From nobody Mon Feb 03 11:20:23 2025 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YmkZ15q82z5n0YM for ; Mon, 03 Feb 2025 11:20:25 +0000 (UTC) (envelope-from SRS0=kvxC=U2=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4YmkZ10jkNz3jZv for ; Mon, 03 Feb 2025 11:20:25 +0000 (UTC) (envelope-from SRS0=kvxC=U2=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Date: Mon, 3 Feb 2025 12:20:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1738581623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jqvr3pHtTmQLu/YLm54jrfu5pKw76zTXnXON/faE/eI=; b=kUJlkOpCjst0uorfYJzm4gCtVEq0GD5wOMr8NcxQJtAmOfgkUiw1cwuvDvrvk3TqxiYCiI ZSBGyNVnADKkA7g25g4QjY9QM7PT2p9PWNKg/jZjqls8le12ckdbkzrBacVhjUhUJRd61Z uWlI5accP4XCSRilNzoC/wtPS2g5vCg6fWxp1PwKpguhSTUjLJ4ZZCiNPsMGEuI4MtRi/z dv2ZrhE69/Rz/GlkxS1rCu/1sijHN0+mo9ATZZgcmTlkXvk2lk84XPWnQMDv/7EduSX2C4 XgDGoT9wfI1Xw+Yu9Jf3sORxTSvo7Goh3sJ1+6aeTDkASrpkT9Tsql8E38IJww== From: Ronald Klop To: =?UTF-8?Q?Klaus_K=C3=BCchemann?= Cc: freebsd-arm@freebsd.org Message-ID: <1780949667.5141.1738581623154@localhost> In-Reply-To: <0C65C3F9-50D3-4B27-BB72-6D1B579AF83A@googlemail.com> References: <1209610970.15723.1738490182716@localhost> <0C65C3F9-50D3-4B27-BB72-6D1B579AF83A@googlemail.com> Subject: Re: you`ll have to hack u-boot&kernel drivers Re: RPI5 16GB panic on boot List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5140_2134093021.1738581623146" X-Mailer: Realworks (736.123) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4YmkZ10jkNz3jZv X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] ------=_Part_5140_2134093021.1738581623146 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Klaus, I was under the impression that the pre-16GB RPI5 were booting using ACPI d= evice enumeration. (https://wiki.freebsd.org/arm/Raspberry%20Pi%205) That i= s why I hoped the 16GB version to work similarly. I don't have a personal preference for one way or the other (ACPI vs DTB). Is your work available in a public repository somewhere? So I could try and= see if I can help somehow. Regards, Ronald. =20 Van: "Klaus K=C3=BCchemann" Datum: zondag, 2 februari 2025 18:06 Aan: Ronald Klop , freebsd-arm@freebsd.org Onderwerp: you`ll have to hack u-boot&kernel drivers Re: RPI5 16GB panic on= boot >=20 >=20 > > Am 02.02.2025 um 10:56 schrieb Ronald Klop : > > > > > > No valid device tree blob found! > > >=20 >=20 > For FreeBSD go the u-boot fdt-based way ! ( since all existing drivers re= ly on that).. > A device tree blob( dtb) is a compiled binary which is read in by u-boot = , > While a device tree source( dts) can be compiled into u-boot`kernel direc= tly=E2=80=A6. >=20 > Some steps further here. I just show you the things I=E2=80=99ve already = hacked ( in u-boot & fbsd-kernel), > Not showing you the things which have to be future-hacked into the kernel= :-), > it=E2=80=99ll be a massive hack because e.g because the RP1 chip has man= y things hanging behind pcie, > I have currently pcie detected in boot but there`s something more to do/= hack regarding DMA=E2=80=A6.. and so further and so on : >=20 > =E2=80=A6 > 4.05 dt-match: compatible: brcm,bcm2712 match: brcm,bcm2712=E2=80=A6. > =E2=80=A6 4.95 Loading 'bcm2712-rpi-cm5-cm5io.dtb' to 0x00000000 offset 0= x100 > 5.06 Read bcm2712-rpi-cm5-cm5io.dtb bytes 80587 hnd 0x198b > =E2=80=A6 5.84 MESS:00:00:05.184071:0: Loaded overlay =E2=80=9Adwc2=E2= =80=98=E2=80=A6 > 5.04 Loading 'u-boot.bin' to 0x00000000 offset 0x200000,, > 5.39 Read u-boot.bin bytes 694000 hnd 0x148d=E2=80=A6 > =E2=80=A6. > =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94 > U-Boot 2025.01 (Jan 19 2025 - 06:10:39 +0100) >=20 > DRAM: 1020 MiB (effective 4 GiB) > RPI: Board rev 0x18 outside known range > RPI Unknown model (0xc04180) > Core: 25 devices, 12 uclasses, devicetree: board > MMC: mmc@fff000: 0, mmc@1100000: 1 > Loading Environment from FAT... ** Bad device specification mmc 1 ** > In: serial,usbkbd > Out: serial,vidconsole > Err: serial,vidconsole > Net: No ethernet found. >=20 > starting USB... > Bus usb@480000: USB DWC2 > scanning bus usb@480000 for devices... 1 USB Device(s) found > scanning usb for storage devices... 0 Storage Device(s) found > Hit any key to stop autoboot: 0 Cannot persist EFI variables without sy= stem partition > ** Booting bootflow '' with efi_mgr > Booting: mmc 0 >=20 > =E2=80=94=E2=80=94=E2=80=94 > Consoles: EFI console =20 > Reading loader env vars from /efi/freebsd/loader.env > Setting currdev to disk0p1: > FreeBSD/arm64 EFI loader, Revision 3.0 > (Sat Feb 1 03:46:15 UTC 2025 root@fbsd5pro) >=20 > Command line arguments: loader.efi > Image base: 0x3e54d000 > EFI version: 2.100 > EFI Firmware: Das U-Boot (rev 8229.256) > Console: efi,comconsole (0) > Load Path: /\EFI\BOOT\BOOTAA64.EFI > Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000= 000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000004000000)/eMMC(0)/e= MMC(0)/HD(1,0x01,0,0x800,0x19000) > BootCurrent: 0000 > BootOrder: 0000[*] > BootInfo Path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,00000000000= 00000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000004000000)/eMMC(0)= /eMMC(0) > Ignoring Boot0000: Only one DP found > Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)= /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000004000000)/eMMC(0)/eMMC(= 0)/HD(1,0x01,0,0x800,0x19000) > Setting currdev to disk0p1: > Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/Ven= Hw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000004000000)/eMMC(0)/eMMC(0)/H= D(2,0x01,0,0x19800,0x9e6800) > Setting currdev to disk0p2: > Loading /boot/defaults/loader.conf > Loading /boot/defaults/loader.conf > Loading /boot/device.hints > Loading /boot/loader.conf > Loading /boot/loader.conf.local > / >=20 > =E2=80=94=E2=80=94=E2=80=94=E2=80=94 >=20 > Loading kernel=E2=80=A6 > =E2=80=94 >=20 > Booting [/boot/kernel/kernel]... =20 > Using DTB provided by EFI at 0x3e6da000. > Loading splash ok > ---<>--- > GDB: no debug ports present > KDB: debugger backends: ddb > KDB: current backend: ddb > WARNING: Cannot find freebsd,dts-version property, cannot check DTB compl= iance > Copyright (c) 1992-2025 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 15.0-CURRENT #3: Sat Feb 1 16:02:48 UTC 2025 > root@fbsd5pro:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC arm64 > FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git ll= vmorg-19.1.7-0-gcd708029e0b2) > WARNING: WITNESS option enabled, expect reduced performance. > VT: init without driver. > real memory =3D 4290248704 (4091 MB) > avail memory =3D 4152508416 (3960 MB) > Starting CPU 1 (100) > Starting CPU 2 (200) > Starting CPU 3 (300) > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > random: unblocking device. > random: entropy device external interface > kbd0 at kbdmux0 > ofwbus0: > simplebus0: on ofwbus0 > regfix0: on simplebus0 > regfix1: on simplebus0 > simplebus1: on ofwbus0 > ofw_clkbus0: on ofwbus0 >=20 > =E2=80=94=E2=80=94=E2=80=94 >=20 > simple_mfd0: mem 0x7d542000-0x7d542= eff on simplebus0 > bcm2835_firmware0: on simplebus0 > ofw_clkbus1: on bcm2835_firmware0 > =E2=80=94 >=20 > psci0: on ofwbus0 > smccc0: on psci0 >=20 > =E2=80=94=E2=80=94 > gic0: mem 0x107fff9000-0x107fff9fff,0x= 107fffa000-0x107fffbfff,0x107fffc000-0x107fffdfff,0x107fffe000-0x107fffffff= irq 86 on simplebus1 > gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 320 > =E2=80=94 > usbus1: 480Mbps High Speed USB v2.0 > ugen1.1: at usbus1 > uhub0 on usbus1 > uhub0: on usbus1 > bcm2835_cpufreq0: ARM 1500MHz, Core 500MHz, SDRAM 0MHz, Turbo OFF > CPU 0: ARM Cortex-A76 r4p1 affinity: 0 0 > Cache Type =3D > Instruction Set Attributes 0 =3D > Instruction Set Attributes 1 =3D > Instruction Set Attributes 2 =3D <> > Processor Features 0 =3D > Processor Features 1 =3D > Processor Features 2 =3D <> > Memory Model Features 0 =3D > Memory Model Features 1 =3D > Memory Model Features 2 =3D <32bit CCIDX,48bit VA,IESB,UAO,CnP> > Memory Model Features 3 =3D <> > Memory Model Features 4 =3D <> > Debug Features 0 =3D > Debug Features 1 =3D <> > Auxiliary Features 0 =3D <> > Auxiliary Features 1 =3D <> > AArch32 Instruction Set Attributes 5 =3D > AArch32 Media and VFP Features 0 =3D > AArch32 Media and VFP Features 1 =3D > CPU 1: ARM Cortex-A76 r4p1 affinity: 1 0 > CPU 2: ARM Cortex-A76 r4p1 affinity: 2 0 > CPU 3: ARM Cortex-A76 r4p1 affinity: 3 0 > gic0: using for IPIs > Release APs...Trying to mount root from ufs:/dev/ufs/rootfs [rw].. > --- > =20 >=20 >=20 >=20 =20 ------=_Part_5140_2134093021.1738581623146 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Klaus,

I was under the impression that the pre-16GB RPI5 were booting using ACPI d= evice enumeration. (https://wiki.freebsd.org/arm/Raspberry%20Pi%205) That is why I hop= ed the 16GB version to work similarly.
I don't have a personal preference for one way or the other (ACPI vs DTB).<= br>
Is your work available in a public repository somewhere? So I could try and= see if I can help somehow.

Regards,
Ronald.

 

Van: "Klaus K=C3=BCchemann" <maciphone2@googlemail.c= om>
Datum: zondag, 2 februari 2025 18:06
Aan: Ronald Klop <ronald-lists@klop.ws>, freebsd-arm= @freebsd.org
Onderwerp: you`ll have to hack u-boot&kernel drivers R= e: RPI5 16GB panic on boot



> Am 02.02.2025 um 10:56 schrieb Ronald Klop <ronald-lists@klop.ws>= ;:
>
>
> No valid device tree blob found!
>


For FreeBSD go the u-boot fdt-based way ! ( since all existing drivers rely= on that)..
A device tree blob( dtb) is a compiled binary which is read in by u-boot ,<= br> While a device tree source( dts) can be compiled into u-boot`kernel directl= y=E2=80=A6.

Some steps further here. I just show you the things I=E2=80=99ve already ha= cked ( in u-boot & fbsd-kernel),
Not showing you the things which have to be future-hacked into the kernel:-= ),
 it=E2=80=99ll be a massive hack because e.g because the RP1 chip has = many things  hanging behind pcie,
I have currently  pcie detected in boot but there`s something more to = do/hack regarding DMA=E2=80=A6.. and so further and so on   :

=E2=80=A6
  4.05 dt-match: compatible: brcm,bcm2712 match: brcm,bcm2712=E2= =80=A6.
=E2=80=A6 4.95 Loading 'bcm2712-rpi-cm5-cm5io.dtb' to 0x00000000 offset 0x1= 00
  5.06 Read bcm2712-rpi-cm5-cm5io.dtb bytes    805= 87 hnd 0x198b
=E2=80=A6   5.84 MESS:00:00:05.184071:0: Loaded overlay =E2=80=9A= dwc2=E2=80=98=E2=80=A6
  5.04 Loading 'u-boot.bin' to 0x00000000 offset 0x200000,,
  5.39 Read u-boot.bin bytes   694000 hnd 0x148d=E2=80= =A6
=E2=80=A6.
=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94
U-Boot 2025.01 (Jan 19 2025 - 06:10:39 +0100)

DRAM:  1020 MiB (effective 4 GiB)
RPI: Board rev 0x18 outside known range
RPI Unknown model (0xc04180)
Core:  25 devices, 12 uclasses, devicetree: board
MMC:   mmc@fff000: 0, mmc@1100000: 1
Loading Environment from FAT... ** Bad device specification mmc 1 **
In:    serial,usbkbd
Out:   serial,vidconsole
Err:   serial,vidconsole
Net:   No ethernet found.

starting USB...
Bus usb@480000: USB DWC2
scanning bus usb@480000 for devices... 1 USB Device(s) found
       scanning usb for storage devices.= .. 0 Storage Device(s) found
Hit any key to stop autoboot:  0  Cannot persist EFI variables wi= thout system partition
** Booting bootflow '<NULL>' with efi_mgr
Booting: mmc 0

=E2=80=94=E2=80=94=E2=80=94
Consoles: EFI console  
    Reading loader env vars from /efi/freebsd/loader.en= v
Setting currdev to disk0p1:
FreeBSD/arm64 EFI loader, Revision 3.0
(Sat Feb  1 03:46:15 UTC 2025 root@fbsd5pro)

   Command line arguments: loader.efi
   Image base: 0x3e54d000
   EFI version: 2.100
   EFI Firmware: Das U-Boot (rev 8229.256)
   Console: efi,comconsole (0)
   Load Path: /\EFI\BOOT\BOOTAA64.EFI
   Load Device: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,= 0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d000000040000= 00)/eMMC(0)/eMMC(0)/HD(1,0x01,0,0x800,0x19000)
   BootCurrent: 0000
   BootOrder: 0000[*]
   BootInfo Path: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628= b,0000000000000000)/VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d0000000400= 0000)/eMMC(0)/eMMC(0)
Ignoring Boot0000: Only one DP found
Trying ESP: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/V= enHw(e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000004000000)/eMMC(0)/eMMC(0)= /HD(1,0x01,0,0x800,0x19000)
Setting currdev to disk0p1:
Trying: /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b,0000000000000000)/VenHw= (e61d73b9-a384-4acc-aeab-82e828f3628b,6d00000004000000)/eMMC(0)/eMMC(0)/HD(= 2,0x01,0,0x19800,0x9e6800)
Setting currdev to disk0p2:
Loading /boot/defaults/loader.conf
Loading /boot/defaults/loader.conf
Loading /boot/device.hints
Loading /boot/loader.conf
Loading /boot/loader.conf.local
/

=E2=80=94=E2=80=94=E2=80=94=E2=80=94

Loading kernel=E2=80=A6
=E2=80=94

Booting [/boot/kernel/kernel]...        =        
Using DTB provided by EFI at 0x3e6da000.
Loading splash ok
---<<BOOT>>---
GDB: no debug ports present
KDB: debugger backends: ddb
KDB: current backend: ddb
WARNING: Cannot find freebsd,dts-version property, cannot check DTB complia= nce
Copyright (c) 1992-2025 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 15.0-CURRENT #3: Sat Feb  1 16:02:48 UTC 2025
    root@fbsd5pro:/usr/obj/usr/src/arm64.aarch64/sys/GE= NERIC arm64
FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd70= 8029e0b2)
WARNING: WITNESS option enabled, expect reduced performance.
VT: init without driver.
real memory  =3D 4290248704 (4091 MB)
avail memory =3D 4152508416 (3960 MB)
Starting CPU 1 (100)
Starting CPU 2 (200)
Starting CPU 3 (300)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
random: unblocking device.
random: entropy device external interface
kbd0 at kbdmux0
ofwbus0: <Open Firmware Device Tree>
simplebus0: <Flattened device tree simple bus> on ofwbus0
regfix0: <Fixed Regulator> on simplebus0
regfix1: <Fixed Regulator> on simplebus0
simplebus1: <Flattened device tree simple bus> on ofwbus0
ofw_clkbus0: <OFW clocks bus> on ofwbus0

=E2=80=94=E2=80=94=E2=80=94

simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0x7d542000-0x7= d542eff on simplebus0
bcm2835_firmware0: <BCM2835 Firmware> on simplebus0
ofw_clkbus1: <OFW clocks bus> on bcm2835_firmware0
=E2=80=94

psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0 smccc0: <ARM SMCCC v1.2> on psci0

=E2=80=94=E2=80=94
gic0: <ARM Generic Interrupt Controller> mem 0x107fff9000-0x107fff9ff= f,0x107fffa000-0x107fffbfff,0x107fffc000-0x107fffdfff,0x107fffe000-0x107fff= ffff irq 86 on simplebus1
gic0: pn 0x2, arch 0x2, rev 0x1, implementer 0x43b irqs 320
=E2=80=94
usbus1: 480Mbps High Speed USB v2.0
ugen1.1: <DWCOTG OTG Root HUB> at usbus1
uhub0 on usbus1
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usb= us1
bcm2835_cpufreq0: ARM 1500MHz, Core 500MHz, SDRAM 0MHz, Turbo OFF
CPU  0: ARM Cortex-A76 r4p1 affinity:  0  0
            &nb= sp;      Cache Type =3D <IDC,64 byte CWG,6= 4 byte ERG,64 byte D-cacheline,PIPT I-cache,64 byte I-cacheline>
 Instruction Set Attributes 0 =3D <DP,RDM,Atomic,CRC32,SHA2,SHA1,AE= S+PMULL>
 Instruction Set Attributes 1 =3D <RCPC-8.3,DCPoP>
 Instruction Set Attributes 2 =3D <>
         Processor Features 0 = =3D <CSV3,CSV2,RAS,AdvSIMD+HP,FP+HP,EL3,EL2,EL1,EL0 32>
         Processor Features 1 = =3D <PSTATE.SSBS>
         Processor Features 2 = =3D <>
      Memory Model Features 0 =3D <TGran4,= TGran64,TGran16,SNSMem,BigEnd,16bit ASID,1TB PA>
      Memory Model Features 1 =3D <XNX,PAN= +ATS1E1,LO,HPD+TTPBHA,VH,16bit VMID,HAF+DS>
      Memory Model Features 2 =3D <32bit C= CIDX,48bit VA,IESB,UAO,CnP>
      Memory Model Features 3 =3D <>       Memory Model Features 4 =3D <>             &nb= sp;Debug Features 0 =3D <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoi= nts,PMUv3p1,Debugv8p2>
            &nb= sp;Debug Features 1 =3D <>
         Auxiliary Features 0 = =3D <>
         Auxiliary Features 1 = =3D <>
AArch32 Instruction Set Attributes 5 =3D <RDM,CRC32,SHA2,SHA1,AES+VMULL,= SEVL>
AArch32 Media and VFP Features 0 =3D <FPRound,FPSqrt,FPDivide,DP VFPv3+v= 4,SP VFPv3+v4,AdvSIMD>
AArch32 Media and VFP Features 1 =3D <SIMDFMAC,FPHP Arith,SIMDHP Arith,S= IMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ>
CPU  1: ARM Cortex-A76 r4p1 affinity:  1  0
CPU  2: ARM Cortex-A76 r4p1 affinity:  2  0
CPU  3: ARM Cortex-A76 r4p1 affinity:  3  0
gic0: using for IPIs
Release APs...Trying to mount root from ufs:/dev/ufs/rootfs [rw]..
---
 


  ------=_Part_5140_2134093021.1738581623146--