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.
···8484 compatible = "fsl,bsc9132qds-fpga", "fsl,fpga-qixis-i2c";8585 reg = <0x66>;8686 };8787+8888+* Freescale on-board CPLD8989+9090+Some Freescale boards like T1040RDB have an on board CPLD connected.9191+9292+Required properties:9393+- compatible: Should be a board-specific string like "fsl,<board>-cpld"9494+ Example:9595+ "fsl,t1040rdb-cpld", "fsl,t1042rdb-cpld", "fsl,t1042rdb_pi-cpld"9696+- reg: should describe CPLD registers9797+9898+Example:9999+ cpld@3,0 {100100+ compatible = "fsl,t1040rdb-cpld";101101+ reg = <3 0 0x300>;102102+ };
+57
arch/powerpc/boot/dts/t2080rdb.dts
···11+/*22+ * T2080PCIe-RDB Board Device Tree Source33+ *44+ * Copyright 2014 Freescale Semiconductor Inc.55+ *66+ * Redistribution and use in source and binary forms, with or without77+ * modification, are permitted provided that the following conditions are met:88+ * * Redistributions of source code must retain the above copyright99+ * notice, this list of conditions and the following disclaimer.1010+ * * Redistributions in binary form must reproduce the above copyright1111+ * notice, this list of conditions and the following disclaimer in the1212+ * documentation and/or other materials provided with the distribution.1313+ * * Neither the name of Freescale Semiconductor nor the1414+ * names of its contributors may be used to endorse or promote products1515+ * derived from this software without specific prior written permission.1616+ *1717+ *1818+ * ALTERNATIVELY, this software may be distributed under the terms of the1919+ * GNU General Public License ("GPL") as published by the Free Software2020+ * Foundation, either version 2 of that License or (at your option) any2121+ * later version.2222+ *2323+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY2424+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2525+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE2626+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY2727+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES2828+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;2929+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND3030+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT3131+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS3232+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333+ */3434+3535+/include/ "fsl/t208xsi-pre.dtsi"3636+/include/ "t208xrdb.dtsi"3737+3838+/ {3939+ model = "fsl,T2080RDB";4040+ compatible = "fsl,T2080RDB";4141+ #address-cells = <2>;4242+ #size-cells = <2>;4343+ interrupt-parent = <&mpic>;4444+4545+ rio: rapidio@ffe0c0000 {4646+ reg = <0xf 0xfe0c0000 0 0x11000>;4747+4848+ port1 {4949+ ranges = <0 0 0xc 0x20000000 0 0x10000000>;5050+ };5151+ port2 {5252+ ranges = <0 0 0xc 0x30000000 0 0x10000000>;5353+ };5454+ };5555+};5656+5757+/include/ "fsl/t2080si-post.dtsi"
+184
arch/powerpc/boot/dts/t208xrdb.dtsi
···11+/*22+ * T2080PCIe-RDB Board Device Tree Source33+ *44+ * Copyright 2014 Freescale Semiconductor Inc.55+ *66+ * Redistribution and use in source and binary forms, with or without77+ * modification, are permitted provided that the following conditions are met:88+ * * Redistributions of source code must retain the above copyright99+ * notice, this list of conditions and the following disclaimer.1010+ * * Redistributions in binary form must reproduce the above copyright1111+ * notice, this list of conditions and the following disclaimer in the1212+ * documentation and/or other materials provided with the distribution.1313+ * * Neither the name of Freescale Semiconductor nor the1414+ * names of its contributors may be used to endorse or promote products1515+ * derived from this software without specific prior written permission.1616+ *1717+ *1818+ * ALTERNATIVELY, this software may be distributed under the terms of the1919+ * GNU General Public License ("GPL") as published by the Free Software2020+ * Foundation, either version 2 of that License or (at your option) any2121+ * later version.2222+ *2323+ * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY2424+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED2525+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE2626+ * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY2727+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES2828+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;2929+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND3030+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT3131+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS3232+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.3333+ */3434+3535+/ {3636+ model = "fsl,T2080RDB";3737+ compatible = "fsl,T2080RDB";3838+ #address-cells = <2>;3939+ #size-cells = <2>;4040+ interrupt-parent = <&mpic>;4141+4242+ ifc: localbus@ffe124000 {4343+ reg = <0xf 0xfe124000 0 0x2000>;4444+ ranges = <0 0 0xf 0xe8000000 0x080000004545+ 2 0 0xf 0xff800000 0x000100004646+ 3 0 0xf 0xffdf0000 0x00008000>;4747+4848+ nor@0,0 {4949+ #address-cells = <1>;5050+ #size-cells = <1>;5151+ compatible = "cfi-flash";5252+ reg = <0x0 0x0 0x8000000>;5353+5454+ bank-width = <2>;5555+ device-width = <1>;5656+ };5757+5858+ nand@1,0 {5959+ #address-cells = <1>;6060+ #size-cells = <1>;6161+ compatible = "fsl,ifc-nand";6262+ reg = <0x2 0x0 0x10000>;6363+ };6464+6565+ boardctrl: board-control@2,0 {6666+ #address-cells = <1>;6767+ #size-cells = <1>;6868+ compatible = "fsl,t2080-cpld";6969+ reg = <3 0 0x300>;7070+ ranges = <0 3 0 0x300>;7171+ };7272+ };7373+7474+ memory {7575+ device_type = "memory";7676+ };7777+7878+ dcsr: dcsr@f00000000 {7979+ ranges = <0x00000000 0xf 0x00000000 0x01072000>;8080+ };8181+8282+ soc: soc@ffe000000 {8383+ ranges = <0x00000000 0xf 0xfe000000 0x1000000>;8484+ reg = <0xf 0xfe000000 0 0x00001000>;8585+ spi@110000 {8686+ flash@0 {8787+ #address-cells = <1>;8888+ #size-cells = <1>;8989+ compatible = "micron,n25q512a";9090+ reg = <0>;9191+ spi-max-frequency = <10000000>; /* input clock */9292+ };9393+ };9494+9595+ i2c@118000 {9696+ adt7481@4c {9797+ compatible = "adi,adt7481";9898+ reg = <0x4c>;9999+ };100100+101101+ rtc@68 {102102+ compatible = "dallas,ds1339";103103+ reg = <0x68>;104104+ interrupts = <0x1 0x1 0 0>;105105+ };106106+107107+ eeprom@50 {108108+ compatible = "atmel,24c256";109109+ reg = <0x50>;110110+ };111111+ };112112+113113+ i2c@118100 {114114+ pca9546@77 {115115+ compatible = "nxp,pca9546";116116+ reg = <0x77>;117117+ };118118+ };119119+120120+ sdhc@114000 {121121+ voltage-ranges = <1800 1800 3300 3300>;122122+ };123123+ };124124+125125+ pci0: pcie@ffe240000 {126126+ reg = <0xf 0xfe240000 0 0x10000>;127127+ ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000128128+ 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>;129129+ pcie@0 {130130+ ranges = <0x02000000 0 0xe0000000131131+ 0x02000000 0 0xe0000000132132+ 0 0x20000000133133+134134+ 0x01000000 0 0x00000000135135+ 0x01000000 0 0x00000000136136+ 0 0x00010000>;137137+ };138138+ };139139+140140+ pci1: pcie@ffe250000 {141141+ reg = <0xf 0xfe250000 0 0x10000>;142142+ ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x10000000143143+ 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>;144144+ pcie@0 {145145+ ranges = <0x02000000 0 0xe0000000146146+ 0x02000000 0 0xe0000000147147+ 0 0x20000000148148+149149+ 0x01000000 0 0x00000000150150+ 0x01000000 0 0x00000000151151+ 0 0x00010000>;152152+ };153153+ };154154+155155+ pci2: pcie@ffe260000 {156156+ reg = <0xf 0xfe260000 0 0x1000>;157157+ ranges = <0x02000000 0 0xe0000000 0xc 0x30000000 0 0x10000000158158+ 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>;159159+ pcie@0 {160160+ ranges = <0x02000000 0 0xe0000000161161+ 0x02000000 0 0xe0000000162162+ 0 0x20000000163163+164164+ 0x01000000 0 0x00000000165165+ 0x01000000 0 0x00000000166166+ 0 0x00010000>;167167+ };168168+ };169169+170170+ pci3: pcie@ffe270000 {171171+ reg = <0xf 0xfe270000 0 0x10000>;172172+ ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x10000000173173+ 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>;174174+ pcie@0 {175175+ ranges = <0x02000000 0 0xe0000000176176+ 0x02000000 0 0xe0000000177177+ 0 0x20000000178178+179179+ 0x01000000 0 0x00000000180180+ 0x01000000 0 0x00000000181181+ 0 0x00010000>;182182+ };183183+ };184184+};
+1
arch/powerpc/configs/corenet32_smp_defconfig
···180180CONFIG_CRYPTO_AES=y181181# CONFIG_CRYPTO_ANSI_CPRNG is not set182182CONFIG_CRYPTO_DEV_FSL_CAAM=y183183+CONFIG_FSL_CORENET_CF=y
+1
arch/powerpc/configs/corenet64_smp_defconfig
···179179CONFIG_CRYPTO_SHA512=y180180# CONFIG_CRYPTO_ANSI_CPRNG is not set181181CONFIG_CRYPTO_DEV_FSL_CAAM=y182182+CONFIG_FSL_CORENET_CF=y
···180180#include "exceptions-64s.S"181181#endif182182183183+#ifdef CONFIG_PPC_BOOK3E184184+_GLOBAL(fsl_secondary_thread_init)185185+ /* Enable branch prediction */186186+ lis r3,BUCSR_INIT@h187187+ ori r3,r3,BUCSR_INIT@l188188+ mtspr SPRN_BUCSR,r3189189+ isync190190+191191+ /*192192+ * Fix PIR to match the linear numbering in the device tree.193193+ *194194+ * On e6500, the reset value of PIR uses the low three bits for195195+ * the thread within a core, and the upper bits for the core196196+ * number. There are two threads per core, so shift everything197197+ * but the low bit right by two bits so that the cpu numbering is198198+ * continuous.199199+ */200200+ mfspr r3, SPRN_PIR201201+ rlwimi r3, r3, 30, 2, 30202202+ mtspr SPRN_PIR, r3203203+#endif204204+183205_GLOBAL(generic_secondary_thread_init)184206 mr r24,r3185207
+4-6
arch/powerpc/kernel/prom.c
···308308309309 /* Get physical cpuid */310310 intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len);311311- if (intserv) {312312- nthreads = len / sizeof(int);313313- } else {314314- intserv = of_get_flat_dt_prop(node, "reg", NULL);315315- nthreads = 1;316316- }311311+ if (!intserv)312312+ intserv = of_get_flat_dt_prop(node, "reg", &len);313313+314314+ nthreads = len / sizeof(int);317315318316 /*319317 * Now see if any of these threads match our boot cpu.
+4-2
arch/powerpc/kernel/setup-common.c
···456456 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",457457 &len);458458 if (intserv) {459459- nthreads = len / sizeof(int);460459 DBG(" ibm,ppc-interrupt-server#s -> %d threads\n",461460 nthreads);462461 } else {463462 DBG(" no ibm,ppc-interrupt-server#s -> 1 thread\n");464464- intserv = of_get_property(dn, "reg", NULL);463463+ intserv = of_get_property(dn, "reg", &len);465464 if (!intserv) {466465 cpu_be = cpu_to_be32(cpu);467466 intserv = &cpu_be; /* assume logical == phys */467467+ len = 4;468468 }469469 }470470+471471+ nthreads = len / sizeof(int);470472471473 for (j = 0; j < nthreads && cpu < nr_cpu_ids; j++) {472474 bool avail;
+5-1
arch/powerpc/kernel/setup_64.c
···511511 check_smt_enabled();512512 setup_tlb_core_data();513513514514-#ifdef CONFIG_SMP514514+ /*515515+ * Freescale Book3e parts spin in a loop provided by firmware,516516+ * so smp_release_cpus() does nothing for them517517+ */518518+#if defined(CONFIG_SMP) && !defined(CONFIG_PPC_FSL_BOOK3E)515519 /* Release secondary cpus out of their spinloops at 0x60 now that516520 * we can map physical -> logical CPU ids517521 */
+56-12
arch/powerpc/mm/tlb_low_64e.S
···299299 * r10 = crap (free to use)300300 */301301tlb_miss_common_e6500:302302-BEGIN_FTR_SECTION302302+ crmove cr2*4+2,cr0*4+2 /* cr2.eq != 0 if kernel address */303303+304304+BEGIN_FTR_SECTION /* CPU_FTR_SMT */303305 /*304306 * Search if we already have an indirect entry for that virtual305307 * address, and if we do, bail out.···326324 b 1b327325 .previous328326327327+ /*328328+ * Erratum A-008139 says that we can't use tlbwe to change329329+ * an indirect entry in any way (including replacing or330330+ * invalidating) if the other thread could be in the process331331+ * of a lookup. The workaround is to invalidate the entry332332+ * with tlbilx before overwriting.333333+ */334334+335335+ lbz r15,TCD_ESEL_NEXT(r11)336336+ rlwinm r10,r15,16,0xff0000337337+ oris r10,r10,MAS0_TLBSEL(1)@h338338+ mtspr SPRN_MAS0,r10339339+ isync340340+ tlbre329341 mfspr r15,SPRN_MAS1330330- mfspr r10,SPRN_MAS2342342+ andis. r15,r15,MAS1_VALID@h343343+ beq 5f344344+345345+BEGIN_FTR_SECTION_NESTED(532)346346+ mfspr r10,SPRN_MAS8347347+ rlwinm r10,r10,0,0x80000fff /* tgs,tlpid -> sgs,slpid */348348+ mtspr SPRN_MAS5,r10349349+END_FTR_SECTION_NESTED(CPU_FTR_EMB_HV,CPU_FTR_EMB_HV,532)350350+351351+ mfspr r10,SPRN_MAS1352352+ rlwinm r15,r10,0,0x3fff0000 /* tid -> spid */353353+ rlwimi r15,r10,20,0x00000003 /* ind,ts -> sind,sas */354354+ mfspr r10,SPRN_MAS6355355+ mtspr SPRN_MAS6,r15356356+357357+ mfspr r15,SPRN_MAS2358358+ isync359359+ tlbilxva 0,r15360360+ isync361361+362362+ mtspr SPRN_MAS6,r10363363+364364+5:365365+BEGIN_FTR_SECTION_NESTED(532)366366+ li r10,0367367+ mtspr SPRN_MAS8,r10368368+ mtspr SPRN_MAS5,r10369369+END_FTR_SECTION_NESTED(CPU_FTR_EMB_HV,CPU_FTR_EMB_HV,532)331370332371 tlbsx 0,r16333333- mtspr SPRN_MAS2,r10334372 mfspr r10,SPRN_MAS1335335- mtspr SPRN_MAS1,r15336336-337337- andis. r10,r10,MAS1_VALID@h373373+ andis. r15,r10,MAS1_VALID@h338374 bne tlb_miss_done_e6500339339-END_FTR_SECTION_IFSET(CPU_FTR_SMT)375375+FTR_SECTION_ELSE376376+ mfspr r10,SPRN_MAS1377377+ALT_FTR_SECTION_END_IFSET(CPU_FTR_SMT)378378+379379+ oris r10,r10,MAS1_VALID@h380380+ beq cr2,4f381381+ rlwinm r10,r10,0,16,1 /* Clear TID */382382+4: mtspr SPRN_MAS1,r10340383341384 /* Now, we need to walk the page tables. First check if we are in342385 * range.···457410 rfi458411459412tlb_miss_kernel_e6500:460460- mfspr r10,SPRN_MAS1461413 ld r14,PACA_KERNELPGD(r13)462462- cmpldi cr0,r15,8 /* Check for vmalloc region */463463- rlwinm r10,r10,0,16,1 /* Clear TID */464464- mtspr SPRN_MAS1,r10465465- beq+ tlb_miss_common_e6500414414+ cmpldi cr1,r15,8 /* Check for vmalloc region */415415+ beq+ cr1,tlb_miss_common_e6500466416467417tlb_miss_fault_e6500:468418 tlb_unlock_e6500
+1-1
arch/powerpc/platforms/85xx/Kconfig
···274274 For 32bit kernel, the following boards are supported:275275 P2041 RDB, P3041 DS, P4080 DS, kmcoge4, and OCA4080276276 For 64bit kernel, the following boards are supported:277277- T208x QDS, T4240 QDS/RDB and B4 QDS277277+ T208x QDS/RDB, T4240 QDS/RDB and B4 QDS278278 The following boards are supported for both 32bit and 64bit kernel:279279 P5020 DS, P5040 DS and T104xQDS280280
···2828#include <asm/dbell.h>2929#include <asm/fsl_guts.h>3030#include <asm/code-patching.h>3131+#include <asm/cputhreads.h>31323233#include <sysdev/fsl_soc.h>3334#include <sysdev/mpic.h>···169168 return in_be32(&((struct epapr_spin_table *)spin_table)->addr_l);170169}171170171171+#ifdef CONFIG_PPC64172172+static void wake_hw_thread(void *info)173173+{174174+ void fsl_secondary_thread_init(void);175175+ unsigned long imsr1, inia1;176176+ int nr = *(const int *)info;177177+178178+ imsr1 = MSR_KERNEL;179179+ inia1 = *(unsigned long *)fsl_secondary_thread_init;180180+181181+ mttmr(TMRN_IMSR1, imsr1);182182+ mttmr(TMRN_INIA1, inia1);183183+ mtspr(SPRN_TENS, TEN_THREAD(1));184184+185185+ smp_generic_kick_cpu(nr);186186+}187187+#endif188188+172189static int smp_85xx_kick_cpu(int nr)173190{174191 unsigned long flags;···201182 WARN_ON(hw_cpu < 0 || hw_cpu >= NR_CPUS);202183203184 pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr);185185+186186+#ifdef CONFIG_PPC64187187+ /* Threads don't use the spin table */188188+ if (cpu_thread_in_core(nr) != 0) {189189+ int primary = cpu_first_thread_sibling(nr);190190+191191+ if (WARN_ON_ONCE(!cpu_has_feature(CPU_FTR_SMT)))192192+ return -ENOENT;193193+194194+ if (cpu_thread_in_core(nr) != 1) {195195+ pr_err("%s: cpu %d: invalid hw thread %d\n",196196+ __func__, nr, cpu_thread_in_core(nr));197197+ return -ENOENT;198198+ }199199+200200+ if (!cpu_online(primary)) {201201+ pr_err("%s: cpu %d: primary %d not online\n",202202+ __func__, nr, primary);203203+ return -ENOENT;204204+ }205205+206206+ smp_call_function_single(primary, wake_hw_thread, &nr, 0);207207+ return 0;208208+ }209209+#endif204210205211 np = of_get_cpu_node(nr, NULL);206212 cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL);
+2-2
arch/powerpc/sysdev/fsl_pci.c
···853853 in = pcie->cfg_type0 + PEX_RC_INWIN_BASE;854854 for (i = 0; i < 4; i++) {855855 /* not enabled, skip */856856- if (!in_le32(&in[i].ar) & PEX_RCIWARn_EN)857857- continue;856856+ if (!(in_le32(&in[i].ar) & PEX_RCIWARn_EN))857857+ continue;858858859859 if (get_immrbase() == in_le32(&in[i].tar))860860 return (u64)in_le32(&in[i].barh) << 32 |
···6161 analysis, especially for IOMMU/SMMU(System Memory Management6262 Unit) module.63636464+config FSL_CORENET_CF6565+ tristate "Freescale CoreNet Error Reporting"6666+ depends on FSL_SOC_BOOKE6767+ help6868+ Say Y for reporting of errors from the Freescale CoreNet6969+ Coherency Fabric. Errors reported include accesses to7070+ physical addresses that mapped by no local access window7171+ (LAW) or an invalid LAW, as well as bad cache state that7272+ represents a coherency violation.7373+6474config FSL_IFC6575 bool6676 depends on FSL_SOC