From nobody Wed Feb 01 05:54:54 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 4P6B331xz9z3cDFr for ; Wed, 1 Feb 2023 05:55:11 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic306-19.consmr.mail.gq1.yahoo.com (sonic306-19.consmr.mail.gq1.yahoo.com [98.137.68.82]) (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 4P6B324Prpz4bgc for ; Wed, 1 Feb 2023 05:55:10 +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=1675230908; bh=2MxDnAwjz32BUehg+X6NU1PR5JOwaIDFtW0n12Gcabo=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=GMZ9u1bPzoISy2G43xePWM3rAyUT7s8tXVHQ3Qu/EfDo9ySRC55LBYKrLwNZ+gQklSuAgTJ4ErLdsh1DePmvCbXEwNbw5WMhD+pj0xQREIUGHNbtqcxY3LcG87Cy/KAeRBsyJ2R5RII0/SMZ1evxkFOip9vObORZVqEt5DrjgJdbI8TvTRRuSV9Dh6MUdv3AnJjdCpKYt6Oq1PUs6eNp/rc8RYCCEnShDs7aDD1VZOjcGtMOGWYwgKZGcVEJpKz6fy7cZEMaihvLwKuRFJKERBucKD/n/0VrY2BTh06L9dROu6PS62eU1Wup1hznj77Rfcl10fsELVV7caASnQG2Dg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1675230908; bh=5N+YBS2UqphE5W8JsvCeGQ6Kv9KS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63BXo9UEAu9uJ8JrF0dBL63PeNPbr6A6.RApRP2H.NdXdmIDZaxcq2_zjBAaEu8rEh5CV7 .2yzW5OhNsXqIAqIrFE3rVCsdNzpIq.71eIzZdXXfuiUd47fmcgCWxm2InhsOaW1xJiBbB8PEotn WMPSbToMcwLk0Bd8MnX2EUCdNmr3g353_m_JdJQ.llQp_hHK4aQc.4QmuB2yLZRBQpLhll2tksCO 9whesx.3WFaVvLfYVPlQ6VNoONH5fZak7u6jvLIOk1htlKH0ictvT3XVRAgzsJzwk3W17QbNOVHd x3x4UWXa3vTyCJ3KaIKhdJ7pjFxP5jsfipR3kxl3yYxQgiGWHbsYK_wcgmYUj5rtjTucEmwcngcm sC8dUH5atDgyzLQoT3lPrJovc1vR37ib2SZyWI00SrEjRYORN9X8TtH6KiASFmEMTV_V7fPfqBZI kXCSSiou9XRoy_zCaMKwwyVPnu_EZMl20fSVlcGQOo_Qke.M6K1Wr9L4iev3m13fx7kKfz7ebvzT 6Ro0.r2FciwRl0OgXo9XQywxBgimEjGfZB3lYl5ROXAZBQ9oCtTiNfozRGu96slsfDSkoxmQhGok - X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.gq1.yahoo.com with HTTP; Wed, 1 Feb 2023 05:55:08 +0000 Received: by hermes--production-bf1-57c96c66f6-hmvtp (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5455d4db279a233e5aadd358bb0cb512; Wed, 01 Feb 2023 05:55:06 +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: Compiling device tree overlays From: Mark Millard In-Reply-To: <20C31E7D-66F0-4097-8889-68503C299FEA@gmail.com> Date: Tue, 31 Jan 2023 21:54:54 -0800 Cc: freebsd-arm@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20C31E7D-66F0-4097-8889-68503C299FEA@gmail.com> To: John Rushford X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Rspamd-Queue-Id: 4P6B324Prpz4bgc 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 31, 2023, at 19:15, John Rushford wrote: > The additional uarts on raspberry pi 4 do not function in FreeBSD = 13.1. I=E2=80=99ve built the rpi-firmware port but it seems to extract = pre-built dtb=E2=80=99s for Linux, The RPi* firmware dtb's are ones from the RPi* folks, which are the ones used by FreeBSD. They are an old version. The *.dtb's match the other firmware contained. Arbitrary mixing=20 nd matching of .dtb versions vs. firmware versions is not supported by anyone as far as I know. The FreeBSD kernel crashes on any rpi* firmware version that is fairly modern last I knew. The crash is tied to mishandling the *.dtb content in the wrong order, causing a use before initialization. I've: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D268835 with a patch to fix the crash issue by causing the correct ordering. That could allow experiments with more recent versions without having to deal with the crashes (at least). Note: I do not expect that updated RPi* firwmare(+ *.dtb 's) would make any difference for what you are doing. But, right now, any direct exploration of such is blocked by the crashes for the kernel as it is. > at least that=E2=80=99s my understanding. > I install these pre-built dtb=E2=80=99s into the boot/msdos/overlays = directory *.dtb files and *.dtbo files are different by purpose, despite a common format. *.dtbo 's go in overlays/ *.dtb 's do not. FYI: The RPi* firmware reads in the appropriate *.dtb and modifies parts of the live Devicie Tree to match various hardware details, such as for "B0T" vs. "C0T" BCM2711's. Some of the detail from the *.dtb can not be depended on. Loading *.dtbo's makes more modifications to the live Device Tree. > and I then try to enable uart3 with =E2=80=98dtoverlay=3Duart3=E2=80=99 = in config.txt. I can see after boot that there is an additional ttyu1 = and cuau1 but, > Neither of these functions. Using vmstat -I I see no interrupts = generated for uart3 when I open the ttyu1 or cuau1 with =E2=80=9Ccu = -l=E2=80=9D. Also, when I write data to the device file, the write = blocks. =20 > Using =E2=80=98watch=E2=80=99 on /dev/ttyu1, I see no data read ever. = I have a GPS card wired up to uart3 and I do not see the NMEA data there = but when I change out the SD card and boot into Debian, uart3 works = fine. >=20 > So, I=E2=80=99m thinking there may be an issue with the pre-built = dtb=E2=80=99s and am trying to make changes to = ./sys/contrib/device-tree/src/arm/bcm2711.dtsi sys/contrib/device-tree/src/arm/ materials for RPI*'s are from the Linux mainline kernel and need not match the ones from the RPi* folks. (Last I knew they did not.) FreeBSD does not build these nor did it intend to use these. That is part of why there is a separate port for bringing the RPi* firmware into the FreeBSD environment. > to troubleshoot uart3. I=E2=80=99m a newbie to raspberry pi and = device tree overlays. > I do not know how to compile my changes and build a new uart3.dtbo To my knowledge, bcm2711.dtsi is not involved in building uart3.dtbo at all, just building the *.dtb . (But, I'm no expert.) > and am unable to find any documentation on this. I was wondering if = someone could help me out with this task? FreeBSD may need changes for it to work for the extra UARTs in RPi4B's. To my knowledge, no kernel work was done to support such new things explicitly: the UART support is the same as it was for the prior RPi*'s as far as I know: 2 UARTs, both for the same serial connection, other other UART possibly used internally for Bluetooth (or otherwise ignored). Prior to the RPi4B's that is all there was for serial connections. While FreeBSD may need changes, I doubt that FreeBSD would ever provide changes to the RPi* firmware materials that would make them any different than those gotten from upstream. In other words, I expect you are working at the wrong end of the chain of software involved. A problem here is that, to my knowledge, no one actively works on any significant RPi* related FreeBSD support any more, and has not for a significant time. For example, the lack of documentation has been a large problem even for the folks that are knowledgable in the general subject areas --and it has been just too painful to deal with. Anyone that tried has eventually stopped. (FreeBSD committers still support committing work by others that appears to make sense to them. That is not the same as the kind of activity I'm referencing.) (I'm not generally knowledgable in most of the relevant background material. It took me months to discover the tiny changes that are in the patch that I referenced earlier --including discovering their appropriateness to dealing with Device Tree handling.) =3D=3D=3D Mark Millard marklmi at yahoo.com