From nobody Fri May 12 16:38:30 2023 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QHvbQ0BbPz4BCls for ; Fri, 12 May 2023 16:38:42 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QHvbP5P9Zz4Llt for ; Fri, 12 May 2023 16:38:41 +0000 (UTC) (envelope-from dfr@rabson.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-ba6fffc5524so1707441276.3 for ; Fri, 12 May 2023 09:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rabson-org.20221208.gappssmtp.com; s=20221208; t=1683909521; x=1686501521; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2z/SuMw/mEs1ie5Hr/ZwVfgP1INfnosAS5XHLLZDT3w=; b=iyXhHgUYVd3W22TBFsjs3OMo75/IxD8kxtzwbTClZJsXPA/BdUOO5uaoODp8JrODLy A4jkKicAk+FdmClNhwCT9fP5kJEgX2QG2Rkd8Q4HPa9FqjPMYfFto1tiaiNI/7stiXjc U/i5zYfctiARvIZK7KLHd5ZqbSmzzRcMSSVl7ZkJs9HgEzZ4WSajuaCgwzhj6JyVaQR4 UN8uBam32Ko996/NIzLJSiRN3pmQ+gxoQtS+JeADjjs54gcn5o4QjjyfGWUTRHEpFXbs QDuiDflFsWc0FN58OYNDZEO9+QjJVPIRipTKdACFG59IJ52JCgmoximCA50R8Z+ieZKv Gt5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683909521; x=1686501521; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2z/SuMw/mEs1ie5Hr/ZwVfgP1INfnosAS5XHLLZDT3w=; b=hYOwQf7QcHy//kKK087TZnCeHyvZRk9kKzmDupVoAJ5tCUM4+NxQgPNTfBR0k6shyf 0QDWjyy9+pv4dYImmL8yQKaVc5ve/Xu1ipZSZ7RwbRTpJaFsAi+FHGFFF/f1oGE4jiZv DdRvFZXK6TTeaUm7HG+ETHiOt9/I/1PsQpYwRsIooLgNZBDPDiILTAwZgXzXhPGT6qxy QRBHfXS6VmkA5mHpaItRGCwsKv5ctthxsUKKVXDG3CL/Bd3iEgUkG/ycCwbGYxE8Pcz/ G4MbuFuZYyMRAuHHLaeqPtVHZZrYskA3DGmMDd87X9yv7fALu2HAo7bsM4x94pUpIcxL I5RA== X-Gm-Message-State: AC+VfDxpWJ3dSKpptByOUz5w6JZqltuYAE4Q4gCtp8zqSCCnbeT8mRCq EWubqFFtoeYlcTU5PSTm0WAdDmJ2sziAOz7kLZWdlLGWRTWp1U6bpds= X-Google-Smtp-Source: ACHHUZ59r3ntjvu9hMKgwmQ09DbFzGLZB4ZJIvP5KsvmTdITjDKwPQb6bBFVxAl08P1pmCWLxYNJYY/gbop3q0l5EEc= X-Received: by 2002:a25:54b:0:b0:ba7:4693:b07 with SMTP id 72-20020a25054b000000b00ba746930b07mr413090ybf.62.1683909520885; Fri, 12 May 2023 09:38:40 -0700 (PDT) List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Doug Rabson Date: Fri, 12 May 2023 17:38:30 +0100 Message-ID: Subject: Re: Raspberry Pi POE+ hat overlay To: Mark Millard Cc: freebsd-arm@freebsd.org Content-Type: multipart/alternative; boundary="000000000000d3a67205fb81bc04" X-Rspamd-Queue-Id: 4QHvbP5P9Zz4Llt X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N --000000000000d3a67205fb81bc04 Content-Type: text/plain; charset="UTF-8" On Fri, 12 May 2023 at 17:27, Mark Millard wrote: > On May 12, 2023, at 08:43, Doug Rabson 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


=
On Fri, 12 May 2023 at 17:27, Mark Mi= llard <marklmi@yahoo.com> wr= ote:
On May 12, 2023, at 08:43, Doug Rabson <<= a href=3D"mailto:dfr@rabson.org" target=3D"_blank">dfr@rabson.org> w= rote:

> 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 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:
>
> dtoverlay=3Drpi-poe-plus
> dtparam=3Dpoe_fan_temp0=3D45000,dtparam=3Dpoe_fan_temp0_hyst=3D3000 > dtparam=3Dpoe_fan_temp1=3D50000,dtparam=3Dpoe_fan_temp1_hyst=3D3000 > dtparam=3Dpoe_fan_temp2=3D62000,dtparam=3Dpoe_fan_temp2_hyst=3D4000 > dtparam=3Dpoe_fan_temp3=3D70000,dtparam=3Dpoe_fan_temp3_hyst=3D5000 >
> 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--=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
-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
-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
-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
-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
-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
-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
-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
-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
-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

You do not mention establishing a copy of overlays/rpi-poe-plus.dtbo .
<= /blockquote>

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.
= =C2=A0

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
=C2=A0
--000000000000d3a67205fb81bc04--