[RFC,2/4] dt-bindings: clock: break out mediatek,ethsys into its own header
Commit Message
The ethsys clocks of MT7981 and MT7986 are identical. In order to
de-duplicate both clock drivers, start with putting ethsys into a
header files of its own, so it can be used by both SoCs.
Propagate this change also to mt7986a.dtsi which is the only user.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 +
drivers/clk/mediatek/clk-mt7986-eth.c | 2 +-
include/dt-bindings/clock/mediatek,ethsys.h | 32 +++++++++++++++++++
.../dt-bindings/clock/mediatek,mt7981-clk.h | 18 -----------
.../dt-bindings/clock/mediatek,mt7986-clk.h | 22 -------------
5 files changed, 34 insertions(+), 41 deletions(-)
create mode 100644 include/dt-bindings/clock/mediatek,ethsys.h
Comments
On 22/02/2023 19:09, Daniel Golle wrote:
> The ethsys clocks of MT7981 and MT7986 are identical. In order to
> de-duplicate both clock drivers, start with putting ethsys into a
> header files of its own, so it can be used by both SoCs.
> Propagate this change also to mt7986a.dtsi which is the only user.
>
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 1 +
> drivers/clk/mediatek/clk-mt7986-eth.c | 2 +-
> include/dt-bindings/clock/mediatek,ethsys.h | 32 +++++++++++++++++++
A bit too generic name. Are you sure it will fit all of eth on all
Mediatek SoCs? Current and future?
> .../dt-bindings/clock/mediatek,mt7981-clk.h | 18 -----------
> .../dt-bindings/clock/mediatek,mt7986-clk.h | 22 -------------
Same problems as previous patch. You cannot mix bindings and DTS and
drivers.
Best regards,
Krzysztof
@@ -7,6 +7,7 @@
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/clock/mediatek,mt7986-clk.h>
+#include <dt-bindings/clock/mediatek,ethsys.h>
#include <dt-bindings/reset/mt7986-resets.h>
#include <dt-bindings/phy/phy.h>
#include <dt-bindings/thermal/thermal.h>
@@ -14,7 +14,7 @@
#include "clk-mtk.h"
#include "clk-gate.h"
-#include <dt-bindings/clock/mt7986-clk.h>
+#include <dt-bindings/clock/mediatek,ethsys.h>
static const struct mtk_gate_regs sgmii0_cg_regs = {
.set_ofs = 0xe4,
new file mode 100644
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) 2021 MediaTek Inc.
+ * Author: Sam Shih <sam.shih@mediatek.com>
+ */
+
+#ifndef _DT_BINDINGS_CLK_MEDIATEK_ETHSYS_H
+#define _DT_BINDINGS_CLK_MEDIATEK_ETHSYS_H
+
+/* SGMIISYS_0 */
+
+#define CLK_SGMII0_TX250M_EN 0
+#define CLK_SGMII0_RX250M_EN 1
+#define CLK_SGMII0_CDR_REF 2
+#define CLK_SGMII0_CDR_FB 3
+
+/* SGMIISYS_1 */
+
+#define CLK_SGMII1_TX250M_EN 0
+#define CLK_SGMII1_RX250M_EN 1
+#define CLK_SGMII1_CDR_REF 2
+#define CLK_SGMII1_CDR_FB 3
+
+/* ETHSYS */
+
+#define CLK_ETH_FE_EN 0
+#define CLK_ETH_GP2_EN 1
+#define CLK_ETH_GP1_EN 2
+#define CLK_ETH_WOCPU1_EN 3
+#define CLK_ETH_WOCPU0_EN 4
+
+#endif
@@ -194,22 +194,4 @@
#define CLK_APMIXED_MPLL 6
#define CLK_APMIXED_APLL2 7
-/* SGMIISYS_0 */
-#define CLK_SGM0_TX_EN 0
-#define CLK_SGM0_RX_EN 1
-#define CLK_SGM0_CK0_EN 2
-#define CLK_SGM0_CDR_CK0_EN 3
-
-/* SGMIISYS_1 */
-#define CLK_SGM1_TX_EN 0
-#define CLK_SGM1_RX_EN 1
-#define CLK_SGM1_CK1_EN 2
-#define CLK_SGM1_CDR_CK1_EN 3
-
-/* ETHSYS */
-#define CLK_ETH_FE_EN 0
-#define CLK_ETH_GP2_EN 1
-#define CLK_ETH_GP1_EN 2
-#define CLK_ETH_WOCPU0_EN 3
-
#endif /* _DT_BINDINGS_CLK_MT7981_H */
@@ -144,26 +144,4 @@
#define CLK_INFRA_IPCIEB_CK 54
#define CLK_INFRA_TRNG_CK 55
-/* SGMIISYS_0 */
-
-#define CLK_SGMII0_TX250M_EN 0
-#define CLK_SGMII0_RX250M_EN 1
-#define CLK_SGMII0_CDR_REF 2
-#define CLK_SGMII0_CDR_FB 3
-
-/* SGMIISYS_1 */
-
-#define CLK_SGMII1_TX250M_EN 0
-#define CLK_SGMII1_RX250M_EN 1
-#define CLK_SGMII1_CDR_REF 2
-#define CLK_SGMII1_CDR_FB 3
-
-/* ETHSYS */
-
-#define CLK_ETH_FE_EN 0
-#define CLK_ETH_GP2_EN 1
-#define CLK_ETH_GP1_EN 2
-#define CLK_ETH_WOCPU1_EN 3
-#define CLK_ETH_WOCPU0_EN 4
-
#endif /* _DT_BINDINGS_CLK_MT7986_H */