Skip to content

Commit bed5162

Browse files
khayash1bebarino
authored andcommitted
clk: uniphier: Add NX1 clock support
Add basic clock data for UniPhier NX1 SoC. This includes PLL and clock division data for cpufreq support. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Kunihiko Hayashi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 6a7f2c9 commit bed5162

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

drivers/clk/uniphier/clk-uniphier-core.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ static const struct of_device_id uniphier_clk_match[] = {
132132
.compatible = "socionext,uniphier-pxs3-clock",
133133
.data = uniphier_pxs3_sys_clk_data,
134134
},
135+
{
136+
.compatible = "socionext,uniphier-nx1-clock",
137+
.data = uniphier_nx1_sys_clk_data,
138+
},
135139
/* Media I/O clock, SD clock */
136140
{
137141
.compatible = "socionext,uniphier-ld4-mio-clock",
@@ -165,6 +169,10 @@ static const struct of_device_id uniphier_clk_match[] = {
165169
.compatible = "socionext,uniphier-pxs3-sd-clock",
166170
.data = uniphier_pro5_sd_clk_data,
167171
},
172+
{
173+
.compatible = "socionext,uniphier-nx1-sd-clock",
174+
.data = uniphier_pro5_sd_clk_data,
175+
},
168176
/* Peripheral clock */
169177
{
170178
.compatible = "socionext,uniphier-ld4-peri-clock",
@@ -198,6 +206,10 @@ static const struct of_device_id uniphier_clk_match[] = {
198206
.compatible = "socionext,uniphier-pxs3-peri-clock",
199207
.data = uniphier_pro4_peri_clk_data,
200208
},
209+
{
210+
.compatible = "socionext,uniphier-nx1-peri-clock",
211+
.data = uniphier_pro4_peri_clk_data,
212+
},
201213
{ /* sentinel */ }
202214
};
203215

drivers/clk/uniphier/clk-uniphier-sys.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
UNIPHIER_CLK_FACTOR("sd-200m", -1, "spll", 1, 10), \
2121
UNIPHIER_CLK_FACTOR("sd-133m", -1, "spll", 1, 15)
2222

23+
#define UNIPHIER_NX1_SYS_CLK_SD \
24+
UNIPHIER_CLK_FACTOR("sd-200m", -1, "spll", 1, 4), \
25+
UNIPHIER_CLK_FACTOR("sd-133m", -1, "spll", 1, 6)
26+
2327
#define UNIPHIER_LD4_SYS_CLK_NAND(idx) \
2428
UNIPHIER_CLK_FACTOR("nand-50m", -1, "spll", 1, 32), \
2529
UNIPHIER_CLK_GATE("nand", (idx), "nand-50m", 0x2104, 2)
@@ -302,3 +306,27 @@ const struct uniphier_clk_data uniphier_pxs3_sys_clk_data[] = {
302306
"spll/4", "spll/8", "s2pll/4", "s2pll/8"),
303307
{ /* sentinel */ }
304308
};
309+
310+
const struct uniphier_clk_data uniphier_nx1_sys_clk_data[] = {
311+
UNIPHIER_CLK_FACTOR("cpll", -1, "ref", 100, 1), /* ARM: 2500 MHz */
312+
UNIPHIER_CLK_FACTOR("spll", -1, "ref", 32, 1), /* 800 MHz */
313+
UNIPHIER_CLK_FACTOR("uart", 0, "spll", 1, 6),
314+
UNIPHIER_CLK_FACTOR("i2c", 1, "spll", 1, 16),
315+
UNIPHIER_NX1_SYS_CLK_SD,
316+
UNIPHIER_CLK_GATE("emmc", 4, NULL, 0x2108, 8),
317+
UNIPHIER_CLK_GATE("ether", 6, NULL, 0x210c, 0),
318+
UNIPHIER_CLK_GATE("usb30-0", 12, NULL, 0x210c, 16), /* =GIO */
319+
UNIPHIER_CLK_GATE("usb30-1", 13, NULL, 0x210c, 20), /* =GIO1P */
320+
UNIPHIER_CLK_GATE("usb30-hsphy0", 16, NULL, 0x210c, 24),
321+
UNIPHIER_CLK_GATE("usb30-ssphy0", 17, NULL, 0x210c, 25),
322+
UNIPHIER_CLK_GATE("usb30-ssphy1", 18, NULL, 0x210c, 26),
323+
UNIPHIER_CLK_GATE("pcie", 24, NULL, 0x210c, 8),
324+
UNIPHIER_CLK_GATE("voc", 52, NULL, 0x2110, 0),
325+
UNIPHIER_CLK_GATE("hdmitx", 58, NULL, 0x2110, 8),
326+
/* CPU gears */
327+
UNIPHIER_CLK_DIV5("cpll", 2, 4, 8, 16, 32),
328+
UNIPHIER_CLK_CPUGEAR("cpu-ca53", 33, 0x8080, 0xf, 5,
329+
"cpll/2", "cpll/4", "cpll/8", "cpll/16",
330+
"cpll/32"),
331+
{ /* sentinel */ }
332+
};

drivers/clk/uniphier/clk-uniphier.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ struct uniphier_clk_data {
119119
UNIPHIER_CLK_DIV2(parent, div0, div1), \
120120
UNIPHIER_CLK_DIV2(parent, div2, div3)
121121

122+
#define UNIPHIER_CLK_DIV5(parent, div0, div1, div2, div3, div4) \
123+
UNIPHIER_CLK_DIV4(parent, div0, div1, div2, div3), \
124+
UNIPHIER_CLK_DIV(parent, div4)
125+
122126
struct clk_hw *uniphier_clk_register_cpugear(struct device *dev,
123127
struct regmap *regmap,
124128
const char *name,
@@ -146,6 +150,7 @@ extern const struct uniphier_clk_data uniphier_pxs2_sys_clk_data[];
146150
extern const struct uniphier_clk_data uniphier_ld11_sys_clk_data[];
147151
extern const struct uniphier_clk_data uniphier_ld20_sys_clk_data[];
148152
extern const struct uniphier_clk_data uniphier_pxs3_sys_clk_data[];
153+
extern const struct uniphier_clk_data uniphier_nx1_sys_clk_data[];
149154
extern const struct uniphier_clk_data uniphier_ld4_mio_clk_data[];
150155
extern const struct uniphier_clk_data uniphier_pro5_sd_clk_data[];
151156
extern const struct uniphier_clk_data uniphier_ld4_peri_clk_data[];

0 commit comments

Comments
 (0)