* [U-Boot] [PATCH v1 18/18] board: pic32mzdask: Customize default environments for OS boot.
@ 2015-12-17 17:34 Purna Chandra Mandal
0 siblings, 0 replies; only message in thread
From: Purna Chandra Mandal @ 2015-12-17 17:34 UTC (permalink / raw)
To: u-boot
Add custom environment variables and commands to help boot
from micro-SD card and/or from network (TFTP protocol).
Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
---
include/configs/pic32mzdask.h | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/include/configs/pic32mzdask.h b/include/configs/pic32mzdask.h
index 94e73e3..c903113 100644
--- a/include/configs/pic32mzdask.h
+++ b/include/configs/pic32mzdask.h
@@ -169,5 +169,48 @@
#define CONFIG_BOOTDELAY 5 /* autoboot after X seconds */
#undef CONFIG_BOOTARGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+ "loadaddr="__stringify(CONFIG_SYS_LOAD_ADDR)"\0" \
+ "uenvfile=uEnv.txt\0" \
+ "uenvaddr="__stringify(CONFIG_SYS_ENV_ADDR)"\0" \
+ "scriptfile=boot.scr\0" \
+ "ubootfile=u-boot.bin\0" \
+ "importbootenv= " \
+ "env import -t -r ${uenvaddr} ${filesize};\0" \
+ \
+ "tftploadenv=tftp ${uenvaddr} ${uenvfile} \0" \
+ "tftploadscr=tftp ${uenvaddr} ${scriptfile} \0" \
+ "tftploadub=tftp ${loadaddr} ${ubootfile} \0" \
+ \
+ "mmcloadenv=fatload mmc 0 ${uenvaddr} ${uenvfile}\0" \
+ "mmcloadscr=fatload mmc 0 ${uenvaddr} ${scriptfile}\0" \
+ "mmcloadub=fatload mmc 0 ${loadaddr} ${ubootfile}\0" \
+ \
+ "flashub=protect off bank 1; " \
+ "erase.b 0x9d004000 0x9d0f3fff; " \
+ "cp.b ${loadaddr} 0x9d004000 ${filesize}; " \
+ "cmp.b ${loadaddr} 0x9d004000 ${filesize}; " \
+ "protect on bank 1; \0" \
+ \
+ "loadbootenv=run mmcloadenv || run tftploadenv\0" \
+ "loadbootscr=run mmcloadscr || run tftploadscr\0" \
+ "bootcmd_root= " \
+ "if run loadbootenv; then " \
+ "echo Loaded environment ${uenvfile}; " \
+ "run importbootenv; " \
+ "fi; " \
+ "if test -n \"${bootcmd_uenv}\" ; then " \
+ "echo Running bootcmd_uenv ...; " \
+ "run bootcmd_uenv; " \
+ "fi; " \
+ "if run loadbootscr; then " \
+ "echo Jumping to ${scriptfile}; " \
+ "source ${uenvaddr}; " \
+ "fi; " \
+ "echo Custom environment or script not found. " \
+ "Aborting auto booting...; \0" \
+ ""
+
+#define CONFIG_BOOTCOMMAND "run bootcmd_root"
#define CONFIG_MEMSIZE_IN_BYTES /* pass 'memsize=' in bytes */
#endif /* __PIC32MZDASK_CONFIG_H */
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-17 17:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-17 17:34 [U-Boot] [PATCH v1 18/18] board: pic32mzdask: Customize default environments for OS boot Purna Chandra Mandal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.