Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2024 16:36:40 +0000
From:      Doug Rabson <dfr@rabson.org>
To:        Emmanuel Vadot <manu@bidouilliste.com>
Cc:        Mike Karels <mike@karels.net>, Mark Millard <marklmi@yahoo.com>,  FreeBSD ARM List <freebsd-arm@freebsd.org>
Subject:   Re: When will FreeBSD support RPI5?
Message-ID:  <CACA0VUjARYPc-5hrv28mhq_SUEda=erRfA1u1B6%2By-U3EYdxoQ@mail.gmail.com>
In-Reply-To: <20240116173205.41b4e0ebaacc42581a0d408d@bidouilliste.com>
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> <1C02D1FA-5BF0-4C82-AD0E-6F9E5EB8A0B9@karels.net> <CACA0VUgYZk1yqOVnEGGdjyX9GZyOV6XjwbjdZq8S9h-nz7jwCg@mail.gmail.com> <20240116173205.41b4e0ebaacc42581a0d408d@bidouilliste.com>

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

On Tue, 16 Jan 2024 at 16:32, Emmanuel Vadot <manu@bidouilliste.com> wrote:

> On Tue, 16 Jan 2024 14:57:40 +0000
> Doug Rabson <dfr@rabson.org> wrote:
>
> > On Sat, 13 Jan 2024 at 19:05, Mike Karels <mike@karels.net> wrote:
> >
> > > On 13 Jan 2024, at 12: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?
> > > >
> > > >> This does not have working PCIe or ethernet yet - I think ethernet
> > > ought to work since we seem to have a matching driver in the tree in
> > > dev/cadence.
> > > >
> > > > Sounds like the same status as booting just ACPI with no such
> > > > adjustments too bcm2835bcm2835_vcbus.c or sdhci_fdt.c ?
> > > >
> > > > I think Mike Karels plans on investigating getting Ethernet
> > > > going based on cgem . I've no clue if this is ACPI, DeviceTree,
> > > > or both.
> > >
> > > The cadence/cgem driver uses FDT.  I haven't looked at details yet.
> The
> > > addition
> > > might be as simple as adding a compat string.  Hopefully it doesn't
> > > require major
> > > surgery.  I just ordered an RPi 5 (8 GB); it will take a while to be
> > > delivered.
> > >
> >
> > The existing driver has the correct compat string but we don't get that
> far
> > since the rp1 node doesn't get probed and attached. This node is nested
> > under pcie@120000 and the whole subtree never gets explored.
> Interestingly,
> > if I hack the 2711 driver a little (based on reading Linux sources), I
> can
> > get that to attach and the rp1 southbridge is visible on the PCI bus with
> > vendor id 0x1de4, device id 0x0001. I made a stub driver for it but that
> > isn't particularly helpful since we need an FDT device to get simplebus
> to
> > attach and discover all the rp1 sub-devices.
>
>  Why is there FDT children under a pci device ???
>

That's a very good question and I don't have an answer. This is just how
the DTB is structured:

                pcie@120000 {

                        compatible = "brcm,bcm2712-pcie";
                        ...
                        rp1 {

                                compatible = "simple-bus";

--000000000000a282b4060f12bcbf
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 Tue, 16 Jan 2024 at 16:32, Emmanue=
l Vadot &lt;<a href=3D"mailto:manu@bidouilliste.com">manu@bidouilliste.com<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-=
color:rgb(204,204,204);padding-left:1ex">On Tue, 16 Jan 2024 14:57:40 +0000=
<br>
Doug Rabson &lt;<a href=3D"mailto:dfr@rabson.org" target=3D"_blank">dfr@rab=
son.org</a>&gt; wrote:<br>
<br>
&gt; On Sat, 13 Jan 2024 at 19:05, Mike Karels &lt;<a href=3D"mailto:mike@k=
arels.net" target=3D"_blank">mike@karels.net</a>&gt; wrote:<br>
&gt; <br>
&gt; &gt; On 13 Jan 2024, at 12:32, Mark Millard wrote:<br>
&gt; &gt;<br>
&gt; &gt; &gt; On Jan 13, 2024, at 07:38, Doug Rabson &lt;<a href=3D"mailto=
:dfr@rabson.org" target=3D"_blank">dfr@rabson.org</a>&gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&gt; Getting back to the RPI 5, with a tweak to<br>
&gt; &gt; arm/broadcom/bcm2835bcm2835_vcbus.c to treat the memory config th=
e same as<br>
&gt; &gt; RPI 4 and to dev/sdhci/sdhci_fdt.c to treat the RPI 5 sdhci contr=
ollers as<br>
&gt; &gt; generic, I can boot to multiuser mode using the EDK2 firmware fro=
m<br>
&gt; &gt; <a href=3D"https://github.com/worproject/rpi5-uefi" rel=3D"norefe=
rrer" target=3D"_blank">https://github.com/worproject/rpi5-uefi</a>; with AC=
PI/Device Tree mode set to<br>
&gt; &gt; Both.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; What does FreeBSD do with &quot;Both&quot;? Does it actually=
 use some ACPI<br>
&gt; &gt; &gt; and some Device Tree? Or does it just use ACPI? Does your<br=
>
&gt; &gt; &gt; combination do anything different than just using ACPI?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&gt; This does not have working PCIe or ethernet yet - I thin=
k ethernet<br>
&gt; &gt; ought to work since we seem to have a matching driver in the tree=
 in<br>
&gt; &gt; dev/cadence.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Sounds like the same status as booting just ACPI with no suc=
h<br>
&gt; &gt; &gt; adjustments too bcm2835bcm2835_vcbus.c or sdhci_fdt.c ?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I think Mike Karels plans on investigating getting Ethernet<=
br>
&gt; &gt; &gt; going based on cgem . I&#39;ve no clue if this is ACPI, Devi=
ceTree,<br>
&gt; &gt; &gt; or both.<br>
&gt; &gt;<br>
&gt; &gt; The cadence/cgem driver uses FDT.=C2=A0 I haven&#39;t looked at d=
etails yet.=C2=A0 The<br>
&gt; &gt; addition<br>
&gt; &gt; might be as simple as adding a compat string.=C2=A0 Hopefully it =
doesn&#39;t<br>
&gt; &gt; require major<br>
&gt; &gt; surgery.=C2=A0 I just ordered an RPi 5 (8 GB); it will take a whi=
le to be<br>
&gt; &gt; delivered.<br>
&gt; &gt;<br>
&gt; <br>
&gt; The existing driver has the correct compat string but we don&#39;t get=
 that far<br>
&gt; since the rp1 node doesn&#39;t get probed and attached. This node is n=
ested<br>
&gt; under pcie@120000 and the whole subtree never gets explored. Interesti=
ngly,<br>
&gt; if I hack the 2711 driver a little (based on reading Linux sources), I=
 can<br>
&gt; get that to attach and the rp1 southbridge is visible on the PCI bus w=
ith<br>
&gt; vendor id 0x1de4, device id 0x0001. I made a stub driver for it but th=
at<br>
&gt; isn&#39;t particularly helpful since we need an FDT device to get simp=
lebus to<br>
&gt; attach and discover all the rp1 sub-devices.<br>
<br>
=C2=A0Why is there FDT children under a pci device ???<br></blockquote><div=
><br></div><div>That&#39;s a very good question and I don&#39;t have an ans=
wer. This is just how the DTB is structured:</div><div><br></div><div>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pcie@120000 {<br><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 compatible =3D &quot;brcm,bcm2712-pcie&quot;;</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ...<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 rp1 {<br><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 comp=
atible =3D &quot;simple-bus&quot;;<br></div><div>=C2=A0</div></div></div>

--000000000000a282b4060f12bcbf--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACA0VUjARYPc-5hrv28mhq_SUEda=erRfA1u1B6%2By-U3EYdxoQ>