]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
keystone2: env: add env script for booting with an initramfs with firmware
authorMurali Karicheri <m-karicheri2@ti.com>
Wed, 9 Mar 2016 10:09:38 +0000 (15:39 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 16 Mar 2016 01:30:18 +0000 (21:30 -0400)
This patch updates the env script to include a initramfs with firmware
loaded and provided to kernel through second argument of bootz command
during boot. Defined DEFAULT_FW_INITRAMFS_BOOT_ENV to have all of the
required env variables and use it in evm specific config file.

The K2 linux drivers for PCIe and NetCP (1G, 10G) requires serdes
firmwares. These requires firmware to be available early through the boot
process in some cases to satisfy firmware requests from driver. Hence use
a small initramfs to provide the same and update boot env to accommodate
this in the boot flow. This method is used when rootfs is nfs and ubifs.
This fs contains just lib/firmware folder with all required firmware.

When rootfs is on initramfs, then the filesystem has the firmware under
lib/firmware and this early initramfs is not required and is not used.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
include/configs/k2e_evm.h
include/configs/k2g_evm.h
include/configs/k2hk_evm.h
include/configs/k2l_evm.h
include/configs/ti_armv7_keystone2.h

index e053a54d4169b8404a85890cd48d3734c43c3614..daf37f63f4ece8bd233c83072fa0945242d39425 100644 (file)
@@ -16,6 +16,7 @@
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
+       DEFAULT_FW_INITRAMFS_BOOT_ENV                                   \
        "addr_mon=0x0c140000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0"       \
index 2c70df1f435b7e004383295475d4c60cf1aa49e5..2e477635c50abb1b475210ae6570e84f874490e0 100644 (file)
@@ -21,6 +21,7 @@
        "console=ttyS0,115200n8\0"                                      \
        "bootpart=0:2\0"                                                \
        "bootdir=/boot\0"                                               \
+       "rd_spec=-\0"                                                   \
        "addr_mon=0x0c040000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0"       \
@@ -34,6 +35,7 @@
        "get_kern_mmc=load mmc ${bootpart} ${loadaddr} "                \
                "${bootdir}/${name_kern}\0"                             \
        "get_mon_mmc=load mmc ${bootpart} ${addr_mon} ${bootdir}/${name_mon}\0"\
+       "name_fs=arago-base-tisdk-image-k2g-evm.cpio\0"
 
 #define CONFIG_BOOTCOMMAND                                             \
        "run envboot; "                                                 \
index 3cd2a85a2d1140ac566646621fe08a2b07e6206b..a031ae40af63c600c34b86a49f1631e9de4d1ad0 100644 (file)
@@ -16,6 +16,7 @@
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
+       DEFAULT_FW_INITRAMFS_BOOT_ENV                                   \
        "addr_mon=0x0c5f0000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0"       \
index 9bacfa49c430b3f3550e4a27f33770a19b005add..829daa28c295bc463f8f20a346d0d5e38b4f9f7b 100644 (file)
@@ -16,6 +16,7 @@
 
 /* U-Boot general configuration */
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS                            \
+       DEFAULT_FW_INITRAMFS_BOOT_ENV                                   \
        "addr_mon=0x0c140000\0"                                         \
        "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "        \
        "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,4096\0"       \
index 2ad2f1c73e84e763a48fabcf0c4bd5ac08db5f15..7131601cccd016c5002b460d43fd1c478e26d6ab 100644 (file)
 /* EDMA3 */
 #define CONFIG_TI_EDMA3
 
+#define DEFAULT_FW_INITRAMFS_BOOT_ENV                                  \
+       "name_fw_rd=k2-fw-initrd.cpio.gz\0"                             \
+       "set_rd_spec=setenv rd_spec ${rdaddr}:${filesize}\0"            \
+       "init_fw_rd_net=dhcp ${rdaddr} ${tftp_root}/${name_fw_rd}; "    \
+               "run set_rd_spec\0"                                     \
+       "init_fw_rd_ramfs=setenv rd_spec -\0"                           \
+       "init_fw_rd_ubi=ubifsload ${rdaddr} ${bootdir}/${name_fw_rd}; " \
+               "run set_rd_spec\0"                                     \
+
 #define DEFAULT_PMMC_BOOT_ENV                                          \
        "set_name_pmmc=setenv name_pmmc ti-sci-firmware-${soc_variant}.bin\0" \
        "dev_pmmc=0\0"                                                  \
        "addr_secdb_key=0xc000000\0"                                    \
        "name_kern=zImage\0"                                            \
        "run_mon=mon_install ${addr_mon}\0"                             \
-       "run_kern=bootz ${loadaddr} - ${fdtaddr}\0"                     \
+       "run_kern=bootz ${loadaddr} ${rd_spec} ${fdtaddr}\0"            \
        "init_net=run args_all args_net\0"                              \
        "init_ubi=run args_all args_ubi; "                              \
                "ubi part ubifs; ubifsmount ubi:rootfs;\0"                      \
 
 #ifndef CONFIG_BOOTCOMMAND
 #define CONFIG_BOOTCOMMAND                                             \
-       "run init_${boot} get_fdt_${boot} get_mon_${boot} "             \
-               "get_kern_${boot} run_mon run_kern"
+       "run init_${boot} init_fw_rd_${boot} get_fdt_${boot} "          \
+               "get_mon_${boot} get_kern_${boot} run_mon run_kern"
 #endif
 
 #define CONFIG_BOOTARGS                                                        \