Skip to content

Commit 20e3120

Browse files
prabhakarladgeertu
authored andcommitted
clk: renesas: r9a09g056: Add XSPI clock/reset
Add XSPI clock and reset entries. Signed-off-by: Lad Prabhakar <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 87239ca commit 20e3120

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/clk/renesas/r9a09g056-cpg.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ enum clk_ids {
3939
CLK_SMUX2_XSPI_CLK0,
4040
CLK_SMUX2_XSPI_CLK1,
4141
CLK_PLLCM33_XSPI,
42+
CLK_PLLCM33_GEAR,
4243
CLK_PLLCLN_DIV2,
4344
CLK_PLLCLN_DIV8,
4445
CLK_PLLCLN_DIV16,
@@ -123,6 +124,7 @@ static const struct cpg_core_clk r9a09g056_core_clks[] __initconst = {
123124
DEF_SMUX(".smux2_xspi_clk1", CLK_SMUX2_XSPI_CLK1, SSEL1_SELCTL3, smux2_xspi_clk1),
124125
DEF_CSDIV(".pllcm33_xspi", CLK_PLLCM33_XSPI, CLK_SMUX2_XSPI_CLK1, CSDIV0_DIVCTL3,
125126
dtable_2_16),
127+
DEF_DDIV(".pllcm33_gear", CLK_PLLCM33_GEAR, CLK_PLLCM33_DIV4, CDDIV0_DIVCTL1, dtable_2_64),
126128

127129
DEF_FIXED(".pllcln_div2", CLK_PLLCLN_DIV2, CLK_PLLCLN, 1, 2),
128130
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 = {
162164
CLK_PLLETH_DIV_125_FIX, 1, 1),
163165
DEF_FIXED("gbeth_1_clk_ptp_ref_i", R9A09G056_GBETH_1_CLK_PTP_REF_I,
164166
CLK_PLLETH_DIV_125_FIX, 1, 1),
167+
DEF_FIXED_MOD_STATUS("spi_clk_spi", R9A09G056_SPI_CLK_SPI, CLK_PLLCM33_XSPI, 1, 2,
168+
FIXED_MOD_CONF_XSPI),
165169
};
166170

167171
static const struct rzv2h_mod_clk r9a09g056_mod_clks[] __initconst = {
@@ -219,6 +223,12 @@ static const struct rzv2h_mod_clk r9a09g056_mod_clks[] __initconst = {
219223
BUS_MSTOP(1, BIT(7))),
220224
DEF_MOD("riic_7_ckm", CLK_PLLCLN_DIV16, 9, 11, 4, 27,
221225
BUS_MSTOP(1, BIT(8))),
226+
DEF_MOD("spi_hclk", CLK_PLLCM33_GEAR, 9, 15, 4, 31,
227+
BUS_MSTOP(4, BIT(5))),
228+
DEF_MOD("spi_aclk", CLK_PLLCM33_GEAR, 10, 0, 5, 0,
229+
BUS_MSTOP(4, BIT(5))),
230+
DEF_MOD("spi_clk_spix2", CLK_PLLCM33_XSPI, 10, 1, 5, 2,
231+
BUS_MSTOP(4, BIT(5))),
222232
DEF_MOD("sdhi_0_imclk", CLK_PLLCLN_DIV8, 10, 3, 5, 3,
223233
BUS_MSTOP(8, BIT(2))),
224234
DEF_MOD("sdhi_0_imclk2", CLK_PLLCLN_DIV8, 10, 4, 5, 4,
@@ -307,6 +317,8 @@ static const struct rzv2h_reset r9a09g056_resets[] __initconst = {
307317
DEF_RST(9, 14, 4, 15), /* RIIC_6_MRST */
308318
DEF_RST(9, 15, 4, 16), /* RIIC_7_MRST */
309319
DEF_RST(10, 0, 4, 17), /* RIIC_8_MRST */
320+
DEF_RST(10, 3, 4, 20), /* SPI_HRESETN */
321+
DEF_RST(10, 4, 4, 21), /* SPI_ARESETN */
310322
DEF_RST(10, 7, 4, 24), /* SDHI_0_IXRST */
311323
DEF_RST(10, 8, 4, 25), /* SDHI_1_IXRST */
312324
DEF_RST(10, 9, 4, 26), /* SDHI_2_IXRST */

drivers/clk/renesas/rzv2h-cpg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ struct fixed_mod_conf {
149149
FIELD_PREP_CONST(BUS_MSTOP_BITS_MASK, (mask)))
150150
#define BUS_MSTOP_NONE GENMASK(31, 0)
151151

152+
#define FIXED_MOD_CONF_XSPI FIXED_MOD_CONF_PACK(5, 1)
153+
152154
/**
153155
* Definitions of CPG Core Clocks
154156
*

0 commit comments

Comments
 (0)