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.
This commit is contained in:
Tom Rini 2018-05-24 09:54:25 -04:00
commit 8730d012c9
12 changed files with 82 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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, &regs->baudl);
writeb((arc_console_baud & 0xff00) >> 8, &regs->baudh);
}
static inline void _debug_uart_putc(int c)
{
struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_DEBUG_UART_BASE;
while (!(readb(&regs->status) & UART_TXEMPTY))
;
writeb(c, &regs->data);
}
DEBUG_UART_FUNCS
#endif

View File

@ -24,16 +24,6 @@
#define CONFIG_SYS_BOOTM_LEN SZ_32M
#define CONFIG_SYS_LOAD_ADDR 0x82000000
/*
* UART configuration
*
*/
#define CONFIG_ARC_SERIAL
/*
* Command line configuration
*/
/*
* Environment settings
*/

View File

@ -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