Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (71 commits)
powerpc/44x: Update ppc44x_defconfig
powerpc/watchdog: Make default timeout for Book-E watchdog a Kconfig option
fsl_rio: Add comments for sRIO registers.
powerpc/fsl-booke: Add e55xx (64-bit) smp defconfig
powerpc/fsl-booke: Add p5020 DS board support
powerpc/fsl-booke64: Use TLB CAMs to cover linear mapping on FSL 64-bit chips
powerpc/fsl-booke: Add support for FSL Arch v1.0 MMU in setup_page_sizes
powerpc/fsl-booke: Add support for FSL 64-bit e5500 core
powerpc/85xx: add cache-sram support
powerpc/85xx: add ngPIXIS FPGA device tree node to the P1022DS board
powerpc: Fix compile error with paca code on ppc64e
powerpc/fsl-booke: Add p3041 DS board support
oprofile/fsl emb: Don't set MSR[PMM] until after clearing the interrupt.
powerpc/fsl-booke: Add PCI device ids for P2040/P3041/P5010/P5020 QoirQ chips
powerpc/mpc8xxx_gpio: Add support for 'qoriq-gpio' controllers
powerpc/fsl_booke: Add support to boot from core other than 0
powerpc/p1022: Add probing for individual DMA channels
powerpc/fsl_soc: Search all global-utilities nodes for rstccr
powerpc: Fix invalid page flags in create TLB CAM path for PTE_64BIT
powerpc/mpc83xx: Support for MPC8308 P1M board
...

Fix up conflict with the generic irq_work changes in arch/powerpc/kernel/time.c

+3678 -685
+2 -2
arch/powerpc/boot/addnote.c
··· 20 20 #include <string.h> 21 21 22 22 /* CHRP note section */ 23 - char arch[] = "PowerPC"; 23 + static const char arch[] = "PowerPC"; 24 24 25 25 #define N_DESCR 6 26 26 unsigned int descr[N_DESCR] = { ··· 33 33 }; 34 34 35 35 /* RPA note section */ 36 - char rpaname[] = "IBM,RPA-Client-Config"; 36 + static const char rpaname[] = "IBM,RPA-Client-Config"; 37 37 38 38 /* 39 39 * Note: setting ignore_my_client_config *should* mean that OF ignores
+254
arch/powerpc/boot/dts/bluestone.dts
··· 1 + /* 2 + * Device Tree for Bluestone (APM821xx) board. 3 + * 4 + * Copyright (c) 2010, Applied Micro Circuits Corporation 5 + * Author: Tirumala R Marri <tmarri@apm.com> 6 + * 7 + * This program is free software; you can redistribute it and/or 8 + * modify it under the terms of the GNU General Public License as 9 + * published by the Free Software Foundation; either version 2 of 10 + * the License, or (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 20 + * MA 02111-1307 USA 21 + * 22 + */ 23 + 24 + /dts-v1/; 25 + 26 + / { 27 + #address-cells = <2>; 28 + #size-cells = <1>; 29 + model = "apm,bluestone"; 30 + compatible = "apm,bluestone"; 31 + dcr-parent = <&{/cpus/cpu@0}>; 32 + 33 + aliases { 34 + ethernet0 = &EMAC0; 35 + serial0 = &UART0; 36 + serial1 = &UART1; 37 + }; 38 + 39 + cpus { 40 + #address-cells = <1>; 41 + #size-cells = <0>; 42 + 43 + cpu@0 { 44 + device_type = "cpu"; 45 + model = "PowerPC,apm821xx"; 46 + reg = <0x00000000>; 47 + clock-frequency = <0>; /* Filled in by U-Boot */ 48 + timebase-frequency = <0>; /* Filled in by U-Boot */ 49 + i-cache-line-size = <32>; 50 + d-cache-line-size = <32>; 51 + i-cache-size = <32768>; 52 + d-cache-size = <32768>; 53 + dcr-controller; 54 + dcr-access-method = "native"; 55 + next-level-cache = <&L2C0>; 56 + }; 57 + }; 58 + 59 + memory { 60 + device_type = "memory"; 61 + reg = <0x00000000 0x00000000 0x00000000>; /* Filled in by U-Boot */ 62 + }; 63 + 64 + UIC0: interrupt-controller0 { 65 + compatible = "ibm,uic"; 66 + interrupt-controller; 67 + cell-index = <0>; 68 + dcr-reg = <0x0c0 0x009>; 69 + #address-cells = <0>; 70 + #size-cells = <0>; 71 + #interrupt-cells = <2>; 72 + }; 73 + 74 + UIC1: interrupt-controller1 { 75 + compatible = "ibm,uic"; 76 + interrupt-controller; 77 + cell-index = <1>; 78 + dcr-reg = <0x0d0 0x009>; 79 + #address-cells = <0>; 80 + #size-cells = <0>; 81 + #interrupt-cells = <2>; 82 + interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 83 + interrupt-parent = <&UIC0>; 84 + }; 85 + 86 + UIC2: interrupt-controller2 { 87 + compatible = "ibm,uic"; 88 + interrupt-controller; 89 + cell-index = <2>; 90 + dcr-reg = <0x0e0 0x009>; 91 + #address-cells = <0>; 92 + #size-cells = <0>; 93 + #interrupt-cells = <2>; 94 + interrupts = <0xa 0x4 0xb 0x4>; /* cascade */ 95 + interrupt-parent = <&UIC0>; 96 + }; 97 + 98 + UIC3: interrupt-controller3 { 99 + compatible = "ibm,uic"; 100 + interrupt-controller; 101 + cell-index = <3>; 102 + dcr-reg = <0x0f0 0x009>; 103 + #address-cells = <0>; 104 + #size-cells = <0>; 105 + #interrupt-cells = <2>; 106 + interrupts = <0x10 0x4 0x11 0x4>; /* cascade */ 107 + interrupt-parent = <&UIC0>; 108 + }; 109 + 110 + SDR0: sdr { 111 + compatible = "ibm,sdr-apm821xx"; 112 + dcr-reg = <0x00e 0x002>; 113 + }; 114 + 115 + CPR0: cpr { 116 + compatible = "ibm,cpr-apm821xx"; 117 + dcr-reg = <0x00c 0x002>; 118 + }; 119 + 120 + plb { 121 + compatible = "ibm,plb4"; 122 + #address-cells = <2>; 123 + #size-cells = <1>; 124 + ranges; 125 + clock-frequency = <0>; /* Filled in by U-Boot */ 126 + 127 + SDRAM0: sdram { 128 + compatible = "ibm,sdram-apm821xx"; 129 + dcr-reg = <0x010 0x002>; 130 + }; 131 + 132 + MAL0: mcmal { 133 + compatible = "ibm,mcmal2"; 134 + descriptor-memory = "ocm"; 135 + dcr-reg = <0x180 0x062>; 136 + num-tx-chans = <1>; 137 + num-rx-chans = <1>; 138 + #address-cells = <0>; 139 + #size-cells = <0>; 140 + interrupt-parent = <&UIC2>; 141 + interrupts = < /*TXEOB*/ 0x6 0x4 142 + /*RXEOB*/ 0x7 0x4 143 + /*SERR*/ 0x3 0x4 144 + /*TXDE*/ 0x4 0x4 145 + /*RXDE*/ 0x5 0x4 146 + }; 147 + 148 + POB0: opb { 149 + compatible = "ibm,opb"; 150 + #address-cells = <1>; 151 + #size-cells = <1>; 152 + ranges = <0xb0000000 0x00000004 0xb0000000 0x50000000>; 153 + clock-frequency = <0>; /* Filled in by U-Boot */ 154 + 155 + EBC0: ebc { 156 + compatible = "ibm,ebc"; 157 + dcr-reg = <0x012 0x002>; 158 + #address-cells = <2>; 159 + #size-cells = <1>; 160 + clock-frequency = <0>; /* Filled in by U-Boot */ 161 + /* ranges property is supplied by U-Boot */ 162 + ranges = < 0x00000003 0x00000000 0xe0000000 0x8000000>; 163 + interrupts = <0x6 0x4>; 164 + interrupt-parent = <&UIC1>; 165 + 166 + nor_flash@0,0 { 167 + compatible = "amd,s29gl512n", "cfi-flash"; 168 + bank-width = <2>; 169 + reg = <0x00000000 0x00000000 0x00400000>; 170 + #address-cells = <1>; 171 + #size-cells = <1>; 172 + partition@0 { 173 + label = "kernel"; 174 + reg = <0x00000000 0x00180000>; 175 + }; 176 + partition@180000 { 177 + label = "env"; 178 + reg = <0x00180000 0x00020000>; 179 + }; 180 + partition@1a0000 { 181 + label = "u-boot"; 182 + reg = <0x001a0000 0x00060000>; 183 + }; 184 + }; 185 + } 186 + 187 + UART0: serial@ef600300 { 188 + device_type = "serial"; 189 + compatible = "ns16550"; 190 + reg = <0xef600300 0x00000008>; 191 + virtual-reg = <0xef600300>; 192 + clock-frequency = <0>; /* Filled in by U-Boot */ 193 + current-speed = <0>; /* Filled in by U-Boot */ 194 + interrupt-parent = <&UIC1>; 195 + interrupts = <0x1 0x4>; 196 + }; 197 + 198 + IIC0: i2c@ef600700 { 199 + compatible = "ibm,iic"; 200 + reg = <0xef600700 0x00000014>; 201 + interrupt-parent = <&UIC0>; 202 + interrupts = <0x2 0x4>; 203 + }; 204 + 205 + IIC1: i2c@ef600800 { 206 + compatible = "ibm,iic"; 207 + reg = <0xef600800 0x00000014>; 208 + interrupt-parent = <&UIC0>; 209 + interrupts = <0x3 0x4>; 210 + }; 211 + 212 + RGMII0: emac-rgmii@ef601500 { 213 + compatible = "ibm,rgmii"; 214 + reg = <0xef601500 0x00000008>; 215 + has-mdio; 216 + }; 217 + 218 + TAH0: emac-tah@ef601350 { 219 + compatible = "ibm,tah"; 220 + reg = <0xef601350 0x00000030>; 221 + }; 222 + 223 + EMAC0: ethernet@ef600c00 { 224 + device_type = "network"; 225 + compatible = "ibm,emac4sync"; 226 + interrupt-parent = <&EMAC0>; 227 + interrupts = <0x0 0x1>; 228 + #interrupt-cells = <1>; 229 + #address-cells = <0>; 230 + #size-cells = <0>; 231 + interrupt-map = </*Status*/ 0x0 &UIC2 0x10 0x4 232 + /*Wake*/ 0x1 &UIC2 0x14 0x4>; 233 + reg = <0xef600c00 0x000000c4>; 234 + local-mac-address = [000000000000]; /* Filled in by U-Boot */ 235 + mal-device = <&MAL0>; 236 + mal-tx-channel = <0>; 237 + mal-rx-channel = <0>; 238 + cell-index = <0>; 239 + max-frame-size = <9000>; 240 + rx-fifo-size = <16384>; 241 + tx-fifo-size = <2048>; 242 + phy-mode = "rgmii"; 243 + phy-map = <0x00000000>; 244 + rgmii-device = <&RGMII0>; 245 + rgmii-channel = <0>; 246 + tah-device = <&TAH0>; 247 + tah-channel = <0>; 248 + has-inverted-stacr-oc; 249 + has-new-stacr-staopc; 250 + }; 251 + }; 252 + 253 + }; 254 + };
+332
arch/powerpc/boot/dts/mpc8308_p1m.dts
··· 1 + /* 2 + * mpc8308_p1m Device Tree Source 3 + * 4 + * Copyright 2010 Ilya Yanok, Emcraft Systems, yanok@emcraft.com 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 + /dts-v1/; 13 + 14 + / { 15 + compatible = "denx,mpc8308_p1m"; 16 + #address-cells = <1>; 17 + #size-cells = <1>; 18 + 19 + aliases { 20 + ethernet0 = &enet0; 21 + ethernet1 = &enet1; 22 + serial0 = &serial0; 23 + serial1 = &serial1; 24 + pci0 = &pci0; 25 + }; 26 + 27 + cpus { 28 + #address-cells = <1>; 29 + #size-cells = <0>; 30 + 31 + PowerPC,8308@0 { 32 + device_type = "cpu"; 33 + reg = <0x0>; 34 + d-cache-line-size = <32>; 35 + i-cache-line-size = <32>; 36 + d-cache-size = <16384>; 37 + i-cache-size = <16384>; 38 + timebase-frequency = <0>; // from bootloader 39 + bus-frequency = <0>; // from bootloader 40 + clock-frequency = <0>; // from bootloader 41 + }; 42 + }; 43 + 44 + memory { 45 + device_type = "memory"; 46 + reg = <0x00000000 0x08000000>; // 128MB at 0 47 + }; 48 + 49 + localbus@e0005000 { 50 + #address-cells = <2>; 51 + #size-cells = <1>; 52 + compatible = "fsl,mpc8315-elbc", "fsl,elbc", "simple-bus"; 53 + reg = <0xe0005000 0x1000>; 54 + interrupts = <77 0x8>; 55 + interrupt-parent = <&ipic>; 56 + 57 + ranges = <0x0 0x0 0xfc000000 0x04000000 58 + 0x1 0x0 0xfbff0000 0x00008000 59 + 0x2 0x0 0xfbff8000 0x00008000>; 60 + 61 + flash@0,0 { 62 + #address-cells = <1>; 63 + #size-cells = <1>; 64 + compatible = "cfi-flash"; 65 + reg = <0x0 0x0 0x4000000>; 66 + bank-width = <2>; 67 + device-width = <1>; 68 + 69 + u-boot@0 { 70 + reg = <0x0 0x60000>; 71 + read-only; 72 + }; 73 + env@60000 { 74 + reg = <0x60000 0x20000>; 75 + }; 76 + env1@80000 { 77 + reg = <0x80000 0x20000>; 78 + }; 79 + kernel@a0000 { 80 + reg = <0xa0000 0x200000>; 81 + }; 82 + dtb@2a0000 { 83 + reg = <0x2a0000 0x20000>; 84 + }; 85 + ramdisk@2c0000 { 86 + reg = <0x2c0000 0x640000>; 87 + }; 88 + user@700000 { 89 + reg = <0x700000 0x3900000>; 90 + }; 91 + }; 92 + 93 + can@1,0 { 94 + compatible = "nxp,sja1000"; 95 + reg = <0x1 0x0 0x80>; 96 + interrupts = <18 0x8>; 97 + interrups-parent = <&ipic>; 98 + }; 99 + 100 + cpld@2,0 { 101 + compatible = "denx,mpc8308_p1m-cpld"; 102 + reg = <0x2 0x0 0x8>; 103 + interrupts = <48 0x8>; 104 + interrups-parent = <&ipic>; 105 + }; 106 + }; 107 + 108 + immr@e0000000 { 109 + #address-cells = <1>; 110 + #size-cells = <1>; 111 + device_type = "soc"; 112 + compatible = "fsl,mpc8308-immr", "simple-bus"; 113 + ranges = <0 0xe0000000 0x00100000>; 114 + reg = <0xe0000000 0x00000200>; 115 + bus-frequency = <0>; 116 + 117 + i2c@3000 { 118 + #address-cells = <1>; 119 + #size-cells = <0>; 120 + compatible = "fsl-i2c"; 121 + reg = <0x3000 0x100>; 122 + interrupts = <14 0x8>; 123 + interrupt-parent = <&ipic>; 124 + dfsrr; 125 + fram@50 { 126 + compatible = "ramtron,24c64"; 127 + reg = <0x50>; 128 + }; 129 + }; 130 + 131 + i2c@3100 { 132 + #address-cells = <1>; 133 + #size-cells = <0>; 134 + compatible = "fsl-i2c"; 135 + reg = <0x3100 0x100>; 136 + interrupts = <15 0x8>; 137 + interrupt-parent = <&ipic>; 138 + dfsrr; 139 + pwm@28 { 140 + compatible = "maxim,ds1050"; 141 + reg = <0x28>; 142 + }; 143 + sensor@48 { 144 + compatible = "maxim,max6625"; 145 + reg = <0x48>; 146 + }; 147 + sensor@49 { 148 + compatible = "maxim,max6625"; 149 + reg = <0x49>; 150 + }; 151 + sensor@4b { 152 + compatible = "maxim,max6625"; 153 + reg = <0x4b>; 154 + }; 155 + }; 156 + 157 + usb@23000 { 158 + compatible = "fsl-usb2-dr"; 159 + reg = <0x23000 0x1000>; 160 + #address-cells = <1>; 161 + #size-cells = <0>; 162 + interrupt-parent = <&ipic>; 163 + interrupts = <38 0x8>; 164 + dr_mode = "peripheral"; 165 + phy_type = "ulpi"; 166 + }; 167 + 168 + enet0: ethernet@24000 { 169 + #address-cells = <1>; 170 + #size-cells = <1>; 171 + ranges = <0x0 0x24000 0x1000>; 172 + 173 + cell-index = <0>; 174 + device_type = "network"; 175 + model = "eTSEC"; 176 + compatible = "gianfar"; 177 + reg = <0x24000 0x1000>; 178 + local-mac-address = [ 00 00 00 00 00 00 ]; 179 + interrupts = <32 0x8 33 0x8 34 0x8>; 180 + interrupt-parent = <&ipic>; 181 + phy-handle = < &phy1 >; 182 + 183 + mdio@520 { 184 + #address-cells = <1>; 185 + #size-cells = <0>; 186 + compatible = "fsl,gianfar-mdio"; 187 + reg = <0x520 0x20>; 188 + phy1: ethernet-phy@1 { 189 + interrupt-parent = <&ipic>; 190 + interrupts = <17 0x8>; 191 + reg = <0x1>; 192 + device_type = "ethernet-phy"; 193 + }; 194 + phy2: ethernet-phy@2 { 195 + interrupt-parent = <&ipic>; 196 + interrupts = <19 0x8>; 197 + reg = <0x2>; 198 + device_type = "ethernet-phy"; 199 + }; 200 + tbi0: tbi-phy@11 { 201 + reg = <0x11>; 202 + device_type = "tbi-phy"; 203 + }; 204 + }; 205 + }; 206 + 207 + enet1: ethernet@25000 { 208 + #address-cells = <1>; 209 + #size-cells = <1>; 210 + cell-index = <1>; 211 + device_type = "network"; 212 + model = "eTSEC"; 213 + compatible = "gianfar"; 214 + reg = <0x25000 0x1000>; 215 + ranges = <0x0 0x25000 0x1000>; 216 + local-mac-address = [ 00 00 00 00 00 00 ]; 217 + interrupts = <35 0x8 36 0x8 37 0x8>; 218 + interrupt-parent = <&ipic>; 219 + phy-handle = < &phy2 >; 220 + 221 + mdio@520 { 222 + #address-cells = <1>; 223 + #size-cells = <0>; 224 + compatible = "fsl,gianfar-tbi"; 225 + reg = <0x520 0x20>; 226 + tbi1: tbi-phy@11 { 227 + reg = <0x11>; 228 + device_type = "tbi-phy"; 229 + }; 230 + }; 231 + }; 232 + 233 + serial0: serial@4500 { 234 + cell-index = <0>; 235 + device_type = "serial"; 236 + compatible = "ns16550"; 237 + reg = <0x4500 0x100>; 238 + clock-frequency = <133333333>; 239 + interrupts = <9 0x8>; 240 + interrupt-parent = <&ipic>; 241 + }; 242 + 243 + serial1: serial@4600 { 244 + cell-index = <1>; 245 + device_type = "serial"; 246 + compatible = "ns16550"; 247 + reg = <0x4600 0x100>; 248 + clock-frequency = <133333333>; 249 + interrupts = <10 0x8>; 250 + interrupt-parent = <&ipic>; 251 + }; 252 + 253 + gpio@c00 { 254 + #gpio-cells = <2>; 255 + compatible = "fsl,mpc8308-gpio", "fsl,mpc8349-gpio"; 256 + reg = <0xc00 0x18>; 257 + interrupts = <74 0x8>; 258 + interrupt-parent = <&ipic>; 259 + gpio-controller; 260 + }; 261 + 262 + timer@500 { 263 + compatible = "fsl,mpc8308-gtm", "fsl,gtm"; 264 + reg = <0x500 0x100>; 265 + interrupts = <90 8 78 8 84 8 72 8>; 266 + interrupt-parent = <&ipic>; 267 + clock-frequency = <133333333>; 268 + }; 269 + 270 + /* IPIC 271 + * interrupts cell = <intr #, sense> 272 + * sense values match linux IORESOURCE_IRQ_* defines: 273 + * sense == 8: Level, low assertion 274 + * sense == 2: Edge, high-to-low change 275 + */ 276 + ipic: interrupt-controller@700 { 277 + compatible = "fsl,ipic"; 278 + interrupt-controller; 279 + #address-cells = <0>; 280 + #interrupt-cells = <2>; 281 + reg = <0x700 0x100>; 282 + device_type = "ipic"; 283 + }; 284 + 285 + ipic-msi@7c0 { 286 + compatible = "fsl,ipic-msi"; 287 + reg = <0x7c0 0x40>; 288 + msi-available-ranges = <0x0 0x100>; 289 + interrupts = < 0x43 0x8 290 + 0x4 0x8 291 + 0x51 0x8 292 + 0x52 0x8 293 + 0x56 0x8 294 + 0x57 0x8 295 + 0x58 0x8 296 + 0x59 0x8 >; 297 + interrupt-parent = < &ipic >; 298 + }; 299 + 300 + }; 301 + 302 + pci0: pcie@e0009000 { 303 + #address-cells = <3>; 304 + #size-cells = <2>; 305 + #interrupt-cells = <1>; 306 + device_type = "pci"; 307 + compatible = "fsl,mpc8308-pcie", "fsl,mpc8314-pcie"; 308 + reg = <0xe0009000 0x00001000 309 + 0xb0000000 0x01000000>; 310 + ranges = <0x02000000 0 0xa0000000 0xa0000000 0 0x10000000 311 + 0x01000000 0 0x00000000 0xb1000000 0 0x00800000>; 312 + bus-range = <0 0>; 313 + interrupt-map-mask = <0 0 0 0>; 314 + interrupt-map = <0 0 0 0 &ipic 1 8>; 315 + interrupts = <0x1 0x8>; 316 + interrupt-parent = <&ipic>; 317 + clock-frequency = <0>; 318 + 319 + pcie@0 { 320 + #address-cells = <3>; 321 + #size-cells = <2>; 322 + device_type = "pci"; 323 + reg = <0 0 0 0 0>; 324 + ranges = <0x02000000 0 0xa0000000 325 + 0x02000000 0 0xa0000000 326 + 0 0x10000000 327 + 0x01000000 0 0x00000000 328 + 0x01000000 0 0x00000000 329 + 0 0x00800000>; 330 + }; 331 + }; 332 + };
+11
arch/powerpc/boot/dts/p1022ds.dts
··· 148 148 label = "reserved-nand"; 149 149 }; 150 150 }; 151 + 152 + board-control@3,0 { 153 + compatible = "fsl,p1022ds-pixis"; 154 + reg = <3 0 0x30>; 155 + interrupt-parent = <&mpic>; 156 + /* 157 + * IRQ8 is generated if the "EVENT" switch is pressed 158 + * and PX_CTL[EVESEL] is set to 00. 159 + */ 160 + interrupts = <8 8>; 161 + }; 151 162 }; 152 163 153 164 soc@fffe00000 {
+68
arch/powerpc/configs/44x/bluestone_defconfig
··· 1 + CONFIG_44x=y 2 + CONFIG_EXPERIMENTAL=y 3 + CONFIG_SYSVIPC=y 4 + CONFIG_POSIX_MQUEUE=y 5 + CONFIG_LOG_BUF_SHIFT=14 6 + CONFIG_BLK_DEV_INITRD=y 7 + CONFIG_EMBEDDED=y 8 + # CONFIG_VM_EVENT_COUNTERS is not set 9 + # CONFIG_PCI_QUIRKS is not set 10 + # CONFIG_COMPAT_BRK is not set 11 + CONFIG_BLUESTONE=y 12 + # CONFIG_EBONY is not set 13 + # CONFIG_KVM_GUEST is not set 14 + CONFIG_NO_HZ=y 15 + CONFIG_HIGH_RES_TIMERS=y 16 + CONFIG_SPARSE_IRQ=y 17 + CONFIG_CMDLINE_BOOL=y 18 + CONFIG_CMDLINE="" 19 + CONFIG_NET=y 20 + CONFIG_PACKET=y 21 + CONFIG_UNIX=y 22 + CONFIG_INET=y 23 + CONFIG_IP_PNP=y 24 + CONFIG_IP_PNP_DHCP=y 25 + CONFIG_IP_PNP_BOOTP=y 26 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 27 + CONFIG_CONNECTOR=y 28 + CONFIG_MTD=y 29 + CONFIG_MTD_PARTITIONS=y 30 + CONFIG_MTD_CMDLINE_PARTS=y 31 + CONFIG_MTD_OF_PARTS=y 32 + CONFIG_MTD_CHAR=y 33 + CONFIG_MTD_BLOCK=y 34 + CONFIG_MTD_CFI=y 35 + CONFIG_MTD_CFI_AMDSTD=y 36 + CONFIG_MTD_PHYSMAP_OF=y 37 + CONFIG_PROC_DEVICETREE=y 38 + CONFIG_BLK_DEV_RAM=y 39 + CONFIG_BLK_DEV_RAM_SIZE=35000 40 + CONFIG_NETDEVICES=y 41 + CONFIG_NET_ETHERNET=y 42 + CONFIG_IBM_NEW_EMAC=y 43 + CONFIG_IBM_NEW_EMAC_RXB=256 44 + CONFIG_IBM_NEW_EMAC_TXB=256 45 + CONFIG_SERIAL_8250=y 46 + CONFIG_SERIAL_8250_CONSOLE=y 47 + CONFIG_SERIAL_8250_NR_UARTS=2 48 + CONFIG_SERIAL_8250_RUNTIME_UARTS=2 49 + CONFIG_SERIAL_8250_EXTENDED=y 50 + CONFIG_SERIAL_8250_SHARE_IRQ=y 51 + CONFIG_SERIAL_OF_PLATFORM=y 52 + CONFIG_I2C=y 53 + CONFIG_I2C_CHARDEV=y 54 + CONFIG_I2C_IBM_IIC=y 55 + CONFIG_SENSORS_AD7414=y 56 + # CONFIG_HID_SUPPORT is not set 57 + # CONFIG_USB_SUPPORT is not set 58 + CONFIG_RTC_CLASS=y 59 + CONFIG_RTC_DRV_M41T80=y 60 + CONFIG_EXT2_FS=y 61 + CONFIG_EXT3_FS=y 62 + CONFIG_PROC_KCORE=y 63 + CONFIG_TMPFS=y 64 + CONFIG_CRAMFS=y 65 + CONFIG_NFS_FS=y 66 + CONFIG_NFS_V3=y 67 + CONFIG_ROOT_NFS=y 68 + CONFIG_NLS=y
+84
arch/powerpc/configs/e55xx_smp_defconfig
··· 1 + CONFIG_PPC64=y 2 + CONFIG_PPC_BOOK3E_64=y 3 + # CONFIG_VIRT_CPU_ACCOUNTING is not set 4 + CONFIG_SMP=y 5 + CONFIG_NR_CPUS=2 6 + CONFIG_EXPERIMENTAL=y 7 + CONFIG_SYSVIPC=y 8 + CONFIG_BSD_PROCESS_ACCT=y 9 + CONFIG_IKCONFIG=y 10 + CONFIG_IKCONFIG_PROC=y 11 + CONFIG_LOG_BUF_SHIFT=14 12 + CONFIG_SYSFS_DEPRECATED_V2=y 13 + CONFIG_BLK_DEV_INITRD=y 14 + # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 15 + CONFIG_EMBEDDED=y 16 + CONFIG_KALLSYMS_ALL=y 17 + CONFIG_KALLSYMS_EXTRA_PASS=y 18 + CONFIG_MODULES=y 19 + CONFIG_MODULE_UNLOAD=y 20 + CONFIG_MODULE_FORCE_UNLOAD=y 21 + CONFIG_MODVERSIONS=y 22 + # CONFIG_BLK_DEV_BSG is not set 23 + CONFIG_P5020_DS=y 24 + # CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set 25 + CONFIG_NO_HZ=y 26 + CONFIG_HIGH_RES_TIMERS=y 27 + CONFIG_BINFMT_MISC=m 28 + CONFIG_SPARSE_IRQ=y 29 + # CONFIG_PCI is not set 30 + CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 31 + CONFIG_PROC_DEVICETREE=y 32 + CONFIG_BLK_DEV_LOOP=y 33 + CONFIG_BLK_DEV_RAM=y 34 + CONFIG_BLK_DEV_RAM_SIZE=131072 35 + CONFIG_EEPROM_LEGACY=y 36 + CONFIG_INPUT_FF_MEMLESS=m 37 + # CONFIG_INPUT_MOUSEDEV is not set 38 + # CONFIG_INPUT_KEYBOARD is not set 39 + # CONFIG_INPUT_MOUSE is not set 40 + CONFIG_SERIO_LIBPS2=y 41 + CONFIG_SERIAL_8250=y 42 + CONFIG_SERIAL_8250_CONSOLE=y 43 + CONFIG_SERIAL_8250_EXTENDED=y 44 + CONFIG_SERIAL_8250_MANY_PORTS=y 45 + CONFIG_SERIAL_8250_DETECT_IRQ=y 46 + CONFIG_SERIAL_8250_RSA=y 47 + CONFIG_I2C=y 48 + # CONFIG_HWMON is not set 49 + CONFIG_VIDEO_OUTPUT_CONTROL=y 50 + # CONFIG_HID_SUPPORT is not set 51 + # CONFIG_USB_SUPPORT is not set 52 + CONFIG_DMADEVICES=y 53 + CONFIG_FSL_DMA=y 54 + CONFIG_EXT2_FS=y 55 + CONFIG_EXT3_FS=y 56 + # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 57 + CONFIG_PROC_KCORE=y 58 + CONFIG_TMPFS=y 59 + # CONFIG_MISC_FILESYSTEMS is not set 60 + CONFIG_PARTITION_ADVANCED=y 61 + CONFIG_MAC_PARTITION=y 62 + CONFIG_NLS=y 63 + CONFIG_NLS_UTF8=m 64 + CONFIG_CRC_T10DIF=y 65 + CONFIG_CRC_ITU_T=m 66 + CONFIG_LIBCRC32C=m 67 + CONFIG_FRAME_WARN=1024 68 + CONFIG_DEBUG_FS=y 69 + CONFIG_DEBUG_KERNEL=y 70 + CONFIG_DETECT_HUNG_TASK=y 71 + # CONFIG_DEBUG_BUGVERBOSE is not set 72 + CONFIG_DEBUG_INFO=y 73 + # CONFIG_RCU_CPU_STALL_DETECTOR is not set 74 + CONFIG_SYSCTL_SYSCALL_CHECK=y 75 + CONFIG_VIRQ_DEBUG=y 76 + CONFIG_CRYPTO=y 77 + CONFIG_CRYPTO_CBC=y 78 + CONFIG_CRYPTO_PCBC=m 79 + CONFIG_CRYPTO_HMAC=y 80 + CONFIG_CRYPTO_MD5=y 81 + CONFIG_CRYPTO_SHA1=m 82 + CONFIG_CRYPTO_DES=y 83 + # CONFIG_CRYPTO_ANSI_CPRNG is not set 84 + CONFIG_CRYPTO_DEV_TALITOS=y
+5 -4
arch/powerpc/configs/ppc44x_defconfig
··· 12 12 CONFIG_MODULE_UNLOAD=y 13 13 # CONFIG_BLK_DEV_BSG is not set 14 14 CONFIG_BAMBOO=y 15 + CONFIG_BLUESTONE=y 15 16 CONFIG_SAM440EP=y 16 17 CONFIG_SEQUOIA=y 17 18 CONFIG_TAISHAN=y ··· 98 97 CONFIG_EXT2_FS=y 99 98 CONFIG_EXT3_FS=m 100 99 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 101 - CONFIG_INOTIFY=y 102 100 CONFIG_VFAT_FS=m 103 101 CONFIG_PROC_KCORE=y 104 102 CONFIG_TMPFS=y 105 103 CONFIG_JFFS2_FS=y 106 104 CONFIG_UBIFS_FS=m 107 105 CONFIG_UBIFS_FS_XATTR=y 106 + CONFIG_LOGFS=m 108 107 CONFIG_CRAMFS=y 108 + CONFIG_SQUASHFS=m 109 + CONFIG_SQUASHFS_XATTR=y 110 + CONFIG_SQUASHFS_LZO=y 109 111 CONFIG_NFS_FS=y 110 112 CONFIG_NFS_V3=y 111 113 CONFIG_ROOT_NFS=y ··· 120 116 CONFIG_DETECT_HUNG_TASK=y 121 117 # CONFIG_RCU_CPU_STALL_DETECTOR is not set 122 118 CONFIG_SYSCTL_SYSCALL_CHECK=y 123 - CONFIG_CRYPTO_CBC=y 124 119 CONFIG_CRYPTO_ECB=y 125 120 CONFIG_CRYPTO_PCBC=y 126 - CONFIG_CRYPTO_MD5=y 127 - CONFIG_CRYPTO_DES=y 128 121 # CONFIG_CRYPTO_ANSI_CPRNG is not set 129 122 # CONFIG_CRYPTO_HW is not set 130 123 CONFIG_VIRTUALIZATION=y
+1 -3
arch/powerpc/configs/ppc64e_defconfig
··· 18 18 CONFIG_MODULE_UNLOAD=y 19 19 CONFIG_MODVERSIONS=y 20 20 CONFIG_MODULE_SRCVERSION_ALL=y 21 + CONFIG_P5020_DS=y 21 22 CONFIG_CPU_FREQ=y 22 23 CONFIG_CPU_FREQ_GOV_POWERSAVE=y 23 24 CONFIG_CPU_FREQ_GOV_USERSPACE=y ··· 257 256 CONFIG_USB=y 258 257 CONFIG_USB_DEVICEFS=y 259 258 CONFIG_USB_EHCI_HCD=y 260 - CONFIG_USB_EHCI_TT_NEWSCHED=y 261 259 # CONFIG_USB_EHCI_HCD_PPC_OF is not set 262 260 CONFIG_USB_OHCI_HCD=y 263 261 CONFIG_USB_STORAGE=m ··· 290 290 CONFIG_JFS_SECURITY=y 291 291 CONFIG_XFS_FS=m 292 292 CONFIG_XFS_POSIX_ACL=y 293 - CONFIG_INOTIFY=y 294 293 CONFIG_AUTOFS4_FS=m 295 294 CONFIG_ISO9660_FS=y 296 295 CONFIG_UDF_FS=m ··· 383 384 CONFIG_CRYPTO_WP512=m 384 385 CONFIG_CRYPTO_AES=m 385 386 CONFIG_CRYPTO_ANUBIS=m 386 - CONFIG_CRYPTO_ARC4=m 387 387 CONFIG_CRYPTO_BLOWFISH=m 388 388 CONFIG_CRYPTO_CAST6=m 389 389 CONFIG_CRYPTO_KHAZAD=m
+10
arch/powerpc/include/asm/checksum.h
··· 52 52 extern __wsum csum_partial_copy_generic(const void *src, void *dst, 53 53 int len, __wsum sum, 54 54 int *src_err, int *dst_err); 55 + 56 + #ifdef __powerpc64__ 57 + #define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER 58 + extern __wsum csum_and_copy_from_user(const void __user *src, void *dst, 59 + int len, __wsum sum, int *err_ptr); 60 + #define HAVE_CSUM_COPY_USER 61 + extern __wsum csum_and_copy_to_user(const void *src, void __user *dst, 62 + int len, __wsum sum, int *err_ptr); 63 + #else 55 64 /* 56 65 * the same as csum_partial, but copies from src to dst while it 57 66 * checksums. 58 67 */ 59 68 #define csum_partial_copy_from_user(src, dst, len, sum, errp) \ 60 69 csum_partial_copy_generic((__force const void *)(src), (dst), (len), (sum), (errp), NULL) 70 + #endif 61 71 62 72 #define csum_partial_copy_nocheck(src, dst, len, sum) \ 63 73 csum_partial_copy_generic((src), (dst), (len), (sum), NULL, NULL)
+2 -2
arch/powerpc/include/asm/compat.h
··· 143 143 * We cant access below the stack pointer in the 32bit ABI and 144 144 * can access 288 bytes in the 64bit ABI 145 145 */ 146 - if (!(test_thread_flag(TIF_32BIT))) 146 + if (!is_32bit_task()) 147 147 usp -= 288; 148 148 149 149 return (void __user *) (usp - len); ··· 213 213 214 214 static inline int is_compat_task(void) 215 215 { 216 - return test_thread_flag(TIF_32BIT); 216 + return is_32bit_task(); 217 217 } 218 218 219 219 #endif /* __KERNEL__ */
+9 -5
arch/powerpc/include/asm/cputable.h
··· 198 198 #define CPU_FTR_CP_USE_DCBTZ LONG_ASM_CONST(0x0040000000000000) 199 199 #define CPU_FTR_UNALIGNED_LD_STD LONG_ASM_CONST(0x0080000000000000) 200 200 #define CPU_FTR_ASYM_SMT LONG_ASM_CONST(0x0100000000000000) 201 + #define CPU_FTR_STCX_CHECKS_ADDRESS LONG_ASM_CONST(0x0200000000000000) 201 202 202 203 #ifndef __ASSEMBLY__ 203 204 ··· 393 392 CPU_FTR_MMCRA | CPU_FTR_CTRL) 394 393 #define CPU_FTRS_POWER4 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 395 394 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 396 - CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ) 395 + CPU_FTR_MMCRA | CPU_FTR_CP_USE_DCBTZ | \ 396 + CPU_FTR_STCX_CHECKS_ADDRESS) 397 397 #define CPU_FTRS_PPC970 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 398 398 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 399 399 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA | \ 400 - CPU_FTR_CP_USE_DCBTZ) 400 + CPU_FTR_CP_USE_DCBTZ | CPU_FTR_STCX_CHECKS_ADDRESS) 401 401 #define CPU_FTRS_POWER5 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 402 402 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 403 403 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 404 404 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 405 - CPU_FTR_PURR) 405 + CPU_FTR_PURR | CPU_FTR_STCX_CHECKS_ADDRESS) 406 406 #define CPU_FTRS_POWER6 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 407 407 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 408 408 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 409 409 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 410 410 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 411 - CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD) 411 + CPU_FTR_DSCR | CPU_FTR_UNALIGNED_LD_STD | \ 412 + CPU_FTR_STCX_CHECKS_ADDRESS) 412 413 #define CPU_FTRS_POWER7 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 413 414 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 414 415 CPU_FTR_MMCRA | CPU_FTR_SMT | \ 415 416 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \ 416 417 CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 417 - CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT) 418 + CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ 419 + CPU_FTR_STCX_CHECKS_ADDRESS) 418 420 #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 419 421 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 420 422 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
+1 -13
arch/powerpc/include/asm/dma-mapping.h
··· 127 127 return dma_ops->dma_supported(dev, mask); 128 128 } 129 129 130 - static inline int dma_set_mask(struct device *dev, u64 dma_mask) 131 - { 132 - struct dma_map_ops *dma_ops = get_dma_ops(dev); 133 - 134 - if (unlikely(dma_ops == NULL)) 135 - return -EIO; 136 - if (dma_ops->set_dma_mask != NULL) 137 - return dma_ops->set_dma_mask(dev, dma_mask); 138 - if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 139 - return -EIO; 140 - *dev->dma_mask = dma_mask; 141 - return 0; 142 - } 130 + extern int dma_set_mask(struct device *dev, u64 dma_mask); 143 131 144 132 static inline void *dma_alloc_coherent(struct device *dev, size_t size, 145 133 dma_addr_t *dma_handle, gfp_t flag)
+1 -1
arch/powerpc/include/asm/elf.h
··· 250 250 * the 64bit ABI has never had these issues dont enable the workaround 251 251 * even if we have an executable stack. 252 252 */ 253 - # define elf_read_implies_exec(ex, exec_stk) (test_thread_flag(TIF_32BIT) ? \ 253 + # define elf_read_implies_exec(ex, exec_stk) (is_32bit_task() ? \ 254 254 (exec_stk == EXSTACK_DEFAULT) : 0) 255 255 #else 256 256 # define SET_PERSONALITY(ex) \
+2 -1
arch/powerpc/include/asm/exception-64s.h
··· 137 137 li r10,0; \ 138 138 ld r11,exception_marker@toc(r2); \ 139 139 std r10,RESULT(r1); /* clear regs->result */ \ 140 - std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ 140 + std r11,STACK_FRAME_OVERHEAD-16(r1); /* mark the frame */ \ 141 + ACCOUNT_STOLEN_TIME 141 142 142 143 /* 143 144 * Exception vectors.
+48
arch/powerpc/include/asm/fsl_85xx_cache_sram.h
··· 1 + /* 2 + * Copyright 2009 Freescale Semiconductor, Inc. 3 + * 4 + * Cache SRAM handling for QorIQ platform 5 + * 6 + * Author: Vivek Mahajan <vivek.mahajan@freescale.com> 7 + 8 + * This file is derived from the original work done 9 + * by Sylvain Munaut for the Bestcomm SRAM allocator. 10 + * 11 + * This program is free software; you can redistribute it and/or modify it 12 + * under the terms of the GNU General Public License as published by the 13 + * Free Software Foundation; either version 2 of the License, or (at your 14 + * option) any later version. 15 + * 16 + * This program is distributed in the hope that it will be useful, 17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 + * GNU General Public License for more details. 20 + * 21 + * You should have received a copy of the GNU General Public License 22 + * along with this program; if not, write to the Free Software 23 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 + */ 25 + 26 + #ifndef __ASM_POWERPC_FSL_85XX_CACHE_SRAM_H__ 27 + #define __ASM_POWERPC_FSL_85XX_CACHE_SRAM_H__ 28 + 29 + #include <asm/rheap.h> 30 + #include <linux/spinlock.h> 31 + 32 + /* 33 + * Cache-SRAM 34 + */ 35 + 36 + struct mpc85xx_cache_sram { 37 + phys_addr_t base_phys; 38 + void *base_virt; 39 + unsigned int size; 40 + rh_info_t *rh; 41 + spinlock_t lock; 42 + }; 43 + 44 + extern void mpc85xx_cache_sram_free(void *ptr); 45 + extern void *mpc85xx_cache_sram_alloc(unsigned int size, 46 + phys_addr_t *phys, unsigned int align); 47 + 48 + #endif /* __AMS_POWERPC_FSL_85XX_CACHE_SRAM_H__ */
+1
arch/powerpc/include/asm/kexec.h
··· 91 91 extern void crash_kexec_secondary(struct pt_regs *regs); 92 92 extern int overlaps_crashkernel(unsigned long start, unsigned long size); 93 93 extern void reserve_crashkernel(void); 94 + extern void machine_kexec_mask_interrupts(void); 94 95 95 96 #else /* !CONFIG_KEXEC */ 96 97 static inline int kexec_sr_activated(int cpu) { return 0; }
+2 -2
arch/powerpc/include/asm/kvm_fpu.h
··· 82 82 FPD_THREE_IN(fnmsub) 83 83 FPD_THREE_IN(fnmadd) 84 84 85 - extern void kvm_cvt_fd(u32 *from, u64 *to, u64 *fpscr); 86 - extern void kvm_cvt_df(u64 *from, u32 *to, u64 *fpscr); 85 + extern void kvm_cvt_fd(u32 *from, u64 *to); 86 + extern void kvm_cvt_df(u64 *from, u32 *to); 87 87 88 88 #endif
+29
arch/powerpc/include/asm/lppaca.h
··· 153 153 154 154 extern struct lppaca lppaca[]; 155 155 156 + #define lppaca_of(cpu) (*paca[cpu].lppaca_ptr) 157 + 156 158 /* 157 159 * SLB shadow buffer structure as defined in the PAPR. The save_area 158 160 * contains adjacent ESID and VSID pairs for each shadowed SLB. The ··· 171 169 } ____cacheline_aligned; 172 170 173 171 extern struct slb_shadow slb_shadow[]; 172 + 173 + /* 174 + * Layout of entries in the hypervisor's dispatch trace log buffer. 175 + */ 176 + struct dtl_entry { 177 + u8 dispatch_reason; 178 + u8 preempt_reason; 179 + u16 processor_id; 180 + u32 enqueue_to_dispatch_time; 181 + u32 ready_to_enqueue_time; 182 + u32 waiting_to_ready_time; 183 + u64 timebase; 184 + u64 fault_addr; 185 + u64 srr0; 186 + u64 srr1; 187 + }; 188 + 189 + #define DISPATCH_LOG_BYTES 4096 /* bytes per cpu */ 190 + #define N_DISPATCH_LOG (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry)) 191 + 192 + /* 193 + * When CONFIG_VIRT_CPU_ACCOUNTING = y, the cpu accounting code controls 194 + * reading from the dispatch trace log. If other code wants to consume 195 + * DTL entries, it can set this pointer to a function that will get 196 + * called once for each DTL entry that gets processed. 197 + */ 198 + extern void (*dtl_consumer)(struct dtl_entry *entry, u64 index); 174 199 175 200 #endif /* CONFIG_PPC_BOOK3S */ 176 201 #endif /* __KERNEL__ */
+3
arch/powerpc/include/asm/machdep.h
··· 102 102 void (*pci_dma_dev_setup)(struct pci_dev *dev); 103 103 void (*pci_dma_bus_setup)(struct pci_bus *bus); 104 104 105 + /* Platform set_dma_mask override */ 106 + int (*dma_set_mask)(struct device *dev, u64 dma_mask); 107 + 105 108 int (*probe)(void); 106 109 void (*setup_arch)(void); /* Optional, may be NULL */ 107 110 void (*init_early)(void);
+15
arch/powerpc/include/asm/mmu-book3e.h
··· 114 114 115 115 #define MAS7_RPN 0xFFFFFFFF 116 116 117 + /* Bit definitions for MMUCFG */ 118 + #define MMUCFG_MAVN 0x00000003 /* MMU Architecture Version Number */ 119 + #define MMUCFG_MAVN_V1 0x00000000 /* v1.0 */ 120 + #define MMUCFG_MAVN_V2 0x00000001 /* v2.0 */ 121 + #define MMUCFG_NTLBS 0x0000000c /* Number of TLBs */ 122 + #define MMUCFG_PIDSIZE 0x000007c0 /* PID Reg Size */ 123 + #define MMUCFG_TWC 0x00008000 /* TLB Write Conditional (v2.0) */ 124 + #define MMUCFG_LRAT 0x00010000 /* LRAT Supported (v2.0) */ 125 + #define MMUCFG_RASIZE 0x00fe0000 /* Real Addr Size */ 126 + #define MMUCFG_LPIDSIZE 0x0f000000 /* LPID Reg Size */ 127 + 117 128 /* Bit definitions for MMUCSR0 */ 118 129 #define MMUCSR0_TLB1FI 0x00000002 /* TLB1 Flash invalidate */ 119 130 #define MMUCSR0_TLB0FI 0x00000004 /* TLB0 Flash invalidate */ ··· 144 133 #define TLBnCFG_GTWE 0x00010000 /* Guest can write */ 145 134 #define TLBnCFG_IND 0x00020000 /* IND entries supported */ 146 135 #define TLBnCFG_PT 0x00040000 /* Can load from page table */ 136 + #define TLBnCFG_MINSIZE 0x00f00000 /* Minimum Page Size (v1.0) */ 137 + #define TLBnCFG_MINSIZE_SHIFT 20 138 + #define TLBnCFG_MAXSIZE 0x000f0000 /* Maximum Page Size (v1.0) */ 139 + #define TLBnCFG_MAXSIZE_SHIFT 16 147 140 #define TLBnCFG_ASSOC 0xff000000 /* Associativity */ 148 141 149 142 /* TLBnPS encoding */
+9 -1
arch/powerpc/include/asm/paca.h
··· 85 85 u8 kexec_state; /* set when kexec down has irqs off */ 86 86 #ifdef CONFIG_PPC_STD_MMU_64 87 87 struct slb_shadow *slb_shadow_ptr; 88 + struct dtl_entry *dispatch_log; 89 + struct dtl_entry *dispatch_log_end; 88 90 89 91 /* 90 92 * Now, starting in cacheline 2, the exception save areas ··· 136 134 /* Stuff for accurate time accounting */ 137 135 u64 user_time; /* accumulated usermode TB ticks */ 138 136 u64 system_time; /* accumulated system TB ticks */ 139 - u64 startpurr; /* PURR/TB value snapshot */ 137 + u64 user_time_scaled; /* accumulated usermode SPURR ticks */ 138 + u64 starttime; /* TB value snapshot */ 139 + u64 starttime_user; /* TB value on exit to usermode */ 140 140 u64 startspurr; /* SPURR value snapshot */ 141 + u64 utime_sspurr; /* ->user_time when ->startspurr set */ 142 + u64 stolen_time; /* TB ticks taken by hypervisor */ 143 + u64 dtl_ridx; /* read index in dispatch log */ 144 + struct dtl_entry *dtl_curr; /* pointer corresponding to dtl_ridx */ 141 145 142 146 #ifdef CONFIG_KVM_BOOK3S_HANDLER 143 147 /* We use this to store guest state in */
+2 -2
arch/powerpc/include/asm/page_64.h
··· 163 163 #endif /* !CONFIG_HUGETLB_PAGE */ 164 164 165 165 #define VM_DATA_DEFAULT_FLAGS \ 166 - (test_thread_flag(TIF_32BIT) ? \ 166 + (is_32bit_task() ? \ 167 167 VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64) 168 168 169 169 /* ··· 179 179 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 180 180 181 181 #define VM_STACK_DEFAULT_FLAGS \ 182 - (test_thread_flag(TIF_32BIT) ? \ 182 + (is_32bit_task() ? \ 183 183 VM_STACK_DEFAULT_FLAGS32 : VM_STACK_DEFAULT_FLAGS64) 184 184 185 185 #include <asm-generic/getorder.h>
+2 -2
arch/powerpc/include/asm/ppc-pci.h
··· 28 28 extern struct pci_dev *isa_bridge_pcidev; /* may be NULL if no ISA bus */ 29 29 30 30 /** Bus Unit ID macros; get low and hi 32-bits of the 64-bit BUID */ 31 - #define BUID_HI(buid) ((buid) >> 32) 32 - #define BUID_LO(buid) ((buid) & 0xffffffff) 31 + #define BUID_HI(buid) upper_32_bits(buid) 32 + #define BUID_LO(buid) lower_32_bits(buid) 33 33 34 34 /* PCI device_node operations */ 35 35 struct device_node;
+31 -19
arch/powerpc/include/asm/ppc_asm.h
··· 9 9 #include <asm/asm-compat.h> 10 10 #include <asm/processor.h> 11 11 #include <asm/ppc-opcode.h> 12 + #include <asm/firmware.h> 12 13 13 14 #ifndef __ASSEMBLY__ 14 15 #error __FILE__ should only be used in assembler files ··· 27 26 #ifndef CONFIG_VIRT_CPU_ACCOUNTING 28 27 #define ACCOUNT_CPU_USER_ENTRY(ra, rb) 29 28 #define ACCOUNT_CPU_USER_EXIT(ra, rb) 29 + #define ACCOUNT_STOLEN_TIME 30 30 #else 31 31 #define ACCOUNT_CPU_USER_ENTRY(ra, rb) \ 32 32 beq 2f; /* if from kernel mode */ \ 33 - BEGIN_FTR_SECTION; \ 34 - mfspr ra,SPRN_PURR; /* get processor util. reg */ \ 35 - END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ 36 - BEGIN_FTR_SECTION; \ 37 - MFTB(ra); /* or get TB if no PURR */ \ 38 - END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ 39 - ld rb,PACA_STARTPURR(r13); \ 40 - std ra,PACA_STARTPURR(r13); \ 33 + MFTB(ra); /* get timebase */ \ 34 + ld rb,PACA_STARTTIME_USER(r13); \ 35 + std ra,PACA_STARTTIME(r13); \ 41 36 subf rb,rb,ra; /* subtract start value */ \ 42 37 ld ra,PACA_USER_TIME(r13); \ 43 38 add ra,ra,rb; /* add on to user time */ \ ··· 41 44 2: 42 45 43 46 #define ACCOUNT_CPU_USER_EXIT(ra, rb) \ 44 - BEGIN_FTR_SECTION; \ 45 - mfspr ra,SPRN_PURR; /* get processor util. reg */ \ 46 - END_FTR_SECTION_IFSET(CPU_FTR_PURR); \ 47 - BEGIN_FTR_SECTION; \ 48 - MFTB(ra); /* or get TB if no PURR */ \ 49 - END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \ 50 - ld rb,PACA_STARTPURR(r13); \ 51 - std ra,PACA_STARTPURR(r13); \ 47 + MFTB(ra); /* get timebase */ \ 48 + ld rb,PACA_STARTTIME(r13); \ 49 + std ra,PACA_STARTTIME_USER(r13); \ 52 50 subf rb,rb,ra; /* subtract start value */ \ 53 51 ld ra,PACA_SYSTEM_TIME(r13); \ 54 - add ra,ra,rb; /* add on to user time */ \ 55 - std ra,PACA_SYSTEM_TIME(r13); 56 - #endif 52 + add ra,ra,rb; /* add on to system time */ \ 53 + std ra,PACA_SYSTEM_TIME(r13) 54 + 55 + #ifdef CONFIG_PPC_SPLPAR 56 + #define ACCOUNT_STOLEN_TIME \ 57 + BEGIN_FW_FTR_SECTION; \ 58 + beq 33f; \ 59 + /* from user - see if there are any DTL entries to process */ \ 60 + ld r10,PACALPPACAPTR(r13); /* get ptr to VPA */ \ 61 + ld r11,PACA_DTL_RIDX(r13); /* get log read index */ \ 62 + ld r10,LPPACA_DTLIDX(r10); /* get log write index */ \ 63 + cmpd cr1,r11,r10; \ 64 + beq+ cr1,33f; \ 65 + bl .accumulate_stolen_time; \ 66 + 33: \ 67 + END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) 68 + 69 + #else /* CONFIG_PPC_SPLPAR */ 70 + #define ACCOUNT_STOLEN_TIME 71 + 72 + #endif /* CONFIG_PPC_SPLPAR */ 73 + 74 + #endif /* CONFIG_VIRT_CPU_ACCOUNTING */ 57 75 58 76 /* 59 77 * Macros for storing registers into and loading registers from
+2 -2
arch/powerpc/include/asm/processor.h
··· 118 118 #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4)) 119 119 #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_USER64 / 4)) 120 120 121 - #define TASK_UNMAPPED_BASE ((test_thread_flag(TIF_32BIT)) ? \ 121 + #define TASK_UNMAPPED_BASE ((is_32bit_task()) ? \ 122 122 TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 ) 123 123 #endif 124 124 ··· 128 128 #define STACK_TOP_USER64 TASK_SIZE_USER64 129 129 #define STACK_TOP_USER32 TASK_SIZE_USER32 130 130 131 - #define STACK_TOP (test_thread_flag(TIF_32BIT) ? \ 131 + #define STACK_TOP (is_32bit_task() ? \ 132 132 STACK_TOP_USER32 : STACK_TOP_USER64) 133 133 134 134 #define STACK_TOP_MAX STACK_TOP_USER64
+7
arch/powerpc/include/asm/pte-common.h
··· 171 171 /* Make modules code happy. We don't set RO yet */ 172 172 #define PAGE_KERNEL_EXEC PAGE_KERNEL_X 173 173 174 + /* 175 + * Don't just check for any non zero bits in __PAGE_USER, since for book3e 176 + * and PTE_64BIT, PAGE_KERNEL_X contains _PAGE_BAP_SR which is also in 177 + * _PAGE_USER. Need to explictly match _PAGE_BAP_UR bit in that case too. 178 + */ 179 + #define pte_user(val) ((val & _PAGE_USER) == _PAGE_USER) 180 + 174 181 /* Advertise special mapping type for AGP */ 175 182 #define PAGE_AGP (PAGE_KERNEL_NC) 176 183 #define HAVE_PAGE_AGP
+1
arch/powerpc/include/asm/rtas.h
··· 187 187 extern void rtas_initialize(void); 188 188 extern int rtas_suspend_cpu(struct rtas_suspend_me_data *data); 189 189 extern int rtas_suspend_last_cpu(struct rtas_suspend_me_data *data); 190 + extern int rtas_ibm_suspend_me(struct rtas_args *); 190 191 191 192 struct rtc_time; 192 193 extern unsigned long rtas_get_boot_time(void);
+19
arch/powerpc/include/asm/systbl.h
··· 329 329 SYSCALL(fanotify_init) 330 330 COMPAT_SYS(fanotify_mark) 331 331 SYSCALL_SPU(prlimit64) 332 + SYSCALL_SPU(socket) 333 + SYSCALL_SPU(bind) 334 + SYSCALL_SPU(connect) 335 + SYSCALL_SPU(listen) 336 + SYSCALL_SPU(accept) 337 + SYSCALL_SPU(getsockname) 338 + SYSCALL_SPU(getpeername) 339 + SYSCALL_SPU(socketpair) 340 + SYSCALL_SPU(send) 341 + SYSCALL_SPU(sendto) 342 + COMPAT_SYS_SPU(recv) 343 + COMPAT_SYS_SPU(recvfrom) 344 + SYSCALL_SPU(shutdown) 345 + COMPAT_SYS_SPU(setsockopt) 346 + COMPAT_SYS_SPU(getsockopt) 347 + COMPAT_SYS_SPU(sendmsg) 348 + COMPAT_SYS_SPU(recvmsg) 349 + COMPAT_SYS_SPU(recvmmsg) 350 + SYSCALL_SPU(accept4)
+2 -2
arch/powerpc/include/asm/system.h
··· 154 154 extern void giveup_spe(struct task_struct *); 155 155 extern void load_up_spe(struct task_struct *); 156 156 extern int fix_alignment(struct pt_regs *); 157 - extern void cvt_fd(float *from, double *to, struct thread_struct *thread); 158 - extern void cvt_df(double *from, float *to, struct thread_struct *thread); 157 + extern void cvt_fd(float *from, double *to); 158 + extern void cvt_df(double *from, float *to); 159 159 160 160 #ifndef CONFIG_SMP 161 161 extern void discard_lazy_cpu_state(void);
-5
arch/powerpc/include/asm/time.h
··· 34 34 extern void GregorianDay(struct rtc_time *tm); 35 35 36 36 extern void generic_calibrate_decr(void); 37 - extern void snapshot_timebase(void); 38 37 39 38 extern void set_dec_cpu6(unsigned int val); 40 39 ··· 211 212 DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array); 212 213 213 214 #if defined(CONFIG_VIRT_CPU_ACCOUNTING) 214 - extern void calculate_steal_time(void); 215 - extern void snapshot_timebases(void); 216 215 #define account_process_vtime(tsk) account_process_tick(tsk, 0) 217 216 #else 218 - #define calculate_steal_time() do { } while (0) 219 - #define snapshot_timebases() do { } while (0) 220 217 #define account_process_vtime(tsk) do { } while (0) 221 218 #endif 222 219
+20 -1
arch/powerpc/include/asm/unistd.h
··· 348 348 #define __NR_fanotify_init 323 349 349 #define __NR_fanotify_mark 324 350 350 #define __NR_prlimit64 325 351 + #define __NR_socket 326 352 + #define __NR_bind 327 353 + #define __NR_connect 328 354 + #define __NR_listen 329 355 + #define __NR_accept 330 356 + #define __NR_getsockname 331 357 + #define __NR_getpeername 332 358 + #define __NR_socketpair 333 359 + #define __NR_send 334 360 + #define __NR_sendto 335 361 + #define __NR_recv 336 362 + #define __NR_recvfrom 337 363 + #define __NR_shutdown 338 364 + #define __NR_setsockopt 339 365 + #define __NR_getsockopt 340 366 + #define __NR_sendmsg 341 367 + #define __NR_recvmsg 342 368 + #define __NR_recvmmsg 343 369 + #define __NR_accept4 344 351 370 352 371 #ifdef __KERNEL__ 353 372 354 - #define __NR_syscalls 326 373 + #define __NR_syscalls 345 355 374 356 375 #define __NR__exit __NR_exit 357 376 #define NR_syscalls __NR_syscalls
+3 -1
arch/powerpc/kernel/Makefile
··· 55 55 obj-$(CONFIG_IBMEBUS) += ibmebus.o 56 56 obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o 57 57 obj-$(CONFIG_CRASH_DUMP) += crash_dump.o 58 + ifeq ($(CONFIG_PPC32),y) 58 59 obj-$(CONFIG_E500) += idle_e500.o 60 + endif 59 61 obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o 60 62 obj-$(CONFIG_TAU) += tau_6xx.o 61 63 obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o ··· 69 67 obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o 70 68 obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o 71 69 obj-$(CONFIG_44x) += cpu_setup_44x.o 72 - obj-$(CONFIG_FSL_BOOKE) += cpu_setup_fsl_booke.o dbell.o 70 + obj-$(CONFIG_PPC_FSL_BOOK3E) += cpu_setup_fsl_booke.o dbell.o 73 71 obj-$(CONFIG_PPC_BOOK3E_64) += dbell.o 74 72 75 73 extra-y := head_$(CONFIG_WORD_SIZE).o
+2 -2
arch/powerpc/kernel/align.c
··· 889 889 #ifdef CONFIG_PPC_FPU 890 890 preempt_disable(); 891 891 enable_kernel_fp(); 892 - cvt_df(&data.dd, (float *)&data.v[4], &current->thread); 892 + cvt_df(&data.dd, (float *)&data.v[4]); 893 893 preempt_enable(); 894 894 #else 895 895 return 0; ··· 933 933 #ifdef CONFIG_PPC_FPU 934 934 preempt_disable(); 935 935 enable_kernel_fp(); 936 - cvt_fd((float *)&data.v[4], &data.dd, &current->thread); 936 + cvt_fd((float *)&data.v[4], &data.dd); 937 937 preempt_enable(); 938 938 #else 939 939 return 0;
+7 -5
arch/powerpc/kernel/asm-offsets.c
··· 61 61 #endif 62 62 #endif 63 63 64 - #if defined(CONFIG_FSL_BOOKE) 64 + #if defined(CONFIG_PPC_FSL_BOOK3E) 65 65 #include "../mm/mmu_decl.h" 66 66 #endif 67 67 ··· 181 181 offsetof(struct slb_shadow, save_area[SLB_NUM_BOLTED - 1].vsid)); 182 182 DEFINE(SLBSHADOW_STACKESID, 183 183 offsetof(struct slb_shadow, save_area[SLB_NUM_BOLTED - 1].esid)); 184 + DEFINE(SLBSHADOW_SAVEAREA, offsetof(struct slb_shadow, save_area)); 184 185 DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0)); 185 186 DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1)); 186 187 DEFINE(LPPACAANYINT, offsetof(struct lppaca, int_dword.any_int)); 187 188 DEFINE(LPPACADECRINT, offsetof(struct lppaca, int_dword.fields.decr_int)); 188 - DEFINE(SLBSHADOW_SAVEAREA, offsetof(struct slb_shadow, save_area)); 189 + DEFINE(LPPACA_DTLIDX, offsetof(struct lppaca, dtl_idx)); 190 + DEFINE(PACA_DTL_RIDX, offsetof(struct paca_struct, dtl_ridx)); 189 191 #endif /* CONFIG_PPC_STD_MMU_64 */ 190 192 DEFINE(PACAEMERGSP, offsetof(struct paca_struct, emergency_sp)); 191 193 DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id)); 192 194 DEFINE(PACAKEXECSTATE, offsetof(struct paca_struct, kexec_state)); 193 - DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr)); 194 - DEFINE(PACA_STARTSPURR, offsetof(struct paca_struct, startspurr)); 195 + DEFINE(PACA_STARTTIME, offsetof(struct paca_struct, starttime)); 196 + DEFINE(PACA_STARTTIME_USER, offsetof(struct paca_struct, starttime_user)); 195 197 DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time)); 196 198 DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time)); 197 199 DEFINE(PACA_TRAP_SAVE, offsetof(struct paca_struct, trap_save)); ··· 470 468 DEFINE(PGD_T_LOG2, PGD_T_LOG2); 471 469 DEFINE(PTE_T_LOG2, PTE_T_LOG2); 472 470 #endif 473 - #ifdef CONFIG_FSL_BOOKE 471 + #ifdef CONFIG_PPC_FSL_BOOK3E 474 472 DEFINE(TLBCAM_SIZE, sizeof(struct tlbcam)); 475 473 DEFINE(TLBCAM_MAS0, offsetof(struct tlbcam, MAS0)); 476 474 DEFINE(TLBCAM_MAS1, offsetof(struct tlbcam, MAS1));
+1
arch/powerpc/kernel/cpu_setup_44x.S
··· 35 35 _GLOBAL(__setup_cpu_460ex) 36 36 _GLOBAL(__setup_cpu_460gt) 37 37 _GLOBAL(__setup_cpu_460sx) 38 + _GLOBAL(__setup_cpu_apm821xx) 38 39 mflr r4 39 40 bl __init_fpu_44x 40 41 bl __fixup_440A_mcheck
+15
arch/powerpc/kernel/cpu_setup_fsl_booke.S
··· 51 51 isync 52 52 blr 53 53 54 + #ifdef CONFIG_PPC32 54 55 _GLOBAL(__setup_cpu_e200) 55 56 /* enable dedicated debug exception handling resources (Debug APU) */ 56 57 mfspr r3,SPRN_HID0 ··· 71 70 bl __e500_icache_setup 72 71 bl __e500_dcache_setup 73 72 bl __setup_e500mc_ivors 73 + mtlr r4 74 + blr 75 + #endif 76 + /* Right now, restore and setup are the same thing */ 77 + _GLOBAL(__restore_cpu_e5500) 78 + _GLOBAL(__setup_cpu_e5500) 79 + mflr r4 80 + bl __e500_icache_setup 81 + bl __e500_dcache_setup 82 + #ifdef CONFIG_PPC_BOOK3E_64 83 + bl .__setup_base_ivors 84 + #else 85 + bl __setup_e500mc_ivors 86 + #endif 74 87 mtlr r4 75 88 blr
+42 -1
arch/powerpc/kernel/cputable.c
··· 48 48 extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec); 49 49 extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec); 50 50 extern void __setup_cpu_460sx(unsigned long offset, struct cpu_spec *spec); 51 + extern void __setup_cpu_apm821xx(unsigned long offset, struct cpu_spec *spec); 51 52 extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec); 52 53 extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec); 53 54 extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec); ··· 67 66 extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec); 68 67 extern void __restore_cpu_power7(void); 69 68 #endif /* CONFIG_PPC64 */ 69 + #if defined(CONFIG_E500) 70 + extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec); 71 + extern void __restore_cpu_e5500(void); 72 + #endif /* CONFIG_E500 */ 70 73 71 74 /* This table only contains "desktop" CPUs, it need to be filled with embedded 72 75 * ones as well... ··· 1810 1805 .machine_check = machine_check_440A, 1811 1806 .platform = "ppc440", 1812 1807 }, 1808 + { /* 464 in APM821xx */ 1809 + .pvr_mask = 0xffffff00, 1810 + .pvr_value = 0x12C41C80, 1811 + .cpu_name = "APM821XX", 1812 + .cpu_features = CPU_FTRS_44X, 1813 + .cpu_user_features = COMMON_USER_BOOKE | 1814 + PPC_FEATURE_HAS_FPU, 1815 + .mmu_features = MMU_FTR_TYPE_44x, 1816 + .icache_bsize = 32, 1817 + .dcache_bsize = 32, 1818 + .cpu_setup = __setup_cpu_apm821xx, 1819 + .machine_check = machine_check_440A, 1820 + .platform = "ppc440", 1821 + }, 1813 1822 { /* 476 core */ 1814 1823 .pvr_mask = 0xffff0000, 1815 1824 .pvr_value = 0x11a50000, ··· 1910 1891 .platform = "ppc5554", 1911 1892 } 1912 1893 #endif /* CONFIG_E200 */ 1894 + #endif /* CONFIG_PPC32 */ 1913 1895 #ifdef CONFIG_E500 1896 + #ifdef CONFIG_PPC32 1914 1897 { /* e500 */ 1915 1898 .pvr_mask = 0xffff0000, 1916 1899 .pvr_value = 0x80200000, ··· 1967 1946 .machine_check = machine_check_e500mc, 1968 1947 .platform = "ppce500mc", 1969 1948 }, 1949 + #endif /* CONFIG_PPC32 */ 1950 + { /* e5500 */ 1951 + .pvr_mask = 0xffff0000, 1952 + .pvr_value = 0x80240000, 1953 + .cpu_name = "e5500", 1954 + .cpu_features = CPU_FTRS_E500MC, 1955 + .cpu_user_features = COMMON_USER_BOOKE, 1956 + .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | 1957 + MMU_FTR_USE_TLBILX, 1958 + .icache_bsize = 64, 1959 + .dcache_bsize = 64, 1960 + .num_pmcs = 4, 1961 + .oprofile_cpu_type = "ppc/e500mc", 1962 + .oprofile_type = PPC_OPROFILE_FSL_EMB, 1963 + .cpu_setup = __setup_cpu_e5500, 1964 + .cpu_restore = __restore_cpu_e5500, 1965 + .machine_check = machine_check_e500mc, 1966 + .platform = "ppce5500", 1967 + }, 1968 + #ifdef CONFIG_PPC32 1970 1969 { /* default match */ 1971 1970 .pvr_mask = 0x00000000, 1972 1971 .pvr_value = 0x00000000, ··· 2001 1960 .machine_check = machine_check_e500, 2002 1961 .platform = "powerpc", 2003 1962 } 2004 - #endif /* CONFIG_E500 */ 2005 1963 #endif /* CONFIG_PPC32 */ 1964 + #endif /* CONFIG_E500 */ 2006 1965 2007 1966 #ifdef CONFIG_PPC_BOOK3E_64 2008 1967 { /* This is a default entry to get going, to be replaced by
+1 -12
arch/powerpc/kernel/crash.c
··· 414 414 crash_kexec_wait_realmode(crashing_cpu); 415 415 #endif 416 416 417 - for_each_irq(i) { 418 - struct irq_desc *desc = irq_to_desc(i); 419 - 420 - if (!desc || !desc->chip || !desc->chip->eoi) 421 - continue; 422 - 423 - if (desc->status & IRQ_INPROGRESS) 424 - desc->chip->eoi(i); 425 - 426 - if (!(desc->status & IRQ_DISABLED)) 427 - desc->chip->shutdown(i); 428 - } 417 + machine_kexec_mask_interrupts(); 429 418 430 419 /* 431 420 * Call registered shutdown routines savely. Swap out
+11 -10
arch/powerpc/kernel/dma-iommu.c
··· 74 74 { 75 75 struct iommu_table *tbl = get_iommu_table_base(dev); 76 76 77 - if (!tbl || tbl->it_offset > mask) { 78 - printk(KERN_INFO 79 - "Warning: IOMMU offset too big for device mask\n"); 80 - if (tbl) 81 - printk(KERN_INFO 82 - "mask: 0x%08llx, table offset: 0x%08lx\n", 83 - mask, tbl->it_offset); 84 - else 85 - printk(KERN_INFO "mask: 0x%08llx, table unavailable\n", 86 - mask); 77 + if (!tbl) { 78 + dev_info(dev, "Warning: IOMMU dma not supported: mask 0x%08llx" 79 + ", table unavailable\n", mask); 80 + return 0; 81 + } 82 + 83 + if ((tbl->it_offset + tbl->it_size) > (mask >> IOMMU_PAGE_SHIFT)) { 84 + dev_info(dev, "Warning: IOMMU window too big for device mask\n"); 85 + dev_info(dev, "mask: 0x%08llx, table end: 0x%08lx\n", 86 + mask, (tbl->it_offset + tbl->it_size) << 87 + IOMMU_PAGE_SHIFT); 87 88 return 0; 88 89 } else 89 90 return 1;
+19 -1
arch/powerpc/kernel/dma.c
··· 12 12 #include <linux/memblock.h> 13 13 #include <asm/bug.h> 14 14 #include <asm/abs_addr.h> 15 + #include <asm/machdep.h> 15 16 16 17 /* 17 18 * Generic direct DMA implementation ··· 90 89 /* Could be improved so platforms can set the limit in case 91 90 * they have limited DMA windows 92 91 */ 93 - return mask >= (memblock_end_of_DRAM() - 1); 92 + return mask >= get_dma_offset(dev) + (memblock_end_of_DRAM() - 1); 94 93 #else 95 94 return 1; 96 95 #endif ··· 154 153 EXPORT_SYMBOL(dma_direct_ops); 155 154 156 155 #define PREALLOC_DMA_DEBUG_ENTRIES (1 << 16) 156 + 157 + int dma_set_mask(struct device *dev, u64 dma_mask) 158 + { 159 + struct dma_map_ops *dma_ops = get_dma_ops(dev); 160 + 161 + if (ppc_md.dma_set_mask) 162 + return ppc_md.dma_set_mask(dev, dma_mask); 163 + if (unlikely(dma_ops == NULL)) 164 + return -EIO; 165 + if (dma_ops->set_dma_mask != NULL) 166 + return dma_ops->set_dma_mask(dev, dma_mask); 167 + if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 168 + return -EIO; 169 + *dev->dma_mask = dma_mask; 170 + return 0; 171 + } 172 + EXPORT_SYMBOL(dma_set_mask); 157 173 158 174 static int __init dma_init(void) 159 175 {
+40
arch/powerpc/kernel/entry_64.S
··· 97 97 addi r9,r1,STACK_FRAME_OVERHEAD 98 98 ld r11,exception_marker@toc(r2) 99 99 std r11,-16(r9) /* "regshere" marker */ 100 + #if defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR) 101 + BEGIN_FW_FTR_SECTION 102 + beq 33f 103 + /* if from user, see if there are any DTL entries to process */ 104 + ld r10,PACALPPACAPTR(r13) /* get ptr to VPA */ 105 + ld r11,PACA_DTL_RIDX(r13) /* get log read index */ 106 + ld r10,LPPACA_DTLIDX(r10) /* get log write index */ 107 + cmpd cr1,r11,r10 108 + beq+ cr1,33f 109 + bl .accumulate_stolen_time 110 + REST_GPR(0,r1) 111 + REST_4GPRS(3,r1) 112 + REST_2GPRS(7,r1) 113 + addi r9,r1,STACK_FRAME_OVERHEAD 114 + 33: 115 + END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) 116 + #endif /* CONFIG_VIRT_CPU_ACCOUNTING && CONFIG_PPC_SPLPAR */ 117 + 100 118 #ifdef CONFIG_TRACE_IRQFLAGS 101 119 bl .trace_hardirqs_on 102 120 REST_GPR(0,r1) ··· 220 202 bge- syscall_error 221 203 syscall_error_cont: 222 204 ld r7,_NIP(r1) 205 + BEGIN_FTR_SECTION 223 206 stdcx. r0,0,r1 /* to clear the reservation */ 207 + END_FTR_SECTION_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) 224 208 andi. r6,r8,MSR_PR 225 209 ld r4,_LINK(r1) 226 210 /* ··· 439 419 sync 440 420 #endif /* CONFIG_SMP */ 441 421 422 + /* 423 + * If we optimise away the clear of the reservation in system 424 + * calls because we know the CPU tracks the address of the 425 + * reservation, then we need to clear it here to cover the 426 + * case that the kernel context switch path has no larx 427 + * instructions. 428 + */ 429 + BEGIN_FTR_SECTION 430 + ldarx r6,0,r1 431 + END_FTR_SECTION_IFSET(CPU_FTR_STCX_CHECKS_ADDRESS) 432 + 442 433 addi r6,r4,-THREAD /* Convert THREAD to 'current' */ 443 434 std r6,PACACURRENT(r13) /* Set new 'current' */ 444 435 ··· 607 576 andi. r0,r3,MSR_RI 608 577 beq- unrecov_restore 609 578 579 + /* 580 + * Clear the reservation. If we know the CPU tracks the address of 581 + * the reservation then we can potentially save some cycles and use 582 + * a larx. On POWER6 and POWER7 this is significantly faster. 583 + */ 584 + BEGIN_FTR_SECTION 610 585 stdcx. r0,0,r1 /* to clear the reservation */ 586 + FTR_SECTION_ELSE 587 + ldarx r4,0,r1 588 + ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) 611 589 612 590 /* 613 591 * Clear RI before restoring r13. If we are returning to
-10
arch/powerpc/kernel/fpu.S
··· 163 163 /* 164 164 * These are used in the alignment trap handler when emulating 165 165 * single-precision loads and stores. 166 - * We restore and save the fpscr so the task gets the same result 167 - * and exceptions as if the cpu had performed the load or store. 168 166 */ 169 167 170 168 _GLOBAL(cvt_fd) 171 - lfd 0,THREAD_FPSCR(r5) /* load up fpscr value */ 172 - MTFSF_L(0) 173 169 lfs 0,0(r3) 174 170 stfd 0,0(r4) 175 - mffs 0 176 - stfd 0,THREAD_FPSCR(r5) /* save new fpscr value */ 177 171 blr 178 172 179 173 _GLOBAL(cvt_df) 180 - lfd 0,THREAD_FPSCR(r5) /* load up fpscr value */ 181 - MTFSF_L(0) 182 174 lfd 0,0(r3) 183 175 stfs 0,0(r4) 184 - mffs 0 185 - stfd 0,THREAD_FPSCR(r5) /* save new fpscr value */ 186 176 blr
+8 -2
arch/powerpc/kernel/head_fsl_booke.S
··· 152 152 /* Check to see if we're the second processor, and jump 153 153 * to the secondary_start code if so 154 154 */ 155 - mfspr r24,SPRN_PIR 156 - cmpwi r24,0 155 + lis r24, boot_cpuid@h 156 + ori r24, r24, boot_cpuid@l 157 + lwz r24, 0(r24) 158 + cmpwi r24, -1 159 + mfspr r24,SPRN_PIR 157 160 bne __secondary_start 158 161 #endif 159 162 ··· 177 174 ori r1,r1,init_thread_union@l 178 175 li r0,0 179 176 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1) 177 + 178 + rlwinm r22,r1,0,0,31-THREAD_SHIFT /* current thread_info */ 179 + stw r24, TI_CPU(r22) 180 180 181 181 bl early_init 182 182
+4 -2
arch/powerpc/kernel/irq.c
··· 587 587 * this will be fixed once slab is made available early 588 588 * instead of the current cruft 589 589 */ 590 - if (mem_init_done) 590 + if (mem_init_done) { 591 + of_node_put(host->of_node); 591 592 kfree(host); 593 + } 592 594 return NULL; 593 595 } 594 596 irq_map[0].host = host; ··· 1145 1143 unsigned long flags; 1146 1144 struct irq_desc *desc; 1147 1145 const char *p; 1148 - char none[] = "none"; 1146 + static const char none[] = "none"; 1149 1147 int i; 1150 1148 1151 1149 seq_printf(m, "%-5s %-7s %-15s %s\n", "virq", "hwirq",
+7 -7
arch/powerpc/kernel/lparcfg.c
··· 56 56 57 57 for_each_possible_cpu(cpu) { 58 58 if (firmware_has_feature(FW_FEATURE_ISERIES)) 59 - sum_purr += lppaca[cpu].emulated_time_base; 59 + sum_purr += lppaca_of(cpu).emulated_time_base; 60 60 else { 61 61 struct cpu_usage *cu; 62 62 ··· 263 263 ppp_data.active_system_procs); 264 264 265 265 /* pool related entries are apropriate for shared configs */ 266 - if (lppaca[0].shared_proc) { 266 + if (lppaca_of(0).shared_proc) { 267 267 unsigned long pool_idle_time, pool_procs; 268 268 269 269 seq_printf(m, "pool=%d\n", ppp_data.pool_num); ··· 460 460 return; 461 461 462 462 for_each_possible_cpu(cpu) { 463 - cmo_faults += lppaca[cpu].cmo_faults; 464 - cmo_fault_time += lppaca[cpu].cmo_fault_time; 463 + cmo_faults += lppaca_of(cpu).cmo_faults; 464 + cmo_fault_time += lppaca_of(cpu).cmo_fault_time; 465 465 } 466 466 467 467 seq_printf(m, "cmo_faults=%lu\n", cmo_faults); ··· 479 479 unsigned long dispatch_dispersions = 0; 480 480 481 481 for_each_possible_cpu(cpu) { 482 - dispatches += lppaca[cpu].yield_count; 483 - dispatch_dispersions += lppaca[cpu].dispersion_count; 482 + dispatches += lppaca_of(cpu).yield_count; 483 + dispatch_dispersions += lppaca_of(cpu).dispersion_count; 484 484 } 485 485 486 486 seq_printf(m, "dispatches=%lu\n", dispatches); ··· 545 545 seq_printf(m, "partition_potential_processors=%d\n", 546 546 partition_potential_processors); 547 547 548 - seq_printf(m, "shared_processor_mode=%d\n", lppaca[0].shared_proc); 548 + seq_printf(m, "shared_processor_mode=%d\n", lppaca_of(0).shared_proc); 549 549 550 550 seq_printf(m, "slb_size=%d\n", mmu_slb_size); 551 551
+24
arch/powerpc/kernel/machine_kexec.c
··· 14 14 #include <linux/threads.h> 15 15 #include <linux/memblock.h> 16 16 #include <linux/of.h> 17 + #include <linux/irq.h> 18 + 17 19 #include <asm/machdep.h> 18 20 #include <asm/prom.h> 19 21 #include <asm/sections.h> 22 + 23 + void machine_kexec_mask_interrupts(void) { 24 + unsigned int i; 25 + 26 + for_each_irq(i) { 27 + struct irq_desc *desc = irq_to_desc(i); 28 + 29 + if (!desc || !desc->chip) 30 + continue; 31 + 32 + if (desc->chip->eoi && 33 + desc->status & IRQ_INPROGRESS) 34 + desc->chip->eoi(i); 35 + 36 + if (desc->chip->mask) 37 + desc->chip->mask(i); 38 + 39 + if (desc->chip->disable && 40 + !(desc->status & IRQ_DISABLED)) 41 + desc->chip->disable(i); 42 + } 43 + } 20 44 21 45 void machine_crash_shutdown(struct pt_regs *regs) 22 46 {
+4
arch/powerpc/kernel/machine_kexec_32.c
··· 39 39 /* Interrupts aren't acceptable while we reboot */ 40 40 local_irq_disable(); 41 41 42 + /* mask each interrupt so we are in a more sane state for the 43 + * kexec kernel */ 44 + machine_kexec_mask_interrupts(); 45 + 42 46 page_list = image->head; 43 47 44 48 /* we need both effective and real address here */
+68 -2
arch/powerpc/kernel/paca.c
··· 27 27 #ifdef CONFIG_PPC_BOOK3S 28 28 29 29 /* 30 + * We only have to have statically allocated lppaca structs on 31 + * legacy iSeries, which supports at most 64 cpus. 32 + */ 33 + #ifdef CONFIG_PPC_ISERIES 34 + #if NR_CPUS < 64 35 + #define NR_LPPACAS NR_CPUS 36 + #else 37 + #define NR_LPPACAS 64 38 + #endif 39 + #else /* not iSeries */ 40 + #define NR_LPPACAS 1 41 + #endif 42 + 43 + /* 30 44 * The structure which the hypervisor knows about - this structure 31 45 * should not cross a page boundary. The vpa_init/register_vpa call 32 46 * is now known to fail if the lppaca structure crosses a page ··· 50 36 * will suffice to ensure that it doesn't cross a page boundary. 51 37 */ 52 38 struct lppaca lppaca[] = { 53 - [0 ... (NR_CPUS-1)] = { 39 + [0 ... (NR_LPPACAS-1)] = { 54 40 .desc = 0xd397d781, /* "LpPa" */ 55 41 .size = sizeof(struct lppaca), 56 42 .dyn_proc_status = 2, ··· 62 48 .page_ins = 0, 63 49 }, 64 50 }; 51 + 52 + static struct lppaca *extra_lppacas; 53 + static long __initdata lppaca_size; 54 + 55 + static void allocate_lppacas(int nr_cpus, unsigned long limit) 56 + { 57 + if (nr_cpus <= NR_LPPACAS) 58 + return; 59 + 60 + lppaca_size = PAGE_ALIGN(sizeof(struct lppaca) * 61 + (nr_cpus - NR_LPPACAS)); 62 + extra_lppacas = __va(memblock_alloc_base(lppaca_size, 63 + PAGE_SIZE, limit)); 64 + } 65 + 66 + static struct lppaca *new_lppaca(int cpu) 67 + { 68 + struct lppaca *lp; 69 + 70 + if (cpu < NR_LPPACAS) 71 + return &lppaca[cpu]; 72 + 73 + lp = extra_lppacas + (cpu - NR_LPPACAS); 74 + *lp = lppaca[0]; 75 + 76 + return lp; 77 + } 78 + 79 + static void free_lppacas(void) 80 + { 81 + long new_size = 0, nr; 82 + 83 + if (!lppaca_size) 84 + return; 85 + nr = num_possible_cpus() - NR_LPPACAS; 86 + if (nr > 0) 87 + new_size = PAGE_ALIGN(nr * sizeof(struct lppaca)); 88 + if (new_size >= lppaca_size) 89 + return; 90 + 91 + memblock_free(__pa(extra_lppacas) + new_size, lppaca_size - new_size); 92 + lppaca_size = new_size; 93 + } 94 + 95 + #else 96 + 97 + static inline void allocate_lppacas(int nr_cpus, unsigned long limit) { } 98 + static inline void free_lppacas(void) { } 65 99 66 100 #endif /* CONFIG_PPC_BOOK3S */ 67 101 ··· 150 88 unsigned long kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL; 151 89 152 90 #ifdef CONFIG_PPC_BOOK3S 153 - new_paca->lppaca_ptr = &lppaca[cpu]; 91 + new_paca->lppaca_ptr = new_lppaca(cpu); 154 92 #else 155 93 new_paca->kernel_pgd = swapper_pg_dir; 156 94 #endif ··· 206 144 printk(KERN_DEBUG "Allocated %u bytes for %d pacas at %p\n", 207 145 paca_size, nr_cpus, paca); 208 146 147 + allocate_lppacas(nr_cpus, limit); 148 + 209 149 /* Can't use for_each_*_cpu, as they aren't functional yet */ 210 150 for (cpu = 0; cpu < nr_cpus; cpu++) 211 151 initialise_paca(&paca[cpu], cpu); ··· 228 164 paca_size - new_size); 229 165 230 166 paca_size = new_size; 167 + 168 + free_lppacas(); 231 169 }
+1 -3
arch/powerpc/kernel/pci-common.c
··· 1090 1090 bus->number, bus->self ? pci_name(bus->self) : "PHB"); 1091 1091 1092 1092 list_for_each_entry(dev, &bus->devices, bus_list) { 1093 - struct dev_archdata *sd = &dev->dev.archdata; 1094 - 1095 1093 /* Cardbus can call us to add new devices to a bus, so ignore 1096 1094 * those who are already fully discovered 1097 1095 */ ··· 1105 1107 set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); 1106 1108 1107 1109 /* Hook up default DMA ops */ 1108 - sd->dma_ops = pci_dma_ops; 1110 + set_dma_ops(&dev->dev, pci_dma_ops); 1109 1111 set_dma_offset(&dev->dev, PCI_DRAM_OFFSET); 1110 1112 1111 1113 /* Additional platform DMA/iommu setup */
+2
arch/powerpc/kernel/ppc970-pmu.c
··· 169 169 switch (unit) { 170 170 case PM_VPU: 171 171 mask = 0x4c; /* byte 0 bits 2,3,6 */ 172 + break; 172 173 case PM_LSU0: 173 174 /* byte 2 bits 0,2,3,4,6; all of byte 1 */ 174 175 mask = 0x085dff00; 176 + break; 175 177 case PM_LSU1L: 176 178 mask = 0x50 << 24; /* byte 3 bits 4,6 */ 177 179 break;
-12
arch/powerpc/kernel/process.c
··· 517 517 518 518 account_system_vtime(current); 519 519 account_process_vtime(current); 520 - calculate_steal_time(); 521 520 522 521 /* 523 522 * We can't take a PMU exception inside _switch() since there is a ··· 1297 1298 1298 1299 return ret; 1299 1300 } 1300 - 1301 - #ifdef CONFIG_SMP 1302 - int arch_sd_sibling_asym_packing(void) 1303 - { 1304 - if (cpu_has_feature(CPU_FTR_ASYM_SMT)) { 1305 - printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n"); 1306 - return SD_ASYM_PACKING; 1307 - } 1308 - return 0; 1309 - } 1310 - #endif
+1 -1
arch/powerpc/kernel/ptrace.c
··· 1681 1681 1682 1682 if (unlikely(current->audit_context)) { 1683 1683 #ifdef CONFIG_PPC64 1684 - if (!test_thread_flag(TIF_32BIT)) 1684 + if (!is_32bit_task()) 1685 1685 audit_syscall_entry(AUDIT_ARCH_PPC64, 1686 1686 regs->gpr[0], 1687 1687 regs->gpr[3], regs->gpr[4],
+2 -2
arch/powerpc/kernel/rtas.c
··· 805 805 __rtas_suspend_cpu((struct rtas_suspend_me_data *)info, 1); 806 806 } 807 807 808 - static int rtas_ibm_suspend_me(struct rtas_args *args) 808 + int rtas_ibm_suspend_me(struct rtas_args *args) 809 809 { 810 810 long state; 811 811 long rc; ··· 855 855 return atomic_read(&data.error); 856 856 } 857 857 #else /* CONFIG_PPC_PSERIES */ 858 - static int rtas_ibm_suspend_me(struct rtas_args *args) 858 + int rtas_ibm_suspend_me(struct rtas_args *args) 859 859 { 860 860 return -ENOSYS; 861 861 }
+1 -1
arch/powerpc/kernel/setup_32.c
··· 46 46 47 47 extern void bootx_init(unsigned long r4, unsigned long phys); 48 48 49 - int boot_cpuid; 49 + int boot_cpuid = -1; 50 50 EXPORT_SYMBOL_GPL(boot_cpuid); 51 51 int boot_cpuid_phys; 52 52
+9 -5
arch/powerpc/kernel/smp.c
··· 508 508 if (smp_ops->take_timebase) 509 509 smp_ops->take_timebase(); 510 510 511 - if (system_state > SYSTEM_BOOTING) 512 - snapshot_timebase(); 513 - 514 511 secondary_cpu_time_init(); 515 512 516 513 ipi_call_lock(); ··· 572 575 573 576 free_cpumask_var(old_mask); 574 577 575 - snapshot_timebases(); 576 - 577 578 dump_numa_cpu_topology(); 579 + } 580 + 581 + int arch_sd_sibling_asym_packing(void) 582 + { 583 + if (cpu_has_feature(CPU_FTR_ASYM_SMT)) { 584 + printk_once(KERN_INFO "Enabling Asymmetric SMT scheduling\n"); 585 + return SD_ASYM_PACKING; 586 + } 587 + return 0; 578 588 } 579 589 580 590 #ifdef CONFIG_HOTPLUG_CPU
+133 -142
arch/powerpc/kernel/time.c
··· 161 161 static long timezone_offset; 162 162 163 163 unsigned long ppc_proc_freq; 164 - EXPORT_SYMBOL(ppc_proc_freq); 164 + EXPORT_SYMBOL_GPL(ppc_proc_freq); 165 165 unsigned long ppc_tb_freq; 166 - 167 - static DEFINE_PER_CPU(u64, last_jiffy); 166 + EXPORT_SYMBOL_GPL(ppc_tb_freq); 168 167 169 168 #ifdef CONFIG_VIRT_CPU_ACCOUNTING 170 169 /* ··· 184 185 185 186 cputime_t cputime_one_jiffy; 186 187 188 + void (*dtl_consumer)(struct dtl_entry *, u64); 189 + 187 190 static void calc_cputime_factors(void) 188 191 { 189 192 struct div_result res; ··· 201 200 } 202 201 203 202 /* 204 - * Read the PURR on systems that have it, otherwise the timebase. 203 + * Read the SPURR on systems that have it, otherwise the PURR, 204 + * or if that doesn't exist return the timebase value passed in. 205 205 */ 206 - static u64 read_purr(void) 206 + static u64 read_spurr(u64 tb) 207 207 { 208 + if (cpu_has_feature(CPU_FTR_SPURR)) 209 + return mfspr(SPRN_SPURR); 208 210 if (cpu_has_feature(CPU_FTR_PURR)) 209 211 return mfspr(SPRN_PURR); 210 - return mftb(); 212 + return tb; 213 + } 214 + 215 + #ifdef CONFIG_PPC_SPLPAR 216 + 217 + /* 218 + * Scan the dispatch trace log and count up the stolen time. 219 + * Should be called with interrupts disabled. 220 + */ 221 + static u64 scan_dispatch_log(u64 stop_tb) 222 + { 223 + u64 i = local_paca->dtl_ridx; 224 + struct dtl_entry *dtl = local_paca->dtl_curr; 225 + struct dtl_entry *dtl_end = local_paca->dispatch_log_end; 226 + struct lppaca *vpa = local_paca->lppaca_ptr; 227 + u64 tb_delta; 228 + u64 stolen = 0; 229 + u64 dtb; 230 + 231 + if (i == vpa->dtl_idx) 232 + return 0; 233 + while (i < vpa->dtl_idx) { 234 + if (dtl_consumer) 235 + dtl_consumer(dtl, i); 236 + dtb = dtl->timebase; 237 + tb_delta = dtl->enqueue_to_dispatch_time + 238 + dtl->ready_to_enqueue_time; 239 + barrier(); 240 + if (i + N_DISPATCH_LOG < vpa->dtl_idx) { 241 + /* buffer has overflowed */ 242 + i = vpa->dtl_idx - N_DISPATCH_LOG; 243 + dtl = local_paca->dispatch_log + (i % N_DISPATCH_LOG); 244 + continue; 245 + } 246 + if (dtb > stop_tb) 247 + break; 248 + stolen += tb_delta; 249 + ++i; 250 + ++dtl; 251 + if (dtl == dtl_end) 252 + dtl = local_paca->dispatch_log; 253 + } 254 + local_paca->dtl_ridx = i; 255 + local_paca->dtl_curr = dtl; 256 + return stolen; 211 257 } 212 258 213 259 /* 214 - * Read the SPURR on systems that have it, otherwise the purr 260 + * Accumulate stolen time by scanning the dispatch trace log. 261 + * Called on entry from user mode. 215 262 */ 216 - static u64 read_spurr(u64 purr) 263 + void accumulate_stolen_time(void) 217 264 { 218 - /* 219 - * cpus without PURR won't have a SPURR 220 - * We already know the former when we use this, so tell gcc 221 - */ 222 - if (cpu_has_feature(CPU_FTR_PURR) && cpu_has_feature(CPU_FTR_SPURR)) 223 - return mfspr(SPRN_SPURR); 224 - return purr; 265 + u64 sst, ust; 266 + 267 + sst = scan_dispatch_log(get_paca()->starttime_user); 268 + ust = scan_dispatch_log(get_paca()->starttime); 269 + get_paca()->system_time -= sst; 270 + get_paca()->user_time -= ust; 271 + get_paca()->stolen_time += ust + sst; 225 272 } 273 + 274 + static inline u64 calculate_stolen_time(u64 stop_tb) 275 + { 276 + u64 stolen = 0; 277 + 278 + if (get_paca()->dtl_ridx != get_paca()->lppaca_ptr->dtl_idx) { 279 + stolen = scan_dispatch_log(stop_tb); 280 + get_paca()->system_time -= stolen; 281 + } 282 + 283 + stolen += get_paca()->stolen_time; 284 + get_paca()->stolen_time = 0; 285 + return stolen; 286 + } 287 + 288 + #else /* CONFIG_PPC_SPLPAR */ 289 + static inline u64 calculate_stolen_time(u64 stop_tb) 290 + { 291 + return 0; 292 + } 293 + 294 + #endif /* CONFIG_PPC_SPLPAR */ 226 295 227 296 /* 228 297 * Account time for a transition between system, hard irq ··· 300 229 */ 301 230 void account_system_vtime(struct task_struct *tsk) 302 231 { 303 - u64 now, nowscaled, delta, deltascaled, sys_time; 232 + u64 now, nowscaled, delta, deltascaled; 304 233 unsigned long flags; 234 + u64 stolen, udelta, sys_scaled, user_scaled; 305 235 306 236 local_irq_save(flags); 307 - now = read_purr(); 237 + now = mftb(); 308 238 nowscaled = read_spurr(now); 309 - delta = now - get_paca()->startpurr; 239 + get_paca()->system_time += now - get_paca()->starttime; 240 + get_paca()->starttime = now; 310 241 deltascaled = nowscaled - get_paca()->startspurr; 311 - get_paca()->startpurr = now; 312 242 get_paca()->startspurr = nowscaled; 313 - if (!in_interrupt()) { 314 - /* deltascaled includes both user and system time. 315 - * Hence scale it based on the purr ratio to estimate 316 - * the system time */ 317 - sys_time = get_paca()->system_time; 318 - if (get_paca()->user_time) 319 - deltascaled = deltascaled * sys_time / 320 - (sys_time + get_paca()->user_time); 321 - delta += sys_time; 322 - get_paca()->system_time = 0; 243 + 244 + stolen = calculate_stolen_time(now); 245 + 246 + delta = get_paca()->system_time; 247 + get_paca()->system_time = 0; 248 + udelta = get_paca()->user_time - get_paca()->utime_sspurr; 249 + get_paca()->utime_sspurr = get_paca()->user_time; 250 + 251 + /* 252 + * Because we don't read the SPURR on every kernel entry/exit, 253 + * deltascaled includes both user and system SPURR ticks. 254 + * Apportion these ticks to system SPURR ticks and user 255 + * SPURR ticks in the same ratio as the system time (delta) 256 + * and user time (udelta) values obtained from the timebase 257 + * over the same interval. The system ticks get accounted here; 258 + * the user ticks get saved up in paca->user_time_scaled to be 259 + * used by account_process_tick. 260 + */ 261 + sys_scaled = delta; 262 + user_scaled = udelta; 263 + if (deltascaled != delta + udelta) { 264 + if (udelta) { 265 + sys_scaled = deltascaled * delta / (delta + udelta); 266 + user_scaled = deltascaled - sys_scaled; 267 + } else { 268 + sys_scaled = deltascaled; 269 + } 323 270 } 324 - if (in_irq() || idle_task(smp_processor_id()) != tsk) 325 - account_system_time(tsk, 0, delta, deltascaled); 326 - else 327 - account_idle_time(delta); 328 - __get_cpu_var(cputime_last_delta) = delta; 329 - __get_cpu_var(cputime_scaled_last_delta) = deltascaled; 271 + get_paca()->user_time_scaled += user_scaled; 272 + 273 + if (in_irq() || idle_task(smp_processor_id()) != tsk) { 274 + account_system_time(tsk, 0, delta, sys_scaled); 275 + if (stolen) 276 + account_steal_time(stolen); 277 + } else { 278 + account_idle_time(delta + stolen); 279 + } 330 280 local_irq_restore(flags); 331 281 } 332 282 EXPORT_SYMBOL_GPL(account_system_vtime); ··· 357 265 * by the exception entry and exit code to the generic process 358 266 * user and system time records. 359 267 * Must be called with interrupts disabled. 268 + * Assumes that account_system_vtime() has been called recently 269 + * (i.e. since the last entry from usermode) so that 270 + * get_paca()->user_time_scaled is up to date. 360 271 */ 361 272 void account_process_tick(struct task_struct *tsk, int user_tick) 362 273 { 363 274 cputime_t utime, utimescaled; 364 275 365 276 utime = get_paca()->user_time; 277 + utimescaled = get_paca()->user_time_scaled; 366 278 get_paca()->user_time = 0; 367 - utimescaled = cputime_to_scaled(utime); 279 + get_paca()->user_time_scaled = 0; 280 + get_paca()->utime_sspurr = 0; 368 281 account_user_time(tsk, utime, utimescaled); 369 282 } 370 283 371 - /* 372 - * Stuff for accounting stolen time. 373 - */ 374 - struct cpu_purr_data { 375 - int initialized; /* thread is running */ 376 - u64 tb; /* last TB value read */ 377 - u64 purr; /* last PURR value read */ 378 - u64 spurr; /* last SPURR value read */ 379 - }; 380 - 381 - /* 382 - * Each entry in the cpu_purr_data array is manipulated only by its 383 - * "owner" cpu -- usually in the timer interrupt but also occasionally 384 - * in process context for cpu online. As long as cpus do not touch 385 - * each others' cpu_purr_data, disabling local interrupts is 386 - * sufficient to serialize accesses. 387 - */ 388 - static DEFINE_PER_CPU(struct cpu_purr_data, cpu_purr_data); 389 - 390 - static void snapshot_tb_and_purr(void *data) 391 - { 392 - unsigned long flags; 393 - struct cpu_purr_data *p = &__get_cpu_var(cpu_purr_data); 394 - 395 - local_irq_save(flags); 396 - p->tb = get_tb_or_rtc(); 397 - p->purr = mfspr(SPRN_PURR); 398 - wmb(); 399 - p->initialized = 1; 400 - local_irq_restore(flags); 401 - } 402 - 403 - /* 404 - * Called during boot when all cpus have come up. 405 - */ 406 - void snapshot_timebases(void) 407 - { 408 - if (!cpu_has_feature(CPU_FTR_PURR)) 409 - return; 410 - on_each_cpu(snapshot_tb_and_purr, NULL, 1); 411 - } 412 - 413 - /* 414 - * Must be called with interrupts disabled. 415 - */ 416 - void calculate_steal_time(void) 417 - { 418 - u64 tb, purr; 419 - s64 stolen; 420 - struct cpu_purr_data *pme; 421 - 422 - pme = &__get_cpu_var(cpu_purr_data); 423 - if (!pme->initialized) 424 - return; /* !CPU_FTR_PURR or early in early boot */ 425 - tb = mftb(); 426 - purr = mfspr(SPRN_PURR); 427 - stolen = (tb - pme->tb) - (purr - pme->purr); 428 - if (stolen > 0) { 429 - if (idle_task(smp_processor_id()) != current) 430 - account_steal_time(stolen); 431 - else 432 - account_idle_time(stolen); 433 - } 434 - pme->tb = tb; 435 - pme->purr = purr; 436 - } 437 - 438 - #ifdef CONFIG_PPC_SPLPAR 439 - /* 440 - * Must be called before the cpu is added to the online map when 441 - * a cpu is being brought up at runtime. 442 - */ 443 - static void snapshot_purr(void) 444 - { 445 - struct cpu_purr_data *pme; 446 - unsigned long flags; 447 - 448 - if (!cpu_has_feature(CPU_FTR_PURR)) 449 - return; 450 - local_irq_save(flags); 451 - pme = &__get_cpu_var(cpu_purr_data); 452 - pme->tb = mftb(); 453 - pme->purr = mfspr(SPRN_PURR); 454 - pme->initialized = 1; 455 - local_irq_restore(flags); 456 - } 457 - 458 - #endif /* CONFIG_PPC_SPLPAR */ 459 - 460 284 #else /* ! CONFIG_VIRT_CPU_ACCOUNTING */ 461 285 #define calc_cputime_factors() 462 - #define calculate_steal_time() do { } while (0) 463 286 #endif 464 - 465 - #if !(defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR)) 466 - #define snapshot_purr() do { } while (0) 467 - #endif 468 - 469 - /* 470 - * Called when a cpu comes up after the system has finished booting, 471 - * i.e. as a result of a hotplug cpu action. 472 - */ 473 - void snapshot_timebase(void) 474 - { 475 - __get_cpu_var(last_jiffy) = get_tb_or_rtc(); 476 - snapshot_purr(); 477 - } 478 287 479 288 void __delay(unsigned long loops) 480 289 { ··· 577 584 578 585 old_regs = set_irq_regs(regs); 579 586 irq_enter(); 580 - 581 - calculate_steal_time(); 582 587 583 588 if (test_irq_work_pending()) { 584 589 clear_irq_work_pending();
+5
arch/powerpc/kernel/traps.c
··· 538 538 539 539 return 0; 540 540 } 541 + 542 + int machine_check_generic(struct pt_regs *regs) 543 + { 544 + return 0; 545 + } 541 546 #elif defined(CONFIG_E200) 542 547 int machine_check_e200(struct pt_regs *regs) 543 548 {
+3 -3
arch/powerpc/kernel/vdso.c
··· 159 159 { 160 160 int i; 161 161 162 - if (!vma || test_thread_flag(TIF_32BIT)) { 162 + if (!vma || is_32bit_task()) { 163 163 printk("vDSO32 @ %016lx:\n", (unsigned long)vdso32_kbase); 164 164 for (i=0; i<vdso32_pages; i++) { 165 165 struct page *pg = virt_to_page(vdso32_kbase + ··· 170 170 dump_one_vdso_page(pg, upg); 171 171 } 172 172 } 173 - if (!vma || !test_thread_flag(TIF_32BIT)) { 173 + if (!vma || !is_32bit_task()) { 174 174 printk("vDSO64 @ %016lx:\n", (unsigned long)vdso64_kbase); 175 175 for (i=0; i<vdso64_pages; i++) { 176 176 struct page *pg = virt_to_page(vdso64_kbase + ··· 200 200 return 0; 201 201 202 202 #ifdef CONFIG_PPC64 203 - if (test_thread_flag(TIF_32BIT)) { 203 + if (is_32bit_task()) { 204 204 vdso_pagelist = vdso32_pagelist; 205 205 vdso_pages = vdso32_pages; 206 206 vdso_base = VDSO32_MBASE;
+3 -3
arch/powerpc/kernel/vdso32/Makefile
··· 14 14 15 15 GCOV_PROFILE := n 16 16 17 - EXTRA_CFLAGS := -shared -fno-common -fno-builtin 18 - EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 17 + ccflags-y := -shared -fno-common -fno-builtin 18 + ccflags-y += -nostdlib -Wl,-soname=linux-vdso32.so.1 \ 19 19 $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 20 - EXTRA_AFLAGS := -D__VDSO32__ -s 20 + asflags-y := -D__VDSO32__ -s 21 21 22 22 obj-y += vdso32_wrapper.o 23 23 extra-y += vdso32.lds
+3 -3
arch/powerpc/kernel/vdso64/Makefile
··· 9 9 10 10 GCOV_PROFILE := n 11 11 12 - EXTRA_CFLAGS := -shared -fno-common -fno-builtin 13 - EXTRA_CFLAGS += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 12 + ccflags-y := -shared -fno-common -fno-builtin 13 + ccflags-y += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ 14 14 $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) 15 - EXTRA_AFLAGS := -D__VDSO64__ -s 15 + asflags-y := -D__VDSO64__ -s 16 16 17 17 obj-y += vdso64_wrapper.o 18 18 extra-y += vdso64.lds
+7 -3
arch/powerpc/kernel/vio.c
··· 1184 1184 /* vio_dev refcount hit 0 */ 1185 1185 static void __devinit vio_dev_release(struct device *dev) 1186 1186 { 1187 - /* XXX should free TCE table */ 1187 + struct iommu_table *tbl = get_iommu_table_base(dev); 1188 + 1189 + /* iSeries uses a common table for all vio devices */ 1190 + if (!firmware_has_feature(FW_FEATURE_ISERIES) && tbl) 1191 + iommu_free_table(tbl, dev->of_node ? 1192 + dev->of_node->full_name : dev_name(dev)); 1188 1193 of_node_put(dev->of_node); 1189 1194 kfree(to_vio_dev(dev)); 1190 1195 } ··· 1259 1254 if (device_register(&viodev->dev)) { 1260 1255 printk(KERN_ERR "%s: failed to register device %s\n", 1261 1256 __func__, dev_name(&viodev->dev)); 1262 - /* XXX free TCE table */ 1263 - kfree(viodev); 1257 + put_device(&viodev->dev); 1264 1258 return NULL; 1265 1259 } 1266 1260
+1 -1
arch/powerpc/kvm/Makefile
··· 4 4 5 5 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 6 6 7 - EXTRA_CFLAGS += -Ivirt/kvm -Iarch/powerpc/kvm 7 + ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm 8 8 9 9 common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o) 10 10
+20 -24
arch/powerpc/kvm/book3s_paired_singles.c
··· 159 159 160 160 static inline void kvmppc_sync_qpr(struct kvm_vcpu *vcpu, int rt) 161 161 { 162 - kvm_cvt_df(&vcpu->arch.fpr[rt], &vcpu->arch.qpr[rt], &vcpu->arch.fpscr); 162 + kvm_cvt_df(&vcpu->arch.fpr[rt], &vcpu->arch.qpr[rt]); 163 163 } 164 164 165 165 static void kvmppc_inject_pf(struct kvm_vcpu *vcpu, ulong eaddr, bool is_store) ··· 204 204 /* put in registers */ 205 205 switch (ls_type) { 206 206 case FPU_LS_SINGLE: 207 - kvm_cvt_fd((u32*)tmp, &vcpu->arch.fpr[rs], &vcpu->arch.fpscr); 207 + kvm_cvt_fd((u32*)tmp, &vcpu->arch.fpr[rs]); 208 208 vcpu->arch.qpr[rs] = *((u32*)tmp); 209 209 break; 210 210 case FPU_LS_DOUBLE: ··· 230 230 231 231 switch (ls_type) { 232 232 case FPU_LS_SINGLE: 233 - kvm_cvt_df(&vcpu->arch.fpr[rs], (u32*)tmp, &vcpu->arch.fpscr); 233 + kvm_cvt_df(&vcpu->arch.fpr[rs], (u32*)tmp); 234 234 val = *((u32*)tmp); 235 235 len = sizeof(u32); 236 236 break; ··· 296 296 emulated = EMULATE_DONE; 297 297 298 298 /* put in registers */ 299 - kvm_cvt_fd(&tmp[0], &vcpu->arch.fpr[rs], &vcpu->arch.fpscr); 299 + kvm_cvt_fd(&tmp[0], &vcpu->arch.fpr[rs]); 300 300 vcpu->arch.qpr[rs] = tmp[1]; 301 301 302 302 dprintk(KERN_INFO "KVM: PSQ_LD [0x%x, 0x%x] at 0x%lx (%d)\n", tmp[0], ··· 314 314 u32 tmp[2]; 315 315 int len = w ? sizeof(u32) : sizeof(u64); 316 316 317 - kvm_cvt_df(&vcpu->arch.fpr[rs], &tmp[0], &vcpu->arch.fpscr); 317 + kvm_cvt_df(&vcpu->arch.fpr[rs], &tmp[0]); 318 318 tmp[1] = vcpu->arch.qpr[rs]; 319 319 320 320 r = kvmppc_st(vcpu, &addr, len, tmp, true); ··· 516 516 WARN_ON(rc); 517 517 518 518 /* PS0 */ 519 - kvm_cvt_df(&fpr[reg_in1], &ps0_in1, &vcpu->arch.fpscr); 520 - kvm_cvt_df(&fpr[reg_in2], &ps0_in2, &vcpu->arch.fpscr); 521 - kvm_cvt_df(&fpr[reg_in3], &ps0_in3, &vcpu->arch.fpscr); 519 + kvm_cvt_df(&fpr[reg_in1], &ps0_in1); 520 + kvm_cvt_df(&fpr[reg_in2], &ps0_in2); 521 + kvm_cvt_df(&fpr[reg_in3], &ps0_in3); 522 522 523 523 if (scalar & SCALAR_LOW) 524 524 ps0_in2 = qpr[reg_in2]; ··· 529 529 ps0_in1, ps0_in2, ps0_in3, ps0_out); 530 530 531 531 if (!(scalar & SCALAR_NO_PS0)) 532 - kvm_cvt_fd(&ps0_out, &fpr[reg_out], &vcpu->arch.fpscr); 532 + kvm_cvt_fd(&ps0_out, &fpr[reg_out]); 533 533 534 534 /* PS1 */ 535 535 ps1_in1 = qpr[reg_in1]; ··· 566 566 WARN_ON(rc); 567 567 568 568 /* PS0 */ 569 - kvm_cvt_df(&fpr[reg_in1], &ps0_in1, &vcpu->arch.fpscr); 569 + kvm_cvt_df(&fpr[reg_in1], &ps0_in1); 570 570 571 571 if (scalar & SCALAR_LOW) 572 572 ps0_in2 = qpr[reg_in2]; 573 573 else 574 - kvm_cvt_df(&fpr[reg_in2], &ps0_in2, &vcpu->arch.fpscr); 574 + kvm_cvt_df(&fpr[reg_in2], &ps0_in2); 575 575 576 576 func(&vcpu->arch.fpscr, &ps0_out, &ps0_in1, &ps0_in2); 577 577 ··· 579 579 dprintk(KERN_INFO "PS2 ps0 -> f(0x%x, 0x%x) = 0x%x\n", 580 580 ps0_in1, ps0_in2, ps0_out); 581 581 582 - kvm_cvt_fd(&ps0_out, &fpr[reg_out], &vcpu->arch.fpscr); 582 + kvm_cvt_fd(&ps0_out, &fpr[reg_out]); 583 583 } 584 584 585 585 /* PS1 */ ··· 615 615 WARN_ON(rc); 616 616 617 617 /* PS0 */ 618 - kvm_cvt_df(&fpr[reg_in], &ps0_in, &vcpu->arch.fpscr); 618 + kvm_cvt_df(&fpr[reg_in], &ps0_in); 619 619 func(&vcpu->arch.fpscr, &ps0_out, &ps0_in); 620 620 621 621 dprintk(KERN_INFO "PS1 ps0 -> f(0x%x) = 0x%x\n", 622 622 ps0_in, ps0_out); 623 623 624 - kvm_cvt_fd(&ps0_out, &fpr[reg_out], &vcpu->arch.fpscr); 624 + kvm_cvt_fd(&ps0_out, &fpr[reg_out]); 625 625 626 626 /* PS1 */ 627 627 ps1_in = qpr[reg_in]; ··· 671 671 #ifdef DEBUG 672 672 for (i = 0; i < ARRAY_SIZE(vcpu->arch.fpr); i++) { 673 673 u32 f; 674 - kvm_cvt_df(&vcpu->arch.fpr[i], &f, &vcpu->arch.fpscr); 674 + kvm_cvt_df(&vcpu->arch.fpr[i], &f); 675 675 dprintk(KERN_INFO "FPR[%d] = 0x%x / 0x%llx QPR[%d] = 0x%x\n", 676 676 i, f, vcpu->arch.fpr[i], i, vcpu->arch.qpr[i]); 677 677 } ··· 796 796 vcpu->arch.fpr[ax_rd] = vcpu->arch.fpr[ax_ra]; 797 797 /* vcpu->arch.qpr[ax_rd] = vcpu->arch.fpr[ax_rb]; */ 798 798 kvm_cvt_df(&vcpu->arch.fpr[ax_rb], 799 - &vcpu->arch.qpr[ax_rd], 800 - &vcpu->arch.fpscr); 799 + &vcpu->arch.qpr[ax_rd]); 801 800 break; 802 801 case OP_4X_PS_MERGE01: 803 802 WARN_ON(rcomp); ··· 807 808 WARN_ON(rcomp); 808 809 /* vcpu->arch.fpr[ax_rd] = vcpu->arch.qpr[ax_ra]; */ 809 810 kvm_cvt_fd(&vcpu->arch.qpr[ax_ra], 810 - &vcpu->arch.fpr[ax_rd], 811 - &vcpu->arch.fpscr); 811 + &vcpu->arch.fpr[ax_rd]); 812 812 /* vcpu->arch.qpr[ax_rd] = vcpu->arch.fpr[ax_rb]; */ 813 813 kvm_cvt_df(&vcpu->arch.fpr[ax_rb], 814 - &vcpu->arch.qpr[ax_rd], 815 - &vcpu->arch.fpscr); 814 + &vcpu->arch.qpr[ax_rd]); 816 815 break; 817 816 case OP_4X_PS_MERGE11: 818 817 WARN_ON(rcomp); 819 818 /* vcpu->arch.fpr[ax_rd] = vcpu->arch.qpr[ax_ra]; */ 820 819 kvm_cvt_fd(&vcpu->arch.qpr[ax_ra], 821 - &vcpu->arch.fpr[ax_rd], 822 - &vcpu->arch.fpscr); 820 + &vcpu->arch.fpr[ax_rd]); 823 821 vcpu->arch.qpr[ax_rd] = vcpu->arch.qpr[ax_rb]; 824 822 break; 825 823 } ··· 1251 1255 #ifdef DEBUG 1252 1256 for (i = 0; i < ARRAY_SIZE(vcpu->arch.fpr); i++) { 1253 1257 u32 f; 1254 - kvm_cvt_df(&vcpu->arch.fpr[i], &f, &vcpu->arch.fpscr); 1258 + kvm_cvt_df(&vcpu->arch.fpr[i], &f); 1255 1259 dprintk(KERN_INFO "FPR[%d] = 0x%x\n", i, f); 1256 1260 } 1257 1261 #endif
+2 -2
arch/powerpc/kvm/emulate.c
··· 145 145 /* this default type might be overwritten by subcategories */ 146 146 kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS); 147 147 148 - pr_debug(KERN_INFO "Emulating opcode %d / %d\n", get_op(inst), get_xop(inst)); 148 + pr_debug("Emulating opcode %d / %d\n", get_op(inst), get_xop(inst)); 149 149 150 150 switch (get_op(inst)) { 151 151 case OP_TRAP: ··· 275 275 { 276 276 u64 jd = get_tb() - vcpu->arch.dec_jiffies; 277 277 kvmppc_set_gpr(vcpu, rt, vcpu->arch.dec - jd); 278 - pr_debug(KERN_INFO "mfDEC: %x - %llx = %lx\n", 278 + pr_debug("mfDEC: %x - %llx = %lx\n", 279 279 vcpu->arch.dec, jd, 280 280 kvmppc_get_gpr(vcpu, rt)); 281 281 break;
-8
arch/powerpc/kvm/fpu.S
··· 273 273 FPD_THREE_IN(fnmadd) 274 274 275 275 _GLOBAL(kvm_cvt_fd) 276 - lfd 0,0(r5) /* load up fpscr value */ 277 - MTFSF_L(0) 278 276 lfs 0,0(r3) 279 277 stfd 0,0(r4) 280 - mffs 0 281 - stfd 0,0(r5) /* save new fpscr value */ 282 278 blr 283 279 284 280 _GLOBAL(kvm_cvt_df) 285 - lfd 0,0(r5) /* load up fpscr value */ 286 - MTFSF_L(0) 287 281 lfd 0,0(r3) 288 282 stfs 0,0(r4) 289 - mffs 0 290 - stfd 0,0(r5) /* save new fpscr value */ 291 283 blr
+3 -4
arch/powerpc/lib/Makefile
··· 4 4 5 5 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 6 6 7 - ifeq ($(CONFIG_PPC64),y) 8 - EXTRA_CFLAGS += -mno-minimal-toc 9 - endif 7 + ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 10 8 11 9 CFLAGS_REMOVE_code-patching.o = -pg 12 10 CFLAGS_REMOVE_feature-fixups.o = -pg ··· 15 17 obj-$(CONFIG_HAS_IOMEM) += devres.o 16 18 17 19 obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ 18 - memcpy_64.o usercopy_64.o mem_64.o string.o 20 + memcpy_64.o usercopy_64.o mem_64.o string.o \ 21 + checksum_wrappers_64.o 19 22 obj-$(CONFIG_XMON) += sstep.o ldstfp.o 20 23 obj-$(CONFIG_KPROBES) += sstep.o ldstfp.o 21 24 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += sstep.o ldstfp.o
+356 -128
arch/powerpc/lib/checksum_64.S
··· 65 65 srwi r3,r3,16 66 66 blr 67 67 68 + #define STACKFRAMESIZE 256 69 + #define STK_REG(i) (112 + ((i)-14)*8) 70 + 68 71 /* 69 72 * Computes the checksum of a memory block at buff, length len, 70 73 * and adds in "sum" (32-bit). 71 74 * 72 - * This code assumes at least halfword alignment, though the length 73 - * can be any number of bytes. The sum is accumulated in r5. 74 - * 75 75 * csum_partial(r3=buff, r4=len, r5=sum) 76 76 */ 77 77 _GLOBAL(csum_partial) 78 - subi r3,r3,8 /* we'll offset by 8 for the loads */ 79 - srdi. r6,r4,3 /* divide by 8 for doubleword count */ 80 - addic r5,r5,0 /* clear carry */ 81 - beq 3f /* if we're doing < 8 bytes */ 82 - andi. r0,r3,2 /* aligned on a word boundary already? */ 83 - beq+ 1f 84 - lhz r6,8(r3) /* do 2 bytes to get aligned */ 85 - addi r3,r3,2 86 - subi r4,r4,2 87 - addc r5,r5,r6 88 - srdi. r6,r4,3 /* recompute number of doublewords */ 89 - beq 3f /* any left? */ 90 - 1: mtctr r6 91 - 2: ldu r6,8(r3) /* main sum loop */ 92 - adde r5,r5,r6 93 - bdnz 2b 94 - andi. r4,r4,7 /* compute bytes left to sum after doublewords */ 95 - 3: cmpwi 0,r4,4 /* is at least a full word left? */ 96 - blt 4f 97 - lwz r6,8(r3) /* sum this word */ 78 + addic r0,r5,0 /* clear carry */ 79 + 80 + srdi. r6,r4,3 /* less than 8 bytes? */ 81 + beq .Lcsum_tail_word 82 + 83 + /* 84 + * If only halfword aligned, align to a double word. Since odd 85 + * aligned addresses should be rare and they would require more 86 + * work to calculate the correct checksum, we ignore that case 87 + * and take the potential slowdown of unaligned loads. 88 + */ 89 + rldicl. r6,r3,64-1,64-2 /* r6 = (r3 & 0x3) >> 1 */ 90 + beq .Lcsum_aligned 91 + 92 + li r7,4 93 + sub r6,r7,r6 94 + mtctr r6 95 + 96 + 1: 97 + lhz r6,0(r3) /* align to doubleword */ 98 + subi r4,r4,2 99 + addi r3,r3,2 100 + adde r0,r0,r6 101 + bdnz 1b 102 + 103 + .Lcsum_aligned: 104 + /* 105 + * We unroll the loop such that each iteration is 64 bytes with an 106 + * entry and exit limb of 64 bytes, meaning a minimum size of 107 + * 128 bytes. 108 + */ 109 + srdi. r6,r4,7 110 + beq .Lcsum_tail_doublewords /* len < 128 */ 111 + 112 + srdi r6,r4,6 113 + subi r6,r6,1 114 + mtctr r6 115 + 116 + stdu r1,-STACKFRAMESIZE(r1) 117 + std r14,STK_REG(r14)(r1) 118 + std r15,STK_REG(r15)(r1) 119 + std r16,STK_REG(r16)(r1) 120 + 121 + ld r6,0(r3) 122 + ld r9,8(r3) 123 + 124 + ld r10,16(r3) 125 + ld r11,24(r3) 126 + 127 + /* 128 + * On POWER6 and POWER7 back to back addes take 2 cycles because of 129 + * the XER dependency. This means the fastest this loop can go is 130 + * 16 cycles per iteration. The scheduling of the loop below has 131 + * been shown to hit this on both POWER6 and POWER7. 132 + */ 133 + .align 5 134 + 2: 135 + adde r0,r0,r6 136 + ld r12,32(r3) 137 + ld r14,40(r3) 138 + 139 + adde r0,r0,r9 140 + ld r15,48(r3) 141 + ld r16,56(r3) 142 + addi r3,r3,64 143 + 144 + adde r0,r0,r10 145 + 146 + adde r0,r0,r11 147 + 148 + adde r0,r0,r12 149 + 150 + adde r0,r0,r14 151 + 152 + adde r0,r0,r15 153 + ld r6,0(r3) 154 + ld r9,8(r3) 155 + 156 + adde r0,r0,r16 157 + ld r10,16(r3) 158 + ld r11,24(r3) 159 + bdnz 2b 160 + 161 + 162 + adde r0,r0,r6 163 + ld r12,32(r3) 164 + ld r14,40(r3) 165 + 166 + adde r0,r0,r9 167 + ld r15,48(r3) 168 + ld r16,56(r3) 169 + addi r3,r3,64 170 + 171 + adde r0,r0,r10 172 + adde r0,r0,r11 173 + adde r0,r0,r12 174 + adde r0,r0,r14 175 + adde r0,r0,r15 176 + adde r0,r0,r16 177 + 178 + ld r14,STK_REG(r14)(r1) 179 + ld r15,STK_REG(r15)(r1) 180 + ld r16,STK_REG(r16)(r1) 181 + addi r1,r1,STACKFRAMESIZE 182 + 183 + andi. r4,r4,63 184 + 185 + .Lcsum_tail_doublewords: /* Up to 127 bytes to go */ 186 + srdi. r6,r4,3 187 + beq .Lcsum_tail_word 188 + 189 + mtctr r6 190 + 3: 191 + ld r6,0(r3) 192 + addi r3,r3,8 193 + adde r0,r0,r6 194 + bdnz 3b 195 + 196 + andi. r4,r4,7 197 + 198 + .Lcsum_tail_word: /* Up to 7 bytes to go */ 199 + srdi. r6,r4,2 200 + beq .Lcsum_tail_halfword 201 + 202 + lwz r6,0(r3) 98 203 addi r3,r3,4 204 + adde r0,r0,r6 99 205 subi r4,r4,4 100 - adde r5,r5,r6 101 - 4: cmpwi 0,r4,2 /* is at least a halfword left? */ 102 - blt+ 5f 103 - lhz r6,8(r3) /* sum this halfword */ 104 - addi r3,r3,2 105 - subi r4,r4,2 106 - adde r5,r5,r6 107 - 5: cmpwi 0,r4,1 /* is at least a byte left? */ 108 - bne+ 6f 109 - lbz r6,8(r3) /* sum this byte */ 110 - slwi r6,r6,8 /* this byte is assumed to be the upper byte of a halfword */ 111 - adde r5,r5,r6 112 - 6: addze r5,r5 /* add in final carry */ 113 - rldicl r4,r5,32,0 /* fold two 32-bit halves together */ 114 - add r3,r4,r5 115 - srdi r3,r3,32 116 - blr 206 + 207 + .Lcsum_tail_halfword: /* Up to 3 bytes to go */ 208 + srdi. r6,r4,1 209 + beq .Lcsum_tail_byte 210 + 211 + lhz r6,0(r3) 212 + addi r3,r3,2 213 + adde r0,r0,r6 214 + subi r4,r4,2 215 + 216 + .Lcsum_tail_byte: /* Up to 1 byte to go */ 217 + andi. r6,r4,1 218 + beq .Lcsum_finish 219 + 220 + lbz r6,0(r3) 221 + sldi r9,r6,8 /* Pad the byte out to 16 bits */ 222 + adde r0,r0,r9 223 + 224 + .Lcsum_finish: 225 + addze r0,r0 /* add in final carry */ 226 + rldicl r4,r0,32,0 /* fold two 32 bit halves together */ 227 + add r3,r4,r0 228 + srdi r3,r3,32 229 + blr 230 + 231 + 232 + .macro source 233 + 100: 234 + .section __ex_table,"a" 235 + .align 3 236 + .llong 100b,.Lsrc_error 237 + .previous 238 + .endm 239 + 240 + .macro dest 241 + 200: 242 + .section __ex_table,"a" 243 + .align 3 244 + .llong 200b,.Ldest_error 245 + .previous 246 + .endm 117 247 118 248 /* 119 249 * Computes the checksum of a memory block at src, length len, 120 250 * and adds in "sum" (32-bit), while copying the block to dst. 121 251 * If an access exception occurs on src or dst, it stores -EFAULT 122 - * to *src_err or *dst_err respectively, and (for an error on 123 - * src) zeroes the rest of dst. 124 - * 125 - * This code needs to be reworked to take advantage of 64 bit sum+copy. 126 - * However, due to tokenring halfword alignment problems this will be very 127 - * tricky. For now we'll leave it until we instrument it somehow. 252 + * to *src_err or *dst_err respectively. The caller must take any action 253 + * required in this case (zeroing memory, recalculating partial checksum etc). 128 254 * 129 255 * csum_partial_copy_generic(r3=src, r4=dst, r5=len, r6=sum, r7=src_err, r8=dst_err) 130 256 */ 131 257 _GLOBAL(csum_partial_copy_generic) 132 - addic r0,r6,0 133 - subi r3,r3,4 134 - subi r4,r4,4 135 - srwi. r6,r5,2 136 - beq 3f /* if we're doing < 4 bytes */ 137 - andi. r9,r4,2 /* Align dst to longword boundary */ 138 - beq+ 1f 139 - 81: lhz r6,4(r3) /* do 2 bytes to get aligned */ 140 - addi r3,r3,2 258 + addic r0,r6,0 /* clear carry */ 259 + 260 + srdi. r6,r5,3 /* less than 8 bytes? */ 261 + beq .Lcopy_tail_word 262 + 263 + /* 264 + * If only halfword aligned, align to a double word. Since odd 265 + * aligned addresses should be rare and they would require more 266 + * work to calculate the correct checksum, we ignore that case 267 + * and take the potential slowdown of unaligned loads. 268 + * 269 + * If the source and destination are relatively unaligned we only 270 + * align the source. This keeps things simple. 271 + */ 272 + rldicl. r6,r3,64-1,64-2 /* r6 = (r3 & 0x3) >> 1 */ 273 + beq .Lcopy_aligned 274 + 275 + li r7,4 276 + sub r6,r7,r6 277 + mtctr r6 278 + 279 + 1: 280 + source; lhz r6,0(r3) /* align to doubleword */ 141 281 subi r5,r5,2 142 - 91: sth r6,4(r4) 143 - addi r4,r4,2 144 - addc r0,r0,r6 145 - srwi. r6,r5,2 /* # words to do */ 146 - beq 3f 147 - 1: mtctr r6 148 - 82: lwzu r6,4(r3) /* the bdnz has zero overhead, so it should */ 149 - 92: stwu r6,4(r4) /* be unnecessary to unroll this loop */ 150 - adde r0,r0,r6 151 - bdnz 82b 152 - andi. r5,r5,3 153 - 3: cmpwi 0,r5,2 154 - blt+ 4f 155 - 83: lhz r6,4(r3) 156 282 addi r3,r3,2 157 - subi r5,r5,2 158 - 93: sth r6,4(r4) 283 + adde r0,r0,r6 284 + dest; sth r6,0(r4) 159 285 addi r4,r4,2 286 + bdnz 1b 287 + 288 + .Lcopy_aligned: 289 + /* 290 + * We unroll the loop such that each iteration is 64 bytes with an 291 + * entry and exit limb of 64 bytes, meaning a minimum size of 292 + * 128 bytes. 293 + */ 294 + srdi. r6,r5,7 295 + beq .Lcopy_tail_doublewords /* len < 128 */ 296 + 297 + srdi r6,r5,6 298 + subi r6,r6,1 299 + mtctr r6 300 + 301 + stdu r1,-STACKFRAMESIZE(r1) 302 + std r14,STK_REG(r14)(r1) 303 + std r15,STK_REG(r15)(r1) 304 + std r16,STK_REG(r16)(r1) 305 + 306 + source; ld r6,0(r3) 307 + source; ld r9,8(r3) 308 + 309 + source; ld r10,16(r3) 310 + source; ld r11,24(r3) 311 + 312 + /* 313 + * On POWER6 and POWER7 back to back addes take 2 cycles because of 314 + * the XER dependency. This means the fastest this loop can go is 315 + * 16 cycles per iteration. The scheduling of the loop below has 316 + * been shown to hit this on both POWER6 and POWER7. 317 + */ 318 + .align 5 319 + 2: 160 320 adde r0,r0,r6 161 - 4: cmpwi 0,r5,1 162 - bne+ 5f 163 - 84: lbz r6,4(r3) 164 - 94: stb r6,4(r4) 165 - slwi r6,r6,8 /* Upper byte of word */ 321 + source; ld r12,32(r3) 322 + source; ld r14,40(r3) 323 + 324 + adde r0,r0,r9 325 + source; ld r15,48(r3) 326 + source; ld r16,56(r3) 327 + addi r3,r3,64 328 + 329 + adde r0,r0,r10 330 + dest; std r6,0(r4) 331 + dest; std r9,8(r4) 332 + 333 + adde r0,r0,r11 334 + dest; std r10,16(r4) 335 + dest; std r11,24(r4) 336 + 337 + adde r0,r0,r12 338 + dest; std r12,32(r4) 339 + dest; std r14,40(r4) 340 + 341 + adde r0,r0,r14 342 + dest; std r15,48(r4) 343 + dest; std r16,56(r4) 344 + addi r4,r4,64 345 + 346 + adde r0,r0,r15 347 + source; ld r6,0(r3) 348 + source; ld r9,8(r3) 349 + 350 + adde r0,r0,r16 351 + source; ld r10,16(r3) 352 + source; ld r11,24(r3) 353 + bdnz 2b 354 + 355 + 166 356 adde r0,r0,r6 167 - 5: addze r3,r0 /* add in final carry (unlikely with 64-bit regs) */ 168 - rldicl r4,r3,32,0 /* fold 64 bit value */ 169 - add r3,r4,r3 170 - srdi r3,r3,32 357 + source; ld r12,32(r3) 358 + source; ld r14,40(r3) 359 + 360 + adde r0,r0,r9 361 + source; ld r15,48(r3) 362 + source; ld r16,56(r3) 363 + addi r3,r3,64 364 + 365 + adde r0,r0,r10 366 + dest; std r6,0(r4) 367 + dest; std r9,8(r4) 368 + 369 + adde r0,r0,r11 370 + dest; std r10,16(r4) 371 + dest; std r11,24(r4) 372 + 373 + adde r0,r0,r12 374 + dest; std r12,32(r4) 375 + dest; std r14,40(r4) 376 + 377 + adde r0,r0,r14 378 + dest; std r15,48(r4) 379 + dest; std r16,56(r4) 380 + addi r4,r4,64 381 + 382 + adde r0,r0,r15 383 + adde r0,r0,r16 384 + 385 + ld r14,STK_REG(r14)(r1) 386 + ld r15,STK_REG(r15)(r1) 387 + ld r16,STK_REG(r16)(r1) 388 + addi r1,r1,STACKFRAMESIZE 389 + 390 + andi. r5,r5,63 391 + 392 + .Lcopy_tail_doublewords: /* Up to 127 bytes to go */ 393 + srdi. r6,r5,3 394 + beq .Lcopy_tail_word 395 + 396 + mtctr r6 397 + 3: 398 + source; ld r6,0(r3) 399 + addi r3,r3,8 400 + adde r0,r0,r6 401 + dest; std r6,0(r4) 402 + addi r4,r4,8 403 + bdnz 3b 404 + 405 + andi. r5,r5,7 406 + 407 + .Lcopy_tail_word: /* Up to 7 bytes to go */ 408 + srdi. r6,r5,2 409 + beq .Lcopy_tail_halfword 410 + 411 + source; lwz r6,0(r3) 412 + addi r3,r3,4 413 + adde r0,r0,r6 414 + dest; stw r6,0(r4) 415 + addi r4,r4,4 416 + subi r5,r5,4 417 + 418 + .Lcopy_tail_halfword: /* Up to 3 bytes to go */ 419 + srdi. r6,r5,1 420 + beq .Lcopy_tail_byte 421 + 422 + source; lhz r6,0(r3) 423 + addi r3,r3,2 424 + adde r0,r0,r6 425 + dest; sth r6,0(r4) 426 + addi r4,r4,2 427 + subi r5,r5,2 428 + 429 + .Lcopy_tail_byte: /* Up to 1 byte to go */ 430 + andi. r6,r5,1 431 + beq .Lcopy_finish 432 + 433 + source; lbz r6,0(r3) 434 + sldi r9,r6,8 /* Pad the byte out to 16 bits */ 435 + adde r0,r0,r9 436 + dest; stb r6,0(r4) 437 + 438 + .Lcopy_finish: 439 + addze r0,r0 /* add in final carry */ 440 + rldicl r4,r0,32,0 /* fold two 32 bit halves together */ 441 + add r3,r4,r0 442 + srdi r3,r3,32 171 443 blr 172 444 173 - /* These shouldn't go in the fixup section, since that would 174 - cause the ex_table addresses to get out of order. */ 175 - 176 - .globl src_error_1 177 - src_error_1: 178 - li r6,0 179 - subi r5,r5,2 180 - 95: sth r6,4(r4) 181 - addi r4,r4,2 182 - srwi. r6,r5,2 183 - beq 3f 184 - mtctr r6 185 - .globl src_error_2 186 - src_error_2: 187 - li r6,0 188 - 96: stwu r6,4(r4) 189 - bdnz 96b 190 - 3: andi. r5,r5,3 191 - beq src_error 192 - .globl src_error_3 193 - src_error_3: 194 - li r6,0 195 - mtctr r5 196 - addi r4,r4,3 197 - 97: stbu r6,1(r4) 198 - bdnz 97b 199 - .globl src_error 200 - src_error: 445 + .Lsrc_error: 201 446 cmpdi 0,r7,0 202 - beq 1f 447 + beqlr 203 448 li r6,-EFAULT 204 449 stw r6,0(r7) 205 - 1: addze r3,r0 206 450 blr 207 451 208 - .globl dst_error 209 - dst_error: 452 + .Ldest_error: 210 453 cmpdi 0,r8,0 211 - beq 1f 454 + beqlr 212 455 li r6,-EFAULT 213 456 stw r6,0(r8) 214 - 1: addze r3,r0 215 457 blr 216 - 217 - .section __ex_table,"a" 218 - .align 3 219 - .llong 81b,src_error_1 220 - .llong 91b,dst_error 221 - .llong 82b,src_error_2 222 - .llong 92b,dst_error 223 - .llong 83b,src_error_3 224 - .llong 93b,dst_error 225 - .llong 84b,src_error_3 226 - .llong 94b,dst_error 227 - .llong 95b,dst_error 228 - .llong 96b,dst_error 229 - .llong 97b,dst_error
+102
arch/powerpc/lib/checksum_wrappers_64.c
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License as published by 4 + * the Free Software Foundation; either version 2 of the License, or 5 + * (at your option) any later version. 6 + * 7 + * This program is distributed in the hope that it will be useful, 8 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 + * GNU General Public License for more details. 11 + * 12 + * You should have received a copy of the GNU General Public License 13 + * along with this program; if not, write to the Free Software 14 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 + * 16 + * Copyright (C) IBM Corporation, 2010 17 + * 18 + * Author: Anton Blanchard <anton@au.ibm.com> 19 + */ 20 + #include <linux/module.h> 21 + #include <linux/compiler.h> 22 + #include <linux/types.h> 23 + #include <asm/checksum.h> 24 + #include <asm/uaccess.h> 25 + 26 + __wsum csum_and_copy_from_user(const void __user *src, void *dst, 27 + int len, __wsum sum, int *err_ptr) 28 + { 29 + unsigned int csum; 30 + 31 + might_sleep(); 32 + 33 + *err_ptr = 0; 34 + 35 + if (!len) { 36 + csum = 0; 37 + goto out; 38 + } 39 + 40 + if (unlikely((len < 0) || !access_ok(VERIFY_READ, src, len))) { 41 + *err_ptr = -EFAULT; 42 + csum = (__force unsigned int)sum; 43 + goto out; 44 + } 45 + 46 + csum = csum_partial_copy_generic((void __force *)src, dst, 47 + len, sum, err_ptr, NULL); 48 + 49 + if (unlikely(*err_ptr)) { 50 + int missing = __copy_from_user(dst, src, len); 51 + 52 + if (missing) { 53 + memset(dst + len - missing, 0, missing); 54 + *err_ptr = -EFAULT; 55 + } else { 56 + *err_ptr = 0; 57 + } 58 + 59 + csum = csum_partial(dst, len, sum); 60 + } 61 + 62 + out: 63 + return (__force __wsum)csum; 64 + } 65 + EXPORT_SYMBOL(csum_and_copy_from_user); 66 + 67 + __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len, 68 + __wsum sum, int *err_ptr) 69 + { 70 + unsigned int csum; 71 + 72 + might_sleep(); 73 + 74 + *err_ptr = 0; 75 + 76 + if (!len) { 77 + csum = 0; 78 + goto out; 79 + } 80 + 81 + if (unlikely((len < 0) || !access_ok(VERIFY_WRITE, dst, len))) { 82 + *err_ptr = -EFAULT; 83 + csum = -1; /* invalid checksum */ 84 + goto out; 85 + } 86 + 87 + csum = csum_partial_copy_generic(src, (void __force *)dst, 88 + len, sum, NULL, err_ptr); 89 + 90 + if (unlikely(*err_ptr)) { 91 + csum = csum_partial(src, len, sum); 92 + 93 + if (copy_to_user(dst, src, len)) { 94 + *err_ptr = -EFAULT; 95 + csum = -1; /* invalid checksum */ 96 + } 97 + } 98 + 99 + out: 100 + return (__force __wsum)csum; 101 + } 102 + EXPORT_SYMBOL(csum_and_copy_to_user);
+1 -1
arch/powerpc/lib/copy_32.S
··· 62 62 63 63 .text 64 64 .stabs "arch/powerpc/lib/",N_SO,0,0,0f 65 - .stabs "copy32.S",N_SO,0,0,0f 65 + .stabs "copy_32.S",N_SO,0,0,0f 66 66 0: 67 67 68 68 CACHELINE_BYTES = L1_CACHE_BYTES
+20 -16
arch/powerpc/lib/ldstfp.S
··· 17 17 #include <asm/asm-offsets.h> 18 18 #include <linux/errno.h> 19 19 20 + #ifdef CONFIG_PPC_FPU 21 + 20 22 #define STKFRM (PPC_MIN_STKFRM + 16) 21 23 22 24 .macro extab instr,handler ··· 83 81 mfmsr r6 84 82 ori r7,r6,MSR_FP 85 83 cmpwi cr7,r3,0 86 - mtmsrd r7 84 + MTMSRD(r7) 87 85 isync 88 86 beq cr7,1f 89 87 stfd fr0,STKFRM-16(r1) ··· 95 93 lfd fr0,STKFRM-16(r1) 96 94 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 97 95 mtlr r0 98 - mtmsrd r6 96 + MTMSRD(r6) 99 97 isync 100 98 mr r3,r9 101 99 addi r1,r1,STKFRM ··· 110 108 mfmsr r6 111 109 ori r7,r6,MSR_FP 112 110 cmpwi cr7,r3,0 113 - mtmsrd r7 111 + MTMSRD(r7) 114 112 isync 115 113 beq cr7,1f 116 114 stfd fr0,STKFRM-16(r1) ··· 122 120 lfd fr0,STKFRM-16(r1) 123 121 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 124 122 mtlr r0 125 - mtmsrd r6 123 + MTMSRD(r6) 126 124 isync 127 125 mr r3,r9 128 126 addi r1,r1,STKFRM ··· 137 135 mfmsr r6 138 136 ori r7,r6,MSR_FP 139 137 cmpwi cr7,r3,0 140 - mtmsrd r7 138 + MTMSRD(r7) 141 139 isync 142 140 beq cr7,1f 143 141 stfd fr0,STKFRM-16(r1) ··· 149 147 lfd fr0,STKFRM-16(r1) 150 148 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 151 149 mtlr r0 152 - mtmsrd r6 150 + MTMSRD(r6) 153 151 isync 154 152 mr r3,r9 155 153 addi r1,r1,STKFRM ··· 164 162 mfmsr r6 165 163 ori r7,r6,MSR_FP 166 164 cmpwi cr7,r3,0 167 - mtmsrd r7 165 + MTMSRD(r7) 168 166 isync 169 167 beq cr7,1f 170 168 stfd fr0,STKFRM-16(r1) ··· 176 174 lfd fr0,STKFRM-16(r1) 177 175 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 178 176 mtlr r0 179 - mtmsrd r6 177 + MTMSRD(r6) 180 178 isync 181 179 mr r3,r9 182 180 addi r1,r1,STKFRM ··· 231 229 oris r7,r6,MSR_VEC@h 232 230 cmpwi cr7,r3,0 233 231 li r8,STKFRM-16 234 - mtmsrd r7 232 + MTMSRD(r7) 235 233 isync 236 234 beq cr7,1f 237 235 stvx vr0,r1,r8 ··· 243 241 lvx vr0,r1,r8 244 242 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 245 243 mtlr r0 246 - mtmsrd r6 244 + MTMSRD(r6) 247 245 isync 248 246 mr r3,r9 249 247 addi r1,r1,STKFRM ··· 259 257 oris r7,r6,MSR_VEC@h 260 258 cmpwi cr7,r3,0 261 259 li r8,STKFRM-16 262 - mtmsrd r7 260 + MTMSRD(r7) 263 261 isync 264 262 beq cr7,1f 265 263 stvx vr0,r1,r8 ··· 271 269 lvx vr0,r1,r8 272 270 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 273 271 mtlr r0 274 - mtmsrd r6 272 + MTMSRD(r6) 275 273 isync 276 274 mr r3,r9 277 275 addi r1,r1,STKFRM ··· 327 325 oris r7,r6,MSR_VSX@h 328 326 cmpwi cr7,r3,0 329 327 li r8,STKFRM-16 330 - mtmsrd r7 328 + MTMSRD(r7) 331 329 isync 332 330 beq cr7,1f 333 331 STXVD2X(0,r1,r8) ··· 339 337 LXVD2X(0,r1,r8) 340 338 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 341 339 mtlr r0 342 - mtmsrd r6 340 + MTMSRD(r6) 343 341 isync 344 342 mr r3,r9 345 343 addi r1,r1,STKFRM ··· 355 353 oris r7,r6,MSR_VSX@h 356 354 cmpwi cr7,r3,0 357 355 li r8,STKFRM-16 358 - mtmsrd r7 356 + MTMSRD(r7) 359 357 isync 360 358 beq cr7,1f 361 359 STXVD2X(0,r1,r8) ··· 367 365 LXVD2X(0,r1,r8) 368 366 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 369 367 mtlr r0 370 - mtmsrd r6 368 + MTMSRD(r6) 371 369 isync 372 370 mr r3,r9 373 371 addi r1,r1,STKFRM ··· 375 373 extab 2b,3b 376 374 377 375 #endif /* CONFIG_VSX */ 376 + 377 + #endif /* CONFIG_PPC_FPU */
+2 -2
arch/powerpc/lib/locks.c
··· 34 34 return; 35 35 holder_cpu = lock_value & 0xffff; 36 36 BUG_ON(holder_cpu >= NR_CPUS); 37 - yield_count = lppaca[holder_cpu].yield_count; 37 + yield_count = lppaca_of(holder_cpu).yield_count; 38 38 if ((yield_count & 1) == 0) 39 39 return; /* virtual cpu is currently running */ 40 40 rmb(); ··· 65 65 return; /* no write lock at present */ 66 66 holder_cpu = lock_value & 0xffff; 67 67 BUG_ON(holder_cpu >= NR_CPUS); 68 - yield_count = lppaca[holder_cpu].yield_count; 68 + yield_count = lppaca_of(holder_cpu).yield_count; 69 69 if ((yield_count & 1) == 0) 70 70 return; /* virtual cpu is currently running */ 71 71 rmb();
+8
arch/powerpc/lib/sstep.c
··· 30 30 #define XER_OV 0x40000000U 31 31 #define XER_CA 0x20000000U 32 32 33 + #ifdef CONFIG_PPC_FPU 33 34 /* 34 35 * Functions in ldstfp.S 35 36 */ ··· 42 41 extern int do_stvx(int rn, unsigned long ea); 43 42 extern int do_lxvd2x(int rn, unsigned long ea); 44 43 extern int do_stxvd2x(int rn, unsigned long ea); 44 + #endif 45 45 46 46 /* 47 47 * Determine whether a conditional branch instruction would branch. ··· 292 290 return write_mem_unaligned(val, ea, nb, regs); 293 291 } 294 292 293 + #ifdef CONFIG_PPC_FPU 295 294 /* 296 295 * Check the address and alignment, and call func to do the actual 297 296 * load or store. ··· 354 351 } 355 352 return err; 356 353 } 354 + #endif 357 355 358 356 #ifdef CONFIG_ALTIVEC 359 357 /* For Altivec/VMX, no need to worry about alignment */ ··· 1397 1393 regs->gpr[rd] = byterev_4(val); 1398 1394 goto ldst_done; 1399 1395 1396 + #ifdef CONFIG_PPC_CPU 1400 1397 case 535: /* lfsx */ 1401 1398 case 567: /* lfsux */ 1402 1399 if (!(regs->msr & MSR_FP)) ··· 1429 1424 ea = xform_ea(instr, regs, u); 1430 1425 err = do_fp_store(rd, do_stfd, ea, 8, regs); 1431 1426 goto ldst_done; 1427 + #endif 1432 1428 1433 1429 #ifdef __powerpc64__ 1434 1430 case 660: /* stdbrx */ ··· 1540 1534 } while (++rd < 32); 1541 1535 goto instr_done; 1542 1536 1537 + #ifdef CONFIG_PPC_FPU 1543 1538 case 48: /* lfs */ 1544 1539 case 49: /* lfsu */ 1545 1540 if (!(regs->msr & MSR_FP)) ··· 1572 1565 ea = dform_ea(instr, regs); 1573 1566 err = do_fp_store(rd, do_stfd, ea, 8, regs); 1574 1567 goto ldst_done; 1568 + #endif 1575 1569 1576 1570 #ifdef __powerpc64__ 1577 1571 case 58: /* ld[u], lwa */
+1 -1
arch/powerpc/math-emu/Makefile
··· 15 15 CFLAGS_fabs.o = -fno-builtin-fabs 16 16 CFLAGS_math.o = -fno-builtin-fabs 17 17 18 - EXTRA_CFLAGS = -I. -Iinclude/math-emu -w 18 + ccflags-y = -I. -Iinclude/math-emu -w
+2 -4
arch/powerpc/mm/Makefile
··· 4 4 5 5 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 6 6 7 - ifeq ($(CONFIG_PPC64),y) 8 - EXTRA_CFLAGS += -mno-minimal-toc 9 - endif 7 + ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 10 8 11 9 obj-y := fault.o mem.o pgtable.o gup.o \ 12 10 init_$(CONFIG_WORD_SIZE).o \ ··· 23 25 mmu_context_hash$(CONFIG_WORD_SIZE).o 24 26 obj-$(CONFIG_40x) += 40x_mmu.o 25 27 obj-$(CONFIG_44x) += 44x_mmu.o 26 - obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o 28 + obj-$(CONFIG_PPC_FSL_BOOK3E) += fsl_booke_mmu.o 27 29 obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o 28 30 obj-$(CONFIG_PPC_MM_SLICES) += slice.o 29 31 ifeq ($(CONFIG_HUGETLB_PAGE),y)
+6
arch/powerpc/mm/fault.c
··· 30 30 #include <linux/kprobes.h> 31 31 #include <linux/kdebug.h> 32 32 #include <linux/perf_event.h> 33 + #include <linux/magic.h> 33 34 34 35 #include <asm/firmware.h> 35 36 #include <asm/page.h> ··· 386 385 void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) 387 386 { 388 387 const struct exception_table_entry *entry; 388 + unsigned long *stackend; 389 389 390 390 /* Are we prepared to handle this fault? */ 391 391 if ((entry = search_exception_tables(regs->nip)) != NULL) { ··· 414 412 } 415 413 printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n", 416 414 regs->nip); 415 + 416 + stackend = end_of_stack(current); 417 + if (current != &init_task && *stackend != STACK_END_MAGIC) 418 + printk(KERN_ALERT "Thread overran stack, or stack corrupted\n"); 417 419 418 420 die("Kernel access of bad area", regs, sig); 419 421 }
+9 -6
arch/powerpc/mm/fsl_booke_mmu.c
··· 57 57 58 58 unsigned int tlbcam_index; 59 59 60 - 61 - #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS) 62 - #error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS" 63 - #endif 64 - 65 60 #define NUM_TLBCAMS (64) 66 61 struct tlbcam TLBCAM[NUM_TLBCAMS]; 67 62 ··· 133 138 if (mmu_has_feature(MMU_FTR_BIG_PHYS)) 134 139 TLBCAM[index].MAS7 = (u64)phys >> 32; 135 140 136 - if (flags & _PAGE_USER) { 141 + /* Below is unlikely -- only for large user pages or similar */ 142 + if (pte_user(flags)) { 137 143 TLBCAM[index].MAS3 |= MAS3_UX | MAS3_UR; 138 144 TLBCAM[index].MAS3 |= ((flags & _PAGE_RW) ? MAS3_UW : 0); 139 145 } ··· 181 185 return amount_mapped; 182 186 } 183 187 188 + #ifdef CONFIG_PPC32 189 + 190 + #if defined(CONFIG_LOWMEM_CAM_NUM_BOOL) && (CONFIG_LOWMEM_CAM_NUM >= NUM_TLBCAMS) 191 + #error "LOWMEM_CAM_NUM must be less than NUM_TLBCAMS" 192 + #endif 193 + 184 194 unsigned long __init mmu_mapin_ram(unsigned long top) 185 195 { 186 196 return tlbcam_addrs[tlbcam_index - 1].limit - PAGE_OFFSET + 1; ··· 227 225 /* 64M mapped initially according to head_fsl_booke.S */ 228 226 memblock_set_current_limit(min_t(u64, limit, 0x04000000)); 229 227 } 228 + #endif
+4 -2
arch/powerpc/mm/mmu_context_nohash.c
··· 334 334 /* We don't touch CPU 0 map, it's allocated at aboot and kept 335 335 * around forever 336 336 */ 337 - if (cpu == 0) 337 + if (cpu == boot_cpuid) 338 338 return NOTIFY_OK; 339 339 340 340 switch (action) { ··· 420 420 */ 421 421 context_map = alloc_bootmem(CTX_MAP_SIZE); 422 422 context_mm = alloc_bootmem(sizeof(void *) * (last_context + 1)); 423 + #ifndef CONFIG_SMP 423 424 stale_map[0] = alloc_bootmem(CTX_MAP_SIZE); 425 + #else 426 + stale_map[boot_cpuid] = alloc_bootmem(CTX_MAP_SIZE); 424 427 425 - #ifdef CONFIG_SMP 426 428 register_cpu_notifier(&mmu_context_cpu_nb); 427 429 #endif 428 430
+4 -1
arch/powerpc/mm/mmu_decl.h
··· 140 140 extern void MMU_init_hw(void); 141 141 extern unsigned long mmu_mapin_ram(unsigned long top); 142 142 143 - #elif defined(CONFIG_FSL_BOOKE) 143 + #elif defined(CONFIG_PPC_FSL_BOOK3E) 144 + extern unsigned long map_mem_in_cams(unsigned long ram, int max_cam_idx); 145 + #ifdef CONFIG_PPC32 144 146 extern void MMU_init_hw(void); 145 147 extern unsigned long mmu_mapin_ram(unsigned long top); 146 148 extern void adjust_total_lowmem(void); 149 + #endif 147 150 extern void loadcam_entry(unsigned int index); 148 151 149 152 struct tlbcam {
+53 -3
arch/powerpc/mm/tlb_nohash.c
··· 349 349 350 350 static void setup_page_sizes(void) 351 351 { 352 - unsigned int tlb0cfg = mfspr(SPRN_TLB0CFG); 353 - unsigned int tlb0ps = mfspr(SPRN_TLB0PS); 354 - unsigned int eptcfg = mfspr(SPRN_EPTCFG); 352 + unsigned int tlb0cfg; 353 + unsigned int tlb0ps; 354 + unsigned int eptcfg; 355 355 int i, psize; 356 + 357 + #ifdef CONFIG_PPC_FSL_BOOK3E 358 + unsigned int mmucfg = mfspr(SPRN_MMUCFG); 359 + 360 + if (((mmucfg & MMUCFG_MAVN) == MMUCFG_MAVN_V1) && 361 + (mmu_has_feature(MMU_FTR_TYPE_FSL_E))) { 362 + unsigned int tlb1cfg = mfspr(SPRN_TLB1CFG); 363 + unsigned int min_pg, max_pg; 364 + 365 + min_pg = (tlb1cfg & TLBnCFG_MINSIZE) >> TLBnCFG_MINSIZE_SHIFT; 366 + max_pg = (tlb1cfg & TLBnCFG_MAXSIZE) >> TLBnCFG_MAXSIZE_SHIFT; 367 + 368 + for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) { 369 + struct mmu_psize_def *def; 370 + unsigned int shift; 371 + 372 + def = &mmu_psize_defs[psize]; 373 + shift = def->shift; 374 + 375 + if (shift == 0) 376 + continue; 377 + 378 + /* adjust to be in terms of 4^shift Kb */ 379 + shift = (shift - 10) >> 1; 380 + 381 + if ((shift >= min_pg) && (shift <= max_pg)) 382 + def->flags |= MMU_PAGE_SIZE_DIRECT; 383 + } 384 + 385 + goto no_indirect; 386 + } 387 + #endif 388 + 389 + tlb0cfg = mfspr(SPRN_TLB0CFG); 390 + tlb0ps = mfspr(SPRN_TLB0PS); 391 + eptcfg = mfspr(SPRN_EPTCFG); 356 392 357 393 /* Look for supported direct sizes */ 358 394 for (psize = 0; psize < MMU_PAGE_COUNT; ++psize) { ··· 540 504 * for use by the TLB miss code 541 505 */ 542 506 linear_map_top = memblock_end_of_DRAM(); 507 + 508 + #ifdef CONFIG_PPC_FSL_BOOK3E 509 + if (mmu_has_feature(MMU_FTR_TYPE_FSL_E)) { 510 + unsigned int num_cams; 511 + 512 + /* use a quarter of the TLBCAM for bolted linear map */ 513 + num_cams = (mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY) / 4; 514 + linear_map_top = map_mem_in_cams(linear_map_top, num_cams); 515 + 516 + /* limit memory so we dont have linear faults */ 517 + memblock_enforce_memory_limit(linear_map_top); 518 + memblock_analyze(); 519 + } 520 + #endif 543 521 544 522 /* A sync won't hurt us after mucking around with 545 523 * the MMU configuration
+1 -1
arch/powerpc/mm/tlb_nohash_low.S
··· 367 367 #error Unsupported processor type ! 368 368 #endif 369 369 370 - #if defined(CONFIG_FSL_BOOKE) 370 + #if defined(CONFIG_PPC_FSL_BOOK3E) 371 371 /* 372 372 * extern void loadcam_entry(unsigned int index) 373 373 *
+1 -3
arch/powerpc/oprofile/Makefile
··· 1 1 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 2 2 3 - ifeq ($(CONFIG_PPC64),y) 4 - EXTRA_CFLAGS += -mno-minimal-toc 5 - endif 3 + ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 6 4 7 5 obj-$(CONFIG_OPROFILE) += oprofile.o 8 6
+1 -1
arch/powerpc/oprofile/backtrace.c
··· 105 105 } 106 106 } else { 107 107 #ifdef CONFIG_PPC64 108 - if (!test_thread_flag(TIF_32BIT)) { 108 + if (!is_32bit_task()) { 109 109 while (depth--) { 110 110 sp = user_getsp64(sp, first_frame); 111 111 if (!sp)
+8 -7
arch/powerpc/oprofile/op_model_fsl_emb.c
··· 2 2 * Freescale Embedded oprofile support, based on ppc64 oprofile support 3 3 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM 4 4 * 5 - * Copyright (c) 2004 Freescale Semiconductor, Inc 5 + * Copyright (c) 2004, 2010 Freescale Semiconductor, Inc 6 6 * 7 7 * Author: Andy Fleming 8 8 * Maintainer: Kumar Gala <galak@kernel.crashing.org> ··· 321 321 int val; 322 322 int i; 323 323 324 - /* set the PMM bit (see comment below) */ 325 - mtmsr(mfmsr() | MSR_PMM); 326 - 327 324 pc = regs->nip; 328 325 is_kernel = is_kernel_addr(pc); 329 326 ··· 337 340 } 338 341 339 342 /* The freeze bit was set by the interrupt. */ 340 - /* Clear the freeze bit, and reenable the interrupt. 341 - * The counters won't actually start until the rfi clears 342 - * the PMM bit */ 343 + /* Clear the freeze bit, and reenable the interrupt. The 344 + * counters won't actually start until the rfi clears the PMM 345 + * bit. The PMM bit should not be set until after the interrupt 346 + * is cleared to avoid it getting lost in some hypervisor 347 + * environments. 348 + */ 349 + mtmsr(mfmsr() | MSR_PMM); 343 350 pmc_start_ctrs(1); 344 351 } 345 352
+16
arch/powerpc/platforms/44x/Kconfig
··· 17 17 help 18 18 This option enables support for the IBM PPC440EP evaluation board. 19 19 20 + config BLUESTONE 21 + bool "Bluestone" 22 + depends on 44x 23 + default n 24 + select PPC44x_SIMPLE 25 + select APM821xx 26 + select IBM_NEW_EMAC_RGMII 27 + help 28 + This option enables support for the APM APM821xx Evaluation board. 29 + 20 30 config EBONY 21 31 bool "Ebony" 22 32 depends on 44x ··· 301 291 select IBM_NEW_EMAC_EMAC4 302 292 select IBM_NEW_EMAC_RGMII 303 293 select IBM_NEW_EMAC_ZMII 294 + select IBM_NEW_EMAC_TAH 295 + 296 + config APM821xx 297 + bool 298 + select PPC_FPU 299 + select IBM_NEW_EMAC_EMAC4 304 300 select IBM_NEW_EMAC_TAH 305 301 306 302 # 44x errata/workaround config symbols, selected by the CPU models above
+1
arch/powerpc/platforms/44x/ppc44x_simple.c
··· 52 52 static char *board[] __initdata = { 53 53 "amcc,arches", 54 54 "amcc,bamboo", 55 + "amcc,bluestone", 55 56 "amcc,canyonlands", 56 57 "amcc,glacier", 57 58 "ibm,ebony",
+2 -2
arch/powerpc/platforms/83xx/Kconfig
··· 10 10 if PPC_83xx 11 11 12 12 config MPC830x_RDB 13 - bool "Freescale MPC830x RDB" 13 + bool "Freescale MPC830x RDB and derivatives" 14 14 select DEFAULT_UIMAGE 15 15 select PPC_MPC831x 16 16 select FSL_GTM 17 17 help 18 - This option enables support for the MPC8308 RDB board. 18 + This option enables support for the MPC8308 RDB and MPC8308 P1M boards. 19 19 20 20 config MPC831x_RDB 21 21 bool "Freescale MPC831x RDB"
+2 -1
arch/powerpc/platforms/83xx/mpc830x_rdb.c
··· 65 65 unsigned long root = of_get_flat_dt_root(); 66 66 67 67 return of_flat_dt_is_compatible(root, "MPC8308RDB") || 68 - of_flat_dt_is_compatible(root, "fsl,mpc8308rdb"); 68 + of_flat_dt_is_compatible(root, "fsl,mpc8308rdb") || 69 + of_flat_dt_is_compatible(root, "denx,mpc8308_p1m"); 69 70 } 70 71 71 72 static struct of_device_id __initdata of_bus_ids[] = {
+27 -1
arch/powerpc/platforms/85xx/Kconfig
··· 11 11 12 12 if FSL_SOC_BOOKE 13 13 14 + if PPC32 15 + 14 16 config MPC8540_ADS 15 17 bool "Freescale MPC8540 ADS" 16 18 select DEFAULT_UIMAGE ··· 155 153 help 156 154 This option enables support for the Wind River SBC8560 board 157 155 156 + config P3041_DS 157 + bool "Freescale P3041 DS" 158 + select DEFAULT_UIMAGE 159 + select PPC_E500MC 160 + select PHYS_64BIT 161 + select SWIOTLB 162 + select MPC8xxx_GPIO 163 + select HAS_RAPIDIO 164 + help 165 + This option enables support for the P3041 DS board 166 + 158 167 config P4080_DS 159 168 bool "Freescale P4080 DS" 160 169 select DEFAULT_UIMAGE 161 - select PPC_FSL_BOOK3E 162 170 select PPC_E500MC 163 171 select PHYS_64BIT 164 172 select SWIOTLB ··· 176 164 select HAS_RAPIDIO 177 165 help 178 166 This option enables support for the P4080 DS board 167 + 168 + endif # PPC32 169 + 170 + config P5020_DS 171 + bool "Freescale P5020 DS" 172 + select DEFAULT_UIMAGE 173 + select E500 174 + select PPC_E500MC 175 + select PHYS_64BIT 176 + select SWIOTLB 177 + select MPC8xxx_GPIO 178 + select HAS_RAPIDIO 179 + help 180 + This option enables support for the P5020 DS board 179 181 180 182 endif # FSL_SOC_BOOKE 181 183
+2
arch/powerpc/platforms/85xx/Makefile
··· 11 11 obj-$(CONFIG_MPC85xx_MDS) += mpc85xx_mds.o 12 12 obj-$(CONFIG_MPC85xx_RDB) += mpc85xx_rdb.o 13 13 obj-$(CONFIG_P1022_DS) += p1022_ds.o 14 + obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o 14 15 obj-$(CONFIG_P4080_DS) += p4080_ds.o corenet_ds.o 16 + obj-$(CONFIG_P5020_DS) += p5020_ds.o corenet_ds.o 15 17 obj-$(CONFIG_STX_GP3) += stx_gp3.o 16 18 obj-$(CONFIG_TQM85xx) += tqm85xx.o 17 19 obj-$(CONFIG_SBC8560) += sbc8560.o
+2
arch/powerpc/platforms/85xx/p1022_ds.c
··· 112 112 { .compatible = "soc", }, 113 113 { .compatible = "simple-bus", }, 114 114 { .compatible = "gianfar", }, 115 + /* So that the DMA channel nodes can be probed individually: */ 116 + { .compatible = "fsl,eloplus-dma", }, 115 117 {}, 116 118 }; 117 119
+64
arch/powerpc/platforms/85xx/p3041_ds.c
··· 1 + /* 2 + * P3041 DS Setup 3 + * 4 + * Maintained by Kumar Gala (see MAINTAINERS for contact information) 5 + * 6 + * Copyright 2009-2010 Freescale Semiconductor Inc. 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + */ 13 + 14 + #include <linux/kernel.h> 15 + #include <linux/pci.h> 16 + #include <linux/kdev_t.h> 17 + #include <linux/delay.h> 18 + #include <linux/interrupt.h> 19 + #include <linux/phy.h> 20 + 21 + #include <asm/system.h> 22 + #include <asm/time.h> 23 + #include <asm/machdep.h> 24 + #include <asm/pci-bridge.h> 25 + #include <mm/mmu_decl.h> 26 + #include <asm/prom.h> 27 + #include <asm/udbg.h> 28 + #include <asm/mpic.h> 29 + 30 + #include <linux/of_platform.h> 31 + #include <sysdev/fsl_soc.h> 32 + #include <sysdev/fsl_pci.h> 33 + 34 + #include "corenet_ds.h" 35 + 36 + /* 37 + * Called very early, device-tree isn't unflattened 38 + */ 39 + static int __init p3041_ds_probe(void) 40 + { 41 + unsigned long root = of_get_flat_dt_root(); 42 + 43 + return of_flat_dt_is_compatible(root, "fsl,P3041DS"); 44 + } 45 + 46 + define_machine(p3041_ds) { 47 + .name = "P3041 DS", 48 + .probe = p3041_ds_probe, 49 + .setup_arch = corenet_ds_setup_arch, 50 + .init_IRQ = corenet_ds_pic_init, 51 + #ifdef CONFIG_PCI 52 + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 53 + #endif 54 + .get_irq = mpic_get_coreint_irq, 55 + .restart = fsl_rstcr_restart, 56 + .calibrate_decr = generic_calibrate_decr, 57 + .progress = udbg_progress, 58 + }; 59 + 60 + machine_device_initcall(p3041_ds, corenet_ds_publish_devices); 61 + 62 + #ifdef CONFIG_SWIOTLB 63 + machine_arch_initcall(p3041_ds, swiotlb_setup_bus_notifier); 64 + #endif
+69
arch/powerpc/platforms/85xx/p5020_ds.c
··· 1 + /* 2 + * P5020 DS Setup 3 + * 4 + * Maintained by Kumar Gala (see MAINTAINERS for contact information) 5 + * 6 + * Copyright 2009-2010 Freescale Semiconductor Inc. 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + */ 13 + 14 + #include <linux/kernel.h> 15 + #include <linux/pci.h> 16 + #include <linux/kdev_t.h> 17 + #include <linux/delay.h> 18 + #include <linux/interrupt.h> 19 + #include <linux/phy.h> 20 + 21 + #include <asm/system.h> 22 + #include <asm/time.h> 23 + #include <asm/machdep.h> 24 + #include <asm/pci-bridge.h> 25 + #include <mm/mmu_decl.h> 26 + #include <asm/prom.h> 27 + #include <asm/udbg.h> 28 + #include <asm/mpic.h> 29 + 30 + #include <linux/of_platform.h> 31 + #include <sysdev/fsl_soc.h> 32 + #include <sysdev/fsl_pci.h> 33 + 34 + #include "corenet_ds.h" 35 + 36 + /* 37 + * Called very early, device-tree isn't unflattened 38 + */ 39 + static int __init p5020_ds_probe(void) 40 + { 41 + unsigned long root = of_get_flat_dt_root(); 42 + 43 + return of_flat_dt_is_compatible(root, "fsl,P5020DS"); 44 + } 45 + 46 + define_machine(p5020_ds) { 47 + .name = "P5020 DS", 48 + .probe = p5020_ds_probe, 49 + .setup_arch = corenet_ds_setup_arch, 50 + .init_IRQ = corenet_ds_pic_init, 51 + #ifdef CONFIG_PCI 52 + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 53 + #endif 54 + /* coreint doesn't play nice with lazy EE, use legacy mpic for now */ 55 + #ifdef CONFIG_PPC64 56 + .get_irq = mpic_get_irq, 57 + #else 58 + .get_irq = mpic_get_coreint_irq, 59 + #endif 60 + .restart = fsl_rstcr_restart, 61 + .calibrate_decr = generic_calibrate_decr, 62 + .progress = udbg_progress, 63 + }; 64 + 65 + machine_device_initcall(p5020_ds, corenet_ds_publish_devices); 66 + 67 + #ifdef CONFIG_SWIOTLB 68 + machine_arch_initcall(p5020_ds, swiotlb_setup_bus_notifier); 69 + #endif
+68 -15
arch/powerpc/platforms/85xx/smp.c
··· 16 16 #include <linux/delay.h> 17 17 #include <linux/of.h> 18 18 #include <linux/kexec.h> 19 + #include <linux/highmem.h> 19 20 20 21 #include <asm/machdep.h> 21 22 #include <asm/pgtable.h> ··· 80 79 local_irq_save(flags); 81 80 82 81 out_be32(bptr_vaddr + BOOT_ENTRY_PIR, nr); 82 + #ifdef CONFIG_PPC32 83 83 out_be32(bptr_vaddr + BOOT_ENTRY_ADDR_LOWER, __pa(__early_start)); 84 84 85 85 if (!ioremappable) ··· 90 88 /* Wait a bit for the CPU to ack. */ 91 89 while ((__secondary_hold_acknowledge != nr) && (++n < 1000)) 92 90 mdelay(1); 91 + #else 92 + out_be64((u64 *)(bptr_vaddr + BOOT_ENTRY_ADDR_UPPER), 93 + __pa((u64)*((unsigned long long *) generic_secondary_smp_init))); 94 + 95 + smp_generic_kick_cpu(nr); 96 + #endif 93 97 94 98 local_irq_restore(flags); 95 99 ··· 122 114 }; 123 115 124 116 #ifdef CONFIG_KEXEC 125 - static int kexec_down_cpus = 0; 117 + atomic_t kexec_down_cpus = ATOMIC_INIT(0); 126 118 127 119 void mpc85xx_smp_kexec_cpu_down(int crash_shutdown, int secondary) 128 120 { 129 - mpic_teardown_this_cpu(1); 121 + local_irq_disable(); 130 122 131 - /* When crashing, this gets called on all CPU's we only 132 - * take down the non-boot cpus */ 133 - if (smp_processor_id() != boot_cpuid) 134 - { 135 - local_irq_disable(); 136 - kexec_down_cpus++; 137 - 123 + if (secondary) { 124 + atomic_inc(&kexec_down_cpus); 125 + /* loop forever */ 138 126 while (1); 139 127 } 140 128 } ··· 141 137 ppc_md.kexec_cpu_down(0,1); 142 138 } 143 139 144 - static void mpc85xx_smp_machine_kexec(struct kimage *image) 140 + static void map_and_flush(unsigned long paddr) 145 141 { 146 - int timeout = 2000; 142 + struct page *page = pfn_to_page(paddr >> PAGE_SHIFT); 143 + unsigned long kaddr = (unsigned long)kmap(page); 144 + 145 + flush_dcache_range(kaddr, kaddr + PAGE_SIZE); 146 + kunmap(page); 147 + } 148 + 149 + /** 150 + * Before we reset the other cores, we need to flush relevant cache 151 + * out to memory so we don't get anything corrupted, some of these flushes 152 + * are performed out of an overabundance of caution as interrupts are not 153 + * disabled yet and we can switch cores 154 + */ 155 + static void mpc85xx_smp_flush_dcache_kexec(struct kimage *image) 156 + { 157 + kimage_entry_t *ptr, entry; 158 + unsigned long paddr; 147 159 int i; 148 160 149 - set_cpus_allowed(current, cpumask_of_cpu(boot_cpuid)); 161 + if (image->type == KEXEC_TYPE_DEFAULT) { 162 + /* normal kexec images are stored in temporary pages */ 163 + for (ptr = &image->head; (entry = *ptr) && !(entry & IND_DONE); 164 + ptr = (entry & IND_INDIRECTION) ? 165 + phys_to_virt(entry & PAGE_MASK) : ptr + 1) { 166 + if (!(entry & IND_DESTINATION)) { 167 + map_and_flush(entry); 168 + } 169 + } 170 + /* flush out last IND_DONE page */ 171 + map_and_flush(entry); 172 + } else { 173 + /* crash type kexec images are copied to the crash region */ 174 + for (i = 0; i < image->nr_segments; i++) { 175 + struct kexec_segment *seg = &image->segment[i]; 176 + for (paddr = seg->mem; paddr < seg->mem + seg->memsz; 177 + paddr += PAGE_SIZE) { 178 + map_and_flush(paddr); 179 + } 180 + } 181 + } 150 182 151 - smp_call_function(mpc85xx_smp_kexec_down, NULL, 0); 183 + /* also flush the kimage struct to be passed in as well */ 184 + flush_dcache_range((unsigned long)image, 185 + (unsigned long)image + sizeof(*image)); 186 + } 152 187 153 - while ( (kexec_down_cpus != (num_online_cpus() - 1)) && 188 + static void mpc85xx_smp_machine_kexec(struct kimage *image) 189 + { 190 + int timeout = INT_MAX; 191 + int i, num_cpus = num_present_cpus(); 192 + 193 + mpc85xx_smp_flush_dcache_kexec(image); 194 + 195 + if (image->type == KEXEC_TYPE_DEFAULT) 196 + smp_call_function(mpc85xx_smp_kexec_down, NULL, 0); 197 + 198 + while ( (atomic_read(&kexec_down_cpus) != (num_cpus - 1)) && 154 199 ( timeout > 0 ) ) 155 200 { 156 201 timeout--; ··· 208 155 if ( !timeout ) 209 156 printk(KERN_ERR "Unable to bring down secondary cpu(s)"); 210 157 211 - for (i = 0; i < num_present_cpus(); i++) 158 + for (i = 0; i < num_cpus; i++) 212 159 { 213 160 if ( i == smp_processor_id() ) continue; 214 161 mpic_reset_core(i);
+7 -1
arch/powerpc/platforms/Kconfig.cputype
··· 125 125 126 126 config E500 127 127 select FSL_EMB_PERFMON 128 + select PPC_FSL_BOOK3E 128 129 bool 129 130 130 131 config PPC_E500MC ··· 167 166 168 167 config FSL_BOOKE 169 168 bool 170 - depends on E200 || E500 169 + depends on (E200 || E500) && PPC32 171 170 default y 172 171 172 + # this is for common code between PPC32 & PPC64 FSL BOOKE 173 + config PPC_FSL_BOOK3E 174 + bool 175 + select FSL_EMB_PERFMON 176 + default y if FSL_BOOKE 173 177 174 178 config PTE_64BIT 175 179 bool
+3 -1
arch/powerpc/platforms/cell/ras.c
··· 173 173 return -ENODEV; 174 174 175 175 size = of_get_property(np, "ibm,cbe-ptcal-size", NULL); 176 - if (!size) 176 + if (!size) { 177 + of_node_put(np); 177 178 return -ENODEV; 179 + } 178 180 179 181 pr_debug("%s: enabling PTCAL, size = 0x%x\n", __func__, *size); 180 182 order = get_order(*size);
+3 -1
arch/powerpc/platforms/cell/spider-pic.c
··· 258 258 return NO_IRQ; 259 259 imap += intsize + 1; 260 260 tmp = of_get_property(iic, "#interrupt-cells", NULL); 261 - if (tmp == NULL) 261 + if (tmp == NULL) { 262 + of_node_put(iic); 262 263 return NO_IRQ; 264 + } 263 265 intsize = *tmp; 264 266 /* Assume unit is last entry of interrupt specifier */ 265 267 unit = imap[intsize - 1];
+18
arch/powerpc/platforms/cell/spufs/file.c
··· 154 154 .release = spufs_attr_release, \ 155 155 .read = spufs_attr_read, \ 156 156 .write = spufs_attr_write, \ 157 + .llseek = generic_file_llseek, \ 157 158 }; 158 159 159 160 ··· 522 521 .release = spufs_cntl_release, 523 522 .read = simple_attr_read, 524 523 .write = simple_attr_write, 524 + .llseek = generic_file_llseek, 525 525 .mmap = spufs_cntl_mmap, 526 526 }; 527 527 ··· 716 714 static const struct file_operations spufs_mbox_fops = { 717 715 .open = spufs_pipe_open, 718 716 .read = spufs_mbox_read, 717 + .llseek = no_llseek, 719 718 }; 720 719 721 720 static ssize_t spufs_mbox_stat_read(struct file *file, char __user *buf, ··· 746 743 static const struct file_operations spufs_mbox_stat_fops = { 747 744 .open = spufs_pipe_open, 748 745 .read = spufs_mbox_stat_read, 746 + .llseek = no_llseek, 749 747 }; 750 748 751 749 /* low-level ibox access function */ ··· 867 863 .read = spufs_ibox_read, 868 864 .poll = spufs_ibox_poll, 869 865 .fasync = spufs_ibox_fasync, 866 + .llseek = no_llseek, 870 867 }; 871 868 872 869 static ssize_t spufs_ibox_stat_read(struct file *file, char __user *buf, ··· 895 890 static const struct file_operations spufs_ibox_stat_fops = { 896 891 .open = spufs_pipe_open, 897 892 .read = spufs_ibox_stat_read, 893 + .llseek = no_llseek, 898 894 }; 899 895 900 896 /* low-level mailbox write */ ··· 1017 1011 .write = spufs_wbox_write, 1018 1012 .poll = spufs_wbox_poll, 1019 1013 .fasync = spufs_wbox_fasync, 1014 + .llseek = no_llseek, 1020 1015 }; 1021 1016 1022 1017 static ssize_t spufs_wbox_stat_read(struct file *file, char __user *buf, ··· 1045 1038 static const struct file_operations spufs_wbox_stat_fops = { 1046 1039 .open = spufs_pipe_open, 1047 1040 .read = spufs_wbox_stat_read, 1041 + .llseek = no_llseek, 1048 1042 }; 1049 1043 1050 1044 static int spufs_signal1_open(struct inode *inode, struct file *file) ··· 1174 1166 .read = spufs_signal1_read, 1175 1167 .write = spufs_signal1_write, 1176 1168 .mmap = spufs_signal1_mmap, 1169 + .llseek = no_llseek, 1177 1170 }; 1178 1171 1179 1172 static const struct file_operations spufs_signal1_nosched_fops = { ··· 1182 1173 .release = spufs_signal1_release, 1183 1174 .write = spufs_signal1_write, 1184 1175 .mmap = spufs_signal1_mmap, 1176 + .llseek = no_llseek, 1185 1177 }; 1186 1178 1187 1179 static int spufs_signal2_open(struct inode *inode, struct file *file) ··· 1315 1305 .read = spufs_signal2_read, 1316 1306 .write = spufs_signal2_write, 1317 1307 .mmap = spufs_signal2_mmap, 1308 + .llseek = no_llseek, 1318 1309 }; 1319 1310 1320 1311 static const struct file_operations spufs_signal2_nosched_fops = { ··· 1323 1312 .release = spufs_signal2_release, 1324 1313 .write = spufs_signal2_write, 1325 1314 .mmap = spufs_signal2_mmap, 1315 + .llseek = no_llseek, 1326 1316 }; 1327 1317 1328 1318 /* ··· 1463 1451 .open = spufs_mss_open, 1464 1452 .release = spufs_mss_release, 1465 1453 .mmap = spufs_mss_mmap, 1454 + .llseek = no_llseek, 1466 1455 }; 1467 1456 1468 1457 static int ··· 1521 1508 .open = spufs_psmap_open, 1522 1509 .release = spufs_psmap_release, 1523 1510 .mmap = spufs_psmap_mmap, 1511 + .llseek = no_llseek, 1524 1512 }; 1525 1513 1526 1514 ··· 1885 1871 .fsync = spufs_mfc_fsync, 1886 1872 .fasync = spufs_mfc_fasync, 1887 1873 .mmap = spufs_mfc_mmap, 1874 + .llseek = no_llseek, 1888 1875 }; 1889 1876 1890 1877 static int spufs_npc_set(void *data, u64 val) ··· 2261 2246 static const struct file_operations spufs_dma_info_fops = { 2262 2247 .open = spufs_info_open, 2263 2248 .read = spufs_dma_info_read, 2249 + .llseek = no_llseek, 2264 2250 }; 2265 2251 2266 2252 static ssize_t __spufs_proxydma_info_read(struct spu_context *ctx, ··· 2315 2299 static const struct file_operations spufs_proxydma_info_fops = { 2316 2300 .open = spufs_info_open, 2317 2301 .read = spufs_proxydma_info_read, 2302 + .llseek = no_llseek, 2318 2303 }; 2319 2304 2320 2305 static int spufs_show_tid(struct seq_file *s, void *private) ··· 2602 2585 .read = spufs_switch_log_read, 2603 2586 .poll = spufs_switch_log_poll, 2604 2587 .release = spufs_switch_log_release, 2588 + .llseek = no_llseek, 2605 2589 }; 2606 2590 2607 2591 /**
+3 -1
arch/powerpc/platforms/chrp/nvram.c
··· 74 74 return; 75 75 76 76 nbytes_p = of_get_property(nvram, "#bytes", &proplen); 77 - if (nbytes_p == NULL || proplen != sizeof(unsigned int)) 77 + if (nbytes_p == NULL || proplen != sizeof(unsigned int)) { 78 + of_node_put(nvram); 78 79 return; 80 + } 79 81 80 82 nvram_size = *nbytes_p; 81 83
+1 -1
arch/powerpc/platforms/iseries/Makefile
··· 1 - EXTRA_CFLAGS += -mno-minimal-toc 1 + ccflags-y := -mno-minimal-toc 2 2 3 3 obj-y += exception.o 4 4 obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt.o mf.o lpevents.o \
+2 -2
arch/powerpc/platforms/iseries/dt.c
··· 243 243 pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE); 244 244 245 245 for (i = 0; i < NR_CPUS; i++) { 246 - if (lppaca[i].dyn_proc_status >= 2) 246 + if (lppaca_of(i).dyn_proc_status >= 2) 247 247 continue; 248 248 249 249 snprintf(p, 32 - (p - buf), "@%d", i); ··· 251 251 252 252 dt_prop_str(dt, "device_type", device_type_cpu); 253 253 254 - index = lppaca[i].dyn_hv_phys_proc_index; 254 + index = lppaca_of(i).dyn_hv_phys_proc_index; 255 255 d = &xIoHriProcessorVpd[index]; 256 256 257 257 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024);
+1 -1
arch/powerpc/platforms/iseries/smp.c
··· 91 91 BUG_ON((nr < 0) || (nr >= NR_CPUS)); 92 92 93 93 /* Verify that our partition has a processor nr */ 94 - if (lppaca[nr].dyn_proc_status >= 2) 94 + if (lppaca_of(nr).dyn_proc_status >= 2) 95 95 return; 96 96 97 97 /* The processor is currently spinning, waiting
+1
arch/powerpc/platforms/maple/setup.c
··· 358 358 model = (const unsigned char *)of_get_property(np, "model", NULL); 359 359 if (!model) { 360 360 printk(KERN_ERR "%s: Unabel to get model info\n", __func__); 361 + of_node_put(np); 361 362 return -ENODEV; 362 363 } 363 364
+6 -3
arch/powerpc/platforms/powermac/pfunc_core.c
··· 837 837 return NULL; 838 838 find_it: 839 839 dev = pmf_find_device(actor); 840 - if (dev == NULL) 841 - return NULL; 840 + if (dev == NULL) { 841 + result = NULL; 842 + goto out; 843 + } 842 844 843 845 list_for_each_entry(func, &dev->functions, link) { 844 846 if (name && strcmp(name, func->name)) ··· 852 850 result = func; 853 851 break; 854 852 } 855 - of_node_put(actor); 856 853 pmf_put_device(dev); 854 + out: 855 + of_node_put(actor); 857 856 return result; 858 857 } 859 858
+4 -9
arch/powerpc/platforms/pseries/Makefile
··· 1 - ifeq ($(CONFIG_PPC64),y) 2 - EXTRA_CFLAGS += -mno-minimal-toc 3 - endif 4 - 5 - ifeq ($(CONFIG_PPC_PSERIES_DEBUG),y) 6 - EXTRA_CFLAGS += -DDEBUG 7 - endif 1 + ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 2 + ccflags-$(CONFIG_PPC_PSERIES_DEBUG) += -DDEBUG 8 3 9 4 obj-y := lpar.o hvCall.o nvram.o reconfig.o \ 10 5 setup.o iommu.o event_sources.o ras.o \ 11 - firmware.o power.o dlpar.o 6 + firmware.o power.o dlpar.o mobility.o 12 7 obj-$(CONFIG_SMP) += smp.o 13 8 obj-$(CONFIG_XICS) += xics.o 14 9 obj-$(CONFIG_SCANLOG) += scanlog.o ··· 18 23 obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o 19 24 obj-$(CONFIG_HVCS) += hvcserver.o 20 25 obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o 21 - obj-$(CONFIG_PHYP_DUMP) += phyp_dump.o 26 + obj-$(CONFIG_PHYP_DUMP) += phyp_dump.o 22 27 obj-$(CONFIG_CMM) += cmm.o 23 28 obj-$(CONFIG_DTL) += dtl.o 24 29
+3 -4
arch/powerpc/platforms/pseries/dlpar.c
··· 33 33 u32 prop_offset; 34 34 }; 35 35 36 - static void dlpar_free_cc_property(struct property *prop) 36 + void dlpar_free_cc_property(struct property *prop) 37 37 { 38 38 kfree(prop->name); 39 39 kfree(prop->value); ··· 55 55 56 56 prop->length = ccwa->prop_length; 57 57 value = (char *)ccwa + ccwa->prop_offset; 58 - prop->value = kzalloc(prop->length, GFP_KERNEL); 58 + prop->value = kmemdup(value, prop->length, GFP_KERNEL); 59 59 if (!prop->value) { 60 60 dlpar_free_cc_property(prop); 61 61 return NULL; 62 62 } 63 63 64 - memcpy(prop->value, value, prop->length); 65 64 return prop; 66 65 } 67 66 ··· 101 102 kfree(dn); 102 103 } 103 104 104 - static void dlpar_free_cc_nodes(struct device_node *dn) 105 + void dlpar_free_cc_nodes(struct device_node *dn) 105 106 { 106 107 if (dn->child) 107 108 dlpar_free_cc_nodes(dn->child);
+170 -56
arch/powerpc/platforms/pseries/dtl.c
··· 23 23 #include <linux/init.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/debugfs.h> 26 + #include <linux/spinlock.h> 26 27 #include <asm/smp.h> 27 28 #include <asm/system.h> 28 29 #include <asm/uaccess.h> 29 30 #include <asm/firmware.h> 31 + #include <asm/lppaca.h> 30 32 31 33 #include "plpar_wrappers.h" 32 - 33 - /* 34 - * Layout of entries in the hypervisor's DTL buffer. Although we don't 35 - * actually access the internals of an entry (we only need to know the size), 36 - * we might as well define it here for reference. 37 - */ 38 - struct dtl_entry { 39 - u8 dispatch_reason; 40 - u8 preempt_reason; 41 - u16 processor_id; 42 - u32 enqueue_to_dispatch_time; 43 - u32 ready_to_enqueue_time; 44 - u32 waiting_to_ready_time; 45 - u64 timebase; 46 - u64 fault_addr; 47 - u64 srr0; 48 - u64 srr1; 49 - }; 50 34 51 35 struct dtl { 52 36 struct dtl_entry *buf; ··· 38 54 int cpu; 39 55 int buf_entries; 40 56 u64 last_idx; 57 + spinlock_t lock; 41 58 }; 42 59 static DEFINE_PER_CPU(struct dtl, cpu_dtl); 43 60 ··· 57 72 static int dtl_buf_entries = (16 * 85); 58 73 59 74 60 - static int dtl_enable(struct dtl *dtl) 75 + #ifdef CONFIG_VIRT_CPU_ACCOUNTING 76 + struct dtl_ring { 77 + u64 write_index; 78 + struct dtl_entry *write_ptr; 79 + struct dtl_entry *buf; 80 + struct dtl_entry *buf_end; 81 + u8 saved_dtl_mask; 82 + }; 83 + 84 + static DEFINE_PER_CPU(struct dtl_ring, dtl_rings); 85 + 86 + static atomic_t dtl_count; 87 + 88 + /* 89 + * The cpu accounting code controls the DTL ring buffer, and we get 90 + * given entries as they are processed. 91 + */ 92 + static void consume_dtle(struct dtl_entry *dtle, u64 index) 93 + { 94 + struct dtl_ring *dtlr = &__get_cpu_var(dtl_rings); 95 + struct dtl_entry *wp = dtlr->write_ptr; 96 + struct lppaca *vpa = local_paca->lppaca_ptr; 97 + 98 + if (!wp) 99 + return; 100 + 101 + *wp = *dtle; 102 + barrier(); 103 + 104 + /* check for hypervisor ring buffer overflow, ignore this entry if so */ 105 + if (index + N_DISPATCH_LOG < vpa->dtl_idx) 106 + return; 107 + 108 + ++wp; 109 + if (wp == dtlr->buf_end) 110 + wp = dtlr->buf; 111 + dtlr->write_ptr = wp; 112 + 113 + /* incrementing write_index makes the new entry visible */ 114 + smp_wmb(); 115 + ++dtlr->write_index; 116 + } 117 + 118 + static int dtl_start(struct dtl *dtl) 119 + { 120 + struct dtl_ring *dtlr = &per_cpu(dtl_rings, dtl->cpu); 121 + 122 + dtlr->buf = dtl->buf; 123 + dtlr->buf_end = dtl->buf + dtl->buf_entries; 124 + dtlr->write_index = 0; 125 + 126 + /* setting write_ptr enables logging into our buffer */ 127 + smp_wmb(); 128 + dtlr->write_ptr = dtl->buf; 129 + 130 + /* enable event logging */ 131 + dtlr->saved_dtl_mask = lppaca_of(dtl->cpu).dtl_enable_mask; 132 + lppaca_of(dtl->cpu).dtl_enable_mask |= dtl_event_mask; 133 + 134 + dtl_consumer = consume_dtle; 135 + atomic_inc(&dtl_count); 136 + return 0; 137 + } 138 + 139 + static void dtl_stop(struct dtl *dtl) 140 + { 141 + struct dtl_ring *dtlr = &per_cpu(dtl_rings, dtl->cpu); 142 + 143 + dtlr->write_ptr = NULL; 144 + smp_wmb(); 145 + 146 + dtlr->buf = NULL; 147 + 148 + /* restore dtl_enable_mask */ 149 + lppaca_of(dtl->cpu).dtl_enable_mask = dtlr->saved_dtl_mask; 150 + 151 + if (atomic_dec_and_test(&dtl_count)) 152 + dtl_consumer = NULL; 153 + } 154 + 155 + static u64 dtl_current_index(struct dtl *dtl) 156 + { 157 + return per_cpu(dtl_rings, dtl->cpu).write_index; 158 + } 159 + 160 + #else /* CONFIG_VIRT_CPU_ACCOUNTING */ 161 + 162 + static int dtl_start(struct dtl *dtl) 61 163 { 62 164 unsigned long addr; 63 165 int ret, hwcpu; 64 - 65 - /* only allow one reader */ 66 - if (dtl->buf) 67 - return -EBUSY; 68 - 69 - /* we need to store the original allocation size for use during read */ 70 - dtl->buf_entries = dtl_buf_entries; 71 - 72 - dtl->buf = kmalloc_node(dtl->buf_entries * sizeof(struct dtl_entry), 73 - GFP_KERNEL, cpu_to_node(dtl->cpu)); 74 - if (!dtl->buf) { 75 - printk(KERN_WARNING "%s: buffer alloc failed for cpu %d\n", 76 - __func__, dtl->cpu); 77 - return -ENOMEM; 78 - } 79 166 80 167 /* Register our dtl buffer with the hypervisor. The HV expects the 81 168 * buffer size to be passed in the second word of the buffer */ ··· 159 102 if (ret) { 160 103 printk(KERN_WARNING "%s: DTL registration for cpu %d (hw %d) " 161 104 "failed with %d\n", __func__, dtl->cpu, hwcpu, ret); 162 - kfree(dtl->buf); 163 105 return -EIO; 164 106 } 165 107 166 108 /* set our initial buffer indices */ 167 - dtl->last_idx = lppaca[dtl->cpu].dtl_idx = 0; 109 + lppaca_of(dtl->cpu).dtl_idx = 0; 168 110 169 111 /* ensure that our updates to the lppaca fields have occurred before 170 112 * we actually enable the logging */ 171 113 smp_wmb(); 172 114 173 115 /* enable event logging */ 174 - lppaca[dtl->cpu].dtl_enable_mask = dtl_event_mask; 116 + lppaca_of(dtl->cpu).dtl_enable_mask = dtl_event_mask; 175 117 176 118 return 0; 177 119 } 178 120 179 - static void dtl_disable(struct dtl *dtl) 121 + static void dtl_stop(struct dtl *dtl) 180 122 { 181 123 int hwcpu = get_hard_smp_processor_id(dtl->cpu); 182 124 183 - lppaca[dtl->cpu].dtl_enable_mask = 0x0; 125 + lppaca_of(dtl->cpu).dtl_enable_mask = 0x0; 184 126 185 127 unregister_dtl(hwcpu, __pa(dtl->buf)); 128 + } 186 129 130 + static u64 dtl_current_index(struct dtl *dtl) 131 + { 132 + return lppaca_of(dtl->cpu).dtl_idx; 133 + } 134 + #endif /* CONFIG_VIRT_CPU_ACCOUNTING */ 135 + 136 + static int dtl_enable(struct dtl *dtl) 137 + { 138 + long int n_entries; 139 + long int rc; 140 + struct dtl_entry *buf = NULL; 141 + 142 + /* only allow one reader */ 143 + if (dtl->buf) 144 + return -EBUSY; 145 + 146 + n_entries = dtl_buf_entries; 147 + buf = kmalloc_node(n_entries * sizeof(struct dtl_entry), 148 + GFP_KERNEL, cpu_to_node(dtl->cpu)); 149 + if (!buf) { 150 + printk(KERN_WARNING "%s: buffer alloc failed for cpu %d\n", 151 + __func__, dtl->cpu); 152 + return -ENOMEM; 153 + } 154 + 155 + spin_lock(&dtl->lock); 156 + rc = -EBUSY; 157 + if (!dtl->buf) { 158 + /* store the original allocation size for use during read */ 159 + dtl->buf_entries = n_entries; 160 + dtl->buf = buf; 161 + dtl->last_idx = 0; 162 + rc = dtl_start(dtl); 163 + if (rc) 164 + dtl->buf = NULL; 165 + } 166 + spin_unlock(&dtl->lock); 167 + 168 + if (rc) 169 + kfree(buf); 170 + return rc; 171 + } 172 + 173 + static void dtl_disable(struct dtl *dtl) 174 + { 175 + spin_lock(&dtl->lock); 176 + dtl_stop(dtl); 187 177 kfree(dtl->buf); 188 178 dtl->buf = NULL; 189 179 dtl->buf_entries = 0; 180 + spin_unlock(&dtl->lock); 190 181 } 191 182 192 183 /* file interface */ ··· 262 157 static ssize_t dtl_file_read(struct file *filp, char __user *buf, size_t len, 263 158 loff_t *pos) 264 159 { 265 - int rc, cur_idx, last_idx, n_read, n_req, read_size; 160 + long int rc, n_read, n_req, read_size; 266 161 struct dtl *dtl; 162 + u64 cur_idx, last_idx, i; 267 163 268 164 if ((len % sizeof(struct dtl_entry)) != 0) 269 165 return -EINVAL; ··· 277 171 /* actual number of entries read */ 278 172 n_read = 0; 279 173 280 - cur_idx = lppaca[dtl->cpu].dtl_idx; 174 + spin_lock(&dtl->lock); 175 + 176 + cur_idx = dtl_current_index(dtl); 281 177 last_idx = dtl->last_idx; 282 178 283 - if (cur_idx - last_idx > dtl->buf_entries) { 284 - pr_debug("%s: hv buffer overflow for cpu %d, samples lost\n", 285 - __func__, dtl->cpu); 286 - } 179 + if (last_idx + dtl->buf_entries <= cur_idx) 180 + last_idx = cur_idx - dtl->buf_entries + 1; 287 181 288 - cur_idx %= dtl->buf_entries; 289 - last_idx %= dtl->buf_entries; 182 + if (last_idx + n_req > cur_idx) 183 + n_req = cur_idx - last_idx; 184 + 185 + if (n_req > 0) 186 + dtl->last_idx = last_idx + n_req; 187 + 188 + spin_unlock(&dtl->lock); 189 + 190 + if (n_req <= 0) 191 + return 0; 192 + 193 + i = last_idx % dtl->buf_entries; 290 194 291 195 /* read the tail of the buffer if we've wrapped */ 292 - if (last_idx > cur_idx) { 293 - read_size = min(n_req, dtl->buf_entries - last_idx); 196 + if (i + n_req > dtl->buf_entries) { 197 + read_size = dtl->buf_entries - i; 294 198 295 - rc = copy_to_user(buf, &dtl->buf[last_idx], 199 + rc = copy_to_user(buf, &dtl->buf[i], 296 200 read_size * sizeof(struct dtl_entry)); 297 201 if (rc) 298 202 return -EFAULT; 299 203 300 - last_idx = 0; 204 + i = 0; 301 205 n_req -= read_size; 302 206 n_read += read_size; 303 207 buf += read_size * sizeof(struct dtl_entry); 304 208 } 305 209 306 210 /* .. and now the head */ 307 - read_size = min(n_req, cur_idx - last_idx); 308 - rc = copy_to_user(buf, &dtl->buf[last_idx], 309 - read_size * sizeof(struct dtl_entry)); 211 + rc = copy_to_user(buf, &dtl->buf[i], n_req * sizeof(struct dtl_entry)); 310 212 if (rc) 311 213 return -EFAULT; 312 214 313 - n_read += read_size; 314 - dtl->last_idx += n_read; 215 + n_read += n_req; 315 216 316 217 return n_read * sizeof(struct dtl_entry); 317 218 } ··· 376 263 /* set up the per-cpu log structures */ 377 264 for_each_possible_cpu(i) { 378 265 struct dtl *dtl = &per_cpu(cpu_dtl, i); 266 + spin_lock_init(&dtl->lock); 379 267 dtl->cpu = i; 380 268 381 269 rc = dtl_setup_file(dtl);
+23 -2
arch/powerpc/platforms/pseries/lpar.c
··· 248 248 int hwcpu = get_hard_smp_processor_id(cpu); 249 249 unsigned long addr; 250 250 long ret; 251 + struct paca_struct *pp; 252 + struct dtl_entry *dtl; 251 253 252 254 if (cpu_has_feature(CPU_FTR_ALTIVEC)) 253 - lppaca[cpu].vmxregs_in_use = 1; 255 + lppaca_of(cpu).vmxregs_in_use = 1; 254 256 255 - addr = __pa(&lppaca[cpu]); 257 + addr = __pa(&lppaca_of(cpu)); 256 258 ret = register_vpa(hwcpu, addr); 257 259 258 260 if (ret) { ··· 275 273 "WARNING: vpa_init: SLB shadow buffer " 276 274 "registration for cpu %d (hw %d) of area %lx " 277 275 "returns %ld\n", cpu, hwcpu, addr, ret); 276 + } 277 + 278 + /* 279 + * Register dispatch trace log, if one has been allocated. 280 + */ 281 + pp = &paca[cpu]; 282 + dtl = pp->dispatch_log; 283 + if (dtl) { 284 + pp->dtl_ridx = 0; 285 + pp->dtl_curr = dtl; 286 + lppaca_of(cpu).dtl_idx = 0; 287 + 288 + /* hypervisor reads buffer length from this field */ 289 + dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES; 290 + ret = register_dtl(hwcpu, __pa(dtl)); 291 + if (ret) 292 + pr_warn("DTL registration failed for cpu %d (%ld)\n", 293 + cpu, ret); 294 + lppaca_of(cpu).dtl_enable_mask = 2; 278 295 } 279 296 } 280 297
+362
arch/powerpc/platforms/pseries/mobility.c
··· 1 + /* 2 + * Support for Partition Mobility/Migration 3 + * 4 + * Copyright (C) 2010 Nathan Fontenot 5 + * Copyright (C) 2010 IBM Corporation 6 + * 7 + * This program is free software; you can redistribute it and/or 8 + * modify it under the terms of the GNU General Public License version 9 + * 2 as published by the Free Software Foundation. 10 + */ 11 + 12 + #include <linux/kernel.h> 13 + #include <linux/kobject.h> 14 + #include <linux/smp.h> 15 + #include <linux/completion.h> 16 + #include <linux/device.h> 17 + #include <linux/delay.h> 18 + #include <linux/slab.h> 19 + 20 + #include <asm/rtas.h> 21 + #include "pseries.h" 22 + 23 + static struct kobject *mobility_kobj; 24 + 25 + struct update_props_workarea { 26 + u32 phandle; 27 + u32 state; 28 + u64 reserved; 29 + u32 nprops; 30 + }; 31 + 32 + #define NODE_ACTION_MASK 0xff000000 33 + #define NODE_COUNT_MASK 0x00ffffff 34 + 35 + #define DELETE_DT_NODE 0x01000000 36 + #define UPDATE_DT_NODE 0x02000000 37 + #define ADD_DT_NODE 0x03000000 38 + 39 + static int mobility_rtas_call(int token, char *buf) 40 + { 41 + int rc; 42 + 43 + spin_lock(&rtas_data_buf_lock); 44 + 45 + memcpy(rtas_data_buf, buf, RTAS_DATA_BUF_SIZE); 46 + rc = rtas_call(token, 2, 1, NULL, rtas_data_buf, 1); 47 + memcpy(buf, rtas_data_buf, RTAS_DATA_BUF_SIZE); 48 + 49 + spin_unlock(&rtas_data_buf_lock); 50 + return rc; 51 + } 52 + 53 + static int delete_dt_node(u32 phandle) 54 + { 55 + struct device_node *dn; 56 + 57 + dn = of_find_node_by_phandle(phandle); 58 + if (!dn) 59 + return -ENOENT; 60 + 61 + dlpar_detach_node(dn); 62 + return 0; 63 + } 64 + 65 + static int update_dt_property(struct device_node *dn, struct property **prop, 66 + const char *name, u32 vd, char *value) 67 + { 68 + struct property *new_prop = *prop; 69 + struct property *old_prop; 70 + int more = 0; 71 + 72 + /* A negative 'vd' value indicates that only part of the new property 73 + * value is contained in the buffer and we need to call 74 + * ibm,update-properties again to get the rest of the value. 75 + * 76 + * A negative value is also the two's compliment of the actual value. 77 + */ 78 + if (vd & 0x80000000) { 79 + vd = ~vd + 1; 80 + more = 1; 81 + } 82 + 83 + if (new_prop) { 84 + /* partial property fixup */ 85 + char *new_data = kzalloc(new_prop->length + vd, GFP_KERNEL); 86 + if (!new_data) 87 + return -ENOMEM; 88 + 89 + memcpy(new_data, new_prop->value, new_prop->length); 90 + memcpy(new_data + new_prop->length, value, vd); 91 + 92 + kfree(new_prop->value); 93 + new_prop->value = new_data; 94 + new_prop->length += vd; 95 + } else { 96 + new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); 97 + if (!new_prop) 98 + return -ENOMEM; 99 + 100 + new_prop->name = kstrdup(name, GFP_KERNEL); 101 + if (!new_prop->name) { 102 + kfree(new_prop); 103 + return -ENOMEM; 104 + } 105 + 106 + new_prop->length = vd; 107 + new_prop->value = kzalloc(new_prop->length, GFP_KERNEL); 108 + if (!new_prop->value) { 109 + kfree(new_prop->name); 110 + kfree(new_prop); 111 + return -ENOMEM; 112 + } 113 + 114 + memcpy(new_prop->value, value, vd); 115 + *prop = new_prop; 116 + } 117 + 118 + if (!more) { 119 + old_prop = of_find_property(dn, new_prop->name, NULL); 120 + if (old_prop) 121 + prom_update_property(dn, new_prop, old_prop); 122 + else 123 + prom_add_property(dn, new_prop); 124 + 125 + new_prop = NULL; 126 + } 127 + 128 + return 0; 129 + } 130 + 131 + static int update_dt_node(u32 phandle) 132 + { 133 + struct update_props_workarea *upwa; 134 + struct device_node *dn; 135 + struct property *prop = NULL; 136 + int i, rc; 137 + char *prop_data; 138 + char *rtas_buf; 139 + int update_properties_token; 140 + 141 + update_properties_token = rtas_token("ibm,update-properties"); 142 + if (update_properties_token == RTAS_UNKNOWN_SERVICE) 143 + return -EINVAL; 144 + 145 + rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); 146 + if (!rtas_buf) 147 + return -ENOMEM; 148 + 149 + dn = of_find_node_by_phandle(phandle); 150 + if (!dn) { 151 + kfree(rtas_buf); 152 + return -ENOENT; 153 + } 154 + 155 + upwa = (struct update_props_workarea *)&rtas_buf[0]; 156 + upwa->phandle = phandle; 157 + 158 + do { 159 + rc = mobility_rtas_call(update_properties_token, rtas_buf); 160 + if (rc < 0) 161 + break; 162 + 163 + prop_data = rtas_buf + sizeof(*upwa); 164 + 165 + for (i = 0; i < upwa->nprops; i++) { 166 + char *prop_name; 167 + u32 vd; 168 + 169 + prop_name = prop_data + 1; 170 + prop_data += strlen(prop_name) + 1; 171 + vd = *prop_data++; 172 + 173 + switch (vd) { 174 + case 0x00000000: 175 + /* name only property, nothing to do */ 176 + break; 177 + 178 + case 0x80000000: 179 + prop = of_find_property(dn, prop_name, NULL); 180 + prom_remove_property(dn, prop); 181 + prop = NULL; 182 + break; 183 + 184 + default: 185 + rc = update_dt_property(dn, &prop, prop_name, 186 + vd, prop_data); 187 + if (rc) { 188 + printk(KERN_ERR "Could not update %s" 189 + " property\n", prop_name); 190 + } 191 + 192 + prop_data += vd; 193 + } 194 + } 195 + } while (rc == 1); 196 + 197 + of_node_put(dn); 198 + kfree(rtas_buf); 199 + return 0; 200 + } 201 + 202 + static int add_dt_node(u32 parent_phandle, u32 drc_index) 203 + { 204 + struct device_node *dn; 205 + struct device_node *parent_dn; 206 + int rc; 207 + 208 + dn = dlpar_configure_connector(drc_index); 209 + if (!dn) 210 + return -ENOENT; 211 + 212 + parent_dn = of_find_node_by_phandle(parent_phandle); 213 + if (!parent_dn) { 214 + dlpar_free_cc_nodes(dn); 215 + return -ENOENT; 216 + } 217 + 218 + dn->parent = parent_dn; 219 + rc = dlpar_attach_node(dn); 220 + if (rc) 221 + dlpar_free_cc_nodes(dn); 222 + 223 + of_node_put(parent_dn); 224 + return rc; 225 + } 226 + 227 + static int pseries_devicetree_update(void) 228 + { 229 + char *rtas_buf; 230 + u32 *data; 231 + int update_nodes_token; 232 + int rc; 233 + 234 + update_nodes_token = rtas_token("ibm,update-nodes"); 235 + if (update_nodes_token == RTAS_UNKNOWN_SERVICE) 236 + return -EINVAL; 237 + 238 + rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); 239 + if (!rtas_buf) 240 + return -ENOMEM; 241 + 242 + do { 243 + rc = mobility_rtas_call(update_nodes_token, rtas_buf); 244 + if (rc && rc != 1) 245 + break; 246 + 247 + data = (u32 *)rtas_buf + 4; 248 + while (*data & NODE_ACTION_MASK) { 249 + int i; 250 + u32 action = *data & NODE_ACTION_MASK; 251 + int node_count = *data & NODE_COUNT_MASK; 252 + 253 + data++; 254 + 255 + for (i = 0; i < node_count; i++) { 256 + u32 phandle = *data++; 257 + u32 drc_index; 258 + 259 + switch (action) { 260 + case DELETE_DT_NODE: 261 + delete_dt_node(phandle); 262 + break; 263 + case UPDATE_DT_NODE: 264 + update_dt_node(phandle); 265 + break; 266 + case ADD_DT_NODE: 267 + drc_index = *data++; 268 + add_dt_node(phandle, drc_index); 269 + break; 270 + } 271 + } 272 + } 273 + } while (rc == 1); 274 + 275 + kfree(rtas_buf); 276 + return rc; 277 + } 278 + 279 + void post_mobility_fixup(void) 280 + { 281 + int rc; 282 + int activate_fw_token; 283 + 284 + rc = pseries_devicetree_update(); 285 + if (rc) { 286 + printk(KERN_ERR "Initial post-mobility device tree update " 287 + "failed: %d\n", rc); 288 + return; 289 + } 290 + 291 + activate_fw_token = rtas_token("ibm,activate-firmware"); 292 + if (activate_fw_token == RTAS_UNKNOWN_SERVICE) { 293 + printk(KERN_ERR "Could not make post-mobility " 294 + "activate-fw call.\n"); 295 + return; 296 + } 297 + 298 + rc = rtas_call(activate_fw_token, 0, 1, NULL); 299 + if (!rc) { 300 + rc = pseries_devicetree_update(); 301 + if (rc) 302 + printk(KERN_ERR "Secondary post-mobility device tree " 303 + "update failed: %d\n", rc); 304 + } else { 305 + printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc); 306 + return; 307 + } 308 + 309 + return; 310 + } 311 + 312 + static ssize_t migrate_store(struct class *class, struct class_attribute *attr, 313 + const char *buf, size_t count) 314 + { 315 + struct rtas_args args; 316 + u64 streamid; 317 + int rc; 318 + 319 + rc = strict_strtoull(buf, 0, &streamid); 320 + if (rc) 321 + return rc; 322 + 323 + memset(&args, 0, sizeof(args)); 324 + args.token = rtas_token("ibm,suspend-me"); 325 + args.nargs = 2; 326 + args.nret = 1; 327 + 328 + args.args[0] = streamid >> 32 ; 329 + args.args[1] = streamid & 0xffffffff; 330 + args.rets = &args.args[args.nargs]; 331 + 332 + do { 333 + args.rets[0] = 0; 334 + rc = rtas_ibm_suspend_me(&args); 335 + if (!rc && args.rets[0] == RTAS_NOT_SUSPENDABLE) 336 + ssleep(1); 337 + } while (!rc && args.rets[0] == RTAS_NOT_SUSPENDABLE); 338 + 339 + if (rc) 340 + return rc; 341 + else if (args.rets[0]) 342 + return args.rets[0]; 343 + 344 + post_mobility_fixup(); 345 + return count; 346 + } 347 + 348 + static CLASS_ATTR(migration, S_IWUSR, NULL, migrate_store); 349 + 350 + static int __init mobility_sysfs_init(void) 351 + { 352 + int rc; 353 + 354 + mobility_kobj = kobject_create_and_add("mobility", kernel_kobj); 355 + if (!mobility_kobj) 356 + return -ENOMEM; 357 + 358 + rc = sysfs_create_file(mobility_kobj, &class_attr_migration.attr); 359 + 360 + return rc; 361 + } 362 + device_initcall(mobility_sysfs_init);
+9
arch/powerpc/platforms/pseries/pseries.h
··· 17 17 extern void request_event_sources_irqs(struct device_node *np, 18 18 irq_handler_t handler, const char *name); 19 19 20 + #include <linux/of.h> 21 + 20 22 extern void __init fw_feature_init(const char *hypertas, unsigned long len); 21 23 22 24 struct pt_regs; ··· 48 46 extern unsigned long rtas_poweron_auto; 49 47 50 48 extern void find_udbg_vterm(void); 49 + 50 + /* Dynamic logical Partitioning/Mobility */ 51 + extern void dlpar_free_cc_nodes(struct device_node *); 52 + extern void dlpar_free_cc_property(struct property *); 53 + extern struct device_node *dlpar_configure_connector(u32); 54 + extern int dlpar_attach_node(struct device_node *); 55 + extern int dlpar_detach_node(struct device_node *); 51 56 52 57 #endif /* _PSERIES_PSERIES_H */
+52
arch/powerpc/platforms/pseries/setup.c
··· 273 273 .notifier_call = pci_dn_reconfig_notifier, 274 274 }; 275 275 276 + #ifdef CONFIG_VIRT_CPU_ACCOUNTING 277 + /* 278 + * Allocate space for the dispatch trace log for all possible cpus 279 + * and register the buffers with the hypervisor. This is used for 280 + * computing time stolen by the hypervisor. 281 + */ 282 + static int alloc_dispatch_logs(void) 283 + { 284 + int cpu, ret; 285 + struct paca_struct *pp; 286 + struct dtl_entry *dtl; 287 + 288 + if (!firmware_has_feature(FW_FEATURE_SPLPAR)) 289 + return 0; 290 + 291 + for_each_possible_cpu(cpu) { 292 + pp = &paca[cpu]; 293 + dtl = kmalloc_node(DISPATCH_LOG_BYTES, GFP_KERNEL, 294 + cpu_to_node(cpu)); 295 + if (!dtl) { 296 + pr_warn("Failed to allocate dispatch trace log for cpu %d\n", 297 + cpu); 298 + pr_warn("Stolen time statistics will be unreliable\n"); 299 + break; 300 + } 301 + 302 + pp->dtl_ridx = 0; 303 + pp->dispatch_log = dtl; 304 + pp->dispatch_log_end = dtl + N_DISPATCH_LOG; 305 + pp->dtl_curr = dtl; 306 + } 307 + 308 + /* Register the DTL for the current (boot) cpu */ 309 + dtl = get_paca()->dispatch_log; 310 + get_paca()->dtl_ridx = 0; 311 + get_paca()->dtl_curr = dtl; 312 + get_paca()->lppaca_ptr->dtl_idx = 0; 313 + 314 + /* hypervisor reads buffer length from this field */ 315 + dtl->enqueue_to_dispatch_time = DISPATCH_LOG_BYTES; 316 + ret = register_dtl(hard_smp_processor_id(), __pa(dtl)); 317 + if (ret) 318 + pr_warn("DTL registration failed for boot cpu %d (%d)\n", 319 + smp_processor_id(), ret); 320 + get_paca()->lppaca_ptr->dtl_enable_mask = 2; 321 + 322 + return 0; 323 + } 324 + 325 + early_initcall(alloc_dispatch_logs); 326 + #endif /* CONFIG_VIRT_CPU_ACCOUNTING */ 327 + 276 328 static void __init pSeries_setup_arch(void) 277 329 { 278 330 /* Discover PIC type and setup ppc_md accordingly */
+1 -1
arch/powerpc/platforms/pseries/xics.c
··· 178 178 if (!distribute_irqs) 179 179 return default_server; 180 180 181 - if (!cpumask_equal(cpumask, cpu_all_mask)) { 181 + if (!cpumask_subset(cpu_possible_mask, cpumask)) { 182 182 int server = cpumask_first_and(cpu_online_mask, cpumask); 183 183 184 184 if (server < nr_cpu_ids)
+2 -3
arch/powerpc/sysdev/Makefile
··· 1 1 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror 2 2 3 - ifeq ($(CONFIG_PPC64),y) 4 - EXTRA_CFLAGS += -mno-minimal-toc 5 - endif 3 + ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 6 4 7 5 mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o 8 6 obj-$(CONFIG_MPIC) += mpic.o $(mpic-msi-obj-y) ··· 18 20 obj-$(CONFIG_FSL_LBC) += fsl_lbc.o 19 21 obj-$(CONFIG_FSL_GTM) += fsl_gtm.o 20 22 obj-$(CONFIG_MPC8xxx_GPIO) += mpc8xxx_gpio.o 23 + obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o 21 24 obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o 22 25 obj-$(CONFIG_RAPIDIO) += fsl_rio.o 23 26 obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
+64 -10
arch/powerpc/sysdev/dart_iommu.c
··· 70 70 static int dart_dirty; 71 71 static int dart_is_u4; 72 72 73 + #define DART_U4_BYPASS_BASE 0x8000000000ull 74 + 73 75 #define DBG(...) 74 76 75 77 static inline void dart_tlb_invalidate_all(void) ··· 294 292 set_bit(iommu_table_dart.it_size - 1, iommu_table_dart.it_map); 295 293 } 296 294 297 - static void pci_dma_dev_setup_dart(struct pci_dev *dev) 295 + static void dma_dev_setup_dart(struct device *dev) 298 296 { 299 297 /* We only have one iommu table on the mac for now, which makes 300 298 * things simple. Setup all PCI devices to point to this table 301 299 */ 302 - set_iommu_table_base(&dev->dev, &iommu_table_dart); 300 + if (get_dma_ops(dev) == &dma_direct_ops) 301 + set_dma_offset(dev, DART_U4_BYPASS_BASE); 302 + else 303 + set_iommu_table_base(dev, &iommu_table_dart); 304 + } 305 + 306 + static void pci_dma_dev_setup_dart(struct pci_dev *dev) 307 + { 308 + dma_dev_setup_dart(&dev->dev); 303 309 } 304 310 305 311 static void pci_dma_bus_setup_dart(struct pci_bus *bus) ··· 325 315 PCI_DN(dn)->iommu_table = &iommu_table_dart; 326 316 } 327 317 318 + static bool dart_device_on_pcie(struct device *dev) 319 + { 320 + struct device_node *np = of_node_get(dev->of_node); 321 + 322 + while(np) { 323 + if (of_device_is_compatible(np, "U4-pcie") || 324 + of_device_is_compatible(np, "u4-pcie")) { 325 + of_node_put(np); 326 + return true; 327 + } 328 + np = of_get_next_parent(np); 329 + } 330 + return false; 331 + } 332 + 333 + static int dart_dma_set_mask(struct device *dev, u64 dma_mask) 334 + { 335 + if (!dev->dma_mask || !dma_supported(dev, dma_mask)) 336 + return -EIO; 337 + 338 + /* U4 supports a DART bypass, we use it for 64-bit capable 339 + * devices to improve performances. However, that only works 340 + * for devices connected to U4 own PCIe interface, not bridged 341 + * through hypertransport. We need the device to support at 342 + * least 40 bits of addresses. 343 + */ 344 + if (dart_device_on_pcie(dev) && dma_mask >= DMA_BIT_MASK(40)) { 345 + dev_info(dev, "Using 64-bit DMA iommu bypass\n"); 346 + set_dma_ops(dev, &dma_direct_ops); 347 + } else { 348 + dev_info(dev, "Using 32-bit DMA via iommu\n"); 349 + set_dma_ops(dev, &dma_iommu_ops); 350 + } 351 + dma_dev_setup_dart(dev); 352 + 353 + *dev->dma_mask = dma_mask; 354 + return 0; 355 + } 356 + 328 357 void __init iommu_init_early_dart(void) 329 358 { 330 359 struct device_node *dn; ··· 377 328 dart_is_u4 = 1; 378 329 } 379 330 331 + /* Initialize the DART HW */ 332 + if (dart_init(dn) != 0) 333 + goto bail; 334 + 380 335 /* Setup low level TCE operations for the core IOMMU code */ 381 336 ppc_md.tce_build = dart_build; 382 337 ppc_md.tce_free = dart_free; 383 338 ppc_md.tce_flush = dart_flush; 384 339 385 - /* Initialize the DART HW */ 386 - if (dart_init(dn) == 0) { 387 - ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_dart; 388 - ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_dart; 340 + /* Setup bypass if supported */ 341 + if (dart_is_u4) 342 + ppc_md.dma_set_mask = dart_dma_set_mask; 389 343 390 - /* Setup pci_dma ops */ 391 - set_pci_dma_ops(&dma_iommu_ops); 392 - return; 393 - } 344 + ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_dart; 345 + ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_dart; 346 + 347 + /* Setup pci_dma ops */ 348 + set_pci_dma_ops(&dma_iommu_ops); 349 + return; 394 350 395 351 bail: 396 352 /* If init failed, use direct iommu and null setup functions */
+101
arch/powerpc/sysdev/fsl_85xx_cache_ctlr.h
··· 1 + /* 2 + * Copyright 2009-2010 Freescale Semiconductor, Inc 3 + * 4 + * QorIQ based Cache Controller Memory Mapped Registers 5 + * 6 + * Author: Vivek Mahajan <vivek.mahajan@freescale.com> 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + * You should have received a copy of the GNU General Public License 19 + * along with this program; if not, write to the Free Software 20 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 + */ 22 + 23 + #ifndef __FSL_85XX_CACHE_CTLR_H__ 24 + #define __FSL_85XX_CACHE_CTLR_H__ 25 + 26 + #define L2CR_L2FI 0x40000000 /* L2 flash invalidate */ 27 + #define L2CR_L2IO 0x00200000 /* L2 instruction only */ 28 + #define L2CR_SRAM_ZERO 0x00000000 /* L2SRAM zero size */ 29 + #define L2CR_SRAM_FULL 0x00010000 /* L2SRAM full size */ 30 + #define L2CR_SRAM_HALF 0x00020000 /* L2SRAM half size */ 31 + #define L2CR_SRAM_TWO_HALFS 0x00030000 /* L2SRAM two half sizes */ 32 + #define L2CR_SRAM_QUART 0x00040000 /* L2SRAM one quarter size */ 33 + #define L2CR_SRAM_TWO_QUARTS 0x00050000 /* L2SRAM two quarter size */ 34 + #define L2CR_SRAM_EIGHTH 0x00060000 /* L2SRAM one eighth size */ 35 + #define L2CR_SRAM_TWO_EIGHTH 0x00070000 /* L2SRAM two eighth size */ 36 + 37 + #define L2SRAM_OPTIMAL_SZ_SHIFT 0x00000003 /* Optimum size for L2SRAM */ 38 + 39 + #define L2SRAM_BAR_MSK_LO18 0xFFFFC000 /* Lower 18 bits */ 40 + #define L2SRAM_BARE_MSK_HI4 0x0000000F /* Upper 4 bits */ 41 + 42 + enum cache_sram_lock_ways { 43 + LOCK_WAYS_ZERO, 44 + LOCK_WAYS_EIGHTH, 45 + LOCK_WAYS_TWO_EIGHTH, 46 + LOCK_WAYS_HALF = 4, 47 + LOCK_WAYS_FULL = 8, 48 + }; 49 + 50 + struct mpc85xx_l2ctlr { 51 + u32 ctl; /* 0x000 - L2 control */ 52 + u8 res1[0xC]; 53 + u32 ewar0; /* 0x010 - External write address 0 */ 54 + u32 ewarea0; /* 0x014 - External write address extended 0 */ 55 + u32 ewcr0; /* 0x018 - External write ctrl */ 56 + u8 res2[4]; 57 + u32 ewar1; /* 0x020 - External write address 1 */ 58 + u32 ewarea1; /* 0x024 - External write address extended 1 */ 59 + u32 ewcr1; /* 0x028 - External write ctrl 1 */ 60 + u8 res3[4]; 61 + u32 ewar2; /* 0x030 - External write address 2 */ 62 + u32 ewarea2; /* 0x034 - External write address extended 2 */ 63 + u32 ewcr2; /* 0x038 - External write ctrl 2 */ 64 + u8 res4[4]; 65 + u32 ewar3; /* 0x040 - External write address 3 */ 66 + u32 ewarea3; /* 0x044 - External write address extended 3 */ 67 + u32 ewcr3; /* 0x048 - External write ctrl 3 */ 68 + u8 res5[0xB4]; 69 + u32 srbar0; /* 0x100 - SRAM base address 0 */ 70 + u32 srbarea0; /* 0x104 - SRAM base addr reg ext address 0 */ 71 + u32 srbar1; /* 0x108 - SRAM base address 1 */ 72 + u32 srbarea1; /* 0x10C - SRAM base addr reg ext address 1 */ 73 + u8 res6[0xCF0]; 74 + u32 errinjhi; /* 0xE00 - Error injection mask high */ 75 + u32 errinjlo; /* 0xE04 - Error injection mask low */ 76 + u32 errinjctl; /* 0xE08 - Error injection tag/ecc control */ 77 + u8 res7[0x14]; 78 + u32 captdatahi; /* 0xE20 - Error data high capture */ 79 + u32 captdatalo; /* 0xE24 - Error data low capture */ 80 + u32 captecc; /* 0xE28 - Error syndrome */ 81 + u8 res8[0x14]; 82 + u32 errdet; /* 0xE40 - Error detect */ 83 + u32 errdis; /* 0xE44 - Error disable */ 84 + u32 errinten; /* 0xE48 - Error interrupt enable */ 85 + u32 errattr; /* 0xE4c - Error attribute capture */ 86 + u32 erradrrl; /* 0xE50 - Error address capture low */ 87 + u32 erradrrh; /* 0xE54 - Error address capture high */ 88 + u32 errctl; /* 0xE58 - Error control */ 89 + u8 res9[0x1A4]; 90 + }; 91 + 92 + struct sram_parameters { 93 + unsigned int sram_size; 94 + uint64_t sram_offset; 95 + }; 96 + 97 + extern int instantiate_cache_sram(struct platform_device *dev, 98 + struct sram_parameters sram_params); 99 + extern void remove_cache_sram(struct platform_device *dev); 100 + 101 + #endif /* __FSL_85XX_CACHE_CTLR_H__ */
+159
arch/powerpc/sysdev/fsl_85xx_cache_sram.c
··· 1 + /* 2 + * Copyright 2009-2010 Freescale Semiconductor, Inc. 3 + * 4 + * Simple memory allocator abstraction for QorIQ (P1/P2) based Cache-SRAM 5 + * 6 + * Author: Vivek Mahajan <vivek.mahajan@freescale.com> 7 + * 8 + * This file is derived from the original work done 9 + * by Sylvain Munaut for the Bestcomm SRAM allocator. 10 + * 11 + * This program is free software; you can redistribute it and/or modify it 12 + * under the terms of the GNU General Public License as published by the 13 + * Free Software Foundation; either version 2 of the License, or (at your 14 + * option) any later version. 15 + * 16 + * This program is distributed in the hope that it will be useful, 17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 + * GNU General Public License for more details. 20 + * 21 + * You should have received a copy of the GNU General Public License 22 + * along with this program; if not, write to the Free Software 23 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 24 + */ 25 + 26 + #include <linux/kernel.h> 27 + #include <linux/slab.h> 28 + #include <linux/err.h> 29 + #include <linux/of_platform.h> 30 + #include <asm/pgtable.h> 31 + #include <asm/fsl_85xx_cache_sram.h> 32 + 33 + #include "fsl_85xx_cache_ctlr.h" 34 + 35 + struct mpc85xx_cache_sram *cache_sram; 36 + 37 + void *mpc85xx_cache_sram_alloc(unsigned int size, 38 + phys_addr_t *phys, unsigned int align) 39 + { 40 + unsigned long offset; 41 + unsigned long flags; 42 + 43 + if (unlikely(cache_sram == NULL)) 44 + return NULL; 45 + 46 + if (!size || (size > cache_sram->size) || (align > cache_sram->size)) { 47 + pr_err("%s(): size(=%x) or align(=%x) zero or too big\n", 48 + __func__, size, align); 49 + return NULL; 50 + } 51 + 52 + if ((align & (align - 1)) || align <= 1) { 53 + pr_err("%s(): align(=%x) must be power of two and >1\n", 54 + __func__, align); 55 + return NULL; 56 + } 57 + 58 + spin_lock_irqsave(&cache_sram->lock, flags); 59 + offset = rh_alloc_align(cache_sram->rh, size, align, NULL); 60 + spin_unlock_irqrestore(&cache_sram->lock, flags); 61 + 62 + if (IS_ERR_VALUE(offset)) 63 + return NULL; 64 + 65 + *phys = cache_sram->base_phys + offset; 66 + 67 + return (unsigned char *)cache_sram->base_virt + offset; 68 + } 69 + EXPORT_SYMBOL(mpc85xx_cache_sram_alloc); 70 + 71 + void mpc85xx_cache_sram_free(void *ptr) 72 + { 73 + unsigned long flags; 74 + BUG_ON(!ptr); 75 + 76 + spin_lock_irqsave(&cache_sram->lock, flags); 77 + rh_free(cache_sram->rh, ptr - cache_sram->base_virt); 78 + spin_unlock_irqrestore(&cache_sram->lock, flags); 79 + } 80 + EXPORT_SYMBOL(mpc85xx_cache_sram_free); 81 + 82 + int __init instantiate_cache_sram(struct platform_device *dev, 83 + struct sram_parameters sram_params) 84 + { 85 + int ret = 0; 86 + 87 + if (cache_sram) { 88 + dev_err(&dev->dev, "Already initialized cache-sram\n"); 89 + return -EBUSY; 90 + } 91 + 92 + cache_sram = kzalloc(sizeof(struct mpc85xx_cache_sram), GFP_KERNEL); 93 + if (!cache_sram) { 94 + dev_err(&dev->dev, "Out of memory for cache_sram structure\n"); 95 + return -ENOMEM; 96 + } 97 + 98 + cache_sram->base_phys = sram_params.sram_offset; 99 + cache_sram->size = sram_params.sram_size; 100 + 101 + if (!request_mem_region(cache_sram->base_phys, cache_sram->size, 102 + "fsl_85xx_cache_sram")) { 103 + dev_err(&dev->dev, "%s: request memory failed\n", 104 + dev->dev.of_node->full_name); 105 + ret = -ENXIO; 106 + goto out_free; 107 + } 108 + 109 + cache_sram->base_virt = ioremap_flags(cache_sram->base_phys, 110 + cache_sram->size, _PAGE_COHERENT | PAGE_KERNEL); 111 + if (!cache_sram->base_virt) { 112 + dev_err(&dev->dev, "%s: ioremap_flags failed\n", 113 + dev->dev.of_node->full_name); 114 + ret = -ENOMEM; 115 + goto out_release; 116 + } 117 + 118 + cache_sram->rh = rh_create(sizeof(unsigned int)); 119 + if (IS_ERR(cache_sram->rh)) { 120 + dev_err(&dev->dev, "%s: Unable to create remote heap\n", 121 + dev->dev.of_node->full_name); 122 + ret = PTR_ERR(cache_sram->rh); 123 + goto out_unmap; 124 + } 125 + 126 + rh_attach_region(cache_sram->rh, 0, cache_sram->size); 127 + spin_lock_init(&cache_sram->lock); 128 + 129 + dev_info(&dev->dev, "[base:0x%llx, size:0x%x] configured and loaded\n", 130 + (unsigned long long)cache_sram->base_phys, cache_sram->size); 131 + 132 + return 0; 133 + 134 + out_unmap: 135 + iounmap(cache_sram->base_virt); 136 + 137 + out_release: 138 + release_mem_region(cache_sram->base_phys, cache_sram->size); 139 + 140 + out_free: 141 + kfree(cache_sram); 142 + return ret; 143 + } 144 + 145 + void remove_cache_sram(struct platform_device *dev) 146 + { 147 + BUG_ON(!cache_sram); 148 + 149 + rh_detach_region(cache_sram->rh, 0, cache_sram->size); 150 + rh_destroy(cache_sram->rh); 151 + 152 + iounmap(cache_sram->base_virt); 153 + release_mem_region(cache_sram->base_phys, cache_sram->size); 154 + 155 + kfree(cache_sram); 156 + cache_sram = NULL; 157 + 158 + dev_info(&dev->dev, "MPC85xx Cache-SRAM driver unloaded\n"); 159 + }
+231
arch/powerpc/sysdev/fsl_85xx_l2ctlr.c
··· 1 + /* 2 + * Copyright 2009-2010 Freescale Semiconductor, Inc. 3 + * 4 + * QorIQ (P1/P2) L2 controller init for Cache-SRAM instantiation 5 + * 6 + * Author: Vivek Mahajan <vivek.mahajan@freescale.com> 7 + * 8 + * This program is free software; you can redistribute it and/or modify it 9 + * under the terms of the GNU General Public License as published by the 10 + * Free Software Foundation; either version 2 of the License, or (at your 11 + * option) any later version. 12 + * 13 + * This program is distributed in the hope that it will be useful, 14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 + * GNU General Public License for more details. 17 + * 18 + * You should have received a copy of the GNU General Public License 19 + * along with this program; if not, write to the Free Software 20 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 + */ 22 + 23 + #include <linux/kernel.h> 24 + #include <linux/of_platform.h> 25 + #include <asm/io.h> 26 + 27 + #include "fsl_85xx_cache_ctlr.h" 28 + 29 + static char *sram_size; 30 + static char *sram_offset; 31 + struct mpc85xx_l2ctlr __iomem *l2ctlr; 32 + 33 + static long get_cache_sram_size(void) 34 + { 35 + unsigned long val; 36 + 37 + if (!sram_size || (strict_strtoul(sram_size, 0, &val) < 0)) 38 + return -EINVAL; 39 + 40 + return val; 41 + } 42 + 43 + static long get_cache_sram_offset(void) 44 + { 45 + unsigned long val; 46 + 47 + if (!sram_offset || (strict_strtoul(sram_offset, 0, &val) < 0)) 48 + return -EINVAL; 49 + 50 + return val; 51 + } 52 + 53 + static int __init get_size_from_cmdline(char *str) 54 + { 55 + if (!str) 56 + return 0; 57 + 58 + sram_size = str; 59 + return 1; 60 + } 61 + 62 + static int __init get_offset_from_cmdline(char *str) 63 + { 64 + if (!str) 65 + return 0; 66 + 67 + sram_offset = str; 68 + return 1; 69 + } 70 + 71 + __setup("cache-sram-size=", get_size_from_cmdline); 72 + __setup("cache-sram-offset=", get_offset_from_cmdline); 73 + 74 + static int __devinit mpc85xx_l2ctlr_of_probe(struct platform_device *dev, 75 + const struct of_device_id *match) 76 + { 77 + long rval; 78 + unsigned int rem; 79 + unsigned char ways; 80 + const unsigned int *prop; 81 + unsigned int l2cache_size; 82 + struct sram_parameters sram_params; 83 + 84 + if (!dev->dev.of_node) { 85 + dev_err(&dev->dev, "Device's OF-node is NULL\n"); 86 + return -EINVAL; 87 + } 88 + 89 + prop = of_get_property(dev->dev.of_node, "cache-size", NULL); 90 + if (!prop) { 91 + dev_err(&dev->dev, "Missing L2 cache-size\n"); 92 + return -EINVAL; 93 + } 94 + l2cache_size = *prop; 95 + 96 + sram_params.sram_size = get_cache_sram_size(); 97 + if (sram_params.sram_size <= 0) { 98 + dev_err(&dev->dev, 99 + "Entire L2 as cache, Aborting Cache-SRAM stuff\n"); 100 + return -EINVAL; 101 + } 102 + 103 + sram_params.sram_offset = get_cache_sram_offset(); 104 + if (sram_params.sram_offset <= 0) { 105 + dev_err(&dev->dev, 106 + "Entire L2 as cache, provide a valid sram offset\n"); 107 + return -EINVAL; 108 + } 109 + 110 + 111 + rem = l2cache_size % sram_params.sram_size; 112 + ways = LOCK_WAYS_FULL * sram_params.sram_size / l2cache_size; 113 + if (rem || (ways & (ways - 1))) { 114 + dev_err(&dev->dev, "Illegal cache-sram-size in command line\n"); 115 + return -EINVAL; 116 + } 117 + 118 + l2ctlr = of_iomap(dev->dev.of_node, 0); 119 + if (!l2ctlr) { 120 + dev_err(&dev->dev, "Can't map L2 controller\n"); 121 + return -EINVAL; 122 + } 123 + 124 + /* 125 + * Write bits[0-17] to srbar0 126 + */ 127 + out_be32(&l2ctlr->srbar0, 128 + sram_params.sram_offset & L2SRAM_BAR_MSK_LO18); 129 + 130 + /* 131 + * Write bits[18-21] to srbare0 132 + */ 133 + #ifdef CONFIG_PHYS_64BIT 134 + out_be32(&l2ctlr->srbarea0, 135 + (sram_params.sram_offset >> 32) & L2SRAM_BARE_MSK_HI4); 136 + #endif 137 + 138 + clrsetbits_be32(&l2ctlr->ctl, L2CR_L2E, L2CR_L2FI); 139 + 140 + switch (ways) { 141 + case LOCK_WAYS_EIGHTH: 142 + setbits32(&l2ctlr->ctl, 143 + L2CR_L2E | L2CR_L2FI | L2CR_SRAM_EIGHTH); 144 + break; 145 + 146 + case LOCK_WAYS_TWO_EIGHTH: 147 + setbits32(&l2ctlr->ctl, 148 + L2CR_L2E | L2CR_L2FI | L2CR_SRAM_QUART); 149 + break; 150 + 151 + case LOCK_WAYS_HALF: 152 + setbits32(&l2ctlr->ctl, 153 + L2CR_L2E | L2CR_L2FI | L2CR_SRAM_HALF); 154 + break; 155 + 156 + case LOCK_WAYS_FULL: 157 + default: 158 + setbits32(&l2ctlr->ctl, 159 + L2CR_L2E | L2CR_L2FI | L2CR_SRAM_FULL); 160 + break; 161 + } 162 + eieio(); 163 + 164 + rval = instantiate_cache_sram(dev, sram_params); 165 + if (rval < 0) { 166 + dev_err(&dev->dev, "Can't instantiate Cache-SRAM\n"); 167 + iounmap(l2ctlr); 168 + return -EINVAL; 169 + } 170 + 171 + return 0; 172 + } 173 + 174 + static int __devexit mpc85xx_l2ctlr_of_remove(struct platform_device *dev) 175 + { 176 + BUG_ON(!l2ctlr); 177 + 178 + iounmap(l2ctlr); 179 + remove_cache_sram(dev); 180 + dev_info(&dev->dev, "MPC85xx L2 controller unloaded\n"); 181 + 182 + return 0; 183 + } 184 + 185 + static struct of_device_id mpc85xx_l2ctlr_of_match[] = { 186 + { 187 + .compatible = "fsl,p2020-l2-cache-controller", 188 + }, 189 + { 190 + .compatible = "fsl,p2010-l2-cache-controller", 191 + }, 192 + { 193 + .compatible = "fsl,p1020-l2-cache-controller", 194 + }, 195 + { 196 + .compatible = "fsl,p1011-l2-cache-controller", 197 + }, 198 + { 199 + .compatible = "fsl,p1013-l2-cache-controller", 200 + }, 201 + { 202 + .compatible = "fsl,p1022-l2-cache-controller", 203 + }, 204 + {}, 205 + }; 206 + 207 + static struct of_platform_driver mpc85xx_l2ctlr_of_platform_driver = { 208 + .driver = { 209 + .name = "fsl-l2ctlr", 210 + .owner = THIS_MODULE, 211 + .of_match_table = mpc85xx_l2ctlr_of_match, 212 + }, 213 + .probe = mpc85xx_l2ctlr_of_probe, 214 + .remove = __devexit_p(mpc85xx_l2ctlr_of_remove), 215 + }; 216 + 217 + static __init int mpc85xx_l2ctlr_of_init(void) 218 + { 219 + return of_register_platform_driver(&mpc85xx_l2ctlr_of_platform_driver); 220 + } 221 + 222 + static void __exit mpc85xx_l2ctlr_of_exit(void) 223 + { 224 + of_unregister_platform_driver(&mpc85xx_l2ctlr_of_platform_driver); 225 + } 226 + 227 + subsys_initcall(mpc85xx_l2ctlr_of_init); 228 + module_exit(mpc85xx_l2ctlr_of_exit); 229 + 230 + MODULE_DESCRIPTION("Freescale MPC85xx L2 controller init"); 231 + MODULE_LICENSE("GPL v2");
+4 -5
arch/powerpc/sysdev/fsl_msi.c
··· 24 24 #include <asm/ppc-pci.h> 25 25 #include <asm/mpic.h> 26 26 #include "fsl_msi.h" 27 + #include "fsl_pci.h" 27 28 28 29 LIST_HEAD(msi_head); 29 30 ··· 126 125 { 127 126 struct fsl_msi *msi_data = fsl_msi_data; 128 127 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 129 - u32 base = 0; 128 + u64 base = fsl_pci_immrbar_base(hose); 130 129 131 - pci_bus_read_config_dword(hose->bus, 132 - PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base); 130 + msg->address_lo = msi_data->msi_addr_lo + lower_32_bits(base); 131 + msg->address_hi = msi_data->msi_addr_hi + upper_32_bits(base); 133 132 134 - msg->address_lo = msi_data->msi_addr_lo + base; 135 - msg->address_hi = msi_data->msi_addr_hi; 136 133 msg->data = hwirq; 137 134 138 135 pr_debug("%s: allocated srs: %d, ibs: %d\n",
+58 -2
arch/powerpc/sysdev/fsl_pci.c
··· 1 1 /* 2 2 * MPC83xx/85xx/86xx PCI/PCIE support routing. 3 3 * 4 - * Copyright 2007-2009 Freescale Semiconductor, Inc. 4 + * Copyright 2007-2010 Freescale Semiconductor, Inc. 5 5 * Copyright 2008-2009 MontaVista Software, Inc. 6 6 * 7 7 * Initial author: Xianghua Xiao <x.xiao@freescale.com> ··· 34 34 #include <sysdev/fsl_soc.h> 35 35 #include <sysdev/fsl_pci.h> 36 36 37 - static int fsl_pcie_bus_fixup; 37 + static int fsl_pcie_bus_fixup, is_mpc83xx_pci; 38 38 39 39 static void __init quirk_fsl_pcie_header(struct pci_dev *dev) 40 40 { ··· 407 407 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2010, quirk_fsl_pcie_header); 408 408 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020E, quirk_fsl_pcie_header); 409 409 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2020, quirk_fsl_pcie_header); 410 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2040E, quirk_fsl_pcie_header); 411 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P2040, quirk_fsl_pcie_header); 412 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P3041E, quirk_fsl_pcie_header); 413 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P3041, quirk_fsl_pcie_header); 410 414 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4040E, quirk_fsl_pcie_header); 411 415 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4040, quirk_fsl_pcie_header); 412 416 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4080E, quirk_fsl_pcie_header); 413 417 DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P4080, quirk_fsl_pcie_header); 418 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P5010E, quirk_fsl_pcie_header); 419 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P5010, quirk_fsl_pcie_header); 420 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P5020E, quirk_fsl_pcie_header); 421 + DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_P5020, quirk_fsl_pcie_header); 414 422 #endif /* CONFIG_FSL_SOC_BOOKE || CONFIG_PPC_86xx */ 415 423 416 424 #if defined(CONFIG_PPC_83xx) || defined(CONFIG_PPC_MPC512x) ··· 438 430 u32 dev_base; 439 431 }; 440 432 433 + struct pex_inbound_window { 434 + u32 ar; 435 + u32 tar; 436 + u32 barl; 437 + u32 barh; 438 + }; 439 + 441 440 /* 442 441 * With the convention of u-boot, the PCIE outbound window 0 serves 443 442 * as configuration transactions outbound. ··· 452 437 #define PEX_OUTWIN0_BAR 0xCA4 453 438 #define PEX_OUTWIN0_TAL 0xCA8 454 439 #define PEX_OUTWIN0_TAH 0xCAC 440 + #define PEX_RC_INWIN_BASE 0xE60 441 + #define PEX_RCIWARn_EN 0x1 455 442 456 443 static int mpc83xx_pcie_exclude_device(struct pci_bus *bus, unsigned int devfn) 457 444 { ··· 621 604 const int *bus_range; 622 605 int primary; 623 606 607 + is_mpc83xx_pci = 1; 608 + 624 609 if (!of_device_is_available(dev)) { 625 610 pr_warning("%s: disabled by the firmware.\n", 626 611 dev->full_name); ··· 702 683 return ret; 703 684 } 704 685 #endif /* CONFIG_PPC_83xx */ 686 + 687 + u64 fsl_pci_immrbar_base(struct pci_controller *hose) 688 + { 689 + #ifdef CONFIG_PPC_83xx 690 + if (is_mpc83xx_pci) { 691 + struct mpc83xx_pcie_priv *pcie = hose->dn->data; 692 + struct pex_inbound_window *in; 693 + int i; 694 + 695 + /* Walk the Root Complex Inbound windows to match IMMR base */ 696 + in = pcie->cfg_type0 + PEX_RC_INWIN_BASE; 697 + for (i = 0; i < 4; i++) { 698 + /* not enabled, skip */ 699 + if (!in_le32(&in[i].ar) & PEX_RCIWARn_EN) 700 + continue; 701 + 702 + if (get_immrbase() == in_le32(&in[i].tar)) 703 + return (u64)in_le32(&in[i].barh) << 32 | 704 + in_le32(&in[i].barl); 705 + } 706 + 707 + printk(KERN_WARNING "could not find PCI BAR matching IMMR\n"); 708 + } 709 + #endif 710 + 711 + #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) 712 + if (!is_mpc83xx_pci) { 713 + u32 base; 714 + 715 + pci_bus_read_config_dword(hose->bus, 716 + PCI_DEVFN(0, 0), PCI_BASE_ADDRESS_0, &base); 717 + return base; 718 + } 719 + #endif 720 + 721 + return 0; 722 + }
+1
arch/powerpc/sysdev/fsl_pci.h
··· 88 88 extern int fsl_add_bridge(struct device_node *dev, int is_primary); 89 89 extern void fsl_pcibios_fixup_bus(struct pci_bus *bus); 90 90 extern int mpc83xx_add_bridge(struct device_node *dev); 91 + u64 fsl_pci_immrbar_base(struct pci_controller *hose); 91 92 92 93 #endif /* __POWERPC_FSL_PCI_H */ 93 94 #endif /* __KERNEL__ */
+40 -25
arch/powerpc/sysdev/fsl_rio.c
··· 117 117 }; 118 118 119 119 struct rio_msg_regs { 120 - u32 omr; 121 - u32 osr; 120 + u32 omr; /* 0xD_3000 - Outbound message 0 mode register */ 121 + u32 osr; /* 0xD_3004 - Outbound message 0 status register */ 122 122 u32 pad1; 123 - u32 odqdpar; 123 + u32 odqdpar; /* 0xD_300C - Outbound message 0 descriptor queue 124 + dequeue pointer address register */ 124 125 u32 pad2; 125 - u32 osar; 126 - u32 odpr; 127 - u32 odatr; 128 - u32 odcr; 126 + u32 osar; /* 0xD_3014 - Outbound message 0 source address 127 + register */ 128 + u32 odpr; /* 0xD_3018 - Outbound message 0 destination port 129 + register */ 130 + u32 odatr; /* 0xD_301C - Outbound message 0 destination attributes 131 + Register*/ 132 + u32 odcr; /* 0xD_3020 - Outbound message 0 double-word count 133 + register */ 129 134 u32 pad3; 130 - u32 odqepar; 135 + u32 odqepar; /* 0xD_3028 - Outbound message 0 descriptor queue 136 + enqueue pointer address register */ 131 137 u32 pad4[13]; 132 - u32 imr; 133 - u32 isr; 138 + u32 imr; /* 0xD_3060 - Inbound message 0 mode register */ 139 + u32 isr; /* 0xD_3064 - Inbound message 0 status register */ 134 140 u32 pad5; 135 - u32 ifqdpar; 141 + u32 ifqdpar; /* 0xD_306C - Inbound message 0 frame queue dequeue 142 + pointer address register*/ 136 143 u32 pad6; 137 - u32 ifqepar; 144 + u32 ifqepar; /* 0xD_3074 - Inbound message 0 frame queue enqueue 145 + pointer address register */ 138 146 u32 pad7[226]; 139 - u32 odmr; 140 - u32 odsr; 147 + u32 odmr; /* 0xD_3400 - Outbound doorbell mode register */ 148 + u32 odsr; /* 0xD_3404 - Outbound doorbell status register */ 141 149 u32 res0[4]; 142 - u32 oddpr; 143 - u32 oddatr; 150 + u32 oddpr; /* 0xD_3418 - Outbound doorbell destination port 151 + register */ 152 + u32 oddatr; /* 0xD_341c - Outbound doorbell destination attributes 153 + register */ 144 154 u32 res1[3]; 145 - u32 odretcr; 155 + u32 odretcr; /* 0xD_342C - Outbound doorbell retry error threshold 156 + configuration register */ 146 157 u32 res2[12]; 147 - u32 dmr; 148 - u32 dsr; 158 + u32 dmr; /* 0xD_3460 - Inbound doorbell mode register */ 159 + u32 dsr; /* 0xD_3464 - Inbound doorbell status register */ 149 160 u32 pad8; 150 - u32 dqdpar; 161 + u32 dqdpar; /* 0xD_346C - Inbound doorbell queue dequeue Pointer 162 + address register */ 151 163 u32 pad9; 152 - u32 dqepar; 164 + u32 dqepar; /* 0xD_3474 - Inbound doorbell Queue enqueue pointer 165 + address register */ 153 166 u32 pad10[26]; 154 - u32 pwmr; 155 - u32 pwsr; 156 - u32 epwqbar; 157 - u32 pwqbar; 167 + u32 pwmr; /* 0xD_34E0 - Inbound port-write mode register */ 168 + u32 pwsr; /* 0xD_34E4 - Inbound port-write status register */ 169 + u32 epwqbar; /* 0xD_34E8 - Extended Port-Write Queue Base Address 170 + register */ 171 + u32 pwqbar; /* 0xD_34EC - Inbound port-write queue base address 172 + register */ 158 173 }; 159 174 160 175 struct rio_tx_desc {
+13 -7
arch/powerpc/sysdev/fsl_soc.c
··· 378 378 static int __init setup_rstcr(void) 379 379 { 380 380 struct device_node *np; 381 - np = of_find_node_by_name(NULL, "global-utilities"); 382 - if ((np && of_get_property(np, "fsl,has-rstcr", NULL))) { 383 - rstcr = of_iomap(np, 0) + 0xb0; 384 - if (!rstcr) 385 - printk (KERN_EMERG "Error: reset control register " 386 - "not mapped!\n"); 387 - } else if (ppc_md.restart == fsl_rstcr_restart) 381 + 382 + for_each_node_by_name(np, "global-utilities") { 383 + if ((of_get_property(np, "fsl,has-rstcr", NULL))) { 384 + rstcr = of_iomap(np, 0) + 0xb0; 385 + if (!rstcr) 386 + printk (KERN_ERR "Error: reset control " 387 + "register not mapped!\n"); 388 + break; 389 + } 390 + } 391 + 392 + if (!rstcr && ppc_md.restart == fsl_rstcr_restart) 388 393 printk(KERN_ERR "No RSTCR register, warm reboot won't work\n"); 389 394 390 395 if (np) 391 396 of_node_put(np); 397 + 392 398 return 0; 393 399 } 394 400
+3
arch/powerpc/sysdev/mpc8xxx_gpio.c
··· 330 330 for_each_compatible_node(np, NULL, "fsl,mpc8610-gpio") 331 331 mpc8xxx_add_controller(np); 332 332 333 + for_each_compatible_node(np, NULL, "fsl,qoriq-gpio") 334 + mpc8xxx_add_controller(np); 335 + 333 336 return 0; 334 337 } 335 338 arch_initcall(mpc8xxx_add_gpiochips);
+1 -1
arch/powerpc/sysdev/pmi.c
··· 114 114 115 115 spin_lock(&data->handler_spinlock); 116 116 list_for_each_entry(handler, &data->handler, node) { 117 - pr_debug(KERN_INFO "pmi: notifying handler %p\n", handler); 117 + pr_debug("pmi: notifying handler %p\n", handler); 118 118 if (handler->type == data->msg.type) 119 119 handler->handle_pmi_message(data->msg); 120 120 }
+1 -3
arch/powerpc/xmon/Makefile
··· 4 4 5 5 GCOV_PROFILE := n 6 6 7 - ifdef CONFIG_PPC64 8 - EXTRA_CFLAGS += -mno-minimal-toc 9 - endif 7 + ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 10 8 11 9 obj-y += xmon.o start.o nonstdio.o 12 10
+1 -1
drivers/i2c/busses/i2c-pasemi.c
··· 88 88 reg_write(smbus, REG_SMSTA, status); 89 89 } 90 90 91 - static unsigned int pasemi_smb_waitready(struct pasemi_smbus *smbus) 91 + static int pasemi_smb_waitready(struct pasemi_smbus *smbus) 92 92 { 93 93 int timeout = 10; 94 94 unsigned int status;
+3 -1
drivers/macintosh/via-pmu-led.c
··· 92 92 if (dt == NULL) 93 93 return -ENODEV; 94 94 model = of_get_property(dt, "model", NULL); 95 - if (model == NULL) 95 + if (model == NULL) { 96 + of_node_put(dt); 96 97 return -ENODEV; 98 + } 97 99 if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 && 98 100 strncmp(model, "iBook", strlen("iBook")) != 0 && 99 101 strcmp(model, "PowerMac7,2") != 0 &&
+21 -1
drivers/watchdog/Kconfig
··· 957 957 the Warp platform. 958 958 959 959 config BOOKE_WDT 960 - bool "PowerPC Book-E Watchdog Timer" 960 + tristate "PowerPC Book-E Watchdog Timer" 961 961 depends on BOOKE || 4xx 962 962 ---help--- 963 + Watchdog driver for PowerPC Book-E chips, such as the Freescale 964 + MPC85xx SOCs and the IBM PowerPC 440. 965 + 963 966 Please see Documentation/watchdog/watchdog-api.txt for 964 967 more information. 968 + 969 + config BOOKE_WDT_DEFAULT_TIMEOUT 970 + int "PowerPC Book-E Watchdog Timer Default Timeout" 971 + depends on BOOKE_WDT 972 + default 38 if FSL_BOOKE 973 + range 0 63 if FSL_BOOKE 974 + default 3 if !FSL_BOOKE 975 + range 0 3 if !FSL_BOOKE 976 + help 977 + Select the default watchdog timer period to be used by the PowerPC 978 + Book-E watchdog driver. A watchdog "event" occurs when the bit 979 + position represented by this number transitions from zero to one. 980 + 981 + For Freescale Book-E processors, this is a number between 0 and 63. 982 + For other Book-E processors, this is a number between 0 and 3. 983 + 984 + The value can be overidden by the wdt_period command-line parameter. 965 985 966 986 # PPC64 Architecture 967 987
+38 -9
drivers/watchdog/booke_wdt.c
··· 4 4 * Author: Matthew McClintock 5 5 * Maintainer: Kumar Gala <galak@kernel.crashing.org> 6 6 * 7 - * Copyright 2005, 2008 Freescale Semiconductor Inc. 7 + * Copyright 2005, 2008, 2010 Freescale Semiconductor Inc. 8 8 * 9 9 * This program is free software; you can redistribute it and/or modify it 10 10 * under the terms of the GNU General Public License as published by the ··· 33 33 * occur, and the final time the board will reset. 34 34 */ 35 35 36 - #ifdef CONFIG_FSL_BOOKE 37 - #define WDT_PERIOD_DEFAULT 38 /* Ex. wdt_period=28 bus=333Mhz,reset=~40sec */ 38 - #else 39 - #define WDT_PERIOD_DEFAULT 3 /* Refer to the PPC40x and PPC4xx manuals */ 40 - #endif /* for timing information */ 41 - 42 36 u32 booke_wdt_enabled; 43 - u32 booke_wdt_period = WDT_PERIOD_DEFAULT; 37 + u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT; 44 38 45 39 #ifdef CONFIG_FSL_BOOKE 46 40 #define WDTP(x) ((((x)&0x3)<<30)|(((x)&0x3c)<<15)) ··· 106 112 val |= (TCR_WIE|TCR_WRC(WRC_CHIP)|WDTP(booke_wdt_period)); 107 113 108 114 mtspr(SPRN_TCR, val); 115 + } 116 + 117 + /** 118 + * booke_wdt_disable - disable the watchdog on the given CPU 119 + * 120 + * This function is called on each CPU. It disables the watchdog on that CPU. 121 + * 122 + * TCR[WRC] cannot be changed once it has been set to non-zero, but we can 123 + * effectively disable the watchdog by setting its period to the maximum value. 124 + */ 125 + static void __booke_wdt_disable(void *data) 126 + { 127 + u32 val; 128 + 129 + val = mfspr(SPRN_TCR); 130 + val &= ~(TCR_WIE | WDTP_MASK); 131 + mtspr(SPRN_TCR, val); 132 + 133 + /* clear status to make sure nothing is pending */ 134 + __booke_wdt_ping(NULL); 135 + 109 136 } 110 137 111 138 static ssize_t booke_wdt_write(struct file *file, const char __user *buf, ··· 208 193 return nonseekable_open(inode, file); 209 194 } 210 195 196 + static int booke_wdt_release(struct inode *inode, struct file *file) 197 + { 198 + on_each_cpu(__booke_wdt_disable, NULL, 0); 199 + booke_wdt_enabled = 0; 200 + 201 + return 0; 202 + } 203 + 211 204 static const struct file_operations booke_wdt_fops = { 212 205 .owner = THIS_MODULE, 213 206 .llseek = no_llseek, 214 207 .write = booke_wdt_write, 215 208 .unlocked_ioctl = booke_wdt_ioctl, 216 209 .open = booke_wdt_open, 210 + .release = booke_wdt_release, 217 211 }; 218 212 219 213 static struct miscdevice booke_wdt_miscdev = { ··· 261 237 262 238 return ret; 263 239 } 264 - device_initcall(booke_wdt_init); 240 + 241 + module_init(booke_wdt_init); 242 + module_exit(booke_wdt_exit); 243 + 244 + MODULE_DESCRIPTION("PowerPC Book-E watchdog driver"); 245 + MODULE_LICENSE("GPL");
+8
include/linux/pci_ids.h
··· 2316 2316 #define PCI_DEVICE_ID_P4080 0x0401 2317 2317 #define PCI_DEVICE_ID_P4040E 0x0408 2318 2318 #define PCI_DEVICE_ID_P4040 0x0409 2319 + #define PCI_DEVICE_ID_P2040E 0x0410 2320 + #define PCI_DEVICE_ID_P2040 0x0411 2321 + #define PCI_DEVICE_ID_P3041E 0x041E 2322 + #define PCI_DEVICE_ID_P3041 0x041F 2323 + #define PCI_DEVICE_ID_P5020E 0x0420 2324 + #define PCI_DEVICE_ID_P5020 0x0421 2325 + #define PCI_DEVICE_ID_P5010E 0x0428 2326 + #define PCI_DEVICE_ID_P5010 0x0429 2319 2327 #define PCI_DEVICE_ID_MPC8641 0x7010 2320 2328 #define PCI_DEVICE_ID_MPC8641D 0x7011 2321 2329 #define PCI_DEVICE_ID_MPC8610 0x7018
+1
kernel/sys_ni.c
··· 50 50 cond_syscall(sys_recvmsg); 51 51 cond_syscall(sys_recvmmsg); 52 52 cond_syscall(compat_sys_recvmsg); 53 + cond_syscall(compat_sys_recv); 53 54 cond_syscall(compat_sys_recvfrom); 54 55 cond_syscall(compat_sys_recvmmsg); 55 56 cond_syscall(sys_socketcall);