[coreboot] Patch set updated for coreboot: 090d4d8 Add a capability for mainboard-specific posting.

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Fri Aug 3 00:31:43 CEST 2012

Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1397


commit 090d4d8421bb113ce98aca598f587fd558b17c80
Author: Ronald G. Minnich <rminnich at 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)
    		case 0xfe: some_fancy_lights();
    Maybe the post function should be an entry in the device. We're beginning to over-use
    weak symbols.
    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 at 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)
 void post_code(uint8_t value)
@@ -34,4 +43,7 @@ void post_code(uint8_t value)
 	outb(value, CONFIG_POST_PORT);
+#ifndef __ROMCC__
+	mainboard_post(value);
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)));

More information about the coreboot mailing list