summaryrefslogtreecommitdiffstats
path: root/recipes-bsp/u-boot/u-boot/0044-Beagleboard-Adjust-boot.patch
blob: 19b4ab79698cda4271ea3a38e8d232726f45db8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
From c8d52ff17d71be0c632f20092d96e9530088c786 Mon Sep 17 00:00:00 2001
From: Jason Kridner <jkridner@beagleboard.org>
Date: Wed, 21 Jul 2010 08:47:59 -0500
Subject: [PATCH] BeagleBoard: Adjust boot command on USER button

When the USER button is pressed, the default boot command will attempt
to load user.scr.  If that fails, it will try to load a ramdisk image.

This version also sets the rootfstype and assumes that the userbutton
command returns success (0) when the button is pressed.  It also really
attempts to load the user.scr file.
---
 include/configs/omap3_beagle.h |   51 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index f372de2..6d1166f 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -195,9 +195,12 @@
 #define CONFIG_BOOTDELAY		3
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
-	"loadaddr=0x82000000\0" \
+	"loadaddr=0x80200000\0" \
+	"rdaddr=0x81600000\0" \
 	"usbtty=cdc_acm\0" \
 	"console=ttyS2,115200n8\0" \
+	"optargs=\0" \
+	"bootscr=boot.scr\0" \
 	"mpurate=500\0" \
 	"buddy=none\0" \
 	"vram=12M\0" \
@@ -208,7 +211,10 @@
 	"mmcrootfstype=ext3 rootwait\0" \
 	"nandroot=/dev/mtdblock4 rw\0" \
 	"nandrootfstype=jffs2\0" \
+	"ramroot=/dev/ram0 rw\0" \
+	"ramrootfstype=ext2\0" \
 	"mmcargs=setenv bootargs console=${console} " \
+		"${optargs} " \
 		"mpurate=${mpurate} " \
 		"buddy=${buddy} "\
 		"vram=${vram} " \
@@ -217,6 +223,7 @@
 		"root=${mmcroot} " \
 		"rootfstype=${mmcrootfstype}\0" \
 	"nandargs=setenv bootargs console=${console} " \
+		"${optargs} " \
 		"mpurate=${mpurate} " \
 		"buddy=${buddy} "\
 		"vram=${vram} " \
@@ -224,7 +231,18 @@
 		"omapdss.def_disp=${defaultdisplay} " \
 		"root=${nandroot} " \
 		"rootfstype=${nandrootfstype}\0" \
-	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr\0" \
+	"loadbootscript=fatload mmc ${mmcdev} ${loadaddr} ${bootscr}\0" \
+	"ramargs=setenv bootargs console=${console} " \
+		"${optargs} " \
+		"mpurate=${mpurate} " \
+		"buddy=${buddy} "\
+		"vram=${vram} " \
+		"omapfb.mode=dvi:${dvimode} " \
+		"omapdss.def_disp=${defaultdisplay} " \
+		"root=${ramroot} rw ramdisk_size=65536 " \
+		"initrd=${rdaddr},64M " \
+		"rootfstype=${ramrootfstype}\0" \
+	"loadramdisk=fatload mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
 	"bootscript=echo Running bootscript from mmc ...; " \
 		"source ${loadaddr}\0" \
 	"loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage\0" \
@@ -235,15 +253,34 @@
 		"run nandargs; " \
 		"nand read ${loadaddr} 280000 400000; " \
 		"bootm ${loadaddr}\0" \
+	"ramboot=echo Booting from ramdisk ...; " \
+		"run ramargs; " \
+		"bootm ${loadaddr}\0" \
 
 #define CONFIG_BOOTCOMMAND \
 	"if mmc init ${mmcdev}; then " \
-		"if run loadbootscript; then " \
-			"run bootscript; " \
+		"if userbutton; then " \
+			"setenv bootscr user.scr;" \
+			"if run loadbootscript; then " \
+				"run bootscript; " \
+			"else " \
+				"if run loaduimage; then " \
+					"if run loadramdisk; then " \
+						"run ramboot; " \
+					"else " \
+						"run mmcboot; " \
+					"fi; " \
+				"fi; " \
+			"fi; " \
 		"else " \
-			"if run loaduimage; then " \
-				"run mmcboot; " \
-			"else run nandboot; " \
+			"setenv bootscr boot.scr; " \
+			"if run loadbootscript; then " \
+				"run bootscript; " \
+			"else " \
+				"if run loaduimage; then " \
+					"run mmcboot; " \
+				"else run nandboot; " \
+				"fi; " \
 			"fi; " \
 		"fi; " \
 	"else run nandboot; fi"
-- 
1.6.1