summaryrefslogtreecommitdiffstats
path: root/src/include/console
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-05-18 16:12:07 +0200
committerNico Huber <nico.h@gmx.de>2017-05-22 11:07:57 +0200
commitafa9aefce00551d5d6227ad0081389b972dd767f (patch)
tree537a06325971eb751349878089899bf950e65ddf /src/include/console
parent7b811d5e3661874dfeca01901f3641eb70a95b1d (diff)
downloadcoreboot-afa9aefce00551d5d6227ad0081389b972dd767f.tar.gz
coreboot-afa9aefce00551d5d6227ad0081389b972dd767f.tar.bz2
coreboot-afa9aefce00551d5d6227ad0081389b972dd767f.zip
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>
Diffstat (limited to 'src/include/console')
-rw-r--r--src/include/console/cbmem_console.h5
-rw-r--r--src/include/console/console.h4
-rw-r--r--src/include/console/ne2k.h2
-rw-r--r--src/include/console/qemu_debugcon.h2
-rw-r--r--src/include/console/spi.h4
-rw-r--r--src/include/console/spkmodem.h2
-rw-r--r--src/include/console/uart.h6
-rw-r--r--src/include/console/usb.h10
8 files changed, 19 insertions, 16 deletions
diff --git a/src/include/console/cbmem_console.h b/src/include/console/cbmem_console.h
index f8b398221eca..a8519d28a93c 100644
--- a/src/include/console/cbmem_console.h
+++ b/src/include/console/cbmem_console.h
@@ -21,10 +21,11 @@
void cbmemc_init(void);
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 || \
(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__
diff --git a/src/include/console/console.h b/src/include/console/console.h
index d89d7471ca34..e00482439abd 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -28,7 +28,7 @@
#ifndef __ROMCC__
void post_code(u8 value);
-#if CONFIG_CMOS_POST_EXTRA
+#if IS_ENABLED(CONFIG_CMOS_POST_EXTRA)
void post_log_extra(u32 value);
struct device;
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_POSTCAR && IS_ENABLED(CONFIG_POSTCAR_CONSOLE)) || \
ENV_VERSTAGE || ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_LIBAGESA || \
- (ENV_SMM && CONFIG_DEBUG_SMI))
+ (ENV_SMM && IS_ENABLED(CONFIG_DEBUG_SMI)))
#if __CONSOLE_ENABLE__
asmlinkage void console_init(void);
diff --git a/src/include/console/ne2k.h b/src/include/console/ne2k.h
index ea2a139ad2de..7b43084f385f 100644
--- a/src/include/console/ne2k.h
+++ b/src/include/console/ne2k.h
@@ -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)
#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)
{
ne2k_init(CONFIG_CONSOLE_NE2K_IO_PORT);
diff --git a/src/include/console/qemu_debugcon.h b/src/include/console/qemu_debugcon.h
index 544442a662e1..3175684dfb1b 100644
--- a/src/include/console/qemu_debugcon.h
+++ b/src/include/console/qemu_debugcon.h
@@ -7,7 +7,7 @@
void qemu_debugcon_init(void);
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_tx_byte(u8 data)
{
diff --git a/src/include/console/spi.h b/src/include/console/spi.h
index 4d281acd77b6..dd33b0f3759d 100644
--- a/src/include/console/spi.h
+++ b/src/include/console/spi.h
@@ -22,8 +22,8 @@
void spiconsole_init(void);
void spiconsole_tx_byte(unsigned char c);
-#define __CONSOLE_SPI_ENABLE__ (CONFIG_SPI_CONSOLE && \
- (ENV_RAMSTAGE || (ENV_SMM && CONFIG_DEBUG_SMI)))
+#define __CONSOLE_SPI_ENABLE__ (IS_ENABLED(CONFIG_SPI_CONSOLE) && \
+ (ENV_RAMSTAGE || (ENV_SMM && IS_ENABLED(CONFIG_DEBUG_SMI))))
#if __CONSOLE_SPI_ENABLE__
static inline void __spiconsole_init(void) { spiconsole_init(); }
diff --git a/src/include/console/spkmodem.h b/src/include/console/spkmodem.h
index dfd21d4eef56..336cf149040b 100644
--- a/src/include/console/spkmodem.h
+++ b/src/include/console/spkmodem.h
@@ -7,7 +7,7 @@
void spkmodem_init(void);
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_tx_byte(u8 data) { spkmodem_tx_byte(data); }
#else
diff --git a/src/include/console/uart.h b/src/include/console/uart.h
index 07ac76393218..744eb625f4cc 100644
--- a/src/include/console/uart.h
+++ b/src/include/console/uart.h
@@ -55,9 +55,9 @@ static inline void *uart_platform_baseptr(int idx)
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_POSTCAR || (ENV_SMM && CONFIG_DEBUG_SMI)))
+ ENV_POSTCAR || (ENV_SMM && IS_ENABLED(CONFIG_DEBUG_SMI))))
#if __CONSOLE_SERIAL_ENABLE__
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) {}
#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
static inline void __gdb_hw_init(void) { uart_init(CONFIG_UART_FOR_GDB); }
static inline void __gdb_tx_byte(u8 data)
diff --git a/src/include/console/usb.h b/src/include/console/usb.h
index 1b153ef8e63d..c67144d03941 100644
--- a/src/include/console/usb.h
+++ b/src/include/console/usb.h
@@ -27,8 +27,9 @@ void usb_tx_flush(int idx);
unsigned char usb_rx_byte(int idx);
int usb_can_rx_byte(int idx);
-#define __CONSOLE_USB_ENABLE__ (CONFIG_CONSOLE_USB && \
- ((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE))
+#define __CONSOLE_USB_ENABLE__ (IS_ENABLED(CONFIG_CONSOLE_USB) && \
+ ((ENV_ROMSTAGE && IS_ENABLED(CONFIG_USBDEBUG_IN_ROMSTAGE)) || \
+ ENV_RAMSTAGE))
#define USB_PIPE_FOR_CONSOLE 0
#define USB_PIPE_FOR_GDB 0
@@ -47,8 +48,9 @@ static inline void __usb_tx_flush(void) {}
#endif
/* */
-#if 0 && CONFIG_GDB_STUB && \
- ((ENV_ROMSTAGE && CONFIG_USBDEBUG_IN_ROMSTAGE) || ENV_RAMSTAGE)
+#if 0 && IS_ENABLED(CONFIG_GDB_STUB) && \
+ ((ENV_ROMSTAGE && IS_ENABLED(CONFIG_USBDEBUG_IN_ROMSTAGE)) \
+ || ENV_RAMSTAGE)
static inline void __gdb_hw_init(void) { usbdebug_init(); }
static inline void __gdb_tx_byte(u8 data)
{