diff options
116 files changed, 1545 insertions, 839 deletions
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/raideng.txt b/Documentation/devicetree/bindings/powerpc/fsl/raideng.txt new file mode 100644 index 000000000000..4ad29b9ac2ac --- /dev/null +++ b/Documentation/devicetree/bindings/powerpc/fsl/raideng.txt | |||
@@ -0,0 +1,81 @@ | |||
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 | }; | ||
diff --git a/Documentation/powerpc/ptrace.txt b/Documentation/powerpc/ptrace.txt index f4a5499b7bc6..f2a7a3919772 100644 --- a/Documentation/powerpc/ptrace.txt +++ b/Documentation/powerpc/ptrace.txt | |||
@@ -127,6 +127,22 @@ Some examples of using the structure to: | |||
127 | p.addr2 = (uint64_t) end_range; | 127 | p.addr2 = (uint64_t) end_range; |
128 | p.condition_value = 0; | 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 | 3. PTRACE_DELHWDEBUG | 146 | 3. PTRACE_DELHWDEBUG |
131 | 147 | ||
132 | Takes an integer which identifies an existing breakpoint or watchpoint | 148 | Takes an integer which identifies an existing breakpoint or watchpoint |
diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 98070370d602..c66129b5dd18 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c | |||
@@ -240,7 +240,7 @@ static void __init update_fec_mac_prop(enum mac_oui oui) | |||
240 | macaddr[4] = (val >> 8) & 0xff; | 240 | macaddr[4] = (val >> 8) & 0xff; |
241 | macaddr[5] = (val >> 0) & 0xff; | 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 | ||
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 159e94f4b22a..b639852116fa 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -181,7 +181,7 @@ $(BOOT_TARGETS2): vmlinux | |||
181 | bootwrapper_install: | 181 | bootwrapper_install: |
182 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 182 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
183 | 183 | ||
184 | %.dtb: | 184 | %.dtb: scripts |
185 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) | 185 | $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) |
186 | 186 | ||
187 | define archhelp | 187 | define archhelp |
diff --git a/arch/powerpc/boot/dts/a3m071.dts b/arch/powerpc/boot/dts/a3m071.dts new file mode 100644 index 000000000000..877a28cb77e4 --- /dev/null +++ b/arch/powerpc/boot/dts/a3m071.dts | |||
@@ -0,0 +1,144 @@ | |||
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 | }; | ||
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi index 64b6abea8464..5d7205b7bb05 100644 --- a/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/p5020si-post.dtsi | |||
@@ -354,4 +354,5 @@ | |||
354 | /include/ "qoriq-sata2-0.dtsi" | 354 | /include/ "qoriq-sata2-0.dtsi" |
355 | /include/ "qoriq-sata2-1.dtsi" | 355 | /include/ "qoriq-sata2-1.dtsi" |
356 | /include/ "qoriq-sec4.2-0.dtsi" | 356 | /include/ "qoriq-sec4.2-0.dtsi" |
357 | /include/ "qoriq-raid1.0-0.dtsi" | ||
357 | }; | 358 | }; |
diff --git a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi index 0a198b0a77e5..8df47fc45ab5 100644 --- a/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/p5020si-pre.dtsi | |||
@@ -73,6 +73,12 @@ | |||
73 | rtic_c = &rtic_c; | 73 | rtic_c = &rtic_c; |
74 | rtic_d = &rtic_d; | 74 | rtic_d = &rtic_d; |
75 | sec_mon = &sec_mon; | 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 | cpus { | 84 | cpus { |
diff --git a/arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi new file mode 100644 index 000000000000..8d2e8aa6cf8a --- /dev/null +++ b/arch/powerpc/boot/dts/fsl/qoriq-raid1.0-0.dtsi | |||
@@ -0,0 +1,85 @@ | |||
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 | }; | ||
diff --git a/arch/powerpc/configs/pseries_defconfig b/arch/powerpc/configs/pseries_defconfig index 1f710a32ffae..5b8e1e508270 100644 --- a/arch/powerpc/configs/pseries_defconfig +++ b/arch/powerpc/configs/pseries_defconfig | |||
@@ -2,7 +2,7 @@ CONFIG_PPC64=y | |||
2 | CONFIG_ALTIVEC=y | 2 | CONFIG_ALTIVEC=y |
3 | CONFIG_VSX=y | 3 | CONFIG_VSX=y |
4 | CONFIG_SMP=y | 4 | CONFIG_SMP=y |
5 | CONFIG_NR_CPUS=1024 | 5 | CONFIG_NR_CPUS=2048 |
6 | CONFIG_EXPERIMENTAL=y | 6 | CONFIG_EXPERIMENTAL=y |
7 | CONFIG_SYSVIPC=y | 7 | CONFIG_SYSVIPC=y |
8 | CONFIG_POSIX_MQUEUE=y | 8 | CONFIG_POSIX_MQUEUE=y |
diff --git a/arch/powerpc/include/asm/bitops.h b/arch/powerpc/include/asm/bitops.h index dc2cf9c6d9e6..ef918a2328bb 100644 --- a/arch/powerpc/include/asm/bitops.h +++ b/arch/powerpc/include/asm/bitops.h | |||
@@ -52,8 +52,6 @@ | |||
52 | #define smp_mb__before_clear_bit() smp_mb() | 52 | #define smp_mb__before_clear_bit() smp_mb() |
53 | #define smp_mb__after_clear_bit() smp_mb() | 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 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) | 55 | #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) |
58 | 56 | ||
59 | /* Macro for generating the ***_bits() functions */ | 57 | /* Macro for generating the ***_bits() functions */ |
@@ -83,22 +81,22 @@ DEFINE_BITOP(change_bits, xor, "", "") | |||
83 | 81 | ||
84 | static __inline__ void set_bit(int nr, volatile unsigned long *addr) | 82 | static __inline__ void set_bit(int nr, volatile unsigned long *addr) |
85 | { | 83 | { |
86 | set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 84 | set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); |
87 | } | 85 | } |
88 | 86 | ||
89 | static __inline__ void clear_bit(int nr, volatile unsigned long *addr) | 87 | static __inline__ void clear_bit(int nr, volatile unsigned long *addr) |
90 | { | 88 | { |
91 | clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 89 | clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); |
92 | } | 90 | } |
93 | 91 | ||
94 | static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) | 92 | static __inline__ void clear_bit_unlock(int nr, volatile unsigned long *addr) |
95 | { | 93 | { |
96 | clear_bits_unlock(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 94 | clear_bits_unlock(BIT_MASK(nr), addr + BIT_WORD(nr)); |
97 | } | 95 | } |
98 | 96 | ||
99 | static __inline__ void change_bit(int nr, volatile unsigned long *addr) | 97 | static __inline__ void change_bit(int nr, volatile unsigned long *addr) |
100 | { | 98 | { |
101 | change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)); | 99 | change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)); |
102 | } | 100 | } |
103 | 101 | ||
104 | /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output | 102 | /* Like DEFINE_BITOP(), with changes to the arguments to 'op' and the output |
@@ -136,26 +134,26 @@ DEFINE_TESTOP(test_and_change_bits, xor, PPC_ATOMIC_ENTRY_BARRIER, | |||
136 | static __inline__ int test_and_set_bit(unsigned long nr, | 134 | static __inline__ int test_and_set_bit(unsigned long nr, |
137 | volatile unsigned long *addr) | 135 | volatile unsigned long *addr) |
138 | { | 136 | { |
139 | return test_and_set_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; | 137 | return test_and_set_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; |
140 | } | 138 | } |
141 | 139 | ||
142 | static __inline__ int test_and_set_bit_lock(unsigned long nr, | 140 | static __inline__ int test_and_set_bit_lock(unsigned long nr, |
143 | volatile unsigned long *addr) | 141 | volatile unsigned long *addr) |
144 | { | 142 | { |
145 | return test_and_set_bits_lock(BITOP_MASK(nr), | 143 | return test_and_set_bits_lock(BIT_MASK(nr), |
146 | addr + BITOP_WORD(nr)) != 0; | 144 | addr + BIT_WORD(nr)) != 0; |
147 | } | 145 | } |
148 | 146 | ||
149 | static __inline__ int test_and_clear_bit(unsigned long nr, | 147 | static __inline__ int test_and_clear_bit(unsigned long nr, |
150 | volatile unsigned long *addr) | 148 | volatile unsigned long *addr) |
151 | { | 149 | { |
152 | return test_and_clear_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; | 150 | return test_and_clear_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; |
153 | } | 151 | } |
154 | 152 | ||
155 | static __inline__ int test_and_change_bit(unsigned long nr, | 153 | static __inline__ int test_and_change_bit(unsigned long nr, |
156 | volatile unsigned long *addr) | 154 | volatile unsigned long *addr) |
157 | { | 155 | { |
158 | return test_and_change_bits(BITOP_MASK(nr), addr + BITOP_WORD(nr)) != 0; | 156 | return test_and_change_bits(BIT_MASK(nr), addr + BIT_WORD(nr)) != 0; |
159 | } | 157 | } |
160 | 158 | ||
161 | #include <asm-generic/bitops/non-atomic.h> | 159 | #include <asm-generic/bitops/non-atomic.h> |
@@ -280,61 +278,8 @@ unsigned long __arch_hweight64(__u64 w); | |||
280 | #include <asm-generic/bitops/find.h> | 278 | #include <asm-generic/bitops/find.h> |
281 | 279 | ||
282 | /* Little-endian versions */ | 280 | /* Little-endian versions */ |
281 | #include <asm-generic/bitops/le.h> | ||
283 | 282 | ||
284 | static __inline__ int test_bit_le(unsigned long nr, | ||
285 | __const__ void *addr) | ||
286 | { | ||
287 | __const__ unsigned char *tmp = (__const__ unsigned char *) addr; | ||
288 | return (tmp[nr >> 3] >> (nr & 7)) & 1; | ||
289 | } | ||
290 | |||
291 | static inline void set_bit_le(int nr, void *addr) | ||
292 | { | ||
293 | set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
294 | } | ||
295 | |||
296 | static inline void clear_bit_le(int nr, void *addr) | ||
297 | { | ||
298 | clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
299 | } | ||
300 | |||
301 | static inline void __set_bit_le(int nr, void *addr) | ||
302 | { | ||
303 | __set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
304 | } | ||
305 | |||
306 | static inline void __clear_bit_le(int nr, void *addr) | ||
307 | { | ||
308 | __clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
309 | } | ||
310 | |||
311 | static inline int test_and_set_bit_le(int nr, void *addr) | ||
312 | { | ||
313 | return test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
314 | } | ||
315 | |||
316 | static inline int test_and_clear_bit_le(int nr, void *addr) | ||
317 | { | ||
318 | return test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
319 | } | ||
320 | |||
321 | static inline int __test_and_set_bit_le(int nr, void *addr) | ||
322 | { | ||
323 | return __test_and_set_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
324 | } | ||
325 | |||
326 | static inline int __test_and_clear_bit_le(int nr, void *addr) | ||
327 | { | ||
328 | return __test_and_clear_bit(nr ^ BITOP_LE_SWIZZLE, addr); | ||
329 | } | ||
330 | |||
331 | #define find_first_zero_bit_le(addr, size) \ | ||
332 | find_next_zero_bit_le((addr), (size), 0) | ||
333 | unsigned long find_next_zero_bit_le(const void *addr, | ||
334 | unsigned long size, unsigned long offset); | ||
335 | |||
336 | unsigned long find_next_bit_le(const void *addr, | ||
337 | unsigned long size, unsigned long offset); | ||
338 | /* Bitmap functions for the ext2 filesystem */ | 283 | /* Bitmap functions for the ext2 filesystem */ |
339 | 284 | ||
340 | #include <asm-generic/bitops/ext2-atomic-setbit.h> | 285 | #include <asm-generic/bitops/ext2-atomic-setbit.h> |
diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h index 21a0687b8c4d..76f81bd64f1d 100644 --- a/arch/powerpc/include/asm/cputable.h +++ b/arch/powerpc/include/asm/cputable.h | |||
@@ -401,6 +401,14 @@ extern const char *powerpc_base_platform; | |||
401 | CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ | 401 | CPU_FTR_DSCR | CPU_FTR_SAO | CPU_FTR_ASYM_SMT | \ |
402 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ | 402 | CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ |
403 | CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY) | 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 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ | 412 | #define CPU_FTRS_CELL (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \ |
405 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ | 413 | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ |
406 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ | 414 | CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ |
@@ -421,8 +429,8 @@ extern const char *powerpc_base_platform; | |||
421 | #define CPU_FTRS_POSSIBLE \ | 429 | #define CPU_FTRS_POSSIBLE \ |
422 | (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ | 430 | (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ |
423 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ | 431 | CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ |
424 | CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ | 432 | CPU_FTRS_POWER7 | CPU_FTRS_POWER8 | CPU_FTRS_CELL | \ |
425 | CPU_FTR_VSX) | 433 | CPU_FTRS_PA6T | CPU_FTR_VSX) |
426 | #endif | 434 | #endif |
427 | #else | 435 | #else |
428 | enum { | 436 | enum { |
diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h index 154c067761b1..607e4eeeb694 100644 --- a/arch/powerpc/include/asm/dbell.h +++ b/arch/powerpc/include/asm/dbell.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2009 Freescale Semicondutor, Inc. | 2 | * Copyright 2009 Freescale Semiconductor, Inc. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License | 5 | * modify it under the terms of the GNU General Public License |
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h index a43c1473915f..ad708dda3ba3 100644 --- a/arch/powerpc/include/asm/exception-64s.h +++ b/arch/powerpc/include/asm/exception-64s.h | |||
@@ -48,6 +48,35 @@ | |||
48 | #define EX_LR 72 | 48 | #define EX_LR 72 |
49 | #define EX_CFAR 80 | 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 | * We're short on space and time in the exception prolog, so we can't | 81 | * We're short on space and time in the exception prolog, so we can't |
53 | * use the normal SET_REG_IMMEDIATE macro. Normally we just need the | 82 | * use the normal SET_REG_IMMEDIATE macro. Normally we just need the |
@@ -55,12 +84,29 @@ | |||
55 | * word. | 84 | * word. |
56 | */ | 85 | */ |
57 | #define LOAD_HANDLER(reg, label) \ | 86 | #define LOAD_HANDLER(reg, label) \ |
58 | addi reg,reg,(label)-_stext; /* virt addr of handler ... */ | 87 | /* Handlers must be within 64K of kbase, which must be 64k aligned */ \ |
88 | ori reg,reg,(label)-_stext; /* virt addr of handler ... */ | ||
59 | 89 | ||
60 | /* Exception register prefixes */ | 90 | /* Exception register prefixes */ |
61 | #define EXC_HV H | 91 | #define EXC_HV H |
62 | #define EXC_STD | 92 | #define EXC_STD |
63 | 93 | ||
94 | #if defined(CONFIG_RELOCATABLE) | ||
95 | /* | ||
96 | * If we support interrupts with relocation on AND we're a relocatable | ||
97 | * kernel, we need to use LR to get to the 2nd level handler. So, save/restore | ||
98 | * it when required. | ||
99 | */ | ||
100 | #define SAVE_LR(reg, area) mflr reg ; std reg,area+EX_LR(r13) | ||
101 | #define GET_LR(reg, area) ld reg,area+EX_LR(r13) | ||
102 | #define RESTORE_LR(reg, area) ld reg,area+EX_LR(r13) ; mtlr reg | ||
103 | #else | ||
104 | /* ...else LR is unused and in register. */ | ||
105 | #define SAVE_LR(reg, area) | ||
106 | #define GET_LR(reg, area) mflr reg | ||
107 | #define RESTORE_LR(reg, area) | ||
108 | #endif | ||
109 | |||
64 | #define __EXCEPTION_PROLOG_1(area, extra, vec) \ | 110 | #define __EXCEPTION_PROLOG_1(area, extra, vec) \ |
65 | GET_PACA(r13); \ | 111 | GET_PACA(r13); \ |
66 | std r9,area+EX_R9(r13); /* save r9 - r12 */ \ | 112 | std r9,area+EX_R9(r13); /* save r9 - r12 */ \ |
@@ -69,6 +115,7 @@ | |||
69 | mfspr r10,SPRN_CFAR; \ | 115 | mfspr r10,SPRN_CFAR; \ |
70 | std r10,area+EX_CFAR(r13); \ | 116 | std r10,area+EX_CFAR(r13); \ |
71 | END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \ | 117 | END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \ |
118 | SAVE_LR(r10, area); \ | ||
72 | mfcr r9; \ | 119 | mfcr r9; \ |
73 | extra(vec); \ | 120 | extra(vec); \ |
74 | std r11,area+EX_R11(r13); \ | 121 | std r11,area+EX_R11(r13); \ |
@@ -169,6 +216,7 @@ do_kvm_##n: \ | |||
169 | sth r1,PACA_TRAP_SAVE(r13); \ | 216 | sth r1,PACA_TRAP_SAVE(r13); \ |
170 | std r3,area+EX_R3(r13); \ | 217 | std r3,area+EX_R3(r13); \ |
171 | addi r3,r13,area; /* r3 -> where regs are saved*/ \ | 218 | addi r3,r13,area; /* r3 -> where regs are saved*/ \ |
219 | RESTORE_LR(r1, area); \ | ||
172 | b bad_stack; \ | 220 | b bad_stack; \ |
173 | 3: std r9,_CCR(r1); /* save CR in stackframe */ \ | 221 | 3: std r9,_CCR(r1); /* save CR in stackframe */ \ |
174 | std r11,_NIP(r1); /* save SRR0 in stackframe */ \ | 222 | std r11,_NIP(r1); /* save SRR0 in stackframe */ \ |
@@ -194,8 +242,8 @@ do_kvm_##n: \ | |||
194 | ld r10,area+EX_CFAR(r13); \ | 242 | ld r10,area+EX_CFAR(r13); \ |
195 | std r10,ORIG_GPR3(r1); \ | 243 | std r10,ORIG_GPR3(r1); \ |
196 | END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \ | 244 | END_FTR_SECTION_NESTED(CPU_FTR_CFAR, CPU_FTR_CFAR, 66); \ |
245 | GET_LR(r9,area); /* Get LR, later save to stack */ \ | ||
197 | ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ | 246 | ld r2,PACATOC(r13); /* get kernel TOC into r2 */ \ |
198 | mflr r9; /* save LR in stackframe */ \ | ||
199 | std r9,_LINK(r1); \ | 247 | std r9,_LINK(r1); \ |
200 | mfctr r10; /* save CTR in stackframe */ \ | 248 | mfctr r10; /* save CTR in stackframe */ \ |
201 | std r10,_CTR(r1); \ | 249 | std r10,_CTR(r1); \ |
@@ -232,6 +280,26 @@ label##_hv: \ | |||
232 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ | 280 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ |
233 | EXC_HV, KVMTEST, vec) | 281 | EXC_HV, KVMTEST, vec) |
234 | 282 | ||
283 | #define STD_RELON_EXCEPTION_PSERIES(loc, vec, label) \ | ||
284 | . = loc; \ | ||
285 | .globl label##_relon_pSeries; \ | ||
286 | label##_relon_pSeries: \ | ||
287 | HMT_MEDIUM; \ | ||
288 | /* No guest interrupts come through here */ \ | ||
289 | SET_SCRATCH0(r13); /* save r13 */ \ | ||
290 | EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ | ||
291 | EXC_STD, KVMTEST_PR, vec) | ||
292 | |||
293 | #define STD_RELON_EXCEPTION_HV(loc, vec, label) \ | ||
294 | . = loc; \ | ||
295 | .globl label##_relon_hv; \ | ||
296 | label##_relon_hv: \ | ||
297 | HMT_MEDIUM; \ | ||
298 | /* No guest interrupts come through here */ \ | ||
299 | SET_SCRATCH0(r13); /* save r13 */ \ | ||
300 | EXCEPTION_RELON_PROLOG_PSERIES(PACA_EXGEN, label##_common, \ | ||
301 | EXC_HV, KVMTEST, vec) | ||
302 | |||
235 | /* This associate vector numbers with bits in paca->irq_happened */ | 303 | /* This associate vector numbers with bits in paca->irq_happened */ |
236 | #define SOFTEN_VALUE_0x500 PACA_IRQ_EE | 304 | #define SOFTEN_VALUE_0x500 PACA_IRQ_EE |
237 | #define SOFTEN_VALUE_0x502 PACA_IRQ_EE | 305 | #define SOFTEN_VALUE_0x502 PACA_IRQ_EE |
@@ -257,6 +325,9 @@ label##_hv: \ | |||
257 | KVMTEST(vec); \ | 325 | KVMTEST(vec); \ |
258 | _SOFTEN_TEST(EXC_STD, vec) | 326 | _SOFTEN_TEST(EXC_STD, vec) |
259 | 327 | ||
328 | #define SOFTEN_NOTEST_PR(vec) _SOFTEN_TEST(EXC_STD, vec) | ||
329 | #define SOFTEN_NOTEST_HV(vec) _SOFTEN_TEST(EXC_HV, vec) | ||
330 | |||
260 | #define __MASKABLE_EXCEPTION_PSERIES(vec, label, h, extra) \ | 331 | #define __MASKABLE_EXCEPTION_PSERIES(vec, label, h, extra) \ |
261 | HMT_MEDIUM; \ | 332 | HMT_MEDIUM; \ |
262 | SET_SCRATCH0(r13); /* save r13 */ \ | 333 | SET_SCRATCH0(r13); /* save r13 */ \ |
@@ -279,6 +350,28 @@ label##_hv: \ | |||
279 | _MASKABLE_EXCEPTION_PSERIES(vec, label, \ | 350 | _MASKABLE_EXCEPTION_PSERIES(vec, label, \ |
280 | EXC_HV, SOFTEN_TEST_HV) | 351 | EXC_HV, SOFTEN_TEST_HV) |
281 | 352 | ||
353 | #define __MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) \ | ||
354 | HMT_MEDIUM; \ | ||
355 | SET_SCRATCH0(r13); /* save r13 */ \ | ||
356 | __EXCEPTION_PROLOG_1(PACA_EXGEN, extra, vec); \ | ||
357 | EXCEPTION_RELON_PROLOG_PSERIES_1(label##_common, h); | ||
358 | #define _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) \ | ||
359 | __MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra) | ||
360 | |||
361 | #define MASKABLE_RELON_EXCEPTION_PSERIES(loc, vec, label) \ | ||
362 | . = loc; \ | ||
363 | .globl label##_relon_pSeries; \ | ||
364 | label##_relon_pSeries: \ | ||
365 | _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, \ | ||
366 | EXC_STD, SOFTEN_NOTEST_PR) | ||
367 | |||
368 | #define MASKABLE_RELON_EXCEPTION_HV(loc, vec, label) \ | ||
369 | . = loc; \ | ||
370 | .globl label##_relon_hv; \ | ||
371 | label##_relon_hv: \ | ||
372 | _MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, \ | ||
373 | EXC_HV, SOFTEN_NOTEST_HV) | ||
374 | |||
282 | /* | 375 | /* |
283 | * Our exception common code can be passed various "additions" | 376 | * Our exception common code can be passed various "additions" |
284 | * to specify the behaviour of interrupts, whether to kick the | 377 | * to specify the behaviour of interrupts, whether to kick the |
diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h index ad0b751b0d78..973cc3be011b 100644 --- a/arch/powerpc/include/asm/firmware.h +++ b/arch/powerpc/include/asm/firmware.h | |||
@@ -49,6 +49,7 @@ | |||
49 | #define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) | 49 | #define FW_FEATURE_XCMO ASM_CONST(0x0000000008000000) |
50 | #define FW_FEATURE_OPAL ASM_CONST(0x0000000010000000) | 50 | #define FW_FEATURE_OPAL ASM_CONST(0x0000000010000000) |
51 | #define FW_FEATURE_OPALv2 ASM_CONST(0x0000000020000000) | 51 | #define FW_FEATURE_OPALv2 ASM_CONST(0x0000000020000000) |
52 | #define FW_FEATURE_SET_MODE ASM_CONST(0x0000000040000000) | ||
52 | 53 | ||
53 | #ifndef __ASSEMBLY__ | 54 | #ifndef __ASSEMBLY__ |
54 | 55 | ||
@@ -62,7 +63,8 @@ enum { | |||
62 | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | | 63 | FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | |
63 | FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR | | 64 | FW_FEATURE_BULK_REMOVE | FW_FEATURE_XDABR | |
64 | FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | | 65 | FW_FEATURE_MULTITCE | FW_FEATURE_SPLPAR | FW_FEATURE_LPAR | |
65 | FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO, | 66 | FW_FEATURE_CMO | FW_FEATURE_VPHN | FW_FEATURE_XCMO | |
67 | FW_FEATURE_SET_MODE, | ||
66 | FW_FEATURE_PSERIES_ALWAYS = 0, | 68 | FW_FEATURE_PSERIES_ALWAYS = 0, |
67 | FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2, | 69 | FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv2, |
68 | FW_FEATURE_POWERNV_ALWAYS = 0, | 70 | FW_FEATURE_POWERNV_ALWAYS = 0, |
diff --git a/arch/powerpc/include/asm/fsl_gtm.h b/arch/powerpc/include/asm/fsl_gtm.h index 8e8c9b5032d3..3b05808f9caa 100644 --- a/arch/powerpc/include/asm/fsl_gtm.h +++ b/arch/powerpc/include/asm/fsl_gtm.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Freescale General-purpose Timers Module | 2 | * Freescale General-purpose Timers Module |
3 | * | 3 | * |
4 | * Copyright (c) Freescale Semicondutor, Inc. 2006. | 4 | * Copyright 2006 Freescale Semiconductor, Inc. |
5 | * Shlomi Gridish <gridish@freescale.com> | 5 | * Shlomi Gridish <gridish@freescale.com> |
6 | * Jerry Huang <Chang-Ming.Huang@freescale.com> | 6 | * Jerry Huang <Chang-Ming.Huang@freescale.com> |
7 | * Copyright (c) MontaVista Software, Inc. 2008. | 7 | * Copyright (c) MontaVista Software, Inc. 2008. |
diff --git a/arch/powerpc/include/asm/fsl_guts.h b/arch/powerpc/include/asm/fsl_guts.h index dd5ba2c22771..77ced0b3d81d 100644 --- a/arch/powerpc/include/asm/fsl_guts.h +++ b/arch/powerpc/include/asm/fsl_guts.h | |||
@@ -71,7 +71,9 @@ struct ccsr_guts { | |||
71 | u8 res0c4[0x224 - 0xc4]; | 71 | u8 res0c4[0x224 - 0xc4]; |
72 | __be32 iodelay1; /* 0x.0224 - IO delay control register 1 */ | 72 | __be32 iodelay1; /* 0x.0224 - IO delay control register 1 */ |
73 | __be32 iodelay2; /* 0x.0228 - IO delay control register 2 */ | 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 | __be32 clkdvdr; /* 0x.0800 - Clock Divide Register */ | 77 | __be32 clkdvdr; /* 0x.0800 - Clock Divide Register */ |
76 | u8 res804[0x900 - 0x804]; | 78 | u8 res804[0x900 - 0x804]; |
77 | __be32 ircr; /* 0x.0900 - Infrared Control Register */ | 79 | __be32 ircr; /* 0x.0900 - Infrared Control Register */ |
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index 7a867065db79..0975e5c0bb19 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -267,7 +267,8 @@ | |||
267 | #define H_RANDOM 0x300 | 267 | #define H_RANDOM 0x300 |
268 | #define H_COP 0x304 | 268 | #define H_COP 0x304 |
269 | #define H_GET_MPP_X 0x314 | 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 | #ifndef __ASSEMBLY__ | 273 | #ifndef __ASSEMBLY__ |
273 | 274 | ||
@@ -355,6 +356,26 @@ struct hvcall_mpp_x_data { | |||
355 | 356 | ||
356 | int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data); | 357 | int h_get_mpp_x(struct hvcall_mpp_x_data *mpp_x_data); |
357 | 358 | ||
359 | static inline unsigned int get_longbusy_msecs(int longbusy_rc) | ||
360 | { | ||
361 | switch (longbusy_rc) { | ||
362 | case H_LONG_BUSY_ORDER_1_MSEC: | ||
363 | return 1; | ||
364 | case H_LONG_BUSY_ORDER_10_MSEC: | ||
365 | return 10; | ||
366 | case H_LONG_BUSY_ORDER_100_MSEC: | ||
367 | return 100; | ||
368 | case H_LONG_BUSY_ORDER_1_SEC: | ||
369 | return 1000; | ||
370 | case H_LONG_BUSY_ORDER_10_SEC: | ||
371 | return 10000; | ||
372 | case H_LONG_BUSY_ORDER_100_SEC: | ||
373 | return 100000; | ||
374 | default: | ||
375 | return 1; | ||
376 | } | ||
377 | } | ||
378 | |||
358 | #ifdef CONFIG_PPC_PSERIES | 379 | #ifdef CONFIG_PPC_PSERIES |
359 | extern int CMO_PrPSP; | 380 | extern int CMO_PrPSP; |
360 | extern int CMO_SecPSP; | 381 | extern int CMO_SecPSP; |
diff --git a/arch/powerpc/include/asm/immap_qe.h b/arch/powerpc/include/asm/immap_qe.h index 61e8490786b8..bedbff891423 100644 --- a/arch/powerpc/include/asm/immap_qe.h +++ b/arch/powerpc/include/asm/immap_qe.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * The Internal Memory Map for devices with QE on them. This | 3 | * The Internal Memory Map for devices with QE on them. This |
4 | * is the superset of all QE devices (8360, etc.). | 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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 8 | * Authors: Shlomi Gridish <gridish@freescale.com> |
9 | * Li Yang <leoli@freescale.com> | 9 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/include/asm/machdep.h b/arch/powerpc/include/asm/machdep.h index 3c82daf8be99..19d9d96eb8d3 100644 --- a/arch/powerpc/include/asm/machdep.h +++ b/arch/powerpc/include/asm/machdep.h | |||
@@ -166,9 +166,6 @@ struct machdep_calls { | |||
166 | unsigned long size, | 166 | unsigned long size, |
167 | pgprot_t vma_prot); | 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 | * Function for waiting for work with reduced power in idle loop; | 170 | * Function for waiting for work with reduced power in idle loop; |
174 | * called with interrupts disabled. | 171 | * called with interrupts disabled. |
diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h index 5e38eedea218..691fd8aca939 100644 --- a/arch/powerpc/include/asm/mmu.h +++ b/arch/powerpc/include/asm/mmu.h | |||
@@ -101,6 +101,7 @@ | |||
101 | #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 101 | #define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE |
102 | #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 102 | #define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE |
103 | #define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | 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 | #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ | 105 | #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ |
105 | MMU_FTR_CI_LARGE_PAGE | 106 | MMU_FTR_CI_LARGE_PAGE |
106 | #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ | 107 | #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ |
diff --git a/arch/powerpc/include/asm/pSeries_reconfig.h b/arch/powerpc/include/asm/pSeries_reconfig.h deleted file mode 100644 index c07edfe98b98..000000000000 --- a/arch/powerpc/include/asm/pSeries_reconfig.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
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 */ | ||
diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 42b1f43b943b..51fb00a20d7e 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright 2009 Freescale Semicondutor, Inc. | 2 | * Copyright 2009 Freescale Semiconductor, Inc. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or | 4 | * This program is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU General Public License | 5 | * modify it under the terms of the GNU General Public License |
@@ -86,6 +86,7 @@ | |||
86 | #define PPC_INST_DCBA_MASK 0xfc0007fe | 86 | #define PPC_INST_DCBA_MASK 0xfc0007fe |
87 | #define PPC_INST_DCBAL 0x7c2005ec | 87 | #define PPC_INST_DCBAL 0x7c2005ec |
88 | #define PPC_INST_DCBZL 0x7c2007ec | 88 | #define PPC_INST_DCBZL 0x7c2007ec |
89 | #define PPC_INST_ICBT 0x7c00002c | ||
89 | #define PPC_INST_ISEL 0x7c00001e | 90 | #define PPC_INST_ISEL 0x7c00001e |
90 | #define PPC_INST_ISEL_MASK 0xfc00003e | 91 | #define PPC_INST_ISEL_MASK 0xfc00003e |
91 | #define PPC_INST_LDARX 0x7c0000a8 | 92 | #define PPC_INST_LDARX 0x7c0000a8 |
@@ -201,6 +202,7 @@ | |||
201 | #define __PPC_MB(s) (((s) & 0x1f) << 6) | 202 | #define __PPC_MB(s) (((s) & 0x1f) << 6) |
202 | #define __PPC_ME(s) (((s) & 0x1f) << 1) | 203 | #define __PPC_ME(s) (((s) & 0x1f) << 1) |
203 | #define __PPC_BI(s) (((s) & 0x1f) << 16) | 204 | #define __PPC_BI(s) (((s) & 0x1f) << 16) |
205 | #define __PPC_CT(t) (((t) & 0x0f) << 21) | ||
204 | 206 | ||
205 | /* | 207 | /* |
206 | * Only use the larx hint bit on 64bit CPUs. e500v1/v2 based CPUs will treat a | 208 | * Only use the larx hint bit on 64bit CPUs. e500v1/v2 based CPUs will treat a |
@@ -263,6 +265,8 @@ | |||
263 | __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) | 265 | __PPC_RS(t) | __PPC_RA0(a) | __PPC_RB(b)) |
264 | #define PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ | 266 | #define PPC_SLBFEE_DOT(t, b) stringify_in_c(.long PPC_INST_SLBFEE | \ |
265 | __PPC_RT(t) | __PPC_RB(b)) | 267 | __PPC_RT(t) | __PPC_RB(b)) |
268 | #define PPC_ICBT(c,a,b) stringify_in_c(.long PPC_INST_ICBT | \ | ||
269 | __PPC_CT(c) | __PPC_RA0(a) | __PPC_RB(b)) | ||
266 | /* PASemi instructions */ | 270 | /* PASemi instructions */ |
267 | #define LBZCIX(t,a,b) stringify_in_c(.long PPC_INST_LBZCIX | \ | 271 | #define LBZCIX(t,a,b) stringify_in_c(.long PPC_INST_LBZCIX | \ |
268 | __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b)) | 272 | __PPC_RT(t) | __PPC_RA(a) | __PPC_RB(b)) |
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index b5c91901e384..99c92d5363e4 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h | |||
@@ -58,6 +58,22 @@ static inline int of_node_to_nid(struct device_node *device) { return 0; } | |||
58 | 58 | ||
59 | extern void of_instantiate_rtc(void); | 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 | /* These includes are put at the bottom because they may contain things | 77 | /* These includes are put at the bottom because they may contain things |
62 | * that are overridden by this file. Ideally they shouldn't be included | 78 | * that are overridden by this file. Ideally they shouldn't be included |
63 | * by this file, but there are a bunch of .c files that currently depend | 79 | * by this file, but there are a bunch of .c files that currently depend |
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h index 229571a49391..32b9bfa0c9bd 100644 --- a/arch/powerpc/include/asm/qe.h +++ b/arch/powerpc/include/asm/qe.h | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/include/asm/qe_ic.h b/arch/powerpc/include/asm/qe_ic.h index f706164b0bd0..25784cc959a0 100644 --- a/arch/powerpc/include/asm/qe_ic.h +++ b/arch/powerpc/include/asm/qe_ic.h | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h index 97d37278ea2d..3d5c9dc8917a 100644 --- a/arch/powerpc/include/asm/reg.h +++ b/arch/powerpc/include/asm/reg.h | |||
@@ -249,6 +249,8 @@ | |||
249 | #define LPCR_RMLS 0x1C000000 /* impl dependent rmo limit sel */ | 249 | #define LPCR_RMLS 0x1C000000 /* impl dependent rmo limit sel */ |
250 | #define LPCR_RMLS_SH (63-37) | 250 | #define LPCR_RMLS_SH (63-37) |
251 | #define LPCR_ILE 0x02000000 /* !HV irqs set MSR:LE */ | 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 | #define LPCR_PECE 0x00007000 /* powersave exit cause enable */ | 254 | #define LPCR_PECE 0x00007000 /* powersave exit cause enable */ |
253 | #define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */ | 255 | #define LPCR_PECE0 0x00004000 /* ext. exceptions can cause exit */ |
254 | #define LPCR_PECE1 0x00002000 /* decrementer can cause exit */ | 256 | #define LPCR_PECE1 0x00002000 /* decrementer can cause exit */ |
@@ -1030,6 +1032,7 @@ | |||
1030 | #define PVR_970MP 0x0044 | 1032 | #define PVR_970MP 0x0044 |
1031 | #define PVR_970GX 0x0045 | 1033 | #define PVR_970GX 0x0045 |
1032 | #define PVR_POWER7p 0x004A | 1034 | #define PVR_POWER7p 0x004A |
1035 | #define PVR_POWER8 0x004B | ||
1033 | #define PVR_BE 0x0070 | 1036 | #define PVR_BE 0x0070 |
1034 | #define PVR_PA6T 0x0090 | 1037 | #define PVR_PA6T 0x0090 |
1035 | 1038 | ||
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index 557cff845dee..aef00c675905 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h | |||
@@ -353,8 +353,13 @@ static inline int page_is_rtas_user_buf(unsigned long pfn) | |||
353 | return 1; | 353 | return 1; |
354 | return 0; | 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 | #else | 360 | #else |
357 | static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;} | 361 | static inline int page_is_rtas_user_buf(unsigned long pfn) { return 0;} |
362 | static inline void pSeries_coalesce_init(void) { } | ||
358 | #endif | 363 | #endif |
359 | 364 | ||
360 | extern int call_rtas(const char *, int, int, unsigned long *, ...); | 365 | extern int call_rtas(const char *, int, int, unsigned long *, ...); |
diff --git a/arch/powerpc/include/asm/setup.h b/arch/powerpc/include/asm/setup.h new file mode 100644 index 000000000000..d3ca85529b8b --- /dev/null +++ b/arch/powerpc/include/asm/setup.h | |||
@@ -0,0 +1,29 @@ | |||
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 | |||
diff --git a/arch/powerpc/include/asm/ucc.h b/arch/powerpc/include/asm/ucc.h index 46b09ba6bead..6927ac26516e 100644 --- a/arch/powerpc/include/asm/ucc.h +++ b/arch/powerpc/include/asm/ucc.h | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/include/asm/ucc_fast.h b/arch/powerpc/include/asm/ucc_fast.h index 4644c840e2fa..72ea9bab07df 100644 --- a/arch/powerpc/include/asm/ucc_fast.h +++ b/arch/powerpc/include/asm/ucc_fast.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Internal header file for UCC FAST unit routines. | 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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 6 | * Authors: Shlomi Gridish <gridish@freescale.com> |
7 | * Li Yang <leoli@freescale.com> | 7 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/include/asm/ucc_slow.h b/arch/powerpc/include/asm/ucc_slow.h index cf131ffdb8d1..c44131e68e11 100644 --- a/arch/powerpc/include/asm/ucc_slow.h +++ b/arch/powerpc/include/asm/ucc_slow.h | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/include/asm/udbg.h b/arch/powerpc/include/asm/udbg.h index b3038817b8dc..5a7510e9d09d 100644 --- a/arch/powerpc/include/asm/udbg.h +++ b/arch/powerpc/include/asm/udbg.h | |||
@@ -21,7 +21,6 @@ extern int (*udbg_getc_poll)(void); | |||
21 | 21 | ||
22 | extern void udbg_puts(const char *s); | 22 | extern void udbg_puts(const char *s); |
23 | extern int udbg_write(const char *s, int n); | 23 | extern int udbg_write(const char *s, int n); |
24 | extern int udbg_read(char *buf, int buflen); | ||
25 | 24 | ||
26 | extern void register_early_udbg_console(void); | 25 | extern void register_early_udbg_console(void); |
27 | extern void udbg_printf(const char *fmt, ...) | 26 | extern void udbg_printf(const char *fmt, ...) |
diff --git a/arch/powerpc/include/uapi/asm/setup.h b/arch/powerpc/include/uapi/asm/setup.h index 8b9a306260b2..552df83f1a49 100644 --- a/arch/powerpc/include/uapi/asm/setup.h +++ b/arch/powerpc/include/uapi/asm/setup.h | |||
@@ -1,32 +1 @@ | |||
1 | #ifndef _ASM_POWERPC_SETUP_H | ||
2 | #define _ASM_POWERPC_SETUP_H | ||
3 | |||
4 | #include <asm-generic/setup.h> | #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 */ | ||
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index cde12f8a4ebc..8f619342f14c 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -38,7 +38,7 @@ obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ | |||
38 | paca.o nvram_64.o firmware.o | 38 | paca.o nvram_64.o firmware.o |
39 | obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o | 39 | obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o |
40 | obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o | 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 | obj64-$(CONFIG_RELOCATABLE) += reloc_64.o | 42 | obj64-$(CONFIG_RELOCATABLE) += reloc_64.o |
43 | obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o | 43 | obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o |
44 | obj-$(CONFIG_PPC_A2) += cpu_setup_a2.o | 44 | obj-$(CONFIG_PPC_A2) += cpu_setup_a2.o |
diff --git a/arch/powerpc/kernel/cpu_setup_power7.S b/arch/powerpc/kernel/cpu_setup_power.S index 76797c5105d6..57cf14065aec 100644 --- a/arch/powerpc/kernel/cpu_setup_power7.S +++ b/arch/powerpc/kernel/cpu_setup_power.S | |||
@@ -27,6 +27,7 @@ _GLOBAL(__setup_cpu_power7) | |||
27 | beqlr | 27 | beqlr |
28 | li r0,0 | 28 | li r0,0 |
29 | mtspr SPRN_LPID,r0 | 29 | mtspr SPRN_LPID,r0 |
30 | mfspr r3,SPRN_LPCR | ||
30 | bl __init_LPCR | 31 | bl __init_LPCR |
31 | bl __init_TLB | 32 | bl __init_TLB |
32 | mtlr r11 | 33 | mtlr r11 |
@@ -39,6 +40,35 @@ _GLOBAL(__restore_cpu_power7) | |||
39 | beqlr | 40 | beqlr |
40 | li r0,0 | 41 | li r0,0 |
41 | mtspr SPRN_LPID,r0 | 42 | mtspr SPRN_LPID,r0 |
43 | mfspr r3,SPRN_LPCR | ||
44 | bl __init_LPCR | ||
45 | bl __init_TLB | ||
46 | mtlr r11 | ||
47 | blr | ||
48 | |||
49 | _GLOBAL(__setup_cpu_power8) | ||
50 | mflr r11 | ||
51 | bl __init_hvmode_206 | ||
52 | mtlr r11 | ||
53 | beqlr | ||
54 | li r0,0 | ||
55 | mtspr SPRN_LPID,r0 | ||
56 | mfspr r3,SPRN_LPCR | ||
57 | oris r3, r3, LPCR_AIL_3@h | ||
58 | bl __init_LPCR | ||
59 | bl __init_TLB | ||
60 | mtlr r11 | ||
61 | blr | ||
62 | |||
63 | _GLOBAL(__restore_cpu_power8) | ||
64 | mflr r11 | ||
65 | mfmsr r3 | ||
66 | rldicl. r0,r3,4,63 | ||
67 | beqlr | ||
68 | li r0,0 | ||
69 | mtspr SPRN_LPID,r0 | ||
70 | mfspr r3,SPRN_LPCR | ||
71 | oris r3, r3, LPCR_AIL_3@h | ||
42 | bl __init_LPCR | 72 | bl __init_LPCR |
43 | bl __init_TLB | 73 | bl __init_TLB |
44 | mtlr r11 | 74 | mtlr r11 |
@@ -57,6 +87,7 @@ __init_hvmode_206: | |||
57 | 87 | ||
58 | __init_LPCR: | 88 | __init_LPCR: |
59 | /* Setup a sane LPCR: | 89 | /* Setup a sane LPCR: |
90 | * Called with initial LPCR in R3 | ||
60 | * | 91 | * |
61 | * LPES = 0b01 (HSRR0/1 used for 0x500) | 92 | * LPES = 0b01 (HSRR0/1 used for 0x500) |
62 | * PECE = 0b111 | 93 | * PECE = 0b111 |
@@ -67,7 +98,6 @@ __init_LPCR: | |||
67 | * | 98 | * |
68 | * Other bits untouched for now | 99 | * Other bits untouched for now |
69 | */ | 100 | */ |
70 | mfspr r3,SPRN_LPCR | ||
71 | li r5,1 | 101 | li r5,1 |
72 | rldimi r3,r5, LPCR_LPES_SH, 64-LPCR_LPES_SH-2 | 102 | rldimi r3,r5, LPCR_LPES_SH, 64-LPCR_LPES_SH-2 |
73 | ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2) | 103 | ori r3,r3,(LPCR_PECE0|LPCR_PECE1|LPCR_PECE2) |
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index 0514c21f138b..75a3d71b895d 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -68,6 +68,8 @@ extern void __restore_cpu_pa6t(void); | |||
68 | extern void __restore_cpu_ppc970(void); | 68 | extern void __restore_cpu_ppc970(void); |
69 | extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec); | 69 | extern void __setup_cpu_power7(unsigned long offset, struct cpu_spec* spec); |
70 | extern void __restore_cpu_power7(void); | 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 | extern void __restore_cpu_a2(void); | 73 | extern void __restore_cpu_a2(void); |
72 | #endif /* CONFIG_PPC64 */ | 74 | #endif /* CONFIG_PPC64 */ |
73 | #if defined(CONFIG_E500) | 75 | #if defined(CONFIG_E500) |
@@ -94,6 +96,10 @@ extern void __restore_cpu_e5500(void); | |||
94 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ | 96 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ |
95 | PPC_FEATURE_TRUE_LE | \ | 97 | PPC_FEATURE_TRUE_LE | \ |
96 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) | 98 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) |
99 | #define COMMON_USER_POWER8 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_06 |\ | ||
100 | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \ | ||
101 | PPC_FEATURE_TRUE_LE | \ | ||
102 | PPC_FEATURE_PSERIES_PERFMON_COMPAT) | ||
97 | #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ | 103 | #define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\ |
98 | PPC_FEATURE_TRUE_LE | \ | 104 | PPC_FEATURE_TRUE_LE | \ |
99 | PPC_FEATURE_HAS_ALTIVEC_COMP) | 105 | PPC_FEATURE_HAS_ALTIVEC_COMP) |
@@ -429,6 +435,21 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
429 | .cpu_restore = __restore_cpu_power7, | 435 | .cpu_restore = __restore_cpu_power7, |
430 | .platform = "power7", | 436 | .platform = "power7", |
431 | }, | 437 | }, |
438 | { /* 2.07-compliant processor, i.e. Power8 "architected" mode */ | ||
439 | .pvr_mask = 0xffffffff, | ||
440 | .pvr_value = 0x0f000004, | ||
441 | .cpu_name = "POWER8 (architected)", | ||
442 | .cpu_features = CPU_FTRS_POWER8, | ||
443 | .cpu_user_features = COMMON_USER_POWER8, | ||
444 | .mmu_features = MMU_FTRS_POWER8, | ||
445 | .icache_bsize = 128, | ||
446 | .dcache_bsize = 128, | ||
447 | .oprofile_type = PPC_OPROFILE_POWER4, | ||
448 | .oprofile_cpu_type = "ppc64/ibm-compat-v1", | ||
449 | .cpu_setup = __setup_cpu_power8, | ||
450 | .cpu_restore = __restore_cpu_power8, | ||
451 | .platform = "power8", | ||
452 | }, | ||
432 | { /* Power7 */ | 453 | { /* Power7 */ |
433 | .pvr_mask = 0xffff0000, | 454 | .pvr_mask = 0xffff0000, |
434 | .pvr_value = 0x003f0000, | 455 | .pvr_value = 0x003f0000, |
@@ -463,6 +484,23 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
463 | .cpu_restore = __restore_cpu_power7, | 484 | .cpu_restore = __restore_cpu_power7, |
464 | .platform = "power7+", | 485 | .platform = "power7+", |
465 | }, | 486 | }, |
487 | { /* Power8 */ | ||
488 | .pvr_mask = 0xffff0000, | ||
489 | .pvr_value = 0x004b0000, | ||
490 | .cpu_name = "POWER8 (raw)", | ||
491 | .cpu_features = CPU_FTRS_POWER8, | ||
492 | .cpu_user_features = COMMON_USER_POWER8, | ||
493 | .mmu_features = MMU_FTRS_POWER8, | ||
494 | .icache_bsize = 128, | ||
495 | .dcache_bsize = 128, | ||
496 | .num_pmcs = 6, | ||
497 | .pmc_type = PPC_PMC_IBM, | ||
498 | .oprofile_cpu_type = "ppc64/power8", | ||
499 | .oprofile_type = PPC_OPROFILE_POWER4, | ||
500 | .cpu_setup = __setup_cpu_power8, | ||
501 | .cpu_restore = __restore_cpu_power8, | ||
502 | .platform = "power8", | ||
503 | }, | ||
466 | { /* Cell Broadband Engine */ | 504 | { /* Cell Broadband Engine */ |
467 | .pvr_mask = 0xffff0000, | 505 | .pvr_mask = 0xffff0000, |
468 | .pvr_value = 0x00700000, | 506 | .pvr_value = 0x00700000, |
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S index e9a906c27234..b310a0573625 100644 --- a/arch/powerpc/kernel/entry_64.S +++ b/arch/powerpc/kernel/entry_64.S | |||
@@ -373,6 +373,8 @@ _GLOBAL(ret_from_fork) | |||
373 | _GLOBAL(ret_from_kernel_thread) | 373 | _GLOBAL(ret_from_kernel_thread) |
374 | bl .schedule_tail | 374 | bl .schedule_tail |
375 | REST_NVGPRS(r1) | 375 | REST_NVGPRS(r1) |
376 | li r3,0 | ||
377 | std r3,0(r1) | ||
376 | ld r14, 0(r14) | 378 | ld r14, 0(r14) |
377 | mtlr r14 | 379 | mtlr r14 |
378 | mr r3,r15 | 380 | mr r3,r15 |
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 10b658ad65e1..4665e82fa377 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S | |||
@@ -19,12 +19,76 @@ | |||
19 | /* | 19 | /* |
20 | * We layout physical memory as follows: | 20 | * We layout physical memory as follows: |
21 | * 0x0000 - 0x00ff : Secondary processor spin code | 21 | * 0x0000 - 0x00ff : Secondary processor spin code |
22 | * 0x0100 - 0x2fff : pSeries Interrupt prologs | 22 | * 0x0100 - 0x17ff : pSeries Interrupt prologs |
23 | * 0x3000 - 0x5fff : interrupt support common interrupt prologs | 23 | * 0x1800 - 0x4000 : interrupt support common interrupt prologs |
24 | * 0x6000 - 0x6fff : Initial (CPU0) segment table | 24 | * 0x4000 - 0x5fff : pSeries interrupts with IR=1,DR=1 |
25 | * 0x6000 - 0x6fff : more interrupt support including for IR=1,DR=1 | ||
25 | * 0x7000 - 0x7fff : FWNMI data area | 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 | * This is the start of the interrupt handlers for pSeries | 94 | * This is the start of the interrupt handlers for pSeries |
@@ -207,31 +271,11 @@ system_call_pSeries: | |||
207 | KVMTEST(0xc00) | 271 | KVMTEST(0xc00) |
208 | GET_SCRATCH0(r13) | 272 | GET_SCRATCH0(r13) |
209 | #endif | 273 | #endif |
210 | BEGIN_FTR_SECTION | 274 | SYSCALL_PSERIES_1 |
211 | cmpdi r0,0x1ebe | 275 | SYSCALL_PSERIES_2_RFID |
212 | beq- 1f | 276 | SYSCALL_PSERIES_3 |
213 | END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) | ||
214 | mr r9,r13 | ||
215 | GET_PACA(r13) | ||
216 | mfspr r11,SPRN_SRR0 | ||
217 | mfspr r12,SPRN_SRR1 | ||
218 | ld r10,PACAKBASE(r13) | ||
219 | LOAD_HANDLER(r10, system_call_entry) | ||
220 | mtspr SPRN_SRR0,r10 | ||
221 | ld r10,PACAKMSR(r13) | ||
222 | mtspr SPRN_SRR1,r10 | ||
223 | rfid | ||
224 | b . /* prevent speculative execution */ | ||
225 | |||
226 | KVM_HANDLER(PACA_EXGEN, EXC_STD, 0xc00) | 277 | KVM_HANDLER(PACA_EXGEN, EXC_STD, 0xc00) |
227 | 278 | ||
228 | /* Fast LE/BE switch system call */ | ||
229 | 1: mfspr r12,SPRN_SRR1 | ||
230 | xori r12,r12,MSR_LE | ||
231 | mtspr SPRN_SRR1,r12 | ||
232 | rfid /* return to userspace */ | ||
233 | b . | ||
234 | |||
235 | STD_EXCEPTION_PSERIES(0xd00, 0xd00, single_step) | 279 | STD_EXCEPTION_PSERIES(0xd00, 0xd00, single_step) |
236 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xd00) | 280 | KVM_HANDLER_PR(PACA_EXGEN, EXC_STD, 0xd00) |
237 | 281 | ||
@@ -276,7 +320,7 @@ vsx_unavailable_pSeries_1: | |||
276 | KVM_HANDLER_PR_SKIP(PACA_EXGEN, EXC_STD, 0x1300) | 320 | KVM_HANDLER_PR_SKIP(PACA_EXGEN, EXC_STD, 0x1300) |
277 | 321 | ||
278 | . = 0x1500 | 322 | . = 0x1500 |
279 | .global denorm_Hypervisor | 323 | .global denorm_exception_hv |
280 | denorm_exception_hv: | 324 | denorm_exception_hv: |
281 | HMT_MEDIUM | 325 | HMT_MEDIUM |
282 | mtspr SPRN_SPRG_HSCRATCH0,r13 | 326 | mtspr SPRN_SPRG_HSCRATCH0,r13 |
@@ -311,12 +355,14 @@ denorm_exception_hv: | |||
311 | #ifdef CONFIG_CBE_RAS | 355 | #ifdef CONFIG_CBE_RAS |
312 | STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal) | 356 | STD_EXCEPTION_HV(0x1800, 0x1802, cbe_thermal) |
313 | KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1802) | 357 | KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1802) |
358 | #else | ||
359 | . = 0x1800 | ||
314 | #endif /* CONFIG_CBE_RAS */ | 360 | #endif /* CONFIG_CBE_RAS */ |
315 | 361 | ||
316 | . = 0x3000 | ||
317 | 362 | ||
318 | /*** Out of line interrupts support ***/ | 363 | /*** Out of line interrupts support ***/ |
319 | 364 | ||
365 | .align 7 | ||
320 | /* moved from 0x200 */ | 366 | /* moved from 0x200 */ |
321 | machine_check_pSeries: | 367 | machine_check_pSeries: |
322 | .globl machine_check_fwnmi | 368 | .globl machine_check_fwnmi |
@@ -575,16 +621,12 @@ slb_miss_user_pseries: | |||
575 | b . /* prevent spec. execution */ | 621 | b . /* prevent spec. execution */ |
576 | #endif /* __DISABLED__ */ | 622 | #endif /* __DISABLED__ */ |
577 | 623 | ||
578 | .align 7 | ||
579 | .globl __end_interrupts | ||
580 | __end_interrupts: | ||
581 | |||
582 | /* | 624 | /* |
583 | * Code from here down to __end_handlers is invoked from the | 625 | * Code from here down to __end_handlers is invoked from the |
584 | * exception prologs above. Because the prologs assemble the | 626 | * exception prologs above. Because the prologs assemble the |
585 | * addresses of these handlers using the LOAD_HANDLER macro, | 627 | * addresses of these handlers using the LOAD_HANDLER macro, |
586 | * which uses an addi instruction, these handlers must be in | 628 | * which uses an ori instruction, these handlers must be in |
587 | * the first 32k of the kernel image. | 629 | * the first 64k of the kernel image. |
588 | */ | 630 | */ |
589 | 631 | ||
590 | /*** Common interrupt handlers ***/ | 632 | /*** Common interrupt handlers ***/ |
@@ -613,8 +655,8 @@ machine_check_common: | |||
613 | STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) | 655 | STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception) |
614 | STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) | 656 | STD_EXCEPTION_COMMON(0xd00, single_step, .single_step_exception) |
615 | STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) | 657 | STD_EXCEPTION_COMMON(0xe00, trap_0e, .unknown_exception) |
616 | STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) | 658 | STD_EXCEPTION_COMMON(0xe40, emulation_assist, .program_check_exception) |
617 | STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) | 659 | STD_EXCEPTION_COMMON(0xe60, hmi_exception, .unknown_exception) |
618 | STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, .performance_monitor_exception) | 660 | STD_EXCEPTION_COMMON_ASYNC(0xf00, performance_monitor, .performance_monitor_exception) |
619 | STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) | 661 | STD_EXCEPTION_COMMON(0x1300, instruction_breakpoint, .instruction_breakpoint_exception) |
620 | STD_EXCEPTION_COMMON(0x1502, denorm, .unknown_exception) | 662 | STD_EXCEPTION_COMMON(0x1502, denorm, .unknown_exception) |
@@ -629,7 +671,158 @@ machine_check_common: | |||
629 | STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception) | 671 | STD_EXCEPTION_COMMON(0x1800, cbe_thermal, .cbe_thermal_exception) |
630 | #endif /* CONFIG_CBE_RAS */ | 672 | #endif /* CONFIG_CBE_RAS */ |
631 | 673 | ||
674 | /* | ||
675 | * Relocation-on interrupts: A subset of the interrupts can be delivered | ||
676 | * with IR=1/DR=1, if AIL==2 and MSR.HV won't be changed by delivering | ||
677 | * it. Addresses are the same as the original interrupt addresses, but | ||
678 | * offset by 0xc000000000004000. | ||
679 | * It's impossible to receive interrupts below 0x300 via this mechanism. | ||
680 | * KVM: None of these traps are from the guest ; anything that escalated | ||
681 | * to HV=1 from HV=0 is delivered via real mode handlers. | ||
682 | */ | ||
683 | |||
684 | /* | ||
685 | * This uses the standard macro, since the original 0x300 vector | ||
686 | * only has extra guff for STAB-based processors -- which never | ||
687 | * come here. | ||
688 | */ | ||
689 | STD_RELON_EXCEPTION_PSERIES(0x4300, 0x300, data_access) | ||
690 | . = 0x4380 | ||
691 | .globl data_access_slb_relon_pSeries | ||
692 | data_access_slb_relon_pSeries: | ||
693 | HMT_MEDIUM | ||
694 | SET_SCRATCH0(r13) | ||
695 | EXCEPTION_PROLOG_1(PACA_EXSLB, NOTEST, 0x380) | ||
696 | std r3,PACA_EXSLB+EX_R3(r13) | ||
697 | mfspr r3,SPRN_DAR | ||
698 | mfspr r12,SPRN_SRR1 | ||
699 | #ifndef CONFIG_RELOCATABLE | ||
700 | b .slb_miss_realmode | ||
701 | #else | ||
702 | /* | ||
703 | * We can't just use a direct branch to .slb_miss_realmode | ||
704 | * because the distance from here to there depends on where | ||
705 | * the kernel ends up being put. | ||
706 | */ | ||
707 | mfctr r11 | ||
708 | ld r10,PACAKBASE(r13) | ||
709 | LOAD_HANDLER(r10, .slb_miss_realmode) | ||
710 | mtctr r10 | ||
711 | bctr | ||
712 | #endif | ||
713 | |||
714 | STD_RELON_EXCEPTION_PSERIES(0x4400, 0x400, instruction_access) | ||
715 | . = 0x4480 | ||
716 | .globl instruction_access_slb_relon_pSeries | ||
717 | instruction_access_slb_relon_pSeries: | ||
718 | HMT_MEDIUM | ||
719 | SET_SCRATCH0(r13) | ||
720 | EXCEPTION_PROLOG_1(PACA_EXSLB, NOTEST, 0x480) | ||
721 | std r3,PACA_EXSLB+EX_R3(r13) | ||
722 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ | ||
723 | mfspr r12,SPRN_SRR1 | ||
724 | #ifndef CONFIG_RELOCATABLE | ||
725 | b .slb_miss_realmode | ||
726 | #else | ||
727 | mfctr r11 | ||
728 | ld r10,PACAKBASE(r13) | ||
729 | LOAD_HANDLER(r10, .slb_miss_realmode) | ||
730 | mtctr r10 | ||
731 | bctr | ||
732 | #endif | ||
733 | |||
734 | . = 0x4500 | ||
735 | .globl hardware_interrupt_relon_pSeries; | ||
736 | .globl hardware_interrupt_relon_hv; | ||
737 | hardware_interrupt_relon_pSeries: | ||
738 | hardware_interrupt_relon_hv: | ||
739 | BEGIN_FTR_SECTION | ||
740 | _MASKABLE_RELON_EXCEPTION_PSERIES(0x502, hardware_interrupt, EXC_HV, SOFTEN_TEST_HV) | ||
741 | FTR_SECTION_ELSE | ||
742 | _MASKABLE_RELON_EXCEPTION_PSERIES(0x500, hardware_interrupt, EXC_STD, SOFTEN_TEST_PR) | ||
743 | ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_206) | ||
744 | STD_RELON_EXCEPTION_PSERIES(0x4600, 0x600, alignment) | ||
745 | STD_RELON_EXCEPTION_PSERIES(0x4700, 0x700, program_check) | ||
746 | STD_RELON_EXCEPTION_PSERIES(0x4800, 0x800, fp_unavailable) | ||
747 | MASKABLE_RELON_EXCEPTION_PSERIES(0x4900, 0x900, decrementer) | ||
748 | STD_RELON_EXCEPTION_HV(0x4980, 0x982, hdecrementer) | ||
749 | STD_RELON_EXCEPTION_PSERIES(0x4b00, 0xb00, trap_0b) | ||
750 | |||
751 | . = 0x4c00 | ||
752 | .globl system_call_relon_pSeries | ||
753 | system_call_relon_pSeries: | ||
754 | HMT_MEDIUM | ||
755 | SYSCALL_PSERIES_1 | ||
756 | SYSCALL_PSERIES_2_DIRECT | ||
757 | SYSCALL_PSERIES_3 | ||
758 | |||
759 | STD_RELON_EXCEPTION_PSERIES(0x4d00, 0xd00, single_step) | ||
760 | |||
761 | . = 0x4e00 | ||
762 | b h_data_storage_relon_hv | ||
763 | |||
764 | . = 0x4e20 | ||
765 | b h_instr_storage_relon_hv | ||
766 | |||
767 | . = 0x4e40 | ||
768 | b emulation_assist_relon_hv | ||
769 | |||
770 | . = 0x4e50 | ||
771 | b hmi_exception_relon_hv | ||
772 | |||
773 | . = 0x4e60 | ||
774 | b hmi_exception_relon_hv | ||
775 | |||
776 | /* For when we support the doorbell interrupt: | ||
777 | STD_RELON_EXCEPTION_HYPERVISOR(0x4e80, 0xe80, doorbell_hyper) | ||
778 | */ | ||
779 | |||
780 | performance_monitor_relon_pSeries_1: | ||
781 | . = 0x4f00 | ||
782 | b performance_monitor_relon_pSeries | ||
783 | |||
784 | altivec_unavailable_relon_pSeries_1: | ||
785 | . = 0x4f20 | ||
786 | b altivec_unavailable_relon_pSeries | ||
787 | |||
788 | vsx_unavailable_relon_pSeries_1: | ||
789 | . = 0x4f40 | ||
790 | b vsx_unavailable_relon_pSeries | ||
791 | |||
792 | #ifdef CONFIG_CBE_RAS | ||
793 | STD_RELON_EXCEPTION_HV(0x5200, 0x1202, cbe_system_error) | ||
794 | #endif /* CONFIG_CBE_RAS */ | ||
795 | STD_RELON_EXCEPTION_PSERIES(0x5300, 0x1300, instruction_breakpoint) | ||
796 | #ifdef CONFIG_PPC_DENORMALISATION | ||
797 | . = 0x5500 | ||
798 | b denorm_exception_hv | ||
799 | #endif | ||
800 | #ifdef CONFIG_CBE_RAS | ||
801 | STD_RELON_EXCEPTION_HV(0x5600, 0x1602, cbe_maintenance) | ||
802 | #else | ||
803 | #ifdef CONFIG_HVC_SCOM | ||
804 | STD_RELON_EXCEPTION_HV(0x5600, 0x1600, maintence_interrupt) | ||
805 | KVM_HANDLER_SKIP(PACA_EXGEN, EXC_HV, 0x1600) | ||
806 | #endif /* CONFIG_HVC_SCOM */ | ||
807 | #endif /* CONFIG_CBE_RAS */ | ||
808 | STD_RELON_EXCEPTION_PSERIES(0x5700, 0x1700, altivec_assist) | ||
809 | #ifdef CONFIG_CBE_RAS | ||
810 | STD_RELON_EXCEPTION_HV(0x5800, 0x1802, cbe_thermal) | ||
811 | #endif /* CONFIG_CBE_RAS */ | ||
812 | |||
813 | /* Other future vectors */ | ||
632 | .align 7 | 814 | .align 7 |
815 | .globl __end_interrupts | ||
816 | __end_interrupts: | ||
817 | |||
818 | .align 7 | ||
819 | system_call_entry_direct: | ||
820 | #if defined(CONFIG_RELOCATABLE) | ||
821 | /* The first level prologue may have used LR to get here, saving | ||
822 | * orig in r10. To save hacking/ifdeffing common code, restore here. | ||
823 | */ | ||
824 | mtlr r10 | ||
825 | #endif | ||
633 | system_call_entry: | 826 | system_call_entry: |
634 | b system_call_common | 827 | b system_call_common |
635 | 828 | ||
@@ -714,21 +907,21 @@ data_access_common: | |||
714 | ld r3,PACA_EXGEN+EX_DAR(r13) | 907 | ld r3,PACA_EXGEN+EX_DAR(r13) |
715 | lwz r4,PACA_EXGEN+EX_DSISR(r13) | 908 | lwz r4,PACA_EXGEN+EX_DSISR(r13) |
716 | li r5,0x300 | 909 | li r5,0x300 |
717 | b .do_hash_page /* Try to handle as hpte fault */ | 910 | b .do_hash_page /* Try to handle as hpte fault */ |
718 | 911 | ||
719 | .align 7 | 912 | .align 7 |
720 | .globl h_data_storage_common | 913 | .globl h_data_storage_common |
721 | h_data_storage_common: | 914 | h_data_storage_common: |
722 | mfspr r10,SPRN_HDAR | 915 | mfspr r10,SPRN_HDAR |
723 | std r10,PACA_EXGEN+EX_DAR(r13) | 916 | std r10,PACA_EXGEN+EX_DAR(r13) |
724 | mfspr r10,SPRN_HDSISR | 917 | mfspr r10,SPRN_HDSISR |
725 | stw r10,PACA_EXGEN+EX_DSISR(r13) | 918 | stw r10,PACA_EXGEN+EX_DSISR(r13) |
726 | EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) | 919 | EXCEPTION_PROLOG_COMMON(0xe00, PACA_EXGEN) |
727 | bl .save_nvgprs | 920 | bl .save_nvgprs |
728 | DISABLE_INTS | 921 | DISABLE_INTS |
729 | addi r3,r1,STACK_FRAME_OVERHEAD | 922 | addi r3,r1,STACK_FRAME_OVERHEAD |
730 | bl .unknown_exception | 923 | bl .unknown_exception |
731 | b .ret_from_except | 924 | b .ret_from_except |
732 | 925 | ||
733 | .align 7 | 926 | .align 7 |
734 | .globl instruction_access_common | 927 | .globl instruction_access_common |
@@ -741,7 +934,7 @@ instruction_access_common: | |||
741 | li r5,0x400 | 934 | li r5,0x400 |
742 | b .do_hash_page /* Try to handle as hpte fault */ | 935 | b .do_hash_page /* Try to handle as hpte fault */ |
743 | 936 | ||
744 | STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) | 937 | STD_EXCEPTION_COMMON(0xe20, h_instr_storage, .unknown_exception) |
745 | 938 | ||
746 | /* | 939 | /* |
747 | * Here is the common SLB miss user that is used when going to virtual | 940 | * Here is the common SLB miss user that is used when going to virtual |
@@ -1152,6 +1345,21 @@ _GLOBAL(do_stab_bolted) | |||
1152 | rfid | 1345 | rfid |
1153 | b . /* prevent speculative execution */ | 1346 | b . /* prevent speculative execution */ |
1154 | 1347 | ||
1348 | |||
1349 | /* Equivalents to the above handlers for relocation-on interrupt vectors */ | ||
1350 | STD_RELON_EXCEPTION_HV(., 0xe00, h_data_storage) | ||
1351 | KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe00) | ||
1352 | STD_RELON_EXCEPTION_HV(., 0xe20, h_instr_storage) | ||
1353 | KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe20) | ||
1354 | STD_RELON_EXCEPTION_HV(., 0xe40, emulation_assist) | ||
1355 | KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe40) | ||
1356 | STD_RELON_EXCEPTION_HV(., 0xe60, hmi_exception) | ||
1357 | KVM_HANDLER(PACA_EXGEN, EXC_HV, 0xe60) | ||
1358 | |||
1359 | STD_RELON_EXCEPTION_PSERIES(., 0xf00, performance_monitor) | ||
1360 | STD_RELON_EXCEPTION_PSERIES(., 0xf20, altivec_unavailable) | ||
1361 | STD_RELON_EXCEPTION_PSERIES(., 0xf40, vsx_unavailable) | ||
1362 | |||
1155 | #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) | 1363 | #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) |
1156 | /* | 1364 | /* |
1157 | * Data area reserved for FWNMI option. | 1365 | * Data area reserved for FWNMI option. |
@@ -1164,7 +1372,7 @@ fwnmi_data_area: | |||
1164 | /* pseries and powernv need to keep the whole page from | 1372 | /* pseries and powernv need to keep the whole page from |
1165 | * 0x7000 to 0x8000 free for use by the firmware | 1373 | * 0x7000 to 0x8000 free for use by the firmware |
1166 | */ | 1374 | */ |
1167 | . = 0x8000 | 1375 | . = 0x8000 |
1168 | #endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */ | 1376 | #endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */ |
1169 | 1377 | ||
1170 | /* Space for CPU0's segment table */ | 1378 | /* Space for CPU0's segment table */ |
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 58bddee8e1e8..116f0868695b 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -422,7 +422,7 @@ _STATIC(__after_prom_start) | |||
422 | tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */ | 422 | tovirt(r6,r6) /* on booke, we already run at PAGE_OFFSET */ |
423 | #endif | 423 | #endif |
424 | 424 | ||
425 | #ifdef CONFIG_CRASH_DUMP | 425 | #ifdef CONFIG_RELOCATABLE |
426 | /* | 426 | /* |
427 | * Check if the kernel has to be running as relocatable kernel based on the | 427 | * Check if the kernel has to be running as relocatable kernel based on the |
428 | * variable __run_at_load, if it is set the kernel is treated as relocatable | 428 | * variable __run_at_load, if it is set the kernel is treated as relocatable |
@@ -432,7 +432,8 @@ _STATIC(__after_prom_start) | |||
432 | cmplwi cr0,r7,1 | 432 | cmplwi cr0,r7,1 |
433 | bne 3f | 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 | b 5f | 437 | b 5f |
437 | 3: | 438 | 3: |
438 | #endif | 439 | #endif |
@@ -703,6 +704,7 @@ _INIT_STATIC(start_here_multiplatform) | |||
703 | 704 | ||
704 | #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL | 705 | #ifdef CONFIG_PPC_EARLY_DEBUG_OPAL |
705 | /* Setup OPAL entry */ | 706 | /* Setup OPAL entry */ |
707 | LOAD_REG_ADDR(r11, opal) | ||
706 | std r28,0(r11); | 708 | std r28,0(r11); |
707 | std r29,8(r11); | 709 | std r29,8(r11); |
708 | #endif | 710 | #endif |
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index 2099d9a879e8..ea78761aa169 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c | |||
@@ -55,9 +55,6 @@ __setup("powersave=off", powersave_off); | |||
55 | */ | 55 | */ |
56 | void cpu_idle(void) | 56 | void cpu_idle(void) |
57 | { | 57 | { |
58 | if (ppc_md.idle_loop) | ||
59 | ppc_md.idle_loop(); /* doesn't return */ | ||
60 | |||
61 | set_thread_flag(TIF_POLLING_NRFLAG); | 58 | set_thread_flag(TIF_POLLING_NRFLAG); |
62 | while (1) { | 59 | while (1) { |
63 | tick_nohz_idle_enter(); | 60 | tick_nohz_idle_enter(); |
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 8226c6cb348a..c862fd716fe3 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -656,7 +656,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) | |||
656 | struct iommu_pool *p; | 656 | struct iommu_pool *p; |
657 | 657 | ||
658 | /* number of bytes needed for the bitmap */ | 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 | page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz)); | 661 | page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz)); |
662 | if (!page) | 662 | if (!page) |
@@ -708,7 +708,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) | |||
708 | 708 | ||
709 | void iommu_free_table(struct iommu_table *tbl, const char *node_name) | 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 | unsigned int order; | 712 | unsigned int order; |
713 | 713 | ||
714 | if (!tbl || !tbl->it_map) { | 714 | if (!tbl || !tbl->it_map) { |
@@ -718,17 +718,11 @@ void iommu_free_table(struct iommu_table *tbl, const char *node_name) | |||
718 | } | 718 | } |
719 | 719 | ||
720 | /* verify that table contains no entries */ | 720 | /* verify that table contains no entries */ |
721 | /* it_size is in entries, and we're examining 64 at a time */ | 721 | if (!bitmap_empty(tbl->it_map, tbl->it_size)) |
722 | for (i = 0; i < (tbl->it_size/64); i++) { | 722 | pr_warn("%s: Unexpected TCEs for %s\n", __func__, node_name); |
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 | } | ||
729 | 723 | ||
730 | /* calculate bitmap size in bytes */ | 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 | /* free bitmap */ | 727 | /* free bitmap */ |
734 | order = get_order(bitmap_sz); | 728 | order = get_order(bitmap_sz); |
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c index fa9f6c72f557..e1ec57e87b3b 100644 --- a/arch/powerpc/kernel/machine_kexec.c +++ b/arch/powerpc/kernel/machine_kexec.c | |||
@@ -218,23 +218,23 @@ static void __init export_crashk_values(struct device_node *node) | |||
218 | * be sure what's in them, so remove them. */ | 218 | * be sure what's in them, so remove them. */ |
219 | prop = of_find_property(node, "linux,crashkernel-base", NULL); | 219 | prop = of_find_property(node, "linux,crashkernel-base", NULL); |
220 | if (prop) | 220 | if (prop) |
221 | prom_remove_property(node, prop); | 221 | of_remove_property(node, prop); |
222 | 222 | ||
223 | prop = of_find_property(node, "linux,crashkernel-size", NULL); | 223 | prop = of_find_property(node, "linux,crashkernel-size", NULL); |
224 | if (prop) | 224 | if (prop) |
225 | prom_remove_property(node, prop); | 225 | of_remove_property(node, prop); |
226 | 226 | ||
227 | if (crashk_res.start != 0) { | 227 | if (crashk_res.start != 0) { |
228 | prom_add_property(node, &crashk_base_prop); | 228 | of_add_property(node, &crashk_base_prop); |
229 | crashk_size = resource_size(&crashk_res); | 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 | * memory_limit is required by the kexec-tools to limit the | 234 | * memory_limit is required by the kexec-tools to limit the |
235 | * crash regions to the actual memory used. | 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 | static int __init kexec_setup(void) | 240 | static int __init kexec_setup(void) |
@@ -249,11 +249,11 @@ static int __init kexec_setup(void) | |||
249 | /* remove any stale properties so ours can be found */ | 249 | /* remove any stale properties so ours can be found */ |
250 | prop = of_find_property(node, kernel_end_prop.name, NULL); | 250 | prop = of_find_property(node, kernel_end_prop.name, NULL); |
251 | if (prop) | 251 | if (prop) |
252 | prom_remove_property(node, prop); | 252 | of_remove_property(node, prop); |
253 | 253 | ||
254 | /* information needed by userspace when using default_machine_kexec */ | 254 | /* information needed by userspace when using default_machine_kexec */ |
255 | kernel_end = __pa(_end); | 255 | kernel_end = __pa(_end); |
256 | prom_add_property(node, &kernel_end_prop); | 256 | of_add_property(node, &kernel_end_prop); |
257 | 257 | ||
258 | export_crashk_values(node); | 258 | export_crashk_values(node); |
259 | 259 | ||
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index d7f609086a99..7206701b1ff1 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -389,14 +389,14 @@ static int __init export_htab_values(void) | |||
389 | /* remove any stale propertys so ours can be found */ | 389 | /* remove any stale propertys so ours can be found */ |
390 | prop = of_find_property(node, htab_base_prop.name, NULL); | 390 | prop = of_find_property(node, htab_base_prop.name, NULL); |
391 | if (prop) | 391 | if (prop) |
392 | prom_remove_property(node, prop); | 392 | of_remove_property(node, prop); |
393 | prop = of_find_property(node, htab_size_prop.name, NULL); | 393 | prop = of_find_property(node, htab_size_prop.name, NULL); |
394 | if (prop) | 394 | if (prop) |
395 | prom_remove_property(node, prop); | 395 | of_remove_property(node, prop); |
396 | 396 | ||
397 | htab_base = __pa(htab_address); | 397 | htab_base = __pa(htab_address); |
398 | prom_add_property(node, &htab_base_prop); | 398 | of_add_property(node, &htab_base_prop); |
399 | prom_add_property(node, &htab_size_prop); | 399 | of_add_property(node, &htab_size_prop); |
400 | 400 | ||
401 | of_node_put(node); | 401 | of_node_put(node); |
402 | return 0; | 402 | return 0; |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 4b06ec5a502e..64f526a321f5 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -208,7 +208,7 @@ pci_create_OF_bus_map(void) | |||
208 | of_prop->name = "pci-OF-bus-map"; | 208 | of_prop->name = "pci-OF-bus-map"; |
209 | of_prop->length = 256; | 209 | of_prop->length = 256; |
210 | of_prop->value = &of_prop[1]; | 210 | of_prop->value = &of_prop[1]; |
211 | prom_add_property(dn, of_prop); | 211 | of_add_property(dn, of_prop); |
212 | of_node_put(dn); | 212 | of_node_put(dn); |
213 | } | 213 | } |
214 | } | 214 | } |
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index 37725e86651e..8b6f7a99cce2 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/debugfs.h> | 32 | #include <linux/debugfs.h> |
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/memblock.h> | 34 | #include <linux/memblock.h> |
35 | #include <linux/of.h> | ||
35 | 36 | ||
36 | #include <asm/prom.h> | 37 | #include <asm/prom.h> |
37 | #include <asm/rtas.h> | 38 | #include <asm/rtas.h> |
@@ -49,11 +50,11 @@ | |||
49 | #include <asm/btext.h> | 50 | #include <asm/btext.h> |
50 | #include <asm/sections.h> | 51 | #include <asm/sections.h> |
51 | #include <asm/machdep.h> | 52 | #include <asm/machdep.h> |
52 | #include <asm/pSeries_reconfig.h> | ||
53 | #include <asm/pci-bridge.h> | 53 | #include <asm/pci-bridge.h> |
54 | #include <asm/kexec.h> | 54 | #include <asm/kexec.h> |
55 | #include <asm/opal.h> | 55 | #include <asm/opal.h> |
56 | #include <asm/fadump.h> | 56 | #include <asm/fadump.h> |
57 | #include <asm/debug.h> | ||
57 | 58 | ||
58 | #include <mm/mmu_decl.h> | 59 | #include <mm/mmu_decl.h> |
59 | 60 | ||
@@ -802,7 +803,7 @@ static int prom_reconfig_notifier(struct notifier_block *nb, | |||
802 | int err; | 803 | int err; |
803 | 804 | ||
804 | switch (action) { | 805 | switch (action) { |
805 | case PSERIES_RECONFIG_ADD: | 806 | case OF_RECONFIG_ATTACH_NODE: |
806 | err = of_finish_dynamic_node(node); | 807 | err = of_finish_dynamic_node(node); |
807 | if (err < 0) | 808 | if (err < 0) |
808 | printk(KERN_ERR "finish_node returned %d\n", err); | 809 | printk(KERN_ERR "finish_node returned %d\n", err); |
@@ -821,7 +822,7 @@ static struct notifier_block prom_reconfig_nb = { | |||
821 | 822 | ||
822 | static int __init prom_reconfig_setup(void) | 823 | static int __init prom_reconfig_setup(void) |
823 | { | 824 | { |
824 | return pSeries_reconfig_notifier_register(&prom_reconfig_nb); | 825 | return of_reconfig_notifier_register(&prom_reconfig_nb); |
825 | } | 826 | } |
826 | __initcall(prom_reconfig_setup); | 827 | __initcall(prom_reconfig_setup); |
827 | #endif | 828 | #endif |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index cb6c123722a2..779f34049a56 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -671,6 +671,7 @@ static void __init early_cmdline_parse(void) | |||
671 | #define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */ | 671 | #define OV1_PPC_2_04 0x08 /* set if we support PowerPC 2.04 */ |
672 | #define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */ | 672 | #define OV1_PPC_2_05 0x04 /* set if we support PowerPC 2.05 */ |
673 | #define OV1_PPC_2_06 0x02 /* set if we support PowerPC 2.06 */ | 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 | /* Option vector 2: Open Firmware options supported */ | 676 | /* Option vector 2: Open Firmware options supported */ |
676 | #define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */ | 677 | #define OV2_REAL_MODE 0x20 /* set if we want OF in real mode */ |
@@ -707,6 +708,7 @@ static void __init early_cmdline_parse(void) | |||
707 | #define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */ | 708 | #define OV5_PFO_HW_RNG 0x80 /* PFO Random Number Generator */ |
708 | #define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */ | 709 | #define OV5_PFO_HW_842 0x40 /* PFO Compression Accelerator */ |
709 | #define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */ | 710 | #define OV5_PFO_HW_ENCR 0x20 /* PFO Encryption Accelerator */ |
711 | #define OV5_SUB_PROCESSORS 0x01 /* 1,2,or 4 Sub-Processors supported */ | ||
710 | 712 | ||
711 | /* Option Vector 6: IBM PAPR hints */ | 713 | /* Option Vector 6: IBM PAPR hints */ |
712 | #define OV6_LINUX 0x02 /* Linux is our OS */ | 714 | #define OV6_LINUX 0x02 /* Linux is our OS */ |
@@ -719,6 +721,8 @@ static unsigned char ibm_architecture_vec[] = { | |||
719 | W(0xfffe0000), W(0x003a0000), /* POWER5/POWER5+ */ | 721 | W(0xfffe0000), W(0x003a0000), /* POWER5/POWER5+ */ |
720 | W(0xffff0000), W(0x003e0000), /* POWER6 */ | 722 | W(0xffff0000), W(0x003e0000), /* POWER6 */ |
721 | W(0xffff0000), W(0x003f0000), /* POWER7 */ | 723 | W(0xffff0000), W(0x003f0000), /* POWER7 */ |
724 | W(0xffff0000), W(0x004b0000), /* POWER8 */ | ||
725 | W(0xffffffff), W(0x0f000004), /* all 2.07-compliant */ | ||
722 | W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */ | 726 | W(0xffffffff), W(0x0f000003), /* all 2.06-compliant */ |
723 | W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */ | 727 | W(0xffffffff), W(0x0f000002), /* all 2.05-compliant */ |
724 | W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */ | 728 | W(0xfffffffe), W(0x0f000001), /* all 2.04-compliant and earlier */ |
@@ -728,7 +732,7 @@ static unsigned char ibm_architecture_vec[] = { | |||
728 | 3 - 2, /* length */ | 732 | 3 - 2, /* length */ |
729 | 0, /* don't ignore, don't halt */ | 733 | 0, /* don't ignore, don't halt */ |
730 | OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 | | 734 | OV1_PPC_2_00 | OV1_PPC_2_01 | OV1_PPC_2_02 | OV1_PPC_2_03 | |
731 | OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06, | 735 | OV1_PPC_2_04 | OV1_PPC_2_05 | OV1_PPC_2_06 | OV1_PPC_2_07, |
732 | 736 | ||
733 | /* option vector 2: Open Firmware options supported */ | 737 | /* option vector 2: Open Firmware options supported */ |
734 | 34 - 2, /* length */ | 738 | 34 - 2, /* length */ |
@@ -755,7 +759,7 @@ static unsigned char ibm_architecture_vec[] = { | |||
755 | OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */ | 759 | OV4_MIN_ENT_CAP, /* minimum VP entitled capacity */ |
756 | 760 | ||
757 | /* option vector 5: PAPR/OF options */ | 761 | /* option vector 5: PAPR/OF options */ |
758 | 18 - 2, /* length */ | 762 | 19 - 2, /* length */ |
759 | 0, /* don't ignore, don't halt */ | 763 | 0, /* don't ignore, don't halt */ |
760 | OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY | | 764 | OV5_LPAR | OV5_SPLPAR | OV5_LARGE_PAGES | OV5_DRCONF_MEMORY | |
761 | OV5_DONATE_DEDICATE_CPU | OV5_MSI, | 765 | OV5_DONATE_DEDICATE_CPU | OV5_MSI, |
@@ -769,13 +773,14 @@ static unsigned char ibm_architecture_vec[] = { | |||
769 | * must match by the macro below. Update the definition if | 773 | * must match by the macro below. Update the definition if |
770 | * the structure layout changes. | 774 | * the structure layout changes. |
771 | */ | 775 | */ |
772 | #define IBM_ARCH_VEC_NRCORES_OFFSET 101 | 776 | #define IBM_ARCH_VEC_NRCORES_OFFSET 117 |
773 | W(NR_CPUS), /* number of cores supported */ | 777 | W(NR_CPUS), /* number of cores supported */ |
774 | 0, | 778 | 0, |
775 | 0, | 779 | 0, |
776 | 0, | 780 | 0, |
777 | 0, | 781 | 0, |
778 | OV5_PFO_HW_RNG | OV5_PFO_HW_ENCR | OV5_PFO_HW_842, | 782 | OV5_PFO_HW_RNG | OV5_PFO_HW_ENCR | OV5_PFO_HW_842, |
783 | OV5_SUB_PROCESSORS, | ||
779 | /* option vector 6: IBM PAPR hints */ | 784 | /* option vector 6: IBM PAPR hints */ |
780 | 4 - 2, /* length */ | 785 | 4 - 2, /* length */ |
781 | 0, | 786 | 0, |
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 79d8e56470df..c4970004d44d 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c | |||
@@ -952,6 +952,10 @@ int ptrace_set_debugreg(struct task_struct *task, unsigned long addr, | |||
952 | arch_bp_generic_fields(data & | 952 | arch_bp_generic_fields(data & |
953 | (DABR_DATA_WRITE | DABR_DATA_READ), | 953 | (DABR_DATA_WRITE | DABR_DATA_READ), |
954 | &attr.bp_type); | 954 | &attr.bp_type); |
955 | |||
956 | /* Enable breakpoint */ | ||
957 | attr.disabled = false; | ||
958 | |||
955 | ret = modify_user_hw_breakpoint(bp, &attr); | 959 | ret = modify_user_hw_breakpoint(bp, &attr); |
956 | if (ret) { | 960 | if (ret) { |
957 | ptrace_put_breakpoints(task); | 961 | ptrace_put_breakpoints(task); |
@@ -1037,7 +1041,7 @@ void ptrace_disable(struct task_struct *child) | |||
1037 | } | 1041 | } |
1038 | 1042 | ||
1039 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS | 1043 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS |
1040 | static long set_intruction_bp(struct task_struct *child, | 1044 | static long set_instruction_bp(struct task_struct *child, |
1041 | struct ppc_hw_breakpoint *bp_info) | 1045 | struct ppc_hw_breakpoint *bp_info) |
1042 | { | 1046 | { |
1043 | int slot; | 1047 | int slot; |
@@ -1338,6 +1342,12 @@ static int set_dac_range(struct task_struct *child, | |||
1338 | static long ppc_set_hwdebug(struct task_struct *child, | 1342 | static long ppc_set_hwdebug(struct task_struct *child, |
1339 | struct ppc_hw_breakpoint *bp_info) | 1343 | struct ppc_hw_breakpoint *bp_info) |
1340 | { | 1344 | { |
1345 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1346 | int len = 0; | ||
1347 | struct thread_struct *thread = &(child->thread); | ||
1348 | struct perf_event *bp; | ||
1349 | struct perf_event_attr attr; | ||
1350 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
1341 | #ifndef CONFIG_PPC_ADV_DEBUG_REGS | 1351 | #ifndef CONFIG_PPC_ADV_DEBUG_REGS |
1342 | unsigned long dabr; | 1352 | unsigned long dabr; |
1343 | #endif | 1353 | #endif |
@@ -1365,7 +1375,7 @@ static long ppc_set_hwdebug(struct task_struct *child, | |||
1365 | if ((bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_EXECUTE) || | 1375 | if ((bp_info->trigger_type != PPC_BREAKPOINT_TRIGGER_EXECUTE) || |
1366 | (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)) | 1376 | (bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE)) |
1367 | return -EINVAL; | 1377 | return -EINVAL; |
1368 | return set_intruction_bp(child, bp_info); | 1378 | return set_instruction_bp(child, bp_info); |
1369 | } | 1379 | } |
1370 | if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT) | 1380 | if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_EXACT) |
1371 | return set_dac(child, bp_info); | 1381 | return set_dac(child, bp_info); |
@@ -1381,13 +1391,9 @@ static long ppc_set_hwdebug(struct task_struct *child, | |||
1381 | */ | 1391 | */ |
1382 | if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 || | 1392 | if ((bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_RW) == 0 || |
1383 | (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 || | 1393 | (bp_info->trigger_type & ~PPC_BREAKPOINT_TRIGGER_RW) != 0 || |
1384 | bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT || | ||
1385 | bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE) | 1394 | bp_info->condition_mode != PPC_BREAKPOINT_CONDITION_NONE) |
1386 | return -EINVAL; | 1395 | return -EINVAL; |
1387 | 1396 | ||
1388 | if (child->thread.dabr) | ||
1389 | return -ENOSPC; | ||
1390 | |||
1391 | if ((unsigned long)bp_info->addr >= TASK_SIZE) | 1397 | if ((unsigned long)bp_info->addr >= TASK_SIZE) |
1392 | return -EIO; | 1398 | return -EIO; |
1393 | 1399 | ||
@@ -1397,6 +1403,50 @@ static long ppc_set_hwdebug(struct task_struct *child, | |||
1397 | dabr |= DABR_DATA_READ; | 1403 | dabr |= DABR_DATA_READ; |
1398 | if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE) | 1404 | if (bp_info->trigger_type & PPC_BREAKPOINT_TRIGGER_WRITE) |
1399 | dabr |= DABR_DATA_WRITE; | 1405 | dabr |= DABR_DATA_WRITE; |
1406 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1407 | if (ptrace_get_breakpoints(child) < 0) | ||
1408 | return -ESRCH; | ||
1409 | |||
1410 | /* | ||
1411 | * Check if the request is for 'range' breakpoints. We can | ||
1412 | * support it if range < 8 bytes. | ||
1413 | */ | ||
1414 | if (bp_info->addr_mode == PPC_BREAKPOINT_MODE_RANGE_INCLUSIVE) { | ||
1415 | len = bp_info->addr2 - bp_info->addr; | ||
1416 | } else if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) { | ||
1417 | ptrace_put_breakpoints(child); | ||
1418 | return -EINVAL; | ||
1419 | } | ||
1420 | bp = thread->ptrace_bps[0]; | ||
1421 | if (bp) { | ||
1422 | ptrace_put_breakpoints(child); | ||
1423 | return -ENOSPC; | ||
1424 | } | ||
1425 | |||
1426 | /* Create a new breakpoint request if one doesn't exist already */ | ||
1427 | hw_breakpoint_init(&attr); | ||
1428 | attr.bp_addr = (unsigned long)bp_info->addr & ~HW_BREAKPOINT_ALIGN; | ||
1429 | attr.bp_len = len; | ||
1430 | arch_bp_generic_fields(dabr & (DABR_DATA_WRITE | DABR_DATA_READ), | ||
1431 | &attr.bp_type); | ||
1432 | |||
1433 | thread->ptrace_bps[0] = bp = register_user_hw_breakpoint(&attr, | ||
1434 | ptrace_triggered, NULL, child); | ||
1435 | if (IS_ERR(bp)) { | ||
1436 | thread->ptrace_bps[0] = NULL; | ||
1437 | ptrace_put_breakpoints(child); | ||
1438 | return PTR_ERR(bp); | ||
1439 | } | ||
1440 | |||
1441 | ptrace_put_breakpoints(child); | ||
1442 | return 1; | ||
1443 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
1444 | |||
1445 | if (bp_info->addr_mode != PPC_BREAKPOINT_MODE_EXACT) | ||
1446 | return -EINVAL; | ||
1447 | |||
1448 | if (child->thread.dabr) | ||
1449 | return -ENOSPC; | ||
1400 | 1450 | ||
1401 | child->thread.dabr = dabr; | 1451 | child->thread.dabr = dabr; |
1402 | child->thread.dabrx = DABRX_ALL; | 1452 | child->thread.dabrx = DABRX_ALL; |
@@ -1405,8 +1455,13 @@ static long ppc_set_hwdebug(struct task_struct *child, | |||
1405 | #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */ | 1455 | #endif /* !CONFIG_PPC_ADV_DEBUG_DVCS */ |
1406 | } | 1456 | } |
1407 | 1457 | ||
1408 | static long ppc_del_hwdebug(struct task_struct *child, long addr, long data) | 1458 | static long ppc_del_hwdebug(struct task_struct *child, long data) |
1409 | { | 1459 | { |
1460 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1461 | int ret = 0; | ||
1462 | struct thread_struct *thread = &(child->thread); | ||
1463 | struct perf_event *bp; | ||
1464 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
1410 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS | 1465 | #ifdef CONFIG_PPC_ADV_DEBUG_REGS |
1411 | int rc; | 1466 | int rc; |
1412 | 1467 | ||
@@ -1426,10 +1481,25 @@ static long ppc_del_hwdebug(struct task_struct *child, long addr, long data) | |||
1426 | #else | 1481 | #else |
1427 | if (data != 1) | 1482 | if (data != 1) |
1428 | return -EINVAL; | 1483 | return -EINVAL; |
1484 | |||
1485 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1486 | if (ptrace_get_breakpoints(child) < 0) | ||
1487 | return -ESRCH; | ||
1488 | |||
1489 | bp = thread->ptrace_bps[0]; | ||
1490 | if (bp) { | ||
1491 | unregister_hw_breakpoint(bp); | ||
1492 | thread->ptrace_bps[0] = NULL; | ||
1493 | } else | ||
1494 | ret = -ENOENT; | ||
1495 | ptrace_put_breakpoints(child); | ||
1496 | return ret; | ||
1497 | #else /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
1429 | if (child->thread.dabr == 0) | 1498 | if (child->thread.dabr == 0) |
1430 | return -ENOENT; | 1499 | return -ENOENT; |
1431 | 1500 | ||
1432 | child->thread.dabr = 0; | 1501 | child->thread.dabr = 0; |
1502 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
1433 | 1503 | ||
1434 | return 0; | 1504 | return 0; |
1435 | #endif | 1505 | #endif |
@@ -1536,7 +1606,11 @@ long arch_ptrace(struct task_struct *child, long request, | |||
1536 | dbginfo.data_bp_alignment = 4; | 1606 | dbginfo.data_bp_alignment = 4; |
1537 | #endif | 1607 | #endif |
1538 | dbginfo.sizeof_condition = 0; | 1608 | dbginfo.sizeof_condition = 0; |
1609 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
1610 | dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE; | ||
1611 | #else | ||
1539 | dbginfo.features = 0; | 1612 | dbginfo.features = 0; |
1613 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
1540 | #endif /* CONFIG_PPC_ADV_DEBUG_REGS */ | 1614 | #endif /* CONFIG_PPC_ADV_DEBUG_REGS */ |
1541 | 1615 | ||
1542 | if (!access_ok(VERIFY_WRITE, datavp, | 1616 | if (!access_ok(VERIFY_WRITE, datavp, |
@@ -1563,7 +1637,7 @@ long arch_ptrace(struct task_struct *child, long request, | |||
1563 | } | 1637 | } |
1564 | 1638 | ||
1565 | case PPC_PTRACE_DELHWDEBUG: { | 1639 | case PPC_PTRACE_DELHWDEBUG: { |
1566 | ret = ppc_del_hwdebug(child, addr, data); | 1640 | ret = ppc_del_hwdebug(child, data); |
1567 | break; | 1641 | break; |
1568 | } | 1642 | } |
1569 | 1643 | ||
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index fcec38241f79..1fd6e7b2f390 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <asm/time.h> | 42 | #include <asm/time.h> |
43 | #include <asm/mmu.h> | 43 | #include <asm/mmu.h> |
44 | #include <asm/topology.h> | 44 | #include <asm/topology.h> |
45 | #include <asm/pSeries_reconfig.h> | ||
46 | 45 | ||
47 | struct rtas_t rtas = { | 46 | struct rtas_t rtas = { |
48 | .lock = __ARCH_SPIN_LOCK_UNLOCKED | 47 | .lock = __ARCH_SPIN_LOCK_UNLOCKED |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 20b0120db0c3..8329190312c1 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -650,10 +650,8 @@ static int initialize_flash_pde_data(const char *rtas_call_name, | |||
650 | int token; | 650 | int token; |
651 | 651 | ||
652 | dp->data = kzalloc(buf_size, GFP_KERNEL); | 652 | dp->data = kzalloc(buf_size, GFP_KERNEL); |
653 | if (dp->data == NULL) { | 653 | if (dp->data == NULL) |
654 | remove_flash_pde(dp); | ||
655 | return -ENOMEM; | 654 | return -ENOMEM; |
656 | } | ||
657 | 655 | ||
658 | /* | 656 | /* |
659 | * This code assumes that the status int is the first member of the | 657 | * This code assumes that the status int is the first member of the |
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index efb6a41b3131..6da881b35dac 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -601,6 +601,11 @@ void __init setup_arch(char **cmdline_p) | |||
601 | 601 | ||
602 | kvm_linear_init(); | 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 | ppc64_boot_msg(0x15, "Setup Done"); | 609 | ppc64_boot_msg(0x15, "Setup Done"); |
605 | } | 610 | } |
606 | 611 | ||
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c index c39c1ca77f46..f9748498fe58 100644 --- a/arch/powerpc/kernel/udbg.c +++ b/arch/powerpc/kernel/udbg.c | |||
@@ -122,29 +122,6 @@ int udbg_write(const char *s, int n) | |||
122 | return n - remain; | 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 | #define UDBG_BUFSIZE 256 | 125 | #define UDBG_BUFSIZE 256 |
149 | void udbg_printf(const char *fmt, ...) | 126 | void udbg_printf(const char *fmt, ...) |
150 | { | 127 | { |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 59213cfaeca9..bba87ca2b4d7 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -399,18 +399,6 @@ static unsigned long read_n_cells(int n, const unsigned int **buf) | |||
399 | return result; | 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 | * Read the next memblock list entry from the ibm,dynamic-memory property | 403 | * Read the next memblock list entry from the ibm,dynamic-memory property |
416 | * and return the information in the provided of_drconf_cell structure. | 404 | * and return the information in the provided of_drconf_cell structure. |
diff --git a/arch/powerpc/mm/tlb_nohash_low.S b/arch/powerpc/mm/tlb_nohash_low.S index fab919fd1384..626ad081639f 100644 --- a/arch/powerpc/mm/tlb_nohash_low.S +++ b/arch/powerpc/mm/tlb_nohash_low.S | |||
@@ -191,12 +191,6 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_TYPE_47x) | |||
191 | #ifdef CONFIG_PPC_47x | 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 | * _tlbivax_bcast is only on 47x. We don't bother doing a runtime | 194 | * _tlbivax_bcast is only on 47x. We don't bother doing a runtime |
201 | * check though, it will blow up soon enough if we mistakenly try | 195 | * check though, it will blow up soon enough if we mistakenly try |
202 | * to use it on a 440. | 196 | * to use it on a 440. |
@@ -208,8 +202,7 @@ _GLOBAL(_tlbivax_bcast) | |||
208 | wrteei 0 | 202 | wrteei 0 |
209 | mtspr SPRN_MMUCR,r5 | 203 | mtspr SPRN_MMUCR,r5 |
210 | isync | 204 | isync |
211 | /* tlbivax 0,r3 - use .long to avoid binutils deps */ | 205 | PPC_TLBIVAX(0, R3) |
212 | .long 0x7c000624 | (r3 << 11) | ||
213 | isync | 206 | isync |
214 | eieio | 207 | eieio |
215 | tlbsync | 208 | tlbsync |
@@ -227,11 +220,11 @@ END_FTR_SECTION_IFSET(CPU_FTR_476_DD2) | |||
227 | bl 2f | 220 | bl 2f |
228 | 2: mflr r6 | 221 | 2: mflr r6 |
229 | li r7,32 | 222 | li r7,32 |
230 | ICBT(0,r6,r7) /* touch next cache line */ | 223 | PPC_ICBT(0,R6,R7) /* touch next cache line */ |
231 | add r6,r6,r7 | 224 | add r6,r6,r7 |
232 | ICBT(0,r6,r7) /* touch next cache line */ | 225 | PPC_ICBT(0,R6,R7) /* touch next cache line */ |
233 | add r6,r6,r7 | 226 | add r6,r6,r7 |
234 | ICBT(0,r6,r7) /* touch next cache line */ | 227 | PPC_ICBT(0,R6,R7) /* touch next cache line */ |
235 | sync | 228 | sync |
236 | nop | 229 | nop |
237 | nop | 230 | nop |
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c index 441af08edf43..2ee01e38d5e2 100644 --- a/arch/powerpc/perf/power7-pmu.c +++ b/arch/powerpc/perf/power7-pmu.c | |||
@@ -54,8 +54,10 @@ | |||
54 | * Layout of constraint bits: | 54 | * Layout of constraint bits: |
55 | * 6666555555555544444444443333333333222222222211111111110000000000 | 55 | * 6666555555555544444444443333333333222222222211111111110000000000 |
56 | * 3210987654321098765432109876543210987654321098765432109876543210 | 56 | * 3210987654321098765432109876543210987654321098765432109876543210 |
57 | * [ ><><><><><><> | 57 | * < >< ><><><><><><> |
58 | * NC P6P5P4P3P2P1 | 58 | * L2 NC P6P5P4P3P2P1 |
59 | * | ||
60 | * L2 - 16-18 - Required L2SEL value (select field) | ||
59 | * | 61 | * |
60 | * NC - number of counters | 62 | * NC - number of counters |
61 | * 15: NC error 0x8000 | 63 | * 15: NC error 0x8000 |
@@ -72,7 +74,7 @@ | |||
72 | static int power7_get_constraint(u64 event, unsigned long *maskp, | 74 | static int power7_get_constraint(u64 event, unsigned long *maskp, |
73 | unsigned long *valp) | 75 | unsigned long *valp) |
74 | { | 76 | { |
75 | int pmc, sh; | 77 | int pmc, sh, unit; |
76 | unsigned long mask = 0, value = 0; | 78 | unsigned long mask = 0, value = 0; |
77 | 79 | ||
78 | pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; | 80 | pmc = (event >> PM_PMC_SH) & PM_PMC_MSK; |
@@ -90,6 +92,15 @@ static int power7_get_constraint(u64 event, unsigned long *maskp, | |||
90 | mask |= 0x8000; | 92 | mask |= 0x8000; |
91 | value |= 0x1000; | 93 | value |= 0x1000; |
92 | } | 94 | } |
95 | |||
96 | unit = (event >> PM_UNIT_SH) & PM_UNIT_MSK; | ||
97 | if (unit == 6) { | ||
98 | /* L2SEL must be identical across events */ | ||
99 | int l2sel = (event >> PM_L2SEL_SH) & PM_L2SEL_MSK; | ||
100 | mask |= 0x7 << 16; | ||
101 | value |= l2sel << 16; | ||
102 | } | ||
103 | |||
93 | *maskp = mask; | 104 | *maskp = mask; |
94 | *valp = value; | 105 | *valp = value; |
95 | return 0; | 106 | return 0; |
diff --git a/arch/powerpc/platforms/512x/Kconfig b/arch/powerpc/platforms/512x/Kconfig index b62508b113db..c16999802ecf 100644 --- a/arch/powerpc/platforms/512x/Kconfig +++ b/arch/powerpc/platforms/512x/Kconfig | |||
@@ -2,7 +2,6 @@ config PPC_MPC512x | |||
2 | bool "512x-based boards" | 2 | bool "512x-based boards" |
3 | depends on 6xx | 3 | depends on 6xx |
4 | select FSL_SOC | 4 | select FSL_SOC |
5 | select FB_FSL_DIU | ||
6 | select IPIC | 5 | select IPIC |
7 | select PPC_CLOCK | 6 | select PPC_CLOCK |
8 | select PPC_PCI_CHOICE | 7 | select PPC_PCI_CHOICE |
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads.c b/arch/powerpc/platforms/512x/mpc5121_ads.c index dcef6ade48e1..0a134e0469ef 100644 --- a/arch/powerpc/platforms/512x/mpc5121_ads.c +++ b/arch/powerpc/platforms/512x/mpc5121_ads.c | |||
@@ -42,7 +42,10 @@ static void __init mpc5121_ads_setup_arch(void) | |||
42 | for_each_compatible_node(np, "pci", "fsl,mpc5121-pci") | 42 | for_each_compatible_node(np, "pci", "fsl,mpc5121-pci") |
43 | mpc83xx_add_bridge(np); | 43 | mpc83xx_add_bridge(np); |
44 | #endif | 44 | #endif |
45 | |||
46 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
45 | mpc512x_setup_diu(); | 47 | mpc512x_setup_diu(); |
48 | #endif | ||
46 | } | 49 | } |
47 | 50 | ||
48 | static void __init mpc5121_ads_init_IRQ(void) | 51 | static void __init mpc5121_ads_init_IRQ(void) |
diff --git a/arch/powerpc/platforms/512x/mpc512x.h b/arch/powerpc/platforms/512x/mpc512x.h index 1ab6d11d0b19..c32b399eb952 100644 --- a/arch/powerpc/platforms/512x/mpc512x.h +++ b/arch/powerpc/platforms/512x/mpc512x.h | |||
@@ -16,6 +16,13 @@ extern void __init mpc512x_init(void); | |||
16 | extern int __init mpc5121_clk_init(void); | 16 | extern int __init mpc5121_clk_init(void); |
17 | void __init mpc512x_declare_of_platform_devices(void); | 17 | void __init mpc512x_declare_of_platform_devices(void); |
18 | extern void mpc512x_restart(char *cmd); | 18 | extern void mpc512x_restart(char *cmd); |
19 | extern void mpc512x_init_diu(void); | 19 | |
20 | extern void mpc512x_setup_diu(void); | 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 | #endif /* __MPC512X_H__ */ | 28 | #endif /* __MPC512X_H__ */ |
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index 1650e090ef3a..35f14fda108a 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c | |||
@@ -58,6 +58,8 @@ void mpc512x_restart(char *cmd) | |||
58 | ; | 58 | ; |
59 | } | 59 | } |
60 | 60 | ||
61 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
62 | |||
61 | struct fsl_diu_shared_fb { | 63 | struct fsl_diu_shared_fb { |
62 | u8 gamma[0x300]; /* 32-bit aligned! */ | 64 | u8 gamma[0x300]; /* 32-bit aligned! */ |
63 | struct diu_ad ad0; /* 32-bit aligned! */ | 65 | struct diu_ad ad0; /* 32-bit aligned! */ |
@@ -66,25 +68,6 @@ struct fsl_diu_shared_fb { | |||
66 | bool in_use; | 68 | bool in_use; |
67 | }; | 69 | }; |
68 | 70 | ||
69 | u32 mpc512x_get_pixel_format(enum fsl_diu_monitor_port port, | ||
70 | unsigned int bits_per_pixel) | ||
71 | { | ||
72 | switch (bits_per_pixel) { | ||
73 | case 32: | ||
74 | return 0x88883316; | ||
75 | case 24: | ||
76 | return 0x88082219; | ||
77 | case 16: | ||
78 | return 0x65053118; | ||
79 | } | ||
80 | return 0x00000400; | ||
81 | } | ||
82 | |||
83 | void mpc512x_set_gamma_table(enum fsl_diu_monitor_port port, | ||
84 | char *gamma_table_base) | ||
85 | { | ||
86 | } | ||
87 | |||
88 | void mpc512x_set_monitor_port(enum fsl_diu_monitor_port port) | 71 | void mpc512x_set_monitor_port(enum fsl_diu_monitor_port port) |
89 | { | 72 | { |
90 | } | 73 | } |
@@ -320,14 +303,14 @@ void __init mpc512x_setup_diu(void) | |||
320 | } | 303 | } |
321 | } | 304 | } |
322 | 305 | ||
323 | diu_ops.get_pixel_format = mpc512x_get_pixel_format; | ||
324 | diu_ops.set_gamma_table = mpc512x_set_gamma_table; | ||
325 | diu_ops.set_monitor_port = mpc512x_set_monitor_port; | 306 | diu_ops.set_monitor_port = mpc512x_set_monitor_port; |
326 | diu_ops.set_pixel_clock = mpc512x_set_pixel_clock; | 307 | diu_ops.set_pixel_clock = mpc512x_set_pixel_clock; |
327 | diu_ops.valid_monitor_port = mpc512x_valid_monitor_port; | 308 | diu_ops.valid_monitor_port = mpc512x_valid_monitor_port; |
328 | diu_ops.release_bootmem = mpc512x_release_bootmem; | 309 | diu_ops.release_bootmem = mpc512x_release_bootmem; |
329 | } | 310 | } |
330 | 311 | ||
312 | #endif | ||
313 | |||
331 | void __init mpc512x_init_IRQ(void) | 314 | void __init mpc512x_init_IRQ(void) |
332 | { | 315 | { |
333 | struct device_node *np; | 316 | struct device_node *np; |
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c index 448d862bcf3d..1843bc932011 100644 --- a/arch/powerpc/platforms/52xx/lite5200.c +++ b/arch/powerpc/platforms/52xx/lite5200.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Written by: Grant Likely <grant.likely@secretlab.ca> | 4 | * Written by: Grant Likely <grant.likely@secretlab.ca> |
5 | * | 5 | * |
6 | * Copyright (C) Secret Lab Technologies Ltd. 2006. All rights reserved. | 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 | * Description: | 9 | * Description: |
10 | * This program is free software; you can redistribute it and/or modify it | 10 | * This program is free software; you can redistribute it and/or modify it |
diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c index 9cf36020cf0d..792a301a0bf0 100644 --- a/arch/powerpc/platforms/52xx/mpc5200_simple.c +++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c | |||
@@ -50,6 +50,7 @@ static void __init mpc5200_simple_setup_arch(void) | |||
50 | 50 | ||
51 | /* list of the supported boards */ | 51 | /* list of the supported boards */ |
52 | static const char *board[] __initdata = { | 52 | static const char *board[] __initdata = { |
53 | "anonymous,a3m071", | ||
53 | "anonymous,a4m072", | 54 | "anonymous,a4m072", |
54 | "anon,charon", | 55 | "anon,charon", |
55 | "ifm,o2d", | 56 | "ifm,o2d", |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c index 2351f9e0fb6f..16150fa430f9 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_lpbfifo.c | |||
@@ -578,18 +578,4 @@ static struct platform_driver mpc52xx_lpbfifo_driver = { | |||
578 | .probe = mpc52xx_lpbfifo_probe, | 578 | .probe = mpc52xx_lpbfifo_probe, |
579 | .remove = __devexit_p(mpc52xx_lpbfifo_remove), | 579 | .remove = __devexit_p(mpc52xx_lpbfifo_remove), |
580 | }; | 580 | }; |
581 | 581 | module_platform_driver(mpc52xx_lpbfifo_driver); | |
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); | ||
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c index 328d221fd1c0..74861a7fb807 100644 --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/bootmem.h> | ||
20 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
21 | 20 | ||
22 | #include <asm/io.h> | 21 | #include <asm/io.h> |
@@ -149,7 +148,7 @@ int __init pq2ads_pci_init_irq(void) | |||
149 | priv->regs = of_iomap(np, 0); | 148 | priv->regs = of_iomap(np, 0); |
150 | if (!priv->regs) { | 149 | if (!priv->regs) { |
151 | printk(KERN_ERR "Cannot map PCI PIC registers.\n"); | 150 | printk(KERN_ERR "Cannot map PCI PIC registers.\n"); |
152 | goto out_free_bootmem; | 151 | goto out_free_kmalloc; |
153 | } | 152 | } |
154 | 153 | ||
155 | /* mask all PCI interrupts */ | 154 | /* mask all PCI interrupts */ |
@@ -171,9 +170,8 @@ int __init pq2ads_pci_init_irq(void) | |||
171 | 170 | ||
172 | out_unmap_regs: | 171 | out_unmap_regs: |
173 | iounmap(priv->regs); | 172 | iounmap(priv->regs); |
174 | out_free_bootmem: | 173 | out_free_kmalloc: |
175 | free_bootmem((unsigned long)priv, | 174 | kfree(priv); |
176 | sizeof(struct pq2ads_pci_pic)); | ||
177 | of_node_put(np); | 175 | of_node_put(np); |
178 | out_unmap_irq: | 176 | out_unmap_irq: |
179 | irq_dispose_mapping(irq); | 177 | irq_dispose_mapping(irq); |
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c index d440435e055c..8d762203eeff 100644 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. | 2 | * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. |
3 | * | 3 | * |
4 | * Description: | 4 | * Description: |
5 | * MPC832xE MDS board specific routines. | 5 | * MPC832xE MDS board specific routines. |
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c index 1b1f6c8a1a12..1a26d2f83401 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) Freescale Semicondutor, Inc. 2006. All rights reserved. | 2 | * Copyright 2006 Freescale Semiconductor, Inc. All rights reserved. |
3 | * | 3 | * |
4 | * Author: Li Yang <LeoLi@freescale.com> | 4 | * Author: Li Yang <LeoLi@freescale.com> |
5 | * Yin Olivia <Hong-hua.Yin@freescale.com> | 5 | * Yin Olivia <Hong-hua.Yin@freescale.com> |
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c index f8769d713d61..b63b42d11d6c 100644 --- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c +++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * MPC8360E-RDK board file. | 2 | * MPC8360E-RDK board file. |
3 | * | 3 | * |
4 | * Copyright (c) 2006 Freescale Semicondutor, Inc. | 4 | * Copyright (c) 2006 Freescale Semiconductor, Inc. |
5 | * Copyright (c) 2007-2008 MontaVista Software, Inc. | 5 | * Copyright (c) 2007-2008 MontaVista Software, Inc. |
6 | * | 6 | * |
7 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> | 7 | * Author: Anton Vorontsov <avorontsov@ru.mvista.com> |
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c index eca1f0960fff..9813c81e8e5b 100644 --- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c +++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/powerpc/platforms/83xx/mpc837x_rdb.c | 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 | * MPC837x RDB board specific routines | 6 | * MPC837x RDB board specific routines |
7 | * | 7 | * |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 8498f7323470..bd12588fa252 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2006-2010, 2012 Freescale Semicondutor, Inc. | 2 | * Copyright (C) 2006-2010, 2012 Freescale Semiconductor, Inc. |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
5 | * Author: Andy Fleming <afleming@freescale.com> | 5 | * Author: Andy Fleming <afleming@freescale.com> |
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 848a3e98e1c1..7328b8d74129 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -249,7 +249,7 @@ static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port) | |||
249 | goto exit; | 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 | if (!iprop) { | 253 | if (!iprop) { |
254 | pr_err("p1022ds: LAW node is missing fsl,num-laws property\n"); | 254 | pr_err("p1022ds: LAW node is missing fsl,num-laws property\n"); |
255 | goto exit; | 255 | goto exit; |
@@ -539,7 +539,7 @@ static void __init p1022_ds_setup_arch(void) | |||
539 | }; | 539 | }; |
540 | 540 | ||
541 | /* | 541 | /* |
542 | * prom_update_property() is called before | 542 | * of_update_property() is called before |
543 | * kmalloc() is available, so the 'new' object | 543 | * kmalloc() is available, so the 'new' object |
544 | * should be allocated in the global area. | 544 | * should be allocated in the global area. |
545 | * The easiest way is to do that is to | 545 | * The easiest way is to do that is to |
@@ -548,7 +548,7 @@ static void __init p1022_ds_setup_arch(void) | |||
548 | */ | 548 | */ |
549 | pr_info("p1022ds: disabling %s node", | 549 | pr_info("p1022ds: disabling %s node", |
550 | np2->full_name); | 550 | np2->full_name); |
551 | prom_update_property(np2, &nor_status); | 551 | of_update_property(np2, &nor_status); |
552 | of_node_put(np2); | 552 | of_node_put(np2); |
553 | } | 553 | } |
554 | 554 | ||
@@ -564,7 +564,7 @@ static void __init p1022_ds_setup_arch(void) | |||
564 | 564 | ||
565 | pr_info("p1022ds: disabling %s node", | 565 | pr_info("p1022ds: disabling %s node", |
566 | np2->full_name); | 566 | np2->full_name); |
567 | prom_update_property(np2, &nand_status); | 567 | of_update_property(np2, &nand_status); |
568 | of_node_put(np2); | 568 | of_node_put(np2); |
569 | } | 569 | } |
570 | 570 | ||
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 6fcfa12e5c56..148c2f2d9780 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c | |||
@@ -128,6 +128,19 @@ static void __cpuinit smp_85xx_mach_cpu_die(void) | |||
128 | } | 128 | } |
129 | #endif | 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 | static int __cpuinit smp_85xx_kick_cpu(int nr) | 144 | static int __cpuinit smp_85xx_kick_cpu(int nr) |
132 | { | 145 | { |
133 | unsigned long flags; | 146 | unsigned long flags; |
@@ -161,8 +174,8 @@ static int __cpuinit smp_85xx_kick_cpu(int nr) | |||
161 | 174 | ||
162 | /* Map the spin table */ | 175 | /* Map the spin table */ |
163 | if (ioremappable) | 176 | if (ioremappable) |
164 | spin_table = ioremap(*cpu_rel_addr, | 177 | spin_table = ioremap_prot(*cpu_rel_addr, |
165 | sizeof(struct epapr_spin_table)); | 178 | sizeof(struct epapr_spin_table), _PAGE_COHERENT); |
166 | else | 179 | else |
167 | spin_table = phys_to_virt(*cpu_rel_addr); | 180 | spin_table = phys_to_virt(*cpu_rel_addr); |
168 | 181 | ||
@@ -173,7 +186,16 @@ static int __cpuinit smp_85xx_kick_cpu(int nr) | |||
173 | generic_set_cpu_up(nr); | 186 | generic_set_cpu_up(nr); |
174 | 187 | ||
175 | if (system_state == SYSTEM_RUNNING) { | 188 | if (system_state == SYSTEM_RUNNING) { |
189 | /* | ||
190 | * To keep it compatible with old boot program which uses | ||
191 | * cache-inhibit spin table, we need to flush the cache | ||
192 | * before accessing spin table to invalidate any staled data. | ||
193 | * We also need to flush the cache after writing to spin | ||
194 | * table to push data out. | ||
195 | */ | ||
196 | flush_spin_table(spin_table); | ||
176 | out_be32(&spin_table->addr_l, 0); | 197 | out_be32(&spin_table->addr_l, 0); |
198 | flush_spin_table(spin_table); | ||
177 | 199 | ||
178 | /* | 200 | /* |
179 | * We don't set the BPTR register here since it already points | 201 | * We don't set the BPTR register here since it already points |
@@ -181,9 +203,14 @@ static int __cpuinit smp_85xx_kick_cpu(int nr) | |||
181 | */ | 203 | */ |
182 | mpic_reset_core(hw_cpu); | 204 | mpic_reset_core(hw_cpu); |
183 | 205 | ||
184 | /* wait until core is ready... */ | 206 | /* |
185 | if (!spin_event_timeout(in_be32(&spin_table->addr_l) == 1, | 207 | * wait until core is ready... |
186 | 10000, 100)) { | 208 | * We need to invalidate the stale data, in case the boot |
209 | * loader uses a cache-inhibited spin table. | ||
210 | */ | ||
211 | if (!spin_event_timeout( | ||
212 | read_spin_table_addr_l(spin_table) == 1, | ||
213 | 10000, 100)) { | ||
187 | pr_err("%s: timeout waiting for core %d to reset\n", | 214 | pr_err("%s: timeout waiting for core %d to reset\n", |
188 | __func__, hw_cpu); | 215 | __func__, hw_cpu); |
189 | ret = -ENOENT; | 216 | ret = -ENOENT; |
@@ -194,12 +221,10 @@ static int __cpuinit smp_85xx_kick_cpu(int nr) | |||
194 | __secondary_hold_acknowledge = -1; | 221 | __secondary_hold_acknowledge = -1; |
195 | } | 222 | } |
196 | #endif | 223 | #endif |
224 | flush_spin_table(spin_table); | ||
197 | out_be32(&spin_table->pir, hw_cpu); | 225 | out_be32(&spin_table->pir, hw_cpu); |
198 | out_be32(&spin_table->addr_l, __pa(__early_start)); | 226 | out_be32(&spin_table->addr_l, __pa(__early_start)); |
199 | 227 | flush_spin_table(spin_table); | |
200 | if (!ioremappable) | ||
201 | flush_dcache_range((ulong)spin_table, | ||
202 | (ulong)spin_table + sizeof(struct epapr_spin_table)); | ||
203 | 228 | ||
204 | /* Wait a bit for the CPU to ack. */ | 229 | /* Wait a bit for the CPU to ack. */ |
205 | if (!spin_event_timeout(__secondary_hold_acknowledge == hw_cpu, | 230 | if (!spin_event_timeout(__secondary_hold_acknowledge == hw_cpu, |
@@ -213,13 +238,11 @@ out: | |||
213 | #else | 238 | #else |
214 | smp_generic_kick_cpu(nr); | 239 | smp_generic_kick_cpu(nr); |
215 | 240 | ||
241 | flush_spin_table(spin_table); | ||
216 | out_be32(&spin_table->pir, hw_cpu); | 242 | out_be32(&spin_table->pir, hw_cpu); |
217 | out_be64((u64 *)(&spin_table->addr_h), | 243 | out_be64((u64 *)(&spin_table->addr_h), |
218 | __pa((u64)*((unsigned long long *)generic_secondary_smp_init))); | 244 | __pa((u64)*((unsigned long long *)generic_secondary_smp_init))); |
219 | 245 | flush_spin_table(spin_table); | |
220 | if (!ioremappable) | ||
221 | flush_dcache_range((ulong)spin_table, | ||
222 | (ulong)spin_table + sizeof(struct epapr_spin_table)); | ||
223 | #endif | 246 | #endif |
224 | 247 | ||
225 | local_irq_restore(flags); | 248 | local_irq_restore(flags); |
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index a817398a56da..04d9d317f741 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c | |||
@@ -353,5 +353,7 @@ define_machine(mpc86xx_hpcd) { | |||
353 | .time_init = mpc86xx_time_init, | 353 | .time_init = mpc86xx_time_init, |
354 | .calibrate_decr = generic_calibrate_decr, | 354 | .calibrate_decr = generic_calibrate_decr, |
355 | .progress = udbg_progress, | 355 | .progress = udbg_progress, |
356 | #ifdef CONFIG_PCI | ||
356 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, | 357 | .pcibios_fixup_bus = fsl_pcibios_fixup_bus, |
358 | #endif | ||
357 | }; | 359 | }; |
diff --git a/arch/powerpc/platforms/powermac/cpufreq_32.c b/arch/powerpc/platforms/powermac/cpufreq_32.c index 64171198535c..311b804353b1 100644 --- a/arch/powerpc/platforms/powermac/cpufreq_32.c +++ b/arch/powerpc/platforms/powermac/cpufreq_32.c | |||
@@ -55,6 +55,7 @@ static unsigned int low_freq; | |||
55 | static unsigned int hi_freq; | 55 | static unsigned int hi_freq; |
56 | static unsigned int cur_freq; | 56 | static unsigned int cur_freq; |
57 | static unsigned int sleep_freq; | 57 | static unsigned int sleep_freq; |
58 | static unsigned long transition_latency; | ||
58 | 59 | ||
59 | /* | 60 | /* |
60 | * Different models uses different mechanisms to switch the frequency | 61 | * Different models uses different mechanisms to switch the frequency |
@@ -403,7 +404,7 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
403 | if (policy->cpu != 0) | 404 | if (policy->cpu != 0) |
404 | return -ENODEV; | 405 | return -ENODEV; |
405 | 406 | ||
406 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | 407 | policy->cpuinfo.transition_latency = transition_latency; |
407 | policy->cur = cur_freq; | 408 | policy->cur = cur_freq; |
408 | 409 | ||
409 | cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); | 410 | cpufreq_frequency_table_get_attr(pmac_cpu_freqs, policy->cpu); |
@@ -658,12 +659,14 @@ static int __init pmac_cpufreq_setup(void) | |||
658 | if (!value) | 659 | if (!value) |
659 | goto out; | 660 | goto out; |
660 | cur_freq = (*value) / 1000; | 661 | cur_freq = (*value) / 1000; |
662 | transition_latency = CPUFREQ_ETERNAL; | ||
661 | 663 | ||
662 | /* Check for 7447A based MacRISC3 */ | 664 | /* Check for 7447A based MacRISC3 */ |
663 | if (of_machine_is_compatible("MacRISC3") && | 665 | if (of_machine_is_compatible("MacRISC3") && |
664 | of_get_property(cpunode, "dynamic-power-step", NULL) && | 666 | of_get_property(cpunode, "dynamic-power-step", NULL) && |
665 | PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { | 667 | PVR_VER(mfspr(SPRN_PVR)) == 0x8003) { |
666 | pmac_cpufreq_init_7447A(cpunode); | 668 | pmac_cpufreq_init_7447A(cpunode); |
669 | transition_latency = 8000000; | ||
667 | /* Check for other MacRISC3 machines */ | 670 | /* Check for other MacRISC3 machines */ |
668 | } else if (of_machine_is_compatible("PowerBook3,4") || | 671 | } else if (of_machine_is_compatible("PowerBook3,4") || |
669 | of_machine_is_compatible("PowerBook3,5") || | 672 | of_machine_is_compatible("PowerBook3,5") || |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 471aa3ccd9fd..53d052e95cfc 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -34,24 +34,12 @@ | |||
34 | #include "powernv.h" | 34 | #include "powernv.h" |
35 | #include "pci.h" | 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 | #define define_pe_printk_level(func, kern_level) \ | 37 | #define define_pe_printk_level(func, kern_level) \ |
51 | static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ | 38 | static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ |
52 | { \ | 39 | { \ |
53 | struct va_format vaf; \ | 40 | struct va_format vaf; \ |
54 | va_list args; \ | 41 | va_list args; \ |
42 | char pfix[32]; \ | ||
55 | int r; \ | 43 | int r; \ |
56 | \ | 44 | \ |
57 | va_start(args, fmt); \ | 45 | va_start(args, fmt); \ |
@@ -59,7 +47,16 @@ static int func(const struct pnv_ioda_pe *pe, const char *fmt, ...) \ | |||
59 | vaf.fmt = fmt; \ | 47 | vaf.fmt = fmt; \ |
60 | vaf.va = &args; \ | 48 | vaf.va = &args; \ |
61 | \ | 49 | \ |
62 | r = __pe_printk(kern_level, pe, &vaf); \ | 50 | if (pe->pdev) \ |
51 | strlcpy(pfix, dev_name(&pe->pdev->dev), \ | ||
52 | sizeof(pfix)); \ | ||
53 | else \ | ||
54 | sprintf(pfix, "%04x:%02x ", \ | ||
55 | pci_domain_nr(pe->pbus), \ | ||
56 | pe->pbus->number); \ | ||
57 | r = printk(kern_level "pci %s: [PE# %.3d] %pV", \ | ||
58 | pfix, pe->pe_number, &vaf); \ | ||
59 | \ | ||
63 | va_end(args); \ | 60 | va_end(args); \ |
64 | \ | 61 | \ |
65 | return r; \ | 62 | return r; \ |
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c index 56d26bc4fd41..09787139834d 100644 --- a/arch/powerpc/platforms/ps3/os-area.c +++ b/arch/powerpc/platforms/ps3/os-area.c | |||
@@ -280,13 +280,13 @@ static void os_area_set_property(struct device_node *node, | |||
280 | 280 | ||
281 | if (tmp) { | 281 | if (tmp) { |
282 | pr_debug("%s:%d found %s\n", __func__, __LINE__, prop->name); | 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 | if (result) | 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 | __LINE__); | 290 | __LINE__); |
291 | } | 291 | } |
292 | 292 | ||
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 0f1b706506ed..a1a7b9a67ffd 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -13,17 +13,16 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/kref.h> | 14 | #include <linux/kref.h> |
15 | #include <linux/notifier.h> | 15 | #include <linux/notifier.h> |
16 | #include <linux/proc_fs.h> | ||
17 | #include <linux/spinlock.h> | 16 | #include <linux/spinlock.h> |
18 | #include <linux/cpu.h> | 17 | #include <linux/cpu.h> |
19 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/of.h> | ||
20 | #include "offline_states.h" | 20 | #include "offline_states.h" |
21 | 21 | ||
22 | #include <asm/prom.h> | 22 | #include <asm/prom.h> |
23 | #include <asm/machdep.h> | 23 | #include <asm/machdep.h> |
24 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
25 | #include <asm/rtas.h> | 25 | #include <asm/rtas.h> |
26 | #include <asm/pSeries_reconfig.h> | ||
27 | 26 | ||
28 | struct cc_workarea { | 27 | struct cc_workarea { |
29 | u32 drc_index; | 28 | u32 drc_index; |
@@ -255,9 +254,6 @@ static struct device_node *derive_parent(const char *path) | |||
255 | 254 | ||
256 | int dlpar_attach_node(struct device_node *dn) | 255 | int dlpar_attach_node(struct device_node *dn) |
257 | { | 256 | { |
258 | #ifdef CONFIG_PROC_DEVICETREE | ||
259 | struct proc_dir_entry *ent; | ||
260 | #endif | ||
261 | int rc; | 257 | int rc; |
262 | 258 | ||
263 | of_node_set_flag(dn, OF_DYNAMIC); | 259 | of_node_set_flag(dn, OF_DYNAMIC); |
@@ -266,44 +262,26 @@ int dlpar_attach_node(struct device_node *dn) | |||
266 | if (!dn->parent) | 262 | if (!dn->parent) |
267 | return -ENOMEM; | 263 | return -ENOMEM; |
268 | 264 | ||
269 | rc = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, dn); | 265 | rc = of_attach_node(dn); |
270 | if (rc) { | 266 | if (rc) { |
271 | printk(KERN_ERR "Failed to add device node %s\n", | 267 | printk(KERN_ERR "Failed to add device node %s\n", |
272 | dn->full_name); | 268 | dn->full_name); |
273 | return rc; | 269 | return rc; |
274 | } | 270 | } |
275 | 271 | ||
276 | of_attach_node(dn); | ||
277 | |||
278 | #ifdef CONFIG_PROC_DEVICETREE | ||
279 | ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); | ||
280 | if (ent) | ||
281 | proc_device_tree_add_node(dn, ent); | ||
282 | #endif | ||
283 | |||
284 | of_node_put(dn->parent); | 272 | of_node_put(dn->parent); |
285 | return 0; | 273 | return 0; |
286 | } | 274 | } |
287 | 275 | ||
288 | int dlpar_detach_node(struct device_node *dn) | 276 | int dlpar_detach_node(struct device_node *dn) |
289 | { | 277 | { |
290 | #ifdef CONFIG_PROC_DEVICETREE | 278 | int rc; |
291 | struct device_node *parent = dn->parent; | ||
292 | struct property *prop = dn->properties; | ||
293 | |||
294 | while (prop) { | ||
295 | remove_proc_entry(prop->name, dn->pde); | ||
296 | prop = prop->next; | ||
297 | } | ||
298 | 279 | ||
299 | if (dn->pde) | 280 | rc = of_detach_node(dn); |
300 | remove_proc_entry(dn->pde->name, parent->pde); | 281 | if (rc) |
301 | #endif | 282 | return rc; |
302 | 283 | ||
303 | pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, dn); | ||
304 | of_detach_node(dn); | ||
305 | of_node_put(dn); /* Must decrement the refcount */ | 284 | of_node_put(dn); /* Must decrement the refcount */ |
306 | |||
307 | return 0; | 285 | return 0; |
308 | } | 286 | } |
309 | 287 | ||
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c index 0b0eff0cce35..7b56118f531c 100644 --- a/arch/powerpc/platforms/pseries/firmware.c +++ b/arch/powerpc/platforms/pseries/firmware.c | |||
@@ -56,6 +56,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = { | |||
56 | {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, | 56 | {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, |
57 | {FW_FEATURE_SPLPAR, "hcall-splpar"}, | 57 | {FW_FEATURE_SPLPAR, "hcall-splpar"}, |
58 | {FW_FEATURE_VPHN, "hcall-vphn"}, | 58 | {FW_FEATURE_VPHN, "hcall-vphn"}, |
59 | {FW_FEATURE_SET_MODE, "hcall-set-mode"}, | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | /* Build up the firmware features bitmask using the contents of | 62 | /* Build up the firmware features bitmask using the contents of |
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 64c97d8ac0c5..a38956269fbf 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -23,12 +23,12 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/sched.h> /* for idle_task_exit */ | 24 | #include <linux/sched.h> /* for idle_task_exit */ |
25 | #include <linux/cpu.h> | 25 | #include <linux/cpu.h> |
26 | #include <linux/of.h> | ||
26 | #include <asm/prom.h> | 27 | #include <asm/prom.h> |
27 | #include <asm/rtas.h> | 28 | #include <asm/rtas.h> |
28 | #include <asm/firmware.h> | 29 | #include <asm/firmware.h> |
29 | #include <asm/machdep.h> | 30 | #include <asm/machdep.h> |
30 | #include <asm/vdso_datapage.h> | 31 | #include <asm/vdso_datapage.h> |
31 | #include <asm/pSeries_reconfig.h> | ||
32 | #include <asm/xics.h> | 32 | #include <asm/xics.h> |
33 | #include "plpar_wrappers.h" | 33 | #include "plpar_wrappers.h" |
34 | #include "offline_states.h" | 34 | #include "offline_states.h" |
@@ -333,10 +333,10 @@ static int pseries_smp_notifier(struct notifier_block *nb, | |||
333 | int err = 0; | 333 | int err = 0; |
334 | 334 | ||
335 | switch (action) { | 335 | switch (action) { |
336 | case PSERIES_RECONFIG_ADD: | 336 | case OF_RECONFIG_ATTACH_NODE: |
337 | err = pseries_add_processor(node); | 337 | err = pseries_add_processor(node); |
338 | break; | 338 | break; |
339 | case PSERIES_RECONFIG_REMOVE: | 339 | case OF_RECONFIG_DETACH_NODE: |
340 | pseries_remove_processor(node); | 340 | pseries_remove_processor(node); |
341 | break; | 341 | break; |
342 | } | 342 | } |
@@ -399,7 +399,7 @@ static int __init pseries_cpu_hotplug_init(void) | |||
399 | 399 | ||
400 | /* Processors can be added/removed only on LPAR */ | 400 | /* Processors can be added/removed only on LPAR */ |
401 | if (firmware_has_feature(FW_FEATURE_LPAR)) { | 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 | cpu_maps_update_begin(); | 403 | cpu_maps_update_begin(); |
404 | if (cede_offline_enabled && parse_cede_parameters() == 0) { | 404 | if (cede_offline_enabled && parse_cede_parameters() == 0) { |
405 | default_offline_state = CPU_STATE_INACTIVE; | 405 | default_offline_state = CPU_STATE_INACTIVE; |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index ecdb0a6b3171..2372c609fa2b 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #include <asm/firmware.h> | 17 | #include <asm/firmware.h> |
18 | #include <asm/machdep.h> | 18 | #include <asm/machdep.h> |
19 | #include <asm/pSeries_reconfig.h> | ||
20 | #include <asm/sparsemem.h> | 19 | #include <asm/sparsemem.h> |
21 | 20 | ||
22 | static unsigned long get_memblock_size(void) | 21 | static unsigned long get_memblock_size(void) |
@@ -187,42 +186,69 @@ static int pseries_add_memory(struct device_node *np) | |||
187 | return (ret < 0) ? -EINVAL : 0; | 186 | return (ret < 0) ? -EINVAL : 0; |
188 | } | 187 | } |
189 | 188 | ||
190 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) | 189 | static int pseries_update_drconf_memory(struct of_prop_reconfig *pr) |
191 | { | 190 | { |
191 | struct of_drconf_cell *new_drmem, *old_drmem; | ||
192 | unsigned long memblock_size; | 192 | unsigned long memblock_size; |
193 | int rc; | 193 | u32 entries; |
194 | u32 *p; | ||
195 | int i, rc = -EINVAL; | ||
194 | 196 | ||
195 | memblock_size = get_memblock_size(); | 197 | memblock_size = get_memblock_size(); |
196 | if (!memblock_size) | 198 | if (!memblock_size) |
197 | return -EINVAL; | 199 | return -EINVAL; |
198 | 200 | ||
199 | if (action == PSERIES_DRCONF_MEM_ADD) { | 201 | p = (u32 *)of_get_property(pr->dn, "ibm,dynamic-memory", NULL); |
200 | rc = memblock_add(*base, memblock_size); | 202 | if (!p) |
201 | rc = (rc < 0) ? -EINVAL : 0; | 203 | return -EINVAL; |
202 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { | 204 | |
203 | rc = pseries_remove_memblock(*base, memblock_size); | 205 | /* The first int of the property is the number of lmb's described |
204 | } else { | 206 | * by the property. This is followed by an array of of_drconf_cell |
205 | rc = -EINVAL; | 207 | * entries. Get the niumber of entries and skip to the array of |
208 | * of_drconf_cell's. | ||
209 | */ | ||
210 | entries = *p++; | ||
211 | old_drmem = (struct of_drconf_cell *)p; | ||
212 | |||
213 | p = (u32 *)pr->prop->value; | ||
214 | p++; | ||
215 | new_drmem = (struct of_drconf_cell *)p; | ||
216 | |||
217 | for (i = 0; i < entries; i++) { | ||
218 | if ((old_drmem[i].flags & DRCONF_MEM_ASSIGNED) && | ||
219 | (!(new_drmem[i].flags & DRCONF_MEM_ASSIGNED))) { | ||
220 | rc = pseries_remove_memblock(old_drmem[i].base_addr, | ||
221 | memblock_size); | ||
222 | break; | ||
223 | } else if ((!(old_drmem[i].flags & DRCONF_MEM_ASSIGNED)) && | ||
224 | (new_drmem[i].flags & DRCONF_MEM_ASSIGNED)) { | ||
225 | rc = memblock_add(old_drmem[i].base_addr, | ||
226 | memblock_size); | ||
227 | rc = (rc < 0) ? -EINVAL : 0; | ||
228 | break; | ||
229 | } | ||
206 | } | 230 | } |
207 | 231 | ||
208 | return rc; | 232 | return rc; |
209 | } | 233 | } |
210 | 234 | ||
211 | static int pseries_memory_notifier(struct notifier_block *nb, | 235 | static int pseries_memory_notifier(struct notifier_block *nb, |
212 | unsigned long action, void *node) | 236 | unsigned long action, void *node) |
213 | { | 237 | { |
238 | struct of_prop_reconfig *pr; | ||
214 | int err = 0; | 239 | int err = 0; |
215 | 240 | ||
216 | switch (action) { | 241 | switch (action) { |
217 | case PSERIES_RECONFIG_ADD: | 242 | case OF_RECONFIG_ATTACH_NODE: |
218 | err = pseries_add_memory(node); | 243 | err = pseries_add_memory(node); |
219 | break; | 244 | break; |
220 | case PSERIES_RECONFIG_REMOVE: | 245 | case OF_RECONFIG_DETACH_NODE: |
221 | err = pseries_remove_memory(node); | 246 | err = pseries_remove_memory(node); |
222 | break; | 247 | break; |
223 | case PSERIES_DRCONF_MEM_ADD: | 248 | case OF_RECONFIG_UPDATE_PROPERTY: |
224 | case PSERIES_DRCONF_MEM_REMOVE: | 249 | pr = (struct of_prop_reconfig *)node; |
225 | err = pseries_drconf_memory(node, action); | 250 | if (!strcmp(pr->prop->name, "ibm,dynamic-memory")) |
251 | err = pseries_update_drconf_memory(pr); | ||
226 | break; | 252 | break; |
227 | } | 253 | } |
228 | return notifier_from_errno(err); | 254 | return notifier_from_errno(err); |
@@ -235,7 +261,7 @@ static struct notifier_block pseries_mem_nb = { | |||
235 | static int __init pseries_memory_hotplug_init(void) | 261 | static int __init pseries_memory_hotplug_init(void) |
236 | { | 262 | { |
237 | if (firmware_has_feature(FW_FEATURE_LPAR)) | 263 | if (firmware_has_feature(FW_FEATURE_LPAR)) |
238 | pSeries_reconfig_notifier_register(&pseries_mem_nb); | 264 | of_reconfig_notifier_register(&pseries_mem_nb); |
239 | 265 | ||
240 | return 0; | 266 | return 0; |
241 | } | 267 | } |
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index 6153eea27ce7..e2685badb5db 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -36,13 +36,13 @@ | |||
36 | #include <linux/dma-mapping.h> | 36 | #include <linux/dma-mapping.h> |
37 | #include <linux/crash_dump.h> | 37 | #include <linux/crash_dump.h> |
38 | #include <linux/memory.h> | 38 | #include <linux/memory.h> |
39 | #include <linux/of.h> | ||
39 | #include <asm/io.h> | 40 | #include <asm/io.h> |
40 | #include <asm/prom.h> | 41 | #include <asm/prom.h> |
41 | #include <asm/rtas.h> | 42 | #include <asm/rtas.h> |
42 | #include <asm/iommu.h> | 43 | #include <asm/iommu.h> |
43 | #include <asm/pci-bridge.h> | 44 | #include <asm/pci-bridge.h> |
44 | #include <asm/machdep.h> | 45 | #include <asm/machdep.h> |
45 | #include <asm/pSeries_reconfig.h> | ||
46 | #include <asm/firmware.h> | 46 | #include <asm/firmware.h> |
47 | #include <asm/tce.h> | 47 | #include <asm/tce.h> |
48 | #include <asm/ppc-pci.h> | 48 | #include <asm/ppc-pci.h> |
@@ -760,7 +760,7 @@ static void remove_ddw(struct device_node *np) | |||
760 | __remove_ddw(np, ddw_avail, liobn); | 760 | __remove_ddw(np, ddw_avail, liobn); |
761 | 761 | ||
762 | delprop: | 762 | delprop: |
763 | ret = prom_remove_property(np, win64); | 763 | ret = of_remove_property(np, win64); |
764 | if (ret) | 764 | if (ret) |
765 | pr_warning("%s: failed to remove direct window property: %d\n", | 765 | pr_warning("%s: failed to remove direct window property: %d\n", |
766 | np->full_name, ret); | 766 | np->full_name, ret); |
@@ -1070,7 +1070,7 @@ static u64 enable_ddw(struct pci_dev *dev, struct device_node *pdn) | |||
1070 | goto out_free_window; | 1070 | goto out_free_window; |
1071 | } | 1071 | } |
1072 | 1072 | ||
1073 | ret = prom_add_property(pdn, win64); | 1073 | ret = of_add_property(pdn, win64); |
1074 | if (ret) { | 1074 | if (ret) { |
1075 | dev_err(&dev->dev, "unable to add dma window property for %s: %d", | 1075 | dev_err(&dev->dev, "unable to add dma window property for %s: %d", |
1076 | pdn->full_name, ret); | 1076 | pdn->full_name, ret); |
@@ -1294,7 +1294,7 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti | |||
1294 | struct direct_window *window; | 1294 | struct direct_window *window; |
1295 | 1295 | ||
1296 | switch (action) { | 1296 | switch (action) { |
1297 | case PSERIES_RECONFIG_REMOVE: | 1297 | case OF_RECONFIG_DETACH_NODE: |
1298 | if (pci && pci->iommu_table) | 1298 | if (pci && pci->iommu_table) |
1299 | iommu_free_table(pci->iommu_table, np->full_name); | 1299 | iommu_free_table(pci->iommu_table, np->full_name); |
1300 | 1300 | ||
@@ -1357,7 +1357,7 @@ void iommu_init_early_pSeries(void) | |||
1357 | } | 1357 | } |
1358 | 1358 | ||
1359 | 1359 | ||
1360 | pSeries_reconfig_notifier_register(&iommu_reconfig_nb); | 1360 | of_reconfig_notifier_register(&iommu_reconfig_nb); |
1361 | register_memory_notifier(&iommu_mem_nb); | 1361 | register_memory_notifier(&iommu_mem_nb); |
1362 | 1362 | ||
1363 | set_pci_dma_ops(&dma_iommu_ops); | 1363 | set_pci_dma_ops(&dma_iommu_ops); |
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c index dd30b12edfe4..6573808cc5f3 100644 --- a/arch/powerpc/platforms/pseries/mobility.c +++ b/arch/powerpc/platforms/pseries/mobility.c | |||
@@ -116,7 +116,7 @@ static int update_dt_property(struct device_node *dn, struct property **prop, | |||
116 | } | 116 | } |
117 | 117 | ||
118 | if (!more) { | 118 | if (!more) { |
119 | prom_update_property(dn, new_prop); | 119 | of_update_property(dn, new_prop); |
120 | new_prop = NULL; | 120 | new_prop = NULL; |
121 | } | 121 | } |
122 | 122 | ||
@@ -172,7 +172,7 @@ static int update_dt_node(u32 phandle) | |||
172 | 172 | ||
173 | case 0x80000000: | 173 | case 0x80000000: |
174 | prop = of_find_property(dn, prop_name, NULL); | 174 | prop = of_find_property(dn, prop_name, NULL); |
175 | prom_remove_property(dn, prop); | 175 | of_remove_property(dn, prop); |
176 | prop = NULL; | 176 | prop = NULL; |
177 | break; | 177 | break; |
178 | 178 | ||
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index 13e8cc43adf7..e6cc34a67053 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -273,4 +273,35 @@ static inline long plpar_put_term_char(unsigned long termno, unsigned long len, | |||
273 | lbuf[1]); | 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 | #endif /* _PSERIES_PLPAR_WRAPPERS_H */ | 307 | #endif /* _PSERIES_PLPAR_WRAPPERS_H */ |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 2f4668136b20..d6491bd481d0 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -16,55 +16,13 @@ | |||
16 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
17 | #include <linux/proc_fs.h> | 17 | #include <linux/proc_fs.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/of.h> | ||
19 | 20 | ||
20 | #include <asm/prom.h> | 21 | #include <asm/prom.h> |
21 | #include <asm/machdep.h> | 22 | #include <asm/machdep.h> |
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
23 | #include <asm/pSeries_reconfig.h> | ||
24 | #include <asm/mmu.h> | 24 | #include <asm/mmu.h> |
25 | 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 | |||
68 | /** | 26 | /** |
69 | * derive_parent - basically like dirname(1) | 27 | * derive_parent - basically like dirname(1) |
70 | * @path: the full_name of a node to be added to the tree | 28 | * @path: the full_name of a node to be added to the tree |
@@ -97,28 +55,6 @@ static struct device_node *derive_parent(const char *path) | |||
97 | return parent; | 55 | return parent; |
98 | } | 56 | } |
99 | 57 | ||
100 | static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); | ||
101 | |||
102 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) | ||
103 | { | ||
104 | return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb); | ||
105 | } | ||
106 | EXPORT_SYMBOL_GPL(pSeries_reconfig_notifier_register); | ||
107 | |||
108 | void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) | ||
109 | { | ||
110 | blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); | ||
111 | } | ||
112 | EXPORT_SYMBOL_GPL(pSeries_reconfig_notifier_unregister); | ||
113 | |||
114 | int pSeries_reconfig_notify(unsigned long action, void *p) | ||
115 | { | ||
116 | int err = blocking_notifier_call_chain(&pSeries_reconfig_chain, | ||
117 | action, p); | ||
118 | |||
119 | return notifier_to_errno(err); | ||
120 | } | ||
121 | |||
122 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) | 58 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) |
123 | { | 59 | { |
124 | struct device_node *np; | 60 | struct device_node *np; |
@@ -142,16 +78,12 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist | |||
142 | goto out_err; | 78 | goto out_err; |
143 | } | 79 | } |
144 | 80 | ||
145 | err = pSeries_reconfig_notify(PSERIES_RECONFIG_ADD, np); | 81 | err = of_attach_node(np); |
146 | if (err) { | 82 | if (err) { |
147 | printk(KERN_ERR "Failed to add device node %s\n", path); | 83 | printk(KERN_ERR "Failed to add device node %s\n", path); |
148 | goto out_err; | 84 | goto out_err; |
149 | } | 85 | } |
150 | 86 | ||
151 | of_attach_node(np); | ||
152 | |||
153 | add_node_proc_entries(np); | ||
154 | |||
155 | of_node_put(np->parent); | 87 | of_node_put(np->parent); |
156 | 88 | ||
157 | return 0; | 89 | return 0; |
@@ -179,11 +111,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np) | |||
179 | return -EBUSY; | 111 | return -EBUSY; |
180 | } | 112 | } |
181 | 113 | ||
182 | remove_node_proc_entries(np); | ||
183 | |||
184 | pSeries_reconfig_notify(PSERIES_RECONFIG_REMOVE, np); | ||
185 | of_detach_node(np); | 114 | of_detach_node(np); |
186 | |||
187 | of_node_put(parent); | 115 | of_node_put(parent); |
188 | of_node_put(np); /* Must decrement the refcount */ | 116 | of_node_put(np); /* Must decrement the refcount */ |
189 | return 0; | 117 | return 0; |
@@ -397,7 +325,7 @@ static int do_add_property(char *buf, size_t bufsize) | |||
397 | if (!prop) | 325 | if (!prop) |
398 | return -ENOMEM; | 326 | return -ENOMEM; |
399 | 327 | ||
400 | prom_add_property(np, prop); | 328 | of_add_property(np, prop); |
401 | 329 | ||
402 | return 0; | 330 | return 0; |
403 | } | 331 | } |
@@ -421,16 +349,15 @@ static int do_remove_property(char *buf, size_t bufsize) | |||
421 | 349 | ||
422 | prop = of_find_property(np, buf, NULL); | 350 | prop = of_find_property(np, buf, NULL); |
423 | 351 | ||
424 | return prom_remove_property(np, prop); | 352 | return of_remove_property(np, prop); |
425 | } | 353 | } |
426 | 354 | ||
427 | static int do_update_property(char *buf, size_t bufsize) | 355 | static int do_update_property(char *buf, size_t bufsize) |
428 | { | 356 | { |
429 | struct device_node *np; | 357 | struct device_node *np; |
430 | struct pSeries_reconfig_prop_update upd_value; | ||
431 | unsigned char *value; | 358 | unsigned char *value; |
432 | char *name, *end, *next_prop; | 359 | char *name, *end, *next_prop; |
433 | int rc, length; | 360 | int length; |
434 | struct property *newprop; | 361 | struct property *newprop; |
435 | buf = parse_node(buf, bufsize, &np); | 362 | buf = parse_node(buf, bufsize, &np); |
436 | end = buf + bufsize; | 363 | end = buf + bufsize; |
@@ -452,41 +379,7 @@ static int do_update_property(char *buf, size_t bufsize) | |||
452 | if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) | 379 | if (!strcmp(name, "slb-size") || !strcmp(name, "ibm,slb-size")) |
453 | slb_set_size(*(int *)value); | 380 | slb_set_size(*(int *)value); |
454 | 381 | ||
455 | upd_value.node = np; | 382 | return of_update_property(np, newprop); |
456 | upd_value.property = newprop; | ||
457 | pSeries_reconfig_notify(PSERIES_UPDATE_PROPERTY, &upd_value); | ||
458 | |||
459 | rc = prom_update_property(np, newprop); | ||
460 | if (rc) | ||
461 | return rc; | ||
462 | |||
463 | /* For memory under the ibm,dynamic-reconfiguration-memory node | ||
464 | * of the device tree, adding and removing memory is just an update | ||
465 | * to the ibm,dynamic-memory property instead of adding/removing a | ||
466 | * memory node in the device tree. For these cases we still need to | ||
467 | * involve the notifier chain. | ||
468 | */ | ||
469 | if (!strcmp(name, "ibm,dynamic-memory")) { | ||
470 | int action; | ||
471 | |||
472 | next_prop = parse_next_property(next_prop, end, &name, | ||
473 | &length, &value); | ||
474 | if (!next_prop) | ||
475 | return -EINVAL; | ||
476 | |||
477 | if (!strcmp(name, "add")) | ||
478 | action = PSERIES_DRCONF_MEM_ADD; | ||
479 | else | ||
480 | action = PSERIES_DRCONF_MEM_REMOVE; | ||
481 | |||
482 | rc = pSeries_reconfig_notify(action, value); | ||
483 | if (rc) { | ||
484 | prom_update_property(np, newprop); | ||
485 | return rc; | ||
486 | } | ||
487 | } | ||
488 | |||
489 | return 0; | ||
490 | } | 383 | } |
491 | 384 | ||
492 | /** | 385 | /** |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index e3cb7ae61658..ca55882465d6 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include <linux/seq_file.h> | 40 | #include <linux/seq_file.h> |
41 | #include <linux/root_dev.h> | 41 | #include <linux/root_dev.h> |
42 | #include <linux/cpuidle.h> | 42 | #include <linux/cpuidle.h> |
43 | #include <linux/of.h> | ||
44 | #include <linux/kexec.h> | ||
43 | 45 | ||
44 | #include <asm/mmu.h> | 46 | #include <asm/mmu.h> |
45 | #include <asm/processor.h> | 47 | #include <asm/processor.h> |
@@ -63,7 +65,6 @@ | |||
63 | #include <asm/smp.h> | 65 | #include <asm/smp.h> |
64 | #include <asm/firmware.h> | 66 | #include <asm/firmware.h> |
65 | #include <asm/eeh.h> | 67 | #include <asm/eeh.h> |
66 | #include <asm/pSeries_reconfig.h> | ||
67 | 68 | ||
68 | #include "plpar_wrappers.h" | 69 | #include "plpar_wrappers.h" |
69 | #include "pseries.h" | 70 | #include "pseries.h" |
@@ -258,7 +259,7 @@ static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long act | |||
258 | int err = NOTIFY_OK; | 259 | int err = NOTIFY_OK; |
259 | 260 | ||
260 | switch (action) { | 261 | switch (action) { |
261 | case PSERIES_RECONFIG_ADD: | 262 | case OF_RECONFIG_ATTACH_NODE: |
262 | pci = np->parent->data; | 263 | pci = np->parent->data; |
263 | if (pci) { | 264 | if (pci) { |
264 | update_dn_pci_info(np, pci->phb); | 265 | update_dn_pci_info(np, pci->phb); |
@@ -367,6 +368,65 @@ static void pSeries_idle(void) | |||
367 | } | 368 | } |
368 | } | 369 | } |
369 | 370 | ||
371 | /* | ||
372 | * Enable relocation on during exceptions. This has partition wide scope and | ||
373 | * may take a while to complete, if it takes longer than one second we will | ||
374 | * just give up rather than wasting any more time on this - if that turns out | ||
375 | * to ever be a problem in practice we can move this into a kernel thread to | ||
376 | * finish off the process later in boot. | ||
377 | */ | ||
378 | static int __init pSeries_enable_reloc_on_exc(void) | ||
379 | { | ||
380 | long rc; | ||
381 | unsigned int delay, total_delay = 0; | ||
382 | |||
383 | while (1) { | ||
384 | rc = enable_reloc_on_exceptions(); | ||
385 | if (!H_IS_LONG_BUSY(rc)) | ||
386 | return rc; | ||
387 | |||
388 | delay = get_longbusy_msecs(rc); | ||
389 | total_delay += delay; | ||
390 | if (total_delay > 1000) { | ||
391 | pr_warn("Warning: Giving up waiting to enable " | ||
392 | "relocation on exceptions (%u msec)!\n", | ||
393 | total_delay); | ||
394 | return rc; | ||
395 | } | ||
396 | |||
397 | mdelay(delay); | ||
398 | } | ||
399 | } | ||
400 | |||
401 | #ifdef CONFIG_KEXEC | ||
402 | static long pSeries_disable_reloc_on_exc(void) | ||
403 | { | ||
404 | long rc; | ||
405 | |||
406 | while (1) { | ||
407 | rc = disable_reloc_on_exceptions(); | ||
408 | if (!H_IS_LONG_BUSY(rc)) | ||
409 | return rc; | ||
410 | mdelay(get_longbusy_msecs(rc)); | ||
411 | } | ||
412 | } | ||
413 | |||
414 | static void pSeries_machine_kexec(struct kimage *image) | ||
415 | { | ||
416 | long rc; | ||
417 | |||
418 | if (firmware_has_feature(FW_FEATURE_SET_MODE) && | ||
419 | (image->type != KEXEC_TYPE_CRASH)) { | ||
420 | rc = pSeries_disable_reloc_on_exc(); | ||
421 | if (rc != H_SUCCESS) | ||
422 | pr_warning("Warning: Failed to disable relocation on " | ||
423 | "exceptions: %ld\n", rc); | ||
424 | } | ||
425 | |||
426 | default_machine_kexec(image); | ||
427 | } | ||
428 | #endif | ||
429 | |||
370 | static void __init pSeries_setup_arch(void) | 430 | static void __init pSeries_setup_arch(void) |
371 | { | 431 | { |
372 | panic_timeout = 10; | 432 | panic_timeout = 10; |
@@ -389,7 +449,7 @@ static void __init pSeries_setup_arch(void) | |||
389 | /* Find and initialize PCI host bridges */ | 449 | /* Find and initialize PCI host bridges */ |
390 | init_pci_config_tokens(); | 450 | init_pci_config_tokens(); |
391 | find_and_init_phbs(); | 451 | find_and_init_phbs(); |
392 | pSeries_reconfig_notifier_register(&pci_dn_reconfig_nb); | 452 | of_reconfig_notifier_register(&pci_dn_reconfig_nb); |
393 | 453 | ||
394 | pSeries_nvram_init(); | 454 | pSeries_nvram_init(); |
395 | 455 | ||
@@ -402,6 +462,14 @@ static void __init pSeries_setup_arch(void) | |||
402 | ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; | 462 | ppc_md.enable_pmcs = pseries_lpar_enable_pmcs; |
403 | else | 463 | else |
404 | ppc_md.enable_pmcs = power4_enable_pmcs; | 464 | ppc_md.enable_pmcs = power4_enable_pmcs; |
465 | |||
466 | if (firmware_has_feature(FW_FEATURE_SET_MODE)) { | ||
467 | long rc; | ||
468 | if ((rc = pSeries_enable_reloc_on_exc()) != H_SUCCESS) { | ||
469 | pr_warn("Unable to enable relocation on exceptions: " | ||
470 | "%ld\n", rc); | ||
471 | } | ||
472 | } | ||
405 | } | 473 | } |
406 | 474 | ||
407 | static int __init pSeries_init_panel(void) | 475 | static int __init pSeries_init_panel(void) |
@@ -659,4 +727,7 @@ define_machine(pseries) { | |||
659 | .progress = rtas_progress, | 727 | .progress = rtas_progress, |
660 | .system_reset_exception = pSeries_system_reset_exception, | 728 | .system_reset_exception = pSeries_system_reset_exception, |
661 | .machine_check_exception = pSeries_machine_check_exception, | 729 | .machine_check_exception = pSeries_machine_check_exception, |
730 | #ifdef CONFIG_KEXEC | ||
731 | .machine_kexec = pSeries_machine_kexec, | ||
732 | #endif | ||
662 | }; | 733 | }; |
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c index 71706bc34a0d..9fc0a4941908 100644 --- a/arch/powerpc/platforms/pseries/smp.c +++ b/arch/powerpc/platforms/pseries/smp.c | |||
@@ -38,7 +38,6 @@ | |||
38 | #include <asm/cputable.h> | 38 | #include <asm/cputable.h> |
39 | #include <asm/firmware.h> | 39 | #include <asm/firmware.h> |
40 | #include <asm/rtas.h> | 40 | #include <asm/rtas.h> |
41 | #include <asm/pSeries_reconfig.h> | ||
42 | #include <asm/mpic.h> | 41 | #include <asm/mpic.h> |
43 | #include <asm/vdso_datapage.h> | 42 | #include <asm/vdso_datapage.h> |
44 | #include <asm/cputhreads.h> | 43 | #include <asm/cputhreads.h> |
diff --git a/arch/powerpc/sysdev/fsl_gtm.c b/arch/powerpc/sysdev/fsl_gtm.c index 02cf1e7e77fc..0eb871cc3437 100644 --- a/arch/powerpc/sysdev/fsl_gtm.c +++ b/arch/powerpc/sysdev/fsl_gtm.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Freescale General-purpose Timers Module | 2 | * Freescale General-purpose Timers Module |
3 | * | 3 | * |
4 | * Copyright (c) Freescale Semicondutor, Inc. 2006. | 4 | * Copyright (c) Freescale Semiconductor, Inc. 2006. |
5 | * Shlomi Gridish <gridish@freescale.com> | 5 | * Shlomi Gridish <gridish@freescale.com> |
6 | * Jerry Huang <Chang-Ming.Huang@freescale.com> | 6 | * Jerry Huang <Chang-Ming.Huang@freescale.com> |
7 | * Copyright (c) MontaVista Software, Inc. 2008. | 7 | * Copyright (c) MontaVista Software, Inc. 2008. |
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index 01b62a62c635..5ba325bff3a2 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c | |||
@@ -89,7 +89,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) | |||
89 | return 0; | 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 | unsigned int index, const struct resource *res, | 93 | unsigned int index, const struct resource *res, |
94 | resource_size_t offset) | 94 | resource_size_t offset) |
95 | { | 95 | { |
@@ -126,7 +126,7 @@ static int __init setup_one_atmu(struct ccsr_pci __iomem *pci, | |||
126 | } | 126 | } |
127 | 127 | ||
128 | /* atmu setup for fsl pci/pcie controller */ | 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 | struct resource *rsrc) | 130 | struct resource *rsrc) |
131 | { | 131 | { |
132 | struct ccsr_pci __iomem *pci; | 132 | struct ccsr_pci __iomem *pci; |
@@ -902,9 +902,42 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev) | |||
902 | return 0; | 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 | static struct platform_driver fsl_pci_driver = { | 937 | static struct platform_driver fsl_pci_driver = { |
906 | .driver = { | 938 | .driver = { |
907 | .name = "fsl-pci", | 939 | .name = "fsl-pci", |
940 | .pm = PCI_PM_OPS, | ||
908 | .of_match_table = pci_ids, | 941 | .of_match_table = pci_ids, |
909 | }, | 942 | }, |
910 | .probe = fsl_pci_probe, | 943 | .probe = fsl_pci_probe, |
diff --git a/arch/powerpc/sysdev/pmi.c b/arch/powerpc/sysdev/pmi.c index 8f0465422b1e..5aaf86c03893 100644 --- a/arch/powerpc/sysdev/pmi.c +++ b/arch/powerpc/sysdev/pmi.c | |||
@@ -214,18 +214,7 @@ static struct platform_driver pmi_of_platform_driver = { | |||
214 | .of_match_table = pmi_match, | 214 | .of_match_table = pmi_match, |
215 | }, | 215 | }, |
216 | }; | 216 | }; |
217 | 217 | module_platform_driver(pmi_of_platform_driver); | |
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); | ||
229 | 218 | ||
230 | int pmi_send_message(pmi_message_t msg) | 219 | int pmi_send_message(pmi_message_t msg) |
231 | { | 220 | { |
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index b04367529729..238a07b97f2c 100644 --- a/arch/powerpc/sysdev/qe_lib/qe.c +++ b/arch/powerpc/sysdev/qe_lib/qe.c | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 2fba6ef2f95e..b2b87c30e266 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/powerpc/sysdev/qe_lib/qe_ic.c | 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 | * Author: Li Yang <leoli@freescale.com> | 6 | * Author: Li Yang <leoli@freescale.com> |
7 | * Based on code from Shlomi Gridish <gridish@freescale.com> | 7 | * Based on code from Shlomi Gridish <gridish@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.h b/arch/powerpc/sysdev/qe_lib/qe_ic.h index c327872ed35c..efef7ab9b753 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.h +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * QUICC ENGINE Interrupt Controller Header | 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 | * Author: Li Yang <leoli@freescale.com> | 8 | * Author: Li Yang <leoli@freescale.com> |
9 | * Based on code from Shlomi Gridish <gridish@freescale.com> | 9 | * Based on code from Shlomi Gridish <gridish@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/qe_io.c b/arch/powerpc/sysdev/qe_lib/qe_io.c index fd1a6c3b1721..a88807b3dd57 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_io.c +++ b/arch/powerpc/sysdev/qe_lib/qe_io.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * QE Parallel I/O ports configuration routines | 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 | * Author: Li Yang <LeoLi@freescale.com> | 8 | * Author: Li Yang <LeoLi@freescale.com> |
9 | * Based on code from Shlomi Gridish <gridish@freescale.com> | 9 | * Based on code from Shlomi Gridish <gridish@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/ucc.c b/arch/powerpc/sysdev/qe_lib/ucc.c index 04677505f20f..134b07d29435 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc.c +++ b/arch/powerpc/sysdev/qe_lib/ucc.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * QE UCC API Set - UCC specific routines implementations. | 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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 8 | * Authors: Shlomi Gridish <gridish@freescale.com> |
9 | * Li Yang <leoli@freescale.com> | 9 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_fast.c b/arch/powerpc/sysdev/qe_lib/ucc_fast.c index fba02440d122..cceb2e366738 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_fast.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_fast.c | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/ucc_slow.c b/arch/powerpc/sysdev/qe_lib/ucc_slow.c index 524c0ead941d..1c062f48f1ac 100644 --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c +++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c | |||
@@ -1,5 +1,5 @@ | |||
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 | * Authors: Shlomi Gridish <gridish@freescale.com> | 4 | * Authors: Shlomi Gridish <gridish@freescale.com> |
5 | * Li Yang <leoli@freescale.com> | 5 | * Li Yang <leoli@freescale.com> |
diff --git a/arch/powerpc/sysdev/qe_lib/usb.c b/arch/powerpc/sysdev/qe_lib/usb.c index 9162828f5da7..27f23bd15eb6 100644 --- a/arch/powerpc/sysdev/qe_lib/usb.c +++ b/arch/powerpc/sysdev/qe_lib/usb.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * QE USB routines | 2 | * QE USB routines |
3 | * | 3 | * |
4 | * Copyright (c) Freescale Semicondutor, Inc. 2006. | 4 | * Copyright 2006 Freescale Semiconductor, Inc. |
5 | * Shlomi Gridish <gridish@freescale.com> | 5 | * Shlomi Gridish <gridish@freescale.com> |
6 | * Jerry Huang <Chang-Ming.Huang@freescale.com> | 6 | * Jerry Huang <Chang-Ming.Huang@freescale.com> |
7 | * Copyright (c) MontaVista Software, Inc. 2008. | 7 | * Copyright (c) MontaVista Software, Inc. 2008. |
diff --git a/arch/powerpc/xmon/Makefile b/arch/powerpc/xmon/Makefile index c168c54e3c40..b49fdbd15808 100644 --- a/arch/powerpc/xmon/Makefile +++ b/arch/powerpc/xmon/Makefile | |||
@@ -6,7 +6,7 @@ GCOV_PROFILE := n | |||
6 | 6 | ||
7 | ccflags-$(CONFIG_PPC64) := -mno-minimal-toc | 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 | ifdef CONFIG_XMON_DISASSEMBLY | 11 | ifdef CONFIG_XMON_DISASSEMBLY |
12 | obj-y += ppc-dis.o ppc-opc.o | 12 | obj-y += ppc-dis.o ppc-opc.o |
diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c index bfac84fbe780..bce3dcfe5058 100644 --- a/arch/powerpc/xmon/nonstdio.c +++ b/arch/powerpc/xmon/nonstdio.c | |||
@@ -7,9 +7,23 @@ | |||
7 | * 2 of the License, or (at your option) any later version. | 7 | * 2 of the License, or (at your option) any later version. |
8 | */ | 8 | */ |
9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
10 | #include <asm/udbg.h> | ||
10 | #include <asm/time.h> | 11 | #include <asm/time.h> |
11 | #include "nonstdio.h" | 12 | #include "nonstdio.h" |
12 | 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 | } | ||
26 | |||
13 | int xmon_putchar(int c) | 27 | int xmon_putchar(int c) |
14 | { | 28 | { |
15 | char ch = c; | 29 | char ch = c; |
@@ -23,34 +37,7 @@ static char line[256]; | |||
23 | static char *lineptr; | 37 | static char *lineptr; |
24 | static int lineleft; | 38 | static int lineleft; |
25 | 39 | ||
26 | int xmon_expect(const char *str, unsigned long timeout) | 40 | static int xmon_getchar(void) |
27 | { | ||
28 | int c; | ||
29 | unsigned long t0; | ||
30 | |||
31 | /* assume 25MHz default timebase if tb_ticks_per_sec not set yet */ | ||
32 | timeout *= tb_ticks_per_sec? tb_ticks_per_sec: 25000000; | ||
33 | t0 = get_tbl(); | ||
34 | do { | ||
35 | lineptr = line; | ||
36 | for (;;) { | ||
37 | c = xmon_read_poll(); | ||
38 | if (c == -1) { | ||
39 | if (get_tbl() - t0 > timeout) | ||
40 | return 0; | ||
41 | continue; | ||
42 | } | ||
43 | if (c == '\n') | ||
44 | break; | ||
45 | if (c != '\r' && lineptr < &line[sizeof(line) - 1]) | ||
46 | *lineptr++ = c; | ||
47 | } | ||
48 | *lineptr = 0; | ||
49 | } while (strstr(line, str) == NULL); | ||
50 | return 1; | ||
51 | } | ||
52 | |||
53 | int xmon_getchar(void) | ||
54 | { | 41 | { |
55 | int c; | 42 | int c; |
56 | 43 | ||
@@ -124,13 +111,19 @@ char *xmon_gets(char *str, int nb) | |||
124 | void xmon_printf(const char *format, ...) | 111 | void xmon_printf(const char *format, ...) |
125 | { | 112 | { |
126 | va_list args; | 113 | va_list args; |
127 | int n; | ||
128 | static char xmon_outbuf[1024]; | 114 | static char xmon_outbuf[1024]; |
115 | int rc, n; | ||
129 | 116 | ||
130 | va_start(args, format); | 117 | va_start(args, format); |
131 | n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); | 118 | n = vsnprintf(xmon_outbuf, sizeof(xmon_outbuf), format, args); |
132 | va_end(args); | 119 | va_end(args); |
133 | xmon_write(xmon_outbuf, n); | 120 | |
121 | rc = xmon_write(xmon_outbuf, n); | ||
122 | |||
123 | if (n && rc == 0) { | ||
124 | /* No udbg hooks, fallback to printk() - dangerous */ | ||
125 | printk(xmon_outbuf); | ||
126 | } | ||
134 | } | 127 | } |
135 | 128 | ||
136 | void xmon_puts(const char *str) | 129 | void xmon_puts(const char *str) |
diff --git a/arch/powerpc/xmon/nonstdio.h b/arch/powerpc/xmon/nonstdio.h index 23dd95f4599c..18a51ded4ffd 100644 --- a/arch/powerpc/xmon/nonstdio.h +++ b/arch/powerpc/xmon/nonstdio.h | |||
@@ -4,12 +4,6 @@ | |||
4 | #define putchar xmon_putchar | 4 | #define putchar xmon_putchar |
5 | 5 | ||
6 | extern int xmon_putchar(int c); | 6 | extern int xmon_putchar(int c); |
7 | extern int xmon_getchar(void); | ||
8 | extern void xmon_puts(const char *); | 7 | extern void xmon_puts(const char *); |
9 | extern char *xmon_gets(char *, int); | 8 | extern char *xmon_gets(char *, int); |
10 | extern void xmon_printf(const char *, ...); | 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); | ||
diff --git a/arch/powerpc/xmon/start.c b/arch/powerpc/xmon/start.c deleted file mode 100644 index 8864de2af382..000000000000 --- a/arch/powerpc/xmon/start.c +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
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 | } | ||
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 3a56a639a92e..1f8d2f10a432 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -52,9 +52,6 @@ | |||
52 | #include "nonstdio.h" | 52 | #include "nonstdio.h" |
53 | #include "dis-asm.h" | 53 | #include "dis-asm.h" |
54 | 54 | ||
55 | #define scanhex xmon_scanhex | ||
56 | #define skipbl xmon_skipbl | ||
57 | |||
58 | #ifdef CONFIG_SMP | 55 | #ifdef CONFIG_SMP |
59 | static cpumask_t cpus_in_xmon = CPU_MASK_NONE; | 56 | static cpumask_t cpus_in_xmon = CPU_MASK_NONE; |
60 | static unsigned long xmon_taken = 1; | 57 | static unsigned long xmon_taken = 1; |
@@ -169,12 +166,8 @@ extern void xmon_leave(void); | |||
169 | 166 | ||
170 | #ifdef CONFIG_PPC64 | 167 | #ifdef CONFIG_PPC64 |
171 | #define REG "%.16lx" | 168 | #define REG "%.16lx" |
172 | #define REGS_PER_LINE 4 | ||
173 | #define LAST_VOLATILE 13 | ||
174 | #else | 169 | #else |
175 | #define REG "%.8lx" | 170 | #define REG "%.8lx" |
176 | #define REGS_PER_LINE 8 | ||
177 | #define LAST_VOLATILE 12 | ||
178 | #endif | 171 | #endif |
179 | 172 | ||
180 | #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) | 173 | #define GETWORD(v) (((v)[0] << 24) + ((v)[1] << 16) + ((v)[2] << 8) + (v)[3]) |
@@ -1288,27 +1281,19 @@ static void get_function_bounds(unsigned long pc, unsigned long *startp, | |||
1288 | catch_memory_errors = 0; | 1281 | catch_memory_errors = 0; |
1289 | } | 1282 | } |
1290 | 1283 | ||
1291 | static int xmon_depth_to_print = 64; | ||
1292 | |||
1293 | #define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) | 1284 | #define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long)) |
1294 | #define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) | 1285 | #define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long)) |
1295 | 1286 | ||
1296 | #ifdef __powerpc64__ | ||
1297 | #define REGS_OFFSET 0x70 | ||
1298 | #else | ||
1299 | #define REGS_OFFSET 16 | ||
1300 | #endif | ||
1301 | |||
1302 | static void xmon_show_stack(unsigned long sp, unsigned long lr, | 1287 | static void xmon_show_stack(unsigned long sp, unsigned long lr, |
1303 | unsigned long pc) | 1288 | unsigned long pc) |
1304 | { | 1289 | { |
1290 | int max_to_print = 64; | ||
1305 | unsigned long ip; | 1291 | unsigned long ip; |
1306 | unsigned long newsp; | 1292 | unsigned long newsp; |
1307 | unsigned long marker; | 1293 | unsigned long marker; |
1308 | int count = 0; | ||
1309 | struct pt_regs regs; | 1294 | struct pt_regs regs; |
1310 | 1295 | ||
1311 | do { | 1296 | while (max_to_print--) { |
1312 | if (sp < PAGE_OFFSET) { | 1297 | if (sp < PAGE_OFFSET) { |
1313 | if (sp != 0) | 1298 | if (sp != 0) |
1314 | printf("SP (%lx) is in userspace\n", sp); | 1299 | printf("SP (%lx) is in userspace\n", sp); |
@@ -1362,10 +1347,10 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, | |||
1362 | an exception frame. */ | 1347 | an exception frame. */ |
1363 | if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) | 1348 | if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long)) |
1364 | && marker == STACK_FRAME_REGS_MARKER) { | 1349 | && marker == STACK_FRAME_REGS_MARKER) { |
1365 | if (mread(sp + REGS_OFFSET, ®s, sizeof(regs)) | 1350 | if (mread(sp + STACK_FRAME_OVERHEAD, ®s, sizeof(regs)) |
1366 | != sizeof(regs)) { | 1351 | != sizeof(regs)) { |
1367 | printf("Couldn't read registers at %lx\n", | 1352 | printf("Couldn't read registers at %lx\n", |
1368 | sp + REGS_OFFSET); | 1353 | sp + STACK_FRAME_OVERHEAD); |
1369 | break; | 1354 | break; |
1370 | } | 1355 | } |
1371 | printf("--- Exception: %lx %s at ", regs.trap, | 1356 | printf("--- Exception: %lx %s at ", regs.trap, |
@@ -1379,7 +1364,7 @@ static void xmon_show_stack(unsigned long sp, unsigned long lr, | |||
1379 | break; | 1364 | break; |
1380 | 1365 | ||
1381 | sp = newsp; | 1366 | sp = newsp; |
1382 | } while (count++ < xmon_depth_to_print); | 1367 | } |
1383 | } | 1368 | } |
1384 | 1369 | ||
1385 | static void backtrace(struct pt_regs *excp) | 1370 | static void backtrace(struct pt_regs *excp) |
@@ -2943,7 +2928,6 @@ static void xmon_init(int enable) | |||
2943 | __debugger_dabr_match = NULL; | 2928 | __debugger_dabr_match = NULL; |
2944 | __debugger_fault_handler = NULL; | 2929 | __debugger_fault_handler = NULL; |
2945 | } | 2930 | } |
2946 | xmon_map_scc(); | ||
2947 | } | 2931 | } |
2948 | 2932 | ||
2949 | #ifdef CONFIG_MAGIC_SYSRQ | 2933 | #ifdef CONFIG_MAGIC_SYSRQ |
diff --git a/drivers/crypto/nx/nx-842.c b/drivers/crypto/nx/nx-842.c index 0ce625738677..6c4c000671c5 100644 --- a/drivers/crypto/nx/nx-842.c +++ b/drivers/crypto/nx/nx-842.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
29 | 29 | ||
30 | #include <asm/page.h> | 30 | #include <asm/page.h> |
31 | #include <asm/pSeries_reconfig.h> | ||
32 | #include <asm/vio.h> | 31 | #include <asm/vio.h> |
33 | 32 | ||
34 | #include "nx_csbcpb.h" /* struct nx_csbcpb */ | 33 | #include "nx_csbcpb.h" /* struct nx_csbcpb */ |
@@ -1014,26 +1013,23 @@ error_out: | |||
1014 | * NOTIFY_BAD encoded with error number on failure, use | 1013 | * NOTIFY_BAD encoded with error number on failure, use |
1015 | * notifier_to_errno() to decode this value | 1014 | * notifier_to_errno() to decode this value |
1016 | */ | 1015 | */ |
1017 | static int nx842_OF_notifier(struct notifier_block *np, | 1016 | static int nx842_OF_notifier(struct notifier_block *np, unsigned long action, |
1018 | unsigned long action, | 1017 | void *update) |
1019 | void *update) | ||
1020 | { | 1018 | { |
1021 | struct pSeries_reconfig_prop_update *upd; | 1019 | struct of_prop_reconfig *upd = update; |
1022 | struct nx842_devdata *local_devdata; | 1020 | struct nx842_devdata *local_devdata; |
1023 | struct device_node *node = NULL; | 1021 | struct device_node *node = NULL; |
1024 | 1022 | ||
1025 | upd = (struct pSeries_reconfig_prop_update *)update; | ||
1026 | |||
1027 | rcu_read_lock(); | 1023 | rcu_read_lock(); |
1028 | local_devdata = rcu_dereference(devdata); | 1024 | local_devdata = rcu_dereference(devdata); |
1029 | if (local_devdata) | 1025 | if (local_devdata) |
1030 | node = local_devdata->dev->of_node; | 1026 | node = local_devdata->dev->of_node; |
1031 | 1027 | ||
1032 | if (local_devdata && | 1028 | if (local_devdata && |
1033 | action == PSERIES_UPDATE_PROPERTY && | 1029 | action == OF_RECONFIG_UPDATE_PROPERTY && |
1034 | !strcmp(upd->node->name, node->name)) { | 1030 | !strcmp(upd->dn->name, node->name)) { |
1035 | rcu_read_unlock(); | 1031 | rcu_read_unlock(); |
1036 | nx842_OF_upd(upd->property); | 1032 | nx842_OF_upd(upd->prop); |
1037 | } else | 1033 | } else |
1038 | rcu_read_unlock(); | 1034 | rcu_read_unlock(); |
1039 | 1035 | ||
@@ -1182,7 +1178,7 @@ static int __init nx842_probe(struct vio_dev *viodev, | |||
1182 | synchronize_rcu(); | 1178 | synchronize_rcu(); |
1183 | kfree(old_devdata); | 1179 | kfree(old_devdata); |
1184 | 1180 | ||
1185 | pSeries_reconfig_notifier_register(&nx842_of_nb); | 1181 | of_reconfig_notifier_register(&nx842_of_nb); |
1186 | 1182 | ||
1187 | ret = nx842_OF_upd(NULL); | 1183 | ret = nx842_OF_upd(NULL); |
1188 | if (ret && ret != -ENODEV) { | 1184 | if (ret && ret != -ENODEV) { |
@@ -1228,7 +1224,7 @@ static int __exit nx842_remove(struct vio_dev *viodev) | |||
1228 | spin_lock_irqsave(&devdata_mutex, flags); | 1224 | spin_lock_irqsave(&devdata_mutex, flags); |
1229 | old_devdata = rcu_dereference_check(devdata, | 1225 | old_devdata = rcu_dereference_check(devdata, |
1230 | lockdep_is_held(&devdata_mutex)); | 1226 | lockdep_is_held(&devdata_mutex)); |
1231 | pSeries_reconfig_notifier_unregister(&nx842_of_nb); | 1227 | of_reconfig_notifier_unregister(&nx842_of_nb); |
1232 | rcu_assign_pointer(devdata, NULL); | 1228 | rcu_assign_pointer(devdata, NULL); |
1233 | spin_unlock_irqrestore(&devdata_mutex, flags); | 1229 | spin_unlock_irqrestore(&devdata_mutex, flags); |
1234 | synchronize_rcu(); | 1230 | synchronize_rcu(); |
diff --git a/drivers/crypto/nx/nx.c b/drivers/crypto/nx/nx.c index 638110efae9b..f7a8a16aa7d3 100644 --- a/drivers/crypto/nx/nx.c +++ b/drivers/crypto/nx/nx.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/scatterlist.h> | 33 | #include <linux/scatterlist.h> |
34 | #include <linux/device.h> | 34 | #include <linux/device.h> |
35 | #include <linux/of.h> | 35 | #include <linux/of.h> |
36 | #include <asm/pSeries_reconfig.h> | ||
37 | #include <asm/hvcall.h> | 36 | #include <asm/hvcall.h> |
38 | #include <asm/vio.h> | 37 | #include <asm/vio.h> |
39 | 38 | ||
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/infiniband/hw/ehca/hcp_if.c index 2d41d04fd959..89517ffb4389 100644 --- a/drivers/infiniband/hw/ehca/hcp_if.c +++ b/drivers/infiniband/hw/ehca/hcp_if.c | |||
@@ -90,26 +90,6 @@ | |||
90 | 90 | ||
91 | static DEFINE_SPINLOCK(hcall_lock); | 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 | static long ehca_plpar_hcall_norets(unsigned long opcode, | 93 | static long ehca_plpar_hcall_norets(unsigned long opcode, |
114 | unsigned long arg1, | 94 | unsigned long arg1, |
115 | unsigned long arg2, | 95 | unsigned long arg2, |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 196368009001..9c6b96414862 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -997,7 +997,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id) | |||
997 | "%02x !\n", id, hdr->id); | 997 | "%02x !\n", id, hdr->id); |
998 | goto failure; | 998 | goto failure; |
999 | } | 999 | } |
1000 | if (prom_add_property(smu->of_node, prop)) { | 1000 | if (of_add_property(smu->of_node, prop)) { |
1001 | printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x " | 1001 | printk(KERN_DEBUG "SMU: Failed creating sdb-partition-%02x " |
1002 | "property !\n", id); | 1002 | "property !\n", id); |
1003 | goto failure; | 1003 | goto failure; |
diff --git a/drivers/macintosh/windfarm_fcu_controls.c b/drivers/macintosh/windfarm_fcu_controls.c index b3411edb324b..fd6ed15a979d 100644 --- a/drivers/macintosh/windfarm_fcu_controls.c +++ b/drivers/macintosh/windfarm_fcu_controls.c | |||
@@ -593,19 +593,7 @@ static struct i2c_driver wf_fcu_driver = { | |||
593 | .id_table = wf_fcu_id, | 593 | .id_table = wf_fcu_id, |
594 | }; | 594 | }; |
595 | 595 | ||
596 | static int __init wf_fcu_init(void) | 596 | module_i2c_driver(wf_fcu_driver); |
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); | ||
609 | 597 | ||
610 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); | 598 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); |
611 | MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); | 599 | MODULE_DESCRIPTION("FCU control objects for PowerMacs thermal control"); |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index b0c2d3695b34..9ef32b3df91f 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
@@ -174,19 +174,7 @@ static struct i2c_driver wf_lm75_driver = { | |||
174 | .id_table = wf_lm75_id, | 174 | .id_table = wf_lm75_id, |
175 | }; | 175 | }; |
176 | 176 | ||
177 | static int __init wf_lm75_sensor_init(void) | 177 | module_i2c_driver(wf_lm75_driver); |
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); | ||
190 | 178 | ||
191 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); | 179 | MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>"); |
192 | MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control"); | 180 | MODULE_DESCRIPTION("LM75 sensor objects for PowerMacs thermal control"); |
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index 371b058d2f7d..945a25b2f31e 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
@@ -130,18 +130,7 @@ static struct i2c_driver wf_max6690_driver = { | |||
130 | .id_table = wf_max6690_id, | 130 | .id_table = wf_max6690_id, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static int __init wf_max6690_sensor_init(void) | 133 | module_i2c_driver(wf_max6690_driver); |
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); | ||
145 | 134 | ||
146 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); | 135 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); |
147 | MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control"); | 136 | MODULE_DESCRIPTION("MAX6690 sensor objects for PowerMac thermal control"); |
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 426e810233d7..d87f5ee04ca9 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
@@ -364,18 +364,7 @@ static struct i2c_driver wf_sat_driver = { | |||
364 | .id_table = wf_sat_id, | 364 | .id_table = wf_sat_id, |
365 | }; | 365 | }; |
366 | 366 | ||
367 | static int __init sat_sensors_init(void) | 367 | module_i2c_driver(wf_sat_driver); |
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); | ||
379 | 368 | ||
380 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); | 369 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); |
381 | MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); | 370 | MODULE_DESCRIPTION("SMU satellite sensors for PowerMac thermal control"); |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h index 8364815c32ff..99b6c2a38dbf 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h +++ b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h | |||
@@ -39,26 +39,6 @@ | |||
39 | * hcp_* - structures, variables and functions releated to Hypervisor Calls | 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 | /* Number of pages which can be registered at once by H_REGISTER_HEA_RPAGES */ | 42 | /* Number of pages which can be registered at once by H_REGISTER_HEA_RPAGES */ |
63 | #define EHEA_MAX_RPAGE 512 | 43 | #define EHEA_MAX_RPAGE 512 |
64 | 44 | ||
diff --git a/drivers/of/base.c b/drivers/of/base.c index be846408dbc1..db8d211a0d05 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -1114,13 +1114,36 @@ int of_parse_phandle_with_args(const struct device_node *np, const char *list_na | |||
1114 | } | 1114 | } |
1115 | EXPORT_SYMBOL(of_parse_phandle_with_args); | 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 | struct property **next; | 1140 | struct property **next; |
1123 | unsigned long flags; | 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 | prop->next = NULL; | 1148 | prop->next = NULL; |
1126 | write_lock_irqsave(&devtree_lock, flags); | 1149 | write_lock_irqsave(&devtree_lock, flags); |
@@ -1146,18 +1169,23 @@ int prom_add_property(struct device_node *np, struct property *prop) | |||
1146 | } | 1169 | } |
1147 | 1170 | ||
1148 | /** | 1171 | /** |
1149 | * prom_remove_property - Remove a property from a node. | 1172 | * of_remove_property - Remove a property from a node. |
1150 | * | 1173 | * |
1151 | * Note that we don't actually remove it, since we have given out | 1174 | * Note that we don't actually remove it, since we have given out |
1152 | * who-knows-how-many pointers to the data using get-property. | 1175 | * who-knows-how-many pointers to the data using get-property. |
1153 | * Instead we just move the property to the "dead properties" | 1176 | * Instead we just move the property to the "dead properties" |
1154 | * list, so it won't be found any more. | 1177 | * list, so it won't be found any more. |
1155 | */ | 1178 | */ |
1156 | int prom_remove_property(struct device_node *np, struct property *prop) | 1179 | int of_remove_property(struct device_node *np, struct property *prop) |
1157 | { | 1180 | { |
1158 | struct property **next; | 1181 | struct property **next; |
1159 | unsigned long flags; | 1182 | unsigned long flags; |
1160 | int found = 0; | 1183 | int found = 0; |
1184 | int rc; | ||
1185 | |||
1186 | rc = of_property_notify(OF_RECONFIG_REMOVE_PROPERTY, np, prop); | ||
1187 | if (rc) | ||
1188 | return rc; | ||
1161 | 1189 | ||
1162 | write_lock_irqsave(&devtree_lock, flags); | 1190 | write_lock_irqsave(&devtree_lock, flags); |
1163 | next = &np->properties; | 1191 | next = &np->properties; |
@@ -1187,7 +1215,7 @@ int prom_remove_property(struct device_node *np, struct property *prop) | |||
1187 | } | 1215 | } |
1188 | 1216 | ||
1189 | /* | 1217 | /* |
1190 | * prom_update_property - Update a property in a node, if the property does | 1218 | * of_update_property - Update a property in a node, if the property does |
1191 | * not exist, add it. | 1219 | * not exist, add it. |
1192 | * | 1220 | * |
1193 | * Note that we don't actually remove it, since we have given out | 1221 | * Note that we don't actually remove it, since we have given out |
@@ -1195,19 +1223,22 @@ int prom_remove_property(struct device_node *np, struct property *prop) | |||
1195 | * Instead we just move the property to the "dead properties" list, | 1223 | * Instead we just move the property to the "dead properties" list, |
1196 | * and add the new property to the property list | 1224 | * and add the new property to the property list |
1197 | */ | 1225 | */ |
1198 | int prom_update_property(struct device_node *np, | 1226 | int of_update_property(struct device_node *np, struct property *newprop) |
1199 | struct property *newprop) | ||
1200 | { | 1227 | { |
1201 | struct property **next, *oldprop; | 1228 | struct property **next, *oldprop; |
1202 | unsigned long flags; | 1229 | unsigned long flags; |
1203 | int found = 0; | 1230 | int rc, found = 0; |
1231 | |||
1232 | rc = of_property_notify(OF_RECONFIG_UPDATE_PROPERTY, np, newprop); | ||
1233 | if (rc) | ||
1234 | return rc; | ||
1204 | 1235 | ||
1205 | if (!newprop->name) | 1236 | if (!newprop->name) |
1206 | return -EINVAL; | 1237 | return -EINVAL; |
1207 | 1238 | ||
1208 | oldprop = of_find_property(np, newprop->name, NULL); | 1239 | oldprop = of_find_property(np, newprop->name, NULL); |
1209 | if (!oldprop) | 1240 | if (!oldprop) |
1210 | return prom_add_property(np, newprop); | 1241 | return of_add_property(np, newprop); |
1211 | 1242 | ||
1212 | write_lock_irqsave(&devtree_lock, flags); | 1243 | write_lock_irqsave(&devtree_lock, flags); |
1213 | next = &np->properties; | 1244 | next = &np->properties; |
@@ -1246,12 +1277,55 @@ int prom_update_property(struct device_node *np, | |||
1246 | * device tree nodes. | 1277 | * device tree nodes. |
1247 | */ | 1278 | */ |
1248 | 1279 | ||
1280 | static BLOCKING_NOTIFIER_HEAD(of_reconfig_chain); | ||
1281 | |||
1282 | int of_reconfig_notifier_register(struct notifier_block *nb) | ||
1283 | { | ||
1284 | return blocking_notifier_chain_register(&of_reconfig_chain, nb); | ||
1285 | } | ||
1286 | EXPORT_SYMBOL_GPL(of_reconfig_notifier_register); | ||
1287 | |||
1288 | int of_reconfig_notifier_unregister(struct notifier_block *nb) | ||
1289 | { | ||
1290 | return blocking_notifier_chain_unregister(&of_reconfig_chain, nb); | ||
1291 | } | ||
1292 | EXPORT_SYMBOL_GPL(of_reconfig_notifier_unregister); | ||
1293 | |||
1294 | int of_reconfig_notify(unsigned long action, void *p) | ||
1295 | { | ||
1296 | int rc; | ||
1297 | |||
1298 | rc = blocking_notifier_call_chain(&of_reconfig_chain, action, p); | ||
1299 | return notifier_to_errno(rc); | ||
1300 | } | ||
1301 | |||
1302 | #ifdef CONFIG_PROC_DEVICETREE | ||
1303 | static void of_add_proc_dt_entry(struct device_node *dn) | ||
1304 | { | ||
1305 | struct proc_dir_entry *ent; | ||
1306 | |||
1307 | ent = proc_mkdir(strrchr(dn->full_name, '/') + 1, dn->parent->pde); | ||
1308 | if (ent) | ||
1309 | proc_device_tree_add_node(dn, ent); | ||
1310 | } | ||
1311 | #else | ||
1312 | static void of_add_proc_dt_entry(struct device_node *dn) | ||
1313 | { | ||
1314 | return; | ||
1315 | } | ||
1316 | #endif | ||
1317 | |||
1249 | /** | 1318 | /** |
1250 | * of_attach_node - Plug a device node into the tree and global list. | 1319 | * of_attach_node - Plug a device node into the tree and global list. |
1251 | */ | 1320 | */ |
1252 | void of_attach_node(struct device_node *np) | 1321 | int of_attach_node(struct device_node *np) |
1253 | { | 1322 | { |
1254 | unsigned long flags; | 1323 | unsigned long flags; |
1324 | int rc; | ||
1325 | |||
1326 | rc = of_reconfig_notify(OF_RECONFIG_ATTACH_NODE, np); | ||
1327 | if (rc) | ||
1328 | return rc; | ||
1255 | 1329 | ||
1256 | write_lock_irqsave(&devtree_lock, flags); | 1330 | write_lock_irqsave(&devtree_lock, flags); |
1257 | np->sibling = np->parent->child; | 1331 | np->sibling = np->parent->child; |
@@ -1259,24 +1333,61 @@ void of_attach_node(struct device_node *np) | |||
1259 | np->parent->child = np; | 1333 | np->parent->child = np; |
1260 | of_allnodes = np; | 1334 | of_allnodes = np; |
1261 | write_unlock_irqrestore(&devtree_lock, flags); | 1335 | write_unlock_irqrestore(&devtree_lock, flags); |
1336 | |||
1337 | of_add_proc_dt_entry(np); | ||
1338 | return 0; | ||
1262 | } | 1339 | } |
1263 | 1340 | ||
1341 | #ifdef CONFIG_PROC_DEVICETREE | ||
1342 | static void of_remove_proc_dt_entry(struct device_node *dn) | ||
1343 | { | ||
1344 | struct device_node *parent = dn->parent; | ||
1345 | struct property *prop = dn->properties; | ||
1346 | |||
1347 | while (prop) { | ||
1348 | remove_proc_entry(prop->name, dn->pde); | ||
1349 | prop = prop->next; | ||
1350 | } | ||
1351 | |||
1352 | if (dn->pde) | ||
1353 | remove_proc_entry(dn->pde->name, parent->pde); | ||
1354 | } | ||
1355 | #else | ||
1356 | static void of_remove_proc_dt_entry(struct device_node *dn) | ||
1357 | { | ||
1358 | return; | ||
1359 | } | ||
1360 | #endif | ||
1361 | |||
1264 | /** | 1362 | /** |
1265 | * of_detach_node - "Unplug" a node from the device tree. | 1363 | * of_detach_node - "Unplug" a node from the device tree. |
1266 | * | 1364 | * |
1267 | * The caller must hold a reference to the node. The memory associated with | 1365 | * The caller must hold a reference to the node. The memory associated with |
1268 | * the node is not freed until its refcount goes to zero. | 1366 | * the node is not freed until its refcount goes to zero. |
1269 | */ | 1367 | */ |
1270 | void of_detach_node(struct device_node *np) | 1368 | int of_detach_node(struct device_node *np) |
1271 | { | 1369 | { |
1272 | struct device_node *parent; | 1370 | struct device_node *parent; |
1273 | unsigned long flags; | 1371 | unsigned long flags; |
1372 | int rc = 0; | ||
1373 | |||
1374 | rc = of_reconfig_notify(OF_RECONFIG_DETACH_NODE, np); | ||
1375 | if (rc) | ||
1376 | return rc; | ||
1274 | 1377 | ||
1275 | write_lock_irqsave(&devtree_lock, flags); | 1378 | write_lock_irqsave(&devtree_lock, flags); |
1276 | 1379 | ||
1380 | if (of_node_check_flag(np, OF_DETACHED)) { | ||
1381 | /* someone already detached it */ | ||
1382 | write_unlock_irqrestore(&devtree_lock, flags); | ||
1383 | return rc; | ||
1384 | } | ||
1385 | |||
1277 | parent = np->parent; | 1386 | parent = np->parent; |
1278 | if (!parent) | 1387 | if (!parent) { |
1279 | goto out_unlock; | 1388 | write_unlock_irqrestore(&devtree_lock, flags); |
1389 | return rc; | ||
1390 | } | ||
1280 | 1391 | ||
1281 | if (of_allnodes == np) | 1392 | if (of_allnodes == np) |
1282 | of_allnodes = np->allnext; | 1393 | of_allnodes = np->allnext; |
@@ -1301,9 +1412,10 @@ void of_detach_node(struct device_node *np) | |||
1301 | } | 1412 | } |
1302 | 1413 | ||
1303 | of_node_set_flag(np, OF_DETACHED); | 1414 | of_node_set_flag(np, OF_DETACHED); |
1304 | |||
1305 | out_unlock: | ||
1306 | write_unlock_irqrestore(&devtree_lock, flags); | 1415 | write_unlock_irqrestore(&devtree_lock, flags); |
1416 | |||
1417 | of_remove_proc_dt_entry(np); | ||
1418 | return rc; | ||
1307 | } | 1419 | } |
1308 | #endif /* defined(CONFIG_OF_DYNAMIC) */ | 1420 | #endif /* defined(CONFIG_OF_DYNAMIC) */ |
1309 | 1421 | ||
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 9c31277b3a81..e7068c508800 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -2140,14 +2140,16 @@ config FB_UDL | |||
2140 | To compile as a module, choose M here: the module name is udlfb. | 2140 | To compile as a module, choose M here: the module name is udlfb. |
2141 | 2141 | ||
2142 | config FB_IBM_GXT4500 | 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 | depends on FB && PPC | 2144 | depends on FB && PPC |
2145 | select FB_CFB_FILLRECT | 2145 | select FB_CFB_FILLRECT |
2146 | select FB_CFB_COPYAREA | 2146 | select FB_CFB_COPYAREA |
2147 | select FB_CFB_IMAGEBLIT | 2147 | select FB_CFB_IMAGEBLIT |
2148 | ---help--- | 2148 | ---help--- |
2149 | Say Y here to enable support for the IBM GXT4500P display | 2149 | Say Y here to enable support for the IBM GXT4000P/6000P and |
2150 | adaptor, found on some IBM System P (pSeries) machines. | 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 | config FB_PS3 | 2154 | config FB_PS3 |
2153 | tristate "PS3 GPU framebuffer driver" | 2155 | tristate "PS3 GPU framebuffer driver" |
diff --git a/drivers/video/gxt4500.c b/drivers/video/gxt4500.c index 0e9afa41d163..4bdea6e9bd55 100644 --- a/drivers/video/gxt4500.c +++ b/drivers/video/gxt4500.c | |||
@@ -1,5 +1,6 @@ | |||
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 | * Copyright (C) 2006 Paul Mackerras, IBM Corp. <paulus@samba.org> | 5 | * Copyright (C) 2006 Paul Mackerras, IBM Corp. <paulus@samba.org> |
5 | */ | 6 | */ |
@@ -14,6 +15,8 @@ | |||
14 | #include <linux/string.h> | 15 | #include <linux/string.h> |
15 | 16 | ||
16 | #define PCI_DEVICE_ID_IBM_GXT4500P 0x21c | 17 | #define PCI_DEVICE_ID_IBM_GXT4500P 0x21c |
18 | #define PCI_DEVICE_ID_IBM_GXT6500P 0x21b | ||
19 | #define PCI_DEVICE_ID_IBM_GXT4000P 0x16e | ||
17 | #define PCI_DEVICE_ID_IBM_GXT6000P 0x170 | 20 | #define PCI_DEVICE_ID_IBM_GXT6000P 0x170 |
18 | 21 | ||
19 | /* GXT4500P registers */ | 22 | /* GXT4500P registers */ |
@@ -173,6 +176,8 @@ static const struct fb_videomode defaultmode __devinitconst = { | |||
173 | /* List of supported cards */ | 176 | /* List of supported cards */ |
174 | enum gxt_cards { | 177 | enum gxt_cards { |
175 | GXT4500P, | 178 | GXT4500P, |
179 | GXT6500P, | ||
180 | GXT4000P, | ||
176 | GXT6000P | 181 | GXT6000P |
177 | }; | 182 | }; |
178 | 183 | ||
@@ -182,6 +187,8 @@ static const struct cardinfo { | |||
182 | const char *cardname; | 187 | const char *cardname; |
183 | } cardinfo[] = { | 188 | } cardinfo[] = { |
184 | [GXT4500P] = { .refclk_ps = 9259, .cardname = "IBM GXT4500P" }, | 189 | [GXT4500P] = { .refclk_ps = 9259, .cardname = "IBM GXT4500P" }, |
190 | [GXT6500P] = { .refclk_ps = 9259, .cardname = "IBM GXT6500P" }, | ||
191 | [GXT4000P] = { .refclk_ps = 40000, .cardname = "IBM GXT4000P" }, | ||
185 | [GXT6000P] = { .refclk_ps = 40000, .cardname = "IBM GXT6000P" }, | 192 | [GXT6000P] = { .refclk_ps = 40000, .cardname = "IBM GXT6000P" }, |
186 | }; | 193 | }; |
187 | 194 | ||
@@ -736,6 +743,10 @@ static void __devexit gxt4500_remove(struct pci_dev *pdev) | |||
736 | static const struct pci_device_id gxt4500_pci_tbl[] = { | 743 | static const struct pci_device_id gxt4500_pci_tbl[] = { |
737 | { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4500P), | 744 | { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4500P), |
738 | .driver_data = GXT4500P }, | 745 | .driver_data = GXT4500P }, |
746 | { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6500P), | ||
747 | .driver_data = GXT6500P }, | ||
748 | { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT4000P), | ||
749 | .driver_data = GXT4000P }, | ||
739 | { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6000P), | 750 | { PCI_DEVICE(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_GXT6000P), |
740 | .driver_data = GXT6000P }, | 751 | .driver_data = GXT6000P }, |
741 | { 0 } | 752 | { 0 } |
@@ -768,7 +779,7 @@ static void __exit gxt4500_exit(void) | |||
768 | module_exit(gxt4500_exit); | 779 | module_exit(gxt4500_exit); |
769 | 780 | ||
770 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); | 781 | MODULE_AUTHOR("Paul Mackerras <paulus@samba.org>"); |
771 | MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6000P"); | 782 | MODULE_DESCRIPTION("FBDev driver for IBM GXT4500P/6500P and GXT4000P/6000P"); |
772 | MODULE_LICENSE("GPL"); | 783 | MODULE_LICENSE("GPL"); |
773 | module_param(mode_option, charp, 0); | 784 | module_param(mode_option, charp, 0); |
774 | MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\""); | 785 | MODULE_PARM_DESC(mode_option, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\""); |
diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c index 4939e0ccc4e5..d294f67d6f84 100644 --- a/drivers/virt/fsl_hypervisor.c +++ b/drivers/virt/fsl_hypervisor.c | |||
@@ -796,9 +796,6 @@ static int has_fsl_hypervisor(void) | |||
796 | struct device_node *node; | 796 | struct device_node *node; |
797 | int ret; | 797 | int ret; |
798 | 798 | ||
799 | if (!(mfmsr() & MSR_GS)) | ||
800 | return 0; | ||
801 | |||
802 | node = of_find_node_by_path("/hypervisor"); | 799 | node = of_find_node_by_path("/hypervisor"); |
803 | if (!node) | 800 | if (!node) |
804 | return 0; | 801 | return 0; |
diff --git a/include/linux/of.h b/include/linux/of.h index 6cfea9aa401f..5ebcc5c8e423 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/mod_devicetable.h> | 22 | #include <linux/mod_devicetable.h> |
23 | #include <linux/spinlock.h> | 23 | #include <linux/spinlock.h> |
24 | #include <linux/topology.h> | 24 | #include <linux/topology.h> |
25 | #include <linux/notifier.h> | ||
25 | 26 | ||
26 | #include <asm/byteorder.h> | 27 | #include <asm/byteorder.h> |
27 | #include <asm/errno.h> | 28 | #include <asm/errno.h> |
@@ -282,16 +283,28 @@ extern int of_alias_get_id(struct device_node *np, const char *stem); | |||
282 | 283 | ||
283 | extern int of_machine_is_compatible(const char *compat); | 284 | extern int of_machine_is_compatible(const char *compat); |
284 | 285 | ||
285 | extern int prom_add_property(struct device_node* np, struct property* prop); | 286 | extern int of_add_property(struct device_node *np, struct property *prop); |
286 | extern int prom_remove_property(struct device_node *np, struct property *prop); | 287 | extern int of_remove_property(struct device_node *np, struct property *prop); |
287 | extern int prom_update_property(struct device_node *np, | 288 | extern int of_update_property(struct device_node *np, struct property *newprop); |
288 | struct property *newprop); | ||
289 | 289 | ||
290 | #if defined(CONFIG_OF_DYNAMIC) | ||
291 | /* For updating the device tree at runtime */ | 290 | /* For updating the device tree at runtime */ |
292 | extern void of_attach_node(struct device_node *); | 291 | #define OF_RECONFIG_ATTACH_NODE 0x0001 |
293 | extern void of_detach_node(struct device_node *); | 292 | #define OF_RECONFIG_DETACH_NODE 0x0002 |
294 | #endif | 293 | #define OF_RECONFIG_ADD_PROPERTY 0x0003 |
294 | #define OF_RECONFIG_REMOVE_PROPERTY 0x0004 | ||
295 | #define OF_RECONFIG_UPDATE_PROPERTY 0x0005 | ||
296 | |||
297 | struct of_prop_reconfig { | ||
298 | struct device_node *dn; | ||
299 | struct property *prop; | ||
300 | }; | ||
301 | |||
302 | extern int of_reconfig_notifier_register(struct notifier_block *); | ||
303 | extern int of_reconfig_notifier_unregister(struct notifier_block *); | ||
304 | extern int of_reconfig_notify(unsigned long, void *); | ||
305 | |||
306 | extern int of_attach_node(struct device_node *); | ||
307 | extern int of_detach_node(struct device_node *); | ||
295 | 308 | ||
296 | #define of_match_ptr(_ptr) (_ptr) | 309 | #define of_match_ptr(_ptr) (_ptr) |
297 | 310 | ||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e458782f3c52..3a353091a903 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -1192,14 +1192,14 @@ config MEMORY_NOTIFIER_ERROR_INJECT | |||
1192 | 1192 | ||
1193 | If unsure, say N. | 1193 | If unsure, say N. |
1194 | 1194 | ||
1195 | config PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT | 1195 | config OF_RECONFIG_NOTIFIER_ERROR_INJECT |
1196 | tristate "pSeries reconfig notifier error injection module" | 1196 | tristate "OF reconfig notifier error injection module" |
1197 | depends on PPC_PSERIES && NOTIFIER_ERROR_INJECTION | 1197 | depends on OF_DYNAMIC && NOTIFIER_ERROR_INJECTION |
1198 | help | 1198 | help |
1199 | This option provides the ability to inject artificial errors to | 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 | through debugfs interface under | 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 | If the notifier call chain should be failed with some events | 1204 | If the notifier call chain should be failed with some events |
1205 | notified, write the error code to "actions/<notifier event>/error". | 1205 | notified, write the error code to "actions/<notifier event>/error". |
diff --git a/lib/Makefile b/lib/Makefile index 5558e35170cd..02ed6c04cd7d 100644 --- a/lib/Makefile +++ b/lib/Makefile | |||
@@ -95,8 +95,8 @@ obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o | |||
95 | obj-$(CONFIG_CPU_NOTIFIER_ERROR_INJECT) += cpu-notifier-error-inject.o | 95 | obj-$(CONFIG_CPU_NOTIFIER_ERROR_INJECT) += cpu-notifier-error-inject.o |
96 | obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o | 96 | obj-$(CONFIG_PM_NOTIFIER_ERROR_INJECT) += pm-notifier-error-inject.o |
97 | obj-$(CONFIG_MEMORY_NOTIFIER_ERROR_INJECT) += memory-notifier-error-inject.o | 97 | obj-$(CONFIG_MEMORY_NOTIFIER_ERROR_INJECT) += memory-notifier-error-inject.o |
98 | obj-$(CONFIG_PSERIES_RECONFIG_NOTIFIER_ERROR_INJECT) += \ | 98 | obj-$(CONFIG_OF_RECONFIG_NOTIFIER_ERROR_INJECT) += \ |
99 | pSeries-reconfig-notifier-error-inject.o | 99 | of-reconfig-notifier-error-inject.o |
100 | 100 | ||
101 | lib-$(CONFIG_GENERIC_BUG) += bug.o | 101 | lib-$(CONFIG_GENERIC_BUG) += bug.o |
102 | 102 | ||
diff --git a/lib/pSeries-reconfig-notifier-error-inject.c b/lib/of-reconfig-notifier-error-inject.c index 7f7c98dcd5c4..8dc79861758a 100644 --- a/lib/pSeries-reconfig-notifier-error-inject.c +++ b/lib/of-reconfig-notifier-error-inject.c | |||
@@ -1,20 +1,20 @@ | |||
1 | #include <linux/kernel.h> | 1 | #include <linux/kernel.h> |
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | 3 | #include <linux/of.h> | |
4 | #include <asm/pSeries_reconfig.h> | ||
5 | 4 | ||
6 | #include "notifier-error-inject.h" | 5 | #include "notifier-error-inject.h" |
7 | 6 | ||
8 | static int priority; | 7 | static int priority; |
9 | module_param(priority, int, 0); | 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 | static struct notifier_err_inject reconfig_err_inject = { | 11 | static struct notifier_err_inject reconfig_err_inject = { |
13 | .actions = { | 12 | .actions = { |
14 | { NOTIFIER_ERR_INJECT_ACTION(PSERIES_RECONFIG_ADD) }, | 13 | { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ATTACH_NODE) }, |
15 | { NOTIFIER_ERR_INJECT_ACTION(PSERIES_RECONFIG_REMOVE) }, | 14 | { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_DETACH_NODE) }, |
16 | { NOTIFIER_ERR_INJECT_ACTION(PSERIES_DRCONF_MEM_ADD) }, | 15 | { NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ADD_PROPERTY) }, |
17 | { NOTIFIER_ERR_INJECT_ACTION(PSERIES_DRCONF_MEM_REMOVE) }, | 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,12 +25,12 @@ static int err_inject_init(void) | |||
25 | { | 25 | { |
26 | int err; | 26 | int err; |
27 | 27 | ||
28 | dir = notifier_err_inject_init("pSeries-reconfig", | 28 | dir = notifier_err_inject_init("OF-reconfig", |
29 | notifier_err_inject_dir, &reconfig_err_inject, priority); | 29 | notifier_err_inject_dir, &reconfig_err_inject, priority); |
30 | if (IS_ERR(dir)) | 30 | if (IS_ERR(dir)) |
31 | return PTR_ERR(dir); | 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 | if (err) | 34 | if (err) |
35 | debugfs_remove_recursive(dir); | 35 | debugfs_remove_recursive(dir); |
36 | 36 | ||
@@ -39,13 +39,13 @@ static int err_inject_init(void) | |||
39 | 39 | ||
40 | static void err_inject_exit(void) | 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 | debugfs_remove_recursive(dir); | 43 | debugfs_remove_recursive(dir); |
44 | } | 44 | } |
45 | 45 | ||
46 | module_init(err_inject_init); | 46 | module_init(err_inject_init); |
47 | module_exit(err_inject_exit); | 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 | MODULE_LICENSE("GPL"); | 50 | MODULE_LICENSE("GPL"); |
51 | MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>"); | 51 | MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>"); |