linux-mips
[Top] [All Lists]

[PATCH] MIPS: BCM63XX: fix BCM6345 clocks bits

To: ralf@linux-mips.org
Subject: [PATCH] MIPS: BCM63XX: fix BCM6345 clocks bits
From: Florian Fainelli <florian@openwrt.org>
Date: Mon, 12 Nov 2012 10:48:45 +0100
Cc: blogic@openwrt.org, linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Sender: linux-mips-bounce@linux-mips.org
BCM6345 has an intermediate 16-bits wide test control register between the
peripheral identifier register, and its clock control register is only 16-bits
wide contrary to other platforms where it is 32-bits wide. By shifting all
clocks bits by 16-bits to the left we ensure they get written to the proper
clock control register, without adding specific BCM6345 handling in the clock
code.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
There is nothing currently using BCM6345 clocks, so this is not 3.7-rc
material, but 3.8.

 arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h 
b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
index 12963d0..57597ee 100644
--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
+++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h
@@ -53,13 +53,18 @@
                                        CKCTL_6338_SAR_EN |             \
                                        CKCTL_6338_SPI_EN)
 
-#define CKCTL_6345_CPU_EN              (1 << 0)
-#define CKCTL_6345_BUS_EN              (1 << 1)
-#define CKCTL_6345_EBI_EN              (1 << 2)
-#define CKCTL_6345_UART_EN             (1 << 3)
-#define CKCTL_6345_ADSLPHY_EN          (1 << 4)
-#define CKCTL_6345_ENET_EN             (1 << 7)
-#define CKCTL_6345_USBH_EN             (1 << 8)
+/* BCM6345 clock bits are shifted by 16 on the left, because of the test
+ * control register which is 16-bits wide. That way we do not have any
+ * specific BCM6345 code for handling clocks, and writing 0 to the test
+ * control register is fine.
+ */
+#define CKCTL_6345_CPU_EN              (1 << 16)
+#define CKCTL_6345_BUS_EN              (1 << 17)
+#define CKCTL_6345_EBI_EN              (1 << 18)
+#define CKCTL_6345_UART_EN             (1 << 19)
+#define CKCTL_6345_ADSLPHY_EN          (1 << 20)
+#define CKCTL_6345_ENET_EN             (1 << 23)
+#define CKCTL_6345_USBH_EN             (1 << 24)
 
 #define CKCTL_6345_ALL_SAFE_EN         (CKCTL_6345_ENET_EN |   \
                                        CKCTL_6345_USBH_EN |    \
-- 
1.7.10.4


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] MIPS: BCM63XX: fix BCM6345 clocks bits, Florian Fainelli <=