Skip to contentSkip to conversation

arm: bcm281xx: Add Ethernet Clock support

PATCH Superseded Steve Rae 1 participant 1 message Jul 25, 2014

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Steve Rae

author
#0 lore raw

PATCH 1/1 arm: bcm281xx: Add Ethernet Clock support

From: Jiandong Zheng <[email protected]>

Enable Ethernet clock when Broadcom StarFighter2 Ethernet block (CONFIG_BCM_SF2_ETH) is enabled.

---
- added board with this feature enabled

 arch/arm/cpu/armv7/bcm281xx/Makefile        |   1 +
 arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c  |  34 +++++++
 arch/arm/cpu/armv7/bcm281xx/clk-eth.c       | 143 ++++++++++++++++++++++++++++
 arch/arm/include/asm/arch-bcm281xx/sysmap.h |   3 +
 boards.cfg                                  |   1 +
 5 files changed, 182 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/bcm281xx/clk-eth.c
arch/arm/cpu/armv7/bcm281xx/Makefile +1 -0
index 98f5aa5..bd867a2 100644
@@ -9,3 +9,4 @@ obj-y	+= clk-core.o
 obj-y	+= clk-bcm281xx.o
 obj-y	+= clk-sdio.o
 obj-y	+= clk-bsc.o
+obj-$(CONFIG_BCM_SF2_ETH) += clk-eth.o
arch/arm/cpu/armv7/bcm281xx/clk-bcm281xx.c +34 -0
index bc8a170..d16b99f 100644
@@ -118,6 +118,16 @@ unsigned long slave_apb_freq_tbl[8] = {
 	78 * CLOCK_1M
 };
 
+unsigned long esub_freq_tbl[8] = {
+	78 * CLOCK_1M,
+	156 * CLOCK_1M,
+	156 * CLOCK_1M,
+	156 * CLOCK_1M,
+	208 * CLOCK_1M,
+	208 * CLOCK_1M,
+	208 * CLOCK_1M
+};
+
 static struct bus_clk_data bsc1_apb_data = {
 	.gate = HW_SW_GATE_AUTO(0x0458, 16, 0, 1),
 };
@@ -295,6 +305,27 @@ static struct ccu_clock kps_ccu_clk = {
 	.freq_tbl = slave_axi_freq_tbl,
 };
 
+#ifdef CONFIG_BCM_SF2_ETH
+static struct ccu_clock esub_ccu_clk = {
+	.clk = {
+		.name = "esub_ccu_clk",
+		.ops = &ccu_clk_ops,
+		.ccu_clk_mgr_base = ESUB_CLK_BASE_ADDR,
+	},
+	.num_policy_masks = 1,
+	.policy_freq_offset = 0x00000008,
+	.freq_bit_shift = 8,
+	.policy_ctl_offset = 0x0000000c,
+	.policy0_mask_offset = 0x00000010,
+	.policy1_mask_offset = 0x00000014,
+	.policy2_mask_offset = 0x00000018,
+	.policy3_mask_offset = 0x0000001c,
+	.lvm_en_offset = 0x00000034,
+	.freq_id = 2,
+	.freq_tbl = esub_freq_tbl,
+};
+#endif
+
 /*
  * Bus clocks
  */
@@ -517,6 +548,9 @@ struct clk_lookup arch_clk_tbl[] = {
 	CLK_LK(bsc1_apb),
 	CLK_LK(bsc2_apb),
 	CLK_LK(bsc3_apb),
+#ifdef CONFIG_BCM_SF2_ETH
+	CLK_LK(esub_ccu),
+#endif
 };
 
 /* public array size */
arch/arm/cpu/armv7/bcm281xx/clk-eth.c new file +143 -0

143 lines not on this page · raw message

arch/arm/include/asm/arch-bcm281xx/sysmap.h +3 -0
index 880b4e0..350e7f6 100644
@@ -9,6 +9,9 @@
 #define BSC1_BASE_ADDR		0x3e016000
 #define BSC2_BASE_ADDR		0x3e017000
 #define BSC3_BASE_ADDR		0x3e018000
+#define DWDMA_AHB_BASE_ADDR	0x38100000
+#define ESUB_CLK_BASE_ADDR	0x38000000
+#define ESW_CONTRL_BASE_ADDR	0x38200000
 #define GPIO2_BASE_ADDR		0x35003000
 #define KONA_MST_CLK_BASE_ADDR	0x3f001000
 #define KONA_SLV_CLK_BASE_ADDR	0x3e011000
boards.cfg +1 -0
index 4b2bc19..d5427df 100644
@@ -289,6 +289,7 @@ Active  arm         armv7          at91        atmel           sama5d3xek
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_nandflash                  sama5d3xek:SAMA5D3,SYS_USE_NANDFLASH                                                                                              Bo Shen <[email protected]>
 Active  arm         armv7          at91        atmel           sama5d3xek          sama5d3xek_spiflash                   sama5d3xek:SAMA5D3,SYS_USE_SERIALFLASH                                                                                            Bo Shen <[email protected]>
 Active  arm         armv7          bcm281xx    broadcom        bcm28155_ap         bcm28155_ap                           bcm28155_ap                                                                                                                       Tim Kryger <[email protected]>
+Active  arm         armv7          bcm281xx    broadcom        bcm28155_ap         bcm28155_w1d                          bcm28155_ap:BCM_SF2_ETH                                                                                                           Steve Rae <[email protected]>
 Active  arm         armv7          exynos      samsung         arndale             arndale                               -                                                                                                                                 Inderpal Singh <[email protected]>
 Active  arm         armv7          exynos      samsung         origen              origen                                -                                                                                                                                 Chander Kashyap <[email protected]>
 Active  arm         armv7          exynos      samsung         smdk5250            smdk5250                              -                                                                                                                                 Chander Kashyap <[email protected]>
Signature · 1 line
1.8.5