Remove dead code and make white space more consistent for acpi_tables.c
Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Myles Watson <mylesgw@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5303 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
@ -59,13 +59,6 @@ static void dump_mem(u32 start, u32 end)
|
|||||||
|
|
||||||
extern const acpi_header_t AmlCode;
|
extern const acpi_header_t AmlCode;
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
extern const acpi_header_t AmlCode_ssdt2;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt3;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt4;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt5;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IO_APIC_ADDR 0xfec00000UL
|
#define IO_APIC_ADDR 0xfec00000UL
|
||||||
|
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current)
|
unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
@ -177,22 +170,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp, madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* SRAT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
|
||||||
srat = (acpi_srat_t *) current;
|
|
||||||
acpi_create_srat(srat);
|
|
||||||
current += srat->header.length;
|
|
||||||
acpi_add_table(rsdp, srat);
|
|
||||||
|
|
||||||
/* SLIT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
|
||||||
slit = (acpi_slit_t *) current;
|
|
||||||
acpi_create_slit(slit);
|
|
||||||
current += slit->header.length;
|
|
||||||
acpi_add_table(rsdp, slit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
@ -201,46 +178,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += ssdt->length;
|
current += ssdt->length;
|
||||||
acpi_add_table(rsdp, ssdt);
|
acpi_add_table(rsdp, ssdt);
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
|
|
||||||
/* same htio, but different position? We may have to copy, change HCIN, and recalculate the checknum and add_table */
|
|
||||||
|
|
||||||
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
|
||||||
if ((sysconf.pci1234[i] & 1) != 1)
|
|
||||||
continue;
|
|
||||||
uint8_t c;
|
|
||||||
if (i < 7) {
|
|
||||||
c = (uint8_t) ('4' + i - 1);
|
|
||||||
} else {
|
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
|
||||||
}
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
|
||||||
current = (current + 0x07) & -0x08;
|
|
||||||
ssdtx = (acpi_header_t *) current;
|
|
||||||
switch (sysconf.hcid[i]) {
|
|
||||||
case 1: /* 8132 */
|
|
||||||
p = &AmlCode_ssdt2;
|
|
||||||
break;
|
|
||||||
case 2: /* 8151 */
|
|
||||||
p = &AmlCode_ssdt3;
|
|
||||||
break;
|
|
||||||
case 3: /* 8131 */
|
|
||||||
p = &AmlCode_ssdt4;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* HTX no io apic */
|
|
||||||
p = &AmlCode_ssdt5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current += p->length;
|
|
||||||
memcpy((void *)ssdtx, p, p->length);
|
|
||||||
update_ssdtx((void *)ssdtx, i);
|
|
||||||
ssdtx->checksum = 0;
|
|
||||||
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
|
||||||
acpi_add_table(rsdp, ssdtx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FACS */
|
/* FACS */
|
||||||
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
||||||
facs = (acpi_facs_t *) current;
|
facs = (acpi_facs_t *) current;
|
||||||
@ -271,12 +208,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_DEBUG, "madt\n");
|
printk(BIOS_DEBUG, "madt\n");
|
||||||
dump_mem(madt, ((void *)madt) + madt->header.length);
|
dump_mem(madt, ((void *)madt) + madt->header.length);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "srat\n");
|
|
||||||
dump_mem(srat, ((void *)srat) + srat->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "slit\n");
|
|
||||||
dump_mem(slit, ((void *)slit) + slit->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ssdt\n");
|
printk(BIOS_DEBUG, "ssdt\n");
|
||||||
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
||||||
|
|
||||||
|
@ -104,21 +104,21 @@ extern void get_bus_conf(void);
|
|||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
||||||
static void update_ssdtx(void *ssdtx, int i)
|
static void update_ssdtx(void *ssdtx, int i)
|
||||||
{
|
{
|
||||||
uint8_t *PCI;
|
u8 *PCI;
|
||||||
uint8_t *HCIN;
|
u8 *HCIN;
|
||||||
uint8_t *UID;
|
u8 *UID;
|
||||||
|
|
||||||
PCI = ssdtx + 0x32;
|
PCI = ssdtx + 0x32;
|
||||||
HCIN = ssdtx + 0x39;
|
HCIN = ssdtx + 0x39;
|
||||||
UID = ssdtx + 0x40;
|
UID = ssdtx + 0x40;
|
||||||
|
|
||||||
if (i < 7) {
|
if (i < 7) {
|
||||||
*PCI = (uint8_t) ('4' + i - 1);
|
*PCI = (u8) ('4' + i - 1);
|
||||||
} else {
|
} else {
|
||||||
*PCI = (uint8_t) ('A' + i - 1 - 6);
|
*PCI = (u8) ('A' + i - 1 - 6);
|
||||||
}
|
}
|
||||||
*HCIN = (uint8_t) i;
|
*HCIN = (u8) i;
|
||||||
*UID = (uint8_t) (i + 3);
|
*UID = (u8) (i + 3);
|
||||||
|
|
||||||
/* FIXME: need to update the GSI id in the ssdtx too */
|
/* FIXME: need to update the GSI id in the ssdtx too */
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
|
|
||||||
get_bus_conf(); /* it will get sblk, pci1234, hcdn, and sbdn */
|
get_bus_conf(); /* it will get sblk, pci1234, hcdn, and sbdn */
|
||||||
|
|
||||||
/* Align ACPI tables to 16byte */
|
/* Align ACPI tables to 16 bytes */
|
||||||
start = (start + 0x0f) & -0x10;
|
start = (start + 0x0f) & -0x10;
|
||||||
current = start;
|
current = start;
|
||||||
|
|
||||||
@ -184,22 +184,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp, madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* SRAT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
|
||||||
srat = (acpi_srat_t *) current;
|
|
||||||
acpi_create_srat(srat);
|
|
||||||
current += srat->header.length;
|
|
||||||
acpi_add_table(rsdp, srat);
|
|
||||||
|
|
||||||
/* SLIT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
|
||||||
slit = (acpi_slit_t *) current;
|
|
||||||
acpi_create_slit(slit);
|
|
||||||
current += slit->header.length;
|
|
||||||
acpi_add_table(rsdp, slit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
@ -215,11 +199,11 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
||||||
if ((sysconf.pci1234[i] & 1) != 1)
|
if ((sysconf.pci1234[i] & 1) != 1)
|
||||||
continue;
|
continue;
|
||||||
uint8_t c;
|
u8 c;
|
||||||
if (i < 7) {
|
if (i < 7) {
|
||||||
c = (uint8_t) ('4' + i - 1);
|
c = (u8) ('4' + i - 1);
|
||||||
} else {
|
} else {
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
c = (u8) ('A' + i - 1 - 6);
|
||||||
}
|
}
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
||||||
current = (current + 0x07) & -0x08;
|
current = (current + 0x07) & -0x08;
|
||||||
@ -278,12 +262,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_DEBUG, "madt\n");
|
printk(BIOS_DEBUG, "madt\n");
|
||||||
dump_mem(madt, ((void *)madt) + madt->header.length);
|
dump_mem(madt, ((void *)madt) + madt->header.length);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "srat\n");
|
|
||||||
dump_mem(srat, ((void *)srat) + srat->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "slit\n");
|
|
||||||
dump_mem(slit, ((void *)slit) + slit->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ssdt\n");
|
printk(BIOS_DEBUG, "ssdt\n");
|
||||||
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
||||||
|
|
||||||
|
@ -36,11 +36,11 @@ static void dump_mem(u32 start, u32 end)
|
|||||||
|
|
||||||
u32 i;
|
u32 i;
|
||||||
print_debug("dump_mem:");
|
print_debug("dump_mem:");
|
||||||
for(i=start;i<end;i++) {
|
for (i = start; i < end; i++) {
|
||||||
if((i & 0xf)==0) {
|
if ((i & 0xf) == 0) {
|
||||||
printk(BIOS_DEBUG, "\n%08x:", i);
|
printk(BIOS_DEBUG, "\n%08x:", i);
|
||||||
}
|
}
|
||||||
printk(BIOS_DEBUG, " %02x", (unsigned char)*((unsigned char *)i));
|
printk(BIOS_DEBUG, " %02x", (u8)*((u8 *)i));
|
||||||
}
|
}
|
||||||
print_debug("\n");
|
print_debug("\n");
|
||||||
}
|
}
|
||||||
@ -104,14 +104,13 @@ static void update_ssdtx(void *ssdtx, int i)
|
|||||||
HCIN = ssdtx + 0x39;
|
HCIN = ssdtx + 0x39;
|
||||||
UID = ssdtx + 0x40;
|
UID = ssdtx + 0x40;
|
||||||
|
|
||||||
if(i<7) {
|
if (i < 7) {
|
||||||
*PCI = (u8) ('4' + i - 1);
|
*PCI = (u8) ('4' + i - 1);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
*PCI = (u8) ('A' + i - 1 - 6);
|
*PCI = (u8) ('A' + i - 1 - 6);
|
||||||
}
|
}
|
||||||
*HCIN = (u8) i;
|
*HCIN = (u8) i;
|
||||||
*UID = (u8) (i+3);
|
*UID = (u8) (i + 3);
|
||||||
|
|
||||||
/* FIXME: need to update the GSI id in the ssdtx too */
|
/* FIXME: need to update the GSI id in the ssdtx too */
|
||||||
|
|
||||||
@ -137,10 +136,10 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
get_bus_conf(); //it will get sblk, pci1234, hcdn, and sbdn
|
get_bus_conf(); /* it will get sblk, pci1234, hcdn, and sbdn */
|
||||||
|
|
||||||
/* Align ACPI tables to 16 bytes */
|
/* Align ACPI tables to 16 bytes */
|
||||||
start = ( start + 0x0f) & -0x10;
|
start = (start + 0x0f) & -0x10;
|
||||||
current = start;
|
current = start;
|
||||||
|
|
||||||
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
|
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
|
||||||
@ -165,31 +164,31 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
hpet = (acpi_hpet_t *) current;
|
hpet = (acpi_hpet_t *) current;
|
||||||
current += sizeof(acpi_hpet_t);
|
current += sizeof(acpi_hpet_t);
|
||||||
acpi_create_hpet(hpet);
|
acpi_create_hpet(hpet);
|
||||||
acpi_add_table(rsdp,hpet);
|
acpi_add_table(rsdp, hpet);
|
||||||
|
|
||||||
/* If we want to use HPET Timers Linux wants an MADT */
|
/* If we want to use HPET Timers Linux wants an MADT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * MADT at %lx\n",current);
|
printk(BIOS_DEBUG, "ACPI: * MADT at %lx\n",current);
|
||||||
madt = (acpi_madt_t *) current;
|
madt = (acpi_madt_t *) current;
|
||||||
acpi_create_madt(madt);
|
acpi_create_madt(madt);
|
||||||
current+=madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp,madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
/* SRAT */
|
/* SRAT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
|
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
|
||||||
srat = (acpi_srat_t *) current;
|
srat = (acpi_srat_t *) current;
|
||||||
acpi_create_srat(srat);
|
acpi_create_srat(srat);
|
||||||
current+=srat->header.length;
|
current += srat->header.length;
|
||||||
acpi_add_table(rsdp,srat);
|
acpi_add_table(rsdp, srat);
|
||||||
|
|
||||||
/* SLIT */
|
/* SLIT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
|
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
|
||||||
slit = (acpi_slit_t *) current;
|
slit = (acpi_slit_t *) current;
|
||||||
acpi_create_slit(slit);
|
acpi_create_slit(slit);
|
||||||
current+=slit->header.length;
|
current += slit->header.length;
|
||||||
acpi_add_table(rsdp,slit);
|
acpi_add_table(rsdp, slit);
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
current = ( current + 0x0f) & -0x10;
|
current = ( current + 0x0f) & -0x10;
|
||||||
@ -209,41 +208,41 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
||||||
|
|
||||||
/* same htio, but different possition? We may have to copy,
|
/* same htio, but different position? We may have to copy,
|
||||||
change HCIN, and recalculate the checknum and add_table */
|
change HCIN, and recalculate the checknum and add_table */
|
||||||
|
|
||||||
for(i=1;i<sysconf.hc_possible_num;i++) { // 0: is hc sblink
|
for(i=1;i<sysconf.hc_possible_num;i++) { // 0: is hc sblink
|
||||||
if((sysconf.pci1234[i] & 1) != 1 ) continue;
|
if((sysconf.pci1234[i] & 1) != 1 ) continue;
|
||||||
u8 c;
|
u8 c;
|
||||||
if(i<7) {
|
if (i < 7) {
|
||||||
c = (u8) ('4' + i - 1);
|
c = (u8) ('4' + i - 1);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
c = (u8) ('A' + i - 1 - 6);
|
c = (u8) ('A' + i - 1 - 6);
|
||||||
}
|
}
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c at %lx\n", c, current); //pci0 and pci1 are in dsdt
|
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c at %lx\n", c, current); //pci0 and pci1 are in dsdt
|
||||||
ssdtx = (acpi_header_t *)current;
|
ssdtx = (acpi_header_t *)current;
|
||||||
switch(sysconf.hcid[i]) {
|
switch (sysconf.hcid[i]) {
|
||||||
case 1:
|
case 1:
|
||||||
p = &AmlCode_ssdt2;
|
p = &AmlCode_ssdt2;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
p = &AmlCode_ssdt3;
|
p = &AmlCode_ssdt3;
|
||||||
break;
|
break;
|
||||||
case 3: //8131
|
case 3: /* 8131 */
|
||||||
p = &AmlCode_ssdt4;
|
p = &AmlCode_ssdt4;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//HTX no io apic
|
/* HTX no io apic */
|
||||||
p = &AmlCode_ssdt5;
|
p = &AmlCode_ssdt5;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
current += ((acpi_header_t *)p)->length;
|
current += p->length;
|
||||||
memcpy((void *)ssdtx, p, p->length);
|
memcpy((void *)ssdtx, p, p->length);
|
||||||
update_ssdtx((void *)ssdtx, i);
|
update_ssdtx((void *)ssdtx, i);
|
||||||
ssdtx->checksum = 0;
|
ssdtx->checksum = 0;
|
||||||
ssdtx->checksum = acpi_checksum((unsigned char *)ssdtx,ssdtx->length);
|
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
||||||
acpi_add_table(rsdp,ssdtx);
|
acpi_add_table(rsdp, ssdtx);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -268,8 +267,8 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
fadt = (acpi_fadt_t *) current;
|
fadt = (acpi_fadt_t *) current;
|
||||||
current += sizeof(acpi_fadt_t);
|
current += sizeof(acpi_fadt_t);
|
||||||
|
|
||||||
acpi_create_fadt(fadt,facs,dsdt);
|
acpi_create_fadt(fadt, facs, dsdt);
|
||||||
acpi_add_table(rsdp,fadt);
|
acpi_add_table(rsdp, fadt);
|
||||||
|
|
||||||
#if DUMP_ACPI_TABLES == 1
|
#if DUMP_ACPI_TABLES == 1
|
||||||
printk(BIOS_DEBUG, "rsdp\n");
|
printk(BIOS_DEBUG, "rsdp\n");
|
||||||
@ -297,4 +296,3 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_INFO, "ACPI: done.\n");
|
printk(BIOS_INFO, "ACPI: done.\n");
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,13 +59,6 @@ static void dump_mem(u32 start, u32 end)
|
|||||||
|
|
||||||
extern const acpi_header_t AmlCode;
|
extern const acpi_header_t AmlCode;
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
extern const acpi_header_t AmlCode_ssdt2;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt3;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt4;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt5;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IO_APIC_ADDR 0xfec00000UL
|
#define IO_APIC_ADDR 0xfec00000UL
|
||||||
|
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current)
|
unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
@ -177,22 +170,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp, madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* SRAT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
|
||||||
srat = (acpi_srat_t *) current;
|
|
||||||
acpi_create_srat(srat);
|
|
||||||
current += srat->header.length;
|
|
||||||
acpi_add_table(rsdp, srat);
|
|
||||||
|
|
||||||
/* SLIT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
|
||||||
slit = (acpi_slit_t *) current;
|
|
||||||
acpi_create_slit(slit);
|
|
||||||
current += slit->header.length;
|
|
||||||
acpi_add_table(rsdp, slit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
@ -201,47 +178,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += ssdt->length;
|
current += ssdt->length;
|
||||||
acpi_add_table(rsdp, ssdt);
|
acpi_add_table(rsdp, ssdt);
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
|
|
||||||
/* same htio, but different position? We may have to copy, change HCIN, and recalculate the checknum and add_table */
|
|
||||||
|
|
||||||
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
|
||||||
if ((sysconf.pci1234[i] & 1) != 1)
|
|
||||||
continue;
|
|
||||||
uint8_t c;
|
|
||||||
if (i < 7) {
|
|
||||||
c = (uint8_t) ('4' + i - 1);
|
|
||||||
} else {
|
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
|
||||||
}
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
|
||||||
current = (current + 0x07) & -0x08;
|
|
||||||
ssdtx = (acpi_header_t *) current;
|
|
||||||
switch (sysconf.hcid[i]) {
|
|
||||||
case 1: /* 8132 */
|
|
||||||
p = &AmlCode_ssdt2;
|
|
||||||
break;
|
|
||||||
case 2: /* 8151 */
|
|
||||||
p = &AmlCode_ssdt3;
|
|
||||||
break;
|
|
||||||
case 3: /* 8131 */
|
|
||||||
p = &AmlCode_ssdt4;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* HTX no io apic */
|
|
||||||
p = &AmlCode_ssdt5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current += ((acpi_header_t *) p)->length;
|
|
||||||
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *) p)->length);
|
|
||||||
update_ssdtx((void *)ssdtx, i);
|
|
||||||
ssdtx->checksum = 0;
|
|
||||||
ssdtx->checksum =
|
|
||||||
acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
|
||||||
acpi_add_table(rsdp, ssdtx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FACS */
|
/* FACS */
|
||||||
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
||||||
facs = (acpi_facs_t *) current;
|
facs = (acpi_facs_t *) current;
|
||||||
@ -273,12 +209,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_DEBUG, "madt\n");
|
printk(BIOS_DEBUG, "madt\n");
|
||||||
dump_mem(madt, ((void *)madt) + madt->header.length);
|
dump_mem(madt, ((void *)madt) + madt->header.length);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "srat\n");
|
|
||||||
dump_mem(srat, ((void *)srat) + srat->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "slit\n");
|
|
||||||
dump_mem(slit, ((void *)slit) + slit->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ssdt\n");
|
printk(BIOS_DEBUG, "ssdt\n");
|
||||||
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@
|
|||||||
#define DUMP_ACPI_TABLES 0
|
#define DUMP_ACPI_TABLES 0
|
||||||
|
|
||||||
#if DUMP_ACPI_TABLES == 1
|
#if DUMP_ACPI_TABLES == 1
|
||||||
static void dump_mem(unsigned start, unsigned end)
|
static void dump_mem(u32 start, u32 end)
|
||||||
{
|
{
|
||||||
|
|
||||||
unsigned i;
|
u32 i;
|
||||||
print_debug("dump_mem:");
|
print_debug("dump_mem:");
|
||||||
for(i=start;i<end;i++) {
|
for(i=start;i<end;i++) {
|
||||||
if((i & 0xf)==0) {
|
if((i & 0xf)==0) {
|
||||||
@ -35,7 +35,7 @@ static void dump_mem(unsigned start, unsigned end)
|
|||||||
printk(BIOS_DEBUG, " %02x", (unsigned char)*((unsigned char *)i));
|
printk(BIOS_DEBUG, " %02x", (unsigned char)*((unsigned char *)i));
|
||||||
}
|
}
|
||||||
print_debug("\n");
|
print_debug("\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern const acpi_header_t AmlCode;
|
extern const acpi_header_t AmlCode;
|
||||||
@ -55,7 +55,7 @@ unsigned long acpi_fill_mcfg(unsigned long current)
|
|||||||
|
|
||||||
unsigned long acpi_fill_madt(unsigned long current)
|
unsigned long acpi_fill_madt(unsigned long current)
|
||||||
{
|
{
|
||||||
unsigned int gsi_base=0x18;
|
u32 gsi_base=0x18;
|
||||||
|
|
||||||
struct mb_sysconf_t *m;
|
struct mb_sysconf_t *m;
|
||||||
|
|
||||||
@ -96,10 +96,9 @@ unsigned long acpi_fill_madt(unsigned long current)
|
|||||||
int j = 0;
|
int j = 0;
|
||||||
|
|
||||||
for(i=1; i< sysconf.hc_possible_num; i++) {
|
for(i=1; i< sysconf.hc_possible_num; i++) {
|
||||||
unsigned d;
|
u32 d = 0;
|
||||||
if(!(sysconf.pci1234[i] & 0x1) ) continue;
|
if(!(sysconf.pci1234[i] & 0x1) ) continue;
|
||||||
// 8131 need to use +4
|
// 8131 need to use +4
|
||||||
|
|
||||||
switch (sysconf.hcid[i]) {
|
switch (sysconf.hcid[i]) {
|
||||||
case 1:
|
case 1:
|
||||||
d = 7;
|
d = 7;
|
||||||
@ -132,10 +131,8 @@ unsigned long acpi_fill_madt(unsigned long current)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
current += acpi_create_madt_irqoverride( (acpi_madt_irqoverride_t *)
|
current += acpi_create_madt_irqoverride( (acpi_madt_irqoverride_t *)
|
||||||
@ -150,7 +147,6 @@ unsigned long acpi_fill_madt(unsigned long current)
|
|||||||
current = acpi_create_madt_lapic_nmis(current, 5, 1);
|
current = acpi_create_madt_lapic_nmis(current, 5, 1);
|
||||||
/* 1: LINT1 connect to NMI */
|
/* 1: LINT1 connect to NMI */
|
||||||
|
|
||||||
|
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -158,22 +154,22 @@ extern void get_bus_conf(void);
|
|||||||
|
|
||||||
static void update_ssdtx(void *ssdtx, int i)
|
static void update_ssdtx(void *ssdtx, int i)
|
||||||
{
|
{
|
||||||
uint8_t *PCI;
|
u8 *PCI;
|
||||||
uint8_t *HCIN;
|
u8 *HCIN;
|
||||||
uint8_t *UID;
|
u8 *UID;
|
||||||
|
|
||||||
PCI = ssdtx + 0x32;
|
PCI = ssdtx + 0x32;
|
||||||
HCIN = ssdtx + 0x39;
|
HCIN = ssdtx + 0x39;
|
||||||
UID = ssdtx + 0x40;
|
UID = ssdtx + 0x40;
|
||||||
|
|
||||||
if(i<7) {
|
if(i<7) {
|
||||||
*PCI = (uint8_t) ('4' + i - 1);
|
*PCI = (u8) ('4' + i - 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*PCI = (uint8_t) ('A' + i - 1 - 6);
|
*PCI = (u8) ('A' + i - 1 - 6);
|
||||||
}
|
}
|
||||||
*HCIN = (uint8_t) i;
|
*HCIN = (u8) i;
|
||||||
*UID = (uint8_t) (i+3);
|
*UID = (u8) (i+3);
|
||||||
|
|
||||||
/* FIXME: need to update the GSI id in the ssdtx too */
|
/* FIXME: need to update the GSI id in the ssdtx too */
|
||||||
|
|
||||||
@ -204,8 +200,8 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
|
|
||||||
get_bus_conf(); //it will get sblk, pci1234, hcdn, and sbdn
|
get_bus_conf(); //it will get sblk, pci1234, hcdn, and sbdn
|
||||||
|
|
||||||
/* Align ACPI tables to 16byte */
|
/* Align ACPI tables to 16 bytes */
|
||||||
start = ( start + 0x0f ) & -0x10;
|
start = ( start + 0x0f) & -0x10;
|
||||||
current = start;
|
current = start;
|
||||||
|
|
||||||
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
|
printk(BIOS_INFO, "ACPI: Writing ACPI tables at %lx...\n", start);
|
||||||
@ -225,36 +221,35 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
/*
|
/*
|
||||||
* We explicitly add these tables later on:
|
* We explicitly add these tables later on:
|
||||||
*/
|
*/
|
||||||
printk(BIOS_DEBUG, "ACPI: * HPET\n");
|
printk(BIOS_DEBUG, "ACPI: * HPET at %lx\n", current);
|
||||||
hpet = (acpi_hpet_t *) current;
|
hpet = (acpi_hpet_t *) current;
|
||||||
current += sizeof(acpi_hpet_t);
|
current += sizeof(acpi_hpet_t);
|
||||||
acpi_create_hpet(hpet);
|
acpi_create_hpet(hpet);
|
||||||
acpi_add_table(rsdp,hpet);
|
acpi_add_table(rsdp, hpet);
|
||||||
|
|
||||||
/* If we want to use HPET Timers Linux wants an MADT */
|
/* If we want to use HPET Timers Linux wants an MADT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * MADT\n");
|
printk(BIOS_DEBUG, "ACPI: * MADT at %lx\n", current);
|
||||||
madt = (acpi_madt_t *) current;
|
madt = (acpi_madt_t *) current;
|
||||||
acpi_create_madt(madt);
|
acpi_create_madt(madt);
|
||||||
current+=madt->header.length;
|
current+=madt->header.length;
|
||||||
acpi_add_table(rsdp,madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
|
|
||||||
/* SRAT */
|
/* SRAT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
printk(BIOS_DEBUG, "ACPI: * SRAT at %lx\n", current);
|
||||||
srat = (acpi_srat_t *) current;
|
srat = (acpi_srat_t *) current;
|
||||||
acpi_create_srat(srat);
|
acpi_create_srat(srat);
|
||||||
current+=srat->header.length;
|
current+=srat->header.length;
|
||||||
acpi_add_table(rsdp,srat);
|
acpi_add_table(rsdp, srat);
|
||||||
|
|
||||||
/* SLIT */
|
/* SLIT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
printk(BIOS_DEBUG, "ACPI: * SLIT at %lx\n", current);
|
||||||
slit = (acpi_slit_t *) current;
|
slit = (acpi_slit_t *) current;
|
||||||
acpi_create_slit(slit);
|
acpi_create_slit(slit);
|
||||||
current+=slit->header.length;
|
current+=slit->header.length;
|
||||||
acpi_add_table(rsdp,slit);
|
acpi_add_table(rsdp, slit);
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
|
|
||||||
acpi_create_ssdt_generator(ssdt, "DYNADATA");
|
acpi_create_ssdt_generator(ssdt, "DYNADATA");
|
||||||
@ -267,15 +262,15 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
|
|
||||||
for(i=1;i<sysconf.hc_possible_num;i++) { // 0: is hc sblink
|
for(i=1;i<sysconf.hc_possible_num;i++) { // 0: is hc sblink
|
||||||
if((sysconf.pci1234[i] & 1) != 1 ) continue;
|
if((sysconf.pci1234[i] & 1) != 1 ) continue;
|
||||||
uint8_t c;
|
u8 c;
|
||||||
if(i<7) {
|
if(i<7) {
|
||||||
c = (uint8_t) ('4' + i - 1);
|
c = (u8) ('4' + i - 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
c = (u8) ('A' + i - 1 - 6);
|
||||||
}
|
}
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); //pci0 and pci1 are in dsdt
|
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
|
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); //pci0 and pci1 are in dsdt
|
||||||
ssdtx = (acpi_header_t *)current;
|
ssdtx = (acpi_header_t *)current;
|
||||||
switch(sysconf.hcid[i]) {
|
switch(sysconf.hcid[i]) {
|
||||||
case 1: //8132
|
case 1: //8132
|
||||||
@ -290,12 +285,12 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
default:
|
default:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
current += ((acpi_header_t *)p)->length;
|
current += p->length;
|
||||||
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *)p)->length);
|
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *)p)->length);
|
||||||
update_ssdtx((void *)ssdtx, i);
|
update_ssdtx((void *)ssdtx, i);
|
||||||
ssdtx->checksum = 0;
|
ssdtx->checksum = 0;
|
||||||
ssdtx->checksum = acpi_checksum((unsigned char *)ssdtx,ssdtx->length);
|
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
||||||
acpi_add_table(rsdp,ssdtx);
|
acpi_add_table(rsdp, ssdtx);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -306,19 +301,19 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
acpi_create_facs(facs);
|
acpi_create_facs(facs);
|
||||||
|
|
||||||
/* DSDT */
|
/* DSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current);
|
||||||
dsdt = (acpi_header_t *)current;
|
dsdt = (acpi_header_t *)current;
|
||||||
current += AmlCode.length;
|
current += AmlCode.length;
|
||||||
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
|
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
|
||||||
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
|
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
|
||||||
|
|
||||||
/* FDAT */
|
/* FDAT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * FADT\n");
|
printk(BIOS_DEBUG, "ACPI: * FADT at %lx\n", current);
|
||||||
fadt = (acpi_fadt_t *) current;
|
fadt = (acpi_fadt_t *) current;
|
||||||
current += sizeof(acpi_fadt_t);
|
current += sizeof(acpi_fadt_t);
|
||||||
|
|
||||||
acpi_create_fadt(fadt,facs,dsdt);
|
acpi_create_fadt(fadt, facs, dsdt);
|
||||||
acpi_add_table(rsdp,fadt);
|
acpi_add_table(rsdp, fadt);
|
||||||
|
|
||||||
#if DUMP_ACPI_TABLES == 1
|
#if DUMP_ACPI_TABLES == 1
|
||||||
printk(BIOS_DEBUG, "rsdp\n");
|
printk(BIOS_DEBUG, "rsdp\n");
|
||||||
|
@ -108,7 +108,6 @@ unsigned long acpi_fill_madt(unsigned long current)
|
|||||||
|
|
||||||
for(i=1; i< sysconf.hc_possible_num; i++) {
|
for(i=1; i< sysconf.hc_possible_num; i++) {
|
||||||
u32 d = 0;
|
u32 d = 0;
|
||||||
|
|
||||||
if(!(sysconf.pci1234[i] & 0x1) ) continue;
|
if(!(sysconf.pci1234[i] & 0x1) ) continue;
|
||||||
// 8131 need to use +4
|
// 8131 need to use +4
|
||||||
switch (sysconf.hcid[i]) {
|
switch (sysconf.hcid[i]) {
|
||||||
@ -164,7 +163,6 @@ unsigned long acpi_fill_madt(unsigned long current)
|
|||||||
extern void get_bus_conf(void);
|
extern void get_bus_conf(void);
|
||||||
extern void update_ssdt(void *ssdt);
|
extern void update_ssdt(void *ssdt);
|
||||||
|
|
||||||
|
|
||||||
static void update_ssdtx(void *ssdtx, int i)
|
static void update_ssdtx(void *ssdtx, int i)
|
||||||
{
|
{
|
||||||
u8 *PCI;
|
u8 *PCI;
|
||||||
@ -234,15 +232,15 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
hpet = (acpi_hpet_t *) current;
|
hpet = (acpi_hpet_t *) current;
|
||||||
current += sizeof(acpi_hpet_t);
|
current += sizeof(acpi_hpet_t);
|
||||||
acpi_create_hpet(hpet);
|
acpi_create_hpet(hpet);
|
||||||
acpi_add_table(rsdp,hpet);
|
acpi_add_table(rsdp, hpet);
|
||||||
|
|
||||||
/* If we want to use HPET Timers Linux wants an MADT */
|
/* If we want to use HPET Timers Linux wants an MADT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * MADT at %lx\n",current);
|
printk(BIOS_DEBUG, "ACPI: * MADT at %lx\n", current);
|
||||||
madt = (acpi_madt_t *) current;
|
madt = (acpi_madt_t *) current;
|
||||||
acpi_create_madt(madt);
|
acpi_create_madt(madt);
|
||||||
current+=madt->header.length;
|
current+=madt->header.length;
|
||||||
acpi_add_table(rsdp,madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
/* SRAT */
|
/* SRAT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
@ -250,7 +248,7 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
srat = (acpi_srat_t *) current;
|
srat = (acpi_srat_t *) current;
|
||||||
acpi_create_srat(srat);
|
acpi_create_srat(srat);
|
||||||
current+=srat->header.length;
|
current+=srat->header.length;
|
||||||
acpi_add_table(rsdp,srat);
|
acpi_add_table(rsdp, srat);
|
||||||
|
|
||||||
/* SLIT */
|
/* SLIT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
@ -258,7 +256,7 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
slit = (acpi_slit_t *) current;
|
slit = (acpi_slit_t *) current;
|
||||||
acpi_create_slit(slit);
|
acpi_create_slit(slit);
|
||||||
current+=slit->header.length;
|
current+=slit->header.length;
|
||||||
acpi_add_table(rsdp,slit);
|
acpi_add_table(rsdp, slit);
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
current = ( current + 0x0f) & -0x10;
|
current = ( current + 0x0f) & -0x10;
|
||||||
@ -270,8 +268,8 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
update_ssdt((void*)ssdt);
|
update_ssdt((void*)ssdt);
|
||||||
/* recalculate checksum */
|
/* recalculate checksum */
|
||||||
ssdt->checksum = 0;
|
ssdt->checksum = 0;
|
||||||
ssdt->checksum = acpi_checksum((unsigned char *)ssdt,ssdt->length);
|
ssdt->checksum = acpi_checksum((unsigned char *)ssdt, ssdt->length);
|
||||||
acpi_add_table(rsdp,ssdt);
|
acpi_add_table(rsdp, ssdt);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PState at %lx\n", current);
|
printk(BIOS_DEBUG, "ACPI: * SSDT for PState at %lx\n", current);
|
||||||
current = acpi_add_ssdt_pstates(rsdp, current);
|
current = acpi_add_ssdt_pstates(rsdp, current);
|
||||||
@ -319,7 +317,7 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
/* DSDT */
|
/* DSDT */
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current);
|
printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current);
|
||||||
dsdt = (acpi_header_t *)current; // it will used by fadt
|
dsdt = (acpi_header_t *)current;
|
||||||
current += AmlCode.length;
|
current += AmlCode.length;
|
||||||
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
|
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
|
||||||
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
|
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
|
||||||
@ -327,7 +325,7 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
/* FACS */ // it needs 64 bit alignment
|
/* FACS */ // it needs 64 bit alignment
|
||||||
current = ( current + 0x07) & -0x08;
|
current = ( current + 0x07) & -0x08;
|
||||||
printk(BIOS_DEBUG, "ACPI: * FACS at %lx\n", current);
|
printk(BIOS_DEBUG, "ACPI: * FACS at %lx\n", current);
|
||||||
facs = (acpi_facs_t *) current; // it will be used by fadt
|
facs = (acpi_facs_t *) current;
|
||||||
current += sizeof(acpi_facs_t);
|
current += sizeof(acpi_facs_t);
|
||||||
acpi_create_facs(facs);
|
acpi_create_facs(facs);
|
||||||
|
|
||||||
@ -337,8 +335,8 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
fadt = (acpi_fadt_t *) current;
|
fadt = (acpi_fadt_t *) current;
|
||||||
current += sizeof(acpi_fadt_t);
|
current += sizeof(acpi_fadt_t);
|
||||||
|
|
||||||
acpi_create_fadt(fadt,facs,dsdt);
|
acpi_create_fadt(fadt, facs, dsdt);
|
||||||
acpi_add_table(rsdp,fadt);
|
acpi_add_table(rsdp, fadt);
|
||||||
|
|
||||||
#if DUMP_ACPI_TABLES == 1
|
#if DUMP_ACPI_TABLES == 1
|
||||||
printk(BIOS_DEBUG, "rsdp\n");
|
printk(BIOS_DEBUG, "rsdp\n");
|
||||||
|
@ -59,13 +59,6 @@ static void dump_mem(u32 start, u32 end)
|
|||||||
|
|
||||||
extern const acpi_header_t AmlCode;
|
extern const acpi_header_t AmlCode;
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
extern const acpi_header_t AmlCode_ssdt2;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt3;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt4;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt5;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IO_APIC_ADDR 0xfec00000UL
|
#define IO_APIC_ADDR 0xfec00000UL
|
||||||
|
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current)
|
unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
@ -177,22 +170,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp, madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* SRAT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
|
||||||
srat = (acpi_srat_t *) current;
|
|
||||||
acpi_create_srat(srat);
|
|
||||||
current += srat->header.length;
|
|
||||||
acpi_add_table(rsdp, srat);
|
|
||||||
|
|
||||||
/* SLIT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
|
||||||
slit = (acpi_slit_t *) current;
|
|
||||||
acpi_create_slit(slit);
|
|
||||||
current += slit->header.length;
|
|
||||||
acpi_add_table(rsdp, slit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
@ -201,47 +178,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += ssdt->length;
|
current += ssdt->length;
|
||||||
acpi_add_table(rsdp, ssdt);
|
acpi_add_table(rsdp, ssdt);
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
|
|
||||||
/* same htio, but different position? We may have to copy, change HCIN, and recalculate the checknum and add_table */
|
|
||||||
|
|
||||||
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
|
||||||
if ((sysconf.pci1234[i] & 1) != 1)
|
|
||||||
continue;
|
|
||||||
uint8_t c;
|
|
||||||
if (i < 7) {
|
|
||||||
c = (uint8_t) ('4' + i - 1);
|
|
||||||
} else {
|
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
|
||||||
}
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
|
||||||
current = (current + 0x07) & -0x08;
|
|
||||||
ssdtx = (acpi_header_t *) current;
|
|
||||||
switch (sysconf.hcid[i]) {
|
|
||||||
case 1: /* 8132 */
|
|
||||||
p = &AmlCode_ssdt2;
|
|
||||||
break;
|
|
||||||
case 2: /* 8151 */
|
|
||||||
p = &AmlCode_ssdt3;
|
|
||||||
break;
|
|
||||||
case 3: /* 8131 */
|
|
||||||
p = &AmlCode_ssdt4;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* HTX no io apic */
|
|
||||||
p = &AmlCode_ssdt5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current += ((acpi_header_t *) p)->length;
|
|
||||||
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *) p)->length);
|
|
||||||
update_ssdtx((void *)ssdtx, i);
|
|
||||||
ssdtx->checksum = 0;
|
|
||||||
ssdtx->checksum =
|
|
||||||
acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
|
||||||
acpi_add_table(rsdp, ssdtx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FACS */
|
/* FACS */
|
||||||
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
||||||
facs = (acpi_facs_t *) current;
|
facs = (acpi_facs_t *) current;
|
||||||
@ -272,12 +208,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_DEBUG, "madt\n");
|
printk(BIOS_DEBUG, "madt\n");
|
||||||
dump_mem(madt, ((void *)madt) + madt->header.length);
|
dump_mem(madt, ((void *)madt) + madt->header.length);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "srat\n");
|
|
||||||
dump_mem(srat, ((void *)srat) + srat->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "slit\n");
|
|
||||||
dump_mem(slit, ((void *)slit) + slit->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ssdt\n");
|
printk(BIOS_DEBUG, "ssdt\n");
|
||||||
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
||||||
|
|
||||||
|
@ -37,11 +37,6 @@ config DCACHE_RAM_GLOBAL_VAR_SIZE
|
|||||||
default 0x04000
|
default 0x04000
|
||||||
depends on BOARD_MSI_MS9652_FAM10
|
depends on BOARD_MSI_MS9652_FAM10
|
||||||
|
|
||||||
config CONFIG_ACPI_SSDTX_NUM
|
|
||||||
hex
|
|
||||||
default 0x1F
|
|
||||||
depends on BOARD_MSI_MS9652_FAM10
|
|
||||||
|
|
||||||
config GENERATE_PIRQ_TABLE
|
config GENERATE_PIRQ_TABLE
|
||||||
bool
|
bool
|
||||||
default y
|
default y
|
||||||
|
@ -59,13 +59,6 @@ static void dump_mem(u32 start, u32 end)
|
|||||||
|
|
||||||
extern const acpi_header_t AmlCode;
|
extern const acpi_header_t AmlCode;
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
extern const acpi_header_t AmlCode_ssdt2;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt3;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt4;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt5;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IO_APIC_ADDR 0xfec00000UL
|
#define IO_APIC_ADDR 0xfec00000UL
|
||||||
|
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current)
|
unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
@ -177,22 +170,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp, madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* SRAT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
|
||||||
srat = (acpi_srat_t *) current;
|
|
||||||
acpi_create_srat(srat);
|
|
||||||
current += srat->header.length;
|
|
||||||
acpi_add_table(rsdp, srat);
|
|
||||||
|
|
||||||
/* SLIT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
|
||||||
slit = (acpi_slit_t *) current;
|
|
||||||
acpi_create_slit(slit);
|
|
||||||
current += slit->header.length;
|
|
||||||
acpi_add_table(rsdp, slit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
@ -201,47 +178,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += ssdt->length;
|
current += ssdt->length;
|
||||||
acpi_add_table(rsdp, ssdt);
|
acpi_add_table(rsdp, ssdt);
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
|
|
||||||
/* same htio, but different position? We may have to copy, change HCIN, and recalculate the checknum and add_table */
|
|
||||||
|
|
||||||
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
|
||||||
if ((sysconf.pci1234[i] & 1) != 1)
|
|
||||||
continue;
|
|
||||||
uint8_t c;
|
|
||||||
if (i < 7) {
|
|
||||||
c = (uint8_t) ('4' + i - 1);
|
|
||||||
} else {
|
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
|
||||||
}
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
|
||||||
current = (current + 0x07) & -0x08;
|
|
||||||
ssdtx = (acpi_header_t *) current;
|
|
||||||
switch (sysconf.hcid[i]) {
|
|
||||||
case 1: /* 8132 */
|
|
||||||
p = &AmlCode_ssdt2;
|
|
||||||
break;
|
|
||||||
case 2: /* 8151 */
|
|
||||||
p = &AmlCode_ssdt3;
|
|
||||||
break;
|
|
||||||
case 3: /* 8131 */
|
|
||||||
p = &AmlCode_ssdt4;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* HTX no io apic */
|
|
||||||
p = &AmlCode_ssdt5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current += ((acpi_header_t *) p)->length;
|
|
||||||
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *) p)->length);
|
|
||||||
update_ssdtx((void *)ssdtx, i);
|
|
||||||
ssdtx->checksum = 0;
|
|
||||||
ssdtx->checksum =
|
|
||||||
acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
|
||||||
acpi_add_table(rsdp, ssdtx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FACS */
|
/* FACS */
|
||||||
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
||||||
facs = (acpi_facs_t *) current;
|
facs = (acpi_facs_t *) current;
|
||||||
@ -272,12 +208,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_DEBUG, "madt\n");
|
printk(BIOS_DEBUG, "madt\n");
|
||||||
dump_mem(madt, ((void *)madt) + madt->header.length);
|
dump_mem(madt, ((void *)madt) + madt->header.length);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "srat\n");
|
|
||||||
dump_mem(srat, ((void *)srat) + srat->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "slit\n");
|
|
||||||
dump_mem(slit, ((void *)slit) + slit->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ssdt\n");
|
printk(BIOS_DEBUG, "ssdt\n");
|
||||||
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
||||||
|
|
||||||
|
@ -59,13 +59,6 @@ static void dump_mem(u32 start, u32 end)
|
|||||||
|
|
||||||
extern const acpi_header_t AmlCode;
|
extern const acpi_header_t AmlCode;
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
extern const acpi_header_t AmlCode_ssdt2;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt3;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt4;
|
|
||||||
extern const acpi_header_t AmlCode_ssdt5;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IO_APIC_ADDR 0xfec00000UL
|
#define IO_APIC_ADDR 0xfec00000UL
|
||||||
|
|
||||||
unsigned long acpi_fill_mcfg(unsigned long current)
|
unsigned long acpi_fill_mcfg(unsigned long current)
|
||||||
@ -177,22 +170,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += madt->header.length;
|
current += madt->header.length;
|
||||||
acpi_add_table(rsdp, madt);
|
acpi_add_table(rsdp, madt);
|
||||||
|
|
||||||
#if 0
|
|
||||||
/* SRAT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SRAT\n");
|
|
||||||
srat = (acpi_srat_t *) current;
|
|
||||||
acpi_create_srat(srat);
|
|
||||||
current += srat->header.length;
|
|
||||||
acpi_add_table(rsdp, srat);
|
|
||||||
|
|
||||||
/* SLIT */
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SLIT\n");
|
|
||||||
slit = (acpi_slit_t *) current;
|
|
||||||
acpi_create_slit(slit);
|
|
||||||
current += slit->header.length;
|
|
||||||
acpi_add_table(rsdp, slit);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* SSDT */
|
/* SSDT */
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
|
||||||
ssdt = (acpi_header_t *)current;
|
ssdt = (acpi_header_t *)current;
|
||||||
@ -201,47 +178,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
current += ssdt->length;
|
current += ssdt->length;
|
||||||
acpi_add_table(rsdp, ssdt);
|
acpi_add_table(rsdp, ssdt);
|
||||||
|
|
||||||
#if CONFIG_ACPI_SSDTX_NUM >= 1
|
|
||||||
|
|
||||||
/* same htio, but different position? We may have to copy, change HCIN, and recalculate the checknum and add_table */
|
|
||||||
|
|
||||||
for (i = 1; i < sysconf.hc_possible_num; i++) { /* 0: is hc sblink */
|
|
||||||
if ((sysconf.pci1234[i] & 1) != 1)
|
|
||||||
continue;
|
|
||||||
uint8_t c;
|
|
||||||
if (i < 7) {
|
|
||||||
c = (uint8_t) ('4' + i - 1);
|
|
||||||
} else {
|
|
||||||
c = (uint8_t) ('A' + i - 1 - 6);
|
|
||||||
}
|
|
||||||
printk(BIOS_DEBUG, "ACPI: * SSDT for PCI%c Aka hcid = %d\n", c, sysconf.hcid[i]); /* pci0 and pci1 are in dsdt */
|
|
||||||
current = (current + 0x07) & -0x08;
|
|
||||||
ssdtx = (acpi_header_t *) current;
|
|
||||||
switch (sysconf.hcid[i]) {
|
|
||||||
case 1: /* 8132 */
|
|
||||||
p = &AmlCode_ssdt2;
|
|
||||||
break;
|
|
||||||
case 2: /* 8151 */
|
|
||||||
p = &AmlCode_ssdt3;
|
|
||||||
break;
|
|
||||||
case 3: /* 8131 */
|
|
||||||
p = &AmlCode_ssdt4;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
/* HTX no io apic */
|
|
||||||
p = &AmlCode_ssdt5;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
current += ((acpi_header_t *) p)->length;
|
|
||||||
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *) p)->length);
|
|
||||||
update_ssdtx((void *)ssdtx, i);
|
|
||||||
ssdtx->checksum = 0;
|
|
||||||
ssdtx->checksum =
|
|
||||||
acpi_checksum((u8 *)ssdtx, ssdtx->length);
|
|
||||||
acpi_add_table(rsdp, ssdtx);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* FACS */
|
/* FACS */
|
||||||
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
printk(BIOS_DEBUG, "ACPI: * FACS\n");
|
||||||
facs = (acpi_facs_t *) current;
|
facs = (acpi_facs_t *) current;
|
||||||
@ -272,12 +208,6 @@ unsigned long write_acpi_tables(unsigned long start)
|
|||||||
printk(BIOS_DEBUG, "madt\n");
|
printk(BIOS_DEBUG, "madt\n");
|
||||||
dump_mem(madt, ((void *)madt) + madt->header.length);
|
dump_mem(madt, ((void *)madt) + madt->header.length);
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "srat\n");
|
|
||||||
dump_mem(srat, ((void *)srat) + srat->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "slit\n");
|
|
||||||
dump_mem(slit, ((void *)slit) + slit->header.length);
|
|
||||||
|
|
||||||
printk(BIOS_DEBUG, "ssdt\n");
|
printk(BIOS_DEBUG, "ssdt\n");
|
||||||
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
dump_mem(ssdt, ((void *)ssdt) + ssdt->length);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user