Some Raspberry Pi4 support

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Some Raspberry Pi4 support

Mark Kettenis
With the diffs I just posted to tech@, OpenBSD can boot successfully
on the Raspberry Pi4 if you use the EDK2-based UEFI firmware that is
availble now.  In principle you can build it yourself from source, but
pre-built versions can be found at:

  https://github.com/pftf/RPi4

Pretty much the only thing that actually works is xhci(4), but all
four USB Type-A ports work (2x USB3.0 and 2x USB2.0).

Some gymnastics are required to actually boot the system.  The best
approach is probably to have a uSD card with just the firmware on it,
and a USB disk/stick with minirootXX.fs on it.

Of course this won't work until my diffs are committed ;).


OpenBSD 6.7-beta (GENERIC) #2: Fri Apr 10 16:25:09 CEST 2020
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
real mem  = 1993285632 (1900MB)
avail mem = 1902022656 (1813MB)
mainbus0 at root: ACPI
cpu0 at mainbus0 mpidr 0: ARM Cortex-A72 r0p3
cpu0: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu0: 1024KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: https://github.com/pftf/RPi4 rev 0x10000
smbios0 at efi0: SMBIOS 3.3.0
smbios0: vendor https://github.com/pftf/RPi4 version "UEFI Firmware v1.7" date Mar 26 2020 22:00:52
smbios0: Sony UK Raspberry Pi 4 Model B
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
ampintc0 at mainbus0 nirq 256, ncpu 4: "interrupt-controller"
agtimer0 at mainbus0: tick rate 54000 KHz
acpi0 at mainbus0: ACPI 5.1
acpi0: sleep states
acpi0: tables DSDT FACP CSRT DBG2 GTDT APIC PPTT SPCR
acpi0: wakeup devices
"BCM2849" at acpi0 not configured
"BCM2835" at acpi0 not configured
"BCM2854" at acpi0 not configured
"ACPI0004" at acpi0 not configured
xhci0 at acpi0 XHC0 addr 0x600000000/0x1000 irq 175, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0004" at acpi0 not configured
"BCM2848" at acpi0 not configured
"BCM2850" at acpi0 not configured
"BCM2856" at acpi0 not configured
"BCM2845" at acpi0 not configured
"BCM2841" at acpi0 not configured
"BCM2841" at acpi0 not configured
"BCM2838" at acpi0 not configured
"BCM2839" at acpi0 not configured
"BCM2844" at acpi0 not configured
pluart0 at acpi0 URT0 addr 0xfe201000/0x1000 irq 153: console
"BCM2836" at acpi0 not configured
"BCM2EA6" at acpi0 not configured
"MSFT8000" at acpi0 not configured
"BCM2847" at acpi0 not configured
"BCM2855" at acpi0 not configured
"BCM6E4E" at acpi0 not configured
uhub1 at uhub0 port 1 configuration 1 interface 0 "VIA Labs USB2.0 Hub" rev 2.10/4.20 addr 2
cdce0 at uhub1 port 2 configuration 2 interface 0 "TP-LINK USB 10/100/1000 LAN" rev 2.10/30.00 addr 3
cdce0: address f4:f2:6d:18:1a:e2
umass0 at uhub0 port 2 configuration 1 interface 0 "SanDisk Ultra Fit" rev 3.00/1.00 addr 4
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SanDisk, Ultra Fit, 1.00> removable serial.07815583310719122025
sd0: 14664MB, 512 bytes/sector, 30031872 sectors
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root device (default sd0a):
swap device (default sd0b):
root on sd0a swap on sd0b dump on sd0b

Reply | Threaded
Open this post in threaded view
|

Re: Some Raspberry Pi4 support

Olivier BURELLI
Hi Mark,

Great job, thanks for all your efforts and works on arm achitectures :)

On Fri, 10 Apr 2020 18:29:16 +0200 (CEST)
Mark Kettenis <[hidden email]> wrote:

> With the diffs I just posted to tech@, OpenBSD can boot successfully
> on the Raspberry Pi4 if you use the EDK2-based UEFI firmware that is
> availble now.  In principle you can build it yourself from source, but
> pre-built versions can be found at:
>
>   https://github.com/pftf/RPi4
>
> Pretty much the only thing that actually works is xhci(4), but all
> four USB Type-A ports work (2x USB3.0 and 2x USB2.0).
>
> Some gymnastics are required to actually boot the system.  The best
> approach is probably to have a uSD card with just the firmware on it,
> and a USB disk/stick with minirootXX.fs on it.
>
> Of course this won't work until my diffs are committed ;).
>
>
> OpenBSD 6.7-beta (GENERIC) #2: Fri Apr 10 16:25:09 CEST 2020
>     [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
> real mem  = 1993285632 (1900MB)
> avail mem = 1902022656 (1813MB)
> mainbus0 at root: ACPI
> cpu0 at mainbus0 mpidr 0: ARM Cortex-A72 r0p3
> cpu0: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
> cpu0: 1024KB 64b/line 16-way L2 cache
> efi0 at mainbus0: UEFI 2.7
> efi0: https://github.com/pftf/RPi4 rev 0x10000
> smbios0 at efi0: SMBIOS 3.3.0
> smbios0: vendor https://github.com/pftf/RPi4 version "UEFI Firmware v1.7" date Mar 26 2020 22:00:52
> smbios0: Sony UK Raspberry Pi 4 Model B
> apm0 at mainbus0
> psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
> ampintc0 at mainbus0 nirq 256, ncpu 4: "interrupt-controller"
> agtimer0 at mainbus0: tick rate 54000 KHz
> acpi0 at mainbus0: ACPI 5.1
> acpi0: sleep states
> acpi0: tables DSDT FACP CSRT DBG2 GTDT APIC PPTT SPCR
> acpi0: wakeup devices
> "BCM2849" at acpi0 not configured
> "BCM2835" at acpi0 not configured
> "BCM2854" at acpi0 not configured
> "ACPI0004" at acpi0 not configured
> xhci0 at acpi0 XHC0 addr 0x600000000/0x1000 irq 175, xHCI 1.0
> usb0 at xhci0: USB revision 3.0
> uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
> "ACPI0007" at acpi0 not configured
> "ACPI0007" at acpi0 not configured
> "ACPI0007" at acpi0 not configured
> "ACPI0007" at acpi0 not configured
> "ACPI0004" at acpi0 not configured
> "BCM2848" at acpi0 not configured
> "BCM2850" at acpi0 not configured
> "BCM2856" at acpi0 not configured
> "BCM2845" at acpi0 not configured
> "BCM2841" at acpi0 not configured
> "BCM2841" at acpi0 not configured
> "BCM2838" at acpi0 not configured
> "BCM2839" at acpi0 not configured
> "BCM2844" at acpi0 not configured
> pluart0 at acpi0 URT0 addr 0xfe201000/0x1000 irq 153: console
> "BCM2836" at acpi0 not configured
> "BCM2EA6" at acpi0 not configured
> "MSFT8000" at acpi0 not configured
> "BCM2847" at acpi0 not configured
> "BCM2855" at acpi0 not configured
> "BCM6E4E" at acpi0 not configured
> uhub1 at uhub0 port 1 configuration 1 interface 0 "VIA Labs USB2.0 Hub" rev 2.10/4.20 addr 2
> cdce0 at uhub1 port 2 configuration 2 interface 0 "TP-LINK USB 10/100/1000 LAN" rev 2.10/30.00 addr 3
> cdce0: address f4:f2:6d:18:1a:e2
> umass0 at uhub0 port 2 configuration 1 interface 0 "SanDisk Ultra Fit" rev 3.00/1.00 addr 4
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, initiator 0
> sd0 at scsibus0 targ 1 lun 0: <SanDisk, Ultra Fit, 1.00> removable serial.07815583310719122025
> sd0: 14664MB, 512 bytes/sector, 30031872 sectors
> vscsi0 at root
> scsibus1 at vscsi0: 256 targets
> softraid0 at root
> scsibus2 at softraid0: 256 targets
> bootfile: sd0a:/bsd
> boot device: sd0
> root device (default sd0a):
> swap device (default sd0b):
> root on sd0a swap on sd0b dump on sd0b


--
burelli.fr <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Some Raspberry Pi4 support

Stuart Henderson
In reply to this post by Mark Kettenis
On 2020/04/10 18:29, Mark Kettenis wrote:
> real mem  = 1993285632 (1900MB)
> avail mem = 1902022656 (1813MB)

It's happy on the 4GB ones with the UEFI option toggled too (by
default it is limited to 3GB).

Thanks for getting this working Mark!


[ using 2013952 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.7-beta (GENERIC.MP) #561: Wed Apr 15 14:55:37 MDT 2020
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
real mem  = 4077580288 (3888MB)
avail mem = 3879211008 (3699MB)
mainbus0 at root: ACPI
cpu0 at mainbus0 mpidr 0: ARM Cortex-A72 r0p3
cpu0: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu0: 1024KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: https://github.com/pftf/RPi4 rev 0x10000
smbios0 at efi0: SMBIOS 3.3.0
smbios0: vendor https://github.com/pftf/RPi4 version "UEFI Firmware v1.8" date Apr 14 2020 21:24:48
smbios0: Sony UK Raspberry Pi 4 Model B
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
ampintc0 at mainbus0 nirq 256, ncpu 4 ipi: 0, 1: "interrupt-controller"
agtimer0 at mainbus0: tick rate 54000 KHz
acpi0 at mainbus0: ACPI 5.1
acpi0: sleep states
acpi0: tables DSDT FACP CSRT DBG2 GTDT APIC PPTT SPCR BGRT
acpi0: wakeup devices
"BCM2849" at acpi0 not configured
"BCM2835" at acpi0 not configured
"BCM2854" at acpi0 not configured
"ACPI0004" at acpi0 not configured
xhci0 at acpi0 XHC0 addr 0x600000000/0x1000 irq 175, xHCI 1.0
usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0007" at acpi0 not configured
"ACPI0004" at acpi0 not configured
"BCM2848" at acpi0 not configured
"BCM2850" at acpi0 not configured
"BCM2856" at acpi0 not configured
"BCM2845" at acpi0 not configured
"BCM2841" at acpi0 not configured
"BCM2841" at acpi0 not configured
"BCM2838" at acpi0 not configured
"BCM2839" at acpi0 not configured
"BCM2844" at acpi0 not configured
pluart0 at acpi0 URT0 addr 0xfe201000/0x1000 irq 153: console
"BCM2836" at acpi0 not configured
"BCM2EA6" at acpi0 not configured
"MSFT8000" at acpi0 not configured
"BCM2847" at acpi0 not configured
"BCM2855" at acpi0 not configured
bse0 at acpi0 ETH0 addr 0xfd580000/0x10000 irq 189: address dc:a6:32:8b:e1:b7
brgphy0 at bse0 phy 1: BCM54210E 10/100/1000baseT PHY, rev. 2
simplefb0 at mainbus0: 1920x1080, 32bpp
wsdisplay0 at simplefb0 mux 1
wsdisplay0: screen 0-5 added (std, vt100 emulation)
cpu1 at mainbus0 mpidr 1: ARM Cortex-A72 r0p3
cpu1: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu1: 1024KB 64b/line 16-way L2 cache
cpu2 at mainbus0 mpidr 2: ARM Cortex-A72 r0p3
cpu2: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu2: 1024KB 64b/line 16-way L2 cache
cpu3 at mainbus0 mpidr 3: ARM Cortex-A72 r0p3
cpu3: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
cpu3: 1024KB 64b/line 16-way L2 cache
uhub1 at uhub0 port 1 configuration 1 interface 0 "VIA Labs USB2.0 Hub" rev 2.10/4.20 addr 2
uhub2 at uhub1 port 4 configuration 1 interface 0 "Chicony Generic USB Hub" rev 1.10/1.00 addr 3
uhidev0 at uhub2 port 1 configuration 1 interface 0 "Chicony PFU-65 USB Keyboard" rev 1.10/1.00 addr 4
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0 mux 1
wskbd0: connecting to wsdisplay0
umass0 at uhub0 port 3 configuration 1 interface 0 "SanDisk Ultra Fit" rev 3.20/1.00 addr 5
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SanDisk, Ultra Fit, 1.00> removable serial.0781558381079d269c03
sd0: 29340MB, 512 bytes/sector, 60088320 sectors
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: sd0
root on sd0a (a3d7f93f60aec212.a) swap on sd0b dump on sd0b

Reply | Threaded
Open this post in threaded view
|

Re: Some Raspberry Pi4 support

Mark Kettenis
> Date: Thu, 16 Apr 2020 21:55:39 +0100
> From: Stuart Henderson <[hidden email]>
>
> On 2020/04/10 18:29, Mark Kettenis wrote:
> > real mem  = 1993285632 (1900MB)
> > avail mem = 1902022656 (1813MB)
>
> It's happy on the 4GB ones with the UEFI option toggled too (by
> default it is limited to 3GB).

I doubt that.  I think you're just lucky that the buffer cache
allocated all your memory low enough.

Still thinking about the best approach to deal with this.  There is a
1GB limit as well for the "GPU" devices such as the USB 2.0 and SDHC
controllers.  So it's either setting the DMA constraint to 3GB and
adding a bounce buffer implementation, or setting the DMA constraint
to 1GB.

> [ using 2013952 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.7-beta (GENERIC.MP) #561: Wed Apr 15 14:55:37 MDT 2020
>     [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC.MP
> real mem  = 4077580288 (3888MB)
> avail mem = 3879211008 (3699MB)
> mainbus0 at root: ACPI
> cpu0 at mainbus0 mpidr 0: ARM Cortex-A72 r0p3
> cpu0: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
> cpu0: 1024KB 64b/line 16-way L2 cache
> efi0 at mainbus0: UEFI 2.7
> efi0: https://github.com/pftf/RPi4 rev 0x10000
> smbios0 at efi0: SMBIOS 3.3.0
> smbios0: vendor https://github.com/pftf/RPi4 version "UEFI Firmware v1.8" date Apr 14 2020 21:24:48
> smbios0: Sony UK Raspberry Pi 4 Model B
> apm0 at mainbus0
> psci0 at mainbus0: PSCI 1.1, SMCCC 1.2
> ampintc0 at mainbus0 nirq 256, ncpu 4 ipi: 0, 1: "interrupt-controller"
> agtimer0 at mainbus0: tick rate 54000 KHz
> acpi0 at mainbus0: ACPI 5.1
> acpi0: sleep states
> acpi0: tables DSDT FACP CSRT DBG2 GTDT APIC PPTT SPCR BGRT
> acpi0: wakeup devices
> "BCM2849" at acpi0 not configured
> "BCM2835" at acpi0 not configured
> "BCM2854" at acpi0 not configured
> "ACPI0004" at acpi0 not configured
> xhci0 at acpi0 XHC0 addr 0x600000000/0x1000 irq 175, xHCI 1.0
> usb0 at xhci0: USB revision 3.0
> uhub0 at usb0 configuration 1 interface 0 "Generic xHCI root hub" rev 3.00/1.00 addr 1
> "ACPI0007" at acpi0 not configured
> "ACPI0007" at acpi0 not configured
> "ACPI0007" at acpi0 not configured
> "ACPI0007" at acpi0 not configured
> "ACPI0004" at acpi0 not configured
> "BCM2848" at acpi0 not configured
> "BCM2850" at acpi0 not configured
> "BCM2856" at acpi0 not configured
> "BCM2845" at acpi0 not configured
> "BCM2841" at acpi0 not configured
> "BCM2841" at acpi0 not configured
> "BCM2838" at acpi0 not configured
> "BCM2839" at acpi0 not configured
> "BCM2844" at acpi0 not configured
> pluart0 at acpi0 URT0 addr 0xfe201000/0x1000 irq 153: console
> "BCM2836" at acpi0 not configured
> "BCM2EA6" at acpi0 not configured
> "MSFT8000" at acpi0 not configured
> "BCM2847" at acpi0 not configured
> "BCM2855" at acpi0 not configured
> bse0 at acpi0 ETH0 addr 0xfd580000/0x10000 irq 189: address dc:a6:32:8b:e1:b7
> brgphy0 at bse0 phy 1: BCM54210E 10/100/1000baseT PHY, rev. 2
> simplefb0 at mainbus0: 1920x1080, 32bpp
> wsdisplay0 at simplefb0 mux 1
> wsdisplay0: screen 0-5 added (std, vt100 emulation)
> cpu1 at mainbus0 mpidr 1: ARM Cortex-A72 r0p3
> cpu1: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
> cpu1: 1024KB 64b/line 16-way L2 cache
> cpu2 at mainbus0 mpidr 2: ARM Cortex-A72 r0p3
> cpu2: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
> cpu2: 1024KB 64b/line 16-way L2 cache
> cpu3 at mainbus0 mpidr 3: ARM Cortex-A72 r0p3
> cpu3: 48KB 64b/line 3-way L1 PIPT I-cache, 32KB 64b/line 2-way L1 D-cache
> cpu3: 1024KB 64b/line 16-way L2 cache
> uhub1 at uhub0 port 1 configuration 1 interface 0 "VIA Labs USB2.0 Hub" rev 2.10/4.20 addr 2
> uhub2 at uhub1 port 4 configuration 1 interface 0 "Chicony Generic USB Hub" rev 1.10/1.00 addr 3
> uhidev0 at uhub2 port 1 configuration 1 interface 0 "Chicony PFU-65 USB Keyboard" rev 1.10/1.00 addr 4
> uhidev0: iclass 3/1
> ukbd0 at uhidev0: 8 variable keys, 6 key codes
> wskbd0 at ukbd0 mux 1
> wskbd0: connecting to wsdisplay0
> umass0 at uhub0 port 3 configuration 1 interface 0 "SanDisk Ultra Fit" rev 3.20/1.00 addr 5
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, initiator 0
> sd0 at scsibus0 targ 1 lun 0: <SanDisk, Ultra Fit, 1.00> removable serial.0781558381079d269c03
> sd0: 29340MB, 512 bytes/sector, 60088320 sectors
> vscsi0 at root
> scsibus1 at vscsi0: 256 targets
> softraid0 at root
> scsibus2 at softraid0: 256 targets
> bootfile: sd0a:/bsd
> boot device: sd0
> root on sd0a (a3d7f93f60aec212.a) swap on sd0b dump on sd0b
>
>