[glsdk/meta-ti-glsdk.git] / recipes-bsp / u-boot / u-boot / 0003-omap3_beagle-enable-the-use-of-a-plain-text-file-nam.patch
1 From 58ca6009d4101e5fd45ef9df22aa360d1662e9e9 Mon Sep 17 00:00:00 2001
2 From: Alexander Holler <holler@ahsoftware.de>
3 Date: Mon, 24 Jan 2011 13:08:49 +0000
4 Subject: [PATCH 03/16] omap3_beagle: enable the use of a plain text file named uEnv.txt instead of boot.scr
6 Using the new env import command it is possible to use plain text files instead
7 of script-images. Plain text files are much easier to handle.
9 E.g. If your boot.scr contains the following:
10 -----------------------------------
11 setenv dvimode 1024x768-16@60
12 run loaduimage
13 run mmcboot
14 -----------------------------------
15 you could create a file named uEnv.txt and use that instead of boot.scr:
16 -----------------------------------
17 dvimode=1024x768-16@60
18 uenvcmd=run loaduimage; run mmcboot
19 -----------------------------------
20 The variable uenvcmd (if existent) will be executed (using run) after uEnv.txt
21 was loaded. If uenvcmd doesn't exist the default boot sequence will be started,
22 therefore you could just use
23 -----------------------------------
24 dvimode=1024x768-16@60
25 -----------------------------------
26 as uEnv.txt because loaduimage and mmcboot is part of the default boot sequence.
27 ---
28 Changes for v2:
29 - Eliminated else redundant clause that would be ignored if boot
30 succeeds.
32 Changes for v3:
33 - Removed boot.scr
35 Changes for v4:
36 - Removed comment about boot.scr being supported.
37 ---
38 include/configs/omap3_beagle.h | 28 ++++++++++++++++------------
39 1 files changed, 16 insertions(+), 12 deletions(-)
41 diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
42 index 8b580ef..c85537c 100644
43 --- a/include/configs/omap3_beagle.h
44 +++ b/include/configs/omap3_beagle.h
45 @@ -213,9 +213,9 @@
46 "omapdss.def_disp=${defaultdisplay} " \
47 "root=${nandroot} " \
48 "rootfstype=${nandrootfstype}\0" \
49 - "loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
50 - "bootscript=echo Running bootscript from mmc ...; " \
51 - "source ${loadaddr}\0" \
52 + "loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
53 + "importbootenv=echo Importing environment from mmc ...; " \
54 + "env import -t $loadaddr $filesize\0" \
55 "loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
56 "mmcboot=echo Booting from mmc ...; " \
57 "run mmcargs; " \
58 @@ -227,15 +227,19 @@
60 #define CONFIG_BOOTCOMMAND \
61 "if mmc rescan ${mmcdev}; then " \
62 - "if run loadbootscript; then " \
63 - "run bootscript; " \
64 - "else " \
65 - "if run loaduimage; then " \
66 - "run mmcboot; " \
67 - "else run nandboot; " \
68 - "fi; " \
69 - "fi; " \
70 - "else run nandboot; fi"
71 + "echo SD/MMC found on device ${mmcdev};" \
72 + "if run loadbootenv; then " \
73 + "run importbootenv;" \
74 + "fi;" \
75 + "if test -n $uenvcmd; then " \
76 + "echo Running uenvcmd ...;" \
77 + "run uenvcmd;" \
78 + "fi;" \
79 + "if run loaduimage; then " \
80 + "run mmcboot;" \
81 + "fi;" \
82 + "fi;" \
83 + "run nandboot;" \
85 #define CONFIG_AUTO_COMPLETE 1
86 /*
87 --
88 1.6.6.1