Support for other A20 boards

This commit is contained in:
Bob Mottram 2015-12-01 16:59:50 +00:00
parent 6fd4d2b084
commit d19c44ac89
4 changed files with 57 additions and 14 deletions

Binary file not shown.

View File

@ -133,21 +133,21 @@ beaglebone_repack_kernel() {
-d $initRd uInitrd )
}
cubieboard2_setup_boot() {
a20_setup_boot() {
dtb="$1"
# Setup boot.cmd
if grep -q btrfs /etc/fstab ; then
fstype=btrfs
fstype=btrfs
else
fstype=ext4
fstype=ext4
fi
kernelVersion=$(ls /usr/lib/*/sun7i-a20-cubieboard2.dtb | head -1 | cut -d/ -f4)
kernelVersion=$(ls /usr/lib/*/$dtb | head -1 | cut -d/ -f4)
version=$(echo $kernelVersion | sed 's/linux-image-\(.*\)/\1/')
initRd=initrd.img-$version
vmlinuz=vmlinuz-$version
# boot.cmd for Cubieboard2
# Parameters based on:
# https://github.com/infidel/cubiebuild/blob/eb6fcf98cd91ea12a216448debc4cda70723d7b3/load-image/.pyboot
# Create boot.cmd
cat >> /boot/boot.cmd <<EOF
setenv mmcdev 0
setenv mmcpart 1
@ -160,10 +160,11 @@ setenv console ttyS0,115200n8
setenv kernel_file $vmlinuz
setenv initrd_file $initRd
setenv fdtfile $dtb
setenv loadaddr 0x41000000
setenv initrd_addr 0x43000000
setenv fdtaddr 0x42000000
setenv loadaddr 0x46000000
setenv initrd_addr 0x48000000
setenv fdtaddr 0x47000000
setenv initrd_high 0xffffffff
setenv fdt_high 0xffffffff
@ -178,10 +179,10 @@ setenv mmcargs setenv bootargs console=\${console} root=\${mmcroot} rootfstype=\
run loadfiles; run mmcargs; bootz \${loadaddr} \${initrd_addr}:\${initrd_size} \${fdtaddr}
EOF
# boot.scr for Cubieboard2
# boot.scr for Allwinner A20 based device
mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
# DTBs for Cubieboard2
# Copy all DTBs
mkdir -p /boot/dtbs
cp /usr/lib/$kernelVersion/* /boot/dtbs
@ -196,8 +197,20 @@ case "$MACHINE" in
beaglebone_repack_kernel
enable_serial_console ttyO0
;;
cubietruck)
a20_setup_boot sun7i-a20-cubietruck.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-lime2)
a20_setup_boot sun7i-a20-olinuxino-lime2.dtb
enable_serial_console ttyS0
;;
a20-olinuxino-micro)
a20_setup_boot sun7i-a20-olinuxino-micro.dtb
enable_serial_console ttyS0
;;
cubieboard2)
cubieboard2_setup_boot
a20_setup_boot sun7i-a20-cubieboard2.dtb
enable_serial_console ttyS0
;;
esac

View File

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

View File

@ -97,6 +97,36 @@ cubieboard2: prep
$(SIGN)
@echo "Build complete."
# build CubieTruck SD card image
cubietruck: prep
$(eval ARCHITECTURE = armhf)
$(eval MACHINE = cubietruck)
$(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE)
@echo ""
$(SIGN)
@echo "Build complete."
# build A20 OLinuXino Lime2 SD card image
a20-olinuxino-lime2: prep
$(eval ARCHITECTURE = armhf)
$(eval MACHINE = a20-olinuxino-lime2)
$(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE)
@echo ""
$(SIGN)
@echo "Build complete."
# build A20 OLinuXino MIRCO SD card image
a20-olinuxino-micro: prep
$(eval ARCHITECTURE = armhf)
$(eval MACHINE = a20-olinuxino-micro)
$(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE)
@echo ""
$(SIGN)
@echo "Build complete."
# build an i386 image
i386: prep
$(eval ARCHITECTURE = i386)