Chameleon

Chameleon Commit Details

Date:2010-01-31 19:14:02 (14 years 2 months ago)
Author:Rekursor
Commit:55
Parents: 54
Message:Imported missing pcefi10.5 improvements, Fixed a bug in nvidia.c
Changes:
M/branches/rekursor/i386/libsaio/dsdt_patcher.c
M/branches/rekursor/i386/libsaio/platform.c
M/branches/rekursor/i386/libsaio/nvidia.c
M/branches/rekursor/i386/libsaio/pci.c
M/branches/rekursor/i386/libsaio/pci_root.c

File differences

branches/rekursor/i386/libsaio/pci_root.c
6363
6464
6565
66
66
6767
6868
6969
......
107107
108108
109109
110
111
112
113
110
111
112
113
114
115
114116
115117
116
118
117119
118120
}
goto out;
}
#if 0
#if 1
/* Chameleon compatibility */
if (getValueForKey("PciRoot", &val, &len, &bootInfo->bootConfig)) {
if (isdigit(val[0])) {
dsdt_uid = findpciroot(new_dsdt, fsize);
free(new_dsdt);
if (dsdt_uid >= 0 && dsdt_uid <= 9) {
rootuid = dsdt_uid;
} else {
verbose("Could not determine PCI-Root-UID value from DSDT!\n");
if(dsdt_uid == 11) dsdt_uid=0; //usually when _UID isnt present, it means uid is zero
else if (dsdt_uid < 0 || dsdt_uid > 9)
{
printf("PciRoot uid value wasnt found, using 0, if you want it to be 1, use -PciRootUID flag");
dsdt_uid = 0;
//if(dsdt_uid == 10) //algo failed, PCI0 wasnt found
}
out:
verbose("Using PCI-Root-UID value %d\n", rootuid);
verbose("Using PCI-Root-UID value: %d\n", rootuid);
return rootuid;
}
branches/rekursor/i386/libsaio/dsdt_patcher.c
1212
1313
1414
15
15
1616
1717
1818
#include "platform.h"
#ifndef DEBUG_DSDT
#define DEBUG_DSDT 0
#define DEBUG_DSDT 1
#endif
#if DEBUG_DSDT==2
branches/rekursor/i386/libsaio/nvidia.c
613613
614614
615615
616
617
616
617
618
619
618620
619621
620622
return 0;
if(!DP_ADD_TEMP_VAL(device, nvidia_device_type))
return 0;
len = sprintf(tmp, "Slot-%x", devices_number);
devprop_add_value(device, "AAPL,slot-name", (uint8_t *)tmp, len + 1);
// Rek : Dont use sprintf return, it does not WORK !! our custom sprintf() always return 0!
// len = sprintf(tmp, "Slot-%x", devices_number);
sprintf(tmp, "Slot-%x",devices_number);
devprop_add_value(device, "AAPL,slot-name", tmp, strlen(tmp));
devices_number++;
return 1;
branches/rekursor/i386/libsaio/platform.c
3636
3737
3838
39
40
41
4239
4340
4441
void scan_platform(void)
{
const char*value;
intlen;
memset(&Platform, 0, sizeof(Platform));
build_pci_dt();
scan_cpu(&Platform);
branches/rekursor/i386/libsaio/pci.c
109109
110110
111111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
112130
113131
114132
115133
134
116135
117136
118137
}
}
void enable_pci_devs(void)
{
uint16_t id;
uint32_t rcba, *fd;
id = pci_config_read16(PCIADDR(0, 0x00, 0), 0x00);
/* make sure we're on Intel chipset */
if (id != 0x8086)
return;
rcba = pci_config_read32(PCIADDR(0, 0x1f, 0), 0xf0) & ~1;
fd = (uint32_t *)(rcba + 0x3418);
/* set SMBus Disable (SD) to 0 */
*fd &= ~0x8;
/* and all devices? */
//*fd = 0x1;
}
void build_pci_dt(void)
{
root_pci_dev = malloc(sizeof(pci_dt_t));
bzero(root_pci_dev, sizeof(pci_dt_t));
enable_pci_devs();
scan_pci_bus(root_pci_dev, 0);
#if DEBUG_PCI
dump_pci_dt(root_pci_dev->children);

Archive Download the corresponding diff file

Revision: 55