* [PATCH 1/2] ARM: imx8m: Make uart setup function name more generic
@ 2020-08-21 4:35 Sascha Hauer
2020-08-21 4:35 ` [PATCH 2/2] ARM: i.MX8M boards: always set up UART Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2020-08-21 4:35 UTC (permalink / raw)
To: Barebox List
So far all i.MX8M variants have the same UART base addresses, so let's
be optimistic that it stays like that and rename imx8mq_uart_setup() to
imx8m_uart_setup().
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 2 +-
arch/arm/mach-imx/include/mach/debug_ll.h | 2 +-
include/serial/imx-uart.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
index 082aefb8c1..96b78d2c66 100644
--- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
@@ -32,7 +32,7 @@ static void setup_uart(void)
imx8mm_setup_pad(IMX8MM_PAD_UART2_TXD_UART2_TX | UART_PAD_CTRL);
- imx8mq_uart_setup((void *)MX8M_UART2_BASE_ADDR);
+ imx8m_uart_setup((void *)MX8M_UART2_BASE_ADDR);
if (IS_ENABLED(CONFIG_DEBUG_LL)) {
imx8m_uart_setup_ll();
diff --git a/arch/arm/mach-imx/include/mach/debug_ll.h b/arch/arm/mach-imx/include/mach/debug_ll.h
index 1593dd018e..a4c57c5d5a 100644
--- a/arch/arm/mach-imx/include/mach/debug_ll.h
+++ b/arch/arm/mach-imx/include/mach/debug_ll.h
@@ -102,7 +102,7 @@ static inline void imx8m_uart_setup_ll(void)
{
void *base = IOMEM(IMX_UART_BASE(IMX_DEBUG_SOC,
CONFIG_DEBUG_IMX_UART_PORT));
- imx8mq_uart_setup(base);
+ imx8m_uart_setup(base);
}
static inline void PUTC_LL(int c)
diff --git a/include/serial/imx-uart.h b/include/serial/imx-uart.h
index 23cee26fcf..c0a03ac054 100644
--- a/include/serial/imx-uart.h
+++ b/include/serial/imx-uart.h
@@ -201,7 +201,7 @@ static inline void imx7_uart_setup(void __iomem *uartbase)
imx_uart_setup(uartbase, 24000000);
}
-static inline void imx8mq_uart_setup(void __iomem *uartbase)
+static inline void imx8m_uart_setup(void __iomem *uartbase)
{
imx_uart_setup(uartbase, 25000000);
}
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] ARM: i.MX8M boards: always set up UART
2020-08-21 4:35 [PATCH 1/2] ARM: imx8m: Make uart setup function name more generic Sascha Hauer
@ 2020-08-21 4:35 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2020-08-21 4:35 UTC (permalink / raw)
To: Barebox List
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>
---
arch/arm/boards/nxp-imx8mm-evk/lowlevel.c | 10 +++++-----
arch/arm/boards/nxp-imx8mp-evk/lowlevel.c | 6 +++++-
arch/arm/boards/nxp-imx8mq-evk/lowlevel.c | 5 ++++-
arch/arm/boards/phytec-som-imx8mq/lowlevel.c | 6 +++++-
arch/arm/boards/zii-imx8mq-dev/lowlevel.c | 5 ++++-
5 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
index 96b78d2c66..2297dc01e7 100644
--- a/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mm-evk/lowlevel.c
@@ -28,16 +28,16 @@ extern char __dtb_imx8mm_evk_start[];
static void setup_uart(void)
{
+ void __iomem *uart = IOMEM(MX8M_UART2_BASE_ADDR);
+
imx8m_early_setup_uart_clock();
imx8mm_setup_pad(IMX8MM_PAD_UART2_TXD_UART2_TX | UART_PAD_CTRL);
+ imx8m_uart_setup(uart);
- imx8m_uart_setup((void *)MX8M_UART2_BASE_ADDR);
+ pbl_set_putc(imx_uart_putc, uart);
- if (IS_ENABLED(CONFIG_DEBUG_LL)) {
- imx8m_uart_setup_ll();
- putc_ll('>');
- }
+ putc_ll('>');
}
static void pmic_reg_write(void *i2c, int reg, uint8_t val)
diff --git a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
index 5df1ed0780..c193640865 100644
--- a/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mp-evk/lowlevel.c
@@ -34,11 +34,15 @@ extern char __dtb_imx8mp_evk_start[];
static void setup_uart(void)
{
+ void __iomem *uart = IOMEM(MX8M_UART2_BASE_ADDR);
+
imx8m_early_setup_uart_clock();
imx8mp_setup_pad(MX8MP_PAD_UART2_TXD__UART2_DCE_TX | UART_PAD_CTRL);
imx8mp_setup_pad(MX8MP_PAD_UART2_RXD__UART2_DCE_RX | UART_PAD_CTRL);
- imx8m_uart_setup_ll();
+ imx8m_uart_setup(uart);
+
+ pbl_set_putc(imx_uart_putc, uart);
putc_ll('>');
}
diff --git a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
index 39358afad1..9d16b7e32a 100644
--- a/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
+++ b/arch/arm/boards/nxp-imx8mq-evk/lowlevel.c
@@ -26,11 +26,14 @@ extern char __dtb_imx8mq_evk_start[];
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('>');
}
diff --git a/arch/arm/boards/phytec-som-imx8mq/lowlevel.c b/arch/arm/boards/phytec-som-imx8mq/lowlevel.c
index f5b9b6c008..ea6ff58cae 100644
--- a/arch/arm/boards/phytec-som-imx8mq/lowlevel.c
+++ b/arch/arm/boards/phytec-som-imx8mq/lowlevel.c
@@ -29,11 +29,15 @@ extern char __dtb_imx8mq_phytec_phycore_som_start[];
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_ll();
+ imx8m_uart_setup(uart);
+
+ pbl_set_putc(imx_uart_putc, uart);
putc_ll('>');
}
diff --git a/arch/arm/boards/zii-imx8mq-dev/lowlevel.c b/arch/arm/boards/zii-imx8mq-dev/lowlevel.c
index 6400833809..80d2e4c997 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('>');
}
--
2.28.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-21 4:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-21 4:35 [PATCH 1/2] ARM: imx8m: Make uart setup function name more generic Sascha Hauer
2020-08-21 4:35 ` [PATCH 2/2] ARM: i.MX8M boards: always set up UART Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox