aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-02 13:53:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-02 13:53:38 -0400
commit66188fb11a82692629e85b6cbc3ecc08c752d2dc (patch)
treebaa7fea3bd3df098d81947c6a52fc60c923b722b
parent0c7fc30f18220c0d1b8fb2636811a0c0d0d65714 (diff)
parent6605d156bdfbb2502ba301bc4fbd8db696ae4b6d (diff)
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "Another round of fixes: - CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems - CPS: Avoid BUG() when offlining pre-r6 CPUs - DEC: Avoid gas warnings due to suspicious instruction scheduling by manually expanding assembler macros. - FTLB: Fix configuration by moving confiuguratoin after probing - FTLB: clear execution hazard after changing FTLB enable - Highmem: Fix detection of unsupported highmem with cache aliases - I6400: Don't touch FTLBP chicken bits - microMIPS: Fix BUILD_ROLLBACK_PROLOGUE - Malta: Fix IOCU disable switch read for MIPS64 - Octeon: Fix probing of devices attached to GPIO lines - uprobes: Misc small fixes" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: CM: Fix mips_cm_max_vp_width for non-MT kernels on MT systems MIPS: Fix detection of unsupported highmem with cache aliases MIPS: Malta: Fix IOCU disable switch read for MIPS64 MIPS: Fix BUILD_ROLLBACK_PROLOGUE for microMIPS MIPS: clear execution hazard after changing FTLB enable MIPS: Configure FTLB after probing TLB sizes from config4 MIPS: Stop setting I6400 FTLBP MIPS: DEC: Avoid la pseudo-instruction in delay slots MIPS: Octeon: mark GPIO controller node not populated after IRQ init. MIPS: uprobes: fix use of uninitialised variable MIPS: uprobes: remove incorrect set_orig_insn MIPS: fix uretprobe implementation MIPS: smp-cps: Avoid BUG() when offlining pre-r6 CPUs
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c6
-rw-r--r--arch/mips/dec/int-handler.S40
-rw-r--r--arch/mips/include/asm/mips-cm.h11
-rw-r--r--arch/mips/include/asm/mipsregs.h2
-rw-r--r--arch/mips/include/asm/uprobes.h1
-rw-r--r--arch/mips/kernel/cpu-probe.c53
-rw-r--r--arch/mips/kernel/genex.S3
-rw-r--r--arch/mips/kernel/setup.c2
-rw-r--r--arch/mips/kernel/smp-cps.c2
-rw-r--r--arch/mips/kernel/uprobes.c25
-rw-r--r--arch/mips/mm/init.c3
-rw-r--r--arch/mips/mti-malta/malta-setup.c8
12 files changed, 101 insertions, 55 deletions
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
index 5a9b87b7993e..c1eb1ff7c800 100644
--- a/arch/mips/cavium-octeon/octeon-irq.c
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -1619,6 +1619,12 @@ static int __init octeon_irq_init_gpio(
1619 return -ENOMEM; 1619 return -ENOMEM;
1620 } 1620 }
1621 1621
1622 /*
1623 * Clear the OF_POPULATED flag that was set by of_irq_init()
1624 * so that all GPIO devices will be probed.
1625 */
1626 of_node_clear_flag(gpio_node, OF_POPULATED);
1627
1622 return 0; 1628 return 0;
1623} 1629}
1624/* 1630/*
diff --git a/arch/mips/dec/int-handler.S b/arch/mips/dec/int-handler.S
index d7b99180c6e1..1910223a9c02 100644
--- a/arch/mips/dec/int-handler.S
+++ b/arch/mips/dec/int-handler.S
@@ -146,7 +146,25 @@
146 /* 146 /*
147 * Find irq with highest priority 147 * Find irq with highest priority
148 */ 148 */
149 PTR_LA t1,cpu_mask_nr_tbl 149 # open coded PTR_LA t1, cpu_mask_nr_tbl
150#if (_MIPS_SZPTR == 32)
151 # open coded la t1, cpu_mask_nr_tbl
152 lui t1, %hi(cpu_mask_nr_tbl)
153 addiu t1, %lo(cpu_mask_nr_tbl)
154
155#endif
156#if (_MIPS_SZPTR == 64)
157 # open coded dla t1, cpu_mask_nr_tbl
158 .set push
159 .set noat
160 lui t1, %highest(cpu_mask_nr_tbl)
161 lui AT, %hi(cpu_mask_nr_tbl)
162 daddiu t1, t1, %higher(cpu_mask_nr_tbl)
163 daddiu AT, AT, %lo(cpu_mask_nr_tbl)
164 dsll t1, 32
165 daddu t1, t1, AT
166 .set pop
167#endif
1501: lw t2,(t1) 1681: lw t2,(t1)
151 nop 169 nop
152 and t2,t0 170 and t2,t0
@@ -195,7 +213,25 @@
195 /* 213 /*
196 * Find irq with highest priority 214 * Find irq with highest priority
197 */ 215 */
198 PTR_LA t1,asic_mask_nr_tbl 216 # open coded PTR_LA t1,asic_mask_nr_tbl
217#if (_MIPS_SZPTR == 32)
218 # open coded la t1, asic_mask_nr_tbl
219 lui t1, %hi(asic_mask_nr_tbl)
220 addiu t1, %lo(asic_mask_nr_tbl)
221
222#endif
223#if (_MIPS_SZPTR == 64)
224 # open coded dla t1, asic_mask_nr_tbl
225 .set push
226 .set noat
227 lui t1, %highest(asic_mask_nr_tbl)
228 lui AT, %hi(asic_mask_nr_tbl)
229 daddiu t1, t1, %higher(asic_mask_nr_tbl)
230 daddiu AT, AT, %lo(asic_mask_nr_tbl)
231 dsll t1, 32
232 daddu t1, t1, AT
233 .set pop
234#endif
1992: lw t2,(t1) 2352: lw t2,(t1)
200 nop 236 nop
201 and t2,t0 237 and t2,t0
diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h
index 58e7874e9347..4fafeefe65c2 100644
--- a/arch/mips/include/asm/mips-cm.h
+++ b/arch/mips/include/asm/mips-cm.h
@@ -458,10 +458,21 @@ static inline int mips_cm_revision(void)
458static inline unsigned int mips_cm_max_vp_width(void) 458static inline unsigned int mips_cm_max_vp_width(void)
459{ 459{
460 extern int smp_num_siblings; 460 extern int smp_num_siblings;
461 uint32_t cfg;
461 462
462 if (mips_cm_revision() >= CM_REV_CM3) 463 if (mips_cm_revision() >= CM_REV_CM3)
463 return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK; 464 return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK;
464 465
466 if (mips_cm_present()) {
467 /*
468 * We presume that all cores in the system will have the same
469 * number of VP(E)s, and if that ever changes then this will
470 * need revisiting.
471 */
472 cfg = read_gcr_cl_config() & CM_GCR_Cx_CONFIG_PVPE_MSK;
473 return (cfg >> CM_GCR_Cx_CONFIG_PVPE_SHF) + 1;
474 }
475
465 if (IS_ENABLED(CONFIG_SMP)) 476 if (IS_ENABLED(CONFIG_SMP))
466 return smp_num_siblings; 477 return smp_num_siblings;
467 478
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index def9d8d13f6e..7dd2dd47909a 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -660,8 +660,6 @@
660 660
661#define MIPS_CONF7_IAR (_ULCAST_(1) << 10) 661#define MIPS_CONF7_IAR (_ULCAST_(1) << 10)
662#define MIPS_CONF7_AR (_ULCAST_(1) << 16) 662#define MIPS_CONF7_AR (_ULCAST_(1) << 16)
663/* FTLB probability bits for R6 */
664#define MIPS_CONF7_FTLBP_SHIFT (18)
665 663
666/* WatchLo* register definitions */ 664/* WatchLo* register definitions */
667#define MIPS_WATCHLO_IRW (_ULCAST_(0x7) << 0) 665#define MIPS_WATCHLO_IRW (_ULCAST_(0x7) << 0)
diff --git a/arch/mips/include/asm/uprobes.h b/arch/mips/include/asm/uprobes.h
index 34c325c674c4..70a4a2f173ff 100644
--- a/arch/mips/include/asm/uprobes.h
+++ b/arch/mips/include/asm/uprobes.h
@@ -36,7 +36,6 @@ struct arch_uprobe {
36 unsigned long resume_epc; 36 unsigned long resume_epc;
37 u32 insn[2]; 37 u32 insn[2];
38 u32 ixol[2]; 38 u32 ixol[2];
39 union mips_instruction orig_inst[MAX_UINSN_BYTES / 4];
40}; 39};
41 40
42struct arch_uprobe_task { 41struct arch_uprobe_task {
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index a88d44247cc8..dd3175442c9e 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -352,7 +352,12 @@ __setup("nohtw", htw_disable);
352static int mips_ftlb_disabled; 352static int mips_ftlb_disabled;
353static int mips_has_ftlb_configured; 353static int mips_has_ftlb_configured;
354 354
355static int set_ftlb_enable(struct cpuinfo_mips *c, int enable); 355enum ftlb_flags {
356 FTLB_EN = 1 << 0,
357 FTLB_SET_PROB = 1 << 1,
358};
359
360static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags);
356 361
357static int __init ftlb_disable(char *s) 362static int __init ftlb_disable(char *s)
358{ 363{
@@ -371,8 +376,6 @@ static int __init ftlb_disable(char *s)
371 return 1; 376 return 1;
372 } 377 }
373 378
374 back_to_back_c0_hazard();
375
376 config4 = read_c0_config4(); 379 config4 = read_c0_config4();
377 380
378 /* Check that FTLB has been disabled */ 381 /* Check that FTLB has been disabled */
@@ -531,7 +534,7 @@ static unsigned int calculate_ftlb_probability(struct cpuinfo_mips *c)
531 return 3; 534 return 3;
532} 535}
533 536
534static int set_ftlb_enable(struct cpuinfo_mips *c, int enable) 537static int set_ftlb_enable(struct cpuinfo_mips *c, enum ftlb_flags flags)
535{ 538{
536 unsigned int config; 539 unsigned int config;
537 540
@@ -542,33 +545,33 @@ static int set_ftlb_enable(struct cpuinfo_mips *c, int enable)
542 case CPU_P6600: 545 case CPU_P6600:
543 /* proAptiv & related cores use Config6 to enable the FTLB */ 546 /* proAptiv & related cores use Config6 to enable the FTLB */
544 config = read_c0_config6(); 547 config = read_c0_config6();
545 /* Clear the old probability value */ 548
546 config &= ~(3 << MIPS_CONF6_FTLBP_SHIFT); 549 if (flags & FTLB_EN)
547 if (enable) 550 config |= MIPS_CONF6_FTLBEN;
548 /* Enable FTLB */
549 write_c0_config6(config |
550 (calculate_ftlb_probability(c)
551 << MIPS_CONF6_FTLBP_SHIFT)
552 | MIPS_CONF6_FTLBEN);
553 else 551 else
554 /* Disable FTLB */ 552 config &= ~MIPS_CONF6_FTLBEN;
555 write_c0_config6(config & ~MIPS_CONF6_FTLBEN); 553
554 if (flags & FTLB_SET_PROB) {
555 config &= ~(3 << MIPS_CONF6_FTLBP_SHIFT);
556 config |= calculate_ftlb_probability(c)
557 << MIPS_CONF6_FTLBP_SHIFT;
558 }
559
560 write_c0_config6(config);
561 back_to_back_c0_hazard();
556 break; 562 break;
557 case CPU_I6400: 563 case CPU_I6400:
558 /* I6400 & related cores use Config7 to configure FTLB */ 564 /* There's no way to disable the FTLB */
559 config = read_c0_config7(); 565 if (!(flags & FTLB_EN))
560 /* Clear the old probability value */ 566 return 1;
561 config &= ~(3 << MIPS_CONF7_FTLBP_SHIFT); 567 return 0;
562 write_c0_config7(config | (calculate_ftlb_probability(c)
563 << MIPS_CONF7_FTLBP_SHIFT));
564 break;
565 case CPU_LOONGSON3: 568 case CPU_LOONGSON3:
566 /* Flush ITLB, DTLB, VTLB and FTLB */ 569 /* Flush ITLB, DTLB, VTLB and FTLB */
567 write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB | 570 write_c0_diag(LOONGSON_DIAG_ITLB | LOONGSON_DIAG_DTLB |
568 LOONGSON_DIAG_VTLB | LOONGSON_DIAG_FTLB); 571 LOONGSON_DIAG_VTLB | LOONGSON_DIAG_FTLB);
569 /* Loongson-3 cores use Config6 to enable the FTLB */ 572 /* Loongson-3 cores use Config6 to enable the FTLB */
570 config = read_c0_config6(); 573 config = read_c0_config6();
571 if (enable) 574 if (flags & FTLB_EN)
572 /* Enable FTLB */ 575 /* Enable FTLB */
573 write_c0_config6(config & ~MIPS_CONF6_FTLBDIS); 576 write_c0_config6(config & ~MIPS_CONF6_FTLBDIS);
574 else 577 else
@@ -788,6 +791,7 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
788 PAGE_SIZE, config4); 791 PAGE_SIZE, config4);
789 /* Switch FTLB off */ 792 /* Switch FTLB off */
790 set_ftlb_enable(c, 0); 793 set_ftlb_enable(c, 0);
794 mips_ftlb_disabled = 1;
791 break; 795 break;
792 } 796 }
793 c->tlbsizeftlbsets = 1 << 797 c->tlbsizeftlbsets = 1 <<
@@ -852,7 +856,7 @@ static void decode_configs(struct cpuinfo_mips *c)
852 c->scache.flags = MIPS_CACHE_NOT_PRESENT; 856 c->scache.flags = MIPS_CACHE_NOT_PRESENT;
853 857
854 /* Enable FTLB if present and not disabled */ 858 /* Enable FTLB if present and not disabled */
855 set_ftlb_enable(c, !mips_ftlb_disabled); 859 set_ftlb_enable(c, mips_ftlb_disabled ? 0 : FTLB_EN);
856 860
857 ok = decode_config0(c); /* Read Config registers. */ 861 ok = decode_config0(c); /* Read Config registers. */
858 BUG_ON(!ok); /* Arch spec violation! */ 862 BUG_ON(!ok); /* Arch spec violation! */
@@ -902,6 +906,9 @@ static void decode_configs(struct cpuinfo_mips *c)
902 } 906 }
903 } 907 }
904 908
909 /* configure the FTLB write probability */
910 set_ftlb_enable(c, (mips_ftlb_disabled ? 0 : FTLB_EN) | FTLB_SET_PROB);
911
905 mips_probe_watch_registers(c); 912 mips_probe_watch_registers(c);
906 913
907#ifndef CONFIG_MIPS_CPS 914#ifndef CONFIG_MIPS_CPS
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 17326a90d53c..dc0b29612891 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -142,9 +142,8 @@ LEAF(__r4k_wait)
142 PTR_LA k1, __r4k_wait 142 PTR_LA k1, __r4k_wait
143 ori k0, 0x1f /* 32 byte rollback region */ 143 ori k0, 0x1f /* 32 byte rollback region */
144 xori k0, 0x1f 144 xori k0, 0x1f
145 bne k0, k1, 9f 145 bne k0, k1, \handler
146 MTC0 k0, CP0_EPC 146 MTC0 k0, CP0_EPC
1479:
148 .set pop 147 .set pop
149 .endm 148 .endm
150 149
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 3be0e6ba2797..0d57909d9026 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -764,7 +764,6 @@ static void __init arch_mem_init(char **cmdline_p)
764 device_tree_init(); 764 device_tree_init();
765 sparse_init(); 765 sparse_init();
766 plat_swiotlb_setup(); 766 plat_swiotlb_setup();
767 paging_init();
768 767
769 dma_contiguous_reserve(PFN_PHYS(max_low_pfn)); 768 dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
770 /* Tell bootmem about cma reserved memblock section */ 769 /* Tell bootmem about cma reserved memblock section */
@@ -877,6 +876,7 @@ void __init setup_arch(char **cmdline_p)
877 prefill_possible_map(); 876 prefill_possible_map();
878 877
879 cpu_cache_init(); 878 cpu_cache_init();
879 paging_init();
880} 880}
881 881
882unsigned long kernelsp[NR_CPUS]; 882unsigned long kernelsp[NR_CPUS];
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index e9d9fc6c754c..6183ad84cc73 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -513,7 +513,7 @@ static void cps_cpu_die(unsigned int cpu)
513 * in which case the CPC will refuse to power down the core. 513 * in which case the CPC will refuse to power down the core.
514 */ 514 */
515 do { 515 do {
516 mips_cm_lock_other(core, vpe_id); 516 mips_cm_lock_other(core, 0);
517 mips_cpc_lock_other(core); 517 mips_cpc_lock_other(core);
518 stat = read_cpc_co_stat_conf(); 518 stat = read_cpc_co_stat_conf();
519 stat &= CPC_Cx_STAT_CONF_SEQSTATE_MSK; 519 stat &= CPC_Cx_STAT_CONF_SEQSTATE_MSK;
diff --git a/arch/mips/kernel/uprobes.c b/arch/mips/kernel/uprobes.c
index 1149b30c9aeb..4c7c1558944a 100644
--- a/arch/mips/kernel/uprobes.c
+++ b/arch/mips/kernel/uprobes.c
@@ -157,7 +157,6 @@ bool is_trap_insn(uprobe_opcode_t *insn)
157int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs) 157int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs)
158{ 158{
159 struct uprobe_task *utask = current->utask; 159 struct uprobe_task *utask = current->utask;
160 union mips_instruction insn;
161 160
162 /* 161 /*
163 * Now find the EPC where to resume after the breakpoint has been 162 * Now find the EPC where to resume after the breakpoint has been
@@ -168,10 +167,10 @@ int arch_uprobe_pre_xol(struct arch_uprobe *aup, struct pt_regs *regs)
168 unsigned long epc; 167 unsigned long epc;
169 168
170 epc = regs->cp0_epc; 169 epc = regs->cp0_epc;
171 __compute_return_epc_for_insn(regs, insn); 170 __compute_return_epc_for_insn(regs,
171 (union mips_instruction) aup->insn[0]);
172 aup->resume_epc = regs->cp0_epc; 172 aup->resume_epc = regs->cp0_epc;
173 } 173 }
174
175 utask->autask.saved_trap_nr = current->thread.trap_nr; 174 utask->autask.saved_trap_nr = current->thread.trap_nr;
176 current->thread.trap_nr = UPROBE_TRAP_NR; 175 current->thread.trap_nr = UPROBE_TRAP_NR;
177 regs->cp0_epc = current->utask->xol_vaddr; 176 regs->cp0_epc = current->utask->xol_vaddr;
@@ -257,7 +256,7 @@ unsigned long arch_uretprobe_hijack_return_addr(
257 ra = regs->regs[31]; 256 ra = regs->regs[31];
258 257
259 /* Replace the return address with the trampoline address */ 258 /* Replace the return address with the trampoline address */
260 regs->regs[31] = ra; 259 regs->regs[31] = trampoline_vaddr;
261 260
262 return ra; 261 return ra;
263} 262}
@@ -280,24 +279,6 @@ int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm,
280 return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN); 279 return uprobe_write_opcode(mm, vaddr, UPROBE_SWBP_INSN);
281} 280}
282 281
283/**
284 * set_orig_insn - Restore the original instruction.
285 * @mm: the probed process address space.
286 * @auprobe: arch specific probepoint information.
287 * @vaddr: the virtual address to insert the opcode.
288 *
289 * For mm @mm, restore the original opcode (opcode) at @vaddr.
290 * Return 0 (success) or a negative errno.
291 *
292 * This overrides the weak version in kernel/events/uprobes.c.
293 */
294int set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm,
295 unsigned long vaddr)
296{
297 return uprobe_write_opcode(mm, vaddr,
298 *(uprobe_opcode_t *)&auprobe->orig_inst[0].word);
299}
300
301void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, 282void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr,
302 void *src, unsigned long len) 283 void *src, unsigned long len)
303{ 284{
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 2c3749d98f04..72f7478ee068 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -440,6 +440,9 @@ static inline void mem_init_free_highmem(void)
440#ifdef CONFIG_HIGHMEM 440#ifdef CONFIG_HIGHMEM
441 unsigned long tmp; 441 unsigned long tmp;
442 442
443 if (cpu_has_dc_aliases)
444 return;
445
443 for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) { 446 for (tmp = highstart_pfn; tmp < highend_pfn; tmp++) {
444 struct page *page = pfn_to_page(tmp); 447 struct page *page = pfn_to_page(tmp);
445 448
diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c
index ec5b21678fad..7e7364b0501e 100644
--- a/arch/mips/mti-malta/malta-setup.c
+++ b/arch/mips/mti-malta/malta-setup.c
@@ -39,6 +39,9 @@
39#include <linux/console.h> 39#include <linux/console.h>
40#endif 40#endif
41 41
42#define ROCIT_CONFIG_GEN0 0x1f403000
43#define ROCIT_CONFIG_GEN0_PCI_IOCU BIT(7)
44
42extern void malta_be_init(void); 45extern void malta_be_init(void);
43extern int malta_be_handler(struct pt_regs *regs, int is_fixup); 46extern int malta_be_handler(struct pt_regs *regs, int is_fixup);
44 47
@@ -107,6 +110,8 @@ static void __init fd_activate(void)
107static int __init plat_enable_iocoherency(void) 110static int __init plat_enable_iocoherency(void)
108{ 111{
109 int supported = 0; 112 int supported = 0;
113 u32 cfg;
114
110 if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) { 115 if (mips_revision_sconid == MIPS_REVISION_SCON_BONITO) {
111 if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) { 116 if (BONITO_PCICACHECTRL & BONITO_PCICACHECTRL_CPUCOH_PRES) {
112 BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN; 117 BONITO_PCICACHECTRL |= BONITO_PCICACHECTRL_CPUCOH_EN;
@@ -129,7 +134,8 @@ static int __init plat_enable_iocoherency(void)
129 } else if (mips_cm_numiocu() != 0) { 134 } else if (mips_cm_numiocu() != 0) {
130 /* Nothing special needs to be done to enable coherency */ 135 /* Nothing special needs to be done to enable coherency */
131 pr_info("CMP IOCU detected\n"); 136 pr_info("CMP IOCU detected\n");
132 if ((*(unsigned int *)0xbf403000 & 0x81) != 0x81) { 137 cfg = __raw_readl((u32 *)CKSEG1ADDR(ROCIT_CONFIG_GEN0));
138 if (!(cfg & ROCIT_CONFIG_GEN0_PCI_IOCU)) {
133 pr_crit("IOCU OPERATION DISABLED BY SWITCH - DEFAULTING TO SW IO COHERENCY\n"); 139 pr_crit("IOCU OPERATION DISABLED BY SWITCH - DEFAULTING TO SW IO COHERENCY\n");
134 return 0; 140 return 0;
135 } 141 }