Browse Source

Support for other A20 boards

Bob Mottram 9 years ago
parent
commit
d19c44ac89

BIN
man/freedombone-image.1.gz View File


+ 26
- 13
src/freedombone-image-hardware-setup View File

@@ -133,21 +133,21 @@ beaglebone_repack_kernel() {
133 133
     -d $initRd uInitrd )
134 134
 }
135 135
 
136
-cubieboard2_setup_boot() {
136
+a20_setup_boot() {
137
+    dtb="$1"
138
+
137 139
     # Setup boot.cmd
138 140
     if grep -q btrfs /etc/fstab ; then
139
-        fstype=btrfs
141
+    fstype=btrfs
140 142
     else
141
-        fstype=ext4
143
+    fstype=ext4
142 144
     fi
143
-    kernelVersion=$(ls /usr/lib/*/sun7i-a20-cubieboard2.dtb | head -1 | cut -d/ -f4)
145
+    kernelVersion=$(ls /usr/lib/*/$dtb | head -1 | cut -d/ -f4)
144 146
     version=$(echo $kernelVersion | sed 's/linux-image-\(.*\)/\1/')
145 147
     initRd=initrd.img-$version
146 148
     vmlinuz=vmlinuz-$version
147 149
 
148
-    # boot.cmd for Cubieboard2
149
-    # Parameters based on:
150
-	# https://github.com/infidel/cubiebuild/blob/eb6fcf98cd91ea12a216448debc4cda70723d7b3/load-image/.pyboot
150
+    # Create boot.cmd
151 151
     cat >> /boot/boot.cmd <<EOF
152 152
 setenv mmcdev 0
153 153
 setenv mmcpart 1
@@ -160,10 +160,11 @@ setenv console ttyS0,115200n8
160 160
 
161 161
 setenv kernel_file $vmlinuz
162 162
 setenv initrd_file $initRd
163
+setenv fdtfile $dtb
163 164
 
164
-setenv loadaddr 0x41000000
165
-setenv initrd_addr 0x43000000
166
-setenv fdtaddr 0x42000000
165
+setenv loadaddr 0x46000000
166
+setenv initrd_addr 0x48000000
167
+setenv fdtaddr 0x47000000
167 168
 
168 169
 setenv initrd_high 0xffffffff
169 170
 setenv fdt_high 0xffffffff
@@ -178,10 +179,10 @@ setenv mmcargs setenv bootargs console=\${console} root=\${mmcroot} rootfstype=\
178 179
 run loadfiles; run mmcargs; bootz \${loadaddr} \${initrd_addr}:\${initrd_size} \${fdtaddr}
179 180
 EOF
180 181
 
181
-    # boot.scr for Cubieboard2
182
+    # boot.scr for Allwinner A20 based device
182 183
     mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
183 184
 
184
-    # DTBs for Cubieboard2
185
+    # Copy all DTBs
185 186
     mkdir -p /boot/dtbs
186 187
     cp /usr/lib/$kernelVersion/* /boot/dtbs
187 188
 
@@ -196,8 +197,20 @@ case "$MACHINE" in
196 197
     beaglebone_repack_kernel
197 198
     enable_serial_console ttyO0
198 199
     ;;
200
+    cubietruck)
201
+    a20_setup_boot sun7i-a20-cubietruck.dtb
202
+    enable_serial_console ttyS0
203
+    ;;
204
+    a20-olinuxino-lime2)
205
+    a20_setup_boot sun7i-a20-olinuxino-lime2.dtb
206
+    enable_serial_console ttyS0
207
+    ;;
208
+    a20-olinuxino-micro)
209
+    a20_setup_boot sun7i-a20-olinuxino-micro.dtb
210
+    enable_serial_console ttyS0
211
+    ;;
199 212
     cubieboard2)
200
-    cubieboard2_setup_boot
213
+    a20_setup_boot sun7i-a20-cubieboard2.dtb
201 214
     enable_serial_console ttyS0
202 215
     ;;
203 216
 esac

+ 1
- 1
src/freedombone-image-make View File

@@ -93,7 +93,7 @@ case "$MACHINE" in
93 93
  --roottype btrfs \
94 94
 "
95 95
     ;;
96
-    cubieboard2)
96
+    cubietruck | a20-olinuxino-lime2 | a20-olinuxino-micro | cubieboard2)
97 97
        extra_pkgs="$a20_pkgs"
98 98
        extra_opts="\
99 99
  --variant minbase \

+ 30
- 0
src/freedombone-image-makefile View File

@@ -97,6 +97,36 @@ cubieboard2: prep
97 97
 	$(SIGN)
98 98
 	@echo "Build complete."
99 99
 
100
+# build CubieTruck SD card image
101
+cubietruck: prep
102
+	$(eval ARCHITECTURE = armhf)
103
+	$(eval MACHINE = cubietruck)
104
+	$(MAKE_IMAGE)
105
+	$(TAR) $(ARCHIVE) $(IMAGE)
106
+	@echo ""
107
+	$(SIGN)
108
+	@echo "Build complete."
109
+
110
+# build A20 OLinuXino Lime2 SD card image
111
+a20-olinuxino-lime2: prep
112
+	$(eval ARCHITECTURE = armhf)
113
+	$(eval MACHINE = a20-olinuxino-lime2)
114
+	$(MAKE_IMAGE)
115
+	$(TAR) $(ARCHIVE) $(IMAGE)
116
+	@echo ""
117
+	$(SIGN)
118
+	@echo "Build complete."
119
+
120
+# build A20 OLinuXino MIRCO SD card image
121
+a20-olinuxino-micro: prep
122
+	$(eval ARCHITECTURE = armhf)
123
+	$(eval MACHINE = a20-olinuxino-micro)
124
+	$(MAKE_IMAGE)
125
+	$(TAR) $(ARCHIVE) $(IMAGE)
126
+	@echo ""
127
+	$(SIGN)
128
+	@echo "Build complete."
129
+
100 130
 # build an i386 image
101 131
 i386: prep
102 132
 	$(eval ARCHITECTURE = i386)