Chameleon

Chameleon Commit Details

Date:2015-03-19 13:05:48 (4 years 7 months ago)
Author:ErmaC
Commit:2641
Parents: 2640
Message:DEBUG for ati and fake_efi, typo.
Changes:
M/trunk/i386/libsaio/fake_efi.c
M/trunk/i386/libsaio/nvidia.c
M/trunk/i386/libsaio/device_inject.c
M/trunk/i386/libsaio/ati.c

File differences

trunk/i386/libsaio/device_inject.c
2525
2626
2727
28
29
28
29
3030
3131
3232
uint32_tdevices_number= 1;
uint32_tbuiltin_set= 0;
DevPropString*string= 0;
uint8_t*stringdata= 0;
DevPropString*string= NULL;
uint8_t*stringdata= NULL;
uint32_tstringlength= 0;
char *efi_inject_get_devprop_string(uint32_t *len)
trunk/i386/libsaio/nvidia.c
19151915
19161916
19171917
1918
1918
19191919
19201920
19211921
19221922
1923
19231924
1925
19241926
19251927
19261928
return size > 0 ? size : 0;
}
static int devprop_add_nvidia_template(struct DevPropDevice *device)
static int devprop_add_nvidia_template(DevPropDevice *device)
{
char tmp[16];
if (!device)
{
return 0;
}
if (!DP_ADD_TEMP_VAL(device, nvidia_compatible_0))
{
trunk/i386/libsaio/ati.c
66
77
88
9
10
11
912
13
14
15
16
17
18
1019
1120
1221
......
5463
5564
5665
57
66
5867
5968
60
69
6170
6271
6372
......
10901099
10911100
10921101
1093
1102
10941103
10951104
10961105
......
11801189
11811190
11821191
1183
1192
11841193
11851194
11861195
......
23882397
23892398
23902399
2391
2400
23922401
23932402
23942403
2395
2404
23962405
23972406
23982407
23992408
24002409
24012410
2402
2411
24032412
24042413
24052414
2406
2407
2415
2416
24082417
24092418
24102419
2411
2420
24122421
24132422
24142423
24152424
2416
2425
24172426
24182427
24192428
......
24292438
24302439
24312440
2432
2441
24332442
24342443
24352444
......
24442453
24452454
24462455
2447
2456
24482457
24492458
24502459
......
24572466
24582467
24592468
2460
2461
2469
2470
24622471
24632472
24642473
......
24712480
24722481
24732482
2474
2483
24752484
24762485
24772486
......
25392548
25402549
25412550
2542
2551
25432552
25442553
25452554
*/
#include "ati.h"
#ifndef DEBUG_ATI
#define DEBUG_ATI 0
#endif
#if DEBUG_ATI
#define DBG(x...)printf(x)
#else
#define DBG(x...)msglog(x)
#endif
/* vals */
static value_t aty_name;
static value_t aty_nameparent;
{"Galago",2},
{"Colobus",2},
{"Mangabey",2},
{"Nomascus",4},
{"Nomascus",4}, // 5
{"Orangutan",2},
/* AMD6000Controller */
{"Pithecia",2},
{"Pithecia",2}, // 3
{"Bulrushes",6},
{"Cattail",4},
{"Hydrilla",5},
{ 0x6606,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon HD 8790M",kNull }, // Mobile
{ 0x6607,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R5 M240",kNull }, // Mobile
{ 0x6608,0x00000000, CHIP_FAMILY_OLAND,"AMD FirePro W2100",kNull },
{ 0x6610,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 200 Series",kNull },
{ 0x6610,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 250",kFutomaki },
{ 0x6611,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 200 Series",kNull },
{ 0x6613,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon R7 240",kFutomaki},
//{ 0x6620,0x00000000, CHIP_FAMILY_OLAND,"AMD Radeon", kNull }, // Mobile
{ 0x6798,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7970X/8970/R9 280X",kFutomaki},
{ 0x6799,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7990 Series",kAji},
{ 0x679A,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950/8950/R9 280",kFutomaki},
{ 0x679B,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7900 Series",kFutomaki},
{ 0x679B,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7990 Series",kFutomaki},
{ 0x679E,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7870 XT",kFutomaki},
{ 0x679F,0x00000000, CHIP_FAMILY_TAHITI,"AMD Radeon HD 7950 Series",kFutomaki},
if (card->info == NULL) // Jief
{
verbose("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%04x:%04x] \n",
DBG("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%04x:%04x] \n",
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys.vendor_id, pci_dev->subsys_id.subsys.device_id);
return false;
}
verbose("Found ATI card! Device ID:[%04X:%04X] Subsystem ID:[%08X] - Radeon [%04X:%08X] %s\n",
DBG("Found ATI card! Device ID:[%04X:%04X] Subsystem ID:[%08X] - Radeon [%04X:%08X] %s\n",
pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id, card->info->device_id, card->info->subsys_id, card->info->model_name);
card->fb= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_0) & ~0x0f);
card->mmio= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_2) & ~0x0f);
card->io= (uint8_t *)(pci_config_read32(pci_dev->dev.addr, PCI_BASE_ADDRESS_4) & ~0x03);
verbose("Framebuffer @0x%08X MMIO @0x%08XI/O Port @0x%08X ROM Addr @0x%08X\n",
DBG("Framebuffer @0x%08X MMIO @0x%08XI/O Port @0x%08X ROM Addr @0x%08X\n",
(unsigned) card->fb, (unsigned) card->mmio, (unsigned) card->io, pci_config_read32(pci_dev->dev.addr, PCI_ROM_ADDRESS));
card->posted = radeon_card_posted();
verbose("ATI card %s, ", card->posted ? "POSTed" : "non-POSTed");
verbose("\n");
DBG("ATI card %s, ", card->posted ? "POSTed" : "non-POSTed");
DBG("\n");
get_vram_size();
getBoolForKey(kATYbinimage, &add_vbios, &bootInfo->chameleonConfig);
if (add_vbios)
{
if (!load_vbios_file(kUseAtiROM, pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id))
{
verbose("reading Video BIOS from %s", card->posted ? "legacy space" : "PCI ROM");
DBG("reading Video BIOS from %s", card->posted ? "legacy space" : "PCI ROM");
if (card->posted)
{
read_vbios(false);
if (card->info->chip_family >= CHIP_FAMILY_CEDAR)
{
verbose("ATI Radeon EVERGREEN family\n");
DBG("ATI Radeon EVERGREEN family\n");
card->flags |= EVERGREEN;
}
card->cfg_name = card_configs[card->info->cfg_name].name;
// which means one of the fb's or kNull
verbose("Framebuffer set to device's default: %s\n", card->cfg_name);
DBG("Framebuffer set to device's default: %s\n", card->cfg_name);
}
else
{
// if a value bigger than 0 ?? is found, (do we need >= 0 ?? that's null FB on card_configs)
if (n_ports > 0)
{
card->ports = n_ports; // use it.
verbose("(AtiPorts) # of ports set to: %d\n", card->ports);
card->ports = (uint8_t)n_ports; // use it.
DBG("(AtiPorts) Nr of ports set to: %d\n", card->ports);
}
else
{
}
}
verbose("# of ports set to framebuffer's default: %d\n", card->ports);
DBG("Nr of ports set to framebuffer's default: %d\n", card->ports);
}
stringlength = string->length;
// -------------------------------------------------
verbose("ATI %s %s %dMB (%s) [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
DBG("ATI %s %s %dMB (%s) [%04x:%04x] (subsys [%04x:%04x]):: %s\n",
chip_family_name[card->info->chip_family], card->info->model_name,
(uint32_t)(card->vram_size / (1024 * 1024)), card->cfg_name,
ati_dev->vendor_id, ati_dev->device_id,
trunk/i386/libsaio/fake_efi.c
1818
1919
2020
21
22
23
24
25
26
27
28
29
30
2131
2232
2333
......
764774
765775
766776
767
777
768778
769779
770780
......
811821
812822
813823
814
824
815825
816826
817827
......
890900
891901
892902
893
903
894904
895905
896906
897907
898908
899909
910
900911
901912
902913
903914
904915
905916
917
906918
907919
908920
#include "pci.h"
#include "sl.h"
#ifndef DEBUG_EFI
#define DEBUG_EFI 0
#endif
#if DEBUG_EFI
#define DBG(x...)printf(x)
#else
#define DBG(x...)
#endif
extern void setup_pci_devs(pci_dt_t *pci_dt);
/*
seedBuffer[index] = randomValue;// mov%rax,(%r15,%rsi,8)
}// jb0x17e12
DT__AddProperty(chosenNode, "random-seed", sizeof(seedBuffer), (EFI_UINT32*) &seedBuffer);
DT__AddProperty(chosenNode, "random-seed", sizeof(seedBuffer), (EFI_UINT32 *) &seedBuffer);
}
else
{
} while (index < 64);// cmp%r14d,%r12d
// jne0x17e55(next)
DT__AddProperty(chosenNode, "random-seed", sizeof(seedBuffer), (EFI_UINT8*) &seedBuffer);
DT__AddProperty(chosenNode, "random-seed", sizeof(seedBuffer), (EFI_UINT8 *) &seedBuffer);
}
}
node = DT__FindNode("/efi/platform", false);
if (!node)
{
verbose("/efi/platform node not found\n");
DBG("saveOriginalSMBIOS: '/efi/platform' node not found\n");
return;
}
origeps = getSmbios(SMBIOS_ORIGINAL);
if (!origeps)
{
DBG("saveOriginalSMBIOS: original SMBIOS not found\n");
return;
}
tableAddress = (void *)AllocateKernelMemory(origeps->dmi.tableLength);
if (!tableAddress)
{
DBG("saveOriginalSMBIOS: can not allocate memory for original SMBIOS\n");
return;
}

Archive Download the corresponding diff file

Revision: 2641