1*1c972ea7Sjsgdnl $OpenBSD: prep,v 1.21 2023/04/10 12:57:15 jsg Exp $ 20d877978SpatrickPlease be aware that OpenBSD support for this platform is far from 30d877978Spatrickcomplete. 40d877978Spatrick 5e3b182c7SjsgTo perform an installation you must be able to interact with the serial 6539b871fSfcambusconsole of the machine in most cases. USB OTG ports such as the one 7539b871fSfcambusfound on the BeagleBone will not function as a console. You need to be 8539b871fSfcambusable to interact with the firmware on the console. Often this requires 9539b871fSfcambusa 3.3V TTL level adapter connected to pins or a header on the board. 10539b871fSfcambus 11539b871fSfcambusOn systems supporting the simplefb(4) driver, such as the Cubieboard2, 12539b871fSfcambusit is possible to install the system using the framebuffer console. 13539b871fSfcambusYou will need to enter the following at the ``boot>'' prompt: 14539b871fSfcambus 15539b871fSfcambus boot> set tty fb0 16e3b182c7Sjsg 17be305a23SjsgFirmware which provides an EFI interface with a Device Tree Blob (DTB) 18be305a23Sjsgfile is required to boot. In most cases this is provided by images of 19be305a23SjsgU-Boot 2016.07 or newer on SD/MMC devices or in SPI flash. If the 20be305a23Sjsgminiroot images are used, U-Boot and DTB files are distributed as part 21be305a23Sjsgof the miniroot disk images. 22be305a23Sjsg 23fa4b262fSjsgOpenBSD can be installed onto a disk by copying the miniroot for your 244675fc66Sderaadtboard "miniroot-board-{:--:}OSrev.img" image to an SD card. 250d877978Spatrick 26fa4b262fSjsgBooting from an SD card: 27fa4b262fSjsg 28fa4b262fSjsg To use the miniroot image you will need another machine to plug the 29fa4b262fSjsg SD card in to. Any machine type will do, as long as it supports SD card 30fa4b262fSjsg storage devices. Under OpenBSD, it will appear as a ``sd'' device, for 31fa4b262fSjsg example sd1. 320d877978Spatrick 330d877978Spatrick Use the dd(1) utility to copy the miniroot to the hard drive. 340d877978Spatrick The command would likely be, under OpenBSD: 354675fc66Sderaadt dd if=miniroot-am335x-{:--:}OSrev.img of=/dev/rsd1c 360d877978Spatrick 377df84a8aSjsg When you have connected the BeagleBone to your computer, a command such 3883b71d08Safresh1 as "cu -l cuaU0 -s 115200" (assuming cuaU0 is your serial port device) 3983b71d08Safresh1 should connect you to the board's console. 400d877978Spatrick 410d877978Spatrick Note: By default the BeagleBone Black will boot from the internal emmc. 42fa4b262fSjsg In order to make it boot from the micro SD card, you will need to hold down 43fa4b262fSjsg the small button located by the SD card slot while powering on the board. 44fa4b262fSjsg Once you have done this the board will boot from the SD card as the default. 45be305a23Sjsg 46be305a23SjsgRunning EFI payloads with U-Boot: 47be305a23Sjsg 48be305a23SjsgIf the U-Boot target supports "distro_bootcmd" efiboot will automatically 49be305a23Sjsgbe loaded by placing bootarm.efi into /efi/boot/bootarm.efi on a FAT 50*1c972ea7Sjsgfilesystem. With dtb files placed in /, /dtbs/, or /dtb/current/. 51be305a23Sjsg 52be305a23SjsgIf the U-Boot target supports bootefi but not automatically finding it with 53be305a23Sjsg"distro_bootcmd" then it must be loaded manually or by U-Boot commands or 54be305a23Sjsgscript. 55be305a23Sjsg => run findfdt 56be305a23Sjsg => load mmc 0:1 ${fdt_addr_r} ${fdtfile} 57be305a23Sjsg => load mmc 0:1 ${kernel_addr_r} efi/boot/bootarm.efi 58be305a23Sjsg => bootefi ${kernel_addr_r} ${fdt_addr_r} 59be305a23SjsgThe bootloader will then run and try to load sd0a:/bsd off an FFS 60be305a23Sjsgfilesystem after a timeout. 61fd7cb2f8Sjsg 62fd7cb2f8SjsgInstall on systems without a supported miniroot: 63fd7cb2f8Sjsg 64fd7cb2f8Sjsg If a miniroot is not available for your system you will have to modify 65fd7cb2f8Sjsg an existing image before booting it. 66fd7cb2f8Sjsg 6749d6abdeSjsg To do so first install the u-boot-arm and dtb packages. Write one of the 68fd7cb2f8Sjsg provided miniroot images to an SD card: 69fd7cb2f8Sjsg 704675fc66Sderaadt dd if=miniroot-am335x-{:--:}OSrev.img of=/dev/rsdXc 71fd7cb2f8Sjsg 724670302aSjsg Add a board specific DTB file (Allwinner and Rockchip U-Boot images 734670302aSjsg come with a default DTB): 74fd7cb2f8Sjsg 75fd7cb2f8Sjsg mount /dev/sdXi /mnt 76fd7cb2f8Sjsg cp /usr/local/share/dtb/arm/board.dtb /mnt/ 77fd7cb2f8Sjsg umount /mnt 78fd7cb2f8Sjsg 79fd7cb2f8Sjsg For systems based on Texas Instruments OMAP and AMxxxx SoCs: 80fd7cb2f8Sjsg 81fd7cb2f8Sjsg mount /dev/sdXi /mnt 82fd7cb2f8Sjsg cp /usr/local/share/u-boot/board/{MLO,u-boot.img} /mnt/ 83fd7cb2f8Sjsg umount /mnt 84fd7cb2f8Sjsg 85fd7cb2f8Sjsg For systems based on Freescale/NXP i.MX SoCs: 86fd7cb2f8Sjsg 874d6bb766Sjsg dd if=/usr/local/share/u-boot/board/SPL of=/dev/sdXc bs=1024 seek=1 88fd7cb2f8Sjsg dd if=/usr/local/share/u-boot/board/u-boot.img \ 894d6bb766Sjsg of=/dev/sdXc bs=1024 seek=69 90fd7cb2f8Sjsg 914d6bb766Sjsg For systems based on Allwinner Axx SoCs: 92fd7cb2f8Sjsg 93fd7cb2f8Sjsg dd if=/usr/local/share/u-boot/board/u-boot-sunxi-with-spl.bin \ 944d6bb766Sjsg of=/dev/sdXc bs=1024 seek=8 9565d6ca33Sjsg 969bfe40daSjsg For systems based on Rockchip RK3288 SoCs: 9765d6ca33Sjsg 989bfe40daSjsg dd if=/usr/local/share/u-boot/board/idbloader.img \ 9965d6ca33Sjsg of=/dev/sdXc seek=64 1009bfe40daSjsg dd if=/usr/local/share/u-boot/board/u-boot.img \ 1019bfe40daSjsg of=/dev/sdXc seek=16384 1022d49784eSjsg 1032d49784eSjsg For systems based on Marvell ARMADA 38x SoCs: 1042d49784eSjsg 1052d49784eSjsg dd if=/usr/local/share/u-boot/board/u-boot-spl.kwb \ 1062d49784eSjsg of=/dev/sdXc bs=512 seek=1 107