diff mbox

[U-Boot,v3] omap3_beagle: enable the use of a plain text file named uEnv.txt instead of boot.scr

Message ID 1299097582-12206-1-git-send-email-jkridner@beagleboard.org
State Accepted
Commit cf073e49bc3502be1b48a0e3faf0cde9edbb89db
Delegated to: Sandeep Paulraj
Headers show

Commit Message

Jason Kridner March 2, 2011, 8:26 p.m. UTC
From: Alexander Holler <holler@ahsoftware.de>

Using the new env import command it is possible to use plain text files instead
of script-images. Plain text files are much easier to handle.

E.g. If your boot.scr contains the following:
-----------------------------------
setenv dvimode 1024x768-16@60
run loaduimage
run mmcboot
-----------------------------------
you could create a file named uEnv.txt and use that instead of boot.scr:
-----------------------------------
dvimode=1024x768-16@60
uenvcmd=run loaduimage; run mmcboot
-----------------------------------
The variable uenvcmd (if existent) will be executed (using run) after uEnv.txt
was loaded. If uenvcmd doesn't exist the default boot sequence will be started,
therefore you could just use
-----------------------------------
dvimode=1024x768-16@60
-----------------------------------
as uEnv.txt because loaduimage and mmcboot is part of the default boot sequence.

For backwards compatibility the use of boot.scr is still supported.
---
Changes for v2:
  - Eliminated else redundant clause that would be ignored if boot
    succeeds.

Changes for v3:
  - Removed boot.scr per discussion with Alexander.

Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
---
 include/configs/omap3_beagle.h |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

Comments

Alexander Holler March 2, 2011, 11:41 p.m. UTC | #1
Hello Jason,

Am 02.03.2011 21:26, schrieb Jason Kridner:
> For backwards compatibility the use of boot.scr is still supported.
>    

Sorry, but I think that line in the description should get removed too.

Regards,

Alexander
Robert Nelson March 2, 2011, 11:48 p.m. UTC | #2
On Wed, Mar 2, 2011 at 5:41 PM, Alexander Holler <holler@ahsoftware.de> wrote:
> Hello Jason,
>
> Am 02.03.2011 21:26, schrieb Jason Kridner:
>>
>> For backwards compatibility the use of boot.scr is still supported.
>>
>
> Sorry, but I think that line in the description should get removed too.
>

So, just a thought..  Are you guys planning to push this same boot
method to all the other "omap" devices that just finally got boot.scr
boot support by default in u-boot?  It also seems's like it'll end up
be the FAQ of the month for the beagleboard group.. ;)

Regards,
Jason Kridner March 3, 2011, 3:04 p.m. UTC | #3
On Wed, Mar 2, 2011 at 6:48 PM, Robert Nelson <robertcnelson@gmail.com> wrote:
> On Wed, Mar 2, 2011 at 5:41 PM, Alexander Holler <holler@ahsoftware.de> wrote:
>> Hello Jason,
>>
>> Am 02.03.2011 21:26, schrieb Jason Kridner:
>>>
>>> For backwards compatibility the use of boot.scr is still supported.
>>>
>>
>> Sorry, but I think that line in the description should get removed too.

I'll submit a v4.

>>
>
> So, just a thought..  Are you guys planning to push this same boot
> method to all the other "omap" devices that just finally got boot.scr
> boot support by default in u-boot?  It also seems's like it'll end up
> be the FAQ of the month for the beagleboard group.. ;)

Indeed it is likely to be FAQ of the month, especially if it lands in
the next software update that gets shipped with the board.  It is a
case, however, in which I like the answer--no more need to run
mkimage.  The conversion process of a boot.scr script (commands) to a
uEnv.txt file (variable setting) won't be exactly trivial, so that has
me a tiny bit concerned.  Still, most cases will be solved by a *much*
simpler uEnv.txt script and an overall simpler process.

I still see a need to use the USER button to go into some sort of
fall-back state to ignore this file and boot some sort of recovery
image.  Since that code isn't upstream yet, there is still going to be
some delta between upstream and what ships on the board--unless I can
somehow figure out an easy way to get a command added for the generic
gpio framework.

>
> Regards,
>
> --
> Robert Nelson
> http://www.rcn-ee.com/
>
Alexander Holler March 4, 2011, 1:30 a.m. UTC | #4
Hello,

Am 03.03.2011 16:04, schrieb Jason Kridner:
> On Wed, Mar 2, 2011 at 6:48 PM, Robert Nelson<robertcnelson@gmail.com>  wrote:
>> On Wed, Mar 2, 2011 at 5:41 PM, Alexander Holler<holler@ahsoftware.de>  wrote:
>>> Hello Jason,
>>>
>>> Am 02.03.2011 21:26, schrieb Jason Kridner:
>>>>
>>>> For backwards compatibility the use of boot.scr is still supported.
>>>>
>>>
>>> Sorry, but I think that line in the description should get removed too.
>
> I'll submit a v4.
>
>>>
>>
>> So, just a thought..  Are you guys planning to push this same boot
>> method to all the other "omap" devices that just finally got boot.scr
>> boot support by default in u-boot?  It also seems's like it'll end up
>> be the FAQ of the month for the beagleboard group.. ;)
>
> Indeed it is likely to be FAQ of the month, especially if it lands in
> the next software update that gets shipped with the board.  It is a
> case, however, in which I like the answer--no more need to run
> mkimage.  The conversion process of a boot.scr script (commands) to a
> uEnv.txt file (variable setting) won't be exactly trivial, so that has
> me a tiny bit concerned.  Still, most cases will be solved by a *much*
> simpler uEnv.txt script and an overall simpler process.

Hmm, if someone will write such an FAQ-entry, be sure to mention that 
people shouldn't use a windows-editor. I haven't tried it, but I don't 
believe env import likes carriage returns.

Regards,

Alexander
Alexander Holler March 4, 2011, 1:43 a.m. UTC | #5
Am 03.03.2011 00:48, schrieb Robert Nelson:
> On Wed, Mar 2, 2011 at 5:41 PM, Alexander Holler<holler@ahsoftware.de>  wrote:
>> Hello Jason,
>>
>> Am 02.03.2011 21:26, schrieb Jason Kridner:
>>>
>>> For backwards compatibility the use of boot.scr is still supported.
>>>
>>
>> Sorry, but I think that line in the description should get removed too.
>>
>
> So, just a thought..  Are you guys planning to push this same boot
> method to all the other "omap" devices that just finally got boot.scr
> boot support by default in u-boot?  It also seems's like it'll end up
> be the FAQ of the month for the beagleboard group.. ;)

I would say that should be decided by every board-maintainer, just like 
the change from ttyS2 to ttyO2. E.g. I don't think the devkit8000-sdk 
will change as soon as the stuff the for the beagleboard.

Regards,

Alexander
Robert Nelson March 4, 2011, 1:51 a.m. UTC | #6
On Thu, Mar 3, 2011 at 7:43 PM, Alexander Holler <holler@ahsoftware.de> wrote:
> Am 03.03.2011 00:48, schrieb Robert Nelson:
>>
>> On Wed, Mar 2, 2011 at 5:41 PM, Alexander Holler<holler@ahsoftware.de>
>>  wrote:
>>>
>>> Hello Jason,
>>>
>>> Am 02.03.2011 21:26, schrieb Jason Kridner:
>>>>
>>>> For backwards compatibility the use of boot.scr is still supported.
>>>>
>>>
>>> Sorry, but I think that line in the description should get removed too.
>>>
>>
>> So, just a thought..  Are you guys planning to push this same boot
>> method to all the other "omap" devices that just finally got boot.scr
>> boot support by default in u-boot?  It also seems's like it'll end up
>> be the FAQ of the month for the beagleboard group.. ;)
>
> I would say that should be decided by every board-maintainer, just like the
> change from ttyS2 to ttyO2. E.g. I don't think the devkit8000-sdk will
> change as soon as the stuff the for the beagleboard.

Oh, we will work around it over the transition, so it's not a big deal..

It was just kinda nice, (if we assume all boards have xlo/u-boot in
nand) that most boards would boot on one boot.scr/kernel/rootfs
combination.  Since the mainline kernel can boot on all omap2/3/4
boards (in mainline) at this point..

But since both the xM/Panda don't have nand, my point's kinda moot as
they'll need a different xlo/u-boot...

Regards,
Sandeep Paulraj April 18, 2011, 9:35 p.m. UTC | #7
> From: Alexander Holler <holler@ahsoftware.de>
> 
> Using the new env import command it is possible to use plain text files
> instead
> of script-images. Plain text files are much easier to handle.
> 
> E.g. If your boot.scr contains the following:
> -----------------------------------
> setenv dvimode 1024x768-16@60
> run loaduimage
> run mmcboot
> -----------------------------------
> you could create a file named uEnv.txt and use that instead of boot.scr:
> -----------------------------------
> dvimode=1024x768-16@60
> uenvcmd=run loaduimage; run mmcboot
> -----------------------------------
> The variable uenvcmd (if existent) will be executed (using run) after
> uEnv.txt
> was loaded. If uenvcmd doesn't exist the default boot sequence will be
> started,
> therefore you could just use
> -----------------------------------
> dvimode=1024x768-16@60
> -----------------------------------
> as uEnv.txt because loaduimage and mmcboot is part of the default boot
> sequence.
> 
> For backwards compatibility the use of boot.scr is still supported.
> ---
> Changes for v2:
>   - Eliminated else redundant clause that would be ignored if boot
>     succeeds.
> 
> Changes for v3:
>   - Removed boot.scr per discussion with Alexander.
> 
> Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
> ---

Pushed to u-boot-ti after making changes to the patch header
Wolfgang Denk April 18, 2011, 11:01 p.m. UTC | #8
Dear "Paulraj, Sandeep",

In message <0554BEF07D437848AF01B9C9B5F0BC5DC365D49D@dlee01.ent.ti.com> you wrote:
> 
> > From: Alexander Holler <holler@ahsoftware.de>
> > 
> > Using the new env import command it is possible to use plain text files
> > instead
> > of script-images. Plain text files are much easier to handle.
> > 
> > E.g. If your boot.scr contains the following:
> > -----------------------------------
> > setenv dvimode 1024x768-16@60
> > run loaduimage
> > run mmcboot
> > -----------------------------------
> > you could create a file named uEnv.txt and use that instead of boot.scr:
> > -----------------------------------
> > dvimode=1024x768-16@60
> > uenvcmd=run loaduimage; run mmcboot
> > -----------------------------------
> > The variable uenvcmd (if existent) will be executed (using run) after
> > uEnv.txt
> > was loaded. If uenvcmd doesn't exist the default boot sequence will be
> > started,
> > therefore you could just use
> > -----------------------------------
> > dvimode=1024x768-16@60
> > -----------------------------------
> > as uEnv.txt because loaduimage and mmcboot is part of the default boot
> > sequence.
> > 
> > For backwards compatibility the use of boot.scr is still supported.
> > ---
> > Changes for v2:
> >   - Eliminated else redundant clause that would be ignored if boot
> >     succeeds.
> > 
> > Changes for v3:
> >   - Removed boot.scr per discussion with Alexander.
> > 
> > Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
> > ---
> 
> Pushed to u-boot-ti after making changes to the patch header

I think you might have missed Jason Kridner's Signed-off-by ?

Best regards,

Wolfgang Denk
Sandeep Paulraj April 18, 2011, 11:32 p.m. UTC | #9
> 
> Dear "Paulraj, Sandeep",
> 
> In message <0554BEF07D437848AF01B9C9B5F0BC5DC365D49D@dlee01.ent.ti.com>
> you wrote:
> >
> > > From: Alexander Holler <holler@ahsoftware.de>
> > >
> > > Using the new env import command it is possible to use plain text
> files
> > > instead
> > > of script-images. Plain text files are much easier to handle.
> > >
> > > E.g. If your boot.scr contains the following:
> > > -----------------------------------
> > > setenv dvimode 1024x768-16@60
> > > run loaduimage
> > > run mmcboot
> > > -----------------------------------
> > > you could create a file named uEnv.txt and use that instead of
> boot.scr:
> > > -----------------------------------
> > > dvimode=1024x768-16@60
> > > uenvcmd=run loaduimage; run mmcboot
> > > -----------------------------------
> > > The variable uenvcmd (if existent) will be executed (using run) after
> > > uEnv.txt
> > > was loaded. If uenvcmd doesn't exist the default boot sequence will be
> > > started,
> > > therefore you could just use
> > > -----------------------------------
> > > dvimode=1024x768-16@60
> > > -----------------------------------
> > > as uEnv.txt because loaduimage and mmcboot is part of the default boot
> > > sequence.
> > >
> > > For backwards compatibility the use of boot.scr is still supported.
> > > ---
> > > Changes for v2:
> > >   - Eliminated else redundant clause that would be ignored if boot
> > >     succeeds.
> > >
> > > Changes for v3:
> > >   - Removed boot.scr per discussion with Alexander.
> > >
> > > Signed-off-by: Jason Kridner <jkridner@beagleboard.org>
> > > ---
> >
> > Pushed to u-boot-ti after making changes to the patch header
> 
> I think you might have missed Jason Kridner's Signed-off-by ?
> 
> Best regards,
> 
> Wolfgang Denk

Thanks,

I have fixed this.

I had to edit the patch headers of quite a few patches and missed this one.

Regards,
Sandeep
diff mbox

Patch

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 8b580ef..c85537c 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -213,9 +213,9 @@ 
 		"omapdss.def_disp=${defaultdisplay} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-	"bootscript=echo Running bootscript from mmc ...; " \
-		"source ${loadaddr}\0" \
+	"loadbootenv=fatload mmc ${mmcdev} ${loadaddr} uEnv.txt\0" \
+	"importbootenv=echo Importing environment from mmc ...; " \
+		"env import -t $loadaddr $filesize\0" \
 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
 	"mmcboot=echo Booting from mmc ...; " \
 		"run mmcargs; " \
@@ -227,15 +227,19 @@ 
 
 #define CONFIG_BOOTCOMMAND \
 	"if mmc rescan ${mmcdev}; then " \
-		"if run loadbootscript; then " \
-			"run bootscript; " \
-		"else " \
-			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"else run nandboot; " \
-			"fi; " \
-		"fi; " \
-	"else run nandboot; fi"
+		"echo SD/MMC found on device ${mmcdev};" \
+		"if run loadbootenv; then " \
+			"run importbootenv;" \
+		"fi;" \
+		"if test -n $uenvcmd; then " \
+			"echo Running uenvcmd ...;" \
+			"run uenvcmd;" \
+		"fi;" \
+		"if run loaduimage; then " \
+			"run mmcboot;" \
+		"fi;" \
+	"fi;" \
+	"run nandboot;" \
 
 #define CONFIG_AUTO_COMPLETE		1
 /*