[PATCH 18/18] ARM: boards: mx6-sabrelite: add deep-probe support
Marco Felsch
m.felsch at pengutronix.de
Mon Sep 28 11:50:41 EDT 2020
Explicit request the required gpio resources instead of relying on their
existence based on the initcall level.
Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
.../boards/freescale-mx6-sabrelite/board.c | 24 ++++++++++++-------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/arch/arm/boards/freescale-mx6-sabrelite/board.c b/arch/arm/boards/freescale-mx6-sabrelite/board.c
index 1b39ef82c6..7fc3d4dc3f 100644
--- a/arch/arm/boards/freescale-mx6-sabrelite/board.c
+++ b/arch/arm/boards/freescale-mx6-sabrelite/board.c
@@ -13,7 +13,9 @@
#include <mach/bbu.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
+#include <of.h>
#include <partition.h>
+#include <deep-probe.h>
#include <linux/phy.h>
#include <asm/io.h>
#include <asm/mmu.h>
@@ -98,10 +100,6 @@ static int sabrelite_ksz9021rn_setup(void)
{
int ret;
- if (!of_machine_is_compatible("fsl,imx6q-sabrelite") &&
- !of_machine_is_compatible("fsl,imx6dl-sabrelite"))
- return 0;
-
mxc_iomux_v3_setup_multiple_pads(sabrelite_enet_gpio_pads,
ARRAY_SIZE(sabrelite_enet_gpio_pads));
@@ -118,11 +116,6 @@ static int sabrelite_ksz9021rn_setup(void)
return 0;
}
-/*
- * Do this before the fec initializes but after our
- * gpios are available.
- */
-fs_initcall(sabrelite_ksz9021rn_setup);
static void sabrelite_ehci_init(void)
{
@@ -134,10 +127,20 @@ static void sabrelite_ehci_init(void)
static int sabrelite_devices_init(void)
{
+ int ret;
+
if (!of_machine_is_compatible("fsl,imx6q-sabrelite") &&
!of_machine_is_compatible("fsl,imx6dl-sabrelite"))
return 0;
+ ret = of_devices_create_on_demand_by_property("gpio-controller");
+ if (ret)
+ return ret;
+
+ ret = sabrelite_ksz9021rn_setup();
+ if (ret)
+ return ret;
+
sabrelite_ehci_init();
armlinux_set_architecture(3769);
@@ -163,3 +166,6 @@ static int sabrelite_coredevices_init(void)
return 0;
}
coredevice_initcall(sabrelite_coredevices_init);
+
+deep_probe_enable(imx6q_sabrelite, "fsl,imx6q-sabrelite");
+deep_probe_enable(imx6dl_sabrelite, "fsl,imx6dl-sabrelite");
--
2.20.1
More information about the barebox
mailing list