Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1401
-gerrit
commit f80c3d9eff0d31d02cf8f541a55b3576dc89aedc
Author: zbao <fishbaozi(a)gmail.com>
Date: Fri Aug 3 14:56:49 2012 +0800
Trivial: Change <tab># to <tab>@# in Makefile command
My editor highlights the <tab># as syntax error. I think it is because
every line starting with a <tab> is seen as a command. But # is not a
makefile accepted command, is it? I found in {top}/Makefile.inc there
are some <tab>@#. So I think every makefile should sync with that format.
Change-Id: Ib86165df4fefff3007693f9b8077a5a0a00bb6d3
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: zbao <fishbaozi(a)gmail.com>
---
Makefile.inc | 2 +-
documentation/Makefile | 2 +-
payloads/external/FILO/Makefile.inc | 4 ++--
payloads/external/SeaBIOS/Makefile.inc | 4 ++--
src/southbridge/amd/Makefile.inc | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/Makefile.inc b/Makefile.inc
index ca1e066..4259cad 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -95,7 +95,7 @@ $(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h
cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$(basename $$(a))).asl
mv $$(basename $$(a)).hex $$(basename $$(a)).c
$(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$(a)).c
- # keep %.o: %.c rule from catching the temporary .c file after a make clean
+ @# keep %.o: %.c rule from catching the temporary .c file after a make clean
mv $$(basename $$(a)).c $$(basename $$(a)).hex
endef
diff --git a/documentation/Makefile b/documentation/Makefile
index 84ac0b5..1a19828 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -32,7 +32,7 @@ else ifneq ($(strip $(CONVERT)),)
endif
LinuxBIOS-AMD64.toc: $(FIGS) LinuxBIOS-AMD64.tex
- # 2 times to make sure we have a current toc.
+ @# 2 times to make sure we have a current toc.
$(PDFLATEX) LinuxBIOS-AMD64.tex
$(PDFLATEX) LinuxBIOS-AMD64.tex
diff --git a/payloads/external/FILO/Makefile.inc b/payloads/external/FILO/Makefile.inc
index 311b3c8..cce075b 100644
--- a/payloads/external/FILO/Makefile.inc
+++ b/payloads/external/FILO/Makefile.inc
@@ -27,8 +27,8 @@ config: libpayload
echo "CONFIG_LZMA=y" >> filo/.config
echo "CONFIG_FLASH_FLOPPY=y" >> filo/.config
echo "CONFIG_VGAHOOKS=y" >> filo/.config
- # This shows how to force a previously set .config option *off*
- #echo "# CONFIG_SMBIOS is not set" >> filo/.config
+ @# This shows how to force a previously set .config option *off*
+ @#echo "# CONFIG_SMBIOS is not set" >> filo/.config
filo: config
echo " MAKE FILO $(NAME-y)"
diff --git a/payloads/external/SeaBIOS/Makefile.inc b/payloads/external/SeaBIOS/Makefile.inc
index e0f03b1..8e47576 100644
--- a/payloads/external/SeaBIOS/Makefile.inc
+++ b/payloads/external/SeaBIOS/Makefile.inc
@@ -29,8 +29,8 @@ config: checkout
echo "CONFIG_LZMA=y" >> $(OUT)/seabios/.config
echo "CONFIG_FLASH_FLOPPY=y" >> $(OUT)/seabios/.config
echo "CONFIG_VGAHOOKS=y" >> $(OUT)/seabios/.config
- # This shows how to force a previously set .config option *off*
- #echo "# CONFIG_SMBIOS is not set" >> $(OUT)/seabios/.config
+ @# This shows how to force a previously set .config option *off*
+ @#echo "# CONFIG_SMBIOS is not set" >> $(OUT)/seabios/.config
build: config
echo " MAKE SeaBIOS $(TAG-y)"
diff --git a/src/southbridge/amd/Makefile.inc b/src/southbridge/amd/Makefile.inc
index 9709715..733a9bc 100644
--- a/src/southbridge/amd/Makefile.inc
+++ b/src/southbridge/amd/Makefile.inc
@@ -21,7 +21,7 @@ ifeq ($(CONFIG_CPU_AMD_AGESA), y)
$(obj)/s3.rom:
echo " S3 NVRAM 0xffff0000 (S3 storage area)"
- # force C locale, so cygwin awk doesn't try to interpret the 0xff below as UTF-8 (or worse)
+ @ # 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
mv $@.tmp $@
Zheng Bao (zheng.bao(a)amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1400
-gerrit
commit 7930ea30fbd307013159deeb1aeee0ca80d05736
Author: zbao <fishbaozi(a)gmail.com>
Date: Fri Aug 3 13:53:10 2012 +0800
AMD S3: Add a document about S3 on AMD platform
See the document. Need review. Everything should be in Authentic
English.
Change-Id: Idc528b8c6b0d5afe08fc4f4387b7bff30698f677
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: zbao <fishbaozi(a)gmail.com>
---
documentation/AMD-S3.txt | 95 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 insertions(+), 0 deletions(-)
diff --git a/documentation/AMD-S3.txt b/documentation/AMD-S3.txt
new file mode 100644
index 0000000..58ee0d7
--- /dev/null
+++ b/documentation/AMD-S3.txt
@@ -0,0 +1,95 @@
+ _____ ____ _____ ______ ____ ____ ____ _______
+ / ____/ __ \| __ \| ____| _ \ / __ \ / __ \__ __|
+ | | | | | | |__) | |__ | |_) | | | | | | | | |
+ | | | | | | _ /| __| | _ <| | | | | | | | |
+ | |___| |__| | | \ \| |____| |_) | |__| | |__| | | |
+ \_____\____/|_| \_\______|____/ \____/ \____/ |_|
+
+ __ __ _____ _____ ____
+ /\ | \/ | __ \ / ____| |___ \
+ / \ | \ / | | | | | (___ __) |
+ / /\ \ | |\/| | | | | \___ \ |__ <
+ / ____ \| | | | |__| | ____) | ___) |
+ /_/ \_\_| |_|_____/ |_____/ |____/
+
+
+ S3 in Coreboot
+----------------------------------------
+ Zheng Bao
+ <zheng.bao(a)amd.com>
+ <fishbaozi(a)gmail.com>
+
+Introduction
+============
+This document is about how the feature S3 is implemented on coreboot,
+specificly on AMD platform. This topic deals with ACPI spec, hardware,
+BIOS, OS. We try to help coreboot users to realize their own S3.
+
+S3 in a nutshell
+================
+The S3 sleeping state is a low wake latency sleeping state where all
+system context is lost except system memory. [1]. S3 is a ACPI
+definition.
+To enter S3, write 3 in SLP_TYPx and setting the SLP_EN bit. But if
+you do that, board can not resume at where it sleeps, because you
+don't save the context. More often than not, we make the board go into
+S3 by the tools which OSes provide. For windows, click
+Start->sleep. For linux, some distribution provide a tools called
+pm-suspend, which can make the system goto S3. If pm-suspend is not
+available, we can run "echo mem > /sys/power/state", but this way may
+not save all the needed context.
+In S3 state, the power is off. So when the power button is pressed,
+BIOS runs as it does in cold boot. If BIOS didn't detect whether
+board boots or resume, it would go the same way as boot. It is not
+what we expect. BIOS detects the SLP_TYPx. If it is 3, it means BIOS
+are waking up.
+BIOS is responsible for restore the machine state as it is before
+sleep. It needs restore the memory controller, not overwriting memory
+which is marked as reserved. For the peripheral which loses its
+registers, BIOS needs to write the original value.
+When everything is done, BIOS needs to find out the wakeup vector
+provided by OSes and jump there. OSes also have work to do. We can go
+to linux kernel or some other open source projects to find out how they
+handle S3 resume.
+
+Memory Layout
+=============
+Restoring memory is the most important job done by BIOS. When the
+power is off, the memory is maintained by standby power. BIOS need to
+make sure that when flow goes to OS, everything in memory should be
+the same as it was.
+
+The chip vendor will provide a way, or code, to wake up the memory
+from sleeping. In AGESA 2008 arch, it is called AmdInitResume.
+
+The BIOS itself needs some memory to run. Either, BIOS marks the erea
+as reserved in e820, or BIOS saves the content into reserved space.
+
+Here is the address Map for S3 Resume. Assumingly the total memory is 1GB.
+00000000 --- 00100000 BIOS Reserved area.
+00100000 --- 00200000 Free
+00200000 --- 01000000 Coreboot ramstage area.
+01000000 --- 2e160000 Free
+2e160000 --- 2e170000 ACPI table
+2e170000 --- 2ef70000 OSRAM
+2ef70000 --- 2efe0000 Stack in highmem
+2efe0000 --- 2f000000 heap in highmem
+2f000000 TOM
+
+AMD requirements in S3
+======================
+Chip vendor like AMD will provide bunch of routines to restore the
+board.[2]
+ * AmdS3Save: It is called in cold boot, save required register into
+ non-volatile storage. Currently, we use SPI flash to store the data.
+ * AmdInitResume: Restore the memory controller.
+ * AmdS3LateRestore: Called after AmdInitResume, restore other
+ register that memory.
+ * (SouthBridge)InitS3EarlyRestore, (SouthBridge)InitS3LateRestore:
+ Provided by Southbridge vendor code. Early is called before PCI
+ enumeration, and Late is called after that.
+
+Reference
+=========
+[1] ACPI40
+[2] Coreboot Vendorcode
the following patch was just integrated into master:
commit 24a31006d5089550f08076b78e51d92d687ae77a
Author: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Date: Fri Jul 27 19:22:26 2012 +0300
Fix mainboard level enable_dev()
Commit 188e3c2ff06a82f61d7d71e610b32b1a250c0a45 dropped mainboard
out of the static device tree. This left dev_root->chip_ops unset,
and mainboard_ops.enable_dev() was no longer called.
Change-Id: I6d447c8049a66041b8bb36ec9aac3e7e0d20a99b
Signed-off-by: Kyösti Mälkki <kyosti.malkki(a)gmail.com>
Build-Tested: build bot (Jenkins) at Fri Jul 27 22:04:59 2012, giving +1
Reviewed-By: Stefan Reinauer <stefan.reinauer(a)coreboot.org> at Fri Aug 3 00:34:49 2012, giving +2
See http://review.coreboot.org/1374 for details.
-gerrit
Alexandru Gagniuc (mr.nuke.me(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1397
-gerrit
commit 090d4d8421bb113ce98aca598f587fd558b17c80
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Thu Aug 2 09:34:05 2012 -0700
Add a capability for mainboard-specific posting.
Some mainboards have really nice capabilities for posting, beyond
simple POST cards. Further, some can not use a POST card. This
change defines a weak symbol (mainboard_post) that can be overridden
by a real mainboard_post function.
If, for example, you'd like to do something fancy before the payload starts,
you can add this to mainboard.c:
void mainboard_post(u8 value)
{
switch(value){
case 0xfe: some_fancy_lights();
break;
}
}
Maybe the post function should be an entry in the device. We're beginning to over-use
weak symbols.
BUG=None
TEST=Build and boot a google chromebook. Observe that it still works. Use it to drive
some pretty lights.
Change-Id: I3512d2ec34a66c747287191851c3f68b6a7cc1b2
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/console/post.c | 12 ++++++++++++
src/include/console/console.h | 2 ++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/console/post.c b/src/console/post.c
index 08336a2..9cdad99 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -24,6 +24,15 @@
/* Write POST information */
+/* someday romcc will be gone. */
+#ifndef __ROMCC__
+/* Some mainboards have very nice features beyond just a simple
+ * display. They can override this function.
+ */
+void __attribute__((weak)) mainboard_post(uint8_t value)
+{
+}
+#endif
void post_code(uint8_t value)
{
#if !CONFIG_NO_POST
@@ -34,4 +43,7 @@ void post_code(uint8_t value)
#endif
outb(value, CONFIG_POST_PORT);
#endif
+#ifndef __ROMCC__
+ mainboard_post(value);
+#endif
}
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 56e202d..00be96f 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -69,6 +69,8 @@ extern int console_loglevel;
#ifndef __ROMCC__
void console_init(void);
void post_code(u8 value);
+/* this function is weak and can be overridden by a mainboard function. */
+void mainboard_post(u8 value);
void __attribute__ ((noreturn)) die(const char *msg);
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
the following patch was just integrated into master:
commit 31b06e2259ccfd84e8fe1f5f0bc1b2bcb58c6a28
Author: zbao <fishbaozi(a)gmail.com>
Date: Thu Aug 2 19:02:26 2012 +0800
RTC: Add a routine to check if the CMOS date is valid
If the CMOS is cleared or someone writes some random date/time
on purpose, the CMOS date register has a invalid date. This will
hurts some OS, like Windows 7, which hangs at MS logo forever.
When we detect that, we need to write a reasonable date in CMOS.
Alexandru Gagniuc:
Hmm, it would be interesting to use the date the coreboot image
was built and set that as the default date. At least until time
travel is invented.
Change-Id: Ic1c7a2d60e711265686441c77bdf7891a7efb42e
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: zbao <fishbaozi(a)gmail.com>
Reviewed-By: Patrick Georgi <patrick(a)georgi-clan.de> at Thu Aug 2 12:37:23 2012, giving +2
Build-Tested: build bot (Jenkins) at Thu Aug 2 12:27:22 2012, giving +1
See http://review.coreboot.org/1389 for details.
-gerrit
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1397
-gerrit
commit 2e4210338aa7a2a8d3725432458e24dae071280d
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Thu Aug 2 09:34:05 2012 -0700
Add a capability for mainboard-specific posting.
Some mainboards have really nice capabilities for posting, beyond
simple POST cards. Further, some can not use a POST card. This
change defines a weak symbol (mainboard_post) that can be overridden
by a real mainboard_post function.
If, for example, you'd like to do something fancy before the payload starts,
you can add this to mainboard.c:
void mainboard_post(u8 value)
{
switch(value){
case 0xfe: some_fancy_lights();
break;
}
}
Maybe the post function should be an entry in the device. We're beginning to over-use
weak symbols.
BUG=None
TEST=Build and boot a google chromebook. Observe that it still works. Use it to drive
some pretty lights.
Change-Id: I3512d2ec34a66c747287191851c3f68b6a7cc1b2
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/console/post.c | 12 ++++++++++++
src/include/console/console.h | 2 ++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/console/post.c b/src/console/post.c
index 08336a2..9cdad99 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -24,6 +24,15 @@
/* Write POST information */
+/* someday romcc will be gone. */
+#ifndef __ROMCC__
+/* Some mainboards have very nice features beyond just a simple
+ * display. They can override this function.
+ */
+void __attribute__((weak)) mainboard_post(uint8_t value)
+{
+}
+#endif
void post_code(uint8_t value)
{
#if !CONFIG_NO_POST
@@ -34,4 +43,7 @@ void post_code(uint8_t value)
#endif
outb(value, CONFIG_POST_PORT);
#endif
+#ifndef __ROMCC__
+ mainboard_post(value);
+#endif
}
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 56e202d..00be96f 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -69,6 +69,8 @@ extern int console_loglevel;
#ifndef __ROMCC__
void console_init(void);
void post_code(u8 value);
+/* this function is weak and can be overridden by a mainboard function. */
+void mainboard_post(u8 value);
void __attribute__ ((noreturn)) die(const char *msg);
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
Ronald G. Minnich (rminnich(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1397
-gerrit
commit 8f45a843b44583fdeade2a78e657efe8424b144b
Author: Ronald G. Minnich <rminnich(a)gmail.com>
Date: Thu Aug 2 09:34:05 2012 -0700
Add a capability for mainboard-specific posting.
Some mainboards have really nice capabilities for posting, beyond
simple POST cards. Further, some can not use a POST card. This
change defines a weak symbol (mainboard_post) that can be overridden
by a real mainboard_post function.
If, for example, you'd like to do something fancy before the payload starts,
you can add this to mainboard.c:
void mainboard_post(u8 value)
{
switch(value){
case 0xfe: some_fancy_lights();
break;
}
}
Maybe the post function should be an entry in the device. We're beginning to over-use
weak symbols.
BUG=None
TEST=Build and boot a google chromebook. Observe that it still works. Use it to drive
some pretty lights.
Change-Id: I3512d2ec34a66c747287191851c3f68b6a7cc1b2
Signed-off-by: Ronald G. Minnich <rminnich(a)gmail.com>
---
src/console/post.c | 8 ++++++++
src/include/console/console.h | 2 ++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/console/post.c b/src/console/post.c
index 08336a2..0f95427 100644
--- a/src/console/post.c
+++ b/src/console/post.c
@@ -24,6 +24,13 @@
/* Write POST information */
+/* Some mainboards have very nice features beyond just a simple
+ * display. They can override this function.
+ */
+void __attribute__((weak)) mainboard_post(uint8_t value)
+{
+}
+
void post_code(uint8_t value)
{
#if !CONFIG_NO_POST
@@ -33,5 +40,6 @@ void post_code(uint8_t value)
print_emerg("\n");
#endif
outb(value, CONFIG_POST_PORT);
+ mainboard_post(value);
#endif
}
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 56e202d..00be96f 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -69,6 +69,8 @@ extern int console_loglevel;
#ifndef __ROMCC__
void console_init(void);
void post_code(u8 value);
+/* this function is weak and can be overridden by a mainboard function. */
+void mainboard_post(u8 value);
void __attribute__ ((noreturn)) die(const char *msg);
int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
the following patch was just integrated into master:
commit 6c9e7d7c6d8eb28b39c9bef1211031a88fd5773e
Author: zbao <fishbaozi(a)gmail.com>
Date: Mon Jul 23 19:49:40 2012 +0800
Limit the device field to 5 bits.
The field device in PCI_ADDRESS only takes 5 bits. So if the device number is
more than 32, it will truncated to 5 bits. Before this patch, other pci devices
will be incorrectly probed as processor node.
Change-Id: I64dcd4f4fda7b7080a9905dce580feb829584b94
Signed-off-by: Zheng Bao <zheng.bao(a)amd.com>
Signed-off-by: zbao <fishbaozi(a)gmail.com>
Build-Tested: build bot (Jenkins) at Tue Jul 31 13:08:25 2012, giving +1
Reviewed-By: Anton Kochkov <anton.kochkov(a)gmail.com> at Thu Aug 2 13:03:08 2012, giving +1
Reviewed-By: Ronald G. Minnich <rminnich(a)gmail.com> at Tue Jul 31 17:45:57 2012, giving +2
See http://review.coreboot.org/1264 for details.
-gerrit