From 97b059730218824a1455f030aadd78ef51729ec0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 18 Oct 2015 19:51:23 -0600 Subject: debug_uart: Adjust the declaration of debug_uart_init() We want to be able to add other common code to this function. So change the driver's version to have an underscore before it, just like _debug_uart_putc(). Define debug_uart_init() to call this version. Update all drivers to this new method. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- drivers/serial/ns16550.c | 2 +- drivers/serial/serial_efi.c | 2 +- drivers/serial/serial_s5p.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c index 6275a11..6433844 100644 --- a/drivers/serial/ns16550.c +++ b/drivers/serial/ns16550.c @@ -257,7 +257,7 @@ int NS16550_tstc(NS16550_t com_port) (1 << CONFIG_DEBUG_UART_SHIFT), \ CONFIG_DEBUG_UART_SHIFT) -void debug_uart_init(void) +static inline void _debug_uart_init(void) { struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE; int baud_divisor; diff --git a/drivers/serial/serial_efi.c b/drivers/serial/serial_efi.c index cf57d89..ea25c25 100644 --- a/drivers/serial/serial_efi.c +++ b/drivers/serial/serial_efi.c @@ -107,7 +107,7 @@ static int serial_efi_pending(struct udevice *dev, bool input) * There is nothing to init here since the EFI console is already running by * the time we enter U-Boot. */ -void debug_uart_init(void) +static inline void _debug_uart_init(void) { } diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index 3f0b588..feba467 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -207,7 +207,7 @@ U_BOOT_DRIVER(serial_s5p) = { #include -void debug_uart_init(void) +static inline void _debug_uart_init(void) { struct s5p_uart *uart = (struct s5p_uart *)CONFIG_DEBUG_UART_BASE; -- cgit v1.1 From 0e977bc1455699fd8a9303ee3e8fd66a3c8eaced Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 18 Oct 2015 19:51:24 -0600 Subject: debug_uart: Support board-specific UART initialisation Some boards need to set things up before the debug UART can be used. On these boards a call to debug_uart_init() is insufficient. When this option is enabled, the function board_debug_uart_init() will be called when debug_uart_init() is called. You can put any code here that is needed to set up the UART ready for use, such as set pin multiplexing or enable clocks. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- drivers/serial/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/serial') diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index ddb725d..39f6500 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -109,6 +109,17 @@ config DEBUG_UART_SHIFT value. Use this value to specify the shift to use, where 0=byte registers, 2=32-bit word registers, etc. +config DEBUG_UART_BOARD_INIT + bool "Enable board-specific debug UART init" + depends on DEBUG_UART + help + Some boards need to set things up before the debug UART can be used. + On these boards a call to debug_uart_init() is insufficient. When + this option is enabled, the function board_debug_uart_init() will + be called when debug_uart_init() is called. You can put any code + here that is needed to set up the UART ready for use, such as set + pin multiplexing or enable clocks. + config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" depends on ARCH_ROCKCHIP && DM_SERIAL -- cgit v1.1 From c7fefcb9125bbd183dc095996c6747273043d988 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 18 Oct 2015 19:51:25 -0600 Subject: debug_uart: Add an option to announce the debug UART It is useful to see a message from the debug UART early during boot so that you know things are working. Add an option to enable this. The message will be displayed as soon as debug_uart_init() is called. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- drivers/serial/Kconfig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/serial') diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 39f6500..ac5920a 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -120,6 +120,16 @@ config DEBUG_UART_BOARD_INIT here that is needed to set up the UART ready for use, such as set pin multiplexing or enable clocks. +config DEBUG_UART_ANNOUNCE + bool "Show a message when the debug UART starts up" + depends on DEBUG_UART + help + Enable this option to show a message when the debug UART is ready + for use. You will see a message like " " as soon as + U-Boot has the UART ready for use (i.e. your code calls + debug_uart_init()). This can be useful just as a check that + everything is working. + config ROCKCHIP_SERIAL bool "Rockchip on-chip UART support" depends on ARCH_ROCKCHIP && DM_SERIAL -- cgit v1.1 From 3a64845e9d52d77b711b36a282e36f637f33d66b Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Mon, 28 Sep 2015 16:17:47 +0530 Subject: drivers: serial: serial_omap: populate default clock frequency when not found in dt In some platforms like am437x, serial node is not populated with clock-frequency node. So in that case have a default clock-clock frequency. Signed-off-by: Mugunthan V N Reviewed-by: Lokesh Vutla --- drivers/serial/serial_omap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/serial') diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c index e8d544f..9709444 100644 --- a/drivers/serial/serial_omap.c +++ b/drivers/serial/serial_omap.c @@ -12,6 +12,8 @@ DECLARE_GLOBAL_DATA_PTR; +#define DEFAULT_CLK_SPEED 48000000 /* 48Mhz */ + #if CONFIG_IS_ENABLED(OF_CONTROL) static const struct udevice_id omap_serial_ids[] = { { .compatible = "ti,omap3-uart" }, @@ -28,7 +30,7 @@ static int omap_serial_ofdata_to_platdata(struct udevice *dev) if (ret) return ret; plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset, - "clock-frequency", -1); + "clock-frequency", DEFAULT_CLK_SPEED); plat->reg_shift = 2; return 0; -- cgit v1.1 From e5a098b5cc46e296af9d95315be1ea848839082c Mon Sep 17 00:00:00 2001 From: Mugunthan V N Date: Mon, 28 Sep 2015 16:17:48 +0530 Subject: drivers: serial: serial_omap: add comaptibles for all ti platforms Adding compatibles for am335x, am437x and dra7 platforms. Signed-off-by: Mugunthan V N Reviewed-by: Lokesh Vutla --- drivers/serial/serial_omap.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/serial') diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c index 9709444..891cd7b 100644 --- a/drivers/serial/serial_omap.c +++ b/drivers/serial/serial_omap.c @@ -16,8 +16,12 @@ DECLARE_GLOBAL_DATA_PTR; #if CONFIG_IS_ENABLED(OF_CONTROL) static const struct udevice_id omap_serial_ids[] = { + { .compatible = "ti,omap2-uart" }, { .compatible = "ti,omap3-uart" }, { .compatible = "ti,omap4-uart" }, + { .compatible = "ti,am3352-uart" }, + { .compatible = "ti,am4372-uart" }, + { .compatible = "ti,dra742-uart" }, { } }; -- cgit v1.1