From patchwork Wed Jun 5 20:51:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687480 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 559AA13A890; Wed, 5 Jun 2024 20:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620735; cv=none; b=K56V1P7hvs6oPnukY8BzdQCx/VJRfd9/Fkzp+veJWSEsodzTt8AK0n5UHsmQRwv1sGNCBR8qOts8yMGgIEE8i3+mlO0UvcDmtv86KjmaD2SRypvghBus430usTsYjJMKwWK0ijNcPxmdj/NHWpNNtYCqR314LUjHyktMIm/7y2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620735; c=relaxed/simple; bh=T4Bf79Ruzb5YS9eT8OxHnbdxl8lURVHHqzg4nFDly2Y=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kxaClO26RZuVU0Jh6Pp5GifrJboyUZw5pPOj6j/lgDM2HJBDT4KLCPzJjxNywCD6Ad/Y6NnHhVi/2wVWGegCjKXkvNwApOhK/Sf9cwxgTcLKD7pXOcl6yoqCne0ghUkCCu8NbKlBDHjVOF08+Nwy7G5P6D3eMCwFTxp1P0M5Hrk= 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=nRSY/ch/; arc=none smtp.client-ip=209.85.167.52 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="nRSY/ch/" Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52b950aa47bso440803e87.1; Wed, 05 Jun 2024 13:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717620732; x=1718225532; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tRZR2FIRT4kLU11sqM7VA2ozbtsr+hE+nmcdAqWhupg=; b=nRSY/ch/UhQabCeHoRIPF84CZdRuiyq6oQPpxWN7Uy4kZYwKrCcNCC6v9scNrEqK3m bPK+XN5Eje5jnB+kwlCXgcolB3e0kL65XAgtmygd9boiQl6z8AAOz4QhiLLTEH0Xz9Ck IP/rdDQI6PbQcH4X7ZEMRrUtQkn/+LThXB8DOT2Wevdsvaepy9DsteZMUJ5kZNbIvz8E LS0/8IBT7mJyuS6Uz8rM6kfapZBkMVqiJ5zv+p7T0ntKJz1vTau2O+8JrsmGAfltAbDQ u9Fr+84yfazu0ub1NeklcIKWMRsNa17xiE/qGbJCPWWR6UNsZXBm4cNHNhtbsu+aIrLC rlGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717620732; x=1718225532; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tRZR2FIRT4kLU11sqM7VA2ozbtsr+hE+nmcdAqWhupg=; b=vNWPhY5dCp3nmfvTxdEqw5gHI/TeWwB3JqOLZPJnv2NM1qTzrHP1E9DEIjTvMZ8gj7 y4s8Oo4GbUgjDl0J8quQkdRcqYE9QCe4Cv0QdNr+XWQTQCDXkOFNQ1vFmsaGlqvLwfPL +XCt8vFc5PJi55zuniQ5KPorPJMqrzYWEtkO0S4Br3CIUr1tNy89QIPTN69kmfmVsIAP 8+/rdnWdg9c7uOL34UPEnrRVbdRFyf/G0zWu0m3luthct9Y/0cqkhMnFhZeE6+FqWlLO LslSehDVYs31fk6Ve4cVtd9e36lcGmlYl4XhM9kYd/IuUr6HTbkf8YdxB2ixIUkHbdLG ynKA== X-Forwarded-Encrypted: i=1; AJvYcCW4ngoAQhhDGec0Bo28Ret7EHw92mgG2/HSNwYUVbwxyAGcm0i88X1/oiulLI8QpZaCo4wt2SUeCM0cH610DoxwmhCepKDXoMHsB9IF6bqp1l2fM+gnJrWQXbPJuCuwET5OpNOSudyCXzyR+Fga0x2BdOiC7d8yJSdxaGiUPGFnZuAGlg== X-Gm-Message-State: AOJu0Yynq0qACAhppR9vL/ovNGLJYKF/EoS/6TW2vciESf9DiDOK0tP6 yEunKl6kVHr1zbR1824NfZQbgaxlPFTBiXzChESV6PnzC8uX9i5pNhL0 X-Google-Smtp-Source: AGHT+IGj0rVw+PbaW//1K6g6mF5yaX4g2jKv2yrK3ycmj8fN1glaSqwLjxl18e4/YdglcXhTAkU7pw== X-Received: by 2002:a05:6512:3b97:b0:52b:8847:ad0f with SMTP id 2adb3069b0e04-52bab4cb7afmr2982121e87.11.1717620732322; Wed, 05 Jun 2024 13:52:12 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c71bb5affsm72265866b.147.2024.06.05.13.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:52:12 -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 1/5] clk: rockchip: rk3128: Drop CLK_NR_CLKS usage Date: Wed, 5 Jun 2024 22:51:59 +0200 Message-ID: <20240605205209.232005-1-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Similar to commit 2dc66a5ab2c6 ("clk: rockchip: rk3588: fix CLK_NR_CLKS usage") this drops CLK_NR_CLKS usage from the clock driver and instead uses the rockchip_clk_find_max_clk_id helper which was introduced for that purpose. Signed-off-by: Alex Bee --- 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 20:52:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687481 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (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 B245612E63; Wed, 5 Jun 2024 20:52:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620736; cv=none; b=g5BBp85skSSlZMS4tp2EJSoY8bUF4rz9NyhgEXvrU1F4+a183PnFXh51hCobEsalakPfWDb1HvitAKQzP5VO33AZfMiW3seUa0HFjTWebZzrJ0S96UPlFLwZXjYEez32itf9G0Q2TWyevEpVvD3Y2N7XrsYUjsHs2v4teQlbntU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620736; c=relaxed/simple; bh=T4X1hUyLpXP90M4wfsNZkBFYoIXVnKWnd66O2FMVaFk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HGprSj+VGYE6TdeSq0zDX5Ex2kxfVso9cY2guPvFfWSqdek6V1Fj2sbtbT/sR9NNSlOEC0/Z2nJ8HzfvMucD+onfo0SkKnYxrDgmEB6JX0/fA3OPt98gIQYeMPCimK+gZNOjQEgGC8Xf4t6COZY4QdUrfM+vKVDUi6LtgXRPwPQ= 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=kRv8mk+0; arc=none smtp.client-ip=209.85.167.49 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="kRv8mk+0" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-52b94ad88cbso451859e87.0; Wed, 05 Jun 2024 13:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717620733; x=1718225533; 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=ntabvct72qGvPmbO5oeReuAlzSAK04HTOHOuuEcj1Pc=; b=kRv8mk+0/r5wAxizcAccSZqJutZv8hzRcxq50/YU+3NGxnVVdBB9htxcabhn1dexA+ oD9sSPqflbUqYGsMH12pvBCSsB9YLf+pHOMuBEbArwz8KC6J4RHXm0R7KYeZji93GtSE V8A5qdcs89pyQEdcNICDD/OqWBnUIzjw0eTG3Ynsi74xs7PV44cWRsD0Yg3ZQa7aOdXy g/CpimZRa+Hwgj2yWQAHI8uNXCVURlBN9CbZNvw0RD+RCJgk/r0grZnCrHqYhFTXC8r/ +WSHuc5HkHSFsJf/16aSPKnIpRL442laYdSczP71ShEgE1VyHJMv6p5gLwKuC55UaQ7S NPHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717620733; x=1718225533; 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=ntabvct72qGvPmbO5oeReuAlzSAK04HTOHOuuEcj1Pc=; b=qpZWPOSGt1enT7Npo2sLqLXGRx7feFIogU4EVkLJgV+80azli0Odx9N8hQt9qwlhJ8 QS4kkPck4uCZgYHcBUTq54Ls3H3UVYLQjjF8cS0qxEyTOPDpDefjmhdg/qKiKpfqdAxJ iIFgbJRaxoVu4nWLPdmoQnRug8RPYV5gKEhQUUGEhdrSj5lX9oAWlhyLMxjxOWOxF3/Q vzcFCMli2ASybh7PgsEUaDTvbqVObfmq90bmeiFmgMQsHe17OVqMfvtdUPU8zVYJXE1C sB0WQPuoXJfkoMVyEX7Q92d37cN5k6W3tQKPbyzO0EFqvREluT12rqlCCIpFvpCJzWYd Orfw== X-Forwarded-Encrypted: i=1; AJvYcCXAGg6N7H+y+j2OTJmtN37Hj1gAyjh32natRpqCIbgvC8Kw+Glg31yZRgVeQ82uSWJ6g5FJlvF+Fhb01ibuquvn+xD1JSXtjcm+bVtkWFuztxmLve3S9cY/yXoR2zdRxC+t3Q/0bEMcFHOQNwIjH5bSYGfILBZLRTvzPRii8lQ0vGerzQ== X-Gm-Message-State: AOJu0YzM8XL29GIu4xHaWuZDJgKNpWJqLD2oegt7pMBeZrQKe/el6ors R3b3i5gB+UzD9ucuNAYRRyiLxl9JNdFseFMRBN9WEHnYyxjjnco= X-Google-Smtp-Source: AGHT+IFLsFZKV2UCEFoLeUQP6sDHDvqEj6Gdi7GN5knUg+e3+onFNbKTpZbrCaUvyEmzLhZLX0d6oQ== X-Received: by 2002:ac2:5592:0:b0:52b:fb4:1283 with SMTP id 2adb3069b0e04-52bab4d8022mr2642243e87.15.1717620732936; Wed, 05 Jun 2024 13:52:12 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c71bb5affsm72265866b.147.2024.06.05.13.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:52:12 -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 2/5] dt-bindings: clock: rk3128: Drop CLK_NR_CLKS Date: Wed, 5 Jun 2024 22:52:00 +0200 Message-ID: <20240605205209.232005-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605205209.232005-1-knaerzche@gmail.com> References: <20240605205209.232005-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: Krzysztof Kozlowski --- 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 20:52:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687482 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 7823D157A41; Wed, 5 Jun 2024 20:52:15 +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=1717620737; cv=none; b=fPDuo7YD64JZVI/VRObDNSX/Lo59hRpE0u383QqRkqG/ardcJG1H5vNEfAAjKKNre8qDP8XqvGPwfYpfbI4Hf+KEqasWTxOo0QgKV9EuE3uveVLrl/wkW3v3OWFs5pMs4wjLnTuCRt0mMzd8OlcNFco6WB9Ho9e8ENki0s3Ii78= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620737; c=relaxed/simple; bh=by1GsYCIe+rl1n6QK7VRgyg7zYyTWVt/pjwSdMKSz+0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HfTSrNbobapK3PDfKz/7f/O+ImTMEb3Sj7g72eMIgDJpcuaGYK4f85qrKFVUjmOhUEb4exrWXkxehnU5v05u64c9Q9ZVdXv6slfA5c+DcaLJLFtAcuilRCKE1n5caaVvTPEXwW8Hksh4K7XYosnvNl+zIACwFh8bIefhe+aGwv4= 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=flWc1qKl; 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="flWc1qKl" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-35dc1d8867eso250560f8f.0; Wed, 05 Jun 2024 13:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717620734; x=1718225534; 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=Bv2MjK1b3RmQFqpYtvaVw+b1geYBojSDIiV6z6FsDD4=; b=flWc1qKlgShTxP7l3NrZ0mLTr7Kj2EbqgpfCVOrVHSSa2rxIq7n5zW9tEdLkVShPLR e+sfVugIPUd+7j2g1tqyCpJslG4wt94cst9MWo7wn3BKLGh5Ge/Wasf2ZzlZnu2skyMy SuG3HbsjrLqCpfnP+jXNai3HsN+lhEPwtccCSPRLAMAy7neEXQNh9Wqy6JJ8BMdKFHrr WZhsy1IsFSGerJN7yfT2T+G56dwv724bl7LldZy3eElYK+9snSrR5Kck28VV6iHTLlyg lj5cctLDuTIrbE/5YbVX+HdQ1TfXGTRF00nfyhaVefNK/I5RsxcHvugWaUjRopoX7664 UsHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717620734; x=1718225534; 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=Bv2MjK1b3RmQFqpYtvaVw+b1geYBojSDIiV6z6FsDD4=; b=YjRl7ZF93S+IHRc5xTcmBj+HnMo46j36drBF016Rj9dprqCr54nWHVUYftf5+MQXt6 LlEzLXYOTOfeGjCqhyHZl9YpSjY2Rao7mL79hw/G5sNYy8J64S4kFKYgcQIrvzsnQH27 L22/+mIexJelXDMauewtTK+jgWquSjL25xcJu6b/sOqq9mL7RoOCk5AT7vTSaL2MNiVv 3hJlORUbhg9QLrsCUvofRMHevjBPrnSZ/WyJ9lEi0vQ5F8qxxxEz6ZsRiLq/bEWw3AVq y9EH5giwTzfDhowp+9RaTTaAE1+vJMZIJE8G95eSKe/YnmPN5NVv53ul5AJprkXvG9D8 LSmg== X-Forwarded-Encrypted: i=1; AJvYcCV7hZS3jsC45nXgT9pUc89QmWn7VH6juDl8WDnr0p6BnNlYDMzoVaxV4Bsb5UdmfPtZTmNdYy3GbxSWor70BdJJkLrNVRIsEWCNAabfhFiC+RDf38HlHttzYmGTbAKYpxk6gNpdLM1XnR76TeiNgfzLNDzkfWkytDLuWUBheFmN2gZVDw== X-Gm-Message-State: AOJu0YwOrTQliRscRAZbLrBOfxco2P1En8bTLSbgh6QSyk6tkP7x5vTr b35bckHI9RXuYBy5N/4i5KJBu/zv3DTjWn5Nr0DC6AYOFr8xlAE= X-Google-Smtp-Source: AGHT+IEdu7DZ/9OzmqugpPTGdnR+0jSWZhYN2028kVpeF4tyO0nXwrIm165+21c8BBaDKxmAhsDWEA== X-Received: by 2002:a05:6000:1048:b0:35e:5b9a:2ce8 with SMTP id ffacd0b85a97d-35e8ef7ea0cmr2749551f8f.51.1717620733690; Wed, 05 Jun 2024 13:52:13 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c71bb5affsm72265866b.147.2024.06.05.13.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:52:13 -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 3/5] dt-bindings: clock: rk3128: Add HCLK_SFC Date: Wed, 5 Jun 2024 22:52:01 +0200 Message-ID: <20240605205209.232005-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605205209.232005-1-knaerzche@gmail.com> References: <20240605205209.232005-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: Krzysztof Kozlowski --- 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 20:52:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687483 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 16C4D15F304; Wed, 5 Jun 2024 20:52:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620737; cv=none; b=Grf3h+Ho0T6B9PFAQy3QLnDgGFzeeGGDokQEbFMblhYd6XQrcsrUI0/cOJPVBf5vIEqDO6zMf2fva4mbVsLidbifF4bbfRNlXjPB0rpUYyfIXJz5qg0YMwb8LExB9ySUK90xJSVf/+TJW5mWtO2gneD7axgObPTscZRLAxcbSN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620737; c=relaxed/simple; bh=Au9iWsVMPpWPvAI260SLmfTKId8+c/JwL4nXeMKMoC4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=omUwvJCI8eBlMZZ+Ni2pjCc1COxfaH1NJ3DB7zuq3dG5Xf/zuXAu5HPi2iF2E3Sr9TytsV6qwu56Be60CmpRbIQpKhv16OoNN/lEpB/ducjrYjwnF6KhvEIkZ0nOrK4bp1RL5UIuDrolvn8gHxX4UoRaZeMqM+Ztaw2qWrWz9rw= 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=O0GG6IiM; arc=none smtp.client-ip=209.85.218.46 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="O0GG6IiM" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a68b54577aaso27430366b.3; Wed, 05 Jun 2024 13:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717620734; x=1718225534; 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=x5DqSnKeWsYvEazcs2KZiewpru7ofXBIBVWU2Z9PCjs=; b=O0GG6IiMTNPAZcYVEiDjCmPADOhmb0PV3lbhWvydV6pE61pYWPNh+BqeK+r345x3KF TZDNoVgUyECu3YBRe1/jq6PHvK19i1o43ag6ZOMrdlMfZKenGfZeVzLuVX81gX/w9tRv 3w3TfXIN/CqXFv4y16nQ3l20ZdNZ+/MJvZW0X99D/WpUP1rJE2COVqLcF2xf39YgU5gF JLa9Ea7ND3PHBVYiqttYZ095/YooaGm+PmUvDuE9/7M39f6rqM5s5oU7GtolBt5i6tEB WmRa0u75Sl4tACHk5ftWKvMY67N4p/32zStDmmtCu2fOkVwbsNKLPlja0un4LGCcDMvF Cc3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717620734; x=1718225534; 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=x5DqSnKeWsYvEazcs2KZiewpru7ofXBIBVWU2Z9PCjs=; b=DabfBQ8AmS9887fKMJiZ038E2b3oNpS2h42g2NILe6vtva/3BDXMzdlxat3mTRgZAv wlT+okYaodD46UhJ+BB1Jtw76PeQrs2nXc4FD2Pk1FJpJYCwS0xqiOGfSZYGDK4GEYhR sCNzf0Enn4GduGUIYVP3iwj4isp2Na+6qYcTZVZOD2+YU1y0XavFMH9DzQm9pqgn40Mr DE3nL1/SsgK2zsB43KkbjKqGVCLOOD9aKcKPWTKM3NNYd4th0p1MFTLiMXiCmqxgWIFk ex37wW4sph36UPwsvyefpqstwwp5Q8+Ca+0mTnOgM0wqj8308AOm24YxhrSJVLgCtHR0 YgjA== X-Forwarded-Encrypted: i=1; AJvYcCUlTGhoxZpYlTp51N2U4Rh+9eyv2NhPs6i1OWXXd+fzEygrkdeHk1QGkF/uk4J6BBXUUZvWMawCf8LaqOgx5mBm8rSXcEnubp+dfCbaxbY9watwiStyTrtYkSrWx00616XwYgwev4Vsomk61cGrI2rMb+xfTxgpkbr1qW30F5DX3jj/FA== X-Gm-Message-State: AOJu0YyD8vPHbO1bwMqIf0aL+c/qbYHolx2M12qT2B2Duoc81ItOtI9n uqznUIznrCPrjfwEu6uQyh5rhPYdzY1vnkrvpOYZnsm4+f3PefA= X-Google-Smtp-Source: AGHT+IF+x4ragnpopQytYvP+V4rZUBOA1cYWVwClyFdv0u225FZrcMfyOsFfMVyB5JJ7IkfFk4MVtg== X-Received: by 2002:a17:906:368f:b0:a68:fbdb:728c with SMTP id a640c23a62f3a-a699f55f75emr196312666b.21.1717620734296; Wed, 05 Jun 2024 13:52:14 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c71bb5affsm72265866b.147.2024.06.05.13.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:52:14 -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 4/5] clk: rockchip: Add HCLK_SFC for RK3128 Date: Wed, 5 Jun 2024 22:52:02 +0200 Message-ID: <20240605205209.232005-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605205209.232005-1-knaerzche@gmail.com> References: <20240605205209.232005-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 --- 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 20:52:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 13687484 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 8F78415F3F0; Wed, 5 Jun 2024 20:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620738; cv=none; b=IJR+jI+rXZdZ0FOJpxTsdi1xUgwGntoih80RLUrwppAKswywCzmM0Mo+Fvghzqz0Rby2gqjroEsi3AgabT8CgLZPwhiZu4IsZskMrTVdC2dcbqJhgL1zePq8Mwfvaqf3c7UtQI/rg+ZdtD2fyU3KnCdtjkVwoMHj7RfKHR0FNDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717620738; c=relaxed/simple; bh=AQXObQDUzMQES1hvJtdiEAsAUh5MhWHJcqhhTYjm7jg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PJGbs/sB3JPM5KDwxL0taNgaTKO+UCzGxSUC3xE+tDDZLIZ5SmoENaQPpFKYju/VCa/oLUFEVjnDpvhz+RuApSmV8/LLIIh72B+WqTuhDPbGcCEZ+64wNDLjSSWRNNFhDV5Y/6sT4Oowh9a+bWST5YgQOW5Vb6lzA/HXQl1tXUg= 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=X55v9jYn; arc=none smtp.client-ip=209.85.218.46 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="X55v9jYn" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a68c5524086so27359966b.3; Wed, 05 Jun 2024 13:52:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717620735; x=1718225535; 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=nSnrzfQSI7FFWe4M7p38YadUmYRLzv+fLcrRvYhlfvQ=; b=X55v9jYn/U4VqqnvR31mAsZqOPeRe7nH2Yo2pc3VFZSEIZF27mZmYk9CVPsapKDwvY 2oODrOFGUUztNtnTN9FYxZF90CD7OwbK6aUAHQYVjY4OaFh4n1FJbDb9e+3ox0cKJaLU zHN4QqVUWDap/Y7OxuUytWGadJgN7+DV0Y9Xq8/GLIpYM8BFxxVzj1jgirwXm3XoR0ct 2tfh80YLQGcS36GvEcSqxM/kzXasQIGTXkJ/O1KX7y/beLlcIZE8dsLX8wUVEYbWkgch Y+vE4Z4PylQH/1Ca9gLQtuZpqPnFJnXJ80AbmWxbcNZP8pWq8pZgVQRpiQP02GnxXURM PdCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717620735; x=1718225535; 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=nSnrzfQSI7FFWe4M7p38YadUmYRLzv+fLcrRvYhlfvQ=; b=j4+cyIkB0qJ5V1LWHCAUIYxn96cPaqlAmwG7EvsmLTPJCYdHJHPtFDG5/TlK2a5M/e OfpXN0HVuUuQCtECjf7i7ebVncFdihunpiCf2YCWOFRiQT0aPHOZr3K19JyR700o0zNy J4Vb9Rnpcgv9ysTInXxWPGoc1AbWjpbVXAjYSRLir73ElX9vD82RUwRZ76xbO87YkfZf Nxh8pP3zHjSxCu9WoDud4Lp77WqT8JxT8/6Y4eQYVeauXgw5SqRdzcRcFSx8RUuOBxA6 Q4BCre2ZUF0ERPHWMRznayJP4x8kvvNXCKTAGcBiCCP2gU7Uv49HAtiBE1KporcEAgUm +rgA== X-Forwarded-Encrypted: i=1; AJvYcCWMejT+DpBjlNa82g5dOElWScKT+5Jdmr8pB8Tjuz02dW7/pGM91D94xrEgGy3zsSl7Vp7kP4PGYMB4ouhT2fch4lv+7/4ihFR2wBW/gxXqBDmPh11y1v8xIWQlO7KAdcc1WcC49CLYmlL3Wd0yNv9bv/R0vlnZwAJmSIdDkMjF3aUTng== X-Gm-Message-State: AOJu0YwPiyYcwckgIKx/JOpHX0J18X0TLHA4XxMtxeGM83p2OQ9Fzek2 embyirMU19zc0u8Z7pLshSaR6cQeERlTOAaYROf84Z2+pzRql/E= X-Google-Smtp-Source: AGHT+IG14C4lSL+BhQzWiuSl+VxUO7QhT+hrjfkE58eBpjAdO85Xvli+57deBqfwo6LwhRefFCQAIw== X-Received: by 2002:a17:906:ca57:b0:a68:eacd:2b38 with SMTP id a640c23a62f3a-a699f663ffdmr240503266b.23.1717620734864; Wed, 05 Jun 2024 13:52:14 -0700 (PDT) Received: from U4.lan ([2a02:810b:f40:4600:5211:58fe:dfef:c48c]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c71bb5affsm72265866b.147.2024.06.05.13.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 13:52:14 -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 5/5] ARM: dts: rockchip: Add SFC for RK3128 Date: Wed, 5 Jun 2024 22:52:03 +0200 Message-ID: <20240605205209.232005-5-knaerzche@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240605205209.232005-1-knaerzche@gmail.com> References: <20240605205209.232005-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 --- 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>;