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

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

Pull powerpc updates from Benjamin Herrenschmidt:
"Notable highlights:

- iommu improvements from Anton removing the per-iommu global lock in
favor of dividing the DMA space into pools, each with its own lock,
and hashed on the CPU number. Along with making the locking more
fine grained, this gives significant improvements in multiqueue
networking scalability.

- Still from Anton, we know provide a vdso based variant of getcpu
which makes sched_getcpu with the appropriate glibc patch something
like 18 times faster.

- More anton goodness (he's been busy !) in other areas such as a
faster __clear_user and copy_page on P7, various perf fixes to
improve sampling quality, etc...

- One more step toward removing legacy i2c interfaces by using new
device-tree based probing of platform devices for the AOA audio
drivers

- A nice series of patches from Michael Neuling that helps avoiding
confusion between register numbers and litterals in assembly code,
trying to enforce the use of "%rN" register names in gas rather
than plain numbers.

- A pile of FSL updates

- The usual bunch of small fixes, cleanups etc...

You may spot a change to drivers/char/mem. The patch got no comment
or ack from outside, it's a trivial patch to allow the architecture to
skip creating /dev/port, which we use to disable it on ppc64 that
don't have a legacy brige. On those, IO ports 0...64K are not mapped
in kernel space at all, so accesses to /dev/port cause oopses (and
yes, distros -still- ship userspace that bangs hard coded ports such
as kbdrate)."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (106 commits)
powerpc/mpic: Create a revmap with enough entries for IPIs and timers
Remove stale .rej file
powerpc/iommu: Fix iommu pool initialization
powerpc/eeh: Check handle_eeh_events() return value
powerpc/85xx: Add phy nodes in SGMII mode for MPC8536/44/72DS & P2020DS
powerpc/e500: add paravirt QEMU platform
powerpc/mpc85xx_ds: convert to unified PCI init
powerpc/fsl-pci: get PCI init out of board files
powerpc/85xx: Update corenet64_smp_defconfig
powerpc/85xx: Update corenet32_smp_defconfig
powerpc/85xx: Rename P1021RDB-PC device trees to be consistent
powerpc/watchdog: move booke watchdog param related code to setup-common.c
sound/aoa: Adapt to new i2c probing scheme
i2c/powermac: Improve detection of devices from device-tree
powerpc: Disable /dev/port interface on systems without an ISA bridge
of: Improve prom_update_property() function
powerpc: Add "memory" attribute for mfmsr()
powerpc/ftrace: Fix assembly trampoline register usage
powerpc/hw_breakpoints: Fix incorrect pointer access
powerpc: Put the gpr save/restore functions in their own section
...

+4750 -3147
+1 -1
arch/powerpc/Kconfig
··· 653 653 config FSL_SOC 654 654 bool 655 655 select HAVE_CAN_FLEXCAN if NET && CAN 656 - select PPC_CLOCK if CAN_FLEXCAN 656 + select PPC_CLOCK 657 657 658 658 config FSL_PCI 659 659 bool
+9
arch/powerpc/Kconfig.debug
··· 331 331 332 332 If you are unsure, say Y. 333 333 334 + config FAIL_IOMMU 335 + bool "Fault-injection capability for IOMMU" 336 + depends on FAULT_INJECTION 337 + help 338 + Provide fault-injection capability for IOMMU. Each device can 339 + be selectively enabled via the fail_iommu property. 340 + 341 + If you are unsure, say N. 342 + 334 343 endmenu
+37 -20
arch/powerpc/boot/Makefile
··· 62 62 $(addprefix $(obj)/,$(libfdt) libfdt-wrapper.o simpleboot.o epapr.o): \ 63 63 $(addprefix $(obj)/,$(libfdtheader)) 64 64 65 - src-wlib := string.S crt0.S crtsavres.S stdio.c main.c \ 65 + src-wlib-y := string.S crt0.S crtsavres.S stdio.c main.c \ 66 66 $(libfdt) libfdt-wrapper.c \ 67 67 ns16550.c serial.c simple_alloc.c div64.S util.S \ 68 - gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \ 69 - 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \ 70 - cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \ 71 - fsl-soc.c mpc8xx.c pq2.c ugecon.c 72 - src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \ 73 - cuboot-ebony.c cuboot-hotfoot.c epapr.c treeboot-ebony.c \ 74 - prpmc2800.c \ 75 - ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \ 76 - cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \ 77 - cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \ 78 - fixed-head.S ep88xc.c ep405.c cuboot-c2k.c \ 79 - cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ 80 - cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \ 81 - virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \ 82 - cuboot-acadia.c cuboot-amigaone.c cuboot-kilauea.c \ 83 - gamecube-head.S gamecube.c wii-head.S wii.c treeboot-iss4xx.c \ 84 - treeboot-currituck.c 68 + gunzip_util.c elf_util.c $(zlib) devtree.c stdlib.c \ 69 + oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \ 70 + uartlite.c mpc52xx-psc.c 71 + src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c 72 + src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c 73 + src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c 74 + src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c 75 + src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c 76 + 77 + src-plat-y := of.c 78 + src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \ 79 + treeboot-walnut.c cuboot-acadia.c \ 80 + cuboot-kilauea.c simpleboot.c \ 81 + virtex405-head.S virtex.c 82 + src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \ 83 + cuboot-bamboo.c cuboot-sam440ep.c \ 84 + cuboot-sequoia.c cuboot-rainier.c \ 85 + cuboot-taishan.c cuboot-katmai.c \ 86 + cuboot-warp.c cuboot-yosemite.c \ 87 + treeboot-iss4xx.c treeboot-currituck.c \ 88 + simpleboot.c fixed-head.S virtex.c 89 + src-plat-$(CONFIG_8xx) += cuboot-8xx.c fixed-head.S ep88xc.c redboot-8xx.c 90 + src-plat-$(CONFIG_PPC_MPC52xx) += cuboot-52xx.c 91 + src-plat-$(CONFIG_PPC_82xx) += cuboot-pq2.c fixed-head.S ep8248e.c cuboot-824x.c 92 + src-plat-$(CONFIG_PPC_83xx) += cuboot-83xx.c fixed-head.S redboot-83xx.c 93 + src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c cuboot-85xx-cpm2.c 94 + src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \ 95 + cuboot-c2k.c gamecube-head.S \ 96 + gamecube.c wii-head.S wii.c holly.c \ 97 + prpmc2800.c 98 + src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c 99 + src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c 100 + src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c 101 + 102 + src-wlib := $(sort $(src-wlib-y)) 103 + src-plat := $(sort $(src-plat-y)) 85 104 src-boot := $(src-wlib) $(src-plat) empty.c 86 105 87 106 src-boot := $(addprefix $(obj)/, $(src-boot)) ··· 276 257 image-$(CONFIG_TQM8555) += cuImage.tqm8555 277 258 image-$(CONFIG_TQM8560) += cuImage.tqm8560 278 259 image-$(CONFIG_SBC8548) += cuImage.sbc8548 279 - image-$(CONFIG_SBC8560) += cuImage.sbc8560 280 260 image-$(CONFIG_KSI8560) += cuImage.ksi8560 281 261 282 262 # Board ports in arch/powerpc/platform/embedded6xx/Kconfig ··· 430 412 $(call cmd,install_wrapper) 431 413 432 414 $(obj)/bootwrapper_install: $(all-installed) 433 -
+34
arch/powerpc/boot/dts/bsc9131rdb.dts
··· 1 + /* 2 + * BSC9131 RDB Device Tree Source 3 + * 4 + * Copyright 2011-2012 Freescale Semiconductor Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or modify it 7 + * under the terms of the GNU General Public License as published by the 8 + * Free Software Foundation; either version 2 of the License, or (at your 9 + * option) any later version. 10 + */ 11 + 12 + /include/ "fsl/bsc9131si-pre.dtsi" 13 + 14 + / { 15 + model = "fsl,bsc9131rdb"; 16 + compatible = "fsl,bsc9131rdb"; 17 + 18 + memory { 19 + device_type = "memory"; 20 + }; 21 + 22 + board_ifc: ifc: ifc@ff71e000 { 23 + /* NAND Flash on board */ 24 + ranges = <0x0 0x0 0x0 0xff800000 0x00004000>; 25 + reg = <0x0 0xff71e000 0x0 0x2000>; 26 + }; 27 + 28 + board_soc: soc: soc@ff700000 { 29 + ranges = <0x0 0x0 0xff700000 0x100000>; 30 + }; 31 + }; 32 + 33 + /include/ "bsc9131rdb.dtsi" 34 + /include/ "fsl/bsc9131si-post.dtsi"
+142
arch/powerpc/boot/dts/bsc9131rdb.dtsi
··· 1 + /* 2 + * BSC9131 RDB Device Tree Source stub (no addresses or top-level ranges) 3 + * 4 + * Copyright 2011-2012 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + &board_ifc { 36 + 37 + nand@0,0 { 38 + #address-cells = <1>; 39 + #size-cells = <1>; 40 + compatible = "fsl,ifc-nand"; 41 + reg = <0x0 0x0 0x4000>; 42 + 43 + partition@0 { 44 + /* This location must not be altered */ 45 + /* 3MB for u-boot Bootloader Image */ 46 + reg = <0x0 0x00300000>; 47 + label = "NAND U-Boot Image"; 48 + read-only; 49 + }; 50 + 51 + partition@300000 { 52 + /* 1MB for DTB Image */ 53 + reg = <0x00300000 0x00100000>; 54 + label = "NAND DTB Image"; 55 + }; 56 + 57 + partition@400000 { 58 + /* 8MB for Linux Kernel Image */ 59 + reg = <0x00400000 0x00800000>; 60 + label = "NAND Linux Kernel Image"; 61 + }; 62 + 63 + partition@c00000 { 64 + /* Rest space for Root file System Image */ 65 + reg = <0x00c00000 0x07400000>; 66 + label = "NAND RFS Image"; 67 + }; 68 + }; 69 + }; 70 + 71 + &board_soc { 72 + /* BSC9131RDB does not have any device on i2c@3100 */ 73 + i2c@3100 { 74 + status = "disabled"; 75 + }; 76 + 77 + spi@7000 { 78 + flash@0 { 79 + #address-cells = <1>; 80 + #size-cells = <1>; 81 + compatible = "spansion,s25sl12801"; 82 + reg = <0>; 83 + spi-max-frequency = <50000000>; 84 + 85 + /* 512KB for u-boot Bootloader Image */ 86 + partition@0 { 87 + reg = <0x0 0x00080000>; 88 + label = "SPI Flash U-Boot Image"; 89 + read-only; 90 + }; 91 + 92 + /* 512KB for DTB Image */ 93 + partition@80000 { 94 + reg = <0x00080000 0x00080000>; 95 + label = "SPI Flash DTB Image"; 96 + }; 97 + 98 + /* 4MB for Linux Kernel Image */ 99 + partition@100000 { 100 + reg = <0x00100000 0x00400000>; 101 + label = "SPI Flash Kernel Image"; 102 + }; 103 + 104 + /*11MB for RFS Image */ 105 + partition@500000 { 106 + reg = <0x00500000 0x00B00000>; 107 + label = "SPI Flash RFS Image"; 108 + }; 109 + 110 + }; 111 + }; 112 + 113 + usb@22000 { 114 + phy_type = "ulpi"; 115 + }; 116 + 117 + mdio@24000 { 118 + phy0: ethernet-phy@0 { 119 + interrupts = <3 1 0 0>; 120 + reg = <0x0>; 121 + }; 122 + 123 + phy1: ethernet-phy@1 { 124 + interrupts = <2 1 0 0>; 125 + reg = <0x3>; 126 + }; 127 + }; 128 + 129 + sdhci@2e000 { 130 + status = "disabled"; 131 + }; 132 + 133 + enet0: ethernet@b0000 { 134 + phy-handle = <&phy0>; 135 + phy-connection-type = "rgmii-id"; 136 + }; 137 + 138 + enet1: ethernet@b1000 { 139 + phy-handle = <&phy1>; 140 + phy-connection-type = "rgmii-id"; 141 + }; 142 + };
+193
arch/powerpc/boot/dts/fsl/bsc9131si-post.dtsi
··· 1 + /* 2 + * BSC9131 Silicon/SoC Device Tree Source (post include) 3 + * 4 + * Copyright 2011-2012 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + &ifc { 36 + #address-cells = <2>; 37 + #size-cells = <1>; 38 + compatible = "fsl,ifc", "simple-bus"; 39 + interrupts = <16 2 0 0 20 2 0 0>; 40 + }; 41 + 42 + &soc { 43 + #address-cells = <1>; 44 + #size-cells = <1>; 45 + device_type = "soc"; 46 + compatible = "fsl,bsc9131-immr", "simple-bus"; 47 + bus-frequency = <0>; // Filled out by uboot. 48 + 49 + ecm-law@0 { 50 + compatible = "fsl,ecm-law"; 51 + reg = <0x0 0x1000>; 52 + fsl,num-laws = <12>; 53 + }; 54 + 55 + ecm@1000 { 56 + compatible = "fsl,bsc9131-ecm", "fsl,ecm"; 57 + reg = <0x1000 0x1000>; 58 + interrupts = <16 2 0 0>; 59 + }; 60 + 61 + memory-controller@2000 { 62 + compatible = "fsl,bsc9131-memory-controller"; 63 + reg = <0x2000 0x1000>; 64 + interrupts = <16 2 0 0>; 65 + }; 66 + 67 + /include/ "pq3-i2c-0.dtsi" 68 + i2c@3000 { 69 + interrupts = <17 2 0 0>; 70 + }; 71 + 72 + /include/ "pq3-i2c-1.dtsi" 73 + i2c@3100 { 74 + interrupts = <17 2 0 0>; 75 + }; 76 + 77 + /include/ "pq3-duart-0.dtsi" 78 + serial0: serial@4500 { 79 + interrupts = <18 2 0 0>; 80 + }; 81 + 82 + serial1: serial@4600 { 83 + interrupts = <18 2 0 0 >; 84 + }; 85 + /include/ "pq3-espi-0.dtsi" 86 + spi0: spi@7000 { 87 + fsl,espi-num-chipselects = <1>; 88 + interrupts = <22 0x2 0 0>; 89 + }; 90 + 91 + /include/ "pq3-gpio-0.dtsi" 92 + gpio-controller@f000 { 93 + interrupts = <19 0x2 0 0>; 94 + }; 95 + 96 + L2: l2-cache-controller@20000 { 97 + compatible = "fsl,bsc9131-l2-cache-controller"; 98 + reg = <0x20000 0x1000>; 99 + cache-line-size = <32>; // 32 bytes 100 + cache-size = <0x40000>; // L2,256K 101 + interrupts = <16 2 0 0>; 102 + }; 103 + 104 + /include/ "pq3-dma-0.dtsi" 105 + 106 + dma@21300 { 107 + 108 + dma-channel@0 { 109 + interrupts = <62 2 0 0>; 110 + }; 111 + 112 + dma-channel@80 { 113 + interrupts = <63 2 0 0>; 114 + }; 115 + 116 + dma-channel@100 { 117 + interrupts = <64 2 0 0>; 118 + }; 119 + 120 + dma-channel@180 { 121 + interrupts = <65 2 0 0>; 122 + }; 123 + }; 124 + 125 + /include/ "pq3-usb2-dr-0.dtsi" 126 + usb@22000 { 127 + compatible = "fsl-usb2-dr","fsl-usb2-dr-v2.2"; 128 + interrupts = <40 0x2 0 0>; 129 + }; 130 + 131 + /include/ "pq3-esdhc-0.dtsi" 132 + sdhc@2e000 { 133 + fsl,sdhci-auto-cmd12; 134 + interrupts = <41 0x2 0 0>; 135 + }; 136 + 137 + /include/ "pq3-sec4.4-0.dtsi" 138 + crypto@30000 { 139 + interrupts = <57 2 0 0>; 140 + 141 + sec_jr0: jr@1000 { 142 + interrupts = <58 2 0 0>; 143 + }; 144 + 145 + sec_jr1: jr@2000 { 146 + interrupts = <59 2 0 0>; 147 + }; 148 + 149 + sec_jr2: jr@3000 { 150 + interrupts = <60 2 0 0>; 151 + }; 152 + 153 + sec_jr3: jr@4000 { 154 + interrupts = <61 2 0 0>; 155 + }; 156 + }; 157 + 158 + /include/ "pq3-mpic.dtsi" 159 + 160 + timer@41100 { 161 + compatible = "fsl,mpic-v1.2-msgr", "fsl,mpic-msg"; 162 + reg = <0x41400 0x200>; 163 + interrupts = < 164 + 0xb0 2 165 + 0xb1 2 166 + 0xb2 2 167 + 0xb3 2>; 168 + }; 169 + 170 + /include/ "pq3-etsec2-0.dtsi" 171 + enet0: ethernet@b0000 { 172 + queue-group@b0000 { 173 + fsl,rx-bit-map = <0xff>; 174 + fsl,tx-bit-map = <0xff>; 175 + interrupts = <26 2 0 0 27 2 0 0 28 2 0 0>; 176 + }; 177 + }; 178 + 179 + /include/ "pq3-etsec2-1.dtsi" 180 + enet1: ethernet@b1000 { 181 + queue-group@b1000 { 182 + fsl,rx-bit-map = <0xff>; 183 + fsl,tx-bit-map = <0xff>; 184 + interrupts = <33 2 0 0 34 2 0 0 35 2 0 0>; 185 + }; 186 + }; 187 + 188 + global-utilities@e0000 { 189 + compatible = "fsl,bsc9131-guts"; 190 + reg = <0xe0000 0x1000>; 191 + fsl,has-rstcr; 192 + }; 193 + };
+15 -1
arch/powerpc/boot/dts/fsl/p1021si-post.dtsi
··· 1 1 /* 2 2 * P1021/P1012 Silicon/SoC Device Tree Source (post include) 3 3 * 4 - * Copyright 2011 Freescale Semiconductor Inc. 4 + * Copyright 2011-2012 Freescale Semiconductor Inc. 5 5 * 6 6 * Redistribution and use in source and binary forms, with or without 7 7 * modification, are permitted provided that the following conditions are met: ··· 210 210 cell-index = <5>; 211 211 reg = <0x2400 0x200>; 212 212 interrupts = <40>; 213 + interrupt-parent = <&qeic>; 214 + }; 215 + 216 + ucc@2600 { 217 + cell-index = <7>; 218 + reg = <0x2600 0x200>; 219 + interrupts = <42>; 220 + interrupt-parent = <&qeic>; 221 + }; 222 + 223 + ucc@2200 { 224 + cell-index = <3>; 225 + reg = <0x2200 0x200>; 226 + interrupts = <34>; 213 227 interrupt-parent = <&qeic>; 214 228 }; 215 229
-302
arch/powerpc/boot/dts/fsl/p3060si-post.dtsi
··· 1 - /* 2 - * P3060 Silicon/SoC Device Tree Source (post include) 3 - * 4 - * Copyright 2011 Freescale Semiconductor Inc. 5 - * 6 - * Redistribution and use in source and binary forms, with or without 7 - * modification, are permitted provided that the following conditions are met: 8 - * * Redistributions of source code must retain the above copyright 9 - * notice, this list of conditions and the following disclaimer. 10 - * * Redistributions in binary form must reproduce the above copyright 11 - * notice, this list of conditions and the following disclaimer in the 12 - * documentation and/or other materials provided with the distribution. 13 - * * Neither the name of Freescale Semiconductor nor the 14 - * names of its contributors may be used to endorse or promote products 15 - * derived from this software without specific prior written permission. 16 - * 17 - * 18 - * ALTERNATIVELY, this software may be distributed under the terms of the 19 - * GNU General Public License ("GPL") as published by the Free Software 20 - * Foundation, either version 2 of that License or (at your option) any 21 - * later version. 22 - * 23 - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - &lbc { 36 - compatible = "fsl,p3060-elbc", "fsl,elbc", "simple-bus"; 37 - interrupts = <25 2 0 0>; 38 - #address-cells = <2>; 39 - #size-cells = <1>; 40 - }; 41 - 42 - /* controller at 0x200000 */ 43 - &pci0 { 44 - compatible = "fsl,p3060-pcie", "fsl,qoriq-pcie-v2.2"; 45 - device_type = "pci"; 46 - #size-cells = <2>; 47 - #address-cells = <3>; 48 - bus-range = <0x0 0xff>; 49 - clock-frequency = <33333333>; 50 - interrupts = <16 2 1 15>; 51 - pcie@0 { 52 - reg = <0 0 0 0 0>; 53 - #interrupt-cells = <1>; 54 - #size-cells = <2>; 55 - #address-cells = <3>; 56 - device_type = "pci"; 57 - interrupts = <16 2 1 15>; 58 - interrupt-map-mask = <0xf800 0 0 7>; 59 - interrupt-map = < 60 - /* IDSEL 0x0 */ 61 - 0000 0 0 1 &mpic 40 1 0 0 62 - 0000 0 0 2 &mpic 1 1 0 0 63 - 0000 0 0 3 &mpic 2 1 0 0 64 - 0000 0 0 4 &mpic 3 1 0 0 65 - >; 66 - }; 67 - }; 68 - 69 - /* controller at 0x201000 */ 70 - &pci1 { 71 - compatible = "fsl,p3060-pcie", "fsl,qoriq-pcie-v2.2"; 72 - device_type = "pci"; 73 - #size-cells = <2>; 74 - #address-cells = <3>; 75 - bus-range = <0 0xff>; 76 - clock-frequency = <33333333>; 77 - interrupts = <16 2 1 14>; 78 - pcie@0 { 79 - reg = <0 0 0 0 0>; 80 - #interrupt-cells = <1>; 81 - #size-cells = <2>; 82 - #address-cells = <3>; 83 - device_type = "pci"; 84 - interrupts = <16 2 1 14>; 85 - interrupt-map-mask = <0xf800 0 0 7>; 86 - interrupt-map = < 87 - /* IDSEL 0x0 */ 88 - 0000 0 0 1 &mpic 41 1 0 0 89 - 0000 0 0 2 &mpic 5 1 0 0 90 - 0000 0 0 3 &mpic 6 1 0 0 91 - 0000 0 0 4 &mpic 7 1 0 0 92 - >; 93 - }; 94 - }; 95 - 96 - &rio { 97 - compatible = "fsl,srio"; 98 - interrupts = <16 2 1 11>; 99 - #address-cells = <2>; 100 - #size-cells = <2>; 101 - fsl,srio-rmu-handle = <&rmu>; 102 - ranges; 103 - 104 - port1 { 105 - #address-cells = <2>; 106 - #size-cells = <2>; 107 - cell-index = <1>; 108 - }; 109 - 110 - port2 { 111 - #address-cells = <2>; 112 - #size-cells = <2>; 113 - cell-index = <2>; 114 - }; 115 - }; 116 - 117 - &dcsr { 118 - #address-cells = <1>; 119 - #size-cells = <1>; 120 - compatible = "fsl,dcsr", "simple-bus"; 121 - 122 - dcsr-epu@0 { 123 - compatible = "fsl,dcsr-epu"; 124 - interrupts = <52 2 0 0 125 - 84 2 0 0 126 - 85 2 0 0>; 127 - reg = <0x0 0x1000>; 128 - }; 129 - dcsr-npc { 130 - compatible = "fsl,dcsr-npc"; 131 - reg = <0x1000 0x1000 0x1000000 0x8000>; 132 - }; 133 - dcsr-nxc@2000 { 134 - compatible = "fsl,dcsr-nxc"; 135 - reg = <0x2000 0x1000>; 136 - }; 137 - dcsr-corenet { 138 - compatible = "fsl,dcsr-corenet"; 139 - reg = <0x8000 0x1000 0xB0000 0x1000>; 140 - }; 141 - dcsr-dpaa@9000 { 142 - compatible = "fsl,p3060-dcsr-dpaa", "fsl,dcsr-dpaa"; 143 - reg = <0x9000 0x1000>; 144 - }; 145 - dcsr-ocn@11000 { 146 - compatible = "fsl,p3060-dcsr-ocn", "fsl,dcsr-ocn"; 147 - reg = <0x11000 0x1000>; 148 - }; 149 - dcsr-ddr@12000 { 150 - compatible = "fsl,dcsr-ddr"; 151 - dev-handle = <&ddr1>; 152 - reg = <0x12000 0x1000>; 153 - }; 154 - dcsr-nal@18000 { 155 - compatible = "fsl,p3060-dcsr-nal", "fsl,dcsr-nal"; 156 - reg = <0x18000 0x1000>; 157 - }; 158 - dcsr-rcpm@22000 { 159 - compatible = "fsl,p3060-dcsr-rcpm", "fsl,dcsr-rcpm"; 160 - reg = <0x22000 0x1000>; 161 - }; 162 - dcsr-cpu-sb-proxy@40000 { 163 - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 164 - cpu-handle = <&cpu0>; 165 - reg = <0x40000 0x1000>; 166 - }; 167 - dcsr-cpu-sb-proxy@41000 { 168 - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 169 - cpu-handle = <&cpu1>; 170 - reg = <0x41000 0x1000>; 171 - }; 172 - dcsr-cpu-sb-proxy@44000 { 173 - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 174 - cpu-handle = <&cpu4>; 175 - reg = <0x44000 0x1000>; 176 - }; 177 - dcsr-cpu-sb-proxy@45000 { 178 - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 179 - cpu-handle = <&cpu5>; 180 - reg = <0x45000 0x1000>; 181 - }; 182 - dcsr-cpu-sb-proxy@46000 { 183 - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 184 - cpu-handle = <&cpu6>; 185 - reg = <0x46000 0x1000>; 186 - }; 187 - dcsr-cpu-sb-proxy@47000 { 188 - compatible = "fsl,dcsr-e500mc-sb-proxy", "fsl,dcsr-cpu-sb-proxy"; 189 - cpu-handle = <&cpu7>; 190 - reg = <0x47000 0x1000>; 191 - }; 192 - 193 - }; 194 - 195 - &soc { 196 - #address-cells = <1>; 197 - #size-cells = <1>; 198 - device_type = "soc"; 199 - compatible = "simple-bus"; 200 - 201 - soc-sram-error { 202 - compatible = "fsl,soc-sram-error"; 203 - interrupts = <16 2 1 29>; 204 - }; 205 - 206 - corenet-law@0 { 207 - compatible = "fsl,corenet-law"; 208 - reg = <0x0 0x1000>; 209 - fsl,num-laws = <32>; 210 - }; 211 - 212 - ddr1: memory-controller@8000 { 213 - compatible = "fsl,qoriq-memory-controller-v4.4", "fsl,qoriq-memory-controller"; 214 - reg = <0x8000 0x1000>; 215 - interrupts = <16 2 1 23>; 216 - }; 217 - 218 - cpc: l3-cache-controller@10000 { 219 - compatible = "fsl,p3060-l3-cache-controller", "cache"; 220 - reg = <0x10000 0x1000 221 - 0x11000 0x1000>; 222 - interrupts = <16 2 1 27 223 - 16 2 1 26>; 224 - }; 225 - 226 - corenet-cf@18000 { 227 - compatible = "fsl,corenet-cf"; 228 - reg = <0x18000 0x1000>; 229 - interrupts = <16 2 1 31>; 230 - fsl,ccf-num-csdids = <32>; 231 - fsl,ccf-num-snoopids = <32>; 232 - }; 233 - 234 - iommu@20000 { 235 - compatible = "fsl,pamu-v1.0", "fsl,pamu"; 236 - reg = <0x20000 0x5000>; 237 - interrupts = < 238 - 24 2 0 0 239 - 16 2 1 30>; 240 - }; 241 - 242 - /include/ "qoriq-rmu-0.dtsi" 243 - /include/ "qoriq-mpic.dtsi" 244 - 245 - guts: global-utilities@e0000 { 246 - compatible = "fsl,qoriq-device-config-1.0"; 247 - reg = <0xe0000 0xe00>; 248 - fsl,has-rstcr; 249 - #sleep-cells = <1>; 250 - fsl,liodn-bits = <12>; 251 - }; 252 - 253 - pins: global-utilities@e0e00 { 254 - compatible = "fsl,qoriq-pin-control-1.0"; 255 - reg = <0xe0e00 0x200>; 256 - #sleep-cells = <2>; 257 - }; 258 - 259 - clockgen: global-utilities@e1000 { 260 - compatible = "fsl,p3060-clockgen", "fsl,qoriq-clockgen-1.0"; 261 - reg = <0xe1000 0x1000>; 262 - clock-frequency = <0>; 263 - }; 264 - 265 - rcpm: global-utilities@e2000 { 266 - compatible = "fsl,qoriq-rcpm-1.0"; 267 - reg = <0xe2000 0x1000>; 268 - #sleep-cells = <1>; 269 - }; 270 - 271 - sfp: sfp@e8000 { 272 - compatible = "fsl,p3060-sfp", "fsl,qoriq-sfp-1.0"; 273 - reg = <0xe8000 0x1000>; 274 - }; 275 - 276 - serdes: serdes@ea000 { 277 - compatible = "fsl,p3060-serdes"; 278 - reg = <0xea000 0x1000>; 279 - }; 280 - 281 - /include/ "qoriq-dma-0.dtsi" 282 - /include/ "qoriq-dma-1.dtsi" 283 - /include/ "qoriq-espi-0.dtsi" 284 - spi@110000 { 285 - fsl,espi-num-chipselects = <4>; 286 - }; 287 - 288 - /include/ "qoriq-i2c-0.dtsi" 289 - /include/ "qoriq-i2c-1.dtsi" 290 - /include/ "qoriq-duart-0.dtsi" 291 - /include/ "qoriq-duart-1.dtsi" 292 - /include/ "qoriq-gpio-0.dtsi" 293 - /include/ "qoriq-usb2-mph-0.dtsi" 294 - usb@210000 { 295 - compatible = "fsl-usb2-mph-v2.2", "fsl,mpc85xx-usb2-mph", "fsl-usb2-mph"; 296 - }; 297 - /include/ "qoriq-usb2-dr-0.dtsi" 298 - usb@211000 { 299 - compatible = "fsl-usb2-dr-v2.2", "fsl,mpc85xx-usb2-dr", "fsl-usb2-dr"; 300 - }; 301 - /include/ "qoriq-sec4.1-0.dtsi" 302 - };
+46 -84
arch/powerpc/boot/dts/fsl/p3060si-pre.dtsi arch/powerpc/boot/dts/p1024rdb_36b.dts
··· 1 1 /* 2 - * P3060 Silicon/SoC Device Tree Source (pre include) 2 + * P1024 RDB 36Bit Physical Address Map Device Tree Source 3 3 * 4 - * Copyright 2011 Freescale Semiconductor Inc. 4 + * Copyright 2012 Freescale Semiconductor Inc. 5 5 * 6 6 * Redistribution and use in source and binary forms, with or without 7 7 * modification, are permitted provided that the following conditions are met: ··· 32 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 33 */ 34 34 35 - /dts-v1/; 35 + /include/ "fsl/p1020si-pre.dtsi" 36 36 / { 37 - compatible = "fsl,P3060"; 38 - #address-cells = <2>; 39 - #size-cells = <2>; 40 - interrupt-parent = <&mpic>; 37 + model = "fsl,P1024RDB"; 38 + compatible = "fsl,P1024RDB"; 41 39 42 - aliases { 43 - ccsr = &soc; 44 - dcsr = &dcsr; 45 - 46 - serial0 = &serial0; 47 - serial1 = &serial1; 48 - serial2 = &serial2; 49 - serial3 = &serial3; 50 - pci0 = &pci0; 51 - pci1 = &pci1; 52 - usb0 = &usb0; 53 - usb1 = &usb1; 54 - dma0 = &dma0; 55 - dma1 = &dma1; 56 - msi0 = &msi0; 57 - msi1 = &msi1; 58 - msi2 = &msi2; 59 - 60 - crypto = &crypto; 61 - sec_jr0 = &sec_jr0; 62 - sec_jr1 = &sec_jr1; 63 - sec_jr2 = &sec_jr2; 64 - sec_jr3 = &sec_jr3; 65 - rtic_a = &rtic_a; 66 - rtic_b = &rtic_b; 67 - rtic_c = &rtic_c; 68 - rtic_d = &rtic_d; 69 - sec_mon = &sec_mon; 40 + memory { 41 + device_type = "memory"; 70 42 }; 71 43 72 - cpus { 73 - #address-cells = <1>; 74 - #size-cells = <0>; 44 + lbc: localbus@fffe05000 { 45 + reg = <0xf 0xffe05000 0 0x1000>; 46 + ranges = <0x0 0x0 0xf 0xef000000 0x01000000 47 + 0x1 0x0 0xf 0xff800000 0x00040000>; 48 + }; 75 49 76 - cpu0: PowerPC,e500mc@0 { 77 - device_type = "cpu"; 78 - reg = <0>; 79 - next-level-cache = <&L2_0>; 80 - L2_0: l2-cache { 81 - next-level-cache = <&cpc>; 82 - }; 50 + soc: soc@fffe00000 { 51 + ranges = <0x0 0xf 0xffe00000 0x100000>; 52 + }; 53 + 54 + pci0: pcie@fffe09000 { 55 + reg = <0xf 0xffe09000 0 0x1000>; 56 + ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 57 + 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>; 58 + pcie@0 { 59 + ranges = <0x2000000 0x0 0xe0000000 60 + 0x2000000 0x0 0xe0000000 61 + 0x0 0x20000000 62 + 63 + 0x1000000 0x0 0x0 64 + 0x1000000 0x0 0x0 65 + 0x0 0x100000>; 83 66 }; 84 - cpu1: PowerPC,e500mc@1 { 85 - device_type = "cpu"; 86 - reg = <1>; 87 - next-level-cache = <&L2_1>; 88 - L2_1: l2-cache { 89 - next-level-cache = <&cpc>; 90 - }; 91 - }; 92 - cpu4: PowerPC,e500mc@4 { 93 - device_type = "cpu"; 94 - reg = <4>; 95 - next-level-cache = <&L2_4>; 96 - L2_4: l2-cache { 97 - next-level-cache = <&cpc>; 98 - }; 99 - }; 100 - cpu5: PowerPC,e500mc@5 { 101 - device_type = "cpu"; 102 - reg = <5>; 103 - next-level-cache = <&L2_5>; 104 - L2_5: l2-cache { 105 - next-level-cache = <&cpc>; 106 - }; 107 - }; 108 - cpu6: PowerPC,e500mc@6 { 109 - device_type = "cpu"; 110 - reg = <6>; 111 - next-level-cache = <&L2_6>; 112 - L2_6: l2-cache { 113 - next-level-cache = <&cpc>; 114 - }; 115 - }; 116 - cpu7: PowerPC,e500mc@7 { 117 - device_type = "cpu"; 118 - reg = <7>; 119 - next-level-cache = <&L2_7>; 120 - L2_7: l2-cache { 121 - next-level-cache = <&cpc>; 122 - }; 67 + }; 68 + 69 + pci1: pcie@fffe0a000 { 70 + reg = <0xf 0xffe0a000 0 0x1000>; 71 + ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000 72 + 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; 73 + pcie@0 { 74 + reg = <0x0 0x0 0x0 0x0 0x0>; 75 + ranges = <0x2000000 0x0 0xe0000000 76 + 0x2000000 0x0 0xe0000000 77 + 0x0 0x20000000 78 + 79 + 0x1000000 0x0 0x0 80 + 0x1000000 0x0 0x0 81 + 0x0 0x100000>; 123 82 }; 124 83 }; 125 84 }; 85 + 86 + /include/ "p1024rdb.dtsi" 87 + /include/ "fsl/p1020si-post.dtsi"
+23
arch/powerpc/boot/dts/mgcoge.dts
··· 222 222 interrupt-parent = <&PIC>; 223 223 usb-clock = <5>; 224 224 }; 225 + spi@11aa0 { 226 + cell-index = <0>; 227 + compatible = "fsl,spi", "fsl,cpm2-spi"; 228 + reg = <0x11a80 0x40 0x89fc 0x2>; 229 + interrupts = <2 8>; 230 + interrupt-parent = <&PIC>; 231 + gpios = < &cpm2_pio_d 19 0>; 232 + #address-cells = <1>; 233 + #size-cells = <0>; 234 + ds3106@1 { 235 + compatible = "gen,spidev"; 236 + reg = <0>; 237 + spi-max-frequency = <8000000>; 238 + }; 239 + }; 240 + 241 + }; 242 + 243 + cpm2_pio_d: gpio-controller@10d60 { 244 + #gpio-cells = <2>; 245 + compatible = "fsl,cpm2-pario-bank"; 246 + reg = <0x10d60 0x14>; 247 + gpio-controller; 225 248 }; 226 249 227 250 cpm2_pio_c: gpio-controller@10d40 {
+8
arch/powerpc/boot/dts/mpc8536ds.dtsi
··· 203 203 reg = <1>; 204 204 device_type = "ethernet-phy"; 205 205 }; 206 + sgmii_phy0: sgmii-phy@0 { 207 + interrupts = <6 1 0 0>; 208 + reg = <0x1d>; 209 + }; 210 + sgmii_phy1: sgmii-phy@1 { 211 + interrupts = <6 1 0 0>; 212 + reg = <0x1c>; 213 + }; 206 214 tbi0: tbi-phy@11 { 207 215 reg = <0x11>; 208 216 device_type = "tbi-phy";
+9
arch/powerpc/boot/dts/mpc8544ds.dtsi
··· 51 51 device_type = "ethernet-phy"; 52 52 }; 53 53 54 + sgmii_phy0: sgmii-phy@0 { 55 + interrupts = <6 1 0 0>; 56 + reg = <0x1c>; 57 + }; 58 + sgmii_phy1: sgmii-phy@1 { 59 + interrupts = <6 1 0 0>; 60 + reg = <0x1d>; 61 + }; 62 + 54 63 tbi0: tbi-phy@11 { 55 64 reg = <0x11>; 56 65 device_type = "tbi-phy";
+17
arch/powerpc/boot/dts/mpc8572ds.dtsi
··· 169 169 reg = <0x3>; 170 170 }; 171 171 172 + sgmii_phy0: sgmii-phy@0 { 173 + interrupts = <6 1 0 0>; 174 + reg = <0x1c>; 175 + }; 176 + sgmii_phy1: sgmii-phy@1 { 177 + interrupts = <6 1 0 0>; 178 + reg = <0x1d>; 179 + }; 180 + sgmii_phy2: sgmii-phy@2 { 181 + interrupts = <7 1 0 0>; 182 + reg = <0x1e>; 183 + }; 184 + sgmii_phy3: sgmii-phy@3 { 185 + interrupts = <7 1 0 0>; 186 + reg = <0x1f>; 187 + }; 188 + 172 189 tbi0: tbi-phy@11 { 173 190 reg = <0x11>; 174 191 device_type = "tbi-phy";
+4 -4
arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts
··· 67 67 msi@41600 { 68 68 msi-available-ranges = <0 0x80>; 69 69 interrupts = < 70 - 0xe0 0 71 - 0xe1 0 72 - 0xe2 0 73 - 0xe3 0>; 70 + 0xe0 0 0 0 71 + 0xe1 0 0 0 72 + 0xe2 0 0 0 73 + 0xe3 0 0 0>; 74 74 }; 75 75 timer@42100 { 76 76 status = "disabled";
+4 -7
arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts
··· 67 67 ethernet@24000 { 68 68 status = "disabled"; 69 69 }; 70 - mdio@24520 { 71 - status = "disabled"; 72 - }; 73 70 ptp_clock@24e00 { 74 71 status = "disabled"; 75 72 }; ··· 97 100 msi@41600 { 98 101 msi-available-ranges = <0x80 0x80>; 99 102 interrupts = < 100 - 0xe4 0 101 - 0xe5 0 102 - 0xe6 0 103 - 0xe7 0>; 103 + 0xe4 0 0 0 104 + 0xe5 0 0 0 105 + 0xe6 0 0 0 106 + 0xe7 0 0 0>; 104 107 }; 105 108 global-utilities@e0000 { 106 109 status = "disabled";
+12
arch/powerpc/boot/dts/p1010rdb.dtsi
··· 126 126 127 127 &board_soc { 128 128 i2c@3000 { 129 + eeprom@50 { 130 + compatible = "st,24c256"; 131 + reg = <0x50>; 132 + }; 133 + 129 134 rtc@68 { 130 135 compatible = "pericom,pt7c4338"; 131 136 reg = <0x68>; 137 + }; 138 + }; 139 + 140 + i2c@3100 { 141 + eeprom@52 { 142 + compatible = "atmel,24c01"; 143 + reg = <0x52>; 132 144 }; 133 145 }; 134 146
+236
arch/powerpc/boot/dts/p1021rdb-pc.dtsi
··· 1 + /* 2 + * P1021 RDB Device Tree Source stub (no addresses or top-level ranges) 3 + * 4 + * Copyright 2012 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + &lbc { 36 + nor@0,0 { 37 + #address-cells = <1>; 38 + #size-cells = <1>; 39 + compatible = "cfi-flash"; 40 + reg = <0x0 0x0 0x1000000>; 41 + bank-width = <2>; 42 + device-width = <1>; 43 + 44 + partition@0 { 45 + /* This location must not be altered */ 46 + /* 256KB for Vitesse 7385 Switch firmware */ 47 + reg = <0x0 0x00040000>; 48 + label = "NOR Vitesse-7385 Firmware"; 49 + read-only; 50 + }; 51 + 52 + partition@40000 { 53 + /* 256KB for DTB Image */ 54 + reg = <0x00040000 0x00040000>; 55 + label = "NOR DTB Image"; 56 + }; 57 + 58 + partition@80000 { 59 + /* 3.5 MB for Linux Kernel Image */ 60 + reg = <0x00080000 0x00380000>; 61 + label = "NOR Linux Kernel Image"; 62 + }; 63 + 64 + partition@400000 { 65 + /* 11MB for JFFS2 based Root file System */ 66 + reg = <0x00400000 0x00b00000>; 67 + label = "NOR JFFS2 Root File System"; 68 + }; 69 + 70 + partition@f00000 { 71 + /* This location must not be altered */ 72 + /* 512KB for u-boot Bootloader Image */ 73 + /* 512KB for u-boot Environment Variables */ 74 + reg = <0x00f00000 0x00100000>; 75 + label = "NOR U-Boot Image"; 76 + }; 77 + }; 78 + 79 + nand@1,0 { 80 + #address-cells = <1>; 81 + #size-cells = <1>; 82 + compatible = "fsl,p1021-fcm-nand", 83 + "fsl,elbc-fcm-nand"; 84 + reg = <0x1 0x0 0x40000>; 85 + 86 + partition@0 { 87 + /* This location must not be altered */ 88 + /* 1MB for u-boot Bootloader Image */ 89 + reg = <0x0 0x00100000>; 90 + label = "NAND U-Boot Image"; 91 + read-only; 92 + }; 93 + 94 + partition@100000 { 95 + /* 1MB for DTB Image */ 96 + reg = <0x00100000 0x00100000>; 97 + label = "NAND DTB Image"; 98 + }; 99 + 100 + partition@200000 { 101 + /* 4MB for Linux Kernel Image */ 102 + reg = <0x00200000 0x00400000>; 103 + label = "NAND Linux Kernel Image"; 104 + }; 105 + 106 + partition@600000 { 107 + /* 4MB for Compressed Root file System Image */ 108 + reg = <0x00600000 0x00400000>; 109 + label = "NAND Compressed RFS Image"; 110 + }; 111 + 112 + partition@a00000 { 113 + /* 7MB for JFFS2 based Root file System */ 114 + reg = <0x00a00000 0x00700000>; 115 + label = "NAND JFFS2 Root File System"; 116 + }; 117 + 118 + partition@1100000 { 119 + /* 15MB for User Writable Area */ 120 + reg = <0x01100000 0x00f00000>; 121 + label = "NAND Writable User area"; 122 + }; 123 + }; 124 + 125 + L2switch@2,0 { 126 + #address-cells = <1>; 127 + #size-cells = <1>; 128 + compatible = "vitesse-7385"; 129 + reg = <0x2 0x0 0x20000>; 130 + }; 131 + }; 132 + 133 + &soc { 134 + i2c@3000 { 135 + rtc@68 { 136 + compatible = "pericom,pt7c4338"; 137 + reg = <0x68>; 138 + }; 139 + }; 140 + 141 + spi@7000 { 142 + flash@0 { 143 + #address-cells = <1>; 144 + #size-cells = <1>; 145 + compatible = "spansion,s25sl12801"; 146 + reg = <0>; 147 + spi-max-frequency = <40000000>; /* input clock */ 148 + 149 + partition@u-boot { 150 + /* 512KB for u-boot Bootloader Image */ 151 + reg = <0x0 0x00080000>; 152 + label = "SPI Flash U-Boot Image"; 153 + read-only; 154 + }; 155 + 156 + partition@dtb { 157 + /* 512KB for DTB Image */ 158 + reg = <0x00080000 0x00080000>; 159 + label = "SPI Flash DTB Image"; 160 + }; 161 + 162 + partition@kernel { 163 + /* 4MB for Linux Kernel Image */ 164 + reg = <0x00100000 0x00400000>; 165 + label = "SPI Flash Linux Kernel Image"; 166 + }; 167 + 168 + partition@fs { 169 + /* 4MB for Compressed RFS Image */ 170 + reg = <0x00500000 0x00400000>; 171 + label = "SPI Flash Compressed RFSImage"; 172 + }; 173 + 174 + partition@jffs-fs { 175 + /* 7MB for JFFS2 based RFS */ 176 + reg = <0x00900000 0x00700000>; 177 + label = "SPI Flash JFFS2 RFS"; 178 + }; 179 + }; 180 + }; 181 + 182 + usb@22000 { 183 + phy_type = "ulpi"; 184 + }; 185 + 186 + mdio@24000 { 187 + phy0: ethernet-phy@0 { 188 + interrupt-parent = <&mpic>; 189 + interrupts = <3 1 0 0>; 190 + reg = <0x0>; 191 + }; 192 + 193 + phy1: ethernet-phy@1 { 194 + interrupt-parent = <&mpic>; 195 + interrupts = <2 1 0 0>; 196 + reg = <0x1>; 197 + }; 198 + 199 + tbi0: tbi-phy@11 { 200 + reg = <0x11>; 201 + device_type = "tbi-phy"; 202 + }; 203 + }; 204 + 205 + mdio@25000 { 206 + tbi1: tbi-phy@11 { 207 + reg = <0x11>; 208 + device_type = "tbi-phy"; 209 + }; 210 + }; 211 + 212 + mdio@26000 { 213 + tbi2: tbi-phy@11 { 214 + reg = <0x11>; 215 + device_type = "tbi-phy"; 216 + }; 217 + }; 218 + 219 + enet0: ethernet@b0000 { 220 + fixed-link = <1 1 1000 0 0>; 221 + phy-connection-type = "rgmii-id"; 222 + 223 + }; 224 + 225 + enet1: ethernet@b1000 { 226 + phy-handle = <&phy0>; 227 + tbi-handle = <&tbi1>; 228 + phy-connection-type = "sgmii"; 229 + }; 230 + 231 + enet2: ethernet@b2000 { 232 + phy-handle = <&phy1>; 233 + tbi-handle = <&tbi2>; 234 + phy-connection-type = "rgmii-id"; 235 + }; 236 + };
+96
arch/powerpc/boot/dts/p1021rdb-pc_32b.dts
··· 1 + /* 2 + * P1021 RDB Device Tree Source 3 + * 4 + * Copyright 2012 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /include/ "fsl/p1021si-pre.dtsi" 36 + / { 37 + model = "fsl,P1021RDB"; 38 + compatible = "fsl,P1021RDB-PC"; 39 + 40 + memory { 41 + device_type = "memory"; 42 + }; 43 + 44 + lbc: localbus@ffe05000 { 45 + reg = <0 0xffe05000 0 0x1000>; 46 + 47 + /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ 48 + ranges = <0x0 0x0 0x0 0xef000000 0x01000000 49 + 0x1 0x0 0x0 0xff800000 0x00040000 50 + 0x2 0x0 0x0 0xffb00000 0x00020000>; 51 + }; 52 + 53 + soc: soc@ffe00000 { 54 + ranges = <0x0 0x0 0xffe00000 0x100000>; 55 + }; 56 + 57 + pci0: pcie@ffe09000 { 58 + ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 59 + 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 60 + reg = <0 0xffe09000 0 0x1000>; 61 + pcie@0 { 62 + ranges = <0x2000000 0x0 0xa0000000 63 + 0x2000000 0x0 0xa0000000 64 + 0x0 0x20000000 65 + 66 + 0x1000000 0x0 0x0 67 + 0x1000000 0x0 0x0 68 + 0x0 0x100000>; 69 + }; 70 + }; 71 + 72 + pci1: pcie@ffe0a000 { 73 + reg = <0 0xffe0a000 0 0x1000>; 74 + ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 75 + 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 76 + pcie@0 { 77 + ranges = <0x2000000 0x0 0x80000000 78 + 0x2000000 0x0 0x80000000 79 + 0x0 0x20000000 80 + 81 + 0x1000000 0x0 0x0 82 + 0x1000000 0x0 0x0 83 + 0x0 0x100000>; 84 + }; 85 + }; 86 + 87 + qe: qe@ffe80000 { 88 + ranges = <0x0 0x0 0xffe80000 0x40000>; 89 + reg = <0 0xffe80000 0 0x480>; 90 + brg-frequency = <0>; 91 + bus-frequency = <0>; 92 + }; 93 + }; 94 + 95 + /include/ "p1021rdb-pc.dtsi" 96 + /include/ "fsl/p1021si-post.dtsi"
+23 -23
arch/powerpc/boot/dts/p1021rdb.dts arch/powerpc/boot/dts/p1021rdb-pc_36b.dts
··· 1 1 /* 2 - * P1021 RDB Device Tree Source 2 + * P1021 RDB Device Tree Source (36-bit address map) 3 3 * 4 - * Copyright 2011 Freescale Semiconductor Inc. 4 + * Copyright 2012 Freescale Semiconductor Inc. 5 5 * 6 6 * Redistribution and use in source and binary forms, with or without 7 7 * modification, are permitted provided that the following conditions are met: ··· 41 41 device_type = "memory"; 42 42 }; 43 43 44 - lbc: localbus@ffe05000 { 45 - reg = <0 0xffe05000 0 0x1000>; 44 + lbc: localbus@fffe05000 { 45 + reg = <0xf 0xffe05000 0 0x1000>; 46 46 47 47 /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ 48 - ranges = <0x0 0x0 0x0 0xef000000 0x01000000 49 - 0x1 0x0 0x0 0xff800000 0x00040000 50 - 0x2 0x0 0x0 0xffb00000 0x00020000>; 48 + ranges = <0x0 0x0 0xf 0xef000000 0x01000000 49 + 0x1 0x0 0xf 0xff800000 0x00040000 50 + 0x2 0x0 0xf 0xffb00000 0x00020000>; 51 51 }; 52 52 53 - soc: soc@ffe00000 { 54 - ranges = <0x0 0x0 0xffe00000 0x100000>; 53 + soc: soc@fffe00000 { 54 + ranges = <0x0 0xf 0xffe00000 0x100000>; 55 55 }; 56 56 57 - pci0: pcie@ffe09000 { 58 - ranges = <0x2000000 0x0 0xa0000000 0 0xa0000000 0x0 0x20000000 59 - 0x1000000 0x0 0x00000000 0 0xffc10000 0x0 0x10000>; 60 - reg = <0 0xffe09000 0 0x1000>; 57 + pci0: pcie@fffe09000 { 58 + ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000 59 + 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>; 60 + reg = <0xf 0xffe09000 0 0x1000>; 61 61 pcie@0 { 62 62 ranges = <0x2000000 0x0 0xa0000000 63 63 0x2000000 0x0 0xa0000000 ··· 69 69 }; 70 70 }; 71 71 72 - pci1: pcie@ffe0a000 { 73 - reg = <0 0xffe0a000 0 0x1000>; 74 - ranges = <0x2000000 0x0 0x80000000 0 0x80000000 0x0 0x20000000 75 - 0x1000000 0x0 0x00000000 0 0xffc00000 0x0 0x10000>; 72 + pci1: pcie@fffe0a000 { 73 + reg = <0xf 0xffe0a000 0 0x1000>; 74 + ranges = <0x2000000 0x0 0x80000000 0xc 0x00000000 0x0 0x20000000 75 + 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; 76 76 pcie@0 { 77 - ranges = <0x2000000 0x0 0x80000000 78 - 0x2000000 0x0 0x80000000 77 + ranges = <0x2000000 0x0 0xc0000000 78 + 0x2000000 0x0 0xc0000000 79 79 0x0 0x20000000 80 80 81 81 0x1000000 0x0 0x0 ··· 84 84 }; 85 85 }; 86 86 87 - qe: qe@ffe80000 { 88 - ranges = <0x0 0x0 0xffe80000 0x40000>; 89 - reg = <0 0xffe80000 0 0x480>; 87 + qe: qe@fffe80000 { 88 + ranges = <0x0 0xf 0xffe80000 0x40000>; 89 + reg = <0xf 0xffe80000 0 0x480>; 90 90 brg-frequency = <0>; 91 91 bus-frequency = <0>; 92 92 }; 93 93 }; 94 94 95 - /include/ "p1021rdb.dtsi" 95 + /include/ "p1021rdb-pc.dtsi" 96 96 /include/ "fsl/p1021si-post.dtsi"
+45 -53
arch/powerpc/boot/dts/p1021rdb.dtsi arch/powerpc/boot/dts/p1024rdb.dtsi
··· 1 1 /* 2 - * P1021 RDB Device Tree Source stub (no addresses or top-level ranges) 2 + * P1024 RDB Device Tree Source stub (no addresses or top-level ranges) 3 3 * 4 - * Copyright 2011 Freescale Semiconductor Inc. 4 + * Copyright 2012 Freescale Semiconductor Inc. 5 5 * 6 6 * Redistribution and use in source and binary forms, with or without 7 7 * modification, are permitted provided that the following conditions are met: ··· 73 73 /* 512KB for u-boot Environment Variables */ 74 74 reg = <0x00f00000 0x00100000>; 75 75 label = "NOR U-Boot Image"; 76 + read-only; 76 77 }; 77 78 }; 78 79 79 80 nand@1,0 { 80 81 #address-cells = <1>; 81 82 #size-cells = <1>; 82 - compatible = "fsl,p1021-fcm-nand", 83 - "fsl,elbc-fcm-nand"; 83 + compatible = "fsl,p1020-fcm-nand", 84 + "fsl,elbc-fcm-nand"; 84 85 reg = <0x1 0x0 0x40000>; 85 86 86 87 partition@0 { ··· 111 110 }; 112 111 113 112 partition@a00000 { 114 - /* 7MB for JFFS2 based Root file System */ 115 - reg = <0x00a00000 0x00700000>; 113 + /* 15MB for JFFS2 based Root file System */ 114 + reg = <0x00a00000 0x00f00000>; 116 115 label = "NAND JFFS2 Root File System"; 117 116 }; 118 117 119 - partition@1100000 { 120 - /* 15MB for User Writable Area */ 121 - reg = <0x01100000 0x00f00000>; 118 + partition@1900000 { 119 + /* 7MB for User Writable Area */ 120 + reg = <0x01900000 0x00700000>; 122 121 label = "NAND Writable User area"; 123 122 }; 124 - }; 125 - 126 - L2switch@2,0 { 127 - #address-cells = <1>; 128 - #size-cells = <1>; 129 - compatible = "vitesse-7385"; 130 - reg = <0x2 0x0 0x20000>; 131 123 }; 132 124 }; 133 125 134 126 &soc { 135 - i2c@3000 { 136 - rtc@68 { 137 - compatible = "pericom,pt7c4338"; 138 - reg = <0x68>; 139 - }; 140 - }; 141 - 142 127 spi@7000 { 143 128 flash@0 { 144 129 #address-cells = <1>; 145 130 #size-cells = <1>; 146 - compatible = "spansion,s25sl12801"; 131 + compatible = "spansion,m25p80"; 147 132 reg = <0>; 148 - spi-max-frequency = <40000000>; /* input clock */ 133 + spi-max-frequency = <40000000>; 149 134 150 - partition@u-boot { 135 + partition@0 { 151 136 /* 512KB for u-boot Bootloader Image */ 152 137 reg = <0x0 0x00080000>; 153 - label = "SPI Flash U-Boot Image"; 138 + label = "SPI U-Boot Image"; 154 139 read-only; 155 140 }; 156 141 157 - partition@dtb { 142 + partition@80000 { 158 143 /* 512KB for DTB Image */ 159 144 reg = <0x00080000 0x00080000>; 160 - label = "SPI Flash DTB Image"; 145 + label = "SPI DTB Image"; 161 146 }; 162 147 163 - partition@kernel { 148 + partition@100000 { 164 149 /* 4MB for Linux Kernel Image */ 165 150 reg = <0x00100000 0x00400000>; 166 - label = "SPI Flash Linux Kernel Image"; 151 + label = "SPI Linux Kernel Image"; 167 152 }; 168 153 169 - partition@fs { 154 + partition@500000 { 170 155 /* 4MB for Compressed RFS Image */ 171 156 reg = <0x00500000 0x00400000>; 172 - label = "SPI Flash Compressed RFSImage"; 157 + label = "SPI Compressed RFS Image"; 173 158 }; 174 159 175 - partition@jffs-fs { 160 + partition@900000 { 176 161 /* 7MB for JFFS2 based RFS */ 177 162 reg = <0x00900000 0x00700000>; 178 - label = "SPI Flash JFFS2 RFS"; 163 + label = "SPI JFFS2 RFS"; 179 164 }; 165 + }; 166 + }; 167 + 168 + i2c@3000 { 169 + rtc@68 { 170 + compatible = "dallas,ds1339"; 171 + reg = <0x68>; 180 172 }; 181 173 }; 182 174 ··· 177 183 phy_type = "ulpi"; 178 184 }; 179 185 186 + usb@23000 { 187 + status = "disabled"; 188 + }; 189 + 180 190 mdio@24000 { 181 191 phy0: ethernet-phy@0 { 182 - interrupt-parent = <&mpic>; 183 192 interrupts = <3 1 0 0>; 184 193 reg = <0x0>; 185 194 }; 186 - 187 195 phy1: ethernet-phy@1 { 188 - interrupt-parent = <&mpic>; 189 196 interrupts = <2 1 0 0>; 190 197 reg = <0x1>; 191 198 }; 199 + phy2: ethernet-phy@2 { 200 + interrupts = <1 1 0 0>; 201 + reg = <0x2>; 202 + }; 203 + }; 192 204 205 + mdio@25000 { 193 206 tbi0: tbi-phy@11 { 194 207 reg = <0x11>; 195 208 device_type = "tbi-phy"; 196 209 }; 197 210 }; 198 211 199 - mdio@25000 { 212 + mdio@26000 { 200 213 tbi1: tbi-phy@11 { 201 214 reg = <0x11>; 202 215 device_type = "tbi-phy"; 203 216 }; 204 217 }; 205 218 206 - mdio@26000 { 207 - tbi2: tbi-phy@11 { 208 - reg = <0x11>; 209 - device_type = "tbi-phy"; 210 - }; 211 - }; 212 - 213 - enet0: ethernet@b0000 { 214 - fixed-link = <1 1 1000 0 0>; 219 + ethernet@b0000 { 220 + phy-handle = <&phy2>; 215 221 phy-connection-type = "rgmii-id"; 216 - 217 222 }; 218 223 219 - enet1: ethernet@b1000 { 224 + ethernet@b1000 { 220 225 phy-handle = <&phy0>; 221 - tbi-handle = <&tbi1>; 226 + tbi-handle = <&tbi0>; 222 227 phy-connection-type = "sgmii"; 223 228 }; 224 229 225 - enet2: ethernet@b2000 { 230 + ethernet@b2000 { 226 231 phy-handle = <&phy1>; 227 - tbi-handle = <&tbi2>; 228 232 phy-connection-type = "rgmii-id"; 229 233 }; 230 234 };
+20 -57
arch/powerpc/boot/dts/p1021rdb_36b.dts arch/powerpc/boot/dts/fsl/bsc9131si-pre.dtsi
··· 1 1 /* 2 - * P1021 RDB Device Tree Source (36-bit address map) 2 + * BSC9131 Silicon/SoC Device Tree Source (pre include) 3 3 * 4 - * Copyright 2011 Freescale Semiconductor Inc. 4 + * Copyright 2011-2012 Freescale Semiconductor Inc. 5 5 * 6 6 * Redistribution and use in source and binary forms, with or without 7 7 * modification, are permitted provided that the following conditions are met: ··· 20 20 * Foundation, either version 2 of that License or (at your option) any 21 21 * later version. 22 22 * 23 - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor "AS IS" AND ANY 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY ··· 32 32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 33 */ 34 34 35 - /include/ "fsl/p1021si-pre.dtsi" 35 + /dts-v1/; 36 36 / { 37 - model = "fsl,P1021RDB"; 38 - compatible = "fsl,P1021RDB-PC"; 37 + compatible = "fsl,BSC9131"; 38 + #address-cells = <2>; 39 + #size-cells = <2>; 40 + interrupt-parent = <&mpic>; 39 41 40 - memory { 41 - device_type = "memory"; 42 + aliases { 43 + serial0 = &serial0; 44 + ethernet0 = &enet0; 45 + ethernet1 = &enet1; 42 46 }; 43 47 44 - lbc: localbus@fffe05000 { 45 - reg = <0xf 0xffe05000 0 0x1000>; 48 + cpus { 49 + #address-cells = <1>; 50 + #size-cells = <0>; 46 51 47 - /* NOR, NAND Flashes and Vitesse 5 port L2 switch */ 48 - ranges = <0x0 0x0 0xf 0xef000000 0x01000000 49 - 0x1 0x0 0xf 0xff800000 0x00040000 50 - 0x2 0x0 0xf 0xffb00000 0x00020000>; 51 - }; 52 - 53 - soc: soc@fffe00000 { 54 - ranges = <0x0 0xf 0xffe00000 0x100000>; 55 - }; 56 - 57 - pci0: pcie@fffe09000 { 58 - ranges = <0x2000000 0x0 0xc0000000 0xc 0x20000000 0x0 0x20000000 59 - 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>; 60 - reg = <0xf 0xffe09000 0 0x1000>; 61 - pcie@0 { 62 - ranges = <0x2000000 0x0 0xa0000000 63 - 0x2000000 0x0 0xa0000000 64 - 0x0 0x20000000 65 - 66 - 0x1000000 0x0 0x0 67 - 0x1000000 0x0 0x0 68 - 0x0 0x100000>; 52 + PowerPC,BSC9131@0 { 53 + device_type = "cpu"; 54 + compatible = "fsl,e500v2"; 55 + reg = <0x0>; 56 + next-level-cache = <&L2>; 69 57 }; 70 58 }; 71 - 72 - pci1: pcie@fffe0a000 { 73 - reg = <0xf 0xffe0a000 0 0x1000>; 74 - ranges = <0x2000000 0x0 0x80000000 0xc 0x00000000 0x0 0x20000000 75 - 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; 76 - pcie@0 { 77 - ranges = <0x2000000 0x0 0xc0000000 78 - 0x2000000 0x0 0xc0000000 79 - 0x0 0x20000000 80 - 81 - 0x1000000 0x0 0x0 82 - 0x1000000 0x0 0x0 83 - 0x0 0x100000>; 84 - }; 85 - }; 86 - 87 - qe: qe@fffe80000 { 88 - ranges = <0x0 0xf 0xffe80000 0x40000>; 89 - reg = <0xf 0xffe80000 0 0x480>; 90 - brg-frequency = <0>; 91 - bus-frequency = <0>; 92 - }; 93 59 }; 94 - 95 - /include/ "p1021rdb.dtsi" 96 - /include/ "fsl/p1021si-post.dtsi"
+4 -16
arch/powerpc/boot/dts/p1022ds.dtsi
··· 33 33 */ 34 34 35 35 &board_lbc { 36 - /* 37 - * This node is used to access the pixis via "indirect" mode, 38 - * which is done by writing the pixis register index to chip 39 - * select 0 and the value to/from chip select 1. Indirect 40 - * mode is the only way to access the pixis when DIU video 41 - * is enabled. Note that this assumes that the first column 42 - * of the 'ranges' property above is the chip select number. 43 - */ 44 - board-control@0,0 { 45 - compatible = "fsl,p1022ds-indirect-pixis"; 46 - reg = <0x0 0x0 1 /* CS0 */ 47 - 0x1 0x0 1>; /* CS1 */ 48 - interrupt-parent = <&mpic>; 49 - interrupts = <8 0 0 0>; 50 - }; 51 - 52 36 nor@0,0 { 53 37 #address-cells = <1>; 54 38 #size-cells = <1>; ··· 144 160 * clock-frequency will be set by U-Boot if 145 161 * the clock is enabled. 146 162 */ 163 + }; 164 + rtc@68 { 165 + compatible = "dallas,ds1339"; 166 + reg = <0x68>; 147 167 }; 148 168 }; 149 169
+87
arch/powerpc/boot/dts/p1024rdb_32b.dts
··· 1 + /* 2 + * P1024 RDB 32Bit Physical Address Map Device Tree Source 3 + * 4 + * Copyright 2012 Freescale Semiconductor Inc. 5 + * 6 + * Redistribution and use in source and binary forms, with or without 7 + * modification, are permitted provided that the following conditions are met: 8 + * * Redistributions of source code must retain the above copyright 9 + * notice, this list of conditions and the following disclaimer. 10 + * * Redistributions in binary form must reproduce the above copyright 11 + * notice, this list of conditions and the following disclaimer in the 12 + * documentation and/or other materials provided with the distribution. 13 + * * Neither the name of Freescale Semiconductor nor the 14 + * names of its contributors may be used to endorse or promote products 15 + * derived from this software without specific prior written permission. 16 + * 17 + * 18 + * ALTERNATIVELY, this software may be distributed under the terms of the 19 + * GNU General Public License ("GPL") as published by the Free Software 20 + * Foundation, either version 2 of that License or (at your option) any 21 + * later version. 22 + * 23 + * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 + * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 + */ 34 + 35 + /include/ "fsl/p1020si-pre.dtsi" 36 + / { 37 + model = "fsl,P1024RDB"; 38 + compatible = "fsl,P1024RDB"; 39 + 40 + memory { 41 + device_type = "memory"; 42 + }; 43 + 44 + lbc: localbus@ffe05000 { 45 + reg = <0x0 0xffe05000 0 0x1000>; 46 + ranges = <0x0 0x0 0x0 0xef000000 0x01000000 47 + 0x1 0x0 0x0 0xff800000 0x00040000>; 48 + }; 49 + 50 + soc: soc@ffe00000 { 51 + ranges = <0x0 0x0 0xffe00000 0x100000>; 52 + }; 53 + 54 + pci0: pcie@ffe09000 { 55 + reg = <0x0 0xffe09000 0 0x1000>; 56 + ranges = <0x2000000 0x0 0xe0000000 0x0 0xa0000000 0x0 0x20000000 57 + 0x1000000 0x0 0x00000000 0x0 0xffc10000 0x0 0x10000>; 58 + pcie@0 { 59 + ranges = <0x2000000 0x0 0xe0000000 60 + 0x2000000 0x0 0xe0000000 61 + 0x0 0x20000000 62 + 63 + 0x1000000 0x0 0x0 64 + 0x1000000 0x0 0x0 65 + 0x0 0x100000>; 66 + }; 67 + }; 68 + 69 + pci1: pcie@ffe0a000 { 70 + reg = <0x0 0xffe0a000 0 0x1000>; 71 + ranges = <0x2000000 0x0 0xe0000000 0x0 0x80000000 0x0 0x20000000 72 + 0x1000000 0x0 0x00000000 0x0 0xffc00000 0x0 0x10000>; 73 + pcie@0 { 74 + reg = <0x0 0x0 0x0 0x0 0x0>; 75 + ranges = <0x2000000 0x0 0xe0000000 76 + 0x2000000 0x0 0xe0000000 77 + 0x0 0x20000000 78 + 79 + 0x1000000 0x0 0x0 80 + 0x1000000 0x0 0x0 81 + 0x0 0x100000>; 82 + }; 83 + }; 84 + }; 85 + 86 + /include/ "p1024rdb.dtsi" 87 + /include/ "fsl/p1020si-post.dtsi"
+40
arch/powerpc/boot/dts/p1025rdb.dtsi
··· 282 282 0x1 0x4 0x2 0x0 0x2 0x0 /* ENET5_RX_DV_SER5_CTS_B */ 283 283 0x1 0x8 0x2 0x0 0x2 0x0>; /* ENET5_RX_ER_SER5_CD_B */ 284 284 }; 285 + 286 + pio3: ucc_pin@03 { 287 + pio-map = < 288 + /* port pin dir open_drain assignment has_irq */ 289 + 0x0 0x16 0x2 0x0 0x2 0x0 /* SER7_CD_B*/ 290 + 0x0 0x12 0x2 0x0 0x2 0x0 /* SER7_CTS_B*/ 291 + 0x0 0x13 0x1 0x0 0x2 0x0 /* SER7_RTS_B*/ 292 + 0x0 0x14 0x2 0x0 0x2 0x0 /* SER7_RXD0*/ 293 + 0x0 0x15 0x1 0x0 0x2 0x0>; /* SER7_TXD0*/ 294 + }; 295 + 296 + pio4: ucc_pin@04 { 297 + pio-map = < 298 + /* port pin dir open_drain assignment has_irq */ 299 + 0x1 0x0 0x2 0x0 0x2 0x0 /* SER3_CD_B*/ 300 + 0x0 0x1c 0x2 0x0 0x2 0x0 /* SER3_CTS_B*/ 301 + 0x0 0x1d 0x1 0x0 0x2 0x0 /* SER3_RTS_B*/ 302 + 0x0 0x1e 0x2 0x0 0x2 0x0 /* SER3_RXD0*/ 303 + 0x0 0x1f 0x1 0x0 0x2 0x0>; /* SER3_TXD0*/ 304 + }; 305 + }; 306 + }; 307 + 308 + &qe { 309 + serial2: ucc@2600 { 310 + device_type = "serial"; 311 + compatible = "ucc_uart"; 312 + port-number = <0>; 313 + rx-clock-name = "brg6"; 314 + tx-clock-name = "brg6"; 315 + pio-handle = <&pio3>; 316 + }; 317 + 318 + serial3: ucc@2200 { 319 + device_type = "serial"; 320 + compatible = "ucc_uart"; 321 + port-number = <1>; 322 + rx-clock-name = "brg2"; 323 + tx-clock-name = "brg2"; 324 + pio-handle = <&pio4>; 285 325 }; 286 326 };
+10
arch/powerpc/boot/dts/p2020ds.dtsi
··· 150 150 interrupts = <3 1 0 0>; 151 151 reg = <0x2>; 152 152 }; 153 + 154 + sgmii_phy1: sgmii-phy@1 { 155 + interrupts = <5 1 0 0>; 156 + reg = <0x1c>; 157 + }; 158 + sgmii_phy2: sgmii-phy@2 { 159 + interrupts = <5 1 0 0>; 160 + reg = <0x1d>; 161 + }; 162 + 153 163 tbi0: tbi-phy@11 { 154 164 reg = <0x11>; 155 165 device_type = "tbi-phy";
+1 -1
arch/powerpc/boot/dts/p2020rdb.dts
··· 34 34 35 35 /* NOR and NAND Flashes */ 36 36 ranges = <0x0 0x0 0x0 0xef000000 0x01000000 37 - 0x1 0x0 0x0 0xff800000 0x00040000 37 + 0x1 0x0 0x0 0xffa00000 0x00040000 38 38 0x2 0x0 0x0 0xffb00000 0x00020000>; 39 39 40 40 nor@0,0 {
+40 -1
arch/powerpc/boot/dts/p2041rdb.dts
··· 121 121 122 122 lbc: localbus@ffe124000 { 123 123 reg = <0xf 0xfe124000 0 0x1000>; 124 - ranges = <0 0 0xf 0xe8000000 0x08000000>; 124 + ranges = <0 0 0xf 0xe8000000 0x08000000 125 + 1 0 0xf 0xffa00000 0x00040000>; 125 126 126 127 flash@0,0 { 127 128 compatible = "cfi-flash"; 128 129 reg = <0 0 0x08000000>; 129 130 bank-width = <2>; 130 131 device-width = <2>; 132 + }; 133 + 134 + nand@1,0 { 135 + #address-cells = <1>; 136 + #size-cells = <1>; 137 + compatible = "fsl,elbc-fcm-nand"; 138 + reg = <0x1 0x0 0x40000>; 139 + 140 + partition@0 { 141 + label = "NAND U-Boot Image"; 142 + reg = <0x0 0x02000000>; 143 + read-only; 144 + }; 145 + 146 + partition@2000000 { 147 + label = "NAND Root File System"; 148 + reg = <0x02000000 0x10000000>; 149 + }; 150 + 151 + partition@12000000 { 152 + label = "NAND Compressed RFS Image"; 153 + reg = <0x12000000 0x08000000>; 154 + }; 155 + 156 + partition@1a000000 { 157 + label = "NAND Linux Kernel Image"; 158 + reg = <0x1a000000 0x04000000>; 159 + }; 160 + 161 + partition@1e000000 { 162 + label = "NAND DTB Image"; 163 + reg = <0x1e000000 0x01000000>; 164 + }; 165 + 166 + partition@1f000000 { 167 + label = "NAND Writable User area"; 168 + reg = <0x1f000000 0x01000000>; 169 + }; 131 170 }; 132 171 }; 133 172
-242
arch/powerpc/boot/dts/p3060qds.dts
··· 1 - /* 2 - * P3060QDS Device Tree Source 3 - * 4 - * Copyright 2011 Freescale Semiconductor Inc. 5 - * 6 - * Redistribution and use in source and binary forms, with or without 7 - * modification, are permitted provided that the following conditions are met: 8 - * * Redistributions of source code must retain the above copyright 9 - * notice, this list of conditions and the following disclaimer. 10 - * * Redistributions in binary form must reproduce the above copyright 11 - * notice, this list of conditions and the following disclaimer in the 12 - * documentation and/or other materials provided with the distribution. 13 - * * Neither the name of Freescale Semiconductor nor the 14 - * names of its contributors may be used to endorse or promote products 15 - * derived from this software without specific prior written permission. 16 - * 17 - * 18 - * ALTERNATIVELY, this software may be distributed under the terms of the 19 - * GNU General Public License ("GPL") as published by the Free Software 20 - * Foundation, either version 2 of that License or (at your option) any 21 - * later version. 22 - * 23 - * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 24 - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 25 - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 - * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 27 - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 28 - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 30 - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 - */ 34 - 35 - /include/ "fsl/p3060si-pre.dtsi" 36 - 37 - / { 38 - model = "fsl,P3060QDS"; 39 - compatible = "fsl,P3060QDS"; 40 - #address-cells = <2>; 41 - #size-cells = <2>; 42 - interrupt-parent = <&mpic>; 43 - 44 - memory { 45 - device_type = "memory"; 46 - }; 47 - 48 - dcsr: dcsr@f00000000 { 49 - ranges = <0x00000000 0xf 0x00000000 0x01008000>; 50 - }; 51 - 52 - soc: soc@ffe000000 { 53 - ranges = <0x00000000 0xf 0xfe000000 0x1000000>; 54 - reg = <0xf 0xfe000000 0 0x00001000>; 55 - spi@110000 { 56 - flash@0 { 57 - #address-cells = <1>; 58 - #size-cells = <1>; 59 - compatible = "spansion,s25sl12801"; 60 - reg = <0>; 61 - spi-max-frequency = <40000000>; /* input clock */ 62 - partition@u-boot { 63 - label = "u-boot"; 64 - reg = <0x00000000 0x00100000>; 65 - read-only; 66 - }; 67 - partition@kernel { 68 - label = "kernel"; 69 - reg = <0x00100000 0x00500000>; 70 - read-only; 71 - }; 72 - partition@dtb { 73 - label = "dtb"; 74 - reg = <0x00600000 0x00100000>; 75 - read-only; 76 - }; 77 - partition@fs { 78 - label = "file system"; 79 - reg = <0x00700000 0x00900000>; 80 - }; 81 - }; 82 - flash@1 { 83 - #address-cells = <1>; 84 - #size-cells = <1>; 85 - compatible = "spansion,en25q32b"; 86 - reg = <1>; 87 - spi-max-frequency = <40000000>; /* input clock */ 88 - partition@spi1 { 89 - label = "spi1"; 90 - reg = <0x00000000 0x00400000>; 91 - }; 92 - }; 93 - flash@2 { 94 - #address-cells = <1>; 95 - #size-cells = <1>; 96 - compatible = "atmel,at45db081d"; 97 - reg = <2>; 98 - spi-max-frequency = <40000000>; /* input clock */ 99 - partition@spi1 { 100 - label = "spi2"; 101 - reg = <0x00000000 0x00100000>; 102 - }; 103 - }; 104 - flash@3 { 105 - #address-cells = <1>; 106 - #size-cells = <1>; 107 - compatible = "spansion,sst25wf040"; 108 - reg = <3>; 109 - spi-max-frequency = <40000000>; /* input clock */ 110 - partition@spi3 { 111 - label = "spi3"; 112 - reg = <0x00000000 0x00080000>; 113 - }; 114 - }; 115 - }; 116 - 117 - i2c@118000 { 118 - eeprom@51 { 119 - compatible = "at24,24c256"; 120 - reg = <0x51>; 121 - }; 122 - eeprom@53 { 123 - compatible = "at24,24c256"; 124 - reg = <0x53>; 125 - }; 126 - rtc@68 { 127 - compatible = "dallas,ds3232"; 128 - reg = <0x68>; 129 - interrupts = <0x1 0x1 0 0>; 130 - }; 131 - }; 132 - 133 - usb0: usb@210000 { 134 - phy_type = "ulpi"; 135 - }; 136 - 137 - usb1: usb@211000 { 138 - dr_mode = "host"; 139 - phy_type = "ulpi"; 140 - }; 141 - }; 142 - 143 - rio: rapidio@ffe0c0000 { 144 - reg = <0xf 0xfe0c0000 0 0x11000>; 145 - 146 - port1 { 147 - ranges = <0 0 0xc 0x20000000 0 0x10000000>; 148 - }; 149 - port2 { 150 - ranges = <0 0 0xc 0x30000000 0 0x10000000>; 151 - }; 152 - }; 153 - 154 - lbc: localbus@ffe124000 { 155 - reg = <0xf 0xfe124000 0 0x1000>; 156 - ranges = <0 0 0xf 0xe8000000 0x08000000 157 - 2 0 0xf 0xffa00000 0x00040000 158 - 3 0 0xf 0xffdf0000 0x00008000>; 159 - 160 - flash@0,0 { 161 - compatible = "cfi-flash"; 162 - reg = <0 0 0x08000000>; 163 - bank-width = <2>; 164 - device-width = <2>; 165 - }; 166 - 167 - nand@2,0 { 168 - #address-cells = <1>; 169 - #size-cells = <1>; 170 - compatible = "fsl,elbc-fcm-nand"; 171 - reg = <0x2 0x0 0x40000>; 172 - 173 - partition@0 { 174 - label = "NAND U-Boot Image"; 175 - reg = <0x0 0x02000000>; 176 - read-only; 177 - }; 178 - 179 - partition@2000000 { 180 - label = "NAND Root File System"; 181 - reg = <0x02000000 0x10000000>; 182 - }; 183 - 184 - partition@12000000 { 185 - label = "NAND Compressed RFS Image"; 186 - reg = <0x12000000 0x08000000>; 187 - }; 188 - 189 - partition@1a000000 { 190 - label = "NAND Linux Kernel Image"; 191 - reg = <0x1a000000 0x04000000>; 192 - }; 193 - 194 - partition@1e000000 { 195 - label = "NAND DTB Image"; 196 - reg = <0x1e000000 0x01000000>; 197 - }; 198 - 199 - partition@1f000000 { 200 - label = "NAND Writable User area"; 201 - reg = <0x1f000000 0x21000000>; 202 - }; 203 - }; 204 - 205 - board-control@3,0 { 206 - compatible = "fsl,p3060qds-fpga", "fsl,fpga-qixis"; 207 - reg = <3 0 0x100>; 208 - }; 209 - }; 210 - 211 - pci0: pcie@ffe200000 { 212 - reg = <0xf 0xfe200000 0 0x1000>; 213 - ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 214 - 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; 215 - pcie@0 { 216 - ranges = <0x02000000 0 0xe0000000 217 - 0x02000000 0 0xe0000000 218 - 0 0x20000000 219 - 220 - 0x01000000 0 0x00000000 221 - 0x01000000 0 0x00000000 222 - 0 0x00010000>; 223 - }; 224 - }; 225 - 226 - pci1: pcie@ffe201000 { 227 - reg = <0xf 0xfe201000 0 0x1000>; 228 - ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 229 - 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; 230 - pcie@0 { 231 - ranges = <0x02000000 0 0xe0000000 232 - 0x02000000 0 0xe0000000 233 - 0 0x20000000 234 - 235 - 0x01000000 0 0x00000000 236 - 0x01000000 0 0x00000000 237 - 0 0x00010000>; 238 - }; 239 - }; 240 - }; 241 - 242 - /include/ "fsl/p3060si-post.dtsi"
-406
arch/powerpc/boot/dts/sbc8560.dts
··· 1 - /* 2 - * SBC8560 Device Tree Source 3 - * 4 - * Copyright 2007 Wind River Systems Inc. 5 - * 6 - * Paul Gortmaker (see MAINTAINERS for contact information) 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 - /dts-v1/; 15 - 16 - / { 17 - model = "SBC8560"; 18 - compatible = "SBC8560"; 19 - #address-cells = <1>; 20 - #size-cells = <1>; 21 - 22 - aliases { 23 - ethernet0 = &enet0; 24 - ethernet1 = &enet1; 25 - ethernet2 = &enet2; 26 - ethernet3 = &enet3; 27 - serial0 = &serial0; 28 - serial1 = &serial1; 29 - pci0 = &pci0; 30 - }; 31 - 32 - cpus { 33 - #address-cells = <1>; 34 - #size-cells = <0>; 35 - 36 - PowerPC,8560@0 { 37 - device_type = "cpu"; 38 - reg = <0>; 39 - d-cache-line-size = <0x20>; // 32 bytes 40 - i-cache-line-size = <0x20>; // 32 bytes 41 - d-cache-size = <0x8000>; // L1, 32K 42 - i-cache-size = <0x8000>; // L1, 32K 43 - timebase-frequency = <0>; // From uboot 44 - bus-frequency = <0>; 45 - clock-frequency = <0>; 46 - next-level-cache = <&L2>; 47 - }; 48 - }; 49 - 50 - memory { 51 - device_type = "memory"; 52 - reg = <0x00000000 0x20000000>; 53 - }; 54 - 55 - soc@ff700000 { 56 - #address-cells = <1>; 57 - #size-cells = <1>; 58 - device_type = "soc"; 59 - ranges = <0x0 0xff700000 0x00100000>; 60 - clock-frequency = <0>; 61 - 62 - ecm-law@0 { 63 - compatible = "fsl,ecm-law"; 64 - reg = <0x0 0x1000>; 65 - fsl,num-laws = <8>; 66 - }; 67 - 68 - ecm@1000 { 69 - compatible = "fsl,mpc8560-ecm", "fsl,ecm"; 70 - reg = <0x1000 0x1000>; 71 - interrupts = <17 2>; 72 - interrupt-parent = <&mpic>; 73 - }; 74 - 75 - memory-controller@2000 { 76 - compatible = "fsl,mpc8560-memory-controller"; 77 - reg = <0x2000 0x1000>; 78 - interrupt-parent = <&mpic>; 79 - interrupts = <0x12 0x2>; 80 - }; 81 - 82 - L2: l2-cache-controller@20000 { 83 - compatible = "fsl,mpc8560-l2-cache-controller"; 84 - reg = <0x20000 0x1000>; 85 - cache-line-size = <0x20>; // 32 bytes 86 - cache-size = <0x40000>; // L2, 256K 87 - interrupt-parent = <&mpic>; 88 - interrupts = <0x10 0x2>; 89 - }; 90 - 91 - i2c@3000 { 92 - #address-cells = <1>; 93 - #size-cells = <0>; 94 - cell-index = <0>; 95 - compatible = "fsl-i2c"; 96 - reg = <0x3000 0x100>; 97 - interrupts = <0x2b 0x2>; 98 - interrupt-parent = <&mpic>; 99 - dfsrr; 100 - }; 101 - 102 - i2c@3100 { 103 - #address-cells = <1>; 104 - #size-cells = <0>; 105 - cell-index = <1>; 106 - compatible = "fsl-i2c"; 107 - reg = <0x3100 0x100>; 108 - interrupts = <0x2b 0x2>; 109 - interrupt-parent = <&mpic>; 110 - dfsrr; 111 - }; 112 - 113 - dma@21300 { 114 - #address-cells = <1>; 115 - #size-cells = <1>; 116 - compatible = "fsl,mpc8560-dma", "fsl,eloplus-dma"; 117 - reg = <0x21300 0x4>; 118 - ranges = <0x0 0x21100 0x200>; 119 - cell-index = <0>; 120 - dma-channel@0 { 121 - compatible = "fsl,mpc8560-dma-channel", 122 - "fsl,eloplus-dma-channel"; 123 - reg = <0x0 0x80>; 124 - cell-index = <0>; 125 - interrupt-parent = <&mpic>; 126 - interrupts = <20 2>; 127 - }; 128 - dma-channel@80 { 129 - compatible = "fsl,mpc8560-dma-channel", 130 - "fsl,eloplus-dma-channel"; 131 - reg = <0x80 0x80>; 132 - cell-index = <1>; 133 - interrupt-parent = <&mpic>; 134 - interrupts = <21 2>; 135 - }; 136 - dma-channel@100 { 137 - compatible = "fsl,mpc8560-dma-channel", 138 - "fsl,eloplus-dma-channel"; 139 - reg = <0x100 0x80>; 140 - cell-index = <2>; 141 - interrupt-parent = <&mpic>; 142 - interrupts = <22 2>; 143 - }; 144 - dma-channel@180 { 145 - compatible = "fsl,mpc8560-dma-channel", 146 - "fsl,eloplus-dma-channel"; 147 - reg = <0x180 0x80>; 148 - cell-index = <3>; 149 - interrupt-parent = <&mpic>; 150 - interrupts = <23 2>; 151 - }; 152 - }; 153 - 154 - enet0: ethernet@24000 { 155 - #address-cells = <1>; 156 - #size-cells = <1>; 157 - cell-index = <0>; 158 - device_type = "network"; 159 - model = "TSEC"; 160 - compatible = "gianfar"; 161 - reg = <0x24000 0x1000>; 162 - ranges = <0x0 0x24000 0x1000>; 163 - local-mac-address = [ 00 00 00 00 00 00 ]; 164 - interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>; 165 - interrupt-parent = <&mpic>; 166 - tbi-handle = <&tbi0>; 167 - phy-handle = <&phy0>; 168 - 169 - mdio@520 { 170 - #address-cells = <1>; 171 - #size-cells = <0>; 172 - compatible = "fsl,gianfar-mdio"; 173 - reg = <0x520 0x20>; 174 - phy0: ethernet-phy@19 { 175 - interrupt-parent = <&mpic>; 176 - interrupts = <0x6 0x1>; 177 - reg = <0x19>; 178 - device_type = "ethernet-phy"; 179 - }; 180 - phy1: ethernet-phy@1a { 181 - interrupt-parent = <&mpic>; 182 - interrupts = <0x7 0x1>; 183 - reg = <0x1a>; 184 - device_type = "ethernet-phy"; 185 - }; 186 - phy2: ethernet-phy@1b { 187 - interrupt-parent = <&mpic>; 188 - interrupts = <0x8 0x1>; 189 - reg = <0x1b>; 190 - device_type = "ethernet-phy"; 191 - }; 192 - phy3: ethernet-phy@1c { 193 - interrupt-parent = <&mpic>; 194 - interrupts = <0x8 0x1>; 195 - reg = <0x1c>; 196 - device_type = "ethernet-phy"; 197 - }; 198 - tbi0: tbi-phy@11 { 199 - reg = <0x11>; 200 - device_type = "tbi-phy"; 201 - }; 202 - }; 203 - }; 204 - 205 - enet1: ethernet@25000 { 206 - #address-cells = <1>; 207 - #size-cells = <1>; 208 - cell-index = <1>; 209 - device_type = "network"; 210 - model = "TSEC"; 211 - compatible = "gianfar"; 212 - reg = <0x25000 0x1000>; 213 - ranges = <0x0 0x25000 0x1000>; 214 - local-mac-address = [ 00 00 00 00 00 00 ]; 215 - interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>; 216 - interrupt-parent = <&mpic>; 217 - tbi-handle = <&tbi1>; 218 - phy-handle = <&phy1>; 219 - 220 - mdio@520 { 221 - #address-cells = <1>; 222 - #size-cells = <0>; 223 - compatible = "fsl,gianfar-tbi"; 224 - reg = <0x520 0x20>; 225 - 226 - tbi1: tbi-phy@11 { 227 - reg = <0x11>; 228 - device_type = "tbi-phy"; 229 - }; 230 - }; 231 - }; 232 - 233 - mpic: pic@40000 { 234 - interrupt-controller; 235 - #address-cells = <0>; 236 - #interrupt-cells = <2>; 237 - compatible = "chrp,open-pic"; 238 - reg = <0x40000 0x40000>; 239 - device_type = "open-pic"; 240 - }; 241 - 242 - cpm@919c0 { 243 - #address-cells = <1>; 244 - #size-cells = <1>; 245 - compatible = "fsl,mpc8560-cpm", "fsl,cpm2"; 246 - reg = <0x919c0 0x30>; 247 - ranges; 248 - 249 - muram@80000 { 250 - #address-cells = <1>; 251 - #size-cells = <1>; 252 - ranges = <0x0 0x80000 0x10000>; 253 - 254 - data@0 { 255 - compatible = "fsl,cpm-muram-data"; 256 - reg = <0x0 0x4000 0x9000 0x2000>; 257 - }; 258 - }; 259 - 260 - brg@919f0 { 261 - compatible = "fsl,mpc8560-brg", 262 - "fsl,cpm2-brg", 263 - "fsl,cpm-brg"; 264 - reg = <0x919f0 0x10 0x915f0 0x10>; 265 - clock-frequency = <165000000>; 266 - }; 267 - 268 - cpmpic: pic@90c00 { 269 - interrupt-controller; 270 - #address-cells = <0>; 271 - #interrupt-cells = <2>; 272 - interrupts = <0x2e 0x2>; 273 - interrupt-parent = <&mpic>; 274 - reg = <0x90c00 0x80>; 275 - compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic"; 276 - }; 277 - 278 - enet2: ethernet@91320 { 279 - device_type = "network"; 280 - compatible = "fsl,mpc8560-fcc-enet", 281 - "fsl,cpm2-fcc-enet"; 282 - reg = <0x91320 0x20 0x88500 0x100 0x913b0 0x1>; 283 - local-mac-address = [ 00 00 00 00 00 00 ]; 284 - fsl,cpm-command = <0x16200300>; 285 - interrupts = <0x21 0x8>; 286 - interrupt-parent = <&cpmpic>; 287 - phy-handle = <&phy2>; 288 - }; 289 - 290 - enet3: ethernet@91340 { 291 - device_type = "network"; 292 - compatible = "fsl,mpc8560-fcc-enet", 293 - "fsl,cpm2-fcc-enet"; 294 - reg = <0x91340 0x20 0x88600 0x100 0x913d0 0x1>; 295 - local-mac-address = [ 00 00 00 00 00 00 ]; 296 - fsl,cpm-command = <0x1a400300>; 297 - interrupts = <0x22 0x8>; 298 - interrupt-parent = <&cpmpic>; 299 - phy-handle = <&phy3>; 300 - }; 301 - }; 302 - 303 - global-utilities@e0000 { 304 - compatible = "fsl,mpc8560-guts"; 305 - reg = <0xe0000 0x1000>; 306 - }; 307 - }; 308 - 309 - pci0: pci@ff708000 { 310 - #interrupt-cells = <1>; 311 - #size-cells = <2>; 312 - #address-cells = <3>; 313 - compatible = "fsl,mpc8540-pcix", "fsl,mpc8540-pci"; 314 - device_type = "pci"; 315 - reg = <0xff708000 0x1000>; 316 - clock-frequency = <66666666>; 317 - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 318 - interrupt-map = < 319 - 320 - /* IDSEL 0x02 */ 321 - 0x1000 0x0 0x0 0x1 &mpic 0x2 0x1 322 - 0x1000 0x0 0x0 0x2 &mpic 0x3 0x1 323 - 0x1000 0x0 0x0 0x3 &mpic 0x4 0x1 324 - 0x1000 0x0 0x0 0x4 &mpic 0x5 0x1>; 325 - 326 - interrupt-parent = <&mpic>; 327 - interrupts = <0x18 0x2>; 328 - bus-range = <0x0 0x0>; 329 - ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000 330 - 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 331 - }; 332 - 333 - localbus@ff705000 { 334 - compatible = "fsl,mpc8560-localbus", "simple-bus"; 335 - #address-cells = <2>; 336 - #size-cells = <1>; 337 - reg = <0xff705000 0x100>; // BRx, ORx, etc. 338 - 339 - ranges = < 340 - 0x0 0x0 0xff800000 0x0800000 // 8MB boot flash 341 - 0x1 0x0 0xe4000000 0x4000000 // 64MB flash 342 - 0x3 0x0 0x20000000 0x4000000 // 64MB SDRAM 343 - 0x4 0x0 0x24000000 0x4000000 // 64MB SDRAM 344 - 0x5 0x0 0xfc000000 0x0c00000 // EPLD 345 - 0x6 0x0 0xe0000000 0x4000000 // 64MB flash 346 - 0x7 0x0 0x80000000 0x0200000 // ATM1,2 347 - >; 348 - 349 - epld@5,0 { 350 - compatible = "wrs,epld-localbus"; 351 - #address-cells = <2>; 352 - #size-cells = <1>; 353 - reg = <0x5 0x0 0xc00000>; 354 - ranges = < 355 - 0x0 0x0 0x5 0x000000 0x1fff // LED disp. 356 - 0x1 0x0 0x5 0x100000 0x1fff // switches 357 - 0x2 0x0 0x5 0x200000 0x1fff // ID reg. 358 - 0x3 0x0 0x5 0x300000 0x1fff // status reg. 359 - 0x4 0x0 0x5 0x400000 0x1fff // reset reg. 360 - 0x5 0x0 0x5 0x500000 0x1fff // Wind port 361 - 0x7 0x0 0x5 0x700000 0x1fff // UART #1 362 - 0x8 0x0 0x5 0x800000 0x1fff // UART #2 363 - 0x9 0x0 0x5 0x900000 0x1fff // RTC 364 - 0xb 0x0 0x5 0xb00000 0x1fff // EEPROM 365 - >; 366 - 367 - bidr@2,0 { 368 - compatible = "wrs,sbc8560-bidr"; 369 - reg = <0x2 0x0 0x10>; 370 - }; 371 - 372 - bcsr@3,0 { 373 - compatible = "wrs,sbc8560-bcsr"; 374 - reg = <0x3 0x0 0x10>; 375 - }; 376 - 377 - brstcr@4,0 { 378 - compatible = "wrs,sbc8560-brstcr"; 379 - reg = <0x4 0x0 0x10>; 380 - }; 381 - 382 - serial0: serial@7,0 { 383 - device_type = "serial"; 384 - compatible = "ns16550"; 385 - reg = <0x7 0x0 0x100>; 386 - clock-frequency = <1843200>; 387 - interrupts = <0x9 0x2>; 388 - interrupt-parent = <&mpic>; 389 - }; 390 - 391 - serial1: serial@8,0 { 392 - device_type = "serial"; 393 - compatible = "ns16550"; 394 - reg = <0x8 0x0 0x100>; 395 - clock-frequency = <1843200>; 396 - interrupts = <0xa 0x2>; 397 - interrupt-parent = <&mpic>; 398 - }; 399 - 400 - rtc@9,0 { 401 - compatible = "m48t59"; 402 - reg = <0x9 0x0 0x1fff>; 403 - }; 404 - }; 405 - }; 406 - };
-27
arch/powerpc/boot/flatdevtree_env.h
··· 1 - /* 2 - * This file adds the header file glue so that the shared files 3 - * flatdevicetree.[ch] can compile and work in the powerpc bootwrapper. 4 - * 5 - * strncmp & strchr copied from <file:lib/string.c> 6 - * Copyright (C) 1991, 1992 Linus Torvalds 7 - * 8 - * Maintained by: Mark A. Greer <mgreer@mvista.com> 9 - */ 10 - #ifndef _PPC_BOOT_FLATDEVTREE_ENV_H_ 11 - #define _PPC_BOOT_FLATDEVTREE_ENV_H_ 12 - 13 - #include <stdarg.h> 14 - #include <stddef.h> 15 - #include "types.h" 16 - #include "string.h" 17 - #include "stdio.h" 18 - #include "ops.h" 19 - 20 - #define be16_to_cpu(x) (x) 21 - #define cpu_to_be16(x) (x) 22 - #define be32_to_cpu(x) (x) 23 - #define cpu_to_be32(x) (x) 24 - #define be64_to_cpu(x) (x) 25 - #define cpu_to_be64(x) (x) 26 - 27 - #endif /* _PPC_BOOT_FLATDEVTREE_ENV_H_ */
+8 -14
arch/powerpc/configs/83xx/kmeter1_defconfig
··· 2 2 # CONFIG_SWAP is not set 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_POSIX_MQUEUE=y 5 - CONFIG_SPARSE_IRQ=y 6 5 CONFIG_LOG_BUF_SHIFT=14 7 6 CONFIG_EXPERT=y 8 - # CONFIG_HOTPLUG is not set 9 7 CONFIG_SLAB=y 10 8 CONFIG_MODULES=y 11 9 CONFIG_MODULE_UNLOAD=y 12 10 # CONFIG_BLK_DEV_BSG is not set 11 + CONFIG_PARTITION_ADVANCED=y 12 + # CONFIG_MSDOS_PARTITION is not set 13 13 # CONFIG_IOSCHED_DEADLINE is not set 14 14 # CONFIG_IOSCHED_CFQ is not set 15 15 # CONFIG_PPC_CHRP is not set ··· 31 31 # CONFIG_INET_XFRM_MODE_BEET is not set 32 32 # CONFIG_INET_LRO is not set 33 33 # CONFIG_IPV6 is not set 34 + CONFIG_TIPC=y 34 35 CONFIG_BRIDGE=m 35 36 CONFIG_VLAN_8021Q=y 36 37 CONFIG_MTD=y 37 - CONFIG_MTD_CONCAT=y 38 - CONFIG_MTD_PARTITIONS=y 39 38 CONFIG_MTD_CMDLINE_PARTS=y 40 39 CONFIG_MTD_CHAR=y 41 40 CONFIG_MTD_BLOCK=y ··· 49 50 CONFIG_PROC_DEVICETREE=y 50 51 CONFIG_NETDEVICES=y 51 52 CONFIG_DUMMY=y 52 - CONFIG_TUN=y 53 53 CONFIG_MII=y 54 - CONFIG_MARVELL_PHY=y 55 - CONFIG_NET_ETHERNET=y 54 + CONFIG_TUN=y 56 55 CONFIG_UCC_GETH=y 57 - # CONFIG_NETDEV_10000 is not set 58 - CONFIG_WAN=y 59 - CONFIG_HDLC=y 56 + CONFIG_MARVELL_PHY=y 60 57 CONFIG_PPP=y 61 58 CONFIG_PPP_MULTILINK=y 62 59 CONFIG_PPPOE=y 60 + CONFIG_WAN=y 61 + CONFIG_HDLC=y 63 62 # CONFIG_INPUT is not set 64 63 # CONFIG_SERIO is not set 65 64 # CONFIG_VT is not set ··· 74 77 # CONFIG_DNOTIFY is not set 75 78 CONFIG_TMPFS=y 76 79 CONFIG_JFFS2_FS=y 80 + CONFIG_UBIFS_FS=y 77 81 CONFIG_NFS_FS=y 78 82 CONFIG_NFS_V3=y 79 83 CONFIG_ROOT_NFS=y 80 - CONFIG_PARTITION_ADVANCED=y 81 - # CONFIG_MSDOS_PARTITION is not set 82 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 83 - CONFIG_SYSCTL_SYSCALL_CHECK=y
-65
arch/powerpc/configs/85xx/sbc8560_defconfig
··· 1 - CONFIG_PPC_85xx=y 2 - CONFIG_EXPERIMENTAL=y 3 - CONFIG_SYSVIPC=y 4 - CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_BLK_DEV_INITRD=y 6 - # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 7 - CONFIG_EXPERT=y 8 - CONFIG_SLAB=y 9 - # CONFIG_BLK_DEV_BSG is not set 10 - CONFIG_SBC8560=y 11 - CONFIG_BINFMT_MISC=y 12 - CONFIG_SPARSE_IRQ=y 13 - # CONFIG_SECCOMP is not set 14 - CONFIG_NET=y 15 - CONFIG_PACKET=y 16 - CONFIG_UNIX=y 17 - CONFIG_XFRM_USER=y 18 - CONFIG_INET=y 19 - CONFIG_IP_MULTICAST=y 20 - CONFIG_IP_PNP=y 21 - CONFIG_IP_PNP_DHCP=y 22 - CONFIG_IP_PNP_BOOTP=y 23 - CONFIG_SYN_COOKIES=y 24 - # CONFIG_INET_LRO is not set 25 - # CONFIG_IPV6 is not set 26 - CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 27 - # CONFIG_FW_LOADER is not set 28 - CONFIG_PROC_DEVICETREE=y 29 - CONFIG_BLK_DEV_LOOP=y 30 - CONFIG_BLK_DEV_RAM=y 31 - CONFIG_BLK_DEV_RAM_SIZE=32768 32 - CONFIG_NETDEVICES=y 33 - CONFIG_BROADCOM_PHY=y 34 - CONFIG_NET_ETHERNET=y 35 - CONFIG_MII=y 36 - CONFIG_GIANFAR=y 37 - # CONFIG_INPUT_MOUSEDEV is not set 38 - # CONFIG_INPUT_KEYBOARD is not set 39 - # CONFIG_INPUT_MOUSE is not set 40 - # CONFIG_SERIO is not set 41 - # CONFIG_VT is not set 42 - CONFIG_SERIAL_8250=y 43 - CONFIG_SERIAL_8250_CONSOLE=y 44 - CONFIG_SERIAL_8250_NR_UARTS=2 45 - CONFIG_SERIAL_8250_RUNTIME_UARTS=2 46 - # CONFIG_HW_RANDOM is not set 47 - CONFIG_VIDEO_OUTPUT_CONTROL=y 48 - CONFIG_RTC_CLASS=y 49 - CONFIG_RTC_DRV_M48T59=y 50 - CONFIG_INOTIFY=y 51 - CONFIG_PROC_KCORE=y 52 - CONFIG_TMPFS=y 53 - CONFIG_NFS_FS=y 54 - CONFIG_ROOT_NFS=y 55 - CONFIG_PARTITION_ADVANCED=y 56 - # CONFIG_MSDOS_PARTITION is not set 57 - CONFIG_MAGIC_SYSRQ=y 58 - CONFIG_DEBUG_KERNEL=y 59 - CONFIG_DETECT_HUNG_TASK=y 60 - CONFIG_DEBUG_MUTEXES=y 61 - # CONFIG_DEBUG_BUGVERBOSE is not set 62 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 63 - CONFIG_SYSCTL_SYSCALL_CHECK=y 64 - CONFIG_PPC_EARLY_DEBUG=y 65 - # CONFIG_CRYPTO_ANSI_CPRNG is not set
+9 -1
arch/powerpc/configs/corenet32_smp_defconfig
··· 23 23 # CONFIG_BLK_DEV_BSG is not set 24 24 CONFIG_P2041_RDB=y 25 25 CONFIG_P3041_DS=y 26 - CONFIG_P3060_QDS=y 27 26 CONFIG_P4080_DS=y 28 27 CONFIG_P5020_DS=y 29 28 CONFIG_HIGHMEM=y ··· 31 32 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 32 33 CONFIG_BINFMT_MISC=m 33 34 CONFIG_KEXEC=y 35 + CONFIG_IRQ_ALL_CPUS=y 34 36 CONFIG_FORCE_MAX_ZONEORDER=13 35 37 CONFIG_FSL_LBC=y 36 38 CONFIG_PCI=y 37 39 CONFIG_PCIEPORTBUS=y 40 + CONFIG_PCI_MSI=y 38 41 # CONFIG_PCIEASPM is not set 39 42 CONFIG_RAPIDIO=y 40 43 CONFIG_FSL_RIO=y ··· 77 76 CONFIG_MTD_CFI=y 78 77 CONFIG_MTD_CFI_AMDSTD=y 79 78 CONFIG_MTD_PHYSMAP_OF=y 79 + CONFIG_MTD_NAND=y 80 + CONFIG_MTD_NAND_ECC=y 81 + CONFIG_MTD_NAND_IDS=y 82 + CONFIG_MTD_NAND_FSL_IFC=y 83 + CONFIG_MTD_NAND_FSL_ELBC=y 80 84 CONFIG_MTD_M25P80=y 81 85 CONFIG_PROC_DEVICETREE=y 82 86 CONFIG_BLK_DEV_LOOP=y ··· 142 136 CONFIG_USB_STORAGE=y 143 137 CONFIG_MMC=y 144 138 CONFIG_MMC_SDHCI=y 139 + CONFIG_MMC_SDHCI_OF=y 140 + CONFIG_MMC_SDHCI_OF_ESDHC=y 145 141 CONFIG_EDAC=y 146 142 CONFIG_EDAC_MM_EDAC=y 147 143 CONFIG_EDAC_MPC85XX=y
+52 -14
arch/powerpc/configs/corenet64_smp_defconfig
··· 6 6 CONFIG_EXPERIMENTAL=y 7 7 CONFIG_SYSVIPC=y 8 8 CONFIG_BSD_PROCESS_ACCT=y 9 - CONFIG_SPARSE_IRQ=y 9 + CONFIG_IRQ_DOMAIN_DEBUG=y 10 + CONFIG_NO_HZ=y 11 + CONFIG_HIGH_RES_TIMERS=y 10 12 CONFIG_IKCONFIG=y 11 13 CONFIG_IKCONFIG_PROC=y 12 14 CONFIG_LOG_BUF_SHIFT=14 ··· 20 18 CONFIG_MODULE_FORCE_UNLOAD=y 21 19 CONFIG_MODVERSIONS=y 22 20 # CONFIG_BLK_DEV_BSG is not set 21 + CONFIG_PARTITION_ADVANCED=y 22 + CONFIG_MAC_PARTITION=y 23 23 CONFIG_P5020_DS=y 24 24 # CONFIG_PPC_OF_BOOT_TRAMPOLINE is not set 25 - CONFIG_NO_HZ=y 26 - CONFIG_HIGH_RES_TIMERS=y 27 25 CONFIG_BINFMT_MISC=m 26 + CONFIG_IRQ_ALL_CPUS=y 27 + CONFIG_PCIEPORTBUS=y 28 + CONFIG_PCI_MSI=y 28 29 CONFIG_RAPIDIO=y 29 30 CONFIG_FSL_RIO=y 30 31 CONFIG_NET=y ··· 56 51 CONFIG_IPV6=y 57 52 CONFIG_IP_SCTP=m 58 53 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 54 + CONFIG_MTD=y 55 + CONFIG_MTD_CMDLINE_PARTS=y 56 + CONFIG_MTD_CHAR=y 57 + CONFIG_MTD_BLOCK=y 58 + CONFIG_MTD_CFI=y 59 + CONFIG_MTD_CFI_AMDSTD=y 60 + CONFIG_MTD_PHYSMAP_OF=y 61 + CONFIG_MTD_M25P80=y 62 + CONFIG_MTD_NAND=y 63 + CONFIG_MTD_NAND_FSL_ELBC=y 64 + CONFIG_MTD_NAND_FSL_IFC=y 59 65 CONFIG_PROC_DEVICETREE=y 60 66 CONFIG_BLK_DEV_LOOP=y 61 67 CONFIG_BLK_DEV_RAM=y 62 68 CONFIG_BLK_DEV_RAM_SIZE=131072 63 - CONFIG_MISC_DEVICES=y 64 69 CONFIG_EEPROM_LEGACY=y 70 + CONFIG_ATA=y 71 + CONFIG_SATA_FSL=y 72 + CONFIG_SATA_SIL24=y 65 73 CONFIG_NETDEVICES=y 66 74 CONFIG_DUMMY=y 67 75 CONFIG_INPUT_FF_MEMLESS=m ··· 84 66 CONFIG_SERIO_LIBPS2=y 85 67 CONFIG_SERIAL_8250=y 86 68 CONFIG_SERIAL_8250_CONSOLE=y 87 - CONFIG_SERIAL_8250_EXTENDED=y 88 69 CONFIG_SERIAL_8250_MANY_PORTS=y 89 70 CONFIG_SERIAL_8250_DETECT_IRQ=y 90 71 CONFIG_SERIAL_8250_RSA=y 91 72 CONFIG_I2C=y 92 73 CONFIG_I2C_CHARDEV=y 93 74 CONFIG_I2C_MPC=y 75 + CONFIG_SPI=y 76 + CONFIG_SPI_GPIO=y 77 + CONFIG_SPI_FSL_SPI=y 78 + CONFIG_SPI_FSL_ESPI=y 94 79 # CONFIG_HWMON is not set 95 80 CONFIG_VIDEO_OUTPUT_CONTROL=y 96 - # CONFIG_HID_SUPPORT is not set 97 - # CONFIG_USB_SUPPORT is not set 81 + CONFIG_USB_HID=m 82 + CONFIG_USB=y 83 + CONFIG_USB_MON=y 84 + CONFIG_USB_EHCI_HCD=y 85 + CONFIG_USB_EHCI_FSL=y 86 + CONFIG_USB_STORAGE=y 87 + CONFIG_MMC=y 88 + CONFIG_MMC_SDHCI=y 89 + CONFIG_EDAC=y 90 + CONFIG_EDAC_MM_EDAC=y 98 91 CONFIG_DMADEVICES=y 99 92 CONFIG_FSL_DMA=y 100 93 CONFIG_EXT2_FS=y 101 94 CONFIG_EXT3_FS=y 102 - # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set 95 + CONFIG_ISO9660_FS=m 96 + CONFIG_JOLIET=y 97 + CONFIG_ZISOFS=y 98 + CONFIG_UDF_FS=m 99 + CONFIG_MSDOS_FS=m 100 + CONFIG_VFAT_FS=y 101 + CONFIG_NTFS_FS=y 103 102 CONFIG_PROC_KCORE=y 104 103 CONFIG_TMPFS=y 105 104 CONFIG_HUGETLBFS=y 106 105 # CONFIG_MISC_FILESYSTEMS is not set 107 - CONFIG_PARTITION_ADVANCED=y 108 - CONFIG_MAC_PARTITION=y 109 - CONFIG_NLS=y 106 + CONFIG_NFS_FS=y 107 + CONFIG_NFS_V4=y 108 + CONFIG_ROOT_NFS=y 109 + CONFIG_NFSD=m 110 + CONFIG_NLS_ISO8859_1=y 110 111 CONFIG_NLS_UTF8=m 111 112 CONFIG_CRC_T10DIF=y 112 - CONFIG_CRC_ITU_T=m 113 113 CONFIG_FRAME_WARN=1024 114 + CONFIG_MAGIC_SYSRQ=y 114 115 CONFIG_DEBUG_FS=y 116 + CONFIG_DEBUG_SHIRQ=y 115 117 CONFIG_DETECT_HUNG_TASK=y 116 118 CONFIG_DEBUG_INFO=y 117 - CONFIG_SYSCTL_SYSCALL_CHECK=y 118 - CONFIG_IRQ_DOMAIN_DEBUG=y 119 + CONFIG_CRYPTO_NULL=y 119 120 CONFIG_CRYPTO_PCBC=m 121 + CONFIG_CRYPTO_MD4=y 120 122 CONFIG_CRYPTO_SHA256=y 121 123 CONFIG_CRYPTO_SHA512=y 122 124 CONFIG_CRYPTO_AES=y
+4 -8
arch/powerpc/configs/mgcoge_defconfig
··· 2 2 # CONFIG_SWAP is not set 3 3 CONFIG_SYSVIPC=y 4 4 CONFIG_POSIX_MQUEUE=y 5 - CONFIG_SPARSE_IRQ=y 6 5 CONFIG_IKCONFIG=y 7 6 CONFIG_IKCONFIG_PROC=y 8 7 CONFIG_LOG_BUF_SHIFT=14 ··· 11 12 # CONFIG_PCSPKR_PLATFORM is not set 12 13 CONFIG_EMBEDDED=y 13 14 CONFIG_SLAB=y 15 + CONFIG_PARTITION_ADVANCED=y 14 16 # CONFIG_IOSCHED_CFQ is not set 15 17 # CONFIG_PPC_PMAC is not set 16 18 CONFIG_PPC_82xx=y ··· 49 49 CONFIG_BLK_DEV_LOOP=y 50 50 CONFIG_BLK_DEV_RAM=y 51 51 CONFIG_NETDEVICES=y 52 - CONFIG_FIXED_PHY=y 53 - CONFIG_NET_ETHERNET=y 54 52 CONFIG_FS_ENET=y 55 53 CONFIG_FS_ENET_MDIO_FCC=y 56 - # CONFIG_NETDEV_1000 is not set 57 - # CONFIG_NETDEV_10000 is not set 54 + CONFIG_FIXED_PHY=y 58 55 # CONFIG_WLAN is not set 59 56 # CONFIG_INPUT is not set 60 57 # CONFIG_SERIO is not set ··· 61 64 CONFIG_I2C=y 62 65 CONFIG_I2C_CHARDEV=y 63 66 CONFIG_I2C_CPM=y 67 + CONFIG_SPI=y 68 + CONFIG_SPI_FSL_SPI=y 64 69 # CONFIG_HWMON is not set 65 70 CONFIG_USB_GADGET=y 66 71 CONFIG_USB_FSL_USB2=y ··· 79 80 CONFIG_NFS_FS=y 80 81 CONFIG_NFS_V3=y 81 82 CONFIG_ROOT_NFS=y 82 - CONFIG_PARTITION_ADVANCED=y 83 - CONFIG_NLS=y 84 83 CONFIG_NLS_CODEPAGE_437=y 85 84 CONFIG_NLS_ASCII=y 86 85 CONFIG_NLS_ISO8859_1=y ··· 87 90 CONFIG_DEBUG_FS=y 88 91 # CONFIG_SCHED_DEBUG is not set 89 92 CONFIG_DEBUG_INFO=y 90 - CONFIG_SYSCTL_SYSCALL_CHECK=y 91 93 CONFIG_BDI_SWITCH=y 92 94 CONFIG_CRYPTO_ECB=y 93 95 CONFIG_CRYPTO_PCBC=y
+24
arch/powerpc/configs/mpc85xx_defconfig
··· 74 74 CONFIG_IPV6=y 75 75 CONFIG_IP_SCTP=m 76 76 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 77 + CONFIG_MTD=y 78 + CONFIG_MTD_CMDLINE_PARTS=y 79 + CONFIG_MTD_CHAR=y 80 + CONFIG_MTD_BLOCK=y 81 + CONFIG_MTD_CFI=y 82 + CONFIG_FTL=y 83 + CONFIG_MTD_GEN_PROBE=y 84 + CONFIG_MTD_MAP_BANK_WIDTH_1=y 85 + CONFIG_MTD_MAP_BANK_WIDTH_2=y 86 + CONFIG_MTD_MAP_BANK_WIDTH_4=y 87 + CONFIG_MTD_CFI_I1=y 88 + CONFIG_MTD_CFI_I2=y 89 + CONFIG_MTD_CFI_INTELEXT=y 90 + CONFIG_MTD_CFI_AMDSTD=y 91 + CONFIG_MTD_CFI_UTIL=y 92 + CONFIG_MTD_PHYSMAP_OF=y 93 + CONFIG_MTD_PARTITIONS=y 94 + CONFIG_MTD_OF_PARTS=y 95 + CONFIG_MTD_NAND=y 96 + CONFIG_MTD_NAND_FSL_ELBC=y 97 + CONFIG_MTD_NAND_FSL_IFC=y 98 + CONFIG_MTD_NAND_IDS=y 99 + CONFIG_MTD_NAND_ECC=y 100 + CONFIG_MTD_M25P80=y 77 101 CONFIG_PROC_DEVICETREE=y 78 102 CONFIG_BLK_DEV_LOOP=y 79 103 CONFIG_BLK_DEV_NBD=y
+25
arch/powerpc/configs/mpc85xx_smp_defconfig
··· 46 46 CONFIG_HIGH_RES_TIMERS=y 47 47 CONFIG_BINFMT_MISC=m 48 48 CONFIG_MATH_EMULATION=y 49 + CONFIG_IRQ_ALL_CPUS=y 49 50 CONFIG_FORCE_MAX_ZONEORDER=12 50 51 CONFIG_PCI=y 51 52 CONFIG_PCI_MSI=y ··· 77 76 CONFIG_IPV6=y 78 77 CONFIG_IP_SCTP=m 79 78 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 79 + CONFIG_MTD=y 80 + CONFIG_MTD_CMDLINE_PARTS=y 81 + CONFIG_MTD_CHAR=y 82 + CONFIG_MTD_BLOCK=y 83 + CONFIG_MTD_CFI=y 84 + CONFIG_FTL=y 85 + CONFIG_MTD_GEN_PROBE=y 86 + CONFIG_MTD_MAP_BANK_WIDTH_1=y 87 + CONFIG_MTD_MAP_BANK_WIDTH_2=y 88 + CONFIG_MTD_MAP_BANK_WIDTH_4=y 89 + CONFIG_MTD_CFI_I1=y 90 + CONFIG_MTD_CFI_I2=y 91 + CONFIG_MTD_CFI_INTELEXT=y 92 + CONFIG_MTD_CFI_AMDSTD=y 93 + CONFIG_MTD_CFI_UTIL=y 94 + CONFIG_MTD_PHYSMAP_OF=y 95 + CONFIG_MTD_PARTITIONS=y 96 + CONFIG_MTD_OF_PARTS=y 97 + CONFIG_MTD_NAND=y 98 + CONFIG_MTD_NAND_FSL_ELBC=y 99 + CONFIG_MTD_NAND_FSL_IFC=y 100 + CONFIG_MTD_NAND_IDS=y 101 + CONFIG_MTD_NAND_ECC=y 102 + CONFIG_MTD_M25P80=y 80 103 CONFIG_PROC_DEVICETREE=y 81 104 CONFIG_BLK_DEV_LOOP=y 82 105 CONFIG_BLK_DEV_NBD=y
+2
arch/powerpc/configs/ppc64_defconfig
··· 16 16 CONFIG_PROFILING=y 17 17 CONFIG_OPROFILE=y 18 18 CONFIG_KPROBES=y 19 + CONFIG_JUMP_LABEL=y 19 20 CONFIG_MODULES=y 20 21 CONFIG_MODULE_UNLOAD=y 21 22 CONFIG_MODVERSIONS=y ··· 490 489 CONFIG_KVM_BOOK3S_64=m 491 490 CONFIG_KVM_BOOK3S_64_HV=y 492 491 CONFIG_VHOST_NET=m 492 + CONFIG_BPF_JIT=y
+1
arch/powerpc/configs/pseries_defconfig
··· 24 24 CONFIG_PROFILING=y 25 25 CONFIG_OPROFILE=y 26 26 CONFIG_KPROBES=y 27 + CONFIG_JUMP_LABEL=y 27 28 CONFIG_MODULES=y 28 29 CONFIG_MODULE_UNLOAD=y 29 30 CONFIG_MODVERSIONS=y
+1 -1
arch/powerpc/include/asm/asm-compat.h
··· 29 29 #define PPC_LLARX(t, a, b, eh) PPC_LDARX(t, a, b, eh) 30 30 #define PPC_STLCX stringify_in_c(stdcx.) 31 31 #define PPC_CNTLZL stringify_in_c(cntlzd) 32 - #define PPC_MTOCRF(FXM, RS) MTOCRF((FXM), (RS)) 32 + #define PPC_MTOCRF(FXM, RS) MTOCRF((FXM), RS) 33 33 #define PPC_LR_STKOFF 16 34 34 #define PPC_MIN_STKFRM 112 35 35 #else /* 32-bit */
+2 -2
arch/powerpc/include/asm/code-patching.h
··· 26 26 unsigned long target, int flags); 27 27 unsigned int create_cond_branch(const unsigned int *addr, 28 28 unsigned long target, int flags); 29 - void patch_branch(unsigned int *addr, unsigned long target, int flags); 30 - void patch_instruction(unsigned int *addr, unsigned int instr); 29 + int patch_branch(unsigned int *addr, unsigned long target, int flags); 30 + int patch_instruction(unsigned int *addr, unsigned int instr); 31 31 32 32 int instr_is_relative_branch(unsigned int instr); 33 33 int instr_is_branch_to_addr(const unsigned int *instr, unsigned long addr);
+3
arch/powerpc/include/asm/device.h
··· 34 34 #ifdef CONFIG_EEH 35 35 struct eeh_dev *edev; 36 36 #endif 37 + #ifdef CONFIG_FAIL_IOMMU 38 + int fail_iommu; 39 + #endif 37 40 }; 38 41 39 42 struct pdev_archdata {
+2 -2
arch/powerpc/include/asm/exception-64s.h
··· 293 293 294 294 #define RUNLATCH_ON \ 295 295 BEGIN_FTR_SECTION \ 296 - clrrdi r3,r1,THREAD_SHIFT; \ 296 + CURRENT_THREAD_INFO(r3, r1); \ 297 297 ld r4,TI_LOCAL_FLAGS(r3); \ 298 298 andi. r0,r4,_TLF_RUNLATCH; \ 299 299 beql ppc64_runlatch_on_trampoline; \ ··· 332 332 #ifdef CONFIG_PPC_970_NAP 333 333 #define FINISH_NAP \ 334 334 BEGIN_FTR_SECTION \ 335 - clrrdi r11,r1,THREAD_SHIFT; \ 335 + CURRENT_THREAD_INFO(r11, r1); \ 336 336 ld r9,TI_LOCAL_FLAGS(r11); \ 337 337 andi. r10,r9,_TLF_NAPPING; \ 338 338 bnel power4_fixup_nap; \
+3 -1
arch/powerpc/include/asm/immap_qe.h
··· 26 26 struct qe_iram { 27 27 __be32 iadd; /* I-RAM Address Register */ 28 28 __be32 idata; /* I-RAM Data Register */ 29 - u8 res0[0x78]; 29 + u8 res0[0x04]; 30 + __be32 iready; /* I-RAM Ready Register */ 31 + u8 res1[0x70]; 30 32 } __attribute__ ((packed)); 31 33 32 34 /* QE Interrupt Controller */
+8
arch/powerpc/include/asm/io.h
··· 20 20 #define _PNPWRP 0xa79 21 21 #define PNPBIOS_BASE 0xf000 22 22 23 + #if defined(CONFIG_PPC64) && defined(CONFIG_PCI) 24 + extern struct pci_dev *isa_bridge_pcidev; 25 + /* 26 + * has legacy ISA devices ? 27 + */ 28 + #define arch_has_dev_port() (isa_bridge_pcidev != NULL) 29 + #endif 30 + 23 31 #include <linux/device.h> 24 32 #include <linux/io.h> 25 33
+14 -4
arch/powerpc/include/asm/iommu.h
··· 53 53 */ 54 54 #define IOMAP_MAX_ORDER 13 55 55 56 + #define IOMMU_POOL_HASHBITS 2 57 + #define IOMMU_NR_POOLS (1 << IOMMU_POOL_HASHBITS) 58 + 59 + struct iommu_pool { 60 + unsigned long start; 61 + unsigned long end; 62 + unsigned long hint; 63 + spinlock_t lock; 64 + } ____cacheline_aligned_in_smp; 65 + 56 66 struct iommu_table { 57 67 unsigned long it_busno; /* Bus number this table belongs to */ 58 68 unsigned long it_size; /* Size of iommu table in entries */ ··· 71 61 unsigned long it_index; /* which iommu table this is */ 72 62 unsigned long it_type; /* type: PCI or Virtual Bus */ 73 63 unsigned long it_blocksize; /* Entries in each block (cacheline) */ 74 - unsigned long it_hint; /* Hint for next alloc */ 75 - unsigned long it_largehint; /* Hint for large allocs */ 76 - unsigned long it_halfpoint; /* Breaking point for small/large allocs */ 77 - spinlock_t it_lock; /* Protects it_map */ 64 + unsigned long poolsize; 65 + unsigned long nr_pools; 66 + struct iommu_pool large_pool; 67 + struct iommu_pool pools[IOMMU_NR_POOLS]; 78 68 unsigned long *it_map; /* A simple allocation bitmap for now */ 79 69 }; 80 70
+1
arch/powerpc/include/asm/kvm_book3s_asm.h
··· 74 74 ulong vmhandler; 75 75 ulong scratch0; 76 76 ulong scratch1; 77 + ulong sprg3; 77 78 u8 in_guest; 78 79 u8 restore_hid5; 79 80 u8 napping;
+1 -6
arch/powerpc/include/asm/mmu.h
··· 163 163 * to think about, feedback welcome. --BenH. 164 164 */ 165 165 166 - /* There are #define as they have to be used in assembly 167 - * 168 - * WARNING: If you change this list, make sure to update the array of 169 - * names currently in arch/powerpc/mm/hugetlbpage.c or bad things will 170 - * happen 171 - */ 166 + /* These are #defines as they have to be used in assembly */ 172 167 #define MMU_PAGE_4K 0 173 168 #define MMU_PAGE_16K 1 174 169 #define MMU_PAGE_64K 2
+5
arch/powerpc/include/asm/perf_event.h
··· 26 26 #include <asm/ptrace.h> 27 27 #include <asm/reg.h> 28 28 29 + /* 30 + * Overload regs->result to specify whether we should use the MSR (result 31 + * is zero) or the SIAR (result is non zero). 32 + */ 29 33 #define perf_arch_fetch_caller_regs(regs, __ip) \ 30 34 do { \ 35 + (regs)->result = 0; \ 31 36 (regs)->nip = __ip; \ 32 37 (regs)->gpr[1] = *(unsigned long *)__get_SP(); \ 33 38 asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
+98 -20
arch/powerpc/include/asm/ppc-opcode.h
··· 15 15 #include <linux/stringify.h> 16 16 #include <asm/asm-compat.h> 17 17 18 + #define __REG_R0 0 19 + #define __REG_R1 1 20 + #define __REG_R2 2 21 + #define __REG_R3 3 22 + #define __REG_R4 4 23 + #define __REG_R5 5 24 + #define __REG_R6 6 25 + #define __REG_R7 7 26 + #define __REG_R8 8 27 + #define __REG_R9 9 28 + #define __REG_R10 10 29 + #define __REG_R11 11 30 + #define __REG_R12 12 31 + #define __REG_R13 13 32 + #define __REG_R14 14 33 + #define __REG_R15 15 34 + #define __REG_R16 16 35 + #define __REG_R17 17 36 + #define __REG_R18 18 37 + #define __REG_R19 19 38 + #define __REG_R20 20 39 + #define __REG_R21 21 40 + #define __REG_R22 22 41 + #define __REG_R23 23 42 + #define __REG_R24 24 43 + #define __REG_R25 25 44 + #define __REG_R26 26 45 + #define __REG_R27 27 46 + #define __REG_R28 28 47 + #define __REG_R29 29 48 + #define __REG_R30 30 49 + #define __REG_R31 31 50 + 51 + #define __REGA0_0 0 52 + #define __REGA0_R1 1 53 + #define __REGA0_R2 2 54 + #define __REGA0_R3 3 55 + #define __REGA0_R4 4 56 + #define __REGA0_R5 5 57 + #define __REGA0_R6 6 58 + #define __REGA0_R7 7 59 + #define __REGA0_R8 8 60 + #define __REGA0_R9 9 61 + #define __REGA0_R10 10 62 + #define __REGA0_R11 11 63 + #define __REGA0_R12 12 64 + #define __REGA0_R13 13 65 + #define __REGA0_R14 14 66 + #define __REGA0_R15 15 67 + #define __REGA0_R16 16 68 + #define __REGA0_R17 17 69 + #define __REGA0_R18 18 70 + #define __REGA0_R19 19 71 + #define __REGA0_R20 20 72 + #define __REGA0_R21 21 73 + #define __REGA0_R22 22 74 + #define __REGA0_R23 23 75 + #define __REGA0_R24 24 76 + #define __REGA0_R25 25 77 + #define __REGA0_R26 26 78 + #define __REGA0_R27 27 79 + #define __REGA0_R28 28 80 + #define __REGA0_R29 29 81 + #define __REGA0_R30 30 82 + #define __REGA0_R31 31 83 + 18 84 /* sorted alphabetically */ 19 85 #define PPC_INST_DCBA 0x7c0005ec 20 86 #define PPC_INST_DCBA_MASK 0xfc0007fe ··· 173 107 #define PPC_INST_NEG 0x7c0000d0 174 108 #define PPC_INST_BRANCH 0x48000000 175 109 #define PPC_INST_BRANCH_COND 0x40800000 110 + #define PPC_INST_LBZCIX 0x7c0006aa 111 + #define PPC_INST_STBCIX 0x7c0007aa 176 112 177 113 /* macros to insert fields into opcodes */ 178 - #define __PPC_RA(a) (((a) & 0x1f) << 16) 179 - #define __PPC_RB(b) (((b) & 0x1f) << 11) 180 - #define __PPC_RS(s) (((s) & 0x1f) << 21) 181 - #define __PPC_RT(s) __PPC_RS(s) 114 + #define ___PPC_RA(a) (((a) & 0x1f) << 16) 115 + #define ___PPC_RB(b) (((b) & 0x1f) << 11) 116 + #define ___PPC_RS(s) (((s) & 0x1f) << 21) 117 + #define ___PPC_RT(t) ___PPC_RS(t) 118 + #define __PPC_RA(a) ___PPC_RA(__REG_##a) 119 + #define __PPC_RA0(a) ___PPC_RA(__REGA0_##a) 120 + #define __PPC_RB(b) ___PPC_RB(__REG_##b) 121 + #define __PPC_RS(s) ___PPC_RS(__REG_##s) 122 + #define __PPC_RT(t) ___PPC_RT(__REG_##t) 182 123 #define __PPC_XA(a) ((((a) & 0x1f) << 16) | (((a) & 0x20) >> 3)) 183 124 #define __PPC_XB(b) ((((b) & 0x1f) << 11) | (((b) & 0x20) >> 4)) 184 125 #define __PPC_XS(s) ((((s) & 0x1f) << 21) | (((s) & 0x20) >> 5)) ··· 214 141 #define PPC_DCBZL(a, b) stringify_in_c(.long PPC_INST_DCBZL | \ 215 142 __PPC_RA(a) | __PPC_RB(b)) 216 143 #define PPC_LDARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LDARX | \ 217 - __PPC_RT(t) | __PPC_RA(a) | \ 218 - __PPC_RB(b) | __PPC_EH(eh)) 144 + ___PPC_RT(t) | ___PPC_RA(a) | \ 145 + ___PPC_RB(b) | __PPC_EH(eh)) 219 146 #define PPC_LWARX(t, a, b, eh) stringify_in_c(.long PPC_INST_LWARX | \ 220 - __PPC_RT(t) | __PPC_RA(a) | \ 221 - __PPC_RB(b) | __PPC_EH(eh)) 147 + ___PPC_RT(t) | ___PPC_RA(a) | \ 148 + ___PPC_RB(b) | __PPC_EH(eh)) 222 149 #define PPC_MSGSND(b) stringify_in_c(.long PPC_INST_MSGSND | \ 223 - __PPC_RB(b)) 150 + ___PPC_RB(b)) 224 151 #define PPC_POPCNTB(a, s) stringify_in_c(.long PPC_INST_POPCNTB | \ 225 152 __PPC_RA(a) | __PPC_RS(s)) 226 153 #define PPC_POPCNTD(a, s) stringify_in_c(.long PPC_INST_POPCNTD | \ ··· 231 158 #define PPC_RFDI stringify_in_c(.long PPC_INST_RFDI) 232 159 #define PPC_RFMCI stringify_in_c(.long PPC_INST_RFMCI) 233 160 #define PPC_TLBILX(t, a, b) stringify_in_c(.long PPC_INST_TLBILX | \ 234 - __PPC_T_TLB(t) | __PPC_RA(a) | __PPC_RB(b)) 161 + __PPC_T_TLB(t) | __PPC_RA0(a) | __PPC_RB(b)) 235 162 #define PPC_TLBILX_ALL(a, b) PPC_TLBILX(0, a, b) 236 163 #define PPC_TLBILX_PID(a, b) PPC_TLBILX(1, a, b) 237 164 #define PPC_TLBILX_VA(a, b) PPC_TLBILX(3, a, b) 238 165 #define PPC_WAIT(w) stringify_in_c(.long PPC_INST_WAIT | \ 239 166 __PPC_WC(w)) 240 167 #define PPC_TLBIE(lp,a) stringify_in_c(.long PPC_INST_TLBIE | \ 241 - __PPC_RB(a) | __PPC_RS(lp)) 168 + ___PPC_RB(a) | ___PPC_RS(lp)) 242 169 #define PPC_TLBSRX_DOT(a,b) stringify_in_c(.long PPC_INST_TLBSRX_DOT | \ 243 - __PPC_RA(a) | __PPC_RB(b)) 170 + __PPC_RA0(a) | __PPC_RB(b)) 244 171 #define PPC_TLBIVAX(a,b) stringify_in_c(.long PPC_INST_TLBIVAX | \ 245 - __PPC_RA(a) | __PPC_RB(b)) 172 + __PPC_RA0(a) | __PPC_RB(b)) 246 173 247 174 #define PPC_ERATWE(s, a, w) stringify_in_c(.long PPC_INST_ERATWE | \ 248 175 __PPC_RS(s) | __PPC_RA(a) | __PPC_WS(w)) 249 176 #define PPC_ERATRE(s, a, w) stringify_in_c(.long PPC_INST_ERATRE | \ 250 177 __PPC_RS(s) | __PPC_RA(a) | __PPC_WS(w)) 251 178 #define PPC_ERATILX(t, a, b) stringify_in_c(.long PPC_INST_ERATILX | \ 252 - __PPC_T_TLB(t) | __PPC_RA(a) | \ 179 + __PPC_T_TLB(t) | __PPC_RA0(a) | \ 253 180 __PPC_RB(b)) 254 181 #define PPC_ERATIVAX(s, a, b) stringify_in_c(.long PPC_INST_ERATIVAX | \ 255 - __PPC_RS(s) | __PPC_RA(a) | __PPC_RB(b)) 182 + __PPC_RS(s) | __PPC_RA0(a) | __PPC_RB(b)) 256 183 #define PPC_ERATSX(t, a, w) stringify_in_c(.long PPC_INST_ERATSX | \ 257 - __PPC_RS(t) | __PPC_RA(a) | __PPC_RB(b)) 184 + __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) 258 185 #define PPC_ERATSX_DOT(t, a, w) stringify_in_c(.long PPC_INST_ERATSX_DOT | \ 259 - __PPC_RS(t) | __PPC_RA(a) | __PPC_RB(b)) 186 + __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) 260 187 #define PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ 261 188 __PPC_RT(t) | __PPC_RB(b)) 189 + /* PASemi instructions */ 190 + #define LBZCIX(t,a,b) stringify_in_c(.long PPC_INST_LBZCIX | \ 191 + __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b)) 192 + #define STBCIX(s,a,b) stringify_in_c(.long PPC_INST_STBCIX | \ 193 + __PPC_RS(s) | __PPC_RA(a) | __PPC_RB(b)) 262 194 263 195 /* 264 196 * Define what the VSX XX1 form instructions will look like, then add ··· 272 194 #define VSX_XX1(s, a, b) (__PPC_XS(s) | __PPC_RA(a) | __PPC_RB(b)) 273 195 #define VSX_XX3(t, a, b) (__PPC_XT(t) | __PPC_XA(a) | __PPC_XB(b)) 274 196 #define STXVD2X(s, a, b) stringify_in_c(.long PPC_INST_STXVD2X | \ 275 - VSX_XX1((s), (a), (b))) 197 + VSX_XX1((s), a, b)) 276 198 #define LXVD2X(s, a, b) stringify_in_c(.long PPC_INST_LXVD2X | \ 277 - VSX_XX1((s), (a), (b))) 199 + VSX_XX1((s), a, b)) 278 200 #define XXLOR(t, a, b) stringify_in_c(.long PPC_INST_XXLOR | \ 279 - VSX_XX3((t), (a), (b))) 201 + VSX_XX3((t), a, b)) 280 202 281 203 #define PPC_NAP stringify_in_c(.long PPC_INST_NAP) 282 204 #define PPC_SLEEP stringify_in_c(.long PPC_INST_SLEEP)
+71 -48
arch/powerpc/include/asm/ppc_asm.h
··· 126 126 #define REST_32VRS(n,b,base) REST_16VRS(n,b,base); REST_16VRS(n+16,b,base) 127 127 128 128 /* Save the lower 32 VSRs in the thread VSR region */ 129 - #define SAVE_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); STXVD2X(n,base,b) 129 + #define SAVE_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); STXVD2X(n,R##base,R##b) 130 130 #define SAVE_2VSRS(n,b,base) SAVE_VSR(n,b,base); SAVE_VSR(n+1,b,base) 131 131 #define SAVE_4VSRS(n,b,base) SAVE_2VSRS(n,b,base); SAVE_2VSRS(n+2,b,base) 132 132 #define SAVE_8VSRS(n,b,base) SAVE_4VSRS(n,b,base); SAVE_4VSRS(n+4,b,base) 133 133 #define SAVE_16VSRS(n,b,base) SAVE_8VSRS(n,b,base); SAVE_8VSRS(n+8,b,base) 134 134 #define SAVE_32VSRS(n,b,base) SAVE_16VSRS(n,b,base); SAVE_16VSRS(n+16,b,base) 135 - #define REST_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); LXVD2X(n,base,b) 135 + #define REST_VSR(n,b,base) li b,THREAD_VSR0+(16*(n)); LXVD2X(n,R##base,R##b) 136 136 #define REST_2VSRS(n,b,base) REST_VSR(n,b,base); REST_VSR(n+1,b,base) 137 137 #define REST_4VSRS(n,b,base) REST_2VSRS(n,b,base); REST_2VSRS(n+2,b,base) 138 138 #define REST_8VSRS(n,b,base) REST_4VSRS(n,b,base); REST_4VSRS(n+4,b,base) 139 139 #define REST_16VSRS(n,b,base) REST_8VSRS(n,b,base); REST_8VSRS(n+8,b,base) 140 140 #define REST_32VSRS(n,b,base) REST_16VSRS(n,b,base); REST_16VSRS(n+16,b,base) 141 141 /* Save the upper 32 VSRs (32-63) in the thread VSX region (0-31) */ 142 - #define SAVE_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); STXVD2X(n+32,base,b) 142 + #define SAVE_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); STXVD2X(n+32,R##base,R##b) 143 143 #define SAVE_2VSRSU(n,b,base) SAVE_VSRU(n,b,base); SAVE_VSRU(n+1,b,base) 144 144 #define SAVE_4VSRSU(n,b,base) SAVE_2VSRSU(n,b,base); SAVE_2VSRSU(n+2,b,base) 145 145 #define SAVE_8VSRSU(n,b,base) SAVE_4VSRSU(n,b,base); SAVE_4VSRSU(n+4,b,base) 146 146 #define SAVE_16VSRSU(n,b,base) SAVE_8VSRSU(n,b,base); SAVE_8VSRSU(n+8,b,base) 147 147 #define SAVE_32VSRSU(n,b,base) SAVE_16VSRSU(n,b,base); SAVE_16VSRSU(n+16,b,base) 148 - #define REST_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); LXVD2X(n+32,base,b) 148 + #define REST_VSRU(n,b,base) li b,THREAD_VR0+(16*(n)); LXVD2X(n+32,R##base,R##b) 149 149 #define REST_2VSRSU(n,b,base) REST_VSRU(n,b,base); REST_VSRU(n+1,b,base) 150 150 #define REST_4VSRSU(n,b,base) REST_2VSRSU(n,b,base); REST_2VSRSU(n+2,b,base) 151 151 #define REST_8VSRSU(n,b,base) REST_4VSRSU(n,b,base); REST_4VSRSU(n+4,b,base) ··· 178 178 #define HMT_HIGH or 3,3,3 179 179 #define HMT_EXTRA_HIGH or 7,7,7 # power7 only 180 180 181 + #ifdef CONFIG_PPC64 182 + #define ULONG_SIZE 8 183 + #else 184 + #define ULONG_SIZE 4 185 + #endif 186 + #define __VCPU_GPR(n) (VCPU_GPRS + (n * ULONG_SIZE)) 187 + #define VCPU_GPR(n) __VCPU_GPR(__REG_##n) 188 + 181 189 #ifdef __KERNEL__ 182 190 #ifdef CONFIG_PPC64 191 + 192 + #define STACKFRAMESIZE 256 193 + #define __STK_REG(i) (112 + ((i)-14)*8) 194 + #define STK_REG(i) __STK_REG(__REG_##i) 195 + 196 + #define __STK_PARAM(i) (48 + ((i)-3)*8) 197 + #define STK_PARAM(i) __STK_PARAM(__REG_##i) 183 198 184 199 #define XGLUE(a,b) a##b 185 200 #define GLUE(a,b) XGLUE(a,b) ··· 310 295 */ 311 296 #ifdef __powerpc64__ 312 297 #define LOAD_REG_IMMEDIATE(reg,expr) \ 313 - lis (reg),(expr)@highest; \ 314 - ori (reg),(reg),(expr)@higher; \ 315 - rldicr (reg),(reg),32,31; \ 316 - oris (reg),(reg),(expr)@h; \ 317 - ori (reg),(reg),(expr)@l; 298 + lis reg,(expr)@highest; \ 299 + ori reg,reg,(expr)@higher; \ 300 + rldicr reg,reg,32,31; \ 301 + oris reg,reg,(expr)@h; \ 302 + ori reg,reg,(expr)@l; 318 303 319 304 #define LOAD_REG_ADDR(reg,name) \ 320 - ld (reg),name@got(r2) 305 + ld reg,name@got(r2) 321 306 322 307 #define LOAD_REG_ADDRBASE(reg,name) LOAD_REG_ADDR(reg,name) 323 308 #define ADDROFF(name) 0 ··· 328 313 #else /* 32-bit */ 329 314 330 315 #define LOAD_REG_IMMEDIATE(reg,expr) \ 331 - lis (reg),(expr)@ha; \ 332 - addi (reg),(reg),(expr)@l; 316 + lis reg,(expr)@ha; \ 317 + addi reg,reg,(expr)@l; 333 318 334 319 #define LOAD_REG_ADDR(reg,name) LOAD_REG_IMMEDIATE(reg, name) 335 320 336 - #define LOAD_REG_ADDRBASE(reg, name) lis (reg),name@ha 321 + #define LOAD_REG_ADDRBASE(reg, name) lis reg,name@ha 337 322 #define ADDROFF(name) name@l 338 323 339 324 /* offsets for stack frame layout */ ··· 387 372 #ifdef CONFIG_PPC64 388 373 #define MTOCRF(FXM, RS) \ 389 374 BEGIN_FTR_SECTION_NESTED(848); \ 390 - mtcrf (FXM), (RS); \ 375 + mtcrf (FXM), RS; \ 391 376 FTR_SECTION_ELSE_NESTED(848); \ 392 - mtocrf (FXM), (RS); \ 377 + mtocrf (FXM), RS; \ 393 378 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_NOEXECUTE, 848) 394 379 #endif 395 380 ··· 478 463 #ifdef CONFIG_PPC_BOOK3S_64 479 464 #define RFI rfid 480 465 #define MTMSRD(r) mtmsrd r 466 + #define MTMSR_EERI(reg) mtmsrd reg,1 481 467 #else 482 468 #define FIX_SRR1(ra, rb) 483 469 #ifndef CONFIG_40x ··· 487 471 #define RFI rfi; b . /* Prevent prefetch past rfi */ 488 472 #endif 489 473 #define MTMSRD(r) mtmsr r 474 + #define MTMSR_EERI(reg) mtmsr reg 490 475 #define CLR_TOP32(r) 491 476 #endif 492 477 ··· 507 490 #define cr7 7 508 491 509 492 510 - /* General Purpose Registers (GPRs) */ 493 + /* 494 + * General Purpose Registers (GPRs) 495 + * 496 + * The lower case r0-r31 should be used in preference to the upper 497 + * case R0-R31 as they provide more error checking in the assembler. 498 + * Use R0-31 only when really nessesary. 499 + */ 511 500 512 - #define r0 0 513 - #define r1 1 514 - #define r2 2 515 - #define r3 3 516 - #define r4 4 517 - #define r5 5 518 - #define r6 6 519 - #define r7 7 520 - #define r8 8 521 - #define r9 9 522 - #define r10 10 523 - #define r11 11 524 - #define r12 12 525 - #define r13 13 526 - #define r14 14 527 - #define r15 15 528 - #define r16 16 529 - #define r17 17 530 - #define r18 18 531 - #define r19 19 532 - #define r20 20 533 - #define r21 21 534 - #define r22 22 535 - #define r23 23 536 - #define r24 24 537 - #define r25 25 538 - #define r26 26 539 - #define r27 27 540 - #define r28 28 541 - #define r29 29 542 - #define r30 30 543 - #define r31 31 501 + #define r0 %r0 502 + #define r1 %r1 503 + #define r2 %r2 504 + #define r3 %r3 505 + #define r4 %r4 506 + #define r5 %r5 507 + #define r6 %r6 508 + #define r7 %r7 509 + #define r8 %r8 510 + #define r9 %r9 511 + #define r10 %r10 512 + #define r11 %r11 513 + #define r12 %r12 514 + #define r13 %r13 515 + #define r14 %r14 516 + #define r15 %r15 517 + #define r16 %r16 518 + #define r17 %r17 519 + #define r18 %r18 520 + #define r19 %r19 521 + #define r20 %r20 522 + #define r21 %r21 523 + #define r22 %r22 524 + #define r23 %r23 525 + #define r24 %r24 526 + #define r25 %r25 527 + #define r26 %r26 528 + #define r27 %r27 529 + #define r28 %r28 530 + #define r29 %r29 531 + #define r30 %r30 532 + #define r31 %r31 544 533 545 534 546 535 /* Floating Point Registers (FPRs) */
-2
arch/powerpc/include/asm/processor.h
··· 389 389 390 390 #ifdef CONFIG_PSERIES_IDLE 391 391 extern void update_smt_snooze_delay(int snooze); 392 - extern int pseries_notify_cpuidle_add_cpu(int cpu); 393 392 #else 394 393 static inline void update_smt_snooze_delay(int snooze) {} 395 - static inline int pseries_notify_cpuidle_add_cpu(int cpu) { return 0; } 396 394 #endif 397 395 398 396 extern void flush_instruction_cache(void);
+1
arch/powerpc/include/asm/qe.h
··· 499 499 /* I-RAM */ 500 500 #define QE_IRAM_IADD_AIE 0x80000000 /* Auto Increment Enable */ 501 501 #define QE_IRAM_IADD_BADDR 0x00080000 /* Base Address */ 502 + #define QE_IRAM_READY 0x80000000 /* Ready */ 502 503 503 504 /* UPC */ 504 505 #define UPGCR_PROTOCOL 0x80000000 /* protocol ul2 or pl2 */
+5 -3
arch/powerpc/include/asm/reg.h
··· 491 491 #define SPRN_SPRG1 0x111 /* Special Purpose Register General 1 */ 492 492 #define SPRN_SPRG2 0x112 /* Special Purpose Register General 2 */ 493 493 #define SPRN_SPRG3 0x113 /* Special Purpose Register General 3 */ 494 + #define SPRN_USPRG3 0x103 /* SPRG3 userspace read */ 494 495 #define SPRN_SPRG4 0x114 /* Special Purpose Register General 4 */ 495 496 #define SPRN_SPRG5 0x115 /* Special Purpose Register General 5 */ 496 497 #define SPRN_SPRG6 0x116 /* Special Purpose Register General 6 */ ··· 754 753 * 64-bit server: 755 754 * - SPRG0 unused (reserved for HV on Power4) 756 755 * - SPRG2 scratch for exception vectors 757 - * - SPRG3 unused (user visible) 756 + * - SPRG3 CPU and NUMA node for VDSO getcpu (user visible) 758 757 * - HSPRG0 stores PACA in HV mode 759 758 * - HSPRG1 scratch for "HV" exceptions 760 759 * 761 760 * 64-bit embedded 762 761 * - SPRG0 generic exception scratch 763 762 * - SPRG2 TLB exception stack 764 - * - SPRG3 unused (user visible) 763 + * - SPRG3 CPU and NUMA node for VDSO getcpu (user visible) 765 764 * - SPRG4 unused (user visible) 766 765 * - SPRG6 TLB miss scratch (user visible, sorry !) 767 766 * - SPRG7 critical exception scratch ··· 1025 1024 /* Macros for setting and retrieving special purpose registers */ 1026 1025 #ifndef __ASSEMBLY__ 1027 1026 #define mfmsr() ({unsigned long rval; \ 1028 - asm volatile("mfmsr %0" : "=r" (rval)); rval;}) 1027 + asm volatile("mfmsr %0" : "=r" (rval) : \ 1028 + : "memory"); rval;}) 1029 1029 #ifdef CONFIG_PPC_BOOK3S_64 1030 1030 #define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \ 1031 1031 : : "r" (v) : "memory")
+6
arch/powerpc/include/asm/thread_info.h
··· 22 22 23 23 #define THREAD_SIZE (1 << THREAD_SHIFT) 24 24 25 + #ifdef CONFIG_PPC64 26 + #define CURRENT_THREAD_INFO(dest, sp) clrrdi dest, sp, THREAD_SHIFT 27 + #else 28 + #define CURRENT_THREAD_INFO(dest, sp) rlwinm dest, sp, 0, 0, 31-THREAD_SHIFT 29 + #endif 30 + 25 31 #ifndef __ASSEMBLY__ 26 32 #include <linux/cache.h> 27 33 #include <asm/processor.h>
+11 -34
arch/powerpc/include/asm/trace.h
··· 8 8 9 9 struct pt_regs; 10 10 11 - TRACE_EVENT(irq_entry, 11 + DECLARE_EVENT_CLASS(ppc64_interrupt_class, 12 12 13 13 TP_PROTO(struct pt_regs *regs), 14 14 ··· 25 25 TP_printk("pt_regs=%p", __entry->regs) 26 26 ); 27 27 28 - TRACE_EVENT(irq_exit, 28 + DEFINE_EVENT(ppc64_interrupt_class, irq_entry, 29 29 30 30 TP_PROTO(struct pt_regs *regs), 31 31 32 - TP_ARGS(regs), 33 - 34 - TP_STRUCT__entry( 35 - __field(struct pt_regs *, regs) 36 - ), 37 - 38 - TP_fast_assign( 39 - __entry->regs = regs; 40 - ), 41 - 42 - TP_printk("pt_regs=%p", __entry->regs) 32 + TP_ARGS(regs) 43 33 ); 44 34 45 - TRACE_EVENT(timer_interrupt_entry, 35 + DEFINE_EVENT(ppc64_interrupt_class, irq_exit, 46 36 47 37 TP_PROTO(struct pt_regs *regs), 48 38 49 - TP_ARGS(regs), 50 - 51 - TP_STRUCT__entry( 52 - __field(struct pt_regs *, regs) 53 - ), 54 - 55 - TP_fast_assign( 56 - __entry->regs = regs; 57 - ), 58 - 59 - TP_printk("pt_regs=%p", __entry->regs) 39 + TP_ARGS(regs) 60 40 ); 61 41 62 - TRACE_EVENT(timer_interrupt_exit, 42 + DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry, 63 43 64 44 TP_PROTO(struct pt_regs *regs), 65 45 66 - TP_ARGS(regs), 46 + TP_ARGS(regs) 47 + ); 67 48 68 - TP_STRUCT__entry( 69 - __field(struct pt_regs *, regs) 70 - ), 49 + DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit, 71 50 72 - TP_fast_assign( 73 - __entry->regs = regs; 74 - ), 51 + TP_PROTO(struct pt_regs *regs), 75 52 76 - TP_printk("pt_regs=%p", __entry->regs) 53 + TP_ARGS(regs) 77 54 ); 78 55 79 56 #ifdef CONFIG_PPC_PSERIES
+2
arch/powerpc/include/asm/vdso.h
··· 22 22 extern unsigned long vdso32_sigtramp; 23 23 extern unsigned long vdso32_rt_sigtramp; 24 24 25 + int __cpuinit vdso_getcpu_init(void); 26 + 25 27 #else /* __ASSEMBLY__ */ 26 28 27 29 #ifdef __VDSO64__
+2
arch/powerpc/include/asm/vio.h
··· 44 44 */ 45 45 #define VIO_CMO_MIN_ENT 1562624 46 46 47 + extern struct bus_type vio_bus_type; 48 + 47 49 struct iommu_table; 48 50 49 51 /*
+1
arch/powerpc/kernel/asm-offsets.c
··· 533 533 HSTATE_FIELD(HSTATE_VMHANDLER, vmhandler); 534 534 HSTATE_FIELD(HSTATE_SCRATCH0, scratch0); 535 535 HSTATE_FIELD(HSTATE_SCRATCH1, scratch1); 536 + HSTATE_FIELD(HSTATE_SPRG3, sprg3); 536 537 HSTATE_FIELD(HSTATE_IN_GUEST, in_guest); 537 538 HSTATE_FIELD(HSTATE_RESTORE_HID5, restore_hid5); 538 539 HSTATE_FIELD(HSTATE_NAPPING, napping);
+3 -3
arch/powerpc/kernel/cpu_setup_a2.S
··· 100 100 lis r4,(MMUCR0_TLBSEL_I|MMUCR0_ECL)@h 101 101 mtspr SPRN_MMUCR0, r4 102 102 li r4,A2_IERAT_SIZE-1 103 - PPC_ERATWE(r4,r4,3) 103 + PPC_ERATWE(R4,R4,3) 104 104 105 105 /* Now set the D-ERAT watermark to 31 */ 106 106 lis r4,(MMUCR0_TLBSEL_D|MMUCR0_ECL)@h 107 107 mtspr SPRN_MMUCR0, r4 108 108 li r4,A2_DERAT_SIZE-1 109 - PPC_ERATWE(r4,r4,3) 109 + PPC_ERATWE(R4,R4,3) 110 110 111 111 /* And invalidate the beast just in case. That won't get rid of 112 112 * a bolted entry though it will be in LRU and so will go away eventually 113 113 * but let's not bother for now 114 114 */ 115 - PPC_ERATILX(0,0,0) 115 + PPC_ERATILX(0,0,R0) 116 116 1: 117 117 blr 118 118
+9 -1
arch/powerpc/kernel/dma.c
··· 11 11 #include <linux/gfp.h> 12 12 #include <linux/memblock.h> 13 13 #include <linux/export.h> 14 + #include <linux/pci.h> 15 + #include <asm/vio.h> 14 16 #include <asm/bug.h> 15 17 #include <asm/abs_addr.h> 16 18 #include <asm/machdep.h> ··· 207 205 208 206 static int __init dma_init(void) 209 207 { 210 - dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); 208 + dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES); 209 + #ifdef CONFIG_PCI 210 + dma_debug_add_bus(&pci_bus_type); 211 + #endif 212 + #ifdef CONFIG_IBMVIO 213 + dma_debug_add_bus(&vio_bus_type); 214 + #endif 211 215 212 216 return 0; 213 217 }
+12 -18
arch/powerpc/kernel/entry_32.S
··· 92 92 mfspr r8,SPRN_SPRG_THREAD 93 93 lwz r0,KSP_LIMIT(r8) 94 94 stw r0,SAVED_KSP_LIMIT(r11) 95 - rlwimi r0,r1,0,0,(31-THREAD_SHIFT) 95 + CURRENT_THREAD_INFO(r0, r1) 96 96 stw r0,KSP_LIMIT(r8) 97 97 /* fall through */ 98 98 #endif ··· 112 112 mfspr r8,SPRN_SPRG_THREAD 113 113 lwz r0,KSP_LIMIT(r8) 114 114 stw r0,saved_ksp_limit@l(0) 115 - rlwimi r0,r1,0,0,(31-THREAD_SHIFT) 115 + CURRENT_THREAD_INFO(r0, r1) 116 116 stw r0,KSP_LIMIT(r8) 117 117 /* fall through */ 118 118 #endif ··· 158 158 tophys(r11,r11) 159 159 addi r11,r11,global_dbcr0@l 160 160 #ifdef CONFIG_SMP 161 - rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 161 + CURRENT_THREAD_INFO(r9, r1) 162 162 lwz r9,TI_CPU(r9) 163 163 slwi r9,r9,3 164 164 add r11,r11,r9 ··· 179 179 ble- stack_ovf /* then the kernel stack overflowed */ 180 180 5: 181 181 #if defined(CONFIG_6xx) || defined(CONFIG_E500) 182 - rlwinm r9,r1,0,0,31-THREAD_SHIFT 182 + CURRENT_THREAD_INFO(r9, r1) 183 183 tophys(r9,r9) /* check local flags */ 184 184 lwz r12,TI_LOCAL_FLAGS(r9) 185 185 mtcrf 0x01,r12 ··· 226 226 stw r3,16(r1) 227 227 stw r4,20(r1) 228 228 stw r5,24(r1) 229 - andi. r12,r12,MSR_PR 230 - b 11f 231 229 bl trace_hardirqs_off 232 - b 12f 233 - 11: 234 - bl trace_hardirqs_off 235 - 12: 236 230 lwz r5,24(r1) 237 231 lwz r4,20(r1) 238 232 lwz r3,16(r1) ··· 327 333 mtmsr r11 328 334 1: 329 335 #endif /* CONFIG_TRACE_IRQFLAGS */ 330 - rlwinm r10,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 336 + CURRENT_THREAD_INFO(r10, r1) 331 337 lwz r11,TI_FLAGS(r10) 332 338 andi. r11,r11,_TIF_SYSCALL_T_OR_A 333 339 bne- syscall_dotrace ··· 348 354 bl do_show_syscall_exit 349 355 #endif 350 356 mr r6,r3 351 - rlwinm r12,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 357 + CURRENT_THREAD_INFO(r12, r1) 352 358 /* disable interrupts so current_thread_info()->flags can't change */ 353 359 LOAD_MSR_KERNEL(r10,MSR_KERNEL) /* doesn't include MSR_EE */ 354 360 /* Note: We don't bother telling lockdep about it */ ··· 809 815 810 816 user_exc_return: /* r10 contains MSR_KERNEL here */ 811 817 /* Check current_thread_info()->flags */ 812 - rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 818 + CURRENT_THREAD_INFO(r9, r1) 813 819 lwz r9,TI_FLAGS(r9) 814 820 andi. r0,r9,_TIF_USER_WORK_MASK 815 821 bne do_work ··· 829 835 /* N.B. the only way to get here is from the beq following ret_from_except. */ 830 836 resume_kernel: 831 837 /* check current_thread_info->preempt_count */ 832 - rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 838 + CURRENT_THREAD_INFO(r9, r1) 833 839 lwz r0,TI_PREEMPT(r9) 834 840 cmpwi 0,r0,0 /* if non-zero, just restore regs and return */ 835 841 bne restore ··· 846 852 bl trace_hardirqs_off 847 853 #endif 848 854 1: bl preempt_schedule_irq 849 - rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 855 + CURRENT_THREAD_INFO(r9, r1) 850 856 lwz r3,TI_FLAGS(r9) 851 857 andi. r0,r3,_TIF_NEED_RESCHED 852 858 bne- 1b ··· 1116 1122 lwz r10,SAVED_KSP_LIMIT(r1) 1117 1123 stw r10,KSP_LIMIT(r9) 1118 1124 lwz r9,THREAD_INFO-THREAD(r9) 1119 - rlwinm r10,r1,0,0,(31-THREAD_SHIFT) 1125 + CURRENT_THREAD_INFO(r10, r1) 1120 1126 lwz r10,TI_PREEMPT(r10) 1121 1127 stw r10,TI_PREEMPT(r9) 1122 1128 RESTORE_xSRR(SRR0,SRR1); ··· 1150 1156 lis r11,global_dbcr0@ha 1151 1157 addi r11,r11,global_dbcr0@l 1152 1158 #ifdef CONFIG_SMP 1153 - rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 1159 + CURRENT_THREAD_INFO(r9, r1) 1154 1160 lwz r9,TI_CPU(r9) 1155 1161 slwi r9,r9,3 1156 1162 add r11,r11,r9 ··· 1191 1197 LOAD_MSR_KERNEL(r10,MSR_KERNEL) 1192 1198 SYNC 1193 1199 MTMSRD(r10) /* disable interrupts */ 1194 - rlwinm r9,r1,0,0,(31-THREAD_SHIFT) 1200 + CURRENT_THREAD_INFO(r9, r1) 1195 1201 lwz r9,TI_FLAGS(r9) 1196 1202 andi. r0,r9,_TIF_NEED_RESCHED 1197 1203 bne- do_resched
+19 -18
arch/powerpc/kernel/entry_64.S
··· 146 146 REST_2GPRS(7,r1) 147 147 addi r9,r1,STACK_FRAME_OVERHEAD 148 148 #endif 149 - clrrdi r11,r1,THREAD_SHIFT 149 + CURRENT_THREAD_INFO(r11, r1) 150 150 ld r10,TI_FLAGS(r11) 151 151 andi. r11,r10,_TIF_SYSCALL_T_OR_A 152 152 bne- syscall_dotrace ··· 181 181 bl .do_show_syscall_exit 182 182 ld r3,RESULT(r1) 183 183 #endif 184 - clrrdi r12,r1,THREAD_SHIFT 184 + CURRENT_THREAD_INFO(r12, r1) 185 185 186 186 ld r8,_MSR(r1) 187 187 #ifdef CONFIG_PPC_BOOK3S ··· 197 197 wrteei 0 198 198 #else 199 199 ld r10,PACAKMSR(r13) 200 - mtmsrd r10,1 200 + /* 201 + * For performance reasons we clear RI the same time that we 202 + * clear EE. We only need to clear RI just before we restore r13 203 + * below, but batching it with EE saves us one expensive mtmsrd call. 204 + * We have to be careful to restore RI if we branch anywhere from 205 + * here (eg syscall_exit_work). 206 + */ 207 + li r9,MSR_RI 208 + andc r11,r10,r9 209 + mtmsrd r11,1 201 210 #endif /* CONFIG_PPC_BOOK3E */ 202 211 203 212 ld r9,TI_FLAGS(r12) ··· 223 214 END_FTR_SECTION_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS) 224 215 andi. r6,r8,MSR_PR 225 216 ld r4,_LINK(r1) 226 - /* 227 - * Clear RI before restoring r13. If we are returning to 228 - * userspace and we take an exception after restoring r13, 229 - * we end up corrupting the userspace r13 value. 230 - */ 231 - #ifdef CONFIG_PPC_BOOK3S 232 - /* No MSR:RI on BookE */ 233 - li r12,MSR_RI 234 - andc r11,r10,r12 235 - mtmsrd r11,1 /* clear MSR.RI */ 236 - #endif /* CONFIG_PPC_BOOK3S */ 237 217 238 218 beq- 1f 239 219 ACCOUNT_CPU_USER_EXIT(r11, r12) ··· 260 262 ld r7,GPR7(r1) 261 263 ld r8,GPR8(r1) 262 264 addi r9,r1,STACK_FRAME_OVERHEAD 263 - clrrdi r10,r1,THREAD_SHIFT 265 + CURRENT_THREAD_INFO(r10, r1) 264 266 ld r10,TI_FLAGS(r10) 265 267 b .Lsyscall_dotrace_cont 266 268 ··· 269 271 b syscall_exit 270 272 271 273 syscall_exit_work: 274 + #ifdef CONFIG_PPC_BOOK3S 275 + mtmsrd r10,1 /* Restore RI */ 276 + #endif 272 277 /* If TIF_RESTOREALL is set, don't scribble on either r3 or ccr. 273 278 If TIF_NOERROR is set, just save r3 as it is. */ 274 279 ··· 500 499 2: 501 500 #endif /* !CONFIG_PPC_BOOK3S */ 502 501 503 - clrrdi r7,r8,THREAD_SHIFT /* base of new stack */ 502 + CURRENT_THREAD_INFO(r7, r8) /* base of new stack */ 504 503 /* Note: this uses SWITCH_FRAME_SIZE rather than INT_FRAME_SIZE 505 504 because we don't need to leave the 288-byte ABI gap at the 506 505 top of the kernel stack. */ ··· 559 558 mtmsrd r10,1 /* Update machine state */ 560 559 #endif /* CONFIG_PPC_BOOK3E */ 561 560 562 - clrrdi r9,r1,THREAD_SHIFT /* current_thread_info() */ 561 + CURRENT_THREAD_INFO(r9, r1) 563 562 ld r3,_MSR(r1) 564 563 ld r4,TI_FLAGS(r9) 565 564 andi. r3,r3,MSR_PR ··· 602 601 1: bl .preempt_schedule_irq 603 602 604 603 /* Re-test flags and eventually loop */ 605 - clrrdi r9,r1,THREAD_SHIFT 604 + CURRENT_THREAD_INFO(r9, r1) 606 605 ld r4,TI_FLAGS(r9) 607 606 andi. r0,r4,_TIF_NEED_RESCHED 608 607 bne 1b
+5 -5
arch/powerpc/kernel/exceptions-64e.S
··· 222 222 * interrupts happen before the wait instruction. 223 223 */ 224 224 #define CHECK_NAPPING() \ 225 - clrrdi r11,r1,THREAD_SHIFT; \ 225 + CURRENT_THREAD_INFO(r11, r1); \ 226 226 ld r10,TI_LOCAL_FLAGS(r11); \ 227 227 andi. r9,r10,_TLF_NAPPING; \ 228 228 beq+ 1f; \ ··· 903 903 bne 1b /* If not, repeat */ 904 904 905 905 /* Invalidate all TLBs */ 906 - PPC_TLBILX_ALL(0,0) 906 + PPC_TLBILX_ALL(0,R0) 907 907 sync 908 908 isync 909 909 ··· 961 961 tlbwe 962 962 963 963 /* Invalidate TLB1 */ 964 - PPC_TLBILX_ALL(0,0) 964 + PPC_TLBILX_ALL(0,R0) 965 965 sync 966 966 isync 967 967 ··· 1020 1020 tlbwe 1021 1021 1022 1022 /* Invalidate TLB1 */ 1023 - PPC_TLBILX_ALL(0,0) 1023 + PPC_TLBILX_ALL(0,R0) 1024 1024 sync 1025 1025 isync 1026 1026 ··· 1138 1138 tlbwe 1139 1139 #endif /* CONFIG_PPC_EARLY_DEBUG_WSP */ 1140 1140 1141 - PPC_TLBILX(0,0,0) 1141 + PPC_TLBILX(0,0,R0) 1142 1142 sync 1143 1143 isync 1144 1144
+2 -1
arch/powerpc/kernel/exceptions-64s.S
··· 239 239 * out of line to handle them 240 240 */ 241 241 . = 0xe00 242 + hv_exception_trampoline: 242 243 b h_data_storage_hv 243 244 . = 0xe20 244 245 b h_instr_storage_hv ··· 852 851 bne- do_ste_alloc /* If so handle it */ 853 852 END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB) 854 853 855 - clrrdi r11,r1,THREAD_SHIFT 854 + CURRENT_THREAD_INFO(r11, r1) 856 855 lwz r0,TI_PREEMPT(r11) /* If we're in an "NMI" */ 857 856 andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */ 858 857 bne 77f /* then don't call hash_page now */
+9 -7
arch/powerpc/kernel/fpu.S
··· 26 26 #include <asm/ptrace.h> 27 27 28 28 #ifdef CONFIG_VSX 29 - #define REST_32FPVSRS(n,c,base) \ 29 + #define __REST_32FPVSRS(n,c,base) \ 30 30 BEGIN_FTR_SECTION \ 31 31 b 2f; \ 32 32 END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ ··· 35 35 2: REST_32VSRS(n,c,base); \ 36 36 3: 37 37 38 - #define SAVE_32FPVSRS(n,c,base) \ 38 + #define __SAVE_32FPVSRS(n,c,base) \ 39 39 BEGIN_FTR_SECTION \ 40 40 b 2f; \ 41 41 END_FTR_SECTION_IFSET(CPU_FTR_VSX); \ ··· 44 44 2: SAVE_32VSRS(n,c,base); \ 45 45 3: 46 46 #else 47 - #define REST_32FPVSRS(n,b,base) REST_32FPRS(n, base) 48 - #define SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base) 47 + #define __REST_32FPVSRS(n,b,base) REST_32FPRS(n, base) 48 + #define __SAVE_32FPVSRS(n,b,base) SAVE_32FPRS(n, base) 49 49 #endif 50 + #define REST_32FPVSRS(n,c,base) __REST_32FPVSRS(n,__REG_##c,__REG_##base) 51 + #define SAVE_32FPVSRS(n,c,base) __SAVE_32FPVSRS(n,__REG_##c,__REG_##base) 50 52 51 53 /* 52 54 * This task wants to use the FPU now. ··· 81 79 beq 1f 82 80 toreal(r4) 83 81 addi r4,r4,THREAD /* want last_task_used_math->thread */ 84 - SAVE_32FPVSRS(0, r5, r4) 82 + SAVE_32FPVSRS(0, R5, R4) 85 83 mffs fr0 86 84 stfd fr0,THREAD_FPSCR(r4) 87 85 PPC_LL r5,PT_REGS(r4) ··· 108 106 #endif 109 107 lfd fr0,THREAD_FPSCR(r5) 110 108 MTFSF_L(fr0) 111 - REST_32FPVSRS(0, r4, r5) 109 + REST_32FPVSRS(0, R4, R5) 112 110 #ifndef CONFIG_SMP 113 111 subi r4,r5,THREAD 114 112 fromreal(r4) ··· 142 140 addi r3,r3,THREAD /* want THREAD of task */ 143 141 PPC_LL r5,PT_REGS(r3) 144 142 PPC_LCMPI 0,r5,0 145 - SAVE_32FPVSRS(0, r4 ,r3) 143 + SAVE_32FPVSRS(0, R4 ,R3) 146 144 mffs fr0 147 145 stfd fr0,THREAD_FPSCR(r3) 148 146 beq 1f
+62 -19
arch/powerpc/kernel/ftrace.c
··· 63 63 return -EINVAL; 64 64 65 65 /* replace the text with the new text */ 66 - if (probe_kernel_write((void *)ip, &new, MCOUNT_INSN_SIZE)) 66 + if (patch_instruction((unsigned int *)ip, new)) 67 67 return -EPERM; 68 - 69 - flush_icache_range(ip, ip + 8); 70 68 71 69 return 0; 72 70 } ··· 210 212 */ 211 213 op = 0x48000008; /* b +8 */ 212 214 213 - if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 215 + if (patch_instruction((unsigned int *)ip, op)) 214 216 return -EPERM; 215 - 216 - 217 - flush_icache_range(ip, ip + 8); 218 217 219 218 return 0; 220 219 } ··· 240 245 241 246 /* 242 247 * On PPC32 the trampoline looks like: 243 - * 0x3d, 0x60, 0x00, 0x00 lis r11,sym@ha 244 - * 0x39, 0x6b, 0x00, 0x00 addi r11,r11,sym@l 245 - * 0x7d, 0x69, 0x03, 0xa6 mtctr r11 248 + * 0x3d, 0x80, 0x00, 0x00 lis r12,sym@ha 249 + * 0x39, 0x8c, 0x00, 0x00 addi r12,r12,sym@l 250 + * 0x7d, 0x89, 0x03, 0xa6 mtctr r12 246 251 * 0x4e, 0x80, 0x04, 0x20 bctr 247 252 */ 248 253 ··· 257 262 pr_devel(" %08x %08x ", jmp[0], jmp[1]); 258 263 259 264 /* verify that this is what we expect it to be */ 260 - if (((jmp[0] & 0xffff0000) != 0x3d600000) || 261 - ((jmp[1] & 0xffff0000) != 0x396b0000) || 262 - (jmp[2] != 0x7d6903a6) || 265 + if (((jmp[0] & 0xffff0000) != 0x3d800000) || 266 + ((jmp[1] & 0xffff0000) != 0x398c0000) || 267 + (jmp[2] != 0x7d8903a6) || 263 268 (jmp[3] != 0x4e800420)) { 264 269 printk(KERN_ERR "Not a trampoline\n"); 265 270 return -EINVAL; ··· 281 286 282 287 op = PPC_INST_NOP; 283 288 284 - if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 289 + if (patch_instruction((unsigned int *)ip, op)) 285 290 return -EPERM; 286 - 287 - flush_icache_range(ip, ip + 8); 288 291 289 292 return 0; 290 293 } ··· 419 426 420 427 pr_devel("write to %lx\n", rec->ip); 421 428 422 - if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) 429 + if (patch_instruction((unsigned int *)ip, op)) 423 430 return -EPERM; 424 - 425 - flush_icache_range(ip, ip + 8); 426 431 427 432 return 0; 428 433 } ··· 473 482 ret = ftrace_modify_code(ip, old, new); 474 483 475 484 return ret; 485 + } 486 + 487 + static int __ftrace_replace_code(struct dyn_ftrace *rec, int enable) 488 + { 489 + unsigned long ftrace_addr = (unsigned long)FTRACE_ADDR; 490 + int ret; 491 + 492 + ret = ftrace_update_record(rec, enable); 493 + 494 + switch (ret) { 495 + case FTRACE_UPDATE_IGNORE: 496 + return 0; 497 + case FTRACE_UPDATE_MAKE_CALL: 498 + return ftrace_make_call(rec, ftrace_addr); 499 + case FTRACE_UPDATE_MAKE_NOP: 500 + return ftrace_make_nop(NULL, rec, ftrace_addr); 501 + } 502 + 503 + return 0; 504 + } 505 + 506 + void ftrace_replace_code(int enable) 507 + { 508 + struct ftrace_rec_iter *iter; 509 + struct dyn_ftrace *rec; 510 + int ret; 511 + 512 + for (iter = ftrace_rec_iter_start(); iter; 513 + iter = ftrace_rec_iter_next(iter)) { 514 + rec = ftrace_rec_iter_record(iter); 515 + ret = __ftrace_replace_code(rec, enable); 516 + if (ret) { 517 + ftrace_bug(ret, rec->ip); 518 + return; 519 + } 520 + } 521 + } 522 + 523 + void arch_ftrace_update_code(int command) 524 + { 525 + if (command & FTRACE_UPDATE_CALLS) 526 + ftrace_replace_code(1); 527 + else if (command & FTRACE_DISABLE_CALLS) 528 + ftrace_replace_code(0); 529 + 530 + if (command & FTRACE_UPDATE_TRACE_FUNC) 531 + ftrace_update_ftrace_func(ftrace_trace_function); 532 + 533 + if (command & FTRACE_START_FUNC_RET) 534 + ftrace_enable_ftrace_graph_caller(); 535 + else if (command & FTRACE_STOP_FUNC_RET) 536 + ftrace_disable_ftrace_graph_caller(); 476 537 } 477 538 478 539 int __init ftrace_dyn_arch_init(void *data)
+7 -18
arch/powerpc/kernel/head_fsl_booke.S
··· 192 192 li r0,0 193 193 stwu r0,THREAD_SIZE-STACK_FRAME_OVERHEAD(r1) 194 194 195 - rlwinm r22,r1,0,0,31-THREAD_SHIFT /* current thread_info */ 195 + CURRENT_THREAD_INFO(r22, r1) 196 196 stw r24, TI_CPU(r22) 197 197 198 198 bl early_init ··· 556 556 /* SPE Unavailable */ 557 557 START_EXCEPTION(SPEUnavailable) 558 558 NORMAL_EXCEPTION_PROLOG(SPE_UNAVAIL) 559 - bne load_up_spe 560 - addi r3,r1,STACK_FRAME_OVERHEAD 559 + beq 1f 560 + bl load_up_spe 561 + b fast_exception_return 562 + 1: addi r3,r1,STACK_FRAME_OVERHEAD 561 563 EXC_XFER_EE_LITE(0x2010, KernelSPE) 562 564 #else 563 565 EXCEPTION(0x2020, SPE_UNAVAIL, SPEUnavailable, \ ··· 780 778 /* Note that the SPE support is closely modeled after the AltiVec 781 779 * support. Changes to one are likely to be applicable to the 782 780 * other! */ 783 - load_up_spe: 781 + _GLOBAL(load_up_spe) 784 782 /* 785 783 * Disable SPE for the task which had SPE previously, 786 784 * and save its SPE registers in its thread_struct. ··· 828 826 subi r4,r5,THREAD 829 827 stw r4,last_task_used_spe@l(r3) 830 828 #endif /* !CONFIG_SMP */ 831 - /* restore registers and return */ 832 - 2: REST_4GPRS(3, r11) 833 - lwz r10,_CCR(r11) 834 - REST_GPR(1, r11) 835 - mtcr r10 836 - lwz r10,_LINK(r11) 837 - mtlr r10 838 - REST_GPR(10, r11) 839 - mtspr SPRN_SRR1,r9 840 - mtspr SPRN_SRR0,r12 841 - REST_GPR(9, r11) 842 - REST_GPR(12, r11) 843 - lwz r11,GPR11(r11) 844 - rfi 829 + blr 845 830 846 831 /* 847 832 * SPE unavailable trap from kernel - print a message, but let
+1 -1
arch/powerpc/kernel/hw_breakpoint.c
··· 111 111 * and the single_step_dabr_instruction(), then cleanup the breakpoint 112 112 * restoration variables to prevent dangling pointers. 113 113 */ 114 - if (bp->ctx->task) 114 + if (bp->ctx && bp->ctx->task) 115 115 bp->ctx->task->thread.last_hit_ubp = NULL; 116 116 } 117 117
+2 -2
arch/powerpc/kernel/idle_6xx.S
··· 135 135 DSSALL 136 136 sync 137 137 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 138 - rlwinm r9,r1,0,0,31-THREAD_SHIFT /* current thread_info */ 138 + CURRENT_THREAD_INFO(r9, r1) 139 139 lwz r8,TI_LOCAL_FLAGS(r9) /* set napping bit */ 140 140 ori r8,r8,_TLF_NAPPING /* so when we take an exception */ 141 141 stw r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */ ··· 158 158 stw r9,_NIP(r11) /* make it do a blr */ 159 159 160 160 #ifdef CONFIG_SMP 161 - rlwinm r12,r11,0,0,31-THREAD_SHIFT 161 + CURRENT_THREAD_INFO(r12, r11) 162 162 lwz r11,TI_CPU(r12) /* get cpu number * 4 */ 163 163 slwi r11,r11,2 164 164 #else
+1 -1
arch/powerpc/kernel/idle_book3e.S
··· 60 60 1: /* Let's set the _TLF_NAPPING flag so interrupts make us return 61 61 * to the right spot 62 62 */ 63 - clrrdi r11,r1,THREAD_SHIFT 63 + CURRENT_THREAD_INFO(r11, r1) 64 64 ld r10,TI_LOCAL_FLAGS(r11) 65 65 ori r10,r10,_TLF_NAPPING 66 66 std r10,TI_LOCAL_FLAGS(r11)
+2 -2
arch/powerpc/kernel/idle_e500.S
··· 21 21 .text 22 22 23 23 _GLOBAL(e500_idle) 24 - rlwinm r3,r1,0,0,31-THREAD_SHIFT /* current thread_info */ 24 + CURRENT_THREAD_INFO(r3, r1) 25 25 lwz r4,TI_LOCAL_FLAGS(r3) /* set napping bit */ 26 26 ori r4,r4,_TLF_NAPPING /* so when we take an exception */ 27 27 stw r4,TI_LOCAL_FLAGS(r3) /* it will return to our caller */ ··· 96 96 stw r9,_NIP(r11) /* make it do a blr */ 97 97 98 98 #ifdef CONFIG_SMP 99 - rlwinm r12,r1,0,0,31-THREAD_SHIFT 99 + CURRENT_THREAD_INFO(r12, r1) 100 100 lwz r11,TI_CPU(r12) /* get cpu number * 4 */ 101 101 slwi r11,r11,2 102 102 #else
+1 -1
arch/powerpc/kernel/idle_power4.S
··· 59 59 DSSALL 60 60 sync 61 61 END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) 62 - clrrdi r9,r1,THREAD_SHIFT /* current thread_info */ 62 + CURRENT_THREAD_INFO(r9, r1) 63 63 ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */ 64 64 ori r8,r8,_TLF_NAPPING /* so when we take an exception */ 65 65 std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */
+232 -59
arch/powerpc/kernel/iommu.c
··· 33 33 #include <linux/bitmap.h> 34 34 #include <linux/iommu-helper.h> 35 35 #include <linux/crash_dump.h> 36 + #include <linux/hash.h> 37 + #include <linux/fault-inject.h> 38 + #include <linux/pci.h> 36 39 #include <asm/io.h> 37 40 #include <asm/prom.h> 38 41 #include <asm/iommu.h> ··· 43 40 #include <asm/machdep.h> 44 41 #include <asm/kdump.h> 45 42 #include <asm/fadump.h> 43 + #include <asm/vio.h> 46 44 47 45 #define DBG(...) 48 46 ··· 62 58 63 59 __setup("iommu=", setup_iommu); 64 60 61 + static DEFINE_PER_CPU(unsigned int, iommu_pool_hash); 62 + 63 + /* 64 + * We precalculate the hash to avoid doing it on every allocation. 65 + * 66 + * The hash is important to spread CPUs across all the pools. For example, 67 + * on a POWER7 with 4 way SMT we want interrupts on the primary threads and 68 + * with 4 pools all primary threads would map to the same pool. 69 + */ 70 + static int __init setup_iommu_pool_hash(void) 71 + { 72 + unsigned int i; 73 + 74 + for_each_possible_cpu(i) 75 + per_cpu(iommu_pool_hash, i) = hash_32(i, IOMMU_POOL_HASHBITS); 76 + 77 + return 0; 78 + } 79 + subsys_initcall(setup_iommu_pool_hash); 80 + 81 + #ifdef CONFIG_FAIL_IOMMU 82 + 83 + static DECLARE_FAULT_ATTR(fail_iommu); 84 + 85 + static int __init setup_fail_iommu(char *str) 86 + { 87 + return setup_fault_attr(&fail_iommu, str); 88 + } 89 + __setup("fail_iommu=", setup_fail_iommu); 90 + 91 + static bool should_fail_iommu(struct device *dev) 92 + { 93 + return dev->archdata.fail_iommu && should_fail(&fail_iommu, 1); 94 + } 95 + 96 + static int __init fail_iommu_debugfs(void) 97 + { 98 + struct dentry *dir = fault_create_debugfs_attr("fail_iommu", 99 + NULL, &fail_iommu); 100 + 101 + return IS_ERR(dir) ? PTR_ERR(dir) : 0; 102 + } 103 + late_initcall(fail_iommu_debugfs); 104 + 105 + static ssize_t fail_iommu_show(struct device *dev, 106 + struct device_attribute *attr, char *buf) 107 + { 108 + return sprintf(buf, "%d\n", dev->archdata.fail_iommu); 109 + } 110 + 111 + static ssize_t fail_iommu_store(struct device *dev, 112 + struct device_attribute *attr, const char *buf, 113 + size_t count) 114 + { 115 + int i; 116 + 117 + if (count > 0 && sscanf(buf, "%d", &i) > 0) 118 + dev->archdata.fail_iommu = (i == 0) ? 0 : 1; 119 + 120 + return count; 121 + } 122 + 123 + static DEVICE_ATTR(fail_iommu, S_IRUGO|S_IWUSR, fail_iommu_show, 124 + fail_iommu_store); 125 + 126 + static int fail_iommu_bus_notify(struct notifier_block *nb, 127 + unsigned long action, void *data) 128 + { 129 + struct device *dev = data; 130 + 131 + if (action == BUS_NOTIFY_ADD_DEVICE) { 132 + if (device_create_file(dev, &dev_attr_fail_iommu)) 133 + pr_warn("Unable to create IOMMU fault injection sysfs " 134 + "entries\n"); 135 + } else if (action == BUS_NOTIFY_DEL_DEVICE) { 136 + device_remove_file(dev, &dev_attr_fail_iommu); 137 + } 138 + 139 + return 0; 140 + } 141 + 142 + static struct notifier_block fail_iommu_bus_notifier = { 143 + .notifier_call = fail_iommu_bus_notify 144 + }; 145 + 146 + static int __init fail_iommu_setup(void) 147 + { 148 + #ifdef CONFIG_PCI 149 + bus_register_notifier(&pci_bus_type, &fail_iommu_bus_notifier); 150 + #endif 151 + #ifdef CONFIG_IBMVIO 152 + bus_register_notifier(&vio_bus_type, &fail_iommu_bus_notifier); 153 + #endif 154 + 155 + return 0; 156 + } 157 + /* 158 + * Must execute after PCI and VIO subsystem have initialised but before 159 + * devices are probed. 160 + */ 161 + arch_initcall(fail_iommu_setup); 162 + #else 163 + static inline bool should_fail_iommu(struct device *dev) 164 + { 165 + return false; 166 + } 167 + #endif 168 + 65 169 static unsigned long iommu_range_alloc(struct device *dev, 66 170 struct iommu_table *tbl, 67 171 unsigned long npages, ··· 183 71 int pass = 0; 184 72 unsigned long align_mask; 185 73 unsigned long boundary_size; 74 + unsigned long flags; 75 + unsigned int pool_nr; 76 + struct iommu_pool *pool; 186 77 187 78 align_mask = 0xffffffffffffffffl >> (64 - align_order); 188 79 ··· 198 83 return DMA_ERROR_CODE; 199 84 } 200 85 201 - if (handle && *handle) 86 + if (should_fail_iommu(dev)) 87 + return DMA_ERROR_CODE; 88 + 89 + /* 90 + * We don't need to disable preemption here because any CPU can 91 + * safely use any IOMMU pool. 92 + */ 93 + pool_nr = __raw_get_cpu_var(iommu_pool_hash) & (tbl->nr_pools - 1); 94 + 95 + if (largealloc) 96 + pool = &(tbl->large_pool); 97 + else 98 + pool = &(tbl->pools[pool_nr]); 99 + 100 + spin_lock_irqsave(&(pool->lock), flags); 101 + 102 + again: 103 + if ((pass == 0) && handle && *handle) 202 104 start = *handle; 203 105 else 204 - start = largealloc ? tbl->it_largehint : tbl->it_hint; 106 + start = pool->hint; 205 107 206 - /* Use only half of the table for small allocs (15 pages or less) */ 207 - limit = largealloc ? tbl->it_size : tbl->it_halfpoint; 208 - 209 - if (largealloc && start < tbl->it_halfpoint) 210 - start = tbl->it_halfpoint; 108 + limit = pool->end; 211 109 212 110 /* The case below can happen if we have a small segment appended 213 111 * to a large, or when the previous alloc was at the very end of 214 112 * the available space. If so, go back to the initial start. 215 113 */ 216 114 if (start >= limit) 217 - start = largealloc ? tbl->it_largehint : tbl->it_hint; 218 - 219 - again: 115 + start = pool->start; 220 116 221 117 if (limit + tbl->it_offset > mask) { 222 118 limit = mask - tbl->it_offset + 1; 223 119 /* If we're constrained on address range, first try 224 120 * at the masked hint to avoid O(n) search complexity, 225 - * but on second pass, start at 0. 121 + * but on second pass, start at 0 in pool 0. 226 122 */ 227 - if ((start & mask) >= limit || pass > 0) 228 - start = 0; 229 - else 123 + if ((start & mask) >= limit || pass > 0) { 124 + pool = &(tbl->pools[0]); 125 + start = pool->start; 126 + } else { 230 127 start &= mask; 128 + } 231 129 } 232 130 233 131 if (dev) ··· 254 126 tbl->it_offset, boundary_size >> IOMMU_PAGE_SHIFT, 255 127 align_mask); 256 128 if (n == -1) { 257 - if (likely(pass < 2)) { 258 - /* First failure, just rescan the half of the table. 259 - * Second failure, rescan the other half of the table. 260 - */ 261 - start = (largealloc ^ pass) ? tbl->it_halfpoint : 0; 262 - limit = pass ? tbl->it_size : limit; 129 + if (likely(pass == 0)) { 130 + /* First try the pool from the start */ 131 + pool->hint = pool->start; 263 132 pass++; 264 133 goto again; 134 + 135 + } else if (pass <= tbl->nr_pools) { 136 + /* Now try scanning all the other pools */ 137 + spin_unlock(&(pool->lock)); 138 + pool_nr = (pool_nr + 1) & (tbl->nr_pools - 1); 139 + pool = &tbl->pools[pool_nr]; 140 + spin_lock(&(pool->lock)); 141 + pool->hint = pool->start; 142 + pass++; 143 + goto again; 144 + 265 145 } else { 266 - /* Third failure, give up */ 146 + /* Give up */ 147 + spin_unlock_irqrestore(&(pool->lock), flags); 267 148 return DMA_ERROR_CODE; 268 149 } 269 150 } ··· 282 145 /* Bump the hint to a new block for small allocs. */ 283 146 if (largealloc) { 284 147 /* Don't bump to new block to avoid fragmentation */ 285 - tbl->it_largehint = end; 148 + pool->hint = end; 286 149 } else { 287 150 /* Overflow will be taken care of at the next allocation */ 288 - tbl->it_hint = (end + tbl->it_blocksize - 1) & 151 + pool->hint = (end + tbl->it_blocksize - 1) & 289 152 ~(tbl->it_blocksize - 1); 290 153 } 291 154 292 155 /* Update handle for SG allocations */ 293 156 if (handle) 294 157 *handle = end; 158 + 159 + spin_unlock_irqrestore(&(pool->lock), flags); 295 160 296 161 return n; 297 162 } ··· 304 165 unsigned long mask, unsigned int align_order, 305 166 struct dma_attrs *attrs) 306 167 { 307 - unsigned long entry, flags; 168 + unsigned long entry; 308 169 dma_addr_t ret = DMA_ERROR_CODE; 309 170 int build_fail; 310 171 311 - spin_lock_irqsave(&(tbl->it_lock), flags); 312 - 313 172 entry = iommu_range_alloc(dev, tbl, npages, NULL, mask, align_order); 314 173 315 - if (unlikely(entry == DMA_ERROR_CODE)) { 316 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 174 + if (unlikely(entry == DMA_ERROR_CODE)) 317 175 return DMA_ERROR_CODE; 318 - } 319 176 320 177 entry += tbl->it_offset; /* Offset into real TCE table */ 321 178 ret = entry << IOMMU_PAGE_SHIFT; /* Set the return dma address */ ··· 328 193 */ 329 194 if (unlikely(build_fail)) { 330 195 __iommu_free(tbl, ret, npages); 331 - 332 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 333 196 return DMA_ERROR_CODE; 334 197 } 335 198 ··· 335 202 if (ppc_md.tce_flush) 336 203 ppc_md.tce_flush(tbl); 337 204 338 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 339 - 340 205 /* Make sure updates are seen by hardware */ 341 206 mb(); 342 207 343 208 return ret; 344 209 } 345 210 346 - static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 347 - unsigned int npages) 211 + static bool iommu_free_check(struct iommu_table *tbl, dma_addr_t dma_addr, 212 + unsigned int npages) 348 213 { 349 214 unsigned long entry, free_entry; 350 215 ··· 362 231 printk(KERN_INFO "\tindex = 0x%llx\n", (u64)tbl->it_index); 363 232 WARN_ON(1); 364 233 } 365 - return; 234 + 235 + return false; 366 236 } 367 237 238 + return true; 239 + } 240 + 241 + static struct iommu_pool *get_pool(struct iommu_table *tbl, 242 + unsigned long entry) 243 + { 244 + struct iommu_pool *p; 245 + unsigned long largepool_start = tbl->large_pool.start; 246 + 247 + /* The large pool is the last pool at the top of the table */ 248 + if (entry >= largepool_start) { 249 + p = &tbl->large_pool; 250 + } else { 251 + unsigned int pool_nr = entry / tbl->poolsize; 252 + 253 + BUG_ON(pool_nr > tbl->nr_pools); 254 + p = &tbl->pools[pool_nr]; 255 + } 256 + 257 + return p; 258 + } 259 + 260 + static void __iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 261 + unsigned int npages) 262 + { 263 + unsigned long entry, free_entry; 264 + unsigned long flags; 265 + struct iommu_pool *pool; 266 + 267 + entry = dma_addr >> IOMMU_PAGE_SHIFT; 268 + free_entry = entry - tbl->it_offset; 269 + 270 + pool = get_pool(tbl, free_entry); 271 + 272 + if (!iommu_free_check(tbl, dma_addr, npages)) 273 + return; 274 + 368 275 ppc_md.tce_free(tbl, entry, npages); 276 + 277 + spin_lock_irqsave(&(pool->lock), flags); 369 278 bitmap_clear(tbl->it_map, free_entry, npages); 279 + spin_unlock_irqrestore(&(pool->lock), flags); 370 280 } 371 281 372 282 static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, 373 283 unsigned int npages) 374 284 { 375 - unsigned long flags; 376 - 377 - spin_lock_irqsave(&(tbl->it_lock), flags); 378 - 379 285 __iommu_free(tbl, dma_addr, npages); 380 286 381 287 /* Make sure TLB cache is flushed if the HW needs it. We do ··· 421 253 */ 422 254 if (ppc_md.tce_flush) 423 255 ppc_md.tce_flush(tbl); 424 - 425 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 426 256 } 427 257 428 258 int iommu_map_sg(struct device *dev, struct iommu_table *tbl, ··· 429 263 struct dma_attrs *attrs) 430 264 { 431 265 dma_addr_t dma_next = 0, dma_addr; 432 - unsigned long flags; 433 266 struct scatterlist *s, *outs, *segstart; 434 267 int outcount, incount, i, build_fail = 0; 435 268 unsigned int align; ··· 449 284 outs->dma_length = 0; 450 285 451 286 DBG("sg mapping %d elements:\n", nelems); 452 - 453 - spin_lock_irqsave(&(tbl->it_lock), flags); 454 287 455 288 max_seg_size = dma_get_max_seg_size(dev); 456 289 for_each_sg(sglist, s, nelems, i) { ··· 532 369 if (ppc_md.tce_flush) 533 370 ppc_md.tce_flush(tbl); 534 371 535 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 536 - 537 372 DBG("mapped %d elements:\n", outcount); 538 373 539 374 /* For the sake of iommu_unmap_sg, we clear out the length in the ··· 563 402 if (s == outs) 564 403 break; 565 404 } 566 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 567 405 return 0; 568 406 } 569 407 ··· 572 412 struct dma_attrs *attrs) 573 413 { 574 414 struct scatterlist *sg; 575 - unsigned long flags; 576 415 577 416 BUG_ON(direction == DMA_NONE); 578 417 579 418 if (!tbl) 580 419 return; 581 - 582 - spin_lock_irqsave(&(tbl->it_lock), flags); 583 420 584 421 sg = sglist; 585 422 while (nelems--) { ··· 597 440 */ 598 441 if (ppc_md.tce_flush) 599 442 ppc_md.tce_flush(tbl); 600 - 601 - spin_unlock_irqrestore(&(tbl->it_lock), flags); 602 443 } 603 444 604 445 static void iommu_table_clear(struct iommu_table *tbl) ··· 649 494 unsigned long sz; 650 495 static int welcomed = 0; 651 496 struct page *page; 652 - 653 - /* Set aside 1/4 of the table for large allocations. */ 654 - tbl->it_halfpoint = tbl->it_size * 3 / 4; 497 + unsigned int i; 498 + struct iommu_pool *p; 655 499 656 500 /* number of bytes needed for the bitmap */ 657 501 sz = (tbl->it_size + 7) >> 3; ··· 669 515 if (tbl->it_offset == 0) 670 516 set_bit(0, tbl->it_map); 671 517 672 - tbl->it_hint = 0; 673 - tbl->it_largehint = tbl->it_halfpoint; 674 - spin_lock_init(&tbl->it_lock); 518 + /* We only split the IOMMU table if we have 1GB or more of space */ 519 + if ((tbl->it_size << IOMMU_PAGE_SHIFT) >= (1UL * 1024 * 1024 * 1024)) 520 + tbl->nr_pools = IOMMU_NR_POOLS; 521 + else 522 + tbl->nr_pools = 1; 523 + 524 + /* We reserve the top 1/4 of the table for large allocations */ 525 + tbl->poolsize = (tbl->it_size * 3 / 4) / tbl->nr_pools; 526 + 527 + for (i = 0; i < tbl->nr_pools; i++) { 528 + p = &tbl->pools[i]; 529 + spin_lock_init(&(p->lock)); 530 + p->start = tbl->poolsize * i; 531 + p->hint = p->start; 532 + p->end = p->start + tbl->poolsize; 533 + } 534 + 535 + p = &tbl->large_pool; 536 + spin_lock_init(&(p->lock)); 537 + p->start = tbl->poolsize * i; 538 + p->hint = p->start; 539 + p->end = tbl->it_size; 675 540 676 541 iommu_table_clear(tbl); 677 542
+1 -1
arch/powerpc/kernel/kvm.c
··· 302 302 303 303 if (imm_one) { 304 304 p[kvm_emulate_wrtee_reg_offs] = 305 - KVM_INST_LI | __PPC_RT(30) | MSR_EE; 305 + KVM_INST_LI | __PPC_RT(R30) | MSR_EE; 306 306 } else { 307 307 /* Make clobbered registers work too */ 308 308 switch (get_rt(rt)) {
+2 -2
arch/powerpc/kernel/misc_32.S
··· 179 179 mtspr SPRN_HID1,r4 180 180 181 181 /* Store new HID1 image */ 182 - rlwinm r6,r1,0,0,(31-THREAD_SHIFT) 182 + CURRENT_THREAD_INFO(r6, r1) 183 183 lwz r6,TI_CPU(r6) 184 184 slwi r6,r6,2 185 185 addis r6,r6,nap_save_hid1@ha ··· 699 699 #ifdef CONFIG_SMP 700 700 _GLOBAL(start_secondary_resume) 701 701 /* Reset stack */ 702 - rlwinm r1,r1,0,0,(31-THREAD_SHIFT) /* current_thread_info() */ 702 + CURRENT_THREAD_INFO(r1, r1) 703 703 addi r1,r1,THREAD_SIZE-STACK_FRAME_OVERHEAD 704 704 li r3,0 705 705 stw r3,0(r1) /* Zero the stack frame pointer */
+2 -7
arch/powerpc/kernel/misc_64.S
··· 301 301 302 302 #ifdef CONFIG_PPC_PASEMI 303 303 304 - /* No support in all binutils for these yet, so use defines */ 305 - #define LBZCIX(RT,RA,RB) .long (0x7c0006aa|(RT<<21)|(RA<<16)|(RB << 11)) 306 - #define STBCIX(RS,RA,RB) .long (0x7c0007aa|(RS<<21)|(RA<<16)|(RB << 11)) 307 - 308 - 309 304 _GLOBAL(real_205_readb) 310 305 mfmsr r7 311 306 ori r0,r7,MSR_DR ··· 309 314 mtmsrd r0 310 315 sync 311 316 isync 312 - LBZCIX(r3,0,r3) 317 + LBZCIX(R3,R0,R3) 313 318 isync 314 319 mtmsrd r7 315 320 sync ··· 324 329 mtmsrd r0 325 330 sync 326 331 isync 327 - STBCIX(r3,0,r4) 332 + STBCIX(R3,R0,R4) 328 333 isync 329 334 mtmsrd r7 330 335 sync
-1
arch/powerpc/kernel/pci-common.c
··· 1646 1646 pci_free_resource_list(&resources); 1647 1647 return; 1648 1648 } 1649 - bus->secondary = hose->first_busno; 1650 1649 hose->bus = bus; 1651 1650 1652 1651 /* Get probe mode and perform scan */
-1
arch/powerpc/kernel/pci_of_scan.c
··· 198 198 199 199 /** 200 200 * of_scan_pci_bridge - Set up a PCI bridge and scan for child nodes 201 - * @node: device tree node of bridge 202 201 * @dev: pci_dev structure for the bridge 203 202 * 204 203 * of_scan_bus() calls this routine for each PCI bridge that it finds, and
+27
arch/powerpc/kernel/setup-common.c
··· 720 720 arch_initcall(powerpc_debugfs_init); 721 721 #endif 722 722 723 + #ifdef CONFIG_BOOKE_WDT 724 + extern u32 booke_wdt_enabled; 725 + extern u32 booke_wdt_period; 726 + 727 + /* Checks wdt=x and wdt_period=xx command-line option */ 728 + notrace int __init early_parse_wdt(char *p) 729 + { 730 + if (p && strncmp(p, "0", 1) != 0) 731 + booke_wdt_enabled = 1; 732 + 733 + return 0; 734 + } 735 + early_param("wdt", early_parse_wdt); 736 + 737 + int __init early_parse_wdt_period(char *p) 738 + { 739 + unsigned long ret; 740 + if (p) { 741 + if (!kstrtol(p, 0, &ret)) 742 + booke_wdt_period = ret; 743 + } 744 + 745 + return 0; 746 + } 747 + early_param("wdt_period", early_parse_wdt_period); 748 + #endif /* CONFIG_BOOKE_WDT */ 749 + 723 750 void ppc_printk_progress(char *s, unsigned short hex) 724 751 { 725 752 pr_info("%s\n", s);
-24
arch/powerpc/kernel/setup_32.c
··· 149 149 ppc_md.progress("id mach(): done", 0x200); 150 150 } 151 151 152 - #ifdef CONFIG_BOOKE_WDT 153 - extern u32 booke_wdt_enabled; 154 - extern u32 booke_wdt_period; 155 - 156 - /* Checks wdt=x and wdt_period=xx command-line option */ 157 - notrace int __init early_parse_wdt(char *p) 158 - { 159 - if (p && strncmp(p, "0", 1) != 0) 160 - booke_wdt_enabled = 1; 161 - 162 - return 0; 163 - } 164 - early_param("wdt", early_parse_wdt); 165 - 166 - int __init early_parse_wdt_period (char *p) 167 - { 168 - if (p) 169 - booke_wdt_period = simple_strtoul(p, NULL, 0); 170 - 171 - return 0; 172 - } 173 - early_param("wdt_period", early_parse_wdt_period); 174 - #endif /* CONFIG_BOOKE_WDT */ 175 - 176 152 /* Checks "l2cr=xxxx" command-line option */ 177 153 int __init ppc_setup_l2cr(char *str) 178 154 {
+3
arch/powerpc/kernel/smp.c
··· 48 48 #ifdef CONFIG_PPC64 49 49 #include <asm/paca.h> 50 50 #endif 51 + #include <asm/vdso.h> 51 52 #include <asm/debug.h> 52 53 53 54 #ifdef DEBUG ··· 571 570 #ifdef CONFIG_PPC64 572 571 if (system_state == SYSTEM_RUNNING) 573 572 vdso_data->processorCount++; 573 + 574 + vdso_getcpu_init(); 574 575 #endif 575 576 notify_cpu_starting(cpu); 576 577 set_cpu_online(cpu, true);
+28
arch/powerpc/kernel/vdso.c
··· 706 706 } 707 707 } 708 708 709 + #ifdef CONFIG_PPC64 710 + int __cpuinit vdso_getcpu_init(void) 711 + { 712 + unsigned long cpu, node, val; 713 + 714 + /* 715 + * SPRG3 contains the CPU in the bottom 16 bits and the NUMA node in 716 + * the next 16 bits. The VDSO uses this to implement getcpu(). 717 + */ 718 + cpu = get_cpu(); 719 + WARN_ON_ONCE(cpu > 0xffff); 720 + 721 + node = cpu_to_node(cpu); 722 + WARN_ON_ONCE(node > 0xffff); 723 + 724 + val = (cpu & 0xfff) | ((node & 0xffff) << 16); 725 + mtspr(SPRN_SPRG3, val); 726 + #ifdef CONFIG_KVM_BOOK3S_HANDLER 727 + get_paca()->kvm_hstate.sprg3 = val; 728 + #endif 729 + 730 + put_cpu(); 731 + 732 + return 0; 733 + } 734 + /* We need to call this before SMP init */ 735 + early_initcall(vdso_getcpu_init); 736 + #endif 709 737 710 738 static int __init vdso_init(void) 711 739 {
+3 -1
arch/powerpc/kernel/vdso32/Makefile
··· 1 1 2 2 # List of files in the vdso, has to be asm only for now 3 3 4 - obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o 4 + obj-vdso32-$(CONFIG_PPC64) = getcpu.o 5 + obj-vdso32 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o \ 6 + $(obj-vdso32-y) 5 7 6 8 # Build rules 7 9
+45
arch/powerpc/kernel/vdso32/getcpu.S
··· 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, 2012 17 + * 18 + * Author: Anton Blanchard <anton@au.ibm.com> 19 + */ 20 + #include <asm/ppc_asm.h> 21 + #include <asm/vdso.h> 22 + 23 + .text 24 + /* 25 + * Exact prototype of getcpu 26 + * 27 + * int __kernel_getcpu(unsigned *cpu, unsigned *node); 28 + * 29 + */ 30 + V_FUNCTION_BEGIN(__kernel_getcpu) 31 + .cfi_startproc 32 + mfspr r5,SPRN_USPRG3 33 + cmpdi cr0,r3,0 34 + cmpdi cr1,r4,0 35 + clrlwi r6,r5,16 36 + rlwinm r7,r5,16,31-15,31-0 37 + beq cr0,1f 38 + stw r6,0(r3) 39 + 1: beq cr1,2f 40 + stw r7,0(r4) 41 + 2: crclr cr0*4+so 42 + li r3,0 /* always success */ 43 + blr 44 + .cfi_endproc 45 + V_FUNCTION_END(__kernel_getcpu)
+3
arch/powerpc/kernel/vdso32/vdso32.lds.S
··· 147 147 __kernel_sync_dicache_p5; 148 148 __kernel_sigtramp32; 149 149 __kernel_sigtramp_rt32; 150 + #ifdef CONFIG_PPC64 151 + __kernel_getcpu; 152 + #endif 150 153 151 154 local: *; 152 155 };
+1 -1
arch/powerpc/kernel/vdso64/Makefile
··· 1 1 # List of files in the vdso, has to be asm only for now 2 2 3 - obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o 3 + obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o 4 4 5 5 # Build rules 6 6
+45
arch/powerpc/kernel/vdso64/getcpu.S
··· 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, 2012 17 + * 18 + * Author: Anton Blanchard <anton@au.ibm.com> 19 + */ 20 + #include <asm/ppc_asm.h> 21 + #include <asm/vdso.h> 22 + 23 + .text 24 + /* 25 + * Exact prototype of getcpu 26 + * 27 + * int __kernel_getcpu(unsigned *cpu, unsigned *node); 28 + * 29 + */ 30 + V_FUNCTION_BEGIN(__kernel_getcpu) 31 + .cfi_startproc 32 + mfspr r5,SPRN_USPRG3 33 + cmpdi cr0,r3,0 34 + cmpdi cr1,r4,0 35 + clrlwi r6,r5,16 36 + rlwinm r7,r5,16,31-15,31-0 37 + beq cr0,1f 38 + stw r6,0(r3) 39 + 1: beq cr1,2f 40 + stw r7,0(r4) 41 + 2: crclr cr0*4+so 42 + li r3,0 /* always success */ 43 + blr 44 + .cfi_endproc 45 + V_FUNCTION_END(__kernel_getcpu)
+1
arch/powerpc/kernel/vdso64/vdso64.lds.S
··· 146 146 __kernel_sync_dicache; 147 147 __kernel_sync_dicache_p5; 148 148 __kernel_sigtramp_rt64; 149 + __kernel_getcpu; 149 150 150 151 local: *; 151 152 };
+26 -16
arch/powerpc/kernel/vio.c
··· 37 37 #include <asm/page.h> 38 38 #include <asm/hvcall.h> 39 39 40 - static struct bus_type vio_bus_type; 41 - 42 40 static struct vio_dev vio_bus_device = { /* fake "parent" device */ 43 41 .name = "vio", 44 42 .type = "", ··· 623 625 * vio_cmo_set_dev_desired - Set desired entitlement for a device 624 626 * 625 627 * @viodev: struct vio_dev for device to alter 626 - * @new_desired: new desired entitlement level in bytes 628 + * @desired: new desired entitlement level in bytes 627 629 * 628 630 * For use by devices to request a change to their entitlement at runtime or 629 631 * through sysfs. The desired entitlement level is changed and a balancing ··· 1260 1262 1261 1263 /** 1262 1264 * vio_register_driver: - Register a new vio driver 1263 - * @drv: The vio_driver structure to be registered. 1265 + * @viodrv: The vio_driver structure to be registered. 1264 1266 */ 1265 1267 int __vio_register_driver(struct vio_driver *viodrv, struct module *owner, 1266 1268 const char *mod_name) ··· 1280 1282 1281 1283 /** 1282 1284 * vio_unregister_driver - Remove registration of vio driver. 1283 - * @driver: The vio_driver struct to be removed form registration 1285 + * @viodrv: The vio_driver struct to be removed form registration 1284 1286 */ 1285 1287 void vio_unregister_driver(struct vio_driver *viodrv) 1286 1288 { ··· 1395 1397 viodev->name = of_node->name; 1396 1398 viodev->dev.of_node = of_node_get(of_node); 1397 1399 1398 - if (firmware_has_feature(FW_FEATURE_CMO)) 1399 - vio_cmo_set_dma_ops(viodev); 1400 - else 1401 - set_dma_ops(&viodev->dev, &dma_iommu_ops); 1402 - set_iommu_table_base(&viodev->dev, vio_build_iommu_table(viodev)); 1403 1400 set_dev_node(&viodev->dev, of_node_to_nid(of_node)); 1404 1401 1405 1402 /* init generic 'struct device' fields: */ 1406 1403 viodev->dev.parent = &vio_bus_device.dev; 1407 1404 viodev->dev.bus = &vio_bus_type; 1408 1405 viodev->dev.release = vio_dev_release; 1409 - /* needed to ensure proper operation of coherent allocations 1410 - * later, in case driver doesn't set it explicitly */ 1411 - dma_set_mask(&viodev->dev, DMA_BIT_MASK(64)); 1412 - dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64)); 1406 + 1407 + if (of_get_property(viodev->dev.of_node, "ibm,my-dma-window", NULL)) { 1408 + if (firmware_has_feature(FW_FEATURE_CMO)) 1409 + vio_cmo_set_dma_ops(viodev); 1410 + else 1411 + set_dma_ops(&viodev->dev, &dma_iommu_ops); 1412 + 1413 + set_iommu_table_base(&viodev->dev, 1414 + vio_build_iommu_table(viodev)); 1415 + 1416 + /* needed to ensure proper operation of coherent allocations 1417 + * later, in case driver doesn't set it explicitly */ 1418 + dma_set_mask(&viodev->dev, DMA_BIT_MASK(64)); 1419 + dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64)); 1420 + } 1413 1421 1414 1422 /* register with generic device framework */ 1415 1423 if (device_register(&viodev->dev)) { ··· 1495 1491 if (firmware_has_feature(FW_FEATURE_CMO)) 1496 1492 vio_cmo_bus_init(); 1497 1493 1494 + return 0; 1495 + } 1496 + postcore_initcall(vio_bus_init); 1497 + 1498 + static int __init vio_device_init(void) 1499 + { 1498 1500 vio_bus_scan_register_devices("vdevice"); 1499 1501 vio_bus_scan_register_devices("ibm,platform-facilities"); 1500 1502 1501 1503 return 0; 1502 1504 } 1503 - __initcall(vio_bus_init); 1505 + device_initcall(vio_device_init); 1504 1506 1505 1507 static ssize_t name_show(struct device *dev, 1506 1508 struct device_attribute *attr, char *buf) ··· 1578 1568 return 0; 1579 1569 } 1580 1570 1581 - static struct bus_type vio_bus_type = { 1571 + struct bus_type vio_bus_type = { 1582 1572 .name = "vio", 1583 1573 .dev_attrs = vio_dev_attrs, 1584 1574 .uevent = vio_hotplug,
+113 -112
arch/powerpc/kvm/book3s_hv_rmhandlers.S
··· 72 72 mtsrr1 r6 73 73 RFI 74 74 75 - #define ULONG_SIZE 8 76 - #define VCPU_GPR(n) (VCPU_GPRS + (n * ULONG_SIZE)) 77 - 78 75 /****************************************************************************** 79 76 * * 80 77 * Entry code * ··· 203 206 /* Load up FP, VMX and VSX registers */ 204 207 bl kvmppc_load_fp 205 208 206 - ld r14, VCPU_GPR(r14)(r4) 207 - ld r15, VCPU_GPR(r15)(r4) 208 - ld r16, VCPU_GPR(r16)(r4) 209 - ld r17, VCPU_GPR(r17)(r4) 210 - ld r18, VCPU_GPR(r18)(r4) 211 - ld r19, VCPU_GPR(r19)(r4) 212 - ld r20, VCPU_GPR(r20)(r4) 213 - ld r21, VCPU_GPR(r21)(r4) 214 - ld r22, VCPU_GPR(r22)(r4) 215 - ld r23, VCPU_GPR(r23)(r4) 216 - ld r24, VCPU_GPR(r24)(r4) 217 - ld r25, VCPU_GPR(r25)(r4) 218 - ld r26, VCPU_GPR(r26)(r4) 219 - ld r27, VCPU_GPR(r27)(r4) 220 - ld r28, VCPU_GPR(r28)(r4) 221 - ld r29, VCPU_GPR(r29)(r4) 222 - ld r30, VCPU_GPR(r30)(r4) 223 - ld r31, VCPU_GPR(r31)(r4) 209 + ld r14, VCPU_GPR(R14)(r4) 210 + ld r15, VCPU_GPR(R15)(r4) 211 + ld r16, VCPU_GPR(R16)(r4) 212 + ld r17, VCPU_GPR(R17)(r4) 213 + ld r18, VCPU_GPR(R18)(r4) 214 + ld r19, VCPU_GPR(R19)(r4) 215 + ld r20, VCPU_GPR(R20)(r4) 216 + ld r21, VCPU_GPR(R21)(r4) 217 + ld r22, VCPU_GPR(R22)(r4) 218 + ld r23, VCPU_GPR(R23)(r4) 219 + ld r24, VCPU_GPR(R24)(r4) 220 + ld r25, VCPU_GPR(R25)(r4) 221 + ld r26, VCPU_GPR(R26)(r4) 222 + ld r27, VCPU_GPR(R27)(r4) 223 + ld r28, VCPU_GPR(R28)(r4) 224 + ld r29, VCPU_GPR(R29)(r4) 225 + ld r30, VCPU_GPR(R30)(r4) 226 + ld r31, VCPU_GPR(R31)(r4) 224 227 225 228 BEGIN_FTR_SECTION 226 229 /* Switch DSCR to guest value */ ··· 544 547 mtlr r5 545 548 mtcr r6 546 549 547 - ld r0, VCPU_GPR(r0)(r4) 548 - ld r1, VCPU_GPR(r1)(r4) 549 - ld r2, VCPU_GPR(r2)(r4) 550 - ld r3, VCPU_GPR(r3)(r4) 551 - ld r5, VCPU_GPR(r5)(r4) 552 - ld r6, VCPU_GPR(r6)(r4) 553 - ld r7, VCPU_GPR(r7)(r4) 554 - ld r8, VCPU_GPR(r8)(r4) 555 - ld r9, VCPU_GPR(r9)(r4) 556 - ld r10, VCPU_GPR(r10)(r4) 557 - ld r11, VCPU_GPR(r11)(r4) 558 - ld r12, VCPU_GPR(r12)(r4) 559 - ld r13, VCPU_GPR(r13)(r4) 550 + ld r0, VCPU_GPR(R0)(r4) 551 + ld r1, VCPU_GPR(R1)(r4) 552 + ld r2, VCPU_GPR(R2)(r4) 553 + ld r3, VCPU_GPR(R3)(r4) 554 + ld r5, VCPU_GPR(R5)(r4) 555 + ld r6, VCPU_GPR(R6)(r4) 556 + ld r7, VCPU_GPR(R7)(r4) 557 + ld r8, VCPU_GPR(R8)(r4) 558 + ld r9, VCPU_GPR(R9)(r4) 559 + ld r10, VCPU_GPR(R10)(r4) 560 + ld r11, VCPU_GPR(R11)(r4) 561 + ld r12, VCPU_GPR(R12)(r4) 562 + ld r13, VCPU_GPR(R13)(r4) 560 563 561 - ld r4, VCPU_GPR(r4)(r4) 564 + ld r4, VCPU_GPR(R4)(r4) 562 565 563 566 hrfid 564 567 b . ··· 587 590 588 591 /* Save registers */ 589 592 590 - std r0, VCPU_GPR(r0)(r9) 591 - std r1, VCPU_GPR(r1)(r9) 592 - std r2, VCPU_GPR(r2)(r9) 593 - std r3, VCPU_GPR(r3)(r9) 594 - std r4, VCPU_GPR(r4)(r9) 595 - std r5, VCPU_GPR(r5)(r9) 596 - std r6, VCPU_GPR(r6)(r9) 597 - std r7, VCPU_GPR(r7)(r9) 598 - std r8, VCPU_GPR(r8)(r9) 593 + std r0, VCPU_GPR(R0)(r9) 594 + std r1, VCPU_GPR(R1)(r9) 595 + std r2, VCPU_GPR(R2)(r9) 596 + std r3, VCPU_GPR(R3)(r9) 597 + std r4, VCPU_GPR(R4)(r9) 598 + std r5, VCPU_GPR(R5)(r9) 599 + std r6, VCPU_GPR(R6)(r9) 600 + std r7, VCPU_GPR(R7)(r9) 601 + std r8, VCPU_GPR(R8)(r9) 599 602 ld r0, HSTATE_HOST_R2(r13) 600 - std r0, VCPU_GPR(r9)(r9) 601 - std r10, VCPU_GPR(r10)(r9) 602 - std r11, VCPU_GPR(r11)(r9) 603 + std r0, VCPU_GPR(R9)(r9) 604 + std r10, VCPU_GPR(R10)(r9) 605 + std r11, VCPU_GPR(R11)(r9) 603 606 ld r3, HSTATE_SCRATCH0(r13) 604 607 lwz r4, HSTATE_SCRATCH1(r13) 605 - std r3, VCPU_GPR(r12)(r9) 608 + std r3, VCPU_GPR(R12)(r9) 606 609 stw r4, VCPU_CR(r9) 607 610 608 611 /* Restore R1/R2 so we can handle faults */ ··· 623 626 624 627 GET_SCRATCH0(r3) 625 628 mflr r4 626 - std r3, VCPU_GPR(r13)(r9) 629 + std r3, VCPU_GPR(R13)(r9) 627 630 std r4, VCPU_LR(r9) 628 631 629 632 /* Unset guest mode */ ··· 965 968 END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) 966 969 967 970 /* Save non-volatile GPRs */ 968 - std r14, VCPU_GPR(r14)(r9) 969 - std r15, VCPU_GPR(r15)(r9) 970 - std r16, VCPU_GPR(r16)(r9) 971 - std r17, VCPU_GPR(r17)(r9) 972 - std r18, VCPU_GPR(r18)(r9) 973 - std r19, VCPU_GPR(r19)(r9) 974 - std r20, VCPU_GPR(r20)(r9) 975 - std r21, VCPU_GPR(r21)(r9) 976 - std r22, VCPU_GPR(r22)(r9) 977 - std r23, VCPU_GPR(r23)(r9) 978 - std r24, VCPU_GPR(r24)(r9) 979 - std r25, VCPU_GPR(r25)(r9) 980 - std r26, VCPU_GPR(r26)(r9) 981 - std r27, VCPU_GPR(r27)(r9) 982 - std r28, VCPU_GPR(r28)(r9) 983 - std r29, VCPU_GPR(r29)(r9) 984 - std r30, VCPU_GPR(r30)(r9) 985 - std r31, VCPU_GPR(r31)(r9) 971 + std r14, VCPU_GPR(R14)(r9) 972 + std r15, VCPU_GPR(R15)(r9) 973 + std r16, VCPU_GPR(R16)(r9) 974 + std r17, VCPU_GPR(R17)(r9) 975 + std r18, VCPU_GPR(R18)(r9) 976 + std r19, VCPU_GPR(R19)(r9) 977 + std r20, VCPU_GPR(R20)(r9) 978 + std r21, VCPU_GPR(R21)(r9) 979 + std r22, VCPU_GPR(R22)(r9) 980 + std r23, VCPU_GPR(R23)(r9) 981 + std r24, VCPU_GPR(R24)(r9) 982 + std r25, VCPU_GPR(R25)(r9) 983 + std r26, VCPU_GPR(R26)(r9) 984 + std r27, VCPU_GPR(R27)(r9) 985 + std r28, VCPU_GPR(R28)(r9) 986 + std r29, VCPU_GPR(R29)(r9) 987 + std r30, VCPU_GPR(R30)(r9) 988 + std r31, VCPU_GPR(R31)(r9) 986 989 987 990 /* Save SPRGs */ 988 991 mfspr r3, SPRN_SPRG0 ··· 1063 1066 li r6,7 1064 1067 mtspr SPRN_DABR,r5 1065 1068 mtspr SPRN_DABRX,r6 1069 + 1070 + /* Restore SPRG3 */ 1071 + ld r3,HSTATE_SPRG3(r13) 1072 + mtspr SPRN_SPRG3,r3 1066 1073 1067 1074 /* 1068 1075 * Reload DEC. HDEC interrupts were disabled when ··· 1161 1160 andi. r0, r11, MSR_DR /* data relocation enabled? */ 1162 1161 beq 3f 1163 1162 clrrdi r0, r4, 28 1164 - PPC_SLBFEE_DOT(r5, r0) /* if so, look up SLB */ 1163 + PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */ 1165 1164 bne 1f /* if no SLB entry found */ 1166 1165 4: std r4, VCPU_FAULT_DAR(r9) 1167 1166 stw r6, VCPU_FAULT_DSISR(r9) ··· 1235 1234 andi. r0, r11, MSR_IR /* instruction relocation enabled? */ 1236 1235 beq 3f 1237 1236 clrrdi r0, r10, 28 1238 - PPC_SLBFEE_DOT(r5, r0) /* if so, look up SLB */ 1237 + PPC_SLBFEE_DOT(R5, R0) /* if so, look up SLB */ 1239 1238 bne 1f /* if no SLB entry found */ 1240 1239 4: 1241 1240 /* Search the hash table. */ ··· 1279 1278 */ 1280 1279 .globl hcall_try_real_mode 1281 1280 hcall_try_real_mode: 1282 - ld r3,VCPU_GPR(r3)(r9) 1281 + ld r3,VCPU_GPR(R3)(r9) 1283 1282 andi. r0,r11,MSR_PR 1284 1283 bne hcall_real_cont 1285 1284 clrrdi r3,r3,2 ··· 1292 1291 add r3,r3,r4 1293 1292 mtctr r3 1294 1293 mr r3,r9 /* get vcpu pointer */ 1295 - ld r4,VCPU_GPR(r4)(r9) 1294 + ld r4,VCPU_GPR(R4)(r9) 1296 1295 bctrl 1297 1296 cmpdi r3,H_TOO_HARD 1298 1297 beq hcall_real_fallback 1299 1298 ld r4,HSTATE_KVM_VCPU(r13) 1300 - std r3,VCPU_GPR(r3)(r4) 1299 + std r3,VCPU_GPR(R3)(r4) 1301 1300 ld r10,VCPU_PC(r4) 1302 1301 ld r11,VCPU_MSR(r4) 1303 1302 b fast_guest_return ··· 1425 1424 li r0,0 /* set trap to 0 to say hcall is handled */ 1426 1425 stw r0,VCPU_TRAP(r3) 1427 1426 li r0,H_SUCCESS 1428 - std r0,VCPU_GPR(r3)(r3) 1427 + std r0,VCPU_GPR(R3)(r3) 1429 1428 BEGIN_FTR_SECTION 1430 1429 b 2f /* just send it up to host on 970 */ 1431 1430 END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206) ··· 1444 1443 addi r6,r5,VCORE_NAPPING_THREADS 1445 1444 31: lwarx r4,0,r6 1446 1445 or r4,r4,r0 1447 - PPC_POPCNTW(r7,r4) 1446 + PPC_POPCNTW(R7,R4) 1448 1447 cmpw r7,r8 1449 1448 bge 2f 1450 1449 stwcx. r4,0,r6 ··· 1465 1464 * DAR, DSISR, DABR, DABRX, DSCR, PMCx, MMCRx, SIAR, SDAR. 1466 1465 */ 1467 1466 /* Save non-volatile GPRs */ 1468 - std r14, VCPU_GPR(r14)(r3) 1469 - std r15, VCPU_GPR(r15)(r3) 1470 - std r16, VCPU_GPR(r16)(r3) 1471 - std r17, VCPU_GPR(r17)(r3) 1472 - std r18, VCPU_GPR(r18)(r3) 1473 - std r19, VCPU_GPR(r19)(r3) 1474 - std r20, VCPU_GPR(r20)(r3) 1475 - std r21, VCPU_GPR(r21)(r3) 1476 - std r22, VCPU_GPR(r22)(r3) 1477 - std r23, VCPU_GPR(r23)(r3) 1478 - std r24, VCPU_GPR(r24)(r3) 1479 - std r25, VCPU_GPR(r25)(r3) 1480 - std r26, VCPU_GPR(r26)(r3) 1481 - std r27, VCPU_GPR(r27)(r3) 1482 - std r28, VCPU_GPR(r28)(r3) 1483 - std r29, VCPU_GPR(r29)(r3) 1484 - std r30, VCPU_GPR(r30)(r3) 1485 - std r31, VCPU_GPR(r31)(r3) 1467 + std r14, VCPU_GPR(R14)(r3) 1468 + std r15, VCPU_GPR(R15)(r3) 1469 + std r16, VCPU_GPR(R16)(r3) 1470 + std r17, VCPU_GPR(R17)(r3) 1471 + std r18, VCPU_GPR(R18)(r3) 1472 + std r19, VCPU_GPR(R19)(r3) 1473 + std r20, VCPU_GPR(R20)(r3) 1474 + std r21, VCPU_GPR(R21)(r3) 1475 + std r22, VCPU_GPR(R22)(r3) 1476 + std r23, VCPU_GPR(R23)(r3) 1477 + std r24, VCPU_GPR(R24)(r3) 1478 + std r25, VCPU_GPR(R25)(r3) 1479 + std r26, VCPU_GPR(R26)(r3) 1480 + std r27, VCPU_GPR(R27)(r3) 1481 + std r28, VCPU_GPR(R28)(r3) 1482 + std r29, VCPU_GPR(R29)(r3) 1483 + std r30, VCPU_GPR(R30)(r3) 1484 + std r31, VCPU_GPR(R31)(r3) 1486 1485 1487 1486 /* save FP state */ 1488 1487 bl .kvmppc_save_fp ··· 1514 1513 bl kvmppc_load_fp 1515 1514 1516 1515 /* Load NV GPRS */ 1517 - ld r14, VCPU_GPR(r14)(r4) 1518 - ld r15, VCPU_GPR(r15)(r4) 1519 - ld r16, VCPU_GPR(r16)(r4) 1520 - ld r17, VCPU_GPR(r17)(r4) 1521 - ld r18, VCPU_GPR(r18)(r4) 1522 - ld r19, VCPU_GPR(r19)(r4) 1523 - ld r20, VCPU_GPR(r20)(r4) 1524 - ld r21, VCPU_GPR(r21)(r4) 1525 - ld r22, VCPU_GPR(r22)(r4) 1526 - ld r23, VCPU_GPR(r23)(r4) 1527 - ld r24, VCPU_GPR(r24)(r4) 1528 - ld r25, VCPU_GPR(r25)(r4) 1529 - ld r26, VCPU_GPR(r26)(r4) 1530 - ld r27, VCPU_GPR(r27)(r4) 1531 - ld r28, VCPU_GPR(r28)(r4) 1532 - ld r29, VCPU_GPR(r29)(r4) 1533 - ld r30, VCPU_GPR(r30)(r4) 1534 - ld r31, VCPU_GPR(r31)(r4) 1516 + ld r14, VCPU_GPR(R14)(r4) 1517 + ld r15, VCPU_GPR(R15)(r4) 1518 + ld r16, VCPU_GPR(R16)(r4) 1519 + ld r17, VCPU_GPR(R17)(r4) 1520 + ld r18, VCPU_GPR(R18)(r4) 1521 + ld r19, VCPU_GPR(R19)(r4) 1522 + ld r20, VCPU_GPR(R20)(r4) 1523 + ld r21, VCPU_GPR(R21)(r4) 1524 + ld r22, VCPU_GPR(R22)(r4) 1525 + ld r23, VCPU_GPR(R23)(r4) 1526 + ld r24, VCPU_GPR(R24)(r4) 1527 + ld r25, VCPU_GPR(R25)(r4) 1528 + ld r26, VCPU_GPR(R26)(r4) 1529 + ld r27, VCPU_GPR(R27)(r4) 1530 + ld r28, VCPU_GPR(R28)(r4) 1531 + ld r29, VCPU_GPR(R29)(r4) 1532 + ld r30, VCPU_GPR(R30)(r4) 1533 + ld r31, VCPU_GPR(R31)(r4) 1535 1534 1536 1535 /* clear our bit in vcore->napping_threads */ 1537 1536 33: ld r5,HSTATE_KVM_VCORE(r13) ··· 1650 1649 reg = 0 1651 1650 .rept 32 1652 1651 li r6,reg*16+VCPU_VSRS 1653 - STXVD2X(reg,r6,r3) 1652 + STXVD2X(reg,R6,R3) 1654 1653 reg = reg + 1 1655 1654 .endr 1656 1655 FTR_SECTION_ELSE ··· 1712 1711 reg = 0 1713 1712 .rept 32 1714 1713 li r7,reg*16+VCPU_VSRS 1715 - LXVD2X(reg,r7,r4) 1714 + LXVD2X(reg,R7,R4) 1716 1715 reg = reg + 1 1717 1716 .endr 1718 1717 FTR_SECTION_ELSE
+36 -44
arch/powerpc/kvm/book3s_interrupts.S
··· 25 25 #include <asm/exception-64s.h> 26 26 27 27 #if defined(CONFIG_PPC_BOOK3S_64) 28 - 29 - #define ULONG_SIZE 8 30 28 #define FUNC(name) GLUE(.,name) 31 - 32 29 #elif defined(CONFIG_PPC_BOOK3S_32) 33 - 34 - #define ULONG_SIZE 4 35 30 #define FUNC(name) name 36 - 37 31 #endif /* CONFIG_PPC_BOOK3S_XX */ 38 32 39 - 40 - #define VCPU_GPR(n) (VCPU_GPRS + (n * ULONG_SIZE)) 41 33 #define VCPU_LOAD_NVGPRS(vcpu) \ 42 - PPC_LL r14, VCPU_GPR(r14)(vcpu); \ 43 - PPC_LL r15, VCPU_GPR(r15)(vcpu); \ 44 - PPC_LL r16, VCPU_GPR(r16)(vcpu); \ 45 - PPC_LL r17, VCPU_GPR(r17)(vcpu); \ 46 - PPC_LL r18, VCPU_GPR(r18)(vcpu); \ 47 - PPC_LL r19, VCPU_GPR(r19)(vcpu); \ 48 - PPC_LL r20, VCPU_GPR(r20)(vcpu); \ 49 - PPC_LL r21, VCPU_GPR(r21)(vcpu); \ 50 - PPC_LL r22, VCPU_GPR(r22)(vcpu); \ 51 - PPC_LL r23, VCPU_GPR(r23)(vcpu); \ 52 - PPC_LL r24, VCPU_GPR(r24)(vcpu); \ 53 - PPC_LL r25, VCPU_GPR(r25)(vcpu); \ 54 - PPC_LL r26, VCPU_GPR(r26)(vcpu); \ 55 - PPC_LL r27, VCPU_GPR(r27)(vcpu); \ 56 - PPC_LL r28, VCPU_GPR(r28)(vcpu); \ 57 - PPC_LL r29, VCPU_GPR(r29)(vcpu); \ 58 - PPC_LL r30, VCPU_GPR(r30)(vcpu); \ 59 - PPC_LL r31, VCPU_GPR(r31)(vcpu); \ 34 + PPC_LL r14, VCPU_GPR(R14)(vcpu); \ 35 + PPC_LL r15, VCPU_GPR(R15)(vcpu); \ 36 + PPC_LL r16, VCPU_GPR(R16)(vcpu); \ 37 + PPC_LL r17, VCPU_GPR(R17)(vcpu); \ 38 + PPC_LL r18, VCPU_GPR(R18)(vcpu); \ 39 + PPC_LL r19, VCPU_GPR(R19)(vcpu); \ 40 + PPC_LL r20, VCPU_GPR(R20)(vcpu); \ 41 + PPC_LL r21, VCPU_GPR(R21)(vcpu); \ 42 + PPC_LL r22, VCPU_GPR(R22)(vcpu); \ 43 + PPC_LL r23, VCPU_GPR(R23)(vcpu); \ 44 + PPC_LL r24, VCPU_GPR(R24)(vcpu); \ 45 + PPC_LL r25, VCPU_GPR(R25)(vcpu); \ 46 + PPC_LL r26, VCPU_GPR(R26)(vcpu); \ 47 + PPC_LL r27, VCPU_GPR(R27)(vcpu); \ 48 + PPC_LL r28, VCPU_GPR(R28)(vcpu); \ 49 + PPC_LL r29, VCPU_GPR(R29)(vcpu); \ 50 + PPC_LL r30, VCPU_GPR(R30)(vcpu); \ 51 + PPC_LL r31, VCPU_GPR(R31)(vcpu); \ 60 52 61 53 /***************************************************************************** 62 54 * * ··· 123 131 /* R7 = vcpu */ 124 132 PPC_LL r7, GPR4(r1) 125 133 126 - PPC_STL r14, VCPU_GPR(r14)(r7) 127 - PPC_STL r15, VCPU_GPR(r15)(r7) 128 - PPC_STL r16, VCPU_GPR(r16)(r7) 129 - PPC_STL r17, VCPU_GPR(r17)(r7) 130 - PPC_STL r18, VCPU_GPR(r18)(r7) 131 - PPC_STL r19, VCPU_GPR(r19)(r7) 132 - PPC_STL r20, VCPU_GPR(r20)(r7) 133 - PPC_STL r21, VCPU_GPR(r21)(r7) 134 - PPC_STL r22, VCPU_GPR(r22)(r7) 135 - PPC_STL r23, VCPU_GPR(r23)(r7) 136 - PPC_STL r24, VCPU_GPR(r24)(r7) 137 - PPC_STL r25, VCPU_GPR(r25)(r7) 138 - PPC_STL r26, VCPU_GPR(r26)(r7) 139 - PPC_STL r27, VCPU_GPR(r27)(r7) 140 - PPC_STL r28, VCPU_GPR(r28)(r7) 141 - PPC_STL r29, VCPU_GPR(r29)(r7) 142 - PPC_STL r30, VCPU_GPR(r30)(r7) 143 - PPC_STL r31, VCPU_GPR(r31)(r7) 134 + PPC_STL r14, VCPU_GPR(R14)(r7) 135 + PPC_STL r15, VCPU_GPR(R15)(r7) 136 + PPC_STL r16, VCPU_GPR(R16)(r7) 137 + PPC_STL r17, VCPU_GPR(R17)(r7) 138 + PPC_STL r18, VCPU_GPR(R18)(r7) 139 + PPC_STL r19, VCPU_GPR(R19)(r7) 140 + PPC_STL r20, VCPU_GPR(R20)(r7) 141 + PPC_STL r21, VCPU_GPR(R21)(r7) 142 + PPC_STL r22, VCPU_GPR(R22)(r7) 143 + PPC_STL r23, VCPU_GPR(R23)(r7) 144 + PPC_STL r24, VCPU_GPR(R24)(r7) 145 + PPC_STL r25, VCPU_GPR(R25)(r7) 146 + PPC_STL r26, VCPU_GPR(R26)(r7) 147 + PPC_STL r27, VCPU_GPR(R27)(r7) 148 + PPC_STL r28, VCPU_GPR(R28)(r7) 149 + PPC_STL r29, VCPU_GPR(R29)(r7) 150 + PPC_STL r30, VCPU_GPR(R30)(r7) 151 + PPC_STL r31, VCPU_GPR(R31)(r7) 144 152 145 153 /* Pass the exit number as 3rd argument to kvmppc_handle_exit */ 146 154 mr r5, r12
-1
arch/powerpc/kvm/book3s_rmhandlers.S
··· 37 37 #if defined(CONFIG_PPC_BOOK3S_64) 38 38 39 39 #define FUNC(name) GLUE(.,name) 40 - #define MTMSR_EERI(reg) mtmsrd (reg),1 41 40 42 41 .globl kvmppc_skip_interrupt 43 42 kvmppc_skip_interrupt:
-2
arch/powerpc/kvm/book3s_segment.S
··· 23 23 24 24 #define GET_SHADOW_VCPU(reg) \ 25 25 mr reg, r13 26 - #define MTMSR_EERI(reg) mtmsrd (reg),1 27 26 28 27 #elif defined(CONFIG_PPC_BOOK3S_32) 29 28 ··· 30 31 tophys(reg, r2); \ 31 32 lwz reg, (THREAD + THREAD_KVM_SVCPU)(reg); \ 32 33 tophys(reg, reg) 33 - #define MTMSR_EERI(reg) mtmsr (reg) 34 34 35 35 #endif 36 36
+138 -139
arch/powerpc/kvm/booke_interrupts.S
··· 25 25 #include <asm/page.h> 26 26 #include <asm/asm-offsets.h> 27 27 28 - #define VCPU_GPR(n) (VCPU_GPRS + (n * 4)) 29 - 30 28 /* The host stack layout: */ 31 29 #define HOST_R1 0 /* Implied by stwu. */ 32 30 #define HOST_CALLEE_LR 4 ··· 34 36 #define HOST_R2 12 35 37 #define HOST_CR 16 36 38 #define HOST_NV_GPRS 20 37 - #define HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) 38 - #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(31) + 4) 39 + #define __HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) 40 + #define HOST_NV_GPR(n) __HOST_NV_GPR(__REG_##n) 41 + #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(R31) + 4) 39 42 #define HOST_STACK_SIZE (((HOST_MIN_STACK_SIZE + 15) / 16) * 16) /* Align. */ 40 43 #define HOST_STACK_LR (HOST_STACK_SIZE + 4) /* In caller stack frame. */ 41 44 ··· 57 58 /* Get pointer to vcpu and record exit number. */ 58 59 mtspr SPRN_SPRG_WSCRATCH0, r4 59 60 mfspr r4, SPRN_SPRG_RVCPU 60 - stw r5, VCPU_GPR(r5)(r4) 61 - stw r6, VCPU_GPR(r6)(r4) 61 + stw r5, VCPU_GPR(R5)(r4) 62 + stw r6, VCPU_GPR(R6)(r4) 62 63 mfctr r5 63 64 lis r6, kvmppc_resume_host@h 64 65 stw r5, VCPU_CTR(r4) ··· 99 100 * r5: KVM exit number 100 101 */ 101 102 _GLOBAL(kvmppc_resume_host) 102 - stw r3, VCPU_GPR(r3)(r4) 103 + stw r3, VCPU_GPR(R3)(r4) 103 104 mfcr r3 104 105 stw r3, VCPU_CR(r4) 105 - stw r7, VCPU_GPR(r7)(r4) 106 - stw r8, VCPU_GPR(r8)(r4) 107 - stw r9, VCPU_GPR(r9)(r4) 106 + stw r7, VCPU_GPR(R7)(r4) 107 + stw r8, VCPU_GPR(R8)(r4) 108 + stw r9, VCPU_GPR(R9)(r4) 108 109 109 110 li r6, 1 110 111 slw r6, r6, r5 ··· 134 135 isync 135 136 stw r9, VCPU_LAST_INST(r4) 136 137 137 - stw r15, VCPU_GPR(r15)(r4) 138 - stw r16, VCPU_GPR(r16)(r4) 139 - stw r17, VCPU_GPR(r17)(r4) 140 - stw r18, VCPU_GPR(r18)(r4) 141 - stw r19, VCPU_GPR(r19)(r4) 142 - stw r20, VCPU_GPR(r20)(r4) 143 - stw r21, VCPU_GPR(r21)(r4) 144 - stw r22, VCPU_GPR(r22)(r4) 145 - stw r23, VCPU_GPR(r23)(r4) 146 - stw r24, VCPU_GPR(r24)(r4) 147 - stw r25, VCPU_GPR(r25)(r4) 148 - stw r26, VCPU_GPR(r26)(r4) 149 - stw r27, VCPU_GPR(r27)(r4) 150 - stw r28, VCPU_GPR(r28)(r4) 151 - stw r29, VCPU_GPR(r29)(r4) 152 - stw r30, VCPU_GPR(r30)(r4) 153 - stw r31, VCPU_GPR(r31)(r4) 138 + stw r15, VCPU_GPR(R15)(r4) 139 + stw r16, VCPU_GPR(R16)(r4) 140 + stw r17, VCPU_GPR(R17)(r4) 141 + stw r18, VCPU_GPR(R18)(r4) 142 + stw r19, VCPU_GPR(R19)(r4) 143 + stw r20, VCPU_GPR(R20)(r4) 144 + stw r21, VCPU_GPR(R21)(r4) 145 + stw r22, VCPU_GPR(R22)(r4) 146 + stw r23, VCPU_GPR(R23)(r4) 147 + stw r24, VCPU_GPR(R24)(r4) 148 + stw r25, VCPU_GPR(R25)(r4) 149 + stw r26, VCPU_GPR(R26)(r4) 150 + stw r27, VCPU_GPR(R27)(r4) 151 + stw r28, VCPU_GPR(R28)(r4) 152 + stw r29, VCPU_GPR(R29)(r4) 153 + stw r30, VCPU_GPR(R30)(r4) 154 + stw r31, VCPU_GPR(R31)(r4) 154 155 ..skip_inst_copy: 155 156 156 157 /* Also grab DEAR and ESR before the host can clobber them. */ ··· 168 169 ..skip_esr: 169 170 170 171 /* Save remaining volatile guest register state to vcpu. */ 171 - stw r0, VCPU_GPR(r0)(r4) 172 - stw r1, VCPU_GPR(r1)(r4) 173 - stw r2, VCPU_GPR(r2)(r4) 174 - stw r10, VCPU_GPR(r10)(r4) 175 - stw r11, VCPU_GPR(r11)(r4) 176 - stw r12, VCPU_GPR(r12)(r4) 177 - stw r13, VCPU_GPR(r13)(r4) 178 - stw r14, VCPU_GPR(r14)(r4) /* We need a NV GPR below. */ 172 + stw r0, VCPU_GPR(R0)(r4) 173 + stw r1, VCPU_GPR(R1)(r4) 174 + stw r2, VCPU_GPR(R2)(r4) 175 + stw r10, VCPU_GPR(R10)(r4) 176 + stw r11, VCPU_GPR(R11)(r4) 177 + stw r12, VCPU_GPR(R12)(r4) 178 + stw r13, VCPU_GPR(R13)(r4) 179 + stw r14, VCPU_GPR(R14)(r4) /* We need a NV GPR below. */ 179 180 mflr r3 180 181 stw r3, VCPU_LR(r4) 181 182 mfxer r3 182 183 stw r3, VCPU_XER(r4) 183 184 mfspr r3, SPRN_SPRG_RSCRATCH0 184 - stw r3, VCPU_GPR(r4)(r4) 185 + stw r3, VCPU_GPR(R4)(r4) 185 186 mfspr r3, SPRN_SRR0 186 187 stw r3, VCPU_PC(r4) 187 188 ··· 213 214 214 215 /* Restore vcpu pointer and the nonvolatiles we used. */ 215 216 mr r4, r14 216 - lwz r14, VCPU_GPR(r14)(r4) 217 + lwz r14, VCPU_GPR(R14)(r4) 217 218 218 219 /* Sometimes instruction emulation must restore complete GPR state. */ 219 220 andi. r5, r3, RESUME_FLAG_NV 220 221 beq ..skip_nv_load 221 - lwz r15, VCPU_GPR(r15)(r4) 222 - lwz r16, VCPU_GPR(r16)(r4) 223 - lwz r17, VCPU_GPR(r17)(r4) 224 - lwz r18, VCPU_GPR(r18)(r4) 225 - lwz r19, VCPU_GPR(r19)(r4) 226 - lwz r20, VCPU_GPR(r20)(r4) 227 - lwz r21, VCPU_GPR(r21)(r4) 228 - lwz r22, VCPU_GPR(r22)(r4) 229 - lwz r23, VCPU_GPR(r23)(r4) 230 - lwz r24, VCPU_GPR(r24)(r4) 231 - lwz r25, VCPU_GPR(r25)(r4) 232 - lwz r26, VCPU_GPR(r26)(r4) 233 - lwz r27, VCPU_GPR(r27)(r4) 234 - lwz r28, VCPU_GPR(r28)(r4) 235 - lwz r29, VCPU_GPR(r29)(r4) 236 - lwz r30, VCPU_GPR(r30)(r4) 237 - lwz r31, VCPU_GPR(r31)(r4) 222 + lwz r15, VCPU_GPR(R15)(r4) 223 + lwz r16, VCPU_GPR(R16)(r4) 224 + lwz r17, VCPU_GPR(R17)(r4) 225 + lwz r18, VCPU_GPR(R18)(r4) 226 + lwz r19, VCPU_GPR(R19)(r4) 227 + lwz r20, VCPU_GPR(R20)(r4) 228 + lwz r21, VCPU_GPR(R21)(r4) 229 + lwz r22, VCPU_GPR(R22)(r4) 230 + lwz r23, VCPU_GPR(R23)(r4) 231 + lwz r24, VCPU_GPR(R24)(r4) 232 + lwz r25, VCPU_GPR(R25)(r4) 233 + lwz r26, VCPU_GPR(R26)(r4) 234 + lwz r27, VCPU_GPR(R27)(r4) 235 + lwz r28, VCPU_GPR(R28)(r4) 236 + lwz r29, VCPU_GPR(R29)(r4) 237 + lwz r30, VCPU_GPR(R30)(r4) 238 + lwz r31, VCPU_GPR(R31)(r4) 238 239 ..skip_nv_load: 239 240 240 241 /* Should we return to the guest? */ ··· 256 257 257 258 /* We already saved guest volatile register state; now save the 258 259 * non-volatiles. */ 259 - stw r15, VCPU_GPR(r15)(r4) 260 - stw r16, VCPU_GPR(r16)(r4) 261 - stw r17, VCPU_GPR(r17)(r4) 262 - stw r18, VCPU_GPR(r18)(r4) 263 - stw r19, VCPU_GPR(r19)(r4) 264 - stw r20, VCPU_GPR(r20)(r4) 265 - stw r21, VCPU_GPR(r21)(r4) 266 - stw r22, VCPU_GPR(r22)(r4) 267 - stw r23, VCPU_GPR(r23)(r4) 268 - stw r24, VCPU_GPR(r24)(r4) 269 - stw r25, VCPU_GPR(r25)(r4) 270 - stw r26, VCPU_GPR(r26)(r4) 271 - stw r27, VCPU_GPR(r27)(r4) 272 - stw r28, VCPU_GPR(r28)(r4) 273 - stw r29, VCPU_GPR(r29)(r4) 274 - stw r30, VCPU_GPR(r30)(r4) 275 - stw r31, VCPU_GPR(r31)(r4) 260 + stw r15, VCPU_GPR(R15)(r4) 261 + stw r16, VCPU_GPR(R16)(r4) 262 + stw r17, VCPU_GPR(R17)(r4) 263 + stw r18, VCPU_GPR(R18)(r4) 264 + stw r19, VCPU_GPR(R19)(r4) 265 + stw r20, VCPU_GPR(R20)(r4) 266 + stw r21, VCPU_GPR(R21)(r4) 267 + stw r22, VCPU_GPR(R22)(r4) 268 + stw r23, VCPU_GPR(R23)(r4) 269 + stw r24, VCPU_GPR(R24)(r4) 270 + stw r25, VCPU_GPR(R25)(r4) 271 + stw r26, VCPU_GPR(R26)(r4) 272 + stw r27, VCPU_GPR(R27)(r4) 273 + stw r28, VCPU_GPR(R28)(r4) 274 + stw r29, VCPU_GPR(R29)(r4) 275 + stw r30, VCPU_GPR(R30)(r4) 276 + stw r31, VCPU_GPR(R31)(r4) 276 277 277 278 /* Load host non-volatile register state from host stack. */ 278 - lwz r14, HOST_NV_GPR(r14)(r1) 279 - lwz r15, HOST_NV_GPR(r15)(r1) 280 - lwz r16, HOST_NV_GPR(r16)(r1) 281 - lwz r17, HOST_NV_GPR(r17)(r1) 282 - lwz r18, HOST_NV_GPR(r18)(r1) 283 - lwz r19, HOST_NV_GPR(r19)(r1) 284 - lwz r20, HOST_NV_GPR(r20)(r1) 285 - lwz r21, HOST_NV_GPR(r21)(r1) 286 - lwz r22, HOST_NV_GPR(r22)(r1) 287 - lwz r23, HOST_NV_GPR(r23)(r1) 288 - lwz r24, HOST_NV_GPR(r24)(r1) 289 - lwz r25, HOST_NV_GPR(r25)(r1) 290 - lwz r26, HOST_NV_GPR(r26)(r1) 291 - lwz r27, HOST_NV_GPR(r27)(r1) 292 - lwz r28, HOST_NV_GPR(r28)(r1) 293 - lwz r29, HOST_NV_GPR(r29)(r1) 294 - lwz r30, HOST_NV_GPR(r30)(r1) 295 - lwz r31, HOST_NV_GPR(r31)(r1) 279 + lwz r14, HOST_NV_GPR(R14)(r1) 280 + lwz r15, HOST_NV_GPR(R15)(r1) 281 + lwz r16, HOST_NV_GPR(R16)(r1) 282 + lwz r17, HOST_NV_GPR(R17)(r1) 283 + lwz r18, HOST_NV_GPR(R18)(r1) 284 + lwz r19, HOST_NV_GPR(R19)(r1) 285 + lwz r20, HOST_NV_GPR(R20)(r1) 286 + lwz r21, HOST_NV_GPR(R21)(r1) 287 + lwz r22, HOST_NV_GPR(R22)(r1) 288 + lwz r23, HOST_NV_GPR(R23)(r1) 289 + lwz r24, HOST_NV_GPR(R24)(r1) 290 + lwz r25, HOST_NV_GPR(R25)(r1) 291 + lwz r26, HOST_NV_GPR(R26)(r1) 292 + lwz r27, HOST_NV_GPR(R27)(r1) 293 + lwz r28, HOST_NV_GPR(R28)(r1) 294 + lwz r29, HOST_NV_GPR(R29)(r1) 295 + lwz r30, HOST_NV_GPR(R30)(r1) 296 + lwz r31, HOST_NV_GPR(R31)(r1) 296 297 297 298 /* Return to kvm_vcpu_run(). */ 298 299 lwz r4, HOST_STACK_LR(r1) ··· 320 321 stw r5, HOST_CR(r1) 321 322 322 323 /* Save host non-volatile register state to stack. */ 323 - stw r14, HOST_NV_GPR(r14)(r1) 324 - stw r15, HOST_NV_GPR(r15)(r1) 325 - stw r16, HOST_NV_GPR(r16)(r1) 326 - stw r17, HOST_NV_GPR(r17)(r1) 327 - stw r18, HOST_NV_GPR(r18)(r1) 328 - stw r19, HOST_NV_GPR(r19)(r1) 329 - stw r20, HOST_NV_GPR(r20)(r1) 330 - stw r21, HOST_NV_GPR(r21)(r1) 331 - stw r22, HOST_NV_GPR(r22)(r1) 332 - stw r23, HOST_NV_GPR(r23)(r1) 333 - stw r24, HOST_NV_GPR(r24)(r1) 334 - stw r25, HOST_NV_GPR(r25)(r1) 335 - stw r26, HOST_NV_GPR(r26)(r1) 336 - stw r27, HOST_NV_GPR(r27)(r1) 337 - stw r28, HOST_NV_GPR(r28)(r1) 338 - stw r29, HOST_NV_GPR(r29)(r1) 339 - stw r30, HOST_NV_GPR(r30)(r1) 340 - stw r31, HOST_NV_GPR(r31)(r1) 324 + stw r14, HOST_NV_GPR(R14)(r1) 325 + stw r15, HOST_NV_GPR(R15)(r1) 326 + stw r16, HOST_NV_GPR(R16)(r1) 327 + stw r17, HOST_NV_GPR(R17)(r1) 328 + stw r18, HOST_NV_GPR(R18)(r1) 329 + stw r19, HOST_NV_GPR(R19)(r1) 330 + stw r20, HOST_NV_GPR(R20)(r1) 331 + stw r21, HOST_NV_GPR(R21)(r1) 332 + stw r22, HOST_NV_GPR(R22)(r1) 333 + stw r23, HOST_NV_GPR(R23)(r1) 334 + stw r24, HOST_NV_GPR(R24)(r1) 335 + stw r25, HOST_NV_GPR(R25)(r1) 336 + stw r26, HOST_NV_GPR(R26)(r1) 337 + stw r27, HOST_NV_GPR(R27)(r1) 338 + stw r28, HOST_NV_GPR(R28)(r1) 339 + stw r29, HOST_NV_GPR(R29)(r1) 340 + stw r30, HOST_NV_GPR(R30)(r1) 341 + stw r31, HOST_NV_GPR(R31)(r1) 341 342 342 343 /* Load guest non-volatiles. */ 343 - lwz r14, VCPU_GPR(r14)(r4) 344 - lwz r15, VCPU_GPR(r15)(r4) 345 - lwz r16, VCPU_GPR(r16)(r4) 346 - lwz r17, VCPU_GPR(r17)(r4) 347 - lwz r18, VCPU_GPR(r18)(r4) 348 - lwz r19, VCPU_GPR(r19)(r4) 349 - lwz r20, VCPU_GPR(r20)(r4) 350 - lwz r21, VCPU_GPR(r21)(r4) 351 - lwz r22, VCPU_GPR(r22)(r4) 352 - lwz r23, VCPU_GPR(r23)(r4) 353 - lwz r24, VCPU_GPR(r24)(r4) 354 - lwz r25, VCPU_GPR(r25)(r4) 355 - lwz r26, VCPU_GPR(r26)(r4) 356 - lwz r27, VCPU_GPR(r27)(r4) 357 - lwz r28, VCPU_GPR(r28)(r4) 358 - lwz r29, VCPU_GPR(r29)(r4) 359 - lwz r30, VCPU_GPR(r30)(r4) 360 - lwz r31, VCPU_GPR(r31)(r4) 344 + lwz r14, VCPU_GPR(R14)(r4) 345 + lwz r15, VCPU_GPR(R15)(r4) 346 + lwz r16, VCPU_GPR(R16)(r4) 347 + lwz r17, VCPU_GPR(R17)(r4) 348 + lwz r18, VCPU_GPR(R18)(r4) 349 + lwz r19, VCPU_GPR(R19)(r4) 350 + lwz r20, VCPU_GPR(R20)(r4) 351 + lwz r21, VCPU_GPR(R21)(r4) 352 + lwz r22, VCPU_GPR(R22)(r4) 353 + lwz r23, VCPU_GPR(R23)(r4) 354 + lwz r24, VCPU_GPR(R24)(r4) 355 + lwz r25, VCPU_GPR(R25)(r4) 356 + lwz r26, VCPU_GPR(R26)(r4) 357 + lwz r27, VCPU_GPR(R27)(r4) 358 + lwz r28, VCPU_GPR(R28)(r4) 359 + lwz r29, VCPU_GPR(R29)(r4) 360 + lwz r30, VCPU_GPR(R30)(r4) 361 + lwz r31, VCPU_GPR(R31)(r4) 361 362 362 363 #ifdef CONFIG_SPE 363 364 /* save host SPEFSCR and load guest SPEFSCR */ ··· 385 386 #endif 386 387 387 388 /* Load some guest volatiles. */ 388 - lwz r0, VCPU_GPR(r0)(r4) 389 - lwz r2, VCPU_GPR(r2)(r4) 390 - lwz r9, VCPU_GPR(r9)(r4) 391 - lwz r10, VCPU_GPR(r10)(r4) 392 - lwz r11, VCPU_GPR(r11)(r4) 393 - lwz r12, VCPU_GPR(r12)(r4) 394 - lwz r13, VCPU_GPR(r13)(r4) 389 + lwz r0, VCPU_GPR(R0)(r4) 390 + lwz r2, VCPU_GPR(R2)(r4) 391 + lwz r9, VCPU_GPR(R9)(r4) 392 + lwz r10, VCPU_GPR(R10)(r4) 393 + lwz r11, VCPU_GPR(R11)(r4) 394 + lwz r12, VCPU_GPR(R12)(r4) 395 + lwz r13, VCPU_GPR(R13)(r4) 395 396 lwz r3, VCPU_LR(r4) 396 397 mtlr r3 397 398 lwz r3, VCPU_XER(r4) ··· 410 411 411 412 /* Can't switch the stack pointer until after IVPR is switched, 412 413 * because host interrupt handlers would get confused. */ 413 - lwz r1, VCPU_GPR(r1)(r4) 414 + lwz r1, VCPU_GPR(R1)(r4) 414 415 415 416 /* 416 417 * Host interrupt handlers may have clobbered these ··· 448 449 mtcr r5 449 450 mtsrr0 r6 450 451 mtsrr1 r7 451 - lwz r5, VCPU_GPR(r5)(r4) 452 - lwz r6, VCPU_GPR(r6)(r4) 453 - lwz r7, VCPU_GPR(r7)(r4) 454 - lwz r8, VCPU_GPR(r8)(r4) 452 + lwz r5, VCPU_GPR(R5)(r4) 453 + lwz r6, VCPU_GPR(R6)(r4) 454 + lwz r7, VCPU_GPR(R7)(r4) 455 + lwz r8, VCPU_GPR(R8)(r4) 455 456 456 457 /* Clear any debug events which occurred since we disabled MSR[DE]. 457 458 * XXX This gives us a 3-instruction window in which a breakpoint ··· 460 461 ori r3, r3, 0xffff 461 462 mtspr SPRN_DBSR, r3 462 463 463 - lwz r3, VCPU_GPR(r3)(r4) 464 - lwz r4, VCPU_GPR(r4)(r4) 464 + lwz r3, VCPU_GPR(R3)(r4) 465 + lwz r4, VCPU_GPR(R4)(r4) 465 466 rfi 466 467 467 468 #ifdef CONFIG_SPE
+111 -116
arch/powerpc/kvm/bookehv_interrupts.S
··· 37 37 38 38 #define LONGBYTES (BITS_PER_LONG / 8) 39 39 40 - #define VCPU_GPR(n) (VCPU_GPRS + (n * LONGBYTES)) 41 40 #define VCPU_GUEST_SPRG(n) (VCPU_GUEST_SPRGS + (n * LONGBYTES)) 42 41 43 42 /* The host stack layout: */ ··· 66 67 */ 67 68 .macro kvm_handler_common intno, srr0, flags 68 69 /* Restore host stack pointer */ 69 - PPC_STL r1, VCPU_GPR(r1)(r4) 70 - PPC_STL r2, VCPU_GPR(r2)(r4) 70 + PPC_STL r1, VCPU_GPR(R1)(r4) 71 + PPC_STL r2, VCPU_GPR(R2)(r4) 71 72 PPC_LL r1, VCPU_HOST_STACK(r4) 72 73 PPC_LL r2, HOST_R2(r1) 73 74 74 75 mfspr r10, SPRN_PID 75 76 lwz r8, VCPU_HOST_PID(r4) 76 77 PPC_LL r11, VCPU_SHARED(r4) 77 - PPC_STL r14, VCPU_GPR(r14)(r4) /* We need a non-volatile GPR. */ 78 + PPC_STL r14, VCPU_GPR(R14)(r4) /* We need a non-volatile GPR. */ 78 79 li r14, \intno 79 80 80 81 stw r10, VCPU_GUEST_PID(r4) ··· 136 137 */ 137 138 138 139 mfspr r3, SPRN_EPLC /* will already have correct ELPID and EGS */ 139 - PPC_STL r15, VCPU_GPR(r15)(r4) 140 - PPC_STL r16, VCPU_GPR(r16)(r4) 141 - PPC_STL r17, VCPU_GPR(r17)(r4) 142 - PPC_STL r18, VCPU_GPR(r18)(r4) 143 - PPC_STL r19, VCPU_GPR(r19)(r4) 140 + PPC_STL r15, VCPU_GPR(R15)(r4) 141 + PPC_STL r16, VCPU_GPR(R16)(r4) 142 + PPC_STL r17, VCPU_GPR(R17)(r4) 143 + PPC_STL r18, VCPU_GPR(R18)(r4) 144 + PPC_STL r19, VCPU_GPR(R19)(r4) 144 145 mr r8, r3 145 - PPC_STL r20, VCPU_GPR(r20)(r4) 146 + PPC_STL r20, VCPU_GPR(R20)(r4) 146 147 rlwimi r8, r6, EPC_EAS_SHIFT - MSR_IR_LG, EPC_EAS 147 - PPC_STL r21, VCPU_GPR(r21)(r4) 148 + PPC_STL r21, VCPU_GPR(R21)(r4) 148 149 rlwimi r8, r6, EPC_EPR_SHIFT - MSR_PR_LG, EPC_EPR 149 - PPC_STL r22, VCPU_GPR(r22)(r4) 150 + PPC_STL r22, VCPU_GPR(R22)(r4) 150 151 rlwimi r8, r10, EPC_EPID_SHIFT, EPC_EPID 151 - PPC_STL r23, VCPU_GPR(r23)(r4) 152 - PPC_STL r24, VCPU_GPR(r24)(r4) 153 - PPC_STL r25, VCPU_GPR(r25)(r4) 154 - PPC_STL r26, VCPU_GPR(r26)(r4) 155 - PPC_STL r27, VCPU_GPR(r27)(r4) 156 - PPC_STL r28, VCPU_GPR(r28)(r4) 157 - PPC_STL r29, VCPU_GPR(r29)(r4) 158 - PPC_STL r30, VCPU_GPR(r30)(r4) 159 - PPC_STL r31, VCPU_GPR(r31)(r4) 152 + PPC_STL r23, VCPU_GPR(R23)(r4) 153 + PPC_STL r24, VCPU_GPR(R24)(r4) 154 + PPC_STL r25, VCPU_GPR(R25)(r4) 155 + PPC_STL r26, VCPU_GPR(R26)(r4) 156 + PPC_STL r27, VCPU_GPR(R27)(r4) 157 + PPC_STL r28, VCPU_GPR(R28)(r4) 158 + PPC_STL r29, VCPU_GPR(R29)(r4) 159 + PPC_STL r30, VCPU_GPR(R30)(r4) 160 + PPC_STL r31, VCPU_GPR(R31)(r4) 160 161 mtspr SPRN_EPLC, r8 161 162 162 163 /* disable preemption, so we are sure we hit the fixup handler */ 163 - #ifdef CONFIG_PPC64 164 - clrrdi r8,r1,THREAD_SHIFT 165 - #else 166 - rlwinm r8,r1,0,0,31-THREAD_SHIFT /* current thread_info */ 167 - #endif 164 + CURRENT_THREAD_INFO(r8, r1) 168 165 li r7, 1 169 166 stw r7, TI_PREEMPT(r8) 170 167 ··· 206 211 .macro kvm_handler intno srr0, srr1, flags 207 212 _GLOBAL(kvmppc_handler_\intno\()_\srr1) 208 213 GET_VCPU(r11, r10) 209 - PPC_STL r3, VCPU_GPR(r3)(r11) 214 + PPC_STL r3, VCPU_GPR(R3)(r11) 210 215 mfspr r3, SPRN_SPRG_RSCRATCH0 211 - PPC_STL r4, VCPU_GPR(r4)(r11) 216 + PPC_STL r4, VCPU_GPR(R4)(r11) 212 217 PPC_LL r4, THREAD_NORMSAVE(0)(r10) 213 - PPC_STL r5, VCPU_GPR(r5)(r11) 218 + PPC_STL r5, VCPU_GPR(R5)(r11) 214 219 stw r13, VCPU_CR(r11) 215 220 mfspr r5, \srr0 216 - PPC_STL r3, VCPU_GPR(r10)(r11) 221 + PPC_STL r3, VCPU_GPR(R10)(r11) 217 222 PPC_LL r3, THREAD_NORMSAVE(2)(r10) 218 - PPC_STL r6, VCPU_GPR(r6)(r11) 219 - PPC_STL r4, VCPU_GPR(r11)(r11) 223 + PPC_STL r6, VCPU_GPR(R6)(r11) 224 + PPC_STL r4, VCPU_GPR(R11)(r11) 220 225 mfspr r6, \srr1 221 - PPC_STL r7, VCPU_GPR(r7)(r11) 222 - PPC_STL r8, VCPU_GPR(r8)(r11) 223 - PPC_STL r9, VCPU_GPR(r9)(r11) 224 - PPC_STL r3, VCPU_GPR(r13)(r11) 226 + PPC_STL r7, VCPU_GPR(R7)(r11) 227 + PPC_STL r8, VCPU_GPR(R8)(r11) 228 + PPC_STL r9, VCPU_GPR(R9)(r11) 229 + PPC_STL r3, VCPU_GPR(R13)(r11) 225 230 mfctr r7 226 - PPC_STL r12, VCPU_GPR(r12)(r11) 231 + PPC_STL r12, VCPU_GPR(R12)(r11) 227 232 PPC_STL r7, VCPU_CTR(r11) 228 233 mr r4, r11 229 234 kvm_handler_common \intno, \srr0, \flags ··· 233 238 _GLOBAL(kvmppc_handler_\intno\()_\srr1) 234 239 mfspr r10, SPRN_SPRG_THREAD 235 240 GET_VCPU(r11, r10) 236 - PPC_STL r3, VCPU_GPR(r3)(r11) 241 + PPC_STL r3, VCPU_GPR(R3)(r11) 237 242 mfspr r3, \scratch 238 - PPC_STL r4, VCPU_GPR(r4)(r11) 243 + PPC_STL r4, VCPU_GPR(R4)(r11) 239 244 PPC_LL r4, GPR9(r8) 240 - PPC_STL r5, VCPU_GPR(r5)(r11) 245 + PPC_STL r5, VCPU_GPR(R5)(r11) 241 246 stw r9, VCPU_CR(r11) 242 247 mfspr r5, \srr0 243 - PPC_STL r3, VCPU_GPR(r8)(r11) 248 + PPC_STL r3, VCPU_GPR(R8)(r11) 244 249 PPC_LL r3, GPR10(r8) 245 - PPC_STL r6, VCPU_GPR(r6)(r11) 246 - PPC_STL r4, VCPU_GPR(r9)(r11) 250 + PPC_STL r6, VCPU_GPR(R6)(r11) 251 + PPC_STL r4, VCPU_GPR(R9)(r11) 247 252 mfspr r6, \srr1 248 253 PPC_LL r4, GPR11(r8) 249 - PPC_STL r7, VCPU_GPR(r7)(r11) 250 - PPC_STL r3, VCPU_GPR(r10)(r11) 254 + PPC_STL r7, VCPU_GPR(R7)(r11) 255 + PPC_STL r3, VCPU_GPR(R10)(r11) 251 256 mfctr r7 252 - PPC_STL r12, VCPU_GPR(r12)(r11) 253 - PPC_STL r13, VCPU_GPR(r13)(r11) 254 - PPC_STL r4, VCPU_GPR(r11)(r11) 257 + PPC_STL r12, VCPU_GPR(R12)(r11) 258 + PPC_STL r13, VCPU_GPR(R13)(r11) 259 + PPC_STL r4, VCPU_GPR(R11)(r11) 255 260 PPC_STL r7, VCPU_CTR(r11) 256 261 mr r4, r11 257 262 kvm_handler_common \intno, \srr0, \flags ··· 305 310 _GLOBAL(kvmppc_resume_host) 306 311 /* Save remaining volatile guest register state to vcpu. */ 307 312 mfspr r3, SPRN_VRSAVE 308 - PPC_STL r0, VCPU_GPR(r0)(r4) 313 + PPC_STL r0, VCPU_GPR(R0)(r4) 309 314 mflr r5 310 315 mfspr r6, SPRN_SPRG4 311 316 PPC_STL r5, VCPU_LR(r4) ··· 353 358 354 359 /* Restore vcpu pointer and the nonvolatiles we used. */ 355 360 mr r4, r14 356 - PPC_LL r14, VCPU_GPR(r14)(r4) 361 + PPC_LL r14, VCPU_GPR(R14)(r4) 357 362 358 363 andi. r5, r3, RESUME_FLAG_NV 359 364 beq skip_nv_load 360 - PPC_LL r15, VCPU_GPR(r15)(r4) 361 - PPC_LL r16, VCPU_GPR(r16)(r4) 362 - PPC_LL r17, VCPU_GPR(r17)(r4) 363 - PPC_LL r18, VCPU_GPR(r18)(r4) 364 - PPC_LL r19, VCPU_GPR(r19)(r4) 365 - PPC_LL r20, VCPU_GPR(r20)(r4) 366 - PPC_LL r21, VCPU_GPR(r21)(r4) 367 - PPC_LL r22, VCPU_GPR(r22)(r4) 368 - PPC_LL r23, VCPU_GPR(r23)(r4) 369 - PPC_LL r24, VCPU_GPR(r24)(r4) 370 - PPC_LL r25, VCPU_GPR(r25)(r4) 371 - PPC_LL r26, VCPU_GPR(r26)(r4) 372 - PPC_LL r27, VCPU_GPR(r27)(r4) 373 - PPC_LL r28, VCPU_GPR(r28)(r4) 374 - PPC_LL r29, VCPU_GPR(r29)(r4) 375 - PPC_LL r30, VCPU_GPR(r30)(r4) 376 - PPC_LL r31, VCPU_GPR(r31)(r4) 365 + PPC_LL r15, VCPU_GPR(R15)(r4) 366 + PPC_LL r16, VCPU_GPR(R16)(r4) 367 + PPC_LL r17, VCPU_GPR(R17)(r4) 368 + PPC_LL r18, VCPU_GPR(R18)(r4) 369 + PPC_LL r19, VCPU_GPR(R19)(r4) 370 + PPC_LL r20, VCPU_GPR(R20)(r4) 371 + PPC_LL r21, VCPU_GPR(R21)(r4) 372 + PPC_LL r22, VCPU_GPR(R22)(r4) 373 + PPC_LL r23, VCPU_GPR(R23)(r4) 374 + PPC_LL r24, VCPU_GPR(R24)(r4) 375 + PPC_LL r25, VCPU_GPR(R25)(r4) 376 + PPC_LL r26, VCPU_GPR(R26)(r4) 377 + PPC_LL r27, VCPU_GPR(R27)(r4) 378 + PPC_LL r28, VCPU_GPR(R28)(r4) 379 + PPC_LL r29, VCPU_GPR(R29)(r4) 380 + PPC_LL r30, VCPU_GPR(R30)(r4) 381 + PPC_LL r31, VCPU_GPR(R31)(r4) 377 382 skip_nv_load: 378 383 /* Should we return to the guest? */ 379 384 andi. r5, r3, RESUME_FLAG_HOST ··· 391 396 * non-volatiles. 392 397 */ 393 398 394 - PPC_STL r15, VCPU_GPR(r15)(r4) 395 - PPC_STL r16, VCPU_GPR(r16)(r4) 396 - PPC_STL r17, VCPU_GPR(r17)(r4) 397 - PPC_STL r18, VCPU_GPR(r18)(r4) 398 - PPC_STL r19, VCPU_GPR(r19)(r4) 399 - PPC_STL r20, VCPU_GPR(r20)(r4) 400 - PPC_STL r21, VCPU_GPR(r21)(r4) 401 - PPC_STL r22, VCPU_GPR(r22)(r4) 402 - PPC_STL r23, VCPU_GPR(r23)(r4) 403 - PPC_STL r24, VCPU_GPR(r24)(r4) 404 - PPC_STL r25, VCPU_GPR(r25)(r4) 405 - PPC_STL r26, VCPU_GPR(r26)(r4) 406 - PPC_STL r27, VCPU_GPR(r27)(r4) 407 - PPC_STL r28, VCPU_GPR(r28)(r4) 408 - PPC_STL r29, VCPU_GPR(r29)(r4) 409 - PPC_STL r30, VCPU_GPR(r30)(r4) 410 - PPC_STL r31, VCPU_GPR(r31)(r4) 399 + PPC_STL r15, VCPU_GPR(R15)(r4) 400 + PPC_STL r16, VCPU_GPR(R16)(r4) 401 + PPC_STL r17, VCPU_GPR(R17)(r4) 402 + PPC_STL r18, VCPU_GPR(R18)(r4) 403 + PPC_STL r19, VCPU_GPR(R19)(r4) 404 + PPC_STL r20, VCPU_GPR(R20)(r4) 405 + PPC_STL r21, VCPU_GPR(R21)(r4) 406 + PPC_STL r22, VCPU_GPR(R22)(r4) 407 + PPC_STL r23, VCPU_GPR(R23)(r4) 408 + PPC_STL r24, VCPU_GPR(R24)(r4) 409 + PPC_STL r25, VCPU_GPR(R25)(r4) 410 + PPC_STL r26, VCPU_GPR(R26)(r4) 411 + PPC_STL r27, VCPU_GPR(R27)(r4) 412 + PPC_STL r28, VCPU_GPR(R28)(r4) 413 + PPC_STL r29, VCPU_GPR(R29)(r4) 414 + PPC_STL r30, VCPU_GPR(R30)(r4) 415 + PPC_STL r31, VCPU_GPR(R31)(r4) 411 416 412 417 /* Load host non-volatile register state from host stack. */ 413 418 PPC_LL r14, HOST_NV_GPR(r14)(r1) ··· 473 478 PPC_STL r31, HOST_NV_GPR(r31)(r1) 474 479 475 480 /* Load guest non-volatiles. */ 476 - PPC_LL r14, VCPU_GPR(r14)(r4) 477 - PPC_LL r15, VCPU_GPR(r15)(r4) 478 - PPC_LL r16, VCPU_GPR(r16)(r4) 479 - PPC_LL r17, VCPU_GPR(r17)(r4) 480 - PPC_LL r18, VCPU_GPR(r18)(r4) 481 - PPC_LL r19, VCPU_GPR(r19)(r4) 482 - PPC_LL r20, VCPU_GPR(r20)(r4) 483 - PPC_LL r21, VCPU_GPR(r21)(r4) 484 - PPC_LL r22, VCPU_GPR(r22)(r4) 485 - PPC_LL r23, VCPU_GPR(r23)(r4) 486 - PPC_LL r24, VCPU_GPR(r24)(r4) 487 - PPC_LL r25, VCPU_GPR(r25)(r4) 488 - PPC_LL r26, VCPU_GPR(r26)(r4) 489 - PPC_LL r27, VCPU_GPR(r27)(r4) 490 - PPC_LL r28, VCPU_GPR(r28)(r4) 491 - PPC_LL r29, VCPU_GPR(r29)(r4) 492 - PPC_LL r30, VCPU_GPR(r30)(r4) 493 - PPC_LL r31, VCPU_GPR(r31)(r4) 481 + PPC_LL r14, VCPU_GPR(R14)(r4) 482 + PPC_LL r15, VCPU_GPR(R15)(r4) 483 + PPC_LL r16, VCPU_GPR(R16)(r4) 484 + PPC_LL r17, VCPU_GPR(R17)(r4) 485 + PPC_LL r18, VCPU_GPR(R18)(r4) 486 + PPC_LL r19, VCPU_GPR(R19)(r4) 487 + PPC_LL r20, VCPU_GPR(R20)(r4) 488 + PPC_LL r21, VCPU_GPR(R21)(r4) 489 + PPC_LL r22, VCPU_GPR(R22)(r4) 490 + PPC_LL r23, VCPU_GPR(R23)(r4) 491 + PPC_LL r24, VCPU_GPR(R24)(r4) 492 + PPC_LL r25, VCPU_GPR(R25)(r4) 493 + PPC_LL r26, VCPU_GPR(R26)(r4) 494 + PPC_LL r27, VCPU_GPR(R27)(r4) 495 + PPC_LL r28, VCPU_GPR(R28)(r4) 496 + PPC_LL r29, VCPU_GPR(R29)(r4) 497 + PPC_LL r30, VCPU_GPR(R30)(r4) 498 + PPC_LL r31, VCPU_GPR(R31)(r4) 494 499 495 500 496 501 lightweight_exit: ··· 549 554 lwz r7, VCPU_CR(r4) 550 555 PPC_LL r8, VCPU_PC(r4) 551 556 PPC_LD(r9, VCPU_SHARED_MSR, r11) 552 - PPC_LL r0, VCPU_GPR(r0)(r4) 553 - PPC_LL r1, VCPU_GPR(r1)(r4) 554 - PPC_LL r2, VCPU_GPR(r2)(r4) 555 - PPC_LL r10, VCPU_GPR(r10)(r4) 556 - PPC_LL r11, VCPU_GPR(r11)(r4) 557 - PPC_LL r12, VCPU_GPR(r12)(r4) 558 - PPC_LL r13, VCPU_GPR(r13)(r4) 557 + PPC_LL r0, VCPU_GPR(R0)(r4) 558 + PPC_LL r1, VCPU_GPR(R1)(r4) 559 + PPC_LL r2, VCPU_GPR(R2)(r4) 560 + PPC_LL r10, VCPU_GPR(R10)(r4) 561 + PPC_LL r11, VCPU_GPR(R11)(r4) 562 + PPC_LL r12, VCPU_GPR(R12)(r4) 563 + PPC_LL r13, VCPU_GPR(R13)(r4) 559 564 mtlr r3 560 565 mtxer r5 561 566 mtctr r6 ··· 581 586 mtcr r7 582 587 583 588 /* Finish loading guest volatiles and jump to guest. */ 584 - PPC_LL r5, VCPU_GPR(r5)(r4) 585 - PPC_LL r6, VCPU_GPR(r6)(r4) 586 - PPC_LL r7, VCPU_GPR(r7)(r4) 587 - PPC_LL r8, VCPU_GPR(r8)(r4) 588 - PPC_LL r9, VCPU_GPR(r9)(r4) 589 + PPC_LL r5, VCPU_GPR(R5)(r4) 590 + PPC_LL r6, VCPU_GPR(R6)(r4) 591 + PPC_LL r7, VCPU_GPR(R7)(r4) 592 + PPC_LL r8, VCPU_GPR(R8)(r4) 593 + PPC_LL r9, VCPU_GPR(R9)(r4) 589 594 590 - PPC_LL r3, VCPU_GPR(r3)(r4) 591 - PPC_LL r4, VCPU_GPR(r4)(r4) 595 + PPC_LL r3, VCPU_GPR(R3)(r4) 596 + PPC_LL r4, VCPU_GPR(R4)(r4) 592 597 rfi
+3 -2
arch/powerpc/lib/Makefile
··· 17 17 obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ 18 18 memcpy_64.o usercopy_64.o mem_64.o string.o \ 19 19 checksum_wrappers_64.o hweight_64.o \ 20 - copyuser_power7.o 20 + copyuser_power7.o string_64.o copypage_power7.o \ 21 + memcpy_power7.o 21 22 obj-$(CONFIG_XMON) += sstep.o ldstfp.o 22 23 obj-$(CONFIG_KPROBES) += sstep.o ldstfp.o 23 24 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += sstep.o ldstfp.o 24 25 25 26 ifeq ($(CONFIG_PPC64),y) 26 27 obj-$(CONFIG_SMP) += locks.o 27 - obj-$(CONFIG_ALTIVEC) += copyuser_power7_vmx.o 28 + obj-$(CONFIG_ALTIVEC) += vmx-helper.o 28 29 endif 29 30 30 31 obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
+12 -15
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 - 71 68 /* 72 69 * Computes the checksum of a memory block at buff, length len, 73 70 * and adds in "sum" (32-bit). ··· 111 114 mtctr r6 112 115 113 116 stdu r1,-STACKFRAMESIZE(r1) 114 - std r14,STK_REG(r14)(r1) 115 - std r15,STK_REG(r15)(r1) 116 - std r16,STK_REG(r16)(r1) 117 + std r14,STK_REG(R14)(r1) 118 + std r15,STK_REG(R15)(r1) 119 + std r16,STK_REG(R16)(r1) 117 120 118 121 ld r6,0(r3) 119 122 ld r9,8(r3) ··· 172 175 adde r0,r0,r15 173 176 adde r0,r0,r16 174 177 175 - ld r14,STK_REG(r14)(r1) 176 - ld r15,STK_REG(r15)(r1) 177 - ld r16,STK_REG(r16)(r1) 178 + ld r14,STK_REG(R14)(r1) 179 + ld r15,STK_REG(R15)(r1) 180 + ld r16,STK_REG(R16)(r1) 178 181 addi r1,r1,STACKFRAMESIZE 179 182 180 183 andi. r4,r4,63 ··· 296 299 mtctr r6 297 300 298 301 stdu r1,-STACKFRAMESIZE(r1) 299 - std r14,STK_REG(r14)(r1) 300 - std r15,STK_REG(r15)(r1) 301 - std r16,STK_REG(r16)(r1) 302 + std r14,STK_REG(R14)(r1) 303 + std r15,STK_REG(R15)(r1) 304 + std r16,STK_REG(R16)(r1) 302 305 303 306 source; ld r6,0(r3) 304 307 source; ld r9,8(r3) ··· 379 382 adde r0,r0,r15 380 383 adde r0,r0,r16 381 384 382 - ld r14,STK_REG(r14)(r1) 383 - ld r15,STK_REG(r15)(r1) 384 - ld r16,STK_REG(r16)(r1) 385 + ld r14,STK_REG(R14)(r1) 386 + ld r15,STK_REG(R15)(r1) 387 + ld r16,STK_REG(R16)(r1) 385 388 addi r1,r1,STACKFRAMESIZE 386 389 387 390 andi. r5,r5,63
+10 -4
arch/powerpc/lib/code-patching.c
··· 13 13 #include <linux/mm.h> 14 14 #include <asm/page.h> 15 15 #include <asm/code-patching.h> 16 + #include <asm/uaccess.h> 16 17 17 18 18 - void patch_instruction(unsigned int *addr, unsigned int instr) 19 + int patch_instruction(unsigned int *addr, unsigned int instr) 19 20 { 20 - *addr = instr; 21 + int err; 22 + 23 + err = __put_user(instr, addr); 24 + if (err) 25 + return err; 21 26 asm ("dcbst 0, %0; sync; icbi 0,%0; sync; isync" : : "r" (addr)); 27 + return 0; 22 28 } 23 29 24 - void patch_branch(unsigned int *addr, unsigned long target, int flags) 30 + int patch_branch(unsigned int *addr, unsigned long target, int flags) 25 31 { 26 - patch_instruction(addr, create_branch(addr, target, flags)); 32 + return patch_instruction(addr, create_branch(addr, target, flags)); 27 33 } 28 34 29 35 unsigned int create_branch(const unsigned int *addr,
+4
arch/powerpc/lib/copypage_64.S
··· 17 17 .section ".text" 18 18 19 19 _GLOBAL(copy_page) 20 + BEGIN_FTR_SECTION 20 21 lis r5,PAGE_SIZE@h 22 + FTR_SECTION_ELSE 23 + b .copypage_power7 24 + ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY) 21 25 ori r5,r5,PAGE_SIZE@l 22 26 BEGIN_FTR_SECTION 23 27 ld r10,PPC64_CACHES@toc(r2)
+165
arch/powerpc/lib/copypage_power7.S
··· 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, 2012 17 + * 18 + * Author: Anton Blanchard <anton@au.ibm.com> 19 + */ 20 + #include <asm/page.h> 21 + #include <asm/ppc_asm.h> 22 + 23 + _GLOBAL(copypage_power7) 24 + /* 25 + * We prefetch both the source and destination using enhanced touch 26 + * instructions. We use a stream ID of 0 for the load side and 27 + * 1 for the store side. Since source and destination are page 28 + * aligned we don't need to clear the bottom 7 bits of either 29 + * address. 30 + */ 31 + ori r9,r3,1 /* stream=1 */ 32 + 33 + #ifdef CONFIG_PPC_64K_PAGES 34 + lis r7,0x0E01 /* depth=7, units=512 */ 35 + #else 36 + lis r7,0x0E00 /* depth=7 */ 37 + ori r7,r7,0x1000 /* units=32 */ 38 + #endif 39 + ori r10,r7,1 /* stream=1 */ 40 + 41 + lis r8,0x8000 /* GO=1 */ 42 + clrldi r8,r8,32 43 + 44 + .machine push 45 + .machine "power4" 46 + dcbt r0,r4,0b01000 47 + dcbt r0,r7,0b01010 48 + dcbtst r0,r9,0b01000 49 + dcbtst r0,r10,0b01010 50 + eieio 51 + dcbt r0,r8,0b01010 /* GO */ 52 + .machine pop 53 + 54 + #ifdef CONFIG_ALTIVEC 55 + mflr r0 56 + std r3,48(r1) 57 + std r4,56(r1) 58 + std r0,16(r1) 59 + stdu r1,-STACKFRAMESIZE(r1) 60 + bl .enter_vmx_copy 61 + cmpwi r3,0 62 + ld r0,STACKFRAMESIZE+16(r1) 63 + ld r3,STACKFRAMESIZE+48(r1) 64 + ld r4,STACKFRAMESIZE+56(r1) 65 + mtlr r0 66 + 67 + li r0,(PAGE_SIZE/128) 68 + mtctr r0 69 + 70 + beq .Lnonvmx_copy 71 + 72 + addi r1,r1,STACKFRAMESIZE 73 + 74 + li r6,16 75 + li r7,32 76 + li r8,48 77 + li r9,64 78 + li r10,80 79 + li r11,96 80 + li r12,112 81 + 82 + .align 5 83 + 1: lvx vr7,r0,r4 84 + lvx vr6,r4,r6 85 + lvx vr5,r4,r7 86 + lvx vr4,r4,r8 87 + lvx vr3,r4,r9 88 + lvx vr2,r4,r10 89 + lvx vr1,r4,r11 90 + lvx vr0,r4,r12 91 + addi r4,r4,128 92 + stvx vr7,r0,r3 93 + stvx vr6,r3,r6 94 + stvx vr5,r3,r7 95 + stvx vr4,r3,r8 96 + stvx vr3,r3,r9 97 + stvx vr2,r3,r10 98 + stvx vr1,r3,r11 99 + stvx vr0,r3,r12 100 + addi r3,r3,128 101 + bdnz 1b 102 + 103 + b .exit_vmx_copy /* tail call optimise */ 104 + 105 + #else 106 + li r0,(PAGE_SIZE/128) 107 + mtctr r0 108 + 109 + stdu r1,-STACKFRAMESIZE(r1) 110 + #endif 111 + 112 + .Lnonvmx_copy: 113 + std r14,STK_REG(R14)(r1) 114 + std r15,STK_REG(R15)(r1) 115 + std r16,STK_REG(R16)(r1) 116 + std r17,STK_REG(R17)(r1) 117 + std r18,STK_REG(R18)(r1) 118 + std r19,STK_REG(R19)(r1) 119 + std r20,STK_REG(R20)(r1) 120 + 121 + 1: ld r0,0(r4) 122 + ld r5,8(r4) 123 + ld r6,16(r4) 124 + ld r7,24(r4) 125 + ld r8,32(r4) 126 + ld r9,40(r4) 127 + ld r10,48(r4) 128 + ld r11,56(r4) 129 + ld r12,64(r4) 130 + ld r14,72(r4) 131 + ld r15,80(r4) 132 + ld r16,88(r4) 133 + ld r17,96(r4) 134 + ld r18,104(r4) 135 + ld r19,112(r4) 136 + ld r20,120(r4) 137 + addi r4,r4,128 138 + std r0,0(r3) 139 + std r5,8(r3) 140 + std r6,16(r3) 141 + std r7,24(r3) 142 + std r8,32(r3) 143 + std r9,40(r3) 144 + std r10,48(r3) 145 + std r11,56(r3) 146 + std r12,64(r3) 147 + std r14,72(r3) 148 + std r15,80(r3) 149 + std r16,88(r3) 150 + std r17,96(r3) 151 + std r18,104(r3) 152 + std r19,112(r3) 153 + std r20,120(r3) 154 + addi r3,r3,128 155 + bdnz 1b 156 + 157 + ld r14,STK_REG(R14)(r1) 158 + ld r15,STK_REG(R15)(r1) 159 + ld r16,STK_REG(R16)(r1) 160 + ld r17,STK_REG(R17)(r1) 161 + ld r18,STK_REG(R18)(r1) 162 + ld r19,STK_REG(R19)(r1) 163 + ld r20,STK_REG(R20)(r1) 164 + addi r1,r1,STACKFRAMESIZE 165 + blr
+108 -49
arch/powerpc/lib/copyuser_power7.S
··· 19 19 */ 20 20 #include <asm/ppc_asm.h> 21 21 22 - #define STACKFRAMESIZE 256 23 - #define STK_REG(i) (112 + ((i)-14)*8) 24 - 25 22 .macro err1 26 23 100: 27 24 .section __ex_table,"a" ··· 54 57 55 58 56 59 .Ldo_err4: 57 - ld r16,STK_REG(r16)(r1) 58 - ld r15,STK_REG(r15)(r1) 59 - ld r14,STK_REG(r14)(r1) 60 + ld r16,STK_REG(R16)(r1) 61 + ld r15,STK_REG(R15)(r1) 62 + ld r14,STK_REG(R14)(r1) 60 63 .Ldo_err3: 61 - bl .exit_vmx_copy 64 + bl .exit_vmx_usercopy 62 65 ld r0,STACKFRAMESIZE+16(r1) 63 66 mtlr r0 64 67 b .Lexit 65 68 #endif /* CONFIG_ALTIVEC */ 66 69 67 70 .Ldo_err2: 68 - ld r22,STK_REG(r22)(r1) 69 - ld r21,STK_REG(r21)(r1) 70 - ld r20,STK_REG(r20)(r1) 71 - ld r19,STK_REG(r19)(r1) 72 - ld r18,STK_REG(r18)(r1) 73 - ld r17,STK_REG(r17)(r1) 74 - ld r16,STK_REG(r16)(r1) 75 - ld r15,STK_REG(r15)(r1) 76 - ld r14,STK_REG(r14)(r1) 71 + ld r22,STK_REG(R22)(r1) 72 + ld r21,STK_REG(R21)(r1) 73 + ld r20,STK_REG(R20)(r1) 74 + ld r19,STK_REG(R19)(r1) 75 + ld r18,STK_REG(R18)(r1) 76 + ld r17,STK_REG(R17)(r1) 77 + ld r16,STK_REG(R16)(r1) 78 + ld r15,STK_REG(R15)(r1) 79 + ld r14,STK_REG(R14)(r1) 77 80 .Lexit: 78 81 addi r1,r1,STACKFRAMESIZE 79 82 .Ldo_err1: ··· 134 137 135 138 mflr r0 136 139 stdu r1,-STACKFRAMESIZE(r1) 137 - std r14,STK_REG(r14)(r1) 138 - std r15,STK_REG(r15)(r1) 139 - std r16,STK_REG(r16)(r1) 140 - std r17,STK_REG(r17)(r1) 141 - std r18,STK_REG(r18)(r1) 142 - std r19,STK_REG(r19)(r1) 143 - std r20,STK_REG(r20)(r1) 144 - std r21,STK_REG(r21)(r1) 145 - std r22,STK_REG(r22)(r1) 140 + std r14,STK_REG(R14)(r1) 141 + std r15,STK_REG(R15)(r1) 142 + std r16,STK_REG(R16)(r1) 143 + std r17,STK_REG(R17)(r1) 144 + std r18,STK_REG(R18)(r1) 145 + std r19,STK_REG(R19)(r1) 146 + std r20,STK_REG(R20)(r1) 147 + std r21,STK_REG(R21)(r1) 148 + std r22,STK_REG(R22)(r1) 146 149 std r0,STACKFRAMESIZE+16(r1) 147 150 148 151 srdi r6,r5,7 ··· 189 192 190 193 clrldi r5,r5,(64-7) 191 194 192 - ld r14,STK_REG(r14)(r1) 193 - ld r15,STK_REG(r15)(r1) 194 - ld r16,STK_REG(r16)(r1) 195 - ld r17,STK_REG(r17)(r1) 196 - ld r18,STK_REG(r18)(r1) 197 - ld r19,STK_REG(r19)(r1) 198 - ld r20,STK_REG(r20)(r1) 199 - ld r21,STK_REG(r21)(r1) 200 - ld r22,STK_REG(r22)(r1) 195 + ld r14,STK_REG(R14)(r1) 196 + ld r15,STK_REG(R15)(r1) 197 + ld r16,STK_REG(R16)(r1) 198 + ld r17,STK_REG(R17)(r1) 199 + ld r18,STK_REG(R18)(r1) 200 + ld r19,STK_REG(R19)(r1) 201 + ld r20,STK_REG(R20)(r1) 202 + ld r21,STK_REG(R21)(r1) 203 + ld r22,STK_REG(R22)(r1) 201 204 addi r1,r1,STACKFRAMESIZE 202 205 203 206 /* Up to 127B to go */ ··· 287 290 mflr r0 288 291 std r0,16(r1) 289 292 stdu r1,-STACKFRAMESIZE(r1) 290 - bl .enter_vmx_copy 293 + bl .enter_vmx_usercopy 291 294 cmpwi r3,0 292 295 ld r0,STACKFRAMESIZE+16(r1) 293 296 ld r3,STACKFRAMESIZE+48(r1) 294 297 ld r4,STACKFRAMESIZE+56(r1) 295 298 ld r5,STACKFRAMESIZE+64(r1) 296 299 mtlr r0 300 + 301 + /* 302 + * We prefetch both the source and destination using enhanced touch 303 + * instructions. We use a stream ID of 0 for the load side and 304 + * 1 for the store side. 305 + */ 306 + clrrdi r6,r4,7 307 + clrrdi r9,r3,7 308 + ori r9,r9,1 /* stream=1 */ 309 + 310 + srdi r7,r5,7 /* length in cachelines, capped at 0x3FF */ 311 + cmpldi r7,0x3FF 312 + ble 1f 313 + li r7,0x3FF 314 + 1: lis r0,0x0E00 /* depth=7 */ 315 + sldi r7,r7,7 316 + or r7,r7,r0 317 + ori r10,r7,1 /* stream=1 */ 318 + 319 + lis r8,0x8000 /* GO=1 */ 320 + clrldi r8,r8,32 321 + 322 + .machine push 323 + .machine "power4" 324 + dcbt r0,r6,0b01000 325 + dcbt r0,r7,0b01010 326 + dcbtst r0,r9,0b01000 327 + dcbtst r0,r10,0b01010 328 + eieio 329 + dcbt r0,r8,0b01010 /* GO */ 330 + .machine pop 331 + 332 + /* 333 + * We prefetch both the source and destination using enhanced touch 334 + * instructions. We use a stream ID of 0 for the load side and 335 + * 1 for the store side. 336 + */ 337 + clrrdi r6,r4,7 338 + clrrdi r9,r3,7 339 + ori r9,r9,1 /* stream=1 */ 340 + 341 + srdi r7,r5,7 /* length in cachelines, capped at 0x3FF */ 342 + cmpldi cr1,r7,0x3FF 343 + ble cr1,1f 344 + li r7,0x3FF 345 + 1: lis r0,0x0E00 /* depth=7 */ 346 + sldi r7,r7,7 347 + or r7,r7,r0 348 + ori r10,r7,1 /* stream=1 */ 349 + 350 + lis r8,0x8000 /* GO=1 */ 351 + clrldi r8,r8,32 352 + 353 + .machine push 354 + .machine "power4" 355 + dcbt r0,r6,0b01000 356 + dcbt r0,r7,0b01010 357 + dcbtst r0,r9,0b01000 358 + dcbtst r0,r10,0b01010 359 + eieio 360 + dcbt r0,r8,0b01010 /* GO */ 361 + .machine pop 297 362 298 363 beq .Lunwind_stack_nonvmx_copy 299 364 ··· 437 378 7: sub r5,r5,r6 438 379 srdi r6,r5,7 439 380 440 - std r14,STK_REG(r14)(r1) 441 - std r15,STK_REG(r15)(r1) 442 - std r16,STK_REG(r16)(r1) 381 + std r14,STK_REG(R14)(r1) 382 + std r15,STK_REG(R15)(r1) 383 + std r16,STK_REG(R16)(r1) 443 384 444 385 li r12,64 445 386 li r14,80 ··· 474 415 addi r3,r3,128 475 416 bdnz 8b 476 417 477 - ld r14,STK_REG(r14)(r1) 478 - ld r15,STK_REG(r15)(r1) 479 - ld r16,STK_REG(r16)(r1) 418 + ld r14,STK_REG(R14)(r1) 419 + ld r15,STK_REG(R15)(r1) 420 + ld r16,STK_REG(R16)(r1) 480 421 481 422 /* Up to 127B to go */ 482 423 clrldi r5,r5,(64-7) ··· 535 476 err3; stb r0,0(r3) 536 477 537 478 15: addi r1,r1,STACKFRAMESIZE 538 - b .exit_vmx_copy /* tail call optimise */ 479 + b .exit_vmx_usercopy /* tail call optimise */ 539 480 540 481 .Lvmx_unaligned_copy: 541 482 /* Get the destination 16B aligned */ ··· 622 563 7: sub r5,r5,r6 623 564 srdi r6,r5,7 624 565 625 - std r14,STK_REG(r14)(r1) 626 - std r15,STK_REG(r15)(r1) 627 - std r16,STK_REG(r16)(r1) 566 + std r14,STK_REG(R14)(r1) 567 + std r15,STK_REG(R15)(r1) 568 + std r16,STK_REG(R16)(r1) 628 569 629 570 li r12,64 630 571 li r14,80 ··· 667 608 addi r3,r3,128 668 609 bdnz 8b 669 610 670 - ld r14,STK_REG(r14)(r1) 671 - ld r15,STK_REG(r15)(r1) 672 - ld r16,STK_REG(r16)(r1) 611 + ld r14,STK_REG(R14)(r1) 612 + ld r15,STK_REG(R15)(r1) 613 + ld r16,STK_REG(R16)(r1) 673 614 674 615 /* Up to 127B to go */ 675 616 clrldi r5,r5,(64-7) ··· 738 679 err3; stb r0,0(r3) 739 680 740 681 15: addi r1,r1,STACKFRAMESIZE 741 - b .exit_vmx_copy /* tail call optimise */ 682 + b .exit_vmx_usercopy /* tail call optimise */ 742 683 #endif /* CONFiG_ALTIVEC */
+25 -2
arch/powerpc/lib/copyuser_power7_vmx.c arch/powerpc/lib/vmx-helper.c
··· 22 22 #include <linux/hardirq.h> 23 23 #include <asm/switch_to.h> 24 24 25 - int enter_vmx_copy(void) 25 + int enter_vmx_usercopy(void) 26 26 { 27 27 if (in_interrupt()) 28 28 return 0; ··· 44 44 * This function must return 0 because we tail call optimise when calling 45 45 * from __copy_tofrom_user_power7 which returns 0 on success. 46 46 */ 47 - int exit_vmx_copy(void) 47 + int exit_vmx_usercopy(void) 48 48 { 49 49 pagefault_enable(); 50 50 return 0; 51 + } 52 + 53 + int enter_vmx_copy(void) 54 + { 55 + if (in_interrupt()) 56 + return 0; 57 + 58 + preempt_disable(); 59 + 60 + enable_kernel_altivec(); 61 + 62 + return 1; 63 + } 64 + 65 + /* 66 + * All calls to this function will be optimised into tail calls. We are 67 + * passed a pointer to the destination which we return as required by a 68 + * memcpy implementation. 69 + */ 70 + void *exit_vmx_copy(void *dest) 71 + { 72 + preempt_enable(); 73 + return dest; 51 74 }
+4 -1
arch/powerpc/lib/crtsavres.S
··· 41 41 #include <asm/ppc_asm.h> 42 42 43 43 .file "crtsavres.S" 44 - .section ".text" 45 44 46 45 #ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 47 46 48 47 #ifndef CONFIG_PPC64 48 + 49 + .section ".text" 49 50 50 51 /* Routines for saving integer registers, called by the compiler. */ 51 52 /* Called with r11 pointing to the stack header word of the caller of the */ ··· 232 231 blr 233 232 234 233 #else /* CONFIG_PPC64 */ 234 + 235 + .section ".text.save.restore","ax",@progbits 235 236 236 237 .globl _savegpr0_14 237 238 _savegpr0_14:
+7 -7
arch/powerpc/lib/hweight_64.S
··· 28 28 nop 29 29 nop 30 30 FTR_SECTION_ELSE 31 - PPC_POPCNTB(r3,r3) 31 + PPC_POPCNTB(R3,R3) 32 32 clrldi r3,r3,64-8 33 33 blr 34 34 ALT_FTR_SECTION_END_IFCLR(CPU_FTR_POPCNTB) ··· 42 42 nop 43 43 FTR_SECTION_ELSE 44 44 BEGIN_FTR_SECTION_NESTED(50) 45 - PPC_POPCNTB(r3,r3) 45 + PPC_POPCNTB(R3,R3) 46 46 srdi r4,r3,8 47 47 add r3,r4,r3 48 48 clrldi r3,r3,64-8 49 49 blr 50 50 FTR_SECTION_ELSE_NESTED(50) 51 51 clrlwi r3,r3,16 52 - PPC_POPCNTW(r3,r3) 52 + PPC_POPCNTW(R3,R3) 53 53 clrldi r3,r3,64-8 54 54 blr 55 55 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 50) ··· 66 66 nop 67 67 FTR_SECTION_ELSE 68 68 BEGIN_FTR_SECTION_NESTED(51) 69 - PPC_POPCNTB(r3,r3) 69 + PPC_POPCNTB(R3,R3) 70 70 srdi r4,r3,16 71 71 add r3,r4,r3 72 72 srdi r4,r3,8 ··· 74 74 clrldi r3,r3,64-8 75 75 blr 76 76 FTR_SECTION_ELSE_NESTED(51) 77 - PPC_POPCNTW(r3,r3) 77 + PPC_POPCNTW(R3,R3) 78 78 clrldi r3,r3,64-8 79 79 blr 80 80 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 51) ··· 93 93 nop 94 94 FTR_SECTION_ELSE 95 95 BEGIN_FTR_SECTION_NESTED(52) 96 - PPC_POPCNTB(r3,r3) 96 + PPC_POPCNTB(R3,R3) 97 97 srdi r4,r3,32 98 98 add r3,r4,r3 99 99 srdi r4,r3,16 ··· 103 103 clrldi r3,r3,64-8 104 104 blr 105 105 FTR_SECTION_ELSE_NESTED(52) 106 - PPC_POPCNTD(r3,r3) 106 + PPC_POPCNTD(R3,R3) 107 107 clrldi r3,r3,64-8 108 108 blr 109 109 ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_POPCNTD, 52)
+6 -6
arch/powerpc/lib/ldstfp.S
··· 330 330 MTMSRD(r7) 331 331 isync 332 332 beq cr7,1f 333 - STXVD2X(0,r1,r8) 333 + STXVD2X(0,R1,R8) 334 334 1: li r9,-EFAULT 335 - 2: LXVD2X(0,0,r4) 335 + 2: LXVD2X(0,R0,R4) 336 336 li r9,0 337 337 3: beq cr7,4f 338 338 bl put_vsr 339 - LXVD2X(0,r1,r8) 339 + LXVD2X(0,R1,R8) 340 340 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 341 341 mtlr r0 342 342 MTMSRD(r6) ··· 358 358 MTMSRD(r7) 359 359 isync 360 360 beq cr7,1f 361 - STXVD2X(0,r1,r8) 361 + STXVD2X(0,R1,R8) 362 362 bl get_vsr 363 363 1: li r9,-EFAULT 364 - 2: STXVD2X(0,0,r4) 364 + 2: STXVD2X(0,R0,R4) 365 365 li r9,0 366 366 3: beq cr7,4f 367 - LXVD2X(0,r1,r8) 367 + LXVD2X(0,R1,R8) 368 368 4: PPC_LL r0,STKFRM+PPC_LR_STKOFF(r1) 369 369 mtlr r0 370 370 MTMSRD(r6)
+4
arch/powerpc/lib/memcpy_64.S
··· 11 11 12 12 .align 7 13 13 _GLOBAL(memcpy) 14 + BEGIN_FTR_SECTION 14 15 std r3,48(r1) /* save destination pointer for return value */ 16 + FTR_SECTION_ELSE 17 + b memcpy_power7 18 + ALT_FTR_SECTION_END_IFCLR(CPU_FTR_VMX_COPY) 15 19 PPC_MTOCRF(0x01,r5) 16 20 cmpldi cr1,r5,16 17 21 neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry
+647
arch/powerpc/lib/memcpy_power7.S
··· 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, 2012 17 + * 18 + * Author: Anton Blanchard <anton@au.ibm.com> 19 + */ 20 + #include <asm/ppc_asm.h> 21 + 22 + _GLOBAL(memcpy_power7) 23 + #ifdef CONFIG_ALTIVEC 24 + cmpldi r5,16 25 + cmpldi cr1,r5,4096 26 + 27 + std r3,48(r1) 28 + 29 + blt .Lshort_copy 30 + bgt cr1,.Lvmx_copy 31 + #else 32 + cmpldi r5,16 33 + 34 + std r3,48(r1) 35 + 36 + blt .Lshort_copy 37 + #endif 38 + 39 + .Lnonvmx_copy: 40 + /* Get the source 8B aligned */ 41 + neg r6,r4 42 + mtocrf 0x01,r6 43 + clrldi r6,r6,(64-3) 44 + 45 + bf cr7*4+3,1f 46 + lbz r0,0(r4) 47 + addi r4,r4,1 48 + stb r0,0(r3) 49 + addi r3,r3,1 50 + 51 + 1: bf cr7*4+2,2f 52 + lhz r0,0(r4) 53 + addi r4,r4,2 54 + sth r0,0(r3) 55 + addi r3,r3,2 56 + 57 + 2: bf cr7*4+1,3f 58 + lwz r0,0(r4) 59 + addi r4,r4,4 60 + stw r0,0(r3) 61 + addi r3,r3,4 62 + 63 + 3: sub r5,r5,r6 64 + cmpldi r5,128 65 + blt 5f 66 + 67 + mflr r0 68 + stdu r1,-STACKFRAMESIZE(r1) 69 + std r14,STK_REG(R14)(r1) 70 + std r15,STK_REG(R15)(r1) 71 + std r16,STK_REG(R16)(r1) 72 + std r17,STK_REG(R17)(r1) 73 + std r18,STK_REG(R18)(r1) 74 + std r19,STK_REG(R19)(r1) 75 + std r20,STK_REG(R20)(r1) 76 + std r21,STK_REG(R21)(r1) 77 + std r22,STK_REG(R22)(r1) 78 + std r0,STACKFRAMESIZE+16(r1) 79 + 80 + srdi r6,r5,7 81 + mtctr r6 82 + 83 + /* Now do cacheline (128B) sized loads and stores. */ 84 + .align 5 85 + 4: 86 + ld r0,0(r4) 87 + ld r6,8(r4) 88 + ld r7,16(r4) 89 + ld r8,24(r4) 90 + ld r9,32(r4) 91 + ld r10,40(r4) 92 + ld r11,48(r4) 93 + ld r12,56(r4) 94 + ld r14,64(r4) 95 + ld r15,72(r4) 96 + ld r16,80(r4) 97 + ld r17,88(r4) 98 + ld r18,96(r4) 99 + ld r19,104(r4) 100 + ld r20,112(r4) 101 + ld r21,120(r4) 102 + addi r4,r4,128 103 + std r0,0(r3) 104 + std r6,8(r3) 105 + std r7,16(r3) 106 + std r8,24(r3) 107 + std r9,32(r3) 108 + std r10,40(r3) 109 + std r11,48(r3) 110 + std r12,56(r3) 111 + std r14,64(r3) 112 + std r15,72(r3) 113 + std r16,80(r3) 114 + std r17,88(r3) 115 + std r18,96(r3) 116 + std r19,104(r3) 117 + std r20,112(r3) 118 + std r21,120(r3) 119 + addi r3,r3,128 120 + bdnz 4b 121 + 122 + clrldi r5,r5,(64-7) 123 + 124 + ld r14,STK_REG(R14)(r1) 125 + ld r15,STK_REG(R15)(r1) 126 + ld r16,STK_REG(R16)(r1) 127 + ld r17,STK_REG(R17)(r1) 128 + ld r18,STK_REG(R18)(r1) 129 + ld r19,STK_REG(R19)(r1) 130 + ld r20,STK_REG(R20)(r1) 131 + ld r21,STK_REG(R21)(r1) 132 + ld r22,STK_REG(R22)(r1) 133 + addi r1,r1,STACKFRAMESIZE 134 + 135 + /* Up to 127B to go */ 136 + 5: srdi r6,r5,4 137 + mtocrf 0x01,r6 138 + 139 + 6: bf cr7*4+1,7f 140 + ld r0,0(r4) 141 + ld r6,8(r4) 142 + ld r7,16(r4) 143 + ld r8,24(r4) 144 + ld r9,32(r4) 145 + ld r10,40(r4) 146 + ld r11,48(r4) 147 + ld r12,56(r4) 148 + addi r4,r4,64 149 + std r0,0(r3) 150 + std r6,8(r3) 151 + std r7,16(r3) 152 + std r8,24(r3) 153 + std r9,32(r3) 154 + std r10,40(r3) 155 + std r11,48(r3) 156 + std r12,56(r3) 157 + addi r3,r3,64 158 + 159 + /* Up to 63B to go */ 160 + 7: bf cr7*4+2,8f 161 + ld r0,0(r4) 162 + ld r6,8(r4) 163 + ld r7,16(r4) 164 + ld r8,24(r4) 165 + addi r4,r4,32 166 + std r0,0(r3) 167 + std r6,8(r3) 168 + std r7,16(r3) 169 + std r8,24(r3) 170 + addi r3,r3,32 171 + 172 + /* Up to 31B to go */ 173 + 8: bf cr7*4+3,9f 174 + ld r0,0(r4) 175 + ld r6,8(r4) 176 + addi r4,r4,16 177 + std r0,0(r3) 178 + std r6,8(r3) 179 + addi r3,r3,16 180 + 181 + 9: clrldi r5,r5,(64-4) 182 + 183 + /* Up to 15B to go */ 184 + .Lshort_copy: 185 + mtocrf 0x01,r5 186 + bf cr7*4+0,12f 187 + lwz r0,0(r4) /* Less chance of a reject with word ops */ 188 + lwz r6,4(r4) 189 + addi r4,r4,8 190 + stw r0,0(r3) 191 + stw r6,4(r3) 192 + addi r3,r3,8 193 + 194 + 12: bf cr7*4+1,13f 195 + lwz r0,0(r4) 196 + addi r4,r4,4 197 + stw r0,0(r3) 198 + addi r3,r3,4 199 + 200 + 13: bf cr7*4+2,14f 201 + lhz r0,0(r4) 202 + addi r4,r4,2 203 + sth r0,0(r3) 204 + addi r3,r3,2 205 + 206 + 14: bf cr7*4+3,15f 207 + lbz r0,0(r4) 208 + stb r0,0(r3) 209 + 210 + 15: ld r3,48(r1) 211 + blr 212 + 213 + .Lunwind_stack_nonvmx_copy: 214 + addi r1,r1,STACKFRAMESIZE 215 + b .Lnonvmx_copy 216 + 217 + #ifdef CONFIG_ALTIVEC 218 + .Lvmx_copy: 219 + mflr r0 220 + std r4,56(r1) 221 + std r5,64(r1) 222 + std r0,16(r1) 223 + stdu r1,-STACKFRAMESIZE(r1) 224 + bl .enter_vmx_copy 225 + cmpwi r3,0 226 + ld r0,STACKFRAMESIZE+16(r1) 227 + ld r3,STACKFRAMESIZE+48(r1) 228 + ld r4,STACKFRAMESIZE+56(r1) 229 + ld r5,STACKFRAMESIZE+64(r1) 230 + mtlr r0 231 + 232 + /* 233 + * We prefetch both the source and destination using enhanced touch 234 + * instructions. We use a stream ID of 0 for the load side and 235 + * 1 for the store side. 236 + */ 237 + clrrdi r6,r4,7 238 + clrrdi r9,r3,7 239 + ori r9,r9,1 /* stream=1 */ 240 + 241 + srdi r7,r5,7 /* length in cachelines, capped at 0x3FF */ 242 + cmpldi cr1,r7,0x3FF 243 + ble cr1,1f 244 + li r7,0x3FF 245 + 1: lis r0,0x0E00 /* depth=7 */ 246 + sldi r7,r7,7 247 + or r7,r7,r0 248 + ori r10,r7,1 /* stream=1 */ 249 + 250 + lis r8,0x8000 /* GO=1 */ 251 + clrldi r8,r8,32 252 + 253 + .machine push 254 + .machine "power4" 255 + dcbt r0,r6,0b01000 256 + dcbt r0,r7,0b01010 257 + dcbtst r0,r9,0b01000 258 + dcbtst r0,r10,0b01010 259 + eieio 260 + dcbt r0,r8,0b01010 /* GO */ 261 + .machine pop 262 + 263 + beq .Lunwind_stack_nonvmx_copy 264 + 265 + /* 266 + * If source and destination are not relatively aligned we use a 267 + * slower permute loop. 268 + */ 269 + xor r6,r4,r3 270 + rldicl. r6,r6,0,(64-4) 271 + bne .Lvmx_unaligned_copy 272 + 273 + /* Get the destination 16B aligned */ 274 + neg r6,r3 275 + mtocrf 0x01,r6 276 + clrldi r6,r6,(64-4) 277 + 278 + bf cr7*4+3,1f 279 + lbz r0,0(r4) 280 + addi r4,r4,1 281 + stb r0,0(r3) 282 + addi r3,r3,1 283 + 284 + 1: bf cr7*4+2,2f 285 + lhz r0,0(r4) 286 + addi r4,r4,2 287 + sth r0,0(r3) 288 + addi r3,r3,2 289 + 290 + 2: bf cr7*4+1,3f 291 + lwz r0,0(r4) 292 + addi r4,r4,4 293 + stw r0,0(r3) 294 + addi r3,r3,4 295 + 296 + 3: bf cr7*4+0,4f 297 + ld r0,0(r4) 298 + addi r4,r4,8 299 + std r0,0(r3) 300 + addi r3,r3,8 301 + 302 + 4: sub r5,r5,r6 303 + 304 + /* Get the desination 128B aligned */ 305 + neg r6,r3 306 + srdi r7,r6,4 307 + mtocrf 0x01,r7 308 + clrldi r6,r6,(64-7) 309 + 310 + li r9,16 311 + li r10,32 312 + li r11,48 313 + 314 + bf cr7*4+3,5f 315 + lvx vr1,r0,r4 316 + addi r4,r4,16 317 + stvx vr1,r0,r3 318 + addi r3,r3,16 319 + 320 + 5: bf cr7*4+2,6f 321 + lvx vr1,r0,r4 322 + lvx vr0,r4,r9 323 + addi r4,r4,32 324 + stvx vr1,r0,r3 325 + stvx vr0,r3,r9 326 + addi r3,r3,32 327 + 328 + 6: bf cr7*4+1,7f 329 + lvx vr3,r0,r4 330 + lvx vr2,r4,r9 331 + lvx vr1,r4,r10 332 + lvx vr0,r4,r11 333 + addi r4,r4,64 334 + stvx vr3,r0,r3 335 + stvx vr2,r3,r9 336 + stvx vr1,r3,r10 337 + stvx vr0,r3,r11 338 + addi r3,r3,64 339 + 340 + 7: sub r5,r5,r6 341 + srdi r6,r5,7 342 + 343 + std r14,STK_REG(R14)(r1) 344 + std r15,STK_REG(R15)(r1) 345 + std r16,STK_REG(R16)(r1) 346 + 347 + li r12,64 348 + li r14,80 349 + li r15,96 350 + li r16,112 351 + 352 + mtctr r6 353 + 354 + /* 355 + * Now do cacheline sized loads and stores. By this stage the 356 + * cacheline stores are also cacheline aligned. 357 + */ 358 + .align 5 359 + 8: 360 + lvx vr7,r0,r4 361 + lvx vr6,r4,r9 362 + lvx vr5,r4,r10 363 + lvx vr4,r4,r11 364 + lvx vr3,r4,r12 365 + lvx vr2,r4,r14 366 + lvx vr1,r4,r15 367 + lvx vr0,r4,r16 368 + addi r4,r4,128 369 + stvx vr7,r0,r3 370 + stvx vr6,r3,r9 371 + stvx vr5,r3,r10 372 + stvx vr4,r3,r11 373 + stvx vr3,r3,r12 374 + stvx vr2,r3,r14 375 + stvx vr1,r3,r15 376 + stvx vr0,r3,r16 377 + addi r3,r3,128 378 + bdnz 8b 379 + 380 + ld r14,STK_REG(R14)(r1) 381 + ld r15,STK_REG(R15)(r1) 382 + ld r16,STK_REG(R16)(r1) 383 + 384 + /* Up to 127B to go */ 385 + clrldi r5,r5,(64-7) 386 + srdi r6,r5,4 387 + mtocrf 0x01,r6 388 + 389 + bf cr7*4+1,9f 390 + lvx vr3,r0,r4 391 + lvx vr2,r4,r9 392 + lvx vr1,r4,r10 393 + lvx vr0,r4,r11 394 + addi r4,r4,64 395 + stvx vr3,r0,r3 396 + stvx vr2,r3,r9 397 + stvx vr1,r3,r10 398 + stvx vr0,r3,r11 399 + addi r3,r3,64 400 + 401 + 9: bf cr7*4+2,10f 402 + lvx vr1,r0,r4 403 + lvx vr0,r4,r9 404 + addi r4,r4,32 405 + stvx vr1,r0,r3 406 + stvx vr0,r3,r9 407 + addi r3,r3,32 408 + 409 + 10: bf cr7*4+3,11f 410 + lvx vr1,r0,r4 411 + addi r4,r4,16 412 + stvx vr1,r0,r3 413 + addi r3,r3,16 414 + 415 + /* Up to 15B to go */ 416 + 11: clrldi r5,r5,(64-4) 417 + mtocrf 0x01,r5 418 + bf cr7*4+0,12f 419 + ld r0,0(r4) 420 + addi r4,r4,8 421 + std r0,0(r3) 422 + addi r3,r3,8 423 + 424 + 12: bf cr7*4+1,13f 425 + lwz r0,0(r4) 426 + addi r4,r4,4 427 + stw r0,0(r3) 428 + addi r3,r3,4 429 + 430 + 13: bf cr7*4+2,14f 431 + lhz r0,0(r4) 432 + addi r4,r4,2 433 + sth r0,0(r3) 434 + addi r3,r3,2 435 + 436 + 14: bf cr7*4+3,15f 437 + lbz r0,0(r4) 438 + stb r0,0(r3) 439 + 440 + 15: addi r1,r1,STACKFRAMESIZE 441 + ld r3,48(r1) 442 + b .exit_vmx_copy /* tail call optimise */ 443 + 444 + .Lvmx_unaligned_copy: 445 + /* Get the destination 16B aligned */ 446 + neg r6,r3 447 + mtocrf 0x01,r6 448 + clrldi r6,r6,(64-4) 449 + 450 + bf cr7*4+3,1f 451 + lbz r0,0(r4) 452 + addi r4,r4,1 453 + stb r0,0(r3) 454 + addi r3,r3,1 455 + 456 + 1: bf cr7*4+2,2f 457 + lhz r0,0(r4) 458 + addi r4,r4,2 459 + sth r0,0(r3) 460 + addi r3,r3,2 461 + 462 + 2: bf cr7*4+1,3f 463 + lwz r0,0(r4) 464 + addi r4,r4,4 465 + stw r0,0(r3) 466 + addi r3,r3,4 467 + 468 + 3: bf cr7*4+0,4f 469 + lwz r0,0(r4) /* Less chance of a reject with word ops */ 470 + lwz r7,4(r4) 471 + addi r4,r4,8 472 + stw r0,0(r3) 473 + stw r7,4(r3) 474 + addi r3,r3,8 475 + 476 + 4: sub r5,r5,r6 477 + 478 + /* Get the desination 128B aligned */ 479 + neg r6,r3 480 + srdi r7,r6,4 481 + mtocrf 0x01,r7 482 + clrldi r6,r6,(64-7) 483 + 484 + li r9,16 485 + li r10,32 486 + li r11,48 487 + 488 + lvsl vr16,0,r4 /* Setup permute control vector */ 489 + lvx vr0,0,r4 490 + addi r4,r4,16 491 + 492 + bf cr7*4+3,5f 493 + lvx vr1,r0,r4 494 + vperm vr8,vr0,vr1,vr16 495 + addi r4,r4,16 496 + stvx vr8,r0,r3 497 + addi r3,r3,16 498 + vor vr0,vr1,vr1 499 + 500 + 5: bf cr7*4+2,6f 501 + lvx vr1,r0,r4 502 + vperm vr8,vr0,vr1,vr16 503 + lvx vr0,r4,r9 504 + vperm vr9,vr1,vr0,vr16 505 + addi r4,r4,32 506 + stvx vr8,r0,r3 507 + stvx vr9,r3,r9 508 + addi r3,r3,32 509 + 510 + 6: bf cr7*4+1,7f 511 + lvx vr3,r0,r4 512 + vperm vr8,vr0,vr3,vr16 513 + lvx vr2,r4,r9 514 + vperm vr9,vr3,vr2,vr16 515 + lvx vr1,r4,r10 516 + vperm vr10,vr2,vr1,vr16 517 + lvx vr0,r4,r11 518 + vperm vr11,vr1,vr0,vr16 519 + addi r4,r4,64 520 + stvx vr8,r0,r3 521 + stvx vr9,r3,r9 522 + stvx vr10,r3,r10 523 + stvx vr11,r3,r11 524 + addi r3,r3,64 525 + 526 + 7: sub r5,r5,r6 527 + srdi r6,r5,7 528 + 529 + std r14,STK_REG(R14)(r1) 530 + std r15,STK_REG(R15)(r1) 531 + std r16,STK_REG(R16)(r1) 532 + 533 + li r12,64 534 + li r14,80 535 + li r15,96 536 + li r16,112 537 + 538 + mtctr r6 539 + 540 + /* 541 + * Now do cacheline sized loads and stores. By this stage the 542 + * cacheline stores are also cacheline aligned. 543 + */ 544 + .align 5 545 + 8: 546 + lvx vr7,r0,r4 547 + vperm vr8,vr0,vr7,vr16 548 + lvx vr6,r4,r9 549 + vperm vr9,vr7,vr6,vr16 550 + lvx vr5,r4,r10 551 + vperm vr10,vr6,vr5,vr16 552 + lvx vr4,r4,r11 553 + vperm vr11,vr5,vr4,vr16 554 + lvx vr3,r4,r12 555 + vperm vr12,vr4,vr3,vr16 556 + lvx vr2,r4,r14 557 + vperm vr13,vr3,vr2,vr16 558 + lvx vr1,r4,r15 559 + vperm vr14,vr2,vr1,vr16 560 + lvx vr0,r4,r16 561 + vperm vr15,vr1,vr0,vr16 562 + addi r4,r4,128 563 + stvx vr8,r0,r3 564 + stvx vr9,r3,r9 565 + stvx vr10,r3,r10 566 + stvx vr11,r3,r11 567 + stvx vr12,r3,r12 568 + stvx vr13,r3,r14 569 + stvx vr14,r3,r15 570 + stvx vr15,r3,r16 571 + addi r3,r3,128 572 + bdnz 8b 573 + 574 + ld r14,STK_REG(R14)(r1) 575 + ld r15,STK_REG(R15)(r1) 576 + ld r16,STK_REG(R16)(r1) 577 + 578 + /* Up to 127B to go */ 579 + clrldi r5,r5,(64-7) 580 + srdi r6,r5,4 581 + mtocrf 0x01,r6 582 + 583 + bf cr7*4+1,9f 584 + lvx vr3,r0,r4 585 + vperm vr8,vr0,vr3,vr16 586 + lvx vr2,r4,r9 587 + vperm vr9,vr3,vr2,vr16 588 + lvx vr1,r4,r10 589 + vperm vr10,vr2,vr1,vr16 590 + lvx vr0,r4,r11 591 + vperm vr11,vr1,vr0,vr16 592 + addi r4,r4,64 593 + stvx vr8,r0,r3 594 + stvx vr9,r3,r9 595 + stvx vr10,r3,r10 596 + stvx vr11,r3,r11 597 + addi r3,r3,64 598 + 599 + 9: bf cr7*4+2,10f 600 + lvx vr1,r0,r4 601 + vperm vr8,vr0,vr1,vr16 602 + lvx vr0,r4,r9 603 + vperm vr9,vr1,vr0,vr16 604 + addi r4,r4,32 605 + stvx vr8,r0,r3 606 + stvx vr9,r3,r9 607 + addi r3,r3,32 608 + 609 + 10: bf cr7*4+3,11f 610 + lvx vr1,r0,r4 611 + vperm vr8,vr0,vr1,vr16 612 + addi r4,r4,16 613 + stvx vr8,r0,r3 614 + addi r3,r3,16 615 + 616 + /* Up to 15B to go */ 617 + 11: clrldi r5,r5,(64-4) 618 + addi r4,r4,-16 /* Unwind the +16 load offset */ 619 + mtocrf 0x01,r5 620 + bf cr7*4+0,12f 621 + lwz r0,0(r4) /* Less chance of a reject with word ops */ 622 + lwz r6,4(r4) 623 + addi r4,r4,8 624 + stw r0,0(r3) 625 + stw r6,4(r3) 626 + addi r3,r3,8 627 + 628 + 12: bf cr7*4+1,13f 629 + lwz r0,0(r4) 630 + addi r4,r4,4 631 + stw r0,0(r3) 632 + addi r3,r3,4 633 + 634 + 13: bf cr7*4+2,14f 635 + lhz r0,0(r4) 636 + addi r4,r4,2 637 + sth r0,0(r3) 638 + addi r3,r3,2 639 + 640 + 14: bf cr7*4+3,15f 641 + lbz r0,0(r4) 642 + stb r0,0(r3) 643 + 644 + 15: addi r1,r1,STACKFRAMESIZE 645 + ld r3,48(r1) 646 + b .exit_vmx_copy /* tail call optimise */ 647 + #endif /* CONFiG_ALTIVEC */
+2
arch/powerpc/lib/string.S
··· 119 119 2: li r3,0 120 120 blr 121 121 122 + #ifdef CONFIG_PPC32 122 123 _GLOBAL(__clear_user) 123 124 addi r6,r3,-4 124 125 li r3,0 ··· 161 160 PPC_LONG 1b,91b 162 161 PPC_LONG 8b,92b 163 162 .text 163 + #endif
+202
arch/powerpc/lib/string_64.S
··· 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, 2012 17 + * 18 + * Author: Anton Blanchard <anton@au.ibm.com> 19 + */ 20 + 21 + #include <asm/ppc_asm.h> 22 + #include <asm/asm-offsets.h> 23 + 24 + .section ".toc","aw" 25 + PPC64_CACHES: 26 + .tc ppc64_caches[TC],ppc64_caches 27 + .section ".text" 28 + 29 + /** 30 + * __clear_user: - Zero a block of memory in user space, with less checking. 31 + * @to: Destination address, in user space. 32 + * @n: Number of bytes to zero. 33 + * 34 + * Zero a block of memory in user space. Caller must check 35 + * the specified block with access_ok() before calling this function. 36 + * 37 + * Returns number of bytes that could not be cleared. 38 + * On success, this will be zero. 39 + */ 40 + 41 + .macro err1 42 + 100: 43 + .section __ex_table,"a" 44 + .align 3 45 + .llong 100b,.Ldo_err1 46 + .previous 47 + .endm 48 + 49 + .macro err2 50 + 200: 51 + .section __ex_table,"a" 52 + .align 3 53 + .llong 200b,.Ldo_err2 54 + .previous 55 + .endm 56 + 57 + .macro err3 58 + 300: 59 + .section __ex_table,"a" 60 + .align 3 61 + .llong 300b,.Ldo_err3 62 + .previous 63 + .endm 64 + 65 + .Ldo_err1: 66 + mr r3,r8 67 + 68 + .Ldo_err2: 69 + mtctr r4 70 + 1: 71 + err3; stb r0,0(r3) 72 + addi r3,r3,1 73 + addi r4,r4,-1 74 + bdnz 1b 75 + 76 + .Ldo_err3: 77 + mr r3,r4 78 + blr 79 + 80 + _GLOBAL(__clear_user) 81 + cmpdi r4,32 82 + neg r6,r3 83 + li r0,0 84 + blt .Lshort_clear 85 + mr r8,r3 86 + mtocrf 0x01,r6 87 + clrldi r6,r6,(64-3) 88 + 89 + /* Get the destination 8 byte aligned */ 90 + bf cr7*4+3,1f 91 + err1; stb r0,0(r3) 92 + addi r3,r3,1 93 + 94 + 1: bf cr7*4+2,2f 95 + err1; sth r0,0(r3) 96 + addi r3,r3,2 97 + 98 + 2: bf cr7*4+1,3f 99 + err1; stw r0,0(r3) 100 + addi r3,r3,4 101 + 102 + 3: sub r4,r4,r6 103 + 104 + cmpdi r4,32 105 + cmpdi cr1,r4,512 106 + blt .Lshort_clear 107 + bgt cr1,.Llong_clear 108 + 109 + .Lmedium_clear: 110 + srdi r6,r4,5 111 + mtctr r6 112 + 113 + /* Do 32 byte chunks */ 114 + 4: 115 + err2; std r0,0(r3) 116 + err2; std r0,8(r3) 117 + err2; std r0,16(r3) 118 + err2; std r0,24(r3) 119 + addi r3,r3,32 120 + addi r4,r4,-32 121 + bdnz 4b 122 + 123 + .Lshort_clear: 124 + /* up to 31 bytes to go */ 125 + cmpdi r4,16 126 + blt 6f 127 + err2; std r0,0(r3) 128 + err2; std r0,8(r3) 129 + addi r3,r3,16 130 + addi r4,r4,-16 131 + 132 + /* Up to 15 bytes to go */ 133 + 6: mr r8,r3 134 + clrldi r4,r4,(64-4) 135 + mtocrf 0x01,r4 136 + bf cr7*4+0,7f 137 + err1; std r0,0(r3) 138 + addi r3,r3,8 139 + 140 + 7: bf cr7*4+1,8f 141 + err1; stw r0,0(r3) 142 + addi r3,r3,4 143 + 144 + 8: bf cr7*4+2,9f 145 + err1; sth r0,0(r3) 146 + addi r3,r3,2 147 + 148 + 9: bf cr7*4+3,10f 149 + err1; stb r0,0(r3) 150 + 151 + 10: li r3,0 152 + blr 153 + 154 + .Llong_clear: 155 + ld r5,PPC64_CACHES@toc(r2) 156 + 157 + bf cr7*4+0,11f 158 + err2; std r0,0(r3) 159 + addi r3,r3,8 160 + addi r4,r4,-8 161 + 162 + /* Destination is 16 byte aligned, need to get it cacheline aligned */ 163 + 11: lwz r7,DCACHEL1LOGLINESIZE(r5) 164 + lwz r9,DCACHEL1LINESIZE(r5) 165 + 166 + /* 167 + * With worst case alignment the long clear loop takes a minimum 168 + * of 1 byte less than 2 cachelines. 169 + */ 170 + sldi r10,r9,2 171 + cmpd r4,r10 172 + blt .Lmedium_clear 173 + 174 + neg r6,r3 175 + addi r10,r9,-1 176 + and. r5,r6,r10 177 + beq 13f 178 + 179 + srdi r6,r5,4 180 + mtctr r6 181 + mr r8,r3 182 + 12: 183 + err1; std r0,0(r3) 184 + err1; std r0,8(r3) 185 + addi r3,r3,16 186 + bdnz 12b 187 + 188 + sub r4,r4,r5 189 + 190 + 13: srd r6,r4,r7 191 + mtctr r6 192 + mr r8,r3 193 + 14: 194 + err1; dcbz r0,r3 195 + add r3,r3,r9 196 + bdnz 14b 197 + 198 + and r4,r4,r10 199 + 200 + cmpdi r4,32 201 + blt .Lshort_clear 202 + b .Lmedium_clear
+4 -4
arch/powerpc/mm/hash_low_32.S
··· 184 184 add r3,r3,r0 /* note create_hpte trims to 24 bits */ 185 185 186 186 #ifdef CONFIG_SMP 187 - rlwinm r8,r1,0,0,(31-THREAD_SHIFT) /* use cpu number to make tag */ 187 + CURRENT_THREAD_INFO(r8, r1) /* use cpu number to make tag */ 188 188 lwz r8,TI_CPU(r8) /* to go in mmu_hash_lock */ 189 189 oris r8,r8,12 190 190 #endif /* CONFIG_SMP */ ··· 545 545 #ifdef CONFIG_SMP 546 546 addis r9,r7,mmu_hash_lock@ha 547 547 addi r9,r9,mmu_hash_lock@l 548 - rlwinm r8,r1,0,0,(31-THREAD_SHIFT) 548 + CURRENT_THREAD_INFO(r8, r1) 549 549 add r8,r8,r7 550 550 lwz r8,TI_CPU(r8) 551 551 oris r8,r8,9 ··· 639 639 */ 640 640 _GLOBAL(_tlbie) 641 641 #ifdef CONFIG_SMP 642 - rlwinm r8,r1,0,0,(31-THREAD_SHIFT) 642 + CURRENT_THREAD_INFO(r8, r1) 643 643 lwz r8,TI_CPU(r8) 644 644 oris r8,r8,11 645 645 mfmsr r10 ··· 677 677 */ 678 678 _GLOBAL(_tlbia) 679 679 #if defined(CONFIG_SMP) 680 - rlwinm r8,r1,0,0,(31-THREAD_SHIFT) 680 + CURRENT_THREAD_INFO(r8, r1) 681 681 lwz r8,TI_CPU(r8) 682 682 oris r8,r8,10 683 683 mfmsr r10
+74 -82
arch/powerpc/mm/hash_low_64.S
··· 34 34 * | CR save area (SP + 8) 35 35 * SP ---> +-- Back chain (SP + 0) 36 36 */ 37 - #define STACKFRAMESIZE 256 38 - 39 - /* Save parameters offsets */ 40 - #define STK_PARM(i) (STACKFRAMESIZE + 48 + ((i)-3)*8) 41 - 42 - /* Save non-volatile offsets */ 43 - #define STK_REG(i) (112 + ((i)-14)*8) 44 - 45 37 46 38 #ifndef CONFIG_PPC_64K_PAGES 47 39 ··· 56 64 std r0,16(r1) 57 65 stdu r1,-STACKFRAMESIZE(r1) 58 66 /* Save all params that we need after a function call */ 59 - std r6,STK_PARM(r6)(r1) 60 - std r8,STK_PARM(r8)(r1) 61 - std r9,STK_PARM(r9)(r1) 67 + std r6,STK_PARAM(R6)(r1) 68 + std r8,STK_PARAM(R8)(r1) 69 + std r9,STK_PARAM(R9)(r1) 62 70 63 71 /* Save non-volatile registers. 64 72 * r31 will hold "old PTE" ··· 67 75 * r28 is a hash value 68 76 * r27 is hashtab mask (maybe dynamic patched instead ?) 69 77 */ 70 - std r27,STK_REG(r27)(r1) 71 - std r28,STK_REG(r28)(r1) 72 - std r29,STK_REG(r29)(r1) 73 - std r30,STK_REG(r30)(r1) 74 - std r31,STK_REG(r31)(r1) 78 + std r27,STK_REG(R27)(r1) 79 + std r28,STK_REG(R28)(r1) 80 + std r29,STK_REG(R29)(r1) 81 + std r30,STK_REG(R30)(r1) 82 + std r31,STK_REG(R31)(r1) 75 83 76 84 /* Step 1: 77 85 * ··· 154 162 /* At this point, r3 contains new PP bits, save them in 155 163 * place of "access" in the param area (sic) 156 164 */ 157 - std r3,STK_PARM(r4)(r1) 165 + std r3,STK_PARAM(R4)(r1) 158 166 159 167 /* Get htab_hash_mask */ 160 168 ld r4,htab_hash_mask@got(2) ··· 184 192 rldicr r3,r0,3,63-3 /* r3 = (hash & mask) << 3 */ 185 193 186 194 /* Call ppc_md.hpte_insert */ 187 - ld r6,STK_PARM(r4)(r1) /* Retrieve new pp bits */ 195 + ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */ 188 196 mr r4,r29 /* Retrieve va */ 189 197 li r7,0 /* !bolted, !secondary */ 190 198 li r8,MMU_PAGE_4K /* page size */ 191 - ld r9,STK_PARM(r9)(r1) /* segment size */ 199 + ld r9,STK_PARAM(R9)(r1) /* segment size */ 192 200 _GLOBAL(htab_call_hpte_insert1) 193 201 bl . /* Patched by htab_finish_init() */ 194 202 cmpdi 0,r3,0 ··· 207 215 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ 208 216 209 217 /* Call ppc_md.hpte_insert */ 210 - ld r6,STK_PARM(r4)(r1) /* Retrieve new pp bits */ 218 + ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */ 211 219 mr r4,r29 /* Retrieve va */ 212 220 li r7,HPTE_V_SECONDARY /* !bolted, secondary */ 213 221 li r8,MMU_PAGE_4K /* page size */ 214 - ld r9,STK_PARM(r9)(r1) /* segment size */ 222 + ld r9,STK_PARAM(R9)(r1) /* segment size */ 215 223 _GLOBAL(htab_call_hpte_insert2) 216 224 bl . /* Patched by htab_finish_init() */ 217 225 cmpdi 0,r3,0 ··· 247 255 * (maybe add eieio may be good still ?) 248 256 */ 249 257 htab_write_out_pte: 250 - ld r6,STK_PARM(r6)(r1) 258 + ld r6,STK_PARAM(R6)(r1) 251 259 std r30,0(r6) 252 260 li r3, 0 253 261 htab_bail: 254 - ld r27,STK_REG(r27)(r1) 255 - ld r28,STK_REG(r28)(r1) 256 - ld r29,STK_REG(r29)(r1) 257 - ld r30,STK_REG(r30)(r1) 258 - ld r31,STK_REG(r31)(r1) 262 + ld r27,STK_REG(R27)(r1) 263 + ld r28,STK_REG(R28)(r1) 264 + ld r29,STK_REG(R29)(r1) 265 + ld r30,STK_REG(R30)(r1) 266 + ld r31,STK_REG(R31)(r1) 259 267 addi r1,r1,STACKFRAMESIZE 260 268 ld r0,16(r1) 261 269 mtlr r0 ··· 280 288 /* Call ppc_md.hpte_updatepp */ 281 289 mr r5,r29 /* va */ 282 290 li r6,MMU_PAGE_4K /* page size */ 283 - ld r7,STK_PARM(r9)(r1) /* segment size */ 284 - ld r8,STK_PARM(r8)(r1) /* get "local" param */ 291 + ld r7,STK_PARAM(R9)(r1) /* segment size */ 292 + ld r8,STK_PARAM(R8)(r1) /* get "local" param */ 285 293 _GLOBAL(htab_call_hpte_updatepp) 286 294 bl . /* Patched by htab_finish_init() */ 287 295 ··· 304 312 305 313 htab_pte_insert_failure: 306 314 /* Bail out restoring old PTE */ 307 - ld r6,STK_PARM(r6)(r1) 315 + ld r6,STK_PARAM(R6)(r1) 308 316 std r31,0(r6) 309 317 li r3,-1 310 318 b htab_bail ··· 332 340 std r0,16(r1) 333 341 stdu r1,-STACKFRAMESIZE(r1) 334 342 /* Save all params that we need after a function call */ 335 - std r6,STK_PARM(r6)(r1) 336 - std r8,STK_PARM(r8)(r1) 337 - std r9,STK_PARM(r9)(r1) 343 + std r6,STK_PARAM(R6)(r1) 344 + std r8,STK_PARAM(R8)(r1) 345 + std r9,STK_PARAM(R9)(r1) 338 346 339 347 /* Save non-volatile registers. 340 348 * r31 will hold "old PTE" ··· 345 353 * r26 is the hidx mask 346 354 * r25 is the index in combo page 347 355 */ 348 - std r25,STK_REG(r25)(r1) 349 - std r26,STK_REG(r26)(r1) 350 - std r27,STK_REG(r27)(r1) 351 - std r28,STK_REG(r28)(r1) 352 - std r29,STK_REG(r29)(r1) 353 - std r30,STK_REG(r30)(r1) 354 - std r31,STK_REG(r31)(r1) 356 + std r25,STK_REG(R25)(r1) 357 + std r26,STK_REG(R26)(r1) 358 + std r27,STK_REG(R27)(r1) 359 + std r28,STK_REG(R28)(r1) 360 + std r29,STK_REG(R29)(r1) 361 + std r30,STK_REG(R30)(r1) 362 + std r31,STK_REG(R31)(r1) 355 363 356 364 /* Step 1: 357 365 * ··· 444 452 /* At this point, r3 contains new PP bits, save them in 445 453 * place of "access" in the param area (sic) 446 454 */ 447 - std r3,STK_PARM(r4)(r1) 455 + std r3,STK_PARAM(R4)(r1) 448 456 449 457 /* Get htab_hash_mask */ 450 458 ld r4,htab_hash_mask@got(2) ··· 465 473 andis. r0,r31,_PAGE_COMBO@h 466 474 beq htab_inval_old_hpte 467 475 468 - ld r6,STK_PARM(r6)(r1) 476 + ld r6,STK_PARAM(R6)(r1) 469 477 ori r26,r6,0x8000 /* Load the hidx mask */ 470 478 ld r26,0(r26) 471 479 addi r5,r25,36 /* Check actual HPTE_SUB bit, this */ ··· 487 495 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 488 496 489 497 /* Call ppc_md.hpte_insert */ 490 - ld r6,STK_PARM(r4)(r1) /* Retrieve new pp bits */ 498 + ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */ 491 499 mr r4,r29 /* Retrieve va */ 492 500 li r7,0 /* !bolted, !secondary */ 493 501 li r8,MMU_PAGE_4K /* page size */ 494 - ld r9,STK_PARM(r9)(r1) /* segment size */ 502 + ld r9,STK_PARAM(R9)(r1) /* segment size */ 495 503 _GLOBAL(htab_call_hpte_insert1) 496 504 bl . /* patched by htab_finish_init() */ 497 505 cmpdi 0,r3,0 ··· 514 522 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ 515 523 516 524 /* Call ppc_md.hpte_insert */ 517 - ld r6,STK_PARM(r4)(r1) /* Retrieve new pp bits */ 525 + ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */ 518 526 mr r4,r29 /* Retrieve va */ 519 527 li r7,HPTE_V_SECONDARY /* !bolted, secondary */ 520 528 li r8,MMU_PAGE_4K /* page size */ 521 - ld r9,STK_PARM(r9)(r1) /* segment size */ 529 + ld r9,STK_PARAM(R9)(r1) /* segment size */ 522 530 _GLOBAL(htab_call_hpte_insert2) 523 531 bl . /* patched by htab_finish_init() */ 524 532 cmpdi 0,r3,0 ··· 551 559 mr r4,r31 /* PTE.pte */ 552 560 li r5,0 /* PTE.hidx */ 553 561 li r6,MMU_PAGE_64K /* psize */ 554 - ld r7,STK_PARM(r9)(r1) /* ssize */ 555 - ld r8,STK_PARM(r8)(r1) /* local */ 562 + ld r7,STK_PARAM(R9)(r1) /* ssize */ 563 + ld r8,STK_PARAM(R8)(r1) /* local */ 556 564 bl .flush_hash_page 557 565 /* Clear out _PAGE_HPTE_SUB bits in the new linux PTE */ 558 566 lis r0,_PAGE_HPTE_SUB@h ··· 568 576 /* Insert slot number & secondary bit in PTE second half, 569 577 * clear _PAGE_BUSY and set approriate HPTE slot bit 570 578 */ 571 - ld r6,STK_PARM(r6)(r1) 579 + ld r6,STK_PARAM(R6)(r1) 572 580 li r0,_PAGE_BUSY 573 581 andc r30,r30,r0 574 582 /* HPTE SUB bit */ ··· 589 597 std r30,0(r6) 590 598 li r3, 0 591 599 htab_bail: 592 - ld r25,STK_REG(r25)(r1) 593 - ld r26,STK_REG(r26)(r1) 594 - ld r27,STK_REG(r27)(r1) 595 - ld r28,STK_REG(r28)(r1) 596 - ld r29,STK_REG(r29)(r1) 597 - ld r30,STK_REG(r30)(r1) 598 - ld r31,STK_REG(r31)(r1) 600 + ld r25,STK_REG(R25)(r1) 601 + ld r26,STK_REG(R26)(r1) 602 + ld r27,STK_REG(R27)(r1) 603 + ld r28,STK_REG(R28)(r1) 604 + ld r29,STK_REG(R29)(r1) 605 + ld r30,STK_REG(R30)(r1) 606 + ld r31,STK_REG(R31)(r1) 599 607 addi r1,r1,STACKFRAMESIZE 600 608 ld r0,16(r1) 601 609 mtlr r0 ··· 622 630 /* Call ppc_md.hpte_updatepp */ 623 631 mr r5,r29 /* va */ 624 632 li r6,MMU_PAGE_4K /* page size */ 625 - ld r7,STK_PARM(r9)(r1) /* segment size */ 626 - ld r8,STK_PARM(r8)(r1) /* get "local" param */ 633 + ld r7,STK_PARAM(R9)(r1) /* segment size */ 634 + ld r8,STK_PARAM(R8)(r1) /* get "local" param */ 627 635 _GLOBAL(htab_call_hpte_updatepp) 628 636 bl . /* patched by htab_finish_init() */ 629 637 ··· 636 644 /* Clear the BUSY bit and Write out the PTE */ 637 645 li r0,_PAGE_BUSY 638 646 andc r30,r30,r0 639 - ld r6,STK_PARM(r6)(r1) 647 + ld r6,STK_PARAM(R6)(r1) 640 648 std r30,0(r6) 641 649 li r3,0 642 650 b htab_bail ··· 649 657 650 658 htab_pte_insert_failure: 651 659 /* Bail out restoring old PTE */ 652 - ld r6,STK_PARM(r6)(r1) 660 + ld r6,STK_PARAM(R6)(r1) 653 661 std r31,0(r6) 654 662 li r3,-1 655 663 b htab_bail ··· 669 677 std r0,16(r1) 670 678 stdu r1,-STACKFRAMESIZE(r1) 671 679 /* Save all params that we need after a function call */ 672 - std r6,STK_PARM(r6)(r1) 673 - std r8,STK_PARM(r8)(r1) 674 - std r9,STK_PARM(r9)(r1) 680 + std r6,STK_PARAM(R6)(r1) 681 + std r8,STK_PARAM(R8)(r1) 682 + std r9,STK_PARAM(R9)(r1) 675 683 676 684 /* Save non-volatile registers. 677 685 * r31 will hold "old PTE" ··· 680 688 * r28 is a hash value 681 689 * r27 is hashtab mask (maybe dynamic patched instead ?) 682 690 */ 683 - std r27,STK_REG(r27)(r1) 684 - std r28,STK_REG(r28)(r1) 685 - std r29,STK_REG(r29)(r1) 686 - std r30,STK_REG(r30)(r1) 687 - std r31,STK_REG(r31)(r1) 691 + std r27,STK_REG(R27)(r1) 692 + std r28,STK_REG(R28)(r1) 693 + std r29,STK_REG(R29)(r1) 694 + std r30,STK_REG(R30)(r1) 695 + std r31,STK_REG(R31)(r1) 688 696 689 697 /* Step 1: 690 698 * ··· 772 780 /* At this point, r3 contains new PP bits, save them in 773 781 * place of "access" in the param area (sic) 774 782 */ 775 - std r3,STK_PARM(r4)(r1) 783 + std r3,STK_PARAM(R4)(r1) 776 784 777 785 /* Get htab_hash_mask */ 778 786 ld r4,htab_hash_mask@got(2) ··· 805 813 rldicr r3,r0,3,63-3 /* r0 = (hash & mask) << 3 */ 806 814 807 815 /* Call ppc_md.hpte_insert */ 808 - ld r6,STK_PARM(r4)(r1) /* Retrieve new pp bits */ 816 + ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */ 809 817 mr r4,r29 /* Retrieve va */ 810 818 li r7,0 /* !bolted, !secondary */ 811 819 li r8,MMU_PAGE_64K 812 - ld r9,STK_PARM(r9)(r1) /* segment size */ 820 + ld r9,STK_PARAM(R9)(r1) /* segment size */ 813 821 _GLOBAL(ht64_call_hpte_insert1) 814 822 bl . /* patched by htab_finish_init() */ 815 823 cmpdi 0,r3,0 ··· 828 836 rldicr r3,r0,3,63-3 /* r0 = (~hash & mask) << 3 */ 829 837 830 838 /* Call ppc_md.hpte_insert */ 831 - ld r6,STK_PARM(r4)(r1) /* Retrieve new pp bits */ 839 + ld r6,STK_PARAM(R4)(r1) /* Retrieve new pp bits */ 832 840 mr r4,r29 /* Retrieve va */ 833 841 li r7,HPTE_V_SECONDARY /* !bolted, secondary */ 834 842 li r8,MMU_PAGE_64K 835 - ld r9,STK_PARM(r9)(r1) /* segment size */ 843 + ld r9,STK_PARAM(R9)(r1) /* segment size */ 836 844 _GLOBAL(ht64_call_hpte_insert2) 837 845 bl . /* patched by htab_finish_init() */ 838 846 cmpdi 0,r3,0 ··· 868 876 * (maybe add eieio may be good still ?) 869 877 */ 870 878 ht64_write_out_pte: 871 - ld r6,STK_PARM(r6)(r1) 879 + ld r6,STK_PARAM(R6)(r1) 872 880 std r30,0(r6) 873 881 li r3, 0 874 882 ht64_bail: 875 - ld r27,STK_REG(r27)(r1) 876 - ld r28,STK_REG(r28)(r1) 877 - ld r29,STK_REG(r29)(r1) 878 - ld r30,STK_REG(r30)(r1) 879 - ld r31,STK_REG(r31)(r1) 883 + ld r27,STK_REG(R27)(r1) 884 + ld r28,STK_REG(R28)(r1) 885 + ld r29,STK_REG(R29)(r1) 886 + ld r30,STK_REG(R30)(r1) 887 + ld r31,STK_REG(R31)(r1) 880 888 addi r1,r1,STACKFRAMESIZE 881 889 ld r0,16(r1) 882 890 mtlr r0 ··· 901 909 /* Call ppc_md.hpte_updatepp */ 902 910 mr r5,r29 /* va */ 903 911 li r6,MMU_PAGE_64K 904 - ld r7,STK_PARM(r9)(r1) /* segment size */ 905 - ld r8,STK_PARM(r8)(r1) /* get "local" param */ 912 + ld r7,STK_PARAM(R9)(r1) /* segment size */ 913 + ld r8,STK_PARAM(R8)(r1) /* get "local" param */ 906 914 _GLOBAL(ht64_call_hpte_updatepp) 907 915 bl . /* patched by htab_finish_init() */ 908 916 ··· 925 933 926 934 ht64_pte_insert_failure: 927 935 /* Bail out restoring old PTE */ 928 - ld r6,STK_PARM(r6)(r1) 936 + ld r6,STK_PARAM(R6)(r1) 929 937 std r31,0(r6) 930 938 li r3,-1 931 939 b ht64_bail
+2
arch/powerpc/mm/numa.c
··· 340 340 dbg("Using form 1 affinity\n"); 341 341 form1_affinity = 1; 342 342 } 343 + 344 + of_node_put(chosen); 343 345 } 344 346 } 345 347
+5 -5
arch/powerpc/mm/tlb_low_64e.S
··· 126 126 /* Set the TLB reservation and search for existing entry. Then load 127 127 * the entry. 128 128 */ 129 - PPC_TLBSRX_DOT(0,r16) 129 + PPC_TLBSRX_DOT(0,R16) 130 130 ldx r14,r14,r15 /* grab pgd entry */ 131 131 beq normal_tlb_miss_done /* tlb exists already, bail */ 132 132 MMU_FTR_SECTION_ELSE ··· 395 395 /* Set the TLB reservation and search for existing entry. Then load 396 396 * the entry. 397 397 */ 398 - PPC_TLBSRX_DOT(0,r16) 398 + PPC_TLBSRX_DOT(0,R16) 399 399 ld r14,0(r10) 400 400 beq normal_tlb_miss_done 401 401 MMU_FTR_SECTION_ELSE ··· 528 528 /* Search if we already have a TLB entry for that virtual address, and 529 529 * if we do, bail out. 530 530 */ 531 - PPC_TLBSRX_DOT(0,r16) 531 + PPC_TLBSRX_DOT(0,R16) 532 532 beq virt_page_table_tlb_miss_done 533 533 END_MMU_FTR_SECTION_IFSET(MMU_FTR_USE_TLBRSRV) 534 534 ··· 779 779 * 780 780 * MAS1:IND should be already set based on MAS4 781 781 */ 782 - PPC_TLBSRX_DOT(0,r16) 782 + PPC_TLBSRX_DOT(0,R16) 783 783 beq htw_tlb_miss_done 784 784 785 785 /* Now, we need to walk the page tables. First check if we are in ··· 919 919 mtspr SPRN_MAS1,r15 920 920 921 921 /* Already somebody there ? */ 922 - PPC_TLBSRX_DOT(0,r16) 922 + PPC_TLBSRX_DOT(0,R16) 923 923 beq tlb_load_linear_done 924 924 925 925 /* Now we build the remaining MAS. MAS0 and 2 should be fine
+8 -8
arch/powerpc/mm/tlb_nohash_low.S
··· 266 266 andi. r3,r3,MMUCSR0_TLBFI@l 267 267 bne 1b 268 268 MMU_FTR_SECTION_ELSE 269 - PPC_TLBILX_ALL(0,0) 269 + PPC_TLBILX_ALL(0,R0) 270 270 ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX) 271 271 msync 272 272 isync ··· 279 279 wrteei 0 280 280 mfspr r4,SPRN_MAS6 /* save MAS6 */ 281 281 mtspr SPRN_MAS6,r3 282 - PPC_TLBILX_PID(0,0) 282 + PPC_TLBILX_PID(0,R0) 283 283 mtspr SPRN_MAS6,r4 /* restore MAS6 */ 284 284 wrtee r10 285 285 MMU_FTR_SECTION_ELSE ··· 313 313 mtspr SPRN_MAS1,r4 314 314 tlbwe 315 315 MMU_FTR_SECTION_ELSE 316 - PPC_TLBILX_VA(0,r3) 316 + PPC_TLBILX_VA(0,R3) 317 317 ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_USE_TLBILX) 318 318 msync 319 319 isync ··· 331 331 mfmsr r10 332 332 wrteei 0 333 333 mtspr SPRN_MAS6,r4 334 - PPC_TLBILX_PID(0,0) 334 + PPC_TLBILX_PID(0,R0) 335 335 wrtee r10 336 336 msync 337 337 isync ··· 343 343 ori r4,r4,MAS6_SIND 344 344 wrteei 0 345 345 mtspr SPRN_MAS6,r4 346 - PPC_TLBILX_PID(0,0) 346 + PPC_TLBILX_PID(0,R0) 347 347 wrtee r10 348 348 msync 349 349 isync 350 350 blr 351 351 352 352 _GLOBAL(_tlbil_all) 353 - PPC_TLBILX_ALL(0,0) 353 + PPC_TLBILX_ALL(0,R0) 354 354 msync 355 355 isync 356 356 blr ··· 364 364 beq 1f 365 365 rlwimi r4,r6,MAS6_SIND_SHIFT,MAS6_SIND 366 366 1: mtspr SPRN_MAS6,r4 /* assume AS=0 for now */ 367 - PPC_TLBILX_VA(0,r3) 367 + PPC_TLBILX_VA(0,R3) 368 368 msync 369 369 isync 370 370 wrtee r10 ··· 379 379 beq 1f 380 380 rlwimi r4,r6,MAS6_SIND_SHIFT,MAS6_SIND 381 381 1: mtspr SPRN_MAS6,r4 /* assume AS=0 for now */ 382 - PPC_TLBIVAX(0,r3) 382 + PPC_TLBIVAX(0,R3) 383 383 eieio 384 384 tlbsync 385 385 sync
+51 -51
arch/powerpc/net/bpf_jit.h
··· 75 75 #define PPC_NOP() EMIT(PPC_INST_NOP) 76 76 #define PPC_BLR() EMIT(PPC_INST_BLR) 77 77 #define PPC_BLRL() EMIT(PPC_INST_BLRL) 78 - #define PPC_MTLR(r) EMIT(PPC_INST_MTLR | __PPC_RT(r)) 79 - #define PPC_ADDI(d, a, i) EMIT(PPC_INST_ADDI | __PPC_RT(d) | \ 80 - __PPC_RA(a) | IMM_L(i)) 78 + #define PPC_MTLR(r) EMIT(PPC_INST_MTLR | ___PPC_RT(r)) 79 + #define PPC_ADDI(d, a, i) EMIT(PPC_INST_ADDI | ___PPC_RT(d) | \ 80 + ___PPC_RA(a) | IMM_L(i)) 81 81 #define PPC_MR(d, a) PPC_OR(d, a, a) 82 82 #define PPC_LI(r, i) PPC_ADDI(r, 0, i) 83 83 #define PPC_ADDIS(d, a, i) EMIT(PPC_INST_ADDIS | \ 84 - __PPC_RS(d) | __PPC_RA(a) | IMM_L(i)) 84 + ___PPC_RS(d) | ___PPC_RA(a) | IMM_L(i)) 85 85 #define PPC_LIS(r, i) PPC_ADDIS(r, 0, i) 86 - #define PPC_STD(r, base, i) EMIT(PPC_INST_STD | __PPC_RS(r) | \ 87 - __PPC_RA(base) | ((i) & 0xfffc)) 86 + #define PPC_STD(r, base, i) EMIT(PPC_INST_STD | ___PPC_RS(r) | \ 87 + ___PPC_RA(base) | ((i) & 0xfffc)) 88 88 89 - #define PPC_LD(r, base, i) EMIT(PPC_INST_LD | __PPC_RT(r) | \ 90 - __PPC_RA(base) | IMM_L(i)) 91 - #define PPC_LWZ(r, base, i) EMIT(PPC_INST_LWZ | __PPC_RT(r) | \ 92 - __PPC_RA(base) | IMM_L(i)) 93 - #define PPC_LHZ(r, base, i) EMIT(PPC_INST_LHZ | __PPC_RT(r) | \ 94 - __PPC_RA(base) | IMM_L(i)) 89 + #define PPC_LD(r, base, i) EMIT(PPC_INST_LD | ___PPC_RT(r) | \ 90 + ___PPC_RA(base) | IMM_L(i)) 91 + #define PPC_LWZ(r, base, i) EMIT(PPC_INST_LWZ | ___PPC_RT(r) | \ 92 + ___PPC_RA(base) | IMM_L(i)) 93 + #define PPC_LHZ(r, base, i) EMIT(PPC_INST_LHZ | ___PPC_RT(r) | \ 94 + ___PPC_RA(base) | IMM_L(i)) 95 95 /* Convenience helpers for the above with 'far' offsets: */ 96 96 #define PPC_LD_OFFS(r, base, i) do { if ((i) < 32768) PPC_LD(r, base, i); \ 97 97 else { PPC_ADDIS(r, base, IMM_HA(i)); \ ··· 105 105 else { PPC_ADDIS(r, base, IMM_HA(i)); \ 106 106 PPC_LHZ(r, r, IMM_L(i)); } } while(0) 107 107 108 - #define PPC_CMPWI(a, i) EMIT(PPC_INST_CMPWI | __PPC_RA(a) | IMM_L(i)) 109 - #define PPC_CMPDI(a, i) EMIT(PPC_INST_CMPDI | __PPC_RA(a) | IMM_L(i)) 110 - #define PPC_CMPLWI(a, i) EMIT(PPC_INST_CMPLWI | __PPC_RA(a) | IMM_L(i)) 111 - #define PPC_CMPLW(a, b) EMIT(PPC_INST_CMPLW | __PPC_RA(a) | __PPC_RB(b)) 108 + #define PPC_CMPWI(a, i) EMIT(PPC_INST_CMPWI | ___PPC_RA(a) | IMM_L(i)) 109 + #define PPC_CMPDI(a, i) EMIT(PPC_INST_CMPDI | ___PPC_RA(a) | IMM_L(i)) 110 + #define PPC_CMPLWI(a, i) EMIT(PPC_INST_CMPLWI | ___PPC_RA(a) | IMM_L(i)) 111 + #define PPC_CMPLW(a, b) EMIT(PPC_INST_CMPLW | ___PPC_RA(a) | ___PPC_RB(b)) 112 112 113 - #define PPC_SUB(d, a, b) EMIT(PPC_INST_SUB | __PPC_RT(d) | \ 114 - __PPC_RB(a) | __PPC_RA(b)) 115 - #define PPC_ADD(d, a, b) EMIT(PPC_INST_ADD | __PPC_RT(d) | \ 116 - __PPC_RA(a) | __PPC_RB(b)) 117 - #define PPC_MUL(d, a, b) EMIT(PPC_INST_MULLW | __PPC_RT(d) | \ 118 - __PPC_RA(a) | __PPC_RB(b)) 119 - #define PPC_MULHWU(d, a, b) EMIT(PPC_INST_MULHWU | __PPC_RT(d) | \ 120 - __PPC_RA(a) | __PPC_RB(b)) 121 - #define PPC_MULI(d, a, i) EMIT(PPC_INST_MULLI | __PPC_RT(d) | \ 122 - __PPC_RA(a) | IMM_L(i)) 123 - #define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | __PPC_RT(d) | \ 124 - __PPC_RA(a) | __PPC_RB(b)) 125 - #define PPC_AND(d, a, b) EMIT(PPC_INST_AND | __PPC_RA(d) | \ 126 - __PPC_RS(a) | __PPC_RB(b)) 127 - #define PPC_ANDI(d, a, i) EMIT(PPC_INST_ANDI | __PPC_RA(d) | \ 128 - __PPC_RS(a) | IMM_L(i)) 129 - #define PPC_AND_DOT(d, a, b) EMIT(PPC_INST_ANDDOT | __PPC_RA(d) | \ 130 - __PPC_RS(a) | __PPC_RB(b)) 131 - #define PPC_OR(d, a, b) EMIT(PPC_INST_OR | __PPC_RA(d) | \ 132 - __PPC_RS(a) | __PPC_RB(b)) 133 - #define PPC_ORI(d, a, i) EMIT(PPC_INST_ORI | __PPC_RA(d) | \ 134 - __PPC_RS(a) | IMM_L(i)) 135 - #define PPC_ORIS(d, a, i) EMIT(PPC_INST_ORIS | __PPC_RA(d) | \ 136 - __PPC_RS(a) | IMM_L(i)) 137 - #define PPC_SLW(d, a, s) EMIT(PPC_INST_SLW | __PPC_RA(d) | \ 138 - __PPC_RS(a) | __PPC_RB(s)) 139 - #define PPC_SRW(d, a, s) EMIT(PPC_INST_SRW | __PPC_RA(d) | \ 140 - __PPC_RS(a) | __PPC_RB(s)) 113 + #define PPC_SUB(d, a, b) EMIT(PPC_INST_SUB | ___PPC_RT(d) | \ 114 + ___PPC_RB(a) | ___PPC_RA(b)) 115 + #define PPC_ADD(d, a, b) EMIT(PPC_INST_ADD | ___PPC_RT(d) | \ 116 + ___PPC_RA(a) | ___PPC_RB(b)) 117 + #define PPC_MUL(d, a, b) EMIT(PPC_INST_MULLW | ___PPC_RT(d) | \ 118 + ___PPC_RA(a) | ___PPC_RB(b)) 119 + #define PPC_MULHWU(d, a, b) EMIT(PPC_INST_MULHWU | ___PPC_RT(d) | \ 120 + ___PPC_RA(a) | ___PPC_RB(b)) 121 + #define PPC_MULI(d, a, i) EMIT(PPC_INST_MULLI | ___PPC_RT(d) | \ 122 + ___PPC_RA(a) | IMM_L(i)) 123 + #define PPC_DIVWU(d, a, b) EMIT(PPC_INST_DIVWU | ___PPC_RT(d) | \ 124 + ___PPC_RA(a) | ___PPC_RB(b)) 125 + #define PPC_AND(d, a, b) EMIT(PPC_INST_AND | ___PPC_RA(d) | \ 126 + ___PPC_RS(a) | ___PPC_RB(b)) 127 + #define PPC_ANDI(d, a, i) EMIT(PPC_INST_ANDI | ___PPC_RA(d) | \ 128 + ___PPC_RS(a) | IMM_L(i)) 129 + #define PPC_AND_DOT(d, a, b) EMIT(PPC_INST_ANDDOT | ___PPC_RA(d) | \ 130 + ___PPC_RS(a) | ___PPC_RB(b)) 131 + #define PPC_OR(d, a, b) EMIT(PPC_INST_OR | ___PPC_RA(d) | \ 132 + ___PPC_RS(a) | ___PPC_RB(b)) 133 + #define PPC_ORI(d, a, i) EMIT(PPC_INST_ORI | ___PPC_RA(d) | \ 134 + ___PPC_RS(a) | IMM_L(i)) 135 + #define PPC_ORIS(d, a, i) EMIT(PPC_INST_ORIS | ___PPC_RA(d) | \ 136 + ___PPC_RS(a) | IMM_L(i)) 137 + #define PPC_SLW(d, a, s) EMIT(PPC_INST_SLW | ___PPC_RA(d) | \ 138 + ___PPC_RS(a) | ___PPC_RB(s)) 139 + #define PPC_SRW(d, a, s) EMIT(PPC_INST_SRW | ___PPC_RA(d) | \ 140 + ___PPC_RS(a) | ___PPC_RB(s)) 141 141 /* slwi = rlwinm Rx, Ry, n, 0, 31-n */ 142 - #define PPC_SLWI(d, a, i) EMIT(PPC_INST_RLWINM | __PPC_RA(d) | \ 143 - __PPC_RS(a) | __PPC_SH(i) | \ 142 + #define PPC_SLWI(d, a, i) EMIT(PPC_INST_RLWINM | ___PPC_RA(d) | \ 143 + ___PPC_RS(a) | __PPC_SH(i) | \ 144 144 __PPC_MB(0) | __PPC_ME(31-(i))) 145 145 /* srwi = rlwinm Rx, Ry, 32-n, n, 31 */ 146 - #define PPC_SRWI(d, a, i) EMIT(PPC_INST_RLWINM | __PPC_RA(d) | \ 147 - __PPC_RS(a) | __PPC_SH(32-(i)) | \ 146 + #define PPC_SRWI(d, a, i) EMIT(PPC_INST_RLWINM | ___PPC_RA(d) | \ 147 + ___PPC_RS(a) | __PPC_SH(32-(i)) | \ 148 148 __PPC_MB(i) | __PPC_ME(31)) 149 149 /* sldi = rldicr Rx, Ry, n, 63-n */ 150 - #define PPC_SLDI(d, a, i) EMIT(PPC_INST_RLDICR | __PPC_RA(d) | \ 151 - __PPC_RS(a) | __PPC_SH(i) | \ 150 + #define PPC_SLDI(d, a, i) EMIT(PPC_INST_RLDICR | ___PPC_RA(d) | \ 151 + ___PPC_RS(a) | __PPC_SH(i) | \ 152 152 __PPC_MB(63-(i)) | (((i) & 0x20) >> 4)) 153 - #define PPC_NEG(d, a) EMIT(PPC_INST_NEG | __PPC_RT(d) | __PPC_RA(a)) 153 + #define PPC_NEG(d, a) EMIT(PPC_INST_NEG | ___PPC_RT(d) | ___PPC_RA(a)) 154 154 155 155 /* Long jump; (unconditional 'branch') */ 156 156 #define PPC_JMP(dest) EMIT(PPC_INST_BRANCH | \
+2 -2
arch/powerpc/net/bpf_jit_comp.c
··· 39 39 /* Make stackframe */ 40 40 if (ctx->seen & SEEN_DATAREF) { 41 41 /* If we call any helpers (for loads), save LR */ 42 - EMIT(PPC_INST_MFLR | __PPC_RT(0)); 42 + EMIT(PPC_INST_MFLR | __PPC_RT(R0)); 43 43 PPC_STD(0, 1, 16); 44 44 45 45 /* Back up non-volatile regs. */ ··· 56 56 PPC_STD(i, 1, -(8*(32-i))); 57 57 } 58 58 } 59 - EMIT(PPC_INST_STDU | __PPC_RS(1) | __PPC_RA(1) | 59 + EMIT(PPC_INST_STDU | __PPC_RS(R1) | __PPC_RA(R1) | 60 60 (-BPF_PPC_STACKFRAME & 0xfffc)); 61 61 } 62 62
+3 -3
arch/powerpc/perf/callchain.c
··· 57 57 58 58 lr = regs->link; 59 59 sp = regs->gpr[1]; 60 - perf_callchain_store(entry, regs->nip); 60 + perf_callchain_store(entry, perf_instruction_pointer(regs)); 61 61 62 62 if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD)) 63 63 return; ··· 238 238 struct signal_frame_64 __user *sigframe; 239 239 unsigned long __user *fp, *uregs; 240 240 241 - next_ip = regs->nip; 241 + next_ip = perf_instruction_pointer(regs); 242 242 lr = regs->link; 243 243 sp = regs->gpr[1]; 244 244 perf_callchain_store(entry, next_ip); ··· 444 444 long level = 0; 445 445 unsigned int __user *fp, *uregs; 446 446 447 - next_ip = regs->nip; 447 + next_ip = perf_instruction_pointer(regs); 448 448 lr = regs->link; 449 449 sp = regs->gpr[1]; 450 450 perf_callchain_store(entry, next_ip);
+68 -31
arch/powerpc/perf/core-book3s.c
··· 73 73 { 74 74 return 0; 75 75 } 76 - static inline void perf_read_regs(struct pt_regs *regs) { } 76 + static inline void perf_read_regs(struct pt_regs *regs) 77 + { 78 + regs->result = 0; 79 + } 77 80 static inline int perf_intr_is_nmi(struct pt_regs *regs) 78 81 { 79 82 return 0; ··· 119 116 *addrp = mfspr(SPRN_SDAR); 120 117 } 121 118 119 + static bool mmcra_sihv(unsigned long mmcra) 120 + { 121 + unsigned long sihv = MMCRA_SIHV; 122 + 123 + if (ppmu->flags & PPMU_ALT_SIPR) 124 + sihv = POWER6_MMCRA_SIHV; 125 + 126 + return !!(mmcra & sihv); 127 + } 128 + 129 + static bool mmcra_sipr(unsigned long mmcra) 130 + { 131 + unsigned long sipr = MMCRA_SIPR; 132 + 133 + if (ppmu->flags & PPMU_ALT_SIPR) 134 + sipr = POWER6_MMCRA_SIPR; 135 + 136 + return !!(mmcra & sipr); 137 + } 138 + 122 139 static inline u32 perf_flags_from_msr(struct pt_regs *regs) 123 140 { 124 141 if (regs->msr & MSR_PR) ··· 151 128 static inline u32 perf_get_misc_flags(struct pt_regs *regs) 152 129 { 153 130 unsigned long mmcra = regs->dsisr; 154 - unsigned long sihv = MMCRA_SIHV; 155 - unsigned long sipr = MMCRA_SIPR; 131 + unsigned long use_siar = regs->result; 156 132 157 - /* Not a PMU interrupt: Make up flags from regs->msr */ 158 - if (TRAP(regs) != 0xf00) 159 - return perf_flags_from_msr(regs); 160 - 161 - /* 162 - * If we don't support continuous sampling and this 163 - * is not a marked event, same deal 164 - */ 165 - if ((ppmu->flags & PPMU_NO_CONT_SAMPLING) && 166 - !(mmcra & MMCRA_SAMPLE_ENABLE)) 133 + if (!use_siar) 167 134 return perf_flags_from_msr(regs); 168 135 169 136 /* ··· 169 156 return PERF_RECORD_MISC_USER; 170 157 } 171 158 172 - if (ppmu->flags & PPMU_ALT_SIPR) { 173 - sihv = POWER6_MMCRA_SIHV; 174 - sipr = POWER6_MMCRA_SIPR; 175 - } 176 - 177 159 /* PR has priority over HV, so order below is important */ 178 - if (mmcra & sipr) 160 + if (mmcra_sipr(mmcra)) 179 161 return PERF_RECORD_MISC_USER; 180 - if ((mmcra & sihv) && (freeze_events_kernel != MMCR0_FCHV)) 162 + if (mmcra_sihv(mmcra) && (freeze_events_kernel != MMCR0_FCHV)) 181 163 return PERF_RECORD_MISC_HYPERVISOR; 182 164 return PERF_RECORD_MISC_KERNEL; 183 165 } ··· 180 172 /* 181 173 * Overload regs->dsisr to store MMCRA so we only need to read it once 182 174 * on each interrupt. 175 + * Overload regs->result to specify whether we should use the MSR (result 176 + * is zero) or the SIAR (result is non zero). 183 177 */ 184 178 static inline void perf_read_regs(struct pt_regs *regs) 185 179 { 186 - regs->dsisr = mfspr(SPRN_MMCRA); 180 + unsigned long mmcra = mfspr(SPRN_MMCRA); 181 + int marked = mmcra & MMCRA_SAMPLE_ENABLE; 182 + int use_siar; 183 + 184 + /* 185 + * If this isn't a PMU exception (eg a software event) the SIAR is 186 + * not valid. Use pt_regs. 187 + * 188 + * If it is a marked event use the SIAR. 189 + * 190 + * If the PMU doesn't update the SIAR for non marked events use 191 + * pt_regs. 192 + * 193 + * If the PMU has HV/PR flags then check to see if they 194 + * place the exception in userspace. If so, use pt_regs. In 195 + * continuous sampling mode the SIAR and the PMU exception are 196 + * not synchronised, so they may be many instructions apart. 197 + * This can result in confusing backtraces. We still want 198 + * hypervisor samples as well as samples in the kernel with 199 + * interrupts off hence the userspace check. 200 + */ 201 + if (TRAP(regs) != 0xf00) 202 + use_siar = 0; 203 + else if (marked) 204 + use_siar = 1; 205 + else if ((ppmu->flags & PPMU_NO_CONT_SAMPLING)) 206 + use_siar = 0; 207 + else if (!(ppmu->flags & PPMU_NO_SIPR) && mmcra_sipr(mmcra)) 208 + use_siar = 0; 209 + else 210 + use_siar = 1; 211 + 212 + regs->dsisr = mmcra; 213 + regs->result = use_siar; 187 214 } 188 215 189 216 /* ··· 1372 1329 */ 1373 1330 unsigned long perf_instruction_pointer(struct pt_regs *regs) 1374 1331 { 1375 - unsigned long mmcra = regs->dsisr; 1332 + unsigned long use_siar = regs->result; 1376 1333 1377 - /* Not a PMU interrupt */ 1378 - if (TRAP(regs) != 0xf00) 1334 + if (use_siar) 1335 + return mfspr(SPRN_SIAR) + perf_ip_adjust(regs); 1336 + else 1379 1337 return regs->nip; 1380 - 1381 - /* Processor doesn't support sampling non marked events */ 1382 - if ((ppmu->flags & PPMU_NO_CONT_SAMPLING) && 1383 - !(mmcra & MMCRA_SAMPLE_ENABLE)) 1384 - return regs->nip; 1385 - 1386 - return mfspr(SPRN_SIAR) + perf_ip_adjust(regs); 1387 1338 } 1388 1339 1389 1340 static bool pmc_overflow(unsigned long val)
+1 -1
arch/powerpc/platforms/44x/currituck.c
··· 160 160 /* No need to check the DMA config as we /know/ our windows are all of 161 161 * RAM. Lets hope that doesn't change */ 162 162 #ifdef CONFIG_SWIOTLB 163 - if (memblock_end_of_DRAM() > 0xffffffff) { 163 + if ((memblock_end_of_DRAM() - 1) > 0xffffffff) { 164 164 ppc_swiotlb_enable = 1; 165 165 set_pci_dma_ops(&swiotlb_dma_ops); 166 166 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+5
arch/powerpc/platforms/82xx/km82xx.c
··· 128 128 {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, /* TXP */ 129 129 {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, /* TXN */ 130 130 {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* RXD */ 131 + 132 + /* SPI */ 133 + {3, 16, CPM_PIN_INPUT | CPM_PIN_SECONDARY},/* SPI_MISO PD16 */ 134 + {3, 17, CPM_PIN_INPUT | CPM_PIN_SECONDARY},/* SPI_MOSI PD17 */ 135 + {3, 18, CPM_PIN_INPUT | CPM_PIN_SECONDARY},/* SPI_CLK PD18 */ 131 136 }; 132 137 133 138 static void __init init_ioports(void)
+74 -40
arch/powerpc/platforms/83xx/km83xx.c
··· 3 3 * Author: Heiko Schocher <hs@denx.de> 4 4 * 5 5 * Description: 6 - * Keymile KMETER1 board specific routines. 6 + * Keymile 83xx platform specific routines. 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify it 9 9 * under the terms of the GNU General Public License as published by the ··· 70 70 for_each_node_by_name(np, "spi") 71 71 par_io_of_config(np); 72 72 73 - for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;) 73 + for_each_node_by_name(np, "ucc") 74 74 par_io_of_config(np); 75 75 } 76 76 77 77 np = of_find_compatible_node(NULL, "network", "ucc_geth"); 78 78 if (np != NULL) { 79 - uint svid; 79 + /* 80 + * handle mpc8360E Erratum QE_ENET10: 81 + * RGMII AC values do not meet the specification 82 + */ 83 + uint svid = mfspr(SPRN_SVR); 84 + struct device_node *np_par; 85 + struct resource res; 86 + void __iomem *base; 87 + int ret; 80 88 81 - /* handle mpc8360ea rev.2.1 erratum 2: RGMII Timing */ 82 - svid = mfspr(SPRN_SVR); 83 - if (SVR_REV(svid) == 0x0021) { 84 - struct device_node *np_par; 85 - struct resource res; 86 - void __iomem *base; 87 - int ret; 88 - 89 - np_par = of_find_node_by_name(NULL, "par_io"); 90 - if (np_par == NULL) { 91 - printk(KERN_WARNING "%s couldn;t find par_io node\n", 92 - __func__); 93 - return; 94 - } 95 - /* Map Parallel I/O ports registers */ 96 - ret = of_address_to_resource(np_par, 0, &res); 97 - if (ret) { 98 - printk(KERN_WARNING "%s couldn;t map par_io registers\n", 99 - __func__); 100 - return; 101 - } 102 - base = ioremap(res.start, resource_size(&res)); 103 - 104 - /* 105 - * IMMR + 0x14A8[4:5] = 11 (clk delay for UCC 2) 106 - * IMMR + 0x14A8[18:19] = 11 (clk delay for UCC 1) 107 - */ 108 - setbits32((base + 0xa8), 0x0c003000); 109 - 110 - /* 111 - * IMMR + 0x14AC[20:27] = 10101010 112 - * (data delay for both UCC's) 113 - */ 114 - clrsetbits_be32((base + 0xac), 0xff0, 0xaa0); 115 - iounmap(base); 116 - of_node_put(np_par); 89 + np_par = of_find_node_by_name(NULL, "par_io"); 90 + if (np_par == NULL) { 91 + printk(KERN_WARNING "%s couldn;t find par_io node\n", 92 + __func__); 93 + return; 117 94 } 95 + /* Map Parallel I/O ports registers */ 96 + ret = of_address_to_resource(np_par, 0, &res); 97 + if (ret) { 98 + printk(KERN_WARNING "%s couldn;t map par_io registers\n", 99 + __func__); 100 + return; 101 + } 102 + 103 + base = ioremap(res.start, res.end - res.start + 1); 104 + 105 + /* 106 + * set output delay adjustments to default values according 107 + * table 5 in Errata Rev. 5, 9/2011: 108 + * 109 + * write 0b01 to UCC1 bits 18:19 110 + * write 0b01 to UCC2 option 1 bits 4:5 111 + * write 0b01 to UCC2 option 2 bits 16:17 112 + */ 113 + clrsetbits_be32((base + 0xa8), 0x0c00f000, 0x04005000); 114 + 115 + /* 116 + * set output delay adjustments to default values according 117 + * table 3-13 in Reference Manual Rev.3 05/2010: 118 + * 119 + * write 0b01 to UCC2 option 2 bits 16:17 120 + * write 0b0101 to UCC1 bits 20:23 121 + * write 0b0101 to UCC2 option 1 bits 24:27 122 + */ 123 + clrsetbits_be32((base + 0xac), 0x0000cff0, 0x00004550); 124 + 125 + if (SVR_REV(svid) == 0x0021) { 126 + /* 127 + * UCC2 option 1: write 0b1010 to bits 24:27 128 + * at address IMMRBAR+0x14AC 129 + */ 130 + clrsetbits_be32((base + 0xac), 0x000000f0, 0x000000a0); 131 + } else if (SVR_REV(svid) == 0x0020) { 132 + /* 133 + * UCC1: write 0b11 to bits 18:19 134 + * at address IMMRBAR+0x14A8 135 + */ 136 + setbits32((base + 0xa8), 0x00003000); 137 + 138 + /* 139 + * UCC2 option 1: write 0b11 to bits 4:5 140 + * at address IMMRBAR+0x14A8 141 + */ 142 + setbits32((base + 0xa8), 0x0c000000); 143 + 144 + /* 145 + * UCC2 option 2: write 0b11 to bits 16:17 146 + * at address IMMRBAR+0x14AC 147 + */ 148 + setbits32((base + 0xac), 0x0000c000); 149 + } 150 + iounmap(base); 151 + of_node_put(np_par); 118 152 of_node_put(np); 119 153 } 120 - #endif /* CONFIG_QUICC_ENGINE */ 154 + #endif /* CONFIG_QUICC_ENGINE */ 121 155 } 122 156 123 157 machine_device_initcall(mpc83xx_km, mpc83xx_declare_of_platform_devices);
+25 -18
arch/powerpc/platforms/85xx/Kconfig
··· 23 23 cache-sram-size and cache-sram-offset kernel boot 24 24 parameters should be passed when this option is enabled. 25 25 26 + config BSC9131_RDB 27 + bool "Freescale BSC9131RDB" 28 + select DEFAULT_UIMAGE 29 + help 30 + This option enables support for the Freescale BSC9131RDB board. 31 + The BSC9131 is a heterogeneous SoC containing an e500v2 powerpc and a 32 + StarCore SC3850 DSP 33 + Manufacturer : Freescale Semiconductor, Inc 34 + 26 35 config MPC8540_ADS 27 36 bool "Freescale MPC8540 ADS" 28 37 select DEFAULT_UIMAGE ··· 184 175 help 185 176 This option enables support for the Wind River SBC8548 board 186 177 187 - config SBC8560 188 - bool "Wind River SBC8560" 189 - select DEFAULT_UIMAGE 190 - help 191 - This option enables support for the Wind River SBC8560 board 192 - 193 178 config GE_IMP3A 194 179 bool "GE Intelligent Platforms IMP3A" 195 180 select DEFAULT_UIMAGE ··· 225 222 help 226 223 This option enables support for the P3041 DS board 227 224 228 - config P3060_QDS 229 - bool "Freescale P3060 QDS" 230 - select DEFAULT_UIMAGE 231 - select PPC_E500MC 232 - select PHYS_64BIT 233 - select SWIOTLB 234 - select GPIO_MPC8XXX 235 - select HAS_RAPIDIO 236 - select PPC_EPAPR_HV_PIC 237 - help 238 - This option enables support for the P3060 QDS board 239 - 240 225 config P4080_DS 241 226 bool "Freescale P4080 DS" 242 227 select DEFAULT_UIMAGE ··· 253 262 select PPC_EPAPR_HV_PIC 254 263 help 255 264 This option enables support for the P5020 DS board 265 + 266 + config PPC_QEMU_E500 267 + bool "QEMU generic e500 platform" 268 + depends on EXPERIMENTAL 269 + select DEFAULT_UIMAGE 270 + help 271 + This option enables support for running as a QEMU guest using 272 + QEMU's generic e500 machine. This is not required if you're 273 + using a QEMU machine that targets a specific board, such as 274 + mpc8544ds. 275 + 276 + Unlike most e500 boards that target a specific CPU, this 277 + platform works with any e500-family CPU that QEMU supports. 278 + Thus, you'll need to make sure CONFIG_PPC_E500MC is set or 279 + unset based on the emulated CPU (or actual host CPU in the case 280 + of KVM). 256 281 257 282 endif # FSL_SOC_BOOKE 258 283
+2 -2
arch/powerpc/platforms/85xx/Makefile
··· 5 5 6 6 obj-y += common.o 7 7 8 + obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o 8 9 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o 9 10 obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o 10 11 obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o ··· 18 17 obj-$(CONFIG_P1023_RDS) += p1023_rds.o 19 18 obj-$(CONFIG_P2041_RDB) += p2041_rdb.o corenet_ds.o 20 19 obj-$(CONFIG_P3041_DS) += p3041_ds.o corenet_ds.o 21 - obj-$(CONFIG_P3060_QDS) += p3060_qds.o corenet_ds.o 22 20 obj-$(CONFIG_P4080_DS) += p4080_ds.o corenet_ds.o 23 21 obj-$(CONFIG_P5020_DS) += p5020_ds.o corenet_ds.o 24 22 obj-$(CONFIG_STX_GP3) += stx_gp3.o 25 23 obj-$(CONFIG_TQM85xx) += tqm85xx.o 26 - obj-$(CONFIG_SBC8560) += sbc8560.o 27 24 obj-$(CONFIG_SBC8548) += sbc8548.o 28 25 obj-$(CONFIG_SOCRATES) += socrates.o socrates_fpga_pic.o 29 26 obj-$(CONFIG_KSI8560) += ksi8560.o 30 27 obj-$(CONFIG_XES_MPC85xx) += xes_mpc85xx.o 31 28 obj-$(CONFIG_GE_IMP3A) += ge_imp3a.o 29 + obj-$(CONFIG_PPC_QEMU_E500) += qemu_e500.o
+67
arch/powerpc/platforms/85xx/bsc913x_rdb.c
··· 1 + /* 2 + * BSC913xRDB Board Setup 3 + * 4 + * Author: Priyanka Jain <Priyanka.Jain@freescale.com> 5 + * 6 + * Copyright 2011-2012 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/of_platform.h> 15 + #include <linux/pci.h> 16 + #include <asm/mpic.h> 17 + #include <sysdev/fsl_soc.h> 18 + #include <asm/udbg.h> 19 + 20 + #include "mpc85xx.h" 21 + 22 + void __init bsc913x_rdb_pic_init(void) 23 + { 24 + struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | 25 + MPIC_SINGLE_DEST_CPU, 26 + 0, 256, " OpenPIC "); 27 + 28 + if (!mpic) 29 + pr_err("bsc913x: Failed to allocate MPIC structure\n"); 30 + else 31 + mpic_init(mpic); 32 + } 33 + 34 + /* 35 + * Setup the architecture 36 + */ 37 + static void __init bsc913x_rdb_setup_arch(void) 38 + { 39 + if (ppc_md.progress) 40 + ppc_md.progress("bsc913x_rdb_setup_arch()", 0); 41 + 42 + pr_info("bsc913x board from Freescale Semiconductor\n"); 43 + } 44 + 45 + machine_device_initcall(bsc9131_rdb, mpc85xx_common_publish_devices); 46 + 47 + /* 48 + * Called very early, device-tree isn't unflattened 49 + */ 50 + 51 + static int __init bsc9131_rdb_probe(void) 52 + { 53 + unsigned long root = of_get_flat_dt_root(); 54 + 55 + return of_flat_dt_is_compatible(root, "fsl,bsc9131rdb"); 56 + } 57 + 58 + define_machine(bsc9131_rdb) { 59 + .name = "BSC9131 RDB", 60 + .probe = bsc9131_rdb_probe, 61 + .setup_arch = bsc913x_rdb_setup_arch, 62 + .init_IRQ = bsc913x_rdb_pic_init, 63 + .get_irq = mpic_get_irq, 64 + .restart = fsl_rstcr_restart, 65 + .calibrate_decr = generic_calibrate_decr, 66 + .progress = udbg_progress, 67 + };
+1 -1
arch/powerpc/platforms/85xx/corenet_ds.c
··· 77 77 #endif 78 78 79 79 #ifdef CONFIG_SWIOTLB 80 - if (memblock_end_of_DRAM() > max) { 80 + if ((memblock_end_of_DRAM() - 1) > max) { 81 81 ppc_swiotlb_enable = 1; 82 82 set_pci_dma_ops(&swiotlb_dma_ops); 83 83 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+1 -1
arch/powerpc/platforms/85xx/ge_imp3a.c
··· 125 125 mpc85xx_smp_init(); 126 126 127 127 #ifdef CONFIG_SWIOTLB 128 - if (memblock_end_of_DRAM() > max) { 128 + if ((memblock_end_of_DRAM() - 1) > max) { 129 129 ppc_swiotlb_enable = 1; 130 130 set_pci_dma_ops(&swiotlb_dma_ops); 131 131 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+1 -1
arch/powerpc/platforms/85xx/mpc8536_ds.c
··· 75 75 #endif 76 76 77 77 #ifdef CONFIG_SWIOTLB 78 - if (memblock_end_of_DRAM() > max) { 78 + if ((memblock_end_of_DRAM() - 1) > max) { 79 79 ppc_swiotlb_enable = 1; 80 80 set_pci_dma_ops(&swiotlb_dma_ops); 81 81 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+29 -68
arch/powerpc/platforms/85xx/mpc85xx_ds.c
··· 114 114 } 115 115 116 116 #ifdef CONFIG_PCI 117 - static int primary_phb_addr; 118 117 extern int uli_exclude_device(struct pci_controller *hose, 119 118 u_char bus, u_char devfn); 119 + 120 + static struct device_node *pci_with_uli; 120 121 121 122 static int mpc85xx_exclude_device(struct pci_controller *hose, 122 123 u_char bus, u_char devfn) 123 124 { 124 - struct device_node* node; 125 - struct resource rsrc; 126 - 127 - node = hose->dn; 128 - of_address_to_resource(node, 0, &rsrc); 129 - 130 - if ((rsrc.start & 0xfffff) == primary_phb_addr) { 125 + if (hose->dn == pci_with_uli) 131 126 return uli_exclude_device(hose, bus, devfn); 132 - } 133 127 134 128 return PCIBIOS_SUCCESSFUL; 135 129 } 136 130 #endif /* CONFIG_PCI */ 131 + 132 + static void __init mpc85xx_ds_pci_init(void) 133 + { 134 + #ifdef CONFIG_PCI 135 + struct device_node *node; 136 + 137 + fsl_pci_init(); 138 + 139 + /* See if we have a ULI under the primary */ 140 + 141 + node = of_find_node_by_name(NULL, "uli1575"); 142 + while ((pci_with_uli = of_get_parent(node))) { 143 + of_node_put(node); 144 + node = pci_with_uli; 145 + 146 + if (pci_with_uli == fsl_pci_primary) { 147 + ppc_md.pci_exclude_device = mpc85xx_exclude_device; 148 + break; 149 + } 150 + } 151 + #endif 152 + } 137 153 138 154 /* 139 155 * Setup the architecture 140 156 */ 141 157 static void __init mpc85xx_ds_setup_arch(void) 142 158 { 143 - #ifdef CONFIG_PCI 144 - struct device_node *np; 145 - struct pci_controller *hose; 146 - #endif 147 - dma_addr_t max = 0xffffffff; 148 - 149 159 if (ppc_md.progress) 150 160 ppc_md.progress("mpc85xx_ds_setup_arch()", 0); 151 161 152 - #ifdef CONFIG_PCI 153 - for_each_node_by_type(np, "pci") { 154 - if (of_device_is_compatible(np, "fsl,mpc8540-pci") || 155 - of_device_is_compatible(np, "fsl,mpc8548-pcie") || 156 - of_device_is_compatible(np, "fsl,p2020-pcie")) { 157 - struct resource rsrc; 158 - of_address_to_resource(np, 0, &rsrc); 159 - if ((rsrc.start & 0xfffff) == primary_phb_addr) 160 - fsl_add_bridge(np, 1); 161 - else 162 - fsl_add_bridge(np, 0); 163 - 164 - hose = pci_find_hose_for_OF_device(np); 165 - max = min(max, hose->dma_window_base_cur + 166 - hose->dma_window_size); 167 - } 168 - } 169 - 170 - ppc_md.pci_exclude_device = mpc85xx_exclude_device; 171 - #endif 172 - 162 + mpc85xx_ds_pci_init(); 173 163 mpc85xx_smp_init(); 174 - 175 - #ifdef CONFIG_SWIOTLB 176 - if (memblock_end_of_DRAM() > max) { 177 - ppc_swiotlb_enable = 1; 178 - set_pci_dma_ops(&swiotlb_dma_ops); 179 - ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; 180 - } 181 - #endif 182 164 183 165 printk("MPC85xx DS board from Freescale Semiconductor\n"); 184 166 } ··· 172 190 { 173 191 unsigned long root = of_get_flat_dt_root(); 174 192 175 - if (of_flat_dt_is_compatible(root, "MPC8544DS")) { 176 - #ifdef CONFIG_PCI 177 - primary_phb_addr = 0xb000; 178 - #endif 179 - return 1; 180 - } 181 - 182 - return 0; 193 + return !!of_flat_dt_is_compatible(root, "MPC8544DS"); 183 194 } 184 195 185 196 machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices); ··· 190 215 { 191 216 unsigned long root = of_get_flat_dt_root(); 192 217 193 - if (of_flat_dt_is_compatible(root, "fsl,MPC8572DS")) { 194 - #ifdef CONFIG_PCI 195 - primary_phb_addr = 0x8000; 196 - #endif 197 - return 1; 198 - } 199 - 200 - return 0; 218 + return !!of_flat_dt_is_compatible(root, "fsl,MPC8572DS"); 201 219 } 202 220 203 221 /* ··· 200 232 { 201 233 unsigned long root = of_get_flat_dt_root(); 202 234 203 - if (of_flat_dt_is_compatible(root, "fsl,P2020DS")) { 204 - #ifdef CONFIG_PCI 205 - primary_phb_addr = 0x9000; 206 - #endif 207 - return 1; 208 - } 209 - 210 - return 0; 235 + return !!of_flat_dt_is_compatible(root, "fsl,P2020DS"); 211 236 } 212 237 213 238 define_machine(mpc8544_ds) {
+1 -1
arch/powerpc/platforms/85xx/mpc85xx_mds.c
··· 359 359 mpc85xx_mds_qe_init(); 360 360 361 361 #ifdef CONFIG_SWIOTLB 362 - if (memblock_end_of_DRAM() > max) { 362 + if ((memblock_end_of_DRAM() - 1) > max) { 363 363 ppc_swiotlb_enable = 1; 364 364 set_pci_dma_ops(&swiotlb_dma_ops); 365 365 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+22
arch/powerpc/platforms/85xx/mpc85xx_rdb.c
··· 169 169 machine_device_initcall(p1020_utm_pc, mpc85xx_common_publish_devices); 170 170 machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices); 171 171 machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices); 172 + machine_device_initcall(p1024_rdb, mpc85xx_common_publish_devices); 172 173 173 174 /* 174 175 * Called very early, device-tree isn't unflattened ··· 236 235 unsigned long root = of_get_flat_dt_root(); 237 236 238 237 return of_flat_dt_is_compatible(root, "fsl,P1020UTM-PC"); 238 + } 239 + 240 + static int __init p1024_rdb_probe(void) 241 + { 242 + unsigned long root = of_get_flat_dt_root(); 243 + 244 + return of_flat_dt_is_compatible(root, "fsl,P1024RDB"); 239 245 } 240 246 241 247 define_machine(p2020_rdb) { ··· 346 338 define_machine(p1020_rdb_pc) { 347 339 .name = "P1020RDB-PC", 348 340 .probe = p1020_rdb_pc_probe, 341 + .setup_arch = mpc85xx_rdb_setup_arch, 342 + .init_IRQ = mpc85xx_rdb_pic_init, 343 + #ifdef CONFIG_PCI 344 + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 345 + #endif 346 + .get_irq = mpic_get_irq, 347 + .restart = fsl_rstcr_restart, 348 + .calibrate_decr = generic_calibrate_decr, 349 + .progress = udbg_progress, 350 + }; 351 + 352 + define_machine(p1024_rdb) { 353 + .name = "P1024 RDB", 354 + .probe = p1024_rdb_probe, 349 355 .setup_arch = mpc85xx_rdb_setup_arch, 350 356 .init_IRQ = mpc85xx_rdb_pic_init, 351 357 #ifdef CONFIG_PCI
+95 -21
arch/powerpc/platforms/85xx/p1022_ds.c
··· 27 27 #include <sysdev/fsl_pci.h> 28 28 #include <asm/udbg.h> 29 29 #include <asm/fsl_guts.h> 30 + #include <asm/fsl_lbc.h> 30 31 #include "smp.h" 31 32 32 33 #include "mpc85xx.h" ··· 143 142 { 144 143 } 145 144 145 + struct fsl_law { 146 + u32 lawbar; 147 + u32 reserved1; 148 + u32 lawar; 149 + u32 reserved[5]; 150 + }; 151 + 152 + #define LAWBAR_MASK 0x00F00000 153 + #define LAWBAR_SHIFT 12 154 + 155 + #define LAWAR_EN 0x80000000 156 + #define LAWAR_TGT_MASK 0x01F00000 157 + #define LAW_TRGT_IF_LBC (0x04 << 20) 158 + 159 + #define LAWAR_MASK (LAWAR_EN | LAWAR_TGT_MASK) 160 + #define LAWAR_MATCH (LAWAR_EN | LAW_TRGT_IF_LBC) 161 + 162 + #define BR_BA 0xFFFF8000 163 + 164 + /* 165 + * Map a BRx value to a physical address 166 + * 167 + * The localbus BRx registers only store the lower 32 bits of the address. To 168 + * obtain the upper four bits, we need to scan the LAW table. The entry which 169 + * maps to the localbus will contain the upper four bits. 170 + */ 171 + static phys_addr_t lbc_br_to_phys(const void *ecm, unsigned int count, u32 br) 172 + { 173 + #ifndef CONFIG_PHYS_64BIT 174 + /* 175 + * If we only have 32-bit addressing, then the BRx address *is* the 176 + * physical address. 177 + */ 178 + return br & BR_BA; 179 + #else 180 + const struct fsl_law *law = ecm + 0xc08; 181 + unsigned int i; 182 + 183 + for (i = 0; i < count; i++) { 184 + u64 lawbar = in_be32(&law[i].lawbar); 185 + u32 lawar = in_be32(&law[i].lawar); 186 + 187 + if ((lawar & LAWAR_MASK) == LAWAR_MATCH) 188 + /* Extract the upper four bits */ 189 + return (br & BR_BA) | ((lawbar & LAWBAR_MASK) << 12); 190 + } 191 + 192 + return 0; 193 + #endif 194 + } 195 + 146 196 /** 147 197 * p1022ds_set_monitor_port: switch the output to a different monitor port 148 - * 149 198 */ 150 199 static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port) 151 200 { 152 201 struct device_node *guts_node; 153 - struct device_node *indirect_node = NULL; 202 + struct device_node *lbc_node = NULL; 203 + struct device_node *law_node = NULL; 154 204 struct ccsr_guts __iomem *guts; 205 + struct fsl_lbc_regs *lbc = NULL; 206 + void *ecm = NULL; 155 207 u8 __iomem *lbc_lcs0_ba = NULL; 156 208 u8 __iomem *lbc_lcs1_ba = NULL; 209 + phys_addr_t cs0_addr, cs1_addr; 210 + const __be32 *iprop; 211 + unsigned int num_laws; 157 212 u8 b; 158 213 159 214 /* Map the global utilities registers. */ ··· 225 168 goto exit; 226 169 } 227 170 228 - indirect_node = of_find_compatible_node(NULL, NULL, 229 - "fsl,p1022ds-indirect-pixis"); 230 - if (!indirect_node) { 231 - pr_err("p1022ds: missing pixis indirect mode node\n"); 171 + lbc_node = of_find_compatible_node(NULL, NULL, "fsl,p1022-elbc"); 172 + if (!lbc_node) { 173 + pr_err("p1022ds: missing localbus node\n"); 232 174 goto exit; 233 175 } 234 176 235 - lbc_lcs0_ba = of_iomap(indirect_node, 0); 236 - if (!lbc_lcs0_ba) { 237 - pr_err("p1022ds: could not map localbus chip select 0\n"); 177 + lbc = of_iomap(lbc_node, 0); 178 + if (!lbc) { 179 + pr_err("p1022ds: could not map localbus node\n"); 238 180 goto exit; 239 181 } 240 182 241 - lbc_lcs1_ba = of_iomap(indirect_node, 1); 242 - if (!lbc_lcs1_ba) { 243 - pr_err("p1022ds: could not map localbus chip select 1\n"); 183 + law_node = of_find_compatible_node(NULL, NULL, "fsl,ecm-law"); 184 + if (!law_node) { 185 + pr_err("p1022ds: missing local access window node\n"); 244 186 goto exit; 245 187 } 188 + 189 + ecm = of_iomap(law_node, 0); 190 + if (!ecm) { 191 + pr_err("p1022ds: could not map local access window node\n"); 192 + goto exit; 193 + } 194 + 195 + iprop = of_get_property(law_node, "fsl,num-laws", 0); 196 + if (!iprop) { 197 + pr_err("p1022ds: LAW node is missing fsl,num-laws property\n"); 198 + goto exit; 199 + } 200 + num_laws = be32_to_cpup(iprop); 201 + 202 + cs0_addr = lbc_br_to_phys(ecm, num_laws, in_be32(&lbc->bank[0].br)); 203 + cs1_addr = lbc_br_to_phys(ecm, num_laws, in_be32(&lbc->bank[1].br)); 204 + 205 + lbc_lcs0_ba = ioremap(cs0_addr, 1); 206 + lbc_lcs1_ba = ioremap(cs1_addr, 1); 246 207 247 208 /* Make sure we're in indirect mode first. */ 248 209 if ((in_be32(&guts->pmuxcr) & PMUXCR_ELBCDIU_MASK) != ··· 329 254 iounmap(lbc_lcs1_ba); 330 255 if (lbc_lcs0_ba) 331 256 iounmap(lbc_lcs0_ba); 257 + if (lbc) 258 + iounmap(lbc); 259 + if (ecm) 260 + iounmap(ecm); 332 261 if (guts) 333 262 iounmap(guts); 334 263 335 - of_node_put(indirect_node); 264 + of_node_put(law_node); 265 + of_node_put(lbc_node); 336 266 of_node_put(guts_node); 337 267 } 338 268 ··· 428 348 */ 429 349 static void __init disable_one_node(struct device_node *np, struct property *new) 430 350 { 431 - struct property *old; 432 - 433 - old = of_find_property(np, new->name, NULL); 434 - if (old) 435 - prom_update_property(np, new, old); 436 - else 437 - prom_add_property(np, new); 351 + prom_update_property(np, new); 438 352 } 439 353 440 354 /* TRUE if there is a "video=fslfb" command-line parameter. */ ··· 524 450 mpc85xx_smp_init(); 525 451 526 452 #ifdef CONFIG_SWIOTLB 527 - if (memblock_end_of_DRAM() > max) { 453 + if ((memblock_end_of_DRAM() - 1) > max) { 528 454 ppc_swiotlb_enable = 1; 529 455 set_pci_dma_ops(&swiotlb_dma_ops); 530 456 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
-77
arch/powerpc/platforms/85xx/p3060_qds.c
··· 1 - /* 2 - * P3060 QDS Setup 3 - * 4 - * Copyright 2011 Freescale Semiconductor Inc. 5 - * 6 - * This program is free software; you can redistribute it and/or modify it 7 - * under the terms of the GNU General Public License as published by the 8 - * Free Software Foundation; either version 2 of the License, or (at your 9 - * option) any later version. 10 - */ 11 - 12 - #include <linux/kernel.h> 13 - #include <linux/interrupt.h> 14 - #include <linux/phy.h> 15 - #include <asm/machdep.h> 16 - #include <asm/udbg.h> 17 - #include <asm/mpic.h> 18 - #include <linux/of_platform.h> 19 - #include <sysdev/fsl_soc.h> 20 - #include <sysdev/fsl_pci.h> 21 - #include <asm/ehv_pic.h> 22 - #include "corenet_ds.h" 23 - 24 - /* 25 - * Called very early, device-tree isn't unflattened 26 - */ 27 - static int __init p3060_qds_probe(void) 28 - { 29 - unsigned long root = of_get_flat_dt_root(); 30 - #ifdef CONFIG_SMP 31 - extern struct smp_ops_t smp_85xx_ops; 32 - #endif 33 - 34 - if (of_flat_dt_is_compatible(root, "fsl,P3060QDS")) 35 - return 1; 36 - 37 - /* Check if we're running under the Freescale hypervisor */ 38 - if (of_flat_dt_is_compatible(root, "fsl,P3060QDS-hv")) { 39 - ppc_md.init_IRQ = ehv_pic_init; 40 - ppc_md.get_irq = ehv_pic_get_irq; 41 - ppc_md.restart = fsl_hv_restart; 42 - ppc_md.power_off = fsl_hv_halt; 43 - ppc_md.halt = fsl_hv_halt; 44 - #ifdef CONFIG_SMP 45 - /* 46 - * Disable the timebase sync operations because we can't write 47 - * to the timebase registers under the hypervisor. 48 - */ 49 - smp_85xx_ops.give_timebase = NULL; 50 - smp_85xx_ops.take_timebase = NULL; 51 - #endif 52 - return 1; 53 - } 54 - 55 - return 0; 56 - } 57 - 58 - define_machine(p3060_qds) { 59 - .name = "P3060 QDS", 60 - .probe = p3060_qds_probe, 61 - .setup_arch = corenet_ds_setup_arch, 62 - .init_IRQ = corenet_ds_pic_init, 63 - #ifdef CONFIG_PCI 64 - .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 65 - #endif 66 - .get_irq = mpic_get_coreint_irq, 67 - .restart = fsl_rstcr_restart, 68 - .calibrate_decr = generic_calibrate_decr, 69 - .progress = udbg_progress, 70 - .power_save = e500_idle, 71 - }; 72 - 73 - machine_device_initcall(p3060_qds, corenet_ds_publish_devices); 74 - 75 - #ifdef CONFIG_SWIOTLB 76 - machine_arch_initcall(p3060_qds, swiotlb_setup_bus_notifier); 77 - #endif
+72
arch/powerpc/platforms/85xx/qemu_e500.c
··· 1 + /* 2 + * Paravirt target for a generic QEMU e500 machine 3 + * 4 + * This is intended to be a flexible device-tree-driven platform, not fixed 5 + * to a particular piece of hardware or a particular spec of virtual hardware, 6 + * beyond the assumption of an e500-family CPU. Some things are still hardcoded 7 + * here, such as MPIC, but this is a limitation of the current code rather than 8 + * an interface contract with QEMU. 9 + * 10 + * Copyright 2012 Freescale Semiconductor Inc. 11 + * 12 + * This program is free software; you can redistribute it and/or modify it 13 + * under the terms of the GNU General Public License as published by the 14 + * Free Software Foundation; either version 2 of the License, or (at your 15 + * option) any later version. 16 + */ 17 + 18 + #include <linux/kernel.h> 19 + #include <linux/of_fdt.h> 20 + #include <asm/machdep.h> 21 + #include <asm/time.h> 22 + #include <asm/udbg.h> 23 + #include <asm/mpic.h> 24 + #include <sysdev/fsl_soc.h> 25 + #include <sysdev/fsl_pci.h> 26 + #include "smp.h" 27 + #include "mpc85xx.h" 28 + 29 + void __init qemu_e500_pic_init(void) 30 + { 31 + struct mpic *mpic; 32 + 33 + mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU, 34 + 0, 256, " OpenPIC "); 35 + 36 + BUG_ON(mpic == NULL); 37 + mpic_init(mpic); 38 + } 39 + 40 + static void __init qemu_e500_setup_arch(void) 41 + { 42 + ppc_md.progress("qemu_e500_setup_arch()", 0); 43 + 44 + fsl_pci_init(); 45 + mpc85xx_smp_init(); 46 + } 47 + 48 + /* 49 + * Called very early, device-tree isn't unflattened 50 + */ 51 + static int __init qemu_e500_probe(void) 52 + { 53 + unsigned long root = of_get_flat_dt_root(); 54 + 55 + return !!of_flat_dt_is_compatible(root, "fsl,qemu-e500"); 56 + } 57 + 58 + machine_device_initcall(qemu_e500, mpc85xx_common_publish_devices); 59 + 60 + define_machine(qemu_e500) { 61 + .name = "QEMU e500", 62 + .probe = qemu_e500_probe, 63 + .setup_arch = qemu_e500_setup_arch, 64 + .init_IRQ = qemu_e500_pic_init, 65 + #ifdef CONFIG_PCI 66 + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 67 + #endif 68 + .get_irq = mpic_get_irq, 69 + .restart = fsl_rstcr_restart, 70 + .calibrate_decr = generic_calibrate_decr, 71 + .progress = udbg_progress, 72 + };
-254
arch/powerpc/platforms/85xx/sbc8560.c
··· 1 - /* 2 - * Wind River SBC8560 setup and early boot code. 3 - * 4 - * Copyright 2007 Wind River Systems Inc. 5 - * 6 - * By Paul Gortmaker (see MAINTAINERS for contact information) 7 - * 8 - * Based largely on the MPC8560ADS support - Copyright 2005 Freescale Inc. 9 - * 10 - * This program is free software; you can redistribute it and/or modify it 11 - * under the terms of the GNU General Public License as published by the 12 - * Free Software Foundation; either version 2 of the License, or (at your 13 - * option) any later version. 14 - */ 15 - 16 - #include <linux/stddef.h> 17 - #include <linux/kernel.h> 18 - #include <linux/pci.h> 19 - #include <linux/kdev_t.h> 20 - #include <linux/delay.h> 21 - #include <linux/seq_file.h> 22 - #include <linux/of_platform.h> 23 - 24 - #include <asm/time.h> 25 - #include <asm/machdep.h> 26 - #include <asm/pci-bridge.h> 27 - #include <asm/mpic.h> 28 - #include <mm/mmu_decl.h> 29 - #include <asm/udbg.h> 30 - 31 - #include <sysdev/fsl_soc.h> 32 - #include <sysdev/fsl_pci.h> 33 - 34 - #include "mpc85xx.h" 35 - 36 - #ifdef CONFIG_CPM2 37 - #include <asm/cpm2.h> 38 - #include <sysdev/cpm2_pic.h> 39 - #endif 40 - 41 - static void __init sbc8560_pic_init(void) 42 - { 43 - struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN, 44 - 0, 256, " OpenPIC "); 45 - BUG_ON(mpic == NULL); 46 - mpic_init(mpic); 47 - 48 - mpc85xx_cpm2_pic_init(); 49 - } 50 - 51 - /* 52 - * Setup the architecture 53 - */ 54 - #ifdef CONFIG_CPM2 55 - struct cpm_pin { 56 - int port, pin, flags; 57 - }; 58 - 59 - static const struct cpm_pin sbc8560_pins[] = { 60 - /* SCC1 */ 61 - {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 62 - {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, 63 - {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 64 - 65 - /* SCC2 */ 66 - {3, 26, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 67 - {3, 27, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 68 - {3, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 69 - 70 - /* FCC2 */ 71 - {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 72 - {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 73 - {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 74 - {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 75 - {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 76 - {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 77 - {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 78 - {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 79 - {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 80 - {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 81 - {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 82 - {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY}, 83 - {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 84 - {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 85 - {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK14 */ 86 - {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, /* CLK13 */ 87 - 88 - /* FCC3 */ 89 - {1, 4, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 90 - {1, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 91 - {1, 6, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 92 - {1, 7, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 93 - {1, 8, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 94 - {1, 9, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 95 - {1, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 96 - {1, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 97 - {1, 12, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 98 - {1, 13, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 99 - {1, 14, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 100 - {1, 15, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY}, 101 - {1, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 102 - {1, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY}, 103 - {2, 16, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* CLK16 */ 104 - {2, 17, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* CLK15 */ 105 - }; 106 - 107 - static void __init init_ioports(void) 108 - { 109 - int i; 110 - 111 - for (i = 0; i < ARRAY_SIZE(sbc8560_pins); i++) { 112 - const struct cpm_pin *pin = &sbc8560_pins[i]; 113 - cpm2_set_pin(pin->port, pin->pin, pin->flags); 114 - } 115 - 116 - cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX); 117 - cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX); 118 - cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_RX); 119 - cpm2_clk_setup(CPM_CLK_SCC2, CPM_BRG2, CPM_CLK_TX); 120 - cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX); 121 - cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX); 122 - cpm2_clk_setup(CPM_CLK_FCC3, CPM_CLK15, CPM_CLK_RX); 123 - cpm2_clk_setup(CPM_CLK_FCC3, CPM_CLK16, CPM_CLK_TX); 124 - } 125 - #endif 126 - 127 - static void __init sbc8560_setup_arch(void) 128 - { 129 - #ifdef CONFIG_PCI 130 - struct device_node *np; 131 - #endif 132 - 133 - if (ppc_md.progress) 134 - ppc_md.progress("sbc8560_setup_arch()", 0); 135 - 136 - #ifdef CONFIG_CPM2 137 - cpm2_reset(); 138 - init_ioports(); 139 - #endif 140 - 141 - #ifdef CONFIG_PCI 142 - for_each_compatible_node(np, "pci", "fsl,mpc8540-pci") 143 - fsl_add_bridge(np, 1); 144 - #endif 145 - } 146 - 147 - static void sbc8560_show_cpuinfo(struct seq_file *m) 148 - { 149 - uint pvid, svid, phid1; 150 - 151 - pvid = mfspr(SPRN_PVR); 152 - svid = mfspr(SPRN_SVR); 153 - 154 - seq_printf(m, "Vendor\t\t: Wind River\n"); 155 - seq_printf(m, "PVR\t\t: 0x%x\n", pvid); 156 - seq_printf(m, "SVR\t\t: 0x%x\n", svid); 157 - 158 - /* Display cpu Pll setting */ 159 - phid1 = mfspr(SPRN_HID1); 160 - seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f)); 161 - } 162 - 163 - machine_device_initcall(sbc8560, mpc85xx_common_publish_devices); 164 - 165 - /* 166 - * Called very early, device-tree isn't unflattened 167 - */ 168 - static int __init sbc8560_probe(void) 169 - { 170 - unsigned long root = of_get_flat_dt_root(); 171 - 172 - return of_flat_dt_is_compatible(root, "SBC8560"); 173 - } 174 - 175 - #ifdef CONFIG_RTC_DRV_M48T59 176 - static int __init sbc8560_rtc_init(void) 177 - { 178 - struct device_node *np; 179 - struct resource res; 180 - struct platform_device *rtc_dev; 181 - 182 - np = of_find_compatible_node(NULL, NULL, "m48t59"); 183 - if (np == NULL) { 184 - printk("No RTC in DTB. Has it been eaten by wild dogs?\n"); 185 - return -ENODEV; 186 - } 187 - 188 - of_address_to_resource(np, 0, &res); 189 - of_node_put(np); 190 - 191 - printk("Found RTC (m48t59) at i/o 0x%x\n", res.start); 192 - 193 - rtc_dev = platform_device_register_simple("rtc-m48t59", 0, &res, 1); 194 - 195 - if (IS_ERR(rtc_dev)) { 196 - printk("Registering sbc8560 RTC device failed\n"); 197 - return PTR_ERR(rtc_dev); 198 - } 199 - 200 - return 0; 201 - } 202 - 203 - arch_initcall(sbc8560_rtc_init); 204 - 205 - #endif /* M48T59 */ 206 - 207 - static __u8 __iomem *brstcr; 208 - 209 - static int __init sbc8560_bdrstcr_init(void) 210 - { 211 - struct device_node *np; 212 - struct resource res; 213 - 214 - np = of_find_compatible_node(NULL, NULL, "wrs,sbc8560-brstcr"); 215 - if (np == NULL) { 216 - printk(KERN_WARNING "sbc8560: No board specific RSTCR in DTB.\n"); 217 - return -ENODEV; 218 - } 219 - 220 - of_address_to_resource(np, 0, &res); 221 - 222 - printk(KERN_INFO "sbc8560: Found BRSTCR at %pR\n", &res); 223 - 224 - brstcr = ioremap(res.start, resource_size(&res)); 225 - if(!brstcr) 226 - printk(KERN_WARNING "sbc8560: ioremap of brstcr failed.\n"); 227 - 228 - of_node_put(np); 229 - 230 - return 0; 231 - } 232 - 233 - arch_initcall(sbc8560_bdrstcr_init); 234 - 235 - void sbc8560_rstcr_restart(char * cmd) 236 - { 237 - local_irq_disable(); 238 - if(brstcr) 239 - clrbits8(brstcr, 0x80); 240 - 241 - while(1); 242 - } 243 - 244 - define_machine(sbc8560) { 245 - .name = "SBC8560", 246 - .probe = sbc8560_probe, 247 - .setup_arch = sbc8560_setup_arch, 248 - .init_IRQ = sbc8560_pic_init, 249 - .show_cpuinfo = sbc8560_show_cpuinfo, 250 - .get_irq = mpic_get_irq, 251 - .restart = sbc8560_rstcr_restart, 252 - .calibrate_decr = generic_calibrate_decr, 253 - .progress = udbg_progress, 254 - };
+1 -1
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
··· 102 102 #endif 103 103 104 104 #ifdef CONFIG_SWIOTLB 105 - if (memblock_end_of_DRAM() > max) { 105 + if ((memblock_end_of_DRAM() - 1) > max) { 106 106 ppc_swiotlb_enable = 1; 107 107 set_pci_dma_ops(&swiotlb_dma_ops); 108 108 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
+4
arch/powerpc/platforms/Kconfig.cputype
··· 159 159 bool "e500mc Support" 160 160 select PPC_FPU 161 161 depends on E500 162 + help 163 + This must be enabled for running on e500mc (and derivatives 164 + such as e5500/e6500), and must be disabled for running on 165 + e500v1 or e500v2. 162 166 163 167 config PPC_FPU 164 168 bool
+13 -15
arch/powerpc/platforms/cell/beat_hvCall.S
··· 22 22 23 23 #include <asm/ppc_asm.h> 24 24 25 - #define STK_PARM(i) (48 + ((i)-3)*8) 26 - 27 25 /* Not implemented on Beat, now */ 28 26 #define HCALL_INST_PRECALL 29 27 #define HCALL_INST_POSTCALL ··· 72 74 mr r6,r7 73 75 mr r7,r8 74 76 mr r8,r9 75 - ld r10,STK_PARM(r10)(r1) 77 + ld r10,STK_PARAM(R10)(r1) 76 78 77 79 HVSC /* invoke the hypervisor */ 78 80 ··· 92 94 93 95 HCALL_INST_PRECALL 94 96 95 - std r4,STK_PARM(r4)(r1) /* save ret buffer */ 97 + std r4,STK_PARAM(R4)(r1) /* save ret buffer */ 96 98 97 99 mr r11,r3 98 100 mr r3,r5 ··· 106 108 107 109 HCALL_INST_POSTCALL 108 110 109 - ld r12,STK_PARM(r4)(r1) 111 + ld r12,STK_PARAM(R4)(r1) 110 112 std r4, 0(r12) 111 113 112 114 lwz r0,8(r1) ··· 123 125 124 126 HCALL_INST_PRECALL 125 127 126 - std r4,STK_PARM(r4)(r1) /* save ret buffer */ 128 + std r4,STK_PARAM(R4)(r1) /* save ret buffer */ 127 129 128 130 mr r11,r3 129 131 mr r3,r5 ··· 137 139 138 140 HCALL_INST_POSTCALL 139 141 140 - ld r12,STK_PARM(r4)(r1) 142 + ld r12,STK_PARAM(R4)(r1) 141 143 std r4, 0(r12) 142 144 std r5, 8(r12) 143 145 ··· 155 157 156 158 HCALL_INST_PRECALL 157 159 158 - std r4,STK_PARM(r4)(r1) /* save ret buffer */ 160 + std r4,STK_PARAM(R4)(r1) /* save ret buffer */ 159 161 160 162 mr r11,r3 161 163 mr r3,r5 ··· 169 171 170 172 HCALL_INST_POSTCALL 171 173 172 - ld r12,STK_PARM(r4)(r1) 174 + ld r12,STK_PARAM(R4)(r1) 173 175 std r4, 0(r12) 174 176 std r5, 8(r12) 175 177 std r6, 16(r12) ··· 188 190 189 191 HCALL_INST_PRECALL 190 192 191 - std r4,STK_PARM(r4)(r1) /* save ret buffer */ 193 + std r4,STK_PARAM(R4)(r1) /* save ret buffer */ 192 194 193 195 mr r11,r3 194 196 mr r3,r5 ··· 202 204 203 205 HCALL_INST_POSTCALL 204 206 205 - ld r12,STK_PARM(r4)(r1) 207 + ld r12,STK_PARAM(R4)(r1) 206 208 std r4, 0(r12) 207 209 std r5, 8(r12) 208 210 std r6, 16(r12) ··· 222 224 223 225 HCALL_INST_PRECALL 224 226 225 - std r4,STK_PARM(r4)(r1) /* save ret buffer */ 227 + std r4,STK_PARAM(R4)(r1) /* save ret buffer */ 226 228 227 229 mr r11,r3 228 230 mr r3,r5 ··· 236 238 237 239 HCALL_INST_POSTCALL 238 240 239 - ld r12,STK_PARM(r4)(r1) 241 + ld r12,STK_PARAM(R4)(r1) 240 242 std r4, 0(r12) 241 243 std r5, 8(r12) 242 244 std r6, 16(r12) ··· 257 259 258 260 HCALL_INST_PRECALL 259 261 260 - std r4,STK_PARM(r4)(r1) /* save ret buffer */ 262 + std r4,STK_PARAM(R4)(r1) /* save ret buffer */ 261 263 262 264 mr r11,r3 263 265 mr r3,r5 ··· 271 273 272 274 HCALL_INST_POSTCALL 273 275 274 - ld r12,STK_PARM(r4)(r1) 276 + ld r12,STK_PARAM(R4)(r1) 275 277 std r4, 0(r12) 276 278 std r5, 8(r12) 277 279 std r6, 16(r12)
-1
arch/powerpc/platforms/cell/iommu.c
··· 518 518 __set_bit(0, window->table.it_map); 519 519 tce_build_cell(&window->table, window->table.it_offset, 1, 520 520 (unsigned long)iommu->pad_page, DMA_TO_DEVICE, NULL); 521 - window->table.it_hint = window->table.it_blocksize; 522 521 523 522 return window; 524 523 }
+4 -6
arch/powerpc/platforms/powernv/opal-takeover.S
··· 14 14 #include <asm/asm-offsets.h> 15 15 #include <asm/opal.h> 16 16 17 - #define STK_PARAM(i) (48 + ((i)-3)*8) 18 - 19 17 #define H_HAL_TAKEOVER 0x5124 20 18 #define H_HAL_TAKEOVER_QUERY_MAGIC -1 21 19 ··· 21 23 _GLOBAL(opal_query_takeover) 22 24 mfcr r0 23 25 stw r0,8(r1) 24 - std r3,STK_PARAM(r3)(r1) 25 - std r4,STK_PARAM(r4)(r1) 26 + std r3,STK_PARAM(R3)(r1) 27 + std r4,STK_PARAM(R4)(r1) 26 28 li r3,H_HAL_TAKEOVER 27 29 li r4,H_HAL_TAKEOVER_QUERY_MAGIC 28 30 HVSC 29 - ld r10,STK_PARAM(r3)(r1) 31 + ld r10,STK_PARAM(R3)(r1) 30 32 std r4,0(r10) 31 - ld r10,STK_PARAM(r4)(r1) 33 + ld r10,STK_PARAM(R4)(r1) 32 34 std r5,0(r10) 33 35 lwz r0,8(r1) 34 36 mtcrf 0xff,r0
+4 -2
arch/powerpc/platforms/pseries/eeh_event.c
··· 85 85 set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */ 86 86 edev = handle_eeh_events(event); 87 87 88 - eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); 89 - pci_dev_put(edev->pdev); 88 + if (edev) { 89 + eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); 90 + pci_dev_put(edev->pdev); 91 + } 90 92 91 93 kfree(event); 92 94 mutex_unlock(&eeh_event_mutex);
+2 -2
arch/powerpc/platforms/pseries/eeh_pseries.c
··· 81 81 ibm_get_config_addr_info2 = rtas_token("ibm,get-config-addr-info2"); 82 82 ibm_get_config_addr_info = rtas_token("ibm,get-config-addr-info"); 83 83 ibm_configure_pe = rtas_token("ibm,configure-pe"); 84 - ibm_configure_bridge = rtas_token ("ibm,configure-bridge"); 84 + ibm_configure_bridge = rtas_token("ibm,configure-bridge"); 85 85 86 86 /* necessary sanity check */ 87 87 if (ibm_set_eeh_option == RTAS_UNKNOWN_SERVICE) { ··· 89 89 __func__); 90 90 return -EINVAL; 91 91 } else if (ibm_set_slot_reset == RTAS_UNKNOWN_SERVICE) { 92 - pr_warning("%s: RTAS service <ibm, set-slot-reset> invalid\n", 92 + pr_warning("%s: RTAS service <ibm,set-slot-reset> invalid\n", 93 93 __func__); 94 94 return -EINVAL; 95 95 } else if (ibm_read_slot_reset_state2 == RTAS_UNKNOWN_SERVICE &&
+38 -40
arch/powerpc/platforms/pseries/hvCall.S
··· 13 13 #include <asm/asm-offsets.h> 14 14 #include <asm/ptrace.h> 15 15 16 - #define STK_PARM(i) (48 + ((i)-3)*8) 17 - 18 16 #ifdef CONFIG_TRACEPOINTS 19 17 20 18 .section ".toc","aw" ··· 24 26 .section ".text" 25 27 26 28 /* 27 - * precall must preserve all registers. use unused STK_PARM() 29 + * precall must preserve all registers. use unused STK_PARAM() 28 30 * areas to save snapshots and opcode. We branch around this 29 31 * in early init (eg when populating the MMU hashtable) by using an 30 32 * unconditional cpu feature. ··· 38 40 cmpdi r12,0; \ 39 41 beq+ 1f; \ 40 42 mflr r0; \ 41 - std r3,STK_PARM(r3)(r1); \ 42 - std r4,STK_PARM(r4)(r1); \ 43 - std r5,STK_PARM(r5)(r1); \ 44 - std r6,STK_PARM(r6)(r1); \ 45 - std r7,STK_PARM(r7)(r1); \ 46 - std r8,STK_PARM(r8)(r1); \ 47 - std r9,STK_PARM(r9)(r1); \ 48 - std r10,STK_PARM(r10)(r1); \ 43 + std r3,STK_PARAM(R3)(r1); \ 44 + std r4,STK_PARAM(R4)(r1); \ 45 + std r5,STK_PARAM(R5)(r1); \ 46 + std r6,STK_PARAM(R6)(r1); \ 47 + std r7,STK_PARAM(R7)(r1); \ 48 + std r8,STK_PARAM(R8)(r1); \ 49 + std r9,STK_PARAM(R9)(r1); \ 50 + std r10,STK_PARAM(R10)(r1); \ 49 51 std r0,16(r1); \ 50 - addi r4,r1,STK_PARM(FIRST_REG); \ 52 + addi r4,r1,STK_PARAM(FIRST_REG); \ 51 53 stdu r1,-STACK_FRAME_OVERHEAD(r1); \ 52 54 bl .__trace_hcall_entry; \ 53 55 addi r1,r1,STACK_FRAME_OVERHEAD; \ 54 56 ld r0,16(r1); \ 55 - ld r3,STK_PARM(r3)(r1); \ 56 - ld r4,STK_PARM(r4)(r1); \ 57 - ld r5,STK_PARM(r5)(r1); \ 58 - ld r6,STK_PARM(r6)(r1); \ 59 - ld r7,STK_PARM(r7)(r1); \ 60 - ld r8,STK_PARM(r8)(r1); \ 61 - ld r9,STK_PARM(r9)(r1); \ 62 - ld r10,STK_PARM(r10)(r1); \ 57 + ld r3,STK_PARAM(R3)(r1); \ 58 + ld r4,STK_PARAM(R4)(r1); \ 59 + ld r5,STK_PARAM(R5)(r1); \ 60 + ld r6,STK_PARAM(R6)(r1); \ 61 + ld r7,STK_PARAM(R7)(r1); \ 62 + ld r8,STK_PARAM(R8)(r1); \ 63 + ld r9,STK_PARAM(R9)(r1); \ 64 + ld r10,STK_PARAM(R10)(r1); \ 63 65 mtlr r0; \ 64 66 1: 65 67 ··· 77 79 cmpdi r12,0; \ 78 80 beq+ 1f; \ 79 81 mflr r0; \ 80 - ld r6,STK_PARM(r3)(r1); \ 81 - std r3,STK_PARM(r3)(r1); \ 82 + ld r6,STK_PARAM(R3)(r1); \ 83 + std r3,STK_PARAM(R3)(r1); \ 82 84 mr r4,r3; \ 83 85 mr r3,r6; \ 84 86 std r0,16(r1); \ ··· 86 88 bl .__trace_hcall_exit; \ 87 89 addi r1,r1,STACK_FRAME_OVERHEAD; \ 88 90 ld r0,16(r1); \ 89 - ld r3,STK_PARM(r3)(r1); \ 91 + ld r3,STK_PARAM(R3)(r1); \ 90 92 mtlr r0; \ 91 93 1: 92 94 ··· 112 114 mfcr r0 113 115 stw r0,8(r1) 114 116 115 - HCALL_INST_PRECALL(r4) 117 + HCALL_INST_PRECALL(R4) 116 118 117 119 HVSC /* invoke the hypervisor */ 118 120 ··· 128 130 mfcr r0 129 131 stw r0,8(r1) 130 132 131 - HCALL_INST_PRECALL(r5) 133 + HCALL_INST_PRECALL(R5) 132 134 133 - std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 135 + std r4,STK_PARAM(R4)(r1) /* Save ret buffer */ 134 136 135 137 mr r4,r5 136 138 mr r5,r6 ··· 141 143 142 144 HVSC /* invoke the hypervisor */ 143 145 144 - ld r12,STK_PARM(r4)(r1) 146 + ld r12,STK_PARAM(R4)(r1) 145 147 std r4, 0(r12) 146 148 std r5, 8(r12) 147 149 std r6, 16(r12) ··· 166 168 mfcr r0 167 169 stw r0,8(r1) 168 170 169 - std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 171 + std r4,STK_PARAM(R4)(r1) /* Save ret buffer */ 170 172 171 173 mr r4,r5 172 174 mr r5,r6 ··· 177 179 178 180 HVSC /* invoke the hypervisor */ 179 181 180 - ld r12,STK_PARM(r4)(r1) 182 + ld r12,STK_PARAM(R4)(r1) 181 183 std r4, 0(r12) 182 184 std r5, 8(r12) 183 185 std r6, 16(r12) ··· 194 196 mfcr r0 195 197 stw r0,8(r1) 196 198 197 - HCALL_INST_PRECALL(r5) 199 + HCALL_INST_PRECALL(R5) 198 200 199 - std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 201 + std r4,STK_PARAM(R4)(r1) /* Save ret buffer */ 200 202 201 203 mr r4,r5 202 204 mr r5,r6 ··· 204 206 mr r7,r8 205 207 mr r8,r9 206 208 mr r9,r10 207 - ld r10,STK_PARM(r11)(r1) /* put arg7 in R10 */ 208 - ld r11,STK_PARM(r12)(r1) /* put arg8 in R11 */ 209 - ld r12,STK_PARM(r13)(r1) /* put arg9 in R12 */ 209 + ld r10,STK_PARAM(R11)(r1) /* put arg7 in R10 */ 210 + ld r11,STK_PARAM(R12)(r1) /* put arg8 in R11 */ 211 + ld r12,STK_PARAM(R13)(r1) /* put arg9 in R12 */ 210 212 211 213 HVSC /* invoke the hypervisor */ 212 214 213 215 mr r0,r12 214 - ld r12,STK_PARM(r4)(r1) 216 + ld r12,STK_PARAM(R4)(r1) 215 217 std r4, 0(r12) 216 218 std r5, 8(r12) 217 219 std r6, 16(r12) ··· 236 238 mfcr r0 237 239 stw r0,8(r1) 238 240 239 - std r4,STK_PARM(r4)(r1) /* Save ret buffer */ 241 + std r4,STK_PARAM(R4)(r1) /* Save ret buffer */ 240 242 241 243 mr r4,r5 242 244 mr r5,r6 ··· 244 246 mr r7,r8 245 247 mr r8,r9 246 248 mr r9,r10 247 - ld r10,STK_PARM(r11)(r1) /* put arg7 in R10 */ 248 - ld r11,STK_PARM(r12)(r1) /* put arg8 in R11 */ 249 - ld r12,STK_PARM(r13)(r1) /* put arg9 in R12 */ 249 + ld r10,STK_PARAM(R11)(r1) /* put arg7 in R10 */ 250 + ld r11,STK_PARAM(R12)(r1) /* put arg8 in R11 */ 251 + ld r12,STK_PARAM(R13)(r1) /* put arg9 in R12 */ 250 252 251 253 HVSC /* invoke the hypervisor */ 252 254 253 255 mr r0,r12 254 - ld r12,STK_PARM(r4)(r1) 256 + ld r12,STK_PARAM(R4)(r1) 255 257 std r4, 0(r12) 256 258 std r5, 8(r12) 257 259 std r6, 16(r12)
+98 -15
arch/powerpc/platforms/pseries/iommu.c
··· 192 192 long l, limit; 193 193 long tcenum_start = tcenum, npages_start = npages; 194 194 int ret = 0; 195 + unsigned long flags; 195 196 196 197 if (npages == 1) { 197 198 return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, 198 199 direction, attrs); 199 200 } 201 + 202 + local_irq_save(flags); /* to protect tcep and the page behind it */ 200 203 201 204 tcep = __get_cpu_var(tce_page); 202 205 ··· 210 207 tcep = (u64 *)__get_free_page(GFP_ATOMIC); 211 208 /* If allocation fails, fall back to the loop implementation */ 212 209 if (!tcep) { 210 + local_irq_restore(flags); 213 211 return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr, 214 212 direction, attrs); 215 213 } ··· 243 239 npages -= limit; 244 240 tcenum += limit; 245 241 } while (npages > 0 && !rc); 242 + 243 + local_irq_restore(flags); 246 244 247 245 if (unlikely(rc == H_NOT_ENOUGH_RESOURCES)) { 248 246 ret = (int)rc; ··· 713 707 714 708 early_param("disable_ddw", disable_ddw_setup); 715 709 710 + static inline void __remove_ddw(struct device_node *np, const u32 *ddw_avail, u64 liobn) 711 + { 712 + int ret; 713 + 714 + ret = rtas_call(ddw_avail[2], 1, 1, NULL, liobn); 715 + if (ret) 716 + pr_warning("%s: failed to remove DMA window: rtas returned " 717 + "%d to ibm,remove-pe-dma-window(%x) %llx\n", 718 + np->full_name, ret, ddw_avail[2], liobn); 719 + else 720 + pr_debug("%s: successfully removed DMA window: rtas returned " 721 + "%d to ibm,remove-pe-dma-window(%x) %llx\n", 722 + np->full_name, ret, ddw_avail[2], liobn); 723 + } 724 + 716 725 static void remove_ddw(struct device_node *np) 717 726 { 718 727 struct dynamic_dma_window_prop *dwp; ··· 757 736 pr_debug("%s successfully cleared tces in window.\n", 758 737 np->full_name); 759 738 760 - ret = rtas_call(ddw_avail[2], 1, 1, NULL, liobn); 761 - if (ret) 762 - pr_warning("%s: failed to remove direct window: rtas returned " 763 - "%d to ibm,remove-pe-dma-window(%x) %llx\n", 764 - np->full_name, ret, ddw_avail[2], liobn); 765 - else 766 - pr_debug("%s: successfully removed direct window: rtas returned " 767 - "%d to ibm,remove-pe-dma-window(%x) %llx\n", 768 - np->full_name, ret, ddw_avail[2], liobn); 739 + __remove_ddw(np, ddw_avail, liobn); 769 740 770 741 delprop: 771 742 ret = prom_remove_property(np, win64); ··· 882 869 return ret; 883 870 } 884 871 872 + static void restore_default_window(struct pci_dev *dev, 873 + u32 ddw_restore_token, unsigned long liobn) 874 + { 875 + struct eeh_dev *edev; 876 + u32 cfg_addr; 877 + u64 buid; 878 + int ret; 879 + 880 + /* 881 + * Get the config address and phb buid of the PE window. 882 + * Rely on eeh to retrieve this for us. 883 + * Retrieve them from the pci device, not the node with the 884 + * dma-window property 885 + */ 886 + edev = pci_dev_to_eeh_dev(dev); 887 + cfg_addr = edev->config_addr; 888 + if (edev->pe_config_addr) 889 + cfg_addr = edev->pe_config_addr; 890 + buid = edev->phb->buid; 891 + 892 + do { 893 + ret = rtas_call(ddw_restore_token, 3, 1, NULL, cfg_addr, 894 + BUID_HI(buid), BUID_LO(buid)); 895 + } while (rtas_busy_delay(ret)); 896 + dev_info(&dev->dev, 897 + "ibm,reset-pe-dma-windows(%x) %x %x %x returned %d\n", 898 + ddw_restore_token, cfg_addr, BUID_HI(buid), BUID_LO(buid), ret); 899 + } 900 + 885 901 /* 886 902 * If the PE supports dynamic dma windows, and there is space for a table 887 903 * that can map all pages in a linear offset, then setup such a table, ··· 931 889 u64 dma_addr, max_addr; 932 890 struct device_node *dn; 933 891 const u32 *uninitialized_var(ddw_avail); 892 + const u32 *uninitialized_var(ddw_extensions); 893 + u32 ddw_restore_token = 0; 934 894 struct direct_window *window; 935 895 struct property *win64; 936 896 struct dynamic_dma_window_prop *ddwprop; 897 + const void *dma_window = NULL; 898 + unsigned long liobn, offset, size; 937 899 938 900 mutex_lock(&direct_window_init_mutex); 939 901 ··· 957 911 if (!ddw_avail || len < 3 * sizeof(u32)) 958 912 goto out_unlock; 959 913 960 - /* 914 + /* 915 + * the extensions property is only required to exist in certain 916 + * levels of firmware and later 917 + * the ibm,ddw-extensions property is a list with the first 918 + * element containing the number of extensions and each 919 + * subsequent entry is a value corresponding to that extension 920 + */ 921 + ddw_extensions = of_get_property(pdn, "ibm,ddw-extensions", &len); 922 + if (ddw_extensions) { 923 + /* 924 + * each new defined extension length should be added to 925 + * the top of the switch so the "earlier" entries also 926 + * get picked up 927 + */ 928 + switch (ddw_extensions[0]) { 929 + /* ibm,reset-pe-dma-windows */ 930 + case 1: 931 + ddw_restore_token = ddw_extensions[1]; 932 + break; 933 + } 934 + } 935 + 936 + /* 937 + * Only remove the existing DMA window if we can restore back to 938 + * the default state. Removing the existing window maximizes the 939 + * resources available to firmware for dynamic window creation. 940 + */ 941 + if (ddw_restore_token) { 942 + dma_window = of_get_property(pdn, "ibm,dma-window", NULL); 943 + of_parse_dma_window(pdn, dma_window, &liobn, &offset, &size); 944 + __remove_ddw(pdn, ddw_avail, liobn); 945 + } 946 + 947 + /* 961 948 * Query if there is a second window of size to map the 962 949 * whole partition. Query returns number of windows, largest 963 950 * block assigned to PE (partition endpoint), and two bitmasks ··· 999 920 dn = pci_device_to_OF_node(dev); 1000 921 ret = query_ddw(dev, ddw_avail, &query); 1001 922 if (ret != 0) 1002 - goto out_unlock; 923 + goto out_restore_window; 1003 924 1004 925 if (query.windows_available == 0) { 1005 926 /* ··· 1008 929 * trading in for a larger page size. 1009 930 */ 1010 931 dev_dbg(&dev->dev, "no free dynamic windows"); 1011 - goto out_unlock; 932 + goto out_restore_window; 1012 933 } 1013 934 if (query.page_size & 4) { 1014 935 page_shift = 24; /* 16MB */ ··· 1019 940 } else { 1020 941 dev_dbg(&dev->dev, "no supported direct page size in mask %x", 1021 942 query.page_size); 1022 - goto out_unlock; 943 + goto out_restore_window; 1023 944 } 1024 945 /* verify the window * number of ptes will map the partition */ 1025 946 /* check largest block * page size > max memory hotplug addr */ ··· 1028 949 dev_dbg(&dev->dev, "can't map partiton max 0x%llx with %u " 1029 950 "%llu-sized pages\n", max_addr, query.largest_available_block, 1030 951 1ULL << page_shift); 1031 - goto out_unlock; 952 + goto out_restore_window; 1032 953 } 1033 954 len = order_base_2(max_addr); 1034 955 win64 = kzalloc(sizeof(struct property), GFP_KERNEL); 1035 956 if (!win64) { 1036 957 dev_info(&dev->dev, 1037 958 "couldn't allocate property for 64bit dma window\n"); 1038 - goto out_unlock; 959 + goto out_restore_window; 1039 960 } 1040 961 win64->name = kstrdup(DIRECT64_PROPNAME, GFP_KERNEL); 1041 962 win64->value = ddwprop = kmalloc(sizeof(*ddwprop), GFP_KERNEL); ··· 1096 1017 kfree(win64->name); 1097 1018 kfree(win64->value); 1098 1019 kfree(win64); 1020 + 1021 + out_restore_window: 1022 + if (ddw_restore_token) 1023 + restore_default_window(dev, ddw_restore_token, liobn); 1099 1024 1100 1025 out_unlock: 1101 1026 mutex_unlock(&direct_window_init_mutex);
+1 -7
arch/powerpc/platforms/pseries/mobility.c
··· 67 67 const char *name, u32 vd, char *value) 68 68 { 69 69 struct property *new_prop = *prop; 70 - struct property *old_prop; 71 70 int more = 0; 72 71 73 72 /* A negative 'vd' value indicates that only part of the new property ··· 116 117 } 117 118 118 119 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 - 120 + prom_update_property(dn, new_prop); 125 121 new_prop = NULL; 126 122 } 127 123
+31 -5
arch/powerpc/platforms/pseries/processor_idle.c
··· 11 11 #include <linux/moduleparam.h> 12 12 #include <linux/cpuidle.h> 13 13 #include <linux/cpu.h> 14 + #include <linux/notifier.h> 14 15 15 16 #include <asm/paca.h> 16 17 #include <asm/reg.h> ··· 190 189 .enter = &shared_cede_loop }, 191 190 }; 192 191 193 - int pseries_notify_cpuidle_add_cpu(int cpu) 192 + static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n, 193 + unsigned long action, void *hcpu) 194 194 { 195 + int hotcpu = (unsigned long)hcpu; 195 196 struct cpuidle_device *dev = 196 - per_cpu_ptr(pseries_cpuidle_devices, cpu); 197 + per_cpu_ptr(pseries_cpuidle_devices, hotcpu); 198 + 197 199 if (dev && cpuidle_get_driver()) { 198 - cpuidle_disable_device(dev); 199 - cpuidle_enable_device(dev); 200 + switch (action) { 201 + case CPU_ONLINE: 202 + case CPU_ONLINE_FROZEN: 203 + cpuidle_pause_and_lock(); 204 + cpuidle_enable_device(dev); 205 + cpuidle_resume_and_unlock(); 206 + break; 207 + 208 + case CPU_DEAD: 209 + case CPU_DEAD_FROZEN: 210 + cpuidle_pause_and_lock(); 211 + cpuidle_disable_device(dev); 212 + cpuidle_resume_and_unlock(); 213 + break; 214 + 215 + default: 216 + return NOTIFY_DONE; 217 + } 200 218 } 201 - return 0; 219 + return NOTIFY_OK; 202 220 } 221 + 222 + static struct notifier_block setup_hotplug_notifier = { 223 + .notifier_call = pseries_cpuidle_add_cpu_notifier, 224 + }; 203 225 204 226 /* 205 227 * pseries_cpuidle_driver_init() ··· 348 324 return retval; 349 325 } 350 326 327 + register_cpu_notifier(&setup_hotplug_notifier); 351 328 printk(KERN_DEBUG "pseries_idle_driver registered\n"); 352 329 353 330 return 0; ··· 357 332 static void __exit pseries_processor_idle_exit(void) 358 333 { 359 334 335 + unregister_cpu_notifier(&setup_hotplug_notifier); 360 336 pseries_idle_devices_uninit(); 361 337 cpuidle_unregister_driver(&pseries_idle_driver); 362 338
+6 -10
arch/powerpc/platforms/pseries/reconfig.c
··· 432 432 unsigned char *value; 433 433 char *name, *end, *next_prop; 434 434 int rc, length; 435 - struct property *newprop, *oldprop; 435 + struct property *newprop; 436 436 buf = parse_node(buf, bufsize, &np); 437 437 end = buf + bufsize; 438 438 ··· 443 443 if (!next_prop) 444 444 return -EINVAL; 445 445 446 + if (!strlen(name)) 447 + return -ENODEV; 448 + 446 449 newprop = new_property(name, length, value, NULL); 447 450 if (!newprop) 448 451 return -ENOMEM; ··· 453 450 if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) 454 451 slb_set_size(*(int *)value); 455 452 456 - oldprop = of_find_property(np, name,NULL); 457 - if (!oldprop) { 458 - if (strlen(name)) 459 - return prom_add_property(np, newprop); 460 - return -ENODEV; 461 - } 462 - 463 453 upd_value.node = np; 464 454 upd_value.property = newprop; 465 455 pSeries_reconfig_notify(PSERIES_UPDATE_PROPERTY, &upd_value); 466 456 467 - rc = prom_update_property(np, newprop, oldprop); 457 + rc = prom_update_property(np, newprop); 468 458 if (rc) 469 459 return rc; 470 460 ··· 482 486 483 487 rc = pSeries_reconfig_notify(action, value); 484 488 if (rc) { 485 - prom_update_property(np, oldprop, newprop); 489 + prom_update_property(np, newprop); 486 490 return rc; 487 491 } 488 492 }
-1
arch/powerpc/platforms/pseries/smp.c
··· 147 147 set_cpu_current_state(cpu, CPU_STATE_ONLINE); 148 148 set_default_offline_state(cpu); 149 149 #endif 150 - pseries_notify_cpuidle_add_cpu(cpu); 151 150 } 152 151 153 152 static int __devinit smp_pSeries_kick_cpu(int nr)
+1 -1
arch/powerpc/sysdev/6xx-suspend.S
··· 29 29 ori r5, r5, ret_from_standby@l 30 30 mtlr r5 31 31 32 - rlwinm r5, r1, 0, 0, 31-THREAD_SHIFT 32 + CURRENT_THREAD_INFO(r5, r1) 33 33 lwz r6, TI_LOCAL_FLAGS(r5) 34 34 ori r6, r6, _TLF_SLEEPING 35 35 stw r6, TI_LOCAL_FLAGS(r5)
+71 -2
arch/powerpc/sysdev/fsl_pci.c
··· 1 1 /* 2 2 * MPC83xx/85xx/86xx PCI/PCIE support routing. 3 3 * 4 - * Copyright 2007-2011 Freescale Semiconductor, Inc. 4 + * Copyright 2007-2012 Freescale Semiconductor, Inc. 5 5 * Copyright 2008-2009 MontaVista Software, Inc. 6 6 * 7 7 * Initial author: Xianghua Xiao <x.xiao@freescale.com> ··· 36 36 37 37 static int fsl_pcie_bus_fixup, is_mpc83xx_pci; 38 38 39 - static void __init quirk_fsl_pcie_header(struct pci_dev *dev) 39 + static void __devinit quirk_fsl_pcie_header(struct pci_dev *dev) 40 40 { 41 41 u8 progif; 42 42 ··· 807 807 808 808 return 0; 809 809 } 810 + 811 + #if defined(CONFIG_FSL_SOC_BOOKE) || defined(CONFIG_PPC_86xx) 812 + static const struct of_device_id pci_ids[] = { 813 + { .compatible = "fsl,mpc8540-pci", }, 814 + { .compatible = "fsl,mpc8548-pcie", }, 815 + { .compatible = "fsl,mpc8610-pci", }, 816 + { .compatible = "fsl,mpc8641-pcie", }, 817 + { .compatible = "fsl,p1022-pcie", }, 818 + { .compatible = "fsl,p1010-pcie", }, 819 + { .compatible = "fsl,p1023-pcie", }, 820 + { .compatible = "fsl,p4080-pcie", }, 821 + { .compatible = "fsl,qoriq-pcie-v2.3", }, 822 + { .compatible = "fsl,qoriq-pcie-v2.2", }, 823 + {}, 824 + }; 825 + 826 + struct device_node *fsl_pci_primary; 827 + 828 + void __devinit fsl_pci_init(void) 829 + { 830 + struct device_node *node; 831 + struct pci_controller *hose; 832 + dma_addr_t max = 0xffffffff; 833 + 834 + /* Callers can specify the primary bus using other means. */ 835 + if (!fsl_pci_primary) { 836 + /* If a PCI host bridge contains an ISA node, it's primary. */ 837 + node = of_find_node_by_type(NULL, "isa"); 838 + while ((fsl_pci_primary = of_get_parent(node))) { 839 + of_node_put(node); 840 + node = fsl_pci_primary; 841 + 842 + if (of_match_node(pci_ids, node)) 843 + break; 844 + } 845 + } 846 + 847 + node = NULL; 848 + for_each_node_by_type(node, "pci") { 849 + if (of_match_node(pci_ids, node)) { 850 + /* 851 + * If there's no PCI host bridge with ISA, arbitrarily 852 + * designate one as primary. This can go away once 853 + * various bugs with primary-less systems are fixed. 854 + */ 855 + if (!fsl_pci_primary) 856 + fsl_pci_primary = node; 857 + 858 + fsl_add_bridge(node, fsl_pci_primary == node); 859 + hose = pci_find_hose_for_OF_device(node); 860 + max = min(max, hose->dma_window_base_cur + 861 + hose->dma_window_size); 862 + } 863 + } 864 + 865 + #ifdef CONFIG_SWIOTLB 866 + /* 867 + * if we couldn't map all of DRAM via the dma windows 868 + * we need SWIOTLB to handle buffers located outside of 869 + * dma capable memory region 870 + */ 871 + if (memblock_end_of_DRAM() - 1 > max) { 872 + ppc_swiotlb_enable = 1; 873 + set_pci_dma_ops(&swiotlb_dma_ops); 874 + ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb; 875 + } 876 + #endif 877 + } 878 + #endif
+8
arch/powerpc/sysdev/fsl_pci.h
··· 93 93 extern int mpc83xx_add_bridge(struct device_node *dev); 94 94 u64 fsl_pci_immrbar_base(struct pci_controller *hose); 95 95 96 + extern struct device_node *fsl_pci_primary; 97 + 98 + #ifdef CONFIG_FSL_PCI 99 + void fsl_pci_init(void); 100 + #else 101 + static inline void fsl_pci_init(void) {} 102 + #endif 103 + 96 104 #endif /* __POWERPC_FSL_PCI_H */ 97 105 #endif /* __KERNEL__ */
+2 -2
arch/powerpc/sysdev/mpic.c
··· 1211 1211 if (of_get_property(node, "single-cpu-affinity", NULL)) 1212 1212 flags |= MPIC_SINGLE_DEST_CPU; 1213 1213 if (of_device_is_compatible(node, "fsl,mpic")) 1214 - flags |= MPIC_FSL; 1214 + flags |= MPIC_FSL | MPIC_LARGE_VECTORS; 1215 1215 1216 1216 mpic = kzalloc(sizeof(struct mpic), GFP_KERNEL); 1217 1217 if (mpic == NULL) ··· 1376 1376 mpic->isu_mask = (1 << mpic->isu_shift) - 1; 1377 1377 1378 1378 mpic->irqhost = irq_domain_add_linear(mpic->node, 1379 - last_irq + 1, 1379 + intvec_top, 1380 1380 &mpic_host_ops, mpic); 1381 1381 1382 1382 /*
+3
arch/powerpc/sysdev/qe_lib/qe.c
··· 395 395 396 396 for (i = 0; i < be32_to_cpu(ucode->count); i++) 397 397 out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i])); 398 + 399 + /* Set I-RAM Ready Register */ 400 + out_be32(&qe_immr->iram.iready, be32_to_cpu(QE_IRAM_READY)); 398 401 } 399 402 400 403 /*
+10 -1
drivers/char/mem.c
··· 27 27 #include <linux/splice.h> 28 28 #include <linux/pfn.h> 29 29 #include <linux/export.h> 30 + #include <linux/io.h> 30 31 31 32 #include <asm/uaccess.h> 32 - #include <asm/io.h> 33 33 34 34 #ifdef CONFIG_IA64 35 35 # include <linux/efi.h> 36 36 #endif 37 + 38 + #define DEVPORT_MINOR 4 37 39 38 40 static inline unsigned long size_inside_page(unsigned long start, 39 41 unsigned long size) ··· 896 894 for (minor = 1; minor < ARRAY_SIZE(devlist); minor++) { 897 895 if (!devlist[minor].name) 898 896 continue; 897 + 898 + /* 899 + * Create /dev/port? 900 + */ 901 + if ((minor == DEVPORT_MINOR) && !arch_has_dev_port()) 902 + continue; 903 + 899 904 device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor), 900 905 NULL, devlist[minor].name); 901 906 }
+133 -24
drivers/i2c/busses/i2c-powermac.c
··· 227 227 return 0; 228 228 } 229 229 230 + static u32 __devinit i2c_powermac_get_addr(struct i2c_adapter *adap, 231 + struct pmac_i2c_bus *bus, 232 + struct device_node *node) 233 + { 234 + const __be32 *prop; 235 + int len; 236 + 237 + /* First check for valid "reg" */ 238 + prop = of_get_property(node, "reg", &len); 239 + if (prop && (len >= sizeof(int))) 240 + return (be32_to_cpup(prop) & 0xff) >> 1; 241 + 242 + /* Then check old-style "i2c-address" */ 243 + prop = of_get_property(node, "i2c-address", &len); 244 + if (prop && (len >= sizeof(int))) 245 + return (be32_to_cpup(prop) & 0xff) >> 1; 246 + 247 + /* Now handle some devices with missing "reg" properties */ 248 + if (!strcmp(node->name, "cereal")) 249 + return 0x60; 250 + else if (!strcmp(node->name, "deq")) 251 + return 0x34; 252 + 253 + dev_warn(&adap->dev, "No i2c address for %s\n", node->full_name); 254 + 255 + return 0xffffffff; 256 + } 257 + 258 + static void __devinit i2c_powermac_create_one(struct i2c_adapter *adap, 259 + const char *type, 260 + u32 addr) 261 + { 262 + struct i2c_board_info info = {}; 263 + struct i2c_client *newdev; 264 + 265 + strncpy(info.type, type, sizeof(info.type)); 266 + info.addr = addr; 267 + newdev = i2c_new_device(adap, &info); 268 + if (!newdev) 269 + dev_err(&adap->dev, 270 + "i2c-powermac: Failure to register missing %s\n", 271 + type); 272 + } 273 + 274 + static void __devinit i2c_powermac_add_missing(struct i2c_adapter *adap, 275 + struct pmac_i2c_bus *bus, 276 + bool found_onyx) 277 + { 278 + struct device_node *busnode = pmac_i2c_get_bus_node(bus); 279 + int rc; 280 + 281 + /* Check for the onyx audio codec */ 282 + #define ONYX_REG_CONTROL 67 283 + if (of_device_is_compatible(busnode, "k2-i2c") && !found_onyx) { 284 + union i2c_smbus_data data; 285 + 286 + rc = i2c_smbus_xfer(adap, 0x46, 0, I2C_SMBUS_READ, 287 + ONYX_REG_CONTROL, I2C_SMBUS_BYTE_DATA, 288 + &data); 289 + if (rc >= 0) 290 + i2c_powermac_create_one(adap, "MAC,pcm3052", 0x46); 291 + 292 + rc = i2c_smbus_xfer(adap, 0x47, 0, I2C_SMBUS_READ, 293 + ONYX_REG_CONTROL, I2C_SMBUS_BYTE_DATA, 294 + &data); 295 + if (rc >= 0) 296 + i2c_powermac_create_one(adap, "MAC,pcm3052", 0x47); 297 + } 298 + } 299 + 300 + static bool __devinit i2c_powermac_get_type(struct i2c_adapter *adap, 301 + struct device_node *node, 302 + u32 addr, char *type, int type_size) 303 + { 304 + char tmp[16]; 305 + 306 + /* Note: we to _NOT_ want the standard 307 + * i2c drivers to match with any of our powermac stuff 308 + * unless they have been specifically modified to handle 309 + * it on a case by case basis. For example, for thermal 310 + * control, things like lm75 etc... shall match with their 311 + * corresponding windfarm drivers, _NOT_ the generic ones, 312 + * so we force a prefix of AAPL, onto the modalias to 313 + * make that happen 314 + */ 315 + 316 + /* First try proper modalias */ 317 + if (of_modalias_node(node, tmp, sizeof(tmp)) >= 0) { 318 + snprintf(type, type_size, "MAC,%s", tmp); 319 + return true; 320 + } 321 + 322 + /* Now look for known workarounds */ 323 + if (!strcmp(node->name, "deq")) { 324 + /* Apple uses address 0x34 for TAS3001 and 0x35 for TAS3004 */ 325 + if (addr == 0x34) { 326 + snprintf(type, type_size, "MAC,tas3001"); 327 + return true; 328 + } else if (addr == 0x35) { 329 + snprintf(type, type_size, "MAC,tas3004"); 330 + return true; 331 + } 332 + } 333 + 334 + dev_err(&adap->dev, "i2c-powermac: modalias failure" 335 + " on %s\n", node->full_name); 336 + return false; 337 + } 338 + 230 339 static void __devinit i2c_powermac_register_devices(struct i2c_adapter *adap, 231 340 struct pmac_i2c_bus *bus) 232 341 { 233 342 struct i2c_client *newdev; 234 343 struct device_node *node; 344 + bool found_onyx = 0; 345 + 346 + /* 347 + * In some cases we end up with the via-pmu node itself, in this 348 + * case we skip this function completely as the device-tree will 349 + * not contain anything useful. 350 + */ 351 + if (!strcmp(adap->dev.of_node->name, "via-pmu")) 352 + return; 235 353 236 354 for_each_child_of_node(adap->dev.of_node, node) { 237 355 struct i2c_board_info info = {}; 238 - struct dev_archdata dev_ad = {}; 239 - const __be32 *reg; 240 - char tmp[16]; 241 356 u32 addr; 242 - int len; 243 357 244 358 /* Get address & channel */ 245 - reg = of_get_property(node, "reg", &len); 246 - if (!reg || (len < sizeof(int))) { 247 - dev_err(&adap->dev, "i2c-powermac: invalid reg on %s\n", 248 - node->full_name); 359 + addr = i2c_powermac_get_addr(adap, bus, node); 360 + if (addr == 0xffffffff) 249 361 continue; 250 - } 251 - addr = be32_to_cpup(reg); 252 362 253 363 /* Multibus setup, check channel */ 254 364 if (!pmac_i2c_match_adapter(node, adap)) ··· 367 257 dev_dbg(&adap->dev, "i2c-powermac: register %s\n", 368 258 node->full_name); 369 259 370 - /* Make up a modalias. Note: we to _NOT_ want the standard 371 - * i2c drivers to match with any of our powermac stuff 372 - * unless they have been specifically modified to handle 373 - * it on a case by case basis. For example, for thermal 374 - * control, things like lm75 etc... shall match with their 375 - * corresponding windfarm drivers, _NOT_ the generic ones, 376 - * so we force a prefix of AAPL, onto the modalias to 377 - * make that happen 260 + /* 261 + * Keep track of some device existence to handle 262 + * workarounds later. 378 263 */ 379 - if (of_modalias_node(node, tmp, sizeof(tmp)) < 0) { 380 - dev_err(&adap->dev, "i2c-powermac: modalias failure" 381 - " on %s\n", node->full_name); 264 + if (of_device_is_compatible(node, "pcm3052")) 265 + found_onyx = true; 266 + 267 + /* Make up a modalias */ 268 + if (!i2c_powermac_get_type(adap, node, addr, 269 + info.type, sizeof(info.type))) { 382 270 continue; 383 271 } 384 - snprintf(info.type, sizeof(info.type), "MAC,%s", tmp); 385 272 386 273 /* Fill out the rest of the info structure */ 387 - info.addr = (addr & 0xff) >> 1; 274 + info.addr = addr; 388 275 info.irq = irq_of_parse_and_map(node, 0); 389 276 info.of_node = of_node_get(node); 390 - info.archdata = &dev_ad; 391 277 392 278 newdev = i2c_new_device(adap, &info); 393 279 if (!newdev) { ··· 398 292 continue; 399 293 } 400 294 } 295 + 296 + /* Additional workarounds */ 297 + i2c_powermac_add_missing(adap, bus, found_onyx); 401 298 } 402 299 403 300 static int __devinit i2c_powermac_probe(struct platform_device *dev)
+11 -4
drivers/of/base.c
··· 1051 1051 } 1052 1052 1053 1053 /* 1054 - * prom_update_property - Update a property in a node. 1054 + * prom_update_property - Update a property in a node, if the property does 1055 + * not exist, add it. 1055 1056 * 1056 1057 * Note that we don't actually remove it, since we have given out 1057 1058 * who-knows-how-many pointers to the data using get-property. ··· 1060 1059 * and add the new property to the property list 1061 1060 */ 1062 1061 int prom_update_property(struct device_node *np, 1063 - struct property *newprop, 1064 - struct property *oldprop) 1062 + struct property *newprop) 1065 1063 { 1066 - struct property **next; 1064 + struct property **next, *oldprop; 1067 1065 unsigned long flags; 1068 1066 int found = 0; 1067 + 1068 + if (!newprop->name) 1069 + return -EINVAL; 1070 + 1071 + oldprop = of_find_property(np, newprop->name, NULL); 1072 + if (!oldprop) 1073 + return prom_add_property(np, newprop); 1069 1074 1070 1075 write_lock_irqsave(&devtree_lock, flags); 1071 1076 next = &np->properties;
+4 -4
drivers/watchdog/Kconfig
··· 1115 1115 config BOOKE_WDT_DEFAULT_TIMEOUT 1116 1116 int "PowerPC Book-E Watchdog Timer Default Timeout" 1117 1117 depends on BOOKE_WDT 1118 - default 38 if FSL_BOOKE 1119 - range 0 63 if FSL_BOOKE 1120 - default 3 if !FSL_BOOKE 1121 - range 0 3 if !FSL_BOOKE 1118 + default 38 if PPC_FSL_BOOK3E 1119 + range 0 63 if PPC_FSL_BOOK3E 1120 + default 3 if !PPC_FSL_BOOK3E 1121 + range 0 3 if !PPC_FSL_BOOK3E 1122 1122 help 1123 1123 Select the default watchdog timer period to be used by the PowerPC 1124 1124 Book-E watchdog driver. A watchdog "event" occurs when the bit
+2 -2
drivers/watchdog/booke_wdt.c
··· 37 37 u32 booke_wdt_enabled; 38 38 u32 booke_wdt_period = CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT; 39 39 40 - #ifdef CONFIG_FSL_BOOKE 40 + #ifdef CONFIG_PPC_FSL_BOOK3E 41 41 #define WDTP(x) ((((x)&0x3)<<30)|(((x)&0x3c)<<15)) 42 42 #define WDTP_MASK (WDTP(0x3f)) 43 43 #else ··· 190 190 case WDIOC_SETTIMEOUT: 191 191 if (get_user(tmp, p)) 192 192 return -EFAULT; 193 - #ifdef CONFIG_FSL_BOOKE 193 + #ifdef CONFIG_PPC_FSL_BOOK3E 194 194 /* period of 1 gives the largest possible timeout */ 195 195 if (tmp > period_to_sec(1)) 196 196 return -EINVAL;
+5
fs/proc/proc_devtree.c
··· 101 101 { 102 102 struct proc_dir_entry *ent; 103 103 104 + if (!oldprop) { 105 + proc_device_tree_add_prop(pde, newprop); 106 + return; 107 + } 108 + 104 109 for (ent = pde->subdir; ent != NULL; ent = ent->next) 105 110 if (ent->data == oldprop) 106 111 break;
+9
include/linux/io.h
··· 67 67 const unsigned char *signature, int length); 68 68 void devm_ioremap_release(struct device *dev, void *res); 69 69 70 + /* 71 + * Some systems do not have legacy ISA devices. 72 + * /dev/port is not a valid interface on these systems. 73 + * So for those archs, <asm/io.h> should define the following symbol. 74 + */ 75 + #ifndef arch_has_dev_port 76 + #define arch_has_dev_port() (1) 77 + #endif 78 + 70 79 #endif /* _LINUX_IO_H */
+1 -2
include/linux/of.h
··· 260 260 extern int prom_add_property(struct device_node* np, struct property* prop); 261 261 extern int prom_remove_property(struct device_node *np, struct property *prop); 262 262 extern int prom_update_property(struct device_node *np, 263 - struct property *newprop, 264 - struct property *oldprop); 263 + struct property *newprop); 265 264 266 265 #if defined(CONFIG_OF_DYNAMIC) 267 266 /* For updating the device tree at runtime */
+3 -72
sound/aoa/codecs/onyx.c
··· 997 997 onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx); 998 998 } 999 999 1000 - static int onyx_create(struct i2c_adapter *adapter, 1001 - struct device_node *node, 1002 - int addr) 1003 - { 1004 - struct i2c_board_info info; 1005 - struct i2c_client *client; 1006 - 1007 - memset(&info, 0, sizeof(struct i2c_board_info)); 1008 - strlcpy(info.type, "aoa_codec_onyx", I2C_NAME_SIZE); 1009 - info.addr = addr; 1010 - info.platform_data = node; 1011 - client = i2c_new_device(adapter, &info); 1012 - if (!client) 1013 - return -ENODEV; 1014 - 1015 - /* 1016 - * We know the driver is already loaded, so the device should be 1017 - * already bound. If not it means binding failed, which suggests 1018 - * the device doesn't really exist and should be deleted. 1019 - * Ideally this would be replaced by better checks _before_ 1020 - * instantiating the device. 1021 - */ 1022 - if (!client->driver) { 1023 - i2c_unregister_device(client); 1024 - return -ENODEV; 1025 - } 1026 - 1027 - /* 1028 - * Let i2c-core delete that device on driver removal. 1029 - * This is safe because i2c-core holds the core_lock mutex for us. 1030 - */ 1031 - list_add_tail(&client->detected, &client->driver->clients); 1032 - return 0; 1033 - } 1034 - 1035 1000 static int onyx_i2c_probe(struct i2c_client *client, 1036 1001 const struct i2c_device_id *id) 1037 1002 { 1038 - struct device_node *node = client->dev.platform_data; 1003 + struct device_node *node = client->dev.of_node; 1039 1004 struct onyx *onyx; 1040 1005 u8 dummy; 1041 1006 ··· 1036 1071 return -ENODEV; 1037 1072 } 1038 1073 1039 - static int onyx_i2c_attach(struct i2c_adapter *adapter) 1040 - { 1041 - struct device_node *busnode, *dev = NULL; 1042 - struct pmac_i2c_bus *bus; 1043 - 1044 - bus = pmac_i2c_adapter_to_bus(adapter); 1045 - if (bus == NULL) 1046 - return -ENODEV; 1047 - busnode = pmac_i2c_get_bus_node(bus); 1048 - 1049 - while ((dev = of_get_next_child(busnode, dev)) != NULL) { 1050 - if (of_device_is_compatible(dev, "pcm3052")) { 1051 - const u32 *addr; 1052 - printk(KERN_DEBUG PFX "found pcm3052\n"); 1053 - addr = of_get_property(dev, "reg", NULL); 1054 - if (!addr) 1055 - return -ENODEV; 1056 - return onyx_create(adapter, dev, (*addr)>>1); 1057 - } 1058 - } 1059 - 1060 - /* if that didn't work, try desperate mode for older 1061 - * machines that have stuff missing from the device tree */ 1062 - 1063 - if (!of_device_is_compatible(busnode, "k2-i2c")) 1064 - return -ENODEV; 1065 - 1066 - printk(KERN_DEBUG PFX "found k2-i2c, checking if onyx chip is on it\n"); 1067 - /* probe both possible addresses for the onyx chip */ 1068 - if (onyx_create(adapter, NULL, 0x46) == 0) 1069 - return 0; 1070 - return onyx_create(adapter, NULL, 0x47); 1071 - } 1072 - 1073 1074 static int onyx_i2c_remove(struct i2c_client *client) 1074 1075 { 1075 1076 struct onyx *onyx = i2c_get_clientdata(client); ··· 1048 1117 } 1049 1118 1050 1119 static const struct i2c_device_id onyx_i2c_id[] = { 1051 - { "aoa_codec_onyx", 0 }, 1120 + { "MAC,pcm3052", 0 }, 1052 1121 { } 1053 1122 }; 1123 + MODULE_DEVICE_TABLE(i2c,onyx_i2c_id); 1054 1124 1055 1125 static struct i2c_driver onyx_driver = { 1056 1126 .driver = { 1057 1127 .name = "aoa_codec_onyx", 1058 1128 .owner = THIS_MODULE, 1059 1129 }, 1060 - .attach_adapter = onyx_i2c_attach, 1061 1130 .probe = onyx_i2c_probe, 1062 1131 .remove = onyx_i2c_remove, 1063 1132 .id_table = onyx_i2c_id,
+3 -77
sound/aoa/codecs/tas.c
··· 883 883 } 884 884 885 885 886 - static int tas_create(struct i2c_adapter *adapter, 887 - struct device_node *node, 888 - int addr) 889 - { 890 - struct i2c_board_info info; 891 - struct i2c_client *client; 892 - 893 - memset(&info, 0, sizeof(struct i2c_board_info)); 894 - strlcpy(info.type, "aoa_codec_tas", I2C_NAME_SIZE); 895 - info.addr = addr; 896 - info.platform_data = node; 897 - 898 - client = i2c_new_device(adapter, &info); 899 - if (!client) 900 - return -ENODEV; 901 - /* 902 - * We know the driver is already loaded, so the device should be 903 - * already bound. If not it means binding failed, and then there 904 - * is no point in keeping the device instantiated. 905 - */ 906 - if (!client->driver) { 907 - i2c_unregister_device(client); 908 - return -ENODEV; 909 - } 910 - 911 - /* 912 - * Let i2c-core delete that device on driver removal. 913 - * This is safe because i2c-core holds the core_lock mutex for us. 914 - */ 915 - list_add_tail(&client->detected, &client->driver->clients); 916 - return 0; 917 - } 918 - 919 886 static int tas_i2c_probe(struct i2c_client *client, 920 887 const struct i2c_device_id *id) 921 888 { 922 - struct device_node *node = client->dev.platform_data; 889 + struct device_node *node = client->dev.of_node; 923 890 struct tas *tas; 924 891 925 892 tas = kzalloc(sizeof(struct tas), GFP_KERNEL); ··· 920 953 return -EINVAL; 921 954 } 922 955 923 - static int tas_i2c_attach(struct i2c_adapter *adapter) 924 - { 925 - struct device_node *busnode, *dev = NULL; 926 - struct pmac_i2c_bus *bus; 927 - 928 - bus = pmac_i2c_adapter_to_bus(adapter); 929 - if (bus == NULL) 930 - return -ENODEV; 931 - busnode = pmac_i2c_get_bus_node(bus); 932 - 933 - while ((dev = of_get_next_child(busnode, dev)) != NULL) { 934 - if (of_device_is_compatible(dev, "tas3004")) { 935 - const u32 *addr; 936 - printk(KERN_DEBUG PFX "found tas3004\n"); 937 - addr = of_get_property(dev, "reg", NULL); 938 - if (!addr) 939 - continue; 940 - return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f); 941 - } 942 - /* older machines have no 'codec' node with a 'compatible' 943 - * property that says 'tas3004', they just have a 'deq' 944 - * node without any such property... */ 945 - if (strcmp(dev->name, "deq") == 0) { 946 - const u32 *_addr; 947 - u32 addr; 948 - printk(KERN_DEBUG PFX "found 'deq' node\n"); 949 - _addr = of_get_property(dev, "i2c-address", NULL); 950 - if (!_addr) 951 - continue; 952 - addr = ((*_addr) >> 1) & 0x7f; 953 - /* now, if the address doesn't match any of the two 954 - * that a tas3004 can have, we cannot handle this. 955 - * I doubt it ever happens but hey. */ 956 - if (addr != 0x34 && addr != 0x35) 957 - continue; 958 - return tas_create(adapter, dev, addr); 959 - } 960 - } 961 - return -ENODEV; 962 - } 963 - 964 956 static int tas_i2c_remove(struct i2c_client *client) 965 957 { 966 958 struct tas *tas = i2c_get_clientdata(client); ··· 937 1011 } 938 1012 939 1013 static const struct i2c_device_id tas_i2c_id[] = { 940 - { "aoa_codec_tas", 0 }, 1014 + { "MAC,tas3004", 0 }, 941 1015 { } 942 1016 }; 1017 + MODULE_DEVICE_TABLE(i2c,tas_i2c_id); 943 1018 944 1019 static struct i2c_driver tas_driver = { 945 1020 .driver = { 946 1021 .name = "aoa_codec_tas", 947 1022 .owner = THIS_MODULE, 948 1023 }, 949 - .attach_adapter = tas_i2c_attach, 950 1024 .probe = tas_i2c_probe, 951 1025 .remove = tas_i2c_remove, 952 1026 .id_table = tas_i2c_id,