From nobody Thu May 18 17:06:59 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 4QMbxd2Vtjz4BnRP for ; Thu, 18 May 2023 17:07:17 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic317-20.consmr.mail.gq1.yahoo.com (sonic317-20.consmr.mail.gq1.yahoo.com [98.137.66.146]) (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 4QMbxc5zQRz4X7Y for ; Thu, 18 May 2023 17:07:16 +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=1684429634; bh=pOzucLZO17FQ1tx0471f9WW9/FNII6sHTaYBwKDRJBI=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=ldXRJSO/sM68TrgJSnhJyWKIElH4gr+beWV18zxmrh3PefQXZkDc2s6HBbWH0bu8VMwZ8hkBKdnWooRlnICRMpRsKIM0H6dF5XYpg31EuT8lcQxLq+32HjPv2Ncv+/tN8yj+Py46lst+ulrYmgGVxqKgs1C2CLnt+HXKAnGZ0IwGP/FQwq4NfBejlVoPdE2/RE6An6HO0gafonp0Meel7+kD3Kz9IJno40Hk78jxkHmi7fNYMFkQBQfEaQz2lshPs2LRmhRmsKBRPS27uBJsPxmwUIUcwhZsUB2U5PweTOYM+GcAdxObGKhdC6Zfu/nVKFxK/aT5r1kLB2fzaf6/mw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684429634; bh=rkP3acvz3Hlsbmc0+JTVpf5fvyb9SocAtS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pLIg9lh7 u7_id24rL56UIIkgyUnns7t0p5I_p11.EEjJDEDMGhqS71rH87.GAgExPvN85VtLWRH9UAMK_miJ UsxCsbrlucDPQvHZKNyf0Dy2_p7e.Y_c1qUGv8.BPHhcQds_0ithFYubg3Pe5mbAo9trldCx2wGf P2WCO31i4BkIbDUO1FEDmt21VgLG2rGm0EgUwxE88FQ55XBZ4r2Tcb.BZLKdI62psyX2gCawHzpm UflUVepKfToEHOOehKTR.Ll3HNlwQUhKaCD0IH5LpBC4n35lZa6kEhpkylOLpYeeAdUtrGay08XT r3BRERIXYzIaZDhlGTJZBI4239dvRPqoy997hVWGliUXk.AY9l2q2VjQ36_gxJ6_0QleW08jm9.u P8.kfXHUZ21tEGeKvbHq1xAtJWQ6E74l3Dkz.tnggGzPs7CVTbFgjt.62WBERHj7DcNUx7DXvDgz 2sapKHY4nCv4PciDgdbNpgVbr9wzI3vlT90wwRoRNhLKouJTiUcnfMy358pNBQiq82UPi_Y5XdVu dNDe6SO14re6nyzcWml7yzorcJvtVponF1dPV_yIwKF3VZEtV28sUn0Pk5rjbJgzRz94db5970iI 8nQ-- X-Sonic-MF: X-Sonic-ID: 23d42eb7-cddb-41c9-94fb-bc2972494b0c Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Thu, 18 May 2023 17:07:14 +0000 Received: by hermes--production-gq1-6db989bfb-7mxxf (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID f432744de593e951bcf5b0f68bcbf5bd; Thu, 18 May 2023 17:07:10 +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.400.51.1.1\)) Subject: Re: Raspberry Pi POE+ hat overlay From: Mark Millard In-Reply-To: Date: Thu, 18 May 2023 10:06:59 -0700 Cc: Doug Rabson , 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: Nuno Teixeira X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Rspamd-Queue-Id: 4QMbxc5zQRz4X7Y 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 18, 2023, at 05:48, Nuno Teixeira wrote: > Indeed, voltage was the missing bit! >=20 > I'm trying to setup 1800 as default now for revs >=3D 1.4 following = https://www.raspberrypi.com/news/bullseye-bonus-1-8ghz-raspberry-pi-4/ = that only talk about setting arm_freq=3D1800 but doesn't mention to = adjust voltage. > It was nice that raspberry tell us what voltage exacly value they use = for new default 1800. >=20 > What I've got now is: >=20 > [pi4] > over_voltage=3D6 > arm_freq=3D2000 > sdram_freq_min=3D3200 > ### force_turbo=3D1 >=20 > My tests shows that we don't need force_turbo=3D1 for a normal running = and system do an auto 600 -> 2000 change when needed. Thats nice. I will note that the RPi* firmware itself varies the frequency and voltages by default --but the way of disabling that also disables powerd from being effective as I understand. (As I understand the firmware's policy details have changed over time but I do not know the details or when.) This makes use of powerd on the RPi*, with the firmware's adjustments also enabled, involve 2 competing mechanisms, if I understand right. I'm not aware of any horrible consequences in actual ooperation but I found force_turbo to lead to less time being taken in build activities back when I last measured it. It is true that I've not looked into this area in a long time. > Also, arm_boost=3D1 with force_turbo or not, is ignored. = https://github.com/raspberrypi/documentation/blob/8b096a52e394c10360549afd= 0a620755df467446/documentation/asciidoc/computers/config_txt/overclocking.= adoc (from 2021-Nov-04) did not have arm_boost documented yet. = https://github.com/raspberrypi/documentation/blob/da45bd8c982e91e11c609991= ba2fc8783872ef67/documentation/asciidoc/computers/config_txt/overclocking.= adoc (from 2021-Nov-11) has arm_boost documented. These give a clue about the vintage of RPi* firmware needed to have the arm_boost notation implemented. > sdram_freq and sdram_freq_min are set to 3200 by default, so I think I = will not need sdram_freq_min=3D3200 here. = https://github.com/raspberrypi/documentation/blob/2cbcd18fc155044f20ae6305= fa0e62629b56893c/configuration/config-txt/overclocking.md (from 2021-Mar-31) shows the Pi4 sdram_freq_min as 400. The defaults have changed with firmware updates. Note that the official RPi* port has 2021-Mar-03 firmware, so before 2021-Mar-31. = https://github.com/raspberrypi/documentation/blob/75e6050edd9e1b0c47c58623= 133dc05a02c16351/documentation/asciidoc/computers/config_txt/overclocking.= adoc (from 2021-Aug-09) shows the Pi4/CM4 sdram_freq_min as 3200. These give a clue about the vintage of RPi* firmware needed to have the sdram_freq_min be 3200 by default. My settings are for a wide range of firmware vintages, not just modern ones. Each item was shown (at the time added) was shown to cut the times for the likes of buildworld, buildkernel, or poudriere bulk activities that I did. Also, I tend to leave in place what has worked and still does work, rather than to track the changes in defaults over time in even more detail. I'd likely have different settings listed if I'd started at a later point that had newer defaults. > The only thing that I can't understand is how to calculate voltage: >=20 > over_voltage: 0 (1.35V, 1.2V on Raspberry Pi 1) ??? > ( https://www.raspberrypi.com/documentation/computers/config_txt.html = ) >=20 > Also, "7. Take it to the max" ( = https://magpi.raspberrypi.com/articles/how-to-overclock-raspberry-pi-4 = ): >=20 > over_voltage=3D6 (?) > arm_freq=3D2147 > gpu_freq=3D750 I'll note that I never attempted to take each RPi4B to its maximum for normal operation. I targeted having a setting combination that was reliable (had some margin) on all the example RPi4B's. I did have to explore were failures occured to do that. I did have access to RPi4B's that were unreliable with arm_freq=3D2100 for any over_voltage that I tried. Backing off to 2000 gave me reliable results on all the RPi4B's. I never had trouble with sdram_freq_min=3D3200 but it did help in contexts with the default being 400. > Thanks, >=20 >=20 > Mark Millard escreveu no dia quinta, 18/05/2023 = =C3=A0(s) 11:57: > On May 18, 2023, at 01:29, Nuno Teixeira wrote: >=20 > > Confirmed that arm_boost is enable by default on rpi4 rev >=3D 1.4 = as I checked with htop. > >=20 > > Also, tested arm_freq=3D1800 and it crashes FreeBSD around = initializing console/video and detecting mouse. >=20 > Overclocking by setting the arm_freq directly involves also > managing over_voltage explicitly, such as: >=20 > over_voltage=3D6 >=20 > A sequence I use (and have used for a long time) is: >=20 > [pi4] > over_voltage=3D6 > arm_freq=3D2000 > sdram_freq_min=3D3200 > force_turbo=3D1 >=20 > But each RPi4B has heatsinks, a case with a fan, > and a power supply rated for 5.1V 3.5A (so: has > some extra margin). >=20 > But the range of RPi4B's span Rev 1.1, Rev 1.4, > and Rev 1.5, a mix of 4 GiByte RAM and 8 GiByte > RAM models. All use those settings. >=20 > As I understand, arm_boost implicitly does the > extra things required for its implicit frequency, > unlike assigning arm_freq or the like. >=20 > If force_turbo is not used, it can be that: >=20 > # > # Local addition that avoids USB3 SSD boot failures that look like: > # uhub_reattach_port: port ? reset failed, error=3DUSB_ERR_TIMEOUT > # uhub_reattach_port: device problem (USB_ERR_TIMEOUT), disabling = port ? > initial_turbo=3D60 >=20 > is required for USB based booting. But this also > gets into if the notation is supported or not for > the firmware vintage used. >=20 > The initial_turbo use happens to avoid frequency > variability during boot and it appears that FreeBSD > does not necessarily tolerate such variability in > that time frame. >=20 > Also: I happen to have USB3 boot media for which use > of usb_pgood_delay=3D2000 is sufficient but without > some such in/for U-Boot, U-Boot has problems > recognizing the device (before FreeBSD is even > involved). I build the U-Boot port with the > assignment built in. >=20 > > As linux config.txt says: > > --- > > [pi4] > > # Run as fast as firmware / board allows > > arm_boost=3D1 > > --- > > firmware must be updated to support this feature for sure. >=20 > I'm not aware of a dated list of when the various > config.txt notations were first supported (firmware > version). This makes it messier to use the web's > published information, if one is using the firmware > vintage that FreeBSD has in its port for the > firmware. >=20 > The notation that I use has been around for a long > time. >=20 > > Cheers, > >=20 > > Nuno Teixeira escreveu no dia quarta, = 17/05/2023 =C3=A0(s) 14:08: > > (...) > >=20 > > I was meant using 13.2 not 12.3 :) > >=20 > > Doug Rabson escreveu no dia quarta, 17/05/2023 = =C3=A0(s) 13:47: > > I'm not sure about 12.3 either - you could try with 13.2 and see if = that makes a difference. > >=20 > > On Wed, 17 May 2023 at 13:45, Nuno Teixeira = wrote: > > Hey, > >=20 > > Ok. I'm new to rpi4 and arm in general but tomorrow I will force = 'arm_freq=3D1800' again just to see it it crashes again. > > I will check too what values linux shows. > >=20 > > I don't know if firmware/uboot version included in 12.3 supports = this feature. > >=20 > > Cheers, > >=20 > > Doug Rabson escreveu no dia quarta, 17/05/2023 = =C3=A0(s) 13:11: > > Hi Nuno, > >=20 > > I'm not sure where to start - I just happened to notice in the = documentation here: = https://www.raspberrypi.com/documentation/computers/config_txt.html that = the cpu frequency Pi4B R1.4 was listed as 1800 if arm_boot=3D1 so I = tried it. > >=20 > > Doug. > >=20 > >=20 > >=20 > > On Wed, 17 May 2023 at 11:11, Nuno Teixeira = wrote: > > Hello Doug, > >=20 > > I have too a 1.5 rpi but arm_boost=3D1 isn't doing anything, htop = shows 1500Mhz when doing something intensive. > > I'm running 13.2 stable > >=20 > > Do I missing something? > >=20 > > Could you take a look at my setup? > >=20 > > Thanks, > >=20 > > Doug Rabson escreveu no dia ter=C3=A7a, 16/05/2023 = =C3=A0(s) 17:19: > >=20 > > 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? > >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com