Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6D73C369D5 for ; Mon, 28 Apr 2025 12:33:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 10E10828A2; Mon, 28 Apr 2025 14:33:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=freeshell.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 820EE828A2; Mon, 28 Apr 2025 14:33:42 +0200 (CEST) Received: from freeshell.de (freeshell.de [IPv6:2a01:4f8:231:482b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 378EC826AD for ; Mon, 28 Apr 2025 14:33:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=freeshell.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=e@freeshell.de Received: from [192.168.2.35] (unknown [98.97.61.227]) (Authenticated sender: e) by freeshell.de (Postfix) with ESMTPSA id 7A24AB4C205B for ; Mon, 28 Apr 2025 14:33:39 +0200 (CEST) Message-ID: <9845576a-05f8-45d3-a3f5-30f270fa55b9@freeshell.de> Date: Mon, 28 Apr 2025 05:33:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: RISC-V (and others?) UART0 clock rate from OF_UPSTREAM From: E Shattow To: U-Boot Mailing List References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 4/23/25 13:09, E Shattow wrote: > Quoting Emil reply to > https://lore.kernel.org/lkml/CAJM55Z95pwTZmw-WPcUaB1BGpVoNgaRYYjUnqSFcLTNyVmZahg@mail.gmail.com/ > >> diff --git a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi > b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi >> index 8a59c3001339..6bb13af82147 100644 >> --- a/arch/riscv/boot/dts/starfive/jh7110-common.dtsi >> +++ b/arch/riscv/boot/dts/starfive/jh7110-common.dtsi >> @@ -635,6 +635,7 @@ GPOEN_DISABLE, >> }; >> >> &uart0 { >> + clock-frequency = <24000000>; >> pinctrl-names = "default"; >> pinctrl-0 = <&uart0_pins>; >> status = "okay"; > > "The uart0 node already has a reference to the uart0_core clock, so it > shouldn't need this property." > > jh7110-common-u-boot.dtsi-26-&uart0 { > jh7110-common-u-boot.dtsi-27- bootph-pre-ram; > jh7110-common-u-boot.dtsi-28- reg-offset = <0>; > jh7110-common-u-boot.dtsi-29- current-speed = <115200>; > jh7110-common-u-boot.dtsi:30: clock-frequency = <24000000>; > > $ grep -B1 -rn 24000000 dts/upstream/src/riscv/starfive/ > dts/upstream/src/riscv/starfive/jh7110-common.dtsi-115-&osc { > dts/upstream/src/riscv/starfive/jh7110-common.dtsi:116: clock-frequency > = <24000000>; > > What should U-Boot be doing to get this uart0 setting when OF_UPSTREAM ? > > -E P.S. As best I can yet understand in drivers/serial/ns16550.c the call to clk_get_by_index() returns -19 (error) when in SPL and returns 0 (success) when in U-Boot Main. I've tried adding bootph-pre-ram to every node in devicetree but it's the same error in SPL phase. Is this supposed to be working in SPL? -E