]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: actions: Add Ethernet clocks
authorAmit Singh Tomar <amittomer25@gmail.com>
Sat, 9 May 2020 14:25:09 +0000 (19:55 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 7 Jul 2020 20:09:22 +0000 (16:09 -0400)
This commit adds clocks needed for ethernet operations for
Actions OWL family of SoCs (S700 and S900).

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
arch/arm/include/asm/arch-owl/regs_s700.h
arch/arm/include/asm/arch-owl/regs_s900.h
drivers/clk/owl/clk_owl.c
drivers/clk/owl/clk_owl.h

index 2f21c15cca8c170e59e90e1f4bb8495b9ef66d0d..90459ae95eeba39e6edd2e3129e40f67bd7b1bb1 100644 (file)
@@ -53,4 +53,6 @@
 #define CMU_CVBSPLL            0x00B8
 #define CMU_SSTSCLK            0x00C0
 
+#define CMU_DEVCLKEN1_ETH      BIT(23)
+
 #endif
index 9e9106ddaab9e121fa0a367495e91e3922e1e48d..084bc9b8c3fb9c13931daa68350fdf73cd6c7fb5 100644 (file)
@@ -61,4 +61,8 @@
 #define CMU_TVOUTPLLDEBUG0                     (0x00EC)
 #define CMU_TVOUTPLLDEBUG1                     (0x00FC)
 
+#define CMU_DEVCLKEN1_ETH                      BIT(22)
+#define CLK_ETHERNET                           CLK_ETH_MAC
+#define CMU_ETHERNETPLL                                CMU_ASSISTPLL
+
 #endif
index 9715fce162157bbd5c21dd7bb094fde819ba5e0c..1999c87a336059aa6033d860c5d10420a8a4ea7d 100644 (file)
@@ -87,6 +87,11 @@ int owl_clk_enable(struct clk *clk)
                /* Enable UART3 interface clock */
                setbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_UART3);
                break;
+       case CLK_RMII_REF:
+       case CLK_ETHERNET:
+               setbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_ETH);
+               setbits_le32(priv->base + CMU_ETHERNETPLL, 5);
+               break;
        default:
                return -EINVAL;
        }
@@ -112,6 +117,10 @@ int owl_clk_disable(struct clk *clk)
                /* Disable UART3 interface clock */
                clrbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_UART3);
                break;
+       case CLK_RMII_REF:
+       case CLK_ETHERNET:
+               clrbits_le32(priv->base + CMU_DEVCLKEN1, CMU_DEVCLKEN1_ETH);
+               break;
        default:
                return -EINVAL;
        }
index cf896bdb98e4d4c87bc6f6cb1e95d3ce0bd0724d..a01f81a6a7bee7bff7fb05b65b06c6eff3c74693 100644 (file)
@@ -62,6 +62,4 @@ struct owl_clk_priv {
 #define CMU_DEVCLKEN1_UART5    BIT(21)
 #define CMU_DEVCLKEN1_UART3    BIT(11)
 
-#define CMU_DEVCLKEN1_ETH_S700 BIT(23)
-
 #endif