diff options
Diffstat (limited to 'src/mainboard/amd')
4 files changed, 31 insertions, 16 deletions
diff --git a/src/mainboard/amd/serengeti_cheetah/Makefile.inc b/src/mainboard/amd/serengeti_cheetah/Makefile.inc new file mode 100644 index 0000000000..876b3edbf4 --- /dev/null +++ b/src/mainboard/amd/serengeti_cheetah/Makefile.inc @@ -0,0 +1,3 @@ +$(eval $(call asl_template,ssdt2)) +$(eval $(call asl_template,ssdt3)) +$(eval $(call asl_template,ssdt4)) diff --git a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c index 168793eb82..14ef93830a 100644 --- a/src/mainboard/amd/serengeti_cheetah/acpi_tables.c +++ b/src/mainboard/amd/serengeti_cheetah/acpi_tables.c @@ -17,14 +17,11 @@ #include <cpu/x86/msr.h> #include <cpu/amd/mtrr.h> #include <cpu/amd/amdk8_sysconf.h> +#include <cbfs.h> #include "northbridge/amd/amdk8/acpi.h" #include "mb_sysconf.h" #include "mainboard.h" -extern const unsigned char AmlCode_ssdt2[]; -extern const unsigned char AmlCode_ssdt3[]; -extern const unsigned char AmlCode_ssdt4[]; - unsigned long acpi_fill_madt(unsigned long current) { u32 gsi_base=0x18; @@ -127,6 +124,7 @@ unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp unsigned long current; acpi_header_t *ssdtx; const void *p; + size_t p_size; int i; @@ -139,6 +137,7 @@ unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp //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 + const char *file_name; if((sysconf.pci1234[i] & 1) != 1 ) continue; u8 c; if(i<7) { @@ -152,17 +151,23 @@ unsigned long mainboard_write_acpi_tables(unsigned long start, acpi_rsdp_t *rsdp ssdtx = (acpi_header_t *)current; switch(sysconf.hcid[i]) { case 1: //8132 - p = &AmlCode_ssdt2; + file_name = CONFIG_CBFS_PREFIX "/ssdt2.aml"; break; case 2: //8151 - p = &AmlCode_ssdt3; + file_name = CONFIG_CBFS_PREFIX "/ssdt3.aml"; break; case 3: //8131 - p = &AmlCode_ssdt4; + file_name = CONFIG_CBFS_PREFIX "/ssdt4.aml"; break; default: continue; } + p = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, + file_name, + CBFS_TYPE_RAW, &p_size); + if (!p || p_size < sizeof(acpi_header_t)) + continue; + memcpy(ssdtx, p, sizeof(acpi_header_t)); current += ssdtx->length; memcpy(ssdtx, p, ssdtx->length); diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/Makefile.inc b/src/mainboard/amd/serengeti_cheetah_fam10/Makefile.inc new file mode 100644 index 0000000000..e826e8153a --- /dev/null +++ b/src/mainboard/amd/serengeti_cheetah_fam10/Makefile.inc @@ -0,0 +1,4 @@ +$(eval $(call asl_template,ssdt2)) +$(eval $(call asl_template,ssdt3)) +$(eval $(call asl_template,ssdt4)) +$(eval $(call asl_template,ssdt5)) diff --git a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c index 8c245285fb..cc932d2676 100644 --- a/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c +++ b/src/mainboard/amd/serengeti_cheetah_fam10/acpi_tables.c @@ -26,15 +26,11 @@ #include <cpu/x86/msr.h> #include <cpu/amd/mtrr.h> #include <cpu/amd/amdfam10_sysconf.h> +#include <cbfs.h> #include "mb_sysconf.h" #include "mainboard.h" -extern const unsigned char AmlCode_ssdt2[]; -extern const unsigned char AmlCode_ssdt3[]; -extern const unsigned char AmlCode_ssdt4[]; -extern const unsigned char AmlCode_ssdt5[]; - unsigned long acpi_fill_madt(unsigned long current) { u32 gsi_base=0x18; @@ -136,6 +132,7 @@ unsigned long mainboard_write_acpi_tables(unsigned long current, { acpi_header_t *ssdtx; const void *p; + size_t p_size; int i; @@ -145,6 +142,7 @@ unsigned long mainboard_write_acpi_tables(unsigned long current, change HCIN, and recalculate the checknum and add_table */ for(i=1;i<sysconf.hc_possible_num;i++) { // 0: is hc sblink + const char *file_name; if((sysconf.pci1234[i] & 1) != 1 ) continue; u8 c; if(i<7) { @@ -158,18 +156,23 @@ unsigned long mainboard_write_acpi_tables(unsigned long current, ssdtx = (acpi_header_t *)current; switch(sysconf.hcid[i]) { case 1: - p = &AmlCode_ssdt2; + file_name = CONFIG_CBFS_PREFIX "/ssdt2.aml"; break; case 2: - p = &AmlCode_ssdt3; + file_name = CONFIG_CBFS_PREFIX "/ssdt3.aml"; break; case 3: //8131 - p = &AmlCode_ssdt4; + file_name = CONFIG_CBFS_PREFIX "/ssdt4.aml"; break; default: //HTX no io apic - p = &AmlCode_ssdt5; + file_name = CONFIG_CBFS_PREFIX "/ssdt5.aml"; } + p = cbfs_get_file_content(CBFS_DEFAULT_MEDIA, + file_name, + CBFS_TYPE_RAW, &p_size); + if (!p || p_size < sizeof(acpi_header_t)) + continue; memcpy(ssdtx, p, sizeof(acpi_header_t)); current += ssdtx->length; memcpy(ssdtx, p, ssdtx->length); |