On 2020/03/07 15:41, Jonathan Gray wrote:
> On Fri, Mar 06, 2020 at 11:29:57PM +0000, Stuart Henderson wrote:
> > I've finally managed to get openbsd installed on an rpi3b (need
> > something to run signify/pkg_sign and this is what I have). Thought I'd
> > write up the install method because there are no useful docs at the
> > moment and it's a bit fiddly. (Note that only rpi3b works - 3b+ has no
> > network/usb, the 32-bit ones are unsupported, 4 is unsupported).
> > 
> > - boot linux, set the otp bit to permanently enable booting from usb (set
> > "program_usb_boot_mode=1" in /boot/config.txt and reboot)
> 
> You don't need to boot linux for that.  Just boot with rpi firmware.
> 3b+ can boot off usb by default.
> 
> And if you don't want to blow the fuse the sd card can be left in and
> boot_targets set in the U-Boot environment as mentioned on arm64.html.

I had to borrow the SD card from something else so I'd prefer to have
it back than not blow the fuse :)

> > 
> > - write miniroot64.fs to an SD card (I tried 6.3 up to 6.6 and -current,
> > that's the only one where I get any console output)
> 
> Are you using pins 8 (tx) and 10 (rx)?
> 
> With the Ethernet port facing towards you numbering is
> 
> 1  2
> 3  4
> 5  6
> 7  8
> 9 10
> 
> After 6.6 the uart is now the more capable pl011 by default.

Yes, I'm using 8/10.

6.4 is the only one from 6.3 to -current where, when written to the SD card,
I had any output.

> 
> > 
> > - write whatever version miniroot to a USB stick (I have a -current one)
> 
> Above you said the 6.4 miniroot, which is it?

The above was on the SD card, this is on the USB stick. IIRC I wasn't able to
get any of the miniroot booting directly from USB stick (but now I am out of
sticks and I don't want to trash the install now I've got it working!).
Though it is possible that I didn't test 6.4 on a stick.

After running the installer and installing -current to USB, serial output
is working.

> 
> > 
> > - ttl cable on standard pins on the pinout.xyz connector 115200
> > 
> > - boot it. if you just leave it to itself you get
> > 
> > ## Starting EFI application at 00080000 ...
> > >> OpenBSD/arm64 BOOTAA64 0.13
> > boot>
> > kcannot open sd0a:/etc/random.seed: No such file or directory
> > booting sd0a:/bsd: 2696864+410652+8951776+739752=0xf3e4c8
> > "Synchronous Abort" handler, esr 0x02000000
> > 
> > instead you have to do "machine exit" (thanks aalm for the tip)
> > and then it boots the installer.
> 
> U-Boot packages on build machines are infrequently updated and going by
> your dmesg it is still 2019.10.  Does anything change if you take the
> rpi3 u-boot.bin from u-boot-aarch64 2020.01 and replace it?

The one where I had the '"Synchronous Abort" handler' error will have
been an older one from the 6.4 miniroot.

If I dd the current snapshot miniroot to an SD card:

- booting directly fails, no serial output

- mounting and copying in a new u-boot, I *do* now get serial output.
Booting a kernel loaded from SD card doesn't work (transcript below) and
"machine exit" doesn't help any more, but I can "b sd1a:/bsd" to boot
from the USB stick.

So it seems it would definitely help to update u-boot on the build machines.

I missed the arm64.html note (I wasn't expecting to see any installation
instructions there, I'm used to that being only in INSTALL.$arch) but as things
stand it seems like it needs an additional note about dd'ing miniroot to USB as
well as SD, and typing 'boot sd1a:/bsd' or some alternative.


U-Boot 2020.01 (Mar 04 2020 - 23:31:22 -0700)

DRAM:  948 MiB
RPI 3 Model B (0xa02082)
MMC:   mmc@7e202000: 0, mmcnr@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
Bus usb@7e980000: scanning bus usb@7e980000 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk [email protected]...
** Unrecognized filesystem type **
Card did not respond to voltage select!
Scanning disk [email protected]...
Disk [email protected] not ready
Scanning disk usb_mass_storage.lun0...
** Unrecognized filesystem type **
Found 6 disks
BootOrder not defined
EFI boot manager: Cannot load any image
168758 bytes read in 12 ms (13.4 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
disks: sd0* sd1
>> OpenBSD/arm64 BOOTAA64 0.20
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2259144+634536+8767192+740424read section header string table
 failed(0). will try /bsd
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 2259144+634536+8767192+740424"Synchronous Abort" handler, 
esr 0x96000044
elr: fffffffffec3f2c8 lr : fffffffffec43a08 (reloc)
elr: 0000000039f192c8 lr : 0000000039f1da08
x0 : 00000000d0dc05eb x1 : 0000000039e1a788
x2 : 0000000000000000 x3 : 00000000f36b9841
x4 : 00000000000000f3 x5 : 00000000000000a0
x6 : 000000003b3c5160 x7 : 0000000000000008
x8 : 000000010abe72e0 x9 : 0000000039f32000
x10: 00000000d0dc05f0 x11: 00000001db9a78d8
x12: 00000000d0dc05f0 x13: 0000000039e0f2b8
x14: 0000000000000000 x15: 0000000039e1d7bc
x16: 0000000039e1d7d0 x17: 00000000000000ee
x18: 000000000000f36b x19: 0000000000000000
x20: 000000003af4c3e0 x21: 000000000000007d
x22: 0000000000000000 x23: 0000000000000380
x24: 0000000039e26968 x25: ffffff8001111360
x26: 371f57fbd0dc05eb x27: ffffff8001111320
x28: 0000000039e22970 x29: 000000003af4c3d0

Code: 927d754a 8b0a010b 9100216b f9023d2b (b800850a)
UEFI image [0x0000000039f0f000:0x0000000039f3833f] pc=0xa2c8 
'/efi\boot\bootaa64.efi'
Resetting CPU ...

resetting ...

U-Boot 2020.01 (Mar 04 2020 - 23:31:22 -0700)

DRAM:  948 MiB
RPI 3 Model B (0xa02082)
MMC:   mmc@7e202000: 0, mmcnr@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
Bus usb@7e980000: scanning bus usb@7e980000 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0 
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk [email protected]...
** Unrecognized filesystem type **
Card did not respond to voltage select!
Scanning disk [email protected]...
Disk [email protected] not ready
Scanning disk usb_mass_storage.lun0...
** Unrecognized filesystem type **
Found 6 disks
BootOrder not defined
EFI boot manager: Cannot load any image
168758 bytes read in 12 ms (13.4 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
disks: sd0* sd1
>> OpenBSD/arm64 BOOTAA64 0.20
boot> boot sd1a:/bsd
booting sd1a:/bsd: 7693824+1495976+536248+848640 
[507156+109+956256+540170]=0xd3b870
type 0x0 pa 0x0 va 0x0 pages 0x1 attr 0x8
type 0x7 pa 0x1000 va 0x1000 pages 0x1ff attr 0x8
type 0x2 pa 0x200000 va 0x200000 pages 0x4000 attr 0x8
type 0x7 pa 0x4200000 va 0x4200000 pages 0x3cf6 attr 0x8
type 0x4 pa 0x7ef6000 va 0x7ef6000 pages 0x14 attr 0x8
type 0x7 pa 0x7f0a000 va 0x7f0a000 pages 0x3139b attr 0x8
type 0x2 pa 0x392a5000 va 0x392a5000 pages 0xb62 attr 0x8
type 0x4 pa 0x39e07000 va 0x39e07000 pages 0x1 attr 0x8
type 0x2 pa 0x39e08000 va 0x39e08000 pages 0x6 attr 0x8
type 0x7 pa 0x39e0e000 va 0x39e0e000 pages 0x1 attr 0x8
type 0x2 pa 0x39e0f000 va 0x39e0f000 pages 0x100 attr 0x8
type 0x1 pa 0x39f0f000 va 0x39f0f000 pages 0x2a attr 0x8
type 0x0 pa 0x39f39000 va 0x39f39000 pages 0x7 attr 0x8
type 0x4 pa 0x39f40000 va 0x39f40000 pages 0x1 attr 0x8
type 0x6 pa 0x39f41000 va 0x4c2fccd000 pages 0x1 attr 0x8000000000000008
type 0x4 pa 0x39f42000 va 0x39f42000 pages 0x2 attr 0x8
type 0x0 pa 0x39f44000 va 0x39f44000 pages 0x7 attr 0x8
type 0x4 pa 0x39f4b000 va 0x39f4b000 pages 0x2 attr 0x8
type 0x6 pa 0x39f4d000 va 0x4c2fcd9000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0x39f4e000 va 0x39f4e000 pages 0x1402 attr 0x8
type 0x5 pa 0x3b350000 va 0x4c310dc000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0x3b360000 va 0x3b360000 pages 0xa0 attr 0x8
type 0xb pa 0x3f100000 va 0x4c310ec000 pages 0x1 attr 0x8000000000000000
[ using 2004664 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2020 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6-current (GENERIC.MP) #486: Thu Mar  5 23:22:04 MST 2020
    [email protected]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 958988288 (914MB)
avail mem = 899465216 (857MB)
mainbus0 at root: Raspberry Pi 3 Model B Rev 1.2
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.8
efi0: Das U-Boot rev 0x20200100

<...>

Reply via email to