]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ti_armv7_common: env: Add support for loading FIT images
authorLokesh Vutla <lokeshvutla@ti.com>
Tue, 29 Nov 2016 06:28:00 +0000 (11:58 +0530)
committerTom Rini <trini@konsulko.com>
Sat, 3 Dec 2016 18:21:08 +0000 (13:21 -0500)
FIT is a new image format which is a Tree like structure and gives more
flexibility in handling of various images. Mainly used for unification of
multiple images in a single blob and provide security information for each
image.

U-Boot already has support for loading such images, so adding the environment
support to load FIT image on all TI platforms.

Reviewed-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
include/configs/am335x_evm.h
include/configs/am43xx_evm.h
include/configs/ti_armv7_common.h
include/configs/ti_omap4_common.h
include/configs/ti_omap5_common.h

index 98827a107b6ee97f24cb3259020722038cea5393..22caed9901d98f5b7440c0f6a95f9538c17ed7bb 100644 (file)
@@ -91,6 +91,9 @@
        func(DHCP, dhcp, na)
 
 #define CONFIG_BOOTCOMMAND \
+       "if test ${boot_fit} -eq 1; then "      \
+               "run update_to_fit;"    \
+       "fi;"   \
        "run findfdt; " \
        "run init_console; " \
        "run envboot; " \
 #define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
        DEFAULT_MMC_TI_ARGS \
+       DEFAULT_FIT_TI_ARGS \
        "bootpart=0:2\0" \
        "bootdir=/boot\0" \
        "bootfile=zImage\0" \
index 07d30197f637c5e28747d05053a21f74ba58e5ad..b47acb27383ce2dfee7c666ffc928127905083a0 100644 (file)
 #define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
        DEFAULT_MMC_TI_ARGS \
+       DEFAULT_FIT_TI_ARGS \
        "fdtfile=undefined\0" \
        "bootpart=0:2\0" \
        "bootdir=/boot\0" \
        DFUARGS \
 
 #define CONFIG_BOOTCOMMAND \
+       "if test ${boot_fit} -eq 1; then "      \
+               "run update_to_fit;"    \
+       "fi;"   \
        "run findfdt; " \
        "run envboot;" \
        "run mmcboot;" \
index a60a32e3605490e251c56ec6babbf759f40698c5..ae2cf460b12b3005ff31e56ff89b93cb26bc6773 100644 (file)
                "if mmc rescan; then " \
                        "echo SD/MMC found on device ${mmcdev};" \
                        "if run loadimage; then " \
-                               "run mmcloados;" \
+                               "if test ${boot_fit} -eq 1; then " \
+                                       "run loadfit; " \
+                               "else " \
+                                       "run mmcloados;" \
+                               "fi;" \
                        "fi;" \
                "fi;\0" \
 
+#define DEFAULT_FIT_TI_ARGS \
+       "boot_fit=0\0" \
+       "fit_loadaddr=0x88000000\0" \
+       "fit_bootfile=fitImage.itb\0" \
+       "update_to_fit=setenv loadaddr ${fit_loadaddr}; setenv bootfile ${fit_bootfile}\0" \
+       "args_fit=setenv bootargs console=${console} \0" \
+       "loadfit=run args_fit; bootm ${loadaddr}:kernel@1 " \
+               "${loadaddr}:ramdisk@1 ${loadaddr}:${fdtfile};\0" \
+
 /*
  * DDR information.  If the CONFIG_NR_DRAM_BANKS is not defined,
  * we say (for simplicity) that we have 1 bank, always, even when
index ce9d3e88835f4feedecfc473cd30570ff27dc6a2..8e0f9eb964d972682ee697a09ef052361f055a4d 100644 (file)
@@ -98,6 +98,9 @@
        func(DHCP, dhcp, na)
 
 #define CONFIG_BOOTCOMMAND \
+       "if test ${boot_fit} -eq 1; then "      \
+               "run update_to_fit;"    \
+       "fi;"   \
        "run findfdt; " \
        "run envboot; " \
        "run distro_bootcmd"
 #define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
        DEFAULT_MMC_TI_ARGS \
+       DEFAULT_FIT_TI_ARGS \
        "console=ttyO2,115200n8\0" \
        "fdtfile=undefined\0" \
        "bootpart=0:2\0" \
index d2f61c804ae5a979d10401a83d49bbaf8f70cb73..f617f7d8d1e29ebf259edbbf3b16d1963266a38e 100644 (file)
@@ -65,6 +65,7 @@
 #define CONFIG_EXTRA_ENV_SETTINGS \
        DEFAULT_LINUX_BOOT_ENV \
        DEFAULT_MMC_TI_ARGS \
+       DEFAULT_FIT_TI_ARGS \
        "console=" CONSOLEDEV ",115200n8\0" \
        "fdtfile=undefined\0" \
        "bootpart=0:2\0" \
                "echo Booting into fastboot ...; " \
                "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
        "fi;" \
+       "if test ${boot_fit} -eq 1; then "      \
+               "run update_to_fit;"    \
+       "fi;"   \
        "run findfdt; " \
        "run envboot; " \
        "run mmcboot;" \