From patchwork Fri Nov 3 15:39:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 740674 Delivered-To: patch@linaro.org Received: by 2002:a5d:538f:0:b0:32d:baff:b0ca with SMTP id d15csp1451166wrv; Fri, 3 Nov 2023 08:40:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7DPDHf7E6GEM38IaZG3XqR34XN4HRg78C5So3mgAdPG3CQQ66G1eT8cvMiJtHJ4HFpUOa X-Received: by 2002:adf:ef02:0:b0:32d:a688:8813 with SMTP id e2-20020adfef02000000b0032da6888813mr16883854wro.32.1699026003217; Fri, 03 Nov 2023 08:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699026003; cv=none; d=google.com; s=arc-20160816; b=HmR71Ak0Qi2BBEHvxpDpTkisPOYQESEthr/gTDV8wTCUCD9mpATeP5GPAkm7ub9geK godBf/H5z064sPdCtY9VxbfpRJgG5FupRK6k5xrirlAyYTmdfVP/Yo69MfSpYFV5qlGe i/+WDd0he9GeK5oIvof0aD9q/wneTNrn7An2yKc4xbkapXKZncUCqQo1unB0VjNtXaTB h/D5RviQuDu/yIluyUW5heAi3bARpbt8jvKSsyz4TM/lZqD/yb1C4qnnqg8F5+6VhP9J juyiaTg+tgx1vBqFh4fYCSnvYRiq0l3mvGlp2JU78NgibaV51IQcjbIBhdiZgTGi0SpE ceUg== 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=Wum8FcvdH2bGPQw0CampEGidduAHrn+RPHDhzUNaT68=; fh=0FVwAJVeeiaWs5Uwy+ThGAzYpsRrsR444+sPUHEnXUc=; b=XIg+oPBpa97e89A3SDzlbFF6JddvaKZxb4uuMXNk6qe4S/qaQ85omcxQcpxhi3pixm xvgUo5zqNuHlVTFQDZjfmfXNISiSfQVNvc0ElaSjNYbgbGgczcymXr5Frm3uXtBadoT9 jVpV+gALjgSbOOOqX0vgDSTl6iYGbrU5igLq82Unh4zVorkvsC8fWJ+2AFlqUeRtGVCq ymbmg8Zbdy+lf0LEUab1yvGUMQLw+Wy98/riilexLJgvYtrcShSDJvH+mfdr9puG+2o+ YGeZL1CucY+y+TQr8rfBlz6/LfXiR1UTajwfKRu+XLabIrU7YPbrdR5oRMmBab7F4uqw Anxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xcvxI+JN; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id w18-20020a5d6812000000b0032f7a1d421dsi1449133wru.818.2023.11.03.08.40.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:40:03 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xcvxI+JN; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 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 6111E87467; Fri, 3 Nov 2023 16:39:41 +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="xcvxI+JN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A2B48870F9; Fri, 3 Nov 2023 16:39:39 +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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) (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 651888710F for ; Fri, 3 Nov 2023 16:39: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=caleb.connolly@linaro.org Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c594196344so29791901fa.3 for ; Fri, 03 Nov 2023 08:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699025972; x=1699630772; 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=Wum8FcvdH2bGPQw0CampEGidduAHrn+RPHDhzUNaT68=; b=xcvxI+JN5cao7pc/QJUok6PnA1T0rIvkezBJEdk7aERYSEmn2r2CObO/s0WoCK5wFs xoOzP8Q798ABUBcKgzB0wL/K07D5b6Z4ucOuxdXDOt1LKb6kGTZG3xvwmSC7ZgETOZPm /tHoldOWHSiQYOpbxTHaJcOaIQq6EIgQMjNK2+wbcFFj5vTpLd2y17MzISh8Nv1kBIYr uB9vR+u3xoqzsTLczzJAMMEtQgykoRjlldXHxRjLdS82aJlHbZLZd/I2jDpyLyu1vwqF gX8JuUzU+W3+bb3gK3cpe4VsACDU0IP7ZT2UWOaGC8tQNQCX+BbkWM2K3IOGWRr7vuW9 4f+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699025972; x=1699630772; 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=Wum8FcvdH2bGPQw0CampEGidduAHrn+RPHDhzUNaT68=; b=QIsxKHbeyq9qWo0JrFGEDh/E5uU4jmYrpax7eO9mhk9NIJl40wXo2xZm/xwFQByIpe sVH08HmLNQ8XeE090ceU9kN8m6b4fQsBdYAqk66g+OFDxN3V1a92fB6gSV8fcvVr6Ha4 HRa0iVuxvZ++77PPjuTB5/4AXmOmf50DWO80WztjG3FixoUGA+6vxtRE755i4IfwKFeC cp4KtkDyI4Jd9/RCUvlRfEHI+cNmnOAw9lT9lu9jT/drCKwav3fgi6U1jx54wlMYg++k d+qbcPc1Jf7h41uOVcH53Gq90u0l0MXio5pAoaubk0fnDSVjU/2T9OXfbQYnzvSq2NHx 4fCA== X-Gm-Message-State: AOJu0YyKSXLeZMjyRyxx4X/RBJVi83ivKR+K7uwpqqvH0zYUJ+evY+i0 kqASPTlLcrpAkp8eCX/0fZg9BQ== X-Received: by 2002:a2e:3c12:0:b0:2c5:1542:57e9 with SMTP id j18-20020a2e3c12000000b002c5154257e9mr18538319lja.41.1699025972656; Fri, 03 Nov 2023 08:39:32 -0700 (PDT) Received: from lion.localdomain (host-92-25-138-185.as13285.net. [92.25.138.185]) by smtp.gmail.com with ESMTPSA id fm15-20020a05600c0c0f00b00405391f485fsm2928334wmb.41.2023.11.03.08.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 08:39:32 -0700 (PDT) From: Caleb Connolly Date: Fri, 03 Nov 2023 15:39:26 +0000 Subject: [PATCH v3 2/7] clk/qcom: move ipq4019 driver from mach-ipq40xx MIME-Version: 1.0 Message-Id: <20231103-b4-qcom-clk-v3-2-8d2d460ece84@linaro.org> References: <20231103-b4-qcom-clk-v3-0-8d2d460ece84@linaro.org> In-Reply-To: <20231103-b4-qcom-clk-v3-0-8d2d460ece84@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, Sumit Garg , Caleb Connolly X-Mailer: b4 0.13-dev-4bd13 X-Developer-Signature: v=1; a=openpgp-sha256; l=4632; i=caleb.connolly@linaro.org; h=from:subject:message-id; bh=iYFPT2lJUrsBSjeNthaSCN9/BiAzK2lKNsXZEWPQhqE=; b=owGbwMvMwCFYaeA6f6eBkTjjabUkhlRXEQMLVu64Zd48yob7630Nmj8f2G97TvZ86Yr1N/V2F JvfOvano5SFQZCDQVZMkUX8xDLLprWX7TW2L7gAM4eVCWQIAxenAEwkzYCRof2vasJlg0UptoZK GjUVLCcKRI5W+pausMyPKfiwrVzlEcNv9mTOfY0m12/8q5zrpdr87ebr4+HsZrwHPv+z2X184h7 7cgA= 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. Reviewed-by: Sumit Garg Signed-off-by: Caleb Connolly --- 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 d812685c9842..8833ee3e8654 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" }, { }