From nobody Wed Oct 8 20:55:26 2025 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 5EC7E2E62A1; Tue, 24 Jun 2025 17:30:36 +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=1750786239; cv=none; b=ZKxxgK27X8Qf5UjvHzUR45EpFZzGQKZ5CwYGMYt/DyXY5VUr8mF+8zHUjKyLfZ7/f3vs8A44R7Mi0XOV1mpZ2hWhSBweM3seh20OHXxgcF7T8rxBeuAhYAyzMmtcSfET/qyoApGepITrLAHykxw8I91COeuVcSEFrIdFYN1FkaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786239; c=relaxed/simple; bh=vfsyxl/iq070xZAICG1am3E3oIVo4pRy60dTKlcOHqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BHfSTluvrQ7BjWvGSu+RRhR4pAlT8mr++Hb0uXiIV68VbAh6LgywDS4eA4CeGupAnE6OsAvqhd49IBBM0Bj+XPLTIuoQphT1g/1v5UJB3htWXQQMACS5nuegav5aMw595/uHmdny2xuNCBqzMRclScMFzEYXanjratlVQX2DTXU= 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=RCEl5YHw; 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="RCEl5YHw" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-450cf0120cdso44100615e9.2; Tue, 24 Jun 2025 10:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750786235; x=1751391035; 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=vq4PNRMs7F+DzgJ1q+7elDnyqvucjET7HDXl0iNWHq0=; b=RCEl5YHwNkkyrHRjmseycxfmqR1k1Q2ptuIrYFybymnaym5rUzX+AK1gZui1KeME7S 0OuvJzZAezuLHMzj6pE7aM1ERnfg7VciPUNCiZY6SJjguP7YYkFFxlEKCLv2IeQnNAWH IY89YBCqt3a9V1pkCYvv+7dn/IzbYqN8FSCAeX5QxorXx5ZsCKbbVmebN8hyhStW3G8n pcKMPBJKLiSL6+XoMXdBsfooSDDu5NoeOcKD8Eb3I7OgXpn5rS6Yu00O6379xaHzQgeA EZpPpxlcaRJlpngBL9ogbZ4wwlpG7Wx9hvkwUGpRoDLV7kO5jBIcUjLsGD+XE88LbFqi 7MgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750786235; x=1751391035; 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=vq4PNRMs7F+DzgJ1q+7elDnyqvucjET7HDXl0iNWHq0=; b=GBoWJxLmOFztVL6M3UWiht6f9/EFtd42FaavYBZt59BVF0kksnbFDHSES2tXFLSklO Zlcj4d2y+dn6oHQhZfGkR4+SZ0NXubySubzw6N9tnngnCRLyXggePbeTqZ2TlaWPKrSc vBnAGTiqSxdbPVJk/xgAfPglQN0oVQyanpeSmrKCEOVuzFIi0t3LDUVftwciZcNsGdeX h5nuR36HnQmYnp9iWQGVktOcij2ZE3NfkYe6haW0oweu8Q4YL7qcxF/YqsWPfXuss41e iHJSX7Jc/rt5K7JBe+5w1lgRLhK5+CGJ0fNUh54iC0UqXTVmrMQi6XkRjMQqaeracUud LM2A== X-Forwarded-Encrypted: i=1; AJvYcCUVC81b99c2GQy5Q1uPF3Cp6M4fFjvUbUvACtlt1XlR6JRlwOfBpQVK5G+M3KLWArJwgS5NB3Yvy+/v@vger.kernel.org, AJvYcCVHo/h9wj0g/IkUM9WZlPNf/+PGkbfIBFLhQej0fKnCm9S4OeJcmehp9jjebHHflfD0XwVWu5Hs8kiVyiow@vger.kernel.org, AJvYcCWtgnmuk+PBtTaVOHytKiK0o0XyRyRrazuRzO6wdWZwTEC/1FwTupMxMxoWnGuVlyVgbxkdjLs5oZ3/@vger.kernel.org X-Gm-Message-State: AOJu0YzLgdlfBaX6hzsjz2z48VdDb0Go8wzAuSzd00trZg9GGMU6nGGR DLdWDoUCcvJkhL5+cjipy5LGYcMuMRAnDwwYSNyf2uxCI5wTvaEtMuOY X-Gm-Gg: ASbGncvhEomQklzd4+nY2OXFBohidX3fejB5ghK9rxnrK9XO99IFtkA1NWLRt0x2GC4 NqqBk4q7gnxAh5vemfcmK834av/akEwx0u2iEJqhfbhzh7j2rP0ZyPNfn1CcOD8mbO20ifQnZjI bS5ORSS3rr5aUS/mtNZ3/5yWGDOPvSRMcLI4b9IOok6r3aaDpjdi3aScJA3h3iZdSBpYFBed5tA gruUl++BgLNMYy89QiE3dSgFm8CADnTxhwDNWkU0YDdDPvN7f0Jyy2nbTCF0pUIngnzAsP5hUYk Rt3rRzGt0n7SP2i41pkT1CaVGEDTdR9C/DhRnyMoUxmik3otaUjnNmsDWLAuno/uAIYbxdrsHLR T+A4+E9sZqoGg8fydZIAS X-Google-Smtp-Source: AGHT+IFch86Bwj3FpcBseDY2MN3vAtSRyWtMvVwN0WFKsbh478c1F1adbvCxkkH1adMYxF3X1H1A8g== X-Received: by 2002:a05:600c:c168:b0:43d:9f2:6274 with SMTP id 5b1f17b1804b1-4536c253eecmr128593605e9.14.1750786234450; Tue, 24 Jun 2025 10:30:34 -0700 (PDT) Received: from iku.example.org ([2a06:5906:61b:2d00:a522:16f6:ec97:d332]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ead202asm181662565e9.27.2025.06.24.10.30.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 10:30:33 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 1/6] dt-bindings: clock: renesas,r9a09g056/57-cpg: Add XSPI core clock Date: Tue, 24 Jun 2025 18:30:25 +0100 Message-ID: <20250624173030.472196-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add XSPI core clock definitions to the clock bindings for the Renesas R9A09G056 and R9A09G057 SoCs. These clocks IDs are used to support XSPI interface. Signed-off-by: Lad Prabhakar --- include/dt-bindings/clock/renesas,r9a09g056-cpg.h | 1 + include/dt-bindings/clock/renesas,r9a09g057-cpg.h | 1 + 2 files changed, 2 insertions(+) diff --git a/include/dt-bindings/clock/renesas,r9a09g056-cpg.h b/include/dt= -bindings/clock/renesas,r9a09g056-cpg.h index f4905b27f8d9..a9af5af9e3a1 100644 --- a/include/dt-bindings/clock/renesas,r9a09g056-cpg.h +++ b/include/dt-bindings/clock/renesas,r9a09g056-cpg.h @@ -20,5 +20,6 @@ #define R9A09G056_USB2_0_CLK_CORE0 9 #define R9A09G056_GBETH_0_CLK_PTP_REF_I 10 #define R9A09G056_GBETH_1_CLK_PTP_REF_I 11 +#define R9A09G056_SPI_CLK_SPI 12 =20 #endif /* __DT_BINDINGS_CLOCK_RENESAS_R9A09G056_CPG_H__ */ diff --git a/include/dt-bindings/clock/renesas,r9a09g057-cpg.h b/include/dt= -bindings/clock/renesas,r9a09g057-cpg.h index 884dbeb1e139..5346a898ab60 100644 --- a/include/dt-bindings/clock/renesas,r9a09g057-cpg.h +++ b/include/dt-bindings/clock/renesas,r9a09g057-cpg.h @@ -21,5 +21,6 @@ #define R9A09G057_USB2_0_CLK_CORE1 10 #define R9A09G057_GBETH_0_CLK_PTP_REF_I 11 #define R9A09G057_GBETH_1_CLK_PTP_REF_I 12 +#define R9A09G057_SPI_CLK_SPI 13 =20 #endif /* __DT_BINDINGS_CLOCK_RENESAS_R9A09G057_CPG_H__ */ --=20 2.49.0 From nobody Wed Oct 8 20:55:26 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 A5C3F2E62AD; Tue, 24 Jun 2025 17:30:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786239; cv=none; b=J8NA2G3eG3+1P+Y/xiqQG4fg5BMp910+AsUZRzzaGflnXEd+rb6EV10Lhm3vIZoyt6lAuQ2FPIVSyHLjo7X5aCA0+uKhcDOYVy1JKkWya5mwcTOtc3Pb/K9RJccqFB2UluTWFDC3H0etODGjbNTNPQhAX372+QWSRODka+zKgyY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786239; c=relaxed/simple; bh=EqMVIG1JOtHwWia9MJuvoy/KovUnFn37vw4qAziiz4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=awgm+QTBdIoydbw/0bksM69JJ6wduSyyzktFkSuzIBUJ9pVpeS2AgIzexY/LCwZbk8KyDeuTW8tHt8glvG04Bh3vLmt4NexUFyfli9wH7iDC/PuSLAqXqTMKJ5tlXrN/rEUieou1GU4hTn+HBE0MT+bXevkXIz2UQX2JYMV9Qh0= 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=dePwlZjD; arc=none smtp.client-ip=209.85.128.41 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="dePwlZjD" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-451e2f0d9c2so604705e9.1; Tue, 24 Jun 2025 10:30:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750786236; x=1751391036; 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=qqz+iNobaWbEhtWCmAaZZYdYmVmSQ8nu4QIVj4Qe7zQ=; b=dePwlZjDzVXmgDxLPzrcD+h+FoEXUn3fBSSeXClPlyyflI2R7I5+vOU8A0yoMyUZck WXOXqTm/DGbDMm+0sekDTipOYQQD6+UdDalHDFE/DUCzzCpPyzE2xSKBq4kJW1BLRKL9 U2Cz19ifD0OS9xjkLjo9R3tfPI/v4jL+ufc56Iy3eAozFcf8/po5j1UKTzSKVqNC5IQR mf9w+sNCZ5HQaM35o4lGm2MeyOPa8fqhv+EeEtVp27w5raAnPN/NscKRuplX2rOfDnfC H3HaWP6VnS//9/xKBofoAV7khaW0atOrHLe8P6/exUq5rdqDnlSG6p9+epLFmh2aCHTh oB0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750786236; x=1751391036; 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=qqz+iNobaWbEhtWCmAaZZYdYmVmSQ8nu4QIVj4Qe7zQ=; b=vW3zRLOcBf2BYbkFaTpkFSY2s4ZKFwsdjIWR8l840bFhi8jKm6OjOqh5PlC/TcYhHA jQntpjiZwR0w6KQrgPQa0Asgkj0+qv1TDs97EB1eqNE1TJSXC7dTA7kvfMVCbMmMXypf 8bowwWV+u4dUsf6J0gDK93eC0WxdLonBDSEPvsGvGD1obaW0odpuAB+UKsShfODMEaGf /E8kjBGzv9xRT9yL2rYZLZlnmw+6mHJmaISVhewyIkEiGOcHn0XOs9LdNzTipjo7p2qi idLks2WvMevtFmiEMGvhBA1l+2RnLfXQwiHnmMyYkjZjLe0ioX0WlsX0mHB1kWDz4vPE zpkg== X-Forwarded-Encrypted: i=1; AJvYcCVSi+ooRO9zfvRFmZUK+9VohXTp8pjWQ1LxSXMqZ3Nd9a6UoJRBc4QCnFSvrqfupIXAnhlsgK9B4EjnFZNM@vger.kernel.org, AJvYcCVtLp8wqSK8h3vuGzRT3lJ1tuHCTJBLA583PvvUZtE3EsptIr3UbhXDvekIjoBqkcVzoAG/rjzBeJCp@vger.kernel.org, AJvYcCXmvDDtiShLdTFxmF9b+twkbIs3h/s52+SXY7Qn+PKCSZAnrMJUyG8vRlgMaoCz/V6IDFti4PGSc+0x@vger.kernel.org X-Gm-Message-State: AOJu0YzUv60kU68GyVQ7gtsNwZYFkCfg0W812dHgiGJR4yrJrjGm1Uu4 iuk3hiuJqZytzKOxn8xAb+Oblemis6lYZ4Toculv5/ebt5QAYG2gEHU1 X-Gm-Gg: ASbGncu72DlBTHpU6jY4b8xjrGI3DPMTSJXLJsWg3oza6Bk8LQZ+1FhYOD/te4c7DSq A1qA44SgvSPfPkjq4YoXlep3RWfj6oV+NimirAtCcFRsnwxyC8K9OOC04JoSsoMSwP6MnglpHN7 7qvcTX/0uTlzQnhemfs82cDk0rJckN1XaNLXIMO+FllMiL89OCe+RFY687o1RxdzJ2a/gp0spqd NuWyAuoNUw8Ff2ZBaLPBn9sW1dU+6NtvuI1zyWdO5cf24nNP9sR2pS+ZRldTMtsxFl1yBIRteko rCBaLs3Ud0b2Tapey5zci50EKrEbsIgRrvlfPkSeIYoTsRKHOVow8iqh97WqQsPdmaLoXfK76pr fRjJ63DXy8utRrw7to4SQ X-Google-Smtp-Source: AGHT+IFqRfnkaDMljjTZKvzSN2yE18iPaQTZP9HNlSeLmYzZ/JnoVxD/fxNVWlcGycMmYOGnQ5N+yg== X-Received: by 2002:a05:600c:620b:b0:43b:c857:e9d7 with SMTP id 5b1f17b1804b1-4537c362937mr38278455e9.5.1750786235642; Tue, 24 Jun 2025 10:30:35 -0700 (PDT) Received: from iku.example.org ([2a06:5906:61b:2d00:a522:16f6:ec97:d332]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ead202asm181662565e9.27.2025.06.24.10.30.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 10:30:34 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 2/6] clk: renesas: r9a09g056: Add support for xspi mux and divider Date: Tue, 24 Jun 2025 18:30:26 +0100 Message-ID: <20250624173030.472196-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar The mux smux2_xspi_clk{0,1} used for selecting spi and spix2 clocks and pllcm33_xspi divider to select different clock rates. Add support for both. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/r9a09g056-cpg.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/clk/renesas/r9a09g056-cpg.c b/drivers/clk/renesas/r9a0= 9g056-cpg.c index e370ffb8c1e2..040acd4ae5dd 100644 --- a/drivers/clk/renesas/r9a09g056-cpg.c +++ b/drivers/clk/renesas/r9a09g056-cpg.c @@ -16,7 +16,7 @@ =20 enum clk_ids { /* Core Clock Outputs exported to DT */ - LAST_DT_CORE_CLK =3D R9A09G056_GBETH_1_CLK_PTP_REF_I, + LAST_DT_CORE_CLK =3D R9A09G056_SPI_CLK_SPI, =20 /* External Input Clocks */ CLK_AUDIO_EXTAL, @@ -32,7 +32,13 @@ enum clk_ids { CLK_PLLGPU, =20 /* Internal Core Clocks */ + CLK_PLLCM33_DIV3, + CLK_PLLCM33_DIV4, + CLK_PLLCM33_DIV5, CLK_PLLCM33_DIV16, + CLK_SMUX2_XSPI_CLK0, + CLK_SMUX2_XSPI_CLK1, + CLK_PLLCM33_XSPI, CLK_PLLCLN_DIV2, CLK_PLLCLN_DIV8, CLK_PLLCLN_DIV16, @@ -62,6 +68,14 @@ static const struct clk_div_table dtable_1_8[] =3D { {0, 0}, }; =20 +static const struct clk_div_table dtable_2_16[] =3D { + {0, 2}, + {1, 4}, + {2, 8}, + {3, 16}, + {0, 0}, +}; + static const struct clk_div_table dtable_2_64[] =3D { {0, 2}, {1, 4}, @@ -83,6 +97,8 @@ static const char * const smux2_gbe0_rxclk[] =3D { ".plle= th_gbe0", "et0_rxclk" }; static const char * const smux2_gbe0_txclk[] =3D { ".plleth_gbe0", "et0_tx= clk" }; static const char * const smux2_gbe1_rxclk[] =3D { ".plleth_gbe1", "et1_rx= clk" }; static const char * const smux2_gbe1_txclk[] =3D { ".plleth_gbe1", "et1_tx= clk" }; +static const char * const smux2_xspi_clk0[] =3D { ".pllcm33_div3", ".pllcm= 33_div4" }; +static const char * const smux2_xspi_clk1[] =3D { ".smux2_xspi_clk0", ".pl= lcm33_div5" }; =20 static const struct cpg_core_clk r9a09g056_core_clks[] __initconst =3D { /* External Clock Inputs */ @@ -99,7 +115,14 @@ static const struct cpg_core_clk r9a09g056_core_clks[] = __initconst =3D { DEF_PLL(".pllgpu", CLK_PLLGPU, CLK_QEXTAL, PLLGPU), =20 /* Internal Core Clocks */ + DEF_FIXED(".pllcm33_div3", CLK_PLLCM33_DIV3, CLK_PLLCM33, 1, 3), + DEF_FIXED(".pllcm33_div4", CLK_PLLCM33_DIV4, CLK_PLLCM33, 1, 4), + DEF_FIXED(".pllcm33_div5", CLK_PLLCM33_DIV5, CLK_PLLCM33, 1, 5), DEF_FIXED(".pllcm33_div16", CLK_PLLCM33_DIV16, CLK_PLLCM33, 1, 16), + DEF_SMUX(".smux2_xspi_clk0", CLK_SMUX2_XSPI_CLK0, SSEL1_SELCTL2, smux2_xs= pi_clk0), + DEF_SMUX(".smux2_xspi_clk1", CLK_SMUX2_XSPI_CLK1, SSEL1_SELCTL3, smux2_xs= pi_clk1), + DEF_CSDIV(".pllcm33_xspi", CLK_PLLCM33_XSPI, CLK_SMUX2_XSPI_CLK1, CSDIV0_= DIVCTL3, + dtable_2_16), =20 DEF_FIXED(".pllcln_div2", CLK_PLLCLN_DIV2, CLK_PLLCLN, 1, 2), DEF_FIXED(".pllcln_div8", CLK_PLLCLN_DIV8, CLK_PLLCLN, 1, 8), --=20 2.49.0 From nobody Wed Oct 8 20:55:26 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 22BF32E174A; Tue, 24 Jun 2025 17:30:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786240; cv=none; b=VZYhf90IA21LRwRY4kiG5P/lyb2NP/yBkI4tShWUhzoV3czKLqIJhEAymSScRbP51VjOuWMy3KTpJEDGG75Z3JPEiQTaIYbMcJoJU86fVnSdL/TIIzDZq5zKxvIfvT3ZCef2CX+Ya3ZOjZDYG2Wk4VtHwKCG18nfl/7/h6CO6H8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786240; c=relaxed/simple; bh=l/vVJyND3aoVunSgh11DPC7260RGdTfh3kb4Ckw8MUw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RjQpTbpLCdl/GZ76l7Hg4WcLYOZar+83R9ivzdNnnuq3reJYUyNzUwUSOF1OcSagC242uv/YZYrhxEPw6ZtsZEeBECo3uLKRx0ApkBUNSi69vBYxiuF8taAzQ+xcVy+HC7cid7W40SfYgk6s5cz4uIendDGyYOp/Zo0dbCfmsBQ= 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=f7IOj3hD; arc=none smtp.client-ip=209.85.128.41 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="f7IOj3hD" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4536b8c183cso623735e9.0; Tue, 24 Jun 2025 10:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750786237; x=1751391037; 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=luq8LQ/Sk4swSZCdRuUf69fldpW53iaSlHmnWlANK1w=; b=f7IOj3hDk6yx8azDtTrchYTu7QkslDoPCjmRpUOS2OVNayQ/ijyeNpmvXnMLJKpbOw EwcLL8oRfp9h81asXMiBralEmCIkVttO1PBR0DWCkMd/aBEIvqf/G3FcKQO9WOLaCwsT JAqdnpFCTZEXJkNUmF1fFZgtyL7i5c5PDN78GGA1lQLK1RM/14SYKqzufRknT1VweqxV xZV05B7gpoVTsb1zwjD8eOIKsimgsaMeH1TiB2zMTLR9l32m8v4ay2F1SkP3OaLYcqEX 9d3epwk2dP1L6DVANQ3ZXnyeit6KHEq1ya5DPGoPPczSDK0Lin7tUz97AD7VqkVrecnO DhJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750786237; x=1751391037; 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=luq8LQ/Sk4swSZCdRuUf69fldpW53iaSlHmnWlANK1w=; b=nduKTkUmi6TeTwmzYbd/5R72JUydtplcAn65skiqqopfHDg0deBMV7KhyJ5ZOB4Z6J b6z1Cl4Nd1xOJaulf6S/+MdHfLcXcVoT2SFoZMgyBxnoT8RVXXYoVpWrDgNbSrCfPfFD JLJ3ELL1zRAJFwradLT6XNyPu0Ch54VqHtTqyjjBfTFk6iI4C4dUS6OTk2QoZ43U5yfD SOaa5FB3jrib44miWqj1SsMSXhgTnvVUp3KHYYu+AOepSXWBTZGzgtGiGWgEVFyWwVaM oVHU0x3c8/SVg4SWNgbbD5eq9X96d7+G3QUL9YbiHOO7NaE+8M/Ay2KgwGczwxsLM9pN BryA== X-Forwarded-Encrypted: i=1; AJvYcCV1twckTMqn2EHHrYro+JSptYpaULWZlv/h2UVcn22FW+ksiupIOfbKIT0GVUwIMHVec15gBaTiNcH9@vger.kernel.org, AJvYcCViEUGPoC19NImbXN0hKdGUUixZi+Q4N4WnVZpCSw2AvixKxux4BNBII6ems53+VcH3bEuj0iDyfR1m@vger.kernel.org, AJvYcCXpgMVq72uYChnpgkKiJ3czP16oWvX7ESa7M6PBYdQrulhnJOY7XRW1NN5IHZwsu5r8dxX+WH/5vdVKqZIh@vger.kernel.org X-Gm-Message-State: AOJu0YyHKxKkLYnZTOgy7yb0X4ijiD4bN/+DVzu3u7EI/B9DE5puVbxY g1VNGmASZLhIKdtry/WvthcT1S21U0YaWEmqApHTvx8SLKIHEGJpCk26 X-Gm-Gg: ASbGnctpDos2awclhvkMTb14kC4FOVgWiPeCji4drKhlnwdYpHlHVIjIBooVm68fosa QKLWwkWUI7+AWSh9sSnIl4aVYBI+9EKz5diac2RHDZzoXVdscwsZzqezdcHSJ5X5b1tW5NzEDA6 dROmrayokuZ6nuN7mTBVn6TBSliDuFzoLA3vxzRmmUIsAjzb9fjZxMFT8TJW4b9ZdlTyHyrFqiO 52moEwrfJ2bW+nacIfOlC1353Y1dJEHoIR/6uoMsRzm9zXh5ykqLf5qQDaozaKQi7VSi+kzPb+T 9SIq/Rw7vHMhO9gbUCEz9DD7+2QxCiOeE/WLTU+RbmHrzw8/faQ0dKlek286GV0HrYkRb5KMuBg hXGRa7wFevhWaPuvC4Wcr X-Google-Smtp-Source: AGHT+IFCCLW/JiGEeOvp8jfgqeOZBKEfYo5R3b0PNhVie8ASPNtfyEuDUx6mcxIaAYS4BtU3Tn2XQg== X-Received: by 2002:a05:600c:46c6:b0:451:df07:d8e0 with SMTP id 5b1f17b1804b1-4537b77f48bmr45295675e9.11.1750786236901; Tue, 24 Jun 2025 10:30:36 -0700 (PDT) Received: from iku.example.org ([2a06:5906:61b:2d00:a522:16f6:ec97:d332]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ead202asm181662565e9.27.2025.06.24.10.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 10:30:36 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 3/6] clk: renesas: r9a09g057: Add support for xspi mux and divider Date: Tue, 24 Jun 2025 18:30:27 +0100 Message-ID: <20250624173030.472196-4-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar The mux smux2_xspi_clk{0,1} used for selecting spi and spix2 clocks and pllcm33_xspi divider to select different clock rates. Add support for both. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/r9a09g057-cpg.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a0= 9g057-cpg.c index da908e820950..39065d63df61 100644 --- a/drivers/clk/renesas/r9a09g057-cpg.c +++ b/drivers/clk/renesas/r9a09g057-cpg.c @@ -16,7 +16,7 @@ =20 enum clk_ids { /* Core Clock Outputs exported to DT */ - LAST_DT_CORE_CLK =3D R9A09G057_GBETH_1_CLK_PTP_REF_I, + LAST_DT_CORE_CLK =3D R9A09G057_SPI_CLK_SPI, =20 /* External Input Clocks */ CLK_AUDIO_EXTAL, @@ -33,9 +33,14 @@ enum clk_ids { CLK_PLLGPU, =20 /* Internal Core Clocks */ + CLK_PLLCM33_DIV3, CLK_PLLCM33_DIV4, + CLK_PLLCM33_DIV5, CLK_PLLCM33_DIV4_PLLCM33, CLK_PLLCM33_DIV16, + CLK_SMUX2_XSPI_CLK0, + CLK_SMUX2_XSPI_CLK1, + CLK_PLLCM33_XSPI, CLK_PLLCLN_DIV2, CLK_PLLCLN_DIV8, CLK_PLLCLN_DIV16, @@ -78,6 +83,14 @@ static const struct clk_div_table dtable_2_4[] =3D { {0, 0}, }; =20 +static const struct clk_div_table dtable_2_16[] =3D { + {0, 2}, + {1, 4}, + {2, 8}, + {3, 16}, + {0, 0}, +}; + static const struct clk_div_table dtable_2_64[] =3D { {0, 2}, {1, 4}, @@ -99,6 +112,8 @@ static const char * const smux2_gbe0_rxclk[] =3D { ".pll= eth_gbe0", "et0_rxclk" }; static const char * const smux2_gbe0_txclk[] =3D { ".plleth_gbe0", "et0_tx= clk" }; static const char * const smux2_gbe1_rxclk[] =3D { ".plleth_gbe1", "et1_rx= clk" }; static const char * const smux2_gbe1_txclk[] =3D { ".plleth_gbe1", "et1_tx= clk" }; +static const char * const smux2_xspi_clk0[] =3D { ".pllcm33_div3", ".pllcm= 33_div4" }; +static const char * const smux2_xspi_clk1[] =3D { ".smux2_xspi_clk0", ".pl= lcm33_div5" }; =20 static const struct cpg_core_clk r9a09g057_core_clks[] __initconst =3D { /* External Clock Inputs */ @@ -116,10 +131,16 @@ static const struct cpg_core_clk r9a09g057_core_clks[= ] __initconst =3D { DEF_PLL(".pllgpu", CLK_PLLGPU, CLK_QEXTAL, PLLGPU), =20 /* Internal Core Clocks */ + DEF_FIXED(".pllcm33_div3", CLK_PLLCM33_DIV3, CLK_PLLCM33, 1, 3), DEF_FIXED(".pllcm33_div4", CLK_PLLCM33_DIV4, CLK_PLLCM33, 1, 4), + DEF_FIXED(".pllcm33_div5", CLK_PLLCM33_DIV5, CLK_PLLCM33, 1, 5), DEF_DDIV(".pllcm33_div4_pllcm33", CLK_PLLCM33_DIV4_PLLCM33, CLK_PLLCM33_DIV4, CDDIV0_DIVCTL1, dtable_2_64), DEF_FIXED(".pllcm33_div16", CLK_PLLCM33_DIV16, CLK_PLLCM33, 1, 16), + DEF_SMUX(".smux2_xspi_clk0", CLK_SMUX2_XSPI_CLK0, SSEL1_SELCTL2, smux2_xs= pi_clk0), + DEF_SMUX(".smux2_xspi_clk1", CLK_SMUX2_XSPI_CLK1, SSEL1_SELCTL3, smux2_xs= pi_clk1), + DEF_CSDIV(".pllcm33_xspi", CLK_PLLCM33_XSPI, CLK_SMUX2_XSPI_CLK1, CSDIV0_= DIVCTL3, + dtable_2_16), =20 DEF_FIXED(".pllcln_div2", CLK_PLLCLN_DIV2, CLK_PLLCLN, 1, 2), DEF_FIXED(".pllcln_div8", CLK_PLLCLN_DIV8, CLK_PLLCLN, 1, 8), --=20 2.49.0 From nobody Wed Oct 8 20:55:26 2025 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 3B0252E6D21; Tue, 24 Jun 2025 17:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786242; cv=none; b=gh2Whkw6eChxy4yXusSwFXJKVXv2s07B8tzoBlZB0jHtkmypaM+En8tdRz3qDs8QhhC4B7bJt6xSinO32R+XWfJJQiZ/blb8IAWySKPjCYgmVAJTWLxIhvhPFXJLb0lvdyAiaAoeEHljfTfYJKWdk2R547YOBQlV4I9c9NJAAcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786242; c=relaxed/simple; bh=UEBUHE/DGAWtL9IV45PYPMN/r9yDe3zXWs2F8mUIL/g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cWwygn2MMEEhhp1M+dae1LFKYhJ3QvbyXCvRRIQ8kGAjOERcQhNAOBRs89Tb6k0fBLGLHk5uYs8UiAs5tLgo1KeqpFxj0mJl3yVCFasYuhu3hzTCfwcxIlegmKSI+kL7WORzgPJ/7jX+rDu8U4Z78pbmODDvY61w2uhCtJOF7IE= 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=WKJlM+WG; arc=none smtp.client-ip=209.85.128.51 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="WKJlM+WG" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4535fbe0299so31510315e9.3; Tue, 24 Jun 2025 10:30:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750786238; x=1751391038; 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=Q6NKGC362pA3i/BAGWUyJ6Alui9mWvc3wem6CesrlFQ=; b=WKJlM+WGOFcsApt9o9jbTj3uOTA+5tV5UFUreFrYAnHscmCTe4k6Fgszxlug+TEBYk DlP8VO6lfqsR1zUcAZ4MVdVrzqejaBrGqSYXuVCFIAoxKEN/e/FXhRUfXDT+GFklSg9O xLaM9tYiun8KYqkOcvYyhunKjiVzk2aP9Ig86R0grluF98GUcYP4GyiwwPMVdmwM80s+ HW/GHw5ozjSP6YZydKhok1HILxCdooJ2ToDXaQJ07KO6kZyQORcQ5M51YpSaql6/N8Vk 4a1Stz+woYgo6+FFStsJcEWzAdUz+2OkzthD+o2T1jVOooifhhs8N2yIqAcSt4ncu6+1 Da1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750786238; x=1751391038; 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=Q6NKGC362pA3i/BAGWUyJ6Alui9mWvc3wem6CesrlFQ=; b=nFjVyGkRQJo9uWg1pVZb4ca8TJ0ObuggBKueLTt6+D/gWKc0lSxgx+2YAkMSu2NPUN bVkOmDUf3jTDoFTIsdSR2J7f5HIwlRpobJJ/FIjw0E5vcZJ2av4rtALOc07j4wvhbPKp ueeY1muuInkntK+X2XYlpA+aY5umTvCzNMLpwPV0falLJlc7NwKsAp6qurJARSSIRuS4 ojmxoLALeF858kGfugzU02xU7k+5hg32cAhNnwDdsrsgArD8cVYmWI910UVnXk3UeZ1o 0OCTipjorzQ6L583runB3U48yrtTSIhYnY+yp4t7E8p5CnPhoPk7ElRaP9VzTh9678WF pfwg== X-Forwarded-Encrypted: i=1; AJvYcCW4IxaXs7IRbz0vUea1Zf11Ln3CY25+GkDCG4yLSSpoddulMQAXolX1aZHTbNohRStQqNpFRsQIPK82biIi@vger.kernel.org, AJvYcCWZ2Tl8Cy/0RK/5oUAgyOBlXascC8qQPV1r0x1efPzZliZpIRgOYsBwffqLX13IDJOjY/I0Jqk/1EAu@vger.kernel.org, AJvYcCXtI9FpsYywxssLRtTrxx0y8RKzKH+cig4qn4uO31okAkh7QyKrJ2Ygk60uLicHDrPYofiZ6p6dZqf7@vger.kernel.org X-Gm-Message-State: AOJu0YzF8Dwt5jKvxCie802oU56c2QbcARHCR43jU7pUUMGUXJoYK8yS HcquAw1fHE84Woar8YbAZojPAuvGbroa/kcFgRJV7uptomdR6WGoGmsL X-Gm-Gg: ASbGncuqu3jLtV6PqStJhFpPEyDsXP6pNbgjkGqoHG3QxC6970yTmBGffMVEpLOYa24 AsVCtZyBV8wCAJRIISH3tHVanXfK45FEbcdmvHlID7jmA5n/97Egfrip1v7Al5OcDnU5tZxNxH3 PMloXB7x2k6MSi3vjNCNslhIzgB995W7owNCPWynbo7nRMtsVlqOMr10dg4kY5RU9LcnVUBLgHe r+ppgWCMQyw2b+BlhpEvJWFxrb0WeJl77y6MCivRWnkyb18b086sdtyrjCPyPbAZ+3RrJqljk5X 2K4cXEOE8KJG2jSHUyM/xRv6idpqxRKn5nTsC3I2IBa/Vfptiisje35TizK74QVy4dNQrn7fDer 9hbep5CqCjS+5QUFj8NZ3 X-Google-Smtp-Source: AGHT+IEZ/iq8mHAW3TThdNzJowXX4LkR1NhhS85+vFyjwutfDxXJrUG8HVF+xw0IGv4e1GfTU+IEag== X-Received: by 2002:a05:600c:6211:b0:453:5a04:b60e with SMTP id 5b1f17b1804b1-453659f5828mr141529555e9.26.1750786238246; Tue, 24 Jun 2025 10:30:38 -0700 (PDT) Received: from iku.example.org ([2a06:5906:61b:2d00:a522:16f6:ec97:d332]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ead202asm181662565e9.27.2025.06.24.10.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 10:30:37 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 4/6] clk: renesas: rzv2h: Add fixed-factor module clocks with status reporting Date: Tue, 24 Jun 2025 18:30:28 +0100 Message-ID: <20250624173030.472196-5-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add support for fixed-factor module clocks that can report their enable status through the module status monitor. Introduce a new clock type, CLK_TYPE_FF_MOD_STATUS, and define the associated structure, rzv2h_ff_mod_status_clk, to manage these clocks. Implement the .is_enabled callback by reading the module status register using monitor index and bit definitions. Provide a helper macro, DEF_FIXED_MOD_STATUS, to simplify the definition of such clocks. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/rzv2h-cpg.c | 83 +++++++++++++++++++++++++++++++++ drivers/clk/renesas/rzv2h-cpg.h | 22 +++++++++ 2 files changed, 105 insertions(+) diff --git a/drivers/clk/renesas/rzv2h-cpg.c b/drivers/clk/renesas/rzv2h-cp= g.c index 11325980379a..a511f34abf18 100644 --- a/drivers/clk/renesas/rzv2h-cpg.c +++ b/drivers/clk/renesas/rzv2h-cpg.c @@ -150,6 +150,22 @@ struct ddiv_clk { =20 #define to_ddiv_clock(_div) container_of(_div, struct ddiv_clk, div) =20 +/** + * struct rzv2h_ff_mod_status_clk - Fixed Factor Module Status Clock + * + * @priv: CPG private data + * @conf: fixed mod configuration + * @fix: fixed factor clock + */ +struct rzv2h_ff_mod_status_clk { + struct rzv2h_cpg_priv *priv; + struct fixed_mod_conf conf; + struct clk_fixed_factor fix; +}; + +#define to_rzv2h_ff_mod_status_clk(_hw) \ + container_of(_hw, struct rzv2h_ff_mod_status_clk, fix.hw) + static int rzv2h_cpg_pll_clk_is_enabled(struct clk_hw *hw) { struct pll_clk *pll_clk =3D to_pll(hw); @@ -421,6 +437,70 @@ rzv2h_cpg_mux_clk_register(const struct cpg_core_clk *= core, return clk_hw->clk; } =20 +static int +rzv2h_clk_ff_mod_status_is_enabled(struct clk_hw *hw) +{ + struct rzv2h_ff_mod_status_clk *fix =3D to_rzv2h_ff_mod_status_clk(hw); + struct rzv2h_cpg_priv *priv =3D fix->priv; + u32 offset =3D GET_CLK_MON_OFFSET(fix->conf.mon_index); + u32 bitmask =3D BIT(fix->conf.mon_bit); + u32 val; + + val =3D readl(priv->base + offset); + return !!(val & bitmask); +} + +static struct clk_ops rzv2h_clk_ff_mod_status_ops; + +static struct clk * __init +rzv2h_cpg_fixed_mod_status_clk_register(const struct cpg_core_clk *core, + struct rzv2h_cpg_priv *priv) +{ + struct rzv2h_ff_mod_status_clk *clk_hw_data; + struct clk_init_data init =3D { }; + struct clk_fixed_factor *fix; + const struct clk *parent; + const char *parent_name; + int ret; + + WARN_DEBUG(core->parent >=3D priv->num_core_clks); + parent =3D priv->clks[core->parent]; + if (IS_ERR(parent)) + return ERR_CAST(parent); + + parent_name =3D __clk_get_name(parent); + parent =3D priv->clks[core->parent]; + if (IS_ERR(parent)) + return ERR_CAST(parent); + + clk_hw_data =3D devm_kzalloc(priv->dev, sizeof(*clk_hw_data), GFP_KERNEL); + if (!clk_hw_data) + return ERR_PTR(-ENOMEM); + + clk_hw_data->priv =3D priv; + clk_hw_data->conf =3D core->cfg.fixed_mod; + + rzv2h_clk_ff_mod_status_ops =3D clk_fixed_factor_ops; + rzv2h_clk_ff_mod_status_ops.is_enabled =3D rzv2h_clk_ff_mod_status_is_ena= bled; + + init.name =3D core->name; + init.ops =3D &rzv2h_clk_ff_mod_status_ops; + init.flags =3D CLK_SET_RATE_PARENT; + init.parent_names =3D &parent_name; + init.num_parents =3D 1; + + fix =3D &clk_hw_data->fix; + fix->hw.init =3D &init; + fix->mult =3D core->mult; + fix->div =3D core->div; + + ret =3D devm_clk_hw_register(priv->dev, &clk_hw_data->fix.hw); + if (ret) + return ERR_PTR(ret); + + return clk_hw_data->fix.hw.clk; +} + static struct clk *rzv2h_cpg_clk_src_twocell_get(struct of_phandle_args *clkspec, void *data) @@ -499,6 +579,9 @@ rzv2h_cpg_register_core_clk(const struct cpg_core_clk *= core, else clk =3D clk_hw->clk; break; + case CLK_TYPE_FF_MOD_STATUS: + clk =3D rzv2h_cpg_fixed_mod_status_clk_register(core, priv); + break; case CLK_TYPE_PLL: clk =3D rzv2h_cpg_pll_clk_register(core, priv, &rzv2h_cpg_pll_ops); break; diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cp= g.h index 7321b085f937..317c8ee2e2d5 100644 --- a/drivers/clk/renesas/rzv2h-cpg.h +++ b/drivers/clk/renesas/rzv2h-cpg.h @@ -93,6 +93,23 @@ struct smuxed { .width =3D (_width), \ }) =20 +/** + * struct fixed_mod_conf - Structure for fixed module configuration + * + * @mon_index: monitor index + * @mon_bit: monitor bit + */ +struct fixed_mod_conf { + u8 mon_index; + u8 mon_bit; +}; + +#define FIXED_MOD_CONF_PACK(_index, _bit) \ + ((struct fixed_mod_conf){ \ + .mon_index =3D (_index), \ + .mon_bit =3D (_bit), \ + }) + #define CPG_SSEL0 (0x300) #define CPG_SSEL1 (0x304) #define CPG_CDDIV0 (0x400) @@ -151,6 +168,7 @@ struct cpg_core_clk { struct ddiv ddiv; struct pll pll; struct smuxed smux; + struct fixed_mod_conf fixed_mod; } cfg; const struct clk_div_table *dtable; const char * const *parent_names; @@ -163,6 +181,7 @@ enum clk_types { /* Generic */ CLK_TYPE_IN, /* External Clock Input */ CLK_TYPE_FF, /* Fixed Factor Clock */ + CLK_TYPE_FF_MOD_STATUS, /* Fixed Factor Clock which can report the status= of module clock */ CLK_TYPE_PLL, CLK_TYPE_DDIV, /* Dynamic Switching Divider */ CLK_TYPE_SMUX, /* Static Mux */ @@ -178,6 +197,9 @@ enum clk_types { DEF_TYPE(_name, _id, CLK_TYPE_IN) #define DEF_FIXED(_name, _id, _parent, _mult, _div) \ DEF_BASE(_name, _id, CLK_TYPE_FF, _parent, .div =3D _div, .mult =3D _mult) +#define DEF_FIXED_MOD_STATUS(_name, _id, _parent, _mult, _div, _gate) \ + DEF_BASE(_name, _id, CLK_TYPE_FF_MOD_STATUS, _parent, .div =3D _div, \ + .mult =3D _mult, .cfg.fixed_mod =3D _gate) #define DEF_DDIV(_name, _id, _parent, _ddiv_packed, _dtable) \ DEF_TYPE(_name, _id, CLK_TYPE_DDIV, \ .cfg.ddiv =3D _ddiv_packed, \ --=20 2.49.0 From nobody Wed Oct 8 20:55:26 2025 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 68C962E762C; Tue, 24 Jun 2025 17:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786243; cv=none; b=Wo5HMHPfl2o1ZRus4q8Fj+eMMjvqOiM3t9yDccgIFHPCQeRHJk1921ZYkiam4YHQT+xgGK+Q02c8oMTka2q06EQLTLPGX7DlnbEJ8Y9D56TooRPBBWVRgh8n+fEUnTffQjEjPXnIlAv+/o3EfAHdgBzpRN+Fx+72ajFY4H2YNRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786243; c=relaxed/simple; bh=pauJs4BU7uWbM9MMX8vR+VYB5wfokBF6mkOLCILpzdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NuGdMeofgkTsQ5wrQXbxOVkH0oWsURZZQTlutL/0dfjeGqx5RsVgjrG4dPYJQ3qeanbCrxs7KzXMH2i5jbxhL6pRn/AaDqnd7XLdrDSLwnmLd2RwaT50MVce6gPREBueW9O8DKVU4XKwRoAuThxerfjzOg3akXfuGIqUz5V5/FU= 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=T48Z5IEc; arc=none smtp.client-ip=209.85.221.41 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="T48Z5IEc" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3a525eee2e3so586565f8f.2; Tue, 24 Jun 2025 10:30:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750786240; x=1751391040; 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=FwhSlWerG+8T4+prUat9IsNl8NdxT3TFxF7x4Oqs4qM=; b=T48Z5IEcqicB3AYjOWAerTA2wh2QwhZ44CKZGLkM/ATRltU5NYAejmJZ/1VsjsMR3S syXzLnTN+loD4yq0h0eOGPWscmHt72grcb5TR5W33/5ejBhWk/9MhstFaHz/qEn8LZWu N+kjW1eItC1azKAMMGstQCdShGNG25BzlHQjOiCD2IyyHK1IayBDf05nR2+/360p6Tat 9l5ef5/VUGRT7z7H2FQUJ7exd00t78i0yLlhcavXGe1n34BSkpeC6gG0R3/XGsiRiX7Q 8U32tv4Ul+vAP9LJrGJ/as1jZRye0fJeJF7sqYPNMwakEJnTBShIOEPXK2Hoc6PaXNI0 MTDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750786240; x=1751391040; 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=FwhSlWerG+8T4+prUat9IsNl8NdxT3TFxF7x4Oqs4qM=; b=l9exQRfyd14dSIWcaynF11NWUbuLbPvvO70xptzd/Lp95Hcr7Kb7Z3hDJDdtEF9WCx b7ELBIFveCAJqTNTTsumo5/MQv67QVw+IWyRY2jTgqzbI1UA5384EDjMlSOUyiT+EV0z /sH+26dmysMfrMwyNP2K4yENLe9exAQS30ybO/wx4NEqwwZcJNIxw9BY/5M75NxwVdW/ X6l2Wg9RUcc2MxOoInnOwkrshhsMXj1PpA6ViIOZG2/9PIUnOiuLs/Pu7006W/vAwsrQ VzVCy1RriNBBK07jY/3AX92w59uc3pGF+CAOHTirWqOckasWGKtDIQW0e6uHNjeDzN0l Qsdw== X-Forwarded-Encrypted: i=1; AJvYcCUczo6Gk7B6bqiNnPad+vVTS7OnRvMt4HMFqOvHPA7grcF6aDWibyJ5NsuuN8d0O5NQzxrYXfzfhVfC@vger.kernel.org, AJvYcCVOSw3BtW11ttf0c8dhPd3PSl+oUqJPi0qhhcxGwWbLewoYa+XSELn+O0HKzoyxf0razJmNq7E8N+O4r3C8@vger.kernel.org, AJvYcCXfZezIsCYd2zTsBHhUNMQgD8UUsukmYSrNKvR+OVupLsfBkX9yq8BQJelqGBh+nWuGfqP/zlrypfTS@vger.kernel.org X-Gm-Message-State: AOJu0YyiROD9EmAUu+cUasam9Jv2dRdX/cdvw42YFvH4Rm0ID19emPOD M+bVBvRmojkSkI+O5SrtRA/In6Zor0EDiWlN4TFzdDQSLyTmOPb1R+eq X-Gm-Gg: ASbGncsQ0ffFGwSW59KZX72HTREb7WeELl7NgD5xWdZexeo7T5bfbFRNrXO2/+2oSu6 vq1WD/X1R5xzRfqgM+flx5NWQzqCKoqejj2pzAa5ulqFALf3O83WQpKrU4IDBKnERqZDWb7aGy9 aBBhqicrc4AtQRT/q71PX66r86balAU4JoYTGN8MV3PSPegInoSqpv2m9m+ptYscrSwBrQVnMYO TmK0HXGjQclF/BlF79NYMzac/TuxbruktX4YWwGu9dlIR7Dz7FWeuPgGGrYIjFpP8Y37f1KmKJF MVTvUGKZX/Yx2HVJ1hjvJHnNwtlxmQ8OCpTO7KQYlW6P+0IXtRcMNuJIzuHhXsU3MnvMoBBdt8T Oj+YWEBg89b08XwE0kmOe X-Google-Smtp-Source: AGHT+IFci8RguuhhZRjRHIGlONaqNWhKtwS2A9YaHlkYOKp2HzfYZa1M3jCzpgBvldqyWLc4YmRHWA== X-Received: by 2002:a05:6000:2409:b0:3a4:dfc2:b9e1 with SMTP id ffacd0b85a97d-3a6d1192b3fmr15315984f8f.2.1750786239475; Tue, 24 Jun 2025 10:30:39 -0700 (PDT) Received: from iku.example.org ([2a06:5906:61b:2d00:a522:16f6:ec97:d332]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ead202asm181662565e9.27.2025.06.24.10.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 10:30:38 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 5/6] clk: renesas: r9a09g056: Add XSPI clock/reset Date: Tue, 24 Jun 2025 18:30:29 +0100 Message-ID: <20250624173030.472196-6-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add XSPI clock and reset entries. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/r9a09g056-cpg.c | 12 ++++++++++++ drivers/clk/renesas/rzv2h-cpg.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/clk/renesas/r9a09g056-cpg.c b/drivers/clk/renesas/r9a0= 9g056-cpg.c index 040acd4ae5dd..437af86f49dd 100644 --- a/drivers/clk/renesas/r9a09g056-cpg.c +++ b/drivers/clk/renesas/r9a09g056-cpg.c @@ -39,6 +39,7 @@ enum clk_ids { CLK_SMUX2_XSPI_CLK0, CLK_SMUX2_XSPI_CLK1, CLK_PLLCM33_XSPI, + CLK_PLLCM33_GEAR, CLK_PLLCLN_DIV2, CLK_PLLCLN_DIV8, CLK_PLLCLN_DIV16, @@ -123,6 +124,7 @@ static const struct cpg_core_clk r9a09g056_core_clks[] = __initconst =3D { DEF_SMUX(".smux2_xspi_clk1", CLK_SMUX2_XSPI_CLK1, SSEL1_SELCTL3, smux2_xs= pi_clk1), DEF_CSDIV(".pllcm33_xspi", CLK_PLLCM33_XSPI, CLK_SMUX2_XSPI_CLK1, CSDIV0_= DIVCTL3, dtable_2_16), + DEF_DDIV(".pllcm33_gear", CLK_PLLCM33_GEAR, CLK_PLLCM33_DIV4, CDDIV0_DIVC= TL1, dtable_2_64), =20 DEF_FIXED(".pllcln_div2", CLK_PLLCLN_DIV2, CLK_PLLCLN, 1, 2), DEF_FIXED(".pllcln_div8", CLK_PLLCLN_DIV8, CLK_PLLCLN, 1, 8), @@ -162,6 +164,8 @@ static const struct cpg_core_clk r9a09g056_core_clks[] = __initconst =3D { CLK_PLLETH_DIV_125_FIX, 1, 1), DEF_FIXED("gbeth_1_clk_ptp_ref_i", R9A09G056_GBETH_1_CLK_PTP_REF_I, CLK_PLLETH_DIV_125_FIX, 1, 1), + DEF_FIXED_MOD_STATUS("spi_clk_spi", R9A09G056_SPI_CLK_SPI, CLK_PLLCM33_XS= PI, 1, 2, + FIXED_MOD_CONF_XSPI), }; =20 static const struct rzv2h_mod_clk r9a09g056_mod_clks[] __initconst =3D { @@ -219,6 +223,12 @@ static const struct rzv2h_mod_clk r9a09g056_mod_clks[]= __initconst =3D { BUS_MSTOP(1, BIT(7))), DEF_MOD("riic_7_ckm", CLK_PLLCLN_DIV16, 9, 11, 4, 27, BUS_MSTOP(1, BIT(8))), + DEF_MOD("spi_hclk", CLK_PLLCM33_GEAR, 9, 15, 4, 31, + BUS_MSTOP(4, BIT(5))), + DEF_MOD("spi_aclk", CLK_PLLCM33_GEAR, 10, 0, 5, 0, + BUS_MSTOP(4, BIT(5))), + DEF_MOD("spi_clk_spix2", CLK_PLLCM33_XSPI, 10, 1, 5, 2, + BUS_MSTOP(4, BIT(5))), DEF_MOD("sdhi_0_imclk", CLK_PLLCLN_DIV8, 10, 3, 5, 3, BUS_MSTOP(8, BIT(2))), DEF_MOD("sdhi_0_imclk2", CLK_PLLCLN_DIV8, 10, 4, 5, 4, @@ -307,6 +317,8 @@ static const struct rzv2h_reset r9a09g056_resets[] __in= itconst =3D { DEF_RST(9, 14, 4, 15), /* RIIC_6_MRST */ DEF_RST(9, 15, 4, 16), /* RIIC_7_MRST */ DEF_RST(10, 0, 4, 17), /* RIIC_8_MRST */ + DEF_RST(10, 3, 4, 20), /* SPI_HRESETN */ + DEF_RST(10, 4, 4, 21), /* SPI_ARESETN */ DEF_RST(10, 7, 4, 24), /* SDHI_0_IXRST */ DEF_RST(10, 8, 4, 25), /* SDHI_1_IXRST */ DEF_RST(10, 9, 4, 26), /* SDHI_2_IXRST */ diff --git a/drivers/clk/renesas/rzv2h-cpg.h b/drivers/clk/renesas/rzv2h-cp= g.h index 317c8ee2e2d5..42b7c7e13284 100644 --- a/drivers/clk/renesas/rzv2h-cpg.h +++ b/drivers/clk/renesas/rzv2h-cpg.h @@ -148,6 +148,8 @@ struct fixed_mod_conf { FIELD_PREP_CONST(BUS_MSTOP_BITS_MASK, (mask))) #define BUS_MSTOP_NONE GENMASK(31, 0) =20 +#define FIXED_MOD_CONF_XSPI FIXED_MOD_CONF_PACK(5, 1) + /** * Definitions of CPG Core Clocks * --=20 2.49.0 From nobody Wed Oct 8 20:55:26 2025 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 B685D2E7F15; Tue, 24 Jun 2025 17:30:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786244; cv=none; b=h3PrgSd+V4IJyAeO1x3t1b3JYusUnuOhLwVHnMiNErRtIOFAjKa0omnARFH6pliaJKZ2WYQ1sOHd3Ron8m4M+q3DbiGTomic4axTO7qYWXgsuwcQbeOXkoSsLGDcW+US+94zGPgchG0nbDz52zGmklcdi390UqGreh/dY/l+d2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750786244; c=relaxed/simple; bh=bVpyKh2OGLR1IfVlI82c34tSoNUWSnovZDukhTkq9hM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=K+5srF+36nuuw8tpW1GjZkCk6cM1nIQBrmONKJIP30Go320GtNpy8Z3MDzZ0Jh2gBcCtBU5Xthjs6tcuu4pQ2IN2r3wcVnRsH7ytXgl+DIyvb8iL/LYAypbEoH/PBkO9d8o6dKK4+Eb0cJAa71XJ5tIX0eNZplb1qGaGyXyu2/0= 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=OuTrj5fZ; arc=none smtp.client-ip=209.85.128.41 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="OuTrj5fZ" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-451ebd3d149so31603715e9.2; Tue, 24 Jun 2025 10:30:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750786241; x=1751391041; 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=1sizNG302uNzqBwHnfp9gUMkakWcmyU9KTTtYGCYjjI=; b=OuTrj5fZHmufzcFFz7tIfhfJauny5yz35mMsObEnvFu+zcrn0zZbCHp6IUHsj8BZKr pdipQiXaJBpvKEukWBz0mxpqlw/nWoSXaVG7sUVnSQVn9lcW9Vp747g7X/q4HsuaJQR4 SyEjsuDWrm/N/D+mtyyCIq+iomM0TSoGTUvABVAF2wExBcshEqhsaUALs0uCKejHMLGz WWJT0Z2Tq4JQtDt+iqnWvHIvZKydnnb9bvr6NIwAwAbIYoIRA2AQDtCgTf+LtwBtNhHO ltoPknh2R3d3h5n/goCMmLg89/A4FHTLDRfcQQax1+aYEhRDEUxLBn7Ag4Pk7ZJrNK+B 9fKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750786241; x=1751391041; 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=1sizNG302uNzqBwHnfp9gUMkakWcmyU9KTTtYGCYjjI=; b=kUaX/ogNUJ8IgexrdRp7fQdcWqfyI7FFQR0jkYm8iVQAUmVrwGS6R2y8vLAisRtCkI kZxg283tZzSQFWIFPqVt85FLT0BRFM9aw9t2p9sYcdkLT9R0CqQZchDd9+1bAH5rYjEK DcAlxPniDxr1CLO+HCIaFGz7jbwl2jmUY+ozwvNbNPGBgOmHzgZ0Z+QCyhHqOCpa1nLP wzuM2VQZbHgqpioYCLSZjiSoxJlnAJjEBfZsZmkWL8m3MvBbW9K7b2YmVVlwF98wJ9Vt w+j97oAQjkB41jTeuUnRcbXbwXLN934iG4C4zydJ2Q8BGEfh1ZGxWAT4BBIxA3kZEblU LVIg== X-Forwarded-Encrypted: i=1; AJvYcCVYe9oTwGBARy6z05+BAg2+UvT9kRQP4Z2bKmffyxOHKhx6QVim+Nssas2q52Mz36D794T/gKfXo9X8@vger.kernel.org, AJvYcCWfIc4tR6NTuapHu0wFdTJipnmSY0yKc2C1tRW1JceRe76MPJGEpt5UkTJ/2qJQzCPuG0LykbmjK7trHs3Z@vger.kernel.org, AJvYcCXCVake5KoAznxWw8z6MSK4a3ISXrKUlN4W/LkFQULvruGkJMSEJsyllBXxbDjoI34X9v46pUywLEWu@vger.kernel.org X-Gm-Message-State: AOJu0YxfW77UlOhcmAemPoXDpZTdHTwvmKyQJLXhNHQ5S22aiMEcubCu zmU0mqFNsP2aSQM/KpKV35dT1vKb6ikLCrw+XIbQcB0tDOemoNo7/nhL X-Gm-Gg: ASbGnctY2csRhP2h1u9joW0Du6g9zMS1rtemiD225bgHi7moyeSNIjBU2jrqBZhAw1o iZV7UeOUjV+1DIpR2+KttKT8ltLlZFOyQXFk+Ubxn64rSJESFRdHZh7/z1IcMxWFsRBAf9GmCPn i2ujzjHPK6kwI5OgfLWQw1R5rZYS5boEUbMRMhsT9VgaCH0Kq3DGw+AUDKYOVINLN9m9EEygIFd nrOyOh+t7cGWTBwQ+CZRIgs7h9qoZ926D9Bu73jEBCqx7oOnV8YAKmj8hysYln03nPzPwWbbIuL YR3NtqLE/8FvpvW0myMJY0xVpNf5cPNLx0xBufrPS01/ExjOZqEz0ddRTI2CzPYEMybCpmy/b/P iB0B3Inp9kWA6dJ13uO4n X-Google-Smtp-Source: AGHT+IGVwaFG2zwbfdjJCGhHl2fr6igkI5o4Pnd2sZaB9w5IHAowPOOtyUGrl+22pchXIJm3NSuXtA== X-Received: by 2002:a05:600c:1c27:b0:453:62e9:125a with SMTP id 5b1f17b1804b1-4537a2f1c30mr62382915e9.18.1750786240629; Tue, 24 Jun 2025 10:30:40 -0700 (PDT) Received: from iku.example.org ([2a06:5906:61b:2d00:a522:16f6:ec97:d332]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4535ead202asm181662565e9.27.2025.06.24.10.30.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 10:30:39 -0700 (PDT) From: Prabhakar X-Google-Original-From: Prabhakar To: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Magnus Damm Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Prabhakar , Biju Das , Fabrizio Castro , Lad Prabhakar Subject: [PATCH 6/6] clk: renesas: r9a09g057: Add XSPI clock/reset Date: Tue, 24 Jun 2025 18:30:30 +0100 Message-ID: <20250624173030.472196-7-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20250624173030.472196-1-prabhakar.mahadev-lad.rj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Lad Prabhakar Add clock and reset entries for the XSPI interface on the R9A09G057 SoC. While at it, rename CLK_PLLCM33_DIV4_PLLCM33 to CLK_PLLCM33_GEAR to align with the terminology used in the hardware manual. Signed-off-by: Lad Prabhakar --- drivers/clk/renesas/r9a09g057-cpg.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/clk/renesas/r9a09g057-cpg.c b/drivers/clk/renesas/r9a0= 9g057-cpg.c index 39065d63df61..687c25f76852 100644 --- a/drivers/clk/renesas/r9a09g057-cpg.c +++ b/drivers/clk/renesas/r9a09g057-cpg.c @@ -36,8 +36,8 @@ enum clk_ids { CLK_PLLCM33_DIV3, CLK_PLLCM33_DIV4, CLK_PLLCM33_DIV5, - CLK_PLLCM33_DIV4_PLLCM33, CLK_PLLCM33_DIV16, + CLK_PLLCM33_GEAR, CLK_SMUX2_XSPI_CLK0, CLK_SMUX2_XSPI_CLK1, CLK_PLLCM33_XSPI, @@ -134,7 +134,7 @@ static const struct cpg_core_clk r9a09g057_core_clks[] = __initconst =3D { DEF_FIXED(".pllcm33_div3", CLK_PLLCM33_DIV3, CLK_PLLCM33, 1, 3), DEF_FIXED(".pllcm33_div4", CLK_PLLCM33_DIV4, CLK_PLLCM33, 1, 4), DEF_FIXED(".pllcm33_div5", CLK_PLLCM33_DIV5, CLK_PLLCM33, 1, 5), - DEF_DDIV(".pllcm33_div4_pllcm33", CLK_PLLCM33_DIV4_PLLCM33, + DEF_DDIV(".pllcm33_gear", CLK_PLLCM33_GEAR, CLK_PLLCM33_DIV4, CDDIV0_DIVCTL1, dtable_2_64), DEF_FIXED(".pllcm33_div16", CLK_PLLCM33_DIV16, CLK_PLLCM33, 1, 16), DEF_SMUX(".smux2_xspi_clk0", CLK_SMUX2_XSPI_CLK0, SSEL1_SELCTL2, smux2_xs= pi_clk0), @@ -189,10 +189,12 @@ static const struct cpg_core_clk r9a09g057_core_clks[= ] __initconst =3D { CLK_PLLETH_DIV_125_FIX, 1, 1), DEF_FIXED("gbeth_1_clk_ptp_ref_i", R9A09G057_GBETH_1_CLK_PTP_REF_I, CLK_PLLETH_DIV_125_FIX, 1, 1), + DEF_FIXED_MOD_STATUS("spi_clk_spi", R9A09G057_SPI_CLK_SPI, CLK_PLLCM33_XS= PI, 1, 2, + FIXED_MOD_CONF_XSPI), }; =20 static const struct rzv2h_mod_clk r9a09g057_mod_clks[] __initconst =3D { - DEF_MOD("dmac_0_aclk", CLK_PLLCM33_DIV4_PLLCM33, 0, 0, 0, 0, + DEF_MOD("dmac_0_aclk", CLK_PLLCM33_GEAR, 0, 0, 0, 0, BUS_MSTOP(5, BIT(9))), DEF_MOD("dmac_1_aclk", CLK_PLLDTY_ACPU_DIV2, 0, 1, 0, 1, BUS_MSTOP(3, BIT(2))), @@ -258,6 +260,12 @@ static const struct rzv2h_mod_clk r9a09g057_mod_clks[]= __initconst =3D { BUS_MSTOP(1, BIT(7))), DEF_MOD("riic_7_ckm", CLK_PLLCLN_DIV16, 9, 11, 4, 27, BUS_MSTOP(1, BIT(8))), + DEF_MOD("spi_hclk", CLK_PLLCM33_GEAR, 9, 15, 4, 31, + BUS_MSTOP(4, BIT(5))), + DEF_MOD("spi_aclk", CLK_PLLCM33_GEAR, 10, 0, 5, 0, + BUS_MSTOP(4, BIT(5))), + DEF_MOD("spi_clk_spix2", CLK_PLLCM33_XSPI, 10, 1, 5, 2, + BUS_MSTOP(4, BIT(5))), DEF_MOD("sdhi_0_imclk", CLK_PLLCLN_DIV8, 10, 3, 5, 3, BUS_MSTOP(8, BIT(2))), DEF_MOD("sdhi_0_imclk2", CLK_PLLCLN_DIV8, 10, 4, 5, 4, @@ -380,6 +388,8 @@ static const struct rzv2h_reset r9a09g057_resets[] __in= itconst =3D { DEF_RST(9, 14, 4, 15), /* RIIC_6_MRST */ DEF_RST(9, 15, 4, 16), /* RIIC_7_MRST */ DEF_RST(10, 0, 4, 17), /* RIIC_8_MRST */ + DEF_RST(10, 3, 4, 20), /* SPI_HRESETN */ + DEF_RST(10, 4, 4, 21), /* SPI_ARESETN */ DEF_RST(10, 7, 4, 24), /* SDHI_0_IXRST */ DEF_RST(10, 8, 4, 25), /* SDHI_1_IXRST */ DEF_RST(10, 9, 4, 26), /* SDHI_2_IXRST */ --=20 2.49.0