From patchwork Mon Oct 30 22:23:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 739302 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c47:0:b0:32d:baff:b0ca with SMTP id n7csp1359267wrt; Mon, 30 Oct 2023 15:23:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1bZ3eNQjG+AJ1gLulpVsLN4RvYSdRPYD3CFyriaKub4aGabMaSPjpvSdVcsEXQIXpmZUU X-Received: by 2002:a5d:598b:0:b0:31d:caae:982d with SMTP id n11-20020a5d598b000000b0031dcaae982dmr941455wri.12.1698704638559; Mon, 30 Oct 2023 15:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698704638; cv=none; d=google.com; s=arc-20160816; b=G1y7LfdhKHRAcdQykOr/CwO+scm2i5akXNVnnBaZh9aLA5laHJn5pjyj76LOiVi/4r iU14yU3R9oYtfquMHYVy7VO9OrTy3WjqZvghuwwheMm2lR3uzymQ0Un8pWYbS105SaTR MVqAzKUPg9b9fR3FqTYahq1gKAvs2OFQ3hg4m+RaWmGt6p/cYZ+eaLzIa17BhYjKR5uP WXgtjiYO9Pe6LrbltBEE6T2nL10j66pLQAnEa1hiBLq0TD4vjvwix4E1N+Gv7t3EbE3n uI9ksEypNPHlqxUet60+1qSB4Mic4KFbyjwuZMwiMBpUqSMa6AiUAdf04H5YXIxXH0bI qPQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=8wlFfos2cRiV+7DflEcMW8UNCaGluy6P9E+KmOAgq0s=; fh=BAQvnH1tBjay7kY8jYbw80L2qbOuUPk6g/cOK8yBBSk=; b=zVI9/v7/nR1kGvClFruuSzi/FJ7diUTL+hK0MGxxX+IeUimuNYr7nieWsA/fEc9rDB cvwYvK6mtnthH1x9wG/wAG22jdtghEjcdeDb7272Cos31lS8ZiNDtoO6a7QwPemJiRVE dttKhIt5u10gkqLunUq+lhQXq5SYr230182Um6M82tAzT7/r+BeSvronaUWHjh4Bqcjd C/TBgjqkUrj6WgeyaMWQfAMFfRHdxuL0v+CSX9fU53D8SGAgt6JlxwXvlK4xiT1iuOnG dg+y5pCL4mzbdxAljv8sD6RBMgPlM8XiRVssJ5pb9ih68ku/PwMv7GkeOejx5j/l5lW+ gWbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aE1IXCMD; 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 Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id h13-20020a05600004cd00b0032327b0eac2si48wri.352.2023.10.30.15.23.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 15:23:58 -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=aE1IXCMD; 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 Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7DA71879AF; Mon, 30 Oct 2023 23:23:33 +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="aE1IXCMD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93EBF87514; Mon, 30 Oct 2023 23:23:32 +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,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) (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 8C021879C0 for ; Mon, 30 Oct 2023 23:23:30 +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-wm1-x334.google.com with SMTP id 5b1f17b1804b1-40907b82ab9so35519875e9.1 for ; Mon, 30 Oct 2023 15:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698704610; x=1699309410; 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=8wlFfos2cRiV+7DflEcMW8UNCaGluy6P9E+KmOAgq0s=; b=aE1IXCMDbFcSpoN+XWO1p5q833fI8ctsQ6pO6aTZmMFrEmv5GlkltDuLT3kjkAuHIw 248JcnCjqtv7d87OljoEBuggg9q0UPXU6ajbXUfFIKyNyiPSSV6QUs59YaHhgamc/DWi OYxNLdEN8RejQ9VhnwJj56qh1MaC0OLcHAgPJg5O9wtT7OOUMSUqTN+S4TyVOZi0A15/ GUfLMCpbQq9Gieb21t+CpKE4ZO5fcwOi5USwHw6A4LwA3EhVseStIR9Y9w+s8WBWho9T yKZiFnqAe8BFFE0OZKvYwPAJFMUUIdukeSL1ZvhYSTuLfdVcnoWCUewoWjADgK9jQ8IA 1r/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698704610; x=1699309410; 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=8wlFfos2cRiV+7DflEcMW8UNCaGluy6P9E+KmOAgq0s=; b=DeK7qPtl8bzOBg3rEgjpxaznV64cLXXFdvcYBpNpILxLjWHADgWrgQIJqFnISH170U xVjzTqTmZPrhX/iuDyh+svfjbK/LRM93L3vYQhzSQn1WefruAol8aMCVmsTbLtjKF+Km SBidHgYnrqCAaq7QUXDyMVZuksS331QSziY0rUJZBQHX6/VM7Cw8yK/mgaGhuuDcQR4N ft27E9YhpXm7GiWCIMxH+RZk4f0dcCPvUy1R08LWi/ByN1mNgvzJtIZZHYNg9Hy9oMeQ uYeycoecB/5Pd+FDNw1xMxoxDul/eqlp4ZxqlIG+shWPEp6ub9TI8BY8nmRcUAXG68eD g2fg== X-Gm-Message-State: AOJu0Yx+85d9tajXO6oH62TOwUN4XEyfgmhOvh2qPSbezHWdivUpq9xW 2EBz82SloMXm8UBsTRkUWP6Ppg== X-Received: by 2002:a5d:64a9:0:b0:32d:ddb9:289f with SMTP id m9-20020a5d64a9000000b0032dddb9289fmr1116810wrp.34.1698704610070; Mon, 30 Oct 2023 15:23:30 -0700 (PDT) Received: from lion.localdomain (host-92-25-138-185.as13285.net. [92.25.138.185]) by smtp.gmail.com with ESMTPSA id n20-20020a05600c465400b0040588d85b3asm6651wmo.15.2023.10.30.15.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 15:23:29 -0700 (PDT) From: Caleb Connolly Date: Mon, 30 Oct 2023 22:23:24 +0000 Subject: [PATCH v2 2/7] clk/qcom: move ipq4019 driver from mach-ipq40xx MIME-Version: 1.0 Message-Id: <20231024-b4-qcom-clk-v2-2-6572bc2be690@linaro.org> References: <20231024-b4-qcom-clk-v2-0-6572bc2be690@linaro.org> In-Reply-To: <20231024-b4-qcom-clk-v2-0-6572bc2be690@linaro.org> To: Ramon Fried , Lukasz Majewski , Sean Anderson , Rayagonda Kokatanur , Robert Marko , Bhupesh Sharma , Luka Perkov , Dzmitry Sankouski , Jorge Ramirez-Ortiz Cc: Vladimir Zapolskiy , u-boot@lists.denx.de, Caleb Connolly X-Mailer: b4 0.13-dev-46309 X-Developer-Signature: v=1; a=openpgp-sha256; l=4583; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=BB3eRYwzJOgZGWxovbINxwebhUzIEsxgWoscfRmUlb4=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhlQHnfs9tyd3R1XeknMV61myJNLn48ndE9zumv0s8HL+7 bU4kudeRykLgyAHg6yYIov4iWWWTWsv22tsX3ABZg4rE8gQBi5OAZjIDx+G/8X3O5p6/9Z3pcxa nGG5f+npbnU+xvqGMM2tr7Ou9Id3bmZkmFkVwvDYisW1c9kpu2OXphveTGN9st57lsbUxrX7qkJ yPwMA 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 This driver is just a stub, but it's necessary to support the upcoming reset driver changes. Signed-off-by: Caleb Connolly Reviewed-by: Sumit Garg --- arch/arm/Kconfig | 1 + arch/arm/mach-ipq40xx/Makefile | 1 - drivers/clk/qcom/Kconfig | 8 +++++ drivers/clk/qcom/Makefile | 1 + .../clk/qcom}/clock-ipq4019.c | 41 ++-------------------- drivers/clk/qcom/clock-qcom.c | 1 + 6 files changed, 13 insertions(+), 40 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 531b081de996..5aaf7e5e32af 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -766,6 +766,7 @@ config ARCH_IPQ40XX select CLK select SMEM select OF_CONTROL + select CLK_QCOM_IPQ4019 imply CMD_DM config ARCH_KEYSTONE diff --git a/arch/arm/mach-ipq40xx/Makefile b/arch/arm/mach-ipq40xx/Makefile index 08a65b8854d3..b36a935c6f9f 100644 --- a/arch/arm/mach-ipq40xx/Makefile +++ b/arch/arm/mach-ipq40xx/Makefile @@ -4,6 +4,5 @@ # # Author: Robert Marko -obj-y += clock-ipq4019.o obj-y += pinctrl-snapdragon.o obj-y += pinctrl-ipq4019.o diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig index a884f077d9b9..0df0d1881a49 100644 --- a/drivers/clk/qcom/Kconfig +++ b/drivers/clk/qcom/Kconfig @@ -23,6 +23,14 @@ config CLK_QCOM_APQ8096 on the Snapdragon APQ8096 SoC. This driver supports the clocks and resets exposed by the GCC hardware block. +config CLK_QCOM_IPQ4019 + bool "Qualcomm IPQ4019 GCC" + select CLK_QCOM + help + Say Y here to enable support for the Global Clock Controller + on the Snapdragon IPQ4019 SoC. This driver supports the clocks + and resets exposed by the GCC hardware block. + config CLK_QCOM_QCS404 bool "Qualcomm QCS404 GCC" select CLK_QCOM diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile index 44d55583596d..cb179fdac583 100644 --- a/drivers/clk/qcom/Makefile +++ b/drivers/clk/qcom/Makefile @@ -6,4 +6,5 @@ obj-y += clock-qcom.o obj-$(CONFIG_CLK_QCOM_SDM845) += clock-sdm845.o obj-$(CONFIG_CLK_QCOM_APQ8016) += clock-apq8016.o obj-$(CONFIG_CLK_QCOM_APQ8096) += clock-apq8096.o +obj-$(CONFIG_CLK_QCOM_IPQ4019) += clock-ipq4019.o obj-$(CONFIG_CLK_QCOM_QCS404) += clock-qcs404.o diff --git a/arch/arm/mach-ipq40xx/clock-ipq4019.c b/drivers/clk/qcom/clock-ipq4019.c similarity index 56% rename from arch/arm/mach-ipq40xx/clock-ipq4019.c rename to drivers/clk/qcom/clock-ipq4019.c index c1d5c4ecdd81..04c99964df15 100644 --- a/arch/arm/mach-ipq40xx/clock-ipq4019.c +++ b/drivers/clk/qcom/clock-ipq4019.c @@ -12,12 +12,9 @@ #include #include #include - #include -struct msm_clk_priv { - phys_addr_t base; -}; +#include "clock-qcom.h" ulong msm_set_rate(struct clk *clk, ulong rate) { @@ -30,23 +27,7 @@ ulong msm_set_rate(struct clk *clk, ulong rate) } } -static int msm_clk_probe(struct udevice *dev) -{ - struct msm_clk_priv *priv = dev_get_priv(dev); - - priv->base = dev_read_addr(dev); - if (priv->base == FDT_ADDR_T_NONE) - return -EINVAL; - - return 0; -} - -static ulong msm_clk_set_rate(struct clk *clk, ulong rate) -{ - return msm_set_rate(clk, rate); -} - -static int msm_enable(struct clk *clk) +int msm_enable(struct clk *clk) { switch (clk->id) { case GCC_BLSP1_QUP1_SPI_APPS_CLK: /*SPI1*/ @@ -68,21 +49,3 @@ static int msm_enable(struct clk *clk) } } -static struct clk_ops msm_clk_ops = { - .set_rate = msm_clk_set_rate, - .enable = msm_enable, -}; - -static const struct udevice_id msm_clk_ids[] = { - { .compatible = "qcom,gcc-ipq4019" }, - { } -}; - -U_BOOT_DRIVER(clk_msm) = { - .name = "clk_msm", - .id = UCLASS_CLK, - .of_match = msm_clk_ids, - .ops = &msm_clk_ops, - .priv_auto = sizeof(struct msm_clk_priv), - .probe = msm_clk_probe, -}; diff --git a/drivers/clk/qcom/clock-qcom.c b/drivers/clk/qcom/clock-qcom.c index 5667abeb89a4..5914616fba5d 100644 --- a/drivers/clk/qcom/clock-qcom.c +++ b/drivers/clk/qcom/clock-qcom.c @@ -166,6 +166,7 @@ static const struct udevice_id msm_clk_ids[] = { { .compatible = "qcom,gcc-apq8016" }, { .compatible = "qcom,gcc-msm8996" }, { .compatible = "qcom,gcc-apq8096" }, + { .compatible = "qcom,gcc-ipq4019" }, { .compatible = "qcom,gcc-sdm845" }, { .compatible = "qcom,gcc-qcs404" }, { }