Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2023 17:38:30 +0100
From:      Doug Rabson <dfr@rabson.org>
To:        Mark Millard <marklmi@yahoo.com>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Raspberry Pi POE+ hat overlay
Message-ID:  <CACA0VUjCyhPCxBTn6h_HMOGjdFnivi5bnq4jgcg4i0bKY%2BF0PA@mail.gmail.com>
In-Reply-To: <E615D3BE-C12D-4960-BB01-AD2D40CA90A5@yahoo.com>
References:  <CACA0VUh9-7o55pXcyn=Ep9mPexAkgjKLEKUh6HqMovTxe2_R0Q@mail.gmail.com> <E615D3BE-C12D-4960-BB01-AD2D40CA90A5@yahoo.com>

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

On Fri, 12 May 2023 at 17:27, Mark Millard <marklmi@yahoo.com> wrote:

> On May 12, 2023, at 08:43, Doug Rabson <dfr@rabson.org> wrote:
>
> > I have a pi4 with the official POE+ hat which I want to run FreeBSD on.
> One thing I noticed is that the fan doesn't run in FreeBSD so I decided to
> try and write a little driver for it. First step seems to be to load the
> corresponding devicetree overlay by adding something like this to
> /boot/msdos/config.txt:
> >
> > dtoverlay=rpi-poe-plus
> > dtparam=poe_fan_temp0=45000,dtparam=poe_fan_temp0_hyst=3000
> > dtparam=poe_fan_temp1=50000,dtparam=poe_fan_temp1_hyst=3000
> > dtparam=poe_fan_temp2=62000,dtparam=poe_fan_temp2_hyst=4000
> > dtparam=poe_fan_temp3=70000,dtparam=poe_fan_temp3_hyst=5000
> >
> > Unfortunately this is where I'm stuck - the overlay is not present in
> the final DTB given to the kernel so there isn't anything to hook a driver
> to. Are dtoverlays supposed to work on FreeBSD?
>
> The RPi* firwmare version that FreeBSD has in ports and uses
> in making snapshots and other images does not have that overlay:
>
> # ls -Tld /usr/local/share/rpi-firmware/overlays/rpi*
> -rw-r--r--  1 root  wheel   489 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-backlight.dtbo
> -rw-r--r--  1 root  wheel  4081 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-cirrus-wm5102.dtbo
> -rw-r--r--  1 root  wheel   643 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-dac.dtbo
> -rw-r--r--  1 root  wheel  2574 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-display.dtbo
> -rw-r--r--  1 root  wheel   842 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-ft5406.dtbo
> -rw-r--r--  1 root  wheel  2937 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-poe.dtbo
> -rw-r--r--  1 root  wheel   771 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-proto.dtbo
> -rw-r--r--  1 root  wheel   893 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-sense.dtbo
> -rw-r--r--  1 root  wheel   567 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpi-tv.dtbo
> -rw-r--r--  1 root  wheel  1226 Mar  3 05:29:57 2021
> /usr/local/share/rpi-firmware/overlays/rpivid-v4l2.dtbo
>
> You do not mention establishing a copy of overlays/rpi-poe-plus.dtbo .
>

I copied the file from a rasbian install I had for another project. Perhaps
I should find the corresponding source for it and build it with the device
tree source from FreeBSD.


>
> You also do not mention what version of FreeBSD you are using
> on the RPi4B. The output of the command:
>

I'm running 13.2-RELEASE-p0

--000000000000d3a67205fb81bc04
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 Fri, 12 May 2023 at 17:27, Mark Mi=
llard &lt;<a href=3D"mailto:marklmi@yahoo.com">marklmi@yahoo.com</a>&gt; wr=
ote:<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-color:rgb(=
204,204,204);padding-left:1ex">On May 12, 2023, at 08:43, Doug Rabson &lt;<=
a href=3D"mailto:dfr@rabson.org" target=3D"_blank">dfr@rabson.org</a>&gt; w=
rote:<br>
<br>
&gt; I have a pi4 with the official POE+ hat which I want to run FreeBSD on=
. One thing I noticed is that the fan doesn&#39;t run in FreeBSD so I decid=
ed to try and write a little driver for it. First step seems to be to load =
the corresponding devicetree overlay by adding something like this to /boot=
/msdos/config.txt:<br>
&gt; <br>
&gt; dtoverlay=3Drpi-poe-plus<br>
&gt; dtparam=3Dpoe_fan_temp0=3D45000,dtparam=3Dpoe_fan_temp0_hyst=3D3000<br=
>
&gt; dtparam=3Dpoe_fan_temp1=3D50000,dtparam=3Dpoe_fan_temp1_hyst=3D3000<br=
>
&gt; dtparam=3Dpoe_fan_temp2=3D62000,dtparam=3Dpoe_fan_temp2_hyst=3D4000<br=
>
&gt; dtparam=3Dpoe_fan_temp3=3D70000,dtparam=3Dpoe_fan_temp3_hyst=3D5000<br=
>
&gt; <br>
&gt; Unfortunately this is where I&#39;m stuck - the overlay is not present=
 in the final DTB given to the kernel so there isn&#39;t anything to hook a=
 driver to. Are dtoverlays supposed to work on FreeBSD?<br>
<br>
The RPi* firwmare version that FreeBSD has in ports and uses<br>
in making snapshots and other images does not have that overlay:<br>
<br>
# ls -Tld /usr/local/share/rpi-firmware/overlays/rpi*<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0489 Mar=C2=A0 3 05:29:57 20=
21 /usr/local/share/rpi-firmware/overlays/rpi-backlight.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 4081 Mar=C2=A0 3 05:29:57 2021 /u=
sr/local/share/rpi-firmware/overlays/rpi-cirrus-wm5102.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0643 Mar=C2=A0 3 05:29:57 20=
21 /usr/local/share/rpi-firmware/overlays/rpi-dac.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 2574 Mar=C2=A0 3 05:29:57 2021 /u=
sr/local/share/rpi-firmware/overlays/rpi-display.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0842 Mar=C2=A0 3 05:29:57 20=
21 /usr/local/share/rpi-firmware/overlays/rpi-ft5406.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 2937 Mar=C2=A0 3 05:29:57 2021 /u=
sr/local/share/rpi-firmware/overlays/rpi-poe.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0771 Mar=C2=A0 3 05:29:57 20=
21 /usr/local/share/rpi-firmware/overlays/rpi-proto.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0893 Mar=C2=A0 3 05:29:57 20=
21 /usr/local/share/rpi-firmware/overlays/rpi-sense.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 =C2=A0567 Mar=C2=A0 3 05:29:57 20=
21 /usr/local/share/rpi-firmware/overlays/rpi-tv.dtbo<br>
-rw-r--r--=C2=A0 1 root=C2=A0 wheel=C2=A0 1226 Mar=C2=A0 3 05:29:57 2021 /u=
sr/local/share/rpi-firmware/overlays/rpivid-v4l2.dtbo<br>
<br>
You do not mention establishing a copy of overlays/rpi-poe-plus.dtbo .<br><=
/blockquote><div><br></div><div>I copied the file from a rasbian=C2=A0insta=
ll I had for another project. Perhaps I should find the corresponding sourc=
e for it and build it with the device tree source from FreeBSD.</div><div>=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(20=
4,204,204);padding-left:1ex">
<br>
You also do not mention what version of FreeBSD you are using<br>
on the RPi4B. The output of the command:<br></blockquote><div><br></div><di=
v>I&#39;m running 13.2-RELEASE-p0</div><div>=C2=A0</div></div></div>

--000000000000d3a67205fb81bc04--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACA0VUjCyhPCxBTn6h_HMOGjdFnivi5bnq4jgcg4i0bKY%2BF0PA>