Implement bootsource_get_ofpath() on top of board_spl_was_booted_from()
and use fdt_fixup_bootsource() in spl_perform_arch_fixups(). With this
U-Boot proper also passes the path on to the OS.

Signed-off-by: Wadim Egorov <[email protected]>
---
 arch/arm/mach-rockchip/spl-boot-order.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-rockchip/spl-boot-order.c 
b/arch/arm/mach-rockchip/spl-boot-order.c
index d2dd5e10935..1a2fdc420d9 100644
--- a/arch/arm/mach-rockchip/spl-boot-order.c
+++ b/arch/arm/mach-rockchip/spl-boot-order.c
@@ -262,9 +262,13 @@ int spl_decode_boot_device(u32 boot_device, char *buf, 
size_t buflen)
 #endif
 }
 
+const char *bootsource_get_ofpath(void)
+{
+       return board_spl_was_booted_from();
+}
+
 void spl_perform_arch_fixups(struct spl_image_info *spl_image)
 {
-       const char *bootrom_ofpath = board_spl_was_booted_from();
        void *blob = spl_image_fdt_addr(spl_image);
        char boot_ofpath[512];
        int chosen, ret;
@@ -293,9 +297,6 @@ void spl_perform_arch_fixups(struct spl_image_info 
*spl_image)
         * Inject the ofpath of the device the BootROM loaded the very first
         * stage from into the FDT.
         */
-       if (!bootrom_ofpath)
-               pr_err("%s: could not map BootROM boot device to ofpath\n", 
__func__);
-       else
-               fdt_setprop_string(blob, chosen, "bootsource", bootrom_ofpath);
+       fdt_fixup_bootsource(blob);
 }
 #endif
-- 
2.48.1

Reply via email to