Skip to contentSkip to conversation

clk: vf610: Add clocks to support MTIP L2 switch

PATCH Applied Lukasz Majewski 4 participants 12 messages Jan 29 – Mar 18

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover clk: vf610: Add clocks to support MTIP L2 switch

This patch series:
- cleans up clocks' setup on vf610 by moving VF610_CLK_END define to driver code
- introduces support for several clocks required by MTIP switch IP block

Lukasz Majewski (4):
clk: vf610: Move VF610_CLK_END define to clk-vf610 driver
dt-bindings: clock: vf610: Drop VF610_CLK_END define
dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
clk: vf610: Add support for the Ethernet switch clocks

 drivers/clk/imx/clk-vf610.c             | 12 ++++++++++++
 include/dt-bindings/clock/vf610-clock.h |  6 +++++-
 2 files changed, 17 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.5
#1 lore raw

PATCH v4 1/4 clk: vf610: Move VF610_CLK_END define to clk-vf610 driver

The VF610_CLK_END was previously defined in vf610-clock.h to indicate the number of clocks.

It is solely used in the clk driver to allocate proper size of the clk table.

Moreover, when new clocks (like e.g. ones for MTIP L2 switch) are defined its value also changes, so it shall be locally adjusted.

---
Changes for v4:
- Separate patch
- Add comment regarding value of VF610_CLK_END

---
 drivers/clk/imx/clk-vf610.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/clk/imx/clk-vf610.c +7 -0
index 9e11f1c7c397..457156944c67 100644
@@ -11,6 +11,13 @@
 
 #include "clk.h"
 
+/*
+ * The VF610_CLK_END corresponds to ones defined in
+ * include/dt-bindings/clock/vf610-clock.h
+ * It shall be the value of the last defined clock +1
+ */
+#define VF610_CLK_END 191
+
 #define CCM_CCR			(ccm_base + 0x00)
 #define CCM_CSR			(ccm_base + 0x04)
 #define CCM_CCSR		(ccm_base + 0x08)
Signature · 1 line
2.39.5
#2 lore raw

PATCH v4 2/4 dt-bindings: clock: vf610: Drop VF610_CLK_END define

In reply to Lukasz Majewski

The VF610_CLK_END should be dropped as it is not part of the ABI.

---
Changes for v4:
- New, separate patch

---
 include/dt-bindings/clock/vf610-clock.h | 1 -
 1 file changed, 1 deletion(-)
include/dt-bindings/clock/vf610-clock.h +0 -1
index 373644e46747..c91fb86fa9a1 100644
@@ -197,6 +197,5 @@
 #define VF610_CLK_TCON1			188
 #define VF610_CLK_CAAM			189
 #define VF610_CLK_CRC			190
-#define VF610_CLK_END			191
 
 #endif /* __DT_BINDINGS_CLOCK_VF610_H */
Signature · 1 line
2.39.5
#4 lore raw

PATCH v4 3/4 dt-bindings: clock: vf610: Add definitions for MTIP L2 switch

In reply to Lukasz Majewski

This patch adds VF610_CLK_ESW and VF610_CLK_ESW_MAC_TAB{0123} macros definitions for L2 switch.

Those definitions describe clocks for MoreThanIP switch IP block; the switch itself and the MAC address lookup table clocks.

---
Changes for v4:
- Do not change VF610_CLK_END

---
 include/dt-bindings/clock/vf610-clock.h | 5 +++++
 1 file changed, 5 insertions(+)
include/dt-bindings/clock/vf610-clock.h +5 -0
index c91fb86fa9a1..5d94bd561a2e 100644
@@ -197,5 +197,10 @@
 #define VF610_CLK_TCON1			188
 #define VF610_CLK_CAAM			189
 #define VF610_CLK_CRC			190
+#define VF610_CLK_ESW			191
+#define VF610_CLK_ESW_MAC_TAB0		192
+#define VF610_CLK_ESW_MAC_TAB1		193
+#define VF610_CLK_ESW_MAC_TAB2		194
+#define VF610_CLK_ESW_MAC_TAB3		195
 
 #endif /* __DT_BINDINGS_CLOCK_VF610_H */
Signature · 1 line
2.39.5
maintainer Acked-by on v4 3/4
#5 lore raw

Re: [PATCH v4 3/4] dt-bindings: clock: vf610: Add definitions for MTIP L2 switch

Quoted 6 lines · Lukasz Majewski

This patch adds VF610_CLK_ESW and VF610_CLK_ESW_MAC_TAB{0123} macros definitions for L2 switch.

Those definitions describe clocks for MoreThanIP switch IP block; the switch itself and the MAC address lookup table clocks.

Quoted 8 lines

---
Changes for v4:
- Do not change VF610_CLK_END

---
 include/dt-bindings/clock/vf610-clock.h | 5 +++++
 1 file changed, 5 insertions(+)
#6 lore raw

PATCH v4 4/4 clk: vf610: Add support for the Ethernet switch clocks

In reply to Lukasz Majewski

The vf610 device has built in the MoreThanIP L2 switch. For proper operation it is required to enable ESW and MAC table lookup clocks.

The MAC table spans from 0x400E_C000 for 0x4000 and it is necessary to provide clocks for each AIPS1-"slot", which size is 0x1000 (hence four separate entries).

Those can be enabled via clock gating CCM_CCGR10 register (0x4006_B068).

---
Changes for v4:
- Adjust VF610_CLK_END

---
 drivers/clk/imx/clk-vf610.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/clk/imx/clk-vf610.c +6 -1
index 457156944c67..766119a86841 100644
@@ -16,7 +16,7 @@
  * include/dt-bindings/clock/vf610-clock.h
  * It shall be the value of the last defined clock +1
  */
-#define VF610_CLK_END 191
+#define VF610_CLK_END 196
 
 #define CCM_CCR			(ccm_base + 0x00)
 #define CCM_CSR			(ccm_base + 0x04)
@@ -316,6 +316,11 @@ static void __init vf610_clocks_init(struct device_node *ccm_node)
 	clk[VF610_CLK_ENET_TS] = imx_clk_gate("enet_ts", "enet_ts_sel", CCM_CSCDR1, 23);
 	clk[VF610_CLK_ENET0] = imx_clk_gate2("enet0", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(0));
 	clk[VF610_CLK_ENET1] = imx_clk_gate2("enet1", "ipg_bus", CCM_CCGR9, CCM_CCGRx_CGn(1));
+	clk[VF610_CLK_ESW] = imx_clk_gate2("esw", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(8));
+	clk[VF610_CLK_ESW_MAC_TAB0] = imx_clk_gate2("esw_tab0", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(12));
+	clk[VF610_CLK_ESW_MAC_TAB1] = imx_clk_gate2("esw_tab1", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(13));
+	clk[VF610_CLK_ESW_MAC_TAB2] = imx_clk_gate2("esw_tab2", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(14));
+	clk[VF610_CLK_ESW_MAC_TAB3] = imx_clk_gate2("esw_tab3", "ipg_bus", CCM_CCGR10, CCM_CCGRx_CGn(15));
 
 	clk[VF610_CLK_PIT] = imx_clk_gate2("pit", "ipg_bus", CCM_CCGR1, CCM_CCGRx_CGn(7));
 
Signature · 1 line
2.39.5
Reviewed-by on the v4 series
#7 lore raw
In reply to Lukasz Majewski
Quoted 10 lines · Lukasz Majewski

This patch series:
- cleans up clocks' setup on vf610 by moving VF610_CLK_END define to driver code
- introduces support for several clocks required by MTIP switch IP block

Lukasz Majewski (4):
clk: vf610: Move VF610_CLK_END define to clk-vf610 driver
dt-bindings: clock: vf610: Drop VF610_CLK_END define
dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
clk: vf610: Add support for the Ethernet switch clocks

#8 lore raw

Dear all,

Quoted 7 lines · Lukasz Majewski
Quoted 6 lines

This patch series:
- cleans up clocks' setup on vf610 by moving VF610_CLK_END define to driver code
- introduces support for several clocks required by MTIP switch IP block

Quoted 7 lines
Quoted 5 lines

Lukasz Majewski (4):
clk: vf610: Move VF610_CLK_END define to clk-vf610 driver
dt-bindings: clock: vf610: Drop VF610_CLK_END define
dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
clk: vf610: Add support for the Ethernet switch clocks

Gentle ping regarding this patch set...

Signature · 10 lines
Best regards,

Lukasz Majewski

--
Nabla Software Engineering GmbH
HRB 40522 Augsburg
Phone: +49 821 45592596
E-Mail: [email protected]
Managing Director : Stefano Babic
#9 lore raw
Quoted 15 lines · Łukasz Majewski

Dear all,

Quoted 13 lines · Lukasz Majewski
Quoted 11 lines

This patch series:
- cleans up clocks' setup on vf610 by moving VF610_CLK_END define to driver code
- introduces support for several clocks required by MTIP switch IP block

Lukasz Majewski (4):
clk: vf610: Move VF610_CLK_END define to clk-vf610 driver
dt-bindings: clock: vf610: Drop VF610_CLK_END define
dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
clk: vf610: Add support for the Ethernet switch clocks

Quoted 3 lines
Quoted 1 line

Gentle ping regarding this patch set...

Will apply after rc1.

#10 lore raw

Hi Abel,

Quoted 16 lines · Łukasz Majewski
Quoted 15 lines

Dear all,

Quoted 13 lines · Lukasz Majewski
Quoted 11 lines

This patch series:
- cleans up clocks' setup on vf610 by moving VF610_CLK_END define to driver code
- introduces support for several clocks required by MTIP switch IP block

Lukasz Majewski (4):
clk: vf610: Move VF610_CLK_END define to clk-vf610 driver
dt-bindings: clock: vf610: Drop VF610_CLK_END define
dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
clk: vf610: Add support for the Ethernet switch clocks

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Gentle ping regarding this patch set...

Will apply after rc1.

Thanks :-)

Signature · 10 lines
Best regards,

Lukasz Majewski

--
Nabla Software Engineering GmbH
HRB 40522 Augsburg
Phone: +49 821 45592596
E-Mail: [email protected]
Managing Director : Stefano Babic
Applied
#11 lore raw
In reply to Lukasz Majewski
Quoted 5 lines · Lukasz Majewski

This patch series:
- cleans up clocks' setup on vf610 by moving VF610_CLK_END define to driver code
- introduces support for several clocks required by MTIP switch IP block

Quoted 7 lines

Lukasz Majewski (4):
clk: vf610: Move VF610_CLK_END define to clk-vf610 driver
dt-bindings: clock: vf610: Drop VF610_CLK_END define
dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
clk: vf610: Add support for the Ethernet switch clocks

[...]

Applied, thanks!

[1/4] clk: vf610: Move VF610_CLK_END define to clk-vf610 driver

      commit: 2c53aa5878f9abe6975ca45591b8e3357794c0e4
[2/4] dt-bindings: clock: vf610: Drop VF610_CLK_END define
      commit: 216ad764f8d8c53b85cc74f6090f8d132772fec4
[3/4] dt-bindings: clock: vf610: Add definitions for MTIP L2 switch
      commit: 819bfc68251484bb9ba4b6cf91279a80c0fd7047
[4/4] clk: vf610: Add support for the Ethernet switch clocks
      commit: 5567730bd36614d8099d73520760c298e80e0fc5

Best regards,

Signature · 1 line
Abel Vesa <[email protected]>