From 1ad3c8365a7d47f16a11db084e38c3604639fd68 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Mon, 12 Jul 2021 19:35:44 +0900 Subject: board: synquacer: Initialize SCBM SMMU at board_init() Since the SCBM SMMU is not only connected to the NETSEC but also shared with the F_SDH30 (eMMC controller), that should be initialized at board level instead of NETSEC. Move the SMMU initialization code into board support and call it from board_init(). Without this fix, if the NETSEC is disabled, the Linux eMMC ADMA cause an error because SMMU is not initialized. Signed-off-by: Masami Hiramatsu --- drivers/net/sni_netsec.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers') diff --git a/drivers/net/sni_netsec.c b/drivers/net/sni_netsec.c index a9ebf6af9c5..4901321d0cf 100644 --- a/drivers/net/sni_netsec.c +++ b/drivers/net/sni_netsec.c @@ -1059,18 +1059,11 @@ static int netsec_of_to_plat(struct udevice *dev) return 0; } -#define SMMU_SCR0_SHCFG_INNER (0x2 << 22) -#define SMMU_SCR0_MTCFG (0x1 << 20) -#define SMMU_SCR0_MEMATTR_INNER_OUTER_WB (0xf << 16) - static int netsec_probe(struct udevice *dev) { struct netsec_priv *priv = dev_get_priv(dev); int ret; - writel(SMMU_SCR0_SHCFG_INNER | SMMU_SCR0_MTCFG | SMMU_SCR0_MEMATTR_INNER_OUTER_WB, - (phys_addr_t)0x52E00000); - netsec_reset_hardware(priv, true); ret = netsec_mdiobus_init(priv, dev->name); -- cgit v1.2.3 From ad7e967738a9c639e07cf50b83ffccdf9a8537b0 Mon Sep 17 00:00:00 2001 From: Stephan Gerhold Date: Wed, 14 Jul 2021 10:56:26 +0200 Subject: serial: serial_msm: Delay initialization to let pins stabilize For some reason, the DragonBoard 410c aborts autoboot immediately if U-Boot is started without LK. It looks like it picks up a single broken character via serial and therefore believes a key was pressed to abort autoboot. After some debugging, it seems like adding some delay after pinctrl setup but before UART initialization fixes the issue. It's also worth mentioning that unlike when booting from LK, the pinctrl setup is actually necessary when booting U-Boot without LK since UART is broken if the pinctrl line is removed. I suspect that reconfiguring the pins might take some time to stabilize and if the UART controller is enabled too quickly it will pick up some random noise. Adding a few milliseconds of delay fixes the issue and shouldn't have any other negative side effects. 3ms seems to be the minimum delay required in my tests, use 5ms instead just to be sure. Signed-off-by: Stephan Gerhold --- drivers/serial/serial_msm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/serial/serial_msm.c b/drivers/serial/serial_msm.c index d8dd5c1104b..ac4d0824b98 100644 --- a/drivers/serial/serial_msm.c +++ b/drivers/serial/serial_msm.c @@ -18,6 +18,7 @@ #include #include #include +#include #include /* Serial registers - this driver works in uartdm mode*/ @@ -193,6 +194,9 @@ static int msm_uart_clk_init(struct udevice *dev) static void uart_dm_init(struct msm_serial_data *priv) { + /* Delay initialization for a bit to let pins stabilize if necessary */ + mdelay(5); + writel(priv->clk_bit_rate, priv->base + UARTDM_CSR); writel(0x0, priv->base + UARTDM_MR1); writel(MSM_BOOT_UART_DM_8_N_1_MODE, priv->base + UARTDM_MR2); -- cgit v1.2.3 From 198201509a460c8f1b85e3447b35599129f4f885 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Mon, 19 Jul 2021 15:36:04 +0800 Subject: serial: pl011: Resend the character if FIFO is full in debug uart pl01x_putc() might return -EAGAIN if there was no space in FIFO. In that case, high-level caller should wait until there is space and resend the character. Signed-off-by: Chen Baozi Reviewed-by: Stefan Roese Reviewed-by: Simon Glass --- drivers/serial/serial_pl01x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 76b96ad414c..8ff19acf335 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -417,7 +417,8 @@ static inline void _debug_uart_putc(int ch) { struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE; - pl01x_putc(regs, ch); + while (pl01x_putc(regs, ch) == -EAGAIN) + ; } DEBUG_UART_FUNCS -- cgit v1.2.3 From bc7b38450baa4efe71bb14ea8aab9e8d206073fd Mon Sep 17 00:00:00 2001 From: Chia-Wei Wang Date: Tue, 20 Jul 2021 15:01:36 +0800 Subject: reset: ast2600: Fix missing reference operator Fix missing reference operator '&' to correctly get HW register addresses for writel(). Signed-off-by: Chia-Wei Wang --- drivers/reset/reset-ast2600.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/reset/reset-ast2600.c b/drivers/reset/reset-ast2600.c index f64adaf74e8..195ddd18e05 100644 --- a/drivers/reset/reset-ast2600.c +++ b/drivers/reset/reset-ast2600.c @@ -41,9 +41,9 @@ static int ast2600_reset_assert(struct reset_ctl *reset_ctl) debug("%s: reset_ctl->id: %lu\n", __func__, reset_ctl->id); if (reset_ctl->id < 32) - writel(BIT(reset_ctl->id), scu->modrst_ctrl1); + writel(BIT(reset_ctl->id), &scu->modrst_ctrl1); else - writel(BIT(reset_ctl->id - 32), scu->modrst_ctrl2); + writel(BIT(reset_ctl->id - 32), &scu->modrst_ctrl2); return 0; } @@ -56,9 +56,9 @@ static int ast2600_reset_deassert(struct reset_ctl *reset_ctl) debug("%s: reset_ctl->id: %lu\n", __func__, reset_ctl->id); if (reset_ctl->id < 32) - writel(BIT(reset_ctl->id), scu->modrst_clr1); + writel(BIT(reset_ctl->id), &scu->modrst_clr1); else - writel(BIT(reset_ctl->id - 32), scu->modrst_clr2); + writel(BIT(reset_ctl->id - 32), &scu->modrst_clr2); return 0; } -- cgit v1.2.3 From 91a043896dfb8544db00496bee08bcf59e449dc9 Mon Sep 17 00:00:00 2001 From: Chen Baozi Date: Wed, 21 Jul 2021 14:11:26 +0800 Subject: serial: pl011: Enable DEBUG_UART_PL011 in SPL Commit b81406db51a6 ("arm: serial: Add debug UART capability to the pl01x driver") add supports to use pl01x as a debug UART. However, due to CONFIG_IS_ENABLED macro requires CONFIG_SPL_* prefix, the _debug_uart_init() would not choose TYPE_PL011 in SPL build. This patch fixes the bug by judging CONFIG_DEBUG_UART_PL011 explicitly. Signed-off-by: Chen Baozi Reviewed-by: Simon Glass --- drivers/serial/serial_pl01x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial_pl01x.c b/drivers/serial/serial_pl01x.c index 8ff19acf335..67caa063c9a 100644 --- a/drivers/serial/serial_pl01x.c +++ b/drivers/serial/serial_pl01x.c @@ -404,8 +404,12 @@ static void _debug_uart_init(void) { #ifndef CONFIG_DEBUG_UART_SKIP_INIT struct pl01x_regs *regs = (struct pl01x_regs *)CONFIG_DEBUG_UART_BASE; - enum pl01x_type type = CONFIG_IS_ENABLED(DEBUG_UART_PL011) ? - TYPE_PL011 : TYPE_PL010; + enum pl01x_type type; + + if (IS_ENABLED(CONFIG_DEBUG_UART_PL011)) + type = TYPE_PL011; + else + type = TYPE_PL010; pl01x_generic_serial_init(regs, type); pl01x_generic_setbrg(regs, type, -- cgit v1.2.3