1dnl $OpenBSD: prep,v 1.21 2023/04/10 12:57:15 jsg 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 in most cases. USB OTG ports such as the one 7found on the BeagleBone will not function as a console. You need to be 8able to interact with the firmware on the console. Often this requires 9a 3.3V TTL level adapter connected to pins or a header on the board. 10 11On systems supporting the simplefb(4) driver, such as the Cubieboard2, 12it is possible to install the system using the framebuffer console. 13You will need to enter the following at the ``boot>'' prompt: 14 15 boot> set tty fb0 16 17Firmware which provides an EFI interface with a Device Tree Blob (DTB) 18file is required to boot. In most cases this is provided by images of 19U-Boot 2016.07 or newer on SD/MMC devices or in SPI flash. If the 20miniroot images are used, U-Boot and DTB files are distributed as part 21of the miniroot disk images. 22 23OpenBSD can be installed onto a disk by copying the miniroot for your 24board "miniroot-board-{:--:}OSrev.img" image to an SD card. 25 26Booting from an SD card: 27 28 To use the miniroot image you will need another machine to plug the 29 SD card in to. Any machine type will do, as long as it supports SD card 30 storage devices. Under OpenBSD, it will appear as a ``sd'' device, for 31 example sd1. 32 33 Use the dd(1) utility to copy the miniroot to the hard drive. 34 The command would likely be, under OpenBSD: 35 dd if=miniroot-am335x-{:--:}OSrev.img of=/dev/rsd1c 36 37 When you have connected the BeagleBone to your computer, a command such 38 as "cu -l cuaU0 -s 115200" (assuming cuaU0 is your serial port device) 39 should connect you to the board's console. 40 41 Note: By default the BeagleBone Black will boot from the internal emmc. 42 In order to make it boot from the micro SD card, you will need to hold down 43 the small button located by the SD card slot while powering on the board. 44 Once you have done this the board will boot from the SD card as the default. 45 46Running EFI payloads with U-Boot: 47 48If the U-Boot target supports "distro_bootcmd" efiboot will automatically 49be loaded by placing bootarm.efi into /efi/boot/bootarm.efi on a FAT 50filesystem. With dtb files placed in /, /dtbs/, or /dtb/current/. 51 52If the U-Boot target supports bootefi but not automatically finding it with 53"distro_bootcmd" then it must be loaded manually or by U-Boot commands or 54script. 55 => run findfdt 56 => load mmc 0:1 ${fdt_addr_r} ${fdtfile} 57 => load mmc 0:1 ${kernel_addr_r} efi/boot/bootarm.efi 58 => bootefi ${kernel_addr_r} ${fdt_addr_r} 59The bootloader will then run and try to load sd0a:/bsd off an FFS 60filesystem after a timeout. 61 62Install on systems without a supported miniroot: 63 64 If a miniroot is not available for your system you will have to modify 65 an existing image before booting it. 66 67 To do so first install the u-boot-arm and dtb packages. Write one of the 68 provided miniroot images to an SD card: 69 70 dd if=miniroot-am335x-{:--:}OSrev.img of=/dev/rsdXc 71 72 Add a board specific DTB file (Allwinner and Rockchip U-Boot images 73 come with a default DTB): 74 75 mount /dev/sdXi /mnt 76 cp /usr/local/share/dtb/arm/board.dtb /mnt/ 77 umount /mnt 78 79 For systems based on Texas Instruments OMAP and AMxxxx SoCs: 80 81 mount /dev/sdXi /mnt 82 cp /usr/local/share/u-boot/board/{MLO,u-boot.img} /mnt/ 83 umount /mnt 84 85 For systems based on Freescale/NXP i.MX SoCs: 86 87 dd if=/usr/local/share/u-boot/board/SPL of=/dev/sdXc bs=1024 seek=1 88 dd if=/usr/local/share/u-boot/board/u-boot.img \ 89 of=/dev/sdXc bs=1024 seek=69 90 91 For systems based on Allwinner Axx SoCs: 92 93 dd if=/usr/local/share/u-boot/board/u-boot-sunxi-with-spl.bin \ 94 of=/dev/sdXc bs=1024 seek=8 95 96 For systems based on Rockchip RK3288 SoCs: 97 98 dd if=/usr/local/share/u-boot/board/idbloader.img \ 99 of=/dev/sdXc seek=64 100 dd if=/usr/local/share/u-boot/board/u-boot.img \ 101 of=/dev/sdXc seek=16384 102 103 For systems based on Marvell ARMADA 38x SoCs: 104 105 dd if=/usr/local/share/u-boot/board/u-boot-spl.kwb \ 106 of=/dev/sdXc bs=512 seek=1 107