summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-11-08 23:47:45 -0700
committerSimon Glass <sjg@chromium.org>2015-11-19 20:27:50 -0700
commit24b852a7a2b8eca71789100983bdb5104cc00696 (patch)
treeaf9a9ed81d30180f9a9286ed504895c216e80229
parent3884c98c32cd5fb5b5b42185d5d0575659434bbf (diff)
Move console definitions into a new console.h file
The console includes a global variable and several functions that are only used by a small subset of U-Boot files. Before adding more functions, move the definitions into their own header file. Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r--arch/blackfin/lib/cmd_cache_dump.c1
-rw-r--r--arch/powerpc/cpu/mpc8260/ether_fcc.c1
-rw-r--r--arch/powerpc/cpu/mpc8260/i2c.c1
-rw-r--r--arch/powerpc/cpu/mpc8xx/i2c.c1
-rw-r--r--arch/sh/lib/board.c1
-rw-r--r--arch/sparc/lib/board.c1
-rw-r--r--board/Arcturus/ucp1020/spl.c1
-rw-r--r--board/amcc/yucca/cmd_yucca.c1
-rw-r--r--board/astro/mcf5373l/fpga.c1
-rw-r--r--board/cobra5272/flash.c1
-rw-r--r--board/esd/common/cmd_loadpci.c1
-rw-r--r--board/esd/cpci405/cpci405.c1
-rw-r--r--board/esd/pmc405de/pmc405de.c1
-rw-r--r--board/esd/pmc440/cmd_pmc440.c1
-rw-r--r--board/esd/pmc440/pmc440.c1
-rw-r--r--board/esd/vme8349/caddy.c1
-rw-r--r--board/freescale/b4860qds/spl.c1
-rw-r--r--board/freescale/c29xpcie/spl.c1
-rw-r--r--board/freescale/mpc8569mds/mpc8569mds.c1
-rw-r--r--board/freescale/p1010rdb/spl.c1
-rw-r--r--board/freescale/p1022ds/spl.c1
-rw-r--r--board/freescale/p1_p2_rdb_pc/spl.c1
-rw-r--r--board/freescale/t102xqds/spl.c1
-rw-r--r--board/freescale/t102xrdb/spl.c1
-rw-r--r--board/freescale/t104xrdb/spl.c1
-rw-r--r--board/freescale/t208xqds/spl.c1
-rw-r--r--board/freescale/t208xrdb/spl.c1
-rw-r--r--board/freescale/t4qds/spl.c1
-rw-r--r--board/freescale/t4rdb/spl.c1
-rw-r--r--board/gdsys/common/cmd_ioloop.c1
-rw-r--r--board/inka4x0/inkadiag.c1
-rw-r--r--board/lwmon5/kbd.c1
-rw-r--r--board/mpl/common/kbd.c1
-rw-r--r--board/mpl/pati/pati.c1
-rw-r--r--board/renesas/sh7785lcr/selfcheck.c1
-rw-r--r--board/tqc/tqm5200/cmd_stk52xx.c1
-rw-r--r--board/tqc/tqm5200/tqm5200.c1
-rw-r--r--board/xes/xpedite1000/xpedite1000.c1
-rw-r--r--common/autoboot.c1
-rw-r--r--common/board_f.c1
-rw-r--r--common/board_r.c1
-rw-r--r--common/cli.c1
-rw-r--r--common/cli_hush.c1
-rw-r--r--common/cli_simple.c1
-rw-r--r--common/cmd_armflash.c1
-rw-r--r--common/cmd_bedbug.c1
-rw-r--r--common/cmd_dcr.c1
-rw-r--r--common/cmd_dfu.c1
-rw-r--r--common/cmd_fastboot.c1
-rw-r--r--common/cmd_fpgad.c1
-rw-r--r--common/cmd_fuse.c1
-rw-r--r--common/cmd_i2c.c1
-rw-r--r--common/cmd_load.c1
-rw-r--r--common/cmd_mem.c2
-rw-r--r--common/cmd_misc.c1
-rw-r--r--common/cmd_mmc.c1
-rw-r--r--common/cmd_nand.c1
-rw-r--r--common/cmd_nvedit.c1
-rw-r--r--common/cmd_otp.c1
-rw-r--r--common/cmd_pci.c1
-rw-r--r--common/cmd_usb.c1
-rw-r--r--common/cmd_usb_mass_storage.c1
-rw-r--r--common/command.c1
-rw-r--r--common/console.c1
-rw-r--r--common/iomux.c1
-rw-r--r--common/main.c1
-rw-r--r--common/usb_kbd.c1
-rw-r--r--drivers/block/fsl_sata.c1
-rw-r--r--drivers/fpga/ACEX1K.c1
-rw-r--r--drivers/fpga/virtex2.c1
-rw-r--r--drivers/fpga/zynqpl.c1
-rw-r--r--drivers/i2c/adi_i2c.c1
-rw-r--r--drivers/input/input.c1
-rw-r--r--drivers/input/keyboard.c3
-rw-r--r--drivers/misc/cbmem_console.c2
-rw-r--r--drivers/mtd/cfi_flash.c1
-rw-r--r--drivers/mtd/nand/bfin_nand.c1
-rw-r--r--drivers/net/e1000_spi.c1
-rw-r--r--drivers/net/keystone_net.c1
-rw-r--r--drivers/net/phy/phy.c1
-rw-r--r--drivers/net/vsc7385.c1
-rw-r--r--drivers/power/battery/bat_trats.c1
-rw-r--r--drivers/spi/bfin_spi.c1
-rw-r--r--drivers/spi/bfin_spi6xx.c1
-rw-r--r--drivers/spi/sh_qspi.c1
-rw-r--r--drivers/spi/sh_spi.c1
-rw-r--r--drivers/usb/gadget/ether.c1
-rw-r--r--drivers/usb/gadget/f_mass_storage.c1
-rw-r--r--drivers/usb/gadget/f_thor.c1
-rw-r--r--drivers/usb/host/r8a66597-hcd.c1
-rw-r--r--drivers/usb/musb-new/musb_uboot.c1
-rw-r--r--examples/standalone/mem_to_mem_idma2intr.c1
-rw-r--r--examples/standalone/smc911x_eeprom.c1
-rw-r--r--include/common.h17
-rw-r--r--include/console.h30
-rw-r--r--lib/display_options.c1
-rw-r--r--lib/gunzip.c1
-rw-r--r--net/net.c1
-rw-r--r--test/dm/test-main.c1
-rw-r--r--test/dm/usb.c1
100 files changed, 131 insertions, 18 deletions
diff --git a/arch/blackfin/lib/cmd_cache_dump.c b/arch/blackfin/lib/cmd_cache_dump.c
index 412e0198af0..f9f909791e9 100644
--- a/arch/blackfin/lib/cmd_cache_dump.c
+++ b/arch/blackfin/lib/cmd_cache_dump.c
@@ -9,6 +9,7 @@
#include <config.h>
#include <common.h>
#include <command.h>
+#include <console.h>
#include <asm/blackfin.h>
#include <asm/mach-common/bits/mpu.h>
diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c b/arch/powerpc/cpu/mpc8260/ether_fcc.c
index 30ea3de9cff..9bb395e6a26 100644
--- a/arch/powerpc/cpu/mpc8260/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c
@@ -24,6 +24,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <asm/cpm_8260.h>
#include <mpc8260.h>
diff --git a/arch/powerpc/cpu/mpc8260/i2c.c b/arch/powerpc/cpu/mpc8260/i2c.c
index 8658ebdadd6..a0de1013291 100644
--- a/arch/powerpc/cpu/mpc8260/i2c.c
+++ b/arch/powerpc/cpu/mpc8260/i2c.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <console.h>
#if defined(CONFIG_HARD_I2C)
diff --git a/arch/powerpc/cpu/mpc8xx/i2c.c b/arch/powerpc/cpu/mpc8xx/i2c.c
index 6146de38752..3dff4ab4ac4 100644
--- a/arch/powerpc/cpu/mpc8xx/i2c.c
+++ b/arch/powerpc/cpu/mpc8xx/i2c.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
+#include <console.h>
#ifdef CONFIG_HARD_I2C
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index 6dad3c7dbfe..69cdca3744f 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <malloc.h>
#include <stdio_dev.h>
#include <version.h>
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index d2ac6bcaca9..10475d10827 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <malloc.h>
#include <stdio_dev.h>
#include <config.h>
diff --git a/board/Arcturus/ucp1020/spl.c b/board/Arcturus/ucp1020/spl.c
index 236b0d0de57..9315bb74012 100644
--- a/board/Arcturus/ucp1020/spl.c
+++ b/board/Arcturus/ucp1020/spl.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <console.h>
#include <ns16550.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/board/amcc/yucca/cmd_yucca.c b/board/amcc/yucca/cmd_yucca.c
index c1724bf0348..cc78284e2bf 100644
--- a/board/amcc/yucca/cmd_yucca.c
+++ b/board/amcc/yucca/cmd_yucca.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <cli.h>
#include <command.h>
+#include <console.h>
#include "yucca.h"
#include <i2c.h>
#include <asm/byteorder.h>
diff --git a/board/astro/mcf5373l/fpga.c b/board/astro/mcf5373l/fpga.c
index d1110dfd6e7..53e00728c3d 100644
--- a/board/astro/mcf5373l/fpga.c
+++ b/board/astro/mcf5373l/fpga.c
@@ -15,6 +15,7 @@
/* Altera/Xilinx FPGA configuration support for the ASTRO "URMEL" board */
#include <common.h>
+#include <console.h>
#include <watchdog.h>
#include <altera.h>
#include <ACEX1K.h>
diff --git a/board/cobra5272/flash.c b/board/cobra5272/flash.c
index c0b8337ddb6..4fac6880f16 100644
--- a/board/cobra5272/flash.c
+++ b/board/cobra5272/flash.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <console.h>
#define PHYS_FLASH_1 CONFIG_SYS_FLASH_BASE
#define FLASH_BANK_SIZE 0x200000
diff --git a/board/esd/common/cmd_loadpci.c b/board/esd/common/cmd_loadpci.c
index 95d18911c3d..9541817d094 100644
--- a/board/esd/common/cmd_loadpci.c
+++ b/board/esd/common/cmd_loadpci.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#if !defined(CONFIG_440)
#include <asm/4xx_pci.h>
#endif
diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index bf5a4cb6824..ca9a94427f9 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -5,6 +5,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <console.h>
#include <libfdt.h>
#include <fdt_support.h>
#include <asm/processor.h>
diff --git a/board/esd/pmc405de/pmc405de.c b/board/esd/pmc405de/pmc405de.c
index 3e1713247d3..24e4977c9ba 100644
--- a/board/esd/pmc405de/pmc405de.c
+++ b/board/esd/pmc405de/pmc405de.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <console.h>
#include <libfdt.h>
#include <fdt_support.h>
#include <asm/processor.h>
diff --git a/board/esd/pmc440/cmd_pmc440.c b/board/esd/pmc440/cmd_pmc440.c
index 40b135f2ba0..b7cd595362c 100644
--- a/board/esd/pmc440/cmd_pmc440.c
+++ b/board/esd/pmc440/cmd_pmc440.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
#include <command.h>
+#include <console.h>
#include <asm/io.h>
#include <asm/cache.h>
#include <asm/processor.h>
diff --git a/board/esd/pmc440/pmc440.c b/board/esd/pmc440/pmc440.c
index 15c3151b842..7e35c1984d3 100644
--- a/board/esd/pmc440/pmc440.c
+++ b/board/esd/pmc440/pmc440.c
@@ -13,6 +13,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <console.h>
#include <libfdt.h>
#include <fdt_support.h>
#include <asm/ppc440.h>
diff --git a/board/esd/vme8349/caddy.c b/board/esd/vme8349/caddy.c
index cd56bed9915..0c1574ca519 100644
--- a/board/esd/vme8349/caddy.c
+++ b/board/esd/vme8349/caddy.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <console.h>
#include <ioports.h>
#include <mpc83xx.h>
#include <asm/mpc8349_pci.h>
diff --git a/board/freescale/b4860qds/spl.c b/board/freescale/b4860qds/spl.c
index 3aa5a780f4b..3f7cc03581a 100644
--- a/board/freescale/b4860qds/spl.c
+++ b/board/freescale/b4860qds/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/spl.h>
#include <malloc.h>
#include <ns16550.h>
diff --git a/board/freescale/c29xpcie/spl.c b/board/freescale/c29xpcie/spl.c
index 21117114008..3d31d41a4f6 100644
--- a/board/freescale/c29xpcie/spl.c
+++ b/board/freescale/c29xpcie/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <ns16550.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/board/freescale/mpc8569mds/mpc8569mds.c b/board/freescale/mpc8569mds/mpc8569mds.c
index 836578f3cb8..122490c026e 100644
--- a/board/freescale/mpc8569mds/mpc8569mds.c
+++ b/board/freescale/mpc8569mds/mpc8569mds.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <console.h>
#include <hwconfig.h>
#include <pci.h>
#include <asm/processor.h>
diff --git a/board/freescale/p1010rdb/spl.c b/board/freescale/p1010rdb/spl.c
index ee873b09141..eb8e567554c 100644
--- a/board/freescale/p1010rdb/spl.c
+++ b/board/freescale/p1010rdb/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <ns16550.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/board/freescale/p1022ds/spl.c b/board/freescale/p1022ds/spl.c
index 7bd9d296ee0..89ef95aab89 100644
--- a/board/freescale/p1022ds/spl.c
+++ b/board/freescale/p1022ds/spl.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <console.h>
#include <ns16550.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/board/freescale/p1_p2_rdb_pc/spl.c b/board/freescale/p1_p2_rdb_pc/spl.c
index 8d0d8504802..0142746c842 100644
--- a/board/freescale/p1_p2_rdb_pc/spl.c
+++ b/board/freescale/p1_p2_rdb_pc/spl.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <console.h>
#include <ns16550.h>
#include <malloc.h>
#include <mmc.h>
diff --git a/board/freescale/t102xqds/spl.c b/board/freescale/t102xqds/spl.c
index 08aef6e1597..073ff2dcde1 100644
--- a/board/freescale/t102xqds/spl.c
+++ b/board/freescale/t102xqds/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <ns16550.h>
#include <nand.h>
diff --git a/board/freescale/t102xrdb/spl.c b/board/freescale/t102xrdb/spl.c
index 9c581ff88e0..da97c440c48 100644
--- a/board/freescale/t102xrdb/spl.c
+++ b/board/freescale/t102xrdb/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <ns16550.h>
#include <nand.h>
diff --git a/board/freescale/t104xrdb/spl.c b/board/freescale/t104xrdb/spl.c
index 4e8735b9ff1..81f48c4c301 100644
--- a/board/freescale/t104xrdb/spl.c
+++ b/board/freescale/t104xrdb/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <ns16550.h>
#include <nand.h>
diff --git a/board/freescale/t208xqds/spl.c b/board/freescale/t208xqds/spl.c
index a71c6171218..55a0f8fdce5 100644
--- a/board/freescale/t208xqds/spl.c
+++ b/board/freescale/t208xqds/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <ns16550.h>
#include <nand.h>
diff --git a/board/freescale/t208xrdb/spl.c b/board/freescale/t208xrdb/spl.c
index 9ae2b1e863f..f63366bb0e6 100644
--- a/board/freescale/t208xrdb/spl.c
+++ b/board/freescale/t208xrdb/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <ns16550.h>
#include <nand.h>
diff --git a/board/freescale/t4qds/spl.c b/board/freescale/t4qds/spl.c
index 0c6156e7f09..d52059a1453 100644
--- a/board/freescale/t4qds/spl.c
+++ b/board/freescale/t4qds/spl.c
@@ -4,6 +4,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/spl.h>
#include <malloc.h>
#include <ns16550.h>
diff --git a/board/freescale/t4rdb/spl.c b/board/freescale/t4rdb/spl.c
index 68ecde79097..4c1e0cc8d0e 100644
--- a/board/freescale/t4rdb/spl.c
+++ b/board/freescale/t4rdb/spl.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/spl.h>
#include <malloc.h>
#include <ns16550.h>
diff --git a/board/gdsys/common/cmd_ioloop.c b/board/gdsys/common/cmd_ioloop.c
index e0c74fee808..0e81c9d9e4f 100644
--- a/board/gdsys/common/cmd_ioloop.c
+++ b/board/gdsys/common/cmd_ioloop.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <gdsys_fpga.h>
diff --git a/board/inka4x0/inkadiag.c b/board/inka4x0/inkadiag.c
index 0bd12ece86b..4c432051298 100644
--- a/board/inka4x0/inkadiag.c
+++ b/board/inka4x0/inkadiag.c
@@ -10,6 +10,7 @@
#include <asm/io.h>
#include <common.h>
#include <config.h>
+#include <console.h>
#include <mpc5xxx.h>
#include <pci.h>
diff --git a/board/lwmon5/kbd.c b/board/lwmon5/kbd.c
index 97962daf939..d6c0a205a3c 100644
--- a/board/lwmon5/kbd.c
+++ b/board/lwmon5/kbd.c
@@ -17,6 +17,7 @@
#include <common.h>
#include <i2c.h>
#include <command.h>
+#include <console.h>
#include <post.h>
#include <serial.h>
#include <malloc.h>
diff --git a/board/mpl/common/kbd.c b/board/mpl/common/kbd.c
index 1da72c53989..36b169489ea 100644
--- a/board/mpl/common/kbd.c
+++ b/board/mpl/common/kbd.c
@@ -8,6 +8,7 @@
* linux/drivers/char/pc_keyb.c
*/
#include <common.h>
+#include <console.h>
#include <asm/processor.h>
#include <stdio_dev.h>
#include "isa.h"
diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c
index 958cdec1365..ddc21083d84 100644
--- a/board/mpl/pati/pati.c
+++ b/board/mpl/pati/pati.c
@@ -29,6 +29,7 @@
**********************************************************************************/
#include <common.h>
+#include <console.h>
#include <mpc5xx.h>
#include <stdio_dev.h>
#include <pci_ids.h>
diff --git a/board/renesas/sh7785lcr/selfcheck.c b/board/renesas/sh7785lcr/selfcheck.c
index d5207507037..9a6cdab9ee5 100644
--- a/board/renesas/sh7785lcr/selfcheck.c
+++ b/board/renesas/sh7785lcr/selfcheck.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/pci.h>
diff --git a/board/tqc/tqm5200/cmd_stk52xx.c b/board/tqc/tqm5200/cmd_stk52xx.c
index 5f905d5dcaf..9d2d5a8fa98 100644
--- a/board/tqc/tqm5200/cmd_stk52xx.c
+++ b/board/tqc/tqm5200/cmd_stk52xx.c
@@ -12,6 +12,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#if defined(CONFIG_CMD_BSP)
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c
index 4d4f29da74e..8b82c348a70 100644
--- a/board/tqc/tqm5200/tqm5200.c
+++ b/board/tqc/tqm5200/tqm5200.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
+#include <console.h>
#include <mpc5xxx.h>
#include <pci.h>
#include <asm/processor.h>
diff --git a/board/xes/xpedite1000/xpedite1000.c b/board/xes/xpedite1000/xpedite1000.c
index daab578f87c..3b8a6683ebb 100644
--- a/board/xes/xpedite1000/xpedite1000.c
+++ b/board/xes/xpedite1000/xpedite1000.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/processor.h>
#include <spd_sdram.h>
#include <i2c.h>
diff --git a/common/autoboot.c b/common/autoboot.c
index c3670762579..c11fb312361 100644
--- a/common/autoboot.c
+++ b/common/autoboot.c
@@ -9,6 +9,7 @@
#include <autoboot.h>
#include <bootretry.h>
#include <cli.h>
+#include <console.h>
#include <fdtdec.h>
#include <menu.h>
#include <post.h>
diff --git a/common/board_f.c b/common/board_f.c
index 84485e96e8c..09baa5c5504 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <linux/compiler.h>
#include <version.h>
+#include <console.h>
#include <environment.h>
#include <dm.h>
#include <fdtdec.h>
diff --git a/common/board_r.c b/common/board_r.c
index c6aa7e5224a..85aef95a895 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -15,6 +15,7 @@
#if defined(CONFIG_CMD_BEDBUG)
#include <bedbug/type.h>
#endif
+#include <console.h>
#ifdef CONFIG_HAS_DATAFLASH
#include <dataflash.h>
#endif
diff --git a/common/cli.c b/common/cli.c
index b6ae80a5fe9..fbcd339c9be 100644
--- a/common/cli.c
+++ b/common/cli.c
@@ -12,6 +12,7 @@
#include <common.h>
#include <cli.h>
#include <cli_hush.h>
+#include <console.h>
#include <fdtdec.h>
#include <malloc.h>
diff --git a/common/cli_hush.c b/common/cli_hush.c
index 296542f4c2d..a7cac4fcb9d 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -79,6 +79,7 @@
#include <malloc.h> /* malloc, free, realloc*/
#include <linux/ctype.h> /* isalpha, isdigit */
#include <common.h> /* readline */
+#include <console.h>
#include <bootretry.h>
#include <cli.h>
#include <cli_hush.h>
diff --git a/common/cli_simple.c b/common/cli_simple.c
index d8b40c93915..9c3d073d583 100644
--- a/common/cli_simple.c
+++ b/common/cli_simple.c
@@ -12,6 +12,7 @@
#include <common.h>
#include <bootretry.h>
#include <cli.h>
+#include <console.h>
#include <linux/ctype.h>
#define DEBUG_PARSER 0 /* set to 1 to debug */
diff --git a/common/cmd_armflash.c b/common/cmd_armflash.c
index af453f7b3b8..b94d128faa2 100644
--- a/common/cmd_armflash.c
+++ b/common/cmd_armflash.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
#include <command.h>
+#include <console.h>
#include <asm/io.h>
#define MAX_REGIONS 4
diff --git a/common/cmd_bedbug.c b/common/cmd_bedbug.c
index 57a8a3f2fe3..69afeafecb5 100644
--- a/common/cmd_bedbug.c
+++ b/common/cmd_bedbug.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <cli.h>
#include <command.h>
+#include <console.h>
#include <linux/ctype.h>
#include <net.h>
#include <bedbug/type.h>
diff --git a/common/cmd_dcr.c b/common/cmd_dcr.c
index 4fddd804abd..cc77250ac82 100644
--- a/common/cmd_dcr.c
+++ b/common/cmd_dcr.c
@@ -13,6 +13,7 @@
#include <cli.h>
#include <config.h>
#include <command.h>
+#include <console.h>
unsigned long get_dcr (unsigned short);
unsigned long set_dcr (unsigned short, unsigned long);
diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
index f060db75c6c..6d95ce92231 100644
--- a/common/cmd_dfu.c
+++ b/common/cmd_dfu.c
@@ -14,6 +14,7 @@
#include <common.h>
#include <watchdog.h>
#include <dfu.h>
+#include <console.h>
#include <g_dnl.h>
#include <usb.h>
#include <net.h>
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index b9d1c8c02bd..488822a2eed 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
#include <command.h>
+#include <console.h>
#include <g_dnl.h>
#include <usb.h>
diff --git a/common/cmd_fpgad.c b/common/cmd_fpgad.c
index 1f1d00f28ac..5370c3e72d3 100644
--- a/common/cmd_fpgad.c
+++ b/common/cmd_fpgad.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <gdsys_fpga.h>
diff --git a/common/cmd_fuse.c b/common/cmd_fuse.c
index d4bc0f6c94a..5998f9b2eb0 100644
--- a/common/cmd_fuse.c
+++ b/common/cmd_fuse.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <fuse.h>
#include <asm/errno.h>
diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 864b2596cca..3d0de81c32f 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -69,6 +69,7 @@
#include <bootretry.h>
#include <cli.h>
#include <command.h>
+#include <console.h>
#include <dm.h>
#include <edid.h>
#include <environment.h>
diff --git a/common/cmd_load.c b/common/cmd_load.c
index d043e6d7bcf..0aa7937fd4b 100644
--- a/common/cmd_load.c
+++ b/common/cmd_load.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
#include <command.h>
+#include <console.h>
#include <s_record.h>
#include <net.h>
#include <exports.h>
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 43c3fb62bff..9fb25840f10 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -12,9 +12,11 @@
*/
#include <common.h>
+#include <console.h>
#include <bootretry.h>
#include <cli.h>
#include <command.h>
+#include <console.h>
#ifdef CONFIG_HAS_DATAFLASH
#include <dataflash.h>
#endif
diff --git a/common/cmd_misc.c b/common/cmd_misc.c
index 93f9eabd6b5..39d86835cff 100644
--- a/common/cmd_misc.c
+++ b/common/cmd_misc.c
@@ -10,6 +10,7 @@
*/
#include <common.h>
#include <command.h>
+#include <console.h>
static int do_sleep(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 1335e3d344c..dfc1ec850e2 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <mmc.h>
static int curr_device = -1;
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 1482462a509..a6b67e29f1c 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -22,6 +22,7 @@
#include <common.h>
#include <linux/mtd/mtd.h>
#include <command.h>
+#include <console.h>
#include <watchdog.h>
#include <malloc.h>
#include <asm/byteorder.h>
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index f4c2523f2fb..2f9cdd095a7 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -27,6 +27,7 @@
#include <common.h>
#include <cli.h>
#include <command.h>
+#include <console.h>
#include <environment.h>
#include <search.h>
#include <errno.h>
diff --git a/common/cmd_otp.c b/common/cmd_otp.c
index 593bb8c650c..10c1475c5a3 100644
--- a/common/cmd_otp.c
+++ b/common/cmd_otp.c
@@ -16,6 +16,7 @@
#include <config.h>
#include <common.h>
#include <command.h>
+#include <console.h>
#include <asm/blackfin.h>
#include <asm/clock.h>
diff --git a/common/cmd_pci.c b/common/cmd_pci.c
index dcecef8da85..802e4330440 100644
--- a/common/cmd_pci.c
+++ b/common/cmd_pci.c
@@ -17,6 +17,7 @@
#include <bootretry.h>
#include <cli.h>
#include <command.h>
+#include <console.h>
#include <asm/processor.h>
#include <asm/io.h>
#include <pci.h>
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 4679134478a..c2d98037fa2 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -13,6 +13,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <dm.h>
#include <memalign.h>
#include <asm/byteorder.h>
diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c
index 198dab15baf..04073891129 100644
--- a/common/cmd_usb_mass_storage.c
+++ b/common/cmd_usb_mass_storage.c
@@ -8,6 +8,7 @@
#include <errno.h>
#include <common.h>
#include <command.h>
+#include <console.h>
#include <g_dnl.h>
#include <part.h>
#include <usb.h>
diff --git a/common/command.c b/common/command.c
index 972ae281c23..858e28885a2 100644
--- a/common/command.c
+++ b/common/command.c
@@ -11,6 +11,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <linux/ctype.h>
/*
diff --git a/common/console.c b/common/console.c
index ace206ca4ff..10972b04a6f 100644
--- a/common/console.c
+++ b/common/console.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <console.h>
#include <debug_uart.h>
#include <stdarg.h>
#include <iomux.h>
diff --git a/common/iomux.c b/common/iomux.c
index 62bdec61aaf..3d8d00b4486 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <console.h>
#include <serial.h>
#include <malloc.h>
diff --git a/common/main.c b/common/main.c
index ead0cd17aa8..5a0318123bc 100644
--- a/common/main.c
+++ b/common/main.c
@@ -10,6 +10,7 @@
#include <common.h>
#include <autoboot.h>
#include <cli.h>
+#include <console.h>
#include <version.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 5c6a372c1f5..5a90f843f2a 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -8,6 +8,7 @@
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <console.h>
#include <dm.h>
#include <errno.h>
#include <malloc.h>
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
index 735708aa20a..208a0ae8890 100644
--- a/drivers/block/fsl_sata.c
+++ b/drivers/block/fsl_sata.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/fsl_serdes.h>
diff --git a/drivers/fpga/ACEX1K.c b/drivers/fpga/ACEX1K.c
index 06b88372e51..1627f0e6ffd 100644
--- a/drivers/fpga/ACEX1K.c
+++ b/drivers/fpga/ACEX1K.c
@@ -9,6 +9,7 @@
*/
#include <common.h> /* core U-Boot definitions */
+#include <console.h>
#include <ACEX1K.h> /* ACEX device family */
/* Define FPGA_DEBUG to get debug printf's */
diff --git a/drivers/fpga/virtex2.c b/drivers/fpga/virtex2.c
index 0d2d9a46932..f7cf02ab5b3 100644
--- a/drivers/fpga/virtex2.c
+++ b/drivers/fpga/virtex2.c
@@ -12,6 +12,7 @@
*/
#include <common.h>
+#include <console.h>
#include <virtex2.h>
#if 0
diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c
index 6a74f896106..ef889ea4e66 100644
--- a/drivers/fpga/zynqpl.c
+++ b/drivers/fpga/zynqpl.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/io.h>
#include <fs.h>
#include <zynqpl.h>
diff --git a/drivers/i2c/adi_i2c.c b/drivers/i2c/adi_i2c.c
index c58f14a36e5..f0c084132a8 100644
--- a/drivers/i2c/adi_i2c.c
+++ b/drivers/i2c/adi_i2c.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <console.h>
#include <i2c.h>
#include <asm/clock.h>
diff --git a/drivers/input/input.c b/drivers/input/input.c
index a39db3cc9c0..011667fedda 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <console.h>
#include <dm.h>
#include <errno.h>
#include <stdio_dev.h>
diff --git a/drivers/input/keyboard.c b/drivers/input/keyboard.c
index 71546cb086c..48255bd87b4 100644
--- a/drivers/input/keyboard.c
+++ b/drivers/input/keyboard.c
@@ -9,7 +9,10 @@
***********************************************************************/
#include <common.h>
+#include <console.h>
#include <input.h>
+
+#include <stdio_dev.h>
#include <keyboard.h>
#include <stdio_dev.h>
diff --git a/drivers/misc/cbmem_console.c b/drivers/misc/cbmem_console.c
index 5f85ccf21e9..127121e7971 100644
--- a/drivers/misc/cbmem_console.c
+++ b/drivers/misc/cbmem_console.c
@@ -16,7 +16,7 @@
*/
#include <common.h>
-
+#include <console.h>
#ifndef CONFIG_SYS_COREBOOT
#error This driver requires coreboot
#endif
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index e3cb59887ce..39932f46478 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -18,6 +18,7 @@
/* #define DEBUG */
#include <common.h>
+#include <console.h>
#include <dm.h>
#include <errno.h>
#include <fdt_support.h>
diff --git a/drivers/mtd/nand/bfin_nand.c b/drivers/mtd/nand/bfin_nand.c
index 7e755e8965a..7c11868cd31 100644
--- a/drivers/mtd/nand/bfin_nand.c
+++ b/drivers/mtd/nand/bfin_nand.c
@@ -15,6 +15,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/io.h>
#ifdef DEBUG
diff --git a/drivers/net/e1000_spi.c b/drivers/net/e1000_spi.c
index e7f68263a47..df72375238f 100644
--- a/drivers/net/e1000_spi.c
+++ b/drivers/net/e1000_spi.c
@@ -1,4 +1,5 @@
#include <common.h>
+#include <console.h>
#include "e1000.h"
#include <linux/compiler.h>
diff --git a/drivers/net/keystone_net.c b/drivers/net/keystone_net.c
index 5ed29ae9171..24ca52e2dfb 100644
--- a/drivers/net/keystone_net.c
+++ b/drivers/net/keystone_net.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
#include <command.h>
+#include <console.h>
#include <net.h>
#include <phy.h>
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 5633ec2402b..51b5746a5a4 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -11,6 +11,7 @@
#include <config.h>
#include <common.h>
+#include <console.h>
#include <dm.h>
#include <malloc.h>
#include <net.h>
diff --git a/drivers/net/vsc7385.c b/drivers/net/vsc7385.c
index a5110e516db..c6d6dce4ae9 100644
--- a/drivers/net/vsc7385.c
+++ b/drivers/net/vsc7385.c
@@ -14,6 +14,7 @@
#include <config.h>
#include <common.h>
+#include <console.h>
#include <asm/io.h>
#include <asm/errno.h>
#include "vsc7385.h"
diff --git a/drivers/power/battery/bat_trats.c b/drivers/power/battery/bat_trats.c
index bfde6921764..089e789b620 100644
--- a/drivers/power/battery/bat_trats.c
+++ b/drivers/power/battery/bat_trats.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <console.h>
#include <power/pmic.h>
#include <power/battery.h>
#include <power/max8997_pmic.h>
diff --git a/drivers/spi/bfin_spi.c b/drivers/spi/bfin_spi.c
index 71a31d0127f..9a6fc781515 100644
--- a/drivers/spi/bfin_spi.c
+++ b/drivers/spi/bfin_spi.c
@@ -9,6 +9,7 @@
/*#define DEBUG*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <spi.h>
diff --git a/drivers/spi/bfin_spi6xx.c b/drivers/spi/bfin_spi6xx.c
index 8359d760f95..9a27b78f641 100644
--- a/drivers/spi/bfin_spi6xx.c
+++ b/drivers/spi/bfin_spi6xx.c
@@ -18,6 +18,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <spi.h>
diff --git a/drivers/spi/sh_qspi.c b/drivers/spi/sh_qspi.c
index 7209e1d319e..75999c812d5 100644
--- a/drivers/spi/sh_qspi.c
+++ b/drivers/spi/sh_qspi.c
@@ -8,6 +8,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <spi.h>
#include <asm/arch/rmobile.h>
diff --git a/drivers/spi/sh_spi.c b/drivers/spi/sh_spi.c
index 7ca5e363da7..1384385e05b 100644
--- a/drivers/spi/sh_spi.c
+++ b/drivers/spi/sh_spi.c
@@ -19,6 +19,7 @@
*/
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <spi.h>
#include <asm/io.h>
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index c5e35ee3507..cfe9a24e24f 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -9,6 +9,7 @@
*/
#include <common.h>
+#include <console.h>
#include <asm/errno.h>
#include <linux/netdevice.h>
#include <linux/usb/ch9.h>
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index abe9391d3d6..ec1f23a0cf3 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -243,6 +243,7 @@
#include <config.h>
#include <malloc.h>
#include <common.h>
+#include <console.h>
#include <g_dnl.h>
#include <linux/err.h>
diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
index 9ed0ce3d313..a60e9487e77 100644
--- a/drivers/usb/gadget/f_thor.c
+++ b/drivers/usb/gadget/f_thor.c
@@ -17,6 +17,7 @@
#include <errno.h>
#include <common.h>
+#include <console.h>
#include <malloc.h>
#include <memalign.h>
#include <version.h>
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index 373e04cbe5e..6ef51906c28 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -7,6 +7,7 @@
*/
#include <common.h>
+#include <console.h>
#include <usb.h>
#include <asm/io.h>
diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c
index 10f6b5d1cf1..233a0e4a5e2 100644
--- a/drivers/usb/musb-new/musb_uboot.c
+++ b/drivers/usb/musb-new/musb_uboot.c
@@ -1,4 +1,5 @@
#include <common.h>
+#include <console.h>
#include <watchdog.h>
#ifdef CONFIG_ARCH_SUNXI
#include <asm/arch/usb_phy.h>
diff --git a/examples/standalone/mem_to_mem_idma2intr.c b/examples/standalone/mem_to_mem_idma2intr.c
index 215dc220336..17da8db9b91 100644
--- a/examples/standalone/mem_to_mem_idma2intr.c
+++ b/examples/standalone/mem_to_mem_idma2intr.c
@@ -28,6 +28,7 @@
#include <common.h>
+#include <console.h>
#include <exports.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/examples/standalone/smc911x_eeprom.c b/examples/standalone/smc911x_eeprom.c
index 6c79c5f65a0..364ad2d2d58 100644
--- a/examples/standalone/smc911x_eeprom.c
+++ b/examples/standalone/smc911x_eeprom.c
@@ -15,6 +15,7 @@
*/
#include <common.h>
+#include <console.h>
#include <exports.h>
#include <linux/ctype.h>
#include "../drivers/net/smc911x.h"
diff --git a/include/common.h b/include/common.h
index 09a131da0b9..e9107300e53 100644
--- a/include/common.h
+++ b/include/common.h
@@ -218,7 +218,6 @@ int run_command_repeatable(const char *cmd, int flag);
* @return 0 on success, or != 0 on error.
*/
int run_command_list(const char *cmd, int len, int flag);
-extern char console_buffer[];
/* arch/$(ARCH)/lib/board.c */
void board_init_f(ulong);
@@ -862,15 +861,6 @@ void srand(unsigned int seed);
unsigned int rand(void);
unsigned int rand_r(unsigned int *seedp);
-/* common/console.c */
-int console_init_f(void); /* Before relocation; uses the serial stuff */
-int console_init_r(void); /* After relocation; uses the console stuff */
-int console_assign(int file, const char *devname); /* Assign the console */
-int ctrlc (void);
-int had_ctrlc (void); /* have we had a Control-C since last clear? */
-void clear_ctrlc (void); /* clear the Control-C condition */
-int disable_ctrlc (int); /* 1 to disable, 0 to enable Control-C detect */
-int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */
/*
* STDIO based functions (can always be used)
*/
@@ -929,13 +919,6 @@ static inline struct in_addr getenv_ip(char *var)
return string_to_ip(getenv(var));
}
-/*
- * CONSOLE multiplexing.
- */
-#ifdef CONFIG_CONSOLE_MUX
-#include <iomux.h>
-#endif
-
int pcmcia_init (void);
#ifdef CONFIG_STATUS_LED
diff --git a/include/console.h b/include/console.h
new file mode 100644
index 00000000000..097518d1503
--- /dev/null
+++ b/include/console.h
@@ -0,0 +1,30 @@
+/*
+ * (C) Copyright 2000-2009
+ * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __CONSOLE_H
+#define __CONSOLE_H
+
+extern char console_buffer[];
+
+/* common/console.c */
+int console_init_f(void); /* Before relocation; uses the serial stuff */
+int console_init_r(void); /* After relocation; uses the console stuff */
+int console_assign(int file, const char *devname); /* Assign the console */
+int ctrlc(void);
+int had_ctrlc(void); /* have we had a Control-C since last clear? */
+void clear_ctrlc(void); /* clear the Control-C condition */
+int disable_ctrlc(int); /* 1 to disable, 0 to enable Control-C detect */
+int confirm_yesno(void); /* 1 if input is "y", "Y", "yes" or "YES" */
+
+/*
+ * CONSOLE multiplexing.
+ */
+#ifdef CONFIG_CONSOLE_MUX
+#include <iomux.h>
+#endif
+
+#endif
diff --git a/lib/display_options.c b/lib/display_options.c
index 83ea4decb53..4f2961fbfb7 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -7,6 +7,7 @@
#include <config.h>
#include <common.h>
+#include <console.h>
#include <div64.h>
#include <inttypes.h>
#include <version.h>
diff --git a/lib/gunzip.c b/lib/gunzip.c
index 4128a1871c9..bdd85c4c175 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -8,6 +8,7 @@
#include <common.h>
#include <watchdog.h>
#include <command.h>
+#include <console.h>
#include <image.h>
#include <malloc.h>
#include <u-boot/zlib.h>
diff --git a/net/net.c b/net/net.c
index 2926bceacba..4d5746a7b35 100644
--- a/net/net.c
+++ b/net/net.c
@@ -83,6 +83,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <environment.h>
#include <errno.h>
#include <net.h>
diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index a36a9c04abe..867b5177e0c 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -6,6 +6,7 @@
#include <common.h>
#include <command.h>
+#include <console.h>
#include <dm.h>
#include <errno.h>
#include <malloc.h>
diff --git a/test/dm/usb.c b/test/dm/usb.c
index 4300bbd5c92..ccc07d5c9b5 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -5,6 +5,7 @@
*/
#include <common.h>
+#include <console.h>
#include <dm.h>
#include <usb.h>
#include <asm/io.h>