summaryrefslogtreecommitdiff
path: root/distrib/armv7
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2016-05-29 15:10:06 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2016-05-29 15:10:06 +0000
commitab5cf34d85587779f16e0ce299c713dc4144ea51 (patch)
tree6c6fe1bf3fbc5b18730f7dcf325135376efa4e22 /distrib/armv7
parent129cf1ad65db97b98b0e048128eb0a36f361333d (diff)
Decide which u-boot/dtb to use based on the fdt model printed when
attaching mainbus not the string we print based on the board id when attaching the soc platform abstraction. Overhaul md_installboot() to make it much more readable based on suggestions from rpe@
Diffstat (limited to 'distrib/armv7')
-rw-r--r--distrib/armv7/ramdisk/install.md74
1 files changed, 33 insertions, 41 deletions
diff --git a/distrib/armv7/ramdisk/install.md b/distrib/armv7/ramdisk/install.md
index c7e6588d006..343bd3a6445 100644
--- a/distrib/armv7/ramdisk/install.md
+++ b/distrib/armv7/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.34 2016/05/29 07:38:01 jsg Exp $
+# $OpenBSD: install.md,v 1.35 2016/05/29 15:10:05 jsg Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -40,51 +40,43 @@ MOUNT_ARGS_msdos="-o-l"
md_installboot() {
local _disk=$1
- local mount_args=${MOUNT_ARGS_msdos}
- BEAGLE=$(scan_dmesg '/^omap0 at mainbus0: TI OMAP3 \(BeagleBoard\).*/s//\1/p')
- BEAGLEBONE=$(scan_dmesg '/^omap0 at mainbus0: TI AM335x \(BeagleBone\).*/s//\1/p')
- PANDA=$(scan_dmesg '/^omap0 at mainbus0: TI OMAP4 \(PandaBoard\)/s//\1/p')
- CUBOX=$(scan_dmesg '/^imx0 at mainbus0: \(SolidRun.*\)/s//CUBOX/p')
- NITROGEN=$(scan_dmesg '/^imx0 at mainbus0: \(Freescale i.MX6 SABRE Lite.*\)/s//NITROGEN/p')
- WANDBOARD=$(scan_dmesg '/^imx0 at mainbus0: \(Wandboard i.MX6.*\)/s//WANDBOARD/p')
- CUBIE=$(scan_dmesg '/^mainbus0 at root: Cubietech \(Cubieboard\)/s//CUBIEBOARD/p')
-
- mount ${mount_args} /dev/${_disk}i /mnt/mnt
-
- # extracted on all machines, so make snap works.
+ # Identify ARMv7 platform based on dmesg.
+ case $(scan_dmesg 's/^mainbus0 at root: \(.*\)$/\1/p') in
+ *AM335x*) _plat=am335x;;
+ *"OMAP3 BeagleBoard"*) _plat=beagle;;
+ *OMAP4*) _plat=panda;;
+ *Cubieboard*) _plat=cubie;;
+ *Cubox-i*|*HummingBoard*) _plat=cubox;;
+ *Wandboard*) _plat=wandboard;;
+ *Nitrogen6*|*"SABRE Lite"*) _plat=nitrogen;;
+ *) ;; # XXX: Handle unknown platform?
+ esac
+
+ # Mount MSDOS partition, extract U-Boot and copy UEFI boot program
+ mount ${MOUNT_ARGS_msdos} /dev/${_disk}i /mnt/mnt
tar -C /mnt/ -xf /usr/mdec/u-boots.tgz
-
mkdir -p /mnt/mnt/efi/boot
cp /mnt/usr/mdec/BOOTARM.EFI /mnt/mnt/efi/boot/bootarm.efi
- if [[ -n $BEAGLE ]]; then
- cp /mnt/usr/mdec/beagle/{MLO,u-boot.img} /mnt/mnt/
- cp /mnt/usr/mdec/beagle/*.dtb /mnt/mnt/
- elif [[ -n $BEAGLEBONE ]]; then
- cp /mnt/usr/mdec/am335x/{MLO,u-boot.img} /mnt/mnt/
- cp /mnt/usr/mdec/am335x/*.dtb /mnt/mnt/
- elif [[ -n $PANDA ]]; then
- cp /mnt/usr/mdec/panda/{MLO,u-boot.img} /mnt/mnt/
- cp /mnt/usr/mdec/panda/*.dtb /mnt/mnt/
- elif [[ -n $CUBOX ]]; then
- cp /mnt/usr/mdec/cubox/*.dtb /mnt/mnt/
- dd if=/mnt/usr/mdec/cubox/SPL \
- of=/dev/${_disk}c bs=1024 seek=1 >/dev/null
- dd if=/mnt/usr/mdec/cubox/u-boot.img \
- of=/dev/${_disk}c bs=1024 seek=69 >/dev/null
- elif [[ -n $NITROGEN ]]; then
- cp /mnt/usr/mdec/nitrogen/*.dtb /mnt/mnt/
- elif [[ -n $WANDBOARD ]]; then
- cp /mnt/usr/mdec/wandboard/*.dtb /mnt/mnt/
- dd if=/mnt/usr/mdec/wandboard/SPL \
- of=/dev/${_disk}c bs=1024 seek=1 >/dev/null
- dd if=/mnt/usr/mdec/wandboard/u-boot.img \
- of=/dev/${_disk}c bs=1024 seek=69 >/dev/null
- elif [[ -n $CUBIE ]]; then
- cp /mnt/usr/mdec/cubie/u-boot-sunxi-with-spl.bin /mnt/mnt/
- cp /mnt/usr/mdec/cubie/*.dtb /mnt/mnt/
- fi
+ _mdec=/mnt/usr/mdec/$_plat
+
+ case $_plat in
+ am335x|beagle|panda)
+ cp $_mdec/{MLO,u-boot.img,*.dtb} /mnt/mnt/
+ ;;
+ cubox|wandboard)
+ cp $_mdec/*.dtb /mnt/mnt/
+ dd if=$_mdec/SPL of=${_disk}c bs=1024 seek=1 >/dev/null
+ dd if=$_mdec/u-boot.img of=${_disk}c bs=1024 seek=69 >/dev/null
+ ;;
+ nitrogen)
+ cp $_mdec/*.dtb /mnt/mnt/
+ ;;
+ cubie)
+ cp $_mdec/{u-boot-sunxi-with-spl.bin,*.dtb} /mnt/mnt/
+ ;;
+ esac
}
md_prep_fdisk() {