Explorar el Código

Use U-Boot instead of mxs-bootlets

Thomas Buck hace 8 años
padre
commit
7e22e52cfd

+ 4
- 0
board/olinuxino/post-build.sh Ver fichero

@@ -0,0 +1,4 @@
1
+#!/bin/sh
2
+
3
+cp $BINARIES_DIR/zImage.imx23-olinuxino $TARGET_DIR/boot/vmlinuz-olinuxino
4
+

+ 2
- 0
board/olinuxino/rootfs-overlay/boot/uEnv.txt Ver fichero

@@ -0,0 +1,2 @@
1
+uname_r=olinuxino
2
+

+ 177
- 0
board/olinuxino/u-boot/0001-mx23_olinuxino-uEnv.txt-bootz-n-fixes.patch Ver fichero

@@ -0,0 +1,177 @@
1
+From a4a4cfc588c889873e5a31e097287abc7255e53f Mon Sep 17 00:00:00 2001
2
+From: Robert Nelson <robertcnelson@gmail.com>
3
+Date: Wed, 3 Jun 2015 14:48:45 -0500
4
+Subject: [PATCH] mx23_olinuxino: uEnv.txt, bootz, n fixes
5
+
6
+Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
7
+---
8
+ include/configs/mx23_olinuxino.h | 120 +++++++++++++++++++++++++++++++++------
9
+ 1 file changed, 104 insertions(+), 16 deletions(-)
10
+
11
+diff --git a/include/configs/mx23_olinuxino.h b/include/configs/mx23_olinuxino.h
12
+index 65203a0..1827e2b 100644
13
+--- a/include/configs/mx23_olinuxino.h
14
++++ b/include/configs/mx23_olinuxino.h
15
+@@ -25,6 +25,14 @@
16
+ #define CONFIG_CMD_MMC
17
+ #define CONFIG_CMD_USB
18
+ 
19
++#define CONFIG_CMD_FAT
20
++#define CONFIG_CMD_EXT4
21
++#define CONFIG_CMD_FS_GENERIC
22
++
23
++/* bootz: zImage/initrd.img support */
24
++#define CONFIG_CMD_BOOTZ
25
++#define CONFIG_SUPPORT_RAW_INITRD
26
++
27
+ /* Memory configuration */
28
+ #define CONFIG_NR_DRAM_BANKS		1		/* 1 bank of DRAM */
29
+ #define PHYS_SDRAM_1			0x40000000	/* Base address */
30
+@@ -65,7 +73,7 @@
31
+ #endif
32
+ 
33
+ /* Booting Linux */
34
+-#define CONFIG_BOOTDELAY	3
35
++#define CONFIG_BOOTDELAY	1
36
+ #define CONFIG_BOOTFILE		"uImage"
37
+ #define CONFIG_LOADADDR		0x42000000
38
+ #define CONFIG_SYS_LOAD_ADDR	CONFIG_LOADADDR
39
+@@ -86,20 +94,58 @@
40
+ 	"console=ttyAMA0\0" \
41
+ 	"fdt_file=imx23-olinuxino.dtb\0" \
42
+ 	"fdt_addr=0x41000000\0" \
43
++	"fdtdir=\0" \
44
++	"bootfile=\0" \
45
++	"bootdir=\0" \
46
+ 	"boot_fdt=try\0" \
47
+ 	"ip_dyn=yes\0" \
48
++	"optargs=\0" \
49
++	"cmdline=\0" \
50
+ 	"mmcdev=0\0" \
51
+ 	"mmcpart=2\0" \
52
+-	"mmcroot=/dev/mmcblk0p3 rw rootwait\0" \
53
++	"mmcroot=/dev/mmcblk0p2 ro\0" \
54
++	"mmcrootfstype=ext4 rootwait fixrtc\0" \
55
+ 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
56
+-		"root=${mmcroot}\0" \
57
++		"${optargs} " \
58
++		"root=${mmcroot} " \
59
++		"rootfstype=${mmcrootfstype} " \
60
++		"${cmdline}\0" \
61
++	"loadbootenv=load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt\0" \
62
++	"importbootenv=echo Importing environment from mmc (uEnv.txt)...; " \
63
++		"env import -t ${loadaddr} ${filesize}\0" \
64
+ 	"loadbootscript="  \
65
+ 		"fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
66
+ 	"bootscript=echo Running bootscript from mmc ...; "	\
67
+ 		"source\0" \
68
+-	"loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
69
+-	"loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
70
+-	"mmcboot=echo Booting from mmc ...; " \
71
++	"loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
72
++	"loadfdt=echo loading ${fdtdir}/${fdt_file} ...;  load mmc ${bootpart} ${fdt_addr} ${fdtdir}/${fdt_file}\0" \
73
++	"mmcboot=mmc dev ${mmcdev}; " \
74
++		"if mmc rescan; then " \
75
++			"echo SD/MMC found on device ${mmcdev};" \
76
++			"echo Checking for: /boot/uEnv.txt ...;" \
77
++			"for i in 2 3 4 5 6 7 ; do " \
78
++				"setenv mmcpart ${i};" \
79
++				"setenv bootpart ${mmcdev}:${mmcpart};" \
80
++				"if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
81
++					"load mmc ${bootpart} ${loadaddr} /boot/uEnv.txt;" \
82
++					"env import -t ${loadaddr} ${filesize};" \
83
++					"echo Loaded environment from /boot/uEnv.txt;" \
84
++					"if test -n ${dtb}; then " \
85
++						"setenv fdt_file ${dtb};" \
86
++						"echo using ${fdt_file} ...;" \
87
++					"fi;" \
88
++					"echo Checking if uname_r is set in /boot/uEnv.txt...;" \
89
++					"if test -n ${uname_r}; then " \
90
++						"setenv mmcroot /dev/mmcblk${mmcdev}p${mmcpart} ro;" \
91
++						"if test -n ${uuid}; then " \
92
++							"setenv mmcroot UUID=${uuid} ro;" \
93
++						"fi;" \
94
++						"run uname_boot;" \
95
++					"fi;" \
96
++				"fi;" \
97
++			"done;" \
98
++		"fi;\0" \
99
++	"mmcboot_old=echo Booting from mmc ...; " \
100
+ 		"run mmcargs; " \
101
+ 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
102
+ 			"if run loadfdt; then " \
103
+@@ -138,19 +184,61 @@
104
+ 			"fi; " \
105
+ 		"else " \
106
+ 			"bootm; " \
107
++		"fi;\0" \
108
++	"uname_boot="\
109
++		"setenv bootdir /boot; " \
110
++		"setenv bootfile vmlinuz-${uname_r}; " \
111
++		"if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
112
++			"echo loading ${bootdir}/${bootfile} ...; "\
113
++			"run loadimage;" \
114
++			"setenv fdtdir /boot/dtbs/${uname_r}; " \
115
++			"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
116
++				"run loadfdt;" \
117
++			"else " \
118
++				"setenv fdtdir /usr/lib/linux-image-${uname_r}; " \
119
++				"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
120
++					"run loadfdt;" \
121
++				"else " \
122
++					"setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
123
++					"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
124
++						"run loadfdt;" \
125
++					"else " \
126
++						"setenv fdtdir /boot/dtb-${uname_r}; " \
127
++						"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
128
++							"run loadfdt;" \
129
++						"else " \
130
++							"setenv fdtdir /boot/dtbs; " \
131
++							"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
132
++								"run loadfdt;" \
133
++							"else " \
134
++								"setenv fdtdir /boot/dtb; " \
135
++								"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
136
++									"run loadfdt;" \
137
++								"else " \
138
++									"setenv fdtdir /boot; " \
139
++									"if test -e mmc ${bootpart} ${fdtdir}/${fdt_file}; then " \
140
++										"run loadfdt;" \
141
++									"else " \
142
++										"echo; echo unable to find ${fdt_file} ...; echo booting legacy ...;"\
143
++										"run mmcargs;" \
144
++										"echo debug: [${bootargs}] ... ;" \
145
++										"echo debug: [bootz ${loadaddr}] ... ;" \
146
++										"bootz ${loadaddr}; " \
147
++									"fi;" \
148
++								"fi;" \
149
++							"fi;" \
150
++						"fi;" \
151
++					"fi;" \
152
++				"fi;" \
153
++			"fi; " \
154
++			"run mmcargs;" \
155
++			"echo debug: [${bootargs}] ... ;" \
156
++			"echo debug: [bootz ${loadaddr} - ${fdt_addr}] ... ;" \
157
++			"bootz ${loadaddr} - ${fdt_addr}; " \
158
+ 		"fi;\0"
159
+ 
160
+ #define CONFIG_BOOTCOMMAND \
161
+-	"mmc dev ${mmcdev}; if mmc rescan; then " \
162
+-		"if run loadbootscript; then " \
163
+-			"run bootscript; " \
164
+-		"else " \
165
+-			"if run loaduimage; then " \
166
+-				"run mmcboot; " \
167
+-			"else run netboot; " \
168
+-			"fi; " \
169
+-		"fi; " \
170
+-	"else run netboot; fi"
171
++	"run mmcboot;"
172
+ 
173
+ /* The rest of the configuration is shared */
174
+ #include <configs/mxs.h>
175
+-- 
176
+2.1.4
177
+

+ 7
- 3
configs/olinuxino_defconfig Ver fichero

@@ -8,6 +8,8 @@ BR2_TARGET_GENERIC_ISSUE="Welcome to the CamCorder"
8 8
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
9 9
 BR2_TARGET_GENERIC_ROOT_PASSWD="camcorder"
10 10
 BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
11
+BR2_ROOTFS_OVERLAY="$(BR2_EXTERNAL)/board/olinuxino/rootfs-overlay"
12
+BR2_ROOTFS_POST_BUILD_SCRIPT="$(BR2_EXTERNAL)/board/olinuxino/post-build.sh"
11 13
 BR2_LINUX_KERNEL=y
12 14
 BR2_LINUX_KERNEL_CUSTOM_VERSION=y
13 15
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="3.18.2"
@@ -18,6 +20,8 @@ BR2_LINUX_KERNEL_INTREE_DTS_NAME="imx23-olinuxino"
18 20
 BR2_PACKAGE_FFMPEG=y
19 21
 BR2_TARGET_ROOTFS_EXT2=y
20 22
 # BR2_TARGET_ROOTFS_TAR is not set
21
-BR2_TARGET_MXS_BOOTLETS=y
22
-BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD=y
23
-BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME="imx23_olinuxino_dev"
23
+BR2_TARGET_UBOOT=y
24
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
25
+BR2_TARGET_UBOOT_PATCH="$(BR2_EXTERNAL)/board/olinuxino/u-boot"
26
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="mx23_olinuxino"
27
+BR2_TARGET_UBOOT_FORMAT_SD=y

+ 9
- 2
flash.sh Ver fichero

@@ -31,8 +31,15 @@ p
31 31
 w
32 32
 EOF
33 33
 
34
-echo Writing bootstream
35
-sudo dd if=output/images/imx23_olinuxino_dev_linux.sb bs=512 of="$1"1 seek=4
34
+if [ -e output/images/imx23_olinuxino_dev_linux.sb ] ; then
35
+	echo Writing mxs-bootlet bootstream
36
+	sudo dd if=output/images/imx23_olinuxino_dev_linux.sb bs=512 of="$1"1 seek=4
37
+elif [ -e output/images/u-boot.sd ] ; then
38
+	echo Writing U-Boot bootstream
39
+	sudo dd if=output/images/u-boot.sd of="$1"1
40
+else
41
+	echo Could not find a suitable bootstream!
42
+fi
36 43
 
37 44
 echo Writing root filesystem
38 45
 sudo dd if=output/images/rootfs.ext2 of="$1"2 bs=512

Loading…
Cancelar
Guardar