From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Cc: Marek Vasut <marex@denx.de>, Fabio Estevam <festevam@denx.de>,
Marcel Ziswiler <marcel.ziswiler@toradex.com>,
Max Krummenacher <max.krummenacher@toradex.com>,
Peng Fan <peng.fan@nxp.com>, Stefano Babic <sbabic@denx.de>
Subject: [PATCH 1/2] ARM: imx8mm: verdin-imx8mm: Rework board_early_init()
Date: Fri, 8 Apr 2022 02:15:00 +0200 [thread overview]
Message-ID: <20220408001501.662956-1-marex@denx.de> (raw)
Rename board_early_init_f() to board_early_init(), since this function
has nothing to do with actual board_early_init_f() as used throughout
U-Boot. The board_early_init() is function local to this board used to
configure UART and WDT pinmux. Wrap init_uart_clk() into this function
so that early UART init would be all in one place. Turn the function
into __weak one, so it could be overridden in case custom carrier board
uses different UART or needs custom IOMUX settings.
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@denx.de>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Max Krummenacher <max.krummenacher@toradex.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
---
board/toradex/verdin-imx8mm/spl.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/board/toradex/verdin-imx8mm/spl.c b/board/toradex/verdin-imx8mm/spl.c
index 97d6a31da15..4e6128c3314 100644
--- a/board/toradex/verdin-imx8mm/spl.c
+++ b/board/toradex/verdin-imx8mm/spl.c
@@ -88,17 +88,17 @@ static iomux_v3_cfg_t const wdog_pads[] = {
IMX8MM_PAD_GPIO1_IO02_WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL),
};
-int board_early_init_f(void)
+__weak void board_early_init(void)
{
struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR;
+ init_uart_clk(0);
+
imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads));
set_wdog_reset(wdog);
imx_iomux_v3_setup_multiple_pads(uart_pads, ARRAY_SIZE(uart_pads));
-
- return 0;
}
int power_init_board(void)
@@ -140,9 +140,7 @@ void board_init_f(ulong dummy)
arch_cpu_init();
- init_uart_clk(0);
-
- board_early_init_f();
+ board_early_init();
timer_init();
--
2.35.1
next reply other threads:[~2022-04-08 0:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-08 0:15 Marek Vasut [this message]
2022-04-08 0:15 ` [PATCH 2/2] ARM: dts: imx8mm: Add i.MX8M Mini Toradex Verdin based Menlo board Marek Vasut
2022-04-12 21:40 ` sbabic
2022-04-12 18:46 ` [PATCH 1/2] ARM: imx8mm: verdin-imx8mm: Rework board_early_init() sbabic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220408001501.662956-1-marex@denx.de \
--to=marex@denx.de \
--cc=festevam@denx.de \
--cc=marcel.ziswiler@toradex.com \
--cc=max.krummenacher@toradex.com \
--cc=peng.fan@nxp.com \
--cc=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox