Re: When will FreeBSD support RPI5?

From: Doug Rabson <dfr_at_rabson.org>
Date: Sun, 14 Jan 2024 13:41:34 UTC
On Sat, 13 Jan 2024 at 19:22, Jesper Schmitz Mouridsen <jsm@freebsd.org>
wrote:

>
> On 13.01.2024 19.32, Mark Millard wrote:
> > On Jan 13, 2024, at 07:38, Doug Rabson <dfr@rabson.org> wrote:
> >
> >> Getting back to the RPI 5, with a tweak to
> arm/broadcom/bcm2835bcm2835_vcbus.c to treat the memory config the same as
> RPI 4 and to dev/sdhci/sdhci_fdt.c to treat the RPI 5 sdhci controllers as
> generic, I can boot to multiuser mode using the EDK2 firmware from
> https://github.com/worproject/rpi5-uefi with ACPI/Device Tree mode set to
> Both.
> > What does FreeBSD do with "Both"? Does it actually use some ACPI
> > and some Device Tree? Or does it just use ACPI? Does your
> > combination do anything different than just using ACPI?
>
> How does the sd card show up? BTW i did put some stuff here [1]
>
> I could not get bcm_dma to work anyone planning on getting that to work?
> it should be similar to 2711 documented in [2]
>

I haven't tried to do anything with bcm_dma - this is my diff (against 14.0
but I'll probably move over to 15-current soon). I used the generic SDHCI
driver in sys/dev/sdhci and it seems to work very well with the RPI 5:

diff --git a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c
b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c
index 88b54467e0c8..d996831816a6 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c
@@ -174,6 +174,11 @@ static struct bcm283x_memory_soc_cfg {
                .soc_compat = "brcm,bcm2838",
                .busdma_lowaddr = BCM2838_PERIPH_MAXADDR,
        },
+       {
+               .memmap = bcm2838_memmap,
+               .soc_compat = "brcm,bcm2712",
+               .busdma_lowaddr = BCM2838_PERIPH_MAXADDR,
+       },
 };

 static struct bcm283x_memory_soc_cfg *booted_soc_memcfg;
diff --git a/sys/dev/sdhci/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c
index 4a355d6514ad..8f2ccfc98859 100644
--- a/sys/dev/sdhci/sdhci_fdt.c
+++ b/sys/dev/sdhci/sdhci_fdt.c
@@ -124,6 +124,7 @@ static struct ofw_compat_data compat_data[] = {
        { "xlnx,zy7_sdhci",             SDHCI_FDT_XLNX_ZY7 },
        { "rockchip,rk3568-dwcmshc",    SDHCI_FDT_RK3568 },
        { "xlnx,zynqmp-8.9a",           SDHCI_FDT_XLNX_ZMP },
+       { "brcm,bcm2712-sdhci",         SDHCI_FDT_GENERIC },
        { NULL, 0 }
 };



>
>