diff options
Diffstat (limited to 'arch')
251 files changed, 2541 insertions, 1114 deletions
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index 4567aca6fdd6..dfa32f061320 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h | |||
@@ -12,16 +12,22 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
12 | 12 | ||
13 | #include <asm-generic/dma-mapping-common.h> | 13 | #include <asm-generic/dma-mapping-common.h> |
14 | 14 | ||
15 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 15 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
16 | dma_addr_t *dma_handle, gfp_t gfp) | 16 | |
17 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
18 | dma_addr_t *dma_handle, gfp_t gfp, | ||
19 | struct dma_attrs *attrs) | ||
17 | { | 20 | { |
18 | return get_dma_ops(dev)->alloc_coherent(dev, size, dma_handle, gfp); | 21 | return get_dma_ops(dev)->alloc(dev, size, dma_handle, gfp, attrs); |
19 | } | 22 | } |
20 | 23 | ||
21 | static inline void dma_free_coherent(struct device *dev, size_t size, | 24 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
22 | void *vaddr, dma_addr_t dma_handle) | 25 | |
26 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
27 | void *vaddr, dma_addr_t dma_handle, | ||
28 | struct dma_attrs *attrs) | ||
23 | { | 29 | { |
24 | get_dma_ops(dev)->free_coherent(dev, size, vaddr, dma_handle); | 30 | get_dma_ops(dev)->free(dev, size, vaddr, dma_handle, attrs); |
25 | } | 31 | } |
26 | 32 | ||
27 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 33 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index 04eea4894ef3..df24b76f9246 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c | |||
@@ -108,7 +108,8 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn, | |||
108 | } | 108 | } |
109 | 109 | ||
110 | static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, | 110 | static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, |
111 | dma_addr_t *dma_handle, gfp_t gfp) | 111 | dma_addr_t *dma_handle, gfp_t gfp, |
112 | struct dma_attrs *attrs) | ||
112 | { | 113 | { |
113 | void *ret; | 114 | void *ret; |
114 | 115 | ||
@@ -123,7 +124,8 @@ static void *alpha_noop_alloc_coherent(struct device *dev, size_t size, | |||
123 | } | 124 | } |
124 | 125 | ||
125 | static void alpha_noop_free_coherent(struct device *dev, size_t size, | 126 | static void alpha_noop_free_coherent(struct device *dev, size_t size, |
126 | void *cpu_addr, dma_addr_t dma_addr) | 127 | void *cpu_addr, dma_addr_t dma_addr, |
128 | struct dma_attrs *attrs) | ||
127 | { | 129 | { |
128 | free_pages((unsigned long)cpu_addr, get_order(size)); | 130 | free_pages((unsigned long)cpu_addr, get_order(size)); |
129 | } | 131 | } |
@@ -174,8 +176,8 @@ static int alpha_noop_set_mask(struct device *dev, u64 mask) | |||
174 | } | 176 | } |
175 | 177 | ||
176 | struct dma_map_ops alpha_noop_ops = { | 178 | struct dma_map_ops alpha_noop_ops = { |
177 | .alloc_coherent = alpha_noop_alloc_coherent, | 179 | .alloc = alpha_noop_alloc_coherent, |
178 | .free_coherent = alpha_noop_free_coherent, | 180 | .free = alpha_noop_free_coherent, |
179 | .map_page = alpha_noop_map_page, | 181 | .map_page = alpha_noop_map_page, |
180 | .map_sg = alpha_noop_map_sg, | 182 | .map_sg = alpha_noop_map_sg, |
181 | .mapping_error = alpha_noop_mapping_error, | 183 | .mapping_error = alpha_noop_mapping_error, |
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 43610804987d..cd634795aa9c 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -434,7 +434,8 @@ static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
434 | else DMA_ADDRP is undefined. */ | 434 | else DMA_ADDRP is undefined. */ |
435 | 435 | ||
436 | static void *alpha_pci_alloc_coherent(struct device *dev, size_t size, | 436 | static void *alpha_pci_alloc_coherent(struct device *dev, size_t size, |
437 | dma_addr_t *dma_addrp, gfp_t gfp) | 437 | dma_addr_t *dma_addrp, gfp_t gfp, |
438 | struct dma_attrs *attrs) | ||
438 | { | 439 | { |
439 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | 440 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); |
440 | void *cpu_addr; | 441 | void *cpu_addr; |
@@ -478,7 +479,8 @@ try_again: | |||
478 | DMA_ADDR past this call are illegal. */ | 479 | DMA_ADDR past this call are illegal. */ |
479 | 480 | ||
480 | static void alpha_pci_free_coherent(struct device *dev, size_t size, | 481 | static void alpha_pci_free_coherent(struct device *dev, size_t size, |
481 | void *cpu_addr, dma_addr_t dma_addr) | 482 | void *cpu_addr, dma_addr_t dma_addr, |
483 | struct dma_attrs *attrs) | ||
482 | { | 484 | { |
483 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); | 485 | struct pci_dev *pdev = alpha_gendev_to_pci(dev); |
484 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); | 486 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); |
@@ -952,8 +954,8 @@ static int alpha_pci_set_mask(struct device *dev, u64 mask) | |||
952 | } | 954 | } |
953 | 955 | ||
954 | struct dma_map_ops alpha_pci_ops = { | 956 | struct dma_map_ops alpha_pci_ops = { |
955 | .alloc_coherent = alpha_pci_alloc_coherent, | 957 | .alloc = alpha_pci_alloc_coherent, |
956 | .free_coherent = alpha_pci_free_coherent, | 958 | .free = alpha_pci_free_coherent, |
957 | .map_page = alpha_pci_map_page, | 959 | .map_page = alpha_pci_map_page, |
958 | .unmap_page = alpha_pci_unmap_page, | 960 | .unmap_page = alpha_pci_unmap_page, |
959 | .map_sg = alpha_pci_map_sg, | 961 | .map_sg = alpha_pci_map_sg, |
diff --git a/arch/alpha/kernel/signal.c b/arch/alpha/kernel/signal.c index 6f7feb5db271..35f2ef44de12 100644 --- a/arch/alpha/kernel/signal.c +++ b/arch/alpha/kernel/signal.c | |||
@@ -120,12 +120,13 @@ SYSCALL_DEFINE5(rt_sigaction, int, sig, const struct sigaction __user *, act, | |||
120 | */ | 120 | */ |
121 | SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) | 121 | SYSCALL_DEFINE1(sigsuspend, old_sigset_t, mask) |
122 | { | 122 | { |
123 | mask &= _BLOCKABLE; | 123 | sigset_t blocked; |
124 | spin_lock_irq(¤t->sighand->siglock); | 124 | |
125 | current->saved_sigmask = current->blocked; | 125 | current->saved_sigmask = current->blocked; |
126 | siginitset(¤t->blocked, mask); | 126 | |
127 | recalc_sigpending(); | 127 | mask &= _BLOCKABLE; |
128 | spin_unlock_irq(¤t->sighand->siglock); | 128 | siginitset(&blocked, mask); |
129 | set_current_blocked(&blocked); | ||
129 | 130 | ||
130 | current->state = TASK_INTERRUPTIBLE; | 131 | current->state = TASK_INTERRUPTIBLE; |
131 | schedule(); | 132 | schedule(); |
@@ -238,10 +239,7 @@ do_sigreturn(struct sigcontext __user *sc, struct pt_regs *regs, | |||
238 | goto give_sigsegv; | 239 | goto give_sigsegv; |
239 | 240 | ||
240 | sigdelsetmask(&set, ~_BLOCKABLE); | 241 | sigdelsetmask(&set, ~_BLOCKABLE); |
241 | spin_lock_irq(¤t->sighand->siglock); | 242 | set_current_blocked(&set); |
242 | current->blocked = set; | ||
243 | recalc_sigpending(); | ||
244 | spin_unlock_irq(¤t->sighand->siglock); | ||
245 | 243 | ||
246 | if (restore_sigcontext(sc, regs, sw)) | 244 | if (restore_sigcontext(sc, regs, sw)) |
247 | goto give_sigsegv; | 245 | goto give_sigsegv; |
@@ -276,10 +274,7 @@ do_rt_sigreturn(struct rt_sigframe __user *frame, struct pt_regs *regs, | |||
276 | goto give_sigsegv; | 274 | goto give_sigsegv; |
277 | 275 | ||
278 | sigdelsetmask(&set, ~_BLOCKABLE); | 276 | sigdelsetmask(&set, ~_BLOCKABLE); |
279 | spin_lock_irq(¤t->sighand->siglock); | 277 | set_current_blocked(&set); |
280 | current->blocked = set; | ||
281 | recalc_sigpending(); | ||
282 | spin_unlock_irq(¤t->sighand->siglock); | ||
283 | 278 | ||
284 | if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw)) | 279 | if (restore_sigcontext(&frame->uc.uc_mcontext, regs, sw)) |
285 | goto give_sigsegv; | 280 | goto give_sigsegv; |
@@ -501,14 +496,8 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
501 | else | 496 | else |
502 | ret = setup_frame(sig, ka, oldset, regs, sw); | 497 | ret = setup_frame(sig, ka, oldset, regs, sw); |
503 | 498 | ||
504 | if (ret == 0) { | 499 | if (ret == 0) |
505 | spin_lock_irq(¤t->sighand->siglock); | 500 | block_sigmask(ka, sig); |
506 | sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); | ||
507 | if (!(ka->sa.sa_flags & SA_NODEFER)) | ||
508 | sigaddset(¤t->blocked,sig); | ||
509 | recalc_sigpending(); | ||
510 | spin_unlock_irq(¤t->sighand->siglock); | ||
511 | } | ||
512 | 501 | ||
513 | return ret; | 502 | return ret; |
514 | } | 503 | } |
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 4087a569b43b..50d438db1f6b 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -450,7 +450,7 @@ setup_smp(void) | |||
450 | smp_num_probed = 1; | 450 | smp_num_probed = 1; |
451 | } | 451 | } |
452 | 452 | ||
453 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_map = %lx\n", | 453 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", |
454 | smp_num_probed, cpumask_bits(cpu_present_mask)[0]); | 454 | smp_num_probed, cpumask_bits(cpu_present_mask)[0]); |
455 | } | 455 | } |
456 | 456 | ||
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 93180845ae16..cf006d40342c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -338,6 +338,7 @@ config ARCH_AT91 | |||
338 | select HAVE_CLK | 338 | select HAVE_CLK |
339 | select CLKDEV_LOOKUP | 339 | select CLKDEV_LOOKUP |
340 | select IRQ_DOMAIN | 340 | select IRQ_DOMAIN |
341 | select NEED_MACH_IO_H if PCCARD | ||
341 | help | 342 | help |
342 | This enables support for systems based on the Atmel AT91RM9200, | 343 | This enables support for systems based on the Atmel AT91RM9200, |
343 | AT91SAM9 processors. | 344 | AT91SAM9 processors. |
diff --git a/arch/arm/boot/dts/at91sam9g20.dtsi b/arch/arm/boot/dts/at91sam9g20.dtsi index 92f36627e7f8..799ad1889b51 100644 --- a/arch/arm/boot/dts/at91sam9g20.dtsi +++ b/arch/arm/boot/dts/at91sam9g20.dtsi | |||
@@ -35,7 +35,7 @@ | |||
35 | }; | 35 | }; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | memory@20000000 { | 38 | memory { |
39 | reg = <0x20000000 0x08000000>; | 39 | reg = <0x20000000 0x08000000>; |
40 | }; | 40 | }; |
41 | 41 | ||
diff --git a/arch/arm/boot/dts/at91sam9g25ek.dts b/arch/arm/boot/dts/at91sam9g25ek.dts index ac0dc0031dda..7829a4d0cb22 100644 --- a/arch/arm/boot/dts/at91sam9g25ek.dts +++ b/arch/arm/boot/dts/at91sam9g25ek.dts | |||
@@ -37,8 +37,8 @@ | |||
37 | usb0: ohci@00600000 { | 37 | usb0: ohci@00600000 { |
38 | status = "okay"; | 38 | status = "okay"; |
39 | num-ports = <2>; | 39 | num-ports = <2>; |
40 | atmel,vbus-gpio = <&pioD 19 0 | 40 | atmel,vbus-gpio = <&pioD 19 1 |
41 | &pioD 20 0 | 41 | &pioD 20 1 |
42 | >; | 42 | >; |
43 | }; | 43 | }; |
44 | 44 | ||
diff --git a/arch/arm/boot/dts/at91sam9g45.dtsi b/arch/arm/boot/dts/at91sam9g45.dtsi index 3d0c32fb218f..9e6eb6ecea0e 100644 --- a/arch/arm/boot/dts/at91sam9g45.dtsi +++ b/arch/arm/boot/dts/at91sam9g45.dtsi | |||
@@ -36,7 +36,7 @@ | |||
36 | }; | 36 | }; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | memory@70000000 { | 39 | memory { |
40 | reg = <0x70000000 0x10000000>; | 40 | reg = <0x70000000 0x10000000>; |
41 | }; | 41 | }; |
42 | 42 | ||
diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts index c4c8ae4123d5..a3633bd13111 100644 --- a/arch/arm/boot/dts/at91sam9m10g45ek.dts +++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts | |||
@@ -17,7 +17,7 @@ | |||
17 | bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"; | 17 | bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"; |
18 | }; | 18 | }; |
19 | 19 | ||
20 | memory@70000000 { | 20 | memory { |
21 | reg = <0x70000000 0x4000000>; | 21 | reg = <0x70000000 0x4000000>; |
22 | }; | 22 | }; |
23 | 23 | ||
@@ -73,8 +73,8 @@ | |||
73 | usb0: ohci@00700000 { | 73 | usb0: ohci@00700000 { |
74 | status = "okay"; | 74 | status = "okay"; |
75 | num-ports = <2>; | 75 | num-ports = <2>; |
76 | atmel,vbus-gpio = <&pioD 1 0 | 76 | atmel,vbus-gpio = <&pioD 1 1 |
77 | &pioD 3 0>; | 77 | &pioD 3 1>; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | usb1: ehci@00800000 { | 80 | usb1: ehci@00800000 { |
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index c111001f254e..70ab3a4e026f 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi | |||
@@ -34,7 +34,7 @@ | |||
34 | }; | 34 | }; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | memory@20000000 { | 37 | memory { |
38 | reg = <0x20000000 0x10000000>; | 38 | reg = <0x20000000 0x10000000>; |
39 | }; | 39 | }; |
40 | 40 | ||
@@ -201,8 +201,8 @@ | |||
201 | >; | 201 | >; |
202 | atmel,nand-addr-offset = <21>; | 202 | atmel,nand-addr-offset = <21>; |
203 | atmel,nand-cmd-offset = <22>; | 203 | atmel,nand-cmd-offset = <22>; |
204 | gpios = <&pioC 8 0 | 204 | gpios = <&pioD 5 0 |
205 | &pioC 14 0 | 205 | &pioD 4 0 |
206 | 0 | 206 | 0 |
207 | >; | 207 | >; |
208 | status = "disabled"; | 208 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/at91sam9x5cm.dtsi b/arch/arm/boot/dts/at91sam9x5cm.dtsi index 67936f83c694..31e7be23703d 100644 --- a/arch/arm/boot/dts/at91sam9x5cm.dtsi +++ b/arch/arm/boot/dts/at91sam9x5cm.dtsi | |||
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | / { | 10 | / { |
11 | memory@20000000 { | 11 | memory { |
12 | reg = <0x20000000 0x8000000>; | 12 | reg = <0x20000000 0x8000000>; |
13 | }; | 13 | }; |
14 | 14 | ||
diff --git a/arch/arm/boot/dts/usb_a9g20.dts b/arch/arm/boot/dts/usb_a9g20.dts index 3b3c4e0fa79f..7c2399c532e5 100644 --- a/arch/arm/boot/dts/usb_a9g20.dts +++ b/arch/arm/boot/dts/usb_a9g20.dts | |||
@@ -16,7 +16,7 @@ | |||
16 | bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs"; | 16 | bootargs = "mem=64M console=ttyS0,115200 root=/dev/mtdblock5 rw rootfstype=ubifs"; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | memory@20000000 { | 19 | memory { |
20 | reg = <0x20000000 0x4000000>; | 20 | reg = <0x20000000 0x4000000>; |
21 | }; | 21 | }; |
22 | 22 | ||
diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h index 44f4a09ff37b..05112380dc53 100644 --- a/arch/arm/include/asm/barrier.h +++ b/arch/arm/include/asm/barrier.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __ASM_BARRIER_H | 2 | #define __ASM_BARRIER_H |
3 | 3 | ||
4 | #ifndef __ASSEMBLY__ | 4 | #ifndef __ASSEMBLY__ |
5 | #include <asm/outercache.h> | ||
5 | 6 | ||
6 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); | 7 | #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); |
7 | 8 | ||
@@ -39,7 +40,6 @@ | |||
39 | #ifdef CONFIG_ARCH_HAS_BARRIERS | 40 | #ifdef CONFIG_ARCH_HAS_BARRIERS |
40 | #include <mach/barriers.h> | 41 | #include <mach/barriers.h> |
41 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) | 42 | #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) |
42 | #include <asm/outercache.h> | ||
43 | #define mb() do { dsb(); outer_sync(); } while (0) | 43 | #define mb() do { dsb(); outer_sync(); } while (0) |
44 | #define rmb() dsb() | 44 | #define rmb() dsb() |
45 | #define wmb() mb() | 45 | #define wmb() mb() |
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index df0ac0bb39aa..9af5563dd3eb 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -119,7 +119,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr) | |||
119 | #ifdef CONFIG_NEED_MACH_IO_H | 119 | #ifdef CONFIG_NEED_MACH_IO_H |
120 | #include <mach/io.h> | 120 | #include <mach/io.h> |
121 | #else | 121 | #else |
122 | #define __io(a) ({ (void)(a); __typesafe_io(0); }) | 122 | #define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT) |
123 | #endif | 123 | #endif |
124 | 124 | ||
125 | /* | 125 | /* |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 632df9a66f8c..ede5f7741c42 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -299,7 +299,6 @@ static inline int pdev_bad_for_parity(struct pci_dev *dev) | |||
299 | */ | 299 | */ |
300 | void pcibios_fixup_bus(struct pci_bus *bus) | 300 | void pcibios_fixup_bus(struct pci_bus *bus) |
301 | { | 301 | { |
302 | struct pci_sys_data *root = bus->sysdata; | ||
303 | struct pci_dev *dev; | 302 | struct pci_dev *dev; |
304 | u16 features = PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_FAST_BACK; | 303 | u16 features = PCI_COMMAND_SERR | PCI_COMMAND_PARITY | PCI_COMMAND_FAST_BACK; |
305 | 304 | ||
diff --git a/arch/arm/kernel/insn.c b/arch/arm/kernel/insn.c index ab312e516546..b760340b7014 100644 --- a/arch/arm/kernel/insn.c +++ b/arch/arm/kernel/insn.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <linux/bug.h> | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include <asm/opcodes.h> | 3 | #include <asm/opcodes.h> |
3 | 4 | ||
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c index ab1869dac97a..4dd41fc9e235 100644 --- a/arch/arm/kernel/kprobes.c +++ b/arch/arm/kernel/kprobes.c | |||
@@ -152,7 +152,7 @@ int __kprobes __arch_disarm_kprobe(void *p) | |||
152 | 152 | ||
153 | void __kprobes arch_disarm_kprobe(struct kprobe *p) | 153 | void __kprobes arch_disarm_kprobe(struct kprobe *p) |
154 | { | 154 | { |
155 | stop_machine(__arch_disarm_kprobe, p, &cpu_online_map); | 155 | stop_machine(__arch_disarm_kprobe, p, cpu_online_mask); |
156 | } | 156 | } |
157 | 157 | ||
158 | void __kprobes arch_remove_kprobe(struct kprobe *p) | 158 | void __kprobes arch_remove_kprobe(struct kprobe *p) |
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 45956c9d0ef0..80abafb9bf33 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -256,7 +256,7 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, | |||
256 | { | 256 | { |
257 | unsigned long tmp; | 257 | unsigned long tmp; |
258 | 258 | ||
259 | if (off & 3 || off >= sizeof(struct user)) | 259 | if (off & 3) |
260 | return -EIO; | 260 | return -EIO; |
261 | 261 | ||
262 | tmp = 0; | 262 | tmp = 0; |
@@ -268,6 +268,8 @@ static int ptrace_read_user(struct task_struct *tsk, unsigned long off, | |||
268 | tmp = tsk->mm->end_code; | 268 | tmp = tsk->mm->end_code; |
269 | else if (off < sizeof(struct pt_regs)) | 269 | else if (off < sizeof(struct pt_regs)) |
270 | tmp = get_user_reg(tsk, off >> 2); | 270 | tmp = get_user_reg(tsk, off >> 2); |
271 | else if (off >= sizeof(struct user)) | ||
272 | return -EIO; | ||
271 | 273 | ||
272 | return put_user(tmp, ret); | 274 | return put_user(tmp, ret); |
273 | } | 275 | } |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 2cee7d1eb958..addbbe8028c2 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -349,7 +349,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
349 | * re-initialize the map in platform_smp_prepare_cpus() if | 349 | * re-initialize the map in platform_smp_prepare_cpus() if |
350 | * present != possible (e.g. physical hotplug). | 350 | * present != possible (e.g. physical hotplug). |
351 | */ | 351 | */ |
352 | init_cpu_present(&cpu_possible_map); | 352 | init_cpu_present(cpu_possible_mask); |
353 | 353 | ||
354 | /* | 354 | /* |
355 | * Initialise the SCU if there are more than one CPU | 355 | * Initialise the SCU if there are more than one CPU |
@@ -581,8 +581,9 @@ void smp_send_stop(void) | |||
581 | unsigned long timeout; | 581 | unsigned long timeout; |
582 | 582 | ||
583 | if (num_online_cpus() > 1) { | 583 | if (num_online_cpus() > 1) { |
584 | cpumask_t mask = cpu_online_map; | 584 | struct cpumask mask; |
585 | cpu_clear(smp_processor_id(), mask); | 585 | cpumask_copy(&mask, cpu_online_mask); |
586 | cpumask_clear_cpu(smp_processor_id(), &mask); | ||
586 | 587 | ||
587 | smp_cross_call(&mask, IPI_CPU_STOP); | 588 | smp_cross_call(&mask, IPI_CPU_STOP); |
588 | } | 589 | } |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 7e5651ee9f85..5652dde4bbe2 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -598,6 +598,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
598 | else | 598 | else |
599 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 599 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
600 | 600 | ||
601 | if (!gpio_is_valid(cs_pin)) | ||
602 | continue; | ||
603 | |||
601 | if (devices[i].bus_num == 0) | 604 | if (devices[i].bus_num == 0) |
602 | enable_spi0 = 1; | 605 | enable_spi0 = 1; |
603 | else | 606 | else |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 096da87dc00d..4db961a93085 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -415,6 +415,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
415 | else | 415 | else |
416 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 416 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
417 | 417 | ||
418 | if (!gpio_is_valid(cs_pin)) | ||
419 | continue; | ||
420 | |||
418 | if (devices[i].bus_num == 0) | 421 | if (devices[i].bus_num == 0) |
419 | enable_spi0 = 1; | 422 | enable_spi0 = 1; |
420 | else | 423 | else |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 53688c46f956..fe99206de880 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -72,7 +72,8 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) | |||
72 | /* Enable VBus control for UHP ports */ | 72 | /* Enable VBus control for UHP ports */ |
73 | for (i = 0; i < data->ports; i++) { | 73 | for (i = 0; i < data->ports; i++) { |
74 | if (gpio_is_valid(data->vbus_pin[i])) | 74 | if (gpio_is_valid(data->vbus_pin[i])) |
75 | at91_set_gpio_output(data->vbus_pin[i], 0); | 75 | at91_set_gpio_output(data->vbus_pin[i], |
76 | data->vbus_pin_active_low[i]); | ||
76 | } | 77 | } |
77 | 78 | ||
78 | /* Enable overcurrent notification */ | 79 | /* Enable overcurrent notification */ |
@@ -671,6 +672,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
671 | else | 672 | else |
672 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 673 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
673 | 674 | ||
675 | if (!gpio_is_valid(cs_pin)) | ||
676 | continue; | ||
677 | |||
674 | if (devices[i].bus_num == 0) | 678 | if (devices[i].bus_num == 0) |
675 | enable_spi0 = 1; | 679 | enable_spi0 = 1; |
676 | else | 680 | else |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 698479f1e197..6b008aee1dff 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -127,12 +127,13 @@ void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data) | |||
127 | /* Enable VBus control for UHP ports */ | 127 | /* Enable VBus control for UHP ports */ |
128 | for (i = 0; i < data->ports; i++) { | 128 | for (i = 0; i < data->ports; i++) { |
129 | if (gpio_is_valid(data->vbus_pin[i])) | 129 | if (gpio_is_valid(data->vbus_pin[i])) |
130 | at91_set_gpio_output(data->vbus_pin[i], 0); | 130 | at91_set_gpio_output(data->vbus_pin[i], |
131 | data->vbus_pin_active_low[i]); | ||
131 | } | 132 | } |
132 | 133 | ||
133 | /* Enable overcurrent notification */ | 134 | /* Enable overcurrent notification */ |
134 | for (i = 0; i < data->ports; i++) { | 135 | for (i = 0; i < data->ports; i++) { |
135 | if (data->overcurrent_pin[i]) | 136 | if (gpio_is_valid(data->overcurrent_pin[i])) |
136 | at91_set_gpio_input(data->overcurrent_pin[i], 1); | 137 | at91_set_gpio_input(data->overcurrent_pin[i], 1); |
137 | } | 138 | } |
138 | 139 | ||
@@ -188,7 +189,8 @@ void __init at91_add_device_usbh_ehci(struct at91_usbh_data *data) | |||
188 | /* Enable VBus control for UHP ports */ | 189 | /* Enable VBus control for UHP ports */ |
189 | for (i = 0; i < data->ports; i++) { | 190 | for (i = 0; i < data->ports; i++) { |
190 | if (gpio_is_valid(data->vbus_pin[i])) | 191 | if (gpio_is_valid(data->vbus_pin[i])) |
191 | at91_set_gpio_output(data->vbus_pin[i], 0); | 192 | at91_set_gpio_output(data->vbus_pin[i], |
193 | data->vbus_pin_active_low[i]); | ||
192 | } | 194 | } |
193 | 195 | ||
194 | usbh_ehci_data = *data; | 196 | usbh_ehci_data = *data; |
@@ -785,6 +787,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
785 | else | 787 | else |
786 | cs_pin = spi1_standard_cs[devices[i].chip_select]; | 788 | cs_pin = spi1_standard_cs[devices[i].chip_select]; |
787 | 789 | ||
790 | if (!gpio_is_valid(cs_pin)) | ||
791 | continue; | ||
792 | |||
788 | if (devices[i].bus_num == 0) | 793 | if (devices[i].bus_num == 0) |
789 | enable_spi0 = 1; | 794 | enable_spi0 = 1; |
790 | else | 795 | else |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index eda72e83037d..fe4ae22e8561 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -419,6 +419,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
419 | else | 419 | else |
420 | cs_pin = spi_standard_cs[devices[i].chip_select]; | 420 | cs_pin = spi_standard_cs[devices[i].chip_select]; |
421 | 421 | ||
422 | if (!gpio_is_valid(cs_pin)) | ||
423 | continue; | ||
424 | |||
422 | /* enable chip-select pin */ | 425 | /* enable chip-select pin */ |
423 | at91_set_gpio_output(cs_pin, 1); | 426 | at91_set_gpio_output(cs_pin, 1); |
424 | 427 | ||
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c index b6831eeb7b76..13c8cae60462 100644 --- a/arch/arm/mach-at91/at91sam9x5.c +++ b/arch/arm/mach-at91/at91sam9x5.c | |||
@@ -223,6 +223,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
223 | CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk), | 223 | CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk), |
224 | CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb0_clk), | 224 | CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb0_clk), |
225 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk), | 225 | CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk), |
226 | CLKDEV_CON_DEV_ID("dma_clk", "ffffec00.dma-controller", &dma0_clk), | ||
227 | CLKDEV_CON_DEV_ID("dma_clk", "ffffee00.dma-controller", &dma1_clk), | ||
226 | CLKDEV_CON_ID("pioA", &pioAB_clk), | 228 | CLKDEV_CON_ID("pioA", &pioAB_clk), |
227 | CLKDEV_CON_ID("pioB", &pioAB_clk), | 229 | CLKDEV_CON_ID("pioB", &pioAB_clk), |
228 | CLKDEV_CON_ID("pioC", &pioCD_clk), | 230 | CLKDEV_CON_ID("pioC", &pioCD_clk), |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 66f0ddf4b2ae..2ffe50f3a9e9 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -74,6 +74,7 @@ static void __init ek_init_early(void) | |||
74 | static struct at91_usbh_data __initdata ek_usbh_data = { | 74 | static struct at91_usbh_data __initdata ek_usbh_data = { |
75 | .ports = 2, | 75 | .ports = 2, |
76 | .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 }, | 76 | .vbus_pin = { AT91_PIN_PA24, AT91_PIN_PA21 }, |
77 | .vbus_pin_active_low = {1, 1}, | ||
77 | .overcurrent_pin= {-EINVAL, -EINVAL}, | 78 | .overcurrent_pin= {-EINVAL, -EINVAL}, |
78 | }; | 79 | }; |
79 | 80 | ||
diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c index e1bea73e6b30..c88e908ddd82 100644 --- a/arch/arm/mach-at91/board-sam9m10g45ek.c +++ b/arch/arm/mach-at91/board-sam9m10g45ek.c | |||
@@ -71,6 +71,7 @@ static void __init ek_init_early(void) | |||
71 | static struct at91_usbh_data __initdata ek_usbh_hs_data = { | 71 | static struct at91_usbh_data __initdata ek_usbh_hs_data = { |
72 | .ports = 2, | 72 | .ports = 2, |
73 | .vbus_pin = {AT91_PIN_PD1, AT91_PIN_PD3}, | 73 | .vbus_pin = {AT91_PIN_PD1, AT91_PIN_PD3}, |
74 | .vbus_pin_active_low = {1, 1}, | ||
74 | .overcurrent_pin= {-EINVAL, -EINVAL}, | 75 | .overcurrent_pin= {-EINVAL, -EINVAL}, |
75 | }; | 76 | }; |
76 | 77 | ||
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 544a5d5ce416..49a821192c65 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
@@ -86,14 +86,15 @@ extern void __init at91_add_device_mci(short mmc_id, struct mci_platform_data *d | |||
86 | extern void __init at91_add_device_eth(struct macb_platform_data *data); | 86 | extern void __init at91_add_device_eth(struct macb_platform_data *data); |
87 | 87 | ||
88 | /* USB Host */ | 88 | /* USB Host */ |
89 | #define AT91_MAX_USBH_PORTS 3 | ||
89 | struct at91_usbh_data { | 90 | struct at91_usbh_data { |
90 | u8 ports; /* number of ports on root hub */ | 91 | int vbus_pin[AT91_MAX_USBH_PORTS]; /* port power-control pin */ |
91 | int vbus_pin[2]; /* port power-control pin */ | 92 | int overcurrent_pin[AT91_MAX_USBH_PORTS]; |
92 | u8 vbus_pin_active_low[2]; | 93 | u8 ports; /* number of ports on root hub */ |
93 | u8 overcurrent_supported; | 94 | u8 overcurrent_supported; |
94 | int overcurrent_pin[2]; | 95 | u8 vbus_pin_active_low[AT91_MAX_USBH_PORTS]; |
95 | u8 overcurrent_status[2]; | 96 | u8 overcurrent_status[AT91_MAX_USBH_PORTS]; |
96 | u8 overcurrent_changed[2]; | 97 | u8 overcurrent_changed[AT91_MAX_USBH_PORTS]; |
97 | }; | 98 | }; |
98 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); | 99 | extern void __init at91_add_device_usbh(struct at91_usbh_data *data); |
99 | extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data); | 100 | extern void __init at91_add_device_usbh_ohci(struct at91_usbh_data *data); |
diff --git a/arch/arm/mach-at91/include/mach/io.h b/arch/arm/mach-at91/include/mach/io.h new file mode 100644 index 000000000000..2d9ca0455745 --- /dev/null +++ b/arch/arm/mach-at91/include/mach/io.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-at91/include/mach/io.h | ||
3 | * | ||
4 | * Copyright (C) 2003 SAN People | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef __ASM_ARCH_IO_H | ||
22 | #define __ASM_ARCH_IO_H | ||
23 | |||
24 | #define IO_SPACE_LIMIT 0xFFFFFFFF | ||
25 | #define __io(a) __typesafe_io(a) | ||
26 | |||
27 | #endif | ||
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index e6cc50e94a58..8614aab47cc0 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c | |||
@@ -583,10 +583,11 @@ core_initcall(exynos_core_init); | |||
583 | #ifdef CONFIG_CACHE_L2X0 | 583 | #ifdef CONFIG_CACHE_L2X0 |
584 | static int __init exynos4_l2x0_cache_init(void) | 584 | static int __init exynos4_l2x0_cache_init(void) |
585 | { | 585 | { |
586 | int ret; | ||
587 | |||
586 | if (soc_is_exynos5250()) | 588 | if (soc_is_exynos5250()) |
587 | return 0; | 589 | return 0; |
588 | 590 | ||
589 | int ret; | ||
590 | ret = l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK); | 591 | ret = l2x0_of_init(L2_AUX_VAL, L2_AUX_MASK); |
591 | if (!ret) { | 592 | if (!ret) { |
592 | l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs); | 593 | l2x0_regs_phys = virt_to_phys(&l2x0_saved_regs); |
diff --git a/arch/arm/mach-exynos/dma.c b/arch/arm/mach-exynos/dma.c index 3983abee4264..69aaa4503205 100644 --- a/arch/arm/mach-exynos/dma.c +++ b/arch/arm/mach-exynos/dma.c | |||
@@ -35,8 +35,6 @@ | |||
35 | #include <mach/irqs.h> | 35 | #include <mach/irqs.h> |
36 | #include <mach/dma.h> | 36 | #include <mach/dma.h> |
37 | 37 | ||
38 | static u64 dma_dmamask = DMA_BIT_MASK(32); | ||
39 | |||
40 | static u8 exynos4210_pdma0_peri[] = { | 38 | static u8 exynos4210_pdma0_peri[] = { |
41 | DMACH_PCM0_RX, | 39 | DMACH_PCM0_RX, |
42 | DMACH_PCM0_TX, | 40 | DMACH_PCM0_TX, |
diff --git a/arch/arm/mach-exynos/include/mach/debug-macro.S b/arch/arm/mach-exynos/include/mach/debug-macro.S index 6c857ff0b5d8..e0c86ea475e7 100644 --- a/arch/arm/mach-exynos/include/mach/debug-macro.S +++ b/arch/arm/mach-exynos/include/mach/debug-macro.S | |||
@@ -21,10 +21,9 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | .macro addruart, rp, rv, tmp | 23 | .macro addruart, rp, rv, tmp |
24 | mov \rp, #0x10000000 | 24 | mrc p15, 0, \tmp, c0, c0, 0 |
25 | ldr \rp, [\rp, #0x0] | 25 | and \tmp, \tmp, #0xf0 |
26 | and \rp, \rp, #0xf00000 | 26 | teq \tmp, #0xf0 @@ A15 |
27 | teq \rp, #0x500000 @@ EXYNOS5 | ||
28 | ldreq \rp, =EXYNOS5_PA_UART | 27 | ldreq \rp, =EXYNOS5_PA_UART |
29 | movne \rp, #EXYNOS4_PA_UART @@ EXYNOS4 | 28 | movne \rp, #EXYNOS4_PA_UART @@ EXYNOS4 |
30 | ldr \rv, =S3C_VA_UART | 29 | ldr \rv, =S3C_VA_UART |
diff --git a/arch/arm/mach-exynos/include/mach/uncompress.h b/arch/arm/mach-exynos/include/mach/uncompress.h index 493f4f365ddf..2979995d5a6a 100644 --- a/arch/arm/mach-exynos/include/mach/uncompress.h +++ b/arch/arm/mach-exynos/include/mach/uncompress.h | |||
@@ -20,9 +20,24 @@ volatile u8 *uart_base; | |||
20 | 20 | ||
21 | #include <plat/uncompress.h> | 21 | #include <plat/uncompress.h> |
22 | 22 | ||
23 | static unsigned int __raw_readl(unsigned int ptr) | ||
24 | { | ||
25 | return *((volatile unsigned int *)ptr); | ||
26 | } | ||
27 | |||
23 | static void arch_detect_cpu(void) | 28 | static void arch_detect_cpu(void) |
24 | { | 29 | { |
25 | if (machine_is_smdk5250()) | 30 | u32 chip_id = __raw_readl(EXYNOS_PA_CHIPID); |
31 | |||
32 | /* | ||
33 | * product_id is bits 31:12 | ||
34 | * bits 23:20 describe the exynosX family | ||
35 | * | ||
36 | */ | ||
37 | chip_id >>= 20; | ||
38 | chip_id &= 0xf; | ||
39 | |||
40 | if (chip_id == 0x5) | ||
26 | uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); | 41 | uart_base = (volatile u8 *)EXYNOS5_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); |
27 | else | 42 | else |
28 | uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); | 43 | uart_base = (volatile u8 *)EXYNOS4_PA_UART + (S3C_UART_OFFSET * CONFIG_S3C_LOWLEVEL_UART_PORT); |
diff --git a/arch/arm/mach-imx/clock-imx27.c b/arch/arm/mach-imx/clock-imx27.c index b9a95ed75553..98e04f5a87dd 100644 --- a/arch/arm/mach-imx/clock-imx27.c +++ b/arch/arm/mach-imx/clock-imx27.c | |||
@@ -662,6 +662,7 @@ static struct clk_lookup lookups[] = { | |||
662 | _REGISTER_CLOCK(NULL, "dma", dma_clk) | 662 | _REGISTER_CLOCK(NULL, "dma", dma_clk) |
663 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) | 663 | _REGISTER_CLOCK(NULL, "rtic", rtic_clk) |
664 | _REGISTER_CLOCK(NULL, "brom", brom_clk) | 664 | _REGISTER_CLOCK(NULL, "brom", brom_clk) |
665 | _REGISTER_CLOCK(NULL, "emma", emma_clk) | ||
665 | _REGISTER_CLOCK("m2m-emmaprp.0", NULL, emma_clk) | 666 | _REGISTER_CLOCK("m2m-emmaprp.0", NULL, emma_clk) |
666 | _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk) | 667 | _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk) |
667 | _REGISTER_CLOCK("imx27-fec.0", NULL, fec_clk) | 668 | _REGISTER_CLOCK("imx27-fec.0", NULL, fec_clk) |
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c index 1e279af656ad..e56c1a83eee3 100644 --- a/arch/arm/mach-imx/clock-imx35.c +++ b/arch/arm/mach-imx/clock-imx35.c | |||
@@ -483,7 +483,7 @@ static struct clk_lookup lookups[] = { | |||
483 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk) | 483 | _REGISTER_CLOCK("imx2-wdt.0", NULL, wdog_clk) |
484 | _REGISTER_CLOCK(NULL, "max", max_clk) | 484 | _REGISTER_CLOCK(NULL, "max", max_clk) |
485 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) | 485 | _REGISTER_CLOCK(NULL, "audmux", audmux_clk) |
486 | _REGISTER_CLOCK(NULL, "csi", csi_clk) | 486 | _REGISTER_CLOCK("mx3-camera.0", NULL, csi_clk) |
487 | _REGISTER_CLOCK(NULL, "iim", iim_clk) | 487 | _REGISTER_CLOCK(NULL, "iim", iim_clk) |
488 | _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) | 488 | _REGISTER_CLOCK(NULL, "gpu2d", gpu2d_clk) |
489 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) | 489 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) |
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index 27bc27e6ea41..c650145d1646 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include <linux/usb/otg.h> | 38 | #include <linux/usb/otg.h> |
39 | #include <linux/usb/ulpi.h> | 39 | #include <linux/usb/ulpi.h> |
40 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
41 | #include <linux/regulator/machine.h> | ||
42 | #include <linux/regulator/fixed.h> | ||
41 | 43 | ||
42 | #include <mach/hardware.h> | 44 | #include <mach/hardware.h> |
43 | #include <asm/mach-types.h> | 45 | #include <asm/mach-types.h> |
@@ -479,6 +481,11 @@ static struct platform_device *devices[] __initdata = { | |||
479 | &armadillo5x0_smc911x_device, | 481 | &armadillo5x0_smc911x_device, |
480 | }; | 482 | }; |
481 | 483 | ||
484 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
485 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
486 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
487 | }; | ||
488 | |||
482 | /* | 489 | /* |
483 | * Perform board specific initializations | 490 | * Perform board specific initializations |
484 | */ | 491 | */ |
@@ -489,6 +496,8 @@ static void __init armadillo5x0_init(void) | |||
489 | mxc_iomux_setup_multiple_pins(armadillo5x0_pins, | 496 | mxc_iomux_setup_multiple_pins(armadillo5x0_pins, |
490 | ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0"); | 497 | ARRAY_SIZE(armadillo5x0_pins), "armadillo5x0"); |
491 | 498 | ||
499 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
500 | |||
492 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 501 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
493 | imx_add_gpio_keys(&armadillo5x0_button_data); | 502 | imx_add_gpio_keys(&armadillo5x0_button_data); |
494 | imx31_add_imx_i2c1(NULL); | 503 | imx31_add_imx_i2c1(NULL); |
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c index fc78e8071cd1..15a26e908260 100644 --- a/arch/arm/mach-imx/mach-kzm_arm11_01.c +++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/serial_8250.h> | 24 | #include <linux/serial_8250.h> |
25 | #include <linux/smsc911x.h> | 25 | #include <linux/smsc911x.h> |
26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
27 | #include <linux/regulator/machine.h> | ||
28 | #include <linux/regulator/fixed.h> | ||
27 | 29 | ||
28 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
29 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
@@ -166,6 +168,11 @@ static struct platform_device kzm_smsc9118_device = { | |||
166 | }, | 168 | }, |
167 | }; | 169 | }; |
168 | 170 | ||
171 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
172 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
173 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
174 | }; | ||
175 | |||
169 | static int __init kzm_init_smsc9118(void) | 176 | static int __init kzm_init_smsc9118(void) |
170 | { | 177 | { |
171 | /* | 178 | /* |
@@ -175,6 +182,8 @@ static int __init kzm_init_smsc9118(void) | |||
175 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int"); | 182 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2), "smsc9118-int"); |
176 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2)); | 183 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2)); |
177 | 184 | ||
185 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
186 | |||
178 | return platform_device_register(&kzm_smsc9118_device); | 187 | return platform_device_register(&kzm_smsc9118_device); |
179 | } | 188 | } |
180 | #else | 189 | #else |
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c index 02401bbd6d53..83714b0cc290 100644 --- a/arch/arm/mach-imx/mach-mx31lilly.c +++ b/arch/arm/mach-imx/mach-mx31lilly.c | |||
@@ -34,6 +34,8 @@ | |||
34 | #include <linux/mfd/mc13783.h> | 34 | #include <linux/mfd/mc13783.h> |
35 | #include <linux/usb/otg.h> | 35 | #include <linux/usb/otg.h> |
36 | #include <linux/usb/ulpi.h> | 36 | #include <linux/usb/ulpi.h> |
37 | #include <linux/regulator/machine.h> | ||
38 | #include <linux/regulator/fixed.h> | ||
37 | 39 | ||
38 | #include <asm/mach-types.h> | 40 | #include <asm/mach-types.h> |
39 | #include <asm/mach/arch.h> | 41 | #include <asm/mach/arch.h> |
@@ -242,6 +244,11 @@ static struct platform_device *devices[] __initdata = { | |||
242 | static int mx31lilly_baseboard; | 244 | static int mx31lilly_baseboard; |
243 | core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444); | 245 | core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444); |
244 | 246 | ||
247 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
248 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
249 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
250 | }; | ||
251 | |||
245 | static void __init mx31lilly_board_init(void) | 252 | static void __init mx31lilly_board_init(void) |
246 | { | 253 | { |
247 | imx31_soc_init(); | 254 | imx31_soc_init(); |
@@ -280,6 +287,8 @@ static void __init mx31lilly_board_init(void) | |||
280 | imx31_add_spi_imx1(&spi1_pdata); | 287 | imx31_add_spi_imx1(&spi1_pdata); |
281 | spi_register_board_info(&mc13783_dev, 1); | 288 | spi_register_board_info(&mc13783_dev, 1); |
282 | 289 | ||
290 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
291 | |||
283 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 292 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
284 | 293 | ||
285 | /* USB */ | 294 | /* USB */ |
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index ef80751712e7..0abef5f13df5 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include <linux/usb/ulpi.h> | 29 | #include <linux/usb/ulpi.h> |
30 | #include <linux/mtd/physmap.h> | 30 | #include <linux/mtd/physmap.h> |
31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
32 | #include <linux/regulator/machine.h> | ||
33 | #include <linux/regulator/fixed.h> | ||
32 | 34 | ||
33 | #include <asm/mach-types.h> | 35 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
@@ -226,6 +228,11 @@ void __init mx31lite_map_io(void) | |||
226 | static int mx31lite_baseboard; | 228 | static int mx31lite_baseboard; |
227 | core_param(mx31lite_baseboard, mx31lite_baseboard, int, 0444); | 229 | core_param(mx31lite_baseboard, mx31lite_baseboard, int, 0444); |
228 | 230 | ||
231 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
232 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
233 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
234 | }; | ||
235 | |||
229 | static void __init mx31lite_init(void) | 236 | static void __init mx31lite_init(void) |
230 | { | 237 | { |
231 | int ret; | 238 | int ret; |
@@ -259,6 +266,8 @@ static void __init mx31lite_init(void) | |||
259 | if (usbh2_pdata.otg) | 266 | if (usbh2_pdata.otg) |
260 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); | 267 | imx31_add_mxc_ehci_hs(2, &usbh2_pdata); |
261 | 268 | ||
269 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
270 | |||
262 | /* SMSC9117 IRQ pin */ | 271 | /* SMSC9117 IRQ pin */ |
263 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); | 272 | ret = gpio_request(IOMUX_TO_GPIO(MX31_PIN_SFS6), "sms9117-irq"); |
264 | if (ret) | 273 | if (ret) |
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c index e14291d89e4f..6ae51c6b95b7 100644 --- a/arch/arm/mach-imx/mach-mx35_3ds.c +++ b/arch/arm/mach-imx/mach-mx35_3ds.c | |||
@@ -97,7 +97,7 @@ static struct i2c_board_info __initdata i2c_devices_3ds[] = { | |||
97 | static int lcd_power_gpio = -ENXIO; | 97 | static int lcd_power_gpio = -ENXIO; |
98 | 98 | ||
99 | static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip, | 99 | static int mc9s08dz60_gpiochip_match(struct gpio_chip *chip, |
100 | void *data) | 100 | const void *data) |
101 | { | 101 | { |
102 | return !strcmp(chip->label, data); | 102 | return !strcmp(chip->label, data); |
103 | } | 103 | } |
diff --git a/arch/arm/mach-imx/mach-mx53_ard.c b/arch/arm/mach-imx/mach-mx53_ard.c index 753f4fc9ec04..05641980dc5e 100644 --- a/arch/arm/mach-imx/mach-mx53_ard.c +++ b/arch/arm/mach-imx/mach-mx53_ard.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | #include <linux/smsc911x.h> | 25 | #include <linux/smsc911x.h> |
26 | #include <linux/regulator/machine.h> | ||
27 | #include <linux/regulator/fixed.h> | ||
26 | 28 | ||
27 | #include <mach/common.h> | 29 | #include <mach/common.h> |
28 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
@@ -214,6 +216,11 @@ static int weim_cs_config(void) | |||
214 | return 0; | 216 | return 0; |
215 | } | 217 | } |
216 | 218 | ||
219 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
220 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
221 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
222 | }; | ||
223 | |||
217 | void __init imx53_ard_common_init(void) | 224 | void __init imx53_ard_common_init(void) |
218 | { | 225 | { |
219 | mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads, | 226 | mxc_iomux_v3_setup_multiple_pads(mx53_ard_pads, |
@@ -232,6 +239,7 @@ static void __init mx53_ard_board_init(void) | |||
232 | 239 | ||
233 | imx53_ard_common_init(); | 240 | imx53_ard_common_init(); |
234 | mx53_ard_io_init(); | 241 | mx53_ard_io_init(); |
242 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
235 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 243 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
236 | 244 | ||
237 | imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); | 245 | imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); |
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h index 169a84007456..c14011fe832d 100644 --- a/arch/arm/mach-msm/include/mach/uncompress.h +++ b/arch/arm/mach-msm/include/mach/uncompress.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H | 16 | #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H |
17 | #define __ASM_ARCH_MSM_UNCOMPRESS_H | 17 | #define __ASM_ARCH_MSM_UNCOMPRESS_H |
18 | 18 | ||
19 | #include <asm/barrier.h> | ||
19 | #include <asm/processor.h> | 20 | #include <asm/processor.h> |
20 | #include <mach/msm_iomap.h> | 21 | #include <mach/msm_iomap.h> |
21 | 22 | ||
diff --git a/arch/arm/mach-msm/smd_debug.c b/arch/arm/mach-msm/smd_debug.c index 0c56a5aaf588..c56df9e932ae 100644 --- a/arch/arm/mach-msm/smd_debug.c +++ b/arch/arm/mach-msm/smd_debug.c | |||
@@ -203,15 +203,9 @@ static ssize_t debug_read(struct file *file, char __user *buf, | |||
203 | return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize); | 203 | return simple_read_from_buffer(buf, count, ppos, debug_buffer, bsize); |
204 | } | 204 | } |
205 | 205 | ||
206 | static int debug_open(struct inode *inode, struct file *file) | ||
207 | { | ||
208 | file->private_data = inode->i_private; | ||
209 | return 0; | ||
210 | } | ||
211 | |||
212 | static const struct file_operations debug_ops = { | 206 | static const struct file_operations debug_ops = { |
213 | .read = debug_read, | 207 | .read = debug_read, |
214 | .open = debug_open, | 208 | .open = simple_open, |
215 | .llseek = default_llseek, | 209 | .llseek = default_llseek, |
216 | }; | 210 | }; |
217 | 211 | ||
diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h new file mode 100644 index 000000000000..ce4f8005b26f --- /dev/null +++ b/arch/arm/mach-omap1/include/mach/io.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-omap1/include/mach/io.h | ||
3 | * | ||
4 | * IO definitions for TI OMAP processors and boards | ||
5 | * | ||
6 | * Copied from arch/arm/mach-sa1100/include/mach/io.h | ||
7 | * Copyright (C) 1997-1999 Russell King | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
15 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
16 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
17 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
20 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
21 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License along | ||
26 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
27 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
28 | * | ||
29 | * Modifications: | ||
30 | * 06-12-1997 RMK Created. | ||
31 | * 07-04-1999 RMK Major cleanup | ||
32 | */ | ||
33 | |||
34 | #ifndef __ASM_ARM_ARCH_IO_H | ||
35 | #define __ASM_ARM_ARCH_IO_H | ||
36 | |||
37 | #define IO_SPACE_LIMIT 0xffffffff | ||
38 | |||
39 | /* | ||
40 | * We don't actually have real ISA nor PCI buses, but there is so many | ||
41 | * drivers out there that might just work if we fake them... | ||
42 | */ | ||
43 | #define __io(a) __typesafe_io(a) | ||
44 | |||
45 | #endif | ||
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 41b0a2fe0b04..909a8b91b564 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <linux/i2c/at24.h> | 27 | #include <linux/i2c/at24.h> |
28 | #include <linux/i2c/twl.h> | 28 | #include <linux/i2c/twl.h> |
29 | #include <linux/regulator/fixed.h> | ||
29 | #include <linux/regulator/machine.h> | 30 | #include <linux/regulator/machine.h> |
30 | #include <linux/mmc/host.h> | 31 | #include <linux/mmc/host.h> |
31 | 32 | ||
@@ -81,8 +82,23 @@ static struct omap_smsc911x_platform_data sb_t35_smsc911x_cfg = { | |||
81 | .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, | 82 | .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, |
82 | }; | 83 | }; |
83 | 84 | ||
85 | static struct regulator_consumer_supply cm_t35_smsc911x_supplies[] = { | ||
86 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
87 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
88 | }; | ||
89 | |||
90 | static struct regulator_consumer_supply sb_t35_smsc911x_supplies[] = { | ||
91 | REGULATOR_SUPPLY("vddvario", "smsc911x.1"), | ||
92 | REGULATOR_SUPPLY("vdd33a", "smsc911x.1"), | ||
93 | }; | ||
94 | |||
84 | static void __init cm_t35_init_ethernet(void) | 95 | static void __init cm_t35_init_ethernet(void) |
85 | { | 96 | { |
97 | regulator_register_fixed(0, cm_t35_smsc911x_supplies, | ||
98 | ARRAY_SIZE(cm_t35_smsc911x_supplies)); | ||
99 | regulator_register_fixed(1, sb_t35_smsc911x_supplies, | ||
100 | ARRAY_SIZE(sb_t35_smsc911x_supplies)); | ||
101 | |||
86 | gpmc_smsc911x_init(&cm_t35_smsc911x_cfg); | 102 | gpmc_smsc911x_init(&cm_t35_smsc911x_cfg); |
87 | gpmc_smsc911x_init(&sb_t35_smsc911x_cfg); | 103 | gpmc_smsc911x_init(&sb_t35_smsc911x_cfg); |
88 | } | 104 | } |
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index e558800adfdf..930c0d380435 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c | |||
@@ -634,8 +634,14 @@ static void __init igep_wlan_bt_init(void) | |||
634 | static inline void __init igep_wlan_bt_init(void) { } | 634 | static inline void __init igep_wlan_bt_init(void) { } |
635 | #endif | 635 | #endif |
636 | 636 | ||
637 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
638 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
639 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
640 | }; | ||
641 | |||
637 | static void __init igep_init(void) | 642 | static void __init igep_init(void) |
638 | { | 643 | { |
644 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
639 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 645 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
640 | 646 | ||
641 | /* Get IGEP2 hardware revision */ | 647 | /* Get IGEP2 hardware revision */ |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index d50a562adfa0..1b6049567ab4 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/err.h> | 22 | #include <linux/err.h> |
23 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
24 | #include <linux/spi/spi.h> | 24 | #include <linux/spi/spi.h> |
25 | #include <linux/regulator/fixed.h> | ||
25 | #include <linux/regulator/machine.h> | 26 | #include <linux/regulator/machine.h> |
26 | #include <linux/i2c/twl.h> | 27 | #include <linux/i2c/twl.h> |
27 | #include <linux/io.h> | 28 | #include <linux/io.h> |
@@ -410,8 +411,14 @@ static struct mtd_partition ldp_nand_partitions[] = { | |||
410 | 411 | ||
411 | }; | 412 | }; |
412 | 413 | ||
414 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
415 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
416 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
417 | }; | ||
418 | |||
413 | static void __init omap_ldp_init(void) | 419 | static void __init omap_ldp_init(void) |
414 | { | 420 | { |
421 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
415 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 422 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
416 | ldp_init_smsc911x(); | 423 | ldp_init_smsc911x(); |
417 | omap_i2c_init(); | 424 | omap_i2c_init(); |
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index 4c90f078abe1..49df12735b41 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c | |||
@@ -114,15 +114,6 @@ static struct omap_smsc911x_platform_data smsc911x_cfg = { | |||
114 | 114 | ||
115 | static inline void __init omap3evm_init_smsc911x(void) | 115 | static inline void __init omap3evm_init_smsc911x(void) |
116 | { | 116 | { |
117 | struct clk *l3ck; | ||
118 | unsigned int rate; | ||
119 | |||
120 | l3ck = clk_get(NULL, "l3_ck"); | ||
121 | if (IS_ERR(l3ck)) | ||
122 | rate = 100000000; | ||
123 | else | ||
124 | rate = clk_get_rate(l3ck); | ||
125 | |||
126 | /* Configure ethernet controller reset gpio */ | 117 | /* Configure ethernet controller reset gpio */ |
127 | if (cpu_is_omap3430()) { | 118 | if (cpu_is_omap3430()) { |
128 | if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) | 119 | if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) |
@@ -632,9 +623,15 @@ static void __init omap3_evm_wl12xx_init(void) | |||
632 | #endif | 623 | #endif |
633 | } | 624 | } |
634 | 625 | ||
626 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
627 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
628 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
629 | }; | ||
630 | |||
635 | static void __init omap3_evm_init(void) | 631 | static void __init omap3_evm_init(void) |
636 | { | 632 | { |
637 | omap3_evm_get_revision(); | 633 | omap3_evm_get_revision(); |
634 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
638 | 635 | ||
639 | if (cpu_is_omap3630()) | 636 | if (cpu_is_omap3630()) |
640 | omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB); | 637 | omap3_mux_init(omap36x_board_mux, OMAP_PACKAGE_CBB); |
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c index 4a7d8c8a75da..9b3c141ff51b 100644 --- a/arch/arm/mach-omap2/board-omap3logic.c +++ b/arch/arm/mach-omap2/board-omap3logic.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
25 | 25 | ||
26 | #include <linux/regulator/fixed.h> | ||
26 | #include <linux/regulator/machine.h> | 27 | #include <linux/regulator/machine.h> |
27 | 28 | ||
28 | #include <linux/i2c/twl.h> | 29 | #include <linux/i2c/twl.h> |
@@ -188,8 +189,14 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
188 | }; | 189 | }; |
189 | #endif | 190 | #endif |
190 | 191 | ||
192 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
193 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
194 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
195 | }; | ||
196 | |||
191 | static void __init omap3logic_init(void) | 197 | static void __init omap3logic_init(void) |
192 | { | 198 | { |
199 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
193 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 200 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
194 | omap3torpedo_fix_pbias_voltage(); | 201 | omap3torpedo_fix_pbias_voltage(); |
195 | omap3logic_i2c_init(); | 202 | omap3logic_i2c_init(); |
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 641004380795..4dffc95bddd2 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | 26 | ||
27 | #include <linux/regulator/fixed.h> | ||
27 | #include <linux/regulator/machine.h> | 28 | #include <linux/regulator/machine.h> |
28 | #include <linux/i2c/twl.h> | 29 | #include <linux/i2c/twl.h> |
29 | #include <linux/mmc/host.h> | 30 | #include <linux/mmc/host.h> |
@@ -72,15 +73,6 @@ static struct omap_smsc911x_platform_data smsc911x_cfg = { | |||
72 | 73 | ||
73 | static inline void __init omap3stalker_init_eth(void) | 74 | static inline void __init omap3stalker_init_eth(void) |
74 | { | 75 | { |
75 | struct clk *l3ck; | ||
76 | unsigned int rate; | ||
77 | |||
78 | l3ck = clk_get(NULL, "l3_ck"); | ||
79 | if (IS_ERR(l3ck)) | ||
80 | rate = 100000000; | ||
81 | else | ||
82 | rate = clk_get_rate(l3ck); | ||
83 | |||
84 | omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP); | 76 | omap_mux_init_gpio(19, OMAP_PIN_INPUT_PULLUP); |
85 | gpmc_smsc911x_init(&smsc911x_cfg); | 77 | gpmc_smsc911x_init(&smsc911x_cfg); |
86 | } | 78 | } |
@@ -419,8 +411,14 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
419 | }; | 411 | }; |
420 | #endif | 412 | #endif |
421 | 413 | ||
414 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
415 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
416 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
417 | }; | ||
418 | |||
422 | static void __init omap3_stalker_init(void) | 419 | static void __init omap3_stalker_init(void) |
423 | { | 420 | { |
421 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
424 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); | 422 | omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); |
425 | omap_board_config = omap3_stalker_config; | 423 | omap_board_config = omap3_stalker_config; |
426 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); | 424 | omap_board_config_size = ARRAY_SIZE(omap3_stalker_config); |
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 668533e2a379..33aa3910b09e 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c | |||
@@ -498,10 +498,18 @@ static struct gpio overo_bt_gpios[] __initdata = { | |||
498 | { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH, "lcd bl enable" }, | 498 | { OVERO_GPIO_BT_NRESET, GPIOF_OUT_INIT_HIGH, "lcd bl enable" }, |
499 | }; | 499 | }; |
500 | 500 | ||
501 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
502 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
503 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
504 | REGULATOR_SUPPLY("vddvario", "smsc911x.1"), | ||
505 | REGULATOR_SUPPLY("vdd33a", "smsc911x.1"), | ||
506 | }; | ||
507 | |||
501 | static void __init overo_init(void) | 508 | static void __init overo_init(void) |
502 | { | 509 | { |
503 | int ret; | 510 | int ret; |
504 | 511 | ||
512 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
505 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); | 513 | omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); |
506 | omap_hsmmc_init(mmc); | 514 | omap_hsmmc_init(mmc); |
507 | overo_i2c_init(); | 515 | overo_i2c_init(); |
diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c index 1e8540eabde9..f64f44173061 100644 --- a/arch/arm/mach-omap2/board-zoom-debugboard.c +++ b/arch/arm/mach-omap2/board-zoom-debugboard.c | |||
@@ -14,6 +14,9 @@ | |||
14 | #include <linux/smsc911x.h> | 14 | #include <linux/smsc911x.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | 16 | ||
17 | #include <linux/regulator/fixed.h> | ||
18 | #include <linux/regulator/machine.h> | ||
19 | |||
17 | #include <plat/gpmc.h> | 20 | #include <plat/gpmc.h> |
18 | #include <plat/gpmc-smsc911x.h> | 21 | #include <plat/gpmc-smsc911x.h> |
19 | 22 | ||
@@ -117,11 +120,17 @@ static struct platform_device *zoom_devices[] __initdata = { | |||
117 | &zoom_debugboard_serial_device, | 120 | &zoom_debugboard_serial_device, |
118 | }; | 121 | }; |
119 | 122 | ||
123 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
124 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
125 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
126 | }; | ||
127 | |||
120 | int __init zoom_debugboard_init(void) | 128 | int __init zoom_debugboard_init(void) |
121 | { | 129 | { |
122 | if (!omap_zoom_debugboard_detect()) | 130 | if (!omap_zoom_debugboard_detect()) |
123 | return 0; | 131 | return 0; |
124 | 132 | ||
133 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
125 | zoom_init_smsc911x(); | 134 | zoom_init_smsc911x(); |
126 | zoom_init_quaduart(); | 135 | zoom_init_quaduart(); |
127 | return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices)); | 136 | return platform_add_devices(zoom_devices, ARRAY_SIZE(zoom_devices)); |
diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index 480fb8f09aed..f4a626f7c79e 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c | |||
@@ -747,7 +747,7 @@ static struct clk dpll4_m3_ck = { | |||
747 | .parent = &dpll4_ck, | 747 | .parent = &dpll4_ck, |
748 | .init = &omap2_init_clksel_parent, | 748 | .init = &omap2_init_clksel_parent, |
749 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 749 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
750 | .clksel_mask = OMAP3430_CLKSEL_TV_MASK, | 750 | .clksel_mask = OMAP3630_CLKSEL_TV_MASK, |
751 | .clksel = dpll4_clksel, | 751 | .clksel = dpll4_clksel, |
752 | .clkdm_name = "dpll4_clkdm", | 752 | .clkdm_name = "dpll4_clkdm", |
753 | .recalc = &omap2_clksel_recalc, | 753 | .recalc = &omap2_clksel_recalc, |
@@ -832,7 +832,7 @@ static struct clk dpll4_m4_ck = { | |||
832 | .parent = &dpll4_ck, | 832 | .parent = &dpll4_ck, |
833 | .init = &omap2_init_clksel_parent, | 833 | .init = &omap2_init_clksel_parent, |
834 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), | 834 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_DSS_MOD, CM_CLKSEL), |
835 | .clksel_mask = OMAP3430_CLKSEL_DSS1_MASK, | 835 | .clksel_mask = OMAP3630_CLKSEL_DSS1_MASK, |
836 | .clksel = dpll4_clksel, | 836 | .clksel = dpll4_clksel, |
837 | .clkdm_name = "dpll4_clkdm", | 837 | .clkdm_name = "dpll4_clkdm", |
838 | .recalc = &omap2_clksel_recalc, | 838 | .recalc = &omap2_clksel_recalc, |
@@ -859,7 +859,7 @@ static struct clk dpll4_m5_ck = { | |||
859 | .parent = &dpll4_ck, | 859 | .parent = &dpll4_ck, |
860 | .init = &omap2_init_clksel_parent, | 860 | .init = &omap2_init_clksel_parent, |
861 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), | 861 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_CAM_MOD, CM_CLKSEL), |
862 | .clksel_mask = OMAP3430_CLKSEL_CAM_MASK, | 862 | .clksel_mask = OMAP3630_CLKSEL_CAM_MASK, |
863 | .clksel = dpll4_clksel, | 863 | .clksel = dpll4_clksel, |
864 | .clkdm_name = "dpll4_clkdm", | 864 | .clkdm_name = "dpll4_clkdm", |
865 | .set_rate = &omap2_clksel_set_rate, | 865 | .set_rate = &omap2_clksel_set_rate, |
@@ -886,7 +886,7 @@ static struct clk dpll4_m6_ck = { | |||
886 | .parent = &dpll4_ck, | 886 | .parent = &dpll4_ck, |
887 | .init = &omap2_init_clksel_parent, | 887 | .init = &omap2_init_clksel_parent, |
888 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), | 888 | .clksel_reg = OMAP_CM_REGADDR(OMAP3430_EMU_MOD, CM_CLKSEL1), |
889 | .clksel_mask = OMAP3430_DIV_DPLL4_MASK, | 889 | .clksel_mask = OMAP3630_DIV_DPLL4_MASK, |
890 | .clksel = dpll4_clksel, | 890 | .clksel = dpll4_clksel, |
891 | .clkdm_name = "dpll4_clkdm", | 891 | .clkdm_name = "dpll4_clkdm", |
892 | .recalc = &omap2_clksel_recalc, | 892 | .recalc = &omap2_clksel_recalc, |
@@ -1394,6 +1394,7 @@ static struct clk cpefuse_fck = { | |||
1394 | .name = "cpefuse_fck", | 1394 | .name = "cpefuse_fck", |
1395 | .ops = &clkops_omap2_dflt, | 1395 | .ops = &clkops_omap2_dflt, |
1396 | .parent = &sys_ck, | 1396 | .parent = &sys_ck, |
1397 | .clkdm_name = "core_l4_clkdm", | ||
1397 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1398 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1398 | .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, | 1399 | .enable_bit = OMAP3430ES2_EN_CPEFUSE_SHIFT, |
1399 | .recalc = &followparent_recalc, | 1400 | .recalc = &followparent_recalc, |
@@ -1403,6 +1404,7 @@ static struct clk ts_fck = { | |||
1403 | .name = "ts_fck", | 1404 | .name = "ts_fck", |
1404 | .ops = &clkops_omap2_dflt, | 1405 | .ops = &clkops_omap2_dflt, |
1405 | .parent = &omap_32k_fck, | 1406 | .parent = &omap_32k_fck, |
1407 | .clkdm_name = "core_l4_clkdm", | ||
1406 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1408 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1407 | .enable_bit = OMAP3430ES2_EN_TS_SHIFT, | 1409 | .enable_bit = OMAP3430ES2_EN_TS_SHIFT, |
1408 | .recalc = &followparent_recalc, | 1410 | .recalc = &followparent_recalc, |
@@ -1412,6 +1414,7 @@ static struct clk usbtll_fck = { | |||
1412 | .name = "usbtll_fck", | 1414 | .name = "usbtll_fck", |
1413 | .ops = &clkops_omap2_dflt_wait, | 1415 | .ops = &clkops_omap2_dflt_wait, |
1414 | .parent = &dpll5_m2_ck, | 1416 | .parent = &dpll5_m2_ck, |
1417 | .clkdm_name = "core_l4_clkdm", | ||
1415 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), | 1418 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP3430ES2_CM_FCLKEN3), |
1416 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, | 1419 | .enable_bit = OMAP3430ES2_EN_USBTLL_SHIFT, |
1417 | .recalc = &followparent_recalc, | 1420 | .recalc = &followparent_recalc, |
@@ -1617,6 +1620,7 @@ static struct clk fshostusb_fck = { | |||
1617 | .name = "fshostusb_fck", | 1620 | .name = "fshostusb_fck", |
1618 | .ops = &clkops_omap2_dflt_wait, | 1621 | .ops = &clkops_omap2_dflt_wait, |
1619 | .parent = &core_48m_fck, | 1622 | .parent = &core_48m_fck, |
1623 | .clkdm_name = "core_l4_clkdm", | ||
1620 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1624 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1621 | .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, | 1625 | .enable_bit = OMAP3430ES1_EN_FSHOSTUSB_SHIFT, |
1622 | .recalc = &followparent_recalc, | 1626 | .recalc = &followparent_recalc, |
@@ -2043,6 +2047,7 @@ static struct clk omapctrl_ick = { | |||
2043 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), | 2047 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_ICLKEN1), |
2044 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, | 2048 | .enable_bit = OMAP3430_EN_OMAPCTRL_SHIFT, |
2045 | .flags = ENABLE_ON_INIT, | 2049 | .flags = ENABLE_ON_INIT, |
2050 | .clkdm_name = "core_l4_clkdm", | ||
2046 | .recalc = &followparent_recalc, | 2051 | .recalc = &followparent_recalc, |
2047 | }; | 2052 | }; |
2048 | 2053 | ||
@@ -2094,6 +2099,7 @@ static struct clk usb_l4_ick = { | |||
2094 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), | 2099 | .clksel_reg = OMAP_CM_REGADDR(CORE_MOD, CM_CLKSEL), |
2095 | .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, | 2100 | .clksel_mask = OMAP3430ES1_CLKSEL_FSHOSTUSB_MASK, |
2096 | .clksel = usb_l4_clksel, | 2101 | .clksel = usb_l4_clksel, |
2102 | .clkdm_name = "core_l4_clkdm", | ||
2097 | .recalc = &omap2_clksel_recalc, | 2103 | .recalc = &omap2_clksel_recalc, |
2098 | }; | 2104 | }; |
2099 | 2105 | ||
@@ -3467,8 +3473,8 @@ static struct omap_clk omap3xxx_clks[] = { | |||
3467 | CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), | 3473 | CLK(NULL, "ipss_ick", &ipss_ick, CK_AM35XX), |
3468 | CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), | 3474 | CLK(NULL, "rmii_ck", &rmii_ck, CK_AM35XX), |
3469 | CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), | 3475 | CLK(NULL, "pclk_ck", &pclk_ck, CK_AM35XX), |
3470 | CLK("davinci_emac", "emac_clk", &emac_ick, CK_AM35XX), | 3476 | CLK("davinci_emac", NULL, &emac_ick, CK_AM35XX), |
3471 | CLK("davinci_emac", "phy_clk", &emac_fck, CK_AM35XX), | 3477 | CLK("davinci_mdio.0", NULL, &emac_fck, CK_AM35XX), |
3472 | CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), | 3478 | CLK("vpfe-capture", "master", &vpfe_ick, CK_AM35XX), |
3473 | CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), | 3479 | CLK("vpfe-capture", "slave", &vpfe_fck, CK_AM35XX), |
3474 | CLK("musb-am35x", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), | 3480 | CLK("musb-am35x", "ick", &hsotgusb_ick_am35xx, CK_AM35XX), |
diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index c03c1108468e..fa6ea65ad44b 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c | |||
@@ -957,8 +957,8 @@ static struct dpll_data dpll_usb_dd = { | |||
957 | .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), | 957 | .modes = (1 << DPLL_LOW_POWER_BYPASS) | (1 << DPLL_LOCKED), |
958 | .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB, | 958 | .autoidle_reg = OMAP4430_CM_AUTOIDLE_DPLL_USB, |
959 | .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB, | 959 | .idlest_reg = OMAP4430_CM_IDLEST_DPLL_USB, |
960 | .mult_mask = OMAP4430_DPLL_MULT_MASK, | 960 | .mult_mask = OMAP4430_DPLL_MULT_USB_MASK, |
961 | .div1_mask = OMAP4430_DPLL_DIV_MASK, | 961 | .div1_mask = OMAP4430_DPLL_DIV_0_7_MASK, |
962 | .enable_mask = OMAP4430_DPLL_EN_MASK, | 962 | .enable_mask = OMAP4430_DPLL_EN_MASK, |
963 | .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, | 963 | .autoidle_mask = OMAP4430_AUTO_DPLL_MODE_MASK, |
964 | .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, | 964 | .idlest_mask = OMAP4430_ST_DPLL_CLK_MASK, |
@@ -978,6 +978,7 @@ static struct clk dpll_usb_ck = { | |||
978 | .recalc = &omap3_dpll_recalc, | 978 | .recalc = &omap3_dpll_recalc, |
979 | .round_rate = &omap2_dpll_round_rate, | 979 | .round_rate = &omap2_dpll_round_rate, |
980 | .set_rate = &omap3_noncore_dpll_set_rate, | 980 | .set_rate = &omap3_noncore_dpll_set_rate, |
981 | .clkdm_name = "l3_init_clkdm", | ||
981 | }; | 982 | }; |
982 | 983 | ||
983 | static struct clk dpll_usb_clkdcoldo_ck = { | 984 | static struct clk dpll_usb_clkdcoldo_ck = { |
diff --git a/arch/arm/mach-omap2/clockdomains44xx_data.c b/arch/arm/mach-omap2/clockdomains44xx_data.c index 9299ac291d28..bd7ed13515cc 100644 --- a/arch/arm/mach-omap2/clockdomains44xx_data.c +++ b/arch/arm/mach-omap2/clockdomains44xx_data.c | |||
@@ -390,7 +390,7 @@ static struct clockdomain emu_sys_44xx_clkdm = { | |||
390 | .prcm_partition = OMAP4430_PRM_PARTITION, | 390 | .prcm_partition = OMAP4430_PRM_PARTITION, |
391 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, | 391 | .cm_inst = OMAP4430_PRM_EMU_CM_INST, |
392 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, | 392 | .clkdm_offs = OMAP4430_PRM_EMU_CM_EMU_CDOFFS, |
393 | .flags = CLKDM_CAN_HWSUP, | 393 | .flags = CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_FORCE_WAKEUP, |
394 | }; | 394 | }; |
395 | 395 | ||
396 | static struct clockdomain l3_dma_44xx_clkdm = { | 396 | static struct clockdomain l3_dma_44xx_clkdm = { |
diff --git a/arch/arm/mach-omap2/gpmc-smsc911x.c b/arch/arm/mach-omap2/gpmc-smsc911x.c index 5e5880d6d099..b6c77be3e8f7 100644 --- a/arch/arm/mach-omap2/gpmc-smsc911x.c +++ b/arch/arm/mach-omap2/gpmc-smsc911x.c | |||
@@ -19,15 +19,11 @@ | |||
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/io.h> | 20 | #include <linux/io.h> |
21 | #include <linux/smsc911x.h> | 21 | #include <linux/smsc911x.h> |
22 | #include <linux/regulator/fixed.h> | ||
23 | #include <linux/regulator/machine.h> | ||
24 | 22 | ||
25 | #include <plat/board.h> | 23 | #include <plat/board.h> |
26 | #include <plat/gpmc.h> | 24 | #include <plat/gpmc.h> |
27 | #include <plat/gpmc-smsc911x.h> | 25 | #include <plat/gpmc-smsc911x.h> |
28 | 26 | ||
29 | static struct omap_smsc911x_platform_data *gpmc_cfg; | ||
30 | |||
31 | static struct resource gpmc_smsc911x_resources[] = { | 27 | static struct resource gpmc_smsc911x_resources[] = { |
32 | [0] = { | 28 | [0] = { |
33 | .flags = IORESOURCE_MEM, | 29 | .flags = IORESOURCE_MEM, |
@@ -41,51 +37,6 @@ static struct smsc911x_platform_config gpmc_smsc911x_config = { | |||
41 | .phy_interface = PHY_INTERFACE_MODE_MII, | 37 | .phy_interface = PHY_INTERFACE_MODE_MII, |
42 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | 38 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
43 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, | 39 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
44 | .flags = SMSC911X_USE_16BIT, | ||
45 | }; | ||
46 | |||
47 | static struct regulator_consumer_supply gpmc_smsc911x_supply[] = { | ||
48 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
49 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
50 | }; | ||
51 | |||
52 | /* Generic regulator definition to satisfy smsc911x */ | ||
53 | static struct regulator_init_data gpmc_smsc911x_reg_init_data = { | ||
54 | .constraints = { | ||
55 | .min_uV = 3300000, | ||
56 | .max_uV = 3300000, | ||
57 | .valid_modes_mask = REGULATOR_MODE_NORMAL | ||
58 | | REGULATOR_MODE_STANDBY, | ||
59 | .valid_ops_mask = REGULATOR_CHANGE_MODE | ||
60 | | REGULATOR_CHANGE_STATUS, | ||
61 | }, | ||
62 | .num_consumer_supplies = ARRAY_SIZE(gpmc_smsc911x_supply), | ||
63 | .consumer_supplies = gpmc_smsc911x_supply, | ||
64 | }; | ||
65 | |||
66 | static struct fixed_voltage_config gpmc_smsc911x_fixed_reg_data = { | ||
67 | .supply_name = "gpmc_smsc911x", | ||
68 | .microvolts = 3300000, | ||
69 | .gpio = -EINVAL, | ||
70 | .startup_delay = 0, | ||
71 | .enable_high = 0, | ||
72 | .enabled_at_boot = 1, | ||
73 | .init_data = &gpmc_smsc911x_reg_init_data, | ||
74 | }; | ||
75 | |||
76 | /* | ||
77 | * Platform device id of 42 is a temporary fix to avoid conflicts | ||
78 | * with other reg-fixed-voltage devices. The real fix should | ||
79 | * involve the driver core providing a way of dynamically | ||
80 | * assigning a unique id on registration for platform devices | ||
81 | * in the same name space. | ||
82 | */ | ||
83 | static struct platform_device gpmc_smsc911x_regulator = { | ||
84 | .name = "reg-fixed-voltage", | ||
85 | .id = 42, | ||
86 | .dev = { | ||
87 | .platform_data = &gpmc_smsc911x_fixed_reg_data, | ||
88 | }, | ||
89 | }; | 40 | }; |
90 | 41 | ||
91 | /* | 42 | /* |
@@ -93,23 +44,12 @@ static struct platform_device gpmc_smsc911x_regulator = { | |||
93 | * assume that pin multiplexing is done in the board-*.c file, | 44 | * assume that pin multiplexing is done in the board-*.c file, |
94 | * or in the bootloader. | 45 | * or in the bootloader. |
95 | */ | 46 | */ |
96 | void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data) | 47 | void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *gpmc_cfg) |
97 | { | 48 | { |
98 | struct platform_device *pdev; | 49 | struct platform_device *pdev; |
99 | unsigned long cs_mem_base; | 50 | unsigned long cs_mem_base; |
100 | int ret; | 51 | int ret; |
101 | 52 | ||
102 | gpmc_cfg = board_data; | ||
103 | |||
104 | if (!gpmc_cfg->id) { | ||
105 | ret = platform_device_register(&gpmc_smsc911x_regulator); | ||
106 | if (ret < 0) { | ||
107 | pr_err("Unable to register smsc911x regulators: %d\n", | ||
108 | ret); | ||
109 | return; | ||
110 | } | ||
111 | } | ||
112 | |||
113 | if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) { | 53 | if (gpmc_cs_request(gpmc_cfg->cs, SZ_16M, &cs_mem_base) < 0) { |
114 | pr_err("Failed to request GPMC mem region\n"); | 54 | pr_err("Failed to request GPMC mem region\n"); |
115 | return; | 55 | return; |
@@ -139,8 +79,7 @@ void __init gpmc_smsc911x_init(struct omap_smsc911x_platform_data *board_data) | |||
139 | gpio_set_value(gpmc_cfg->gpio_reset, 1); | 79 | gpio_set_value(gpmc_cfg->gpio_reset, 1); |
140 | } | 80 | } |
141 | 81 | ||
142 | if (gpmc_cfg->flags) | 82 | gpmc_smsc911x_config.flags = gpmc_cfg->flags ? : SMSC911X_USE_16BIT; |
143 | gpmc_smsc911x_config.flags = gpmc_cfg->flags; | ||
144 | 83 | ||
145 | pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id, | 84 | pdev = platform_device_register_resndata(NULL, "smsc911x", gpmc_cfg->id, |
146 | gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources), | 85 | gpmc_smsc911x_resources, ARRAY_SIZE(gpmc_smsc911x_resources), |
diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index 100db6217f39..b0268eaffe13 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c | |||
@@ -506,6 +506,13 @@ static void __init omap_hsmmc_init_one(struct omap2_hsmmc_info *hsmmcinfo, | |||
506 | if (oh->dev_attr != NULL) { | 506 | if (oh->dev_attr != NULL) { |
507 | mmc_dev_attr = oh->dev_attr; | 507 | mmc_dev_attr = oh->dev_attr; |
508 | mmc_data->controller_flags = mmc_dev_attr->flags; | 508 | mmc_data->controller_flags = mmc_dev_attr->flags; |
509 | /* | ||
510 | * erratum 2.1.1.128 doesn't apply if board has | ||
511 | * a transceiver is attached | ||
512 | */ | ||
513 | if (hsmmcinfo->transceiver) | ||
514 | mmc_data->controller_flags &= | ||
515 | ~OMAP_HSMMC_BROKEN_MULTIBLOCK_READ; | ||
509 | } | 516 | } |
510 | 517 | ||
511 | pdev = platform_device_alloc(name, ctrl_nr - 1); | 518 | pdev = platform_device_alloc(name, ctrl_nr - 1); |
diff --git a/arch/arm/mach-omap2/include/mach/barriers.h b/arch/arm/mach-omap2/include/mach/barriers.h index 4fa72c7cc7cd..1c582a8592b9 100644 --- a/arch/arm/mach-omap2/include/mach/barriers.h +++ b/arch/arm/mach-omap2/include/mach/barriers.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #ifndef __MACH_BARRIERS_H | 22 | #ifndef __MACH_BARRIERS_H |
23 | #define __MACH_BARRIERS_H | 23 | #define __MACH_BARRIERS_H |
24 | 24 | ||
25 | #include <asm/outercache.h> | ||
26 | |||
25 | extern void omap_bus_sync(void); | 27 | extern void omap_bus_sync(void); |
26 | 28 | ||
27 | #define rmb() dsb() | 29 | #define rmb() dsb() |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index eba6cd3816f5..2c27fdb61e66 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -1395,7 +1395,7 @@ static int _read_hardreset(struct omap_hwmod *oh, const char *name) | |||
1395 | */ | 1395 | */ |
1396 | static int _ocp_softreset(struct omap_hwmod *oh) | 1396 | static int _ocp_softreset(struct omap_hwmod *oh) |
1397 | { | 1397 | { |
1398 | u32 v; | 1398 | u32 v, softrst_mask; |
1399 | int c = 0; | 1399 | int c = 0; |
1400 | int ret = 0; | 1400 | int ret = 0; |
1401 | 1401 | ||
@@ -1427,11 +1427,13 @@ static int _ocp_softreset(struct omap_hwmod *oh) | |||
1427 | oh->class->sysc->syss_offs) | 1427 | oh->class->sysc->syss_offs) |
1428 | & SYSS_RESETDONE_MASK), | 1428 | & SYSS_RESETDONE_MASK), |
1429 | MAX_MODULE_SOFTRESET_WAIT, c); | 1429 | MAX_MODULE_SOFTRESET_WAIT, c); |
1430 | else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) | 1430 | else if (oh->class->sysc->sysc_flags & SYSC_HAS_RESET_STATUS) { |
1431 | softrst_mask = (0x1 << oh->class->sysc->sysc_fields->srst_shift); | ||
1431 | omap_test_timeout(!(omap_hwmod_read(oh, | 1432 | omap_test_timeout(!(omap_hwmod_read(oh, |
1432 | oh->class->sysc->sysc_offs) | 1433 | oh->class->sysc->sysc_offs) |
1433 | & SYSC_TYPE2_SOFTRESET_MASK), | 1434 | & softrst_mask), |
1434 | MAX_MODULE_SOFTRESET_WAIT, c); | 1435 | MAX_MODULE_SOFTRESET_WAIT, c); |
1436 | } | ||
1435 | 1437 | ||
1436 | if (c == MAX_MODULE_SOFTRESET_WAIT) | 1438 | if (c == MAX_MODULE_SOFTRESET_WAIT) |
1437 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", | 1439 | pr_warning("omap_hwmod: %s: softreset failed (waited %d usec)\n", |
@@ -1477,6 +1479,11 @@ static int _reset(struct omap_hwmod *oh) | |||
1477 | 1479 | ||
1478 | ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); | 1480 | ret = (oh->class->reset) ? oh->class->reset(oh) : _ocp_softreset(oh); |
1479 | 1481 | ||
1482 | if (oh->class->sysc) { | ||
1483 | _update_sysc_cache(oh); | ||
1484 | _enable_sysc(oh); | ||
1485 | } | ||
1486 | |||
1480 | return ret; | 1487 | return ret; |
1481 | } | 1488 | } |
1482 | 1489 | ||
@@ -1786,20 +1793,9 @@ static int _setup(struct omap_hwmod *oh, void *data) | |||
1786 | return 0; | 1793 | return 0; |
1787 | } | 1794 | } |
1788 | 1795 | ||
1789 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) { | 1796 | if (!(oh->flags & HWMOD_INIT_NO_RESET)) |
1790 | _reset(oh); | 1797 | _reset(oh); |
1791 | 1798 | ||
1792 | /* | ||
1793 | * OCP_SYSCONFIG bits need to be reprogrammed after a softreset. | ||
1794 | * The _enable() function should be split to | ||
1795 | * avoid the rewrite of the OCP_SYSCONFIG register. | ||
1796 | */ | ||
1797 | if (oh->class->sysc) { | ||
1798 | _update_sysc_cache(oh); | ||
1799 | _enable_sysc(oh); | ||
1800 | } | ||
1801 | } | ||
1802 | |||
1803 | postsetup_state = oh->_postsetup_state; | 1799 | postsetup_state = oh->_postsetup_state; |
1804 | if (postsetup_state == _HWMOD_STATE_UNKNOWN) | 1800 | if (postsetup_state == _HWMOD_STATE_UNKNOWN) |
1805 | postsetup_state = _HWMOD_STATE_ENABLED; | 1801 | postsetup_state = _HWMOD_STATE_ENABLED; |
@@ -1907,20 +1903,10 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs) | |||
1907 | */ | 1903 | */ |
1908 | int omap_hwmod_softreset(struct omap_hwmod *oh) | 1904 | int omap_hwmod_softreset(struct omap_hwmod *oh) |
1909 | { | 1905 | { |
1910 | u32 v; | 1906 | if (!oh) |
1911 | int ret; | ||
1912 | |||
1913 | if (!oh || !(oh->_sysc_cache)) | ||
1914 | return -EINVAL; | 1907 | return -EINVAL; |
1915 | 1908 | ||
1916 | v = oh->_sysc_cache; | 1909 | return _ocp_softreset(oh); |
1917 | ret = _set_softreset(oh, &v); | ||
1918 | if (ret) | ||
1919 | goto error; | ||
1920 | _write_sysconfig(v, oh); | ||
1921 | |||
1922 | error: | ||
1923 | return ret; | ||
1924 | } | 1910 | } |
1925 | 1911 | ||
1926 | /** | 1912 | /** |
@@ -2463,26 +2449,28 @@ int omap_hwmod_del_initiator_dep(struct omap_hwmod *oh, | |||
2463 | * @oh: struct omap_hwmod * | 2449 | * @oh: struct omap_hwmod * |
2464 | * | 2450 | * |
2465 | * Sets the module OCP socket ENAWAKEUP bit to allow the module to | 2451 | * Sets the module OCP socket ENAWAKEUP bit to allow the module to |
2466 | * send wakeups to the PRCM. Eventually this should sets PRCM wakeup | 2452 | * send wakeups to the PRCM, and enable I/O ring wakeup events for |
2467 | * registers to cause the PRCM to receive wakeup events from the | 2453 | * this IP block if it has dynamic mux entries. Eventually this |
2468 | * module. Does not set any wakeup routing registers beyond this | 2454 | * should set PRCM wakeup registers to cause the PRCM to receive |
2469 | * point - if the module is to wake up any other module or subsystem, | 2455 | * wakeup events from the module. Does not set any wakeup routing |
2470 | * that must be set separately. Called by omap_device code. Returns | 2456 | * registers beyond this point - if the module is to wake up any other |
2471 | * -EINVAL on error or 0 upon success. | 2457 | * module or subsystem, that must be set separately. Called by |
2458 | * omap_device code. Returns -EINVAL on error or 0 upon success. | ||
2472 | */ | 2459 | */ |
2473 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | 2460 | int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) |
2474 | { | 2461 | { |
2475 | unsigned long flags; | 2462 | unsigned long flags; |
2476 | u32 v; | 2463 | u32 v; |
2477 | 2464 | ||
2478 | if (!oh->class->sysc || | ||
2479 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) | ||
2480 | return -EINVAL; | ||
2481 | |||
2482 | spin_lock_irqsave(&oh->_lock, flags); | 2465 | spin_lock_irqsave(&oh->_lock, flags); |
2483 | v = oh->_sysc_cache; | 2466 | |
2484 | _enable_wakeup(oh, &v); | 2467 | if (oh->class->sysc && |
2485 | _write_sysconfig(v, oh); | 2468 | (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) { |
2469 | v = oh->_sysc_cache; | ||
2470 | _enable_wakeup(oh, &v); | ||
2471 | _write_sysconfig(v, oh); | ||
2472 | } | ||
2473 | |||
2486 | _set_idle_ioring_wakeup(oh, true); | 2474 | _set_idle_ioring_wakeup(oh, true); |
2487 | spin_unlock_irqrestore(&oh->_lock, flags); | 2475 | spin_unlock_irqrestore(&oh->_lock, flags); |
2488 | 2476 | ||
@@ -2494,26 +2482,28 @@ int omap_hwmod_enable_wakeup(struct omap_hwmod *oh) | |||
2494 | * @oh: struct omap_hwmod * | 2482 | * @oh: struct omap_hwmod * |
2495 | * | 2483 | * |
2496 | * Clears the module OCP socket ENAWAKEUP bit to prevent the module | 2484 | * Clears the module OCP socket ENAWAKEUP bit to prevent the module |
2497 | * from sending wakeups to the PRCM. Eventually this should clear | 2485 | * from sending wakeups to the PRCM, and disable I/O ring wakeup |
2498 | * PRCM wakeup registers to cause the PRCM to ignore wakeup events | 2486 | * events for this IP block if it has dynamic mux entries. Eventually |
2499 | * from the module. Does not set any wakeup routing registers beyond | 2487 | * this should clear PRCM wakeup registers to cause the PRCM to ignore |
2500 | * this point - if the module is to wake up any other module or | 2488 | * wakeup events from the module. Does not set any wakeup routing |
2501 | * subsystem, that must be set separately. Called by omap_device | 2489 | * registers beyond this point - if the module is to wake up any other |
2502 | * code. Returns -EINVAL on error or 0 upon success. | 2490 | * module or subsystem, that must be set separately. Called by |
2491 | * omap_device code. Returns -EINVAL on error or 0 upon success. | ||
2503 | */ | 2492 | */ |
2504 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) | 2493 | int omap_hwmod_disable_wakeup(struct omap_hwmod *oh) |
2505 | { | 2494 | { |
2506 | unsigned long flags; | 2495 | unsigned long flags; |
2507 | u32 v; | 2496 | u32 v; |
2508 | 2497 | ||
2509 | if (!oh->class->sysc || | ||
2510 | !(oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) | ||
2511 | return -EINVAL; | ||
2512 | |||
2513 | spin_lock_irqsave(&oh->_lock, flags); | 2498 | spin_lock_irqsave(&oh->_lock, flags); |
2514 | v = oh->_sysc_cache; | 2499 | |
2515 | _disable_wakeup(oh, &v); | 2500 | if (oh->class->sysc && |
2516 | _write_sysconfig(v, oh); | 2501 | (oh->class->sysc->sysc_flags & SYSC_HAS_ENAWAKEUP)) { |
2502 | v = oh->_sysc_cache; | ||
2503 | _disable_wakeup(oh, &v); | ||
2504 | _write_sysconfig(v, oh); | ||
2505 | } | ||
2506 | |||
2517 | _set_idle_ioring_wakeup(oh, false); | 2507 | _set_idle_ioring_wakeup(oh, false); |
2518 | spin_unlock_irqrestore(&oh->_lock, flags); | 2508 | spin_unlock_irqrestore(&oh->_lock, flags); |
2519 | 2509 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 08daa5e0eb5f..cc9bd106a854 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c | |||
@@ -2996,6 +2996,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp1_slaves[] = { | |||
2996 | &omap44xx_l4_abe__mcbsp1_dma, | 2996 | &omap44xx_l4_abe__mcbsp1_dma, |
2997 | }; | 2997 | }; |
2998 | 2998 | ||
2999 | static struct omap_hwmod_opt_clk mcbsp1_opt_clks[] = { | ||
3000 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3001 | { .role = "prcm_clk", .clk = "mcbsp1_sync_mux_ck" }, | ||
3002 | }; | ||
3003 | |||
2999 | static struct omap_hwmod omap44xx_mcbsp1_hwmod = { | 3004 | static struct omap_hwmod omap44xx_mcbsp1_hwmod = { |
3000 | .name = "mcbsp1", | 3005 | .name = "mcbsp1", |
3001 | .class = &omap44xx_mcbsp_hwmod_class, | 3006 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3012,6 +3017,8 @@ static struct omap_hwmod omap44xx_mcbsp1_hwmod = { | |||
3012 | }, | 3017 | }, |
3013 | .slaves = omap44xx_mcbsp1_slaves, | 3018 | .slaves = omap44xx_mcbsp1_slaves, |
3014 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), | 3019 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp1_slaves), |
3020 | .opt_clks = mcbsp1_opt_clks, | ||
3021 | .opt_clks_cnt = ARRAY_SIZE(mcbsp1_opt_clks), | ||
3015 | }; | 3022 | }; |
3016 | 3023 | ||
3017 | /* mcbsp2 */ | 3024 | /* mcbsp2 */ |
@@ -3071,6 +3078,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp2_slaves[] = { | |||
3071 | &omap44xx_l4_abe__mcbsp2_dma, | 3078 | &omap44xx_l4_abe__mcbsp2_dma, |
3072 | }; | 3079 | }; |
3073 | 3080 | ||
3081 | static struct omap_hwmod_opt_clk mcbsp2_opt_clks[] = { | ||
3082 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3083 | { .role = "prcm_clk", .clk = "mcbsp2_sync_mux_ck" }, | ||
3084 | }; | ||
3085 | |||
3074 | static struct omap_hwmod omap44xx_mcbsp2_hwmod = { | 3086 | static struct omap_hwmod omap44xx_mcbsp2_hwmod = { |
3075 | .name = "mcbsp2", | 3087 | .name = "mcbsp2", |
3076 | .class = &omap44xx_mcbsp_hwmod_class, | 3088 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3087,6 +3099,8 @@ static struct omap_hwmod omap44xx_mcbsp2_hwmod = { | |||
3087 | }, | 3099 | }, |
3088 | .slaves = omap44xx_mcbsp2_slaves, | 3100 | .slaves = omap44xx_mcbsp2_slaves, |
3089 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), | 3101 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp2_slaves), |
3102 | .opt_clks = mcbsp2_opt_clks, | ||
3103 | .opt_clks_cnt = ARRAY_SIZE(mcbsp2_opt_clks), | ||
3090 | }; | 3104 | }; |
3091 | 3105 | ||
3092 | /* mcbsp3 */ | 3106 | /* mcbsp3 */ |
@@ -3146,6 +3160,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp3_slaves[] = { | |||
3146 | &omap44xx_l4_abe__mcbsp3_dma, | 3160 | &omap44xx_l4_abe__mcbsp3_dma, |
3147 | }; | 3161 | }; |
3148 | 3162 | ||
3163 | static struct omap_hwmod_opt_clk mcbsp3_opt_clks[] = { | ||
3164 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3165 | { .role = "prcm_clk", .clk = "mcbsp3_sync_mux_ck" }, | ||
3166 | }; | ||
3167 | |||
3149 | static struct omap_hwmod omap44xx_mcbsp3_hwmod = { | 3168 | static struct omap_hwmod omap44xx_mcbsp3_hwmod = { |
3150 | .name = "mcbsp3", | 3169 | .name = "mcbsp3", |
3151 | .class = &omap44xx_mcbsp_hwmod_class, | 3170 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3162,6 +3181,8 @@ static struct omap_hwmod omap44xx_mcbsp3_hwmod = { | |||
3162 | }, | 3181 | }, |
3163 | .slaves = omap44xx_mcbsp3_slaves, | 3182 | .slaves = omap44xx_mcbsp3_slaves, |
3164 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), | 3183 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp3_slaves), |
3184 | .opt_clks = mcbsp3_opt_clks, | ||
3185 | .opt_clks_cnt = ARRAY_SIZE(mcbsp3_opt_clks), | ||
3165 | }; | 3186 | }; |
3166 | 3187 | ||
3167 | /* mcbsp4 */ | 3188 | /* mcbsp4 */ |
@@ -3200,6 +3221,11 @@ static struct omap_hwmod_ocp_if *omap44xx_mcbsp4_slaves[] = { | |||
3200 | &omap44xx_l4_per__mcbsp4, | 3221 | &omap44xx_l4_per__mcbsp4, |
3201 | }; | 3222 | }; |
3202 | 3223 | ||
3224 | static struct omap_hwmod_opt_clk mcbsp4_opt_clks[] = { | ||
3225 | { .role = "pad_fck", .clk = "pad_clks_ck" }, | ||
3226 | { .role = "prcm_clk", .clk = "mcbsp4_sync_mux_ck" }, | ||
3227 | }; | ||
3228 | |||
3203 | static struct omap_hwmod omap44xx_mcbsp4_hwmod = { | 3229 | static struct omap_hwmod omap44xx_mcbsp4_hwmod = { |
3204 | .name = "mcbsp4", | 3230 | .name = "mcbsp4", |
3205 | .class = &omap44xx_mcbsp_hwmod_class, | 3231 | .class = &omap44xx_mcbsp_hwmod_class, |
@@ -3216,6 +3242,8 @@ static struct omap_hwmod omap44xx_mcbsp4_hwmod = { | |||
3216 | }, | 3242 | }, |
3217 | .slaves = omap44xx_mcbsp4_slaves, | 3243 | .slaves = omap44xx_mcbsp4_slaves, |
3218 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), | 3244 | .slaves_cnt = ARRAY_SIZE(omap44xx_mcbsp4_slaves), |
3245 | .opt_clks = mcbsp4_opt_clks, | ||
3246 | .opt_clks_cnt = ARRAY_SIZE(mcbsp4_opt_clks), | ||
3219 | }; | 3247 | }; |
3220 | 3248 | ||
3221 | /* | 3249 | /* |
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c index 9262a6b47702..de6d46451746 100644 --- a/arch/arm/mach-omap2/opp.c +++ b/arch/arm/mach-omap2/opp.c | |||
@@ -64,10 +64,10 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def, | |||
64 | } | 64 | } |
65 | oh = omap_hwmod_lookup(opp_def->hwmod_name); | 65 | oh = omap_hwmod_lookup(opp_def->hwmod_name); |
66 | if (!oh || !oh->od) { | 66 | if (!oh || !oh->od) { |
67 | pr_warn("%s: no hwmod or odev for %s, [%d] " | 67 | pr_debug("%s: no hwmod or odev for %s, [%d] " |
68 | "cannot add OPPs.\n", __func__, | 68 | "cannot add OPPs.\n", __func__, |
69 | opp_def->hwmod_name, i); | 69 | opp_def->hwmod_name, i); |
70 | return -EINVAL; | 70 | continue; |
71 | } | 71 | } |
72 | dev = &oh->od->pdev->dev; | 72 | dev = &oh->od->pdev->dev; |
73 | 73 | ||
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 238defc6f6df..703bd1099259 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -153,8 +153,7 @@ static void omap3_save_secure_ram_context(void) | |||
153 | pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); | 153 | pwrdm_set_next_pwrst(mpu_pwrdm, mpu_next_state); |
154 | /* Following is for error tracking, it should not happen */ | 154 | /* Following is for error tracking, it should not happen */ |
155 | if (ret) { | 155 | if (ret) { |
156 | printk(KERN_ERR "save_secure_sram() returns %08x\n", | 156 | pr_err("save_secure_sram() returns %08x\n", ret); |
157 | ret); | ||
158 | while (1) | 157 | while (1) |
159 | ; | 158 | ; |
160 | } | 159 | } |
@@ -289,7 +288,7 @@ void omap_sram_idle(void) | |||
289 | break; | 288 | break; |
290 | default: | 289 | default: |
291 | /* Invalid state */ | 290 | /* Invalid state */ |
292 | printk(KERN_ERR "Invalid mpu state in sram_idle\n"); | 291 | pr_err("Invalid mpu state in sram_idle\n"); |
293 | return; | 292 | return; |
294 | } | 293 | } |
295 | 294 | ||
@@ -439,18 +438,17 @@ restore: | |||
439 | list_for_each_entry(pwrst, &pwrst_list, node) { | 438 | list_for_each_entry(pwrst, &pwrst_list, node) { |
440 | state = pwrdm_read_prev_pwrst(pwrst->pwrdm); | 439 | state = pwrdm_read_prev_pwrst(pwrst->pwrdm); |
441 | if (state > pwrst->next_state) { | 440 | if (state > pwrst->next_state) { |
442 | printk(KERN_INFO "Powerdomain (%s) didn't enter " | 441 | pr_info("Powerdomain (%s) didn't enter " |
443 | "target state %d\n", | 442 | "target state %d\n", |
444 | pwrst->pwrdm->name, pwrst->next_state); | 443 | pwrst->pwrdm->name, pwrst->next_state); |
445 | ret = -1; | 444 | ret = -1; |
446 | } | 445 | } |
447 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); | 446 | omap_set_pwrdm_state(pwrst->pwrdm, pwrst->saved_state); |
448 | } | 447 | } |
449 | if (ret) | 448 | if (ret) |
450 | printk(KERN_ERR "Could not enter target state in pm_suspend\n"); | 449 | pr_err("Could not enter target state in pm_suspend\n"); |
451 | else | 450 | else |
452 | printk(KERN_INFO "Successfully put all powerdomains " | 451 | pr_info("Successfully put all powerdomains to target state\n"); |
453 | "to target state\n"); | ||
454 | 452 | ||
455 | return ret; | 453 | return ret; |
456 | } | 454 | } |
@@ -734,21 +732,22 @@ static int __init omap3_pm_init(void) | |||
734 | 732 | ||
735 | if (ret) { | 733 | if (ret) { |
736 | pr_err("pm: Failed to request pm_io irq\n"); | 734 | pr_err("pm: Failed to request pm_io irq\n"); |
737 | goto err1; | 735 | goto err2; |
738 | } | 736 | } |
739 | 737 | ||
740 | ret = pwrdm_for_each(pwrdms_setup, NULL); | 738 | ret = pwrdm_for_each(pwrdms_setup, NULL); |
741 | if (ret) { | 739 | if (ret) { |
742 | printk(KERN_ERR "Failed to setup powerdomains\n"); | 740 | pr_err("Failed to setup powerdomains\n"); |
743 | goto err2; | 741 | goto err3; |
744 | } | 742 | } |
745 | 743 | ||
746 | (void) clkdm_for_each(omap_pm_clkdms_setup, NULL); | 744 | (void) clkdm_for_each(omap_pm_clkdms_setup, NULL); |
747 | 745 | ||
748 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); | 746 | mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); |
749 | if (mpu_pwrdm == NULL) { | 747 | if (mpu_pwrdm == NULL) { |
750 | printk(KERN_ERR "Failed to get mpu_pwrdm\n"); | 748 | pr_err("Failed to get mpu_pwrdm\n"); |
751 | goto err2; | 749 | ret = -EINVAL; |
750 | goto err3; | ||
752 | } | 751 | } |
753 | 752 | ||
754 | neon_pwrdm = pwrdm_lookup("neon_pwrdm"); | 753 | neon_pwrdm = pwrdm_lookup("neon_pwrdm"); |
@@ -781,8 +780,8 @@ static int __init omap3_pm_init(void) | |||
781 | omap3_secure_ram_storage = | 780 | omap3_secure_ram_storage = |
782 | kmalloc(0x803F, GFP_KERNEL); | 781 | kmalloc(0x803F, GFP_KERNEL); |
783 | if (!omap3_secure_ram_storage) | 782 | if (!omap3_secure_ram_storage) |
784 | printk(KERN_ERR "Memory allocation failed when" | 783 | pr_err("Memory allocation failed when " |
785 | "allocating for secure sram context\n"); | 784 | "allocating for secure sram context\n"); |
786 | 785 | ||
787 | local_irq_disable(); | 786 | local_irq_disable(); |
788 | local_fiq_disable(); | 787 | local_fiq_disable(); |
@@ -796,14 +795,17 @@ static int __init omap3_pm_init(void) | |||
796 | } | 795 | } |
797 | 796 | ||
798 | omap3_save_scratchpad_contents(); | 797 | omap3_save_scratchpad_contents(); |
799 | err1: | ||
800 | return ret; | 798 | return ret; |
801 | err2: | 799 | |
802 | free_irq(INT_34XX_PRCM_MPU_IRQ, NULL); | 800 | err3: |
803 | list_for_each_entry_safe(pwrst, tmp, &pwrst_list, node) { | 801 | list_for_each_entry_safe(pwrst, tmp, &pwrst_list, node) { |
804 | list_del(&pwrst->node); | 802 | list_del(&pwrst->node); |
805 | kfree(pwrst); | 803 | kfree(pwrst); |
806 | } | 804 | } |
805 | free_irq(omap_prcm_event_to_irq("io"), omap3_pm_init); | ||
806 | err2: | ||
807 | free_irq(omap_prcm_event_to_irq("wkup"), NULL); | ||
808 | err1: | ||
807 | return ret; | 809 | return ret; |
808 | } | 810 | } |
809 | 811 | ||
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c index 9ccaadc2cf07..885625352429 100644 --- a/arch/arm/mach-omap2/pm44xx.c +++ b/arch/arm/mach-omap2/pm44xx.c | |||
@@ -144,7 +144,7 @@ static void omap_default_idle(void) | |||
144 | static int __init omap4_pm_init(void) | 144 | static int __init omap4_pm_init(void) |
145 | { | 145 | { |
146 | int ret; | 146 | int ret; |
147 | struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm; | 147 | struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm, *l4wkup; |
148 | struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm; | 148 | struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm; |
149 | 149 | ||
150 | if (!cpu_is_omap44xx()) | 150 | if (!cpu_is_omap44xx()) |
@@ -168,14 +168,19 @@ static int __init omap4_pm_init(void) | |||
168 | * MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as | 168 | * MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as |
169 | * expected. The hardware recommendation is to enable static | 169 | * expected. The hardware recommendation is to enable static |
170 | * dependencies for these to avoid system lock ups or random crashes. | 170 | * dependencies for these to avoid system lock ups or random crashes. |
171 | * The L4 wakeup depedency is added to workaround the OCP sync hardware | ||
172 | * BUG with 32K synctimer which lead to incorrect timer value read | ||
173 | * from the 32K counter. The BUG applies for GPTIMER1 and WDT2 which | ||
174 | * are part of L4 wakeup clockdomain. | ||
171 | */ | 175 | */ |
172 | mpuss_clkdm = clkdm_lookup("mpuss_clkdm"); | 176 | mpuss_clkdm = clkdm_lookup("mpuss_clkdm"); |
173 | emif_clkdm = clkdm_lookup("l3_emif_clkdm"); | 177 | emif_clkdm = clkdm_lookup("l3_emif_clkdm"); |
174 | l3_1_clkdm = clkdm_lookup("l3_1_clkdm"); | 178 | l3_1_clkdm = clkdm_lookup("l3_1_clkdm"); |
175 | l3_2_clkdm = clkdm_lookup("l3_2_clkdm"); | 179 | l3_2_clkdm = clkdm_lookup("l3_2_clkdm"); |
176 | l4_per_clkdm = clkdm_lookup("l4_per_clkdm"); | 180 | l4_per_clkdm = clkdm_lookup("l4_per_clkdm"); |
181 | l4wkup = clkdm_lookup("l4_wkup_clkdm"); | ||
177 | ducati_clkdm = clkdm_lookup("ducati_clkdm"); | 182 | ducati_clkdm = clkdm_lookup("ducati_clkdm"); |
178 | if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) || | 183 | if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) || (!l4wkup) || |
179 | (!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm)) | 184 | (!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm)) |
180 | goto err2; | 185 | goto err2; |
181 | 186 | ||
@@ -183,6 +188,7 @@ static int __init omap4_pm_init(void) | |||
183 | ret |= clkdm_add_wkdep(mpuss_clkdm, l3_1_clkdm); | 188 | ret |= clkdm_add_wkdep(mpuss_clkdm, l3_1_clkdm); |
184 | ret |= clkdm_add_wkdep(mpuss_clkdm, l3_2_clkdm); | 189 | ret |= clkdm_add_wkdep(mpuss_clkdm, l3_2_clkdm); |
185 | ret |= clkdm_add_wkdep(mpuss_clkdm, l4_per_clkdm); | 190 | ret |= clkdm_add_wkdep(mpuss_clkdm, l4_per_clkdm); |
191 | ret |= clkdm_add_wkdep(mpuss_clkdm, l4wkup); | ||
186 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm); | 192 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm); |
187 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm); | 193 | ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm); |
188 | if (ret) { | 194 | if (ret) { |
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 8a18d1bd61c8..96ad3dbeac34 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -972,7 +972,13 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm) | |||
972 | 972 | ||
973 | int pwrdm_state_switch(struct powerdomain *pwrdm) | 973 | int pwrdm_state_switch(struct powerdomain *pwrdm) |
974 | { | 974 | { |
975 | return _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); | 975 | int ret; |
976 | |||
977 | ret = pwrdm_wait_transition(pwrdm); | ||
978 | if (!ret) | ||
979 | ret = _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW); | ||
980 | |||
981 | return ret; | ||
976 | } | 982 | } |
977 | 983 | ||
978 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) | 984 | int pwrdm_clkdm_state_switch(struct clockdomain *clkdm) |
diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c index eac623c7c3d8..f106d21ff581 100644 --- a/arch/arm/mach-omap2/prm44xx.c +++ b/arch/arm/mach-omap2/prm44xx.c | |||
@@ -147,8 +147,9 @@ static inline u32 _read_pending_irq_reg(u16 irqen_offs, u16 irqst_offs) | |||
147 | u32 mask, st; | 147 | u32 mask, st; |
148 | 148 | ||
149 | /* XXX read mask from RAM? */ | 149 | /* XXX read mask from RAM? */ |
150 | mask = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, irqen_offs); | 150 | mask = omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, |
151 | st = omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, irqst_offs); | 151 | irqen_offs); |
152 | st = omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, irqst_offs); | ||
152 | 153 | ||
153 | return mask & st; | 154 | return mask & st; |
154 | } | 155 | } |
@@ -180,7 +181,7 @@ void omap44xx_prm_read_pending_irqs(unsigned long *events) | |||
180 | */ | 181 | */ |
181 | void omap44xx_prm_ocp_barrier(void) | 182 | void omap44xx_prm_ocp_barrier(void) |
182 | { | 183 | { |
183 | omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | 184 | omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, |
184 | OMAP4_REVISION_PRM_OFFSET); | 185 | OMAP4_REVISION_PRM_OFFSET); |
185 | } | 186 | } |
186 | 187 | ||
@@ -198,19 +199,19 @@ void omap44xx_prm_ocp_barrier(void) | |||
198 | void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask) | 199 | void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask) |
199 | { | 200 | { |
200 | saved_mask[0] = | 201 | saved_mask[0] = |
201 | omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | 202 | omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, |
202 | OMAP4_PRM_IRQSTATUS_MPU_OFFSET); | 203 | OMAP4_PRM_IRQSTATUS_MPU_OFFSET); |
203 | saved_mask[1] = | 204 | saved_mask[1] = |
204 | omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | 205 | omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, |
205 | OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET); | 206 | OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET); |
206 | 207 | ||
207 | omap4_prm_write_inst_reg(0, OMAP4430_PRM_DEVICE_INST, | 208 | omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST, |
208 | OMAP4_PRM_IRQENABLE_MPU_OFFSET); | 209 | OMAP4_PRM_IRQENABLE_MPU_OFFSET); |
209 | omap4_prm_write_inst_reg(0, OMAP4430_PRM_DEVICE_INST, | 210 | omap4_prm_write_inst_reg(0, OMAP4430_PRM_OCP_SOCKET_INST, |
210 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); | 211 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); |
211 | 212 | ||
212 | /* OCP barrier */ | 213 | /* OCP barrier */ |
213 | omap4_prm_read_inst_reg(OMAP4430_PRM_DEVICE_INST, | 214 | omap4_prm_read_inst_reg(OMAP4430_PRM_OCP_SOCKET_INST, |
214 | OMAP4_REVISION_PRM_OFFSET); | 215 | OMAP4_REVISION_PRM_OFFSET); |
215 | } | 216 | } |
216 | 217 | ||
@@ -226,9 +227,9 @@ void omap44xx_prm_save_and_clear_irqen(u32 *saved_mask) | |||
226 | */ | 227 | */ |
227 | void omap44xx_prm_restore_irqen(u32 *saved_mask) | 228 | void omap44xx_prm_restore_irqen(u32 *saved_mask) |
228 | { | 229 | { |
229 | omap4_prm_write_inst_reg(saved_mask[0], OMAP4430_PRM_DEVICE_INST, | 230 | omap4_prm_write_inst_reg(saved_mask[0], OMAP4430_PRM_OCP_SOCKET_INST, |
230 | OMAP4_PRM_IRQENABLE_MPU_OFFSET); | 231 | OMAP4_PRM_IRQENABLE_MPU_OFFSET); |
231 | omap4_prm_write_inst_reg(saved_mask[1], OMAP4430_PRM_DEVICE_INST, | 232 | omap4_prm_write_inst_reg(saved_mask[1], OMAP4430_PRM_OCP_SOCKET_INST, |
232 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); | 233 | OMAP4_PRM_IRQENABLE_MPU_2_OFFSET); |
233 | } | 234 | } |
234 | 235 | ||
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 873b51d494ea..d28f848897d6 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -290,7 +290,7 @@ int omap_prcm_register_chain_handler(struct omap_prcm_irq_setup *irq_setup) | |||
290 | goto err; | 290 | goto err; |
291 | } | 291 | } |
292 | 292 | ||
293 | for (i = 0; i <= irq_setup->nr_regs; i++) { | 293 | for (i = 0; i < irq_setup->nr_regs; i++) { |
294 | gc = irq_alloc_generic_chip("PRCM", 1, | 294 | gc = irq_alloc_generic_chip("PRCM", 1, |
295 | irq_setup->base_irq + i * 32, prm_base, | 295 | irq_setup->base_irq + i * 32, prm_base, |
296 | handle_level_irq); | 296 | handle_level_irq); |
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index f51348dafafd..dde8a11f47d5 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c | |||
@@ -54,7 +54,7 @@ static struct omap_device_pm_latency omap_uhhtll_latency[] = { | |||
54 | /* | 54 | /* |
55 | * setup_ehci_io_mux - initialize IO pad mux for USBHOST | 55 | * setup_ehci_io_mux - initialize IO pad mux for USBHOST |
56 | */ | 56 | */ |
57 | static void setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode) | 57 | static void __init setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode) |
58 | { | 58 | { |
59 | switch (port_mode[0]) { | 59 | switch (port_mode[0]) { |
60 | case OMAP_EHCI_PORT_MODE_PHY: | 60 | case OMAP_EHCI_PORT_MODE_PHY: |
@@ -197,7 +197,8 @@ static void setup_ehci_io_mux(const enum usbhs_omap_port_mode *port_mode) | |||
197 | return; | 197 | return; |
198 | } | 198 | } |
199 | 199 | ||
200 | static void setup_4430ehci_io_mux(const enum usbhs_omap_port_mode *port_mode) | 200 | static |
201 | void __init setup_4430ehci_io_mux(const enum usbhs_omap_port_mode *port_mode) | ||
201 | { | 202 | { |
202 | switch (port_mode[0]) { | 203 | switch (port_mode[0]) { |
203 | case OMAP_EHCI_PORT_MODE_PHY: | 204 | case OMAP_EHCI_PORT_MODE_PHY: |
@@ -315,7 +316,7 @@ static void setup_4430ehci_io_mux(const enum usbhs_omap_port_mode *port_mode) | |||
315 | } | 316 | } |
316 | } | 317 | } |
317 | 318 | ||
318 | static void setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) | 319 | static void __init setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) |
319 | { | 320 | { |
320 | switch (port_mode[0]) { | 321 | switch (port_mode[0]) { |
321 | case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: | 322 | case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: |
@@ -412,7 +413,8 @@ static void setup_ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) | |||
412 | } | 413 | } |
413 | } | 414 | } |
414 | 415 | ||
415 | static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) | 416 | static |
417 | void __init setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) | ||
416 | { | 418 | { |
417 | switch (port_mode[0]) { | 419 | switch (port_mode[0]) { |
418 | case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: | 420 | case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index 109ccd2a8885..fe2d1f80ef50 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -113,6 +113,7 @@ config MACH_ARMCORE | |||
113 | select IWMMXT | 113 | select IWMMXT |
114 | select PXA25x | 114 | select PXA25x |
115 | select MIGHT_HAVE_PCI | 115 | select MIGHT_HAVE_PCI |
116 | select NEED_MACH_IO_H if PCI | ||
116 | 117 | ||
117 | config MACH_EM_X270 | 118 | config MACH_EM_X270 |
118 | bool "CompuLab EM-x270 platform" | 119 | bool "CompuLab EM-x270 platform" |
diff --git a/arch/arm/mach-pxa/include/mach/io.h b/arch/arm/mach-pxa/include/mach/io.h new file mode 100644 index 000000000000..cd78b7fe3567 --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/io.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-pxa/include/mach/io.h | ||
3 | * | ||
4 | * Copied from asm/arch/sa1100/io.h | ||
5 | */ | ||
6 | #ifndef __ASM_ARM_ARCH_IO_H | ||
7 | #define __ASM_ARM_ARCH_IO_H | ||
8 | |||
9 | #define IO_SPACE_LIMIT 0xffffffff | ||
10 | |||
11 | /* | ||
12 | * We don't actually have real ISA nor PCI buses, but there is so many | ||
13 | * drivers out there that might just work if we fake them... | ||
14 | */ | ||
15 | #define __io(a) __typesafe_io(a) | ||
16 | |||
17 | #endif | ||
diff --git a/arch/arm/mach-s3c24xx/common.h b/arch/arm/mach-s3c24xx/common.h new file mode 100644 index 000000000000..c2f596e7bc2d --- /dev/null +++ b/arch/arm/mach-s3c24xx/common.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2012 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.com | ||
4 | * | ||
5 | * Common Header for S3C24XX SoCs | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef __ARCH_ARM_MACH_S3C24XX_COMMON_H | ||
13 | #define __ARCH_ARM_MACH_S3C24XX_COMMON_H __FILE__ | ||
14 | |||
15 | void s3c2410_restart(char mode, const char *cmd); | ||
16 | void s3c244x_restart(char mode, const char *cmd); | ||
17 | |||
18 | #endif /* __ARCH_ARM_MACH_S3C24XX_COMMON_H */ | ||
diff --git a/arch/arm/mach-sa1100/collie.c b/arch/arm/mach-sa1100/collie.c index 48885b7efd6b..c7f418b0cde9 100644 --- a/arch/arm/mach-sa1100/collie.c +++ b/arch/arm/mach-sa1100/collie.c | |||
@@ -313,6 +313,10 @@ static struct sa1100fb_mach_info collie_lcd_info = { | |||
313 | 313 | ||
314 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, | 314 | .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, |
315 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), | 315 | .lccr3 = LCCR3_OutEnH | LCCR3_PixRsEdg | LCCR3_ACBsDiv(2), |
316 | |||
317 | #ifdef CONFIG_BACKLIGHT_LOCOMO | ||
318 | .lcd_power = locomolcd_power | ||
319 | #endif | ||
316 | }; | 320 | }; |
317 | 321 | ||
318 | static void __init collie_init(void) | 322 | static void __init collie_init(void) |
diff --git a/arch/arm/mach-sa1100/include/mach/collie.h b/arch/arm/mach-sa1100/include/mach/collie.h index 52acda7061b7..f33679d2d3ee 100644 --- a/arch/arm/mach-sa1100/include/mach/collie.h +++ b/arch/arm/mach-sa1100/include/mach/collie.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * arch/arm/mach-sa1100/include/mach/collie.h | 2 | * arch/arm/mach-sa1100/include/mach/collie.h |
3 | * | 3 | * |
4 | * This file contains the hardware specific definitions for Assabet | 4 | * This file contains the hardware specific definitions for Collie |
5 | * Only include this file from SA1100-specific files. | 5 | * Only include this file from SA1100-specific files. |
6 | * | 6 | * |
7 | * ChangeLog: | 7 | * ChangeLog: |
@@ -13,6 +13,7 @@ | |||
13 | #ifndef __ASM_ARCH_COLLIE_H | 13 | #ifndef __ASM_ARCH_COLLIE_H |
14 | #define __ASM_ARCH_COLLIE_H | 14 | #define __ASM_ARCH_COLLIE_H |
15 | 15 | ||
16 | extern void locomolcd_power(int on); | ||
16 | 17 | ||
17 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) | 18 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) |
18 | #define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0) | 19 | #define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0) |
diff --git a/arch/arm/mach-versatile/pci.c b/arch/arm/mach-versatile/pci.c index a6e23f464528..d2268be8c34c 100644 --- a/arch/arm/mach-versatile/pci.c +++ b/arch/arm/mach-versatile/pci.c | |||
@@ -190,7 +190,7 @@ static struct resource pre_mem = { | |||
190 | .flags = IORESOURCE_MEM | IORESOURCE_PREFETCH, | 190 | .flags = IORESOURCE_MEM | IORESOURCE_PREFETCH, |
191 | }; | 191 | }; |
192 | 192 | ||
193 | static int __init pci_versatile_setup_resources(struct list_head *resources) | 193 | static int __init pci_versatile_setup_resources(struct pci_sys_data *sys) |
194 | { | 194 | { |
195 | int ret = 0; | 195 | int ret = 0; |
196 | 196 | ||
@@ -218,9 +218,9 @@ static int __init pci_versatile_setup_resources(struct list_head *resources) | |||
218 | * the mem resource for this bus | 218 | * the mem resource for this bus |
219 | * the prefetch mem resource for this bus | 219 | * the prefetch mem resource for this bus |
220 | */ | 220 | */ |
221 | pci_add_resource_offset(resources, &io_mem, sys->io_offset); | 221 | pci_add_resource_offset(&sys->resources, &io_mem, sys->io_offset); |
222 | pci_add_resource_offset(resources, &non_mem, sys->mem_offset); | 222 | pci_add_resource_offset(&sys->resources, &non_mem, sys->mem_offset); |
223 | pci_add_resource_offset(resources, &pre_mem, sys->mem_offset); | 223 | pci_add_resource_offset(&sys->resources, &pre_mem, sys->mem_offset); |
224 | 224 | ||
225 | goto out; | 225 | goto out; |
226 | 226 | ||
@@ -249,7 +249,7 @@ int __init pci_versatile_setup(int nr, struct pci_sys_data *sys) | |||
249 | 249 | ||
250 | if (nr == 0) { | 250 | if (nr == 0) { |
251 | sys->mem_offset = 0; | 251 | sys->mem_offset = 0; |
252 | ret = pci_versatile_setup_resources(&sys->resources); | 252 | ret = pci_versatile_setup_resources(sys); |
253 | if (ret < 0) { | 253 | if (ret < 0) { |
254 | printk("pci_versatile_setup: resources... oops?\n"); | 254 | printk("pci_versatile_setup: resources... oops?\n"); |
255 | goto out; | 255 | goto out; |
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c index d1e31fa1b0c3..5cac2c540f4f 100644 --- a/arch/arm/plat-mxc/3ds_debugboard.c +++ b/arch/arm/plat-mxc/3ds_debugboard.c | |||
@@ -80,7 +80,7 @@ static struct smsc911x_platform_config smsc911x_config = { | |||
80 | 80 | ||
81 | static struct platform_device smsc_lan9217_device = { | 81 | static struct platform_device smsc_lan9217_device = { |
82 | .name = "smsc911x", | 82 | .name = "smsc911x", |
83 | .id = 0, | 83 | .id = -1, |
84 | .dev = { | 84 | .dev = { |
85 | .platform_data = &smsc911x_config, | 85 | .platform_data = &smsc911x_config, |
86 | }, | 86 | }, |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index ce1e9b96ba1a..ad95c7a5d009 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -17,6 +17,7 @@ config ARCH_OMAP1 | |||
17 | select IRQ_DOMAIN | 17 | select IRQ_DOMAIN |
18 | select HAVE_IDE | 18 | select HAVE_IDE |
19 | select NEED_MACH_MEMORY_H | 19 | select NEED_MACH_MEMORY_H |
20 | select NEED_MACH_IO_H if PCCARD | ||
20 | help | 21 | help |
21 | "Systems based on omap7xx, omap15xx or omap16xx" | 22 | "Systems based on omap7xx, omap15xx or omap16xx" |
22 | 23 | ||
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 56b6f8b7053e..8506cbb7fea4 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -441,6 +441,8 @@ static int __init clk_disable_unused(void) | |||
441 | return 0; | 441 | return 0; |
442 | 442 | ||
443 | pr_info("clock: disabling unused clocks to save power\n"); | 443 | pr_info("clock: disabling unused clocks to save power\n"); |
444 | |||
445 | spin_lock_irqsave(&clockfw_lock, flags); | ||
444 | list_for_each_entry(ck, &clocks, node) { | 446 | list_for_each_entry(ck, &clocks, node) { |
445 | if (ck->ops == &clkops_null) | 447 | if (ck->ops == &clkops_null) |
446 | continue; | 448 | continue; |
@@ -448,10 +450,9 @@ static int __init clk_disable_unused(void) | |||
448 | if (ck->usecount > 0 || !ck->enable_reg) | 450 | if (ck->usecount > 0 || !ck->enable_reg) |
449 | continue; | 451 | continue; |
450 | 452 | ||
451 | spin_lock_irqsave(&clockfw_lock, flags); | ||
452 | arch_clock->clk_disable_unused(ck); | 453 | arch_clock->clk_disable_unused(ck); |
453 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
454 | } | 454 | } |
455 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
455 | 456 | ||
456 | return 0; | 457 | return 0; |
457 | } | 458 | } |
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h index 9e8e63d52aab..8070145ccb98 100644 --- a/arch/arm/plat-omap/include/plat/omap_hwmod.h +++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h | |||
@@ -47,17 +47,17 @@ extern struct omap_hwmod_sysc_fields omap_hwmod_sysc_type2; | |||
47 | * with the original PRCM protocol defined for OMAP2420 | 47 | * with the original PRCM protocol defined for OMAP2420 |
48 | */ | 48 | */ |
49 | #define SYSC_TYPE1_MIDLEMODE_SHIFT 12 | 49 | #define SYSC_TYPE1_MIDLEMODE_SHIFT 12 |
50 | #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_MIDLEMODE_SHIFT) | 50 | #define SYSC_TYPE1_MIDLEMODE_MASK (0x3 << SYSC_TYPE1_MIDLEMODE_SHIFT) |
51 | #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8 | 51 | #define SYSC_TYPE1_CLOCKACTIVITY_SHIFT 8 |
52 | #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_CLOCKACTIVITY_SHIFT) | 52 | #define SYSC_TYPE1_CLOCKACTIVITY_MASK (0x3 << SYSC_TYPE1_CLOCKACTIVITY_SHIFT) |
53 | #define SYSC_TYPE1_SIDLEMODE_SHIFT 3 | 53 | #define SYSC_TYPE1_SIDLEMODE_SHIFT 3 |
54 | #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_SIDLEMODE_SHIFT) | 54 | #define SYSC_TYPE1_SIDLEMODE_MASK (0x3 << SYSC_TYPE1_SIDLEMODE_SHIFT) |
55 | #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2 | 55 | #define SYSC_TYPE1_ENAWAKEUP_SHIFT 2 |
56 | #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_ENAWAKEUP_SHIFT) | 56 | #define SYSC_TYPE1_ENAWAKEUP_MASK (1 << SYSC_TYPE1_ENAWAKEUP_SHIFT) |
57 | #define SYSC_TYPE1_SOFTRESET_SHIFT 1 | 57 | #define SYSC_TYPE1_SOFTRESET_SHIFT 1 |
58 | #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_SOFTRESET_SHIFT) | 58 | #define SYSC_TYPE1_SOFTRESET_MASK (1 << SYSC_TYPE1_SOFTRESET_SHIFT) |
59 | #define SYSC_TYPE1_AUTOIDLE_SHIFT 0 | 59 | #define SYSC_TYPE1_AUTOIDLE_SHIFT 0 |
60 | #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_AUTOIDLE_SHIFT) | 60 | #define SYSC_TYPE1_AUTOIDLE_MASK (1 << SYSC_TYPE1_AUTOIDLE_SHIFT) |
61 | 61 | ||
62 | /* | 62 | /* |
63 | * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant | 63 | * OCP SYSCONFIG bit shifts/masks TYPE2. These are for IPs compliant |
diff --git a/arch/avr32/include/asm/barrier.h b/arch/avr32/include/asm/barrier.h index 808001c9cf8c..0961275373db 100644 --- a/arch/avr32/include/asm/barrier.h +++ b/arch/avr32/include/asm/barrier.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #ifndef __ASM_AVR32_BARRIER_H | 8 | #ifndef __ASM_AVR32_BARRIER_H |
9 | #define __ASM_AVR32_BARRIER_H | 9 | #define __ASM_AVR32_BARRIER_H |
10 | 10 | ||
11 | #define nop() asm volatile("nop") | ||
12 | |||
11 | #define mb() asm volatile("" : : : "memory") | 13 | #define mb() asm volatile("" : : : "memory") |
12 | #define rmb() mb() | 14 | #define rmb() mb() |
13 | #define wmb() asm volatile("sync 0" : : : "memory") | 15 | #define wmb() asm volatile("sync 0" : : : "memory") |
diff --git a/arch/avr32/include/asm/special_insns.h b/arch/avr32/include/asm/special_insns.h deleted file mode 100644 index f922218dfaa5..000000000000 --- a/arch/avr32/include/asm/special_insns.h +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004-2006 Atmel Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | #ifndef __ASM_AVR32_SPECIAL_INSNS_H | ||
9 | #define __ASM_AVR32_SPECIAL_INSNS_H | ||
10 | |||
11 | #define nop() asm volatile("nop") | ||
12 | |||
13 | #endif /* __ASM_AVR32_SPECIAL_INSNS_H */ | ||
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index 71733866cb4f..70742ec997f8 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
8 | #include <linux/serial.h> | 8 | #include <linux/serial.h> |
9 | #include <linux/platform_data/macb.h> | 9 | #include <linux/platform_data/macb.h> |
10 | #include <linux/platform_data/atmel_nand.h> | 10 | #include <linux/platform_data/atmel.h> |
11 | 11 | ||
12 | #define GPIO_PIN_NONE (-1) | 12 | #define GPIO_PIN_NONE (-1) |
13 | 13 | ||
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index c1269a1085e1..373a6902d8fa 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -823,7 +823,7 @@ config CACHELINE_ALIGNED_L1 | |||
823 | bool "Locate cacheline_aligned data to L1 Data Memory" | 823 | bool "Locate cacheline_aligned data to L1 Data Memory" |
824 | default y if !BF54x | 824 | default y if !BF54x |
825 | default n if BF54x | 825 | default n if BF54x |
826 | depends on !SMP && !BF531 | 826 | depends on !SMP && !BF531 && !CRC32 |
827 | help | 827 | help |
828 | If enabled, cacheline_aligned data is linked | 828 | If enabled, cacheline_aligned data is linked |
829 | into L1 data memory. (less latency) | 829 | into L1 data memory. (less latency) |
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig index 9ccc18a6b4df..90b175323644 100644 --- a/arch/blackfin/configs/BF527-EZKIT_defconfig +++ b/arch/blackfin/configs/BF527-EZKIT_defconfig | |||
@@ -147,6 +147,7 @@ CONFIG_USB_OTG_BLACKLIST_HUB=y | |||
147 | CONFIG_USB_MON=y | 147 | CONFIG_USB_MON=y |
148 | CONFIG_USB_MUSB_HDRC=y | 148 | CONFIG_USB_MUSB_HDRC=y |
149 | CONFIG_USB_MUSB_BLACKFIN=y | 149 | CONFIG_USB_MUSB_BLACKFIN=y |
150 | CONFIG_MUSB_PIO_ONLY=y | ||
150 | CONFIG_USB_STORAGE=y | 151 | CONFIG_USB_STORAGE=y |
151 | CONFIG_USB_GADGET=y | 152 | CONFIG_USB_GADGET=y |
152 | CONFIG_RTC_CLASS=y | 153 | CONFIG_RTC_CLASS=y |
diff --git a/arch/blackfin/include/asm/cmpxchg.h b/arch/blackfin/include/asm/cmpxchg.h index ba2484f4cb2a..c05868cc61c1 100644 --- a/arch/blackfin/include/asm/cmpxchg.h +++ b/arch/blackfin/include/asm/cmpxchg.h | |||
@@ -122,7 +122,8 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | |||
122 | (unsigned long)(n), sizeof(*(ptr)))) | 122 | (unsigned long)(n), sizeof(*(ptr)))) |
123 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | 123 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) |
124 | 124 | ||
125 | #include <asm-generic/cmpxchg.h> | 125 | #define cmpxchg(ptr, o, n) cmpxchg_local((ptr), (o), (n)) |
126 | #define cmpxchg64(ptr, o, n) cmpxchg64_local((ptr), (o), (n)) | ||
126 | 127 | ||
127 | #endif /* !CONFIG_SMP */ | 128 | #endif /* !CONFIG_SMP */ |
128 | 129 | ||
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 5a25856381ff..12d3571b5232 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h | |||
@@ -244,16 +244,26 @@ static inline int gpio_set_debounce(unsigned gpio, unsigned debounce) | |||
244 | return -EINVAL; | 244 | return -EINVAL; |
245 | } | 245 | } |
246 | 246 | ||
247 | static inline int gpio_get_value(unsigned gpio) | 247 | static inline int __gpio_get_value(unsigned gpio) |
248 | { | 248 | { |
249 | return bfin_gpio_get_value(gpio); | 249 | return bfin_gpio_get_value(gpio); |
250 | } | 250 | } |
251 | 251 | ||
252 | static inline void gpio_set_value(unsigned gpio, int value) | 252 | static inline void __gpio_set_value(unsigned gpio, int value) |
253 | { | 253 | { |
254 | return bfin_gpio_set_value(gpio, value); | 254 | return bfin_gpio_set_value(gpio, value); |
255 | } | 255 | } |
256 | 256 | ||
257 | static inline int gpio_get_value(unsigned gpio) | ||
258 | { | ||
259 | return __gpio_get_value(gpio); | ||
260 | } | ||
261 | |||
262 | static inline void gpio_set_value(unsigned gpio, int value) | ||
263 | { | ||
264 | return __gpio_set_value(gpio, value); | ||
265 | } | ||
266 | |||
257 | static inline int gpio_to_irq(unsigned gpio) | 267 | static inline int gpio_to_irq(unsigned gpio) |
258 | { | 268 | { |
259 | if (likely(gpio < MAX_BLACKFIN_GPIOS)) | 269 | if (likely(gpio < MAX_BLACKFIN_GPIOS)) |
diff --git a/arch/c6x/kernel/signal.c b/arch/c6x/kernel/signal.c index 304f675826e9..3b5a05099989 100644 --- a/arch/c6x/kernel/signal.c +++ b/arch/c6x/kernel/signal.c | |||
@@ -85,10 +85,7 @@ asmlinkage int do_rt_sigreturn(struct pt_regs *regs) | |||
85 | goto badframe; | 85 | goto badframe; |
86 | 86 | ||
87 | sigdelsetmask(&set, ~_BLOCKABLE); | 87 | sigdelsetmask(&set, ~_BLOCKABLE); |
88 | spin_lock_irq(¤t->sighand->siglock); | 88 | set_current_blocked(&set); |
89 | current->blocked = set; | ||
90 | recalc_sigpending(); | ||
91 | spin_unlock_irq(¤t->sighand->siglock); | ||
92 | 89 | ||
93 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) | 90 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) |
94 | goto badframe; | 91 | goto badframe; |
@@ -279,15 +276,8 @@ static int handle_signal(int sig, | |||
279 | 276 | ||
280 | /* Set up the stack frame */ | 277 | /* Set up the stack frame */ |
281 | ret = setup_rt_frame(sig, ka, info, oldset, regs); | 278 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
282 | if (ret == 0) { | 279 | if (ret == 0) |
283 | spin_lock_irq(¤t->sighand->siglock); | 280 | block_sigmask(ka, sig); |
284 | sigorsets(¤t->blocked, ¤t->blocked, | ||
285 | &ka->sa.sa_mask); | ||
286 | if (!(ka->sa.sa_flags & SA_NODEFER)) | ||
287 | sigaddset(¤t->blocked, sig); | ||
288 | recalc_sigpending(); | ||
289 | spin_unlock_irq(¤t->sighand->siglock); | ||
290 | } | ||
291 | 281 | ||
292 | return ret; | 282 | return ret; |
293 | } | 283 | } |
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c index 41098a3803a2..4f8d8bcdc7de 100644 --- a/arch/frv/mb93090-mb00/pci-dma.c +++ b/arch/frv/mb93090-mb00/pci-dma.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/dma-mapping.h> | 13 | #include <linux/dma-mapping.h> |
14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <linux/pci.h> | 15 | #include <linux/pci.h> |
16 | #include <linux/export.h> | ||
16 | #include <linux/highmem.h> | 17 | #include <linux/highmem.h> |
17 | #include <linux/scatterlist.h> | 18 | #include <linux/scatterlist.h> |
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index 448b224ba4ef..233ed3d2d25e 100644 --- a/arch/hexagon/include/asm/dma-mapping.h +++ b/arch/hexagon/include/asm/dma-mapping.h | |||
@@ -71,29 +71,35 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
71 | return (dma_addr == bad_dma_address); | 71 | return (dma_addr == bad_dma_address); |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 74 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
75 | dma_addr_t *dma_handle, gfp_t flag) | 75 | |
76 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
77 | dma_addr_t *dma_handle, gfp_t flag, | ||
78 | struct dma_attrs *attrs) | ||
76 | { | 79 | { |
77 | void *ret; | 80 | void *ret; |
78 | struct dma_map_ops *ops = get_dma_ops(dev); | 81 | struct dma_map_ops *ops = get_dma_ops(dev); |
79 | 82 | ||
80 | BUG_ON(!dma_ops); | 83 | BUG_ON(!dma_ops); |
81 | 84 | ||
82 | ret = ops->alloc_coherent(dev, size, dma_handle, flag); | 85 | ret = ops->alloc(dev, size, dma_handle, flag, attrs); |
83 | 86 | ||
84 | debug_dma_alloc_coherent(dev, size, *dma_handle, ret); | 87 | debug_dma_alloc_coherent(dev, size, *dma_handle, ret); |
85 | 88 | ||
86 | return ret; | 89 | return ret; |
87 | } | 90 | } |
88 | 91 | ||
89 | static inline void dma_free_coherent(struct device *dev, size_t size, | 92 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
90 | void *cpu_addr, dma_addr_t dma_handle) | 93 | |
94 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
95 | void *cpu_addr, dma_addr_t dma_handle, | ||
96 | struct dma_attrs *attrs) | ||
91 | { | 97 | { |
92 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 98 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
93 | 99 | ||
94 | BUG_ON(!dma_ops); | 100 | BUG_ON(!dma_ops); |
95 | 101 | ||
96 | dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); | 102 | dma_ops->free(dev, size, cpu_addr, dma_handle, attrs); |
97 | 103 | ||
98 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); | 104 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); |
99 | } | 105 | } |
diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c index e711ace62fdf..37302218ca4a 100644 --- a/arch/hexagon/kernel/dma.c +++ b/arch/hexagon/kernel/dma.c | |||
@@ -54,7 +54,8 @@ static struct gen_pool *coherent_pool; | |||
54 | /* Allocates from a pool of uncached memory that was reserved at boot time */ | 54 | /* Allocates from a pool of uncached memory that was reserved at boot time */ |
55 | 55 | ||
56 | void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, | 56 | void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, |
57 | dma_addr_t *dma_addr, gfp_t flag) | 57 | dma_addr_t *dma_addr, gfp_t flag, |
58 | struct dma_attrs *attrs) | ||
58 | { | 59 | { |
59 | void *ret; | 60 | void *ret; |
60 | 61 | ||
@@ -81,7 +82,7 @@ void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, | |||
81 | } | 82 | } |
82 | 83 | ||
83 | static void hexagon_free_coherent(struct device *dev, size_t size, void *vaddr, | 84 | static void hexagon_free_coherent(struct device *dev, size_t size, void *vaddr, |
84 | dma_addr_t dma_addr) | 85 | dma_addr_t dma_addr, struct dma_attrs *attrs) |
85 | { | 86 | { |
86 | gen_pool_free(coherent_pool, (unsigned long) vaddr, size); | 87 | gen_pool_free(coherent_pool, (unsigned long) vaddr, size); |
87 | } | 88 | } |
@@ -202,8 +203,8 @@ static void hexagon_sync_single_for_device(struct device *dev, | |||
202 | } | 203 | } |
203 | 204 | ||
204 | struct dma_map_ops hexagon_dma_ops = { | 205 | struct dma_map_ops hexagon_dma_ops = { |
205 | .alloc_coherent = hexagon_dma_alloc_coherent, | 206 | .alloc = hexagon_dma_alloc_coherent, |
206 | .free_coherent = hexagon_free_coherent, | 207 | .free = hexagon_free_coherent, |
207 | .map_sg = hexagon_map_sg, | 208 | .map_sg = hexagon_map_sg, |
208 | .map_page = hexagon_map_page, | 209 | .map_page = hexagon_map_page, |
209 | .sync_single_for_cpu = hexagon_sync_single_for_cpu, | 210 | .sync_single_for_cpu = hexagon_sync_single_for_cpu, |
diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c index 15d1fd22bbc5..9b44a9e2d05a 100644 --- a/arch/hexagon/kernel/smp.c +++ b/arch/hexagon/kernel/smp.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #define BASE_IPI_IRQ 26 | 35 | #define BASE_IPI_IRQ 26 |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * cpu_possible_map needs to be filled out prior to setup_per_cpu_areas | 38 | * cpu_possible_mask needs to be filled out prior to setup_per_cpu_areas |
39 | * (which is prior to any of our smp_prepare_cpu crap), in order to set | 39 | * (which is prior to any of our smp_prepare_cpu crap), in order to set |
40 | * up the... per_cpu areas. | 40 | * up the... per_cpu areas. |
41 | */ | 41 | */ |
@@ -208,7 +208,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
208 | stack_start = ((void *) thread) + THREAD_SIZE; | 208 | stack_start = ((void *) thread) + THREAD_SIZE; |
209 | __vmstart(start_secondary, stack_start); | 209 | __vmstart(start_secondary, stack_start); |
210 | 210 | ||
211 | while (!cpu_isset(cpu, cpu_online_map)) | 211 | while (!cpu_online(cpu)) |
212 | barrier(); | 212 | barrier(); |
213 | 213 | ||
214 | return 0; | 214 | return 0; |
@@ -229,7 +229,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
229 | 229 | ||
230 | /* Right now, let's just fake it. */ | 230 | /* Right now, let's just fake it. */ |
231 | for (i = 0; i < max_cpus; i++) | 231 | for (i = 0; i < max_cpus; i++) |
232 | cpu_set(i, cpu_present_map); | 232 | set_cpu_present(i, true); |
233 | 233 | ||
234 | /* Also need to register the interrupts for IPI */ | 234 | /* Also need to register the interrupts for IPI */ |
235 | if (max_cpus > 1) | 235 | if (max_cpus > 1) |
@@ -269,5 +269,5 @@ void smp_start_cpus(void) | |||
269 | int i; | 269 | int i; |
270 | 270 | ||
271 | for (i = 0; i < NR_CPUS; i++) | 271 | for (i = 0; i < NR_CPUS; i++) |
272 | cpu_set(i, cpu_possible_map); | 272 | set_cpu_possible(i, true); |
273 | } | 273 | } |
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index f6ea3a3b4a84..bcda5b2d121a 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -1129,7 +1129,8 @@ void sba_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size, | |||
1129 | * See Documentation/DMA-API-HOWTO.txt | 1129 | * See Documentation/DMA-API-HOWTO.txt |
1130 | */ | 1130 | */ |
1131 | static void * | 1131 | static void * |
1132 | sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp_t flags) | 1132 | sba_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, |
1133 | gfp_t flags, struct dma_attrs *attrs) | ||
1133 | { | 1134 | { |
1134 | struct ioc *ioc; | 1135 | struct ioc *ioc; |
1135 | void *addr; | 1136 | void *addr; |
@@ -1191,8 +1192,8 @@ sba_alloc_coherent (struct device *dev, size_t size, dma_addr_t *dma_handle, gfp | |||
1191 | * | 1192 | * |
1192 | * See Documentation/DMA-API-HOWTO.txt | 1193 | * See Documentation/DMA-API-HOWTO.txt |
1193 | */ | 1194 | */ |
1194 | static void sba_free_coherent (struct device *dev, size_t size, void *vaddr, | 1195 | static void sba_free_coherent(struct device *dev, size_t size, void *vaddr, |
1195 | dma_addr_t dma_handle) | 1196 | dma_addr_t dma_handle, struct dma_attrs *attrs) |
1196 | { | 1197 | { |
1197 | sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL); | 1198 | sba_unmap_single_attrs(dev, dma_handle, size, 0, NULL); |
1198 | free_pages((unsigned long) vaddr, get_order(size)); | 1199 | free_pages((unsigned long) vaddr, get_order(size)); |
@@ -2212,8 +2213,8 @@ sba_page_override(char *str) | |||
2212 | __setup("sbapagesize=",sba_page_override); | 2213 | __setup("sbapagesize=",sba_page_override); |
2213 | 2214 | ||
2214 | struct dma_map_ops sba_dma_ops = { | 2215 | struct dma_map_ops sba_dma_ops = { |
2215 | .alloc_coherent = sba_alloc_coherent, | 2216 | .alloc = sba_alloc_coherent, |
2216 | .free_coherent = sba_free_coherent, | 2217 | .free = sba_free_coherent, |
2217 | .map_page = sba_map_page, | 2218 | .map_page = sba_map_page, |
2218 | .unmap_page = sba_unmap_page, | 2219 | .unmap_page = sba_unmap_page, |
2219 | .map_sg = sba_map_sg_attrs, | 2220 | .map_sg = sba_map_sg_attrs, |
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 4336d080b241..4f5e8148440d 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h | |||
@@ -23,23 +23,29 @@ extern void machvec_dma_sync_single(struct device *, dma_addr_t, size_t, | |||
23 | extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int, | 23 | extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int, |
24 | enum dma_data_direction); | 24 | enum dma_data_direction); |
25 | 25 | ||
26 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 26 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
27 | dma_addr_t *daddr, gfp_t gfp) | 27 | |
28 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
29 | dma_addr_t *daddr, gfp_t gfp, | ||
30 | struct dma_attrs *attrs) | ||
28 | { | 31 | { |
29 | struct dma_map_ops *ops = platform_dma_get_ops(dev); | 32 | struct dma_map_ops *ops = platform_dma_get_ops(dev); |
30 | void *caddr; | 33 | void *caddr; |
31 | 34 | ||
32 | caddr = ops->alloc_coherent(dev, size, daddr, gfp); | 35 | caddr = ops->alloc(dev, size, daddr, gfp, attrs); |
33 | debug_dma_alloc_coherent(dev, size, *daddr, caddr); | 36 | debug_dma_alloc_coherent(dev, size, *daddr, caddr); |
34 | return caddr; | 37 | return caddr; |
35 | } | 38 | } |
36 | 39 | ||
37 | static inline void dma_free_coherent(struct device *dev, size_t size, | 40 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
38 | void *caddr, dma_addr_t daddr) | 41 | |
42 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
43 | void *caddr, dma_addr_t daddr, | ||
44 | struct dma_attrs *attrs) | ||
39 | { | 45 | { |
40 | struct dma_map_ops *ops = platform_dma_get_ops(dev); | 46 | struct dma_map_ops *ops = platform_dma_get_ops(dev); |
41 | debug_dma_free_coherent(dev, size, caddr, daddr); | 47 | debug_dma_free_coherent(dev, size, caddr, daddr); |
42 | ops->free_coherent(dev, size, caddr, daddr); | 48 | ops->free(dev, size, caddr, daddr, attrs); |
43 | } | 49 | } |
44 | 50 | ||
45 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 51 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index ac795d311f44..6f38b6120d96 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -839,7 +839,7 @@ static __init int setup_additional_cpus(char *s) | |||
839 | early_param("additional_cpus", setup_additional_cpus); | 839 | early_param("additional_cpus", setup_additional_cpus); |
840 | 840 | ||
841 | /* | 841 | /* |
842 | * cpu_possible_map should be static, it cannot change as CPUs | 842 | * cpu_possible_mask should be static, it cannot change as CPUs |
843 | * are onlined, or offlined. The reason is per-cpu data-structures | 843 | * are onlined, or offlined. The reason is per-cpu data-structures |
844 | * are allocated by some modules at init time, and dont expect to | 844 | * are allocated by some modules at init time, and dont expect to |
845 | * do this dynamically on cpu arrival/departure. | 845 | * do this dynamically on cpu arrival/departure. |
diff --git a/arch/ia64/kernel/pci-swiotlb.c b/arch/ia64/kernel/pci-swiotlb.c index d9485d952ed0..939260aeac98 100644 --- a/arch/ia64/kernel/pci-swiotlb.c +++ b/arch/ia64/kernel/pci-swiotlb.c | |||
@@ -15,16 +15,24 @@ int swiotlb __read_mostly; | |||
15 | EXPORT_SYMBOL(swiotlb); | 15 | EXPORT_SYMBOL(swiotlb); |
16 | 16 | ||
17 | static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size, | 17 | static void *ia64_swiotlb_alloc_coherent(struct device *dev, size_t size, |
18 | dma_addr_t *dma_handle, gfp_t gfp) | 18 | dma_addr_t *dma_handle, gfp_t gfp, |
19 | struct dma_attrs *attrs) | ||
19 | { | 20 | { |
20 | if (dev->coherent_dma_mask != DMA_BIT_MASK(64)) | 21 | if (dev->coherent_dma_mask != DMA_BIT_MASK(64)) |
21 | gfp |= GFP_DMA; | 22 | gfp |= GFP_DMA; |
22 | return swiotlb_alloc_coherent(dev, size, dma_handle, gfp); | 23 | return swiotlb_alloc_coherent(dev, size, dma_handle, gfp); |
23 | } | 24 | } |
24 | 25 | ||
26 | static void ia64_swiotlb_free_coherent(struct device *dev, size_t size, | ||
27 | void *vaddr, dma_addr_t dma_addr, | ||
28 | struct dma_attrs *attrs) | ||
29 | { | ||
30 | swiotlb_free_coherent(dev, size, vaddr, dma_addr); | ||
31 | } | ||
32 | |||
25 | struct dma_map_ops swiotlb_dma_ops = { | 33 | struct dma_map_ops swiotlb_dma_ops = { |
26 | .alloc_coherent = ia64_swiotlb_alloc_coherent, | 34 | .alloc = ia64_swiotlb_alloc_coherent, |
27 | .free_coherent = swiotlb_free_coherent, | 35 | .free = ia64_swiotlb_free_coherent, |
28 | .map_page = swiotlb_map_page, | 36 | .map_page = swiotlb_map_page, |
29 | .unmap_page = swiotlb_unmap_page, | 37 | .unmap_page = swiotlb_unmap_page, |
30 | .map_sg = swiotlb_map_sg_attrs, | 38 | .map_sg = swiotlb_map_sg_attrs, |
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c index a9d310de57da..3290d6e00c31 100644 --- a/arch/ia64/sn/pci/pci_dma.c +++ b/arch/ia64/sn/pci/pci_dma.c | |||
@@ -76,7 +76,8 @@ EXPORT_SYMBOL(sn_dma_set_mask); | |||
76 | * more information. | 76 | * more information. |
77 | */ | 77 | */ |
78 | static void *sn_dma_alloc_coherent(struct device *dev, size_t size, | 78 | static void *sn_dma_alloc_coherent(struct device *dev, size_t size, |
79 | dma_addr_t * dma_handle, gfp_t flags) | 79 | dma_addr_t * dma_handle, gfp_t flags, |
80 | struct dma_attrs *attrs) | ||
80 | { | 81 | { |
81 | void *cpuaddr; | 82 | void *cpuaddr; |
82 | unsigned long phys_addr; | 83 | unsigned long phys_addr; |
@@ -137,7 +138,7 @@ static void *sn_dma_alloc_coherent(struct device *dev, size_t size, | |||
137 | * any associated IOMMU mappings. | 138 | * any associated IOMMU mappings. |
138 | */ | 139 | */ |
139 | static void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | 140 | static void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, |
140 | dma_addr_t dma_handle) | 141 | dma_addr_t dma_handle, struct dma_attrs *attrs) |
141 | { | 142 | { |
142 | struct pci_dev *pdev = to_pci_dev(dev); | 143 | struct pci_dev *pdev = to_pci_dev(dev); |
143 | struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); | 144 | struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev); |
@@ -466,8 +467,8 @@ int sn_pci_legacy_write(struct pci_bus *bus, u16 port, u32 val, u8 size) | |||
466 | } | 467 | } |
467 | 468 | ||
468 | static struct dma_map_ops sn_dma_ops = { | 469 | static struct dma_map_ops sn_dma_ops = { |
469 | .alloc_coherent = sn_dma_alloc_coherent, | 470 | .alloc = sn_dma_alloc_coherent, |
470 | .free_coherent = sn_dma_free_coherent, | 471 | .free = sn_dma_free_coherent, |
471 | .map_page = sn_dma_map_page, | 472 | .map_page = sn_dma_map_page, |
472 | .unmap_page = sn_dma_unmap_page, | 473 | .unmap_page = sn_dma_unmap_page, |
473 | .map_sg = sn_dma_map_sg, | 474 | .map_sg = sn_dma_map_sg, |
diff --git a/arch/m68k/include/asm/atomic.h b/arch/m68k/include/asm/atomic.h index 336e6173794f..f4e32de263a7 100644 --- a/arch/m68k/include/asm/atomic.h +++ b/arch/m68k/include/asm/atomic.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/irqflags.h> | 5 | #include <linux/irqflags.h> |
6 | #include <asm/cmpxchg.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * Atomic operations that C can't guarantee us. Useful for | 9 | * Atomic operations that C can't guarantee us. Useful for |
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index 96fa6ed7e799..d9f62e0f46c0 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -980,6 +980,9 @@ int __init mac_platform_init(void) | |||
980 | { | 980 | { |
981 | u8 *swim_base; | 981 | u8 *swim_base; |
982 | 982 | ||
983 | if (!MACH_IS_MAC) | ||
984 | return -ENODEV; | ||
985 | |||
983 | /* | 986 | /* |
984 | * Serial devices | 987 | * Serial devices |
985 | */ | 988 | */ |
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c index 512adb64f7dd..8a1ce327c963 100644 --- a/arch/m68k/q40/config.c +++ b/arch/m68k/q40/config.c | |||
@@ -334,6 +334,9 @@ static __init int q40_add_kbd_device(void) | |||
334 | { | 334 | { |
335 | struct platform_device *pdev; | 335 | struct platform_device *pdev; |
336 | 336 | ||
337 | if (!MACH_IS_Q40) | ||
338 | return -ENODEV; | ||
339 | |||
337 | pdev = platform_device_register_simple("q40kbd", -1, NULL, 0); | 340 | pdev = platform_device_register_simple("q40kbd", -1, NULL, 0); |
338 | if (IS_ERR(pdev)) | 341 | if (IS_ERR(pdev)) |
339 | return PTR_ERR(pdev); | 342 | return PTR_ERR(pdev); |
diff --git a/arch/microblaze/include/asm/cmpxchg.h b/arch/microblaze/include/asm/cmpxchg.h index 0094859abd9b..538afc0ab9f3 100644 --- a/arch/microblaze/include/asm/cmpxchg.h +++ b/arch/microblaze/include/asm/cmpxchg.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _ASM_MICROBLAZE_CMPXCHG_H | 1 | #ifndef _ASM_MICROBLAZE_CMPXCHG_H |
2 | #define _ASM_MICROBLAZE_CMPXCHG_H | 2 | #define _ASM_MICROBLAZE_CMPXCHG_H |
3 | 3 | ||
4 | #include <linux/irqflags.h> | ||
5 | |||
4 | void __bad_xchg(volatile void *ptr, int size); | 6 | void __bad_xchg(volatile void *ptr, int size); |
5 | 7 | ||
6 | static inline unsigned long __xchg(unsigned long x, volatile void *ptr, | 8 | static inline unsigned long __xchg(unsigned long x, volatile void *ptr, |
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index 3a3e5b886854..01d228286cb0 100644 --- a/arch/microblaze/include/asm/dma-mapping.h +++ b/arch/microblaze/include/asm/dma-mapping.h | |||
@@ -123,28 +123,34 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
123 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 123 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
124 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | 124 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) |
125 | 125 | ||
126 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 126 | #define dma_alloc_coherent(d, s, h, f) dma_alloc_attrs(d, s, h, f, NULL) |
127 | dma_addr_t *dma_handle, gfp_t flag) | 127 | |
128 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
129 | dma_addr_t *dma_handle, gfp_t flag, | ||
130 | struct dma_attrs *attrs) | ||
128 | { | 131 | { |
129 | struct dma_map_ops *ops = get_dma_ops(dev); | 132 | struct dma_map_ops *ops = get_dma_ops(dev); |
130 | void *memory; | 133 | void *memory; |
131 | 134 | ||
132 | BUG_ON(!ops); | 135 | BUG_ON(!ops); |
133 | 136 | ||
134 | memory = ops->alloc_coherent(dev, size, dma_handle, flag); | 137 | memory = ops->alloc(dev, size, dma_handle, flag, attrs); |
135 | 138 | ||
136 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); | 139 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); |
137 | return memory; | 140 | return memory; |
138 | } | 141 | } |
139 | 142 | ||
140 | static inline void dma_free_coherent(struct device *dev, size_t size, | 143 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d, s, c, h, NULL) |
141 | void *cpu_addr, dma_addr_t dma_handle) | 144 | |
145 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
146 | void *cpu_addr, dma_addr_t dma_handle, | ||
147 | struct dma_attrs *attrs) | ||
142 | { | 148 | { |
143 | struct dma_map_ops *ops = get_dma_ops(dev); | 149 | struct dma_map_ops *ops = get_dma_ops(dev); |
144 | 150 | ||
145 | BUG_ON(!ops); | 151 | BUG_ON(!ops); |
146 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); | 152 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); |
147 | ops->free_coherent(dev, size, cpu_addr, dma_handle); | 153 | ops->free(dev, size, cpu_addr, dma_handle, attrs); |
148 | } | 154 | } |
149 | 155 | ||
150 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 156 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
diff --git a/arch/microblaze/include/asm/futex.h b/arch/microblaze/include/asm/futex.h index b0526d2716fa..ff8cde159d9a 100644 --- a/arch/microblaze/include/asm/futex.h +++ b/arch/microblaze/include/asm/futex.h | |||
@@ -24,7 +24,7 @@ | |||
24 | .word 1b,4b,2b,4b; \ | 24 | .word 1b,4b,2b,4b; \ |
25 | .previous;" \ | 25 | .previous;" \ |
26 | : "=&r" (oldval), "=&r" (ret) \ | 26 | : "=&r" (oldval), "=&r" (ret) \ |
27 | : "b" (uaddr), "i" (-EFAULT), "r" (oparg) \ | 27 | : "r" (uaddr), "i" (-EFAULT), "r" (oparg) \ |
28 | ); \ | 28 | ); \ |
29 | }) | 29 | }) |
30 | 30 | ||
diff --git a/arch/microblaze/include/asm/processor.h b/arch/microblaze/include/asm/processor.h index 510a8e1c16ba..bffb54527299 100644 --- a/arch/microblaze/include/asm/processor.h +++ b/arch/microblaze/include/asm/processor.h | |||
@@ -31,6 +31,8 @@ extern const struct seq_operations cpuinfo_op; | |||
31 | /* Do necessary setup to start up a newly executed thread. */ | 31 | /* Do necessary setup to start up a newly executed thread. */ |
32 | void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp); | 32 | void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp); |
33 | 33 | ||
34 | extern void ret_from_fork(void); | ||
35 | |||
34 | # endif /* __ASSEMBLY__ */ | 36 | # endif /* __ASSEMBLY__ */ |
35 | 37 | ||
36 | # ifndef CONFIG_MMU | 38 | # ifndef CONFIG_MMU |
@@ -143,8 +145,6 @@ static inline void exit_thread(void) | |||
143 | 145 | ||
144 | unsigned long get_wchan(struct task_struct *p); | 146 | unsigned long get_wchan(struct task_struct *p); |
145 | 147 | ||
146 | extern void ret_from_fork(void); | ||
147 | |||
148 | /* The size allocated for kernel stacks. This _must_ be a power of two! */ | 148 | /* The size allocated for kernel stacks. This _must_ be a power of two! */ |
149 | # define KERNEL_STACK_SIZE 0x2000 | 149 | # define KERNEL_STACK_SIZE 0x2000 |
150 | 150 | ||
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c index 65a4af4cbbbe..a2bfa2ca5730 100644 --- a/arch/microblaze/kernel/dma.c +++ b/arch/microblaze/kernel/dma.c | |||
@@ -33,7 +33,8 @@ static unsigned long get_dma_direct_offset(struct device *dev) | |||
33 | #define NOT_COHERENT_CACHE | 33 | #define NOT_COHERENT_CACHE |
34 | 34 | ||
35 | static void *dma_direct_alloc_coherent(struct device *dev, size_t size, | 35 | static void *dma_direct_alloc_coherent(struct device *dev, size_t size, |
36 | dma_addr_t *dma_handle, gfp_t flag) | 36 | dma_addr_t *dma_handle, gfp_t flag, |
37 | struct dma_attrs *attrs) | ||
37 | { | 38 | { |
38 | #ifdef NOT_COHERENT_CACHE | 39 | #ifdef NOT_COHERENT_CACHE |
39 | return consistent_alloc(flag, size, dma_handle); | 40 | return consistent_alloc(flag, size, dma_handle); |
@@ -57,7 +58,8 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
57 | } | 58 | } |
58 | 59 | ||
59 | static void dma_direct_free_coherent(struct device *dev, size_t size, | 60 | static void dma_direct_free_coherent(struct device *dev, size_t size, |
60 | void *vaddr, dma_addr_t dma_handle) | 61 | void *vaddr, dma_addr_t dma_handle, |
62 | struct dma_attrs *attrs) | ||
61 | { | 63 | { |
62 | #ifdef NOT_COHERENT_CACHE | 64 | #ifdef NOT_COHERENT_CACHE |
63 | consistent_free(size, vaddr); | 65 | consistent_free(size, vaddr); |
@@ -176,8 +178,8 @@ dma_direct_sync_sg_for_device(struct device *dev, | |||
176 | } | 178 | } |
177 | 179 | ||
178 | struct dma_map_ops dma_direct_ops = { | 180 | struct dma_map_ops dma_direct_ops = { |
179 | .alloc_coherent = dma_direct_alloc_coherent, | 181 | .alloc = dma_direct_alloc_coherent, |
180 | .free_coherent = dma_direct_free_coherent, | 182 | .free = dma_direct_free_coherent, |
181 | .map_sg = dma_direct_map_sg, | 183 | .map_sg = dma_direct_map_sg, |
182 | .unmap_sg = dma_direct_unmap_sg, | 184 | .unmap_sg = dma_direct_unmap_sg, |
183 | .dma_supported = dma_direct_dma_supported, | 185 | .dma_supported = dma_direct_dma_supported, |
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c index ec485876d0d0..aba1f9a97d5d 100644 --- a/arch/microblaze/kernel/early_printk.c +++ b/arch/microblaze/kernel/early_printk.c | |||
@@ -176,6 +176,7 @@ void __init remap_early_printk(void) | |||
176 | base_addr = (u32) ioremap(base_addr, PAGE_SIZE); | 176 | base_addr = (u32) ioremap(base_addr, PAGE_SIZE); |
177 | printk(KERN_CONT "0x%x\n", base_addr); | 177 | printk(KERN_CONT "0x%x\n", base_addr); |
178 | 178 | ||
179 | #ifdef CONFIG_MMU | ||
179 | /* | 180 | /* |
180 | * Early console is on the top of skipped TLB entries | 181 | * Early console is on the top of skipped TLB entries |
181 | * decrease tlb_skip size ensure that hardcoded TLB entry will be | 182 | * decrease tlb_skip size ensure that hardcoded TLB entry will be |
@@ -189,6 +190,7 @@ void __init remap_early_printk(void) | |||
189 | * cmp rX, orig_base_addr | 190 | * cmp rX, orig_base_addr |
190 | */ | 191 | */ |
191 | tlb_skip -= 1; | 192 | tlb_skip -= 1; |
193 | #endif | ||
192 | } | 194 | } |
193 | 195 | ||
194 | void __init disable_early_printk(void) | 196 | void __init disable_early_printk(void) |
diff --git a/arch/microblaze/kernel/setup.c b/arch/microblaze/kernel/setup.c index 71af974aa24a..16d8dfd9094b 100644 --- a/arch/microblaze/kernel/setup.c +++ b/arch/microblaze/kernel/setup.c | |||
@@ -206,6 +206,7 @@ static int microblaze_debugfs_init(void) | |||
206 | } | 206 | } |
207 | arch_initcall(microblaze_debugfs_init); | 207 | arch_initcall(microblaze_debugfs_init); |
208 | 208 | ||
209 | # ifdef CONFIG_MMU | ||
209 | static int __init debugfs_tlb(void) | 210 | static int __init debugfs_tlb(void) |
210 | { | 211 | { |
211 | struct dentry *d; | 212 | struct dentry *d; |
@@ -218,6 +219,7 @@ static int __init debugfs_tlb(void) | |||
218 | return -ENOMEM; | 219 | return -ENOMEM; |
219 | } | 220 | } |
220 | device_initcall(debugfs_tlb); | 221 | device_initcall(debugfs_tlb); |
222 | # endif | ||
221 | #endif | 223 | #endif |
222 | 224 | ||
223 | static int dflt_bus_notify(struct notifier_block *nb, | 225 | static int dflt_bus_notify(struct notifier_block *nb, |
diff --git a/arch/microblaze/kernel/unwind.c b/arch/microblaze/kernel/unwind.c index 9781a528cfc9..6be4ae3c3351 100644 --- a/arch/microblaze/kernel/unwind.c +++ b/arch/microblaze/kernel/unwind.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/sections.h> | 24 | #include <asm/sections.h> |
25 | #include <asm/exceptions.h> | 25 | #include <asm/exceptions.h> |
26 | #include <asm/unwind.h> | 26 | #include <asm/unwind.h> |
27 | #include <asm/switch_to.h> | ||
27 | 28 | ||
28 | struct stack_trace; | 29 | struct stack_trace; |
29 | 30 | ||
diff --git a/arch/microblaze/lib/uaccess_old.S b/arch/microblaze/lib/uaccess_old.S index f037266cdaf3..f085995ee848 100644 --- a/arch/microblaze/lib/uaccess_old.S +++ b/arch/microblaze/lib/uaccess_old.S | |||
@@ -122,22 +122,22 @@ __strnlen_user: | |||
122 | 15: swi r24, r5, 0x0018 + offset; \ | 122 | 15: swi r24, r5, 0x0018 + offset; \ |
123 | 16: swi r25, r5, 0x001C + offset; \ | 123 | 16: swi r25, r5, 0x001C + offset; \ |
124 | .section __ex_table,"a"; \ | 124 | .section __ex_table,"a"; \ |
125 | .word 1b, 0f; \ | 125 | .word 1b, 33f; \ |
126 | .word 2b, 0f; \ | 126 | .word 2b, 33f; \ |
127 | .word 3b, 0f; \ | 127 | .word 3b, 33f; \ |
128 | .word 4b, 0f; \ | 128 | .word 4b, 33f; \ |
129 | .word 5b, 0f; \ | 129 | .word 5b, 33f; \ |
130 | .word 6b, 0f; \ | 130 | .word 6b, 33f; \ |
131 | .word 7b, 0f; \ | 131 | .word 7b, 33f; \ |
132 | .word 8b, 0f; \ | 132 | .word 8b, 33f; \ |
133 | .word 9b, 0f; \ | 133 | .word 9b, 33f; \ |
134 | .word 10b, 0f; \ | 134 | .word 10b, 33f; \ |
135 | .word 11b, 0f; \ | 135 | .word 11b, 33f; \ |
136 | .word 12b, 0f; \ | 136 | .word 12b, 33f; \ |
137 | .word 13b, 0f; \ | 137 | .word 13b, 33f; \ |
138 | .word 14b, 0f; \ | 138 | .word 14b, 33f; \ |
139 | .word 15b, 0f; \ | 139 | .word 15b, 33f; \ |
140 | .word 16b, 0f; \ | 140 | .word 16b, 33f; \ |
141 | .text | 141 | .text |
142 | 142 | ||
143 | #define COPY_80(offset) \ | 143 | #define COPY_80(offset) \ |
@@ -190,14 +190,17 @@ w2: sw r4, r5, r3 | |||
190 | 190 | ||
191 | .align 4 /* Alignment is important to keep icache happy */ | 191 | .align 4 /* Alignment is important to keep icache happy */ |
192 | page: /* Create room on stack and save registers for storign values */ | 192 | page: /* Create room on stack and save registers for storign values */ |
193 | addik r1, r1, -32 | 193 | addik r1, r1, -40 |
194 | swi r19, r1, 4 | 194 | swi r5, r1, 0 |
195 | swi r20, r1, 8 | 195 | swi r6, r1, 4 |
196 | swi r21, r1, 12 | 196 | swi r7, r1, 8 |
197 | swi r22, r1, 16 | 197 | swi r19, r1, 12 |
198 | swi r23, r1, 20 | 198 | swi r20, r1, 16 |
199 | swi r24, r1, 24 | 199 | swi r21, r1, 20 |
200 | swi r25, r1, 28 | 200 | swi r22, r1, 24 |
201 | swi r23, r1, 28 | ||
202 | swi r24, r1, 32 | ||
203 | swi r25, r1, 36 | ||
201 | loop: /* r4, r19, r20, r21, r22, r23, r24, r25 are used for storing values */ | 204 | loop: /* r4, r19, r20, r21, r22, r23, r24, r25 are used for storing values */ |
202 | /* Loop unrolling to get performance boost */ | 205 | /* Loop unrolling to get performance boost */ |
203 | COPY_80(0x000); | 206 | COPY_80(0x000); |
@@ -205,21 +208,44 @@ loop: /* r4, r19, r20, r21, r22, r23, r24, r25 are used for storing values */ | |||
205 | COPY_80(0x100); | 208 | COPY_80(0x100); |
206 | COPY_80(0x180); | 209 | COPY_80(0x180); |
207 | /* copy loop */ | 210 | /* copy loop */ |
208 | addik r6, r6, 0x200 | 211 | addik r6, r6, 0x200 |
209 | addik r7, r7, -0x200 | 212 | addik r7, r7, -0x200 |
210 | bneid r7, loop | 213 | bneid r7, loop |
211 | addik r5, r5, 0x200 | 214 | addik r5, r5, 0x200 |
215 | |||
212 | /* Restore register content */ | 216 | /* Restore register content */ |
213 | lwi r19, r1, 4 | 217 | lwi r5, r1, 0 |
214 | lwi r20, r1, 8 | 218 | lwi r6, r1, 4 |
215 | lwi r21, r1, 12 | 219 | lwi r7, r1, 8 |
216 | lwi r22, r1, 16 | 220 | lwi r19, r1, 12 |
217 | lwi r23, r1, 20 | 221 | lwi r20, r1, 16 |
218 | lwi r24, r1, 24 | 222 | lwi r21, r1, 20 |
219 | lwi r25, r1, 28 | 223 | lwi r22, r1, 24 |
220 | addik r1, r1, 32 | 224 | lwi r23, r1, 28 |
225 | lwi r24, r1, 32 | ||
226 | lwi r25, r1, 36 | ||
227 | addik r1, r1, 40 | ||
221 | /* return back */ | 228 | /* return back */ |
229 | addik r3, r0, 0 | ||
230 | rtsd r15, 8 | ||
231 | nop | ||
232 | |||
233 | /* Fault case - return temp count */ | ||
234 | 33: | ||
222 | addik r3, r7, 0 | 235 | addik r3, r7, 0 |
236 | /* Restore register content */ | ||
237 | lwi r5, r1, 0 | ||
238 | lwi r6, r1, 4 | ||
239 | lwi r7, r1, 8 | ||
240 | lwi r19, r1, 12 | ||
241 | lwi r20, r1, 16 | ||
242 | lwi r21, r1, 20 | ||
243 | lwi r22, r1, 24 | ||
244 | lwi r23, r1, 28 | ||
245 | lwi r24, r1, 32 | ||
246 | lwi r25, r1, 36 | ||
247 | addik r1, r1, 40 | ||
248 | /* return back */ | ||
223 | rtsd r15, 8 | 249 | rtsd r15, 8 |
224 | nop | 250 | nop |
225 | 251 | ||
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c index b6bb92c16a47..41dd00884975 100644 --- a/arch/mips/cavium-octeon/dma-octeon.c +++ b/arch/mips/cavium-octeon/dma-octeon.c | |||
@@ -157,7 +157,7 @@ static void octeon_dma_sync_sg_for_device(struct device *dev, | |||
157 | } | 157 | } |
158 | 158 | ||
159 | static void *octeon_dma_alloc_coherent(struct device *dev, size_t size, | 159 | static void *octeon_dma_alloc_coherent(struct device *dev, size_t size, |
160 | dma_addr_t *dma_handle, gfp_t gfp) | 160 | dma_addr_t *dma_handle, gfp_t gfp, struct dma_attrs *attrs) |
161 | { | 161 | { |
162 | void *ret; | 162 | void *ret; |
163 | 163 | ||
@@ -192,7 +192,7 @@ static void *octeon_dma_alloc_coherent(struct device *dev, size_t size, | |||
192 | } | 192 | } |
193 | 193 | ||
194 | static void octeon_dma_free_coherent(struct device *dev, size_t size, | 194 | static void octeon_dma_free_coherent(struct device *dev, size_t size, |
195 | void *vaddr, dma_addr_t dma_handle) | 195 | void *vaddr, dma_addr_t dma_handle, struct dma_attrs *attrs) |
196 | { | 196 | { |
197 | int order = get_order(size); | 197 | int order = get_order(size); |
198 | 198 | ||
@@ -240,8 +240,8 @@ EXPORT_SYMBOL(dma_to_phys); | |||
240 | 240 | ||
241 | static struct octeon_dma_map_ops octeon_linear_dma_map_ops = { | 241 | static struct octeon_dma_map_ops octeon_linear_dma_map_ops = { |
242 | .dma_map_ops = { | 242 | .dma_map_ops = { |
243 | .alloc_coherent = octeon_dma_alloc_coherent, | 243 | .alloc = octeon_dma_alloc_coherent, |
244 | .free_coherent = octeon_dma_free_coherent, | 244 | .free = octeon_dma_free_coherent, |
245 | .map_page = octeon_dma_map_page, | 245 | .map_page = octeon_dma_map_page, |
246 | .unmap_page = swiotlb_unmap_page, | 246 | .unmap_page = swiotlb_unmap_page, |
247 | .map_sg = octeon_dma_map_sg, | 247 | .map_sg = octeon_dma_map_sg, |
@@ -325,8 +325,8 @@ void __init plat_swiotlb_setup(void) | |||
325 | #ifdef CONFIG_PCI | 325 | #ifdef CONFIG_PCI |
326 | static struct octeon_dma_map_ops _octeon_pci_dma_map_ops = { | 326 | static struct octeon_dma_map_ops _octeon_pci_dma_map_ops = { |
327 | .dma_map_ops = { | 327 | .dma_map_ops = { |
328 | .alloc_coherent = octeon_dma_alloc_coherent, | 328 | .alloc = octeon_dma_alloc_coherent, |
329 | .free_coherent = octeon_dma_free_coherent, | 329 | .free = octeon_dma_free_coherent, |
330 | .map_page = octeon_dma_map_page, | 330 | .map_page = octeon_dma_map_page, |
331 | .unmap_page = swiotlb_unmap_page, | 331 | .unmap_page = swiotlb_unmap_page, |
332 | .map_sg = octeon_dma_map_sg, | 332 | .map_sg = octeon_dma_map_sg, |
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c index c3e2b85c3b02..97e7ce9b50ed 100644 --- a/arch/mips/cavium-octeon/smp.c +++ b/arch/mips/cavium-octeon/smp.c | |||
@@ -78,7 +78,7 @@ static inline void octeon_send_ipi_mask(const struct cpumask *mask, | |||
78 | } | 78 | } |
79 | 79 | ||
80 | /** | 80 | /** |
81 | * Detect available CPUs, populate cpu_possible_map | 81 | * Detect available CPUs, populate cpu_possible_mask |
82 | */ | 82 | */ |
83 | static void octeon_smp_hotplug_setup(void) | 83 | static void octeon_smp_hotplug_setup(void) |
84 | { | 84 | { |
@@ -268,7 +268,7 @@ static int octeon_cpu_disable(void) | |||
268 | 268 | ||
269 | spin_lock(&smp_reserve_lock); | 269 | spin_lock(&smp_reserve_lock); |
270 | 270 | ||
271 | cpu_clear(cpu, cpu_online_map); | 271 | set_cpu_online(cpu, false); |
272 | cpu_clear(cpu, cpu_callin_map); | 272 | cpu_clear(cpu, cpu_callin_map); |
273 | local_irq_disable(); | 273 | local_irq_disable(); |
274 | fixup_irqs(); | 274 | fixup_irqs(); |
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index 7aa37ddfca4b..be39a12901c6 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h | |||
@@ -57,25 +57,31 @@ dma_set_mask(struct device *dev, u64 mask) | |||
57 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 57 | extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
58 | enum dma_data_direction direction); | 58 | enum dma_data_direction direction); |
59 | 59 | ||
60 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 60 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
61 | dma_addr_t *dma_handle, gfp_t gfp) | 61 | |
62 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
63 | dma_addr_t *dma_handle, gfp_t gfp, | ||
64 | struct dma_attrs *attrs) | ||
62 | { | 65 | { |
63 | void *ret; | 66 | void *ret; |
64 | struct dma_map_ops *ops = get_dma_ops(dev); | 67 | struct dma_map_ops *ops = get_dma_ops(dev); |
65 | 68 | ||
66 | ret = ops->alloc_coherent(dev, size, dma_handle, gfp); | 69 | ret = ops->alloc(dev, size, dma_handle, gfp, attrs); |
67 | 70 | ||
68 | debug_dma_alloc_coherent(dev, size, *dma_handle, ret); | 71 | debug_dma_alloc_coherent(dev, size, *dma_handle, ret); |
69 | 72 | ||
70 | return ret; | 73 | return ret; |
71 | } | 74 | } |
72 | 75 | ||
73 | static inline void dma_free_coherent(struct device *dev, size_t size, | 76 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
74 | void *vaddr, dma_addr_t dma_handle) | 77 | |
78 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
79 | void *vaddr, dma_addr_t dma_handle, | ||
80 | struct dma_attrs *attrs) | ||
75 | { | 81 | { |
76 | struct dma_map_ops *ops = get_dma_ops(dev); | 82 | struct dma_map_ops *ops = get_dma_ops(dev); |
77 | 83 | ||
78 | ops->free_coherent(dev, size, vaddr, dma_handle); | 84 | ops->free(dev, size, vaddr, dma_handle, attrs); |
79 | 85 | ||
80 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); | 86 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); |
81 | } | 87 | } |
diff --git a/arch/mips/kernel/mips-mt-fpaff.c b/arch/mips/kernel/mips-mt-fpaff.c index 802e6160f37e..33f63bab478a 100644 --- a/arch/mips/kernel/mips-mt-fpaff.c +++ b/arch/mips/kernel/mips-mt-fpaff.c | |||
@@ -173,7 +173,7 @@ asmlinkage long mipsmt_sys_sched_getaffinity(pid_t pid, unsigned int len, | |||
173 | if (retval) | 173 | if (retval) |
174 | goto out_unlock; | 174 | goto out_unlock; |
175 | 175 | ||
176 | cpus_and(mask, p->thread.user_cpus_allowed, cpu_possible_map); | 176 | cpumask_and(&mask, &p->thread.user_cpus_allowed, cpu_possible_mask); |
177 | 177 | ||
178 | out_unlock: | 178 | out_unlock: |
179 | read_unlock(&tasklist_lock); | 179 | read_unlock(&tasklist_lock); |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index e309665b6c81..f8b2c592514d 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -25,7 +25,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
25 | int i; | 25 | int i; |
26 | 26 | ||
27 | #ifdef CONFIG_SMP | 27 | #ifdef CONFIG_SMP |
28 | if (!cpu_isset(n, cpu_online_map)) | 28 | if (!cpu_online(n)) |
29 | return 0; | 29 | return 0; |
30 | #endif | 30 | #endif |
31 | 31 | ||
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index ca673569fd24..3046e2986006 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c | |||
@@ -317,7 +317,7 @@ static int bmips_cpu_disable(void) | |||
317 | 317 | ||
318 | pr_info("SMP: CPU%d is offline\n", cpu); | 318 | pr_info("SMP: CPU%d is offline\n", cpu); |
319 | 319 | ||
320 | cpu_clear(cpu, cpu_online_map); | 320 | set_cpu_online(cpu, false); |
321 | cpu_clear(cpu, cpu_callin_map); | 321 | cpu_clear(cpu, cpu_callin_map); |
322 | 322 | ||
323 | local_flush_tlb_all(); | 323 | local_flush_tlb_all(); |
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 9c1cce9de35f..ba9376bf52a1 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -148,7 +148,7 @@ static void stop_this_cpu(void *dummy) | |||
148 | /* | 148 | /* |
149 | * Remove this CPU: | 149 | * Remove this CPU: |
150 | */ | 150 | */ |
151 | cpu_clear(smp_processor_id(), cpu_online_map); | 151 | set_cpu_online(smp_processor_id(), false); |
152 | for (;;) { | 152 | for (;;) { |
153 | if (cpu_wait) | 153 | if (cpu_wait) |
154 | (*cpu_wait)(); /* Wait if available. */ | 154 | (*cpu_wait)(); /* Wait if available. */ |
@@ -174,7 +174,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) | |||
174 | mp_ops->prepare_cpus(max_cpus); | 174 | mp_ops->prepare_cpus(max_cpus); |
175 | set_cpu_sibling_map(0); | 175 | set_cpu_sibling_map(0); |
176 | #ifndef CONFIG_HOTPLUG_CPU | 176 | #ifndef CONFIG_HOTPLUG_CPU |
177 | init_cpu_present(&cpu_possible_map); | 177 | init_cpu_present(cpu_possible_mask); |
178 | #endif | 178 | #endif |
179 | } | 179 | } |
180 | 180 | ||
@@ -248,7 +248,7 @@ int __cpuinit __cpu_up(unsigned int cpu) | |||
248 | while (!cpu_isset(cpu, cpu_callin_map)) | 248 | while (!cpu_isset(cpu, cpu_callin_map)) |
249 | udelay(100); | 249 | udelay(100); |
250 | 250 | ||
251 | cpu_set(cpu, cpu_online_map); | 251 | set_cpu_online(cpu, true); |
252 | 252 | ||
253 | return 0; | 253 | return 0; |
254 | } | 254 | } |
@@ -320,13 +320,12 @@ void flush_tlb_mm(struct mm_struct *mm) | |||
320 | if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { | 320 | if ((atomic_read(&mm->mm_users) != 1) || (current->mm != mm)) { |
321 | smp_on_other_tlbs(flush_tlb_mm_ipi, mm); | 321 | smp_on_other_tlbs(flush_tlb_mm_ipi, mm); |
322 | } else { | 322 | } else { |
323 | cpumask_t mask = cpu_online_map; | ||
324 | unsigned int cpu; | 323 | unsigned int cpu; |
325 | 324 | ||
326 | cpu_clear(smp_processor_id(), mask); | 325 | for_each_online_cpu(cpu) { |
327 | for_each_cpu_mask(cpu, mask) | 326 | if (cpu != smp_processor_id() && cpu_context(cpu, mm)) |
328 | if (cpu_context(cpu, mm)) | ||
329 | cpu_context(cpu, mm) = 0; | 327 | cpu_context(cpu, mm) = 0; |
328 | } | ||
330 | } | 329 | } |
331 | local_flush_tlb_mm(mm); | 330 | local_flush_tlb_mm(mm); |
332 | 331 | ||
@@ -360,13 +359,12 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l | |||
360 | 359 | ||
361 | smp_on_other_tlbs(flush_tlb_range_ipi, &fd); | 360 | smp_on_other_tlbs(flush_tlb_range_ipi, &fd); |
362 | } else { | 361 | } else { |
363 | cpumask_t mask = cpu_online_map; | ||
364 | unsigned int cpu; | 362 | unsigned int cpu; |
365 | 363 | ||
366 | cpu_clear(smp_processor_id(), mask); | 364 | for_each_online_cpu(cpu) { |
367 | for_each_cpu_mask(cpu, mask) | 365 | if (cpu != smp_processor_id() && cpu_context(cpu, mm)) |
368 | if (cpu_context(cpu, mm)) | ||
369 | cpu_context(cpu, mm) = 0; | 366 | cpu_context(cpu, mm) = 0; |
367 | } | ||
370 | } | 368 | } |
371 | local_flush_tlb_range(vma, start, end); | 369 | local_flush_tlb_range(vma, start, end); |
372 | preempt_enable(); | 370 | preempt_enable(); |
@@ -407,13 +405,12 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | |||
407 | 405 | ||
408 | smp_on_other_tlbs(flush_tlb_page_ipi, &fd); | 406 | smp_on_other_tlbs(flush_tlb_page_ipi, &fd); |
409 | } else { | 407 | } else { |
410 | cpumask_t mask = cpu_online_map; | ||
411 | unsigned int cpu; | 408 | unsigned int cpu; |
412 | 409 | ||
413 | cpu_clear(smp_processor_id(), mask); | 410 | for_each_online_cpu(cpu) { |
414 | for_each_cpu_mask(cpu, mask) | 411 | if (cpu != smp_processor_id() && cpu_context(cpu, vma->vm_mm)) |
415 | if (cpu_context(cpu, vma->vm_mm)) | ||
416 | cpu_context(cpu, vma->vm_mm) = 0; | 412 | cpu_context(cpu, vma->vm_mm) = 0; |
413 | } | ||
417 | } | 414 | } |
418 | local_flush_tlb_page(vma, page); | 415 | local_flush_tlb_page(vma, page); |
419 | preempt_enable(); | 416 | preempt_enable(); |
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index c4f75bbc0bd6..f5dd38f1d015 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c | |||
@@ -291,7 +291,7 @@ static void smtc_configure_tlb(void) | |||
291 | * possibly leave some TCs/VPEs as "slave" processors. | 291 | * possibly leave some TCs/VPEs as "slave" processors. |
292 | * | 292 | * |
293 | * Use c0_MVPConf0 to find out how many TCs are available, setting up | 293 | * Use c0_MVPConf0 to find out how many TCs are available, setting up |
294 | * cpu_possible_map and the logical/physical mappings. | 294 | * cpu_possible_mask and the logical/physical mappings. |
295 | */ | 295 | */ |
296 | 296 | ||
297 | int __init smtc_build_cpu_map(int start_cpu_slot) | 297 | int __init smtc_build_cpu_map(int start_cpu_slot) |
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c index 1f9ca07f53c8..47037ec5589b 100644 --- a/arch/mips/mm/c-octeon.c +++ b/arch/mips/mm/c-octeon.c | |||
@@ -80,9 +80,9 @@ static void octeon_flush_icache_all_cores(struct vm_area_struct *vma) | |||
80 | if (vma) | 80 | if (vma) |
81 | mask = *mm_cpumask(vma->vm_mm); | 81 | mask = *mm_cpumask(vma->vm_mm); |
82 | else | 82 | else |
83 | mask = cpu_online_map; | 83 | mask = *cpu_online_mask; |
84 | cpu_clear(cpu, mask); | 84 | cpumask_clear_cpu(cpu, &mask); |
85 | for_each_cpu_mask(cpu, mask) | 85 | for_each_cpu(cpu, &mask) |
86 | octeon_send_ipi_single(cpu, SMP_ICACHE_FLUSH); | 86 | octeon_send_ipi_single(cpu, SMP_ICACHE_FLUSH); |
87 | 87 | ||
88 | preempt_enable(); | 88 | preempt_enable(); |
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c index 46084912e588..3fab2046c8a4 100644 --- a/arch/mips/mm/dma-default.c +++ b/arch/mips/mm/dma-default.c | |||
@@ -98,7 +98,7 @@ void *dma_alloc_noncoherent(struct device *dev, size_t size, | |||
98 | EXPORT_SYMBOL(dma_alloc_noncoherent); | 98 | EXPORT_SYMBOL(dma_alloc_noncoherent); |
99 | 99 | ||
100 | static void *mips_dma_alloc_coherent(struct device *dev, size_t size, | 100 | static void *mips_dma_alloc_coherent(struct device *dev, size_t size, |
101 | dma_addr_t * dma_handle, gfp_t gfp) | 101 | dma_addr_t * dma_handle, gfp_t gfp, struct dma_attrs *attrs) |
102 | { | 102 | { |
103 | void *ret; | 103 | void *ret; |
104 | 104 | ||
@@ -132,7 +132,7 @@ void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, | |||
132 | EXPORT_SYMBOL(dma_free_noncoherent); | 132 | EXPORT_SYMBOL(dma_free_noncoherent); |
133 | 133 | ||
134 | static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr, | 134 | static void mips_dma_free_coherent(struct device *dev, size_t size, void *vaddr, |
135 | dma_addr_t dma_handle) | 135 | dma_addr_t dma_handle, struct dma_attrs *attrs) |
136 | { | 136 | { |
137 | unsigned long addr = (unsigned long) vaddr; | 137 | unsigned long addr = (unsigned long) vaddr; |
138 | int order = get_order(size); | 138 | int order = get_order(size); |
@@ -323,8 +323,8 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | |||
323 | EXPORT_SYMBOL(dma_cache_sync); | 323 | EXPORT_SYMBOL(dma_cache_sync); |
324 | 324 | ||
325 | static struct dma_map_ops mips_default_dma_map_ops = { | 325 | static struct dma_map_ops mips_default_dma_map_ops = { |
326 | .alloc_coherent = mips_dma_alloc_coherent, | 326 | .alloc = mips_dma_alloc_coherent, |
327 | .free_coherent = mips_dma_free_coherent, | 327 | .free = mips_dma_free_coherent, |
328 | .map_page = mips_dma_map_page, | 328 | .map_page = mips_dma_map_page, |
329 | .unmap_page = mips_dma_unmap_page, | 329 | .unmap_page = mips_dma_unmap_page, |
330 | .map_sg = mips_dma_map_sg, | 330 | .map_sg = mips_dma_map_sg, |
diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c index db17f49886c2..fab316de57e9 100644 --- a/arch/mips/netlogic/common/smp.c +++ b/arch/mips/netlogic/common/smp.c | |||
@@ -165,7 +165,7 @@ void __init nlm_smp_setup(void) | |||
165 | cpu_set(boot_cpu, phys_cpu_present_map); | 165 | cpu_set(boot_cpu, phys_cpu_present_map); |
166 | __cpu_number_map[boot_cpu] = 0; | 166 | __cpu_number_map[boot_cpu] = 0; |
167 | __cpu_logical_map[0] = boot_cpu; | 167 | __cpu_logical_map[0] = boot_cpu; |
168 | cpu_set(0, cpu_possible_map); | 168 | set_cpu_possible(0, true); |
169 | 169 | ||
170 | num_cpus = 1; | 170 | num_cpus = 1; |
171 | for (i = 0; i < NR_CPUS; i++) { | 171 | for (i = 0; i < NR_CPUS; i++) { |
@@ -177,14 +177,14 @@ void __init nlm_smp_setup(void) | |||
177 | cpu_set(i, phys_cpu_present_map); | 177 | cpu_set(i, phys_cpu_present_map); |
178 | __cpu_number_map[i] = num_cpus; | 178 | __cpu_number_map[i] = num_cpus; |
179 | __cpu_logical_map[num_cpus] = i; | 179 | __cpu_logical_map[num_cpus] = i; |
180 | cpu_set(num_cpus, cpu_possible_map); | 180 | set_cpu_possible(num_cpus, true); |
181 | ++num_cpus; | 181 | ++num_cpus; |
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | pr_info("Phys CPU present map: %lx, possible map %lx\n", | 185 | pr_info("Phys CPU present map: %lx, possible map %lx\n", |
186 | (unsigned long)phys_cpu_present_map.bits[0], | 186 | (unsigned long)phys_cpu_present_map.bits[0], |
187 | (unsigned long)cpu_possible_map.bits[0]); | 187 | (unsigned long)cpumask_bits(cpu_possible_mask)[0]); |
188 | 188 | ||
189 | pr_info("Detected %i Slave CPU(s)\n", num_cpus); | 189 | pr_info("Detected %i Slave CPU(s)\n", num_cpus); |
190 | nlm_set_nmi_handler(nlm_boot_secondary_cpus); | 190 | nlm_set_nmi_handler(nlm_boot_secondary_cpus); |
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c index 2608752898c0..b71fae231049 100644 --- a/arch/mips/pmc-sierra/yosemite/smp.c +++ b/arch/mips/pmc-sierra/yosemite/smp.c | |||
@@ -146,7 +146,7 @@ static void __cpuinit yos_boot_secondary(int cpu, struct task_struct *idle) | |||
146 | } | 146 | } |
147 | 147 | ||
148 | /* | 148 | /* |
149 | * Detect available CPUs, populate cpu_possible_map before smp_init | 149 | * Detect available CPUs, populate cpu_possible_mask before smp_init |
150 | * | 150 | * |
151 | * We don't want to start the secondary CPU yet nor do we have a nice probing | 151 | * We don't want to start the secondary CPU yet nor do we have a nice probing |
152 | * feature in PMON so we just assume presence of the secondary core. | 152 | * feature in PMON so we just assume presence of the secondary core. |
@@ -155,10 +155,10 @@ static void __init yos_smp_setup(void) | |||
155 | { | 155 | { |
156 | int i; | 156 | int i; |
157 | 157 | ||
158 | cpus_clear(cpu_possible_map); | 158 | init_cpu_possible(cpu_none_mask); |
159 | 159 | ||
160 | for (i = 0; i < 2; i++) { | 160 | for (i = 0; i < 2; i++) { |
161 | cpu_set(i, cpu_possible_map); | 161 | set_cpu_possible(i, true); |
162 | __cpu_number_map[i] = i; | 162 | __cpu_number_map[i] = i; |
163 | __cpu_logical_map[i] = i; | 163 | __cpu_logical_map[i] = i; |
164 | } | 164 | } |
@@ -169,7 +169,7 @@ static void __init yos_prepare_cpus(unsigned int max_cpus) | |||
169 | /* | 169 | /* |
170 | * Be paranoid. Enable the IPI only if we're really about to go SMP. | 170 | * Be paranoid. Enable the IPI only if we're really about to go SMP. |
171 | */ | 171 | */ |
172 | if (cpus_weight(cpu_possible_map)) | 172 | if (num_possible_cpus()) |
173 | set_c0_status(STATUSF_IP5); | 173 | set_c0_status(STATUSF_IP5); |
174 | } | 174 | } |
175 | 175 | ||
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c index c6851df9ab74..735b43bf8f82 100644 --- a/arch/mips/sgi-ip27/ip27-smp.c +++ b/arch/mips/sgi-ip27/ip27-smp.c | |||
@@ -76,7 +76,7 @@ static int do_cpumask(cnodeid_t cnode, nasid_t nasid, int highest) | |||
76 | /* Only let it join in if it's marked enabled */ | 76 | /* Only let it join in if it's marked enabled */ |
77 | if ((acpu->cpu_info.flags & KLINFO_ENABLE) && | 77 | if ((acpu->cpu_info.flags & KLINFO_ENABLE) && |
78 | (tot_cpus_found != NR_CPUS)) { | 78 | (tot_cpus_found != NR_CPUS)) { |
79 | cpu_set(cpuid, cpu_possible_map); | 79 | set_cpu_possible(cpuid, true); |
80 | alloc_cpupda(cpuid, tot_cpus_found); | 80 | alloc_cpupda(cpuid, tot_cpus_found); |
81 | cpus_found++; | 81 | cpus_found++; |
82 | tot_cpus_found++; | 82 | tot_cpus_found++; |
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c index d667875be564..de88e22694a0 100644 --- a/arch/mips/sibyte/bcm1480/smp.c +++ b/arch/mips/sibyte/bcm1480/smp.c | |||
@@ -138,7 +138,7 @@ static void __cpuinit bcm1480_boot_secondary(int cpu, struct task_struct *idle) | |||
138 | 138 | ||
139 | /* | 139 | /* |
140 | * Use CFE to find out how many CPUs are available, setting up | 140 | * Use CFE to find out how many CPUs are available, setting up |
141 | * cpu_possible_map and the logical/physical mappings. | 141 | * cpu_possible_mask and the logical/physical mappings. |
142 | * XXXKW will the boot CPU ever not be physical 0? | 142 | * XXXKW will the boot CPU ever not be physical 0? |
143 | * | 143 | * |
144 | * Common setup before any secondaries are started | 144 | * Common setup before any secondaries are started |
@@ -147,14 +147,13 @@ static void __init bcm1480_smp_setup(void) | |||
147 | { | 147 | { |
148 | int i, num; | 148 | int i, num; |
149 | 149 | ||
150 | cpus_clear(cpu_possible_map); | 150 | init_cpu_possible(cpumask_of(0)); |
151 | cpu_set(0, cpu_possible_map); | ||
152 | __cpu_number_map[0] = 0; | 151 | __cpu_number_map[0] = 0; |
153 | __cpu_logical_map[0] = 0; | 152 | __cpu_logical_map[0] = 0; |
154 | 153 | ||
155 | for (i = 1, num = 0; i < NR_CPUS; i++) { | 154 | for (i = 1, num = 0; i < NR_CPUS; i++) { |
156 | if (cfe_cpu_stop(i) == 0) { | 155 | if (cfe_cpu_stop(i) == 0) { |
157 | cpu_set(i, cpu_possible_map); | 156 | set_cpu_possible(i, true); |
158 | __cpu_number_map[i] = ++num; | 157 | __cpu_number_map[i] = ++num; |
159 | __cpu_logical_map[num] = i; | 158 | __cpu_logical_map[num] = i; |
160 | } | 159 | } |
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c index 38e7f6bd7922..285cfef4ebc0 100644 --- a/arch/mips/sibyte/sb1250/smp.c +++ b/arch/mips/sibyte/sb1250/smp.c | |||
@@ -126,7 +126,7 @@ static void __cpuinit sb1250_boot_secondary(int cpu, struct task_struct *idle) | |||
126 | 126 | ||
127 | /* | 127 | /* |
128 | * Use CFE to find out how many CPUs are available, setting up | 128 | * Use CFE to find out how many CPUs are available, setting up |
129 | * cpu_possible_map and the logical/physical mappings. | 129 | * cpu_possible_mask and the logical/physical mappings. |
130 | * XXXKW will the boot CPU ever not be physical 0? | 130 | * XXXKW will the boot CPU ever not be physical 0? |
131 | * | 131 | * |
132 | * Common setup before any secondaries are started | 132 | * Common setup before any secondaries are started |
@@ -135,14 +135,13 @@ static void __init sb1250_smp_setup(void) | |||
135 | { | 135 | { |
136 | int i, num; | 136 | int i, num; |
137 | 137 | ||
138 | cpus_clear(cpu_possible_map); | 138 | init_cpu_possible(cpumask_of(0)); |
139 | cpu_set(0, cpu_possible_map); | ||
140 | __cpu_number_map[0] = 0; | 139 | __cpu_number_map[0] = 0; |
141 | __cpu_logical_map[0] = 0; | 140 | __cpu_logical_map[0] = 0; |
142 | 141 | ||
143 | for (i = 1, num = 0; i < NR_CPUS; i++) { | 142 | for (i = 1, num = 0; i < NR_CPUS; i++) { |
144 | if (cfe_cpu_stop(i) == 0) { | 143 | if (cfe_cpu_stop(i) == 0) { |
145 | cpu_set(i, cpu_possible_map); | 144 | set_cpu_possible(i, true); |
146 | __cpu_number_map[i] = ++num; | 145 | __cpu_number_map[i] = ++num; |
147 | __cpu_logical_map[num] = i; | 146 | __cpu_logical_map[num] = i; |
148 | } | 147 | } |
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h index 3ae56073cc3d..6c6defc24619 100644 --- a/arch/parisc/include/asm/atomic.h +++ b/arch/parisc/include/asm/atomic.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #define _ASM_PARISC_ATOMIC_H_ | 6 | #define _ASM_PARISC_ATOMIC_H_ |
7 | 7 | ||
8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
9 | #include <asm/cmpxchg.h> | ||
9 | 10 | ||
10 | /* | 11 | /* |
11 | * Atomic operations that C can't guarantee us. Useful for | 12 | * Atomic operations that C can't guarantee us. Useful for |
@@ -48,112 +49,6 @@ extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; | |||
48 | # define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0) | 49 | # define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0) |
49 | #endif | 50 | #endif |
50 | 51 | ||
51 | /* This should get optimized out since it's never called. | ||
52 | ** Or get a link error if xchg is used "wrong". | ||
53 | */ | ||
54 | extern void __xchg_called_with_bad_pointer(void); | ||
55 | |||
56 | |||
57 | /* __xchg32/64 defined in arch/parisc/lib/bitops.c */ | ||
58 | extern unsigned long __xchg8(char, char *); | ||
59 | extern unsigned long __xchg32(int, int *); | ||
60 | #ifdef CONFIG_64BIT | ||
61 | extern unsigned long __xchg64(unsigned long, unsigned long *); | ||
62 | #endif | ||
63 | |||
64 | /* optimizer better get rid of switch since size is a constant */ | ||
65 | static __inline__ unsigned long | ||
66 | __xchg(unsigned long x, __volatile__ void * ptr, int size) | ||
67 | { | ||
68 | switch(size) { | ||
69 | #ifdef CONFIG_64BIT | ||
70 | case 8: return __xchg64(x,(unsigned long *) ptr); | ||
71 | #endif | ||
72 | case 4: return __xchg32((int) x, (int *) ptr); | ||
73 | case 1: return __xchg8((char) x, (char *) ptr); | ||
74 | } | ||
75 | __xchg_called_with_bad_pointer(); | ||
76 | return x; | ||
77 | } | ||
78 | |||
79 | |||
80 | /* | ||
81 | ** REVISIT - Abandoned use of LDCW in xchg() for now: | ||
82 | ** o need to test sizeof(*ptr) to avoid clearing adjacent bytes | ||
83 | ** o and while we are at it, could CONFIG_64BIT code use LDCD too? | ||
84 | ** | ||
85 | ** if (__builtin_constant_p(x) && (x == NULL)) | ||
86 | ** if (((unsigned long)p & 0xf) == 0) | ||
87 | ** return __ldcw(p); | ||
88 | */ | ||
89 | #define xchg(ptr,x) \ | ||
90 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) | ||
91 | |||
92 | |||
93 | #define __HAVE_ARCH_CMPXCHG 1 | ||
94 | |||
95 | /* bug catcher for when unsupported size is used - won't link */ | ||
96 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
97 | |||
98 | /* __cmpxchg_u32/u64 defined in arch/parisc/lib/bitops.c */ | ||
99 | extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old, unsigned int new_); | ||
100 | extern unsigned long __cmpxchg_u64(volatile unsigned long *ptr, unsigned long old, unsigned long new_); | ||
101 | |||
102 | /* don't worry...optimizer will get rid of most of this */ | ||
103 | static __inline__ unsigned long | ||
104 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) | ||
105 | { | ||
106 | switch(size) { | ||
107 | #ifdef CONFIG_64BIT | ||
108 | case 8: return __cmpxchg_u64((unsigned long *)ptr, old, new_); | ||
109 | #endif | ||
110 | case 4: return __cmpxchg_u32((unsigned int *)ptr, (unsigned int) old, (unsigned int) new_); | ||
111 | } | ||
112 | __cmpxchg_called_with_bad_pointer(); | ||
113 | return old; | ||
114 | } | ||
115 | |||
116 | #define cmpxchg(ptr,o,n) \ | ||
117 | ({ \ | ||
118 | __typeof__(*(ptr)) _o_ = (o); \ | ||
119 | __typeof__(*(ptr)) _n_ = (n); \ | ||
120 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | ||
121 | (unsigned long)_n_, sizeof(*(ptr))); \ | ||
122 | }) | ||
123 | |||
124 | #include <asm-generic/cmpxchg-local.h> | ||
125 | |||
126 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
127 | unsigned long old, | ||
128 | unsigned long new_, int size) | ||
129 | { | ||
130 | switch (size) { | ||
131 | #ifdef CONFIG_64BIT | ||
132 | case 8: return __cmpxchg_u64((unsigned long *)ptr, old, new_); | ||
133 | #endif | ||
134 | case 4: return __cmpxchg_u32(ptr, old, new_); | ||
135 | default: | ||
136 | return __cmpxchg_local_generic(ptr, old, new_, size); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | /* | ||
141 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
142 | * them available. | ||
143 | */ | ||
144 | #define cmpxchg_local(ptr, o, n) \ | ||
145 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | ||
146 | (unsigned long)(n), sizeof(*(ptr)))) | ||
147 | #ifdef CONFIG_64BIT | ||
148 | #define cmpxchg64_local(ptr, o, n) \ | ||
149 | ({ \ | ||
150 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
151 | cmpxchg_local((ptr), (o), (n)); \ | ||
152 | }) | ||
153 | #else | ||
154 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
155 | #endif | ||
156 | |||
157 | /* | 52 | /* |
158 | * Note that we need not lock read accesses - aligned word writes/reads | 53 | * Note that we need not lock read accesses - aligned word writes/reads |
159 | * are atomic, so a reader never sees inconsistent values. | 54 | * are atomic, so a reader never sees inconsistent values. |
diff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h new file mode 100644 index 000000000000..dbd13354ec41 --- /dev/null +++ b/arch/parisc/include/asm/cmpxchg.h | |||
@@ -0,0 +1,116 @@ | |||
1 | /* | ||
2 | * forked from parisc asm/atomic.h which was: | ||
3 | * Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org> | ||
4 | * Copyright (C) 2006 Kyle McMartin <kyle@parisc-linux.org> | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASM_PARISC_CMPXCHG_H_ | ||
8 | #define _ASM_PARISC_CMPXCHG_H_ | ||
9 | |||
10 | /* This should get optimized out since it's never called. | ||
11 | ** Or get a link error if xchg is used "wrong". | ||
12 | */ | ||
13 | extern void __xchg_called_with_bad_pointer(void); | ||
14 | |||
15 | /* __xchg32/64 defined in arch/parisc/lib/bitops.c */ | ||
16 | extern unsigned long __xchg8(char, char *); | ||
17 | extern unsigned long __xchg32(int, int *); | ||
18 | #ifdef CONFIG_64BIT | ||
19 | extern unsigned long __xchg64(unsigned long, unsigned long *); | ||
20 | #endif | ||
21 | |||
22 | /* optimizer better get rid of switch since size is a constant */ | ||
23 | static inline unsigned long | ||
24 | __xchg(unsigned long x, __volatile__ void *ptr, int size) | ||
25 | { | ||
26 | switch (size) { | ||
27 | #ifdef CONFIG_64BIT | ||
28 | case 8: return __xchg64(x, (unsigned long *) ptr); | ||
29 | #endif | ||
30 | case 4: return __xchg32((int) x, (int *) ptr); | ||
31 | case 1: return __xchg8((char) x, (char *) ptr); | ||
32 | } | ||
33 | __xchg_called_with_bad_pointer(); | ||
34 | return x; | ||
35 | } | ||
36 | |||
37 | /* | ||
38 | ** REVISIT - Abandoned use of LDCW in xchg() for now: | ||
39 | ** o need to test sizeof(*ptr) to avoid clearing adjacent bytes | ||
40 | ** o and while we are at it, could CONFIG_64BIT code use LDCD too? | ||
41 | ** | ||
42 | ** if (__builtin_constant_p(x) && (x == NULL)) | ||
43 | ** if (((unsigned long)p & 0xf) == 0) | ||
44 | ** return __ldcw(p); | ||
45 | */ | ||
46 | #define xchg(ptr, x) \ | ||
47 | ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) | ||
48 | |||
49 | #define __HAVE_ARCH_CMPXCHG 1 | ||
50 | |||
51 | /* bug catcher for when unsupported size is used - won't link */ | ||
52 | extern void __cmpxchg_called_with_bad_pointer(void); | ||
53 | |||
54 | /* __cmpxchg_u32/u64 defined in arch/parisc/lib/bitops.c */ | ||
55 | extern unsigned long __cmpxchg_u32(volatile unsigned int *m, unsigned int old, | ||
56 | unsigned int new_); | ||
57 | extern unsigned long __cmpxchg_u64(volatile unsigned long *ptr, | ||
58 | unsigned long old, unsigned long new_); | ||
59 | |||
60 | /* don't worry...optimizer will get rid of most of this */ | ||
61 | static inline unsigned long | ||
62 | __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) | ||
63 | { | ||
64 | switch (size) { | ||
65 | #ifdef CONFIG_64BIT | ||
66 | case 8: return __cmpxchg_u64((unsigned long *)ptr, old, new_); | ||
67 | #endif | ||
68 | case 4: return __cmpxchg_u32((unsigned int *)ptr, | ||
69 | (unsigned int)old, (unsigned int)new_); | ||
70 | } | ||
71 | __cmpxchg_called_with_bad_pointer(); | ||
72 | return old; | ||
73 | } | ||
74 | |||
75 | #define cmpxchg(ptr, o, n) \ | ||
76 | ({ \ | ||
77 | __typeof__(*(ptr)) _o_ = (o); \ | ||
78 | __typeof__(*(ptr)) _n_ = (n); \ | ||
79 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | ||
80 | (unsigned long)_n_, sizeof(*(ptr))); \ | ||
81 | }) | ||
82 | |||
83 | #include <asm-generic/cmpxchg-local.h> | ||
84 | |||
85 | static inline unsigned long __cmpxchg_local(volatile void *ptr, | ||
86 | unsigned long old, | ||
87 | unsigned long new_, int size) | ||
88 | { | ||
89 | switch (size) { | ||
90 | #ifdef CONFIG_64BIT | ||
91 | case 8: return __cmpxchg_u64((unsigned long *)ptr, old, new_); | ||
92 | #endif | ||
93 | case 4: return __cmpxchg_u32(ptr, old, new_); | ||
94 | default: | ||
95 | return __cmpxchg_local_generic(ptr, old, new_, size); | ||
96 | } | ||
97 | } | ||
98 | |||
99 | /* | ||
100 | * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make | ||
101 | * them available. | ||
102 | */ | ||
103 | #define cmpxchg_local(ptr, o, n) \ | ||
104 | ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \ | ||
105 | (unsigned long)(n), sizeof(*(ptr)))) | ||
106 | #ifdef CONFIG_64BIT | ||
107 | #define cmpxchg64_local(ptr, o, n) \ | ||
108 | ({ \ | ||
109 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
110 | cmpxchg_local((ptr), (o), (n)); \ | ||
111 | }) | ||
112 | #else | ||
113 | #define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) | ||
114 | #endif | ||
115 | |||
116 | #endif /* _ASM_PARISC_CMPXCHG_H_ */ | ||
diff --git a/arch/powerpc/boot/dts/p1020mbg-pc.dtsi b/arch/powerpc/boot/dts/p1020mbg-pc.dtsi new file mode 100644 index 000000000000..a24699cfea9c --- /dev/null +++ b/arch/powerpc/boot/dts/p1020mbg-pc.dtsi | |||
@@ -0,0 +1,151 @@ | |||
1 | /* | ||
2 | * P1020 MBG-PC Device Tree Source stub (no addresses or top-level ranges) | ||
3 | * | ||
4 | * Copyright 2012 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * * Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * * Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * * Neither the name of Freescale Semiconductor nor the | ||
14 | * names of its contributors may be used to endorse or promote products | ||
15 | * derived from this software without specific prior written permission. | ||
16 | * | ||
17 | * | ||
18 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") as published by the Free Software | ||
20 | * Foundation, either version 2 of that License or (at your option) any | ||
21 | * later version. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
24 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
27 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | &lbc { | ||
36 | nor@0,0 { | ||
37 | #address-cells = <1>; | ||
38 | #size-cells = <1>; | ||
39 | compatible = "cfi-flash"; | ||
40 | reg = <0x0 0x0 0x4000000>; | ||
41 | bank-width = <2>; | ||
42 | device-width = <1>; | ||
43 | |||
44 | partition@0 { | ||
45 | /* 128KB for DTB Image */ | ||
46 | reg = <0x0 0x00020000>; | ||
47 | label = "NOR DTB Image"; | ||
48 | }; | ||
49 | |||
50 | partition@20000 { | ||
51 | /* 3.875 MB for Linux Kernel Image */ | ||
52 | reg = <0x00020000 0x003e0000>; | ||
53 | label = "NOR Linux Kernel Image"; | ||
54 | }; | ||
55 | |||
56 | partition@400000 { | ||
57 | /* 58MB for Root file System */ | ||
58 | reg = <0x00400000 0x03a00000>; | ||
59 | label = "NOR Root File System"; | ||
60 | }; | ||
61 | |||
62 | partition@3e00000 { | ||
63 | /* This location must not be altered */ | ||
64 | /* 1M for Vitesse 7385 Switch firmware */ | ||
65 | reg = <0x3e00000 0x00100000>; | ||
66 | label = "NOR Vitesse-7385 Firmware"; | ||
67 | read-only; | ||
68 | }; | ||
69 | |||
70 | partition@3f00000 { | ||
71 | /* This location must not be altered */ | ||
72 | /* 512KB for u-boot Bootloader Image */ | ||
73 | /* 512KB for u-boot Environment Variables */ | ||
74 | reg = <0x03f00000 0x00100000>; | ||
75 | label = "NOR U-Boot Image"; | ||
76 | read-only; | ||
77 | }; | ||
78 | }; | ||
79 | |||
80 | L2switch@2,0 { | ||
81 | #address-cells = <1>; | ||
82 | #size-cells = <1>; | ||
83 | compatible = "vitesse-7385"; | ||
84 | reg = <0x2 0x0 0x20000>; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | &soc { | ||
89 | i2c@3000 { | ||
90 | rtc@68 { | ||
91 | compatible = "dallas,ds1339"; | ||
92 | reg = <0x68>; | ||
93 | }; | ||
94 | }; | ||
95 | |||
96 | mdio@24000 { | ||
97 | phy0: ethernet-phy@0 { | ||
98 | interrupts = <3 1 0 0>; | ||
99 | reg = <0x0>; | ||
100 | }; | ||
101 | phy1: ethernet-phy@1 { | ||
102 | interrupts = <2 1 0 0>; | ||
103 | reg = <0x1>; | ||
104 | }; | ||
105 | }; | ||
106 | |||
107 | mdio@25000 { | ||
108 | tbi1: tbi-phy@11 { | ||
109 | reg = <0x11>; | ||
110 | device_type = "tbi-phy"; | ||
111 | }; | ||
112 | }; | ||
113 | |||
114 | mdio@26000 { | ||
115 | tbi2: tbi-phy@11 { | ||
116 | reg = <0x11>; | ||
117 | device_type = "tbi-phy"; | ||
118 | }; | ||
119 | }; | ||
120 | |||
121 | enet0: ethernet@b0000 { | ||
122 | fixed-link = <1 1 1000 0 0>; | ||
123 | phy-connection-type = "rgmii-id"; | ||
124 | }; | ||
125 | |||
126 | enet1: ethernet@b1000 { | ||
127 | phy-handle = <&phy0>; | ||
128 | tbi-handle = <&tbi1>; | ||
129 | phy-connection-type = "sgmii"; | ||
130 | }; | ||
131 | |||
132 | enet2: ethernet@b2000 { | ||
133 | phy-handle = <&phy1>; | ||
134 | phy-connection-type = "rgmii-id"; | ||
135 | }; | ||
136 | |||
137 | usb@22000 { | ||
138 | phy_type = "ulpi"; | ||
139 | }; | ||
140 | |||
141 | /* USB2 is shared with localbus, so it must be disabled | ||
142 | by default. We can't put 'status = "disabled";' here | ||
143 | since U-Boot doesn't clear the status property when | ||
144 | it enables USB2. OTOH, U-Boot does create a new node | ||
145 | when there isn't any. So, just comment it out. | ||
146 | */ | ||
147 | usb@23000 { | ||
148 | status = "disabled"; | ||
149 | phy_type = "ulpi"; | ||
150 | }; | ||
151 | }; | ||
diff --git a/arch/powerpc/boot/dts/p1020mbg-pc_32b.dts b/arch/powerpc/boot/dts/p1020mbg-pc_32b.dts new file mode 100644 index 000000000000..ab8f076eae90 --- /dev/null +++ b/arch/powerpc/boot/dts/p1020mbg-pc_32b.dts | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * P1020 MBG-PC Device Tree Source (32-bit address map) | ||
3 | * | ||
4 | * Copyright 2012 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * * Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * * Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * * Neither the name of Freescale Semiconductor nor the | ||
14 | * names of its contributors may be used to endorse or promote products | ||
15 | * derived from this software without specific prior written permission. | ||
16 | * | ||
17 | * | ||
18 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") as published by the Free Software | ||
20 | * Foundation, either version 2 of that License or (at your option) any | ||
21 | * later version. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
24 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
27 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | /include/ "fsl/p1020si-pre.dtsi" | ||
36 | / { | ||
37 | model = "fsl,P1020MBG-PC"; | ||
38 | compatible = "fsl,P1020MBG-PC"; | ||
39 | |||
40 | memory { | ||
41 | device_type = "memory"; | ||
42 | }; | ||
43 | |||
44 | lbc: localbus@ffe05000 { | ||
45 | reg = <0x0 0xffe05000 0x0 0x1000>; | ||
46 | |||
47 | /* NOR and L2 switch */ | ||
48 | ranges = <0x0 0x0 0x0 0xec000000 0x04000000 | ||
49 | 0x1 0x0 0x0 0xffa00000 0x00040000 | ||
50 | 0x2 0x0 0x0 0xffb00000 0x00020000>; | ||
51 | }; | ||
52 | |||
53 | soc: soc@ffe00000 { | ||
54 | ranges = <0x0 0x0 0xffe00000 0x100000>; | ||
55 | }; | ||
56 | |||
57 | pci0: pcie@ffe09000 { | ||
58 | reg = <0x0 0xffe09000 0x0 0x1000>; | ||
59 | ranges = <0x2000000 0x0 0xe0000000 0x0 0xa0000000 0x0 0x20000000 | ||
60 | 0x1000000 0x0 0x00000000 0x0 0xffc10000 0x0 0x10000>; | ||
61 | pcie@0 { | ||
62 | ranges = <0x2000000 0x0 0xe0000000 | ||
63 | 0x2000000 0x0 0xe0000000 | ||
64 | 0x0 0x20000000 | ||
65 | |||
66 | 0x1000000 0x0 0x0 | ||
67 | 0x1000000 0x0 0x0 | ||
68 | 0x0 0x100000>; | ||
69 | }; | ||
70 | }; | ||
71 | |||
72 | pci1: pcie@ffe0a000 { | ||
73 | reg = <0x0 0xffe0a000 0x0 0x1000>; | ||
74 | ranges = <0x2000000 0x0 0xe0000000 0x0 0x80000000 0x0 0x20000000 | ||
75 | 0x1000000 0x0 0x00000000 0x0 0xffc00000 0x0 0x10000>; | ||
76 | pcie@0 { | ||
77 | ranges = <0x2000000 0x0 0xe0000000 | ||
78 | 0x2000000 0x0 0xe0000000 | ||
79 | 0x0 0x20000000 | ||
80 | |||
81 | 0x1000000 0x0 0x0 | ||
82 | 0x1000000 0x0 0x0 | ||
83 | 0x0 0x100000>; | ||
84 | }; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | /include/ "p1020mbg-pc.dtsi" | ||
89 | /include/ "fsl/p1020si-post.dtsi" | ||
diff --git a/arch/powerpc/boot/dts/p1020mbg-pc_36b.dts b/arch/powerpc/boot/dts/p1020mbg-pc_36b.dts new file mode 100644 index 000000000000..9e9f401419b1 --- /dev/null +++ b/arch/powerpc/boot/dts/p1020mbg-pc_36b.dts | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * P1020 MBG-PC Device Tree Source (36-bit address map) | ||
3 | * | ||
4 | * Copyright 2012 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * * Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * * Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * * Neither the name of Freescale Semiconductor nor the | ||
14 | * names of its contributors may be used to endorse or promote products | ||
15 | * derived from this software without specific prior written permission. | ||
16 | * | ||
17 | * | ||
18 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") as published by the Free Software | ||
20 | * Foundation, either version 2 of that License or (at your option) any | ||
21 | * later version. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
24 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
27 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | /include/ "fsl/p1020si-pre.dtsi" | ||
36 | / { | ||
37 | model = "fsl,P1020MBG-PC"; | ||
38 | compatible = "fsl,P1020MBG-PC"; | ||
39 | |||
40 | memory { | ||
41 | device_type = "memory"; | ||
42 | }; | ||
43 | |||
44 | lbc: localbus@fffe05000 { | ||
45 | reg = <0xf 0xffe05000 0x0 0x1000>; | ||
46 | |||
47 | /* NOR and L2 switch */ | ||
48 | ranges = <0x0 0x0 0xf 0xec000000 0x04000000 | ||
49 | 0x1 0x0 0xf 0xffa00000 0x00040000 | ||
50 | 0x2 0x0 0xf 0xffb00000 0x00020000>; | ||
51 | }; | ||
52 | |||
53 | soc: soc@fffe00000 { | ||
54 | ranges = <0x0 0xf 0xffe00000 0x100000>; | ||
55 | }; | ||
56 | |||
57 | pci0: pcie@fffe09000 { | ||
58 | reg = <0xf 0xffe09000 0x0 0x1000>; | ||
59 | ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | ||
60 | 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>; | ||
61 | pcie@0 { | ||
62 | ranges = <0x2000000 0x0 0xe0000000 | ||
63 | 0x2000000 0x0 0xe0000000 | ||
64 | 0x0 0x20000000 | ||
65 | |||
66 | 0x1000000 0x0 0x0 | ||
67 | 0x1000000 0x0 0x0 | ||
68 | 0x0 0x100000>; | ||
69 | }; | ||
70 | }; | ||
71 | |||
72 | pci1: pcie@fffe0a000 { | ||
73 | reg = <0xf 0xffe0a000 0 0x1000>; | ||
74 | ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | ||
75 | 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; | ||
76 | pcie@0 { | ||
77 | ranges = <0x2000000 0x0 0xe0000000 | ||
78 | 0x2000000 0x0 0xe0000000 | ||
79 | 0x0 0x20000000 | ||
80 | |||
81 | 0x1000000 0x0 0x0 | ||
82 | 0x1000000 0x0 0x0 | ||
83 | 0x0 0x100000>; | ||
84 | }; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | /include/ "p1020mbg-pc.dtsi" | ||
89 | /include/ "fsl/p1020si-post.dtsi" | ||
diff --git a/arch/powerpc/boot/dts/p1020utm-pc.dtsi b/arch/powerpc/boot/dts/p1020utm-pc.dtsi new file mode 100644 index 000000000000..7ea85eabcc5c --- /dev/null +++ b/arch/powerpc/boot/dts/p1020utm-pc.dtsi | |||
@@ -0,0 +1,140 @@ | |||
1 | /* | ||
2 | * P1020 UTM-PC Device Tree Source stub (no addresses or top-level ranges) | ||
3 | * | ||
4 | * Copyright 2012 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * * Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * * Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * * Neither the name of Freescale Semiconductor nor the | ||
14 | * names of its contributors may be used to endorse or promote products | ||
15 | * derived from this software without specific prior written permission. | ||
16 | * | ||
17 | * | ||
18 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") as published by the Free Software | ||
20 | * Foundation, either version 2 of that License or (at your option) any | ||
21 | * later version. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
24 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
27 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | &lbc { | ||
36 | nor@0,0 { | ||
37 | #address-cells = <1>; | ||
38 | #size-cells = <1>; | ||
39 | compatible = "cfi-flash"; | ||
40 | reg = <0x0 0x0 0x2000000>; | ||
41 | bank-width = <2>; | ||
42 | device-width = <1>; | ||
43 | |||
44 | partition@0 { | ||
45 | /* 256KB for DTB Image */ | ||
46 | reg = <0x0 0x00040000>; | ||
47 | label = "NOR DTB Image"; | ||
48 | }; | ||
49 | |||
50 | partition@40000 { | ||
51 | /* 3.75 MB for Linux Kernel Image */ | ||
52 | reg = <0x00040000 0x003c0000>; | ||
53 | label = "NOR Linux Kernel Image"; | ||
54 | }; | ||
55 | |||
56 | partition@400000 { | ||
57 | /* 27MB for Root file System */ | ||
58 | reg = <0x00400000 0x01b00000>; | ||
59 | label = "NOR Root File System"; | ||
60 | }; | ||
61 | |||
62 | partition@1f00000 { | ||
63 | /* This location must not be altered */ | ||
64 | /* 512KB for u-boot Bootloader Image */ | ||
65 | /* 512KB for u-boot Environment Variables */ | ||
66 | reg = <0x01f00000 0x00100000>; | ||
67 | label = "NOR U-Boot Image"; | ||
68 | read-only; | ||
69 | }; | ||
70 | }; | ||
71 | }; | ||
72 | |||
73 | &soc { | ||
74 | i2c@3000 { | ||
75 | rtc@68 { | ||
76 | compatible = "dallas,ds1339"; | ||
77 | reg = <0x68>; | ||
78 | }; | ||
79 | }; | ||
80 | |||
81 | mdio@24000 { | ||
82 | phy0: ethernet-phy@0 { | ||
83 | interrupts = <3 1 0 0>; | ||
84 | reg = <0x0>; | ||
85 | }; | ||
86 | phy1: ethernet-phy@1 { | ||
87 | interrupts = <2 1 0 0>; | ||
88 | reg = <0x1>; | ||
89 | }; | ||
90 | phy2: ethernet-phy@2 { | ||
91 | interrupts = <1 1 0 0>; | ||
92 | reg = <0x2>; | ||
93 | }; | ||
94 | }; | ||
95 | |||
96 | mdio@25000 { | ||
97 | tbi1: tbi-phy@11 { | ||
98 | reg = <0x11>; | ||
99 | device_type = "tbi-phy"; | ||
100 | }; | ||
101 | }; | ||
102 | |||
103 | mdio@26000 { | ||
104 | tbi2: tbi-phy@11 { | ||
105 | reg = <0x11>; | ||
106 | device_type = "tbi-phy"; | ||
107 | }; | ||
108 | }; | ||
109 | |||
110 | enet0: ethernet@b0000 { | ||
111 | phy-handle = <&phy2>; | ||
112 | phy-connection-type = "rgmii-id"; | ||
113 | }; | ||
114 | |||
115 | enet1: ethernet@b1000 { | ||
116 | phy-handle = <&phy0>; | ||
117 | tbi-handle = <&tbi1>; | ||
118 | phy-connection-type = "sgmii"; | ||
119 | }; | ||
120 | |||
121 | enet2: ethernet@b2000 { | ||
122 | phy-handle = <&phy1>; | ||
123 | phy-connection-type = "rgmii-id"; | ||
124 | }; | ||
125 | |||
126 | usb@22000 { | ||
127 | phy_type = "ulpi"; | ||
128 | }; | ||
129 | |||
130 | /* USB2 is shared with localbus, so it must be disabled | ||
131 | by default. We can't put 'status = "disabled";' here | ||
132 | since U-Boot doesn't clear the status property when | ||
133 | it enables USB2. OTOH, U-Boot does create a new node | ||
134 | when there isn't any. So, just comment it out. | ||
135 | */ | ||
136 | usb@23000 { | ||
137 | status = "disabled"; | ||
138 | phy_type = "ulpi"; | ||
139 | }; | ||
140 | }; | ||
diff --git a/arch/powerpc/boot/dts/p1020utm-pc_32b.dts b/arch/powerpc/boot/dts/p1020utm-pc_32b.dts new file mode 100644 index 000000000000..4bfdd8971cdb --- /dev/null +++ b/arch/powerpc/boot/dts/p1020utm-pc_32b.dts | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * P1020 UTM-PC Device Tree Source (32-bit address map) | ||
3 | * | ||
4 | * Copyright 2012 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * * Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * * Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * * Neither the name of Freescale Semiconductor nor the | ||
14 | * names of its contributors may be used to endorse or promote products | ||
15 | * derived from this software without specific prior written permission. | ||
16 | * | ||
17 | * | ||
18 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") as published by the Free Software | ||
20 | * Foundation, either version 2 of that License or (at your option) any | ||
21 | * later version. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
24 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
27 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | /include/ "fsl/p1020si-pre.dtsi" | ||
36 | / { | ||
37 | model = "fsl,P1020UTM-PC"; | ||
38 | compatible = "fsl,P1020UTM-PC"; | ||
39 | |||
40 | memory { | ||
41 | device_type = "memory"; | ||
42 | }; | ||
43 | |||
44 | lbc: localbus@ffe05000 { | ||
45 | reg = <0x0 0xffe05000 0x0 0x1000>; | ||
46 | |||
47 | /* NOR */ | ||
48 | ranges = <0x0 0x0 0x0 0xec000000 0x02000000 | ||
49 | 0x1 0x0 0x0 0xffa00000 0x00040000 | ||
50 | 0x2 0x0 0x0 0xffb00000 0x00020000>; | ||
51 | }; | ||
52 | |||
53 | soc: soc@ffe00000 { | ||
54 | ranges = <0x0 0x0 0xffe00000 0x100000>; | ||
55 | }; | ||
56 | |||
57 | pci0: pcie@ffe09000 { | ||
58 | reg = <0x0 0xffe09000 0x0 0x1000>; | ||
59 | ranges = <0x2000000 0x0 0xe0000000 0x0 0xa0000000 0x0 0x20000000 | ||
60 | 0x1000000 0x0 0x00000000 0x0 0xffc10000 0x0 0x10000>; | ||
61 | pcie@0 { | ||
62 | ranges = <0x2000000 0x0 0xe0000000 | ||
63 | 0x2000000 0x0 0xe0000000 | ||
64 | 0x0 0x20000000 | ||
65 | |||
66 | 0x1000000 0x0 0x0 | ||
67 | 0x1000000 0x0 0x0 | ||
68 | 0x0 0x100000>; | ||
69 | }; | ||
70 | }; | ||
71 | |||
72 | pci1: pcie@ffe0a000 { | ||
73 | reg = <0x0 0xffe0a000 0x0 0x1000>; | ||
74 | ranges = <0x2000000 0x0 0xe0000000 0x0 0x80000000 0x0 0x20000000 | ||
75 | 0x1000000 0x0 0x00000000 0x0 0xffc00000 0x0 0x10000>; | ||
76 | pcie@0 { | ||
77 | ranges = <0x2000000 0x0 0xe0000000 | ||
78 | 0x2000000 0x0 0xe0000000 | ||
79 | 0x0 0x20000000 | ||
80 | |||
81 | 0x1000000 0x0 0x0 | ||
82 | 0x1000000 0x0 0x0 | ||
83 | 0x0 0x100000>; | ||
84 | }; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | /include/ "p1020utm-pc.dtsi" | ||
89 | /include/ "fsl/p1020si-post.dtsi" | ||
diff --git a/arch/powerpc/boot/dts/p1020utm-pc_36b.dts b/arch/powerpc/boot/dts/p1020utm-pc_36b.dts new file mode 100644 index 000000000000..abec53557501 --- /dev/null +++ b/arch/powerpc/boot/dts/p1020utm-pc_36b.dts | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * P1020 UTM-PC Device Tree Source (36-bit address map) | ||
3 | * | ||
4 | * Copyright 2012 Freescale Semiconductor Inc. | ||
5 | * | ||
6 | * Redistribution and use in source and binary forms, with or without | ||
7 | * modification, are permitted provided that the following conditions are met: | ||
8 | * * Redistributions of source code must retain the above copyright | ||
9 | * notice, this list of conditions and the following disclaimer. | ||
10 | * * Redistributions in binary form must reproduce the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer in the | ||
12 | * documentation and/or other materials provided with the distribution. | ||
13 | * * Neither the name of Freescale Semiconductor nor the | ||
14 | * names of its contributors may be used to endorse or promote products | ||
15 | * derived from this software without specific prior written permission. | ||
16 | * | ||
17 | * | ||
18 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
19 | * GNU General Public License ("GPL") as published by the Free Software | ||
20 | * Foundation, either version 2 of that License or (at your option) any | ||
21 | * later version. | ||
22 | * | ||
23 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
24 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
25 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
26 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
27 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
28 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
29 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
30 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
31 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
32 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
33 | */ | ||
34 | |||
35 | /include/ "fsl/p1020si-pre.dtsi" | ||
36 | / { | ||
37 | model = "fsl,P1020UTM-PC"; | ||
38 | compatible = "fsl,P1020UTM-PC"; | ||
39 | |||
40 | memory { | ||
41 | device_type = "memory"; | ||
42 | }; | ||
43 | |||
44 | lbc: localbus@fffe05000 { | ||
45 | reg = <0xf 0xffe05000 0x0 0x1000>; | ||
46 | |||
47 | /* NOR */ | ||
48 | ranges = <0x0 0x0 0xf 0xec000000 0x02000000 | ||
49 | 0x1 0x0 0xf 0xffa00000 0x00040000 | ||
50 | 0x2 0x0 0xf 0xffb00000 0x00020000>; | ||
51 | }; | ||
52 | |||
53 | soc: soc@fffe00000 { | ||
54 | ranges = <0x0 0xf 0xffe00000 0x100000>; | ||
55 | }; | ||
56 | |||
57 | pci0: pcie@fffe09000 { | ||
58 | reg = <0xf 0xffe09000 0x0 0x1000>; | ||
59 | ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | ||
60 | 0x1000000 0x0 0x00000000 0xf 0xffc10000 0x0 0x10000>; | ||
61 | pcie@0 { | ||
62 | ranges = <0x2000000 0x0 0xe0000000 | ||
63 | 0x2000000 0x0 0xe0000000 | ||
64 | 0x0 0x20000000 | ||
65 | |||
66 | 0x1000000 0x0 0x0 | ||
67 | 0x1000000 0x0 0x0 | ||
68 | 0x0 0x100000>; | ||
69 | }; | ||
70 | }; | ||
71 | |||
72 | pci1: pcie@fffe0a000 { | ||
73 | reg = <0xf 0xffe0a000 0 0x1000>; | ||
74 | ranges = <0x2000000 0x0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | ||
75 | 0x1000000 0x0 0x00000000 0xf 0xffc00000 0x0 0x10000>; | ||
76 | pcie@0 { | ||
77 | ranges = <0x2000000 0x0 0xe0000000 | ||
78 | 0x2000000 0x0 0xe0000000 | ||
79 | 0x0 0x20000000 | ||
80 | |||
81 | 0x1000000 0x0 0x0 | ||
82 | 0x1000000 0x0 0x0 | ||
83 | 0x0 0x100000>; | ||
84 | }; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | /include/ "p1020utm-pc.dtsi" | ||
89 | /include/ "fsl/p1020si-post.dtsi" | ||
diff --git a/arch/powerpc/boot/dts/p2041rdb.dts b/arch/powerpc/boot/dts/p2041rdb.dts index 4f957db01230..285213976a7f 100644 --- a/arch/powerpc/boot/dts/p2041rdb.dts +++ b/arch/powerpc/boot/dts/p2041rdb.dts | |||
@@ -135,7 +135,6 @@ | |||
135 | reg = <0xf 0xfe200000 0 0x1000>; | 135 | reg = <0xf 0xfe200000 0 0x1000>; |
136 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | 136 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 |
137 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; | 137 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; |
138 | fsl,msi = <&msi0>; | ||
139 | pcie@0 { | 138 | pcie@0 { |
140 | ranges = <0x02000000 0 0xe0000000 | 139 | ranges = <0x02000000 0 0xe0000000 |
141 | 0x02000000 0 0xe0000000 | 140 | 0x02000000 0 0xe0000000 |
@@ -151,7 +150,6 @@ | |||
151 | reg = <0xf 0xfe201000 0 0x1000>; | 150 | reg = <0xf 0xfe201000 0 0x1000>; |
152 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | 151 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 |
153 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; | 152 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; |
154 | fsl,msi = <&msi1>; | ||
155 | pcie@0 { | 153 | pcie@0 { |
156 | ranges = <0x02000000 0 0xe0000000 | 154 | ranges = <0x02000000 0 0xe0000000 |
157 | 0x02000000 0 0xe0000000 | 155 | 0x02000000 0 0xe0000000 |
@@ -167,7 +165,6 @@ | |||
167 | reg = <0xf 0xfe202000 0 0x1000>; | 165 | reg = <0xf 0xfe202000 0 0x1000>; |
168 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 | 166 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 |
169 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; | 167 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; |
170 | fsl,msi = <&msi2>; | ||
171 | pcie@0 { | 168 | pcie@0 { |
172 | ranges = <0x02000000 0 0xe0000000 | 169 | ranges = <0x02000000 0 0xe0000000 |
173 | 0x02000000 0 0xe0000000 | 170 | 0x02000000 0 0xe0000000 |
diff --git a/arch/powerpc/boot/dts/p3041ds.dts b/arch/powerpc/boot/dts/p3041ds.dts index f469145abaeb..22a215e94162 100644 --- a/arch/powerpc/boot/dts/p3041ds.dts +++ b/arch/powerpc/boot/dts/p3041ds.dts | |||
@@ -173,7 +173,6 @@ | |||
173 | reg = <0xf 0xfe200000 0 0x1000>; | 173 | reg = <0xf 0xfe200000 0 0x1000>; |
174 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | 174 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 |
175 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; | 175 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; |
176 | fsl,msi = <&msi0>; | ||
177 | pcie@0 { | 176 | pcie@0 { |
178 | ranges = <0x02000000 0 0xe0000000 | 177 | ranges = <0x02000000 0 0xe0000000 |
179 | 0x02000000 0 0xe0000000 | 178 | 0x02000000 0 0xe0000000 |
@@ -189,7 +188,6 @@ | |||
189 | reg = <0xf 0xfe201000 0 0x1000>; | 188 | reg = <0xf 0xfe201000 0 0x1000>; |
190 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | 189 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 |
191 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; | 190 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; |
192 | fsl,msi = <&msi1>; | ||
193 | pcie@0 { | 191 | pcie@0 { |
194 | ranges = <0x02000000 0 0xe0000000 | 192 | ranges = <0x02000000 0 0xe0000000 |
195 | 0x02000000 0 0xe0000000 | 193 | 0x02000000 0 0xe0000000 |
@@ -205,7 +203,6 @@ | |||
205 | reg = <0xf 0xfe202000 0 0x1000>; | 203 | reg = <0xf 0xfe202000 0 0x1000>; |
206 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 | 204 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 |
207 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; | 205 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; |
208 | fsl,msi = <&msi2>; | ||
209 | pcie@0 { | 206 | pcie@0 { |
210 | ranges = <0x02000000 0 0xe0000000 | 207 | ranges = <0x02000000 0 0xe0000000 |
211 | 0x02000000 0 0xe0000000 | 208 | 0x02000000 0 0xe0000000 |
@@ -221,7 +218,6 @@ | |||
221 | reg = <0xf 0xfe203000 0 0x1000>; | 218 | reg = <0xf 0xfe203000 0 0x1000>; |
222 | ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 | 219 | ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 |
223 | 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; | 220 | 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; |
224 | fsl,msi = <&msi2>; | ||
225 | pcie@0 { | 221 | pcie@0 { |
226 | ranges = <0x02000000 0 0xe0000000 | 222 | ranges = <0x02000000 0 0xe0000000 |
227 | 0x02000000 0 0xe0000000 | 223 | 0x02000000 0 0xe0000000 |
diff --git a/arch/powerpc/boot/dts/p3060qds.dts b/arch/powerpc/boot/dts/p3060qds.dts index 529042e4b9a2..9ae875c8a211 100644 --- a/arch/powerpc/boot/dts/p3060qds.dts +++ b/arch/powerpc/boot/dts/p3060qds.dts | |||
@@ -212,7 +212,6 @@ | |||
212 | reg = <0xf 0xfe200000 0 0x1000>; | 212 | reg = <0xf 0xfe200000 0 0x1000>; |
213 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | 213 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 |
214 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; | 214 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; |
215 | fsl,msi = <&msi0>; | ||
216 | pcie@0 { | 215 | pcie@0 { |
217 | ranges = <0x02000000 0 0xe0000000 | 216 | ranges = <0x02000000 0 0xe0000000 |
218 | 0x02000000 0 0xe0000000 | 217 | 0x02000000 0 0xe0000000 |
@@ -228,7 +227,6 @@ | |||
228 | reg = <0xf 0xfe201000 0 0x1000>; | 227 | reg = <0xf 0xfe201000 0 0x1000>; |
229 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | 228 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 |
230 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; | 229 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; |
231 | fsl,msi = <&msi1>; | ||
232 | pcie@0 { | 230 | pcie@0 { |
233 | ranges = <0x02000000 0 0xe0000000 | 231 | ranges = <0x02000000 0 0xe0000000 |
234 | 0x02000000 0 0xe0000000 | 232 | 0x02000000 0 0xe0000000 |
diff --git a/arch/powerpc/boot/dts/p4080ds.dts b/arch/powerpc/boot/dts/p4080ds.dts index 6d60e54e50a0..3e204609d02e 100644 --- a/arch/powerpc/boot/dts/p4080ds.dts +++ b/arch/powerpc/boot/dts/p4080ds.dts | |||
@@ -141,7 +141,6 @@ | |||
141 | reg = <0xf 0xfe200000 0 0x1000>; | 141 | reg = <0xf 0xfe200000 0 0x1000>; |
142 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | 142 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 |
143 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; | 143 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; |
144 | fsl,msi = <&msi0>; | ||
145 | pcie@0 { | 144 | pcie@0 { |
146 | ranges = <0x02000000 0 0xe0000000 | 145 | ranges = <0x02000000 0 0xe0000000 |
147 | 0x02000000 0 0xe0000000 | 146 | 0x02000000 0 0xe0000000 |
@@ -157,7 +156,6 @@ | |||
157 | reg = <0xf 0xfe201000 0 0x1000>; | 156 | reg = <0xf 0xfe201000 0 0x1000>; |
158 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | 157 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 |
159 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; | 158 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; |
160 | fsl,msi = <&msi1>; | ||
161 | pcie@0 { | 159 | pcie@0 { |
162 | ranges = <0x02000000 0 0xe0000000 | 160 | ranges = <0x02000000 0 0xe0000000 |
163 | 0x02000000 0 0xe0000000 | 161 | 0x02000000 0 0xe0000000 |
@@ -173,7 +171,6 @@ | |||
173 | reg = <0xf 0xfe202000 0 0x1000>; | 171 | reg = <0xf 0xfe202000 0 0x1000>; |
174 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 | 172 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 |
175 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; | 173 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; |
176 | fsl,msi = <&msi2>; | ||
177 | pcie@0 { | 174 | pcie@0 { |
178 | ranges = <0x02000000 0 0xe0000000 | 175 | ranges = <0x02000000 0 0xe0000000 |
179 | 0x02000000 0 0xe0000000 | 176 | 0x02000000 0 0xe0000000 |
diff --git a/arch/powerpc/boot/dts/p5020ds.dts b/arch/powerpc/boot/dts/p5020ds.dts index 1c250684c902..27c07ed6adc1 100644 --- a/arch/powerpc/boot/dts/p5020ds.dts +++ b/arch/powerpc/boot/dts/p5020ds.dts | |||
@@ -173,7 +173,6 @@ | |||
173 | reg = <0xf 0xfe200000 0 0x1000>; | 173 | reg = <0xf 0xfe200000 0 0x1000>; |
174 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 | 174 | ranges = <0x02000000 0 0xe0000000 0xc 0x00000000 0x0 0x20000000 |
175 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; | 175 | 0x01000000 0 0x00000000 0xf 0xf8000000 0x0 0x00010000>; |
176 | fsl,msi = <&msi0>; | ||
177 | pcie@0 { | 176 | pcie@0 { |
178 | ranges = <0x02000000 0 0xe0000000 | 177 | ranges = <0x02000000 0 0xe0000000 |
179 | 0x02000000 0 0xe0000000 | 178 | 0x02000000 0 0xe0000000 |
@@ -189,7 +188,6 @@ | |||
189 | reg = <0xf 0xfe201000 0 0x1000>; | 188 | reg = <0xf 0xfe201000 0 0x1000>; |
190 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 | 189 | ranges = <0x02000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 |
191 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; | 190 | 0x01000000 0x0 0x00000000 0xf 0xf8010000 0x0 0x00010000>; |
192 | fsl,msi = <&msi1>; | ||
193 | pcie@0 { | 191 | pcie@0 { |
194 | ranges = <0x02000000 0 0xe0000000 | 192 | ranges = <0x02000000 0 0xe0000000 |
195 | 0x02000000 0 0xe0000000 | 193 | 0x02000000 0 0xe0000000 |
@@ -205,7 +203,6 @@ | |||
205 | reg = <0xf 0xfe202000 0 0x1000>; | 203 | reg = <0xf 0xfe202000 0 0x1000>; |
206 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 | 204 | ranges = <0x02000000 0 0xe0000000 0xc 0x40000000 0 0x20000000 |
207 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; | 205 | 0x01000000 0 0x00000000 0xf 0xf8020000 0 0x00010000>; |
208 | fsl,msi = <&msi2>; | ||
209 | pcie@0 { | 206 | pcie@0 { |
210 | ranges = <0x02000000 0 0xe0000000 | 207 | ranges = <0x02000000 0 0xe0000000 |
211 | 0x02000000 0 0xe0000000 | 208 | 0x02000000 0 0xe0000000 |
@@ -221,7 +218,6 @@ | |||
221 | reg = <0xf 0xfe203000 0 0x1000>; | 218 | reg = <0xf 0xfe203000 0 0x1000>; |
222 | ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 | 219 | ranges = <0x02000000 0 0xe0000000 0xc 0x60000000 0 0x20000000 |
223 | 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; | 220 | 0x01000000 0 0x00000000 0xf 0xf8030000 0 0x00010000>; |
224 | fsl,msi = <&msi2>; | ||
225 | pcie@0 { | 221 | pcie@0 { |
226 | ranges = <0x02000000 0 0xe0000000 | 222 | ranges = <0x02000000 0 0xe0000000 |
227 | 0x02000000 0 0xe0000000 | 223 | 0x02000000 0 0xe0000000 |
diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig index f8aef205d222..91db656294e8 100644 --- a/arch/powerpc/configs/corenet32_smp_defconfig +++ b/arch/powerpc/configs/corenet32_smp_defconfig | |||
@@ -116,6 +116,7 @@ CONFIG_SERIAL_8250_RSA=y | |||
116 | CONFIG_HW_RANDOM=y | 116 | CONFIG_HW_RANDOM=y |
117 | CONFIG_NVRAM=y | 117 | CONFIG_NVRAM=y |
118 | CONFIG_I2C=y | 118 | CONFIG_I2C=y |
119 | CONFIG_I2C_CHARDEV=y | ||
119 | CONFIG_I2C_MPC=y | 120 | CONFIG_I2C_MPC=y |
120 | CONFIG_SPI=y | 121 | CONFIG_SPI=y |
121 | CONFIG_SPI_GPIO=y | 122 | CONFIG_SPI_GPIO=y |
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig index 82b13bfcf3c0..6798343580f0 100644 --- a/arch/powerpc/configs/corenet64_smp_defconfig +++ b/arch/powerpc/configs/corenet64_smp_defconfig | |||
@@ -71,6 +71,8 @@ CONFIG_SERIAL_8250_MANY_PORTS=y | |||
71 | CONFIG_SERIAL_8250_DETECT_IRQ=y | 71 | CONFIG_SERIAL_8250_DETECT_IRQ=y |
72 | CONFIG_SERIAL_8250_RSA=y | 72 | CONFIG_SERIAL_8250_RSA=y |
73 | CONFIG_I2C=y | 73 | CONFIG_I2C=y |
74 | CONFIG_I2C_CHARDEV=y | ||
75 | CONFIG_I2C_MPC=y | ||
74 | # CONFIG_HWMON is not set | 76 | # CONFIG_HWMON is not set |
75 | CONFIG_VIDEO_OUTPUT_CONTROL=y | 77 | CONFIG_VIDEO_OUTPUT_CONTROL=y |
76 | # CONFIG_HID_SUPPORT is not set | 78 | # CONFIG_HID_SUPPORT is not set |
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig index b7ac92a8b28f..62bb723c5b54 100644 --- a/arch/powerpc/configs/mpc85xx_defconfig +++ b/arch/powerpc/configs/mpc85xx_defconfig | |||
@@ -117,6 +117,7 @@ CONFIG_SERIAL_8250_RSA=y | |||
117 | CONFIG_SERIAL_QE=m | 117 | CONFIG_SERIAL_QE=m |
118 | CONFIG_NVRAM=y | 118 | CONFIG_NVRAM=y |
119 | CONFIG_I2C=y | 119 | CONFIG_I2C=y |
120 | CONFIG_I2C_CHARDEV=y | ||
120 | CONFIG_I2C_CPM=m | 121 | CONFIG_I2C_CPM=m |
121 | CONFIG_I2C_MPC=y | 122 | CONFIG_I2C_MPC=y |
122 | CONFIG_SPI=y | 123 | CONFIG_SPI=y |
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig index 41d5e4709a08..d1828427ae55 100644 --- a/arch/powerpc/configs/mpc85xx_smp_defconfig +++ b/arch/powerpc/configs/mpc85xx_smp_defconfig | |||
@@ -119,6 +119,7 @@ CONFIG_SERIAL_8250_RSA=y | |||
119 | CONFIG_SERIAL_QE=m | 119 | CONFIG_SERIAL_QE=m |
120 | CONFIG_NVRAM=y | 120 | CONFIG_NVRAM=y |
121 | CONFIG_I2C=y | 121 | CONFIG_I2C=y |
122 | CONFIG_I2C_CHARDEV=y | ||
122 | CONFIG_I2C_CPM=m | 123 | CONFIG_I2C_CPM=m |
123 | CONFIG_I2C_MPC=y | 124 | CONFIG_I2C_MPC=y |
124 | CONFIG_SPI=y | 125 | CONFIG_SPI=y |
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index dd70fac57ec8..62678e365ca0 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -22,9 +22,11 @@ | |||
22 | 22 | ||
23 | /* Some dma direct funcs must be visible for use in other dma_ops */ | 23 | /* Some dma direct funcs must be visible for use in other dma_ops */ |
24 | extern void *dma_direct_alloc_coherent(struct device *dev, size_t size, | 24 | extern void *dma_direct_alloc_coherent(struct device *dev, size_t size, |
25 | dma_addr_t *dma_handle, gfp_t flag); | 25 | dma_addr_t *dma_handle, gfp_t flag, |
26 | struct dma_attrs *attrs); | ||
26 | extern void dma_direct_free_coherent(struct device *dev, size_t size, | 27 | extern void dma_direct_free_coherent(struct device *dev, size_t size, |
27 | void *vaddr, dma_addr_t dma_handle); | 28 | void *vaddr, dma_addr_t dma_handle, |
29 | struct dma_attrs *attrs); | ||
28 | 30 | ||
29 | 31 | ||
30 | #ifdef CONFIG_NOT_COHERENT_CACHE | 32 | #ifdef CONFIG_NOT_COHERENT_CACHE |
@@ -130,23 +132,29 @@ static inline int dma_supported(struct device *dev, u64 mask) | |||
130 | 132 | ||
131 | extern int dma_set_mask(struct device *dev, u64 dma_mask); | 133 | extern int dma_set_mask(struct device *dev, u64 dma_mask); |
132 | 134 | ||
133 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 135 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
134 | dma_addr_t *dma_handle, gfp_t flag) | 136 | |
137 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
138 | dma_addr_t *dma_handle, gfp_t flag, | ||
139 | struct dma_attrs *attrs) | ||
135 | { | 140 | { |
136 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 141 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
137 | void *cpu_addr; | 142 | void *cpu_addr; |
138 | 143 | ||
139 | BUG_ON(!dma_ops); | 144 | BUG_ON(!dma_ops); |
140 | 145 | ||
141 | cpu_addr = dma_ops->alloc_coherent(dev, size, dma_handle, flag); | 146 | cpu_addr = dma_ops->alloc(dev, size, dma_handle, flag, attrs); |
142 | 147 | ||
143 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); | 148 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); |
144 | 149 | ||
145 | return cpu_addr; | 150 | return cpu_addr; |
146 | } | 151 | } |
147 | 152 | ||
148 | static inline void dma_free_coherent(struct device *dev, size_t size, | 153 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
149 | void *cpu_addr, dma_addr_t dma_handle) | 154 | |
155 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
156 | void *cpu_addr, dma_addr_t dma_handle, | ||
157 | struct dma_attrs *attrs) | ||
150 | { | 158 | { |
151 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 159 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
152 | 160 | ||
@@ -154,7 +162,7 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
154 | 162 | ||
155 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); | 163 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); |
156 | 164 | ||
157 | dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); | 165 | dma_ops->free(dev, size, cpu_addr, dma_handle, attrs); |
158 | } | 166 | } |
159 | 167 | ||
160 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 168 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h index f3b0c2cc9fea..976835d8f22e 100644 --- a/arch/powerpc/include/asm/epapr_hcalls.h +++ b/arch/powerpc/include/asm/epapr_hcalls.h | |||
@@ -134,10 +134,15 @@ | |||
134 | * whether they will be clobbered. | 134 | * whether they will be clobbered. |
135 | * | 135 | * |
136 | * Note that r11 can be used as an output parameter. | 136 | * Note that r11 can be used as an output parameter. |
137 | * | ||
138 | * The "memory" clobber is only necessary for hcalls where the Hypervisor | ||
139 | * will read or write guest memory. However, we add it to all hcalls because | ||
140 | * the impact is minimal, and we want to ensure that it's present for the | ||
141 | * hcalls that need it. | ||
137 | */ | 142 | */ |
138 | 143 | ||
139 | /* List of common clobbered registers. Do not use this macro. */ | 144 | /* List of common clobbered registers. Do not use this macro. */ |
140 | #define EV_HCALL_CLOBBERS "r0", "r12", "xer", "ctr", "lr", "cc" | 145 | #define EV_HCALL_CLOBBERS "r0", "r12", "xer", "ctr", "lr", "cc", "memory" |
141 | 146 | ||
142 | #define EV_HCALL_CLOBBERS8 EV_HCALL_CLOBBERS | 147 | #define EV_HCALL_CLOBBERS8 EV_HCALL_CLOBBERS |
143 | #define EV_HCALL_CLOBBERS7 EV_HCALL_CLOBBERS8, "r10" | 148 | #define EV_HCALL_CLOBBERS7 EV_HCALL_CLOBBERS8, "r10" |
diff --git a/arch/powerpc/include/asm/fsl_guts.h b/arch/powerpc/include/asm/fsl_guts.h index ce04530d2000..aa4c488589ce 100644 --- a/arch/powerpc/include/asm/fsl_guts.h +++ b/arch/powerpc/include/asm/fsl_guts.h | |||
@@ -16,15 +16,6 @@ | |||
16 | #define __ASM_POWERPC_FSL_GUTS_H__ | 16 | #define __ASM_POWERPC_FSL_GUTS_H__ |
17 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
18 | 18 | ||
19 | /* | ||
20 | * These #ifdefs are safe because it's not possible to build a kernel that | ||
21 | * runs on e500 and e600 cores. | ||
22 | */ | ||
23 | |||
24 | #if !defined(CONFIG_PPC_85xx) && !defined(CONFIG_PPC_86xx) | ||
25 | #error Only 85xx and 86xx SOCs are supported | ||
26 | #endif | ||
27 | |||
28 | /** | 19 | /** |
29 | * Global Utility Registers. | 20 | * Global Utility Registers. |
30 | * | 21 | * |
@@ -36,11 +27,7 @@ | |||
36 | * different names. In these cases, one name is chosen to avoid extraneous | 27 | * different names. In these cases, one name is chosen to avoid extraneous |
37 | * #ifdefs. | 28 | * #ifdefs. |
38 | */ | 29 | */ |
39 | #ifdef CONFIG_PPC_85xx | 30 | struct ccsr_guts { |
40 | struct ccsr_guts_85xx { | ||
41 | #else | ||
42 | struct ccsr_guts_86xx { | ||
43 | #endif | ||
44 | __be32 porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */ | 31 | __be32 porpllsr; /* 0x.0000 - POR PLL Ratio Status Register */ |
45 | __be32 porbmsr; /* 0x.0004 - POR Boot Mode Status Register */ | 32 | __be32 porbmsr; /* 0x.0004 - POR Boot Mode Status Register */ |
46 | __be32 porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */ | 33 | __be32 porimpscr; /* 0x.0008 - POR I/O Impedance Status and Control Register */ |
@@ -77,11 +64,8 @@ struct ccsr_guts_86xx { | |||
77 | u8 res0a8[0xb0 - 0xa8]; | 64 | u8 res0a8[0xb0 - 0xa8]; |
78 | __be32 rstcr; /* 0x.00b0 - Reset Control Register */ | 65 | __be32 rstcr; /* 0x.00b0 - Reset Control Register */ |
79 | u8 res0b4[0xc0 - 0xb4]; | 66 | u8 res0b4[0xc0 - 0xb4]; |
80 | #ifdef CONFIG_PPC_85xx | 67 | __be32 iovselsr; /* 0x.00c0 - I/O voltage select status register |
81 | __be32 iovselsr; /* 0x.00c0 - I/O voltage select status register */ | 68 | Called 'elbcvselcr' on 86xx SOCs */ |
82 | #else | ||
83 | __be32 elbcvselcr; /* 0x.00c0 - eLBC Voltage Select Ctrl Reg */ | ||
84 | #endif | ||
85 | u8 res0c4[0x224 - 0xc4]; | 69 | u8 res0c4[0x224 - 0xc4]; |
86 | __be32 iodelay1; /* 0x.0224 - IO delay control register 1 */ | 70 | __be32 iodelay1; /* 0x.0224 - IO delay control register 1 */ |
87 | __be32 iodelay2; /* 0x.0228 - IO delay control register 2 */ | 71 | __be32 iodelay2; /* 0x.0228 - IO delay control register 2 */ |
@@ -136,7 +120,7 @@ struct ccsr_guts_86xx { | |||
136 | * ch: The channel on the DMA controller (0, 1, 2, or 3) | 120 | * ch: The channel on the DMA controller (0, 1, 2, or 3) |
137 | * device: The device to set as the source (CCSR_GUTS_DMACR_DEV_xx) | 121 | * device: The device to set as the source (CCSR_GUTS_DMACR_DEV_xx) |
138 | */ | 122 | */ |
139 | static inline void guts_set_dmacr(struct ccsr_guts_86xx __iomem *guts, | 123 | static inline void guts_set_dmacr(struct ccsr_guts __iomem *guts, |
140 | unsigned int co, unsigned int ch, unsigned int device) | 124 | unsigned int co, unsigned int ch, unsigned int device) |
141 | { | 125 | { |
142 | unsigned int shift = 16 + (8 * (1 - co) + 2 * (3 - ch)); | 126 | unsigned int shift = 16 + (8 * (1 - co) + 2 * (3 - ch)); |
@@ -172,7 +156,7 @@ static inline void guts_set_dmacr(struct ccsr_guts_86xx __iomem *guts, | |||
172 | * ch: The channel on the DMA controller (0, 1, 2, or 3) | 156 | * ch: The channel on the DMA controller (0, 1, 2, or 3) |
173 | * value: the new value for the bit (0 or 1) | 157 | * value: the new value for the bit (0 or 1) |
174 | */ | 158 | */ |
175 | static inline void guts_set_pmuxcr_dma(struct ccsr_guts_86xx __iomem *guts, | 159 | static inline void guts_set_pmuxcr_dma(struct ccsr_guts __iomem *guts, |
176 | unsigned int co, unsigned int ch, unsigned int value) | 160 | unsigned int co, unsigned int ch, unsigned int value) |
177 | { | 161 | { |
178 | if ((ch == 0) || (ch == 3)) { | 162 | if ((ch == 0) || (ch == 3)) { |
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 3f6464b4d970..bcfdcd22c766 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c | |||
@@ -17,7 +17,8 @@ | |||
17 | * to the dma address (mapping) of the first page. | 17 | * to the dma address (mapping) of the first page. |
18 | */ | 18 | */ |
19 | static void *dma_iommu_alloc_coherent(struct device *dev, size_t size, | 19 | static void *dma_iommu_alloc_coherent(struct device *dev, size_t size, |
20 | dma_addr_t *dma_handle, gfp_t flag) | 20 | dma_addr_t *dma_handle, gfp_t flag, |
21 | struct dma_attrs *attrs) | ||
21 | { | 22 | { |
22 | return iommu_alloc_coherent(dev, get_iommu_table_base(dev), size, | 23 | return iommu_alloc_coherent(dev, get_iommu_table_base(dev), size, |
23 | dma_handle, dev->coherent_dma_mask, flag, | 24 | dma_handle, dev->coherent_dma_mask, flag, |
@@ -25,7 +26,8 @@ static void *dma_iommu_alloc_coherent(struct device *dev, size_t size, | |||
25 | } | 26 | } |
26 | 27 | ||
27 | static void dma_iommu_free_coherent(struct device *dev, size_t size, | 28 | static void dma_iommu_free_coherent(struct device *dev, size_t size, |
28 | void *vaddr, dma_addr_t dma_handle) | 29 | void *vaddr, dma_addr_t dma_handle, |
30 | struct dma_attrs *attrs) | ||
29 | { | 31 | { |
30 | iommu_free_coherent(get_iommu_table_base(dev), size, vaddr, dma_handle); | 32 | iommu_free_coherent(get_iommu_table_base(dev), size, vaddr, dma_handle); |
31 | } | 33 | } |
@@ -105,8 +107,8 @@ static u64 dma_iommu_get_required_mask(struct device *dev) | |||
105 | } | 107 | } |
106 | 108 | ||
107 | struct dma_map_ops dma_iommu_ops = { | 109 | struct dma_map_ops dma_iommu_ops = { |
108 | .alloc_coherent = dma_iommu_alloc_coherent, | 110 | .alloc = dma_iommu_alloc_coherent, |
109 | .free_coherent = dma_iommu_free_coherent, | 111 | .free = dma_iommu_free_coherent, |
110 | .map_sg = dma_iommu_map_sg, | 112 | .map_sg = dma_iommu_map_sg, |
111 | .unmap_sg = dma_iommu_unmap_sg, | 113 | .unmap_sg = dma_iommu_unmap_sg, |
112 | .dma_supported = dma_iommu_dma_supported, | 114 | .dma_supported = dma_iommu_dma_supported, |
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c index 1ebc9189aada..4ab88dafb235 100644 --- a/arch/powerpc/kernel/dma-swiotlb.c +++ b/arch/powerpc/kernel/dma-swiotlb.c | |||
@@ -47,8 +47,8 @@ static u64 swiotlb_powerpc_get_required(struct device *dev) | |||
47 | * for everything else. | 47 | * for everything else. |
48 | */ | 48 | */ |
49 | struct dma_map_ops swiotlb_dma_ops = { | 49 | struct dma_map_ops swiotlb_dma_ops = { |
50 | .alloc_coherent = dma_direct_alloc_coherent, | 50 | .alloc = dma_direct_alloc_coherent, |
51 | .free_coherent = dma_direct_free_coherent, | 51 | .free = dma_direct_free_coherent, |
52 | .map_sg = swiotlb_map_sg_attrs, | 52 | .map_sg = swiotlb_map_sg_attrs, |
53 | .unmap_sg = swiotlb_unmap_sg_attrs, | 53 | .unmap_sg = swiotlb_unmap_sg_attrs, |
54 | .dma_supported = swiotlb_dma_supported, | 54 | .dma_supported = swiotlb_dma_supported, |
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c index 7d0233c12ee3..b1ec983dcec8 100644 --- a/arch/powerpc/kernel/dma.c +++ b/arch/powerpc/kernel/dma.c | |||
@@ -26,7 +26,8 @@ | |||
26 | 26 | ||
27 | 27 | ||
28 | void *dma_direct_alloc_coherent(struct device *dev, size_t size, | 28 | void *dma_direct_alloc_coherent(struct device *dev, size_t size, |
29 | dma_addr_t *dma_handle, gfp_t flag) | 29 | dma_addr_t *dma_handle, gfp_t flag, |
30 | struct dma_attrs *attrs) | ||
30 | { | 31 | { |
31 | void *ret; | 32 | void *ret; |
32 | #ifdef CONFIG_NOT_COHERENT_CACHE | 33 | #ifdef CONFIG_NOT_COHERENT_CACHE |
@@ -54,7 +55,8 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
54 | } | 55 | } |
55 | 56 | ||
56 | void dma_direct_free_coherent(struct device *dev, size_t size, | 57 | void dma_direct_free_coherent(struct device *dev, size_t size, |
57 | void *vaddr, dma_addr_t dma_handle) | 58 | void *vaddr, dma_addr_t dma_handle, |
59 | struct dma_attrs *attrs) | ||
58 | { | 60 | { |
59 | #ifdef CONFIG_NOT_COHERENT_CACHE | 61 | #ifdef CONFIG_NOT_COHERENT_CACHE |
60 | __dma_free_coherent(size, vaddr); | 62 | __dma_free_coherent(size, vaddr); |
@@ -150,8 +152,8 @@ static inline void dma_direct_sync_single(struct device *dev, | |||
150 | #endif | 152 | #endif |
151 | 153 | ||
152 | struct dma_map_ops dma_direct_ops = { | 154 | struct dma_map_ops dma_direct_ops = { |
153 | .alloc_coherent = dma_direct_alloc_coherent, | 155 | .alloc = dma_direct_alloc_coherent, |
154 | .free_coherent = dma_direct_free_coherent, | 156 | .free = dma_direct_free_coherent, |
155 | .map_sg = dma_direct_map_sg, | 157 | .map_sg = dma_direct_map_sg, |
156 | .unmap_sg = dma_direct_unmap_sg, | 158 | .unmap_sg = dma_direct_unmap_sg, |
157 | .dma_supported = dma_direct_dma_supported, | 159 | .dma_supported = dma_direct_dma_supported, |
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index cfe7a38708c3..18bdf74fa164 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include <asm/prom.h> | 40 | #include <asm/prom.h> |
41 | #include <asm/rtas.h> | 41 | #include <asm/rtas.h> |
42 | #include <asm/fadump.h> | 42 | #include <asm/fadump.h> |
43 | #include <asm/debug.h> | ||
44 | #include <asm/setup.h> | ||
43 | 45 | ||
44 | static struct fw_dump fw_dump; | 46 | static struct fw_dump fw_dump; |
45 | static struct fadump_mem_struct fdm; | 47 | static struct fadump_mem_struct fdm; |
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 79bb282e6501..b01d14eeca8d 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -65,7 +65,8 @@ static struct of_device_id __initdata ibmebus_matches[] = { | |||
65 | static void *ibmebus_alloc_coherent(struct device *dev, | 65 | static void *ibmebus_alloc_coherent(struct device *dev, |
66 | size_t size, | 66 | size_t size, |
67 | dma_addr_t *dma_handle, | 67 | dma_addr_t *dma_handle, |
68 | gfp_t flag) | 68 | gfp_t flag, |
69 | struct dma_attrs *attrs) | ||
69 | { | 70 | { |
70 | void *mem; | 71 | void *mem; |
71 | 72 | ||
@@ -77,7 +78,8 @@ static void *ibmebus_alloc_coherent(struct device *dev, | |||
77 | 78 | ||
78 | static void ibmebus_free_coherent(struct device *dev, | 79 | static void ibmebus_free_coherent(struct device *dev, |
79 | size_t size, void *vaddr, | 80 | size_t size, void *vaddr, |
80 | dma_addr_t dma_handle) | 81 | dma_addr_t dma_handle, |
82 | struct dma_attrs *attrs) | ||
81 | { | 83 | { |
82 | kfree(vaddr); | 84 | kfree(vaddr); |
83 | } | 85 | } |
@@ -136,8 +138,8 @@ static u64 ibmebus_dma_get_required_mask(struct device *dev) | |||
136 | } | 138 | } |
137 | 139 | ||
138 | static struct dma_map_ops ibmebus_dma_ops = { | 140 | static struct dma_map_ops ibmebus_dma_ops = { |
139 | .alloc_coherent = ibmebus_alloc_coherent, | 141 | .alloc = ibmebus_alloc_coherent, |
140 | .free_coherent = ibmebus_free_coherent, | 142 | .free = ibmebus_free_coherent, |
141 | .map_sg = ibmebus_map_sg, | 143 | .map_sg = ibmebus_map_sg, |
142 | .unmap_sg = ibmebus_unmap_sg, | 144 | .unmap_sg = ibmebus_unmap_sg, |
143 | .dma_supported = ibmebus_dma_supported, | 145 | .dma_supported = ibmebus_dma_supported, |
diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 76a6e40a6f7c..782bd0a3c2f0 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/current.h> | 24 | #include <asm/current.h> |
25 | #include <asm/processor.h> | 25 | #include <asm/processor.h> |
26 | #include <asm/machdep.h> | 26 | #include <asm/machdep.h> |
27 | #include <asm/debug.h> | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * This table contains the mapping between PowerPC hardware trap types, and | 30 | * This table contains the mapping between PowerPC hardware trap types, and |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index b2f7c8480bf6..a3a99901c8ec 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -482,7 +482,8 @@ static void vio_cmo_balance(struct work_struct *work) | |||
482 | } | 482 | } |
483 | 483 | ||
484 | static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size, | 484 | static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size, |
485 | dma_addr_t *dma_handle, gfp_t flag) | 485 | dma_addr_t *dma_handle, gfp_t flag, |
486 | struct dma_attrs *attrs) | ||
486 | { | 487 | { |
487 | struct vio_dev *viodev = to_vio_dev(dev); | 488 | struct vio_dev *viodev = to_vio_dev(dev); |
488 | void *ret; | 489 | void *ret; |
@@ -492,7 +493,7 @@ static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size, | |||
492 | return NULL; | 493 | return NULL; |
493 | } | 494 | } |
494 | 495 | ||
495 | ret = dma_iommu_ops.alloc_coherent(dev, size, dma_handle, flag); | 496 | ret = dma_iommu_ops.alloc(dev, size, dma_handle, flag, attrs); |
496 | if (unlikely(ret == NULL)) { | 497 | if (unlikely(ret == NULL)) { |
497 | vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); | 498 | vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); |
498 | atomic_inc(&viodev->cmo.allocs_failed); | 499 | atomic_inc(&viodev->cmo.allocs_failed); |
@@ -502,11 +503,12 @@ static void *vio_dma_iommu_alloc_coherent(struct device *dev, size_t size, | |||
502 | } | 503 | } |
503 | 504 | ||
504 | static void vio_dma_iommu_free_coherent(struct device *dev, size_t size, | 505 | static void vio_dma_iommu_free_coherent(struct device *dev, size_t size, |
505 | void *vaddr, dma_addr_t dma_handle) | 506 | void *vaddr, dma_addr_t dma_handle, |
507 | struct dma_attrs *attrs) | ||
506 | { | 508 | { |
507 | struct vio_dev *viodev = to_vio_dev(dev); | 509 | struct vio_dev *viodev = to_vio_dev(dev); |
508 | 510 | ||
509 | dma_iommu_ops.free_coherent(dev, size, vaddr, dma_handle); | 511 | dma_iommu_ops.free(dev, size, vaddr, dma_handle, attrs); |
510 | 512 | ||
511 | vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); | 513 | vio_cmo_dealloc(viodev, roundup(size, PAGE_SIZE)); |
512 | } | 514 | } |
@@ -607,8 +609,8 @@ static u64 vio_dma_get_required_mask(struct device *dev) | |||
607 | } | 609 | } |
608 | 610 | ||
609 | struct dma_map_ops vio_dma_mapping_ops = { | 611 | struct dma_map_ops vio_dma_mapping_ops = { |
610 | .alloc_coherent = vio_dma_iommu_alloc_coherent, | 612 | .alloc = vio_dma_iommu_alloc_coherent, |
611 | .free_coherent = vio_dma_iommu_free_coherent, | 613 | .free = vio_dma_iommu_free_coherent, |
612 | .map_sg = vio_dma_iommu_map_sg, | 614 | .map_sg = vio_dma_iommu_map_sg, |
613 | .unmap_sg = vio_dma_iommu_unmap_sg, | 615 | .unmap_sg = vio_dma_iommu_unmap_sg, |
614 | .map_page = vio_dma_iommu_map_page, | 616 | .map_page = vio_dma_iommu_map_page, |
diff --git a/arch/powerpc/kvm/book3s_emulate.c b/arch/powerpc/kvm/book3s_emulate.c index f1950d131827..135663a3e4fc 100644 --- a/arch/powerpc/kvm/book3s_emulate.c +++ b/arch/powerpc/kvm/book3s_emulate.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/disassemble.h> | 21 | #include <asm/disassemble.h> |
22 | #include <asm/kvm_book3s.h> | 22 | #include <asm/kvm_book3s.h> |
23 | #include <asm/reg.h> | 23 | #include <asm/reg.h> |
24 | #include <asm/switch_to.h> | ||
24 | 25 | ||
25 | #define OP_19_XOP_RFID 18 | 26 | #define OP_19_XOP_RFID 18 |
26 | #define OP_19_XOP_RFI 50 | 27 | #define OP_19_XOP_RFI 50 |
diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c index bed1279aa6a8..e1b60f56f2a1 100644 --- a/arch/powerpc/kvm/book3s_hv_builtin.c +++ b/arch/powerpc/kvm/book3s_hv_builtin.c | |||
@@ -173,9 +173,9 @@ static void __init kvm_linear_init_one(ulong size, int count, int type) | |||
173 | 173 | ||
174 | static struct kvmppc_linear_info *kvm_alloc_linear(int type) | 174 | static struct kvmppc_linear_info *kvm_alloc_linear(int type) |
175 | { | 175 | { |
176 | struct kvmppc_linear_info *ri; | 176 | struct kvmppc_linear_info *ri, *ret; |
177 | 177 | ||
178 | ri = NULL; | 178 | ret = NULL; |
179 | spin_lock(&linear_lock); | 179 | spin_lock(&linear_lock); |
180 | list_for_each_entry(ri, &free_linears, list) { | 180 | list_for_each_entry(ri, &free_linears, list) { |
181 | if (ri->type != type) | 181 | if (ri->type != type) |
@@ -183,11 +183,12 @@ static struct kvmppc_linear_info *kvm_alloc_linear(int type) | |||
183 | 183 | ||
184 | list_del(&ri->list); | 184 | list_del(&ri->list); |
185 | atomic_inc(&ri->use_count); | 185 | atomic_inc(&ri->use_count); |
186 | memset(ri->base_virt, 0, ri->npages << PAGE_SHIFT); | ||
187 | ret = ri; | ||
186 | break; | 188 | break; |
187 | } | 189 | } |
188 | spin_unlock(&linear_lock); | 190 | spin_unlock(&linear_lock); |
189 | memset(ri->base_virt, 0, ri->npages << PAGE_SHIFT); | 191 | return ret; |
190 | return ri; | ||
191 | } | 192 | } |
192 | 193 | ||
193 | static void kvm_release_linear(struct kvmppc_linear_info *ri) | 194 | static void kvm_release_linear(struct kvmppc_linear_info *ri) |
diff --git a/arch/powerpc/kvm/book3s_hv_interrupts.S b/arch/powerpc/kvm/book3s_hv_interrupts.S index 3f7b674dd4bf..d3fb4df02c41 100644 --- a/arch/powerpc/kvm/book3s_hv_interrupts.S +++ b/arch/powerpc/kvm/book3s_hv_interrupts.S | |||
@@ -46,8 +46,10 @@ _GLOBAL(__kvmppc_vcore_entry) | |||
46 | /* Save host state to the stack */ | 46 | /* Save host state to the stack */ |
47 | stdu r1, -SWITCH_FRAME_SIZE(r1) | 47 | stdu r1, -SWITCH_FRAME_SIZE(r1) |
48 | 48 | ||
49 | /* Save non-volatile registers (r14 - r31) */ | 49 | /* Save non-volatile registers (r14 - r31) and CR */ |
50 | SAVE_NVGPRS(r1) | 50 | SAVE_NVGPRS(r1) |
51 | mfcr r3 | ||
52 | std r3, _CCR(r1) | ||
51 | 53 | ||
52 | /* Save host DSCR */ | 54 | /* Save host DSCR */ |
53 | BEGIN_FTR_SECTION | 55 | BEGIN_FTR_SECTION |
@@ -157,8 +159,10 @@ kvmppc_handler_highmem: | |||
157 | * R13 = PACA | 159 | * R13 = PACA |
158 | */ | 160 | */ |
159 | 161 | ||
160 | /* Restore non-volatile host registers (r14 - r31) */ | 162 | /* Restore non-volatile host registers (r14 - r31) and CR */ |
161 | REST_NVGPRS(r1) | 163 | REST_NVGPRS(r1) |
164 | ld r4, _CCR(r1) | ||
165 | mtcr r4 | ||
162 | 166 | ||
163 | addi r1, r1, SWITCH_FRAME_SIZE | 167 | addi r1, r1, SWITCH_FRAME_SIZE |
164 | ld r0, PPC_LR_STKOFF(r1) | 168 | ld r0, PPC_LR_STKOFF(r1) |
diff --git a/arch/powerpc/kvm/book3s_interrupts.S b/arch/powerpc/kvm/book3s_interrupts.S index 0a8515a5c042..3e35383bdb21 100644 --- a/arch/powerpc/kvm/book3s_interrupts.S +++ b/arch/powerpc/kvm/book3s_interrupts.S | |||
@@ -84,6 +84,10 @@ kvm_start_entry: | |||
84 | /* Save non-volatile registers (r14 - r31) */ | 84 | /* Save non-volatile registers (r14 - r31) */ |
85 | SAVE_NVGPRS(r1) | 85 | SAVE_NVGPRS(r1) |
86 | 86 | ||
87 | /* Save CR */ | ||
88 | mfcr r14 | ||
89 | stw r14, _CCR(r1) | ||
90 | |||
87 | /* Save LR */ | 91 | /* Save LR */ |
88 | PPC_STL r0, _LINK(r1) | 92 | PPC_STL r0, _LINK(r1) |
89 | 93 | ||
@@ -165,6 +169,9 @@ kvm_exit_loop: | |||
165 | PPC_LL r4, _LINK(r1) | 169 | PPC_LL r4, _LINK(r1) |
166 | mtlr r4 | 170 | mtlr r4 |
167 | 171 | ||
172 | lwz r14, _CCR(r1) | ||
173 | mtcr r14 | ||
174 | |||
168 | /* Restore non-volatile host registers (r14 - r31) */ | 175 | /* Restore non-volatile host registers (r14 - r31) */ |
169 | REST_NVGPRS(r1) | 176 | REST_NVGPRS(r1) |
170 | 177 | ||
diff --git a/arch/powerpc/kvm/book3s_paired_singles.c b/arch/powerpc/kvm/book3s_paired_singles.c index e70ef2d86431..a59a25a13218 100644 --- a/arch/powerpc/kvm/book3s_paired_singles.c +++ b/arch/powerpc/kvm/book3s_paired_singles.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/kvm_fpu.h> | 24 | #include <asm/kvm_fpu.h> |
25 | #include <asm/reg.h> | 25 | #include <asm/reg.h> |
26 | #include <asm/cacheflush.h> | 26 | #include <asm/cacheflush.h> |
27 | #include <asm/switch_to.h> | ||
27 | #include <linux/vmalloc.h> | 28 | #include <linux/vmalloc.h> |
28 | 29 | ||
29 | /* #define DEBUG */ | 30 | /* #define DEBUG */ |
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index 7340e1090b77..7759053d391b 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <asm/kvm_ppc.h> | 33 | #include <asm/kvm_ppc.h> |
34 | #include <asm/kvm_book3s.h> | 34 | #include <asm/kvm_book3s.h> |
35 | #include <asm/mmu_context.h> | 35 | #include <asm/mmu_context.h> |
36 | #include <asm/switch_to.h> | ||
36 | #include <linux/gfp.h> | 37 | #include <linux/gfp.h> |
37 | #include <linux/sched.h> | 38 | #include <linux/sched.h> |
38 | #include <linux/vmalloc.h> | 39 | #include <linux/vmalloc.h> |
@@ -776,6 +777,7 @@ program_interrupt: | |||
776 | } | 777 | } |
777 | } | 778 | } |
778 | 779 | ||
780 | preempt_disable(); | ||
779 | if (!(r & RESUME_HOST)) { | 781 | if (!(r & RESUME_HOST)) { |
780 | /* To avoid clobbering exit_reason, only check for signals if | 782 | /* To avoid clobbering exit_reason, only check for signals if |
781 | * we aren't already exiting to userspace for some other | 783 | * we aren't already exiting to userspace for some other |
@@ -797,8 +799,6 @@ program_interrupt: | |||
797 | run->exit_reason = KVM_EXIT_INTR; | 799 | run->exit_reason = KVM_EXIT_INTR; |
798 | r = -EINTR; | 800 | r = -EINTR; |
799 | } else { | 801 | } else { |
800 | preempt_disable(); | ||
801 | |||
802 | /* In case an interrupt came in that was triggered | 802 | /* In case an interrupt came in that was triggered |
803 | * from userspace (like DEC), we need to check what | 803 | * from userspace (like DEC), we need to check what |
804 | * to inject now! */ | 804 | * to inject now! */ |
@@ -880,7 +880,8 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
880 | 880 | ||
881 | switch (reg->id) { | 881 | switch (reg->id) { |
882 | case KVM_REG_PPC_HIOR: | 882 | case KVM_REG_PPC_HIOR: |
883 | r = put_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr); | 883 | r = copy_to_user((u64 __user *)(long)reg->addr, |
884 | &to_book3s(vcpu)->hior, sizeof(u64)); | ||
884 | break; | 885 | break; |
885 | default: | 886 | default: |
886 | break; | 887 | break; |
@@ -895,7 +896,8 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) | |||
895 | 896 | ||
896 | switch (reg->id) { | 897 | switch (reg->id) { |
897 | case KVM_REG_PPC_HIOR: | 898 | case KVM_REG_PPC_HIOR: |
898 | r = get_user(to_book3s(vcpu)->hior, (u64 __user *)reg->addr); | 899 | r = copy_from_user(&to_book3s(vcpu)->hior, |
900 | (u64 __user *)(long)reg->addr, sizeof(u64)); | ||
899 | if (!r) | 901 | if (!r) |
900 | to_book3s(vcpu)->hior_explicit = true; | 902 | to_book3s(vcpu)->hior_explicit = true; |
901 | break; | 903 | break; |
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S index 10d8ef602e5c..c8c4b878795a 100644 --- a/arch/powerpc/kvm/booke_interrupts.S +++ b/arch/powerpc/kvm/booke_interrupts.S | |||
@@ -34,7 +34,8 @@ | |||
34 | /* r2 is special: it holds 'current', and it made nonvolatile in the | 34 | /* r2 is special: it holds 'current', and it made nonvolatile in the |
35 | * kernel with the -ffixed-r2 gcc option. */ | 35 | * kernel with the -ffixed-r2 gcc option. */ |
36 | #define HOST_R2 12 | 36 | #define HOST_R2 12 |
37 | #define HOST_NV_GPRS 16 | 37 | #define HOST_CR 16 |
38 | #define HOST_NV_GPRS 20 | ||
38 | #define HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) | 39 | #define HOST_NV_GPR(n) (HOST_NV_GPRS + ((n - 14) * 4)) |
39 | #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(31) + 4) | 40 | #define HOST_MIN_STACK_SIZE (HOST_NV_GPR(31) + 4) |
40 | #define HOST_STACK_SIZE (((HOST_MIN_STACK_SIZE + 15) / 16) * 16) /* Align. */ | 41 | #define HOST_STACK_SIZE (((HOST_MIN_STACK_SIZE + 15) / 16) * 16) /* Align. */ |
@@ -296,8 +297,10 @@ heavyweight_exit: | |||
296 | 297 | ||
297 | /* Return to kvm_vcpu_run(). */ | 298 | /* Return to kvm_vcpu_run(). */ |
298 | lwz r4, HOST_STACK_LR(r1) | 299 | lwz r4, HOST_STACK_LR(r1) |
300 | lwz r5, HOST_CR(r1) | ||
299 | addi r1, r1, HOST_STACK_SIZE | 301 | addi r1, r1, HOST_STACK_SIZE |
300 | mtlr r4 | 302 | mtlr r4 |
303 | mtcr r5 | ||
301 | /* r3 still contains the return code from kvmppc_handle_exit(). */ | 304 | /* r3 still contains the return code from kvmppc_handle_exit(). */ |
302 | blr | 305 | blr |
303 | 306 | ||
@@ -314,6 +317,8 @@ _GLOBAL(__kvmppc_vcpu_run) | |||
314 | stw r3, HOST_RUN(r1) | 317 | stw r3, HOST_RUN(r1) |
315 | mflr r3 | 318 | mflr r3 |
316 | stw r3, HOST_STACK_LR(r1) | 319 | stw r3, HOST_STACK_LR(r1) |
320 | mfcr r5 | ||
321 | stw r5, HOST_CR(r1) | ||
317 | 322 | ||
318 | /* Save host non-volatile register state to stack. */ | 323 | /* Save host non-volatile register state to stack. */ |
319 | stw r14, HOST_NV_GPR(r14)(r1) | 324 | stw r14, HOST_NV_GPR(r14)(r1) |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c index bfb11e01133e..e2d401ad8fbb 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c | |||
@@ -93,7 +93,7 @@ struct mpc52xx_pci { | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | /* MPC5200 device tree match tables */ | 95 | /* MPC5200 device tree match tables */ |
96 | const struct of_device_id mpc52xx_pci_ids[] __initdata = { | 96 | const struct of_device_id mpc52xx_pci_ids[] __initconst = { |
97 | { .type = "pci", .compatible = "fsl,mpc5200-pci", }, | 97 | { .type = "pci", .compatible = "fsl,mpc5200-pci", }, |
98 | { .type = "pci", .compatible = "mpc5200-pci", }, | 98 | { .type = "pci", .compatible = "mpc5200-pci", }, |
99 | {} | 99 | {} |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c index 3754ddc00af7..9a6f04406e0d 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c | |||
@@ -270,7 +270,7 @@ static void __init mpc85xx_mds_qe_init(void) | |||
270 | 270 | ||
271 | if (machine_is(p1021_mds)) { | 271 | if (machine_is(p1021_mds)) { |
272 | 272 | ||
273 | struct ccsr_guts_85xx __iomem *guts; | 273 | struct ccsr_guts __iomem *guts; |
274 | 274 | ||
275 | np = of_find_node_by_name(NULL, "global-utilities"); | 275 | np = of_find_node_by_name(NULL, "global-utilities"); |
276 | if (np) { | 276 | if (np) { |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 9848f9e39853..313fce4f5574 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c | |||
@@ -127,7 +127,7 @@ static void __init mpc85xx_rdb_setup_arch(void) | |||
127 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE) | 127 | #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE) |
128 | if (machine_is(p1025_rdb)) { | 128 | if (machine_is(p1025_rdb)) { |
129 | 129 | ||
130 | struct ccsr_guts_85xx __iomem *guts; | 130 | struct ccsr_guts __iomem *guts; |
131 | 131 | ||
132 | np = of_find_node_by_name(NULL, "global-utilities"); | 132 | np = of_find_node_by_name(NULL, "global-utilities"); |
133 | if (np) { | 133 | if (np) { |
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c index 0fe88e39945e..e74b7cde9aee 100644 --- a/arch/powerpc/platforms/85xx/p1022_ds.c +++ b/arch/powerpc/platforms/85xx/p1022_ds.c | |||
@@ -150,7 +150,7 @@ static void p1022ds_set_monitor_port(enum fsl_diu_monitor_port port) | |||
150 | { | 150 | { |
151 | struct device_node *guts_node; | 151 | struct device_node *guts_node; |
152 | struct device_node *indirect_node = NULL; | 152 | struct device_node *indirect_node = NULL; |
153 | struct ccsr_guts_85xx __iomem *guts; | 153 | struct ccsr_guts __iomem *guts; |
154 | u8 __iomem *lbc_lcs0_ba = NULL; | 154 | u8 __iomem *lbc_lcs0_ba = NULL; |
155 | u8 __iomem *lbc_lcs1_ba = NULL; | 155 | u8 __iomem *lbc_lcs1_ba = NULL; |
156 | u8 b; | 156 | u8 b; |
@@ -269,7 +269,7 @@ exit: | |||
269 | void p1022ds_set_pixel_clock(unsigned int pixclock) | 269 | void p1022ds_set_pixel_clock(unsigned int pixclock) |
270 | { | 270 | { |
271 | struct device_node *guts_np = NULL; | 271 | struct device_node *guts_np = NULL; |
272 | struct ccsr_guts_85xx __iomem *guts; | 272 | struct ccsr_guts __iomem *guts; |
273 | unsigned long freq; | 273 | unsigned long freq; |
274 | u64 temp; | 274 | u64 temp; |
275 | u32 pxclk; | 275 | u32 pxclk; |
diff --git a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c index bbc615206c67..62cd3c555bfb 100644 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c | |||
@@ -225,7 +225,7 @@ void mpc8610hpcd_set_monitor_port(enum fsl_diu_monitor_port port) | |||
225 | void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) | 225 | void mpc8610hpcd_set_pixel_clock(unsigned int pixclock) |
226 | { | 226 | { |
227 | struct device_node *guts_np = NULL; | 227 | struct device_node *guts_np = NULL; |
228 | struct ccsr_guts_86xx __iomem *guts; | 228 | struct ccsr_guts __iomem *guts; |
229 | unsigned long freq; | 229 | unsigned long freq; |
230 | u64 temp; | 230 | u64 temp; |
231 | u32 pxclk; | 231 | u32 pxclk; |
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c index ae9fc7bc17d6..b9f509a34c01 100644 --- a/arch/powerpc/platforms/cell/iommu.c +++ b/arch/powerpc/platforms/cell/iommu.c | |||
@@ -564,7 +564,8 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev) | |||
564 | /* A coherent allocation implies strong ordering */ | 564 | /* A coherent allocation implies strong ordering */ |
565 | 565 | ||
566 | static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, | 566 | static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, |
567 | dma_addr_t *dma_handle, gfp_t flag) | 567 | dma_addr_t *dma_handle, gfp_t flag, |
568 | struct dma_attrs *attrs) | ||
568 | { | 569 | { |
569 | if (iommu_fixed_is_weak) | 570 | if (iommu_fixed_is_weak) |
570 | return iommu_alloc_coherent(dev, cell_get_iommu_table(dev), | 571 | return iommu_alloc_coherent(dev, cell_get_iommu_table(dev), |
@@ -572,18 +573,19 @@ static void *dma_fixed_alloc_coherent(struct device *dev, size_t size, | |||
572 | device_to_mask(dev), flag, | 573 | device_to_mask(dev), flag, |
573 | dev_to_node(dev)); | 574 | dev_to_node(dev)); |
574 | else | 575 | else |
575 | return dma_direct_ops.alloc_coherent(dev, size, dma_handle, | 576 | return dma_direct_ops.alloc(dev, size, dma_handle, flag, |
576 | flag); | 577 | attrs); |
577 | } | 578 | } |
578 | 579 | ||
579 | static void dma_fixed_free_coherent(struct device *dev, size_t size, | 580 | static void dma_fixed_free_coherent(struct device *dev, size_t size, |
580 | void *vaddr, dma_addr_t dma_handle) | 581 | void *vaddr, dma_addr_t dma_handle, |
582 | struct dma_attrs *attrs) | ||
581 | { | 583 | { |
582 | if (iommu_fixed_is_weak) | 584 | if (iommu_fixed_is_weak) |
583 | iommu_free_coherent(cell_get_iommu_table(dev), size, vaddr, | 585 | iommu_free_coherent(cell_get_iommu_table(dev), size, vaddr, |
584 | dma_handle); | 586 | dma_handle); |
585 | else | 587 | else |
586 | dma_direct_ops.free_coherent(dev, size, vaddr, dma_handle); | 588 | dma_direct_ops.free(dev, size, vaddr, dma_handle, attrs); |
587 | } | 589 | } |
588 | 590 | ||
589 | static dma_addr_t dma_fixed_map_page(struct device *dev, struct page *page, | 591 | static dma_addr_t dma_fixed_map_page(struct device *dev, struct page *page, |
@@ -642,8 +644,8 @@ static int dma_fixed_dma_supported(struct device *dev, u64 mask) | |||
642 | static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask); | 644 | static int dma_set_mask_and_switch(struct device *dev, u64 dma_mask); |
643 | 645 | ||
644 | struct dma_map_ops dma_iommu_fixed_ops = { | 646 | struct dma_map_ops dma_iommu_fixed_ops = { |
645 | .alloc_coherent = dma_fixed_alloc_coherent, | 647 | .alloc = dma_fixed_alloc_coherent, |
646 | .free_coherent = dma_fixed_free_coherent, | 648 | .free = dma_fixed_free_coherent, |
647 | .map_sg = dma_fixed_map_sg, | 649 | .map_sg = dma_fixed_map_sg, |
648 | .unmap_sg = dma_fixed_unmap_sg, | 650 | .unmap_sg = dma_fixed_unmap_sg, |
649 | .dma_supported = dma_fixed_dma_supported, | 651 | .dma_supported = dma_fixed_dma_supported, |
diff --git a/arch/powerpc/platforms/cell/qpace_setup.c b/arch/powerpc/platforms/cell/qpace_setup.c index 7f9b6742f8b6..6e3409d590ac 100644 --- a/arch/powerpc/platforms/cell/qpace_setup.c +++ b/arch/powerpc/platforms/cell/qpace_setup.c | |||
@@ -61,7 +61,7 @@ static void qpace_progress(char *s, unsigned short hex) | |||
61 | printk("*** %04x : %s\n", hex, s ? s : ""); | 61 | printk("*** %04x : %s\n", hex, s ? s : ""); |
62 | } | 62 | } |
63 | 63 | ||
64 | static const struct of_device_id qpace_bus_ids[] __initdata = { | 64 | static const struct of_device_id qpace_bus_ids[] __initconst = { |
65 | { .type = "soc", }, | 65 | { .type = "soc", }, |
66 | { .compatible = "soc", }, | 66 | { .compatible = "soc", }, |
67 | { .type = "spider", }, | 67 | { .type = "spider", }, |
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c index fa3e294fd343..4ab087671185 100644 --- a/arch/powerpc/platforms/cell/setup.c +++ b/arch/powerpc/platforms/cell/setup.c | |||
@@ -140,7 +140,7 @@ static int __devinit cell_setup_phb(struct pci_controller *phb) | |||
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
142 | 142 | ||
143 | static const struct of_device_id cell_bus_ids[] __initdata = { | 143 | static const struct of_device_id cell_bus_ids[] __initconst = { |
144 | { .type = "soc", }, | 144 | { .type = "soc", }, |
145 | { .compatible = "soc", }, | 145 | { .compatible = "soc", }, |
146 | { .type = "spider", }, | 146 | { .type = "spider", }, |
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index 880eb9ce22c5..5606fe36faf2 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -515,7 +515,8 @@ core_initcall(ps3_system_bus_init); | |||
515 | * to the dma address (mapping) of the first page. | 515 | * to the dma address (mapping) of the first page. |
516 | */ | 516 | */ |
517 | static void * ps3_alloc_coherent(struct device *_dev, size_t size, | 517 | static void * ps3_alloc_coherent(struct device *_dev, size_t size, |
518 | dma_addr_t *dma_handle, gfp_t flag) | 518 | dma_addr_t *dma_handle, gfp_t flag, |
519 | struct dma_attrs *attrs) | ||
519 | { | 520 | { |
520 | int result; | 521 | int result; |
521 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); | 522 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); |
@@ -552,7 +553,7 @@ clean_none: | |||
552 | } | 553 | } |
553 | 554 | ||
554 | static void ps3_free_coherent(struct device *_dev, size_t size, void *vaddr, | 555 | static void ps3_free_coherent(struct device *_dev, size_t size, void *vaddr, |
555 | dma_addr_t dma_handle) | 556 | dma_addr_t dma_handle, struct dma_attrs *attrs) |
556 | { | 557 | { |
557 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); | 558 | struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev); |
558 | 559 | ||
@@ -701,8 +702,8 @@ static u64 ps3_dma_get_required_mask(struct device *_dev) | |||
701 | } | 702 | } |
702 | 703 | ||
703 | static struct dma_map_ops ps3_sb_dma_ops = { | 704 | static struct dma_map_ops ps3_sb_dma_ops = { |
704 | .alloc_coherent = ps3_alloc_coherent, | 705 | .alloc = ps3_alloc_coherent, |
705 | .free_coherent = ps3_free_coherent, | 706 | .free = ps3_free_coherent, |
706 | .map_sg = ps3_sb_map_sg, | 707 | .map_sg = ps3_sb_map_sg, |
707 | .unmap_sg = ps3_sb_unmap_sg, | 708 | .unmap_sg = ps3_sb_unmap_sg, |
708 | .dma_supported = ps3_dma_supported, | 709 | .dma_supported = ps3_dma_supported, |
@@ -712,8 +713,8 @@ static struct dma_map_ops ps3_sb_dma_ops = { | |||
712 | }; | 713 | }; |
713 | 714 | ||
714 | static struct dma_map_ops ps3_ioc0_dma_ops = { | 715 | static struct dma_map_ops ps3_ioc0_dma_ops = { |
715 | .alloc_coherent = ps3_alloc_coherent, | 716 | .alloc = ps3_alloc_coherent, |
716 | .free_coherent = ps3_free_coherent, | 717 | .free = ps3_free_coherent, |
717 | .map_sg = ps3_ioc0_map_sg, | 718 | .map_sg = ps3_ioc0_map_sg, |
718 | .unmap_sg = ps3_ioc0_unmap_sg, | 719 | .unmap_sg = ps3_ioc0_unmap_sg, |
719 | .dma_supported = ps3_dma_supported, | 720 | .dma_supported = ps3_dma_supported, |
diff --git a/arch/powerpc/platforms/pseries/eeh_event.c b/arch/powerpc/platforms/pseries/eeh_event.c index 4a4752565856..4cb375c0f8d1 100644 --- a/arch/powerpc/platforms/pseries/eeh_event.c +++ b/arch/powerpc/platforms/pseries/eeh_event.c | |||
@@ -59,8 +59,7 @@ static int eeh_event_handler(void * dummy) | |||
59 | struct eeh_event *event; | 59 | struct eeh_event *event; |
60 | struct eeh_dev *edev; | 60 | struct eeh_dev *edev; |
61 | 61 | ||
62 | daemonize("eehd"); | 62 | set_task_comm(current, "eehd"); |
63 | set_current_state(TASK_INTERRUPTIBLE); | ||
64 | 63 | ||
65 | spin_lock_irqsave(&eeh_eventlist_lock, flags); | 64 | spin_lock_irqsave(&eeh_eventlist_lock, flags); |
66 | event = NULL; | 65 | event = NULL; |
@@ -83,6 +82,7 @@ static int eeh_event_handler(void * dummy) | |||
83 | printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", | 82 | printk(KERN_INFO "EEH: Detected PCI bus error on device %s\n", |
84 | eeh_pci_name(edev->pdev)); | 83 | eeh_pci_name(edev->pdev)); |
85 | 84 | ||
85 | set_current_state(TASK_INTERRUPTIBLE); /* Don't add to load average */ | ||
86 | edev = handle_eeh_events(event); | 86 | edev = handle_eeh_events(event); |
87 | 87 | ||
88 | eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); | 88 | eeh_clear_slot(eeh_dev_to_of_node(edev), EEH_MODE_RECOVERING); |
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c index ceb09cbd2329..818e763f8265 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 Freescale Semicondutor, Inc. All rights reserved. | 2 | * Copyright (C) 2006-2010 Freescale Semicondutor, 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> |
@@ -266,7 +266,19 @@ EXPORT_SYMBOL(qe_clock_source); | |||
266 | static void qe_snums_init(void) | 266 | static void qe_snums_init(void) |
267 | { | 267 | { |
268 | int i; | 268 | int i; |
269 | static const u8 snum_init[] = { | 269 | static const u8 snum_init_76[] = { |
270 | 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, | ||
271 | 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89, | ||
272 | 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9, | ||
273 | 0xD8, 0xD9, 0xE8, 0xE9, 0x44, 0x45, 0x4C, 0x4D, | ||
274 | 0x54, 0x55, 0x5C, 0x5D, 0x64, 0x65, 0x6C, 0x6D, | ||
275 | 0x74, 0x75, 0x7C, 0x7D, 0x84, 0x85, 0x8C, 0x8D, | ||
276 | 0x94, 0x95, 0x9C, 0x9D, 0xA4, 0xA5, 0xAC, 0xAD, | ||
277 | 0xB4, 0xB5, 0xBC, 0xBD, 0xC4, 0xC5, 0xCC, 0xCD, | ||
278 | 0xD4, 0xD5, 0xDC, 0xDD, 0xE4, 0xE5, 0xEC, 0xED, | ||
279 | 0xF4, 0xF5, 0xFC, 0xFD, | ||
280 | }; | ||
281 | static const u8 snum_init_46[] = { | ||
270 | 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, | 282 | 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, |
271 | 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89, | 283 | 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x88, 0x89, |
272 | 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9, | 284 | 0x98, 0x99, 0xA8, 0xA9, 0xB8, 0xB9, 0xC8, 0xC9, |
@@ -274,9 +286,15 @@ static void qe_snums_init(void) | |||
274 | 0x28, 0x29, 0x38, 0x39, 0x48, 0x49, 0x58, 0x59, | 286 | 0x28, 0x29, 0x38, 0x39, 0x48, 0x49, 0x58, 0x59, |
275 | 0x68, 0x69, 0x78, 0x79, 0x80, 0x81, | 287 | 0x68, 0x69, 0x78, 0x79, 0x80, 0x81, |
276 | }; | 288 | }; |
289 | static const u8 *snum_init; | ||
277 | 290 | ||
278 | qe_num_of_snum = qe_get_num_of_snums(); | 291 | qe_num_of_snum = qe_get_num_of_snums(); |
279 | 292 | ||
293 | if (qe_num_of_snum == 76) | ||
294 | snum_init = snum_init_76; | ||
295 | else | ||
296 | snum_init = snum_init_46; | ||
297 | |||
280 | for (i = 0; i < qe_num_of_snum; i++) { | 298 | for (i = 0; i < qe_num_of_snum; i++) { |
281 | snums[i].num = snum_init[i]; | 299 | snums[i].num = snum_init[i]; |
282 | snums[i].state = QE_SNUM_STATE_FREE; | 300 | snums[i].state = QE_SNUM_STATE_FREE; |
diff --git a/arch/sh/Kconfig.debug b/arch/sh/Kconfig.debug index c1d5a820b1aa..5f2bb4242c0f 100644 --- a/arch/sh/Kconfig.debug +++ b/arch/sh/Kconfig.debug | |||
@@ -61,6 +61,7 @@ config DUMP_CODE | |||
61 | config DWARF_UNWINDER | 61 | config DWARF_UNWINDER |
62 | bool "Enable the DWARF unwinder for stacktraces" | 62 | bool "Enable the DWARF unwinder for stacktraces" |
63 | select FRAME_POINTER | 63 | select FRAME_POINTER |
64 | depends on SUPERH32 | ||
64 | default n | 65 | default n |
65 | help | 66 | help |
66 | Enabling this option will make stacktraces more accurate, at | 67 | Enabling this option will make stacktraces more accurate, at |
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c index d879848f3cdd..d0d6221d7c2e 100644 --- a/arch/sh/boards/board-sh7785lcr.c +++ b/arch/sh/boards/board-sh7785lcr.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <cpu/sh7785.h> | 28 | #include <cpu/sh7785.h> |
29 | #include <asm/heartbeat.h> | 29 | #include <asm/heartbeat.h> |
30 | #include <asm/clock.h> | 30 | #include <asm/clock.h> |
31 | #include <asm/bl_bit.h> | ||
31 | 32 | ||
32 | /* | 33 | /* |
33 | * NOTE: This board has 2 physical memory maps. | 34 | * NOTE: This board has 2 physical memory maps. |
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c index adc9b4bba828..8b50cf763c06 100644 --- a/arch/sh/boards/mach-hp6xx/pm.c +++ b/arch/sh/boards/mach-hp6xx/pm.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/gfp.h> | 14 | #include <linux/gfp.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/hd64461.h> | 16 | #include <asm/hd64461.h> |
17 | #include <asm/bl_bit.h> | ||
17 | #include <mach/hp6xx.h> | 18 | #include <mach/hp6xx.h> |
18 | #include <cpu/dac.h> | 19 | #include <cpu/dac.h> |
19 | #include <asm/freq.h> | 20 | #include <asm/freq.h> |
diff --git a/arch/sh/drivers/dma/dma-sysfs.c b/arch/sh/drivers/dma/dma-sysfs.c index b1cb2715ad6e..67ee95603813 100644 --- a/arch/sh/drivers/dma/dma-sysfs.c +++ b/arch/sh/drivers/dma/dma-sysfs.c | |||
@@ -54,7 +54,7 @@ static int __init dma_subsys_init(void) | |||
54 | if (unlikely(ret)) | 54 | if (unlikely(ret)) |
55 | return ret; | 55 | return ret; |
56 | 56 | ||
57 | return device_create_file(dma_subsys.dev_root, &dev_attr_devices.attr); | 57 | return device_create_file(dma_subsys.dev_root, &dev_attr_devices); |
58 | } | 58 | } |
59 | postcore_initcall(dma_subsys_init); | 59 | postcore_initcall(dma_subsys_init); |
60 | 60 | ||
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index 1a73c3e759a7..8bd965e00a15 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h | |||
@@ -52,25 +52,31 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
52 | return dma_addr == 0; | 52 | return dma_addr == 0; |
53 | } | 53 | } |
54 | 54 | ||
55 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 55 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
56 | dma_addr_t *dma_handle, gfp_t gfp) | 56 | |
57 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
58 | dma_addr_t *dma_handle, gfp_t gfp, | ||
59 | struct dma_attrs *attrs) | ||
57 | { | 60 | { |
58 | struct dma_map_ops *ops = get_dma_ops(dev); | 61 | struct dma_map_ops *ops = get_dma_ops(dev); |
59 | void *memory; | 62 | void *memory; |
60 | 63 | ||
61 | if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) | 64 | if (dma_alloc_from_coherent(dev, size, dma_handle, &memory)) |
62 | return memory; | 65 | return memory; |
63 | if (!ops->alloc_coherent) | 66 | if (!ops->alloc) |
64 | return NULL; | 67 | return NULL; |
65 | 68 | ||
66 | memory = ops->alloc_coherent(dev, size, dma_handle, gfp); | 69 | memory = ops->alloc(dev, size, dma_handle, gfp, attrs); |
67 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); | 70 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); |
68 | 71 | ||
69 | return memory; | 72 | return memory; |
70 | } | 73 | } |
71 | 74 | ||
72 | static inline void dma_free_coherent(struct device *dev, size_t size, | 75 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
73 | void *vaddr, dma_addr_t dma_handle) | 76 | |
77 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
78 | void *vaddr, dma_addr_t dma_handle, | ||
79 | struct dma_attrs *attrs) | ||
74 | { | 80 | { |
75 | struct dma_map_ops *ops = get_dma_ops(dev); | 81 | struct dma_map_ops *ops = get_dma_ops(dev); |
76 | 82 | ||
@@ -78,14 +84,16 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
78 | return; | 84 | return; |
79 | 85 | ||
80 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); | 86 | debug_dma_free_coherent(dev, size, vaddr, dma_handle); |
81 | if (ops->free_coherent) | 87 | if (ops->free) |
82 | ops->free_coherent(dev, size, vaddr, dma_handle); | 88 | ops->free(dev, size, vaddr, dma_handle, attrs); |
83 | } | 89 | } |
84 | 90 | ||
85 | /* arch/sh/mm/consistent.c */ | 91 | /* arch/sh/mm/consistent.c */ |
86 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 92 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
87 | dma_addr_t *dma_addr, gfp_t flag); | 93 | dma_addr_t *dma_addr, gfp_t flag, |
94 | struct dma_attrs *attrs); | ||
88 | extern void dma_generic_free_coherent(struct device *dev, size_t size, | 95 | extern void dma_generic_free_coherent(struct device *dev, size_t size, |
89 | void *vaddr, dma_addr_t dma_handle); | 96 | void *vaddr, dma_addr_t dma_handle, |
97 | struct dma_attrs *attrs); | ||
90 | 98 | ||
91 | #endif /* __ASM_SH_DMA_MAPPING_H */ | 99 | #endif /* __ASM_SH_DMA_MAPPING_H */ |
diff --git a/arch/sh/kernel/cpu/fpu.c b/arch/sh/kernel/cpu/fpu.c index 7f1b70cace35..f8f7af51c128 100644 --- a/arch/sh/kernel/cpu/fpu.c +++ b/arch/sh/kernel/cpu/fpu.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <linux/slab.h> | 2 | #include <linux/slab.h> |
3 | #include <asm/processor.h> | 3 | #include <asm/processor.h> |
4 | #include <asm/fpu.h> | 4 | #include <asm/fpu.h> |
5 | #include <asm/traps.h> | ||
5 | 6 | ||
6 | int init_fpu(struct task_struct *tsk) | 7 | int init_fpu(struct task_struct *tsk) |
7 | { | 8 | { |
diff --git a/arch/sh/kernel/cpu/sh2a/fpu.c b/arch/sh/kernel/cpu/sh2a/fpu.c index 488d24e0cdf0..98bbaa447c93 100644 --- a/arch/sh/kernel/cpu/sh2a/fpu.c +++ b/arch/sh/kernel/cpu/sh2a/fpu.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/processor.h> | 14 | #include <asm/processor.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/fpu.h> | 16 | #include <asm/fpu.h> |
17 | #include <asm/traps.h> | ||
17 | 18 | ||
18 | /* The PR (precision) bit in the FP Status Register must be clear when | 19 | /* The PR (precision) bit in the FP Status Register must be clear when |
19 | * an frchg instruction is executed, otherwise the instruction is undefined. | 20 | * an frchg instruction is executed, otherwise the instruction is undefined. |
diff --git a/arch/sh/kernel/cpu/sh4/fpu.c b/arch/sh/kernel/cpu/sh4/fpu.c index e74cd6c0f10d..69ab4d3c8d41 100644 --- a/arch/sh/kernel/cpu/sh4/fpu.c +++ b/arch/sh/kernel/cpu/sh4/fpu.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <cpu/fpu.h> | 16 | #include <cpu/fpu.h> |
17 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
18 | #include <asm/fpu.h> | 18 | #include <asm/fpu.h> |
19 | #include <asm/traps.h> | ||
19 | 20 | ||
20 | /* The PR (precision) bit in the FP Status Register must be clear when | 21 | /* The PR (precision) bit in the FP Status Register must be clear when |
21 | * an frchg instruction is executed, otherwise the instruction is undefined. | 22 | * an frchg instruction is executed, otherwise the instruction is undefined. |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c index 5853989586ed..04ab5aeaf920 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c | |||
@@ -113,7 +113,7 @@ static struct clk_lookup lookups[] = { | |||
113 | CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), | 113 | CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]), |
114 | 114 | ||
115 | /* MSTP32 clocks */ | 115 | /* MSTP32 clocks */ |
116 | CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP004]), | 116 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP004]), |
117 | CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]), | 117 | CLKDEV_CON_ID("riic0", &mstp_clks[MSTP000]), |
118 | CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]), | 118 | CLKDEV_CON_ID("riic1", &mstp_clks[MSTP000]), |
119 | CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]), | 119 | CLKDEV_CON_ID("riic2", &mstp_clks[MSTP000]), |
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c index a6f95ae4aae7..08d27fac8d08 100644 --- a/arch/sh/kernel/cpu/shmobile/pm.c +++ b/arch/sh/kernel/cpu/shmobile/pm.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <asm/suspend.h> | 16 | #include <asm/suspend.h> |
17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
18 | #include <asm/cacheflush.h> | 18 | #include <asm/cacheflush.h> |
19 | #include <asm/bl_bit.h> | ||
19 | 20 | ||
20 | /* | 21 | /* |
21 | * Notifier lists for pre/post sleep notification | 22 | * Notifier lists for pre/post sleep notification |
diff --git a/arch/sh/kernel/dma-nommu.c b/arch/sh/kernel/dma-nommu.c index 3c55b87f8b63..5b0bfcda6d0b 100644 --- a/arch/sh/kernel/dma-nommu.c +++ b/arch/sh/kernel/dma-nommu.c | |||
@@ -63,8 +63,8 @@ static void nommu_sync_sg(struct device *dev, struct scatterlist *sg, | |||
63 | #endif | 63 | #endif |
64 | 64 | ||
65 | struct dma_map_ops nommu_dma_ops = { | 65 | struct dma_map_ops nommu_dma_ops = { |
66 | .alloc_coherent = dma_generic_alloc_coherent, | 66 | .alloc = dma_generic_alloc_coherent, |
67 | .free_coherent = dma_generic_free_coherent, | 67 | .free = dma_generic_free_coherent, |
68 | .map_page = nommu_map_page, | 68 | .map_page = nommu_map_page, |
69 | .map_sg = nommu_map_sg, | 69 | .map_sg = nommu_map_sg, |
70 | #ifdef CONFIG_DMA_NONCOHERENT | 70 | #ifdef CONFIG_DMA_NONCOHERENT |
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 64852ecc6881..ee226e20c20c 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c | |||
@@ -17,8 +17,8 @@ | |||
17 | #include <linux/irqflags.h> | 17 | #include <linux/irqflags.h> |
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/cpuidle.h> | 19 | #include <linux/cpuidle.h> |
20 | #include <asm/pgalloc.h> | ||
21 | #include <linux/atomic.h> | 20 | #include <linux/atomic.h> |
21 | #include <asm/pgalloc.h> | ||
22 | #include <asm/smp.h> | 22 | #include <asm/smp.h> |
23 | #include <asm/bl_bit.h> | 23 | #include <asm/bl_bit.h> |
24 | 24 | ||
diff --git a/arch/sh/kernel/kgdb.c b/arch/sh/kernel/kgdb.c index efb6d398dec3..b117781bfea2 100644 --- a/arch/sh/kernel/kgdb.c +++ b/arch/sh/kernel/kgdb.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
15 | #include <linux/io.h> | 15 | #include <linux/io.h> |
16 | #include <asm/cacheflush.h> | 16 | #include <asm/cacheflush.h> |
17 | #include <asm/traps.h> | ||
17 | 18 | ||
18 | /* Macros for single step instruction identification */ | 19 | /* Macros for single step instruction identification */ |
19 | #define OPCODE_BT(op) (((op) & 0xff00) == 0x8900) | 20 | #define OPCODE_BT(op) (((op) & 0xff00) == 0x8900) |
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index f72e3a951588..94273aaf78c1 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/mmu_context.h> | 26 | #include <asm/mmu_context.h> |
27 | #include <asm/fpu.h> | 27 | #include <asm/fpu.h> |
28 | #include <asm/syscalls.h> | 28 | #include <asm/syscalls.h> |
29 | #include <asm/switch_to.h> | ||
29 | 30 | ||
30 | void show_regs(struct pt_regs * regs) | 31 | void show_regs(struct pt_regs * regs) |
31 | { | 32 | { |
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index a17a14d32340..eaebdf6a5c77 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/smp.h> | 27 | #include <asm/smp.h> |
28 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
29 | #include <asm/sections.h> | 29 | #include <asm/sections.h> |
30 | #include <asm/setup.h> | ||
30 | 31 | ||
31 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ | 32 | int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ |
32 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ | 33 | int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ |
diff --git a/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S b/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S index 555a64f124ca..23af17584054 100644 --- a/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S +++ b/arch/sh/kernel/vsyscall/vsyscall-sigreturn.S | |||
@@ -34,6 +34,41 @@ __kernel_rt_sigreturn: | |||
34 | 1: .short __NR_rt_sigreturn | 34 | 1: .short __NR_rt_sigreturn |
35 | .LEND_rt_sigreturn: | 35 | .LEND_rt_sigreturn: |
36 | .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn | 36 | .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn |
37 | .previous | ||
37 | 38 | ||
38 | .section .eh_frame,"a",@progbits | 39 | .section .eh_frame,"a",@progbits |
40 | .LCIE1: | ||
41 | .ualong .LCIE1_end - .LCIE1_start | ||
42 | .LCIE1_start: | ||
43 | .ualong 0 /* CIE ID */ | ||
44 | .byte 0x1 /* Version number */ | ||
45 | .string "zRS" /* NUL-terminated augmentation string */ | ||
46 | .uleb128 0x1 /* Code alignment factor */ | ||
47 | .sleb128 -4 /* Data alignment factor */ | ||
48 | .byte 0x11 /* Return address register column */ | ||
49 | .uleb128 0x1 /* Augmentation length and data */ | ||
50 | .byte 0x1b /* DW_EH_PE_pcrel | DW_EH_PE_sdata4. */ | ||
51 | .byte 0xc, 0xf, 0x0 /* DW_CFA_def_cfa: r15 ofs 0 */ | ||
52 | |||
53 | .align 2 | ||
54 | .LCIE1_end: | ||
55 | |||
56 | .ualong .LFDE0_end-.LFDE0_start /* Length FDE0 */ | ||
57 | .LFDE0_start: | ||
58 | .ualong .LFDE0_start-.LCIE1 /* CIE pointer */ | ||
59 | .ualong .LSTART_sigreturn-. /* PC-relative start address */ | ||
60 | .ualong .LEND_sigreturn-.LSTART_sigreturn | ||
61 | .uleb128 0 /* Augmentation */ | ||
62 | .align 2 | ||
63 | .LFDE0_end: | ||
64 | |||
65 | .ualong .LFDE1_end-.LFDE1_start /* Length FDE1 */ | ||
66 | .LFDE1_start: | ||
67 | .ualong .LFDE1_start-.LCIE1 /* CIE pointer */ | ||
68 | .ualong .LSTART_rt_sigreturn-. /* PC-relative start address */ | ||
69 | .ualong .LEND_rt_sigreturn-.LSTART_rt_sigreturn | ||
70 | .uleb128 0 /* Augmentation */ | ||
71 | .align 2 | ||
72 | .LFDE1_end: | ||
73 | |||
39 | .previous | 74 | .previous |
diff --git a/arch/sh/kernel/vsyscall/vsyscall-trapa.S b/arch/sh/kernel/vsyscall/vsyscall-trapa.S index 3e70f851cdc6..0eb74d00690a 100644 --- a/arch/sh/kernel/vsyscall/vsyscall-trapa.S +++ b/arch/sh/kernel/vsyscall/vsyscall-trapa.S | |||
@@ -3,37 +3,34 @@ | |||
3 | .type __kernel_vsyscall,@function | 3 | .type __kernel_vsyscall,@function |
4 | __kernel_vsyscall: | 4 | __kernel_vsyscall: |
5 | .LSTART_vsyscall: | 5 | .LSTART_vsyscall: |
6 | /* XXX: We'll have to do something here once we opt to use the vDSO | 6 | trapa #0x10 |
7 | * page for something other than the signal trampoline.. as well as | 7 | nop |
8 | * fill out .eh_frame -- PFM. */ | ||
9 | .LEND_vsyscall: | 8 | .LEND_vsyscall: |
10 | .size __kernel_vsyscall,.-.LSTART_vsyscall | 9 | .size __kernel_vsyscall,.-.LSTART_vsyscall |
10 | .previous | ||
11 | 11 | ||
12 | .section .eh_frame,"a",@progbits | 12 | .section .eh_frame,"a",@progbits |
13 | .previous | ||
14 | .LCIE: | 13 | .LCIE: |
15 | .ualong .LCIE_end - .LCIE_start | 14 | .ualong .LCIE_end - .LCIE_start |
16 | .LCIE_start: | 15 | .LCIE_start: |
17 | .ualong 0 /* CIE ID */ | 16 | .ualong 0 /* CIE ID */ |
18 | .byte 0x1 /* Version number */ | 17 | .byte 0x1 /* Version number */ |
19 | .string "zRS" /* NUL-terminated augmentation string */ | 18 | .string "zR" /* NUL-terminated augmentation string */ |
20 | .uleb128 0x1 /* Code alignment factor */ | 19 | .uleb128 0x1 /* Code alignment factor */ |
21 | .sleb128 -4 /* Data alignment factor */ | 20 | .sleb128 -4 /* Data alignment factor */ |
22 | .byte 0x11 /* Return address register column */ | 21 | .byte 0x11 /* Return address register column */ |
23 | /* Augmentation length and data (none) */ | 22 | .uleb128 0x1 /* Augmentation length and data */ |
24 | .byte 0xc /* DW_CFA_def_cfa */ | 23 | .byte 0x1b /* DW_EH_PE_pcrel | DW_EH_PE_sdata4. */ |
25 | .uleb128 0xf /* r15 */ | 24 | .byte 0xc,0xf,0x0 /* DW_CFA_def_cfa: r15 ofs 0 */ |
26 | .uleb128 0x0 /* offset 0 */ | ||
27 | |||
28 | .align 2 | 25 | .align 2 |
29 | .LCIE_end: | 26 | .LCIE_end: |
30 | 27 | ||
31 | .ualong .LFDE_end-.LFDE_start /* Length FDE */ | 28 | .ualong .LFDE_end-.LFDE_start /* Length FDE */ |
32 | .LFDE_start: | 29 | .LFDE_start: |
33 | .ualong .LCIE /* CIE pointer */ | 30 | .ualong .LFDE_start-.LCIE /* CIE pointer */ |
34 | .ualong .LSTART_vsyscall-. /* start address */ | 31 | .ualong .LSTART_vsyscall-. /* PC-relative start address */ |
35 | .ualong .LEND_vsyscall-.LSTART_vsyscall | 32 | .ualong .LEND_vsyscall-.LSTART_vsyscall |
36 | .uleb128 0 | 33 | .uleb128 0 /* Augmentation */ |
37 | .align 2 | 34 | .align 2 |
38 | .LFDE_end: | 35 | .LFDE_end: |
39 | .previous | 36 | .previous |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 112fea12522a..0e529285b28d 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/highmem.h> | 18 | #include <linux/highmem.h> |
19 | #include <asm/pgtable.h> | 19 | #include <asm/pgtable.h> |
20 | #include <asm/mmu_context.h> | 20 | #include <asm/mmu_context.h> |
21 | #include <asm/cache_insns.h> | ||
21 | #include <asm/cacheflush.h> | 22 | #include <asm/cacheflush.h> |
22 | 23 | ||
23 | /* | 24 | /* |
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index f251b5f27652..b81d9dbf9fef 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c | |||
@@ -33,7 +33,8 @@ static int __init dma_init(void) | |||
33 | fs_initcall(dma_init); | 33 | fs_initcall(dma_init); |
34 | 34 | ||
35 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 35 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
36 | dma_addr_t *dma_handle, gfp_t gfp) | 36 | dma_addr_t *dma_handle, gfp_t gfp, |
37 | struct dma_attrs *attrs) | ||
37 | { | 38 | { |
38 | void *ret, *ret_nocache; | 39 | void *ret, *ret_nocache; |
39 | int order = get_order(size); | 40 | int order = get_order(size); |
@@ -64,7 +65,8 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, | |||
64 | } | 65 | } |
65 | 66 | ||
66 | void dma_generic_free_coherent(struct device *dev, size_t size, | 67 | void dma_generic_free_coherent(struct device *dev, size_t size, |
67 | void *vaddr, dma_addr_t dma_handle) | 68 | void *vaddr, dma_addr_t dma_handle, |
69 | struct dma_attrs *attrs) | ||
68 | { | 70 | { |
69 | int order = get_order(size); | 71 | int order = get_order(size); |
70 | unsigned long pfn = dma_handle >> PAGE_SHIFT; | 72 | unsigned long pfn = dma_handle >> PAGE_SHIFT; |
diff --git a/arch/sh/mm/flush-sh4.c b/arch/sh/mm/flush-sh4.c index 75a17f5bfa14..0b85dd9dd3a7 100644 --- a/arch/sh/mm/flush-sh4.c +++ b/arch/sh/mm/flush-sh4.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/mm.h> | 1 | #include <linux/mm.h> |
2 | #include <asm/mmu_context.h> | 2 | #include <asm/mmu_context.h> |
3 | #include <asm/cache_insns.h> | ||
3 | #include <asm/cacheflush.h> | 4 | #include <asm/cacheflush.h> |
4 | #include <asm/traps.h> | 5 | #include <asm/traps.h> |
5 | 6 | ||
diff --git a/arch/sh/mm/sram.c b/arch/sh/mm/sram.c index bc156ec4545e..2d8fa718d55e 100644 --- a/arch/sh/mm/sram.c +++ b/arch/sh/mm/sram.c | |||
@@ -9,6 +9,7 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/errno.h> | ||
12 | #include <asm/sram.h> | 13 | #include <asm/sram.h> |
13 | 14 | ||
14 | /* | 15 | /* |
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 8c0e4f7bb204..48a7c65731d2 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h | |||
@@ -26,24 +26,30 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
26 | 26 | ||
27 | #include <asm-generic/dma-mapping-common.h> | 27 | #include <asm-generic/dma-mapping-common.h> |
28 | 28 | ||
29 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 29 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
30 | dma_addr_t *dma_handle, gfp_t flag) | 30 | |
31 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
32 | dma_addr_t *dma_handle, gfp_t flag, | ||
33 | struct dma_attrs *attrs) | ||
31 | { | 34 | { |
32 | struct dma_map_ops *ops = get_dma_ops(dev); | 35 | struct dma_map_ops *ops = get_dma_ops(dev); |
33 | void *cpu_addr; | 36 | void *cpu_addr; |
34 | 37 | ||
35 | cpu_addr = ops->alloc_coherent(dev, size, dma_handle, flag); | 38 | cpu_addr = ops->alloc(dev, size, dma_handle, flag, attrs); |
36 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); | 39 | debug_dma_alloc_coherent(dev, size, *dma_handle, cpu_addr); |
37 | return cpu_addr; | 40 | return cpu_addr; |
38 | } | 41 | } |
39 | 42 | ||
40 | static inline void dma_free_coherent(struct device *dev, size_t size, | 43 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
41 | void *cpu_addr, dma_addr_t dma_handle) | 44 | |
45 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
46 | void *cpu_addr, dma_addr_t dma_handle, | ||
47 | struct dma_attrs *attrs) | ||
42 | { | 48 | { |
43 | struct dma_map_ops *ops = get_dma_ops(dev); | 49 | struct dma_map_ops *ops = get_dma_ops(dev); |
44 | 50 | ||
45 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); | 51 | debug_dma_free_coherent(dev, size, cpu_addr, dma_handle); |
46 | ops->free_coherent(dev, size, cpu_addr, dma_handle); | 52 | ops->free(dev, size, cpu_addr, dma_handle, attrs); |
47 | } | 53 | } |
48 | 54 | ||
49 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | 55 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) |
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 6fa2f7980e6b..76e4a52aa85e 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h | |||
@@ -12,8 +12,6 @@ | |||
12 | * the SpitFire page tables. | 12 | * the SpitFire page tables. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <asm-generic/pgtable-nopud.h> | ||
16 | |||
17 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
18 | #include <linux/const.h> | 16 | #include <linux/const.h> |
19 | #include <asm/types.h> | 17 | #include <asm/types.h> |
@@ -22,6 +20,8 @@ | |||
22 | #include <asm/page.h> | 20 | #include <asm/page.h> |
23 | #include <asm/processor.h> | 21 | #include <asm/processor.h> |
24 | 22 | ||
23 | #include <asm-generic/pgtable-nopud.h> | ||
24 | |||
25 | /* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB). | 25 | /* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB). |
26 | * The page copy blockops can use 0x6000000 to 0x8000000. | 26 | * The page copy blockops can use 0x6000000 to 0x8000000. |
27 | * The TSB is mapped in the 0x8000000 to 0xa000000 range. | 27 | * The TSB is mapped in the 0x8000000 to 0xa000000 range. |
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 4643d68713fa..070ed141aac7 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
@@ -280,7 +280,8 @@ static inline void iommu_free_ctx(struct iommu *iommu, int ctx) | |||
280 | } | 280 | } |
281 | 281 | ||
282 | static void *dma_4u_alloc_coherent(struct device *dev, size_t size, | 282 | static void *dma_4u_alloc_coherent(struct device *dev, size_t size, |
283 | dma_addr_t *dma_addrp, gfp_t gfp) | 283 | dma_addr_t *dma_addrp, gfp_t gfp, |
284 | struct dma_attrs *attrs) | ||
284 | { | 285 | { |
285 | unsigned long flags, order, first_page; | 286 | unsigned long flags, order, first_page; |
286 | struct iommu *iommu; | 287 | struct iommu *iommu; |
@@ -330,7 +331,8 @@ static void *dma_4u_alloc_coherent(struct device *dev, size_t size, | |||
330 | } | 331 | } |
331 | 332 | ||
332 | static void dma_4u_free_coherent(struct device *dev, size_t size, | 333 | static void dma_4u_free_coherent(struct device *dev, size_t size, |
333 | void *cpu, dma_addr_t dvma) | 334 | void *cpu, dma_addr_t dvma, |
335 | struct dma_attrs *attrs) | ||
334 | { | 336 | { |
335 | struct iommu *iommu; | 337 | struct iommu *iommu; |
336 | unsigned long flags, order, npages; | 338 | unsigned long flags, order, npages; |
@@ -825,8 +827,8 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev, | |||
825 | } | 827 | } |
826 | 828 | ||
827 | static struct dma_map_ops sun4u_dma_ops = { | 829 | static struct dma_map_ops sun4u_dma_ops = { |
828 | .alloc_coherent = dma_4u_alloc_coherent, | 830 | .alloc = dma_4u_alloc_coherent, |
829 | .free_coherent = dma_4u_free_coherent, | 831 | .free = dma_4u_free_coherent, |
830 | .map_page = dma_4u_map_page, | 832 | .map_page = dma_4u_map_page, |
831 | .unmap_page = dma_4u_unmap_page, | 833 | .unmap_page = dma_4u_unmap_page, |
832 | .map_sg = dma_4u_map_sg, | 834 | .map_sg = dma_4u_map_sg, |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index d0479e2163fa..21bd73943f7f 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -261,7 +261,8 @@ EXPORT_SYMBOL(sbus_set_sbus64); | |||
261 | * CPU may access them without any explicit flushing. | 261 | * CPU may access them without any explicit flushing. |
262 | */ | 262 | */ |
263 | static void *sbus_alloc_coherent(struct device *dev, size_t len, | 263 | static void *sbus_alloc_coherent(struct device *dev, size_t len, |
264 | dma_addr_t *dma_addrp, gfp_t gfp) | 264 | dma_addr_t *dma_addrp, gfp_t gfp, |
265 | struct dma_attrs *attrs) | ||
265 | { | 266 | { |
266 | struct platform_device *op = to_platform_device(dev); | 267 | struct platform_device *op = to_platform_device(dev); |
267 | unsigned long len_total = PAGE_ALIGN(len); | 268 | unsigned long len_total = PAGE_ALIGN(len); |
@@ -315,7 +316,7 @@ err_nopages: | |||
315 | } | 316 | } |
316 | 317 | ||
317 | static void sbus_free_coherent(struct device *dev, size_t n, void *p, | 318 | static void sbus_free_coherent(struct device *dev, size_t n, void *p, |
318 | dma_addr_t ba) | 319 | dma_addr_t ba, struct dma_attrs *attrs) |
319 | { | 320 | { |
320 | struct resource *res; | 321 | struct resource *res; |
321 | struct page *pgv; | 322 | struct page *pgv; |
@@ -407,8 +408,8 @@ static void sbus_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
407 | } | 408 | } |
408 | 409 | ||
409 | struct dma_map_ops sbus_dma_ops = { | 410 | struct dma_map_ops sbus_dma_ops = { |
410 | .alloc_coherent = sbus_alloc_coherent, | 411 | .alloc = sbus_alloc_coherent, |
411 | .free_coherent = sbus_free_coherent, | 412 | .free = sbus_free_coherent, |
412 | .map_page = sbus_map_page, | 413 | .map_page = sbus_map_page, |
413 | .unmap_page = sbus_unmap_page, | 414 | .unmap_page = sbus_unmap_page, |
414 | .map_sg = sbus_map_sg, | 415 | .map_sg = sbus_map_sg, |
@@ -436,7 +437,8 @@ arch_initcall(sparc_register_ioport); | |||
436 | * hwdev should be valid struct pci_dev pointer for PCI devices. | 437 | * hwdev should be valid struct pci_dev pointer for PCI devices. |
437 | */ | 438 | */ |
438 | static void *pci32_alloc_coherent(struct device *dev, size_t len, | 439 | static void *pci32_alloc_coherent(struct device *dev, size_t len, |
439 | dma_addr_t *pba, gfp_t gfp) | 440 | dma_addr_t *pba, gfp_t gfp, |
441 | struct dma_attrs *attrs) | ||
440 | { | 442 | { |
441 | unsigned long len_total = PAGE_ALIGN(len); | 443 | unsigned long len_total = PAGE_ALIGN(len); |
442 | void *va; | 444 | void *va; |
@@ -489,7 +491,7 @@ err_nopages: | |||
489 | * past this call are illegal. | 491 | * past this call are illegal. |
490 | */ | 492 | */ |
491 | static void pci32_free_coherent(struct device *dev, size_t n, void *p, | 493 | static void pci32_free_coherent(struct device *dev, size_t n, void *p, |
492 | dma_addr_t ba) | 494 | dma_addr_t ba, struct dma_attrs *attrs) |
493 | { | 495 | { |
494 | struct resource *res; | 496 | struct resource *res; |
495 | 497 | ||
@@ -645,8 +647,8 @@ static void pci32_sync_sg_for_device(struct device *device, struct scatterlist * | |||
645 | } | 647 | } |
646 | 648 | ||
647 | struct dma_map_ops pci32_dma_ops = { | 649 | struct dma_map_ops pci32_dma_ops = { |
648 | .alloc_coherent = pci32_alloc_coherent, | 650 | .alloc = pci32_alloc_coherent, |
649 | .free_coherent = pci32_free_coherent, | 651 | .free = pci32_free_coherent, |
650 | .map_page = pci32_map_page, | 652 | .map_page = pci32_map_page, |
651 | .unmap_page = pci32_unmap_page, | 653 | .unmap_page = pci32_unmap_page, |
652 | .map_sg = pci32_map_sg, | 654 | .map_sg = pci32_map_sg, |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index a19c8a063683..35e43673c453 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -104,11 +104,11 @@ static int irq_choose_cpu(const struct cpumask *affinity) | |||
104 | { | 104 | { |
105 | cpumask_t mask; | 105 | cpumask_t mask; |
106 | 106 | ||
107 | cpus_and(mask, cpu_online_map, *affinity); | 107 | cpumask_and(&mask, cpu_online_mask, affinity); |
108 | if (cpus_equal(mask, cpu_online_map) || cpus_empty(mask)) | 108 | if (cpumask_equal(&mask, cpu_online_mask) || cpumask_empty(&mask)) |
109 | return boot_cpu_id; | 109 | return boot_cpu_id; |
110 | else | 110 | else |
111 | return first_cpu(mask); | 111 | return cpumask_first(&mask); |
112 | } | 112 | } |
113 | #else | 113 | #else |
114 | #define irq_choose_cpu(affinity) boot_cpu_id | 114 | #define irq_choose_cpu(affinity) boot_cpu_id |
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index af5755d20fbe..7661e84a05a0 100644 --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c | |||
@@ -128,7 +128,8 @@ static inline long iommu_batch_end(void) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | static void *dma_4v_alloc_coherent(struct device *dev, size_t size, | 130 | static void *dma_4v_alloc_coherent(struct device *dev, size_t size, |
131 | dma_addr_t *dma_addrp, gfp_t gfp) | 131 | dma_addr_t *dma_addrp, gfp_t gfp, |
132 | struct dma_attrs *attrs) | ||
132 | { | 133 | { |
133 | unsigned long flags, order, first_page, npages, n; | 134 | unsigned long flags, order, first_page, npages, n; |
134 | struct iommu *iommu; | 135 | struct iommu *iommu; |
@@ -198,7 +199,7 @@ range_alloc_fail: | |||
198 | } | 199 | } |
199 | 200 | ||
200 | static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu, | 201 | static void dma_4v_free_coherent(struct device *dev, size_t size, void *cpu, |
201 | dma_addr_t dvma) | 202 | dma_addr_t dvma, struct dma_attrs *attrs) |
202 | { | 203 | { |
203 | struct pci_pbm_info *pbm; | 204 | struct pci_pbm_info *pbm; |
204 | struct iommu *iommu; | 205 | struct iommu *iommu; |
@@ -527,8 +528,8 @@ static void dma_4v_unmap_sg(struct device *dev, struct scatterlist *sglist, | |||
527 | } | 528 | } |
528 | 529 | ||
529 | static struct dma_map_ops sun4v_dma_ops = { | 530 | static struct dma_map_ops sun4v_dma_ops = { |
530 | .alloc_coherent = dma_4v_alloc_coherent, | 531 | .alloc = dma_4v_alloc_coherent, |
531 | .free_coherent = dma_4v_free_coherent, | 532 | .free = dma_4v_free_coherent, |
532 | .map_page = dma_4v_map_page, | 533 | .map_page = dma_4v_map_page, |
533 | .unmap_page = dma_4v_unmap_page, | 534 | .unmap_page = dma_4v_unmap_page, |
534 | .map_sg = dma_4v_map_sg, | 535 | .map_sg = dma_4v_map_sg, |
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 11270ca22c0a..96033e2d6845 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig | |||
@@ -12,7 +12,7 @@ config TILE | |||
12 | select GENERIC_PENDING_IRQ if SMP | 12 | select GENERIC_PENDING_IRQ if SMP |
13 | select GENERIC_IRQ_SHOW | 13 | select GENERIC_IRQ_SHOW |
14 | select SYS_HYPERVISOR | 14 | select SYS_HYPERVISOR |
15 | select ARCH_HAVE_NMI_SAFE_CMPXCHG if !M386 | 15 | select ARCH_HAVE_NMI_SAFE_CMPXCHG |
16 | 16 | ||
17 | # FIXME: investigate whether we need/want these options. | 17 | # FIXME: investigate whether we need/want these options. |
18 | # select HAVE_IOREMAP_PROT | 18 | # select HAVE_IOREMAP_PROT |
@@ -69,6 +69,9 @@ config ARCH_PHYS_ADDR_T_64BIT | |||
69 | config ARCH_DMA_ADDR_T_64BIT | 69 | config ARCH_DMA_ADDR_T_64BIT |
70 | def_bool y | 70 | def_bool y |
71 | 71 | ||
72 | config NEED_DMA_MAP_STATE | ||
73 | def_bool y | ||
74 | |||
72 | config LOCKDEP_SUPPORT | 75 | config LOCKDEP_SUPPORT |
73 | def_bool y | 76 | def_bool y |
74 | 77 | ||
@@ -118,7 +121,7 @@ config 64BIT | |||
118 | 121 | ||
119 | config ARCH_DEFCONFIG | 122 | config ARCH_DEFCONFIG |
120 | string | 123 | string |
121 | default "arch/tile/configs/tile_defconfig" if !TILEGX | 124 | default "arch/tile/configs/tilepro_defconfig" if !TILEGX |
122 | default "arch/tile/configs/tilegx_defconfig" if TILEGX | 125 | default "arch/tile/configs/tilegx_defconfig" if TILEGX |
123 | 126 | ||
124 | source "init/Kconfig" | 127 | source "init/Kconfig" |
@@ -240,6 +243,7 @@ endchoice | |||
240 | 243 | ||
241 | config PAGE_OFFSET | 244 | config PAGE_OFFSET |
242 | hex | 245 | hex |
246 | depends on !64BIT | ||
243 | default 0xF0000000 if VMSPLIT_3_75G | 247 | default 0xF0000000 if VMSPLIT_3_75G |
244 | default 0xE0000000 if VMSPLIT_3_5G | 248 | default 0xE0000000 if VMSPLIT_3_5G |
245 | default 0xB0000000 if VMSPLIT_2_75G | 249 | default 0xB0000000 if VMSPLIT_2_75G |
diff --git a/arch/tile/Makefile b/arch/tile/Makefile index 17acce70569b..9520bc5a4b7f 100644 --- a/arch/tile/Makefile +++ b/arch/tile/Makefile | |||
@@ -30,7 +30,8 @@ ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"") | |||
30 | KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) | 30 | KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) |
31 | endif | 31 | endif |
32 | 32 | ||
33 | LIBGCC_PATH := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 33 | LIBGCC_PATH := \ |
34 | $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) | ||
34 | 35 | ||
35 | # Provide the path to use for "make defconfig". | 36 | # Provide the path to use for "make defconfig". |
36 | KBUILD_DEFCONFIG := $(ARCH)_defconfig | 37 | KBUILD_DEFCONFIG := $(ARCH)_defconfig |
@@ -53,8 +54,6 @@ libs-y += $(LIBGCC_PATH) | |||
53 | # See arch/tile/Kbuild for content of core part of the kernel | 54 | # See arch/tile/Kbuild for content of core part of the kernel |
54 | core-y += arch/tile/ | 55 | core-y += arch/tile/ |
55 | 56 | ||
56 | core-$(CONFIG_KVM) += arch/tile/kvm/ | ||
57 | |||
58 | ifdef TILERA_ROOT | 57 | ifdef TILERA_ROOT |
59 | INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot | 58 | INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot |
60 | endif | 59 | endif |
diff --git a/arch/tile/include/arch/spr_def.h b/arch/tile/include/arch/spr_def.h index f548efeb2de3..d6ba449b5363 100644 --- a/arch/tile/include/arch/spr_def.h +++ b/arch/tile/include/arch/spr_def.h | |||
@@ -60,8 +60,8 @@ | |||
60 | _concat4(SPR_IPI_EVENT_, CONFIG_KERNEL_PL,,) | 60 | _concat4(SPR_IPI_EVENT_, CONFIG_KERNEL_PL,,) |
61 | #define SPR_IPI_EVENT_RESET_K \ | 61 | #define SPR_IPI_EVENT_RESET_K \ |
62 | _concat4(SPR_IPI_EVENT_RESET_, CONFIG_KERNEL_PL,,) | 62 | _concat4(SPR_IPI_EVENT_RESET_, CONFIG_KERNEL_PL,,) |
63 | #define SPR_IPI_MASK_SET_K \ | 63 | #define SPR_IPI_EVENT_SET_K \ |
64 | _concat4(SPR_IPI_MASK_SET_, CONFIG_KERNEL_PL,,) | 64 | _concat4(SPR_IPI_EVENT_SET_, CONFIG_KERNEL_PL,,) |
65 | #define INT_IPI_K \ | 65 | #define INT_IPI_K \ |
66 | _concat4(INT_IPI_, CONFIG_KERNEL_PL,,) | 66 | _concat4(INT_IPI_, CONFIG_KERNEL_PL,,) |
67 | 67 | ||
diff --git a/arch/tile/include/asm/atomic.h b/arch/tile/include/asm/atomic.h index bb696da5d7cd..f2461429a4a4 100644 --- a/arch/tile/include/asm/atomic.h +++ b/arch/tile/include/asm/atomic.h | |||
@@ -17,6 +17,8 @@ | |||
17 | #ifndef _ASM_TILE_ATOMIC_H | 17 | #ifndef _ASM_TILE_ATOMIC_H |
18 | #define _ASM_TILE_ATOMIC_H | 18 | #define _ASM_TILE_ATOMIC_H |
19 | 19 | ||
20 | #include <asm/cmpxchg.h> | ||
21 | |||
20 | #ifndef __ASSEMBLY__ | 22 | #ifndef __ASSEMBLY__ |
21 | 23 | ||
22 | #include <linux/compiler.h> | 24 | #include <linux/compiler.h> |
@@ -121,54 +123,6 @@ static inline int atomic_read(const atomic_t *v) | |||
121 | */ | 123 | */ |
122 | #define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) | 124 | #define atomic_add_negative(i, v) (atomic_add_return((i), (v)) < 0) |
123 | 125 | ||
124 | /* Nonexistent functions intended to cause link errors. */ | ||
125 | extern unsigned long __xchg_called_with_bad_pointer(void); | ||
126 | extern unsigned long __cmpxchg_called_with_bad_pointer(void); | ||
127 | |||
128 | #define xchg(ptr, x) \ | ||
129 | ({ \ | ||
130 | typeof(*(ptr)) __x; \ | ||
131 | switch (sizeof(*(ptr))) { \ | ||
132 | case 4: \ | ||
133 | __x = (typeof(__x))(typeof(__x-__x))atomic_xchg( \ | ||
134 | (atomic_t *)(ptr), \ | ||
135 | (u32)(typeof((x)-(x)))(x)); \ | ||
136 | break; \ | ||
137 | case 8: \ | ||
138 | __x = (typeof(__x))(typeof(__x-__x))atomic64_xchg( \ | ||
139 | (atomic64_t *)(ptr), \ | ||
140 | (u64)(typeof((x)-(x)))(x)); \ | ||
141 | break; \ | ||
142 | default: \ | ||
143 | __xchg_called_with_bad_pointer(); \ | ||
144 | } \ | ||
145 | __x; \ | ||
146 | }) | ||
147 | |||
148 | #define cmpxchg(ptr, o, n) \ | ||
149 | ({ \ | ||
150 | typeof(*(ptr)) __x; \ | ||
151 | switch (sizeof(*(ptr))) { \ | ||
152 | case 4: \ | ||
153 | __x = (typeof(__x))(typeof(__x-__x))atomic_cmpxchg( \ | ||
154 | (atomic_t *)(ptr), \ | ||
155 | (u32)(typeof((o)-(o)))(o), \ | ||
156 | (u32)(typeof((n)-(n)))(n)); \ | ||
157 | break; \ | ||
158 | case 8: \ | ||
159 | __x = (typeof(__x))(typeof(__x-__x))atomic64_cmpxchg( \ | ||
160 | (atomic64_t *)(ptr), \ | ||
161 | (u64)(typeof((o)-(o)))(o), \ | ||
162 | (u64)(typeof((n)-(n)))(n)); \ | ||
163 | break; \ | ||
164 | default: \ | ||
165 | __cmpxchg_called_with_bad_pointer(); \ | ||
166 | } \ | ||
167 | __x; \ | ||
168 | }) | ||
169 | |||
170 | #define tas(ptr) (xchg((ptr), 1)) | ||
171 | |||
172 | #endif /* __ASSEMBLY__ */ | 126 | #endif /* __ASSEMBLY__ */ |
173 | 127 | ||
174 | #ifndef __tilegx__ | 128 | #ifndef __tilegx__ |
diff --git a/arch/tile/include/asm/atomic_32.h b/arch/tile/include/asm/atomic_32.h index 466dc4a39a4f..54d1da826f93 100644 --- a/arch/tile/include/asm/atomic_32.h +++ b/arch/tile/include/asm/atomic_32.h | |||
@@ -200,7 +200,7 @@ static inline u64 atomic64_add_return(u64 i, atomic64_t *v) | |||
200 | * @u: ...unless v is equal to u. | 200 | * @u: ...unless v is equal to u. |
201 | * | 201 | * |
202 | * Atomically adds @a to @v, so long as @v was not already @u. | 202 | * Atomically adds @a to @v, so long as @v was not already @u. |
203 | * Returns the old value of @v. | 203 | * Returns non-zero if @v was not @u, and zero otherwise. |
204 | */ | 204 | */ |
205 | static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u) | 205 | static inline u64 atomic64_add_unless(atomic64_t *v, u64 a, u64 u) |
206 | { | 206 | { |
diff --git a/arch/tile/include/asm/bitops_64.h b/arch/tile/include/asm/bitops_64.h index 58d021a9834f..60b87ee54fb8 100644 --- a/arch/tile/include/asm/bitops_64.h +++ b/arch/tile/include/asm/bitops_64.h | |||
@@ -38,10 +38,10 @@ static inline void clear_bit(unsigned nr, volatile unsigned long *addr) | |||
38 | 38 | ||
39 | static inline void change_bit(unsigned nr, volatile unsigned long *addr) | 39 | static inline void change_bit(unsigned nr, volatile unsigned long *addr) |
40 | { | 40 | { |
41 | unsigned long old, mask = (1UL << (nr % BITS_PER_LONG)); | 41 | unsigned long mask = (1UL << (nr % BITS_PER_LONG)); |
42 | long guess, oldval; | 42 | unsigned long guess, oldval; |
43 | addr += nr / BITS_PER_LONG; | 43 | addr += nr / BITS_PER_LONG; |
44 | old = *addr; | 44 | oldval = *addr; |
45 | do { | 45 | do { |
46 | guess = oldval; | 46 | guess = oldval; |
47 | oldval = atomic64_cmpxchg((atomic64_t *)addr, | 47 | oldval = atomic64_cmpxchg((atomic64_t *)addr, |
@@ -85,7 +85,7 @@ static inline int test_and_change_bit(unsigned nr, | |||
85 | volatile unsigned long *addr) | 85 | volatile unsigned long *addr) |
86 | { | 86 | { |
87 | unsigned long mask = (1UL << (nr % BITS_PER_LONG)); | 87 | unsigned long mask = (1UL << (nr % BITS_PER_LONG)); |
88 | long guess, oldval = *addr; | 88 | unsigned long guess, oldval; |
89 | addr += nr / BITS_PER_LONG; | 89 | addr += nr / BITS_PER_LONG; |
90 | oldval = *addr; | 90 | oldval = *addr; |
91 | do { | 91 | do { |
diff --git a/arch/tile/include/asm/cmpxchg.h b/arch/tile/include/asm/cmpxchg.h new file mode 100644 index 000000000000..276f067e3640 --- /dev/null +++ b/arch/tile/include/asm/cmpxchg.h | |||
@@ -0,0 +1,73 @@ | |||
1 | /* | ||
2 | * cmpxchg.h -- forked from asm/atomic.h with this copyright: | ||
3 | * | ||
4 | * Copyright 2010 Tilera Corporation. All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation, version 2. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
13 | * NON INFRINGEMENT. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef _ASM_TILE_CMPXCHG_H | ||
19 | #define _ASM_TILE_CMPXCHG_H | ||
20 | |||
21 | #ifndef __ASSEMBLY__ | ||
22 | |||
23 | /* Nonexistent functions intended to cause link errors. */ | ||
24 | extern unsigned long __xchg_called_with_bad_pointer(void); | ||
25 | extern unsigned long __cmpxchg_called_with_bad_pointer(void); | ||
26 | |||
27 | #define xchg(ptr, x) \ | ||
28 | ({ \ | ||
29 | typeof(*(ptr)) __x; \ | ||
30 | switch (sizeof(*(ptr))) { \ | ||
31 | case 4: \ | ||
32 | __x = (typeof(__x))(typeof(__x-__x))atomic_xchg( \ | ||
33 | (atomic_t *)(ptr), \ | ||
34 | (u32)(typeof((x)-(x)))(x)); \ | ||
35 | break; \ | ||
36 | case 8: \ | ||
37 | __x = (typeof(__x))(typeof(__x-__x))atomic64_xchg( \ | ||
38 | (atomic64_t *)(ptr), \ | ||
39 | (u64)(typeof((x)-(x)))(x)); \ | ||
40 | break; \ | ||
41 | default: \ | ||
42 | __xchg_called_with_bad_pointer(); \ | ||
43 | } \ | ||
44 | __x; \ | ||
45 | }) | ||
46 | |||
47 | #define cmpxchg(ptr, o, n) \ | ||
48 | ({ \ | ||
49 | typeof(*(ptr)) __x; \ | ||
50 | switch (sizeof(*(ptr))) { \ | ||
51 | case 4: \ | ||
52 | __x = (typeof(__x))(typeof(__x-__x))atomic_cmpxchg( \ | ||
53 | (atomic_t *)(ptr), \ | ||
54 | (u32)(typeof((o)-(o)))(o), \ | ||
55 | (u32)(typeof((n)-(n)))(n)); \ | ||
56 | break; \ | ||
57 | case 8: \ | ||
58 | __x = (typeof(__x))(typeof(__x-__x))atomic64_cmpxchg( \ | ||
59 | (atomic64_t *)(ptr), \ | ||
60 | (u64)(typeof((o)-(o)))(o), \ | ||
61 | (u64)(typeof((n)-(n)))(n)); \ | ||
62 | break; \ | ||
63 | default: \ | ||
64 | __cmpxchg_called_with_bad_pointer(); \ | ||
65 | } \ | ||
66 | __x; \ | ||
67 | }) | ||
68 | |||
69 | #define tas(ptr) (xchg((ptr), 1)) | ||
70 | |||
71 | #endif /* __ASSEMBLY__ */ | ||
72 | |||
73 | #endif /* _ASM_TILE_CMPXCHG_H */ | ||
diff --git a/arch/tile/include/asm/irq.h b/arch/tile/include/asm/irq.h index f80f8ceabc67..33cff9a3058b 100644 --- a/arch/tile/include/asm/irq.h +++ b/arch/tile/include/asm/irq.h | |||
@@ -21,7 +21,7 @@ | |||
21 | #define NR_IRQS 32 | 21 | #define NR_IRQS 32 |
22 | 22 | ||
23 | /* IRQ numbers used for linux IPIs. */ | 23 | /* IRQ numbers used for linux IPIs. */ |
24 | #define IRQ_RESCHEDULE 1 | 24 | #define IRQ_RESCHEDULE 0 |
25 | 25 | ||
26 | #define irq_canonicalize(irq) (irq) | 26 | #define irq_canonicalize(irq) (irq) |
27 | 27 | ||
diff --git a/arch/tile/include/asm/spinlock_64.h b/arch/tile/include/asm/spinlock_64.h index 72be5904e020..5f8b6a095fd8 100644 --- a/arch/tile/include/asm/spinlock_64.h +++ b/arch/tile/include/asm/spinlock_64.h | |||
@@ -137,7 +137,7 @@ static inline void arch_read_unlock(arch_rwlock_t *rw) | |||
137 | static inline void arch_write_unlock(arch_rwlock_t *rw) | 137 | static inline void arch_write_unlock(arch_rwlock_t *rw) |
138 | { | 138 | { |
139 | __insn_mf(); | 139 | __insn_mf(); |
140 | rw->lock = 0; | 140 | __insn_exch4(&rw->lock, 0); /* Avoid waiting in the write buffer. */ |
141 | } | 141 | } |
142 | 142 | ||
143 | static inline int arch_read_trylock(arch_rwlock_t *rw) | 143 | static inline int arch_read_trylock(arch_rwlock_t *rw) |
diff --git a/arch/tile/include/asm/stack.h b/arch/tile/include/asm/stack.h index 4d97a2db932e..0e9d382a2d45 100644 --- a/arch/tile/include/asm/stack.h +++ b/arch/tile/include/asm/stack.h | |||
@@ -25,7 +25,6 @@ | |||
25 | struct KBacktraceIterator { | 25 | struct KBacktraceIterator { |
26 | BacktraceIterator it; | 26 | BacktraceIterator it; |
27 | struct task_struct *task; /* task we are backtracing */ | 27 | struct task_struct *task; /* task we are backtracing */ |
28 | pte_t *pgtable; /* page table for user space access */ | ||
29 | int end; /* iteration complete. */ | 28 | int end; /* iteration complete. */ |
30 | int new_context; /* new context is starting */ | 29 | int new_context; /* new context is starting */ |
31 | int profile; /* profiling, so stop on async intrpt */ | 30 | int profile; /* profiling, so stop on async intrpt */ |
diff --git a/arch/tile/include/asm/traps.h b/arch/tile/include/asm/traps.h index 5f20f920f932..e28c3df4176a 100644 --- a/arch/tile/include/asm/traps.h +++ b/arch/tile/include/asm/traps.h | |||
@@ -64,7 +64,11 @@ void do_breakpoint(struct pt_regs *, int fault_num); | |||
64 | 64 | ||
65 | 65 | ||
66 | #ifdef __tilegx__ | 66 | #ifdef __tilegx__ |
67 | /* kernel/single_step.c */ | ||
67 | void gx_singlestep_handle(struct pt_regs *, int fault_num); | 68 | void gx_singlestep_handle(struct pt_regs *, int fault_num); |
69 | |||
70 | /* kernel/intvec_64.S */ | ||
71 | void fill_ra_stack(void); | ||
68 | #endif | 72 | #endif |
69 | 73 | ||
70 | #endif /* _ASM_TILE_SYSCALLS_H */ | 74 | #endif /* _ASM_TILE_TRAPS_H */ |
diff --git a/arch/tile/kernel/entry.S b/arch/tile/kernel/entry.S index 431e9ae60488..ec91568df880 100644 --- a/arch/tile/kernel/entry.S +++ b/arch/tile/kernel/entry.S | |||
@@ -85,6 +85,7 @@ STD_ENTRY(cpu_idle_on_new_stack) | |||
85 | /* Loop forever on a nap during SMP boot. */ | 85 | /* Loop forever on a nap during SMP boot. */ |
86 | STD_ENTRY(smp_nap) | 86 | STD_ENTRY(smp_nap) |
87 | nap | 87 | nap |
88 | nop /* avoid provoking the icache prefetch with a jump */ | ||
88 | j smp_nap /* we are not architecturally guaranteed not to exit nap */ | 89 | j smp_nap /* we are not architecturally guaranteed not to exit nap */ |
89 | jrp lr /* clue in the backtracer */ | 90 | jrp lr /* clue in the backtracer */ |
90 | STD_ENDPROC(smp_nap) | 91 | STD_ENDPROC(smp_nap) |
@@ -105,5 +106,6 @@ STD_ENTRY(_cpu_idle) | |||
105 | .global _cpu_idle_nap | 106 | .global _cpu_idle_nap |
106 | _cpu_idle_nap: | 107 | _cpu_idle_nap: |
107 | nap | 108 | nap |
109 | nop /* avoid provoking the icache prefetch with a jump */ | ||
108 | jrp lr | 110 | jrp lr |
109 | STD_ENDPROC(_cpu_idle) | 111 | STD_ENDPROC(_cpu_idle) |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index aecc8ed5f39b..5d56a1ef5ba5 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
@@ -799,6 +799,10 @@ handle_interrupt: | |||
799 | * This routine takes a boolean in r30 indicating if this is an NMI. | 799 | * This routine takes a boolean in r30 indicating if this is an NMI. |
800 | * If so, we also expect a boolean in r31 indicating whether to | 800 | * If so, we also expect a boolean in r31 indicating whether to |
801 | * re-enable the oprofile interrupts. | 801 | * re-enable the oprofile interrupts. |
802 | * | ||
803 | * Note that .Lresume_userspace is jumped to directly in several | ||
804 | * places, and we need to make sure r30 is set correctly in those | ||
805 | * callers as well. | ||
802 | */ | 806 | */ |
803 | STD_ENTRY(interrupt_return) | 807 | STD_ENTRY(interrupt_return) |
804 | /* If we're resuming to kernel space, don't check thread flags. */ | 808 | /* If we're resuming to kernel space, don't check thread flags. */ |
@@ -1237,7 +1241,10 @@ handle_syscall: | |||
1237 | bzt r30, 1f | 1241 | bzt r30, 1f |
1238 | jal do_syscall_trace | 1242 | jal do_syscall_trace |
1239 | FEEDBACK_REENTER(handle_syscall) | 1243 | FEEDBACK_REENTER(handle_syscall) |
1240 | 1: j .Lresume_userspace /* jump into middle of interrupt_return */ | 1244 | 1: { |
1245 | movei r30, 0 /* not an NMI */ | ||
1246 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1247 | } | ||
1241 | 1248 | ||
1242 | .Linvalid_syscall: | 1249 | .Linvalid_syscall: |
1243 | /* Report an invalid syscall back to the user program */ | 1250 | /* Report an invalid syscall back to the user program */ |
@@ -1246,7 +1253,10 @@ handle_syscall: | |||
1246 | movei r28, -ENOSYS | 1253 | movei r28, -ENOSYS |
1247 | } | 1254 | } |
1248 | sw r29, r28 | 1255 | sw r29, r28 |
1249 | j .Lresume_userspace /* jump into middle of interrupt_return */ | 1256 | { |
1257 | movei r30, 0 /* not an NMI */ | ||
1258 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1259 | } | ||
1250 | STD_ENDPROC(handle_syscall) | 1260 | STD_ENDPROC(handle_syscall) |
1251 | 1261 | ||
1252 | /* Return the address for oprofile to suppress in backtraces. */ | 1262 | /* Return the address for oprofile to suppress in backtraces. */ |
@@ -1262,7 +1272,10 @@ STD_ENTRY(ret_from_fork) | |||
1262 | jal sim_notify_fork | 1272 | jal sim_notify_fork |
1263 | jal schedule_tail | 1273 | jal schedule_tail |
1264 | FEEDBACK_REENTER(ret_from_fork) | 1274 | FEEDBACK_REENTER(ret_from_fork) |
1265 | j .Lresume_userspace /* jump into middle of interrupt_return */ | 1275 | { |
1276 | movei r30, 0 /* not an NMI */ | ||
1277 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1278 | } | ||
1266 | STD_ENDPROC(ret_from_fork) | 1279 | STD_ENDPROC(ret_from_fork) |
1267 | 1280 | ||
1268 | /* | 1281 | /* |
@@ -1376,7 +1389,10 @@ handle_ill: | |||
1376 | 1389 | ||
1377 | jal send_sigtrap /* issue a SIGTRAP */ | 1390 | jal send_sigtrap /* issue a SIGTRAP */ |
1378 | FEEDBACK_REENTER(handle_ill) | 1391 | FEEDBACK_REENTER(handle_ill) |
1379 | j .Lresume_userspace /* jump into middle of interrupt_return */ | 1392 | { |
1393 | movei r30, 0 /* not an NMI */ | ||
1394 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1395 | } | ||
1380 | 1396 | ||
1381 | .Ldispatch_normal_ill: | 1397 | .Ldispatch_normal_ill: |
1382 | { | 1398 | { |
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S index 79c93e10ba27..49d9d6621682 100644 --- a/arch/tile/kernel/intvec_64.S +++ b/arch/tile/kernel/intvec_64.S | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/irqflags.h> | 22 | #include <asm/irqflags.h> |
23 | #include <asm/asm-offsets.h> | 23 | #include <asm/asm-offsets.h> |
24 | #include <asm/types.h> | 24 | #include <asm/types.h> |
25 | #include <asm/signal.h> | ||
25 | #include <hv/hypervisor.h> | 26 | #include <hv/hypervisor.h> |
26 | #include <arch/abi.h> | 27 | #include <arch/abi.h> |
27 | #include <arch/interrupts.h> | 28 | #include <arch/interrupts.h> |
@@ -605,6 +606,10 @@ handle_interrupt: | |||
605 | * This routine takes a boolean in r30 indicating if this is an NMI. | 606 | * This routine takes a boolean in r30 indicating if this is an NMI. |
606 | * If so, we also expect a boolean in r31 indicating whether to | 607 | * If so, we also expect a boolean in r31 indicating whether to |
607 | * re-enable the oprofile interrupts. | 608 | * re-enable the oprofile interrupts. |
609 | * | ||
610 | * Note that .Lresume_userspace is jumped to directly in several | ||
611 | * places, and we need to make sure r30 is set correctly in those | ||
612 | * callers as well. | ||
608 | */ | 613 | */ |
609 | STD_ENTRY(interrupt_return) | 614 | STD_ENTRY(interrupt_return) |
610 | /* If we're resuming to kernel space, don't check thread flags. */ | 615 | /* If we're resuming to kernel space, don't check thread flags. */ |
@@ -1039,11 +1044,28 @@ handle_syscall: | |||
1039 | 1044 | ||
1040 | /* Do syscall trace again, if requested. */ | 1045 | /* Do syscall trace again, if requested. */ |
1041 | ld r30, r31 | 1046 | ld r30, r31 |
1042 | andi r30, r30, _TIF_SYSCALL_TRACE | 1047 | andi r0, r30, _TIF_SYSCALL_TRACE |
1043 | beqzt r30, 1f | 1048 | { |
1049 | andi r0, r30, _TIF_SINGLESTEP | ||
1050 | beqzt r0, 1f | ||
1051 | } | ||
1044 | jal do_syscall_trace | 1052 | jal do_syscall_trace |
1045 | FEEDBACK_REENTER(handle_syscall) | 1053 | FEEDBACK_REENTER(handle_syscall) |
1046 | 1: j .Lresume_userspace /* jump into middle of interrupt_return */ | 1054 | andi r0, r30, _TIF_SINGLESTEP |
1055 | |||
1056 | 1: beqzt r0, 2f | ||
1057 | |||
1058 | /* Single stepping -- notify ptrace. */ | ||
1059 | { | ||
1060 | movei r0, SIGTRAP | ||
1061 | jal ptrace_notify | ||
1062 | } | ||
1063 | FEEDBACK_REENTER(handle_syscall) | ||
1064 | |||
1065 | 2: { | ||
1066 | movei r30, 0 /* not an NMI */ | ||
1067 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1068 | } | ||
1047 | 1069 | ||
1048 | .Lcompat_syscall: | 1070 | .Lcompat_syscall: |
1049 | /* | 1071 | /* |
@@ -1077,7 +1099,10 @@ handle_syscall: | |||
1077 | movei r28, -ENOSYS | 1099 | movei r28, -ENOSYS |
1078 | } | 1100 | } |
1079 | st r29, r28 | 1101 | st r29, r28 |
1080 | j .Lresume_userspace /* jump into middle of interrupt_return */ | 1102 | { |
1103 | movei r30, 0 /* not an NMI */ | ||
1104 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1105 | } | ||
1081 | STD_ENDPROC(handle_syscall) | 1106 | STD_ENDPROC(handle_syscall) |
1082 | 1107 | ||
1083 | /* Return the address for oprofile to suppress in backtraces. */ | 1108 | /* Return the address for oprofile to suppress in backtraces. */ |
@@ -1093,7 +1118,10 @@ STD_ENTRY(ret_from_fork) | |||
1093 | jal sim_notify_fork | 1118 | jal sim_notify_fork |
1094 | jal schedule_tail | 1119 | jal schedule_tail |
1095 | FEEDBACK_REENTER(ret_from_fork) | 1120 | FEEDBACK_REENTER(ret_from_fork) |
1096 | j .Lresume_userspace | 1121 | { |
1122 | movei r30, 0 /* not an NMI */ | ||
1123 | j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1124 | } | ||
1097 | STD_ENDPROC(ret_from_fork) | 1125 | STD_ENDPROC(ret_from_fork) |
1098 | 1126 | ||
1099 | /* Various stub interrupt handlers and syscall handlers */ | 1127 | /* Various stub interrupt handlers and syscall handlers */ |
@@ -1156,6 +1184,18 @@ int_unalign: | |||
1156 | push_extra_callee_saves r0 | 1184 | push_extra_callee_saves r0 |
1157 | j do_trap | 1185 | j do_trap |
1158 | 1186 | ||
1187 | /* Fill the return address stack with nonzero entries. */ | ||
1188 | STD_ENTRY(fill_ra_stack) | ||
1189 | { | ||
1190 | move r0, lr | ||
1191 | jal 1f | ||
1192 | } | ||
1193 | 1: jal 2f | ||
1194 | 2: jal 3f | ||
1195 | 3: jal 4f | ||
1196 | 4: jrp r0 | ||
1197 | STD_ENDPROC(fill_ra_stack) | ||
1198 | |||
1159 | /* Include .intrpt1 array of interrupt vectors */ | 1199 | /* Include .intrpt1 array of interrupt vectors */ |
1160 | .section ".intrpt1", "ax" | 1200 | .section ".intrpt1", "ax" |
1161 | 1201 | ||
@@ -1166,7 +1206,7 @@ int_unalign: | |||
1166 | #define do_hardwall_trap bad_intr | 1206 | #define do_hardwall_trap bad_intr |
1167 | #endif | 1207 | #endif |
1168 | 1208 | ||
1169 | int_hand INT_MEM_ERROR, MEM_ERROR, bad_intr | 1209 | int_hand INT_MEM_ERROR, MEM_ERROR, do_trap |
1170 | int_hand INT_SINGLE_STEP_3, SINGLE_STEP_3, bad_intr | 1210 | int_hand INT_SINGLE_STEP_3, SINGLE_STEP_3, bad_intr |
1171 | #if CONFIG_KERNEL_PL == 2 | 1211 | #if CONFIG_KERNEL_PL == 2 |
1172 | int_hand INT_SINGLE_STEP_2, SINGLE_STEP_2, gx_singlestep_handle | 1212 | int_hand INT_SINGLE_STEP_2, SINGLE_STEP_2, gx_singlestep_handle |
diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c index b90ab9925674..98d476920106 100644 --- a/arch/tile/kernel/module.c +++ b/arch/tile/kernel/module.c | |||
@@ -67,6 +67,8 @@ void *module_alloc(unsigned long size) | |||
67 | area = __get_vm_area(size, VM_ALLOC, MEM_MODULE_START, MEM_MODULE_END); | 67 | area = __get_vm_area(size, VM_ALLOC, MEM_MODULE_START, MEM_MODULE_END); |
68 | if (!area) | 68 | if (!area) |
69 | goto error; | 69 | goto error; |
70 | area->nr_pages = npages; | ||
71 | area->pages = pages; | ||
70 | 72 | ||
71 | if (map_vm_area(area, prot_rwx, &pages)) { | 73 | if (map_vm_area(area, prot_rwx, &pages)) { |
72 | vunmap(area->addr); | 74 | vunmap(area->addr); |
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 30caecac94dc..2d5ef617bb39 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/tracehook.h> | 28 | #include <linux/tracehook.h> |
29 | #include <linux/signal.h> | 29 | #include <linux/signal.h> |
30 | #include <asm/stack.h> | 30 | #include <asm/stack.h> |
31 | #include <asm/switch_to.h> | ||
31 | #include <asm/homecache.h> | 32 | #include <asm/homecache.h> |
32 | #include <asm/syscalls.h> | 33 | #include <asm/syscalls.h> |
33 | #include <asm/traps.h> | 34 | #include <asm/traps.h> |
@@ -285,7 +286,7 @@ struct task_struct *validate_current(void) | |||
285 | static struct task_struct corrupt = { .comm = "<corrupt>" }; | 286 | static struct task_struct corrupt = { .comm = "<corrupt>" }; |
286 | struct task_struct *tsk = current; | 287 | struct task_struct *tsk = current; |
287 | if (unlikely((unsigned long)tsk < PAGE_OFFSET || | 288 | if (unlikely((unsigned long)tsk < PAGE_OFFSET || |
288 | (void *)tsk > high_memory || | 289 | (high_memory && (void *)tsk > high_memory) || |
289 | ((unsigned long)tsk & (__alignof__(*tsk) - 1)) != 0)) { | 290 | ((unsigned long)tsk & (__alignof__(*tsk) - 1)) != 0)) { |
290 | pr_err("Corrupt 'current' %p (sp %#lx)\n", tsk, stack_pointer); | 291 | pr_err("Corrupt 'current' %p (sp %#lx)\n", tsk, stack_pointer); |
291 | tsk = &corrupt; | 292 | tsk = &corrupt; |
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c index 5f85d8b34dbb..bff23f476110 100644 --- a/arch/tile/kernel/setup.c +++ b/arch/tile/kernel/setup.c | |||
@@ -103,13 +103,11 @@ unsigned long __initdata pci_reserve_end_pfn = -1U; | |||
103 | 103 | ||
104 | static int __init setup_maxmem(char *str) | 104 | static int __init setup_maxmem(char *str) |
105 | { | 105 | { |
106 | long maxmem_mb; | 106 | unsigned long long maxmem; |
107 | if (str == NULL || strict_strtol(str, 0, &maxmem_mb) != 0 || | 107 | if (str == NULL || (maxmem = memparse(str, NULL)) == 0) |
108 | maxmem_mb == 0) | ||
109 | return -EINVAL; | 108 | return -EINVAL; |
110 | 109 | ||
111 | maxmem_pfn = (maxmem_mb >> (HPAGE_SHIFT - 20)) << | 110 | maxmem_pfn = (maxmem >> HPAGE_SHIFT) << (HPAGE_SHIFT - PAGE_SHIFT); |
112 | (HPAGE_SHIFT - PAGE_SHIFT); | ||
113 | pr_info("Forcing RAM used to no more than %dMB\n", | 111 | pr_info("Forcing RAM used to no more than %dMB\n", |
114 | maxmem_pfn >> (20 - PAGE_SHIFT)); | 112 | maxmem_pfn >> (20 - PAGE_SHIFT)); |
115 | return 0; | 113 | return 0; |
@@ -119,14 +117,15 @@ early_param("maxmem", setup_maxmem); | |||
119 | static int __init setup_maxnodemem(char *str) | 117 | static int __init setup_maxnodemem(char *str) |
120 | { | 118 | { |
121 | char *endp; | 119 | char *endp; |
122 | long maxnodemem_mb, node; | 120 | unsigned long long maxnodemem; |
121 | long node; | ||
123 | 122 | ||
124 | node = str ? simple_strtoul(str, &endp, 0) : INT_MAX; | 123 | node = str ? simple_strtoul(str, &endp, 0) : INT_MAX; |
125 | if (node >= MAX_NUMNODES || *endp != ':' || | 124 | if (node >= MAX_NUMNODES || *endp != ':') |
126 | strict_strtol(endp+1, 0, &maxnodemem_mb) != 0) | ||
127 | return -EINVAL; | 125 | return -EINVAL; |
128 | 126 | ||
129 | maxnodemem_pfn[node] = (maxnodemem_mb >> (HPAGE_SHIFT - 20)) << | 127 | maxnodemem = memparse(endp+1, NULL); |
128 | maxnodemem_pfn[node] = (maxnodemem >> HPAGE_SHIFT) << | ||
130 | (HPAGE_SHIFT - PAGE_SHIFT); | 129 | (HPAGE_SHIFT - PAGE_SHIFT); |
131 | pr_info("Forcing RAM used on node %ld to no more than %dMB\n", | 130 | pr_info("Forcing RAM used on node %ld to no more than %dMB\n", |
132 | node, maxnodemem_pfn[node] >> (20 - PAGE_SHIFT)); | 131 | node, maxnodemem_pfn[node] >> (20 - PAGE_SHIFT)); |
@@ -913,6 +912,13 @@ void __cpuinit setup_cpu(int boot) | |||
913 | 912 | ||
914 | #ifdef CONFIG_BLK_DEV_INITRD | 913 | #ifdef CONFIG_BLK_DEV_INITRD |
915 | 914 | ||
915 | /* | ||
916 | * Note that the kernel can potentially support other compression | ||
917 | * techniques than gz, though we don't do so by default. If we ever | ||
918 | * decide to do so we can either look for other filename extensions, | ||
919 | * or just allow a file with this name to be compressed with an | ||
920 | * arbitrary compressor (somewhat counterintuitively). | ||
921 | */ | ||
916 | static int __initdata set_initramfs_file; | 922 | static int __initdata set_initramfs_file; |
917 | static char __initdata initramfs_file[128] = "initramfs.cpio.gz"; | 923 | static char __initdata initramfs_file[128] = "initramfs.cpio.gz"; |
918 | 924 | ||
@@ -928,9 +934,9 @@ static int __init setup_initramfs_file(char *str) | |||
928 | early_param("initramfs_file", setup_initramfs_file); | 934 | early_param("initramfs_file", setup_initramfs_file); |
929 | 935 | ||
930 | /* | 936 | /* |
931 | * We look for an additional "initramfs.cpio.gz" file in the hvfs. | 937 | * We look for an "initramfs.cpio.gz" file in the hvfs. |
932 | * If there is one, we allocate some memory for it and it will be | 938 | * If there is one, we allocate some memory for it and it will be |
933 | * unpacked to the initramfs after any built-in initramfs_data. | 939 | * unpacked to the initramfs. |
934 | */ | 940 | */ |
935 | static void __init load_hv_initrd(void) | 941 | static void __init load_hv_initrd(void) |
936 | { | 942 | { |
@@ -1100,7 +1106,7 @@ EXPORT_SYMBOL(hash_for_home_map); | |||
1100 | 1106 | ||
1101 | /* | 1107 | /* |
1102 | * cpu_cacheable_map lists all the cpus whose caches the hypervisor can | 1108 | * cpu_cacheable_map lists all the cpus whose caches the hypervisor can |
1103 | * flush on our behalf. It is set to cpu_possible_map OR'ed with | 1109 | * flush on our behalf. It is set to cpu_possible_mask OR'ed with |
1104 | * hash_for_home_map, and it is what should be passed to | 1110 | * hash_for_home_map, and it is what should be passed to |
1105 | * hv_flush_remote() to flush all caches. Note that if there are | 1111 | * hv_flush_remote() to flush all caches. Note that if there are |
1106 | * dedicated hypervisor driver tiles that have authorized use of their | 1112 | * dedicated hypervisor driver tiles that have authorized use of their |
@@ -1186,7 +1192,7 @@ static void __init setup_cpu_maps(void) | |||
1186 | sizeof(cpu_lotar_map)); | 1192 | sizeof(cpu_lotar_map)); |
1187 | if (rc < 0) { | 1193 | if (rc < 0) { |
1188 | pr_err("warning: no HV_INQ_TILES_LOTAR; using AVAIL\n"); | 1194 | pr_err("warning: no HV_INQ_TILES_LOTAR; using AVAIL\n"); |
1189 | cpu_lotar_map = cpu_possible_map; | 1195 | cpu_lotar_map = *cpu_possible_mask; |
1190 | } | 1196 | } |
1191 | 1197 | ||
1192 | #if CHIP_HAS_CBOX_HOME_MAP() | 1198 | #if CHIP_HAS_CBOX_HOME_MAP() |
@@ -1196,9 +1202,9 @@ static void __init setup_cpu_maps(void) | |||
1196 | sizeof(hash_for_home_map)); | 1202 | sizeof(hash_for_home_map)); |
1197 | if (rc < 0) | 1203 | if (rc < 0) |
1198 | early_panic("hv_inquire_tiles(HFH_CACHE) failed: rc %d\n", rc); | 1204 | early_panic("hv_inquire_tiles(HFH_CACHE) failed: rc %d\n", rc); |
1199 | cpumask_or(&cpu_cacheable_map, &cpu_possible_map, &hash_for_home_map); | 1205 | cpumask_or(&cpu_cacheable_map, cpu_possible_mask, &hash_for_home_map); |
1200 | #else | 1206 | #else |
1201 | cpu_cacheable_map = cpu_possible_map; | 1207 | cpu_cacheable_map = *cpu_possible_mask; |
1202 | #endif | 1208 | #endif |
1203 | } | 1209 | } |
1204 | 1210 | ||
diff --git a/arch/tile/kernel/single_step.c b/arch/tile/kernel/single_step.c index bc1eb586e24d..9efbc1391b3c 100644 --- a/arch/tile/kernel/single_step.c +++ b/arch/tile/kernel/single_step.c | |||
@@ -153,6 +153,25 @@ static tile_bundle_bits rewrite_load_store_unaligned( | |||
153 | if (((unsigned long)addr % size) == 0) | 153 | if (((unsigned long)addr % size) == 0) |
154 | return bundle; | 154 | return bundle; |
155 | 155 | ||
156 | /* | ||
157 | * Return SIGBUS with the unaligned address, if requested. | ||
158 | * Note that we return SIGBUS even for completely invalid addresses | ||
159 | * as long as they are in fact unaligned; this matches what the | ||
160 | * tilepro hardware would be doing, if it could provide us with the | ||
161 | * actual bad address in an SPR, which it doesn't. | ||
162 | */ | ||
163 | if (unaligned_fixup == 0) { | ||
164 | siginfo_t info = { | ||
165 | .si_signo = SIGBUS, | ||
166 | .si_code = BUS_ADRALN, | ||
167 | .si_addr = addr | ||
168 | }; | ||
169 | trace_unhandled_signal("unaligned trap", regs, | ||
170 | (unsigned long)addr, SIGBUS); | ||
171 | force_sig_info(info.si_signo, &info, current); | ||
172 | return (tilepro_bundle_bits) 0; | ||
173 | } | ||
174 | |||
156 | #ifndef __LITTLE_ENDIAN | 175 | #ifndef __LITTLE_ENDIAN |
157 | # error We assume little-endian representation with copy_xx_user size 2 here | 176 | # error We assume little-endian representation with copy_xx_user size 2 here |
158 | #endif | 177 | #endif |
@@ -192,18 +211,6 @@ static tile_bundle_bits rewrite_load_store_unaligned( | |||
192 | return (tile_bundle_bits) 0; | 211 | return (tile_bundle_bits) 0; |
193 | } | 212 | } |
194 | 213 | ||
195 | if (unaligned_fixup == 0) { | ||
196 | siginfo_t info = { | ||
197 | .si_signo = SIGBUS, | ||
198 | .si_code = BUS_ADRALN, | ||
199 | .si_addr = addr | ||
200 | }; | ||
201 | trace_unhandled_signal("unaligned trap", regs, | ||
202 | (unsigned long)addr, SIGBUS); | ||
203 | force_sig_info(info.si_signo, &info, current); | ||
204 | return (tile_bundle_bits) 0; | ||
205 | } | ||
206 | |||
207 | if (unaligned_printk || unaligned_fixup_count == 0) { | 214 | if (unaligned_printk || unaligned_fixup_count == 0) { |
208 | pr_info("Process %d/%s: PC %#lx: Fixup of" | 215 | pr_info("Process %d/%s: PC %#lx: Fixup of" |
209 | " unaligned %s at %#lx.\n", | 216 | " unaligned %s at %#lx.\n", |
diff --git a/arch/tile/kernel/smp.c b/arch/tile/kernel/smp.c index a44e103c5a63..91da0f721958 100644 --- a/arch/tile/kernel/smp.c +++ b/arch/tile/kernel/smp.c | |||
@@ -103,7 +103,7 @@ static void smp_stop_cpu_interrupt(void) | |||
103 | set_cpu_online(smp_processor_id(), 0); | 103 | set_cpu_online(smp_processor_id(), 0); |
104 | arch_local_irq_disable_all(); | 104 | arch_local_irq_disable_all(); |
105 | for (;;) | 105 | for (;;) |
106 | asm("nap"); | 106 | asm("nap; nop"); |
107 | } | 107 | } |
108 | 108 | ||
109 | /* This function calls the 'stop' function on all other CPUs in the system. */ | 109 | /* This function calls the 'stop' function on all other CPUs in the system. */ |
@@ -113,6 +113,12 @@ void smp_send_stop(void) | |||
113 | send_IPI_allbutself(MSG_TAG_STOP_CPU); | 113 | send_IPI_allbutself(MSG_TAG_STOP_CPU); |
114 | } | 114 | } |
115 | 115 | ||
116 | /* On panic, just wait; we may get an smp_send_stop() later on. */ | ||
117 | void panic_smp_self_stop(void) | ||
118 | { | ||
119 | while (1) | ||
120 | asm("nap; nop"); | ||
121 | } | ||
116 | 122 | ||
117 | /* | 123 | /* |
118 | * Dispatch code called from hv_message_intr() for HV_MSG_TILE hv messages. | 124 | * Dispatch code called from hv_message_intr() for HV_MSG_TILE hv messages. |
diff --git a/arch/tile/kernel/stack.c b/arch/tile/kernel/stack.c index 37ee4d037e0b..b2f44c28dda6 100644 --- a/arch/tile/kernel/stack.c +++ b/arch/tile/kernel/stack.c | |||
@@ -21,10 +21,12 @@ | |||
21 | #include <linux/stacktrace.h> | 21 | #include <linux/stacktrace.h> |
22 | #include <linux/uaccess.h> | 22 | #include <linux/uaccess.h> |
23 | #include <linux/mmzone.h> | 23 | #include <linux/mmzone.h> |
24 | #include <linux/dcache.h> | ||
25 | #include <linux/fs.h> | ||
24 | #include <asm/backtrace.h> | 26 | #include <asm/backtrace.h> |
25 | #include <asm/page.h> | 27 | #include <asm/page.h> |
26 | #include <asm/tlbflush.h> | ||
27 | #include <asm/ucontext.h> | 28 | #include <asm/ucontext.h> |
29 | #include <asm/switch_to.h> | ||
28 | #include <asm/sigframe.h> | 30 | #include <asm/sigframe.h> |
29 | #include <asm/stack.h> | 31 | #include <asm/stack.h> |
30 | #include <arch/abi.h> | 32 | #include <arch/abi.h> |
@@ -44,72 +46,23 @@ static int in_kernel_stack(struct KBacktraceIterator *kbt, unsigned long sp) | |||
44 | return sp >= kstack_base && sp < kstack_base + THREAD_SIZE; | 46 | return sp >= kstack_base && sp < kstack_base + THREAD_SIZE; |
45 | } | 47 | } |
46 | 48 | ||
47 | /* Is address valid for reading? */ | ||
48 | static int valid_address(struct KBacktraceIterator *kbt, unsigned long address) | ||
49 | { | ||
50 | HV_PTE *l1_pgtable = kbt->pgtable; | ||
51 | HV_PTE *l2_pgtable; | ||
52 | unsigned long pfn; | ||
53 | HV_PTE pte; | ||
54 | struct page *page; | ||
55 | |||
56 | if (l1_pgtable == NULL) | ||
57 | return 0; /* can't read user space in other tasks */ | ||
58 | |||
59 | #ifdef CONFIG_64BIT | ||
60 | /* Find the real l1_pgtable by looking in the l0_pgtable. */ | ||
61 | pte = l1_pgtable[HV_L0_INDEX(address)]; | ||
62 | if (!hv_pte_get_present(pte)) | ||
63 | return 0; | ||
64 | pfn = hv_pte_get_pfn(pte); | ||
65 | if (pte_huge(pte)) { | ||
66 | if (!pfn_valid(pfn)) { | ||
67 | pr_err("L0 huge page has bad pfn %#lx\n", pfn); | ||
68 | return 0; | ||
69 | } | ||
70 | return hv_pte_get_present(pte) && hv_pte_get_readable(pte); | ||
71 | } | ||
72 | page = pfn_to_page(pfn); | ||
73 | BUG_ON(PageHighMem(page)); /* No HIGHMEM on 64-bit. */ | ||
74 | l1_pgtable = (HV_PTE *)pfn_to_kaddr(pfn); | ||
75 | #endif | ||
76 | pte = l1_pgtable[HV_L1_INDEX(address)]; | ||
77 | if (!hv_pte_get_present(pte)) | ||
78 | return 0; | ||
79 | pfn = hv_pte_get_pfn(pte); | ||
80 | if (pte_huge(pte)) { | ||
81 | if (!pfn_valid(pfn)) { | ||
82 | pr_err("huge page has bad pfn %#lx\n", pfn); | ||
83 | return 0; | ||
84 | } | ||
85 | return hv_pte_get_present(pte) && hv_pte_get_readable(pte); | ||
86 | } | ||
87 | |||
88 | page = pfn_to_page(pfn); | ||
89 | if (PageHighMem(page)) { | ||
90 | pr_err("L2 page table not in LOWMEM (%#llx)\n", | ||
91 | HV_PFN_TO_CPA(pfn)); | ||
92 | return 0; | ||
93 | } | ||
94 | l2_pgtable = (HV_PTE *)pfn_to_kaddr(pfn); | ||
95 | pte = l2_pgtable[HV_L2_INDEX(address)]; | ||
96 | return hv_pte_get_present(pte) && hv_pte_get_readable(pte); | ||
97 | } | ||
98 | |||
99 | /* Callback for backtracer; basically a glorified memcpy */ | 49 | /* Callback for backtracer; basically a glorified memcpy */ |
100 | static bool read_memory_func(void *result, unsigned long address, | 50 | static bool read_memory_func(void *result, unsigned long address, |
101 | unsigned int size, void *vkbt) | 51 | unsigned int size, void *vkbt) |
102 | { | 52 | { |
103 | int retval; | 53 | int retval; |
104 | struct KBacktraceIterator *kbt = (struct KBacktraceIterator *)vkbt; | 54 | struct KBacktraceIterator *kbt = (struct KBacktraceIterator *)vkbt; |
55 | |||
56 | if (address == 0) | ||
57 | return 0; | ||
105 | if (__kernel_text_address(address)) { | 58 | if (__kernel_text_address(address)) { |
106 | /* OK to read kernel code. */ | 59 | /* OK to read kernel code. */ |
107 | } else if (address >= PAGE_OFFSET) { | 60 | } else if (address >= PAGE_OFFSET) { |
108 | /* We only tolerate kernel-space reads of this task's stack */ | 61 | /* We only tolerate kernel-space reads of this task's stack */ |
109 | if (!in_kernel_stack(kbt, address)) | 62 | if (!in_kernel_stack(kbt, address)) |
110 | return 0; | 63 | return 0; |
111 | } else if (!valid_address(kbt, address)) { | 64 | } else if (!kbt->is_current) { |
112 | return 0; /* invalid user-space address */ | 65 | return 0; /* can't read from other user address spaces */ |
113 | } | 66 | } |
114 | pagefault_disable(); | 67 | pagefault_disable(); |
115 | retval = __copy_from_user_inatomic(result, | 68 | retval = __copy_from_user_inatomic(result, |
@@ -127,6 +80,8 @@ static struct pt_regs *valid_fault_handler(struct KBacktraceIterator* kbt) | |||
127 | unsigned long sp = kbt->it.sp; | 80 | unsigned long sp = kbt->it.sp; |
128 | struct pt_regs *p; | 81 | struct pt_regs *p; |
129 | 82 | ||
83 | if (sp % sizeof(long) != 0) | ||
84 | return NULL; | ||
130 | if (!in_kernel_stack(kbt, sp)) | 85 | if (!in_kernel_stack(kbt, sp)) |
131 | return NULL; | 86 | return NULL; |
132 | if (!in_kernel_stack(kbt, sp + C_ABI_SAVE_AREA_SIZE + PTREGS_SIZE-1)) | 87 | if (!in_kernel_stack(kbt, sp + C_ABI_SAVE_AREA_SIZE + PTREGS_SIZE-1)) |
@@ -169,27 +124,27 @@ static int is_sigreturn(unsigned long pc) | |||
169 | } | 124 | } |
170 | 125 | ||
171 | /* Return a pt_regs pointer for a valid signal handler frame */ | 126 | /* Return a pt_regs pointer for a valid signal handler frame */ |
172 | static struct pt_regs *valid_sigframe(struct KBacktraceIterator* kbt) | 127 | static struct pt_regs *valid_sigframe(struct KBacktraceIterator* kbt, |
128 | struct rt_sigframe* kframe) | ||
173 | { | 129 | { |
174 | BacktraceIterator *b = &kbt->it; | 130 | BacktraceIterator *b = &kbt->it; |
175 | 131 | ||
176 | if (b->pc == VDSO_BASE) { | 132 | if (b->pc == VDSO_BASE && b->sp < PAGE_OFFSET && |
177 | struct rt_sigframe *frame; | 133 | b->sp % sizeof(long) == 0) { |
178 | unsigned long sigframe_top = | 134 | int retval; |
179 | b->sp + sizeof(struct rt_sigframe) - 1; | 135 | pagefault_disable(); |
180 | if (!valid_address(kbt, b->sp) || | 136 | retval = __copy_from_user_inatomic( |
181 | !valid_address(kbt, sigframe_top)) { | 137 | kframe, (void __user __force *)b->sp, |
182 | if (kbt->verbose) | 138 | sizeof(*kframe)); |
183 | pr_err(" (odd signal: sp %#lx?)\n", | 139 | pagefault_enable(); |
184 | (unsigned long)(b->sp)); | 140 | if (retval != 0 || |
141 | (unsigned int)(kframe->info.si_signo) >= _NSIG) | ||
185 | return NULL; | 142 | return NULL; |
186 | } | ||
187 | frame = (struct rt_sigframe *)b->sp; | ||
188 | if (kbt->verbose) { | 143 | if (kbt->verbose) { |
189 | pr_err(" <received signal %d>\n", | 144 | pr_err(" <received signal %d>\n", |
190 | frame->info.si_signo); | 145 | kframe->info.si_signo); |
191 | } | 146 | } |
192 | return (struct pt_regs *)&frame->uc.uc_mcontext; | 147 | return (struct pt_regs *)&kframe->uc.uc_mcontext; |
193 | } | 148 | } |
194 | return NULL; | 149 | return NULL; |
195 | } | 150 | } |
@@ -202,10 +157,11 @@ static int KBacktraceIterator_is_sigreturn(struct KBacktraceIterator *kbt) | |||
202 | static int KBacktraceIterator_restart(struct KBacktraceIterator *kbt) | 157 | static int KBacktraceIterator_restart(struct KBacktraceIterator *kbt) |
203 | { | 158 | { |
204 | struct pt_regs *p; | 159 | struct pt_regs *p; |
160 | struct rt_sigframe kframe; | ||
205 | 161 | ||
206 | p = valid_fault_handler(kbt); | 162 | p = valid_fault_handler(kbt); |
207 | if (p == NULL) | 163 | if (p == NULL) |
208 | p = valid_sigframe(kbt); | 164 | p = valid_sigframe(kbt, &kframe); |
209 | if (p == NULL) | 165 | if (p == NULL) |
210 | return 0; | 166 | return 0; |
211 | backtrace_init(&kbt->it, read_memory_func, kbt, | 167 | backtrace_init(&kbt->it, read_memory_func, kbt, |
@@ -265,41 +221,19 @@ void KBacktraceIterator_init(struct KBacktraceIterator *kbt, | |||
265 | 221 | ||
266 | /* | 222 | /* |
267 | * Set up callback information. We grab the kernel stack base | 223 | * Set up callback information. We grab the kernel stack base |
268 | * so we will allow reads of that address range, and if we're | 224 | * so we will allow reads of that address range. |
269 | * asking about the current process we grab the page table | ||
270 | * so we can check user accesses before trying to read them. | ||
271 | * We flush the TLB to avoid any weird skew issues. | ||
272 | */ | 225 | */ |
273 | is_current = (t == NULL); | 226 | is_current = (t == NULL || t == current); |
274 | kbt->is_current = is_current; | 227 | kbt->is_current = is_current; |
275 | if (is_current) | 228 | if (is_current) |
276 | t = validate_current(); | 229 | t = validate_current(); |
277 | kbt->task = t; | 230 | kbt->task = t; |
278 | kbt->pgtable = NULL; | ||
279 | kbt->verbose = 0; /* override in caller if desired */ | 231 | kbt->verbose = 0; /* override in caller if desired */ |
280 | kbt->profile = 0; /* override in caller if desired */ | 232 | kbt->profile = 0; /* override in caller if desired */ |
281 | kbt->end = KBT_ONGOING; | 233 | kbt->end = KBT_ONGOING; |
282 | kbt->new_context = 0; | 234 | kbt->new_context = 1; |
283 | if (is_current) { | 235 | if (is_current) |
284 | HV_PhysAddr pgdir_pa = hv_inquire_context().page_table; | ||
285 | if (pgdir_pa == (unsigned long)swapper_pg_dir - PAGE_OFFSET) { | ||
286 | /* | ||
287 | * Not just an optimization: this also allows | ||
288 | * this to work at all before va/pa mappings | ||
289 | * are set up. | ||
290 | */ | ||
291 | kbt->pgtable = swapper_pg_dir; | ||
292 | } else { | ||
293 | struct page *page = pfn_to_page(PFN_DOWN(pgdir_pa)); | ||
294 | if (!PageHighMem(page)) | ||
295 | kbt->pgtable = __va(pgdir_pa); | ||
296 | else | ||
297 | pr_err("page table not in LOWMEM" | ||
298 | " (%#llx)\n", pgdir_pa); | ||
299 | } | ||
300 | local_flush_tlb_all(); | ||
301 | validate_stack(regs); | 236 | validate_stack(regs); |
302 | } | ||
303 | 237 | ||
304 | if (regs == NULL) { | 238 | if (regs == NULL) { |
305 | if (is_current || t->state == TASK_RUNNING) { | 239 | if (is_current || t->state == TASK_RUNNING) { |
@@ -345,6 +279,78 @@ void KBacktraceIterator_next(struct KBacktraceIterator *kbt) | |||
345 | } | 279 | } |
346 | EXPORT_SYMBOL(KBacktraceIterator_next); | 280 | EXPORT_SYMBOL(KBacktraceIterator_next); |
347 | 281 | ||
282 | static void describe_addr(struct KBacktraceIterator *kbt, | ||
283 | unsigned long address, | ||
284 | int have_mmap_sem, char *buf, size_t bufsize) | ||
285 | { | ||
286 | struct vm_area_struct *vma; | ||
287 | size_t namelen, remaining; | ||
288 | unsigned long size, offset, adjust; | ||
289 | char *p, *modname; | ||
290 | const char *name; | ||
291 | int rc; | ||
292 | |||
293 | /* | ||
294 | * Look one byte back for every caller frame (i.e. those that | ||
295 | * aren't a new context) so we look up symbol data for the | ||
296 | * call itself, not the following instruction, which may be on | ||
297 | * a different line (or in a different function). | ||
298 | */ | ||
299 | adjust = !kbt->new_context; | ||
300 | address -= adjust; | ||
301 | |||
302 | if (address >= PAGE_OFFSET) { | ||
303 | /* Handle kernel symbols. */ | ||
304 | BUG_ON(bufsize < KSYM_NAME_LEN); | ||
305 | name = kallsyms_lookup(address, &size, &offset, | ||
306 | &modname, buf); | ||
307 | if (name == NULL) { | ||
308 | buf[0] = '\0'; | ||
309 | return; | ||
310 | } | ||
311 | namelen = strlen(buf); | ||
312 | remaining = (bufsize - 1) - namelen; | ||
313 | p = buf + namelen; | ||
314 | rc = snprintf(p, remaining, "+%#lx/%#lx ", | ||
315 | offset + adjust, size); | ||
316 | if (modname && rc < remaining) | ||
317 | snprintf(p + rc, remaining - rc, "[%s] ", modname); | ||
318 | buf[bufsize-1] = '\0'; | ||
319 | return; | ||
320 | } | ||
321 | |||
322 | /* If we don't have the mmap_sem, we can't show any more info. */ | ||
323 | buf[0] = '\0'; | ||
324 | if (!have_mmap_sem) | ||
325 | return; | ||
326 | |||
327 | /* Find vma info. */ | ||
328 | vma = find_vma(kbt->task->mm, address); | ||
329 | if (vma == NULL || address < vma->vm_start) { | ||
330 | snprintf(buf, bufsize, "[unmapped address] "); | ||
331 | return; | ||
332 | } | ||
333 | |||
334 | if (vma->vm_file) { | ||
335 | char *s; | ||
336 | p = d_path(&vma->vm_file->f_path, buf, bufsize); | ||
337 | if (IS_ERR(p)) | ||
338 | p = "?"; | ||
339 | s = strrchr(p, '/'); | ||
340 | if (s) | ||
341 | p = s+1; | ||
342 | } else { | ||
343 | p = "anon"; | ||
344 | } | ||
345 | |||
346 | /* Generate a string description of the vma info. */ | ||
347 | namelen = strlen(p); | ||
348 | remaining = (bufsize - 1) - namelen; | ||
349 | memmove(buf, p, namelen); | ||
350 | snprintf(buf + namelen, remaining, "[%lx+%lx] ", | ||
351 | vma->vm_start, vma->vm_end - vma->vm_start); | ||
352 | } | ||
353 | |||
348 | /* | 354 | /* |
349 | * This method wraps the backtracer's more generic support. | 355 | * This method wraps the backtracer's more generic support. |
350 | * It is only invoked from the architecture-specific code; show_stack() | 356 | * It is only invoked from the architecture-specific code; show_stack() |
@@ -353,6 +359,7 @@ EXPORT_SYMBOL(KBacktraceIterator_next); | |||
353 | void tile_show_stack(struct KBacktraceIterator *kbt, int headers) | 359 | void tile_show_stack(struct KBacktraceIterator *kbt, int headers) |
354 | { | 360 | { |
355 | int i; | 361 | int i; |
362 | int have_mmap_sem = 0; | ||
356 | 363 | ||
357 | if (headers) { | 364 | if (headers) { |
358 | /* | 365 | /* |
@@ -369,31 +376,16 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers) | |||
369 | kbt->verbose = 1; | 376 | kbt->verbose = 1; |
370 | i = 0; | 377 | i = 0; |
371 | for (; !KBacktraceIterator_end(kbt); KBacktraceIterator_next(kbt)) { | 378 | for (; !KBacktraceIterator_end(kbt); KBacktraceIterator_next(kbt)) { |
372 | char *modname; | ||
373 | const char *name; | ||
374 | unsigned long address = kbt->it.pc; | ||
375 | unsigned long offset, size; | ||
376 | char namebuf[KSYM_NAME_LEN+100]; | 379 | char namebuf[KSYM_NAME_LEN+100]; |
380 | unsigned long address = kbt->it.pc; | ||
377 | 381 | ||
378 | if (address >= PAGE_OFFSET) | 382 | /* Try to acquire the mmap_sem as we pass into userspace. */ |
379 | name = kallsyms_lookup(address, &size, &offset, | 383 | if (address < PAGE_OFFSET && !have_mmap_sem && kbt->task->mm) |
380 | &modname, namebuf); | 384 | have_mmap_sem = |
381 | else | 385 | down_read_trylock(&kbt->task->mm->mmap_sem); |
382 | name = NULL; | 386 | |
383 | 387 | describe_addr(kbt, address, have_mmap_sem, | |
384 | if (!name) | 388 | namebuf, sizeof(namebuf)); |
385 | namebuf[0] = '\0'; | ||
386 | else { | ||
387 | size_t namelen = strlen(namebuf); | ||
388 | size_t remaining = (sizeof(namebuf) - 1) - namelen; | ||
389 | char *p = namebuf + namelen; | ||
390 | int rc = snprintf(p, remaining, "+%#lx/%#lx ", | ||
391 | offset, size); | ||
392 | if (modname && rc < remaining) | ||
393 | snprintf(p + rc, remaining - rc, | ||
394 | "[%s] ", modname); | ||
395 | namebuf[sizeof(namebuf)-1] = '\0'; | ||
396 | } | ||
397 | 389 | ||
398 | pr_err(" frame %d: 0x%lx %s(sp 0x%lx)\n", | 390 | pr_err(" frame %d: 0x%lx %s(sp 0x%lx)\n", |
399 | i++, address, namebuf, (unsigned long)(kbt->it.sp)); | 391 | i++, address, namebuf, (unsigned long)(kbt->it.sp)); |
@@ -408,6 +400,8 @@ void tile_show_stack(struct KBacktraceIterator *kbt, int headers) | |||
408 | pr_err("Stack dump stopped; next frame identical to this one\n"); | 400 | pr_err("Stack dump stopped; next frame identical to this one\n"); |
409 | if (headers) | 401 | if (headers) |
410 | pr_err("Stack dump complete\n"); | 402 | pr_err("Stack dump complete\n"); |
403 | if (have_mmap_sem) | ||
404 | up_read(&kbt->task->mm->mmap_sem); | ||
411 | } | 405 | } |
412 | EXPORT_SYMBOL(tile_show_stack); | 406 | EXPORT_SYMBOL(tile_show_stack); |
413 | 407 | ||
diff --git a/arch/tile/kernel/traps.c b/arch/tile/kernel/traps.c index 2bb6602a1ee7..73cff814ac57 100644 --- a/arch/tile/kernel/traps.c +++ b/arch/tile/kernel/traps.c | |||
@@ -200,7 +200,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num, | |||
200 | { | 200 | { |
201 | siginfo_t info = { 0 }; | 201 | siginfo_t info = { 0 }; |
202 | int signo, code; | 202 | int signo, code; |
203 | unsigned long address; | 203 | unsigned long address = 0; |
204 | bundle_bits instr; | 204 | bundle_bits instr; |
205 | 205 | ||
206 | /* Re-enable interrupts. */ | 206 | /* Re-enable interrupts. */ |
@@ -223,6 +223,10 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num, | |||
223 | } | 223 | } |
224 | 224 | ||
225 | switch (fault_num) { | 225 | switch (fault_num) { |
226 | case INT_MEM_ERROR: | ||
227 | signo = SIGBUS; | ||
228 | code = BUS_OBJERR; | ||
229 | break; | ||
226 | case INT_ILL: | 230 | case INT_ILL: |
227 | if (copy_from_user(&instr, (void __user *)regs->pc, | 231 | if (copy_from_user(&instr, (void __user *)regs->pc, |
228 | sizeof(instr))) { | 232 | sizeof(instr))) { |
@@ -289,7 +293,10 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num, | |||
289 | address = regs->pc; | 293 | address = regs->pc; |
290 | break; | 294 | break; |
291 | #ifdef __tilegx__ | 295 | #ifdef __tilegx__ |
292 | case INT_ILL_TRANS: | 296 | case INT_ILL_TRANS: { |
297 | /* Avoid a hardware erratum with the return address stack. */ | ||
298 | fill_ra_stack(); | ||
299 | |||
293 | signo = SIGSEGV; | 300 | signo = SIGSEGV; |
294 | code = SEGV_MAPERR; | 301 | code = SEGV_MAPERR; |
295 | if (reason & SPR_ILL_TRANS_REASON__I_STREAM_VA_RMASK) | 302 | if (reason & SPR_ILL_TRANS_REASON__I_STREAM_VA_RMASK) |
@@ -297,6 +304,7 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num, | |||
297 | else | 304 | else |
298 | address = 0; /* FIXME: GX: single-step for address */ | 305 | address = 0; /* FIXME: GX: single-step for address */ |
299 | break; | 306 | break; |
307 | } | ||
300 | #endif | 308 | #endif |
301 | default: | 309 | default: |
302 | panic("Unexpected do_trap interrupt number %d", fault_num); | 310 | panic("Unexpected do_trap interrupt number %d", fault_num); |
@@ -308,7 +316,8 @@ void __kprobes do_trap(struct pt_regs *regs, int fault_num, | |||
308 | info.si_addr = (void __user *)address; | 316 | info.si_addr = (void __user *)address; |
309 | if (signo == SIGILL) | 317 | if (signo == SIGILL) |
310 | info.si_trapno = fault_num; | 318 | info.si_trapno = fault_num; |
311 | trace_unhandled_signal("trap", regs, address, signo); | 319 | if (signo != SIGTRAP) |
320 | trace_unhandled_signal("trap", regs, address, signo); | ||
312 | force_sig_info(signo, &info, current); | 321 | force_sig_info(signo, &info, current); |
313 | } | 322 | } |
314 | 323 | ||
diff --git a/arch/tile/lib/Makefile b/arch/tile/lib/Makefile index 0c26086ecbef..985f59858234 100644 --- a/arch/tile/lib/Makefile +++ b/arch/tile/lib/Makefile | |||
@@ -7,6 +7,7 @@ lib-y = cacheflush.o checksum.o cpumask.o delay.o uaccess.o \ | |||
7 | strchr_$(BITS).o strlen_$(BITS).o | 7 | strchr_$(BITS).o strlen_$(BITS).o |
8 | 8 | ||
9 | ifeq ($(CONFIG_TILEGX),y) | 9 | ifeq ($(CONFIG_TILEGX),y) |
10 | CFLAGS_REMOVE_memcpy_user_64.o = -fno-omit-frame-pointer | ||
10 | lib-y += memcpy_user_64.o | 11 | lib-y += memcpy_user_64.o |
11 | else | 12 | else |
12 | lib-y += atomic_32.o atomic_asm_32.o memcpy_tile64.o | 13 | lib-y += atomic_32.o atomic_asm_32.o memcpy_tile64.o |
diff --git a/arch/tile/lib/cacheflush.c b/arch/tile/lib/cacheflush.c index 8928aace7a64..db4fb89e12d8 100644 --- a/arch/tile/lib/cacheflush.c +++ b/arch/tile/lib/cacheflush.c | |||
@@ -39,7 +39,21 @@ void finv_buffer_remote(void *buffer, size_t size, int hfh) | |||
39 | { | 39 | { |
40 | char *p, *base; | 40 | char *p, *base; |
41 | size_t step_size, load_count; | 41 | size_t step_size, load_count; |
42 | |||
43 | /* | ||
44 | * On TILEPro the striping granularity is a fixed 8KB; on | ||
45 | * TILE-Gx it is configurable, and we rely on the fact that | ||
46 | * the hypervisor always configures maximum striping, so that | ||
47 | * bits 9 and 10 of the PA are part of the stripe function, so | ||
48 | * every 512 bytes we hit a striping boundary. | ||
49 | * | ||
50 | */ | ||
51 | #ifdef __tilegx__ | ||
52 | const unsigned long STRIPE_WIDTH = 512; | ||
53 | #else | ||
42 | const unsigned long STRIPE_WIDTH = 8192; | 54 | const unsigned long STRIPE_WIDTH = 8192; |
55 | #endif | ||
56 | |||
43 | #ifdef __tilegx__ | 57 | #ifdef __tilegx__ |
44 | /* | 58 | /* |
45 | * On TILE-Gx, we must disable the dstream prefetcher before doing | 59 | * On TILE-Gx, we must disable the dstream prefetcher before doing |
@@ -74,7 +88,7 @@ void finv_buffer_remote(void *buffer, size_t size, int hfh) | |||
74 | * memory, that one load would be sufficient, but since we may | 88 | * memory, that one load would be sufficient, but since we may |
75 | * be, we also need to back up to the last load issued to | 89 | * be, we also need to back up to the last load issued to |
76 | * another memory controller, which would be the point where | 90 | * another memory controller, which would be the point where |
77 | * we crossed an 8KB boundary (the granularity of striping | 91 | * we crossed a "striping" boundary (the granularity of striping |
78 | * across memory controllers). Keep backing up and doing this | 92 | * across memory controllers). Keep backing up and doing this |
79 | * until we are before the beginning of the buffer, or have | 93 | * until we are before the beginning of the buffer, or have |
80 | * hit all the controllers. | 94 | * hit all the controllers. |
@@ -88,12 +102,22 @@ void finv_buffer_remote(void *buffer, size_t size, int hfh) | |||
88 | * every cache line on a full memory stripe on each | 102 | * every cache line on a full memory stripe on each |
89 | * controller" that we simply do that, to simplify the logic. | 103 | * controller" that we simply do that, to simplify the logic. |
90 | * | 104 | * |
91 | * FIXME: See bug 9535 for some issues with this code. | 105 | * On TILE-Gx the hash-for-home function is much more complex, |
106 | * with the upshot being we can't readily guarantee we have | ||
107 | * hit both entries in the 128-entry AMT that were hit by any | ||
108 | * load in the entire range, so we just re-load them all. | ||
109 | * With larger buffers, we may want to consider using a hypervisor | ||
110 | * trap to issue loads directly to each hash-for-home tile for | ||
111 | * each controller (doing it from Linux would trash the TLB). | ||
92 | */ | 112 | */ |
93 | if (hfh) { | 113 | if (hfh) { |
94 | step_size = L2_CACHE_BYTES; | 114 | step_size = L2_CACHE_BYTES; |
115 | #ifdef __tilegx__ | ||
116 | load_count = (size + L2_CACHE_BYTES - 1) / L2_CACHE_BYTES; | ||
117 | #else | ||
95 | load_count = (STRIPE_WIDTH / L2_CACHE_BYTES) * | 118 | load_count = (STRIPE_WIDTH / L2_CACHE_BYTES) * |
96 | (1 << CHIP_LOG_NUM_MSHIMS()); | 119 | (1 << CHIP_LOG_NUM_MSHIMS()); |
120 | #endif | ||
97 | } else { | 121 | } else { |
98 | step_size = STRIPE_WIDTH; | 122 | step_size = STRIPE_WIDTH; |
99 | load_count = (1 << CHIP_LOG_NUM_MSHIMS()); | 123 | load_count = (1 << CHIP_LOG_NUM_MSHIMS()); |
@@ -109,7 +133,7 @@ void finv_buffer_remote(void *buffer, size_t size, int hfh) | |||
109 | 133 | ||
110 | /* Figure out how far back we need to go. */ | 134 | /* Figure out how far back we need to go. */ |
111 | base = p - (step_size * (load_count - 2)); | 135 | base = p - (step_size * (load_count - 2)); |
112 | if ((long)base < (long)buffer) | 136 | if ((unsigned long)base < (unsigned long)buffer) |
113 | base = buffer; | 137 | base = buffer; |
114 | 138 | ||
115 | /* | 139 | /* |
diff --git a/arch/tile/lib/memcpy_user_64.c b/arch/tile/lib/memcpy_user_64.c index 4763b3aff1cc..37440caa7370 100644 --- a/arch/tile/lib/memcpy_user_64.c +++ b/arch/tile/lib/memcpy_user_64.c | |||
@@ -14,7 +14,13 @@ | |||
14 | * Do memcpy(), but trap and return "n" when a load or store faults. | 14 | * Do memcpy(), but trap and return "n" when a load or store faults. |
15 | * | 15 | * |
16 | * Note: this idiom only works when memcpy() compiles to a leaf function. | 16 | * Note: this idiom only works when memcpy() compiles to a leaf function. |
17 | * If "sp" is updated during memcpy, the "jrp lr" will be incorrect. | 17 | * Here leaf function not only means it does not have calls, but also |
18 | * requires no stack operations (sp, stack frame pointer) and no | ||
19 | * use of callee-saved registers, else "jrp lr" will be incorrect since | ||
20 | * unwinding stack frame is bypassed. Since memcpy() is not complex so | ||
21 | * these conditions are satisfied here, but we need to be careful when | ||
22 | * modifying this file. This is not a clean solution but is the best | ||
23 | * one so far. | ||
18 | * | 24 | * |
19 | * Also note that we are capturing "n" from the containing scope here. | 25 | * Also note that we are capturing "n" from the containing scope here. |
20 | */ | 26 | */ |
diff --git a/arch/tile/lib/spinlock_common.h b/arch/tile/lib/spinlock_common.h index c10109809132..6ac37509faca 100644 --- a/arch/tile/lib/spinlock_common.h +++ b/arch/tile/lib/spinlock_common.h | |||
@@ -60,5 +60,5 @@ static void delay_backoff(int iterations) | |||
60 | loops += __insn_crc32_32(stack_pointer, get_cycles_low()) & | 60 | loops += __insn_crc32_32(stack_pointer, get_cycles_low()) & |
61 | (loops - 1); | 61 | (loops - 1); |
62 | 62 | ||
63 | relax(1 << exponent); | 63 | relax(loops); |
64 | } | 64 | } |
diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c index cba30e9547b4..22e58f51ed23 100644 --- a/arch/tile/mm/fault.c +++ b/arch/tile/mm/fault.c | |||
@@ -130,7 +130,7 @@ static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address) | |||
130 | } | 130 | } |
131 | 131 | ||
132 | /* | 132 | /* |
133 | * Handle a fault on the vmalloc or module mapping area | 133 | * Handle a fault on the vmalloc area. |
134 | */ | 134 | */ |
135 | static inline int vmalloc_fault(pgd_t *pgd, unsigned long address) | 135 | static inline int vmalloc_fault(pgd_t *pgd, unsigned long address) |
136 | { | 136 | { |
@@ -203,9 +203,14 @@ static pgd_t *get_current_pgd(void) | |||
203 | * interrupt or a critical region, and must do as little as possible. | 203 | * interrupt or a critical region, and must do as little as possible. |
204 | * Similarly, we can't use atomic ops here, since we may be handling a | 204 | * Similarly, we can't use atomic ops here, since we may be handling a |
205 | * fault caused by an atomic op access. | 205 | * fault caused by an atomic op access. |
206 | * | ||
207 | * If we find a migrating PTE while we're in an NMI context, and we're | ||
208 | * at a PC that has a registered exception handler, we don't wait, | ||
209 | * since this thread may (e.g.) have been interrupted while migrating | ||
210 | * its own stack, which would then cause us to self-deadlock. | ||
206 | */ | 211 | */ |
207 | static int handle_migrating_pte(pgd_t *pgd, int fault_num, | 212 | static int handle_migrating_pte(pgd_t *pgd, int fault_num, |
208 | unsigned long address, | 213 | unsigned long address, unsigned long pc, |
209 | int is_kernel_mode, int write) | 214 | int is_kernel_mode, int write) |
210 | { | 215 | { |
211 | pud_t *pud; | 216 | pud_t *pud; |
@@ -227,6 +232,8 @@ static int handle_migrating_pte(pgd_t *pgd, int fault_num, | |||
227 | pte_offset_kernel(pmd, address); | 232 | pte_offset_kernel(pmd, address); |
228 | pteval = *pte; | 233 | pteval = *pte; |
229 | if (pte_migrating(pteval)) { | 234 | if (pte_migrating(pteval)) { |
235 | if (in_nmi() && search_exception_tables(pc)) | ||
236 | return 0; | ||
230 | wait_for_migration(pte); | 237 | wait_for_migration(pte); |
231 | return 1; | 238 | return 1; |
232 | } | 239 | } |
@@ -300,7 +307,7 @@ static int handle_page_fault(struct pt_regs *regs, | |||
300 | * rather than trying to patch up the existing PTE. | 307 | * rather than trying to patch up the existing PTE. |
301 | */ | 308 | */ |
302 | pgd = get_current_pgd(); | 309 | pgd = get_current_pgd(); |
303 | if (handle_migrating_pte(pgd, fault_num, address, | 310 | if (handle_migrating_pte(pgd, fault_num, address, regs->pc, |
304 | is_kernel_mode, write)) | 311 | is_kernel_mode, write)) |
305 | return 1; | 312 | return 1; |
306 | 313 | ||
@@ -335,9 +342,12 @@ static int handle_page_fault(struct pt_regs *regs, | |||
335 | /* | 342 | /* |
336 | * If we're trying to touch user-space addresses, we must | 343 | * If we're trying to touch user-space addresses, we must |
337 | * be either at PL0, or else with interrupts enabled in the | 344 | * be either at PL0, or else with interrupts enabled in the |
338 | * kernel, so either way we can re-enable interrupts here. | 345 | * kernel, so either way we can re-enable interrupts here |
346 | * unless we are doing atomic access to user space with | ||
347 | * interrupts disabled. | ||
339 | */ | 348 | */ |
340 | local_irq_enable(); | 349 | if (!(regs->flags & PT_FLAGS_DISABLE_IRQ)) |
350 | local_irq_enable(); | ||
341 | 351 | ||
342 | mm = tsk->mm; | 352 | mm = tsk->mm; |
343 | 353 | ||
@@ -665,7 +675,7 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num, | |||
665 | */ | 675 | */ |
666 | if (fault_num == INT_DTLB_ACCESS) | 676 | if (fault_num == INT_DTLB_ACCESS) |
667 | write = 1; | 677 | write = 1; |
668 | if (handle_migrating_pte(pgd, fault_num, address, 1, write)) | 678 | if (handle_migrating_pte(pgd, fault_num, address, pc, 1, write)) |
669 | return state; | 679 | return state; |
670 | 680 | ||
671 | /* Return zero so that we continue on with normal fault handling. */ | 681 | /* Return zero so that we continue on with normal fault handling. */ |
diff --git a/arch/tile/mm/homecache.c b/arch/tile/mm/homecache.c index 1cc6ae477c98..499f73770b05 100644 --- a/arch/tile/mm/homecache.c +++ b/arch/tile/mm/homecache.c | |||
@@ -394,6 +394,7 @@ int page_home(struct page *page) | |||
394 | return pte_to_home(*virt_to_pte(NULL, kva)); | 394 | return pte_to_home(*virt_to_pte(NULL, kva)); |
395 | } | 395 | } |
396 | } | 396 | } |
397 | EXPORT_SYMBOL(page_home); | ||
397 | 398 | ||
398 | void homecache_change_page_home(struct page *page, int order, int home) | 399 | void homecache_change_page_home(struct page *page, int order, int home) |
399 | { | 400 | { |
diff --git a/arch/tile/mm/init.c b/arch/tile/mm/init.c index 830c4908ea76..6a9d20ddc34f 100644 --- a/arch/tile/mm/init.c +++ b/arch/tile/mm/init.c | |||
@@ -254,11 +254,6 @@ static pgprot_t __init init_pgprot(ulong address) | |||
254 | return construct_pgprot(PAGE_KERNEL_RO, PAGE_HOME_IMMUTABLE); | 254 | return construct_pgprot(PAGE_KERNEL_RO, PAGE_HOME_IMMUTABLE); |
255 | } | 255 | } |
256 | 256 | ||
257 | /* As a performance optimization, keep the boot init stack here. */ | ||
258 | if (address >= (ulong)&init_thread_union && | ||
259 | address < (ulong)&init_thread_union + THREAD_SIZE) | ||
260 | return construct_pgprot(PAGE_KERNEL, smp_processor_id()); | ||
261 | |||
262 | #ifndef __tilegx__ | 257 | #ifndef __tilegx__ |
263 | #if !ATOMIC_LOCKS_FOUND_VIA_TABLE() | 258 | #if !ATOMIC_LOCKS_FOUND_VIA_TABLE() |
264 | /* Force the atomic_locks[] array page to be hash-for-home. */ | 259 | /* Force the atomic_locks[] array page to be hash-for-home. */ |
@@ -557,6 +552,7 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) | |||
557 | 552 | ||
558 | address = MEM_SV_INTRPT; | 553 | address = MEM_SV_INTRPT; |
559 | pmd = get_pmd(pgtables, address); | 554 | pmd = get_pmd(pgtables, address); |
555 | pfn = 0; /* code starts at PA 0 */ | ||
560 | if (ktext_small) { | 556 | if (ktext_small) { |
561 | /* Allocate an L2 PTE for the kernel text */ | 557 | /* Allocate an L2 PTE for the kernel text */ |
562 | int cpu = 0; | 558 | int cpu = 0; |
@@ -579,10 +575,15 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) | |||
579 | } | 575 | } |
580 | 576 | ||
581 | BUG_ON(address != (unsigned long)_stext); | 577 | BUG_ON(address != (unsigned long)_stext); |
582 | pfn = 0; /* code starts at PA 0 */ | 578 | pte = NULL; |
583 | pte = alloc_pte(); | 579 | for (; address < (unsigned long)_einittext; |
584 | for (pte_ofs = 0; address < (unsigned long)_einittext; | 580 | pfn++, address += PAGE_SIZE) { |
585 | pfn++, pte_ofs++, address += PAGE_SIZE) { | 581 | pte_ofs = pte_index(address); |
582 | if (pte_ofs == 0) { | ||
583 | if (pte) | ||
584 | assign_pte(pmd++, pte); | ||
585 | pte = alloc_pte(); | ||
586 | } | ||
586 | if (!ktext_local) { | 587 | if (!ktext_local) { |
587 | prot = set_remote_cache_cpu(prot, cpu); | 588 | prot = set_remote_cache_cpu(prot, cpu); |
588 | cpu = cpumask_next(cpu, &ktext_mask); | 589 | cpu = cpumask_next(cpu, &ktext_mask); |
@@ -591,7 +592,8 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) | |||
591 | } | 592 | } |
592 | pte[pte_ofs] = pfn_pte(pfn, prot); | 593 | pte[pte_ofs] = pfn_pte(pfn, prot); |
593 | } | 594 | } |
594 | assign_pte(pmd, pte); | 595 | if (pte) |
596 | assign_pte(pmd, pte); | ||
595 | } else { | 597 | } else { |
596 | pte_t pteval = pfn_pte(0, PAGE_KERNEL_EXEC); | 598 | pte_t pteval = pfn_pte(0, PAGE_KERNEL_EXEC); |
597 | pteval = pte_mkhuge(pteval); | 599 | pteval = pte_mkhuge(pteval); |
@@ -614,7 +616,9 @@ static void __init kernel_physical_mapping_init(pgd_t *pgd_base) | |||
614 | else | 616 | else |
615 | pteval = hv_pte_set_mode(pteval, | 617 | pteval = hv_pte_set_mode(pteval, |
616 | HV_PTE_MODE_CACHE_NO_L3); | 618 | HV_PTE_MODE_CACHE_NO_L3); |
617 | *(pte_t *)pmd = pteval; | 619 | for (; address < (unsigned long)_einittext; |
620 | pfn += PFN_DOWN(HPAGE_SIZE), address += HPAGE_SIZE) | ||
621 | *(pte_t *)(pmd++) = pfn_pte(pfn, pteval); | ||
618 | } | 622 | } |
619 | 623 | ||
620 | /* Set swapper_pgprot here so it is flushed to memory right away. */ | 624 | /* Set swapper_pgprot here so it is flushed to memory right away. */ |
diff --git a/arch/tile/mm/pgtable.c b/arch/tile/mm/pgtable.c index 87303693a072..2410aa899b3e 100644 --- a/arch/tile/mm/pgtable.c +++ b/arch/tile/mm/pgtable.c | |||
@@ -177,14 +177,10 @@ void shatter_huge_page(unsigned long addr) | |||
177 | if (!pmd_huge_page(*pmd)) | 177 | if (!pmd_huge_page(*pmd)) |
178 | return; | 178 | return; |
179 | 179 | ||
180 | /* | 180 | spin_lock_irqsave(&init_mm.page_table_lock, flags); |
181 | * Grab the pgd_lock, since we may need it to walk the pgd_list, | ||
182 | * and since we need some kind of lock here to avoid races. | ||
183 | */ | ||
184 | spin_lock_irqsave(&pgd_lock, flags); | ||
185 | if (!pmd_huge_page(*pmd)) { | 181 | if (!pmd_huge_page(*pmd)) { |
186 | /* Lost the race to convert the huge page. */ | 182 | /* Lost the race to convert the huge page. */ |
187 | spin_unlock_irqrestore(&pgd_lock, flags); | 183 | spin_unlock_irqrestore(&init_mm.page_table_lock, flags); |
188 | return; | 184 | return; |
189 | } | 185 | } |
190 | 186 | ||
@@ -194,6 +190,7 @@ void shatter_huge_page(unsigned long addr) | |||
194 | 190 | ||
195 | #ifdef __PAGETABLE_PMD_FOLDED | 191 | #ifdef __PAGETABLE_PMD_FOLDED |
196 | /* Walk every pgd on the system and update the pmd there. */ | 192 | /* Walk every pgd on the system and update the pmd there. */ |
193 | spin_lock(&pgd_lock); | ||
197 | list_for_each(pos, &pgd_list) { | 194 | list_for_each(pos, &pgd_list) { |
198 | pmd_t *copy_pmd; | 195 | pmd_t *copy_pmd; |
199 | pgd = list_to_pgd(pos) + pgd_index(addr); | 196 | pgd = list_to_pgd(pos) + pgd_index(addr); |
@@ -201,6 +198,7 @@ void shatter_huge_page(unsigned long addr) | |||
201 | copy_pmd = pmd_offset(pud, addr); | 198 | copy_pmd = pmd_offset(pud, addr); |
202 | __set_pmd(copy_pmd, *pmd); | 199 | __set_pmd(copy_pmd, *pmd); |
203 | } | 200 | } |
201 | spin_unlock(&pgd_lock); | ||
204 | #endif | 202 | #endif |
205 | 203 | ||
206 | /* Tell every cpu to notice the change. */ | 204 | /* Tell every cpu to notice the change. */ |
@@ -208,7 +206,7 @@ void shatter_huge_page(unsigned long addr) | |||
208 | cpu_possible_mask, NULL, 0); | 206 | cpu_possible_mask, NULL, 0); |
209 | 207 | ||
210 | /* Hold the lock until the TLB flush is finished to avoid races. */ | 208 | /* Hold the lock until the TLB flush is finished to avoid races. */ |
211 | spin_unlock_irqrestore(&pgd_lock, flags); | 209 | spin_unlock_irqrestore(&init_mm.page_table_lock, flags); |
212 | } | 210 | } |
213 | 211 | ||
214 | /* | 212 | /* |
@@ -217,9 +215,13 @@ void shatter_huge_page(unsigned long addr) | |||
217 | * against pageattr.c; it is the unique case in which a valid change | 215 | * against pageattr.c; it is the unique case in which a valid change |
218 | * of kernel pagetables can't be lazily synchronized by vmalloc faults. | 216 | * of kernel pagetables can't be lazily synchronized by vmalloc faults. |
219 | * vmalloc faults work because attached pagetables are never freed. | 217 | * vmalloc faults work because attached pagetables are never freed. |
220 | * The locking scheme was chosen on the basis of manfred's | 218 | * |
221 | * recommendations and having no core impact whatsoever. | 219 | * The lock is always taken with interrupts disabled, unlike on x86 |
222 | * -- wli | 220 | * and other platforms, because we need to take the lock in |
221 | * shatter_huge_page(), which may be called from an interrupt context. | ||
222 | * We are not at risk from the tlbflush IPI deadlock that was seen on | ||
223 | * x86, since we use the flush_remote() API to have the hypervisor do | ||
224 | * the TLB flushes regardless of irq disabling. | ||
223 | */ | 225 | */ |
224 | DEFINE_SPINLOCK(pgd_lock); | 226 | DEFINE_SPINLOCK(pgd_lock); |
225 | LIST_HEAD(pgd_list); | 227 | LIST_HEAD(pgd_list); |
@@ -469,10 +471,18 @@ void __set_pte(pte_t *ptep, pte_t pte) | |||
469 | 471 | ||
470 | void set_pte(pte_t *ptep, pte_t pte) | 472 | void set_pte(pte_t *ptep, pte_t pte) |
471 | { | 473 | { |
472 | struct page *page = pfn_to_page(pte_pfn(pte)); | 474 | if (pte_present(pte) && |
473 | 475 | (!CHIP_HAS_MMIO() || hv_pte_get_mode(pte) != HV_PTE_MODE_MMIO)) { | |
474 | /* Update the home of a PTE if necessary */ | 476 | /* The PTE actually references physical memory. */ |
475 | pte = pte_set_home(pte, page_home(page)); | 477 | unsigned long pfn = pte_pfn(pte); |
478 | if (pfn_valid(pfn)) { | ||
479 | /* Update the home of the PTE from the struct page. */ | ||
480 | pte = pte_set_home(pte, page_home(pfn_to_page(pfn))); | ||
481 | } else if (hv_pte_get_mode(pte) == 0) { | ||
482 | /* remap_pfn_range(), etc, must supply PTE mode. */ | ||
483 | panic("set_pte(): out-of-range PFN and mode 0\n"); | ||
484 | } | ||
485 | } | ||
476 | 486 | ||
477 | __set_pte(ptep, pte); | 487 | __set_pte(ptep, pte); |
478 | } | 488 | } |
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 2e9852c0d487..0a9e57e7446b 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -41,7 +41,7 @@ static int __init start_kernel_proc(void *unused) | |||
41 | cpu_tasks[0].pid = pid; | 41 | cpu_tasks[0].pid = pid; |
42 | cpu_tasks[0].task = current; | 42 | cpu_tasks[0].task = current; |
43 | #ifdef CONFIG_SMP | 43 | #ifdef CONFIG_SMP |
44 | cpu_online_map = cpumask_of_cpu(0); | 44 | init_cpu_online(get_cpu_mask(0)); |
45 | #endif | 45 | #endif |
46 | start_kernel(); | 46 | start_kernel(); |
47 | return 0; | 47 | return 0; |
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c index 155206a66908..6f588e160fb0 100644 --- a/arch/um/kernel/smp.c +++ b/arch/um/kernel/smp.c | |||
@@ -76,7 +76,7 @@ static int idle_proc(void *cpup) | |||
76 | cpu_relax(); | 76 | cpu_relax(); |
77 | 77 | ||
78 | notify_cpu_starting(cpu); | 78 | notify_cpu_starting(cpu); |
79 | cpu_set(cpu, cpu_online_map); | 79 | set_cpu_online(cpu, true); |
80 | default_idle(); | 80 | default_idle(); |
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
@@ -110,8 +110,7 @@ void smp_prepare_cpus(unsigned int maxcpus) | |||
110 | for (i = 0; i < ncpus; ++i) | 110 | for (i = 0; i < ncpus; ++i) |
111 | set_cpu_possible(i, true); | 111 | set_cpu_possible(i, true); |
112 | 112 | ||
113 | cpu_clear(me, cpu_online_map); | 113 | set_cpu_online(me, true); |
114 | cpu_set(me, cpu_online_map); | ||
115 | cpu_set(me, cpu_callin_map); | 114 | cpu_set(me, cpu_callin_map); |
116 | 115 | ||
117 | err = os_pipe(cpu_data[me].ipi_pipe, 1, 1); | 116 | err = os_pipe(cpu_data[me].ipi_pipe, 1, 1); |
@@ -138,13 +137,13 @@ void smp_prepare_cpus(unsigned int maxcpus) | |||
138 | 137 | ||
139 | void smp_prepare_boot_cpu(void) | 138 | void smp_prepare_boot_cpu(void) |
140 | { | 139 | { |
141 | cpu_set(smp_processor_id(), cpu_online_map); | 140 | set_cpu_online(smp_processor_id(), true); |
142 | } | 141 | } |
143 | 142 | ||
144 | int __cpu_up(unsigned int cpu) | 143 | int __cpu_up(unsigned int cpu) |
145 | { | 144 | { |
146 | cpu_set(cpu, smp_commenced_mask); | 145 | cpu_set(cpu, smp_commenced_mask); |
147 | while (!cpu_isset(cpu, cpu_online_map)) | 146 | while (!cpu_online(cpu)) |
148 | mb(); | 147 | mb(); |
149 | return 0; | 148 | return 0; |
150 | } | 149 | } |
diff --git a/arch/unicore32/include/asm/dma-mapping.h b/arch/unicore32/include/asm/dma-mapping.h index 9258e592f414..366460a81796 100644 --- a/arch/unicore32/include/asm/dma-mapping.h +++ b/arch/unicore32/include/asm/dma-mapping.h | |||
@@ -82,20 +82,26 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask) | |||
82 | return 0; | 82 | return 0; |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | 85 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) |
86 | dma_addr_t *dma_handle, gfp_t flag) | 86 | |
87 | static inline void *dma_alloc_attrs(struct device *dev, size_t size, | ||
88 | dma_addr_t *dma_handle, gfp_t flag, | ||
89 | struct dma_attrs *attrs) | ||
87 | { | 90 | { |
88 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 91 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
89 | 92 | ||
90 | return dma_ops->alloc_coherent(dev, size, dma_handle, flag); | 93 | return dma_ops->alloc(dev, size, dma_handle, flag, attrs); |
91 | } | 94 | } |
92 | 95 | ||
93 | static inline void dma_free_coherent(struct device *dev, size_t size, | 96 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
94 | void *cpu_addr, dma_addr_t dma_handle) | 97 | |
98 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
99 | void *cpu_addr, dma_addr_t dma_handle, | ||
100 | struct dma_attrs *attrs) | ||
95 | { | 101 | { |
96 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | 102 | struct dma_map_ops *dma_ops = get_dma_ops(dev); |
97 | 103 | ||
98 | dma_ops->free_coherent(dev, size, cpu_addr, dma_handle); | 104 | dma_ops->free(dev, size, cpu_addr, dma_handle, attrs); |
99 | } | 105 | } |
100 | 106 | ||
101 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | 107 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) |
diff --git a/arch/unicore32/mm/dma-swiotlb.c b/arch/unicore32/mm/dma-swiotlb.c index bfa9fbb2bbb1..16c08b2143a7 100644 --- a/arch/unicore32/mm/dma-swiotlb.c +++ b/arch/unicore32/mm/dma-swiotlb.c | |||
@@ -17,9 +17,23 @@ | |||
17 | 17 | ||
18 | #include <asm/dma.h> | 18 | #include <asm/dma.h> |
19 | 19 | ||
20 | static void *unicore_swiotlb_alloc_coherent(struct device *dev, size_t size, | ||
21 | dma_addr_t *dma_handle, gfp_t flags, | ||
22 | struct dma_attrs *attrs) | ||
23 | { | ||
24 | return swiotlb_alloc_coherent(dev, size, dma_handle, flags); | ||
25 | } | ||
26 | |||
27 | static void unicore_swiotlb_free_coherent(struct device *dev, size_t size, | ||
28 | void *vaddr, dma_addr_t dma_addr, | ||
29 | struct dma_attrs *attrs) | ||
30 | { | ||
31 | swiotlb_free_coherent(dev, size, vaddr, dma_addr); | ||
32 | } | ||
33 | |||
20 | struct dma_map_ops swiotlb_dma_map_ops = { | 34 | struct dma_map_ops swiotlb_dma_map_ops = { |
21 | .alloc_coherent = swiotlb_alloc_coherent, | 35 | .alloc = unicore_swiotlb_alloc_coherent, |
22 | .free_coherent = swiotlb_free_coherent, | 36 | .free = unicore_swiotlb_free_coherent, |
23 | .map_sg = swiotlb_map_sg_attrs, | 37 | .map_sg = swiotlb_map_sg_attrs, |
24 | .unmap_sg = swiotlb_unmap_sg_attrs, | 38 | .unmap_sg = swiotlb_unmap_sg_attrs, |
25 | .dma_supported = swiotlb_dma_supported, | 39 | .dma_supported = swiotlb_dma_supported, |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 968dbe24a255..41a7237606a3 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -129,6 +129,7 @@ KBUILD_CFLAGS += -Wno-sign-compare | |||
129 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables | 129 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables |
130 | # prevent gcc from generating any FP code by mistake | 130 | # prevent gcc from generating any FP code by mistake |
131 | KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) | 131 | KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,) |
132 | KBUILD_CFLAGS += $(call cc-option,-mno-avx,) | ||
132 | 133 | ||
133 | KBUILD_CFLAGS += $(mflags-y) | 134 | KBUILD_CFLAGS += $(mflags-y) |
134 | KBUILD_AFLAGS += $(mflags-y) | 135 | KBUILD_AFLAGS += $(mflags-y) |
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index ed3065fd6314..4b4331d71935 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h | |||
@@ -59,7 +59,8 @@ extern int dma_supported(struct device *hwdev, u64 mask); | |||
59 | extern int dma_set_mask(struct device *dev, u64 mask); | 59 | extern int dma_set_mask(struct device *dev, u64 mask); |
60 | 60 | ||
61 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 61 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
62 | dma_addr_t *dma_addr, gfp_t flag); | 62 | dma_addr_t *dma_addr, gfp_t flag, |
63 | struct dma_attrs *attrs); | ||
63 | 64 | ||
64 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | 65 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
65 | { | 66 | { |
@@ -111,9 +112,11 @@ static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp) | |||
111 | return gfp; | 112 | return gfp; |
112 | } | 113 | } |
113 | 114 | ||
115 | #define dma_alloc_coherent(d,s,h,f) dma_alloc_attrs(d,s,h,f,NULL) | ||
116 | |||
114 | static inline void * | 117 | static inline void * |
115 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | 118 | dma_alloc_attrs(struct device *dev, size_t size, dma_addr_t *dma_handle, |
116 | gfp_t gfp) | 119 | gfp_t gfp, struct dma_attrs *attrs) |
117 | { | 120 | { |
118 | struct dma_map_ops *ops = get_dma_ops(dev); | 121 | struct dma_map_ops *ops = get_dma_ops(dev); |
119 | void *memory; | 122 | void *memory; |
@@ -129,18 +132,21 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | |||
129 | if (!is_device_dma_capable(dev)) | 132 | if (!is_device_dma_capable(dev)) |
130 | return NULL; | 133 | return NULL; |
131 | 134 | ||
132 | if (!ops->alloc_coherent) | 135 | if (!ops->alloc) |
133 | return NULL; | 136 | return NULL; |
134 | 137 | ||
135 | memory = ops->alloc_coherent(dev, size, dma_handle, | 138 | memory = ops->alloc(dev, size, dma_handle, |
136 | dma_alloc_coherent_gfp_flags(dev, gfp)); | 139 | dma_alloc_coherent_gfp_flags(dev, gfp), attrs); |
137 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); | 140 | debug_dma_alloc_coherent(dev, size, *dma_handle, memory); |
138 | 141 | ||
139 | return memory; | 142 | return memory; |
140 | } | 143 | } |
141 | 144 | ||
142 | static inline void dma_free_coherent(struct device *dev, size_t size, | 145 | #define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) |
143 | void *vaddr, dma_addr_t bus) | 146 | |
147 | static inline void dma_free_attrs(struct device *dev, size_t size, | ||
148 | void *vaddr, dma_addr_t bus, | ||
149 | struct dma_attrs *attrs) | ||
144 | { | 150 | { |
145 | struct dma_map_ops *ops = get_dma_ops(dev); | 151 | struct dma_map_ops *ops = get_dma_ops(dev); |
146 | 152 | ||
@@ -150,8 +156,8 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
150 | return; | 156 | return; |
151 | 157 | ||
152 | debug_dma_free_coherent(dev, size, vaddr, bus); | 158 | debug_dma_free_coherent(dev, size, vaddr, bus); |
153 | if (ops->free_coherent) | 159 | if (ops->free) |
154 | ops->free_coherent(dev, size, vaddr, bus); | 160 | ops->free(dev, size, vaddr, bus, attrs); |
155 | } | 161 | } |
156 | 162 | ||
157 | #endif | 163 | #endif |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 7284c9a6a0b5..4fa7dcceb6c0 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -974,16 +974,6 @@ extern bool cpu_has_amd_erratum(const int *); | |||
974 | #define cpu_has_amd_erratum(x) (false) | 974 | #define cpu_has_amd_erratum(x) (false) |
975 | #endif /* CONFIG_CPU_SUP_AMD */ | 975 | #endif /* CONFIG_CPU_SUP_AMD */ |
976 | 976 | ||
977 | #ifdef CONFIG_X86_32 | ||
978 | /* | ||
979 | * disable hlt during certain critical i/o operations | ||
980 | */ | ||
981 | #define HAVE_DISABLE_HLT | ||
982 | #endif | ||
983 | |||
984 | void disable_hlt(void); | ||
985 | void enable_hlt(void); | ||
986 | |||
987 | void cpu_idle_wait(void); | 977 | void cpu_idle_wait(void); |
988 | 978 | ||
989 | extern unsigned long arch_align_stack(unsigned long sp); | 979 | extern unsigned long arch_align_stack(unsigned long sp); |
diff --git a/arch/x86/include/asm/word-at-a-time.h b/arch/x86/include/asm/word-at-a-time.h new file mode 100644 index 000000000000..6fe6767b7124 --- /dev/null +++ b/arch/x86/include/asm/word-at-a-time.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef _ASM_WORD_AT_A_TIME_H | ||
2 | #define _ASM_WORD_AT_A_TIME_H | ||
3 | |||
4 | /* | ||
5 | * This is largely generic for little-endian machines, but the | ||
6 | * optimal byte mask counting is probably going to be something | ||
7 | * that is architecture-specific. If you have a reliably fast | ||
8 | * bit count instruction, that might be better than the multiply | ||
9 | * and shift, for example. | ||
10 | */ | ||
11 | |||
12 | #ifdef CONFIG_64BIT | ||
13 | |||
14 | /* | ||
15 | * Jan Achrenius on G+: microoptimized version of | ||
16 | * the simpler "(mask & ONEBYTES) * ONEBYTES >> 56" | ||
17 | * that works for the bytemasks without having to | ||
18 | * mask them first. | ||
19 | */ | ||
20 | static inline long count_masked_bytes(unsigned long mask) | ||
21 | { | ||
22 | return mask*0x0001020304050608ul >> 56; | ||
23 | } | ||
24 | |||
25 | #else /* 32-bit case */ | ||
26 | |||
27 | /* Carl Chatfield / Jan Achrenius G+ version for 32-bit */ | ||
28 | static inline long count_masked_bytes(long mask) | ||
29 | { | ||
30 | /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */ | ||
31 | long a = (0x0ff0001+mask) >> 23; | ||
32 | /* Fix the 1 for 00 case */ | ||
33 | return a & mask; | ||
34 | } | ||
35 | |||
36 | #endif | ||
37 | |||
38 | #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) | ||
39 | |||
40 | /* Return the high bit set in the first byte that is a zero */ | ||
41 | static inline unsigned long has_zero(unsigned long a) | ||
42 | { | ||
43 | return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80); | ||
44 | } | ||
45 | |||
46 | #endif /* _ASM_WORD_AT_A_TIME_H */ | ||
diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c index b1e7c7f7a0af..e66311200cbd 100644 --- a/arch/x86/kernel/amd_gart_64.c +++ b/arch/x86/kernel/amd_gart_64.c | |||
@@ -477,7 +477,7 @@ error: | |||
477 | /* allocate and map a coherent mapping */ | 477 | /* allocate and map a coherent mapping */ |
478 | static void * | 478 | static void * |
479 | gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | 479 | gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, |
480 | gfp_t flag) | 480 | gfp_t flag, struct dma_attrs *attrs) |
481 | { | 481 | { |
482 | dma_addr_t paddr; | 482 | dma_addr_t paddr; |
483 | unsigned long align_mask; | 483 | unsigned long align_mask; |
@@ -500,7 +500,8 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | |||
500 | } | 500 | } |
501 | __free_pages(page, get_order(size)); | 501 | __free_pages(page, get_order(size)); |
502 | } else | 502 | } else |
503 | return dma_generic_alloc_coherent(dev, size, dma_addr, flag); | 503 | return dma_generic_alloc_coherent(dev, size, dma_addr, flag, |
504 | attrs); | ||
504 | 505 | ||
505 | return NULL; | 506 | return NULL; |
506 | } | 507 | } |
@@ -508,7 +509,7 @@ gart_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, | |||
508 | /* free a coherent mapping */ | 509 | /* free a coherent mapping */ |
509 | static void | 510 | static void |
510 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, | 511 | gart_free_coherent(struct device *dev, size_t size, void *vaddr, |
511 | dma_addr_t dma_addr) | 512 | dma_addr_t dma_addr, struct dma_attrs *attrs) |
512 | { | 513 | { |
513 | gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); | 514 | gart_unmap_page(dev, dma_addr, size, DMA_BIDIRECTIONAL, NULL); |
514 | free_pages((unsigned long)vaddr, get_order(size)); | 515 | free_pages((unsigned long)vaddr, get_order(size)); |
@@ -700,8 +701,8 @@ static struct dma_map_ops gart_dma_ops = { | |||
700 | .unmap_sg = gart_unmap_sg, | 701 | .unmap_sg = gart_unmap_sg, |
701 | .map_page = gart_map_page, | 702 | .map_page = gart_map_page, |
702 | .unmap_page = gart_unmap_page, | 703 | .unmap_page = gart_unmap_page, |
703 | .alloc_coherent = gart_alloc_coherent, | 704 | .alloc = gart_alloc_coherent, |
704 | .free_coherent = gart_free_coherent, | 705 | .free = gart_free_coherent, |
705 | .mapping_error = gart_mapping_error, | 706 | .mapping_error = gart_mapping_error, |
706 | }; | 707 | }; |
707 | 708 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index ef484d9d0a25..a2dfacfd7103 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
@@ -1271,6 +1271,17 @@ done: | |||
1271 | return num ? -EINVAL : 0; | 1271 | return num ? -EINVAL : 0; |
1272 | } | 1272 | } |
1273 | 1273 | ||
1274 | PMU_FORMAT_ATTR(cccr, "config:0-31" ); | ||
1275 | PMU_FORMAT_ATTR(escr, "config:32-62"); | ||
1276 | PMU_FORMAT_ATTR(ht, "config:63" ); | ||
1277 | |||
1278 | static struct attribute *intel_p4_formats_attr[] = { | ||
1279 | &format_attr_cccr.attr, | ||
1280 | &format_attr_escr.attr, | ||
1281 | &format_attr_ht.attr, | ||
1282 | NULL, | ||
1283 | }; | ||
1284 | |||
1274 | static __initconst const struct x86_pmu p4_pmu = { | 1285 | static __initconst const struct x86_pmu p4_pmu = { |
1275 | .name = "Netburst P4/Xeon", | 1286 | .name = "Netburst P4/Xeon", |
1276 | .handle_irq = p4_pmu_handle_irq, | 1287 | .handle_irq = p4_pmu_handle_irq, |
@@ -1305,6 +1316,8 @@ static __initconst const struct x86_pmu p4_pmu = { | |||
1305 | * the former idea is taken from OProfile code | 1316 | * the former idea is taken from OProfile code |
1306 | */ | 1317 | */ |
1307 | .perfctr_second_write = 1, | 1318 | .perfctr_second_write = 1, |
1319 | |||
1320 | .format_attrs = intel_p4_formats_attr, | ||
1308 | }; | 1321 | }; |
1309 | 1322 | ||
1310 | __init int p4_pmu_init(void) | 1323 | __init int p4_pmu_init(void) |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 7943e0c21bde..3dafc6003b7c 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -282,8 +282,13 @@ void fixup_irqs(void) | |||
282 | else if (!(warned++)) | 282 | else if (!(warned++)) |
283 | set_affinity = 0; | 283 | set_affinity = 0; |
284 | 284 | ||
285 | /* | ||
286 | * We unmask if the irq was not marked masked by the | ||
287 | * core code. That respects the lazy irq disable | ||
288 | * behaviour. | ||
289 | */ | ||
285 | if (!irqd_can_move_in_process_context(data) && | 290 | if (!irqd_can_move_in_process_context(data) && |
286 | !irqd_irq_disabled(data) && chip->irq_unmask) | 291 | !irqd_irq_masked(data) && chip->irq_unmask) |
287 | chip->irq_unmask(data); | 292 | chip->irq_unmask(data); |
288 | 293 | ||
289 | raw_spin_unlock(&desc->lock); | 294 | raw_spin_unlock(&desc->lock); |
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c index 90fcf62854bb..1d5d31ea686b 100644 --- a/arch/x86/kernel/kdebugfs.c +++ b/arch/x86/kernel/kdebugfs.c | |||
@@ -68,16 +68,9 @@ static ssize_t setup_data_read(struct file *file, char __user *user_buf, | |||
68 | return count; | 68 | return count; |
69 | } | 69 | } |
70 | 70 | ||
71 | static int setup_data_open(struct inode *inode, struct file *file) | ||
72 | { | ||
73 | file->private_data = inode->i_private; | ||
74 | |||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | static const struct file_operations fops_setup_data = { | 71 | static const struct file_operations fops_setup_data = { |
79 | .read = setup_data_read, | 72 | .read = setup_data_read, |
80 | .open = setup_data_open, | 73 | .open = simple_open, |
81 | .llseek = default_llseek, | 74 | .llseek = default_llseek, |
82 | }; | 75 | }; |
83 | 76 | ||
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c index db6720edfdd0..8bfb6146f753 100644 --- a/arch/x86/kernel/kgdb.c +++ b/arch/x86/kernel/kgdb.c | |||
@@ -43,6 +43,8 @@ | |||
43 | #include <linux/smp.h> | 43 | #include <linux/smp.h> |
44 | #include <linux/nmi.h> | 44 | #include <linux/nmi.h> |
45 | #include <linux/hw_breakpoint.h> | 45 | #include <linux/hw_breakpoint.h> |
46 | #include <linux/uaccess.h> | ||
47 | #include <linux/memory.h> | ||
46 | 48 | ||
47 | #include <asm/debugreg.h> | 49 | #include <asm/debugreg.h> |
48 | #include <asm/apicdef.h> | 50 | #include <asm/apicdef.h> |
@@ -741,6 +743,64 @@ void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long ip) | |||
741 | regs->ip = ip; | 743 | regs->ip = ip; |
742 | } | 744 | } |
743 | 745 | ||
746 | int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) | ||
747 | { | ||
748 | int err; | ||
749 | char opc[BREAK_INSTR_SIZE]; | ||
750 | |||
751 | bpt->type = BP_BREAKPOINT; | ||
752 | err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr, | ||
753 | BREAK_INSTR_SIZE); | ||
754 | if (err) | ||
755 | return err; | ||
756 | err = probe_kernel_write((char *)bpt->bpt_addr, | ||
757 | arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE); | ||
758 | #ifdef CONFIG_DEBUG_RODATA | ||
759 | if (!err) | ||
760 | return err; | ||
761 | /* | ||
762 | * It is safe to call text_poke() because normal kernel execution | ||
763 | * is stopped on all cores, so long as the text_mutex is not locked. | ||
764 | */ | ||
765 | if (mutex_is_locked(&text_mutex)) | ||
766 | return -EBUSY; | ||
767 | text_poke((void *)bpt->bpt_addr, arch_kgdb_ops.gdb_bpt_instr, | ||
768 | BREAK_INSTR_SIZE); | ||
769 | err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE); | ||
770 | if (err) | ||
771 | return err; | ||
772 | if (memcmp(opc, arch_kgdb_ops.gdb_bpt_instr, BREAK_INSTR_SIZE)) | ||
773 | return -EINVAL; | ||
774 | bpt->type = BP_POKE_BREAKPOINT; | ||
775 | #endif /* CONFIG_DEBUG_RODATA */ | ||
776 | return err; | ||
777 | } | ||
778 | |||
779 | int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) | ||
780 | { | ||
781 | #ifdef CONFIG_DEBUG_RODATA | ||
782 | int err; | ||
783 | char opc[BREAK_INSTR_SIZE]; | ||
784 | |||
785 | if (bpt->type != BP_POKE_BREAKPOINT) | ||
786 | goto knl_write; | ||
787 | /* | ||
788 | * It is safe to call text_poke() because normal kernel execution | ||
789 | * is stopped on all cores, so long as the text_mutex is not locked. | ||
790 | */ | ||
791 | if (mutex_is_locked(&text_mutex)) | ||
792 | goto knl_write; | ||
793 | text_poke((void *)bpt->bpt_addr, bpt->saved_instr, BREAK_INSTR_SIZE); | ||
794 | err = probe_kernel_read(opc, (char *)bpt->bpt_addr, BREAK_INSTR_SIZE); | ||
795 | if (err || memcmp(opc, bpt->saved_instr, BREAK_INSTR_SIZE)) | ||
796 | goto knl_write; | ||
797 | return err; | ||
798 | knl_write: | ||
799 | #endif /* CONFIG_DEBUG_RODATA */ | ||
800 | return probe_kernel_write((char *)bpt->bpt_addr, | ||
801 | (char *)bpt->saved_instr, BREAK_INSTR_SIZE); | ||
802 | } | ||
803 | |||
744 | struct kgdb_arch arch_kgdb_ops = { | 804 | struct kgdb_arch arch_kgdb_ops = { |
745 | /* Breakpoint instruction: */ | 805 | /* Breakpoint instruction: */ |
746 | .gdb_bpt_instr = { 0xcc }, | 806 | .gdb_bpt_instr = { 0xcc }, |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 694d801bf606..b8ba6e4a27e4 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <asm/traps.h> | 38 | #include <asm/traps.h> |
39 | #include <asm/desc.h> | 39 | #include <asm/desc.h> |
40 | #include <asm/tlbflush.h> | 40 | #include <asm/tlbflush.h> |
41 | #include <asm/idle.h> | ||
41 | 42 | ||
42 | static int kvmapf = 1; | 43 | static int kvmapf = 1; |
43 | 44 | ||
@@ -253,7 +254,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
253 | kvm_async_pf_task_wait((u32)read_cr2()); | 254 | kvm_async_pf_task_wait((u32)read_cr2()); |
254 | break; | 255 | break; |
255 | case KVM_PV_REASON_PAGE_READY: | 256 | case KVM_PV_REASON_PAGE_READY: |
257 | rcu_irq_enter(); | ||
258 | exit_idle(); | ||
256 | kvm_async_pf_task_wake((u32)read_cr2()); | 259 | kvm_async_pf_task_wake((u32)read_cr2()); |
260 | rcu_irq_exit(); | ||
257 | break; | 261 | break; |
258 | } | 262 | } |
259 | } | 263 | } |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 6ac5782f4d6b..d0b2fb9ccbb1 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -430,7 +430,7 @@ static void calgary_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
430 | } | 430 | } |
431 | 431 | ||
432 | static void* calgary_alloc_coherent(struct device *dev, size_t size, | 432 | static void* calgary_alloc_coherent(struct device *dev, size_t size, |
433 | dma_addr_t *dma_handle, gfp_t flag) | 433 | dma_addr_t *dma_handle, gfp_t flag, struct dma_attrs *attrs) |
434 | { | 434 | { |
435 | void *ret = NULL; | 435 | void *ret = NULL; |
436 | dma_addr_t mapping; | 436 | dma_addr_t mapping; |
@@ -463,7 +463,8 @@ error: | |||
463 | } | 463 | } |
464 | 464 | ||
465 | static void calgary_free_coherent(struct device *dev, size_t size, | 465 | static void calgary_free_coherent(struct device *dev, size_t size, |
466 | void *vaddr, dma_addr_t dma_handle) | 466 | void *vaddr, dma_addr_t dma_handle, |
467 | struct dma_attrs *attrs) | ||
467 | { | 468 | { |
468 | unsigned int npages; | 469 | unsigned int npages; |
469 | struct iommu_table *tbl = find_iommu_table(dev); | 470 | struct iommu_table *tbl = find_iommu_table(dev); |
@@ -476,8 +477,8 @@ static void calgary_free_coherent(struct device *dev, size_t size, | |||
476 | } | 477 | } |
477 | 478 | ||
478 | static struct dma_map_ops calgary_dma_ops = { | 479 | static struct dma_map_ops calgary_dma_ops = { |
479 | .alloc_coherent = calgary_alloc_coherent, | 480 | .alloc = calgary_alloc_coherent, |
480 | .free_coherent = calgary_free_coherent, | 481 | .free = calgary_free_coherent, |
481 | .map_sg = calgary_map_sg, | 482 | .map_sg = calgary_map_sg, |
482 | .unmap_sg = calgary_unmap_sg, | 483 | .unmap_sg = calgary_unmap_sg, |
483 | .map_page = calgary_map_page, | 484 | .map_page = calgary_map_page, |
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 28e5e06fcba4..3003250ac51d 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -96,7 +96,8 @@ void __init pci_iommu_alloc(void) | |||
96 | } | 96 | } |
97 | } | 97 | } |
98 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 98 | void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
99 | dma_addr_t *dma_addr, gfp_t flag) | 99 | dma_addr_t *dma_addr, gfp_t flag, |
100 | struct dma_attrs *attrs) | ||
100 | { | 101 | { |
101 | unsigned long dma_mask; | 102 | unsigned long dma_mask; |
102 | struct page *page; | 103 | struct page *page; |
diff --git a/arch/x86/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu.c index 3af4af810c07..f96050685b46 100644 --- a/arch/x86/kernel/pci-nommu.c +++ b/arch/x86/kernel/pci-nommu.c | |||
@@ -75,7 +75,7 @@ static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg, | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr, | 77 | static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr, |
78 | dma_addr_t dma_addr) | 78 | dma_addr_t dma_addr, struct dma_attrs *attrs) |
79 | { | 79 | { |
80 | free_pages((unsigned long)vaddr, get_order(size)); | 80 | free_pages((unsigned long)vaddr, get_order(size)); |
81 | } | 81 | } |
@@ -96,8 +96,8 @@ static void nommu_sync_sg_for_device(struct device *dev, | |||
96 | } | 96 | } |
97 | 97 | ||
98 | struct dma_map_ops nommu_dma_ops = { | 98 | struct dma_map_ops nommu_dma_ops = { |
99 | .alloc_coherent = dma_generic_alloc_coherent, | 99 | .alloc = dma_generic_alloc_coherent, |
100 | .free_coherent = nommu_free_coherent, | 100 | .free = nommu_free_coherent, |
101 | .map_sg = nommu_map_sg, | 101 | .map_sg = nommu_map_sg, |
102 | .map_page = nommu_map_page, | 102 | .map_page = nommu_map_page, |
103 | .sync_single_for_device = nommu_sync_single_for_device, | 103 | .sync_single_for_device = nommu_sync_single_for_device, |
diff --git a/arch/x86/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb.c index 8f972cbddef0..6c483ba98b9c 100644 --- a/arch/x86/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb.c | |||
@@ -15,21 +15,30 @@ | |||
15 | int swiotlb __read_mostly; | 15 | int swiotlb __read_mostly; |
16 | 16 | ||
17 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 17 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
18 | dma_addr_t *dma_handle, gfp_t flags) | 18 | dma_addr_t *dma_handle, gfp_t flags, |
19 | struct dma_attrs *attrs) | ||
19 | { | 20 | { |
20 | void *vaddr; | 21 | void *vaddr; |
21 | 22 | ||
22 | vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags); | 23 | vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags, |
24 | attrs); | ||
23 | if (vaddr) | 25 | if (vaddr) |
24 | return vaddr; | 26 | return vaddr; |
25 | 27 | ||
26 | return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); | 28 | return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); |
27 | } | 29 | } |
28 | 30 | ||
31 | static void x86_swiotlb_free_coherent(struct device *dev, size_t size, | ||
32 | void *vaddr, dma_addr_t dma_addr, | ||
33 | struct dma_attrs *attrs) | ||
34 | { | ||
35 | swiotlb_free_coherent(dev, size, vaddr, dma_addr); | ||
36 | } | ||
37 | |||
29 | static struct dma_map_ops swiotlb_dma_ops = { | 38 | static struct dma_map_ops swiotlb_dma_ops = { |
30 | .mapping_error = swiotlb_dma_mapping_error, | 39 | .mapping_error = swiotlb_dma_mapping_error, |
31 | .alloc_coherent = x86_swiotlb_alloc_coherent, | 40 | .alloc = x86_swiotlb_alloc_coherent, |
32 | .free_coherent = swiotlb_free_coherent, | 41 | .free = x86_swiotlb_free_coherent, |
33 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, | 42 | .sync_single_for_cpu = swiotlb_sync_single_for_cpu, |
34 | .sync_single_for_device = swiotlb_sync_single_for_device, | 43 | .sync_single_for_device = swiotlb_sync_single_for_device, |
35 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, | 44 | .sync_sg_for_cpu = swiotlb_sync_sg_for_cpu, |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index a33afaa5ddb7..1d92a5ab6e8b 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -362,34 +362,10 @@ void (*pm_idle)(void); | |||
362 | EXPORT_SYMBOL(pm_idle); | 362 | EXPORT_SYMBOL(pm_idle); |
363 | #endif | 363 | #endif |
364 | 364 | ||
365 | #ifdef CONFIG_X86_32 | ||
366 | /* | ||
367 | * This halt magic was a workaround for ancient floppy DMA | ||
368 | * wreckage. It should be safe to remove. | ||
369 | */ | ||
370 | static int hlt_counter; | ||
371 | void disable_hlt(void) | ||
372 | { | ||
373 | hlt_counter++; | ||
374 | } | ||
375 | EXPORT_SYMBOL(disable_hlt); | ||
376 | |||
377 | void enable_hlt(void) | ||
378 | { | ||
379 | hlt_counter--; | ||
380 | } | ||
381 | EXPORT_SYMBOL(enable_hlt); | ||
382 | |||
383 | static inline int hlt_use_halt(void) | ||
384 | { | ||
385 | return (!hlt_counter && boot_cpu_data.hlt_works_ok); | ||
386 | } | ||
387 | #else | ||
388 | static inline int hlt_use_halt(void) | 365 | static inline int hlt_use_halt(void) |
389 | { | 366 | { |
390 | return 1; | 367 | return 1; |
391 | } | 368 | } |
392 | #endif | ||
393 | 369 | ||
394 | #ifndef CONFIG_SMP | 370 | #ifndef CONFIG_SMP |
395 | static inline void play_dead(void) | 371 | static inline void play_dead(void) |
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index a73f0c104813..173df38dbda5 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c | |||
@@ -369,7 +369,7 @@ int kvm_pmu_set_msr(struct kvm_vcpu *vcpu, u32 index, u64 data) | |||
369 | case MSR_CORE_PERF_FIXED_CTR_CTRL: | 369 | case MSR_CORE_PERF_FIXED_CTR_CTRL: |
370 | if (pmu->fixed_ctr_ctrl == data) | 370 | if (pmu->fixed_ctr_ctrl == data) |
371 | return 0; | 371 | return 0; |
372 | if (!(data & 0xfffffffffffff444)) { | 372 | if (!(data & 0xfffffffffffff444ull)) { |
373 | reprogram_fixed_counters(pmu, data); | 373 | reprogram_fixed_counters(pmu, data); |
374 | return 0; | 374 | return 0; |
375 | } | 375 | } |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 280751c84724..ad85adfef843 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3906,7 +3906,9 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu) | |||
3906 | vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); | 3906 | vmcs_write16(VIRTUAL_PROCESSOR_ID, vmx->vpid); |
3907 | 3907 | ||
3908 | vmx->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET; | 3908 | vmx->vcpu.arch.cr0 = X86_CR0_NW | X86_CR0_CD | X86_CR0_ET; |
3909 | vcpu->srcu_idx = srcu_read_lock(&vcpu->kvm->srcu); | ||
3909 | vmx_set_cr0(&vmx->vcpu, kvm_read_cr0(vcpu)); /* enter rmode */ | 3910 | vmx_set_cr0(&vmx->vcpu, kvm_read_cr0(vcpu)); /* enter rmode */ |
3911 | srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); | ||
3910 | vmx_set_cr4(&vmx->vcpu, 0); | 3912 | vmx_set_cr4(&vmx->vcpu, 0); |
3911 | vmx_set_efer(&vmx->vcpu, 0); | 3913 | vmx_set_efer(&vmx->vcpu, 0); |
3912 | vmx_fpu_activate(&vmx->vcpu); | 3914 | vmx_fpu_activate(&vmx->vcpu); |
diff --git a/arch/x86/net/bpf_jit.S b/arch/x86/net/bpf_jit.S index 66870223f8c5..877b9a1b2152 100644 --- a/arch/x86/net/bpf_jit.S +++ b/arch/x86/net/bpf_jit.S | |||
@@ -18,17 +18,17 @@ | |||
18 | * r9d : hlen = skb->len - skb->data_len | 18 | * r9d : hlen = skb->len - skb->data_len |
19 | */ | 19 | */ |
20 | #define SKBDATA %r8 | 20 | #define SKBDATA %r8 |
21 | 21 | #define SKF_MAX_NEG_OFF $(-0x200000) /* SKF_LL_OFF from filter.h */ | |
22 | sk_load_word_ind: | ||
23 | .globl sk_load_word_ind | ||
24 | |||
25 | add %ebx,%esi /* offset += X */ | ||
26 | # test %esi,%esi /* if (offset < 0) goto bpf_error; */ | ||
27 | js bpf_error | ||
28 | 22 | ||
29 | sk_load_word: | 23 | sk_load_word: |
30 | .globl sk_load_word | 24 | .globl sk_load_word |
31 | 25 | ||
26 | test %esi,%esi | ||
27 | js bpf_slow_path_word_neg | ||
28 | |||
29 | sk_load_word_positive_offset: | ||
30 | .globl sk_load_word_positive_offset | ||
31 | |||
32 | mov %r9d,%eax # hlen | 32 | mov %r9d,%eax # hlen |
33 | sub %esi,%eax # hlen - offset | 33 | sub %esi,%eax # hlen - offset |
34 | cmp $3,%eax | 34 | cmp $3,%eax |
@@ -37,16 +37,15 @@ sk_load_word: | |||
37 | bswap %eax /* ntohl() */ | 37 | bswap %eax /* ntohl() */ |
38 | ret | 38 | ret |
39 | 39 | ||
40 | |||
41 | sk_load_half_ind: | ||
42 | .globl sk_load_half_ind | ||
43 | |||
44 | add %ebx,%esi /* offset += X */ | ||
45 | js bpf_error | ||
46 | |||
47 | sk_load_half: | 40 | sk_load_half: |
48 | .globl sk_load_half | 41 | .globl sk_load_half |
49 | 42 | ||
43 | test %esi,%esi | ||
44 | js bpf_slow_path_half_neg | ||
45 | |||
46 | sk_load_half_positive_offset: | ||
47 | .globl sk_load_half_positive_offset | ||
48 | |||
50 | mov %r9d,%eax | 49 | mov %r9d,%eax |
51 | sub %esi,%eax # hlen - offset | 50 | sub %esi,%eax # hlen - offset |
52 | cmp $1,%eax | 51 | cmp $1,%eax |
@@ -55,14 +54,15 @@ sk_load_half: | |||
55 | rol $8,%ax # ntohs() | 54 | rol $8,%ax # ntohs() |
56 | ret | 55 | ret |
57 | 56 | ||
58 | sk_load_byte_ind: | ||
59 | .globl sk_load_byte_ind | ||
60 | add %ebx,%esi /* offset += X */ | ||
61 | js bpf_error | ||
62 | |||
63 | sk_load_byte: | 57 | sk_load_byte: |
64 | .globl sk_load_byte | 58 | .globl sk_load_byte |
65 | 59 | ||
60 | test %esi,%esi | ||
61 | js bpf_slow_path_byte_neg | ||
62 | |||
63 | sk_load_byte_positive_offset: | ||
64 | .globl sk_load_byte_positive_offset | ||
65 | |||
66 | cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */ | 66 | cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte */ |
67 | jle bpf_slow_path_byte | 67 | jle bpf_slow_path_byte |
68 | movzbl (SKBDATA,%rsi),%eax | 68 | movzbl (SKBDATA,%rsi),%eax |
@@ -73,25 +73,21 @@ sk_load_byte: | |||
73 | * | 73 | * |
74 | * Implements BPF_S_LDX_B_MSH : ldxb 4*([offset]&0xf) | 74 | * Implements BPF_S_LDX_B_MSH : ldxb 4*([offset]&0xf) |
75 | * Must preserve A accumulator (%eax) | 75 | * Must preserve A accumulator (%eax) |
76 | * Inputs : %esi is the offset value, already known positive | 76 | * Inputs : %esi is the offset value |
77 | */ | 77 | */ |
78 | ENTRY(sk_load_byte_msh) | 78 | sk_load_byte_msh: |
79 | CFI_STARTPROC | 79 | .globl sk_load_byte_msh |
80 | test %esi,%esi | ||
81 | js bpf_slow_path_byte_msh_neg | ||
82 | |||
83 | sk_load_byte_msh_positive_offset: | ||
84 | .globl sk_load_byte_msh_positive_offset | ||
80 | cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte_msh */ | 85 | cmp %esi,%r9d /* if (offset >= hlen) goto bpf_slow_path_byte_msh */ |
81 | jle bpf_slow_path_byte_msh | 86 | jle bpf_slow_path_byte_msh |
82 | movzbl (SKBDATA,%rsi),%ebx | 87 | movzbl (SKBDATA,%rsi),%ebx |
83 | and $15,%bl | 88 | and $15,%bl |
84 | shl $2,%bl | 89 | shl $2,%bl |
85 | ret | 90 | ret |
86 | CFI_ENDPROC | ||
87 | ENDPROC(sk_load_byte_msh) | ||
88 | |||
89 | bpf_error: | ||
90 | # force a return 0 from jit handler | ||
91 | xor %eax,%eax | ||
92 | mov -8(%rbp),%rbx | ||
93 | leaveq | ||
94 | ret | ||
95 | 91 | ||
96 | /* rsi contains offset and can be scratched */ | 92 | /* rsi contains offset and can be scratched */ |
97 | #define bpf_slow_path_common(LEN) \ | 93 | #define bpf_slow_path_common(LEN) \ |
@@ -138,3 +134,67 @@ bpf_slow_path_byte_msh: | |||
138 | shl $2,%al | 134 | shl $2,%al |
139 | xchg %eax,%ebx | 135 | xchg %eax,%ebx |
140 | ret | 136 | ret |
137 | |||
138 | #define sk_negative_common(SIZE) \ | ||
139 | push %rdi; /* save skb */ \ | ||
140 | push %r9; \ | ||
141 | push SKBDATA; \ | ||
142 | /* rsi already has offset */ \ | ||
143 | mov $SIZE,%ecx; /* size */ \ | ||
144 | call bpf_internal_load_pointer_neg_helper; \ | ||
145 | test %rax,%rax; \ | ||
146 | pop SKBDATA; \ | ||
147 | pop %r9; \ | ||
148 | pop %rdi; \ | ||
149 | jz bpf_error | ||
150 | |||
151 | |||
152 | bpf_slow_path_word_neg: | ||
153 | cmp SKF_MAX_NEG_OFF, %esi /* test range */ | ||
154 | jl bpf_error /* offset lower -> error */ | ||
155 | sk_load_word_negative_offset: | ||
156 | .globl sk_load_word_negative_offset | ||
157 | sk_negative_common(4) | ||
158 | mov (%rax), %eax | ||
159 | bswap %eax | ||
160 | ret | ||
161 | |||
162 | bpf_slow_path_half_neg: | ||
163 | cmp SKF_MAX_NEG_OFF, %esi | ||
164 | jl bpf_error | ||
165 | sk_load_half_negative_offset: | ||
166 | .globl sk_load_half_negative_offset | ||
167 | sk_negative_common(2) | ||
168 | mov (%rax),%ax | ||
169 | rol $8,%ax | ||
170 | movzwl %ax,%eax | ||
171 | ret | ||
172 | |||
173 | bpf_slow_path_byte_neg: | ||
174 | cmp SKF_MAX_NEG_OFF, %esi | ||
175 | jl bpf_error | ||
176 | sk_load_byte_negative_offset: | ||
177 | .globl sk_load_byte_negative_offset | ||
178 | sk_negative_common(1) | ||
179 | movzbl (%rax), %eax | ||
180 | ret | ||
181 | |||
182 | bpf_slow_path_byte_msh_neg: | ||
183 | cmp SKF_MAX_NEG_OFF, %esi | ||
184 | jl bpf_error | ||
185 | sk_load_byte_msh_negative_offset: | ||
186 | .globl sk_load_byte_msh_negative_offset | ||
187 | xchg %eax,%ebx /* dont lose A , X is about to be scratched */ | ||
188 | sk_negative_common(1) | ||
189 | movzbl (%rax),%eax | ||
190 | and $15,%al | ||
191 | shl $2,%al | ||
192 | xchg %eax,%ebx | ||
193 | ret | ||
194 | |||
195 | bpf_error: | ||
196 | # force a return 0 from jit handler | ||
197 | xor %eax,%eax | ||
198 | mov -8(%rbp),%rbx | ||
199 | leaveq | ||
200 | ret | ||
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 5671752f8d9c..0597f95b6da6 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -30,7 +30,10 @@ int bpf_jit_enable __read_mostly; | |||
30 | * assembly code in arch/x86/net/bpf_jit.S | 30 | * assembly code in arch/x86/net/bpf_jit.S |
31 | */ | 31 | */ |
32 | extern u8 sk_load_word[], sk_load_half[], sk_load_byte[], sk_load_byte_msh[]; | 32 | extern u8 sk_load_word[], sk_load_half[], sk_load_byte[], sk_load_byte_msh[]; |
33 | extern u8 sk_load_word_ind[], sk_load_half_ind[], sk_load_byte_ind[]; | 33 | extern u8 sk_load_word_positive_offset[], sk_load_half_positive_offset[]; |
34 | extern u8 sk_load_byte_positive_offset[], sk_load_byte_msh_positive_offset[]; | ||
35 | extern u8 sk_load_word_negative_offset[], sk_load_half_negative_offset[]; | ||
36 | extern u8 sk_load_byte_negative_offset[], sk_load_byte_msh_negative_offset[]; | ||
34 | 37 | ||
35 | static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) | 38 | static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) |
36 | { | 39 | { |
@@ -117,6 +120,8 @@ static inline void bpf_flush_icache(void *start, void *end) | |||
117 | set_fs(old_fs); | 120 | set_fs(old_fs); |
118 | } | 121 | } |
119 | 122 | ||
123 | #define CHOOSE_LOAD_FUNC(K, func) \ | ||
124 | ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset) | ||
120 | 125 | ||
121 | void bpf_jit_compile(struct sk_filter *fp) | 126 | void bpf_jit_compile(struct sk_filter *fp) |
122 | { | 127 | { |
@@ -289,7 +294,7 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
289 | EMIT2(0x24, K & 0xFF); /* and imm8,%al */ | 294 | EMIT2(0x24, K & 0xFF); /* and imm8,%al */ |
290 | } else if (K >= 0xFFFF0000) { | 295 | } else if (K >= 0xFFFF0000) { |
291 | EMIT2(0x66, 0x25); /* and imm16,%ax */ | 296 | EMIT2(0x66, 0x25); /* and imm16,%ax */ |
292 | EMIT2(K, 2); | 297 | EMIT(K, 2); |
293 | } else { | 298 | } else { |
294 | EMIT1_off32(0x25, K); /* and imm32,%eax */ | 299 | EMIT1_off32(0x25, K); /* and imm32,%eax */ |
295 | } | 300 | } |
@@ -473,44 +478,46 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
473 | #endif | 478 | #endif |
474 | break; | 479 | break; |
475 | case BPF_S_LD_W_ABS: | 480 | case BPF_S_LD_W_ABS: |
476 | func = sk_load_word; | 481 | func = CHOOSE_LOAD_FUNC(K, sk_load_word); |
477 | common_load: seen |= SEEN_DATAREF; | 482 | common_load: seen |= SEEN_DATAREF; |
478 | if ((int)K < 0) { | ||
479 | /* Abort the JIT because __load_pointer() is needed. */ | ||
480 | goto out; | ||
481 | } | ||
482 | t_offset = func - (image + addrs[i]); | 483 | t_offset = func - (image + addrs[i]); |
483 | EMIT1_off32(0xbe, K); /* mov imm32,%esi */ | 484 | EMIT1_off32(0xbe, K); /* mov imm32,%esi */ |
484 | EMIT1_off32(0xe8, t_offset); /* call */ | 485 | EMIT1_off32(0xe8, t_offset); /* call */ |
485 | break; | 486 | break; |
486 | case BPF_S_LD_H_ABS: | 487 | case BPF_S_LD_H_ABS: |
487 | func = sk_load_half; | 488 | func = CHOOSE_LOAD_FUNC(K, sk_load_half); |
488 | goto common_load; | 489 | goto common_load; |
489 | case BPF_S_LD_B_ABS: | 490 | case BPF_S_LD_B_ABS: |
490 | func = sk_load_byte; | 491 | func = CHOOSE_LOAD_FUNC(K, sk_load_byte); |
491 | goto common_load; | 492 | goto common_load; |
492 | case BPF_S_LDX_B_MSH: | 493 | case BPF_S_LDX_B_MSH: |
493 | if ((int)K < 0) { | 494 | func = CHOOSE_LOAD_FUNC(K, sk_load_byte_msh); |
494 | /* Abort the JIT because __load_pointer() is needed. */ | ||
495 | goto out; | ||
496 | } | ||
497 | seen |= SEEN_DATAREF | SEEN_XREG; | 495 | seen |= SEEN_DATAREF | SEEN_XREG; |
498 | t_offset = sk_load_byte_msh - (image + addrs[i]); | 496 | t_offset = func - (image + addrs[i]); |
499 | EMIT1_off32(0xbe, K); /* mov imm32,%esi */ | 497 | EMIT1_off32(0xbe, K); /* mov imm32,%esi */ |
500 | EMIT1_off32(0xe8, t_offset); /* call sk_load_byte_msh */ | 498 | EMIT1_off32(0xe8, t_offset); /* call sk_load_byte_msh */ |
501 | break; | 499 | break; |
502 | case BPF_S_LD_W_IND: | 500 | case BPF_S_LD_W_IND: |
503 | func = sk_load_word_ind; | 501 | func = sk_load_word; |
504 | common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG; | 502 | common_load_ind: seen |= SEEN_DATAREF | SEEN_XREG; |
505 | t_offset = func - (image + addrs[i]); | 503 | t_offset = func - (image + addrs[i]); |
506 | EMIT1_off32(0xbe, K); /* mov imm32,%esi */ | 504 | if (K) { |
505 | if (is_imm8(K)) { | ||
506 | EMIT3(0x8d, 0x73, K); /* lea imm8(%rbx), %esi */ | ||
507 | } else { | ||
508 | EMIT2(0x8d, 0xb3); /* lea imm32(%rbx),%esi */ | ||
509 | EMIT(K, 4); | ||
510 | } | ||
511 | } else { | ||
512 | EMIT2(0x89,0xde); /* mov %ebx,%esi */ | ||
513 | } | ||
507 | EMIT1_off32(0xe8, t_offset); /* call sk_load_xxx_ind */ | 514 | EMIT1_off32(0xe8, t_offset); /* call sk_load_xxx_ind */ |
508 | break; | 515 | break; |
509 | case BPF_S_LD_H_IND: | 516 | case BPF_S_LD_H_IND: |
510 | func = sk_load_half_ind; | 517 | func = sk_load_half; |
511 | goto common_load_ind; | 518 | goto common_load_ind; |
512 | case BPF_S_LD_B_IND: | 519 | case BPF_S_LD_B_IND: |
513 | func = sk_load_byte_ind; | 520 | func = sk_load_byte; |
514 | goto common_load_ind; | 521 | goto common_load_ind; |
515 | case BPF_S_JMP_JA: | 522 | case BPF_S_JMP_JA: |
516 | t_offset = addrs[i + K] - addrs[i]; | 523 | t_offset = addrs[i + K] - addrs[i]; |
diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 47936830968c..218cdb16163c 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c | |||
@@ -225,13 +225,13 @@ static void __restore_processor_state(struct saved_context *ctxt) | |||
225 | fix_processor_context(); | 225 | fix_processor_context(); |
226 | 226 | ||
227 | do_fpu_end(); | 227 | do_fpu_end(); |
228 | x86_platform.restore_sched_clock_state(); | ||
228 | mtrr_bp_restore(); | 229 | mtrr_bp_restore(); |
229 | } | 230 | } |
230 | 231 | ||
231 | /* Needed by apm.c */ | 232 | /* Needed by apm.c */ |
232 | void restore_processor_state(void) | 233 | void restore_processor_state(void) |
233 | { | 234 | { |
234 | x86_platform.restore_sched_clock_state(); | ||
235 | __restore_processor_state(&saved_context); | 235 | __restore_processor_state(&saved_context); |
236 | } | 236 | } |
237 | #ifdef CONFIG_X86_32 | 237 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index b132ade26f77..4f51bebac02c 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -967,7 +967,7 @@ void xen_setup_shared_info(void) | |||
967 | xen_setup_mfn_list_list(); | 967 | xen_setup_mfn_list_list(); |
968 | } | 968 | } |
969 | 969 | ||
970 | /* This is called once we have the cpu_possible_map */ | 970 | /* This is called once we have the cpu_possible_mask */ |
971 | void xen_setup_vcpu_info_placement(void) | 971 | void xen_setup_vcpu_info_placement(void) |
972 | { | 972 | { |
973 | int cpu; | 973 | int cpu; |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 988828b479ed..b8e279479a6b 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1859,6 +1859,7 @@ pgd_t * __init xen_setup_kernel_pagetable(pgd_t *pgd, | |||
1859 | #endif /* CONFIG_X86_64 */ | 1859 | #endif /* CONFIG_X86_64 */ |
1860 | 1860 | ||
1861 | static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss; | 1861 | static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss; |
1862 | static unsigned char fake_ioapic_mapping[PAGE_SIZE] __page_aligned_bss; | ||
1862 | 1863 | ||
1863 | static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) | 1864 | static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) |
1864 | { | 1865 | { |
@@ -1899,7 +1900,7 @@ static void xen_set_fixmap(unsigned idx, phys_addr_t phys, pgprot_t prot) | |||
1899 | * We just don't map the IO APIC - all access is via | 1900 | * We just don't map the IO APIC - all access is via |
1900 | * hypercalls. Keep the address in the pte for reference. | 1901 | * hypercalls. Keep the address in the pte for reference. |
1901 | */ | 1902 | */ |
1902 | pte = pfn_pte(PFN_DOWN(__pa(dummy_mapping)), PAGE_KERNEL); | 1903 | pte = pfn_pte(PFN_DOWN(__pa(fake_ioapic_mapping)), PAGE_KERNEL); |
1903 | break; | 1904 | break; |
1904 | #endif | 1905 | #endif |
1905 | 1906 | ||
@@ -2064,6 +2065,7 @@ void __init xen_init_mmu_ops(void) | |||
2064 | pv_mmu_ops = xen_mmu_ops; | 2065 | pv_mmu_ops = xen_mmu_ops; |
2065 | 2066 | ||
2066 | memset(dummy_mapping, 0xff, PAGE_SIZE); | 2067 | memset(dummy_mapping, 0xff, PAGE_SIZE); |
2068 | memset(fake_ioapic_mapping, 0xfd, PAGE_SIZE); | ||
2067 | } | 2069 | } |
2068 | 2070 | ||
2069 | /* Protected by xen_reservation_lock. */ | 2071 | /* Protected by xen_reservation_lock. */ |
diff --git a/arch/x86/xen/pci-swiotlb-xen.c b/arch/x86/xen/pci-swiotlb-xen.c index b480d4207a4c..967633ad98c4 100644 --- a/arch/x86/xen/pci-swiotlb-xen.c +++ b/arch/x86/xen/pci-swiotlb-xen.c | |||
@@ -12,8 +12,8 @@ int xen_swiotlb __read_mostly; | |||
12 | 12 | ||
13 | static struct dma_map_ops xen_swiotlb_dma_ops = { | 13 | static struct dma_map_ops xen_swiotlb_dma_ops = { |
14 | .mapping_error = xen_swiotlb_dma_mapping_error, | 14 | .mapping_error = xen_swiotlb_dma_mapping_error, |
15 | .alloc_coherent = xen_swiotlb_alloc_coherent, | 15 | .alloc = xen_swiotlb_alloc_coherent, |
16 | .free_coherent = xen_swiotlb_free_coherent, | 16 | .free = xen_swiotlb_free_coherent, |
17 | .sync_single_for_cpu = xen_swiotlb_sync_single_for_cpu, | 17 | .sync_single_for_cpu = xen_swiotlb_sync_single_for_cpu, |
18 | .sync_single_for_device = xen_swiotlb_sync_single_for_device, | 18 | .sync_single_for_device = xen_swiotlb_sync_single_for_device, |
19 | .sync_sg_for_cpu = xen_swiotlb_sync_sg_for_cpu, | 19 | .sync_sg_for_cpu = xen_swiotlb_sync_sg_for_cpu, |
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 02900e8ce26c..5fac6919b957 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -59,7 +59,7 @@ static irqreturn_t xen_reschedule_interrupt(int irq, void *dev_id) | |||
59 | 59 | ||
60 | static void __cpuinit cpu_bringup(void) | 60 | static void __cpuinit cpu_bringup(void) |
61 | { | 61 | { |
62 | int cpu = smp_processor_id(); | 62 | int cpu; |
63 | 63 | ||
64 | cpu_init(); | 64 | cpu_init(); |
65 | touch_softlockup_watchdog(); | 65 | touch_softlockup_watchdog(); |