From patchwork Thu Aug 3 11:08:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Massimo Pegorer X-Patchwork-Id: 1816386 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; 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=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=afsUlBfJ; dkim-atps=neutral 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 (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RGmM44mb7z1ybS for ; Thu, 3 Aug 2023 21:09:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5FF5386CA3; Thu, 3 Aug 2023 13:09:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="afsUlBfJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9807686C9C; Thu, 3 Aug 2023 13:08: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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 58E3686BFD for ; Thu, 3 Aug 2023 13:08:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=massimo.pegorer+oss@gmail.com Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b9b904bb04so12736991fa.1 for ; Thu, 03 Aug 2023 04:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691060917; x=1691665717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=ivi1TLr7XmfE9kjTI78EPloZ2zhNoLewhp9c+OyIvio=; b=afsUlBfJCkwRMK2Gq5KMdbgLq5pTHsBWWkzdzWHQc5RRQHvK8V7ZA1jW4jRSPc+l4L qaBXZoO3ZgJ07IvpZVxwQVEnZaKh3KZ2aI8vhqZzHfcp9shbaumhef8eN3L+Bfzxd4Sk pEZTlRbMmbDur/nWWIBiBJ3+nMsupY0Egumo60Okfbim1M4hGXnx7ohyw8qNxsi3ZuxH bjQzGi4KyxtDp6Mr3k1ZuNtHCSwzZzezlQPI306JMNGbZMbExQfcr5kYhPrF83jbyLJE UCBtvQs0INpfwL6ybwE+w+NF1Ct+Qf+cvuvNbgwlkGQYDLN9vTQzkPtp+5g/qCep44d0 LYWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691060917; x=1691665717; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ivi1TLr7XmfE9kjTI78EPloZ2zhNoLewhp9c+OyIvio=; b=WyxUo0V6fBm8NTu6gniwqmaTMtZNuiBRWQ0oXw0BNHJDjirB0MYlCeAWjSSpM0Ps7Y 8Pri5a8EEJlGKzRnpPqbrUXEsQwpDMV2xtM9yRMRxU2S18hfPDH2URWxtritKWXzpklm xlCMYqp4sEgvWoDuJv09tLrqbF3IRS2cFtxa0UJbbQNHDXy73CA1xXbr7sLRiF1Mf7kq 6UGPKd6lsppgQN8hIcJQiiY2weZAHU0qyY0koPMzsTBWCcuL/tgz/2mzuZDZKRW/NUA+ ccuIB7JRpwWi06iSMxjUhRTFrsMKnBobKvTPiM/S+w9lQq74iQ55tWTP6906d5v3g1HX EY1g== X-Gm-Message-State: ABy/qLbr1TBAEpx7RGdHrEF54x6qj8ow2Y38jVORnkLoJ9EBATPv1D4j Xgk8QFPwU9pvndzf/NSULxRzgDn2S91wyw== X-Google-Smtp-Source: APBJJlGs5j1v8Cm6Rwx4cgI2fJZVMwpNWd6JFLJo+Jy0QMemULkv1QJoNwh7s3gII/+VbJbajHIEJA== X-Received: by 2002:a2e:83d0:0:b0:2b6:e96c:5414 with SMTP id s16-20020a2e83d0000000b002b6e96c5414mr6699167ljh.52.1691060917351; Thu, 03 Aug 2023 04:08:37 -0700 (PDT) Received: from pegmas-T15.fritz.box ([151.71.248.167]) by smtp.gmail.com with ESMTPSA id e3-20020a17090681c300b00997d76981e0sm10329528ejx.208.2023.08.03.04.08.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 04:08:36 -0700 (PDT) From: Massimo Pegorer To: u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar Cc: Lukasz Majewski , Sean Anderson , Massimo Pegorer Subject: [PATCH 1/3] clk: rockchip: rk3308: Fix ordering between masking and shifting Date: Thu, 3 Aug 2023 13:08:11 +0200 Message-Id: <20230803110813.175956-2-massimo.pegorer+oss@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803110813.175956-1-massimo.pegorer+oss@gmail.com> References: <20230803110813.175956-1-massimo.pegorer+oss@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 03 Aug 2023 13:09:10 +0200 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 As per definitions of masks and shift offsets in cru_rk3308.h, values read from registers must be first masked and then shifted. By the way, this fix is binary invariant, because in all of fixed cases the shift offset is zero. Signed-off-by: Massimo Pegorer Reviewed-by: Kever Yang --- drivers/clk/rockchip/clk_rk3308.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/rockchip/clk_rk3308.c b/drivers/clk/rockchip/clk_rk3308.c index 64f33587e2..d27673c454 100644 --- a/drivers/clk/rockchip/clk_rk3308.c +++ b/drivers/clk/rockchip/clk_rk3308.c @@ -150,7 +150,7 @@ static ulong rk3308_i2c_get_clk(struct clk *clk) } con = readl(&cru->clksel_con[con_id]); - div = con >> CLK_I2C_DIV_CON_SHIFT & CLK_I2C_DIV_CON_MASK; + div = (con & CLK_I2C_DIV_CON_MASK) >> CLK_I2C_DIV_CON_SHIFT; return DIV_TO_RATE(priv->dpll_hz, div); } @@ -314,7 +314,7 @@ static ulong rk3308_saradc_get_clk(struct clk *clk) u32 div, con; con = readl(&cru->clksel_con[34]); - div = con >> CLK_SARADC_DIV_CON_SHIFT & CLK_SARADC_DIV_CON_MASK; + div = (con & CLK_SARADC_DIV_CON_MASK) >> CLK_SARADC_DIV_CON_SHIFT; return DIV_TO_RATE(OSC_HZ, div); } @@ -342,7 +342,7 @@ static ulong rk3308_tsadc_get_clk(struct clk *clk) u32 div, con; con = readl(&cru->clksel_con[33]); - div = con >> CLK_SARADC_DIV_CON_SHIFT & CLK_SARADC_DIV_CON_MASK; + div = (con & CLK_SARADC_DIV_CON_MASK) >> CLK_SARADC_DIV_CON_SHIFT; return DIV_TO_RATE(OSC_HZ, div); } @@ -385,7 +385,7 @@ static ulong rk3308_spi_get_clk(struct clk *clk) } con = readl(&cru->clksel_con[con_id]); - div = con >> CLK_SPI_DIV_CON_SHIFT & CLK_SPI_DIV_CON_MASK; + div = (con & CLK_SPI_DIV_CON_MASK) >> CLK_SPI_DIV_CON_SHIFT; return DIV_TO_RATE(priv->dpll_hz, div); } @@ -429,7 +429,7 @@ static ulong rk3308_pwm_get_clk(struct clk *clk) u32 div, con; con = readl(&cru->clksel_con[29]); - div = con >> CLK_PWM_DIV_CON_SHIFT & CLK_PWM_DIV_CON_MASK; + div = (con & CLK_PWM_DIV_CON_MASK) >> CLK_PWM_DIV_CON_SHIFT; return DIV_TO_RATE(priv->dpll_hz, div); } From patchwork Thu Aug 3 11:08:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Massimo Pegorer X-Patchwork-Id: 1816387 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; 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=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=iphVQnVm; dkim-atps=neutral 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 (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RGmMF48fSz1ybS for ; Thu, 3 Aug 2023 21:09:29 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3730386CB1; Thu, 3 Aug 2023 13:09:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iphVQnVm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 82F8886A85; Thu, 3 Aug 2023 13:08:42 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2DEA986CA2 for ; Thu, 3 Aug 2023 13:08:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=massimo.pegorer+oss@gmail.com Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-5230ac6dbc5so924791a12.3 for ; Thu, 03 Aug 2023 04:08:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691060919; x=1691665719; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=rr1OBx78qXJ4GbkL0jLmykley8lYJZWU/2hARcEsK/s=; b=iphVQnVmOw07jigtuf8ChueyA7SrE/m3Z883M8bEQ/rS+0pva+qOE+uJj64xtdkpXW Tv23DOLEXVNAt6pYWLnBfouXOFR4wiai2xbraNyM7svU6O0apZ7iWv3h5gb74q5XQiS0 jG+Nj5GtQ5qbsQwqWFPV+xa1FHEcT0g+RpnNaEffHjWD9p3rBcouY36O8Na31jlQIwXz hPQlfv+Tu3Nb2pefwEb2rGQw3AdkMLCy+1eacHlL1bBKRgjzUn7ge2UGoL9raIGX2nnO C7wIjSgjjQp1ksSxF1syPeoKFszIcoO44PTJttWl6MjbLBb+5PJ/Rm+q7PPDurjKS3ui 3Ibg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691060919; x=1691665719; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rr1OBx78qXJ4GbkL0jLmykley8lYJZWU/2hARcEsK/s=; b=PXEd2t/UCobZB25YYAzOWJlKQRXVANH582+da7ve5tgkyURcqcZQ6ska1cXHv2mb4e rQzJG8ARx5JSXq99OYrxQ1pW5mhkFNiXB0L51Xdc9wZr6cKem/1MZxnEWbiWkWo4R0YL IjBwY1qHs8iRNcCh5P6UDPezPUWp0Peyx84xYTZtxjI5G2og0gHKFbym0xJ8z74jzwJh 6rYx4sO/wdeeOXXUF+oYiC1QHKa90kASs9iG4Y2BcubyQLf7AiKnxSbahEZNwc/UfgA+ QggqO77LUGfpOP1LB2kW1hbX9Y8RraXhFO8/SdCQThmGwd36FjNpILDZBAE1p2wjcEQn ul1A== X-Gm-Message-State: ABy/qLZBMk6CFzBwSov8KLjZufSYNsOekolnexpmTbI0kvGXksL939qX Kj7f45YN97jUSn2xzvxEGDvexXMbg3GS8A== X-Google-Smtp-Source: APBJJlFr46N/X9sX7u27jr+wAjhJLhg3Wpalm25YFxjbXERu8srK1LnqbMr+hTgiCwuWAi1FETnOiA== X-Received: by 2002:a17:907:b09:b0:993:eef2:5d61 with SMTP id h9-20020a1709070b0900b00993eef25d61mr6899657ejl.27.1691060919608; Thu, 03 Aug 2023 04:08:39 -0700 (PDT) Received: from pegmas-T15.fritz.box ([151.71.248.167]) by smtp.gmail.com with ESMTPSA id e3-20020a17090681c300b00997d76981e0sm10329528ejx.208.2023.08.03.04.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 04:08:39 -0700 (PDT) From: Massimo Pegorer To: u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar Cc: Lukasz Majewski , Sean Anderson , Massimo Pegorer Subject: [PATCH 2/3] clk: rockchip: rk3308: Support reading UART rate and clock registers Date: Thu, 3 Aug 2023 13:08:12 +0200 Message-Id: <20230803110813.175956-3-massimo.pegorer+oss@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803110813.175956-1-massimo.pegorer+oss@gmail.com> References: <20230803110813.175956-1-massimo.pegorer+oss@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 03 Aug 2023 13:09:10 +0200 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 Add support to read RK3308 registers used to configure UART clocks, and thus to get UART rate and baudrate. This fixes clock_get_rate returning error on serial device probing. Moreover, there is no need anymore to use 'clock-frequency' property for UART nodes in *-u-boot.dtsi files for all cases where UART is not inited by U-Boot proper or by SPL o by TPL code but by a preliminary external boot phase (for Rock PI S, UART is inited by external TPL). Signed-off-by: Massimo Pegorer Reviewed-by: Kever Yang --- arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi | 2 - arch/arm/include/asm/arch-rk3308/cru_rk3308.h | 15 +++++ drivers/clk/rockchip/clk_rk3308.c | 59 +++++++++++++++++++ 3 files changed, 74 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi index 09694b41e5..61415559b7 100644 --- a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +++ b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi @@ -12,6 +12,4 @@ &uart0 { bootph-all; - clock-frequency = <24000000>; - status = "okay"; }; diff --git a/arch/arm/include/asm/arch-rk3308/cru_rk3308.h b/arch/arm/include/asm/arch-rk3308/cru_rk3308.h index 86c906bb0e..84b63e4d56 100644 --- a/arch/arm/include/asm/arch-rk3308/cru_rk3308.h +++ b/arch/arm/include/asm/arch-rk3308/cru_rk3308.h @@ -189,6 +189,21 @@ enum { DCLK_VOP_DIV_SHIFT = 0, DCLK_VOP_DIV_MASK = 0xff, + /* CRU_CLKSEL_CON10 */ + /* CRU_CLKSEL_CON13 */ + /* CRU_CLKSEL_CON16 */ + /* CRU_CLKSEL_CON19 */ + /* CRU_CLKSEL_CON22 */ + CLK_UART_PLL_SEL_SHIFT = 13, + CLK_UART_PLL_SEL_MASK = 0x7 << CLK_UART_PLL_SEL_SHIFT, + CLK_UART_PLL_SEL_DPLL = 0, + CLK_UART_PLL_SEL_VPLL0, + CLK_UART_PLL_SEL_VPLL1, + CLK_UART_PLL_SEL_480M, + CLK_UART_PLL_SEL_24M, + CLK_UART_DIV_CON_SHIFT = 0, + CLK_UART_DIV_CON_MASK = 0x1f << CLK_UART_DIV_CON_SHIFT, + /* CRU_CLK_SEL25_CON */ /* CRU_CLK_SEL26_CON */ /* CRU_CLK_SEL27_CON */ diff --git a/drivers/clk/rockchip/clk_rk3308.c b/drivers/clk/rockchip/clk_rk3308.c index d27673c454..d0a3f65446 100644 --- a/drivers/clk/rockchip/clk_rk3308.c +++ b/drivers/clk/rockchip/clk_rk3308.c @@ -451,6 +451,58 @@ static ulong rk3308_pwm_set_clk(struct clk *clk, uint hz) return rk3308_pwm_get_clk(clk); } +static ulong rk3308_uart_get_clk(struct clk *clk) +{ + struct rk3308_clk_priv *priv = dev_get_priv(clk->dev); + struct rk3308_cru *cru = priv->cru; + u32 div, pll_sel, con, con_id, parent; + + switch (clk->id) { + case SCLK_UART0: + con_id = 10; + break; + case SCLK_UART1: + con_id = 13; + break; + case SCLK_UART2: + con_id = 16; + break; + case SCLK_UART3: + con_id = 19; + break; + case SCLK_UART4: + con_id = 22; + break; + default: + printf("do not support this uart interface\n"); + return -EINVAL; + } + + con = readl(&cru->clksel_con[con_id]); + pll_sel = (con & CLK_UART_PLL_SEL_MASK) >> CLK_UART_PLL_SEL_SHIFT; + div = (con & CLK_UART_DIV_CON_MASK) >> CLK_UART_DIV_CON_SHIFT; + + switch (pll_sel) { + case CLK_UART_PLL_SEL_DPLL: + parent = priv->dpll_hz; + break; + case CLK_UART_PLL_SEL_VPLL0: + parent = priv->vpll0_hz; + break; + case CLK_UART_PLL_SEL_VPLL1: + parent = priv->vpll0_hz; + break; + case CLK_UART_PLL_SEL_24M: + parent = OSC_HZ; + break; + default: + printf("do not support this uart pll sel\n"); + return -EINVAL; + } + + return DIV_TO_RATE(parent, div); +} + static ulong rk3308_vop_get_clk(struct clk *clk) { struct rk3308_clk_priv *priv = dev_get_priv(clk->dev); @@ -813,6 +865,13 @@ static ulong rk3308_clk_get_rate(struct clk *clk) case SCLK_EMMC_SAMPLE: rate = rk3308_mmc_get_clk(clk); break; + case SCLK_UART0: + case SCLK_UART1: + case SCLK_UART2: + case SCLK_UART3: + case SCLK_UART4: + rate = rk3308_uart_get_clk(clk); + break; case SCLK_I2C0: case SCLK_I2C1: case SCLK_I2C2: From patchwork Thu Aug 3 11:08:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Massimo Pegorer X-Patchwork-Id: 1816388 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; 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=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=QwKIRgHX; dkim-atps=neutral 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 (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RGmMR3X0rz1ybS for ; Thu, 3 Aug 2023 21:09:39 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1795F86CC0; Thu, 3 Aug 2023 13:09:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="QwKIRgHX"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 554FF86CB2; Thu, 3 Aug 2023 13:08:46 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9D06086A85 for ; Thu, 3 Aug 2023 13:08:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=massimo.pegorer+oss@gmail.com Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-99c0290f0a8so107556666b.1 for ; Thu, 03 Aug 2023 04:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691060923; x=1691665723; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=aOxpbRTq3xGgEBorYXWLBDcdBdjRHtBjmtC8waTSkO8=; b=QwKIRgHXO+juk7rB7b5mBDZO5y+qLRh8N5gnu5lsPH7v8E39AXg0mnQx27Ei4+K9x4 jV0zmq5AZNZdP1LgXmN/px9S36lO0pEiSDjD/JnbV7yHD8ysyjHogL+GQL23XqmpLTtH vKabcBmNn+06ZpomYme71s5Xxsp6kVNuoFY6e/69ba0Jozn7XYFheIzXwKhdkCS1rWmh qnheDo+Cja7bgLIXpTe+s6YkpN7V8lVTCKUHkTNkbuUnrXMFsQrLDc5HWRVf0BEEgFTB h3WeIjs3nDfC9y51rKQxkVD+IXgrUATQfMvNFzy6fLuzI1whV6nqgY4QcTIDeNloSuW3 869w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691060923; x=1691665723; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aOxpbRTq3xGgEBorYXWLBDcdBdjRHtBjmtC8waTSkO8=; b=eeiWJYXE4TRd1WPS26qF4lJOlLdAfhBjxibotAUy8311xTjen25O8u0+wWhjiyHu1c j3POamypicXAjOyRElc1Ak6y3RfmXy+rVsYplL8qHmSi43ilV4SFRDcsMrOGjgkHyBj6 Xj3IugiDdIoLyCJ+TYZz8rLvH4/gynuSYlDL+B8JfY5y1eUQI4ubdQI/mCsLPpMAU+TV bCLN1VAxzWpptQOL98RbOEVkTqu+q9KaHkgiUFBo84ffOe10X5MOVr/zoEmJ1ZKLABIX xFnRw/m0vRL7o/dRkM0J3S0lcaRracwz+NvJLgDGHbHvxmDaSXtns9uEvalLOypmzSPE FScw== X-Gm-Message-State: ABy/qLZU1JmHTI7+KlMAYjsWQmQ47z3f1sBENP6l6aqy/p6C/qy6NmDu Hbbnbh7xaw8sUi30v5y3nET4q1evvyx5dA== X-Google-Smtp-Source: APBJJlF5FB8c7o3jpo7JYaFA2WrnoddJ2dvVs24mpsuA6gRyisDq4ULB9X+CFBgeLzX+1FUHkE8h7g== X-Received: by 2002:a17:907:b10:b0:99c:5056:4e2e with SMTP id h16-20020a1709070b1000b0099c50564e2emr2712832ejl.31.1691060923204; Thu, 03 Aug 2023 04:08:43 -0700 (PDT) Received: from pegmas-T15.fritz.box ([151.71.248.167]) by smtp.gmail.com with ESMTPSA id e3-20020a17090681c300b00997d76981e0sm10329528ejx.208.2023.08.03.04.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 04:08:42 -0700 (PDT) From: Massimo Pegorer To: u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Akash Gajjar Cc: Lukasz Majewski , Sean Anderson , Massimo Pegorer Subject: [PATCH 3/3] dts: rockchip: rk3308: Avoid warning for serial probe on prereloc Date: Thu, 3 Aug 2023 13:08:13 +0200 Message-Id: <20230803110813.175956-4-massimo.pegorer+oss@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230803110813.175956-1-massimo.pegorer+oss@gmail.com> References: <20230803110813.175956-1-massimo.pegorer+oss@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Thu, 03 Aug 2023 13:09:10 +0200 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 Make device tree complete and consistent for pre relocation phase. Some nodes are missing, causing warnings to be issued on serial port probing during pre relocation phase (uclass_get_device_by_phandle_id fails when called by pinctrl_select_state_full: none of these failures is fatal nor causing issues). Add to *-u-boot.dtsi all required nodes with the 'bootph-some-ram' attribute. Signed-off-by: Massimo Pegorer Reviewed-by: Kever Yang --- arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi index 61415559b7..d88dee8057 100644 --- a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi +++ b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi @@ -13,3 +13,30 @@ &uart0 { bootph-all; }; + +&pinctrl { + bootph-some-ram; + + uart0 { + bootph-some-ram; + }; + rtc { + bootph-some-ram; + }; +}; + +&uart0_xfer { + bootph-some-ram; +}; + +&uart0_cts { + bootph-some-ram; +}; + +&uart0_rts { + bootph-some-ram; +}; + +&rtc_32k { + bootph-some-ram; +};