From nobody Tue May 16 17:11:58 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 4QLN8F0RDqz4BFsb for ; Tue, 16 May 2023 17:12:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic304-24.consmr.mail.gq1.yahoo.com (sonic304-24.consmr.mail.gq1.yahoo.com [98.137.68.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 4QLN8D0BB5z417B for ; Tue, 16 May 2023 17:12:11 +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=1684257130; bh=aKcudontywxoRGiw7pAE6vE532NrCjr1uAQjJAJHhw0=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=gGINHQlSIfSR73ePWF9VD/Oxm7YoQ172DEv4CdjMiOGbwQ+IZckiuhCGjeM2fcbG+mSFUQfiVD3GsbVCVhqY7UwSduiNalrkN98dEwIJANNCB4J7JB8igrXgbXeg+h+DsnTernCOHXQJjF1yzhdwin9g+/9qs0ki5xon8yjY+uAvbBZvDicMQtYrkPB+jJJaY42kaG3T3CFk4aHhYLkkfc6QNuYSMwaVh9dvRhaFDMgh21SCU/ib4H3fukCvBE489tUeO/m4q/yIrUT7v+0e4Y/Z0QJVVNDr1HLI5W5CBN5P1xYuxvZSmNbatDAp7UwJCOrO/37gQLwMAfBQweXwdw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684257130; bh=A9aDG3qTFW0wRF2OK2ee1noku1MMDiibf3Mgltf71+C=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DsMbL6eTbmR_QDL0kmUMTk4RhYWLjOG7WTcFsLVdc1.Gzzwh5tpqpU1TVsIrv4TAMcs _62nAm7eo.C0cQsSJXXptUborkKkxnh3HSXAh4Gg6cbDBQxsUN8Cur6VYEBhqzF5mpCKv1DFhOJh 7xjIURzzQs2X5UeWOhY5Gi3LyxhTaZtQUEN4xYpUyR1HBsosi1DJ7sz_DjL8rH89c7PGS_HJc9Sf YfSDglW3jVIZIfeJA_Cdc6T.8KvXQdjprVcN3NT6dE7g34MXzgVK_eX9s54fh1AohWQL0WeNxNBJ m1M2OtGieDk2E9_Tbox3LRJGJAVGKqiLQyYdMsO9BT.1YggAjnuR6KK8egf25wACl9lXjh.0HLny 65WYKkoI9NC0ZujAljyRYuqR7UwWwVYAXxBoMW6ApPWTvjcj3gwdbhL1DATga2WfEPTZHKj5Wer. mPDvX2B0NvpEc_pLMEl1VuZU9GnlnuztqXEn185lMFJMW1J4V8FiiaatWkrMEW7EePlESWuaNKDg nJPqwx4a0y3ZBz8uSU6eTKNZnexNMrwRvrxuirzZs9UFrRxeZgX_cvVW_5uqhm2cL0.QOxrxy1fU oLg-- X-Sonic-MF: X-Sonic-ID: e002a373-8dcd-41ed-8327-ec4ff30cb3e9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Tue, 16 May 2023 17:12:10 +0000 Received: by hermes--production-gq1-6db989bfb-7p67n (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 13c4f4784403a462569b35873f54ad04; Tue, 16 May 2023 17:12:09 +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: Tue, 16 May 2023 10:11:58 -0700 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <77CD0716-3BC8-47EB-8743-F2BD9CA43D31@yahoo.com> <432A1A16-9FE5-4339-AB38-8F3E03A5D4EF@yahoo.com> To: Doug Rabson X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Rspamd-Queue-Id: 4QLN8D0BB5z417B 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 16, 2023, at 09:19, Doug Rabson wrote: >> On Sat, 13 May 2023 at 13:45, Doug Rabson wrote: >> I was able to build an updated rpi-firmware port based on 1.20210805 = and this boots successfully on pi400 as well as rpi4. With this, I can = load the rpi-poe-plus overlay and I just need to try and reverse = engineer the undocumented mailbox API by reading the Linux code. >>=20 > I have a first approximation of a fan driver which works with the = 1.20210805 firmware (actually, I substituted rpi-poe-plus.dtbo from = 1.20210831 which just changes the fan levels for the POE+). I'm testing = with an rpi4B rev 1.5 with 'make -j4 buildworld' and the fan is keeping = the cpu temperature below 65 degrees which is nice, especially since I = set arm_boost=3D1 in config.txt which boosts the cpu frequency up to = 1800 for this board. >=20 > Does anyone have a pointer to the problem with firmware later than = 20210805? Would it make any kind of sense to try to get the fix into = releng/13.2 as an errata? I doubt that FreeBSD would do a 13.2-RELEASE errata for a bug that is RPi* specific. But that should not block checking my assumptions. It might be more likely as an extra errata if another one was deemed essential so that an update would be happening anyway. (But I do not know if they do such things for fixes with narrower applicability.) Relevant from stable/13 are: = https://cgit.freebsd.org/src/commit/?h=3Dstable/13&id=3D5b6edfc577fbb4e970= 3c112713c7fb472e144346 ( https://bugs.freebsd.org/268835 ) and = https://cgit.freebsd.org/src/commit/?h=3Dstable/13&id=3Daa399ad3e554223b8b= f741c3933c38dec92eaf20 ( https://reviews.freebsd.org/D38756 ) The 1st of the 2 is the actual fix (essential), quoting: bcm_dma: attach at an earlier bus pass The sdhci_bcm driver attach routine relies on bcm_dma already being attached, in order to allocate a DMA channel. However, both drivers attached at the default pass so this is not guaranteed. Newer RPI firmware exposes this assumption, and the result is a NULL-dereference in bcm_dma_allocate(). To fix this, use BUS_PASS_SUPPORTDEV for bcm_dma. . . . diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c = b/sys/arm/broadcom/bcm2835/bcm2835_dma.c index cab8639bb607..af86647704f6 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c @@ -766,5 +766,6 @@ static driver_t bcm_dma_driver =3D { =20 static devclass_t bcm_dma_devclass; =20 -DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, bcm_dma_devclass, 0, = 0); +EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, = bcm_dma_devclass, 0, 0, + BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(bcm_dma, 1); The 2nd deals with improving error handling to avoid "NULL softc"s leading to crashes. But that is not essential to allowing more recent firmware. =3D=3D=3D Mark Millard marklmi at yahoo.com