ARM: OMAP4/5: Change the default boot command to work with device tree
authorSRICHARAN R <r.sricharan@ti.com>
Thu, 4 Apr 2013 23:39:27 +0000 (23:39 +0000)
committerTom Rini <trini@ti.com>
Mon, 8 Apr 2013 15:29:05 +0000 (11:29 -0400)
Now with kernel moving to all device tree, the default
boot command is changed to pass the device tree blob.
Also, adding the findfdt command to get the dt-blob
based on the board.

Thanks to Tom Rini <trini@ti.com> for suggesting this.

Signed-off-by: Sricharan R <r.sricharan@ti.com>
include/configs/omap4_common.h
include/configs/omap5_common.h

index 6ae6a0f4355a465cdf833ac7e0eb8c9a6583fa1b..7af3989bea3459fb38cb76b17ca8c7dbc078e3bf 100644 (file)
  */
 
 #define CONFIG_BOOTDELAY       3
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_CMD_FS_GENERIC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
 
 #define CONFIG_ENV_OVERWRITE
 
        "loadaddr=0x82000000\0" \
        "console=ttyO2,115200n8\0" \
        "fdt_high=0xffffffff\0" \
+       "fdtaddr=0x80f80000\0" \
+       "bootpart=0:2\0" \
+       "bootdir=/boot\0" \
+       "bootfile=uImage\0" \
        "usbtty=cdc_acm\0" \
        "vram=16M\0" \
        "mmcdev=0\0" \
        "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
        "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
                "env import -t ${loadaddr} ${filesize}\0" \
-       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+       "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
        "mmcboot=echo Booting from mmc${mmcdev} ...; " \
                "run mmcargs; " \
-               "bootm ${loadaddr}\0" \
+               "bootm ${loadaddr} - ${fdtaddr}\0" \
+       "findfdt="\
+               "if test $board_name = sdp4430; then " \
+                       "setenv fdtfile omap4-sdp.dtb; fi; " \
+               "if test $board_name = panda; then " \
+                       "setenv fdtfile omap4-panda-es.dtb; fi\0" \
+       "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
 
 #define CONFIG_BOOTCOMMAND \
+       "run findfdt; " \
        "mmc dev ${mmcdev}; if mmc rescan; then " \
                "echo SD/MMC found on device ${mmcdev};" \
                "if run loadbootscript; then " \
                                "run uenvcmd;" \
                        "fi;" \
                "fi;" \
-               "if run loaduimage; then " \
+               "if run loadimage; then " \
+                       "run loadfdt;" \
                        "run mmcboot; " \
                "fi; " \
        "fi"
index 6d7aa7bcbb959e006062bcf915f175f16413a93c..6fb0253888838c1e22e6c1826023073f58861abf 100644 (file)
  */
 
 #define CONFIG_BOOTDELAY       3
+#define CONFIG_ENV_VARS_UBOOT_CONFIG
+#define CONFIG_CMD_FS_GENERIC
+#define CONFIG_CMD_EXT2
+#define CONFIG_CMD_EXT4
 
 #define CONFIG_ENV_OVERWRITE
 
        "loadaddr=0x82000000\0" \
        "console=ttyO2,115200n8\0" \
        "fdt_high=0xffffffff\0" \
+       "fdtaddr=0x80f80000\0" \
+       "bootpart=0:2\0" \
+       "bootdir=/boot\0" \
+       "bootfile=uImage\0" \
        "usbtty=cdc_acm\0" \
        "vram=16M\0" \
        "mmcdev=0\0" \
        "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
        "importbootenv=echo Importing environment from mmc${mmcdev} ...; " \
                "env import -t ${loadaddr} ${filesize}\0" \
-       "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
+       "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
        "mmcboot=echo Booting from mmc${mmcdev} ...; " \
                "run mmcargs; " \
-               "bootm ${loadaddr}\0" \
+               "bootm ${loadaddr} - ${fdtaddr}\0" \
+       "findfdt="\
+               "if test $board_name = omap5_uevm; then " \
+                       "setenv fdtfile omap5-uevm.dtb; fi;\0 " \
+       "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0" \
 
 #define CONFIG_BOOTCOMMAND \
+       "run findfdt; " \
        "mmc dev ${mmcdev}; if mmc rescan; then " \
                "if run loadbootscript; then " \
                        "run bootscript; " \
                                "run uenvcmd;" \
                        "fi;" \
                "fi;" \
-               "if run loaduimage; then " \
+               "if run loadimage; then " \
+                       "run loadfdt; " \
                        "run mmcboot; " \
                "fi; " \
        "fi"