Commit abca947746063e53e3aeadd5b809b4a7be913acf

Authored by Murali Karicheri
Committed by Tom Rini
1 parent 84fe28382c

keystone2: env: add env script for booting with an initramfs with firmware

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>

Showing 5 changed files with 17 additions and 3 deletions Side-by-side Diff

include/configs/k2e_evm.h
... ... @@ -16,6 +16,7 @@
16 16  
17 17 /* U-Boot general configuration */
18 18 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS \
  19 + DEFAULT_FW_INITRAMFS_BOOT_ENV \
19 20 "addr_mon=0x0c140000\0" \
20 21 "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs " \
21 22 "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0" \
include/configs/k2g_evm.h
... ... @@ -21,6 +21,7 @@
21 21 "console=ttyS0,115200n8\0" \
22 22 "bootpart=0:2\0" \
23 23 "bootdir=/boot\0" \
  24 + "rd_spec=-\0" \
24 25 "addr_mon=0x0c040000\0" \
25 26 "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs " \
26 27 "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0" \
... ... @@ -34,6 +35,7 @@
34 35 "get_kern_mmc=load mmc ${bootpart} ${loadaddr} " \
35 36 "${bootdir}/${name_kern}\0" \
36 37 "get_mon_mmc=load mmc ${bootpart} ${addr_mon} ${bootdir}/${name_mon}\0"\
  38 + "name_fs=arago-base-tisdk-image-k2g-evm.cpio\0"
37 39  
38 40 #define CONFIG_BOOTCOMMAND \
39 41 "run envboot; " \
include/configs/k2hk_evm.h
... ... @@ -16,6 +16,7 @@
16 16  
17 17 /* U-Boot general configuration */
18 18 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS \
  19 + DEFAULT_FW_INITRAMFS_BOOT_ENV \
19 20 "addr_mon=0x0c5f0000\0" \
20 21 "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs " \
21 22 "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,2048\0" \
include/configs/k2l_evm.h
... ... @@ -16,6 +16,7 @@
16 16  
17 17 /* U-Boot general configuration */
18 18 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS \
  19 + DEFAULT_FW_INITRAMFS_BOOT_ENV \
19 20 "addr_mon=0x0c140000\0" \
20 21 "args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs " \
21 22 "root=ubi0:rootfs rootflags=sync rw ubi.mtd=ubifs,4096\0" \
include/configs/ti_armv7_keystone2.h
... ... @@ -224,6 +224,15 @@
224 224 /* EDMA3 */
225 225 #define CONFIG_TI_EDMA3
226 226  
  227 +#define DEFAULT_FW_INITRAMFS_BOOT_ENV \
  228 + "name_fw_rd=k2-fw-initrd.cpio.gz\0" \
  229 + "set_rd_spec=setenv rd_spec ${rdaddr}:${filesize}\0" \
  230 + "init_fw_rd_net=dhcp ${rdaddr} ${tftp_root}/${name_fw_rd}; " \
  231 + "run set_rd_spec\0" \
  232 + "init_fw_rd_ramfs=setenv rd_spec -\0" \
  233 + "init_fw_rd_ubi=ubifsload ${rdaddr} ${bootdir}/${name_fw_rd}; " \
  234 + "run set_rd_spec\0" \
  235 +
227 236 #define DEFAULT_PMMC_BOOT_ENV \
228 237 "set_name_pmmc=setenv name_pmmc ti-sci-firmware-${soc_variant}.bin\0" \
229 238 "dev_pmmc=0\0" \
... ... @@ -249,7 +258,7 @@
249 258 "addr_secdb_key=0xc000000\0" \
250 259 "name_kern=zImage\0" \
251 260 "run_mon=mon_install ${addr_mon}\0" \
252   - "run_kern=bootz ${loadaddr} - ${fdtaddr}\0" \
  261 + "run_kern=bootz ${loadaddr} ${rd_spec} ${fdtaddr}\0" \
253 262 "init_net=run args_all args_net\0" \
254 263 "init_ubi=run args_all args_ubi; " \
255 264 "ubi part ubifs; ubifsmount ubi:rootfs;\0" \
... ... @@ -286,8 +295,8 @@
286 295  
287 296 #ifndef CONFIG_BOOTCOMMAND
288 297 #define CONFIG_BOOTCOMMAND \
289   - "run init_${boot} get_fdt_${boot} get_mon_${boot} " \
290   - "get_kern_${boot} run_mon run_kern"
  298 + "run init_${boot} init_fw_rd_${boot} get_fdt_${boot} " \
  299 + "get_mon_${boot} get_kern_${boot} run_mon run_kern"
291 300 #endif
292 301  
293 302 #define CONFIG_BOOTARGS \