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 update from Benjamin Herrenschmidt:
"The main highlight is probably some base POWER8 support. There's more
to come such as transactional memory support but that will wait for
the next one.

Overall it's pretty quiet, or rather I've been pretty poor at picking
things up from patchwork and reviewing them this time around and Kumar
no better on the FSL side it seems..."

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (73 commits)
powerpc+of: Rename and fix OF reconfig notifier error inject module
powerpc: mpc5200: Add a3m071 board support
powerpc/512x: don't compile any platform DIU code if the DIU is not enabled
powerpc/mpc52xx: use module_platform_driver macro
powerpc+of: Export of_reconfig_notifier_[register,unregister]
powerpc/dma/raidengine: add raidengine device
powerpc/iommu/fsl: Add PAMU bypass enable register to ccsr_guts struct
powerpc/mpc85xx: Change spin table to cached memory
powerpc/fsl-pci: Add PCI controller ATMU PM support
powerpc/86xx: fsl_pcibios_fixup_bus requires CONFIG_PCI
drivers/virt: the Freescale hypervisor driver doesn't need to check MSR[GS]
powerpc/85xx: p1022ds: Use NULL instead of 0 for pointers
powerpc: Disable relocation on exceptions when kexecing
powerpc: Enable relocation on during exceptions at boot
powerpc: Move get_longbusy_msecs into hvcall.h and remove duplicate function
powerpc: Add wrappers to enable/disable relocation on exceptions
powerpc: Add set_mode hcall
powerpc: Setup relocation on exceptions for bare metal systems
powerpc: Move initial mfspr LPCR out of __init_LPCR
powerpc: Add relocation on exception vector handlers
...

+1545 -839
+81
Documentation/devicetree/bindings/powerpc/fsl/raideng.txt
··· 1 + * Freescale 85xx RAID Engine nodes 2 + 3 + RAID Engine nodes are defined to describe on-chip RAID accelerators. Each RAID 4 + Engine should have a separate node. 5 + 6 + Supported chips: 7 + P5020, P5040 8 + 9 + Required properties: 10 + 11 + - compatible: Should contain "fsl,raideng-v1.0" as the value 12 + This identifies RAID Engine block. 1 in 1.0 represents 13 + major number whereas 0 represents minor number. The 14 + version matches the hardware IP version. 15 + - reg: offset and length of the register set for the device 16 + - ranges: standard ranges property specifying the translation 17 + between child address space and parent address space 18 + 19 + Example: 20 + /* P5020 */ 21 + raideng: raideng@320000 { 22 + compatible = "fsl,raideng-v1.0"; 23 + #address-cells = <1>; 24 + #size-cells = <1>; 25 + reg = <0x320000 0x10000>; 26 + ranges = <0 0x320000 0x10000>; 27 + }; 28 + 29 + 30 + There must be a sub-node for each job queue present in RAID Engine 31 + This node must be a sub-node of the main RAID Engine node 32 + 33 + - compatible: Should contain "fsl,raideng-v1.0-job-queue" as the value 34 + This identifies the job queue interface 35 + - reg: offset and length of the register set for job queue 36 + - ranges: standard ranges property specifying the translation 37 + between child address space and parent address space 38 + 39 + Example: 40 + /* P5020 */ 41 + raideng_jq0@1000 { 42 + compatible = "fsl,raideng-v1.0-job-queue"; 43 + reg = <0x1000 0x1000>; 44 + ranges = <0x0 0x1000 0x1000>; 45 + }; 46 + 47 + 48 + There must be a sub-node for each job ring present in RAID Engine 49 + This node must be a sub-node of job queue node 50 + 51 + - compatible: Must contain "fsl,raideng-v1.0-job-ring" as the value 52 + This identifies job ring. Should contain either 53 + "fsl,raideng-v1.0-hp-ring" or "fsl,raideng-v1.0-lp-ring" 54 + depending upon whether ring has high or low priority 55 + - reg: offset and length of the register set for job ring 56 + - interrupts: interrupt mapping for job ring IRQ 57 + 58 + Optional property: 59 + 60 + - fsl,liodn: Specifies the LIODN to be used for Job Ring. This 61 + property is normally set by firmware. Value 62 + is of 12-bits which is the LIODN number for this JR. 63 + This property is used by the IOMMU (PAMU) to distinquish 64 + transactions from this JR and than be able to do address 65 + translation & protection accordingly. 66 + 67 + Example: 68 + /* P5020 */ 69 + raideng_jq0@1000 { 70 + compatible = "fsl,raideng-v1.0-job-queue"; 71 + reg = <0x1000 0x1000>; 72 + ranges = <0x0 0x1000 0x1000>; 73 + 74 + raideng_jr0: jr@0 { 75 + compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; 76 + reg = <0x0 0x400>; 77 + interrupts = <139 2 0 0>; 78 + interrupt-parent = <&mpic>; 79 + fsl,liodn = <0x41>; 80 + }; 81 + };
+16
Documentation/powerpc/ptrace.txt
··· 127 127 p.addr2 = (uint64_t) end_range; 128 128 p.condition_value = 0; 129 129 130 + - set a watchpoint in server processors (BookS) 131 + 132 + p.version = 1; 133 + p.trigger_type = PPC_BREAKPOINT_TRIGGER_RW; 134 + p.addr_mode = PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE; 135 + or 136 + p.addr_mode = PPC_BREAKPOINT_MODE_EXACT; 137 + 138 + p.condition_mode = PPC_BREAKPOINT_CONDITION_NONE; 139 + p.addr = (uint64_t) begin_range; 140 + /* For PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE addr2 needs to be specified, where 141 + * addr2 - addr <= 8 Bytes. 142 + */ 143 + p.addr2 = (uint64_t) end_range; 144 + p.condition_value = 0; 145 + 130 146 3. PTRACE_DELHWDEBUG 131 147 132 148 Takes an integer which identifies an existing breakpoint or watchpoint
+1 -1
arch/arm/mach-mxs/mach-mxs.c
··· 240 240 macaddr[4] = (val >> 8) & 0xff; 241 241 macaddr[5] = (val >> 0) & 0xff; 242 242 243 - prom_update_property(np, newmac); 243 + of_update_property(np, newmac); 244 244 } 245 245 } 246 246
+1 -1
arch/powerpc/Makefile
··· 181 181 bootwrapper_install: 182 182 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 183 183 184 - %.dtb: 184 + %.dtb: scripts 185 185 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) 186 186 187 187 define archhelp
+144
arch/powerpc/boot/dts/a3m071.dts
··· 1 + /* 2 + * a3m071 board Device Tree Source 3 + * 4 + * Copyright 2012 Stefan Roese <sr@denx.de> 5 + * 6 + * Copyright (C) 2011 DENX Software Engineering GmbH 7 + * Heiko Schocher <hs@denx.de> 8 + * 9 + * Copyright (C) 2007 Semihalf 10 + * Marian Balakowicz <m8@semihalf.com> 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/ "mpc5200b.dtsi" 19 + 20 + / { 21 + model = "anonymous,a3m071"; 22 + compatible = "anonymous,a3m071"; 23 + 24 + soc5200@f0000000 { 25 + #address-cells = <1>; 26 + #size-cells = <1>; 27 + compatible = "fsl,mpc5200b-immr"; 28 + ranges = <0 0xf0000000 0x0000c000>; 29 + reg = <0xf0000000 0x00000100>; 30 + bus-frequency = <0>; /* From boot loader */ 31 + system-frequency = <0>; /* From boot loader */ 32 + 33 + timer@600 { 34 + fsl,has-wdt; 35 + }; 36 + 37 + spi@f00 { 38 + status = "disabled"; 39 + }; 40 + 41 + usb: usb@1000 { 42 + status = "disabled"; 43 + }; 44 + 45 + psc@2000 { 46 + compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 47 + reg = <0x2000 0x100>; 48 + interrupts = <2 1 0>; 49 + }; 50 + 51 + psc@2200 { 52 + status = "disabled"; 53 + }; 54 + 55 + psc@2400 { 56 + status = "disabled"; 57 + }; 58 + 59 + psc@2600 { 60 + status = "disabled"; 61 + }; 62 + 63 + psc@2800 { 64 + status = "disabled"; 65 + }; 66 + 67 + psc@2c00 { // PSC6 68 + compatible = "fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart"; 69 + reg = <0x2c00 0x100>; 70 + interrupts = <2 4 0>; 71 + }; 72 + 73 + ethernet@3000 { 74 + phy-handle = <&phy0>; 75 + }; 76 + 77 + mdio@3000 { 78 + phy0: ethernet-phy@3 { 79 + reg = <0x03>; 80 + }; 81 + }; 82 + 83 + ata@3a00 { 84 + status = "disabled"; 85 + }; 86 + 87 + i2c@3d00 { 88 + status = "disabled"; 89 + }; 90 + 91 + i2c@3d40 { 92 + status = "disabled"; 93 + }; 94 + }; 95 + 96 + localbus { 97 + compatible = "fsl,mpc5200b-lpb","simple-bus"; 98 + #address-cells = <2>; 99 + #size-cells = <1>; 100 + ranges = <0 0 0xfc000000 0x02000000 101 + 3 0 0xe9000000 0x00080000 102 + 5 0 0xe8000000 0x00010000>; 103 + 104 + flash@0,0 { 105 + #address-cells = <1>; 106 + #size-cells = <1>; 107 + reg = <0 0x0 0x02000000>; 108 + compatible = "cfi-flash"; 109 + bank-width = <2>; 110 + partition@0x0 { 111 + label = "u-boot"; 112 + reg = <0x00000000 0x00040000>; 113 + read-only; 114 + }; 115 + partition@0x00040000 { 116 + label = "env"; 117 + reg = <0x00040000 0x00020000>; 118 + }; 119 + partition@0x00060000 { 120 + label = "dtb"; 121 + reg = <0x00060000 0x00020000>; 122 + }; 123 + partition@0x00080000 { 124 + label = "kernel"; 125 + reg = <0x00080000 0x00500000>; 126 + }; 127 + partition@0x00580000 { 128 + label = "root"; 129 + reg = <0x00580000 0x00A80000>; 130 + }; 131 + }; 132 + 133 + fpga@3,0 { 134 + compatible = "anonymous,a3m071-fpga"; 135 + reg = <3 0x0 0x00080000 136 + 5 0x0 0x00010000>; 137 + interrupts = <0 0 3>; /* level low */ 138 + }; 139 + }; 140 + 141 + pci@f0000d00 { 142 + status = "disabled"; 143 + }; 144 + };
+1
arch/powerpc/boot/dts/fsl/p5020si-post.dtsi
··· 354 354 /include/ "qoriq-sata2-0.dtsi" 355 355 /include/ "qoriq-sata2-1.dtsi" 356 356 /include/ "qoriq-sec4.2-0.dtsi" 357 + /include/ "qoriq-raid1.0-0.dtsi" 357 358 };
+6
arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi
··· 73 73 rtic_c = &rtic_c; 74 74 rtic_d = &rtic_d; 75 75 sec_mon = &sec_mon; 76 + 77 + raideng = &raideng; 78 + raideng_jr0 = &raideng_jr0; 79 + raideng_jr1 = &raideng_jr1; 80 + raideng_jr2 = &raideng_jr2; 81 + raideng_jr3 = &raideng_jr3; 76 82 }; 77 83 78 84 cpus {
+85
arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi
··· 1 + /* 2 + * QorIQ RAID 1.0 device tree stub [ controller @ offset 0x320000 ] 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 + raideng: raideng@320000 { 36 + compatible = "fsl,raideng-v1.0"; 37 + #address-cells = <1>; 38 + #size-cells = <1>; 39 + reg = <0x320000 0x10000>; 40 + ranges = <0 0x320000 0x10000>; 41 + 42 + raideng_jq0@1000 { 43 + compatible = "fsl,raideng-v1.0-job-queue"; 44 + #address-cells = <1>; 45 + #size-cells = <1>; 46 + reg = <0x1000 0x1000>; 47 + ranges = <0x0 0x1000 0x1000>; 48 + 49 + raideng_jr0: jr@0 { 50 + compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; 51 + reg = <0x0 0x400>; 52 + interrupts = <139 2 0 0>; 53 + interrupt-parent = <&mpic>; 54 + }; 55 + 56 + raideng_jr1: jr@400 { 57 + compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-lp-ring"; 58 + reg = <0x400 0x400>; 59 + interrupts = <140 2 0 0>; 60 + interrupt-parent = <&mpic>; 61 + }; 62 + }; 63 + 64 + raideng_jq1@2000 { 65 + compatible = "fsl,raideng-v1.0-job-queue"; 66 + #address-cells = <1>; 67 + #size-cells = <1>; 68 + reg = <0x2000 0x1000>; 69 + ranges = <0x0 0x2000 0x1000>; 70 + 71 + raideng_jr2: jr@0 { 72 + compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-hp-ring"; 73 + reg = <0x0 0x400>; 74 + interrupts = <141 2 0 0>; 75 + interrupt-parent = <&mpic>; 76 + }; 77 + 78 + raideng_jr3: jr@400 { 79 + compatible = "fsl,raideng-v1.0-job-ring", "fsl,raideng-v1.0-lp-ring"; 80 + reg = <0x400 0x400>; 81 + interrupts = <142 2 0 0>; 82 + interrupt-parent = <&mpic>; 83 + }; 84 + }; 85 + };
+1 -1
arch/powerpc/configs/pseries_defconfig
··· 2 2 CONFIG_ALTIVEC=y 3 3 CONFIG_VSX=y 4 4 CONFIG_SMP=y 5 - CONFIG_NR_CPUS=1024 5 + CONFIG_NR_CPUS=2048 6 6 CONFIG_EXPERIMENTAL=y 7 7 CONFIG_SYSVIPC=y 8 8 CONFIG_POSIX_MQUEUE=y
+10 -65
arch/powerpc/include/asm/bitops.h
··· 52 52 #define smp_mb__before_clear_bit() smp_mb() 53 53 #define smp_mb__after_clear_bit() smp_mb() 54 54 55 - #define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) 56 - #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG) 57 55 #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) 58 56 59 57 /* Macro for generating the ***_bits() functions */ ··· 81 83 82 84 static __inline__ void set_bit(int nr, volatile unsigned long *addr) 83 85 { 84 - set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); 86 + set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); 85 87 } 86 88 87 89 static __inline__ void clear_bit(int nr, volatile unsigned long *addr) 88 90 { 89 - clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); 91 + clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); 90 92 } 91 93 92 94 static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) 93 95 { 94 - clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr)); 96 + clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr)); 95 97 } 96 98 97 99 static __inline__ void change_bit(int nr, volatile unsigned long *addr) 98 100 { 99 - change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); 101 + change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); 100 102 } 101 103 102 104 /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output ··· 134 136 static __inline__ int test_and_set_bit(unsigned long nr, 135 137 volatile unsigned long *addr) 136 138 { 137 - return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; 139 + return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; 138 140 } 139 141 140 142 static __inline__ int test_and_set_bit_lock(unsigned long nr, 141 143 volatile unsigned long *addr) 142 144 { 143 - return test_and_set_bits_lock(BITOP_MASK(nr), 144 - addr + BITOP_WORD(nr)) != 0; 145 + return test_and_set_bits_lock(BIT_MASK(nr), 146 + addr + BIT_WORD(nr)) != 0; 145 147 } 146 148 147 149 static __inline__ int test_and_clear_bit(unsigned long nr, 148 150 volatile unsigned long *addr) 149 151 { 150 - return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; 152 + return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; 151 153 } 152 154 153 155 static __inline__ int test_and_change_bit(unsigned long nr, 154 156 volatile unsigned long *addr) 155 157 { 156 - return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; 158 + return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; 157 159 } 158 160 159 161 #include <asm-generic/bitops/non-atomic.h> ··· 278 280 #include <asm-generic/bitops/find.h> 279 281 280 282 /* Little-endian versions */ 283 + #include <asm-generic/bitops/le.h> 281 284 282 - static __inline__ int test_bit_le(unsigned long nr, 283 - __const__ void *addr) 284 - { 285 - __const__ unsigned char *tmp = (__const__ unsigned char *) addr; 286 - return (tmp[nr >> 3] >> (nr & 7)) & 1; 287 - } 288 - 289 - static inline void set_bit_le(int nr, void *addr) 290 - { 291 - set_bit(nr ^ BITOP_LE_SWIZZLE, addr); 292 - } 293 - 294 - static inline void clear_bit_le(int nr, void *addr) 295 - { 296 - clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); 297 - } 298 - 299 - static inline void __set_bit_le(int nr, void *addr) 300 - { 301 - __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); 302 - } 303 - 304 - static inline void __clear_bit_le(int nr, void *addr) 305 - { 306 - __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); 307 - } 308 - 309 - static inline int test_and_set_bit_le(int nr, void *addr) 310 - { 311 - return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); 312 - } 313 - 314 - static inline int test_and_clear_bit_le(int nr, void *addr) 315 - { 316 - return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); 317 - } 318 - 319 - static inline int __test_and_set_bit_le(int nr, void *addr) 320 - { 321 - return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); 322 - } 323 - 324 - static inline int __test_and_clear_bit_le(int nr, void *addr) 325 - { 326 - return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); 327 - } 328 - 329 - #define find_first_zero_bit_le(addr, size) \ 330 - find_next_zero_bit_le((addr), (size), 0) 331 - unsigned long find_next_zero_bit_le(const void *addr, 332 - unsigned long size, unsigned long offset); 333 - 334 - unsigned long find_next_bit_le(const void *addr, 335 - unsigned long size, unsigned long offset); 336 285 /* Bitmap functions for the ext2 filesystem */ 337 286 338 287 #include <asm-generic/bitops/ext2-atomic-setbit.h>
+10 -2
arch/powerpc/include/asm/cputable.h
··· 401 401 CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ 402 402 CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 403 403 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY) 404 + #define CPU_FTRS_POWER8 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 405 + CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | CPU_FTR_ARCH_206 |\ 406 + CPU_FTR_MMCRA | CPU_FTR_SMT | \ 407 + CPU_FTR_COHERENT_ICACHE | \ 408 + CPU_FTR_PURR | CPU_FTR_SPURR | CPU_FTR_REAL_LE | \ 409 + CPU_FTR_DSCR | CPU_FTR_SAO | \ 410 + CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ 411 + CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY) 404 412 #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ 405 413 CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ 406 414 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ ··· 429 421 #define CPU_FTRS_POSSIBLE \ 430 422 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 431 423 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 432 - CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ 433 - CPU_FTR_VSX) 424 + CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL | \ 425 + CPU_FTRS_PA6T | CPU_FTR_VSX) 434 426 #endif 435 427 #else 436 428 enum {
+1 -1
arch/powerpc/include/asm/dbell.h
··· 1 1 /* 2 - * Copyright 2009 Freescale Semicondutor, Inc. 2 + * Copyright 2009 Freescale Semiconductor, Inc. 3 3 * 4 4 * This program is free software; you can redistribute it and/or 5 5 * modify it under the terms of the GNU General Public License
+95 -2
arch/powerpc/include/asm/exception-64s.h
··· 48 48 #define EX_LR 72 49 49 #define EX_CFAR 80 50 50 51 + #ifdef CONFIG_RELOCATABLE 52 + #define EXCEPTION_RELON_PROLOG_PSERIES_1(label, h) \ 53 + ld r12,PACAKBASE(r13); /* get high part of &label */ \ 54 + mfspr r11,SPRN_##h##SRR0; /* save SRR0 */ \ 55 + LOAD_HANDLER(r12,label); \ 56 + mtlr r12; \ 57 + mfspr r12,SPRN_##h##SRR1; /* and SRR1 */ \ 58 + li r10,MSR_RI; \ 59 + mtmsrd r10,1; /* Set RI (EE=0) */ \ 60 + blr; 61 + #else 62 + /* If not relocatable, we can jump directly -- and save messing with LR */ 63 + #define EXCEPTION_RELON_PROLOG_PSERIES_1(label, h) \ 64 + mfspr r11,SPRN_##h##SRR0; /* save SRR0 */ \ 65 + mfspr r12,SPRN_##h##SRR1; /* and SRR1 */ \ 66 + li r10,MSR_RI; \ 67 + mtmsrd r10,1; /* Set RI (EE=0) */ \ 68 + b label; 69 + #endif 70 + 71 + /* 72 + * As EXCEPTION_PROLOG_PSERIES(), except we've already got relocation on 73 + * so no need to rfid. Save lr in case we're CONFIG_RELOCATABLE, in which 74 + * case EXCEPTION_RELON_PROLOG_PSERIES_1 will be using lr. 75 + */ 76 + #define EXCEPTION_RELON_PROLOG_PSERIES(area, label, h, extra, vec) \ 77 + EXCEPTION_PROLOG_1(area, extra, vec); \ 78 + EXCEPTION_RELON_PROLOG_PSERIES_1(label, h) 79 + 51 80 /* 52 81 * We're short on space and time in the exception prolog, so we can't 53 82 * use the normal SET_REG_IMMEDIATE macro. Normally we just need the ··· 84 55 * word. 85 56 */ 86 57 #define LOAD_HANDLER(reg, label) \ 87 - addi reg,reg,(label)-_stext; /* virt addr of handler ... */ 58 + /* Handlers must be within 64K of kbase, which must be 64k aligned */ \ 59 + ori reg,reg,(label)-_stext; /* virt addr of handler ... */ 88 60 89 61 /* Exception register prefixes */ 90 62 #define EXC_HV H 91 63 #define EXC_STD 64 + 65 + #if defined(CONFIG_RELOCATABLE) 66 + /* 67 + * If we support interrupts with relocation on AND we're a relocatable 68 + * kernel, we need to use LR to get to the 2nd level handler. So, save/restore 69 + * it when required. 70 + */ 71 + #define SAVE_LR(reg, area) mflr reg ; std reg,area+EX_LR(r13) 72 + #define GET_LR(reg, area) ld reg,area+EX_LR(r13) 73 + #define RESTORE_LR(reg, area) ld reg,area+EX_LR(r13) ; mtlr reg 74 + #else 75 + /* ...else LR is unused and in register. */ 76 + #define SAVE_LR(reg, area) 77 + #define GET_LR(reg, area) mflr reg 78 + #define RESTORE_LR(reg, area) 79 + #endif 92 80 93 81 #define __EXCEPTION_PROLOG_1(area, extra, vec) \ 94 82 GET_PACA(r13); \ ··· 115 69 mfspr r10,SPRN_CFAR; \ 116 70 std r10,area+EX_CFAR(r13); \ 117 71 END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \ 72 + SAVE_LR(r10, area); \ 118 73 mfcr r9; \ 119 74 extra(vec); \ 120 75 std r11,area+EX_R11(r13); \ ··· 216 169 sth r1,PACA_TRAP_SAVE(r13); \ 217 170 std r3,area+EX_R3(r13); \ 218 171 addi r3,r13,area; /* r3 -> where regs are saved*/ \ 172 + RESTORE_LR(r1, area); \ 219 173 b bad_stack; \ 220 174 3: std r9,_CCR(r1); /* save CR in stackframe */ \ 221 175 std r11,_NIP(r1); /* save SRR0 in stackframe */ \ ··· 242 194 ld r10,area+EX_CFAR(r13); \ 243 195 std r10,ORIG_GPR3(r1); \ 244 196 END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \ 197 + GET_LR(r9,area); /* Get LR, later save to stack */ \ 245 198 ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ 246 - mflr r9; /* save LR in stackframe */ \ 247 199 std r9,_LINK(r1); \ 248 200 mfctr r10; /* save CTR in stackframe */ \ 249 201 std r10,_CTR(r1); \ ··· 280 232 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ 281 233 EXC_HV, KVMTEST, vec) 282 234 235 + #define STD_RELON_EXCEPTION_PSERIES(loc, vec, label) \ 236 + . = loc; \ 237 + .globl label##_relon_pSeries; \ 238 + label##_relon_pSeries: \ 239 + HMT_MEDIUM; \ 240 + /* No guest interrupts come through here */ \ 241 + SET_SCRATCH0(r13); /* save r13 */ \ 242 + EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ 243 + EXC_STD, KVMTEST_PR, vec) 244 + 245 + #define STD_RELON_EXCEPTION_HV(loc, vec, label) \ 246 + . = loc; \ 247 + .globl label##_relon_hv; \ 248 + label##_relon_hv: \ 249 + HMT_MEDIUM; \ 250 + /* No guest interrupts come through here */ \ 251 + SET_SCRATCH0(r13); /* save r13 */ \ 252 + EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ 253 + EXC_HV, KVMTEST, vec) 254 + 283 255 /* This associate vector numbers with bits in paca->irq_happened */ 284 256 #define SOFTEN_VALUE_0x500 PACA_IRQ_EE 285 257 #define SOFTEN_VALUE_0x502 PACA_IRQ_EE ··· 325 257 KVMTEST(vec); \ 326 258 _SOFTEN_TEST(EXC_STD, vec) 327 259 260 + #define SOFTEN_NOTEST_PR(vec) _SOFTEN_TEST(EXC_STD, vec) 261 + #define SOFTEN_NOTEST_HV(vec) _SOFTEN_TEST(EXC_HV, vec) 262 + 328 263 #define __MASKABLE_EXCEPTION_PSERIES(vec, label, h, extra) \ 329 264 HMT_MEDIUM; \ 330 265 SET_SCRATCH0(r13); /* save r13 */ \ ··· 349 278 label##_hv: \ 350 279 _MASKABLE_EXCEPTION_PSERIES(vec, label, \ 351 280 EXC_HV, SOFTEN_TEST_HV) 281 + 282 + #define __MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) \ 283 + HMT_MEDIUM; \ 284 + SET_SCRATCH0(r13); /* save r13 */ \ 285 + __EXCEPTION_PROLOG_1(PACA_EXGEN, extra, vec); \ 286 + EXCEPTION_RELON_PROLOG_PSERIES_1(label##_common, h); 287 + #define _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) \ 288 + __MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) 289 + 290 + #define MASKABLE_RELON_EXCEPTION_PSERIES(loc, vec, label) \ 291 + . = loc; \ 292 + .globl label##_relon_pSeries; \ 293 + label##_relon_pSeries: \ 294 + _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, \ 295 + EXC_STD, SOFTEN_NOTEST_PR) 296 + 297 + #define MASKABLE_RELON_EXCEPTION_HV(loc, vec, label) \ 298 + . = loc; \ 299 + .globl label##_relon_hv; \ 300 + label##_relon_hv: \ 301 + _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, \ 302 + EXC_HV, SOFTEN_NOTEST_HV) 352 303 353 304 /* 354 305 * Our exception common code can be passed various "additions"
+3 -1
arch/powerpc/include/asm/firmware.h
··· 49 49 #define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) 50 50 #define FW_FEATURE_OPAL ASM_CONST(0x0000000010000000) 51 51 #define FW_FEATURE_OPALv2 ASM_CONST(0x0000000020000000) 52 + #define FW_FEATURE_SET_MODE ASM_CONST(0x0000000040000000) 52 53 53 54 #ifndef __ASSEMBLY__ 54 55 ··· 63 62 FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | 64 63 FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR | 65 64 FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | 66 - FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO, 65 + FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO | 66 + FW_FEATURE_SET_MODE, 67 67 FW_FEATURE_PSERIES_ALWAYS = 0, 68 68 FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2, 69 69 FW_FEATURE_POWERNV_ALWAYS = 0,
+1 -1
arch/powerpc/include/asm/fsl_gtm.h
··· 1 1 /* 2 2 * Freescale General-purpose Timers Module 3 3 * 4 - * Copyright (c) Freescale Semicondutor, Inc. 2006. 4 + * Copyright 2006 Freescale Semiconductor, Inc. 5 5 * Shlomi Gridish <gridish@freescale.com> 6 6 * Jerry Huang <Chang-Ming.Huang@freescale.com> 7 7 * Copyright (c) MontaVista Software, Inc. 2008.
+3 -1
arch/powerpc/include/asm/fsl_guts.h
··· 71 71 u8 res0c4[0x224 - 0xc4]; 72 72 __be32 iodelay1; /* 0x.0224 - IO delay control register 1 */ 73 73 __be32 iodelay2; /* 0x.0228 - IO delay control register 2 */ 74 - u8 res22c[0x800 - 0x22c]; 74 + u8 res22c[0x604 - 0x22c]; 75 + __be32 pamubypenr; /* 0x.604 - PAMU bypass enable register */ 76 + u8 res608[0x800 - 0x608]; 75 77 __be32 clkdvdr; /* 0x.0800 - Clock Divide Register */ 76 78 u8 res804[0x900 - 0x804]; 77 79 __be32 ircr; /* 0x.0900 - Infrared Control Register */
+22 -1
arch/powerpc/include/asm/hvcall.h
··· 267 267 #define H_RANDOM 0x300 268 268 #define H_COP 0x304 269 269 #define H_GET_MPP_X 0x314 270 - #define MAX_HCALL_OPCODE H_GET_MPP_X 270 + #define H_SET_MODE 0x31C 271 + #define MAX_HCALL_OPCODE H_SET_MODE 271 272 272 273 #ifndef __ASSEMBLY__ 273 274 ··· 355 354 }; 356 355 357 356 int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data); 357 + 358 + static inline unsigned int get_longbusy_msecs(int longbusy_rc) 359 + { 360 + switch (longbusy_rc) { 361 + case H_LONG_BUSY_ORDER_1_MSEC: 362 + return 1; 363 + case H_LONG_BUSY_ORDER_10_MSEC: 364 + return 10; 365 + case H_LONG_BUSY_ORDER_100_MSEC: 366 + return 100; 367 + case H_LONG_BUSY_ORDER_1_SEC: 368 + return 1000; 369 + case H_LONG_BUSY_ORDER_10_SEC: 370 + return 10000; 371 + case H_LONG_BUSY_ORDER_100_SEC: 372 + return 100000; 373 + default: 374 + return 1; 375 + } 376 + } 358 377 359 378 #ifdef CONFIG_PPC_PSERIES 360 379 extern int CMO_PrPSP;
+1 -1
arch/powerpc/include/asm/immap_qe.h
··· 3 3 * The Internal Memory Map for devices with QE on them. This 4 4 * is the superset of all QE devices (8360, etc.). 5 5 6 - * Copyright (C) 2006. Freescale Semicondutor, Inc. All rights reserved. 6 + * Copyright (C) 2006. Freescale Semiconductor, Inc. All rights reserved. 7 7 * 8 8 * Authors: Shlomi Gridish <gridish@freescale.com> 9 9 * Li Yang <leoli@freescale.com>
-3
arch/powerpc/include/asm/machdep.h
··· 166 166 unsigned long size, 167 167 pgprot_t vma_prot); 168 168 169 - /* Idle loop for this platform, leave empty for default idle loop */ 170 - void (*idle_loop)(void); 171 - 172 169 /* 173 170 * Function for waiting for work with reduced power in idle loop; 174 171 * called with interrupts disabled.
+1
arch/powerpc/include/asm/mmu.h
··· 101 101 #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 102 102 #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 103 103 #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 104 + #define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE 104 105 #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ 105 106 MMU_FTR_CI_LARGE_PAGE 106 107 #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
-47
arch/powerpc/include/asm/pSeries_reconfig.h
··· 1 - #ifndef _PPC64_PSERIES_RECONFIG_H 2 - #define _PPC64_PSERIES_RECONFIG_H 3 - #ifdef __KERNEL__ 4 - 5 - #include <linux/notifier.h> 6 - 7 - /* 8 - * Use this API if your code needs to know about OF device nodes being 9 - * added or removed on pSeries systems. 10 - */ 11 - 12 - #define PSERIES_RECONFIG_ADD 0x0001 13 - #define PSERIES_RECONFIG_REMOVE 0x0002 14 - #define PSERIES_DRCONF_MEM_ADD 0x0003 15 - #define PSERIES_DRCONF_MEM_REMOVE 0x0004 16 - #define PSERIES_UPDATE_PROPERTY 0x0005 17 - 18 - /** 19 - * pSeries_reconfig_notify - Notifier value structure for OFDT property updates 20 - * 21 - * @node: Device tree node which owns the property being updated 22 - * @property: Updated property 23 - */ 24 - struct pSeries_reconfig_prop_update { 25 - struct device_node *node; 26 - struct property *property; 27 - }; 28 - 29 - #ifdef CONFIG_PPC_PSERIES 30 - extern int pSeries_reconfig_notifier_register(struct notifier_block *); 31 - extern void pSeries_reconfig_notifier_unregister(struct notifier_block *); 32 - extern int pSeries_reconfig_notify(unsigned long action, void *p); 33 - /* Not the best place to put this, will be fixed when we move some 34 - * of the rtas suspend-me stuff to pseries */ 35 - extern void pSeries_coalesce_init(void); 36 - #else /* !CONFIG_PPC_PSERIES */ 37 - static inline int pSeries_reconfig_notifier_register(struct notifier_block *nb) 38 - { 39 - return 0; 40 - } 41 - static inline void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) { } 42 - static inline void pSeries_coalesce_init(void) { } 43 - #endif /* CONFIG_PPC_PSERIES */ 44 - 45 - 46 - #endif /* __KERNEL__ */ 47 - #endif /* _PPC64_PSERIES_RECONFIG_H */
+5 -1
arch/powerpc/include/asm/ppc-opcode.h
··· 1 1 /* 2 - * Copyright 2009 Freescale Semicondutor, Inc. 2 + * Copyright 2009 Freescale Semiconductor, Inc. 3 3 * 4 4 * This program is free software; you can redistribute it and/or 5 5 * modify it under the terms of the GNU General Public License ··· 86 86 #define PPC_INST_DCBA_MASK 0xfc0007fe 87 87 #define PPC_INST_DCBAL 0x7c2005ec 88 88 #define PPC_INST_DCBZL 0x7c2007ec 89 + #define PPC_INST_ICBT 0x7c00002c 89 90 #define PPC_INST_ISEL 0x7c00001e 90 91 #define PPC_INST_ISEL_MASK 0xfc00003e 91 92 #define PPC_INST_LDARX 0x7c0000a8 ··· 202 201 #define __PPC_MB(s) (((s) & 0x1f) << 6) 203 202 #define __PPC_ME(s) (((s) & 0x1f) << 1) 204 203 #define __PPC_BI(s) (((s) & 0x1f) << 16) 204 + #define __PPC_CT(t) (((t) & 0x0f) << 21) 205 205 206 206 /* 207 207 * Only use the larx hint bit on 64bit CPUs. e500v1/v2 based CPUs will treat a ··· 265 263 __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) 266 264 #define PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ 267 265 __PPC_RT(t) | __PPC_RB(b)) 266 + #define PPC_ICBT(c,a,b) stringify_in_c(.long PPC_INST_ICBT | \ 267 + __PPC_CT(c) | __PPC_RA0(a) | __PPC_RB(b)) 268 268 /* PASemi instructions */ 269 269 #define LBZCIX(t,a,b) stringify_in_c(.long PPC_INST_LBZCIX | \ 270 270 __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b))
+16
arch/powerpc/include/asm/prom.h
··· 58 58 59 59 extern void of_instantiate_rtc(void); 60 60 61 + /* The of_drconf_cell struct defines the layout of the LMB array 62 + * specified in the device tree property 63 + * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory 64 + */ 65 + struct of_drconf_cell { 66 + u64 base_addr; 67 + u32 drc_index; 68 + u32 reserved; 69 + u32 aa_index; 70 + u32 flags; 71 + }; 72 + 73 + #define DRCONF_MEM_ASSIGNED 0x00000008 74 + #define DRCONF_MEM_AI_INVALID 0x00000040 75 + #define DRCONF_MEM_RESERVED 0x00000080 76 + 61 77 /* These includes are put at the bottom because they may contain things 62 78 * that are overridden by this file. Ideally they shouldn't be included 63 79 * by this file, but there are a bunch of .c files that currently depend
+1 -1
arch/powerpc/include/asm/qe.h
··· 1 1 /* 2 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/include/asm/qe_ic.h
··· 1 1 /* 2 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
+3
arch/powerpc/include/asm/reg.h
··· 249 249 #define LPCR_RMLS 0x1C000000 /* impl dependent rmo limit sel */ 250 250 #define LPCR_RMLS_SH (63-37) 251 251 #define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */ 252 + #define LPCR_AIL_0 0x00000000 /* MMU off exception offset 0x0 */ 253 + #define LPCR_AIL_3 0x01800000 /* MMU on exception offset 0xc00...4xxx */ 252 254 #define LPCR_PECE 0x00007000 /* powersave exit cause enable */ 253 255 #define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */ 254 256 #define LPCR_PECE1 0x00002000 /* decrementer can cause exit */ ··· 1032 1030 #define PVR_970MP 0x0044 1033 1031 #define PVR_970GX 0x0045 1034 1032 #define PVR_POWER7p 0x004A 1033 + #define PVR_POWER8 0x004B 1035 1034 #define PVR_BE 0x0070 1036 1035 #define PVR_PA6T 0x0090 1037 1036
+5
arch/powerpc/include/asm/rtas.h
··· 353 353 return 1; 354 354 return 0; 355 355 } 356 + 357 + /* Not the best place to put pSeries_coalesce_init, will be fixed when we 358 + * move some of the rtas suspend-me stuff to pseries */ 359 + extern void pSeries_coalesce_init(void); 356 360 #else 357 361 static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;} 362 + static inline void pSeries_coalesce_init(void) { } 358 363 #endif 359 364 360 365 extern int call_rtas(const char *, int, int, unsigned long *, ...);
+29
arch/powerpc/include/asm/setup.h
··· 1 + #ifndef _ASM_POWERPC_SETUP_H 2 + #define _ASM_POWERPC_SETUP_H 3 + 4 + #include <uapi/asm/setup.h> 5 + 6 + #ifndef __ASSEMBLY__ 7 + extern void ppc_printk_progress(char *s, unsigned short hex); 8 + 9 + extern unsigned int rtas_data; 10 + extern int mem_init_done; /* set on boot once kmalloc can be called */ 11 + extern int init_bootmem_done; /* set once bootmem is available */ 12 + extern unsigned long long memory_limit; 13 + extern unsigned long klimit; 14 + extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); 15 + 16 + struct device_node; 17 + extern void note_scsi_host(struct device_node *, void *); 18 + 19 + /* Used in very early kernel initialization. */ 20 + extern unsigned long reloc_offset(void); 21 + extern unsigned long add_reloc_offset(unsigned long); 22 + extern void reloc_got2(unsigned long); 23 + 24 + #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) 25 + 26 + #endif /* !__ASSEMBLY__ */ 27 + 28 + #endif /* _ASM_POWERPC_SETUP_H */ 29 +
+1 -1
arch/powerpc/include/asm/ucc.h
··· 1 1 /* 2 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/include/asm/ucc_fast.h
··· 1 1 /* 2 2 * Internal header file for UCC FAST unit routines. 3 3 * 4 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 4 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 5 5 * 6 6 * Authors: Shlomi Gridish <gridish@freescale.com> 7 7 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/include/asm/ucc_slow.h
··· 1 1 /* 2 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
-1
arch/powerpc/include/asm/udbg.h
··· 21 21 22 22 extern void udbg_puts(const char *s); 23 23 extern int udbg_write(const char *s, int n); 24 - extern int udbg_read(char *buf, int buflen); 25 24 26 25 extern void register_early_udbg_console(void); 27 26 extern void udbg_printf(const char *fmt, ...)
-31
arch/powerpc/include/uapi/asm/setup.h
··· 1 - #ifndef _ASM_POWERPC_SETUP_H 2 - #define _ASM_POWERPC_SETUP_H 3 - 4 1 #include <asm-generic/setup.h> 5 - 6 - #ifndef __ASSEMBLY__ 7 - extern void ppc_printk_progress(char *s, unsigned short hex); 8 - 9 - extern unsigned int rtas_data; 10 - extern int mem_init_done; /* set on boot once kmalloc can be called */ 11 - extern int init_bootmem_done; /* set once bootmem is available */ 12 - extern unsigned long long memory_limit; 13 - extern unsigned long klimit; 14 - extern void *zalloc_maybe_bootmem(size_t size, gfp_t mask); 15 - 16 - extern void via_cuda_init(void); 17 - extern void read_rtc_time(void); 18 - extern void pmac_find_display(void); 19 - 20 - struct device_node; 21 - extern void note_scsi_host(struct device_node *, void *); 22 - 23 - /* Used in very early kernel initialization. */ 24 - extern unsigned long reloc_offset(void); 25 - extern unsigned long add_reloc_offset(unsigned long); 26 - extern void reloc_got2(unsigned long); 27 - 28 - #define PTRRELOC(x) ((typeof(x)) add_reloc_offset((unsigned long)(x))) 29 - 30 - #endif /* !__ASSEMBLY__ */ 31 - 32 - #endif /* _ASM_POWERPC_SETUP_H */
+1 -1
arch/powerpc/kernel/Makefile
··· 38 38 paca.o nvram_64.o firmware.o 39 39 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o 40 40 obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o 41 - obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power7.o 41 + obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o 42 42 obj64-$(CONFIG_RELOCATABLE) += reloc_64.o 43 43 obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o 44 44 obj-$(CONFIG_PPC_A2) += cpu_setup_a2.o
+31 -1
arch/powerpc/kernel/cpu_setup_power7.S arch/powerpc/kernel/cpu_setup_power.S
··· 27 27 beqlr 28 28 li r0,0 29 29 mtspr SPRN_LPID,r0 30 + mfspr r3,SPRN_LPCR 30 31 bl __init_LPCR 31 32 bl __init_TLB 32 33 mtlr r11 ··· 40 39 beqlr 41 40 li r0,0 42 41 mtspr SPRN_LPID,r0 42 + mfspr r3,SPRN_LPCR 43 + bl __init_LPCR 44 + bl __init_TLB 45 + mtlr r11 46 + blr 47 + 48 + _GLOBAL(__setup_cpu_power8) 49 + mflr r11 50 + bl __init_hvmode_206 51 + mtlr r11 52 + beqlr 53 + li r0,0 54 + mtspr SPRN_LPID,r0 55 + mfspr r3,SPRN_LPCR 56 + oris r3, r3, LPCR_AIL_3@h 57 + bl __init_LPCR 58 + bl __init_TLB 59 + mtlr r11 60 + blr 61 + 62 + _GLOBAL(__restore_cpu_power8) 63 + mflr r11 64 + mfmsr r3 65 + rldicl. r0,r3,4,63 66 + beqlr 67 + li r0,0 68 + mtspr SPRN_LPID,r0 69 + mfspr r3,SPRN_LPCR 70 + oris r3, r3, LPCR_AIL_3@h 43 71 bl __init_LPCR 44 72 bl __init_TLB 45 73 mtlr r11 ··· 87 57 88 58 __init_LPCR: 89 59 /* Setup a sane LPCR: 60 + * Called with initial LPCR in R3 90 61 * 91 62 * LPES = 0b01 (HSRR0/1 used for 0x500) 92 63 * PECE = 0b111 ··· 98 67 * 99 68 * Other bits untouched for now 100 69 */ 101 - mfspr r3,SPRN_LPCR 102 70 li r5,1 103 71 rldimi r3,r5, LPCR_LPES_SH, 64-LPCR_LPES_SH-2 104 72 ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2)
+38
arch/powerpc/kernel/cputable.c
··· 68 68 extern void __restore_cpu_ppc970(void); 69 69 extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec); 70 70 extern void __restore_cpu_power7(void); 71 + extern void __setup_cpu_power8(unsigned long offset, struct cpu_spec* spec); 72 + extern void __restore_cpu_power8(void); 71 73 extern void __restore_cpu_a2(void); 72 74 #endif /* CONFIG_PPC64 */ 73 75 #if defined(CONFIG_E500) ··· 93 91 PPC_FEATURE_TRUE_LE | \ 94 92 PPC_FEATURE_PSERIES_PERFMON_COMPAT) 95 93 #define COMMON_USER_POWER7 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ 94 + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ 95 + PPC_FEATURE_TRUE_LE | \ 96 + PPC_FEATURE_PSERIES_PERFMON_COMPAT) 97 + #define COMMON_USER_POWER8 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ 96 98 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ 97 99 PPC_FEATURE_TRUE_LE | \ 98 100 PPC_FEATURE_PSERIES_PERFMON_COMPAT) ··· 435 429 .cpu_restore = __restore_cpu_power7, 436 430 .platform = "power7", 437 431 }, 432 + { /* 2.07-compliant processor, i.e. Power8 "architected" mode */ 433 + .pvr_mask = 0xffffffff, 434 + .pvr_value = 0x0f000004, 435 + .cpu_name = "POWER8 (architected)", 436 + .cpu_features = CPU_FTRS_POWER8, 437 + .cpu_user_features = COMMON_USER_POWER8, 438 + .mmu_features = MMU_FTRS_POWER8, 439 + .icache_bsize = 128, 440 + .dcache_bsize = 128, 441 + .oprofile_type = PPC_OPROFILE_POWER4, 442 + .oprofile_cpu_type = "ppc64/ibm-compat-v1", 443 + .cpu_setup = __setup_cpu_power8, 444 + .cpu_restore = __restore_cpu_power8, 445 + .platform = "power8", 446 + }, 438 447 { /* Power7 */ 439 448 .pvr_mask = 0xffff0000, 440 449 .pvr_value = 0x003f0000, ··· 483 462 .cpu_setup = __setup_cpu_power7, 484 463 .cpu_restore = __restore_cpu_power7, 485 464 .platform = "power7+", 465 + }, 466 + { /* Power8 */ 467 + .pvr_mask = 0xffff0000, 468 + .pvr_value = 0x004b0000, 469 + .cpu_name = "POWER8 (raw)", 470 + .cpu_features = CPU_FTRS_POWER8, 471 + .cpu_user_features = COMMON_USER_POWER8, 472 + .mmu_features = MMU_FTRS_POWER8, 473 + .icache_bsize = 128, 474 + .dcache_bsize = 128, 475 + .num_pmcs = 6, 476 + .pmc_type = PPC_PMC_IBM, 477 + .oprofile_cpu_type = "ppc64/power8", 478 + .oprofile_type = PPC_OPROFILE_POWER4, 479 + .cpu_setup = __setup_cpu_power8, 480 + .cpu_restore = __restore_cpu_power8, 481 + .platform = "power8", 486 482 }, 487 483 { /* Cell Broadband Engine */ 488 484 .pvr_mask = 0xffff0000,
+2
arch/powerpc/kernel/entry_64.S
··· 373 373 _GLOBAL(ret_from_kernel_thread) 374 374 bl .schedule_tail 375 375 REST_NVGPRS(r1) 376 + li r3,0 377 + std r3,0(r1) 376 378 ld r14, 0(r14) 377 379 mtlr r14 378 380 mr r3,r15
+258 -50
arch/powerpc/kernel/exceptions-64s.S
··· 19 19 /* 20 20 * We layout physical memory as follows: 21 21 * 0x0000 - 0x00ff : Secondary processor spin code 22 - * 0x0100 - 0x2fff : pSeries Interrupt prologs 23 - * 0x3000 - 0x5fff : interrupt support common interrupt prologs 24 - * 0x6000 - 0x6fff : Initial (CPU0) segment table 22 + * 0x0100 - 0x17ff : pSeries Interrupt prologs 23 + * 0x1800 - 0x4000 : interrupt support common interrupt prologs 24 + * 0x4000 - 0x5fff : pSeries interrupts with IR=1,DR=1 25 + * 0x6000 - 0x6fff : more interrupt support including for IR=1,DR=1 25 26 * 0x7000 - 0x7fff : FWNMI data area 26 - * 0x8000 - : Early init and support code 27 + * 0x8000 - 0x8fff : Initial (CPU0) segment table 28 + * 0x9000 - : Early init and support code 27 29 */ 30 + /* Syscall routine is used twice, in reloc-off and reloc-on paths */ 31 + #define SYSCALL_PSERIES_1 \ 32 + BEGIN_FTR_SECTION \ 33 + cmpdi r0,0x1ebe ; \ 34 + beq- 1f ; \ 35 + END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \ 36 + mr r9,r13 ; \ 37 + GET_PACA(r13) ; \ 38 + mfspr r11,SPRN_SRR0 ; \ 39 + 0: 40 + 41 + #define SYSCALL_PSERIES_2_RFID \ 42 + mfspr r12,SPRN_SRR1 ; \ 43 + ld r10,PACAKBASE(r13) ; \ 44 + LOAD_HANDLER(r10, system_call_entry) ; \ 45 + mtspr SPRN_SRR0,r10 ; \ 46 + ld r10,PACAKMSR(r13) ; \ 47 + mtspr SPRN_SRR1,r10 ; \ 48 + rfid ; \ 49 + b . ; /* prevent speculative execution */ 50 + 51 + #define SYSCALL_PSERIES_3 \ 52 + /* Fast LE/BE switch system call */ \ 53 + 1: mfspr r12,SPRN_SRR1 ; \ 54 + xori r12,r12,MSR_LE ; \ 55 + mtspr SPRN_SRR1,r12 ; \ 56 + rfid ; /* return to userspace */ \ 57 + b . ; \ 58 + 2: mfspr r12,SPRN_SRR1 ; \ 59 + andi. r12,r12,MSR_PR ; \ 60 + bne 0b ; \ 61 + mtspr SPRN_SRR0,r3 ; \ 62 + mtspr SPRN_SRR1,r4 ; \ 63 + mtspr SPRN_SDR1,r5 ; \ 64 + rfid ; \ 65 + b . ; /* prevent speculative execution */ 66 + 67 + #if defined(CONFIG_RELOCATABLE) 68 + /* 69 + * We can't branch directly; in the direct case we use LR 70 + * and system_call_entry restores LR. (We thus need to move 71 + * LR to r10 in the RFID case too.) 72 + */ 73 + #define SYSCALL_PSERIES_2_DIRECT \ 74 + mflr r10 ; \ 75 + ld r12,PACAKBASE(r13) ; \ 76 + LOAD_HANDLER(r12, system_call_entry_direct) ; \ 77 + mtlr r12 ; \ 78 + mfspr r12,SPRN_SRR1 ; \ 79 + /* Re-use of r13... No spare regs to do this */ \ 80 + li r13,MSR_RI ; \ 81 + mtmsrd r13,1 ; \ 82 + GET_PACA(r13) ; /* get r13 back */ \ 83 + blr ; 84 + #else 85 + /* We can branch directly */ 86 + #define SYSCALL_PSERIES_2_DIRECT \ 87 + mfspr r12,SPRN_SRR1 ; \ 88 + li r10,MSR_RI ; \ 89 + mtmsrd r10,1 ; /* Set RI (EE=0) */ \ 90 + b system_call_entry_direct ; 91 + #endif 28 92 29 93 /* 30 94 * This is the start of the interrupt handlers for pSeries ··· 271 207 KVMTEST(0xc00) 272 208 GET_SCRATCH0(r13) 273 209 #endif 274 - BEGIN_FTR_SECTION 275 - cmpdi r0,0x1ebe 276 - beq- 1f 277 - END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) 278 - mr r9,r13 279 - GET_PACA(r13) 280 - mfspr r11,SPRN_SRR0 281 - mfspr r12,SPRN_SRR1 282 - ld r10,PACAKBASE(r13) 283 - LOAD_HANDLER(r10, system_call_entry) 284 - mtspr SPRN_SRR0,r10 285 - ld r10,PACAKMSR(r13) 286 - mtspr SPRN_SRR1,r10 287 - rfid 288 - b . /* prevent speculative execution */ 289 - 210 + SYSCALL_PSERIES_1 211 + SYSCALL_PSERIES_2_RFID 212 + SYSCALL_PSERIES_3 290 213 KVM_HANDLER(PACA_EXGEN, EXC_STD, 0xc00) 291 - 292 - /* Fast LE/BE switch system call */ 293 - 1: mfspr r12,SPRN_SRR1 294 - xori r12,r12,MSR_LE 295 - mtspr SPRN_SRR1,r12 296 - rfid /* return to userspace */ 297 - b . 298 214 299 215 STD_EXCEPTION_PSERIES(0xd00, 0xd00, single_step) 300 216 KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xd00) ··· 320 276 KVM_HANDLER_PR_SKIP(PACA_EXGEN, EXC_STD, 0x1300) 321 277 322 278 . = 0x1500 323 - .global denorm_Hypervisor 279 + .global denorm_exception_hv 324 280 denorm_exception_hv: 325 281 HMT_MEDIUM 326 282 mtspr SPRN_SPRG_HSCRATCH0,r13 ··· 355 311 #ifdef CONFIG_CBE_RAS 356 312 STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal) 357 313 KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1802) 314 + #else 315 + . = 0x1800 358 316 #endif /* CONFIG_CBE_RAS */ 359 317 360 - . = 0x3000 361 318 362 319 /*** Out of line interrupts support ***/ 363 320 321 + .align 7 364 322 /* moved from 0x200 */ 365 323 machine_check_pSeries: 366 324 .globl machine_check_fwnmi ··· 621 575 b . /* prevent spec. execution */ 622 576 #endif /* __DISABLED__ */ 623 577 624 - .align 7 625 - .globl __end_interrupts 626 - __end_interrupts: 627 - 628 578 /* 629 579 * Code from here down to __end_handlers is invoked from the 630 580 * exception prologs above. Because the prologs assemble the 631 581 * addresses of these handlers using the LOAD_HANDLER macro, 632 - * which uses an addi instruction, these handlers must be in 633 - * the first 32k of the kernel image. 582 + * which uses an ori instruction, these handlers must be in 583 + * the first 64k of the kernel image. 634 584 */ 635 585 636 586 /*** Common interrupt handlers ***/ ··· 655 613 STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) 656 614 STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) 657 615 STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) 658 - STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) 659 - STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) 616 + STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) 617 + STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) 660 618 STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, .performance_monitor_exception) 661 619 STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) 662 620 STD_EXCEPTION_COMMON(0x1502, denorm, .unknown_exception) ··· 671 629 STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception) 672 630 #endif /* CONFIG_CBE_RAS */ 673 631 632 + /* 633 + * Relocation-on interrupts: A subset of the interrupts can be delivered 634 + * with IR=1/DR=1, if AIL==2 and MSR.HV won't be changed by delivering 635 + * it. Addresses are the same as the original interrupt addresses, but 636 + * offset by 0xc000000000004000. 637 + * It's impossible to receive interrupts below 0x300 via this mechanism. 638 + * KVM: None of these traps are from the guest ; anything that escalated 639 + * to HV=1 from HV=0 is delivered via real mode handlers. 640 + */ 641 + 642 + /* 643 + * This uses the standard macro, since the original 0x300 vector 644 + * only has extra guff for STAB-based processors -- which never 645 + * come here. 646 + */ 647 + STD_RELON_EXCEPTION_PSERIES(0x4300, 0x300, data_access) 648 + . = 0x4380 649 + .globl data_access_slb_relon_pSeries 650 + data_access_slb_relon_pSeries: 651 + HMT_MEDIUM 652 + SET_SCRATCH0(r13) 653 + EXCEPTION_PROLOG_1(PACA_EXSLB, NOTEST, 0x380) 654 + std r3,PACA_EXSLB+EX_R3(r13) 655 + mfspr r3,SPRN_DAR 656 + mfspr r12,SPRN_SRR1 657 + #ifndef CONFIG_RELOCATABLE 658 + b .slb_miss_realmode 659 + #else 660 + /* 661 + * We can't just use a direct branch to .slb_miss_realmode 662 + * because the distance from here to there depends on where 663 + * the kernel ends up being put. 664 + */ 665 + mfctr r11 666 + ld r10,PACAKBASE(r13) 667 + LOAD_HANDLER(r10, .slb_miss_realmode) 668 + mtctr r10 669 + bctr 670 + #endif 671 + 672 + STD_RELON_EXCEPTION_PSERIES(0x4400, 0x400, instruction_access) 673 + . = 0x4480 674 + .globl instruction_access_slb_relon_pSeries 675 + instruction_access_slb_relon_pSeries: 676 + HMT_MEDIUM 677 + SET_SCRATCH0(r13) 678 + EXCEPTION_PROLOG_1(PACA_EXSLB, NOTEST, 0x480) 679 + std r3,PACA_EXSLB+EX_R3(r13) 680 + mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 681 + mfspr r12,SPRN_SRR1 682 + #ifndef CONFIG_RELOCATABLE 683 + b .slb_miss_realmode 684 + #else 685 + mfctr r11 686 + ld r10,PACAKBASE(r13) 687 + LOAD_HANDLER(r10, .slb_miss_realmode) 688 + mtctr r10 689 + bctr 690 + #endif 691 + 692 + . = 0x4500 693 + .globl hardware_interrupt_relon_pSeries; 694 + .globl hardware_interrupt_relon_hv; 695 + hardware_interrupt_relon_pSeries: 696 + hardware_interrupt_relon_hv: 697 + BEGIN_FTR_SECTION 698 + _MASKABLE_RELON_EXCEPTION_PSERIES(0x502, hardware_interrupt, EXC_HV, SOFTEN_TEST_HV) 699 + FTR_SECTION_ELSE 700 + _MASKABLE_RELON_EXCEPTION_PSERIES(0x500, hardware_interrupt, EXC_STD, SOFTEN_TEST_PR) 701 + ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_206) 702 + STD_RELON_EXCEPTION_PSERIES(0x4600, 0x600, alignment) 703 + STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check) 704 + STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable) 705 + MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer) 706 + STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer) 707 + STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b) 708 + 709 + . = 0x4c00 710 + .globl system_call_relon_pSeries 711 + system_call_relon_pSeries: 712 + HMT_MEDIUM 713 + SYSCALL_PSERIES_1 714 + SYSCALL_PSERIES_2_DIRECT 715 + SYSCALL_PSERIES_3 716 + 717 + STD_RELON_EXCEPTION_PSERIES(0x4d00, 0xd00, single_step) 718 + 719 + . = 0x4e00 720 + b h_data_storage_relon_hv 721 + 722 + . = 0x4e20 723 + b h_instr_storage_relon_hv 724 + 725 + . = 0x4e40 726 + b emulation_assist_relon_hv 727 + 728 + . = 0x4e50 729 + b hmi_exception_relon_hv 730 + 731 + . = 0x4e60 732 + b hmi_exception_relon_hv 733 + 734 + /* For when we support the doorbell interrupt: 735 + STD_RELON_EXCEPTION_HYPERVISOR(0x4e80, 0xe80, doorbell_hyper) 736 + */ 737 + 738 + performance_monitor_relon_pSeries_1: 739 + . = 0x4f00 740 + b performance_monitor_relon_pSeries 741 + 742 + altivec_unavailable_relon_pSeries_1: 743 + . = 0x4f20 744 + b altivec_unavailable_relon_pSeries 745 + 746 + vsx_unavailable_relon_pSeries_1: 747 + . = 0x4f40 748 + b vsx_unavailable_relon_pSeries 749 + 750 + #ifdef CONFIG_CBE_RAS 751 + STD_RELON_EXCEPTION_HV(0x5200, 0x1202, cbe_system_error) 752 + #endif /* CONFIG_CBE_RAS */ 753 + STD_RELON_EXCEPTION_PSERIES(0x5300, 0x1300, instruction_breakpoint) 754 + #ifdef CONFIG_PPC_DENORMALISATION 755 + . = 0x5500 756 + b denorm_exception_hv 757 + #endif 758 + #ifdef CONFIG_CBE_RAS 759 + STD_RELON_EXCEPTION_HV(0x5600, 0x1602, cbe_maintenance) 760 + #else 761 + #ifdef CONFIG_HVC_SCOM 762 + STD_RELON_EXCEPTION_HV(0x5600, 0x1600, maintence_interrupt) 763 + KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1600) 764 + #endif /* CONFIG_HVC_SCOM */ 765 + #endif /* CONFIG_CBE_RAS */ 766 + STD_RELON_EXCEPTION_PSERIES(0x5700, 0x1700, altivec_assist) 767 + #ifdef CONFIG_CBE_RAS 768 + STD_RELON_EXCEPTION_HV(0x5800, 0x1802, cbe_thermal) 769 + #endif /* CONFIG_CBE_RAS */ 770 + 771 + /* Other future vectors */ 674 772 .align 7 773 + .globl __end_interrupts 774 + __end_interrupts: 775 + 776 + .align 7 777 + system_call_entry_direct: 778 + #if defined(CONFIG_RELOCATABLE) 779 + /* The first level prologue may have used LR to get here, saving 780 + * orig in r10. To save hacking/ifdeffing common code, restore here. 781 + */ 782 + mtlr r10 783 + #endif 675 784 system_call_entry: 676 785 b system_call_common 677 786 ··· 907 714 ld r3,PACA_EXGEN+EX_DAR(r13) 908 715 lwz r4,PACA_EXGEN+EX_DSISR(r13) 909 716 li r5,0x300 910 - b .do_hash_page /* Try to handle as hpte fault */ 717 + b .do_hash_page /* Try to handle as hpte fault */ 911 718 912 719 .align 7 913 - .globl h_data_storage_common 720 + .globl h_data_storage_common 914 721 h_data_storage_common: 915 - mfspr r10,SPRN_HDAR 916 - std r10,PACA_EXGEN+EX_DAR(r13) 917 - mfspr r10,SPRN_HDSISR 918 - stw r10,PACA_EXGEN+EX_DSISR(r13) 919 - EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) 920 - bl .save_nvgprs 722 + mfspr r10,SPRN_HDAR 723 + std r10,PACA_EXGEN+EX_DAR(r13) 724 + mfspr r10,SPRN_HDSISR 725 + stw r10,PACA_EXGEN+EX_DSISR(r13) 726 + EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) 727 + bl .save_nvgprs 921 728 DISABLE_INTS 922 - addi r3,r1,STACK_FRAME_OVERHEAD 923 - bl .unknown_exception 924 - b .ret_from_except 729 + addi r3,r1,STACK_FRAME_OVERHEAD 730 + bl .unknown_exception 731 + b .ret_from_except 925 732 926 733 .align 7 927 734 .globl instruction_access_common ··· 934 741 li r5,0x400 935 742 b .do_hash_page /* Try to handle as hpte fault */ 936 743 937 - STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) 744 + STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) 938 745 939 746 /* 940 747 * Here is the common SLB miss user that is used when going to virtual ··· 1345 1152 rfid 1346 1153 b . /* prevent speculative execution */ 1347 1154 1155 + 1156 + /* Equivalents to the above handlers for relocation-on interrupt vectors */ 1157 + STD_RELON_EXCEPTION_HV(., 0xe00, h_data_storage) 1158 + KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe00) 1159 + STD_RELON_EXCEPTION_HV(., 0xe20, h_instr_storage) 1160 + KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe20) 1161 + STD_RELON_EXCEPTION_HV(., 0xe40, emulation_assist) 1162 + KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe40) 1163 + STD_RELON_EXCEPTION_HV(., 0xe60, hmi_exception) 1164 + KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe60) 1165 + 1166 + STD_RELON_EXCEPTION_PSERIES(., 0xf00, performance_monitor) 1167 + STD_RELON_EXCEPTION_PSERIES(., 0xf20, altivec_unavailable) 1168 + STD_RELON_EXCEPTION_PSERIES(., 0xf40, vsx_unavailable) 1169 + 1348 1170 #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) 1349 1171 /* 1350 1172 * Data area reserved for FWNMI option. ··· 1372 1164 /* pseries and powernv need to keep the whole page from 1373 1165 * 0x7000 to 0x8000 free for use by the firmware 1374 1166 */ 1375 - . = 0x8000 1167 + . = 0x8000 1376 1168 #endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */ 1377 1169 1378 1170 /* Space for CPU0's segment table */
+4 -2
arch/powerpc/kernel/head_64.S
··· 422 422 tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */ 423 423 #endif 424 424 425 - #ifdef CONFIG_CRASH_DUMP 425 + #ifdef CONFIG_RELOCATABLE 426 426 /* 427 427 * Check if the kernel has to be running as relocatable kernel based on the 428 428 * variable __run_at_load, if it is set the kernel is treated as relocatable ··· 432 432 cmplwi cr0,r7,1 433 433 bne 3f 434 434 435 - li r5,__end_interrupts - _stext /* just copy interrupts */ 435 + /* just copy interrupts */ 436 + LOAD_REG_IMMEDIATE(r5, __end_interrupts - _stext) 436 437 b 5f 437 438 3: 438 439 #endif ··· 704 703 705 704 #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL 706 705 /* Setup OPAL entry */ 706 + LOAD_REG_ADDR(r11, opal) 707 707 std r28,0(r11); 708 708 std r29,8(r11); 709 709 #endif
-3
arch/powerpc/kernel/idle.c
··· 55 55 */ 56 56 void cpu_idle(void) 57 57 { 58 - if (ppc_md.idle_loop) 59 - ppc_md.idle_loop(); /* doesn't return */ 60 - 61 58 set_thread_flag(TIF_POLLING_NRFLAG); 62 59 while (1) { 63 60 tick_nohz_idle_enter();
+5 -11
arch/powerpc/kernel/iommu.c
··· 656 656 struct iommu_pool *p; 657 657 658 658 /* number of bytes needed for the bitmap */ 659 - sz = (tbl->it_size + 7) >> 3; 659 + sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long); 660 660 661 661 page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz)); 662 662 if (!page) ··· 708 708 709 709 void iommu_free_table(struct iommu_table *tbl, const char *node_name) 710 710 { 711 - unsigned long bitmap_sz, i; 711 + unsigned long bitmap_sz; 712 712 unsigned int order; 713 713 714 714 if (!tbl || !tbl->it_map) { ··· 718 718 } 719 719 720 720 /* verify that table contains no entries */ 721 - /* it_size is in entries, and we're examining 64 at a time */ 722 - for (i = 0; i < (tbl->it_size/64); i++) { 723 - if (tbl->it_map[i] != 0) { 724 - printk(KERN_WARNING "%s: Unexpected TCEs for %s\n", 725 - __func__, node_name); 726 - break; 727 - } 728 - } 721 + if (!bitmap_empty(tbl->it_map, tbl->it_size)) 722 + pr_warn("%s: Unexpected TCEs for %s\n", __func__, node_name); 729 723 730 724 /* calculate bitmap size in bytes */ 731 - bitmap_sz = (tbl->it_size + 7) / 8; 725 + bitmap_sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long); 732 726 733 727 /* free bitmap */ 734 728 order = get_order(bitmap_sz);
+7 -7
arch/powerpc/kernel/machine_kexec.c
··· 218 218 * be sure what's in them, so remove them. */ 219 219 prop = of_find_property(node, "linux,crashkernel-base", NULL); 220 220 if (prop) 221 - prom_remove_property(node, prop); 221 + of_remove_property(node, prop); 222 222 223 223 prop = of_find_property(node, "linux,crashkernel-size", NULL); 224 224 if (prop) 225 - prom_remove_property(node, prop); 225 + of_remove_property(node, prop); 226 226 227 227 if (crashk_res.start != 0) { 228 - prom_add_property(node, &crashk_base_prop); 228 + of_add_property(node, &crashk_base_prop); 229 229 crashk_size = resource_size(&crashk_res); 230 - prom_add_property(node, &crashk_size_prop); 230 + of_add_property(node, &crashk_size_prop); 231 231 } 232 232 233 233 /* 234 234 * memory_limit is required by the kexec-tools to limit the 235 235 * crash regions to the actual memory used. 236 236 */ 237 - prom_update_property(node, &memory_limit_prop); 237 + of_update_property(node, &memory_limit_prop); 238 238 } 239 239 240 240 static int __init kexec_setup(void) ··· 249 249 /* remove any stale properties so ours can be found */ 250 250 prop = of_find_property(node, kernel_end_prop.name, NULL); 251 251 if (prop) 252 - prom_remove_property(node, prop); 252 + of_remove_property(node, prop); 253 253 254 254 /* information needed by userspace when using default_machine_kexec */ 255 255 kernel_end = __pa(_end); 256 - prom_add_property(node, &kernel_end_prop); 256 + of_add_property(node, &kernel_end_prop); 257 257 258 258 export_crashk_values(node); 259 259
+4 -4
arch/powerpc/kernel/machine_kexec_64.c
··· 389 389 /* remove any stale propertys so ours can be found */ 390 390 prop = of_find_property(node, htab_base_prop.name, NULL); 391 391 if (prop) 392 - prom_remove_property(node, prop); 392 + of_remove_property(node, prop); 393 393 prop = of_find_property(node, htab_size_prop.name, NULL); 394 394 if (prop) 395 - prom_remove_property(node, prop); 395 + of_remove_property(node, prop); 396 396 397 397 htab_base = __pa(htab_address); 398 - prom_add_property(node, &htab_base_prop); 399 - prom_add_property(node, &htab_size_prop); 398 + of_add_property(node, &htab_base_prop); 399 + of_add_property(node, &htab_size_prop); 400 400 401 401 of_node_put(node); 402 402 return 0;
+1 -1
arch/powerpc/kernel/pci_32.c
··· 208 208 of_prop->name = "pci-OF-bus-map"; 209 209 of_prop->length = 256; 210 210 of_prop->value = &of_prop[1]; 211 - prom_add_property(dn, of_prop); 211 + of_add_property(dn, of_prop); 212 212 of_node_put(dn); 213 213 } 214 214 }
+4 -3
arch/powerpc/kernel/prom.c
··· 32 32 #include <linux/debugfs.h> 33 33 #include <linux/irq.h> 34 34 #include <linux/memblock.h> 35 + #include <linux/of.h> 35 36 36 37 #include <asm/prom.h> 37 38 #include <asm/rtas.h> ··· 50 49 #include <asm/btext.h> 51 50 #include <asm/sections.h> 52 51 #include <asm/machdep.h> 53 - #include <asm/pSeries_reconfig.h> 54 52 #include <asm/pci-bridge.h> 55 53 #include <asm/kexec.h> 56 54 #include <asm/opal.h> 57 55 #include <asm/fadump.h> 56 + #include <asm/debug.h> 58 57 59 58 #include <mm/mmu_decl.h> 60 59 ··· 803 802 int err; 804 803 805 804 switch (action) { 806 - case PSERIES_RECONFIG_ADD: 805 + case OF_RECONFIG_ATTACH_NODE: 807 806 err = of_finish_dynamic_node(node); 808 807 if (err < 0) 809 808 printk(KERN_ERR "finish_node returned %d\n", err); ··· 822 821 823 822 static int __init prom_reconfig_setup(void) 824 823 { 825 - return pSeries_reconfig_notifier_register(&prom_reconfig_nb); 824 + return of_reconfig_notifier_register(&prom_reconfig_nb); 826 825 } 827 826 __initcall(prom_reconfig_setup); 828 827 #endif
+8 -3
arch/powerpc/kernel/prom_init.c
··· 671 671 #define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */ 672 672 #define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */ 673 673 #define OV1_PPC_2_06 0x02 /* set if we support PowerPC 2.06 */ 674 + #define OV1_PPC_2_07 0x01 /* set if we support PowerPC 2.07 */ 674 675 675 676 /* Option vector 2: Open Firmware options supported */ 676 677 #define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */ ··· 708 707 #define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */ 709 708 #define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */ 710 709 #define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */ 710 + #define OV5_SUB_PROCESSORS 0x01 /* 1,2,or 4 Sub-Processors supported */ 711 711 712 712 /* Option Vector 6: IBM PAPR hints */ 713 713 #define OV6_LINUX 0x02 /* Linux is our OS */ ··· 721 719 W(0xfffe0000), W(0x003a0000), /* POWER5/POWER5+ */ 722 720 W(0xffff0000), W(0x003e0000), /* POWER6 */ 723 721 W(0xffff0000), W(0x003f0000), /* POWER7 */ 722 + W(0xffff0000), W(0x004b0000), /* POWER8 */ 723 + W(0xffffffff), W(0x0f000004), /* all 2.07-compliant */ 724 724 W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */ 725 725 W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */ 726 726 W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */ ··· 732 728 3 - 2, /* length */ 733 729 0, /* don't ignore, don't halt */ 734 730 OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 | 735 - OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06, 731 + OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06 | OV1_PPC_2_07, 736 732 737 733 /* option vector 2: Open Firmware options supported */ 738 734 34 - 2, /* length */ ··· 759 755 OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */ 760 756 761 757 /* option vector 5: PAPR/OF options */ 762 - 18 - 2, /* length */ 758 + 19 - 2, /* length */ 763 759 0, /* don't ignore, don't halt */ 764 760 OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY | 765 761 OV5_DONATE_DEDICATE_CPU | OV5_MSI, ··· 773 769 * must match by the macro below. Update the definition if 774 770 * the structure layout changes. 775 771 */ 776 - #define IBM_ARCH_VEC_NRCORES_OFFSET 101 772 + #define IBM_ARCH_VEC_NRCORES_OFFSET 117 777 773 W(NR_CPUS), /* number of cores supported */ 778 774 0, 779 775 0, 780 776 0, 781 777 0, 782 778 OV5_PFO_HW_RNG | OV5_PFO_HW_ENCR | OV5_PFO_HW_842, 779 + OV5_SUB_PROCESSORS, 783 780 /* option vector 6: IBM PAPR hints */ 784 781 4 - 2, /* length */ 785 782 0,
+82 -8
arch/powerpc/kernel/ptrace.c
··· 952 952 arch_bp_generic_fields(data & 953 953 (DABR_DATA_WRITE | DABR_DATA_READ), 954 954 &attr.bp_type); 955 + 956 + /* Enable breakpoint */ 957 + attr.disabled = false; 958 + 955 959 ret = modify_user_hw_breakpoint(bp, &attr); 956 960 if (ret) { 957 961 ptrace_put_breakpoints(task); ··· 1041 1037 } 1042 1038 1043 1039 #ifdef CONFIG_PPC_ADV_DEBUG_REGS 1044 - static long set_intruction_bp(struct task_struct *child, 1040 + static long set_instruction_bp(struct task_struct *child, 1045 1041 struct ppc_hw_breakpoint *bp_info) 1046 1042 { 1047 1043 int slot; ··· 1342 1338 static long ppc_set_hwdebug(struct task_struct *child, 1343 1339 struct ppc_hw_breakpoint *bp_info) 1344 1340 { 1341 + #ifdef CONFIG_HAVE_HW_BREAKPOINT 1342 + int len = 0; 1343 + struct thread_struct *thread = &(child->thread); 1344 + struct perf_event *bp; 1345 + struct perf_event_attr attr; 1346 + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 1345 1347 #ifndef CONFIG_PPC_ADV_DEBUG_REGS 1346 1348 unsigned long dabr; 1347 1349 #endif ··· 1375 1365 if ((bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_EXECUTE) || 1376 1366 (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)) 1377 1367 return -EINVAL; 1378 - return set_intruction_bp(child, bp_info); 1368 + return set_instruction_bp(child, bp_info); 1379 1369 } 1380 1370 if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT) 1381 1371 return set_dac(child, bp_info); ··· 1391 1381 */ 1392 1382 if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 || 1393 1383 (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 || 1394 - bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT || 1395 1384 bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE) 1396 1385 return -EINVAL; 1397 - 1398 - if (child->thread.dabr) 1399 - return -ENOSPC; 1400 1386 1401 1387 if ((unsigned long)bp_info->addr >= TASK_SIZE) 1402 1388 return -EIO; ··· 1403 1397 dabr |= DABR_DATA_READ; 1404 1398 if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE) 1405 1399 dabr |= DABR_DATA_WRITE; 1400 + #ifdef CONFIG_HAVE_HW_BREAKPOINT 1401 + if (ptrace_get_breakpoints(child) < 0) 1402 + return -ESRCH; 1403 + 1404 + /* 1405 + * Check if the request is for 'range' breakpoints. We can 1406 + * support it if range < 8 bytes. 1407 + */ 1408 + if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) { 1409 + len = bp_info->addr2 - bp_info->addr; 1410 + } else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) { 1411 + ptrace_put_breakpoints(child); 1412 + return -EINVAL; 1413 + } 1414 + bp = thread->ptrace_bps[0]; 1415 + if (bp) { 1416 + ptrace_put_breakpoints(child); 1417 + return -ENOSPC; 1418 + } 1419 + 1420 + /* Create a new breakpoint request if one doesn't exist already */ 1421 + hw_breakpoint_init(&attr); 1422 + attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN; 1423 + attr.bp_len = len; 1424 + arch_bp_generic_fields(dabr & (DABR_DATA_WRITE | DABR_DATA_READ), 1425 + &attr.bp_type); 1426 + 1427 + thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr, 1428 + ptrace_triggered, NULL, child); 1429 + if (IS_ERR(bp)) { 1430 + thread->ptrace_bps[0] = NULL; 1431 + ptrace_put_breakpoints(child); 1432 + return PTR_ERR(bp); 1433 + } 1434 + 1435 + ptrace_put_breakpoints(child); 1436 + return 1; 1437 + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 1438 + 1439 + if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) 1440 + return -EINVAL; 1441 + 1442 + if (child->thread.dabr) 1443 + return -ENOSPC; 1406 1444 1407 1445 child->thread.dabr = dabr; 1408 1446 child->thread.dabrx = DABRX_ALL; ··· 1455 1405 #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */ 1456 1406 } 1457 1407 1458 - static long ppc_del_hwdebug(struct task_struct *child, long addr, long data) 1408 + static long ppc_del_hwdebug(struct task_struct *child, long data) 1459 1409 { 1410 + #ifdef CONFIG_HAVE_HW_BREAKPOINT 1411 + int ret = 0; 1412 + struct thread_struct *thread = &(child->thread); 1413 + struct perf_event *bp; 1414 + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 1460 1415 #ifdef CONFIG_PPC_ADV_DEBUG_REGS 1461 1416 int rc; 1462 1417 ··· 1481 1426 #else 1482 1427 if (data != 1) 1483 1428 return -EINVAL; 1429 + 1430 + #ifdef CONFIG_HAVE_HW_BREAKPOINT 1431 + if (ptrace_get_breakpoints(child) < 0) 1432 + return -ESRCH; 1433 + 1434 + bp = thread->ptrace_bps[0]; 1435 + if (bp) { 1436 + unregister_hw_breakpoint(bp); 1437 + thread->ptrace_bps[0] = NULL; 1438 + } else 1439 + ret = -ENOENT; 1440 + ptrace_put_breakpoints(child); 1441 + return ret; 1442 + #else /* CONFIG_HAVE_HW_BREAKPOINT */ 1484 1443 if (child->thread.dabr == 0) 1485 1444 return -ENOENT; 1486 1445 1487 1446 child->thread.dabr = 0; 1447 + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 1488 1448 1489 1449 return 0; 1490 1450 #endif ··· 1606 1536 dbginfo.data_bp_alignment = 4; 1607 1537 #endif 1608 1538 dbginfo.sizeof_condition = 0; 1539 + #ifdef CONFIG_HAVE_HW_BREAKPOINT 1540 + dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE; 1541 + #else 1609 1542 dbginfo.features = 0; 1543 + #endif /* CONFIG_HAVE_HW_BREAKPOINT */ 1610 1544 #endif /* CONFIG_PPC_ADV_DEBUG_REGS */ 1611 1545 1612 1546 if (!access_ok(VERIFY_WRITE, datavp, ··· 1637 1563 } 1638 1564 1639 1565 case PPC_PTRACE_DELHWDEBUG: { 1640 - ret = ppc_del_hwdebug(child, addr, data); 1566 + ret = ppc_del_hwdebug(child, data); 1641 1567 break; 1642 1568 } 1643 1569
-1
arch/powerpc/kernel/rtas.c
··· 42 42 #include <asm/time.h> 43 43 #include <asm/mmu.h> 44 44 #include <asm/topology.h> 45 - #include <asm/pSeries_reconfig.h> 46 45 47 46 struct rtas_t rtas = { 48 47 .lock = __ARCH_SPIN_LOCK_UNLOCKED
+1 -3
arch/powerpc/kernel/rtas_flash.c
··· 650 650 int token; 651 651 652 652 dp->data = kzalloc(buf_size, GFP_KERNEL); 653 - if (dp->data == NULL) { 654 - remove_flash_pde(dp); 653 + if (dp->data == NULL) 655 654 return -ENOMEM; 656 - } 657 655 658 656 /* 659 657 * This code assumes that the status int is the first member of the
+5
arch/powerpc/kernel/setup_64.c
··· 601 601 602 602 kvm_linear_init(); 603 603 604 + /* Interrupt code needs to be 64K-aligned */ 605 + if ((unsigned long)_stext & 0xffff) 606 + panic("Kernelbase not 64K-aligned (0x%lx)!\n", 607 + (unsigned long)_stext); 608 + 604 609 ppc64_boot_msg(0x15, "Setup Done"); 605 610 } 606 611
-23
arch/powerpc/kernel/udbg.c
··· 122 122 return n - remain; 123 123 } 124 124 125 - int udbg_read(char *buf, int buflen) 126 - { 127 - char *p = buf; 128 - int i, c; 129 - 130 - if (!udbg_getc) 131 - return 0; 132 - 133 - for (i = 0; i < buflen; ++i) { 134 - do { 135 - c = udbg_getc(); 136 - if (c == -1 && i == 0) 137 - return -1; 138 - 139 - } while (c == 0x11 || c == 0x13); 140 - if (c == 0 || c == -1) 141 - break; 142 - *p++ = c; 143 - } 144 - 145 - return i; 146 - } 147 - 148 125 #define UDBG_BUFSIZE 256 149 126 void udbg_printf(const char *fmt, ...) 150 127 {
-12
arch/powerpc/mm/numa.c
··· 399 399 return result; 400 400 } 401 401 402 - struct of_drconf_cell { 403 - u64 base_addr; 404 - u32 drc_index; 405 - u32 reserved; 406 - u32 aa_index; 407 - u32 flags; 408 - }; 409 - 410 - #define DRCONF_MEM_ASSIGNED 0x00000008 411 - #define DRCONF_MEM_AI_INVALID 0x00000040 412 - #define DRCONF_MEM_RESERVED 0x00000080 413 - 414 402 /* 415 403 * Read the next memblock list entry from the ibm,dynamic-memory property 416 404 * and return the information in the provided of_drconf_cell structure.
+4 -11
arch/powerpc/mm/tlb_nohash_low.S
··· 191 191 #ifdef CONFIG_PPC_47x 192 192 193 193 /* 194 - * 47x variant of icbt 195 - */ 196 - # define ICBT(CT,RA,RB) \ 197 - .long 0x7c00002c | ((CT) << 21) | ((RA) << 16) | ((RB) << 11) 198 - 199 - /* 200 194 * _tlbivax_bcast is only on 47x. We don't bother doing a runtime 201 195 * check though, it will blow up soon enough if we mistakenly try 202 196 * to use it on a 440. ··· 202 208 wrteei 0 203 209 mtspr SPRN_MMUCR,r5 204 210 isync 205 - /* tlbivax 0,r3 - use .long to avoid binutils deps */ 206 - .long 0x7c000624 | (r3 << 11) 211 + PPC_TLBIVAX(0, R3) 207 212 isync 208 213 eieio 209 214 tlbsync ··· 220 227 bl 2f 221 228 2: mflr r6 222 229 li r7,32 223 - ICBT(0,r6,r7) /* touch next cache line */ 230 + PPC_ICBT(0,R6,R7) /* touch next cache line */ 224 231 add r6,r6,r7 225 - ICBT(0,r6,r7) /* touch next cache line */ 232 + PPC_ICBT(0,R6,R7) /* touch next cache line */ 226 233 add r6,r6,r7 227 - ICBT(0,r6,r7) /* touch next cache line */ 234 + PPC_ICBT(0,R6,R7) /* touch next cache line */ 228 235 sync 229 236 nop 230 237 nop
+14 -3
arch/powerpc/perf/power7-pmu.c
··· 54 54 * Layout of constraint bits: 55 55 * 6666555555555544444444443333333333222222222211111111110000000000 56 56 * 3210987654321098765432109876543210987654321098765432109876543210 57 - * [ ><><><><><><> 58 - * NC P6P5P4P3P2P1 57 + * < >< ><><><><><><> 58 + * L2 NC P6P5P4P3P2P1 59 + * 60 + * L2 - 16-18 - Required L2SEL value (select field) 59 61 * 60 62 * NC - number of counters 61 63 * 15: NC error 0x8000 ··· 74 72 static int power7_get_constraint(u64 event, unsigned long *maskp, 75 73 unsigned long *valp) 76 74 { 77 - int pmc, sh; 75 + int pmc, sh, unit; 78 76 unsigned long mask = 0, value = 0; 79 77 80 78 pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; ··· 92 90 mask |= 0x8000; 93 91 value |= 0x1000; 94 92 } 93 + 94 + unit = (event >> PM_UNIT_SH) & PM_UNIT_MSK; 95 + if (unit == 6) { 96 + /* L2SEL must be identical across events */ 97 + int l2sel = (event >> PM_L2SEL_SH) & PM_L2SEL_MSK; 98 + mask |= 0x7 << 16; 99 + value |= l2sel << 16; 100 + } 101 + 95 102 *maskp = mask; 96 103 *valp = value; 97 104 return 0;
-1
arch/powerpc/platforms/512x/Kconfig
··· 2 2 bool "512x-based boards" 3 3 depends on 6xx 4 4 select FSL_SOC 5 - select FB_FSL_DIU 6 5 select IPIC 7 6 select PPC_CLOCK 8 7 select PPC_PCI_CHOICE
+3
arch/powerpc/platforms/512x/mpc5121_ads.c
··· 42 42 for_each_compatible_node(np, "pci", "fsl,mpc5121-pci") 43 43 mpc83xx_add_bridge(np); 44 44 #endif 45 + 46 + #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 45 47 mpc512x_setup_diu(); 48 + #endif 46 49 } 47 50 48 51 static void __init mpc5121_ads_init_IRQ(void)
+9 -2
arch/powerpc/platforms/512x/mpc512x.h
··· 16 16 extern int __init mpc5121_clk_init(void); 17 17 void __init mpc512x_declare_of_platform_devices(void); 18 18 extern void mpc512x_restart(char *cmd); 19 - extern void mpc512x_init_diu(void); 20 - extern void mpc512x_setup_diu(void); 19 + 20 + #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 21 + void mpc512x_init_diu(void); 22 + void mpc512x_setup_diu(void); 23 + #else 24 + #define mpc512x_init_diu NULL 25 + #define mpc512x_setup_diu NULL 26 + #endif 27 + 21 28 #endif /* __MPC512X_H__ */
+4 -21
arch/powerpc/platforms/512x/mpc512x_shared.c
··· 58 58 ; 59 59 } 60 60 61 + #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) 62 + 61 63 struct fsl_diu_shared_fb { 62 64 u8 gamma[0x300]; /* 32-bit aligned! */ 63 65 struct diu_ad ad0; /* 32-bit aligned! */ ··· 67 65 size_t fb_len; 68 66 bool in_use; 69 67 }; 70 - 71 - u32 mpc512x_get_pixel_format(enum fsl_diu_monitor_port port, 72 - unsigned int bits_per_pixel) 73 - { 74 - switch (bits_per_pixel) { 75 - case 32: 76 - return 0x88883316; 77 - case 24: 78 - return 0x88082219; 79 - case 16: 80 - return 0x65053118; 81 - } 82 - return 0x00000400; 83 - } 84 - 85 - void mpc512x_set_gamma_table(enum fsl_diu_monitor_port port, 86 - char *gamma_table_base) 87 - { 88 - } 89 68 90 69 void mpc512x_set_monitor_port(enum fsl_diu_monitor_port port) 91 70 { ··· 303 320 } 304 321 } 305 322 306 - diu_ops.get_pixel_format = mpc512x_get_pixel_format; 307 - diu_ops.set_gamma_table = mpc512x_set_gamma_table; 308 323 diu_ops.set_monitor_port = mpc512x_set_monitor_port; 309 324 diu_ops.set_pixel_clock = mpc512x_set_pixel_clock; 310 325 diu_ops.valid_monitor_port = mpc512x_valid_monitor_port; 311 326 diu_ops.release_bootmem = mpc512x_release_bootmem; 312 327 } 328 + 329 + #endif 313 330 314 331 void __init mpc512x_init_IRQ(void) 315 332 {
+1 -1
arch/powerpc/platforms/52xx/lite5200.c
··· 4 4 * Written by: Grant Likely <grant.likely@secretlab.ca> 5 5 * 6 6 * Copyright (C) Secret Lab Technologies Ltd. 2006. All rights reserved. 7 - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. 7 + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. 8 8 * 9 9 * Description: 10 10 * This program is free software; you can redistribute it and/or modify it
+1
arch/powerpc/platforms/52xx/mpc5200_simple.c
··· 50 50 51 51 /* list of the supported boards */ 52 52 static const char *board[] __initdata = { 53 + "anonymous,a3m071", 53 54 "anonymous,a4m072", 54 55 "anon,charon", 55 56 "ifm,o2d",
+1 -15
arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c
··· 578 578 .probe = mpc52xx_lpbfifo_probe, 579 579 .remove = __devexit_p(mpc52xx_lpbfifo_remove), 580 580 }; 581 - 582 - /*********************************************************************** 583 - * Module init/exit 584 - */ 585 - static int __init mpc52xx_lpbfifo_init(void) 586 - { 587 - return platform_driver_register(&mpc52xx_lpbfifo_driver); 588 - } 589 - module_init(mpc52xx_lpbfifo_init); 590 - 591 - static void __exit mpc52xx_lpbfifo_exit(void) 592 - { 593 - platform_driver_unregister(&mpc52xx_lpbfifo_driver); 594 - } 595 - module_exit(mpc52xx_lpbfifo_exit); 581 + module_platform_driver(mpc52xx_lpbfifo_driver);
+3 -5
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
··· 16 16 #include <linux/spinlock.h> 17 17 #include <linux/irq.h> 18 18 #include <linux/types.h> 19 - #include <linux/bootmem.h> 20 19 #include <linux/slab.h> 21 20 22 21 #include <asm/io.h> ··· 148 149 priv->regs = of_iomap(np, 0); 149 150 if (!priv->regs) { 150 151 printk(KERN_ERR "Cannot map PCI PIC registers.\n"); 151 - goto out_free_bootmem; 152 + goto out_free_kmalloc; 152 153 } 153 154 154 155 /* mask all PCI interrupts */ ··· 170 171 171 172 out_unmap_regs: 172 173 iounmap(priv->regs); 173 - out_free_bootmem: 174 - free_bootmem((unsigned long)priv, 175 - sizeof(struct pq2ads_pci_pic)); 174 + out_free_kmalloc: 175 + kfree(priv); 176 176 of_node_put(np); 177 177 out_unmap_irq: 178 178 irq_dispose_mapping(irq);
+1 -1
arch/powerpc/platforms/83xx/mpc832x_mds.c
··· 1 1 /* 2 - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. 2 + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Description: 5 5 * MPC832xE MDS board specific routines.
+1 -1
arch/powerpc/platforms/83xx/mpc836x_mds.c
··· 1 1 /* 2 - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. 2 + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Author: Li Yang <LeoLi@freescale.com> 5 5 * Yin Olivia <Hong-hua.Yin@freescale.com>
+1 -1
arch/powerpc/platforms/83xx/mpc836x_rdk.c
··· 1 1 /* 2 2 * MPC8360E-RDK board file. 3 3 * 4 - * Copyright (c) 2006 Freescale Semicondutor, Inc. 4 + * Copyright (c) 2006 Freescale Semiconductor, Inc. 5 5 * Copyright (c) 2007-2008 MontaVista Software, Inc. 6 6 * 7 7 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
+1 -1
arch/powerpc/platforms/83xx/mpc837x_rdb.c
··· 1 1 /* 2 2 * arch/powerpc/platforms/83xx/mpc837x_rdb.c 3 3 * 4 - * Copyright (C) 2007 Freescale Semicondutor, Inc. All rights reserved. 4 + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. 5 5 * 6 6 * MPC837x RDB board specific routines 7 7 *
+1 -1
arch/powerpc/platforms/85xx/mpc85xx_mds.c
··· 1 1 /* 2 - * Copyright (C) 2006-2010, 2012 Freescale Semicondutor, Inc. 2 + * Copyright (C) 2006-2010, 2012 Freescale Semiconductor, Inc. 3 3 * All rights reserved. 4 4 * 5 5 * Author: Andy Fleming <afleming@freescale.com>
+4 -4
arch/powerpc/platforms/85xx/p1022_ds.c
··· 249 249 goto exit; 250 250 } 251 251 252 - iprop = of_get_property(law_node, "fsl,num-laws", 0); 252 + iprop = of_get_property(law_node, "fsl,num-laws", NULL); 253 253 if (!iprop) { 254 254 pr_err("p1022ds: LAW node is missing fsl,num-laws property\n"); 255 255 goto exit; ··· 539 539 }; 540 540 541 541 /* 542 - * prom_update_property() is called before 542 + * of_update_property() is called before 543 543 * kmalloc() is available, so the 'new' object 544 544 * should be allocated in the global area. 545 545 * The easiest way is to do that is to ··· 548 548 */ 549 549 pr_info("p1022ds: disabling %s node", 550 550 np2->full_name); 551 - prom_update_property(np2, &nor_status); 551 + of_update_property(np2, &nor_status); 552 552 of_node_put(np2); 553 553 } 554 554 ··· 564 564 565 565 pr_info("p1022ds: disabling %s node", 566 566 np2->full_name); 567 - prom_update_property(np2, &nand_status); 567 + of_update_property(np2, &nand_status); 568 568 of_node_put(np2); 569 569 } 570 570
+36 -13
arch/powerpc/platforms/85xx/smp.c
··· 128 128 } 129 129 #endif 130 130 131 + static inline void flush_spin_table(void *spin_table) 132 + { 133 + flush_dcache_range((ulong)spin_table, 134 + (ulong)spin_table + sizeof(struct epapr_spin_table)); 135 + } 136 + 137 + static inline u32 read_spin_table_addr_l(void *spin_table) 138 + { 139 + flush_dcache_range((ulong)spin_table, 140 + (ulong)spin_table + sizeof(struct epapr_spin_table)); 141 + return in_be32(&((struct epapr_spin_table *)spin_table)->addr_l); 142 + } 143 + 131 144 static int __cpuinit smp_85xx_kick_cpu(int nr) 132 145 { 133 146 unsigned long flags; ··· 174 161 175 162 /* Map the spin table */ 176 163 if (ioremappable) 177 - spin_table = ioremap(*cpu_rel_addr, 178 - sizeof(struct epapr_spin_table)); 164 + spin_table = ioremap_prot(*cpu_rel_addr, 165 + sizeof(struct epapr_spin_table), _PAGE_COHERENT); 179 166 else 180 167 spin_table = phys_to_virt(*cpu_rel_addr); 181 168 ··· 186 173 generic_set_cpu_up(nr); 187 174 188 175 if (system_state == SYSTEM_RUNNING) { 176 + /* 177 + * To keep it compatible with old boot program which uses 178 + * cache-inhibit spin table, we need to flush the cache 179 + * before accessing spin table to invalidate any staled data. 180 + * We also need to flush the cache after writing to spin 181 + * table to push data out. 182 + */ 183 + flush_spin_table(spin_table); 189 184 out_be32(&spin_table->addr_l, 0); 185 + flush_spin_table(spin_table); 190 186 191 187 /* 192 188 * We don't set the BPTR register here since it already points ··· 203 181 */ 204 182 mpic_reset_core(hw_cpu); 205 183 206 - /* wait until core is ready... */ 207 - if (!spin_event_timeout(in_be32(&spin_table->addr_l) == 1, 208 - 10000, 100)) { 184 + /* 185 + * wait until core is ready... 186 + * We need to invalidate the stale data, in case the boot 187 + * loader uses a cache-inhibited spin table. 188 + */ 189 + if (!spin_event_timeout( 190 + read_spin_table_addr_l(spin_table) == 1, 191 + 10000, 100)) { 209 192 pr_err("%s: timeout waiting for core %d to reset\n", 210 193 __func__, hw_cpu); 211 194 ret = -ENOENT; ··· 221 194 __secondary_hold_acknowledge = -1; 222 195 } 223 196 #endif 197 + flush_spin_table(spin_table); 224 198 out_be32(&spin_table->pir, hw_cpu); 225 199 out_be32(&spin_table->addr_l, __pa(__early_start)); 226 - 227 - if (!ioremappable) 228 - flush_dcache_range((ulong)spin_table, 229 - (ulong)spin_table + sizeof(struct epapr_spin_table)); 200 + flush_spin_table(spin_table); 230 201 231 202 /* Wait a bit for the CPU to ack. */ 232 203 if (!spin_event_timeout(__secondary_hold_acknowledge == hw_cpu, ··· 238 213 #else 239 214 smp_generic_kick_cpu(nr); 240 215 216 + flush_spin_table(spin_table); 241 217 out_be32(&spin_table->pir, hw_cpu); 242 218 out_be64((u64 *)(&spin_table->addr_h), 243 219 __pa((u64)*((unsigned long long *)generic_secondary_smp_init))); 244 - 245 - if (!ioremappable) 246 - flush_dcache_range((ulong)spin_table, 247 - (ulong)spin_table + sizeof(struct epapr_spin_table)); 220 + flush_spin_table(spin_table); 248 221 #endif 249 222 250 223 local_irq_restore(flags);
+2
arch/powerpc/platforms/86xx/mpc8610_hpcd.c
··· 353 353 .time_init = mpc86xx_time_init, 354 354 .calibrate_decr = generic_calibrate_decr, 355 355 .progress = udbg_progress, 356 + #ifdef CONFIG_PCI 356 357 .pcibios_fixup_bus = fsl_pcibios_fixup_bus, 358 + #endif 357 359 };
+4 -1
arch/powerpc/platforms/powermac/cpufreq_32.c
··· 55 55 static unsigned int hi_freq; 56 56 static unsigned int cur_freq; 57 57 static unsigned int sleep_freq; 58 + static unsigned long transition_latency; 58 59 59 60 /* 60 61 * Different models uses different mechanisms to switch the frequency ··· 404 403 if (policy->cpu != 0) 405 404 return -ENODEV; 406 405 407 - policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 406 + policy->cpuinfo.transition_latency = transition_latency; 408 407 policy->cur = cur_freq; 409 408 410 409 cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); ··· 659 658 if (!value) 660 659 goto out; 661 660 cur_freq = (*value) / 1000; 661 + transition_latency = CPUFREQ_ETERNAL; 662 662 663 663 /* Check for 7447A based MacRISC3 */ 664 664 if (of_machine_is_compatible("MacRISC3") && 665 665 of_get_property(cpunode, "dynamic-power-step", NULL) && 666 666 PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { 667 667 pmac_cpufreq_init_7447A(cpunode); 668 + transition_latency = 8000000; 668 669 /* Check for other MacRISC3 machines */ 669 670 } else if (of_machine_is_compatible("PowerBook3,4") || 670 671 of_machine_is_compatible("PowerBook3,5") ||
+11 -14
arch/powerpc/platforms/powernv/pci-ioda.c
··· 34 34 #include "powernv.h" 35 35 #include "pci.h" 36 36 37 - static int __pe_printk(const char *level, const struct pnv_ioda_pe *pe, 38 - struct va_format *vaf) 39 - { 40 - char pfix[32]; 41 - 42 - if (pe->pdev) 43 - strlcpy(pfix, dev_name(&pe->pdev->dev), sizeof(pfix)); 44 - else 45 - sprintf(pfix, "%04x:%02x ", 46 - pci_domain_nr(pe->pbus), pe->pbus->number); 47 - return printk("pci %s%s: [PE# %.3d] %pV", level, pfix, pe->pe_number, vaf); 48 - } 49 - 50 37 #define define_pe_printk_level(func, kern_level) \ 51 38 static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ 52 39 { \ 53 40 struct va_format vaf; \ 54 41 va_list args; \ 42 + char pfix[32]; \ 55 43 int r; \ 56 44 \ 57 45 va_start(args, fmt); \ ··· 47 59 vaf.fmt = fmt; \ 48 60 vaf.va = &args; \ 49 61 \ 50 - r = __pe_printk(kern_level, pe, &vaf); \ 62 + if (pe->pdev) \ 63 + strlcpy(pfix, dev_name(&pe->pdev->dev), \ 64 + sizeof(pfix)); \ 65 + else \ 66 + sprintf(pfix, "%04x:%02x ", \ 67 + pci_domain_nr(pe->pbus), \ 68 + pe->pbus->number); \ 69 + r = printk(kern_level "pci %s: [PE# %.3d] %pV", \ 70 + pfix, pe->pe_number, &vaf); \ 71 + \ 51 72 va_end(args); \ 52 73 \ 53 74 return r; \
+3 -3
arch/powerpc/platforms/ps3/os-area.c
··· 280 280 281 281 if (tmp) { 282 282 pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name); 283 - prom_remove_property(node, tmp); 283 + of_remove_property(node, tmp); 284 284 } 285 285 286 - result = prom_add_property(node, prop); 286 + result = of_add_property(node, prop); 287 287 288 288 if (result) 289 - pr_debug("%s:%d prom_set_property failed\n", __func__, 289 + pr_debug("%s:%d of_set_property failed\n", __func__, 290 290 __LINE__); 291 291 } 292 292
+6 -28
arch/powerpc/platforms/pseries/dlpar.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/kref.h> 15 15 #include <linux/notifier.h> 16 - #include <linux/proc_fs.h> 17 16 #include <linux/spinlock.h> 18 17 #include <linux/cpu.h> 19 18 #include <linux/slab.h> 19 + #include <linux/of.h> 20 20 #include "offline_states.h" 21 21 22 22 #include <asm/prom.h> 23 23 #include <asm/machdep.h> 24 24 #include <asm/uaccess.h> 25 25 #include <asm/rtas.h> 26 - #include <asm/pSeries_reconfig.h> 27 26 28 27 struct cc_workarea { 29 28 u32 drc_index; ··· 254 255 255 256 int dlpar_attach_node(struct device_node *dn) 256 257 { 257 - #ifdef CONFIG_PROC_DEVICETREE 258 - struct proc_dir_entry *ent; 259 - #endif 260 258 int rc; 261 259 262 260 of_node_set_flag(dn, OF_DYNAMIC); ··· 262 266 if (!dn->parent) 263 267 return -ENOMEM; 264 268 265 - rc = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, dn); 269 + rc = of_attach_node(dn); 266 270 if (rc) { 267 271 printk(KERN_ERR "Failed to add device node %s\n", 268 272 dn->full_name); 269 273 return rc; 270 274 } 271 - 272 - of_attach_node(dn); 273 - 274 - #ifdef CONFIG_PROC_DEVICETREE 275 - ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); 276 - if (ent) 277 - proc_device_tree_add_node(dn, ent); 278 - #endif 279 275 280 276 of_node_put(dn->parent); 281 277 return 0; ··· 275 287 276 288 int dlpar_detach_node(struct device_node *dn) 277 289 { 278 - #ifdef CONFIG_PROC_DEVICETREE 279 - struct device_node *parent = dn->parent; 280 - struct property *prop = dn->properties; 290 + int rc; 281 291 282 - while (prop) { 283 - remove_proc_entry(prop->name, dn->pde); 284 - prop = prop->next; 285 - } 292 + rc = of_detach_node(dn); 293 + if (rc) 294 + return rc; 286 295 287 - if (dn->pde) 288 - remove_proc_entry(dn->pde->name, parent->pde); 289 - #endif 290 - 291 - pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn); 292 - of_detach_node(dn); 293 296 of_node_put(dn); /* Must decrement the refcount */ 294 - 295 297 return 0; 296 298 } 297 299
+1
arch/powerpc/platforms/pseries/firmware.c
··· 56 56 {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, 57 57 {FW_FEATURE_SPLPAR, "hcall-splpar"}, 58 58 {FW_FEATURE_VPHN, "hcall-vphn"}, 59 + {FW_FEATURE_SET_MODE, "hcall-set-mode"}, 59 60 }; 60 61 61 62 /* Build up the firmware features bitmask using the contents of
+4 -4
arch/powerpc/platforms/pseries/hotplug-cpu.c
··· 23 23 #include <linux/delay.h> 24 24 #include <linux/sched.h> /* for idle_task_exit */ 25 25 #include <linux/cpu.h> 26 + #include <linux/of.h> 26 27 #include <asm/prom.h> 27 28 #include <asm/rtas.h> 28 29 #include <asm/firmware.h> 29 30 #include <asm/machdep.h> 30 31 #include <asm/vdso_datapage.h> 31 - #include <asm/pSeries_reconfig.h> 32 32 #include <asm/xics.h> 33 33 #include "plpar_wrappers.h" 34 34 #include "offline_states.h" ··· 333 333 int err = 0; 334 334 335 335 switch (action) { 336 - case PSERIES_RECONFIG_ADD: 336 + case OF_RECONFIG_ATTACH_NODE: 337 337 err = pseries_add_processor(node); 338 338 break; 339 - case PSERIES_RECONFIG_REMOVE: 339 + case OF_RECONFIG_DETACH_NODE: 340 340 pseries_remove_processor(node); 341 341 break; 342 342 } ··· 399 399 400 400 /* Processors can be added/removed only on LPAR */ 401 401 if (firmware_has_feature(FW_FEATURE_LPAR)) { 402 - pSeries_reconfig_notifier_register(&pseries_smp_nb); 402 + of_reconfig_notifier_register(&pseries_smp_nb); 403 403 cpu_maps_update_begin(); 404 404 if (cede_offline_enabled && parse_cede_parameters() == 0) { 405 405 default_offline_state = CPU_STATE_INACTIVE;
+43 -17
arch/powerpc/platforms/pseries/hotplug-memory.c
··· 16 16 17 17 #include <asm/firmware.h> 18 18 #include <asm/machdep.h> 19 - #include <asm/pSeries_reconfig.h> 20 19 #include <asm/sparsemem.h> 21 20 22 21 static unsigned long get_memblock_size(void) ··· 186 187 return (ret < 0) ? -EINVAL : 0; 187 188 } 188 189 189 - static int pseries_drconf_memory(unsigned long *base, unsigned int action) 190 + static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) 190 191 { 192 + struct of_drconf_cell *new_drmem, *old_drmem; 191 193 unsigned long memblock_size; 192 - int rc; 194 + u32 entries; 195 + u32 *p; 196 + int i, rc = -EINVAL; 193 197 194 198 memblock_size = get_memblock_size(); 195 199 if (!memblock_size) 196 200 return -EINVAL; 197 201 198 - if (action == PSERIES_DRCONF_MEM_ADD) { 199 - rc = memblock_add(*base, memblock_size); 200 - rc = (rc < 0) ? -EINVAL : 0; 201 - } else if (action == PSERIES_DRCONF_MEM_REMOVE) { 202 - rc = pseries_remove_memblock(*base, memblock_size); 203 - } else { 204 - rc = -EINVAL; 202 + p = (u32 *)of_get_property(pr->dn, "ibm,dynamic-memory", NULL); 203 + if (!p) 204 + return -EINVAL; 205 + 206 + /* The first int of the property is the number of lmb's described 207 + * by the property. This is followed by an array of of_drconf_cell 208 + * entries. Get the niumber of entries and skip to the array of 209 + * of_drconf_cell's. 210 + */ 211 + entries = *p++; 212 + old_drmem = (struct of_drconf_cell *)p; 213 + 214 + p = (u32 *)pr->prop->value; 215 + p++; 216 + new_drmem = (struct of_drconf_cell *)p; 217 + 218 + for (i = 0; i < entries; i++) { 219 + if ((old_drmem[i].flags & DRCONF_MEM_ASSIGNED) && 220 + (!(new_drmem[i].flags & DRCONF_MEM_ASSIGNED))) { 221 + rc = pseries_remove_memblock(old_drmem[i].base_addr, 222 + memblock_size); 223 + break; 224 + } else if ((!(old_drmem[i].flags & DRCONF_MEM_ASSIGNED)) && 225 + (new_drmem[i].flags & DRCONF_MEM_ASSIGNED)) { 226 + rc = memblock_add(old_drmem[i].base_addr, 227 + memblock_size); 228 + rc = (rc < 0) ? -EINVAL : 0; 229 + break; 230 + } 205 231 } 206 232 207 233 return rc; 208 234 } 209 235 210 236 static int pseries_memory_notifier(struct notifier_block *nb, 211 - unsigned long action, void *node) 237 + unsigned long action, void *node) 212 238 { 239 + struct of_prop_reconfig *pr; 213 240 int err = 0; 214 241 215 242 switch (action) { 216 - case PSERIES_RECONFIG_ADD: 243 + case OF_RECONFIG_ATTACH_NODE: 217 244 err = pseries_add_memory(node); 218 245 break; 219 - case PSERIES_RECONFIG_REMOVE: 246 + case OF_RECONFIG_DETACH_NODE: 220 247 err = pseries_remove_memory(node); 221 248 break; 222 - case PSERIES_DRCONF_MEM_ADD: 223 - case PSERIES_DRCONF_MEM_REMOVE: 224 - err = pseries_drconf_memory(node, action); 249 + case OF_RECONFIG_UPDATE_PROPERTY: 250 + pr = (struct of_prop_reconfig *)node; 251 + if (!strcmp(pr->prop->name, "ibm,dynamic-memory")) 252 + err = pseries_update_drconf_memory(pr); 225 253 break; 226 254 } 227 255 return notifier_from_errno(err); ··· 261 235 static int __init pseries_memory_hotplug_init(void) 262 236 { 263 237 if (firmware_has_feature(FW_FEATURE_LPAR)) 264 - pSeries_reconfig_notifier_register(&pseries_mem_nb); 238 + of_reconfig_notifier_register(&pseries_mem_nb); 265 239 266 240 return 0; 267 241 }
+5 -5
arch/powerpc/platforms/pseries/iommu.c
··· 36 36 #include <linux/dma-mapping.h> 37 37 #include <linux/crash_dump.h> 38 38 #include <linux/memory.h> 39 + #include <linux/of.h> 39 40 #include <asm/io.h> 40 41 #include <asm/prom.h> 41 42 #include <asm/rtas.h> 42 43 #include <asm/iommu.h> 43 44 #include <asm/pci-bridge.h> 44 45 #include <asm/machdep.h> 45 - #include <asm/pSeries_reconfig.h> 46 46 #include <asm/firmware.h> 47 47 #include <asm/tce.h> 48 48 #include <asm/ppc-pci.h> ··· 760 760 __remove_ddw(np, ddw_avail, liobn); 761 761 762 762 delprop: 763 - ret = prom_remove_property(np, win64); 763 + ret = of_remove_property(np, win64); 764 764 if (ret) 765 765 pr_warning("%s: failed to remove direct window property: %d\n", 766 766 np->full_name, ret); ··· 1070 1070 goto out_free_window; 1071 1071 } 1072 1072 1073 - ret = prom_add_property(pdn, win64); 1073 + ret = of_add_property(pdn, win64); 1074 1074 if (ret) { 1075 1075 dev_err(&dev->dev, "unable to add dma window property for %s: %d", 1076 1076 pdn->full_name, ret); ··· 1294 1294 struct direct_window *window; 1295 1295 1296 1296 switch (action) { 1297 - case PSERIES_RECONFIG_REMOVE: 1297 + case OF_RECONFIG_DETACH_NODE: 1298 1298 if (pci && pci->iommu_table) 1299 1299 iommu_free_table(pci->iommu_table, np->full_name); 1300 1300 ··· 1357 1357 } 1358 1358 1359 1359 1360 - pSeries_reconfig_notifier_register(&iommu_reconfig_nb); 1360 + of_reconfig_notifier_register(&iommu_reconfig_nb); 1361 1361 register_memory_notifier(&iommu_mem_nb); 1362 1362 1363 1363 set_pci_dma_ops(&dma_iommu_ops);
+2 -2
arch/powerpc/platforms/pseries/mobility.c
··· 116 116 } 117 117 118 118 if (!more) { 119 - prom_update_property(dn, new_prop); 119 + of_update_property(dn, new_prop); 120 120 new_prop = NULL; 121 121 } 122 122 ··· 172 172 173 173 case 0x80000000: 174 174 prop = of_find_property(dn, prop_name, NULL); 175 - prom_remove_property(dn, prop); 175 + of_remove_property(dn, prop); 176 176 prop = NULL; 177 177 break; 178 178
+31
arch/powerpc/platforms/pseries/plpar_wrappers.h
··· 273 273 lbuf[1]); 274 274 } 275 275 276 + /* Set various resource mode parameters */ 277 + static inline long plpar_set_mode(unsigned long mflags, unsigned long resource, 278 + unsigned long value1, unsigned long value2) 279 + { 280 + return plpar_hcall_norets(H_SET_MODE, mflags, resource, value1, value2); 281 + } 282 + 283 + /* 284 + * Enable relocation on exceptions on this partition 285 + * 286 + * Note: this call has a partition wide scope and can take a while to complete. 287 + * If it returns H_LONG_BUSY_* it should be retried periodically until it 288 + * returns H_SUCCESS. 289 + */ 290 + static inline long enable_reloc_on_exceptions(void) 291 + { 292 + /* mflags = 3: Exceptions at 0xC000000000004000 */ 293 + return plpar_set_mode(3, 3, 0, 0); 294 + } 295 + 296 + /* 297 + * Disable relocation on exceptions on this partition 298 + * 299 + * Note: this call has a partition wide scope and can take a while to complete. 300 + * If it returns H_LONG_BUSY_* it should be retried periodically until it 301 + * returns H_SUCCESS. 302 + */ 303 + static inline long disable_reloc_on_exceptions(void) { 304 + return plpar_set_mode(0, 3, 0, 0); 305 + } 306 + 276 307 #endif /* _PSERIES_PLPAR_WRAPPERS_H */
+6 -113
arch/powerpc/platforms/pseries/reconfig.c
··· 16 16 #include <linux/notifier.h> 17 17 #include <linux/proc_fs.h> 18 18 #include <linux/slab.h> 19 + #include <linux/of.h> 19 20 20 21 #include <asm/prom.h> 21 22 #include <asm/machdep.h> 22 23 #include <asm/uaccess.h> 23 - #include <asm/pSeries_reconfig.h> 24 24 #include <asm/mmu.h> 25 - 26 - 27 - 28 - /* 29 - * Routines for "runtime" addition and removal of device tree nodes. 30 - */ 31 - #ifdef CONFIG_PROC_DEVICETREE 32 - /* 33 - * Add a node to /proc/device-tree. 34 - */ 35 - static void add_node_proc_entries(struct device_node *np) 36 - { 37 - struct proc_dir_entry *ent; 38 - 39 - ent = proc_mkdir(strrchr(np->full_name, '/') + 1, np->parent->pde); 40 - if (ent) 41 - proc_device_tree_add_node(np, ent); 42 - } 43 - 44 - static void remove_node_proc_entries(struct device_node *np) 45 - { 46 - struct property *pp = np->properties; 47 - struct device_node *parent = np->parent; 48 - 49 - while (pp) { 50 - remove_proc_entry(pp->name, np->pde); 51 - pp = pp->next; 52 - } 53 - if (np->pde) 54 - remove_proc_entry(np->pde->name, parent->pde); 55 - } 56 - #else /* !CONFIG_PROC_DEVICETREE */ 57 - static void add_node_proc_entries(struct device_node *np) 58 - { 59 - return; 60 - } 61 - 62 - static void remove_node_proc_entries(struct device_node *np) 63 - { 64 - return; 65 - } 66 - #endif /* CONFIG_PROC_DEVICETREE */ 67 25 68 26 /** 69 27 * derive_parent - basically like dirname(1) ··· 55 97 return parent; 56 98 } 57 99 58 - static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); 59 - 60 - int pSeries_reconfig_notifier_register(struct notifier_block *nb) 61 - { 62 - return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb); 63 - } 64 - EXPORT_SYMBOL_GPL(pSeries_reconfig_notifier_register); 65 - 66 - void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) 67 - { 68 - blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); 69 - } 70 - EXPORT_SYMBOL_GPL(pSeries_reconfig_notifier_unregister); 71 - 72 - int pSeries_reconfig_notify(unsigned long action, void *p) 73 - { 74 - int err = blocking_notifier_call_chain(&pSeries_reconfig_chain, 75 - action, p); 76 - 77 - return notifier_to_errno(err); 78 - } 79 - 80 100 static int pSeries_reconfig_add_node(const char *path, struct property *proplist) 81 101 { 82 102 struct device_node *np; ··· 78 142 goto out_err; 79 143 } 80 144 81 - err = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, np); 145 + err = of_attach_node(np); 82 146 if (err) { 83 147 printk(KERN_ERR "Failed to add device node %s\n", path); 84 148 goto out_err; 85 149 } 86 - 87 - of_attach_node(np); 88 - 89 - add_node_proc_entries(np); 90 150 91 151 of_node_put(np->parent); 92 152 ··· 111 179 return -EBUSY; 112 180 } 113 181 114 - remove_node_proc_entries(np); 115 - 116 - pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np); 117 182 of_detach_node(np); 118 - 119 183 of_node_put(parent); 120 184 of_node_put(np); /* Must decrement the refcount */ 121 185 return 0; ··· 325 397 if (!prop) 326 398 return -ENOMEM; 327 399 328 - prom_add_property(np, prop); 400 + of_add_property(np, prop); 329 401 330 402 return 0; 331 403 } ··· 349 421 350 422 prop = of_find_property(np, buf, NULL); 351 423 352 - return prom_remove_property(np, prop); 424 + return of_remove_property(np, prop); 353 425 } 354 426 355 427 static int do_update_property(char *buf, size_t bufsize) 356 428 { 357 429 struct device_node *np; 358 - struct pSeries_reconfig_prop_update upd_value; 359 430 unsigned char *value; 360 431 char *name, *end, *next_prop; 361 - int rc, length; 432 + int length; 362 433 struct property *newprop; 363 434 buf = parse_node(buf, bufsize, &np); 364 435 end = buf + bufsize; ··· 379 452 if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) 380 453 slb_set_size(*(int *)value); 381 454 382 - upd_value.node = np; 383 - upd_value.property = newprop; 384 - pSeries_reconfig_notify(PSERIES_UPDATE_PROPERTY, &upd_value); 385 - 386 - rc = prom_update_property(np, newprop); 387 - if (rc) 388 - return rc; 389 - 390 - /* For memory under the ibm,dynamic-reconfiguration-memory node 391 - * of the device tree, adding and removing memory is just an update 392 - * to the ibm,dynamic-memory property instead of adding/removing a 393 - * memory node in the device tree. For these cases we still need to 394 - * involve the notifier chain. 395 - */ 396 - if (!strcmp(name, "ibm,dynamic-memory")) { 397 - int action; 398 - 399 - next_prop = parse_next_property(next_prop, end, &name, 400 - &length, &value); 401 - if (!next_prop) 402 - return -EINVAL; 403 - 404 - if (!strcmp(name, "add")) 405 - action = PSERIES_DRCONF_MEM_ADD; 406 - else 407 - action = PSERIES_DRCONF_MEM_REMOVE; 408 - 409 - rc = pSeries_reconfig_notify(action, value); 410 - if (rc) { 411 - prom_update_property(np, newprop); 412 - return rc; 413 - } 414 - } 415 - 416 - return 0; 455 + return of_update_property(np, newprop); 417 456 } 418 457 419 458 /**
+74 -3
arch/powerpc/platforms/pseries/setup.c
··· 40 40 #include <linux/seq_file.h> 41 41 #include <linux/root_dev.h> 42 42 #include <linux/cpuidle.h> 43 + #include <linux/of.h> 44 + #include <linux/kexec.h> 43 45 44 46 #include <asm/mmu.h> 45 47 #include <asm/processor.h> ··· 65 63 #include <asm/smp.h> 66 64 #include <asm/firmware.h> 67 65 #include <asm/eeh.h> 68 - #include <asm/pSeries_reconfig.h> 69 66 70 67 #include "plpar_wrappers.h" 71 68 #include "pseries.h" ··· 259 258 int err = NOTIFY_OK; 260 259 261 260 switch (action) { 262 - case PSERIES_RECONFIG_ADD: 261 + case OF_RECONFIG_ATTACH_NODE: 263 262 pci = np->parent->data; 264 263 if (pci) { 265 264 update_dn_pci_info(np, pci->phb); ··· 368 367 } 369 368 } 370 369 370 + /* 371 + * Enable relocation on during exceptions. This has partition wide scope and 372 + * may take a while to complete, if it takes longer than one second we will 373 + * just give up rather than wasting any more time on this - if that turns out 374 + * to ever be a problem in practice we can move this into a kernel thread to 375 + * finish off the process later in boot. 376 + */ 377 + static int __init pSeries_enable_reloc_on_exc(void) 378 + { 379 + long rc; 380 + unsigned int delay, total_delay = 0; 381 + 382 + while (1) { 383 + rc = enable_reloc_on_exceptions(); 384 + if (!H_IS_LONG_BUSY(rc)) 385 + return rc; 386 + 387 + delay = get_longbusy_msecs(rc); 388 + total_delay += delay; 389 + if (total_delay > 1000) { 390 + pr_warn("Warning: Giving up waiting to enable " 391 + "relocation on exceptions (%u msec)!\n", 392 + total_delay); 393 + return rc; 394 + } 395 + 396 + mdelay(delay); 397 + } 398 + } 399 + 400 + #ifdef CONFIG_KEXEC 401 + static long pSeries_disable_reloc_on_exc(void) 402 + { 403 + long rc; 404 + 405 + while (1) { 406 + rc = disable_reloc_on_exceptions(); 407 + if (!H_IS_LONG_BUSY(rc)) 408 + return rc; 409 + mdelay(get_longbusy_msecs(rc)); 410 + } 411 + } 412 + 413 + static void pSeries_machine_kexec(struct kimage *image) 414 + { 415 + long rc; 416 + 417 + if (firmware_has_feature(FW_FEATURE_SET_MODE) && 418 + (image->type != KEXEC_TYPE_CRASH)) { 419 + rc = pSeries_disable_reloc_on_exc(); 420 + if (rc != H_SUCCESS) 421 + pr_warning("Warning: Failed to disable relocation on " 422 + "exceptions: %ld\n", rc); 423 + } 424 + 425 + default_machine_kexec(image); 426 + } 427 + #endif 428 + 371 429 static void __init pSeries_setup_arch(void) 372 430 { 373 431 panic_timeout = 10; ··· 449 389 /* Find and initialize PCI host bridges */ 450 390 init_pci_config_tokens(); 451 391 find_and_init_phbs(); 452 - pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb); 392 + of_reconfig_notifier_register(&pci_dn_reconfig_nb); 453 393 454 394 pSeries_nvram_init(); 455 395 ··· 462 402 ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; 463 403 else 464 404 ppc_md.enable_pmcs = power4_enable_pmcs; 405 + 406 + if (firmware_has_feature(FW_FEATURE_SET_MODE)) { 407 + long rc; 408 + if ((rc = pSeries_enable_reloc_on_exc()) != H_SUCCESS) { 409 + pr_warn("Unable to enable relocation on exceptions: " 410 + "%ld\n", rc); 411 + } 412 + } 465 413 } 466 414 467 415 static int __init pSeries_init_panel(void) ··· 727 659 .progress = rtas_progress, 728 660 .system_reset_exception = pSeries_system_reset_exception, 729 661 .machine_check_exception = pSeries_machine_check_exception, 662 + #ifdef CONFIG_KEXEC 663 + .machine_kexec = pSeries_machine_kexec, 664 + #endif 730 665 };
-1
arch/powerpc/platforms/pseries/smp.c
··· 38 38 #include <asm/cputable.h> 39 39 #include <asm/firmware.h> 40 40 #include <asm/rtas.h> 41 - #include <asm/pSeries_reconfig.h> 42 41 #include <asm/mpic.h> 43 42 #include <asm/vdso_datapage.h> 44 43 #include <asm/cputhreads.h>
+1 -1
arch/powerpc/sysdev/fsl_gtm.c
··· 1 1 /* 2 2 * Freescale General-purpose Timers Module 3 3 * 4 - * Copyright (c) Freescale Semicondutor, Inc. 2006. 4 + * Copyright (c) Freescale Semiconductor, Inc. 2006. 5 5 * Shlomi Gridish <gridish@freescale.com> 6 6 * Jerry Huang <Chang-Ming.Huang@freescale.com> 7 7 * Copyright (c) MontaVista Software, Inc. 2008.
+35 -2
arch/powerpc/sysdev/fsl_pci.c
··· 89 89 return 0; 90 90 } 91 91 92 - static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, 92 + static int setup_one_atmu(struct ccsr_pci __iomem *pci, 93 93 unsigned int index, const struct resource *res, 94 94 resource_size_t offset) 95 95 { ··· 126 126 } 127 127 128 128 /* atmu setup for fsl pci/pcie controller */ 129 - static void __init setup_pci_atmu(struct pci_controller *hose, 129 + static void setup_pci_atmu(struct pci_controller *hose, 130 130 struct resource *rsrc) 131 131 { 132 132 struct ccsr_pci __iomem *pci; ··· 902 902 return 0; 903 903 } 904 904 905 + #ifdef CONFIG_PM 906 + static int fsl_pci_resume(struct device *dev) 907 + { 908 + struct pci_controller *hose; 909 + struct resource pci_rsrc; 910 + 911 + hose = pci_find_hose_for_OF_device(dev->of_node); 912 + if (!hose) 913 + return -ENODEV; 914 + 915 + if (of_address_to_resource(dev->of_node, 0, &pci_rsrc)) { 916 + dev_err(dev, "Get pci register base failed."); 917 + return -ENODEV; 918 + } 919 + 920 + setup_pci_atmu(hose, &pci_rsrc); 921 + 922 + return 0; 923 + } 924 + 925 + static const struct dev_pm_ops pci_pm_ops = { 926 + .resume = fsl_pci_resume, 927 + }; 928 + 929 + #define PCI_PM_OPS (&pci_pm_ops) 930 + 931 + #else 932 + 933 + #define PCI_PM_OPS NULL 934 + 935 + #endif 936 + 905 937 static struct platform_driver fsl_pci_driver = { 906 938 .driver = { 907 939 .name = "fsl-pci", 940 + .pm = PCI_PM_OPS, 908 941 .of_match_table = pci_ids, 909 942 }, 910 943 .probe = fsl_pci_probe,
+1 -12
arch/powerpc/sysdev/pmi.c
··· 214 214 .of_match_table = pmi_match, 215 215 }, 216 216 }; 217 - 218 - static int __init pmi_module_init(void) 219 - { 220 - return platform_driver_register(&pmi_of_platform_driver); 221 - } 222 - module_init(pmi_module_init); 223 - 224 - static void __exit pmi_module_exit(void) 225 - { 226 - platform_driver_unregister(&pmi_of_platform_driver); 227 - } 228 - module_exit(pmi_module_exit); 217 + module_platform_driver(pmi_of_platform_driver); 229 218 230 219 int pmi_send_message(pmi_message_t msg) 231 220 {
+1 -1
arch/powerpc/sysdev/qe_lib/qe.c
··· 1 1 /* 2 - * Copyright (C) 2006-2010 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/qe_ic.c
··· 1 1 /* 2 2 * arch/powerpc/sysdev/qe_lib/qe_ic.c 3 3 * 4 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 4 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 5 5 * 6 6 * Author: Li Yang <leoli@freescale.com> 7 7 * Based on code from Shlomi Gridish <gridish@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/qe_ic.h
··· 3 3 * 4 4 * QUICC ENGINE Interrupt Controller Header 5 5 * 6 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 6 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 7 7 * 8 8 * Author: Li Yang <leoli@freescale.com> 9 9 * Based on code from Shlomi Gridish <gridish@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/qe_io.c
··· 3 3 * 4 4 * QE Parallel I/O ports configuration routines 5 5 * 6 - * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. 6 + * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. 7 7 * 8 8 * Author: Li Yang <LeoLi@freescale.com> 9 9 * Based on code from Shlomi Gridish <gridish@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/ucc.c
··· 3 3 * 4 4 * QE UCC API Set - UCC specific routines implementations. 5 5 * 6 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 6 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 7 7 * 8 8 * Authors: Shlomi Gridish <gridish@freescale.com> 9 9 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/ucc_fast.c
··· 1 1 /* 2 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/ucc_slow.c
··· 1 1 /* 2 - * Copyright (C) 2006 Freescale Semicondutor, Inc. All rights reserved. 2 + * Copyright (C) 2006 Freescale Semiconductor, Inc. All rights reserved. 3 3 * 4 4 * Authors: Shlomi Gridish <gridish@freescale.com> 5 5 * Li Yang <leoli@freescale.com>
+1 -1
arch/powerpc/sysdev/qe_lib/usb.c
··· 1 1 /* 2 2 * QE USB routines 3 3 * 4 - * Copyright (c) Freescale Semicondutor, Inc. 2006. 4 + * Copyright 2006 Freescale Semiconductor, Inc. 5 5 * Shlomi Gridish <gridish@freescale.com> 6 6 * Jerry Huang <Chang-Ming.Huang@freescale.com> 7 7 * Copyright (c) MontaVista Software, Inc. 2008.
+1 -1
arch/powerpc/xmon/Makefile
··· 6 6 7 7 ccflags-$(CONFIG_PPC64) := -mno-minimal-toc 8 8 9 - obj-y += xmon.o start.o nonstdio.o 9 + obj-y += xmon.o nonstdio.o 10 10 11 11 ifdef CONFIG_XMON_DISASSEMBLY 12 12 obj-y += ppc-dis.o ppc-opc.o
+23 -30
arch/powerpc/xmon/nonstdio.c
··· 7 7 * 2 of the License, or (at your option) any later version. 8 8 */ 9 9 #include <linux/string.h> 10 + #include <asm/udbg.h> 10 11 #include <asm/time.h> 11 12 #include "nonstdio.h" 13 + 14 + 15 + static int xmon_write(const void *ptr, int nb) 16 + { 17 + return udbg_write(ptr, nb); 18 + } 19 + 20 + static int xmon_readchar(void) 21 + { 22 + if (udbg_getc) 23 + return udbg_getc(); 24 + return -1; 25 + } 12 26 13 27 int xmon_putchar(int c) 14 28 { ··· 37 23 static char *lineptr; 38 24 static int lineleft; 39 25 40 - int xmon_expect(const char *str, unsigned long timeout) 41 - { 42 - int c; 43 - unsigned long t0; 44 - 45 - /* assume 25MHz default timebase if tb_ticks_per_sec not set yet */ 46 - timeout *= tb_ticks_per_sec? tb_ticks_per_sec: 25000000; 47 - t0 = get_tbl(); 48 - do { 49 - lineptr = line; 50 - for (;;) { 51 - c = xmon_read_poll(); 52 - if (c == -1) { 53 - if (get_tbl() - t0 > timeout) 54 - return 0; 55 - continue; 56 - } 57 - if (c == '\n') 58 - break; 59 - if (c != '\r' && lineptr < &line[sizeof(line) - 1]) 60 - *lineptr++ = c; 61 - } 62 - *lineptr = 0; 63 - } while (strstr(line, str) == NULL); 64 - return 1; 65 - } 66 - 67 - int xmon_getchar(void) 26 + static int xmon_getchar(void) 68 27 { 69 28 int c; 70 29 ··· 111 124 void xmon_printf(const char *format, ...) 112 125 { 113 126 va_list args; 114 - int n; 115 127 static char xmon_outbuf[1024]; 128 + int rc, n; 116 129 117 130 va_start(args, format); 118 131 n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); 119 132 va_end(args); 120 - xmon_write(xmon_outbuf, n); 133 + 134 + rc = xmon_write(xmon_outbuf, n); 135 + 136 + if (n && rc == 0) { 137 + /* No udbg hooks, fallback to printk() - dangerous */ 138 + printk(xmon_outbuf); 139 + } 121 140 } 122 141 123 142 void xmon_puts(const char *str)
-6
arch/powerpc/xmon/nonstdio.h
··· 4 4 #define putchar xmon_putchar 5 5 6 6 extern int xmon_putchar(int c); 7 - extern int xmon_getchar(void); 8 7 extern void xmon_puts(const char *); 9 8 extern char *xmon_gets(char *, int); 10 9 extern void xmon_printf(const char *, ...); 11 - extern void xmon_map_scc(void); 12 - extern int xmon_expect(const char *str, unsigned long timeout); 13 - extern int xmon_write(const void *ptr, int nb); 14 - extern int xmon_readchar(void); 15 - extern int xmon_read_poll(void);
-34
arch/powerpc/xmon/start.c
··· 1 - /* 2 - * Copyright (C) 1996 Paul Mackerras. 3 - * 4 - * This program is free software; you can redistribute it and/or 5 - * modify it under the terms of the GNU General Public License 6 - * as published by the Free Software Foundation; either version 7 - * 2 of the License, or (at your option) any later version. 8 - */ 9 - #include <asm/machdep.h> 10 - #include <asm/udbg.h> 11 - #include "nonstdio.h" 12 - 13 - void xmon_map_scc(void) 14 - { 15 - } 16 - 17 - int xmon_write(const void *ptr, int nb) 18 - { 19 - return udbg_write(ptr, nb); 20 - } 21 - 22 - int xmon_readchar(void) 23 - { 24 - if (udbg_getc) 25 - return udbg_getc(); 26 - return -1; 27 - } 28 - 29 - int xmon_read_poll(void) 30 - { 31 - if (udbg_getc_poll) 32 - return udbg_getc_poll(); 33 - return -1; 34 - }
+5 -21
arch/powerpc/xmon/xmon.c
··· 52 52 #include "nonstdio.h" 53 53 #include "dis-asm.h" 54 54 55 - #define scanhex xmon_scanhex 56 - #define skipbl xmon_skipbl 57 - 58 55 #ifdef CONFIG_SMP 59 56 static cpumask_t cpus_in_xmon = CPU_MASK_NONE; 60 57 static unsigned long xmon_taken = 1; ··· 166 169 167 170 #ifdef CONFIG_PPC64 168 171 #define REG "%.16lx" 169 - #define REGS_PER_LINE 4 170 - #define LAST_VOLATILE 13 171 172 #else 172 173 #define REG "%.8lx" 173 - #define REGS_PER_LINE 8 174 - #define LAST_VOLATILE 12 175 174 #endif 176 175 177 176 #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) ··· 1281 1288 catch_memory_errors = 0; 1282 1289 } 1283 1290 1284 - static int xmon_depth_to_print = 64; 1285 - 1286 1291 #define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) 1287 1292 #define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) 1288 - 1289 - #ifdef __powerpc64__ 1290 - #define REGS_OFFSET 0x70 1291 - #else 1292 - #define REGS_OFFSET 16 1293 - #endif 1294 1293 1295 1294 static void xmon_show_stack(unsigned long sp, unsigned long lr, 1296 1295 unsigned long pc) 1297 1296 { 1297 + int max_to_print = 64; 1298 1298 unsigned long ip; 1299 1299 unsigned long newsp; 1300 1300 unsigned long marker; 1301 - int count = 0; 1302 1301 struct pt_regs regs; 1303 1302 1304 - do { 1303 + while (max_to_print--) { 1305 1304 if (sp < PAGE_OFFSET) { 1306 1305 if (sp != 0) 1307 1306 printf("SP (%lx) is in userspace\n", sp); ··· 1347 1362 an exception frame. */ 1348 1363 if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) 1349 1364 && marker == STACK_FRAME_REGS_MARKER) { 1350 - if (mread(sp + REGS_OFFSET, &regs, sizeof(regs)) 1365 + if (mread(sp + STACK_FRAME_OVERHEAD, &regs, sizeof(regs)) 1351 1366 != sizeof(regs)) { 1352 1367 printf("Couldn't read registers at %lx\n", 1353 - sp + REGS_OFFSET); 1368 + sp + STACK_FRAME_OVERHEAD); 1354 1369 break; 1355 1370 } 1356 1371 printf("--- Exception: %lx %s at ", regs.trap, ··· 1364 1379 break; 1365 1380 1366 1381 sp = newsp; 1367 - } while (count++ < xmon_depth_to_print); 1382 + } 1368 1383 } 1369 1384 1370 1385 static void backtrace(struct pt_regs *excp) ··· 2928 2943 __debugger_dabr_match = NULL; 2929 2944 __debugger_fault_handler = NULL; 2930 2945 } 2931 - xmon_map_scc(); 2932 2946 } 2933 2947 2934 2948 #ifdef CONFIG_MAGIC_SYSRQ
+8 -12
drivers/crypto/nx/nx-842.c
··· 28 28 #include <linux/slab.h> 29 29 30 30 #include <asm/page.h> 31 - #include <asm/pSeries_reconfig.h> 32 31 #include <asm/vio.h> 33 32 34 33 #include "nx_csbcpb.h" /* struct nx_csbcpb */ ··· 1013 1014 * NOTIFY_BAD encoded with error number on failure, use 1014 1015 * notifier_to_errno() to decode this value 1015 1016 */ 1016 - static int nx842_OF_notifier(struct notifier_block *np, 1017 - unsigned long action, 1018 - void *update) 1017 + static int nx842_OF_notifier(struct notifier_block *np, unsigned long action, 1018 + void *update) 1019 1019 { 1020 - struct pSeries_reconfig_prop_update *upd; 1020 + struct of_prop_reconfig *upd = update; 1021 1021 struct nx842_devdata *local_devdata; 1022 1022 struct device_node *node = NULL; 1023 - 1024 - upd = (struct pSeries_reconfig_prop_update *)update; 1025 1023 1026 1024 rcu_read_lock(); 1027 1025 local_devdata = rcu_dereference(devdata); ··· 1026 1030 node = local_devdata->dev->of_node; 1027 1031 1028 1032 if (local_devdata && 1029 - action == PSERIES_UPDATE_PROPERTY && 1030 - !strcmp(upd->node->name, node->name)) { 1033 + action == OF_RECONFIG_UPDATE_PROPERTY && 1034 + !strcmp(upd->dn->name, node->name)) { 1031 1035 rcu_read_unlock(); 1032 - nx842_OF_upd(upd->property); 1036 + nx842_OF_upd(upd->prop); 1033 1037 } else 1034 1038 rcu_read_unlock(); 1035 1039 ··· 1178 1182 synchronize_rcu(); 1179 1183 kfree(old_devdata); 1180 1184 1181 - pSeries_reconfig_notifier_register(&nx842_of_nb); 1185 + of_reconfig_notifier_register(&nx842_of_nb); 1182 1186 1183 1187 ret = nx842_OF_upd(NULL); 1184 1188 if (ret && ret != -ENODEV) { ··· 1224 1228 spin_lock_irqsave(&devdata_mutex, flags); 1225 1229 old_devdata = rcu_dereference_check(devdata, 1226 1230 lockdep_is_held(&devdata_mutex)); 1227 - pSeries_reconfig_notifier_unregister(&nx842_of_nb); 1231 + of_reconfig_notifier_unregister(&nx842_of_nb); 1228 1232 rcu_assign_pointer(devdata, NULL); 1229 1233 spin_unlock_irqrestore(&devdata_mutex, flags); 1230 1234 synchronize_rcu();
-1
drivers/crypto/nx/nx.c
··· 33 33 #include <linux/scatterlist.h> 34 34 #include <linux/device.h> 35 35 #include <linux/of.h> 36 - #include <asm/pSeries_reconfig.h> 37 36 #include <asm/hvcall.h> 38 37 #include <asm/vio.h> 39 38
-20
drivers/infiniband/hw/ehca/hcp_if.c
··· 90 90 91 91 static DEFINE_SPINLOCK(hcall_lock); 92 92 93 - static u32 get_longbusy_msecs(int longbusy_rc) 94 - { 95 - switch (longbusy_rc) { 96 - case H_LONG_BUSY_ORDER_1_MSEC: 97 - return 1; 98 - case H_LONG_BUSY_ORDER_10_MSEC: 99 - return 10; 100 - case H_LONG_BUSY_ORDER_100_MSEC: 101 - return 100; 102 - case H_LONG_BUSY_ORDER_1_SEC: 103 - return 1000; 104 - case H_LONG_BUSY_ORDER_10_SEC: 105 - return 10000; 106 - case H_LONG_BUSY_ORDER_100_SEC: 107 - return 100000; 108 - default: 109 - return 1; 110 - } 111 - } 112 - 113 93 static long ehca_plpar_hcall_norets(unsigned long opcode, 114 94 unsigned long arg1, 115 95 unsigned long arg2,
+1 -1
drivers/macintosh/smu.c
··· 997 997 "%02x !\n", id, hdr->id); 998 998 goto failure; 999 999 } 1000 - if (prom_add_property(smu->of_node, prop)) { 1000 + if (of_add_property(smu->of_node, prop)) { 1001 1001 printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x " 1002 1002 "property !\n", id); 1003 1003 goto failure;
+1 -13
drivers/macintosh/windfarm_fcu_controls.c
··· 593 593 .id_table = wf_fcu_id, 594 594 }; 595 595 596 - static int __init wf_fcu_init(void) 597 - { 598 - return i2c_add_driver(&wf_fcu_driver); 599 - } 600 - 601 - static void __exit wf_fcu_exit(void) 602 - { 603 - i2c_del_driver(&wf_fcu_driver); 604 - } 605 - 606 - 607 - module_init(wf_fcu_init); 608 - module_exit(wf_fcu_exit); 596 + module_i2c_driver(wf_fcu_driver); 609 597 610 598 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 611 599 MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control");
+1 -13
drivers/macintosh/windfarm_lm75_sensor.c
··· 174 174 .id_table = wf_lm75_id, 175 175 }; 176 176 177 - static int __init wf_lm75_sensor_init(void) 178 - { 179 - return i2c_add_driver(&wf_lm75_driver); 180 - } 181 - 182 - static void __exit wf_lm75_sensor_exit(void) 183 - { 184 - i2c_del_driver(&wf_lm75_driver); 185 - } 186 - 187 - 188 - module_init(wf_lm75_sensor_init); 189 - module_exit(wf_lm75_sensor_exit); 177 + module_i2c_driver(wf_lm75_driver); 190 178 191 179 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); 192 180 MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control");
+1 -12
drivers/macintosh/windfarm_max6690_sensor.c
··· 130 130 .id_table = wf_max6690_id, 131 131 }; 132 132 133 - static int __init wf_max6690_sensor_init(void) 134 - { 135 - return i2c_add_driver(&wf_max6690_driver); 136 - } 137 - 138 - static void __exit wf_max6690_sensor_exit(void) 139 - { 140 - i2c_del_driver(&wf_max6690_driver); 141 - } 142 - 143 - module_init(wf_max6690_sensor_init); 144 - module_exit(wf_max6690_sensor_exit); 133 + module_i2c_driver(wf_max6690_driver); 145 134 146 135 MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); 147 136 MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control");
+1 -12
drivers/macintosh/windfarm_smu_sat.c
··· 364 364 .id_table = wf_sat_id, 365 365 }; 366 366 367 - static int __init sat_sensors_init(void) 368 - { 369 - return i2c_add_driver(&wf_sat_driver); 370 - } 371 - 372 - static void __exit sat_sensors_exit(void) 373 - { 374 - i2c_del_driver(&wf_sat_driver); 375 - } 376 - 377 - module_init(sat_sensors_init); 378 - module_exit(sat_sensors_exit); 367 + module_i2c_driver(wf_sat_driver); 379 368 380 369 MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); 381 370 MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control");
-20
drivers/net/ethernet/ibm/ehea/ehea_phyp.h
··· 39 39 * hcp_* - structures, variables and functions releated to Hypervisor Calls 40 40 */ 41 41 42 - static inline u32 get_longbusy_msecs(int long_busy_ret_code) 43 - { 44 - switch (long_busy_ret_code) { 45 - case H_LONG_BUSY_ORDER_1_MSEC: 46 - return 1; 47 - case H_LONG_BUSY_ORDER_10_MSEC: 48 - return 10; 49 - case H_LONG_BUSY_ORDER_100_MSEC: 50 - return 100; 51 - case H_LONG_BUSY_ORDER_1_SEC: 52 - return 1000; 53 - case H_LONG_BUSY_ORDER_10_SEC: 54 - return 10000; 55 - case H_LONG_BUSY_ORDER_100_SEC: 56 - return 100000; 57 - default: 58 - return 1; 59 - } 60 - } 61 - 62 42 /* Number of pages which can be registered at once by H_REGISTER_HEA_RPAGES */ 63 43 #define EHEA_MAX_RPAGE 512 64 44
+127 -15
drivers/of/base.c
··· 1114 1114 } 1115 1115 EXPORT_SYMBOL(of_parse_phandle_with_args); 1116 1116 1117 + #if defined(CONFIG_OF_DYNAMIC) 1118 + static int of_property_notify(int action, struct device_node *np, 1119 + struct property *prop) 1120 + { 1121 + struct of_prop_reconfig pr; 1122 + 1123 + pr.dn = np; 1124 + pr.prop = prop; 1125 + return of_reconfig_notify(action, &pr); 1126 + } 1127 + #else 1128 + static int of_property_notify(int action, struct device_node *np, 1129 + struct property *prop) 1130 + { 1131 + return 0; 1132 + } 1133 + #endif 1134 + 1117 1135 /** 1118 - * prom_add_property - Add a property to a node 1136 + * of_add_property - Add a property to a node 1119 1137 */ 1120 - int prom_add_property(struct device_node *np, struct property *prop) 1138 + int of_add_property(struct device_node *np, struct property *prop) 1121 1139 { 1122 1140 struct property **next; 1123 1141 unsigned long flags; 1142 + int rc; 1143 + 1144 + rc = of_property_notify(OF_RECONFIG_ADD_PROPERTY, np, prop); 1145 + if (rc) 1146 + return rc; 1124 1147 1125 1148 prop->next = NULL; 1126 1149 write_lock_irqsave(&devtree_lock, flags); ··· 1169 1146 } 1170 1147 1171 1148 /** 1172 - * prom_remove_property - Remove a property from a node. 1149 + * of_remove_property - Remove a property from a node. 1173 1150 * 1174 1151 * Note that we don't actually remove it, since we have given out 1175 1152 * who-knows-how-many pointers to the data using get-property. 1176 1153 * Instead we just move the property to the "dead properties" 1177 1154 * list, so it won't be found any more. 1178 1155 */ 1179 - int prom_remove_property(struct device_node *np, struct property *prop) 1156 + int of_remove_property(struct device_node *np, struct property *prop) 1180 1157 { 1181 1158 struct property **next; 1182 1159 unsigned long flags; 1183 1160 int found = 0; 1161 + int rc; 1162 + 1163 + rc = of_property_notify(OF_RECONFIG_REMOVE_PROPERTY, np, prop); 1164 + if (rc) 1165 + return rc; 1184 1166 1185 1167 write_lock_irqsave(&devtree_lock, flags); 1186 1168 next = &np->properties; ··· 1215 1187 } 1216 1188 1217 1189 /* 1218 - * prom_update_property - Update a property in a node, if the property does 1190 + * of_update_property - Update a property in a node, if the property does 1219 1191 * not exist, add it. 1220 1192 * 1221 1193 * Note that we don't actually remove it, since we have given out ··· 1223 1195 * Instead we just move the property to the "dead properties" list, 1224 1196 * and add the new property to the property list 1225 1197 */ 1226 - int prom_update_property(struct device_node *np, 1227 - struct property *newprop) 1198 + int of_update_property(struct device_node *np, struct property *newprop) 1228 1199 { 1229 1200 struct property **next, *oldprop; 1230 1201 unsigned long flags; 1231 - int found = 0; 1202 + int rc, found = 0; 1203 + 1204 + rc = of_property_notify(OF_RECONFIG_UPDATE_PROPERTY, np, newprop); 1205 + if (rc) 1206 + return rc; 1232 1207 1233 1208 if (!newprop->name) 1234 1209 return -EINVAL; 1235 1210 1236 1211 oldprop = of_find_property(np, newprop->name, NULL); 1237 1212 if (!oldprop) 1238 - return prom_add_property(np, newprop); 1213 + return of_add_property(np, newprop); 1239 1214 1240 1215 write_lock_irqsave(&devtree_lock, flags); 1241 1216 next = &np->properties; ··· 1277 1246 * device tree nodes. 1278 1247 */ 1279 1248 1249 + static BLOCKING_NOTIFIER_HEAD(of_reconfig_chain); 1250 + 1251 + int of_reconfig_notifier_register(struct notifier_block *nb) 1252 + { 1253 + return blocking_notifier_chain_register(&of_reconfig_chain, nb); 1254 + } 1255 + EXPORT_SYMBOL_GPL(of_reconfig_notifier_register); 1256 + 1257 + int of_reconfig_notifier_unregister(struct notifier_block *nb) 1258 + { 1259 + return blocking_notifier_chain_unregister(&of_reconfig_chain, nb); 1260 + } 1261 + EXPORT_SYMBOL_GPL(of_reconfig_notifier_unregister); 1262 + 1263 + int of_reconfig_notify(unsigned long action, void *p) 1264 + { 1265 + int rc; 1266 + 1267 + rc = blocking_notifier_call_chain(&of_reconfig_chain, action, p); 1268 + return notifier_to_errno(rc); 1269 + } 1270 + 1271 + #ifdef CONFIG_PROC_DEVICETREE 1272 + static void of_add_proc_dt_entry(struct device_node *dn) 1273 + { 1274 + struct proc_dir_entry *ent; 1275 + 1276 + ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); 1277 + if (ent) 1278 + proc_device_tree_add_node(dn, ent); 1279 + } 1280 + #else 1281 + static void of_add_proc_dt_entry(struct device_node *dn) 1282 + { 1283 + return; 1284 + } 1285 + #endif 1286 + 1280 1287 /** 1281 1288 * of_attach_node - Plug a device node into the tree and global list. 1282 1289 */ 1283 - void of_attach_node(struct device_node *np) 1290 + int of_attach_node(struct device_node *np) 1284 1291 { 1285 1292 unsigned long flags; 1293 + int rc; 1294 + 1295 + rc = of_reconfig_notify(OF_RECONFIG_ATTACH_NODE, np); 1296 + if (rc) 1297 + return rc; 1286 1298 1287 1299 write_lock_irqsave(&devtree_lock, flags); 1288 1300 np->sibling = np->parent->child; ··· 1333 1259 np->parent->child = np; 1334 1260 of_allnodes = np; 1335 1261 write_unlock_irqrestore(&devtree_lock, flags); 1262 + 1263 + of_add_proc_dt_entry(np); 1264 + return 0; 1336 1265 } 1266 + 1267 + #ifdef CONFIG_PROC_DEVICETREE 1268 + static void of_remove_proc_dt_entry(struct device_node *dn) 1269 + { 1270 + struct device_node *parent = dn->parent; 1271 + struct property *prop = dn->properties; 1272 + 1273 + while (prop) { 1274 + remove_proc_entry(prop->name, dn->pde); 1275 + prop = prop->next; 1276 + } 1277 + 1278 + if (dn->pde) 1279 + remove_proc_entry(dn->pde->name, parent->pde); 1280 + } 1281 + #else 1282 + static void of_remove_proc_dt_entry(struct device_node *dn) 1283 + { 1284 + return; 1285 + } 1286 + #endif 1337 1287 1338 1288 /** 1339 1289 * of_detach_node - "Unplug" a node from the device tree. ··· 1365 1267 * The caller must hold a reference to the node. The memory associated with 1366 1268 * the node is not freed until its refcount goes to zero. 1367 1269 */ 1368 - void of_detach_node(struct device_node *np) 1270 + int of_detach_node(struct device_node *np) 1369 1271 { 1370 1272 struct device_node *parent; 1371 1273 unsigned long flags; 1274 + int rc = 0; 1275 + 1276 + rc = of_reconfig_notify(OF_RECONFIG_DETACH_NODE, np); 1277 + if (rc) 1278 + return rc; 1372 1279 1373 1280 write_lock_irqsave(&devtree_lock, flags); 1374 1281 1282 + if (of_node_check_flag(np, OF_DETACHED)) { 1283 + /* someone already detached it */ 1284 + write_unlock_irqrestore(&devtree_lock, flags); 1285 + return rc; 1286 + } 1287 + 1375 1288 parent = np->parent; 1376 - if (!parent) 1377 - goto out_unlock; 1289 + if (!parent) { 1290 + write_unlock_irqrestore(&devtree_lock, flags); 1291 + return rc; 1292 + } 1378 1293 1379 1294 if (of_allnodes == np) 1380 1295 of_allnodes = np->allnext; ··· 1412 1301 } 1413 1302 1414 1303 of_node_set_flag(np, OF_DETACHED); 1415 - 1416 - out_unlock: 1417 1304 write_unlock_irqrestore(&devtree_lock, flags); 1305 + 1306 + of_remove_proc_dt_entry(np); 1307 + return rc; 1418 1308 } 1419 1309 #endif /* defined(CONFIG_OF_DYNAMIC) */ 1420 1310
+5 -3
drivers/video/Kconfig
··· 2140 2140 To compile as a module, choose M here: the module name is udlfb. 2141 2141 2142 2142 config FB_IBM_GXT4500 2143 - tristate "Framebuffer support for IBM GXT4500P adaptor" 2143 + tristate "Framebuffer support for IBM GXT4000P/4500P/6000P/6500P adaptors" 2144 2144 depends on FB && PPC 2145 2145 select FB_CFB_FILLRECT 2146 2146 select FB_CFB_COPYAREA 2147 2147 select FB_CFB_IMAGEBLIT 2148 2148 ---help--- 2149 - Say Y here to enable support for the IBM GXT4500P display 2150 - adaptor, found on some IBM System P (pSeries) machines. 2149 + Say Y here to enable support for the IBM GXT4000P/6000P and 2150 + GXT4500P/6500P display adaptor based on Raster Engine RC1000, 2151 + found on some IBM System P (pSeries) machines. This driver 2152 + doesn't use Geometry Engine GT1000. 2151 2153 2152 2154 config FB_PS3 2153 2155 tristate "PS3 GPU framebuffer driver"
+13 -2
drivers/video/gxt4500.c
··· 1 1 /* 2 - * Frame buffer device for IBM GXT4500P and GXT6000P display adaptors 2 + * Frame buffer device for IBM GXT4500P/6500P and GXT4000P/6000P 3 + * display adaptors 3 4 * 4 5 * Copyright (C) 2006 Paul Mackerras, IBM Corp. <paulus@samba.org> 5 6 */ ··· 15 14 #include <linux/string.h> 16 15 17 16 #define PCI_DEVICE_ID_IBM_GXT4500P 0x21c 17 + #define PCI_DEVICE_ID_IBM_GXT6500P 0x21b 18 + #define PCI_DEVICE_ID_IBM_GXT4000P 0x16e 18 19 #define PCI_DEVICE_ID_IBM_GXT6000P 0x170 19 20 20 21 /* GXT4500P registers */ ··· 176 173 /* List of supported cards */ 177 174 enum gxt_cards { 178 175 GXT4500P, 176 + GXT6500P, 177 + GXT4000P, 179 178 GXT6000P 180 179 }; 181 180 ··· 187 182 const char *cardname; 188 183 } cardinfo[] = { 189 184 [GXT4500P] = { .refclk_ps = 9259, .cardname = "IBM GXT4500P" }, 185 + [GXT6500P] = { .refclk_ps = 9259, .cardname = "IBM GXT6500P" }, 186 + [GXT4000P] = { .refclk_ps = 40000, .cardname = "IBM GXT4000P" }, 190 187 [GXT6000P] = { .refclk_ps = 40000, .cardname = "IBM GXT6000P" }, 191 188 }; 192 189 ··· 743 736 static const struct pci_device_id gxt4500_pci_tbl[] = { 744 737 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4500P), 745 738 .driver_data = GXT4500P }, 739 + { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6500P), 740 + .driver_data = GXT6500P }, 741 + { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4000P), 742 + .driver_data = GXT4000P }, 746 743 { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6000P), 747 744 .driver_data = GXT6000P }, 748 745 { 0 } ··· 779 768 module_exit(gxt4500_exit); 780 769 781 770 MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); 782 - MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6000P"); 771 + MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6500P and GXT4000P/6000P"); 783 772 MODULE_LICENSE("GPL"); 784 773 module_param(mode_option, charp, 0); 785 774 MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\"");
-3
drivers/virt/fsl_hypervisor.c
··· 796 796 struct device_node *node; 797 797 int ret; 798 798 799 - if (!(mfmsr() & MSR_GS)) 800 - return 0; 801 - 802 799 node = of_find_node_by_path("/hypervisor"); 803 800 if (!node) 804 801 return 0;
+21 -8
include/linux/of.h
··· 22 22 #include <linux/mod_devicetable.h> 23 23 #include <linux/spinlock.h> 24 24 #include <linux/topology.h> 25 + #include <linux/notifier.h> 25 26 26 27 #include <asm/byteorder.h> 27 28 #include <asm/errno.h> ··· 283 282 284 283 extern int of_machine_is_compatible(const char *compat); 285 284 286 - extern int prom_add_property(struct device_node* np, struct property* prop); 287 - extern int prom_remove_property(struct device_node *np, struct property *prop); 288 - extern int prom_update_property(struct device_node *np, 289 - struct property *newprop); 285 + extern int of_add_property(struct device_node *np, struct property *prop); 286 + extern int of_remove_property(struct device_node *np, struct property *prop); 287 + extern int of_update_property(struct device_node *np, struct property *newprop); 290 288 291 - #if defined(CONFIG_OF_DYNAMIC) 292 289 /* For updating the device tree at runtime */ 293 - extern void of_attach_node(struct device_node *); 294 - extern void of_detach_node(struct device_node *); 295 - #endif 290 + #define OF_RECONFIG_ATTACH_NODE 0x0001 291 + #define OF_RECONFIG_DETACH_NODE 0x0002 292 + #define OF_RECONFIG_ADD_PROPERTY 0x0003 293 + #define OF_RECONFIG_REMOVE_PROPERTY 0x0004 294 + #define OF_RECONFIG_UPDATE_PROPERTY 0x0005 295 + 296 + struct of_prop_reconfig { 297 + struct device_node *dn; 298 + struct property *prop; 299 + }; 300 + 301 + extern int of_reconfig_notifier_register(struct notifier_block *); 302 + extern int of_reconfig_notifier_unregister(struct notifier_block *); 303 + extern int of_reconfig_notify(unsigned long, void *); 304 + 305 + extern int of_attach_node(struct device_node *); 306 + extern int of_detach_node(struct device_node *); 296 307 297 308 #define of_match_ptr(_ptr) (_ptr) 298 309
+5 -5
lib/Kconfig.debug
··· 1192 1192 1193 1193 If unsure, say N. 1194 1194 1195 - config PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT 1196 - tristate "pSeries reconfig notifier error injection module" 1197 - depends on PPC_PSERIES && NOTIFIER_ERROR_INJECTION 1195 + config OF_RECONFIG_NOTIFIER_ERROR_INJECT 1196 + tristate "OF reconfig notifier error injection module" 1197 + depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION 1198 1198 help 1199 1199 This option provides the ability to inject artificial errors to 1200 - pSeries reconfig notifier chain callbacks. It is controlled 1200 + OF reconfig notifier chain callbacks. It is controlled 1201 1201 through debugfs interface under 1202 - /sys/kernel/debug/notifier-error-inject/pSeries-reconfig/ 1202 + /sys/kernel/debug/notifier-error-inject/OF-reconfig/ 1203 1203 1204 1204 If the notifier call chain should be failed with some events 1205 1205 notified, write the error code to "actions/<notifier event>/error".
+2 -2
lib/Makefile
··· 95 95 obj-$(CONFIG_CPU_NOTIFIER_ERROR_INJECT) += cpu-notifier-error-inject.o 96 96 obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o 97 97 obj-$(CONFIG_MEMORY_NOTIFIER_ERROR_INJECT) += memory-notifier-error-inject.o 98 - obj-$(CONFIG_PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT) += \ 99 - pSeries-reconfig-notifier-error-inject.o 98 + obj-$(CONFIG_OF_RECONFIG_NOTIFIER_ERROR_INJECT) += \ 99 + of-reconfig-notifier-error-inject.o 100 100 101 101 lib-$(CONFIG_GENERIC_BUG) += bug.o 102 102
+11 -11
lib/pSeries-reconfig-notifier-error-inject.c lib/of-reconfig-notifier-error-inject.c
··· 1 1 #include <linux/kernel.h> 2 2 #include <linux/module.h> 3 - 4 - #include <asm/pSeries_reconfig.h> 3 + #include <linux/of.h> 5 4 6 5 #include "notifier-error-inject.h" 7 6 8 7 static int priority; 9 8 module_param(priority, int, 0); 10 - MODULE_PARM_DESC(priority, "specify pSeries reconfig notifier priority"); 9 + MODULE_PARM_DESC(priority, "specify OF reconfig notifier priority"); 11 10 12 11 static struct notifier_err_inject reconfig_err_inject = { 13 12 .actions = { 14 - { NOTIFIER_ERR_INJECT_ACTION(PSERIES_RECONFIG_ADD) }, 15 - { NOTIFIER_ERR_INJECT_ACTION(PSERIES_RECONFIG_REMOVE) }, 16 - { NOTIFIER_ERR_INJECT_ACTION(PSERIES_DRCONF_MEM_ADD) }, 17 - { NOTIFIER_ERR_INJECT_ACTION(PSERIES_DRCONF_MEM_REMOVE) }, 13 + { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ATTACH_NODE) }, 14 + { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_DETACH_NODE) }, 15 + { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ADD_PROPERTY) }, 16 + { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_REMOVE_PROPERTY) }, 17 + { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_UPDATE_PROPERTY) }, 18 18 {} 19 19 } 20 20 }; ··· 25 25 { 26 26 int err; 27 27 28 - dir = notifier_err_inject_init("pSeries-reconfig", 28 + dir = notifier_err_inject_init("OF-reconfig", 29 29 notifier_err_inject_dir, &reconfig_err_inject, priority); 30 30 if (IS_ERR(dir)) 31 31 return PTR_ERR(dir); 32 32 33 - err = pSeries_reconfig_notifier_register(&reconfig_err_inject.nb); 33 + err = of_reconfig_notifier_register(&reconfig_err_inject.nb); 34 34 if (err) 35 35 debugfs_remove_recursive(dir); 36 36 ··· 39 39 40 40 static void err_inject_exit(void) 41 41 { 42 - pSeries_reconfig_notifier_unregister(&reconfig_err_inject.nb); 42 + of_reconfig_notifier_unregister(&reconfig_err_inject.nb); 43 43 debugfs_remove_recursive(dir); 44 44 } 45 45 46 46 module_init(err_inject_init); 47 47 module_exit(err_inject_exit); 48 48 49 - MODULE_DESCRIPTION("pSeries reconfig notifier error injection module"); 49 + MODULE_DESCRIPTION("OF reconfig notifier error injection module"); 50 50 MODULE_LICENSE("GPL"); 51 51 MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>");