mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH next 1/3] ARM: i.MX8MP: EVK: convert to board driver and enable deep-probe
@ 2022-10-17 16:18 Marco Felsch
  2022-10-17 16:18 ` [PATCH next 2/3] ARM: dts: i.MX8MP: assume hsio power domain to be powered Marco Felsch
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Marco Felsch @ 2022-10-17 16:18 UTC (permalink / raw)
  To: barebox

Convert the driver to the board driver mechanism. While on it enable the
deep-probe support and add a comment about the ENET1_RGMII_EN bit
setting.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 arch/arm/boards/nxp-imx8mp-evk/board.c | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/arch/arm/boards/nxp-imx8mp-evk/board.c b/arch/arm/boards/nxp-imx8mp-evk/board.c
index 8f1c247109..57c41aa8d8 100644
--- a/arch/arm/boards/nxp-imx8mp-evk/board.c
+++ b/arch/arm/boards/nxp-imx8mp-evk/board.c
@@ -6,6 +6,7 @@
 #include <asm/memory.h>
 #include <bootsource.h>
 #include <common.h>
+#include <deep-probe.h>
 #include <init.h>
 #include <linux/phy.h>
 #include <linux/sizes.h>
@@ -14,15 +15,12 @@
 #include <gpio.h>
 #include <envfs.h>
 
-static int nxp_imx8mp_evk_init(void)
+static int nxp_imx8mp_evk_probe(struct device_d *dev)
 {
 	int emmc_bbu_flag = 0;
 	int sd_bbu_flag = 0;
 	u32 val;
 
-	if (!of_machine_is_compatible("fsl,imx8mp-evk"))
-		return 0;
-
 	if (bootsource_get() == BOOTSOURCE_MMC) {
 		if (bootsource_get_instance() == 2) {
 			of_device_enable_path("/chosen/environment-emmc");
@@ -39,10 +37,23 @@ static int nxp_imx8mp_evk_init(void)
 	imx8m_bbu_internal_mmc_register_handler("SD", "/dev/mmc1.barebox", sd_bbu_flag);
 	imx8m_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc2", emmc_bbu_flag);
 
+	/* Enable RGMII TX clk output */
 	val = readl(MX8MP_IOMUXC_GPR_BASE_ADDR + MX8MP_IOMUXC_GPR1);
 	val |= MX8MP_IOMUXC_GPR1_ENET1_RGMII_EN;
 	writel(val, MX8MP_IOMUXC_GPR_BASE_ADDR + MX8MP_IOMUXC_GPR1);
 
 	return 0;
 }
-coredevice_initcall(nxp_imx8mp_evk_init);
+
+static const struct of_device_id nxp_imx8mp_evk_of_match[] = {
+	{ .compatible = "fsl,imx8mp-evk" },
+	{ /* Sentinel */ }
+};
+BAREBOX_DEEP_PROBE_ENABLE(nxp_imx8mp_evk_of_match);
+
+static struct driver_d nxp_imx8mp_evk_board_driver = {
+	.name = "board-nxp-imx8mp-evk",
+	.probe = nxp_imx8mp_evk_probe,
+	.of_compatible = nxp_imx8mp_evk_of_match,
+};
+coredevice_platform_driver(nxp_imx8mp_evk_board_driver);
-- 
2.30.2




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-18  9:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-17 16:18 [PATCH next 1/3] ARM: i.MX8MP: EVK: convert to board driver and enable deep-probe Marco Felsch
2022-10-17 16:18 ` [PATCH next 2/3] ARM: dts: i.MX8MP: assume hsio power domain to be powered Marco Felsch
2022-10-17 16:39   ` Ahmad Fatoum
2022-10-17 16:18 ` [PATCH next 3/3] ARM: i.MX8M: align SIP_BUILDINFO with the tf-a define Marco Felsch
2022-10-17 16:39   ` Ahmad Fatoum
2022-10-17 16:38 ` [PATCH next 1/3] ARM: i.MX8MP: EVK: convert to board driver and enable deep-probe Ahmad Fatoum
2022-10-18  9:04 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox