From patchwork Wed Jun 5 21:00:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687497 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 456254965B; Wed, 5 Jun 2024 21:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621254; cv=none; b=b8lKPCjB+O5SvwNRexWRoSMRvnS+dy+LfimGlP1Vt0auqH+EcgxykYGG9GITbFvdltS1QfBr9ttfbyWIdR9dZXPP2i59O6UZmSYU921n9ox3o2aQz2z1CvjeKZacfy3pKr6ONbkxBgunoOxUXQRmfGdYVPbOPSOXMBa8x95ur7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621254; c=relaxed/simple; bh=V9iuBXE3RCPxqipBIYq+2imZhquQ1wdIjv+HQgtM/dk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CJLwvKgnnHDpbFhki3tYzo+8MXLbMIVwYyJM5MfwXzuazAF5uhTJbjUtiMEGfy8YOuAD3urE2JYB+5X3nPTdxCnQHUJ7vB/P6PgJCRPj8rSlMB99h7auKDXxZIAATc42XA06yLjtkFcheKOw2V66quc6sDgQov6KPmHXho67YCc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SACEtrH4; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SACEtrH4" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4215afa33b7so3026085e9.2; Wed, 05 Jun 2024 14:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717621251; x=1718226051; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SwbtZSg+KieEl718DTPhm+GILj3m52AXbprU8PF/yug=; b=SACEtrH41nZpDxN7QON61tORyWFn5dHuwygegc7csrK+1U9eNU3y+pjx1s2AtQhEDn zTV0LTOkl74Qo6MKH1QTZFANECsLKdLNaCxXfxDTcuW3gPpdT+Z7pt04xGDjBSpJT8qE WHwNmE3mlg1AovAm0IfQqSyUfm49EXsMN4YMFIfeOai+H5xZyCkIw0POWY4qSN2FNkDO 2+MViKo8uBB6Zkg2KEvQ0+JKk0G+sQ2y/aWxrilYLRwXqzl7joHwcuOEQSpz35SuGxQS RSLKi+BjK4BBRgXIYfnfeREqbN8bCjNGBH5GceK5ZXMoEPA0dplqlrnRXOhf6TOD+8rI /gWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717621251; x=1718226051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SwbtZSg+KieEl718DTPhm+GILj3m52AXbprU8PF/yug=; b=VHntkoHXZbi6DDGDQbXe/g5JY5FU8BFxFqKfQSmuN0R7rALZ1eolXL82JnrvChjNKP 1NjMw9cU6m5NJXbMlU6XquF4ahKNIsvYlCV/WBAexftOYgRSw2SbnBCdrwViDSYje4nX aCIMdt70wkLfWDjmCBeuabDCsdZJSRfjgbTMSDxBRKeq4fBnR9LQdsSsyrMhHCzBKyic bK4055u3cdjbxWqd/pGG+WB+G//PjSth+7gQleuC6p4ysHTgVYa+Dpnq320CbG9Kf73w /HOwYCAPmNeQVCPBR8OgTgf4Qx8JIK51REBeN0QR8PyLtgyk+FyrCoffY9J6YOG+fOHL ++VQ== X-Forwarded-Encrypted: i=1; AJvYcCUeFHSAEc5r90Pdnl9W2Vl26U0lMeexHZU2t5fq58I05Dv7ITph4A/hVolhGRbKg2wiYdEtUQ9sv3xkASd4eXVYeyEoglPaUzN6d47X5R3eXVm9Q0gf3KFnha/Rvs5nMoTBQ/Jf2x05x7kI77xOdC1bCOs+rq4/9NyltOGk1iABKcWa3w== X-Gm-Message-State: AOJu0YxRERS+q6U7cC8kZr1gwttieoTtOKQgZEnZAZglCJplyJhDOcYC mqpXUdteSZDgzQvF8E3T7APEXKeyVroK2vBNrf7rjHa6u+LbcDg= X-Google-Smtp-Source: AGHT+IE/9gjfgWZnYQXOAj5tp9SUA5Lk6QARVK16iFxrgqIbxjEEWBQNATeesl0pbTjRSU1L32AXIA== X-Received: by 2002:adf:fe0d:0:b0:35e:60e6:c8a8 with SMTP id ffacd0b85a97d-35e8405dd0emr2592276f8f.10.1717621251632; Wed, 05 Jun 2024 14:00:51 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d77sm15955721f8f.5.2024.06.05.14.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:00:51 -0700 (PDT) From: Alex Bee To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Alex Bee Subject: [PATCH v2 1/5 RESEND] clk: rockchip: rk3128: Drop CLK_NR_CLKS usage Date: Wed, 5 Jun 2024 23:00:45 +0200 Message-ID: <20240605210049.232284-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605210049.232284-1-knaerzche@gmail.com> References: <20240605210049.232284-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In order to get rid of CLK_NR_CLKS and be able to drop it from the bindings, use rockchip_clk_find_max_clk_id helper to find the highest clock id. Signed-off-by: Alex Bee --- changes since v1: - new patch drivers/clk/rockchip/clk-rk3128.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/clk/rockchip/clk-rk3128.c b/drivers/clk/rockchip/clk-rk3128.c index d076b7971f33..40e0e4556d59 100644 --- a/drivers/clk/rockchip/clk-rk3128.c +++ b/drivers/clk/rockchip/clk-rk3128.c @@ -569,18 +569,22 @@ static const char *const rk3128_critical_clocks[] __initconst = { "sclk_timer5", }; -static struct rockchip_clk_provider *__init rk3128_common_clk_init(struct device_node *np) +static struct rockchip_clk_provider *__init rk3128_common_clk_init(struct device_node *np, + unsigned long soc_nr_clks) { struct rockchip_clk_provider *ctx; + unsigned long common_nr_clks; void __iomem *reg_base; + common_nr_clks = rockchip_clk_find_max_clk_id(common_clk_branches, + ARRAY_SIZE(common_clk_branches)) + 1; reg_base = of_iomap(np, 0); if (!reg_base) { pr_err("%s: could not map cru region\n", __func__); return ERR_PTR(-ENOMEM); } - ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS); + ctx = rockchip_clk_init(np, reg_base, max(common_nr_clks, soc_nr_clks)); if (IS_ERR(ctx)) { pr_err("%s: rockchip clk init failed\n", __func__); iounmap(reg_base); @@ -609,8 +613,12 @@ static struct rockchip_clk_provider *__init rk3128_common_clk_init(struct device static void __init rk3126_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long soc_nr_clks; - ctx = rk3128_common_clk_init(np); + soc_nr_clks = rockchip_clk_find_max_clk_id(rk3126_clk_branches, + ARRAY_SIZE(rk3126_clk_branches)) + 1; + + ctx = rk3128_common_clk_init(np, soc_nr_clks); if (IS_ERR(ctx)) return; @@ -627,8 +635,12 @@ CLK_OF_DECLARE(rk3126_cru, "rockchip,rk3126-cru", rk3126_clk_init); static void __init rk3128_clk_init(struct device_node *np) { struct rockchip_clk_provider *ctx; + unsigned long soc_nr_clks; + + soc_nr_clks = rockchip_clk_find_max_clk_id(rk3128_clk_branches, + ARRAY_SIZE(rk3128_clk_branches)) + 1; - ctx = rk3128_common_clk_init(np); + ctx = rk3128_common_clk_init(np, soc_nr_clks); if (IS_ERR(ctx)) return; From patchwork Wed Jun 5 21:00:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687498 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0725113A40B; Wed, 5 Jun 2024 21:00:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621255; cv=none; b=AQRCvhWtUDBTf2eoUMHYfjq6lpR4XdsMfmRECZl9Bqm4nTtsOUeZYEvapoHE6h8si2PV7K1G6FZyeKsTSohCyX7WjzkfCSNbJZpO79Fph0P6ohl36kbLJEgsgsWhd7ksin/07Mt/M3RBN5ABONr4ZsDkTik8EJoko1mKiF9ghlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621255; c=relaxed/simple; bh=oUhHL9Gh1eiLkn61h89qakuHxe3kwFPwvQ1qeKNnvTc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kqUnMceC4bVfN475agRS40GDjX9kOHs1jn5b0QC0+o3anhD2BstWbmCYXb5iWty74INrnA6oHd6smU1L3dFR6pz9h7Xdo41a1Qp6pIVPJWob7QwZaLL3aZ1erGn2Axr0SMMoCvd7tItWi1YedNaqAOYkhcIF3knpF5oQ3FsmL+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=f4x5jKrZ; arc=none smtp.client-ip=209.85.221.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="f4x5jKrZ" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-35e5604abdcso880246f8f.0; Wed, 05 Jun 2024 14:00:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717621252; x=1718226052; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XuZhauiIXe/dPit2+IYYIDdw8J65X44pe+rX+iqZzH0=; b=f4x5jKrZiqjjuycndzGo6ClE0pGaPRU/JgkjiWYFA50a7gHv6BM/lLNgHU+IC3ZzAv s/Nt0PQNZp44pB9hM0QXWdzWofqsTUaZBK9l+ybtaquH6AFZB5WLc5aS0TIwmnxFz86V 2eqULaiAmL6mLP2MqDRAiWU1T8/uxtlrTSRpKfIYllI9npPh9G8aWORWoZutJ4p/GFJC tyJh9O8IVGuVbnjIrcQlgJtUkhLbHGlN1Uf4sgDnP/S5ZbXtQMM7mxrxBFAUdnT8m5sQ AdtPa4Igpf3vc2FRn2UbcyO8Y91HdHi5VZA2ZlAejWBIyPVel8/K6HhDEI4vmw3OOeiA 8Kjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717621252; x=1718226052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XuZhauiIXe/dPit2+IYYIDdw8J65X44pe+rX+iqZzH0=; b=oMg7sHJPhyUVVGc3Vi7IP88liti7r4lttH8B2yVJtCM7KIrNYKK5bNKkjkGYC+KMyA 8KxHF4EV6OUJazFL95LXxCmNhY9AoA9oetY7LSYZpm1Kb+86oTXabEuKzGu7bEZ7zrpt HC0w5ssXqfKvg2DmILT/dnLNpLSLTH0ivsKuNLnaHVEveZ6R/OX2QCQTtsyyCUlTMwRq bih5D0c7fE0UC+qyyEj6E7UyyrHOamqtQuc9sZkjw6CHWo9KAlSz3DDDKJ4iJPR3TwVX AFcgeIGa3RtRNU7ZXJj3POc2u9JJjGg6w3p6741w4zBqSJq3Z9U5nc75zDHFtNwYPr8X ZotA== X-Forwarded-Encrypted: i=1; AJvYcCUow1ABjnyHTRT3uKQgSlL+umGS9tFImDXCoWYU00InfLgnTtbPMW8TuoPptv/UKPuxSvUpHn/hgS0I0i6IVaBQV4Fll5+OZamr0zEZHdLkcs8Td1NQ2D6HI77M3uTwCNSjckucwxC9HIImK76jjwZQgesi0gu7OtuEPxs14OEBokMxOw== X-Gm-Message-State: AOJu0YxIZG82hWwsySvi6fPBZQpReNN0WkaEcd2TqN8MlURNSq4P7+1j pi296hkwm+ul18EwZ68gi8Se6G6WYD6vl1qYZ8vIgXvduMv/4MY= X-Google-Smtp-Source: AGHT+IE07M3Ayc5UVGzWAK6FK9JW9Ttxd18yCpMX1vjpRHWw1Ldtf8cyezEw5LAY1mfB5VzssLahGA== X-Received: by 2002:a5d:6d8f:0:b0:34c:7ed4:55a with SMTP id ffacd0b85a97d-35ef0ddb092mr806043f8f.33.1717621252274; Wed, 05 Jun 2024 14:00:52 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d77sm15955721f8f.5.2024.06.05.14.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:00:52 -0700 (PDT) From: Alex Bee To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Alex Bee Subject: [PATCH v2 2/5 RESEND] dt-bindings: clock: rk3128: Drop CLK_NR_CLKS Date: Wed, 5 Jun 2024 23:00:46 +0200 Message-ID: <20240605210049.232284-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605210049.232284-1-knaerzche@gmail.com> References: <20240605210049.232284-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CLK_NR_CLKS should not be part of the binding. Let's drop it, since the kernel code no longer uses it either. Signed-off-by: Alex Bee Acked-by: Conor Dooley --- changes since v1: - new patch include/dt-bindings/clock/rk3128-cru.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/dt-bindings/clock/rk3128-cru.h b/include/dt-bindings/clock/rk3128-cru.h index 1be455ba4985..420984fc2285 100644 --- a/include/dt-bindings/clock/rk3128-cru.h +++ b/include/dt-bindings/clock/rk3128-cru.h @@ -145,7 +145,6 @@ #define HCLK_CRYPTO 476 #define HCLK_PERI 478 -#define CLK_NR_CLKS (HCLK_PERI + 1) /* soft-reset indices */ #define SRST_CORE0_PO 0 From patchwork Wed Jun 5 21:00:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687499 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94AC415F301; Wed, 5 Jun 2024 21:00:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621256; cv=none; b=qhAbGNl+VRpAY+ZIFdREuzRTWe3L3EtniZwBc30GnKLeyzTsd9HdYqqPyj5ucYbe0gW3AbxzyFvd2xL3Bh88JTmOlXQIR13OSSktyzxWEzmqHiPZRaDlx/v/ZeDWAiULimWdvbYRSKOikMjK5oTS3cKe87c26eyngKUkUYqcyoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621256; c=relaxed/simple; bh=qj5xcBjZErFO/5M33HBTO0XOhViDdJ/QFEMyH3GL7rU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R7mgcdMVvuQVacGWhyO3NIGdeu9SCjj7xhcGLNZjms3GwaqEApzrViPv5E5kgdhNw2vmVat7oQmVRIria2BcnS9p4tz8zsQmdtTq+s587Ok/SmsEGpSWpsYPbGEIvLdSdZl3uPRMVuXtMbd137WepUKPRF3kEntxeLWGwBoW3FM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QR0YS/59; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QR0YS/59" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-354b722fe81so237356f8f.3; Wed, 05 Jun 2024 14:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717621253; x=1718226053; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=33SKSYjNACPXXw3O2oejlfq/sz5jEco/GHNmXgivYNQ=; b=QR0YS/59YQMcrHrOzGfZ/d0AaLAVdZfbij0P/JVcospZGgioaUpLq+wKCwNtWdR9cF bDQmEzZMWaylkcxRydLR1nmCzNwmZm8Yz8bEn7b27txdSmIIZtq2sHMq17Zmr/e+vlbm UxZfjHxHnhN+mqy8TUX3FgUFQ1Yaw0pBUrrstyXFbk/ypJOxaQhQnnSkHxZmHrJnXsoP 6/N7LqTzB+W/Id7HrnHtdK4JOQydrkDFQxP6rpstwW7qMiQlSY7VtIiVSRddppLaOXvo Tbd0F5l8ESFduAjwm0ivPvtgC64ftvxl8JLW19fnJa9tOo79ZkWxelmw19eNwB2GtyO3 /eEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717621253; x=1718226053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=33SKSYjNACPXXw3O2oejlfq/sz5jEco/GHNmXgivYNQ=; b=u01VJcRG7VM2Rbz4Oj6MVcLZh8X6tged0qXSdwmHoP8JVsWQmucbGTyki7LYF/FCep 4jRWzwuFDfhUZ+u9eD+yT1bpx2NnV3dmkKfla1OCBJiNBlGrniOFS86CYp56xWivUT8h ldBQ+R38llJRZ5IogaBt4xqf8/q4pC5FtcRkIn8l1FaPa/7sKGPi6/ys2llE1xiEGOq/ R4vcfyiFsbynWZXbwz5W2PSU173aJ9Cj8jnIruQgojskjCZi1ou0lNPbov4oTFE2AzOL fuw/KggpMn9xk/59Zokuxl5qtJL0AosyBVdFvuSVLahlfdj8QrJ1vi6gOzCY18YxLkGE klTQ== X-Forwarded-Encrypted: i=1; AJvYcCWHyOyaiv9liRYrvX/4v9hQyvwqp5cABFdG25LMEbs64pvL4jytK9dlU/vTzs/SnIyf5lKzKpwWJ3dTZui0topBYfwhk4zPNEdk1YFzcHduk4p8k6lHx2mCSLMIOFkALt7cDLtihh70mWFgpwt2D04zT+cQDegrkYn99UdTpxQzqCffcw== X-Gm-Message-State: AOJu0YyupVAN5ub1FM2tdT8CCkXDpZuAJsrUoCOo24l2ETG13qnvAXyo 7QT2HqMFr2dfgi7LJwcOQeWWNkn5WB5uYSNSzUk10G0KdWt/JLVpXXah X-Google-Smtp-Source: AGHT+IFcXVzdcNVRTv2q+gnXoLiA/j0pGT6qTKLZ1gOC2fRRWKBiSTRzKhmf2QhA3zWNLo70MM+brA== X-Received: by 2002:adf:ee50:0:b0:355:796:15ef with SMTP id ffacd0b85a97d-35e840583abmr2623083f8f.10.1717621252888; Wed, 05 Jun 2024 14:00:52 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d77sm15955721f8f.5.2024.06.05.14.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:00:52 -0700 (PDT) From: Alex Bee To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Alex Bee Subject: [PATCH v2 3/5 RESEND] dt-bindings: clock: rk3128: Add HCLK_SFC Date: Wed, 5 Jun 2024 23:00:47 +0200 Message-ID: <20240605210049.232284-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605210049.232284-1-knaerzche@gmail.com> References: <20240605210049.232284-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a clock id for SFC's AHB clock. Signed-off-by: Alex Bee Acked-by: Conor Dooley --- changes since v1: - add new clock id at the end include/dt-bindings/clock/rk3128-cru.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/clock/rk3128-cru.h b/include/dt-bindings/clock/rk3128-cru.h index 420984fc2285..d731c3ffbe1e 100644 --- a/include/dt-bindings/clock/rk3128-cru.h +++ b/include/dt-bindings/clock/rk3128-cru.h @@ -144,6 +144,7 @@ #define HCLK_TSP 475 #define HCLK_CRYPTO 476 #define HCLK_PERI 478 +#define HCLK_SFC 479 /* soft-reset indices */ From patchwork Wed Jun 5 21:00:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687500 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DEE515F400; Wed, 5 Jun 2024 21:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621257; cv=none; b=EmwspRITSmbUlVXtxcpE02coaBC00FWrnNO0YEzIEZLBtxT7EXWIopnnx3fvfZZ0QzqH7oNlRduLsHUYKVb0+VLKQtH2eRUxW2ywPO3+t0068QrEGoKiNoOVW81ul9mC4vYmT7F5IS11s2DZRVWrLTy1gTEO3vjN5al3M1zInqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621257; c=relaxed/simple; bh=0hQOg06m6hCRZq4aIk0CQ3974f7/WXPRwvQqm4cuKP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aSBgVJl49XAnjMWZXwVEiuLUPv5GRR6leJqvx0D+5gIDXxMFiiBCSKxij4fHZqY7gPWw+hVp5SaA1ZefBqyNqtM8vdYOBC3BCxXwLtvfXtomqrldh5mOuItzRZtdCG+hK4Qlman2rNONOeMRsI+EIapReWmUDDWz7NRFD6V+BKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lTu2hcKz; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lTu2hcKz" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4213b94b8b5so3554835e9.0; Wed, 05 Jun 2024 14:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717621254; x=1718226054; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fk9rPd7/DZbkWMr4RLdz9e3yLOVFGIh3KC1NJKidnyE=; b=lTu2hcKzXakAfOwW0aTfK8jGax7t7UXlpsV7aFPSgmbviBpmNZ/BlUAgFn97NacqVZ Ef+M8MafmJJwHbkb7fOOelebCuH224PbwRLWWVnJJtuk0aah799bZeMgyr8Qilzx+Twt ATgHouTUPpeAu7Dy1ZT+4uc6fqr6BcjJDosJ5iMJbz8ZNXfOcElpmAt8764qzJTm/4kM 2rsevwiL4pRdNhu4bdiTfxkynf8Wna5P9xqw80BVbeB7kuAoyFBell4PU3jKQ8cRONkF R3UFnhXcrPoPpLnctdkfqbLOeLtycDk9g/HXJPClCtP0/dB7YLf5/Qm0V3+k2COImg1s mEag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717621254; x=1718226054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fk9rPd7/DZbkWMr4RLdz9e3yLOVFGIh3KC1NJKidnyE=; b=Yb58q80Mrb/g4MZv7znKg9Ly4mp3w6mItt51pGhUb+73xG0kJhi0pUZXgxiMFNyXQ8 vctWTkKPAjTXWWTuaN2FyQISbHmC5ynH4Y6ex23gtj4Qyqb3H6UNPmwSTKM8YTIMVHfn PIB2VJvB70TjaS6DmnviJCWztqw0xDOWrA4ZIMmkixM+BkUZJhK7gsinNNO+3xXtPw6F mJPeblvYN1D6Qk75AqK5YIQi47WIgPpK8QjEdDsVHIXkMkJvPHxocU9XSEZlDFKAJrtH kCO+UG2qMJ3zWMrCu9YNZfCxupY/+djIIHz04wAtEOiFqfVOUcFQLhq7kX09ekHUHTTq 7jVg== X-Forwarded-Encrypted: i=1; AJvYcCVrr4GnhtTlCs12/c9Kk7u2RVjrX9o81g4NeBOMF4ly7K2Ja0NAysVGiIeWfh+BznLlBOwpYPZ6k0nZ9NHHe/RMvkBeduaHsPjBUAIaUzdw3IdvClyCgkpQkYEWPTVyysirmaUkukBY7dUyA3YqLmuwsWlrlmjMPSLqJsex+EFiPhPOpQ== X-Gm-Message-State: AOJu0YzDQTR7ZO8Ov5d9daFut9T+GAUsXYoNMh+N8cbZlwn6jG+BARu+ G0xF9Q0c2gvC2orAfkAc7A7LYp9cTaC+SJzJIOQVlWkSpMan7jE= X-Google-Smtp-Source: AGHT+IEzFnF+ZiqUZD6IAFUBc9JkLG0/nVhzj+suO7W+KygvluwYQcTuVTP0MA1/SlsiCkafZG+2rQ== X-Received: by 2002:adf:e847:0:b0:35e:f3d0:e10b with SMTP id ffacd0b85a97d-35ef3d0e34emr92878f8f.23.1717621253590; Wed, 05 Jun 2024 14:00:53 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d77sm15955721f8f.5.2024.06.05.14.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:00:53 -0700 (PDT) From: Alex Bee To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Alex Bee Subject: [PATCH v2 4/5 RESEND] clk: rockchip: Add HCLK_SFC for RK3128 Date: Wed, 5 Jun 2024 23:00:48 +0200 Message-ID: <20240605210049.232284-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605210049.232284-1-knaerzche@gmail.com> References: <20240605210049.232284-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The SFC IP exists only in RK3128 version of the SoC, thus the clock gets added to rk3128_clk_branches. Signed-off-by: Alex Bee --- changes since v1: - none drivers/clk/rockchip/clk-rk3128.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/rockchip/clk-rk3128.c b/drivers/clk/rockchip/clk-rk3128.c index 40e0e4556d59..7c3d92af12df 100644 --- a/drivers/clk/rockchip/clk-rk3128.c +++ b/drivers/clk/rockchip/clk-rk3128.c @@ -553,6 +553,7 @@ static struct rockchip_clk_branch rk3128_clk_branches[] __initdata = { RK2928_CLKSEL_CON(11), 14, 2, MFLAGS, 8, 5, DFLAGS, RK2928_CLKGATE_CON(3), 15, GFLAGS), + GATE(HCLK_SFC, "hclk_sfc", "hclk_peri", 0, RK2928_CLKGATE_CON(7), 1, GFLAGS), GATE(HCLK_GPS, "hclk_gps", "aclk_peri", 0, RK2928_CLKGATE_CON(3), 14, GFLAGS), GATE(PCLK_HDMI, "pclk_hdmi", "pclk_cpu", 0, RK2928_CLKGATE_CON(3), 8, GFLAGS), }; From patchwork Wed Jun 5 21:00:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687501 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 006B215FA66; Wed, 5 Jun 2024 21:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621257; cv=none; b=tyRGwRqivE6c9koDVP8Pg9zeXpGpkBy0aKevoOTEtPFLySUL9LdH8YRm+wyEZD0395jGvBWzSL6y4f5AGUBxkRs2j0bCYVoRcfilpSf800siY1ZznUx5q63ROh0MbFQ+o0u9wHJe/tpzaDbxBNEo+VkfyOI3RQWhgNBtpIsWUZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717621257; c=relaxed/simple; bh=XbbvUFHICWvu13gNhRXL0Fye9J8RtUmvNrF/SgzD6jI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m9LlInl5QLhu1Br8UpmHm2lb7uA3C94ZGvh+tlLV6d3tUjHS+lq/8VVgT9bB4fFrwTb9qFrWGWYMZpRyrjx6wW8IpgCa9QdxRl7b4PIU0ig5ZgOVd4X7SEvErkX2cE3jWKLbUSSei7H8ctFgs3w+EnJck1Km8fA1R++JzAiUzuY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KB9Z9poR; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KB9Z9poR" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-354f14bd80cso214307f8f.1; Wed, 05 Jun 2024 14:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717621254; x=1718226054; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jhHtvxGUyohTCTNa+GzFt+gMuFh5QKejQOFzumSpgUQ=; b=KB9Z9poRg/PsZYJS60eqXIJSG98xhGjfSqUf58xWugUvYWtu8aU1uXB8axgSRjdl4L k7mUCXLiAe3vky+1ec2KxLkTQP3/gcpnvQ/JCoJQ9U+1ju+IIJQzgioWwbEp67wBSQ29 Qwd7lcm7vAgbz8MYTTuvHHAoghjUBiz2YB+WjmYW5N/Qc4jmvjMwcczFTPfNw4Pzlr/I gt9RJC7bjRC8b3MCNDl7CC9SUV3D/R50gez8DL0qfzakRzH46UWJWH/2X0a9Ct6hq+we V8m/jWgJAYdXvFSodOxUUEc2BTcTwAFXXY7lR2i6HQNFaslnSaLIT29A4kdahhWXWDlp WkVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717621254; x=1718226054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jhHtvxGUyohTCTNa+GzFt+gMuFh5QKejQOFzumSpgUQ=; b=nyktjPKQDQgWoAjw+j1tIhH5DXrnVI9h6QOeRlXHVHjHgqOlbSxoVT99UmLxCRfwvS VR33XLqb7d5elowCsLMWrEh5EnUcVjgFcE5SG+ulUcyrcyXdSfyoDJC8gnP/8DTv/Hh6 ktQuleQN49zS5gQ3cT9O1Ckq9wFKBKwZdryKTMxT2n0IuvdtmbmOkRNeLaUsoesgsWJV UOyKgyc0QJ6rA5fU6CkhcU6tGs3VClrTwfvpwVwGeVewEdaJMr3VH5VVUq9nnX3v2SrB WNk50crgpv3Bw0EAenITunz+rw9mVbuJvDdXz1xdxUKtqB/szhhO79Cb6vXEYoWCNKWu 0OYw== X-Forwarded-Encrypted: i=1; AJvYcCWOAq6MqDRzBDyjZaOEqzPLvc98p3XmOXsNScxoMliYtD0NdVpY6aW+u0B73OptkbZxtBd5W5W4KB553G51mi+iiRAq2zKMiDuSCaV4wqBtFFCVd0UGf68Ip4HPioG0CWu37qX7dG5nE5r39vVS5+dOhklX9/g6OzTSip1HwoLtU64I6Q== X-Gm-Message-State: AOJu0Yzt+VVj0sTYy0cvyzAuA5Sb4ZfNiWpnuyOWZGucRWdMmiLngZ5T FIqNoMdU6xMvw0n4LVS+LHm43TIn2rN7K13C7/OPTE1XwFg57is= X-Google-Smtp-Source: AGHT+IH/ErPZA9UlMKsmZDV/X1wnV/PWz8EhOEK3XFrFUKLnJNMrmKCwpJ2Mt6rxai/f8/VEUq6zvA== X-Received: by 2002:a05:6000:1884:b0:35c:1961:899d with SMTP id ffacd0b85a97d-35e840754camr3384746f8f.27.1717621254251; Wed, 05 Jun 2024 14:00:54 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d77sm15955721f8f.5.2024.06.05.14.00.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 14:00:53 -0700 (PDT) From: Alex Bee To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner Cc: Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Alex Bee Subject: [PATCH v2 5/5 RESEND] ARM: dts: rockchip: Add SFC for RK3128 Date: Wed, 5 Jun 2024 23:00:49 +0200 Message-ID: <20240605210049.232284-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605210049.232284-1-knaerzche@gmail.com> References: <20240605210049.232284-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the Serial Flash Controller and it's pincontrols. Signed-off-by: Alex Bee --- changes since v1: - none arch/arm/boot/dts/rockchip/rk3128.dtsi | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm/boot/dts/rockchip/rk3128.dtsi b/arch/arm/boot/dts/rockchip/rk3128.dtsi index a7ab0904564f..22e2a35dedb1 100644 --- a/arch/arm/boot/dts/rockchip/rk3128.dtsi +++ b/arch/arm/boot/dts/rockchip/rk3128.dtsi @@ -399,6 +399,15 @@ usb_host_ohci: usb@101e0000 { status = "disabled"; }; + sfc: spi@1020c000 { + compatible = "rockchip,sfc"; + reg = <0x1020c000 0x8000>; + interrupts = ; + clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>; + clock-names = "clk_sfc", "hclk_sfc"; + status = "disabled"; + }; + sdmmc: mmc@10214000 { compatible = "rockchip,rk3128-dw-mshc", "rockchip,rk3288-dw-mshc"; reg = <0x10214000 0x4000>; @@ -1155,6 +1164,32 @@ sdmmc_bus4: sdmmc-bus4 { }; }; + sfc { + sfc_bus2: sfc-bus2 { + rockchip,pins = <1 RK_PD0 3 &pcfg_pull_default>, + <1 RK_PD1 3 &pcfg_pull_default>; + }; + + sfc_bus4: sfc-bus4 { + rockchip,pins = <1 RK_PD0 3 &pcfg_pull_default>, + <1 RK_PD1 3 &pcfg_pull_default>, + <1 RK_PD2 3 &pcfg_pull_default>, + <1 RK_PD3 3 &pcfg_pull_default>; + }; + + sfc_clk: sfc-clk { + rockchip,pins = <2 RK_PA4 3 &pcfg_pull_none>; + }; + + sfc_cs0: sfc-cs0 { + rockchip,pins = <2 RK_PA2 3 &pcfg_pull_default>; + }; + + sfc_cs1: sfc-cs1 { + rockchip,pins = <2 RK_PA3 3 &pcfg_pull_default>; + }; + }; + spdif { spdif_tx: spdif-tx { rockchip,pins = <3 RK_PD3 1 &pcfg_pull_none>;