include/console: Use IS_ENABLED() macro

Change-Id: I3d0c61c37399e96c1d154c1d3af5c47db967a07a
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.coreboot.org/19763
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
This commit is contained in:
Nico Huber 2017-05-18 16:12:07 +02:00 committed by Nico Huber
parent 7b811d5e36
commit afa9aefce0
8 changed files with 19 additions and 16 deletions

View file

@ -21,10 +21,11 @@
void cbmemc_init(void); void cbmemc_init(void);
void cbmemc_tx_byte(unsigned char data); void cbmemc_tx_byte(unsigned char data);
#define __CBMEM_CONSOLE_ENABLE__ (CONFIG_CONSOLE_CBMEM && \ #define __CBMEM_CONSOLE_ENABLE__ (IS_ENABLED(CONFIG_CONSOLE_CBMEM) && \
(ENV_RAMSTAGE || ENV_VERSTAGE || ENV_POSTCAR || \ (ENV_RAMSTAGE || ENV_VERSTAGE || ENV_POSTCAR || \
(IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && \ (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT) && \
(ENV_ROMSTAGE || (ENV_BOOTBLOCK && CONFIG_BOOTBLOCK_CONSOLE)))\ (ENV_ROMSTAGE || \
(ENV_BOOTBLOCK && IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE))))\
)) ))
#if __CBMEM_CONSOLE_ENABLE__ #if __CBMEM_CONSOLE_ENABLE__

View file

@ -28,7 +28,7 @@
#ifndef __ROMCC__ #ifndef __ROMCC__
void post_code(u8 value); void post_code(u8 value);
#if CONFIG_CMOS_POST_EXTRA #if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
void post_log_extra(u32 value); void post_log_extra(u32 value);
struct device; struct device;
void post_log_path(struct device *dev); void post_log_path(struct device *dev);
@ -46,7 +46,7 @@ void __attribute__ ((noreturn)) die(const char *msg);
((ENV_BOOTBLOCK && IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) || \ ((ENV_BOOTBLOCK && IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) || \
(ENV_POSTCAR && IS_ENABLED(CONFIG_POSTCAR_CONSOLE)) || \ (ENV_POSTCAR && IS_ENABLED(CONFIG_POSTCAR_CONSOLE)) || \
ENV_VERSTAGE || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_LIBAGESA || \ ENV_VERSTAGE || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_LIBAGESA || \
(ENV_SMM && CONFIG_DEBUG_SMI)) (ENV_SMM && IS_ENABLED(CONFIG_DEBUG_SMI)))
#if __CONSOLE_ENABLE__ #if __CONSOLE_ENABLE__
asmlinkage void console_init(void); asmlinkage void console_init(void);

View file

@ -27,7 +27,7 @@ void ne2k_transmit(unsigned int eth_nic_base);
#define ne2k_append_data_byte(d, base) ne2k_append_data(&d, 1, base) #define ne2k_append_data_byte(d, base) ne2k_append_data(&d, 1, base)
#endif #endif
#if CONFIG_CONSOLE_NE2K && (ENV_ROMSTAGE || ENV_RAMSTAGE) #if IS_ENABLED(CONFIG_CONSOLE_NE2K) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
static inline void __ne2k_init(void) static inline void __ne2k_init(void)
{ {
ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT); ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);

View file

@ -7,7 +7,7 @@
void qemu_debugcon_init(void); void qemu_debugcon_init(void);
void qemu_debugcon_tx_byte(unsigned char data); void qemu_debugcon_tx_byte(unsigned char data);
#if CONFIG_CONSOLE_QEMU_DEBUGCON && (ENV_ROMSTAGE || ENV_RAMSTAGE) #if IS_ENABLED(CONFIG_CONSOLE_QEMU_DEBUGCON) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
static inline void __qemu_debugcon_init(void) { qemu_debugcon_init(); } static inline void __qemu_debugcon_init(void) { qemu_debugcon_init(); }
static inline void __qemu_debugcon_tx_byte(u8 data) static inline void __qemu_debugcon_tx_byte(u8 data)
{ {

View file

@ -22,8 +22,8 @@
void spiconsole_init(void); void spiconsole_init(void);
void spiconsole_tx_byte(unsigned char c); void spiconsole_tx_byte(unsigned char c);
#define __CONSOLE_SPI_ENABLE__ (CONFIG_SPI_CONSOLE && \ #define __CONSOLE_SPI_ENABLE__ (IS_ENABLED(CONFIG_SPI_CONSOLE) && \
(ENV_RAMSTAGE || (ENV_SMM && CONFIG_DEBUG_SMI))) (ENV_RAMSTAGE || (ENV_SMM && IS_ENABLED(CONFIG_DEBUG_SMI))))
#if __CONSOLE_SPI_ENABLE__ #if __CONSOLE_SPI_ENABLE__
static inline void __spiconsole_init(void) { spiconsole_init(); } static inline void __spiconsole_init(void) { spiconsole_init(); }

View file

@ -7,7 +7,7 @@
void spkmodem_init(void); void spkmodem_init(void);
void spkmodem_tx_byte(unsigned char c); void spkmodem_tx_byte(unsigned char c);
#if CONFIG_SPKMODEM && (ENV_ROMSTAGE || ENV_RAMSTAGE) #if IS_ENABLED(CONFIG_SPKMODEM) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
static inline void __spkmodem_init(void) { spkmodem_init(); } static inline void __spkmodem_init(void) { spkmodem_init(); }
static inline void __spkmodem_tx_byte(u8 data) { spkmodem_tx_byte(data); } static inline void __spkmodem_tx_byte(u8 data) { spkmodem_tx_byte(data); }
#else #else

View file

@ -55,9 +55,9 @@ static inline void *uart_platform_baseptr(int idx)
void oxford_remap(unsigned int new_base); void oxford_remap(unsigned int new_base);
#define __CONSOLE_SERIAL_ENABLE__ (CONFIG_CONSOLE_SERIAL && \ #define __CONSOLE_SERIAL_ENABLE__ (IS_ENABLED(CONFIG_CONSOLE_SERIAL) && \
(ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_VERSTAGE || \ (ENV_BOOTBLOCK || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_VERSTAGE || \
ENV_POSTCAR || (ENV_SMM && CONFIG_DEBUG_SMI))) ENV_POSTCAR || (ENV_SMM && IS_ENABLED(CONFIG_DEBUG_SMI))))
#if __CONSOLE_SERIAL_ENABLE__ #if __CONSOLE_SERIAL_ENABLE__
static inline void __uart_init(void) static inline void __uart_init(void)
@ -78,7 +78,7 @@ static inline void __uart_tx_byte(u8 data) {}
static inline void __uart_tx_flush(void) {} static inline void __uart_tx_flush(void) {}
#endif #endif
#if CONFIG_GDB_STUB && (ENV_ROMSTAGE || ENV_RAMSTAGE) #if IS_ENABLED(CONFIG_GDB_STUB) && (ENV_ROMSTAGE || ENV_RAMSTAGE)
#define CONFIG_UART_FOR_GDB CONFIG_UART_FOR_CONSOLE #define CONFIG_UART_FOR_GDB CONFIG_UART_FOR_CONSOLE
static inline void __gdb_hw_init(void) { uart_init(CONFIG_UART_FOR_GDB); } static inline void __gdb_hw_init(void) { uart_init(CONFIG_UART_FOR_GDB); }
static inline void __gdb_tx_byte(u8 data) static inline void __gdb_tx_byte(u8 data)

View file

@ -27,8 +27,9 @@ void usb_tx_flush(int idx);
unsigned char usb_rx_byte(int idx); unsigned char usb_rx_byte(int idx);
int usb_can_rx_byte(int idx); int usb_can_rx_byte(int idx);
#define __CONSOLE_USB_ENABLE__ (CONFIG_CONSOLE_USB && \ #define __CONSOLE_USB_ENABLE__ (IS_ENABLED(CONFIG_CONSOLE_USB) && \
((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE)) ((ENV_ROMSTAGE && IS_ENABLED(CONFIG_USBDEBUG_IN_ROMSTAGE)) || \
ENV_RAMSTAGE))
#define USB_PIPE_FOR_CONSOLE 0 #define USB_PIPE_FOR_CONSOLE 0
#define USB_PIPE_FOR_GDB 0 #define USB_PIPE_FOR_GDB 0
@ -47,8 +48,9 @@ static inline void __usb_tx_flush(void) {}
#endif #endif
/* */ /* */
#if 0 && CONFIG_GDB_STUB && \ #if 0 && IS_ENABLED(CONFIG_GDB_STUB) && \
((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE) ((ENV_ROMSTAGE && IS_ENABLED(CONFIG_USBDEBUG_IN_ROMSTAGE)) \
|| ENV_RAMSTAGE)
static inline void __gdb_hw_init(void) { usbdebug_init(); } static inline void __gdb_hw_init(void) { usbdebug_init(); }
static inline void __gdb_tx_byte(u8 data) static inline void __gdb_tx_byte(u8 data)
{ {