Add macros for gmac clock control, instead of using raw values.
Also add comment noting GMAC ahb gate is in second gate register,
to avoid confusion over same offset as EMAC.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
---
 arch/arm/include/asm/arch-sunxi/clock.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/include/asm/arch-sunxi/clock.h 
b/arch/arm/include/asm/arch-sunxi/clock.h
index b4e540e..b39de3a 100644
--- a/arch/arm/include/asm/arch-sunxi/clock.h
+++ b/arch/arm/include/asm/arch-sunxi/clock.h
@@ -172,6 +172,8 @@ struct sunxi_ccm_reg {
 #define AHB_GATE_OFFSET_USB_OHCI0      2
 #define AHB_GATE_OFFSET_USB_EHCI0      1
 #define AHB_GATE_OFFSET_USB            0
+
+/* ahb clock gate bit offset (second register) */
 #define AHB_GATE_OFFSET_GMAC           17
 
 #define CCM_AHB_GATE_GPS (0x1 << 26)
@@ -223,6 +225,12 @@ struct sunxi_ccm_reg {
 #define CCM_MBUS_CTRL_CLK_SRC_PLL5 0x2
 #define CCM_MBUS_CTRL_GATE (0x1 << 31)
 
+#define CCM_GMAC_CTRL_TX_CLK_SRC_MII 0x0
+#define CCM_GMAC_CTRL_TX_CLK_SRC_EXT_RGMII 0x1
+#define CCM_GMAC_CTRL_TX_CLK_SRC_INT_RGMII 0x2
+#define CCM_GMAC_CTRL_GPIT_MII (0x0 << 2)
+#define CCM_GMAC_CTRL_GPIT_RGMII (0x1 << 2)
+
 
 #ifndef __ASSEMBLY__
 int clock_init(void);
-- 
1.8.5.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to