From: Marco Felsch <m.felsch@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH next 1/3] ARM: i.MX8MP: EVK: convert to board driver and enable deep-probe
Date: Mon, 17 Oct 2022 18:18:16 +0200 [thread overview]
Message-ID: <20221017161818.333094-1-m.felsch@pengutronix.de> (raw)
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
next reply other threads:[~2022-10-17 16:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 16:18 Marco Felsch [this message]
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
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=20221017161818.333094-1-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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