[Bug 261147] sysutils/rpi-firmware/ RPI Zero 2 W boot files

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 06 Jan 2023 22:35:05 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261147

Mark Millard <marklmi26-fbsd@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marklmi26-fbsd@yahoo.com

--- Comment #8 from Mark Millard <marklmi26-fbsd@yahoo.com> ---
(In reply to Jürgen Weber from comment #7)

I expect that you likely need to get a serial console going and
to capture and report its output in order to provide enough
context to be likely to get help.

Going in another direction . . .

One possible contribution is being sure that bcm_dma has been
initialized in an earlier pass in order to avoid
used-before-defined issues that happens in some vintages of
some .dtb files for the kernel as-it is now.

main [so: 14] has <?>_devclass useage removed so main vs.
stable/13 and the like need separate patches to make bcm_dma
initialize in an earlier pass on the fdt.

# git -C /usr/main-src/ diff sys/arm/broadcom/bcm2835/bcm2835_dma.c
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c
b/sys/arm/broadcom/bcm2835/bcm2835_dma.c
index 5f9ecb0b7981..d901447df1e9 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c
@@ -764,5 +764,6 @@ static driver_t bcm_dma_driver = {
        sizeof(struct bcm_dma_softc),
 };

-DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0);
+EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0,
+    BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
 MODULE_VERSION(bcm_dma, 1);

# git -C /usr/13S-src/ diff sys/arm/broadcom/bcm2835/bcm2835_dma.c
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c
b/sys/arm/broadcom/bcm2835/bcm2835_dma.c
index cab8639bb607..6d521d6dcace 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c
@@ -766,5 +766,6 @@ static driver_t bcm_dma_driver = {

 static devclass_t bcm_dma_devclass;

-DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, bcm_dma_devclass, 0, 0);
+EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, bcm_dma_devclass,
+    0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE);
 MODULE_VERSION(bcm_dma, 1);

I am only now starting a round of updates that would apply
such patching to all the RPi*'s that I have access to. (Not
much variety in type, however: all RPi4B's, either 4 GiByte
Rev 1.1's or 8 GiByte Rev 1.4's/1.5's. The Rev 1.5 is also
a "C0T" part instead of a "B0T" part. But for what I've
tried so far, I've been able to boot the more recent RPi*
firmware vintages that I've tried based on bcm_dma having
been initiated before it was used.

Note: It took me months to discover EARLY_DRIVER_MODULE and
that it was appropriate for needing a resource initialized
earlier for fdt based booting. I can not make any claim of
expertise in the area, just of experimentation. So someone
knowledgable would need to judge how appropriate the details
are as the technique to deal with the kind of problem it
avoids.

-- 
You are receiving this mail because:
You are on the CC list for the bug.