mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] Layerscape LS1028a: add clk support
@ 2023-12-19 13:21 Sascha Hauer
  2023-12-19 13:21 ` [PATCH 1/2] clk: layerscape: move chipinfo_ls1012a further up Sascha Hauer
  2023-12-19 13:21 ` [PATCH 2/2] clk: layerscape: add support for ls1028a Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-12-19 13:21 UTC (permalink / raw)
  To: Barebox List

Adding clk support for LS1028a is straight forward. The changes are
directly imported from Linux.

Sascha Hauer (2):
  clk: layerscape: move chipinfo_ls1012a further up
  clk: layerscape: add support for ls1028a

 drivers/clk/clk-qoric.c | 83 +++++++++++++++++++++++++++++++++++++----
 1 file changed, 76 insertions(+), 7 deletions(-)

-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] clk: layerscape: move chipinfo_ls1012a further up
  2023-12-19 13:21 [PATCH 0/2] Layerscape LS1028a: add clk support Sascha Hauer
@ 2023-12-19 13:21 ` Sascha Hauer
  2023-12-19 13:21 ` [PATCH 2/2] clk: layerscape: add support for ls1028a Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-12-19 13:21 UTC (permalink / raw)
  To: Barebox List

Cosmetic change to keep the chipinfo entries ordered.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/clk/clk-qoric.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/clk-qoric.c b/drivers/clk/clk-qoric.c
index 895810ccd1..49859077f6 100644
--- a/drivers/clk/clk-qoric.c
+++ b/drivers/clk/clk-qoric.c
@@ -203,6 +203,13 @@ static void __init t2080_init_periph(struct clockgen *cg)
 	cg->fman[0] = cg->hwaccel[0];
 }
 
+static const struct clockgen_chipinfo chipinfo_ls1012a = {
+	.compat = "fsl,ls1012a-clockgen",
+	.cmux_groups = { &ls1012a_cmux },
+	.cmux_to_group = { 0, -1 },
+	.pll_mask = 0x03,
+};
+
 static const struct clockgen_chipinfo chipinfo_ls1021a = {
 	.compat = "fsl,ls1021a-clockgen",
 	.cmux_groups = { &t1023_cmux },
@@ -238,13 +245,6 @@ static const struct clockgen_chipinfo chipinfo_ls1088a = {
 	.flags = CG_VER3 | CG_LITTLE_ENDIAN,
 };
 
-static const struct clockgen_chipinfo chipinfo_ls1012a = {
-	.compat = "fsl,ls1012a-clockgen",
-	.cmux_groups = { &ls1012a_cmux },
-	.cmux_to_group = { 0, -1 },
-	.pll_mask = 0x03,
-};
-
 static const struct clockgen_chipinfo chipinfo_ls2080a = {
 	.compat = "fsl,ls2080a-clockgen",
 	.cmux_groups = { &clockgen2_cmux_cga12, &clockgen2_cmux_cgb },
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] clk: layerscape: add support for ls1028a
  2023-12-19 13:21 [PATCH 0/2] Layerscape LS1028a: add clk support Sascha Hauer
  2023-12-19 13:21 ` [PATCH 1/2] clk: layerscape: move chipinfo_ls1012a further up Sascha Hauer
@ 2023-12-19 13:21 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2023-12-19 13:21 UTC (permalink / raw)
  To: Barebox List

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/clk/clk-qoric.c | 69 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)

diff --git a/drivers/clk/clk-qoric.c b/drivers/clk/clk-qoric.c
index 49859077f6..6c69b5b3f3 100644
--- a/drivers/clk/clk-qoric.c
+++ b/drivers/clk/clk-qoric.c
@@ -143,6 +143,58 @@ static const struct clockgen_muxinfo clockgen2_cmux_cgb = {
 	},
 };
 
+static const struct clockgen_muxinfo ls1028a_hwa1 = {
+	{
+		{ CLKSEL_VALID, PLATFORM_PLL, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV3 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV4 },
+		{},
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV3 },
+	},
+};
+
+static const struct clockgen_muxinfo ls1028a_hwa2 = {
+	{
+		{ CLKSEL_VALID, PLATFORM_PLL, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV3 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV4 },
+		{},
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV3 },
+	},
+};
+
+static const struct clockgen_muxinfo ls1028a_hwa3 = {
+	{
+		{ CLKSEL_VALID, PLATFORM_PLL, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV3 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV4 },
+		{},
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV3 },
+	},
+};
+
+static const struct clockgen_muxinfo ls1028a_hwa4 = {
+	{
+		{ CLKSEL_VALID, PLATFORM_PLL, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV1 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV3 },
+		{ CLKSEL_VALID, CGA_PLL2, PLL_DIV4 },
+		{},
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV2 },
+		{ CLKSEL_VALID, CGA_PLL1, PLL_DIV3 },
+	},
+};
+
 static const struct clockgen_muxinfo ls1043a_hwa1 = {
 	{
 		{},
@@ -217,6 +269,15 @@ static const struct clockgen_chipinfo chipinfo_ls1021a = {
 	.pll_mask = 0x03,
 };
 
+static const struct clockgen_chipinfo chipinfo_ls1028a = {
+	.compat = "fsl,ls1028a-clockgen",
+	.cmux_groups = { &clockgen2_cmux_cga12 },
+	.hwaccel = { &ls1028a_hwa1, &ls1028a_hwa2, &ls1028a_hwa3, &ls1028a_hwa4 },
+	.cmux_to_group = { 0, 0, 0, 0, -1 },
+	.pll_mask = 0x07,
+	.flags = CG_VER3 | CG_LITTLE_ENDIAN,
+};
+
 static const struct clockgen_chipinfo chipinfo_ls1043a = {
 	.compat = "fsl,ls1043a-clockgen",
 	.init_periph = t2080_init_periph,
@@ -622,6 +683,11 @@ static void __maybe_unused clockgen_init_ls1021a(struct device_node *np)
 	clockgen_init(np, &chipinfo_ls1021a);
 }
 
+static void __maybe_unused clockgen_init_ls1028a(struct device_node *np)
+{
+	clockgen_init(np, &chipinfo_ls1028a);
+}
+
 static void __maybe_unused clockgen_init_ls1043a(struct device_node *np)
 {
 	clockgen_init(np, &chipinfo_ls1043a);
@@ -648,6 +714,9 @@ CLK_OF_DECLARE(qoriq_clockgen_ls1012a, "fsl,ls1012a-clockgen", clockgen_init_ls1
 #ifdef CONFIG_ARCH_LS1021
 CLK_OF_DECLARE(qoriq_clockgen_ls1021a, "fsl,ls1021a-clockgen", clockgen_init_ls1021a);
 #endif
+#ifdef CONFIG_ARCH_LS1028
+CLK_OF_DECLARE(qoriq_clockgen_ls1021a, "fsl,ls1028a-clockgen", clockgen_init_ls1028a);
+#endif
 #ifdef CONFIG_ARCH_LS1043
 CLK_OF_DECLARE(qoriq_clockgen_ls1043a, "fsl,ls1043a-clockgen", clockgen_init_ls1043a);
 #endif
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-19 13:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19 13:21 [PATCH 0/2] Layerscape LS1028a: add clk support Sascha Hauer
2023-12-19 13:21 ` [PATCH 1/2] clk: layerscape: move chipinfo_ls1012a further up Sascha Hauer
2023-12-19 13:21 ` [PATCH 2/2] clk: layerscape: add support for ls1028a Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox