[coreboot] New patch to review for coreboot: b5cd09f AMD S3: Remove hardcoded size of volatile storage

Zheng Bao (zheng.bao@amd.com) gerrit at coreboot.org
Wed Feb 13 12:02:30 CET 2013


Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2383

-gerrit

commit b5cd09f89299c7798fa46c89e94dae860a9696b0
Author: Zheng Bao <fishbaozi at gmail.com>
Date:   Wed Feb 13 19:01:55 2013 +0800

    AMD S3: Remove hardcoded size of volatile storage
    
    The size of volatile storage for S3 can be configured.
    The space is divided into several parts. Make sure the
    sum of each part is not above the limit.
    
    Change-Id: I9152797cf0045c8da48109a9d760e417717686db
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: zheng Bao <fishbaozi at gmail.com>
---
 src/cpu/amd/agesa/s3_resume.h            | 5 +++++
 src/southbridge/amd/Makefile.inc         | 2 +-
 src/southbridge/amd/agesa/hudson/Kconfig | 8 ++++++++
 src/southbridge/amd/cimx/sb700/Kconfig   | 7 +++++++
 src/southbridge/amd/cimx/sb800/Kconfig   | 8 ++++++++
 src/southbridge/amd/cimx/sb900/Kconfig   | 8 ++++++++
 6 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/src/cpu/amd/agesa/s3_resume.h b/src/cpu/amd/agesa/s3_resume.h
index 39ad30a..9f66d6a 100644
--- a/src/cpu/amd/agesa/s3_resume.h
+++ b/src/cpu/amd/agesa/s3_resume.h
@@ -28,6 +28,11 @@
 #define S3_DATA_MTRR_POS	(CONFIG_S3_VOLATILE_POS + S3_DATA_VOLATILE_SIZE)
 #define S3_DATA_NONVOLATILE_POS	(CONFIG_S3_VOLATILE_POS + S3_DATA_VOLATILE_SIZE + S3_DATA_MTRR_SIZE)
 
+#if (S3_DATA_VOLATILE_SIZE + S3_DATA_MTRR_SIZE + S3_DATA_NONVOLATILE_SIZE) > CONFIG_S3_VOLATILE_SIZE
+#error "Pleaes expand your S3_VOLATILE_SIZE"
+#endif
+
+
 typedef enum {
 	S3DataTypeNonVolatile=0,            ///< NonVolatile Data Type
 	S3DataTypeVolatile                  ///< Volatile Data Type
diff --git a/src/southbridge/amd/Makefile.inc b/src/southbridge/amd/Makefile.inc
index 1b2cb1f..b6af980 100644
--- a/src/southbridge/amd/Makefile.inc
+++ b/src/southbridge/amd/Makefile.inc
@@ -22,7 +22,7 @@ ifeq ($(CONFIG_CPU_AMD_AGESA), y)
 $(obj)/coreboot_s3nv.rom: $(obj)/config.h
 	echo "    S3 NVRAM   $(CONFIG_S3_VOLATILE_POS) (S3 storage area)"
 	# force C locale, so cygwin awk doesn't try to interpret the 0xff below as UTF-8 (or worse)
-	LC_ALL=C awk 'BEGIN {for (i=0; i<32768; i++) {printf "%c", 255}}' > $@.tmp
+	printf %d $(CONFIG_S3_VOLATILE_SIZE) | LC_ALL=C awk '{for (i=0; i<$$1; i++) {printf "%c", 255}}' > $@.tmp
 	mv $@.tmp $@
 
 cbfs-files-y += s3nv
diff --git a/src/southbridge/amd/agesa/hudson/Kconfig b/src/southbridge/amd/agesa/hudson/Kconfig
index 92e5960..c652670 100644
--- a/src/southbridge/amd/agesa/hudson/Kconfig
+++ b/src/southbridge/amd/agesa/hudson/Kconfig
@@ -212,6 +212,14 @@ config S3_VOLATILE_POS
 	  For a system with S3 feature, the BIOS needs to save some data to
 	  non-volitile storage at cold boot stage.
 
+config S3_VOLATILE_SIZE
+	hex "S3 volatile storage size"
+	default 0x8000
+	depends on HAVE_ACPI_RESUME
+	help
+	  For a system with S3 feature, the BIOS needs to save some data to
+	  non-volitile storage at cold boot stage.
+
 config HUDSON_LEGACY_FREE
 	bool "System is legacy free"
 	help
diff --git a/src/southbridge/amd/cimx/sb700/Kconfig b/src/southbridge/amd/cimx/sb700/Kconfig
index f139450..4105393 100644
--- a/src/southbridge/amd/cimx/sb700/Kconfig
+++ b/src/southbridge/amd/cimx/sb700/Kconfig
@@ -68,5 +68,12 @@ config S3_VOLATILE_POS
 	  For a system with S3 feature, the BIOS needs to save some data to
 	  non-volitile storage at cold boot stage.
 
+config S3_VOLATILE_SIZE
+	hex "S3 volatile storage size"
+	default 0x8000
+	depends on HAVE_ACPI_RESUME
+	help
+	  For a system with S3 feature, the BIOS needs to save some data to
+	  non-volitile storage at cold boot stage.
 endif #SOUTHBRIDGE_AMD_CIMX_SB700
 
diff --git a/src/southbridge/amd/cimx/sb800/Kconfig b/src/southbridge/amd/cimx/sb800/Kconfig
index 1f3ee9a..9add77b 100644
--- a/src/southbridge/amd/cimx/sb800/Kconfig
+++ b/src/southbridge/amd/cimx/sb800/Kconfig
@@ -130,6 +130,14 @@ config S3_VOLATILE_POS
 	  For a system with S3 feature, the BIOS needs to save some data to
 	  non-volitile storage at cold boot stage.
 
+config S3_VOLATILE_SIZE
+	hex "S3 volatile storage size"
+	default 0x8000
+	depends on HAVE_ACPI_RESUME
+	help
+	  For a system with S3 feature, the BIOS needs to save some data to
+	  non-volitile storage at cold boot stage.
+
 config SB800_IMC_FWM
 	bool "Add IMC firmware"
 	default n
diff --git a/src/southbridge/amd/cimx/sb900/Kconfig b/src/southbridge/amd/cimx/sb900/Kconfig
index acc369e..862589c 100755
--- a/src/southbridge/amd/cimx/sb900/Kconfig
+++ b/src/southbridge/amd/cimx/sb900/Kconfig
@@ -61,5 +61,13 @@ config S3_VOLATILE_POS
 	  For a system with S3 feature, the BIOS needs to save some data to
 	  non-volitile storage at cold boot stage.
 
+config S3_VOLATILE_SIZE
+	hex "S3 volatile storage size"
+	default 0x8000
+	depends on HAVE_ACPI_RESUME
+	help
+	  For a system with S3 feature, the BIOS needs to save some data to
+	  non-volitile storage at cold boot stage.
+
 endif #SOUTHBRIDGE_AMD_CIMX_SB900
 



More information about the coreboot mailing list