MIPS: BCM63xx: Enable second core SMP on BCM6328 if available
authorJonas Gorski <jogo@openwrt.org>
Tue, 18 Jun 2013 08:34:32 +0000 (08:34 +0000)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 1 Jul 2013 13:10:59 +0000 (15:10 +0200)
BCM6328 has a OTP which tells us if the second core is available.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: John Crispin <blogic@openwrt.org>
Cc: Maxime Bizon <mbizon@freebox.fr>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Kevin Cernekee <cernekee@gmail.com>
Patchwork: https://patchwork.linux-mips.org/patch/5490/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/bcm63xx/prom.c
arch/mips/include/asm/mach-bcm63xx/bcm63xx_cpu.h
arch/mips/include/asm/mach-bcm63xx/bcm63xx_regs.h

index 3b21454c56a05d980599c6354e3af28851b51bfc..8ac4e095e68e24b2ba3b43ba8ecc4d07e298557e 100644 (file)
@@ -69,7 +69,11 @@ void __init prom_init(void)
                 * for now.
                 */
                if (BCMCPU_IS_6328()) {
-                       bmips_smp_enabled = 0;
+                       reg = bcm_readl(BCM_6328_OTP_BASE +
+                                       OTP_USER_BITS_6328_REG(3));
+
+                       if (reg & OTP_6328_REG3_TP1_DISABLED)
+                               bmips_smp_enabled = 0;
                } else if (BCMCPU_IS_6358()) {
                        bmips_smp_enabled = 0;
                }
index 9d3c08e4a7e4ee9f1524650e72315fd14c6a791b..22390a2a066175f20c1f5a99b94bcd9951571625 100644 (file)
@@ -296,6 +296,8 @@ enum bcm63xx_regs_set {
 #define BCM_6328_PCMDMAS_BASE          (0xdeadbeef)
 #define BCM_6328_RNG_BASE              (0xdeadbeef)
 #define BCM_6328_MISC_BASE             (0xb0001800)
+#define BCM_6328_OTP_BASE              (0xb0000600)
+
 /*
  * 6338 register sets base address
  */
index 654213746b32eacb354c357f75d513832cbe8c15..018628fe6f15723ce0434fd63b3c4bfe52e4cff4 100644 (file)
 
 #define PCIE_DEVICE_OFFSET             0x8000
 
+/*************************************************************************
+ * _REG relative to RSET_OTP
+ *************************************************************************/
+
+#define OTP_USER_BITS_6328_REG(i)      (0x20 + (i) * 4)
+#define   OTP_6328_REG3_TP1_DISABLED   BIT(9)
+
 #endif /* BCM63XX_REGS_H_ */