From nobody Fri May 12 17:11:06 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 4QHwK85ksZz4BFny for ; Fri, 12 May 2023 17:11:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic315-54.consmr.mail.gq1.yahoo.com (sonic315-54.consmr.mail.gq1.yahoo.com [98.137.65.30]) (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 4QHwK81bfdz4V7N for ; Fri, 12 May 2023 17:11:24 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683911481; bh=hvCn/1QEExlFXA8J4inWgFIe1hQ/hy96yKlRWLIvtaw=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=MJ8bHRsh5STxAJH3smLs3yhVN953NFB6fpux8z6+bhAZDapwfsKBA1t9Hf/nfZTtVyajVVZnRP6hUtxeK61I0W+Bhri6cus8WJ57HwG+od96Uf0b1qoBC8doFxVrFbgbpGMgfr9LIzoHtCzn9M0ngzddebAI3QUyd1/R2JAiBbi01oPQInpyvKTjjr4p3RTmaLFrZFZWbnxLOMtyrDn+7tFO0xVSENQNeX6kZPeCIS6vLWxTc1mjp2ZYIvtTcVhaXeOUNjKy4eQ21gKhdMuEQNnuE2GtVEf2SNGBR+rwChkbieen1uVs5ZEvuqha/4jybeYrUSMRLXjW84yfkLvk6w== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683911481; bh=15eByCUkMDC9i000+OoGvSGxiaF2r7mqQ4oTjxo/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QG9G2J0ha4XUAwpNFhQdfy8PNI86b9x0k DmCf_4qMcyF0fQgdaCvq4iSfNtj6xUBWvA.diuN2rexZhctlYY0JLfXjCs1W381PxPgFB4j3_e6i BPY4c7_sOochvc6hQPRhTbFxBpLZ8qVF9K5YhDk3R4PFPRpO7DEvp6swJRvCZTQDZI9MqrTYlaYx RIm62cGXpscJ8uhzopl3pyGKmHZhfBubJQsaumU.EmpY7lYs58TOrWjwxgMf7Jet_UAjiC8WPKTt HuVMbu1vVIhSfquG6966kwJ7YRV_yxYhIQqpWsBKD0f9KNpzV6lXyJ.HCHeCXI.Z4Iv6ZPN5nCOn 9IFlkmlmjBkMNkYY9s5LLE9olD2yPT8EEqHaiy7678q6V.JwJG9HZDkK6hAnvQeIyEzkjQX6vlUY 1.NbwbiYPvnPUQnzbHp.66TLFDcs6nPfN8FBPQ8bdb1PaoqWTQylDEJ2fhJMThlLIwbJ8t46kGCl PjohGncaCoHRVZGPagY2jwnLNcj._Iujm.cl_jszL8GWrP.cKs51Urv.pKnqHYUSgu1kDYyloVvr j2LEc X-Sonic-MF: X-Sonic-ID: 15220643-c8d8-49b7-a5ee-684921b8d907 Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Fri, 12 May 2023 17:11:21 +0000 Received: by hermes--production-bf1-54475bbfff-xvhwr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 391f468d62347dac59308d93a8efc449; Fri, 12 May 2023 17:11:19 +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:11:06 -0700 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Doug Rabson X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Rspamd-Queue-Id: 4QHwK81bfdz4V7N X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On May 12, 2023, at 09: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: >=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 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: 1.20210527/boot/overlays/rpi-poe-plus.dtbo 1.20210727/boot/overlays/rpi-poe-plus.dtbo 1.20210805/boot/overlays/rpi-poe-plus.dtbo So extracting a consistent/full set of firmware and trying it is a possibility. The first 3 tags links on: https://github.com/raspberrypi/linux/tags?after=3D1.20210831 are for the above 3 firmware versions. Anything newer will lead to a FreeBSD kernel crash for 13.2-RELEASE-p0 due to mishandling the .dtb file that would be used. As an example of what is in . . ./boot/ from one of those 3: # 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 (I'll not list the overlays/* .) I've no clue to the consequences of mixing and matching materials from different vintages of the firmware. It does appear that: 1.20210727/boot/overlays/rpi-poe-plus.dtbo 1.20210805/boot/overlays/rpi-poe-plus.dtbo (the newer 2 of th3 3) are the same by content but that: 1.20210527/boot/overlays/rpi-poe-plus.dtbo is distinct in its older content. =3D=3D=3D Mark Millard marklmi at yahoo.com