summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2016-05-22 06:43:03 +0000
committerjsg <jsg@openbsd.org>2016-05-22 06:43:03 +0000
commitdcab443fc5b4c57162c1c34fa5f246159cd142bf (patch)
tree1bef3c4859f609cec0d8afa8cc7651b170c2f87d
parentRemove LOADADDR definitions, the default ${loadaddr} set by u-boot is (diff)
downloadwireguard-openbsd-dcab443fc5b4c57162c1c34fa5f246159cd142bf.tar.xz
wireguard-openbsd-dcab443fc5b4c57162c1c34fa5f246159cd142bf.zip
use a common simple u-boot script that loads with fdt
-rw-r--r--distrib/armv7/ramdisk/install.md42
1 files changed, 13 insertions, 29 deletions
diff --git a/distrib/armv7/ramdisk/install.md b/distrib/armv7/ramdisk/install.md
index 7aa83ea8bcb..7598f00fe0d 100644
--- a/distrib/armv7/ramdisk/install.md
+++ b/distrib/armv7/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.28 2016/05/21 07:19:24 jsg Exp $
+# $OpenBSD: install.md,v 1.29 2016/05/22 06:43:03 jsg Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -37,26 +37,21 @@
if dmesg | grep -q '^omap0 at mainbus0:'; then
MDPLAT=OMAP
- LOADADDR=0x82800000
fi
if dmesg | grep -q '^imx0 at mainbus0:'; then
MDPLAT=IMX
- LOADADDR=0x18800000
fi
if dmesg | grep -q '^sunxi0 at mainbus0:'; then
MDPLAT=SUNXI
- LOADADDR=0x40200000
fi
if dmesg | grep -q '^vexpress0 at mainbus0:'; then
if dmesg | grep -q '^cpu0 at mainbus0: ARM Cortex A9 '; then
MDPLAT=VEXPRESSA9
- LOADADDR=0x60300000
else
MDPLAT=VEXPRESSA15
- LOADADDR=0x80300000
fi
fi
@@ -88,6 +83,17 @@ md_installboot() {
# extracted on all machines, so make snap works.
tar -C /mnt/ -xf /usr/mdec/u-boots.tgz
+ cat > /tmp/boot.cmd<<__EOT
+setenv bootargs sd0a:/bsd ;
+mmc rescan ;
+usb start ;
+run findfdt ;
+load mmc \${mmcdev}:1 \${loadaddr} bsd.umg ;
+load mmc \${mmcdev}:1 \${fdt_addr_r} \${fdtfile} ;
+bootm \${loadaddr} - \${fdt_addr_r} ;
+__EOT
+ mkuboot -t script -a arm -o linux /tmp/boot.cmd /mnt/mnt/boot.scr
+
if [[ ${MDPLAT} == "OMAP" ]]; then
if [[ -n $BEAGLE ]]; then
@@ -100,33 +106,16 @@ md_installboot() {
cp /mnt/usr/mdec/panda/{MLO,u-boot.img} /mnt/mnt/
cp /mnt/usr/mdec/panda/*.dtb /mnt/mnt/
fi
- cat > /mnt/mnt/uenv.txt<<__EOT
-bootcmd=mmc rescan ; setenv loadaddr ${LOADADDR}; setenv bootargs sd0i:/bsd.umg ; fatload mmc \${mmcdev} \${loadaddr} bsd.umg ; bootm \${loadaddr} ;
-uenvcmd=boot
-__EOT
elif [[ ${MDPLAT} == "IMX" ]]; then
if [[ -n $CUBOX ]]; then
- cat > /tmp/boot.cmd<<__EOT
-; setenv loadaddr ${LOADADDR} ; setenv bootargs sd0i:/bsd.umg ; for dtype in usb mmc ; do for disk in 0 1 ; do \${dtype} dev \${disk} ; for fs in fat ext2 ; do if \${fs}load \${dtype} \${disk}:1 \${loadaddr} bsd.umg ; then bootm \${loadaddr} ; fi ; done; done; done; echo; echo failed to load bsd.umg
-__EOT
- mkuboot -t script -a arm -o linux /tmp/boot.cmd \
- /mnt/mnt/boot.scr
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
- cat > /tmp/6x_bootscript.scr<<__EOT
- ; setenv loadaddr ${LOADADDR} ; setenv bootargs sd0i:/bsd.umg ; for dtype in sata mmc ; do for disk in 0 1 ; do \${dtype} dev \${disk} ; for fs in fat ext2 ; do if \${fs}load \${dtype} \${disk}:1 \${loadaddr} bsd.umg ; then bootm \${loadaddr} ; fi ; done; done; done; echo; echo failed to load bsd.umg
-__EOT
- mkuboot -t script -a arm -o linux /tmp/6x_bootscript.scr /mnt/mnt/6x_bootscript
+ mv /mnt/mnt/boot.scr /mnt/mnt/6x_bootscript
elif [[ -n $WANDBOARD ]]; then
- cat > /tmp/boot.cmd<<__EOT
-; setenv loadaddr ${LOADADDR} ; setenv bootargs sd0i:/bsd.umg ; for dtype in mmc ; do for disk in 0 1 ; do \${dtype} dev \${disk} ; for fs in fat ext2 ; do if \${fs}load \${dtype} \${disk}:1 \${loadaddr} bsd.umg ; then bootm \${loadaddr} ; fi ; done; done; done; echo; echo failed to load bsd.umg
-__EOT
- mkuboot -t script -a arm -o linux /tmp/boot.cmd \
- /mnt/mnt/boot.scr
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
@@ -134,11 +123,6 @@ __EOT
of=/dev/${_disk}c bs=1024 seek=69 >/dev/null
fi
elif [[ ${MDPLAT} == "SUNXI" ]]; then
- cat > /mnt/mnt/uenv.txt<<__EOT
-bootargs=sd0i:/bsd
-mmcboot=mmc rescan ; fatload mmc 0 ${LOADADDR} bsd.umg && bootm ${LOADADDR};
-uenvcmd=run mmcboot;
-__EOT
cp /mnt/usr/mdec/cubie/u-boot-sunxi-with-spl.bin /mnt/mnt/
cp /mnt/usr/mdec/cubie/*.dtb /mnt/mnt/
fi