diff options
author | Tom Rini | 2018-05-24 09:54:25 -0400 |
---|---|---|
committer | Tom Rini | 2018-05-24 09:54:25 -0400 |
commit | 8730d012c9bd92d6412b3ef6e33b40c5df00f225 (patch) | |
tree | c6db406267e19a4c59e0a49565c284822ff39b6f | |
parent | 7049f620002b18eef4ffc6512efafac4177e1b01 (diff) | |
parent | 0556b569e52caf3ab519c340435236e4940cc1cd (diff) |
Merge tag 'arc-uart-updates-for-2018.07-rc1' of git://git.denx.de/u-boot-arc
Add support for DEBUG_UART on ARC devboards
This required us to do 2 things:
1) Insert a call to debug_uart_init() in early boot code
2) Convert serial_arc to Kconfig
Once both items above are done we just patched defconfigs.
-rw-r--r-- | arch/arc/lib/start.S | 5 | ||||
-rw-r--r-- | configs/axs101_defconfig | 5 | ||||
-rw-r--r-- | configs/axs103_defconfig | 5 | ||||
-rw-r--r-- | configs/hsdk_defconfig | 5 | ||||
-rw-r--r-- | configs/nsim_700_defconfig | 5 | ||||
-rw-r--r-- | configs/nsim_700be_defconfig | 5 | ||||
-rw-r--r-- | configs/nsim_hs38_defconfig | 5 | ||||
-rw-r--r-- | configs/nsim_hs38be_defconfig | 5 | ||||
-rw-r--r-- | drivers/serial/Kconfig | 16 | ||||
-rw-r--r-- | drivers/serial/serial_arc.c | 26 | ||||
-rw-r--r-- | include/configs/nsim.h | 10 | ||||
-rw-r--r-- | scripts/config_whitelist.txt | 1 |
12 files changed, 82 insertions, 11 deletions
diff --git a/arch/arc/lib/start.S b/arch/arc/lib/start.S index 3fb05606c7b..e573ce7718b 100644 --- a/arch/arc/lib/start.S +++ b/arch/arc/lib/start.S @@ -75,6 +75,11 @@ ENTRY(_start) /* Initialize reserved area - note: r0 already contains address */ bl board_init_f_init_reserve +#ifdef CONFIG_DEBUG_UART + /* Earliest point to set up early debug uart */ + bl debug_uart_init +#endif + /* Zero the one and only argument of "board_init_f" */ mov_s %r0, 0 bl board_init_f diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig index 25b10888ced..559ed4734c1 100644 --- a/configs/axs101_defconfig +++ b/configs/axs101_defconfig @@ -3,6 +3,7 @@ CONFIG_TARGET_AXS101=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=750000000 CONFIG_DEFAULT_DEVICE_TREE="axs101" +CONFIG_DEBUG_UART=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS3,115200n8" @@ -33,6 +34,10 @@ CONFIG_DM_ETH=y CONFIG_PHY_GIGE=y CONFIG_ETH_DESIGNWARE=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xe0022000 +CONFIG_DEBUG_UART_CLOCK=33333333 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig index b9d387b88a8..8b66451307d 100644 --- a/configs/axs103_defconfig +++ b/configs/axs103_defconfig @@ -3,6 +3,7 @@ CONFIG_ISA_ARCV2=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=100000000 CONFIG_DEFAULT_DEVICE_TREE="axs103" +CONFIG_DEBUG_UART=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS3,115200n8" @@ -33,6 +34,10 @@ CONFIG_DM_ETH=y CONFIG_PHY_GIGE=y CONFIG_ETH_DESIGNWARE=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xe0022000 +CONFIG_DEBUG_UART_CLOCK=33333333 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_SYS_NS16550=y CONFIG_USB=y CONFIG_DM_USB=y diff --git a/configs/hsdk_defconfig b/configs/hsdk_defconfig index d23acfeb878..28cd1dd70c4 100644 --- a/configs/hsdk_defconfig +++ b/configs/hsdk_defconfig @@ -4,6 +4,7 @@ CONFIG_TARGET_HSDK=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=500000000 CONFIG_DEFAULT_DEVICE_TREE="hsdk" +CONFIG_DEBUG_UART=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyS0,115200n8" CONFIG_BOARD_EARLY_INIT_F=y @@ -42,6 +43,10 @@ CONFIG_SPI_FLASH_SST=y CONFIG_DM_ETH=y CONFIG_ETH_DESIGNWARE=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xf0005000 +CONFIG_DEBUG_UART_CLOCK=33333333 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_SYS_NS16550=y CONFIG_SPI=y CONFIG_DM_SPI=y diff --git a/configs/nsim_700_defconfig b/configs/nsim_700_defconfig index 12fe5f77c64..b10044986fa 100644 --- a/configs/nsim_700_defconfig +++ b/configs/nsim_700_defconfig @@ -3,6 +3,7 @@ CONFIG_TARGET_NSIM=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=70000000 CONFIG_DEFAULT_DEVICE_TREE="nsim" +CONFIG_DEBUG_UART=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyARC0,115200n8" @@ -13,4 +14,8 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_DM=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_ARC_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xc0fc1000 +CONFIG_DEBUG_UART_CLOCK=70000000 +CONFIG_ARC_SERIAL=y CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/configs/nsim_700be_defconfig b/configs/nsim_700be_defconfig index 6c0dba7c6d0..6f03145517d 100644 --- a/configs/nsim_700be_defconfig +++ b/configs/nsim_700be_defconfig @@ -4,6 +4,7 @@ CONFIG_TARGET_NSIM=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=70000000 CONFIG_DEFAULT_DEVICE_TREE="nsim" +CONFIG_DEBUG_UART=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyARC0,115200n8" @@ -14,4 +15,8 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_DM=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_ARC_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xc0fc1000 +CONFIG_DEBUG_UART_CLOCK=70000000 +CONFIG_ARC_SERIAL=y CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/configs/nsim_hs38_defconfig b/configs/nsim_hs38_defconfig index bb31adb381d..526dd3e5e24 100644 --- a/configs/nsim_hs38_defconfig +++ b/configs/nsim_hs38_defconfig @@ -4,6 +4,7 @@ CONFIG_TARGET_NSIM=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=70000000 CONFIG_DEFAULT_DEVICE_TREE="nsim" +CONFIG_DEBUG_UART=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyARC0,115200n8" @@ -14,4 +15,8 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_DM=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_ARC_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xc0fc1000 +CONFIG_DEBUG_UART_CLOCK=70000000 +CONFIG_ARC_SERIAL=y CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/configs/nsim_hs38be_defconfig b/configs/nsim_hs38be_defconfig index a2cc238433f..141051ded1f 100644 --- a/configs/nsim_hs38be_defconfig +++ b/configs/nsim_hs38be_defconfig @@ -5,6 +5,7 @@ CONFIG_TARGET_NSIM=y CONFIG_SYS_TEXT_BASE=0x81000000 CONFIG_SYS_CLK_FREQ=70000000 CONFIG_DEFAULT_DEVICE_TREE="nsim" +CONFIG_DEBUG_UART=y CONFIG_BOOTDELAY=3 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="console=ttyARC0,115200n8" @@ -15,4 +16,8 @@ CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y CONFIG_DM=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_ARC_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xc0fc1000 +CONFIG_DEBUG_UART_CLOCK=70000000 +CONFIG_ARC_SERIAL=y CONFIG_USE_PRIVATE_LIBGCC=y diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 5937910e5bf..87779098608 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -197,6 +197,15 @@ config DEBUG_UART_AR933X driver will be available until the real driver model serial is running. +config DEBUG_ARC_SERIAL + bool "ARC UART" + depends on ARC_SERIAL + help + Select this to enable a debug UART using the ARC UART driver. + You will need to provide parameters to make this work. The + driver will be available until the real driver model serial is + running. + config DEBUG_UART_ATMEL bool "Atmel USART" help @@ -425,6 +434,13 @@ config AR933X_UART tree binding to operate, please refer to the document at doc/device-tree-bindings/serial/qca,ar9330-uart.txt. +config ARC_SERIAL + bool "ARC UART support" + depends on DM_SERIAL + help + Select this to enable support for ARC UART now typically + only used in Synopsys DesignWare ARC simulators like nSIM. + config ATMEL_USART bool "Atmel USART support" help diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c index da4a07ab2f6..925f0c25554 100644 --- a/drivers/serial/serial_arc.c +++ b/drivers/serial/serial_arc.c @@ -130,3 +130,29 @@ U_BOOT_DRIVER(serial_arc) = { .ops = &arc_serial_ops, .flags = DM_FLAG_PRE_RELOC, }; + +#ifdef CONFIG_DEBUG_ARC_SERIAL +#include <debug_uart.h> + +static inline void _debug_uart_init(void) +{ + struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_DEBUG_UART_BASE; + int arc_console_baud = CONFIG_DEBUG_UART_CLOCK / (CONFIG_BAUDRATE * 4) - 1; + + writeb(arc_console_baud & 0xff, ®s->baudl); + writeb((arc_console_baud & 0xff00) >> 8, ®s->baudh); +} + +static inline void _debug_uart_putc(int c) +{ + struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_DEBUG_UART_BASE; + + while (!(readb(®s->status) & UART_TXEMPTY)) + ; + + writeb(c, ®s->data); +} + +DEBUG_UART_FUNCS + +#endif diff --git a/include/configs/nsim.h b/include/configs/nsim.h index 0f22606feed..c3f34a91e43 100644 --- a/include/configs/nsim.h +++ b/include/configs/nsim.h @@ -25,16 +25,6 @@ #define CONFIG_SYS_LOAD_ADDR 0x82000000 /* - * UART configuration - * - */ -#define CONFIG_ARC_SERIAL - -/* - * Command line configuration - */ - -/* * Environment settings */ #define CONFIG_ENV_SIZE SZ_512 diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 9f3ccecc1dd..c5cb23dbf17 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -47,7 +47,6 @@ CONFIG_ARCH_RMOBILE_EXTRAM_BOOT CONFIG_ARCH_TEGRA CONFIG_ARCH_USE_BUILTIN_BSWAP CONFIG_ARC_MMU_VER -CONFIG_ARC_SERIAL CONFIG_ARIES_M28_V10 CONFIG_ARMADA100 CONFIG_ARMADA100_FEC |