diff options
Diffstat (limited to 'arch')
116 files changed, 759 insertions, 415 deletions
diff --git a/arch/arc/include/asm/spinlock.h b/arch/arc/include/asm/spinlock.h index f158197ac5b0..b6a8c2dfbe6e 100644 --- a/arch/arc/include/asm/spinlock.h +++ b/arch/arc/include/asm/spinlock.h | |||
@@ -45,7 +45,14 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock) | |||
45 | 45 | ||
46 | static inline void arch_spin_unlock(arch_spinlock_t *lock) | 46 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
47 | { | 47 | { |
48 | lock->slock = __ARCH_SPIN_LOCK_UNLOCKED__; | 48 | unsigned int tmp = __ARCH_SPIN_LOCK_UNLOCKED__; |
49 | |||
50 | __asm__ __volatile__( | ||
51 | " ex %0, [%1] \n" | ||
52 | : "+r" (tmp) | ||
53 | : "r"(&(lock->slock)) | ||
54 | : "memory"); | ||
55 | |||
49 | smp_mb(); | 56 | smp_mb(); |
50 | } | 57 | } |
51 | 58 | ||
diff --git a/arch/arc/include/asm/uaccess.h b/arch/arc/include/asm/uaccess.h index 32420824375b..30c9baffa96f 100644 --- a/arch/arc/include/asm/uaccess.h +++ b/arch/arc/include/asm/uaccess.h | |||
@@ -43,7 +43,7 @@ | |||
43 | * Because it essentially checks if buffer end is within limit and @len is | 43 | * Because it essentially checks if buffer end is within limit and @len is |
44 | * non-ngeative, which implies that buffer start will be within limit too. | 44 | * non-ngeative, which implies that buffer start will be within limit too. |
45 | * | 45 | * |
46 | * The reason for rewriting being, for majorit yof cases, @len is generally | 46 | * The reason for rewriting being, for majority of cases, @len is generally |
47 | * compile time constant, causing first sub-expression to be compile time | 47 | * compile time constant, causing first sub-expression to be compile time |
48 | * subsumed. | 48 | * subsumed. |
49 | * | 49 | * |
@@ -53,7 +53,7 @@ | |||
53 | * | 53 | * |
54 | */ | 54 | */ |
55 | #define __user_ok(addr, sz) (((sz) <= TASK_SIZE) && \ | 55 | #define __user_ok(addr, sz) (((sz) <= TASK_SIZE) && \ |
56 | (((addr)+(sz)) <= get_fs())) | 56 | ((addr) <= (get_fs() - (sz)))) |
57 | #define __access_ok(addr, sz) (unlikely(__kernel_ok) || \ | 57 | #define __access_ok(addr, sz) (unlikely(__kernel_ok) || \ |
58 | likely(__user_ok((addr), (sz)))) | 58 | likely(__user_ok((addr), (sz)))) |
59 | 59 | ||
diff --git a/arch/arc/kernel/signal.c b/arch/arc/kernel/signal.c index ee6ef2f60a28..7e95e1a86510 100644 --- a/arch/arc/kernel/signal.c +++ b/arch/arc/kernel/signal.c | |||
@@ -101,7 +101,6 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
101 | { | 101 | { |
102 | struct rt_sigframe __user *sf; | 102 | struct rt_sigframe __user *sf; |
103 | unsigned int magic; | 103 | unsigned int magic; |
104 | int err; | ||
105 | struct pt_regs *regs = current_pt_regs(); | 104 | struct pt_regs *regs = current_pt_regs(); |
106 | 105 | ||
107 | /* Always make any pending restarted system calls return -EINTR */ | 106 | /* Always make any pending restarted system calls return -EINTR */ |
@@ -119,15 +118,16 @@ SYSCALL_DEFINE0(rt_sigreturn) | |||
119 | if (!access_ok(VERIFY_READ, sf, sizeof(*sf))) | 118 | if (!access_ok(VERIFY_READ, sf, sizeof(*sf))) |
120 | goto badframe; | 119 | goto badframe; |
121 | 120 | ||
122 | err = restore_usr_regs(regs, sf); | 121 | if (__get_user(magic, &sf->sigret_magic)) |
123 | err |= __get_user(magic, &sf->sigret_magic); | ||
124 | if (err) | ||
125 | goto badframe; | 122 | goto badframe; |
126 | 123 | ||
127 | if (unlikely(is_do_ss_needed(magic))) | 124 | if (unlikely(is_do_ss_needed(magic))) |
128 | if (restore_altstack(&sf->uc.uc_stack)) | 125 | if (restore_altstack(&sf->uc.uc_stack)) |
129 | goto badframe; | 126 | goto badframe; |
130 | 127 | ||
128 | if (restore_usr_regs(regs, sf)) | ||
129 | goto badframe; | ||
130 | |||
131 | /* Don't restart from sigreturn */ | 131 | /* Don't restart from sigreturn */ |
132 | syscall_wont_restart(regs); | 132 | syscall_wont_restart(regs); |
133 | 133 | ||
@@ -191,6 +191,15 @@ setup_rt_frame(int signo, struct k_sigaction *ka, siginfo_t *info, | |||
191 | return 1; | 191 | return 1; |
192 | 192 | ||
193 | /* | 193 | /* |
194 | * w/o SA_SIGINFO, struct ucontext is partially populated (only | ||
195 | * uc_mcontext/uc_sigmask) for kernel's normal user state preservation | ||
196 | * during signal handler execution. This works for SA_SIGINFO as well | ||
197 | * although the semantics are now overloaded (the same reg state can be | ||
198 | * inspected by userland: but are they allowed to fiddle with it ? | ||
199 | */ | ||
200 | err |= stash_usr_regs(sf, regs, set); | ||
201 | |||
202 | /* | ||
194 | * SA_SIGINFO requires 3 args to signal handler: | 203 | * SA_SIGINFO requires 3 args to signal handler: |
195 | * #1: sig-no (common to any handler) | 204 | * #1: sig-no (common to any handler) |
196 | * #2: struct siginfo | 205 | * #2: struct siginfo |
@@ -213,14 +222,6 @@ setup_rt_frame(int signo, struct k_sigaction *ka, siginfo_t *info, | |||
213 | magic = MAGIC_SIGALTSTK; | 222 | magic = MAGIC_SIGALTSTK; |
214 | } | 223 | } |
215 | 224 | ||
216 | /* | ||
217 | * w/o SA_SIGINFO, struct ucontext is partially populated (only | ||
218 | * uc_mcontext/uc_sigmask) for kernel's normal user state preservation | ||
219 | * during signal handler execution. This works for SA_SIGINFO as well | ||
220 | * although the semantics are now overloaded (the same reg state can be | ||
221 | * inspected by userland: but are they allowed to fiddle with it ? | ||
222 | */ | ||
223 | err |= stash_usr_regs(sf, regs, set); | ||
224 | err |= __put_user(magic, &sf->sigret_magic); | 225 | err |= __put_user(magic, &sf->sigret_magic); |
225 | if (err) | 226 | if (err) |
226 | return err; | 227 | return err; |
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c index 0e51e69cf30d..3fde7de3ea67 100644 --- a/arch/arc/kernel/time.c +++ b/arch/arc/kernel/time.c | |||
@@ -227,12 +227,9 @@ void __attribute__((weak)) arc_local_timer_setup(unsigned int cpu) | |||
227 | { | 227 | { |
228 | struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); | 228 | struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); |
229 | 229 | ||
230 | clockevents_calc_mult_shift(clk, arc_get_core_freq(), 5); | ||
231 | |||
232 | clk->max_delta_ns = clockevent_delta2ns(ARC_TIMER_MAX, clk); | ||
233 | clk->cpumask = cpumask_of(cpu); | 230 | clk->cpumask = cpumask_of(cpu); |
234 | 231 | clockevents_config_and_register(clk, arc_get_core_freq(), | |
235 | clockevents_register_device(clk); | 232 | 0, ARC_TIMER_MAX); |
236 | 233 | ||
237 | /* | 234 | /* |
238 | * setup the per-cpu timer IRQ handler - for all cpus | 235 | * setup the per-cpu timer IRQ handler - for all cpus |
diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index 28d170060747..7ff5b5c183bb 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c | |||
@@ -245,6 +245,12 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, | |||
245 | regs->status32 &= ~STATUS_DE_MASK; | 245 | regs->status32 &= ~STATUS_DE_MASK; |
246 | } else { | 246 | } else { |
247 | regs->ret += state.instr_len; | 247 | regs->ret += state.instr_len; |
248 | |||
249 | /* handle zero-overhead-loop */ | ||
250 | if ((regs->ret == regs->lp_end) && (regs->lp_count)) { | ||
251 | regs->ret = regs->lp_start; | ||
252 | regs->lp_count--; | ||
253 | } | ||
248 | } | 254 | } |
249 | 255 | ||
250 | return 0; | 256 | return 0; |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3917dd4f270c..585218778a1b 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -483,6 +483,7 @@ config ARCH_IXP4XX | |||
483 | bool "IXP4xx-based" | 483 | bool "IXP4xx-based" |
484 | depends on MMU | 484 | depends on MMU |
485 | select ARCH_HAS_DMA_SET_COHERENT_MASK | 485 | select ARCH_HAS_DMA_SET_COHERENT_MASK |
486 | select ARCH_SUPPORTS_BIG_ENDIAN | ||
486 | select ARCH_REQUIRE_GPIOLIB | 487 | select ARCH_REQUIRE_GPIOLIB |
487 | select CLKSRC_MMIO | 488 | select CLKSRC_MMIO |
488 | select CPU_XSCALE | 489 | select CPU_XSCALE |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a37a50f575a2..00696973d88d 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -16,6 +16,7 @@ LDFLAGS := | |||
16 | LDFLAGS_vmlinux :=-p --no-undefined -X | 16 | LDFLAGS_vmlinux :=-p --no-undefined -X |
17 | ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) | 17 | ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) |
18 | LDFLAGS_vmlinux += --be8 | 18 | LDFLAGS_vmlinux += --be8 |
19 | LDFLAGS_MODULE += --be8 | ||
19 | endif | 20 | endif |
20 | 21 | ||
21 | OBJCOPYFLAGS :=-O binary -R .comment -S | 22 | OBJCOPYFLAGS :=-O binary -R .comment -S |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 75189f13cf54..066b03480b63 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
@@ -135,6 +135,7 @@ start: | |||
135 | .word _edata @ zImage end address | 135 | .word _edata @ zImage end address |
136 | THUMB( .thumb ) | 136 | THUMB( .thumb ) |
137 | 1: | 137 | 1: |
138 | ARM_BE8( setend be ) @ go BE8 if compiled for BE8 | ||
138 | mrs r9, cpsr | 139 | mrs r9, cpsr |
139 | #ifdef CONFIG_ARM_VIRT_EXT | 140 | #ifdef CONFIG_ARM_VIRT_EXT |
140 | bl __hyp_stub_install @ get into SVC mode, reversibly | 141 | bl __hyp_stub_install @ get into SVC mode, reversibly |
@@ -699,9 +700,7 @@ __armv4_mmu_cache_on: | |||
699 | mrc p15, 0, r0, c1, c0, 0 @ read control reg | 700 | mrc p15, 0, r0, c1, c0, 0 @ read control reg |
700 | orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement | 701 | orr r0, r0, #0x5000 @ I-cache enable, RR cache replacement |
701 | orr r0, r0, #0x0030 | 702 | orr r0, r0, #0x0030 |
702 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 703 | ARM_BE8( orr r0, r0, #1 << 25 ) @ big-endian page tables |
703 | orr r0, r0, #1 << 25 @ big-endian page tables | ||
704 | #endif | ||
705 | bl __common_mmu_cache_on | 704 | bl __common_mmu_cache_on |
706 | mov r0, #0 | 705 | mov r0, #0 |
707 | mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs | 706 | mcr p15, 0, r0, c8, c7, 0 @ flush I,D TLBs |
@@ -728,9 +727,7 @@ __armv7_mmu_cache_on: | |||
728 | orr r0, r0, #1 << 22 @ U (v6 unaligned access model) | 727 | orr r0, r0, #1 << 22 @ U (v6 unaligned access model) |
729 | @ (needed for ARM1176) | 728 | @ (needed for ARM1176) |
730 | #ifdef CONFIG_MMU | 729 | #ifdef CONFIG_MMU |
731 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 730 | ARM_BE8( orr r0, r0, #1 << 25 ) @ big-endian page tables |
732 | orr r0, r0, #1 << 25 @ big-endian page tables | ||
733 | #endif | ||
734 | mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg | 731 | mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg |
735 | orrne r0, r0, #1 @ MMU enabled | 732 | orrne r0, r0, #1 @ MMU enabled |
736 | movne r1, #0xfffffffd @ domain 0 = client | 733 | movne r1, #0xfffffffd @ domain 0 = client |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index e95af3f5433b..802720e3e8fd 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -41,6 +41,8 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d33ek.dtb | |||
41 | dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb | 41 | dtb-$(CONFIG_ARCH_AT91) += sama5d34ek.dtb |
42 | dtb-$(CONFIG_ARCH_AT91) += sama5d35ek.dtb | 42 | dtb-$(CONFIG_ARCH_AT91) += sama5d35ek.dtb |
43 | 43 | ||
44 | dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb | ||
45 | |||
44 | dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb | 46 | dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb |
45 | dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb \ | 47 | dtb-$(CONFIG_ARCH_BCM) += bcm11351-brt.dtb \ |
46 | bcm28155-ap.dtb | 48 | bcm28155-ap.dtb |
diff --git a/arch/arm/boot/dts/armada-370-netgear-rn102.dts b/arch/arm/boot/dts/armada-370-netgear-rn102.dts index 05e4485a8225..8ac2ac1f69cc 100644 --- a/arch/arm/boot/dts/armada-370-netgear-rn102.dts +++ b/arch/arm/boot/dts/armada-370-netgear-rn102.dts | |||
@@ -27,6 +27,25 @@ | |||
27 | }; | 27 | }; |
28 | 28 | ||
29 | soc { | 29 | soc { |
30 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000 | ||
31 | MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000>; | ||
32 | |||
33 | pcie-controller { | ||
34 | status = "okay"; | ||
35 | |||
36 | /* Connected to Marvell SATA controller */ | ||
37 | pcie@1,0 { | ||
38 | /* Port 0, Lane 0 */ | ||
39 | status = "okay"; | ||
40 | }; | ||
41 | |||
42 | /* Connected to FL1009 USB 3.0 controller */ | ||
43 | pcie@2,0 { | ||
44 | /* Port 1, Lane 0 */ | ||
45 | status = "okay"; | ||
46 | }; | ||
47 | }; | ||
48 | |||
30 | internal-regs { | 49 | internal-regs { |
31 | serial@12000 { | 50 | serial@12000 { |
32 | clock-frequency = <200000000>; | 51 | clock-frequency = <200000000>; |
@@ -57,6 +76,11 @@ | |||
57 | marvell,pins = "mpp56"; | 76 | marvell,pins = "mpp56"; |
58 | marvell,function = "gpio"; | 77 | marvell,function = "gpio"; |
59 | }; | 78 | }; |
79 | |||
80 | poweroff: poweroff { | ||
81 | marvell,pins = "mpp8"; | ||
82 | marvell,function = "gpio"; | ||
83 | }; | ||
60 | }; | 84 | }; |
61 | 85 | ||
62 | mdio { | 86 | mdio { |
@@ -89,22 +113,6 @@ | |||
89 | pwm_polarity = <0>; | 113 | pwm_polarity = <0>; |
90 | }; | 114 | }; |
91 | }; | 115 | }; |
92 | |||
93 | pcie-controller { | ||
94 | status = "okay"; | ||
95 | |||
96 | /* Connected to Marvell SATA controller */ | ||
97 | pcie@1,0 { | ||
98 | /* Port 0, Lane 0 */ | ||
99 | status = "okay"; | ||
100 | }; | ||
101 | |||
102 | /* Connected to FL1009 USB 3.0 controller */ | ||
103 | pcie@2,0 { | ||
104 | /* Port 1, Lane 0 */ | ||
105 | status = "okay"; | ||
106 | }; | ||
107 | }; | ||
108 | }; | 116 | }; |
109 | }; | 117 | }; |
110 | 118 | ||
@@ -160,7 +168,7 @@ | |||
160 | button@1 { | 168 | button@1 { |
161 | label = "Power Button"; | 169 | label = "Power Button"; |
162 | linux,code = <116>; /* KEY_POWER */ | 170 | linux,code = <116>; /* KEY_POWER */ |
163 | gpios = <&gpio1 30 1>; | 171 | gpios = <&gpio1 30 0>; |
164 | }; | 172 | }; |
165 | 173 | ||
166 | button@2 { | 174 | button@2 { |
@@ -176,4 +184,11 @@ | |||
176 | }; | 184 | }; |
177 | }; | 185 | }; |
178 | 186 | ||
187 | gpio_poweroff { | ||
188 | compatible = "gpio-poweroff"; | ||
189 | pinctrl-0 = <&poweroff>; | ||
190 | pinctrl-names = "default"; | ||
191 | gpios = <&gpio0 8 1>; | ||
192 | }; | ||
193 | |||
179 | }; | 194 | }; |
diff --git a/arch/arm/boot/dts/armada-xp.dtsi b/arch/arm/boot/dts/armada-xp.dtsi index def125c0eeaa..3058522f5aad 100644 --- a/arch/arm/boot/dts/armada-xp.dtsi +++ b/arch/arm/boot/dts/armada-xp.dtsi | |||
@@ -70,6 +70,8 @@ | |||
70 | 70 | ||
71 | timer@20300 { | 71 | timer@20300 { |
72 | compatible = "marvell,armada-xp-timer"; | 72 | compatible = "marvell,armada-xp-timer"; |
73 | clocks = <&coreclk 2>, <&refclk>; | ||
74 | clock-names = "nbclk", "fixed"; | ||
73 | }; | 75 | }; |
74 | 76 | ||
75 | coreclk: mvebu-sar@18230 { | 77 | coreclk: mvebu-sar@18230 { |
@@ -169,4 +171,13 @@ | |||
169 | }; | 171 | }; |
170 | }; | 172 | }; |
171 | }; | 173 | }; |
174 | |||
175 | clocks { | ||
176 | /* 25 MHz reference crystal */ | ||
177 | refclk: oscillator { | ||
178 | compatible = "fixed-clock"; | ||
179 | #clock-cells = <0>; | ||
180 | clock-frequency = <25000000>; | ||
181 | }; | ||
182 | }; | ||
172 | }; | 183 | }; |
diff --git a/arch/arm/boot/dts/at91sam9x5.dtsi b/arch/arm/boot/dts/at91sam9x5.dtsi index cf78ac0b04b1..e74dc15efa9d 100644 --- a/arch/arm/boot/dts/at91sam9x5.dtsi +++ b/arch/arm/boot/dts/at91sam9x5.dtsi | |||
@@ -190,12 +190,12 @@ | |||
190 | AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA8 periph A */ | 190 | AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA8 periph A */ |
191 | }; | 191 | }; |
192 | 192 | ||
193 | pinctrl_uart2_rts: uart2_rts-0 { | 193 | pinctrl_usart2_rts: usart2_rts-0 { |
194 | atmel,pins = | 194 | atmel,pins = |
195 | <AT91_PIOB 0 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB0 periph B */ | 195 | <AT91_PIOB 0 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB0 periph B */ |
196 | }; | 196 | }; |
197 | 197 | ||
198 | pinctrl_uart2_cts: uart2_cts-0 { | 198 | pinctrl_usart2_cts: usart2_cts-0 { |
199 | atmel,pins = | 199 | atmel,pins = |
200 | <AT91_PIOB 1 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB1 periph B */ | 200 | <AT91_PIOB 1 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB1 periph B */ |
201 | }; | 201 | }; |
@@ -556,6 +556,7 @@ | |||
556 | interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>; | 556 | interrupts = <12 IRQ_TYPE_LEVEL_HIGH 0>; |
557 | dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(0)>; | 557 | dmas = <&dma0 1 AT91_DMA_CFG_PER_ID(0)>; |
558 | dma-names = "rxtx"; | 558 | dma-names = "rxtx"; |
559 | pinctrl-names = "default"; | ||
559 | #address-cells = <1>; | 560 | #address-cells = <1>; |
560 | #size-cells = <0>; | 561 | #size-cells = <0>; |
561 | status = "disabled"; | 562 | status = "disabled"; |
@@ -567,6 +568,7 @@ | |||
567 | interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>; | 568 | interrupts = <26 IRQ_TYPE_LEVEL_HIGH 0>; |
568 | dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(0)>; | 569 | dmas = <&dma1 1 AT91_DMA_CFG_PER_ID(0)>; |
569 | dma-names = "rxtx"; | 570 | dma-names = "rxtx"; |
571 | pinctrl-names = "default"; | ||
570 | #address-cells = <1>; | 572 | #address-cells = <1>; |
571 | #size-cells = <0>; | 573 | #size-cells = <0>; |
572 | status = "disabled"; | 574 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/atlas6.dtsi b/arch/arm/boot/dts/atlas6.dtsi index 8678e0c11119..6db4f81d4795 100644 --- a/arch/arm/boot/dts/atlas6.dtsi +++ b/arch/arm/boot/dts/atlas6.dtsi | |||
@@ -181,6 +181,8 @@ | |||
181 | interrupts = <17>; | 181 | interrupts = <17>; |
182 | fifosize = <128>; | 182 | fifosize = <128>; |
183 | clocks = <&clks 13>; | 183 | clocks = <&clks 13>; |
184 | sirf,uart-dma-rx-channel = <21>; | ||
185 | sirf,uart-dma-tx-channel = <2>; | ||
184 | }; | 186 | }; |
185 | 187 | ||
186 | uart1: uart@b0060000 { | 188 | uart1: uart@b0060000 { |
@@ -199,6 +201,8 @@ | |||
199 | interrupts = <19>; | 201 | interrupts = <19>; |
200 | fifosize = <128>; | 202 | fifosize = <128>; |
201 | clocks = <&clks 15>; | 203 | clocks = <&clks 15>; |
204 | sirf,uart-dma-rx-channel = <6>; | ||
205 | sirf,uart-dma-tx-channel = <7>; | ||
202 | }; | 206 | }; |
203 | 207 | ||
204 | usp0: usp@b0080000 { | 208 | usp0: usp@b0080000 { |
@@ -206,7 +210,10 @@ | |||
206 | compatible = "sirf,prima2-usp"; | 210 | compatible = "sirf,prima2-usp"; |
207 | reg = <0xb0080000 0x10000>; | 211 | reg = <0xb0080000 0x10000>; |
208 | interrupts = <20>; | 212 | interrupts = <20>; |
213 | fifosize = <128>; | ||
209 | clocks = <&clks 28>; | 214 | clocks = <&clks 28>; |
215 | sirf,usp-dma-rx-channel = <17>; | ||
216 | sirf,usp-dma-tx-channel = <18>; | ||
210 | }; | 217 | }; |
211 | 218 | ||
212 | usp1: usp@b0090000 { | 219 | usp1: usp@b0090000 { |
@@ -214,7 +221,10 @@ | |||
214 | compatible = "sirf,prima2-usp"; | 221 | compatible = "sirf,prima2-usp"; |
215 | reg = <0xb0090000 0x10000>; | 222 | reg = <0xb0090000 0x10000>; |
216 | interrupts = <21>; | 223 | interrupts = <21>; |
224 | fifosize = <128>; | ||
217 | clocks = <&clks 29>; | 225 | clocks = <&clks 29>; |
226 | sirf,usp-dma-rx-channel = <14>; | ||
227 | sirf,usp-dma-tx-channel = <15>; | ||
218 | }; | 228 | }; |
219 | 229 | ||
220 | dmac0: dma-controller@b00b0000 { | 230 | dmac0: dma-controller@b00b0000 { |
@@ -237,6 +247,8 @@ | |||
237 | compatible = "sirf,prima2-vip"; | 247 | compatible = "sirf,prima2-vip"; |
238 | reg = <0xb00C0000 0x10000>; | 248 | reg = <0xb00C0000 0x10000>; |
239 | clocks = <&clks 31>; | 249 | clocks = <&clks 31>; |
250 | interrupts = <14>; | ||
251 | sirf,vip-dma-rx-channel = <16>; | ||
240 | }; | 252 | }; |
241 | 253 | ||
242 | spi0: spi@b00d0000 { | 254 | spi0: spi@b00d0000 { |
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi index cf7aeaf89e9c..1335b2e1bed4 100644 --- a/arch/arm/boot/dts/kirkwood.dtsi +++ b/arch/arm/boot/dts/kirkwood.dtsi | |||
@@ -13,6 +13,7 @@ | |||
13 | cpu@0 { | 13 | cpu@0 { |
14 | device_type = "cpu"; | 14 | device_type = "cpu"; |
15 | compatible = "marvell,feroceon"; | 15 | compatible = "marvell,feroceon"; |
16 | reg = <0>; | ||
16 | clocks = <&core_clk 1>, <&core_clk 3>, <&gate_clk 11>; | 17 | clocks = <&core_clk 1>, <&core_clk 3>, <&gate_clk 11>; |
17 | clock-names = "cpu_clk", "ddrclk", "powersave"; | 18 | clock-names = "cpu_clk", "ddrclk", "powersave"; |
18 | }; | 19 | }; |
@@ -167,7 +168,7 @@ | |||
167 | xor@60900 { | 168 | xor@60900 { |
168 | compatible = "marvell,orion-xor"; | 169 | compatible = "marvell,orion-xor"; |
169 | reg = <0x60900 0x100 | 170 | reg = <0x60900 0x100 |
170 | 0xd0B00 0x100>; | 171 | 0x60B00 0x100>; |
171 | status = "okay"; | 172 | status = "okay"; |
172 | clocks = <&gate_clk 16>; | 173 | clocks = <&gate_clk 16>; |
173 | 174 | ||
diff --git a/arch/arm/boot/dts/prima2.dtsi b/arch/arm/boot/dts/prima2.dtsi index bbeb623fc2c6..27ed9f5144bc 100644 --- a/arch/arm/boot/dts/prima2.dtsi +++ b/arch/arm/boot/dts/prima2.dtsi | |||
@@ -171,7 +171,8 @@ | |||
171 | compatible = "simple-bus"; | 171 | compatible = "simple-bus"; |
172 | #address-cells = <1>; | 172 | #address-cells = <1>; |
173 | #size-cells = <1>; | 173 | #size-cells = <1>; |
174 | ranges = <0xb0000000 0xb0000000 0x180000>; | 174 | ranges = <0xb0000000 0xb0000000 0x180000>, |
175 | <0x56000000 0x56000000 0x1b00000>; | ||
175 | 176 | ||
176 | timer@b0020000 { | 177 | timer@b0020000 { |
177 | compatible = "sirf,prima2-tick"; | 178 | compatible = "sirf,prima2-tick"; |
@@ -196,25 +197,32 @@ | |||
196 | uart0: uart@b0050000 { | 197 | uart0: uart@b0050000 { |
197 | cell-index = <0>; | 198 | cell-index = <0>; |
198 | compatible = "sirf,prima2-uart"; | 199 | compatible = "sirf,prima2-uart"; |
199 | reg = <0xb0050000 0x10000>; | 200 | reg = <0xb0050000 0x1000>; |
200 | interrupts = <17>; | 201 | interrupts = <17>; |
202 | fifosize = <128>; | ||
201 | clocks = <&clks 13>; | 203 | clocks = <&clks 13>; |
204 | sirf,uart-dma-rx-channel = <21>; | ||
205 | sirf,uart-dma-tx-channel = <2>; | ||
202 | }; | 206 | }; |
203 | 207 | ||
204 | uart1: uart@b0060000 { | 208 | uart1: uart@b0060000 { |
205 | cell-index = <1>; | 209 | cell-index = <1>; |
206 | compatible = "sirf,prima2-uart"; | 210 | compatible = "sirf,prima2-uart"; |
207 | reg = <0xb0060000 0x10000>; | 211 | reg = <0xb0060000 0x1000>; |
208 | interrupts = <18>; | 212 | interrupts = <18>; |
213 | fifosize = <32>; | ||
209 | clocks = <&clks 14>; | 214 | clocks = <&clks 14>; |
210 | }; | 215 | }; |
211 | 216 | ||
212 | uart2: uart@b0070000 { | 217 | uart2: uart@b0070000 { |
213 | cell-index = <2>; | 218 | cell-index = <2>; |
214 | compatible = "sirf,prima2-uart"; | 219 | compatible = "sirf,prima2-uart"; |
215 | reg = <0xb0070000 0x10000>; | 220 | reg = <0xb0070000 0x1000>; |
216 | interrupts = <19>; | 221 | interrupts = <19>; |
222 | fifosize = <128>; | ||
217 | clocks = <&clks 15>; | 223 | clocks = <&clks 15>; |
224 | sirf,uart-dma-rx-channel = <6>; | ||
225 | sirf,uart-dma-tx-channel = <7>; | ||
218 | }; | 226 | }; |
219 | 227 | ||
220 | usp0: usp@b0080000 { | 228 | usp0: usp@b0080000 { |
@@ -222,7 +230,10 @@ | |||
222 | compatible = "sirf,prima2-usp"; | 230 | compatible = "sirf,prima2-usp"; |
223 | reg = <0xb0080000 0x10000>; | 231 | reg = <0xb0080000 0x10000>; |
224 | interrupts = <20>; | 232 | interrupts = <20>; |
233 | fifosize = <128>; | ||
225 | clocks = <&clks 28>; | 234 | clocks = <&clks 28>; |
235 | sirf,usp-dma-rx-channel = <17>; | ||
236 | sirf,usp-dma-tx-channel = <18>; | ||
226 | }; | 237 | }; |
227 | 238 | ||
228 | usp1: usp@b0090000 { | 239 | usp1: usp@b0090000 { |
@@ -230,7 +241,10 @@ | |||
230 | compatible = "sirf,prima2-usp"; | 241 | compatible = "sirf,prima2-usp"; |
231 | reg = <0xb0090000 0x10000>; | 242 | reg = <0xb0090000 0x10000>; |
232 | interrupts = <21>; | 243 | interrupts = <21>; |
244 | fifosize = <128>; | ||
233 | clocks = <&clks 29>; | 245 | clocks = <&clks 29>; |
246 | sirf,usp-dma-rx-channel = <14>; | ||
247 | sirf,usp-dma-tx-channel = <15>; | ||
234 | }; | 248 | }; |
235 | 249 | ||
236 | usp2: usp@b00a0000 { | 250 | usp2: usp@b00a0000 { |
@@ -238,7 +252,10 @@ | |||
238 | compatible = "sirf,prima2-usp"; | 252 | compatible = "sirf,prima2-usp"; |
239 | reg = <0xb00a0000 0x10000>; | 253 | reg = <0xb00a0000 0x10000>; |
240 | interrupts = <22>; | 254 | interrupts = <22>; |
255 | fifosize = <128>; | ||
241 | clocks = <&clks 30>; | 256 | clocks = <&clks 30>; |
257 | sirf,usp-dma-rx-channel = <10>; | ||
258 | sirf,usp-dma-tx-channel = <11>; | ||
242 | }; | 259 | }; |
243 | 260 | ||
244 | dmac0: dma-controller@b00b0000 { | 261 | dmac0: dma-controller@b00b0000 { |
@@ -261,6 +278,8 @@ | |||
261 | compatible = "sirf,prima2-vip"; | 278 | compatible = "sirf,prima2-vip"; |
262 | reg = <0xb00C0000 0x10000>; | 279 | reg = <0xb00C0000 0x10000>; |
263 | clocks = <&clks 31>; | 280 | clocks = <&clks 31>; |
281 | interrupts = <14>; | ||
282 | sirf,vip-dma-rx-channel = <16>; | ||
264 | }; | 283 | }; |
265 | 284 | ||
266 | spi0: spi@b00d0000 { | 285 | spi0: spi@b00d0000 { |
diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi index 6c26caa880f2..658fcc537576 100644 --- a/arch/arm/boot/dts/r8a73a4.dtsi +++ b/arch/arm/boot/dts/r8a73a4.dtsi | |||
@@ -193,7 +193,7 @@ | |||
193 | }; | 193 | }; |
194 | 194 | ||
195 | sdhi0: sdhi@ee100000 { | 195 | sdhi0: sdhi@ee100000 { |
196 | compatible = "renesas,r8a73a4-sdhi"; | 196 | compatible = "renesas,sdhi-r8a73a4"; |
197 | reg = <0 0xee100000 0 0x100>; | 197 | reg = <0 0xee100000 0 0x100>; |
198 | interrupt-parent = <&gic>; | 198 | interrupt-parent = <&gic>; |
199 | interrupts = <0 165 4>; | 199 | interrupts = <0 165 4>; |
@@ -202,7 +202,7 @@ | |||
202 | }; | 202 | }; |
203 | 203 | ||
204 | sdhi1: sdhi@ee120000 { | 204 | sdhi1: sdhi@ee120000 { |
205 | compatible = "renesas,r8a73a4-sdhi"; | 205 | compatible = "renesas,sdhi-r8a73a4"; |
206 | reg = <0 0xee120000 0 0x100>; | 206 | reg = <0 0xee120000 0 0x100>; |
207 | interrupt-parent = <&gic>; | 207 | interrupt-parent = <&gic>; |
208 | interrupts = <0 166 4>; | 208 | interrupts = <0 166 4>; |
@@ -211,7 +211,7 @@ | |||
211 | }; | 211 | }; |
212 | 212 | ||
213 | sdhi2: sdhi@ee140000 { | 213 | sdhi2: sdhi@ee140000 { |
214 | compatible = "renesas,r8a73a4-sdhi"; | 214 | compatible = "renesas,sdhi-r8a73a4"; |
215 | reg = <0 0xee140000 0 0x100>; | 215 | reg = <0 0xee140000 0 0x100>; |
216 | interrupt-parent = <&gic>; | 216 | interrupt-parent = <&gic>; |
217 | interrupts = <0 167 4>; | 217 | interrupts = <0 167 4>; |
diff --git a/arch/arm/boot/dts/r8a7778.dtsi b/arch/arm/boot/dts/r8a7778.dtsi index 45ac404ab6d8..3577aba82583 100644 --- a/arch/arm/boot/dts/r8a7778.dtsi +++ b/arch/arm/boot/dts/r8a7778.dtsi | |||
@@ -96,6 +96,5 @@ | |||
96 | pfc: pfc@fffc0000 { | 96 | pfc: pfc@fffc0000 { |
97 | compatible = "renesas,pfc-r8a7778"; | 97 | compatible = "renesas,pfc-r8a7778"; |
98 | reg = <0xfffc000 0x118>; | 98 | reg = <0xfffc000 0x118>; |
99 | #gpio-range-cells = <3>; | ||
100 | }; | 99 | }; |
101 | }; | 100 | }; |
diff --git a/arch/arm/boot/dts/r8a7779.dtsi b/arch/arm/boot/dts/r8a7779.dtsi index 23a62447359c..ebbe507fcbfa 100644 --- a/arch/arm/boot/dts/r8a7779.dtsi +++ b/arch/arm/boot/dts/r8a7779.dtsi | |||
@@ -188,7 +188,6 @@ | |||
188 | pfc: pfc@fffc0000 { | 188 | pfc: pfc@fffc0000 { |
189 | compatible = "renesas,pfc-r8a7779"; | 189 | compatible = "renesas,pfc-r8a7779"; |
190 | reg = <0xfffc0000 0x23c>; | 190 | reg = <0xfffc0000 0x23c>; |
191 | #gpio-range-cells = <3>; | ||
192 | }; | 191 | }; |
193 | 192 | ||
194 | thermal@ffc48000 { | 193 | thermal@ffc48000 { |
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi index 3b879e7c697c..413b4c29e782 100644 --- a/arch/arm/boot/dts/r8a7790.dtsi +++ b/arch/arm/boot/dts/r8a7790.dtsi | |||
@@ -148,11 +148,10 @@ | |||
148 | pfc: pfc@e6060000 { | 148 | pfc: pfc@e6060000 { |
149 | compatible = "renesas,pfc-r8a7790"; | 149 | compatible = "renesas,pfc-r8a7790"; |
150 | reg = <0 0xe6060000 0 0x250>; | 150 | reg = <0 0xe6060000 0 0x250>; |
151 | #gpio-range-cells = <3>; | ||
152 | }; | 151 | }; |
153 | 152 | ||
154 | sdhi0: sdhi@ee100000 { | 153 | sdhi0: sdhi@ee100000 { |
155 | compatible = "renesas,r8a7790-sdhi"; | 154 | compatible = "renesas,sdhi-r8a7790"; |
156 | reg = <0 0xee100000 0 0x100>; | 155 | reg = <0 0xee100000 0 0x100>; |
157 | interrupt-parent = <&gic>; | 156 | interrupt-parent = <&gic>; |
158 | interrupts = <0 165 4>; | 157 | interrupts = <0 165 4>; |
@@ -161,7 +160,7 @@ | |||
161 | }; | 160 | }; |
162 | 161 | ||
163 | sdhi1: sdhi@ee120000 { | 162 | sdhi1: sdhi@ee120000 { |
164 | compatible = "renesas,r8a7790-sdhi"; | 163 | compatible = "renesas,sdhi-r8a7790"; |
165 | reg = <0 0xee120000 0 0x100>; | 164 | reg = <0 0xee120000 0 0x100>; |
166 | interrupt-parent = <&gic>; | 165 | interrupt-parent = <&gic>; |
167 | interrupts = <0 166 4>; | 166 | interrupts = <0 166 4>; |
@@ -170,7 +169,7 @@ | |||
170 | }; | 169 | }; |
171 | 170 | ||
172 | sdhi2: sdhi@ee140000 { | 171 | sdhi2: sdhi@ee140000 { |
173 | compatible = "renesas,r8a7790-sdhi"; | 172 | compatible = "renesas,sdhi-r8a7790"; |
174 | reg = <0 0xee140000 0 0x100>; | 173 | reg = <0 0xee140000 0 0x100>; |
175 | interrupt-parent = <&gic>; | 174 | interrupt-parent = <&gic>; |
176 | interrupts = <0 167 4>; | 175 | interrupts = <0 167 4>; |
@@ -179,7 +178,7 @@ | |||
179 | }; | 178 | }; |
180 | 179 | ||
181 | sdhi3: sdhi@ee160000 { | 180 | sdhi3: sdhi@ee160000 { |
182 | compatible = "renesas,r8a7790-sdhi"; | 181 | compatible = "renesas,sdhi-r8a7790"; |
183 | reg = <0 0xee160000 0 0x100>; | 182 | reg = <0 0xee160000 0 0x100>; |
184 | interrupt-parent = <&gic>; | 183 | interrupt-parent = <&gic>; |
185 | interrupts = <0 168 4>; | 184 | interrupts = <0 168 4>; |
diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index ba59a5875a10..3955c7606a6f 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi | |||
@@ -196,7 +196,7 @@ | |||
196 | }; | 196 | }; |
197 | 197 | ||
198 | sdhi0: sdhi@ee100000 { | 198 | sdhi0: sdhi@ee100000 { |
199 | compatible = "renesas,r8a7740-sdhi"; | 199 | compatible = "renesas,sdhi-r8a7740"; |
200 | reg = <0xee100000 0x100>; | 200 | reg = <0xee100000 0x100>; |
201 | interrupt-parent = <&gic>; | 201 | interrupt-parent = <&gic>; |
202 | interrupts = <0 83 4 | 202 | interrupts = <0 83 4 |
@@ -208,7 +208,7 @@ | |||
208 | 208 | ||
209 | /* SDHI1 and SDHI2 have no CD pins, no need for CD IRQ */ | 209 | /* SDHI1 and SDHI2 have no CD pins, no need for CD IRQ */ |
210 | sdhi1: sdhi@ee120000 { | 210 | sdhi1: sdhi@ee120000 { |
211 | compatible = "renesas,r8a7740-sdhi"; | 211 | compatible = "renesas,sdhi-r8a7740"; |
212 | reg = <0xee120000 0x100>; | 212 | reg = <0xee120000 0x100>; |
213 | interrupt-parent = <&gic>; | 213 | interrupt-parent = <&gic>; |
214 | interrupts = <0 88 4 | 214 | interrupts = <0 88 4 |
@@ -219,7 +219,7 @@ | |||
219 | }; | 219 | }; |
220 | 220 | ||
221 | sdhi2: sdhi@ee140000 { | 221 | sdhi2: sdhi@ee140000 { |
222 | compatible = "renesas,r8a7740-sdhi"; | 222 | compatible = "renesas,sdhi-r8a7740"; |
223 | reg = <0xee140000 0x100>; | 223 | reg = <0xee140000 0x100>; |
224 | interrupt-parent = <&gic>; | 224 | interrupt-parent = <&gic>; |
225 | interrupts = <0 104 4 | 225 | interrupts = <0 104 4 |
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 117f955a2a06..8e1a0245907f 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c | |||
@@ -269,6 +269,11 @@ static const struct edmacc_param dummy_paramset = { | |||
269 | .ccnt = 1, | 269 | .ccnt = 1, |
270 | }; | 270 | }; |
271 | 271 | ||
272 | static const struct of_device_id edma_of_ids[] = { | ||
273 | { .compatible = "ti,edma3", }, | ||
274 | {} | ||
275 | }; | ||
276 | |||
272 | /*****************************************************************************/ | 277 | /*****************************************************************************/ |
273 | 278 | ||
274 | static void map_dmach_queue(unsigned ctlr, unsigned ch_no, | 279 | static void map_dmach_queue(unsigned ctlr, unsigned ch_no, |
@@ -560,14 +565,38 @@ static int reserve_contiguous_slots(int ctlr, unsigned int id, | |||
560 | static int prepare_unused_channel_list(struct device *dev, void *data) | 565 | static int prepare_unused_channel_list(struct device *dev, void *data) |
561 | { | 566 | { |
562 | struct platform_device *pdev = to_platform_device(dev); | 567 | struct platform_device *pdev = to_platform_device(dev); |
563 | int i, ctlr; | 568 | int i, count, ctlr; |
569 | struct of_phandle_args dma_spec; | ||
564 | 570 | ||
571 | if (dev->of_node) { | ||
572 | count = of_property_count_strings(dev->of_node, "dma-names"); | ||
573 | if (count < 0) | ||
574 | return 0; | ||
575 | for (i = 0; i < count; i++) { | ||
576 | if (of_parse_phandle_with_args(dev->of_node, "dmas", | ||
577 | "#dma-cells", i, | ||
578 | &dma_spec)) | ||
579 | continue; | ||
580 | |||
581 | if (!of_match_node(edma_of_ids, dma_spec.np)) { | ||
582 | of_node_put(dma_spec.np); | ||
583 | continue; | ||
584 | } | ||
585 | |||
586 | clear_bit(EDMA_CHAN_SLOT(dma_spec.args[0]), | ||
587 | edma_cc[0]->edma_unused); | ||
588 | of_node_put(dma_spec.np); | ||
589 | } | ||
590 | return 0; | ||
591 | } | ||
592 | |||
593 | /* For non-OF case */ | ||
565 | for (i = 0; i < pdev->num_resources; i++) { | 594 | for (i = 0; i < pdev->num_resources; i++) { |
566 | if ((pdev->resource[i].flags & IORESOURCE_DMA) && | 595 | if ((pdev->resource[i].flags & IORESOURCE_DMA) && |
567 | (int)pdev->resource[i].start >= 0) { | 596 | (int)pdev->resource[i].start >= 0) { |
568 | ctlr = EDMA_CTLR(pdev->resource[i].start); | 597 | ctlr = EDMA_CTLR(pdev->resource[i].start); |
569 | clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), | 598 | clear_bit(EDMA_CHAN_SLOT(pdev->resource[i].start), |
570 | edma_cc[ctlr]->edma_unused); | 599 | edma_cc[ctlr]->edma_unused); |
571 | } | 600 | } |
572 | } | 601 | } |
573 | 602 | ||
@@ -1762,11 +1791,6 @@ static int edma_probe(struct platform_device *pdev) | |||
1762 | return 0; | 1791 | return 0; |
1763 | } | 1792 | } |
1764 | 1793 | ||
1765 | static const struct of_device_id edma_of_ids[] = { | ||
1766 | { .compatible = "ti,edma3", }, | ||
1767 | {} | ||
1768 | }; | ||
1769 | |||
1770 | static struct platform_driver edma_driver = { | 1794 | static struct platform_driver edma_driver = { |
1771 | .driver = { | 1795 | .driver = { |
1772 | .name = "edma", | 1796 | .name = "edma", |
diff --git a/arch/arm/common/mcpm_head.S b/arch/arm/common/mcpm_head.S index 49dd5352fe70..e02db4b81a66 100644 --- a/arch/arm/common/mcpm_head.S +++ b/arch/arm/common/mcpm_head.S | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
17 | #include <asm/mcpm.h> | 17 | #include <asm/mcpm.h> |
18 | #include <asm/assembler.h> | ||
18 | 19 | ||
19 | #include "vlock.h" | 20 | #include "vlock.h" |
20 | 21 | ||
@@ -47,6 +48,7 @@ | |||
47 | 48 | ||
48 | ENTRY(mcpm_entry_point) | 49 | ENTRY(mcpm_entry_point) |
49 | 50 | ||
51 | ARM_BE8(setend be) | ||
50 | THUMB( adr r12, BSYM(1f) ) | 52 | THUMB( adr r12, BSYM(1f) ) |
51 | THUMB( bx r12 ) | 53 | THUMB( bx r12 ) |
52 | THUMB( .thumb ) | 54 | THUMB( .thumb ) |
diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig index f3935b46df29..119fc378fc52 100644 --- a/arch/arm/configs/multi_v7_defconfig +++ b/arch/arm/configs/multi_v7_defconfig | |||
@@ -135,6 +135,7 @@ CONFIG_MMC=y | |||
135 | CONFIG_MMC_ARMMMCI=y | 135 | CONFIG_MMC_ARMMMCI=y |
136 | CONFIG_MMC_SDHCI=y | 136 | CONFIG_MMC_SDHCI=y |
137 | CONFIG_MMC_SDHCI_PLTFM=y | 137 | CONFIG_MMC_SDHCI_PLTFM=y |
138 | CONFIG_MMC_SDHCI_ESDHC_IMX=y | ||
138 | CONFIG_MMC_SDHCI_TEGRA=y | 139 | CONFIG_MMC_SDHCI_TEGRA=y |
139 | CONFIG_MMC_SDHCI_SPEAR=y | 140 | CONFIG_MMC_SDHCI_SPEAR=y |
140 | CONFIG_MMC_OMAP=y | 141 | CONFIG_MMC_OMAP=y |
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index fcc1b5bf6979..5c2285160575 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -53,6 +53,13 @@ | |||
53 | #define put_byte_3 lsl #0 | 53 | #define put_byte_3 lsl #0 |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | /* Select code for any configuration running in BE8 mode */ | ||
57 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
58 | #define ARM_BE8(code...) code | ||
59 | #else | ||
60 | #define ARM_BE8(code...) | ||
61 | #endif | ||
62 | |||
56 | /* | 63 | /* |
57 | * Data preload for architectures that support it | 64 | * Data preload for architectures that support it |
58 | */ | 65 | */ |
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h index 55ffc3b850f4..134aa28b6f64 100644 --- a/arch/arm/include/asm/atomic.h +++ b/arch/arm/include/asm/atomic.h | |||
@@ -307,8 +307,8 @@ static inline void atomic64_add(u64 i, atomic64_t *v) | |||
307 | prefetchw(&v->counter); | 307 | prefetchw(&v->counter); |
308 | __asm__ __volatile__("@ atomic64_add\n" | 308 | __asm__ __volatile__("@ atomic64_add\n" |
309 | "1: ldrexd %0, %H0, [%3]\n" | 309 | "1: ldrexd %0, %H0, [%3]\n" |
310 | " adds %0, %0, %4\n" | 310 | " adds %Q0, %Q0, %Q4\n" |
311 | " adc %H0, %H0, %H4\n" | 311 | " adc %R0, %R0, %R4\n" |
312 | " strexd %1, %0, %H0, [%3]\n" | 312 | " strexd %1, %0, %H0, [%3]\n" |
313 | " teq %1, #0\n" | 313 | " teq %1, #0\n" |
314 | " bne 1b" | 314 | " bne 1b" |
@@ -326,8 +326,8 @@ static inline u64 atomic64_add_return(u64 i, atomic64_t *v) | |||
326 | 326 | ||
327 | __asm__ __volatile__("@ atomic64_add_return\n" | 327 | __asm__ __volatile__("@ atomic64_add_return\n" |
328 | "1: ldrexd %0, %H0, [%3]\n" | 328 | "1: ldrexd %0, %H0, [%3]\n" |
329 | " adds %0, %0, %4\n" | 329 | " adds %Q0, %Q0, %Q4\n" |
330 | " adc %H0, %H0, %H4\n" | 330 | " adc %R0, %R0, %R4\n" |
331 | " strexd %1, %0, %H0, [%3]\n" | 331 | " strexd %1, %0, %H0, [%3]\n" |
332 | " teq %1, #0\n" | 332 | " teq %1, #0\n" |
333 | " bne 1b" | 333 | " bne 1b" |
@@ -348,8 +348,8 @@ static inline void atomic64_sub(u64 i, atomic64_t *v) | |||
348 | prefetchw(&v->counter); | 348 | prefetchw(&v->counter); |
349 | __asm__ __volatile__("@ atomic64_sub\n" | 349 | __asm__ __volatile__("@ atomic64_sub\n" |
350 | "1: ldrexd %0, %H0, [%3]\n" | 350 | "1: ldrexd %0, %H0, [%3]\n" |
351 | " subs %0, %0, %4\n" | 351 | " subs %Q0, %Q0, %Q4\n" |
352 | " sbc %H0, %H0, %H4\n" | 352 | " sbc %R0, %R0, %R4\n" |
353 | " strexd %1, %0, %H0, [%3]\n" | 353 | " strexd %1, %0, %H0, [%3]\n" |
354 | " teq %1, #0\n" | 354 | " teq %1, #0\n" |
355 | " bne 1b" | 355 | " bne 1b" |
@@ -367,8 +367,8 @@ static inline u64 atomic64_sub_return(u64 i, atomic64_t *v) | |||
367 | 367 | ||
368 | __asm__ __volatile__("@ atomic64_sub_return\n" | 368 | __asm__ __volatile__("@ atomic64_sub_return\n" |
369 | "1: ldrexd %0, %H0, [%3]\n" | 369 | "1: ldrexd %0, %H0, [%3]\n" |
370 | " subs %0, %0, %4\n" | 370 | " subs %Q0, %Q0, %Q4\n" |
371 | " sbc %H0, %H0, %H4\n" | 371 | " sbc %R0, %R0, %R4\n" |
372 | " strexd %1, %0, %H0, [%3]\n" | 372 | " strexd %1, %0, %H0, [%3]\n" |
373 | " teq %1, #0\n" | 373 | " teq %1, #0\n" |
374 | " bne 1b" | 374 | " bne 1b" |
@@ -435,9 +435,9 @@ static inline u64 atomic64_dec_if_positive(atomic64_t *v) | |||
435 | 435 | ||
436 | __asm__ __volatile__("@ atomic64_dec_if_positive\n" | 436 | __asm__ __volatile__("@ atomic64_dec_if_positive\n" |
437 | "1: ldrexd %0, %H0, [%3]\n" | 437 | "1: ldrexd %0, %H0, [%3]\n" |
438 | " subs %0, %0, #1\n" | 438 | " subs %Q0, %Q0, #1\n" |
439 | " sbc %H0, %H0, #0\n" | 439 | " sbc %R0, %R0, #0\n" |
440 | " teq %H0, #0\n" | 440 | " teq %R0, #0\n" |
441 | " bmi 2f\n" | 441 | " bmi 2f\n" |
442 | " strexd %1, %0, %H0, [%3]\n" | 442 | " strexd %1, %0, %H0, [%3]\n" |
443 | " teq %1, #0\n" | 443 | " teq %1, #0\n" |
@@ -466,8 +466,8 @@ static inline int atomic64_add_unless(atomic64_t *v, u64 a, u64 u) | |||
466 | " teqeq %H0, %H5\n" | 466 | " teqeq %H0, %H5\n" |
467 | " moveq %1, #0\n" | 467 | " moveq %1, #0\n" |
468 | " beq 2f\n" | 468 | " beq 2f\n" |
469 | " adds %0, %0, %6\n" | 469 | " adds %Q0, %Q0, %Q6\n" |
470 | " adc %H0, %H0, %H6\n" | 470 | " adc %R0, %R0, %R6\n" |
471 | " strexd %2, %0, %H0, [%4]\n" | 471 | " strexd %2, %0, %H0, [%4]\n" |
472 | " teq %2, #0\n" | 472 | " teq %2, #0\n" |
473 | " bne 1b\n" | 473 | " bne 1b\n" |
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h index 7af5c6c3653a..b274bde24905 100644 --- a/arch/arm/include/asm/bug.h +++ b/arch/arm/include/asm/bug.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define _ASMARM_BUG_H | 2 | #define _ASMARM_BUG_H |
3 | 3 | ||
4 | #include <linux/linkage.h> | 4 | #include <linux/linkage.h> |
5 | #include <linux/types.h> | ||
6 | #include <asm/opcodes.h> | ||
5 | 7 | ||
6 | #ifdef CONFIG_BUG | 8 | #ifdef CONFIG_BUG |
7 | 9 | ||
@@ -12,10 +14,10 @@ | |||
12 | */ | 14 | */ |
13 | #ifdef CONFIG_THUMB2_KERNEL | 15 | #ifdef CONFIG_THUMB2_KERNEL |
14 | #define BUG_INSTR_VALUE 0xde02 | 16 | #define BUG_INSTR_VALUE 0xde02 |
15 | #define BUG_INSTR_TYPE ".hword " | 17 | #define BUG_INSTR(__value) __inst_thumb16(__value) |
16 | #else | 18 | #else |
17 | #define BUG_INSTR_VALUE 0xe7f001f2 | 19 | #define BUG_INSTR_VALUE 0xe7f001f2 |
18 | #define BUG_INSTR_TYPE ".word " | 20 | #define BUG_INSTR(__value) __inst_arm(__value) |
19 | #endif | 21 | #endif |
20 | 22 | ||
21 | 23 | ||
@@ -33,7 +35,7 @@ | |||
33 | 35 | ||
34 | #define __BUG(__file, __line, __value) \ | 36 | #define __BUG(__file, __line, __value) \ |
35 | do { \ | 37 | do { \ |
36 | asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n" \ | 38 | asm volatile("1:\t" BUG_INSTR(__value) "\n" \ |
37 | ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \ | 39 | ".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \ |
38 | "2:\t.asciz " #__file "\n" \ | 40 | "2:\t.asciz " #__file "\n" \ |
39 | ".popsection\n" \ | 41 | ".popsection\n" \ |
@@ -48,7 +50,7 @@ do { \ | |||
48 | 50 | ||
49 | #define __BUG(__file, __line, __value) \ | 51 | #define __BUG(__file, __line, __value) \ |
50 | do { \ | 52 | do { \ |
51 | asm volatile(BUG_INSTR_TYPE #__value); \ | 53 | asm volatile(BUG_INSTR(__value) "\n"); \ |
52 | unreachable(); \ | 54 | unreachable(); \ |
53 | } while (0) | 55 | } while (0) |
54 | #endif /* CONFIG_DEBUG_BUGVERBOSE */ | 56 | #endif /* CONFIG_DEBUG_BUGVERBOSE */ |
diff --git a/arch/arm/include/asm/hardware/coresight.h b/arch/arm/include/asm/hardware/coresight.h index 0cf7a6b842ff..ad774f37c47c 100644 --- a/arch/arm/include/asm/hardware/coresight.h +++ b/arch/arm/include/asm/hardware/coresight.h | |||
@@ -24,8 +24,8 @@ | |||
24 | #define TRACER_TIMEOUT 10000 | 24 | #define TRACER_TIMEOUT 10000 |
25 | 25 | ||
26 | #define etm_writel(t, v, x) \ | 26 | #define etm_writel(t, v, x) \ |
27 | (__raw_writel((v), (t)->etm_regs + (x))) | 27 | (writel_relaxed((v), (t)->etm_regs + (x))) |
28 | #define etm_readl(t, x) (__raw_readl((t)->etm_regs + (x))) | 28 | #define etm_readl(t, x) (readl_relaxed((t)->etm_regs + (x))) |
29 | 29 | ||
30 | /* CoreSight Management Registers */ | 30 | /* CoreSight Management Registers */ |
31 | #define CSMR_LOCKACCESS 0xfb0 | 31 | #define CSMR_LOCKACCESS 0xfb0 |
@@ -142,8 +142,8 @@ | |||
142 | #define ETBFF_TRIGFL BIT(10) | 142 | #define ETBFF_TRIGFL BIT(10) |
143 | 143 | ||
144 | #define etb_writel(t, v, x) \ | 144 | #define etb_writel(t, v, x) \ |
145 | (__raw_writel((v), (t)->etb_regs + (x))) | 145 | (writel_relaxed((v), (t)->etb_regs + (x))) |
146 | #define etb_readl(t, x) (__raw_readl((t)->etb_regs + (x))) | 146 | #define etb_readl(t, x) (readl_relaxed((t)->etb_regs + (x))) |
147 | 147 | ||
148 | #define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0) | 148 | #define etm_lock(t) do { etm_writel((t), 0, CSMR_LOCKACCESS); } while (0) |
149 | #define etm_unlock(t) \ | 149 | #define etm_unlock(t) \ |
diff --git a/arch/arm/include/asm/kgdb.h b/arch/arm/include/asm/kgdb.h index 48066ce9ea34..0a9d5dd93294 100644 --- a/arch/arm/include/asm/kgdb.h +++ b/arch/arm/include/asm/kgdb.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define __ARM_KGDB_H__ | 11 | #define __ARM_KGDB_H__ |
12 | 12 | ||
13 | #include <linux/ptrace.h> | 13 | #include <linux/ptrace.h> |
14 | #include <asm/opcodes.h> | ||
14 | 15 | ||
15 | /* | 16 | /* |
16 | * GDB assumes that we're a user process being debugged, so | 17 | * GDB assumes that we're a user process being debugged, so |
@@ -41,7 +42,7 @@ | |||
41 | 42 | ||
42 | static inline void arch_kgdb_breakpoint(void) | 43 | static inline void arch_kgdb_breakpoint(void) |
43 | { | 44 | { |
44 | asm(".word 0xe7ffdeff"); | 45 | asm(__inst_arm(0xe7ffdeff)); |
45 | } | 46 | } |
46 | 47 | ||
47 | extern void kgdb_handle_bus_error(void); | 48 | extern void kgdb_handle_bus_error(void); |
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h index 6f18da09668b..64fd15159b7d 100644 --- a/arch/arm/include/asm/mmu.h +++ b/arch/arm/include/asm/mmu.h | |||
@@ -16,7 +16,7 @@ typedef struct { | |||
16 | #ifdef CONFIG_CPU_HAS_ASID | 16 | #ifdef CONFIG_CPU_HAS_ASID |
17 | #define ASID_BITS 8 | 17 | #define ASID_BITS 8 |
18 | #define ASID_MASK ((~0ULL) << ASID_BITS) | 18 | #define ASID_MASK ((~0ULL) << ASID_BITS) |
19 | #define ASID(mm) ((mm)->context.id.counter & ~ASID_MASK) | 19 | #define ASID(mm) ((unsigned int)((mm)->context.id.counter & ~ASID_MASK)) |
20 | #else | 20 | #else |
21 | #define ASID(mm) (0) | 21 | #define ASID(mm) (0) |
22 | #endif | 22 | #endif |
diff --git a/arch/arm/include/debug/pl01x.S b/arch/arm/include/debug/pl01x.S index 37c6895b87e6..92ef808a2337 100644 --- a/arch/arm/include/debug/pl01x.S +++ b/arch/arm/include/debug/pl01x.S | |||
@@ -25,12 +25,14 @@ | |||
25 | 25 | ||
26 | .macro waituart,rd,rx | 26 | .macro waituart,rd,rx |
27 | 1001: ldr \rd, [\rx, #UART01x_FR] | 27 | 1001: ldr \rd, [\rx, #UART01x_FR] |
28 | ARM_BE8( rev \rd, \rd ) | ||
28 | tst \rd, #UART01x_FR_TXFF | 29 | tst \rd, #UART01x_FR_TXFF |
29 | bne 1001b | 30 | bne 1001b |
30 | .endm | 31 | .endm |
31 | 32 | ||
32 | .macro busyuart,rd,rx | 33 | .macro busyuart,rd,rx |
33 | 1001: ldr \rd, [\rx, #UART01x_FR] | 34 | 1001: ldr \rd, [\rx, #UART01x_FR] |
35 | ARM_BE8( rev \rd, \rd ) | ||
34 | tst \rd, #UART01x_FR_BUSY | 36 | tst \rd, #UART01x_FR_BUSY |
35 | bne 1001b | 37 | bne 1001b |
36 | .endm | 38 | .endm |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 9b818ca3610b..a30fc9be9e9e 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -17,7 +17,8 @@ CFLAGS_REMOVE_return_address.o = -pg | |||
17 | 17 | ||
18 | obj-y := elf.o entry-common.o irq.o opcodes.o \ | 18 | obj-y := elf.o entry-common.o irq.o opcodes.o \ |
19 | process.o ptrace.o return_address.o \ | 19 | process.o ptrace.o return_address.o \ |
20 | setup.o signal.o stacktrace.o sys_arm.o time.o traps.o | 20 | setup.o signal.o sigreturn_codes.o \ |
21 | stacktrace.o sys_arm.o time.o traps.o | ||
21 | 22 | ||
22 | obj-$(CONFIG_ATAGS) += atags_parse.o | 23 | obj-$(CONFIG_ATAGS) += atags_parse.o |
23 | obj-$(CONFIG_ATAGS_PROC) += atags_proc.o | 24 | obj-$(CONFIG_ATAGS_PROC) += atags_proc.o |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 9cbe70c8b0ef..55090fbb81a2 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -416,9 +416,8 @@ __und_usr: | |||
416 | bne __und_usr_thumb | 416 | bne __und_usr_thumb |
417 | sub r4, r2, #4 @ ARM instr at LR - 4 | 417 | sub r4, r2, #4 @ ARM instr at LR - 4 |
418 | 1: ldrt r0, [r4] | 418 | 1: ldrt r0, [r4] |
419 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 419 | ARM_BE8(rev r0, r0) @ little endian instruction |
420 | rev r0, r0 @ little endian instruction | 420 | |
421 | #endif | ||
422 | @ r0 = 32-bit ARM instruction which caused the exception | 421 | @ r0 = 32-bit ARM instruction which caused the exception |
423 | @ r2 = PC value for the following instruction (:= regs->ARM_pc) | 422 | @ r2 = PC value for the following instruction (:= regs->ARM_pc) |
424 | @ r4 = PC value for the faulting instruction | 423 | @ r4 = PC value for the faulting instruction |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index bc6bd9683ba4..a2dcafdf1bc8 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -393,9 +393,7 @@ ENTRY(vector_swi) | |||
393 | #else | 393 | #else |
394 | USER( ldr r10, [lr, #-4] ) @ get SWI instruction | 394 | USER( ldr r10, [lr, #-4] ) @ get SWI instruction |
395 | #endif | 395 | #endif |
396 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 396 | ARM_BE8(rev r10, r10) @ little endian instruction |
397 | rev r10, r10 @ little endian instruction | ||
398 | #endif | ||
399 | 397 | ||
400 | #elif defined(CONFIG_AEABI) | 398 | #elif defined(CONFIG_AEABI) |
401 | 399 | ||
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 32402ba6710a..e46330f4506a 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -77,6 +77,7 @@ | |||
77 | 77 | ||
78 | __HEAD | 78 | __HEAD |
79 | ENTRY(stext) | 79 | ENTRY(stext) |
80 | ARM_BE8(setend be ) @ ensure we are in BE8 mode | ||
80 | 81 | ||
81 | THUMB( adr r9, BSYM(1f) ) @ Kernel is always entered in ARM. | 82 | THUMB( adr r9, BSYM(1f) ) @ Kernel is always entered in ARM. |
82 | THUMB( bx r9 ) @ If this is a Thumb-2 kernel, | 83 | THUMB( bx r9 ) @ If this is a Thumb-2 kernel, |
@@ -352,6 +353,9 @@ ENTRY(secondary_startup) | |||
352 | * the processor type - there is no need to check the machine type | 353 | * the processor type - there is no need to check the machine type |
353 | * as it has already been validated by the primary processor. | 354 | * as it has already been validated by the primary processor. |
354 | */ | 355 | */ |
356 | |||
357 | ARM_BE8(setend be) @ ensure we are in BE8 mode | ||
358 | |||
355 | #ifdef CONFIG_ARM_VIRT_EXT | 359 | #ifdef CONFIG_ARM_VIRT_EXT |
356 | bl __hyp_stub_install_secondary | 360 | bl __hyp_stub_install_secondary |
357 | #endif | 361 | #endif |
@@ -602,15 +606,20 @@ __fixup_a_pv_table: | |||
602 | b 2f | 606 | b 2f |
603 | 1: add r7, r3 | 607 | 1: add r7, r3 |
604 | ldrh ip, [r7, #2] | 608 | ldrh ip, [r7, #2] |
609 | ARM_BE8(rev16 ip, ip) | ||
605 | tst ip, #0x4000 | 610 | tst ip, #0x4000 |
606 | and ip, #0x8f00 | 611 | and ip, #0x8f00 |
607 | orrne ip, r6 @ mask in offset bits 31-24 | 612 | orrne ip, r6 @ mask in offset bits 31-24 |
608 | orreq ip, r0 @ mask in offset bits 7-0 | 613 | orreq ip, r0 @ mask in offset bits 7-0 |
614 | ARM_BE8(rev16 ip, ip) | ||
609 | strh ip, [r7, #2] | 615 | strh ip, [r7, #2] |
610 | ldrheq ip, [r7] | 616 | bne 2f |
611 | biceq ip, #0x20 | 617 | ldrh ip, [r7] |
612 | orreq ip, ip, r0, lsr #16 | 618 | ARM_BE8(rev16 ip, ip) |
613 | strheq ip, [r7] | 619 | bic ip, #0x20 |
620 | orr ip, ip, r0, lsr #16 | ||
621 | ARM_BE8(rev16 ip, ip) | ||
622 | strh ip, [r7] | ||
614 | 2: cmp r4, r5 | 623 | 2: cmp r4, r5 |
615 | ldrcc r7, [r4], #4 @ use branch for delay slot | 624 | ldrcc r7, [r4], #4 @ use branch for delay slot |
616 | bcc 1b | 625 | bcc 1b |
@@ -619,11 +628,20 @@ __fixup_a_pv_table: | |||
619 | moveq r0, #0x400000 @ set bit 22, mov to mvn instruction | 628 | moveq r0, #0x400000 @ set bit 22, mov to mvn instruction |
620 | b 2f | 629 | b 2f |
621 | 1: ldr ip, [r7, r3] | 630 | 1: ldr ip, [r7, r3] |
631 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
632 | @ in BE8, we load data in BE, but instructions still in LE | ||
633 | bic ip, ip, #0xff000000 | ||
634 | tst ip, #0x000f0000 @ check the rotation field | ||
635 | orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 | ||
636 | biceq ip, ip, #0x00004000 @ clear bit 22 | ||
637 | orreq ip, ip, r0, lsl #24 @ mask in offset bits 7-0 | ||
638 | #else | ||
622 | bic ip, ip, #0x000000ff | 639 | bic ip, ip, #0x000000ff |
623 | tst ip, #0xf00 @ check the rotation field | 640 | tst ip, #0xf00 @ check the rotation field |
624 | orrne ip, ip, r6 @ mask in offset bits 31-24 | 641 | orrne ip, ip, r6 @ mask in offset bits 31-24 |
625 | biceq ip, ip, #0x400000 @ clear bit 22 | 642 | biceq ip, ip, #0x400000 @ clear bit 22 |
626 | orreq ip, ip, r0 @ mask in offset bits 7-0 | 643 | orreq ip, ip, r0 @ mask in offset bits 7-0 |
644 | #endif | ||
627 | str ip, [r7, r3] | 645 | str ip, [r7, r3] |
628 | 2: cmp r4, r5 | 646 | 2: cmp r4, r5 |
629 | ldrcc r7, [r4], #4 @ use branch for delay slot | 647 | ldrcc r7, [r4], #4 @ use branch for delay slot |
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 084dc8896986..5fdb4038f969 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/sections.h> | 24 | #include <asm/sections.h> |
25 | #include <asm/smp_plat.h> | 25 | #include <asm/smp_plat.h> |
26 | #include <asm/unwind.h> | 26 | #include <asm/unwind.h> |
27 | #include <asm/opcodes.h> | ||
27 | 28 | ||
28 | #ifdef CONFIG_XIP_KERNEL | 29 | #ifdef CONFIG_XIP_KERNEL |
29 | /* | 30 | /* |
@@ -60,6 +61,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
60 | Elf32_Sym *sym; | 61 | Elf32_Sym *sym; |
61 | const char *symname; | 62 | const char *symname; |
62 | s32 offset; | 63 | s32 offset; |
64 | u32 tmp; | ||
63 | #ifdef CONFIG_THUMB2_KERNEL | 65 | #ifdef CONFIG_THUMB2_KERNEL |
64 | u32 upper, lower, sign, j1, j2; | 66 | u32 upper, lower, sign, j1, j2; |
65 | #endif | 67 | #endif |
@@ -95,7 +97,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
95 | case R_ARM_PC24: | 97 | case R_ARM_PC24: |
96 | case R_ARM_CALL: | 98 | case R_ARM_CALL: |
97 | case R_ARM_JUMP24: | 99 | case R_ARM_JUMP24: |
98 | offset = (*(u32 *)loc & 0x00ffffff) << 2; | 100 | offset = __mem_to_opcode_arm(*(u32 *)loc); |
101 | offset = (offset & 0x00ffffff) << 2; | ||
99 | if (offset & 0x02000000) | 102 | if (offset & 0x02000000) |
100 | offset -= 0x04000000; | 103 | offset -= 0x04000000; |
101 | 104 | ||
@@ -111,9 +114,10 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
111 | } | 114 | } |
112 | 115 | ||
113 | offset >>= 2; | 116 | offset >>= 2; |
117 | offset &= 0x00ffffff; | ||
114 | 118 | ||
115 | *(u32 *)loc &= 0xff000000; | 119 | *(u32 *)loc &= __opcode_to_mem_arm(0xff000000); |
116 | *(u32 *)loc |= offset & 0x00ffffff; | 120 | *(u32 *)loc |= __opcode_to_mem_arm(offset); |
117 | break; | 121 | break; |
118 | 122 | ||
119 | case R_ARM_V4BX: | 123 | case R_ARM_V4BX: |
@@ -121,8 +125,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
121 | * other bits to re-code instruction as | 125 | * other bits to re-code instruction as |
122 | * MOV PC,Rm. | 126 | * MOV PC,Rm. |
123 | */ | 127 | */ |
124 | *(u32 *)loc &= 0xf000000f; | 128 | *(u32 *)loc &= __opcode_to_mem_arm(0xf000000f); |
125 | *(u32 *)loc |= 0x01a0f000; | 129 | *(u32 *)loc |= __opcode_to_mem_arm(0x01a0f000); |
126 | break; | 130 | break; |
127 | 131 | ||
128 | case R_ARM_PREL31: | 132 | case R_ARM_PREL31: |
@@ -132,7 +136,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
132 | 136 | ||
133 | case R_ARM_MOVW_ABS_NC: | 137 | case R_ARM_MOVW_ABS_NC: |
134 | case R_ARM_MOVT_ABS: | 138 | case R_ARM_MOVT_ABS: |
135 | offset = *(u32 *)loc; | 139 | offset = tmp = __mem_to_opcode_arm(*(u32 *)loc); |
136 | offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff); | 140 | offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff); |
137 | offset = (offset ^ 0x8000) - 0x8000; | 141 | offset = (offset ^ 0x8000) - 0x8000; |
138 | 142 | ||
@@ -140,16 +144,18 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
140 | if (ELF32_R_TYPE(rel->r_info) == R_ARM_MOVT_ABS) | 144 | if (ELF32_R_TYPE(rel->r_info) == R_ARM_MOVT_ABS) |
141 | offset >>= 16; | 145 | offset >>= 16; |
142 | 146 | ||
143 | *(u32 *)loc &= 0xfff0f000; | 147 | tmp &= 0xfff0f000; |
144 | *(u32 *)loc |= ((offset & 0xf000) << 4) | | 148 | tmp |= ((offset & 0xf000) << 4) | |
145 | (offset & 0x0fff); | 149 | (offset & 0x0fff); |
150 | |||
151 | *(u32 *)loc = __opcode_to_mem_arm(tmp); | ||
146 | break; | 152 | break; |
147 | 153 | ||
148 | #ifdef CONFIG_THUMB2_KERNEL | 154 | #ifdef CONFIG_THUMB2_KERNEL |
149 | case R_ARM_THM_CALL: | 155 | case R_ARM_THM_CALL: |
150 | case R_ARM_THM_JUMP24: | 156 | case R_ARM_THM_JUMP24: |
151 | upper = *(u16 *)loc; | 157 | upper = __mem_to_opcode_thumb16(*(u16 *)loc); |
152 | lower = *(u16 *)(loc + 2); | 158 | lower = __mem_to_opcode_thumb16(*(u16 *)(loc + 2)); |
153 | 159 | ||
154 | /* | 160 | /* |
155 | * 25 bit signed address range (Thumb-2 BL and B.W | 161 | * 25 bit signed address range (Thumb-2 BL and B.W |
@@ -198,17 +204,20 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
198 | sign = (offset >> 24) & 1; | 204 | sign = (offset >> 24) & 1; |
199 | j1 = sign ^ (~(offset >> 23) & 1); | 205 | j1 = sign ^ (~(offset >> 23) & 1); |
200 | j2 = sign ^ (~(offset >> 22) & 1); | 206 | j2 = sign ^ (~(offset >> 22) & 1); |
201 | *(u16 *)loc = (u16)((upper & 0xf800) | (sign << 10) | | 207 | upper = (u16)((upper & 0xf800) | (sign << 10) | |
202 | ((offset >> 12) & 0x03ff)); | 208 | ((offset >> 12) & 0x03ff)); |
203 | *(u16 *)(loc + 2) = (u16)((lower & 0xd000) | | 209 | lower = (u16)((lower & 0xd000) | |
204 | (j1 << 13) | (j2 << 11) | | 210 | (j1 << 13) | (j2 << 11) | |
205 | ((offset >> 1) & 0x07ff)); | 211 | ((offset >> 1) & 0x07ff)); |
212 | |||
213 | *(u16 *)loc = __opcode_to_mem_thumb16(upper); | ||
214 | *(u16 *)(loc + 2) = __opcode_to_mem_thumb16(lower); | ||
206 | break; | 215 | break; |
207 | 216 | ||
208 | case R_ARM_THM_MOVW_ABS_NC: | 217 | case R_ARM_THM_MOVW_ABS_NC: |
209 | case R_ARM_THM_MOVT_ABS: | 218 | case R_ARM_THM_MOVT_ABS: |
210 | upper = *(u16 *)loc; | 219 | upper = __mem_to_opcode_thumb16(*(u16 *)loc); |
211 | lower = *(u16 *)(loc + 2); | 220 | lower = __mem_to_opcode_thumb16(*(u16 *)(loc + 2)); |
212 | 221 | ||
213 | /* | 222 | /* |
214 | * MOVT/MOVW instructions encoding in Thumb-2: | 223 | * MOVT/MOVW instructions encoding in Thumb-2: |
@@ -229,12 +238,14 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, | |||
229 | if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_ABS) | 238 | if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_ABS) |
230 | offset >>= 16; | 239 | offset >>= 16; |
231 | 240 | ||
232 | *(u16 *)loc = (u16)((upper & 0xfbf0) | | 241 | upper = (u16)((upper & 0xfbf0) | |
233 | ((offset & 0xf000) >> 12) | | 242 | ((offset & 0xf000) >> 12) | |
234 | ((offset & 0x0800) >> 1)); | 243 | ((offset & 0x0800) >> 1)); |
235 | *(u16 *)(loc + 2) = (u16)((lower & 0x8f00) | | 244 | lower = (u16)((lower & 0x8f00) | |
236 | ((offset & 0x0700) << 4) | | 245 | ((offset & 0x0700) << 4) | |
237 | (offset & 0x00ff)); | 246 | (offset & 0x00ff)); |
247 | *(u16 *)loc = __opcode_to_mem_thumb16(upper); | ||
248 | *(u16 *)(loc + 2) = __opcode_to_mem_thumb16(lower); | ||
238 | break; | 249 | break; |
239 | #endif | 250 | #endif |
240 | 251 | ||
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index ab3304225272..64845fc4152a 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -21,29 +21,7 @@ | |||
21 | #include <asm/unistd.h> | 21 | #include <asm/unistd.h> |
22 | #include <asm/vfp.h> | 22 | #include <asm/vfp.h> |
23 | 23 | ||
24 | /* | 24 | extern const unsigned long sigreturn_codes[7]; |
25 | * For ARM syscalls, we encode the syscall number into the instruction. | ||
26 | */ | ||
27 | #define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE)) | ||
28 | #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE)) | ||
29 | |||
30 | /* | ||
31 | * With EABI, the syscall number has to be loaded into r7. | ||
32 | */ | ||
33 | #define MOV_R7_NR_SIGRETURN (0xe3a07000 | (__NR_sigreturn - __NR_SYSCALL_BASE)) | ||
34 | #define MOV_R7_NR_RT_SIGRETURN (0xe3a07000 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) | ||
35 | |||
36 | /* | ||
37 | * For Thumb syscalls, we pass the syscall number via r7. We therefore | ||
38 | * need two 16-bit instructions. | ||
39 | */ | ||
40 | #define SWI_THUMB_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_sigreturn - __NR_SYSCALL_BASE)) | ||
41 | #define SWI_THUMB_RT_SIGRETURN (0xdf00 << 16 | 0x2700 | (__NR_rt_sigreturn - __NR_SYSCALL_BASE)) | ||
42 | |||
43 | static const unsigned long sigreturn_codes[7] = { | ||
44 | MOV_R7_NR_SIGRETURN, SWI_SYS_SIGRETURN, SWI_THUMB_SIGRETURN, | ||
45 | MOV_R7_NR_RT_SIGRETURN, SWI_SYS_RT_SIGRETURN, SWI_THUMB_RT_SIGRETURN, | ||
46 | }; | ||
47 | 25 | ||
48 | static unsigned long signal_return_offset; | 26 | static unsigned long signal_return_offset; |
49 | 27 | ||
diff --git a/arch/arm/kernel/sigreturn_codes.S b/arch/arm/kernel/sigreturn_codes.S new file mode 100644 index 000000000000..3c5d0f2170fd --- /dev/null +++ b/arch/arm/kernel/sigreturn_codes.S | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * sigreturn_codes.S - code sinpets for sigreturn syscalls | ||
3 | * | ||
4 | * Created by: Victor Kamensky, 2013-08-13 | ||
5 | * Copyright: (C) 2013 Linaro Limited | ||
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 | * 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 | |||
17 | #include <asm/unistd.h> | ||
18 | |||
19 | /* | ||
20 | * For ARM syscalls, we encode the syscall number into the instruction. | ||
21 | * With EABI, the syscall number has to be loaded into r7. As result | ||
22 | * ARM syscall sequence snippet will have move and svc in .arm encoding | ||
23 | * | ||
24 | * For Thumb syscalls, we pass the syscall number via r7. We therefore | ||
25 | * need two 16-bit instructions in .thumb encoding | ||
26 | * | ||
27 | * Please note sigreturn_codes code are not executed in place. Instead | ||
28 | * they just copied by kernel into appropriate places. Code inside of | ||
29 | * arch/arm/kernel/signal.c is very sensitive to layout of these code | ||
30 | * snippets. | ||
31 | */ | ||
32 | |||
33 | #if __LINUX_ARM_ARCH__ <= 4 | ||
34 | /* | ||
35 | * Note we manually set minimally required arch that supports | ||
36 | * required thumb opcodes for early arch versions. It is OK | ||
37 | * for this file to be used in combination with other | ||
38 | * lower arch variants, since these code snippets are only | ||
39 | * used as input data. | ||
40 | */ | ||
41 | .arch armv4t | ||
42 | #endif | ||
43 | |||
44 | .section .rodata | ||
45 | .global sigreturn_codes | ||
46 | .type sigreturn_codes, #object | ||
47 | |||
48 | .arm | ||
49 | |||
50 | sigreturn_codes: | ||
51 | |||
52 | /* ARM sigreturn syscall code snippet */ | ||
53 | mov r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) | ||
54 | swi #(__NR_sigreturn)|(__NR_OABI_SYSCALL_BASE) | ||
55 | |||
56 | /* Thumb sigreturn syscall code snippet */ | ||
57 | .thumb | ||
58 | movs r7, #(__NR_sigreturn - __NR_SYSCALL_BASE) | ||
59 | swi #0 | ||
60 | |||
61 | /* ARM sigreturn_rt syscall code snippet */ | ||
62 | .arm | ||
63 | mov r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) | ||
64 | swi #(__NR_rt_sigreturn)|(__NR_OABI_SYSCALL_BASE) | ||
65 | |||
66 | /* Thumb sigreturn_rt syscall code snippet */ | ||
67 | .thumb | ||
68 | movs r7, #(__NR_rt_sigreturn - __NR_SYSCALL_BASE) | ||
69 | swi #0 | ||
70 | |||
71 | /* | ||
72 | * Note on addtional space: setup_return in signal.c | ||
73 | * algorithm uses two words copy regardless whether | ||
74 | * it is thumb case or not, so we need additional | ||
75 | * word after real last entry. | ||
76 | */ | ||
77 | .arm | ||
78 | .space 4 | ||
79 | |||
80 | .size sigreturn_codes, . - sigreturn_codes | ||
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 622460201911..b907d9b790ab 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S | |||
@@ -126,6 +126,7 @@ ENDPROC(cpu_resume_after_mmu) | |||
126 | .data | 126 | .data |
127 | .align | 127 | .align |
128 | ENTRY(cpu_resume) | 128 | ENTRY(cpu_resume) |
129 | ARM_BE8(setend be) @ ensure we are in BE mode | ||
129 | mov r1, #0 | 130 | mov r1, #0 |
130 | ALT_SMP(mrc p15, 0, r0, c0, c0, 5) | 131 | ALT_SMP(mrc p15, 0, r0, c0, c0, 5) |
131 | ALT_UP_B(1f) | 132 | ALT_UP_B(1f) |
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c index 5bc1a63284e3..1aafa0d785eb 100644 --- a/arch/arm/kernel/smp_scu.c +++ b/arch/arm/kernel/smp_scu.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | unsigned int __init scu_get_core_count(void __iomem *scu_base) | 29 | unsigned int __init scu_get_core_count(void __iomem *scu_base) |
30 | { | 30 | { |
31 | unsigned int ncores = __raw_readl(scu_base + SCU_CONFIG); | 31 | unsigned int ncores = readl_relaxed(scu_base + SCU_CONFIG); |
32 | return (ncores & 0x03) + 1; | 32 | return (ncores & 0x03) + 1; |
33 | } | 33 | } |
34 | 34 | ||
@@ -42,19 +42,19 @@ void scu_enable(void __iomem *scu_base) | |||
42 | #ifdef CONFIG_ARM_ERRATA_764369 | 42 | #ifdef CONFIG_ARM_ERRATA_764369 |
43 | /* Cortex-A9 only */ | 43 | /* Cortex-A9 only */ |
44 | if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090) { | 44 | if ((read_cpuid_id() & 0xff0ffff0) == 0x410fc090) { |
45 | scu_ctrl = __raw_readl(scu_base + 0x30); | 45 | scu_ctrl = readl_relaxed(scu_base + 0x30); |
46 | if (!(scu_ctrl & 1)) | 46 | if (!(scu_ctrl & 1)) |
47 | __raw_writel(scu_ctrl | 0x1, scu_base + 0x30); | 47 | writel_relaxed(scu_ctrl | 0x1, scu_base + 0x30); |
48 | } | 48 | } |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | scu_ctrl = __raw_readl(scu_base + SCU_CTRL); | 51 | scu_ctrl = readl_relaxed(scu_base + SCU_CTRL); |
52 | /* already enabled? */ | 52 | /* already enabled? */ |
53 | if (scu_ctrl & 1) | 53 | if (scu_ctrl & 1) |
54 | return; | 54 | return; |
55 | 55 | ||
56 | scu_ctrl |= 1; | 56 | scu_ctrl |= 1; |
57 | __raw_writel(scu_ctrl, scu_base + SCU_CTRL); | 57 | writel_relaxed(scu_ctrl, scu_base + SCU_CTRL); |
58 | 58 | ||
59 | /* | 59 | /* |
60 | * Ensure that the data accessed by CPU0 before the SCU was | 60 | * Ensure that the data accessed by CPU0 before the SCU was |
@@ -80,9 +80,9 @@ int scu_power_mode(void __iomem *scu_base, unsigned int mode) | |||
80 | if (mode > 3 || mode == 1 || cpu > 3) | 80 | if (mode > 3 || mode == 1 || cpu > 3) |
81 | return -EINVAL; | 81 | return -EINVAL; |
82 | 82 | ||
83 | val = __raw_readb(scu_base + SCU_CPU_STATUS + cpu) & ~0x03; | 83 | val = readb_relaxed(scu_base + SCU_CPU_STATUS + cpu) & ~0x03; |
84 | val |= mode; | 84 | val |= mode; |
85 | __raw_writeb(val, scu_base + SCU_CPU_STATUS + cpu); | 85 | writeb_relaxed(val, scu_base + SCU_CPU_STATUS + cpu); |
86 | 86 | ||
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index 2985c9f0905d..6591e26fc13f 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -45,7 +45,7 @@ static void twd_set_mode(enum clock_event_mode mode, | |||
45 | case CLOCK_EVT_MODE_PERIODIC: | 45 | case CLOCK_EVT_MODE_PERIODIC: |
46 | ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE | 46 | ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE |
47 | | TWD_TIMER_CONTROL_PERIODIC; | 47 | | TWD_TIMER_CONTROL_PERIODIC; |
48 | __raw_writel(DIV_ROUND_CLOSEST(twd_timer_rate, HZ), | 48 | writel_relaxed(DIV_ROUND_CLOSEST(twd_timer_rate, HZ), |
49 | twd_base + TWD_TIMER_LOAD); | 49 | twd_base + TWD_TIMER_LOAD); |
50 | break; | 50 | break; |
51 | case CLOCK_EVT_MODE_ONESHOT: | 51 | case CLOCK_EVT_MODE_ONESHOT: |
@@ -58,18 +58,18 @@ static void twd_set_mode(enum clock_event_mode mode, | |||
58 | ctrl = 0; | 58 | ctrl = 0; |
59 | } | 59 | } |
60 | 60 | ||
61 | __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL); | 61 | writel_relaxed(ctrl, twd_base + TWD_TIMER_CONTROL); |
62 | } | 62 | } |
63 | 63 | ||
64 | static int twd_set_next_event(unsigned long evt, | 64 | static int twd_set_next_event(unsigned long evt, |
65 | struct clock_event_device *unused) | 65 | struct clock_event_device *unused) |
66 | { | 66 | { |
67 | unsigned long ctrl = __raw_readl(twd_base + TWD_TIMER_CONTROL); | 67 | unsigned long ctrl = readl_relaxed(twd_base + TWD_TIMER_CONTROL); |
68 | 68 | ||
69 | ctrl |= TWD_TIMER_CONTROL_ENABLE; | 69 | ctrl |= TWD_TIMER_CONTROL_ENABLE; |
70 | 70 | ||
71 | __raw_writel(evt, twd_base + TWD_TIMER_COUNTER); | 71 | writel_relaxed(evt, twd_base + TWD_TIMER_COUNTER); |
72 | __raw_writel(ctrl, twd_base + TWD_TIMER_CONTROL); | 72 | writel_relaxed(ctrl, twd_base + TWD_TIMER_CONTROL); |
73 | 73 | ||
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
@@ -82,8 +82,8 @@ static int twd_set_next_event(unsigned long evt, | |||
82 | */ | 82 | */ |
83 | static int twd_timer_ack(void) | 83 | static int twd_timer_ack(void) |
84 | { | 84 | { |
85 | if (__raw_readl(twd_base + TWD_TIMER_INTSTAT)) { | 85 | if (readl_relaxed(twd_base + TWD_TIMER_INTSTAT)) { |
86 | __raw_writel(1, twd_base + TWD_TIMER_INTSTAT); | 86 | writel_relaxed(1, twd_base + TWD_TIMER_INTSTAT); |
87 | return 1; | 87 | return 1; |
88 | } | 88 | } |
89 | 89 | ||
@@ -211,15 +211,15 @@ static void twd_calibrate_rate(void) | |||
211 | waitjiffies += 5; | 211 | waitjiffies += 5; |
212 | 212 | ||
213 | /* enable, no interrupt or reload */ | 213 | /* enable, no interrupt or reload */ |
214 | __raw_writel(0x1, twd_base + TWD_TIMER_CONTROL); | 214 | writel_relaxed(0x1, twd_base + TWD_TIMER_CONTROL); |
215 | 215 | ||
216 | /* maximum value */ | 216 | /* maximum value */ |
217 | __raw_writel(0xFFFFFFFFU, twd_base + TWD_TIMER_COUNTER); | 217 | writel_relaxed(0xFFFFFFFFU, twd_base + TWD_TIMER_COUNTER); |
218 | 218 | ||
219 | while (get_jiffies_64() < waitjiffies) | 219 | while (get_jiffies_64() < waitjiffies) |
220 | udelay(10); | 220 | udelay(10); |
221 | 221 | ||
222 | count = __raw_readl(twd_base + TWD_TIMER_COUNTER); | 222 | count = readl_relaxed(twd_base + TWD_TIMER_COUNTER); |
223 | 223 | ||
224 | twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5); | 224 | twd_timer_rate = (0xFFFFFFFFU - count) * (HZ / 5); |
225 | 225 | ||
@@ -277,7 +277,7 @@ static void twd_timer_setup(void) | |||
277 | * bother with the below. | 277 | * bother with the below. |
278 | */ | 278 | */ |
279 | if (per_cpu(percpu_setup_called, cpu)) { | 279 | if (per_cpu(percpu_setup_called, cpu)) { |
280 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); | 280 | writel_relaxed(0, twd_base + TWD_TIMER_CONTROL); |
281 | clockevents_register_device(clk); | 281 | clockevents_register_device(clk); |
282 | enable_percpu_irq(clk->irq, 0); | 282 | enable_percpu_irq(clk->irq, 0); |
283 | return; | 283 | return; |
@@ -290,7 +290,7 @@ static void twd_timer_setup(void) | |||
290 | * The following is done once per CPU the first time .setup() is | 290 | * The following is done once per CPU the first time .setup() is |
291 | * called. | 291 | * called. |
292 | */ | 292 | */ |
293 | __raw_writel(0, twd_base + TWD_TIMER_CONTROL); | 293 | writel_relaxed(0, twd_base + TWD_TIMER_CONTROL); |
294 | 294 | ||
295 | clk->name = "local_timer"; | 295 | clk->name = "local_timer"; |
296 | clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | | 296 | clk->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT | |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 8fcda140358d..6125f259b7b5 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <asm/unwind.h> | 34 | #include <asm/unwind.h> |
35 | #include <asm/tls.h> | 35 | #include <asm/tls.h> |
36 | #include <asm/system_misc.h> | 36 | #include <asm/system_misc.h> |
37 | #include <asm/opcodes.h> | ||
37 | 38 | ||
38 | static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; | 39 | static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" }; |
39 | 40 | ||
@@ -341,15 +342,17 @@ void arm_notify_die(const char *str, struct pt_regs *regs, | |||
341 | int is_valid_bugaddr(unsigned long pc) | 342 | int is_valid_bugaddr(unsigned long pc) |
342 | { | 343 | { |
343 | #ifdef CONFIG_THUMB2_KERNEL | 344 | #ifdef CONFIG_THUMB2_KERNEL |
344 | unsigned short bkpt; | 345 | u16 bkpt; |
346 | u16 insn = __opcode_to_mem_thumb16(BUG_INSTR_VALUE); | ||
345 | #else | 347 | #else |
346 | unsigned long bkpt; | 348 | u32 bkpt; |
349 | u32 insn = __opcode_to_mem_arm(BUG_INSTR_VALUE); | ||
347 | #endif | 350 | #endif |
348 | 351 | ||
349 | if (probe_kernel_address((unsigned *)pc, bkpt)) | 352 | if (probe_kernel_address((unsigned *)pc, bkpt)) |
350 | return 0; | 353 | return 0; |
351 | 354 | ||
352 | return bkpt == BUG_INSTR_VALUE; | 355 | return bkpt == insn; |
353 | } | 356 | } |
354 | 357 | ||
355 | #endif | 358 | #endif |
@@ -402,25 +405,28 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs) | |||
402 | if (processor_mode(regs) == SVC_MODE) { | 405 | if (processor_mode(regs) == SVC_MODE) { |
403 | #ifdef CONFIG_THUMB2_KERNEL | 406 | #ifdef CONFIG_THUMB2_KERNEL |
404 | if (thumb_mode(regs)) { | 407 | if (thumb_mode(regs)) { |
405 | instr = ((u16 *)pc)[0]; | 408 | instr = __mem_to_opcode_thumb16(((u16 *)pc)[0]); |
406 | if (is_wide_instruction(instr)) { | 409 | if (is_wide_instruction(instr)) { |
407 | instr <<= 16; | 410 | u16 inst2; |
408 | instr |= ((u16 *)pc)[1]; | 411 | inst2 = __mem_to_opcode_thumb16(((u16 *)pc)[1]); |
412 | instr = __opcode_thumb32_compose(instr, inst2); | ||
409 | } | 413 | } |
410 | } else | 414 | } else |
411 | #endif | 415 | #endif |
412 | instr = *(u32 *) pc; | 416 | instr = __mem_to_opcode_arm(*(u32 *) pc); |
413 | } else if (thumb_mode(regs)) { | 417 | } else if (thumb_mode(regs)) { |
414 | if (get_user(instr, (u16 __user *)pc)) | 418 | if (get_user(instr, (u16 __user *)pc)) |
415 | goto die_sig; | 419 | goto die_sig; |
420 | instr = __mem_to_opcode_thumb16(instr); | ||
416 | if (is_wide_instruction(instr)) { | 421 | if (is_wide_instruction(instr)) { |
417 | unsigned int instr2; | 422 | unsigned int instr2; |
418 | if (get_user(instr2, (u16 __user *)pc+1)) | 423 | if (get_user(instr2, (u16 __user *)pc+1)) |
419 | goto die_sig; | 424 | goto die_sig; |
420 | instr <<= 16; | 425 | instr2 = __mem_to_opcode_thumb16(instr2); |
421 | instr |= instr2; | 426 | instr = __opcode_thumb32_compose(instr, instr2); |
422 | } | 427 | } |
423 | } else if (get_user(instr, (u32 __user *)pc)) { | 428 | } else if (get_user(instr, (u32 __user *)pc)) { |
429 | instr = __mem_to_opcode_arm(instr); | ||
424 | goto die_sig; | 430 | goto die_sig; |
425 | } | 431 | } |
426 | 432 | ||
diff --git a/arch/arm/kvm/reset.c b/arch/arm/kvm/reset.c index 71e08baee209..c02ba4af599f 100644 --- a/arch/arm/kvm/reset.c +++ b/arch/arm/kvm/reset.c | |||
@@ -58,14 +58,14 @@ static const struct kvm_irq_level a15_vtimer_irq = { | |||
58 | */ | 58 | */ |
59 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu) | 59 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu) |
60 | { | 60 | { |
61 | struct kvm_regs *cpu_reset; | 61 | struct kvm_regs *reset_regs; |
62 | const struct kvm_irq_level *cpu_vtimer_irq; | 62 | const struct kvm_irq_level *cpu_vtimer_irq; |
63 | 63 | ||
64 | switch (vcpu->arch.target) { | 64 | switch (vcpu->arch.target) { |
65 | case KVM_ARM_TARGET_CORTEX_A15: | 65 | case KVM_ARM_TARGET_CORTEX_A15: |
66 | if (vcpu->vcpu_id > a15_max_cpu_idx) | 66 | if (vcpu->vcpu_id > a15_max_cpu_idx) |
67 | return -EINVAL; | 67 | return -EINVAL; |
68 | cpu_reset = &a15_regs_reset; | 68 | reset_regs = &a15_regs_reset; |
69 | vcpu->arch.midr = read_cpuid_id(); | 69 | vcpu->arch.midr = read_cpuid_id(); |
70 | cpu_vtimer_irq = &a15_vtimer_irq; | 70 | cpu_vtimer_irq = &a15_vtimer_irq; |
71 | break; | 71 | break; |
@@ -74,7 +74,7 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | /* Reset core registers */ | 76 | /* Reset core registers */ |
77 | memcpy(&vcpu->arch.regs, cpu_reset, sizeof(vcpu->arch.regs)); | 77 | memcpy(&vcpu->arch.regs, reset_regs, sizeof(vcpu->arch.regs)); |
78 | 78 | ||
79 | /* Reset CP15 registers */ | 79 | /* Reset CP15 registers */ |
80 | kvm_reset_coprocs(vcpu); | 80 | kvm_reset_coprocs(vcpu); |
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c index 180b3024bec3..f607deb40f4d 100644 --- a/arch/arm/mach-at91/at91rm9200_time.c +++ b/arch/arm/mach-at91/at91rm9200_time.c | |||
@@ -93,7 +93,7 @@ static irqreturn_t at91rm9200_timer_interrupt(int irq, void *dev_id) | |||
93 | 93 | ||
94 | static struct irqaction at91rm9200_timer_irq = { | 94 | static struct irqaction at91rm9200_timer_irq = { |
95 | .name = "at91_tick", | 95 | .name = "at91_tick", |
96 | .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | 96 | .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL, |
97 | .handler = at91rm9200_timer_interrupt, | 97 | .handler = at91rm9200_timer_interrupt, |
98 | .irq = NR_IRQS_LEGACY + AT91_ID_SYS, | 98 | .irq = NR_IRQS_LEGACY + AT91_ID_SYS, |
99 | }; | 99 | }; |
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c index 3a4bc2e1a65e..bb392320a0dd 100644 --- a/arch/arm/mach-at91/at91sam926x_time.c +++ b/arch/arm/mach-at91/at91sam926x_time.c | |||
@@ -171,7 +171,7 @@ static irqreturn_t at91sam926x_pit_interrupt(int irq, void *dev_id) | |||
171 | 171 | ||
172 | static struct irqaction at91sam926x_pit_irq = { | 172 | static struct irqaction at91sam926x_pit_irq = { |
173 | .name = "at91_tick", | 173 | .name = "at91_tick", |
174 | .flags = IRQF_SHARED | IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, | 174 | .flags = IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL, |
175 | .handler = at91sam926x_pit_interrupt, | 175 | .handler = at91sam926x_pit_interrupt, |
176 | .irq = NR_IRQS_LEGACY + AT91_ID_SYS, | 176 | .irq = NR_IRQS_LEGACY + AT91_ID_SYS, |
177 | }; | 177 | }; |
diff --git a/arch/arm/mach-at91/at91sam9g45_reset.S b/arch/arm/mach-at91/at91sam9g45_reset.S index 721a1a34dd1d..c40c1e2ef80f 100644 --- a/arch/arm/mach-at91/at91sam9g45_reset.S +++ b/arch/arm/mach-at91/at91sam9g45_reset.S | |||
@@ -16,11 +16,17 @@ | |||
16 | #include "at91_rstc.h" | 16 | #include "at91_rstc.h" |
17 | .arm | 17 | .arm |
18 | 18 | ||
19 | /* | ||
20 | * at91_ramc_base is an array void* | ||
21 | * init at NULL if only one DDR controler is present in or DT | ||
22 | */ | ||
19 | .globl at91sam9g45_restart | 23 | .globl at91sam9g45_restart |
20 | 24 | ||
21 | at91sam9g45_restart: | 25 | at91sam9g45_restart: |
22 | ldr r5, =at91_ramc_base @ preload constants | 26 | ldr r5, =at91_ramc_base @ preload constants |
23 | ldr r0, [r5] | 27 | ldr r0, [r5] |
28 | ldr r5, [r5, #4] @ ddr1 | ||
29 | cmp r5, #0 | ||
24 | ldr r4, =at91_rstc_base | 30 | ldr r4, =at91_rstc_base |
25 | ldr r1, [r4] | 31 | ldr r1, [r4] |
26 | 32 | ||
@@ -30,6 +36,8 @@ at91sam9g45_restart: | |||
30 | 36 | ||
31 | .balign 32 @ align to cache line | 37 | .balign 32 @ align to cache line |
32 | 38 | ||
39 | strne r2, [r5, #AT91_DDRSDRC_RTR] @ disable DDR1 access | ||
40 | strne r3, [r5, #AT91_DDRSDRC_LPR] @ power down DDR1 | ||
33 | str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access | 41 | str r2, [r0, #AT91_DDRSDRC_RTR] @ disable DDR0 access |
34 | str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0 | 42 | str r3, [r0, #AT91_DDRSDRC_LPR] @ power down DDR0 |
35 | str r4, [r1, #AT91_RSTC_CR] @ reset processor | 43 | str r4, [r1, #AT91_RSTC_CR] @ reset processor |
diff --git a/arch/arm/mach-at91/at91x40_time.c b/arch/arm/mach-at91/at91x40_time.c index 2919eba41ff4..c0e637adf65d 100644 --- a/arch/arm/mach-at91/at91x40_time.c +++ b/arch/arm/mach-at91/at91x40_time.c | |||
@@ -57,7 +57,7 @@ static irqreturn_t at91x40_timer_interrupt(int irq, void *dev_id) | |||
57 | 57 | ||
58 | static struct irqaction at91x40_timer_irq = { | 58 | static struct irqaction at91x40_timer_irq = { |
59 | .name = "at91_tick", | 59 | .name = "at91_tick", |
60 | .flags = IRQF_DISABLED | IRQF_TIMER, | 60 | .flags = IRQF_TIMER, |
61 | .handler = at91x40_timer_interrupt | 61 | .handler = at91x40_timer_interrupt |
62 | }; | 62 | }; |
63 | 63 | ||
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c index 92b7f770615a..4078ba93776b 100644 --- a/arch/arm/mach-davinci/board-dm365-evm.c +++ b/arch/arm/mach-davinci/board-dm365-evm.c | |||
@@ -176,7 +176,7 @@ static struct at24_platform_data eeprom_info = { | |||
176 | .context = (void *)0x7f00, | 176 | .context = (void *)0x7f00, |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static struct snd_platform_data dm365_evm_snd_data = { | 179 | static struct snd_platform_data dm365_evm_snd_data __maybe_unused = { |
180 | .asp_chan_q = EVENTQ_3, | 180 | .asp_chan_q = EVENTQ_3, |
181 | }; | 181 | }; |
182 | 182 | ||
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index 52b8571b2e70..ce402cd21fa0 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
@@ -15,8 +15,6 @@ | |||
15 | 15 | ||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | ||
18 | #include <linux/platform_device.h> | ||
19 | |||
20 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) | 18 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) |
21 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) | 19 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) |
22 | #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) | 20 | #define DAVINCI_UART2_BASE (IO_PHYS + 0x20800) |
@@ -39,6 +37,8 @@ | |||
39 | #define UART_DM646X_SCR_TX_WATERMARK 0x08 | 37 | #define UART_DM646X_SCR_TX_WATERMARK 0x08 |
40 | 38 | ||
41 | #ifndef __ASSEMBLY__ | 39 | #ifndef __ASSEMBLY__ |
40 | #include <linux/platform_device.h> | ||
41 | |||
42 | extern int davinci_serial_init(struct platform_device *); | 42 | extern int davinci_serial_init(struct platform_device *); |
43 | #endif | 43 | #endif |
44 | 44 | ||
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig index 8e8437dea3ce..3c3bff715b47 100644 --- a/arch/arm/mach-highbank/Kconfig +++ b/arch/arm/mach-highbank/Kconfig | |||
@@ -4,6 +4,7 @@ config ARCH_HIGHBANK | |||
4 | select ARCH_HAS_CPUFREQ | 4 | select ARCH_HAS_CPUFREQ |
5 | select ARCH_HAS_HOLES_MEMORYMODEL | 5 | select ARCH_HAS_HOLES_MEMORYMODEL |
6 | select ARCH_HAS_OPP | 6 | select ARCH_HAS_OPP |
7 | select ARCH_SUPPORTS_BIG_ENDIAN | ||
7 | select ARCH_WANT_OPTIONAL_GPIOLIB | 8 | select ARCH_WANT_OPTIONAL_GPIOLIB |
8 | select ARM_AMBA | 9 | select ARM_AMBA |
9 | select ARM_ERRATA_764369 | 10 | select ARM_ERRATA_764369 |
diff --git a/arch/arm/mach-integrator/pci_v3.h b/arch/arm/mach-integrator/pci_v3.h index 755fd29fed4a..06a9e2e7d007 100644 --- a/arch/arm/mach-integrator/pci_v3.h +++ b/arch/arm/mach-integrator/pci_v3.h | |||
@@ -1,2 +1,9 @@ | |||
1 | /* Simple oneliner include to the PCIv3 early init */ | 1 | /* Simple oneliner include to the PCIv3 early init */ |
2 | #ifdef CONFIG_PCI | ||
2 | extern int pci_v3_early_init(void); | 3 | extern int pci_v3_early_init(void); |
4 | #else | ||
5 | static inline int pci_v3_early_init(void) | ||
6 | { | ||
7 | return 0; | ||
8 | } | ||
9 | #endif | ||
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig index 30e1ebe3a891..c342dc4e8a45 100644 --- a/arch/arm/mach-ixp4xx/Kconfig +++ b/arch/arm/mach-ixp4xx/Kconfig | |||
@@ -1,9 +1,5 @@ | |||
1 | if ARCH_IXP4XX | 1 | if ARCH_IXP4XX |
2 | 2 | ||
3 | config ARCH_SUPPORTS_BIG_ENDIAN | ||
4 | bool | ||
5 | default y | ||
6 | |||
7 | menu "Intel IXP4xx Implementation Options" | 3 | menu "Intel IXP4xx Implementation Options" |
8 | 4 | ||
9 | comment "IXP4xx Platforms" | 5 | comment "IXP4xx Platforms" |
diff --git a/arch/arm/mach-mvebu/Kconfig b/arch/arm/mach-mvebu/Kconfig index 9eb63d724602..5e269d7263ce 100644 --- a/arch/arm/mach-mvebu/Kconfig +++ b/arch/arm/mach-mvebu/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | config ARCH_MVEBU | 1 | config ARCH_MVEBU |
2 | bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 | 2 | bool "Marvell SOCs with Device Tree support" if ARCH_MULTI_V7 |
3 | select ARCH_SUPPORTS_BIG_ENDIAN | ||
3 | select CLKSRC_MMIO | 4 | select CLKSRC_MMIO |
4 | select COMMON_CLK | 5 | select COMMON_CLK |
5 | select GENERIC_CLOCKEVENTS | 6 | select GENERIC_CLOCKEVENTS |
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 4c24303ec481..58adf2fd9cfc 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c | |||
@@ -140,6 +140,7 @@ int __init coherency_init(void) | |||
140 | coherency_base = of_iomap(np, 0); | 140 | coherency_base = of_iomap(np, 0); |
141 | coherency_cpu_base = of_iomap(np, 1); | 141 | coherency_cpu_base = of_iomap(np, 1); |
142 | set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); | 142 | set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); |
143 | of_node_put(np); | ||
143 | } | 144 | } |
144 | 145 | ||
145 | return 0; | 146 | return 0; |
@@ -147,9 +148,14 @@ int __init coherency_init(void) | |||
147 | 148 | ||
148 | static int __init coherency_late_init(void) | 149 | static int __init coherency_late_init(void) |
149 | { | 150 | { |
150 | if (of_find_matching_node(NULL, of_coherency_table)) | 151 | struct device_node *np; |
152 | |||
153 | np = of_find_matching_node(NULL, of_coherency_table); | ||
154 | if (np) { | ||
151 | bus_register_notifier(&platform_bus_type, | 155 | bus_register_notifier(&platform_bus_type, |
152 | &mvebu_hwcc_platform_nb); | 156 | &mvebu_hwcc_platform_nb); |
157 | of_node_put(np); | ||
158 | } | ||
153 | return 0; | 159 | return 0; |
154 | } | 160 | } |
155 | 161 | ||
diff --git a/arch/arm/mach-mvebu/coherency_ll.S b/arch/arm/mach-mvebu/coherency_ll.S index 5476669ba905..ee7598fe75db 100644 --- a/arch/arm/mach-mvebu/coherency_ll.S +++ b/arch/arm/mach-mvebu/coherency_ll.S | |||
@@ -20,6 +20,8 @@ | |||
20 | #define ARMADA_XP_CFB_CTL_REG_OFFSET 0x0 | 20 | #define ARMADA_XP_CFB_CTL_REG_OFFSET 0x0 |
21 | #define ARMADA_XP_CFB_CFG_REG_OFFSET 0x4 | 21 | #define ARMADA_XP_CFB_CFG_REG_OFFSET 0x4 |
22 | 22 | ||
23 | #include <asm/assembler.h> | ||
24 | |||
23 | .text | 25 | .text |
24 | /* | 26 | /* |
25 | * r0: Coherency fabric base register address | 27 | * r0: Coherency fabric base register address |
@@ -29,6 +31,7 @@ ENTRY(ll_set_cpu_coherent) | |||
29 | /* Create bit by cpu index */ | 31 | /* Create bit by cpu index */ |
30 | mov r3, #(1 << 24) | 32 | mov r3, #(1 << 24) |
31 | lsl r1, r3, r1 | 33 | lsl r1, r3, r1 |
34 | ARM_BE8(rev r1, r1) | ||
32 | 35 | ||
33 | /* Add CPU to SMP group - Atomic */ | 36 | /* Add CPU to SMP group - Atomic */ |
34 | add r3, r0, #ARMADA_XP_CFB_CTL_REG_OFFSET | 37 | add r3, r0, #ARMADA_XP_CFB_CTL_REG_OFFSET |
diff --git a/arch/arm/mach-mvebu/headsmp.S b/arch/arm/mach-mvebu/headsmp.S index 8a1b0c96e9ec..3dd80df428f7 100644 --- a/arch/arm/mach-mvebu/headsmp.S +++ b/arch/arm/mach-mvebu/headsmp.S | |||
@@ -21,12 +21,16 @@ | |||
21 | #include <linux/linkage.h> | 21 | #include <linux/linkage.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | 23 | ||
24 | #include <asm/assembler.h> | ||
25 | |||
24 | /* | 26 | /* |
25 | * Armada XP specific entry point for secondary CPUs. | 27 | * Armada XP specific entry point for secondary CPUs. |
26 | * We add the CPU to the coherency fabric and then jump to secondary | 28 | * We add the CPU to the coherency fabric and then jump to secondary |
27 | * startup | 29 | * startup |
28 | */ | 30 | */ |
29 | ENTRY(armada_xp_secondary_startup) | 31 | ENTRY(armada_xp_secondary_startup) |
32 | ARM_BE8(setend be ) @ go BE8 if entered LE | ||
33 | |||
30 | /* Get coherency fabric base physical address */ | 34 | /* Get coherency fabric base physical address */ |
31 | adr r0, 1f | 35 | adr r0, 1f |
32 | ldr r1, [r0] | 36 | ldr r1, [r0] |
diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c index 3cc4bef6401c..27fc4f049474 100644 --- a/arch/arm/mach-mvebu/pmsu.c +++ b/arch/arm/mach-mvebu/pmsu.c | |||
@@ -67,6 +67,7 @@ int __init armada_370_xp_pmsu_init(void) | |||
67 | pr_info("Initializing Power Management Service Unit\n"); | 67 | pr_info("Initializing Power Management Service Unit\n"); |
68 | pmsu_mp_base = of_iomap(np, 0); | 68 | pmsu_mp_base = of_iomap(np, 0); |
69 | pmsu_reset_base = of_iomap(np, 1); | 69 | pmsu_reset_base = of_iomap(np, 1); |
70 | of_node_put(np); | ||
70 | } | 71 | } |
71 | 72 | ||
72 | return 0; | 73 | return 0; |
diff --git a/arch/arm/mach-mvebu/system-controller.c b/arch/arm/mach-mvebu/system-controller.c index f875124ff4f9..5175083cdb34 100644 --- a/arch/arm/mach-mvebu/system-controller.c +++ b/arch/arm/mach-mvebu/system-controller.c | |||
@@ -98,6 +98,7 @@ static int __init mvebu_system_controller_init(void) | |||
98 | BUG_ON(!match); | 98 | BUG_ON(!match); |
99 | system_controller_base = of_iomap(np, 0); | 99 | system_controller_base = of_iomap(np, 0); |
100 | mvebu_sc = (struct mvebu_system_controller *)match->data; | 100 | mvebu_sc = (struct mvebu_system_controller *)match->data; |
101 | of_node_put(np); | ||
101 | } | 102 | } |
102 | 103 | ||
103 | return 0; | 104 | return 0; |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 5bd1479d3deb..7f8f6076d360 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -1108,9 +1108,9 @@ static const struct pinctrl_map eva_pinctrl_map[] = { | |||
1108 | PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-r8a7740", | 1108 | PIN_MAP_MUX_GROUP_DEFAULT("asoc-simple-card.1", "pfc-r8a7740", |
1109 | "fsib_mclk_in", "fsib"), | 1109 | "fsib_mclk_in", "fsib"), |
1110 | /* GETHER */ | 1110 | /* GETHER */ |
1111 | PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740", | 1111 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740", |
1112 | "gether_mii", "gether"), | 1112 | "gether_mii", "gether"), |
1113 | PIN_MAP_MUX_GROUP_DEFAULT("sh-eth", "pfc-r8a7740", | 1113 | PIN_MAP_MUX_GROUP_DEFAULT("r8a7740-gether", "pfc-r8a7740", |
1114 | "gether_int", "gether"), | 1114 | "gether_int", "gether"), |
1115 | /* HDMI */ | 1115 | /* HDMI */ |
1116 | PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-r8a7740", | 1116 | PIN_MAP_MUX_GROUP_DEFAULT("sh-mobile-hdmi", "pfc-r8a7740", |
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index ffb6f0ac7606..5930af8d434f 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/pinctrl/machine.h> | 29 | #include <linux/pinctrl/machine.h> |
30 | #include <linux/platform_data/gpio-rcar.h> | 30 | #include <linux/platform_data/gpio-rcar.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/phy.h> | ||
32 | #include <linux/regulator/fixed.h> | 33 | #include <linux/regulator/fixed.h> |
33 | #include <linux/regulator/machine.h> | 34 | #include <linux/regulator/machine.h> |
34 | #include <linux/sh_eth.h> | 35 | #include <linux/sh_eth.h> |
@@ -155,6 +156,30 @@ static void __init lager_add_standard_devices(void) | |||
155 | ðer_pdata, sizeof(ether_pdata)); | 156 | ðer_pdata, sizeof(ether_pdata)); |
156 | } | 157 | } |
157 | 158 | ||
159 | /* | ||
160 | * Ether LEDs on the Lager board are named LINK and ACTIVE which corresponds | ||
161 | * to non-default 01 setting of the Micrel KSZ8041 PHY control register 1 bits | ||
162 | * 14-15. We have to set them back to 01 from the default 00 value each time | ||
163 | * the PHY is reset. It's also important because the PHY's LED0 signal is | ||
164 | * connected to SoC's ETH_LINK signal and in the PHY's default mode it will | ||
165 | * bounce on and off after each packet, which we apparently want to avoid. | ||
166 | */ | ||
167 | static int lager_ksz8041_fixup(struct phy_device *phydev) | ||
168 | { | ||
169 | u16 phyctrl1 = phy_read(phydev, 0x1e); | ||
170 | |||
171 | phyctrl1 &= ~0xc000; | ||
172 | phyctrl1 |= 0x4000; | ||
173 | return phy_write(phydev, 0x1e, phyctrl1); | ||
174 | } | ||
175 | |||
176 | static void __init lager_init(void) | ||
177 | { | ||
178 | lager_add_standard_devices(); | ||
179 | |||
180 | phy_register_fixup_for_id("r8a7790-ether-ff:01", lager_ksz8041_fixup); | ||
181 | } | ||
182 | |||
158 | static const char *lager_boards_compat_dt[] __initdata = { | 183 | static const char *lager_boards_compat_dt[] __initdata = { |
159 | "renesas,lager", | 184 | "renesas,lager", |
160 | NULL, | 185 | NULL, |
@@ -163,6 +188,6 @@ static const char *lager_boards_compat_dt[] __initdata = { | |||
163 | DT_MACHINE_START(LAGER_DT, "lager") | 188 | DT_MACHINE_START(LAGER_DT, "lager") |
164 | .init_early = r8a7790_init_delay, | 189 | .init_early = r8a7790_init_delay, |
165 | .init_time = r8a7790_timer_init, | 190 | .init_time = r8a7790_timer_init, |
166 | .init_machine = lager_add_standard_devices, | 191 | .init_machine = lager_init, |
167 | .dt_compat = lager_boards_compat_dt, | 192 | .dt_compat = lager_boards_compat_dt, |
168 | MACHINE_END | 193 | MACHINE_END |
diff --git a/arch/arm/mach-vexpress/Kconfig b/arch/arm/mach-vexpress/Kconfig index 365795447804..4fe8ebe5b2d4 100644 --- a/arch/arm/mach-vexpress/Kconfig +++ b/arch/arm/mach-vexpress/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config ARCH_VEXPRESS | 1 | config ARCH_VEXPRESS |
2 | bool "ARM Ltd. Versatile Express family" if ARCH_MULTI_V7 | 2 | bool "ARM Ltd. Versatile Express family" if ARCH_MULTI_V7 |
3 | select ARCH_REQUIRE_GPIOLIB | 3 | select ARCH_REQUIRE_GPIOLIB |
4 | select ARCH_SUPPORTS_BIG_ENDIAN | ||
4 | select ARM_AMBA | 5 | select ARM_AMBA |
5 | select ARM_GIC | 6 | select ARM_GIC |
6 | select ARM_TIMER_SP804 | 7 | select ARM_TIMER_SP804 |
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c index 7aeb5d60e484..e6eb48192912 100644 --- a/arch/arm/mach-vexpress/tc2_pm.c +++ b/arch/arm/mach-vexpress/tc2_pm.c | |||
@@ -131,6 +131,16 @@ static void tc2_pm_down(u64 residency) | |||
131 | } else | 131 | } else |
132 | BUG(); | 132 | BUG(); |
133 | 133 | ||
134 | /* | ||
135 | * If the CPU is committed to power down, make sure | ||
136 | * the power controller will be in charge of waking it | ||
137 | * up upon IRQ, ie IRQ lines are cut from GIC CPU IF | ||
138 | * to the CPU by disabling the GIC CPU IF to prevent wfi | ||
139 | * from completing execution behind power controller back | ||
140 | */ | ||
141 | if (!skip_wfi) | ||
142 | gic_cpu_if_down(); | ||
143 | |||
134 | if (last_man && __mcpm_outbound_enter_critical(cpu, cluster)) { | 144 | if (last_man && __mcpm_outbound_enter_critical(cpu, cluster)) { |
135 | arch_spin_unlock(&tc2_pm_lock); | 145 | arch_spin_unlock(&tc2_pm_lock); |
136 | 146 | ||
@@ -231,7 +241,6 @@ static void tc2_pm_suspend(u64 residency) | |||
231 | cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); | 241 | cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); |
232 | cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); | 242 | cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); |
233 | ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point)); | 243 | ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point)); |
234 | gic_cpu_if_down(); | ||
235 | tc2_pm_down(residency); | 244 | tc2_pm_down(residency); |
236 | } | 245 | } |
237 | 246 | ||
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index cd2c88e7a8f7..1f8fed94c2a4 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -952,3 +952,9 @@ config ARCH_HAS_BARRIERS | |||
952 | help | 952 | help |
953 | This option allows the use of custom mandatory barriers | 953 | This option allows the use of custom mandatory barriers |
954 | included via the mach/barriers.h file. | 954 | included via the mach/barriers.h file. |
955 | |||
956 | config ARCH_SUPPORTS_BIG_ENDIAN | ||
957 | bool | ||
958 | help | ||
959 | This option specifies the architecture can support big endian | ||
960 | operation. | ||
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 80741992a9fc..3815a8262af0 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -38,9 +38,8 @@ ENTRY(v6_early_abort) | |||
38 | bne do_DataAbort | 38 | bne do_DataAbort |
39 | bic r1, r1, #1 << 11 @ clear bit 11 of FSR | 39 | bic r1, r1, #1 << 11 @ clear bit 11 of FSR |
40 | ldr r3, [r4] @ read aborted ARM instruction | 40 | ldr r3, [r4] @ read aborted ARM instruction |
41 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 41 | ARM_BE8(rev r3, r3) |
42 | rev r3, r3 | 42 | |
43 | #endif | ||
44 | do_ldrd_abort tmp=ip, insn=r3 | 43 | do_ldrd_abort tmp=ip, insn=r3 |
45 | tst r3, #1 << 20 @ L = 0 -> write | 44 | tst r3, #1 << 20 @ L = 0 -> write |
46 | orreq r1, r1, #1 << 11 @ yes. | 45 | orreq r1, r1, #1 << 11 @ yes. |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index 6f4585b89078..924036473b16 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/cp15.h> | 25 | #include <asm/cp15.h> |
26 | #include <asm/system_info.h> | 26 | #include <asm/system_info.h> |
27 | #include <asm/unaligned.h> | 27 | #include <asm/unaligned.h> |
28 | #include <asm/opcodes.h> | ||
28 | 29 | ||
29 | #include "fault.h" | 30 | #include "fault.h" |
30 | 31 | ||
@@ -762,21 +763,25 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
762 | if (thumb_mode(regs)) { | 763 | if (thumb_mode(regs)) { |
763 | u16 *ptr = (u16 *)(instrptr & ~1); | 764 | u16 *ptr = (u16 *)(instrptr & ~1); |
764 | fault = probe_kernel_address(ptr, tinstr); | 765 | fault = probe_kernel_address(ptr, tinstr); |
766 | tinstr = __mem_to_opcode_thumb16(tinstr); | ||
765 | if (!fault) { | 767 | if (!fault) { |
766 | if (cpu_architecture() >= CPU_ARCH_ARMv7 && | 768 | if (cpu_architecture() >= CPU_ARCH_ARMv7 && |
767 | IS_T32(tinstr)) { | 769 | IS_T32(tinstr)) { |
768 | /* Thumb-2 32-bit */ | 770 | /* Thumb-2 32-bit */ |
769 | u16 tinst2 = 0; | 771 | u16 tinst2 = 0; |
770 | fault = probe_kernel_address(ptr + 1, tinst2); | 772 | fault = probe_kernel_address(ptr + 1, tinst2); |
771 | instr = (tinstr << 16) | tinst2; | 773 | tinst2 = __mem_to_opcode_thumb16(tinst2); |
774 | instr = __opcode_thumb32_compose(tinstr, tinst2); | ||
772 | thumb2_32b = 1; | 775 | thumb2_32b = 1; |
773 | } else { | 776 | } else { |
774 | isize = 2; | 777 | isize = 2; |
775 | instr = thumb2arm(tinstr); | 778 | instr = thumb2arm(tinstr); |
776 | } | 779 | } |
777 | } | 780 | } |
778 | } else | 781 | } else { |
779 | fault = probe_kernel_address(instrptr, instr); | 782 | fault = probe_kernel_address(instrptr, instr); |
783 | instr = __mem_to_opcode_arm(instr); | ||
784 | } | ||
780 | 785 | ||
781 | if (fault) { | 786 | if (fault) { |
782 | type = TYPE_FAULT; | 787 | type = TYPE_FAULT; |
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 1128064fddcb..45dc29f85d56 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -220,9 +220,7 @@ __v6_setup: | |||
220 | #endif /* CONFIG_MMU */ | 220 | #endif /* CONFIG_MMU */ |
221 | adr r5, v6_crval | 221 | adr r5, v6_crval |
222 | ldmia r5, {r5, r6} | 222 | ldmia r5, {r5, r6} |
223 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 223 | ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables |
224 | orr r6, r6, #1 << 25 @ big-endian page tables | ||
225 | #endif | ||
226 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 224 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
227 | bic r0, r0, r5 @ clear bits them | 225 | bic r0, r0, r5 @ clear bits them |
228 | orr r0, r0, r6 @ set them | 226 | orr r0, r0, r6 @ set them |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index c63d9bdee51e..60920f62fdf5 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -367,9 +367,7 @@ __v7_setup: | |||
367 | #endif | 367 | #endif |
368 | adr r5, v7_crval | 368 | adr r5, v7_crval |
369 | ldmia r5, {r5, r6} | 369 | ldmia r5, {r5, r6} |
370 | #ifdef CONFIG_CPU_ENDIAN_BE8 | 370 | ARM_BE8(orr r6, r6, #1 << 25) @ big-endian page tables |
371 | orr r6, r6, #1 << 25 @ big-endian page tables | ||
372 | #endif | ||
373 | #ifdef CONFIG_SWP_EMULATE | 371 | #ifdef CONFIG_SWP_EMULATE |
374 | orr r5, r5, #(1 << 10) @ set SW bit in "clear" | 372 | orr r5, r5, #(1 << 10) @ set SW bit in "clear" |
375 | bic r6, r6, #(1 << 10) @ clear it in "mmuset" | 373 | bic r6, r6, #(1 << 10) @ clear it in "mmuset" |
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index f50d223a0bd3..510d923ef6fd 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/if_vlan.h> | 19 | #include <linux/if_vlan.h> |
20 | #include <asm/cacheflush.h> | 20 | #include <asm/cacheflush.h> |
21 | #include <asm/hwcap.h> | 21 | #include <asm/hwcap.h> |
22 | #include <asm/opcodes.h> | ||
22 | 23 | ||
23 | #include "bpf_jit_32.h" | 24 | #include "bpf_jit_32.h" |
24 | 25 | ||
@@ -113,8 +114,11 @@ static u32 jit_udiv(u32 dividend, u32 divisor) | |||
113 | 114 | ||
114 | static inline void _emit(int cond, u32 inst, struct jit_ctx *ctx) | 115 | static inline void _emit(int cond, u32 inst, struct jit_ctx *ctx) |
115 | { | 116 | { |
117 | inst |= (cond << 28); | ||
118 | inst = __opcode_to_mem_arm(inst); | ||
119 | |||
116 | if (ctx->target != NULL) | 120 | if (ctx->target != NULL) |
117 | ctx->target[ctx->idx] = inst | (cond << 28); | 121 | ctx->target[ctx->idx] = inst; |
118 | 122 | ||
119 | ctx->idx++; | 123 | ctx->idx++; |
120 | } | 124 | } |
diff --git a/arch/arm/plat-versatile/headsmp.S b/arch/arm/plat-versatile/headsmp.S index 2677bc3762d7..40f27e52de75 100644 --- a/arch/arm/plat-versatile/headsmp.S +++ b/arch/arm/plat-versatile/headsmp.S | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | #include <linux/linkage.h> | 11 | #include <linux/linkage.h> |
12 | #include <linux/init.h> | 12 | #include <linux/init.h> |
13 | #include <asm/assembler.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * Realview/Versatile Express specific entry point for secondary CPUs. | 16 | * Realview/Versatile Express specific entry point for secondary CPUs. |
@@ -17,6 +18,7 @@ | |||
17 | * until we're ready for them to initialise. | 18 | * until we're ready for them to initialise. |
18 | */ | 19 | */ |
19 | ENTRY(versatile_secondary_startup) | 20 | ENTRY(versatile_secondary_startup) |
21 | ARM_BE8(setend be) | ||
20 | mrc p15, 0, r0, c0, c0, 5 | 22 | mrc p15, 0, r0, c0, c0, 5 |
21 | bic r0, #0xff000000 | 23 | bic r0, #0xff000000 |
22 | adr r4, 1f | 24 | adr r4, 1f |
diff --git a/arch/arm64/Kconfig.debug b/arch/arm64/Kconfig.debug index 1a6bfe954d49..835c559786bd 100644 --- a/arch/arm64/Kconfig.debug +++ b/arch/arm64/Kconfig.debug | |||
@@ -6,13 +6,6 @@ config FRAME_POINTER | |||
6 | bool | 6 | bool |
7 | default y | 7 | default y |
8 | 8 | ||
9 | config DEBUG_STACK_USAGE | ||
10 | bool "Enable stack utilization instrumentation" | ||
11 | depends on DEBUG_KERNEL | ||
12 | help | ||
13 | Enables the display of the minimum amount of free stack which each | ||
14 | task has ever had available in the sysrq-T output. | ||
15 | |||
16 | config EARLY_PRINTK | 9 | config EARLY_PRINTK |
17 | bool "Early printk support" | 10 | bool "Early printk support" |
18 | default y | 11 | default y |
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 5b3e83217b03..31c81e9b792e 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig | |||
@@ -42,7 +42,7 @@ CONFIG_IP_PNP_BOOTP=y | |||
42 | # CONFIG_WIRELESS is not set | 42 | # CONFIG_WIRELESS is not set |
43 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 43 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
44 | CONFIG_DEVTMPFS=y | 44 | CONFIG_DEVTMPFS=y |
45 | # CONFIG_BLK_DEV is not set | 45 | CONFIG_BLK_DEV=y |
46 | CONFIG_SCSI=y | 46 | CONFIG_SCSI=y |
47 | # CONFIG_SCSI_PROC_FS is not set | 47 | # CONFIG_SCSI_PROC_FS is not set |
48 | CONFIG_BLK_DEV_SD=y | 48 | CONFIG_BLK_DEV_SD=y |
@@ -72,6 +72,7 @@ CONFIG_LOGO=y | |||
72 | # CONFIG_IOMMU_SUPPORT is not set | 72 | # CONFIG_IOMMU_SUPPORT is not set |
73 | CONFIG_EXT2_FS=y | 73 | CONFIG_EXT2_FS=y |
74 | CONFIG_EXT3_FS=y | 74 | CONFIG_EXT3_FS=y |
75 | CONFIG_EXT4_FS=y | ||
75 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 76 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
76 | # CONFIG_EXT3_FS_XATTR is not set | 77 | # CONFIG_EXT3_FS_XATTR is not set |
77 | CONFIG_FUSE_FS=y | 78 | CONFIG_FUSE_FS=y |
@@ -90,3 +91,5 @@ CONFIG_DEBUG_KERNEL=y | |||
90 | CONFIG_DEBUG_INFO=y | 91 | CONFIG_DEBUG_INFO=y |
91 | # CONFIG_FTRACE is not set | 92 | # CONFIG_FTRACE is not set |
92 | CONFIG_ATOMIC64_SELFTEST=y | 93 | CONFIG_ATOMIC64_SELFTEST=y |
94 | CONFIG_VIRTIO_MMIO=y | ||
95 | CONFIG_VIRTIO_BLK=y | ||
diff --git a/arch/arm64/include/asm/uaccess.h b/arch/arm64/include/asm/uaccess.h index edb3d5c73a32..7ecc2b23882e 100644 --- a/arch/arm64/include/asm/uaccess.h +++ b/arch/arm64/include/asm/uaccess.h | |||
@@ -166,9 +166,10 @@ do { \ | |||
166 | 166 | ||
167 | #define get_user(x, ptr) \ | 167 | #define get_user(x, ptr) \ |
168 | ({ \ | 168 | ({ \ |
169 | __typeof__(*(ptr)) __user *__p = (ptr); \ | ||
169 | might_fault(); \ | 170 | might_fault(); \ |
170 | access_ok(VERIFY_READ, (ptr), sizeof(*(ptr))) ? \ | 171 | access_ok(VERIFY_READ, __p, sizeof(*__p)) ? \ |
171 | __get_user((x), (ptr)) : \ | 172 | __get_user((x), __p) : \ |
172 | ((x) = 0, -EFAULT); \ | 173 | ((x) = 0, -EFAULT); \ |
173 | }) | 174 | }) |
174 | 175 | ||
@@ -227,9 +228,10 @@ do { \ | |||
227 | 228 | ||
228 | #define put_user(x, ptr) \ | 229 | #define put_user(x, ptr) \ |
229 | ({ \ | 230 | ({ \ |
231 | __typeof__(*(ptr)) __user *__p = (ptr); \ | ||
230 | might_fault(); \ | 232 | might_fault(); \ |
231 | access_ok(VERIFY_WRITE, (ptr), sizeof(*(ptr))) ? \ | 233 | access_ok(VERIFY_WRITE, __p, sizeof(*__p)) ? \ |
232 | __put_user((x), (ptr)) : \ | 234 | __put_user((x), __p) : \ |
233 | -EFAULT; \ | 235 | -EFAULT; \ |
234 | }) | 236 | }) |
235 | 237 | ||
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 1f2e4d5a5c0f..bb785d23dbde 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c | |||
@@ -80,8 +80,10 @@ void fpsimd_thread_switch(struct task_struct *next) | |||
80 | 80 | ||
81 | void fpsimd_flush_thread(void) | 81 | void fpsimd_flush_thread(void) |
82 | { | 82 | { |
83 | preempt_disable(); | ||
83 | memset(¤t->thread.fpsimd_state, 0, sizeof(struct fpsimd_state)); | 84 | memset(¤t->thread.fpsimd_state, 0, sizeof(struct fpsimd_state)); |
84 | fpsimd_load_state(¤t->thread.fpsimd_state); | 85 | fpsimd_load_state(¤t->thread.fpsimd_state); |
86 | preempt_enable(); | ||
85 | } | 87 | } |
86 | 88 | ||
87 | #ifdef CONFIG_KERNEL_MODE_NEON | 89 | #ifdef CONFIG_KERNEL_MODE_NEON |
diff --git a/arch/arm64/mm/tlb.S b/arch/arm64/mm/tlb.S index 8ae80a18e8ec..19da91e0cd27 100644 --- a/arch/arm64/mm/tlb.S +++ b/arch/arm64/mm/tlb.S | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | ENTRY(__cpu_flush_user_tlb_range) | 36 | ENTRY(__cpu_flush_user_tlb_range) |
37 | vma_vm_mm x3, x2 // get vma->vm_mm | 37 | vma_vm_mm x3, x2 // get vma->vm_mm |
38 | mmid x3, x3 // get vm_mm->context.id | 38 | mmid w3, x3 // get vm_mm->context.id |
39 | dsb sy | 39 | dsb sy |
40 | lsr x0, x0, #12 // align address | 40 | lsr x0, x0, #12 // align address |
41 | lsr x1, x1, #12 | 41 | lsr x1, x1, #12 |
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild index d22af851f3f6..fd7980743890 100644 --- a/arch/avr32/include/asm/Kbuild +++ b/arch/avr32/include/asm/Kbuild | |||
@@ -1,5 +1,19 @@ | |||
1 | 1 | ||
2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
3 | generic-y += cputime.h | ||
4 | generic-y += delay.h | ||
5 | generic-y += device.h | ||
6 | generic-y += div64.h | ||
7 | generic-y += emergency-restart.h | ||
3 | generic-y += exec.h | 8 | generic-y += exec.h |
4 | generic-y += trace_clock.h | 9 | generic-y += futex.h |
10 | generic-y += irq_regs.h | ||
5 | generic-y += param.h | 11 | generic-y += param.h |
12 | generic-y += local.h | ||
13 | generic-y += local64.h | ||
14 | generic-y += percpu.h | ||
15 | generic-y += scatterlist.h | ||
16 | generic-y += sections.h | ||
17 | generic-y += topology.h | ||
18 | generic-y += trace_clock.h | ||
19 | generic-y += xor.h | ||
diff --git a/arch/avr32/include/asm/cputime.h b/arch/avr32/include/asm/cputime.h deleted file mode 100644 index e87e0f81cbeb..000000000000 --- a/arch/avr32/include/asm/cputime.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_CPUTIME_H | ||
2 | #define __ASM_AVR32_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_CPUTIME_H */ | ||
diff --git a/arch/avr32/include/asm/delay.h b/arch/avr32/include/asm/delay.h deleted file mode 100644 index 9670e127b7b2..000000000000 --- a/arch/avr32/include/asm/delay.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/delay.h> | ||
diff --git a/arch/avr32/include/asm/device.h b/arch/avr32/include/asm/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/arch/avr32/include/asm/device.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/arch/avr32/include/asm/div64.h b/arch/avr32/include/asm/div64.h deleted file mode 100644 index d7ddd4fdeca6..000000000000 --- a/arch/avr32/include/asm/div64.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_DIV64_H | ||
2 | #define __ASM_AVR32_DIV64_H | ||
3 | |||
4 | #include <asm-generic/div64.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_DIV64_H */ | ||
diff --git a/arch/avr32/include/asm/emergency-restart.h b/arch/avr32/include/asm/emergency-restart.h deleted file mode 100644 index 3e7e014776ba..000000000000 --- a/arch/avr32/include/asm/emergency-restart.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_EMERGENCY_RESTART_H | ||
2 | #define __ASM_AVR32_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_EMERGENCY_RESTART_H */ | ||
diff --git a/arch/avr32/include/asm/futex.h b/arch/avr32/include/asm/futex.h deleted file mode 100644 index 10419f14a68a..000000000000 --- a/arch/avr32/include/asm/futex.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_FUTEX_H | ||
2 | #define __ASM_AVR32_FUTEX_H | ||
3 | |||
4 | #include <asm-generic/futex.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_FUTEX_H */ | ||
diff --git a/arch/avr32/include/asm/irq_regs.h b/arch/avr32/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/arch/avr32/include/asm/irq_regs.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/arch/avr32/include/asm/local.h b/arch/avr32/include/asm/local.h deleted file mode 100644 index 1c1619694da3..000000000000 --- a/arch/avr32/include/asm/local.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_LOCAL_H | ||
2 | #define __ASM_AVR32_LOCAL_H | ||
3 | |||
4 | #include <asm-generic/local.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_LOCAL_H */ | ||
diff --git a/arch/avr32/include/asm/local64.h b/arch/avr32/include/asm/local64.h deleted file mode 100644 index 36c93b5cc239..000000000000 --- a/arch/avr32/include/asm/local64.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/local64.h> | ||
diff --git a/arch/avr32/include/asm/percpu.h b/arch/avr32/include/asm/percpu.h deleted file mode 100644 index 69227b4cd0d4..000000000000 --- a/arch/avr32/include/asm/percpu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_PERCPU_H | ||
2 | #define __ASM_AVR32_PERCPU_H | ||
3 | |||
4 | #include <asm-generic/percpu.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_PERCPU_H */ | ||
diff --git a/arch/avr32/include/asm/scatterlist.h b/arch/avr32/include/asm/scatterlist.h deleted file mode 100644 index a5902d9834e8..000000000000 --- a/arch/avr32/include/asm/scatterlist.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_SCATTERLIST_H | ||
2 | #define __ASM_AVR32_SCATTERLIST_H | ||
3 | |||
4 | #include <asm-generic/scatterlist.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_SCATTERLIST_H */ | ||
diff --git a/arch/avr32/include/asm/sections.h b/arch/avr32/include/asm/sections.h deleted file mode 100644 index aa14252e4181..000000000000 --- a/arch/avr32/include/asm/sections.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_SECTIONS_H | ||
2 | #define __ASM_AVR32_SECTIONS_H | ||
3 | |||
4 | #include <asm-generic/sections.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_SECTIONS_H */ | ||
diff --git a/arch/avr32/include/asm/topology.h b/arch/avr32/include/asm/topology.h deleted file mode 100644 index 5b766cbb4806..000000000000 --- a/arch/avr32/include/asm/topology.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __ASM_AVR32_TOPOLOGY_H | ||
2 | #define __ASM_AVR32_TOPOLOGY_H | ||
3 | |||
4 | #include <asm-generic/topology.h> | ||
5 | |||
6 | #endif /* __ASM_AVR32_TOPOLOGY_H */ | ||
diff --git a/arch/avr32/include/asm/xor.h b/arch/avr32/include/asm/xor.h deleted file mode 100644 index 99c87aa0af4f..000000000000 --- a/arch/avr32/include/asm/xor.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_XOR_H | ||
2 | #define _ASM_XOR_H | ||
3 | |||
4 | #include <asm-generic/xor.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index c2731003edef..42a53e740a7e 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c | |||
@@ -289,7 +289,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
289 | memset(childregs, 0, sizeof(struct pt_regs)); | 289 | memset(childregs, 0, sizeof(struct pt_regs)); |
290 | p->thread.cpu_context.r0 = arg; | 290 | p->thread.cpu_context.r0 = arg; |
291 | p->thread.cpu_context.r1 = usp; /* fn */ | 291 | p->thread.cpu_context.r1 = usp; /* fn */ |
292 | p->thread.cpu_context.r2 = syscall_return; | 292 | p->thread.cpu_context.r2 = (unsigned long)syscall_return; |
293 | p->thread.cpu_context.pc = (unsigned long)ret_from_kernel_thread; | 293 | p->thread.cpu_context.pc = (unsigned long)ret_from_kernel_thread; |
294 | childregs->sr = MODE_SUPERVISOR; | 294 | childregs->sr = MODE_SUPERVISOR; |
295 | } else { | 295 | } else { |
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c index 869a1c6ffeee..12f828ad5058 100644 --- a/arch/avr32/kernel/time.c +++ b/arch/avr32/kernel/time.c | |||
@@ -98,7 +98,14 @@ static void comparator_mode(enum clock_event_mode mode, | |||
98 | case CLOCK_EVT_MODE_SHUTDOWN: | 98 | case CLOCK_EVT_MODE_SHUTDOWN: |
99 | sysreg_write(COMPARE, 0); | 99 | sysreg_write(COMPARE, 0); |
100 | pr_debug("%s: stop\n", evdev->name); | 100 | pr_debug("%s: stop\n", evdev->name); |
101 | cpu_idle_poll_ctrl(false); | 101 | if (evdev->mode == CLOCK_EVT_MODE_ONESHOT || |
102 | evdev->mode == CLOCK_EVT_MODE_RESUME) { | ||
103 | /* | ||
104 | * Only disable idle poll if we have forced that | ||
105 | * in a previous call. | ||
106 | */ | ||
107 | cpu_idle_poll_ctrl(false); | ||
108 | } | ||
102 | break; | 109 | break; |
103 | default: | 110 | default: |
104 | BUG(); | 111 | BUG(); |
diff --git a/arch/mips/alchemy/board-mtx1.c b/arch/mips/alchemy/board-mtx1.c index 4a9baa9f6330..9969dbab19e3 100644 --- a/arch/mips/alchemy/board-mtx1.c +++ b/arch/mips/alchemy/board-mtx1.c | |||
@@ -276,7 +276,7 @@ static struct platform_device mtx1_pci_host = { | |||
276 | .resource = alchemy_pci_host_res, | 276 | .resource = alchemy_pci_host_res, |
277 | }; | 277 | }; |
278 | 278 | ||
279 | static struct __initdata platform_device * mtx1_devs[] = { | 279 | static struct platform_device *mtx1_devs[] __initdata = { |
280 | &mtx1_pci_host, | 280 | &mtx1_pci_host, |
281 | &mtx1_gpio_leds, | 281 | &mtx1_gpio_leds, |
282 | &mtx1_wdt, | 282 | &mtx1_wdt, |
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index 627883bc6d5f..bc6f96fcb529 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c | |||
@@ -609,6 +609,7 @@ static void r4k_dma_cache_wback_inv(unsigned long addr, unsigned long size) | |||
609 | r4k_blast_scache(); | 609 | r4k_blast_scache(); |
610 | else | 610 | else |
611 | blast_scache_range(addr, addr + size); | 611 | blast_scache_range(addr, addr + size); |
612 | preempt_enable(); | ||
612 | __sync(); | 613 | __sync(); |
613 | return; | 614 | return; |
614 | } | 615 | } |
@@ -650,6 +651,7 @@ static void r4k_dma_cache_inv(unsigned long addr, unsigned long size) | |||
650 | */ | 651 | */ |
651 | blast_inv_scache_range(addr, addr + size); | 652 | blast_inv_scache_range(addr, addr + size); |
652 | } | 653 | } |
654 | preempt_enable(); | ||
653 | __sync(); | 655 | __sync(); |
654 | return; | 656 | return; |
655 | } | 657 | } |
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index d10d27a720c0..00c0ed333a3d 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -182,6 +182,9 @@ void do_page_fault(struct pt_regs *regs, unsigned long code, | |||
182 | 182 | ||
183 | if (user_mode(regs)) | 183 | if (user_mode(regs)) |
184 | flags |= FAULT_FLAG_USER; | 184 | flags |= FAULT_FLAG_USER; |
185 | |||
186 | acc_type = parisc_acctyp(code, regs->iir); | ||
187 | |||
185 | if (acc_type & VM_WRITE) | 188 | if (acc_type & VM_WRITE) |
186 | flags |= FAULT_FLAG_WRITE; | 189 | flags |= FAULT_FLAG_WRITE; |
187 | retry: | 190 | retry: |
@@ -196,8 +199,6 @@ retry: | |||
196 | 199 | ||
197 | good_area: | 200 | good_area: |
198 | 201 | ||
199 | acc_type = parisc_acctyp(code,regs->iir); | ||
200 | |||
201 | if ((vma->vm_flags & acc_type) != acc_type) | 202 | if ((vma->vm_flags & acc_type) != acc_type) |
202 | goto bad_area; | 203 | goto bad_area; |
203 | 204 | ||
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 0adab06ce5c0..572bb5b95f35 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -661,7 +661,7 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid) | |||
661 | /* number of bytes needed for the bitmap */ | 661 | /* number of bytes needed for the bitmap */ |
662 | sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long); | 662 | sz = BITS_TO_LONGS(tbl->it_size) * sizeof(unsigned long); |
663 | 663 | ||
664 | page = alloc_pages_node(nid, GFP_ATOMIC, get_order(sz)); | 664 | page = alloc_pages_node(nid, GFP_KERNEL, get_order(sz)); |
665 | if (!page) | 665 | if (!page) |
666 | panic("iommu_init_table: Can't allocate %ld bytes\n", sz); | 666 | panic("iommu_init_table: Can't allocate %ld bytes\n", sz); |
667 | tbl->it_map = page_address(page); | 667 | tbl->it_map = page_address(page); |
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 27a90b99ef67..b4e667663d9b 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/machdep.h> | 17 | #include <asm/machdep.h> |
18 | #include <asm/smp.h> | 18 | #include <asm/smp.h> |
19 | #include <asm/pmc.h> | 19 | #include <asm/pmc.h> |
20 | #include <asm/firmware.h> | ||
20 | 21 | ||
21 | #include "cacheinfo.h" | 22 | #include "cacheinfo.h" |
22 | 23 | ||
@@ -179,15 +180,25 @@ SYSFS_PMCSETUP(spurr, SPRN_SPURR); | |||
179 | SYSFS_PMCSETUP(dscr, SPRN_DSCR); | 180 | SYSFS_PMCSETUP(dscr, SPRN_DSCR); |
180 | SYSFS_PMCSETUP(pir, SPRN_PIR); | 181 | SYSFS_PMCSETUP(pir, SPRN_PIR); |
181 | 182 | ||
183 | /* | ||
184 | Lets only enable read for phyp resources and | ||
185 | enable write when needed with a separate function. | ||
186 | Lets be conservative and default to pseries. | ||
187 | */ | ||
182 | static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); | 188 | static DEVICE_ATTR(mmcra, 0600, show_mmcra, store_mmcra); |
183 | static DEVICE_ATTR(spurr, 0400, show_spurr, NULL); | 189 | static DEVICE_ATTR(spurr, 0400, show_spurr, NULL); |
184 | static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); | 190 | static DEVICE_ATTR(dscr, 0600, show_dscr, store_dscr); |
185 | static DEVICE_ATTR(purr, 0600, show_purr, store_purr); | 191 | static DEVICE_ATTR(purr, 0400, show_purr, store_purr); |
186 | static DEVICE_ATTR(pir, 0400, show_pir, NULL); | 192 | static DEVICE_ATTR(pir, 0400, show_pir, NULL); |
187 | 193 | ||
188 | unsigned long dscr_default = 0; | 194 | unsigned long dscr_default = 0; |
189 | EXPORT_SYMBOL(dscr_default); | 195 | EXPORT_SYMBOL(dscr_default); |
190 | 196 | ||
197 | static void add_write_permission_dev_attr(struct device_attribute *attr) | ||
198 | { | ||
199 | attr->attr.mode |= 0200; | ||
200 | } | ||
201 | |||
191 | static ssize_t show_dscr_default(struct device *dev, | 202 | static ssize_t show_dscr_default(struct device *dev, |
192 | struct device_attribute *attr, char *buf) | 203 | struct device_attribute *attr, char *buf) |
193 | { | 204 | { |
@@ -394,8 +405,11 @@ static void register_cpu_online(unsigned int cpu) | |||
394 | if (cpu_has_feature(CPU_FTR_MMCRA)) | 405 | if (cpu_has_feature(CPU_FTR_MMCRA)) |
395 | device_create_file(s, &dev_attr_mmcra); | 406 | device_create_file(s, &dev_attr_mmcra); |
396 | 407 | ||
397 | if (cpu_has_feature(CPU_FTR_PURR)) | 408 | if (cpu_has_feature(CPU_FTR_PURR)) { |
409 | if (!firmware_has_feature(FW_FEATURE_LPAR)) | ||
410 | add_write_permission_dev_attr(&dev_attr_purr); | ||
398 | device_create_file(s, &dev_attr_purr); | 411 | device_create_file(s, &dev_attr_purr); |
412 | } | ||
399 | 413 | ||
400 | if (cpu_has_feature(CPU_FTR_SPURR)) | 414 | if (cpu_has_feature(CPU_FTR_SPURR)) |
401 | device_create_file(s, &dev_attr_spurr); | 415 | device_create_file(s, &dev_attr_spurr); |
diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S index 7b60b9851469..cd809eaa8b5c 100644 --- a/arch/powerpc/kernel/tm.S +++ b/arch/powerpc/kernel/tm.S | |||
@@ -79,6 +79,11 @@ _GLOBAL(tm_abort) | |||
79 | TABORT(R3) | 79 | TABORT(R3) |
80 | blr | 80 | blr |
81 | 81 | ||
82 | .section ".toc","aw" | ||
83 | DSCR_DEFAULT: | ||
84 | .tc dscr_default[TC],dscr_default | ||
85 | |||
86 | .section ".text" | ||
82 | 87 | ||
83 | /* void tm_reclaim(struct thread_struct *thread, | 88 | /* void tm_reclaim(struct thread_struct *thread, |
84 | * unsigned long orig_msr, | 89 | * unsigned long orig_msr, |
@@ -123,6 +128,7 @@ _GLOBAL(tm_reclaim) | |||
123 | mr r15, r14 | 128 | mr r15, r14 |
124 | ori r15, r15, MSR_FP | 129 | ori r15, r15, MSR_FP |
125 | li r16, MSR_RI | 130 | li r16, MSR_RI |
131 | ori r16, r16, MSR_EE /* IRQs hard off */ | ||
126 | andc r15, r15, r16 | 132 | andc r15, r15, r16 |
127 | oris r15, r15, MSR_VEC@h | 133 | oris r15, r15, MSR_VEC@h |
128 | #ifdef CONFIG_VSX | 134 | #ifdef CONFIG_VSX |
@@ -187,11 +193,18 @@ dont_backup_fp: | |||
187 | std r1, PACATMSCRATCH(r13) | 193 | std r1, PACATMSCRATCH(r13) |
188 | ld r1, PACAR1(r13) | 194 | ld r1, PACAR1(r13) |
189 | 195 | ||
196 | /* Store the PPR in r11 and reset to decent value */ | ||
197 | std r11, GPR11(r1) /* Temporary stash */ | ||
198 | mfspr r11, SPRN_PPR | ||
199 | HMT_MEDIUM | ||
200 | |||
190 | /* Now get some more GPRS free */ | 201 | /* Now get some more GPRS free */ |
191 | std r7, GPR7(r1) /* Temporary stash */ | 202 | std r7, GPR7(r1) /* Temporary stash */ |
192 | std r12, GPR12(r1) /* '' '' '' */ | 203 | std r12, GPR12(r1) /* '' '' '' */ |
193 | ld r12, STACK_PARAM(0)(r1) /* Param 0, thread_struct * */ | 204 | ld r12, STACK_PARAM(0)(r1) /* Param 0, thread_struct * */ |
194 | 205 | ||
206 | std r11, THREAD_TM_PPR(r12) /* Store PPR and free r11 */ | ||
207 | |||
195 | addi r7, r12, PT_CKPT_REGS /* Thread's ckpt_regs */ | 208 | addi r7, r12, PT_CKPT_REGS /* Thread's ckpt_regs */ |
196 | 209 | ||
197 | /* Make r7 look like an exception frame so that we | 210 | /* Make r7 look like an exception frame so that we |
@@ -203,15 +216,19 @@ dont_backup_fp: | |||
203 | SAVE_GPR(0, r7) /* user r0 */ | 216 | SAVE_GPR(0, r7) /* user r0 */ |
204 | SAVE_GPR(2, r7) /* user r2 */ | 217 | SAVE_GPR(2, r7) /* user r2 */ |
205 | SAVE_4GPRS(3, r7) /* user r3-r6 */ | 218 | SAVE_4GPRS(3, r7) /* user r3-r6 */ |
206 | SAVE_4GPRS(8, r7) /* user r8-r11 */ | 219 | SAVE_GPR(8, r7) /* user r8 */ |
220 | SAVE_GPR(9, r7) /* user r9 */ | ||
221 | SAVE_GPR(10, r7) /* user r10 */ | ||
207 | ld r3, PACATMSCRATCH(r13) /* user r1 */ | 222 | ld r3, PACATMSCRATCH(r13) /* user r1 */ |
208 | ld r4, GPR7(r1) /* user r7 */ | 223 | ld r4, GPR7(r1) /* user r7 */ |
209 | ld r5, GPR12(r1) /* user r12 */ | 224 | ld r5, GPR11(r1) /* user r11 */ |
210 | GET_SCRATCH0(6) /* user r13 */ | 225 | ld r6, GPR12(r1) /* user r12 */ |
226 | GET_SCRATCH0(8) /* user r13 */ | ||
211 | std r3, GPR1(r7) | 227 | std r3, GPR1(r7) |
212 | std r4, GPR7(r7) | 228 | std r4, GPR7(r7) |
213 | std r5, GPR12(r7) | 229 | std r5, GPR11(r7) |
214 | std r6, GPR13(r7) | 230 | std r6, GPR12(r7) |
231 | std r8, GPR13(r7) | ||
215 | 232 | ||
216 | SAVE_NVGPRS(r7) /* user r14-r31 */ | 233 | SAVE_NVGPRS(r7) /* user r14-r31 */ |
217 | 234 | ||
@@ -234,14 +251,12 @@ dont_backup_fp: | |||
234 | std r6, _XER(r7) | 251 | std r6, _XER(r7) |
235 | 252 | ||
236 | 253 | ||
237 | /* ******************** TAR, PPR, DSCR ********** */ | 254 | /* ******************** TAR, DSCR ********** */ |
238 | mfspr r3, SPRN_TAR | 255 | mfspr r3, SPRN_TAR |
239 | mfspr r4, SPRN_PPR | 256 | mfspr r4, SPRN_DSCR |
240 | mfspr r5, SPRN_DSCR | ||
241 | 257 | ||
242 | std r3, THREAD_TM_TAR(r12) | 258 | std r3, THREAD_TM_TAR(r12) |
243 | std r4, THREAD_TM_PPR(r12) | 259 | std r4, THREAD_TM_DSCR(r12) |
244 | std r5, THREAD_TM_DSCR(r12) | ||
245 | 260 | ||
246 | /* MSR and flags: We don't change CRs, and we don't need to alter | 261 | /* MSR and flags: We don't change CRs, and we don't need to alter |
247 | * MSR. | 262 | * MSR. |
@@ -258,7 +273,7 @@ dont_backup_fp: | |||
258 | std r3, THREAD_TM_TFHAR(r12) | 273 | std r3, THREAD_TM_TFHAR(r12) |
259 | std r4, THREAD_TM_TFIAR(r12) | 274 | std r4, THREAD_TM_TFIAR(r12) |
260 | 275 | ||
261 | /* AMR and PPR are checkpointed too, but are unsupported by Linux. */ | 276 | /* AMR is checkpointed too, but is unsupported by Linux. */ |
262 | 277 | ||
263 | /* Restore original MSR/IRQ state & clear TM mode */ | 278 | /* Restore original MSR/IRQ state & clear TM mode */ |
264 | ld r14, TM_FRAME_L0(r1) /* Orig MSR */ | 279 | ld r14, TM_FRAME_L0(r1) /* Orig MSR */ |
@@ -274,6 +289,12 @@ dont_backup_fp: | |||
274 | mtcr r4 | 289 | mtcr r4 |
275 | mtlr r0 | 290 | mtlr r0 |
276 | ld r2, 40(r1) | 291 | ld r2, 40(r1) |
292 | |||
293 | /* Load system default DSCR */ | ||
294 | ld r4, DSCR_DEFAULT@toc(r2) | ||
295 | ld r0, 0(r4) | ||
296 | mtspr SPRN_DSCR, r0 | ||
297 | |||
277 | blr | 298 | blr |
278 | 299 | ||
279 | 300 | ||
@@ -358,25 +379,24 @@ dont_restore_fp: | |||
358 | 379 | ||
359 | restore_gprs: | 380 | restore_gprs: |
360 | 381 | ||
361 | /* ******************** TAR, PPR, DSCR ********** */ | 382 | /* ******************** CR,LR,CCR,MSR ********** */ |
362 | ld r4, THREAD_TM_TAR(r3) | 383 | ld r4, _CTR(r7) |
363 | ld r5, THREAD_TM_PPR(r3) | 384 | ld r5, _LINK(r7) |
364 | ld r6, THREAD_TM_DSCR(r3) | 385 | ld r6, _CCR(r7) |
386 | ld r8, _XER(r7) | ||
365 | 387 | ||
366 | mtspr SPRN_TAR, r4 | 388 | mtctr r4 |
367 | mtspr SPRN_PPR, r5 | 389 | mtlr r5 |
368 | mtspr SPRN_DSCR, r6 | 390 | mtcr r6 |
391 | mtxer r8 | ||
369 | 392 | ||
370 | /* ******************** CR,LR,CCR,MSR ********** */ | 393 | /* ******************** TAR ******************** */ |
371 | ld r3, _CTR(r7) | 394 | ld r4, THREAD_TM_TAR(r3) |
372 | ld r4, _LINK(r7) | 395 | mtspr SPRN_TAR, r4 |
373 | ld r5, _CCR(r7) | ||
374 | ld r6, _XER(r7) | ||
375 | 396 | ||
376 | mtctr r3 | 397 | /* Load up the PPR and DSCR in GPRs only at this stage */ |
377 | mtlr r4 | 398 | ld r5, THREAD_TM_DSCR(r3) |
378 | mtcr r5 | 399 | ld r6, THREAD_TM_PPR(r3) |
379 | mtxer r6 | ||
380 | 400 | ||
381 | /* Clear the MSR RI since we are about to change R1. EE is already off | 401 | /* Clear the MSR RI since we are about to change R1. EE is already off |
382 | */ | 402 | */ |
@@ -384,19 +404,26 @@ restore_gprs: | |||
384 | mtmsrd r4, 1 | 404 | mtmsrd r4, 1 |
385 | 405 | ||
386 | REST_4GPRS(0, r7) /* GPR0-3 */ | 406 | REST_4GPRS(0, r7) /* GPR0-3 */ |
387 | REST_GPR(4, r7) /* GPR4-6 */ | 407 | REST_GPR(4, r7) /* GPR4 */ |
388 | REST_GPR(5, r7) | ||
389 | REST_GPR(6, r7) | ||
390 | REST_4GPRS(8, r7) /* GPR8-11 */ | 408 | REST_4GPRS(8, r7) /* GPR8-11 */ |
391 | REST_2GPRS(12, r7) /* GPR12-13 */ | 409 | REST_2GPRS(12, r7) /* GPR12-13 */ |
392 | 410 | ||
393 | REST_NVGPRS(r7) /* GPR14-31 */ | 411 | REST_NVGPRS(r7) /* GPR14-31 */ |
394 | 412 | ||
395 | ld r7, GPR7(r7) /* GPR7 */ | 413 | /* Load up PPR and DSCR here so we don't run with user values for long |
414 | */ | ||
415 | mtspr SPRN_DSCR, r5 | ||
416 | mtspr SPRN_PPR, r6 | ||
417 | |||
418 | REST_GPR(5, r7) /* GPR5-7 */ | ||
419 | REST_GPR(6, r7) | ||
420 | ld r7, GPR7(r7) | ||
396 | 421 | ||
397 | /* Commit register state as checkpointed state: */ | 422 | /* Commit register state as checkpointed state: */ |
398 | TRECHKPT | 423 | TRECHKPT |
399 | 424 | ||
425 | HMT_MEDIUM | ||
426 | |||
400 | /* Our transactional state has now changed. | 427 | /* Our transactional state has now changed. |
401 | * | 428 | * |
402 | * Now just get out of here. Transactional (current) state will be | 429 | * Now just get out of here. Transactional (current) state will be |
@@ -419,6 +446,12 @@ restore_gprs: | |||
419 | mtcr r4 | 446 | mtcr r4 |
420 | mtlr r0 | 447 | mtlr r0 |
421 | ld r2, 40(r1) | 448 | ld r2, 40(r1) |
449 | |||
450 | /* Load system default DSCR */ | ||
451 | ld r4, DSCR_DEFAULT@toc(r2) | ||
452 | ld r0, 0(r4) | ||
453 | mtspr SPRN_DSCR, r0 | ||
454 | |||
422 | blr | 455 | blr |
423 | 456 | ||
424 | /* ****************************************************************** */ | 457 | /* ****************************************************************** */ |
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c index 78a350670de3..d38cc08b16c7 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -1530,11 +1530,15 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
1530 | const char *cp; | 1530 | const char *cp; |
1531 | 1531 | ||
1532 | dn = dev->of_node; | 1532 | dn = dev->of_node; |
1533 | if (!dn) | 1533 | if (!dn) { |
1534 | return -ENODEV; | 1534 | strcat(buf, "\n"); |
1535 | return strlen(buf); | ||
1536 | } | ||
1535 | cp = of_get_property(dn, "compatible", NULL); | 1537 | cp = of_get_property(dn, "compatible", NULL); |
1536 | if (!cp) | 1538 | if (!cp) { |
1537 | return -ENODEV; | 1539 | strcat(buf, "\n"); |
1540 | return strlen(buf); | ||
1541 | } | ||
1538 | 1542 | ||
1539 | return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp); | 1543 | return sprintf(buf, "vio:T%sS%s\n", vio_dev->type, cp); |
1540 | } | 1544 | } |
diff --git a/arch/powerpc/lib/checksum_64.S b/arch/powerpc/lib/checksum_64.S index 167f72555d60..57a072065057 100644 --- a/arch/powerpc/lib/checksum_64.S +++ b/arch/powerpc/lib/checksum_64.S | |||
@@ -226,19 +226,35 @@ _GLOBAL(csum_partial) | |||
226 | blr | 226 | blr |
227 | 227 | ||
228 | 228 | ||
229 | .macro source | 229 | .macro srcnr |
230 | 100: | 230 | 100: |
231 | .section __ex_table,"a" | 231 | .section __ex_table,"a" |
232 | .align 3 | 232 | .align 3 |
233 | .llong 100b,.Lsrc_error | 233 | .llong 100b,.Lsrc_error_nr |
234 | .previous | 234 | .previous |
235 | .endm | 235 | .endm |
236 | 236 | ||
237 | .macro dest | 237 | .macro source |
238 | 150: | ||
239 | .section __ex_table,"a" | ||
240 | .align 3 | ||
241 | .llong 150b,.Lsrc_error | ||
242 | .previous | ||
243 | .endm | ||
244 | |||
245 | .macro dstnr | ||
238 | 200: | 246 | 200: |
239 | .section __ex_table,"a" | 247 | .section __ex_table,"a" |
240 | .align 3 | 248 | .align 3 |
241 | .llong 200b,.Ldest_error | 249 | .llong 200b,.Ldest_error_nr |
250 | .previous | ||
251 | .endm | ||
252 | |||
253 | .macro dest | ||
254 | 250: | ||
255 | .section __ex_table,"a" | ||
256 | .align 3 | ||
257 | .llong 250b,.Ldest_error | ||
242 | .previous | 258 | .previous |
243 | .endm | 259 | .endm |
244 | 260 | ||
@@ -269,16 +285,16 @@ _GLOBAL(csum_partial_copy_generic) | |||
269 | rldicl. r6,r3,64-1,64-2 /* r6 = (r3 & 0x3) >> 1 */ | 285 | rldicl. r6,r3,64-1,64-2 /* r6 = (r3 & 0x3) >> 1 */ |
270 | beq .Lcopy_aligned | 286 | beq .Lcopy_aligned |
271 | 287 | ||
272 | li r7,4 | 288 | li r9,4 |
273 | sub r6,r7,r6 | 289 | sub r6,r9,r6 |
274 | mtctr r6 | 290 | mtctr r6 |
275 | 291 | ||
276 | 1: | 292 | 1: |
277 | source; lhz r6,0(r3) /* align to doubleword */ | 293 | srcnr; lhz r6,0(r3) /* align to doubleword */ |
278 | subi r5,r5,2 | 294 | subi r5,r5,2 |
279 | addi r3,r3,2 | 295 | addi r3,r3,2 |
280 | adde r0,r0,r6 | 296 | adde r0,r0,r6 |
281 | dest; sth r6,0(r4) | 297 | dstnr; sth r6,0(r4) |
282 | addi r4,r4,2 | 298 | addi r4,r4,2 |
283 | bdnz 1b | 299 | bdnz 1b |
284 | 300 | ||
@@ -392,10 +408,10 @@ dest; std r16,56(r4) | |||
392 | 408 | ||
393 | mtctr r6 | 409 | mtctr r6 |
394 | 3: | 410 | 3: |
395 | source; ld r6,0(r3) | 411 | srcnr; ld r6,0(r3) |
396 | addi r3,r3,8 | 412 | addi r3,r3,8 |
397 | adde r0,r0,r6 | 413 | adde r0,r0,r6 |
398 | dest; std r6,0(r4) | 414 | dstnr; std r6,0(r4) |
399 | addi r4,r4,8 | 415 | addi r4,r4,8 |
400 | bdnz 3b | 416 | bdnz 3b |
401 | 417 | ||
@@ -405,10 +421,10 @@ dest; std r6,0(r4) | |||
405 | srdi. r6,r5,2 | 421 | srdi. r6,r5,2 |
406 | beq .Lcopy_tail_halfword | 422 | beq .Lcopy_tail_halfword |
407 | 423 | ||
408 | source; lwz r6,0(r3) | 424 | srcnr; lwz r6,0(r3) |
409 | addi r3,r3,4 | 425 | addi r3,r3,4 |
410 | adde r0,r0,r6 | 426 | adde r0,r0,r6 |
411 | dest; stw r6,0(r4) | 427 | dstnr; stw r6,0(r4) |
412 | addi r4,r4,4 | 428 | addi r4,r4,4 |
413 | subi r5,r5,4 | 429 | subi r5,r5,4 |
414 | 430 | ||
@@ -416,10 +432,10 @@ dest; stw r6,0(r4) | |||
416 | srdi. r6,r5,1 | 432 | srdi. r6,r5,1 |
417 | beq .Lcopy_tail_byte | 433 | beq .Lcopy_tail_byte |
418 | 434 | ||
419 | source; lhz r6,0(r3) | 435 | srcnr; lhz r6,0(r3) |
420 | addi r3,r3,2 | 436 | addi r3,r3,2 |
421 | adde r0,r0,r6 | 437 | adde r0,r0,r6 |
422 | dest; sth r6,0(r4) | 438 | dstnr; sth r6,0(r4) |
423 | addi r4,r4,2 | 439 | addi r4,r4,2 |
424 | subi r5,r5,2 | 440 | subi r5,r5,2 |
425 | 441 | ||
@@ -427,10 +443,10 @@ dest; sth r6,0(r4) | |||
427 | andi. r6,r5,1 | 443 | andi. r6,r5,1 |
428 | beq .Lcopy_finish | 444 | beq .Lcopy_finish |
429 | 445 | ||
430 | source; lbz r6,0(r3) | 446 | srcnr; lbz r6,0(r3) |
431 | sldi r9,r6,8 /* Pad the byte out to 16 bits */ | 447 | sldi r9,r6,8 /* Pad the byte out to 16 bits */ |
432 | adde r0,r0,r9 | 448 | adde r0,r0,r9 |
433 | dest; stb r6,0(r4) | 449 | dstnr; stb r6,0(r4) |
434 | 450 | ||
435 | .Lcopy_finish: | 451 | .Lcopy_finish: |
436 | addze r0,r0 /* add in final carry */ | 452 | addze r0,r0 /* add in final carry */ |
@@ -440,6 +456,11 @@ dest; stb r6,0(r4) | |||
440 | blr | 456 | blr |
441 | 457 | ||
442 | .Lsrc_error: | 458 | .Lsrc_error: |
459 | ld r14,STK_REG(R14)(r1) | ||
460 | ld r15,STK_REG(R15)(r1) | ||
461 | ld r16,STK_REG(R16)(r1) | ||
462 | addi r1,r1,STACKFRAMESIZE | ||
463 | .Lsrc_error_nr: | ||
443 | cmpdi 0,r7,0 | 464 | cmpdi 0,r7,0 |
444 | beqlr | 465 | beqlr |
445 | li r6,-EFAULT | 466 | li r6,-EFAULT |
@@ -447,6 +468,11 @@ dest; stb r6,0(r4) | |||
447 | blr | 468 | blr |
448 | 469 | ||
449 | .Ldest_error: | 470 | .Ldest_error: |
471 | ld r14,STK_REG(R14)(r1) | ||
472 | ld r15,STK_REG(R15)(r1) | ||
473 | ld r16,STK_REG(R16)(r1) | ||
474 | addi r1,r1,STACKFRAMESIZE | ||
475 | .Ldest_error_nr: | ||
450 | cmpdi 0,r8,0 | 476 | cmpdi 0,r8,0 |
451 | beqlr | 477 | beqlr |
452 | li r6,-EFAULT | 478 | li r6,-EFAULT |
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index d0cd9e4c6837..8ed035d2edb5 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c | |||
@@ -300,5 +300,9 @@ void vmemmap_free(unsigned long start, unsigned long end) | |||
300 | { | 300 | { |
301 | } | 301 | } |
302 | 302 | ||
303 | void register_page_bootmem_memmap(unsigned long section_nr, | ||
304 | struct page *start_page, unsigned long size) | ||
305 | { | ||
306 | } | ||
303 | #endif /* CONFIG_SPARSEMEM_VMEMMAP */ | 307 | #endif /* CONFIG_SPARSEMEM_VMEMMAP */ |
304 | 308 | ||
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 1cf9c5b67f24..3fa93dc7fe75 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
@@ -297,12 +297,21 @@ void __init paging_init(void) | |||
297 | } | 297 | } |
298 | #endif /* ! CONFIG_NEED_MULTIPLE_NODES */ | 298 | #endif /* ! CONFIG_NEED_MULTIPLE_NODES */ |
299 | 299 | ||
300 | static void __init register_page_bootmem_info(void) | ||
301 | { | ||
302 | int i; | ||
303 | |||
304 | for_each_online_node(i) | ||
305 | register_page_bootmem_info_node(NODE_DATA(i)); | ||
306 | } | ||
307 | |||
300 | void __init mem_init(void) | 308 | void __init mem_init(void) |
301 | { | 309 | { |
302 | #ifdef CONFIG_SWIOTLB | 310 | #ifdef CONFIG_SWIOTLB |
303 | swiotlb_init(0); | 311 | swiotlb_init(0); |
304 | #endif | 312 | #endif |
305 | 313 | ||
314 | register_page_bootmem_info(); | ||
306 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); | 315 | high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); |
307 | set_max_mapnr(max_pfn); | 316 | set_max_mapnr(max_pfn); |
308 | free_all_bootmem(); | 317 | free_all_bootmem(); |
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index 2ee4a707f0df..a3f7abd2f13f 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c | |||
@@ -199,6 +199,7 @@ | |||
199 | #define MMCR1_UNIT_SHIFT(pmc) (60 - (4 * ((pmc) - 1))) | 199 | #define MMCR1_UNIT_SHIFT(pmc) (60 - (4 * ((pmc) - 1))) |
200 | #define MMCR1_COMBINE_SHIFT(pmc) (35 - ((pmc) - 1)) | 200 | #define MMCR1_COMBINE_SHIFT(pmc) (35 - ((pmc) - 1)) |
201 | #define MMCR1_PMCSEL_SHIFT(pmc) (24 - (((pmc) - 1)) * 8) | 201 | #define MMCR1_PMCSEL_SHIFT(pmc) (24 - (((pmc) - 1)) * 8) |
202 | #define MMCR1_FAB_SHIFT 36 | ||
202 | #define MMCR1_DC_QUAL_SHIFT 47 | 203 | #define MMCR1_DC_QUAL_SHIFT 47 |
203 | #define MMCR1_IC_QUAL_SHIFT 46 | 204 | #define MMCR1_IC_QUAL_SHIFT 46 |
204 | 205 | ||
@@ -388,8 +389,8 @@ static int power8_compute_mmcr(u64 event[], int n_ev, | |||
388 | * the threshold bits are used for the match value. | 389 | * the threshold bits are used for the match value. |
389 | */ | 390 | */ |
390 | if (event_is_fab_match(event[i])) { | 391 | if (event_is_fab_match(event[i])) { |
391 | mmcr1 |= (event[i] >> EVENT_THR_CTL_SHIFT) & | 392 | mmcr1 |= ((event[i] >> EVENT_THR_CTL_SHIFT) & |
392 | EVENT_THR_CTL_MASK; | 393 | EVENT_THR_CTL_MASK) << MMCR1_FAB_SHIFT; |
393 | } else { | 394 | } else { |
394 | val = (event[i] >> EVENT_THR_CTL_SHIFT) & EVENT_THR_CTL_MASK; | 395 | val = (event[i] >> EVENT_THR_CTL_SHIFT) & EVENT_THR_CTL_MASK; |
395 | mmcra |= val << MMCRA_THR_CTL_SHIFT; | 396 | mmcra |= val << MMCRA_THR_CTL_SHIFT; |
diff --git a/arch/score/Kconfig b/arch/score/Kconfig index a1be70db75fe..305f7ee1f382 100644 --- a/arch/score/Kconfig +++ b/arch/score/Kconfig | |||
@@ -2,6 +2,7 @@ menu "Machine selection" | |||
2 | 2 | ||
3 | config SCORE | 3 | config SCORE |
4 | def_bool y | 4 | def_bool y |
5 | select HAVE_GENERIC_HARDIRQS | ||
5 | select GENERIC_IRQ_SHOW | 6 | select GENERIC_IRQ_SHOW |
6 | select GENERIC_IOMAP | 7 | select GENERIC_IOMAP |
7 | select GENERIC_ATOMIC64 | 8 | select GENERIC_ATOMIC64 |
@@ -110,3 +111,6 @@ source "security/Kconfig" | |||
110 | source "crypto/Kconfig" | 111 | source "crypto/Kconfig" |
111 | 112 | ||
112 | source "lib/Kconfig" | 113 | source "lib/Kconfig" |
114 | |||
115 | config NO_IOMEM | ||
116 | def_bool y | ||
diff --git a/arch/score/Makefile b/arch/score/Makefile index 974aefe86123..9e3e060290e0 100644 --- a/arch/score/Makefile +++ b/arch/score/Makefile | |||
@@ -20,8 +20,8 @@ cflags-y += -G0 -pipe -mel -mnhwloop -D__SCOREEL__ \ | |||
20 | # | 20 | # |
21 | KBUILD_AFLAGS += $(cflags-y) | 21 | KBUILD_AFLAGS += $(cflags-y) |
22 | KBUILD_CFLAGS += $(cflags-y) | 22 | KBUILD_CFLAGS += $(cflags-y) |
23 | KBUILD_AFLAGS_MODULE += -mlong-calls | 23 | KBUILD_AFLAGS_MODULE += |
24 | KBUILD_CFLAGS_MODULE += -mlong-calls | 24 | KBUILD_CFLAGS_MODULE += |
25 | LDFLAGS += --oformat elf32-littlescore | 25 | LDFLAGS += --oformat elf32-littlescore |
26 | LDFLAGS_vmlinux += -G0 -static -nostdlib | 26 | LDFLAGS_vmlinux += -G0 -static -nostdlib |
27 | 27 | ||
diff --git a/arch/score/include/asm/checksum.h b/arch/score/include/asm/checksum.h index f909ac3144a4..961bd64015a8 100644 --- a/arch/score/include/asm/checksum.h +++ b/arch/score/include/asm/checksum.h | |||
@@ -184,48 +184,57 @@ static inline __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
184 | __wsum sum) | 184 | __wsum sum) |
185 | { | 185 | { |
186 | __asm__ __volatile__( | 186 | __asm__ __volatile__( |
187 | ".set\tnoreorder\t\t\t# csum_ipv6_magic\n\t" | 187 | ".set\tvolatile\t\t\t# csum_ipv6_magic\n\t" |
188 | ".set\tnoat\n\t" | 188 | "add\t%0, %0, %5\t\t\t# proto (long in network byte order)\n\t" |
189 | "addu\t%0, %5\t\t\t# proto (long in network byte order)\n\t" | 189 | "cmp.c\t%5, %0\n\t" |
190 | "sltu\t$1, %0, %5\n\t" | 190 | "bleu 1f\n\t" |
191 | "addu\t%0, $1\n\t" | 191 | "addi\t%0, 0x1\n\t" |
192 | "addu\t%0, %6\t\t\t# csum\n\t" | 192 | "1:add\t%0, %0, %6\t\t\t# csum\n\t" |
193 | "sltu\t$1, %0, %6\n\t" | 193 | "cmp.c\t%6, %0\n\t" |
194 | "lw\t%1, 0(%2)\t\t\t# four words source address\n\t" | 194 | "lw\t%1, [%2, 0]\t\t\t# four words source address\n\t" |
195 | "addu\t%0, $1\n\t" | 195 | "bleu 1f\n\t" |
196 | "addu\t%0, %1\n\t" | 196 | "addi\t%0, 0x1\n\t" |
197 | "sltu\t$1, %0, %1\n\t" | 197 | "1:add\t%0, %0, %1\n\t" |
198 | "lw\t%1, 4(%2)\n\t" | 198 | "cmp.c\t%1, %0\n\t" |
199 | "addu\t%0, $1\n\t" | 199 | "1:lw\t%1, [%2, 4]\n\t" |
200 | "addu\t%0, %1\n\t" | 200 | "bleu 1f\n\t" |
201 | "sltu\t$1, %0, %1\n\t" | 201 | "addi\t%0, 0x1\n\t" |
202 | "lw\t%1, 8(%2)\n\t" | 202 | "1:add\t%0, %0, %1\n\t" |
203 | "addu\t%0, $1\n\t" | 203 | "cmp.c\t%1, %0\n\t" |
204 | "addu\t%0, %1\n\t" | 204 | "lw\t%1, [%2,8]\n\t" |
205 | "sltu\t$1, %0, %1\n\t" | 205 | "bleu 1f\n\t" |
206 | "lw\t%1, 12(%2)\n\t" | 206 | "addi\t%0, 0x1\n\t" |
207 | "addu\t%0, $1\n\t" | 207 | "1:add\t%0, %0, %1\n\t" |
208 | "addu\t%0, %1\n\t" | 208 | "cmp.c\t%1, %0\n\t" |
209 | "sltu\t$1, %0, %1\n\t" | 209 | "lw\t%1, [%2, 12]\n\t" |
210 | "lw\t%1, 0(%3)\n\t" | 210 | "bleu 1f\n\t" |
211 | "addu\t%0, $1\n\t" | 211 | "addi\t%0, 0x1\n\t" |
212 | "addu\t%0, %1\n\t" | 212 | "1:add\t%0, %0,%1\n\t" |
213 | "sltu\t$1, %0, %1\n\t" | 213 | "cmp.c\t%1, %0\n\t" |
214 | "lw\t%1, 4(%3)\n\t" | 214 | "lw\t%1, [%3, 0]\n\t" |
215 | "addu\t%0, $1\n\t" | 215 | "bleu 1f\n\t" |
216 | "addu\t%0, %1\n\t" | 216 | "addi\t%0, 0x1\n\t" |
217 | "sltu\t$1, %0, %1\n\t" | 217 | "1:add\t%0, %0, %1\n\t" |
218 | "lw\t%1, 8(%3)\n\t" | 218 | "cmp.c\t%1, %0\n\t" |
219 | "addu\t%0, $1\n\t" | 219 | "lw\t%1, [%3, 4]\n\t" |
220 | "addu\t%0, %1\n\t" | 220 | "bleu 1f\n\t" |
221 | "sltu\t$1, %0, %1\n\t" | 221 | "addi\t%0, 0x1\n\t" |
222 | "lw\t%1, 12(%3)\n\t" | 222 | "1:add\t%0, %0, %1\n\t" |
223 | "addu\t%0, $1\n\t" | 223 | "cmp.c\t%1, %0\n\t" |
224 | "addu\t%0, %1\n\t" | 224 | "lw\t%1, [%3, 8]\n\t" |
225 | "sltu\t$1, %0, %1\n\t" | 225 | "bleu 1f\n\t" |
226 | "addu\t%0, $1\t\t\t# Add final carry\n\t" | 226 | "addi\t%0, 0x1\n\t" |
227 | ".set\tnoat\n\t" | 227 | "1:add\t%0, %0, %1\n\t" |
228 | ".set\tnoreorder" | 228 | "cmp.c\t%1, %0\n\t" |
229 | "lw\t%1, [%3, 12]\n\t" | ||
230 | "bleu 1f\n\t" | ||
231 | "addi\t%0, 0x1\n\t" | ||
232 | "1:add\t%0, %0, %1\n\t" | ||
233 | "cmp.c\t%1, %0\n\t" | ||
234 | "bleu 1f\n\t" | ||
235 | "addi\t%0, 0x1\n\t" | ||
236 | "1:\n\t" | ||
237 | ".set\toptimize" | ||
229 | : "=r" (sum), "=r" (proto) | 238 | : "=r" (sum), "=r" (proto) |
230 | : "r" (saddr), "r" (daddr), | 239 | : "r" (saddr), "r" (daddr), |
231 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); | 240 | "0" (htonl(len)), "1" (htonl(proto)), "r" (sum)); |
diff --git a/arch/score/include/asm/io.h b/arch/score/include/asm/io.h index fbbfd7132e3b..574c8827abe2 100644 --- a/arch/score/include/asm/io.h +++ b/arch/score/include/asm/io.h | |||
@@ -5,5 +5,4 @@ | |||
5 | 5 | ||
6 | #define virt_to_bus virt_to_phys | 6 | #define virt_to_bus virt_to_phys |
7 | #define bus_to_virt phys_to_virt | 7 | #define bus_to_virt phys_to_virt |
8 | |||
9 | #endif /* _ASM_SCORE_IO_H */ | 8 | #endif /* _ASM_SCORE_IO_H */ |
diff --git a/arch/score/include/asm/pgalloc.h b/arch/score/include/asm/pgalloc.h index 059a61b7071b..716b3fd1d863 100644 --- a/arch/score/include/asm/pgalloc.h +++ b/arch/score/include/asm/pgalloc.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define _ASM_SCORE_PGALLOC_H | 2 | #define _ASM_SCORE_PGALLOC_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | 5 | #include <linux/highmem.h> | |
6 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, | 6 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, |
7 | pte_t *pte) | 7 | pte_t *pte) |
8 | { | 8 | { |
diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S index 7234ed09b7b7..befb87d30a89 100644 --- a/arch/score/kernel/entry.S +++ b/arch/score/kernel/entry.S | |||
@@ -264,7 +264,7 @@ resume_kernel: | |||
264 | disable_irq | 264 | disable_irq |
265 | lw r8, [r28, TI_PRE_COUNT] | 265 | lw r8, [r28, TI_PRE_COUNT] |
266 | cmpz.c r8 | 266 | cmpz.c r8 |
267 | bne r8, restore_all | 267 | bne restore_all |
268 | need_resched: | 268 | need_resched: |
269 | lw r8, [r28, TI_FLAGS] | 269 | lw r8, [r28, TI_FLAGS] |
270 | andri.c r9, r8, _TIF_NEED_RESCHED | 270 | andri.c r9, r8, _TIF_NEED_RESCHED |
@@ -415,7 +415,7 @@ ENTRY(handle_sys) | |||
415 | sw r9, [r0, PT_EPC] | 415 | sw r9, [r0, PT_EPC] |
416 | 416 | ||
417 | cmpi.c r27, __NR_syscalls # check syscall number | 417 | cmpi.c r27, __NR_syscalls # check syscall number |
418 | bgeu illegal_syscall | 418 | bcs illegal_syscall |
419 | 419 | ||
420 | slli r8, r27, 2 # get syscall routine | 420 | slli r8, r27, 2 # get syscall routine |
421 | la r11, sys_call_table | 421 | la r11, sys_call_table |
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c index f4c6d02421d3..a1519ad3d49d 100644 --- a/arch/score/kernel/process.c +++ b/arch/score/kernel/process.c | |||
@@ -78,8 +78,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
78 | p->thread.reg0 = (unsigned long) childregs; | 78 | p->thread.reg0 = (unsigned long) childregs; |
79 | if (unlikely(p->flags & PF_KTHREAD)) { | 79 | if (unlikely(p->flags & PF_KTHREAD)) { |
80 | memset(childregs, 0, sizeof(struct pt_regs)); | 80 | memset(childregs, 0, sizeof(struct pt_regs)); |
81 | p->thread->reg12 = usp; | 81 | p->thread.reg12 = usp; |
82 | p->thread->reg13 = arg; | 82 | p->thread.reg13 = arg; |
83 | p->thread.reg3 = (unsigned long) ret_from_kernel_thread; | 83 | p->thread.reg3 = (unsigned long) ret_from_kernel_thread; |
84 | } else { | 84 | } else { |
85 | *childregs = *current_pt_regs(); | 85 | *childregs = *current_pt_regs(); |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 2137ad667438..78c4fdb91bc5 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -506,12 +506,17 @@ config SUN_OPENPROMFS | |||
506 | Only choose N if you know in advance that you will not need to modify | 506 | Only choose N if you know in advance that you will not need to modify |
507 | OpenPROM settings on the running system. | 507 | OpenPROM settings on the running system. |
508 | 508 | ||
509 | # Makefile helper | 509 | # Makefile helpers |
510 | config SPARC64_PCI | 510 | config SPARC64_PCI |
511 | bool | 511 | bool |
512 | default y | 512 | default y |
513 | depends on SPARC64 && PCI | 513 | depends on SPARC64 && PCI |
514 | 514 | ||
515 | config SPARC64_PCI_MSI | ||
516 | bool | ||
517 | default y | ||
518 | depends on SPARC64_PCI && PCI_MSI | ||
519 | |||
515 | endmenu | 520 | endmenu |
516 | 521 | ||
517 | menu "Executable file formats" | 522 | menu "Executable file formats" |
diff --git a/arch/sparc/include/asm/floppy_64.h b/arch/sparc/include/asm/floppy_64.h index e204f902e6c9..7c90c50c200d 100644 --- a/arch/sparc/include/asm/floppy_64.h +++ b/arch/sparc/include/asm/floppy_64.h | |||
@@ -254,7 +254,7 @@ static int sun_fd_request_irq(void) | |||
254 | once = 1; | 254 | once = 1; |
255 | 255 | ||
256 | error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, | 256 | error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, |
257 | IRQF_DISABLED, "floppy", NULL); | 257 | 0, "floppy", NULL); |
258 | 258 | ||
259 | return ((error == 0) ? 0 : -1); | 259 | return ((error == 0) ? 0 : -1); |
260 | } | 260 | } |
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index d432fb20358e..d15cc1794b0e 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | |||
1 | # | 2 | # |
2 | # Makefile for the linux kernel. | 3 | # Makefile for the linux kernel. |
3 | # | 4 | # |
@@ -99,7 +100,7 @@ obj-$(CONFIG_STACKTRACE) += stacktrace.o | |||
99 | obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o | 100 | obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o |
100 | obj-$(CONFIG_SPARC64_PCI) += pci_psycho.o pci_sabre.o pci_schizo.o | 101 | obj-$(CONFIG_SPARC64_PCI) += pci_psycho.o pci_sabre.o pci_schizo.o |
101 | obj-$(CONFIG_SPARC64_PCI) += pci_sun4v.o pci_sun4v_asm.o pci_fire.o | 102 | obj-$(CONFIG_SPARC64_PCI) += pci_sun4v.o pci_sun4v_asm.o pci_fire.o |
102 | obj-$(CONFIG_PCI_MSI) += pci_msi.o | 103 | obj-$(CONFIG_SPARC64_PCI_MSI) += pci_msi.o |
103 | 104 | ||
104 | obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o | 105 | obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o |
105 | 106 | ||
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index 62d6b153ffa2..dff60abbea01 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -849,9 +849,8 @@ void ldom_reboot(const char *boot_command) | |||
849 | if (boot_command && strlen(boot_command)) { | 849 | if (boot_command && strlen(boot_command)) { |
850 | unsigned long len; | 850 | unsigned long len; |
851 | 851 | ||
852 | strcpy(full_boot_str, "boot "); | 852 | snprintf(full_boot_str, sizeof(full_boot_str), "boot %s", |
853 | strlcpy(full_boot_str + strlen("boot "), boot_command, | 853 | boot_command); |
854 | sizeof(full_boot_str + strlen("boot "))); | ||
855 | len = strlen(full_boot_str); | 854 | len = strlen(full_boot_str); |
856 | 855 | ||
857 | if (reboot_data_supported) { | 856 | if (reboot_data_supported) { |
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index 54df554b82d9..e01d75d40329 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c | |||
@@ -1249,12 +1249,12 @@ int ldc_bind(struct ldc_channel *lp, const char *name) | |||
1249 | snprintf(lp->rx_irq_name, LDC_IRQ_NAME_MAX, "%s RX", name); | 1249 | snprintf(lp->rx_irq_name, LDC_IRQ_NAME_MAX, "%s RX", name); |
1250 | snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name); | 1250 | snprintf(lp->tx_irq_name, LDC_IRQ_NAME_MAX, "%s TX", name); |
1251 | 1251 | ||
1252 | err = request_irq(lp->cfg.rx_irq, ldc_rx, IRQF_DISABLED, | 1252 | err = request_irq(lp->cfg.rx_irq, ldc_rx, 0, |
1253 | lp->rx_irq_name, lp); | 1253 | lp->rx_irq_name, lp); |
1254 | if (err) | 1254 | if (err) |
1255 | return err; | 1255 | return err; |
1256 | 1256 | ||
1257 | err = request_irq(lp->cfg.tx_irq, ldc_tx, IRQF_DISABLED, | 1257 | err = request_irq(lp->cfg.tx_irq, ldc_tx, 0, |
1258 | lp->tx_irq_name, lp); | 1258 | lp->tx_irq_name, lp); |
1259 | if (err) { | 1259 | if (err) { |
1260 | free_irq(lp->cfg.rx_irq, lp); | 1260 | free_irq(lp->cfg.rx_irq, lp); |
diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c index 22513e96b012..86179d409893 100644 --- a/arch/x86/kernel/sysfb_simplefb.c +++ b/arch/x86/kernel/sysfb_simplefb.c | |||
@@ -72,14 +72,14 @@ __init int create_simplefb(const struct screen_info *si, | |||
72 | * the part that is occupied by the framebuffer */ | 72 | * the part that is occupied by the framebuffer */ |
73 | len = mode->height * mode->stride; | 73 | len = mode->height * mode->stride; |
74 | len = PAGE_ALIGN(len); | 74 | len = PAGE_ALIGN(len); |
75 | if (len > si->lfb_size << 16) { | 75 | if (len > (u64)si->lfb_size << 16) { |
76 | printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n"); | 76 | printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n"); |
77 | return -EINVAL; | 77 | return -EINVAL; |
78 | } | 78 | } |
79 | 79 | ||
80 | /* setup IORESOURCE_MEM as framebuffer memory */ | 80 | /* setup IORESOURCE_MEM as framebuffer memory */ |
81 | memset(&res, 0, sizeof(res)); | 81 | memset(&res, 0, sizeof(res)); |
82 | res.flags = IORESOURCE_MEM; | 82 | res.flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
83 | res.name = simplefb_resname; | 83 | res.name = simplefb_resname; |
84 | res.start = si->lfb_base; | 84 | res.start = si->lfb_base; |
85 | res.end = si->lfb_base + len - 1; | 85 | res.end = si->lfb_base + len - 1; |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a1216de9ffda..3b8e7459dd4d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -5345,7 +5345,9 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu) | |||
5345 | * There are errata that may cause this bit to not be set: | 5345 | * There are errata that may cause this bit to not be set: |
5346 | * AAK134, BY25. | 5346 | * AAK134, BY25. |
5347 | */ | 5347 | */ |
5348 | if (exit_qualification & INTR_INFO_UNBLOCK_NMI) | 5348 | if (!(to_vmx(vcpu)->idt_vectoring_info & VECTORING_INFO_VALID_MASK) && |
5349 | cpu_has_virtual_nmis() && | ||
5350 | (exit_qualification & INTR_INFO_UNBLOCK_NMI)) | ||
5349 | vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); | 5351 | vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, GUEST_INTR_STATE_NMI); |
5350 | 5352 | ||
5351 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); | 5353 | gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 5596c7bdd327..082e88129712 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -700,7 +700,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, | |||
700 | if (!(pci_probe & PCI_PROBE_MMCONF) || pci_mmcfg_arch_init_failed) | 700 | if (!(pci_probe & PCI_PROBE_MMCONF) || pci_mmcfg_arch_init_failed) |
701 | return -ENODEV; | 701 | return -ENODEV; |
702 | 702 | ||
703 | if (start > end || !addr) | 703 | if (start > end) |
704 | return -EINVAL; | 704 | return -EINVAL; |
705 | 705 | ||
706 | mutex_lock(&pci_mmcfg_lock); | 706 | mutex_lock(&pci_mmcfg_lock); |
@@ -716,6 +716,11 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, | |||
716 | return -EEXIST; | 716 | return -EEXIST; |
717 | } | 717 | } |
718 | 718 | ||
719 | if (!addr) { | ||
720 | mutex_unlock(&pci_mmcfg_lock); | ||
721 | return -EINVAL; | ||
722 | } | ||
723 | |||
719 | rc = -EBUSY; | 724 | rc = -EBUSY; |
720 | cfg = pci_mmconfig_alloc(seg, start, end, addr); | 725 | cfg = pci_mmconfig_alloc(seg, start, end, addr); |
721 | if (cfg == NULL) { | 726 | if (cfg == NULL) { |