summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-07-04 16:14:37 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-07-14 19:48:00 +0200
commit7b23ae0e8938eb71453cbc28c2cc74c14a4039ae (patch)
tree6f57fc077140b22a2f1d8b509baac3384c38eb7b /src/mainboard
parent06ff7268f67d1345fd115fda0879d781eac2d6b1 (diff)
AGESA: Trace execution with AGESAWRAPPER()
Implement logging just once to have uniform output. Change-Id: I8db694a3bf6b1af459bdf98f7acb99edf4dd07f7 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/6180 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/amd/dinar/romstage.c36
-rw-r--r--src/mainboard/amd/inagua/romstage.c36
-rw-r--r--src/mainboard/amd/olivehill/romstage.c45
-rw-r--r--src/mainboard/amd/parmer/romstage.c44
-rw-r--r--src/mainboard/amd/persimmon/romstage.c52
-rw-r--r--src/mainboard/amd/south_station/romstage.c36
-rw-r--r--src/mainboard/amd/thatcher/romstage.c46
-rw-r--r--src/mainboard/amd/torpedo/romstage.c36
-rw-r--r--src/mainboard/amd/union_station/romstage.c36
-rw-r--r--src/mainboard/asrock/e350m1/romstage.c36
-rw-r--r--src/mainboard/asrock/imb-a180/romstage.c45
-rw-r--r--src/mainboard/asus/f2a85-m/romstage.c45
-rwxr-xr-xsrc/mainboard/gizmosphere/gizmo/romstage.c52
-rw-r--r--src/mainboard/hp/pavilion_m6_1035dx/romstage.c44
-rw-r--r--src/mainboard/jetway/nf81-t56n-lf/romstage.c52
-rw-r--r--src/mainboard/lippert/frontrunner-af/romstage.c52
-rw-r--r--src/mainboard/lippert/toucan-af/romstage.c52
-rw-r--r--src/mainboard/supermicro/h8qgi/romstage.c29
-rw-r--r--src/mainboard/supermicro/h8scm/romstage.c29
-rw-r--r--src/mainboard/tyan/s8226/romstage.c29
20 files changed, 147 insertions, 685 deletions
diff --git a/src/mainboard/amd/dinar/romstage.c b/src/mainboard/amd/dinar/romstage.c
index ba3e1ef66a..1156ec4625 100644
--- a/src/mainboard/amd/dinar/romstage.c
+++ b/src/mainboard/amd/dinar/romstage.c
@@ -30,6 +30,7 @@
#include <console/loglevel.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include "superio/smsc/sch4037/sch4037_early_init.c"
#include "superio/smsc/sio1036/sio1036_early_init.c"
@@ -67,12 +68,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x32);
- val = agesawrapper_amdinitmmio();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio passed\n");
- }
+ AGESAWRAPPER(amdinitmmio);
/* Halt if there was a built in self test failure */
post_code(0x33);
@@ -89,20 +85,10 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x35);
- val = agesawrapper_amdinitreset();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset passed\n");
- }
+ AGESAWRAPPER(amdinitreset);
post_code(0x36);
- val = agesawrapper_amdinitearly ();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly passed\n");
- }
+ AGESAWRAPPER(amdinitearly);
post_code(0x37);
nb_Poweron_Init();
@@ -111,20 +97,10 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
post_code(0x39);
- val = agesawrapper_amdinitpost ();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost passed\n");
- }
+ AGESAWRAPPER(amdinitpost);
post_code(0x40);
- val = agesawrapper_amdinitenv ();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv passed\n");
- }
+ AGESAWRAPPER(amdinitenv);
post_code(0x43);
diff --git a/src/mainboard/amd/inagua/romstage.c b/src/mainboard/amd/inagua/romstage.c
index a7b8a40dfd..489e81f9ef 100644
--- a/src/mainboard/amd/inagua/romstage.c
+++ b/src/mainboard/amd/inagua/romstage.c
@@ -32,6 +32,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/smsc/kbc1100/kbc1100.h>
#include "cpu/x86/lapic.h"
@@ -74,44 +75,19 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
post_code(0x50);
copy_and_run();
diff --git a/src/mainboard/amd/olivehill/romstage.c b/src/mainboard/amd/olivehill/romstage.c
index c979456ce2..718a0575d8 100644
--- a/src/mainboard/amd/olivehill/romstage.c
+++ b/src/mainboard/amd/olivehill/romstage.c
@@ -31,6 +31,7 @@
#include <console/loglevel.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include "cpu/x86/lapic.h"
#include "southbridge/amd/agesa/hudson/hudson.h"
@@ -50,7 +51,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
outb(0xD2, 0xcd6);
outb(0x00, 0xcd7);
- val = agesawrapper_amdinitmmio();
+ AGESAWRAPPER(amdinitmmio);
hudson_lpc_port80();
@@ -76,56 +77,28 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
val = inb(0xcd6);
post_code(0x37);
- val = agesawrapper_amdinitreset();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- }
-
+ AGESAWRAPPER(amdinitreset);
post_code(0x38);
printk(BIOS_DEBUG, "Got past yangtze_early_setup\n");
post_code(0x39);
- val = agesawrapper_amdinitearly ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n");
-
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- val = agesawrapper_amdinitpost ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitpost\n");
-
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n");
+ AGESAWRAPPER(amdinitenv);
/* TODO: Disable cache is not ok. */
disable_cache_as_ram();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/amd/parmer/romstage.c b/src/mainboard/amd/parmer/romstage.c
index b0fa5d987c..7bd3984dcc 100644
--- a/src/mainboard/amd/parmer/romstage.c
+++ b/src/mainboard/amd/parmer/romstage.c
@@ -31,6 +31,7 @@
#include <console/loglevel.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include "cpu/x86/lapic.h"
#include "southbridge/amd/agesa/hudson/hudson.h"
@@ -41,7 +42,7 @@
void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
{
u32 val;
- val = agesawrapper_amdinitmmio();
+ AGESAWRAPPER(amdinitmmio);
hudson_lpc_port80();
@@ -62,53 +63,24 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- }
-
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- val = agesawrapper_amdinitearly ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n");
-
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- val = agesawrapper_amdinitpost ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitpost\n");
-
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n");
+ AGESAWRAPPER(amdinitenv);
disable_cache_as_ram();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/amd/persimmon/romstage.c b/src/mainboard/amd/persimmon/romstage.c
index f6f230990e..b0fd12ccb5 100644
--- a/src/mainboard/amd/persimmon/romstage.c
+++ b/src/mainboard/amd/persimmon/romstage.c
@@ -32,6 +32,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/fintek/common/fintek.h>
#include <superio/fintek/f81865f/f81865f.h>
@@ -79,64 +80,29 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x42);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/amd/south_station/romstage.c b/src/mainboard/amd/south_station/romstage.c
index 13c096ff4d..a66c2b822b 100644
--- a/src/mainboard/amd/south_station/romstage.c
+++ b/src/mainboard/amd/south_station/romstage.c
@@ -32,6 +32,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/fintek/common/fintek.h>
#include <superio/fintek/f81865f/f81865f.h>
@@ -74,44 +75,19 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
post_code(0x50);
copy_and_run();
diff --git a/src/mainboard/amd/thatcher/romstage.c b/src/mainboard/amd/thatcher/romstage.c
index 10dac122e3..f3108ffcab 100644
--- a/src/mainboard/amd/thatcher/romstage.c
+++ b/src/mainboard/amd/thatcher/romstage.c
@@ -31,6 +31,7 @@
#include <console/loglevel.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include "cpu/x86/lapic.h"
#include "southbridge/amd/agesa/hudson/hudson.h"
@@ -46,7 +47,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
u32 val;
u8 byte;
device_t dev;
- val = agesawrapper_amdinitmmio();
+ AGESAWRAPPER(amdinitmmio);
hudson_lpc_port80();
//__asm__ volatile ("1: jmp 1b");
@@ -79,53 +80,24 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- }
-
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- val = agesawrapper_amdinitearly ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n");
-
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- val = agesawrapper_amdinitpost ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitpost\n");
-
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n");
+ AGESAWRAPPER(amdinitenv);
disable_cache_as_ram();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/amd/torpedo/romstage.c b/src/mainboard/amd/torpedo/romstage.c
index e3416c7cdd..febe1204ba 100644
--- a/src/mainboard/amd/torpedo/romstage.c
+++ b/src/mainboard/amd/torpedo/romstage.c
@@ -29,6 +29,7 @@
#include <console/loglevel.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/smsc/kbc1100/kbc1100.h>
#include "cpu/x86/lapic.h"
@@ -44,12 +45,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
u32 val;
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
if (!cpu_init_detectedx && boot_cpu()) {
post_code(0x30);
@@ -76,28 +72,13 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x36);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
post_code(0x38);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x39);
printk(BIOS_DEBUG, "sb_before_pci_init ");
@@ -105,12 +86,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "passed.\n");
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
post_code(0x43);
copy_and_run();
diff --git a/src/mainboard/amd/union_station/romstage.c b/src/mainboard/amd/union_station/romstage.c
index 05acf524d6..531d3b43dd 100644
--- a/src/mainboard/amd/union_station/romstage.c
+++ b/src/mainboard/amd/union_station/romstage.c
@@ -32,6 +32,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include "cpu/x86/lapic.h"
#include <sb_cimx.h>
@@ -68,44 +69,19 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
post_code(0x50);
copy_and_run();
diff --git a/src/mainboard/asrock/e350m1/romstage.c b/src/mainboard/asrock/e350m1/romstage.c
index 5c2f86747f..a0a2912ab8 100644
--- a/src/mainboard/asrock/e350m1/romstage.c
+++ b/src/mainboard/asrock/e350m1/romstage.c
@@ -31,6 +31,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/winbond/common/winbond.h>
#include <superio/winbond/w83627hf/w83627hf.h>
@@ -74,44 +75,19 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
post_code(0x50);
copy_and_run();
diff --git a/src/mainboard/asrock/imb-a180/romstage.c b/src/mainboard/asrock/imb-a180/romstage.c
index a818e0302c..b750e440af 100644
--- a/src/mainboard/asrock/imb-a180/romstage.c
+++ b/src/mainboard/asrock/imb-a180/romstage.c
@@ -31,6 +31,7 @@
#include <console/loglevel.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include "cpu/x86/lapic.h"
#include "southbridge/amd/agesa/hudson/hudson.h"
@@ -55,7 +56,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
//outb(0xD2, 0xcd6);
//outb(0x00, 0xcd7);
- val = agesawrapper_amdinitmmio();
+ AGESAWRAPPER(amdinitmmio);
hudson_lpc_port80();
@@ -100,56 +101,28 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
val = inb(0xcd6);
post_code(0x37);
- val = agesawrapper_amdinitreset();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- }
-
+ AGESAWRAPPER(amdinitreset);
post_code(0x38);
printk(BIOS_DEBUG, "Got past yangtze_early_setup\n");
post_code(0x39);
- val = agesawrapper_amdinitearly ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n");
-
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- val = agesawrapper_amdinitpost ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitpost\n");
-
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n");
+ AGESAWRAPPER(amdinitenv);
/* TODO: Disable cache is not ok. */
disable_cache_as_ram();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/asus/f2a85-m/romstage.c b/src/mainboard/asus/f2a85-m/romstage.c
index f50f3340e9..71455fddd2 100644
--- a/src/mainboard/asus/f2a85-m/romstage.c
+++ b/src/mainboard/asus/f2a85-m/romstage.c
@@ -19,6 +19,7 @@
*/
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include <arch/acpi.h>
#include <arch/cpu.h>
@@ -75,7 +76,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
hudson_lpc_port80();
#endif
- val = agesawrapper_amdinitmmio();
+ AGESAWRAPPER(amdinitmmio);
if (!cpu_init_detectedx && boot_cpu()) {
@@ -127,53 +128,23 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- }
-
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- val = agesawrapper_amdinitearly ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n");
-
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- val = agesawrapper_amdinitpost ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitpost\n");
-
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n");
+ AGESAWRAPPER(amdinitenv);
disable_cache_as_ram();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/gizmosphere/gizmo/romstage.c b/src/mainboard/gizmosphere/gizmo/romstage.c
index 5def470846..420efc356f 100755
--- a/src/mainboard/gizmosphere/gizmo/romstage.c
+++ b/src/mainboard/gizmosphere/gizmo/romstage.c
@@ -33,6 +33,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <cpu/x86/cache.h>
#include <sb_cimx.h>
@@ -87,64 +88,29 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x42);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/romstage.c b/src/mainboard/hp/pavilion_m6_1035dx/romstage.c
index 38991af67d..7855cd102e 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/romstage.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/romstage.c
@@ -18,6 +18,7 @@
*/
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include <arch/acpi.h>
#include <arch/cpu.h>
@@ -38,7 +39,7 @@
void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
{
u32 val;
- val = agesawrapper_amdinitmmio();
+ AGESAWRAPPER(amdinitmmio);
hudson_lpc_port80();
@@ -59,53 +60,24 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- }
-
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- val = agesawrapper_amdinitearly ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitearly\n");
-
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- val = agesawrapper_amdinitpost ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitpost\n");
-
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv ();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitenv\n");
+ AGESAWRAPPER(amdinitenv);
disable_cache_as_ram();
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/jetway/nf81-t56n-lf/romstage.c b/src/mainboard/jetway/nf81-t56n-lf/romstage.c
index 7f9cb1869f..4b2f711fc5 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/romstage.c
+++ b/src/mainboard/jetway/nf81-t56n-lf/romstage.c
@@ -19,6 +19,7 @@
*/
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include <arch/acpi.h>
#include <arch/cpu.h>
@@ -95,64 +96,29 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitpost);
post_code(0x42);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "AGESA_STATUS: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/lippert/frontrunner-af/romstage.c b/src/mainboard/lippert/frontrunner-af/romstage.c
index b65834e0ba..05c50193b9 100644
--- a/src/mainboard/lippert/frontrunner-af/romstage.c
+++ b/src/mainboard/lippert/frontrunner-af/romstage.c
@@ -32,6 +32,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/smsc/smscsuperio/smscsuperio.h>
#include "cpu/x86/lapic.h"
@@ -78,68 +79,33 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
/* Reboots with outb(3,0x92), outb(4,0xcf9) or triple-fault all
* hang, looks like DRAM re-init goes wrong, don't know why. */
+ val = AGESAWRAPPER(amdinitpost);
if (val == 7) /* fatal, amdinitenv below is going to hang */
outb(0x06, 0x0cf9); /* reset system harder instead */
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
post_code(0x42);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/lippert/toucan-af/romstage.c b/src/mainboard/lippert/toucan-af/romstage.c
index ff2697b1fb..595faa0ff5 100644
--- a/src/mainboard/lippert/toucan-af/romstage.c
+++ b/src/mainboard/lippert/toucan-af/romstage.c
@@ -32,6 +32,7 @@
#include <cpu/x86/mtrr.h>
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "cpu/x86/bist.h"
#include <superio/winbond/common/winbond.h>
#include <superio/winbond/w83627dhg/w83627dhg.h>
@@ -79,68 +80,33 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x35);
- printk(BIOS_DEBUG, "agesawrapper_amdinitmmio ");
- val = agesawrapper_amdinitmmio();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitmmio);
post_code(0x37);
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset ");
- val = agesawrapper_amdinitreset();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitreset);
post_code(0x39);
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly ");
- val = agesawrapper_amdinitearly ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitearly);
int s3resume = acpi_is_wakeup_early() && acpi_s3_resume_allowed();
if (!s3resume) {
post_code(0x40);
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost ");
- val = agesawrapper_amdinitpost ();
/* Reboots with outb(3,0x92), outb(4,0xcf9) or triple-fault all
* hang, looks like DRAM re-init goes wrong, don't know why. */
+ val = AGESAWRAPPER(amdinitpost);
if (val == 7) /* fatal, amdinitenv below is going to hang */
outb(0x06, 0x0cf9); /* reset system harder instead */
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
post_code(0x42);
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv ");
- val = agesawrapper_amdinitenv ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitenv);
} else { /* S3 detect */
printk(BIOS_INFO, "S3 detected\n");
post_code(0x60);
- printk(BIOS_DEBUG, "agesawrapper_amdinitresume ");
- val = agesawrapper_amdinitresume();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
-
- printk(BIOS_DEBUG, "agesawrapper_amds3laterestore ");
- val = agesawrapper_amds3laterestore ();
- if (val)
- printk(BIOS_DEBUG, "error level: %x \n", val);
- else
- printk(BIOS_DEBUG, "passed.\n");
+ AGESAWRAPPER(amdinitresume);
+
+ AGESAWRAPPER(amds3laterestore);
post_code(0x61);
prepare_for_resume();
diff --git a/src/mainboard/supermicro/h8qgi/romstage.c b/src/mainboard/supermicro/h8qgi/romstage.c
index 03d501dbd0..4273fdb82a 100644
--- a/src/mainboard/supermicro/h8qgi/romstage.c
+++ b/src/mainboard/supermicro/h8qgi/romstage.c
@@ -28,6 +28,7 @@
#include "cpu/x86/lapic.h"
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge/amd/agesa/family10/reset_test.h"
#include <nb_cimx.h>
#include <sb_cimx.h>
@@ -65,12 +66,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- val = agesawrapper_amdinitreset();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset passed\n");
- }
+ AGESAWRAPPER(amdinitreset);
if (!cpu_init_detectedx && boot_cpu()) {
post_code(0x38);
@@ -85,12 +81,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
sb_Poweron_Init();
}
post_code(0x3B);
- val = agesawrapper_amdinitearly();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly passed\n");
- }
+ AGESAWRAPPER(amdinitearly);
post_code(0x3C);
/* W83627DHG pin89,90 function select is RSTOUT3#, RSTOUT2# by default.
@@ -110,20 +101,10 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x40);
- val = agesawrapper_amdinitpost();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost passed\n");
- }
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv passed\n");
-
+ AGESAWRAPPER(amdinitenv);
post_code(0x42);
post_code(0x50);
diff --git a/src/mainboard/supermicro/h8scm/romstage.c b/src/mainboard/supermicro/h8scm/romstage.c
index b80b4de731..4084addfb9 100644
--- a/src/mainboard/supermicro/h8scm/romstage.c
+++ b/src/mainboard/supermicro/h8scm/romstage.c
@@ -28,6 +28,7 @@
#include "cpu/x86/lapic.h"
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge/amd/agesa/family10/reset_test.h"
#include <nb_cimx.h>
#include <sb_cimx.h>
@@ -64,12 +65,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- val = agesawrapper_amdinitreset();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset passed\n");
- }
+ AGESAWRAPPER(amdinitreset);
if (!cpu_init_detectedx && boot_cpu()) {
post_code(0x38);
@@ -84,12 +80,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
sb_Poweron_Init();
}
post_code(0x3B);
- val = agesawrapper_amdinitearly();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly passed\n");
- }
+ AGESAWRAPPER(amdinitearly);
post_code(0x3C);
nb_Ht_Init();
@@ -104,20 +95,10 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x40);
- val = agesawrapper_amdinitpost();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost passed\n");
- }
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv passed\n");
-
+ AGESAWRAPPER(amdinitenv);
post_code(0x42);
post_code(0x50);
diff --git a/src/mainboard/tyan/s8226/romstage.c b/src/mainboard/tyan/s8226/romstage.c
index 8b8fa5fe0e..9624af8658 100644
--- a/src/mainboard/tyan/s8226/romstage.c
+++ b/src/mainboard/tyan/s8226/romstage.c
@@ -28,6 +28,7 @@
#include "cpu/x86/lapic.h"
#include "cpu/amd/car.h"
#include "agesawrapper.h"
+#include <northbridge/amd/agesa/agesawrapper_call.h>
#include "northbridge/amd/agesa/family10/reset_test.h"
#include <nb_cimx.h>
#include <sb_cimx.h>
@@ -64,12 +65,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
printk(BIOS_DEBUG, "cpu_init_detectedx = %08lx \n", cpu_init_detectedx);
post_code(0x37);
- val = agesawrapper_amdinitreset();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitreset passed\n");
- }
+ AGESAWRAPPER(amdinitreset);
if (!cpu_init_detectedx && boot_cpu()) {
post_code(0x38);
@@ -84,12 +80,7 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
sb_Poweron_Init();
}
post_code(0x3B);
- val = agesawrapper_amdinitearly();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitearly passed\n");
- }
+ AGESAWRAPPER(amdinitearly);
post_code(0x3C);
/* W83627DHG pin89,90 function select is RSTOUT3#, RSTOUT2# by default.
@@ -109,20 +100,10 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
}
post_code(0x40);
- val = agesawrapper_amdinitpost();
- if (val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost failed: %x \n", val);
- } else {
- printk(BIOS_DEBUG, "agesawrapper_amdinitpost passed\n");
- }
+ AGESAWRAPPER(amdinitpost);
post_code(0x41);
- val = agesawrapper_amdinitenv();
- if(val) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv failed: %x \n", val);
- }
- printk(BIOS_DEBUG, "agesawrapper_amdinitenv passed\n");
-
+ AGESAWRAPPER(amdinitenv);
post_code(0x42);
post_code(0x50);