Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jan 2024 13:41:34 +0000
From:      Doug Rabson <dfr@rabson.org>
To:        Jesper Schmitz Mouridsen <jsm@freebsd.org>
Cc:        Mark Millard <marklmi@yahoo.com>, John Kennedy <warlock@phouka.net>, ykla <yklaxds@gmail.com>,  FreeBSD ARM List <freebsd-arm@freebsd.org>
Subject:   Re: When will FreeBSD support RPI5?
Message-ID:  <CACA0VUhvy=gyWEwERn2-3a2DFqgXUt27BuYZAbehwJh8va533w@mail.gmail.com>
In-Reply-To: <9e45c7d7-450c-48e5-8101-c6ea5cb3a023@FreeBSD.org>
References:  <CA%2BPGaYC6__AZUgHqfv3PO-o=7FnEzRzTPGPhMuahFNdcN0D69A@mail.gmail.com> <ddbf131c-1f2c-424b-9a3f-54ded16c5123@FreeBSD.org> <ZZHC_SjrPgs3DMKe@phouka1.phouka.net> <5a39810c-5fd8-4969-a222-2561b050b035@FreeBSD.org> <CACA0VUjoTTVje7tQe%2BVHXPco_xs4C8vSB3P3eDnhuYJYSqc7Sw@mail.gmail.com> <A2CA16F2-9894-41F2-8035-A5E8BE271B58@yahoo.com> <CACA0VUg7XHtQ7nviXVUZ_dZGaPe2uhbT-eGRbMAOajqZLGDmew@mail.gmail.com> <ECBFBAEF-C35B-4C68-B9BF-C3B62E5A4DFE@yahoo.com> <347FE009-A470-4765-A9B9-7C9AB5E954DA@yahoo.com> <CACA0VUh_X5nudWGOCeupW_34=aUewmwvOWmp61ONm=PtNr9wFw@mail.gmail.com> <76FA010A-338F-4E32-B381-37C7BA63CAFC@yahoo.com> <9e45c7d7-450c-48e5-8101-c6ea5cb3a023@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000ca324c060ee80e74
Content-Type: text/plain; charset="UTF-8"

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 }
 };



>
>

--000000000000ca324c060ee80e74
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Sat, 13 Jan 2024 at 19:22, Jesper =
Schmitz Mouridsen &lt;<a href=3D"mailto:jsm@freebsd.org">jsm@freebsd.org</a=
>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-co=
lor:rgb(204,204,204);padding-left:1ex"><br>
On 13.01.2024 19.32, Mark Millard wrote:<br>
&gt; On Jan 13, 2024, at 07:38, Doug Rabson &lt;<a href=3D"mailto:dfr@rabso=
n.org" target=3D"_blank">dfr@rabson.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Getting back to the RPI 5, with a tweak to arm/broadcom/bcm2835bcm=
2835_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 <a href=3D"https://github.com/w=
orproject/rpi5-uefi" rel=3D"noreferrer" target=3D"_blank">https://github.co=
m/worproject/rpi5-uefi</a> with ACPI/Device Tree mode set to Both.<br>
&gt; What does FreeBSD do with &quot;Both&quot;? Does it actually use some =
ACPI<br>
&gt; and some Device Tree? Or does it just use ACPI? Does your<br>
&gt; combination do anything different than just using ACPI?<br>
<br>
How does the sd card show up? BTW i did put some stuff here [1]<br>
<br>
I could not get bcm_dma to work anyone planning on getting that to work? <b=
r>
it should be similar to 2711 documented in [2]<br></blockquote><div><br></d=
iv><div>I haven&#39;t tried to do anything with bcm_dma - this is my diff (=
against=C2=A014.0 but I&#39;ll probably move over to 15-current soon). I us=
ed the generic SDHCI driver in sys/dev/sdhci and it seems to work very well=
 with the RPI 5:</div><div><br></div></div><blockquote style=3D"margin:0 0 =
0 40px;border:none;padding:0px"><div class=3D"gmail_quote"><div>diff --git =
a/sys/arm/broadcom/bcm2835/bcm2835_vcbus.c b/sys/arm/broadcom/bcm2835/bcm28=
35_vcbus.c<br>index 88b54467e0c8..d996831816a6 100644<br>--- a/sys/arm/broa=
dcom/bcm2835/bcm2835_vcbus.c<br>+++ b/sys/arm/broadcom/bcm2835/bcm2835_vcbu=
s.c<br>@@ -174,6 +174,11 @@ static struct bcm283x_memory_soc_cfg {<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .soc_compat =3D &quot;=
brcm,bcm2838&quot;,<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 .busdma_lowaddr =3D BCM2838_PERIPH_MAXADDR,<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 },<br>+ =C2=A0 =C2=A0 =C2=A0 {<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 .memmap =3D bcm2838_memmap,<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 .soc_compat =3D &quot;brcm,bcm2712&quot;,<br>+ =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .busdma_lowaddr =3D BCM2838_PERIP=
H_MAXADDR,<br>+ =C2=A0 =C2=A0 =C2=A0 },<br>=C2=A0};<br><br>=C2=A0static str=
uct bcm283x_memory_soc_cfg *booted_soc_memcfg;<br>diff --git a/sys/dev/sdhc=
i/sdhci_fdt.c b/sys/dev/sdhci/sdhci_fdt.c<br>index 4a355d6514ad..8f2ccfc988=
59 100644<br>--- a/sys/dev/sdhci/sdhci_fdt.c<br>+++ b/sys/dev/sdhci/sdhci_f=
dt.c<br>@@ -124,6 +124,7 @@ static struct ofw_compat_data compat_data[] =3D=
 {<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 { &quot;xlnx,zy7_sdhci&quot;, =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SDHCI_FDT_XLNX_ZY7 },<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 { &quot;rockchip,rk3568-dwcmshc&quot;, =C2=A0 =C2=A0SDHCI_FDT_RK=
3568 },<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 { &quot;xlnx,zynqmp-8.9a&quot;, =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SDHCI_FDT_XLNX_ZMP },<br>+ =C2=A0 =C2=A0 =
=C2=A0 { &quot;brcm,bcm2712-sdhci&quot;, =C2=A0 =C2=A0 =C2=A0 =C2=A0 SDHCI_=
FDT_GENERIC },<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 { NULL, 0 }<br>=C2=A0};<br></=
div></div></blockquote><div class=3D"gmail_quote"><div>=C2=A0</div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-wid=
th:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-l=
eft:1ex"><br>
</blockquote></div></div>

--000000000000ca324c060ee80e74--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACA0VUhvy=gyWEwERn2-3a2DFqgXUt27BuYZAbehwJh8va533w>