Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge remote-tracking branch 'scott/next' into next

Scott writes:

Highlights include e6500 hardware threading support, an e6500 TLB erratum
workaround, corenet error reporting, support for a new board, and some
minor fixes.

+717 -35
+16
Documentation/devicetree/bindings/powerpc/fsl/board.txt
··· 84 84 compatible = "fsl,bsc9132qds-fpga", "fsl,fpga-qixis-i2c"; 85 85 reg = <0x66>; 86 86 }; 87 + 88 + * Freescale on-board CPLD 89 + 90 + Some Freescale boards like T1040RDB have an on board CPLD connected. 91 + 92 + Required properties: 93 + - compatible: Should be a board-specific string like "fsl,<board>-cpld" 94 + Example: 95 + "fsl,t1040rdb-cpld", "fsl,t1042rdb-cpld", "fsl,t1042rdb_pi-cpld" 96 + - reg: should describe CPLD registers 97 + 98 + Example: 99 + cpld@3,0 { 100 + compatible = "fsl,t1040rdb-cpld"; 101 + reg = <3 0 0x300>; 102 + };
+57
arch/powerpc/boot/dts/t2080rdb.dts
··· 1 + /* 2 + * T2080PCIe-RDB Board Device Tree Source 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /include/ "fsl/t208xsi-pre.dtsi" 36 + /include/ "t208xrdb.dtsi" 37 + 38 + / { 39 + model = "fsl,T2080RDB"; 40 + compatible = "fsl,T2080RDB"; 41 + #address-cells = <2>; 42 + #size-cells = <2>; 43 + interrupt-parent = <&mpic>; 44 + 45 + rio: rapidio@ffe0c0000 { 46 + reg = <0xf 0xfe0c0000 0 0x11000>; 47 + 48 + port1 { 49 + ranges = <0 0 0xc 0x20000000 0 0x10000000>; 50 + }; 51 + port2 { 52 + ranges = <0 0 0xc 0x30000000 0 0x10000000>; 53 + }; 54 + }; 55 + }; 56 + 57 + /include/ "fsl/t2080si-post.dtsi"
+184
arch/powerpc/boot/dts/t208xrdb.dtsi
··· 1 + /* 2 + * T2080PCIe-RDB Board Device Tree Source 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + / { 36 + model = "fsl,T2080RDB"; 37 + compatible = "fsl,T2080RDB"; 38 + #address-cells = <2>; 39 + #size-cells = <2>; 40 + interrupt-parent = <&mpic>; 41 + 42 + ifc: localbus@ffe124000 { 43 + reg = <0xf 0xfe124000 0 0x2000>; 44 + ranges = <0 0 0xf 0xe8000000 0x08000000 45 + 2 0 0xf 0xff800000 0x00010000 46 + 3 0 0xf 0xffdf0000 0x00008000>; 47 + 48 + nor@0,0 { 49 + #address-cells = <1>; 50 + #size-cells = <1>; 51 + compatible = "cfi-flash"; 52 + reg = <0x0 0x0 0x8000000>; 53 + 54 + bank-width = <2>; 55 + device-width = <1>; 56 + }; 57 + 58 + nand@1,0 { 59 + #address-cells = <1>; 60 + #size-cells = <1>; 61 + compatible = "fsl,ifc-nand"; 62 + reg = <0x2 0x0 0x10000>; 63 + }; 64 + 65 + boardctrl: board-control@2,0 { 66 + #address-cells = <1>; 67 + #size-cells = <1>; 68 + compatible = "fsl,t2080-cpld"; 69 + reg = <3 0 0x300>; 70 + ranges = <0 3 0 0x300>; 71 + }; 72 + }; 73 + 74 + memory { 75 + device_type = "memory"; 76 + }; 77 + 78 + dcsr: dcsr@f00000000 { 79 + ranges = <0x00000000 0xf 0x00000000 0x01072000>; 80 + }; 81 + 82 + soc: soc@ffe000000 { 83 + ranges = <0x00000000 0xf 0xfe000000 0x1000000>; 84 + reg = <0xf 0xfe000000 0 0x00001000>; 85 + spi@110000 { 86 + flash@0 { 87 + #address-cells = <1>; 88 + #size-cells = <1>; 89 + compatible = "micron,n25q512a"; 90 + reg = <0>; 91 + spi-max-frequency = <10000000>; /* input clock */ 92 + }; 93 + }; 94 + 95 + i2c@118000 { 96 + adt7481@4c { 97 + compatible = "adi,adt7481"; 98 + reg = <0x4c>; 99 + }; 100 + 101 + rtc@68 { 102 + compatible = "dallas,ds1339"; 103 + reg = <0x68>; 104 + interrupts = <0x1 0x1 0 0>; 105 + }; 106 + 107 + eeprom@50 { 108 + compatible = "atmel,24c256"; 109 + reg = <0x50>; 110 + }; 111 + }; 112 + 113 + i2c@118100 { 114 + pca9546@77 { 115 + compatible = "nxp,pca9546"; 116 + reg = <0x77>; 117 + }; 118 + }; 119 + 120 + sdhc@114000 { 121 + voltage-ranges = <1800 1800 3300 3300>; 122 + }; 123 + }; 124 + 125 + pci0: pcie@ffe240000 { 126 + reg = <0xf 0xfe240000 0 0x10000>; 127 + ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 128 + 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 129 + pcie@0 { 130 + ranges = <0x02000000 0 0xe0000000 131 + 0x02000000 0 0xe0000000 132 + 0 0x20000000 133 + 134 + 0x01000000 0 0x00000000 135 + 0x01000000 0 0x00000000 136 + 0 0x00010000>; 137 + }; 138 + }; 139 + 140 + pci1: pcie@ffe250000 { 141 + reg = <0xf 0xfe250000 0 0x10000>; 142 + ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x10000000 143 + 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 144 + pcie@0 { 145 + ranges = <0x02000000 0 0xe0000000 146 + 0x02000000 0 0xe0000000 147 + 0 0x20000000 148 + 149 + 0x01000000 0 0x00000000 150 + 0x01000000 0 0x00000000 151 + 0 0x00010000>; 152 + }; 153 + }; 154 + 155 + pci2: pcie@ffe260000 { 156 + reg = <0xf 0xfe260000 0 0x1000>; 157 + ranges = <0x02000000 0 0xe0000000 0xc 0x30000000 0 0x10000000 158 + 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; 159 + pcie@0 { 160 + ranges = <0x02000000 0 0xe0000000 161 + 0x02000000 0 0xe0000000 162 + 0 0x20000000 163 + 164 + 0x01000000 0 0x00000000 165 + 0x01000000 0 0x00000000 166 + 0 0x00010000>; 167 + }; 168 + }; 169 + 170 + pci3: pcie@ffe270000 { 171 + reg = <0xf 0xfe270000 0 0x10000>; 172 + ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x10000000 173 + 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; 174 + pcie@0 { 175 + ranges = <0x02000000 0 0xe0000000 176 + 0x02000000 0 0xe0000000 177 + 0 0x20000000 178 + 179 + 0x01000000 0 0x00000000 180 + 0x01000000 0 0x00000000 181 + 0 0x00010000>; 182 + }; 183 + }; 184 + };
+1
arch/powerpc/configs/corenet32_smp_defconfig
··· 180 180 CONFIG_CRYPTO_AES=y 181 181 # CONFIG_CRYPTO_ANSI_CPRNG is not set 182 182 CONFIG_CRYPTO_DEV_FSL_CAAM=y 183 + CONFIG_FSL_CORENET_CF=y
+1
arch/powerpc/configs/corenet64_smp_defconfig
··· 179 179 CONFIG_CRYPTO_SHA512=y 180 180 # CONFIG_CRYPTO_ANSI_CPRNG is not set 181 181 CONFIG_CRYPTO_DEV_FSL_CAAM=y 182 + CONFIG_FSL_CORENET_CF=y
+1 -1
arch/powerpc/include/asm/cputable.h
··· 391 391 CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \ 392 392 CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 393 393 CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ 394 - CPU_FTR_CELL_TB_BUG) 394 + CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT) 395 395 #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 396 396 397 397 /* 64-bit CPUs */
+9
arch/powerpc/include/asm/ppc-opcode.h
··· 150 150 #define PPC_INST_MCRXR_MASK 0xfc0007fe 151 151 #define PPC_INST_MFSPR_PVR 0x7c1f42a6 152 152 #define PPC_INST_MFSPR_PVR_MASK 0xfc1fffff 153 + #define PPC_INST_MFTMR 0x7c0002dc 153 154 #define PPC_INST_MSGSND 0x7c00019c 154 155 #define PPC_INST_MSGSNDP 0x7c00011c 156 + #define PPC_INST_MTTMR 0x7c0003dc 155 157 #define PPC_INST_NOP 0x60000000 156 158 #define PPC_INST_POPCNTB 0x7c0000f4 157 159 #define PPC_INST_POPCNTB_MASK 0xfc0007fe ··· 370 368 | __PPC_RA(r)) 371 369 #define TABORT(r) stringify_in_c(.long PPC_INST_TABORT \ 372 370 | __PPC_RA(r)) 371 + 372 + /* book3e thread control instructions */ 373 + #define TMRN(x) ((((x) & 0x1f) << 16) | (((x) & 0x3e0) << 6)) 374 + #define MTTMR(tmr, r) stringify_in_c(.long PPC_INST_MTTMR | \ 375 + TMRN(tmr) | ___PPC_RS(r)) 376 + #define MFTMR(tmr, r) stringify_in_c(.long PPC_INST_MFTMR | \ 377 + TMRN(tmr) | ___PPC_RT(r)) 373 378 374 379 #endif /* _ASM_POWERPC_PPC_OPCODE_H */
+46 -9
arch/powerpc/include/asm/reg_booke.h
··· 15 15 #ifndef __ASM_POWERPC_REG_BOOKE_H__ 16 16 #define __ASM_POWERPC_REG_BOOKE_H__ 17 17 18 + #include <asm/ppc-opcode.h> 19 + 18 20 /* Machine State Register (MSR) Fields */ 19 - #define MSR_GS (1<<28) /* Guest state */ 20 - #define MSR_UCLE (1<<26) /* User-mode cache lock enable */ 21 - #define MSR_SPE (1<<25) /* Enable SPE */ 22 - #define MSR_DWE (1<<10) /* Debug Wait Enable */ 23 - #define MSR_UBLE (1<<10) /* BTB lock enable (e500) */ 24 - #define MSR_IS MSR_IR /* Instruction Space */ 25 - #define MSR_DS MSR_DR /* Data Space */ 26 - #define MSR_PMM (1<<2) /* Performance monitor mark bit */ 27 - #define MSR_CM (1<<31) /* Computation Mode (0=32-bit, 1=64-bit) */ 21 + #define MSR_GS_LG 28 /* Guest state */ 22 + #define MSR_UCLE_LG 26 /* User-mode cache lock enable */ 23 + #define MSR_SPE_LG 25 /* Enable SPE */ 24 + #define MSR_DWE_LG 10 /* Debug Wait Enable */ 25 + #define MSR_UBLE_LG 10 /* BTB lock enable (e500) */ 26 + #define MSR_IS_LG MSR_IR_LG /* Instruction Space */ 27 + #define MSR_DS_LG MSR_DR_LG /* Data Space */ 28 + #define MSR_PMM_LG 2 /* Performance monitor mark bit */ 29 + #define MSR_CM_LG 31 /* Computation Mode (0=32-bit, 1=64-bit) */ 30 + 31 + #define MSR_GS __MASK(MSR_GS_LG) 32 + #define MSR_UCLE __MASK(MSR_UCLE_LG) 33 + #define MSR_SPE __MASK(MSR_SPE_LG) 34 + #define MSR_DWE __MASK(MSR_DWE_LG) 35 + #define MSR_UBLE __MASK(MSR_UBLE_LG) 36 + #define MSR_IS __MASK(MSR_IS_LG) 37 + #define MSR_DS __MASK(MSR_DS_LG) 38 + #define MSR_PMM __MASK(MSR_PMM_LG) 39 + #define MSR_CM __MASK(MSR_CM_LG) 28 40 29 41 #if defined(CONFIG_PPC_BOOK3E_64) 30 42 #define MSR_64BIT MSR_CM ··· 610 598 /* Bit definitions for L1CSR2. */ 611 599 #define L1CSR2_DCWS 0x40000000 /* Data Cache write shadow */ 612 600 601 + /* Bit definitions for BUCSR. */ 602 + #define BUCSR_STAC_EN 0x01000000 /* Segment Target Address Cache */ 603 + #define BUCSR_LS_EN 0x00400000 /* Link Stack */ 604 + #define BUCSR_BBFI 0x00000200 /* Branch Buffer flash invalidate */ 605 + #define BUCSR_BPEN 0x00000001 /* Branch prediction enable */ 606 + #define BUCSR_INIT (BUCSR_STAC_EN | BUCSR_LS_EN | BUCSR_BBFI | BUCSR_BPEN) 607 + 613 608 /* Bit definitions for L2CSR0. */ 614 609 #define L2CSR0_L2E 0x80000000 /* L2 Cache Enable */ 615 610 #define L2CSR0_L2PE 0x40000000 /* L2 Cache Parity/ECC Enable */ ··· 739 720 #define MMUBE1_VBE3 0x00000004 740 721 #define MMUBE1_VBE4 0x00000002 741 722 #define MMUBE1_VBE5 0x00000001 723 + 724 + #define TMRN_IMSR0 0x120 /* Initial MSR Register 0 (e6500) */ 725 + #define TMRN_IMSR1 0x121 /* Initial MSR Register 1 (e6500) */ 726 + #define TMRN_INIA0 0x140 /* Next Instruction Address Register 0 */ 727 + #define TMRN_INIA1 0x141 /* Next Instruction Address Register 1 */ 728 + #define SPRN_TENSR 0x1b5 /* Thread Enable Status Register */ 729 + #define SPRN_TENS 0x1b6 /* Thread Enable Set Register */ 730 + #define SPRN_TENC 0x1b7 /* Thread Enable Clear Register */ 731 + 732 + #define TEN_THREAD(x) (1 << (x)) 733 + 734 + #ifndef __ASSEMBLY__ 735 + #define mftmr(rn) ({unsigned long rval; \ 736 + asm volatile(MFTMR(rn, %0) : "=r" (rval)); rval;}) 737 + #define mttmr(rn, v) asm volatile(MTTMR(rn, %0) : \ 738 + : "r" ((unsigned long)(v)) \ 739 + : "memory") 740 + #endif /* !__ASSEMBLY__ */ 742 741 743 742 #endif /* __ASM_POWERPC_REG_BOOKE_H__ */ 744 743 #endif /* __KERNEL__ */
+22
arch/powerpc/kernel/head_64.S
··· 180 180 #include "exceptions-64s.S" 181 181 #endif 182 182 183 + #ifdef CONFIG_PPC_BOOK3E 184 + _GLOBAL(fsl_secondary_thread_init) 185 + /* Enable branch prediction */ 186 + lis r3,BUCSR_INIT@h 187 + ori r3,r3,BUCSR_INIT@l 188 + mtspr SPRN_BUCSR,r3 189 + isync 190 + 191 + /* 192 + * Fix PIR to match the linear numbering in the device tree. 193 + * 194 + * On e6500, the reset value of PIR uses the low three bits for 195 + * the thread within a core, and the upper bits for the core 196 + * number. There are two threads per core, so shift everything 197 + * but the low bit right by two bits so that the cpu numbering is 198 + * continuous. 199 + */ 200 + mfspr r3, SPRN_PIR 201 + rlwimi r3, r3, 30, 2, 30 202 + mtspr SPRN_PIR, r3 203 + #endif 204 + 183 205 _GLOBAL(generic_secondary_thread_init) 184 206 mr r24,r3 185 207
+4 -6
arch/powerpc/kernel/prom.c
··· 308 308 309 309 /* Get physical cpuid */ 310 310 intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len); 311 - if (intserv) { 312 - nthreads = len / sizeof(int); 313 - } else { 314 - intserv = of_get_flat_dt_prop(node, "reg", NULL); 315 - nthreads = 1; 316 - } 311 + if (!intserv) 312 + intserv = of_get_flat_dt_prop(node, "reg", &len); 313 + 314 + nthreads = len / sizeof(int); 317 315 318 316 /* 319 317 * Now see if any of these threads match our boot cpu.
+4 -2
arch/powerpc/kernel/setup-common.c
··· 456 456 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s", 457 457 &len); 458 458 if (intserv) { 459 - nthreads = len / sizeof(int); 460 459 DBG(" ibm,ppc-interrupt-server#s -> %d threads\n", 461 460 nthreads); 462 461 } else { 463 462 DBG(" no ibm,ppc-interrupt-server#s -> 1 thread\n"); 464 - intserv = of_get_property(dn, "reg", NULL); 463 + intserv = of_get_property(dn, "reg", &len); 465 464 if (!intserv) { 466 465 cpu_be = cpu_to_be32(cpu); 467 466 intserv = &cpu_be; /* assume logical == phys */ 467 + len = 4; 468 468 } 469 469 } 470 + 471 + nthreads = len / sizeof(int); 470 472 471 473 for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) { 472 474 bool avail;
+5 -1
arch/powerpc/kernel/setup_64.c
··· 511 511 check_smt_enabled(); 512 512 setup_tlb_core_data(); 513 513 514 - #ifdef CONFIG_SMP 514 + /* 515 + * Freescale Book3e parts spin in a loop provided by firmware, 516 + * so smp_release_cpus() does nothing for them 517 + */ 518 + #if defined(CONFIG_SMP) && !defined(CONFIG_PPC_FSL_BOOK3E) 515 519 /* Release secondary cpus out of their spinloops at 0x60 now that 516 520 * we can map physical -> logical CPU ids 517 521 */
+56 -12
arch/powerpc/mm/tlb_low_64e.S
··· 299 299 * r10 = crap (free to use) 300 300 */ 301 301 tlb_miss_common_e6500: 302 - BEGIN_FTR_SECTION 302 + crmove cr2*4+2,cr0*4+2 /* cr2.eq != 0 if kernel address */ 303 + 304 + BEGIN_FTR_SECTION /* CPU_FTR_SMT */ 303 305 /* 304 306 * Search if we already have an indirect entry for that virtual 305 307 * address, and if we do, bail out. ··· 326 324 b 1b 327 325 .previous 328 326 327 + /* 328 + * Erratum A-008139 says that we can't use tlbwe to change 329 + * an indirect entry in any way (including replacing or 330 + * invalidating) if the other thread could be in the process 331 + * of a lookup. The workaround is to invalidate the entry 332 + * with tlbilx before overwriting. 333 + */ 334 + 335 + lbz r15,TCD_ESEL_NEXT(r11) 336 + rlwinm r10,r15,16,0xff0000 337 + oris r10,r10,MAS0_TLBSEL(1)@h 338 + mtspr SPRN_MAS0,r10 339 + isync 340 + tlbre 329 341 mfspr r15,SPRN_MAS1 330 - mfspr r10,SPRN_MAS2 342 + andis. r15,r15,MAS1_VALID@h 343 + beq 5f 344 + 345 + BEGIN_FTR_SECTION_NESTED(532) 346 + mfspr r10,SPRN_MAS8 347 + rlwinm r10,r10,0,0x80000fff /* tgs,tlpid -> sgs,slpid */ 348 + mtspr SPRN_MAS5,r10 349 + END_FTR_SECTION_NESTED(CPU_FTR_EMB_HV,CPU_FTR_EMB_HV,532) 350 + 351 + mfspr r10,SPRN_MAS1 352 + rlwinm r15,r10,0,0x3fff0000 /* tid -> spid */ 353 + rlwimi r15,r10,20,0x00000003 /* ind,ts -> sind,sas */ 354 + mfspr r10,SPRN_MAS6 355 + mtspr SPRN_MAS6,r15 356 + 357 + mfspr r15,SPRN_MAS2 358 + isync 359 + tlbilxva 0,r15 360 + isync 361 + 362 + mtspr SPRN_MAS6,r10 363 + 364 + 5: 365 + BEGIN_FTR_SECTION_NESTED(532) 366 + li r10,0 367 + mtspr SPRN_MAS8,r10 368 + mtspr SPRN_MAS5,r10 369 + END_FTR_SECTION_NESTED(CPU_FTR_EMB_HV,CPU_FTR_EMB_HV,532) 331 370 332 371 tlbsx 0,r16 333 - mtspr SPRN_MAS2,r10 334 372 mfspr r10,SPRN_MAS1 335 - mtspr SPRN_MAS1,r15 336 - 337 - andis. r10,r10,MAS1_VALID@h 373 + andis. r15,r10,MAS1_VALID@h 338 374 bne tlb_miss_done_e6500 339 - END_FTR_SECTION_IFSET(CPU_FTR_SMT) 375 + FTR_SECTION_ELSE 376 + mfspr r10,SPRN_MAS1 377 + ALT_FTR_SECTION_END_IFSET(CPU_FTR_SMT) 378 + 379 + oris r10,r10,MAS1_VALID@h 380 + beq cr2,4f 381 + rlwinm r10,r10,0,16,1 /* Clear TID */ 382 + 4: mtspr SPRN_MAS1,r10 340 383 341 384 /* Now, we need to walk the page tables. First check if we are in 342 385 * range. ··· 457 410 rfi 458 411 459 412 tlb_miss_kernel_e6500: 460 - mfspr r10,SPRN_MAS1 461 413 ld r14,PACA_KERNELPGD(r13) 462 - cmpldi cr0,r15,8 /* Check for vmalloc region */ 463 - rlwinm r10,r10,0,16,1 /* Clear TID */ 464 - mtspr SPRN_MAS1,r10 465 - beq+ tlb_miss_common_e6500 414 + cmpldi cr1,r15,8 /* Check for vmalloc region */ 415 + beq+ cr1,tlb_miss_common_e6500 466 416 467 417 tlb_miss_fault_e6500: 468 418 tlb_unlock_e6500
+1 -1
arch/powerpc/platforms/85xx/Kconfig
··· 274 274 For 32bit kernel, the following boards are supported: 275 275 P2041 RDB, P3041 DS, P4080 DS, kmcoge4, and OCA4080 276 276 For 64bit kernel, the following boards are supported: 277 - T208x QDS, T4240 QDS/RDB and B4 QDS 277 + T208x QDS/RDB, T4240 QDS/RDB and B4 QDS 278 278 The following boards are supported for both 32bit and 64bit kernel: 279 279 P5020 DS, P5040 DS and T104xQDS 280 280
+1
arch/powerpc/platforms/85xx/corenet_generic.c
··· 120 120 "fsl,P5020DS", 121 121 "fsl,P5040DS", 122 122 "fsl,T2080QDS", 123 + "fsl,T2080RDB", 123 124 "fsl,T2081QDS", 124 125 "fsl,T4240QDS", 125 126 "fsl,T4240RDB",
+44
arch/powerpc/platforms/85xx/smp.c
··· 28 28 #include <asm/dbell.h> 29 29 #include <asm/fsl_guts.h> 30 30 #include <asm/code-patching.h> 31 + #include <asm/cputhreads.h> 31 32 32 33 #include <sysdev/fsl_soc.h> 33 34 #include <sysdev/mpic.h> ··· 169 168 return in_be32(&((struct epapr_spin_table *)spin_table)->addr_l); 170 169 } 171 170 171 + #ifdef CONFIG_PPC64 172 + static void wake_hw_thread(void *info) 173 + { 174 + void fsl_secondary_thread_init(void); 175 + unsigned long imsr1, inia1; 176 + int nr = *(const int *)info; 177 + 178 + imsr1 = MSR_KERNEL; 179 + inia1 = *(unsigned long *)fsl_secondary_thread_init; 180 + 181 + mttmr(TMRN_IMSR1, imsr1); 182 + mttmr(TMRN_INIA1, inia1); 183 + mtspr(SPRN_TENS, TEN_THREAD(1)); 184 + 185 + smp_generic_kick_cpu(nr); 186 + } 187 + #endif 188 + 172 189 static int smp_85xx_kick_cpu(int nr) 173 190 { 174 191 unsigned long flags; ··· 201 182 WARN_ON(hw_cpu < 0 || hw_cpu >= NR_CPUS); 202 183 203 184 pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr); 185 + 186 + #ifdef CONFIG_PPC64 187 + /* Threads don't use the spin table */ 188 + if (cpu_thread_in_core(nr) != 0) { 189 + int primary = cpu_first_thread_sibling(nr); 190 + 191 + if (WARN_ON_ONCE(!cpu_has_feature(CPU_FTR_SMT))) 192 + return -ENOENT; 193 + 194 + if (cpu_thread_in_core(nr) != 1) { 195 + pr_err("%s: cpu %d: invalid hw thread %d\n", 196 + __func__, nr, cpu_thread_in_core(nr)); 197 + return -ENOENT; 198 + } 199 + 200 + if (!cpu_online(primary)) { 201 + pr_err("%s: cpu %d: primary %d not online\n", 202 + __func__, nr, primary); 203 + return -ENOENT; 204 + } 205 + 206 + smp_call_function_single(primary, wake_hw_thread, &nr, 0); 207 + return 0; 208 + } 209 + #endif 204 210 205 211 np = of_get_cpu_node(nr, NULL); 206 212 cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL);
+2 -2
arch/powerpc/sysdev/fsl_pci.c
··· 853 853 in = pcie->cfg_type0 + PEX_RC_INWIN_BASE; 854 854 for (i = 0; i < 4; i++) { 855 855 /* not enabled, skip */ 856 - if (!in_le32(&in[i].ar) & PEX_RCIWARn_EN) 857 - continue; 856 + if (!(in_le32(&in[i].ar) & PEX_RCIWARn_EN)) 857 + continue; 858 858 859 859 if (get_immrbase() == in_le32(&in[i].tar)) 860 860 return (u64)in_le32(&in[i].barh) << 32 |
+1 -1
arch/powerpc/sysdev/mpic_msgr.c
··· 184 184 dev_info(&dev->dev, "Found %d message registers\n", 185 185 mpic_msgr_count); 186 186 187 - mpic_msgrs = kzalloc(sizeof(struct mpic_msgr) * mpic_msgr_count, 187 + mpic_msgrs = kcalloc(mpic_msgr_count, sizeof(*mpic_msgrs), 188 188 GFP_KERNEL); 189 189 if (!mpic_msgrs) { 190 190 dev_err(&dev->dev,
+10
drivers/memory/Kconfig
··· 61 61 analysis, especially for IOMMU/SMMU(System Memory Management 62 62 Unit) module. 63 63 64 + config FSL_CORENET_CF 65 + tristate "Freescale CoreNet Error Reporting" 66 + depends on FSL_SOC_BOOKE 67 + help 68 + Say Y for reporting of errors from the Freescale CoreNet 69 + Coherency Fabric. Errors reported include accesses to 70 + physical addresses that mapped by no local access window 71 + (LAW) or an invalid LAW, as well as bad cache state that 72 + represents a coherency violation. 73 + 64 74 config FSL_IFC 65 75 bool 66 76 depends on FSL_SOC
+1
drivers/memory/Makefile
··· 7 7 endif 8 8 obj-$(CONFIG_TI_AEMIF) += ti-aemif.o 9 9 obj-$(CONFIG_TI_EMIF) += emif.o 10 + obj-$(CONFIG_FSL_CORENET_CF) += fsl-corenet-cf.o 10 11 obj-$(CONFIG_FSL_IFC) += fsl_ifc.o 11 12 obj-$(CONFIG_MVEBU_DEVBUS) += mvebu-devbus.o 12 13 obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o
+251
drivers/memory/fsl-corenet-cf.c
··· 1 + /* 2 + * CoreNet Coherency Fabric error reporting 3 + * 4 + * Copyright 2014 Freescale Semiconductor Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 + * option) any later version. 10 + */ 11 + 12 + #include <linux/interrupt.h> 13 + #include <linux/io.h> 14 + #include <linux/irq.h> 15 + #include <linux/module.h> 16 + #include <linux/of.h> 17 + #include <linux/of_address.h> 18 + #include <linux/of_device.h> 19 + #include <linux/of_irq.h> 20 + #include <linux/platform_device.h> 21 + 22 + enum ccf_version { 23 + CCF1, 24 + CCF2, 25 + }; 26 + 27 + struct ccf_info { 28 + enum ccf_version version; 29 + int err_reg_offs; 30 + }; 31 + 32 + static const struct ccf_info ccf1_info = { 33 + .version = CCF1, 34 + .err_reg_offs = 0xa00, 35 + }; 36 + 37 + static const struct ccf_info ccf2_info = { 38 + .version = CCF2, 39 + .err_reg_offs = 0xe40, 40 + }; 41 + 42 + static const struct of_device_id ccf_matches[] = { 43 + { 44 + .compatible = "fsl,corenet1-cf", 45 + .data = &ccf1_info, 46 + }, 47 + { 48 + .compatible = "fsl,corenet2-cf", 49 + .data = &ccf2_info, 50 + }, 51 + {} 52 + }; 53 + 54 + struct ccf_err_regs { 55 + u32 errdet; /* 0x00 Error Detect Register */ 56 + /* 0x04 Error Enable (ccf1)/Disable (ccf2) Register */ 57 + u32 errdis; 58 + /* 0x08 Error Interrupt Enable Register (ccf2 only) */ 59 + u32 errinten; 60 + u32 cecar; /* 0x0c Error Capture Attribute Register */ 61 + u32 cecaddrh; /* 0x10 Error Capture Address High */ 62 + u32 cecaddrl; /* 0x14 Error Capture Address Low */ 63 + u32 cecar2; /* 0x18 Error Capture Attribute Register 2 */ 64 + }; 65 + 66 + /* LAE/CV also valid for errdis and errinten */ 67 + #define ERRDET_LAE (1 << 0) /* Local Access Error */ 68 + #define ERRDET_CV (1 << 1) /* Coherency Violation */ 69 + #define ERRDET_CTYPE_SHIFT 26 /* Capture Type (ccf2 only) */ 70 + #define ERRDET_CTYPE_MASK (0x1f << ERRDET_CTYPE_SHIFT) 71 + #define ERRDET_CAP (1 << 31) /* Capture Valid (ccf2 only) */ 72 + 73 + #define CECAR_VAL (1 << 0) /* Valid (ccf1 only) */ 74 + #define CECAR_UVT (1 << 15) /* Unavailable target ID (ccf1) */ 75 + #define CECAR_SRCID_SHIFT_CCF1 24 76 + #define CECAR_SRCID_MASK_CCF1 (0xff << CECAR_SRCID_SHIFT_CCF1) 77 + #define CECAR_SRCID_SHIFT_CCF2 18 78 + #define CECAR_SRCID_MASK_CCF2 (0xff << CECAR_SRCID_SHIFT_CCF2) 79 + 80 + #define CECADDRH_ADDRH 0xff 81 + 82 + struct ccf_private { 83 + const struct ccf_info *info; 84 + struct device *dev; 85 + void __iomem *regs; 86 + struct ccf_err_regs __iomem *err_regs; 87 + }; 88 + 89 + static irqreturn_t ccf_irq(int irq, void *dev_id) 90 + { 91 + struct ccf_private *ccf = dev_id; 92 + static DEFINE_RATELIMIT_STATE(ratelimit, DEFAULT_RATELIMIT_INTERVAL, 93 + DEFAULT_RATELIMIT_BURST); 94 + u32 errdet, cecar, cecar2; 95 + u64 addr; 96 + u32 src_id; 97 + bool uvt = false; 98 + bool cap_valid = false; 99 + 100 + errdet = ioread32be(&ccf->err_regs->errdet); 101 + cecar = ioread32be(&ccf->err_regs->cecar); 102 + cecar2 = ioread32be(&ccf->err_regs->cecar2); 103 + addr = ioread32be(&ccf->err_regs->cecaddrl); 104 + addr |= ((u64)(ioread32be(&ccf->err_regs->cecaddrh) & 105 + CECADDRH_ADDRH)) << 32; 106 + 107 + if (!__ratelimit(&ratelimit)) 108 + goto out; 109 + 110 + switch (ccf->info->version) { 111 + case CCF1: 112 + if (cecar & CECAR_VAL) { 113 + if (cecar & CECAR_UVT) 114 + uvt = true; 115 + 116 + src_id = (cecar & CECAR_SRCID_MASK_CCF1) >> 117 + CECAR_SRCID_SHIFT_CCF1; 118 + cap_valid = true; 119 + } 120 + 121 + break; 122 + case CCF2: 123 + if (errdet & ERRDET_CAP) { 124 + src_id = (cecar & CECAR_SRCID_MASK_CCF2) >> 125 + CECAR_SRCID_SHIFT_CCF2; 126 + cap_valid = true; 127 + } 128 + 129 + break; 130 + } 131 + 132 + dev_crit(ccf->dev, "errdet 0x%08x cecar 0x%08x cecar2 0x%08x\n", 133 + errdet, cecar, cecar2); 134 + 135 + if (errdet & ERRDET_LAE) { 136 + if (uvt) 137 + dev_crit(ccf->dev, "LAW Unavailable Target ID\n"); 138 + else 139 + dev_crit(ccf->dev, "Local Access Window Error\n"); 140 + } 141 + 142 + if (errdet & ERRDET_CV) 143 + dev_crit(ccf->dev, "Coherency Violation\n"); 144 + 145 + if (cap_valid) { 146 + dev_crit(ccf->dev, "address 0x%09llx, src id 0x%x\n", 147 + addr, src_id); 148 + } 149 + 150 + out: 151 + iowrite32be(errdet, &ccf->err_regs->errdet); 152 + return errdet ? IRQ_HANDLED : IRQ_NONE; 153 + } 154 + 155 + static int ccf_probe(struct platform_device *pdev) 156 + { 157 + struct ccf_private *ccf; 158 + struct resource *r; 159 + const struct of_device_id *match; 160 + int ret, irq; 161 + 162 + match = of_match_device(ccf_matches, &pdev->dev); 163 + if (WARN_ON(!match)) 164 + return -ENODEV; 165 + 166 + ccf = devm_kzalloc(&pdev->dev, sizeof(*ccf), GFP_KERNEL); 167 + if (!ccf) 168 + return -ENOMEM; 169 + 170 + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 171 + if (!r) { 172 + dev_err(&pdev->dev, "%s: no mem resource\n", __func__); 173 + return -ENXIO; 174 + } 175 + 176 + ccf->regs = devm_ioremap_resource(&pdev->dev, r); 177 + if (IS_ERR(ccf->regs)) { 178 + dev_err(&pdev->dev, "%s: can't map mem resource\n", __func__); 179 + return PTR_ERR(ccf->regs); 180 + } 181 + 182 + ccf->dev = &pdev->dev; 183 + ccf->info = match->data; 184 + ccf->err_regs = ccf->regs + ccf->info->err_reg_offs; 185 + 186 + dev_set_drvdata(&pdev->dev, ccf); 187 + 188 + irq = platform_get_irq(pdev, 0); 189 + if (!irq) { 190 + dev_err(&pdev->dev, "%s: no irq\n", __func__); 191 + return -ENXIO; 192 + } 193 + 194 + ret = devm_request_irq(&pdev->dev, irq, ccf_irq, 0, pdev->name, ccf); 195 + if (ret) { 196 + dev_err(&pdev->dev, "%s: can't request irq\n", __func__); 197 + return ret; 198 + } 199 + 200 + switch (ccf->info->version) { 201 + case CCF1: 202 + /* On CCF1 this register enables rather than disables. */ 203 + iowrite32be(ERRDET_LAE | ERRDET_CV, &ccf->err_regs->errdis); 204 + break; 205 + 206 + case CCF2: 207 + iowrite32be(0, &ccf->err_regs->errdis); 208 + iowrite32be(ERRDET_LAE | ERRDET_CV, &ccf->err_regs->errinten); 209 + break; 210 + } 211 + 212 + return 0; 213 + } 214 + 215 + static int ccf_remove(struct platform_device *pdev) 216 + { 217 + struct ccf_private *ccf = dev_get_drvdata(&pdev->dev); 218 + 219 + switch (ccf->info->version) { 220 + case CCF1: 221 + iowrite32be(0, &ccf->err_regs->errdis); 222 + break; 223 + 224 + case CCF2: 225 + /* 226 + * We clear errdis on ccf1 because that's the only way to 227 + * disable interrupts, but on ccf2 there's no need to disable 228 + * detection. 229 + */ 230 + iowrite32be(0, &ccf->err_regs->errinten); 231 + break; 232 + } 233 + 234 + return 0; 235 + } 236 + 237 + static struct platform_driver ccf_driver = { 238 + .driver = { 239 + .name = KBUILD_MODNAME, 240 + .owner = THIS_MODULE, 241 + .of_match_table = ccf_matches, 242 + }, 243 + .probe = ccf_probe, 244 + .remove = ccf_remove, 245 + }; 246 + 247 + module_platform_driver(ccf_driver); 248 + 249 + MODULE_LICENSE("GPL"); 250 + MODULE_AUTHOR("Freescale Semiconductor"); 251 + MODULE_DESCRIPTION("Freescale CoreNet Coherency Fabric error reporting");