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

Merge some Freescale updates from Scott Wood

+1088 -155
+41 -12
Documentation/devicetree/bindings/powerpc/fsl/msi-pic.txt
··· 1 1 * Freescale MSI interrupt controller 2 2 3 3 Required properties: 4 - - compatible : compatible list, contains 2 entries, 5 - first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572, 6 - etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" depending on 7 - the parent type. 4 + - compatible : compatible list, may contain one or two entries 5 + The first is "fsl,CHIP-msi", where CHIP is the processor(mpc8610, mpc8572, 6 + etc.) and the second is "fsl,mpic-msi" or "fsl,ipic-msi" or 7 + "fsl,mpic-msi-v4.3" depending on the parent type and version. If mpic 8 + version is 4.3, the number of MSI registers is increased to 16, MSIIR1 is 9 + provided to access these 16 registers, and compatible "fsl,mpic-msi-v4.3" 10 + should be used. The first entry is optional; the second entry is 11 + required. 8 12 9 13 - reg : It may contain one or two regions. The first region should contain 10 14 the address and the length of the shared message interrupt register set. 11 - The second region should contain the address of aliased MSIIR register for 12 - platforms that have such an alias. 13 - 14 - - msi-available-ranges: use <start count> style section to define which 15 - msi interrupt can be used in the 256 msi interrupts. This property is 16 - optional, without this, all the 256 MSI interrupts can be used. 17 - Each available range must begin and end on a multiple of 32 (i.e. 18 - no splitting an individual MSI register or the associated PIC interrupt). 15 + The second region should contain the address of aliased MSIIR or MSIIR1 16 + register for platforms that have such an alias, if using MSIIR1, the second 17 + region must be added because different MSI group has different MSIIR1 offset. 19 18 20 19 - interrupts : each one of the interrupts here is one entry per 32 MSIs, 21 20 and routed to the host interrupt controller. the interrupts should ··· 27 28 to MPIC. 28 29 29 30 Optional properties: 31 + - msi-available-ranges: use <start count> style section to define which 32 + msi interrupt can be used in the 256 msi interrupts. This property is 33 + optional, without this, all the MSI interrupts can be used. 34 + Each available range must begin and end on a multiple of 32 (i.e. 35 + no splitting an individual MSI register or the associated PIC interrupt). 36 + MPIC v4.3 does not support this property because the 32 interrupts of an 37 + individual register are not continuous when using MSIIR1. 38 + 30 39 - msi-address-64: 64-bit PCI address of the MSIIR register. The MSIIR register 31 40 is used for MSI messaging. The address of MSIIR in PCI address space is 32 41 the MSI message address. ··· 59 52 0xe6 0 60 53 0xe7 0>; 61 54 interrupt-parent = <&mpic>; 55 + }; 56 + 57 + msi@41600 { 58 + compatible = "fsl,mpic-msi-v4.3"; 59 + reg = <0x41600 0x200 0x44148 4>; 60 + interrupts = < 61 + 0xe0 0 0 0 62 + 0xe1 0 0 0 63 + 0xe2 0 0 0 64 + 0xe3 0 0 0 65 + 0xe4 0 0 0 66 + 0xe5 0 0 0 67 + 0xe6 0 0 0 68 + 0xe7 0 0 0 69 + 0x100 0 0 0 70 + 0x101 0 0 0 71 + 0x102 0 0 0 72 + 0x103 0 0 0 73 + 0x104 0 0 0 74 + 0x105 0 0 0 75 + 0x106 0 0 0 76 + 0x107 0 0 0>; 62 77 }; 63 78 64 79 The Freescale hypervisor and msi-address-64
+16 -2
arch/powerpc/Makefile
··· 98 98 CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) 99 99 100 100 KBUILD_CPPFLAGS += -Iarch/$(ARCH) 101 - KBUILD_AFLAGS += -Iarch/$(ARCH) 101 + KBUILD_AFLAGS += -msoft-float -Iarch/$(ARCH) 102 102 KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) 103 103 CPP = $(CC) -E $(KBUILD_CFLAGS) 104 104 ··· 132 132 KBUILD_CFLAGS += -mcpu=powerpc 133 133 endif 134 134 135 + ifeq ($(CONFIG_E500),y) 136 + ifeq ($(CONFIG_64BIT),y) 137 + KBUILD_CFLAGS += -mcpu=e5500 138 + KBUILD_AFLAGS += -mcpu=e5500 139 + else 140 + ifeq ($(CONFIG_PPC_E500MC),y) 141 + KBUILD_CFLAGS += -mcpu=e500mc 142 + KBUILD_AFLAGS += -mcpu=e500mc 143 + else 144 + KBUILD_CFLAGS += -mcpu=8540 145 + KBUILD_AFLAGS += -mcpu=8540 146 + endif 147 + endif 148 + endif 149 + 135 150 # Work around a gcc code-gen bug with -fno-omit-frame-pointer. 136 151 ifeq ($(CONFIG_FUNCTION_TRACER),y) 137 152 KBUILD_CFLAGS += -mno-sched-epilog ··· 154 139 155 140 cpu-as-$(CONFIG_4xx) += -Wa,-m405 156 141 cpu-as-$(CONFIG_ALTIVEC) += -Wa,-maltivec 157 - cpu-as-$(CONFIG_E500) += -Wa,-me500 158 142 cpu-as-$(CONFIG_E200) += -Wa,-me200 159 143 160 144 KBUILD_AFLAGS += $(cpu-as-y)
+1 -1
arch/powerpc/boot/dts/b4420qds.dts
··· 33 33 */ 34 34 35 35 /include/ "fsl/b4420si-pre.dtsi" 36 - /include/ "b4qds.dts" 36 + /include/ "b4qds.dtsi" 37 37 38 38 / { 39 39 model = "fsl,B4420QDS";
+1 -1
arch/powerpc/boot/dts/b4860qds.dts
··· 33 33 */ 34 34 35 35 /include/ "fsl/b4860si-pre.dtsi" 36 - /include/ "b4qds.dts" 36 + /include/ "b4qds.dtsi" 37 37 38 38 / { 39 39 model = "fsl,B4860QDS";
arch/powerpc/boot/dts/b4qds.dts arch/powerpc/boot/dts/b4qds.dtsi
+1 -1
arch/powerpc/boot/dts/fsl/b4si-post.dtsi
··· 204 204 }; 205 205 }; 206 206 207 - /include/ "qoriq-mpic.dtsi" 207 + /include/ "qoriq-mpic4.3.dtsi" 208 208 209 209 guts: global-utilities@e0000 { 210 210 compatible = "fsl,b4-device-config";
+149
arch/powerpc/boot/dts/fsl/qoriq-mpic4.3.dtsi
··· 1 + /* 2 + * QorIQ MPIC device tree stub [ controller @ offset 0x40000 ] 3 + * 4 + * Copyright 2013 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 + mpic: pic@40000 { 36 + interrupt-controller; 37 + #address-cells = <0>; 38 + #interrupt-cells = <4>; 39 + reg = <0x40000 0x40000>; 40 + compatible = "fsl,mpic"; 41 + device_type = "open-pic"; 42 + clock-frequency = <0x0>; 43 + }; 44 + 45 + timer@41100 { 46 + compatible = "fsl,mpic-global-timer"; 47 + reg = <0x41100 0x100 0x41300 4>; 48 + interrupts = <0 0 3 0 49 + 1 0 3 0 50 + 2 0 3 0 51 + 3 0 3 0>; 52 + }; 53 + 54 + msi0: msi@41600 { 55 + compatible = "fsl,mpic-msi-v4.3"; 56 + reg = <0x41600 0x200 0x44148 4>; 57 + interrupts = < 58 + 0xe0 0 0 0 59 + 0xe1 0 0 0 60 + 0xe2 0 0 0 61 + 0xe3 0 0 0 62 + 0xe4 0 0 0 63 + 0xe5 0 0 0 64 + 0xe6 0 0 0 65 + 0xe7 0 0 0 66 + 0x100 0 0 0 67 + 0x101 0 0 0 68 + 0x102 0 0 0 69 + 0x103 0 0 0 70 + 0x104 0 0 0 71 + 0x105 0 0 0 72 + 0x106 0 0 0 73 + 0x107 0 0 0>; 74 + }; 75 + 76 + msi1: msi@41800 { 77 + compatible = "fsl,mpic-msi-v4.3"; 78 + reg = <0x41800 0x200 0x45148 4>; 79 + interrupts = < 80 + 0xe8 0 0 0 81 + 0xe9 0 0 0 82 + 0xea 0 0 0 83 + 0xeb 0 0 0 84 + 0xec 0 0 0 85 + 0xed 0 0 0 86 + 0xee 0 0 0 87 + 0xef 0 0 0 88 + 0x108 0 0 0 89 + 0x109 0 0 0 90 + 0x10a 0 0 0 91 + 0x10b 0 0 0 92 + 0x10c 0 0 0 93 + 0x10d 0 0 0 94 + 0x10e 0 0 0 95 + 0x10f 0 0 0>; 96 + }; 97 + 98 + msi2: msi@41a00 { 99 + compatible = "fsl,mpic-msi-v4.3"; 100 + reg = <0x41a00 0x200 0x46148 4>; 101 + interrupts = < 102 + 0xf0 0 0 0 103 + 0xf1 0 0 0 104 + 0xf2 0 0 0 105 + 0xf3 0 0 0 106 + 0xf4 0 0 0 107 + 0xf5 0 0 0 108 + 0xf6 0 0 0 109 + 0xf7 0 0 0 110 + 0x110 0 0 0 111 + 0x111 0 0 0 112 + 0x112 0 0 0 113 + 0x113 0 0 0 114 + 0x114 0 0 0 115 + 0x115 0 0 0 116 + 0x116 0 0 0 117 + 0x117 0 0 0>; 118 + }; 119 + 120 + msi3: msi@41c00 { 121 + compatible = "fsl,mpic-msi-v4.3"; 122 + reg = <0x41c00 0x200 0x47148 4>; 123 + interrupts = < 124 + 0xf8 0 0 0 125 + 0xf9 0 0 0 126 + 0xfa 0 0 0 127 + 0xfb 0 0 0 128 + 0xfc 0 0 0 129 + 0xfd 0 0 0 130 + 0xfe 0 0 0 131 + 0xff 0 0 0 132 + 0x118 0 0 0 133 + 0x119 0 0 0 134 + 0x11a 0 0 0 135 + 0x11b 0 0 0 136 + 0x11c 0 0 0 137 + 0x11d 0 0 0 138 + 0x11e 0 0 0 139 + 0x11f 0 0 0>; 140 + }; 141 + 142 + timer@42100 { 143 + compatible = "fsl,mpic-global-timer"; 144 + reg = <0x42100 0x100 0x42300 4>; 145 + interrupts = <4 0 3 0 146 + 5 0 3 0 147 + 6 0 3 0 148 + 7 0 3 0>; 149 + };
+1 -1
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
··· 358 358 16 2 1 30>; 359 359 }; 360 360 361 - /include/ "qoriq-mpic.dtsi" 361 + /include/ "qoriq-mpic4.3.dtsi" 362 362 363 363 guts: global-utilities@e0000 { 364 364 compatible = "fsl,t4240-device-config", "fsl,qoriq-device-config-2.0";
+280
arch/powerpc/boot/dts/p1020rdb-pd.dts
··· 1 + /* 2 + * P1020 RDB-PD Device Tree Source (32-bit address map) 3 + * 4 + * Copyright 2013 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/p1020si-pre.dtsi" 36 + / { 37 + model = "fsl,P1020RDB-PD"; 38 + compatible = "fsl,P1020RDB-PD"; 39 + 40 + memory { 41 + device_type = "memory"; 42 + }; 43 + 44 + lbc: localbus@ffe05000 { 45 + reg = <0x0 0xffe05000 0x0 0x1000>; 46 + 47 + /* NOR, NAND flash, L2 switch and CPLD */ 48 + ranges = <0x0 0x0 0x0 0xec000000 0x04000000 49 + 0x1 0x0 0x0 0xff800000 0x00040000 50 + 0x2 0x0 0x0 0xffa00000 0x00020000 51 + 0x3 0x0 0x0 0xffb00000 0x00020000>; 52 + 53 + nor@0,0 { 54 + #address-cells = <1>; 55 + #size-cells = <1>; 56 + compatible = "cfi-flash"; 57 + reg = <0x0 0x0 0x4000000>; 58 + bank-width = <2>; 59 + device-width = <1>; 60 + 61 + partition@0 { 62 + /* 128KB for DTB Image */ 63 + reg = <0x0 0x00020000>; 64 + label = "NOR DTB Image"; 65 + }; 66 + 67 + partition@20000 { 68 + /* 3.875 MB for Linux Kernel Image */ 69 + reg = <0x00020000 0x003e0000>; 70 + label = "NOR Linux Kernel Image"; 71 + }; 72 + 73 + partition@400000 { 74 + /* 58MB for Root file System */ 75 + reg = <0x00400000 0x03a00000>; 76 + label = "NOR Root File System"; 77 + }; 78 + 79 + partition@3e00000 { 80 + /* This location must not be altered */ 81 + /* 1M for Vitesse 7385 Switch firmware */ 82 + reg = <0x3e00000 0x00100000>; 83 + label = "NOR Vitesse-7385 Firmware"; 84 + read-only; 85 + }; 86 + 87 + partition@3f00000 { 88 + /* This location must not be altered */ 89 + /* 512KB for u-boot Bootloader Image */ 90 + /* 512KB for u-boot Environment Variables */ 91 + reg = <0x03f00000 0x00100000>; 92 + label = "NOR U-Boot Image"; 93 + read-only; 94 + }; 95 + }; 96 + 97 + nand@1,0 { 98 + #address-cells = <1>; 99 + #size-cells = <1>; 100 + compatible = "fsl,p1020-fcm-nand", 101 + "fsl,elbc-fcm-nand"; 102 + reg = <0x1 0x0 0x40000>; 103 + 104 + partition@0 { 105 + /* This location must not be altered */ 106 + /* 1MB for u-boot Bootloader Image */ 107 + reg = <0x0 0x00100000>; 108 + label = "NAND U-Boot Image"; 109 + read-only; 110 + }; 111 + 112 + partition@100000 { 113 + /* 1MB for DTB Image */ 114 + reg = <0x00100000 0x00100000>; 115 + label = "NAND DTB Image"; 116 + }; 117 + 118 + partition@200000 { 119 + /* 4MB for Linux Kernel Image */ 120 + reg = <0x00200000 0x00400000>; 121 + label = "NAND Linux Kernel Image"; 122 + }; 123 + 124 + partition@600000 { 125 + /* 122MB for File System Image */ 126 + reg = <0x00600000 0x07a00000>; 127 + label = "NAND File System Image"; 128 + }; 129 + }; 130 + 131 + cpld@2,0 { 132 + compatible = "fsl,p1020rdb-pd-cpld"; 133 + reg = <0x2 0x0 0x20000>; 134 + }; 135 + 136 + L2switch@3,0 { 137 + #address-cells = <1>; 138 + #size-cells = <1>; 139 + compatible = "vitesse-7385"; 140 + reg = <0x3 0x0 0x20000>; 141 + }; 142 + }; 143 + 144 + soc: soc@ffe00000 { 145 + ranges = <0x0 0x0 0xffe00000 0x100000>; 146 + 147 + i2c@3000 { 148 + rtc@68 { 149 + compatible = "dallas,ds1339"; 150 + reg = <0x68>; 151 + }; 152 + }; 153 + 154 + spi@7000 { 155 + flash@0 { 156 + #address-cells = <1>; 157 + #size-cells = <1>; 158 + compatible = "spansion,s25sl12801"; 159 + reg = <0>; 160 + /* input clock */ 161 + spi-max-frequency = <40000000>; 162 + 163 + partition@0 { 164 + /* 512KB for u-boot Bootloader Image */ 165 + reg = <0x0 0x00080000>; 166 + label = "SPI U-Boot Image"; 167 + read-only; 168 + }; 169 + 170 + partition@80000 { 171 + /* 512KB for DTB Image*/ 172 + reg = <0x00080000 0x00080000>; 173 + label = "SPI DTB Image"; 174 + }; 175 + 176 + partition@100000 { 177 + /* 4MB for Linux Kernel Image */ 178 + reg = <0x00100000 0x00400000>; 179 + label = "SPI Linux Kernel Image"; 180 + }; 181 + 182 + partition@500000 { 183 + /* 11MB for FS System Image */ 184 + reg = <0x00500000 0x00b00000>; 185 + label = "SPI File System Image"; 186 + }; 187 + }; 188 + 189 + slic@0 { 190 + compatible = "zarlink,le88266"; 191 + reg = <1>; 192 + spi-max-frequency = <8000000>; 193 + }; 194 + 195 + slic@1 { 196 + compatible = "zarlink,le88266"; 197 + reg = <2>; 198 + spi-max-frequency = <8000000>; 199 + }; 200 + }; 201 + 202 + mdio@24000 { 203 + phy0: ethernet-phy@0 { 204 + interrupts = <3 1 0 0>; 205 + reg = <0x0>; 206 + }; 207 + 208 + phy1: ethernet-phy@1 { 209 + interrupts = <2 1 0 0>; 210 + reg = <0x1>; 211 + }; 212 + }; 213 + 214 + mdio@25000 { 215 + tbi1: tbi-phy@11 { 216 + reg = <0x11>; 217 + device_type = "tbi-phy"; 218 + }; 219 + }; 220 + 221 + mdio@26000 { 222 + tbi2: tbi-phy@11 { 223 + reg = <0x11>; 224 + device_type = "tbi-phy"; 225 + }; 226 + }; 227 + 228 + enet0: ethernet@b0000 { 229 + fixed-link = <1 1 1000 0 0>; 230 + phy-connection-type = "rgmii-id"; 231 + }; 232 + 233 + enet1: ethernet@b1000 { 234 + phy-handle = <&phy0>; 235 + tbi-handle = <&tbi1>; 236 + phy-connection-type = "sgmii"; 237 + }; 238 + 239 + enet2: ethernet@b2000 { 240 + phy-handle = <&phy1>; 241 + phy-connection-type = "rgmii-id"; 242 + }; 243 + 244 + usb@22000 { 245 + phy_type = "ulpi"; 246 + }; 247 + }; 248 + 249 + pci0: pcie@ffe09000 { 250 + reg = <0x0 0xffe09000 0x0 0x1000>; 251 + ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x20000000 252 + 0x1000000 0x0 0x00000000 0x0 0xffc10000 0x0 0x10000>; 253 + pcie@0 { 254 + ranges = <0x2000000 0x0 0xa0000000 255 + 0x2000000 0x0 0xa0000000 256 + 0x0 0x20000000 257 + 258 + 0x1000000 0x0 0x0 259 + 0x1000000 0x0 0x0 260 + 0x0 0x100000>; 261 + }; 262 + }; 263 + 264 + pci1: pcie@ffe0a000 { 265 + reg = <0x0 0xffe0a000 0x0 0x1000>; 266 + ranges = <0x2000000 0x0 0x80000000 0x0 0x80000000 0x0 0x20000000 267 + 0x1000000 0x0 0x00000000 0x0 0xffc00000 0x0 0x10000>; 268 + pcie@0 { 269 + ranges = <0x2000000 0x0 0x80000000 270 + 0x2000000 0x0 0x80000000 271 + 0x0 0x20000000 272 + 273 + 0x1000000 0x0 0x0 274 + 0x1000000 0x0 0x0 275 + 0x0 0x100000>; 276 + }; 277 + }; 278 + }; 279 + 280 + /include/ "fsl/p1020si-post.dtsi"
+1
arch/powerpc/configs/85xx/p1023rds_defconfig
··· 63 63 CONFIG_IP_SCTP=m 64 64 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 65 65 CONFIG_DEVTMPFS=y 66 + CONFIG_DEVTMPFS_MOUNT=y 66 67 CONFIG_PROC_DEVICETREE=y 67 68 CONFIG_BLK_DEV_LOOP=y 68 69 CONFIG_BLK_DEV_RAM=y
+1
arch/powerpc/configs/corenet32_smp_defconfig
··· 70 70 CONFIG_IP_SCTP=m 71 71 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 72 72 CONFIG_DEVTMPFS=y 73 + CONFIG_DEVTMPFS_MOUNT=y 73 74 CONFIG_MTD=y 74 75 CONFIG_MTD_CMDLINE_PARTS=y 75 76 CONFIG_MTD_CHAR=y
+1
arch/powerpc/configs/corenet64_smp_defconfig
··· 59 59 CONFIG_IP_SCTP=m 60 60 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 61 61 CONFIG_DEVTMPFS=y 62 + CONFIG_DEVTMPFS_MOUNT=y 62 63 CONFIG_MTD=y 63 64 CONFIG_MTD_PARTITIONS=y 64 65 CONFIG_MTD_OF_PARTS=y
+1
arch/powerpc/configs/mpc83xx_defconfig
··· 42 42 # CONFIG_IPV6 is not set 43 43 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 44 44 CONFIG_DEVTMPFS=y 45 + CONFIG_DEVTMPFS_MOUNT=y 45 46 # CONFIG_FW_LOADER is not set 46 47 CONFIG_MTD=y 47 48 CONFIG_MTD_CHAR=y
+1
arch/powerpc/configs/mpc85xx_defconfig
··· 78 78 CONFIG_IP_SCTP=m 79 79 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 80 80 CONFIG_DEVTMPFS=y 81 + CONFIG_DEVTMPFS_MOUNT=y 81 82 CONFIG_MTD=y 82 83 CONFIG_MTD_PARTITIONS=y 83 84 CONFIG_MTD_OF_PARTS=y
+1
arch/powerpc/configs/mpc85xx_smp_defconfig
··· 81 81 CONFIG_IP_SCTP=m 82 82 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 83 83 CONFIG_DEVTMPFS=y 84 + CONFIG_DEVTMPFS_MOUNT=y 84 85 CONFIG_MTD=y 85 86 CONFIG_MTD_PARTITIONS=y 86 87 CONFIG_MTD_OF_PARTS=y
+6
arch/powerpc/include/asm/epapr_hcalls.h
··· 105 105 extern bool epapr_paravirt_enabled; 106 106 extern u32 epapr_hypercall_start[]; 107 107 108 + #ifdef CONFIG_EPAPR_PARAVIRT 109 + int __init epapr_paravirt_early_init(void); 110 + #else 111 + static inline int epapr_paravirt_early_init(void) { return 0; } 112 + #endif 113 + 108 114 /* 109 115 * We use "uintptr_t" to define a register because it's guaranteed to be a 110 116 * 32-bit integer on a 32-bit platform, and a 64-bit integer on a 64-bit
+7
arch/powerpc/include/asm/mpic.h
··· 396 396 #define MPIC_REGSET_TSI108 MPIC_REGSET(1) /* Tsi108/109 PIC */ 397 397 398 398 /* Get the version of primary MPIC */ 399 + #ifdef CONFIG_MPIC 399 400 extern u32 fsl_mpic_primary_get_version(void); 401 + #else 402 + static inline u32 fsl_mpic_primary_get_version(void) 403 + { 404 + return 0; 405 + } 406 + #endif 400 407 401 408 /* Allocate the controller structure and setup the linux irq descs 402 409 * for the range if interrupts passed in. No HW initialization is
+1 -1
arch/powerpc/include/asm/perf_event_fsl_emb.h
··· 13 13 #include <linux/types.h> 14 14 #include <asm/hw_irq.h> 15 15 16 - #define MAX_HWEVENTS 4 16 + #define MAX_HWEVENTS 6 17 17 18 18 /* event flags */ 19 19 #define FSL_EMB_EVENT_VALID 1
+47
arch/powerpc/include/asm/ppc-opcode.h
··· 81 81 #define __REGA0_R30 30 82 82 #define __REGA0_R31 31 83 83 84 + /* opcode and xopcode for instructions */ 85 + #define OP_TRAP 3 86 + #define OP_TRAP_64 2 87 + 88 + #define OP_31_XOP_TRAP 4 89 + #define OP_31_XOP_LWZX 23 90 + #define OP_31_XOP_DCBST 54 91 + #define OP_31_XOP_LWZUX 55 92 + #define OP_31_XOP_TRAP_64 68 93 + #define OP_31_XOP_DCBF 86 94 + #define OP_31_XOP_LBZX 87 95 + #define OP_31_XOP_STWX 151 96 + #define OP_31_XOP_STBX 215 97 + #define OP_31_XOP_LBZUX 119 98 + #define OP_31_XOP_STBUX 247 99 + #define OP_31_XOP_LHZX 279 100 + #define OP_31_XOP_LHZUX 311 101 + #define OP_31_XOP_MFSPR 339 102 + #define OP_31_XOP_LHAX 343 103 + #define OP_31_XOP_LHAUX 375 104 + #define OP_31_XOP_STHX 407 105 + #define OP_31_XOP_STHUX 439 106 + #define OP_31_XOP_MTSPR 467 107 + #define OP_31_XOP_DCBI 470 108 + #define OP_31_XOP_LWBRX 534 109 + #define OP_31_XOP_TLBSYNC 566 110 + #define OP_31_XOP_STWBRX 662 111 + #define OP_31_XOP_LHBRX 790 112 + #define OP_31_XOP_STHBRX 918 113 + 114 + #define OP_LWZ 32 115 + #define OP_LD 58 116 + #define OP_LWZU 33 117 + #define OP_LBZ 34 118 + #define OP_LBZU 35 119 + #define OP_STW 36 120 + #define OP_STWU 37 121 + #define OP_STD 62 122 + #define OP_STB 38 123 + #define OP_STBU 39 124 + #define OP_LHZ 40 125 + #define OP_LHZU 41 126 + #define OP_LHA 42 127 + #define OP_LHAU 43 128 + #define OP_STH 44 129 + #define OP_STHU 45 130 + 84 131 /* sorted alphabetically */ 85 132 #define PPC_INST_BHRBE 0x7c00025c 86 133 #define PPC_INST_CLRBHRB 0x7c00035c
+19 -5
arch/powerpc/include/asm/reg_fsl_emb.h
··· 17 17 /* Freescale Book E Performance Monitor APU Registers */ 18 18 #define PMRN_PMC0 0x010 /* Performance Monitor Counter 0 */ 19 19 #define PMRN_PMC1 0x011 /* Performance Monitor Counter 1 */ 20 - #define PMRN_PMC2 0x012 /* Performance Monitor Counter 1 */ 21 - #define PMRN_PMC3 0x013 /* Performance Monitor Counter 1 */ 20 + #define PMRN_PMC2 0x012 /* Performance Monitor Counter 2 */ 21 + #define PMRN_PMC3 0x013 /* Performance Monitor Counter 3 */ 22 + #define PMRN_PMC4 0x014 /* Performance Monitor Counter 4 */ 23 + #define PMRN_PMC5 0x015 /* Performance Monitor Counter 5 */ 22 24 #define PMRN_PMLCA0 0x090 /* PM Local Control A0 */ 23 25 #define PMRN_PMLCA1 0x091 /* PM Local Control A1 */ 24 26 #define PMRN_PMLCA2 0x092 /* PM Local Control A2 */ 25 27 #define PMRN_PMLCA3 0x093 /* PM Local Control A3 */ 28 + #define PMRN_PMLCA4 0x094 /* PM Local Control A4 */ 29 + #define PMRN_PMLCA5 0x095 /* PM Local Control A5 */ 26 30 27 31 #define PMLCA_FC 0x80000000 /* Freeze Counter */ 28 32 #define PMLCA_FCS 0x40000000 /* Freeze in Supervisor */ ··· 34 30 #define PMLCA_FCM1 0x10000000 /* Freeze when PMM==1 */ 35 31 #define PMLCA_FCM0 0x08000000 /* Freeze when PMM==0 */ 36 32 #define PMLCA_CE 0x04000000 /* Condition Enable */ 33 + #define PMLCA_FGCS1 0x00000002 /* Freeze in guest state */ 34 + #define PMLCA_FGCS0 0x00000001 /* Freeze in hypervisor state */ 37 35 38 - #define PMLCA_EVENT_MASK 0x00ff0000 /* Event field */ 36 + #define PMLCA_EVENT_MASK 0x01ff0000 /* Event field */ 39 37 #define PMLCA_EVENT_SHIFT 16 40 38 41 39 #define PMRN_PMLCB0 0x110 /* PM Local Control B0 */ 42 40 #define PMRN_PMLCB1 0x111 /* PM Local Control B1 */ 43 41 #define PMRN_PMLCB2 0x112 /* PM Local Control B2 */ 44 42 #define PMRN_PMLCB3 0x113 /* PM Local Control B3 */ 43 + #define PMRN_PMLCB4 0x114 /* PM Local Control B4 */ 44 + #define PMRN_PMLCB5 0x115 /* PM Local Control B5 */ 45 45 46 46 #define PMLCB_THRESHMUL_MASK 0x0700 /* Threshold Multiple Field */ 47 47 #define PMLCB_THRESHMUL_SHIFT 8 ··· 63 55 64 56 #define PMRN_UPMC0 0x000 /* User Performance Monitor Counter 0 */ 65 57 #define PMRN_UPMC1 0x001 /* User Performance Monitor Counter 1 */ 66 - #define PMRN_UPMC2 0x002 /* User Performance Monitor Counter 1 */ 67 - #define PMRN_UPMC3 0x003 /* User Performance Monitor Counter 1 */ 58 + #define PMRN_UPMC2 0x002 /* User Performance Monitor Counter 2 */ 59 + #define PMRN_UPMC3 0x003 /* User Performance Monitor Counter 3 */ 60 + #define PMRN_UPMC4 0x004 /* User Performance Monitor Counter 4 */ 61 + #define PMRN_UPMC5 0x005 /* User Performance Monitor Counter 5 */ 68 62 #define PMRN_UPMLCA0 0x080 /* User PM Local Control A0 */ 69 63 #define PMRN_UPMLCA1 0x081 /* User PM Local Control A1 */ 70 64 #define PMRN_UPMLCA2 0x082 /* User PM Local Control A2 */ 71 65 #define PMRN_UPMLCA3 0x083 /* User PM Local Control A3 */ 66 + #define PMRN_UPMLCA4 0x084 /* User PM Local Control A4 */ 67 + #define PMRN_UPMLCA5 0x085 /* User PM Local Control A5 */ 72 68 #define PMRN_UPMLCB0 0x100 /* User PM Local Control B0 */ 73 69 #define PMRN_UPMLCB1 0x101 /* User PM Local Control B1 */ 74 70 #define PMRN_UPMLCB2 0x102 /* User PM Local Control B2 */ 75 71 #define PMRN_UPMLCB3 0x103 /* User PM Local Control B3 */ 72 + #define PMRN_UPMLCB4 0x104 /* User PM Local Control B4 */ 73 + #define PMRN_UPMLCB5 0x105 /* User PM Local Control B5 */ 76 74 #define PMRN_UPMGC0 0x180 /* User PM Global Control 0 */ 77 75 78 76
+1 -1
arch/powerpc/kernel/cpu_setup_fsl_booke.S
··· 75 75 bl __e500_icache_setup 76 76 bl __e500_dcache_setup 77 77 bl __setup_e500_ivors 78 - #ifdef CONFIG_FSL_RIO 78 + #if defined(CONFIG_FSL_RIO) || defined(CONFIG_FSL_PCI) 79 79 /* Ensure that RFXE is set */ 80 80 mfspr r3,SPRN_HID1 81 81 oris r3,r3,HID1_RFXE@h
+1 -1
arch/powerpc/kernel/cputable.c
··· 2105 2105 MMU_FTR_USE_TLBILX, 2106 2106 .icache_bsize = 64, 2107 2107 .dcache_bsize = 64, 2108 - .num_pmcs = 4, 2108 + .num_pmcs = 6, 2109 2109 .oprofile_cpu_type = "ppc/e6500", 2110 2110 .oprofile_type = PPC_OPROFILE_FSL_EMB, 2111 2111 .cpu_setup = __setup_cpu_e6500,
+16 -12
arch/powerpc/kernel/epapr_paravirt.c
··· 30 30 31 31 bool epapr_paravirt_enabled; 32 32 33 - static int __init epapr_paravirt_init(void) 33 + static int __init early_init_dt_scan_epapr(unsigned long node, 34 + const char *uname, 35 + int depth, void *data) 34 36 { 35 - struct device_node *hyper_node; 36 37 const u32 *insts; 37 - int len, i; 38 + unsigned long len; 39 + int i; 38 40 39 - hyper_node = of_find_node_by_path("/hypervisor"); 40 - if (!hyper_node) 41 - return -ENODEV; 42 - 43 - insts = of_get_property(hyper_node, "hcall-instructions", &len); 41 + insts = of_get_flat_dt_prop(node, "hcall-instructions", &len); 44 42 if (!insts) 45 - return -ENODEV; 43 + return 0; 46 44 47 45 if (len % 4 || len > (4 * 4)) 48 - return -ENODEV; 46 + return -1; 49 47 50 48 for (i = 0; i < (len / 4); i++) { 51 49 patch_instruction(epapr_hypercall_start + i, insts[i]); ··· 53 55 } 54 56 55 57 #if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) 56 - if (of_get_property(hyper_node, "has-idle", NULL)) 58 + if (of_get_flat_dt_prop(node, "has-idle", NULL)) 57 59 ppc_md.power_save = epapr_ev_idle; 58 60 #endif 59 61 60 62 epapr_paravirt_enabled = true; 61 63 64 + return 1; 65 + } 66 + 67 + int __init epapr_paravirt_early_init(void) 68 + { 69 + of_scan_flat_dt(early_init_dt_scan_epapr, NULL); 70 + 62 71 return 0; 63 72 } 64 73 65 - early_initcall(epapr_paravirt_init);
+3 -1
arch/powerpc/kernel/setup_32.c
··· 38 38 #include <asm/serial.h> 39 39 #include <asm/udbg.h> 40 40 #include <asm/mmu_context.h> 41 + #include <asm/epapr_hcalls.h> 41 42 42 43 #include "setup.h" 43 44 ··· 128 127 129 128 /* Do some early initialization based on the flat device tree */ 130 129 early_init_devtree(__va(dt_ptr)); 130 + 131 + epapr_paravirt_early_init(); 131 132 132 133 early_init_mmu(); 133 134 ··· 329 326 330 327 /* Initialize the MMU context management stuff */ 331 328 mmu_context_init(); 332 - 333 329 }
+3
arch/powerpc/kernel/setup_64.c
··· 66 66 #include <asm/code-patching.h> 67 67 #include <asm/kvm_ppc.h> 68 68 #include <asm/hugetlb.h> 69 + #include <asm/epapr_hcalls.h> 69 70 70 71 #include "setup.h" 71 72 ··· 215 214 * calculating/retrieving the hash table size. 216 215 */ 217 216 early_init_devtree(__va(dt_ptr)); 217 + 218 + epapr_paravirt_early_init(); 218 219 219 220 /* Now we know the logical id of our boot cpu, setup the paca. */ 220 221 setup_paca(&paca[boot_cpuid]);
+8
arch/powerpc/kernel/swsusp_booke.S
··· 141 141 lis r11,swsusp_save_area@h 142 142 ori r11,r11,swsusp_save_area@l 143 143 144 + /* 145 + * Mappings from virtual addresses to physical addresses may be 146 + * different than they were prior to restoring hibernation state. 147 + * Invalidate the TLB so that the boot CPU is using the new 148 + * mappings. 149 + */ 150 + bl _tlbil_all 151 + 144 152 lwz r4,SL_SPRG0(r11) 145 153 mtsprg 0,r4 146 154 lwz r4,SL_SPRG1(r11)
+3
arch/powerpc/kernel/traps.c
··· 62 62 #include <asm/switch_to.h> 63 63 #include <asm/tm.h> 64 64 #include <asm/debug.h> 65 + #include <sysdev/fsl_pci.h> 65 66 66 67 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC) 67 68 int (*__debugger)(struct pt_regs *regs) __read_mostly; ··· 567 566 568 567 if (reason & MCSR_BUS_RBERR) { 569 568 if (fsl_rio_mcheck_exception(regs)) 569 + return 1; 570 + if (fsl_pci_mcheck_exception(regs)) 570 571 return 1; 571 572 } 572 573
+1 -44
arch/powerpc/kvm/emulate.c
··· 30 30 #include <asm/byteorder.h> 31 31 #include <asm/kvm_ppc.h> 32 32 #include <asm/disassemble.h> 33 + #include <asm/ppc-opcode.h> 33 34 #include "timing.h" 34 35 #include "trace.h" 35 - 36 - #define OP_TRAP 3 37 - #define OP_TRAP_64 2 38 - 39 - #define OP_31_XOP_TRAP 4 40 - #define OP_31_XOP_LWZX 23 41 - #define OP_31_XOP_DCBST 54 42 - #define OP_31_XOP_TRAP_64 68 43 - #define OP_31_XOP_DCBF 86 44 - #define OP_31_XOP_LBZX 87 45 - #define OP_31_XOP_STWX 151 46 - #define OP_31_XOP_STBX 215 47 - #define OP_31_XOP_LBZUX 119 48 - #define OP_31_XOP_STBUX 247 49 - #define OP_31_XOP_LHZX 279 50 - #define OP_31_XOP_LHZUX 311 51 - #define OP_31_XOP_MFSPR 339 52 - #define OP_31_XOP_LHAX 343 53 - #define OP_31_XOP_STHX 407 54 - #define OP_31_XOP_STHUX 439 55 - #define OP_31_XOP_MTSPR 467 56 - #define OP_31_XOP_DCBI 470 57 - #define OP_31_XOP_LWBRX 534 58 - #define OP_31_XOP_TLBSYNC 566 59 - #define OP_31_XOP_STWBRX 662 60 - #define OP_31_XOP_LHBRX 790 61 - #define OP_31_XOP_STHBRX 918 62 - 63 - #define OP_LWZ 32 64 - #define OP_LD 58 65 - #define OP_LWZU 33 66 - #define OP_LBZ 34 67 - #define OP_LBZU 35 68 - #define OP_STW 36 69 - #define OP_STWU 37 70 - #define OP_STD 62 71 - #define OP_STB 38 72 - #define OP_STBU 39 73 - #define OP_LHZ 40 74 - #define OP_LHZU 41 75 - #define OP_LHA 42 76 - #define OP_LHAU 43 77 - #define OP_STH 44 78 - #define OP_STHU 45 79 36 80 37 void kvmppc_emulate_dec(struct kvm_vcpu *vcpu) 81 38 {
+30
arch/powerpc/oprofile/op_model_fsl_emb.c
··· 46 46 case 3: 47 47 pmlca = mfpmr(PMRN_PMLCA3); 48 48 break; 49 + case 4: 50 + pmlca = mfpmr(PMRN_PMLCA4); 51 + break; 52 + case 5: 53 + pmlca = mfpmr(PMRN_PMLCA5); 54 + break; 49 55 default: 50 56 panic("Bad ctr number\n"); 51 57 } ··· 74 68 case 3: 75 69 mtpmr(PMRN_PMLCA3, pmlca); 76 70 break; 71 + case 4: 72 + mtpmr(PMRN_PMLCA4, pmlca); 73 + break; 74 + case 5: 75 + mtpmr(PMRN_PMLCA5, pmlca); 76 + break; 77 77 default: 78 78 panic("Bad ctr number\n"); 79 79 } ··· 96 84 return mfpmr(PMRN_PMC2); 97 85 case 3: 98 86 return mfpmr(PMRN_PMC3); 87 + case 4: 88 + return mfpmr(PMRN_PMC4); 89 + case 5: 90 + return mfpmr(PMRN_PMC5); 99 91 default: 100 92 return 0; 101 93 } ··· 119 103 break; 120 104 case 3: 121 105 mtpmr(PMRN_PMC3, val); 106 + break; 107 + case 4: 108 + mtpmr(PMRN_PMC4, val); 109 + break; 110 + case 5: 111 + mtpmr(PMRN_PMC5, val); 122 112 break; 123 113 default: 124 114 break; ··· 154 132 case 3: 155 133 mtpmr(PMRN_PMLCA3, pmlca); 156 134 mtpmr(PMRN_PMLCB3, pmlcb); 135 + break; 136 + case 4: 137 + mtpmr(PMRN_PMLCA4, pmlca); 138 + mtpmr(PMRN_PMLCB4, pmlcb); 139 + break; 140 + case 5: 141 + mtpmr(PMRN_PMLCA5, pmlca); 142 + mtpmr(PMRN_PMLCB5, pmlcb); 157 143 break; 158 144 default: 159 145 panic("Bad ctr number!\n");
+1 -1
arch/powerpc/perf/Makefile
··· 9 9 obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o 10 10 11 11 obj-$(CONFIG_FSL_EMB_PERF_EVENT) += core-fsl-emb.o 12 - obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o 12 + obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o e6500-pmu.o 13 13 14 14 obj-$(CONFIG_PPC64) += $(obj64-y) 15 15 obj-$(CONFIG_PPC32) += $(obj32-y)
+30
arch/powerpc/perf/core-fsl-emb.c
··· 70 70 case 3: 71 71 val = mfpmr(PMRN_PMC3); 72 72 break; 73 + case 4: 74 + val = mfpmr(PMRN_PMC4); 75 + break; 76 + case 5: 77 + val = mfpmr(PMRN_PMC5); 78 + break; 73 79 default: 74 80 printk(KERN_ERR "oops trying to read PMC%d\n", idx); 75 81 val = 0; ··· 100 94 break; 101 95 case 3: 102 96 mtpmr(PMRN_PMC3, val); 97 + break; 98 + case 4: 99 + mtpmr(PMRN_PMC4, val); 100 + break; 101 + case 5: 102 + mtpmr(PMRN_PMC5, val); 103 103 break; 104 104 default: 105 105 printk(KERN_ERR "oops trying to write PMC%d\n", idx); ··· 132 120 case 3: 133 121 mtpmr(PMRN_PMLCA3, val); 134 122 break; 123 + case 4: 124 + mtpmr(PMRN_PMLCA4, val); 125 + break; 126 + case 5: 127 + mtpmr(PMRN_PMLCA5, val); 128 + break; 135 129 default: 136 130 printk(KERN_ERR "oops trying to write PMLCA%d\n", idx); 137 131 } ··· 162 144 break; 163 145 case 3: 164 146 mtpmr(PMRN_PMLCB3, val); 147 + break; 148 + case 4: 149 + mtpmr(PMRN_PMLCB4, val); 150 + break; 151 + case 5: 152 + mtpmr(PMRN_PMLCB5, val); 165 153 break; 166 154 default: 167 155 printk(KERN_ERR "oops trying to write PMLCB%d\n", idx); ··· 485 461 int err; 486 462 int num_restricted; 487 463 int i; 464 + 465 + if (ppmu->n_counter > MAX_HWEVENTS) { 466 + WARN(1, "No. of perf counters (%d) is higher than max array size(%d)\n", 467 + ppmu->n_counter, MAX_HWEVENTS); 468 + ppmu->n_counter = MAX_HWEVENTS; 469 + } 488 470 489 471 switch (event->attr.type) { 490 472 case PERF_TYPE_HARDWARE:
+121
arch/powerpc/perf/e6500-pmu.c
··· 1 + /* 2 + * Performance counter support for e6500 family processors. 3 + * 4 + * Author: Priyanka Jain, Priyanka.Jain@freescale.com 5 + * Based on e500-pmu.c 6 + * Copyright 2013 Freescale Semiconductor, Inc. 7 + * Copyright 2008-2009 Paul Mackerras, IBM Corporation. 8 + * 9 + * This program is free software; you can redistribute it and/or 10 + * modify it under the terms of the GNU General Public License 11 + * as published by the Free Software Foundation; either version 12 + * 2 of the License, or (at your option) any later version. 13 + */ 14 + 15 + #include <linux/string.h> 16 + #include <linux/perf_event.h> 17 + #include <asm/reg.h> 18 + #include <asm/cputable.h> 19 + 20 + /* 21 + * Map of generic hardware event types to hardware events 22 + * Zero if unsupported 23 + */ 24 + static int e6500_generic_events[] = { 25 + [PERF_COUNT_HW_CPU_CYCLES] = 1, 26 + [PERF_COUNT_HW_INSTRUCTIONS] = 2, 27 + [PERF_COUNT_HW_CACHE_MISSES] = 221, 28 + [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 12, 29 + [PERF_COUNT_HW_BRANCH_MISSES] = 15, 30 + }; 31 + 32 + #define C(x) PERF_COUNT_HW_CACHE_##x 33 + 34 + /* 35 + * Table of generalized cache-related events. 36 + * 0 means not supported, -1 means nonsensical, other values 37 + * are event codes. 38 + */ 39 + static int e6500_cache_events[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = { 40 + [C(L1D)] = { 41 + /*RESULT_ACCESS RESULT_MISS */ 42 + [C(OP_READ)] = { 27, 222 }, 43 + [C(OP_WRITE)] = { 28, 223 }, 44 + [C(OP_PREFETCH)] = { 29, 0 }, 45 + }, 46 + [C(L1I)] = { 47 + /*RESULT_ACCESS RESULT_MISS */ 48 + [C(OP_READ)] = { 2, 254 }, 49 + [C(OP_WRITE)] = { -1, -1 }, 50 + [C(OP_PREFETCH)] = { 37, 0 }, 51 + }, 52 + /* 53 + * Assuming LL means L2, it's not a good match for this model. 54 + * It does not have separate read/write events (but it does have 55 + * separate instruction/data events). 56 + */ 57 + [C(LL)] = { 58 + /*RESULT_ACCESS RESULT_MISS */ 59 + [C(OP_READ)] = { 0, 0 }, 60 + [C(OP_WRITE)] = { 0, 0 }, 61 + [C(OP_PREFETCH)] = { 0, 0 }, 62 + }, 63 + /* 64 + * There are data/instruction MMU misses, but that's a miss on 65 + * the chip's internal level-one TLB which is probably not 66 + * what the user wants. Instead, unified level-two TLB misses 67 + * are reported here. 68 + */ 69 + [C(DTLB)] = { 70 + /*RESULT_ACCESS RESULT_MISS */ 71 + [C(OP_READ)] = { 26, 66 }, 72 + [C(OP_WRITE)] = { -1, -1 }, 73 + [C(OP_PREFETCH)] = { -1, -1 }, 74 + }, 75 + [C(BPU)] = { 76 + /*RESULT_ACCESS RESULT_MISS */ 77 + [C(OP_READ)] = { 12, 15 }, 78 + [C(OP_WRITE)] = { -1, -1 }, 79 + [C(OP_PREFETCH)] = { -1, -1 }, 80 + }, 81 + [C(NODE)] = { 82 + /* RESULT_ACCESS RESULT_MISS */ 83 + [C(OP_READ)] = { -1, -1 }, 84 + [C(OP_WRITE)] = { -1, -1 }, 85 + [C(OP_PREFETCH)] = { -1, -1 }, 86 + }, 87 + }; 88 + 89 + static int num_events = 512; 90 + 91 + /* Upper half of event id is PMLCb, for threshold events */ 92 + static u64 e6500_xlate_event(u64 event_id) 93 + { 94 + u32 event_low = (u32)event_id; 95 + if (event_low >= num_events || 96 + (event_id & (FSL_EMB_EVENT_THRESHMUL | FSL_EMB_EVENT_THRESH))) 97 + return 0; 98 + 99 + return FSL_EMB_EVENT_VALID; 100 + } 101 + 102 + static struct fsl_emb_pmu e6500_pmu = { 103 + .name = "e6500 family", 104 + .n_counter = 6, 105 + .n_restricted = 0, 106 + .xlate_event = e6500_xlate_event, 107 + .n_generic = ARRAY_SIZE(e6500_generic_events), 108 + .generic_events = e6500_generic_events, 109 + .cache_events = &e6500_cache_events, 110 + }; 111 + 112 + static int init_e6500_pmu(void) 113 + { 114 + if (!cur_cpu_spec->oprofile_cpu_type || 115 + strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc/e6500")) 116 + return -ENODEV; 117 + 118 + return register_fsl_emb_pmu(&e6500_pmu); 119 + } 120 + 121 + early_initcall(init_e6500_pmu);
-6
arch/powerpc/platforms/85xx/corenet_ds.c
··· 53 53 { 54 54 mpc85xx_smp_init(); 55 55 56 - #if defined(CONFIG_PCI) && defined(CONFIG_PPC64) 57 - pci_devs_phb_init(); 58 - #endif 59 - 60 - fsl_pci_assign_primary(); 61 - 62 56 swiotlb_detect_4g(); 63 57 64 58 pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
+22
arch/powerpc/platforms/85xx/mpc85xx_rdb.c
··· 160 160 machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices); 161 161 machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices); 162 162 machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices); 163 + machine_arch_initcall(p1020_rdb_pd, mpc85xx_common_publish_devices); 163 164 machine_arch_initcall(p1020_utm_pc, mpc85xx_common_publish_devices); 164 165 machine_arch_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices); 165 166 machine_arch_initcall(p1025_rdb, mpc85xx_common_publish_devices); ··· 192 191 unsigned long root = of_get_flat_dt_root(); 193 192 194 193 return of_flat_dt_is_compatible(root, "fsl,P1020RDB-PC"); 194 + } 195 + 196 + static int __init p1020_rdb_pd_probe(void) 197 + { 198 + unsigned long root = of_get_flat_dt_root(); 199 + 200 + return of_flat_dt_is_compatible(root, "fsl,P1020RDB-PD"); 195 201 } 196 202 197 203 static int __init p1021_rdb_pc_probe(void) ··· 348 340 define_machine(p1020_rdb_pc) { 349 341 .name = "P1020RDB-PC", 350 342 .probe = p1020_rdb_pc_probe, 343 + .setup_arch = mpc85xx_rdb_setup_arch, 344 + .init_IRQ = mpc85xx_rdb_pic_init, 345 + #ifdef CONFIG_PCI 346 + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 347 + #endif 348 + .get_irq = mpic_get_irq, 349 + .restart = fsl_rstcr_restart, 350 + .calibrate_decr = generic_calibrate_decr, 351 + .progress = udbg_progress, 352 + }; 353 + 354 + define_machine(p1020_rdb_pd) { 355 + .name = "P1020RDB-PD", 356 + .probe = p1020_rdb_pd_probe, 351 357 .setup_arch = mpc85xx_rdb_setup_arch, 352 358 .init_IRQ = mpc85xx_rdb_pic_init, 353 359 #ifdef CONFIG_PCI
+96 -41
arch/powerpc/sysdev/fsl_msi.c
··· 28 28 #include "fsl_msi.h" 29 29 #include "fsl_pci.h" 30 30 31 + #define MSIIR_OFFSET_MASK 0xfffff 32 + #define MSIIR_IBS_SHIFT 0 33 + #define MSIIR_SRS_SHIFT 5 34 + #define MSIIR1_IBS_SHIFT 4 35 + #define MSIIR1_SRS_SHIFT 0 36 + #define MSI_SRS_MASK 0xf 37 + #define MSI_IBS_MASK 0x1f 38 + 39 + #define msi_hwirq(msi, msir_index, intr_index) \ 40 + ((msir_index) << (msi)->srs_shift | \ 41 + ((intr_index) << (msi)->ibs_shift)) 42 + 31 43 static LIST_HEAD(msi_head); 32 44 33 45 struct fsl_msi_feature { ··· 92 80 93 81 static int fsl_msi_init_allocator(struct fsl_msi *msi_data) 94 82 { 95 - int rc; 83 + int rc, hwirq; 96 84 97 - rc = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS, 85 + rc = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS_MAX, 98 86 msi_data->irqhost->of_node); 99 87 if (rc) 100 88 return rc; 101 89 102 - rc = msi_bitmap_reserve_dt_hwirqs(&msi_data->bitmap); 103 - if (rc < 0) { 104 - msi_bitmap_free(&msi_data->bitmap); 105 - return rc; 106 - } 90 + /* 91 + * Reserve all the hwirqs 92 + * The available hwirqs will be released in fsl_msi_setup_hwirq() 93 + */ 94 + for (hwirq = 0; hwirq < NR_MSI_IRQS_MAX; hwirq++) 95 + msi_bitmap_reserve_hwirq(&msi_data->bitmap, hwirq); 107 96 108 97 return 0; 109 98 } ··· 157 144 158 145 msg->data = hwirq; 159 146 160 - pr_debug("%s: allocated srs: %d, ibs: %d\n", 161 - __func__, hwirq / IRQS_PER_MSI_REG, hwirq % IRQS_PER_MSI_REG); 147 + pr_debug("%s: allocated srs: %d, ibs: %d\n", __func__, 148 + (hwirq >> msi_data->srs_shift) & MSI_SRS_MASK, 149 + (hwirq >> msi_data->ibs_shift) & MSI_IBS_MASK); 162 150 } 163 151 164 152 static int fsl_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) ··· 269 255 270 256 msir_index = cascade_data->index; 271 257 272 - if (msir_index >= NR_MSI_REG) 258 + if (msir_index >= NR_MSI_REG_MAX) 273 259 cascade_irq = NO_IRQ; 274 260 275 261 irqd_set_chained_irq_inprogress(idata); ··· 299 285 intr_index = ffs(msir_value) - 1; 300 286 301 287 cascade_irq = irq_linear_revmap(msi_data->irqhost, 302 - msir_index * IRQS_PER_MSI_REG + 303 - intr_index + have_shift); 288 + msi_hwirq(msi_data, msir_index, 289 + intr_index + have_shift)); 304 290 if (cascade_irq != NO_IRQ) 305 291 generic_handle_irq(cascade_irq); 306 292 have_shift += intr_index + 1; ··· 330 316 331 317 if (msi->list.prev != NULL) 332 318 list_del(&msi->list); 333 - for (i = 0; i < NR_MSI_REG; i++) { 319 + for (i = 0; i < NR_MSI_REG_MAX; i++) { 334 320 virq = msi->msi_virqs[i]; 335 321 if (virq != NO_IRQ) { 336 322 cascade_data = irq_get_handler_data(virq); ··· 353 339 int offset, int irq_index) 354 340 { 355 341 struct fsl_msi_cascade_data *cascade_data = NULL; 356 - int virt_msir; 342 + int virt_msir, i; 357 343 358 344 virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index); 359 345 if (virt_msir == NO_IRQ) { ··· 374 360 irq_set_handler_data(virt_msir, cascade_data); 375 361 irq_set_chained_handler(virt_msir, fsl_msi_cascade); 376 362 363 + /* Release the hwirqs corresponding to this MSI register */ 364 + for (i = 0; i < IRQS_PER_MSI_REG; i++) 365 + msi_bitmap_free_hwirqs(&msi->bitmap, 366 + msi_hwirq(msi, offset, i), 1); 367 + 377 368 return 0; 378 369 } 379 370 ··· 387 368 { 388 369 const struct of_device_id *match; 389 370 struct fsl_msi *msi; 390 - struct resource res; 371 + struct resource res, msiir; 391 372 int err, i, j, irq_index, count; 392 - int rc; 393 373 const u32 *p; 394 374 const struct fsl_msi_feature *features; 395 375 int len; 396 376 u32 offset; 397 - static const u32 all_avail[] = { 0, NR_MSI_IRQS }; 398 377 399 378 match = of_match_device(fsl_of_msi_ids, &dev->dev); 400 379 if (!match) ··· 409 392 platform_set_drvdata(dev, msi); 410 393 411 394 msi->irqhost = irq_domain_add_linear(dev->dev.of_node, 412 - NR_MSI_IRQS, &fsl_msi_host_ops, msi); 395 + NR_MSI_IRQS_MAX, &fsl_msi_host_ops, msi); 413 396 414 397 if (msi->irqhost == NULL) { 415 398 dev_err(&dev->dev, "No memory for MSI irqhost\n"); ··· 438 421 } 439 422 msi->msiir_offset = 440 423 features->msiir_offset + (res.start & 0xfffff); 424 + 425 + /* 426 + * First read the MSIIR/MSIIR1 offset from dts 427 + * On failure use the hardcode MSIIR offset 428 + */ 429 + if (of_address_to_resource(dev->dev.of_node, 1, &msiir)) 430 + msi->msiir_offset = features->msiir_offset + 431 + (res.start & MSIIR_OFFSET_MASK); 432 + else 433 + msi->msiir_offset = msiir.start & MSIIR_OFFSET_MASK; 441 434 } 442 435 443 436 msi->feature = features->fsl_pic_ip; ··· 458 431 */ 459 432 msi->phandle = dev->dev.of_node->phandle; 460 433 461 - rc = fsl_msi_init_allocator(msi); 462 - if (rc) { 434 + err = fsl_msi_init_allocator(msi); 435 + if (err) { 463 436 dev_err(&dev->dev, "Error allocating MSI bitmap\n"); 464 437 goto error_out; 465 438 } 466 439 467 440 p = of_get_property(dev->dev.of_node, "msi-available-ranges", &len); 468 - if (p && len % (2 * sizeof(u32)) != 0) { 469 - dev_err(&dev->dev, "%s: Malformed msi-available-ranges property\n", 470 - __func__); 471 - err = -EINVAL; 472 - goto error_out; 473 - } 474 441 475 - if (!p) { 476 - p = all_avail; 477 - len = sizeof(all_avail); 478 - } 442 + if (of_device_is_compatible(dev->dev.of_node, "fsl,mpic-msi-v4.3")) { 443 + msi->srs_shift = MSIIR1_SRS_SHIFT; 444 + msi->ibs_shift = MSIIR1_IBS_SHIFT; 445 + if (p) 446 + dev_warn(&dev->dev, "%s: dose not support msi-available-ranges property\n", 447 + __func__); 479 448 480 - for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) { 481 - if (p[i * 2] % IRQS_PER_MSI_REG || 482 - p[i * 2 + 1] % IRQS_PER_MSI_REG) { 483 - printk(KERN_WARNING "%s: %s: msi available range of %u at %u is not IRQ-aligned\n", 484 - __func__, dev->dev.of_node->full_name, 485 - p[i * 2 + 1], p[i * 2]); 449 + for (irq_index = 0; irq_index < NR_MSI_REG_MSIIR1; 450 + irq_index++) { 451 + err = fsl_msi_setup_hwirq(msi, dev, 452 + irq_index, irq_index); 453 + if (err) 454 + goto error_out; 455 + } 456 + } else { 457 + static const u32 all_avail[] = 458 + { 0, NR_MSI_REG_MSIIR * IRQS_PER_MSI_REG }; 459 + 460 + msi->srs_shift = MSIIR_SRS_SHIFT; 461 + msi->ibs_shift = MSIIR_IBS_SHIFT; 462 + 463 + if (p && len % (2 * sizeof(u32)) != 0) { 464 + dev_err(&dev->dev, "%s: Malformed msi-available-ranges property\n", 465 + __func__); 486 466 err = -EINVAL; 487 467 goto error_out; 488 468 } 489 469 490 - offset = p[i * 2] / IRQS_PER_MSI_REG; 491 - count = p[i * 2 + 1] / IRQS_PER_MSI_REG; 470 + if (!p) { 471 + p = all_avail; 472 + len = sizeof(all_avail); 473 + } 492 474 493 - for (j = 0; j < count; j++, irq_index++) { 494 - err = fsl_msi_setup_hwirq(msi, dev, offset + j, irq_index); 495 - if (err) 475 + for (irq_index = 0, i = 0; i < len / (2 * sizeof(u32)); i++) { 476 + if (p[i * 2] % IRQS_PER_MSI_REG || 477 + p[i * 2 + 1] % IRQS_PER_MSI_REG) { 478 + pr_warn("%s: %s: msi available range of %u at %u is not IRQ-aligned\n", 479 + __func__, dev->dev.of_node->full_name, 480 + p[i * 2 + 1], p[i * 2]); 481 + err = -EINVAL; 496 482 goto error_out; 483 + } 484 + 485 + offset = p[i * 2] / IRQS_PER_MSI_REG; 486 + count = p[i * 2 + 1] / IRQS_PER_MSI_REG; 487 + 488 + for (j = 0; j < count; j++, irq_index++) { 489 + err = fsl_msi_setup_hwirq(msi, dev, offset + j, 490 + irq_index); 491 + if (err) 492 + goto error_out; 493 + } 497 494 } 498 495 } 499 496 ··· 557 506 static const struct of_device_id fsl_of_msi_ids[] = { 558 507 { 559 508 .compatible = "fsl,mpic-msi", 509 + .data = &mpic_msi_feature, 510 + }, 511 + { 512 + .compatible = "fsl,mpic-msi-v4.3", 560 513 .data = &mpic_msi_feature, 561 514 }, 562 515 {
+7 -3
arch/powerpc/sysdev/fsl_msi.h
··· 16 16 #include <linux/of.h> 17 17 #include <asm/msi_bitmap.h> 18 18 19 - #define NR_MSI_REG 8 19 + #define NR_MSI_REG_MSIIR 8 /* MSIIR can index 8 MSI registers */ 20 + #define NR_MSI_REG_MSIIR1 16 /* MSIIR1 can index 16 MSI registers */ 21 + #define NR_MSI_REG_MAX NR_MSI_REG_MSIIR1 20 22 #define IRQS_PER_MSI_REG 32 21 - #define NR_MSI_IRQS (NR_MSI_REG * IRQS_PER_MSI_REG) 23 + #define NR_MSI_IRQS_MAX (NR_MSI_REG_MAX * IRQS_PER_MSI_REG) 22 24 23 25 #define FSL_PIC_IP_MASK 0x0000000F 24 26 #define FSL_PIC_IP_MPIC 0x00000001 ··· 33 31 unsigned long cascade_irq; 34 32 35 33 u32 msiir_offset; /* Offset of MSIIR, relative to start of CCSR */ 34 + u32 ibs_shift; /* Shift of interrupt bit select */ 35 + u32 srs_shift; /* Shift of the shared interrupt register select */ 36 36 void __iomem *msi_regs; 37 37 u32 feature; 38 - int msi_virqs[NR_MSI_REG]; 38 + int msi_virqs[NR_MSI_REG_MAX]; 39 39 40 40 struct msi_bitmap bitmap; 41 41
+163 -21
arch/powerpc/sysdev/fsl_pci.c
··· 26 26 #include <linux/memblock.h> 27 27 #include <linux/log2.h> 28 28 #include <linux/slab.h> 29 + #include <linux/uaccess.h> 29 30 30 31 #include <asm/io.h> 31 32 #include <asm/prom.h> 32 33 #include <asm/pci-bridge.h> 34 + #include <asm/ppc-pci.h> 33 35 #include <asm/machdep.h> 36 + #include <asm/disassemble.h> 37 + #include <asm/ppc-opcode.h> 34 38 #include <sysdev/fsl_soc.h> 35 39 #include <sysdev/fsl_pci.h> 36 40 ··· 68 64 if (hose->indirect_type & PPC_INDIRECT_TYPE_FSL_CFG_REG_LINK) { 69 65 if (hose->ops->read == fsl_indirect_read_config) { 70 66 struct pci_bus bus; 71 - bus.number = 0; 67 + bus.number = hose->first_busno; 72 68 bus.sysdata = hose; 73 69 bus.ops = hose->ops; 74 70 indirect_read_config(&bus, 0, PCIE_LTSSM, 4, &val); ··· 301 297 if (early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) { 302 298 /* Size window to exact size if power-of-two or one size up */ 303 299 if ((1ull << mem_log) != mem) { 300 + mem_log++; 304 301 if ((1ull << mem_log) > mem) 305 302 pr_info("%s: Setting PCI inbound window " 306 303 "greater than memory size\n", name); 307 - mem_log++; 308 304 } 309 305 310 306 piwar |= ((mem_log - 1) & PIWAR_SZ_MASK); ··· 377 373 } 378 374 379 375 if (hose->dma_window_size < mem) { 380 - #ifndef CONFIG_SWIOTLB 376 + #ifdef CONFIG_SWIOTLB 377 + ppc_swiotlb_enable = 1; 378 + #else 381 379 pr_err("%s: ERROR: Memory size exceeds PCI ATMU ability to " 382 380 "map - enable CONFIG_SWIOTLB to avoid dma errors.\n", 383 381 name); ··· 874 868 return 0; 875 869 } 876 870 871 + #ifdef CONFIG_E500 872 + static int mcheck_handle_load(struct pt_regs *regs, u32 inst) 873 + { 874 + unsigned int rd, ra, rb, d; 875 + 876 + rd = get_rt(inst); 877 + ra = get_ra(inst); 878 + rb = get_rb(inst); 879 + d = get_d(inst); 880 + 881 + switch (get_op(inst)) { 882 + case 31: 883 + switch (get_xop(inst)) { 884 + case OP_31_XOP_LWZX: 885 + case OP_31_XOP_LWBRX: 886 + regs->gpr[rd] = 0xffffffff; 887 + break; 888 + 889 + case OP_31_XOP_LWZUX: 890 + regs->gpr[rd] = 0xffffffff; 891 + regs->gpr[ra] += regs->gpr[rb]; 892 + break; 893 + 894 + case OP_31_XOP_LBZX: 895 + regs->gpr[rd] = 0xff; 896 + break; 897 + 898 + case OP_31_XOP_LBZUX: 899 + regs->gpr[rd] = 0xff; 900 + regs->gpr[ra] += regs->gpr[rb]; 901 + break; 902 + 903 + case OP_31_XOP_LHZX: 904 + case OP_31_XOP_LHBRX: 905 + regs->gpr[rd] = 0xffff; 906 + break; 907 + 908 + case OP_31_XOP_LHZUX: 909 + regs->gpr[rd] = 0xffff; 910 + regs->gpr[ra] += regs->gpr[rb]; 911 + break; 912 + 913 + case OP_31_XOP_LHAX: 914 + regs->gpr[rd] = ~0UL; 915 + break; 916 + 917 + case OP_31_XOP_LHAUX: 918 + regs->gpr[rd] = ~0UL; 919 + regs->gpr[ra] += regs->gpr[rb]; 920 + break; 921 + 922 + default: 923 + return 0; 924 + } 925 + break; 926 + 927 + case OP_LWZ: 928 + regs->gpr[rd] = 0xffffffff; 929 + break; 930 + 931 + case OP_LWZU: 932 + regs->gpr[rd] = 0xffffffff; 933 + regs->gpr[ra] += (s16)d; 934 + break; 935 + 936 + case OP_LBZ: 937 + regs->gpr[rd] = 0xff; 938 + break; 939 + 940 + case OP_LBZU: 941 + regs->gpr[rd] = 0xff; 942 + regs->gpr[ra] += (s16)d; 943 + break; 944 + 945 + case OP_LHZ: 946 + regs->gpr[rd] = 0xffff; 947 + break; 948 + 949 + case OP_LHZU: 950 + regs->gpr[rd] = 0xffff; 951 + regs->gpr[ra] += (s16)d; 952 + break; 953 + 954 + case OP_LHA: 955 + regs->gpr[rd] = ~0UL; 956 + break; 957 + 958 + case OP_LHAU: 959 + regs->gpr[rd] = ~0UL; 960 + regs->gpr[ra] += (s16)d; 961 + break; 962 + 963 + default: 964 + return 0; 965 + } 966 + 967 + return 1; 968 + } 969 + 970 + static int is_in_pci_mem_space(phys_addr_t addr) 971 + { 972 + struct pci_controller *hose; 973 + struct resource *res; 974 + int i; 975 + 976 + list_for_each_entry(hose, &hose_list, list_node) { 977 + if (!(hose->indirect_type & PPC_INDIRECT_TYPE_EXT_REG)) 978 + continue; 979 + 980 + for (i = 0; i < 3; i++) { 981 + res = &hose->mem_resources[i]; 982 + if ((res->flags & IORESOURCE_MEM) && 983 + addr >= res->start && addr <= res->end) 984 + return 1; 985 + } 986 + } 987 + return 0; 988 + } 989 + 990 + int fsl_pci_mcheck_exception(struct pt_regs *regs) 991 + { 992 + u32 inst; 993 + int ret; 994 + phys_addr_t addr = 0; 995 + 996 + /* Let KVM/QEMU deal with the exception */ 997 + if (regs->msr & MSR_GS) 998 + return 0; 999 + 1000 + #ifdef CONFIG_PHYS_64BIT 1001 + addr = mfspr(SPRN_MCARU); 1002 + addr <<= 32; 1003 + #endif 1004 + addr += mfspr(SPRN_MCAR); 1005 + 1006 + if (is_in_pci_mem_space(addr)) { 1007 + if (user_mode(regs)) { 1008 + pagefault_disable(); 1009 + ret = get_user(regs->nip, &inst); 1010 + pagefault_enable(); 1011 + } else { 1012 + ret = probe_kernel_address(regs->nip, inst); 1013 + } 1014 + 1015 + if (mcheck_handle_load(regs, inst)) { 1016 + regs->nip += 4; 1017 + return 1; 1018 + } 1019 + } 1020 + 1021 + return 0; 1022 + } 1023 + #endif 1024 + 877 1025 #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) 878 1026 static const struct of_device_id pci_ids[] = { 879 1027 { .compatible = "fsl,mpc8540-pci", }, ··· 1088 928 { 1089 929 int ret; 1090 930 struct device_node *node; 1091 - #ifdef CONFIG_SWIOTLB 1092 - struct pci_controller *hose; 1093 - #endif 1094 931 1095 932 node = pdev->dev.of_node; 1096 933 ret = fsl_add_bridge(pdev, fsl_pci_primary == node); 1097 - 1098 - #ifdef CONFIG_SWIOTLB 1099 - if (ret == 0) { 1100 - hose = pci_find_hose_for_OF_device(pdev->dev.of_node); 1101 - 1102 - /* 1103 - * if we couldn't map all of DRAM via the dma windows 1104 - * we need SWIOTLB to handle buffers located outside of 1105 - * dma capable memory region 1106 - */ 1107 - if (memblock_end_of_DRAM() - 1 > hose->dma_window_base_cur + 1108 - hose->dma_window_size) 1109 - ppc_swiotlb_enable = 1; 1110 - } 1111 - #endif 1112 934 1113 935 mpc85xx_pci_err_probe(pdev); 1114 936
+6
arch/powerpc/sysdev/fsl_pci.h
··· 126 126 } 127 127 #endif 128 128 129 + #ifdef CONFIG_FSL_PCI 130 + extern int fsl_pci_mcheck_exception(struct pt_regs *); 131 + #else 132 + static inline int fsl_pci_mcheck_exception(struct pt_regs *regs) {return 0; } 133 + #endif 134 + 129 135 #endif /* __POWERPC_FSL_PCI_H */ 130 136 #endif /* __KERNEL__ */