[PATCH v3 09/10] ARM: stm32mp: ddrctrl: add deep-probe support

Marco Felsch m.felsch at pengutronix.de
Wed Oct 21 07:58:12 EDT 2020


In case of deep-probe we have to ensure that the memory device is
available after the mem_initcall().

Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
---
Changelog:

v2:
- convert to of_devices_ensure_probed_by_dev_id()
- drop use-less deep-probe include
v3:
- no changes
---
 arch/arm/mach-stm32mp/ddrctrl.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-stm32mp/ddrctrl.c b/arch/arm/mach-stm32mp/ddrctrl.c
index 646fe4401a..a7a87ef8f8 100644
--- a/arch/arm/mach-stm32mp/ddrctrl.c
+++ b/arch/arm/mach-stm32mp/ddrctrl.c
@@ -148,4 +148,15 @@ static struct driver_d stm32mp1_ddr_driver = {
 	.of_compatible = DRV_OF_COMPAT(stm32mp1_ddr_dt_ids),
 };
 
-mem_platform_driver(stm32mp1_ddr_driver);
+static int stm32mp1_ddr_init(void)
+{
+	int ret;
+
+	ret = platform_driver_register(&stm32mp1_ddr_driver);
+	if (ret)
+		return ret;
+
+	return of_devices_ensure_probed_by_dev_id(of_get_root_node(),
+						  stm32mp1_ddr_dt_ids);
+}
+mem_initcall(stm32mp1_ddr_init);
-- 
2.20.1




More information about the barebox mailing list