diff mbox

[U-Boot,v3,34/62] dm: spl: Bind in all devices in SPL with of-platdata

Message ID 1467655123-29441-35-git-send-email-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass July 4, 2016, 5:58 p.m. UTC
When CONFIG_OF_PLATDATA is enabled, we cannot use the u-boot,dm-pre-reloc
device tree property since the device tree is not available. However,
dt-platdata.c only includes devices which would have been present in the
device tree, and we can assume that all such devices are needed for SPL.
If they were not needed, they would have been omitted to save space.

So in this case, bind all devices regardless of the u-boot,dm-pre-reloc
setting. This avoids needing to add a DM_FLAG_PRE_RELOC to every driver,
thus affecting U-Boot proper also.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 common/spl/spl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Simon Glass July 15, 2016, 3:59 a.m. UTC | #1
On 4 July 2016 at 11:58, Simon Glass <sjg@chromium.org> wrote:
> When CONFIG_OF_PLATDATA is enabled, we cannot use the u-boot,dm-pre-reloc
> device tree property since the device tree is not available. However,
> dt-platdata.c only includes devices which would have been present in the
> device tree, and we can assume that all such devices are needed for SPL.
> If they were not needed, they would have been omitted to save space.
>
> So in this case, bind all devices regardless of the u-boot,dm-pre-reloc
> setting. This avoids needing to add a DM_FLAG_PRE_RELOC to every driver,
> thus affecting U-Boot proper also.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  common/spl/spl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Applied to u-boot-dm
diff mbox

Patch

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 59f41a1..12aed02 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -210,7 +210,8 @@  int spl_init(void)
 		}
 	}
 	if (IS_ENABLED(CONFIG_SPL_DM)) {
-		ret = dm_init_and_scan(true);
+		/* With CONFIG_OF_PLATDATA, bring in all devices */
+		ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA));
 		if (ret) {
 			debug("dm_init_and_scan() returned error %d\n", ret);
 			return ret;