From 908d0243ac0bdf2672ec584a52d178100fff3fb2 Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Thu, 25 Jun 2020 01:10:10 -0300 Subject: core: drop const for struct driver_info In order to prepare for a new support of phandle when OF_PLATDATA is used drop the const for struct driver_info as this struct will need to be updated on runtime. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass --- drivers/core/root.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/core/root.c') diff --git a/drivers/core/root.c b/drivers/core/root.c index 7d257ea887d..23a65cd71df 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -26,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR; -static const struct driver_info root_info = { +static struct driver_info root_info = { .name = "root_driver", }; -- cgit v1.2.3 From fed0f891c6821d475710e1f7033253ec4723ee09 Mon Sep 17 00:00:00 2001 From: Walter Lozano Date: Thu, 25 Jun 2020 01:10:11 -0300 Subject: core: extend struct driver_info to point to device Currently when creating an U_BOOT_DEVICE entry a struct driver_info is declared, which contains the data needed to instantiate the device. However, the actual device is created at runtime and there is no proper way to get the device based on its struct driver_info. This patch extends struct driver_info adding a pointer to udevice which is populated during the bind process, allowing to generate a set of functions to get the device based on its struct driver_info. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass --- drivers/core/root.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/core/root.c') diff --git a/drivers/core/root.c b/drivers/core/root.c index 23a65cd71df..0de5d7c70d6 100644 --- a/drivers/core/root.c +++ b/drivers/core/root.c @@ -347,6 +347,10 @@ int dm_init_and_scan(bool pre_reloc_only) { int ret; +#if CONFIG_IS_ENABLED(OF_PLATDATA) + dm_populate_phandle_data(); +#endif + ret = dm_init(IS_ENABLED(CONFIG_OF_LIVE)); if (ret) { debug("dm_init() failed: %d\n", ret); -- cgit v1.2.3