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:
Myles Watson
2010-03-26 18:31:12 +00:00
parent 723c270211
commit 9417cc05fc
10 changed files with 215 additions and 600 deletions

View File

@ -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);

View File

@ -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 */
@ -148,9 +148,9 @@ 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 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);

View File

@ -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;
} }

View File

@ -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);

View File

@ -23,19 +23,19 @@
#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) {
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", (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,102 +55,98 @@ 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;
m = sysconf.mb;
m = sysconf.mb;
/* create all subtables for processors */ /* create all subtables for processors */
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* Write 8111 IOAPIC */ /* Write 8111 IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8111, current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8111,
IO_APIC_ADDR, 0); IO_APIC_ADDR, 0);
/* Write all 8131 IOAPICs */ /* Write all 8131 IOAPICs */
{ {
device_t dev; device_t dev;
struct resource *res; struct resource *res;
dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN((sysconf.hcdn[0]&0xff), 1)); dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN((sysconf.hcdn[0]&0xff), 1));
if (dev) { if (dev) {
res = find_resource(dev, PCI_BASE_ADDRESS_0); res = find_resource(dev, PCI_BASE_ADDRESS_0);
if (res) { if (res) {
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132_1, current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132_1,
res->base, gsi_base ); res->base, gsi_base );
gsi_base+=7; gsi_base+=7;
} }
} }
dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN((sysconf.hcdn[0] & 0xff)+1, 1)); dev = dev_find_slot(m->bus_8132_0, PCI_DEVFN((sysconf.hcdn[0] & 0xff)+1, 1));
if (dev) { if (dev) {
res = find_resource(dev, PCI_BASE_ADDRESS_0); res = find_resource(dev, PCI_BASE_ADDRESS_0);
if (res) { if (res) {
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132_2, current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132_2,
res->base, gsi_base ); res->base, gsi_base );
gsi_base+=7; gsi_base+=7;
} }
} }
int i; int i;
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;
break; break;
case 3: case 3:
d = 4; d = 4;
break; break;
} }
switch (sysconf.hcid[i]) { switch (sysconf.hcid[i]) {
case 1: case 1:
case 3: case 3:
dev = dev_find_slot(m->bus_8132a[j][0], PCI_DEVFN(m->sbdn3a[j], 1)); dev = dev_find_slot(m->bus_8132a[j][0], PCI_DEVFN(m->sbdn3a[j], 1));
if (dev) { if (dev) {
res = find_resource(dev, PCI_BASE_ADDRESS_0); res = find_resource(dev, PCI_BASE_ADDRESS_0);
if (res) { if (res) {
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132a[j][0], current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132a[j][0],
res->base, gsi_base ); res->base, gsi_base );
gsi_base+=d; gsi_base+=d;
} }
} }
dev = dev_find_slot(m->bus_8132a[j][0], PCI_DEVFN(m->sbdn3a[j]+1, 1)); dev = dev_find_slot(m->bus_8132a[j][0], PCI_DEVFN(m->sbdn3a[j]+1, 1));
if (dev) { if (dev) {
res = find_resource(dev, PCI_BASE_ADDRESS_0); res = find_resource(dev, PCI_BASE_ADDRESS_0);
if (res) { if (res) {
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132a[j][1], current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, m->apicid_8132a[j][1],
res->base, gsi_base ); res->base, gsi_base );
gsi_base+=d; gsi_base+=d;
} }
} }
break; break;
} }
j++;
j++; }
} }
}
current += acpi_create_madt_irqoverride( (acpi_madt_irqoverride_t *) current += acpi_create_madt_irqoverride( (acpi_madt_irqoverride_t *)
current, 0, 0, 2, 5 ); current, 0, 0, 2, 5 );
/* 0: mean bus 0--->ISA */ /* 0: mean bus 0--->ISA */
/* 0: PIC 0 */ /* 0: PIC 0 */
/* 2: APIC 2 */ /* 2: APIC 2 */
/* 5 mean: 0101 --> Edige-triggered, Active high*/ /* 5 mean: 0101 --> Edige-triggered, Active high*/
/* create all subtables for processors */ /* create all subtables for processors */
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,24 +154,24 @@ 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,10 +200,10 @@ 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);
/* We need at least an RSDP and an RSDT Table */ /* We need at least an RSDP and an RSDT Table */
@ -218,43 +214,42 @@ unsigned long write_acpi_tables(unsigned long start)
/* clear all table memory */ /* clear all table memory */
memset((void *)start, 0, current - start); memset((void *)start, 0, current - start);
acpi_write_rsdp(rsdp, rsdt, NULL); acpi_write_rsdp(rsdp, rsdt, NULL);
acpi_write_rsdt(rsdt); acpi_write_rsdt(rsdt);
/* /*
* 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");
@ -263,40 +258,40 @@ unsigned long write_acpi_tables(unsigned long start)
#if CONFIG_ACPI_SSDTX_NUM >= 1 #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 //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 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
p = &AmlCode_ssdt2; p = &AmlCode_ssdt2;
break; break;
case 2: //8151 case 2: //8151
p = &AmlCode_ssdt3; p = &AmlCode_ssdt3;
break; break;
case 3: //8131 case 3: //8131
p = &AmlCode_ssdt4; p = &AmlCode_ssdt4;
break; break;
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
/* FACS */ /* FACS */
@ -306,41 +301,41 @@ 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");
dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t)); dump_mem(rsdp, ((void *)rsdp) + sizeof(acpi_rsdp_t));
printk(BIOS_DEBUG, "rsdt\n"); printk(BIOS_DEBUG, "rsdt\n");
dump_mem(rsdt, ((void *)rsdt) + sizeof(acpi_rsdt_t)); dump_mem(rsdt, ((void *)rsdt) + sizeof(acpi_rsdt_t));
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"); printk(BIOS_DEBUG, "srat\n");
dump_mem(srat, ((void *)srat) + srat->header.length); dump_mem(srat, ((void *)srat) + srat->header.length);
printk(BIOS_DEBUG, "slit\n"); printk(BIOS_DEBUG, "slit\n");
dump_mem(slit, ((void *)slit) + slit->header.length); 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);
printk(BIOS_DEBUG, "fadt\n"); printk(BIOS_DEBUG, "fadt\n");
dump_mem(fadt, ((void *)fadt) + fadt->header.length); dump_mem(fadt, ((void *)fadt) + fadt->header.length);
#endif #endif
printk(BIOS_INFO, "ACPI: done.\n"); printk(BIOS_INFO, "ACPI: done.\n");

View File

@ -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;
@ -209,7 +207,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 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);
@ -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);
@ -290,7 +288,7 @@ unsigned long write_acpi_tables(unsigned long start)
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]) {
@ -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");

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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);