From owner-freebsd-arm@freebsd.org Sun Sep 27 02:01:14 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D80F63E73B5 for ; Sun, 27 Sep 2020 02:01:14 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic309-22.consmr.mail.gq1.yahoo.com (sonic309-22.consmr.mail.gq1.yahoo.com [98.137.65.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BzTQd6rTRz4LvT for ; Sun, 27 Sep 2020 02:01:13 +0000 (UTC) (envelope-from marklmi@yahoo.com) X-YMail-OSG: 43XJ7VIVM1lq0WjhOGAjOqx3fqacAwcI_dpRNzqGQzIXcixqaxB.DF0DR7fQGdm vKEIIWFb.Eqv0zFPnCaslopwrGYt767MIHUGPthmrvOAk2B9vAtbajGrRb1RIxUe22utSXJNBV1f PQAt5uNGQczTdsix765F7dFWe5yHoDwCPTaocfZvDn5TOoxPhmJjMox0q9yLgouwDtXaoObKRC_7 bdnpbZWz2GM4b77GN2z1CbmS2Td_vW3e5UG9XI5QwqWIbEMF0vuHsxEVUbHFTsLGkZ0LcqfzeVds aKjNYSUmbcoADcM0AbQiF7QqhaojAdNhJsrpfSZ8Pu.3EN_rVR1wwSpDvKD29eW_bMQaoMHdZqDM B_0EdwmaooY0St.FqZb.mom3cjRJrkwZAXDCA2H_qASEnj4itc2lSU8C0DmjH5U3fmpgHanxm.en w1.eFE8nKanExUbRaL1T1UgqqLdPKCL37kbmqlAsn8AaNibVuPwg2JK_chwXGgqJDybzxb28Am8R SV.goiltx1_YVer6_sefetLtYsvqPY318QPleFd1nLiz4lRp5DKWHE2WZznME.L7QUXF.TCKIjie eBqE8FSV6PQDGHuIfsQzUu3hQHzKQgDjE1HxvxWZjqCWKzsTs63HLlvW9TP24DWT3tFVp4d36Y3g beKzt0I8K2I5Le3I7iF4py4Morffor67ADljnboyo036JtVlppD5lruFr4v3IPdqps23zl5kzYqC ege3lGlXzO.r0wCwntTEd..WQswZMvT3TLFMMAlbwIu.yA.K8wCcyHmbAx30y6qfHixKVKsySdaj grWWhvHUxwNSKiZDeU.JXmd531qKFvu7PzBbnLlZTVMlh6Sc.lLzxxbef93h01H2Zz5z7tPkw.r7 9AaVJgpH3GvNoHhYc5RVtCHTXs.OwkpWIDeM9Kn_4Sk0NCWR6lBruZ.goujFSMEPn60kuSOAodtH I.052K531vDCwHJJn1v8zq.PFkplTZjN77NUdyie.bF143IKdKevuuovEGTCO89sBf8qAkhwEpZx K4H3Kd2i54KZP7hfJskG58vr0YksM36VbzV4nxuneXNpxAIwAyX_1B32umSmDJ1YWunpzn9SyhQI vif3mMCV7SMG3erruUJHXuowKvgecLLz0L5nj1q5xXZXqjZ99ZNqG1TNOVCrN7HLwPmajuQ7IP47 zkFfQ7f2oQrRSTyNPsbm_zhww5QgN7vFNdFvfdsVZNP00NsGCcVO7t955VfoBaAnVc5xIG.caVaA CQL1jQ01KcNfV6GuEtRjVjJ0eA7uO_0L4UtXpZ5UIo409rVF_NaJ2Pgg97obzaRnJAe2sGK27Mle Ul_QtkgZTMC.ttC7wzPO0qqEQxezNu1cjqvDtr0i6YKvzpMh9diw5DR9cwzf9J8iCKNZRnTxDuyx OX.f7yzMZECbCDFEhidsbLmJVM7.vjAi8.hp0d_Tg32VrTNo5H2sYhd2Ocp1ilp0l2VEMsmzT7fR _d.cl4PZiBoa.donuQnfDccqWD4JeUf_fVtyZi7fSscKu9J5vPfuY.BNIvALX3hNSO251HW7X Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.gq1.yahoo.com with HTTP; Sun, 27 Sep 2020 02:01:12 +0000 Received: by smtp404.mail.bf1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 3202a82a4abbe471097f6c1431241496; Sun, 27 Sep 2020 02:01:08 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: RPi4B u-boot based booting and hw.cpufreq.voltage_core and dev.cpu.0.freq use: able to use 2000 MHz From: Mark Millard In-Reply-To: <64B39936-7689-4240-A5F9-4DF5EAE4DE42@yahoo.com> Date: Sat, 26 Sep 2020 19:01:06 -0700 Cc: freebsd-arm , Robert Clausecker Content-Transfer-Encoding: quoted-printable Message-Id: <19D27F91-F038-4393-90BF-7A439F8BF4B1@yahoo.com> References: <0578EC2B-D21C-46AA-AD3E-CD13985B18FA.ref@yahoo.com> <0578EC2B-D21C-46AA-AD3E-CD13985B18FA@yahoo.com> <20200926133934.GD54660@bastion.zyxst.net> <64B39936-7689-4240-A5F9-4DF5EAE4DE42@yahoo.com> To: tech-lists X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4BzTQd6rTRz4LvT X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.29 / 15.00]; FREEMAIL_FROM(0.00)[yahoo.com]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; NEURAL_HAM_SHORT(-0.79)[-0.788]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.987]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.02)[-1.016]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[98.137.65.148:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[98.137.65.148:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-arm] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Sep 2020 02:01:14 -0000 On 2020-Sep-26, at 13:20, Mark Millard wrote: > On 2020-Sep-26, at 06:39, tech-lists wrote: >=20 >> On Sat, Sep 26, 2020 at 12:37:45AM -0700, Mark Millard via = freebsd-arm wrote: >>> I got access to a 4 GiByte RPi4B that does not have modernized >>> eeprom contents. With it I was able to do a u-boot based boot >>> of head -r365932 based on the msdosfs on a older microsd card >>> that had materials from 2020-Jul-13 (u-boot.bin) and 14 (RPi4B >>> materials). I updated EFI/BOOT/bootaa64.efi . The u-boot.bin >>> is from my build of sysutils/u-boot-rpi4/ (no local changes). >>>=20 >>> In this context . . . >>>=20 >>> I added over_voltage=3D6 and arm_freq=3D2000 to config.txt and it >>> ends up looking like: >>>=20 >>> arm_control=3D0x200 >>> arm_64bit=3D1 >>> dtoverlay=3Ddisable-bt >>> dtoverlay=3Dmmc >>> device_tree_address=3D0x4000 >>> kernel=3Du-boot.bin >>> armstub=3Darmstub8-gic.bin >>> over_voltage=3D6 >>> arm_freq=3D2000 >>>=20 >>>=20 >>> Booting based on that resulted in: >>>=20 >>> dev.bcm2835_cpufreq.0.freq_settings: 2000/-1 600/-1 >>> dev.cpu.0.freq_levels: 2000/-1 600/-1 >>> dev.cpu.0.freq: 600 >>>=20 >>> And: >>>=20 >>> # sysctl dev.cpu.0.freq=3D2000 >>> dev.cpu.0.freq: 600 -> 2000 >>>=20 >>> worked. (Without the over_voltage it reports 600 and then >>> hangs.) Having /etc/sysctl.conf list dev.cpu.0.freq=3D2000 >>> works. >>=20 >> Exellent! On the basis of your post I went ahead and removed from = config.txt >> three lines, then added two and rebooted. >>=20 >> It's now this: >>=20 >> arm_control=3D0x200 >> arm_64bit=3D1 >> dtoverlay=3Ddisable-bt >> dtoverlay=3Dmmc >> device_tree_address=3D0x4000 >> kernel=3Du-boot.bin >> armstub=3Darmstub8-gic.bin >> over_voltage=3D6 >> arm_freq=3D2000 >>=20 >> before, when it didn't work, it had this: >> [same as above], apart from >> gpu_mem=3D16 >> over_voltage=3D6 >> arm_freq=3D2100 >>=20 >> In creating the freebsd instance I followed these instructions for = 8GB >> = https://lists.freebsd.org/pipermail/freebsd-arm/2020-August/022162.html >> and applied D26344. /etc/rc.conf has powerd loaded >>=20 >> I was particularly interested in getting this clocked to a reasonable = speed as >> it's used to build packages with poudriere based on arm7 and aarch64 = for >> -current. >=20 > The cortex-A72 is largely memory subsystem limited on the > RPi4B compared to, say, the MACCHIATObin Double Shot > running at the same clock rate. >=20 > So I've recently experimented with changing the > sdram_freq_min from the default or 400 to 3200 > (to match sdram_freq): >=20 > # more /microsd_efi/config.txt > arm_control=3D0x200 > arm_64bit=3D1 > dtoverlay=3Ddisable-bt > dtoverlay=3Dmmc > device_tree_address=3D0x4000 > kernel=3Du-boot.bin > armstub=3Darmstub8-gic.bin > over_voltage=3D6 > arm_freq=3D2000 > sdram_freq_min=3D3200 >=20 > A benchmark I use suggests I'll see the fastest RPi4B > buildworld buildkernel times that I've seen yet when I=20 > get around to trying that. ( My benchmarking and testing > is based on powerd or the like not being in use but the > kernel or rpi-firmware could be doing its own thing > given the above and sysctl.conf having > dev.cpu.0.freq=3D2000 .) Preiminary benchmarking indicates that rpi4-uefi-devel's uefi/ACPI context effectively ends up with sdram_freq_min=3D3200 ignored (making no difference). (In my context, it is the same FreeBSD root file system for both types of boots, so only boot-specific code varies.) Thus, it looks like the u-boot context can be better tailored for cutting the buildworld buildkernel time required and so it looks like that is the environment that I will be timing a from-scratch build in. The ACPI context does not have a sysctl interface to the values that the u-boot one has. So u-boot based is more direct for validating what is in use. > I have heatsinks and a fan involved, as well as a > (apparently good) 5.1v 3.5A power supply. My experiments > presume such a context. >=20 > (I've sent out a separate list message about hw.cpufreq.sdram_freq > having a value-display problem and the 3 hw.cpufreq.voltage_sdram_* > values looking to be lower than expected. I've not seen evidence > of problems in operation so far.) >=20 > I'll note that: >=20 > = https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md= >=20 > reports: >=20 > QUOTE > arm_control >=20 > DEPRECATED - use arm_64bit to enable 64-bit kernels. >=20 > Sets board-specific control bits. > END QUOTE >=20 > So I'm likely to experiment with removing that line > from config.txt . >=20 >=20 >> seems very stable so far: >>=20 >> 2:36p.m. up 45 mins, 1 user, load averages: 6.51, 3.57, 2.92 >> Sat 26 Sep 2020 14:36:14 BST >> dev.cpu.0.temperature: 65.0C >> dev.cpu.0.freq_levels: 2000/-1 600/-1 >> dev.cpu.0.freq: 2000 >>=20 >> rpi4 is in a FLIRC case for cooling, no fan. 24 degC/44%rh ambient. >>=20 >=20 >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com ( dsl-only.net went away in early 2018-Mar)