From nobody Thu Dec 28 20:22:16 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 4T1KgX2ZKyz54YSN for ; Thu, 28 Dec 2023 20:22:32 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic310-21.consmr.mail.gq1.yahoo.com (sonic310-21.consmr.mail.gq1.yahoo.com [98.137.69.147]) (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 4T1KgW6FGbz4VTR for ; Thu, 28 Dec 2023 20:22:31 +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=1703794949; bh=cCmlbXiuYDsu3y+I3qMt6y1/MOk/3j/85eAiOgp5mwQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=pUYf1HCaOj/O2B7Q+MaHUM6tTrgdibFKWyzkdd1DDZ6bbcpQfB0hhinC0ZjnbqRJ6mCe6gGCRNavxeoEQCdSa6iRmKw33Vs5XS6dIUlUdxSF/fg/nxyBn1KAX4wdoHEQATKnK94NaET12GB38hJQjuOBG58WWZEY8uNMY7QJjh/NVcSoqLh8m34yGPgxcQ6r1TaaCe+LMrbErlkHBbu2SSRLFZI20EDCVCgBHMTF7RIcHbTFYBq12l6bkpDMNOc2frefDbN6kUUcKWbeA0K+clmjPx0iTGvos3/jxYf67zF9F9/KQ/LTs0pWtKrNfpOgfcK4BRk5TxZTOSEpLrqVOA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1703794949; bh=7XT2Pt8ixdLc71EaJDc0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NI Ke2stsdZ5LlE7fh4vqx7RwX4aHP51UpbMP7hszVo3emyveN3vU7KWeAgdi9_W7yh1n64KiuxN_gd BmAPc5Y73CUCZIWHHWC83ABx0RmV1yUkfxZe75CpFfuwmzsEQxrvruKxuHwxjg4xfH7DNobdLxM9 wGZrAs.Rhnip0tHd791r.KaeMurkzlxXUBJyQ2VYvIFASjDnglwf52QSwhiLx3Uto6xOWwBIuUEx tfv4zSrjB3fSugk48vK8fllkEF4AiX_GLZeqFTK3g_ocUrFfmugpOkEJm4GPJdBiy61ONZ2iXdS9 B9BwO.qxSU5fSniFrY4VIaFsF17q56.K94wJ8nKW_dGekiOmnvPza.r6wvj7rFNQld60gEoCFmlm Luz6OBRcWW.VhMKG9PhhXllQaUlae4tyGctI2z21ENL2xHR6jip1Rdp1_9ik0iI8nwWOC2bK68ad yhuIHdoJcrhVaG8w69AjHDBr4ysAAbmnRIeSieyOWF1AldtKLtC041rlCE3hqz9OIAGDwlh.djcI 0uOOCvmX4CGawhleOjBWVJkuAwYSGQaRgTcEHLwtIXYPdbyEJz62JQGOLlfbAPbCFhRJd6yw9ag- - X-Sonic-MF: X-Sonic-ID: a2ee40fc-9e66-433c-9dd5-b1b436db97a2 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.gq1.yahoo.com with HTTP; Thu, 28 Dec 2023 20:22:29 +0000 Received: by hermes--production-gq1-6949d6d8f9-7dnvp (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 8fe1ed7bc23f3be0cdb262c7e78c3a68; Thu, 28 Dec 2023 20:22:27 +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 \(3774.300.61.1.2\)) Subject: Re: enabling powerd on RPi From: Mark Millard In-Reply-To: Date: Thu, 28 Dec 2023 12:22:16 -0800 Cc: freebsd-arm Content-Transfer-Encoding: quoted-printable Message-Id: <0E56E105-2A22-460E-9C58-24074922AA18@yahoo.com> References: To: Mike Karels X-Mailer: Apple Mail (2.3774.300.61.1.2) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated 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-Spamd-Bar: ---- X-Rspamd-Queue-Id: 4T1KgW6FGbz4VTR On Dec 28, 2023, at 11:11, Mike Karels wrote: > I am looking at enabling powerd by default on the Raspberry Pi 4 and = maybe > others. There is a bug from 2021 on the subject which has gotten some = recent > discussion, https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256836. = Also, > problems come up from time to time about performance problems because = people > don't know to enable powerd. It makes FreeBSD look much slower than = Linux. If performance comparison to linux is a driving issue, seeing what linux does about sdram_freq and sdram_freq_min may be relevant. This may be in whole, or in part, based on the RPi* firmware version the: = https://www.raspberrypi.com/documentation/computers/config_txt.html#overcl= ocking-options and its: "This table gives the default values for the options on various Raspberry Pi models, all frequencies are stated in MHz." content has varied as firmware releases have been made. But I've not always found that the two match for FreeBSD. This might be because they mixed firmware and linux defaults without being explicit, something I've run into before. (I'll note that the history of the documented defaults is available via giuthub, even if somewhat messy as they restructured the documentation over time.) For the RPi4B's and Pi 400's the modern tables indicate sdram_freq_min=3D3200 is the default. It used to be sdram_freq_min=3D400 = . Recent testing of stable/14 snapshots with RPI4B's has shown the 400 figure is in use. Only the RPi4B's, Pi 400's, and Pi5 show non-400 defaults in the modern table. Another such example is that RPi4B Rev 1.4+ is documented to have arm_freq=3D1800 by default if arm_boot=3D1 in config.txt . Otherwise RPi4B's are documented to use 1500 as the default. But FreeBSD does not end up with the documented figures: ending up matching the default arm_freq_min=3D600 instead of (all but Pi0/W, Pi1, and Pi 5 are documhted to have the 600). My guess is that FreeBSD makes its own assignments. Note that the default arm_freq_min is model dependent if Pi0/W, Pi1, or [someday] Pi 5 are to be covered. > The simplest action is to enable powerd by default on the = arm64-aarch64-RPI > images. This would affect RPi 4 and variants, also RPI 3* and later = RPi 2. > I enabled powerd on an RPi 3B+, and it seems to have no issues; it = seems > to work. Does anyone know of a disadvantage of enabling powerd on RPI > images for all targets? Serial port configurations that attempt to use the mini-uart have problems with core_freq changes changing the serial console frequency in use. (mini-uart used for bluetooth instead has such issues too.) Which UART is used by default varies by model, the bluetooth capable families (so, e.g., not Pi2) having the mini-uart for the serial port and full UART for bluetooth. (I'm not clear on the v1.1 vs. v1.2 for the RPi2B's.) core_freq and core_freq_min also vary by model. There is a core_freq_min. core_freq and core_freq_min defaults are documented as model specific. hdmi_enable_4kp60 use changes the default for core_freq and core_freq_min as well. There is enable_uart=3D1 to force the core clock to be fixed for seerial use, which frequency is dependent on force_turbo=3D1 vs. not. I do not know what FreeBSD does about such things if it does not match such documentation. There is: = https://www.raspberrypi.com/documentation/computers/configuration.html#con= figuring-uarts that says, in part, QUOTE In order to use the mini UART, you need to configure the Raspberry Pi to use a fixed VPU core clock frequency END QUOTE I'll also note that arm_64bit=3D1 is the default for the RPi4B's, Pi 400, CM4, and CM4S these days, but not for the rest that are 64=3Dbit capable (ignoring RPi5's, which do not have the parameter). I do not know what FreeBSD does about such things if it does not match such documentation. > The alternative would be to configure at the first > boot, although I'm not positive of a definitive way to identify the = RPi > variants. Maybe just looking for a dev.cpu.0.freq sysctl node would > suffice. >=20 > If no one objects, I will make changes to enable powerd on RPI = snapshots > for 15-current, and we can see what happens. =3D=3D=3D Mark Millard marklmi at yahoo.com