Copy acpi blobs in two parts to make sure gcc does the right thing.

Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Stefan Reinauer <stepan@coresystems.de>


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5384 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Myles Watson 2010-04-09 03:41:23 +00:00
parent e64b63750f
commit ae60855f91
27 changed files with 185 additions and 148 deletions

View File

@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *)current;
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -57,13 +57,13 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char 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;
extern const unsigned char AmlCode_ssdt2[];
extern const unsigned char AmlCode_ssdt3[];
extern const unsigned char AmlCode_ssdt4[];
extern const unsigned char AmlCode_ssdt5[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@ -144,7 +144,7 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_header_t *ssdt;
#if CONFIG_ACPI_SSDTX_NUM >= 1
acpi_header_t *ssdtx;
acpi_header_t const *p;
void *p;
int i;
#endif
@ -223,8 +223,9 @@ unsigned long write_acpi_tables(unsigned long start)
p = &AmlCode_ssdt5;
break;
}
current += p->length;
memcpy((void *)ssdtx, p, p->length);
memcpy(ssdtx, p, sizeof(acpi_header_t));
current += ssdtx->length;
memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
@ -240,9 +241,10 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
dsdt = (acpi_header_t *)current;
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -46,14 +46,14 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const acpi_header_t AmlCode_ssdt;
extern const unsigned char AmlCode[];
extern const unsigned char AmlCode_ssdt[];
#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;
extern const unsigned char AmlCode_ssdt2[];
extern const unsigned char AmlCode_ssdt3[];
extern const unsigned char AmlCode_ssdt4[];
extern const unsigned char AmlCode_ssdt5[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@ -132,7 +132,7 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_header_t *ssdt;
#if CONFIG_ACPI_SSDTX_NUM >= 1
acpi_header_t *ssdtx;
acpi_header_t const *p;
void *p;
int i;
#endif
@ -194,8 +194,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ( current + 0x0f) & -0x10;
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)current;
current += AmlCode_ssdt.length;
memcpy((void *)ssdt, &AmlCode_ssdt, AmlCode_ssdt.length);
memcpy(ssdt, &AmlCode_ssdt, sizeof(acpi_header_t));
current += ssdt->length;
memcpy(ssdt, &AmlCode_ssdt, ssdt->length);
//Here you need to set value in pci1234, sblk and sbdn in get_bus_conf.c
update_ssdt((void*)ssdt);
/* recalculate checksum */
@ -237,8 +238,9 @@ unsigned long write_acpi_tables(unsigned long start)
p = &AmlCode_ssdt5;
break;
}
current += p->length;
memcpy((void *)ssdtx, p, p->length);
memcpy(ssdtx, p, sizeof(acpi_header_t));
current += ssdtx->length;
memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
@ -250,8 +252,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ( current + 0x07) & -0x08;
printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current);
dsdt = (acpi_header_t *)current; // it will used by fadt
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
/* FACS */ // it needs 64 bit alignment

View File

@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@ -187,9 +187,10 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -38,11 +38,11 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char 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 unsigned char AmlCode_ssdt2[];
extern const unsigned char AmlCode_ssdt3[];
extern const unsigned char AmlCode_ssdt4[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@ -194,7 +194,7 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_header_t *dsdt;
acpi_header_t *ssdt;
acpi_header_t *ssdtx;
acpi_header_t const *p;
void *p;
int i;
@ -285,8 +285,9 @@ unsigned long write_acpi_tables(unsigned long start)
default:
continue;
}
current += p->length;
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *)p)->length);
memcpy(ssdtx, p, sizeof(acpi_header_t));
current += ssdtx->length;
memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
@ -303,8 +304,9 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current);
dsdt = (acpi_header_t *)current;
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FDAT */

View File

@ -46,14 +46,14 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const acpi_header_t AmlCode_ssdt;
extern const unsigned char AmlCode[];
extern const unsigned char AmlCode_ssdt[];
#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;
extern const unsigned char AmlCode_ssdt2[];
extern const unsigned char AmlCode_ssdt3[];
extern const unsigned char AmlCode_ssdt4[];
extern const unsigned char AmlCode_ssdt5[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@ -200,7 +200,7 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_header_t *dsdt;
acpi_header_t *ssdt;
acpi_header_t *ssdtx;
acpi_header_t const *p;
void *p;
int i;
@ -262,8 +262,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ( current + 0x0f) & -0x10;
printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current);
ssdt = (acpi_header_t *)current;
current += AmlCode_ssdt.length;
memcpy((void *)ssdt, &AmlCode_ssdt, AmlCode_ssdt.length);
memcpy(ssdt, &AmlCode_ssdt, sizeof(acpi_header_t));
current += ssdt->length;
memcpy(ssdt, &AmlCode_ssdt, ssdt->length);
//Here you need to set value in pci1234, sblk and sbdn in get_bus_conf.c
update_ssdt((void*)ssdt);
/* recalculate checksum */
@ -305,8 +306,9 @@ unsigned long write_acpi_tables(unsigned long start)
//HTX no io apic
p = &AmlCode_ssdt5;
}
current += p->length;
memcpy((void *)ssdtx, p, p->length);
memcpy(ssdtx, p, sizeof(acpi_header_t));
current += ssdtx->length;
memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
@ -318,8 +320,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ( current + 0x07) & -0x08;
printk(BIOS_DEBUG, "ACPI: * DSDT at %lx\n", current);
dsdt = (acpi_header_t *)current;
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FACS */ // it needs 64 bit alignment

View File

@ -57,13 +57,13 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char 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;
extern const unsigned char AmlCode_ssdt2[];
extern const unsigned char AmlCode_ssdt3[];
extern const unsigned char AmlCode_ssdt4[];
extern const unsigned char AmlCode_ssdt5[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@ -144,7 +144,7 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_header_t *ssdt;
#if CONFIG_ACPI_SSDTX_NUM >= 1
acpi_header_t *ssdtx;
acpi_header_t const *p;
void *p;
int i;
#endif
@ -223,8 +223,9 @@ unsigned long write_acpi_tables(unsigned long start)
p = &AmlCode_ssdt5;
break;
}
current += p->length;
memcpy((void *)ssdtx, p, p->length);
memcpy(ssdtx, p, sizeof(acpi_header_t));
current += ssdtx->length;
memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((u8 *)ssdtx, ssdtx->length);
@ -240,9 +241,10 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
dsdt = (acpi_header_t *)current;
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -31,7 +31,7 @@
#include <../../../southbridge/via/vt8237r/vt8237r.h>
#include <../../../southbridge/via/k8t890/k8t890.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -117,11 +117,12 @@ unsigned long write_acpi_tables(unsigned long start)
current += sizeof(acpi_facs_t);
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
dsdt = (acpi_header_t *)current;
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
dsdt->checksum = 0; /* Don't trust iasl to get this right. */
dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt,
dsdt->length);
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -33,7 +33,7 @@
#include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
#include <cpu/amd/model_fxx_powernow.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -133,10 +133,11 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
dsdt->checksum = 0; /* Don't trust iasl to get this right. */
dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt,
dsdt->length);
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -34,7 +34,7 @@
#include <device/pci.h>
#include <cpu/amd/amdk8_sysconf.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -143,10 +143,11 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
dsdt->checksum = 0; /* Don't trust iasl to get this right. */
dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt,
dsdt->length);
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -31,7 +31,7 @@
#define OLD_ACPI 0
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#if CONFIG_HAVE_ACPI_SLIC
unsigned long acpi_create_slic(unsigned long current);
#endif
@ -273,8 +273,9 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
#if OLD_ACPI
for (i=0; i < dsdt->length; i++) {

View File

@ -28,7 +28,7 @@
#include <device/pci_ids.h>
#include "ioapic.h"
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -204,9 +204,10 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
ALIGN_CURRENT;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt,
dsdt->length);

View File

@ -38,13 +38,13 @@ static void dump_mem(unsigned start, unsigned end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char 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;
extern const unsigned char AmlCode_ssdt2[];
extern const unsigned char AmlCode_ssdt3[];
extern const unsigned char AmlCode_ssdt4[];
extern const unsigned char AmlCode_ssdt5[];
#endif
#define IO_APIC_ADDR 0xfec00000UL
@ -201,7 +201,7 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_header_t *dsdt;
acpi_header_t *ssdt;
acpi_header_t *ssdtx;
acpi_header_t const *p;
void *p;
int i;
@ -295,8 +295,9 @@ unsigned long write_acpi_tables(unsigned long start)
p = &AmlCode_ssdt5;
break;
}
current += ((acpi_header_t *)p)->length;
memcpy((void *)ssdtx, (void *)p, ((acpi_header_t *)p)->length);
memcpy(ssdtx, p, sizeof(acpi_header_t));
current += ssdtx->length;
memcpy(ssdtx, p, ssdtx->length);
update_ssdtx((void *)ssdtx, i);
ssdtx->checksum = 0;
ssdtx->checksum = acpi_checksum((unsigned char *)ssdtx,ssdtx->length);
@ -313,8 +314,9 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *)current;
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
/* FDAT */

View File

@ -29,7 +29,7 @@
#include <cpu/x86/msr.h>
#include "dmi.h"
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#if CONFIG_HAVE_ACPI_SLIC
unsigned long acpi_create_slic(unsigned long current);
#endif
@ -204,8 +204,9 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
ALIGN_CURRENT;

View File

@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -35,7 +35,7 @@
#include <cpu/amd/amdfam10_sysconf.h>
#include "mb_sysconf.h"
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -147,8 +147,9 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
dsdt->checksum = 0; /* Don't trust iasl to get this right. */
dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt,

View File

@ -30,7 +30,7 @@
#include <device/pci_ids.h>
#include "dmi.h"
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#if CONFIG_HAVE_ACPI_SLIC
unsigned long acpi_create_slic(unsigned long current);
#endif
@ -273,8 +273,9 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
/* Fix up global NVS region for SMI handler. The GNVS region lives
* in the (high) table area. The low memory map looks like this:

View File

@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -57,7 +57,7 @@ static void dump_mem(u32 start, u32 end)
}
#endif
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
#define IO_APIC_ADDR 0xfec00000UL
@ -187,8 +187,9 @@ unsigned long write_acpi_tables(unsigned long start)
/* DSDT */
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
/* FADT */
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -20,7 +20,7 @@
#include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
#include <cpu/amd/model_fxx_powernow.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -139,8 +139,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ALIGN(current, 16);
dsdt = (acpi_header_t *) current;
printk(BIOS_DEBUG, "ACPI: * DSDT %p\n", dsdt);
current += AmlCode.length;
memcpy((void*) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
current = ALIGN(current, 16);

View File

@ -20,7 +20,7 @@
#include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
#include <cpu/amd/model_fxx_powernow.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -139,8 +139,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ALIGN(current, 16);
dsdt = (acpi_header_t *) current;
printk(BIOS_DEBUG, "ACPI: * DSDT %p\n", dsdt);
current += AmlCode.length;
memcpy((void*) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
current = ALIGN(current, 16);

View File

@ -20,7 +20,7 @@
#include <../../../northbridge/amd/amdk8/amdk8_acpi.h>
#include <cpu/amd/model_fxx_powernow.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -164,8 +164,9 @@ unsigned long write_acpi_tables(unsigned long start)
current = ALIGN(current, 16);
dsdt = (acpi_header_t *) current;
printk(BIOS_DEBUG, "ACPI: * DSDT %p\n", dsdt);
current += AmlCode.length;
memcpy((void*) dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
current = ALIGN(current, 16);

View File

@ -11,7 +11,7 @@
#include <string.h>
#include <arch/acpi.h>
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -75,10 +75,11 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *)current;
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
dsdt->checksum = 0; // don't trust intel iasl compiler to get this right
dsdt->checksum = acpi_checksum(dsdt,dsdt->length);
dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n",dsdt,dsdt->length);
printk(BIOS_DEBUG, "ACPI: * FADT\n");

View File

@ -35,8 +35,8 @@
#include <device/pci_ids.h>
#include <../../../northbridge/via/vx800/vx800.h>
extern const acpi_header_t AmlCode_dsdt;
extern const acpi_header_t AmlCode_ssdt;
extern const unsigned char AmlCode_dsdt[];
extern const unsigned char AmlCode_ssdt[];
extern u32 wake_vec;
@ -80,8 +80,6 @@ unsigned long acpi_create_madt_lapic_nmis(unsigned long current, u16 flags,
unsigned long acpi_fill_madt(unsigned long current)
{
unsigned int gsi_base = 0x18;
/* Create all subtables for processors. */
current = acpi_create_madt_lapics(current);
@ -113,6 +111,7 @@ unsigned long acpi_fill_slit(unsigned long current)
unsigned long acpi_fill_srat(unsigned long current)
{
/* No NUMA, no SRAT. */
return current;
}
#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
@ -122,14 +121,15 @@ unsigned long write_acpi_tables(unsigned long start)
{
unsigned long current;
acpi_rsdp_t *rsdp;
acpi_srat_t *srat;
acpi_rsdt_t *rsdt;
acpi_mcfg_t *mcfg;
acpi_hpet_t *hpet;
acpi_madt_t *madt;
acpi_fadt_t *fadt;
acpi_facs_t *facs;
acpi_header_t *dsdt, *ssdt;
acpi_header_t *dsdt;
#if 0
acpi_header_t *ssdt;
#endif
/* Align ACPI tables to 16 byte. */
start = (start + 0x0f) & -0x10;
@ -158,10 +158,11 @@ unsigned long write_acpi_tables(unsigned long start)
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *) current;
current += AmlCode_dsdt.length;
memcpy((void *)dsdt, &AmlCode_dsdt, AmlCode_dsdt.length);
memcpy(dsdt, &AmlCode_dsdt, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode_dsdt, dsdt->length);
dsdt->checksum = 0; /* Don't trust iasl to get this right. */
dsdt->checksum = acpi_checksum(dsdt, dsdt->length);
dsdt->checksum = acpi_checksum((u8*)dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * DSDT @ %p Length %x\n", dsdt, dsdt->length);
printk(BIOS_DEBUG, "ACPI: * FADT\n");
@ -181,7 +182,7 @@ unsigned long write_acpi_tables(unsigned long start)
/* NO MCFG in VX855, no PCI-E. */
printk(BIOS_DEBUG, "ACPI: * HPET\n");
hpet = (acpi_mcfg_t *) current;
hpet = (acpi_hpet_t *) current;
acpi_create_hpet(hpet);
current += hpet->header.length;
acpi_add_table(rsdp, hpet);
@ -189,10 +190,11 @@ unsigned long write_acpi_tables(unsigned long start)
#if 0
printk(BIOS_DEBUG, "ACPI: * SSDT\n");
ssdt = (acpi_header_t *) current;
current += AmlCode_ssdt.length;
memcpy((void *)ssdt, &AmlCode_ssdt, AmlCode_ssdt.length);
memcpy(ssdt, &AmlCode_ssdt, sizeof(acpi_header_t));
current += ssdt->length;
memcpy(ssdt, &AmlCode_ssdt, ssdt->length);
ssdt->checksum = 0; /* Don't trust iasl to get this right. */
ssdt->checksum = acpi_checksum(ssdt, ssdt->length);
ssdt->checksum = acpi_checksum((u8*)ssdt, ssdt->length);
acpi_add_table(rsdp, ssdt);
printk(BIOS_DEBUG, "ACPI: * SSDT @ %08x Length %x\n", ssdt, ssdt->length);
#endif

View File

@ -35,7 +35,7 @@
#include <device/pci_ids.h>
#include "../../../southbridge/via/vt8237r/vt8237r.h"
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
/*
* These four macros are copied from <arch/smp/mpspec.h>, I have to do this
@ -160,8 +160,9 @@ unsigned long write_acpi_tables(unsigned long start)
printk(BIOS_DEBUG, "ACPI: * DSDT\n");
dsdt = (acpi_header_t *)current;
current += AmlCode.length;
memcpy((void *)dsdt, &AmlCode, AmlCode.length);
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
#if 0
dsdt->checksum = 0; // don't trust intel iasl compiler to get this right
dsdt->checksum = acpi_checksum(dsdt,dsdt->length);

View File

@ -27,7 +27,7 @@
#include <device/pci_ids.h>
#include "dmi.h"
extern const acpi_header_t AmlCode;
extern const unsigned char AmlCode[];
unsigned long acpi_fill_mcfg(unsigned long current)
{
@ -180,8 +180,10 @@ unsigned long write_acpi_tables(unsigned long start)
acpi_create_facs(facs);
dsdt = (acpi_header_t *) current;
current += AmlCode.length;
memcpy((void *) dsdt, &AmlCode,AmlCode.length);
dsdt = (acpi_header_t *)current;
memcpy(dsdt, &AmlCode, sizeof(acpi_header_t));
current += dsdt->length;
memcpy(dsdt, &AmlCode, dsdt->length);
#ifdef DONT_TRUST_IASL
dsdt->checksum = 0; // don't trust intel iasl compiler to get this right
dsdt->checksum = acpi_checksum(dsdt, dsdt->length);

View File

@ -268,7 +268,7 @@ void update_ssdt(void *ssdt)
}
void update_sspr(void *sspr, u32 nodeid, u32 cpuindex)
static void update_sspr(void *sspr, u32 nodeid, u32 cpuindex)
{
u8 *CPU;
u8 *CPUIN;
@ -291,7 +291,7 @@ void update_sspr(void *sspr, u32 nodeid, u32 cpuindex)
CONTROL = sspr + 0x8d;
STATUS = sspr + 0x8f;
sprintf(CPU, "%02x", (u8)cpuindex);
sprintf(CPU, "%02x", (char)cpuindex);
*CPUIN = (u8) cpuindex;
for(i=0;i<sysconf.p_state_num;i++) {
@ -305,11 +305,11 @@ void update_sspr(void *sspr, u32 nodeid, u32 cpuindex)
}
}
extern const acpi_header_t AmlCode_sspr5;
extern const acpi_header_t AmlCode_sspr4;
extern const acpi_header_t AmlCode_sspr3;
extern const acpi_header_t AmlCode_sspr2;
extern const acpi_header_t AmlCode_sspr1;
extern const unsigned char AmlCode_sspr5[];
extern const unsigned char AmlCode_sspr4[];
extern const unsigned char AmlCode_sspr3[];
extern const unsigned char AmlCode_sspr2[];
extern const unsigned char AmlCode_sspr1[];
/* fixme: find one good way for different p_state_num */
unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current)
@ -321,7 +321,7 @@ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current)
if(!sysconf.p_state_num) return current;
acpi_header_t *AmlCode_sspr;
void *AmlCode_sspr;
switch(sysconf.p_state_num) {
case 1: AmlCode_sspr = &AmlCode_sspr1; break;
case 2: AmlCode_sspr = &AmlCode_sspr2; break;
@ -342,8 +342,9 @@ unsigned long acpi_add_ssdt_pstates(acpi_rsdp_t *rsdp, unsigned long current)
current = ( current + 0x0f) & -0x10;
ssdt = (acpi_header_t *)current;
current += AmlCode_sspr->length;
memcpy((void *)ssdt, AmlCode_sspr, AmlCode_sspr->length);
memcpy(ssdt, AmlCode_sspr, sizeof(acpi_header_t));
current += ssdt->length;
memcpy(ssdt, AmlCode_sspr, ssdt->length);
update_sspr((void*)ssdt,cpu->path.apic.node_id, cpu_index);
/* recalculate checksum */
ssdt->checksum = 0;