aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2019-10-15 18:24:41 +0530
committerTom Rini <trini@konsulko.com>2019-10-23 20:47:12 -0400
commit13b6770c0513eb80596c862b0c513101b5449934 (patch)
tree0bbb82b4bfbebce80a3c85bdfbae16d51ff1824a
parenta539c8bd7dffa144bdc4826d5858a515f626856f (diff)
downloadu-boot-13b6770c0513eb80596c862b0c513101b5449934.zip
u-boot-13b6770c0513eb80596c862b0c513101b5449934.tar.gz
u-boot-13b6770c0513eb80596c862b0c513101b5449934.tar.bz2
env: ti: Add environment variables to boot from UFS
Add environment variables to boot kernel from a filesystem contained in the 2nd UFS LUN. The user can boot from a ufs filesystem just by entering the following commands. => setenv boot ufs => boot Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
-rw-r--r--include/configs/j721e_evm.h4
-rw-r--r--include/environment/ti/ufs.h33
2 files changed, 36 insertions, 1 deletions
diff --git a/include/configs/j721e_evm.h b/include/configs/j721e_evm.h
index dbe226b..73547b5 100644
--- a/include/configs/j721e_evm.h
+++ b/include/configs/j721e_evm.h
@@ -13,6 +13,7 @@
#include <config_distro_bootcmd.h>
#include <environment/ti/mmc.h>
#include <environment/ti/k3_rproc.h>
+#include <environment/ti/ufs.h>
#define CONFIG_ENV_SIZE (128 << 10)
@@ -103,7 +104,8 @@
DEFAULT_MMC_TI_ARGS \
EXTRA_ENV_J721E_BOARD_SETTINGS \
EXTRA_ENV_J721E_BOARD_SETTINGS_MMC \
- EXTRA_ENV_RPROC_SETTINGS
+ EXTRA_ENV_RPROC_SETTINGS \
+ DEFAULT_UFS_TI_ARGS
/* Now for the remaining common defines */
#include <configs/ti_armv7_common.h>
diff --git a/include/environment/ti/ufs.h b/include/environment/ti/ufs.h
new file mode 100644
index 0000000..d457e20
--- /dev/null
+++ b/include/environment/ti/ufs.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Environment variable definitions for UFS on TI boards.
+ */
+
+#ifndef __TI_UFS_H
+#define __TI_UFS_H
+
+#define DEFAULT_UFS_TI_ARGS \
+ "scsirootfstype=ext4 rootwait\0" \
+ "ufs_finduuid=part uuid scsi ${bootpart} uuid\0" \
+ "args_ufs=setenv devtype scsi;setenv bootpart 1:1;" \
+ "run ufs_finduuid;setenv bootargs console = ${console} " \
+ "${optargs}" \
+ "root=PARTUUID=${uuid} rw " \
+ "rootfstype=${scsirootfstype};" \
+ "setenv devtype scsi;" \
+ "setenv bootpart 1:1\0" \
+ "init_ufs=ufs init; scsi scan; run args_ufs\0" \
+ "get_kern_ufs=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${name_kern}\0" \
+ "get_fdt_ufs=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
+ "get_overlay_ufs=" \
+ "fdt address ${fdtaddr};" \
+ "fdt resize 0x100000;" \
+ "for overlay in $name_overlays;" \
+ "do;" \
+ "load scsi ${bootpart} ${overlayaddr} ${bootdir}/${overlay} && " \
+ "fdt apply ${overlayaddr};" \
+ "done;\0"
+
+#endif