]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
MIPS: Netlogic: Use PRID_IMP_MASK macro
authorJayachandran C <jchandra@broadcom.com>
Tue, 29 Apr 2014 14:37:49 +0000 (20:07 +0530)
committerRalf Baechle <ralf@linux-mips.org>
Fri, 30 May 2014 14:49:02 +0000 (16:49 +0200)
Use PRID_IMP_MASK macro instead of 0xff00 to extract the processor
type.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6868/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/netlogic/mips-extns.h
arch/mips/include/asm/netlogic/xlp-hal/xlp.h
arch/mips/netlogic/common/reset.S
arch/mips/netlogic/xlp/dt.c
arch/mips/netlogic/xlp/setup.c
arch/mips/netlogic/xlp/wakeup.c

index de9aada6f4c1cbd6f0bee1997f7e1744694b04f2..38af905bf07ed2cc8109c15da310510bb98befd9 100644 (file)
@@ -146,9 +146,9 @@ static inline int hard_smp_processor_id(void)
 
 static inline int nlm_nodeid(void)
 {
-       uint32_t prid = read_c0_prid();
+       uint32_t prid = read_c0_prid() & PRID_IMP_MASK;
 
-       if ((prid & 0xff00) == PRID_IMP_NETLOGIC_XLP9XX)
+       if (prid == PRID_IMP_NETLOGIC_XLP9XX)
                return (__read_32bit_c0_register($15, 1) >> 7) & 0x7;
        else
                return (__read_32bit_c0_register($15, 1) >> 5) & 0x3;
index bd7dda096506cf4e45746dba95edac076fed13b8..a11b289956e6483ffb38646f727b7e8ed31fe261 100644 (file)
@@ -99,7 +99,7 @@ void *xlp_dt_init(void *fdtp);
 
 static inline int cpu_is_xlpii(void)
 {
-       int chip = read_c0_prid() & 0xff00;
+       int chip = read_c0_prid() & PRID_IMP_MASK;
 
        return chip == PRID_IMP_NETLOGIC_XLP2XX ||
                chip == PRID_IMP_NETLOGIC_XLP9XX;
@@ -107,7 +107,7 @@ static inline int cpu_is_xlpii(void)
 
 static inline int cpu_is_xlp9xx(void)
 {
-       int chip = read_c0_prid() & 0xff00;
+       int chip = read_c0_prid() & PRID_IMP_MASK;
 
        return chip == PRID_IMP_NETLOGIC_XLP9XX;
 }
index 13c1bc5b5988f05f303423fdf35fb3248a973f7e..5b60b469da156cf2c04b1d00821a800b8df22311 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <asm/asm.h>
 #include <asm/asm-offsets.h>
+#include <asm/cpu.h>
 #include <asm/cacheops.h>
 #include <asm/regdef.h>
 #include <asm/mipsregs.h>
@@ -92,7 +93,7 @@
  */
 .macro xlp_flush_l1_dcache
        mfc0    t0, CP0_EBASE, 0
-       andi    t0, t0, 0xff00
+       andi    t0, t0, PRID_IMP_MASK
        slt     t1, t0, 0x1200
        beqz    t1, 15f
        nop
@@ -171,7 +172,7 @@ FEXPORT(nlm_reset_entry)
 
 1:     /* Entry point on core wakeup */
        mfc0    t0, CP0_EBASE, 0        /* processor ID */
-       andi    t0, 0xff00
+       andi    t0, PRID_IMP_MASK
        li      t1, 0x1500              /* XLP 9xx */
        beq     t0, t1, 2f              /* does not need to set coherent */
        nop
index 5754097b9cde83d5a57ab86c67eda7ee0c35e528..0b36ac80a232ede16c11061877ab2f12b5dc85c7 100644 (file)
@@ -48,7 +48,7 @@ static void *xlp_fdt_blob;
 void __init *xlp_dt_init(void *fdtp)
 {
        if (!fdtp) {
-               switch (current_cpu_data.processor_id & 0xff00) {
+               switch (current_cpu_data.processor_id & PRID_IMP_MASK) {
 #ifdef CONFIG_DT_XLP_GVP
                case PRID_IMP_NETLOGIC_XLP9XX:
                        fdtp = __dtb_xlp_gvp_begin;
index 8c60a2dd9ef6bd5f2d86cd786b7c8c5e31627fe7..1ddb62bd354b767ec1a8e4a929db707a4d48d217 100644 (file)
@@ -121,7 +121,7 @@ void __init plat_mem_setup(void)
 
 const char *get_system_type(void)
 {
-       switch (read_c0_prid() & 0xff00) {
+       switch (read_c0_prid() & PRID_IMP_MASK) {
        case PRID_IMP_NETLOGIC_XLP9XX:
        case PRID_IMP_NETLOGIC_XLP2XX:
                return "Broadcom XLPII Series";
index 7589238658865d4f5f62c79aa806aa6df8e4110e..f4823ad6145fbb66782a3316a7091b23b8cc5cb2 100644 (file)
@@ -139,7 +139,7 @@ static void xlp_enable_secondary_cores(const cpumask_t *wakeup_mask)
                } else {
                        fusemask = nlm_read_sys_reg(nodep->sysbase,
                                                SYS_EFUSE_DEVICE_CFG_STATUS0);
-                       switch (read_c0_prid() & 0xff00) {
+                       switch (read_c0_prid() & PRID_IMP_MASK) {
                        case PRID_IMP_NETLOGIC_XLP3XX:
                                mask = 0xf;
                                break;