From nobody Fri May 12 17:19:32 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 4QHwVt49z1z4BGDc for ; Fri, 12 May 2023 17:19:50 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic311-24.consmr.mail.gq1.yahoo.com (sonic311-24.consmr.mail.gq1.yahoo.com [98.137.65.205]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4QHwVs2fXDz4WBd for ; Fri, 12 May 2023 17:19:49 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=iDniEFO+; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.65.205 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683911987; bh=7TQ6oKTQfgsk9MB6P2ZYia/qBnD/lgS51W7FI/vAYuA=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=iDniEFO+TqSH7JLRoe9R7lC3PEcb5na1Yh9ifoVKCX0Zel8dlWnvksISqP3JVUYU13PdM9yVEJH2jUPLpx/JtlQZ1hfDIZsFi5dE/uLFA3OrAys1ZKLgPEd2SNxzjLcwIn0Mnq9qARu7bFw9XsVKTa7iBzMGFgy+VUWo+m7koiMqdU4rr32zJBMpomnuv+UfWSHuMwF9lv8E8BHPlWpiY58GUjMSQ6B9s2j8uAiTJfBrLnQTs8N4W3gruT9d71U2gNc5K0rKHZ2bxiFPzYEY6NZOEd9LC98Y5nTW3m0PkIK3D7q+VKMyTmmfnglninbr9xRllPYUynLZDOG4prdeQg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683911987; bh=sIuTHJ9gQWyijx/pAnYIVFyoy0aAHKJPXAOQ1TVxPJ3=; h=X-Sonic-MF:Subject:From:Date:To:From:Subject; b=DA6io0bORmN/6etPKMr6tvmvNU0b1WhP/CFdeccaO/JooiEwLB2R8M8dVOqRd3s2Wiz0laDqko4JcPWGn0VgY+8d4q9TDAlVSdxOb6WRED2l/dFwjEbWFoCSs501u558OxMFoKwE0XxNkostMtvl8RpM+1c5+SwHFZlWZQw0lypJJ3YgovUM9W2+b5tS4fogmsh7V0n29ZM8FYdpc6NxcWF4pD7I7LBew3yikWYNpPTQBpGhyUj+d1Kc9Wdr6nAVW1oGs9yl6acsg5gCXlXmLlypKVmaFRRDK8XQLGJ7dBgVmzO9FgIrh1FRYMp/OuesuBwZUCeb6RnW4Kkam4v50Q== X-YMail-OSG: cMNh5GMVM1loddUZwNI.5M9IiZIPRMVk8HOxERouhzWNGB6uqm0k0XL7teDDA1J mz6e44TDTtadF9BalEcKPLmk2byLwIiJxX30B8JBe1EQBUXKDzd8JLD.Guq9zZuSNLIw5qdQCK9V iQMJrnDorbUTG6NjBObO9RTFg3y5jhovT.9tjwoiZhwndsPwzpam3uk2RaYgKsvMaGjqi8PBKtVV F_y3gAAU1qVBVnQT_qpERzoCJbbAwelBTPJ4N18hwQ2Q9eA0LsRkyI6sJSXopnjHaUMPN8gerni_ 4D8ky0qo3RvjUOTUmnZFRuc46lheO4Dkww8F38XWxJ3dG7M5O0HUfWWFU1FyyHWgQN18_B2NA2LF fdIZkIowIA6DpU6EP6O8eFp0ko9dq1IZaWeIrTtdR8rGCmsO8N9sU9crxOQSd8vXsKXJTNEVVhCS A7kWbwFG6aAEKrbjQ9IyKvJ_b0vCGrr9PPCyapL5jyn54yWGQZ8d6UmbYtqK6k6rj3hegXCtagdu Zj6QXWadW4f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HhhOAJ41fxwKDC0XlSyKzt89MA41yRxAOTpt6yZeZ_iY.hG8vmUYKRPMOwLrb5j2XsmUt3 SYH_1Y4adrJWWTOeCq36xaXwY7rwTb2urp0dsqEx8JZ6a53Et6iMck.vlMN2Cfv5iZY01l_jmLcL 1vKHXq4wYl__JPOnEpDE1nCdRNFFjTdvdMzeF.vKl9J4mqeTzN7eLmUvK9cz.hKTjnBuiK16Yr5i VWUvScVVK2pFv.VgaAPQFXOeu59N8JkKyIUl4F0Anb3Cwu2n6Zjj.E2hQw3.6vtCzx30.GBgUlHX x.g33YVKZ73liO1KLY40XwE4CWYbj1ORnDMTrBBbupzVdr.qK6NkmFJA6JtirPv2GtSu2KH3ClwV _Yk.Qwq4yYUcIZ0CdTxr8iTDjX9iNaL2chtgn9_ZTir2gyUp0LkzhG7boa7moqrfNky0urVmaw19 90rTDpS5hXsF6v.LIlhmdUoQ.38Tyv5HtxtsPhM2Ta_3NldrwW2npG_uQ3Dtg0m1N2ytE8iOeXv6 kha.9RaU0U7Y2S_3O26vMd8AtQ6sbOOjGhc78yPJLbsNCCWyDIkeJkqAHNYrQ7wbNa_0z6TvzhOH L_70dTRyXMxhrXISfWvTLOorTBH3rYvniKNW_lJKR2fV9Q8P8Dd2_8Zjnc8OOOdh_16IhsZ0YjOF 4.pxLh4TGRJT0NzLOS5scJD47b8OSyMPZaWoLhHkSpWeO_pNT6sIlwU4Um4n6xdCy.XLYlVPqelI bDA-- X-Sonic-MF: X-Sonic-ID: df2fd966-9eb0-4ced-9d90-3245f67c00f7 Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Fri, 12 May 2023 17:19:47 +0000 Received: by hermes--production-gq1-6db989bfb-7p67n (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 81a73e6264eb1d1636dab32d93d4ffb2; Fri, 12 May 2023 17:19:43 +0000 (UTC) Content-Type: text/plain; charset=us-ascii 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 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: Raspberry Pi POE+ hat overlay From: Mark Millard In-Reply-To: Date: Fri, 12 May 2023 10:19:32 -0700 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <77CD0716-3BC8-47EB-8743-F2BD9CA43D31@yahoo.com> References: To: Doug Rabson X-Mailer: Apple Mail (2.3731.400.51.1.1) 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.998]; MV_CASE(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; BLOCKLISTDE_FAIL(0.00)[98.137.65.205:server fail]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.205:from]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-arm@freebsd.org] X-Rspamd-Queue-Id: 4QHwVs2fXDz4WBd X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On May 12, 2023, at 10:11, Mark Millard wrote: > On May 12, 2023, at 09:38, Doug Rabson wrote: >=20 >> On Fri, 12 May 2023 at 17:27, Mark Millard wrote: >> On May 12, 2023, at 08:43, Doug Rabson wrote: >>=20 >>> 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: >>>=20 >>> 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 >>>=20 >>> 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? >>=20 >> The RPi* firwmare version that FreeBSD has in ports and uses >> in making snapshots and other images does not have that overlay: >>=20 >> # 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 >>=20 >> You do not mention establishing a copy of overlays/rpi-poe-plus.dtbo = . >>=20 >> 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. >>=20 >> You also do not mention what version of FreeBSD you are using >> on the RPi4B. The output of the command: >>=20 >> I'm running 13.2-RELEASE-p0 >=20 > That limits the range of firmware you can experiment with > but the following tagged vintages should be compatible and > also have an overlays/rpi-poe-plus.dtbo present: >=20 > 1.20210527/boot/overlays/rpi-poe-plus.dtbo > 1.20210727/boot/overlays/rpi-poe-plus.dtbo > 1.20210805/boot/overlays/rpi-poe-plus.dtbo >=20 > So extracting a consistent/full set of firmware and trying > it is a possibility. >=20 > The first 3 tags links on: >=20 > https://github.com/raspberrypi/linux/tags?after=3D1.20210831 >=20 > are for the above 3 firmware versions. >=20 > Anything newer will lead to a FreeBSD kernel crash for > 13.2-RELEASE-p0 due to mishandling the .dtb file that > would be used. >=20 > As an example of what is in . . ./boot/ from one of those 3: >=20 > # ls -Tld firmware-1.20210805/boot/* > -rw-rw-r-- 1 root wheel 18693 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/COPYING.linux > -rw-rw-r-- 1 root wheel 1594 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/LICENCE.broadcom > -rw-rw-r-- 1 root wheel 26401 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2708-rpi-b-plus.dtb > -rw-rw-r-- 1 root wheel 25749 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2708-rpi-b-rev1.dtb > -rw-rw-r-- 1 root wheel 26138 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2708-rpi-b.dtb > -rw-rw-r-- 1 root wheel 26060 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2708-rpi-cm.dtb > -rw-rw-r-- 1 root wheel 27076 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2708-rpi-zero-w.dtb > -rw-rw-r-- 1 root wheel 25883 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2708-rpi-zero.dtb > -rw-rw-r-- 1 root wheel 27276 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2709-rpi-2-b.dtb > -rw-rw-r-- 1 root wheel 27425 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2710-rpi-2-b.dtb > -rw-rw-r-- 1 root wheel 29542 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2710-rpi-3-b-plus.dtb > -rw-rw-r-- 1 root wheel 28923 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2710-rpi-3-b.dtb > -rw-rw-r-- 1 root wheel 27421 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2710-rpi-cm3.dtb > -rw-rw-r-- 1 root wheel 49825 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2711-rpi-4-b.dtb > -rw-rw-r-- 1 root wheel 49821 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2711-rpi-400.dtb > -rw-rw-r-- 1 root wheel 50499 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bcm2711-rpi-cm4.dtb > -rw-rw-r-- 1 root wheel 52456 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/bootcode.bin > -rw-rw-r-- 1 root wheel 7278 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup.dat > -rw-rw-r-- 1 root wheel 5407 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup4.dat > -rw-rw-r-- 1 root wheel 3211 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup4cd.dat > -rw-rw-r-- 1 root wheel 8416 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup4db.dat > -rw-rw-r-- 1 root wheel 8418 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup4x.dat > -rw-rw-r-- 1 root wheel 3211 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup_cd.dat > -rw-rw-r-- 1 root wheel 10262 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup_db.dat > -rw-rw-r-- 1 root wheel 10262 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/fixup_x.dat > drwxrwxr-x 2 root wheel 236 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/overlays > -rw-rw-r-- 1 root wheel 2959904 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start.elf > -rw-rw-r-- 1 root wheel 2235712 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start4.elf > -rw-rw-r-- 1 root wheel 799964 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start4cd.elf > -rw-rw-r-- 1 root wheel 3731528 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start4db.elf > -rw-rw-r-- 1 root wheel 2987720 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start4x.elf > -rw-rw-r-- 1 root wheel 799964 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start_cd.elf > -rw-rw-r-- 1 root wheel 4803496 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start_db.elf > -rw-rw-r-- 1 root wheel 3711432 Aug 5 04:11:18 2021 = firmware-1.20210805/boot/start_x.elf Note the lack of config.txt , armstub8-gic.bin , and armstub8.bin . > (I'll not list the overlays/* .) >=20 > I've no clue to the consequences of mixing and matching > materials from different vintages of the firmware. It > does appear that: >=20 > 1.20210727/boot/overlays/rpi-poe-plus.dtbo > 1.20210805/boot/overlays/rpi-poe-plus.dtbo >=20 > (the newer 2 of th3 3) are the same by content but that: >=20 > 1.20210527/boot/overlays/rpi-poe-plus.dtbo >=20 > is distinct in its older content. Be warned that the sys-utils/rpi-firmware port installs a couple of files that are not based on https://github.com/raspberrypi/ materials: # ls -Tld /boot/efi/armstub8* -rwxr-xr-x 1 root wheel 5888 Apr 20 19:25:22 2022 = /boot/efi/armstub8-gic.bin -rwxr-xr-x 1 root wheel 5888 Apr 20 19:25:22 2022 = /boot/efi/armstub8.bin Be sure to keep those 2 files in place (for at least armstub8-gic.bin ). A similar point goes for your config.txt . =3D=3D=3D Mark Millard marklmi at yahoo.com