Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <yamada.masahiro@socionext.com>
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/1634000035-3114-4-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>

authored by

Kunihiko Hayashi and committed by
Stephen Boyd
bed51629 6a7f2c9e

+45
+12
drivers/clk/uniphier/clk-uniphier-core.c
··· 132 132 .compatible = "socionext,uniphier-pxs3-clock", 133 133 .data = uniphier_pxs3_sys_clk_data, 134 134 }, 135 + { 136 + .compatible = "socionext,uniphier-nx1-clock", 137 + .data = uniphier_nx1_sys_clk_data, 138 + }, 135 139 /* Media I/O clock, SD clock */ 136 140 { 137 141 .compatible = "socionext,uniphier-ld4-mio-clock", ··· 169 165 .compatible = "socionext,uniphier-pxs3-sd-clock", 170 166 .data = uniphier_pro5_sd_clk_data, 171 167 }, 168 + { 169 + .compatible = "socionext,uniphier-nx1-sd-clock", 170 + .data = uniphier_pro5_sd_clk_data, 171 + }, 172 172 /* Peripheral clock */ 173 173 { 174 174 .compatible = "socionext,uniphier-ld4-peri-clock", ··· 204 196 }, 205 197 { 206 198 .compatible = "socionext,uniphier-pxs3-peri-clock", 199 + .data = uniphier_pro4_peri_clk_data, 200 + }, 201 + { 202 + .compatible = "socionext,uniphier-nx1-peri-clock", 207 203 .data = uniphier_pro4_peri_clk_data, 208 204 }, 209 205 { /* sentinel */ }
+28
drivers/clk/uniphier/clk-uniphier-sys.c
··· 20 20 UNIPHIER_CLK_FACTOR("sd-200m", -1, "spll", 1, 10), \ 21 21 UNIPHIER_CLK_FACTOR("sd-133m", -1, "spll", 1, 15) 22 22 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 + 23 27 #define UNIPHIER_LD4_SYS_CLK_NAND(idx) \ 24 28 UNIPHIER_CLK_FACTOR("nand-50m", -1, "spll", 1, 32), \ 25 29 UNIPHIER_CLK_GATE("nand", (idx), "nand-50m", 0x2104, 2) ··· 304 300 UNIPHIER_CLK_CPUGEAR("cpu-ipp", 34, 0x8100, 0xf, 8, 305 301 "s2pll/2", "spll/2", "s2pll/3", "spll/3", 306 302 "spll/4", "spll/8", "s2pll/4", "s2pll/8"), 303 + { /* sentinel */ } 304 + }; 305 + 306 + const struct uniphier_clk_data uniphier_nx1_sys_clk_data[] = { 307 + UNIPHIER_CLK_FACTOR("cpll", -1, "ref", 100, 1), /* ARM: 2500 MHz */ 308 + UNIPHIER_CLK_FACTOR("spll", -1, "ref", 32, 1), /* 800 MHz */ 309 + UNIPHIER_CLK_FACTOR("uart", 0, "spll", 1, 6), 310 + UNIPHIER_CLK_FACTOR("i2c", 1, "spll", 1, 16), 311 + UNIPHIER_NX1_SYS_CLK_SD, 312 + UNIPHIER_CLK_GATE("emmc", 4, NULL, 0x2108, 8), 313 + UNIPHIER_CLK_GATE("ether", 6, NULL, 0x210c, 0), 314 + UNIPHIER_CLK_GATE("usb30-0", 12, NULL, 0x210c, 16), /* =GIO */ 315 + UNIPHIER_CLK_GATE("usb30-1", 13, NULL, 0x210c, 20), /* =GIO1P */ 316 + UNIPHIER_CLK_GATE("usb30-hsphy0", 16, NULL, 0x210c, 24), 317 + UNIPHIER_CLK_GATE("usb30-ssphy0", 17, NULL, 0x210c, 25), 318 + UNIPHIER_CLK_GATE("usb30-ssphy1", 18, NULL, 0x210c, 26), 319 + UNIPHIER_CLK_GATE("pcie", 24, NULL, 0x210c, 8), 320 + UNIPHIER_CLK_GATE("voc", 52, NULL, 0x2110, 0), 321 + UNIPHIER_CLK_GATE("hdmitx", 58, NULL, 0x2110, 8), 322 + /* CPU gears */ 323 + UNIPHIER_CLK_DIV5("cpll", 2, 4, 8, 16, 32), 324 + UNIPHIER_CLK_CPUGEAR("cpu-ca53", 33, 0x8080, 0xf, 5, 325 + "cpll/2", "cpll/4", "cpll/8", "cpll/16", 326 + "cpll/32"), 307 327 { /* sentinel */ } 308 328 };
+5
drivers/clk/uniphier/clk-uniphier.h
··· 119 119 UNIPHIER_CLK_DIV2(parent, div0, div1), \ 120 120 UNIPHIER_CLK_DIV2(parent, div2, div3) 121 121 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 + 122 126 struct clk_hw *uniphier_clk_register_cpugear(struct device *dev, 123 127 struct regmap *regmap, 124 128 const char *name, ··· 150 146 extern const struct uniphier_clk_data uniphier_ld11_sys_clk_data[]; 151 147 extern const struct uniphier_clk_data uniphier_ld20_sys_clk_data[]; 152 148 extern const struct uniphier_clk_data uniphier_pxs3_sys_clk_data[]; 149 + extern const struct uniphier_clk_data uniphier_nx1_sys_clk_data[]; 153 150 extern const struct uniphier_clk_data uniphier_ld4_mio_clk_data[]; 154 151 extern const struct uniphier_clk_data uniphier_pro5_sd_clk_data[]; 155 152 extern const struct uniphier_clk_data uniphier_ld4_peri_clk_data[];