From patchwork Tue Apr 30 15:30:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Karlman X-Patchwork-Id: 1929688 X-Patchwork-Delegate: ykai007@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=kwiboo.se header.i=@kwiboo.se header.a=rsa-sha256 header.s=fe-e1b5cab7be header.b=Ns8BWggq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VTPQ964mVz23jG for ; Wed, 1 May 2024 01:34:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 06F2488A56; Tue, 30 Apr 2024 17:33:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=kwiboo.se header.i=@kwiboo.se header.b="Ns8BWggq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9DF4088A62; Tue, 30 Apr 2024 17:33:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp.forwardemail.net (smtp.forwardemail.net [167.172.40.54]) (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 E12A888A56 for ; Tue, 30 Apr 2024 17:33:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kwiboo.se Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=SRS0=8b89=ME=kwiboo.se=jonas@fe-bounces.kwiboo.se DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kwiboo.se; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-ID: Date: Subject: Cc: To: From; q=dns/txt; s=fe-e1b5cab7be; t=1714491152; bh=xLF7G970im7TYuLEdVvA0tVzyEXwL+uVlSSBljKE9yo=; b=Ns8BWggqDG51xMAMMmigysyil26weOz+AOerKkJ5DiOr1Apimwomxo2GXjZuLPPOp8Ffvz29w YFyfzAaSArzkS4d33p+RqFotFnTwReQhleML8OOuDZzAomdHEjpwqVxuopZGoeKDPpQJP1oxuaQ 0C13WHlaVNlCgMa2zLp/gXdOoEFcUiDusLI8Pjt1sxYLgm3QcOTschj/fXjq6MiyHJRHWqnAJ4t TcB7GhBVzhLCsUdueHDYeJZsVYIXeqWEqSXD/5vE1o0BlF9ezcZVBtF3arNEfGwaV12lZ42UYJF Yxus0VsWJm5OsPouLXtyLbX8Oj1ebdchAz9GMxR3g48g== From: Jonas Karlman To: Kever Yang , Simon Glass , Philipp Tomsich , Tom Rini , Quentin Schulz , Klaus Goger Cc: Peter Robinson , u-boot@lists.denx.de, Jonas Karlman Subject: [PATCH v2 16/18] rockchip: rk3399: Include uart related pinctrl nodes in TPL/SPL Date: Tue, 30 Apr 2024 15:30:23 +0000 Message-ID: <20240430153053.308788-17-jonas@kwiboo.se> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240430153053.308788-1-jonas@kwiboo.se> References: <20240430153053.308788-1-jonas@kwiboo.se> MIME-Version: 1.0 X-Report-Abuse-To: abuse@forwardemail.net X-Report-Abuse: abuse@forwardemail.net X-Complaints-To: abuse@forwardemail.net X-ForwardEmail-Version: 0.4.40 X-ForwardEmail-Sender: rfc822; jonas@kwiboo.se, smtp.forwardemail.net, 167.172.40.54 X-ForwardEmail-ID: 66310efdd99e42224315b925 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 The initial serial console UART iomux is typically configured in board_debug_uart_init() at TPL stage on Rockchip platform. Later stages typically use pinctrl driver to configure iomux UART once again based on the control FDT. Include uart related pinctrl nodes in TPL/SPL control FDT to make it possible for pinctrl driver to configure UART iomux at TPL/SPL stage. Following debug log message may also be seen at U-Boot pre-reloc stage: ns16550_serial serial@ff1a0000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19 This can be resolved by including bootph prop for U-Bood pre-reloc phase (bootph-some-ram or bootph-all). However, this has intentionally been excluded due to including it unnecessarily slows down boot around 200-400 ms. Also add the clock-frequency prop similar to what has been done for other Rockchip SoCs. Signed-off-by: Jonas Karlman Reviewed-by: Kever Yang --- v2: New patch split from "Fix loading FIT from SD-card" patch v2: Change to only include pinctrl nodes in TPL and SPL phase Hopefully the clock-frequency prop can be used to help speed up boot in a future patch series, loading the uart rate from clock driver currently delays boot at i.e. U-Boot proper pre-reloc. --- arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi | 16 ++++++++++++++++ arch/arm/dts/rk3399-u-boot.dtsi | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi b/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi index 390cf24152a6..d1912a2ef6a9 100644 --- a/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi +++ b/arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi @@ -113,4 +113,20 @@ &uart0 { bootph-all; + clock-frequency = <24000000>; +}; + +&uart0_cts { + bootph-pre-sram; + bootph-pre-ram; +}; + +&uart0_rts { + bootph-pre-sram; + bootph-pre-ram; +}; + +&uart0_xfer { + bootph-pre-sram; + bootph-pre-ram; }; diff --git a/arch/arm/dts/rk3399-u-boot.dtsi b/arch/arm/dts/rk3399-u-boot.dtsi index 9815dc53e8ed..b39fe39fa2b3 100644 --- a/arch/arm/dts/rk3399-u-boot.dtsi +++ b/arch/arm/dts/rk3399-u-boot.dtsi @@ -136,6 +136,12 @@ &uart2 { bootph-all; + clock-frequency = <24000000>; +}; + +&uart2c_xfer { + bootph-pre-sram; + bootph-pre-ram; }; &vopb {