From f88204e02b2ece82a76544070f37a4e2e2bd0f11 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Fri, 3 Aug 2012 13:20:57 -0500 Subject: 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 POST_TIME_TO_PARTY: 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 Signed-off-by: Alexandru Gagniuc Reviewed-on: http://review.coreboot.org/1397 Tested-by: build bot (Jenkins) --- src/console/post.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/console') diff --git a/src/console/post.c b/src/console/post.c index 08336a28e9..be2d0e9307 100644 --- a/src/console/post.c +++ b/src/console/post.c @@ -24,6 +24,20 @@ /* 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) +{ +} + +#else +/* This just keeps the number of #ifs to a minimum */ +#define mainboard_post(x) +#endif + void post_code(uint8_t value) { #if !CONFIG_NO_POST @@ -34,4 +48,5 @@ void post_code(uint8_t value) #endif outb(value, CONFIG_POST_PORT); #endif + mainboard_post(value); } -- cgit v1.2.3