clk: uniphier: Add SoC-glue clock source selector support for Pro4
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Tue, 12 Oct 2021 00:53:55 +0000 (09:53 +0900)
committerStephen Boyd <sboyd@kernel.org>
Tue, 2 Nov 2021 21:34:51 +0000 (14:34 -0700)
Add SoC-glue clock source selector for ahci controller on UniPhier SoCs.
Currently this supports Pro4 only.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/1634000035-3114-6-git-send-email-hayashi.kunihiko@socionext.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/uniphier/clk-uniphier-core.c
drivers/clk/uniphier/clk-uniphier-sys.c
drivers/clk/uniphier/clk-uniphier.h

index 0a947e757d136d100b954df4f2406b86dfe00822..46c66fac48e6a796bb2efaed527e389980ee0b82 100644 (file)
@@ -210,6 +210,11 @@ static const struct of_device_id uniphier_clk_match[] = {
                .compatible = "socionext,uniphier-nx1-peri-clock",
                .data = uniphier_pro4_peri_clk_data,
        },
+       /* SoC-glue clock */
+       {
+               .compatible = "socionext,uniphier-pro4-sg-clock",
+               .data = uniphier_pro4_sg_clk_data,
+       },
        { /* sentinel */ }
 };
 
index e8bf85cd2d30424ca24d6fa3ec3209bf971162d2..0180470b24db19ed785fd616602e4b8a69784da2 100644 (file)
@@ -330,3 +330,20 @@ const struct uniphier_clk_data uniphier_nx1_sys_clk_data[] = {
                             "cpll/32"),
        { /* sentinel */ }
 };
+
+const struct uniphier_clk_data uniphier_pro4_sg_clk_data[] = {
+       UNIPHIER_CLK_DIV("gpll", 4),
+       {
+               .name = "sata-ref",
+               .type = UNIPHIER_CLK_TYPE_MUX,
+               .idx = 0,
+               .data.mux = {
+                       .parent_names = { "gpll/4", "ref", },
+                       .num_parents = 2,
+                       .reg = 0x1a28,
+                       .masks = { 0x1, 0x1, },
+                       .vals  = { 0x0, 0x1, },
+               },
+       },
+       { /* sentinel */ }
+};
index c54fb789588909646b5c2cb01adb1dd84feb2b67..dea0c7829aeefd924570d5211d462fb256975e09 100644 (file)
@@ -155,5 +155,6 @@ extern const struct uniphier_clk_data uniphier_ld4_mio_clk_data[];
 extern const struct uniphier_clk_data uniphier_pro5_sd_clk_data[];
 extern const struct uniphier_clk_data uniphier_ld4_peri_clk_data[];
 extern const struct uniphier_clk_data uniphier_pro4_peri_clk_data[];
+extern const struct uniphier_clk_data uniphier_pro4_sg_clk_data[];
 
 #endif /* __CLK_UNIPHIER_H__ */