[coreboot-gerrit] Patch set updated for coreboot: bcbbd1d console: Fix includes
Kyösti Mälkki (kyosti.malkki@gmail.com)
gerrit at coreboot.org
Tue Feb 18 00:41:19 CET 2014
Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5232
-gerrit
commit bcbbd1d09a65b91de5d1ad5f8e87ea5c4063410a
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date: Mon Feb 17 21:34:42 2014 +0200
console: Fix includes
Do not pull in console hw-specific prototypes everywhere
with console.h as those are not needed for higher levels.
Move prototypes for UARTs next to other consoles.
Change-Id: Icbc9cd3e5bdfdab85d7dccd7c3827bba35248fb8
Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
src/arch/armv7/early_console.c | 2 ++
src/arch/x86/lib/romcc_console.c | 1 +
src/arch/x86/lib/romstage_console.c | 14 +++------
src/console/console.c | 6 ++++
src/cpu/allwinner/a10/uart_console.c | 2 +-
src/cpu/samsung/exynos5250/uart.c | 2 +-
src/cpu/samsung/exynos5420/uart.c | 2 +-
src/cpu/ti/am335x/uart.c | 2 +-
src/cpu/x86/smm/smiutil.c | 2 +-
src/drivers/oxford/oxpcie/oxpcie_early.c | 2 +-
src/drivers/uart/pl011.c | 2 +-
src/drivers/uart/util.c | 2 +-
src/include/console/console.h | 16 ----------
src/include/console/uart.h | 42 ++++++++++++++++++++++++++
src/include/uart.h | 40 ------------------------
src/include/uart8250.h | 2 --
src/lib/cbmem.c | 1 +
src/lib/cbmem_console.c | 1 +
src/lib/coreboot_table.c | 1 +
src/lib/uart8250.c | 2 +-
src/lib/uart8250mem.c | 2 +-
src/mainboard/cubietech/cubieboard/bootblock.c | 2 +-
src/mainboard/ti/beaglebone/bootblock.c | 2 +-
src/northbridge/intel/sandybridge/raminit.c | 1 +
24 files changed, 72 insertions(+), 79 deletions(-)
diff --git a/src/arch/armv7/early_console.c b/src/arch/armv7/early_console.c
index b6339fc..93ea38d 100644
--- a/src/arch/armv7/early_console.c
+++ b/src/arch/armv7/early_console.c
@@ -18,6 +18,8 @@
*/
#include <console/console.h>
+#include <console/cbmem_console.h>
+#include <console/uart.h>
#include <console/vtxprintf.h>
/* FIXME: need to make console driver more generic */
diff --git a/src/arch/x86/lib/romcc_console.c b/src/arch/x86/lib/romcc_console.c
index c5e6882..52b8a87 100644
--- a/src/arch/x86/lib/romcc_console.c
+++ b/src/arch/x86/lib/romcc_console.c
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <console/loglevel.h>
#include <console/post_codes.h>
+#include <console/ne2k.h>
/* __PRE_RAM__ */
/* Using a global varible can cause problems when we reset the stack
diff --git a/src/arch/x86/lib/romstage_console.c b/src/arch/x86/lib/romstage_console.c
index 68b10eb..4cd5d2d 100644
--- a/src/arch/x86/lib/romstage_console.c
+++ b/src/arch/x86/lib/romstage_console.c
@@ -19,20 +19,16 @@
#include <smp/node.h>
#include <console/console.h>
+#include <console/cbmem_console.h>
+#include <console/uart.h>
+#include <console/usb.h>
+#include <console/ne2k.h>
+#include <console/spkmodem.h>
#include <console/vtxprintf.h>
#if CONFIG_CONSOLE_SERIAL8250 || CONFIG_CONSOLE_SERIAL8250MEM
#include <uart8250.h>
#endif
-#if CONFIG_USBDEBUG
-#include <console/usb.h>
-#endif
-#if CONFIG_CONSOLE_NE2K
-#include <console/ne2k.h>
-#endif
-#if CONFIG_SPKMODEM
-#include <console/spkmodem.h>
-#endif
void console_tx_byte(unsigned char byte)
{
diff --git a/src/console/console.c b/src/console/console.c
index 081113c..334e140 100644
--- a/src/console/console.c
+++ b/src/console/console.c
@@ -18,6 +18,12 @@
*/
#include <console/console.h>
+#include <console/cbmem_console.h>
+#include <console/uart.h>
+#include <console/usb.h>
+#include <console/ne2k.h>
+#include <console/spkmodem.h>
+
#include <build.h>
#include <arch/hlt.h>
#include <arch/io.h>
diff --git a/src/cpu/allwinner/a10/uart_console.c b/src/cpu/allwinner/a10/uart_console.c
index 58930dd..94ab7f7 100644
--- a/src/cpu/allwinner/a10/uart_console.c
+++ b/src/cpu/allwinner/a10/uart_console.c
@@ -8,7 +8,7 @@
#include <config.h>
#include <types.h>
-#include <uart.h>
+#include <console/uart.h>
#include <arch/io.h>
#include <console/console.h>
diff --git a/src/cpu/samsung/exynos5250/uart.c b/src/cpu/samsung/exynos5250/uart.c
index dbf7202..80e9f4e 100644
--- a/src/cpu/samsung/exynos5250/uart.c
+++ b/src/cpu/samsung/exynos5250/uart.c
@@ -18,7 +18,7 @@
*/
#include <console/console.h> /* for __console definition */
-#include <uart.h>
+#include <console/uart.h>
#include <arch/io.h>
#include "uart.h"
#include "clk.h"
diff --git a/src/cpu/samsung/exynos5420/uart.c b/src/cpu/samsung/exynos5420/uart.c
index c5c8a8c..ac01488 100644
--- a/src/cpu/samsung/exynos5420/uart.c
+++ b/src/cpu/samsung/exynos5420/uart.c
@@ -18,7 +18,7 @@
*/
#include <console/console.h> /* for __console definition */
-#include <uart.h>
+#include <console/uart.h>
#include <arch/io.h>
#include "uart.h"
#include "clk.h"
diff --git a/src/cpu/ti/am335x/uart.c b/src/cpu/ti/am335x/uart.c
index bd2ff44..448b1c2 100644
--- a/src/cpu/ti/am335x/uart.c
+++ b/src/cpu/ti/am335x/uart.c
@@ -18,7 +18,7 @@
#include <config.h>
#include <types.h>
-#include <uart.h>
+#include <console/uart.h>
#include <arch/io.h>
#include <console/console.h> /* for __console definition */
diff --git a/src/cpu/x86/smm/smiutil.c b/src/cpu/x86/smm/smiutil.c
index a50a16a..98ef223 100644
--- a/src/cpu/x86/smm/smiutil.c
+++ b/src/cpu/x86/smm/smiutil.c
@@ -23,7 +23,7 @@
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>
#include <console/console.h>
-#include <uart.h>
+#include <console/uart.h>
#include <uart8250.h>
#include <console/vtxprintf.h>
diff --git a/src/drivers/oxford/oxpcie/oxpcie_early.c b/src/drivers/oxford/oxpcie/oxpcie_early.c
index edb97d5..c711a40 100644
--- a/src/drivers/oxford/oxpcie/oxpcie_early.c
+++ b/src/drivers/oxford/oxpcie/oxpcie_early.c
@@ -21,7 +21,7 @@
#include <arch/io.h>
#include <arch/early_variables.h>
#include <delay.h>
-#include <uart.h>
+#include <console/uart.h>
#include <uart8250.h>
#include <device/pci_def.h>
diff --git a/src/drivers/uart/pl011.c b/src/drivers/uart/pl011.c
index af085ac..376e95c 100644
--- a/src/drivers/uart/pl011.c
+++ b/src/drivers/uart/pl011.c
@@ -14,7 +14,7 @@
*/
#include <console/console.h>
-#include <uart.h>
+#include <console/uart.h>
static void pl011_uart_tx_byte(unsigned char data)
{
diff --git a/src/drivers/uart/util.c b/src/drivers/uart/util.c
index a3bfd3b..56678d9 100644
--- a/src/drivers/uart/util.c
+++ b/src/drivers/uart/util.c
@@ -16,7 +16,7 @@
*/
#include <console/console.h>
-#include <uart.h>
+#include <console/uart.h>
#if CONFIG_USE_OPTION_TABLE
#include <option.h>
#include "option_table.h"
diff --git a/src/include/console/console.h b/src/include/console/console.h
index 6fa624c..dfeedda 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -24,22 +24,6 @@
#include <console/loglevel.h>
#include <console/post_codes.h>
-#if CONFIG_CONSOLE_SERIAL
-#include <uart.h>
-#endif
-#if CONFIG_USBDEBUG && !defined(__ROMCC__)
-#include <console/usb.h>
-#endif
-#if CONFIG_CONSOLE_NE2K
-#include <console/ne2k.h>
-#endif
-#if CONFIG_CONSOLE_CBMEM
-#include <console/cbmem_console.h>
-#endif
-#if CONFIG_SPKMODEM
-#include <console/spkmodem.h>
-#endif
-
#ifndef __PRE_RAM__
unsigned char console_rx_byte(void);
int console_tst_byte(void);
diff --git a/src/include/console/uart.h b/src/include/console/uart.h
new file mode 100644
index 0000000..9071ddf
--- /dev/null
+++ b/src/include/console/uart.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef CONSOLE_UART_H
+#define CONSOLE_UART_H
+
+/* Return the clock frequency UART uses as reference clock for
+ * baudrate generator. */
+unsigned int uart_platform_refclk(void);
+
+/* Return the divisor that configures UART for baudrate detemined
+ * from option_table, or when that is not used, CONFIG_TTYS0_BAUD.
+ */
+unsigned int uart_baudrate_divisor(unsigned int refclk);
+
+
+unsigned char uart_rx_byte(void);
+void uart_tx_byte(unsigned char data);
+void uart_tx_flush(void);
+void uart_init(void);
+
+uint32_t uartmem_getbaseaddr(void);
+
+void oxford_init(void);
+
+#endif /* CONSOLE_UART_H */
diff --git a/src/include/uart.h b/src/include/uart.h
deleted file mode 100644
index 98d77e7..0000000
--- a/src/include/uart.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2012 The ChromiumOS Authors. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef UART_H
-#define UART_H
-
-/* Return the clock frequency UART uses as reference clock for
- * baudrate generator. */
-unsigned int uart_platform_refclk(void);
-
-/* Return the divisor that configures UART for baudrate detemined
- * from option_table, or when that is not used, CONFIG_TTYS0_BAUD.
- */
-unsigned int uart_baudrate_divisor(unsigned int refclk);
-
-
-unsigned char uart_rx_byte(void);
-void uart_tx_byte(unsigned char data);
-void uart_tx_flush(void);
-void uart_init(void);
-
-uint32_t uartmem_getbaseaddr(void);
-
-#endif /* UART_H */
diff --git a/src/include/uart8250.h b/src/include/uart8250.h
index 112cd44..af95796 100644
--- a/src/include/uart8250.h
+++ b/src/include/uart8250.h
@@ -129,8 +129,6 @@ u32 uart_mem_init(void);
#if defined(__PRE_RAM__) && CONFIG_DRIVERS_OXFORD_OXPCIE
/* and special init for OXPCIe based cards */
extern int oxford_oxpcie_present;
-
-void oxford_init(void);
#endif
#endif
diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c
index d97f6af..3fea49a 100644
--- a/src/lib/cbmem.c
+++ b/src/lib/cbmem.c
@@ -23,6 +23,7 @@
#include <cbmem.h>
#include <boot/coreboot_tables.h>
#include <console/console.h>
+#include <console/cbmem_console.h>
#include <arch/early_variables.h>
#if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__)
#include <arch/acpi.h>
diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c
index 83d44e3..9d5419a 100644
--- a/src/lib/cbmem_console.c
+++ b/src/lib/cbmem_console.c
@@ -18,6 +18,7 @@
*/
#include <console/console.h>
+#include <console/cbmem_console.h>
#include <cbmem.h>
#include <arch/early_variables.h>
#include <string.h>
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index d5dc14c..167eda0 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -21,6 +21,7 @@
*/
#include <console/console.h>
+#include <console/uart.h>
#include <ip_checksum.h>
#include <boot/coreboot_tables.h>
#include <string.h>
diff --git a/src/lib/uart8250.c b/src/lib/uart8250.c
index 9dcd388..9f3ad9b 100644
--- a/src/lib/uart8250.c
+++ b/src/lib/uart8250.c
@@ -19,7 +19,7 @@
*/
#include <arch/io.h>
-#include <uart.h>
+#include <console/uart.h>
#include <uart8250.h>
#include <trace.h>
diff --git a/src/lib/uart8250mem.c b/src/lib/uart8250mem.c
index a370e50..7b4672a 100644
--- a/src/lib/uart8250mem.c
+++ b/src/lib/uart8250mem.c
@@ -19,7 +19,7 @@
*/
#include <arch/io.h>
-#include <uart.h>
+#include <console/uart.h>
#include <uart8250.h>
#include <device/device.h>
#include <delay.h>
diff --git a/src/mainboard/cubietech/cubieboard/bootblock.c b/src/mainboard/cubietech/cubieboard/bootblock.c
index 2e5929c..e22c1d8 100644
--- a/src/mainboard/cubietech/cubieboard/bootblock.c
+++ b/src/mainboard/cubietech/cubieboard/bootblock.c
@@ -7,7 +7,7 @@
*/
#include <arch/io.h>
-#include <uart.h>
+#include <console/uart.h>
#include <console/console.h>
#include <delay.h>
#include <cpu/allwinner/a10/gpio.h>
diff --git a/src/mainboard/ti/beaglebone/bootblock.c b/src/mainboard/ti/beaglebone/bootblock.c
index dd46040..9e0a62e 100644
--- a/src/mainboard/ti/beaglebone/bootblock.c
+++ b/src/mainboard/ti/beaglebone/bootblock.c
@@ -19,7 +19,7 @@
#include <arch/io.h>
#include <types.h>
-#include <uart.h>
+#include <console/uart.h>
#include <console/console.h>
#include <cpu/ti/am335x/pinmux.h>
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index b9c3839..bfb4033 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -18,6 +18,7 @@
*/
#include <console/console.h>
+#include <console/usb.h>
#include <string.h>
#include <arch/hlt.h>
#include <arch/io.h>
More information about the coreboot-gerrit
mailing list