From patchwork Fri Mar 14 15:31:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 873453 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp773871wrq; Fri, 14 Mar 2025 08:31:34 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU6tNdOvj8zEc2FlO1BvqJ3V6cMIumbKoO1XKSdQz7iPsY3ngqSXIRm+KG/UPFk68Q5IS52Dg==@linaro.org X-Google-Smtp-Source: AGHT+IHYf6vreCRBZkBPcOC4p8OlIs8HN5cam0noSsK5F9dZQXLYVu4kxBg5SRe7QM5SK7mwpZoe X-Received: by 2002:a05:6402:254e:b0:5e5:bdfe:6c16 with SMTP id 4fb4d7f45d1cf-5e89f346e48mr3234421a12.3.1741966294015; Fri, 14 Mar 2025 08:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741966293; cv=none; d=google.com; s=arc-20240605; b=Wt9Gfs8ZU1LepUyA+bsS6WeF8s7bM6yySLG+7T4D4mhd3h3hrCXE5i8PijA9j7r/un 3pXeEpswtK6eNattu0B7fWIxlv5qMqzE+dXnYcXQ1Y07rw+aeurilpzdSw7eYcRveXvM CS6XblcPydJDpPFTC+ULHP5cqr7fatcoR3WMcHsFTUzY9nHeKJLCBEdhy9QM+5pjG5nw wHvpoL/b6Qwoot0l1b+tKvGg7nCD89SaTEqxuCwL6ho0UJFxS0J3upT7qN+oO63xrpvh K1J26J27R5sLZ7ihpMXabOxONAGE9yW8k2dBPPRJHGWRuO4MS7BSW3fsr63qLGUS1pQs hGAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=s0m4/Z5dOo+I7WTYK65j7lHlRCfu5BFPnI6We4OMi+U=; fh=H/AtoT0+j8Ml0c5OOJw3Qjc5PpUuklg+qBmzesOznGw=; b=TFE+jt/hlTN+Z8XQhqJUG4GTfVmpHzmXueRWXp07bOwVoi3huEn8KcHh+KGhMepwor 7UF5J0hHoMWlEC6syaJXRgXlpkCbRFl57ylNepqSIXko2GfbMKYjvJ+OxiXsCyJEBxFQ EOaILWfJ0SRN5bTNHHBgziyWMb2/LUa2gpleUFe1Xd2874nt1BzPyul4EER1IvKisos6 nlBDJ8frRIWtYD2bD8h+17clqDm1+RkU5RTXLXnIkRKF91MpGcsCt+zijcduzEJW5+ju lhoQV/q1EfAyWVEdcFx6XFyey21pMiyAAMchaBeDRHecoJPL9gdQDXYHcrrsRKSMWXrP KSQA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qxgiGRg8; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5e8169779e5si3292514a12.121.2025.03.14.08.31.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:31:33 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qxgiGRg8; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2E34681DD6; Fri, 14 Mar 2025 16:31:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qxgiGRg8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7EF5481E18; Fri, 14 Mar 2025 16:31:26 +0100 (CET) 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 CD5DF81DE9 for ; Fri, 14 Mar 2025 16:31:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso1887043f8f.0 for ; Fri, 14 Mar 2025 08:31:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741966283; x=1742571083; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s0m4/Z5dOo+I7WTYK65j7lHlRCfu5BFPnI6We4OMi+U=; b=qxgiGRg8BDJ0wl9nzUKbSMX41ktyclIUo5gYbiVgmJJhYxfArS/xLz9C0tCMeFYlvP Det3siBrKsQErRccCYvHZT8KNBjHS4HR9CxK/rYf+dpsRq3TXuIMQ5q/iTwVaQ6xUkRy ioiBItBtZpbR4cpoR/UW5r4sX8WFwBK26Ti8nXOoGte8Ns/wzWOvQejY2uUgoaQh+vh9 tIzOl60DSKXLwTEB5u6I4KUQz6STDGuDOjNR3uPZ6JuICOou5n3jcowZMzAnuus102PA Gzm6St9dRUeOGlAb0BpATzivbSOU+CPB3yNwXQgJgq8zZZJjCI2LhrHfM90Kd528G1kN BoOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966283; x=1742571083; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s0m4/Z5dOo+I7WTYK65j7lHlRCfu5BFPnI6We4OMi+U=; b=UYIHJo0FrV+9d/01YfefAQ3uzODMVmOlz0HcSF8l7VP7IhVYPb+5ezfuj6cNVFxUTY mwpo2acbB2tD/PGARKBp+iT0jIgjQCC9ptcLSof4oOrOCcOlGpK9taMeIAZ5NIy+bkED cZXRFV2owr7e7KAmh4boTZXIONdRupjFwAXL4nHluYvarYUG2igRbVnp7d3dD7zWWrKZ fh3Hx+OBPQGsOp2nG0BnwyDVMx9GnG5p5J2NaGX2s/oB57/gpJSU+m4QST74c0C9Z134 J7wS6xRQpHWOk3TF/7Mlo9S9H8/Dkf/H7JirppefJrupsHDKsVeqNTVcsXRY/LaiU4SZ dhlQ== X-Forwarded-Encrypted: i=1; AJvYcCUO2QEPhNEBnnj6bJU6jR8v3A95MjT9VbuQ2YAZYwOW5RxVpdl5+tWi+gNdsp7u68e0R1yB+d8=@lists.denx.de X-Gm-Message-State: AOJu0YxjJJRV65g8RYiAVyYk17jZGpJosS+cNtFsB2JcVdOByJrMTE/p IVKbBuZLIb5nvB998Li4qqXlzr1GFFWLd+MYnaYzPOx+jdbCe1rNarPEHDGvu9E= X-Gm-Gg: ASbGncugLV6jtRP4H84TKHQKTjJEYK6RCjml+AL/IayPvog0szst+y7+w/Fxv6R+hjD mdSOWz95mJvKRdQLxHQeKio6jPYnecAyQtHdCD2emdltr3/L1f3y+eJhtw9FerPm56nFWgjbaZM qwG8UpOMISIZbrtHutRgdW+RvT4rVhcjqCWXPx7EkutEXU3kBuIG0KleVKWL7PUxEQvTngLeiMl 9K7AGCZRgYtrKBEcMIUZkT+zBJSR5OLiRN1x3FV4R2tEtn/B2BGa+9lQ0W5B2Mk9saeHwNckMnx CLm5KKDNPbuBg4mH49cIb7XhtDy5hxaP8m5gMlfKHuKui3xNYbZ+CdtO3NWp X-Received: by 2002:a5d:6d89:0:b0:391:4835:d888 with SMTP id ffacd0b85a97d-3971e971f65mr3749516f8f.42.1741966283164; Fri, 14 Mar 2025 08:31:23 -0700 (PDT) Received: from toyger.powerhub ([2a0a:ef40:1d11:ab01:2b81:563b:c694:c380]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb318af0sm5907399f8f.73.2025.03.14.08.31.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:31:22 -0700 (PDT) From: Caleb Connolly Date: Fri, 14 Mar 2025 15:31:19 +0000 Subject: [PATCH 1/3] clk/qcom: bubble up qcom_gate_clk_en() errors MIME-Version: 1.0 Message-Id: <20250314-sc7280-more-clocks-v1-1-ead54487c38e@linaro.org> References: <20250314-sc7280-more-clocks-v1-0-ead54487c38e@linaro.org> In-Reply-To: <20250314-sc7280-more-clocks-v1-0-ead54487c38e@linaro.org> To: Lukasz Majewski , Sean Anderson , Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=9051; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=BVqaHgiN6EQRAggbVE1+JSiYr2C0HUvLyJDG4E7p7jk=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn1EvIsREelhZXVniohXwlS8IlSM9g+sa6X2T8I twdSxyPu3KJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ9RLyAAKCRAFgzErGV9k tmLRD/4wQnJo0hLnQQICsVM+iuGmglMTW2zNBi/wfEjZuYg7EP43D0Y01DgdpDtouk2eC3c5NaK UwAxtxJI4O7OMdEOlnaS7avZi6m2EsgxDxp/iCmAubaK2DkP4UZvGIevy7z6I11hnMJK3RyA5yF 3Fvn0WFjSU69BFO4LaKWnaIqbQyn1pQT+JOembHifj87s4bizJ+b5OZMSCaRKzRkEU/j3MqrTDG OOw3wU0K/Y7nYr0InSncfho3iCMI0M/b+FRq52eEMimLEHLl2Dm5RdQ2R1eJzCVhId/3Eu4AlwO IdfcE96hJq/FqETDcAAoUmLxXwaQx7vGvUxYKzdt2kvDTUSwO9YT/3ZsAZ9o7EqV+ACHweByhUD WOagYtQDEeyQsqUdKLF36syCwlldpmH2t1+28qksyRucyyBn/2vkUDpNECb4gESQko+yQzx5B3i crqqgY5BQzntKL9jYmEX2YXYxY3lAEFN0eyHtEclTVfA2hAMU9Z7EpLgcnCIbR8mu9+TY9c78eV SfCx3tIRb4WEz7xnF8BSYe1dyfO99d2H/GvertA7k1MNYj1JM8Ob/huWjE61eHAITdOEv6q/Hkk s2dl60oZwKlpLjRO2geWf3njmY5IQyXtyUGMUyY5JXIXiPO5lPVs0sICsG51QNK36EPPWGzwq5V 342lIndvu9h4TEQ== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 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 If we try to enable a gate clock that doesn't exist, we used to just fail silently. This may make sense for early bringup of some core peripherals that we know are already enabled, but it only makes debugging missing clocks more difficult. Bubble up errors now that qcom_gate_clk_en() can return an error code to catch any still-missing clocks and make it easier to find missing ones as more complicated peripherals are enabled. Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- drivers/clk/qcom/clock-apq8016.c | 3 +-- drivers/clk/qcom/clock-qcm2290.c | 4 +--- drivers/clk/qcom/clock-qcom.h | 12 +++++++++--- drivers/clk/qcom/clock-sa8775p.c | 4 +--- drivers/clk/qcom/clock-sc7280.c | 4 +--- drivers/clk/qcom/clock-sdm845.c | 4 +--- drivers/clk/qcom/clock-sm6115.c | 4 +--- drivers/clk/qcom/clock-sm8150.c | 4 +--- drivers/clk/qcom/clock-sm8250.c | 4 +--- drivers/clk/qcom/clock-sm8550.c | 4 +--- drivers/clk/qcom/clock-sm8650.c | 4 +--- drivers/clk/qcom/clock-x1e80100.c | 4 +--- 12 files changed, 20 insertions(+), 35 deletions(-) diff --git a/drivers/clk/qcom/clock-apq8016.c b/drivers/clk/qcom/clock-apq8016.c index b5def55dbc2ac671130624dec56592288a0ceb3d..3bafbfea3b6f5bf903f6f5a593e1f062bd40c53a 100644 --- a/drivers/clk/qcom/clock-apq8016.c +++ b/drivers/clk/qcom/clock-apq8016.c @@ -144,11 +144,10 @@ static int apq8016_clk_enable(struct clk *clk) return 0; } debug("%s: clk %s\n", __func__, apq8016_clks[clk->id].name); - qcom_gate_clk_en(priv, clk->id); - return 0; + return qcom_gate_clk_en(priv, clk->id); } static struct msm_clk_data apq8016_clk_data = { .set_rate = apq8016_clk_set_rate, diff --git a/drivers/clk/qcom/clock-qcm2290.c b/drivers/clk/qcom/clock-qcm2290.c index c78705cb8cf19a75508f5a3a0fbc7c04d750d273..1326b770c3ebd723120de4b6657aafac726023d6 100644 --- a/drivers/clk/qcom/clock-qcm2290.c +++ b/drivers/clk/qcom/clock-qcm2290.c @@ -133,11 +133,9 @@ static int qcm2290_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_PRIM_CLKREF_CLK); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map qcm2290_gcc_resets[] = { [GCC_CAMSS_OPE_BCR] = { 0x55000 }, diff --git a/drivers/clk/qcom/clock-qcom.h b/drivers/clk/qcom/clock-qcom.h index ff336dea39cf5cbe35f37f93669285897ba185a4..e9eb659f3ed37522a71e04e9418f48091bf9a0aa 100644 --- a/drivers/clk/qcom/clock-qcom.h +++ b/drivers/clk/qcom/clock-qcom.h @@ -6,8 +6,9 @@ #define _CLOCK_QCOM_H #include #include +#include #define CFG_CLK_SRC_CXO (0 << 8) #define CFG_CLK_SRC_GPLL0 (1 << 8) #define CFG_CLK_SRC_GPLL0_AUX2 (2 << 8) @@ -104,15 +105,20 @@ void clk_rcg_set_rate_mnd(phys_addr_t base, uint32_t cmd_rcgr, void clk_rcg_set_rate(phys_addr_t base, uint32_t cmd_rcgr, int div, int source); void clk_phy_mux_enable(phys_addr_t base, uint32_t cmd_rcgr, bool enabled); -static inline void qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id) +static inline int qcom_gate_clk_en(const struct msm_clk_priv *priv, unsigned long id) { u32 val; - if (id >= priv->data->num_clks || priv->data->clks[id].reg == 0) - return; + if (id >= priv->data->num_clks || priv->data->clks[id].reg == 0) { + log_err("gcc@%#08llx: unknown clock ID %lu!\n", + priv->base, id); + return -ENOENT; + } val = readl(priv->base + priv->data->clks[id].reg); writel(val | priv->data->clks[id].en_val, priv->base + priv->data->clks[id].reg); + + return 0; } #endif diff --git a/drivers/clk/qcom/clock-sa8775p.c b/drivers/clk/qcom/clock-sa8775p.c index e31f24ed4f0ca989f20d1eadcff5f24f173455fa..527cecf5c8282a7c2e16740e6520241a230bca73 100644 --- a/drivers/clk/qcom/clock-sa8775p.c +++ b/drivers/clk/qcom/clock-sa8775p.c @@ -72,11 +72,9 @@ static int sa8775p_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_PRIM_PHY_COM_AUX_CLK); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sa8775p_gcc_resets[] = { [GCC_CAMERA_BCR] = { 0x32000 }, diff --git a/drivers/clk/qcom/clock-sc7280.c b/drivers/clk/qcom/clock-sc7280.c index 5d343f120519da02d8ec3e269d348ab46cde70a8..8ffd1f43f23e51140c7822f0f523fdfd8ab1de7a 100644 --- a/drivers/clk/qcom/clock-sc7280.c +++ b/drivers/clk/qcom/clock-sc7280.c @@ -72,11 +72,9 @@ static int sc7280_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_PRIM_PHY_COM_AUX_CLK); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sc7280_gcc_resets[] = { [GCC_PCIE_0_BCR] = { 0x6b000 }, diff --git a/drivers/clk/qcom/clock-sdm845.c b/drivers/clk/qcom/clock-sdm845.c index adffb0cb2402a6b27e0e998af2f121c519301820..6a0bf16ba2dce7f922adf971817399c71ac35586 100644 --- a/drivers/clk/qcom/clock-sdm845.c +++ b/drivers/clk/qcom/clock-sdm845.c @@ -161,11 +161,9 @@ static int sdm845_clk_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_COM_AUX_CLK); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sdm845_gcc_resets[] = { [GCC_QUPV3_WRAPPER_0_BCR] = { 0x17000 }, diff --git a/drivers/clk/qcom/clock-sm6115.c b/drivers/clk/qcom/clock-sm6115.c index 9057dfe0bb1873e9edcfd8c01c0a81b6b8b4ca2c..17c2e5617580aae9ad3f0d802bbc6882c2c81043 100644 --- a/drivers/clk/qcom/clock-sm6115.c +++ b/drivers/clk/qcom/clock-sm6115.c @@ -145,11 +145,9 @@ static int sm6115_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_PRIM_CLKREF_CLK); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sm6115_gcc_resets[] = { [GCC_QUSB2PHY_PRIM_BCR] = { 0x1c000 }, diff --git a/drivers/clk/qcom/clock-sm8150.c b/drivers/clk/qcom/clock-sm8150.c index 88f2e678f43cfcc9b80917f26c211049ebca6f9d..7dd0d56eb43031e893541e4031cbda2e92ae402d 100644 --- a/drivers/clk/qcom/clock-sm8150.c +++ b/drivers/clk/qcom/clock-sm8150.c @@ -242,11 +242,9 @@ static int sm8150_clk_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_COM_AUX_CLK); break; }; - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sm8150_gcc_resets[] = { [GCC_EMAC_BCR] = { 0x6000 }, diff --git a/drivers/clk/qcom/clock-sm8250.c b/drivers/clk/qcom/clock-sm8250.c index e322a923a5c048769dd5134c6c24e16bb74e7317..26396847d85964d5056cf9af62b8bc89be34dc43 100644 --- a/drivers/clk/qcom/clock-sm8250.c +++ b/drivers/clk/qcom/clock-sm8250.c @@ -194,11 +194,9 @@ static int sm8250_enable(struct clk *clk) qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_COM_AUX_CLK); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sm8250_gcc_resets[] = { [GCC_GPU_BCR] = { 0x71000 }, diff --git a/drivers/clk/qcom/clock-sm8550.c b/drivers/clk/qcom/clock-sm8550.c index 62b5a409e8e08243ad53a0bc58af1c7754a3d950..7c06489b9c4df9ce94fa9b44a762c10133377423 100644 --- a/drivers/clk/qcom/clock-sm8550.c +++ b/drivers/clk/qcom/clock-sm8550.c @@ -219,11 +219,9 @@ static int sm8550_enable(struct clk *clk) clk_phy_mux_enable(priv->base, 0x8d078, true); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sm8550_gcc_resets[] = { [GCC_CAMERA_BCR] = { 0x26000 }, diff --git a/drivers/clk/qcom/clock-sm8650.c b/drivers/clk/qcom/clock-sm8650.c index 9baaecb571f6c575c0e7c48d66214c1331b6642f..364454644a699c495479b3099f590562c415ce82 100644 --- a/drivers/clk/qcom/clock-sm8650.c +++ b/drivers/clk/qcom/clock-sm8650.c @@ -216,11 +216,9 @@ static int sm8650_enable(struct clk *clk) clk_phy_mux_enable(priv->base, 0x8d078, true); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map sm8650_gcc_resets[] = { [GCC_CAMERA_BCR] = { 0x26000 }, diff --git a/drivers/clk/qcom/clock-x1e80100.c b/drivers/clk/qcom/clock-x1e80100.c index bd9c6ed1c8a0b4ca0b5164d849efa5c0755c1e2e..542d6248d658d2921ef18877c70389549c471ab8 100644 --- a/drivers/clk/qcom/clock-x1e80100.c +++ b/drivers/clk/qcom/clock-x1e80100.c @@ -173,11 +173,9 @@ static int x1e80100_enable(struct clk *clk) clk_phy_mux_enable(priv->base, 0x31088, true); break; } - qcom_gate_clk_en(priv, clk->id); - - return 0; + return qcom_gate_clk_en(priv, clk->id); } static const struct qcom_reset_map x1e80100_gcc_resets[] = { [GCC_AV1E_BCR] = { 0x4a000 }, From patchwork Fri Mar 14 15:31:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 873454 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp773963wrq; Fri, 14 Mar 2025 08:31:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWs2bsk2sK8Q6gemTunNjg++x6vs13iJX2zHxiZqnU0yTd+wWUifgtU3w/4MJkQYFPiZu6K8g==@linaro.org X-Google-Smtp-Source: AGHT+IFqVIj4CDFDXpuHj8gkQ9fUMN7n/lLMqG206KifAmMwtTVgn6Z1UULD/9EhZ9EcKgmJi+PW X-Received: by 2002:a17:907:94c7:b0:ac2:b9b2:217b with SMTP id a640c23a62f3a-ac330267036mr307367966b.19.1741966302411; Fri, 14 Mar 2025 08:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741966302; cv=none; d=google.com; s=arc-20240605; b=PU8DZKMdJsJXZ6dl1ICwm5MG00/7PWoeBW59lD2rnSdvM1FixNH5WdiSAPNBm1joJ7 OpElwfEHEwJR59ePtCWX1PSGppQIMachGtGLY/eqH5Jt1GixATdLWsaIY0I3pVSYAAY2 BCzYCfxFphi/Dxst/AJYnWrZCkWULfu7b1UH99mnc7bJlVACWkvqGnx4kMIcQerjagGg 2CLrtUh1zjx4aUzJzW5dK9nXhIfHk8qLIYBAmJ2tAUzYlpDeW3qAs+irtJFPI2s8M4rA 9Ul+a6y7YkEz/+EbRLm5AhxxD66BIkN/zmW3XrC6EZE6c/U1vaVa0MYCcPcUY3d13IzJ xsow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=VPUorqKfsLVRRT6LL5YY8NsN1BebLDOcS6il2uJCEXE=; fh=GCgNJDeLV9+3jNcTiMispYW8vPnlawFZnzgtgNFY4Y8=; b=TTwbKqI4y59NnUs0n1WYu/YLmpECn6mqia4+omKoTmhLku880ZjghHn/uiraTwPm4P CDTikB9lxCew8nax0qLktlRLJO0INgwvzFCbytMcMhlvh/yMyRy3fjf0fpr0lPjdR1tW A+Mh4JuQfj4jtiDFAxcwMB5mdQ0vKsOAK3+BzxCT4fR54sfvF7/GnvyYKliVi8RN4E6s zwn6vJA6XWORjyXRx11LhY06YJlv3W0/8i+A4XvjA2kz4976eWV7iSEPcQSLPiNzKHzN aVuo1xlADTCrgROBPu6y85oyAVc5KoKiSv7iyd2e9rIO3edqovTgFl3k/jg5dAkZ8kyE kjKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzcf6VAR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-ac314a495cbsi331252866b.335.2025.03.14.08.31.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:31:42 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vzcf6VAR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7904581E47; Fri, 14 Mar 2025 16:31:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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; unprotected) header.d=linaro.org header.i=@linaro.org header.b="vzcf6VAR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F226181DE9; Fri, 14 Mar 2025 16:31:26 +0100 (CET) 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (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 0374881D52 for ; Fri, 14 Mar 2025 16:31:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3914bc3e01aso1454075f8f.2 for ; Fri, 14 Mar 2025 08:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741966284; x=1742571084; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=VPUorqKfsLVRRT6LL5YY8NsN1BebLDOcS6il2uJCEXE=; b=vzcf6VARlDYeVdp71uzpx9nWQ2XGIC5dA2J0eeGdCg/R/P94404XnCZ8zp/rNMXsf2 n8t9WYeX7mhEHpLjT4zanpgj7M1zC3zMa9q0Uz8ONXctCufbmxQTvmh7TGcuGe+UNlxa WZvhNFbG0QQCNsnHDXCcUpbD/ctAlvjPP/+JhbQd9+zF8KopxdnWKa6amwgq8vZ9vI/y XSU4Gi4jVO1JllH18zYvS0TUSz9cWp4ocEWztiICUH4gFm1zcbljuqg0E83GkyHDiLZ0 heKEs7po57WTGY8JfXYVG3E1emw4gbJFnObEQTtlNRYb5ps61ze15/I0H9ljUXk2yI6g 2eVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966284; x=1742571084; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VPUorqKfsLVRRT6LL5YY8NsN1BebLDOcS6il2uJCEXE=; b=U2ob1707x+8USb01G6983kzgncvu13OQpV9N7nL/eM/lGJR+lmGnCw7qNkMMnQGTJc s+ao9AKWKxgoQcIgH0F0LY3LHg7OSetA6ohTjSrrjNf1jcRitdhLznz3cf9RgAPRH+IN A1EgeG7En2fn2nMoj51ofy0Lz2IdPAZGA55b/LHsvtXLvKl/y0e8lB2JDzofuPuaImNX ZXy7fKr2+gB5FOtbZfm6Ud4Wk3SMf0PS3LcsaqQVdOfhSen2HT4XbFHWxML2qMMvrWR6 UkjsBdnHsOlcl0Qh/lLrWR6vCH6kf/r22J3IA0b9tL9ZRMfIW3sxr43lOrcX/HnyOjYu hprA== X-Forwarded-Encrypted: i=1; AJvYcCWhICFKLIgBPaBfkMQfqHMkwPZ36l/5Ki8BhwMNnSzb2nWD1h+SclgkdYjwGlIYk2jfWEEOdBU=@lists.denx.de X-Gm-Message-State: AOJu0Yy/myDQAMpyT3QZ0kH/4xFhkNeye+fdaY3xU/AwpW/GJi0lxydQ u1OXDlE2+bPPinkAKhN+fEcbG77PQ7foQBkL7/7oOkjwMrWhmBQ/7QDzHTBfA00= X-Gm-Gg: ASbGnctl60FvQqYACAEXtoZqXZ+kduqgr/Kdd7CgeHEsYkDpCmHhl/Y0320cyv4G0FJ sz0/s5pHHQLqVNMHPmX57l8aUqukNwL+j5ceYI0Dl+MWKQxOjkjPVzH39Vs/vCCZlnRdCjAtVwc TifKv0CUtLdgXBcYVZ9WWPV2MwbCy+0h12tqEa9joC7+aieWHucCtpsFTw3fnde/Qg0ScAqOfyc 7zncWv3HiKR7/CAEHanciJgThzu0tfZrHS+0d1+FyVsKB3pdAXGiPR4bYV/VHOHUn7x80GEEM58 pPyq8+zNw1cOENf6421nZCCBWhEV/cPEwloQ3AvyB09o6m5aJ0wYqGrG7mLMFBn15mVeHYo= X-Received: by 2002:a05:6000:156a:b0:391:2dea:c984 with SMTP id ffacd0b85a97d-3971d133670mr4219447f8f.11.1741966284389; Fri, 14 Mar 2025 08:31:24 -0700 (PDT) Received: from toyger.powerhub ([2a0a:ef40:1d11:ab01:2b81:563b:c694:c380]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb318af0sm5907399f8f.73.2025.03.14.08.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:31:23 -0700 (PDT) From: Caleb Connolly Date: Fri, 14 Mar 2025 15:31:20 +0000 Subject: [PATCH 2/3] clk/qcom: sc7280: add some debug data MIME-Version: 1.0 Message-Id: <20250314-sc7280-more-clocks-v1-2-ead54487c38e@linaro.org> References: <20250314-sc7280-more-clocks-v1-0-ead54487c38e@linaro.org> In-Reply-To: <20250314-sc7280-more-clocks-v1-0-ead54487c38e@linaro.org> To: Lukasz Majewski , Sean Anderson , Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1499; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=wwzfi07FEq2tTZD8/0hk+k/kdehPMtnFcHRl/8LZNn8=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn1EvIvHElet0RsdIBXWbs95caOdD6cWQXc2hK0 coFjRTzhNSJAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ9RLyAAKCRAFgzErGV9k tlOZD/wJEZD6mcXN4IF4mHrSd6hnp+gjNZAqmV+9owZRdNlUauAul83hRqgzHTozScnlyS4NXeP HJ9VzotNkqQMN0qfTza7mlvZrh0cyA3+9PmVL+Bj3RiZMrZ03LDzE9q2Z7f5oq8yUHn/UC0zcBY YPzCl4MEpZEK/Mm3B3agyDlVgccSUlIjMeBA0Ysm/7f6ygX8BbnpyKqiNnbX8aOEevPDnVLUAgC qjkZD4Eclo7cjW7vltRhYD453X0YnhNYajv8GaVZ80rYqKNBoz87CoH2fqQmpPf4gyjSJg8OSEC XWMdfydK9EXFfqT3l817d03J0l/zhYkOw+Qw0CIW2lEJJ/tLo3cSUPcIXXLOb80js/GY+zadEFL yPPfurReL+ty1aDsDgaYt6eKnAhrFRrCSZSLYgadsnZSSeS9H2OMGNF5n0TsVhXfzsx6CKysUar uzXaBp8F4Y5x2O0jctleSjd2e4JqnDSbyip3HUqroQTxzMD50/Yu1/oWgkm8CqBNjW1vhlJbA2S +afDTevlkruhO08jGWdsgheabFAssJwyoVXtke64YszIjvgrixMsPcD03mXyKL3yGxs5iqb4VKK y2pQQC8jOlJv6/5nXvNJE1r6XmcNQ5gefzfMyP0ppvvRWsPoq8EilPmcDMD2I0XYwdMG4XqkmEJ BlJ7FDePxk2mgQg== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 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 Dump a few PCIe and USB clocks Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- drivers/clk/qcom/clock-sc7280.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/clk/qcom/clock-sc7280.c b/drivers/clk/qcom/clock-sc7280.c index 8ffd1f43f23e51140c7822f0f523fdfd8ab1de7a..2cbc01b6e0a4f1db0e4a894cd869b532d6b3fa45 100644 --- a/drivers/clk/qcom/clock-sc7280.c +++ b/drivers/clk/qcom/clock-sc7280.c @@ -99,8 +99,20 @@ static const struct qcom_power_map sc7280_gdscs[] = { [GCC_UFS_PHY_GDSC] = { 0x77004 }, [GCC_USB30_PRIM_GDSC] = { 0xf004 }, }; +static const phys_addr_t sc7280_rcg_addrs[] = { + 0x10f020, // USB30_PRIM_MASTER_CLK_CMD_RCGR + 0x10f038, // USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR + 0x18d058, // PCIE_1_AUX_CLK_CMD_RCGR +}; + +static const char *const sc7280_rcg_names[] = { + "USB30_PRIM_MASTER_CLK_SRC", + "USB30_PRIM_MOCK_UTMI_CLK_SRC", + "GCC_PCIE_1_AUX_CLK_SRC", +}; + static struct msm_clk_data qcs404_gcc_data = { .resets = sc7280_gcc_resets, .num_resets = ARRAY_SIZE(sc7280_gcc_resets), .clks = sc7280_clks, @@ -110,8 +122,12 @@ static struct msm_clk_data qcs404_gcc_data = { .num_power_domains = ARRAY_SIZE(sc7280_gdscs), .enable = sc7280_enable, .set_rate = sc7280_set_rate, + + .dbg_rcg_addrs = sc7280_rcg_addrs, + .num_rcgs = ARRAY_SIZE(sc7280_rcg_addrs), + .dbg_rcg_names = sc7280_rcg_names, }; static const struct udevice_id gcc_sc7280_of_match[] = { { From patchwork Fri Mar 14 15:31:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 873455 Delivered-To: patch@linaro.org Received: by 2002:a5d:4308:0:b0:38f:210b:807b with SMTP id h8csp774065wrq; Fri, 14 Mar 2025 08:31:51 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXM5R47b3fdnH1hpVg5KnoezrXHZgC8nqp3pk19PJWUgU7cmpI4cj3DY6T3VgfYXe+Avv5bRQ==@linaro.org X-Google-Smtp-Source: AGHT+IEyCkkiLbwO3RiQgIf5/Eji+ZUwXMvz9a9CCoiDIRsQhJKGiCwZDrcxxCmweWPUpZarTbBI X-Received: by 2002:a17:907:9487:b0:ac2:758f:9814 with SMTP id a640c23a62f3a-ac3302cc701mr327219666b.23.1741966311412; Fri, 14 Mar 2025 08:31:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741966311; cv=none; d=google.com; s=arc-20240605; b=ONsWqWYhxb+0jWWNA+Qks/tsxFndlYztbZK2CvLNJyIrrFv+4K77Ai2l5v6PW2m/Iy k8gthigCH67qTuZBaHR2mjoDd5rK6wvsDvL1VLX6nVFJ3MKr/BimSNCzH+YgXx8phm83 G102ZIBtacjccrfX7VgrfL3l29TQejvV2Z7bceIZownAwUsorOXLsQqW7n6kr372eiRP BQaMsB1ecJDS5KRPdJooaij7EQwkyTaOMRQBZDOTyj+u2/UQgqS96It2iW3kOeiZ8Qv5 8Vc9SQPWLqpwao819rqpN2Vs5RaNLhCGpF9ihNJv/LtUh3cFXAFpNxBAHVHuSMZLD1Ga vIOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:cc:to:in-reply-to:references :message-id:content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=21x5foQgtcTOyKtLHII1zsKa5bMbZ7sza8nVxOePoCw=; fh=RejRlyvoqk/Y6EO9KWw8ukZHr9jkEGP+w1Kl0CcFkXw=; b=M3Y1QHlIxOiHFHCyZ8ODp4DokWw7vygs8v2Vui8FBPhNjZ7hlOMXh7IRuvDSQjv2Fn HreZpt5z7w+MLiCFw+sd1vST5m9xBRt6lW7H4GyLWV/aVEn/1AuPwNArrBTMZnzeG/rH 6LKN1Nl3GHLNgGMjgXyCu4vg060/URir9EhmNOC96XWtwUk7HNTTwrqNEUXYqIYYBFfR CTa6b21mITbT87DPphtVKUt9cWMkMk2Pl2pZtnrxRLX9hVRuzgb1MpmfNzlf+sq5iAIS 8NjONC1pzcUUXcF0uhJsxI23Xl+r6WzX/7rFM6GIaNATRpWFo5GtfcNFqH+WBScomB+h o+ZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xjbf5hfR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-ac314aaab65si347922366b.526.2025.03.14.08.31.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:31:51 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xjbf5hfR; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C47EE81EA2; Fri, 14 Mar 2025 16:31:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org 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; unprotected) header.d=linaro.org header.i=@linaro.org header.b="xjbf5hfR"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9364281E64; Fri, 14 Mar 2025 16:31:28 +0100 (CET) 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (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 4445A81E25 for ; Fri, 14 Mar 2025 16:31:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3914aba1ce4so1985170f8f.2 for ; Fri, 14 Mar 2025 08:31:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741966286; x=1742571086; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=21x5foQgtcTOyKtLHII1zsKa5bMbZ7sza8nVxOePoCw=; b=xjbf5hfR27DzyyfOWN3Fzcxq71KdS8Ww5lTVjcxpI/SWnJzbjU2jazzYj/Z8DY3NcF Y/XToBFyowYTINFvyji/Td4KZFBjTYjFbiBA7h8aZx1AGJMwMmtKinsXFErB3nl/VJQq JbMdDlK+XOHmxqgxTH5bBCUDec+3PFdLF5Fw8+22o5rOLboAgXPgF51IS6kao4KQgL// T4aY3NRjgok5xy6Cs4PByeLO1CA/ryn7epVJmqM/HbnCmmUUQpWnu367StioaLo5jbjP Kku3IRocH14ZRZS4yM3Uz7AW6LBhZKcBCYntiLu+w5HDn+2udXPjOWCtOy2t4dzAXwu4 1tSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966286; x=1742571086; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=21x5foQgtcTOyKtLHII1zsKa5bMbZ7sza8nVxOePoCw=; b=YgtKrcy5RhbkxOTJGl+8sJA1c4kfiSFAw3Jy6mrt4aQIO57iK3zP+YDBV75AQo5pdw Zc7pfb6fmGRnXzTZvLoorOBSjvZDhHhqTZHMVSpeiIrzkjevFFit3E+7XjchosYywtxX Cr2mDuupbsMBouQUk/biP/dRBjNehiIID7EU/e0X999LSb2gwWkr3y4fb8/1+SmUSa3e LXwZKrXSQVBbmkn1eNvbHXQXdICrzh7CPrBOU5No+zLXBH4RCA3mcS4903PwxBvEi+lr cNnUZx3qucIjgEZP0qkrOJAOWvny6r5i+UvNX6hYXJLoIUeetowReLEF64LVYvCsFasF UwZw== X-Forwarded-Encrypted: i=1; AJvYcCUVI15wUkWtcuKFtEpbN9TrP66l/6MVp29zmtUAKf3JXplN3hyd6ijBZEvq/o9upbEjFOn9tLg=@lists.denx.de X-Gm-Message-State: AOJu0YzCYcjjJdxRuPnJBy0ZzOf+VkHaVqJCumIQh7KVStAM3+N+m+ua 60ls6sI3Ou3mBkkE3PSrj7vgn4bfm+KjaRV0+ehdTy9IqOGhEIce23hFZh20Fsk= X-Gm-Gg: ASbGncuQak/qfza25+IQl9vzkT9cOcLkzL8Y4P26gqCsE0SQ8khtejO8Q6UhPeWCYEE s9bAi0DWrloegMSsUiAbw1fBUksGHI2HowonGkuOKrMGMTpqJ6zbUGERRPeJEh4oIM9IH5aiPnn VmgWH4FQe6hkQZKLudflbLGLZdvkBlt/fj8SPIVcObdcK9TIs47DnGgddqyViyP665pzzUcJYHT uXsJG61nZZa7aZvAG66GAz1y3E4X7Q29J7EKaz9Qv0z/Kfz2PzGlN/dSKwWL7K+kQWdH7fucRfz Ia7Y7hO96KJY/U1MpLjOp+KZlv9PJ1m7m/R3nHgv3Qjw24rT6J+GUTFH0/AkxOC2N2ffJpU= X-Received: by 2002:a5d:5f93:0:b0:38b:d7d2:12f6 with SMTP id ffacd0b85a97d-3971cd57af9mr4781355f8f.2.1741966285619; Fri, 14 Mar 2025 08:31:25 -0700 (PDT) Received: from toyger.powerhub ([2a0a:ef40:1d11:ab01:2b81:563b:c694:c380]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-395cb318af0sm5907399f8f.73.2025.03.14.08.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:31:24 -0700 (PDT) From: Caleb Connolly Date: Fri, 14 Mar 2025 15:31:21 +0000 Subject: [PATCH 3/3] clk/qcom: sc7280: add GENI, PCIe, and more USB clocks MIME-Version: 1.0 Message-Id: <20250314-sc7280-more-clocks-v1-3-ead54487c38e@linaro.org> References: <20250314-sc7280-more-clocks-v1-0-ead54487c38e@linaro.org> In-Reply-To: <20250314-sc7280-more-clocks-v1-0-ead54487c38e@linaro.org> To: Lukasz Majewski , Sean Anderson , Caleb Connolly , Neil Armstrong , Sumit Garg , Tom Rini Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=6890; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=vYcCN1yZmZoxXDUTn0lAtMlt9Y5wC01HF2q5MEF/6Vc=; b=owEBbQKS/ZANAwAKAQWDMSsZX2S2AcsmYgBn1EvIbrXKIjHOSWBOrfOWv566Cj5n1AyatJpHU /3moI2H19+JAjMEAAEKAB0WIQS2UaFGPGq+0GkMVc0FgzErGV9ktgUCZ9RLyAAKCRAFgzErGV9k tusREACT3QBehpuUA4OjaURcYujxPJ+ck8KZ8gA4XOKh9Jc7vRFssqMWNW5Lg2406XEK2mxZTKb DpQxdJFuTdqpRKVOulmG3Ez+WSkfDPHijs/cNc0b8lngOxVztWc3lxUHWJQLQ9jt0ObIIJRVv+Q ohdfyr8gZ78Oj7Re6fwep3WgyxaMb0WWdEKsCwDtI72txTRRkPtL+WFCFRBXa/o6W6V6jCwE1JW 9cbJ0yULCSqzMe5lwVxFrYzQWh2A0iSysDfYkcZ72DLC4NFn1R5c+spIcgyLf8b4YlYXB+olq60 qrQZyhFOQmfN6EtwsXlwI1tWPpDlJscDPTZuB4EQ007dYEv16FZgvFngIpPEhVZnuOA+z8YP4pj T9sYCId1OttsASeWqCSqCNhn1/ljKcS4/GdB6IMOrP1TCFbrdAVQr0xZ91OVpkTGP2o93Qo3hHe psdmP4Sfd+cXiCd1YwUibMrKOUc7sE0Mh17FeGG6uIBd7V6Kre1UxOo/fDQ6z7cVJVzHkpJerbT aSmmGltxII7yach0uVYTRlMXCCgd45ZuBMgZ9brt5JYhYTWsAamGhEyOuhngL7WjMCCkMD+gQoP OSw73a9kFNjV0A1uYmF+qepCc5K2p1tIGmKpvqwneblSbGUIwBUu58CV8xvfcCkT8DycuMqNypj OFfaAu+GdfBuvLg== X-Developer-Key: i=caleb.connolly@linaro.org; a=openpgp; fpr=83B24DA7FE145076BC38BB250CD904EB673A7C47 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 for a bunch of new clocks, including PCIe, GENI (for all peripherals used on the RB3 Gen 2), and some missing USB clocks. Signed-off-by: Caleb Connolly Reviewed-by: Neil Armstrong --- drivers/clk/qcom/clock-sc7280.c | 104 +++++++++++++++++++++++++++++++++++----- 1 file changed, 93 insertions(+), 11 deletions(-) diff --git a/drivers/clk/qcom/clock-sc7280.c b/drivers/clk/qcom/clock-sc7280.c index 2cbc01b6e0a4f1db0e4a894cd869b532d6b3fa45..8691f08109b39639d8a5defe75161049399bf682 100644 --- a/drivers/clk/qcom/clock-sc7280.c +++ b/drivers/clk/qcom/clock-sc7280.c @@ -15,31 +15,66 @@ #include #include "clock-qcom.h" -#define USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR 0xf038 #define USB30_PRIM_MASTER_CLK_CMD_RCGR 0xf020 +#define USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR 0xf038 +#define USB30_SEC_MASTER_CLK_CMD_RCGR 0x9e020 +#define USB30_SEC_MOCK_UTMI_CLK_CMD_RCGR 0x9e038 +#define PCIE_1_AUX_CLK_CMD_RCGR 0x8d058 +#define PCIE1_PHY_RCHNG_CMD_RCGR 0x8d03c +#define PCIE_1_PIPE_CLK_PHY_MUX 0x8d054 + +static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = { + F(66666667, CFG_CLK_SRC_GPLL0_EVEN, 4.5, 0, 0), + F(133333333, CFG_CLK_SRC_GPLL0, 4.5, 0, 0), + F(200000000, CFG_CLK_SRC_GPLL0_ODD, 1, 0, 0), + F(240000000, CFG_CLK_SRC_GPLL0, 2.5, 0, 0), + { } +}; + +static const struct freq_tbl ftbl_gcc_usb30_sec_master_clk_src[] = { + F(60000000, CFG_CLK_SRC_GPLL0_EVEN, 5, 0, 0), + F(120000000, CFG_CLK_SRC_GPLL0_EVEN, 2.5, 0, 0), + { } +}; static ulong sc7280_set_rate(struct clk *clk, ulong rate) { struct msm_clk_priv *priv = dev_get_priv(clk->dev); + const struct freq_tbl *freq; if (clk->id < priv->data->num_clks) debug("%s: %s, requested rate=%ld\n", __func__, priv->data->clks[clk->id].name, rate); switch (clk->id) { - case GCC_USB30_PRIM_MOCK_UTMI_CLK: - WARN(rate != 19200000, "Unexpected rate for USB30_PRIM_MOCK_UTMI_CLK: %lu\n", rate); - clk_rcg_set_rate(priv->base, USB30_PRIM_MASTER_CLK_CMD_RCGR, 0, CFG_CLK_SRC_CXO); - return rate; case GCC_USB30_PRIM_MASTER_CLK: - WARN(rate != 200000000, "Unexpected rate for USB30_PRIM_MASTER_CLK: %lu\n", rate); + freq = qcom_find_freq(ftbl_gcc_usb30_prim_master_clk_src, rate); clk_rcg_set_rate_mnd(priv->base, USB30_PRIM_MASTER_CLK_CMD_RCGR, - 1, 0, 0, CFG_CLK_SRC_GPLL0_ODD, 8); - clk_rcg_set_rate(priv->base, 0xf064, 0, 0); - return rate; + freq->pre_div, freq->m, freq->n, freq->src, 8); + return freq->freq; + case GCC_USB30_PRIM_MOCK_UTMI_CLK: + clk_rcg_set_rate(priv->base, USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR, 1, 0); + return 19200000; + case GCC_USB3_PRIM_PHY_AUX_CLK_SRC: + clk_rcg_set_rate(priv->base, USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR, 1, 0); + return 19200000; + case GCC_USB30_SEC_MASTER_CLK: + freq = qcom_find_freq(ftbl_gcc_usb30_sec_master_clk_src, rate); + clk_rcg_set_rate_mnd(priv->base, USB30_SEC_MASTER_CLK_CMD_RCGR, + freq->pre_div, freq->m, freq->n, freq->src, 8); + return freq->freq; + case GCC_USB30_SEC_MOCK_UTMI_CLK: + clk_rcg_set_rate(priv->base, USB30_SEC_MOCK_UTMI_CLK_CMD_RCGR, 1, 0); + return 19200000; + case GCC_USB3_SEC_PHY_AUX_CLK_SRC: + clk_rcg_set_rate(priv->base, USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR, 1, 0); + return 19200000; + case GCC_PCIE1_PHY_RCHNG_CLK: + clk_rcg_set_rate(priv->base, PCIE1_PHY_RCHNG_CMD_RCGR, 5, CFG_CLK_SRC_GPLL0_EVEN); + return 100000000; default: - return 0; + return rate; } } static const struct gate_clk sc7280_clks[] = { @@ -49,15 +84,37 @@ static const struct gate_clk sc7280_clks[] = { GATE_CLK(GCC_USB30_PRIM_SLEEP_CLK, 0xf018, 1), GATE_CLK(GCC_USB30_PRIM_MOCK_UTMI_CLK, 0xf01c, 1), GATE_CLK(GCC_USB3_PRIM_PHY_AUX_CLK, 0xf054, 1), GATE_CLK(GCC_USB3_PRIM_PHY_COM_AUX_CLK, 0xf058, 1), + GATE_CLK(GCC_CFG_NOC_USB3_SEC_AXI_CLK, 0x9e07c, 1), + GATE_CLK(GCC_USB30_SEC_MASTER_CLK, 0x9e010, 1), + GATE_CLK(GCC_AGGRE_USB3_SEC_AXI_CLK, 0x9e080, 1), + GATE_CLK(GCC_USB30_SEC_SLEEP_CLK, 0x9e018, 1), + GATE_CLK(GCC_USB30_SEC_MOCK_UTMI_CLK, 0x9e01c, 1), + GATE_CLK(GCC_USB3_SEC_PHY_AUX_CLK, 0x9e054, 1), + GATE_CLK(GCC_USB3_SEC_PHY_COM_AUX_CLK, 0x9e058, 1), + GATE_CLK(GCC_PCIE_CLKREF_EN, 0x8c004, 1), + GATE_CLK(GCC_PCIE_1_PIPE_CLK, 0x52000, BIT(30)), + GATE_CLK(GCC_PCIE_1_AUX_CLK, 0x52000, BIT(29)), + GATE_CLK(GCC_PCIE_1_CFG_AHB_CLK, 0x52000, BIT(28)), + GATE_CLK(GCC_PCIE_1_MSTR_AXI_CLK, 0x52000, BIT(27)), + GATE_CLK(GCC_PCIE_1_SLV_AXI_CLK, 0x52000, BIT(26)), + GATE_CLK(GCC_PCIE_1_SLV_Q2A_AXI_CLK, 0x52000, BIT(25)), + GATE_CLK(GCC_PCIE1_PHY_RCHNG_CLK, 0x52000, BIT(23)), + GATE_CLK(GCC_DDRSS_PCIE_SF_CLK, 0x52000, BIT(19)), + GATE_CLK(GCC_AGGRE_NOC_PCIE_TBU_CLK, 0x52000, BIT(18)), + GATE_CLK(GCC_AGGRE_NOC_PCIE_1_AXI_CLK, 0x52000, BIT(11)), + GATE_CLK(GCC_AGGRE_NOC_PCIE_CENTER_SF_AXI_CLK, 0x52008, BIT(28)), + GATE_CLK(GCC_QUPV3_WRAP0_S0_CLK, 0x52008, BIT(10)), + GATE_CLK(GCC_QUPV3_WRAP0_S1_CLK, 0x52008, BIT(11)), + GATE_CLK(GCC_QUPV3_WRAP0_S3_CLK, 0x52008, BIT(13)), }; static int sc7280_enable(struct clk *clk) { struct msm_clk_priv *priv = dev_get_priv(clk->dev); - if (priv->data->num_clks < clk->id) { + if (priv->data->num_clks <= clk->id) { debug("%s: unknown clk id %lu\n", __func__, clk->id); return 0; } @@ -70,8 +127,31 @@ static int sc7280_enable(struct clk *clk) case GCC_USB30_PRIM_MASTER_CLK: qcom_gate_clk_en(priv, GCC_USB3_PRIM_PHY_AUX_CLK); qcom_gate_clk_en(priv, GCC_USB3_PRIM_PHY_COM_AUX_CLK); break; + case GCC_AGGRE_USB3_SEC_AXI_CLK: + qcom_gate_clk_en(priv, GCC_USB30_SEC_MASTER_CLK); + fallthrough; + case GCC_USB30_SEC_MASTER_CLK: + qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_AUX_CLK); + qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_COM_AUX_CLK); + break; + case GCC_PCIE_1_PIPE_CLK: + clk_phy_mux_enable(priv->base, PCIE_1_PIPE_CLK_PHY_MUX, true); + break; + case GCC_PCIE_1_AUX_CLK: + clk_rcg_set_rate_mnd(priv->base, PCIE_1_AUX_CLK_CMD_RCGR, 1, 0, 0, + CFG_CLK_SRC_CXO, 16); + break; + case GCC_QUPV3_WRAP0_S0_CLK: + clk_rcg_set_rate_mnd(priv->base, 0x17010, 1, 0, 0, CFG_CLK_SRC_CXO, 16); + break; + case GCC_QUPV3_WRAP0_S1_CLK: + clk_rcg_set_rate_mnd(priv->base, 0x17140, 1, 0, 0, CFG_CLK_SRC_CXO, 16); + break; + case GCC_QUPV3_WRAP0_S3_CLK: + clk_rcg_set_rate_mnd(priv->base, 0x173a0, 1, 0, 0, CFG_CLK_SRC_CXO, 16); + break; } return qcom_gate_clk_en(priv, clk->id); } @@ -97,8 +177,10 @@ static const struct qcom_reset_map sc7280_gcc_resets[] = { static const struct qcom_power_map sc7280_gdscs[] = { [GCC_UFS_PHY_GDSC] = { 0x77004 }, [GCC_USB30_PRIM_GDSC] = { 0xf004 }, + [GCC_USB30_SEC_GDSC] = { 0x9e004 }, + [GCC_PCIE_1_GDSC] = { 0x8d004 }, }; static const phys_addr_t sc7280_rcg_addrs[] = { 0x10f020, // USB30_PRIM_MASTER_CLK_CMD_RCGR