]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm: spl: Bind in all devices in SPL with of-platdata
authorSimon Glass <sjg@chromium.org>
Mon, 4 Jul 2016 17:58:14 +0000 (11:58 -0600)
committerSimon Glass <sjg@chromium.org>
Fri, 15 Jul 2016 02:40:24 +0000 (20:40 -0600)
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>
common/spl/spl.c

index 59f41a12237a6df6ca48e68aae29c16cef3595f3..12aed02935648eaa43d1faeb465d75aecb48160e 100644 (file)
@@ -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;