diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-08-21 06:18:43 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-08-21 07:43:00 +0200 |
commit | ec82a0888b6ad370e4e3b1b691105eb37684c9d0 (patch) | |
tree | 915bf82d80e83b32e1f7bd341272bab12517ec26 /arch/arm/boards/zii-imx8mq-dev | |
parent | 9ba893e0dadcf6721e80f2516881a8830da1e417 (diff) | |
download | barebox-ec82a0888b6ad370e4e3b1b691105eb37684c9d0.tar.gz barebox-ec82a0888b6ad370e4e3b1b691105eb37684c9d0.tar.xz |
ARM: i.MX8M boards: always set up UART
Quoting Lucas on b96cc34f91 ("ARM: nxp-imx8mm-evk: always set up UART"):
| When the TF-A is configured to have some output on the UART it does not
| set up the UART on its own, but just expects a pre-existing configuration.
| If Barebox did not set up the UART in the !DEBUG_LL case, TF-A will just
| hang without any user accessible debug output, which is a very non-obvious
| failure, so better be safe and always set up the UART in case TF-A wants
| to use it.
This patch adopts this for all i.MX8M boards and makes the early UART
setup consistent across all of them. We also add pbl_set_putc() to
enable regular PBL console messages. For the i.MX8MM-EVK the unnecessary
call to imx8m_uart_setup_ll() is dropped; we already configured the
UART in imx8m_uart_setup(), no need to do that again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/zii-imx8mq-dev')
-rw-r--r-- | arch/arm/boards/zii-imx8mq-dev/lowlevel.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c index 6400833809..311e61fb1d 100644 --- a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c +++ b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c @@ -28,11 +28,14 @@ static void setup_uart(void) { + void __iomem *uart = IOMEM(MX8M_UART1_BASE_ADDR); + imx8m_early_setup_uart_clock(); imx8mq_setup_pad(IMX8MQ_PAD_UART1_TXD__UART1_TX | UART_PAD_CTRL); + imx8m_uart_setup(uart); - imx8m_uart_setup_ll(); + pbl_set_putc(imx_uart_putc, uart); putc_ll('>'); } @@ -118,6 +121,8 @@ static __noreturn noinline void zii_imx8mq_dev_start(void) unsigned int system_type; void *fdt; + setup_uart(); + if (get_pc() < MX8MQ_DDR_CSD1_BASE_ADDR) { /* * We assume that we were just loaded by MaskROM into @@ -194,9 +199,6 @@ ENTRY_FUNCTION(start_zii_imx8mq_dev, r0, r1, r2) imx8mq_cpu_lowlevel_init(); relocate_to_current_adr(); setup_c(); - - if (IS_ENABLED(CONFIG_DEBUG_LL)) - setup_uart(); zii_imx8mq_dev_start(); } |