From nobody Fri May 12 16:49:22 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 4QHvqz52zLz4BDKc for ; Fri, 12 May 2023 16:49:35 +0000 (UTC) (envelope-from dfr@rabson.org) Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (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 4QHvqy2qgRz4QM4 for ; Fri, 12 May 2023 16:49:34 +0000 (UTC) (envelope-from dfr@rabson.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rabson-org.20221208.gappssmtp.com header.s=20221208 header.b=c4RQNAGn; spf=pass (mx1.freebsd.org: domain of dfr@rabson.org designates 2607:f8b0:4864:20::b30 as permitted sender) smtp.mailfrom=dfr@rabson.org; dmarc=none Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-b9a6f17f2b6so47677040276.1 for ; Fri, 12 May 2023 09:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rabson-org.20221208.gappssmtp.com; s=20221208; t=1683910173; x=1686502173; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zYehUQbIvzZO+9zG6X7u0M7IuGigjBLXG2zK27q+0TM=; b=c4RQNAGn+jK9tP/92yFBV6EmT5D/vmzcYL9FXg21RfhoL5LkdGS51ShUT/S14gOpgN hEYQopEbv5Rebn12Y7vhGNpmvbj4XWc4smpjjsx9ChfbqvCIDkfz6/peiWVFcN1vx4gL pZQNkKeC+2RF0Tj6iIXrKbrXfOzu89X767xu7ZMy4GNlodU8ii7ihKdyO/joYCn5mX2v IOjMxS55VdmolKkjMW2mVrg8Fh4XQSixb8S5s78pzFmN3mRRixHuHMldRCoavaYVjURS zX/jdFCqj0brmNj7XPPgo/d75hy8Ku/3cwj6iBGfFQgXHzttOLlw7cCo+WdUz/tcnHbo rIOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683910173; x=1686502173; 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=zYehUQbIvzZO+9zG6X7u0M7IuGigjBLXG2zK27q+0TM=; b=DAKqsfDBlXmh2sHIPQlgeaj/pH9kyugWTNpSHCq/faZPucWrYvpW/nvn4rF7g6OEsP UNSBGLeGtWgmxzc9+hHhumxaV/juSxXQm7yyfaPZcbfpqXhaHEAwntgVQmerkadGxGbv YPTSEFOQ7BEyOzUf+TNDqjZhNU1ex+kyAm+yNgcjOWccZ7oN7Qdfe/9K+C1rSN45q6EV FY0MK1wWvlZKKwIw6OOxnp+nVfTSWrMpat9rVy2/548l3AD6eumJtI9fKMCaX/jJeiB0 m+3MpHss+m5iNE2H5H2r9PVTnmM/Aqnu555B4euPIf601UdJNuMfgQE/tS20+RGnNT+p 2LGg== X-Gm-Message-State: AC+VfDwZRUUx/YMk8oQPu8D/huTUBMtRKPhDWvFPnDQrngpBIykQVAC9 VztBw5bpNxGz+zdKXg5Iscg9/3Lgkh213gGZSwe9IA== X-Google-Smtp-Source: ACHHUZ680u3Np0pHQNB0gwmLvkWHvPvoh5neTNrCiM/9KT0Ktbn4kUocLbaLyPmSFZU6iSCeyAmkS/7oxgJgP7ZcS64= X-Received: by 2002:a25:4884:0:b0:b9d:88a7:dbf with SMTP id v126-20020a254884000000b00b9d88a70dbfmr25276651yba.4.1683910173193; Fri, 12 May 2023 09:49:33 -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:49:22 +0100 Message-ID: Subject: Re: Raspberry Pi POE+ hat overlay To: Mark Millard Cc: freebsd-arm@freebsd.org Content-Type: multipart/alternative; boundary="000000000000b50f7e05fb81e395" X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; R_DKIM_ALLOW(-0.20)[rabson-org.20221208.gappssmtp.com:s=20221208]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org]; FREEMAIL_TO(0.00)[yahoo.com]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::b30:from]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[dfr]; DKIM_TRACE(0.00)[rabson-org.20221208.gappssmtp.com:+]; TO_DN_SOME(0.00)[]; DMARC_NA(0.00)[rabson.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QHvqy2qgRz4QM4 X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N --000000000000b50f7e05fb81e395 Content-Type: text/plain; charset="UTF-8" On Fri, 12 May 2023 at 17:38, Doug Rabson wrote: > > > 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 > Ok, if I add the rpi-poe.dtbo file and change to using 'dtoverlay=rpi-poe', then I do see the overlay in the booted system - thanks for all the pointers. Looks like I need to figure out how to add rpi-poe-plus to the rpi-firmware port first. > --000000000000b50f7e05fb81e395 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, 12 May 2023 at 17:38, Doug Ra= bson <dfr@rabson.org> wrote:


On Fri, 12 Ma= y 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 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

Ok, if I add the rpi-poe.dtbo file and change to using 'dtover= lay=3Drpi-poe', then I do see the overlay in the booted system - thanks= for all the pointers. Looks like I need to figure out how to add rpi-poe-p= lus to the rpi-firmware port first.
=C2=A0
--000000000000b50f7e05fb81e395--