summaryrefslogtreecommitdiff
path: root/libre/uboot-beaglebone-linux-libre-grsec/0001-parabola-arm-modifications.patch
blob: ca64e86310105e66694e036ea85a89d7c853f290 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index 968d041..3406926 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -1,7 +1,6 @@
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_ADDR=0x82000000
-CONFIG_SYS_EXTRA_OPTIONS="NAND"
-CONFIG_CONS_INDEX=1
+CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1"
 CONFIG_ARM=y
 CONFIG_TARGET_AM335X_EVM=y
diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index a87059c..e68e848 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -17,6 +17,7 @@
 #define __CONFIG_AM335X_EVM_H
 
 #include <configs/ti_am335x_common.h>
+#define CONFIG_ENV_IS_NOWHERE
 
 #ifndef CONFIG_SPL_BUILD
 #ifndef CONFIG_FIT
@@ -45,6 +46,9 @@
 /* Enhance our eMMC support / experience. */
 #define CONFIG_CMD_GPT
 #define CONFIG_EFI_PARTITION
+#define CONFIG_CMD_PART
+#define CONFIG_PARTITION_UUIDS
+#define CONFIG_CMD_SETEXPR
 
 #ifdef CONFIG_NAND
 #define NANDARGS \
@@ -70,110 +74,79 @@
 #ifndef CONFIG_SPL_BUILD
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	DEFAULT_LINUX_BOOT_ENV \
-	"boot_fdt=try\0" \
-	"bootpart=0:2\0" \
+	"bootpart=0:1\0" \
 	"bootdir=/boot\0" \
-	"bootfile=zImage\0" \
+	"fdtdir=/boot/dtbs/linux-libre-grsec\0" \
+	"bootfile=vmlinuz-linux-libre-grsec\0" \
 	"fdtfile=undefined\0" \
+	"rdfile=initramfs-linux-libre-grsec.img\0" \
 	"console=ttyO0,115200n8\0" \
 	"partitions=" \
 		"uuid_disk=${uuid_gpt_disk};" \
 		"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
 	"optargs=\0" \
-	"mmcdev=0\0" \
-	"mmcroot=/dev/mmcblk0p2 ro\0" \
-	"mmcrootfstype=ext4 rootwait\0" \
-	"rootpath=/export/rootfs\0" \
-	"nfsopts=nolock\0" \
-	"static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
-		"::off\0" \
-	"ramroot=/dev/ram0 rw\0" \
-	"ramrootfstype=ext2\0" \
+	"cape_disable=\0" \
+	"cape_enable=\0" \
+	"cmdline=\0" \
 	"mmcargs=setenv bootargs console=${console} " \
 		"${optargs} " \
-		"root=${mmcroot} " \
-		"rootfstype=${mmcrootfstype}\0" \
-	"spiroot=/dev/mtdblock4 rw\0" \
-	"spirootfstype=jffs2\0" \
-	"spisrcaddr=0xe0000\0" \
-	"spiimgsize=0x362000\0" \
-	"spibusno=0\0" \
-	"spiargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=${spiroot} " \
-		"rootfstype=${spirootfstype}\0" \
-	"netargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=/dev/nfs " \
-		"nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
-		"ip=dhcp\0" \
-	"bootenv=uEnv.txt\0" \
-	"loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr\0" \
-	"bootscript=echo Running bootscript from mmc${mmcdev} ...; " \
-		"source ${loadaddr}\0" \
-	"loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
-	"importbootenv=echo Importing environment from mmc ...; " \
-		"env import -t -r $loadaddr $filesize\0" \
-	"ramargs=setenv bootargs console=${console} " \
-		"${optargs} " \
-		"root=${ramroot} " \
-		"rootfstype=${ramrootfstype}\0" \
-	"loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
-	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
-	"loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
-	"mmcloados=run mmcargs; " \
-		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
-			"if run loadfdt; then " \
-				"bootz ${loadaddr} - ${fdtaddr}; " \
-			"else " \
-				"if test ${boot_fdt} = try; then " \
-					"bootz; " \
-				"else " \
-					"echo WARN: Cannot load the DT; " \
-				"fi; " \
-			"fi; " \
-		"else " \
-			"bootz; " \
-		"fi;\0" \
-	"mmcboot=mmc dev ${mmcdev}; " \
-		"if mmc rescan; then " \
-			"echo SD/MMC found on device ${mmcdev};" \
-			"if run loadbootscript; then " \
-				"run bootscript;" \
-			"else " \
-				"if run loadbootenv; then " \
-					"echo Loaded environment from ${bootenv};" \
-					"run importbootenv;" \
+		"${cape_disable} " \
+		"${cape_enable} " \
+		"root=${root} " \
+		"${cmdline}\0" \
+	"loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
+	"loadrd=load ${devtype} ${bootpart} ${rdaddr} ${bootdir}/${rdfile}\0" \
+	"loadfdt=echo loading ${fdtdir}/${fdtfile} ...; load ${devtype} ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
+	"mmcboot=usb start;" \
+		"for devtype in mmc usb; do " \
+			"for devnum in 0 1; do " \
+				"if ${devtype} dev ${devnum}; then " \
+					"echo ${devtype} found on device ${devnum};" \
+					"setenv bootpart ${devnum}:1;" \
+					"part uuid ${devtype} ${bootpart} uuid;" \
+					"setenv root PARTUUID=${uuid} rw rootwait fixrtc;" \
+					"echo Checking for: ${bootdir}/uboot-beaglebone-linux-libre-grsec/uEnv.txt ...;" \
+					"gpio set 54;" \
+					"if test -e ${devtype} ${bootpart} ${bootdir}/uboot-beaglebone-linux-libre-grsec/uEnv.txt; then " \
+						"load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/uboot-beaglebone-linux-libre-grsec/uEnv.txt;" \
+						"env import -t ${loadaddr} ${filesize};" \
+						"echo Loaded environment from ${bootdir}/uboot-beaglebone-linux-libre-grsec/uEnv.txt;" \
+						"if test -n ${cape}; then " \
+							"if test -e ${devtype} ${bootpart} ${fdtdir}/${fdtbase}-${cape}.dtb; then " \
+								"setenv fdtfile ${fdtbase}-${cape}.dtb; " \
+							"fi; " \
+							"echo using: $fdtfile...; " \
+						"fi; " \
+						"echo Checking if uenvcmd is set ...;" \
+						"if test -n ${uenvcmd}; then " \
+							"echo Running uenvcmd ...;" \
+							"run uenvcmd;" \
+						"fi;" \
+					"fi;" \
+					"gpio set 55;" \
+					"if run loadimage; then " \
+						"run mmcargs;" \
+						"if run loadfdt; then " \
+							"gpio set 56;" \
+							"if run loadrd; then " \
+								"bootz ${loadaddr} ${rdaddr}:${filesize} ${fdtaddr};" \
+							"else " \
+								"bootz ${loadaddr} - ${fdtaddr};" \
+							"fi;" \
+						"fi;" \
+					"else " \
+						"echo No kernel found;" \
+					"fi;" \
+					"gpio clear 54; gpio clear 55;" \
+					"setexpr devnum ${devnum} + 1;" \
 				"fi;" \
-				"if test -n $uenvcmd; then " \
-					"echo Running uenvcmd ...;" \
-					"run uenvcmd;" \
-				"fi;" \
-				"if run loadimage; then " \
-					"run mmcloados;" \
-				"fi;" \
-			"fi ;" \
-		"fi;\0" \
-	"spiboot=echo Booting from spi ...; " \
-		"run spiargs; " \
-		"sf probe ${spibusno}:0; " \
-		"sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
-		"bootz ${loadaddr}\0" \
-	"netboot=echo Booting from network ...; " \
-		"setenv autoload no; " \
-		"dhcp; " \
-		"tftp ${loadaddr} ${bootfile}; " \
-		"tftp ${fdtaddr} ${fdtfile}; " \
-		"run netargs; " \
-		"bootz ${loadaddr} - ${fdtaddr}\0" \
-	"ramboot=echo Booting from ramdisk ...; " \
-		"run ramargs; " \
-		"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
+			"done;" \
+		"done;\0" \
 	"findfdt="\
 		"if test $board_name = A335BONE; then " \
-			"setenv fdtfile am335x-bone.dtb; fi; " \
+			"setenv fdtfile am335x-bone.dtb; setenv fdtbase am335x-bone; fi; " \
 		"if test $board_name = A335BNLT; then " \
-			"setenv fdtfile am335x-boneblack.dtb; fi; " \
+			"setenv fdtfile am335x-boneblack.dtb; setenv fdtbase am335x-boneblack; setenv umsmedia 1; fi; " \
 		"if test $board_name = A33515BB; then " \
 			"setenv fdtfile am335x-evm.dtb; fi; " \
 		"if test $board_name = A335X_SK; then " \
@@ -185,12 +158,11 @@
 #endif
 
 #define CONFIG_BOOTCOMMAND \
-	"run findfdt; " \
-	"run mmcboot;" \
-	"setenv mmcdev 1; " \
-	"setenv bootpart 1:2; " \
+	"gpio set 53;" \
+	"run findfdt;" \
 	"run mmcboot;" \
-	"run nandboot;"
+	"gpio clear 54; gpio clear 55;" \
+	"gpio set 56"
 
 /* NS16550 Configuration */
 #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* Base EVM has UART0 */
@@ -329,9 +301,8 @@
 #endif
 
 #ifdef CONFIG_MUSB_GADGET
-#define CONFIG_USB_ETHER
-#define CONFIG_USB_ETH_RNDIS
-#define CONFIG_USBNET_HOST_ADDR	"de:ad:be:af:00:00"
+#define CONFIG_CMD_USB_MASS_STORAGE
+#define CONFIG_USB_GADGET_MASS_STORAGE
 
 /* USB TI's IDs */
 #define CONFIG_G_DNL_VENDOR_NUM 0x0451
-- 
2.4.2