From nobody Sun Jan 08 00:59:41 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 4NqJdS5knGz2qsKN for ; Sun, 8 Jan 2023 00:59:56 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic313-20.consmr.mail.gq1.yahoo.com (sonic313-20.consmr.mail.gq1.yahoo.com [98.137.65.83]) (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 4NqJdS2RBZz4Ctq for ; Sun, 8 Jan 2023 00:59:56 +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=1673139594; bh=1yE6LAHn7r2F9aLmfrJUM4Ei3Zcd43eFGHSfliExK34=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=S4P/hjCflQX2/4KlJ+A9rKF5ujT5ouqPECYMVPlpCVkqyiYVftjGJIXjI8jHH8xKJ8CJRGH1ZuoPB4JkMFyL+QIC9p0/ORVBdERdF5omdKG3kCLXOK49+xWJ6xn4l5OoQJR7kE9gmwwG35QWwmGSLZFonqaC0C5awA//8BcXI1EcxoLhZflYdHJjqLqxar75Ntn1BWPTqBRXImkV1Bl+D1p+u9Q2xq0S1Y6oa6sBnPBZ3L/lxLhU8xQ4c7Ef2VPIVD7zg6K6McmboNLZMvGiF0GLdvucJrCN/H9ym6uynDFbtZsPyJ059tlsrwS3Z8uecZ7r6fyGrXVHHiujHJ/7SA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1673139594; bh=qsyJDA+skhkFysN7IJ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qzfD.VDJKu8HqiDounxrMsP_N_nUrDedrOk0eepNka9KP6AcrRTuFnumTVrnSmeaR2kv 4911V1yjvkseB7uONrXqPqoU5Tm0YUFhLkeIFXW3loOtJMY4ZQFCtg7xbhJlgei6Fcw0WGUaO3oO yYsxE9LJJkggWcRFQchWlSximG0aPoYxiAlGCzKXBvq03PfXIuh0eYOhFcky0e_CTOA4sLB_Gvz7 6QM37tUh68PY77OmEn2Pesw6mkPPoTEo.Kz2WBvGOvKsdlIGoqE9LGLaBtuyjGFK57PL9zYwroSj 9eiecuneP5xtKI8v20AjQ9C6oA7_3W8TVKT7dmVygyAU3B594zpVzl4kcnEGOo39ePJ71nYSGbcF LkdodUtK1xtWILdB6.bd.MH4rY1tTh8STTOwm8nQbMGjrnoW_74I7pjfXS.i3PQEwdfCRmUijZPE PRIm04VEK_OJLoHqeZSoCgqlLXXckUTk_VA3DmcsfwcxWkPeaPSbOG02rJcrAYCXUAbnCWRYcI5D rD24qhv1o5L1jBKCJguBzmaq.qtbFg8_wYkpXY3ENQb_q3NNDu1FjBHEQitOt.jiTvOCeORQH5w- - X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Sun, 8 Jan 2023 00:59:54 +0000 Received: by hermes--production-gq1-d898c4779-nnvpg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7ea711b08cdcd29ed7ad74503476384f; Sun, 08 Jan 2023 00:59:51 +0000 (UTC) Content-Type: text/plain; charset=utf-8 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.300.101.1.3\)) Subject: Re: How to make FreeBSD's kernel boot a RPi4B with modern RPi* firmware From: Mark Millard In-Reply-To: Date: Sat, 7 Jan 2023 16:59:41 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <217ACD33-A466-4A01-AD36-5D4A0C1B3CF0@yahoo.com> References: <9C037D3F-A440-4708-993D-117F313691BB@yahoo.com> <374EC3E5-4CB4-4336-A8B9-7A9CF6151691@yahoo.com> <9E9C739E-8308-472A-B797-05A37559DD00@googlemail.com> To: =?utf-8?Q?Klaus_K=C3=BCchemann?= X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Rspamd-Queue-Id: 4NqJdS2RBZz4Ctq 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 Jan 7, 2023, at 10:58, Klaus K=C3=BCchemann = wrote: >=20 >> Am 07.01.2023 um 11:18 schrieb Mark Millard : >>=20 >>=20 >> =E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6=E2=80=A6= ... >>>>=20 >>>>=20 >>>> stable/13's source code changes are ( similarly for >>>> releng/13.1 ): >>>>=20 >>>> # git -C /usr/13S-src/ diff sys/arm/broadcom/bcm2835/bcm2835_dma.c >>>> diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c = b/sys/arm/broadcom/bcm2835/bcm2835_dma.c >>>> index cab8639bb607..6d521d6dcace 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_INTERRUPT + BUS_PASS_ORDER_LATE); >>>> MODULE_VERSION(bcm_dma, 1); >>>>=20 >>>>=20 >>>> main's [so: 14's] source code changes are: >>>>=20 >>>> # git -C /usr/main-src/ diff sys/arm/broadcom/bcm2835/bcm2835_dma.c >>>> diff --git a/sys/arm/broadcom/bcm2835/bcm2835_dma.c = b/sys/arm/broadcom/bcm2835/bcm2835_dma.c >>>> index 5f9ecb0b7981..d901447df1e9 100644 >>>> --- a/sys/arm/broadcom/bcm2835/bcm2835_dma.c >>>> +++ b/sys/arm/broadcom/bcm2835/bcm2835_dma.c >>>> @@ -764,5 +764,6 @@ static driver_t bcm_dma_driver =3D { >>>> sizeof(struct bcm_dma_softc), >>>> }; >>>>=20 >>>> -DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0); >>>> +EARLY_DRIVER_MODULE(bcm_dma, simplebus, bcm_dma_driver, 0, 0, >>>> + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); >>>> MODULE_VERSION(bcm_dma, 1); >>>>=20 >>=20 >>=20 >> =3D=3D=3D >> Mark Millard >> marklmi at yahoo.com >>=20 >=20 >=20 > =E2=80=A6=E2=80=A6.on the other hand : if your = EARLY_DRIVER_MODULE(bcm_dma=E2=80=A6 doesn=E2=80=99t do anything wrong, > you could give it in phabricator review, why not?!.. Yep, once I've better evidence from the RPi*'s that I have access to. I'll note that no vintages of the following .dtb files are in the current sysutils/rpi-firmware port: bcm2709-rpi-cm2.dtb bcm2710-rpi-zero-2-w.dtb bcm2710-rpi-zero-2.dtb bcm2711-rpi-cm4s.dtb I've no direct evidence of if any vintage of any of these would end up hitting the bcm_dma issue or not. But I expect that the EARLY_DRIVER_MODULE related patching would avoid (just!) that specific crash problem if it would otherwise would occur. There is: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261147 reporting the absence of bcm2710-rpi-zero-2-w.dtb . So someone might want to experiment with more recent RPi* firmware, possibly even to develop some level of support for bcm2710-rpi-zero-2-w.dtb (live Device Tree possibly adjusted by the RPi* firmware) --if changes are needed. The .dtb vintage and the RPi* start*.efi and the like vintages are not necessarily fully independent. Mixing and matching could be a problem, independent of any additional FreeBSD kernel-related issues. (It is another example of the poor level of documentation for the RPi* context.) =3D=3D=3D Mark Millard marklmi at yahoo.com