Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6137
-gerrit
commit 491ad696acc481f3f18967097b58b8729bdf133f
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Wed Jun 11 12:53:47 2014 -0600
drivers/spi: Reduce the per loop delay of spi_flash_cmd_poll_bit()
At the end of some SPI operations the SPI device needs to be polled
to determine if it is done with the operation. For SPI data writes
the predicted time of that operation could be less than 10us.
The current per loop delay of 500us is adding too much delay.
This change replaces the delay(x) in the do-while loop with a
timer so that the actual timeout value won't be lengthened by the
delay of reading the SPI device.
Change-Id: Idf5a70182d66fc6a4b760ddae5f15a9fb654c9ff
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/drivers/spi/spi_flash.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 33588d5..6d92836 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -16,6 +16,7 @@
#include <cpu/x86/smm.h>
#endif
#include "spi_flash_internal.h"
+#include <timer.h>
static void spi_flash_addr(u32 addr, u8 *cmd)
{
@@ -106,27 +107,24 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
u8 cmd, u8 poll_bit)
{
struct spi_slave *spi = flash->spi;
- unsigned long timebase;
int ret;
u8 status;
+ struct mono_time current, end;
+
+ timer_monotonic_get(¤t);
+ end = current;
+ mono_time_add_msecs(&end, timeout);
- timebase = timeout;
do {
ret = spi_flash_cmd_read(spi, &cmd, 1, &status, 1);
if (ret)
return -1;
-
if ((status & poll_bit) == 0)
- break;
-
- udelay(500);
- } while (timebase--);
-
- if ((status & poll_bit) == 0)
- return 0;
+ return 0;
+ timer_monotonic_get(¤t);
+ } while (!mono_time_after(¤t, &end));
- /* Timed out */
- printk(BIOS_DEBUG, "SF: time out!\n");
+ printk(BIOS_DEBUG, "SF: timeout at %ld msec\n",timeout);
return -1;
}
Kyösti Mälkki (kyosti.malkki(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6132
-gerrit
commit 5598d9737034c83f3dac71b3bd272f0110072837
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Thu Jun 19 23:12:15 2014 +0300
AGESA: Add agesawrapper_post_device()
NOTE: The procedure is moved across a collected timestamp
TS_WRITE_TABLES, so the delay of SPI erase/write will be accounted
for in an earlier entry in cbmem -t output.
Change-Id: I0f082e7af1769c8d7d03cdd51fdb5dacbf3402b4
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
---
src/cpu/amd/agesa/Makefile.inc | 1 +
src/cpu/amd/agesa/amd_late_init.c | 51 ++++++++++++++++++++++
src/mainboard/amd/dinar/agesawrapper.h | 1 +
src/mainboard/amd/dinar/get_bus_conf.c | 22 ----------
src/mainboard/amd/inagua/agesawrapper.h | 1 +
src/mainboard/amd/inagua/get_bus_conf.c | 21 ---------
src/mainboard/amd/olivehill/get_bus_conf.c | 35 ---------------
src/mainboard/amd/parmer/get_bus_conf.c | 35 ---------------
src/mainboard/amd/persimmon/get_bus_conf.c | 34 ---------------
src/mainboard/amd/south_station/agesawrapper.h | 1 +
src/mainboard/amd/south_station/get_bus_conf.c | 21 ---------
src/mainboard/amd/thatcher/get_bus_conf.c | 35 ---------------
src/mainboard/amd/torpedo/agesawrapper.h | 1 +
src/mainboard/amd/torpedo/get_bus_conf.c | 23 ----------
src/mainboard/amd/union_station/agesawrapper.h | 1 +
src/mainboard/amd/union_station/get_bus_conf.c | 21 ---------
src/mainboard/asrock/e350m1/agesawrapper.h | 1 +
src/mainboard/asrock/e350m1/get_bus_conf.c | 21 ---------
src/mainboard/asrock/imb-a180/get_bus_conf.c | 35 ---------------
src/mainboard/asus/f2a85-m/get_bus_conf.c | 35 ---------------
src/mainboard/gizmosphere/gizmo/get_bus_conf.c | 34 ---------------
src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c | 35 ---------------
src/mainboard/jetway/nf81-t56n-lf/get_bus_conf.c | 37 ----------------
.../lippert/frontrunner-af/get_bus_conf.c | 34 ---------------
src/mainboard/lippert/toucan-af/get_bus_conf.c | 34 ---------------
src/mainboard/supermicro/h8qgi/agesawrapper.h | 1 +
src/mainboard/supermicro/h8qgi/get_bus_conf.c | 22 ----------
src/mainboard/supermicro/h8scm/agesawrapper.h | 1 +
src/mainboard/supermicro/h8scm/get_bus_conf.c | 22 ----------
src/mainboard/tyan/s8226/agesawrapper.h | 1 +
src/mainboard/tyan/s8226/get_bus_conf.c | 22 ----------
31 files changed, 61 insertions(+), 578 deletions(-)
diff --git a/src/cpu/amd/agesa/Makefile.inc b/src/cpu/amd/agesa/Makefile.inc
index 1f29664..beba040 100644
--- a/src/cpu/amd/agesa/Makefile.inc
+++ b/src/cpu/amd/agesa/Makefile.inc
@@ -31,6 +31,7 @@ cpu_incs += $(src)/cpu/amd/agesa/cache_as_ram.inc
romstage-y += heapmanager.c
ramstage-y += heapmanager.c
+ramstage-y += amd_late_init.c
ifeq ($(CONFIG_HAVE_ACPI_RESUME), y)
diff --git a/src/cpu/amd/agesa/amd_late_init.c b/src/cpu/amd/agesa/amd_late_init.c
new file mode 100644
index 0000000..e08b159
--- /dev/null
+++ b/src/cpu/amd/agesa/amd_late_init.c
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Advanced Micro Devices, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/acpi.h>
+#include <bootstate.h>
+#include <console/console.h>
+
+#include "agesawrapper.h"
+
+void get_bus_conf(void);
+
+static void agesawrapper_post_device(void *unused)
+{
+ u32 status;
+ if (acpi_is_wakeup_s3())
+ return;
+
+ status = agesawrapper_amdinitlate();
+ if (status) {
+ printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
+ }
+
+ if (!acpi_s3_resume_allowed())
+ return;
+
+ status = agesawrapper_amdS3Save();
+ if (status) {
+ printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
+ }
+}
+
+BOOT_STATE_INIT_ENTRIES(agesa_bscb) = {
+ BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_EXIT,
+ agesawrapper_post_device, NULL),
+};
diff --git a/src/mainboard/amd/dinar/agesawrapper.h b/src/mainboard/amd/dinar/agesawrapper.h
index c42b2b0..b8b8db8 100644
--- a/src/mainboard/amd/dinar/agesawrapper.h
+++ b/src/mainboard/amd/dinar/agesawrapper.h
@@ -95,4 +95,5 @@ UINT32 agesawrapper_amdinitmmio (void);
void *agesawrapper_getlateinitptr (int pick);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/amd/dinar/get_bus_conf.c b/src/mainboard/amd/dinar/get_bus_conf.c
index a59bc43..a4d627b 100644
--- a/src/mainboard/amd/dinar/get_bus_conf.c
+++ b/src/mainboard/amd/dinar/get_bus_conf.c
@@ -66,8 +66,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
- u32 status;
-
device_t dev;
int i, j;
@@ -77,26 +75,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
printk(BIOS_DEBUG, "Mainboard - Get_bus_conf.c - get_bus_conf - Start.\n");
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- printk(BIOS_DEBUG, "Got past agesawrapper_amdinitlate\n");
sbdn_sb700 = 0;
diff --git a/src/mainboard/amd/inagua/agesawrapper.h b/src/mainboard/amd/inagua/agesawrapper.h
index 50b6a30..6e15a25 100644
--- a/src/mainboard/amd/inagua/agesawrapper.h
+++ b/src/mainboard/amd/inagua/agesawrapper.h
@@ -53,4 +53,5 @@ UINT32 agesawrapper_amdinitmmio (void);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
void *agesawrapper_getlateinitptr (int pick);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/amd/inagua/get_bus_conf.c b/src/mainboard/amd/inagua/get_bus_conf.c
index be281055..8ab41d1 100644
--- a/src/mainboard/amd/inagua/get_bus_conf.c
+++ b/src/mainboard/amd/inagua/get_bus_conf.c
@@ -55,7 +55,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -65,26 +64,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/amd/olivehill/get_bus_conf.c b/src/mainboard/amd/olivehill/get_bus_conf.c
index df6ebb7..3addc97 100644
--- a/src/mainboard/amd/olivehill/get_bus_conf.c
+++ b/src/mainboard/amd/olivehill/get_bus_conf.c
@@ -50,13 +50,9 @@ u32 sbdn_yangtze;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
u32 value;
device_t dev;
@@ -67,37 +63,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "hardwaremain". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- status = agesawrapper_amdS3Save();
- if (status) {
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
- }
-#else
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
dev = dev_find_slot(0, PCI_DEVFN(0, 0)); /* clear IoapicSbFeatureEn */
pci_write_config32(dev, 0xF8, 0);
pci_write_config32(dev, 0xFC, 5); /* TODO: move it to dsdt.asl */
diff --git a/src/mainboard/amd/parmer/get_bus_conf.c b/src/mainboard/amd/parmer/get_bus_conf.c
index bf76fe2..ce5276f 100644
--- a/src/mainboard/amd/parmer/get_bus_conf.c
+++ b/src/mainboard/amd/parmer/get_bus_conf.c
@@ -50,13 +50,9 @@ u32 sbdn_hudson;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -66,37 +62,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- status = agesawrapper_amdS3Save();
- if (status) {
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
- }
-#else
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_hudson = 0;
diff --git a/src/mainboard/amd/persimmon/get_bus_conf.c b/src/mainboard/amd/persimmon/get_bus_conf.c
index ac65a1d..15b1989 100644
--- a/src/mainboard/amd/persimmon/get_bus_conf.c
+++ b/src/mainboard/amd/persimmon/get_bus_conf.c
@@ -53,14 +53,9 @@ u32 sbdn_sb800;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
-
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -70,35 +65,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- status = agesawrapper_amdS3Save();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
-#else
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/amd/south_station/agesawrapper.h b/src/mainboard/amd/south_station/agesawrapper.h
index 48ed2f1..47332c5 100644
--- a/src/mainboard/amd/south_station/agesawrapper.h
+++ b/src/mainboard/amd/south_station/agesawrapper.h
@@ -53,4 +53,5 @@ UINT32 agesawrapper_amdinitmmio (void);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
void *agesawrapper_getlateinitptr (int pick);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif /* _AGESAWRAPPER_H_ */
diff --git a/src/mainboard/amd/south_station/get_bus_conf.c b/src/mainboard/amd/south_station/get_bus_conf.c
index df8ce6e..6a3d232 100644
--- a/src/mainboard/amd/south_station/get_bus_conf.c
+++ b/src/mainboard/amd/south_station/get_bus_conf.c
@@ -55,7 +55,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -65,26 +64,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/amd/thatcher/get_bus_conf.c b/src/mainboard/amd/thatcher/get_bus_conf.c
index bf76fe2..ce5276f 100644
--- a/src/mainboard/amd/thatcher/get_bus_conf.c
+++ b/src/mainboard/amd/thatcher/get_bus_conf.c
@@ -50,13 +50,9 @@ u32 sbdn_hudson;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -66,37 +62,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- status = agesawrapper_amdS3Save();
- if (status) {
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
- }
-#else
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_hudson = 0;
diff --git a/src/mainboard/amd/torpedo/agesawrapper.h b/src/mainboard/amd/torpedo/agesawrapper.h
index 9883bd1..5947b6b 100644
--- a/src/mainboard/amd/torpedo/agesawrapper.h
+++ b/src/mainboard/amd/torpedo/agesawrapper.h
@@ -95,4 +95,5 @@ UINT32 agesawrapper_amdinitmmio (void);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
void *agesawrapper_getlateinitptr (int pick);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/amd/torpedo/get_bus_conf.c b/src/mainboard/amd/torpedo/get_bus_conf.c
index 2b4e9fa..5404941 100644
--- a/src/mainboard/amd/torpedo/get_bus_conf.c
+++ b/src/mainboard/amd/torpedo/get_bus_conf.c
@@ -59,8 +59,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
- u32 status;
-
device_t dev;
int i, j;
@@ -70,27 +68,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
printk(BIOS_DEBUG, "Mainboard - %s - %s - Start.\n", __FILE__, __func__);
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate ");
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "error level: %x \n", status);
- else
- printk(BIOS_DEBUG, "passed.\n");
sbdn_sb900 = 0;
diff --git a/src/mainboard/amd/union_station/agesawrapper.h b/src/mainboard/amd/union_station/agesawrapper.h
index 48ed2f1..47332c5 100644
--- a/src/mainboard/amd/union_station/agesawrapper.h
+++ b/src/mainboard/amd/union_station/agesawrapper.h
@@ -53,4 +53,5 @@ UINT32 agesawrapper_amdinitmmio (void);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
void *agesawrapper_getlateinitptr (int pick);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif /* _AGESAWRAPPER_H_ */
diff --git a/src/mainboard/amd/union_station/get_bus_conf.c b/src/mainboard/amd/union_station/get_bus_conf.c
index df8ce6e..6a3d232 100644
--- a/src/mainboard/amd/union_station/get_bus_conf.c
+++ b/src/mainboard/amd/union_station/get_bus_conf.c
@@ -55,7 +55,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -65,26 +64,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/asrock/e350m1/agesawrapper.h b/src/mainboard/asrock/e350m1/agesawrapper.h
index 10158f6..b503559 100644
--- a/src/mainboard/asrock/e350m1/agesawrapper.h
+++ b/src/mainboard/asrock/e350m1/agesawrapper.h
@@ -84,4 +84,5 @@ UINT32 agesawrapper_amdinitcpuio (void);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
void *agesawrapper_getlateinitptr (int pick);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/asrock/e350m1/get_bus_conf.c b/src/mainboard/asrock/e350m1/get_bus_conf.c
index df8ce6e..6a3d232 100644
--- a/src/mainboard/asrock/e350m1/get_bus_conf.c
+++ b/src/mainboard/asrock/e350m1/get_bus_conf.c
@@ -55,7 +55,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -65,26 +64,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/asrock/imb-a180/get_bus_conf.c b/src/mainboard/asrock/imb-a180/get_bus_conf.c
index a380872..226d57d 100644
--- a/src/mainboard/asrock/imb-a180/get_bus_conf.c
+++ b/src/mainboard/asrock/imb-a180/get_bus_conf.c
@@ -47,13 +47,9 @@ u32 sbdn_yangtze;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
u32 value;
device_t dev;
@@ -64,37 +60,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "hardwaremain". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- status = agesawrapper_amdS3Save();
- if (status) {
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
- }
-#else
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
dev = dev_find_slot(0, PCI_DEVFN(0, 0)); /* clear IoapicSbFeatureEn */
pci_write_config32(dev, 0xF8, 0);
pci_write_config32(dev, 0xFC, 5); /* TODO: move it to dsdt.asl */
diff --git a/src/mainboard/asus/f2a85-m/get_bus_conf.c b/src/mainboard/asus/f2a85-m/get_bus_conf.c
index b915d76..5d5922b 100644
--- a/src/mainboard/asus/f2a85-m/get_bus_conf.c
+++ b/src/mainboard/asus/f2a85-m/get_bus_conf.c
@@ -48,13 +48,9 @@ u32 sbdn_hudson;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -64,37 +60,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- status = agesawrapper_amdS3Save();
- if (status) {
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
- }
-#else
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_hudson = 0;
diff --git a/src/mainboard/gizmosphere/gizmo/get_bus_conf.c b/src/mainboard/gizmosphere/gizmo/get_bus_conf.c
index 89118aa..3b43d9d 100755
--- a/src/mainboard/gizmosphere/gizmo/get_bus_conf.c
+++ b/src/mainboard/gizmosphere/gizmo/get_bus_conf.c
@@ -52,14 +52,9 @@ u32 sbdn_sb800;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
-
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -69,35 +64,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "hardwaremain". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- status = agesawrapper_amdS3Save();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
-#else
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c b/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c
index 79a5380..34afc17 100644
--- a/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c
+++ b/src/mainboard/hp/pavilion_m6_1035dx/get_bus_conf.c
@@ -49,13 +49,9 @@ u32 sbdn_hudson;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -65,37 +61,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
- status = agesawrapper_amdS3Save();
- if (status) {
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
- }
-#else
- status = agesawrapper_amdinitlate();
- if (status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_hudson = 0;
diff --git a/src/mainboard/jetway/nf81-t56n-lf/get_bus_conf.c b/src/mainboard/jetway/nf81-t56n-lf/get_bus_conf.c
index 688f9dd..69a86ab 100644
--- a/src/mainboard/jetway/nf81-t56n-lf/get_bus_conf.c
+++ b/src/mainboard/jetway/nf81-t56n-lf/get_bus_conf.c
@@ -54,14 +54,9 @@ u32 sbdn_sb800;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif /* CONFIG_HAVE_ACPI_RESUME */
-
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -72,39 +67,7 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place,
- * conceptually, but functionally within the coreboot model, this is the
- * best place to make the call. The logically correct place to call
- * AmdInitLate is after PCI scan is done, after the decision about S3
- * resume is made, and before the system tables are written into RAM. The
- * routine that is
- * responsible for writing the tables is "write_tables", called near the
- * end of "main". There is no platform specific entry point between the S3
- * resume decision point and the call to "write_tables", and the next
- * platform specific entry points are the calls to the ACPI table write
- * functions. The first of ose would seem to be the right place, but other
- * table write
- * functions, e.g. the PIRQ table write function, are called before the
- * ACPI tables are written. This routine is called at the beginning of each
- * of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- status = agesawrapper_amdS3Save();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
-#else
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif /* CONFIG_HAVE_ACPI_RESUME */
sbdn_sb800 = 0;
diff --git a/src/mainboard/lippert/frontrunner-af/get_bus_conf.c b/src/mainboard/lippert/frontrunner-af/get_bus_conf.c
index 258d895..1e7fca4 100644
--- a/src/mainboard/lippert/frontrunner-af/get_bus_conf.c
+++ b/src/mainboard/lippert/frontrunner-af/get_bus_conf.c
@@ -51,14 +51,9 @@ u32 sbdn_sb800;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
-
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -68,35 +63,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- status = agesawrapper_amdS3Save();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
-#else
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/lippert/toucan-af/get_bus_conf.c b/src/mainboard/lippert/toucan-af/get_bus_conf.c
index 258d895..1e7fca4 100644
--- a/src/mainboard/lippert/toucan-af/get_bus_conf.c
+++ b/src/mainboard/lippert/toucan-af/get_bus_conf.c
@@ -51,14 +51,9 @@ u32 sbdn_sb800;
static u32 get_bus_conf_done = 0;
-#if CONFIG_HAVE_ACPI_RESUME
-extern u8 acpi_slp_type;
-#endif
-
void get_bus_conf(void)
{
u32 apicid_base;
- u32 status;
device_t dev;
int i, j;
@@ -68,35 +63,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
-/*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
-#if CONFIG_HAVE_ACPI_RESUME
- if (acpi_slp_type != 3) {
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- status = agesawrapper_amdS3Save();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amds3save failed: %x \n", status);
- }
-#else
- status = agesawrapper_amdinitlate();
- if(status)
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
-#endif
sbdn_sb800 = 0;
memset(bus_sb800, 0, sizeof(bus_sb800));
diff --git a/src/mainboard/supermicro/h8qgi/agesawrapper.h b/src/mainboard/supermicro/h8qgi/agesawrapper.h
index 4f5a693..51e438d 100644
--- a/src/mainboard/supermicro/h8qgi/agesawrapper.h
+++ b/src/mainboard/supermicro/h8qgi/agesawrapper.h
@@ -79,4 +79,5 @@ UINT32 agesawrapper_amdinitmmio (void);
void *agesawrapper_getlateinitptr (int pick);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/supermicro/h8qgi/get_bus_conf.c b/src/mainboard/supermicro/h8qgi/get_bus_conf.c
index 25dc2a2..345c75d 100644
--- a/src/mainboard/supermicro/h8qgi/get_bus_conf.c
+++ b/src/mainboard/supermicro/h8qgi/get_bus_conf.c
@@ -48,8 +48,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
- u32 status;
-
device_t dev;
int i, j;
@@ -58,26 +56,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sp5100 = 0;
for (i = 0; i < ARRAY_SIZE(bus_sp5100); i++) {
diff --git a/src/mainboard/supermicro/h8scm/agesawrapper.h b/src/mainboard/supermicro/h8scm/agesawrapper.h
index 4f5a693..51e438d 100644
--- a/src/mainboard/supermicro/h8scm/agesawrapper.h
+++ b/src/mainboard/supermicro/h8scm/agesawrapper.h
@@ -79,4 +79,5 @@ UINT32 agesawrapper_amdinitmmio (void);
void *agesawrapper_getlateinitptr (int pick);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/supermicro/h8scm/get_bus_conf.c b/src/mainboard/supermicro/h8scm/get_bus_conf.c
index 4b2cb32..4b51f2a 100644
--- a/src/mainboard/supermicro/h8scm/get_bus_conf.c
+++ b/src/mainboard/supermicro/h8scm/get_bus_conf.c
@@ -48,8 +48,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
- u32 status;
-
device_t dev;
int i, j;
@@ -58,26 +56,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sp5100 = 0;
for (i = 0; i < 0; i++) {
diff --git a/src/mainboard/tyan/s8226/agesawrapper.h b/src/mainboard/tyan/s8226/agesawrapper.h
index 4f5a693..51e438d 100644
--- a/src/mainboard/tyan/s8226/agesawrapper.h
+++ b/src/mainboard/tyan/s8226/agesawrapper.h
@@ -79,4 +79,5 @@ UINT32 agesawrapper_amdinitmmio (void);
void *agesawrapper_getlateinitptr (int pick);
UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr);
+static inline UINT32 agesawrapper_amdS3Save(void) { return 0; }
#endif
diff --git a/src/mainboard/tyan/s8226/get_bus_conf.c b/src/mainboard/tyan/s8226/get_bus_conf.c
index d45e1ad..5c416c5 100644
--- a/src/mainboard/tyan/s8226/get_bus_conf.c
+++ b/src/mainboard/tyan/s8226/get_bus_conf.c
@@ -47,8 +47,6 @@ static u32 get_bus_conf_done = 0;
void get_bus_conf(void)
{
- u32 status;
-
device_t dev;
int i, j;
@@ -57,26 +55,6 @@ void get_bus_conf(void)
get_bus_conf_done = 1;
- /*
- * This is the call to AmdInitLate. It is really in the wrong place, conceptually,
- * but functionally within the coreboot model, this is the best place to make the
- * call. The logically correct place to call AmdInitLate is after PCI scan is done,
- * after the decision about S3 resume is made, and before the system tables are
- * written into RAM. The routine that is responsible for writing the tables is
- * "write_tables", called near the end of "main". There is no platform
- * specific entry point between the S3 resume decision point and the call to
- * "write_tables", and the next platform specific entry points are the calls to
- * the ACPI table write functions. The first of ose would seem to be the right
- * place, but other table write functions, e.g. the PIRQ table write function, are
- * called before the ACPI tables are written. This routine is called at the beginning
- * of each of the write functions called prior to the ACPI write functions, so this
- * becomes the best place for this call.
- */
- status = agesawrapper_amdinitlate();
- if(status) {
- printk(BIOS_DEBUG, "agesawrapper_amdinitlate failed: %x \n", status);
- }
-
sbdn_sp5100 = 0;
for (i = 0; i < 0; i++) {
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6137
-gerrit
commit 08aa304bc66c2f2d08e95b83ac48ef1c0fcf3816
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Wed Jun 11 12:53:47 2014 -0600
drivers/spi: Reduce the per loop delay of spi_flash_cmd_poll_bit()
At the end of some SPI operations the SPI device needs to be polled
to determine if it is done with the operation. For SPI data writes
the predicted time of that operation could be less than 10us.
The current per loop delay of 500us is adding too much delay.
This change replaces the delay(x) in the do-while loop with a
timer so that the actual timeout value won't be lengthened by the
delay of reading the SPI device.
Change-Id: Idf5a70182d66fc6a4b760ddae5f15a9fb654c9ff
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/drivers/spi/spi_flash.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 33588d5..6d92836 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -16,6 +16,7 @@
#include <cpu/x86/smm.h>
#endif
#include "spi_flash_internal.h"
+#include <timer.h>
static void spi_flash_addr(u32 addr, u8 *cmd)
{
@@ -106,27 +107,24 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
u8 cmd, u8 poll_bit)
{
struct spi_slave *spi = flash->spi;
- unsigned long timebase;
int ret;
u8 status;
+ struct mono_time current, end;
+
+ timer_monotonic_get(¤t);
+ end = current;
+ mono_time_add_msecs(&end, timeout);
- timebase = timeout;
do {
ret = spi_flash_cmd_read(spi, &cmd, 1, &status, 1);
if (ret)
return -1;
-
if ((status & poll_bit) == 0)
- break;
-
- udelay(500);
- } while (timebase--);
-
- if ((status & poll_bit) == 0)
- return 0;
+ return 0;
+ timer_monotonic_get(¤t);
+ } while (!mono_time_after(¤t, &end));
- /* Timed out */
- printk(BIOS_DEBUG, "SF: time out!\n");
+ printk(BIOS_DEBUG, "SF: timeout at %ld msec\n",timeout);
return -1;
}
Edward O'Callaghan (eocallaghan(a)alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6137
-gerrit
commit 5c2c362d35143c57e7aafc47cd16081610909b4f
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Wed Jun 11 12:53:47 2014 -0600
drivers/spi: Reduce the per loop delay of spi_flash_cmd_poll_bit()
At the end of some SPI operations the SPI device needs to be polled
to determine if it is done with the operation. For SPI data writes
the predicted time of that operation could be less than 10us.
The current per loop delay of 500us is adding too much delay.
This change replaces the delay(x) in the do-while loop with a
timer so that the actual timeout value won't be lengthened by the
delay of reading the SPI device.
Change-Id: Idf5a70182d66fc6a4b760ddae5f15a9fb654c9ff
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/drivers/spi/spi_flash.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 33588d5..6d92836 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -16,6 +16,7 @@
#include <cpu/x86/smm.h>
#endif
#include "spi_flash_internal.h"
+#include <timer.h>
static void spi_flash_addr(u32 addr, u8 *cmd)
{
@@ -106,27 +107,24 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
u8 cmd, u8 poll_bit)
{
struct spi_slave *spi = flash->spi;
- unsigned long timebase;
int ret;
u8 status;
+ struct mono_time current, end;
+
+ timer_monotonic_get(¤t);
+ end = current;
+ mono_time_add_msecs(&end, timeout);
- timebase = timeout;
do {
ret = spi_flash_cmd_read(spi, &cmd, 1, &status, 1);
if (ret)
return -1;
-
if ((status & poll_bit) == 0)
- break;
-
- udelay(500);
- } while (timebase--);
-
- if ((status & poll_bit) == 0)
- return 0;
+ return 0;
+ timer_monotonic_get(¤t);
+ } while (!mono_time_after(¤t, &end));
- /* Timed out */
- printk(BIOS_DEBUG, "SF: time out!\n");
+ printk(BIOS_DEBUG, "SF: timeout at %ld msec\n",timeout);
return -1;
}
David Hendricks (dhendrix(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6137
-gerrit
commit 55ab10c6819f879a76952c32a017e689355daa82
Author: Dave Frodin <dave.frodin(a)se-eng.com>
Date: Wed Jun 11 12:53:47 2014 -0600
drivers/spi: Reduce the per loop delay of spi_flash_cmd_poll_bit()
At the end of some SPI operations the SPI device needs to be polled
to determine if it is done with the operation. For SPI data writes
the predicted time of that operation could be less than 10us.
The current per loop delay of 500us is adding too much delay.
This change replaces the delay(x) in the do-while loop with a
timer so that the actual timeout value won't be lengthened by the
delay of reading the SPI device.
Change-Id: Idf5a70182d66fc6a4b760ddae5f15a9fb654c9ff
Signed-off-by: Dave Frodin <dave.frodin(a)se-eng.com>
---
src/drivers/spi/spi_flash.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c
index 33588d5..6d92836 100644
--- a/src/drivers/spi/spi_flash.c
+++ b/src/drivers/spi/spi_flash.c
@@ -16,6 +16,7 @@
#include <cpu/x86/smm.h>
#endif
#include "spi_flash_internal.h"
+#include <timer.h>
static void spi_flash_addr(u32 addr, u8 *cmd)
{
@@ -106,27 +107,24 @@ int spi_flash_cmd_poll_bit(struct spi_flash *flash, unsigned long timeout,
u8 cmd, u8 poll_bit)
{
struct spi_slave *spi = flash->spi;
- unsigned long timebase;
int ret;
u8 status;
+ struct mono_time current, end;
+
+ timer_monotonic_get(¤t);
+ end = current;
+ mono_time_add_msecs(&end, timeout);
- timebase = timeout;
do {
ret = spi_flash_cmd_read(spi, &cmd, 1, &status, 1);
if (ret)
return -1;
-
if ((status & poll_bit) == 0)
- break;
-
- udelay(500);
- } while (timebase--);
-
- if ((status & poll_bit) == 0)
- return 0;
+ return 0;
+ timer_monotonic_get(¤t);
+ } while (!mono_time_after(¤t, &end));
- /* Timed out */
- printk(BIOS_DEBUG, "SF: time out!\n");
+ printk(BIOS_DEBUG, "SF: timeout at %ld msec\n",timeout);
return -1;
}