diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-03-28 21:26:54 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-03-28 21:26:54 +0000 |
commit | 35b6bbb7217956fe29f5d7f29d3ce780f1e640f5 (patch) | |
tree | df9e6309e10de7887d8346c8e1fd2dcc2b1f3e2e /src/arch/i386 | |
parent | 83a1dd850b9f61929a2db17a9429d3d193e34bfb (diff) | |
download | coreboot-35b6bbb7217956fe29f5d7f29d3ce780f1e640f5.tar.xz |
drop unneeded __ROMCC__ checks when the check for __PRE_RAM__ is more
appropriate. Also, factor out post_code() for __PRE_RAM__ code and drop it from
some mainboards.
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5307 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/i386')
-rw-r--r-- | src/arch/i386/include/arch/cpu.h | 2 | ||||
-rw-r--r-- | src/arch/i386/include/arch/hlt.h | 2 | ||||
-rw-r--r-- | src/arch/i386/include/arch/io.h | 8 | ||||
-rw-r--r-- | src/arch/i386/lib/console.c | 13 | ||||
-rw-r--r-- | src/arch/i386/lib/console_print.c | 4 |
5 files changed, 19 insertions, 10 deletions
diff --git a/src/arch/i386/include/arch/cpu.h b/src/arch/i386/include/arch/cpu.h index d43c847cef..47d4baf63b 100644 --- a/src/arch/i386/include/arch/cpu.h +++ b/src/arch/i386/include/arch/cpu.h @@ -104,7 +104,7 @@ static inline unsigned int cpuid_edx(unsigned int op) #define X86_VENDOR_SIS 10 #define X86_VENDOR_UNKNOWN 0xff -#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__) && defined( __GNUC__) +#if !defined(__PRE_RAM__) #include <device/device.h> diff --git a/src/arch/i386/include/arch/hlt.h b/src/arch/i386/include/arch/hlt.h index 931e933fc7..ddfe169954 100644 --- a/src/arch/i386/include/arch/hlt.h +++ b/src/arch/i386/include/arch/hlt.h @@ -1,7 +1,7 @@ #ifndef ARCH_HLT_H #define ARCH_HLT_H -#if defined( __ROMCC__) && !defined(__PRE_RAM__) && !defined(__GNUC__) +#if defined(__ROMCC__) static void hlt(void) { __builtin_hlt(); diff --git a/src/arch/i386/include/arch/io.h b/src/arch/i386/include/arch/io.h index e2e15ec762..3a76579fbc 100644 --- a/src/arch/i386/include/arch/io.h +++ b/src/arch/i386/include/arch/io.h @@ -9,7 +9,7 @@ * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing" * versions of the single-IO instructions (inb_p/inw_p/..). */ -#if defined( __ROMCC__ ) && !defined (__GNUC__) +#if defined(__ROMCC__) static inline void outb(uint8_t value, uint16_t port) { __builtin_outb(value, port); @@ -42,7 +42,6 @@ static inline uint32_t inl(uint16_t port) return __builtin_inl(port); } #else - static inline void outb(uint8_t value, uint16_t port) { __asm__ __volatile__ ("outb %b0, %w1" : : "a" (value), "Nd" (port)); @@ -78,8 +77,7 @@ static inline uint32_t inl(uint16_t port) __asm__ __volatile__ ("inl %w1, %0" : "=a"(value) : "Nd" (port)); return value; } - -#endif /* __ROMCC__ && !__GNUC__*/ +#endif /* __ROMCC__ */ static inline void outsb(uint16_t port, const void *addr, unsigned long count) { @@ -136,6 +134,7 @@ static inline void insl(uint16_t port, void *addr, unsigned long count) ); } +#if 0 /* XXX XXX XXX This is a story from the evil API from hell XXX XXX XXX * We have different functions for memory access in pre-ram stage and ram * stage. Those in pre-ram stage are called write32 and expect the address @@ -173,6 +172,7 @@ static inline uint32_t readl(const volatile void *addr) { return *(volatile uint32_t *) addr; } +#endif #if !defined(__PRE_RAM__) static inline __attribute__((always_inline)) uint8_t read8(unsigned long addr) diff --git a/src/arch/i386/lib/console.c b/src/arch/i386/lib/console.c index 15d65a31c7..69b5a66f38 100644 --- a/src/arch/i386/lib/console.c +++ b/src/arch/i386/lib/console.c @@ -19,6 +19,19 @@ void console_init(void) print_info(console_test); } + +void post_code(u8 value) +{ +#if !defined(CONFIG_NO_POST) || CONFIG_NO_POST==0 +#if CONFIG_SERIAL_POST==1 + print_emerg("POST: 0x"); + print_emerg_hex8(value); + print_emerg("\r\n"); +#endif + outb(value, 0x80); +#endif +} + void die(const char *str) { print_emerg(str); diff --git a/src/arch/i386/lib/console_print.c b/src/arch/i386/lib/console_print.c index 0aa540d153..2acec2308a 100644 --- a/src/arch/i386/lib/console_print.c +++ b/src/arch/i386/lib/console_print.c @@ -62,10 +62,6 @@ static void __console_tx_string(int loglevel, const char *str) } } -/* Actually this should say defined(__ROMCC__) but that define is explicitly - * set in some romstage.c files to trigger the simple device_t version to be used. - * So __GNUCC__ does the right thing here. - */ #if defined (__ROMCC__) #define STATIC #else |