summaryrefslogtreecommitdiff
path: root/distrib
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-02-18 02:01:54 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-02-18 02:01:54 +0000
commit91c3a07fcd4c487a71ee43675e2328e68dbef15d (patch)
tree083907aa1c60283387885e65b9d5776caae8b65c /distrib
parent5e7e235c4b2975bacc1e2c11e5521b357fe72fb5 (diff)
Add miniroot and ramdisk hooks for the Raspberry Pi 3.
Unlike the TI boot ROM the Broadcom one doesn't understand FAT12, only FAT16 or FAT32. The u-boot-aarch64 and raspberrypi-firmware packages are now required to run make release on arm64. ok patrick@
Diffstat (limited to 'distrib')
-rw-r--r--distrib/arm64/miniroot/Makefile15
-rw-r--r--distrib/arm64/ramdisk/Makefile8
-rw-r--r--distrib/arm64/ramdisk/install.md15
-rw-r--r--distrib/arm64/ramdisk/list9
4 files changed, 42 insertions, 5 deletions
diff --git a/distrib/arm64/miniroot/Makefile b/distrib/arm64/miniroot/Makefile
index bae5163c9de..5257a9e2198 100644
--- a/distrib/arm64/miniroot/Makefile
+++ b/distrib/arm64/miniroot/Makefile
@@ -23,11 +23,19 @@ FFSSTART!= expr ${MSDOSSTART} + ${MSDOSSIZE}
FS?= msdos
PART_ID?=C
-NEWFS_ARGS_msdos=-L boot
+NEWFS_ARGS_msdos=-L boot -c1 -F16
MOUNT_ARGS_msdos=-o-l
PDTB= /usr/local/share/dtb/arm64
PUBOOT= /usr/local/share/u-boot
+PRPI= /usr/local/share/raspberrypi-firmware/boot
+
+PIFILES=\
+ bootcode.bin \
+ start.elf \
+ fixup.dat \
+ bcm2710-rpi-3-b.dtb \
+ bcm2710-rpi-cm3.dtb
cleandir: clean
clean:
@@ -49,8 +57,13 @@ do_files:
ln ${MOUNT_POINT}/bsd.rd ${MOUNT_POINT}/bsd
-umount ${MOUNT_POINT}
mount ${MOUNT_ARGS_msdos} ${VND_IDEV} ${MOUNT_POINT}
+.for FILE in ${PIFILES}
+ cp ${PRPI}/${FILE} ${MOUNT_POINT}/
+.endfor
+ cp ${PUBOOT}/rpi_3/u-boot.bin ${MOUNT_POINT}/
mkdir -p ${MOUNT_POINT}/efi/boot
cp /usr/mdec/BOOTAA64.EFI ${MOUNT_POINT}/efi/boot/bootaa64.efi
+ echo 'arm_control=0x200\nenable_uart=1\ndevice_tree_address=0x100\nkernel=u-boot.bin' > ${MOUNT_POINT}/config.txt
rd_setup:
dd if=/dev/zero of=${IMAGE} bs=512 count=${NBLKS}
diff --git a/distrib/arm64/ramdisk/Makefile b/distrib/arm64/ramdisk/Makefile
index 25cc40940c6..e89c8ebf591 100644
--- a/distrib/arm64/ramdisk/Makefile
+++ b/distrib/arm64/ramdisk/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2017/01/23 02:24:00 patrick Exp $
+# $OpenBSD: Makefile,v 1.2 2017/02/18 02:01:53 jsg Exp $
REV= ${OSrev}
@@ -17,6 +17,9 @@ MTREE= ${UTILS}/mtree.conf
DISKTYPE= rdroot
MAKEFSARGS_RD= -o disklabel=${DISKTYPE},minfree=0,density=4096
+DIRS=\
+ rpi
+
.ifndef DESTDIR
all ${IMAGE}:
@echo setenv DESTDIR before making a ramdisk!
@@ -39,6 +42,9 @@ ${BSD_RD}: ${IMAGE} bsd rdsetroot
${IMAGE}: ${CBIN}
rm -rf $@.d
install -d -o root -g wheel $@.d
+.for DIR in ${DIRS}
+ mkdir -p $@.d/usr/mdec/${DIR}
+.endfor
mtree -def ${MTREE} -p $@.d -u
TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} REV=${REV} \
TARGDIR=$@.d UTILS=${UTILS} RELEASEDIR=${RELEASEDIR} \
diff --git a/distrib/arm64/ramdisk/install.md b/distrib/arm64/ramdisk/install.md
index 49400610f5e..7df6a9527d8 100644
--- a/distrib/arm64/ramdisk/install.md
+++ b/distrib/arm64/ramdisk/install.md
@@ -1,4 +1,4 @@
-# $OpenBSD: install.md,v 1.1 2017/01/23 02:24:00 patrick Exp $
+# $OpenBSD: install.md,v 1.2 2017/02/18 02:01:53 jsg Exp $
#
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -39,12 +39,23 @@ NEWFSARGS_msdos="-F 16 -L boot"
MOUNT_ARGS_msdos="-o-l"
md_installboot() {
- local _disk=/dev/$1
+ local _disk=/dev/$1 _mdec _plat
# Mount MSDOS partition, extract U-Boot and copy UEFI boot program
mount ${MOUNT_ARGS_msdos} ${_disk}i /mnt/mnt
mkdir -p /mnt/mnt/efi/boot
cp /mnt/usr/mdec/BOOTAA64.EFI /mnt/mnt/efi/boot/bootaa64.efi
+
+ _plat=rpi
+ _mdec=/usr/mdec/$_plat
+
+ cp $_mdec/{bootcode.bin,start.elf,fixup.dat,*.dtb} /mnt/mnt/
+ cat > /mnt/mnt/config.txt<<-__EOT
+ arm_control=0x200
+ enable_uart=1
+ device_tree_address=0x100
+ kernel=u-boot.bin
+ __EOT
}
md_prep_fdisk() {
diff --git a/distrib/arm64/ramdisk/list b/distrib/arm64/ramdisk/list
index c2205032a67..d8b000df4c1 100644
--- a/distrib/arm64/ramdisk/list
+++ b/distrib/arm64/ramdisk/list
@@ -1,4 +1,4 @@
-# $OpenBSD: list,v 1.1 2017/01/23 02:24:00 patrick Exp $
+# $OpenBSD: list,v 1.2 2017/02/18 02:01:53 jsg Exp $
SRCDIRS distrib/special
@@ -116,4 +116,11 @@ SYMLINK install.sub autoinstall
SYMLINK install.sub install
SYMLINK install.sub upgrade
+COPY /usr/local/share/raspberrypi-firmware/boot/bcm2710-rpi-3-b.dtb usr/mdec/rpi/bcm2710-rpi-3-b.dtb
+COPY /usr/local/share/raspberrypi-firmware/boot/bcm2710-rpi-cm3.dtb usr/mdec/rpi/bcm2710-rpi-cm3.dtb
+COPY /usr/local/share/raspberrypi-firmware/boot/bootcode.bin usr/mdec/rpi/bootcode.bin
+COPY /usr/local/share/raspberrypi-firmware/boot/start.elf usr/mdec/rpi/start.elf
+COPY /usr/local/share/raspberrypi-firmware/boot/fixup.dat usr/mdec/rpi/fixup.dat
+COPY /usr/local/share/u-boot/rpi_3/u-boot.bin usr/mdec/rpi/u-boot.bin
+
TZ