1dnl $OpenBSD: prep,v 1.11 2020/05/17 17:04:27 deraadt Exp $ 2Please be aware that OpenBSD support for this platform is far from 3complete. 4 5To perform an installation you must be able to interact with the serial 6console of the machine. USB OTG ports such as the one found on the 7BeagleBone will not function as a console. You need to be able to 8interact with the firmware on the console. Often this requires a 3.3V 9TTL level adapter connected to pins or a header on the board. 10 11Firmware which provides an UEFI interface with a Device Tree Blob 12(DTB) file or ACPI support is required to boot. In most cases this is 13provided by images of U-Boot 2016.07 or newer on SD/MMC devices or in 14SPI flash. If the miniroot images are used, U-Boot and DTB files are 15distributed as part of the miniroot disk images. 16 17OpenBSD can be installed onto a disk by copying the miniroot for your 18board "miniroot{:--:}OSrev.img" image to an SD card. 19 20Booting from an SD card: 21 22 To use the miniroot image you will need another machine to plug the 23 SD card in to. Any machine type will do, as long as it supports SD card 24 storage devices. Under OpenBSD, it will appear as a ``sd'' device, for 25 example sd1. 26 27 Use the dd(1) utility to copy the miniroot to the SD card. 28 The command would likely be, under OpenBSD: 29 dd if=miniroot{:--:}OSrev.img of=/dev/rsd1c bs=1m 30 31 When you have connected the serial to your computer, a command such 32 as "cu -l cuaU0 -s 115200" (assuming cuaU0 is your serial port device) 33 should connect you to the board's console. 34 35Running EFI payloads with U-Boot: 36 37If the U-Boot target supports "distro_bootcmd" efiboot will automatically 38be loaded by placing bootaa64.efi into /efi/boot/bootaa64.efi on a FAT 39filesystem. With dtb files placed in in /vendor/, /dtbs/vendor/, or 40/dtb/current/vendor/. 41 42If the U-Boot target supports bootefi but not automatically finding it with 43"distro_bootcmd" then it must be loaded manually or by U-Boot commands or 44script. 45 => run findfdt 46 => load mmc 0:1 ${fdt_addr_r} ${fdtfile} 47 => load mmc 0:1 ${kernel_addr_r} efi/boot/bootaa64.efi 48 => bootefi ${kernel_addr_r} ${fdt_addr_r} 49The bootloader will then run and try to load sd0a:/bsd off an FFS 50filesystem after a timeout. 51 52Install on Raspberry Pi 4: 53 54 You will need a microSD card (only a small one is needed), a USB 55 storage device, a TTL serial interface adapter (e.g. CP2102 USB-UART 56 converter), and a cable to attach this to the TXD/RXD/GND pins on the 57 https://pinout.xyz/ header on the board. 58 59 Follow the installation instructions at https://github.com/pftf/RPi4 60 to install UEFI firmware to a FAT-formatted microSD card. 61 62 Use the dd(1) utility to copy the miniroot to the USB storage device. 63 The command would likely be, under OpenBSD: 64 dd if=miniroot{:--:}OSrev.img of=/dev/rsd1c bs=1m 65 66 When you have connected the serial to your computer, a command such 67 as "cu -l cuaU0 -s 115200" (assuming cuaU0 is your serial port device) 68 should connect you to the board's console. 69 70 Shortly after powering the board, you should see messages on the serial 71 console starting with "Initialising SDRAM" followed by messages from the 72 UEFI firmware. If you have a monitor connected to the HDMI port, you 73 should see a multi-coloured screen followed by UEFI firmware output. 74 If you do not see this, re-check your UEFI firmware installation. 75 76 OpenBSD should boot automatically soon after loading the UEFI firmware. 77 If a monitor is connected you will see messages from the boot loader, 78 but after the kernel has started running you will only see output on 79 the serial console. 80 81Install on systems without a supported miniroot: 82 83 If a miniroot is not available for your system you will have to modify 84 an existing image before booting it. 85 86 To do so first install the u-boot-aarch64 and dtb packages. Write the 87 provided miniroot image to an SD card: 88 89 dd if=miniroot{:--:}OSrev.img of=/dev/rsdXc bs=1m 90 91 Add a board specific DTB file (Allwinner and Rockchip U-Boot images 92 come with a default DTB): 93 94 mount /dev/sdXi /mnt 95 mkdir /mnt/vendor 96 cp /usr/local/share/dtb/arm64/vendor/board.dtb /mnt/vendor/ 97 umount /mnt 98 99 For systems based on Allwinner Axx Socs: 100 101 dd if=/usr/local/share/u-boot/board/u-boot-sunxi-with-spl.bin \ 102 of=/dev/sdXc bs=1024 seek=8 103 104 For systems based on Rockchip RK33xx SoCs: 105 106 dd if=/usr/local/share/u-boot/board/idbloader.img \ 107 of=/dev/sdXc seek=64 108 dd if=/usr/local/share/u-boot/board/u-boot.itb \ 109 of=/dev/sdXc seek=16384 110