diff options
Diffstat (limited to 'arch')
397 files changed, 3475 insertions, 2501 deletions
diff --git a/arch/arc/include/asm/barrier.h b/arch/arc/include/asm/barrier.h deleted file mode 100644 index c32245c3d1e9..000000000000 --- a/arch/arc/include/asm/barrier.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __ASM_BARRIER_H | ||
10 | #define __ASM_BARRIER_H | ||
11 | |||
12 | #ifndef __ASSEMBLY__ | ||
13 | |||
14 | /* TODO-vineetg: Need to see what this does, don't we need sync anywhere */ | ||
15 | #define mb() __asm__ __volatile__ ("" : : : "memory") | ||
16 | #define rmb() mb() | ||
17 | #define wmb() mb() | ||
18 | #define set_mb(var, value) do { var = value; mb(); } while (0) | ||
19 | #define set_wmb(var, value) do { var = value; wmb(); } while (0) | ||
20 | #define read_barrier_depends() mb() | ||
21 | |||
22 | /* TODO-vineetg verify the correctness of macros here */ | ||
23 | #ifdef CONFIG_SMP | ||
24 | #define smp_mb() mb() | ||
25 | #define smp_rmb() rmb() | ||
26 | #define smp_wmb() wmb() | ||
27 | #else | ||
28 | #define smp_mb() barrier() | ||
29 | #define smp_rmb() barrier() | ||
30 | #define smp_wmb() barrier() | ||
31 | #endif | ||
32 | |||
33 | #define smp_read_barrier_depends() do { } while (0) | ||
34 | |||
35 | #endif | ||
36 | |||
37 | #endif | ||
diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S index 819dd5f7eb05..29b82adbf0b4 100644 --- a/arch/arc/kernel/entry.S +++ b/arch/arc/kernel/entry.S | |||
@@ -614,11 +614,13 @@ resume_user_mode_begin: | |||
614 | 614 | ||
615 | resume_kernel_mode: | 615 | resume_kernel_mode: |
616 | 616 | ||
617 | #ifdef CONFIG_PREEMPT | 617 | ; Disable Interrupts from this point on |
618 | 618 | ; CONFIG_PREEMPT: This is a must for preempt_schedule_irq() | |
619 | ; This is a must for preempt_schedule_irq() | 619 | ; !CONFIG_PREEMPT: To ensure restore_regs is intr safe |
620 | IRQ_DISABLE r9 | 620 | IRQ_DISABLE r9 |
621 | 621 | ||
622 | #ifdef CONFIG_PREEMPT | ||
623 | |||
622 | ; Can't preempt if preemption disabled | 624 | ; Can't preempt if preemption disabled |
623 | GET_CURR_THR_INFO_FROM_SP r10 | 625 | GET_CURR_THR_INFO_FROM_SP r10 |
624 | ld r8, [r10, THREAD_INFO_PREEMPT_COUNT] | 626 | ld r8, [r10, THREAD_INFO_PREEMPT_COUNT] |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index ab438cb5af55..db3c5414223e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -30,9 +30,9 @@ config ARM | |||
30 | select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) | 30 | select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT) |
31 | select HAVE_ARCH_TRACEHOOK | 31 | select HAVE_ARCH_TRACEHOOK |
32 | select HAVE_BPF_JIT | 32 | select HAVE_BPF_JIT |
33 | select HAVE_CC_STACKPROTECTOR | ||
33 | select HAVE_CONTEXT_TRACKING | 34 | select HAVE_CONTEXT_TRACKING |
34 | select HAVE_C_RECORDMCOUNT | 35 | select HAVE_C_RECORDMCOUNT |
35 | select HAVE_CC_STACKPROTECTOR | ||
36 | select HAVE_DEBUG_KMEMLEAK | 36 | select HAVE_DEBUG_KMEMLEAK |
37 | select HAVE_DMA_API_DEBUG | 37 | select HAVE_DMA_API_DEBUG |
38 | select HAVE_DMA_ATTRS | 38 | select HAVE_DMA_ATTRS |
@@ -311,6 +311,7 @@ config ARCH_MULTIPLATFORM | |||
311 | select ARM_HAS_SG_CHAIN | 311 | select ARM_HAS_SG_CHAIN |
312 | select ARM_PATCH_PHYS_VIRT | 312 | select ARM_PATCH_PHYS_VIRT |
313 | select AUTO_ZRELADDR | 313 | select AUTO_ZRELADDR |
314 | select CLKSRC_OF | ||
314 | select COMMON_CLK | 315 | select COMMON_CLK |
315 | select GENERIC_CLOCKEVENTS | 316 | select GENERIC_CLOCKEVENTS |
316 | select MULTI_IRQ_HANDLER | 317 | select MULTI_IRQ_HANDLER |
@@ -422,8 +423,8 @@ config ARCH_EFM32 | |||
422 | bool "Energy Micro efm32" | 423 | bool "Energy Micro efm32" |
423 | depends on !MMU | 424 | depends on !MMU |
424 | select ARCH_REQUIRE_GPIOLIB | 425 | select ARCH_REQUIRE_GPIOLIB |
425 | select AUTO_ZRELADDR | ||
426 | select ARM_NVIC | 426 | select ARM_NVIC |
427 | select AUTO_ZRELADDR | ||
427 | select CLKSRC_OF | 428 | select CLKSRC_OF |
428 | select COMMON_CLK | 429 | select COMMON_CLK |
429 | select CPU_V7M | 430 | select CPU_V7M |
@@ -511,8 +512,8 @@ config ARCH_IXP4XX | |||
511 | bool "IXP4xx-based" | 512 | bool "IXP4xx-based" |
512 | depends on MMU | 513 | depends on MMU |
513 | select ARCH_HAS_DMA_SET_COHERENT_MASK | 514 | select ARCH_HAS_DMA_SET_COHERENT_MASK |
514 | select ARCH_SUPPORTS_BIG_ENDIAN | ||
515 | select ARCH_REQUIRE_GPIOLIB | 515 | select ARCH_REQUIRE_GPIOLIB |
516 | select ARCH_SUPPORTS_BIG_ENDIAN | ||
516 | select CLKSRC_MMIO | 517 | select CLKSRC_MMIO |
517 | select CPU_XSCALE | 518 | select CPU_XSCALE |
518 | select DMABOUNCE if PCI | 519 | select DMABOUNCE if PCI |
@@ -1110,9 +1111,9 @@ config ARM_NR_BANKS | |||
1110 | default 8 | 1111 | default 8 |
1111 | 1112 | ||
1112 | config IWMMXT | 1113 | config IWMMXT |
1113 | bool "Enable iWMMXt support" if !CPU_PJ4 | 1114 | bool "Enable iWMMXt support" |
1114 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 | 1115 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B |
1115 | default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 | 1116 | default y if PXA27x || PXA3xx || ARCH_MMP || CPU_PJ4 || CPU_PJ4B |
1116 | help | 1117 | help |
1117 | Enable support for iWMMXt context switching at run time if | 1118 | Enable support for iWMMXt context switching at run time if |
1118 | running on a CPU that supports it. | 1119 | running on a CPU that supports it. |
@@ -1575,8 +1576,8 @@ config BIG_LITTLE | |||
1575 | config BL_SWITCHER | 1576 | config BL_SWITCHER |
1576 | bool "big.LITTLE switcher support" | 1577 | bool "big.LITTLE switcher support" |
1577 | depends on BIG_LITTLE && MCPM && HOTPLUG_CPU | 1578 | depends on BIG_LITTLE && MCPM && HOTPLUG_CPU |
1578 | select CPU_PM | ||
1579 | select ARM_CPU_SUSPEND | 1579 | select ARM_CPU_SUSPEND |
1580 | select CPU_PM | ||
1580 | help | 1581 | help |
1581 | The big.LITTLE "switcher" provides the core functionality to | 1582 | The big.LITTLE "switcher" provides the core functionality to |
1582 | transparently handle transition between a cluster of A15's | 1583 | transparently handle transition between a cluster of A15's |
@@ -1920,9 +1921,9 @@ config XEN | |||
1920 | depends on CPU_V7 && !CPU_V6 | 1921 | depends on CPU_V7 && !CPU_V6 |
1921 | depends on !GENERIC_ATOMIC64 | 1922 | depends on !GENERIC_ATOMIC64 |
1922 | depends on MMU | 1923 | depends on MMU |
1924 | select ARCH_DMA_ADDR_T_64BIT | ||
1923 | select ARM_PSCI | 1925 | select ARM_PSCI |
1924 | select SWIOTLB_XEN | 1926 | select SWIOTLB_XEN |
1925 | select ARCH_DMA_ADDR_T_64BIT | ||
1926 | help | 1927 | help |
1927 | Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. | 1928 | Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. |
1928 | 1929 | ||
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 4a2fc0bf6fc9..eab8ecbe69c1 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -1030,9 +1030,9 @@ config DEBUG_UART_PHYS | |||
1030 | default 0x40100000 if DEBUG_PXA_UART1 | 1030 | default 0x40100000 if DEBUG_PXA_UART1 |
1031 | default 0x42000000 if ARCH_GEMINI | 1031 | default 0x42000000 if ARCH_GEMINI |
1032 | default 0x7c0003f8 if FOOTBRIDGE | 1032 | default 0x7c0003f8 if FOOTBRIDGE |
1033 | default 0x80230000 if DEBUG_PICOXCELL_UART | ||
1034 | default 0x80070000 if DEBUG_IMX23_UART | 1033 | default 0x80070000 if DEBUG_IMX23_UART |
1035 | default 0x80074000 if DEBUG_IMX28_UART | 1034 | default 0x80074000 if DEBUG_IMX28_UART |
1035 | default 0x80230000 if DEBUG_PICOXCELL_UART | ||
1036 | default 0x808c0000 if ARCH_EP93XX | 1036 | default 0x808c0000 if ARCH_EP93XX |
1037 | default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART | 1037 | default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART |
1038 | default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX | 1038 | default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX |
@@ -1096,22 +1096,22 @@ config DEBUG_UART_VIRT | |||
1096 | default 0xfeb26000 if DEBUG_RK3X_UART1 | 1096 | default 0xfeb26000 if DEBUG_RK3X_UART1 |
1097 | default 0xfeb30c00 if DEBUG_KEYSTONE_UART0 | 1097 | default 0xfeb30c00 if DEBUG_KEYSTONE_UART0 |
1098 | default 0xfeb31000 if DEBUG_KEYSTONE_UART1 | 1098 | default 0xfeb31000 if DEBUG_KEYSTONE_UART1 |
1099 | default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE | ||
1100 | default 0xfed60000 if DEBUG_RK29_UART0 | ||
1101 | default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 | ||
1102 | default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 | ||
1103 | default 0xfec02000 if DEBUG_SOCFPGA_UART | 1099 | default 0xfec02000 if DEBUG_SOCFPGA_UART |
1100 | default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE | ||
1104 | default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0 | 1101 | default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0 |
1105 | default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1 | 1102 | default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1 |
1106 | default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2 | 1103 | default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2 |
1107 | default 0xfed12000 if ARCH_KIRKWOOD | 1104 | default 0xfed12000 if ARCH_KIRKWOOD |
1105 | default 0xfed60000 if DEBUG_RK29_UART0 | ||
1106 | default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 | ||
1107 | default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 | ||
1108 | default 0xfedc0000 if ARCH_EP93XX | 1108 | default 0xfedc0000 if ARCH_EP93XX |
1109 | default 0xfee003f8 if FOOTBRIDGE | 1109 | default 0xfee003f8 if FOOTBRIDGE |
1110 | default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART | 1110 | default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART |
1111 | default 0xfef36000 if DEBUG_HIGHBANK_UART | ||
1112 | default 0xfee82340 if ARCH_IOP13XX | 1111 | default 0xfee82340 if ARCH_IOP13XX |
1113 | default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN | 1112 | default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN |
1114 | default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN | 1113 | default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN |
1114 | default 0xfef36000 if DEBUG_HIGHBANK_UART | ||
1115 | default 0xfefff700 if ARCH_IOP33X | 1115 | default 0xfefff700 if ARCH_IOP33X |
1116 | default 0xff003000 if DEBUG_U300_UART | 1116 | default 0xff003000 if DEBUG_U300_UART |
1117 | default DEBUG_UART_PHYS if !MMU | 1117 | default DEBUG_UART_PHYS if !MMU |
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 35c146f31e46..377b7c364033 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile | |||
@@ -51,10 +51,9 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d36ek.dtb | |||
51 | 51 | ||
52 | dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb | 52 | dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb |
53 | dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb | 53 | dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb |
54 | dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb | ||
54 | dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \ | 55 | dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb \ |
55 | bcm21664-garnet.dtb | 56 | bcm21664-garnet.dtb |
56 | dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb | ||
57 | dtb-$(CONFIG_ARCH_BCM_5301X) += bcm4708-netgear-r6250.dtb | ||
58 | dtb-$(CONFIG_ARCH_BERLIN) += \ | 57 | dtb-$(CONFIG_ARCH_BERLIN) += \ |
59 | berlin2-sony-nsz-gs7.dtb \ | 58 | berlin2-sony-nsz-gs7.dtb \ |
60 | berlin2cd-google-chromecast.dtb | 59 | berlin2cd-google-chromecast.dtb |
@@ -246,6 +245,7 @@ dtb-$(CONFIG_ARCH_OMAP2PLUS) += omap2420-h4.dtb \ | |||
246 | omap3-sbc-t3730.dtb \ | 245 | omap3-sbc-t3730.dtb \ |
247 | omap3-devkit8000.dtb \ | 246 | omap3-devkit8000.dtb \ |
248 | omap3-beagle-xm.dtb \ | 247 | omap3-beagle-xm.dtb \ |
248 | omap3-beagle-xm-ab.dtb \ | ||
249 | omap3-evm.dtb \ | 249 | omap3-evm.dtb \ |
250 | omap3-evm-37xx.dtb \ | 250 | omap3-evm-37xx.dtb \ |
251 | omap3-ldp.dtb \ | 251 | omap3-ldp.dtb \ |
@@ -294,13 +294,6 @@ dtb-$(CONFIG_ARCH_PRIMA2) += prima2-evb.dtb | |||
294 | dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \ | 294 | dtb-$(CONFIG_ARCH_QCOM) += qcom-msm8660-surf.dtb \ |
295 | qcom-msm8960-cdp.dtb \ | 295 | qcom-msm8960-cdp.dtb \ |
296 | qcom-apq8074-dragonboard.dtb | 296 | qcom-apq8074-dragonboard.dtb |
297 | dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ | ||
298 | ste-hrefprev60-stuib.dtb \ | ||
299 | ste-hrefprev60-tvk.dtb \ | ||
300 | ste-hrefv60plus-stuib.dtb \ | ||
301 | ste-hrefv60plus-tvk.dtb \ | ||
302 | ste-ccu8540.dtb \ | ||
303 | ste-ccu9540.dtb | ||
304 | dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb | 297 | dtb-$(CONFIG_ARCH_S3C24XX) += s3c2416-smdk2416.dtb |
305 | dtb-$(CONFIG_ARCH_S3C64XX) += s3c6410-mini6410.dtb \ | 298 | dtb-$(CONFIG_ARCH_S3C64XX) += s3c6410-mini6410.dtb \ |
306 | s3c6410-smdk6410.dtb | 299 | s3c6410-smdk6410.dtb |
@@ -369,9 +362,16 @@ dtb-$(CONFIG_ARCH_TEGRA) += tegra20-harmony.dtb \ | |||
369 | tegra30-cardhu-a04.dtb \ | 362 | tegra30-cardhu-a04.dtb \ |
370 | tegra114-dalmore.dtb \ | 363 | tegra114-dalmore.dtb \ |
371 | tegra124-venice2.dtb | 364 | tegra124-venice2.dtb |
365 | dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb | ||
366 | dtb-$(CONFIG_ARCH_U8500) += ste-snowball.dtb \ | ||
367 | ste-hrefprev60-stuib.dtb \ | ||
368 | ste-hrefprev60-tvk.dtb \ | ||
369 | ste-hrefv60plus-stuib.dtb \ | ||
370 | ste-hrefv60plus-tvk.dtb \ | ||
371 | ste-ccu8540.dtb \ | ||
372 | ste-ccu9540.dtb | ||
372 | dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \ | 373 | dtb-$(CONFIG_ARCH_VERSATILE) += versatile-ab.dtb \ |
373 | versatile-pb.dtb | 374 | versatile-pb.dtb |
374 | dtb-$(CONFIG_ARCH_U300) += ste-u300.dtb | ||
375 | dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ | 375 | dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2p-ca5s.dtb \ |
376 | vexpress-v2p-ca9.dtb \ | 376 | vexpress-v2p-ca9.dtb \ |
377 | vexpress-v2p-ca15-tc1.dtb \ | 377 | vexpress-v2p-ca15-tc1.dtb \ |
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi index e3f27ec31718..2e7d932887b5 100644 --- a/arch/arm/boot/dts/am335x-bone-common.dtsi +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi | |||
@@ -183,7 +183,7 @@ | |||
183 | &usb { | 183 | &usb { |
184 | status = "okay"; | 184 | status = "okay"; |
185 | 185 | ||
186 | control@44e10000 { | 186 | control@44e10620 { |
187 | status = "okay"; | 187 | status = "okay"; |
188 | }; | 188 | }; |
189 | 189 | ||
@@ -204,7 +204,7 @@ | |||
204 | dr_mode = "host"; | 204 | dr_mode = "host"; |
205 | }; | 205 | }; |
206 | 206 | ||
207 | dma-controller@07402000 { | 207 | dma-controller@47402000 { |
208 | status = "okay"; | 208 | status = "okay"; |
209 | }; | 209 | }; |
210 | }; | 210 | }; |
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts index 28ae040e7c3d..6028217ace0f 100644 --- a/arch/arm/boot/dts/am335x-evm.dts +++ b/arch/arm/boot/dts/am335x-evm.dts | |||
@@ -301,8 +301,8 @@ | |||
301 | 301 | ||
302 | am335x_evm_audio_pins: am335x_evm_audio_pins { | 302 | am335x_evm_audio_pins: am335x_evm_audio_pins { |
303 | pinctrl-single,pins = < | 303 | pinctrl-single,pins = < |
304 | 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rx_dv.mcasp1_aclkx */ | 304 | 0x10c (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_crs.mcasp1_aclkx */ |
305 | 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_txd3.mcasp1_fsx */ | 305 | 0x110 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* mii1_rxerr.mcasp1_fsx */ |
306 | 0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */ | 306 | 0x108 (PIN_OUTPUT_PULLDOWN | MUX_MODE4) /* mii1_col.mcasp1_axr2 */ |
307 | 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */ | 307 | 0x144 (PIN_INPUT_PULLDOWN | MUX_MODE4) /* rmii1_ref_clk.mcasp1_axr3 */ |
308 | >; | 308 | >; |
@@ -331,7 +331,7 @@ | |||
331 | &usb { | 331 | &usb { |
332 | status = "okay"; | 332 | status = "okay"; |
333 | 333 | ||
334 | control@44e10000 { | 334 | control@44e10620 { |
335 | status = "okay"; | 335 | status = "okay"; |
336 | }; | 336 | }; |
337 | 337 | ||
@@ -352,7 +352,7 @@ | |||
352 | dr_mode = "host"; | 352 | dr_mode = "host"; |
353 | }; | 353 | }; |
354 | 354 | ||
355 | dma-controller@07402000 { | 355 | dma-controller@47402000 { |
356 | status = "okay"; | 356 | status = "okay"; |
357 | }; | 357 | }; |
358 | }; | 358 | }; |
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts index ec08f6f677c3..ab238850a7b2 100644 --- a/arch/arm/boot/dts/am335x-evmsk.dts +++ b/arch/arm/boot/dts/am335x-evmsk.dts | |||
@@ -364,7 +364,7 @@ | |||
364 | &usb { | 364 | &usb { |
365 | status = "okay"; | 365 | status = "okay"; |
366 | 366 | ||
367 | control@44e10000 { | 367 | control@44e10620 { |
368 | status = "okay"; | 368 | status = "okay"; |
369 | }; | 369 | }; |
370 | 370 | ||
@@ -385,7 +385,7 @@ | |||
385 | dr_mode = "host"; | 385 | dr_mode = "host"; |
386 | }; | 386 | }; |
387 | 387 | ||
388 | dma-controller@07402000 { | 388 | dma-controller@47402000 { |
389 | status = "okay"; | 389 | status = "okay"; |
390 | }; | 390 | }; |
391 | }; | 391 | }; |
diff --git a/arch/arm/boot/dts/am335x-igep0033.dtsi b/arch/arm/boot/dts/am335x-igep0033.dtsi index 7063311a58d9..9f22c189f636 100644 --- a/arch/arm/boot/dts/am335x-igep0033.dtsi +++ b/arch/arm/boot/dts/am335x-igep0033.dtsi | |||
@@ -118,7 +118,6 @@ | |||
118 | reg = <0 0 0>; /* CS0, offset 0 */ | 118 | reg = <0 0 0>; /* CS0, offset 0 */ |
119 | nand-bus-width = <8>; | 119 | nand-bus-width = <8>; |
120 | ti,nand-ecc-opt = "bch8"; | 120 | ti,nand-ecc-opt = "bch8"; |
121 | gpmc,device-nand = "true"; | ||
122 | gpmc,device-width = <1>; | 121 | gpmc,device-width = <1>; |
123 | gpmc,sync-clk-ps = <0>; | 122 | gpmc,sync-clk-ps = <0>; |
124 | gpmc,cs-on-ns = <0>; | 123 | gpmc,cs-on-ns = <0>; |
@@ -202,7 +201,7 @@ | |||
202 | &usb { | 201 | &usb { |
203 | status = "okay"; | 202 | status = "okay"; |
204 | 203 | ||
205 | control@44e10000 { | 204 | control@44e10620 { |
206 | status = "okay"; | 205 | status = "okay"; |
207 | }; | 206 | }; |
208 | 207 | ||
@@ -223,7 +222,7 @@ | |||
223 | dr_mode = "host"; | 222 | dr_mode = "host"; |
224 | }; | 223 | }; |
225 | 224 | ||
226 | dma-controller@07402000 { | 225 | dma-controller@47402000 { |
227 | status = "okay"; | 226 | status = "okay"; |
228 | }; | 227 | }; |
229 | }; | 228 | }; |
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 9770e35f2536..7ad75b4e0663 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi | |||
@@ -72,7 +72,7 @@ | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * The soc node represents the soc top level view. It is uses for IPs | 75 | * The soc node represents the soc top level view. It is used for IPs |
76 | * that are not memory mapped in the MPU view or for the MPU itself. | 76 | * that are not memory mapped in the MPU view or for the MPU itself. |
77 | */ | 77 | */ |
78 | soc { | 78 | soc { |
@@ -94,8 +94,8 @@ | |||
94 | 94 | ||
95 | /* | 95 | /* |
96 | * XXX: Use a flat representation of the AM33XX interconnect. | 96 | * XXX: Use a flat representation of the AM33XX interconnect. |
97 | * The real AM33XX interconnect network is quite complex.Since | 97 | * The real AM33XX interconnect network is quite complex. Since |
98 | * that will not bring real advantage to represent that in DT | 98 | * it will not bring real advantage to represent that in DT |
99 | * for the moment, just use a fake OCP bus entry to represent | 99 | * for the moment, just use a fake OCP bus entry to represent |
100 | * the whole bus hierarchy. | 100 | * the whole bus hierarchy. |
101 | */ | 101 | */ |
@@ -144,7 +144,7 @@ | |||
144 | compatible = "ti,edma3"; | 144 | compatible = "ti,edma3"; |
145 | ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2"; | 145 | ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2"; |
146 | reg = <0x49000000 0x10000>, | 146 | reg = <0x49000000 0x10000>, |
147 | <0x44e10f90 0x10>; | 147 | <0x44e10f90 0x40>; |
148 | interrupts = <12 13 14>; | 148 | interrupts = <12 13 14>; |
149 | #dma-cells = <1>; | 149 | #dma-cells = <1>; |
150 | dma-channels = <64>; | 150 | dma-channels = <64>; |
@@ -802,7 +802,7 @@ | |||
802 | <0x46000000 0x400000>; | 802 | <0x46000000 0x400000>; |
803 | reg-names = "mpu", "dat"; | 803 | reg-names = "mpu", "dat"; |
804 | interrupts = <80>, <81>; | 804 | interrupts = <80>, <81>; |
805 | interrupts-names = "tx", "rx"; | 805 | interrupt-names = "tx", "rx"; |
806 | status = "disabled"; | 806 | status = "disabled"; |
807 | dmas = <&edma 8>, | 807 | dmas = <&edma 8>, |
808 | <&edma 9>; | 808 | <&edma 9>; |
@@ -816,7 +816,7 @@ | |||
816 | <0x46400000 0x400000>; | 816 | <0x46400000 0x400000>; |
817 | reg-names = "mpu", "dat"; | 817 | reg-names = "mpu", "dat"; |
818 | interrupts = <82>, <83>; | 818 | interrupts = <82>, <83>; |
819 | interrupts-names = "tx", "rx"; | 819 | interrupt-names = "tx", "rx"; |
820 | status = "disabled"; | 820 | status = "disabled"; |
821 | dmas = <&edma 10>, | 821 | dmas = <&edma 10>, |
822 | <&edma 11>; | 822 | <&edma 11>; |
diff --git a/arch/arm/boot/dts/am3517.dtsi b/arch/arm/boot/dts/am3517.dtsi index 788391f91684..5a452fdd7c5d 100644 --- a/arch/arm/boot/dts/am3517.dtsi +++ b/arch/arm/boot/dts/am3517.dtsi | |||
@@ -62,5 +62,21 @@ | |||
62 | }; | 62 | }; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | &iva { | ||
66 | status = "disabled"; | ||
67 | }; | ||
68 | |||
69 | &mailbox { | ||
70 | status = "disabled"; | ||
71 | }; | ||
72 | |||
73 | &mmu_isp { | ||
74 | status = "disabled"; | ||
75 | }; | ||
76 | |||
77 | &smartreflex_mpu_iva { | ||
78 | status = "disabled"; | ||
79 | }; | ||
80 | |||
65 | /include/ "am35xx-clocks.dtsi" | 81 | /include/ "am35xx-clocks.dtsi" |
66 | /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" | 82 | /include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" |
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi index 36d523a26831..d1f8707ff1df 100644 --- a/arch/arm/boot/dts/am4372.dtsi +++ b/arch/arm/boot/dts/am4372.dtsi | |||
@@ -691,7 +691,7 @@ | |||
691 | <0x46000000 0x400000>; | 691 | <0x46000000 0x400000>; |
692 | reg-names = "mpu", "dat"; | 692 | reg-names = "mpu", "dat"; |
693 | interrupts = <80>, <81>; | 693 | interrupts = <80>, <81>; |
694 | interrupts-names = "tx", "rx"; | 694 | interrupt-names = "tx", "rx"; |
695 | status = "disabled"; | 695 | status = "disabled"; |
696 | dmas = <&edma 8>, | 696 | dmas = <&edma 8>, |
697 | <&edma 9>; | 697 | <&edma 9>; |
@@ -705,7 +705,7 @@ | |||
705 | <0x46400000 0x400000>; | 705 | <0x46400000 0x400000>; |
706 | reg-names = "mpu", "dat"; | 706 | reg-names = "mpu", "dat"; |
707 | interrupts = <82>, <83>; | 707 | interrupts = <82>, <83>; |
708 | interrupts-names = "tx", "rx"; | 708 | interrupt-names = "tx", "rx"; |
709 | status = "disabled"; | 709 | status = "disabled"; |
710 | dmas = <&edma 10>, | 710 | dmas = <&edma 10>, |
711 | <&edma 11>; | 711 | <&edma 11>; |
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts index df8798e8bd25..a055f7f0f14a 100644 --- a/arch/arm/boot/dts/am437x-gp-evm.dts +++ b/arch/arm/boot/dts/am437x-gp-evm.dts | |||
@@ -117,6 +117,11 @@ | |||
117 | status = "okay"; | 117 | status = "okay"; |
118 | }; | 118 | }; |
119 | 119 | ||
120 | &gpio5 { | ||
121 | status = "okay"; | ||
122 | ti,no-reset-on-init; | ||
123 | }; | ||
124 | |||
120 | &mmc1 { | 125 | &mmc1 { |
121 | status = "okay"; | 126 | status = "okay"; |
122 | vmmc-supply = <&vmmcsd_fixed>; | 127 | vmmc-supply = <&vmmcsd_fixed>; |
diff --git a/arch/arm/boot/dts/armada-370-db.dts b/arch/arm/boot/dts/armada-370-db.dts index 82f238a9063f..3383c4b66803 100644 --- a/arch/arm/boot/dts/armada-370-db.dts +++ b/arch/arm/boot/dts/armada-370-db.dts | |||
@@ -67,6 +67,7 @@ | |||
67 | i2c@11000 { | 67 | i2c@11000 { |
68 | pinctrl-0 = <&i2c0_pins>; | 68 | pinctrl-0 = <&i2c0_pins>; |
69 | pinctrl-names = "default"; | 69 | pinctrl-names = "default"; |
70 | clock-frequency = <100000>; | ||
70 | status = "okay"; | 71 | status = "okay"; |
71 | audio_codec: audio-codec@4a { | 72 | audio_codec: audio-codec@4a { |
72 | compatible = "cirrus,cs42l51"; | 73 | compatible = "cirrus,cs42l51"; |
diff --git a/arch/arm/boot/dts/armada-370-xp.dtsi b/arch/arm/boot/dts/armada-370-xp.dtsi index bbb40f62037d..bb77970c0b12 100644 --- a/arch/arm/boot/dts/armada-370-xp.dtsi +++ b/arch/arm/boot/dts/armada-370-xp.dtsi | |||
@@ -230,6 +230,7 @@ | |||
230 | #size-cells = <0>; | 230 | #size-cells = <0>; |
231 | compatible = "marvell,orion-mdio"; | 231 | compatible = "marvell,orion-mdio"; |
232 | reg = <0x72004 0x4>; | 232 | reg = <0x72004 0x4>; |
233 | clocks = <&gateclk 4>; | ||
233 | }; | 234 | }; |
234 | 235 | ||
235 | eth1: ethernet@74000 { | 236 | eth1: ethernet@74000 { |
diff --git a/arch/arm/boot/dts/armada-375-db.dts b/arch/arm/boot/dts/armada-375-db.dts index 9378d3136b41..0451124e8ebf 100644 --- a/arch/arm/boot/dts/armada-375-db.dts +++ b/arch/arm/boot/dts/armada-375-db.dts | |||
@@ -79,6 +79,11 @@ | |||
79 | }; | 79 | }; |
80 | }; | 80 | }; |
81 | 81 | ||
82 | sata@a0000 { | ||
83 | status = "okay"; | ||
84 | nr-ports = <2>; | ||
85 | }; | ||
86 | |||
82 | nand: nand@d0000 { | 87 | nand: nand@d0000 { |
83 | pinctrl-0 = <&nand_pins>; | 88 | pinctrl-0 = <&nand_pins>; |
84 | pinctrl-names = "default"; | 89 | pinctrl-names = "default"; |
diff --git a/arch/arm/boot/dts/armada-380.dtsi b/arch/arm/boot/dts/armada-380.dtsi index 068031f0f263..6d0f03c98ee9 100644 --- a/arch/arm/boot/dts/armada-380.dtsi +++ b/arch/arm/boot/dts/armada-380.dtsi | |||
@@ -99,7 +99,7 @@ | |||
99 | pcie@3,0 { | 99 | pcie@3,0 { |
100 | device_type = "pci"; | 100 | device_type = "pci"; |
101 | assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; | 101 | assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; |
102 | reg = <0x1000 0 0 0 0>; | 102 | reg = <0x1800 0 0 0 0>; |
103 | #address-cells = <3>; | 103 | #address-cells = <3>; |
104 | #size-cells = <2>; | 104 | #size-cells = <2>; |
105 | #interrupt-cells = <1>; | 105 | #interrupt-cells = <1>; |
diff --git a/arch/arm/boot/dts/armada-385.dtsi b/arch/arm/boot/dts/armada-385.dtsi index e2919f02e1d4..da801964a257 100644 --- a/arch/arm/boot/dts/armada-385.dtsi +++ b/arch/arm/boot/dts/armada-385.dtsi | |||
@@ -110,7 +110,7 @@ | |||
110 | pcie@3,0 { | 110 | pcie@3,0 { |
111 | device_type = "pci"; | 111 | device_type = "pci"; |
112 | assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; | 112 | assigned-addresses = <0x82000800 0 0x44000 0 0x2000>; |
113 | reg = <0x1000 0 0 0 0>; | 113 | reg = <0x1800 0 0 0 0>; |
114 | #address-cells = <3>; | 114 | #address-cells = <3>; |
115 | #size-cells = <2>; | 115 | #size-cells = <2>; |
116 | #interrupt-cells = <1>; | 116 | #interrupt-cells = <1>; |
@@ -131,7 +131,7 @@ | |||
131 | pcie@4,0 { | 131 | pcie@4,0 { |
132 | device_type = "pci"; | 132 | device_type = "pci"; |
133 | assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; | 133 | assigned-addresses = <0x82000800 0 0x48000 0 0x2000>; |
134 | reg = <0x1000 0 0 0 0>; | 134 | reg = <0x2000 0 0 0 0>; |
135 | #address-cells = <3>; | 135 | #address-cells = <3>; |
136 | #size-cells = <2>; | 136 | #size-cells = <2>; |
137 | #interrupt-cells = <1>; | 137 | #interrupt-cells = <1>; |
diff --git a/arch/arm/boot/dts/armada-38x.dtsi b/arch/arm/boot/dts/armada-38x.dtsi index a064f59da02d..ca8813bb99ba 100644 --- a/arch/arm/boot/dts/armada-38x.dtsi +++ b/arch/arm/boot/dts/armada-38x.dtsi | |||
@@ -336,6 +336,7 @@ | |||
336 | #size-cells = <0>; | 336 | #size-cells = <0>; |
337 | compatible = "marvell,orion-mdio"; | 337 | compatible = "marvell,orion-mdio"; |
338 | reg = <0x72004 0x4>; | 338 | reg = <0x72004 0x4>; |
339 | clocks = <&gateclk 4>; | ||
339 | }; | 340 | }; |
340 | 341 | ||
341 | coredivclk: clock@e4250 { | 342 | coredivclk: clock@e4250 { |
diff --git a/arch/arm/boot/dts/armada-xp-db.dts b/arch/arm/boot/dts/armada-xp-db.dts index 448373c4b0e5..90f0bf6f9271 100644 --- a/arch/arm/boot/dts/armada-xp-db.dts +++ b/arch/arm/boot/dts/armada-xp-db.dts | |||
@@ -49,7 +49,7 @@ | |||
49 | /* Device Bus parameters are required */ | 49 | /* Device Bus parameters are required */ |
50 | 50 | ||
51 | /* Read parameters */ | 51 | /* Read parameters */ |
52 | devbus,bus-width = <8>; | 52 | devbus,bus-width = <16>; |
53 | devbus,turn-off-ps = <60000>; | 53 | devbus,turn-off-ps = <60000>; |
54 | devbus,badr-skew-ps = <0>; | 54 | devbus,badr-skew-ps = <0>; |
55 | devbus,acc-first-ps = <124000>; | 55 | devbus,acc-first-ps = <124000>; |
diff --git a/arch/arm/boot/dts/armada-xp-gp.dts b/arch/arm/boot/dts/armada-xp-gp.dts index 61bda687f782..0c756421ae6a 100644 --- a/arch/arm/boot/dts/armada-xp-gp.dts +++ b/arch/arm/boot/dts/armada-xp-gp.dts | |||
@@ -59,7 +59,7 @@ | |||
59 | /* Device Bus parameters are required */ | 59 | /* Device Bus parameters are required */ |
60 | 60 | ||
61 | /* Read parameters */ | 61 | /* Read parameters */ |
62 | devbus,bus-width = <8>; | 62 | devbus,bus-width = <16>; |
63 | devbus,turn-off-ps = <60000>; | 63 | devbus,turn-off-ps = <60000>; |
64 | devbus,badr-skew-ps = <0>; | 64 | devbus,badr-skew-ps = <0>; |
65 | devbus,acc-first-ps = <124000>; | 65 | devbus,acc-first-ps = <124000>; |
@@ -146,22 +146,22 @@ | |||
146 | ethernet@70000 { | 146 | ethernet@70000 { |
147 | status = "okay"; | 147 | status = "okay"; |
148 | phy = <&phy0>; | 148 | phy = <&phy0>; |
149 | phy-mode = "rgmii-id"; | 149 | phy-mode = "qsgmii"; |
150 | }; | 150 | }; |
151 | ethernet@74000 { | 151 | ethernet@74000 { |
152 | status = "okay"; | 152 | status = "okay"; |
153 | phy = <&phy1>; | 153 | phy = <&phy1>; |
154 | phy-mode = "rgmii-id"; | 154 | phy-mode = "qsgmii"; |
155 | }; | 155 | }; |
156 | ethernet@30000 { | 156 | ethernet@30000 { |
157 | status = "okay"; | 157 | status = "okay"; |
158 | phy = <&phy2>; | 158 | phy = <&phy2>; |
159 | phy-mode = "rgmii-id"; | 159 | phy-mode = "qsgmii"; |
160 | }; | 160 | }; |
161 | ethernet@34000 { | 161 | ethernet@34000 { |
162 | status = "okay"; | 162 | status = "okay"; |
163 | phy = <&phy3>; | 163 | phy = <&phy3>; |
164 | phy-mode = "rgmii-id"; | 164 | phy-mode = "qsgmii"; |
165 | }; | 165 | }; |
166 | 166 | ||
167 | /* Front-side USB slot */ | 167 | /* Front-side USB slot */ |
diff --git a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts index 985948ce67b3..5d42feb31049 100644 --- a/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts +++ b/arch/arm/boot/dts/armada-xp-openblocks-ax3-4.dts | |||
@@ -39,7 +39,7 @@ | |||
39 | /* Device Bus parameters are required */ | 39 | /* Device Bus parameters are required */ |
40 | 40 | ||
41 | /* Read parameters */ | 41 | /* Read parameters */ |
42 | devbus,bus-width = <8>; | 42 | devbus,bus-width = <16>; |
43 | devbus,turn-off-ps = <60000>; | 43 | devbus,turn-off-ps = <60000>; |
44 | devbus,badr-skew-ps = <0>; | 44 | devbus,badr-skew-ps = <0>; |
45 | devbus,acc-first-ps = <124000>; | 45 | devbus,acc-first-ps = <124000>; |
diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts index ce1375595e5f..4537259ce529 100644 --- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts +++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts | |||
@@ -34,7 +34,7 @@ | |||
34 | }; | 34 | }; |
35 | 35 | ||
36 | spi0: spi@f0004000 { | 36 | spi0: spi@f0004000 { |
37 | cs-gpios = <&pioD 13 0>; | 37 | cs-gpios = <&pioD 13 0>, <0>, <0>, <&pioD 16 0>; |
38 | status = "okay"; | 38 | status = "okay"; |
39 | }; | 39 | }; |
40 | 40 | ||
@@ -79,7 +79,7 @@ | |||
79 | }; | 79 | }; |
80 | 80 | ||
81 | spi1: spi@f8008000 { | 81 | spi1: spi@f8008000 { |
82 | cs-gpios = <&pioC 25 0>, <0>, <0>, <&pioD 16 0>; | 82 | cs-gpios = <&pioC 25 0>; |
83 | status = "okay"; | 83 | status = "okay"; |
84 | }; | 84 | }; |
85 | 85 | ||
diff --git a/arch/arm/boot/dts/at91sam9260.dtsi b/arch/arm/boot/dts/at91sam9260.dtsi index 366fc2cbcd64..c0e0eae16a27 100644 --- a/arch/arm/boot/dts/at91sam9260.dtsi +++ b/arch/arm/boot/dts/at91sam9260.dtsi | |||
@@ -641,7 +641,7 @@ | |||
641 | trigger@3 { | 641 | trigger@3 { |
642 | reg = <3>; | 642 | reg = <3>; |
643 | trigger-name = "external"; | 643 | trigger-name = "external"; |
644 | trigger-value = <0x13>; | 644 | trigger-value = <0xd>; |
645 | trigger-external; | 645 | trigger-external; |
646 | }; | 646 | }; |
647 | }; | 647 | }; |
diff --git a/arch/arm/boot/dts/at91sam9261.dtsi b/arch/arm/boot/dts/at91sam9261.dtsi index e21dda0e8986..3be973e9889a 100644 --- a/arch/arm/boot/dts/at91sam9261.dtsi +++ b/arch/arm/boot/dts/at91sam9261.dtsi | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <dt-bindings/pinctrl/at91.h> | 10 | #include <dt-bindings/pinctrl/at91.h> |
11 | #include <dt-bindings/interrupt-controller/irq.h> | 11 | #include <dt-bindings/interrupt-controller/irq.h> |
12 | #include <dt-bindings/gpio/gpio.h> | 12 | #include <dt-bindings/gpio/gpio.h> |
13 | #include <dt-bindings/clk/at91.h> | 13 | #include <dt-bindings/clock/at91.h> |
14 | 14 | ||
15 | / { | 15 | / { |
16 | model = "Atmel AT91SAM9261 family SoC"; | 16 | model = "Atmel AT91SAM9261 family SoC"; |
diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi index 63e1784d272c..92a52faebef7 100644 --- a/arch/arm/boot/dts/at91sam9rl.dtsi +++ b/arch/arm/boot/dts/at91sam9rl.dtsi | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include "skeleton.dtsi" | 9 | #include "skeleton.dtsi" |
10 | #include <dt-bindings/pinctrl/at91.h> | 10 | #include <dt-bindings/pinctrl/at91.h> |
11 | #include <dt-bindings/clk/at91.h> | 11 | #include <dt-bindings/clock/at91.h> |
12 | #include <dt-bindings/interrupt-controller/irq.h> | 12 | #include <dt-bindings/interrupt-controller/irq.h> |
13 | #include <dt-bindings/gpio/gpio.h> | 13 | #include <dt-bindings/gpio/gpio.h> |
14 | 14 | ||
diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi index 1c0f8e1893ae..149b55099935 100644 --- a/arch/arm/boot/dts/dra7.dtsi +++ b/arch/arm/boot/dts/dra7.dtsi | |||
@@ -80,7 +80,7 @@ | |||
80 | }; | 80 | }; |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * The soc node represents the soc top level view. It is uses for IPs | 83 | * The soc node represents the soc top level view. It is used for IPs |
84 | * that are not memory mapped in the MPU view or for the MPU itself. | 84 | * that are not memory mapped in the MPU view or for the MPU itself. |
85 | */ | 85 | */ |
86 | soc { | 86 | soc { |
@@ -94,7 +94,7 @@ | |||
94 | /* | 94 | /* |
95 | * XXX: Use a flat representation of the SOC interconnect. | 95 | * XXX: Use a flat representation of the SOC interconnect. |
96 | * The real OMAP interconnect network is quite complex. | 96 | * The real OMAP interconnect network is quite complex. |
97 | * Since that will not bring real advantage to represent that in DT for | 97 | * Since it will not bring real advantage to represent that in DT for |
98 | * the moment, just use a fake OCP bus entry to represent the whole bus | 98 | * the moment, just use a fake OCP bus entry to represent the whole bus |
99 | * hierarchy. | 99 | * hierarchy. |
100 | */ | 100 | */ |
diff --git a/arch/arm/boot/dts/dra7xx-clocks.dtsi b/arch/arm/boot/dts/dra7xx-clocks.dtsi index e96da9a898ad..cfb8fc753f50 100644 --- a/arch/arm/boot/dts/dra7xx-clocks.dtsi +++ b/arch/arm/boot/dts/dra7xx-clocks.dtsi | |||
@@ -1640,7 +1640,7 @@ | |||
1640 | #clock-cells = <0>; | 1640 | #clock-cells = <0>; |
1641 | compatible = "ti,mux-clock"; | 1641 | compatible = "ti,mux-clock"; |
1642 | clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; | 1642 | clocks = <&abe_24m_fclk>, <&abe_sys_clk_div>, <&func_24m_clk>, <&atlclkin3_ck>, <&atl_clkin2_ck>, <&atl_clkin1_ck>, <&atl_clkin0_ck>, <&sys_clkin2>, <&ref_clkin0_ck>, <&ref_clkin1_ck>, <&ref_clkin2_ck>, <&ref_clkin3_ck>, <&mlb_clk>, <&mlbp_clk>; |
1643 | ti,bit-shift = <28>; | 1643 | ti,bit-shift = <24>; |
1644 | reg = <0x1860>; | 1644 | reg = <0x1860>; |
1645 | }; | 1645 | }; |
1646 | 1646 | ||
diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts index 9583563dd0ef..8a558b7ac999 100644 --- a/arch/arm/boot/dts/exynos4412-trats2.dts +++ b/arch/arm/boot/dts/exynos4412-trats2.dts | |||
@@ -503,7 +503,7 @@ | |||
503 | status = "okay"; | 503 | status = "okay"; |
504 | 504 | ||
505 | ak8975@0c { | 505 | ak8975@0c { |
506 | compatible = "ak,ak8975"; | 506 | compatible = "asahi-kasei,ak8975"; |
507 | reg = <0x0c>; | 507 | reg = <0x0c>; |
508 | gpios = <&gpj0 7 0>; | 508 | gpios = <&gpj0 7 0>; |
509 | }; | 509 | }; |
diff --git a/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts index 090f9830b129..cde19c818667 100644 --- a/arch/arm/boot/dts/exynos5250-arndale.dts +++ b/arch/arm/boot/dts/exynos5250-arndale.dts | |||
@@ -107,6 +107,7 @@ | |||
107 | regulator-name = "VDD_IOPERI_1.8V"; | 107 | regulator-name = "VDD_IOPERI_1.8V"; |
108 | regulator-min-microvolt = <1800000>; | 108 | regulator-min-microvolt = <1800000>; |
109 | regulator-max-microvolt = <1800000>; | 109 | regulator-max-microvolt = <1800000>; |
110 | regulator-always-on; | ||
110 | op_mode = <1>; | 111 | op_mode = <1>; |
111 | }; | 112 | }; |
112 | 113 | ||
diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-octa.dts index 80a3bf4c5986..896a2a6619e0 100644 --- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts +++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts | |||
@@ -364,16 +364,4 @@ | |||
364 | gpio-key,wakeup; | 364 | gpio-key,wakeup; |
365 | }; | 365 | }; |
366 | }; | 366 | }; |
367 | |||
368 | amba { | ||
369 | mdma1: mdma@11C10000 { | ||
370 | /* | ||
371 | * MDMA1 can support both secure and non-secure | ||
372 | * AXI transactions. When this is enabled in the kernel | ||
373 | * for boards that run in secure mode, we are getting | ||
374 | * imprecise external aborts causing the kernel to oops. | ||
375 | */ | ||
376 | status = "disabled"; | ||
377 | }; | ||
378 | }; | ||
379 | }; | 367 | }; |
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi index c3a9a66c5767..b69fbcb7dcb8 100644 --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi | |||
@@ -219,16 +219,6 @@ | |||
219 | reg = <0x100440C0 0x20>; | 219 | reg = <0x100440C0 0x20>; |
220 | }; | 220 | }; |
221 | 221 | ||
222 | mau_pd: power-domain@100440E0 { | ||
223 | compatible = "samsung,exynos4210-pd"; | ||
224 | reg = <0x100440E0 0x20>; | ||
225 | }; | ||
226 | |||
227 | g2d_pd: power-domain@10044100 { | ||
228 | compatible = "samsung,exynos4210-pd"; | ||
229 | reg = <0x10044100 0x20>; | ||
230 | }; | ||
231 | |||
232 | msc_pd: power-domain@10044120 { | 222 | msc_pd: power-domain@10044120 { |
233 | compatible = "samsung,exynos4210-pd"; | 223 | compatible = "samsung,exynos4210-pd"; |
234 | reg = <0x10044120 0x20>; | 224 | reg = <0x10044120 0x20>; |
@@ -336,6 +326,13 @@ | |||
336 | #dma-cells = <1>; | 326 | #dma-cells = <1>; |
337 | #dma-channels = <8>; | 327 | #dma-channels = <8>; |
338 | #dma-requests = <1>; | 328 | #dma-requests = <1>; |
329 | /* | ||
330 | * MDMA1 can support both secure and non-secure | ||
331 | * AXI transactions. When this is enabled in the kernel | ||
332 | * for boards that run in secure mode, we are getting | ||
333 | * imprecise external aborts causing the kernel to oops. | ||
334 | */ | ||
335 | status = "disabled"; | ||
339 | }; | 336 | }; |
340 | }; | 337 | }; |
341 | 338 | ||
@@ -385,7 +382,7 @@ | |||
385 | spi_0: spi@12d20000 { | 382 | spi_0: spi@12d20000 { |
386 | compatible = "samsung,exynos4210-spi"; | 383 | compatible = "samsung,exynos4210-spi"; |
387 | reg = <0x12d20000 0x100>; | 384 | reg = <0x12d20000 0x100>; |
388 | interrupts = <0 66 0>; | 385 | interrupts = <0 68 0>; |
389 | dmas = <&pdma0 5 | 386 | dmas = <&pdma0 5 |
390 | &pdma0 4>; | 387 | &pdma0 4>; |
391 | dma-names = "tx", "rx"; | 388 | dma-names = "tx", "rx"; |
@@ -401,7 +398,7 @@ | |||
401 | spi_1: spi@12d30000 { | 398 | spi_1: spi@12d30000 { |
402 | compatible = "samsung,exynos4210-spi"; | 399 | compatible = "samsung,exynos4210-spi"; |
403 | reg = <0x12d30000 0x100>; | 400 | reg = <0x12d30000 0x100>; |
404 | interrupts = <0 67 0>; | 401 | interrupts = <0 69 0>; |
405 | dmas = <&pdma1 5 | 402 | dmas = <&pdma1 5 |
406 | &pdma1 4>; | 403 | &pdma1 4>; |
407 | dma-names = "tx", "rx"; | 404 | dma-names = "tx", "rx"; |
@@ -417,7 +414,7 @@ | |||
417 | spi_2: spi@12d40000 { | 414 | spi_2: spi@12d40000 { |
418 | compatible = "samsung,exynos4210-spi"; | 415 | compatible = "samsung,exynos4210-spi"; |
419 | reg = <0x12d40000 0x100>; | 416 | reg = <0x12d40000 0x100>; |
420 | interrupts = <0 68 0>; | 417 | interrupts = <0 70 0>; |
421 | dmas = <&pdma0 7 | 418 | dmas = <&pdma0 7 |
422 | &pdma0 6>; | 419 | &pdma0 6>; |
423 | dma-names = "tx", "rx"; | 420 | dma-names = "tx", "rx"; |
@@ -730,6 +727,5 @@ | |||
730 | interrupts = <0 112 0>; | 727 | interrupts = <0 112 0>; |
731 | clocks = <&clock 471>; | 728 | clocks = <&clock 471>; |
732 | clock-names = "secss"; | 729 | clock-names = "secss"; |
733 | samsung,power-domain = <&g2d_pd>; | ||
734 | }; | 730 | }; |
735 | }; | 731 | }; |
diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi index 32f760e24898..ea323f09dc78 100644 --- a/arch/arm/boot/dts/imx25.dtsi +++ b/arch/arm/boot/dts/imx25.dtsi | |||
@@ -56,6 +56,7 @@ | |||
56 | 56 | ||
57 | osc { | 57 | osc { |
58 | compatible = "fsl,imx-osc", "fixed-clock"; | 58 | compatible = "fsl,imx-osc", "fixed-clock"; |
59 | #clock-cells = <0>; | ||
59 | clock-frequency = <24000000>; | 60 | clock-frequency = <24000000>; |
60 | }; | 61 | }; |
61 | }; | 62 | }; |
diff --git a/arch/arm/boot/dts/imx27-apf27.dts b/arch/arm/boot/dts/imx27-apf27.dts index 09f57b39e3ef..73aae4f5e539 100644 --- a/arch/arm/boot/dts/imx27-apf27.dts +++ b/arch/arm/boot/dts/imx27-apf27.dts | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | osc26m { | 30 | osc26m { |
31 | compatible = "fsl,imx-osc26m", "fixed-clock"; | 31 | compatible = "fsl,imx-osc26m", "fixed-clock"; |
32 | #clock-cells = <0>; | ||
32 | clock-frequency = <0>; | 33 | clock-frequency = <0>; |
33 | }; | 34 | }; |
34 | }; | 35 | }; |
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi index 6279e0b4f768..137e010eab35 100644 --- a/arch/arm/boot/dts/imx27.dtsi +++ b/arch/arm/boot/dts/imx27.dtsi | |||
@@ -48,6 +48,7 @@ | |||
48 | 48 | ||
49 | osc26m { | 49 | osc26m { |
50 | compatible = "fsl,imx-osc26m", "fixed-clock"; | 50 | compatible = "fsl,imx-osc26m", "fixed-clock"; |
51 | #clock-cells = <0>; | ||
51 | clock-frequency = <26000000>; | 52 | clock-frequency = <26000000>; |
52 | }; | 53 | }; |
53 | }; | 54 | }; |
diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi index 0c75fe3deb35..9c89d1ca97c2 100644 --- a/arch/arm/boot/dts/imx50.dtsi +++ b/arch/arm/boot/dts/imx50.dtsi | |||
@@ -53,21 +53,25 @@ | |||
53 | 53 | ||
54 | ckil { | 54 | ckil { |
55 | compatible = "fsl,imx-ckil", "fixed-clock"; | 55 | compatible = "fsl,imx-ckil", "fixed-clock"; |
56 | #clock-cells = <0>; | ||
56 | clock-frequency = <32768>; | 57 | clock-frequency = <32768>; |
57 | }; | 58 | }; |
58 | 59 | ||
59 | ckih1 { | 60 | ckih1 { |
60 | compatible = "fsl,imx-ckih1", "fixed-clock"; | 61 | compatible = "fsl,imx-ckih1", "fixed-clock"; |
62 | #clock-cells = <0>; | ||
61 | clock-frequency = <22579200>; | 63 | clock-frequency = <22579200>; |
62 | }; | 64 | }; |
63 | 65 | ||
64 | ckih2 { | 66 | ckih2 { |
65 | compatible = "fsl,imx-ckih2", "fixed-clock"; | 67 | compatible = "fsl,imx-ckih2", "fixed-clock"; |
68 | #clock-cells = <0>; | ||
66 | clock-frequency = <0>; | 69 | clock-frequency = <0>; |
67 | }; | 70 | }; |
68 | 71 | ||
69 | osc { | 72 | osc { |
70 | compatible = "fsl,imx-osc", "fixed-clock"; | 73 | compatible = "fsl,imx-osc", "fixed-clock"; |
74 | #clock-cells = <0>; | ||
71 | clock-frequency = <24000000>; | 75 | clock-frequency = <24000000>; |
72 | }; | 76 | }; |
73 | }; | 77 | }; |
diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi index 5f8216d08f6b..150bb4e2f744 100644 --- a/arch/arm/boot/dts/imx51.dtsi +++ b/arch/arm/boot/dts/imx51.dtsi | |||
@@ -50,21 +50,25 @@ | |||
50 | 50 | ||
51 | ckil { | 51 | ckil { |
52 | compatible = "fsl,imx-ckil", "fixed-clock"; | 52 | compatible = "fsl,imx-ckil", "fixed-clock"; |
53 | #clock-cells = <0>; | ||
53 | clock-frequency = <32768>; | 54 | clock-frequency = <32768>; |
54 | }; | 55 | }; |
55 | 56 | ||
56 | ckih1 { | 57 | ckih1 { |
57 | compatible = "fsl,imx-ckih1", "fixed-clock"; | 58 | compatible = "fsl,imx-ckih1", "fixed-clock"; |
59 | #clock-cells = <0>; | ||
58 | clock-frequency = <0>; | 60 | clock-frequency = <0>; |
59 | }; | 61 | }; |
60 | 62 | ||
61 | ckih2 { | 63 | ckih2 { |
62 | compatible = "fsl,imx-ckih2", "fixed-clock"; | 64 | compatible = "fsl,imx-ckih2", "fixed-clock"; |
65 | #clock-cells = <0>; | ||
63 | clock-frequency = <0>; | 66 | clock-frequency = <0>; |
64 | }; | 67 | }; |
65 | 68 | ||
66 | osc { | 69 | osc { |
67 | compatible = "fsl,imx-osc", "fixed-clock"; | 70 | compatible = "fsl,imx-osc", "fixed-clock"; |
71 | #clock-cells = <0>; | ||
68 | clock-frequency = <24000000>; | 72 | clock-frequency = <24000000>; |
69 | }; | 73 | }; |
70 | }; | 74 | }; |
diff --git a/arch/arm/boot/dts/imx53-m53evk.dts b/arch/arm/boot/dts/imx53-m53evk.dts index f6d3ac3e5587..d5d146a8b149 100644 --- a/arch/arm/boot/dts/imx53-m53evk.dts +++ b/arch/arm/boot/dts/imx53-m53evk.dts | |||
@@ -17,7 +17,8 @@ | |||
17 | compatible = "denx,imx53-m53evk", "fsl,imx53"; | 17 | compatible = "denx,imx53-m53evk", "fsl,imx53"; |
18 | 18 | ||
19 | memory { | 19 | memory { |
20 | reg = <0x70000000 0x20000000>; | 20 | reg = <0x70000000 0x20000000>, |
21 | <0xb0000000 0x20000000>; | ||
21 | }; | 22 | }; |
22 | 23 | ||
23 | soc { | 24 | soc { |
@@ -193,17 +194,17 @@ | |||
193 | irq-trigger = <0x1>; | 194 | irq-trigger = <0x1>; |
194 | 195 | ||
195 | stmpe_touchscreen { | 196 | stmpe_touchscreen { |
196 | compatible = "stmpe,ts"; | 197 | compatible = "st,stmpe-ts"; |
197 | reg = <0>; | 198 | reg = <0>; |
198 | ts,sample-time = <4>; | 199 | st,sample-time = <4>; |
199 | ts,mod-12b = <1>; | 200 | st,mod-12b = <1>; |
200 | ts,ref-sel = <0>; | 201 | st,ref-sel = <0>; |
201 | ts,adc-freq = <1>; | 202 | st,adc-freq = <1>; |
202 | ts,ave-ctrl = <3>; | 203 | st,ave-ctrl = <3>; |
203 | ts,touch-det-delay = <3>; | 204 | st,touch-det-delay = <3>; |
204 | ts,settling = <4>; | 205 | st,settling = <4>; |
205 | ts,fraction-z = <7>; | 206 | st,fraction-z = <7>; |
206 | ts,i-drive = <1>; | 207 | st,i-drive = <1>; |
207 | }; | 208 | }; |
208 | }; | 209 | }; |
209 | 210 | ||
diff --git a/arch/arm/boot/dts/imx53-mba53.dts b/arch/arm/boot/dts/imx53-mba53.dts index 7c8c12969892..a3431d784870 100644 --- a/arch/arm/boot/dts/imx53-mba53.dts +++ b/arch/arm/boot/dts/imx53-mba53.dts | |||
@@ -244,7 +244,7 @@ | |||
244 | &tve { | 244 | &tve { |
245 | pinctrl-names = "default"; | 245 | pinctrl-names = "default"; |
246 | pinctrl-0 = <&pinctrl_vga_sync_1>; | 246 | pinctrl-0 = <&pinctrl_vga_sync_1>; |
247 | i2c-ddc-bus = <&i2c3>; | 247 | ddc-i2c-bus = <&i2c3>; |
248 | fsl,tve-mode = "vga"; | 248 | fsl,tve-mode = "vga"; |
249 | fsl,hsync-pin = <4>; | 249 | fsl,hsync-pin = <4>; |
250 | fsl,vsync-pin = <6>; | 250 | fsl,vsync-pin = <6>; |
diff --git a/arch/arm/boot/dts/imx53-qsb-common.dtsi b/arch/arm/boot/dts/imx53-qsb-common.dtsi index 3f825a6813da..ede04fa4161f 100644 --- a/arch/arm/boot/dts/imx53-qsb-common.dtsi +++ b/arch/arm/boot/dts/imx53-qsb-common.dtsi | |||
@@ -14,7 +14,8 @@ | |||
14 | 14 | ||
15 | / { | 15 | / { |
16 | memory { | 16 | memory { |
17 | reg = <0x70000000 0x40000000>; | 17 | reg = <0x70000000 0x20000000>, |
18 | <0xb0000000 0x20000000>; | ||
18 | }; | 19 | }; |
19 | 20 | ||
20 | display0: display@di0 { | 21 | display0: display@di0 { |
diff --git a/arch/arm/boot/dts/imx53-tx53-x03x.dts b/arch/arm/boot/dts/imx53-tx53-x03x.dts index 0217dde3b36b..3b73e81dc3f0 100644 --- a/arch/arm/boot/dts/imx53-tx53-x03x.dts +++ b/arch/arm/boot/dts/imx53-tx53-x03x.dts | |||
@@ -25,12 +25,17 @@ | |||
25 | soc { | 25 | soc { |
26 | display: display@di0 { | 26 | display: display@di0 { |
27 | compatible = "fsl,imx-parallel-display"; | 27 | compatible = "fsl,imx-parallel-display"; |
28 | crtcs = <&ipu 0>; | ||
29 | interface-pix-fmt = "rgb24"; | 28 | interface-pix-fmt = "rgb24"; |
30 | pinctrl-names = "default"; | 29 | pinctrl-names = "default"; |
31 | pinctrl-0 = <&pinctrl_rgb24_vga1>; | 30 | pinctrl-0 = <&pinctrl_rgb24_vga1>; |
32 | status = "okay"; | 31 | status = "okay"; |
33 | 32 | ||
33 | port { | ||
34 | display0_in: endpoint { | ||
35 | remote-endpoint = <&ipu_di0_disp0>; | ||
36 | }; | ||
37 | }; | ||
38 | |||
34 | display-timings { | 39 | display-timings { |
35 | VGA { | 40 | VGA { |
36 | clock-frequency = <25200000>; | 41 | clock-frequency = <25200000>; |
@@ -293,6 +298,10 @@ | |||
293 | }; | 298 | }; |
294 | }; | 299 | }; |
295 | 300 | ||
301 | &ipu_di0_disp0 { | ||
302 | remote-endpoint = <&display0_in>; | ||
303 | }; | ||
304 | |||
296 | &kpp { | 305 | &kpp { |
297 | pinctrl-names = "default"; | 306 | pinctrl-names = "default"; |
298 | pinctrl-0 = <&pinctrl_kpp>; | 307 | pinctrl-0 = <&pinctrl_kpp>; |
diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi index b57ab57740f6..6a1bf4ff83d5 100644 --- a/arch/arm/boot/dts/imx53.dtsi +++ b/arch/arm/boot/dts/imx53.dtsi | |||
@@ -70,21 +70,25 @@ | |||
70 | 70 | ||
71 | ckil { | 71 | ckil { |
72 | compatible = "fsl,imx-ckil", "fixed-clock"; | 72 | compatible = "fsl,imx-ckil", "fixed-clock"; |
73 | #clock-cells = <0>; | ||
73 | clock-frequency = <32768>; | 74 | clock-frequency = <32768>; |
74 | }; | 75 | }; |
75 | 76 | ||
76 | ckih1 { | 77 | ckih1 { |
77 | compatible = "fsl,imx-ckih1", "fixed-clock"; | 78 | compatible = "fsl,imx-ckih1", "fixed-clock"; |
79 | #clock-cells = <0>; | ||
78 | clock-frequency = <22579200>; | 80 | clock-frequency = <22579200>; |
79 | }; | 81 | }; |
80 | 82 | ||
81 | ckih2 { | 83 | ckih2 { |
82 | compatible = "fsl,imx-ckih2", "fixed-clock"; | 84 | compatible = "fsl,imx-ckih2", "fixed-clock"; |
85 | #clock-cells = <0>; | ||
83 | clock-frequency = <0>; | 86 | clock-frequency = <0>; |
84 | }; | 87 | }; |
85 | 88 | ||
86 | osc { | 89 | osc { |
87 | compatible = "fsl,imx-osc", "fixed-clock"; | 90 | compatible = "fsl,imx-osc", "fixed-clock"; |
91 | #clock-cells = <0>; | ||
88 | clock-frequency = <24000000>; | 92 | clock-frequency = <24000000>; |
89 | }; | 93 | }; |
90 | }; | 94 | }; |
@@ -111,7 +115,7 @@ | |||
111 | #address-cells = <1>; | 115 | #address-cells = <1>; |
112 | #size-cells = <0>; | 116 | #size-cells = <0>; |
113 | compatible = "fsl,imx53-ipu"; | 117 | compatible = "fsl,imx53-ipu"; |
114 | reg = <0x18000000 0x080000000>; | 118 | reg = <0x18000000 0x08000000>; |
115 | interrupts = <11 10>; | 119 | interrupts = <11 10>; |
116 | clocks = <&clks IMX5_CLK_IPU_GATE>, | 120 | clocks = <&clks IMX5_CLK_IPU_GATE>, |
117 | <&clks IMX5_CLK_IPU_DI0_GATE>, | 121 | <&clks IMX5_CLK_IPU_DI0_GATE>, |
@@ -430,7 +434,7 @@ | |||
430 | 434 | ||
431 | port { | 435 | port { |
432 | lvds1_in: endpoint { | 436 | lvds1_in: endpoint { |
433 | remote-endpoint = <&ipu_di0_lvds0>; | 437 | remote-endpoint = <&ipu_di1_lvds1>; |
434 | }; | 438 | }; |
435 | }; | 439 | }; |
436 | }; | 440 | }; |
diff --git a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts index a63bbb3d46bb..e4ae38fd0269 100644 --- a/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts +++ b/arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts | |||
@@ -19,7 +19,10 @@ | |||
19 | compatible = "dmo,imx6q-edmqmx6", "fsl,imx6q"; | 19 | compatible = "dmo,imx6q-edmqmx6", "fsl,imx6q"; |
20 | 20 | ||
21 | aliases { | 21 | aliases { |
22 | gpio7 = &stmpe_gpio; | 22 | gpio7 = &stmpe_gpio1; |
23 | gpio8 = &stmpe_gpio2; | ||
24 | stmpe-i2c0 = &stmpe1; | ||
25 | stmpe-i2c1 = &stmpe2; | ||
23 | }; | 26 | }; |
24 | 27 | ||
25 | memory { | 28 | memory { |
@@ -40,13 +43,15 @@ | |||
40 | regulator-always-on; | 43 | regulator-always-on; |
41 | }; | 44 | }; |
42 | 45 | ||
43 | reg_usb_otg_vbus: regulator@1 { | 46 | reg_usb_otg_switch: regulator@1 { |
44 | compatible = "regulator-fixed"; | 47 | compatible = "regulator-fixed"; |
45 | reg = <1>; | 48 | reg = <1>; |
46 | regulator-name = "usb_otg_vbus"; | 49 | regulator-name = "usb_otg_switch"; |
47 | regulator-min-microvolt = <5000000>; | 50 | regulator-min-microvolt = <5000000>; |
48 | regulator-max-microvolt = <5000000>; | 51 | regulator-max-microvolt = <5000000>; |
49 | gpio = <&gpio7 12 0>; | 52 | gpio = <&gpio7 12 0>; |
53 | regulator-boot-on; | ||
54 | regulator-always-on; | ||
50 | }; | 55 | }; |
51 | 56 | ||
52 | reg_usb_host1: regulator@2 { | 57 | reg_usb_host1: regulator@2 { |
@@ -65,23 +70,23 @@ | |||
65 | 70 | ||
66 | led-blue { | 71 | led-blue { |
67 | label = "blue"; | 72 | label = "blue"; |
68 | gpios = <&stmpe_gpio 8 GPIO_ACTIVE_HIGH>; | 73 | gpios = <&stmpe_gpio1 8 GPIO_ACTIVE_HIGH>; |
69 | linux,default-trigger = "heartbeat"; | 74 | linux,default-trigger = "heartbeat"; |
70 | }; | 75 | }; |
71 | 76 | ||
72 | led-green { | 77 | led-green { |
73 | label = "green"; | 78 | label = "green"; |
74 | gpios = <&stmpe_gpio 9 GPIO_ACTIVE_HIGH>; | 79 | gpios = <&stmpe_gpio1 9 GPIO_ACTIVE_HIGH>; |
75 | }; | 80 | }; |
76 | 81 | ||
77 | led-pink { | 82 | led-pink { |
78 | label = "pink"; | 83 | label = "pink"; |
79 | gpios = <&stmpe_gpio 10 GPIO_ACTIVE_HIGH>; | 84 | gpios = <&stmpe_gpio1 10 GPIO_ACTIVE_HIGH>; |
80 | }; | 85 | }; |
81 | 86 | ||
82 | led-red { | 87 | led-red { |
83 | label = "red"; | 88 | label = "red"; |
84 | gpios = <&stmpe_gpio 11 GPIO_ACTIVE_HIGH>; | 89 | gpios = <&stmpe_gpio1 11 GPIO_ACTIVE_HIGH>; |
85 | }; | 90 | }; |
86 | }; | 91 | }; |
87 | }; | 92 | }; |
@@ -99,7 +104,8 @@ | |||
99 | clock-frequency = <100000>; | 104 | clock-frequency = <100000>; |
100 | pinctrl-names = "default"; | 105 | pinctrl-names = "default"; |
101 | pinctrl-0 = <&pinctrl_i2c2 | 106 | pinctrl-0 = <&pinctrl_i2c2 |
102 | &pinctrl_stmpe>; | 107 | &pinctrl_stmpe1 |
108 | &pinctrl_stmpe2>; | ||
103 | status = "okay"; | 109 | status = "okay"; |
104 | 110 | ||
105 | pmic: pfuze100@08 { | 111 | pmic: pfuze100@08 { |
@@ -205,13 +211,25 @@ | |||
205 | }; | 211 | }; |
206 | }; | 212 | }; |
207 | 213 | ||
208 | stmpe: stmpe1601@40 { | 214 | stmpe1: stmpe1601@40 { |
209 | compatible = "st,stmpe1601"; | 215 | compatible = "st,stmpe1601"; |
210 | reg = <0x40>; | 216 | reg = <0x40>; |
211 | interrupts = <30 0>; | 217 | interrupts = <30 0>; |
212 | interrupt-parent = <&gpio3>; | 218 | interrupt-parent = <&gpio3>; |
213 | 219 | ||
214 | stmpe_gpio: stmpe_gpio { | 220 | stmpe_gpio1: stmpe_gpio { |
221 | #gpio-cells = <2>; | ||
222 | compatible = "st,stmpe-gpio"; | ||
223 | }; | ||
224 | }; | ||
225 | |||
226 | stmpe2: stmpe1601@44 { | ||
227 | compatible = "st,stmpe1601"; | ||
228 | reg = <0x44>; | ||
229 | interrupts = <2 0>; | ||
230 | interrupt-parent = <&gpio5>; | ||
231 | |||
232 | stmpe_gpio2: stmpe_gpio { | ||
215 | #gpio-cells = <2>; | 233 | #gpio-cells = <2>; |
216 | compatible = "st,stmpe-gpio"; | 234 | compatible = "st,stmpe-gpio"; |
217 | }; | 235 | }; |
@@ -273,10 +291,14 @@ | |||
273 | >; | 291 | >; |
274 | }; | 292 | }; |
275 | 293 | ||
276 | pinctrl_stmpe: stmpegrp { | 294 | pinctrl_stmpe1: stmpe1grp { |
277 | fsl,pins = <MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x80000000>; | 295 | fsl,pins = <MX6QDL_PAD_EIM_D30__GPIO3_IO30 0x80000000>; |
278 | }; | 296 | }; |
279 | 297 | ||
298 | pinctrl_stmpe2: stmpe2grp { | ||
299 | fsl,pins = <MX6QDL_PAD_EIM_A25__GPIO5_IO02 0x80000000>; | ||
300 | }; | ||
301 | |||
280 | pinctrl_uart1: uart1grp { | 302 | pinctrl_uart1: uart1grp { |
281 | fsl,pins = < | 303 | fsl,pins = < |
282 | MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1 | 304 | MX6QDL_PAD_SD3_DAT7__UART1_TX_DATA 0x1b0b1 |
@@ -293,7 +315,7 @@ | |||
293 | 315 | ||
294 | pinctrl_usbotg: usbotggrp { | 316 | pinctrl_usbotg: usbotggrp { |
295 | fsl,pins = < | 317 | fsl,pins = < |
296 | MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059 | 318 | MX6QDL_PAD_ENET_RX_ER__USB_OTG_ID 0x17059 |
297 | >; | 319 | >; |
298 | }; | 320 | }; |
299 | 321 | ||
@@ -344,11 +366,11 @@ | |||
344 | &usbh1 { | 366 | &usbh1 { |
345 | vbus-supply = <®_usb_host1>; | 367 | vbus-supply = <®_usb_host1>; |
346 | disable-over-current; | 368 | disable-over-current; |
369 | dr_mode = "host"; | ||
347 | status = "okay"; | 370 | status = "okay"; |
348 | }; | 371 | }; |
349 | 372 | ||
350 | &usbotg { | 373 | &usbotg { |
351 | vbus-supply = <®_usb_otg_vbus>; | ||
352 | pinctrl-names = "default"; | 374 | pinctrl-names = "default"; |
353 | pinctrl-0 = <&pinctrl_usbotg>; | 375 | pinctrl-0 = <&pinctrl_usbotg>; |
354 | disable-over-current; | 376 | disable-over-current; |
diff --git a/arch/arm/boot/dts/imx6q-gw5400-a.dts b/arch/arm/boot/dts/imx6q-gw5400-a.dts index 902f98310481..e51bb3f0fd56 100644 --- a/arch/arm/boot/dts/imx6q-gw5400-a.dts +++ b/arch/arm/boot/dts/imx6q-gw5400-a.dts | |||
@@ -487,9 +487,6 @@ | |||
487 | 487 | ||
488 | &ldb { | 488 | &ldb { |
489 | status = "okay"; | 489 | status = "okay"; |
490 | lvds-channel@0 { | ||
491 | crtcs = <&ipu1 0>, <&ipu1 1>, <&ipu2 0>, <&ipu2 1>; | ||
492 | }; | ||
493 | }; | 490 | }; |
494 | 491 | ||
495 | &pcie { | 492 | &pcie { |
diff --git a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi index 8e99c9a9bc76..035d3a85c318 100644 --- a/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi +++ b/arch/arm/boot/dts/imx6qdl-gw52xx.dtsi | |||
@@ -436,9 +436,6 @@ | |||
436 | 436 | ||
437 | &ldb { | 437 | &ldb { |
438 | status = "okay"; | 438 | status = "okay"; |
439 | lvds-channel@0 { | ||
440 | crtcs = <&ipu1 0>, <&ipu1 1>; | ||
441 | }; | ||
442 | }; | 439 | }; |
443 | 440 | ||
444 | &pcie { | 441 | &pcie { |
diff --git a/arch/arm/boot/dts/imx6qdl-microsom-ar8035.dtsi b/arch/arm/boot/dts/imx6qdl-microsom-ar8035.dtsi index a3cb2fff8f61..d16066608e21 100644 --- a/arch/arm/boot/dts/imx6qdl-microsom-ar8035.dtsi +++ b/arch/arm/boot/dts/imx6qdl-microsom-ar8035.dtsi | |||
@@ -26,25 +26,25 @@ | |||
26 | /* GPIO16 -> AR8035 25MHz */ | 26 | /* GPIO16 -> AR8035 25MHz */ |
27 | MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0xc0000000 | 27 | MX6QDL_PAD_GPIO_16__ENET_REF_CLK 0xc0000000 |
28 | MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x80000000 | 28 | MX6QDL_PAD_RGMII_TXC__RGMII_TXC 0x80000000 |
29 | MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b0b0 | 29 | MX6QDL_PAD_RGMII_TD0__RGMII_TD0 0x1b030 |
30 | MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b0b0 | 30 | MX6QDL_PAD_RGMII_TD1__RGMII_TD1 0x1b030 |
31 | MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b0b0 | 31 | MX6QDL_PAD_RGMII_TD2__RGMII_TD2 0x1b030 |
32 | MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b0b0 | 32 | MX6QDL_PAD_RGMII_TD3__RGMII_TD3 0x1b030 |
33 | MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b0b0 | 33 | MX6QDL_PAD_RGMII_TX_CTL__RGMII_TX_CTL 0x1b030 |
34 | /* AR8035 CLK_25M --> ENET_REF_CLK (V22) */ | 34 | /* AR8035 CLK_25M --> ENET_REF_CLK (V22) */ |
35 | MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x0a0b1 | 35 | MX6QDL_PAD_ENET_REF_CLK__ENET_TX_CLK 0x0a0b1 |
36 | /* AR8035 pin strapping: IO voltage: pull up */ | 36 | /* AR8035 pin strapping: IO voltage: pull up */ |
37 | MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b0b0 | 37 | MX6QDL_PAD_RGMII_RXC__RGMII_RXC 0x1b030 |
38 | /* AR8035 pin strapping: PHYADDR#0: pull down */ | 38 | /* AR8035 pin strapping: PHYADDR#0: pull down */ |
39 | MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x130b0 | 39 | MX6QDL_PAD_RGMII_RD0__RGMII_RD0 0x13030 |
40 | /* AR8035 pin strapping: PHYADDR#1: pull down */ | 40 | /* AR8035 pin strapping: PHYADDR#1: pull down */ |
41 | MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x130b0 | 41 | MX6QDL_PAD_RGMII_RD1__RGMII_RD1 0x13030 |
42 | /* AR8035 pin strapping: MODE#1: pull up */ | 42 | /* AR8035 pin strapping: MODE#1: pull up */ |
43 | MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b0b0 | 43 | MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b030 |
44 | /* AR8035 pin strapping: MODE#3: pull up */ | 44 | /* AR8035 pin strapping: MODE#3: pull up */ |
45 | MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b0b0 | 45 | MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b030 |
46 | /* AR8035 pin strapping: MODE#0: pull down */ | 46 | /* AR8035 pin strapping: MODE#0: pull down */ |
47 | MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x130b0 | 47 | MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x13030 |
48 | 48 | ||
49 | /* | 49 | /* |
50 | * As the RMII pins are also connected to RGMII | 50 | * As the RMII pins are also connected to RGMII |
diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi index 55cb926fa3f7..eca0971d4db1 100644 --- a/arch/arm/boot/dts/imx6qdl.dtsi +++ b/arch/arm/boot/dts/imx6qdl.dtsi | |||
@@ -10,6 +10,8 @@ | |||
10 | * http://www.gnu.org/copyleft/gpl.html | 10 | * http://www.gnu.org/copyleft/gpl.html |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <dt-bindings/interrupt-controller/arm-gic.h> | ||
14 | |||
13 | #include "skeleton.dtsi" | 15 | #include "skeleton.dtsi" |
14 | 16 | ||
15 | / { | 17 | / { |
@@ -46,8 +48,6 @@ | |||
46 | intc: interrupt-controller@00a01000 { | 48 | intc: interrupt-controller@00a01000 { |
47 | compatible = "arm,cortex-a9-gic"; | 49 | compatible = "arm,cortex-a9-gic"; |
48 | #interrupt-cells = <3>; | 50 | #interrupt-cells = <3>; |
49 | #address-cells = <1>; | ||
50 | #size-cells = <1>; | ||
51 | interrupt-controller; | 51 | interrupt-controller; |
52 | reg = <0x00a01000 0x1000>, | 52 | reg = <0x00a01000 0x1000>, |
53 | <0x00a00100 0x100>; | 53 | <0x00a00100 0x100>; |
@@ -59,16 +59,19 @@ | |||
59 | 59 | ||
60 | ckil { | 60 | ckil { |
61 | compatible = "fsl,imx-ckil", "fixed-clock"; | 61 | compatible = "fsl,imx-ckil", "fixed-clock"; |
62 | #clock-cells = <0>; | ||
62 | clock-frequency = <32768>; | 63 | clock-frequency = <32768>; |
63 | }; | 64 | }; |
64 | 65 | ||
65 | ckih1 { | 66 | ckih1 { |
66 | compatible = "fsl,imx-ckih1", "fixed-clock"; | 67 | compatible = "fsl,imx-ckih1", "fixed-clock"; |
68 | #clock-cells = <0>; | ||
67 | clock-frequency = <0>; | 69 | clock-frequency = <0>; |
68 | }; | 70 | }; |
69 | 71 | ||
70 | osc { | 72 | osc { |
71 | compatible = "fsl,imx-osc", "fixed-clock"; | 73 | compatible = "fsl,imx-osc", "fixed-clock"; |
74 | #clock-cells = <0>; | ||
72 | clock-frequency = <24000000>; | 75 | clock-frequency = <24000000>; |
73 | }; | 76 | }; |
74 | }; | 77 | }; |
@@ -138,6 +141,12 @@ | |||
138 | 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */ | 141 | 0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; /* non-prefetchable memory */ |
139 | num-lanes = <1>; | 142 | num-lanes = <1>; |
140 | interrupts = <0 123 IRQ_TYPE_LEVEL_HIGH>; | 143 | interrupts = <0 123 IRQ_TYPE_LEVEL_HIGH>; |
144 | #interrupt-cells = <1>; | ||
145 | interrupt-map-mask = <0 0 0 0x7>; | ||
146 | interrupt-map = <0 0 0 1 &intc GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>, | ||
147 | <0 0 0 2 &intc GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>, | ||
148 | <0 0 0 3 &intc GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>, | ||
149 | <0 0 0 4 &intc GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>; | ||
141 | clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>; | 150 | clocks = <&clks 189>, <&clks 187>, <&clks 206>, <&clks 144>; |
142 | clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi"; | 151 | clock-names = "pcie_ref_125m", "sata_ref_100m", "lvds_gate", "pcie_axi"; |
143 | status = "disabled"; | 152 | status = "disabled"; |
diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts index 864d8dfb51ca..a8d9a93fab85 100644 --- a/arch/arm/boot/dts/imx6sl-evk.dts +++ b/arch/arm/boot/dts/imx6sl-evk.dts | |||
@@ -282,6 +282,7 @@ | |||
282 | MX6SL_PAD_ECSPI1_MISO__ECSPI1_MISO 0x100b1 | 282 | MX6SL_PAD_ECSPI1_MISO__ECSPI1_MISO 0x100b1 |
283 | MX6SL_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x100b1 | 283 | MX6SL_PAD_ECSPI1_MOSI__ECSPI1_MOSI 0x100b1 |
284 | MX6SL_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x100b1 | 284 | MX6SL_PAD_ECSPI1_SCLK__ECSPI1_SCLK 0x100b1 |
285 | MX6SL_PAD_ECSPI1_SS0__GPIO4_IO11 0x80000000 | ||
285 | >; | 286 | >; |
286 | }; | 287 | }; |
287 | 288 | ||
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi index 3cb4941afeef..d26b099260a3 100644 --- a/arch/arm/boot/dts/imx6sl.dtsi +++ b/arch/arm/boot/dts/imx6sl.dtsi | |||
@@ -68,8 +68,6 @@ | |||
68 | intc: interrupt-controller@00a01000 { | 68 | intc: interrupt-controller@00a01000 { |
69 | compatible = "arm,cortex-a9-gic"; | 69 | compatible = "arm,cortex-a9-gic"; |
70 | #interrupt-cells = <3>; | 70 | #interrupt-cells = <3>; |
71 | #address-cells = <1>; | ||
72 | #size-cells = <1>; | ||
73 | interrupt-controller; | 71 | interrupt-controller; |
74 | reg = <0x00a01000 0x1000>, | 72 | reg = <0x00a01000 0x1000>, |
75 | <0x00a00100 0x100>; | 73 | <0x00a00100 0x100>; |
@@ -81,11 +79,13 @@ | |||
81 | 79 | ||
82 | ckil { | 80 | ckil { |
83 | compatible = "fixed-clock"; | 81 | compatible = "fixed-clock"; |
82 | #clock-cells = <0>; | ||
84 | clock-frequency = <32768>; | 83 | clock-frequency = <32768>; |
85 | }; | 84 | }; |
86 | 85 | ||
87 | osc { | 86 | osc { |
88 | compatible = "fixed-clock"; | 87 | compatible = "fixed-clock"; |
88 | #clock-cells = <0>; | ||
89 | clock-frequency = <24000000>; | 89 | clock-frequency = <24000000>; |
90 | }; | 90 | }; |
91 | }; | 91 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-b3.dts b/arch/arm/boot/dts/kirkwood-b3.dts index 40791053106b..6becedebaa4e 100644 --- a/arch/arm/boot/dts/kirkwood-b3.dts +++ b/arch/arm/boot/dts/kirkwood-b3.dts | |||
@@ -75,7 +75,7 @@ | |||
75 | m25p16@0 { | 75 | m25p16@0 { |
76 | #address-cells = <1>; | 76 | #address-cells = <1>; |
77 | #size-cells = <1>; | 77 | #size-cells = <1>; |
78 | compatible = "m25p16"; | 78 | compatible = "st,m25p16"; |
79 | reg = <0>; | 79 | reg = <0>; |
80 | spi-max-frequency = <40000000>; | 80 | spi-max-frequency = <40000000>; |
81 | mode = <0>; | 81 | mode = <0>; |
diff --git a/arch/arm/boot/dts/kirkwood-cloudbox.dts b/arch/arm/boot/dts/kirkwood-cloudbox.dts index 0e06fd3cee4d..3b62aeeaa3a2 100644 --- a/arch/arm/boot/dts/kirkwood-cloudbox.dts +++ b/arch/arm/boot/dts/kirkwood-cloudbox.dts | |||
@@ -46,7 +46,7 @@ | |||
46 | flash@0 { | 46 | flash@0 { |
47 | #address-cells = <1>; | 47 | #address-cells = <1>; |
48 | #size-cells = <1>; | 48 | #size-cells = <1>; |
49 | compatible = "mx25l4005a"; | 49 | compatible = "mxicy,mx25l4005a"; |
50 | reg = <0>; | 50 | reg = <0>; |
51 | spi-max-frequency = <20000000>; | 51 | spi-max-frequency = <20000000>; |
52 | mode = <0>; | 52 | mode = <0>; |
diff --git a/arch/arm/boot/dts/kirkwood-dreamplug.dts b/arch/arm/boot/dts/kirkwood-dreamplug.dts index ef3463e0ae19..28b3ee369778 100644 --- a/arch/arm/boot/dts/kirkwood-dreamplug.dts +++ b/arch/arm/boot/dts/kirkwood-dreamplug.dts | |||
@@ -43,7 +43,7 @@ | |||
43 | m25p40@0 { | 43 | m25p40@0 { |
44 | #address-cells = <1>; | 44 | #address-cells = <1>; |
45 | #size-cells = <1>; | 45 | #size-cells = <1>; |
46 | compatible = "mx25l1606e"; | 46 | compatible = "mxicy,mx25l1606e"; |
47 | reg = <0>; | 47 | reg = <0>; |
48 | spi-max-frequency = <50000000>; | 48 | spi-max-frequency = <50000000>; |
49 | mode = <0>; | 49 | mode = <0>; |
diff --git a/arch/arm/boot/dts/kirkwood-laplug.dts b/arch/arm/boot/dts/kirkwood-laplug.dts index c9e82eff9bf2..6761ffa2c4ab 100644 --- a/arch/arm/boot/dts/kirkwood-laplug.dts +++ b/arch/arm/boot/dts/kirkwood-laplug.dts | |||
@@ -48,7 +48,7 @@ | |||
48 | status = "okay"; | 48 | status = "okay"; |
49 | 49 | ||
50 | eeprom@50 { | 50 | eeprom@50 { |
51 | compatible = "at,24c04"; | 51 | compatible = "atmel,24c04"; |
52 | pagesize = <16>; | 52 | pagesize = <16>; |
53 | reg = <0x50>; | 53 | reg = <0x50>; |
54 | }; | 54 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts index 2cb0dc529165..b939f4f52d16 100644 --- a/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts +++ b/arch/arm/boot/dts/kirkwood-mv88f6281gtw-ge.dts | |||
@@ -30,6 +30,16 @@ | |||
30 | bootargs = "console=ttyS0,115200n8 earlyprintk"; | 30 | bootargs = "console=ttyS0,115200n8 earlyprintk"; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | mbus { | ||
34 | pcie-controller { | ||
35 | status = "okay"; | ||
36 | |||
37 | pcie@1,0 { | ||
38 | status = "okay"; | ||
39 | }; | ||
40 | }; | ||
41 | }; | ||
42 | |||
33 | ocp@f1000000 { | 43 | ocp@f1000000 { |
34 | pinctrl@10000 { | 44 | pinctrl@10000 { |
35 | pmx_usb_led: pmx-usb-led { | 45 | pmx_usb_led: pmx-usb-led { |
@@ -56,7 +66,7 @@ | |||
56 | flash@0 { | 66 | flash@0 { |
57 | #address-cells = <1>; | 67 | #address-cells = <1>; |
58 | #size-cells = <1>; | 68 | #size-cells = <1>; |
59 | compatible = "mx25l12805d"; | 69 | compatible = "mxicy,mx25l12805d"; |
60 | reg = <0>; | 70 | reg = <0>; |
61 | spi-max-frequency = <50000000>; | 71 | spi-max-frequency = <50000000>; |
62 | mode = <0>; | 72 | mode = <0>; |
@@ -73,14 +83,6 @@ | |||
73 | ehci@50000 { | 83 | ehci@50000 { |
74 | status = "okay"; | 84 | status = "okay"; |
75 | }; | 85 | }; |
76 | |||
77 | pcie-controller { | ||
78 | status = "okay"; | ||
79 | |||
80 | pcie@1,0 { | ||
81 | status = "okay"; | ||
82 | }; | ||
83 | }; | ||
84 | }; | 86 | }; |
85 | 87 | ||
86 | gpio-leds { | 88 | gpio-leds { |
diff --git a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi index 743152f31a81..e6e5ec4fe6b9 100644 --- a/arch/arm/boot/dts/kirkwood-ns2-common.dtsi +++ b/arch/arm/boot/dts/kirkwood-ns2-common.dtsi | |||
@@ -32,7 +32,7 @@ | |||
32 | flash@0 { | 32 | flash@0 { |
33 | #address-cells = <1>; | 33 | #address-cells = <1>; |
34 | #size-cells = <1>; | 34 | #size-cells = <1>; |
35 | compatible = "mx25l4005a"; | 35 | compatible = "mxicy,mx25l4005a"; |
36 | reg = <0>; | 36 | reg = <0>; |
37 | spi-max-frequency = <20000000>; | 37 | spi-max-frequency = <20000000>; |
38 | mode = <0>; | 38 | mode = <0>; |
@@ -50,7 +50,7 @@ | |||
50 | status = "okay"; | 50 | status = "okay"; |
51 | 51 | ||
52 | eeprom@50 { | 52 | eeprom@50 { |
53 | compatible = "at,24c04"; | 53 | compatible = "atmel,24c04"; |
54 | pagesize = <16>; | 54 | pagesize = <16>; |
55 | reg = <0x50>; | 55 | reg = <0x50>; |
56 | }; | 56 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi b/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi index aa78c2d11fe7..e2cc85cc3b87 100644 --- a/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi +++ b/arch/arm/boot/dts/kirkwood-nsa310-common.dtsi | |||
@@ -4,6 +4,16 @@ | |||
4 | / { | 4 | / { |
5 | model = "ZyXEL NSA310"; | 5 | model = "ZyXEL NSA310"; |
6 | 6 | ||
7 | mbus { | ||
8 | pcie-controller { | ||
9 | status = "okay"; | ||
10 | |||
11 | pcie@1,0 { | ||
12 | status = "okay"; | ||
13 | }; | ||
14 | }; | ||
15 | }; | ||
16 | |||
7 | ocp@f1000000 { | 17 | ocp@f1000000 { |
8 | pinctrl: pinctrl@10000 { | 18 | pinctrl: pinctrl@10000 { |
9 | 19 | ||
@@ -26,14 +36,6 @@ | |||
26 | status = "okay"; | 36 | status = "okay"; |
27 | nr-ports = <2>; | 37 | nr-ports = <2>; |
28 | }; | 38 | }; |
29 | |||
30 | pcie-controller { | ||
31 | status = "okay"; | ||
32 | |||
33 | pcie@1,0 { | ||
34 | status = "okay"; | ||
35 | }; | ||
36 | }; | ||
37 | }; | 39 | }; |
38 | 40 | ||
39 | gpio_poweroff { | 41 | gpio_poweroff { |
diff --git a/arch/arm/boot/dts/kirkwood-nsa310.dts b/arch/arm/boot/dts/kirkwood-nsa310.dts index 03fa24cf3344..0a07af9d8e58 100644 --- a/arch/arm/boot/dts/kirkwood-nsa310.dts +++ b/arch/arm/boot/dts/kirkwood-nsa310.dts | |||
@@ -104,7 +104,7 @@ | |||
104 | status = "okay"; | 104 | status = "okay"; |
105 | 105 | ||
106 | adt7476: adt7476a@2e { | 106 | adt7476: adt7476a@2e { |
107 | compatible = "adt7476"; | 107 | compatible = "adi,adt7476"; |
108 | reg = <0x2e>; | 108 | reg = <0x2e>; |
109 | }; | 109 | }; |
110 | }; | 110 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-nsa310a.dts b/arch/arm/boot/dts/kirkwood-nsa310a.dts index a5e779452867..27ca6a79c48a 100644 --- a/arch/arm/boot/dts/kirkwood-nsa310a.dts +++ b/arch/arm/boot/dts/kirkwood-nsa310a.dts | |||
@@ -94,7 +94,7 @@ | |||
94 | status = "okay"; | 94 | status = "okay"; |
95 | 95 | ||
96 | lm85: lm85@2e { | 96 | lm85: lm85@2e { |
97 | compatible = "lm85"; | 97 | compatible = "national,lm85"; |
98 | reg = <0x2e>; | 98 | reg = <0x2e>; |
99 | }; | 99 | }; |
100 | }; | 100 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts index b88da9392c32..0650beafc1de 100644 --- a/arch/arm/boot/dts/kirkwood-openblocks_a6.dts +++ b/arch/arm/boot/dts/kirkwood-openblocks_a6.dts | |||
@@ -40,7 +40,7 @@ | |||
40 | pinctrl-names = "default"; | 40 | pinctrl-names = "default"; |
41 | 41 | ||
42 | s35390a: s35390a@30 { | 42 | s35390a: s35390a@30 { |
43 | compatible = "s35390a"; | 43 | compatible = "sii,s35390a"; |
44 | reg = <0x30>; | 44 | reg = <0x30>; |
45 | }; | 45 | }; |
46 | }; | 46 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-openblocks_a7.dts b/arch/arm/boot/dts/kirkwood-openblocks_a7.dts index b2f7cae06839..38520a287514 100644 --- a/arch/arm/boot/dts/kirkwood-openblocks_a7.dts +++ b/arch/arm/boot/dts/kirkwood-openblocks_a7.dts | |||
@@ -52,7 +52,7 @@ | |||
52 | pinctrl-names = "default"; | 52 | pinctrl-names = "default"; |
53 | 53 | ||
54 | s24c02: s24c02@50 { | 54 | s24c02: s24c02@50 { |
55 | compatible = "24c02"; | 55 | compatible = "atmel,24c02"; |
56 | reg = <0x50>; | 56 | reg = <0x50>; |
57 | }; | 57 | }; |
58 | }; | 58 | }; |
diff --git a/arch/arm/boot/dts/kirkwood-t5325.dts b/arch/arm/boot/dts/kirkwood-t5325.dts index 7d1c7677a18f..0bd70d928c69 100644 --- a/arch/arm/boot/dts/kirkwood-t5325.dts +++ b/arch/arm/boot/dts/kirkwood-t5325.dts | |||
@@ -127,11 +127,6 @@ | |||
127 | 127 | ||
128 | i2c@11000 { | 128 | i2c@11000 { |
129 | status = "okay"; | 129 | status = "okay"; |
130 | |||
131 | alc5621: alc5621@1a { | ||
132 | compatible = "realtek,alc5621"; | ||
133 | reg = <0x1a>; | ||
134 | }; | ||
135 | }; | 130 | }; |
136 | 131 | ||
137 | serial@12000 { | 132 | serial@12000 { |
diff --git a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi index f577b7df9a29..521c587acaee 100644 --- a/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi +++ b/arch/arm/boot/dts/omap-gpmc-smsc911x.dtsi | |||
@@ -24,11 +24,10 @@ | |||
24 | compatible = "smsc,lan9221", "smsc,lan9115"; | 24 | compatible = "smsc,lan9221", "smsc,lan9115"; |
25 | bank-width = <2>; | 25 | bank-width = <2>; |
26 | gpmc,mux-add-data; | 26 | gpmc,mux-add-data; |
27 | gpmc,cs-on-ns = <0>; | 27 | gpmc,cs-on-ns = <1>; |
28 | gpmc,cs-rd-off-ns = <186>; | 28 | gpmc,cs-rd-off-ns = <180>; |
29 | gpmc,cs-wr-off-ns = <186>; | 29 | gpmc,cs-wr-off-ns = <180>; |
30 | gpmc,adv-on-ns = <12>; | 30 | gpmc,adv-rd-off-ns = <18>; |
31 | gpmc,adv-rd-off-ns = <48>; | ||
32 | gpmc,adv-wr-off-ns = <48>; | 31 | gpmc,adv-wr-off-ns = <48>; |
33 | gpmc,oe-on-ns = <54>; | 32 | gpmc,oe-on-ns = <54>; |
34 | gpmc,oe-off-ns = <168>; | 33 | gpmc,oe-off-ns = <168>; |
@@ -36,12 +35,10 @@ | |||
36 | gpmc,we-off-ns = <168>; | 35 | gpmc,we-off-ns = <168>; |
37 | gpmc,rd-cycle-ns = <186>; | 36 | gpmc,rd-cycle-ns = <186>; |
38 | gpmc,wr-cycle-ns = <186>; | 37 | gpmc,wr-cycle-ns = <186>; |
39 | gpmc,access-ns = <114>; | 38 | gpmc,access-ns = <144>; |
40 | gpmc,page-burst-access-ns = <6>; | 39 | gpmc,page-burst-access-ns = <24>; |
41 | gpmc,bus-turnaround-ns = <12>; | 40 | gpmc,bus-turnaround-ns = <90>; |
42 | gpmc,cycle2cycle-delay-ns = <18>; | 41 | gpmc,cycle2cycle-delay-ns = <90>; |
43 | gpmc,wr-data-mux-bus-ns = <90>; | ||
44 | gpmc,wr-access-ns = <186>; | ||
45 | gpmc,cycle2cycle-samecsen; | 42 | gpmc,cycle2cycle-samecsen; |
46 | gpmc,cycle2cycle-diffcsen; | 43 | gpmc,cycle2cycle-diffcsen; |
47 | vddvario-supply = <&vddvario>; | 44 | vddvario-supply = <&vddvario>; |
diff --git a/arch/arm/boot/dts/omap2.dtsi b/arch/arm/boot/dts/omap2.dtsi index 22f35ea142c1..8f8c07da4ac1 100644 --- a/arch/arm/boot/dts/omap2.dtsi +++ b/arch/arm/boot/dts/omap2.dtsi | |||
@@ -71,13 +71,6 @@ | |||
71 | interrupts = <58>; | 71 | interrupts = <58>; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | mailbox: mailbox@48094000 { | ||
75 | compatible = "ti,omap2-mailbox"; | ||
76 | ti,hwmods = "mailbox"; | ||
77 | reg = <0x48094000 0x200>; | ||
78 | interrupts = <26>; | ||
79 | }; | ||
80 | |||
81 | intc: interrupt-controller@1 { | 74 | intc: interrupt-controller@1 { |
82 | compatible = "ti,omap2-intc"; | 75 | compatible = "ti,omap2-intc"; |
83 | interrupt-controller; | 76 | interrupt-controller; |
diff --git a/arch/arm/boot/dts/omap2420.dtsi b/arch/arm/boot/dts/omap2420.dtsi index 85b1fb014c43..2d9979835f24 100644 --- a/arch/arm/boot/dts/omap2420.dtsi +++ b/arch/arm/boot/dts/omap2420.dtsi | |||
@@ -125,6 +125,14 @@ | |||
125 | dma-names = "tx", "rx"; | 125 | dma-names = "tx", "rx"; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | mailbox: mailbox@48094000 { | ||
129 | compatible = "ti,omap2-mailbox"; | ||
130 | reg = <0x48094000 0x200>; | ||
131 | interrupts = <26>, <34>; | ||
132 | interrupt-names = "dsp", "iva"; | ||
133 | ti,hwmods = "mailbox"; | ||
134 | }; | ||
135 | |||
128 | timer1: timer@48028000 { | 136 | timer1: timer@48028000 { |
129 | compatible = "ti,omap2420-timer"; | 137 | compatible = "ti,omap2420-timer"; |
130 | reg = <0x48028000 0x400>; | 138 | reg = <0x48028000 0x400>; |
diff --git a/arch/arm/boot/dts/omap2430.dtsi b/arch/arm/boot/dts/omap2430.dtsi index d09697dab55e..42d2c61c9e2d 100644 --- a/arch/arm/boot/dts/omap2430.dtsi +++ b/arch/arm/boot/dts/omap2430.dtsi | |||
@@ -216,6 +216,13 @@ | |||
216 | dma-names = "tx", "rx"; | 216 | dma-names = "tx", "rx"; |
217 | }; | 217 | }; |
218 | 218 | ||
219 | mailbox: mailbox@48094000 { | ||
220 | compatible = "ti,omap2-mailbox"; | ||
221 | reg = <0x48094000 0x200>; | ||
222 | interrupts = <26>; | ||
223 | ti,hwmods = "mailbox"; | ||
224 | }; | ||
225 | |||
219 | timer1: timer@49018000 { | 226 | timer1: timer@49018000 { |
220 | compatible = "ti,omap2420-timer"; | 227 | compatible = "ti,omap2420-timer"; |
221 | reg = <0x49018000 0x400>; | 228 | reg = <0x49018000 0x400>; |
diff --git a/arch/arm/boot/dts/omap3-beagle-xm-ab.dts b/arch/arm/boot/dts/omap3-beagle-xm-ab.dts new file mode 100644 index 000000000000..7ac3bcf59d59 --- /dev/null +++ b/arch/arm/boot/dts/omap3-beagle-xm-ab.dts | |||
@@ -0,0 +1,16 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include "omap3-beagle-xm.dts" | ||
10 | |||
11 | / { | ||
12 | /* HS USB Port 2 Power enable was inverted with the xM C */ | ||
13 | hsusb2_power: hsusb2_power_reg { | ||
14 | enable-active-high; | ||
15 | }; | ||
16 | }; | ||
diff --git a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi index d00055809e31..25ba08331d88 100644 --- a/arch/arm/boot/dts/omap3-cm-t3x30.dtsi +++ b/arch/arm/boot/dts/omap3-cm-t3x30.dtsi | |||
@@ -10,18 +10,6 @@ | |||
10 | cpu0-supply = <&vcc>; | 10 | cpu0-supply = <&vcc>; |
11 | }; | 11 | }; |
12 | }; | 12 | }; |
13 | |||
14 | vddvario: regulator-vddvario { | ||
15 | compatible = "regulator-fixed"; | ||
16 | regulator-name = "vddvario"; | ||
17 | regulator-always-on; | ||
18 | }; | ||
19 | |||
20 | vdd33a: regulator-vdd33a { | ||
21 | compatible = "regulator-fixed"; | ||
22 | regulator-name = "vdd33a"; | ||
23 | regulator-always-on; | ||
24 | }; | ||
25 | }; | 13 | }; |
26 | 14 | ||
27 | &omap3_pmx_core { | 15 | &omap3_pmx_core { |
@@ -35,58 +23,34 @@ | |||
35 | 23 | ||
36 | hsusb0_pins: pinmux_hsusb0_pins { | 24 | hsusb0_pins: pinmux_hsusb0_pins { |
37 | pinctrl-single,pins = < | 25 | pinctrl-single,pins = < |
38 | OMAP3_CORE1_IOPAD(0x21a0, PIN_OUTPUT | MUX_MODE0) /* hsusb0_clk.hsusb0_clk */ | 26 | OMAP3_CORE1_IOPAD(0x21a2, PIN_OUTPUT | MUX_MODE0) /* hsusb0_clk.hsusb0_clk */ |
39 | OMAP3_CORE1_IOPAD(0x21a2, PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */ | 27 | OMAP3_CORE1_IOPAD(0x21a4, PIN_OUTPUT | MUX_MODE0) /* hsusb0_stp.hsusb0_stp */ |
40 | OMAP3_CORE1_IOPAD(0x21a4, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_dir.hsusb0_dir */ | 28 | OMAP3_CORE1_IOPAD(0x21a6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_dir.hsusb0_dir */ |
41 | OMAP3_CORE1_IOPAD(0x21a6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_nxt.hsusb0_nxt */ | 29 | OMAP3_CORE1_IOPAD(0x21a8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_nxt.hsusb0_nxt */ |
42 | OMAP3_CORE1_IOPAD(0x21a8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data0.hsusb2_data0 */ | 30 | OMAP3_CORE1_IOPAD(0x21aa, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data0.hsusb2_data0 */ |
43 | OMAP3_CORE1_IOPAD(0x21aa, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data1.hsusb0_data1 */ | 31 | OMAP3_CORE1_IOPAD(0x21ac, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data1.hsusb0_data1 */ |
44 | OMAP3_CORE1_IOPAD(0x21ac, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data2.hsusb0_data2 */ | 32 | OMAP3_CORE1_IOPAD(0x21ae, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data2.hsusb0_data2 */ |
45 | OMAP3_CORE1_IOPAD(0x21ae, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data3 */ | 33 | OMAP3_CORE1_IOPAD(0x21b0, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data3 */ |
46 | OMAP3_CORE1_IOPAD(0x21b0, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data4 */ | 34 | OMAP3_CORE1_IOPAD(0x21b2, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data4 */ |
47 | OMAP3_CORE1_IOPAD(0x21b2, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data5 */ | 35 | OMAP3_CORE1_IOPAD(0x21b4, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data5 */ |
48 | OMAP3_CORE1_IOPAD(0x21b4, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data6 */ | 36 | OMAP3_CORE1_IOPAD(0x21b6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data6 */ |
49 | OMAP3_CORE1_IOPAD(0x21b6, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */ | 37 | OMAP3_CORE1_IOPAD(0x21b8, PIN_INPUT_PULLDOWN | MUX_MODE0) /* hsusb0_data7.hsusb0_data7 */ |
50 | >; | 38 | >; |
51 | }; | 39 | }; |
52 | }; | 40 | }; |
53 | 41 | ||
42 | #include "omap-gpmc-smsc911x.dtsi" | ||
43 | |||
54 | &gpmc { | 44 | &gpmc { |
55 | ranges = <5 0 0x2c000000 0x01000000>; | 45 | ranges = <5 0 0x2c000000 0x01000000>; |
56 | 46 | ||
57 | smsc1: ethernet@5,0 { | 47 | smsc1: ethernet@gpmc { |
58 | compatible = "smsc,lan9221", "smsc,lan9115"; | 48 | compatible = "smsc,lan9221", "smsc,lan9115"; |
59 | pinctrl-names = "default"; | 49 | pinctrl-names = "default"; |
60 | pinctrl-0 = <&smsc1_pins>; | 50 | pinctrl-0 = <&smsc1_pins>; |
61 | interrupt-parent = <&gpio6>; | 51 | interrupt-parent = <&gpio6>; |
62 | interrupts = <3 IRQ_TYPE_LEVEL_LOW>; | 52 | interrupts = <3 IRQ_TYPE_LEVEL_LOW>; |
63 | reg = <5 0 0xff>; | 53 | reg = <5 0 0xff>; |
64 | bank-width = <2>; | ||
65 | gpmc,mux-add-data; | ||
66 | gpmc,cs-on-ns = <0>; | ||
67 | gpmc,cs-rd-off-ns = <186>; | ||
68 | gpmc,cs-wr-off-ns = <186>; | ||
69 | gpmc,adv-on-ns = <12>; | ||
70 | gpmc,adv-rd-off-ns = <48>; | ||
71 | gpmc,adv-wr-off-ns = <48>; | ||
72 | gpmc,oe-on-ns = <54>; | ||
73 | gpmc,oe-off-ns = <168>; | ||
74 | gpmc,we-on-ns = <54>; | ||
75 | gpmc,we-off-ns = <168>; | ||
76 | gpmc,rd-cycle-ns = <186>; | ||
77 | gpmc,wr-cycle-ns = <186>; | ||
78 | gpmc,access-ns = <114>; | ||
79 | gpmc,page-burst-access-ns = <6>; | ||
80 | gpmc,bus-turnaround-ns = <12>; | ||
81 | gpmc,cycle2cycle-delay-ns = <18>; | ||
82 | gpmc,wr-data-mux-bus-ns = <90>; | ||
83 | gpmc,wr-access-ns = <186>; | ||
84 | gpmc,cycle2cycle-samecsen; | ||
85 | gpmc,cycle2cycle-diffcsen; | ||
86 | vddvario-supply = <&vddvario>; | ||
87 | vdd33a-supply = <&vdd33a>; | ||
88 | reg-io-width = <4>; | ||
89 | smsc,save-mac-address; | ||
90 | }; | 54 | }; |
91 | }; | 55 | }; |
92 | 56 | ||
diff --git a/arch/arm/boot/dts/omap3-devkit8000.dts b/arch/arm/boot/dts/omap3-devkit8000.dts index bf5a515a3247..da402f0fdab4 100644 --- a/arch/arm/boot/dts/omap3-devkit8000.dts +++ b/arch/arm/boot/dts/omap3-devkit8000.dts | |||
@@ -112,7 +112,6 @@ | |||
112 | reg = <0 0 0>; /* CS0, offset 0 */ | 112 | reg = <0 0 0>; /* CS0, offset 0 */ |
113 | nand-bus-width = <16>; | 113 | nand-bus-width = <16>; |
114 | 114 | ||
115 | gpmc,device-nand; | ||
116 | gpmc,sync-clk-ps = <0>; | 115 | gpmc,sync-clk-ps = <0>; |
117 | gpmc,cs-on-ns = <0>; | 116 | gpmc,cs-on-ns = <0>; |
118 | gpmc,cs-rd-off-ns = <44>; | 117 | gpmc,cs-rd-off-ns = <44>; |
diff --git a/arch/arm/boot/dts/omap3-igep.dtsi b/arch/arm/boot/dts/omap3-igep.dtsi index b97736d98a64..e2d163bf0619 100644 --- a/arch/arm/boot/dts/omap3-igep.dtsi +++ b/arch/arm/boot/dts/omap3-igep.dtsi | |||
@@ -107,7 +107,7 @@ | |||
107 | >; | 107 | >; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | smsc911x_pins: pinmux_smsc911x_pins { | 110 | smsc9221_pins: pinmux_smsc9221_pins { |
111 | pinctrl-single,pins = < | 111 | pinctrl-single,pins = < |
112 | 0x1a2 (PIN_INPUT | MUX_MODE4) /* mcspi1_cs2.gpio_176 */ | 112 | 0x1a2 (PIN_INPUT | MUX_MODE4) /* mcspi1_cs2.gpio_176 */ |
113 | >; | 113 | >; |
diff --git a/arch/arm/boot/dts/omap3-igep0020.dts b/arch/arm/boot/dts/omap3-igep0020.dts index 7abd64f6ae21..b22caaaf774b 100644 --- a/arch/arm/boot/dts/omap3-igep0020.dts +++ b/arch/arm/boot/dts/omap3-igep0020.dts | |||
@@ -10,7 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "omap3-igep.dtsi" | 12 | #include "omap3-igep.dtsi" |
13 | #include "omap-gpmc-smsc911x.dtsi" | 13 | #include "omap-gpmc-smsc9221.dtsi" |
14 | 14 | ||
15 | / { | 15 | / { |
16 | model = "IGEPv2 (TI OMAP AM/DM37x)"; | 16 | model = "IGEPv2 (TI OMAP AM/DM37x)"; |
@@ -248,7 +248,7 @@ | |||
248 | 248 | ||
249 | ethernet@gpmc { | 249 | ethernet@gpmc { |
250 | pinctrl-names = "default"; | 250 | pinctrl-names = "default"; |
251 | pinctrl-0 = <&smsc911x_pins>; | 251 | pinctrl-0 = <&smsc9221_pins>; |
252 | reg = <5 0 0xff>; | 252 | reg = <5 0 0xff>; |
253 | interrupt-parent = <&gpio6>; | 253 | interrupt-parent = <&gpio6>; |
254 | interrupts = <16 IRQ_TYPE_LEVEL_LOW>; | 254 | interrupts = <16 IRQ_TYPE_LEVEL_LOW>; |
diff --git a/arch/arm/boot/dts/omap3-lilly-a83x.dtsi b/arch/arm/boot/dts/omap3-lilly-a83x.dtsi index 6369d9f43ca2..cc1dce6978f5 100644 --- a/arch/arm/boot/dts/omap3-lilly-a83x.dtsi +++ b/arch/arm/boot/dts/omap3-lilly-a83x.dtsi | |||
@@ -368,7 +368,6 @@ | |||
368 | /* no elm on omap3 */ | 368 | /* no elm on omap3 */ |
369 | 369 | ||
370 | gpmc,mux-add-data = <0>; | 370 | gpmc,mux-add-data = <0>; |
371 | gpmc,device-nand; | ||
372 | gpmc,device-width = <2>; | 371 | gpmc,device-width = <2>; |
373 | gpmc,wait-pin = <0>; | 372 | gpmc,wait-pin = <0>; |
374 | gpmc,wait-monitoring-ns = <0>; | 373 | gpmc,wait-monitoring-ns = <0>; |
diff --git a/arch/arm/boot/dts/omap3-sb-t35.dtsi b/arch/arm/boot/dts/omap3-sb-t35.dtsi index 7909c51b05a5..d59e3de1441e 100644 --- a/arch/arm/boot/dts/omap3-sb-t35.dtsi +++ b/arch/arm/boot/dts/omap3-sb-t35.dtsi | |||
@@ -2,20 +2,6 @@ | |||
2 | * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730 | 2 | * Common support for CompuLab SB-T35 used on SBC-T3530, SBC-T3517 and SBC-T3730 |
3 | */ | 3 | */ |
4 | 4 | ||
5 | / { | ||
6 | vddvario_sb_t35: regulator-vddvario-sb-t35 { | ||
7 | compatible = "regulator-fixed"; | ||
8 | regulator-name = "vddvario"; | ||
9 | regulator-always-on; | ||
10 | }; | ||
11 | |||
12 | vdd33a_sb_t35: regulator-vdd33a-sb-t35 { | ||
13 | compatible = "regulator-fixed"; | ||
14 | regulator-name = "vdd33a"; | ||
15 | regulator-always-on; | ||
16 | }; | ||
17 | }; | ||
18 | |||
19 | &omap3_pmx_core { | 5 | &omap3_pmx_core { |
20 | smsc2_pins: pinmux_smsc2_pins { | 6 | smsc2_pins: pinmux_smsc2_pins { |
21 | pinctrl-single,pins = < | 7 | pinctrl-single,pins = < |
@@ -37,11 +23,10 @@ | |||
37 | reg = <4 0 0xff>; | 23 | reg = <4 0 0xff>; |
38 | bank-width = <2>; | 24 | bank-width = <2>; |
39 | gpmc,mux-add-data; | 25 | gpmc,mux-add-data; |
40 | gpmc,cs-on-ns = <0>; | 26 | gpmc,cs-on-ns = <1>; |
41 | gpmc,cs-rd-off-ns = <186>; | 27 | gpmc,cs-rd-off-ns = <180>; |
42 | gpmc,cs-wr-off-ns = <186>; | 28 | gpmc,cs-wr-off-ns = <180>; |
43 | gpmc,adv-on-ns = <12>; | 29 | gpmc,adv-rd-off-ns = <18>; |
44 | gpmc,adv-rd-off-ns = <48>; | ||
45 | gpmc,adv-wr-off-ns = <48>; | 30 | gpmc,adv-wr-off-ns = <48>; |
46 | gpmc,oe-on-ns = <54>; | 31 | gpmc,oe-on-ns = <54>; |
47 | gpmc,oe-off-ns = <168>; | 32 | gpmc,oe-off-ns = <168>; |
@@ -49,16 +34,14 @@ | |||
49 | gpmc,we-off-ns = <168>; | 34 | gpmc,we-off-ns = <168>; |
50 | gpmc,rd-cycle-ns = <186>; | 35 | gpmc,rd-cycle-ns = <186>; |
51 | gpmc,wr-cycle-ns = <186>; | 36 | gpmc,wr-cycle-ns = <186>; |
52 | gpmc,access-ns = <114>; | 37 | gpmc,access-ns = <144>; |
53 | gpmc,page-burst-access-ns = <6>; | 38 | gpmc,page-burst-access-ns = <24>; |
54 | gpmc,bus-turnaround-ns = <12>; | 39 | gpmc,bus-turnaround-ns = <90>; |
55 | gpmc,cycle2cycle-delay-ns = <18>; | 40 | gpmc,cycle2cycle-delay-ns = <90>; |
56 | gpmc,wr-data-mux-bus-ns = <90>; | ||
57 | gpmc,wr-access-ns = <186>; | ||
58 | gpmc,cycle2cycle-samecsen; | 41 | gpmc,cycle2cycle-samecsen; |
59 | gpmc,cycle2cycle-diffcsen; | 42 | gpmc,cycle2cycle-diffcsen; |
60 | vddvario-supply = <&vddvario_sb_t35>; | 43 | vddvario-supply = <&vddvario>; |
61 | vdd33a-supply = <&vdd33a_sb_t35>; | 44 | vdd33a-supply = <&vdd33a>; |
62 | reg-io-width = <4>; | 45 | reg-io-width = <4>; |
63 | smsc,save-mac-address; | 46 | smsc,save-mac-address; |
64 | }; | 47 | }; |
diff --git a/arch/arm/boot/dts/omap3-sbc-t3517.dts b/arch/arm/boot/dts/omap3-sbc-t3517.dts index 024c9c6c682d..42189b65d393 100644 --- a/arch/arm/boot/dts/omap3-sbc-t3517.dts +++ b/arch/arm/boot/dts/omap3-sbc-t3517.dts | |||
@@ -8,6 +8,19 @@ | |||
8 | / { | 8 | / { |
9 | model = "CompuLab SBC-T3517 with CM-T3517"; | 9 | model = "CompuLab SBC-T3517 with CM-T3517"; |
10 | compatible = "compulab,omap3-sbc-t3517", "compulab,omap3-cm-t3517", "ti,am3517", "ti,omap3"; | 10 | compatible = "compulab,omap3-sbc-t3517", "compulab,omap3-cm-t3517", "ti,am3517", "ti,omap3"; |
11 | |||
12 | /* Only one GPMC smsc9220 on SBC-T3517, CM-T3517 uses am35x Ethernet */ | ||
13 | vddvario: regulator-vddvario-sb-t35 { | ||
14 | compatible = "regulator-fixed"; | ||
15 | regulator-name = "vddvario"; | ||
16 | regulator-always-on; | ||
17 | }; | ||
18 | |||
19 | vdd33a: regulator-vdd33a-sb-t35 { | ||
20 | compatible = "regulator-fixed"; | ||
21 | regulator-name = "vdd33a"; | ||
22 | regulator-always-on; | ||
23 | }; | ||
11 | }; | 24 | }; |
12 | 25 | ||
13 | &omap3_pmx_core { | 26 | &omap3_pmx_core { |
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 5e5790f631eb..4231191ade06 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
@@ -61,7 +61,7 @@ | |||
61 | ti,hwmods = "mpu"; | 61 | ti,hwmods = "mpu"; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | iva { | 64 | iva: iva { |
65 | compatible = "ti,iva2.2"; | 65 | compatible = "ti,iva2.2"; |
66 | ti,hwmods = "iva"; | 66 | ti,hwmods = "iva"; |
67 | 67 | ||
@@ -74,7 +74,7 @@ | |||
74 | /* | 74 | /* |
75 | * XXX: Use a flat representation of the OMAP3 interconnect. | 75 | * XXX: Use a flat representation of the OMAP3 interconnect. |
76 | * The real OMAP interconnect network is quite complex. | 76 | * The real OMAP interconnect network is quite complex. |
77 | * Since that will not bring real advantage to represent that in DT for | 77 | * Since it will not bring real advantage to represent that in DT for |
78 | * the moment, just use a fake OCP bus entry to represent the whole bus | 78 | * the moment, just use a fake OCP bus entry to represent the whole bus |
79 | * hierarchy. | 79 | * hierarchy. |
80 | */ | 80 | */ |
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi index 27fcac874742..649b5cd38b40 100644 --- a/arch/arm/boot/dts/omap4.dtsi +++ b/arch/arm/boot/dts/omap4.dtsi | |||
@@ -72,7 +72,7 @@ | |||
72 | }; | 72 | }; |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * The soc node represents the soc top level view. It is uses for IPs | 75 | * The soc node represents the soc top level view. It is used for IPs |
76 | * that are not memory mapped in the MPU view or for the MPU itself. | 76 | * that are not memory mapped in the MPU view or for the MPU itself. |
77 | */ | 77 | */ |
78 | soc { | 78 | soc { |
@@ -96,7 +96,7 @@ | |||
96 | /* | 96 | /* |
97 | * XXX: Use a flat representation of the OMAP4 interconnect. | 97 | * XXX: Use a flat representation of the OMAP4 interconnect. |
98 | * The real OMAP interconnect network is quite complex. | 98 | * The real OMAP interconnect network is quite complex. |
99 | * Since that will not bring real advantage to represent that in DT for | 99 | * Since it will not bring real advantage to represent that in DT for |
100 | * the moment, just use a fake OCP bus entry to represent the whole bus | 100 | * the moment, just use a fake OCP bus entry to represent the whole bus |
101 | * hierarchy. | 101 | * hierarchy. |
102 | */ | 102 | */ |
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi index 6f3de22fb266..36b4312a5e0d 100644 --- a/arch/arm/boot/dts/omap5.dtsi +++ b/arch/arm/boot/dts/omap5.dtsi | |||
@@ -93,7 +93,7 @@ | |||
93 | }; | 93 | }; |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * The soc node represents the soc top level view. It is uses for IPs | 96 | * The soc node represents the soc top level view. It is used for IPs |
97 | * that are not memory mapped in the MPU view or for the MPU itself. | 97 | * that are not memory mapped in the MPU view or for the MPU itself. |
98 | */ | 98 | */ |
99 | soc { | 99 | soc { |
@@ -107,7 +107,7 @@ | |||
107 | /* | 107 | /* |
108 | * XXX: Use a flat representation of the OMAP3 interconnect. | 108 | * XXX: Use a flat representation of the OMAP3 interconnect. |
109 | * The real OMAP interconnect network is quite complex. | 109 | * The real OMAP interconnect network is quite complex. |
110 | * Since that will not bring real advantage to represent that in DT for | 110 | * Since it will not bring real advantage to represent that in DT for |
111 | * the moment, just use a fake OCP bus entry to represent the whole bus | 111 | * the moment, just use a fake OCP bus entry to represent the whole bus |
112 | * hierarchy. | 112 | * hierarchy. |
113 | */ | 113 | */ |
@@ -630,6 +630,13 @@ | |||
630 | status = "disabled"; | 630 | status = "disabled"; |
631 | }; | 631 | }; |
632 | 632 | ||
633 | mailbox: mailbox@4a0f4000 { | ||
634 | compatible = "ti,omap4-mailbox"; | ||
635 | reg = <0x4a0f4000 0x200>; | ||
636 | interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; | ||
637 | ti,hwmods = "mailbox"; | ||
638 | }; | ||
639 | |||
633 | timer1: timer@4ae18000 { | 640 | timer1: timer@4ae18000 { |
634 | compatible = "ti,omap5430-timer"; | 641 | compatible = "ti,omap5430-timer"; |
635 | reg = <0x4ae18000 0x80>; | 642 | reg = <0x4ae18000 0x80>; |
@@ -813,6 +820,12 @@ | |||
813 | <0x4a084c00 0x40>; | 820 | <0x4a084c00 0x40>; |
814 | reg-names = "phy_rx", "phy_tx", "pll_ctrl"; | 821 | reg-names = "phy_rx", "phy_tx", "pll_ctrl"; |
815 | ctrl-module = <&omap_control_usb3phy>; | 822 | ctrl-module = <&omap_control_usb3phy>; |
823 | clocks = <&usb_phy_cm_clk32k>, | ||
824 | <&sys_clkin>, | ||
825 | <&usb_otg_ss_refclk960m>; | ||
826 | clock-names = "wkupclk", | ||
827 | "sysclk", | ||
828 | "refclk"; | ||
816 | #phy-cells = <0>; | 829 | #phy-cells = <0>; |
817 | }; | 830 | }; |
818 | }; | 831 | }; |
diff --git a/arch/arm/boot/dts/r8a7740.dtsi b/arch/arm/boot/dts/r8a7740.dtsi index 8280884bfa59..2551e9438d35 100644 --- a/arch/arm/boot/dts/r8a7740.dtsi +++ b/arch/arm/boot/dts/r8a7740.dtsi | |||
@@ -28,7 +28,6 @@ | |||
28 | gic: interrupt-controller@c2800000 { | 28 | gic: interrupt-controller@c2800000 { |
29 | compatible = "arm,cortex-a9-gic"; | 29 | compatible = "arm,cortex-a9-gic"; |
30 | #interrupt-cells = <3>; | 30 | #interrupt-cells = <3>; |
31 | #address-cells = <1>; | ||
32 | interrupt-controller; | 31 | interrupt-controller; |
33 | reg = <0xc2800000 0x1000>, | 32 | reg = <0xc2800000 0x1000>, |
34 | <0xc2000000 0x1000>; | 33 | <0xc2000000 0x1000>; |
diff --git a/arch/arm/boot/dts/r8a7790-lager.dts b/arch/arm/boot/dts/r8a7790-lager.dts index 6e99eb2df076..d01048ab3e77 100644 --- a/arch/arm/boot/dts/r8a7790-lager.dts +++ b/arch/arm/boot/dts/r8a7790-lager.dts | |||
@@ -141,12 +141,12 @@ | |||
141 | }; | 141 | }; |
142 | 142 | ||
143 | sdhi0_pins: sd0 { | 143 | sdhi0_pins: sd0 { |
144 | renesas,gpios = "sdhi0_data4", "sdhi0_ctrl"; | 144 | renesas,groups = "sdhi0_data4", "sdhi0_ctrl"; |
145 | renesas,function = "sdhi0"; | 145 | renesas,function = "sdhi0"; |
146 | }; | 146 | }; |
147 | 147 | ||
148 | sdhi2_pins: sd2 { | 148 | sdhi2_pins: sd2 { |
149 | renesas,gpios = "sdhi2_data4", "sdhi2_ctrl"; | 149 | renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; |
150 | renesas,function = "sdhi2"; | 150 | renesas,function = "sdhi2"; |
151 | }; | 151 | }; |
152 | 152 | ||
diff --git a/arch/arm/boot/dts/r8a7791-koelsch.dts b/arch/arm/boot/dts/r8a7791-koelsch.dts index bdd73e6657b2..de1b6977c69a 100644 --- a/arch/arm/boot/dts/r8a7791-koelsch.dts +++ b/arch/arm/boot/dts/r8a7791-koelsch.dts | |||
@@ -230,17 +230,17 @@ | |||
230 | }; | 230 | }; |
231 | 231 | ||
232 | sdhi0_pins: sd0 { | 232 | sdhi0_pins: sd0 { |
233 | renesas,gpios = "sdhi0_data4", "sdhi0_ctrl"; | 233 | renesas,groups = "sdhi0_data4", "sdhi0_ctrl"; |
234 | renesas,function = "sdhi0"; | 234 | renesas,function = "sdhi0"; |
235 | }; | 235 | }; |
236 | 236 | ||
237 | sdhi1_pins: sd1 { | 237 | sdhi1_pins: sd1 { |
238 | renesas,gpios = "sdhi1_data4", "sdhi1_ctrl"; | 238 | renesas,groups = "sdhi1_data4", "sdhi1_ctrl"; |
239 | renesas,function = "sdhi1"; | 239 | renesas,function = "sdhi1"; |
240 | }; | 240 | }; |
241 | 241 | ||
242 | sdhi2_pins: sd2 { | 242 | sdhi2_pins: sd2 { |
243 | renesas,gpios = "sdhi2_data4", "sdhi2_ctrl"; | 243 | renesas,groups = "sdhi2_data4", "sdhi2_ctrl"; |
244 | renesas,function = "sdhi2"; | 244 | renesas,function = "sdhi2"; |
245 | }; | 245 | }; |
246 | 246 | ||
diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index bb36596ea205..ed9a70af3e3f 100644 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi | |||
@@ -149,7 +149,7 @@ | |||
149 | 149 | ||
150 | uart0 { | 150 | uart0 { |
151 | uart0_xfer: uart0-xfer { | 151 | uart0_xfer: uart0-xfer { |
152 | rockchip,pins = <RK_GPIO1 0 RK_FUNC_1 &pcfg_pull_none>, | 152 | rockchip,pins = <RK_GPIO1 0 RK_FUNC_1 &pcfg_pull_up>, |
153 | <RK_GPIO1 1 RK_FUNC_1 &pcfg_pull_none>; | 153 | <RK_GPIO1 1 RK_FUNC_1 &pcfg_pull_none>; |
154 | }; | 154 | }; |
155 | 155 | ||
@@ -164,7 +164,7 @@ | |||
164 | 164 | ||
165 | uart1 { | 165 | uart1 { |
166 | uart1_xfer: uart1-xfer { | 166 | uart1_xfer: uart1-xfer { |
167 | rockchip,pins = <RK_GPIO1 4 RK_FUNC_1 &pcfg_pull_none>, | 167 | rockchip,pins = <RK_GPIO1 4 RK_FUNC_1 &pcfg_pull_up>, |
168 | <RK_GPIO1 5 RK_FUNC_1 &pcfg_pull_none>; | 168 | <RK_GPIO1 5 RK_FUNC_1 &pcfg_pull_none>; |
169 | }; | 169 | }; |
170 | 170 | ||
@@ -179,7 +179,7 @@ | |||
179 | 179 | ||
180 | uart2 { | 180 | uart2 { |
181 | uart2_xfer: uart2-xfer { | 181 | uart2_xfer: uart2-xfer { |
182 | rockchip,pins = <RK_GPIO1 8 RK_FUNC_1 &pcfg_pull_none>, | 182 | rockchip,pins = <RK_GPIO1 8 RK_FUNC_1 &pcfg_pull_up>, |
183 | <RK_GPIO1 9 RK_FUNC_1 &pcfg_pull_none>; | 183 | <RK_GPIO1 9 RK_FUNC_1 &pcfg_pull_none>; |
184 | }; | 184 | }; |
185 | /* no rts / cts for uart2 */ | 185 | /* no rts / cts for uart2 */ |
@@ -187,7 +187,7 @@ | |||
187 | 187 | ||
188 | uart3 { | 188 | uart3 { |
189 | uart3_xfer: uart3-xfer { | 189 | uart3_xfer: uart3-xfer { |
190 | rockchip,pins = <RK_GPIO1 10 RK_FUNC_1 &pcfg_pull_none>, | 190 | rockchip,pins = <RK_GPIO1 10 RK_FUNC_1 &pcfg_pull_up>, |
191 | <RK_GPIO1 11 RK_FUNC_1 &pcfg_pull_none>; | 191 | <RK_GPIO1 11 RK_FUNC_1 &pcfg_pull_none>; |
192 | }; | 192 | }; |
193 | 193 | ||
diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi index eabcfdbb403a..a106b0872910 100644 --- a/arch/arm/boot/dts/sama5d3.dtsi +++ b/arch/arm/boot/dts/sama5d3.dtsi | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <dt-bindings/pinctrl/at91.h> | 13 | #include <dt-bindings/pinctrl/at91.h> |
14 | #include <dt-bindings/interrupt-controller/irq.h> | 14 | #include <dt-bindings/interrupt-controller/irq.h> |
15 | #include <dt-bindings/gpio/gpio.h> | 15 | #include <dt-bindings/gpio/gpio.h> |
16 | #include <dt-bindings/clk/at91.h> | 16 | #include <dt-bindings/clock/at91.h> |
17 | 17 | ||
18 | / { | 18 | / { |
19 | model = "Atmel SAMA5D3 family SoC"; | 19 | model = "Atmel SAMA5D3 family SoC"; |
diff --git a/arch/arm/boot/dts/sama5d3_mci2.dtsi b/arch/arm/boot/dts/sama5d3_mci2.dtsi index b029fe7ef17a..1b02208ea6ff 100644 --- a/arch/arm/boot/dts/sama5d3_mci2.dtsi +++ b/arch/arm/boot/dts/sama5d3_mci2.dtsi | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <dt-bindings/pinctrl/at91.h> | 10 | #include <dt-bindings/pinctrl/at91.h> |
11 | #include <dt-bindings/interrupt-controller/irq.h> | 11 | #include <dt-bindings/interrupt-controller/irq.h> |
12 | #include <dt-bindings/clk/at91.h> | 12 | #include <dt-bindings/clock/at91.h> |
13 | 13 | ||
14 | / { | 14 | / { |
15 | ahb { | 15 | ahb { |
diff --git a/arch/arm/boot/dts/sama5d3_tcb1.dtsi b/arch/arm/boot/dts/sama5d3_tcb1.dtsi index 382b04431f66..02848453ca0c 100644 --- a/arch/arm/boot/dts/sama5d3_tcb1.dtsi +++ b/arch/arm/boot/dts/sama5d3_tcb1.dtsi | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <dt-bindings/pinctrl/at91.h> | 10 | #include <dt-bindings/pinctrl/at91.h> |
11 | #include <dt-bindings/interrupt-controller/irq.h> | 11 | #include <dt-bindings/interrupt-controller/irq.h> |
12 | #include <dt-bindings/clk/at91.h> | 12 | #include <dt-bindings/clock/at91.h> |
13 | 13 | ||
14 | / { | 14 | / { |
15 | aliases { | 15 | aliases { |
diff --git a/arch/arm/boot/dts/sama5d3_uart.dtsi b/arch/arm/boot/dts/sama5d3_uart.dtsi index a9fa75e41652..7a8d4c6115f7 100644 --- a/arch/arm/boot/dts/sama5d3_uart.dtsi +++ b/arch/arm/boot/dts/sama5d3_uart.dtsi | |||
@@ -9,7 +9,7 @@ | |||
9 | 9 | ||
10 | #include <dt-bindings/pinctrl/at91.h> | 10 | #include <dt-bindings/pinctrl/at91.h> |
11 | #include <dt-bindings/interrupt-controller/irq.h> | 11 | #include <dt-bindings/interrupt-controller/irq.h> |
12 | #include <dt-bindings/clk/at91.h> | 12 | #include <dt-bindings/clock/at91.h> |
13 | 13 | ||
14 | / { | 14 | / { |
15 | aliases { | 15 | aliases { |
diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi index b7bd3b9a6753..5ecf552e1c00 100644 --- a/arch/arm/boot/dts/sh73a0.dtsi +++ b/arch/arm/boot/dts/sh73a0.dtsi | |||
@@ -34,7 +34,6 @@ | |||
34 | gic: interrupt-controller@f0001000 { | 34 | gic: interrupt-controller@f0001000 { |
35 | compatible = "arm,cortex-a9-gic"; | 35 | compatible = "arm,cortex-a9-gic"; |
36 | #interrupt-cells = <3>; | 36 | #interrupt-cells = <3>; |
37 | #address-cells = <1>; | ||
38 | interrupt-controller; | 37 | interrupt-controller; |
39 | reg = <0xf0001000 0x1000>, | 38 | reg = <0xf0001000 0x1000>, |
40 | <0xf0000100 0x100>; | 39 | <0xf0000100 0x100>; |
diff --git a/arch/arm/boot/dts/spear320-hmi.dts b/arch/arm/boot/dts/spear320-hmi.dts index 3075d2d3a8be..0aa6fef5ce22 100644 --- a/arch/arm/boot/dts/spear320-hmi.dts +++ b/arch/arm/boot/dts/spear320-hmi.dts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * DTS file for SPEAr320 Evaluation Baord | 2 | * DTS file for SPEAr320 Evaluation Baord |
3 | * | 3 | * |
4 | * Copyright 2012 Shiraz Hashim <shiraz.hashim@st.com> | 4 | * Copyright 2012 Shiraz Hashim <shiraz.linux.kernel@gmail.com> |
5 | * | 5 | * |
6 | * The code contained herein is licensed under the GNU General Public | 6 | * The code contained herein is licensed under the GNU General Public |
7 | * License. You may obtain a copy of the GNU General Public License | 7 | * License. You may obtain a copy of the GNU General Public License |
diff --git a/arch/arm/boot/dts/ste-ccu8540.dts b/arch/arm/boot/dts/ste-ccu8540.dts index 7f3baf51a3a9..32dd55e5f4e6 100644 --- a/arch/arm/boot/dts/ste-ccu8540.dts +++ b/arch/arm/boot/dts/ste-ccu8540.dts | |||
@@ -18,6 +18,7 @@ | |||
18 | compatible = "st-ericsson,ccu8540", "st-ericsson,u8540"; | 18 | compatible = "st-ericsson,ccu8540", "st-ericsson,u8540"; |
19 | 19 | ||
20 | memory@0 { | 20 | memory@0 { |
21 | device_type = "memory"; | ||
21 | reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>; | 22 | reg = <0x20000000 0x1f000000>, <0xc0000000 0x3f000000>; |
22 | }; | 23 | }; |
23 | 24 | ||
diff --git a/arch/arm/boot/dts/stih415-pinctrl.dtsi b/arch/arm/boot/dts/stih415-pinctrl.dtsi index f09fb10a3791..81df870e5ee6 100644 --- a/arch/arm/boot/dts/stih415-pinctrl.dtsi +++ b/arch/arm/boot/dts/stih415-pinctrl.dtsi | |||
@@ -49,7 +49,7 @@ | |||
49 | reg = <0xfe61f080 0x4>; | 49 | reg = <0xfe61f080 0x4>; |
50 | reg-names = "irqmux"; | 50 | reg-names = "irqmux"; |
51 | interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>; | 51 | interrupts = <GIC_SPI 180 IRQ_TYPE_LEVEL_HIGH>; |
52 | interrupts-names = "irqmux"; | 52 | interrupt-names = "irqmux"; |
53 | ranges = <0 0xfe610000 0x5000>; | 53 | ranges = <0 0xfe610000 0x5000>; |
54 | 54 | ||
55 | PIO0: gpio@fe610000 { | 55 | PIO0: gpio@fe610000 { |
@@ -187,7 +187,7 @@ | |||
187 | reg = <0xfee0f080 0x4>; | 187 | reg = <0xfee0f080 0x4>; |
188 | reg-names = "irqmux"; | 188 | reg-names = "irqmux"; |
189 | interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>; | 189 | interrupts = <GIC_SPI 181 IRQ_TYPE_LEVEL_HIGH>; |
190 | interrupts-names = "irqmux"; | 190 | interrupt-names = "irqmux"; |
191 | ranges = <0 0xfee00000 0x8000>; | 191 | ranges = <0 0xfee00000 0x8000>; |
192 | 192 | ||
193 | PIO5: gpio@fee00000 { | 193 | PIO5: gpio@fee00000 { |
@@ -282,7 +282,7 @@ | |||
282 | reg = <0xfe82f080 0x4>; | 282 | reg = <0xfe82f080 0x4>; |
283 | reg-names = "irqmux"; | 283 | reg-names = "irqmux"; |
284 | interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; | 284 | interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; |
285 | interrupts-names = "irqmux"; | 285 | interrupt-names = "irqmux"; |
286 | ranges = <0 0xfe820000 0x8000>; | 286 | ranges = <0 0xfe820000 0x8000>; |
287 | 287 | ||
288 | PIO13: gpio@fe820000 { | 288 | PIO13: gpio@fe820000 { |
@@ -423,7 +423,7 @@ | |||
423 | reg = <0xfd6bf080 0x4>; | 423 | reg = <0xfd6bf080 0x4>; |
424 | reg-names = "irqmux"; | 424 | reg-names = "irqmux"; |
425 | interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; | 425 | interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; |
426 | interrupts-names = "irqmux"; | 426 | interrupt-names = "irqmux"; |
427 | ranges = <0 0xfd6b0000 0x3000>; | 427 | ranges = <0 0xfd6b0000 0x3000>; |
428 | 428 | ||
429 | PIO100: gpio@fd6b0000 { | 429 | PIO100: gpio@fd6b0000 { |
@@ -460,7 +460,7 @@ | |||
460 | reg = <0xfd33f080 0x4>; | 460 | reg = <0xfd33f080 0x4>; |
461 | reg-names = "irqmux"; | 461 | reg-names = "irqmux"; |
462 | interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; | 462 | interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; |
463 | interrupts-names = "irqmux"; | 463 | interrupt-names = "irqmux"; |
464 | ranges = <0 0xfd330000 0x5000>; | 464 | ranges = <0 0xfd330000 0x5000>; |
465 | 465 | ||
466 | PIO103: gpio@fd330000 { | 466 | PIO103: gpio@fd330000 { |
diff --git a/arch/arm/boot/dts/stih416-pinctrl.dtsi b/arch/arm/boot/dts/stih416-pinctrl.dtsi index aeea304086eb..250d5ecc951e 100644 --- a/arch/arm/boot/dts/stih416-pinctrl.dtsi +++ b/arch/arm/boot/dts/stih416-pinctrl.dtsi | |||
@@ -53,7 +53,7 @@ | |||
53 | reg = <0xfe61f080 0x4>; | 53 | reg = <0xfe61f080 0x4>; |
54 | reg-names = "irqmux"; | 54 | reg-names = "irqmux"; |
55 | interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; | 55 | interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>; |
56 | interrupts-names = "irqmux"; | 56 | interrupt-names = "irqmux"; |
57 | ranges = <0 0xfe610000 0x6000>; | 57 | ranges = <0 0xfe610000 0x6000>; |
58 | 58 | ||
59 | PIO0: gpio@fe610000 { | 59 | PIO0: gpio@fe610000 { |
@@ -201,7 +201,7 @@ | |||
201 | reg = <0xfee0f080 0x4>; | 201 | reg = <0xfee0f080 0x4>; |
202 | reg-names = "irqmux"; | 202 | reg-names = "irqmux"; |
203 | interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>; | 203 | interrupts = <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>; |
204 | interrupts-names = "irqmux"; | 204 | interrupt-names = "irqmux"; |
205 | ranges = <0 0xfee00000 0x10000>; | 205 | ranges = <0 0xfee00000 0x10000>; |
206 | 206 | ||
207 | PIO5: gpio@fee00000 { | 207 | PIO5: gpio@fee00000 { |
@@ -333,7 +333,7 @@ | |||
333 | reg = <0xfe82f080 0x4>; | 333 | reg = <0xfe82f080 0x4>; |
334 | reg-names = "irqmux"; | 334 | reg-names = "irqmux"; |
335 | interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; | 335 | interrupts = <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>; |
336 | interrupts-names = "irqmux"; | 336 | interrupt-names = "irqmux"; |
337 | ranges = <0 0xfe820000 0x6000>; | 337 | ranges = <0 0xfe820000 0x6000>; |
338 | 338 | ||
339 | PIO13: gpio@fe820000 { | 339 | PIO13: gpio@fe820000 { |
@@ -461,7 +461,7 @@ | |||
461 | reg = <0xfd6bf080 0x4>; | 461 | reg = <0xfd6bf080 0x4>; |
462 | reg-names = "irqmux"; | 462 | reg-names = "irqmux"; |
463 | interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; | 463 | interrupts = <GIC_SPI 113 IRQ_TYPE_LEVEL_HIGH>; |
464 | interrupts-names = "irqmux"; | 464 | interrupt-names = "irqmux"; |
465 | ranges = <0 0xfd6b0000 0x3000>; | 465 | ranges = <0 0xfd6b0000 0x3000>; |
466 | 466 | ||
467 | PIO100: gpio@fd6b0000 { | 467 | PIO100: gpio@fd6b0000 { |
@@ -498,7 +498,7 @@ | |||
498 | reg = <0xfd33f080 0x4>; | 498 | reg = <0xfd33f080 0x4>; |
499 | reg-names = "irqmux"; | 499 | reg-names = "irqmux"; |
500 | interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; | 500 | interrupts = <GIC_SPI 114 IRQ_TYPE_LEVEL_HIGH>; |
501 | interrupts-names = "irqmux"; | 501 | interrupt-names = "irqmux"; |
502 | ranges = <0 0xfd330000 0x5000>; | 502 | ranges = <0 0xfd330000 0x5000>; |
503 | 503 | ||
504 | PIO103: gpio@fd330000 { | 504 | PIO103: gpio@fd330000 { |
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi index 32efc105df83..aba1c8a3f388 100644 --- a/arch/arm/boot/dts/sun7i-a20.dtsi +++ b/arch/arm/boot/dts/sun7i-a20.dtsi | |||
@@ -87,7 +87,7 @@ | |||
87 | 87 | ||
88 | pll4: clk@01c20018 { | 88 | pll4: clk@01c20018 { |
89 | #clock-cells = <0>; | 89 | #clock-cells = <0>; |
90 | compatible = "allwinner,sun4i-a10-pll1-clk"; | 90 | compatible = "allwinner,sun7i-a20-pll4-clk"; |
91 | reg = <0x01c20018 0x4>; | 91 | reg = <0x01c20018 0x4>; |
92 | clocks = <&osc24M>; | 92 | clocks = <&osc24M>; |
93 | clock-output-names = "pll4"; | 93 | clock-output-names = "pll4"; |
@@ -109,6 +109,14 @@ | |||
109 | clock-output-names = "pll6_sata", "pll6_other", "pll6"; | 109 | clock-output-names = "pll6_sata", "pll6_other", "pll6"; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | pll8: clk@01c20040 { | ||
113 | #clock-cells = <0>; | ||
114 | compatible = "allwinner,sun7i-a20-pll4-clk"; | ||
115 | reg = <0x01c20040 0x4>; | ||
116 | clocks = <&osc24M>; | ||
117 | clock-output-names = "pll8"; | ||
118 | }; | ||
119 | |||
112 | cpu: cpu@01c20054 { | 120 | cpu: cpu@01c20054 { |
113 | #clock-cells = <0>; | 121 | #clock-cells = <0>; |
114 | compatible = "allwinner,sun4i-a10-cpu-clk"; | 122 | compatible = "allwinner,sun4i-a10-cpu-clk"; |
@@ -805,9 +813,9 @@ | |||
805 | status = "disabled"; | 813 | status = "disabled"; |
806 | }; | 814 | }; |
807 | 815 | ||
808 | i2c4: i2c@01c2bc00 { | 816 | i2c4: i2c@01c2c000 { |
809 | compatible = "allwinner,sun4i-i2c"; | 817 | compatible = "allwinner,sun4i-i2c"; |
810 | reg = <0x01c2bc00 0x400>; | 818 | reg = <0x01c2c000 0x400>; |
811 | interrupts = <0 89 4>; | 819 | interrupts = <0 89 4>; |
812 | clocks = <&apb1_gates 15>; | 820 | clocks = <&apb1_gates 15>; |
813 | clock-frequency = <100000>; | 821 | clock-frequency = <100000>; |
diff --git a/arch/arm/boot/dts/tegra124.dtsi b/arch/arm/boot/dts/tegra124.dtsi index cf45a1a39483..6d540a025148 100644 --- a/arch/arm/boot/dts/tegra124.dtsi +++ b/arch/arm/boot/dts/tegra124.dtsi | |||
@@ -233,19 +233,6 @@ | |||
233 | status = "disabled"; | 233 | status = "disabled"; |
234 | }; | 234 | }; |
235 | 235 | ||
236 | serial@0,70006400 { | ||
237 | compatible = "nvidia,tegra124-uart", "nvidia,tegra20-uart"; | ||
238 | reg = <0x0 0x70006400 0x0 0x40>; | ||
239 | reg-shift = <2>; | ||
240 | interrupts = <GIC_SPI 91 IRQ_TYPE_LEVEL_HIGH>; | ||
241 | clocks = <&tegra_car TEGRA124_CLK_UARTE>; | ||
242 | resets = <&tegra_car 66>; | ||
243 | reset-names = "serial"; | ||
244 | dmas = <&apbdma 20>, <&apbdma 20>; | ||
245 | dma-names = "rx", "tx"; | ||
246 | status = "disabled"; | ||
247 | }; | ||
248 | |||
249 | pwm@0,7000a000 { | 236 | pwm@0,7000a000 { |
250 | compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm"; | 237 | compatible = "nvidia,tegra124-pwm", "nvidia,tegra20-pwm"; |
251 | reg = <0x0 0x7000a000 0x0 0x100>; | 238 | reg = <0x0 0x7000a000 0x0 0x100>; |
diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts index 7dd1d6ede525..ded361075aab 100644 --- a/arch/arm/boot/dts/vf610-twr.dts +++ b/arch/arm/boot/dts/vf610-twr.dts | |||
@@ -25,11 +25,13 @@ | |||
25 | clocks { | 25 | clocks { |
26 | audio_ext { | 26 | audio_ext { |
27 | compatible = "fixed-clock"; | 27 | compatible = "fixed-clock"; |
28 | #clock-cells = <0>; | ||
28 | clock-frequency = <24576000>; | 29 | clock-frequency = <24576000>; |
29 | }; | 30 | }; |
30 | 31 | ||
31 | enet_ext { | 32 | enet_ext { |
32 | compatible = "fixed-clock"; | 33 | compatible = "fixed-clock"; |
34 | #clock-cells = <0>; | ||
33 | clock-frequency = <50000000>; | 35 | clock-frequency = <50000000>; |
34 | }; | 36 | }; |
35 | }; | 37 | }; |
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi index 804873367669..b8ce0aa7b157 100644 --- a/arch/arm/boot/dts/vf610.dtsi +++ b/arch/arm/boot/dts/vf610.dtsi | |||
@@ -45,11 +45,13 @@ | |||
45 | 45 | ||
46 | sxosc { | 46 | sxosc { |
47 | compatible = "fixed-clock"; | 47 | compatible = "fixed-clock"; |
48 | #clock-cells = <0>; | ||
48 | clock-frequency = <32768>; | 49 | clock-frequency = <32768>; |
49 | }; | 50 | }; |
50 | 51 | ||
51 | fxosc { | 52 | fxosc { |
52 | compatible = "fixed-clock"; | 53 | compatible = "fixed-clock"; |
54 | #clock-cells = <0>; | ||
53 | clock-frequency = <24000000>; | 55 | clock-frequency = <24000000>; |
54 | }; | 56 | }; |
55 | }; | 57 | }; |
@@ -72,8 +74,6 @@ | |||
72 | intc: interrupt-controller@40002000 { | 74 | intc: interrupt-controller@40002000 { |
73 | compatible = "arm,cortex-a9-gic"; | 75 | compatible = "arm,cortex-a9-gic"; |
74 | #interrupt-cells = <3>; | 76 | #interrupt-cells = <3>; |
75 | #address-cells = <1>; | ||
76 | #size-cells = <1>; | ||
77 | interrupt-controller; | 77 | interrupt-controller; |
78 | reg = <0x40003000 0x1000>, | 78 | reg = <0x40003000 0x1000>, |
79 | <0x40002100 0x100>; | 79 | <0x40002100 0x100>; |
diff --git a/arch/arm/boot/dts/zynq-7000.dtsi b/arch/arm/boot/dts/zynq-7000.dtsi index 511180769af5..c1176abc34d9 100644 --- a/arch/arm/boot/dts/zynq-7000.dtsi +++ b/arch/arm/boot/dts/zynq-7000.dtsi | |||
@@ -24,6 +24,7 @@ | |||
24 | device_type = "cpu"; | 24 | device_type = "cpu"; |
25 | reg = <0>; | 25 | reg = <0>; |
26 | clocks = <&clkc 3>; | 26 | clocks = <&clkc 3>; |
27 | clock-latency = <1000>; | ||
27 | operating-points = < | 28 | operating-points = < |
28 | /* kHz uV */ | 29 | /* kHz uV */ |
29 | 666667 1000000 | 30 | 666667 1000000 |
@@ -54,6 +55,28 @@ | |||
54 | interrupt-parent = <&intc>; | 55 | interrupt-parent = <&intc>; |
55 | ranges; | 56 | ranges; |
56 | 57 | ||
58 | i2c0: zynq-i2c@e0004000 { | ||
59 | compatible = "cdns,i2c-r1p10"; | ||
60 | status = "disabled"; | ||
61 | clocks = <&clkc 38>; | ||
62 | interrupt-parent = <&intc>; | ||
63 | interrupts = <0 25 4>; | ||
64 | reg = <0xe0004000 0x1000>; | ||
65 | #address-cells = <1>; | ||
66 | #size-cells = <0>; | ||
67 | }; | ||
68 | |||
69 | i2c1: zynq-i2c@e0005000 { | ||
70 | compatible = "cdns,i2c-r1p10"; | ||
71 | status = "disabled"; | ||
72 | clocks = <&clkc 39>; | ||
73 | interrupt-parent = <&intc>; | ||
74 | interrupts = <0 48 4>; | ||
75 | reg = <0xe0005000 0x1000>; | ||
76 | #address-cells = <1>; | ||
77 | #size-cells = <0>; | ||
78 | }; | ||
79 | |||
57 | intc: interrupt-controller@f8f01000 { | 80 | intc: interrupt-controller@f8f01000 { |
58 | compatible = "arm,cortex-a9-gic"; | 81 | compatible = "arm,cortex-a9-gic"; |
59 | #interrupt-cells = <3>; | 82 | #interrupt-cells = <3>; |
diff --git a/arch/arm/boot/dts/zynq-zc702.dts b/arch/arm/boot/dts/zynq-zc702.dts index c913f77a21eb..5e09cee33d42 100644 --- a/arch/arm/boot/dts/zynq-zc702.dts +++ b/arch/arm/boot/dts/zynq-zc702.dts | |||
@@ -34,6 +34,82 @@ | |||
34 | phy-mode = "rgmii"; | 34 | phy-mode = "rgmii"; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | &i2c0 { | ||
38 | status = "okay"; | ||
39 | clock-frequency = <400000>; | ||
40 | |||
41 | i2cswitch@74 { | ||
42 | compatible = "nxp,pca9548"; | ||
43 | #address-cells = <1>; | ||
44 | #size-cells = <0>; | ||
45 | reg = <0x74>; | ||
46 | |||
47 | i2c@0 { | ||
48 | #address-cells = <1>; | ||
49 | #size-cells = <0>; | ||
50 | reg = <0>; | ||
51 | si570: clock-generator@5d { | ||
52 | #clock-cells = <0>; | ||
53 | compatible = "silabs,si570"; | ||
54 | temperature-stability = <50>; | ||
55 | reg = <0x5d>; | ||
56 | factory-fout = <156250000>; | ||
57 | clock-frequency = <148500000>; | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | i2c@2 { | ||
62 | #address-cells = <1>; | ||
63 | #size-cells = <0>; | ||
64 | reg = <2>; | ||
65 | eeprom@54 { | ||
66 | compatible = "at,24c08"; | ||
67 | reg = <0x54>; | ||
68 | }; | ||
69 | }; | ||
70 | |||
71 | i2c@3 { | ||
72 | #address-cells = <1>; | ||
73 | #size-cells = <0>; | ||
74 | reg = <3>; | ||
75 | gpio@21 { | ||
76 | compatible = "ti,tca6416"; | ||
77 | reg = <0x21>; | ||
78 | gpio-controller; | ||
79 | #gpio-cells = <2>; | ||
80 | }; | ||
81 | }; | ||
82 | |||
83 | i2c@4 { | ||
84 | #address-cells = <1>; | ||
85 | #size-cells = <0>; | ||
86 | reg = <4>; | ||
87 | rtc@51 { | ||
88 | compatible = "nxp,pcf8563"; | ||
89 | reg = <0x51>; | ||
90 | }; | ||
91 | }; | ||
92 | |||
93 | i2c@7 { | ||
94 | #address-cells = <1>; | ||
95 | #size-cells = <0>; | ||
96 | reg = <7>; | ||
97 | hwmon@52 { | ||
98 | compatible = "ti,ucd9248"; | ||
99 | reg = <52>; | ||
100 | }; | ||
101 | hwmon@53 { | ||
102 | compatible = "ti,ucd9248"; | ||
103 | reg = <53>; | ||
104 | }; | ||
105 | hwmon@54 { | ||
106 | compatible = "ti,ucd9248"; | ||
107 | reg = <54>; | ||
108 | }; | ||
109 | }; | ||
110 | }; | ||
111 | }; | ||
112 | |||
37 | &sdhci0 { | 113 | &sdhci0 { |
38 | status = "okay"; | 114 | status = "okay"; |
39 | }; | 115 | }; |
diff --git a/arch/arm/boot/dts/zynq-zc706.dts b/arch/arm/boot/dts/zynq-zc706.dts index 88f62c50382e..4cc9913078cd 100644 --- a/arch/arm/boot/dts/zynq-zc706.dts +++ b/arch/arm/boot/dts/zynq-zc706.dts | |||
@@ -35,6 +35,74 @@ | |||
35 | phy-mode = "rgmii"; | 35 | phy-mode = "rgmii"; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | &i2c0 { | ||
39 | status = "okay"; | ||
40 | clock-frequency = <400000>; | ||
41 | |||
42 | i2cswitch@74 { | ||
43 | compatible = "nxp,pca9548"; | ||
44 | #address-cells = <1>; | ||
45 | #size-cells = <0>; | ||
46 | reg = <0x74>; | ||
47 | |||
48 | i2c@0 { | ||
49 | #address-cells = <1>; | ||
50 | #size-cells = <0>; | ||
51 | reg = <0>; | ||
52 | si570: clock-generator@5d { | ||
53 | #clock-cells = <0>; | ||
54 | compatible = "silabs,si570"; | ||
55 | temperature-stability = <50>; | ||
56 | reg = <0x5d>; | ||
57 | factory-fout = <156250000>; | ||
58 | clock-frequency = <148500000>; | ||
59 | }; | ||
60 | }; | ||
61 | |||
62 | i2c@2 { | ||
63 | #address-cells = <1>; | ||
64 | #size-cells = <0>; | ||
65 | reg = <2>; | ||
66 | eeprom@54 { | ||
67 | compatible = "at,24c08"; | ||
68 | reg = <0x54>; | ||
69 | }; | ||
70 | }; | ||
71 | |||
72 | i2c@3 { | ||
73 | #address-cells = <1>; | ||
74 | #size-cells = <0>; | ||
75 | reg = <3>; | ||
76 | gpio@21 { | ||
77 | compatible = "ti,tca6416"; | ||
78 | reg = <0x21>; | ||
79 | gpio-controller; | ||
80 | #gpio-cells = <2>; | ||
81 | }; | ||
82 | }; | ||
83 | |||
84 | i2c@4 { | ||
85 | #address-cells = <1>; | ||
86 | #size-cells = <0>; | ||
87 | reg = <4>; | ||
88 | rtc@51 { | ||
89 | compatible = "nxp,pcf8563"; | ||
90 | reg = <0x51>; | ||
91 | }; | ||
92 | }; | ||
93 | |||
94 | i2c@7 { | ||
95 | #address-cells = <1>; | ||
96 | #size-cells = <0>; | ||
97 | reg = <7>; | ||
98 | ucd90120@65 { | ||
99 | compatible = "ti,ucd90120"; | ||
100 | reg = <0x65>; | ||
101 | }; | ||
102 | }; | ||
103 | }; | ||
104 | }; | ||
105 | |||
38 | &sdhci0 { | 106 | &sdhci0 { |
39 | status = "okay"; | 107 | status = "okay"; |
40 | }; | 108 | }; |
diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c index 5774b6ea7ad5..490f3dced749 100644 --- a/arch/arm/common/bL_switcher.c +++ b/arch/arm/common/bL_switcher.c | |||
@@ -433,8 +433,12 @@ static void bL_switcher_restore_cpus(void) | |||
433 | { | 433 | { |
434 | int i; | 434 | int i; |
435 | 435 | ||
436 | for_each_cpu(i, &bL_switcher_removed_logical_cpus) | 436 | for_each_cpu(i, &bL_switcher_removed_logical_cpus) { |
437 | cpu_up(i); | 437 | struct device *cpu_dev = get_cpu_device(i); |
438 | int ret = device_online(cpu_dev); | ||
439 | if (ret) | ||
440 | dev_err(cpu_dev, "switcher: unable to restore CPU\n"); | ||
441 | } | ||
438 | } | 442 | } |
439 | 443 | ||
440 | static int bL_switcher_halve_cpus(void) | 444 | static int bL_switcher_halve_cpus(void) |
@@ -521,7 +525,7 @@ static int bL_switcher_halve_cpus(void) | |||
521 | continue; | 525 | continue; |
522 | } | 526 | } |
523 | 527 | ||
524 | ret = cpu_down(i); | 528 | ret = device_offline(get_cpu_device(i)); |
525 | if (ret) { | 529 | if (ret) { |
526 | bL_switcher_restore_cpus(); | 530 | bL_switcher_restore_cpus(); |
527 | return ret; | 531 | return ret; |
@@ -797,10 +801,8 @@ static int __init bL_switcher_init(void) | |||
797 | { | 801 | { |
798 | int ret; | 802 | int ret; |
799 | 803 | ||
800 | if (MAX_NR_CLUSTERS != 2) { | 804 | if (!mcpm_is_available()) |
801 | pr_err("%s: only dual cluster systems are supported\n", __func__); | 805 | return -ENODEV; |
802 | return -EINVAL; | ||
803 | } | ||
804 | 806 | ||
805 | cpu_notifier(bL_switcher_hotplug_callback, 0); | 807 | cpu_notifier(bL_switcher_hotplug_callback, 0); |
806 | 808 | ||
diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c index 41bca32409fc..5339009b3c0c 100644 --- a/arch/arm/common/edma.c +++ b/arch/arm/common/edma.c | |||
@@ -1423,55 +1423,38 @@ EXPORT_SYMBOL(edma_clear_event); | |||
1423 | 1423 | ||
1424 | #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DMADEVICES) | 1424 | #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DMADEVICES) |
1425 | 1425 | ||
1426 | static int edma_of_read_u32_to_s16_array(const struct device_node *np, | 1426 | static int edma_xbar_event_map(struct device *dev, struct device_node *node, |
1427 | const char *propname, s16 *out_values, | 1427 | struct edma_soc_info *pdata, size_t sz) |
1428 | size_t sz) | ||
1429 | { | 1428 | { |
1430 | int ret; | 1429 | const char pname[] = "ti,edma-xbar-event-map"; |
1431 | |||
1432 | ret = of_property_read_u16_array(np, propname, out_values, sz); | ||
1433 | if (ret) | ||
1434 | return ret; | ||
1435 | |||
1436 | /* Terminate it */ | ||
1437 | *out_values++ = -1; | ||
1438 | *out_values++ = -1; | ||
1439 | |||
1440 | return 0; | ||
1441 | } | ||
1442 | |||
1443 | static int edma_xbar_event_map(struct device *dev, | ||
1444 | struct device_node *node, | ||
1445 | struct edma_soc_info *pdata, int len) | ||
1446 | { | ||
1447 | int ret, i; | ||
1448 | struct resource res; | 1430 | struct resource res; |
1449 | void __iomem *xbar; | 1431 | void __iomem *xbar; |
1450 | const s16 (*xbar_chans)[2]; | 1432 | s16 (*xbar_chans)[2]; |
1433 | size_t nelm = sz / sizeof(s16); | ||
1451 | u32 shift, offset, mux; | 1434 | u32 shift, offset, mux; |
1435 | int ret, i; | ||
1452 | 1436 | ||
1453 | xbar_chans = devm_kzalloc(dev, | 1437 | xbar_chans = devm_kzalloc(dev, (nelm + 2) * sizeof(s16), GFP_KERNEL); |
1454 | len/sizeof(s16) + 2*sizeof(s16), | ||
1455 | GFP_KERNEL); | ||
1456 | if (!xbar_chans) | 1438 | if (!xbar_chans) |
1457 | return -ENOMEM; | 1439 | return -ENOMEM; |
1458 | 1440 | ||
1459 | ret = of_address_to_resource(node, 1, &res); | 1441 | ret = of_address_to_resource(node, 1, &res); |
1460 | if (ret) | 1442 | if (ret) |
1461 | return -EIO; | 1443 | return -ENOMEM; |
1462 | 1444 | ||
1463 | xbar = devm_ioremap(dev, res.start, resource_size(&res)); | 1445 | xbar = devm_ioremap(dev, res.start, resource_size(&res)); |
1464 | if (!xbar) | 1446 | if (!xbar) |
1465 | return -ENOMEM; | 1447 | return -ENOMEM; |
1466 | 1448 | ||
1467 | ret = edma_of_read_u32_to_s16_array(node, | 1449 | ret = of_property_read_u16_array(node, pname, (u16 *)xbar_chans, nelm); |
1468 | "ti,edma-xbar-event-map", | ||
1469 | (s16 *)xbar_chans, | ||
1470 | len/sizeof(u32)); | ||
1471 | if (ret) | 1450 | if (ret) |
1472 | return -EIO; | 1451 | return -EIO; |
1473 | 1452 | ||
1474 | for (i = 0; xbar_chans[i][0] != -1; i++) { | 1453 | /* Invalidate last entry for the other user of this mess */ |
1454 | nelm >>= 1; | ||
1455 | xbar_chans[nelm][0] = xbar_chans[nelm][1] = -1; | ||
1456 | |||
1457 | for (i = 0; i < nelm; i++) { | ||
1475 | shift = (xbar_chans[i][1] & 0x03) << 3; | 1458 | shift = (xbar_chans[i][1] & 0x03) << 3; |
1476 | offset = xbar_chans[i][1] & 0xfffffffc; | 1459 | offset = xbar_chans[i][1] & 0xfffffffc; |
1477 | mux = readl(xbar + offset); | 1460 | mux = readl(xbar + offset); |
@@ -1480,8 +1463,7 @@ static int edma_xbar_event_map(struct device *dev, | |||
1480 | writel(mux, (xbar + offset)); | 1463 | writel(mux, (xbar + offset)); |
1481 | } | 1464 | } |
1482 | 1465 | ||
1483 | pdata->xbar_chans = xbar_chans; | 1466 | pdata->xbar_chans = (const s16 (*)[2]) xbar_chans; |
1484 | |||
1485 | return 0; | 1467 | return 0; |
1486 | } | 1468 | } |
1487 | 1469 | ||
diff --git a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c index 1e361abc29eb..86fd60fefbc9 100644 --- a/arch/arm/common/mcpm_entry.c +++ b/arch/arm/common/mcpm_entry.c | |||
@@ -48,6 +48,11 @@ int __init mcpm_platform_register(const struct mcpm_platform_ops *ops) | |||
48 | return 0; | 48 | return 0; |
49 | } | 49 | } |
50 | 50 | ||
51 | bool mcpm_is_available(void) | ||
52 | { | ||
53 | return (platform_ops) ? true : false; | ||
54 | } | ||
55 | |||
51 | int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster) | 56 | int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster) |
52 | { | 57 | { |
53 | if (!platform_ops) | 58 | if (!platform_ops) |
diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 01004640ee4d..3df3f3a79ef4 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig | |||
@@ -132,7 +132,7 @@ CONFIG_CRC_ITU_T=y | |||
132 | CONFIG_CRC7=y | 132 | CONFIG_CRC7=y |
133 | CONFIG_XZ_DEC=y | 133 | CONFIG_XZ_DEC=y |
134 | CONFIG_AVERAGE=y | 134 | CONFIG_AVERAGE=y |
135 | CONFIG_PINCTRL_CAPRI=y | 135 | CONFIG_PINCTRL_BCM281XX=y |
136 | CONFIG_WATCHDOG=y | 136 | CONFIG_WATCHDOG=y |
137 | CONFIG_BCM_KONA_WDT=y | 137 | CONFIG_BCM_KONA_WDT=y |
138 | CONFIG_BCM_KONA_WDT_DEBUG=y | 138 | CONFIG_BCM_KONA_WDT_DEBUG=y |
diff --git a/arch/arm/configs/exynos_defconfig b/arch/arm/configs/exynos_defconfig index 4ce7b70ea901..e07a227ec0db 100644 --- a/arch/arm/configs/exynos_defconfig +++ b/arch/arm/configs/exynos_defconfig | |||
@@ -65,6 +65,7 @@ CONFIG_TCG_TIS_I2C_INFINEON=y | |||
65 | CONFIG_I2C=y | 65 | CONFIG_I2C=y |
66 | CONFIG_I2C_MUX=y | 66 | CONFIG_I2C_MUX=y |
67 | CONFIG_I2C_ARB_GPIO_CHALLENGE=y | 67 | CONFIG_I2C_ARB_GPIO_CHALLENGE=y |
68 | CONFIG_I2C_EXYNOS5=y | ||
68 | CONFIG_I2C_S3C2410=y | 69 | CONFIG_I2C_S3C2410=y |
69 | CONFIG_DEBUG_GPIO=y | 70 | CONFIG_DEBUG_GPIO=y |
70 | # CONFIG_HWMON is not set | 71 | # CONFIG_HWMON is not set |
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig index a9667957b757..a4e8d017f25b 100644 --- a/arch/arm/configs/omap2plus_defconfig +++ b/arch/arm/configs/omap2plus_defconfig | |||
@@ -226,7 +226,7 @@ CONFIG_USB_DWC3=m | |||
226 | CONFIG_USB_TEST=y | 226 | CONFIG_USB_TEST=y |
227 | CONFIG_NOP_USB_XCEIV=y | 227 | CONFIG_NOP_USB_XCEIV=y |
228 | CONFIG_OMAP_USB2=y | 228 | CONFIG_OMAP_USB2=y |
229 | CONFIG_OMAP_USB3=y | 229 | CONFIG_TI_PIPE3=y |
230 | CONFIG_AM335X_PHY_USB=y | 230 | CONFIG_AM335X_PHY_USB=y |
231 | CONFIG_USB_GADGET=y | 231 | CONFIG_USB_GADGET=y |
232 | CONFIG_USB_GADGET_DEBUG=y | 232 | CONFIG_USB_GADGET_DEBUG=y |
diff --git a/arch/arm/configs/sunxi_defconfig b/arch/arm/configs/sunxi_defconfig index b5df4a511b0a..81ba78eaf54a 100644 --- a/arch/arm/configs/sunxi_defconfig +++ b/arch/arm/configs/sunxi_defconfig | |||
@@ -37,7 +37,7 @@ CONFIG_SUN4I_EMAC=y | |||
37 | # CONFIG_NET_VENDOR_NATSEMI is not set | 37 | # CONFIG_NET_VENDOR_NATSEMI is not set |
38 | # CONFIG_NET_VENDOR_SEEQ is not set | 38 | # CONFIG_NET_VENDOR_SEEQ is not set |
39 | # CONFIG_NET_VENDOR_SMSC is not set | 39 | # CONFIG_NET_VENDOR_SMSC is not set |
40 | # CONFIG_NET_VENDOR_STMICRO is not set | 40 | CONFIG_STMMAC_ETH=y |
41 | # CONFIG_NET_VENDOR_WIZNET is not set | 41 | # CONFIG_NET_VENDOR_WIZNET is not set |
42 | # CONFIG_WLAN is not set | 42 | # CONFIG_WLAN is not set |
43 | CONFIG_SERIAL_8250=y | 43 | CONFIG_SERIAL_8250=y |
diff --git a/arch/arm/configs/u300_defconfig b/arch/arm/configs/u300_defconfig index fd81a1b99cce..aaa95ab606a8 100644 --- a/arch/arm/configs/u300_defconfig +++ b/arch/arm/configs/u300_defconfig | |||
@@ -11,6 +11,7 @@ CONFIG_MODULES=y | |||
11 | CONFIG_MODULE_UNLOAD=y | 11 | CONFIG_MODULE_UNLOAD=y |
12 | # CONFIG_LBDAF is not set | 12 | # CONFIG_LBDAF is not set |
13 | # CONFIG_BLK_DEV_BSG is not set | 13 | # CONFIG_BLK_DEV_BSG is not set |
14 | CONFIG_PARTITION_ADVANCED=y | ||
14 | # CONFIG_IOSCHED_CFQ is not set | 15 | # CONFIG_IOSCHED_CFQ is not set |
15 | # CONFIG_ARCH_MULTI_V7 is not set | 16 | # CONFIG_ARCH_MULTI_V7 is not set |
16 | CONFIG_ARCH_U300=y | 17 | CONFIG_ARCH_U300=y |
@@ -21,7 +22,6 @@ CONFIG_ZBOOT_ROM_TEXT=0x0 | |||
21 | CONFIG_ZBOOT_ROM_BSS=0x0 | 22 | CONFIG_ZBOOT_ROM_BSS=0x0 |
22 | CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072" | 23 | CONFIG_CMDLINE="root=/dev/ram0 rw rootfstype=rootfs console=ttyAMA0,115200n8 lpj=515072" |
23 | CONFIG_CPU_IDLE=y | 24 | CONFIG_CPU_IDLE=y |
24 | CONFIG_FPE_NWFPE=y | ||
25 | # CONFIG_SUSPEND is not set | 25 | # CONFIG_SUSPEND is not set |
26 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 26 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
27 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 27 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
@@ -64,8 +64,8 @@ CONFIG_TMPFS=y | |||
64 | CONFIG_NLS_CODEPAGE_437=y | 64 | CONFIG_NLS_CODEPAGE_437=y |
65 | CONFIG_NLS_ISO8859_1=y | 65 | CONFIG_NLS_ISO8859_1=y |
66 | CONFIG_PRINTK_TIME=y | 66 | CONFIG_PRINTK_TIME=y |
67 | CONFIG_DEBUG_INFO=y | ||
67 | CONFIG_DEBUG_FS=y | 68 | CONFIG_DEBUG_FS=y |
68 | # CONFIG_SCHED_DEBUG is not set | 69 | # CONFIG_SCHED_DEBUG is not set |
69 | CONFIG_TIMER_STATS=y | 70 | CONFIG_TIMER_STATS=y |
70 | # CONFIG_DEBUG_PREEMPT is not set | 71 | # CONFIG_DEBUG_PREEMPT is not set |
71 | CONFIG_DEBUG_INFO=y | ||
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig index 65f77885c167..d219d6a43238 100644 --- a/arch/arm/configs/u8500_defconfig +++ b/arch/arm/configs/u8500_defconfig | |||
@@ -1,16 +1,16 @@ | |||
1 | # CONFIG_SWAP is not set | 1 | # CONFIG_SWAP is not set |
2 | CONFIG_SYSVIPC=y | 2 | CONFIG_SYSVIPC=y |
3 | CONFIG_NO_HZ=y | 3 | CONFIG_NO_HZ_IDLE=y |
4 | CONFIG_HIGH_RES_TIMERS=y | 4 | CONFIG_HIGH_RES_TIMERS=y |
5 | CONFIG_BLK_DEV_INITRD=y | 5 | CONFIG_BLK_DEV_INITRD=y |
6 | CONFIG_KALLSYMS_ALL=y | 6 | CONFIG_KALLSYMS_ALL=y |
7 | CONFIG_MODULES=y | 7 | CONFIG_MODULES=y |
8 | CONFIG_MODULE_UNLOAD=y | 8 | CONFIG_MODULE_UNLOAD=y |
9 | # CONFIG_BLK_DEV_BSG is not set | 9 | # CONFIG_BLK_DEV_BSG is not set |
10 | CONFIG_PARTITION_ADVANCED=y | ||
10 | CONFIG_ARCH_U8500=y | 11 | CONFIG_ARCH_U8500=y |
11 | CONFIG_MACH_HREFV60=y | 12 | CONFIG_MACH_HREFV60=y |
12 | CONFIG_MACH_SNOWBALL=y | 13 | CONFIG_MACH_SNOWBALL=y |
13 | CONFIG_MACH_UX500_DT=y | ||
14 | CONFIG_SMP=y | 14 | CONFIG_SMP=y |
15 | CONFIG_NR_CPUS=2 | 15 | CONFIG_NR_CPUS=2 |
16 | CONFIG_PREEMPT=y | 16 | CONFIG_PREEMPT=y |
@@ -34,16 +34,22 @@ CONFIG_IP_PNP=y | |||
34 | CONFIG_IP_PNP_DHCP=y | 34 | CONFIG_IP_PNP_DHCP=y |
35 | CONFIG_NETFILTER=y | 35 | CONFIG_NETFILTER=y |
36 | CONFIG_PHONET=y | 36 | CONFIG_PHONET=y |
37 | # CONFIG_WIRELESS is not set | 37 | CONFIG_CFG80211=y |
38 | CONFIG_CFG80211_DEBUGFS=y | ||
39 | CONFIG_MAC80211=y | ||
40 | CONFIG_MAC80211_LEDS=y | ||
38 | CONFIG_CAIF=y | 41 | CONFIG_CAIF=y |
39 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 42 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
43 | CONFIG_DEVTMPFS=y | ||
44 | CONFIG_DEVTMPFS_MOUNT=y | ||
40 | CONFIG_BLK_DEV_RAM=y | 45 | CONFIG_BLK_DEV_RAM=y |
41 | CONFIG_BLK_DEV_RAM_SIZE=65536 | 46 | CONFIG_BLK_DEV_RAM_SIZE=65536 |
42 | CONFIG_SENSORS_BH1780=y | 47 | CONFIG_SENSORS_BH1780=y |
43 | CONFIG_NETDEVICES=y | 48 | CONFIG_NETDEVICES=y |
44 | CONFIG_SMSC911X=y | 49 | CONFIG_SMSC911X=y |
45 | CONFIG_SMSC_PHY=y | 50 | CONFIG_SMSC_PHY=y |
46 | # CONFIG_WLAN is not set | 51 | CONFIG_CW1200=y |
52 | CONFIG_CW1200_WLAN_SDIO=y | ||
47 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | 53 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
48 | CONFIG_INPUT_EVDEV=y | 54 | CONFIG_INPUT_EVDEV=y |
49 | # CONFIG_KEYBOARD_ATKBD is not set | 55 | # CONFIG_KEYBOARD_ATKBD is not set |
@@ -85,15 +91,12 @@ CONFIG_AB8500_USB=y | |||
85 | CONFIG_USB_GADGET=y | 91 | CONFIG_USB_GADGET=y |
86 | CONFIG_USB_ETH=m | 92 | CONFIG_USB_ETH=m |
87 | CONFIG_MMC=y | 93 | CONFIG_MMC=y |
88 | CONFIG_MMC_UNSAFE_RESUME=y | ||
89 | # CONFIG_MMC_BLOCK_BOUNCE is not set | ||
90 | CONFIG_MMC_ARMMMCI=y | 94 | CONFIG_MMC_ARMMMCI=y |
91 | CONFIG_NEW_LEDS=y | 95 | CONFIG_NEW_LEDS=y |
92 | CONFIG_LEDS_CLASS=y | 96 | CONFIG_LEDS_CLASS=y |
93 | CONFIG_LEDS_LM3530=y | 97 | CONFIG_LEDS_LM3530=y |
94 | CONFIG_LEDS_GPIO=y | 98 | CONFIG_LEDS_GPIO=y |
95 | CONFIG_LEDS_LP5521=y | 99 | CONFIG_LEDS_LP5521=y |
96 | CONFIG_LEDS_TRIGGERS=y | ||
97 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | 100 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y |
98 | CONFIG_RTC_CLASS=y | 101 | CONFIG_RTC_CLASS=y |
99 | CONFIG_RTC_DRV_AB8500=y | 102 | CONFIG_RTC_DRV_AB8500=y |
@@ -103,6 +106,11 @@ CONFIG_STE_DMA40=y | |||
103 | CONFIG_STAGING=y | 106 | CONFIG_STAGING=y |
104 | CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y | 107 | CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y |
105 | CONFIG_HSEM_U8500=y | 108 | CONFIG_HSEM_U8500=y |
109 | CONFIG_IIO=y | ||
110 | CONFIG_IIO_ST_ACCEL_3AXIS=y | ||
111 | CONFIG_IIO_ST_GYRO_3AXIS=y | ||
112 | CONFIG_IIO_ST_MAGN_3AXIS=y | ||
113 | CONFIG_IIO_ST_PRESS=y | ||
106 | CONFIG_EXT2_FS=y | 114 | CONFIG_EXT2_FS=y |
107 | CONFIG_EXT2_FS_XATTR=y | 115 | CONFIG_EXT2_FS_XATTR=y |
108 | CONFIG_EXT2_FS_POSIX_ACL=y | 116 | CONFIG_EXT2_FS_POSIX_ACL=y |
@@ -110,8 +118,6 @@ CONFIG_EXT2_FS_SECURITY=y | |||
110 | CONFIG_EXT3_FS=y | 118 | CONFIG_EXT3_FS=y |
111 | CONFIG_EXT4_FS=y | 119 | CONFIG_EXT4_FS=y |
112 | CONFIG_VFAT_FS=y | 120 | CONFIG_VFAT_FS=y |
113 | CONFIG_DEVTMPFS=y | ||
114 | CONFIG_DEVTMPFS_MOUNT=y | ||
115 | CONFIG_TMPFS=y | 121 | CONFIG_TMPFS=y |
116 | CONFIG_TMPFS_POSIX_ACL=y | 122 | CONFIG_TMPFS_POSIX_ACL=y |
117 | # CONFIG_MISC_FILESYSTEMS is not set | 123 | # CONFIG_MISC_FILESYSTEMS is not set |
diff --git a/arch/arm/include/asm/cputype.h b/arch/arm/include/asm/cputype.h index c651e3b26ec7..4764344367d4 100644 --- a/arch/arm/include/asm/cputype.h +++ b/arch/arm/include/asm/cputype.h | |||
@@ -222,22 +222,22 @@ static inline int cpu_is_xsc3(void) | |||
222 | #endif | 222 | #endif |
223 | 223 | ||
224 | /* | 224 | /* |
225 | * Marvell's PJ4 core is based on V7 version. It has some modification | 225 | * Marvell's PJ4 and PJ4B cores are based on V7 version, |
226 | * for coprocessor setting. For this reason, we need a way to distinguish | 226 | * but require a specical sequence for enabling coprocessors. |
227 | * it. | 227 | * For this reason, we need a way to distinguish them. |
228 | */ | 228 | */ |
229 | #ifndef CONFIG_CPU_PJ4 | 229 | #if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B) |
230 | #define cpu_is_pj4() 0 | ||
231 | #else | ||
232 | static inline int cpu_is_pj4(void) | 230 | static inline int cpu_is_pj4(void) |
233 | { | 231 | { |
234 | unsigned int id; | 232 | unsigned int id; |
235 | 233 | ||
236 | id = read_cpuid_id(); | 234 | id = read_cpuid_id(); |
237 | if ((id & 0xfffffff0) == 0x562f5840) | 235 | if ((id & 0xff0fff00) == 0x560f5800) |
238 | return 1; | 236 | return 1; |
239 | 237 | ||
240 | return 0; | 238 | return 0; |
241 | } | 239 | } |
240 | #else | ||
241 | #define cpu_is_pj4() 0 | ||
242 | #endif | 242 | #endif |
243 | #endif | 243 | #endif |
diff --git a/arch/arm/include/asm/div64.h b/arch/arm/include/asm/div64.h index 191ada6e4d2d..662c7bd06108 100644 --- a/arch/arm/include/asm/div64.h +++ b/arch/arm/include/asm/div64.h | |||
@@ -156,7 +156,7 @@ | |||
156 | /* Select the best insn combination to perform the */ \ | 156 | /* Select the best insn combination to perform the */ \ |
157 | /* actual __m * __n / (__p << 64) operation. */ \ | 157 | /* actual __m * __n / (__p << 64) operation. */ \ |
158 | if (!__c) { \ | 158 | if (!__c) { \ |
159 | asm ( "umull %Q0, %R0, %1, %Q2\n\t" \ | 159 | asm ( "umull %Q0, %R0, %Q1, %Q2\n\t" \ |
160 | "mov %Q0, #0" \ | 160 | "mov %Q0, #0" \ |
161 | : "=&r" (__res) \ | 161 | : "=&r" (__res) \ |
162 | : "r" (__m), "r" (__n) \ | 162 | : "r" (__m), "r" (__n) \ |
diff --git a/arch/arm/include/asm/mcpm.h b/arch/arm/include/asm/mcpm.h index 608516ebabfe..a5ff410dcdb6 100644 --- a/arch/arm/include/asm/mcpm.h +++ b/arch/arm/include/asm/mcpm.h | |||
@@ -54,6 +54,13 @@ void mcpm_set_early_poke(unsigned cpu, unsigned cluster, | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | /** | 56 | /** |
57 | * mcpm_is_available - returns whether MCPM is initialized and available | ||
58 | * | ||
59 | * This returns true or false accordingly. | ||
60 | */ | ||
61 | bool mcpm_is_available(void); | ||
62 | |||
63 | /** | ||
57 | * mcpm_cpu_power_up - make given CPU in given cluster runable | 64 | * mcpm_cpu_power_up - make given CPU in given cluster runable |
58 | * | 65 | * |
59 | * @cpu: CPU number within given cluster | 66 | * @cpu: CPU number within given cluster |
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h index 0baf7f0d9394..f1a0dace3efe 100644 --- a/arch/arm/include/asm/tlb.h +++ b/arch/arm/include/asm/tlb.h | |||
@@ -98,15 +98,25 @@ static inline void __tlb_alloc_page(struct mmu_gather *tlb) | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | 101 | static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) |
102 | { | 102 | { |
103 | tlb_flush(tlb); | 103 | tlb_flush(tlb); |
104 | } | ||
105 | |||
106 | static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) | ||
107 | { | ||
104 | free_pages_and_swap_cache(tlb->pages, tlb->nr); | 108 | free_pages_and_swap_cache(tlb->pages, tlb->nr); |
105 | tlb->nr = 0; | 109 | tlb->nr = 0; |
106 | if (tlb->pages == tlb->local) | 110 | if (tlb->pages == tlb->local) |
107 | __tlb_alloc_page(tlb); | 111 | __tlb_alloc_page(tlb); |
108 | } | 112 | } |
109 | 113 | ||
114 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | ||
115 | { | ||
116 | tlb_flush_mmu_tlbonly(tlb); | ||
117 | tlb_flush_mmu_free(tlb); | ||
118 | } | ||
119 | |||
110 | static inline void | 120 | static inline void |
111 | tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end) | 121 | tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end) |
112 | { | 122 | { |
diff --git a/arch/arm/include/asm/trusted_foundations.h b/arch/arm/include/asm/trusted_foundations.h index b5f7705abcb0..624e1d436c6c 100644 --- a/arch/arm/include/asm/trusted_foundations.h +++ b/arch/arm/include/asm/trusted_foundations.h | |||
@@ -54,7 +54,9 @@ static inline void register_trusted_foundations( | |||
54 | */ | 54 | */ |
55 | pr_err("No support for Trusted Foundations, continuing in degraded mode.\n"); | 55 | pr_err("No support for Trusted Foundations, continuing in degraded mode.\n"); |
56 | pr_err("Secondary processors as well as CPU PM will be disabled.\n"); | 56 | pr_err("Secondary processors as well as CPU PM will be disabled.\n"); |
57 | #if IS_ENABLED(CONFIG_SMP) | ||
57 | setup_max_cpus = 0; | 58 | setup_max_cpus = 0; |
59 | #endif | ||
58 | cpu_idle_poll_ctrl(true); | 60 | cpu_idle_poll_ctrl(true); |
59 | } | 61 | } |
60 | 62 | ||
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 12c3a5decc60..75d95799b6e6 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
@@ -171,8 +171,9 @@ extern int __put_user_8(void *, unsigned long long); | |||
171 | #define __put_user_check(x,p) \ | 171 | #define __put_user_check(x,p) \ |
172 | ({ \ | 172 | ({ \ |
173 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ | 173 | unsigned long __limit = current_thread_info()->addr_limit - 1; \ |
174 | const typeof(*(p)) __user *__tmp_p = (p); \ | ||
174 | register const typeof(*(p)) __r2 asm("r2") = (x); \ | 175 | register const typeof(*(p)) __r2 asm("r2") = (x); \ |
175 | register const typeof(*(p)) __user *__p asm("r0") = (p);\ | 176 | register const typeof(*(p)) __user *__p asm("r0") = __tmp_p; \ |
176 | register unsigned long __l asm("r1") = __limit; \ | 177 | register unsigned long __l asm("r1") = __limit; \ |
177 | register int __e asm("r0"); \ | 178 | register int __e asm("r0"); \ |
178 | switch (sizeof(*(__p))) { \ | 179 | switch (sizeof(*(__p))) { \ |
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h index cf4f3e867395..ded062f9b358 100644 --- a/arch/arm/include/asm/xen/page.h +++ b/arch/arm/include/asm/xen/page.h | |||
@@ -77,7 +77,6 @@ static inline xpaddr_t machine_to_phys(xmaddr_t machine) | |||
77 | } | 77 | } |
78 | /* VIRT <-> MACHINE conversion */ | 78 | /* VIRT <-> MACHINE conversion */ |
79 | #define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v)))) | 79 | #define virt_to_machine(v) (phys_to_machine(XPADDR(__pa(v)))) |
80 | #define virt_to_pfn(v) (PFN_DOWN(__pa(v))) | ||
81 | #define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v))) | 80 | #define virt_to_mfn(v) (pfn_to_mfn(virt_to_pfn(v))) |
82 | #define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT)) | 81 | #define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT)) |
83 | 82 | ||
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h index fb5584d0cc05..ba94446c72d9 100644 --- a/arch/arm/include/uapi/asm/unistd.h +++ b/arch/arm/include/uapi/asm/unistd.h | |||
@@ -408,6 +408,7 @@ | |||
408 | #define __NR_finit_module (__NR_SYSCALL_BASE+379) | 408 | #define __NR_finit_module (__NR_SYSCALL_BASE+379) |
409 | #define __NR_sched_setattr (__NR_SYSCALL_BASE+380) | 409 | #define __NR_sched_setattr (__NR_SYSCALL_BASE+380) |
410 | #define __NR_sched_getattr (__NR_SYSCALL_BASE+381) | 410 | #define __NR_sched_getattr (__NR_SYSCALL_BASE+381) |
411 | #define __NR_renameat2 (__NR_SYSCALL_BASE+382) | ||
411 | 412 | ||
412 | /* | 413 | /* |
413 | * This may need to be greater than __NR_last_syscall+1 in order to | 414 | * This may need to be greater than __NR_last_syscall+1 in order to |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index a766bcbaf8ad..040619c32d68 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -79,6 +79,7 @@ obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o | |||
79 | obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o | 79 | obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o |
80 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o | 80 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o |
81 | obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o | 81 | obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o |
82 | obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o | ||
82 | obj-$(CONFIG_IWMMXT) += iwmmxt.o | 83 | obj-$(CONFIG_IWMMXT) += iwmmxt.o |
83 | obj-$(CONFIG_PERF_EVENTS) += perf_regs.o | 84 | obj-$(CONFIG_PERF_EVENTS) += perf_regs.o |
84 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o | 85 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o perf_event_cpu.o |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 166e945de832..8f51bdcdacbb 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -391,6 +391,7 @@ | |||
391 | CALL(sys_finit_module) | 391 | CALL(sys_finit_module) |
392 | /* 380 */ CALL(sys_sched_setattr) | 392 | /* 380 */ CALL(sys_sched_setattr) |
393 | CALL(sys_sched_getattr) | 393 | CALL(sys_sched_getattr) |
394 | CALL(sys_renameat2) | ||
394 | #ifndef syscalls_counted | 395 | #ifndef syscalls_counted |
395 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls | 396 | .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls |
396 | #define syscalls_counted | 397 | #define syscalls_counted |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 1420725142ca..efb208de75ec 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -132,6 +132,10 @@ | |||
132 | orrne r5, V7M_xPSR_FRAMEPTRALIGN | 132 | orrne r5, V7M_xPSR_FRAMEPTRALIGN |
133 | biceq r5, V7M_xPSR_FRAMEPTRALIGN | 133 | biceq r5, V7M_xPSR_FRAMEPTRALIGN |
134 | 134 | ||
135 | @ ensure bit 0 is cleared in the PC, otherwise behaviour is | ||
136 | @ unpredictable | ||
137 | bic r4, #1 | ||
138 | |||
135 | @ write basic exception frame | 139 | @ write basic exception frame |
136 | stmdb r2!, {r1, r3-r5} | 140 | stmdb r2!, {r1, r3-r5} |
137 | ldmia sp, {r1, r3-r5} | 141 | ldmia sp, {r1, r3-r5} |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index f8c08839edf3..591d6e4a6492 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -587,7 +587,7 @@ __fixup_pv_table: | |||
587 | add r6, r6, r3 @ adjust __pv_phys_pfn_offset address | 587 | add r6, r6, r3 @ adjust __pv_phys_pfn_offset address |
588 | add r7, r7, r3 @ adjust __pv_offset address | 588 | add r7, r7, r3 @ adjust __pv_offset address |
589 | mov r0, r8, lsr #12 @ convert to PFN | 589 | mov r0, r8, lsr #12 @ convert to PFN |
590 | str r0, [r6, #LOW_OFFSET] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset | 590 | str r0, [r6] @ save computed PHYS_OFFSET to __pv_phys_pfn_offset |
591 | strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits | 591 | strcc ip, [r7, #HIGH_OFFSET] @ save to __pv_offset high bits |
592 | mov r6, r3, lsr #24 @ constant for add/sub instructions | 592 | mov r6, r3, lsr #24 @ constant for add/sub instructions |
593 | teq r3, r6, lsl #24 @ must be 16MiB aligned | 593 | teq r3, r6, lsl #24 @ must be 16MiB aligned |
diff --git a/arch/arm/kernel/iwmmxt.S b/arch/arm/kernel/iwmmxt.S index a08783823b32..2452dd1bef53 100644 --- a/arch/arm/kernel/iwmmxt.S +++ b/arch/arm/kernel/iwmmxt.S | |||
@@ -19,12 +19,16 @@ | |||
19 | #include <asm/thread_info.h> | 19 | #include <asm/thread_info.h> |
20 | #include <asm/asm-offsets.h> | 20 | #include <asm/asm-offsets.h> |
21 | 21 | ||
22 | #if defined(CONFIG_CPU_PJ4) | 22 | #if defined(CONFIG_CPU_PJ4) || defined(CONFIG_CPU_PJ4B) |
23 | #define PJ4(code...) code | 23 | #define PJ4(code...) code |
24 | #define XSC(code...) | 24 | #define XSC(code...) |
25 | #else | 25 | #elif defined(CONFIG_CPU_MOHAWK) || \ |
26 | defined(CONFIG_CPU_XSC3) || \ | ||
27 | defined(CONFIG_CPU_XSCALE) | ||
26 | #define PJ4(code...) | 28 | #define PJ4(code...) |
27 | #define XSC(code...) code | 29 | #define XSC(code...) code |
30 | #else | ||
31 | #error "Unsupported iWMMXt architecture" | ||
28 | #endif | 32 | #endif |
29 | 33 | ||
30 | #define MMX_WR0 (0x00) | 34 | #define MMX_WR0 (0x00) |
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index f0d180d8b29f..8cf0996aa1a8 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -184,3 +184,10 @@ void machine_kexec(struct kimage *image) | |||
184 | 184 | ||
185 | soft_restart(reboot_entry_phys); | 185 | soft_restart(reboot_entry_phys); |
186 | } | 186 | } |
187 | |||
188 | void arch_crash_save_vmcoreinfo(void) | ||
189 | { | ||
190 | #ifdef CONFIG_ARM_LPAE | ||
191 | VMCOREINFO_CONFIG(ARM_LPAE); | ||
192 | #endif | ||
193 | } | ||
diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c index fc7208636284..8153e36b2491 100644 --- a/arch/arm/kernel/pj4-cp0.c +++ b/arch/arm/kernel/pj4-cp0.c | |||
@@ -45,7 +45,7 @@ static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t) | |||
45 | return NOTIFY_DONE; | 45 | return NOTIFY_DONE; |
46 | } | 46 | } |
47 | 47 | ||
48 | static struct notifier_block iwmmxt_notifier_block = { | 48 | static struct notifier_block __maybe_unused iwmmxt_notifier_block = { |
49 | .notifier_call = iwmmxt_do, | 49 | .notifier_call = iwmmxt_do, |
50 | }; | 50 | }; |
51 | 51 | ||
@@ -72,6 +72,33 @@ static void __init pj4_cp_access_write(u32 value) | |||
72 | : "=r" (temp) : "r" (value)); | 72 | : "=r" (temp) : "r" (value)); |
73 | } | 73 | } |
74 | 74 | ||
75 | static int __init pj4_get_iwmmxt_version(void) | ||
76 | { | ||
77 | u32 cp_access, wcid; | ||
78 | |||
79 | cp_access = pj4_cp_access_read(); | ||
80 | pj4_cp_access_write(cp_access | 0xf); | ||
81 | |||
82 | /* check if coprocessor 0 and 1 are available */ | ||
83 | if ((pj4_cp_access_read() & 0xf) != 0xf) { | ||
84 | pj4_cp_access_write(cp_access); | ||
85 | return -ENODEV; | ||
86 | } | ||
87 | |||
88 | /* read iWMMXt coprocessor id register p1, c0 */ | ||
89 | __asm__ __volatile__ ("mrc p1, 0, %0, c0, c0, 0\n" : "=r" (wcid)); | ||
90 | |||
91 | pj4_cp_access_write(cp_access); | ||
92 | |||
93 | /* iWMMXt v1 */ | ||
94 | if ((wcid & 0xffffff00) == 0x56051000) | ||
95 | return 1; | ||
96 | /* iWMMXt v2 */ | ||
97 | if ((wcid & 0xffffff00) == 0x56052000) | ||
98 | return 2; | ||
99 | |||
100 | return -EINVAL; | ||
101 | } | ||
75 | 102 | ||
76 | /* | 103 | /* |
77 | * Disable CP0/CP1 on boot, and let call_fpe() and the iWMMXt lazy | 104 | * Disable CP0/CP1 on boot, and let call_fpe() and the iWMMXt lazy |
@@ -79,17 +106,26 @@ static void __init pj4_cp_access_write(u32 value) | |||
79 | */ | 106 | */ |
80 | static int __init pj4_cp0_init(void) | 107 | static int __init pj4_cp0_init(void) |
81 | { | 108 | { |
82 | u32 cp_access; | 109 | u32 __maybe_unused cp_access; |
110 | int vers; | ||
83 | 111 | ||
84 | if (!cpu_is_pj4()) | 112 | if (!cpu_is_pj4()) |
85 | return 0; | 113 | return 0; |
86 | 114 | ||
115 | vers = pj4_get_iwmmxt_version(); | ||
116 | if (vers < 0) | ||
117 | return 0; | ||
118 | |||
119 | #ifndef CONFIG_IWMMXT | ||
120 | pr_info("PJ4 iWMMXt coprocessor detected, but kernel support is missing.\n"); | ||
121 | #else | ||
87 | cp_access = pj4_cp_access_read() & ~0xf; | 122 | cp_access = pj4_cp_access_read() & ~0xf; |
88 | pj4_cp_access_write(cp_access); | 123 | pj4_cp_access_write(cp_access); |
89 | 124 | ||
90 | printk(KERN_INFO "PJ4 iWMMXt coprocessor enabled.\n"); | 125 | pr_info("PJ4 iWMMXt v%d coprocessor enabled.\n", vers); |
91 | elf_hwcap |= HWCAP_IWMMXT; | 126 | elf_hwcap |= HWCAP_IWMMXT; |
92 | thread_register_notifier(&iwmmxt_notifier_block); | 127 | thread_register_notifier(&iwmmxt_notifier_block); |
128 | #endif | ||
93 | 129 | ||
94 | return 0; | 130 | return 0; |
95 | } | 131 | } |
diff --git a/arch/arm/kernel/sys_oabi-compat.c b/arch/arm/kernel/sys_oabi-compat.c index 702bd329d9d0..e90a3148f385 100644 --- a/arch/arm/kernel/sys_oabi-compat.c +++ b/arch/arm/kernel/sys_oabi-compat.c | |||
@@ -203,9 +203,9 @@ asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd, | |||
203 | int ret; | 203 | int ret; |
204 | 204 | ||
205 | switch (cmd) { | 205 | switch (cmd) { |
206 | case F_GETLKP: | 206 | case F_OFD_GETLK: |
207 | case F_SETLKP: | 207 | case F_OFD_SETLK: |
208 | case F_SETLKPW: | 208 | case F_OFD_SETLKW: |
209 | case F_GETLK64: | 209 | case F_GETLK64: |
210 | case F_SETLK64: | 210 | case F_SETLK64: |
211 | case F_SETLKW64: | 211 | case F_SETLKW64: |
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c index 3c217694ebec..cb791ac6a003 100644 --- a/arch/arm/kernel/unwind.c +++ b/arch/arm/kernel/unwind.c | |||
@@ -285,7 +285,7 @@ static int unwind_exec_pop_r4_to_rN(struct unwind_ctrl_block *ctrl, | |||
285 | if (unwind_pop_register(ctrl, &vsp, reg)) | 285 | if (unwind_pop_register(ctrl, &vsp, reg)) |
286 | return -URC_FAILURE; | 286 | return -URC_FAILURE; |
287 | 287 | ||
288 | if (insn & 0x80) | 288 | if (insn & 0x8) |
289 | if (unwind_pop_register(ctrl, &vsp, 14)) | 289 | if (unwind_pop_register(ctrl, &vsp, 14)) |
290 | return -URC_FAILURE; | 290 | return -URC_FAILURE; |
291 | 291 | ||
diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index 466bd299b1a8..4be5bb150bdd 100644 --- a/arch/arm/kvm/Kconfig +++ b/arch/arm/kvm/Kconfig | |||
@@ -23,7 +23,7 @@ config KVM | |||
23 | select HAVE_KVM_CPU_RELAX_INTERCEPT | 23 | select HAVE_KVM_CPU_RELAX_INTERCEPT |
24 | select KVM_MMIO | 24 | select KVM_MMIO |
25 | select KVM_ARM_HOST | 25 | select KVM_ARM_HOST |
26 | depends on ARM_VIRT_EXT && ARM_LPAE | 26 | depends on ARM_VIRT_EXT && ARM_LPAE && !CPU_BIG_ENDIAN |
27 | ---help--- | 27 | ---help--- |
28 | Support hosting virtualized guest machines. You will also | 28 | Support hosting virtualized guest machines. You will also |
29 | need to select one or more of the processor modules below. | 29 | need to select one or more of the processor modules below. |
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 80bb1e6c2c29..16f804938b8f 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c | |||
@@ -42,6 +42,8 @@ static unsigned long hyp_idmap_start; | |||
42 | static unsigned long hyp_idmap_end; | 42 | static unsigned long hyp_idmap_end; |
43 | static phys_addr_t hyp_idmap_vector; | 43 | static phys_addr_t hyp_idmap_vector; |
44 | 44 | ||
45 | #define pgd_order get_order(PTRS_PER_PGD * sizeof(pgd_t)) | ||
46 | |||
45 | #define kvm_pmd_huge(_x) (pmd_huge(_x) || pmd_trans_huge(_x)) | 47 | #define kvm_pmd_huge(_x) (pmd_huge(_x) || pmd_trans_huge(_x)) |
46 | 48 | ||
47 | static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) | 49 | static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) |
@@ -293,14 +295,14 @@ void free_boot_hyp_pgd(void) | |||
293 | if (boot_hyp_pgd) { | 295 | if (boot_hyp_pgd) { |
294 | unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); | 296 | unmap_range(NULL, boot_hyp_pgd, hyp_idmap_start, PAGE_SIZE); |
295 | unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); | 297 | unmap_range(NULL, boot_hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); |
296 | kfree(boot_hyp_pgd); | 298 | free_pages((unsigned long)boot_hyp_pgd, pgd_order); |
297 | boot_hyp_pgd = NULL; | 299 | boot_hyp_pgd = NULL; |
298 | } | 300 | } |
299 | 301 | ||
300 | if (hyp_pgd) | 302 | if (hyp_pgd) |
301 | unmap_range(NULL, hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); | 303 | unmap_range(NULL, hyp_pgd, TRAMPOLINE_VA, PAGE_SIZE); |
302 | 304 | ||
303 | kfree(init_bounce_page); | 305 | free_page((unsigned long)init_bounce_page); |
304 | init_bounce_page = NULL; | 306 | init_bounce_page = NULL; |
305 | 307 | ||
306 | mutex_unlock(&kvm_hyp_pgd_mutex); | 308 | mutex_unlock(&kvm_hyp_pgd_mutex); |
@@ -330,7 +332,7 @@ void free_hyp_pgds(void) | |||
330 | for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE) | 332 | for (addr = VMALLOC_START; is_vmalloc_addr((void*)addr); addr += PGDIR_SIZE) |
331 | unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); | 333 | unmap_range(NULL, hyp_pgd, KERN_TO_HYP(addr), PGDIR_SIZE); |
332 | 334 | ||
333 | kfree(hyp_pgd); | 335 | free_pages((unsigned long)hyp_pgd, pgd_order); |
334 | hyp_pgd = NULL; | 336 | hyp_pgd = NULL; |
335 | } | 337 | } |
336 | 338 | ||
@@ -1024,7 +1026,7 @@ int kvm_mmu_init(void) | |||
1024 | size_t len = __hyp_idmap_text_end - __hyp_idmap_text_start; | 1026 | size_t len = __hyp_idmap_text_end - __hyp_idmap_text_start; |
1025 | phys_addr_t phys_base; | 1027 | phys_addr_t phys_base; |
1026 | 1028 | ||
1027 | init_bounce_page = kmalloc(PAGE_SIZE, GFP_KERNEL); | 1029 | init_bounce_page = (void *)__get_free_page(GFP_KERNEL); |
1028 | if (!init_bounce_page) { | 1030 | if (!init_bounce_page) { |
1029 | kvm_err("Couldn't allocate HYP init bounce page\n"); | 1031 | kvm_err("Couldn't allocate HYP init bounce page\n"); |
1030 | err = -ENOMEM; | 1032 | err = -ENOMEM; |
@@ -1050,8 +1052,9 @@ int kvm_mmu_init(void) | |||
1050 | (unsigned long)phys_base); | 1052 | (unsigned long)phys_base); |
1051 | } | 1053 | } |
1052 | 1054 | ||
1053 | hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL); | 1055 | hyp_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, pgd_order); |
1054 | boot_hyp_pgd = kzalloc(PTRS_PER_PGD * sizeof(pgd_t), GFP_KERNEL); | 1056 | boot_hyp_pgd = (pgd_t *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, pgd_order); |
1057 | |||
1055 | if (!hyp_pgd || !boot_hyp_pgd) { | 1058 | if (!hyp_pgd || !boot_hyp_pgd) { |
1056 | kvm_err("Hyp mode PGD not allocated\n"); | 1059 | kvm_err("Hyp mode PGD not allocated\n"); |
1057 | err = -ENOMEM; | 1060 | err = -ENOMEM; |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 8b1b0a870025..7cd6f19945ed 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -1296,7 +1296,7 @@ static struct resource adc_resources[] = { | |||
1296 | }; | 1296 | }; |
1297 | 1297 | ||
1298 | static struct platform_device at91_adc_device = { | 1298 | static struct platform_device at91_adc_device = { |
1299 | .name = "at91_adc", | 1299 | .name = "at91sam9260-adc", |
1300 | .id = -1, | 1300 | .id = -1, |
1301 | .dev = { | 1301 | .dev = { |
1302 | .platform_data = &adc_data, | 1302 | .platform_data = &adc_data, |
@@ -1308,19 +1308,19 @@ static struct platform_device at91_adc_device = { | |||
1308 | static struct at91_adc_trigger at91_adc_triggers[] = { | 1308 | static struct at91_adc_trigger at91_adc_triggers[] = { |
1309 | [0] = { | 1309 | [0] = { |
1310 | .name = "timer-counter-0", | 1310 | .name = "timer-counter-0", |
1311 | .value = AT91_ADC_TRGSEL_TC0 | AT91_ADC_TRGEN, | 1311 | .value = 0x1, |
1312 | }, | 1312 | }, |
1313 | [1] = { | 1313 | [1] = { |
1314 | .name = "timer-counter-1", | 1314 | .name = "timer-counter-1", |
1315 | .value = AT91_ADC_TRGSEL_TC1 | AT91_ADC_TRGEN, | 1315 | .value = 0x3, |
1316 | }, | 1316 | }, |
1317 | [2] = { | 1317 | [2] = { |
1318 | .name = "timer-counter-2", | 1318 | .name = "timer-counter-2", |
1319 | .value = AT91_ADC_TRGSEL_TC2 | AT91_ADC_TRGEN, | 1319 | .value = 0x5, |
1320 | }, | 1320 | }, |
1321 | [3] = { | 1321 | [3] = { |
1322 | .name = "external", | 1322 | .name = "external", |
1323 | .value = AT91_ADC_TRGSEL_EXTERNAL | AT91_ADC_TRGEN, | 1323 | .value = 0xd, |
1324 | .is_external = true, | 1324 | .is_external = true, |
1325 | }, | 1325 | }, |
1326 | }; | 1326 | }; |
diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c index 77b04c2edd78..dab362c06487 100644 --- a/arch/arm/mach-at91/at91sam9g45_devices.c +++ b/arch/arm/mach-at91/at91sam9g45_devices.c | |||
@@ -1204,7 +1204,7 @@ static struct resource adc_resources[] = { | |||
1204 | }; | 1204 | }; |
1205 | 1205 | ||
1206 | static struct platform_device at91_adc_device = { | 1206 | static struct platform_device at91_adc_device = { |
1207 | .name = "at91_adc", | 1207 | .name = "at91sam9g45-adc", |
1208 | .id = -1, | 1208 | .id = -1, |
1209 | .dev = { | 1209 | .dev = { |
1210 | .platform_data = &adc_data, | 1210 | .platform_data = &adc_data, |
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c index 932129ef26c6..aa01c4222b40 100644 --- a/arch/arm/mach-exynos/firmware.c +++ b/arch/arm/mach-exynos/firmware.c | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #include <mach/map.h> | 19 | #include <mach/map.h> |
20 | 20 | ||
21 | #include <plat/cpu.h> | ||
22 | |||
21 | #include "smc.h" | 23 | #include "smc.h" |
22 | 24 | ||
23 | static int exynos_do_idle(void) | 25 | static int exynos_do_idle(void) |
@@ -28,13 +30,24 @@ static int exynos_do_idle(void) | |||
28 | 30 | ||
29 | static int exynos_cpu_boot(int cpu) | 31 | static int exynos_cpu_boot(int cpu) |
30 | { | 32 | { |
33 | /* | ||
34 | * The second parameter of SMC_CMD_CPU1BOOT command means CPU id. | ||
35 | * But, Exynos4212 has only one secondary CPU so second parameter | ||
36 | * isn't used for informing secure firmware about CPU id. | ||
37 | */ | ||
38 | if (soc_is_exynos4212()) | ||
39 | cpu = 0; | ||
40 | |||
31 | exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); | 41 | exynos_smc(SMC_CMD_CPU1BOOT, cpu, 0, 0); |
32 | return 0; | 42 | return 0; |
33 | } | 43 | } |
34 | 44 | ||
35 | static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr) | 45 | static int exynos_set_cpu_boot_addr(int cpu, unsigned long boot_addr) |
36 | { | 46 | { |
37 | void __iomem *boot_reg = S5P_VA_SYSRAM_NS + 0x1c + 4*cpu; | 47 | void __iomem *boot_reg = S5P_VA_SYSRAM_NS + 0x1c; |
48 | |||
49 | if (!soc_is_exynos4212()) | ||
50 | boot_reg += 4*cpu; | ||
38 | 51 | ||
39 | __raw_writel(boot_addr, boot_reg); | 52 | __raw_writel(boot_addr, boot_reg); |
40 | return 0; | 53 | return 0; |
diff --git a/arch/arm/mach-imx/clk-imx6q.c b/arch/arm/mach-imx/clk-imx6q.c index b0e7f9d2c245..2b4d6acfa34a 100644 --- a/arch/arm/mach-imx/clk-imx6q.c +++ b/arch/arm/mach-imx/clk-imx6q.c | |||
@@ -208,8 +208,8 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
208 | * the "output_enable" bit as a gate, even though it's really just | 208 | * the "output_enable" bit as a gate, even though it's really just |
209 | * enabling clock output. | 209 | * enabling clock output. |
210 | */ | 210 | */ |
211 | clk[lvds1_gate] = imx_clk_gate("lvds1_gate", "dummy", base + 0x160, 10); | 211 | clk[lvds1_gate] = imx_clk_gate("lvds1_gate", "lvds1_sel", base + 0x160, 10); |
212 | clk[lvds2_gate] = imx_clk_gate("lvds2_gate", "dummy", base + 0x160, 11); | 212 | clk[lvds2_gate] = imx_clk_gate("lvds2_gate", "lvds2_sel", base + 0x160, 11); |
213 | 213 | ||
214 | /* name parent_name reg idx */ | 214 | /* name parent_name reg idx */ |
215 | clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0); | 215 | clk[pll2_pfd0_352m] = imx_clk_pfd("pll2_pfd0_352m", "pll2_bus", base + 0x100, 0); |
@@ -258,14 +258,14 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
258 | clk[ipu2_sel] = imx_clk_mux("ipu2_sel", base + 0x3c, 14, 2, ipu_sels, ARRAY_SIZE(ipu_sels)); | 258 | clk[ipu2_sel] = imx_clk_mux("ipu2_sel", base + 0x3c, 14, 2, ipu_sels, ARRAY_SIZE(ipu_sels)); |
259 | clk[ldb_di0_sel] = imx_clk_mux_flags("ldb_di0_sel", base + 0x2c, 9, 3, ldb_di_sels, ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT); | 259 | clk[ldb_di0_sel] = imx_clk_mux_flags("ldb_di0_sel", base + 0x2c, 9, 3, ldb_di_sels, ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT); |
260 | clk[ldb_di1_sel] = imx_clk_mux_flags("ldb_di1_sel", base + 0x2c, 12, 3, ldb_di_sels, ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT); | 260 | clk[ldb_di1_sel] = imx_clk_mux_flags("ldb_di1_sel", base + 0x2c, 12, 3, ldb_di_sels, ARRAY_SIZE(ldb_di_sels), CLK_SET_RATE_PARENT); |
261 | clk[ipu1_di0_pre_sel] = imx_clk_mux("ipu1_di0_pre_sel", base + 0x34, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); | 261 | clk[ipu1_di0_pre_sel] = imx_clk_mux_flags("ipu1_di0_pre_sel", base + 0x34, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); |
262 | clk[ipu1_di1_pre_sel] = imx_clk_mux("ipu1_di1_pre_sel", base + 0x34, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); | 262 | clk[ipu1_di1_pre_sel] = imx_clk_mux_flags("ipu1_di1_pre_sel", base + 0x34, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); |
263 | clk[ipu2_di0_pre_sel] = imx_clk_mux("ipu2_di0_pre_sel", base + 0x38, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); | 263 | clk[ipu2_di0_pre_sel] = imx_clk_mux_flags("ipu2_di0_pre_sel", base + 0x38, 6, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); |
264 | clk[ipu2_di1_pre_sel] = imx_clk_mux("ipu2_di1_pre_sel", base + 0x38, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels)); | 264 | clk[ipu2_di1_pre_sel] = imx_clk_mux_flags("ipu2_di1_pre_sel", base + 0x38, 15, 3, ipu_di_pre_sels, ARRAY_SIZE(ipu_di_pre_sels), CLK_SET_RATE_PARENT); |
265 | clk[ipu1_di0_sel] = imx_clk_mux("ipu1_di0_sel", base + 0x34, 0, 3, ipu1_di0_sels, ARRAY_SIZE(ipu1_di0_sels)); | 265 | clk[ipu1_di0_sel] = imx_clk_mux_flags("ipu1_di0_sel", base + 0x34, 0, 3, ipu1_di0_sels, ARRAY_SIZE(ipu1_di0_sels), CLK_SET_RATE_PARENT); |
266 | clk[ipu1_di1_sel] = imx_clk_mux("ipu1_di1_sel", base + 0x34, 9, 3, ipu1_di1_sels, ARRAY_SIZE(ipu1_di1_sels)); | 266 | clk[ipu1_di1_sel] = imx_clk_mux_flags("ipu1_di1_sel", base + 0x34, 9, 3, ipu1_di1_sels, ARRAY_SIZE(ipu1_di1_sels), CLK_SET_RATE_PARENT); |
267 | clk[ipu2_di0_sel] = imx_clk_mux("ipu2_di0_sel", base + 0x38, 0, 3, ipu2_di0_sels, ARRAY_SIZE(ipu2_di0_sels)); | 267 | clk[ipu2_di0_sel] = imx_clk_mux_flags("ipu2_di0_sel", base + 0x38, 0, 3, ipu2_di0_sels, ARRAY_SIZE(ipu2_di0_sels), CLK_SET_RATE_PARENT); |
268 | clk[ipu2_di1_sel] = imx_clk_mux("ipu2_di1_sel", base + 0x38, 9, 3, ipu2_di1_sels, ARRAY_SIZE(ipu2_di1_sels)); | 268 | clk[ipu2_di1_sel] = imx_clk_mux_flags("ipu2_di1_sel", base + 0x38, 9, 3, ipu2_di1_sels, ARRAY_SIZE(ipu2_di1_sels), CLK_SET_RATE_PARENT); |
269 | clk[hsi_tx_sel] = imx_clk_mux("hsi_tx_sel", base + 0x30, 28, 1, hsi_tx_sels, ARRAY_SIZE(hsi_tx_sels)); | 269 | clk[hsi_tx_sel] = imx_clk_mux("hsi_tx_sel", base + 0x30, 28, 1, hsi_tx_sels, ARRAY_SIZE(hsi_tx_sels)); |
270 | clk[pcie_axi_sel] = imx_clk_mux("pcie_axi_sel", base + 0x18, 10, 1, pcie_axi_sels, ARRAY_SIZE(pcie_axi_sels)); | 270 | clk[pcie_axi_sel] = imx_clk_mux("pcie_axi_sel", base + 0x18, 10, 1, pcie_axi_sels, ARRAY_SIZE(pcie_axi_sels)); |
271 | clk[ssi1_sel] = imx_clk_fixup_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup); | 271 | clk[ssi1_sel] = imx_clk_fixup_mux("ssi1_sel", base + 0x1c, 10, 2, ssi_sels, ARRAY_SIZE(ssi_sels), imx_cscmr1_fixup); |
@@ -445,6 +445,15 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) | |||
445 | clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); | 445 | clk_set_parent(clk[ldb_di1_sel], clk[pll5_video_div]); |
446 | } | 446 | } |
447 | 447 | ||
448 | clk_set_parent(clk[ipu1_di0_pre_sel], clk[pll5_video_div]); | ||
449 | clk_set_parent(clk[ipu1_di1_pre_sel], clk[pll5_video_div]); | ||
450 | clk_set_parent(clk[ipu2_di0_pre_sel], clk[pll5_video_div]); | ||
451 | clk_set_parent(clk[ipu2_di1_pre_sel], clk[pll5_video_div]); | ||
452 | clk_set_parent(clk[ipu1_di0_sel], clk[ipu1_di0_pre]); | ||
453 | clk_set_parent(clk[ipu1_di1_sel], clk[ipu1_di1_pre]); | ||
454 | clk_set_parent(clk[ipu2_di0_sel], clk[ipu2_di0_pre]); | ||
455 | clk_set_parent(clk[ipu2_di1_sel], clk[ipu2_di1_pre]); | ||
456 | |||
448 | /* | 457 | /* |
449 | * The gpmi needs 100MHz frequency in the EDO/Sync mode, | 458 | * The gpmi needs 100MHz frequency in the EDO/Sync mode, |
450 | * We can not get the 100MHz from the pll2_pfd0_352m. | 459 | * We can not get the 100MHz from the pll2_pfd0_352m. |
diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c index fc4dd7cedc11..6bd7c3f37ac0 100644 --- a/arch/arm/mach-imx/devices/platform-ipu-core.c +++ b/arch/arm/mach-imx/devices/platform-ipu-core.c | |||
@@ -77,7 +77,7 @@ struct platform_device *__init imx_alloc_mx3_camera( | |||
77 | 77 | ||
78 | pdev = platform_device_alloc("mx3-camera", 0); | 78 | pdev = platform_device_alloc("mx3-camera", 0); |
79 | if (!pdev) | 79 | if (!pdev) |
80 | goto err; | 80 | return ERR_PTR(-ENOMEM); |
81 | 81 | ||
82 | pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); | 82 | pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL); |
83 | if (!pdev->dev.dma_mask) | 83 | if (!pdev->dev.dma_mask) |
diff --git a/arch/arm/mach-mvebu/mvebu-soc-id.c b/arch/arm/mach-mvebu/mvebu-soc-id.c index f3d4cf53f746..09520e19b78e 100644 --- a/arch/arm/mach-mvebu/mvebu-soc-id.c +++ b/arch/arm/mach-mvebu/mvebu-soc-id.c | |||
@@ -108,7 +108,18 @@ static int __init mvebu_soc_id_init(void) | |||
108 | iounmap(pci_base); | 108 | iounmap(pci_base); |
109 | 109 | ||
110 | res_ioremap: | 110 | res_ioremap: |
111 | clk_disable_unprepare(clk); | 111 | /* |
112 | * If the PCIe unit is actually enabled and we have PCI | ||
113 | * support in the kernel, we intentionally do not release the | ||
114 | * reference to the clock. We want to keep it running since | ||
115 | * the bootloader does some PCIe link configuration that the | ||
116 | * kernel is for now unable to do, and gating the clock would | ||
117 | * make us loose this precious configuration. | ||
118 | */ | ||
119 | if (!of_device_is_available(child) || !IS_ENABLED(CONFIG_PCI_MVEBU)) { | ||
120 | clk_disable_unprepare(clk); | ||
121 | clk_put(clk); | ||
122 | } | ||
112 | 123 | ||
113 | clk_err: | 124 | clk_err: |
114 | of_node_put(child); | 125 | of_node_put(child); |
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index ac82512b9c8c..b6885e42c0a0 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c | |||
@@ -142,7 +142,7 @@ __init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, | |||
142 | board_nand_data.nr_parts = nr_parts; | 142 | board_nand_data.nr_parts = nr_parts; |
143 | board_nand_data.devsize = nand_type; | 143 | board_nand_data.devsize = nand_type; |
144 | 144 | ||
145 | board_nand_data.ecc_opt = OMAP_ECC_BCH8_CODE_HW; | 145 | board_nand_data.ecc_opt = OMAP_ECC_HAM1_CODE_HW; |
146 | gpmc_nand_init(&board_nand_data, gpmc_t); | 146 | gpmc_nand_init(&board_nand_data, gpmc_t); |
147 | } | 147 | } |
148 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ | 148 | #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ |
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c index 43a90c8d6837..9cfebc5c7455 100644 --- a/arch/arm/mach-omap2/board-rx51-video.c +++ b/arch/arm/mach-omap2/board-rx51-video.c | |||
@@ -48,7 +48,7 @@ static struct omap_dss_board_info rx51_dss_board_info = { | |||
48 | 48 | ||
49 | static int __init rx51_video_init(void) | 49 | static int __init rx51_video_init(void) |
50 | { | 50 | { |
51 | if (!machine_is_nokia_rx51() && !of_machine_is_compatible("nokia,omap3-n900")) | 51 | if (!machine_is_nokia_rx51()) |
52 | return 0; | 52 | return 0; |
53 | 53 | ||
54 | if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) { | 54 | if (omap_mux_init_gpio(RX51_LCD_RESET_GPIO, OMAP_PIN_OUTPUT)) { |
diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index 8f5121b89688..eb8c75ec3b1a 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c | |||
@@ -456,7 +456,8 @@ static struct clk_hw_omap dpll4_m5x2_ck_hw = { | |||
456 | .clkdm_name = "dpll4_clkdm", | 456 | .clkdm_name = "dpll4_clkdm", |
457 | }; | 457 | }; |
458 | 458 | ||
459 | DEFINE_STRUCT_CLK(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, dpll4_m5x2_ck_ops); | 459 | DEFINE_STRUCT_CLK_FLAGS(dpll4_m5x2_ck, dpll4_m5x2_ck_parent_names, |
460 | dpll4_m5x2_ck_ops, CLK_SET_RATE_PARENT); | ||
460 | 461 | ||
461 | static struct clk dpll4_m5x2_ck_3630 = { | 462 | static struct clk dpll4_m5x2_ck_3630 = { |
462 | .name = "dpll4_m5x2_ck", | 463 | .name = "dpll4_m5x2_ck", |
diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 2649ce445845..332af927f4d3 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c | |||
@@ -209,7 +209,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw) | |||
209 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | 209 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || |
210 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | 210 | v == OMAP3XXX_EN_DPLL_FRBYPASS) |
211 | return 1; | 211 | return 1; |
212 | } else if (soc_is_am33xx() || cpu_is_omap44xx()) { | 212 | } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx()) { |
213 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | 213 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || |
214 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | 214 | v == OMAP4XXX_EN_DPLL_FRBYPASS || |
215 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | 215 | v == OMAP4XXX_EN_DPLL_MNBYPASS) |
@@ -255,7 +255,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk) | |||
255 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || | 255 | if (v == OMAP3XXX_EN_DPLL_LPBYPASS || |
256 | v == OMAP3XXX_EN_DPLL_FRBYPASS) | 256 | v == OMAP3XXX_EN_DPLL_FRBYPASS) |
257 | return __clk_get_rate(dd->clk_bypass); | 257 | return __clk_get_rate(dd->clk_bypass); |
258 | } else if (soc_is_am33xx() || cpu_is_omap44xx()) { | 258 | } else if (soc_is_am33xx() || cpu_is_omap44xx() || soc_is_am43xx()) { |
259 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || | 259 | if (v == OMAP4XXX_EN_DPLL_LPBYPASS || |
260 | v == OMAP4XXX_EN_DPLL_FRBYPASS || | 260 | v == OMAP4XXX_EN_DPLL_FRBYPASS || |
261 | v == OMAP4XXX_EN_DPLL_MNBYPASS) | 261 | v == OMAP4XXX_EN_DPLL_MNBYPASS) |
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c index 01fc710c8181..2498ab025fa2 100644 --- a/arch/arm/mach-omap2/cpuidle44xx.c +++ b/arch/arm/mach-omap2/cpuidle44xx.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/cpuidle.h> | 14 | #include <linux/cpuidle.h> |
15 | #include <linux/cpu_pm.h> | 15 | #include <linux/cpu_pm.h> |
16 | #include <linux/export.h> | 16 | #include <linux/export.h> |
17 | #include <linux/clockchips.h> | ||
17 | 18 | ||
18 | #include <asm/cpuidle.h> | 19 | #include <asm/cpuidle.h> |
19 | #include <asm/proc-fns.h> | 20 | #include <asm/proc-fns.h> |
@@ -83,6 +84,7 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, | |||
83 | { | 84 | { |
84 | struct idle_statedata *cx = state_ptr + index; | 85 | struct idle_statedata *cx = state_ptr + index; |
85 | u32 mpuss_can_lose_context = 0; | 86 | u32 mpuss_can_lose_context = 0; |
87 | int cpu_id = smp_processor_id(); | ||
86 | 88 | ||
87 | /* | 89 | /* |
88 | * CPU0 has to wait and stay ON until CPU1 is OFF state. | 90 | * CPU0 has to wait and stay ON until CPU1 is OFF state. |
@@ -110,6 +112,8 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, | |||
110 | mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) && | 112 | mpuss_can_lose_context = (cx->mpu_state == PWRDM_POWER_RET) && |
111 | (cx->mpu_logic_state == PWRDM_POWER_OFF); | 113 | (cx->mpu_logic_state == PWRDM_POWER_OFF); |
112 | 114 | ||
115 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id); | ||
116 | |||
113 | /* | 117 | /* |
114 | * Call idle CPU PM enter notifier chain so that | 118 | * Call idle CPU PM enter notifier chain so that |
115 | * VFP and per CPU interrupt context is saved. | 119 | * VFP and per CPU interrupt context is saved. |
@@ -165,6 +169,8 @@ static int omap_enter_idle_coupled(struct cpuidle_device *dev, | |||
165 | if (dev->cpu == 0 && mpuss_can_lose_context) | 169 | if (dev->cpu == 0 && mpuss_can_lose_context) |
166 | cpu_cluster_pm_exit(); | 170 | cpu_cluster_pm_exit(); |
167 | 171 | ||
172 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id); | ||
173 | |||
168 | fail: | 174 | fail: |
169 | cpuidle_coupled_parallel_barrier(dev, &abort_barrier); | 175 | cpuidle_coupled_parallel_barrier(dev, &abort_barrier); |
170 | cpu_done[dev->cpu] = false; | 176 | cpu_done[dev->cpu] = false; |
@@ -172,6 +178,16 @@ fail: | |||
172 | return index; | 178 | return index; |
173 | } | 179 | } |
174 | 180 | ||
181 | /* | ||
182 | * For each cpu, setup the broadcast timer because local timers | ||
183 | * stops for the states above C1. | ||
184 | */ | ||
185 | static void omap_setup_broadcast_timer(void *arg) | ||
186 | { | ||
187 | int cpu = smp_processor_id(); | ||
188 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ON, &cpu); | ||
189 | } | ||
190 | |||
175 | static struct cpuidle_driver omap4_idle_driver = { | 191 | static struct cpuidle_driver omap4_idle_driver = { |
176 | .name = "omap4_idle", | 192 | .name = "omap4_idle", |
177 | .owner = THIS_MODULE, | 193 | .owner = THIS_MODULE, |
@@ -189,8 +205,7 @@ static struct cpuidle_driver omap4_idle_driver = { | |||
189 | /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ | 205 | /* C2 - CPU0 OFF + CPU1 OFF + MPU CSWR */ |
190 | .exit_latency = 328 + 440, | 206 | .exit_latency = 328 + 440, |
191 | .target_residency = 960, | 207 | .target_residency = 960, |
192 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED | | 208 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, |
193 | CPUIDLE_FLAG_TIMER_STOP, | ||
194 | .enter = omap_enter_idle_coupled, | 209 | .enter = omap_enter_idle_coupled, |
195 | .name = "C2", | 210 | .name = "C2", |
196 | .desc = "CPUx OFF, MPUSS CSWR", | 211 | .desc = "CPUx OFF, MPUSS CSWR", |
@@ -199,8 +214,7 @@ static struct cpuidle_driver omap4_idle_driver = { | |||
199 | /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ | 214 | /* C3 - CPU0 OFF + CPU1 OFF + MPU OSWR */ |
200 | .exit_latency = 460 + 518, | 215 | .exit_latency = 460 + 518, |
201 | .target_residency = 1100, | 216 | .target_residency = 1100, |
202 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED | | 217 | .flags = CPUIDLE_FLAG_TIME_VALID | CPUIDLE_FLAG_COUPLED, |
203 | CPUIDLE_FLAG_TIMER_STOP, | ||
204 | .enter = omap_enter_idle_coupled, | 218 | .enter = omap_enter_idle_coupled, |
205 | .name = "C3", | 219 | .name = "C3", |
206 | .desc = "CPUx OFF, MPUSS OSWR", | 220 | .desc = "CPUx OFF, MPUSS OSWR", |
@@ -231,5 +245,8 @@ int __init omap4_idle_init(void) | |||
231 | if (!cpu_clkdm[0] || !cpu_clkdm[1]) | 245 | if (!cpu_clkdm[0] || !cpu_clkdm[1]) |
232 | return -ENODEV; | 246 | return -ENODEV; |
233 | 247 | ||
248 | /* Configure the broadcast timer on each cpu */ | ||
249 | on_each_cpu(omap_setup_broadcast_timer, NULL, 1); | ||
250 | |||
234 | return cpuidle_register(&omap4_idle_driver, cpu_online_mask); | 251 | return cpuidle_register(&omap4_idle_driver, cpu_online_mask); |
235 | } | 252 | } |
diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c index ab43755364f5..9fe8c949305c 100644 --- a/arch/arm/mach-omap2/gpmc.c +++ b/arch/arm/mach-omap2/gpmc.c | |||
@@ -501,7 +501,7 @@ static int gpmc_cs_delete_mem(int cs) | |||
501 | int r; | 501 | int r; |
502 | 502 | ||
503 | spin_lock(&gpmc_mem_lock); | 503 | spin_lock(&gpmc_mem_lock); |
504 | r = release_resource(&gpmc_cs_mem[cs]); | 504 | r = release_resource(res); |
505 | res->start = 0; | 505 | res->start = 0; |
506 | res->end = 0; | 506 | res->end = 0; |
507 | spin_unlock(&gpmc_mem_lock); | 507 | spin_unlock(&gpmc_mem_lock); |
@@ -527,6 +527,14 @@ static int gpmc_cs_remap(int cs, u32 base) | |||
527 | pr_err("%s: requested chip-select is disabled\n", __func__); | 527 | pr_err("%s: requested chip-select is disabled\n", __func__); |
528 | return -ENODEV; | 528 | return -ENODEV; |
529 | } | 529 | } |
530 | |||
531 | /* | ||
532 | * Make sure we ignore any device offsets from the GPMC partition | ||
533 | * allocated for the chip select and that the new base confirms | ||
534 | * to the GPMC 16MB minimum granularity. | ||
535 | */ | ||
536 | base &= ~(SZ_16M - 1); | ||
537 | |||
530 | gpmc_cs_get_memconf(cs, &old_base, &size); | 538 | gpmc_cs_get_memconf(cs, &old_base, &size); |
531 | if (base == old_base) | 539 | if (base == old_base) |
532 | return 0; | 540 | return 0; |
@@ -586,6 +594,8 @@ EXPORT_SYMBOL(gpmc_cs_request); | |||
586 | 594 | ||
587 | void gpmc_cs_free(int cs) | 595 | void gpmc_cs_free(int cs) |
588 | { | 596 | { |
597 | struct resource *res = &gpmc_cs_mem[cs]; | ||
598 | |||
589 | spin_lock(&gpmc_mem_lock); | 599 | spin_lock(&gpmc_mem_lock); |
590 | if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { | 600 | if (cs >= gpmc_cs_num || cs < 0 || !gpmc_cs_reserved(cs)) { |
591 | printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); | 601 | printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs); |
@@ -594,7 +604,8 @@ void gpmc_cs_free(int cs) | |||
594 | return; | 604 | return; |
595 | } | 605 | } |
596 | gpmc_cs_disable_mem(cs); | 606 | gpmc_cs_disable_mem(cs); |
597 | release_resource(&gpmc_cs_mem[cs]); | 607 | if (res->flags) |
608 | release_resource(res); | ||
598 | gpmc_cs_set_reserved(cs, 0); | 609 | gpmc_cs_set_reserved(cs, 0); |
599 | spin_unlock(&gpmc_mem_lock); | 610 | spin_unlock(&gpmc_mem_lock); |
600 | } | 611 | } |
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S index 75e92952c18e..40c5d5f1451c 100644 --- a/arch/arm/mach-omap2/omap-headsmp.S +++ b/arch/arm/mach-omap2/omap-headsmp.S | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Secondary CPU startup routine source file. | 2 | * Secondary CPU startup routine source file. |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Texas Instruments, Inc. | 4 | * Copyright (C) 2009-2014 Texas Instruments, Inc. |
5 | * | 5 | * |
6 | * Author: | 6 | * Author: |
7 | * Santosh Shilimkar <santosh.shilimkar@ti.com> | 7 | * Santosh Shilimkar <santosh.shilimkar@ti.com> |
@@ -28,9 +28,13 @@ | |||
28 | * code. This routine also provides a holding flag into which | 28 | * code. This routine also provides a holding flag into which |
29 | * secondary core is held until we're ready for it to initialise. | 29 | * secondary core is held until we're ready for it to initialise. |
30 | * The primary core will update this flag using a hardware | 30 | * The primary core will update this flag using a hardware |
31 | + * register AuxCoreBoot0. | 31 | * register AuxCoreBoot0. |
32 | */ | 32 | */ |
33 | ENTRY(omap5_secondary_startup) | 33 | ENTRY(omap5_secondary_startup) |
34 | .arm | ||
35 | THUMB( adr r9, BSYM(wait) ) @ CPU may be entered in ARM mode. | ||
36 | THUMB( bx r9 ) @ If this is a Thumb-2 kernel, | ||
37 | THUMB( .thumb ) @ switch to Thumb now. | ||
34 | wait: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0 | 38 | wait: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0 |
35 | ldr r0, [r2] | 39 | ldr r0, [r2] |
36 | mov r0, r0, lsr #5 | 40 | mov r0, r0, lsr #5 |
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 1f33f5db10d5..66c60fe1104c 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c | |||
@@ -2546,11 +2546,12 @@ static int __init _init(struct omap_hwmod *oh, void *data) | |||
2546 | return -EINVAL; | 2546 | return -EINVAL; |
2547 | } | 2547 | } |
2548 | 2548 | ||
2549 | if (np) | 2549 | if (np) { |
2550 | if (of_find_property(np, "ti,no-reset-on-init", NULL)) | 2550 | if (of_find_property(np, "ti,no-reset-on-init", NULL)) |
2551 | oh->flags |= HWMOD_INIT_NO_RESET; | 2551 | oh->flags |= HWMOD_INIT_NO_RESET; |
2552 | if (of_find_property(np, "ti,no-idle-on-init", NULL)) | 2552 | if (of_find_property(np, "ti,no-idle-on-init", NULL)) |
2553 | oh->flags |= HWMOD_INIT_NO_IDLE; | 2553 | oh->flags |= HWMOD_INIT_NO_IDLE; |
2554 | } | ||
2554 | 2555 | ||
2555 | oh->_state = _HWMOD_STATE_INITIALIZED; | 2556 | oh->_state = _HWMOD_STATE_INITIALIZED; |
2556 | 2557 | ||
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index a123ff0070bd..71ac7d5f3385 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | |||
@@ -1964,7 +1964,7 @@ static struct omap_hwmod_irq_info omap3xxx_usb_host_hs_irqs[] = { | |||
1964 | static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { | 1964 | static struct omap_hwmod omap3xxx_usb_host_hs_hwmod = { |
1965 | .name = "usb_host_hs", | 1965 | .name = "usb_host_hs", |
1966 | .class = &omap3xxx_usb_host_hs_hwmod_class, | 1966 | .class = &omap3xxx_usb_host_hs_hwmod_class, |
1967 | .clkdm_name = "l3_init_clkdm", | 1967 | .clkdm_name = "usbhost_clkdm", |
1968 | .mpu_irqs = omap3xxx_usb_host_hs_irqs, | 1968 | .mpu_irqs = omap3xxx_usb_host_hs_irqs, |
1969 | .main_clk = "usbhost_48m_fck", | 1969 | .main_clk = "usbhost_48m_fck", |
1970 | .prcm = { | 1970 | .prcm = { |
@@ -2047,7 +2047,7 @@ static struct omap_hwmod_irq_info omap3xxx_usb_tll_hs_irqs[] = { | |||
2047 | static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { | 2047 | static struct omap_hwmod omap3xxx_usb_tll_hs_hwmod = { |
2048 | .name = "usb_tll_hs", | 2048 | .name = "usb_tll_hs", |
2049 | .class = &omap3xxx_usb_tll_hs_hwmod_class, | 2049 | .class = &omap3xxx_usb_tll_hs_hwmod_class, |
2050 | .clkdm_name = "l3_init_clkdm", | 2050 | .clkdm_name = "core_l4_clkdm", |
2051 | .mpu_irqs = omap3xxx_usb_tll_hs_irqs, | 2051 | .mpu_irqs = omap3xxx_usb_tll_hs_irqs, |
2052 | .main_clk = "usbtll_fck", | 2052 | .main_clk = "usbtll_fck", |
2053 | .prcm = { | 2053 | .prcm = { |
diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c index 892317294fdc..e829664e6a6c 100644 --- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c | |||
@@ -895,7 +895,7 @@ static struct omap_hwmod omap54xx_mcpdm_hwmod = { | |||
895 | * current exception. | 895 | * current exception. |
896 | */ | 896 | */ |
897 | 897 | ||
898 | .flags = HWMOD_EXT_OPT_MAIN_CLK, | 898 | .flags = HWMOD_EXT_OPT_MAIN_CLK | HWMOD_SWSUP_SIDLE, |
899 | .main_clk = "pad_clks_ck", | 899 | .main_clk = "pad_clks_ck", |
900 | .prcm = { | 900 | .prcm = { |
901 | .omap4 = { | 901 | .omap4 = { |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 1f3770a8a728..87099bb6de69 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -330,10 +330,6 @@ void omap_sram_idle(void) | |||
330 | omap3_sram_restore_context(); | 330 | omap3_sram_restore_context(); |
331 | omap2_sms_restore_context(); | 331 | omap2_sms_restore_context(); |
332 | } | 332 | } |
333 | if (core_next_state == PWRDM_POWER_OFF) | ||
334 | omap2_prm_clear_mod_reg_bits(OMAP3430_AUTO_OFF_MASK, | ||
335 | OMAP3430_GR_MOD, | ||
336 | OMAP3_PRM_VOLTCTRL_OFFSET); | ||
337 | } | 333 | } |
338 | omap3_intc_resume_idle(); | 334 | omap3_intc_resume_idle(); |
339 | 335 | ||
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h index f565f9944af2..7548db2bfb8a 100644 --- a/arch/arm/mach-orion5x/common.h +++ b/arch/arm/mach-orion5x/common.h | |||
@@ -21,7 +21,7 @@ struct mv_sata_platform_data; | |||
21 | #define ORION_MBUS_DEVBUS_BOOT_ATTR 0x0f | 21 | #define ORION_MBUS_DEVBUS_BOOT_ATTR 0x0f |
22 | #define ORION_MBUS_DEVBUS_TARGET(cs) 0x01 | 22 | #define ORION_MBUS_DEVBUS_TARGET(cs) 0x01 |
23 | #define ORION_MBUS_DEVBUS_ATTR(cs) (~(1 << cs)) | 23 | #define ORION_MBUS_DEVBUS_ATTR(cs) (~(1 << cs)) |
24 | #define ORION_MBUS_SRAM_TARGET 0x00 | 24 | #define ORION_MBUS_SRAM_TARGET 0x09 |
25 | #define ORION_MBUS_SRAM_ATTR 0x00 | 25 | #define ORION_MBUS_SRAM_ATTR 0x00 |
26 | 26 | ||
27 | /* | 27 | /* |
diff --git a/arch/arm/mach-pxa/include/mach/hx4700.h b/arch/arm/mach-pxa/include/mach/hx4700.h index 8bc02913517c..0e1bb46264f9 100644 --- a/arch/arm/mach-pxa/include/mach/hx4700.h +++ b/arch/arm/mach-pxa/include/mach/hx4700.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/mfd/asic3.h> | 16 | #include <linux/mfd/asic3.h> |
17 | #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */ | ||
17 | 18 | ||
18 | #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO | 19 | #define HX4700_ASIC3_GPIO_BASE PXA_NR_BUILTIN_GPIO |
19 | #define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS) | 20 | #define HX4700_EGPIO_BASE (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS) |
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c index dbfa5a26cfff..072842f6491b 100644 --- a/arch/arm/mach-rockchip/platsmp.c +++ b/arch/arm/mach-rockchip/platsmp.c | |||
@@ -152,7 +152,7 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus) | |||
152 | 152 | ||
153 | node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-pmu"); | 153 | node = of_find_compatible_node(NULL, NULL, "rockchip,rk3066-pmu"); |
154 | if (!node) { | 154 | if (!node) { |
155 | pr_err("%s: could not find sram dt node\n", __func__); | 155 | pr_err("%s: could not find pmu dt node\n", __func__); |
156 | return; | 156 | return; |
157 | } | 157 | } |
158 | 158 | ||
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 2858f380beae..486063db2a2f 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -992,6 +992,7 @@ static struct asoc_simple_card_info fsi_wm8978_info = { | |||
992 | .platform = "sh_fsi2", | 992 | .platform = "sh_fsi2", |
993 | .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM, | 993 | .daifmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBM_CFM, |
994 | .cpu_dai = { | 994 | .cpu_dai = { |
995 | .fmt = SND_SOC_DAIFMT_IB_NF, | ||
995 | .name = "fsia-dai", | 996 | .name = "fsia-dai", |
996 | }, | 997 | }, |
997 | .codec_dai = { | 998 | .codec_dai = { |
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index f0104bfe544e..18c7e0311aa6 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -588,14 +588,12 @@ static struct asoc_simple_card_info rsnd_card_info = { | |||
588 | .card = "SSI01-AK4643", | 588 | .card = "SSI01-AK4643", |
589 | .codec = "ak4642-codec.2-0012", | 589 | .codec = "ak4642-codec.2-0012", |
590 | .platform = "rcar_sound", | 590 | .platform = "rcar_sound", |
591 | .daifmt = SND_SOC_DAIFMT_LEFT_J, | 591 | .daifmt = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_CBM_CFM, |
592 | .cpu_dai = { | 592 | .cpu_dai = { |
593 | .name = "rcar_sound", | 593 | .name = "rcar_sound", |
594 | .fmt = SND_SOC_DAIFMT_CBS_CFS, | ||
595 | }, | 594 | }, |
596 | .codec_dai = { | 595 | .codec_dai = { |
597 | .name = "ak4642-hifi", | 596 | .name = "ak4642-hifi", |
598 | .fmt = SND_SOC_DAIFMT_CBM_CFM, | ||
599 | .sysclk = 11289600, | 597 | .sysclk = 11289600, |
600 | }, | 598 | }, |
601 | }; | 599 | }; |
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index 2009a9bc6356..9989b1b06ffd 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c | |||
@@ -170,7 +170,7 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
170 | [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */ | 170 | [MSTP010] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 10, 0), /* SSI2 */ |
171 | [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */ | 171 | [MSTP009] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 9, 0), /* SSI3 */ |
172 | [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */ | 172 | [MSTP008] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 8, 0), /* SRU */ |
173 | [MSTP007] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 7, 0), /* HSPI */ | 173 | [MSTP007] = SH_CLK_MSTP32(&s_clk, MSTPCR0, 7, 0), /* HSPI */ |
174 | }; | 174 | }; |
175 | 175 | ||
176 | static struct clk_lookup lookups[] = { | 176 | static struct clk_lookup lookups[] = { |
diff --git a/arch/arm/mach-spear/headsmp.S b/arch/arm/mach-spear/headsmp.S index ed85473a047f..c52192dc3d9f 100644 --- a/arch/arm/mach-spear/headsmp.S +++ b/arch/arm/mach-spear/headsmp.S | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Picked from realview | 4 | * Picked from realview |
5 | * Copyright (c) 2012 ST Microelectronics Limited | 5 | * Copyright (c) 2012 ST Microelectronics Limited |
6 | * Shiraz Hashim <shiraz.hashim@st.com> | 6 | * Shiraz Hashim <shiraz.linux.kernel@gmail.com> |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/arch/arm/mach-spear/platsmp.c b/arch/arm/mach-spear/platsmp.c index 5c4a19887b2b..c19751fff2c6 100644 --- a/arch/arm/mach-spear/platsmp.c +++ b/arch/arm/mach-spear/platsmp.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * based upon linux/arch/arm/mach-realview/platsmp.c | 4 | * based upon linux/arch/arm/mach-realview/platsmp.c |
5 | * | 5 | * |
6 | * Copyright (C) 2012 ST Microelectronics Ltd. | 6 | * Copyright (C) 2012 ST Microelectronics Ltd. |
7 | * Shiraz Hashim <shiraz.hashim@st.com> | 7 | * Shiraz Hashim <shiraz.linux.kernel@gmail.com> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
diff --git a/arch/arm/mach-spear/time.c b/arch/arm/mach-spear/time.c index 218ba5b67d92..26fda4ed4d51 100644 --- a/arch/arm/mach-spear/time.c +++ b/arch/arm/mach-spear/time.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/arm/plat-spear/time.c | 2 | * arch/arm/plat-spear/time.c |
3 | * | 3 | * |
4 | * Copyright (C) 2010 ST Microelectronics | 4 | * Copyright (C) 2010 ST Microelectronics |
5 | * Shiraz Hashim<shiraz.hashim@st.com> | 5 | * Shiraz Hashim<shiraz.linux.kernel@gmail.com> |
6 | * | 6 | * |
7 | * This file is licensed under the terms of the GNU General Public | 7 | * This file is licensed under the terms of the GNU General Public |
8 | * License version 2. This program is licensed "as is" without any | 8 | * License version 2. This program is licensed "as is" without any |
@@ -71,7 +71,7 @@ static void clockevent_set_mode(enum clock_event_mode mode, | |||
71 | static int clockevent_next_event(unsigned long evt, | 71 | static int clockevent_next_event(unsigned long evt, |
72 | struct clock_event_device *clk_event_dev); | 72 | struct clock_event_device *clk_event_dev); |
73 | 73 | ||
74 | static void spear_clocksource_init(void) | 74 | static void __init spear_clocksource_init(void) |
75 | { | 75 | { |
76 | u32 tick_rate; | 76 | u32 tick_rate; |
77 | u16 val; | 77 | u16 val; |
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 92d660f9610f..55b305d51669 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig | |||
@@ -70,7 +70,4 @@ config TEGRA_AHB | |||
70 | which controls AHB bus master arbitration and some | 70 | which controls AHB bus master arbitration and some |
71 | performance parameters(priority, prefech size). | 71 | performance parameters(priority, prefech size). |
72 | 72 | ||
73 | config TEGRA_EMC_SCALING_ENABLE | ||
74 | bool "Enable scaling the memory frequency" | ||
75 | |||
76 | endmenu | 73 | endmenu |
diff --git a/arch/arm/mach-vexpress/dcscb.c b/arch/arm/mach-vexpress/dcscb.c index 788495d35cf9..30b993399ed7 100644 --- a/arch/arm/mach-vexpress/dcscb.c +++ b/arch/arm/mach-vexpress/dcscb.c | |||
@@ -51,12 +51,14 @@ static int dcscb_allcpus_mask[2]; | |||
51 | static int dcscb_power_up(unsigned int cpu, unsigned int cluster) | 51 | static int dcscb_power_up(unsigned int cpu, unsigned int cluster) |
52 | { | 52 | { |
53 | unsigned int rst_hold, cpumask = (1 << cpu); | 53 | unsigned int rst_hold, cpumask = (1 << cpu); |
54 | unsigned int all_mask = dcscb_allcpus_mask[cluster]; | 54 | unsigned int all_mask; |
55 | 55 | ||
56 | pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); | 56 | pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); |
57 | if (cpu >= 4 || cluster >= 2) | 57 | if (cpu >= 4 || cluster >= 2) |
58 | return -EINVAL; | 58 | return -EINVAL; |
59 | 59 | ||
60 | all_mask = dcscb_allcpus_mask[cluster]; | ||
61 | |||
60 | /* | 62 | /* |
61 | * Since this is called with IRQs enabled, and no arch_spin_lock_irq | 63 | * Since this is called with IRQs enabled, and no arch_spin_lock_irq |
62 | * variant exists, we need to disable IRQs manually here. | 64 | * variant exists, we need to disable IRQs manually here. |
@@ -101,11 +103,12 @@ static void dcscb_power_down(void) | |||
101 | cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); | 103 | cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); |
102 | cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); | 104 | cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); |
103 | cpumask = (1 << cpu); | 105 | cpumask = (1 << cpu); |
104 | all_mask = dcscb_allcpus_mask[cluster]; | ||
105 | 106 | ||
106 | pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); | 107 | pr_debug("%s: cpu %u cluster %u\n", __func__, cpu, cluster); |
107 | BUG_ON(cpu >= 4 || cluster >= 2); | 108 | BUG_ON(cpu >= 4 || cluster >= 2); |
108 | 109 | ||
110 | all_mask = dcscb_allcpus_mask[cluster]; | ||
111 | |||
109 | __mcpm_cpu_going_down(cpu, cluster); | 112 | __mcpm_cpu_going_down(cpu, cluster); |
110 | 113 | ||
111 | arch_spin_lock(&dcscb_lock); | 114 | arch_spin_lock(&dcscb_lock); |
diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c index c26ef5b92ca7..2c2754e79cb3 100644 --- a/arch/arm/mach-vexpress/spc.c +++ b/arch/arm/mach-vexpress/spc.c | |||
@@ -392,7 +392,7 @@ static irqreturn_t ve_spc_irq_handler(int irq, void *data) | |||
392 | * +--------------------------+ | 392 | * +--------------------------+ |
393 | * | 31 20 | 19 0 | | 393 | * | 31 20 | 19 0 | |
394 | * +--------------------------+ | 394 | * +--------------------------+ |
395 | * | u_volt | freq(kHz) | | 395 | * | m_volt | freq(kHz) | |
396 | * +--------------------------+ | 396 | * +--------------------------+ |
397 | */ | 397 | */ |
398 | #define MULT_FACTOR 20 | 398 | #define MULT_FACTOR 20 |
@@ -414,7 +414,7 @@ static int ve_spc_populate_opps(uint32_t cluster) | |||
414 | ret = ve_spc_read_sys_cfg(SYSCFG_SCC, off, &data); | 414 | ret = ve_spc_read_sys_cfg(SYSCFG_SCC, off, &data); |
415 | if (!ret) { | 415 | if (!ret) { |
416 | opps->freq = (data & FREQ_MASK) * MULT_FACTOR; | 416 | opps->freq = (data & FREQ_MASK) * MULT_FACTOR; |
417 | opps->u_volt = data >> VOLT_SHIFT; | 417 | opps->u_volt = (data >> VOLT_SHIFT) * 1000; |
418 | } else { | 418 | } else { |
419 | break; | 419 | break; |
420 | } | 420 | } |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index f5ad9ee70426..5bf7c3c3b301 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -420,29 +420,29 @@ config CPU_32v3 | |||
420 | bool | 420 | bool |
421 | select CPU_USE_DOMAINS if MMU | 421 | select CPU_USE_DOMAINS if MMU |
422 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 422 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
423 | select TLS_REG_EMUL if SMP || !MMU | ||
424 | select NEED_KUSER_HELPERS | 423 | select NEED_KUSER_HELPERS |
424 | select TLS_REG_EMUL if SMP || !MMU | ||
425 | 425 | ||
426 | config CPU_32v4 | 426 | config CPU_32v4 |
427 | bool | 427 | bool |
428 | select CPU_USE_DOMAINS if MMU | 428 | select CPU_USE_DOMAINS if MMU |
429 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 429 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
430 | select TLS_REG_EMUL if SMP || !MMU | ||
431 | select NEED_KUSER_HELPERS | 430 | select NEED_KUSER_HELPERS |
431 | select TLS_REG_EMUL if SMP || !MMU | ||
432 | 432 | ||
433 | config CPU_32v4T | 433 | config CPU_32v4T |
434 | bool | 434 | bool |
435 | select CPU_USE_DOMAINS if MMU | 435 | select CPU_USE_DOMAINS if MMU |
436 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 436 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
437 | select TLS_REG_EMUL if SMP || !MMU | ||
438 | select NEED_KUSER_HELPERS | 437 | select NEED_KUSER_HELPERS |
438 | select TLS_REG_EMUL if SMP || !MMU | ||
439 | 439 | ||
440 | config CPU_32v5 | 440 | config CPU_32v5 |
441 | bool | 441 | bool |
442 | select CPU_USE_DOMAINS if MMU | 442 | select CPU_USE_DOMAINS if MMU |
443 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 443 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
444 | select TLS_REG_EMUL if SMP || !MMU | ||
445 | select NEED_KUSER_HELPERS | 444 | select NEED_KUSER_HELPERS |
445 | select TLS_REG_EMUL if SMP || !MMU | ||
446 | 446 | ||
447 | config CPU_32v6 | 447 | config CPU_32v6 |
448 | bool | 448 | bool |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index f62aa0677e5c..6b00be1f971e 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -1963,8 +1963,8 @@ arm_iommu_create_mapping(struct bus_type *bus, dma_addr_t base, size_t size) | |||
1963 | mapping->nr_bitmaps = 1; | 1963 | mapping->nr_bitmaps = 1; |
1964 | mapping->extensions = extensions; | 1964 | mapping->extensions = extensions; |
1965 | mapping->base = base; | 1965 | mapping->base = base; |
1966 | mapping->size = bitmap_size << PAGE_SHIFT; | ||
1967 | mapping->bits = BITS_PER_BYTE * bitmap_size; | 1966 | mapping->bits = BITS_PER_BYTE * bitmap_size; |
1967 | mapping->size = mapping->bits << PAGE_SHIFT; | ||
1968 | 1968 | ||
1969 | spin_lock_init(&mapping->lock); | 1969 | spin_lock_init(&mapping->lock); |
1970 | 1970 | ||
diff --git a/arch/arm/mm/proc-v7m.S b/arch/arm/mm/proc-v7m.S index 0c93588fcb91..1ca37c72f12f 100644 --- a/arch/arm/mm/proc-v7m.S +++ b/arch/arm/mm/proc-v7m.S | |||
@@ -123,6 +123,11 @@ __v7m_setup: | |||
123 | mov pc, lr | 123 | mov pc, lr |
124 | ENDPROC(__v7m_setup) | 124 | ENDPROC(__v7m_setup) |
125 | 125 | ||
126 | .align 2 | ||
127 | __v7m_setup_stack: | ||
128 | .space 4 * 8 @ 8 registers | ||
129 | __v7m_setup_stack_top: | ||
130 | |||
126 | define_processor_functions v7m, dabort=nommu_early_abort, pabort=legacy_pabort, nommu=1 | 131 | define_processor_functions v7m, dabort=nommu_early_abort, pabort=legacy_pabort, nommu=1 |
127 | 132 | ||
128 | .section ".rodata" | 133 | .section ".rodata" |
@@ -152,6 +157,3 @@ __v7m_proc_info: | |||
152 | .long nop_cache_fns @ proc_info_list.cache | 157 | .long nop_cache_fns @ proc_info_list.cache |
153 | .size __v7m_proc_info, . - __v7m_proc_info | 158 | .size __v7m_proc_info, . - __v7m_proc_info |
154 | 159 | ||
155 | __v7m_setup_stack: | ||
156 | .space 4 * 8 @ 8 registers | ||
157 | __v7m_setup_stack_top: | ||
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 5f5b975887fc..b5608b1f9fbd 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -70,6 +70,7 @@ static u32 errata; | |||
70 | 70 | ||
71 | static struct omap_dma_global_context_registers { | 71 | static struct omap_dma_global_context_registers { |
72 | u32 dma_irqenable_l0; | 72 | u32 dma_irqenable_l0; |
73 | u32 dma_irqenable_l1; | ||
73 | u32 dma_ocp_sysconfig; | 74 | u32 dma_ocp_sysconfig; |
74 | u32 dma_gcr; | 75 | u32 dma_gcr; |
75 | } omap_dma_global_context; | 76 | } omap_dma_global_context; |
@@ -1973,10 +1974,17 @@ static struct irqaction omap24xx_dma_irq; | |||
1973 | 1974 | ||
1974 | /*----------------------------------------------------------------------------*/ | 1975 | /*----------------------------------------------------------------------------*/ |
1975 | 1976 | ||
1977 | /* | ||
1978 | * Note that we are currently using only IRQENABLE_L0 and L1. | ||
1979 | * As the DSP may be using IRQENABLE_L2 and L3, let's not | ||
1980 | * touch those for now. | ||
1981 | */ | ||
1976 | void omap_dma_global_context_save(void) | 1982 | void omap_dma_global_context_save(void) |
1977 | { | 1983 | { |
1978 | omap_dma_global_context.dma_irqenable_l0 = | 1984 | omap_dma_global_context.dma_irqenable_l0 = |
1979 | p->dma_read(IRQENABLE_L0, 0); | 1985 | p->dma_read(IRQENABLE_L0, 0); |
1986 | omap_dma_global_context.dma_irqenable_l1 = | ||
1987 | p->dma_read(IRQENABLE_L1, 0); | ||
1980 | omap_dma_global_context.dma_ocp_sysconfig = | 1988 | omap_dma_global_context.dma_ocp_sysconfig = |
1981 | p->dma_read(OCP_SYSCONFIG, 0); | 1989 | p->dma_read(OCP_SYSCONFIG, 0); |
1982 | omap_dma_global_context.dma_gcr = p->dma_read(GCR, 0); | 1990 | omap_dma_global_context.dma_gcr = p->dma_read(GCR, 0); |
@@ -1991,6 +1999,8 @@ void omap_dma_global_context_restore(void) | |||
1991 | OCP_SYSCONFIG, 0); | 1999 | OCP_SYSCONFIG, 0); |
1992 | p->dma_write(omap_dma_global_context.dma_irqenable_l0, | 2000 | p->dma_write(omap_dma_global_context.dma_irqenable_l0, |
1993 | IRQENABLE_L0, 0); | 2001 | IRQENABLE_L0, 0); |
2002 | p->dma_write(omap_dma_global_context.dma_irqenable_l1, | ||
2003 | IRQENABLE_L1, 0); | ||
1994 | 2004 | ||
1995 | if (IS_DMA_ERRATA(DMA_ROMCODE_BUG)) | 2005 | if (IS_DMA_ERRATA(DMA_ROMCODE_BUG)) |
1996 | p->dma_write(0x3 , IRQSTATUS_L0, 0); | 2006 | p->dma_write(0x3 , IRQSTATUS_L0, 0); |
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c index 6cac43bd1d86..423f56dd4028 100644 --- a/arch/arm/vfp/vfpdouble.c +++ b/arch/arm/vfp/vfpdouble.c | |||
@@ -866,6 +866,8 @@ vfp_double_multiply_accumulate(int dd, int dn, int dm, u32 fpscr, u32 negate, ch | |||
866 | vdp.sign = vfp_sign_negate(vdp.sign); | 866 | vdp.sign = vfp_sign_negate(vdp.sign); |
867 | 867 | ||
868 | vfp_double_unpack(&vdn, vfp_get_double(dd)); | 868 | vfp_double_unpack(&vdn, vfp_get_double(dd)); |
869 | if (vdn.exponent == 0 && vdn.significand) | ||
870 | vfp_double_normalise_denormal(&vdn); | ||
869 | if (negate & NEG_SUBTRACT) | 871 | if (negate & NEG_SUBTRACT) |
870 | vdn.sign = vfp_sign_negate(vdn.sign); | 872 | vdn.sign = vfp_sign_negate(vdn.sign); |
871 | 873 | ||
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c index b252631b406b..4f96c1617aae 100644 --- a/arch/arm/vfp/vfpsingle.c +++ b/arch/arm/vfp/vfpsingle.c | |||
@@ -915,6 +915,8 @@ vfp_single_multiply_accumulate(int sd, int sn, s32 m, u32 fpscr, u32 negate, cha | |||
915 | v = vfp_get_float(sd); | 915 | v = vfp_get_float(sd); |
916 | pr_debug("VFP: s%u = %08x\n", sd, v); | 916 | pr_debug("VFP: s%u = %08x\n", sd, v); |
917 | vfp_single_unpack(&vsn, v); | 917 | vfp_single_unpack(&vsn, v); |
918 | if (vsn.exponent == 0 && vsn.significand) | ||
919 | vfp_single_normalise_denormal(&vsn); | ||
918 | if (negate & NEG_SUBTRACT) | 920 | if (negate & NEG_SUBTRACT) |
919 | vsn.sign = vfp_sign_negate(vsn.sign); | 921 | vsn.sign = vfp_sign_negate(vsn.sign); |
920 | 922 | ||
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index e6e4d3749a6e..e759af5d7098 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -323,8 +323,6 @@ menu "CPU Power Management" | |||
323 | 323 | ||
324 | source "drivers/cpuidle/Kconfig" | 324 | source "drivers/cpuidle/Kconfig" |
325 | 325 | ||
326 | source "kernel/power/Kconfig" | ||
327 | |||
328 | source "drivers/cpufreq/Kconfig" | 326 | source "drivers/cpufreq/Kconfig" |
329 | 327 | ||
330 | endmenu | 328 | endmenu |
diff --git a/arch/arm64/boot/dts/apm-storm.dtsi b/arch/arm64/boot/dts/apm-storm.dtsi index 93f4b2dd9248..f8c40a66e65d 100644 --- a/arch/arm64/boot/dts/apm-storm.dtsi +++ b/arch/arm64/boot/dts/apm-storm.dtsi | |||
@@ -307,6 +307,7 @@ | |||
307 | <0x0 0x1f21e000 0x0 0x1000>, | 307 | <0x0 0x1f21e000 0x0 0x1000>, |
308 | <0x0 0x1f217000 0x0 0x1000>; | 308 | <0x0 0x1f217000 0x0 0x1000>; |
309 | interrupts = <0x0 0x86 0x4>; | 309 | interrupts = <0x0 0x86 0x4>; |
310 | dma-coherent; | ||
310 | status = "disabled"; | 311 | status = "disabled"; |
311 | clocks = <&sata01clk 0>; | 312 | clocks = <&sata01clk 0>; |
312 | phys = <&phy1 0>; | 313 | phys = <&phy1 0>; |
@@ -321,6 +322,7 @@ | |||
321 | <0x0 0x1f22e000 0x0 0x1000>, | 322 | <0x0 0x1f22e000 0x0 0x1000>, |
322 | <0x0 0x1f227000 0x0 0x1000>; | 323 | <0x0 0x1f227000 0x0 0x1000>; |
323 | interrupts = <0x0 0x87 0x4>; | 324 | interrupts = <0x0 0x87 0x4>; |
325 | dma-coherent; | ||
324 | status = "ok"; | 326 | status = "ok"; |
325 | clocks = <&sata23clk 0>; | 327 | clocks = <&sata23clk 0>; |
326 | phys = <&phy2 0>; | 328 | phys = <&phy2 0>; |
@@ -334,6 +336,7 @@ | |||
334 | <0x0 0x1f23d000 0x0 0x1000>, | 336 | <0x0 0x1f23d000 0x0 0x1000>, |
335 | <0x0 0x1f23e000 0x0 0x1000>; | 337 | <0x0 0x1f23e000 0x0 0x1000>; |
336 | interrupts = <0x0 0x88 0x4>; | 338 | interrupts = <0x0 0x88 0x4>; |
339 | dma-coherent; | ||
337 | status = "ok"; | 340 | status = "ok"; |
338 | clocks = <&sata45clk 0>; | 341 | clocks = <&sata45clk 0>; |
339 | phys = <&phy3 0>; | 342 | phys = <&phy3 0>; |
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index e94f9458aa6f..993bce527b85 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
@@ -138,6 +138,7 @@ static inline void *phys_to_virt(phys_addr_t x) | |||
138 | #define __pa(x) __virt_to_phys((unsigned long)(x)) | 138 | #define __pa(x) __virt_to_phys((unsigned long)(x)) |
139 | #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) | 139 | #define __va(x) ((void *)__phys_to_virt((phys_addr_t)(x))) |
140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) | 140 | #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) |
141 | #define virt_to_pfn(x) __phys_to_pfn(__virt_to_phys(x)) | ||
141 | 142 | ||
142 | /* | 143 | /* |
143 | * virt_to_page(k) convert a _valid_ virtual address to struct page * | 144 | * virt_to_page(k) convert a _valid_ virtual address to struct page * |
diff --git a/arch/arm64/include/asm/mmu.h b/arch/arm64/include/asm/mmu.h index f600d400c07d..aff0292c8f4d 100644 --- a/arch/arm64/include/asm/mmu.h +++ b/arch/arm64/include/asm/mmu.h | |||
@@ -22,6 +22,9 @@ typedef struct { | |||
22 | void *vdso; | 22 | void *vdso; |
23 | } mm_context_t; | 23 | } mm_context_t; |
24 | 24 | ||
25 | #define INIT_MM_CONTEXT(name) \ | ||
26 | .context.id_lock = __RAW_SPIN_LOCK_UNLOCKED(name.context.id_lock), | ||
27 | |||
25 | #define ASID(mm) ((mm)->context.id & 0xffff) | 28 | #define ASID(mm) ((mm)->context.id & 0xffff) |
26 | 29 | ||
27 | extern void paging_init(void); | 30 | extern void paging_init(void); |
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 90c811f05a2e..7b1c67a0b485 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -266,7 +266,7 @@ static inline pmd_t pte_pmd(pte_t pte) | |||
266 | 266 | ||
267 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) | 267 | #define pmd_page(pmd) pfn_to_page(__phys_to_pfn(pmd_val(pmd) & PHYS_MASK)) |
268 | 268 | ||
269 | #define set_pmd_at(mm, addr, pmdp, pmd) set_pmd(pmdp, pmd) | 269 | #define set_pmd_at(mm, addr, pmdp, pmd) set_pte_at(mm, addr, (pte_t *)pmdp, pmd_pte(pmd)) |
270 | 270 | ||
271 | static inline int has_transparent_hugepage(void) | 271 | static inline int has_transparent_hugepage(void) |
272 | { | 272 | { |
diff --git a/arch/arm64/include/asm/tlb.h b/arch/arm64/include/asm/tlb.h index 72cadf52ca80..80e2c08900d6 100644 --- a/arch/arm64/include/asm/tlb.h +++ b/arch/arm64/include/asm/tlb.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #ifndef __ASM_TLB_H | 19 | #ifndef __ASM_TLB_H |
20 | #define __ASM_TLB_H | 20 | #define __ASM_TLB_H |
21 | 21 | ||
22 | #define __tlb_remove_pmd_tlb_entry __tlb_remove_pmd_tlb_entry | ||
22 | 23 | ||
23 | #include <asm-generic/tlb.h> | 24 | #include <asm-generic/tlb.h> |
24 | 25 | ||
@@ -99,5 +100,10 @@ static inline void __pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmdp, | |||
99 | } | 100 | } |
100 | #endif | 101 | #endif |
101 | 102 | ||
103 | static inline void __tlb_remove_pmd_tlb_entry(struct mmu_gather *tlb, pmd_t *pmdp, | ||
104 | unsigned long address) | ||
105 | { | ||
106 | tlb_add_flush(tlb, address); | ||
107 | } | ||
102 | 108 | ||
103 | #endif | 109 | #endif |
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index bb8eb8a78e67..c8d8fc17bd5a 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h | |||
@@ -403,8 +403,9 @@ __SYSCALL(378, sys_kcmp) | |||
403 | __SYSCALL(379, sys_finit_module) | 403 | __SYSCALL(379, sys_finit_module) |
404 | __SYSCALL(380, sys_sched_setattr) | 404 | __SYSCALL(380, sys_sched_setattr) |
405 | __SYSCALL(381, sys_sched_getattr) | 405 | __SYSCALL(381, sys_sched_getattr) |
406 | __SYSCALL(382, sys_renameat2) | ||
406 | 407 | ||
407 | #define __NR_compat_syscalls 379 | 408 | #define __NR_compat_syscalls 383 |
408 | 409 | ||
409 | /* | 410 | /* |
410 | * Compat syscall numbers used by the AArch64 kernel. | 411 | * Compat syscall numbers used by the AArch64 kernel. |
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index ed3955a95747..a7fb874b595e 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c | |||
@@ -318,9 +318,6 @@ static int brk_handler(unsigned long addr, unsigned int esr, | |||
318 | if (call_break_hook(regs, esr) == DBG_HOOK_HANDLED) | 318 | if (call_break_hook(regs, esr) == DBG_HOOK_HANDLED) |
319 | return 0; | 319 | return 0; |
320 | 320 | ||
321 | pr_warn("unexpected brk exception at %lx, esr=0x%x\n", | ||
322 | (long)instruction_pointer(regs), esr); | ||
323 | |||
324 | if (!user_mode(regs)) | 321 | if (!user_mode(regs)) |
325 | return -EFAULT; | 322 | return -EFAULT; |
326 | 323 | ||
diff --git a/arch/arm64/kernel/early_printk.c b/arch/arm64/kernel/early_printk.c index ffbbdde7aba1..2dc36d00addf 100644 --- a/arch/arm64/kernel/early_printk.c +++ b/arch/arm64/kernel/early_printk.c | |||
@@ -143,10 +143,8 @@ static int __init setup_early_printk(char *buf) | |||
143 | } | 143 | } |
144 | /* no options parsing yet */ | 144 | /* no options parsing yet */ |
145 | 145 | ||
146 | if (paddr) { | 146 | if (paddr) |
147 | set_fixmap_io(FIX_EARLYCON_MEM_BASE, paddr); | 147 | early_base = (void __iomem *)set_fixmap_offset_io(FIX_EARLYCON_MEM_BASE, paddr); |
148 | early_base = (void __iomem *)fix_to_virt(FIX_EARLYCON_MEM_BASE); | ||
149 | } | ||
150 | 148 | ||
151 | printch = match->printch; | 149 | printch = match->printch; |
152 | early_console = &early_console_dev; | 150 | early_console = &early_console_dev; |
diff --git a/arch/arm64/kernel/irq.c b/arch/arm64/kernel/irq.c index 473e5dbf8f39..0f08dfd69ebc 100644 --- a/arch/arm64/kernel/irq.c +++ b/arch/arm64/kernel/irq.c | |||
@@ -97,11 +97,15 @@ static bool migrate_one_irq(struct irq_desc *desc) | |||
97 | if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity)) | 97 | if (irqd_is_per_cpu(d) || !cpumask_test_cpu(smp_processor_id(), affinity)) |
98 | return false; | 98 | return false; |
99 | 99 | ||
100 | if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) { | 100 | if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) |
101 | affinity = cpu_online_mask; | ||
102 | ret = true; | 101 | ret = true; |
103 | } | ||
104 | 102 | ||
103 | /* | ||
104 | * when using forced irq_set_affinity we must ensure that the cpu | ||
105 | * being offlined is not present in the affinity mask, it may be | ||
106 | * selected as the target CPU otherwise | ||
107 | */ | ||
108 | affinity = cpu_online_mask; | ||
105 | c = irq_data_get_irq_chip(d); | 109 | c = irq_data_get_irq_chip(d); |
106 | if (!c->irq_set_affinity) | 110 | if (!c->irq_set_affinity) |
107 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); | 111 | pr_debug("IRQ%u: unable to set affinity\n", d->irq); |
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 720853f70b6b..7ec784653b29 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -393,11 +393,10 @@ void __init setup_arch(char **cmdline_p) | |||
393 | 393 | ||
394 | static int __init arm64_device_init(void) | 394 | static int __init arm64_device_init(void) |
395 | { | 395 | { |
396 | of_clk_init(NULL); | ||
397 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 396 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
398 | return 0; | 397 | return 0; |
399 | } | 398 | } |
400 | arch_initcall(arm64_device_init); | 399 | arch_initcall_sync(arm64_device_init); |
401 | 400 | ||
402 | static DEFINE_PER_CPU(struct cpu, cpu_data); | 401 | static DEFINE_PER_CPU(struct cpu, cpu_data); |
403 | 402 | ||
diff --git a/arch/arm64/kernel/time.c b/arch/arm64/kernel/time.c index 29c39d5d77e3..6815987b50f8 100644 --- a/arch/arm64/kernel/time.c +++ b/arch/arm64/kernel/time.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/irq.h> | 33 | #include <linux/irq.h> |
34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
35 | #include <linux/clocksource.h> | 35 | #include <linux/clocksource.h> |
36 | #include <linux/clk-provider.h> | ||
36 | 37 | ||
37 | #include <clocksource/arm_arch_timer.h> | 38 | #include <clocksource/arm_arch_timer.h> |
38 | 39 | ||
@@ -65,6 +66,7 @@ void __init time_init(void) | |||
65 | { | 66 | { |
66 | u32 arch_timer_rate; | 67 | u32 arch_timer_rate; |
67 | 68 | ||
69 | of_clk_init(NULL); | ||
68 | clocksource_of_init(); | 70 | clocksource_of_init(); |
69 | 71 | ||
70 | arch_timer_rate = arch_timer_get_rate(); | 72 | arch_timer_rate = arch_timer_get_rate(); |
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 0ba347e59f06..c851eb44dc50 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -22,8 +22,11 @@ | |||
22 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
23 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
24 | #include <linux/dma-contiguous.h> | 24 | #include <linux/dma-contiguous.h> |
25 | #include <linux/of.h> | ||
26 | #include <linux/platform_device.h> | ||
25 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
26 | #include <linux/swiotlb.h> | 28 | #include <linux/swiotlb.h> |
29 | #include <linux/amba/bus.h> | ||
27 | 30 | ||
28 | #include <asm/cacheflush.h> | 31 | #include <asm/cacheflush.h> |
29 | 32 | ||
@@ -305,17 +308,45 @@ struct dma_map_ops coherent_swiotlb_dma_ops = { | |||
305 | }; | 308 | }; |
306 | EXPORT_SYMBOL(coherent_swiotlb_dma_ops); | 309 | EXPORT_SYMBOL(coherent_swiotlb_dma_ops); |
307 | 310 | ||
311 | static int dma_bus_notifier(struct notifier_block *nb, | ||
312 | unsigned long event, void *_dev) | ||
313 | { | ||
314 | struct device *dev = _dev; | ||
315 | |||
316 | if (event != BUS_NOTIFY_ADD_DEVICE) | ||
317 | return NOTIFY_DONE; | ||
318 | |||
319 | if (of_property_read_bool(dev->of_node, "dma-coherent")) | ||
320 | set_dma_ops(dev, &coherent_swiotlb_dma_ops); | ||
321 | |||
322 | return NOTIFY_OK; | ||
323 | } | ||
324 | |||
325 | static struct notifier_block platform_bus_nb = { | ||
326 | .notifier_call = dma_bus_notifier, | ||
327 | }; | ||
328 | |||
329 | static struct notifier_block amba_bus_nb = { | ||
330 | .notifier_call = dma_bus_notifier, | ||
331 | }; | ||
332 | |||
308 | extern int swiotlb_late_init_with_default_size(size_t default_size); | 333 | extern int swiotlb_late_init_with_default_size(size_t default_size); |
309 | 334 | ||
310 | static int __init swiotlb_late_init(void) | 335 | static int __init swiotlb_late_init(void) |
311 | { | 336 | { |
312 | size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); | 337 | size_t swiotlb_size = min(SZ_64M, MAX_ORDER_NR_PAGES << PAGE_SHIFT); |
313 | 338 | ||
314 | dma_ops = &coherent_swiotlb_dma_ops; | 339 | /* |
340 | * These must be registered before of_platform_populate(). | ||
341 | */ | ||
342 | bus_register_notifier(&platform_bus_type, &platform_bus_nb); | ||
343 | bus_register_notifier(&amba_bustype, &amba_bus_nb); | ||
344 | |||
345 | dma_ops = &noncoherent_swiotlb_dma_ops; | ||
315 | 346 | ||
316 | return swiotlb_late_init_with_default_size(swiotlb_size); | 347 | return swiotlb_late_init_with_default_size(swiotlb_size); |
317 | } | 348 | } |
318 | subsys_initcall(swiotlb_late_init); | 349 | arch_initcall(swiotlb_late_init); |
319 | 350 | ||
320 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 | 351 | #define PREALLOC_DMA_DEBUG_ENTRIES 4096 |
321 | 352 | ||
diff --git a/arch/arm64/mm/hugetlbpage.c b/arch/arm64/mm/hugetlbpage.c index 5e9aec358306..31eb959e9aa8 100644 --- a/arch/arm64/mm/hugetlbpage.c +++ b/arch/arm64/mm/hugetlbpage.c | |||
@@ -51,7 +51,11 @@ int pmd_huge(pmd_t pmd) | |||
51 | 51 | ||
52 | int pud_huge(pud_t pud) | 52 | int pud_huge(pud_t pud) |
53 | { | 53 | { |
54 | #ifndef __PAGETABLE_PMD_FOLDED | ||
54 | return !(pud_val(pud) & PUD_TABLE_BIT); | 55 | return !(pud_val(pud) & PUD_TABLE_BIT); |
56 | #else | ||
57 | return 0; | ||
58 | #endif | ||
55 | } | 59 | } |
56 | 60 | ||
57 | int pmd_huge_support(void) | 61 | int pmd_huge_support(void) |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 6b7e89569a3a..0a472c41a67f 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -374,6 +374,9 @@ int kern_addr_valid(unsigned long addr) | |||
374 | if (pmd_none(*pmd)) | 374 | if (pmd_none(*pmd)) |
375 | return 0; | 375 | return 0; |
376 | 376 | ||
377 | if (pmd_sect(*pmd)) | ||
378 | return pfn_valid(pmd_pfn(*pmd)); | ||
379 | |||
377 | pte = pte_offset_kernel(pmd, addr); | 380 | pte = pte_offset_kernel(pmd, addr); |
378 | if (pte_none(*pte)) | 381 | if (pte_none(*pte)) |
379 | return 0; | 382 | return 0; |
diff --git a/arch/blackfin/include/asm/bfin_spi3.h b/arch/blackfin/include/asm/bfin_spi3.h deleted file mode 100644 index 0957e65a54be..000000000000 --- a/arch/blackfin/include/asm/bfin_spi3.h +++ /dev/null | |||
@@ -1,258 +0,0 @@ | |||
1 | /* | ||
2 | * Analog Devices SPI3 controller driver | ||
3 | * | ||
4 | * Copyright (c) 2011 Analog Devices Inc. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | */ | ||
19 | |||
20 | #ifndef _SPI_CHANNEL_H_ | ||
21 | #define _SPI_CHANNEL_H_ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | /* SPI_CONTROL */ | ||
26 | #define SPI_CTL_EN 0x00000001 /* Enable */ | ||
27 | #define SPI_CTL_MSTR 0x00000002 /* Master/Slave */ | ||
28 | #define SPI_CTL_PSSE 0x00000004 /* controls modf error in master mode */ | ||
29 | #define SPI_CTL_ODM 0x00000008 /* Open Drain Mode */ | ||
30 | #define SPI_CTL_CPHA 0x00000010 /* Clock Phase */ | ||
31 | #define SPI_CTL_CPOL 0x00000020 /* Clock Polarity */ | ||
32 | #define SPI_CTL_ASSEL 0x00000040 /* Slave Select Pin Control */ | ||
33 | #define SPI_CTL_SELST 0x00000080 /* Slave Select Polarity in-between transfers */ | ||
34 | #define SPI_CTL_EMISO 0x00000100 /* Enable MISO */ | ||
35 | #define SPI_CTL_SIZE 0x00000600 /* Word Transfer Size */ | ||
36 | #define SPI_CTL_SIZE08 0x00000000 /* SIZE: 8 bits */ | ||
37 | #define SPI_CTL_SIZE16 0x00000200 /* SIZE: 16 bits */ | ||
38 | #define SPI_CTL_SIZE32 0x00000400 /* SIZE: 32 bits */ | ||
39 | #define SPI_CTL_LSBF 0x00001000 /* LSB First */ | ||
40 | #define SPI_CTL_FCEN 0x00002000 /* Flow-Control Enable */ | ||
41 | #define SPI_CTL_FCCH 0x00004000 /* Flow-Control Channel Selection */ | ||
42 | #define SPI_CTL_FCPL 0x00008000 /* Flow-Control Polarity */ | ||
43 | #define SPI_CTL_FCWM 0x00030000 /* Flow-Control Water-Mark */ | ||
44 | #define SPI_CTL_FIFO0 0x00000000 /* FCWM: TFIFO empty or RFIFO Full */ | ||
45 | #define SPI_CTL_FIFO1 0x00010000 /* FCWM: TFIFO 75% or more empty or RFIFO 75% or more full */ | ||
46 | #define SPI_CTL_FIFO2 0x00020000 /* FCWM: TFIFO 50% or more empty or RFIFO 50% or more full */ | ||
47 | #define SPI_CTL_FMODE 0x00040000 /* Fast-mode Enable */ | ||
48 | #define SPI_CTL_MIOM 0x00300000 /* Multiple I/O Mode */ | ||
49 | #define SPI_CTL_MIO_DIS 0x00000000 /* MIOM: Disable */ | ||
50 | #define SPI_CTL_MIO_DUAL 0x00100000 /* MIOM: Enable DIOM (Dual I/O Mode) */ | ||
51 | #define SPI_CTL_MIO_QUAD 0x00200000 /* MIOM: Enable QUAD (Quad SPI Mode) */ | ||
52 | #define SPI_CTL_SOSI 0x00400000 /* Start on MOSI */ | ||
53 | /* SPI_RX_CONTROL */ | ||
54 | #define SPI_RXCTL_REN 0x00000001 /* Receive Channel Enable */ | ||
55 | #define SPI_RXCTL_RTI 0x00000004 /* Receive Transfer Initiate */ | ||
56 | #define SPI_RXCTL_RWCEN 0x00000008 /* Receive Word Counter Enable */ | ||
57 | #define SPI_RXCTL_RDR 0x00000070 /* Receive Data Request */ | ||
58 | #define SPI_RXCTL_RDR_DIS 0x00000000 /* RDR: Disabled */ | ||
59 | #define SPI_RXCTL_RDR_NE 0x00000010 /* RDR: RFIFO not empty */ | ||
60 | #define SPI_RXCTL_RDR_25 0x00000020 /* RDR: RFIFO 25% full */ | ||
61 | #define SPI_RXCTL_RDR_50 0x00000030 /* RDR: RFIFO 50% full */ | ||
62 | #define SPI_RXCTL_RDR_75 0x00000040 /* RDR: RFIFO 75% full */ | ||
63 | #define SPI_RXCTL_RDR_FULL 0x00000050 /* RDR: RFIFO full */ | ||
64 | #define SPI_RXCTL_RDO 0x00000100 /* Receive Data Over-Run */ | ||
65 | #define SPI_RXCTL_RRWM 0x00003000 /* FIFO Regular Water-Mark */ | ||
66 | #define SPI_RXCTL_RWM_0 0x00000000 /* RRWM: RFIFO Empty */ | ||
67 | #define SPI_RXCTL_RWM_25 0x00001000 /* RRWM: RFIFO 25% full */ | ||
68 | #define SPI_RXCTL_RWM_50 0x00002000 /* RRWM: RFIFO 50% full */ | ||
69 | #define SPI_RXCTL_RWM_75 0x00003000 /* RRWM: RFIFO 75% full */ | ||
70 | #define SPI_RXCTL_RUWM 0x00070000 /* FIFO Urgent Water-Mark */ | ||
71 | #define SPI_RXCTL_UWM_DIS 0x00000000 /* RUWM: Disabled */ | ||
72 | #define SPI_RXCTL_UWM_25 0x00010000 /* RUWM: RFIFO 25% full */ | ||
73 | #define SPI_RXCTL_UWM_50 0x00020000 /* RUWM: RFIFO 50% full */ | ||
74 | #define SPI_RXCTL_UWM_75 0x00030000 /* RUWM: RFIFO 75% full */ | ||
75 | #define SPI_RXCTL_UWM_FULL 0x00040000 /* RUWM: RFIFO full */ | ||
76 | /* SPI_TX_CONTROL */ | ||
77 | #define SPI_TXCTL_TEN 0x00000001 /* Transmit Channel Enable */ | ||
78 | #define SPI_TXCTL_TTI 0x00000004 /* Transmit Transfer Initiate */ | ||
79 | #define SPI_TXCTL_TWCEN 0x00000008 /* Transmit Word Counter Enable */ | ||
80 | #define SPI_TXCTL_TDR 0x00000070 /* Transmit Data Request */ | ||
81 | #define SPI_TXCTL_TDR_DIS 0x00000000 /* TDR: Disabled */ | ||
82 | #define SPI_TXCTL_TDR_NF 0x00000010 /* TDR: TFIFO not full */ | ||
83 | #define SPI_TXCTL_TDR_25 0x00000020 /* TDR: TFIFO 25% empty */ | ||
84 | #define SPI_TXCTL_TDR_50 0x00000030 /* TDR: TFIFO 50% empty */ | ||
85 | #define SPI_TXCTL_TDR_75 0x00000040 /* TDR: TFIFO 75% empty */ | ||
86 | #define SPI_TXCTL_TDR_EMPTY 0x00000050 /* TDR: TFIFO empty */ | ||
87 | #define SPI_TXCTL_TDU 0x00000100 /* Transmit Data Under-Run */ | ||
88 | #define SPI_TXCTL_TRWM 0x00003000 /* FIFO Regular Water-Mark */ | ||
89 | #define SPI_TXCTL_RWM_FULL 0x00000000 /* TRWM: TFIFO full */ | ||
90 | #define SPI_TXCTL_RWM_25 0x00001000 /* TRWM: TFIFO 25% empty */ | ||
91 | #define SPI_TXCTL_RWM_50 0x00002000 /* TRWM: TFIFO 50% empty */ | ||
92 | #define SPI_TXCTL_RWM_75 0x00003000 /* TRWM: TFIFO 75% empty */ | ||
93 | #define SPI_TXCTL_TUWM 0x00070000 /* FIFO Urgent Water-Mark */ | ||
94 | #define SPI_TXCTL_UWM_DIS 0x00000000 /* TUWM: Disabled */ | ||
95 | #define SPI_TXCTL_UWM_25 0x00010000 /* TUWM: TFIFO 25% empty */ | ||
96 | #define SPI_TXCTL_UWM_50 0x00020000 /* TUWM: TFIFO 50% empty */ | ||
97 | #define SPI_TXCTL_UWM_75 0x00030000 /* TUWM: TFIFO 75% empty */ | ||
98 | #define SPI_TXCTL_UWM_EMPTY 0x00040000 /* TUWM: TFIFO empty */ | ||
99 | /* SPI_CLOCK */ | ||
100 | #define SPI_CLK_BAUD 0x0000FFFF /* Baud Rate */ | ||
101 | /* SPI_DELAY */ | ||
102 | #define SPI_DLY_STOP 0x000000FF /* Transfer delay time in multiples of SCK period */ | ||
103 | #define SPI_DLY_LEADX 0x00000100 /* Extended (1 SCK) LEAD Control */ | ||
104 | #define SPI_DLY_LAGX 0x00000200 /* Extended (1 SCK) LAG control */ | ||
105 | /* SPI_SSEL */ | ||
106 | #define SPI_SLVSEL_SSE1 0x00000002 /* SPISSEL1 Enable */ | ||
107 | #define SPI_SLVSEL_SSE2 0x00000004 /* SPISSEL2 Enable */ | ||
108 | #define SPI_SLVSEL_SSE3 0x00000008 /* SPISSEL3 Enable */ | ||
109 | #define SPI_SLVSEL_SSE4 0x00000010 /* SPISSEL4 Enable */ | ||
110 | #define SPI_SLVSEL_SSE5 0x00000020 /* SPISSEL5 Enable */ | ||
111 | #define SPI_SLVSEL_SSE6 0x00000040 /* SPISSEL6 Enable */ | ||
112 | #define SPI_SLVSEL_SSE7 0x00000080 /* SPISSEL7 Enable */ | ||
113 | #define SPI_SLVSEL_SSEL1 0x00000200 /* SPISSEL1 Value */ | ||
114 | #define SPI_SLVSEL_SSEL2 0x00000400 /* SPISSEL2 Value */ | ||
115 | #define SPI_SLVSEL_SSEL3 0x00000800 /* SPISSEL3 Value */ | ||
116 | #define SPI_SLVSEL_SSEL4 0x00001000 /* SPISSEL4 Value */ | ||
117 | #define SPI_SLVSEL_SSEL5 0x00002000 /* SPISSEL5 Value */ | ||
118 | #define SPI_SLVSEL_SSEL6 0x00004000 /* SPISSEL6 Value */ | ||
119 | #define SPI_SLVSEL_SSEL7 0x00008000 /* SPISSEL7 Value */ | ||
120 | /* SPI_RWC */ | ||
121 | #define SPI_RWC_VALUE 0x0000FFFF /* Received Word-Count */ | ||
122 | /* SPI_RWCR */ | ||
123 | #define SPI_RWCR_VALUE 0x0000FFFF /* Received Word-Count Reload */ | ||
124 | /* SPI_TWC */ | ||
125 | #define SPI_TWC_VALUE 0x0000FFFF /* Transmitted Word-Count */ | ||
126 | /* SPI_TWCR */ | ||
127 | #define SPI_TWCR_VALUE 0x0000FFFF /* Transmitted Word-Count Reload */ | ||
128 | /* SPI_IMASK */ | ||
129 | #define SPI_IMSK_RUWM 0x00000002 /* Receive Urgent Water-Mark Interrupt Mask */ | ||
130 | #define SPI_IMSK_TUWM 0x00000004 /* Transmit Urgent Water-Mark Interrupt Mask */ | ||
131 | #define SPI_IMSK_ROM 0x00000010 /* Receive Over-Run Error Interrupt Mask */ | ||
132 | #define SPI_IMSK_TUM 0x00000020 /* Transmit Under-Run Error Interrupt Mask */ | ||
133 | #define SPI_IMSK_TCM 0x00000040 /* Transmit Collision Error Interrupt Mask */ | ||
134 | #define SPI_IMSK_MFM 0x00000080 /* Mode Fault Error Interrupt Mask */ | ||
135 | #define SPI_IMSK_RSM 0x00000100 /* Receive Start Interrupt Mask */ | ||
136 | #define SPI_IMSK_TSM 0x00000200 /* Transmit Start Interrupt Mask */ | ||
137 | #define SPI_IMSK_RFM 0x00000400 /* Receive Finish Interrupt Mask */ | ||
138 | #define SPI_IMSK_TFM 0x00000800 /* Transmit Finish Interrupt Mask */ | ||
139 | /* SPI_IMASKCL */ | ||
140 | #define SPI_IMSK_CLR_RUW 0x00000002 /* Receive Urgent Water-Mark Interrupt Mask */ | ||
141 | #define SPI_IMSK_CLR_TUWM 0x00000004 /* Transmit Urgent Water-Mark Interrupt Mask */ | ||
142 | #define SPI_IMSK_CLR_ROM 0x00000010 /* Receive Over-Run Error Interrupt Mask */ | ||
143 | #define SPI_IMSK_CLR_TUM 0x00000020 /* Transmit Under-Run Error Interrupt Mask */ | ||
144 | #define SPI_IMSK_CLR_TCM 0x00000040 /* Transmit Collision Error Interrupt Mask */ | ||
145 | #define SPI_IMSK_CLR_MFM 0x00000080 /* Mode Fault Error Interrupt Mask */ | ||
146 | #define SPI_IMSK_CLR_RSM 0x00000100 /* Receive Start Interrupt Mask */ | ||
147 | #define SPI_IMSK_CLR_TSM 0x00000200 /* Transmit Start Interrupt Mask */ | ||
148 | #define SPI_IMSK_CLR_RFM 0x00000400 /* Receive Finish Interrupt Mask */ | ||
149 | #define SPI_IMSK_CLR_TFM 0x00000800 /* Transmit Finish Interrupt Mask */ | ||
150 | /* SPI_IMASKST */ | ||
151 | #define SPI_IMSK_SET_RUWM 0x00000002 /* Receive Urgent Water-Mark Interrupt Mask */ | ||
152 | #define SPI_IMSK_SET_TUWM 0x00000004 /* Transmit Urgent Water-Mark Interrupt Mask */ | ||
153 | #define SPI_IMSK_SET_ROM 0x00000010 /* Receive Over-Run Error Interrupt Mask */ | ||
154 | #define SPI_IMSK_SET_TUM 0x00000020 /* Transmit Under-Run Error Interrupt Mask */ | ||
155 | #define SPI_IMSK_SET_TCM 0x00000040 /* Transmit Collision Error Interrupt Mask */ | ||
156 | #define SPI_IMSK_SET_MFM 0x00000080 /* Mode Fault Error Interrupt Mask */ | ||
157 | #define SPI_IMSK_SET_RSM 0x00000100 /* Receive Start Interrupt Mask */ | ||
158 | #define SPI_IMSK_SET_TSM 0x00000200 /* Transmit Start Interrupt Mask */ | ||
159 | #define SPI_IMSK_SET_RFM 0x00000400 /* Receive Finish Interrupt Mask */ | ||
160 | #define SPI_IMSK_SET_TFM 0x00000800 /* Transmit Finish Interrupt Mask */ | ||
161 | /* SPI_STATUS */ | ||
162 | #define SPI_STAT_SPIF 0x00000001 /* SPI Finished */ | ||
163 | #define SPI_STAT_RUWM 0x00000002 /* Receive Urgent Water-Mark Breached */ | ||
164 | #define SPI_STAT_TUWM 0x00000004 /* Transmit Urgent Water-Mark Breached */ | ||
165 | #define SPI_STAT_ROE 0x00000010 /* Receive Over-Run Error Indication */ | ||
166 | #define SPI_STAT_TUE 0x00000020 /* Transmit Under-Run Error Indication */ | ||
167 | #define SPI_STAT_TCE 0x00000040 /* Transmit Collision Error Indication */ | ||
168 | #define SPI_STAT_MODF 0x00000080 /* Mode Fault Error Indication */ | ||
169 | #define SPI_STAT_RS 0x00000100 /* Receive Start Indication */ | ||
170 | #define SPI_STAT_TS 0x00000200 /* Transmit Start Indication */ | ||
171 | #define SPI_STAT_RF 0x00000400 /* Receive Finish Indication */ | ||
172 | #define SPI_STAT_TF 0x00000800 /* Transmit Finish Indication */ | ||
173 | #define SPI_STAT_RFS 0x00007000 /* SPI_RFIFO status */ | ||
174 | #define SPI_STAT_RFIFO_EMPTY 0x00000000 /* RFS: RFIFO Empty */ | ||
175 | #define SPI_STAT_RFIFO_25 0x00001000 /* RFS: RFIFO 25% Full */ | ||
176 | #define SPI_STAT_RFIFO_50 0x00002000 /* RFS: RFIFO 50% Full */ | ||
177 | #define SPI_STAT_RFIFO_75 0x00003000 /* RFS: RFIFO 75% Full */ | ||
178 | #define SPI_STAT_RFIFO_FULL 0x00004000 /* RFS: RFIFO Full */ | ||
179 | #define SPI_STAT_TFS 0x00070000 /* SPI_TFIFO status */ | ||
180 | #define SPI_STAT_TFIFO_FULL 0x00000000 /* TFS: TFIFO full */ | ||
181 | #define SPI_STAT_TFIFO_25 0x00010000 /* TFS: TFIFO 25% empty */ | ||
182 | #define SPI_STAT_TFIFO_50 0x00020000 /* TFS: TFIFO 50% empty */ | ||
183 | #define SPI_STAT_TFIFO_75 0x00030000 /* TFS: TFIFO 75% empty */ | ||
184 | #define SPI_STAT_TFIFO_EMPTY 0x00040000 /* TFS: TFIFO empty */ | ||
185 | #define SPI_STAT_FCS 0x00100000 /* Flow-Control Stall Indication */ | ||
186 | #define SPI_STAT_RFE 0x00400000 /* SPI_RFIFO Empty */ | ||
187 | #define SPI_STAT_TFF 0x00800000 /* SPI_TFIFO Full */ | ||
188 | /* SPI_ILAT */ | ||
189 | #define SPI_ILAT_RUWMI 0x00000002 /* Receive Urgent Water Mark Interrupt */ | ||
190 | #define SPI_ILAT_TUWMI 0x00000004 /* Transmit Urgent Water Mark Interrupt */ | ||
191 | #define SPI_ILAT_ROI 0x00000010 /* Receive Over-Run Error Indication */ | ||
192 | #define SPI_ILAT_TUI 0x00000020 /* Transmit Under-Run Error Indication */ | ||
193 | #define SPI_ILAT_TCI 0x00000040 /* Transmit Collision Error Indication */ | ||
194 | #define SPI_ILAT_MFI 0x00000080 /* Mode Fault Error Indication */ | ||
195 | #define SPI_ILAT_RSI 0x00000100 /* Receive Start Indication */ | ||
196 | #define SPI_ILAT_TSI 0x00000200 /* Transmit Start Indication */ | ||
197 | #define SPI_ILAT_RFI 0x00000400 /* Receive Finish Indication */ | ||
198 | #define SPI_ILAT_TFI 0x00000800 /* Transmit Finish Indication */ | ||
199 | /* SPI_ILATCL */ | ||
200 | #define SPI_ILAT_CLR_RUWMI 0x00000002 /* Receive Urgent Water Mark Interrupt */ | ||
201 | #define SPI_ILAT_CLR_TUWMI 0x00000004 /* Transmit Urgent Water Mark Interrupt */ | ||
202 | #define SPI_ILAT_CLR_ROI 0x00000010 /* Receive Over-Run Error Indication */ | ||
203 | #define SPI_ILAT_CLR_TUI 0x00000020 /* Transmit Under-Run Error Indication */ | ||
204 | #define SPI_ILAT_CLR_TCI 0x00000040 /* Transmit Collision Error Indication */ | ||
205 | #define SPI_ILAT_CLR_MFI 0x00000080 /* Mode Fault Error Indication */ | ||
206 | #define SPI_ILAT_CLR_RSI 0x00000100 /* Receive Start Indication */ | ||
207 | #define SPI_ILAT_CLR_TSI 0x00000200 /* Transmit Start Indication */ | ||
208 | #define SPI_ILAT_CLR_RFI 0x00000400 /* Receive Finish Indication */ | ||
209 | #define SPI_ILAT_CLR_TFI 0x00000800 /* Transmit Finish Indication */ | ||
210 | |||
211 | /* | ||
212 | * bfin spi3 registers layout | ||
213 | */ | ||
214 | struct bfin_spi_regs { | ||
215 | u32 revid; | ||
216 | u32 control; | ||
217 | u32 rx_control; | ||
218 | u32 tx_control; | ||
219 | u32 clock; | ||
220 | u32 delay; | ||
221 | u32 ssel; | ||
222 | u32 rwc; | ||
223 | u32 rwcr; | ||
224 | u32 twc; | ||
225 | u32 twcr; | ||
226 | u32 reserved0; | ||
227 | u32 emask; | ||
228 | u32 emaskcl; | ||
229 | u32 emaskst; | ||
230 | u32 reserved1; | ||
231 | u32 status; | ||
232 | u32 elat; | ||
233 | u32 elatcl; | ||
234 | u32 reserved2; | ||
235 | u32 rfifo; | ||
236 | u32 reserved3; | ||
237 | u32 tfifo; | ||
238 | }; | ||
239 | |||
240 | #define MAX_CTRL_CS 8 /* cs in spi controller */ | ||
241 | |||
242 | /* device.platform_data for SSP controller devices */ | ||
243 | struct bfin_spi3_master { | ||
244 | u16 num_chipselect; | ||
245 | u16 pin_req[7]; | ||
246 | }; | ||
247 | |||
248 | /* spi_board_info.controller_data for SPI slave devices, | ||
249 | * copied to spi_device.platform_data ... mostly for dma tuning | ||
250 | */ | ||
251 | struct bfin_spi3_chip { | ||
252 | u32 control; | ||
253 | u16 cs_chg_udelay; /* Some devices require 16-bit delays */ | ||
254 | u32 tx_dummy_val; /* tx value for rx only transfer */ | ||
255 | bool enable_dma; | ||
256 | }; | ||
257 | |||
258 | #endif /* _SPI_CHANNEL_H_ */ | ||
diff --git a/arch/blackfin/mach-bf609/boards/ezkit.c b/arch/blackfin/mach-bf609/boards/ezkit.c index 943f7e95ec15..1ba4600de69f 100644 --- a/arch/blackfin/mach-bf609/boards/ezkit.c +++ b/arch/blackfin/mach-bf609/boards/ezkit.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include <linux/pinctrl/machine.h> | 20 | #include <linux/pinctrl/machine.h> |
21 | #include <linux/pinctrl/pinconf-generic.h> | 21 | #include <linux/pinctrl/pinconf-generic.h> |
22 | #include <linux/platform_data/pinctrl-adi2.h> | 22 | #include <linux/platform_data/pinctrl-adi2.h> |
23 | #include <asm/bfin_spi3.h> | 23 | #include <linux/spi/adi_spi3.h> |
24 | #include <asm/dma.h> | 24 | #include <asm/dma.h> |
25 | #include <asm/gpio.h> | 25 | #include <asm/gpio.h> |
26 | #include <asm/nand.h> | 26 | #include <asm/nand.h> |
@@ -767,13 +767,13 @@ static struct flash_platform_data bfin_spi_flash_data = { | |||
767 | .type = "w25q32", | 767 | .type = "w25q32", |
768 | }; | 768 | }; |
769 | 769 | ||
770 | static struct bfin_spi3_chip spi_flash_chip_info = { | 770 | static struct adi_spi3_chip spi_flash_chip_info = { |
771 | .enable_dma = true, /* use dma transfer with this chip*/ | 771 | .enable_dma = true, /* use dma transfer with this chip*/ |
772 | }; | 772 | }; |
773 | #endif | 773 | #endif |
774 | 774 | ||
775 | #if IS_ENABLED(CONFIG_SPI_SPIDEV) | 775 | #if IS_ENABLED(CONFIG_SPI_SPIDEV) |
776 | static struct bfin_spi3_chip spidev_chip_info = { | 776 | static struct adi_spi3_chip spidev_chip_info = { |
777 | .enable_dma = true, | 777 | .enable_dma = true, |
778 | }; | 778 | }; |
779 | #endif | 779 | #endif |
@@ -1736,7 +1736,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
1736 | }, | 1736 | }, |
1737 | #endif | 1737 | #endif |
1738 | }; | 1738 | }; |
1739 | #if IS_ENABLED(CONFIG_SPI_BFIN_V3) | 1739 | #if IS_ENABLED(CONFIG_SPI_ADI_V3) |
1740 | /* SPI (0) */ | 1740 | /* SPI (0) */ |
1741 | static struct resource bfin_spi0_resource[] = { | 1741 | static struct resource bfin_spi0_resource[] = { |
1742 | { | 1742 | { |
@@ -1777,13 +1777,13 @@ static struct resource bfin_spi1_resource[] = { | |||
1777 | }; | 1777 | }; |
1778 | 1778 | ||
1779 | /* SPI controller data */ | 1779 | /* SPI controller data */ |
1780 | static struct bfin_spi3_master bf60x_spi_master_info0 = { | 1780 | static struct adi_spi3_master bf60x_spi_master_info0 = { |
1781 | .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, | 1781 | .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, |
1782 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, | 1782 | .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0}, |
1783 | }; | 1783 | }; |
1784 | 1784 | ||
1785 | static struct platform_device bf60x_spi_master0 = { | 1785 | static struct platform_device bf60x_spi_master0 = { |
1786 | .name = "bfin-spi3", | 1786 | .name = "adi-spi3", |
1787 | .id = 0, /* Bus number */ | 1787 | .id = 0, /* Bus number */ |
1788 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | 1788 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), |
1789 | .resource = bfin_spi0_resource, | 1789 | .resource = bfin_spi0_resource, |
@@ -1792,13 +1792,13 @@ static struct platform_device bf60x_spi_master0 = { | |||
1792 | }, | 1792 | }, |
1793 | }; | 1793 | }; |
1794 | 1794 | ||
1795 | static struct bfin_spi3_master bf60x_spi_master_info1 = { | 1795 | static struct adi_spi3_master bf60x_spi_master_info1 = { |
1796 | .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, | 1796 | .num_chipselect = MAX_CTRL_CS + MAX_BLACKFIN_GPIOS, |
1797 | .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, | 1797 | .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0}, |
1798 | }; | 1798 | }; |
1799 | 1799 | ||
1800 | static struct platform_device bf60x_spi_master1 = { | 1800 | static struct platform_device bf60x_spi_master1 = { |
1801 | .name = "bfin-spi3", | 1801 | .name = "adi-spi3", |
1802 | .id = 1, /* Bus number */ | 1802 | .id = 1, /* Bus number */ |
1803 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), | 1803 | .num_resources = ARRAY_SIZE(bfin_spi1_resource), |
1804 | .resource = bfin_spi1_resource, | 1804 | .resource = bfin_spi1_resource, |
@@ -1990,7 +1990,7 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
1990 | &bfin_sdh_device, | 1990 | &bfin_sdh_device, |
1991 | #endif | 1991 | #endif |
1992 | 1992 | ||
1993 | #if IS_ENABLED(CONFIG_SPI_BFIN_V3) | 1993 | #if IS_ENABLED(CONFIG_SPI_ADI_V3) |
1994 | &bf60x_spi_master0, | 1994 | &bf60x_spi_master0, |
1995 | &bf60x_spi_master1, | 1995 | &bf60x_spi_master1, |
1996 | #endif | 1996 | #endif |
@@ -2051,8 +2051,8 @@ static struct pinctrl_map __initdata bfin_pinmux_map[] = { | |||
2051 | PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"), | 2051 | PIN_MAP_MUX_GROUP_DEFAULT("bfin_sir.1", "pinctrl-adi2.0", NULL, "uart1"), |
2052 | PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"), | 2052 | PIN_MAP_MUX_GROUP_DEFAULT("bfin-sdh.0", "pinctrl-adi2.0", NULL, "rsi0"), |
2053 | PIN_MAP_MUX_GROUP_DEFAULT("stmmaceth.0", "pinctrl-adi2.0", NULL, "eth0"), | 2053 | PIN_MAP_MUX_GROUP_DEFAULT("stmmaceth.0", "pinctrl-adi2.0", NULL, "eth0"), |
2054 | PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.0", "pinctrl-adi2.0", NULL, "spi0"), | 2054 | PIN_MAP_MUX_GROUP_DEFAULT("adi-spi3.0", "pinctrl-adi2.0", NULL, "spi0"), |
2055 | PIN_MAP_MUX_GROUP_DEFAULT("bfin-spi3.1", "pinctrl-adi2.0", NULL, "spi1"), | 2055 | PIN_MAP_MUX_GROUP_DEFAULT("adi-spi3.1", "pinctrl-adi2.0", NULL, "spi1"), |
2056 | PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"), | 2056 | PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.0", "pinctrl-adi2.0", NULL, "twi0"), |
2057 | PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"), | 2057 | PIN_MAP_MUX_GROUP_DEFAULT("i2c-bfin-twi.1", "pinctrl-adi2.0", NULL, "twi1"), |
2058 | PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"), | 2058 | PIN_MAP_MUX_GROUP_DEFAULT("bfin-rotary", "pinctrl-adi2.0", NULL, "rotary"), |
diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c index 56200f37cfc8..244fa4ab4c56 100644 --- a/arch/blackfin/mach-bf609/clock.c +++ b/arch/blackfin/mach-bf609/clock.c | |||
@@ -363,6 +363,12 @@ static struct clk ethclk = { | |||
363 | .ops = &dummy_clk_ops, | 363 | .ops = &dummy_clk_ops, |
364 | }; | 364 | }; |
365 | 365 | ||
366 | static struct clk spiclk = { | ||
367 | .name = "spi", | ||
368 | .parent = &sclk1, | ||
369 | .ops = &dummy_clk_ops, | ||
370 | }; | ||
371 | |||
366 | static struct clk_lookup bf609_clks[] = { | 372 | static struct clk_lookup bf609_clks[] = { |
367 | CLK(sys_clkin, NULL, "SYS_CLKIN"), | 373 | CLK(sys_clkin, NULL, "SYS_CLKIN"), |
368 | CLK(pll_clk, NULL, "PLLCLK"), | 374 | CLK(pll_clk, NULL, "PLLCLK"), |
@@ -375,6 +381,7 @@ static struct clk_lookup bf609_clks[] = { | |||
375 | CLK(dclk, NULL, "DCLK"), | 381 | CLK(dclk, NULL, "DCLK"), |
376 | CLK(oclk, NULL, "OCLK"), | 382 | CLK(oclk, NULL, "OCLK"), |
377 | CLK(ethclk, NULL, "stmmaceth"), | 383 | CLK(ethclk, NULL, "stmmaceth"), |
384 | CLK(spiclk, NULL, "spi"), | ||
378 | }; | 385 | }; |
379 | 386 | ||
380 | int __init clk_init(void) | 387 | int __init clk_init(void) |
diff --git a/arch/hexagon/include/asm/barrier.h b/arch/hexagon/include/asm/barrier.h deleted file mode 100644 index 4e863daea25b..000000000000 --- a/arch/hexagon/include/asm/barrier.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Memory barrier definitions for the Hexagon architecture | ||
3 | * | ||
4 | * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 and | ||
8 | * only version 2 as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
18 | * 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _ASM_BARRIER_H | ||
22 | #define _ASM_BARRIER_H | ||
23 | |||
24 | #define rmb() barrier() | ||
25 | #define read_barrier_depends() barrier() | ||
26 | #define wmb() barrier() | ||
27 | #define mb() barrier() | ||
28 | #define smp_rmb() barrier() | ||
29 | #define smp_read_barrier_depends() barrier() | ||
30 | #define smp_wmb() barrier() | ||
31 | #define smp_mb() barrier() | ||
32 | |||
33 | /* Set a value and use a memory barrier. Used by the scheduler somewhere. */ | ||
34 | #define set_mb(var, value) \ | ||
35 | do { var = value; mb(); } while (0) | ||
36 | |||
37 | #endif /* _ASM_BARRIER_H */ | ||
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h index bc5efc7c3f3f..39d64e0df1de 100644 --- a/arch/ia64/include/asm/tlb.h +++ b/arch/ia64/include/asm/tlb.h | |||
@@ -91,18 +91,9 @@ extern struct ia64_tr_entry *ia64_idtrs[NR_CPUS]; | |||
91 | #define RR_RID_MASK 0x00000000ffffff00L | 91 | #define RR_RID_MASK 0x00000000ffffff00L |
92 | #define RR_TO_RID(val) ((val >> 8) & 0xffffff) | 92 | #define RR_TO_RID(val) ((val >> 8) & 0xffffff) |
93 | 93 | ||
94 | /* | ||
95 | * Flush the TLB for address range START to END and, if not in fast mode, release the | ||
96 | * freed pages that where gathered up to this point. | ||
97 | */ | ||
98 | static inline void | 94 | static inline void |
99 | ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) | 95 | ia64_tlb_flush_mmu_tlbonly(struct mmu_gather *tlb, unsigned long start, unsigned long end) |
100 | { | 96 | { |
101 | unsigned long i; | ||
102 | unsigned int nr; | ||
103 | |||
104 | if (!tlb->need_flush) | ||
105 | return; | ||
106 | tlb->need_flush = 0; | 97 | tlb->need_flush = 0; |
107 | 98 | ||
108 | if (tlb->fullmm) { | 99 | if (tlb->fullmm) { |
@@ -135,6 +126,14 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e | |||
135 | flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end)); | 126 | flush_tlb_range(&vma, ia64_thash(start), ia64_thash(end)); |
136 | } | 127 | } |
137 | 128 | ||
129 | } | ||
130 | |||
131 | static inline void | ||
132 | ia64_tlb_flush_mmu_free(struct mmu_gather *tlb) | ||
133 | { | ||
134 | unsigned long i; | ||
135 | unsigned int nr; | ||
136 | |||
138 | /* lastly, release the freed pages */ | 137 | /* lastly, release the freed pages */ |
139 | nr = tlb->nr; | 138 | nr = tlb->nr; |
140 | 139 | ||
@@ -144,6 +143,19 @@ ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long e | |||
144 | free_page_and_swap_cache(tlb->pages[i]); | 143 | free_page_and_swap_cache(tlb->pages[i]); |
145 | } | 144 | } |
146 | 145 | ||
146 | /* | ||
147 | * Flush the TLB for address range START to END and, if not in fast mode, release the | ||
148 | * freed pages that where gathered up to this point. | ||
149 | */ | ||
150 | static inline void | ||
151 | ia64_tlb_flush_mmu (struct mmu_gather *tlb, unsigned long start, unsigned long end) | ||
152 | { | ||
153 | if (!tlb->need_flush) | ||
154 | return; | ||
155 | ia64_tlb_flush_mmu_tlbonly(tlb, start, end); | ||
156 | ia64_tlb_flush_mmu_free(tlb); | ||
157 | } | ||
158 | |||
147 | static inline void __tlb_alloc_page(struct mmu_gather *tlb) | 159 | static inline void __tlb_alloc_page(struct mmu_gather *tlb) |
148 | { | 160 | { |
149 | unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); | 161 | unsigned long addr = __get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0); |
@@ -206,6 +218,16 @@ static inline int __tlb_remove_page(struct mmu_gather *tlb, struct page *page) | |||
206 | return tlb->max - tlb->nr; | 218 | return tlb->max - tlb->nr; |
207 | } | 219 | } |
208 | 220 | ||
221 | static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) | ||
222 | { | ||
223 | ia64_tlb_flush_mmu_tlbonly(tlb, tlb->start_addr, tlb->end_addr); | ||
224 | } | ||
225 | |||
226 | static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) | ||
227 | { | ||
228 | ia64_tlb_flush_mmu_free(tlb); | ||
229 | } | ||
230 | |||
209 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | 231 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) |
210 | { | 232 | { |
211 | ia64_tlb_flush_mmu(tlb, tlb->start_addr, tlb->end_addr); | 233 | ia64_tlb_flush_mmu(tlb, tlb->start_addr, tlb->end_addr); |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index ae763d8bf55a..fb13dc5e8f8c 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | 13 | ||
14 | #define NR_syscalls 314 /* length of syscall table */ | 14 | #define NR_syscalls 315 /* length of syscall table */ |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * The following defines stop scripts/checksyscalls.sh from complaining about | 17 | * The following defines stop scripts/checksyscalls.sh from complaining about |
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 715e85f858de..7de0a2d65da4 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h | |||
@@ -327,5 +327,6 @@ | |||
327 | #define __NR_finit_module 1335 | 327 | #define __NR_finit_module 1335 |
328 | #define __NR_sched_setattr 1336 | 328 | #define __NR_sched_setattr 1336 |
329 | #define __NR_sched_getattr 1337 | 329 | #define __NR_sched_getattr 1337 |
330 | #define __NR_renameat2 1338 | ||
330 | 331 | ||
331 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ | 332 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index fa8d61a312a7..ba3d03503e84 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1775,6 +1775,7 @@ sys_call_table: | |||
1775 | data8 sys_finit_module // 1335 | 1775 | data8 sys_finit_module // 1335 |
1776 | data8 sys_sched_setattr | 1776 | data8 sys_sched_setattr |
1777 | data8 sys_sched_getattr | 1777 | data8 sys_sched_getattr |
1778 | data8 sys_renameat2 | ||
1778 | 1779 | ||
1779 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1780 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
1780 | #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ | 1781 | #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */ |
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index e6f80fcf013b..a4acddad0c78 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S | |||
@@ -259,7 +259,7 @@ start_ap: | |||
259 | * Switch into virtual mode: | 259 | * Switch into virtual mode: |
260 | */ | 260 | */ |
261 | movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \ | 261 | movl r16=(IA64_PSR_IT|IA64_PSR_IC|IA64_PSR_DT|IA64_PSR_RT|IA64_PSR_DFH|IA64_PSR_BN \ |
262 | |IA64_PSR_DI|IA64_PSR_AC) | 262 | |IA64_PSR_DI) |
263 | ;; | 263 | ;; |
264 | mov cr.ipsr=r16 | 264 | mov cr.ipsr=r16 |
265 | movl r17=1f | 265 | movl r17=1f |
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S index 689ffcaa284e..18e794a57248 100644 --- a/arch/ia64/kernel/ivt.S +++ b/arch/ia64/kernel/ivt.S | |||
@@ -58,7 +58,7 @@ | |||
58 | #include <asm/unistd.h> | 58 | #include <asm/unistd.h> |
59 | #include <asm/errno.h> | 59 | #include <asm/errno.h> |
60 | 60 | ||
61 | #if 1 | 61 | #if 0 |
62 | # define PSR_DEFAULT_BITS psr.ac | 62 | # define PSR_DEFAULT_BITS psr.ac |
63 | #else | 63 | #else |
64 | # define PSR_DEFAULT_BITS 0 | 64 | # define PSR_DEFAULT_BITS 0 |
diff --git a/arch/ia64/kvm/vmm_ivt.S b/arch/ia64/kvm/vmm_ivt.S index 24018484c6e9..397e34a63e18 100644 --- a/arch/ia64/kvm/vmm_ivt.S +++ b/arch/ia64/kvm/vmm_ivt.S | |||
@@ -64,7 +64,7 @@ | |||
64 | #include "kvm_minstate.h" | 64 | #include "kvm_minstate.h" |
65 | #include "vti.h" | 65 | #include "vti.h" |
66 | 66 | ||
67 | #if 1 | 67 | #if 0 |
68 | # define PSR_DEFAULT_BITS psr.ac | 68 | # define PSR_DEFAULT_BITS psr.ac |
69 | #else | 69 | #else |
70 | # define PSR_DEFAULT_BITS 0 | 70 | # define PSR_DEFAULT_BITS 0 |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 9d38b73989eb..33afa56ad47a 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -4,7 +4,7 @@ | |||
4 | #include <uapi/asm/unistd.h> | 4 | #include <uapi/asm/unistd.h> |
5 | 5 | ||
6 | 6 | ||
7 | #define NR_syscalls 351 | 7 | #define NR_syscalls 352 |
8 | 8 | ||
9 | #define __ARCH_WANT_OLD_READDIR | 9 | #define __ARCH_WANT_OLD_READDIR |
10 | #define __ARCH_WANT_OLD_STAT | 10 | #define __ARCH_WANT_OLD_STAT |
diff --git a/arch/m68k/include/uapi/asm/unistd.h b/arch/m68k/include/uapi/asm/unistd.h index b932dd470041..9cd82fbc7817 100644 --- a/arch/m68k/include/uapi/asm/unistd.h +++ b/arch/m68k/include/uapi/asm/unistd.h | |||
@@ -356,5 +356,6 @@ | |||
356 | #define __NR_finit_module 348 | 356 | #define __NR_finit_module 348 |
357 | #define __NR_sched_setattr 349 | 357 | #define __NR_sched_setattr 349 |
358 | #define __NR_sched_getattr 350 | 358 | #define __NR_sched_getattr 350 |
359 | #define __NR_renameat2 351 | ||
359 | 360 | ||
360 | #endif /* _UAPI_ASM_M68K_UNISTD_H_ */ | 361 | #endif /* _UAPI_ASM_M68K_UNISTD_H_ */ |
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S index b6223dc41d82..501e10212789 100644 --- a/arch/m68k/kernel/syscalltable.S +++ b/arch/m68k/kernel/syscalltable.S | |||
@@ -371,4 +371,5 @@ ENTRY(sys_call_table) | |||
371 | .long sys_finit_module | 371 | .long sys_finit_module |
372 | .long sys_sched_setattr | 372 | .long sys_sched_setattr |
373 | .long sys_sched_getattr /* 350 */ | 373 | .long sys_sched_getattr /* 350 */ |
374 | .long sys_renameat2 | ||
374 | 375 | ||
diff --git a/arch/metag/include/asm/barrier.h b/arch/metag/include/asm/barrier.h index 5d6b4b407dda..2d6f0de77325 100644 --- a/arch/metag/include/asm/barrier.h +++ b/arch/metag/include/asm/barrier.h | |||
@@ -15,6 +15,7 @@ static inline void wr_fence(void) | |||
15 | volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_FENCE; | 15 | volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_FENCE; |
16 | barrier(); | 16 | barrier(); |
17 | *flushptr = 0; | 17 | *flushptr = 0; |
18 | barrier(); | ||
18 | } | 19 | } |
19 | 20 | ||
20 | #else /* CONFIG_METAG_META21 */ | 21 | #else /* CONFIG_METAG_META21 */ |
@@ -35,6 +36,7 @@ static inline void wr_fence(void) | |||
35 | *flushptr = 0; | 36 | *flushptr = 0; |
36 | *flushptr = 0; | 37 | *flushptr = 0; |
37 | *flushptr = 0; | 38 | *flushptr = 0; |
39 | barrier(); | ||
38 | } | 40 | } |
39 | 41 | ||
40 | #endif /* !CONFIG_METAG_META21 */ | 42 | #endif /* !CONFIG_METAG_META21 */ |
@@ -68,6 +70,7 @@ static inline void fence(void) | |||
68 | volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_ATOMIC_UNLOCK; | 70 | volatile int *flushptr = (volatile int *) LINSYSEVENT_WR_ATOMIC_UNLOCK; |
69 | barrier(); | 71 | barrier(); |
70 | *flushptr = 0; | 72 | *flushptr = 0; |
73 | barrier(); | ||
71 | } | 74 | } |
72 | #define smp_mb() fence() | 75 | #define smp_mb() fence() |
73 | #define smp_rmb() fence() | 76 | #define smp_rmb() fence() |
diff --git a/arch/metag/include/asm/processor.h b/arch/metag/include/asm/processor.h index f16477d1f571..a8a37477c66e 100644 --- a/arch/metag/include/asm/processor.h +++ b/arch/metag/include/asm/processor.h | |||
@@ -22,6 +22,8 @@ | |||
22 | /* Add an extra page of padding at the top of the stack for the guard page. */ | 22 | /* Add an extra page of padding at the top of the stack for the guard page. */ |
23 | #define STACK_TOP (TASK_SIZE - PAGE_SIZE) | 23 | #define STACK_TOP (TASK_SIZE - PAGE_SIZE) |
24 | #define STACK_TOP_MAX STACK_TOP | 24 | #define STACK_TOP_MAX STACK_TOP |
25 | /* Maximum virtual space for stack */ | ||
26 | #define STACK_SIZE_MAX (CONFIG_MAX_STACK_SIZE_MB*1024*1024) | ||
25 | 27 | ||
26 | /* This decides where the kernel will search for a free chunk of vm | 28 | /* This decides where the kernel will search for a free chunk of vm |
27 | * space during mmap's. | 29 | * space during mmap's. |
diff --git a/arch/metag/include/uapi/asm/Kbuild b/arch/metag/include/uapi/asm/Kbuild index 84e09feb4d54..ab78be2b6eb0 100644 --- a/arch/metag/include/uapi/asm/Kbuild +++ b/arch/metag/include/uapi/asm/Kbuild | |||
@@ -4,11 +4,11 @@ include include/uapi/asm-generic/Kbuild.asm | |||
4 | header-y += byteorder.h | 4 | header-y += byteorder.h |
5 | header-y += ech.h | 5 | header-y += ech.h |
6 | header-y += ptrace.h | 6 | header-y += ptrace.h |
7 | header-y += resource.h | ||
8 | header-y += sigcontext.h | 7 | header-y += sigcontext.h |
9 | header-y += siginfo.h | 8 | header-y += siginfo.h |
10 | header-y += swab.h | 9 | header-y += swab.h |
11 | header-y += unistd.h | 10 | header-y += unistd.h |
12 | 11 | ||
13 | generic-y += mman.h | 12 | generic-y += mman.h |
13 | generic-y += resource.h | ||
14 | generic-y += setup.h | 14 | generic-y += setup.h |
diff --git a/arch/metag/include/uapi/asm/resource.h b/arch/metag/include/uapi/asm/resource.h deleted file mode 100644 index 526d23cc3054..000000000000 --- a/arch/metag/include/uapi/asm/resource.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _UAPI_METAG_RESOURCE_H | ||
2 | #define _UAPI_METAG_RESOURCE_H | ||
3 | |||
4 | #define _STK_LIM_MAX (1 << 28) | ||
5 | #include <asm-generic/resource.h> | ||
6 | |||
7 | #endif /* _UAPI_METAG_RESOURCE_H */ | ||
diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 1a5b4032cb66..60a359cfa328 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile | |||
@@ -151,7 +151,7 @@ cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) \ | |||
151 | -Wa,--trap | 151 | -Wa,--trap |
152 | cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \ | 152 | cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \ |
153 | -Wa,--trap | 153 | -Wa,--trap |
154 | cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) \ | 154 | cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1 -mno-mdmx -mno-mips3d,-march=r5000) \ |
155 | -Wa,--trap | 155 | -Wa,--trap |
156 | cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap | 156 | cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap |
157 | cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \ | 157 | cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \ |
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index c2bb4f896ce7..3aa5b46b2d40 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -635,7 +635,7 @@ static void octeon_irq_cpu_offline_ciu(struct irq_data *data) | |||
635 | cpumask_clear(&new_affinity); | 635 | cpumask_clear(&new_affinity); |
636 | cpumask_set_cpu(cpumask_first(cpu_online_mask), &new_affinity); | 636 | cpumask_set_cpu(cpumask_first(cpu_online_mask), &new_affinity); |
637 | } | 637 | } |
638 | __irq_set_affinity_locked(data, &new_affinity); | 638 | irq_set_affinity_locked(data, &new_affinity, false); |
639 | } | 639 | } |
640 | 640 | ||
641 | static int octeon_irq_ciu_set_affinity(struct irq_data *data, | 641 | static int octeon_irq_ciu_set_affinity(struct irq_data *data, |
diff --git a/arch/mips/dec/ecc-berr.c b/arch/mips/dec/ecc-berr.c index 5abf4e894216..2a66e908f6a9 100644 --- a/arch/mips/dec/ecc-berr.c +++ b/arch/mips/dec/ecc-berr.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/addrspace.h> | 21 | #include <asm/addrspace.h> |
22 | #include <asm/bootinfo.h> | 22 | #include <asm/bootinfo.h> |
23 | #include <asm/cpu.h> | 23 | #include <asm/cpu.h> |
24 | #include <asm/cpu-type.h> | ||
24 | #include <asm/irq_regs.h> | 25 | #include <asm/irq_regs.h> |
25 | #include <asm/processor.h> | 26 | #include <asm/processor.h> |
26 | #include <asm/ptrace.h> | 27 | #include <asm/ptrace.h> |
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c index f434b759e3b9..ec606363b806 100644 --- a/arch/mips/dec/kn02xa-berr.c +++ b/arch/mips/dec/kn02xa-berr.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | 20 | ||
21 | #include <asm/addrspace.h> | 21 | #include <asm/addrspace.h> |
22 | #include <asm/cpu-type.h> | ||
22 | #include <asm/irq_regs.h> | 23 | #include <asm/irq_regs.h> |
23 | #include <asm/ptrace.h> | 24 | #include <asm/ptrace.h> |
24 | #include <asm/traps.h> | 25 | #include <asm/traps.h> |
diff --git a/arch/mips/dec/prom/Makefile b/arch/mips/dec/prom/Makefile index 064ae7a76bdc..ae73e42ac20b 100644 --- a/arch/mips/dec/prom/Makefile +++ b/arch/mips/dec/prom/Makefile | |||
@@ -6,4 +6,3 @@ | |||
6 | lib-y += init.o memory.o cmdline.o identify.o console.o | 6 | lib-y += init.o memory.o cmdline.o identify.o console.o |
7 | 7 | ||
8 | lib-$(CONFIG_32BIT) += locore.o | 8 | lib-$(CONFIG_32BIT) += locore.o |
9 | lib-$(CONFIG_64BIT) += call_o32.o | ||
diff --git a/arch/mips/dec/prom/call_o32.S b/arch/mips/dec/prom/call_o32.S deleted file mode 100644 index 8c8498159e43..000000000000 --- a/arch/mips/dec/prom/call_o32.S +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | /* | ||
2 | * O32 interface for the 64 (or N32) ABI. | ||
3 | * | ||
4 | * Copyright (C) 2002 Maciej W. Rozycki | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <asm/asm.h> | ||
13 | #include <asm/regdef.h> | ||
14 | |||
15 | /* Maximum number of arguments supported. Must be even! */ | ||
16 | #define O32_ARGC 32 | ||
17 | /* Number of static registers we save. */ | ||
18 | #define O32_STATC 11 | ||
19 | /* Frame size for both of the above. */ | ||
20 | #define O32_FRAMESZ (4 * O32_ARGC + SZREG * O32_STATC) | ||
21 | |||
22 | .text | ||
23 | |||
24 | /* | ||
25 | * O32 function call dispatcher, for interfacing 32-bit ROM routines. | ||
26 | * | ||
27 | * The standard 64 (N32) calling sequence is supported, with a0 | ||
28 | * holding a function pointer, a1-a7 -- its first seven arguments | ||
29 | * and the stack -- remaining ones (up to O32_ARGC, including a1-a7). | ||
30 | * Static registers, gp and fp are preserved, v0 holds a result. | ||
31 | * This code relies on the called o32 function for sp and ra | ||
32 | * restoration and thus both this dispatcher and the current stack | ||
33 | * have to be placed in a KSEGx (or KUSEG) address space. Any | ||
34 | * pointers passed have to point to addresses within one of these | ||
35 | * spaces as well. | ||
36 | */ | ||
37 | NESTED(call_o32, O32_FRAMESZ, ra) | ||
38 | REG_SUBU sp,O32_FRAMESZ | ||
39 | |||
40 | REG_S ra,O32_FRAMESZ-1*SZREG(sp) | ||
41 | REG_S fp,O32_FRAMESZ-2*SZREG(sp) | ||
42 | REG_S gp,O32_FRAMESZ-3*SZREG(sp) | ||
43 | REG_S s7,O32_FRAMESZ-4*SZREG(sp) | ||
44 | REG_S s6,O32_FRAMESZ-5*SZREG(sp) | ||
45 | REG_S s5,O32_FRAMESZ-6*SZREG(sp) | ||
46 | REG_S s4,O32_FRAMESZ-7*SZREG(sp) | ||
47 | REG_S s3,O32_FRAMESZ-8*SZREG(sp) | ||
48 | REG_S s2,O32_FRAMESZ-9*SZREG(sp) | ||
49 | REG_S s1,O32_FRAMESZ-10*SZREG(sp) | ||
50 | REG_S s0,O32_FRAMESZ-11*SZREG(sp) | ||
51 | |||
52 | move jp,a0 | ||
53 | |||
54 | sll a0,a1,zero | ||
55 | sll a1,a2,zero | ||
56 | sll a2,a3,zero | ||
57 | sll a3,a4,zero | ||
58 | sw a5,0x10(sp) | ||
59 | sw a6,0x14(sp) | ||
60 | sw a7,0x18(sp) | ||
61 | |||
62 | PTR_LA t0,O32_FRAMESZ(sp) | ||
63 | PTR_LA t1,0x1c(sp) | ||
64 | li t2,O32_ARGC-7 | ||
65 | 1: | ||
66 | lw t3,(t0) | ||
67 | REG_ADDU t0,SZREG | ||
68 | sw t3,(t1) | ||
69 | REG_SUBU t2,1 | ||
70 | REG_ADDU t1,4 | ||
71 | bnez t2,1b | ||
72 | |||
73 | jalr jp | ||
74 | |||
75 | REG_L s0,O32_FRAMESZ-11*SZREG(sp) | ||
76 | REG_L s1,O32_FRAMESZ-10*SZREG(sp) | ||
77 | REG_L s2,O32_FRAMESZ-9*SZREG(sp) | ||
78 | REG_L s3,O32_FRAMESZ-8*SZREG(sp) | ||
79 | REG_L s4,O32_FRAMESZ-7*SZREG(sp) | ||
80 | REG_L s5,O32_FRAMESZ-6*SZREG(sp) | ||
81 | REG_L s6,O32_FRAMESZ-5*SZREG(sp) | ||
82 | REG_L s7,O32_FRAMESZ-4*SZREG(sp) | ||
83 | REG_L gp,O32_FRAMESZ-3*SZREG(sp) | ||
84 | REG_L fp,O32_FRAMESZ-2*SZREG(sp) | ||
85 | REG_L ra,O32_FRAMESZ-1*SZREG(sp) | ||
86 | |||
87 | REG_ADDU sp,O32_FRAMESZ | ||
88 | jr ra | ||
89 | END(call_o32) | ||
diff --git a/arch/mips/fw/lib/call_o32.S b/arch/mips/fw/lib/call_o32.S index b308b2a0613e..4703fe4dbd9a 100644 --- a/arch/mips/fw/lib/call_o32.S +++ b/arch/mips/fw/lib/call_o32.S | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * O32 interface for the 64 (or N32) ABI. | 2 | * O32 interface for the 64 (or N32) ABI. |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Maciej W. Rozycki | 4 | * Copyright (C) 2002, 2014 Maciej W. Rozycki |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public License | 7 | * modify it under the terms of the GNU General Public License |
@@ -12,28 +12,37 @@ | |||
12 | #include <asm/asm.h> | 12 | #include <asm/asm.h> |
13 | #include <asm/regdef.h> | 13 | #include <asm/regdef.h> |
14 | 14 | ||
15 | /* O32 register size. */ | ||
16 | #define O32_SZREG 4 | ||
15 | /* Maximum number of arguments supported. Must be even! */ | 17 | /* Maximum number of arguments supported. Must be even! */ |
16 | #define O32_ARGC 32 | 18 | #define O32_ARGC 32 |
17 | /* Number of static registers we save. */ | 19 | /* Number of static registers we save. */ |
18 | #define O32_STATC 11 | 20 | #define O32_STATC 11 |
19 | /* Frame size for static register */ | 21 | /* Argument area frame size. */ |
20 | #define O32_FRAMESZ (SZREG * O32_STATC) | 22 | #define O32_ARGSZ (O32_SZREG * O32_ARGC) |
21 | /* Frame size on new stack */ | 23 | /* Static register save area frame size. */ |
22 | #define O32_FRAMESZ_NEW (SZREG + 4 * O32_ARGC) | 24 | #define O32_STATSZ (SZREG * O32_STATC) |
25 | /* Stack pointer register save area frame size. */ | ||
26 | #define O32_SPSZ SZREG | ||
27 | /* Combined area frame size. */ | ||
28 | #define O32_FRAMESZ (O32_ARGSZ + O32_SPSZ + O32_STATSZ) | ||
29 | /* Switched stack frame size. */ | ||
30 | #define O32_NFRAMESZ (O32_ARGSZ + O32_SPSZ) | ||
23 | 31 | ||
24 | .text | 32 | .text |
25 | 33 | ||
26 | /* | 34 | /* |
27 | * O32 function call dispatcher, for interfacing 32-bit ROM routines. | 35 | * O32 function call dispatcher, for interfacing 32-bit ROM routines. |
28 | * | 36 | * |
29 | * The standard 64 (N32) calling sequence is supported, with a0 | 37 | * The standard 64 (N32) calling sequence is supported, with a0 holding |
30 | * holding a function pointer, a1 a new stack pointer, a2-a7 -- its | 38 | * a function pointer, a1 a pointer to the new stack to call the |
31 | * first six arguments and the stack -- remaining ones (up to O32_ARGC, | 39 | * function with or 0 if no stack switching is requested, a2-a7 -- the |
32 | * including a2-a7). Static registers, gp and fp are preserved, v0 holds | 40 | * function call's first six arguments, and the stack -- the remaining |
33 | * a result. This code relies on the called o32 function for sp and ra | 41 | * arguments (up to O32_ARGC, including a2-a7). Static registers, gp |
34 | * restoration and this dispatcher has to be placed in a KSEGx (or KUSEG) | 42 | * and fp are preserved, v0 holds the result. This code relies on the |
35 | * address space. Any pointers passed have to point to addresses within | 43 | * called o32 function for sp and ra restoration and this dispatcher has |
36 | * one of these spaces as well. | 44 | * to be placed in a KSEGx (or KUSEG) address space. Any pointers |
45 | * passed have to point to addresses within one of these spaces as well. | ||
37 | */ | 46 | */ |
38 | NESTED(call_o32, O32_FRAMESZ, ra) | 47 | NESTED(call_o32, O32_FRAMESZ, ra) |
39 | REG_SUBU sp,O32_FRAMESZ | 48 | REG_SUBU sp,O32_FRAMESZ |
@@ -51,32 +60,36 @@ NESTED(call_o32, O32_FRAMESZ, ra) | |||
51 | REG_S s0,O32_FRAMESZ-11*SZREG(sp) | 60 | REG_S s0,O32_FRAMESZ-11*SZREG(sp) |
52 | 61 | ||
53 | move jp,a0 | 62 | move jp,a0 |
54 | REG_SUBU s0,a1,O32_FRAMESZ_NEW | 63 | |
55 | REG_S sp,O32_FRAMESZ_NEW-1*SZREG(s0) | 64 | move fp,sp |
65 | beqz a1,0f | ||
66 | REG_SUBU fp,a1,O32_NFRAMESZ | ||
67 | 0: | ||
68 | REG_S sp,O32_NFRAMESZ-1*SZREG(fp) | ||
56 | 69 | ||
57 | sll a0,a2,zero | 70 | sll a0,a2,zero |
58 | sll a1,a3,zero | 71 | sll a1,a3,zero |
59 | sll a2,a4,zero | 72 | sll a2,a4,zero |
60 | sll a3,a5,zero | 73 | sll a3,a5,zero |
61 | sw a6,0x10(s0) | 74 | sw a6,4*O32_SZREG(fp) |
62 | sw a7,0x14(s0) | 75 | sw a7,5*O32_SZREG(fp) |
63 | 76 | ||
64 | PTR_LA t0,O32_FRAMESZ(sp) | 77 | PTR_LA t0,O32_FRAMESZ(sp) |
65 | PTR_LA t1,0x18(s0) | 78 | PTR_LA t1,6*O32_SZREG(fp) |
66 | li t2,O32_ARGC-6 | 79 | li t2,O32_ARGC-6 |
67 | 1: | 80 | 1: |
68 | lw t3,(t0) | 81 | lw t3,(t0) |
69 | REG_ADDU t0,SZREG | 82 | REG_ADDU t0,SZREG |
70 | sw t3,(t1) | 83 | sw t3,(t1) |
71 | REG_SUBU t2,1 | 84 | REG_SUBU t2,1 |
72 | REG_ADDU t1,4 | 85 | REG_ADDU t1,O32_SZREG |
73 | bnez t2,1b | 86 | bnez t2,1b |
74 | 87 | ||
75 | move sp,s0 | 88 | move sp,fp |
76 | 89 | ||
77 | jalr jp | 90 | jalr jp |
78 | 91 | ||
79 | REG_L sp,O32_FRAMESZ_NEW-1*SZREG(sp) | 92 | REG_L sp,O32_NFRAMESZ-1*SZREG(sp) |
80 | 93 | ||
81 | REG_L s0,O32_FRAMESZ-11*SZREG(sp) | 94 | REG_L s0,O32_FRAMESZ-11*SZREG(sp) |
82 | REG_L s1,O32_FRAMESZ-10*SZREG(sp) | 95 | REG_L s1,O32_FRAMESZ-10*SZREG(sp) |
diff --git a/arch/mips/fw/sni/sniprom.c b/arch/mips/fw/sni/sniprom.c index 2c2cb182af4e..6aa264b9856a 100644 --- a/arch/mips/fw/sni/sniprom.c +++ b/arch/mips/fw/sni/sniprom.c | |||
@@ -40,7 +40,8 @@ | |||
40 | 40 | ||
41 | #ifdef CONFIG_64BIT | 41 | #ifdef CONFIG_64BIT |
42 | 42 | ||
43 | static u8 o32_stk[16384]; | 43 | /* O32 stack has to be 8-byte aligned. */ |
44 | static u64 o32_stk[4096]; | ||
44 | #define O32_STK &o32_stk[sizeof(o32_stk)] | 45 | #define O32_STK &o32_stk[sizeof(o32_stk)] |
45 | 46 | ||
46 | #define __PROM_O32(fun, arg) fun arg __asm__(#fun); \ | 47 | #define __PROM_O32(fun, arg) fun arg __asm__(#fun); \ |
diff --git a/arch/mips/include/asm/cpu-info.h b/arch/mips/include/asm/cpu-info.h index dc2135be2a3a..ff2707ab3295 100644 --- a/arch/mips/include/asm/cpu-info.h +++ b/arch/mips/include/asm/cpu-info.h | |||
@@ -39,14 +39,14 @@ struct cache_desc { | |||
39 | #define MIPS_CACHE_PINDEX 0x00000020 /* Physically indexed cache */ | 39 | #define MIPS_CACHE_PINDEX 0x00000020 /* Physically indexed cache */ |
40 | 40 | ||
41 | struct cpuinfo_mips { | 41 | struct cpuinfo_mips { |
42 | unsigned int udelay_val; | 42 | unsigned long asid_cache; |
43 | unsigned int asid_cache; | ||
44 | 43 | ||
45 | /* | 44 | /* |
46 | * Capability and feature descriptor structure for MIPS CPU | 45 | * Capability and feature descriptor structure for MIPS CPU |
47 | */ | 46 | */ |
48 | unsigned long options; | 47 | unsigned long options; |
49 | unsigned long ases; | 48 | unsigned long ases; |
49 | unsigned int udelay_val; | ||
50 | unsigned int processor_id; | 50 | unsigned int processor_id; |
51 | unsigned int fpu_id; | 51 | unsigned int fpu_id; |
52 | unsigned int msa_id; | 52 | unsigned int msa_id; |
diff --git a/arch/mips/include/asm/dec/prom.h b/arch/mips/include/asm/dec/prom.h index c0ead6313845..b59a2103b61a 100644 --- a/arch/mips/include/asm/dec/prom.h +++ b/arch/mips/include/asm/dec/prom.h | |||
@@ -113,31 +113,31 @@ extern int (*__pmax_close)(int); | |||
113 | #define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \ | 113 | #define __DEC_PROM_O32(fun, arg) fun arg __asm__(#fun); \ |
114 | __asm__(#fun " = call_o32") | 114 | __asm__(#fun " = call_o32") |
115 | 115 | ||
116 | int __DEC_PROM_O32(_rex_bootinit, (int (*)(void))); | 116 | int __DEC_PROM_O32(_rex_bootinit, (int (*)(void), void *)); |
117 | int __DEC_PROM_O32(_rex_bootread, (int (*)(void))); | 117 | int __DEC_PROM_O32(_rex_bootread, (int (*)(void), void *)); |
118 | int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), memmap *)); | 118 | int __DEC_PROM_O32(_rex_getbitmap, (int (*)(memmap *), void *, memmap *)); |
119 | unsigned long *__DEC_PROM_O32(_rex_slot_address, | 119 | unsigned long *__DEC_PROM_O32(_rex_slot_address, |
120 | (unsigned long *(*)(int), int)); | 120 | (unsigned long *(*)(int), void *, int)); |
121 | void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void))); | 121 | void *__DEC_PROM_O32(_rex_gettcinfo, (void *(*)(void), void *)); |
122 | int __DEC_PROM_O32(_rex_getsysid, (int (*)(void))); | 122 | int __DEC_PROM_O32(_rex_getsysid, (int (*)(void), void *)); |
123 | void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void))); | 123 | void __DEC_PROM_O32(_rex_clear_cache, (void (*)(void), void *)); |
124 | 124 | ||
125 | int __DEC_PROM_O32(_prom_getchar, (int (*)(void))); | 125 | int __DEC_PROM_O32(_prom_getchar, (int (*)(void), void *)); |
126 | char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), char *)); | 126 | char *__DEC_PROM_O32(_prom_getenv, (char *(*)(char *), void *, char *)); |
127 | int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), char *, ...)); | 127 | int __DEC_PROM_O32(_prom_printf, (int (*)(char *, ...), void *, char *, ...)); |
128 | 128 | ||
129 | 129 | ||
130 | #define rex_bootinit() _rex_bootinit(__rex_bootinit) | 130 | #define rex_bootinit() _rex_bootinit(__rex_bootinit, NULL) |
131 | #define rex_bootread() _rex_bootread(__rex_bootread) | 131 | #define rex_bootread() _rex_bootread(__rex_bootread, NULL) |
132 | #define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, x) | 132 | #define rex_getbitmap(x) _rex_getbitmap(__rex_getbitmap, NULL, x) |
133 | #define rex_slot_address(x) _rex_slot_address(__rex_slot_address, x) | 133 | #define rex_slot_address(x) _rex_slot_address(__rex_slot_address, NULL, x) |
134 | #define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo) | 134 | #define rex_gettcinfo() _rex_gettcinfo(__rex_gettcinfo, NULL) |
135 | #define rex_getsysid() _rex_getsysid(__rex_getsysid) | 135 | #define rex_getsysid() _rex_getsysid(__rex_getsysid, NULL) |
136 | #define rex_clear_cache() _rex_clear_cache(__rex_clear_cache) | 136 | #define rex_clear_cache() _rex_clear_cache(__rex_clear_cache, NULL) |
137 | 137 | ||
138 | #define prom_getchar() _prom_getchar(__prom_getchar) | 138 | #define prom_getchar() _prom_getchar(__prom_getchar, NULL) |
139 | #define prom_getenv(x) _prom_getenv(__prom_getenv, x) | 139 | #define prom_getenv(x) _prom_getenv(__prom_getenv, NULL, x) |
140 | #define prom_printf(x...) _prom_printf(__prom_printf, x) | 140 | #define prom_printf(x...) _prom_printf(__prom_printf, NULL, x) |
141 | 141 | ||
142 | #else /* !CONFIG_64BIT */ | 142 | #else /* !CONFIG_64BIT */ |
143 | 143 | ||
diff --git a/arch/mips/include/asm/rm9k-ocd.h b/arch/mips/include/asm/rm9k-ocd.h deleted file mode 100644 index b0b80d9ecf96..000000000000 --- a/arch/mips/include/asm/rm9k-ocd.h +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 by Basler Vision Technologies AG | ||
3 | * Author: Thomas Koeller <thomas.koeller@baslerweb.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #if !defined(_ASM_RM9K_OCD_H) | ||
21 | #define _ASM_RM9K_OCD_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/spinlock.h> | ||
25 | #include <asm/io.h> | ||
26 | |||
27 | extern volatile void __iomem * const ocd_base; | ||
28 | extern volatile void __iomem * const titan_base; | ||
29 | |||
30 | #define ocd_addr(__x__) (ocd_base + (__x__)) | ||
31 | #define titan_addr(__x__) (titan_base + (__x__)) | ||
32 | #define scram_addr(__x__) (scram_base + (__x__)) | ||
33 | |||
34 | /* OCD register access */ | ||
35 | #define ocd_readl(__offs__) __raw_readl(ocd_addr(__offs__)) | ||
36 | #define ocd_readw(__offs__) __raw_readw(ocd_addr(__offs__)) | ||
37 | #define ocd_readb(__offs__) __raw_readb(ocd_addr(__offs__)) | ||
38 | #define ocd_writel(__val__, __offs__) \ | ||
39 | __raw_writel((__val__), ocd_addr(__offs__)) | ||
40 | #define ocd_writew(__val__, __offs__) \ | ||
41 | __raw_writew((__val__), ocd_addr(__offs__)) | ||
42 | #define ocd_writeb(__val__, __offs__) \ | ||
43 | __raw_writeb((__val__), ocd_addr(__offs__)) | ||
44 | |||
45 | /* TITAN register access - 32 bit-wide only */ | ||
46 | #define titan_readl(__offs__) __raw_readl(titan_addr(__offs__)) | ||
47 | #define titan_writel(__val__, __offs__) \ | ||
48 | __raw_writel((__val__), titan_addr(__offs__)) | ||
49 | |||
50 | /* Protect access to shared TITAN registers */ | ||
51 | extern spinlock_t titan_lock; | ||
52 | extern int titan_irqflags; | ||
53 | #define lock_titan_regs() spin_lock_irqsave(&titan_lock, titan_irqflags) | ||
54 | #define unlock_titan_regs() spin_unlock_irqrestore(&titan_lock, titan_irqflags) | ||
55 | |||
56 | #endif /* !defined(_ASM_RM9K_OCD_H) */ | ||
diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index c6e9cd2bca8d..17960fe7a8ce 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h | |||
@@ -133,6 +133,8 @@ static inline int syscall_get_arch(void) | |||
133 | #ifdef CONFIG_64BIT | 133 | #ifdef CONFIG_64BIT |
134 | if (!test_thread_flag(TIF_32BIT_REGS)) | 134 | if (!test_thread_flag(TIF_32BIT_REGS)) |
135 | arch |= __AUDIT_ARCH_64BIT; | 135 | arch |= __AUDIT_ARCH_64BIT; |
136 | if (test_thread_flag(TIF_32BIT_ADDR)) | ||
137 | arch |= __AUDIT_ARCH_CONVENTION_MIPS64_N32; | ||
136 | #endif | 138 | #endif |
137 | #if defined(__LITTLE_ENDIAN) | 139 | #if defined(__LITTLE_ENDIAN) |
138 | arch |= __AUDIT_ARCH_LE; | 140 | arch |= __AUDIT_ARCH_LE; |
diff --git a/arch/mips/include/uapi/asm/inst.h b/arch/mips/include/uapi/asm/inst.h index df6e775f3fef..3125797f2a88 100644 --- a/arch/mips/include/uapi/asm/inst.h +++ b/arch/mips/include/uapi/asm/inst.h | |||
@@ -484,13 +484,13 @@ enum MIPS6e_i8_func { | |||
484 | * Damn ... bitfields depend from byteorder :-( | 484 | * Damn ... bitfields depend from byteorder :-( |
485 | */ | 485 | */ |
486 | #ifdef __MIPSEB__ | 486 | #ifdef __MIPSEB__ |
487 | #define BITFIELD_FIELD(field, more) \ | 487 | #define __BITFIELD_FIELD(field, more) \ |
488 | field; \ | 488 | field; \ |
489 | more | 489 | more |
490 | 490 | ||
491 | #elif defined(__MIPSEL__) | 491 | #elif defined(__MIPSEL__) |
492 | 492 | ||
493 | #define BITFIELD_FIELD(field, more) \ | 493 | #define __BITFIELD_FIELD(field, more) \ |
494 | more \ | 494 | more \ |
495 | field; | 495 | field; |
496 | 496 | ||
@@ -499,112 +499,112 @@ enum MIPS6e_i8_func { | |||
499 | #endif | 499 | #endif |
500 | 500 | ||
501 | struct j_format { | 501 | struct j_format { |
502 | BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */ | 502 | __BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */ |
503 | BITFIELD_FIELD(unsigned int target : 26, | 503 | __BITFIELD_FIELD(unsigned int target : 26, |
504 | ;)) | 504 | ;)) |
505 | }; | 505 | }; |
506 | 506 | ||
507 | struct i_format { /* signed immediate format */ | 507 | struct i_format { /* signed immediate format */ |
508 | BITFIELD_FIELD(unsigned int opcode : 6, | 508 | __BITFIELD_FIELD(unsigned int opcode : 6, |
509 | BITFIELD_FIELD(unsigned int rs : 5, | 509 | __BITFIELD_FIELD(unsigned int rs : 5, |
510 | BITFIELD_FIELD(unsigned int rt : 5, | 510 | __BITFIELD_FIELD(unsigned int rt : 5, |
511 | BITFIELD_FIELD(signed int simmediate : 16, | 511 | __BITFIELD_FIELD(signed int simmediate : 16, |
512 | ;)))) | 512 | ;)))) |
513 | }; | 513 | }; |
514 | 514 | ||
515 | struct u_format { /* unsigned immediate format */ | 515 | struct u_format { /* unsigned immediate format */ |
516 | BITFIELD_FIELD(unsigned int opcode : 6, | 516 | __BITFIELD_FIELD(unsigned int opcode : 6, |
517 | BITFIELD_FIELD(unsigned int rs : 5, | 517 | __BITFIELD_FIELD(unsigned int rs : 5, |
518 | BITFIELD_FIELD(unsigned int rt : 5, | 518 | __BITFIELD_FIELD(unsigned int rt : 5, |
519 | BITFIELD_FIELD(unsigned int uimmediate : 16, | 519 | __BITFIELD_FIELD(unsigned int uimmediate : 16, |
520 | ;)))) | 520 | ;)))) |
521 | }; | 521 | }; |
522 | 522 | ||
523 | struct c_format { /* Cache (>= R6000) format */ | 523 | struct c_format { /* Cache (>= R6000) format */ |
524 | BITFIELD_FIELD(unsigned int opcode : 6, | 524 | __BITFIELD_FIELD(unsigned int opcode : 6, |
525 | BITFIELD_FIELD(unsigned int rs : 5, | 525 | __BITFIELD_FIELD(unsigned int rs : 5, |
526 | BITFIELD_FIELD(unsigned int c_op : 3, | 526 | __BITFIELD_FIELD(unsigned int c_op : 3, |
527 | BITFIELD_FIELD(unsigned int cache : 2, | 527 | __BITFIELD_FIELD(unsigned int cache : 2, |
528 | BITFIELD_FIELD(unsigned int simmediate : 16, | 528 | __BITFIELD_FIELD(unsigned int simmediate : 16, |
529 | ;))))) | 529 | ;))))) |
530 | }; | 530 | }; |
531 | 531 | ||
532 | struct r_format { /* Register format */ | 532 | struct r_format { /* Register format */ |
533 | BITFIELD_FIELD(unsigned int opcode : 6, | 533 | __BITFIELD_FIELD(unsigned int opcode : 6, |
534 | BITFIELD_FIELD(unsigned int rs : 5, | 534 | __BITFIELD_FIELD(unsigned int rs : 5, |
535 | BITFIELD_FIELD(unsigned int rt : 5, | 535 | __BITFIELD_FIELD(unsigned int rt : 5, |
536 | BITFIELD_FIELD(unsigned int rd : 5, | 536 | __BITFIELD_FIELD(unsigned int rd : 5, |
537 | BITFIELD_FIELD(unsigned int re : 5, | 537 | __BITFIELD_FIELD(unsigned int re : 5, |
538 | BITFIELD_FIELD(unsigned int func : 6, | 538 | __BITFIELD_FIELD(unsigned int func : 6, |
539 | ;)))))) | 539 | ;)))))) |
540 | }; | 540 | }; |
541 | 541 | ||
542 | struct p_format { /* Performance counter format (R10000) */ | 542 | struct p_format { /* Performance counter format (R10000) */ |
543 | BITFIELD_FIELD(unsigned int opcode : 6, | 543 | __BITFIELD_FIELD(unsigned int opcode : 6, |
544 | BITFIELD_FIELD(unsigned int rs : 5, | 544 | __BITFIELD_FIELD(unsigned int rs : 5, |
545 | BITFIELD_FIELD(unsigned int rt : 5, | 545 | __BITFIELD_FIELD(unsigned int rt : 5, |
546 | BITFIELD_FIELD(unsigned int rd : 5, | 546 | __BITFIELD_FIELD(unsigned int rd : 5, |
547 | BITFIELD_FIELD(unsigned int re : 5, | 547 | __BITFIELD_FIELD(unsigned int re : 5, |
548 | BITFIELD_FIELD(unsigned int func : 6, | 548 | __BITFIELD_FIELD(unsigned int func : 6, |
549 | ;)))))) | 549 | ;)))))) |
550 | }; | 550 | }; |
551 | 551 | ||
552 | struct f_format { /* FPU register format */ | 552 | struct f_format { /* FPU register format */ |
553 | BITFIELD_FIELD(unsigned int opcode : 6, | 553 | __BITFIELD_FIELD(unsigned int opcode : 6, |
554 | BITFIELD_FIELD(unsigned int : 1, | 554 | __BITFIELD_FIELD(unsigned int : 1, |
555 | BITFIELD_FIELD(unsigned int fmt : 4, | 555 | __BITFIELD_FIELD(unsigned int fmt : 4, |
556 | BITFIELD_FIELD(unsigned int rt : 5, | 556 | __BITFIELD_FIELD(unsigned int rt : 5, |
557 | BITFIELD_FIELD(unsigned int rd : 5, | 557 | __BITFIELD_FIELD(unsigned int rd : 5, |
558 | BITFIELD_FIELD(unsigned int re : 5, | 558 | __BITFIELD_FIELD(unsigned int re : 5, |
559 | BITFIELD_FIELD(unsigned int func : 6, | 559 | __BITFIELD_FIELD(unsigned int func : 6, |
560 | ;))))))) | 560 | ;))))))) |
561 | }; | 561 | }; |
562 | 562 | ||
563 | struct ma_format { /* FPU multiply and add format (MIPS IV) */ | 563 | struct ma_format { /* FPU multiply and add format (MIPS IV) */ |
564 | BITFIELD_FIELD(unsigned int opcode : 6, | 564 | __BITFIELD_FIELD(unsigned int opcode : 6, |
565 | BITFIELD_FIELD(unsigned int fr : 5, | 565 | __BITFIELD_FIELD(unsigned int fr : 5, |
566 | BITFIELD_FIELD(unsigned int ft : 5, | 566 | __BITFIELD_FIELD(unsigned int ft : 5, |
567 | BITFIELD_FIELD(unsigned int fs : 5, | 567 | __BITFIELD_FIELD(unsigned int fs : 5, |
568 | BITFIELD_FIELD(unsigned int fd : 5, | 568 | __BITFIELD_FIELD(unsigned int fd : 5, |
569 | BITFIELD_FIELD(unsigned int func : 4, | 569 | __BITFIELD_FIELD(unsigned int func : 4, |
570 | BITFIELD_FIELD(unsigned int fmt : 2, | 570 | __BITFIELD_FIELD(unsigned int fmt : 2, |
571 | ;))))))) | 571 | ;))))))) |
572 | }; | 572 | }; |
573 | 573 | ||
574 | struct b_format { /* BREAK and SYSCALL */ | 574 | struct b_format { /* BREAK and SYSCALL */ |
575 | BITFIELD_FIELD(unsigned int opcode : 6, | 575 | __BITFIELD_FIELD(unsigned int opcode : 6, |
576 | BITFIELD_FIELD(unsigned int code : 20, | 576 | __BITFIELD_FIELD(unsigned int code : 20, |
577 | BITFIELD_FIELD(unsigned int func : 6, | 577 | __BITFIELD_FIELD(unsigned int func : 6, |
578 | ;))) | 578 | ;))) |
579 | }; | 579 | }; |
580 | 580 | ||
581 | struct ps_format { /* MIPS-3D / paired single format */ | 581 | struct ps_format { /* MIPS-3D / paired single format */ |
582 | BITFIELD_FIELD(unsigned int opcode : 6, | 582 | __BITFIELD_FIELD(unsigned int opcode : 6, |
583 | BITFIELD_FIELD(unsigned int rs : 5, | 583 | __BITFIELD_FIELD(unsigned int rs : 5, |
584 | BITFIELD_FIELD(unsigned int ft : 5, | 584 | __BITFIELD_FIELD(unsigned int ft : 5, |
585 | BITFIELD_FIELD(unsigned int fs : 5, | 585 | __BITFIELD_FIELD(unsigned int fs : 5, |
586 | BITFIELD_FIELD(unsigned int fd : 5, | 586 | __BITFIELD_FIELD(unsigned int fd : 5, |
587 | BITFIELD_FIELD(unsigned int func : 6, | 587 | __BITFIELD_FIELD(unsigned int func : 6, |
588 | ;)))))) | 588 | ;)))))) |
589 | }; | 589 | }; |
590 | 590 | ||
591 | struct v_format { /* MDMX vector format */ | 591 | struct v_format { /* MDMX vector format */ |
592 | BITFIELD_FIELD(unsigned int opcode : 6, | 592 | __BITFIELD_FIELD(unsigned int opcode : 6, |
593 | BITFIELD_FIELD(unsigned int sel : 4, | 593 | __BITFIELD_FIELD(unsigned int sel : 4, |
594 | BITFIELD_FIELD(unsigned int fmt : 1, | 594 | __BITFIELD_FIELD(unsigned int fmt : 1, |
595 | BITFIELD_FIELD(unsigned int vt : 5, | 595 | __BITFIELD_FIELD(unsigned int vt : 5, |
596 | BITFIELD_FIELD(unsigned int vs : 5, | 596 | __BITFIELD_FIELD(unsigned int vs : 5, |
597 | BITFIELD_FIELD(unsigned int vd : 5, | 597 | __BITFIELD_FIELD(unsigned int vd : 5, |
598 | BITFIELD_FIELD(unsigned int func : 6, | 598 | __BITFIELD_FIELD(unsigned int func : 6, |
599 | ;))))))) | 599 | ;))))))) |
600 | }; | 600 | }; |
601 | 601 | ||
602 | struct spec3_format { /* SPEC3 */ | 602 | struct spec3_format { /* SPEC3 */ |
603 | BITFIELD_FIELD(unsigned int opcode:6, | 603 | __BITFIELD_FIELD(unsigned int opcode:6, |
604 | BITFIELD_FIELD(unsigned int rs:5, | 604 | __BITFIELD_FIELD(unsigned int rs:5, |
605 | BITFIELD_FIELD(unsigned int rt:5, | 605 | __BITFIELD_FIELD(unsigned int rt:5, |
606 | BITFIELD_FIELD(signed int simmediate:9, | 606 | __BITFIELD_FIELD(signed int simmediate:9, |
607 | BITFIELD_FIELD(unsigned int func:7, | 607 | __BITFIELD_FIELD(unsigned int func:7, |
608 | ;))))) | 608 | ;))))) |
609 | }; | 609 | }; |
610 | 610 | ||
@@ -616,141 +616,141 @@ struct spec3_format { /* SPEC3 */ | |||
616 | * if it is MIPS32 instruction re-encoded for use in the microMIPS ASE. | 616 | * if it is MIPS32 instruction re-encoded for use in the microMIPS ASE. |
617 | */ | 617 | */ |
618 | struct fb_format { /* FPU branch format (MIPS32) */ | 618 | struct fb_format { /* FPU branch format (MIPS32) */ |
619 | BITFIELD_FIELD(unsigned int opcode : 6, | 619 | __BITFIELD_FIELD(unsigned int opcode : 6, |
620 | BITFIELD_FIELD(unsigned int bc : 5, | 620 | __BITFIELD_FIELD(unsigned int bc : 5, |
621 | BITFIELD_FIELD(unsigned int cc : 3, | 621 | __BITFIELD_FIELD(unsigned int cc : 3, |
622 | BITFIELD_FIELD(unsigned int flag : 2, | 622 | __BITFIELD_FIELD(unsigned int flag : 2, |
623 | BITFIELD_FIELD(signed int simmediate : 16, | 623 | __BITFIELD_FIELD(signed int simmediate : 16, |
624 | ;))))) | 624 | ;))))) |
625 | }; | 625 | }; |
626 | 626 | ||
627 | struct fp0_format { /* FPU multiply and add format (MIPS32) */ | 627 | struct fp0_format { /* FPU multiply and add format (MIPS32) */ |
628 | BITFIELD_FIELD(unsigned int opcode : 6, | 628 | __BITFIELD_FIELD(unsigned int opcode : 6, |
629 | BITFIELD_FIELD(unsigned int fmt : 5, | 629 | __BITFIELD_FIELD(unsigned int fmt : 5, |
630 | BITFIELD_FIELD(unsigned int ft : 5, | 630 | __BITFIELD_FIELD(unsigned int ft : 5, |
631 | BITFIELD_FIELD(unsigned int fs : 5, | 631 | __BITFIELD_FIELD(unsigned int fs : 5, |
632 | BITFIELD_FIELD(unsigned int fd : 5, | 632 | __BITFIELD_FIELD(unsigned int fd : 5, |
633 | BITFIELD_FIELD(unsigned int func : 6, | 633 | __BITFIELD_FIELD(unsigned int func : 6, |
634 | ;)))))) | 634 | ;)))))) |
635 | }; | 635 | }; |
636 | 636 | ||
637 | struct mm_fp0_format { /* FPU multipy and add format (microMIPS) */ | 637 | struct mm_fp0_format { /* FPU multipy and add format (microMIPS) */ |
638 | BITFIELD_FIELD(unsigned int opcode : 6, | 638 | __BITFIELD_FIELD(unsigned int opcode : 6, |
639 | BITFIELD_FIELD(unsigned int ft : 5, | 639 | __BITFIELD_FIELD(unsigned int ft : 5, |
640 | BITFIELD_FIELD(unsigned int fs : 5, | 640 | __BITFIELD_FIELD(unsigned int fs : 5, |
641 | BITFIELD_FIELD(unsigned int fd : 5, | 641 | __BITFIELD_FIELD(unsigned int fd : 5, |
642 | BITFIELD_FIELD(unsigned int fmt : 3, | 642 | __BITFIELD_FIELD(unsigned int fmt : 3, |
643 | BITFIELD_FIELD(unsigned int op : 2, | 643 | __BITFIELD_FIELD(unsigned int op : 2, |
644 | BITFIELD_FIELD(unsigned int func : 6, | 644 | __BITFIELD_FIELD(unsigned int func : 6, |
645 | ;))))))) | 645 | ;))))))) |
646 | }; | 646 | }; |
647 | 647 | ||
648 | struct fp1_format { /* FPU mfc1 and cfc1 format (MIPS32) */ | 648 | struct fp1_format { /* FPU mfc1 and cfc1 format (MIPS32) */ |
649 | BITFIELD_FIELD(unsigned int opcode : 6, | 649 | __BITFIELD_FIELD(unsigned int opcode : 6, |
650 | BITFIELD_FIELD(unsigned int op : 5, | 650 | __BITFIELD_FIELD(unsigned int op : 5, |
651 | BITFIELD_FIELD(unsigned int rt : 5, | 651 | __BITFIELD_FIELD(unsigned int rt : 5, |
652 | BITFIELD_FIELD(unsigned int fs : 5, | 652 | __BITFIELD_FIELD(unsigned int fs : 5, |
653 | BITFIELD_FIELD(unsigned int fd : 5, | 653 | __BITFIELD_FIELD(unsigned int fd : 5, |
654 | BITFIELD_FIELD(unsigned int func : 6, | 654 | __BITFIELD_FIELD(unsigned int func : 6, |
655 | ;)))))) | 655 | ;)))))) |
656 | }; | 656 | }; |
657 | 657 | ||
658 | struct mm_fp1_format { /* FPU mfc1 and cfc1 format (microMIPS) */ | 658 | struct mm_fp1_format { /* FPU mfc1 and cfc1 format (microMIPS) */ |
659 | BITFIELD_FIELD(unsigned int opcode : 6, | 659 | __BITFIELD_FIELD(unsigned int opcode : 6, |
660 | BITFIELD_FIELD(unsigned int rt : 5, | 660 | __BITFIELD_FIELD(unsigned int rt : 5, |
661 | BITFIELD_FIELD(unsigned int fs : 5, | 661 | __BITFIELD_FIELD(unsigned int fs : 5, |
662 | BITFIELD_FIELD(unsigned int fmt : 2, | 662 | __BITFIELD_FIELD(unsigned int fmt : 2, |
663 | BITFIELD_FIELD(unsigned int op : 8, | 663 | __BITFIELD_FIELD(unsigned int op : 8, |
664 | BITFIELD_FIELD(unsigned int func : 6, | 664 | __BITFIELD_FIELD(unsigned int func : 6, |
665 | ;)))))) | 665 | ;)))))) |
666 | }; | 666 | }; |
667 | 667 | ||
668 | struct mm_fp2_format { /* FPU movt and movf format (microMIPS) */ | 668 | struct mm_fp2_format { /* FPU movt and movf format (microMIPS) */ |
669 | BITFIELD_FIELD(unsigned int opcode : 6, | 669 | __BITFIELD_FIELD(unsigned int opcode : 6, |
670 | BITFIELD_FIELD(unsigned int fd : 5, | 670 | __BITFIELD_FIELD(unsigned int fd : 5, |
671 | BITFIELD_FIELD(unsigned int fs : 5, | 671 | __BITFIELD_FIELD(unsigned int fs : 5, |
672 | BITFIELD_FIELD(unsigned int cc : 3, | 672 | __BITFIELD_FIELD(unsigned int cc : 3, |
673 | BITFIELD_FIELD(unsigned int zero : 2, | 673 | __BITFIELD_FIELD(unsigned int zero : 2, |
674 | BITFIELD_FIELD(unsigned int fmt : 2, | 674 | __BITFIELD_FIELD(unsigned int fmt : 2, |
675 | BITFIELD_FIELD(unsigned int op : 3, | 675 | __BITFIELD_FIELD(unsigned int op : 3, |
676 | BITFIELD_FIELD(unsigned int func : 6, | 676 | __BITFIELD_FIELD(unsigned int func : 6, |
677 | ;)))))))) | 677 | ;)))))))) |
678 | }; | 678 | }; |
679 | 679 | ||
680 | struct mm_fp3_format { /* FPU abs and neg format (microMIPS) */ | 680 | struct mm_fp3_format { /* FPU abs and neg format (microMIPS) */ |
681 | BITFIELD_FIELD(unsigned int opcode : 6, | 681 | __BITFIELD_FIELD(unsigned int opcode : 6, |
682 | BITFIELD_FIELD(unsigned int rt : 5, | 682 | __BITFIELD_FIELD(unsigned int rt : 5, |
683 | BITFIELD_FIELD(unsigned int fs : 5, | 683 | __BITFIELD_FIELD(unsigned int fs : 5, |
684 | BITFIELD_FIELD(unsigned int fmt : 3, | 684 | __BITFIELD_FIELD(unsigned int fmt : 3, |
685 | BITFIELD_FIELD(unsigned int op : 7, | 685 | __BITFIELD_FIELD(unsigned int op : 7, |
686 | BITFIELD_FIELD(unsigned int func : 6, | 686 | __BITFIELD_FIELD(unsigned int func : 6, |
687 | ;)))))) | 687 | ;)))))) |
688 | }; | 688 | }; |
689 | 689 | ||
690 | struct mm_fp4_format { /* FPU c.cond format (microMIPS) */ | 690 | struct mm_fp4_format { /* FPU c.cond format (microMIPS) */ |
691 | BITFIELD_FIELD(unsigned int opcode : 6, | 691 | __BITFIELD_FIELD(unsigned int opcode : 6, |
692 | BITFIELD_FIELD(unsigned int rt : 5, | 692 | __BITFIELD_FIELD(unsigned int rt : 5, |
693 | BITFIELD_FIELD(unsigned int fs : 5, | 693 | __BITFIELD_FIELD(unsigned int fs : 5, |
694 | BITFIELD_FIELD(unsigned int cc : 3, | 694 | __BITFIELD_FIELD(unsigned int cc : 3, |
695 | BITFIELD_FIELD(unsigned int fmt : 3, | 695 | __BITFIELD_FIELD(unsigned int fmt : 3, |
696 | BITFIELD_FIELD(unsigned int cond : 4, | 696 | __BITFIELD_FIELD(unsigned int cond : 4, |
697 | BITFIELD_FIELD(unsigned int func : 6, | 697 | __BITFIELD_FIELD(unsigned int func : 6, |
698 | ;))))))) | 698 | ;))))))) |
699 | }; | 699 | }; |
700 | 700 | ||
701 | struct mm_fp5_format { /* FPU lwxc1 and swxc1 format (microMIPS) */ | 701 | struct mm_fp5_format { /* FPU lwxc1 and swxc1 format (microMIPS) */ |
702 | BITFIELD_FIELD(unsigned int opcode : 6, | 702 | __BITFIELD_FIELD(unsigned int opcode : 6, |
703 | BITFIELD_FIELD(unsigned int index : 5, | 703 | __BITFIELD_FIELD(unsigned int index : 5, |
704 | BITFIELD_FIELD(unsigned int base : 5, | 704 | __BITFIELD_FIELD(unsigned int base : 5, |
705 | BITFIELD_FIELD(unsigned int fd : 5, | 705 | __BITFIELD_FIELD(unsigned int fd : 5, |
706 | BITFIELD_FIELD(unsigned int op : 5, | 706 | __BITFIELD_FIELD(unsigned int op : 5, |
707 | BITFIELD_FIELD(unsigned int func : 6, | 707 | __BITFIELD_FIELD(unsigned int func : 6, |
708 | ;)))))) | 708 | ;)))))) |
709 | }; | 709 | }; |
710 | 710 | ||
711 | struct fp6_format { /* FPU madd and msub format (MIPS IV) */ | 711 | struct fp6_format { /* FPU madd and msub format (MIPS IV) */ |
712 | BITFIELD_FIELD(unsigned int opcode : 6, | 712 | __BITFIELD_FIELD(unsigned int opcode : 6, |
713 | BITFIELD_FIELD(unsigned int fr : 5, | 713 | __BITFIELD_FIELD(unsigned int fr : 5, |
714 | BITFIELD_FIELD(unsigned int ft : 5, | 714 | __BITFIELD_FIELD(unsigned int ft : 5, |
715 | BITFIELD_FIELD(unsigned int fs : 5, | 715 | __BITFIELD_FIELD(unsigned int fs : 5, |
716 | BITFIELD_FIELD(unsigned int fd : 5, | 716 | __BITFIELD_FIELD(unsigned int fd : 5, |
717 | BITFIELD_FIELD(unsigned int func : 6, | 717 | __BITFIELD_FIELD(unsigned int func : 6, |
718 | ;)))))) | 718 | ;)))))) |
719 | }; | 719 | }; |
720 | 720 | ||
721 | struct mm_fp6_format { /* FPU madd and msub format (microMIPS) */ | 721 | struct mm_fp6_format { /* FPU madd and msub format (microMIPS) */ |
722 | BITFIELD_FIELD(unsigned int opcode : 6, | 722 | __BITFIELD_FIELD(unsigned int opcode : 6, |
723 | BITFIELD_FIELD(unsigned int ft : 5, | 723 | __BITFIELD_FIELD(unsigned int ft : 5, |
724 | BITFIELD_FIELD(unsigned int fs : 5, | 724 | __BITFIELD_FIELD(unsigned int fs : 5, |
725 | BITFIELD_FIELD(unsigned int fd : 5, | 725 | __BITFIELD_FIELD(unsigned int fd : 5, |
726 | BITFIELD_FIELD(unsigned int fr : 5, | 726 | __BITFIELD_FIELD(unsigned int fr : 5, |
727 | BITFIELD_FIELD(unsigned int func : 6, | 727 | __BITFIELD_FIELD(unsigned int func : 6, |
728 | ;)))))) | 728 | ;)))))) |
729 | }; | 729 | }; |
730 | 730 | ||
731 | struct mm_i_format { /* Immediate format (microMIPS) */ | 731 | struct mm_i_format { /* Immediate format (microMIPS) */ |
732 | BITFIELD_FIELD(unsigned int opcode : 6, | 732 | __BITFIELD_FIELD(unsigned int opcode : 6, |
733 | BITFIELD_FIELD(unsigned int rt : 5, | 733 | __BITFIELD_FIELD(unsigned int rt : 5, |
734 | BITFIELD_FIELD(unsigned int rs : 5, | 734 | __BITFIELD_FIELD(unsigned int rs : 5, |
735 | BITFIELD_FIELD(signed int simmediate : 16, | 735 | __BITFIELD_FIELD(signed int simmediate : 16, |
736 | ;)))) | 736 | ;)))) |
737 | }; | 737 | }; |
738 | 738 | ||
739 | struct mm_m_format { /* Multi-word load/store format (microMIPS) */ | 739 | struct mm_m_format { /* Multi-word load/store format (microMIPS) */ |
740 | BITFIELD_FIELD(unsigned int opcode : 6, | 740 | __BITFIELD_FIELD(unsigned int opcode : 6, |
741 | BITFIELD_FIELD(unsigned int rd : 5, | 741 | __BITFIELD_FIELD(unsigned int rd : 5, |
742 | BITFIELD_FIELD(unsigned int base : 5, | 742 | __BITFIELD_FIELD(unsigned int base : 5, |
743 | BITFIELD_FIELD(unsigned int func : 4, | 743 | __BITFIELD_FIELD(unsigned int func : 4, |
744 | BITFIELD_FIELD(signed int simmediate : 12, | 744 | __BITFIELD_FIELD(signed int simmediate : 12, |
745 | ;))))) | 745 | ;))))) |
746 | }; | 746 | }; |
747 | 747 | ||
748 | struct mm_x_format { /* Scaled indexed load format (microMIPS) */ | 748 | struct mm_x_format { /* Scaled indexed load format (microMIPS) */ |
749 | BITFIELD_FIELD(unsigned int opcode : 6, | 749 | __BITFIELD_FIELD(unsigned int opcode : 6, |
750 | BITFIELD_FIELD(unsigned int index : 5, | 750 | __BITFIELD_FIELD(unsigned int index : 5, |
751 | BITFIELD_FIELD(unsigned int base : 5, | 751 | __BITFIELD_FIELD(unsigned int base : 5, |
752 | BITFIELD_FIELD(unsigned int rd : 5, | 752 | __BITFIELD_FIELD(unsigned int rd : 5, |
753 | BITFIELD_FIELD(unsigned int func : 11, | 753 | __BITFIELD_FIELD(unsigned int func : 11, |
754 | ;))))) | 754 | ;))))) |
755 | }; | 755 | }; |
756 | 756 | ||
@@ -758,51 +758,51 @@ struct mm_x_format { /* Scaled indexed load format (microMIPS) */ | |||
758 | * microMIPS instruction formats (16-bit length) | 758 | * microMIPS instruction formats (16-bit length) |
759 | */ | 759 | */ |
760 | struct mm_b0_format { /* Unconditional branch format (microMIPS) */ | 760 | struct mm_b0_format { /* Unconditional branch format (microMIPS) */ |
761 | BITFIELD_FIELD(unsigned int opcode : 6, | 761 | __BITFIELD_FIELD(unsigned int opcode : 6, |
762 | BITFIELD_FIELD(signed int simmediate : 10, | 762 | __BITFIELD_FIELD(signed int simmediate : 10, |
763 | BITFIELD_FIELD(unsigned int : 16, /* Ignored */ | 763 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
764 | ;))) | 764 | ;))) |
765 | }; | 765 | }; |
766 | 766 | ||
767 | struct mm_b1_format { /* Conditional branch format (microMIPS) */ | 767 | struct mm_b1_format { /* Conditional branch format (microMIPS) */ |
768 | BITFIELD_FIELD(unsigned int opcode : 6, | 768 | __BITFIELD_FIELD(unsigned int opcode : 6, |
769 | BITFIELD_FIELD(unsigned int rs : 3, | 769 | __BITFIELD_FIELD(unsigned int rs : 3, |
770 | BITFIELD_FIELD(signed int simmediate : 7, | 770 | __BITFIELD_FIELD(signed int simmediate : 7, |
771 | BITFIELD_FIELD(unsigned int : 16, /* Ignored */ | 771 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
772 | ;)))) | 772 | ;)))) |
773 | }; | 773 | }; |
774 | 774 | ||
775 | struct mm16_m_format { /* Multi-word load/store format */ | 775 | struct mm16_m_format { /* Multi-word load/store format */ |
776 | BITFIELD_FIELD(unsigned int opcode : 6, | 776 | __BITFIELD_FIELD(unsigned int opcode : 6, |
777 | BITFIELD_FIELD(unsigned int func : 4, | 777 | __BITFIELD_FIELD(unsigned int func : 4, |
778 | BITFIELD_FIELD(unsigned int rlist : 2, | 778 | __BITFIELD_FIELD(unsigned int rlist : 2, |
779 | BITFIELD_FIELD(unsigned int imm : 4, | 779 | __BITFIELD_FIELD(unsigned int imm : 4, |
780 | BITFIELD_FIELD(unsigned int : 16, /* Ignored */ | 780 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
781 | ;))))) | 781 | ;))))) |
782 | }; | 782 | }; |
783 | 783 | ||
784 | struct mm16_rb_format { /* Signed immediate format */ | 784 | struct mm16_rb_format { /* Signed immediate format */ |
785 | BITFIELD_FIELD(unsigned int opcode : 6, | 785 | __BITFIELD_FIELD(unsigned int opcode : 6, |
786 | BITFIELD_FIELD(unsigned int rt : 3, | 786 | __BITFIELD_FIELD(unsigned int rt : 3, |
787 | BITFIELD_FIELD(unsigned int base : 3, | 787 | __BITFIELD_FIELD(unsigned int base : 3, |
788 | BITFIELD_FIELD(signed int simmediate : 4, | 788 | __BITFIELD_FIELD(signed int simmediate : 4, |
789 | BITFIELD_FIELD(unsigned int : 16, /* Ignored */ | 789 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
790 | ;))))) | 790 | ;))))) |
791 | }; | 791 | }; |
792 | 792 | ||
793 | struct mm16_r3_format { /* Load from global pointer format */ | 793 | struct mm16_r3_format { /* Load from global pointer format */ |
794 | BITFIELD_FIELD(unsigned int opcode : 6, | 794 | __BITFIELD_FIELD(unsigned int opcode : 6, |
795 | BITFIELD_FIELD(unsigned int rt : 3, | 795 | __BITFIELD_FIELD(unsigned int rt : 3, |
796 | BITFIELD_FIELD(signed int simmediate : 7, | 796 | __BITFIELD_FIELD(signed int simmediate : 7, |
797 | BITFIELD_FIELD(unsigned int : 16, /* Ignored */ | 797 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
798 | ;)))) | 798 | ;)))) |
799 | }; | 799 | }; |
800 | 800 | ||
801 | struct mm16_r5_format { /* Load/store from stack pointer format */ | 801 | struct mm16_r5_format { /* Load/store from stack pointer format */ |
802 | BITFIELD_FIELD(unsigned int opcode : 6, | 802 | __BITFIELD_FIELD(unsigned int opcode : 6, |
803 | BITFIELD_FIELD(unsigned int rt : 5, | 803 | __BITFIELD_FIELD(unsigned int rt : 5, |
804 | BITFIELD_FIELD(signed int simmediate : 5, | 804 | __BITFIELD_FIELD(signed int simmediate : 5, |
805 | BITFIELD_FIELD(unsigned int : 16, /* Ignored */ | 805 | __BITFIELD_FIELD(unsigned int : 16, /* Ignored */ |
806 | ;)))) | 806 | ;)))) |
807 | }; | 807 | }; |
808 | 808 | ||
@@ -810,57 +810,57 @@ struct mm16_r5_format { /* Load/store from stack pointer format */ | |||
810 | * MIPS16e instruction formats (16-bit length) | 810 | * MIPS16e instruction formats (16-bit length) |
811 | */ | 811 | */ |
812 | struct m16e_rr { | 812 | struct m16e_rr { |
813 | BITFIELD_FIELD(unsigned int opcode : 5, | 813 | __BITFIELD_FIELD(unsigned int opcode : 5, |
814 | BITFIELD_FIELD(unsigned int rx : 3, | 814 | __BITFIELD_FIELD(unsigned int rx : 3, |
815 | BITFIELD_FIELD(unsigned int nd : 1, | 815 | __BITFIELD_FIELD(unsigned int nd : 1, |
816 | BITFIELD_FIELD(unsigned int l : 1, | 816 | __BITFIELD_FIELD(unsigned int l : 1, |
817 | BITFIELD_FIELD(unsigned int ra : 1, | 817 | __BITFIELD_FIELD(unsigned int ra : 1, |
818 | BITFIELD_FIELD(unsigned int func : 5, | 818 | __BITFIELD_FIELD(unsigned int func : 5, |
819 | ;)))))) | 819 | ;)))))) |
820 | }; | 820 | }; |
821 | 821 | ||
822 | struct m16e_jal { | 822 | struct m16e_jal { |
823 | BITFIELD_FIELD(unsigned int opcode : 5, | 823 | __BITFIELD_FIELD(unsigned int opcode : 5, |
824 | BITFIELD_FIELD(unsigned int x : 1, | 824 | __BITFIELD_FIELD(unsigned int x : 1, |
825 | BITFIELD_FIELD(unsigned int imm20_16 : 5, | 825 | __BITFIELD_FIELD(unsigned int imm20_16 : 5, |
826 | BITFIELD_FIELD(signed int imm25_21 : 5, | 826 | __BITFIELD_FIELD(signed int imm25_21 : 5, |
827 | ;)))) | 827 | ;)))) |
828 | }; | 828 | }; |
829 | 829 | ||
830 | struct m16e_i64 { | 830 | struct m16e_i64 { |
831 | BITFIELD_FIELD(unsigned int opcode : 5, | 831 | __BITFIELD_FIELD(unsigned int opcode : 5, |
832 | BITFIELD_FIELD(unsigned int func : 3, | 832 | __BITFIELD_FIELD(unsigned int func : 3, |
833 | BITFIELD_FIELD(unsigned int imm : 8, | 833 | __BITFIELD_FIELD(unsigned int imm : 8, |
834 | ;))) | 834 | ;))) |
835 | }; | 835 | }; |
836 | 836 | ||
837 | struct m16e_ri64 { | 837 | struct m16e_ri64 { |
838 | BITFIELD_FIELD(unsigned int opcode : 5, | 838 | __BITFIELD_FIELD(unsigned int opcode : 5, |
839 | BITFIELD_FIELD(unsigned int func : 3, | 839 | __BITFIELD_FIELD(unsigned int func : 3, |
840 | BITFIELD_FIELD(unsigned int ry : 3, | 840 | __BITFIELD_FIELD(unsigned int ry : 3, |
841 | BITFIELD_FIELD(unsigned int imm : 5, | 841 | __BITFIELD_FIELD(unsigned int imm : 5, |
842 | ;)))) | 842 | ;)))) |
843 | }; | 843 | }; |
844 | 844 | ||
845 | struct m16e_ri { | 845 | struct m16e_ri { |
846 | BITFIELD_FIELD(unsigned int opcode : 5, | 846 | __BITFIELD_FIELD(unsigned int opcode : 5, |
847 | BITFIELD_FIELD(unsigned int rx : 3, | 847 | __BITFIELD_FIELD(unsigned int rx : 3, |
848 | BITFIELD_FIELD(unsigned int imm : 8, | 848 | __BITFIELD_FIELD(unsigned int imm : 8, |
849 | ;))) | 849 | ;))) |
850 | }; | 850 | }; |
851 | 851 | ||
852 | struct m16e_rri { | 852 | struct m16e_rri { |
853 | BITFIELD_FIELD(unsigned int opcode : 5, | 853 | __BITFIELD_FIELD(unsigned int opcode : 5, |
854 | BITFIELD_FIELD(unsigned int rx : 3, | 854 | __BITFIELD_FIELD(unsigned int rx : 3, |
855 | BITFIELD_FIELD(unsigned int ry : 3, | 855 | __BITFIELD_FIELD(unsigned int ry : 3, |
856 | BITFIELD_FIELD(unsigned int imm : 5, | 856 | __BITFIELD_FIELD(unsigned int imm : 5, |
857 | ;)))) | 857 | ;)))) |
858 | }; | 858 | }; |
859 | 859 | ||
860 | struct m16e_i8 { | 860 | struct m16e_i8 { |
861 | BITFIELD_FIELD(unsigned int opcode : 5, | 861 | __BITFIELD_FIELD(unsigned int opcode : 5, |
862 | BITFIELD_FIELD(unsigned int func : 3, | 862 | __BITFIELD_FIELD(unsigned int func : 3, |
863 | BITFIELD_FIELD(unsigned int imm : 8, | 863 | __BITFIELD_FIELD(unsigned int imm : 8, |
864 | ;))) | 864 | ;))) |
865 | }; | 865 | }; |
866 | 866 | ||
diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h index d6e154a9e6a5..5805414777e0 100644 --- a/arch/mips/include/uapi/asm/unistd.h +++ b/arch/mips/include/uapi/asm/unistd.h | |||
@@ -371,16 +371,17 @@ | |||
371 | #define __NR_finit_module (__NR_Linux + 348) | 371 | #define __NR_finit_module (__NR_Linux + 348) |
372 | #define __NR_sched_setattr (__NR_Linux + 349) | 372 | #define __NR_sched_setattr (__NR_Linux + 349) |
373 | #define __NR_sched_getattr (__NR_Linux + 350) | 373 | #define __NR_sched_getattr (__NR_Linux + 350) |
374 | #define __NR_renameat2 (__NR_Linux + 351) | ||
374 | 375 | ||
375 | /* | 376 | /* |
376 | * Offset of the last Linux o32 flavoured syscall | 377 | * Offset of the last Linux o32 flavoured syscall |
377 | */ | 378 | */ |
378 | #define __NR_Linux_syscalls 350 | 379 | #define __NR_Linux_syscalls 351 |
379 | 380 | ||
380 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ | 381 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */ |
381 | 382 | ||
382 | #define __NR_O32_Linux 4000 | 383 | #define __NR_O32_Linux 4000 |
383 | #define __NR_O32_Linux_syscalls 350 | 384 | #define __NR_O32_Linux_syscalls 351 |
384 | 385 | ||
385 | #if _MIPS_SIM == _MIPS_SIM_ABI64 | 386 | #if _MIPS_SIM == _MIPS_SIM_ABI64 |
386 | 387 | ||
@@ -699,16 +700,17 @@ | |||
699 | #define __NR_getdents64 (__NR_Linux + 308) | 700 | #define __NR_getdents64 (__NR_Linux + 308) |
700 | #define __NR_sched_setattr (__NR_Linux + 309) | 701 | #define __NR_sched_setattr (__NR_Linux + 309) |
701 | #define __NR_sched_getattr (__NR_Linux + 310) | 702 | #define __NR_sched_getattr (__NR_Linux + 310) |
703 | #define __NR_renameat2 (__NR_Linux + 311) | ||
702 | 704 | ||
703 | /* | 705 | /* |
704 | * Offset of the last Linux 64-bit flavoured syscall | 706 | * Offset of the last Linux 64-bit flavoured syscall |
705 | */ | 707 | */ |
706 | #define __NR_Linux_syscalls 310 | 708 | #define __NR_Linux_syscalls 311 |
707 | 709 | ||
708 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ | 710 | #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */ |
709 | 711 | ||
710 | #define __NR_64_Linux 5000 | 712 | #define __NR_64_Linux 5000 |
711 | #define __NR_64_Linux_syscalls 310 | 713 | #define __NR_64_Linux_syscalls 311 |
712 | 714 | ||
713 | #if _MIPS_SIM == _MIPS_SIM_NABI32 | 715 | #if _MIPS_SIM == _MIPS_SIM_NABI32 |
714 | 716 | ||
@@ -1031,15 +1033,16 @@ | |||
1031 | #define __NR_finit_module (__NR_Linux + 312) | 1033 | #define __NR_finit_module (__NR_Linux + 312) |
1032 | #define __NR_sched_setattr (__NR_Linux + 313) | 1034 | #define __NR_sched_setattr (__NR_Linux + 313) |
1033 | #define __NR_sched_getattr (__NR_Linux + 314) | 1035 | #define __NR_sched_getattr (__NR_Linux + 314) |
1036 | #define __NR_renameat2 (__NR_Linux + 315) | ||
1034 | 1037 | ||
1035 | /* | 1038 | /* |
1036 | * Offset of the last N32 flavoured syscall | 1039 | * Offset of the last N32 flavoured syscall |
1037 | */ | 1040 | */ |
1038 | #define __NR_Linux_syscalls 314 | 1041 | #define __NR_Linux_syscalls 315 |
1039 | 1042 | ||
1040 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ | 1043 | #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */ |
1041 | 1044 | ||
1042 | #define __NR_N32_Linux 6000 | 1045 | #define __NR_N32_Linux 6000 |
1043 | #define __NR_N32_Linux_syscalls 314 | 1046 | #define __NR_N32_Linux_syscalls 315 |
1044 | 1047 | ||
1045 | #endif /* _UAPI_ASM_UNISTD_H */ | 1048 | #endif /* _UAPI_ASM_UNISTD_H */ |
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c index 4d78bf445a9c..76122ff5cb5e 100644 --- a/arch/mips/kernel/branch.c +++ b/arch/mips/kernel/branch.c | |||
@@ -317,7 +317,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, | |||
317 | if (regs->regs[insn.i_format.rs] == | 317 | if (regs->regs[insn.i_format.rs] == |
318 | regs->regs[insn.i_format.rt]) { | 318 | regs->regs[insn.i_format.rt]) { |
319 | epc = epc + 4 + (insn.i_format.simmediate << 2); | 319 | epc = epc + 4 + (insn.i_format.simmediate << 2); |
320 | if (insn.i_format.rt == beql_op) | 320 | if (insn.i_format.opcode == beql_op) |
321 | ret = BRANCH_LIKELY_TAKEN; | 321 | ret = BRANCH_LIKELY_TAKEN; |
322 | } else | 322 | } else |
323 | epc += 8; | 323 | epc += 8; |
@@ -329,7 +329,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, | |||
329 | if (regs->regs[insn.i_format.rs] != | 329 | if (regs->regs[insn.i_format.rs] != |
330 | regs->regs[insn.i_format.rt]) { | 330 | regs->regs[insn.i_format.rt]) { |
331 | epc = epc + 4 + (insn.i_format.simmediate << 2); | 331 | epc = epc + 4 + (insn.i_format.simmediate << 2); |
332 | if (insn.i_format.rt == bnel_op) | 332 | if (insn.i_format.opcode == bnel_op) |
333 | ret = BRANCH_LIKELY_TAKEN; | 333 | ret = BRANCH_LIKELY_TAKEN; |
334 | } else | 334 | } else |
335 | epc += 8; | 335 | epc += 8; |
@@ -341,7 +341,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, | |||
341 | /* rt field assumed to be zero */ | 341 | /* rt field assumed to be zero */ |
342 | if ((long)regs->regs[insn.i_format.rs] <= 0) { | 342 | if ((long)regs->regs[insn.i_format.rs] <= 0) { |
343 | epc = epc + 4 + (insn.i_format.simmediate << 2); | 343 | epc = epc + 4 + (insn.i_format.simmediate << 2); |
344 | if (insn.i_format.rt == bnel_op) | 344 | if (insn.i_format.opcode == blezl_op) |
345 | ret = BRANCH_LIKELY_TAKEN; | 345 | ret = BRANCH_LIKELY_TAKEN; |
346 | } else | 346 | } else |
347 | epc += 8; | 347 | epc += 8; |
@@ -353,7 +353,7 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, | |||
353 | /* rt field assumed to be zero */ | 353 | /* rt field assumed to be zero */ |
354 | if ((long)regs->regs[insn.i_format.rs] > 0) { | 354 | if ((long)regs->regs[insn.i_format.rs] > 0) { |
355 | epc = epc + 4 + (insn.i_format.simmediate << 2); | 355 | epc = epc + 4 + (insn.i_format.simmediate << 2); |
356 | if (insn.i_format.rt == bnel_op) | 356 | if (insn.i_format.opcode == bgtzl_op) |
357 | ret = BRANCH_LIKELY_TAKEN; | 357 | ret = BRANCH_LIKELY_TAKEN; |
358 | } else | 358 | } else |
359 | epc += 8; | 359 | epc += 8; |
diff --git a/arch/mips/kernel/proc.c b/arch/mips/kernel/proc.c index e40971b51d2f..037a44d962f3 100644 --- a/arch/mips/kernel/proc.c +++ b/arch/mips/kernel/proc.c | |||
@@ -124,14 +124,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
124 | seq_printf(m, "kscratch registers\t: %d\n", | 124 | seq_printf(m, "kscratch registers\t: %d\n", |
125 | hweight8(cpu_data[n].kscratch_mask)); | 125 | hweight8(cpu_data[n].kscratch_mask)); |
126 | seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core); | 126 | seq_printf(m, "core\t\t\t: %d\n", cpu_data[n].core); |
127 | #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC) | 127 | |
128 | if (cpu_has_mipsmt) { | ||
129 | seq_printf(m, "VPE\t\t\t: %d\n", cpu_data[n].vpe_id); | ||
130 | #if defined(CONFIG_MIPS_MT_SMTC) | ||
131 | seq_printf(m, "TC\t\t\t: %d\n", cpu_data[n].tc_id); | ||
132 | #endif | ||
133 | } | ||
134 | #endif | ||
135 | sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", | 128 | sprintf(fmt, "VCE%%c exceptions\t\t: %s\n", |
136 | cpu_has_vce ? "%u" : "not available"); | 129 | cpu_has_vce ? "%u" : "not available"); |
137 | seq_printf(m, fmt, 'D', vced_count); | 130 | seq_printf(m, fmt, 'D', vced_count); |
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 71f85f427034..f639ccd5060c 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -163,7 +163,7 @@ int ptrace_get_watch_regs(struct task_struct *child, | |||
163 | enum pt_watch_style style; | 163 | enum pt_watch_style style; |
164 | int i; | 164 | int i; |
165 | 165 | ||
166 | if (!cpu_has_watch || current_cpu_data.watch_reg_use_cnt == 0) | 166 | if (!cpu_has_watch || boot_cpu_data.watch_reg_use_cnt == 0) |
167 | return -EIO; | 167 | return -EIO; |
168 | if (!access_ok(VERIFY_WRITE, addr, sizeof(struct pt_watch_regs))) | 168 | if (!access_ok(VERIFY_WRITE, addr, sizeof(struct pt_watch_regs))) |
169 | return -EIO; | 169 | return -EIO; |
@@ -177,14 +177,14 @@ int ptrace_get_watch_regs(struct task_struct *child, | |||
177 | #endif | 177 | #endif |
178 | 178 | ||
179 | __put_user(style, &addr->style); | 179 | __put_user(style, &addr->style); |
180 | __put_user(current_cpu_data.watch_reg_use_cnt, | 180 | __put_user(boot_cpu_data.watch_reg_use_cnt, |
181 | &addr->WATCH_STYLE.num_valid); | 181 | &addr->WATCH_STYLE.num_valid); |
182 | for (i = 0; i < current_cpu_data.watch_reg_use_cnt; i++) { | 182 | for (i = 0; i < boot_cpu_data.watch_reg_use_cnt; i++) { |
183 | __put_user(child->thread.watch.mips3264.watchlo[i], | 183 | __put_user(child->thread.watch.mips3264.watchlo[i], |
184 | &addr->WATCH_STYLE.watchlo[i]); | 184 | &addr->WATCH_STYLE.watchlo[i]); |
185 | __put_user(child->thread.watch.mips3264.watchhi[i] & 0xfff, | 185 | __put_user(child->thread.watch.mips3264.watchhi[i] & 0xfff, |
186 | &addr->WATCH_STYLE.watchhi[i]); | 186 | &addr->WATCH_STYLE.watchhi[i]); |
187 | __put_user(current_cpu_data.watch_reg_masks[i], | 187 | __put_user(boot_cpu_data.watch_reg_masks[i], |
188 | &addr->WATCH_STYLE.watch_masks[i]); | 188 | &addr->WATCH_STYLE.watch_masks[i]); |
189 | } | 189 | } |
190 | for (; i < 8; i++) { | 190 | for (; i < 8; i++) { |
@@ -204,12 +204,12 @@ int ptrace_set_watch_regs(struct task_struct *child, | |||
204 | unsigned long lt[NUM_WATCH_REGS]; | 204 | unsigned long lt[NUM_WATCH_REGS]; |
205 | u16 ht[NUM_WATCH_REGS]; | 205 | u16 ht[NUM_WATCH_REGS]; |
206 | 206 | ||
207 | if (!cpu_has_watch || current_cpu_data.watch_reg_use_cnt == 0) | 207 | if (!cpu_has_watch || boot_cpu_data.watch_reg_use_cnt == 0) |
208 | return -EIO; | 208 | return -EIO; |
209 | if (!access_ok(VERIFY_READ, addr, sizeof(struct pt_watch_regs))) | 209 | if (!access_ok(VERIFY_READ, addr, sizeof(struct pt_watch_regs))) |
210 | return -EIO; | 210 | return -EIO; |
211 | /* Check the values. */ | 211 | /* Check the values. */ |
212 | for (i = 0; i < current_cpu_data.watch_reg_use_cnt; i++) { | 212 | for (i = 0; i < boot_cpu_data.watch_reg_use_cnt; i++) { |
213 | __get_user(lt[i], &addr->WATCH_STYLE.watchlo[i]); | 213 | __get_user(lt[i], &addr->WATCH_STYLE.watchlo[i]); |
214 | #ifdef CONFIG_32BIT | 214 | #ifdef CONFIG_32BIT |
215 | if (lt[i] & __UA_LIMIT) | 215 | if (lt[i] & __UA_LIMIT) |
@@ -228,7 +228,7 @@ int ptrace_set_watch_regs(struct task_struct *child, | |||
228 | return -EINVAL; | 228 | return -EINVAL; |
229 | } | 229 | } |
230 | /* Install them. */ | 230 | /* Install them. */ |
231 | for (i = 0; i < current_cpu_data.watch_reg_use_cnt; i++) { | 231 | for (i = 0; i < boot_cpu_data.watch_reg_use_cnt; i++) { |
232 | if (lt[i] & 7) | 232 | if (lt[i] & 7) |
233 | watch_active = 1; | 233 | watch_active = 1; |
234 | child->thread.watch.mips3264.watchlo[i] = lt[i]; | 234 | child->thread.watch.mips3264.watchlo[i] = lt[i]; |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index fdc70b400442..3245474f19d5 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -577,3 +577,4 @@ EXPORT(sys_call_table) | |||
577 | PTR sys_finit_module | 577 | PTR sys_finit_module |
578 | PTR sys_sched_setattr | 578 | PTR sys_sched_setattr |
579 | PTR sys_sched_getattr /* 4350 */ | 579 | PTR sys_sched_getattr /* 4350 */ |
580 | PTR sys_renameat2 | ||
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index dd99c3285aea..be2fedd4ae33 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -430,4 +430,5 @@ EXPORT(sys_call_table) | |||
430 | PTR sys_getdents64 | 430 | PTR sys_getdents64 |
431 | PTR sys_sched_setattr | 431 | PTR sys_sched_setattr |
432 | PTR sys_sched_getattr /* 5310 */ | 432 | PTR sys_sched_getattr /* 5310 */ |
433 | PTR sys_renameat2 | ||
433 | .size sys_call_table,.-sys_call_table | 434 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index f68d2f4f0090..c1dbcda4b816 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -423,4 +423,5 @@ EXPORT(sysn32_call_table) | |||
423 | PTR sys_finit_module | 423 | PTR sys_finit_module |
424 | PTR sys_sched_setattr | 424 | PTR sys_sched_setattr |
425 | PTR sys_sched_getattr | 425 | PTR sys_sched_getattr |
426 | PTR sys_renameat2 /* 6315 */ | ||
426 | .size sysn32_call_table,.-sysn32_call_table | 427 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 70f6acecd928..f1343ccd7ed7 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -556,4 +556,5 @@ EXPORT(sys32_call_table) | |||
556 | PTR sys_finit_module | 556 | PTR sys_finit_module |
557 | PTR sys_sched_setattr | 557 | PTR sys_sched_setattr |
558 | PTR sys_sched_getattr /* 4350 */ | 558 | PTR sys_sched_getattr /* 4350 */ |
559 | PTR sys_renameat2 | ||
559 | .size sys32_call_table,.-sys32_call_table | 560 | .size sys32_call_table,.-sys32_call_table |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 074e857ced28..8119ac2fdfc9 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -1545,7 +1545,7 @@ asmlinkage void cache_parity_error(void) | |||
1545 | reg_val & (1<<30) ? "secondary" : "primary", | 1545 | reg_val & (1<<30) ? "secondary" : "primary", |
1546 | reg_val & (1<<31) ? "data" : "insn"); | 1546 | reg_val & (1<<31) ? "data" : "insn"); |
1547 | if (cpu_has_mips_r2 && | 1547 | if (cpu_has_mips_r2 && |
1548 | ((current_cpu_data.processor_id && 0xff0000) == PRID_COMP_MIPS)) { | 1548 | ((current_cpu_data.processor_id & 0xff0000) == PRID_COMP_MIPS)) { |
1549 | pr_err("Error bits: %s%s%s%s%s%s%s%s\n", | 1549 | pr_err("Error bits: %s%s%s%s%s%s%s%s\n", |
1550 | reg_val & (1<<29) ? "ED " : "", | 1550 | reg_val & (1<<29) ? "ED " : "", |
1551 | reg_val & (1<<28) ? "ET " : "", | 1551 | reg_val & (1<<28) ? "ET " : "", |
@@ -1585,7 +1585,7 @@ asmlinkage void do_ftlb(void) | |||
1585 | 1585 | ||
1586 | /* For the moment, report the problem and hang. */ | 1586 | /* For the moment, report the problem and hang. */ |
1587 | if (cpu_has_mips_r2 && | 1587 | if (cpu_has_mips_r2 && |
1588 | ((current_cpu_data.processor_id && 0xff0000) == PRID_COMP_MIPS)) { | 1588 | ((current_cpu_data.processor_id & 0xff0000) == PRID_COMP_MIPS)) { |
1589 | pr_err("FTLB error exception, cp0_ecc=0x%08x:\n", | 1589 | pr_err("FTLB error exception, cp0_ecc=0x%08x:\n", |
1590 | read_c0_ecc()); | 1590 | read_c0_ecc()); |
1591 | pr_err("cp0_errorepc == %0*lx\n", field, read_c0_errorepc()); | 1591 | pr_err("cp0_errorepc == %0*lx\n", field, read_c0_errorepc()); |
diff --git a/arch/mips/lantiq/dts/easy50712.dts b/arch/mips/lantiq/dts/easy50712.dts index fac1f5b178eb..143b8a37b5e4 100644 --- a/arch/mips/lantiq/dts/easy50712.dts +++ b/arch/mips/lantiq/dts/easy50712.dts | |||
@@ -8,6 +8,7 @@ | |||
8 | }; | 8 | }; |
9 | 9 | ||
10 | memory@0 { | 10 | memory@0 { |
11 | device_type = "memory"; | ||
11 | reg = <0x0 0x2000000>; | 12 | reg = <0x0 0x2000000>; |
12 | }; | 13 | }; |
13 | 14 | ||
diff --git a/arch/mips/lib/csum_partial.S b/arch/mips/lib/csum_partial.S index 2e4825e48388..9901237563c5 100644 --- a/arch/mips/lib/csum_partial.S +++ b/arch/mips/lib/csum_partial.S | |||
@@ -56,14 +56,20 @@ | |||
56 | #define UNIT(unit) ((unit)*NBYTES) | 56 | #define UNIT(unit) ((unit)*NBYTES) |
57 | 57 | ||
58 | #define ADDC(sum,reg) \ | 58 | #define ADDC(sum,reg) \ |
59 | .set push; \ | ||
60 | .set noat; \ | ||
59 | ADD sum, reg; \ | 61 | ADD sum, reg; \ |
60 | sltu v1, sum, reg; \ | 62 | sltu v1, sum, reg; \ |
61 | ADD sum, v1; \ | 63 | ADD sum, v1; \ |
64 | .set pop | ||
62 | 65 | ||
63 | #define ADDC32(sum,reg) \ | 66 | #define ADDC32(sum,reg) \ |
67 | .set push; \ | ||
68 | .set noat; \ | ||
64 | addu sum, reg; \ | 69 | addu sum, reg; \ |
65 | sltu v1, sum, reg; \ | 70 | sltu v1, sum, reg; \ |
66 | addu sum, v1; \ | 71 | addu sum, v1; \ |
72 | .set pop | ||
67 | 73 | ||
68 | #define CSUM_BIGCHUNK1(src, offset, sum, _t0, _t1, _t2, _t3) \ | 74 | #define CSUM_BIGCHUNK1(src, offset, sum, _t0, _t1, _t2, _t3) \ |
69 | LOAD _t0, (offset + UNIT(0))(src); \ | 75 | LOAD _t0, (offset + UNIT(0))(src); \ |
@@ -710,6 +716,8 @@ LEAF(csum_partial) | |||
710 | ADDC(sum, t2) | 716 | ADDC(sum, t2) |
711 | .Ldone\@: | 717 | .Ldone\@: |
712 | /* fold checksum */ | 718 | /* fold checksum */ |
719 | .set push | ||
720 | .set noat | ||
713 | #ifdef USE_DOUBLE | 721 | #ifdef USE_DOUBLE |
714 | dsll32 v1, sum, 0 | 722 | dsll32 v1, sum, 0 |
715 | daddu sum, v1 | 723 | daddu sum, v1 |
@@ -732,6 +740,7 @@ LEAF(csum_partial) | |||
732 | or sum, sum, t0 | 740 | or sum, sum, t0 |
733 | 1: | 741 | 1: |
734 | #endif | 742 | #endif |
743 | .set pop | ||
735 | .set reorder | 744 | .set reorder |
736 | ADDC32(sum, psum) | 745 | ADDC32(sum, psum) |
737 | jr ra | 746 | jr ra |
diff --git a/arch/mips/lib/delay.c b/arch/mips/lib/delay.c index 44713af15a62..705cfb7c1a74 100644 --- a/arch/mips/lib/delay.c +++ b/arch/mips/lib/delay.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * Copyright (C) 1994 by Waldorf Electronics | 6 | * Copyright (C) 1994 by Waldorf Electronics |
7 | * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle | 7 | * Copyright (C) 1995 - 2000, 01, 03 by Ralf Baechle |
8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. | 8 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
9 | * Copyright (C) 2007 Maciej W. Rozycki | 9 | * Copyright (C) 2007, 2014 Maciej W. Rozycki |
10 | */ | 10 | */ |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/param.h> | 12 | #include <linux/param.h> |
@@ -15,6 +15,12 @@ | |||
15 | #include <asm/compiler.h> | 15 | #include <asm/compiler.h> |
16 | #include <asm/war.h> | 16 | #include <asm/war.h> |
17 | 17 | ||
18 | #ifndef CONFIG_CPU_DADDI_WORKAROUNDS | ||
19 | #define GCC_DADDI_IMM_ASM() "I" | ||
20 | #else | ||
21 | #define GCC_DADDI_IMM_ASM() "r" | ||
22 | #endif | ||
23 | |||
18 | void __delay(unsigned long loops) | 24 | void __delay(unsigned long loops) |
19 | { | 25 | { |
20 | __asm__ __volatile__ ( | 26 | __asm__ __volatile__ ( |
@@ -22,13 +28,13 @@ void __delay(unsigned long loops) | |||
22 | " .align 3 \n" | 28 | " .align 3 \n" |
23 | "1: bnez %0, 1b \n" | 29 | "1: bnez %0, 1b \n" |
24 | #if BITS_PER_LONG == 32 | 30 | #if BITS_PER_LONG == 32 |
25 | " subu %0, 1 \n" | 31 | " subu %0, %1 \n" |
26 | #else | 32 | #else |
27 | " dsubu %0, 1 \n" | 33 | " dsubu %0, %1 \n" |
28 | #endif | 34 | #endif |
29 | " .set reorder \n" | 35 | " .set reorder \n" |
30 | : "=r" (loops) | 36 | : "=r" (loops) |
31 | : "0" (loops)); | 37 | : GCC_DADDI_IMM_ASM() (1), "0" (loops)); |
32 | } | 38 | } |
33 | EXPORT_SYMBOL(__delay); | 39 | EXPORT_SYMBOL(__delay); |
34 | 40 | ||
diff --git a/arch/mips/lib/strncpy_user.S b/arch/mips/lib/strncpy_user.S index d3301cd1e9a5..3c32baf8b494 100644 --- a/arch/mips/lib/strncpy_user.S +++ b/arch/mips/lib/strncpy_user.S | |||
@@ -35,7 +35,6 @@ LEAF(__strncpy_from_\func\()_asm) | |||
35 | bnez v0, .Lfault\@ | 35 | bnez v0, .Lfault\@ |
36 | 36 | ||
37 | FEXPORT(__strncpy_from_\func\()_nocheck_asm) | 37 | FEXPORT(__strncpy_from_\func\()_nocheck_asm) |
38 | .set noreorder | ||
39 | move t0, zero | 38 | move t0, zero |
40 | move v1, a1 | 39 | move v1, a1 |
41 | .ifeqs "\func","kernel" | 40 | .ifeqs "\func","kernel" |
@@ -45,21 +44,21 @@ FEXPORT(__strncpy_from_\func\()_nocheck_asm) | |||
45 | .endif | 44 | .endif |
46 | PTR_ADDIU v1, 1 | 45 | PTR_ADDIU v1, 1 |
47 | R10KCBARRIER(0(ra)) | 46 | R10KCBARRIER(0(ra)) |
47 | sb v0, (a0) | ||
48 | beqz v0, 2f | 48 | beqz v0, 2f |
49 | sb v0, (a0) | ||
50 | PTR_ADDIU t0, 1 | 49 | PTR_ADDIU t0, 1 |
50 | PTR_ADDIU a0, 1 | ||
51 | bne t0, a2, 1b | 51 | bne t0, a2, 1b |
52 | PTR_ADDIU a0, 1 | ||
53 | 2: PTR_ADDU v0, a1, t0 | 52 | 2: PTR_ADDU v0, a1, t0 |
54 | xor v0, a1 | 53 | xor v0, a1 |
55 | bltz v0, .Lfault\@ | 54 | bltz v0, .Lfault\@ |
56 | nop | 55 | move v0, t0 |
57 | jr ra # return n | 56 | jr ra # return n |
58 | move v0, t0 | ||
59 | END(__strncpy_from_\func\()_asm) | 57 | END(__strncpy_from_\func\()_asm) |
60 | 58 | ||
61 | .Lfault\@: jr ra | 59 | .Lfault\@: |
62 | li v0, -EFAULT | 60 | li v0, -EFAULT |
61 | jr ra | ||
63 | 62 | ||
64 | .section __ex_table,"a" | 63 | .section __ex_table,"a" |
65 | PTR 1b, .Lfault\@ | 64 | PTR 1b, .Lfault\@ |
diff --git a/arch/mips/loongson/Kconfig b/arch/mips/loongson/Kconfig index 7397be226a06..603d79a95f47 100644 --- a/arch/mips/loongson/Kconfig +++ b/arch/mips/loongson/Kconfig | |||
@@ -64,7 +64,6 @@ config LEMOTE_MACH3A | |||
64 | bool "Lemote Loongson 3A family machines" | 64 | bool "Lemote Loongson 3A family machines" |
65 | select ARCH_SPARSEMEM_ENABLE | 65 | select ARCH_SPARSEMEM_ENABLE |
66 | select GENERIC_ISA_DMA_SUPPORT_BROKEN | 66 | select GENERIC_ISA_DMA_SUPPORT_BROKEN |
67 | select GENERIC_HARDIRQS_NO__DO_IRQ | ||
68 | select BOOT_ELF32 | 67 | select BOOT_ELF32 |
69 | select BOARD_SCACHE | 68 | select BOARD_SCACHE |
70 | select CSRC_R4K | 69 | select CSRC_R4K |
diff --git a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c index c639b9db0012..12c75db23420 100644 --- a/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c +++ b/arch/mips/loongson/common/cs5536/cs5536_mfgpt.c | |||
@@ -27,8 +27,7 @@ | |||
27 | 27 | ||
28 | #include <cs5536/cs5536_mfgpt.h> | 28 | #include <cs5536/cs5536_mfgpt.h> |
29 | 29 | ||
30 | DEFINE_SPINLOCK(mfgpt_lock); | 30 | static DEFINE_RAW_SPINLOCK(mfgpt_lock); |
31 | EXPORT_SYMBOL(mfgpt_lock); | ||
32 | 31 | ||
33 | static u32 mfgpt_base; | 32 | static u32 mfgpt_base; |
34 | 33 | ||
@@ -55,7 +54,7 @@ EXPORT_SYMBOL(enable_mfgpt0_counter); | |||
55 | static void init_mfgpt_timer(enum clock_event_mode mode, | 54 | static void init_mfgpt_timer(enum clock_event_mode mode, |
56 | struct clock_event_device *evt) | 55 | struct clock_event_device *evt) |
57 | { | 56 | { |
58 | spin_lock(&mfgpt_lock); | 57 | raw_spin_lock(&mfgpt_lock); |
59 | 58 | ||
60 | switch (mode) { | 59 | switch (mode) { |
61 | case CLOCK_EVT_MODE_PERIODIC: | 60 | case CLOCK_EVT_MODE_PERIODIC: |
@@ -79,7 +78,7 @@ static void init_mfgpt_timer(enum clock_event_mode mode, | |||
79 | /* Nothing to do here */ | 78 | /* Nothing to do here */ |
80 | break; | 79 | break; |
81 | } | 80 | } |
82 | spin_unlock(&mfgpt_lock); | 81 | raw_spin_unlock(&mfgpt_lock); |
83 | } | 82 | } |
84 | 83 | ||
85 | static struct clock_event_device mfgpt_clockevent = { | 84 | static struct clock_event_device mfgpt_clockevent = { |
@@ -157,7 +156,7 @@ static cycle_t mfgpt_read(struct clocksource *cs) | |||
157 | static int old_count; | 156 | static int old_count; |
158 | static u32 old_jifs; | 157 | static u32 old_jifs; |
159 | 158 | ||
160 | spin_lock_irqsave(&mfgpt_lock, flags); | 159 | raw_spin_lock_irqsave(&mfgpt_lock, flags); |
161 | /* | 160 | /* |
162 | * Although our caller may have the read side of xtime_lock, | 161 | * Although our caller may have the read side of xtime_lock, |
163 | * this is now a seqlock, and we are cheating in this routine | 162 | * this is now a seqlock, and we are cheating in this routine |
@@ -191,7 +190,7 @@ static cycle_t mfgpt_read(struct clocksource *cs) | |||
191 | old_count = count; | 190 | old_count = count; |
192 | old_jifs = jifs; | 191 | old_jifs = jifs; |
193 | 192 | ||
194 | spin_unlock_irqrestore(&mfgpt_lock, flags); | 193 | raw_spin_unlock_irqrestore(&mfgpt_lock, flags); |
195 | 194 | ||
196 | return (cycle_t) (jifs * COMPARE) + count; | 195 | return (cycle_t) (jifs * COMPARE) + count; |
197 | } | 196 | } |
diff --git a/arch/mips/loongson/lemote-2f/clock.c b/arch/mips/loongson/lemote-2f/clock.c index e1f427f4f5f3..67dd94ef28e6 100644 --- a/arch/mips/loongson/lemote-2f/clock.c +++ b/arch/mips/loongson/lemote-2f/clock.c | |||
@@ -91,6 +91,7 @@ EXPORT_SYMBOL(clk_put); | |||
91 | 91 | ||
92 | int clk_set_rate(struct clk *clk, unsigned long rate) | 92 | int clk_set_rate(struct clk *clk, unsigned long rate) |
93 | { | 93 | { |
94 | unsigned int rate_khz = rate / 1000; | ||
94 | int ret = 0; | 95 | int ret = 0; |
95 | int regval; | 96 | int regval; |
96 | int i; | 97 | int i; |
@@ -111,10 +112,10 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
111 | if (loongson2_clockmod_table[i].frequency == | 112 | if (loongson2_clockmod_table[i].frequency == |
112 | CPUFREQ_ENTRY_INVALID) | 113 | CPUFREQ_ENTRY_INVALID) |
113 | continue; | 114 | continue; |
114 | if (rate == loongson2_clockmod_table[i].frequency) | 115 | if (rate_khz == loongson2_clockmod_table[i].frequency) |
115 | break; | 116 | break; |
116 | } | 117 | } |
117 | if (rate != loongson2_clockmod_table[i].frequency) | 118 | if (rate_khz != loongson2_clockmod_table[i].frequency) |
118 | return -ENOTSUPP; | 119 | return -ENOTSUPP; |
119 | 120 | ||
120 | clk->rate = rate; | 121 | clk->rate = rate; |
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index e422b38d3113..9e67cdea3c74 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -29,15 +29,15 @@ void (*flush_cache_range)(struct vm_area_struct *vma, unsigned long start, | |||
29 | void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, | 29 | void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, |
30 | unsigned long pfn); | 30 | unsigned long pfn); |
31 | void (*flush_icache_range)(unsigned long start, unsigned long end); | 31 | void (*flush_icache_range)(unsigned long start, unsigned long end); |
32 | EXPORT_SYMBOL_GPL(flush_icache_range); | ||
32 | void (*local_flush_icache_range)(unsigned long start, unsigned long end); | 33 | void (*local_flush_icache_range)(unsigned long start, unsigned long end); |
33 | 34 | ||
34 | void (*__flush_cache_vmap)(void); | 35 | void (*__flush_cache_vmap)(void); |
35 | void (*__flush_cache_vunmap)(void); | 36 | void (*__flush_cache_vunmap)(void); |
36 | 37 | ||
37 | void (*__flush_kernel_vmap_range)(unsigned long vaddr, int size); | 38 | void (*__flush_kernel_vmap_range)(unsigned long vaddr, int size); |
38 | void (*__invalidate_kernel_vmap_range)(unsigned long vaddr, int size); | ||
39 | |||
40 | EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range); | 39 | EXPORT_SYMBOL_GPL(__flush_kernel_vmap_range); |
40 | void (*__invalidate_kernel_vmap_range)(unsigned long vaddr, int size); | ||
41 | 41 | ||
42 | /* MIPS specific cache operations */ | 42 | /* MIPS specific cache operations */ |
43 | void (*flush_cache_sigtramp)(unsigned long addr); | 43 | void (*flush_cache_sigtramp)(unsigned long addr); |
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c index 58033c44690d..b611102e23b5 100644 --- a/arch/mips/mm/page.c +++ b/arch/mips/mm/page.c | |||
@@ -273,7 +273,7 @@ void build_clear_page(void) | |||
273 | uasm_i_ori(&buf, A2, A0, off); | 273 | uasm_i_ori(&buf, A2, A0, off); |
274 | 274 | ||
275 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) | 275 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) |
276 | uasm_i_lui(&buf, AT, 0xa000); | 276 | uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000)); |
277 | 277 | ||
278 | off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size) | 278 | off = cache_line_size ? min(8, pref_bias_clear_store / cache_line_size) |
279 | * cache_line_size : 0; | 279 | * cache_line_size : 0; |
@@ -424,7 +424,7 @@ void build_copy_page(void) | |||
424 | uasm_i_ori(&buf, A2, A0, off); | 424 | uasm_i_ori(&buf, A2, A0, off); |
425 | 425 | ||
426 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) | 426 | if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) |
427 | uasm_i_lui(&buf, AT, 0xa000); | 427 | uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000)); |
428 | 428 | ||
429 | off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) * | 429 | off = cache_line_size ? min(8, pref_bias_copy_load / cache_line_size) * |
430 | cache_line_size : 0; | 430 | cache_line_size : 0; |
diff --git a/arch/mips/mm/tlb-funcs.S b/arch/mips/mm/tlb-funcs.S index 30a494db99c2..a5427c6e9757 100644 --- a/arch/mips/mm/tlb-funcs.S +++ b/arch/mips/mm/tlb-funcs.S | |||
@@ -16,8 +16,10 @@ | |||
16 | 16 | ||
17 | #define FASTPATH_SIZE 128 | 17 | #define FASTPATH_SIZE 128 |
18 | 18 | ||
19 | EXPORT(tlbmiss_handler_setup_pgd_start) | ||
19 | LEAF(tlbmiss_handler_setup_pgd) | 20 | LEAF(tlbmiss_handler_setup_pgd) |
20 | .space 16 * 4 | 21 | 1: j 1b /* Dummy, will be replaced. */ |
22 | .space 64 | ||
21 | END(tlbmiss_handler_setup_pgd) | 23 | END(tlbmiss_handler_setup_pgd) |
22 | EXPORT(tlbmiss_handler_setup_pgd_end) | 24 | EXPORT(tlbmiss_handler_setup_pgd_end) |
23 | 25 | ||
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c index ee88367ab3ad..f99ec587b151 100644 --- a/arch/mips/mm/tlbex.c +++ b/arch/mips/mm/tlbex.c | |||
@@ -1422,16 +1422,17 @@ static void build_r4000_tlb_refill_handler(void) | |||
1422 | extern u32 handle_tlbl[], handle_tlbl_end[]; | 1422 | extern u32 handle_tlbl[], handle_tlbl_end[]; |
1423 | extern u32 handle_tlbs[], handle_tlbs_end[]; | 1423 | extern u32 handle_tlbs[], handle_tlbs_end[]; |
1424 | extern u32 handle_tlbm[], handle_tlbm_end[]; | 1424 | extern u32 handle_tlbm[], handle_tlbm_end[]; |
1425 | extern u32 tlbmiss_handler_setup_pgd[], tlbmiss_handler_setup_pgd_end[]; | 1425 | extern u32 tlbmiss_handler_setup_pgd_start[], tlbmiss_handler_setup_pgd[]; |
1426 | extern u32 tlbmiss_handler_setup_pgd_end[]; | ||
1426 | 1427 | ||
1427 | static void build_setup_pgd(void) | 1428 | static void build_setup_pgd(void) |
1428 | { | 1429 | { |
1429 | const int a0 = 4; | 1430 | const int a0 = 4; |
1430 | const int __maybe_unused a1 = 5; | 1431 | const int __maybe_unused a1 = 5; |
1431 | const int __maybe_unused a2 = 6; | 1432 | const int __maybe_unused a2 = 6; |
1432 | u32 *p = tlbmiss_handler_setup_pgd; | 1433 | u32 *p = tlbmiss_handler_setup_pgd_start; |
1433 | const int tlbmiss_handler_setup_pgd_size = | 1434 | const int tlbmiss_handler_setup_pgd_size = |
1434 | tlbmiss_handler_setup_pgd_end - tlbmiss_handler_setup_pgd; | 1435 | tlbmiss_handler_setup_pgd_end - tlbmiss_handler_setup_pgd_start; |
1435 | #ifndef CONFIG_MIPS_PGD_C0_CONTEXT | 1436 | #ifndef CONFIG_MIPS_PGD_C0_CONTEXT |
1436 | long pgdc = (long)pgd_current; | 1437 | long pgdc = (long)pgd_current; |
1437 | #endif | 1438 | #endif |
diff --git a/arch/mips/mti-malta/malta-memory.c b/arch/mips/mti-malta/malta-memory.c index 6d0f4ab3632d..f2364e419682 100644 --- a/arch/mips/mti-malta/malta-memory.c +++ b/arch/mips/mti-malta/malta-memory.c | |||
@@ -27,7 +27,7 @@ unsigned long physical_memsize = 0L; | |||
27 | fw_memblock_t * __init fw_getmdesc(int eva) | 27 | fw_memblock_t * __init fw_getmdesc(int eva) |
28 | { | 28 | { |
29 | char *memsize_str, *ememsize_str __maybe_unused = NULL, *ptr; | 29 | char *memsize_str, *ememsize_str __maybe_unused = NULL, *ptr; |
30 | unsigned long memsize, ememsize __maybe_unused = 0; | 30 | unsigned long memsize = 0, ememsize __maybe_unused = 0; |
31 | static char cmdline[COMMAND_LINE_SIZE] __initdata; | 31 | static char cmdline[COMMAND_LINE_SIZE] __initdata; |
32 | int tmp; | 32 | int tmp; |
33 | 33 | ||
diff --git a/arch/mips/pci/pci-rc32434.c b/arch/mips/pci/pci-rc32434.c index b128cb973ebe..7f6ce6d734c0 100644 --- a/arch/mips/pci/pci-rc32434.c +++ b/arch/mips/pci/pci-rc32434.c | |||
@@ -53,7 +53,6 @@ static struct resource rc32434_res_pci_mem1 = { | |||
53 | .start = 0x50000000, | 53 | .start = 0x50000000, |
54 | .end = 0x5FFFFFFF, | 54 | .end = 0x5FFFFFFF, |
55 | .flags = IORESOURCE_MEM, | 55 | .flags = IORESOURCE_MEM, |
56 | .parent = &rc32434_res_pci_mem1, | ||
57 | .sibling = NULL, | 56 | .sibling = NULL, |
58 | .child = &rc32434_res_pci_mem2 | 57 | .child = &rc32434_res_pci_mem2 |
59 | }; | 58 | }; |
diff --git a/arch/mips/ralink/dts/mt7620a_eval.dts b/arch/mips/ralink/dts/mt7620a_eval.dts index 35eb874ab7f1..709f58132f5c 100644 --- a/arch/mips/ralink/dts/mt7620a_eval.dts +++ b/arch/mips/ralink/dts/mt7620a_eval.dts | |||
@@ -7,6 +7,7 @@ | |||
7 | model = "Ralink MT7620A evaluation board"; | 7 | model = "Ralink MT7620A evaluation board"; |
8 | 8 | ||
9 | memory@0 { | 9 | memory@0 { |
10 | device_type = "memory"; | ||
10 | reg = <0x0 0x2000000>; | 11 | reg = <0x0 0x2000000>; |
11 | }; | 12 | }; |
12 | 13 | ||
diff --git a/arch/mips/ralink/dts/rt2880_eval.dts b/arch/mips/ralink/dts/rt2880_eval.dts index 322d7002595b..0a685db093d4 100644 --- a/arch/mips/ralink/dts/rt2880_eval.dts +++ b/arch/mips/ralink/dts/rt2880_eval.dts | |||
@@ -7,6 +7,7 @@ | |||
7 | model = "Ralink RT2880 evaluation board"; | 7 | model = "Ralink RT2880 evaluation board"; |
8 | 8 | ||
9 | memory@0 { | 9 | memory@0 { |
10 | device_type = "memory"; | ||
10 | reg = <0x8000000 0x2000000>; | 11 | reg = <0x8000000 0x2000000>; |
11 | }; | 12 | }; |
12 | 13 | ||
diff --git a/arch/mips/ralink/dts/rt3052_eval.dts b/arch/mips/ralink/dts/rt3052_eval.dts index 0ac73ea28198..ec9e9a035541 100644 --- a/arch/mips/ralink/dts/rt3052_eval.dts +++ b/arch/mips/ralink/dts/rt3052_eval.dts | |||
@@ -7,6 +7,7 @@ | |||
7 | model = "Ralink RT3052 evaluation board"; | 7 | model = "Ralink RT3052 evaluation board"; |
8 | 8 | ||
9 | memory@0 { | 9 | memory@0 { |
10 | device_type = "memory"; | ||
10 | reg = <0x0 0x2000000>; | 11 | reg = <0x0 0x2000000>; |
11 | }; | 12 | }; |
12 | 13 | ||
diff --git a/arch/mips/ralink/dts/rt3883_eval.dts b/arch/mips/ralink/dts/rt3883_eval.dts index 2fa6b330bf4f..e8df21a5d10d 100644 --- a/arch/mips/ralink/dts/rt3883_eval.dts +++ b/arch/mips/ralink/dts/rt3883_eval.dts | |||
@@ -7,6 +7,7 @@ | |||
7 | model = "Ralink RT3883 evaluation board"; | 7 | model = "Ralink RT3883 evaluation board"; |
8 | 8 | ||
9 | memory@0 { | 9 | memory@0 { |
10 | device_type = "memory"; | ||
10 | reg = <0x0 0x2000000>; | 11 | reg = <0x0 0x2000000>; |
11 | }; | 12 | }; |
12 | 13 | ||
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 1faefed32749..108d48e652af 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -22,6 +22,7 @@ config PARISC | |||
22 | select GENERIC_SMP_IDLE_THREAD | 22 | select GENERIC_SMP_IDLE_THREAD |
23 | select GENERIC_STRNCPY_FROM_USER | 23 | select GENERIC_STRNCPY_FROM_USER |
24 | select SYSCTL_ARCH_UNALIGN_ALLOW | 24 | select SYSCTL_ARCH_UNALIGN_ALLOW |
25 | select SYSCTL_EXCEPTION_TRACE | ||
25 | select HAVE_MOD_ARCH_SPECIFIC | 26 | select HAVE_MOD_ARCH_SPECIFIC |
26 | select VIRT_TO_BUS | 27 | select VIRT_TO_BUS |
27 | select MODULES_USE_ELF_RELA | 28 | select MODULES_USE_ELF_RELA |
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h index 198a86feb574..d951c9681ab3 100644 --- a/arch/parisc/include/asm/processor.h +++ b/arch/parisc/include/asm/processor.h | |||
@@ -55,6 +55,11 @@ | |||
55 | #define STACK_TOP TASK_SIZE | 55 | #define STACK_TOP TASK_SIZE |
56 | #define STACK_TOP_MAX DEFAULT_TASK_SIZE | 56 | #define STACK_TOP_MAX DEFAULT_TASK_SIZE |
57 | 57 | ||
58 | /* Allow bigger stacks for 64-bit processes */ | ||
59 | #define STACK_SIZE_MAX (USER_WIDE_MODE \ | ||
60 | ? (1 << 30) /* 1 GB */ \ | ||
61 | : (CONFIG_MAX_STACK_SIZE_MB*1024*1024)) | ||
62 | |||
58 | #endif | 63 | #endif |
59 | 64 | ||
60 | #ifndef __ASSEMBLY__ | 65 | #ifndef __ASSEMBLY__ |
diff --git a/arch/parisc/include/asm/shmparam.h b/arch/parisc/include/asm/shmparam.h index 628ddc22faa8..afe1300ab667 100644 --- a/arch/parisc/include/asm/shmparam.h +++ b/arch/parisc/include/asm/shmparam.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef _ASMPARISC_SHMPARAM_H | 1 | #ifndef _ASMPARISC_SHMPARAM_H |
2 | #define _ASMPARISC_SHMPARAM_H | 2 | #define _ASMPARISC_SHMPARAM_H |
3 | 3 | ||
4 | #define __ARCH_FORCE_SHMLBA 1 | 4 | #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ |
5 | 5 | #define SHM_COLOUR 0x00400000 /* shared mappings colouring */ | |
6 | #define SHMLBA 0x00400000 /* attach addr needs to be 4 Mb aligned */ | ||
7 | 6 | ||
8 | #endif /* _ASMPARISC_SHMPARAM_H */ | 7 | #endif /* _ASMPARISC_SHMPARAM_H */ |
diff --git a/arch/parisc/include/uapi/asm/Kbuild b/arch/parisc/include/uapi/asm/Kbuild index a580642555b6..348356c99514 100644 --- a/arch/parisc/include/uapi/asm/Kbuild +++ b/arch/parisc/include/uapi/asm/Kbuild | |||
@@ -1,6 +1,8 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | generic-y += resource.h | ||
5 | |||
4 | header-y += bitsperlong.h | 6 | header-y += bitsperlong.h |
5 | header-y += byteorder.h | 7 | header-y += byteorder.h |
6 | header-y += errno.h | 8 | header-y += errno.h |
@@ -13,7 +15,6 @@ header-y += msgbuf.h | |||
13 | header-y += pdc.h | 15 | header-y += pdc.h |
14 | header-y += posix_types.h | 16 | header-y += posix_types.h |
15 | header-y += ptrace.h | 17 | header-y += ptrace.h |
16 | header-y += resource.h | ||
17 | header-y += sembuf.h | 18 | header-y += sembuf.h |
18 | header-y += setup.h | 19 | header-y += setup.h |
19 | header-y += shmbuf.h | 20 | header-y += shmbuf.h |
diff --git a/arch/parisc/include/uapi/asm/resource.h b/arch/parisc/include/uapi/asm/resource.h deleted file mode 100644 index 8b06343b62ed..000000000000 --- a/arch/parisc/include/uapi/asm/resource.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _ASM_PARISC_RESOURCE_H | ||
2 | #define _ASM_PARISC_RESOURCE_H | ||
3 | |||
4 | #define _STK_LIM_MAX 10 * _STK_LIM | ||
5 | #include <asm-generic/resource.h> | ||
6 | |||
7 | #endif | ||
diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h index 265ae5190b0a..47e0e21d2272 100644 --- a/arch/parisc/include/uapi/asm/unistd.h +++ b/arch/parisc/include/uapi/asm/unistd.h | |||
@@ -829,8 +829,9 @@ | |||
829 | #define __NR_sched_setattr (__NR_Linux + 334) | 829 | #define __NR_sched_setattr (__NR_Linux + 334) |
830 | #define __NR_sched_getattr (__NR_Linux + 335) | 830 | #define __NR_sched_getattr (__NR_Linux + 335) |
831 | #define __NR_utimes (__NR_Linux + 336) | 831 | #define __NR_utimes (__NR_Linux + 336) |
832 | #define __NR_renameat2 (__NR_Linux + 337) | ||
832 | 833 | ||
833 | #define __NR_Linux_syscalls (__NR_utimes + 1) | 834 | #define __NR_Linux_syscalls (__NR_renameat2 + 1) |
834 | 835 | ||
835 | 836 | ||
836 | #define __IGNORE_select /* newselect */ | 837 | #define __IGNORE_select /* newselect */ |
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index a6ffc775a9f8..f6448c7c62b5 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -323,7 +323,8 @@ void flush_dcache_page(struct page *page) | |||
323 | * specifically accesses it, of course) */ | 323 | * specifically accesses it, of course) */ |
324 | 324 | ||
325 | flush_tlb_page(mpnt, addr); | 325 | flush_tlb_page(mpnt, addr); |
326 | if (old_addr == 0 || (old_addr & (SHMLBA - 1)) != (addr & (SHMLBA - 1))) { | 326 | if (old_addr == 0 || (old_addr & (SHM_COLOUR - 1)) |
327 | != (addr & (SHM_COLOUR - 1))) { | ||
327 | __flush_cache_page(mpnt, addr, page_to_phys(page)); | 328 | __flush_cache_page(mpnt, addr, page_to_phys(page)); |
328 | if (old_addr) | 329 | if (old_addr) |
329 | printk(KERN_ERR "INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %s\n", old_addr, addr, mpnt->vm_file ? (char *)mpnt->vm_file->f_path.dentry->d_name.name : "(null)"); | 330 | printk(KERN_ERR "INEQUIVALENT ALIASES 0x%lx and 0x%lx in file %s\n", old_addr, addr, mpnt->vm_file ? (char *)mpnt->vm_file->f_path.dentry->d_name.name : "(null)"); |
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c index b7cadc4a06cd..e1ffea2f9a0b 100644 --- a/arch/parisc/kernel/sys_parisc.c +++ b/arch/parisc/kernel/sys_parisc.c | |||
@@ -45,7 +45,7 @@ | |||
45 | 45 | ||
46 | static int get_offset(unsigned int last_mmap) | 46 | static int get_offset(unsigned int last_mmap) |
47 | { | 47 | { |
48 | return (last_mmap & (SHMLBA-1)) >> PAGE_SHIFT; | 48 | return (last_mmap & (SHM_COLOUR-1)) >> PAGE_SHIFT; |
49 | } | 49 | } |
50 | 50 | ||
51 | static unsigned long shared_align_offset(unsigned int last_mmap, | 51 | static unsigned long shared_align_offset(unsigned int last_mmap, |
@@ -57,8 +57,8 @@ static unsigned long shared_align_offset(unsigned int last_mmap, | |||
57 | static inline unsigned long COLOR_ALIGN(unsigned long addr, | 57 | static inline unsigned long COLOR_ALIGN(unsigned long addr, |
58 | unsigned int last_mmap, unsigned long pgoff) | 58 | unsigned int last_mmap, unsigned long pgoff) |
59 | { | 59 | { |
60 | unsigned long base = (addr+SHMLBA-1) & ~(SHMLBA-1); | 60 | unsigned long base = (addr+SHM_COLOUR-1) & ~(SHM_COLOUR-1); |
61 | unsigned long off = (SHMLBA-1) & | 61 | unsigned long off = (SHM_COLOUR-1) & |
62 | (shared_align_offset(last_mmap, pgoff) << PAGE_SHIFT); | 62 | (shared_align_offset(last_mmap, pgoff) << PAGE_SHIFT); |
63 | 63 | ||
64 | return base + off; | 64 | return base + off; |
@@ -72,10 +72,10 @@ static unsigned long mmap_upper_limit(void) | |||
72 | { | 72 | { |
73 | unsigned long stack_base; | 73 | unsigned long stack_base; |
74 | 74 | ||
75 | /* Limit stack size to 1GB - see setup_arg_pages() in fs/exec.c */ | 75 | /* Limit stack size - see setup_arg_pages() in fs/exec.c */ |
76 | stack_base = rlimit_max(RLIMIT_STACK); | 76 | stack_base = rlimit_max(RLIMIT_STACK); |
77 | if (stack_base > (1 << 30)) | 77 | if (stack_base > STACK_SIZE_MAX) |
78 | stack_base = 1 << 30; | 78 | stack_base = STACK_SIZE_MAX; |
79 | 79 | ||
80 | return PAGE_ALIGN(STACK_TOP - stack_base); | 80 | return PAGE_ALIGN(STACK_TOP - stack_base); |
81 | } | 81 | } |
@@ -101,7 +101,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
101 | if (flags & MAP_FIXED) { | 101 | if (flags & MAP_FIXED) { |
102 | if ((flags & MAP_SHARED) && last_mmap && | 102 | if ((flags & MAP_SHARED) && last_mmap && |
103 | (addr - shared_align_offset(last_mmap, pgoff)) | 103 | (addr - shared_align_offset(last_mmap, pgoff)) |
104 | & (SHMLBA - 1)) | 104 | & (SHM_COLOUR - 1)) |
105 | return -EINVAL; | 105 | return -EINVAL; |
106 | goto found_addr; | 106 | goto found_addr; |
107 | } | 107 | } |
@@ -122,7 +122,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
122 | info.length = len; | 122 | info.length = len; |
123 | info.low_limit = mm->mmap_legacy_base; | 123 | info.low_limit = mm->mmap_legacy_base; |
124 | info.high_limit = mmap_upper_limit(); | 124 | info.high_limit = mmap_upper_limit(); |
125 | info.align_mask = last_mmap ? (PAGE_MASK & (SHMLBA - 1)) : 0; | 125 | info.align_mask = last_mmap ? (PAGE_MASK & (SHM_COLOUR - 1)) : 0; |
126 | info.align_offset = shared_align_offset(last_mmap, pgoff); | 126 | info.align_offset = shared_align_offset(last_mmap, pgoff); |
127 | addr = vm_unmapped_area(&info); | 127 | addr = vm_unmapped_area(&info); |
128 | 128 | ||
@@ -161,7 +161,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
161 | if (flags & MAP_FIXED) { | 161 | if (flags & MAP_FIXED) { |
162 | if ((flags & MAP_SHARED) && last_mmap && | 162 | if ((flags & MAP_SHARED) && last_mmap && |
163 | (addr - shared_align_offset(last_mmap, pgoff)) | 163 | (addr - shared_align_offset(last_mmap, pgoff)) |
164 | & (SHMLBA - 1)) | 164 | & (SHM_COLOUR - 1)) |
165 | return -EINVAL; | 165 | return -EINVAL; |
166 | goto found_addr; | 166 | goto found_addr; |
167 | } | 167 | } |
@@ -182,7 +182,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
182 | info.length = len; | 182 | info.length = len; |
183 | info.low_limit = PAGE_SIZE; | 183 | info.low_limit = PAGE_SIZE; |
184 | info.high_limit = mm->mmap_base; | 184 | info.high_limit = mm->mmap_base; |
185 | info.align_mask = last_mmap ? (PAGE_MASK & (SHMLBA - 1)) : 0; | 185 | info.align_mask = last_mmap ? (PAGE_MASK & (SHM_COLOUR - 1)) : 0; |
186 | info.align_offset = shared_align_offset(last_mmap, pgoff); | 186 | info.align_offset = shared_align_offset(last_mmap, pgoff); |
187 | addr = vm_unmapped_area(&info); | 187 | addr = vm_unmapped_area(&info); |
188 | if (!(addr & ~PAGE_MASK)) | 188 | if (!(addr & ~PAGE_MASK)) |
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index a63bb179f79a..838786011037 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
@@ -589,10 +589,13 @@ cas_nocontend: | |||
589 | # endif | 589 | # endif |
590 | /* ENABLE_LWS_DEBUG */ | 590 | /* ENABLE_LWS_DEBUG */ |
591 | 591 | ||
592 | rsm PSW_SM_I, %r0 /* Disable interrupts */ | ||
593 | /* COW breaks can cause contention on UP systems */ | ||
592 | LDCW 0(%sr2,%r20), %r28 /* Try to acquire the lock */ | 594 | LDCW 0(%sr2,%r20), %r28 /* Try to acquire the lock */ |
593 | cmpb,<>,n %r0, %r28, cas_action /* Did we get it? */ | 595 | cmpb,<>,n %r0, %r28, cas_action /* Did we get it? */ |
594 | cas_wouldblock: | 596 | cas_wouldblock: |
595 | ldo 2(%r0), %r28 /* 2nd case */ | 597 | ldo 2(%r0), %r28 /* 2nd case */ |
598 | ssm PSW_SM_I, %r0 | ||
596 | b lws_exit /* Contended... */ | 599 | b lws_exit /* Contended... */ |
597 | ldo -EAGAIN(%r0), %r21 /* Spin in userspace */ | 600 | ldo -EAGAIN(%r0), %r21 /* Spin in userspace */ |
598 | 601 | ||
@@ -619,15 +622,17 @@ cas_action: | |||
619 | stw %r1, 4(%sr2,%r20) | 622 | stw %r1, 4(%sr2,%r20) |
620 | #endif | 623 | #endif |
621 | /* The load and store could fail */ | 624 | /* The load and store could fail */ |
622 | 1: ldw 0(%sr3,%r26), %r28 | 625 | 1: ldw,ma 0(%sr3,%r26), %r28 |
623 | sub,<> %r28, %r25, %r0 | 626 | sub,<> %r28, %r25, %r0 |
624 | 2: stw %r24, 0(%sr3,%r26) | 627 | 2: stw,ma %r24, 0(%sr3,%r26) |
625 | /* Free lock */ | 628 | /* Free lock */ |
626 | stw %r20, 0(%sr2,%r20) | 629 | stw,ma %r20, 0(%sr2,%r20) |
627 | #if ENABLE_LWS_DEBUG | 630 | #if ENABLE_LWS_DEBUG |
628 | /* Clear thread register indicator */ | 631 | /* Clear thread register indicator */ |
629 | stw %r0, 4(%sr2,%r20) | 632 | stw %r0, 4(%sr2,%r20) |
630 | #endif | 633 | #endif |
634 | /* Enable interrupts */ | ||
635 | ssm PSW_SM_I, %r0 | ||
631 | /* Return to userspace, set no error */ | 636 | /* Return to userspace, set no error */ |
632 | b lws_exit | 637 | b lws_exit |
633 | copy %r0, %r21 | 638 | copy %r0, %r21 |
@@ -639,6 +644,7 @@ cas_action: | |||
639 | #if ENABLE_LWS_DEBUG | 644 | #if ENABLE_LWS_DEBUG |
640 | stw %r0, 4(%sr2,%r20) | 645 | stw %r0, 4(%sr2,%r20) |
641 | #endif | 646 | #endif |
647 | ssm PSW_SM_I, %r0 | ||
642 | b lws_exit | 648 | b lws_exit |
643 | ldo -EFAULT(%r0),%r21 /* set errno */ | 649 | ldo -EFAULT(%r0),%r21 /* set errno */ |
644 | nop | 650 | nop |
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S index 80e5dd248934..c5fa7a697fba 100644 --- a/arch/parisc/kernel/syscall_table.S +++ b/arch/parisc/kernel/syscall_table.S | |||
@@ -392,7 +392,7 @@ | |||
392 | ENTRY_COMP(vmsplice) | 392 | ENTRY_COMP(vmsplice) |
393 | ENTRY_COMP(move_pages) /* 295 */ | 393 | ENTRY_COMP(move_pages) /* 295 */ |
394 | ENTRY_SAME(getcpu) | 394 | ENTRY_SAME(getcpu) |
395 | ENTRY_SAME(epoll_pwait) | 395 | ENTRY_COMP(epoll_pwait) |
396 | ENTRY_COMP(statfs64) | 396 | ENTRY_COMP(statfs64) |
397 | ENTRY_COMP(fstatfs64) | 397 | ENTRY_COMP(fstatfs64) |
398 | ENTRY_COMP(kexec_load) /* 300 */ | 398 | ENTRY_COMP(kexec_load) /* 300 */ |
@@ -432,6 +432,7 @@ | |||
432 | ENTRY_SAME(sched_setattr) | 432 | ENTRY_SAME(sched_setattr) |
433 | ENTRY_SAME(sched_getattr) /* 335 */ | 433 | ENTRY_SAME(sched_getattr) /* 335 */ |
434 | ENTRY_COMP(utimes) | 434 | ENTRY_COMP(utimes) |
435 | ENTRY_SAME(renameat2) | ||
435 | 436 | ||
436 | /* Nothing yet */ | 437 | /* Nothing yet */ |
437 | 438 | ||
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c index 1cd1d0c83b6d..47ee620d15d2 100644 --- a/arch/parisc/kernel/traps.c +++ b/arch/parisc/kernel/traps.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/console.h> | 26 | #include <linux/console.h> |
27 | #include <linux/bug.h> | 27 | #include <linux/bug.h> |
28 | #include <linux/ratelimit.h> | ||
28 | 29 | ||
29 | #include <asm/assembly.h> | 30 | #include <asm/assembly.h> |
30 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
@@ -42,9 +43,6 @@ | |||
42 | 43 | ||
43 | #include "../math-emu/math-emu.h" /* for handle_fpe() */ | 44 | #include "../math-emu/math-emu.h" /* for handle_fpe() */ |
44 | 45 | ||
45 | #define PRINT_USER_FAULTS /* (turn this on if you want user faults to be */ | ||
46 | /* dumped to the console via printk) */ | ||
47 | |||
48 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | 46 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) |
49 | DEFINE_SPINLOCK(pa_dbit_lock); | 47 | DEFINE_SPINLOCK(pa_dbit_lock); |
50 | #endif | 48 | #endif |
@@ -160,6 +158,17 @@ void show_regs(struct pt_regs *regs) | |||
160 | } | 158 | } |
161 | } | 159 | } |
162 | 160 | ||
161 | static DEFINE_RATELIMIT_STATE(_hppa_rs, | ||
162 | DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); | ||
163 | |||
164 | #define parisc_printk_ratelimited(critical, regs, fmt, ...) { \ | ||
165 | if ((critical || show_unhandled_signals) && __ratelimit(&_hppa_rs)) { \ | ||
166 | printk(fmt, ##__VA_ARGS__); \ | ||
167 | show_regs(regs); \ | ||
168 | } \ | ||
169 | } | ||
170 | |||
171 | |||
163 | static void do_show_stack(struct unwind_frame_info *info) | 172 | static void do_show_stack(struct unwind_frame_info *info) |
164 | { | 173 | { |
165 | int i = 1; | 174 | int i = 1; |
@@ -229,12 +238,10 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err) | |||
229 | if (err == 0) | 238 | if (err == 0) |
230 | return; /* STFU */ | 239 | return; /* STFU */ |
231 | 240 | ||
232 | printk(KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n", | 241 | parisc_printk_ratelimited(1, regs, |
242 | KERN_CRIT "%s (pid %d): %s (code %ld) at " RFMT "\n", | ||
233 | current->comm, task_pid_nr(current), str, err, regs->iaoq[0]); | 243 | current->comm, task_pid_nr(current), str, err, regs->iaoq[0]); |
234 | #ifdef PRINT_USER_FAULTS | 244 | |
235 | /* XXX for debugging only */ | ||
236 | show_regs(regs); | ||
237 | #endif | ||
238 | return; | 245 | return; |
239 | } | 246 | } |
240 | 247 | ||
@@ -321,14 +328,11 @@ static void handle_break(struct pt_regs *regs) | |||
321 | (tt == BUG_TRAP_TYPE_NONE) ? 9 : 0); | 328 | (tt == BUG_TRAP_TYPE_NONE) ? 9 : 0); |
322 | } | 329 | } |
323 | 330 | ||
324 | #ifdef PRINT_USER_FAULTS | 331 | if (unlikely(iir != GDB_BREAK_INSN)) |
325 | if (unlikely(iir != GDB_BREAK_INSN)) { | 332 | parisc_printk_ratelimited(0, regs, |
326 | printk(KERN_DEBUG "break %d,%d: pid=%d command='%s'\n", | 333 | KERN_DEBUG "break %d,%d: pid=%d command='%s'\n", |
327 | iir & 31, (iir>>13) & ((1<<13)-1), | 334 | iir & 31, (iir>>13) & ((1<<13)-1), |
328 | task_pid_nr(current), current->comm); | 335 | task_pid_nr(current), current->comm); |
329 | show_regs(regs); | ||
330 | } | ||
331 | #endif | ||
332 | 336 | ||
333 | /* send standard GDB signal */ | 337 | /* send standard GDB signal */ |
334 | handle_gdb_break(regs, TRAP_BRKPT); | 338 | handle_gdb_break(regs, TRAP_BRKPT); |
@@ -758,11 +762,9 @@ void notrace handle_interruption(int code, struct pt_regs *regs) | |||
758 | 762 | ||
759 | default: | 763 | default: |
760 | if (user_mode(regs)) { | 764 | if (user_mode(regs)) { |
761 | #ifdef PRINT_USER_FAULTS | 765 | parisc_printk_ratelimited(0, regs, KERN_DEBUG |
762 | printk(KERN_DEBUG "\nhandle_interruption() pid=%d command='%s'\n", | 766 | "handle_interruption() pid=%d command='%s'\n", |
763 | task_pid_nr(current), current->comm); | 767 | task_pid_nr(current), current->comm); |
764 | show_regs(regs); | ||
765 | #endif | ||
766 | /* SIGBUS, for lack of a better one. */ | 768 | /* SIGBUS, for lack of a better one. */ |
767 | si.si_signo = SIGBUS; | 769 | si.si_signo = SIGBUS; |
768 | si.si_code = BUS_OBJERR; | 770 | si.si_code = BUS_OBJERR; |
@@ -779,16 +781,10 @@ void notrace handle_interruption(int code, struct pt_regs *regs) | |||
779 | 781 | ||
780 | if (user_mode(regs)) { | 782 | if (user_mode(regs)) { |
781 | if ((fault_space >> SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) { | 783 | if ((fault_space >> SPACEID_SHIFT) != (regs->sr[7] >> SPACEID_SHIFT)) { |
782 | #ifdef PRINT_USER_FAULTS | 784 | parisc_printk_ratelimited(0, regs, KERN_DEBUG |
783 | if (fault_space == 0) | 785 | "User fault %d on space 0x%08lx, pid=%d command='%s'\n", |
784 | printk(KERN_DEBUG "User Fault on Kernel Space "); | 786 | code, fault_space, |
785 | else | 787 | task_pid_nr(current), current->comm); |
786 | printk(KERN_DEBUG "User Fault (long pointer) (fault %d) ", | ||
787 | code); | ||
788 | printk(KERN_CONT "pid=%d command='%s'\n", | ||
789 | task_pid_nr(current), current->comm); | ||
790 | show_regs(regs); | ||
791 | #endif | ||
792 | si.si_signo = SIGSEGV; | 788 | si.si_signo = SIGSEGV; |
793 | si.si_errno = 0; | 789 | si.si_errno = 0; |
794 | si.si_code = SEGV_MAPERR; | 790 | si.si_code = SEGV_MAPERR; |
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c index 413dc1769299..b2b441b32341 100644 --- a/arch/parisc/lib/memcpy.c +++ b/arch/parisc/lib/memcpy.c | |||
@@ -470,7 +470,7 @@ static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len) | |||
470 | return 0; | 470 | return 0; |
471 | 471 | ||
472 | /* if a load or store fault occured we can get the faulty addr */ | 472 | /* if a load or store fault occured we can get the faulty addr */ |
473 | d = &__get_cpu_var(exception_data); | 473 | d = this_cpu_ptr(&exception_data); |
474 | fault_addr = d->fault_addr; | 474 | fault_addr = d->fault_addr; |
475 | 475 | ||
476 | /* error in load or store? */ | 476 | /* error in load or store? */ |
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c index 9d08c71a967e..3ca9c1131cfe 100644 --- a/arch/parisc/mm/fault.c +++ b/arch/parisc/mm/fault.c | |||
@@ -19,10 +19,6 @@ | |||
19 | #include <asm/uaccess.h> | 19 | #include <asm/uaccess.h> |
20 | #include <asm/traps.h> | 20 | #include <asm/traps.h> |
21 | 21 | ||
22 | #define PRINT_USER_FAULTS /* (turn this on if you want user faults to be */ | ||
23 | /* dumped to the console via printk) */ | ||
24 | |||
25 | |||
26 | /* Various important other fields */ | 22 | /* Various important other fields */ |
27 | #define bit22set(x) (x & 0x00000200) | 23 | #define bit22set(x) (x & 0x00000200) |
28 | #define bits23_25set(x) (x & 0x000001c0) | 24 | #define bits23_25set(x) (x & 0x000001c0) |
@@ -34,6 +30,8 @@ | |||
34 | 30 | ||
35 | DEFINE_PER_CPU(struct exception_data, exception_data); | 31 | DEFINE_PER_CPU(struct exception_data, exception_data); |
36 | 32 | ||
33 | int show_unhandled_signals = 1; | ||
34 | |||
37 | /* | 35 | /* |
38 | * parisc_acctyp(unsigned int inst) -- | 36 | * parisc_acctyp(unsigned int inst) -- |
39 | * Given a PA-RISC memory access instruction, determine if the | 37 | * Given a PA-RISC memory access instruction, determine if the |
@@ -151,7 +149,7 @@ int fixup_exception(struct pt_regs *regs) | |||
151 | fix = search_exception_tables(regs->iaoq[0]); | 149 | fix = search_exception_tables(regs->iaoq[0]); |
152 | if (fix) { | 150 | if (fix) { |
153 | struct exception_data *d; | 151 | struct exception_data *d; |
154 | d = &__get_cpu_var(exception_data); | 152 | d = this_cpu_ptr(&exception_data); |
155 | d->fault_ip = regs->iaoq[0]; | 153 | d->fault_ip = regs->iaoq[0]; |
156 | d->fault_space = regs->isr; | 154 | d->fault_space = regs->isr; |
157 | d->fault_addr = regs->ior; | 155 | d->fault_addr = regs->ior; |
@@ -173,6 +171,32 @@ int fixup_exception(struct pt_regs *regs) | |||
173 | return 0; | 171 | return 0; |
174 | } | 172 | } |
175 | 173 | ||
174 | /* | ||
175 | * Print out info about fatal segfaults, if the show_unhandled_signals | ||
176 | * sysctl is set: | ||
177 | */ | ||
178 | static inline void | ||
179 | show_signal_msg(struct pt_regs *regs, unsigned long code, | ||
180 | unsigned long address, struct task_struct *tsk, | ||
181 | struct vm_area_struct *vma) | ||
182 | { | ||
183 | if (!unhandled_signal(tsk, SIGSEGV)) | ||
184 | return; | ||
185 | |||
186 | if (!printk_ratelimit()) | ||
187 | return; | ||
188 | |||
189 | pr_warn("\n"); | ||
190 | pr_warn("do_page_fault() command='%s' type=%lu address=0x%08lx", | ||
191 | tsk->comm, code, address); | ||
192 | print_vma_addr(KERN_CONT " in ", regs->iaoq[0]); | ||
193 | if (vma) | ||
194 | pr_warn(" vm_start = 0x%08lx, vm_end = 0x%08lx\n", | ||
195 | vma->vm_start, vma->vm_end); | ||
196 | |||
197 | show_regs(regs); | ||
198 | } | ||
199 | |||
176 | void do_page_fault(struct pt_regs *regs, unsigned long code, | 200 | void do_page_fault(struct pt_regs *regs, unsigned long code, |
177 | unsigned long address) | 201 | unsigned long address) |
178 | { | 202 | { |
@@ -270,16 +294,8 @@ bad_area: | |||
270 | if (user_mode(regs)) { | 294 | if (user_mode(regs)) { |
271 | struct siginfo si; | 295 | struct siginfo si; |
272 | 296 | ||
273 | #ifdef PRINT_USER_FAULTS | 297 | show_signal_msg(regs, code, address, tsk, vma); |
274 | printk(KERN_DEBUG "\n"); | 298 | |
275 | printk(KERN_DEBUG "do_page_fault() pid=%d command='%s' type=%lu address=0x%08lx\n", | ||
276 | task_pid_nr(tsk), tsk->comm, code, address); | ||
277 | if (vma) { | ||
278 | printk(KERN_DEBUG "vm_start = 0x%08lx, vm_end = 0x%08lx\n", | ||
279 | vma->vm_start, vma->vm_end); | ||
280 | } | ||
281 | show_regs(regs); | ||
282 | #endif | ||
283 | switch (code) { | 299 | switch (code) { |
284 | case 15: /* Data TLB miss fault/Data page fault */ | 300 | case 15: /* Data TLB miss fault/Data page fault */ |
285 | /* send SIGSEGV when outside of vma */ | 301 | /* send SIGSEGV when outside of vma */ |
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 4c0cedf4e2c7..ce4c68a4a823 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -150,7 +150,9 @@ endif | |||
150 | 150 | ||
151 | CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) | 151 | CFLAGS-$(CONFIG_TUNE_CELL) += $(call cc-option,-mtune=cell) |
152 | 152 | ||
153 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) | 153 | asinstr := $(call as-instr,lis 9$(comma)foo@high,-DHAVE_AS_ATHIGH=1) |
154 | |||
155 | KBUILD_CPPFLAGS += -Iarch/$(ARCH) $(asinstr) | ||
154 | KBUILD_AFLAGS += -Iarch/$(ARCH) | 156 | KBUILD_AFLAGS += -Iarch/$(ARCH) |
155 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) | 157 | KBUILD_CFLAGS += -msoft-float -pipe -Iarch/$(ARCH) $(CFLAGS-y) |
156 | CPP = $(CC) -E $(KBUILD_CFLAGS) | 158 | CPP = $(CC) -E $(KBUILD_CFLAGS) |
diff --git a/arch/powerpc/boot/main.c b/arch/powerpc/boot/main.c index a28f02165e97..d367a0aece2a 100644 --- a/arch/powerpc/boot/main.c +++ b/arch/powerpc/boot/main.c | |||
@@ -139,18 +139,18 @@ static struct addr_range prep_initrd(struct addr_range vmlinux, void *chosen, | |||
139 | * edit the command line passed to vmlinux (by setting /chosen/bootargs). | 139 | * edit the command line passed to vmlinux (by setting /chosen/bootargs). |
140 | * The buffer is put in it's own section so that tools may locate it easier. | 140 | * The buffer is put in it's own section so that tools may locate it easier. |
141 | */ | 141 | */ |
142 | static char cmdline[COMMAND_LINE_SIZE] | 142 | static char cmdline[BOOT_COMMAND_LINE_SIZE] |
143 | __attribute__((__section__("__builtin_cmdline"))); | 143 | __attribute__((__section__("__builtin_cmdline"))); |
144 | 144 | ||
145 | static void prep_cmdline(void *chosen) | 145 | static void prep_cmdline(void *chosen) |
146 | { | 146 | { |
147 | if (cmdline[0] == '\0') | 147 | if (cmdline[0] == '\0') |
148 | getprop(chosen, "bootargs", cmdline, COMMAND_LINE_SIZE-1); | 148 | getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1); |
149 | 149 | ||
150 | printf("\n\rLinux/PowerPC load: %s", cmdline); | 150 | printf("\n\rLinux/PowerPC load: %s", cmdline); |
151 | /* If possible, edit the command line */ | 151 | /* If possible, edit the command line */ |
152 | if (console_ops.edit_cmdline) | 152 | if (console_ops.edit_cmdline) |
153 | console_ops.edit_cmdline(cmdline, COMMAND_LINE_SIZE); | 153 | console_ops.edit_cmdline(cmdline, BOOT_COMMAND_LINE_SIZE); |
154 | printf("\n\r"); | 154 | printf("\n\r"); |
155 | 155 | ||
156 | /* Put the command line back into the devtree for the kernel */ | 156 | /* Put the command line back into the devtree for the kernel */ |
@@ -174,7 +174,7 @@ void start(void) | |||
174 | * built-in command line wasn't set by an external tool */ | 174 | * built-in command line wasn't set by an external tool */ |
175 | if ((loader_info.cmdline_len > 0) && (cmdline[0] == '\0')) | 175 | if ((loader_info.cmdline_len > 0) && (cmdline[0] == '\0')) |
176 | memmove(cmdline, loader_info.cmdline, | 176 | memmove(cmdline, loader_info.cmdline, |
177 | min(loader_info.cmdline_len, COMMAND_LINE_SIZE-1)); | 177 | min(loader_info.cmdline_len, BOOT_COMMAND_LINE_SIZE-1)); |
178 | 178 | ||
179 | if (console_ops.open && (console_ops.open() < 0)) | 179 | if (console_ops.open && (console_ops.open() < 0)) |
180 | exit(); | 180 | exit(); |
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h index b3218ce451bb..8aad3c55aeda 100644 --- a/arch/powerpc/boot/ops.h +++ b/arch/powerpc/boot/ops.h | |||
@@ -15,7 +15,7 @@ | |||
15 | #include "types.h" | 15 | #include "types.h" |
16 | #include "string.h" | 16 | #include "string.h" |
17 | 17 | ||
18 | #define COMMAND_LINE_SIZE 512 | 18 | #define BOOT_COMMAND_LINE_SIZE 2048 |
19 | #define MAX_PATH_LEN 256 | 19 | #define MAX_PATH_LEN 256 |
20 | #define MAX_PROP_LEN 256 /* What should this be? */ | 20 | #define MAX_PROP_LEN 256 /* What should this be? */ |
21 | 21 | ||
diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c index 9954d98871d0..4ec2d86d3c50 100644 --- a/arch/powerpc/boot/ps3.c +++ b/arch/powerpc/boot/ps3.c | |||
@@ -47,13 +47,13 @@ BSS_STACK(4096); | |||
47 | * The buffer is put in it's own section so that tools may locate it easier. | 47 | * The buffer is put in it's own section so that tools may locate it easier. |
48 | */ | 48 | */ |
49 | 49 | ||
50 | static char cmdline[COMMAND_LINE_SIZE] | 50 | static char cmdline[BOOT_COMMAND_LINE_SIZE] |
51 | __attribute__((__section__("__builtin_cmdline"))); | 51 | __attribute__((__section__("__builtin_cmdline"))); |
52 | 52 | ||
53 | static void prep_cmdline(void *chosen) | 53 | static void prep_cmdline(void *chosen) |
54 | { | 54 | { |
55 | if (cmdline[0] == '\0') | 55 | if (cmdline[0] == '\0') |
56 | getprop(chosen, "bootargs", cmdline, COMMAND_LINE_SIZE-1); | 56 | getprop(chosen, "bootargs", cmdline, BOOT_COMMAND_LINE_SIZE-1); |
57 | else | 57 | else |
58 | setprop_str(chosen, "bootargs", cmdline); | 58 | setprop_str(chosen, "bootargs", cmdline); |
59 | 59 | ||
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h index a2efdaa020b0..66ad7a74116f 100644 --- a/arch/powerpc/include/asm/opal.h +++ b/arch/powerpc/include/asm/opal.h | |||
@@ -41,14 +41,14 @@ struct opal_takeover_args { | |||
41 | * size except the last one in the list to be as well. | 41 | * size except the last one in the list to be as well. |
42 | */ | 42 | */ |
43 | struct opal_sg_entry { | 43 | struct opal_sg_entry { |
44 | void *data; | 44 | __be64 data; |
45 | long length; | 45 | __be64 length; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | /* sg list */ | 48 | /* SG list */ |
49 | struct opal_sg_list { | 49 | struct opal_sg_list { |
50 | unsigned long num_entries; | 50 | __be64 length; |
51 | struct opal_sg_list *next; | 51 | __be64 next; |
52 | struct opal_sg_entry entry[]; | 52 | struct opal_sg_entry entry[]; |
53 | }; | 53 | }; |
54 | 54 | ||
@@ -858,8 +858,8 @@ int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, | |||
858 | int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, | 858 | int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, |
859 | uint32_t addr, __be32 *data, uint32_t sz); | 859 | uint32_t addr, __be32 *data, uint32_t sz); |
860 | 860 | ||
861 | int64_t opal_read_elog(uint64_t buffer, size_t size, uint64_t log_id); | 861 | int64_t opal_read_elog(uint64_t buffer, uint64_t size, uint64_t log_id); |
862 | int64_t opal_get_elog_size(uint64_t *log_id, size_t *size, uint64_t *elog_type); | 862 | int64_t opal_get_elog_size(__be64 *log_id, __be64 *size, __be64 *elog_type); |
863 | int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset); | 863 | int64_t opal_write_elog(uint64_t buffer, uint64_t size, uint64_t offset); |
864 | int64_t opal_send_ack_elog(uint64_t log_id); | 864 | int64_t opal_send_ack_elog(uint64_t log_id); |
865 | void opal_resend_pending_logs(void); | 865 | void opal_resend_pending_logs(void); |
@@ -868,23 +868,24 @@ int64_t opal_validate_flash(uint64_t buffer, uint32_t *size, uint32_t *result); | |||
868 | int64_t opal_manage_flash(uint8_t op); | 868 | int64_t opal_manage_flash(uint8_t op); |
869 | int64_t opal_update_flash(uint64_t blk_list); | 869 | int64_t opal_update_flash(uint64_t blk_list); |
870 | int64_t opal_dump_init(uint8_t dump_type); | 870 | int64_t opal_dump_init(uint8_t dump_type); |
871 | int64_t opal_dump_info(uint32_t *dump_id, uint32_t *dump_size); | 871 | int64_t opal_dump_info(__be32 *dump_id, __be32 *dump_size); |
872 | int64_t opal_dump_info2(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type); | 872 | int64_t opal_dump_info2(__be32 *dump_id, __be32 *dump_size, __be32 *dump_type); |
873 | int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer); | 873 | int64_t opal_dump_read(uint32_t dump_id, uint64_t buffer); |
874 | int64_t opal_dump_ack(uint32_t dump_id); | 874 | int64_t opal_dump_ack(uint32_t dump_id); |
875 | int64_t opal_dump_resend_notification(void); | 875 | int64_t opal_dump_resend_notification(void); |
876 | 876 | ||
877 | int64_t opal_get_msg(uint64_t buffer, size_t size); | 877 | int64_t opal_get_msg(uint64_t buffer, uint64_t size); |
878 | int64_t opal_check_completion(uint64_t buffer, size_t size, uint64_t token); | 878 | int64_t opal_check_completion(uint64_t buffer, uint64_t size, uint64_t token); |
879 | int64_t opal_sync_host_reboot(void); | 879 | int64_t opal_sync_host_reboot(void); |
880 | int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer, | 880 | int64_t opal_get_param(uint64_t token, uint32_t param_id, uint64_t buffer, |
881 | size_t length); | 881 | uint64_t length); |
882 | int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer, | 882 | int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer, |
883 | size_t length); | 883 | uint64_t length); |
884 | int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data); | 884 | int64_t opal_sensor_read(uint32_t sensor_hndl, int token, __be32 *sensor_data); |
885 | 885 | ||
886 | /* Internal functions */ | 886 | /* Internal functions */ |
887 | extern int early_init_dt_scan_opal(unsigned long node, const char *uname, int depth, void *data); | 887 | extern int early_init_dt_scan_opal(unsigned long node, const char *uname, |
888 | int depth, void *data); | ||
888 | extern int early_init_dt_scan_recoverable_ranges(unsigned long node, | 889 | extern int early_init_dt_scan_recoverable_ranges(unsigned long node, |
889 | const char *uname, int depth, void *data); | 890 | const char *uname, int depth, void *data); |
890 | 891 | ||
@@ -893,10 +894,6 @@ extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); | |||
893 | 894 | ||
894 | extern void hvc_opal_init_early(void); | 895 | extern void hvc_opal_init_early(void); |
895 | 896 | ||
896 | /* Internal functions */ | ||
897 | extern int early_init_dt_scan_opal(unsigned long node, const char *uname, | ||
898 | int depth, void *data); | ||
899 | |||
900 | extern int opal_notifier_register(struct notifier_block *nb); | 897 | extern int opal_notifier_register(struct notifier_block *nb); |
901 | extern int opal_notifier_unregister(struct notifier_block *nb); | 898 | extern int opal_notifier_unregister(struct notifier_block *nb); |
902 | 899 | ||
@@ -906,9 +903,6 @@ extern void opal_notifier_enable(void); | |||
906 | extern void opal_notifier_disable(void); | 903 | extern void opal_notifier_disable(void); |
907 | extern void opal_notifier_update_evt(uint64_t evt_mask, uint64_t evt_val); | 904 | extern void opal_notifier_update_evt(uint64_t evt_mask, uint64_t evt_val); |
908 | 905 | ||
909 | extern int opal_get_chars(uint32_t vtermno, char *buf, int count); | ||
910 | extern int opal_put_chars(uint32_t vtermno, const char *buf, int total_len); | ||
911 | |||
912 | extern int __opal_async_get_token(void); | 906 | extern int __opal_async_get_token(void); |
913 | extern int opal_async_get_token_interruptible(void); | 907 | extern int opal_async_get_token_interruptible(void); |
914 | extern int __opal_async_release_token(int token); | 908 | extern int __opal_async_release_token(int token); |
@@ -916,8 +910,6 @@ extern int opal_async_release_token(int token); | |||
916 | extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg); | 910 | extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg); |
917 | extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data); | 911 | extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data); |
918 | 912 | ||
919 | extern void hvc_opal_init_early(void); | ||
920 | |||
921 | struct rtc_time; | 913 | struct rtc_time; |
922 | extern int opal_set_rtc_time(struct rtc_time *tm); | 914 | extern int opal_set_rtc_time(struct rtc_time *tm); |
923 | extern void opal_get_rtc_time(struct rtc_time *tm); | 915 | extern void opal_get_rtc_time(struct rtc_time *tm); |
@@ -937,6 +929,10 @@ extern int opal_resync_timebase(void); | |||
937 | 929 | ||
938 | extern void opal_lpc_init(void); | 930 | extern void opal_lpc_init(void); |
939 | 931 | ||
932 | struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr, | ||
933 | unsigned long vmalloc_size); | ||
934 | void opal_free_sg_list(struct opal_sg_list *sg); | ||
935 | |||
940 | #endif /* __ASSEMBLY__ */ | 936 | #endif /* __ASSEMBLY__ */ |
941 | 937 | ||
942 | #endif /* __OPAL_H */ | 938 | #endif /* __OPAL_H */ |
diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h index 6586a40a46ce..cded7c1278ef 100644 --- a/arch/powerpc/include/asm/ppc_asm.h +++ b/arch/powerpc/include/asm/ppc_asm.h | |||
@@ -318,11 +318,16 @@ n: | |||
318 | addi reg,reg,(name - 0b)@l; | 318 | addi reg,reg,(name - 0b)@l; |
319 | 319 | ||
320 | #ifdef __powerpc64__ | 320 | #ifdef __powerpc64__ |
321 | #ifdef HAVE_AS_ATHIGH | ||
322 | #define __AS_ATHIGH high | ||
323 | #else | ||
324 | #define __AS_ATHIGH h | ||
325 | #endif | ||
321 | #define LOAD_REG_IMMEDIATE(reg,expr) \ | 326 | #define LOAD_REG_IMMEDIATE(reg,expr) \ |
322 | lis reg,(expr)@highest; \ | 327 | lis reg,(expr)@highest; \ |
323 | ori reg,reg,(expr)@higher; \ | 328 | ori reg,reg,(expr)@higher; \ |
324 | rldicr reg,reg,32,31; \ | 329 | rldicr reg,reg,32,31; \ |
325 | oris reg,reg,(expr)@h; \ | 330 | oris reg,reg,(expr)@__AS_ATHIGH; \ |
326 | ori reg,reg,(expr)@l; | 331 | ori reg,reg,(expr)@l; |
327 | 332 | ||
328 | #define LOAD_REG_ADDR(reg,name) \ | 333 | #define LOAD_REG_ADDR(reg,name) \ |
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h index d0e784e0ff48..521790330672 100644 --- a/arch/powerpc/include/asm/sections.h +++ b/arch/powerpc/include/asm/sections.h | |||
@@ -39,6 +39,17 @@ static inline int overlaps_kernel_text(unsigned long start, unsigned long end) | |||
39 | (unsigned long)_stext < end; | 39 | (unsigned long)_stext < end; |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline int overlaps_kvm_tmp(unsigned long start, unsigned long end) | ||
43 | { | ||
44 | #ifdef CONFIG_KVM_GUEST | ||
45 | extern char kvm_tmp[]; | ||
46 | return start < (unsigned long)kvm_tmp && | ||
47 | (unsigned long)&kvm_tmp[1024 * 1024] < end; | ||
48 | #else | ||
49 | return 0; | ||
50 | #endif | ||
51 | } | ||
52 | |||
42 | #undef dereference_function_descriptor | 53 | #undef dereference_function_descriptor |
43 | static inline void *dereference_function_descriptor(void *ptr) | 54 | static inline void *dereference_function_descriptor(void *ptr) |
44 | { | 55 | { |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 3ddf70276706..ea4dc3a89c1f 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -361,3 +361,4 @@ SYSCALL(finit_module) | |||
361 | SYSCALL(ni_syscall) /* sys_kcmp */ | 361 | SYSCALL(ni_syscall) /* sys_kcmp */ |
362 | SYSCALL_SPU(sched_setattr) | 362 | SYSCALL_SPU(sched_setattr) |
363 | SYSCALL_SPU(sched_getattr) | 363 | SYSCALL_SPU(sched_getattr) |
364 | SYSCALL_SPU(renameat2) | ||
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index 4494f029b632..9b892bbd9d84 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
13 | 13 | ||
14 | 14 | ||
15 | #define __NR_syscalls 357 | 15 | #define __NR_syscalls 358 |
16 | 16 | ||
17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
18 | #define NR_syscalls __NR_syscalls | 18 | #define NR_syscalls __NR_syscalls |
diff --git a/arch/powerpc/include/uapi/asm/setup.h b/arch/powerpc/include/uapi/asm/setup.h index 552df83f1a49..ae3fb68cb28e 100644 --- a/arch/powerpc/include/uapi/asm/setup.h +++ b/arch/powerpc/include/uapi/asm/setup.h | |||
@@ -1 +1,6 @@ | |||
1 | #include <asm-generic/setup.h> | 1 | #ifndef _UAPI_ASM_POWERPC_SETUP_H |
2 | #define _UAPI_ASM_POWERPC_SETUP_H | ||
3 | |||
4 | #define COMMAND_LINE_SIZE 2048 | ||
5 | |||
6 | #endif /* _UAPI_ASM_POWERPC_SETUP_H */ | ||
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index 881bf2e2560d..2d526f7b48da 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
@@ -379,5 +379,6 @@ | |||
379 | #define __NR_kcmp 354 | 379 | #define __NR_kcmp 354 |
380 | #define __NR_sched_setattr 355 | 380 | #define __NR_sched_setattr 355 |
381 | #define __NR_sched_getattr 356 | 381 | #define __NR_sched_getattr 356 |
382 | #define __NR_renameat2 357 | ||
382 | 383 | ||
383 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 384 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c index 6a0175297b0d..dd8695f6cb6d 100644 --- a/arch/powerpc/kernel/kvm.c +++ b/arch/powerpc/kernel/kvm.c | |||
@@ -74,7 +74,7 @@ | |||
74 | #define KVM_INST_MTSRIN 0x7c0001e4 | 74 | #define KVM_INST_MTSRIN 0x7c0001e4 |
75 | 75 | ||
76 | static bool kvm_patching_worked = true; | 76 | static bool kvm_patching_worked = true; |
77 | static char kvm_tmp[1024 * 1024]; | 77 | char kvm_tmp[1024 * 1024]; |
78 | static int kvm_tmp_index; | 78 | static int kvm_tmp_index; |
79 | 79 | ||
80 | static inline void kvm_patch_ins(u32 *inst, u32 new_inst) | 80 | static inline void kvm_patch_ins(u32 *inst, u32 new_inst) |
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index 59d229a2a3e0..879b3aacac32 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c | |||
@@ -237,7 +237,7 @@ static void wake_offline_cpus(void) | |||
237 | if (!cpu_online(cpu)) { | 237 | if (!cpu_online(cpu)) { |
238 | printk(KERN_INFO "kexec: Waking offline cpu %d.\n", | 238 | printk(KERN_INFO "kexec: Waking offline cpu %d.\n", |
239 | cpu); | 239 | cpu); |
240 | cpu_up(cpu); | 240 | WARN_ON(cpu_up(cpu)); |
241 | } | 241 | } |
242 | } | 242 | } |
243 | } | 243 | } |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 2a4779091a58..155013da27e0 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -208,7 +208,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, | |||
208 | unsigned long in_devfn) | 208 | unsigned long in_devfn) |
209 | { | 209 | { |
210 | struct pci_controller* hose; | 210 | struct pci_controller* hose; |
211 | struct pci_bus *bus = NULL; | 211 | struct pci_bus *tmp_bus, *bus = NULL; |
212 | struct device_node *hose_node; | 212 | struct device_node *hose_node; |
213 | 213 | ||
214 | /* Argh ! Please forgive me for that hack, but that's the | 214 | /* Argh ! Please forgive me for that hack, but that's the |
@@ -229,10 +229,12 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus, | |||
229 | * used on pre-domains setup. We return the first match | 229 | * used on pre-domains setup. We return the first match |
230 | */ | 230 | */ |
231 | 231 | ||
232 | list_for_each_entry(bus, &pci_root_buses, node) { | 232 | list_for_each_entry(tmp_bus, &pci_root_buses, node) { |
233 | if (in_bus >= bus->number && in_bus <= bus->busn_res.end) | 233 | if (in_bus >= tmp_bus->number && |
234 | in_bus <= tmp_bus->busn_res.end) { | ||
235 | bus = tmp_bus; | ||
234 | break; | 236 | break; |
235 | bus = NULL; | 237 | } |
236 | } | 238 | } |
237 | if (bus == NULL || bus->dev.of_node == NULL) | 239 | if (bus == NULL || bus->dev.of_node == NULL) |
238 | return -ENODEV; | 240 | return -ENODEV; |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index 3bd77edd7610..450850a49dce 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -120,6 +120,7 @@ EXPORT_SYMBOL(giveup_spe); | |||
120 | EXPORT_SYMBOL(flush_instruction_cache); | 120 | EXPORT_SYMBOL(flush_instruction_cache); |
121 | #endif | 121 | #endif |
122 | EXPORT_SYMBOL(flush_dcache_range); | 122 | EXPORT_SYMBOL(flush_dcache_range); |
123 | EXPORT_SYMBOL(flush_icache_range); | ||
123 | 124 | ||
124 | #ifdef CONFIG_SMP | 125 | #ifdef CONFIG_SMP |
125 | #ifdef CONFIG_PPC32 | 126 | #ifdef CONFIG_PPC32 |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 2f3cdb01506d..658e89d2025b 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -705,7 +705,7 @@ static int __init rtas_flash_init(void) | |||
705 | if (rtas_token("ibm,update-flash-64-and-reboot") == | 705 | if (rtas_token("ibm,update-flash-64-and-reboot") == |
706 | RTAS_UNKNOWN_SERVICE) { | 706 | RTAS_UNKNOWN_SERVICE) { |
707 | pr_info("rtas_flash: no firmware flash support\n"); | 707 | pr_info("rtas_flash: no firmware flash support\n"); |
708 | return 1; | 708 | return -EINVAL; |
709 | } | 709 | } |
710 | 710 | ||
711 | rtas_validate_flash_data.buf = kzalloc(VALIDATE_BUF_SIZE, GFP_KERNEL); | 711 | rtas_validate_flash_data.buf = kzalloc(VALIDATE_BUF_SIZE, GFP_KERNEL); |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 122a580f7322..7e711bdcc6da 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -813,9 +813,6 @@ static void __init clocksource_init(void) | |||
813 | static int decrementer_set_next_event(unsigned long evt, | 813 | static int decrementer_set_next_event(unsigned long evt, |
814 | struct clock_event_device *dev) | 814 | struct clock_event_device *dev) |
815 | { | 815 | { |
816 | /* Don't adjust the decrementer if some irq work is pending */ | ||
817 | if (test_irq_work_pending()) | ||
818 | return 0; | ||
819 | __get_cpu_var(decrementers_next_tb) = get_tb_or_rtc() + evt; | 816 | __get_cpu_var(decrementers_next_tb) = get_tb_or_rtc() + evt; |
820 | set_dec(evt); | 817 | set_dec(evt); |
821 | 818 | ||
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 94e597e6f15c..7af190a266b3 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -886,7 +886,7 @@ static int kvmppc_book3s_init(void) | |||
886 | r = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); | 886 | r = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); |
887 | if (r) | 887 | if (r) |
888 | return r; | 888 | return r; |
889 | #ifdef CONFIG_KVM_BOOK3S_32 | 889 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER |
890 | r = kvmppc_book3s_init_pr(); | 890 | r = kvmppc_book3s_init_pr(); |
891 | #endif | 891 | #endif |
892 | return r; | 892 | return r; |
@@ -895,7 +895,7 @@ static int kvmppc_book3s_init(void) | |||
895 | 895 | ||
896 | static void kvmppc_book3s_exit(void) | 896 | static void kvmppc_book3s_exit(void) |
897 | { | 897 | { |
898 | #ifdef CONFIG_KVM_BOOK3S_32 | 898 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER |
899 | kvmppc_book3s_exit_pr(); | 899 | kvmppc_book3s_exit_pr(); |
900 | #endif | 900 | #endif |
901 | kvm_exit(); | 901 | kvm_exit(); |
@@ -905,7 +905,7 @@ module_init(kvmppc_book3s_init); | |||
905 | module_exit(kvmppc_book3s_exit); | 905 | module_exit(kvmppc_book3s_exit); |
906 | 906 | ||
907 | /* On 32bit this is our one and only kernel module */ | 907 | /* On 32bit this is our one and only kernel module */ |
908 | #ifdef CONFIG_KVM_BOOK3S_32 | 908 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER |
909 | MODULE_ALIAS_MISCDEV(KVM_MINOR); | 909 | MODULE_ALIAS_MISCDEV(KVM_MINOR); |
910 | MODULE_ALIAS("devname:kvm"); | 910 | MODULE_ALIAS("devname:kvm"); |
911 | #endif | 911 | #endif |
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index 1d6c56ad5b60..8fcc36306a02 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c | |||
@@ -234,7 +234,7 @@ long kvmppc_do_h_enter(struct kvm *kvm, unsigned long flags, | |||
234 | pte_size = psize; | 234 | pte_size = psize; |
235 | pte = lookup_linux_pte_and_update(pgdir, hva, writing, | 235 | pte = lookup_linux_pte_and_update(pgdir, hva, writing, |
236 | &pte_size); | 236 | &pte_size); |
237 | if (pte_present(pte)) { | 237 | if (pte_present(pte) && !pte_numa(pte)) { |
238 | if (writing && !pte_write(pte)) | 238 | if (writing && !pte_write(pte)) |
239 | /* make the actual HPTE be read-only */ | 239 | /* make the actual HPTE be read-only */ |
240 | ptel = hpte_make_readonly(ptel); | 240 | ptel = hpte_make_readonly(ptel); |
diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S index ffbb871c2bd8..07c8b5b0f9d2 100644 --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S | |||
@@ -242,6 +242,12 @@ kvm_novcpu_exit: | |||
242 | */ | 242 | */ |
243 | .globl kvm_start_guest | 243 | .globl kvm_start_guest |
244 | kvm_start_guest: | 244 | kvm_start_guest: |
245 | |||
246 | /* Set runlatch bit the minute you wake up from nap */ | ||
247 | mfspr r1, SPRN_CTRLF | ||
248 | ori r1, r1, 1 | ||
249 | mtspr SPRN_CTRLT, r1 | ||
250 | |||
245 | ld r2,PACATOC(r13) | 251 | ld r2,PACATOC(r13) |
246 | 252 | ||
247 | li r0,KVM_HWTHREAD_IN_KVM | 253 | li r0,KVM_HWTHREAD_IN_KVM |
@@ -309,6 +315,11 @@ kvm_no_guest: | |||
309 | li r0, KVM_HWTHREAD_IN_NAP | 315 | li r0, KVM_HWTHREAD_IN_NAP |
310 | stb r0, HSTATE_HWTHREAD_STATE(r13) | 316 | stb r0, HSTATE_HWTHREAD_STATE(r13) |
311 | kvm_do_nap: | 317 | kvm_do_nap: |
318 | /* Clear the runlatch bit before napping */ | ||
319 | mfspr r2, SPRN_CTRLF | ||
320 | clrrdi r2, r2, 1 | ||
321 | mtspr SPRN_CTRLT, r2 | ||
322 | |||
312 | li r3, LPCR_PECE0 | 323 | li r3, LPCR_PECE0 |
313 | mfspr r4, SPRN_LPCR | 324 | mfspr r4, SPRN_LPCR |
314 | rlwimi r4, r3, 0, LPCR_PECE0 | LPCR_PECE1 | 325 | rlwimi r4, r3, 0, LPCR_PECE0 | LPCR_PECE1 |
@@ -1312,6 +1323,110 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_206) | |||
1312 | mr r3, r9 | 1323 | mr r3, r9 |
1313 | bl kvmppc_save_fp | 1324 | bl kvmppc_save_fp |
1314 | 1325 | ||
1326 | #ifdef CONFIG_PPC_TRANSACTIONAL_MEM | ||
1327 | BEGIN_FTR_SECTION | ||
1328 | b 2f | ||
1329 | END_FTR_SECTION_IFCLR(CPU_FTR_TM) | ||
1330 | /* Turn on TM. */ | ||
1331 | mfmsr r8 | ||
1332 | li r0, 1 | ||
1333 | rldimi r8, r0, MSR_TM_LG, 63-MSR_TM_LG | ||
1334 | mtmsrd r8 | ||
1335 | |||
1336 | ld r5, VCPU_MSR(r9) | ||
1337 | rldicl. r5, r5, 64 - MSR_TS_S_LG, 62 | ||
1338 | beq 1f /* TM not active in guest. */ | ||
1339 | |||
1340 | li r3, TM_CAUSE_KVM_RESCHED | ||
1341 | |||
1342 | /* Clear the MSR RI since r1, r13 are all going to be foobar. */ | ||
1343 | li r5, 0 | ||
1344 | mtmsrd r5, 1 | ||
1345 | |||
1346 | /* All GPRs are volatile at this point. */ | ||
1347 | TRECLAIM(R3) | ||
1348 | |||
1349 | /* Temporarily store r13 and r9 so we have some regs to play with */ | ||
1350 | SET_SCRATCH0(r13) | ||
1351 | GET_PACA(r13) | ||
1352 | std r9, PACATMSCRATCH(r13) | ||
1353 | ld r9, HSTATE_KVM_VCPU(r13) | ||
1354 | |||
1355 | /* Get a few more GPRs free. */ | ||
1356 | std r29, VCPU_GPRS_TM(29)(r9) | ||
1357 | std r30, VCPU_GPRS_TM(30)(r9) | ||
1358 | std r31, VCPU_GPRS_TM(31)(r9) | ||
1359 | |||
1360 | /* Save away PPR and DSCR soon so don't run with user values. */ | ||
1361 | mfspr r31, SPRN_PPR | ||
1362 | HMT_MEDIUM | ||
1363 | mfspr r30, SPRN_DSCR | ||
1364 | ld r29, HSTATE_DSCR(r13) | ||
1365 | mtspr SPRN_DSCR, r29 | ||
1366 | |||
1367 | /* Save all but r9, r13 & r29-r31 */ | ||
1368 | reg = 0 | ||
1369 | .rept 29 | ||
1370 | .if (reg != 9) && (reg != 13) | ||
1371 | std reg, VCPU_GPRS_TM(reg)(r9) | ||
1372 | .endif | ||
1373 | reg = reg + 1 | ||
1374 | .endr | ||
1375 | /* ... now save r13 */ | ||
1376 | GET_SCRATCH0(r4) | ||
1377 | std r4, VCPU_GPRS_TM(13)(r9) | ||
1378 | /* ... and save r9 */ | ||
1379 | ld r4, PACATMSCRATCH(r13) | ||
1380 | std r4, VCPU_GPRS_TM(9)(r9) | ||
1381 | |||
1382 | /* Reload stack pointer and TOC. */ | ||
1383 | ld r1, HSTATE_HOST_R1(r13) | ||
1384 | ld r2, PACATOC(r13) | ||
1385 | |||
1386 | /* Set MSR RI now we have r1 and r13 back. */ | ||
1387 | li r5, MSR_RI | ||
1388 | mtmsrd r5, 1 | ||
1389 | |||
1390 | /* Save away checkpinted SPRs. */ | ||
1391 | std r31, VCPU_PPR_TM(r9) | ||
1392 | std r30, VCPU_DSCR_TM(r9) | ||
1393 | mflr r5 | ||
1394 | mfcr r6 | ||
1395 | mfctr r7 | ||
1396 | mfspr r8, SPRN_AMR | ||
1397 | mfspr r10, SPRN_TAR | ||
1398 | std r5, VCPU_LR_TM(r9) | ||
1399 | stw r6, VCPU_CR_TM(r9) | ||
1400 | std r7, VCPU_CTR_TM(r9) | ||
1401 | std r8, VCPU_AMR_TM(r9) | ||
1402 | std r10, VCPU_TAR_TM(r9) | ||
1403 | |||
1404 | /* Restore r12 as trap number. */ | ||
1405 | lwz r12, VCPU_TRAP(r9) | ||
1406 | |||
1407 | /* Save FP/VSX. */ | ||
1408 | addi r3, r9, VCPU_FPRS_TM | ||
1409 | bl .store_fp_state | ||
1410 | addi r3, r9, VCPU_VRS_TM | ||
1411 | bl .store_vr_state | ||
1412 | mfspr r6, SPRN_VRSAVE | ||
1413 | stw r6, VCPU_VRSAVE_TM(r9) | ||
1414 | 1: | ||
1415 | /* | ||
1416 | * We need to save these SPRs after the treclaim so that the software | ||
1417 | * error code is recorded correctly in the TEXASR. Also the user may | ||
1418 | * change these outside of a transaction, so they must always be | ||
1419 | * context switched. | ||
1420 | */ | ||
1421 | mfspr r5, SPRN_TFHAR | ||
1422 | mfspr r6, SPRN_TFIAR | ||
1423 | mfspr r7, SPRN_TEXASR | ||
1424 | std r5, VCPU_TFHAR(r9) | ||
1425 | std r6, VCPU_TFIAR(r9) | ||
1426 | std r7, VCPU_TEXASR(r9) | ||
1427 | 2: | ||
1428 | #endif | ||
1429 | |||
1315 | /* Increment yield count if they have a VPA */ | 1430 | /* Increment yield count if they have a VPA */ |
1316 | ld r8, VCPU_VPA(r9) /* do they have a VPA? */ | 1431 | ld r8, VCPU_VPA(r9) /* do they have a VPA? */ |
1317 | cmpdi r8, 0 | 1432 | cmpdi r8, 0 |
@@ -1999,8 +2114,13 @@ END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_206) | |||
1999 | 2114 | ||
2000 | /* | 2115 | /* |
2001 | * Take a nap until a decrementer or external or doobell interrupt | 2116 | * Take a nap until a decrementer or external or doobell interrupt |
2002 | * occurs, with PECE1, PECE0 and PECEDP set in LPCR | 2117 | * occurs, with PECE1, PECE0 and PECEDP set in LPCR. Also clear the |
2118 | * runlatch bit before napping. | ||
2003 | */ | 2119 | */ |
2120 | mfspr r2, SPRN_CTRLF | ||
2121 | clrrdi r2, r2, 1 | ||
2122 | mtspr SPRN_CTRLT, r2 | ||
2123 | |||
2004 | li r0,1 | 2124 | li r0,1 |
2005 | stb r0,HSTATE_HWTHREAD_REQ(r13) | 2125 | stb r0,HSTATE_HWTHREAD_REQ(r13) |
2006 | mfspr r5,SPRN_LPCR | 2126 | mfspr r5,SPRN_LPCR |
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c index c5c052a9729c..02f1defd8bb9 100644 --- a/arch/powerpc/kvm/book3s_pr.c +++ b/arch/powerpc/kvm/book3s_pr.c | |||
@@ -1153,7 +1153,7 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_pr(struct kvm *kvm, | |||
1153 | goto free_vcpu; | 1153 | goto free_vcpu; |
1154 | vcpu->arch.book3s = vcpu_book3s; | 1154 | vcpu->arch.book3s = vcpu_book3s; |
1155 | 1155 | ||
1156 | #ifdef CONFIG_KVM_BOOK3S_32 | 1156 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER |
1157 | vcpu->arch.shadow_vcpu = | 1157 | vcpu->arch.shadow_vcpu = |
1158 | kzalloc(sizeof(*vcpu->arch.shadow_vcpu), GFP_KERNEL); | 1158 | kzalloc(sizeof(*vcpu->arch.shadow_vcpu), GFP_KERNEL); |
1159 | if (!vcpu->arch.shadow_vcpu) | 1159 | if (!vcpu->arch.shadow_vcpu) |
@@ -1198,7 +1198,7 @@ static struct kvm_vcpu *kvmppc_core_vcpu_create_pr(struct kvm *kvm, | |||
1198 | uninit_vcpu: | 1198 | uninit_vcpu: |
1199 | kvm_vcpu_uninit(vcpu); | 1199 | kvm_vcpu_uninit(vcpu); |
1200 | free_shadow_vcpu: | 1200 | free_shadow_vcpu: |
1201 | #ifdef CONFIG_KVM_BOOK3S_32 | 1201 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER |
1202 | kfree(vcpu->arch.shadow_vcpu); | 1202 | kfree(vcpu->arch.shadow_vcpu); |
1203 | free_vcpu3s: | 1203 | free_vcpu3s: |
1204 | #endif | 1204 | #endif |
@@ -1215,7 +1215,7 @@ static void kvmppc_core_vcpu_free_pr(struct kvm_vcpu *vcpu) | |||
1215 | 1215 | ||
1216 | free_page((unsigned long)vcpu->arch.shared & PAGE_MASK); | 1216 | free_page((unsigned long)vcpu->arch.shared & PAGE_MASK); |
1217 | kvm_vcpu_uninit(vcpu); | 1217 | kvm_vcpu_uninit(vcpu); |
1218 | #ifdef CONFIG_KVM_BOOK3S_32 | 1218 | #ifdef CONFIG_KVM_BOOK3S_32_HANDLER |
1219 | kfree(vcpu->arch.shadow_vcpu); | 1219 | kfree(vcpu->arch.shadow_vcpu); |
1220 | #endif | 1220 | #endif |
1221 | vfree(vcpu_book3s); | 1221 | vfree(vcpu_book3s); |
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c index 3ea26c25590b..cf1d325eae8b 100644 --- a/arch/powerpc/mm/hash_native_64.c +++ b/arch/powerpc/mm/hash_native_64.c | |||
@@ -82,17 +82,14 @@ static inline void __tlbie(unsigned long vpn, int psize, int apsize, int ssize) | |||
82 | va &= ~((1ul << mmu_psize_defs[apsize].shift) - 1); | 82 | va &= ~((1ul << mmu_psize_defs[apsize].shift) - 1); |
83 | va |= penc << 12; | 83 | va |= penc << 12; |
84 | va |= ssize << 8; | 84 | va |= ssize << 8; |
85 | /* Add AVAL part */ | 85 | /* |
86 | if (psize != apsize) { | 86 | * AVAL bits: |
87 | /* | 87 | * We don't need all the bits, but rest of the bits |
88 | * MPSS, 64K base page size and 16MB parge page size | 88 | * must be ignored by the processor. |
89 | * We don't need all the bits, but rest of the bits | 89 | * vpn cover upto 65 bits of va. (0...65) and we need |
90 | * must be ignored by the processor. | 90 | * 58..64 bits of va. |
91 | * vpn cover upto 65 bits of va. (0...65) and we need | 91 | */ |
92 | * 58..64 bits of va. | 92 | va |= (vpn & 0xfe); /* AVAL */ |
93 | */ | ||
94 | va |= (vpn & 0xfe); | ||
95 | } | ||
96 | va |= 1; /* L */ | 93 | va |= 1; /* L */ |
97 | asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2) | 94 | asm volatile(ASM_FTR_IFCLR("tlbie %0,1", PPC_TLBIE(%1,%0), %2) |
98 | : : "r" (va), "r"(0), "i" (CPU_FTR_ARCH_206) | 95 | : : "r" (va), "r"(0), "i" (CPU_FTR_ARCH_206) |
@@ -133,17 +130,14 @@ static inline void __tlbiel(unsigned long vpn, int psize, int apsize, int ssize) | |||
133 | va &= ~((1ul << mmu_psize_defs[apsize].shift) - 1); | 130 | va &= ~((1ul << mmu_psize_defs[apsize].shift) - 1); |
134 | va |= penc << 12; | 131 | va |= penc << 12; |
135 | va |= ssize << 8; | 132 | va |= ssize << 8; |
136 | /* Add AVAL part */ | 133 | /* |
137 | if (psize != apsize) { | 134 | * AVAL bits: |
138 | /* | 135 | * We don't need all the bits, but rest of the bits |
139 | * MPSS, 64K base page size and 16MB parge page size | 136 | * must be ignored by the processor. |
140 | * We don't need all the bits, but rest of the bits | 137 | * vpn cover upto 65 bits of va. (0...65) and we need |
141 | * must be ignored by the processor. | 138 | * 58..64 bits of va. |
142 | * vpn cover upto 65 bits of va. (0...65) and we need | 139 | */ |
143 | * 58..64 bits of va. | 140 | va |= (vpn & 0xfe); |
144 | */ | ||
145 | va |= (vpn & 0xfe); | ||
146 | } | ||
147 | va |= 1; /* L */ | 141 | va |= 1; /* L */ |
148 | asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)" | 142 | asm volatile(".long 0x7c000224 | (%0 << 11) | (1 << 21)" |
149 | : : "r"(va) : "memory"); | 143 | : : "r"(va) : "memory"); |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index d766d6ee33fe..06ba83b036d3 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -207,6 +207,10 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, | |||
207 | if (overlaps_kernel_text(vaddr, vaddr + step)) | 207 | if (overlaps_kernel_text(vaddr, vaddr + step)) |
208 | tprot &= ~HPTE_R_N; | 208 | tprot &= ~HPTE_R_N; |
209 | 209 | ||
210 | /* Make kvm guest trampolines executable */ | ||
211 | if (overlaps_kvm_tmp(vaddr, vaddr + step)) | ||
212 | tprot &= ~HPTE_R_N; | ||
213 | |||
210 | /* | 214 | /* |
211 | * If relocatable, check if it overlaps interrupt vectors that | 215 | * If relocatable, check if it overlaps interrupt vectors that |
212 | * are copied down to real 0. For relocatable kernel | 216 | * are copied down to real 0. For relocatable kernel |
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 4ebbb9e99286..3b181b22cd46 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c | |||
@@ -232,6 +232,7 @@ int __node_distance(int a, int b) | |||
232 | 232 | ||
233 | return distance; | 233 | return distance; |
234 | } | 234 | } |
235 | EXPORT_SYMBOL(__node_distance); | ||
235 | 236 | ||
236 | static void initialize_distance_lookup_table(int nid, | 237 | static void initialize_distance_lookup_table(int nid, |
237 | const __be32 *associativity) | 238 | const __be32 *associativity) |
diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 297c91051413..e0766b82e165 100644 --- a/arch/powerpc/perf/hv-24x7.c +++ b/arch/powerpc/perf/hv-24x7.c | |||
@@ -155,16 +155,28 @@ static ssize_t read_offset_data(void *dest, size_t dest_len, | |||
155 | return copy_len; | 155 | return copy_len; |
156 | } | 156 | } |
157 | 157 | ||
158 | static unsigned long h_get_24x7_catalog_page(char page[static 4096], | 158 | static unsigned long h_get_24x7_catalog_page_(unsigned long phys_4096, |
159 | u32 version, u32 index) | 159 | unsigned long version, |
160 | unsigned long index) | ||
160 | { | 161 | { |
161 | WARN_ON(!IS_ALIGNED((unsigned long)page, 4096)); | 162 | pr_devel("h_get_24x7_catalog_page(0x%lx, %lu, %lu)", |
163 | phys_4096, | ||
164 | version, | ||
165 | index); | ||
166 | WARN_ON(!IS_ALIGNED(phys_4096, 4096)); | ||
162 | return plpar_hcall_norets(H_GET_24X7_CATALOG_PAGE, | 167 | return plpar_hcall_norets(H_GET_24X7_CATALOG_PAGE, |
163 | virt_to_phys(page), | 168 | phys_4096, |
164 | version, | 169 | version, |
165 | index); | 170 | index); |
166 | } | 171 | } |
167 | 172 | ||
173 | static unsigned long h_get_24x7_catalog_page(char page[], | ||
174 | u64 version, u32 index) | ||
175 | { | ||
176 | return h_get_24x7_catalog_page_(virt_to_phys(page), | ||
177 | version, index); | ||
178 | } | ||
179 | |||
168 | static ssize_t catalog_read(struct file *filp, struct kobject *kobj, | 180 | static ssize_t catalog_read(struct file *filp, struct kobject *kobj, |
169 | struct bin_attribute *bin_attr, char *buf, | 181 | struct bin_attribute *bin_attr, char *buf, |
170 | loff_t offset, size_t count) | 182 | loff_t offset, size_t count) |
@@ -173,7 +185,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj, | |||
173 | ssize_t ret = 0; | 185 | ssize_t ret = 0; |
174 | size_t catalog_len = 0, catalog_page_len = 0, page_count = 0; | 186 | size_t catalog_len = 0, catalog_page_len = 0, page_count = 0; |
175 | loff_t page_offset = 0; | 187 | loff_t page_offset = 0; |
176 | uint32_t catalog_version_num = 0; | 188 | uint64_t catalog_version_num = 0; |
177 | void *page = kmem_cache_alloc(hv_page_cache, GFP_USER); | 189 | void *page = kmem_cache_alloc(hv_page_cache, GFP_USER); |
178 | struct hv_24x7_catalog_page_0 *page_0 = page; | 190 | struct hv_24x7_catalog_page_0 *page_0 = page; |
179 | if (!page) | 191 | if (!page) |
@@ -185,7 +197,7 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj, | |||
185 | goto e_free; | 197 | goto e_free; |
186 | } | 198 | } |
187 | 199 | ||
188 | catalog_version_num = be32_to_cpu(page_0->version); | 200 | catalog_version_num = be64_to_cpu(page_0->version); |
189 | catalog_page_len = be32_to_cpu(page_0->length); | 201 | catalog_page_len = be32_to_cpu(page_0->length); |
190 | catalog_len = catalog_page_len * 4096; | 202 | catalog_len = catalog_page_len * 4096; |
191 | 203 | ||
@@ -208,8 +220,9 @@ static ssize_t catalog_read(struct file *filp, struct kobject *kobj, | |||
208 | page, 4096, page_offset * 4096); | 220 | page, 4096, page_offset * 4096); |
209 | e_free: | 221 | e_free: |
210 | if (hret) | 222 | if (hret) |
211 | pr_err("h_get_24x7_catalog_page(ver=%d, page=%lld) failed: rc=%ld\n", | 223 | pr_err("h_get_24x7_catalog_page(ver=%lld, page=%lld) failed:" |
212 | catalog_version_num, page_offset, hret); | 224 | " rc=%ld\n", |
225 | catalog_version_num, page_offset, hret); | ||
213 | kfree(page); | 226 | kfree(page); |
214 | 227 | ||
215 | pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n", | 228 | pr_devel("catalog_read: offset=%lld(%lld) count=%zu(%zu) catalog_len=%zu(%zu) => %zd\n", |
@@ -243,7 +256,7 @@ e_free: \ | |||
243 | static DEVICE_ATTR_RO(_name) | 256 | static DEVICE_ATTR_RO(_name) |
244 | 257 | ||
245 | PAGE_0_ATTR(catalog_version, "%lld\n", | 258 | PAGE_0_ATTR(catalog_version, "%lld\n", |
246 | (unsigned long long)be32_to_cpu(page_0->version)); | 259 | (unsigned long long)be64_to_cpu(page_0->version)); |
247 | PAGE_0_ATTR(catalog_len, "%lld\n", | 260 | PAGE_0_ATTR(catalog_len, "%lld\n", |
248 | (unsigned long long)be32_to_cpu(page_0->length) * 4096); | 261 | (unsigned long long)be32_to_cpu(page_0->length) * 4096); |
249 | static BIN_ATTR_RO(catalog, 0/* real length varies */); | 262 | static BIN_ATTR_RO(catalog, 0/* real length varies */); |
@@ -485,13 +498,13 @@ static int hv_24x7_init(void) | |||
485 | struct hv_perf_caps caps; | 498 | struct hv_perf_caps caps; |
486 | 499 | ||
487 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { | 500 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { |
488 | pr_info("not a virtualized system, not enabling\n"); | 501 | pr_debug("not a virtualized system, not enabling\n"); |
489 | return -ENODEV; | 502 | return -ENODEV; |
490 | } | 503 | } |
491 | 504 | ||
492 | hret = hv_perf_caps_get(&caps); | 505 | hret = hv_perf_caps_get(&caps); |
493 | if (hret) { | 506 | if (hret) { |
494 | pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n", | 507 | pr_debug("could not obtain capabilities, not enabling, rc=%ld\n", |
495 | hret); | 508 | hret); |
496 | return -ENODEV; | 509 | return -ENODEV; |
497 | } | 510 | } |
diff --git a/arch/powerpc/perf/hv-gpci.c b/arch/powerpc/perf/hv-gpci.c index 278ba7b9c2b5..c9d399a2df82 100644 --- a/arch/powerpc/perf/hv-gpci.c +++ b/arch/powerpc/perf/hv-gpci.c | |||
@@ -78,7 +78,7 @@ static ssize_t kernel_version_show(struct device *dev, | |||
78 | return sprintf(page, "0x%x\n", COUNTER_INFO_VERSION_CURRENT); | 78 | return sprintf(page, "0x%x\n", COUNTER_INFO_VERSION_CURRENT); |
79 | } | 79 | } |
80 | 80 | ||
81 | DEVICE_ATTR_RO(kernel_version); | 81 | static DEVICE_ATTR_RO(kernel_version); |
82 | HV_CAPS_ATTR(version, "0x%x\n"); | 82 | HV_CAPS_ATTR(version, "0x%x\n"); |
83 | HV_CAPS_ATTR(ga, "%d\n"); | 83 | HV_CAPS_ATTR(ga, "%d\n"); |
84 | HV_CAPS_ATTR(expanded, "%d\n"); | 84 | HV_CAPS_ATTR(expanded, "%d\n"); |
@@ -273,13 +273,13 @@ static int hv_gpci_init(void) | |||
273 | struct hv_perf_caps caps; | 273 | struct hv_perf_caps caps; |
274 | 274 | ||
275 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { | 275 | if (!firmware_has_feature(FW_FEATURE_LPAR)) { |
276 | pr_info("not a virtualized system, not enabling\n"); | 276 | pr_debug("not a virtualized system, not enabling\n"); |
277 | return -ENODEV; | 277 | return -ENODEV; |
278 | } | 278 | } |
279 | 279 | ||
280 | hret = hv_perf_caps_get(&caps); | 280 | hret = hv_perf_caps_get(&caps); |
281 | if (hret) { | 281 | if (hret) { |
282 | pr_info("could not obtain capabilities, error 0x%80lx, not enabling\n", | 282 | pr_debug("could not obtain capabilities, not enabling, rc=%ld\n", |
283 | hret); | 283 | hret); |
284 | return -ENODEV; | 284 | return -ENODEV; |
285 | } | 285 | } |
diff --git a/arch/powerpc/platforms/powernv/eeh-ioda.c b/arch/powerpc/platforms/powernv/eeh-ioda.c index 253fefe3d1a0..5b51079f3e3b 100644 --- a/arch/powerpc/platforms/powernv/eeh-ioda.c +++ b/arch/powerpc/platforms/powernv/eeh-ioda.c | |||
@@ -549,7 +549,8 @@ static int ioda_eeh_reset(struct eeh_pe *pe, int option) | |||
549 | ret = ioda_eeh_phb_reset(hose, option); | 549 | ret = ioda_eeh_phb_reset(hose, option); |
550 | } else { | 550 | } else { |
551 | bus = eeh_pe_bus_get(pe); | 551 | bus = eeh_pe_bus_get(pe); |
552 | if (pci_is_root_bus(bus)) | 552 | if (pci_is_root_bus(bus) || |
553 | pci_is_root_bus(bus->parent)) | ||
553 | ret = ioda_eeh_root_reset(hose, option); | 554 | ret = ioda_eeh_root_reset(hose, option); |
554 | else | 555 | else |
555 | ret = ioda_eeh_bridge_reset(hose, bus->self, option); | 556 | ret = ioda_eeh_bridge_reset(hose, bus->self, option); |
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c index b9827b0d87e4..788a1977b9a5 100644 --- a/arch/powerpc/platforms/powernv/opal-dump.c +++ b/arch/powerpc/platforms/powernv/opal-dump.c | |||
@@ -209,89 +209,20 @@ static struct kobj_type dump_ktype = { | |||
209 | .default_attrs = dump_default_attrs, | 209 | .default_attrs = dump_default_attrs, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static void free_dump_sg_list(struct opal_sg_list *list) | 212 | static int64_t dump_read_info(uint32_t *dump_id, uint32_t *dump_size, uint32_t *dump_type) |
213 | { | ||
214 | struct opal_sg_list *sg1; | ||
215 | while (list) { | ||
216 | sg1 = list->next; | ||
217 | kfree(list); | ||
218 | list = sg1; | ||
219 | } | ||
220 | list = NULL; | ||
221 | } | ||
222 | |||
223 | static struct opal_sg_list *dump_data_to_sglist(struct dump_obj *dump) | ||
224 | { | ||
225 | struct opal_sg_list *sg1, *list = NULL; | ||
226 | void *addr; | ||
227 | int64_t size; | ||
228 | |||
229 | addr = dump->buffer; | ||
230 | size = dump->size; | ||
231 | |||
232 | sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
233 | if (!sg1) | ||
234 | goto nomem; | ||
235 | |||
236 | list = sg1; | ||
237 | sg1->num_entries = 0; | ||
238 | while (size > 0) { | ||
239 | /* Translate virtual address to physical address */ | ||
240 | sg1->entry[sg1->num_entries].data = | ||
241 | (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT); | ||
242 | |||
243 | if (size > PAGE_SIZE) | ||
244 | sg1->entry[sg1->num_entries].length = PAGE_SIZE; | ||
245 | else | ||
246 | sg1->entry[sg1->num_entries].length = size; | ||
247 | |||
248 | sg1->num_entries++; | ||
249 | if (sg1->num_entries >= SG_ENTRIES_PER_NODE) { | ||
250 | sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
251 | if (!sg1->next) | ||
252 | goto nomem; | ||
253 | |||
254 | sg1 = sg1->next; | ||
255 | sg1->num_entries = 0; | ||
256 | } | ||
257 | addr += PAGE_SIZE; | ||
258 | size -= PAGE_SIZE; | ||
259 | } | ||
260 | return list; | ||
261 | |||
262 | nomem: | ||
263 | pr_err("%s : Failed to allocate memory\n", __func__); | ||
264 | free_dump_sg_list(list); | ||
265 | return NULL; | ||
266 | } | ||
267 | |||
268 | static void sglist_to_phy_addr(struct opal_sg_list *list) | ||
269 | { | ||
270 | struct opal_sg_list *sg, *next; | ||
271 | |||
272 | for (sg = list; sg; sg = next) { | ||
273 | next = sg->next; | ||
274 | /* Don't translate NULL pointer for last entry */ | ||
275 | if (sg->next) | ||
276 | sg->next = (struct opal_sg_list *)__pa(sg->next); | ||
277 | else | ||
278 | sg->next = NULL; | ||
279 | |||
280 | /* Convert num_entries to length */ | ||
281 | sg->num_entries = | ||
282 | sg->num_entries * sizeof(struct opal_sg_entry) + 16; | ||
283 | } | ||
284 | } | ||
285 | |||
286 | static int64_t dump_read_info(uint32_t *id, uint32_t *size, uint32_t *type) | ||
287 | { | 213 | { |
214 | __be32 id, size, type; | ||
288 | int rc; | 215 | int rc; |
289 | *type = 0xffffffff; | ||
290 | 216 | ||
291 | rc = opal_dump_info2(id, size, type); | 217 | type = cpu_to_be32(0xffffffff); |
292 | 218 | ||
219 | rc = opal_dump_info2(&id, &size, &type); | ||
293 | if (rc == OPAL_PARAMETER) | 220 | if (rc == OPAL_PARAMETER) |
294 | rc = opal_dump_info(id, size); | 221 | rc = opal_dump_info(&id, &size); |
222 | |||
223 | *dump_id = be32_to_cpu(id); | ||
224 | *dump_size = be32_to_cpu(size); | ||
225 | *dump_type = be32_to_cpu(type); | ||
295 | 226 | ||
296 | if (rc) | 227 | if (rc) |
297 | pr_warn("%s: Failed to get dump info (%d)\n", | 228 | pr_warn("%s: Failed to get dump info (%d)\n", |
@@ -314,15 +245,12 @@ static int64_t dump_read_data(struct dump_obj *dump) | |||
314 | } | 245 | } |
315 | 246 | ||
316 | /* Generate SG list */ | 247 | /* Generate SG list */ |
317 | list = dump_data_to_sglist(dump); | 248 | list = opal_vmalloc_to_sg_list(dump->buffer, dump->size); |
318 | if (!list) { | 249 | if (!list) { |
319 | rc = -ENOMEM; | 250 | rc = -ENOMEM; |
320 | goto out; | 251 | goto out; |
321 | } | 252 | } |
322 | 253 | ||
323 | /* Translate sg list addr to real address */ | ||
324 | sglist_to_phy_addr(list); | ||
325 | |||
326 | /* First entry address */ | 254 | /* First entry address */ |
327 | addr = __pa(list); | 255 | addr = __pa(list); |
328 | 256 | ||
@@ -341,7 +269,7 @@ static int64_t dump_read_data(struct dump_obj *dump) | |||
341 | __func__, dump->id); | 269 | __func__, dump->id); |
342 | 270 | ||
343 | /* Free SG list */ | 271 | /* Free SG list */ |
344 | free_dump_sg_list(list); | 272 | opal_free_sg_list(list); |
345 | 273 | ||
346 | out: | 274 | out: |
347 | return rc; | 275 | return rc; |
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c index ef7bc2a97862..10268c41d830 100644 --- a/arch/powerpc/platforms/powernv/opal-elog.c +++ b/arch/powerpc/platforms/powernv/opal-elog.c | |||
@@ -238,18 +238,25 @@ static struct elog_obj *create_elog_obj(uint64_t id, size_t size, uint64_t type) | |||
238 | 238 | ||
239 | static void elog_work_fn(struct work_struct *work) | 239 | static void elog_work_fn(struct work_struct *work) |
240 | { | 240 | { |
241 | size_t elog_size; | 241 | __be64 size; |
242 | __be64 id; | ||
243 | __be64 type; | ||
244 | uint64_t elog_size; | ||
242 | uint64_t log_id; | 245 | uint64_t log_id; |
243 | uint64_t elog_type; | 246 | uint64_t elog_type; |
244 | int rc; | 247 | int rc; |
245 | char name[2+16+1]; | 248 | char name[2+16+1]; |
246 | 249 | ||
247 | rc = opal_get_elog_size(&log_id, &elog_size, &elog_type); | 250 | rc = opal_get_elog_size(&id, &size, &type); |
248 | if (rc != OPAL_SUCCESS) { | 251 | if (rc != OPAL_SUCCESS) { |
249 | pr_err("ELOG: Opal log read failed\n"); | 252 | pr_err("ELOG: Opal log read failed\n"); |
250 | return; | 253 | return; |
251 | } | 254 | } |
252 | 255 | ||
256 | elog_size = be64_to_cpu(size); | ||
257 | log_id = be64_to_cpu(id); | ||
258 | elog_type = be64_to_cpu(type); | ||
259 | |||
253 | BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE); | 260 | BUG_ON(elog_size > OPAL_MAX_ERRLOG_SIZE); |
254 | 261 | ||
255 | if (elog_size >= OPAL_MAX_ERRLOG_SIZE) | 262 | if (elog_size >= OPAL_MAX_ERRLOG_SIZE) |
diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c index 714ef972406b..dc487ff04704 100644 --- a/arch/powerpc/platforms/powernv/opal-flash.c +++ b/arch/powerpc/platforms/powernv/opal-flash.c | |||
@@ -79,9 +79,6 @@ | |||
79 | /* XXX: Assume candidate image size is <= 1GB */ | 79 | /* XXX: Assume candidate image size is <= 1GB */ |
80 | #define MAX_IMAGE_SIZE 0x40000000 | 80 | #define MAX_IMAGE_SIZE 0x40000000 |
81 | 81 | ||
82 | /* Flash sg list version */ | ||
83 | #define SG_LIST_VERSION (1UL) | ||
84 | |||
85 | /* Image status */ | 82 | /* Image status */ |
86 | enum { | 83 | enum { |
87 | IMAGE_INVALID, | 84 | IMAGE_INVALID, |
@@ -131,11 +128,15 @@ static DEFINE_MUTEX(image_data_mutex); | |||
131 | */ | 128 | */ |
132 | static inline void opal_flash_validate(void) | 129 | static inline void opal_flash_validate(void) |
133 | { | 130 | { |
134 | struct validate_flash_t *args_buf = &validate_flash_data; | 131 | long ret; |
132 | void *buf = validate_flash_data.buf; | ||
133 | __be32 size, result; | ||
135 | 134 | ||
136 | args_buf->status = opal_validate_flash(__pa(args_buf->buf), | 135 | ret = opal_validate_flash(__pa(buf), &size, &result); |
137 | &(args_buf->buf_size), | 136 | |
138 | &(args_buf->result)); | 137 | validate_flash_data.status = ret; |
138 | validate_flash_data.buf_size = be32_to_cpu(size); | ||
139 | validate_flash_data.result = be32_to_cpu(result); | ||
139 | } | 140 | } |
140 | 141 | ||
141 | /* | 142 | /* |
@@ -268,93 +269,11 @@ static ssize_t manage_store(struct kobject *kobj, | |||
268 | } | 269 | } |
269 | 270 | ||
270 | /* | 271 | /* |
271 | * Free sg list | ||
272 | */ | ||
273 | static void free_sg_list(struct opal_sg_list *list) | ||
274 | { | ||
275 | struct opal_sg_list *sg1; | ||
276 | while (list) { | ||
277 | sg1 = list->next; | ||
278 | kfree(list); | ||
279 | list = sg1; | ||
280 | } | ||
281 | list = NULL; | ||
282 | } | ||
283 | |||
284 | /* | ||
285 | * Build candidate image scatter gather list | ||
286 | * | ||
287 | * list format: | ||
288 | * ----------------------------------- | ||
289 | * | VER (8) | Entry length in bytes | | ||
290 | * ----------------------------------- | ||
291 | * | Pointer to next entry | | ||
292 | * ----------------------------------- | ||
293 | * | Address of memory area 1 | | ||
294 | * ----------------------------------- | ||
295 | * | Length of memory area 1 | | ||
296 | * ----------------------------------- | ||
297 | * | ......... | | ||
298 | * ----------------------------------- | ||
299 | * | ......... | | ||
300 | * ----------------------------------- | ||
301 | * | Address of memory area N | | ||
302 | * ----------------------------------- | ||
303 | * | Length of memory area N | | ||
304 | * ----------------------------------- | ||
305 | */ | ||
306 | static struct opal_sg_list *image_data_to_sglist(void) | ||
307 | { | ||
308 | struct opal_sg_list *sg1, *list = NULL; | ||
309 | void *addr; | ||
310 | int size; | ||
311 | |||
312 | addr = image_data.data; | ||
313 | size = image_data.size; | ||
314 | |||
315 | sg1 = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
316 | if (!sg1) | ||
317 | return NULL; | ||
318 | |||
319 | list = sg1; | ||
320 | sg1->num_entries = 0; | ||
321 | while (size > 0) { | ||
322 | /* Translate virtual address to physical address */ | ||
323 | sg1->entry[sg1->num_entries].data = | ||
324 | (void *)(vmalloc_to_pfn(addr) << PAGE_SHIFT); | ||
325 | |||
326 | if (size > PAGE_SIZE) | ||
327 | sg1->entry[sg1->num_entries].length = PAGE_SIZE; | ||
328 | else | ||
329 | sg1->entry[sg1->num_entries].length = size; | ||
330 | |||
331 | sg1->num_entries++; | ||
332 | if (sg1->num_entries >= SG_ENTRIES_PER_NODE) { | ||
333 | sg1->next = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
334 | if (!sg1->next) { | ||
335 | pr_err("%s : Failed to allocate memory\n", | ||
336 | __func__); | ||
337 | goto nomem; | ||
338 | } | ||
339 | |||
340 | sg1 = sg1->next; | ||
341 | sg1->num_entries = 0; | ||
342 | } | ||
343 | addr += PAGE_SIZE; | ||
344 | size -= PAGE_SIZE; | ||
345 | } | ||
346 | return list; | ||
347 | nomem: | ||
348 | free_sg_list(list); | ||
349 | return NULL; | ||
350 | } | ||
351 | |||
352 | /* | ||
353 | * OPAL update flash | 272 | * OPAL update flash |
354 | */ | 273 | */ |
355 | static int opal_flash_update(int op) | 274 | static int opal_flash_update(int op) |
356 | { | 275 | { |
357 | struct opal_sg_list *sg, *list, *next; | 276 | struct opal_sg_list *list; |
358 | unsigned long addr; | 277 | unsigned long addr; |
359 | int64_t rc = OPAL_PARAMETER; | 278 | int64_t rc = OPAL_PARAMETER; |
360 | 279 | ||
@@ -364,30 +283,13 @@ static int opal_flash_update(int op) | |||
364 | goto flash; | 283 | goto flash; |
365 | } | 284 | } |
366 | 285 | ||
367 | list = image_data_to_sglist(); | 286 | list = opal_vmalloc_to_sg_list(image_data.data, image_data.size); |
368 | if (!list) | 287 | if (!list) |
369 | goto invalid_img; | 288 | goto invalid_img; |
370 | 289 | ||
371 | /* First entry address */ | 290 | /* First entry address */ |
372 | addr = __pa(list); | 291 | addr = __pa(list); |
373 | 292 | ||
374 | /* Translate sg list address to absolute */ | ||
375 | for (sg = list; sg; sg = next) { | ||
376 | next = sg->next; | ||
377 | /* Don't translate NULL pointer for last entry */ | ||
378 | if (sg->next) | ||
379 | sg->next = (struct opal_sg_list *)__pa(sg->next); | ||
380 | else | ||
381 | sg->next = NULL; | ||
382 | |||
383 | /* | ||
384 | * Convert num_entries to version/length format | ||
385 | * to satisfy OPAL. | ||
386 | */ | ||
387 | sg->num_entries = (SG_LIST_VERSION << 56) | | ||
388 | (sg->num_entries * sizeof(struct opal_sg_entry) + 16); | ||
389 | } | ||
390 | |||
391 | pr_alert("FLASH: Image is %u bytes\n", image_data.size); | 293 | pr_alert("FLASH: Image is %u bytes\n", image_data.size); |
392 | pr_alert("FLASH: Image update requested\n"); | 294 | pr_alert("FLASH: Image update requested\n"); |
393 | pr_alert("FLASH: Image will be updated during system reboot\n"); | 295 | pr_alert("FLASH: Image will be updated during system reboot\n"); |
diff --git a/arch/powerpc/platforms/powernv/opal-sysparam.c b/arch/powerpc/platforms/powernv/opal-sysparam.c index 6b614726baf2..d202f9bc3683 100644 --- a/arch/powerpc/platforms/powernv/opal-sysparam.c +++ b/arch/powerpc/platforms/powernv/opal-sysparam.c | |||
@@ -39,10 +39,11 @@ struct param_attr { | |||
39 | struct kobj_attribute kobj_attr; | 39 | struct kobj_attribute kobj_attr; |
40 | }; | 40 | }; |
41 | 41 | ||
42 | static int opal_get_sys_param(u32 param_id, u32 length, void *buffer) | 42 | static ssize_t opal_get_sys_param(u32 param_id, u32 length, void *buffer) |
43 | { | 43 | { |
44 | struct opal_msg msg; | 44 | struct opal_msg msg; |
45 | int ret, token; | 45 | ssize_t ret; |
46 | int token; | ||
46 | 47 | ||
47 | token = opal_async_get_token_interruptible(); | 48 | token = opal_async_get_token_interruptible(); |
48 | if (token < 0) { | 49 | if (token < 0) { |
@@ -59,7 +60,7 @@ static int opal_get_sys_param(u32 param_id, u32 length, void *buffer) | |||
59 | 60 | ||
60 | ret = opal_async_wait_response(token, &msg); | 61 | ret = opal_async_wait_response(token, &msg); |
61 | if (ret) { | 62 | if (ret) { |
62 | pr_err("%s: Failed to wait for the async response, %d\n", | 63 | pr_err("%s: Failed to wait for the async response, %zd\n", |
63 | __func__, ret); | 64 | __func__, ret); |
64 | goto out_token; | 65 | goto out_token; |
65 | } | 66 | } |
@@ -111,7 +112,7 @@ static ssize_t sys_param_show(struct kobject *kobj, | |||
111 | { | 112 | { |
112 | struct param_attr *attr = container_of(kobj_attr, struct param_attr, | 113 | struct param_attr *attr = container_of(kobj_attr, struct param_attr, |
113 | kobj_attr); | 114 | kobj_attr); |
114 | int ret; | 115 | ssize_t ret; |
115 | 116 | ||
116 | mutex_lock(&opal_sysparam_mutex); | 117 | mutex_lock(&opal_sysparam_mutex); |
117 | ret = opal_get_sys_param(attr->param_id, attr->param_size, | 118 | ret = opal_get_sys_param(attr->param_id, attr->param_size, |
@@ -121,9 +122,10 @@ static ssize_t sys_param_show(struct kobject *kobj, | |||
121 | 122 | ||
122 | memcpy(buf, param_data_buf, attr->param_size); | 123 | memcpy(buf, param_data_buf, attr->param_size); |
123 | 124 | ||
125 | ret = attr->param_size; | ||
124 | out: | 126 | out: |
125 | mutex_unlock(&opal_sysparam_mutex); | 127 | mutex_unlock(&opal_sysparam_mutex); |
126 | return ret ? ret : attr->param_size; | 128 | return ret; |
127 | } | 129 | } |
128 | 130 | ||
129 | static ssize_t sys_param_store(struct kobject *kobj, | 131 | static ssize_t sys_param_store(struct kobject *kobj, |
@@ -131,14 +133,20 @@ static ssize_t sys_param_store(struct kobject *kobj, | |||
131 | { | 133 | { |
132 | struct param_attr *attr = container_of(kobj_attr, struct param_attr, | 134 | struct param_attr *attr = container_of(kobj_attr, struct param_attr, |
133 | kobj_attr); | 135 | kobj_attr); |
134 | int ret; | 136 | ssize_t ret; |
137 | |||
138 | /* MAX_PARAM_DATA_LEN is sizeof(param_data_buf) */ | ||
139 | if (count > MAX_PARAM_DATA_LEN) | ||
140 | count = MAX_PARAM_DATA_LEN; | ||
135 | 141 | ||
136 | mutex_lock(&opal_sysparam_mutex); | 142 | mutex_lock(&opal_sysparam_mutex); |
137 | memcpy(param_data_buf, buf, count); | 143 | memcpy(param_data_buf, buf, count); |
138 | ret = opal_set_sys_param(attr->param_id, attr->param_size, | 144 | ret = opal_set_sys_param(attr->param_id, attr->param_size, |
139 | param_data_buf); | 145 | param_data_buf); |
140 | mutex_unlock(&opal_sysparam_mutex); | 146 | mutex_unlock(&opal_sysparam_mutex); |
141 | return ret ? ret : count; | 147 | if (!ret) |
148 | ret = count; | ||
149 | return ret; | ||
142 | } | 150 | } |
143 | 151 | ||
144 | void __init opal_sys_param_init(void) | 152 | void __init opal_sys_param_init(void) |
@@ -214,13 +222,13 @@ void __init opal_sys_param_init(void) | |||
214 | } | 222 | } |
215 | 223 | ||
216 | if (of_property_read_u32_array(sysparam, "param-len", size, count)) { | 224 | if (of_property_read_u32_array(sysparam, "param-len", size, count)) { |
217 | pr_err("SYSPARAM: Missing propery param-len in the DT\n"); | 225 | pr_err("SYSPARAM: Missing property param-len in the DT\n"); |
218 | goto out_free_perm; | 226 | goto out_free_perm; |
219 | } | 227 | } |
220 | 228 | ||
221 | 229 | ||
222 | if (of_property_read_u8_array(sysparam, "param-perm", perm, count)) { | 230 | if (of_property_read_u8_array(sysparam, "param-perm", perm, count)) { |
223 | pr_err("SYSPARAM: Missing propery param-perm in the DT\n"); | 231 | pr_err("SYSPARAM: Missing property param-perm in the DT\n"); |
224 | goto out_free_perm; | 232 | goto out_free_perm; |
225 | } | 233 | } |
226 | 234 | ||
@@ -233,6 +241,12 @@ void __init opal_sys_param_init(void) | |||
233 | 241 | ||
234 | /* For each of the parameters, populate the parameter attributes */ | 242 | /* For each of the parameters, populate the parameter attributes */ |
235 | for (i = 0; i < count; i++) { | 243 | for (i = 0; i < count; i++) { |
244 | if (size[i] > MAX_PARAM_DATA_LEN) { | ||
245 | pr_warn("SYSPARAM: Not creating parameter %d as size " | ||
246 | "exceeds buffer length\n", i); | ||
247 | continue; | ||
248 | } | ||
249 | |||
236 | sysfs_attr_init(&attr[i].kobj_attr.attr); | 250 | sysfs_attr_init(&attr[i].kobj_attr.attr); |
237 | attr[i].param_id = id[i]; | 251 | attr[i].param_id = id[i]; |
238 | attr[i].param_size = size[i]; | 252 | attr[i].param_size = size[i]; |
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 49d2f00019e5..360ad80c754c 100644 --- a/arch/powerpc/platforms/powernv/opal.c +++ b/arch/powerpc/platforms/powernv/opal.c | |||
@@ -242,14 +242,14 @@ void opal_notifier_update_evt(uint64_t evt_mask, | |||
242 | void opal_notifier_enable(void) | 242 | void opal_notifier_enable(void) |
243 | { | 243 | { |
244 | int64_t rc; | 244 | int64_t rc; |
245 | uint64_t evt = 0; | 245 | __be64 evt = 0; |
246 | 246 | ||
247 | atomic_set(&opal_notifier_hold, 0); | 247 | atomic_set(&opal_notifier_hold, 0); |
248 | 248 | ||
249 | /* Process pending events */ | 249 | /* Process pending events */ |
250 | rc = opal_poll_events(&evt); | 250 | rc = opal_poll_events(&evt); |
251 | if (rc == OPAL_SUCCESS && evt) | 251 | if (rc == OPAL_SUCCESS && evt) |
252 | opal_do_notifier(evt); | 252 | opal_do_notifier(be64_to_cpu(evt)); |
253 | } | 253 | } |
254 | 254 | ||
255 | void opal_notifier_disable(void) | 255 | void opal_notifier_disable(void) |
@@ -529,7 +529,7 @@ static irqreturn_t opal_interrupt(int irq, void *data) | |||
529 | 529 | ||
530 | opal_handle_interrupt(virq_to_hw(irq), &events); | 530 | opal_handle_interrupt(virq_to_hw(irq), &events); |
531 | 531 | ||
532 | opal_do_notifier(events); | 532 | opal_do_notifier(be64_to_cpu(events)); |
533 | 533 | ||
534 | return IRQ_HANDLED; | 534 | return IRQ_HANDLED; |
535 | } | 535 | } |
@@ -638,3 +638,66 @@ void opal_shutdown(void) | |||
638 | 638 | ||
639 | /* Export this so that test modules can use it */ | 639 | /* Export this so that test modules can use it */ |
640 | EXPORT_SYMBOL_GPL(opal_invalid_call); | 640 | EXPORT_SYMBOL_GPL(opal_invalid_call); |
641 | |||
642 | /* Convert a region of vmalloc memory to an opal sg list */ | ||
643 | struct opal_sg_list *opal_vmalloc_to_sg_list(void *vmalloc_addr, | ||
644 | unsigned long vmalloc_size) | ||
645 | { | ||
646 | struct opal_sg_list *sg, *first = NULL; | ||
647 | unsigned long i = 0; | ||
648 | |||
649 | sg = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
650 | if (!sg) | ||
651 | goto nomem; | ||
652 | |||
653 | first = sg; | ||
654 | |||
655 | while (vmalloc_size > 0) { | ||
656 | uint64_t data = vmalloc_to_pfn(vmalloc_addr) << PAGE_SHIFT; | ||
657 | uint64_t length = min(vmalloc_size, PAGE_SIZE); | ||
658 | |||
659 | sg->entry[i].data = cpu_to_be64(data); | ||
660 | sg->entry[i].length = cpu_to_be64(length); | ||
661 | i++; | ||
662 | |||
663 | if (i >= SG_ENTRIES_PER_NODE) { | ||
664 | struct opal_sg_list *next; | ||
665 | |||
666 | next = kzalloc(PAGE_SIZE, GFP_KERNEL); | ||
667 | if (!next) | ||
668 | goto nomem; | ||
669 | |||
670 | sg->length = cpu_to_be64( | ||
671 | i * sizeof(struct opal_sg_entry) + 16); | ||
672 | i = 0; | ||
673 | sg->next = cpu_to_be64(__pa(next)); | ||
674 | sg = next; | ||
675 | } | ||
676 | |||
677 | vmalloc_addr += length; | ||
678 | vmalloc_size -= length; | ||
679 | } | ||
680 | |||
681 | sg->length = cpu_to_be64(i * sizeof(struct opal_sg_entry) + 16); | ||
682 | |||
683 | return first; | ||
684 | |||
685 | nomem: | ||
686 | pr_err("%s : Failed to allocate memory\n", __func__); | ||
687 | opal_free_sg_list(first); | ||
688 | return NULL; | ||
689 | } | ||
690 | |||
691 | void opal_free_sg_list(struct opal_sg_list *sg) | ||
692 | { | ||
693 | while (sg) { | ||
694 | uint64_t next = be64_to_cpu(sg->next); | ||
695 | |||
696 | kfree(sg); | ||
697 | |||
698 | if (next) | ||
699 | sg = __va(next); | ||
700 | else | ||
701 | sg = NULL; | ||
702 | } | ||
703 | } | ||
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 3b2b4fb3585b..98824aa99173 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -343,7 +343,6 @@ static void pnv_ioda_setup_same_PE(struct pci_bus *bus, struct pnv_ioda_pe *pe) | |||
343 | pci_name(dev)); | 343 | pci_name(dev)); |
344 | continue; | 344 | continue; |
345 | } | 345 | } |
346 | pci_dev_get(dev); | ||
347 | pdn->pcidev = dev; | 346 | pdn->pcidev = dev; |
348 | pdn->pe_number = pe->pe_number; | 347 | pdn->pe_number = pe->pe_number; |
349 | pe->dma_weight += pnv_ioda_dma_weight(dev); | 348 | pe->dma_weight += pnv_ioda_dma_weight(dev); |
@@ -462,7 +461,7 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb *phb, struct pci_dev *pdev | |||
462 | 461 | ||
463 | pe = &phb->ioda.pe_array[pdn->pe_number]; | 462 | pe = &phb->ioda.pe_array[pdn->pe_number]; |
464 | WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops); | 463 | WARN_ON(get_dma_ops(&pdev->dev) != &dma_iommu_ops); |
465 | set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table); | 464 | set_iommu_table_base(&pdev->dev, &pe->tce32_table); |
466 | } | 465 | } |
467 | 466 | ||
468 | static int pnv_pci_ioda_dma_set_mask(struct pnv_phb *phb, | 467 | static int pnv_pci_ioda_dma_set_mask(struct pnv_phb *phb, |
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 61cf8fa9c61b..8723d32632f5 100644 --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c | |||
@@ -162,18 +162,62 @@ static void pnv_shutdown(void) | |||
162 | } | 162 | } |
163 | 163 | ||
164 | #ifdef CONFIG_KEXEC | 164 | #ifdef CONFIG_KEXEC |
165 | static void pnv_kexec_wait_secondaries_down(void) | ||
166 | { | ||
167 | int my_cpu, i, notified = -1; | ||
168 | |||
169 | my_cpu = get_cpu(); | ||
170 | |||
171 | for_each_online_cpu(i) { | ||
172 | uint8_t status; | ||
173 | int64_t rc; | ||
174 | |||
175 | if (i == my_cpu) | ||
176 | continue; | ||
177 | |||
178 | for (;;) { | ||
179 | rc = opal_query_cpu_status(get_hard_smp_processor_id(i), | ||
180 | &status); | ||
181 | if (rc != OPAL_SUCCESS || status != OPAL_THREAD_STARTED) | ||
182 | break; | ||
183 | barrier(); | ||
184 | if (i != notified) { | ||
185 | printk(KERN_INFO "kexec: waiting for cpu %d " | ||
186 | "(physical %d) to enter OPAL\n", | ||
187 | i, paca[i].hw_cpu_id); | ||
188 | notified = i; | ||
189 | } | ||
190 | } | ||
191 | } | ||
192 | } | ||
193 | |||
165 | static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) | 194 | static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) |
166 | { | 195 | { |
167 | xics_kexec_teardown_cpu(secondary); | 196 | xics_kexec_teardown_cpu(secondary); |
168 | 197 | ||
169 | /* Return secondary CPUs to firmware on OPAL v3 */ | 198 | /* On OPAL v3, we return all CPUs to firmware */ |
170 | if (firmware_has_feature(FW_FEATURE_OPALv3) && secondary) { | 199 | |
200 | if (!firmware_has_feature(FW_FEATURE_OPALv3)) | ||
201 | return; | ||
202 | |||
203 | if (secondary) { | ||
204 | /* Return secondary CPUs to firmware on OPAL v3 */ | ||
171 | mb(); | 205 | mb(); |
172 | get_paca()->kexec_state = KEXEC_STATE_REAL_MODE; | 206 | get_paca()->kexec_state = KEXEC_STATE_REAL_MODE; |
173 | mb(); | 207 | mb(); |
174 | 208 | ||
175 | /* Return the CPU to OPAL */ | 209 | /* Return the CPU to OPAL */ |
176 | opal_return_cpu(); | 210 | opal_return_cpu(); |
211 | } else if (crash_shutdown) { | ||
212 | /* | ||
213 | * On crash, we don't wait for secondaries to go | ||
214 | * down as they might be unreachable or hung, so | ||
215 | * instead we just wait a bit and move on. | ||
216 | */ | ||
217 | mdelay(1); | ||
218 | } else { | ||
219 | /* Primary waits for the secondaries to have reached OPAL */ | ||
220 | pnv_kexec_wait_secondaries_down(); | ||
177 | } | 221 | } |
178 | } | 222 | } |
179 | #endif /* CONFIG_KEXEC */ | 223 | #endif /* CONFIG_KEXEC */ |
diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms/powernv/smp.c index 908672bdcea6..bf5fcd452168 100644 --- a/arch/powerpc/platforms/powernv/smp.c +++ b/arch/powerpc/platforms/powernv/smp.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <asm/cputhreads.h> | 30 | #include <asm/cputhreads.h> |
31 | #include <asm/xics.h> | 31 | #include <asm/xics.h> |
32 | #include <asm/opal.h> | 32 | #include <asm/opal.h> |
33 | #include <asm/runlatch.h> | ||
33 | 34 | ||
34 | #include "powernv.h" | 35 | #include "powernv.h" |
35 | 36 | ||
@@ -156,7 +157,9 @@ static void pnv_smp_cpu_kill_self(void) | |||
156 | */ | 157 | */ |
157 | mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); | 158 | mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~(u64)LPCR_PECE1); |
158 | while (!generic_check_cpu_restart(cpu)) { | 159 | while (!generic_check_cpu_restart(cpu)) { |
160 | ppc64_runlatch_off(); | ||
159 | power7_nap(); | 161 | power7_nap(); |
162 | ppc64_runlatch_on(); | ||
160 | if (!generic_check_cpu_restart(cpu)) { | 163 | if (!generic_check_cpu_restart(cpu)) { |
161 | DBG("CPU%d Unexpected exit while offline !\n", cpu); | 164 | DBG("CPU%d Unexpected exit while offline !\n", cpu); |
162 | /* We may be getting an IPI, so we re-enable | 165 | /* We may be getting an IPI, so we re-enable |
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index 9b8e05078a63..20d62975856f 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -88,13 +88,14 @@ void set_default_offline_state(int cpu) | |||
88 | 88 | ||
89 | static void rtas_stop_self(void) | 89 | static void rtas_stop_self(void) |
90 | { | 90 | { |
91 | struct rtas_args args = { | 91 | static struct rtas_args args = { |
92 | .token = cpu_to_be32(rtas_stop_self_token), | ||
93 | .nargs = 0, | 92 | .nargs = 0, |
94 | .nret = 1, | 93 | .nret = 1, |
95 | .rets = &args.args[0], | 94 | .rets = &args.args[0], |
96 | }; | 95 | }; |
97 | 96 | ||
97 | args.token = cpu_to_be32(rtas_stop_self_token); | ||
98 | |||
98 | local_irq_disable(); | 99 | local_irq_disable(); |
99 | 100 | ||
100 | BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE); | 101 | BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE); |
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 573b488fc48b..7f75c94af822 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -100,10 +100,10 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz | |||
100 | 100 | ||
101 | start_pfn = base >> PAGE_SHIFT; | 101 | start_pfn = base >> PAGE_SHIFT; |
102 | 102 | ||
103 | if (!pfn_valid(start_pfn)) { | 103 | lock_device_hotplug(); |
104 | memblock_remove(base, memblock_size); | 104 | |
105 | return 0; | 105 | if (!pfn_valid(start_pfn)) |
106 | } | 106 | goto out; |
107 | 107 | ||
108 | block_sz = memory_block_size_bytes(); | 108 | block_sz = memory_block_size_bytes(); |
109 | sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE; | 109 | sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE; |
@@ -114,8 +114,10 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz | |||
114 | base += MIN_MEMORY_BLOCK_SIZE; | 114 | base += MIN_MEMORY_BLOCK_SIZE; |
115 | } | 115 | } |
116 | 116 | ||
117 | out: | ||
117 | /* Update memory regions for memory remove */ | 118 | /* Update memory regions for memory remove */ |
118 | memblock_remove(base, memblock_size); | 119 | memblock_remove(base, memblock_size); |
120 | unlock_device_hotplug(); | ||
119 | return 0; | 121 | return 0; |
120 | } | 122 | } |
121 | 123 | ||
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 64603a10b863..4914fd3f41ec 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -1058,7 +1058,7 @@ static int __init apm821xx_pciex_core_init(struct device_node *np) | |||
1058 | return 1; | 1058 | return 1; |
1059 | } | 1059 | } |
1060 | 1060 | ||
1061 | static int apm821xx_pciex_init_port_hw(struct ppc4xx_pciex_port *port) | 1061 | static int __init apm821xx_pciex_init_port_hw(struct ppc4xx_pciex_port *port) |
1062 | { | 1062 | { |
1063 | u32 val; | 1063 | u32 val; |
1064 | 1064 | ||
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index cf3c0089bef2..23223cd63e54 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
@@ -820,6 +820,9 @@ static int ctr_aes_crypt(struct blkcipher_desc *desc, long func, | |||
820 | else | 820 | else |
821 | memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE); | 821 | memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE); |
822 | spin_unlock(&ctrblk_lock); | 822 | spin_unlock(&ctrblk_lock); |
823 | } else { | ||
824 | if (!nbytes) | ||
825 | memcpy(walk->iv, ctrptr, AES_BLOCK_SIZE); | ||
823 | } | 826 | } |
824 | /* | 827 | /* |
825 | * final block may be < AES_BLOCK_SIZE, copy only nbytes | 828 | * final block may be < AES_BLOCK_SIZE, copy only nbytes |
diff --git a/arch/s390/crypto/des_s390.c b/arch/s390/crypto/des_s390.c index 0a5aac8a9412..7acb77f7ef1a 100644 --- a/arch/s390/crypto/des_s390.c +++ b/arch/s390/crypto/des_s390.c | |||
@@ -429,6 +429,9 @@ static int ctr_desall_crypt(struct blkcipher_desc *desc, long func, | |||
429 | else | 429 | else |
430 | memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE); | 430 | memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE); |
431 | spin_unlock(&ctrblk_lock); | 431 | spin_unlock(&ctrblk_lock); |
432 | } else { | ||
433 | if (!nbytes) | ||
434 | memcpy(walk->iv, ctrptr, DES_BLOCK_SIZE); | ||
432 | } | 435 | } |
433 | /* final block may be < DES_BLOCK_SIZE, copy only nbytes */ | 436 | /* final block may be < DES_BLOCK_SIZE, copy only nbytes */ |
434 | if (nbytes) { | 437 | if (nbytes) { |
diff --git a/arch/s390/include/asm/ccwgroup.h b/arch/s390/include/asm/ccwgroup.h index 6e670f88d125..ebc2913f9ee0 100644 --- a/arch/s390/include/asm/ccwgroup.h +++ b/arch/s390/include/asm/ccwgroup.h | |||
@@ -22,8 +22,8 @@ struct ccwgroup_device { | |||
22 | /* public: */ | 22 | /* public: */ |
23 | unsigned int count; | 23 | unsigned int count; |
24 | struct device dev; | 24 | struct device dev; |
25 | struct ccw_device *cdev[0]; | ||
26 | struct work_struct ungroup_work; | 25 | struct work_struct ungroup_work; |
26 | struct ccw_device *cdev[0]; | ||
27 | }; | 27 | }; |
28 | 28 | ||
29 | /** | 29 | /** |
diff --git a/arch/s390/include/asm/sigp.h b/arch/s390/include/asm/sigp.h index d091aa1aaf11..bf9c823d4020 100644 --- a/arch/s390/include/asm/sigp.h +++ b/arch/s390/include/asm/sigp.h | |||
@@ -31,4 +31,23 @@ | |||
31 | #define SIGP_STATUS_INCORRECT_STATE 0x00000200UL | 31 | #define SIGP_STATUS_INCORRECT_STATE 0x00000200UL |
32 | #define SIGP_STATUS_NOT_RUNNING 0x00000400UL | 32 | #define SIGP_STATUS_NOT_RUNNING 0x00000400UL |
33 | 33 | ||
34 | #ifndef __ASSEMBLY__ | ||
35 | |||
36 | static inline int __pcpu_sigp(u16 addr, u8 order, u32 parm, u32 *status) | ||
37 | { | ||
38 | register unsigned int reg1 asm ("1") = parm; | ||
39 | int cc; | ||
40 | |||
41 | asm volatile( | ||
42 | " sigp %1,%2,0(%3)\n" | ||
43 | " ipm %0\n" | ||
44 | " srl %0,28\n" | ||
45 | : "=d" (cc), "+d" (reg1) : "d" (addr), "a" (order) : "cc"); | ||
46 | if (status && cc == 1) | ||
47 | *status = reg1; | ||
48 | return cc; | ||
49 | } | ||
50 | |||
51 | #endif /* __ASSEMBLY__ */ | ||
52 | |||
34 | #endif /* __S390_ASM_SIGP_H */ | 53 | #endif /* __S390_ASM_SIGP_H */ |
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index 160779394096..21703f85b48d 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifndef __ASM_SMP_H | 7 | #ifndef __ASM_SMP_H |
8 | #define __ASM_SMP_H | 8 | #define __ASM_SMP_H |
9 | 9 | ||
10 | #include <asm/sigp.h> | ||
11 | |||
10 | #ifdef CONFIG_SMP | 12 | #ifdef CONFIG_SMP |
11 | 13 | ||
12 | #include <asm/lowcore.h> | 14 | #include <asm/lowcore.h> |
@@ -50,9 +52,18 @@ static inline int smp_store_status(int cpu) { return 0; } | |||
50 | static inline int smp_vcpu_scheduled(int cpu) { return 1; } | 52 | static inline int smp_vcpu_scheduled(int cpu) { return 1; } |
51 | static inline void smp_yield_cpu(int cpu) { } | 53 | static inline void smp_yield_cpu(int cpu) { } |
52 | static inline void smp_yield(void) { } | 54 | static inline void smp_yield(void) { } |
53 | static inline void smp_stop_cpu(void) { } | ||
54 | static inline void smp_fill_possible_mask(void) { } | 55 | static inline void smp_fill_possible_mask(void) { } |
55 | 56 | ||
57 | static inline void smp_stop_cpu(void) | ||
58 | { | ||
59 | u16 pcpu = stap(); | ||
60 | |||
61 | for (;;) { | ||
62 | __pcpu_sigp(pcpu, SIGP_STOP, 0, NULL); | ||
63 | cpu_relax(); | ||
64 | } | ||
65 | } | ||
66 | |||
56 | #endif /* CONFIG_SMP */ | 67 | #endif /* CONFIG_SMP */ |
57 | 68 | ||
58 | #ifdef CONFIG_HOTPLUG_CPU | 69 | #ifdef CONFIG_HOTPLUG_CPU |
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h index c544b6f05d95..a25f09fbaf36 100644 --- a/arch/s390/include/asm/tlb.h +++ b/arch/s390/include/asm/tlb.h | |||
@@ -59,12 +59,23 @@ static inline void tlb_gather_mmu(struct mmu_gather *tlb, | |||
59 | tlb->batch = NULL; | 59 | tlb->batch = NULL; |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | 62 | static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) |
63 | { | 63 | { |
64 | __tlb_flush_mm_lazy(tlb->mm); | 64 | __tlb_flush_mm_lazy(tlb->mm); |
65 | } | ||
66 | |||
67 | static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) | ||
68 | { | ||
65 | tlb_table_flush(tlb); | 69 | tlb_table_flush(tlb); |
66 | } | 70 | } |
67 | 71 | ||
72 | |||
73 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | ||
74 | { | ||
75 | tlb_flush_mmu_tlbonly(tlb); | ||
76 | tlb_flush_mmu_free(tlb); | ||
77 | } | ||
78 | |||
68 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, | 79 | static inline void tlb_finish_mmu(struct mmu_gather *tlb, |
69 | unsigned long start, unsigned long end) | 80 | unsigned long start, unsigned long end) |
70 | { | 81 | { |
diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h index 5eb5c9ddb120..3802d2d3a18d 100644 --- a/arch/s390/include/uapi/asm/unistd.h +++ b/arch/s390/include/uapi/asm/unistd.h | |||
@@ -282,7 +282,8 @@ | |||
282 | #define __NR_finit_module 344 | 282 | #define __NR_finit_module 344 |
283 | #define __NR_sched_setattr 345 | 283 | #define __NR_sched_setattr 345 |
284 | #define __NR_sched_getattr 346 | 284 | #define __NR_sched_getattr 346 |
285 | #define NR_syscalls 345 | 285 | #define __NR_renameat2 347 |
286 | #define NR_syscalls 348 | ||
286 | 287 | ||
287 | /* | 288 | /* |
288 | * There are some system calls that are not present on 64 bit, some | 289 | * There are some system calls that are not present on 64 bit, some |
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c index 824c39dfddfc..45cdb37aa6f8 100644 --- a/arch/s390/kernel/compat_wrapper.c +++ b/arch/s390/kernel/compat_wrapper.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Compat sytem call wrappers. | 2 | * Compat system call wrappers. |
3 | * | 3 | * |
4 | * Copyright IBM Corp. 2014 | 4 | * Copyright IBM Corp. 2014 |
5 | */ | 5 | */ |
@@ -213,3 +213,4 @@ COMPAT_SYSCALL_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, i | |||
213 | COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags); | 213 | COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags); |
214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); | 214 | COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags); |
215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); | 215 | COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags); |
216 | COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags); | ||
diff --git a/arch/s390/kernel/dumpstack.c b/arch/s390/kernel/dumpstack.c index e6af9406987c..acb412442e5e 100644 --- a/arch/s390/kernel/dumpstack.c +++ b/arch/s390/kernel/dumpstack.c | |||
@@ -144,10 +144,10 @@ void show_registers(struct pt_regs *regs) | |||
144 | char *mode; | 144 | char *mode; |
145 | 145 | ||
146 | mode = user_mode(regs) ? "User" : "Krnl"; | 146 | mode = user_mode(regs) ? "User" : "Krnl"; |
147 | printk("%s PSW : %p %p (%pSR)\n", | 147 | printk("%s PSW : %p %p", mode, (void *)regs->psw.mask, (void *)regs->psw.addr); |
148 | mode, (void *) regs->psw.mask, | 148 | if (!user_mode(regs)) |
149 | (void *) regs->psw.addr, | 149 | printk(" (%pSR)", (void *)regs->psw.addr); |
150 | (void *) regs->psw.addr); | 150 | printk("\n"); |
151 | printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " | 151 | printk(" R:%x T:%x IO:%x EX:%x Key:%x M:%x W:%x " |
152 | "P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER), | 152 | "P:%x AS:%x CC:%x PM:%x", mask_bits(regs, PSW_MASK_PER), |
153 | mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO), | 153 | mask_bits(regs, PSW_MASK_DAT), mask_bits(regs, PSW_MASK_IO), |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 4ac8fafec95f..1c82619eb4f7 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -64,7 +64,7 @@ void update_cr_regs(struct task_struct *task) | |||
64 | if (task->thread.per_flags & PER_FLAG_NO_TE) | 64 | if (task->thread.per_flags & PER_FLAG_NO_TE) |
65 | cr_new &= ~(1UL << 55); | 65 | cr_new &= ~(1UL << 55); |
66 | if (cr_new != cr) | 66 | if (cr_new != cr) |
67 | __ctl_load(cr, 0, 0); | 67 | __ctl_load(cr_new, 0, 0); |
68 | /* Set or clear transaction execution TDC bits 62 and 63. */ | 68 | /* Set or clear transaction execution TDC bits 62 and 63. */ |
69 | __ctl_store(cr, 2, 2); | 69 | __ctl_store(cr, 2, 2); |
70 | cr_new = cr & ~3UL; | 70 | cr_new = cr & ~3UL; |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index f70f2489fa5f..88d1ca81e2dd 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -1027,3 +1027,35 @@ void __init setup_arch(char **cmdline_p) | |||
1027 | /* Setup zfcpdump support */ | 1027 | /* Setup zfcpdump support */ |
1028 | setup_zfcpdump(); | 1028 | setup_zfcpdump(); |
1029 | } | 1029 | } |
1030 | |||
1031 | #ifdef CONFIG_32BIT | ||
1032 | static int no_removal_warning __initdata; | ||
1033 | |||
1034 | static int __init parse_no_removal_warning(char *str) | ||
1035 | { | ||
1036 | no_removal_warning = 1; | ||
1037 | return 0; | ||
1038 | } | ||
1039 | __setup("no_removal_warning", parse_no_removal_warning); | ||
1040 | |||
1041 | static int __init removal_warning(void) | ||
1042 | { | ||
1043 | if (no_removal_warning) | ||
1044 | return 0; | ||
1045 | printk(KERN_ALERT "\n\n"); | ||
1046 | printk(KERN_CONT "Warning - you are using a 31 bit kernel!\n\n"); | ||
1047 | printk(KERN_CONT "We plan to remove 31 bit kernel support from the kernel sources in March 2015.\n"); | ||
1048 | printk(KERN_CONT "Currently we assume that nobody is using the 31 bit kernel on old 31 bit\n"); | ||
1049 | printk(KERN_CONT "hardware anymore. If you think that the code should not be removed and also\n"); | ||
1050 | printk(KERN_CONT "future versions of the Linux kernel should be able to run in 31 bit mode\n"); | ||
1051 | printk(KERN_CONT "please let us know. Please write to:\n"); | ||
1052 | printk(KERN_CONT "linux390@de.ibm.com (mail address) and/or\n"); | ||
1053 | printk(KERN_CONT "linux-s390@vger.kernel.org (mailing list).\n\n"); | ||
1054 | printk(KERN_CONT "Thank you!\n\n"); | ||
1055 | printk(KERN_CONT "If this kernel runs on a 64 bit machine you may consider using a 64 bit kernel.\n"); | ||
1056 | printk(KERN_CONT "This message can be disabled with the \"no_removal_warning\" kernel parameter.\n"); | ||
1057 | schedule_timeout_uninterruptible(300 * HZ); | ||
1058 | return 0; | ||
1059 | } | ||
1060 | early_initcall(removal_warning); | ||
1061 | #endif | ||
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 512ce1cde2a4..86e65ec3422b 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -82,21 +82,6 @@ DEFINE_MUTEX(smp_cpu_state_mutex); | |||
82 | /* | 82 | /* |
83 | * Signal processor helper functions. | 83 | * Signal processor helper functions. |
84 | */ | 84 | */ |
85 | static inline int __pcpu_sigp(u16 addr, u8 order, u32 parm, u32 *status) | ||
86 | { | ||
87 | register unsigned int reg1 asm ("1") = parm; | ||
88 | int cc; | ||
89 | |||
90 | asm volatile( | ||
91 | " sigp %1,%2,0(%3)\n" | ||
92 | " ipm %0\n" | ||
93 | " srl %0,28\n" | ||
94 | : "=d" (cc), "+d" (reg1) : "d" (addr), "a" (order) : "cc"); | ||
95 | if (status && cc == 1) | ||
96 | *status = reg1; | ||
97 | return cc; | ||
98 | } | ||
99 | |||
100 | static inline int __pcpu_sigp_relax(u16 addr, u8 order, u32 parm, u32 *status) | 85 | static inline int __pcpu_sigp_relax(u16 addr, u8 order, u32 parm, u32 *status) |
101 | { | 86 | { |
102 | int cc; | 87 | int cc; |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 542ef488bac1..fe5cdf29a001 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -355,3 +355,4 @@ SYSCALL(sys_kcmp,sys_kcmp,compat_sys_kcmp) | |||
355 | SYSCALL(sys_finit_module,sys_finit_module,compat_sys_finit_module) | 355 | SYSCALL(sys_finit_module,sys_finit_module,compat_sys_finit_module) |
356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ | 356 | SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */ |
357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) | 357 | SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr) |
358 | SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2) | ||
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index b3ecb8f5b6ce..9ae6664ff08c 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -158,6 +158,7 @@ int kvm_dev_ioctl_check_extension(long ext) | |||
158 | case KVM_CAP_ONE_REG: | 158 | case KVM_CAP_ONE_REG: |
159 | case KVM_CAP_ENABLE_CAP: | 159 | case KVM_CAP_ENABLE_CAP: |
160 | case KVM_CAP_S390_CSS_SUPPORT: | 160 | case KVM_CAP_S390_CSS_SUPPORT: |
161 | case KVM_CAP_IRQFD: | ||
161 | case KVM_CAP_IOEVENTFD: | 162 | case KVM_CAP_IOEVENTFD: |
162 | case KVM_CAP_DEVICE_CTRL: | 163 | case KVM_CAP_DEVICE_CTRL: |
163 | case KVM_CAP_ENABLE_CAP_VM: | 164 | case KVM_CAP_ENABLE_CAP_VM: |
diff --git a/arch/s390/lib/uaccess.c b/arch/s390/lib/uaccess.c index 23f866b4c7f1..7416efe8eae4 100644 --- a/arch/s390/lib/uaccess.c +++ b/arch/s390/lib/uaccess.c | |||
@@ -338,9 +338,6 @@ static inline unsigned long strnlen_user_srst(const char __user *src, | |||
338 | register unsigned long reg0 asm("0") = 0; | 338 | register unsigned long reg0 asm("0") = 0; |
339 | unsigned long tmp1, tmp2; | 339 | unsigned long tmp1, tmp2; |
340 | 340 | ||
341 | if (unlikely(!size)) | ||
342 | return 0; | ||
343 | update_primary_asce(current); | ||
344 | asm volatile( | 341 | asm volatile( |
345 | " la %2,0(%1)\n" | 342 | " la %2,0(%1)\n" |
346 | " la %3,0(%0,%1)\n" | 343 | " la %3,0(%0,%1)\n" |
@@ -359,6 +356,8 @@ static inline unsigned long strnlen_user_srst(const char __user *src, | |||
359 | 356 | ||
360 | unsigned long __strnlen_user(const char __user *src, unsigned long size) | 357 | unsigned long __strnlen_user(const char __user *src, unsigned long size) |
361 | { | 358 | { |
359 | if (unlikely(!size)) | ||
360 | return 0; | ||
362 | update_primary_asce(current); | 361 | update_primary_asce(current); |
363 | return strnlen_user_srst(src, size); | 362 | return strnlen_user_srst(src, size); |
364 | } | 363 | } |
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index 19f623f1f21c..2f51a998a67e 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -126,6 +126,133 @@ static inline int user_space_fault(struct pt_regs *regs) | |||
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | static int bad_address(void *p) | ||
130 | { | ||
131 | unsigned long dummy; | ||
132 | |||
133 | return probe_kernel_address((unsigned long *)p, dummy); | ||
134 | } | ||
135 | |||
136 | #ifdef CONFIG_64BIT | ||
137 | static void dump_pagetable(unsigned long asce, unsigned long address) | ||
138 | { | ||
139 | unsigned long *table = __va(asce & PAGE_MASK); | ||
140 | |||
141 | pr_alert("AS:%016lx ", asce); | ||
142 | switch (asce & _ASCE_TYPE_MASK) { | ||
143 | case _ASCE_TYPE_REGION1: | ||
144 | table = table + ((address >> 53) & 0x7ff); | ||
145 | if (bad_address(table)) | ||
146 | goto bad; | ||
147 | pr_cont("R1:%016lx ", *table); | ||
148 | if (*table & _REGION_ENTRY_INVALID) | ||
149 | goto out; | ||
150 | table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); | ||
151 | /* fallthrough */ | ||
152 | case _ASCE_TYPE_REGION2: | ||
153 | table = table + ((address >> 42) & 0x7ff); | ||
154 | if (bad_address(table)) | ||
155 | goto bad; | ||
156 | pr_cont("R2:%016lx ", *table); | ||
157 | if (*table & _REGION_ENTRY_INVALID) | ||
158 | goto out; | ||
159 | table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); | ||
160 | /* fallthrough */ | ||
161 | case _ASCE_TYPE_REGION3: | ||
162 | table = table + ((address >> 31) & 0x7ff); | ||
163 | if (bad_address(table)) | ||
164 | goto bad; | ||
165 | pr_cont("R3:%016lx ", *table); | ||
166 | if (*table & (_REGION_ENTRY_INVALID | _REGION3_ENTRY_LARGE)) | ||
167 | goto out; | ||
168 | table = (unsigned long *)(*table & _REGION_ENTRY_ORIGIN); | ||
169 | /* fallthrough */ | ||
170 | case _ASCE_TYPE_SEGMENT: | ||
171 | table = table + ((address >> 20) & 0x7ff); | ||
172 | if (bad_address(table)) | ||
173 | goto bad; | ||
174 | pr_cont(KERN_CONT "S:%016lx ", *table); | ||
175 | if (*table & (_SEGMENT_ENTRY_INVALID | _SEGMENT_ENTRY_LARGE)) | ||
176 | goto out; | ||
177 | table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN); | ||
178 | } | ||
179 | table = table + ((address >> 12) & 0xff); | ||
180 | if (bad_address(table)) | ||
181 | goto bad; | ||
182 | pr_cont("P:%016lx ", *table); | ||
183 | out: | ||
184 | pr_cont("\n"); | ||
185 | return; | ||
186 | bad: | ||
187 | pr_cont("BAD\n"); | ||
188 | } | ||
189 | |||
190 | #else /* CONFIG_64BIT */ | ||
191 | |||
192 | static void dump_pagetable(unsigned long asce, unsigned long address) | ||
193 | { | ||
194 | unsigned long *table = __va(asce & PAGE_MASK); | ||
195 | |||
196 | pr_alert("AS:%08lx ", asce); | ||
197 | table = table + ((address >> 20) & 0x7ff); | ||
198 | if (bad_address(table)) | ||
199 | goto bad; | ||
200 | pr_cont("S:%08lx ", *table); | ||
201 | if (*table & _SEGMENT_ENTRY_INVALID) | ||
202 | goto out; | ||
203 | table = (unsigned long *)(*table & _SEGMENT_ENTRY_ORIGIN); | ||
204 | table = table + ((address >> 12) & 0xff); | ||
205 | if (bad_address(table)) | ||
206 | goto bad; | ||
207 | pr_cont("P:%08lx ", *table); | ||
208 | out: | ||
209 | pr_cont("\n"); | ||
210 | return; | ||
211 | bad: | ||
212 | pr_cont("BAD\n"); | ||
213 | } | ||
214 | |||
215 | #endif /* CONFIG_64BIT */ | ||
216 | |||
217 | static void dump_fault_info(struct pt_regs *regs) | ||
218 | { | ||
219 | unsigned long asce; | ||
220 | |||
221 | pr_alert("Fault in "); | ||
222 | switch (regs->int_parm_long & 3) { | ||
223 | case 3: | ||
224 | pr_cont("home space "); | ||
225 | break; | ||
226 | case 2: | ||
227 | pr_cont("secondary space "); | ||
228 | break; | ||
229 | case 1: | ||
230 | pr_cont("access register "); | ||
231 | break; | ||
232 | case 0: | ||
233 | pr_cont("primary space "); | ||
234 | break; | ||
235 | } | ||
236 | pr_cont("mode while using "); | ||
237 | if (!user_space_fault(regs)) { | ||
238 | asce = S390_lowcore.kernel_asce; | ||
239 | pr_cont("kernel "); | ||
240 | } | ||
241 | #ifdef CONFIG_PGSTE | ||
242 | else if ((current->flags & PF_VCPU) && S390_lowcore.gmap) { | ||
243 | struct gmap *gmap = (struct gmap *)S390_lowcore.gmap; | ||
244 | asce = gmap->asce; | ||
245 | pr_cont("gmap "); | ||
246 | } | ||
247 | #endif | ||
248 | else { | ||
249 | asce = S390_lowcore.user_asce; | ||
250 | pr_cont("user "); | ||
251 | } | ||
252 | pr_cont("ASCE.\n"); | ||
253 | dump_pagetable(asce, regs->int_parm_long & __FAIL_ADDR_MASK); | ||
254 | } | ||
255 | |||
129 | static inline void report_user_fault(struct pt_regs *regs, long signr) | 256 | static inline void report_user_fault(struct pt_regs *regs, long signr) |
130 | { | 257 | { |
131 | if ((task_pid_nr(current) > 1) && !show_unhandled_signals) | 258 | if ((task_pid_nr(current) > 1) && !show_unhandled_signals) |
@@ -138,8 +265,9 @@ static inline void report_user_fault(struct pt_regs *regs, long signr) | |||
138 | regs->int_code); | 265 | regs->int_code); |
139 | print_vma_addr(KERN_CONT "in ", regs->psw.addr & PSW_ADDR_INSN); | 266 | print_vma_addr(KERN_CONT "in ", regs->psw.addr & PSW_ADDR_INSN); |
140 | printk(KERN_CONT "\n"); | 267 | printk(KERN_CONT "\n"); |
141 | printk(KERN_ALERT "failing address: %lX\n", | 268 | printk(KERN_ALERT "failing address: %016lx TEID: %016lx\n", |
142 | regs->int_parm_long & __FAIL_ADDR_MASK); | 269 | regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long); |
270 | dump_fault_info(regs); | ||
143 | show_regs(regs); | 271 | show_regs(regs); |
144 | } | 272 | } |
145 | 273 | ||
@@ -177,11 +305,13 @@ static noinline void do_no_context(struct pt_regs *regs) | |||
177 | address = regs->int_parm_long & __FAIL_ADDR_MASK; | 305 | address = regs->int_parm_long & __FAIL_ADDR_MASK; |
178 | if (!user_space_fault(regs)) | 306 | if (!user_space_fault(regs)) |
179 | printk(KERN_ALERT "Unable to handle kernel pointer dereference" | 307 | printk(KERN_ALERT "Unable to handle kernel pointer dereference" |
180 | " at virtual kernel address %p\n", (void *)address); | 308 | " in virtual kernel address space\n"); |
181 | else | 309 | else |
182 | printk(KERN_ALERT "Unable to handle kernel paging request" | 310 | printk(KERN_ALERT "Unable to handle kernel paging request" |
183 | " at virtual user address %p\n", (void *)address); | 311 | " in virtual user address space\n"); |
184 | 312 | printk(KERN_ALERT "failing address: %016lx TEID: %016lx\n", | |
313 | regs->int_parm_long & __FAIL_ADDR_MASK, regs->int_parm_long); | ||
314 | dump_fault_info(regs); | ||
185 | die(regs, "Oops"); | 315 | die(regs, "Oops"); |
186 | do_exit(SIGKILL); | 316 | do_exit(SIGKILL); |
187 | } | 317 | } |
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 9c36dc398f90..e9f8fa9337fe 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -276,7 +276,6 @@ static void bpf_jit_noleaks(struct bpf_jit *jit, struct sock_filter *filter) | |||
276 | case BPF_S_LD_W_IND: | 276 | case BPF_S_LD_W_IND: |
277 | case BPF_S_LD_H_IND: | 277 | case BPF_S_LD_H_IND: |
278 | case BPF_S_LD_B_IND: | 278 | case BPF_S_LD_B_IND: |
279 | case BPF_S_LDX_B_MSH: | ||
280 | case BPF_S_LD_IMM: | 279 | case BPF_S_LD_IMM: |
281 | case BPF_S_LD_MEM: | 280 | case BPF_S_LD_MEM: |
282 | case BPF_S_MISC_TXA: | 281 | case BPF_S_MISC_TXA: |
@@ -812,7 +811,7 @@ static struct bpf_binary_header *bpf_alloc_binary(unsigned int bpfsize, | |||
812 | return NULL; | 811 | return NULL; |
813 | memset(header, 0, sz); | 812 | memset(header, 0, sz); |
814 | header->pages = sz / PAGE_SIZE; | 813 | header->pages = sz / PAGE_SIZE; |
815 | hole = sz - (bpfsize + sizeof(*header)); | 814 | hole = min(sz - (bpfsize + sizeof(*header)), PAGE_SIZE - sizeof(*header)); |
816 | /* Insert random number of illegal instructions before BPF code | 815 | /* Insert random number of illegal instructions before BPF code |
817 | * and make sure the first instruction starts at an even address. | 816 | * and make sure the first instruction starts at an even address. |
818 | */ | 817 | */ |
diff --git a/arch/sh/include/asm/tlb.h b/arch/sh/include/asm/tlb.h index 362192ed12fe..62f80d2a9df9 100644 --- a/arch/sh/include/asm/tlb.h +++ b/arch/sh/include/asm/tlb.h | |||
@@ -86,6 +86,14 @@ tlb_end_vma(struct mmu_gather *tlb, struct vm_area_struct *vma) | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | static inline void tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) | ||
90 | { | ||
91 | } | ||
92 | |||
93 | static inline void tlb_flush_mmu_free(struct mmu_gather *tlb) | ||
94 | { | ||
95 | } | ||
96 | |||
89 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) | 97 | static inline void tlb_flush_mmu(struct mmu_gather *tlb) |
90 | { | 98 | { |
91 | } | 99 | } |
diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h index 0f9e94537eee..1a49ffdf9da9 100644 --- a/arch/sparc/include/asm/pgtable_64.h +++ b/arch/sparc/include/asm/pgtable_64.h | |||
@@ -24,7 +24,8 @@ | |||
24 | 24 | ||
25 | /* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB). | 25 | /* The kernel image occupies 0x4000000 to 0x6000000 (4MB --> 96MB). |
26 | * The page copy blockops can use 0x6000000 to 0x8000000. | 26 | * The page copy blockops can use 0x6000000 to 0x8000000. |
27 | * The TSB is mapped in the 0x8000000 to 0xa000000 range. | 27 | * The 8K TSB is mapped in the 0x8000000 to 0x8400000 range. |
28 | * The 4M TSB is mapped in the 0x8400000 to 0x8800000 range. | ||
28 | * The PROM resides in an area spanning 0xf0000000 to 0x100000000. | 29 | * The PROM resides in an area spanning 0xf0000000 to 0x100000000. |
29 | * The vmalloc area spans 0x100000000 to 0x200000000. | 30 | * The vmalloc area spans 0x100000000 to 0x200000000. |
30 | * Since modules need to be in the lowest 32-bits of the address space, | 31 | * Since modules need to be in the lowest 32-bits of the address space, |
@@ -33,7 +34,8 @@ | |||
33 | * 0x400000000. | 34 | * 0x400000000. |
34 | */ | 35 | */ |
35 | #define TLBTEMP_BASE _AC(0x0000000006000000,UL) | 36 | #define TLBTEMP_BASE _AC(0x0000000006000000,UL) |
36 | #define TSBMAP_BASE _AC(0x0000000008000000,UL) | 37 | #define TSBMAP_8K_BASE _AC(0x0000000008000000,UL) |
38 | #define TSBMAP_4M_BASE _AC(0x0000000008400000,UL) | ||
37 | #define MODULES_VADDR _AC(0x0000000010000000,UL) | 39 | #define MODULES_VADDR _AC(0x0000000010000000,UL) |
38 | #define MODULES_LEN _AC(0x00000000e0000000,UL) | 40 | #define MODULES_LEN _AC(0x00000000e0000000,UL) |
39 | #define MODULES_END _AC(0x00000000f0000000,UL) | 41 | #define MODULES_END _AC(0x00000000f0000000,UL) |
@@ -71,6 +73,23 @@ | |||
71 | 73 | ||
72 | #include <linux/sched.h> | 74 | #include <linux/sched.h> |
73 | 75 | ||
76 | extern unsigned long sparc64_valid_addr_bitmap[]; | ||
77 | |||
78 | /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ | ||
79 | static inline bool __kern_addr_valid(unsigned long paddr) | ||
80 | { | ||
81 | if ((paddr >> MAX_PHYS_ADDRESS_BITS) != 0UL) | ||
82 | return false; | ||
83 | return test_bit(paddr >> ILOG2_4MB, sparc64_valid_addr_bitmap); | ||
84 | } | ||
85 | |||
86 | static inline bool kern_addr_valid(unsigned long addr) | ||
87 | { | ||
88 | unsigned long paddr = __pa(addr); | ||
89 | |||
90 | return __kern_addr_valid(paddr); | ||
91 | } | ||
92 | |||
74 | /* Entries per page directory level. */ | 93 | /* Entries per page directory level. */ |
75 | #define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3)) | 94 | #define PTRS_PER_PTE (1UL << (PAGE_SHIFT-3)) |
76 | #define PTRS_PER_PMD (1UL << PMD_BITS) | 95 | #define PTRS_PER_PMD (1UL << PMD_BITS) |
@@ -79,9 +98,12 @@ | |||
79 | /* Kernel has a separate 44bit address space. */ | 98 | /* Kernel has a separate 44bit address space. */ |
80 | #define FIRST_USER_ADDRESS 0 | 99 | #define FIRST_USER_ADDRESS 0 |
81 | 100 | ||
82 | #define pte_ERROR(e) __builtin_trap() | 101 | #define pmd_ERROR(e) \ |
83 | #define pmd_ERROR(e) __builtin_trap() | 102 | pr_err("%s:%d: bad pmd %p(%016lx) seen at (%pS)\n", \ |
84 | #define pgd_ERROR(e) __builtin_trap() | 103 | __FILE__, __LINE__, &(e), pmd_val(e), __builtin_return_address(0)) |
104 | #define pgd_ERROR(e) \ | ||
105 | pr_err("%s:%d: bad pgd %p(%016lx) seen at (%pS)\n", \ | ||
106 | __FILE__, __LINE__, &(e), pgd_val(e), __builtin_return_address(0)) | ||
85 | 107 | ||
86 | #endif /* !(__ASSEMBLY__) */ | 108 | #endif /* !(__ASSEMBLY__) */ |
87 | 109 | ||
@@ -258,8 +280,8 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t prot) | |||
258 | { | 280 | { |
259 | unsigned long mask, tmp; | 281 | unsigned long mask, tmp; |
260 | 282 | ||
261 | /* SUN4U: 0x600307ffffffecb8 (negated == 0x9ffcf80000001347) | 283 | /* SUN4U: 0x630107ffffffec38 (negated == 0x9cfef800000013c7) |
262 | * SUN4V: 0x30ffffffffffee17 (negated == 0xcf000000000011e8) | 284 | * SUN4V: 0x33ffffffffffee07 (negated == 0xcc000000000011f8) |
263 | * | 285 | * |
264 | * Even if we use negation tricks the result is still a 6 | 286 | * Even if we use negation tricks the result is still a 6 |
265 | * instruction sequence, so don't try to play fancy and just | 287 | * instruction sequence, so don't try to play fancy and just |
@@ -289,10 +311,10 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t prot) | |||
289 | " .previous\n" | 311 | " .previous\n" |
290 | : "=r" (mask), "=r" (tmp) | 312 | : "=r" (mask), "=r" (tmp) |
291 | : "i" (_PAGE_PADDR_4U | _PAGE_MODIFIED_4U | _PAGE_ACCESSED_4U | | 313 | : "i" (_PAGE_PADDR_4U | _PAGE_MODIFIED_4U | _PAGE_ACCESSED_4U | |
292 | _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_E_4U | _PAGE_PRESENT_4U | | 314 | _PAGE_CP_4U | _PAGE_CV_4U | _PAGE_E_4U | |
293 | _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4U), | 315 | _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4U), |
294 | "i" (_PAGE_PADDR_4V | _PAGE_MODIFIED_4V | _PAGE_ACCESSED_4V | | 316 | "i" (_PAGE_PADDR_4V | _PAGE_MODIFIED_4V | _PAGE_ACCESSED_4V | |
295 | _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_E_4V | _PAGE_PRESENT_4V | | 317 | _PAGE_CP_4V | _PAGE_CV_4V | _PAGE_E_4V | |
296 | _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4V)); | 318 | _PAGE_SPECIAL | _PAGE_PMD_HUGE | _PAGE_SZALL_4V)); |
297 | 319 | ||
298 | return __pte((pte_val(pte) & mask) | (pgprot_val(prot) & ~mask)); | 320 | return __pte((pte_val(pte) & mask) | (pgprot_val(prot) & ~mask)); |
@@ -633,7 +655,7 @@ static inline unsigned long pmd_large(pmd_t pmd) | |||
633 | { | 655 | { |
634 | pte_t pte = __pte(pmd_val(pmd)); | 656 | pte_t pte = __pte(pmd_val(pmd)); |
635 | 657 | ||
636 | return (pte_val(pte) & _PAGE_PMD_HUGE) && pte_present(pte); | 658 | return pte_val(pte) & _PAGE_PMD_HUGE; |
637 | } | 659 | } |
638 | 660 | ||
639 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 661 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
@@ -719,20 +741,6 @@ static inline pmd_t pmd_mkwrite(pmd_t pmd) | |||
719 | return __pmd(pte_val(pte)); | 741 | return __pmd(pte_val(pte)); |
720 | } | 742 | } |
721 | 743 | ||
722 | static inline pmd_t pmd_mknotpresent(pmd_t pmd) | ||
723 | { | ||
724 | unsigned long mask; | ||
725 | |||
726 | if (tlb_type == hypervisor) | ||
727 | mask = _PAGE_PRESENT_4V; | ||
728 | else | ||
729 | mask = _PAGE_PRESENT_4U; | ||
730 | |||
731 | pmd_val(pmd) &= ~mask; | ||
732 | |||
733 | return pmd; | ||
734 | } | ||
735 | |||
736 | static inline pmd_t pmd_mksplitting(pmd_t pmd) | 744 | static inline pmd_t pmd_mksplitting(pmd_t pmd) |
737 | { | 745 | { |
738 | pte_t pte = __pte(pmd_val(pmd)); | 746 | pte_t pte = __pte(pmd_val(pmd)); |
@@ -757,6 +765,20 @@ static inline int pmd_present(pmd_t pmd) | |||
757 | 765 | ||
758 | #define pmd_none(pmd) (!pmd_val(pmd)) | 766 | #define pmd_none(pmd) (!pmd_val(pmd)) |
759 | 767 | ||
768 | /* pmd_bad() is only called on non-trans-huge PMDs. Our encoding is | ||
769 | * very simple, it's just the physical address. PTE tables are of | ||
770 | * size PAGE_SIZE so make sure the sub-PAGE_SIZE bits are clear and | ||
771 | * the top bits outside of the range of any physical address size we | ||
772 | * support are clear as well. We also validate the physical itself. | ||
773 | */ | ||
774 | #define pmd_bad(pmd) ((pmd_val(pmd) & ~PAGE_MASK) || \ | ||
775 | !__kern_addr_valid(pmd_val(pmd))) | ||
776 | |||
777 | #define pud_none(pud) (!pud_val(pud)) | ||
778 | |||
779 | #define pud_bad(pud) ((pud_val(pud) & ~PAGE_MASK) || \ | ||
780 | !__kern_addr_valid(pud_val(pud))) | ||
781 | |||
760 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 782 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
761 | extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, | 783 | extern void set_pmd_at(struct mm_struct *mm, unsigned long addr, |
762 | pmd_t *pmdp, pmd_t pmd); | 784 | pmd_t *pmdp, pmd_t pmd); |
@@ -790,10 +812,7 @@ static inline unsigned long __pmd_page(pmd_t pmd) | |||
790 | #define pud_page_vaddr(pud) \ | 812 | #define pud_page_vaddr(pud) \ |
791 | ((unsigned long) __va(pud_val(pud))) | 813 | ((unsigned long) __va(pud_val(pud))) |
792 | #define pud_page(pud) virt_to_page((void *)pud_page_vaddr(pud)) | 814 | #define pud_page(pud) virt_to_page((void *)pud_page_vaddr(pud)) |
793 | #define pmd_bad(pmd) (0) | ||
794 | #define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0UL) | 815 | #define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0UL) |
795 | #define pud_none(pud) (!pud_val(pud)) | ||
796 | #define pud_bad(pud) (0) | ||
797 | #define pud_present(pud) (pud_val(pud) != 0U) | 816 | #define pud_present(pud) (pud_val(pud) != 0U) |
798 | #define pud_clear(pudp) (pud_val(*(pudp)) = 0UL) | 817 | #define pud_clear(pudp) (pud_val(*(pudp)) = 0UL) |
799 | 818 | ||
@@ -893,6 +912,10 @@ extern void update_mmu_cache(struct vm_area_struct *, unsigned long, pte_t *); | |||
893 | extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, | 912 | extern void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long addr, |
894 | pmd_t *pmd); | 913 | pmd_t *pmd); |
895 | 914 | ||
915 | #define __HAVE_ARCH_PMDP_INVALIDATE | ||
916 | extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, | ||
917 | pmd_t *pmdp); | ||
918 | |||
896 | #define __HAVE_ARCH_PGTABLE_DEPOSIT | 919 | #define __HAVE_ARCH_PGTABLE_DEPOSIT |
897 | extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | 920 | extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, |
898 | pgtable_t pgtable); | 921 | pgtable_t pgtable); |
@@ -919,18 +942,6 @@ extern unsigned long pte_file(pte_t); | |||
919 | extern pte_t pgoff_to_pte(unsigned long); | 942 | extern pte_t pgoff_to_pte(unsigned long); |
920 | #define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL) | 943 | #define PTE_FILE_MAX_BITS (64UL - PAGE_SHIFT - 1UL) |
921 | 944 | ||
922 | extern unsigned long sparc64_valid_addr_bitmap[]; | ||
923 | |||
924 | /* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ | ||
925 | static inline bool kern_addr_valid(unsigned long addr) | ||
926 | { | ||
927 | unsigned long paddr = __pa(addr); | ||
928 | |||
929 | if ((paddr >> 41UL) != 0UL) | ||
930 | return false; | ||
931 | return test_bit(paddr >> 22, sparc64_valid_addr_bitmap); | ||
932 | } | ||
933 | |||
934 | extern int page_in_phys_avail(unsigned long paddr); | 945 | extern int page_in_phys_avail(unsigned long paddr); |
935 | 946 | ||
936 | /* | 947 | /* |
diff --git a/arch/sparc/include/asm/tsb.h b/arch/sparc/include/asm/tsb.h index 2230f80d9fe3..90916f955cac 100644 --- a/arch/sparc/include/asm/tsb.h +++ b/arch/sparc/include/asm/tsb.h | |||
@@ -171,7 +171,8 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; | |||
171 | andcc REG1, REG2, %g0; \ | 171 | andcc REG1, REG2, %g0; \ |
172 | be,pt %xcc, 700f; \ | 172 | be,pt %xcc, 700f; \ |
173 | sethi %hi(4 * 1024 * 1024), REG2; \ | 173 | sethi %hi(4 * 1024 * 1024), REG2; \ |
174 | andn REG1, REG2, REG1; \ | 174 | brgez,pn REG1, FAIL_LABEL; \ |
175 | andn REG1, REG2, REG1; \ | ||
175 | and VADDR, REG2, REG2; \ | 176 | and VADDR, REG2, REG2; \ |
176 | brlz,pt REG1, PTE_LABEL; \ | 177 | brlz,pt REG1, PTE_LABEL; \ |
177 | or REG1, REG2, REG1; \ | 178 | or REG1, REG2, REG1; \ |
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S index 26b706a1867d..452f04fe8da6 100644 --- a/arch/sparc/kernel/head_64.S +++ b/arch/sparc/kernel/head_64.S | |||
@@ -282,8 +282,8 @@ sun4v_chip_type: | |||
282 | stx %l2, [%l4 + 0x0] | 282 | stx %l2, [%l4 + 0x0] |
283 | ldx [%sp + 2047 + 128 + 0x50], %l3 ! physaddr low | 283 | ldx [%sp + 2047 + 128 + 0x50], %l3 ! physaddr low |
284 | /* 4MB align */ | 284 | /* 4MB align */ |
285 | srlx %l3, 22, %l3 | 285 | srlx %l3, ILOG2_4MB, %l3 |
286 | sllx %l3, 22, %l3 | 286 | sllx %l3, ILOG2_4MB, %l3 |
287 | stx %l3, [%l4 + 0x8] | 287 | stx %l3, [%l4 + 0x8] |
288 | 288 | ||
289 | /* Leave service as-is, "call-method" */ | 289 | /* Leave service as-is, "call-method" */ |
diff --git a/arch/sparc/kernel/ktlb.S b/arch/sparc/kernel/ktlb.S index 542e96ac4d39..605d49204580 100644 --- a/arch/sparc/kernel/ktlb.S +++ b/arch/sparc/kernel/ktlb.S | |||
@@ -277,7 +277,7 @@ kvmap_dtlb_load: | |||
277 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 277 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
278 | kvmap_vmemmap: | 278 | kvmap_vmemmap: |
279 | sub %g4, %g5, %g5 | 279 | sub %g4, %g5, %g5 |
280 | srlx %g5, 22, %g5 | 280 | srlx %g5, ILOG2_4MB, %g5 |
281 | sethi %hi(vmemmap_table), %g1 | 281 | sethi %hi(vmemmap_table), %g1 |
282 | sllx %g5, 3, %g5 | 282 | sllx %g5, 3, %g5 |
283 | or %g1, %lo(vmemmap_table), %g1 | 283 | or %g1, %lo(vmemmap_table), %g1 |
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c index 6479256fd5a4..337094556916 100644 --- a/arch/sparc/kernel/nmi.c +++ b/arch/sparc/kernel/nmi.c | |||
@@ -68,27 +68,16 @@ EXPORT_SYMBOL(touch_nmi_watchdog); | |||
68 | 68 | ||
69 | static void die_nmi(const char *str, struct pt_regs *regs, int do_panic) | 69 | static void die_nmi(const char *str, struct pt_regs *regs, int do_panic) |
70 | { | 70 | { |
71 | int this_cpu = smp_processor_id(); | ||
72 | |||
71 | if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, | 73 | if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, |
72 | pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) | 74 | pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) |
73 | return; | 75 | return; |
74 | 76 | ||
75 | console_verbose(); | ||
76 | bust_spinlocks(1); | ||
77 | |||
78 | printk(KERN_EMERG "%s", str); | ||
79 | printk(" on CPU%d, ip %08lx, registers:\n", | ||
80 | smp_processor_id(), regs->tpc); | ||
81 | show_regs(regs); | ||
82 | dump_stack(); | ||
83 | |||
84 | bust_spinlocks(0); | ||
85 | |||
86 | if (do_panic || panic_on_oops) | 77 | if (do_panic || panic_on_oops) |
87 | panic("Non maskable interrupt"); | 78 | panic("Watchdog detected hard LOCKUP on cpu %d", this_cpu); |
88 | 79 | else | |
89 | nmi_exit(); | 80 | WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu); |
90 | local_irq_enable(); | ||
91 | do_exit(SIGBUS); | ||
92 | } | 81 | } |
93 | 82 | ||
94 | notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | 83 | notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index 9781048161ab..745a3633ce14 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
@@ -149,7 +149,7 @@ void cpu_panic(void) | |||
149 | #define NUM_ROUNDS 64 /* magic value */ | 149 | #define NUM_ROUNDS 64 /* magic value */ |
150 | #define NUM_ITERS 5 /* likewise */ | 150 | #define NUM_ITERS 5 /* likewise */ |
151 | 151 | ||
152 | static DEFINE_SPINLOCK(itc_sync_lock); | 152 | static DEFINE_RAW_SPINLOCK(itc_sync_lock); |
153 | static unsigned long go[SLAVE + 1]; | 153 | static unsigned long go[SLAVE + 1]; |
154 | 154 | ||
155 | #define DEBUG_TICK_SYNC 0 | 155 | #define DEBUG_TICK_SYNC 0 |
@@ -257,7 +257,7 @@ static void smp_synchronize_one_tick(int cpu) | |||
257 | go[MASTER] = 0; | 257 | go[MASTER] = 0; |
258 | membar_safe("#StoreLoad"); | 258 | membar_safe("#StoreLoad"); |
259 | 259 | ||
260 | spin_lock_irqsave(&itc_sync_lock, flags); | 260 | raw_spin_lock_irqsave(&itc_sync_lock, flags); |
261 | { | 261 | { |
262 | for (i = 0; i < NUM_ROUNDS*NUM_ITERS; i++) { | 262 | for (i = 0; i < NUM_ROUNDS*NUM_ITERS; i++) { |
263 | while (!go[MASTER]) | 263 | while (!go[MASTER]) |
@@ -268,7 +268,7 @@ static void smp_synchronize_one_tick(int cpu) | |||
268 | membar_safe("#StoreLoad"); | 268 | membar_safe("#StoreLoad"); |
269 | } | 269 | } |
270 | } | 270 | } |
271 | spin_unlock_irqrestore(&itc_sync_lock, flags); | 271 | raw_spin_unlock_irqrestore(&itc_sync_lock, flags); |
272 | } | 272 | } |
273 | 273 | ||
274 | #if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) | 274 | #if defined(CONFIG_SUN_LDOMS) && defined(CONFIG_HOTPLUG_CPU) |
diff --git a/arch/sparc/kernel/sys32.S b/arch/sparc/kernel/sys32.S index f7c72b6efc27..d066eb18650c 100644 --- a/arch/sparc/kernel/sys32.S +++ b/arch/sparc/kernel/sys32.S | |||
@@ -44,7 +44,7 @@ SIGN1(sys32_timer_settime, compat_sys_timer_settime, %o1) | |||
44 | SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) | 44 | SIGN1(sys32_io_submit, compat_sys_io_submit, %o1) |
45 | SIGN1(sys32_mq_open, compat_sys_mq_open, %o1) | 45 | SIGN1(sys32_mq_open, compat_sys_mq_open, %o1) |
46 | SIGN1(sys32_select, compat_sys_select, %o0) | 46 | SIGN1(sys32_select, compat_sys_select, %o0) |
47 | SIGN3(sys32_futex, compat_sys_futex, %o1, %o2, %o5) | 47 | SIGN1(sys32_futex, compat_sys_futex, %o1) |
48 | SIGN1(sys32_recvfrom, compat_sys_recvfrom, %o0) | 48 | SIGN1(sys32_recvfrom, compat_sys_recvfrom, %o0) |
49 | SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0) | 49 | SIGN1(sys32_recvmsg, compat_sys_recvmsg, %o0) |
50 | SIGN1(sys32_sendmsg, compat_sys_sendmsg, %o0) | 50 | SIGN1(sys32_sendmsg, compat_sys_sendmsg, %o0) |
diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c index a364000ca1aa..7f41d40b7e6e 100644 --- a/arch/sparc/kernel/sysfs.c +++ b/arch/sparc/kernel/sysfs.c | |||
@@ -151,7 +151,7 @@ static ssize_t store_mmustat_enable(struct device *s, | |||
151 | size_t count) | 151 | size_t count) |
152 | { | 152 | { |
153 | unsigned long val, err; | 153 | unsigned long val, err; |
154 | int ret = sscanf(buf, "%ld", &val); | 154 | int ret = sscanf(buf, "%lu", &val); |
155 | 155 | ||
156 | if (ret != 1) | 156 | if (ret != 1) |
157 | return -EINVAL; | 157 | return -EINVAL; |
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c index 3c1a7cb31579..35ab8b60d256 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c | |||
@@ -166,17 +166,23 @@ static unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs) | |||
166 | unsigned long compute_effective_address(struct pt_regs *regs, | 166 | unsigned long compute_effective_address(struct pt_regs *regs, |
167 | unsigned int insn, unsigned int rd) | 167 | unsigned int insn, unsigned int rd) |
168 | { | 168 | { |
169 | int from_kernel = (regs->tstate & TSTATE_PRIV) != 0; | ||
169 | unsigned int rs1 = (insn >> 14) & 0x1f; | 170 | unsigned int rs1 = (insn >> 14) & 0x1f; |
170 | unsigned int rs2 = insn & 0x1f; | 171 | unsigned int rs2 = insn & 0x1f; |
171 | int from_kernel = (regs->tstate & TSTATE_PRIV) != 0; | 172 | unsigned long addr; |
172 | 173 | ||
173 | if (insn & 0x2000) { | 174 | if (insn & 0x2000) { |
174 | maybe_flush_windows(rs1, 0, rd, from_kernel); | 175 | maybe_flush_windows(rs1, 0, rd, from_kernel); |
175 | return (fetch_reg(rs1, regs) + sign_extend_imm13(insn)); | 176 | addr = (fetch_reg(rs1, regs) + sign_extend_imm13(insn)); |
176 | } else { | 177 | } else { |
177 | maybe_flush_windows(rs1, rs2, rd, from_kernel); | 178 | maybe_flush_windows(rs1, rs2, rd, from_kernel); |
178 | return (fetch_reg(rs1, regs) + fetch_reg(rs2, regs)); | 179 | addr = (fetch_reg(rs1, regs) + fetch_reg(rs2, regs)); |
179 | } | 180 | } |
181 | |||
182 | if (!from_kernel && test_thread_flag(TIF_32BIT)) | ||
183 | addr &= 0xffffffff; | ||
184 | |||
185 | return addr; | ||
180 | } | 186 | } |
181 | 187 | ||
182 | /* This is just to make gcc think die_if_kernel does return... */ | 188 | /* This is just to make gcc think die_if_kernel does return... */ |
diff --git a/arch/sparc/lib/NG2memcpy.S b/arch/sparc/lib/NG2memcpy.S index 2c20ad63ddbf..30eee6e8a81b 100644 --- a/arch/sparc/lib/NG2memcpy.S +++ b/arch/sparc/lib/NG2memcpy.S | |||
@@ -236,6 +236,7 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ | |||
236 | */ | 236 | */ |
237 | VISEntryHalf | 237 | VISEntryHalf |
238 | 238 | ||
239 | membar #Sync | ||
239 | alignaddr %o1, %g0, %g0 | 240 | alignaddr %o1, %g0, %g0 |
240 | 241 | ||
241 | add %o1, (64 - 1), %o4 | 242 | add %o1, (64 - 1), %o4 |
diff --git a/arch/sparc/mm/fault_64.c b/arch/sparc/mm/fault_64.c index 69bb818fdd79..4ced3fc66130 100644 --- a/arch/sparc/mm/fault_64.c +++ b/arch/sparc/mm/fault_64.c | |||
@@ -96,38 +96,51 @@ static unsigned int get_user_insn(unsigned long tpc) | |||
96 | pte_t *ptep, pte; | 96 | pte_t *ptep, pte; |
97 | unsigned long pa; | 97 | unsigned long pa; |
98 | u32 insn = 0; | 98 | u32 insn = 0; |
99 | unsigned long pstate; | ||
100 | 99 | ||
101 | if (pgd_none(*pgdp)) | 100 | if (pgd_none(*pgdp) || unlikely(pgd_bad(*pgdp))) |
102 | goto outret; | 101 | goto out; |
103 | pudp = pud_offset(pgdp, tpc); | 102 | pudp = pud_offset(pgdp, tpc); |
104 | if (pud_none(*pudp)) | 103 | if (pud_none(*pudp) || unlikely(pud_bad(*pudp))) |
105 | goto outret; | 104 | goto out; |
106 | pmdp = pmd_offset(pudp, tpc); | ||
107 | if (pmd_none(*pmdp)) | ||
108 | goto outret; | ||
109 | 105 | ||
110 | /* This disables preemption for us as well. */ | 106 | /* This disables preemption for us as well. */ |
111 | __asm__ __volatile__("rdpr %%pstate, %0" : "=r" (pstate)); | 107 | local_irq_disable(); |
112 | __asm__ __volatile__("wrpr %0, %1, %%pstate" | 108 | |
113 | : : "r" (pstate), "i" (PSTATE_IE)); | 109 | pmdp = pmd_offset(pudp, tpc); |
114 | ptep = pte_offset_map(pmdp, tpc); | 110 | if (pmd_none(*pmdp) || unlikely(pmd_bad(*pmdp))) |
115 | pte = *ptep; | 111 | goto out_irq_enable; |
116 | if (!pte_present(pte)) | ||
117 | goto out; | ||
118 | 112 | ||
119 | pa = (pte_pfn(pte) << PAGE_SHIFT); | 113 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
120 | pa += (tpc & ~PAGE_MASK); | 114 | if (pmd_trans_huge(*pmdp)) { |
115 | if (pmd_trans_splitting(*pmdp)) | ||
116 | goto out_irq_enable; | ||
121 | 117 | ||
122 | /* Use phys bypass so we don't pollute dtlb/dcache. */ | 118 | pa = pmd_pfn(*pmdp) << PAGE_SHIFT; |
123 | __asm__ __volatile__("lduwa [%1] %2, %0" | 119 | pa += tpc & ~HPAGE_MASK; |
124 | : "=r" (insn) | ||
125 | : "r" (pa), "i" (ASI_PHYS_USE_EC)); | ||
126 | 120 | ||
121 | /* Use phys bypass so we don't pollute dtlb/dcache. */ | ||
122 | __asm__ __volatile__("lduwa [%1] %2, %0" | ||
123 | : "=r" (insn) | ||
124 | : "r" (pa), "i" (ASI_PHYS_USE_EC)); | ||
125 | } else | ||
126 | #endif | ||
127 | { | ||
128 | ptep = pte_offset_map(pmdp, tpc); | ||
129 | pte = *ptep; | ||
130 | if (pte_present(pte)) { | ||
131 | pa = (pte_pfn(pte) << PAGE_SHIFT); | ||
132 | pa += (tpc & ~PAGE_MASK); | ||
133 | |||
134 | /* Use phys bypass so we don't pollute dtlb/dcache. */ | ||
135 | __asm__ __volatile__("lduwa [%1] %2, %0" | ||
136 | : "=r" (insn) | ||
137 | : "r" (pa), "i" (ASI_PHYS_USE_EC)); | ||
138 | } | ||
139 | pte_unmap(ptep); | ||
140 | } | ||
141 | out_irq_enable: | ||
142 | local_irq_enable(); | ||
127 | out: | 143 | out: |
128 | pte_unmap(ptep); | ||
129 | __asm__ __volatile__("wrpr %0, 0x0, %%pstate" : : "r" (pstate)); | ||
130 | outret: | ||
131 | return insn; | 144 | return insn; |
132 | } | 145 | } |
133 | 146 | ||
@@ -153,7 +166,8 @@ show_signal_msg(struct pt_regs *regs, int sig, int code, | |||
153 | } | 166 | } |
154 | 167 | ||
155 | static void do_fault_siginfo(int code, int sig, struct pt_regs *regs, | 168 | static void do_fault_siginfo(int code, int sig, struct pt_regs *regs, |
156 | unsigned int insn, int fault_code) | 169 | unsigned long fault_addr, unsigned int insn, |
170 | int fault_code) | ||
157 | { | 171 | { |
158 | unsigned long addr; | 172 | unsigned long addr; |
159 | siginfo_t info; | 173 | siginfo_t info; |
@@ -161,10 +175,18 @@ static void do_fault_siginfo(int code, int sig, struct pt_regs *regs, | |||
161 | info.si_code = code; | 175 | info.si_code = code; |
162 | info.si_signo = sig; | 176 | info.si_signo = sig; |
163 | info.si_errno = 0; | 177 | info.si_errno = 0; |
164 | if (fault_code & FAULT_CODE_ITLB) | 178 | if (fault_code & FAULT_CODE_ITLB) { |
165 | addr = regs->tpc; | 179 | addr = regs->tpc; |
166 | else | 180 | } else { |
167 | addr = compute_effective_address(regs, insn, 0); | 181 | /* If we were able to probe the faulting instruction, use it |
182 | * to compute a precise fault address. Otherwise use the fault | ||
183 | * time provided address which may only have page granularity. | ||
184 | */ | ||
185 | if (insn) | ||
186 | addr = compute_effective_address(regs, insn, 0); | ||
187 | else | ||
188 | addr = fault_addr; | ||
189 | } | ||
168 | info.si_addr = (void __user *) addr; | 190 | info.si_addr = (void __user *) addr; |
169 | info.si_trapno = 0; | 191 | info.si_trapno = 0; |
170 | 192 | ||
@@ -239,7 +261,7 @@ static void __kprobes do_kernel_fault(struct pt_regs *regs, int si_code, | |||
239 | /* The si_code was set to make clear whether | 261 | /* The si_code was set to make clear whether |
240 | * this was a SEGV_MAPERR or SEGV_ACCERR fault. | 262 | * this was a SEGV_MAPERR or SEGV_ACCERR fault. |
241 | */ | 263 | */ |
242 | do_fault_siginfo(si_code, SIGSEGV, regs, insn, fault_code); | 264 | do_fault_siginfo(si_code, SIGSEGV, regs, address, insn, fault_code); |
243 | return; | 265 | return; |
244 | } | 266 | } |
245 | 267 | ||
@@ -259,18 +281,6 @@ static void noinline __kprobes bogus_32bit_fault_tpc(struct pt_regs *regs) | |||
259 | show_regs(regs); | 281 | show_regs(regs); |
260 | } | 282 | } |
261 | 283 | ||
262 | static void noinline __kprobes bogus_32bit_fault_address(struct pt_regs *regs, | ||
263 | unsigned long addr) | ||
264 | { | ||
265 | static int times; | ||
266 | |||
267 | if (times++ < 10) | ||
268 | printk(KERN_ERR "FAULT[%s:%d]: 32-bit process " | ||
269 | "reports 64-bit fault address [%lx]\n", | ||
270 | current->comm, current->pid, addr); | ||
271 | show_regs(regs); | ||
272 | } | ||
273 | |||
274 | asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) | 284 | asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) |
275 | { | 285 | { |
276 | enum ctx_state prev_state = exception_enter(); | 286 | enum ctx_state prev_state = exception_enter(); |
@@ -300,10 +310,8 @@ asmlinkage void __kprobes do_sparc64_fault(struct pt_regs *regs) | |||
300 | goto intr_or_no_mm; | 310 | goto intr_or_no_mm; |
301 | } | 311 | } |
302 | } | 312 | } |
303 | if (unlikely((address >> 32) != 0)) { | 313 | if (unlikely((address >> 32) != 0)) |
304 | bogus_32bit_fault_address(regs, address); | ||
305 | goto intr_or_no_mm; | 314 | goto intr_or_no_mm; |
306 | } | ||
307 | } | 315 | } |
308 | 316 | ||
309 | if (regs->tstate & TSTATE_PRIV) { | 317 | if (regs->tstate & TSTATE_PRIV) { |
@@ -525,7 +533,7 @@ do_sigbus: | |||
525 | * Send a sigbus, regardless of whether we were in kernel | 533 | * Send a sigbus, regardless of whether we were in kernel |
526 | * or user mode. | 534 | * or user mode. |
527 | */ | 535 | */ |
528 | do_fault_siginfo(BUS_ADRERR, SIGBUS, regs, insn, fault_code); | 536 | do_fault_siginfo(BUS_ADRERR, SIGBUS, regs, address, insn, fault_code); |
529 | 537 | ||
530 | /* Kernel mode? Handle exceptions or die */ | 538 | /* Kernel mode? Handle exceptions or die */ |
531 | if (regs->tstate & TSTATE_PRIV) | 539 | if (regs->tstate & TSTATE_PRIV) |
diff --git a/arch/sparc/mm/gup.c b/arch/sparc/mm/gup.c index c4d3da68b800..1aed0432c64b 100644 --- a/arch/sparc/mm/gup.c +++ b/arch/sparc/mm/gup.c | |||
@@ -73,7 +73,7 @@ static int gup_huge_pmd(pmd_t *pmdp, pmd_t pmd, unsigned long addr, | |||
73 | struct page *head, *page, *tail; | 73 | struct page *head, *page, *tail; |
74 | int refs; | 74 | int refs; |
75 | 75 | ||
76 | if (!pmd_large(pmd)) | 76 | if (!(pmd_val(pmd) & _PAGE_VALID)) |
77 | return 0; | 77 | return 0; |
78 | 78 | ||
79 | if (write && !pmd_write(pmd)) | 79 | if (write && !pmd_write(pmd)) |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index eafbc65c9c47..ed3c969a5f4c 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -588,7 +588,7 @@ static void __init remap_kernel(void) | |||
588 | int i, tlb_ent = sparc64_highest_locked_tlbent(); | 588 | int i, tlb_ent = sparc64_highest_locked_tlbent(); |
589 | 589 | ||
590 | tte_vaddr = (unsigned long) KERNBASE; | 590 | tte_vaddr = (unsigned long) KERNBASE; |
591 | phys_page = (prom_boot_mapping_phys_low >> 22UL) << 22UL; | 591 | phys_page = (prom_boot_mapping_phys_low >> ILOG2_4MB) << ILOG2_4MB; |
592 | tte_data = kern_large_tte(phys_page); | 592 | tte_data = kern_large_tte(phys_page); |
593 | 593 | ||
594 | kern_locked_tte_data = tte_data; | 594 | kern_locked_tte_data = tte_data; |
@@ -1881,7 +1881,7 @@ void __init paging_init(void) | |||
1881 | 1881 | ||
1882 | BUILD_BUG_ON(NR_CPUS > 4096); | 1882 | BUILD_BUG_ON(NR_CPUS > 4096); |
1883 | 1883 | ||
1884 | kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL; | 1884 | kern_base = (prom_boot_mapping_phys_low >> ILOG2_4MB) << ILOG2_4MB; |
1885 | kern_size = (unsigned long)&_end - (unsigned long)KERNBASE; | 1885 | kern_size = (unsigned long)&_end - (unsigned long)KERNBASE; |
1886 | 1886 | ||
1887 | /* Invalidate both kernel TSBs. */ | 1887 | /* Invalidate both kernel TSBs. */ |
@@ -1937,7 +1937,7 @@ void __init paging_init(void) | |||
1937 | shift = kern_base + PAGE_OFFSET - ((unsigned long)KERNBASE); | 1937 | shift = kern_base + PAGE_OFFSET - ((unsigned long)KERNBASE); |
1938 | 1938 | ||
1939 | real_end = (unsigned long)_end; | 1939 | real_end = (unsigned long)_end; |
1940 | num_kernel_image_mappings = DIV_ROUND_UP(real_end - KERNBASE, 1 << 22); | 1940 | num_kernel_image_mappings = DIV_ROUND_UP(real_end - KERNBASE, 1 << ILOG2_4MB); |
1941 | printk("Kernel: Using %d locked TLB entries for main kernel image.\n", | 1941 | printk("Kernel: Using %d locked TLB entries for main kernel image.\n", |
1942 | num_kernel_image_mappings); | 1942 | num_kernel_image_mappings); |
1943 | 1943 | ||
@@ -2094,7 +2094,7 @@ static void __init setup_valid_addr_bitmap_from_pavail(unsigned long *bitmap) | |||
2094 | 2094 | ||
2095 | if (new_start <= old_start && | 2095 | if (new_start <= old_start && |
2096 | new_end >= (old_start + PAGE_SIZE)) { | 2096 | new_end >= (old_start + PAGE_SIZE)) { |
2097 | set_bit(old_start >> 22, bitmap); | 2097 | set_bit(old_start >> ILOG2_4MB, bitmap); |
2098 | goto do_next_page; | 2098 | goto do_next_page; |
2099 | } | 2099 | } |
2100 | } | 2100 | } |
@@ -2143,7 +2143,7 @@ void __init mem_init(void) | |||
2143 | addr = PAGE_OFFSET + kern_base; | 2143 | addr = PAGE_OFFSET + kern_base; |
2144 | last = PAGE_ALIGN(kern_size) + addr; | 2144 | last = PAGE_ALIGN(kern_size) + addr; |
2145 | while (addr < last) { | 2145 | while (addr < last) { |
2146 | set_bit(__pa(addr) >> 22, sparc64_valid_addr_bitmap); | 2146 | set_bit(__pa(addr) >> ILOG2_4MB, sparc64_valid_addr_bitmap); |
2147 | addr += PAGE_SIZE; | 2147 | addr += PAGE_SIZE; |
2148 | } | 2148 | } |
2149 | 2149 | ||
@@ -2267,7 +2267,7 @@ int __meminit vmemmap_populate(unsigned long vstart, unsigned long vend, | |||
2267 | void *block; | 2267 | void *block; |
2268 | 2268 | ||
2269 | if (!(*vmem_pp & _PAGE_VALID)) { | 2269 | if (!(*vmem_pp & _PAGE_VALID)) { |
2270 | block = vmemmap_alloc_block(1UL << 22, node); | 2270 | block = vmemmap_alloc_block(1UL << ILOG2_4MB, node); |
2271 | if (!block) | 2271 | if (!block) |
2272 | return -ENOMEM; | 2272 | return -ENOMEM; |
2273 | 2273 | ||
diff --git a/arch/sparc/mm/tlb.c b/arch/sparc/mm/tlb.c index b12cb5e72812..b89aba217e3b 100644 --- a/arch/sparc/mm/tlb.c +++ b/arch/sparc/mm/tlb.c | |||
@@ -134,7 +134,7 @@ no_cache_flush: | |||
134 | 134 | ||
135 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 135 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
136 | static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr, | 136 | static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr, |
137 | pmd_t pmd, bool exec) | 137 | pmd_t pmd) |
138 | { | 138 | { |
139 | unsigned long end; | 139 | unsigned long end; |
140 | pte_t *pte; | 140 | pte_t *pte; |
@@ -142,8 +142,11 @@ static void tlb_batch_pmd_scan(struct mm_struct *mm, unsigned long vaddr, | |||
142 | pte = pte_offset_map(&pmd, vaddr); | 142 | pte = pte_offset_map(&pmd, vaddr); |
143 | end = vaddr + HPAGE_SIZE; | 143 | end = vaddr + HPAGE_SIZE; |
144 | while (vaddr < end) { | 144 | while (vaddr < end) { |
145 | if (pte_val(*pte) & _PAGE_VALID) | 145 | if (pte_val(*pte) & _PAGE_VALID) { |
146 | bool exec = pte_exec(*pte); | ||
147 | |||
146 | tlb_batch_add_one(mm, vaddr, exec); | 148 | tlb_batch_add_one(mm, vaddr, exec); |
149 | } | ||
147 | pte++; | 150 | pte++; |
148 | vaddr += PAGE_SIZE; | 151 | vaddr += PAGE_SIZE; |
149 | } | 152 | } |
@@ -177,19 +180,30 @@ void set_pmd_at(struct mm_struct *mm, unsigned long addr, | |||
177 | } | 180 | } |
178 | 181 | ||
179 | if (!pmd_none(orig)) { | 182 | if (!pmd_none(orig)) { |
180 | pte_t orig_pte = __pte(pmd_val(orig)); | ||
181 | bool exec = pte_exec(orig_pte); | ||
182 | |||
183 | addr &= HPAGE_MASK; | 183 | addr &= HPAGE_MASK; |
184 | if (pmd_trans_huge(orig)) { | 184 | if (pmd_trans_huge(orig)) { |
185 | pte_t orig_pte = __pte(pmd_val(orig)); | ||
186 | bool exec = pte_exec(orig_pte); | ||
187 | |||
185 | tlb_batch_add_one(mm, addr, exec); | 188 | tlb_batch_add_one(mm, addr, exec); |
186 | tlb_batch_add_one(mm, addr + REAL_HPAGE_SIZE, exec); | 189 | tlb_batch_add_one(mm, addr + REAL_HPAGE_SIZE, exec); |
187 | } else { | 190 | } else { |
188 | tlb_batch_pmd_scan(mm, addr, orig, exec); | 191 | tlb_batch_pmd_scan(mm, addr, orig); |
189 | } | 192 | } |
190 | } | 193 | } |
191 | } | 194 | } |
192 | 195 | ||
196 | void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, | ||
197 | pmd_t *pmdp) | ||
198 | { | ||
199 | pmd_t entry = *pmdp; | ||
200 | |||
201 | pmd_val(entry) &= ~_PAGE_VALID; | ||
202 | |||
203 | set_pmd_at(vma->vm_mm, address, pmdp, entry); | ||
204 | flush_tlb_range(vma, address, address + HPAGE_PMD_SIZE); | ||
205 | } | ||
206 | |||
193 | void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, | 207 | void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp, |
194 | pgtable_t pgtable) | 208 | pgtable_t pgtable) |
195 | { | 209 | { |
diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c index f5d506fdddad..fe19b81acc09 100644 --- a/arch/sparc/mm/tsb.c +++ b/arch/sparc/mm/tsb.c | |||
@@ -133,7 +133,19 @@ static void setup_tsb_params(struct mm_struct *mm, unsigned long tsb_idx, unsign | |||
133 | mm->context.tsb_block[tsb_idx].tsb_nentries = | 133 | mm->context.tsb_block[tsb_idx].tsb_nentries = |
134 | tsb_bytes / sizeof(struct tsb); | 134 | tsb_bytes / sizeof(struct tsb); |
135 | 135 | ||
136 | base = TSBMAP_BASE; | 136 | switch (tsb_idx) { |
137 | case MM_TSB_BASE: | ||
138 | base = TSBMAP_8K_BASE; | ||
139 | break; | ||
140 | #if defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE) | ||
141 | case MM_TSB_HUGE: | ||
142 | base = TSBMAP_4M_BASE; | ||
143 | break; | ||
144 | #endif | ||
145 | default: | ||
146 | BUG(); | ||
147 | } | ||
148 | |||
137 | tte = pgprot_val(PAGE_KERNEL_LOCKED); | 149 | tte = pgprot_val(PAGE_KERNEL_LOCKED); |
138 | tsb_paddr = __pa(mm->context.tsb_block[tsb_idx].tsb); | 150 | tsb_paddr = __pa(mm->context.tsb_block[tsb_idx].tsb); |
139 | BUG_ON(tsb_paddr & (tsb_bytes - 1UL)); | 151 | BUG_ON(tsb_paddr & (tsb_bytes - 1UL)); |
diff --git a/arch/um/include/asm/tlb.h b/arch/um/include/asm/tlb.h index 29b0301c18aa..16eb63fac57d 100644 --- a/arch/um/include/asm/tlb.h +++ b/arch/um/include/asm/tlb.h | |||
@@ -59,13 +59,25 @@ extern void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, | |||
59 | unsigned long end); | 59 | unsigned long end); |
60 | 60 | ||
61 | static inline void | 61 | static inline void |
62 | tlb_flush_mmu_tlbonly(struct mmu_gather *tlb) | ||
63 | { | ||
64 | flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); | ||
65 | } | ||
66 | |||
67 | static inline void | ||
68 | tlb_flush_mmu_free(struct mmu_gather *tlb) | ||
69 | { | ||
70 | init_tlb_gather(tlb); | ||
71 | } | ||
72 | |||
73 | static inline void | ||
62 | tlb_flush_mmu(struct mmu_gather *tlb) | 74 | tlb_flush_mmu(struct mmu_gather *tlb) |
63 | { | 75 | { |
64 | if (!tlb->need_flush) | 76 | if (!tlb->need_flush) |
65 | return; | 77 | return; |
66 | 78 | ||
67 | flush_tlb_mm_range(tlb->mm, tlb->start, tlb->end); | 79 | tlb_flush_mmu_tlbonly(tlb); |
68 | init_tlb_gather(tlb); | 80 | tlb_flush_mmu_free(tlb); |
69 | } | 81 | } |
70 | 82 | ||
71 | /* tlb_finish_mmu | 83 | /* tlb_finish_mmu |
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 75298d3358e7..08eec0b691b0 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h | |||
@@ -136,6 +136,7 @@ extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg); | |||
136 | extern int os_get_ifname(int fd, char *namebuf); | 136 | extern int os_get_ifname(int fd, char *namebuf); |
137 | extern int os_set_slip(int fd); | 137 | extern int os_set_slip(int fd); |
138 | extern int os_mode_fd(int fd, int mode); | 138 | extern int os_mode_fd(int fd, int mode); |
139 | extern int os_fsync_file(int fd); | ||
139 | 140 | ||
140 | extern int os_seek_file(int fd, unsigned long long offset); | 141 | extern int os_seek_file(int fd, unsigned long long offset); |
141 | extern int os_open_file(const char *file, struct openflags flags, int mode); | 142 | extern int os_open_file(const char *file, struct openflags flags, int mode); |
diff --git a/arch/um/kernel/physmem.c b/arch/um/kernel/physmem.c index f116db15d402..30fdd5d0067b 100644 --- a/arch/um/kernel/physmem.c +++ b/arch/um/kernel/physmem.c | |||
@@ -103,6 +103,7 @@ void __init setup_physmem(unsigned long start, unsigned long reserve_end, | |||
103 | */ | 103 | */ |
104 | os_seek_file(physmem_fd, __pa(&__syscall_stub_start)); | 104 | os_seek_file(physmem_fd, __pa(&__syscall_stub_start)); |
105 | os_write_file(physmem_fd, &__syscall_stub_start, PAGE_SIZE); | 105 | os_write_file(physmem_fd, &__syscall_stub_start, PAGE_SIZE); |
106 | os_fsync_file(physmem_fd); | ||
106 | 107 | ||
107 | bootmap_size = init_bootmem(pfn, pfn + delta); | 108 | bootmap_size = init_bootmem(pfn, pfn + delta); |
108 | free_bootmem(__pa(reserve_end) + bootmap_size, | 109 | free_bootmem(__pa(reserve_end) + bootmap_size, |
diff --git a/arch/um/os-Linux/file.c b/arch/um/os-Linux/file.c index 07a750197bb0..08d90fba952c 100644 --- a/arch/um/os-Linux/file.c +++ b/arch/um/os-Linux/file.c | |||
@@ -237,6 +237,12 @@ void os_close_file(int fd) | |||
237 | { | 237 | { |
238 | close(fd); | 238 | close(fd); |
239 | } | 239 | } |
240 | int os_fsync_file(int fd) | ||
241 | { | ||
242 | if (fsync(fd) < 0) | ||
243 | return -errno; | ||
244 | return 0; | ||
245 | } | ||
240 | 246 | ||
241 | int os_seek_file(int fd, unsigned long long offset) | 247 | int os_seek_file(int fd, unsigned long long offset) |
242 | { | 248 | { |
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index e1704ff600ff..df9191acd926 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -151,6 +151,7 @@ int __init main(int argc, char **argv, char **envp) | |||
151 | #endif | 151 | #endif |
152 | 152 | ||
153 | do_uml_initcalls(); | 153 | do_uml_initcalls(); |
154 | change_sig(SIGPIPE, 0); | ||
154 | ret = linux_main(argc, argv); | 155 | ret = linux_main(argc, argv); |
155 | 156 | ||
156 | /* | 157 | /* |
diff --git a/arch/um/os-Linux/mem.c b/arch/um/os-Linux/mem.c index 3c4af77e51a2..897e9ad0c108 100644 --- a/arch/um/os-Linux/mem.c +++ b/arch/um/os-Linux/mem.c | |||
@@ -12,337 +12,117 @@ | |||
12 | #include <string.h> | 12 | #include <string.h> |
13 | #include <sys/stat.h> | 13 | #include <sys/stat.h> |
14 | #include <sys/mman.h> | 14 | #include <sys/mman.h> |
15 | #include <sys/param.h> | 15 | #include <sys/vfs.h> |
16 | #include <linux/magic.h> | ||
16 | #include <init.h> | 17 | #include <init.h> |
17 | #include <os.h> | 18 | #include <os.h> |
18 | 19 | ||
19 | /* Modified by which_tmpdir, which is called during early boot */ | 20 | /* Set by make_tempfile() during early boot. */ |
20 | static char *default_tmpdir = "/tmp"; | ||
21 | |||
22 | /* | ||
23 | * Modified when creating the physical memory file and when checking | ||
24 | * the tmp filesystem for usability, both happening during early boot. | ||
25 | */ | ||
26 | static char *tempdir = NULL; | 21 | static char *tempdir = NULL; |
27 | 22 | ||
28 | static void __init find_tempdir(void) | 23 | /* Check if dir is on tmpfs. Return 0 if yes, -1 if no or error. */ |
24 | static int __init check_tmpfs(const char *dir) | ||
29 | { | 25 | { |
30 | const char *dirs[] = { "TMP", "TEMP", "TMPDIR", NULL }; | 26 | struct statfs st; |
31 | int i; | ||
32 | char *dir = NULL; | ||
33 | |||
34 | if (tempdir != NULL) | ||
35 | /* We've already been called */ | ||
36 | return; | ||
37 | for (i = 0; dirs[i]; i++) { | ||
38 | dir = getenv(dirs[i]); | ||
39 | if ((dir != NULL) && (*dir != '\0')) | ||
40 | break; | ||
41 | } | ||
42 | if ((dir == NULL) || (*dir == '\0')) | ||
43 | dir = default_tmpdir; | ||
44 | 27 | ||
45 | tempdir = malloc(strlen(dir) + 2); | 28 | printf("Checking if %s is on tmpfs...", dir); |
46 | if (tempdir == NULL) { | 29 | if (statfs(dir, &st) < 0) { |
47 | fprintf(stderr, "Failed to malloc tempdir, " | 30 | printf("%s\n", strerror(errno)); |
48 | "errno = %d\n", errno); | 31 | } else if (st.f_type != TMPFS_MAGIC) { |
49 | return; | 32 | printf("no\n"); |
50 | } | 33 | } else { |
51 | strcpy(tempdir, dir); | 34 | printf("OK\n"); |
52 | strcat(tempdir, "/"); | 35 | return 0; |
53 | } | ||
54 | |||
55 | /* | ||
56 | * Remove bytes from the front of the buffer and refill it so that if there's a | ||
57 | * partial string that we care about, it will be completed, and we can recognize | ||
58 | * it. | ||
59 | */ | ||
60 | static int pop(int fd, char *buf, size_t size, size_t npop) | ||
61 | { | ||
62 | ssize_t n; | ||
63 | size_t len = strlen(&buf[npop]); | ||
64 | |||
65 | memmove(buf, &buf[npop], len + 1); | ||
66 | n = read(fd, &buf[len], size - len - 1); | ||
67 | if (n < 0) | ||
68 | return -errno; | ||
69 | |||
70 | buf[len + n] = '\0'; | ||
71 | return 1; | ||
72 | } | ||
73 | |||
74 | /* | ||
75 | * This will return 1, with the first character in buf being the | ||
76 | * character following the next instance of c in the file. This will | ||
77 | * read the file as needed. If there's an error, -errno is returned; | ||
78 | * if the end of the file is reached, 0 is returned. | ||
79 | */ | ||
80 | static int next(int fd, char *buf, size_t size, char c) | ||
81 | { | ||
82 | ssize_t n; | ||
83 | char *ptr; | ||
84 | |||
85 | while ((ptr = strchr(buf, c)) == NULL) { | ||
86 | n = read(fd, buf, size - 1); | ||
87 | if (n == 0) | ||
88 | return 0; | ||
89 | else if (n < 0) | ||
90 | return -errno; | ||
91 | |||
92 | buf[n] = '\0'; | ||
93 | } | 36 | } |
94 | 37 | return -1; | |
95 | return pop(fd, buf, size, ptr - buf + 1); | ||
96 | } | 38 | } |
97 | 39 | ||
98 | /* | 40 | /* |
99 | * Decode an octal-escaped and space-terminated path of the form used by | 41 | * Choose the tempdir to use. We want something on tmpfs so that our memory is |
100 | * /proc/mounts. May be used to decode a path in-place. "out" must be at least | 42 | * not subject to the host's vm.dirty_ratio. If a tempdir is specified in the |
101 | * as large as the input. The output is always null-terminated. "len" gets the | 43 | * environment, we use that even if it's not on tmpfs, but we warn the user. |
102 | * length of the output, excluding the trailing null. Returns 0 if a full path | 44 | * Otherwise, we try common tmpfs locations, and if no tmpfs directory is found |
103 | * was successfully decoded, otherwise an error. | 45 | * then we fall back to /tmp. |
104 | */ | 46 | */ |
105 | static int decode_path(const char *in, char *out, size_t *len) | 47 | static char * __init choose_tempdir(void) |
106 | { | 48 | { |
107 | char *first = out; | 49 | static const char * const vars[] = { |
108 | int c; | 50 | "TMPDIR", |
51 | "TMP", | ||
52 | "TEMP", | ||
53 | NULL | ||
54 | }; | ||
55 | static const char fallback_dir[] = "/tmp"; | ||
56 | static const char * const tmpfs_dirs[] = { | ||
57 | "/dev/shm", | ||
58 | fallback_dir, | ||
59 | NULL | ||
60 | }; | ||
109 | int i; | 61 | int i; |
110 | int ret = -EINVAL; | 62 | const char *dir; |
111 | while (1) { | 63 | |
112 | switch (*in) { | 64 | printf("Checking environment variables for a tempdir..."); |
113 | case '\0': | 65 | for (i = 0; vars[i]; i++) { |
114 | goto out; | 66 | dir = getenv(vars[i]); |
115 | 67 | if ((dir != NULL) && (*dir != '\0')) { | |
116 | case ' ': | 68 | printf("%s\n", dir); |
117 | ret = 0; | 69 | if (check_tmpfs(dir) >= 0) |
118 | goto out; | 70 | goto done; |
119 | 71 | else | |
120 | case '\\': | 72 | goto warn; |
121 | in++; | ||
122 | c = 0; | ||
123 | for (i = 0; i < 3; i++) { | ||
124 | if (*in < '0' || *in > '7') | ||
125 | goto out; | ||
126 | c = (c << 3) | (*in++ - '0'); | ||
127 | } | ||
128 | *(unsigned char *)out++ = (unsigned char) c; | ||
129 | break; | ||
130 | |||
131 | default: | ||
132 | *out++ = *in++; | ||
133 | break; | ||
134 | } | 73 | } |
135 | } | 74 | } |
75 | printf("none found\n"); | ||
136 | 76 | ||
137 | out: | 77 | for (i = 0; tmpfs_dirs[i]; i++) { |
138 | *out = '\0'; | 78 | dir = tmpfs_dirs[i]; |
139 | *len = out - first; | 79 | if (check_tmpfs(dir) >= 0) |
140 | return ret; | 80 | goto done; |
141 | } | ||
142 | |||
143 | /* | ||
144 | * Computes the length of s when encoded with three-digit octal escape sequences | ||
145 | * for the characters in chars. | ||
146 | */ | ||
147 | static size_t octal_encoded_length(const char *s, const char *chars) | ||
148 | { | ||
149 | size_t len = strlen(s); | ||
150 | while ((s = strpbrk(s, chars)) != NULL) { | ||
151 | len += 3; | ||
152 | s++; | ||
153 | } | ||
154 | |||
155 | return len; | ||
156 | } | ||
157 | |||
158 | enum { | ||
159 | OUTCOME_NOTHING_MOUNTED, | ||
160 | OUTCOME_TMPFS_MOUNT, | ||
161 | OUTCOME_NON_TMPFS_MOUNT, | ||
162 | }; | ||
163 | |||
164 | /* Read a line of /proc/mounts data looking for a tmpfs mount at "path". */ | ||
165 | static int read_mount(int fd, char *buf, size_t bufsize, const char *path, | ||
166 | int *outcome) | ||
167 | { | ||
168 | int found; | ||
169 | int match; | ||
170 | char *space; | ||
171 | size_t len; | ||
172 | |||
173 | enum { | ||
174 | MATCH_NONE, | ||
175 | MATCH_EXACT, | ||
176 | MATCH_PARENT, | ||
177 | }; | ||
178 | |||
179 | found = next(fd, buf, bufsize, ' '); | ||
180 | if (found != 1) | ||
181 | return found; | ||
182 | |||
183 | /* | ||
184 | * If there's no following space in the buffer, then this path is | ||
185 | * truncated, so it can't be the one we're looking for. | ||
186 | */ | ||
187 | space = strchr(buf, ' '); | ||
188 | if (space) { | ||
189 | match = MATCH_NONE; | ||
190 | if (!decode_path(buf, buf, &len)) { | ||
191 | if (!strcmp(buf, path)) | ||
192 | match = MATCH_EXACT; | ||
193 | else if (!strncmp(buf, path, len) | ||
194 | && (path[len] == '/' || !strcmp(buf, "/"))) | ||
195 | match = MATCH_PARENT; | ||
196 | } | ||
197 | |||
198 | found = pop(fd, buf, bufsize, space - buf + 1); | ||
199 | if (found != 1) | ||
200 | return found; | ||
201 | |||
202 | switch (match) { | ||
203 | case MATCH_EXACT: | ||
204 | if (!strncmp(buf, "tmpfs", strlen("tmpfs"))) | ||
205 | *outcome = OUTCOME_TMPFS_MOUNT; | ||
206 | else | ||
207 | *outcome = OUTCOME_NON_TMPFS_MOUNT; | ||
208 | break; | ||
209 | |||
210 | case MATCH_PARENT: | ||
211 | /* This mount obscures any previous ones. */ | ||
212 | *outcome = OUTCOME_NOTHING_MOUNTED; | ||
213 | break; | ||
214 | } | ||
215 | } | 81 | } |
216 | 82 | ||
217 | return next(fd, buf, bufsize, '\n'); | 83 | dir = fallback_dir; |
84 | warn: | ||
85 | printf("Warning: tempdir %s is not on tmpfs\n", dir); | ||
86 | done: | ||
87 | /* Make a copy since getenv results may not remain valid forever. */ | ||
88 | return strdup(dir); | ||
218 | } | 89 | } |
219 | 90 | ||
220 | /* which_tmpdir is called only during early boot */ | ||
221 | static int checked_tmpdir = 0; | ||
222 | |||
223 | /* | 91 | /* |
224 | * Look for a tmpfs mounted at /dev/shm. I couldn't find a cleaner | 92 | * Create an unlinked tempfile in a suitable tempdir. template must be the |
225 | * way to do this than to parse /proc/mounts. statfs will return the | 93 | * basename part of the template with a leading '/'. |
226 | * same filesystem magic number and fs id for both /dev and /dev/shm | ||
227 | * when they are both tmpfs, so you can't tell if they are different | ||
228 | * filesystems. Also, there seems to be no other way of finding the | ||
229 | * mount point of a filesystem from within it. | ||
230 | * | ||
231 | * If a /dev/shm tmpfs entry is found, then we switch to using it. | ||
232 | * Otherwise, we stay with the default /tmp. | ||
233 | */ | 94 | */ |
234 | static void which_tmpdir(void) | 95 | static int __init make_tempfile(const char *template) |
235 | { | 96 | { |
97 | char *tempname; | ||
236 | int fd; | 98 | int fd; |
237 | int found; | ||
238 | int outcome; | ||
239 | char *path; | ||
240 | char *buf; | ||
241 | size_t bufsize; | ||
242 | 99 | ||
243 | if (checked_tmpdir) | 100 | if (tempdir == NULL) { |
244 | return; | 101 | tempdir = choose_tempdir(); |
245 | 102 | if (tempdir == NULL) { | |
246 | checked_tmpdir = 1; | 103 | fprintf(stderr, "Failed to choose tempdir: %s\n", |
247 | 104 | strerror(errno)); | |
248 | printf("Checking for tmpfs mount on /dev/shm..."); | 105 | return -1; |
249 | |||
250 | path = realpath("/dev/shm", NULL); | ||
251 | if (!path) { | ||
252 | printf("failed to check real path, errno = %d\n", errno); | ||
253 | return; | ||
254 | } | ||
255 | printf("%s...", path); | ||
256 | |||
257 | /* | ||
258 | * The buffer needs to be able to fit the full octal-escaped path, a | ||
259 | * space, and a trailing null in order to successfully decode it. | ||
260 | */ | ||
261 | bufsize = octal_encoded_length(path, " \t\n\\") + 2; | ||
262 | |||
263 | if (bufsize < 128) | ||
264 | bufsize = 128; | ||
265 | |||
266 | buf = malloc(bufsize); | ||
267 | if (!buf) { | ||
268 | printf("malloc failed, errno = %d\n", errno); | ||
269 | goto out; | ||
270 | } | ||
271 | buf[0] = '\0'; | ||
272 | |||
273 | fd = open("/proc/mounts", O_RDONLY); | ||
274 | if (fd < 0) { | ||
275 | printf("failed to open /proc/mounts, errno = %d\n", errno); | ||
276 | goto out1; | ||
277 | } | ||
278 | |||
279 | outcome = OUTCOME_NOTHING_MOUNTED; | ||
280 | while (1) { | ||
281 | found = read_mount(fd, buf, bufsize, path, &outcome); | ||
282 | if (found != 1) | ||
283 | break; | ||
284 | } | ||
285 | |||
286 | if (found < 0) { | ||
287 | printf("read returned errno %d\n", -found); | ||
288 | } else { | ||
289 | switch (outcome) { | ||
290 | case OUTCOME_TMPFS_MOUNT: | ||
291 | printf("OK\n"); | ||
292 | default_tmpdir = "/dev/shm"; | ||
293 | break; | ||
294 | |||
295 | case OUTCOME_NON_TMPFS_MOUNT: | ||
296 | printf("not tmpfs\n"); | ||
297 | break; | ||
298 | |||
299 | default: | ||
300 | printf("nothing mounted on /dev/shm\n"); | ||
301 | break; | ||
302 | } | 106 | } |
303 | } | 107 | } |
304 | 108 | ||
305 | close(fd); | 109 | tempname = malloc(strlen(tempdir) + strlen(template) + 1); |
306 | out1: | ||
307 | free(buf); | ||
308 | out: | ||
309 | free(path); | ||
310 | } | ||
311 | |||
312 | static int __init make_tempfile(const char *template, char **out_tempname, | ||
313 | int do_unlink) | ||
314 | { | ||
315 | char *tempname; | ||
316 | int fd; | ||
317 | |||
318 | which_tmpdir(); | ||
319 | tempname = malloc(MAXPATHLEN); | ||
320 | if (tempname == NULL) | 110 | if (tempname == NULL) |
321 | return -1; | 111 | return -1; |
322 | 112 | ||
323 | find_tempdir(); | 113 | strcpy(tempname, tempdir); |
324 | if ((tempdir == NULL) || (strlen(tempdir) >= MAXPATHLEN)) | 114 | strcat(tempname, template); |
325 | goto out; | ||
326 | |||
327 | if (template[0] != '/') | ||
328 | strcpy(tempname, tempdir); | ||
329 | else | ||
330 | tempname[0] = '\0'; | ||
331 | strncat(tempname, template, MAXPATHLEN-1-strlen(tempname)); | ||
332 | fd = mkstemp(tempname); | 115 | fd = mkstemp(tempname); |
333 | if (fd < 0) { | 116 | if (fd < 0) { |
334 | fprintf(stderr, "open - cannot create %s: %s\n", tempname, | 117 | fprintf(stderr, "open - cannot create %s: %s\n", tempname, |
335 | strerror(errno)); | 118 | strerror(errno)); |
336 | goto out; | 119 | goto out; |
337 | } | 120 | } |
338 | if (do_unlink && (unlink(tempname) < 0)) { | 121 | if (unlink(tempname) < 0) { |
339 | perror("unlink"); | 122 | perror("unlink"); |
340 | goto close; | 123 | goto close; |
341 | } | 124 | } |
342 | if (out_tempname) { | 125 | free(tempname); |
343 | *out_tempname = tempname; | ||
344 | } else | ||
345 | free(tempname); | ||
346 | return fd; | 126 | return fd; |
347 | close: | 127 | close: |
348 | close(fd); | 128 | close(fd); |
@@ -351,14 +131,14 @@ out: | |||
351 | return -1; | 131 | return -1; |
352 | } | 132 | } |
353 | 133 | ||
354 | #define TEMPNAME_TEMPLATE "vm_file-XXXXXX" | 134 | #define TEMPNAME_TEMPLATE "/vm_file-XXXXXX" |
355 | 135 | ||
356 | static int __init create_tmp_file(unsigned long long len) | 136 | static int __init create_tmp_file(unsigned long long len) |
357 | { | 137 | { |
358 | int fd, err; | 138 | int fd, err; |
359 | char zero; | 139 | char zero; |
360 | 140 | ||
361 | fd = make_tempfile(TEMPNAME_TEMPLATE, NULL, 1); | 141 | fd = make_tempfile(TEMPNAME_TEMPLATE); |
362 | if (fd < 0) | 142 | if (fd < 0) |
363 | exit(1); | 143 | exit(1); |
364 | 144 | ||
@@ -402,7 +182,6 @@ int __init create_mem_file(unsigned long long len) | |||
402 | return fd; | 182 | return fd; |
403 | } | 183 | } |
404 | 184 | ||
405 | |||
406 | void __init check_tmpexec(void) | 185 | void __init check_tmpexec(void) |
407 | { | 186 | { |
408 | void *addr; | 187 | void *addr; |
@@ -410,14 +189,13 @@ void __init check_tmpexec(void) | |||
410 | 189 | ||
411 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, | 190 | addr = mmap(NULL, UM_KERN_PAGE_SIZE, |
412 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); | 191 | PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0); |
413 | printf("Checking PROT_EXEC mmap in %s...",tempdir); | 192 | printf("Checking PROT_EXEC mmap in %s...", tempdir); |
414 | fflush(stdout); | ||
415 | if (addr == MAP_FAILED) { | 193 | if (addr == MAP_FAILED) { |
416 | err = errno; | 194 | err = errno; |
417 | perror("failed"); | 195 | printf("%s\n", strerror(err)); |
418 | close(fd); | 196 | close(fd); |
419 | if (err == EPERM) | 197 | if (err == EPERM) |
420 | printf("%s must be not mounted noexec\n",tempdir); | 198 | printf("%s must be not mounted noexec\n", tempdir); |
421 | exit(1); | 199 | exit(1); |
422 | } | 200 | } |
423 | printf("OK\n"); | 201 | printf("OK\n"); |
diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 602f57e590b5..33f71b01fd22 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile | |||
@@ -79,11 +79,14 @@ else | |||
79 | UTS_MACHINE := x86_64 | 79 | UTS_MACHINE := x86_64 |
80 | CHECKFLAGS += -D__x86_64__ -m64 | 80 | CHECKFLAGS += -D__x86_64__ -m64 |
81 | 81 | ||
82 | biarch := -m64 | ||
82 | KBUILD_AFLAGS += -m64 | 83 | KBUILD_AFLAGS += -m64 |
83 | KBUILD_CFLAGS += -m64 | 84 | KBUILD_CFLAGS += -m64 |
84 | 85 | ||
85 | # Don't autogenerate traditional x87, MMX or SSE instructions | 86 | # Don't autogenerate traditional x87, MMX or SSE instructions |
86 | KBUILD_CFLAGS += -mno-mmx -mno-sse -mno-80387 -mno-fp-ret-in-387 | 87 | KBUILD_CFLAGS += -mno-mmx -mno-sse |
88 | KBUILD_CFLAGS += $(call cc-option,-mno-80387) | ||
89 | KBUILD_CFLAGS += $(call cc-option,-mno-fp-ret-in-387) | ||
87 | 90 | ||
88 | # Use -mpreferred-stack-boundary=3 if supported. | 91 | # Use -mpreferred-stack-boundary=3 if supported. |
89 | KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) | 92 | KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) |
@@ -250,8 +253,8 @@ archclean: | |||
250 | PHONY += kvmconfig | 253 | PHONY += kvmconfig |
251 | kvmconfig: | 254 | kvmconfig: |
252 | $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target)) | 255 | $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target)) |
253 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config arch/x86/configs/kvm_guest.config | 256 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config |
254 | $(Q)yes "" | $(MAKE) oldconfig | 257 | $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig |
255 | 258 | ||
256 | define archhelp | 259 | define archhelp |
257 | echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' | 260 | echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)' |
diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile index abb9eba61b50..dbe8dd2fe247 100644 --- a/arch/x86/boot/Makefile +++ b/arch/x86/boot/Makefile | |||
@@ -71,7 +71,7 @@ $(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE | |||
71 | 71 | ||
72 | SETUP_OBJS = $(addprefix $(obj)/,$(setup-y)) | 72 | SETUP_OBJS = $(addprefix $(obj)/,$(setup-y)) |
73 | 73 | ||
74 | sed-voffset := -e 's/^\([0-9a-fA-F]*\) . \(_text\|_end\)$$/\#define VO_\2 0x\1/p' | 74 | sed-voffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(_text\|_end\)$$/\#define VO_\2 0x\1/p' |
75 | 75 | ||
76 | quiet_cmd_voffset = VOFFSET $@ | 76 | quiet_cmd_voffset = VOFFSET $@ |
77 | cmd_voffset = $(NM) $< | sed -n $(sed-voffset) > $@ | 77 | cmd_voffset = $(NM) $< | sed -n $(sed-voffset) > $@ |
@@ -80,7 +80,7 @@ targets += voffset.h | |||
80 | $(obj)/voffset.h: vmlinux FORCE | 80 | $(obj)/voffset.h: vmlinux FORCE |
81 | $(call if_changed,voffset) | 81 | $(call if_changed,voffset) |
82 | 82 | ||
83 | sed-zoffset := -e 's/^\([0-9a-fA-F]*\) . \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p' | 83 | sed-zoffset := -e 's/^\([0-9a-fA-F]*\) [ABCDGRSTVW] \(startup_32\|startup_64\|efi32_stub_entry\|efi64_stub_entry\|efi_pe_entry\|input_data\|_end\|z_.*\)$$/\#define ZO_\2 0x\1/p' |
84 | 84 | ||
85 | quiet_cmd_zoffset = ZOFFSET $@ | 85 | quiet_cmd_zoffset = ZOFFSET $@ |
86 | cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@ | 86 | cmd_zoffset = $(NM) $< | sed -n $(sed-zoffset) > $@ |
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index 17684615374b..57ab74df7eea 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c | |||
@@ -354,7 +354,7 @@ static void parse_elf(void *output) | |||
354 | free(phdrs); | 354 | free(phdrs); |
355 | } | 355 | } |
356 | 356 | ||
357 | asmlinkage void *decompress_kernel(void *rmode, memptr heap, | 357 | asmlinkage __visible void *decompress_kernel(void *rmode, memptr heap, |
358 | unsigned char *input_data, | 358 | unsigned char *input_data, |
359 | unsigned long input_len, | 359 | unsigned long input_len, |
360 | unsigned char *output, | 360 | unsigned char *output, |
diff --git a/arch/x86/include/asm/hpet.h b/arch/x86/include/asm/hpet.h index b18df579c0e9..36f7125945e3 100644 --- a/arch/x86/include/asm/hpet.h +++ b/arch/x86/include/asm/hpet.h | |||
@@ -63,6 +63,7 @@ | |||
63 | /* hpet memory map physical address */ | 63 | /* hpet memory map physical address */ |
64 | extern unsigned long hpet_address; | 64 | extern unsigned long hpet_address; |
65 | extern unsigned long force_hpet_address; | 65 | extern unsigned long force_hpet_address; |
66 | extern int boot_hpet_disable; | ||
66 | extern u8 hpet_blockid; | 67 | extern u8 hpet_blockid; |
67 | extern int hpet_force_user; | 68 | extern int hpet_force_user; |
68 | extern u8 hpet_msi_disable; | 69 | extern u8 hpet_msi_disable; |
diff --git a/arch/x86/include/asm/hugetlb.h b/arch/x86/include/asm/hugetlb.h index a8091216963b..68c05398bba9 100644 --- a/arch/x86/include/asm/hugetlb.h +++ b/arch/x86/include/asm/hugetlb.h | |||
@@ -52,6 +52,7 @@ static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm, | |||
52 | static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, | 52 | static inline void huge_ptep_clear_flush(struct vm_area_struct *vma, |
53 | unsigned long addr, pte_t *ptep) | 53 | unsigned long addr, pte_t *ptep) |
54 | { | 54 | { |
55 | ptep_clear_flush(vma, addr, ptep); | ||
55 | } | 56 | } |
56 | 57 | ||
57 | static inline int huge_pte_none(pte_t pte) | 58 | static inline int huge_pte_none(pte_t pte) |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index fcaf9c961265..7de069afb382 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -60,7 +60,7 @@ | |||
60 | | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE \ | 60 | | X86_CR4_PSE | X86_CR4_PAE | X86_CR4_MCE \ |
61 | | X86_CR4_PGE | X86_CR4_PCE | X86_CR4_OSFXSR | X86_CR4_PCIDE \ | 61 | | X86_CR4_PGE | X86_CR4_PCE | X86_CR4_OSFXSR | X86_CR4_PCIDE \ |
62 | | X86_CR4_OSXSAVE | X86_CR4_SMEP | X86_CR4_FSGSBASE \ | 62 | | X86_CR4_OSXSAVE | X86_CR4_SMEP | X86_CR4_FSGSBASE \ |
63 | | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE)) | 63 | | X86_CR4_OSXMMEXCPT | X86_CR4_VMXE | X86_CR4_SMAP)) |
64 | 64 | ||
65 | #define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR) | 65 | #define CR8_RESERVED_BITS (~(unsigned long)X86_CR8_TPR) |
66 | 66 | ||
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h index 8de6d9cf3b95..678205195ae1 100644 --- a/arch/x86/include/asm/page_64_types.h +++ b/arch/x86/include/asm/page_64_types.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _ASM_X86_PAGE_64_DEFS_H | 1 | #ifndef _ASM_X86_PAGE_64_DEFS_H |
2 | #define _ASM_X86_PAGE_64_DEFS_H | 2 | #define _ASM_X86_PAGE_64_DEFS_H |
3 | 3 | ||
4 | #define THREAD_SIZE_ORDER 1 | 4 | #define THREAD_SIZE_ORDER 2 |
5 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) | 5 | #define THREAD_SIZE (PAGE_SIZE << THREAD_SIZE_ORDER) |
6 | #define CURRENT_MASK (~(THREAD_SIZE - 1)) | 6 | #define CURRENT_MASK (~(THREAD_SIZE - 1)) |
7 | 7 | ||
diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h index c827ace3121b..fcf2b3ae1bf0 100644 --- a/arch/x86/include/uapi/asm/msr-index.h +++ b/arch/x86/include/uapi/asm/msr-index.h | |||
@@ -384,7 +384,7 @@ | |||
384 | #define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18 | 384 | #define MSR_IA32_MISC_ENABLE_MWAIT_BIT 18 |
385 | #define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT) | 385 | #define MSR_IA32_MISC_ENABLE_MWAIT (1ULL << MSR_IA32_MISC_ENABLE_MWAIT_BIT) |
386 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22 | 386 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT 22 |
387 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT); | 387 | #define MSR_IA32_MISC_ENABLE_LIMIT_CPUID (1ULL << MSR_IA32_MISC_ENABLE_LIMIT_CPUID_BIT) |
388 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT 23 | 388 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT 23 |
389 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT) | 389 | #define MSR_IA32_MISC_ENABLE_XTPR_DISABLE (1ULL << MSR_IA32_MISC_ENABLE_XTPR_DISABLE_BIT) |
390 | #define MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT 34 | 390 | #define MSR_IA32_MISC_ENABLE_XD_DISABLE_BIT 34 |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 3a2ae4c88948..31368207837c 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
@@ -31,7 +31,7 @@ static char temp_stack[4096]; | |||
31 | * | 31 | * |
32 | * Wrapper around acpi_enter_sleep_state() to be called by assmebly. | 32 | * Wrapper around acpi_enter_sleep_state() to be called by assmebly. |
33 | */ | 33 | */ |
34 | acpi_status asmlinkage x86_acpi_enter_sleep_state(u8 state) | 34 | acpi_status asmlinkage __visible x86_acpi_enter_sleep_state(u8 state) |
35 | { | 35 | { |
36 | return acpi_enter_sleep_state(state); | 36 | return acpi_enter_sleep_state(state); |
37 | } | 37 | } |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 6ad4658de705..992060e09897 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2189,7 +2189,7 @@ void send_cleanup_vector(struct irq_cfg *cfg) | |||
2189 | cfg->move_in_progress = 0; | 2189 | cfg->move_in_progress = 0; |
2190 | } | 2190 | } |
2191 | 2191 | ||
2192 | asmlinkage void smp_irq_move_cleanup_interrupt(void) | 2192 | asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) |
2193 | { | 2193 | { |
2194 | unsigned vector, me; | 2194 | unsigned vector, me; |
2195 | 2195 | ||
@@ -3425,6 +3425,11 @@ int get_nr_irqs_gsi(void) | |||
3425 | return nr_irqs_gsi; | 3425 | return nr_irqs_gsi; |
3426 | } | 3426 | } |
3427 | 3427 | ||
3428 | unsigned int arch_dynirq_lower_bound(unsigned int from) | ||
3429 | { | ||
3430 | return from < nr_irqs_gsi ? nr_irqs_gsi : from; | ||
3431 | } | ||
3432 | |||
3428 | int __init arch_probe_nr_irqs(void) | 3433 | int __init arch_probe_nr_irqs(void) |
3429 | { | 3434 | { |
3430 | int nr; | 3435 | int nr; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index eeee23ff75ef..68317c80de7f 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -598,7 +598,6 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) | |||
598 | { | 598 | { |
599 | struct mce m; | 599 | struct mce m; |
600 | int i; | 600 | int i; |
601 | unsigned long *v; | ||
602 | 601 | ||
603 | this_cpu_inc(mce_poll_count); | 602 | this_cpu_inc(mce_poll_count); |
604 | 603 | ||
@@ -618,8 +617,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) | |||
618 | if (!(m.status & MCI_STATUS_VAL)) | 617 | if (!(m.status & MCI_STATUS_VAL)) |
619 | continue; | 618 | continue; |
620 | 619 | ||
621 | v = &get_cpu_var(mce_polled_error); | 620 | this_cpu_write(mce_polled_error, 1); |
622 | set_bit(0, v); | ||
623 | /* | 621 | /* |
624 | * Uncorrected or signalled events are handled by the exception | 622 | * Uncorrected or signalled events are handled by the exception |
625 | * handler when it is enabled, so don't process those here. | 623 | * handler when it is enabled, so don't process those here. |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_intel.c b/arch/x86/kernel/cpu/mcheck/mce_intel.c index 3bdb95ae8c43..9a316b21df8b 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_intel.c +++ b/arch/x86/kernel/cpu/mcheck/mce_intel.c | |||
@@ -42,7 +42,7 @@ static DEFINE_PER_CPU(mce_banks_t, mce_banks_owned); | |||
42 | * cmci_discover_lock protects against parallel discovery attempts | 42 | * cmci_discover_lock protects against parallel discovery attempts |
43 | * which could race against each other. | 43 | * which could race against each other. |
44 | */ | 44 | */ |
45 | static DEFINE_RAW_SPINLOCK(cmci_discover_lock); | 45 | static DEFINE_SPINLOCK(cmci_discover_lock); |
46 | 46 | ||
47 | #define CMCI_THRESHOLD 1 | 47 | #define CMCI_THRESHOLD 1 |
48 | #define CMCI_POLL_INTERVAL (30 * HZ) | 48 | #define CMCI_POLL_INTERVAL (30 * HZ) |
@@ -144,14 +144,14 @@ static void cmci_storm_disable_banks(void) | |||
144 | int bank; | 144 | int bank; |
145 | u64 val; | 145 | u64 val; |
146 | 146 | ||
147 | raw_spin_lock_irqsave(&cmci_discover_lock, flags); | 147 | spin_lock_irqsave(&cmci_discover_lock, flags); |
148 | owned = __get_cpu_var(mce_banks_owned); | 148 | owned = __get_cpu_var(mce_banks_owned); |
149 | for_each_set_bit(bank, owned, MAX_NR_BANKS) { | 149 | for_each_set_bit(bank, owned, MAX_NR_BANKS) { |
150 | rdmsrl(MSR_IA32_MCx_CTL2(bank), val); | 150 | rdmsrl(MSR_IA32_MCx_CTL2(bank), val); |
151 | val &= ~MCI_CTL2_CMCI_EN; | 151 | val &= ~MCI_CTL2_CMCI_EN; |
152 | wrmsrl(MSR_IA32_MCx_CTL2(bank), val); | 152 | wrmsrl(MSR_IA32_MCx_CTL2(bank), val); |
153 | } | 153 | } |
154 | raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); | 154 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
155 | } | 155 | } |
156 | 156 | ||
157 | static bool cmci_storm_detect(void) | 157 | static bool cmci_storm_detect(void) |
@@ -211,7 +211,7 @@ static void cmci_discover(int banks) | |||
211 | int i; | 211 | int i; |
212 | int bios_wrong_thresh = 0; | 212 | int bios_wrong_thresh = 0; |
213 | 213 | ||
214 | raw_spin_lock_irqsave(&cmci_discover_lock, flags); | 214 | spin_lock_irqsave(&cmci_discover_lock, flags); |
215 | for (i = 0; i < banks; i++) { | 215 | for (i = 0; i < banks; i++) { |
216 | u64 val; | 216 | u64 val; |
217 | int bios_zero_thresh = 0; | 217 | int bios_zero_thresh = 0; |
@@ -266,7 +266,7 @@ static void cmci_discover(int banks) | |||
266 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); | 266 | WARN_ON(!test_bit(i, __get_cpu_var(mce_poll_banks))); |
267 | } | 267 | } |
268 | } | 268 | } |
269 | raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); | 269 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
270 | if (mca_cfg.bios_cmci_threshold && bios_wrong_thresh) { | 270 | if (mca_cfg.bios_cmci_threshold && bios_wrong_thresh) { |
271 | pr_info_once( | 271 | pr_info_once( |
272 | "bios_cmci_threshold: Some banks do not have valid thresholds set\n"); | 272 | "bios_cmci_threshold: Some banks do not have valid thresholds set\n"); |
@@ -316,10 +316,10 @@ void cmci_clear(void) | |||
316 | 316 | ||
317 | if (!cmci_supported(&banks)) | 317 | if (!cmci_supported(&banks)) |
318 | return; | 318 | return; |
319 | raw_spin_lock_irqsave(&cmci_discover_lock, flags); | 319 | spin_lock_irqsave(&cmci_discover_lock, flags); |
320 | for (i = 0; i < banks; i++) | 320 | for (i = 0; i < banks; i++) |
321 | __cmci_disable_bank(i); | 321 | __cmci_disable_bank(i); |
322 | raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); | 322 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
323 | } | 323 | } |
324 | 324 | ||
325 | static void cmci_rediscover_work_func(void *arg) | 325 | static void cmci_rediscover_work_func(void *arg) |
@@ -360,9 +360,9 @@ void cmci_disable_bank(int bank) | |||
360 | if (!cmci_supported(&banks)) | 360 | if (!cmci_supported(&banks)) |
361 | return; | 361 | return; |
362 | 362 | ||
363 | raw_spin_lock_irqsave(&cmci_discover_lock, flags); | 363 | spin_lock_irqsave(&cmci_discover_lock, flags); |
364 | __cmci_disable_bank(bank); | 364 | __cmci_disable_bank(bank); |
365 | raw_spin_unlock_irqrestore(&cmci_discover_lock, flags); | 365 | spin_unlock_irqrestore(&cmci_discover_lock, flags); |
366 | } | 366 | } |
367 | 367 | ||
368 | static void intel_init_cmci(void) | 368 | static void intel_init_cmci(void) |
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index d921b7ee6595..36a1bb6d1ee0 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -429,14 +429,14 @@ static inline void __smp_thermal_interrupt(void) | |||
429 | smp_thermal_vector(); | 429 | smp_thermal_vector(); |
430 | } | 430 | } |
431 | 431 | ||
432 | asmlinkage void smp_thermal_interrupt(struct pt_regs *regs) | 432 | asmlinkage __visible void smp_thermal_interrupt(struct pt_regs *regs) |
433 | { | 433 | { |
434 | entering_irq(); | 434 | entering_irq(); |
435 | __smp_thermal_interrupt(); | 435 | __smp_thermal_interrupt(); |
436 | exiting_ack_irq(); | 436 | exiting_ack_irq(); |
437 | } | 437 | } |
438 | 438 | ||
439 | asmlinkage void smp_trace_thermal_interrupt(struct pt_regs *regs) | 439 | asmlinkage __visible void smp_trace_thermal_interrupt(struct pt_regs *regs) |
440 | { | 440 | { |
441 | entering_irq(); | 441 | entering_irq(); |
442 | trace_thermal_apic_entry(THERMAL_APIC_VECTOR); | 442 | trace_thermal_apic_entry(THERMAL_APIC_VECTOR); |
diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c index fe6b1c86645b..7245980186ee 100644 --- a/arch/x86/kernel/cpu/mcheck/threshold.c +++ b/arch/x86/kernel/cpu/mcheck/threshold.c | |||
@@ -24,14 +24,14 @@ static inline void __smp_threshold_interrupt(void) | |||
24 | mce_threshold_vector(); | 24 | mce_threshold_vector(); |
25 | } | 25 | } |
26 | 26 | ||
27 | asmlinkage void smp_threshold_interrupt(void) | 27 | asmlinkage __visible void smp_threshold_interrupt(void) |
28 | { | 28 | { |
29 | entering_irq(); | 29 | entering_irq(); |
30 | __smp_threshold_interrupt(); | 30 | __smp_threshold_interrupt(); |
31 | exiting_ack_irq(); | 31 | exiting_ack_irq(); |
32 | } | 32 | } |
33 | 33 | ||
34 | asmlinkage void smp_trace_threshold_interrupt(void) | 34 | asmlinkage __visible void smp_trace_threshold_interrupt(void) |
35 | { | 35 | { |
36 | entering_irq(); | 36 | entering_irq(); |
37 | trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); | 37 | trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); |
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index aa333d966886..adb02aa62af5 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -169,7 +169,6 @@ static struct event_constraint intel_slm_event_constraints[] __read_mostly = | |||
169 | { | 169 | { |
170 | FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ | 170 | FIXED_EVENT_CONSTRAINT(0x00c0, 0), /* INST_RETIRED.ANY */ |
171 | FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ | 171 | FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */ |
172 | FIXED_EVENT_CONSTRAINT(0x013c, 2), /* CPU_CLK_UNHALTED.REF */ | ||
173 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* pseudo CPU_CLK_UNHALTED.REF */ | 172 | FIXED_EVENT_CONSTRAINT(0x0300, 2), /* pseudo CPU_CLK_UNHALTED.REF */ |
174 | EVENT_CONSTRAINT_END | 173 | EVENT_CONSTRAINT_END |
175 | }; | 174 | }; |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_rapl.c b/arch/x86/kernel/cpu/perf_event_intel_rapl.c index 059218ed5208..619f7699487a 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_rapl.c +++ b/arch/x86/kernel/cpu/perf_event_intel_rapl.c | |||
@@ -59,7 +59,7 @@ | |||
59 | #define INTEL_RAPL_PKG 0x2 /* pseudo-encoding */ | 59 | #define INTEL_RAPL_PKG 0x2 /* pseudo-encoding */ |
60 | #define RAPL_IDX_RAM_NRG_STAT 2 /* DRAM */ | 60 | #define RAPL_IDX_RAM_NRG_STAT 2 /* DRAM */ |
61 | #define INTEL_RAPL_RAM 0x3 /* pseudo-encoding */ | 61 | #define INTEL_RAPL_RAM 0x3 /* pseudo-encoding */ |
62 | #define RAPL_IDX_PP1_NRG_STAT 3 /* DRAM */ | 62 | #define RAPL_IDX_PP1_NRG_STAT 3 /* gpu */ |
63 | #define INTEL_RAPL_PP1 0x4 /* pseudo-encoding */ | 63 | #define INTEL_RAPL_PP1 0x4 /* pseudo-encoding */ |
64 | 64 | ||
65 | /* Clients have PP0, PKG */ | 65 | /* Clients have PP0, PKG */ |
@@ -72,6 +72,12 @@ | |||
72 | 1<<RAPL_IDX_PKG_NRG_STAT|\ | 72 | 1<<RAPL_IDX_PKG_NRG_STAT|\ |
73 | 1<<RAPL_IDX_RAM_NRG_STAT) | 73 | 1<<RAPL_IDX_RAM_NRG_STAT) |
74 | 74 | ||
75 | /* Servers have PP0, PKG, RAM, PP1 */ | ||
76 | #define RAPL_IDX_HSW (1<<RAPL_IDX_PP0_NRG_STAT|\ | ||
77 | 1<<RAPL_IDX_PKG_NRG_STAT|\ | ||
78 | 1<<RAPL_IDX_RAM_NRG_STAT|\ | ||
79 | 1<<RAPL_IDX_PP1_NRG_STAT) | ||
80 | |||
75 | /* | 81 | /* |
76 | * event code: LSB 8 bits, passed in attr->config | 82 | * event code: LSB 8 bits, passed in attr->config |
77 | * any other bit is reserved | 83 | * any other bit is reserved |
@@ -425,6 +431,24 @@ static struct attribute *rapl_events_cln_attr[] = { | |||
425 | NULL, | 431 | NULL, |
426 | }; | 432 | }; |
427 | 433 | ||
434 | static struct attribute *rapl_events_hsw_attr[] = { | ||
435 | EVENT_PTR(rapl_cores), | ||
436 | EVENT_PTR(rapl_pkg), | ||
437 | EVENT_PTR(rapl_gpu), | ||
438 | EVENT_PTR(rapl_ram), | ||
439 | |||
440 | EVENT_PTR(rapl_cores_unit), | ||
441 | EVENT_PTR(rapl_pkg_unit), | ||
442 | EVENT_PTR(rapl_gpu_unit), | ||
443 | EVENT_PTR(rapl_ram_unit), | ||
444 | |||
445 | EVENT_PTR(rapl_cores_scale), | ||
446 | EVENT_PTR(rapl_pkg_scale), | ||
447 | EVENT_PTR(rapl_gpu_scale), | ||
448 | EVENT_PTR(rapl_ram_scale), | ||
449 | NULL, | ||
450 | }; | ||
451 | |||
428 | static struct attribute_group rapl_pmu_events_group = { | 452 | static struct attribute_group rapl_pmu_events_group = { |
429 | .name = "events", | 453 | .name = "events", |
430 | .attrs = NULL, /* patched at runtime */ | 454 | .attrs = NULL, /* patched at runtime */ |
@@ -511,6 +535,7 @@ static int rapl_cpu_prepare(int cpu) | |||
511 | struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); | 535 | struct rapl_pmu *pmu = per_cpu(rapl_pmu, cpu); |
512 | int phys_id = topology_physical_package_id(cpu); | 536 | int phys_id = topology_physical_package_id(cpu); |
513 | u64 ms; | 537 | u64 ms; |
538 | u64 msr_rapl_power_unit_bits; | ||
514 | 539 | ||
515 | if (pmu) | 540 | if (pmu) |
516 | return 0; | 541 | return 0; |
@@ -518,6 +543,10 @@ static int rapl_cpu_prepare(int cpu) | |||
518 | if (phys_id < 0) | 543 | if (phys_id < 0) |
519 | return -1; | 544 | return -1; |
520 | 545 | ||
546 | /* protect rdmsrl() to handle virtualization */ | ||
547 | if (rdmsrl_safe(MSR_RAPL_POWER_UNIT, &msr_rapl_power_unit_bits)) | ||
548 | return -1; | ||
549 | |||
521 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); | 550 | pmu = kzalloc_node(sizeof(*pmu), GFP_KERNEL, cpu_to_node(cpu)); |
522 | if (!pmu) | 551 | if (!pmu) |
523 | return -1; | 552 | return -1; |
@@ -531,8 +560,7 @@ static int rapl_cpu_prepare(int cpu) | |||
531 | * | 560 | * |
532 | * we cache in local PMU instance | 561 | * we cache in local PMU instance |
533 | */ | 562 | */ |
534 | rdmsrl(MSR_RAPL_POWER_UNIT, pmu->hw_unit); | 563 | pmu->hw_unit = (msr_rapl_power_unit_bits >> 8) & 0x1FULL; |
535 | pmu->hw_unit = (pmu->hw_unit >> 8) & 0x1FULL; | ||
536 | pmu->pmu = &rapl_pmu_class; | 564 | pmu->pmu = &rapl_pmu_class; |
537 | 565 | ||
538 | /* | 566 | /* |
@@ -631,11 +659,14 @@ static int __init rapl_pmu_init(void) | |||
631 | switch (boot_cpu_data.x86_model) { | 659 | switch (boot_cpu_data.x86_model) { |
632 | case 42: /* Sandy Bridge */ | 660 | case 42: /* Sandy Bridge */ |
633 | case 58: /* Ivy Bridge */ | 661 | case 58: /* Ivy Bridge */ |
634 | case 60: /* Haswell */ | ||
635 | case 69: /* Haswell-Celeron */ | ||
636 | rapl_cntr_mask = RAPL_IDX_CLN; | 662 | rapl_cntr_mask = RAPL_IDX_CLN; |
637 | rapl_pmu_events_group.attrs = rapl_events_cln_attr; | 663 | rapl_pmu_events_group.attrs = rapl_events_cln_attr; |
638 | break; | 664 | break; |
665 | case 60: /* Haswell */ | ||
666 | case 69: /* Haswell-Celeron */ | ||
667 | rapl_cntr_mask = RAPL_IDX_HSW; | ||
668 | rapl_pmu_events_group.attrs = rapl_events_hsw_attr; | ||
669 | break; | ||
639 | case 45: /* Sandy Bridge-EP */ | 670 | case 45: /* Sandy Bridge-EP */ |
640 | case 62: /* IvyTown */ | 671 | case 62: /* IvyTown */ |
641 | rapl_cntr_mask = RAPL_IDX_SRV; | 672 | rapl_cntr_mask = RAPL_IDX_SRV; |
@@ -650,7 +681,9 @@ static int __init rapl_pmu_init(void) | |||
650 | cpu_notifier_register_begin(); | 681 | cpu_notifier_register_begin(); |
651 | 682 | ||
652 | for_each_online_cpu(cpu) { | 683 | for_each_online_cpu(cpu) { |
653 | rapl_cpu_prepare(cpu); | 684 | ret = rapl_cpu_prepare(cpu); |
685 | if (ret) | ||
686 | goto out; | ||
654 | rapl_cpu_init(cpu); | 687 | rapl_cpu_init(cpu); |
655 | } | 688 | } |
656 | 689 | ||
@@ -673,6 +706,7 @@ static int __init rapl_pmu_init(void) | |||
673 | hweight32(rapl_cntr_mask), | 706 | hweight32(rapl_cntr_mask), |
674 | ktime_to_ms(pmu->timer_interval)); | 707 | ktime_to_ms(pmu->timer_interval)); |
675 | 708 | ||
709 | out: | ||
676 | cpu_notifier_register_done(); | 710 | cpu_notifier_register_done(); |
677 | 711 | ||
678 | return 0; | 712 | return 0; |
diff --git a/arch/x86/kernel/cpu/rdrand.c b/arch/x86/kernel/cpu/rdrand.c index 384df5105fbc..136ac74dee82 100644 --- a/arch/x86/kernel/cpu/rdrand.c +++ b/arch/x86/kernel/cpu/rdrand.c | |||
@@ -27,6 +27,7 @@ | |||
27 | static int __init x86_rdrand_setup(char *s) | 27 | static int __init x86_rdrand_setup(char *s) |
28 | { | 28 | { |
29 | setup_clear_cpu_cap(X86_FEATURE_RDRAND); | 29 | setup_clear_cpu_cap(X86_FEATURE_RDRAND); |
30 | setup_clear_cpu_cap(X86_FEATURE_RDSEED); | ||
30 | return 1; | 31 | return 1; |
31 | } | 32 | } |
32 | __setup("nordrand", x86_rdrand_setup); | 33 | __setup("nordrand", x86_rdrand_setup); |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index b0cc3809723d..6cda0baeac9d 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/dma.h> | 17 | #include <asm/dma.h> |
18 | #include <asm/io_apic.h> | 18 | #include <asm/io_apic.h> |
19 | #include <asm/apic.h> | 19 | #include <asm/apic.h> |
20 | #include <asm/hpet.h> | ||
20 | #include <asm/iommu.h> | 21 | #include <asm/iommu.h> |
21 | #include <asm/gart.h> | 22 | #include <asm/gart.h> |
22 | #include <asm/irq_remapping.h> | 23 | #include <asm/irq_remapping.h> |
@@ -240,7 +241,7 @@ static u32 __init intel_stolen_base(int num, int slot, int func, size_t stolen_s | |||
240 | return base; | 241 | return base; |
241 | } | 242 | } |
242 | 243 | ||
243 | #define KB(x) ((x) * 1024) | 244 | #define KB(x) ((x) * 1024UL) |
244 | #define MB(x) (KB (KB (x))) | 245 | #define MB(x) (KB (KB (x))) |
245 | #define GB(x) (MB (KB (x))) | 246 | #define GB(x) (MB (KB (x))) |
246 | 247 | ||
@@ -530,6 +531,15 @@ static void __init intel_graphics_stolen(int num, int slot, int func) | |||
530 | } | 531 | } |
531 | } | 532 | } |
532 | 533 | ||
534 | static void __init force_disable_hpet(int num, int slot, int func) | ||
535 | { | ||
536 | #ifdef CONFIG_HPET_TIMER | ||
537 | boot_hpet_disable = 1; | ||
538 | pr_info("x86/hpet: Will disable the HPET for this platform because it's not reliable\n"); | ||
539 | #endif | ||
540 | } | ||
541 | |||
542 | |||
533 | #define QFLAG_APPLY_ONCE 0x1 | 543 | #define QFLAG_APPLY_ONCE 0x1 |
534 | #define QFLAG_APPLIED 0x2 | 544 | #define QFLAG_APPLIED 0x2 |
535 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) | 545 | #define QFLAG_DONE (QFLAG_APPLY_ONCE|QFLAG_APPLIED) |
@@ -567,6 +577,12 @@ static struct chipset early_qrk[] __initdata = { | |||
567 | PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check }, | 577 | PCI_BASE_CLASS_BRIDGE, 0, intel_remapping_check }, |
568 | { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID, | 578 | { PCI_VENDOR_ID_INTEL, PCI_ANY_ID, PCI_CLASS_DISPLAY_VGA, PCI_ANY_ID, |
569 | QFLAG_APPLY_ONCE, intel_graphics_stolen }, | 579 | QFLAG_APPLY_ONCE, intel_graphics_stolen }, |
580 | /* | ||
581 | * HPET on current version of Baytrail platform has accuracy | ||
582 | * problems, disable it for now: | ||
583 | */ | ||
584 | { PCI_VENDOR_ID_INTEL, 0x0f00, | ||
585 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, force_disable_hpet}, | ||
570 | {} | 586 | {} |
571 | }; | 587 | }; |
572 | 588 | ||
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index c61a14a4a310..d6c1b9836995 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
@@ -29,7 +29,7 @@ static void __init i386_default_early_setup(void) | |||
29 | reserve_ebda_region(); | 29 | reserve_ebda_region(); |
30 | } | 30 | } |
31 | 31 | ||
32 | asmlinkage void __init i386_start_kernel(void) | 32 | asmlinkage __visible void __init i386_start_kernel(void) |
33 | { | 33 | { |
34 | sanitize_boot_params(&boot_params); | 34 | sanitize_boot_params(&boot_params); |
35 | 35 | ||
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 85126ccbdf6b..068054f4bf20 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -137,7 +137,7 @@ static void __init copy_bootdata(char *real_mode_data) | |||
137 | } | 137 | } |
138 | } | 138 | } |
139 | 139 | ||
140 | asmlinkage void __init x86_64_start_kernel(char * real_mode_data) | 140 | asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data) |
141 | { | 141 | { |
142 | int i; | 142 | int i; |
143 | 143 | ||
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 8d80ae011603..4177bfbc80b0 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -88,7 +88,7 @@ static inline void hpet_clear_mapping(void) | |||
88 | /* | 88 | /* |
89 | * HPET command line enable / disable | 89 | * HPET command line enable / disable |
90 | */ | 90 | */ |
91 | static int boot_hpet_disable; | 91 | int boot_hpet_disable; |
92 | int hpet_force_user; | 92 | int hpet_force_user; |
93 | static int hpet_verbose; | 93 | static int hpet_verbose; |
94 | 94 | ||
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 79a3f9682871..61b17dc2c277 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c | |||
@@ -897,9 +897,10 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
897 | struct kprobe *cur = kprobe_running(); | 897 | struct kprobe *cur = kprobe_running(); |
898 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); | 898 | struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); |
899 | 899 | ||
900 | switch (kcb->kprobe_status) { | 900 | if (unlikely(regs->ip == (unsigned long)cur->ainsn.insn)) { |
901 | case KPROBE_HIT_SS: | 901 | /* This must happen on single-stepping */ |
902 | case KPROBE_REENTER: | 902 | WARN_ON(kcb->kprobe_status != KPROBE_HIT_SS && |
903 | kcb->kprobe_status != KPROBE_REENTER); | ||
903 | /* | 904 | /* |
904 | * We are here because the instruction being single | 905 | * We are here because the instruction being single |
905 | * stepped caused a page fault. We reset the current | 906 | * stepped caused a page fault. We reset the current |
@@ -914,9 +915,8 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
914 | else | 915 | else |
915 | reset_current_kprobe(); | 916 | reset_current_kprobe(); |
916 | preempt_enable_no_resched(); | 917 | preempt_enable_no_resched(); |
917 | break; | 918 | } else if (kcb->kprobe_status == KPROBE_HIT_ACTIVE || |
918 | case KPROBE_HIT_ACTIVE: | 919 | kcb->kprobe_status == KPROBE_HIT_SSDONE) { |
919 | case KPROBE_HIT_SSDONE: | ||
920 | /* | 920 | /* |
921 | * We increment the nmissed count for accounting, | 921 | * We increment the nmissed count for accounting, |
922 | * we can also use npre/npostfault count for accounting | 922 | * we can also use npre/npostfault count for accounting |
@@ -945,10 +945,8 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, int trapnr) | |||
945 | * fixup routine could not handle it, | 945 | * fixup routine could not handle it, |
946 | * Let do_page_fault() fix it. | 946 | * Let do_page_fault() fix it. |
947 | */ | 947 | */ |
948 | break; | ||
949 | default: | ||
950 | break; | ||
951 | } | 948 | } |
949 | |||
952 | return 0; | 950 | return 0; |
953 | } | 951 | } |
954 | 952 | ||
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index af1d14a9ebda..dcbbaa165bde 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <asm/mmu_context.h> | 20 | #include <asm/mmu_context.h> |
21 | #include <asm/syscalls.h> | 21 | #include <asm/syscalls.h> |
22 | 22 | ||
23 | int sysctl_ldt16 = 0; | ||
24 | |||
23 | #ifdef CONFIG_SMP | 25 | #ifdef CONFIG_SMP |
24 | static void flush_ldt(void *current_mm) | 26 | static void flush_ldt(void *current_mm) |
25 | { | 27 | { |
@@ -234,7 +236,7 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) | |||
234 | * IRET leaking the high bits of the kernel stack address. | 236 | * IRET leaking the high bits of the kernel stack address. |
235 | */ | 237 | */ |
236 | #ifdef CONFIG_X86_64 | 238 | #ifdef CONFIG_X86_64 |
237 | if (!ldt_info.seg_32bit) { | 239 | if (!ldt_info.seg_32bit && !sysctl_ldt16) { |
238 | error = -EINVAL; | 240 | error = -EINVAL; |
239 | goto out_unlock; | 241 | goto out_unlock; |
240 | } | 242 | } |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 9c0280f93d05..898d077617a9 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -52,7 +52,7 @@ | |||
52 | 52 | ||
53 | asmlinkage extern void ret_from_fork(void); | 53 | asmlinkage extern void ret_from_fork(void); |
54 | 54 | ||
55 | asmlinkage DEFINE_PER_CPU(unsigned long, old_rsp); | 55 | __visible DEFINE_PER_CPU(unsigned long, old_rsp); |
56 | 56 | ||
57 | /* Prints also some state that isn't saved in the pt_regs */ | 57 | /* Prints also some state that isn't saved in the pt_regs */ |
58 | void __show_regs(struct pt_regs *regs, int all) | 58 | void __show_regs(struct pt_regs *regs, int all) |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 654b46574b91..52b1157c53eb 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
@@ -114,8 +114,8 @@ EXPORT_SYMBOL(machine_real_restart); | |||
114 | */ | 114 | */ |
115 | static int __init set_pci_reboot(const struct dmi_system_id *d) | 115 | static int __init set_pci_reboot(const struct dmi_system_id *d) |
116 | { | 116 | { |
117 | if (reboot_type != BOOT_CF9) { | 117 | if (reboot_type != BOOT_CF9_FORCE) { |
118 | reboot_type = BOOT_CF9; | 118 | reboot_type = BOOT_CF9_FORCE; |
119 | pr_info("%s series board detected. Selecting %s-method for reboots.\n", | 119 | pr_info("%s series board detected. Selecting %s-method for reboots.\n", |
120 | d->ident, "PCI"); | 120 | d->ident, "PCI"); |
121 | } | 121 | } |
@@ -191,6 +191,16 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
191 | }, | 191 | }, |
192 | }, | 192 | }, |
193 | 193 | ||
194 | /* Certec */ | ||
195 | { /* Handle problems with rebooting on Certec BPC600 */ | ||
196 | .callback = set_pci_reboot, | ||
197 | .ident = "Certec BPC600", | ||
198 | .matches = { | ||
199 | DMI_MATCH(DMI_SYS_VENDOR, "Certec"), | ||
200 | DMI_MATCH(DMI_PRODUCT_NAME, "BPC600"), | ||
201 | }, | ||
202 | }, | ||
203 | |||
194 | /* Dell */ | 204 | /* Dell */ |
195 | { /* Handle problems with rebooting on Dell DXP061 */ | 205 | { /* Handle problems with rebooting on Dell DXP061 */ |
196 | .callback = set_bios_reboot, | 206 | .callback = set_bios_reboot, |
@@ -458,20 +468,23 @@ void __attribute__((weak)) mach_reboot_fixups(void) | |||
458 | } | 468 | } |
459 | 469 | ||
460 | /* | 470 | /* |
461 | * Windows compatible x86 hardware expects the following on reboot: | 471 | * To the best of our knowledge Windows compatible x86 hardware expects |
472 | * the following on reboot: | ||
462 | * | 473 | * |
463 | * 1) If the FADT has the ACPI reboot register flag set, try it | 474 | * 1) If the FADT has the ACPI reboot register flag set, try it |
464 | * 2) If still alive, write to the keyboard controller | 475 | * 2) If still alive, write to the keyboard controller |
465 | * 3) If still alive, write to the ACPI reboot register again | 476 | * 3) If still alive, write to the ACPI reboot register again |
466 | * 4) If still alive, write to the keyboard controller again | 477 | * 4) If still alive, write to the keyboard controller again |
467 | * 5) If still alive, call the EFI runtime service to reboot | 478 | * 5) If still alive, call the EFI runtime service to reboot |
468 | * 6) If still alive, write to the PCI IO port 0xCF9 to reboot | 479 | * 6) If no EFI runtime service, call the BIOS to do a reboot |
469 | * 7) If still alive, inform BIOS to do a proper reboot | 480 | * |
481 | * We default to following the same pattern. We also have | ||
482 | * two other reboot methods: 'triple fault' and 'PCI', which | ||
483 | * can be triggered via the reboot= kernel boot option or | ||
484 | * via quirks. | ||
470 | * | 485 | * |
471 | * If the machine is still alive at this stage, it gives up. We default to | 486 | * This means that this function can never return, it can misbehave |
472 | * following the same pattern, except that if we're still alive after (7) we'll | 487 | * by not rebooting properly and hanging. |
473 | * try to force a triple fault and then cycle between hitting the keyboard | ||
474 | * controller and doing that | ||
475 | */ | 488 | */ |
476 | static void native_machine_emergency_restart(void) | 489 | static void native_machine_emergency_restart(void) |
477 | { | 490 | { |
@@ -492,6 +505,11 @@ static void native_machine_emergency_restart(void) | |||
492 | for (;;) { | 505 | for (;;) { |
493 | /* Could also try the reset bit in the Hammer NB */ | 506 | /* Could also try the reset bit in the Hammer NB */ |
494 | switch (reboot_type) { | 507 | switch (reboot_type) { |
508 | case BOOT_ACPI: | ||
509 | acpi_reboot(); | ||
510 | reboot_type = BOOT_KBD; | ||
511 | break; | ||
512 | |||
495 | case BOOT_KBD: | 513 | case BOOT_KBD: |
496 | mach_reboot_fixups(); /* For board specific fixups */ | 514 | mach_reboot_fixups(); /* For board specific fixups */ |
497 | 515 | ||
@@ -509,43 +527,29 @@ static void native_machine_emergency_restart(void) | |||
509 | } | 527 | } |
510 | break; | 528 | break; |
511 | 529 | ||
512 | case BOOT_TRIPLE: | ||
513 | load_idt(&no_idt); | ||
514 | __asm__ __volatile__("int3"); | ||
515 | |||
516 | /* We're probably dead after this, but... */ | ||
517 | reboot_type = BOOT_KBD; | ||
518 | break; | ||
519 | |||
520 | case BOOT_BIOS: | ||
521 | machine_real_restart(MRR_BIOS); | ||
522 | |||
523 | /* We're probably dead after this, but... */ | ||
524 | reboot_type = BOOT_TRIPLE; | ||
525 | break; | ||
526 | |||
527 | case BOOT_ACPI: | ||
528 | acpi_reboot(); | ||
529 | reboot_type = BOOT_KBD; | ||
530 | break; | ||
531 | |||
532 | case BOOT_EFI: | 530 | case BOOT_EFI: |
533 | if (efi_enabled(EFI_RUNTIME_SERVICES)) | 531 | if (efi_enabled(EFI_RUNTIME_SERVICES)) |
534 | efi.reset_system(reboot_mode == REBOOT_WARM ? | 532 | efi.reset_system(reboot_mode == REBOOT_WARM ? |
535 | EFI_RESET_WARM : | 533 | EFI_RESET_WARM : |
536 | EFI_RESET_COLD, | 534 | EFI_RESET_COLD, |
537 | EFI_SUCCESS, 0, NULL); | 535 | EFI_SUCCESS, 0, NULL); |
538 | reboot_type = BOOT_CF9_COND; | 536 | reboot_type = BOOT_BIOS; |
537 | break; | ||
538 | |||
539 | case BOOT_BIOS: | ||
540 | machine_real_restart(MRR_BIOS); | ||
541 | |||
542 | /* We're probably dead after this, but... */ | ||
543 | reboot_type = BOOT_CF9_SAFE; | ||
539 | break; | 544 | break; |
540 | 545 | ||
541 | case BOOT_CF9: | 546 | case BOOT_CF9_FORCE: |
542 | port_cf9_safe = true; | 547 | port_cf9_safe = true; |
543 | /* Fall through */ | 548 | /* Fall through */ |
544 | 549 | ||
545 | case BOOT_CF9_COND: | 550 | case BOOT_CF9_SAFE: |
546 | if (port_cf9_safe) { | 551 | if (port_cf9_safe) { |
547 | u8 reboot_code = reboot_mode == REBOOT_WARM ? | 552 | u8 reboot_code = reboot_mode == REBOOT_WARM ? 0x06 : 0x0E; |
548 | 0x06 : 0x0E; | ||
549 | u8 cf9 = inb(0xcf9) & ~reboot_code; | 553 | u8 cf9 = inb(0xcf9) & ~reboot_code; |
550 | outb(cf9|2, 0xcf9); /* Request hard reset */ | 554 | outb(cf9|2, 0xcf9); /* Request hard reset */ |
551 | udelay(50); | 555 | udelay(50); |
@@ -553,7 +557,15 @@ static void native_machine_emergency_restart(void) | |||
553 | outb(cf9|reboot_code, 0xcf9); | 557 | outb(cf9|reboot_code, 0xcf9); |
554 | udelay(50); | 558 | udelay(50); |
555 | } | 559 | } |
556 | reboot_type = BOOT_BIOS; | 560 | reboot_type = BOOT_TRIPLE; |
561 | break; | ||
562 | |||
563 | case BOOT_TRIPLE: | ||
564 | load_idt(&no_idt); | ||
565 | __asm__ __volatile__("int3"); | ||
566 | |||
567 | /* We're probably dead after this, but... */ | ||
568 | reboot_type = BOOT_KBD; | ||
557 | break; | 569 | break; |
558 | } | 570 | } |
559 | } | 571 | } |
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c index 7c3a5a61f2e4..be8e1bde07aa 100644 --- a/arch/x86/kernel/smp.c +++ b/arch/x86/kernel/smp.c | |||
@@ -168,7 +168,7 @@ static int smp_stop_nmi_callback(unsigned int val, struct pt_regs *regs) | |||
168 | * this function calls the 'stop' function on all other CPUs in the system. | 168 | * this function calls the 'stop' function on all other CPUs in the system. |
169 | */ | 169 | */ |
170 | 170 | ||
171 | asmlinkage void smp_reboot_interrupt(void) | 171 | asmlinkage __visible void smp_reboot_interrupt(void) |
172 | { | 172 | { |
173 | ack_APIC_irq(); | 173 | ack_APIC_irq(); |
174 | irq_enter(); | 174 | irq_enter(); |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 57409f6b8c62..f73b5d435bdc 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
@@ -357,7 +357,7 @@ exit: | |||
357 | * for scheduling or signal handling. The actual stack switch is done in | 357 | * for scheduling or signal handling. The actual stack switch is done in |
358 | * entry.S | 358 | * entry.S |
359 | */ | 359 | */ |
360 | asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) | 360 | asmlinkage __visible __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) |
361 | { | 361 | { |
362 | struct pt_regs *regs = eregs; | 362 | struct pt_regs *regs = eregs; |
363 | /* Did already sync */ | 363 | /* Did already sync */ |
@@ -601,11 +601,11 @@ do_spurious_interrupt_bug(struct pt_regs *regs, long error_code) | |||
601 | #endif | 601 | #endif |
602 | } | 602 | } |
603 | 603 | ||
604 | asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void) | 604 | asmlinkage __visible void __attribute__((weak)) smp_thermal_interrupt(void) |
605 | { | 605 | { |
606 | } | 606 | } |
607 | 607 | ||
608 | asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void) | 608 | asmlinkage __visible void __attribute__((weak)) smp_threshold_interrupt(void) |
609 | { | 609 | { |
610 | } | 610 | } |
611 | 611 | ||
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index f6584a90aba3..b99b9ad8540c 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c | |||
@@ -26,6 +26,9 @@ | |||
26 | 26 | ||
27 | #define TOPOLOGY_REGISTER_OFFSET 0x10 | 27 | #define TOPOLOGY_REGISTER_OFFSET 0x10 |
28 | 28 | ||
29 | /* Flag below is initialized once during vSMP PCI initialization. */ | ||
30 | static int irq_routing_comply = 1; | ||
31 | |||
29 | #if defined CONFIG_PCI && defined CONFIG_PARAVIRT | 32 | #if defined CONFIG_PCI && defined CONFIG_PARAVIRT |
30 | /* | 33 | /* |
31 | * Interrupt control on vSMPowered systems: | 34 | * Interrupt control on vSMPowered systems: |
@@ -33,7 +36,7 @@ | |||
33 | * and vice versa. | 36 | * and vice versa. |
34 | */ | 37 | */ |
35 | 38 | ||
36 | asmlinkage unsigned long vsmp_save_fl(void) | 39 | asmlinkage __visible unsigned long vsmp_save_fl(void) |
37 | { | 40 | { |
38 | unsigned long flags = native_save_fl(); | 41 | unsigned long flags = native_save_fl(); |
39 | 42 | ||
@@ -53,7 +56,7 @@ __visible void vsmp_restore_fl(unsigned long flags) | |||
53 | } | 56 | } |
54 | PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl); | 57 | PV_CALLEE_SAVE_REGS_THUNK(vsmp_restore_fl); |
55 | 58 | ||
56 | asmlinkage void vsmp_irq_disable(void) | 59 | asmlinkage __visible void vsmp_irq_disable(void) |
57 | { | 60 | { |
58 | unsigned long flags = native_save_fl(); | 61 | unsigned long flags = native_save_fl(); |
59 | 62 | ||
@@ -61,7 +64,7 @@ asmlinkage void vsmp_irq_disable(void) | |||
61 | } | 64 | } |
62 | PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable); | 65 | PV_CALLEE_SAVE_REGS_THUNK(vsmp_irq_disable); |
63 | 66 | ||
64 | asmlinkage void vsmp_irq_enable(void) | 67 | asmlinkage __visible void vsmp_irq_enable(void) |
65 | { | 68 | { |
66 | unsigned long flags = native_save_fl(); | 69 | unsigned long flags = native_save_fl(); |
67 | 70 | ||
@@ -101,6 +104,10 @@ static void __init set_vsmp_pv_ops(void) | |||
101 | #ifdef CONFIG_SMP | 104 | #ifdef CONFIG_SMP |
102 | if (cap & ctl & BIT(8)) { | 105 | if (cap & ctl & BIT(8)) { |
103 | ctl &= ~BIT(8); | 106 | ctl &= ~BIT(8); |
107 | |||
108 | /* Interrupt routing set to ignore */ | ||
109 | irq_routing_comply = 0; | ||
110 | |||
104 | #ifdef CONFIG_PROC_FS | 111 | #ifdef CONFIG_PROC_FS |
105 | /* Don't let users change irq affinity via procfs */ | 112 | /* Don't let users change irq affinity via procfs */ |
106 | no_irq_affinity = 1; | 113 | no_irq_affinity = 1; |
@@ -218,7 +225,9 @@ static void vsmp_apic_post_init(void) | |||
218 | { | 225 | { |
219 | /* need to update phys_pkg_id */ | 226 | /* need to update phys_pkg_id */ |
220 | apic->phys_pkg_id = apicid_phys_pkg_id; | 227 | apic->phys_pkg_id = apicid_phys_pkg_id; |
221 | apic->vector_allocation_domain = fill_vector_allocation_domain; | 228 | |
229 | if (!irq_routing_comply) | ||
230 | apic->vector_allocation_domain = fill_vector_allocation_domain; | ||
222 | } | 231 | } |
223 | 232 | ||
224 | void __init vsmp_init(void) | 233 | void __init vsmp_init(void) |
diff --git a/arch/x86/kernel/vsyscall_gtod.c b/arch/x86/kernel/vsyscall_gtod.c index f9c6e56e14b5..9531fbb123ba 100644 --- a/arch/x86/kernel/vsyscall_gtod.c +++ b/arch/x86/kernel/vsyscall_gtod.c | |||
@@ -43,7 +43,7 @@ void update_vsyscall(struct timekeeper *tk) | |||
43 | vdata->monotonic_time_sec = tk->xtime_sec | 43 | vdata->monotonic_time_sec = tk->xtime_sec |
44 | + tk->wall_to_monotonic.tv_sec; | 44 | + tk->wall_to_monotonic.tv_sec; |
45 | vdata->monotonic_time_snsec = tk->xtime_nsec | 45 | vdata->monotonic_time_snsec = tk->xtime_nsec |
46 | + (tk->wall_to_monotonic.tv_nsec | 46 | + ((u64)tk->wall_to_monotonic.tv_nsec |
47 | << tk->shift); | 47 | << tk->shift); |
48 | while (vdata->monotonic_time_snsec >= | 48 | while (vdata->monotonic_time_snsec >= |
49 | (((u64)NSEC_PER_SEC) << tk->shift)) { | 49 | (((u64)NSEC_PER_SEC) << tk->shift)) { |
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index bea60671ef8a..f47a104a749c 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c | |||
@@ -308,7 +308,7 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
308 | const u32 kvm_supported_word9_x86_features = | 308 | const u32 kvm_supported_word9_x86_features = |
309 | F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) | | 309 | F(FSGSBASE) | F(BMI1) | F(HLE) | F(AVX2) | F(SMEP) | |
310 | F(BMI2) | F(ERMS) | f_invpcid | F(RTM) | f_mpx | F(RDSEED) | | 310 | F(BMI2) | F(ERMS) | f_invpcid | F(RTM) | f_mpx | F(RDSEED) | |
311 | F(ADX); | 311 | F(ADX) | F(SMAP); |
312 | 312 | ||
313 | /* all calls to cpuid_count() should be made on the same cpu */ | 313 | /* all calls to cpuid_count() should be made on the same cpu */ |
314 | get_cpu(); | 314 | get_cpu(); |
diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h index a2a1bb7ed8c1..eeecbed26ac7 100644 --- a/arch/x86/kvm/cpuid.h +++ b/arch/x86/kvm/cpuid.h | |||
@@ -48,6 +48,14 @@ static inline bool guest_cpuid_has_smep(struct kvm_vcpu *vcpu) | |||
48 | return best && (best->ebx & bit(X86_FEATURE_SMEP)); | 48 | return best && (best->ebx & bit(X86_FEATURE_SMEP)); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline bool guest_cpuid_has_smap(struct kvm_vcpu *vcpu) | ||
52 | { | ||
53 | struct kvm_cpuid_entry2 *best; | ||
54 | |||
55 | best = kvm_find_cpuid_entry(vcpu, 7, 0); | ||
56 | return best && (best->ebx & bit(X86_FEATURE_SMAP)); | ||
57 | } | ||
58 | |||
51 | static inline bool guest_cpuid_has_fsgsbase(struct kvm_vcpu *vcpu) | 59 | static inline bool guest_cpuid_has_fsgsbase(struct kvm_vcpu *vcpu) |
52 | { | 60 | { |
53 | struct kvm_cpuid_entry2 *best; | 61 | struct kvm_cpuid_entry2 *best; |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index f5704d9e5ddc..813d31038b93 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -3601,20 +3601,27 @@ static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu, | |||
3601 | } | 3601 | } |
3602 | } | 3602 | } |
3603 | 3603 | ||
3604 | static void update_permission_bitmask(struct kvm_vcpu *vcpu, | 3604 | void update_permission_bitmask(struct kvm_vcpu *vcpu, |
3605 | struct kvm_mmu *mmu, bool ept) | 3605 | struct kvm_mmu *mmu, bool ept) |
3606 | { | 3606 | { |
3607 | unsigned bit, byte, pfec; | 3607 | unsigned bit, byte, pfec; |
3608 | u8 map; | 3608 | u8 map; |
3609 | bool fault, x, w, u, wf, uf, ff, smep; | 3609 | bool fault, x, w, u, wf, uf, ff, smapf, cr4_smap, cr4_smep, smap = 0; |
3610 | 3610 | ||
3611 | smep = kvm_read_cr4_bits(vcpu, X86_CR4_SMEP); | 3611 | cr4_smep = kvm_read_cr4_bits(vcpu, X86_CR4_SMEP); |
3612 | cr4_smap = kvm_read_cr4_bits(vcpu, X86_CR4_SMAP); | ||
3612 | for (byte = 0; byte < ARRAY_SIZE(mmu->permissions); ++byte) { | 3613 | for (byte = 0; byte < ARRAY_SIZE(mmu->permissions); ++byte) { |
3613 | pfec = byte << 1; | 3614 | pfec = byte << 1; |
3614 | map = 0; | 3615 | map = 0; |
3615 | wf = pfec & PFERR_WRITE_MASK; | 3616 | wf = pfec & PFERR_WRITE_MASK; |
3616 | uf = pfec & PFERR_USER_MASK; | 3617 | uf = pfec & PFERR_USER_MASK; |
3617 | ff = pfec & PFERR_FETCH_MASK; | 3618 | ff = pfec & PFERR_FETCH_MASK; |
3619 | /* | ||
3620 | * PFERR_RSVD_MASK bit is set in PFEC if the access is not | ||
3621 | * subject to SMAP restrictions, and cleared otherwise. The | ||
3622 | * bit is only meaningful if the SMAP bit is set in CR4. | ||
3623 | */ | ||
3624 | smapf = !(pfec & PFERR_RSVD_MASK); | ||
3618 | for (bit = 0; bit < 8; ++bit) { | 3625 | for (bit = 0; bit < 8; ++bit) { |
3619 | x = bit & ACC_EXEC_MASK; | 3626 | x = bit & ACC_EXEC_MASK; |
3620 | w = bit & ACC_WRITE_MASK; | 3627 | w = bit & ACC_WRITE_MASK; |
@@ -3626,12 +3633,33 @@ static void update_permission_bitmask(struct kvm_vcpu *vcpu, | |||
3626 | /* Allow supervisor writes if !cr0.wp */ | 3633 | /* Allow supervisor writes if !cr0.wp */ |
3627 | w |= !is_write_protection(vcpu) && !uf; | 3634 | w |= !is_write_protection(vcpu) && !uf; |
3628 | /* Disallow supervisor fetches of user code if cr4.smep */ | 3635 | /* Disallow supervisor fetches of user code if cr4.smep */ |
3629 | x &= !(smep && u && !uf); | 3636 | x &= !(cr4_smep && u && !uf); |
3637 | |||
3638 | /* | ||
3639 | * SMAP:kernel-mode data accesses from user-mode | ||
3640 | * mappings should fault. A fault is considered | ||
3641 | * as a SMAP violation if all of the following | ||
3642 | * conditions are ture: | ||
3643 | * - X86_CR4_SMAP is set in CR4 | ||
3644 | * - An user page is accessed | ||
3645 | * - Page fault in kernel mode | ||
3646 | * - if CPL = 3 or X86_EFLAGS_AC is clear | ||
3647 | * | ||
3648 | * Here, we cover the first three conditions. | ||
3649 | * The fourth is computed dynamically in | ||
3650 | * permission_fault() and is in smapf. | ||
3651 | * | ||
3652 | * Also, SMAP does not affect instruction | ||
3653 | * fetches, add the !ff check here to make it | ||
3654 | * clearer. | ||
3655 | */ | ||
3656 | smap = cr4_smap && u && !uf && !ff; | ||
3630 | } else | 3657 | } else |
3631 | /* Not really needed: no U/S accesses on ept */ | 3658 | /* Not really needed: no U/S accesses on ept */ |
3632 | u = 1; | 3659 | u = 1; |
3633 | 3660 | ||
3634 | fault = (ff && !x) || (uf && !u) || (wf && !w); | 3661 | fault = (ff && !x) || (uf && !u) || (wf && !w) || |
3662 | (smapf && smap); | ||
3635 | map |= fault << bit; | 3663 | map |= fault << bit; |
3636 | } | 3664 | } |
3637 | mmu->permissions[byte] = map; | 3665 | mmu->permissions[byte] = map; |
diff --git a/arch/x86/kvm/mmu.h b/arch/x86/kvm/mmu.h index 292615274358..3842e70bdb7c 100644 --- a/arch/x86/kvm/mmu.h +++ b/arch/x86/kvm/mmu.h | |||
@@ -44,11 +44,17 @@ | |||
44 | #define PT_DIRECTORY_LEVEL 2 | 44 | #define PT_DIRECTORY_LEVEL 2 |
45 | #define PT_PAGE_TABLE_LEVEL 1 | 45 | #define PT_PAGE_TABLE_LEVEL 1 |
46 | 46 | ||
47 | #define PFERR_PRESENT_MASK (1U << 0) | 47 | #define PFERR_PRESENT_BIT 0 |
48 | #define PFERR_WRITE_MASK (1U << 1) | 48 | #define PFERR_WRITE_BIT 1 |
49 | #define PFERR_USER_MASK (1U << 2) | 49 | #define PFERR_USER_BIT 2 |
50 | #define PFERR_RSVD_MASK (1U << 3) | 50 | #define PFERR_RSVD_BIT 3 |
51 | #define PFERR_FETCH_MASK (1U << 4) | 51 | #define PFERR_FETCH_BIT 4 |
52 | |||
53 | #define PFERR_PRESENT_MASK (1U << PFERR_PRESENT_BIT) | ||
54 | #define PFERR_WRITE_MASK (1U << PFERR_WRITE_BIT) | ||
55 | #define PFERR_USER_MASK (1U << PFERR_USER_BIT) | ||
56 | #define PFERR_RSVD_MASK (1U << PFERR_RSVD_BIT) | ||
57 | #define PFERR_FETCH_MASK (1U << PFERR_FETCH_BIT) | ||
52 | 58 | ||
53 | int kvm_mmu_get_spte_hierarchy(struct kvm_vcpu *vcpu, u64 addr, u64 sptes[4]); | 59 | int kvm_mmu_get_spte_hierarchy(struct kvm_vcpu *vcpu, u64 addr, u64 sptes[4]); |
54 | void kvm_mmu_set_mmio_spte_mask(u64 mmio_mask); | 60 | void kvm_mmu_set_mmio_spte_mask(u64 mmio_mask); |
@@ -73,6 +79,8 @@ int handle_mmio_page_fault_common(struct kvm_vcpu *vcpu, u64 addr, bool direct); | |||
73 | void kvm_init_shadow_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context); | 79 | void kvm_init_shadow_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context); |
74 | void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context, | 80 | void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, struct kvm_mmu *context, |
75 | bool execonly); | 81 | bool execonly); |
82 | void update_permission_bitmask(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, | ||
83 | bool ept); | ||
76 | 84 | ||
77 | static inline unsigned int kvm_mmu_available_pages(struct kvm *kvm) | 85 | static inline unsigned int kvm_mmu_available_pages(struct kvm *kvm) |
78 | { | 86 | { |
@@ -110,10 +118,30 @@ static inline bool is_write_protection(struct kvm_vcpu *vcpu) | |||
110 | * Will a fault with a given page-fault error code (pfec) cause a permission | 118 | * Will a fault with a given page-fault error code (pfec) cause a permission |
111 | * fault with the given access (in ACC_* format)? | 119 | * fault with the given access (in ACC_* format)? |
112 | */ | 120 | */ |
113 | static inline bool permission_fault(struct kvm_mmu *mmu, unsigned pte_access, | 121 | static inline bool permission_fault(struct kvm_vcpu *vcpu, struct kvm_mmu *mmu, |
114 | unsigned pfec) | 122 | unsigned pte_access, unsigned pfec) |
115 | { | 123 | { |
116 | return (mmu->permissions[pfec >> 1] >> pte_access) & 1; | 124 | int cpl = kvm_x86_ops->get_cpl(vcpu); |
125 | unsigned long rflags = kvm_x86_ops->get_rflags(vcpu); | ||
126 | |||
127 | /* | ||
128 | * If CPL < 3, SMAP prevention are disabled if EFLAGS.AC = 1. | ||
129 | * | ||
130 | * If CPL = 3, SMAP applies to all supervisor-mode data accesses | ||
131 | * (these are implicit supervisor accesses) regardless of the value | ||
132 | * of EFLAGS.AC. | ||
133 | * | ||
134 | * This computes (cpl < 3) && (rflags & X86_EFLAGS_AC), leaving | ||
135 | * the result in X86_EFLAGS_AC. We then insert it in place of | ||
136 | * the PFERR_RSVD_MASK bit; this bit will always be zero in pfec, | ||
137 | * but it will be one in index if SMAP checks are being overridden. | ||
138 | * It is important to keep this branchless. | ||
139 | */ | ||
140 | unsigned long smap = (cpl - 3) & (rflags & X86_EFLAGS_AC); | ||
141 | int index = (pfec >> 1) + | ||
142 | (smap >> (X86_EFLAGS_AC_BIT - PFERR_RSVD_BIT + 1)); | ||
143 | |||
144 | return (mmu->permissions[index] >> pte_access) & 1; | ||
117 | } | 145 | } |
118 | 146 | ||
119 | void kvm_mmu_invalidate_zap_all_pages(struct kvm *kvm); | 147 | void kvm_mmu_invalidate_zap_all_pages(struct kvm *kvm); |
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index b1e6c1bf68d3..123efd3ec29f 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
@@ -353,7 +353,7 @@ retry_walk: | |||
353 | walker->ptes[walker->level - 1] = pte; | 353 | walker->ptes[walker->level - 1] = pte; |
354 | } while (!is_last_gpte(mmu, walker->level, pte)); | 354 | } while (!is_last_gpte(mmu, walker->level, pte)); |
355 | 355 | ||
356 | if (unlikely(permission_fault(mmu, pte_access, access))) { | 356 | if (unlikely(permission_fault(vcpu, mmu, pte_access, access))) { |
357 | errcode |= PFERR_PRESENT_MASK; | 357 | errcode |= PFERR_PRESENT_MASK; |
358 | goto error; | 358 | goto error; |
359 | } | 359 | } |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 1320e0f8e611..138ceffc6377 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -503,7 +503,7 @@ static inline struct vcpu_vmx *to_vmx(struct kvm_vcpu *vcpu) | |||
503 | [number##_HIGH] = VMCS12_OFFSET(name)+4 | 503 | [number##_HIGH] = VMCS12_OFFSET(name)+4 |
504 | 504 | ||
505 | 505 | ||
506 | static const unsigned long shadow_read_only_fields[] = { | 506 | static unsigned long shadow_read_only_fields[] = { |
507 | /* | 507 | /* |
508 | * We do NOT shadow fields that are modified when L0 | 508 | * We do NOT shadow fields that are modified when L0 |
509 | * traps and emulates any vmx instruction (e.g. VMPTRLD, | 509 | * traps and emulates any vmx instruction (e.g. VMPTRLD, |
@@ -526,10 +526,10 @@ static const unsigned long shadow_read_only_fields[] = { | |||
526 | GUEST_LINEAR_ADDRESS, | 526 | GUEST_LINEAR_ADDRESS, |
527 | GUEST_PHYSICAL_ADDRESS | 527 | GUEST_PHYSICAL_ADDRESS |
528 | }; | 528 | }; |
529 | static const int max_shadow_read_only_fields = | 529 | static int max_shadow_read_only_fields = |
530 | ARRAY_SIZE(shadow_read_only_fields); | 530 | ARRAY_SIZE(shadow_read_only_fields); |
531 | 531 | ||
532 | static const unsigned long shadow_read_write_fields[] = { | 532 | static unsigned long shadow_read_write_fields[] = { |
533 | GUEST_RIP, | 533 | GUEST_RIP, |
534 | GUEST_RSP, | 534 | GUEST_RSP, |
535 | GUEST_CR0, | 535 | GUEST_CR0, |
@@ -558,7 +558,7 @@ static const unsigned long shadow_read_write_fields[] = { | |||
558 | HOST_FS_SELECTOR, | 558 | HOST_FS_SELECTOR, |
559 | HOST_GS_SELECTOR | 559 | HOST_GS_SELECTOR |
560 | }; | 560 | }; |
561 | static const int max_shadow_read_write_fields = | 561 | static int max_shadow_read_write_fields = |
562 | ARRAY_SIZE(shadow_read_write_fields); | 562 | ARRAY_SIZE(shadow_read_write_fields); |
563 | 563 | ||
564 | static const unsigned short vmcs_field_to_offset_table[] = { | 564 | static const unsigned short vmcs_field_to_offset_table[] = { |
@@ -3009,6 +3009,41 @@ static void free_kvm_area(void) | |||
3009 | } | 3009 | } |
3010 | } | 3010 | } |
3011 | 3011 | ||
3012 | static void init_vmcs_shadow_fields(void) | ||
3013 | { | ||
3014 | int i, j; | ||
3015 | |||
3016 | /* No checks for read only fields yet */ | ||
3017 | |||
3018 | for (i = j = 0; i < max_shadow_read_write_fields; i++) { | ||
3019 | switch (shadow_read_write_fields[i]) { | ||
3020 | case GUEST_BNDCFGS: | ||
3021 | if (!vmx_mpx_supported()) | ||
3022 | continue; | ||
3023 | break; | ||
3024 | default: | ||
3025 | break; | ||
3026 | } | ||
3027 | |||
3028 | if (j < i) | ||
3029 | shadow_read_write_fields[j] = | ||
3030 | shadow_read_write_fields[i]; | ||
3031 | j++; | ||
3032 | } | ||
3033 | max_shadow_read_write_fields = j; | ||
3034 | |||
3035 | /* shadowed fields guest access without vmexit */ | ||
3036 | for (i = 0; i < max_shadow_read_write_fields; i++) { | ||
3037 | clear_bit(shadow_read_write_fields[i], | ||
3038 | vmx_vmwrite_bitmap); | ||
3039 | clear_bit(shadow_read_write_fields[i], | ||
3040 | vmx_vmread_bitmap); | ||
3041 | } | ||
3042 | for (i = 0; i < max_shadow_read_only_fields; i++) | ||
3043 | clear_bit(shadow_read_only_fields[i], | ||
3044 | vmx_vmread_bitmap); | ||
3045 | } | ||
3046 | |||
3012 | static __init int alloc_kvm_area(void) | 3047 | static __init int alloc_kvm_area(void) |
3013 | { | 3048 | { |
3014 | int cpu; | 3049 | int cpu; |
@@ -3039,6 +3074,8 @@ static __init int hardware_setup(void) | |||
3039 | enable_vpid = 0; | 3074 | enable_vpid = 0; |
3040 | if (!cpu_has_vmx_shadow_vmcs()) | 3075 | if (!cpu_has_vmx_shadow_vmcs()) |
3041 | enable_shadow_vmcs = 0; | 3076 | enable_shadow_vmcs = 0; |
3077 | if (enable_shadow_vmcs) | ||
3078 | init_vmcs_shadow_fields(); | ||
3042 | 3079 | ||
3043 | if (!cpu_has_vmx_ept() || | 3080 | if (!cpu_has_vmx_ept() || |
3044 | !cpu_has_vmx_ept_4levels()) { | 3081 | !cpu_has_vmx_ept_4levels()) { |
@@ -3484,13 +3521,14 @@ static int vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | |||
3484 | hw_cr4 &= ~X86_CR4_PAE; | 3521 | hw_cr4 &= ~X86_CR4_PAE; |
3485 | hw_cr4 |= X86_CR4_PSE; | 3522 | hw_cr4 |= X86_CR4_PSE; |
3486 | /* | 3523 | /* |
3487 | * SMEP is disabled if CPU is in non-paging mode in | 3524 | * SMEP/SMAP is disabled if CPU is in non-paging mode |
3488 | * hardware. However KVM always uses paging mode to | 3525 | * in hardware. However KVM always uses paging mode to |
3489 | * emulate guest non-paging mode with TDP. | 3526 | * emulate guest non-paging mode with TDP. |
3490 | * To emulate this behavior, SMEP needs to be manually | 3527 | * To emulate this behavior, SMEP/SMAP needs to be |
3491 | * disabled when guest switches to non-paging mode. | 3528 | * manually disabled when guest switches to non-paging |
3529 | * mode. | ||
3492 | */ | 3530 | */ |
3493 | hw_cr4 &= ~X86_CR4_SMEP; | 3531 | hw_cr4 &= ~(X86_CR4_SMEP | X86_CR4_SMAP); |
3494 | } else if (!(cr4 & X86_CR4_PAE)) { | 3532 | } else if (!(cr4 & X86_CR4_PAE)) { |
3495 | hw_cr4 &= ~X86_CR4_PAE; | 3533 | hw_cr4 &= ~X86_CR4_PAE; |
3496 | } | 3534 | } |
@@ -7740,7 +7778,8 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) | |||
7740 | 7778 | ||
7741 | exec_control = vmcs12->pin_based_vm_exec_control; | 7779 | exec_control = vmcs12->pin_based_vm_exec_control; |
7742 | exec_control |= vmcs_config.pin_based_exec_ctrl; | 7780 | exec_control |= vmcs_config.pin_based_exec_ctrl; |
7743 | exec_control &= ~PIN_BASED_VMX_PREEMPTION_TIMER; | 7781 | exec_control &= ~(PIN_BASED_VMX_PREEMPTION_TIMER | |
7782 | PIN_BASED_POSTED_INTR); | ||
7744 | vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, exec_control); | 7783 | vmcs_write32(PIN_BASED_VM_EXEC_CONTROL, exec_control); |
7745 | 7784 | ||
7746 | vmx->nested.preemption_timer_expired = false; | 7785 | vmx->nested.preemption_timer_expired = false; |
@@ -7777,7 +7816,9 @@ static void prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) | |||
7777 | if (!vmx->rdtscp_enabled) | 7816 | if (!vmx->rdtscp_enabled) |
7778 | exec_control &= ~SECONDARY_EXEC_RDTSCP; | 7817 | exec_control &= ~SECONDARY_EXEC_RDTSCP; |
7779 | /* Take the following fields only from vmcs12 */ | 7818 | /* Take the following fields only from vmcs12 */ |
7780 | exec_control &= ~SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES; | 7819 | exec_control &= ~(SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES | |
7820 | SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY | | ||
7821 | SECONDARY_EXEC_APIC_REGISTER_VIRT); | ||
7781 | if (nested_cpu_has(vmcs12, | 7822 | if (nested_cpu_has(vmcs12, |
7782 | CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)) | 7823 | CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)) |
7783 | exec_control |= vmcs12->secondary_vm_exec_control; | 7824 | exec_control |= vmcs12->secondary_vm_exec_control; |
@@ -8802,14 +8843,6 @@ static int __init vmx_init(void) | |||
8802 | 8843 | ||
8803 | memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE); | 8844 | memset(vmx_vmread_bitmap, 0xff, PAGE_SIZE); |
8804 | memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE); | 8845 | memset(vmx_vmwrite_bitmap, 0xff, PAGE_SIZE); |
8805 | /* shadowed read/write fields */ | ||
8806 | for (i = 0; i < max_shadow_read_write_fields; i++) { | ||
8807 | clear_bit(shadow_read_write_fields[i], vmx_vmwrite_bitmap); | ||
8808 | clear_bit(shadow_read_write_fields[i], vmx_vmread_bitmap); | ||
8809 | } | ||
8810 | /* shadowed read only fields */ | ||
8811 | for (i = 0; i < max_shadow_read_only_fields; i++) | ||
8812 | clear_bit(shadow_read_only_fields[i], vmx_vmread_bitmap); | ||
8813 | 8846 | ||
8814 | /* | 8847 | /* |
8815 | * Allow direct access to the PC debug port (it is often used for I/O | 8848 | * Allow direct access to the PC debug port (it is often used for I/O |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9d1b5cd4d34c..20316c67b824 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -106,6 +106,8 @@ EXPORT_SYMBOL_GPL(kvm_max_guest_tsc_khz); | |||
106 | static u32 tsc_tolerance_ppm = 250; | 106 | static u32 tsc_tolerance_ppm = 250; |
107 | module_param(tsc_tolerance_ppm, uint, S_IRUGO | S_IWUSR); | 107 | module_param(tsc_tolerance_ppm, uint, S_IRUGO | S_IWUSR); |
108 | 108 | ||
109 | static bool backwards_tsc_observed = false; | ||
110 | |||
109 | #define KVM_NR_SHARED_MSRS 16 | 111 | #define KVM_NR_SHARED_MSRS 16 |
110 | 112 | ||
111 | struct kvm_shared_msrs_global { | 113 | struct kvm_shared_msrs_global { |
@@ -280,7 +282,7 @@ int kvm_set_apic_base(struct kvm_vcpu *vcpu, struct msr_data *msr_info) | |||
280 | } | 282 | } |
281 | EXPORT_SYMBOL_GPL(kvm_set_apic_base); | 283 | EXPORT_SYMBOL_GPL(kvm_set_apic_base); |
282 | 284 | ||
283 | asmlinkage void kvm_spurious_fault(void) | 285 | asmlinkage __visible void kvm_spurious_fault(void) |
284 | { | 286 | { |
285 | /* Fault while not rebooting. We want the trace. */ | 287 | /* Fault while not rebooting. We want the trace. */ |
286 | BUG(); | 288 | BUG(); |
@@ -652,6 +654,9 @@ int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | |||
652 | if (!guest_cpuid_has_smep(vcpu) && (cr4 & X86_CR4_SMEP)) | 654 | if (!guest_cpuid_has_smep(vcpu) && (cr4 & X86_CR4_SMEP)) |
653 | return 1; | 655 | return 1; |
654 | 656 | ||
657 | if (!guest_cpuid_has_smap(vcpu) && (cr4 & X86_CR4_SMAP)) | ||
658 | return 1; | ||
659 | |||
655 | if (!guest_cpuid_has_fsgsbase(vcpu) && (cr4 & X86_CR4_FSGSBASE)) | 660 | if (!guest_cpuid_has_fsgsbase(vcpu) && (cr4 & X86_CR4_FSGSBASE)) |
656 | return 1; | 661 | return 1; |
657 | 662 | ||
@@ -680,6 +685,9 @@ int kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4) | |||
680 | (!(cr4 & X86_CR4_PCIDE) && (old_cr4 & X86_CR4_PCIDE))) | 685 | (!(cr4 & X86_CR4_PCIDE) && (old_cr4 & X86_CR4_PCIDE))) |
681 | kvm_mmu_reset_context(vcpu); | 686 | kvm_mmu_reset_context(vcpu); |
682 | 687 | ||
688 | if ((cr4 ^ old_cr4) & X86_CR4_SMAP) | ||
689 | update_permission_bitmask(vcpu, vcpu->arch.walk_mmu, false); | ||
690 | |||
683 | if ((cr4 ^ old_cr4) & X86_CR4_OSXSAVE) | 691 | if ((cr4 ^ old_cr4) & X86_CR4_OSXSAVE) |
684 | kvm_update_cpuid(vcpu); | 692 | kvm_update_cpuid(vcpu); |
685 | 693 | ||
@@ -1117,7 +1125,6 @@ static inline u64 get_kernel_ns(void) | |||
1117 | { | 1125 | { |
1118 | struct timespec ts; | 1126 | struct timespec ts; |
1119 | 1127 | ||
1120 | WARN_ON(preemptible()); | ||
1121 | ktime_get_ts(&ts); | 1128 | ktime_get_ts(&ts); |
1122 | monotonic_to_bootbased(&ts); | 1129 | monotonic_to_bootbased(&ts); |
1123 | return timespec_to_ns(&ts); | 1130 | return timespec_to_ns(&ts); |
@@ -1481,7 +1488,8 @@ static void pvclock_update_vm_gtod_copy(struct kvm *kvm) | |||
1481 | &ka->master_kernel_ns, | 1488 | &ka->master_kernel_ns, |
1482 | &ka->master_cycle_now); | 1489 | &ka->master_cycle_now); |
1483 | 1490 | ||
1484 | ka->use_master_clock = host_tsc_clocksource & vcpus_matched; | 1491 | ka->use_master_clock = host_tsc_clocksource && vcpus_matched |
1492 | && !backwards_tsc_observed; | ||
1485 | 1493 | ||
1486 | if (ka->use_master_clock) | 1494 | if (ka->use_master_clock) |
1487 | atomic_set(&kvm_guest_has_master_clock, 1); | 1495 | atomic_set(&kvm_guest_has_master_clock, 1); |
@@ -4164,7 +4172,8 @@ static int vcpu_mmio_gva_to_gpa(struct kvm_vcpu *vcpu, unsigned long gva, | |||
4164 | | (write ? PFERR_WRITE_MASK : 0); | 4172 | | (write ? PFERR_WRITE_MASK : 0); |
4165 | 4173 | ||
4166 | if (vcpu_match_mmio_gva(vcpu, gva) | 4174 | if (vcpu_match_mmio_gva(vcpu, gva) |
4167 | && !permission_fault(vcpu->arch.walk_mmu, vcpu->arch.access, access)) { | 4175 | && !permission_fault(vcpu, vcpu->arch.walk_mmu, |
4176 | vcpu->arch.access, access)) { | ||
4168 | *gpa = vcpu->arch.mmio_gfn << PAGE_SHIFT | | 4177 | *gpa = vcpu->arch.mmio_gfn << PAGE_SHIFT | |
4169 | (gva & (PAGE_SIZE - 1)); | 4178 | (gva & (PAGE_SIZE - 1)); |
4170 | trace_vcpu_match_mmio(gva, *gpa, write, false); | 4179 | trace_vcpu_match_mmio(gva, *gpa, write, false); |
@@ -6939,6 +6948,7 @@ int kvm_arch_hardware_enable(void *garbage) | |||
6939 | */ | 6948 | */ |
6940 | if (backwards_tsc) { | 6949 | if (backwards_tsc) { |
6941 | u64 delta_cyc = max_tsc - local_tsc; | 6950 | u64 delta_cyc = max_tsc - local_tsc; |
6951 | backwards_tsc_observed = true; | ||
6942 | list_for_each_entry(kvm, &vm_list, vm_list) { | 6952 | list_for_each_entry(kvm, &vm_list, vm_list) { |
6943 | kvm_for_each_vcpu(i, vcpu, kvm) { | 6953 | kvm_for_each_vcpu(i, vcpu, kvm) { |
6944 | vcpu->arch.tsc_offset_adjustment += delta_cyc; | 6954 | vcpu->arch.tsc_offset_adjustment += delta_cyc; |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index ad1fb5f53925..aae94132bc24 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -233,13 +233,13 @@ static void lguest_end_context_switch(struct task_struct *next) | |||
233 | * flags word contains all kind of stuff, but in practice Linux only cares | 233 | * flags word contains all kind of stuff, but in practice Linux only cares |
234 | * about the interrupt flag. Our "save_flags()" just returns that. | 234 | * about the interrupt flag. Our "save_flags()" just returns that. |
235 | */ | 235 | */ |
236 | asmlinkage unsigned long lguest_save_fl(void) | 236 | asmlinkage __visible unsigned long lguest_save_fl(void) |
237 | { | 237 | { |
238 | return lguest_data.irq_enabled; | 238 | return lguest_data.irq_enabled; |
239 | } | 239 | } |
240 | 240 | ||
241 | /* Interrupts go off... */ | 241 | /* Interrupts go off... */ |
242 | asmlinkage void lguest_irq_disable(void) | 242 | asmlinkage __visible void lguest_irq_disable(void) |
243 | { | 243 | { |
244 | lguest_data.irq_enabled = 0; | 244 | lguest_data.irq_enabled = 0; |
245 | } | 245 | } |
diff --git a/arch/x86/lib/msr.c b/arch/x86/lib/msr.c index db9db446b71a..43623739c7cf 100644 --- a/arch/x86/lib/msr.c +++ b/arch/x86/lib/msr.c | |||
@@ -76,7 +76,7 @@ static inline int __flip_bit(u32 msr, u8 bit, bool set) | |||
76 | if (m1.q == m.q) | 76 | if (m1.q == m.q) |
77 | return 0; | 77 | return 0; |
78 | 78 | ||
79 | err = msr_write(msr, &m); | 79 | err = msr_write(msr, &m1); |
80 | if (err) | 80 | if (err) |
81 | return err; | 81 | return err; |
82 | 82 | ||
diff --git a/arch/x86/math-emu/errors.c b/arch/x86/math-emu/errors.c index a5449089cd9f..9e6545f269e5 100644 --- a/arch/x86/math-emu/errors.c +++ b/arch/x86/math-emu/errors.c | |||
@@ -302,7 +302,7 @@ static struct { | |||
302 | 0x242 in div_Xsig.S | 302 | 0x242 in div_Xsig.S |
303 | */ | 303 | */ |
304 | 304 | ||
305 | asmlinkage void FPU_exception(int n) | 305 | asmlinkage __visible void FPU_exception(int n) |
306 | { | 306 | { |
307 | int i, int_type; | 307 | int i, int_type; |
308 | 308 | ||
@@ -492,7 +492,7 @@ int real_2op_NaN(FPU_REG const *b, u_char tagb, | |||
492 | 492 | ||
493 | /* Invalid arith operation on Valid registers */ | 493 | /* Invalid arith operation on Valid registers */ |
494 | /* Returns < 0 if the exception is unmasked */ | 494 | /* Returns < 0 if the exception is unmasked */ |
495 | asmlinkage int arith_invalid(int deststnr) | 495 | asmlinkage __visible int arith_invalid(int deststnr) |
496 | { | 496 | { |
497 | 497 | ||
498 | EXCEPTION(EX_Invalid); | 498 | EXCEPTION(EX_Invalid); |
@@ -507,7 +507,7 @@ asmlinkage int arith_invalid(int deststnr) | |||
507 | } | 507 | } |
508 | 508 | ||
509 | /* Divide a finite number by zero */ | 509 | /* Divide a finite number by zero */ |
510 | asmlinkage int FPU_divide_by_zero(int deststnr, u_char sign) | 510 | asmlinkage __visible int FPU_divide_by_zero(int deststnr, u_char sign) |
511 | { | 511 | { |
512 | FPU_REG *dest = &st(deststnr); | 512 | FPU_REG *dest = &st(deststnr); |
513 | int tag = TAG_Valid; | 513 | int tag = TAG_Valid; |
@@ -539,7 +539,7 @@ int set_precision_flag(int flags) | |||
539 | } | 539 | } |
540 | 540 | ||
541 | /* This may be called often, so keep it lean */ | 541 | /* This may be called often, so keep it lean */ |
542 | asmlinkage void set_precision_flag_up(void) | 542 | asmlinkage __visible void set_precision_flag_up(void) |
543 | { | 543 | { |
544 | if (control_word & CW_Precision) | 544 | if (control_word & CW_Precision) |
545 | partial_status |= (SW_Precision | SW_C1); /* The masked response */ | 545 | partial_status |= (SW_Precision | SW_C1); /* The masked response */ |
@@ -548,7 +548,7 @@ asmlinkage void set_precision_flag_up(void) | |||
548 | } | 548 | } |
549 | 549 | ||
550 | /* This may be called often, so keep it lean */ | 550 | /* This may be called often, so keep it lean */ |
551 | asmlinkage void set_precision_flag_down(void) | 551 | asmlinkage __visible void set_precision_flag_down(void) |
552 | { | 552 | { |
553 | if (control_word & CW_Precision) { /* The masked response */ | 553 | if (control_word & CW_Precision) { /* The masked response */ |
554 | partial_status &= ~SW_C1; | 554 | partial_status &= ~SW_C1; |
@@ -557,7 +557,7 @@ asmlinkage void set_precision_flag_down(void) | |||
557 | EXCEPTION(EX_Precision); | 557 | EXCEPTION(EX_Precision); |
558 | } | 558 | } |
559 | 559 | ||
560 | asmlinkage int denormal_operand(void) | 560 | asmlinkage __visible int denormal_operand(void) |
561 | { | 561 | { |
562 | if (control_word & CW_Denormal) { /* The masked response */ | 562 | if (control_word & CW_Denormal) { /* The masked response */ |
563 | partial_status |= SW_Denorm_Op; | 563 | partial_status |= SW_Denorm_Op; |
@@ -568,7 +568,7 @@ asmlinkage int denormal_operand(void) | |||
568 | } | 568 | } |
569 | } | 569 | } |
570 | 570 | ||
571 | asmlinkage int arith_overflow(FPU_REG *dest) | 571 | asmlinkage __visible int arith_overflow(FPU_REG *dest) |
572 | { | 572 | { |
573 | int tag = TAG_Valid; | 573 | int tag = TAG_Valid; |
574 | 574 | ||
@@ -596,7 +596,7 @@ asmlinkage int arith_overflow(FPU_REG *dest) | |||
596 | 596 | ||
597 | } | 597 | } |
598 | 598 | ||
599 | asmlinkage int arith_underflow(FPU_REG *dest) | 599 | asmlinkage __visible int arith_underflow(FPU_REG *dest) |
600 | { | 600 | { |
601 | int tag = TAG_Valid; | 601 | int tag = TAG_Valid; |
602 | 602 | ||
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index dc017735bb91..6d5663a599a7 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -171,7 +171,7 @@ static struct bpf_binary_header *bpf_alloc_binary(unsigned int proglen, | |||
171 | memset(header, 0xcc, sz); /* fill whole space with int3 instructions */ | 171 | memset(header, 0xcc, sz); /* fill whole space with int3 instructions */ |
172 | 172 | ||
173 | header->pages = sz / PAGE_SIZE; | 173 | header->pages = sz / PAGE_SIZE; |
174 | hole = sz - (proglen + sizeof(*header)); | 174 | hole = min(sz - (proglen + sizeof(*header)), PAGE_SIZE - sizeof(*header)); |
175 | 175 | ||
176 | /* insert a random number of int3 instructions before BPF code */ | 176 | /* insert a random number of int3 instructions before BPF code */ |
177 | *image_ptr = &header->image[prandom_u32() % hole]; | 177 | *image_ptr = &header->image[prandom_u32() % hole]; |
diff --git a/arch/x86/platform/efi/early_printk.c b/arch/x86/platform/efi/early_printk.c index 81b506d5befd..524142117296 100644 --- a/arch/x86/platform/efi/early_printk.c +++ b/arch/x86/platform/efi/early_printk.c | |||
@@ -14,48 +14,92 @@ | |||
14 | 14 | ||
15 | static const struct font_desc *font; | 15 | static const struct font_desc *font; |
16 | static u32 efi_x, efi_y; | 16 | static u32 efi_x, efi_y; |
17 | static void *efi_fb; | ||
18 | static bool early_efi_keep; | ||
17 | 19 | ||
18 | static __init void early_efi_clear_scanline(unsigned int y) | 20 | /* |
21 | * efi earlyprintk need use early_ioremap to map the framebuffer. | ||
22 | * But early_ioremap is not usable for earlyprintk=efi,keep, ioremap should | ||
23 | * be used instead. ioremap will be available after paging_init() which is | ||
24 | * earlier than initcall callbacks. Thus adding this early initcall function | ||
25 | * early_efi_map_fb to map the whole efi framebuffer. | ||
26 | */ | ||
27 | static __init int early_efi_map_fb(void) | ||
19 | { | 28 | { |
20 | unsigned long base, *dst; | 29 | unsigned long base, size; |
21 | u16 len; | 30 | |
31 | if (!early_efi_keep) | ||
32 | return 0; | ||
22 | 33 | ||
23 | base = boot_params.screen_info.lfb_base; | 34 | base = boot_params.screen_info.lfb_base; |
24 | len = boot_params.screen_info.lfb_linelength; | 35 | size = boot_params.screen_info.lfb_size; |
36 | efi_fb = ioremap(base, size); | ||
37 | |||
38 | return efi_fb ? 0 : -ENOMEM; | ||
39 | } | ||
40 | early_initcall(early_efi_map_fb); | ||
41 | |||
42 | /* | ||
43 | * early_efi_map maps efi framebuffer region [start, start + len -1] | ||
44 | * In case earlyprintk=efi,keep we have the whole framebuffer mapped already | ||
45 | * so just return the offset efi_fb + start. | ||
46 | */ | ||
47 | static __init_refok void *early_efi_map(unsigned long start, unsigned long len) | ||
48 | { | ||
49 | unsigned long base; | ||
50 | |||
51 | base = boot_params.screen_info.lfb_base; | ||
52 | |||
53 | if (efi_fb) | ||
54 | return (efi_fb + start); | ||
55 | else | ||
56 | return early_ioremap(base + start, len); | ||
57 | } | ||
25 | 58 | ||
26 | dst = early_ioremap(base + y*len, len); | 59 | static __init_refok void early_efi_unmap(void *addr, unsigned long len) |
60 | { | ||
61 | if (!efi_fb) | ||
62 | early_iounmap(addr, len); | ||
63 | } | ||
64 | |||
65 | static void early_efi_clear_scanline(unsigned int y) | ||
66 | { | ||
67 | unsigned long *dst; | ||
68 | u16 len; | ||
69 | |||
70 | len = boot_params.screen_info.lfb_linelength; | ||
71 | dst = early_efi_map(y*len, len); | ||
27 | if (!dst) | 72 | if (!dst) |
28 | return; | 73 | return; |
29 | 74 | ||
30 | memset(dst, 0, len); | 75 | memset(dst, 0, len); |
31 | early_iounmap(dst, len); | 76 | early_efi_unmap(dst, len); |
32 | } | 77 | } |
33 | 78 | ||
34 | static __init void early_efi_scroll_up(void) | 79 | static void early_efi_scroll_up(void) |
35 | { | 80 | { |
36 | unsigned long base, *dst, *src; | 81 | unsigned long *dst, *src; |
37 | u16 len; | 82 | u16 len; |
38 | u32 i, height; | 83 | u32 i, height; |
39 | 84 | ||
40 | base = boot_params.screen_info.lfb_base; | ||
41 | len = boot_params.screen_info.lfb_linelength; | 85 | len = boot_params.screen_info.lfb_linelength; |
42 | height = boot_params.screen_info.lfb_height; | 86 | height = boot_params.screen_info.lfb_height; |
43 | 87 | ||
44 | for (i = 0; i < height - font->height; i++) { | 88 | for (i = 0; i < height - font->height; i++) { |
45 | dst = early_ioremap(base + i*len, len); | 89 | dst = early_efi_map(i*len, len); |
46 | if (!dst) | 90 | if (!dst) |
47 | return; | 91 | return; |
48 | 92 | ||
49 | src = early_ioremap(base + (i + font->height) * len, len); | 93 | src = early_efi_map((i + font->height) * len, len); |
50 | if (!src) { | 94 | if (!src) { |
51 | early_iounmap(dst, len); | 95 | early_efi_unmap(dst, len); |
52 | return; | 96 | return; |
53 | } | 97 | } |
54 | 98 | ||
55 | memmove(dst, src, len); | 99 | memmove(dst, src, len); |
56 | 100 | ||
57 | early_iounmap(src, len); | 101 | early_efi_unmap(src, len); |
58 | early_iounmap(dst, len); | 102 | early_efi_unmap(dst, len); |
59 | } | 103 | } |
60 | } | 104 | } |
61 | 105 | ||
@@ -79,16 +123,14 @@ static void early_efi_write_char(u32 *dst, unsigned char c, unsigned int h) | |||
79 | } | 123 | } |
80 | } | 124 | } |
81 | 125 | ||
82 | static __init void | 126 | static void |
83 | early_efi_write(struct console *con, const char *str, unsigned int num) | 127 | early_efi_write(struct console *con, const char *str, unsigned int num) |
84 | { | 128 | { |
85 | struct screen_info *si; | 129 | struct screen_info *si; |
86 | unsigned long base; | ||
87 | unsigned int len; | 130 | unsigned int len; |
88 | const char *s; | 131 | const char *s; |
89 | void *dst; | 132 | void *dst; |
90 | 133 | ||
91 | base = boot_params.screen_info.lfb_base; | ||
92 | si = &boot_params.screen_info; | 134 | si = &boot_params.screen_info; |
93 | len = si->lfb_linelength; | 135 | len = si->lfb_linelength; |
94 | 136 | ||
@@ -109,7 +151,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num) | |||
109 | for (h = 0; h < font->height; h++) { | 151 | for (h = 0; h < font->height; h++) { |
110 | unsigned int n, x; | 152 | unsigned int n, x; |
111 | 153 | ||
112 | dst = early_ioremap(base + (efi_y + h) * len, len); | 154 | dst = early_efi_map((efi_y + h) * len, len); |
113 | if (!dst) | 155 | if (!dst) |
114 | return; | 156 | return; |
115 | 157 | ||
@@ -123,7 +165,7 @@ early_efi_write(struct console *con, const char *str, unsigned int num) | |||
123 | s++; | 165 | s++; |
124 | } | 166 | } |
125 | 167 | ||
126 | early_iounmap(dst, len); | 168 | early_efi_unmap(dst, len); |
127 | } | 169 | } |
128 | 170 | ||
129 | num -= count; | 171 | num -= count; |
@@ -179,6 +221,9 @@ static __init int early_efi_setup(struct console *con, char *options) | |||
179 | for (i = 0; i < (yres - efi_y) / font->height; i++) | 221 | for (i = 0; i < (yres - efi_y) / font->height; i++) |
180 | early_efi_scroll_up(); | 222 | early_efi_scroll_up(); |
181 | 223 | ||
224 | /* early_console_register will unset CON_BOOT in case ,keep */ | ||
225 | if (!(con->flags & CON_BOOT)) | ||
226 | early_efi_keep = true; | ||
182 | return 0; | 227 | return 0; |
183 | } | 228 | } |
184 | 229 | ||
diff --git a/arch/x86/platform/olpc/olpc-xo1-pm.c b/arch/x86/platform/olpc/olpc-xo1-pm.c index ff0174dda810..a9acde72d4ed 100644 --- a/arch/x86/platform/olpc/olpc-xo1-pm.c +++ b/arch/x86/platform/olpc/olpc-xo1-pm.c | |||
@@ -75,7 +75,7 @@ static int xo1_power_state_enter(suspend_state_t pm_state) | |||
75 | return 0; | 75 | return 0; |
76 | } | 76 | } |
77 | 77 | ||
78 | asmlinkage int xo1_do_sleep(u8 sleep_state) | 78 | asmlinkage __visible int xo1_do_sleep(u8 sleep_state) |
79 | { | 79 | { |
80 | void *pgd_addr = __va(read_cr3()); | 80 | void *pgd_addr = __va(read_cr3()); |
81 | 81 | ||
diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c index 304fca20d96e..35e2bb6c0f37 100644 --- a/arch/x86/power/hibernate_64.c +++ b/arch/x86/power/hibernate_64.c | |||
@@ -23,7 +23,7 @@ | |||
23 | extern __visible const void __nosave_begin, __nosave_end; | 23 | extern __visible const void __nosave_begin, __nosave_end; |
24 | 24 | ||
25 | /* Defined in hibernate_asm_64.S */ | 25 | /* Defined in hibernate_asm_64.S */ |
26 | extern asmlinkage int restore_image(void); | 26 | extern asmlinkage __visible int restore_image(void); |
27 | 27 | ||
28 | /* | 28 | /* |
29 | * Address to jump to in the last phase of restore in order to get to the image | 29 | * Address to jump to in the last phase of restore in order to get to the image |
diff --git a/arch/x86/syscalls/Makefile b/arch/x86/syscalls/Makefile index f325af26107c..3323c2745248 100644 --- a/arch/x86/syscalls/Makefile +++ b/arch/x86/syscalls/Makefile | |||
@@ -54,5 +54,7 @@ syshdr-$(CONFIG_X86_64) += syscalls_64.h | |||
54 | 54 | ||
55 | targets += $(uapisyshdr-y) $(syshdr-y) | 55 | targets += $(uapisyshdr-y) $(syshdr-y) |
56 | 56 | ||
57 | PHONY += all | ||
57 | all: $(addprefix $(uapi)/,$(uapisyshdr-y)) | 58 | all: $(addprefix $(uapi)/,$(uapisyshdr-y)) |
58 | all: $(addprefix $(out)/,$(syshdr-y)) | 59 | all: $(addprefix $(out)/,$(syshdr-y)) |
60 | @: | ||
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index 96bc506ac6de..d6b867921612 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl | |||
@@ -359,3 +359,4 @@ | |||
359 | 350 i386 finit_module sys_finit_module | 359 | 350 i386 finit_module sys_finit_module |
360 | 351 i386 sched_setattr sys_sched_setattr | 360 | 351 i386 sched_setattr sys_sched_setattr |
361 | 352 i386 sched_getattr sys_sched_getattr | 361 | 352 i386 sched_getattr sys_sched_getattr |
362 | 353 i386 renameat2 sys_renameat2 | ||
diff --git a/arch/x86/tools/Makefile b/arch/x86/tools/Makefile index e8120346903b..604a37efd4d5 100644 --- a/arch/x86/tools/Makefile +++ b/arch/x86/tools/Makefile | |||
@@ -40,4 +40,6 @@ $(obj)/insn_sanity.o: $(srctree)/arch/x86/lib/insn.c $(srctree)/arch/x86/lib/ina | |||
40 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include | 40 | HOST_EXTRACFLAGS += -I$(srctree)/tools/include |
41 | hostprogs-y += relocs | 41 | hostprogs-y += relocs |
42 | relocs-objs := relocs_32.o relocs_64.o relocs_common.o | 42 | relocs-objs := relocs_32.o relocs_64.o relocs_common.o |
43 | PHONY += relocs | ||
43 | relocs: $(obj)/relocs | 44 | relocs: $(obj)/relocs |
45 | @: | ||
diff --git a/arch/x86/vdso/vdso-layout.lds.S b/arch/x86/vdso/vdso-layout.lds.S index 2e263f367b13..9df017ab2285 100644 --- a/arch/x86/vdso/vdso-layout.lds.S +++ b/arch/x86/vdso/vdso-layout.lds.S | |||
@@ -9,12 +9,9 @@ SECTIONS | |||
9 | #ifdef BUILD_VDSO32 | 9 | #ifdef BUILD_VDSO32 |
10 | #include <asm/vdso32.h> | 10 | #include <asm/vdso32.h> |
11 | 11 | ||
12 | .hpet_sect : { | 12 | hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); |
13 | hpet_page = . - VDSO_OFFSET(VDSO_HPET_PAGE); | ||
14 | } :text :hpet_sect | ||
15 | 13 | ||
16 | .vvar_sect : { | 14 | vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); |
17 | vvar = . - VDSO_OFFSET(VDSO_VVAR_PAGE); | ||
18 | 15 | ||
19 | /* Place all vvars at the offsets in asm/vvar.h. */ | 16 | /* Place all vvars at the offsets in asm/vvar.h. */ |
20 | #define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset; | 17 | #define EMIT_VVAR(name, offset) vvar_ ## name = vvar + offset; |
@@ -22,7 +19,6 @@ SECTIONS | |||
22 | #include <asm/vvar.h> | 19 | #include <asm/vvar.h> |
23 | #undef __VVAR_KERNEL_LDS | 20 | #undef __VVAR_KERNEL_LDS |
24 | #undef EMIT_VVAR | 21 | #undef EMIT_VVAR |
25 | } :text :vvar_sect | ||
26 | #endif | 22 | #endif |
27 | . = SIZEOF_HEADERS; | 23 | . = SIZEOF_HEADERS; |
28 | 24 | ||
@@ -61,7 +57,12 @@ SECTIONS | |||
61 | */ | 57 | */ |
62 | . = ALIGN(0x100); | 58 | . = ALIGN(0x100); |
63 | 59 | ||
64 | .text : { *(.text*) } :text =0x90909090 | 60 | .text : { *(.text*) } :text =0x90909090, |
61 | |||
62 | /* | ||
63 | * The comma above works around a bug in gold: | ||
64 | * https://sourceware.org/bugzilla/show_bug.cgi?id=16804 | ||
65 | */ | ||
65 | 66 | ||
66 | /DISCARD/ : { | 67 | /DISCARD/ : { |
67 | *(.discard) | 68 | *(.discard) |
@@ -84,8 +85,4 @@ PHDRS | |||
84 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ | 85 | dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ |
85 | note PT_NOTE FLAGS(4); /* PF_R */ | 86 | note PT_NOTE FLAGS(4); /* PF_R */ |
86 | eh_frame_hdr PT_GNU_EH_FRAME; | 87 | eh_frame_hdr PT_GNU_EH_FRAME; |
87 | #ifdef BUILD_VDSO32 | ||
88 | vvar_sect PT_NULL FLAGS(4); /* PF_R */ | ||
89 | hpet_sect PT_NULL FLAGS(4); /* PF_R */ | ||
90 | #endif | ||
91 | } | 88 | } |
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c index 00348980a3a6..e1f220e3ca68 100644 --- a/arch/x86/vdso/vdso32-setup.c +++ b/arch/x86/vdso/vdso32-setup.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #ifdef CONFIG_X86_64 | 39 | #ifdef CONFIG_X86_64 |
40 | #define vdso_enabled sysctl_vsyscall32 | 40 | #define vdso_enabled sysctl_vsyscall32 |
41 | #define arch_setup_additional_pages syscall32_setup_pages | 41 | #define arch_setup_additional_pages syscall32_setup_pages |
42 | extern int sysctl_ldt16; | ||
42 | #endif | 43 | #endif |
43 | 44 | ||
44 | /* | 45 | /* |
@@ -249,6 +250,13 @@ static struct ctl_table abi_table2[] = { | |||
249 | .mode = 0644, | 250 | .mode = 0644, |
250 | .proc_handler = proc_dointvec | 251 | .proc_handler = proc_dointvec |
251 | }, | 252 | }, |
253 | { | ||
254 | .procname = "ldt16", | ||
255 | .data = &sysctl_ldt16, | ||
256 | .maxlen = sizeof(int), | ||
257 | .mode = 0644, | ||
258 | .proc_handler = proc_dointvec | ||
259 | }, | ||
252 | {} | 260 | {} |
253 | }; | 261 | }; |
254 | 262 | ||
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 201d09a7c46b..c34bfc4bbe7f 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1515,7 +1515,7 @@ static void __init xen_pvh_early_guest_init(void) | |||
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | /* First C function to be called on Xen boot */ | 1517 | /* First C function to be called on Xen boot */ |
1518 | asmlinkage void __init xen_start_kernel(void) | 1518 | asmlinkage __visible void __init xen_start_kernel(void) |
1519 | { | 1519 | { |
1520 | struct physdev_set_iopl set_iopl; | 1520 | struct physdev_set_iopl set_iopl; |
1521 | int rc; | 1521 | int rc; |
diff --git a/arch/x86/xen/irq.c b/arch/x86/xen/irq.c index 08f763de26fe..a1207cb6472a 100644 --- a/arch/x86/xen/irq.c +++ b/arch/x86/xen/irq.c | |||
@@ -23,7 +23,7 @@ void xen_force_evtchn_callback(void) | |||
23 | (void)HYPERVISOR_xen_version(0, NULL); | 23 | (void)HYPERVISOR_xen_version(0, NULL); |
24 | } | 24 | } |
25 | 25 | ||
26 | asmlinkage unsigned long xen_save_fl(void) | 26 | asmlinkage __visible unsigned long xen_save_fl(void) |
27 | { | 27 | { |
28 | struct vcpu_info *vcpu; | 28 | struct vcpu_info *vcpu; |
29 | unsigned long flags; | 29 | unsigned long flags; |
@@ -63,7 +63,7 @@ __visible void xen_restore_fl(unsigned long flags) | |||
63 | } | 63 | } |
64 | PV_CALLEE_SAVE_REGS_THUNK(xen_restore_fl); | 64 | PV_CALLEE_SAVE_REGS_THUNK(xen_restore_fl); |
65 | 65 | ||
66 | asmlinkage void xen_irq_disable(void) | 66 | asmlinkage __visible void xen_irq_disable(void) |
67 | { | 67 | { |
68 | /* There's a one instruction preempt window here. We need to | 68 | /* There's a one instruction preempt window here. We need to |
69 | make sure we're don't switch CPUs between getting the vcpu | 69 | make sure we're don't switch CPUs between getting the vcpu |
@@ -74,7 +74,7 @@ asmlinkage void xen_irq_disable(void) | |||
74 | } | 74 | } |
75 | PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable); | 75 | PV_CALLEE_SAVE_REGS_THUNK(xen_irq_disable); |
76 | 76 | ||
77 | asmlinkage void xen_irq_enable(void) | 77 | asmlinkage __visible void xen_irq_enable(void) |
78 | { | 78 | { |
79 | struct vcpu_info *vcpu; | 79 | struct vcpu_info *vcpu; |
80 | 80 | ||
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index a18eadd8bb40..7005974c3ff3 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c | |||
@@ -441,10 +441,11 @@ static int xen_cpu_up(unsigned int cpu, struct task_struct *idle) | |||
441 | irq_ctx_init(cpu); | 441 | irq_ctx_init(cpu); |
442 | #else | 442 | #else |
443 | clear_tsk_thread_flag(idle, TIF_FORK); | 443 | clear_tsk_thread_flag(idle, TIF_FORK); |
444 | #endif | ||
444 | per_cpu(kernel_stack, cpu) = | 445 | per_cpu(kernel_stack, cpu) = |
445 | (unsigned long)task_stack_page(idle) - | 446 | (unsigned long)task_stack_page(idle) - |
446 | KERNEL_STACK_OFFSET + THREAD_SIZE; | 447 | KERNEL_STACK_OFFSET + THREAD_SIZE; |
447 | #endif | 448 | |
448 | xen_setup_runstate_info(cpu); | 449 | xen_setup_runstate_info(cpu); |
449 | xen_setup_timer(cpu); | 450 | xen_setup_timer(cpu); |
450 | xen_init_lock_cpu(cpu); | 451 | xen_init_lock_cpu(cpu); |
diff --git a/arch/x86/xen/spinlock.c b/arch/x86/xen/spinlock.c index 4d3acc34a998..0ba5f3b967f0 100644 --- a/arch/x86/xen/spinlock.c +++ b/arch/x86/xen/spinlock.c | |||
@@ -274,7 +274,7 @@ void __init xen_init_spinlocks(void) | |||
274 | printk(KERN_DEBUG "xen: PV spinlocks disabled\n"); | 274 | printk(KERN_DEBUG "xen: PV spinlocks disabled\n"); |
275 | return; | 275 | return; |
276 | } | 276 | } |
277 | 277 | printk(KERN_DEBUG "xen: PV spinlocks enabled\n"); | |
278 | pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning); | 278 | pv_lock_ops.lock_spinning = PV_CALLEE_SAVE(xen_lock_spinning); |
279 | pv_lock_ops.unlock_kick = xen_unlock_kick; | 279 | pv_lock_ops.unlock_kick = xen_unlock_kick; |
280 | } | 280 | } |
@@ -290,6 +290,9 @@ static __init int xen_init_spinlocks_jump(void) | |||
290 | if (!xen_pvspin) | 290 | if (!xen_pvspin) |
291 | return 0; | 291 | return 0; |
292 | 292 | ||
293 | if (!xen_domain()) | ||
294 | return 0; | ||
295 | |||
293 | static_key_slow_inc(¶virt_ticketlocks_enabled); | 296 | static_key_slow_inc(¶virt_ticketlocks_enabled); |
294 | return 0; | 297 | return 0; |
295 | } | 298 | } |
diff --git a/arch/x86/xen/xen-asm_32.S b/arch/x86/xen/xen-asm_32.S index 33ca6e42a4ca..fd92a64d748e 100644 --- a/arch/x86/xen/xen-asm_32.S +++ b/arch/x86/xen/xen-asm_32.S | |||
@@ -75,6 +75,17 @@ ENDPROC(xen_sysexit) | |||
75 | * stack state in whatever form its in, we keep things simple by only | 75 | * stack state in whatever form its in, we keep things simple by only |
76 | * using a single register which is pushed/popped on the stack. | 76 | * using a single register which is pushed/popped on the stack. |
77 | */ | 77 | */ |
78 | |||
79 | .macro POP_FS | ||
80 | 1: | ||
81 | popw %fs | ||
82 | .pushsection .fixup, "ax" | ||
83 | 2: movw $0, (%esp) | ||
84 | jmp 1b | ||
85 | .popsection | ||
86 | _ASM_EXTABLE(1b,2b) | ||
87 | .endm | ||
88 | |||
78 | ENTRY(xen_iret) | 89 | ENTRY(xen_iret) |
79 | /* test eflags for special cases */ | 90 | /* test eflags for special cases */ |
80 | testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(%esp) | 91 | testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(%esp) |
@@ -83,15 +94,13 @@ ENTRY(xen_iret) | |||
83 | push %eax | 94 | push %eax |
84 | ESP_OFFSET=4 # bytes pushed onto stack | 95 | ESP_OFFSET=4 # bytes pushed onto stack |
85 | 96 | ||
86 | /* | 97 | /* Store vcpu_info pointer for easy access */ |
87 | * Store vcpu_info pointer for easy access. Do it this way to | ||
88 | * avoid having to reload %fs | ||
89 | */ | ||
90 | #ifdef CONFIG_SMP | 98 | #ifdef CONFIG_SMP |
91 | GET_THREAD_INFO(%eax) | 99 | pushw %fs |
92 | movl %ss:TI_cpu(%eax), %eax | 100 | movl $(__KERNEL_PERCPU), %eax |
93 | movl %ss:__per_cpu_offset(,%eax,4), %eax | 101 | movl %eax, %fs |
94 | mov %ss:xen_vcpu(%eax), %eax | 102 | movl %fs:xen_vcpu, %eax |
103 | POP_FS | ||
95 | #else | 104 | #else |
96 | movl %ss:xen_vcpu, %eax | 105 | movl %ss:xen_vcpu, %eax |
97 | #endif | 106 | #endif |
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 02d6d29a63c1..3a617af60d46 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -14,6 +14,7 @@ config XTENSA | |||
14 | select GENERIC_PCI_IOMAP | 14 | select GENERIC_PCI_IOMAP |
15 | select ARCH_WANT_IPC_PARSE_VERSION | 15 | select ARCH_WANT_IPC_PARSE_VERSION |
16 | select ARCH_WANT_OPTIONAL_GPIOLIB | 16 | select ARCH_WANT_OPTIONAL_GPIOLIB |
17 | select BUILDTIME_EXTABLE_SORT | ||
17 | select CLONE_BACKWARDS | 18 | select CLONE_BACKWARDS |
18 | select IRQ_DOMAIN | 19 | select IRQ_DOMAIN |
19 | select HAVE_OPROFILE | 20 | select HAVE_OPROFILE |
@@ -189,6 +190,24 @@ config INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX | |||
189 | 190 | ||
190 | If in doubt, say Y. | 191 | If in doubt, say Y. |
191 | 192 | ||
193 | config HIGHMEM | ||
194 | bool "High Memory Support" | ||
195 | help | ||
196 | Linux can use the full amount of RAM in the system by | ||
197 | default. However, the default MMUv2 setup only maps the | ||
198 | lowermost 128 MB of memory linearly to the areas starting | ||
199 | at 0xd0000000 (cached) and 0xd8000000 (uncached). | ||
200 | When there are more than 128 MB memory in the system not | ||
201 | all of it can be "permanently mapped" by the kernel. | ||
202 | The physical memory that's not permanently mapped is called | ||
203 | "high memory". | ||
204 | |||
205 | If you are compiling a kernel which will never run on a | ||
206 | machine with more than 128 MB total physical RAM, answer | ||
207 | N here. | ||
208 | |||
209 | If unsure, say Y. | ||
210 | |||
192 | endmenu | 211 | endmenu |
193 | 212 | ||
194 | config XTENSA_CALIBRATE_CCOUNT | 213 | config XTENSA_CALIBRATE_CCOUNT |
@@ -224,7 +243,6 @@ choice | |||
224 | 243 | ||
225 | config XTENSA_PLATFORM_ISS | 244 | config XTENSA_PLATFORM_ISS |
226 | bool "ISS" | 245 | bool "ISS" |
227 | depends on TTY | ||
228 | select XTENSA_CALIBRATE_CCOUNT | 246 | select XTENSA_CALIBRATE_CCOUNT |
229 | select SERIAL_CONSOLE | 247 | select SERIAL_CONSOLE |
230 | help | 248 | help |
diff --git a/arch/xtensa/boot/dts/kc705.dts b/arch/xtensa/boot/dts/kc705.dts new file mode 100644 index 000000000000..742a347be67a --- /dev/null +++ b/arch/xtensa/boot/dts/kc705.dts | |||
@@ -0,0 +1,11 @@ | |||
1 | /dts-v1/; | ||
2 | /include/ "xtfpga.dtsi" | ||
3 | /include/ "xtfpga-flash-128m.dtsi" | ||
4 | |||
5 | / { | ||
6 | compatible = "cdns,xtensa-kc705"; | ||
7 | memory@0 { | ||
8 | device_type = "memory"; | ||
9 | reg = <0x00000000 0x08000000>; | ||
10 | }; | ||
11 | }; | ||
diff --git a/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi b/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi new file mode 100644 index 000000000000..d3a88e029873 --- /dev/null +++ b/arch/xtensa/boot/dts/xtfpga-flash-128m.dtsi | |||
@@ -0,0 +1,28 @@ | |||
1 | / { | ||
2 | soc { | ||
3 | flash: flash@00000000 { | ||
4 | #address-cells = <1>; | ||
5 | #size-cells = <1>; | ||
6 | compatible = "cfi-flash"; | ||
7 | reg = <0x00000000 0x08000000>; | ||
8 | bank-width = <2>; | ||
9 | device-width = <2>; | ||
10 | partition@0x0 { | ||
11 | label = "data"; | ||
12 | reg = <0x00000000 0x06000000>; | ||
13 | }; | ||
14 | partition@0x6000000 { | ||
15 | label = "boot loader area"; | ||
16 | reg = <0x06000000 0x00800000>; | ||
17 | }; | ||
18 | partition@0x6800000 { | ||
19 | label = "kernel image"; | ||
20 | reg = <0x06800000 0x017e0000>; | ||
21 | }; | ||
22 | partition@0x7fe0000 { | ||
23 | label = "boot environment"; | ||
24 | reg = <0x07fe0000 0x00020000>; | ||
25 | }; | ||
26 | }; | ||
27 | }; | ||
28 | }; | ||
diff --git a/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi b/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi index e5703c7beeb6..1d97203c18e7 100644 --- a/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi +++ b/arch/xtensa/boot/dts/xtfpga-flash-16m.dtsi | |||
@@ -1,26 +1,28 @@ | |||
1 | / { | 1 | / { |
2 | flash: flash@f8000000 { | 2 | soc { |
3 | #address-cells = <1>; | 3 | flash: flash@08000000 { |
4 | #size-cells = <1>; | 4 | #address-cells = <1>; |
5 | compatible = "cfi-flash"; | 5 | #size-cells = <1>; |
6 | reg = <0xf8000000 0x01000000>; | 6 | compatible = "cfi-flash"; |
7 | bank-width = <2>; | 7 | reg = <0x08000000 0x01000000>; |
8 | device-width = <2>; | 8 | bank-width = <2>; |
9 | partition@0x0 { | 9 | device-width = <2>; |
10 | label = "boot loader area"; | 10 | partition@0x0 { |
11 | reg = <0x00000000 0x00400000>; | 11 | label = "boot loader area"; |
12 | reg = <0x00000000 0x00400000>; | ||
13 | }; | ||
14 | partition@0x400000 { | ||
15 | label = "kernel image"; | ||
16 | reg = <0x00400000 0x00600000>; | ||
17 | }; | ||
18 | partition@0xa00000 { | ||
19 | label = "data"; | ||
20 | reg = <0x00a00000 0x005e0000>; | ||
21 | }; | ||
22 | partition@0xfe0000 { | ||
23 | label = "boot environment"; | ||
24 | reg = <0x00fe0000 0x00020000>; | ||
25 | }; | ||
12 | }; | 26 | }; |
13 | partition@0x400000 { | 27 | }; |
14 | label = "kernel image"; | ||
15 | reg = <0x00400000 0x00600000>; | ||
16 | }; | ||
17 | partition@0xa00000 { | ||
18 | label = "data"; | ||
19 | reg = <0x00a00000 0x005e0000>; | ||
20 | }; | ||
21 | partition@0xfe0000 { | ||
22 | label = "boot environment"; | ||
23 | reg = <0x00fe0000 0x00020000>; | ||
24 | }; | ||
25 | }; | ||
26 | }; | 28 | }; |
diff --git a/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi b/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi index 6f9c10d6b689..d1c621ca8be1 100644 --- a/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi +++ b/arch/xtensa/boot/dts/xtfpga-flash-4m.dtsi | |||
@@ -1,18 +1,20 @@ | |||
1 | / { | 1 | / { |
2 | flash: flash@f8000000 { | 2 | soc { |
3 | #address-cells = <1>; | 3 | flash: flash@08000000 { |
4 | #size-cells = <1>; | 4 | #address-cells = <1>; |
5 | compatible = "cfi-flash"; | 5 | #size-cells = <1>; |
6 | reg = <0xf8000000 0x00400000>; | 6 | compatible = "cfi-flash"; |
7 | bank-width = <2>; | 7 | reg = <0x08000000 0x00400000>; |
8 | device-width = <2>; | 8 | bank-width = <2>; |
9 | partition@0x0 { | 9 | device-width = <2>; |
10 | label = "boot loader area"; | 10 | partition@0x0 { |
11 | reg = <0x00000000 0x003f0000>; | 11 | label = "boot loader area"; |
12 | reg = <0x00000000 0x003f0000>; | ||
13 | }; | ||
14 | partition@0x3f0000 { | ||
15 | label = "boot environment"; | ||
16 | reg = <0x003f0000 0x00010000>; | ||
17 | }; | ||
12 | }; | 18 | }; |
13 | partition@0x3f0000 { | 19 | }; |
14 | label = "boot environment"; | ||
15 | reg = <0x003f0000 0x00010000>; | ||
16 | }; | ||
17 | }; | ||
18 | }; | 20 | }; |
diff --git a/arch/xtensa/boot/dts/xtfpga.dtsi b/arch/xtensa/boot/dts/xtfpga.dtsi index e7370b11348e..dec9178840f6 100644 --- a/arch/xtensa/boot/dts/xtfpga.dtsi +++ b/arch/xtensa/boot/dts/xtfpga.dtsi | |||
@@ -42,21 +42,28 @@ | |||
42 | }; | 42 | }; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | serial0: serial@fd050020 { | 45 | soc { |
46 | device_type = "serial"; | 46 | #address-cells = <1>; |
47 | compatible = "ns16550a"; | 47 | #size-cells = <1>; |
48 | no-loopback-test; | 48 | compatible = "simple-bus"; |
49 | reg = <0xfd050020 0x20>; | 49 | ranges = <0x00000000 0xf0000000 0x10000000>; |
50 | reg-shift = <2>; | ||
51 | interrupts = <0 1>; /* external irq 0 */ | ||
52 | clocks = <&osc>; | ||
53 | }; | ||
54 | 50 | ||
55 | enet0: ethoc@fd030000 { | 51 | serial0: serial@0d050020 { |
56 | compatible = "opencores,ethoc"; | 52 | device_type = "serial"; |
57 | reg = <0xfd030000 0x4000 0xfd800000 0x4000>; | 53 | compatible = "ns16550a"; |
58 | interrupts = <1 1>; /* external irq 1 */ | 54 | no-loopback-test; |
59 | local-mac-address = [00 50 c2 13 6f 00]; | 55 | reg = <0x0d050020 0x20>; |
60 | clocks = <&osc>; | 56 | reg-shift = <2>; |
57 | interrupts = <0 1>; /* external irq 0 */ | ||
58 | clocks = <&osc>; | ||
59 | }; | ||
60 | |||
61 | enet0: ethoc@0d030000 { | ||
62 | compatible = "opencores,ethoc"; | ||
63 | reg = <0x0d030000 0x4000 0x0d800000 0x4000>; | ||
64 | interrupts = <1 1>; /* external irq 1 */ | ||
65 | local-mac-address = [00 50 c2 13 6f 00]; | ||
66 | clocks = <&osc>; | ||
67 | }; | ||
61 | }; | 68 | }; |
62 | }; | 69 | }; |
diff --git a/arch/xtensa/include/asm/bootparam.h b/arch/xtensa/include/asm/bootparam.h index 23392c5630ce..892aab399ac8 100644 --- a/arch/xtensa/include/asm/bootparam.h +++ b/arch/xtensa/include/asm/bootparam.h | |||
@@ -37,23 +37,14 @@ typedef struct bp_tag { | |||
37 | unsigned long data[0]; /* data */ | 37 | unsigned long data[0]; /* data */ |
38 | } bp_tag_t; | 38 | } bp_tag_t; |
39 | 39 | ||
40 | typedef struct meminfo { | 40 | struct bp_meminfo { |
41 | unsigned long type; | 41 | unsigned long type; |
42 | unsigned long start; | 42 | unsigned long start; |
43 | unsigned long end; | 43 | unsigned long end; |
44 | } meminfo_t; | 44 | }; |
45 | |||
46 | #define SYSMEM_BANKS_MAX 5 | ||
47 | 45 | ||
48 | #define MEMORY_TYPE_CONVENTIONAL 0x1000 | 46 | #define MEMORY_TYPE_CONVENTIONAL 0x1000 |
49 | #define MEMORY_TYPE_NONE 0x2000 | 47 | #define MEMORY_TYPE_NONE 0x2000 |
50 | 48 | ||
51 | typedef struct sysmem_info { | ||
52 | int nr_banks; | ||
53 | meminfo_t bank[SYSMEM_BANKS_MAX]; | ||
54 | } sysmem_info_t; | ||
55 | |||
56 | extern sysmem_info_t sysmem; | ||
57 | |||
58 | #endif | 49 | #endif |
59 | #endif | 50 | #endif |
diff --git a/arch/xtensa/include/asm/fixmap.h b/arch/xtensa/include/asm/fixmap.h new file mode 100644 index 000000000000..9f6c33d0428a --- /dev/null +++ b/arch/xtensa/include/asm/fixmap.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * fixmap.h: compile-time virtual memory allocation | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 1998 Ingo Molnar | ||
9 | * | ||
10 | * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 | ||
11 | */ | ||
12 | |||
13 | #ifndef _ASM_FIXMAP_H | ||
14 | #define _ASM_FIXMAP_H | ||
15 | |||
16 | #include <asm/pgtable.h> | ||
17 | #ifdef CONFIG_HIGHMEM | ||
18 | #include <linux/threads.h> | ||
19 | #include <asm/kmap_types.h> | ||
20 | #endif | ||
21 | |||
22 | /* | ||
23 | * Here we define all the compile-time 'special' virtual | ||
24 | * addresses. The point is to have a constant address at | ||
25 | * compile time, but to set the physical address only | ||
26 | * in the boot process. We allocate these special addresses | ||
27 | * from the end of the consistent memory region backwards. | ||
28 | * Also this lets us do fail-safe vmalloc(), we | ||
29 | * can guarantee that these special addresses and | ||
30 | * vmalloc()-ed addresses never overlap. | ||
31 | * | ||
32 | * these 'compile-time allocated' memory buffers are | ||
33 | * fixed-size 4k pages. (or larger if used with an increment | ||
34 | * higher than 1) use fixmap_set(idx,phys) to associate | ||
35 | * physical memory with fixmap indices. | ||
36 | */ | ||
37 | enum fixed_addresses { | ||
38 | #ifdef CONFIG_HIGHMEM | ||
39 | /* reserved pte's for temporary kernel mappings */ | ||
40 | FIX_KMAP_BEGIN, | ||
41 | FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_TYPE_NR * NR_CPUS) - 1, | ||
42 | #endif | ||
43 | __end_of_fixed_addresses | ||
44 | }; | ||
45 | |||
46 | #define FIXADDR_TOP (VMALLOC_START - PAGE_SIZE) | ||
47 | #define FIXADDR_SIZE (__end_of_fixed_addresses << PAGE_SHIFT) | ||
48 | #define FIXADDR_START ((FIXADDR_TOP - FIXADDR_SIZE) & PMD_MASK) | ||
49 | |||
50 | #include <asm-generic/fixmap.h> | ||
51 | |||
52 | #define kmap_get_fixmap_pte(vaddr) \ | ||
53 | pte_offset_kernel( \ | ||
54 | pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)), (vaddr)), \ | ||
55 | (vaddr) \ | ||
56 | ) | ||
57 | |||
58 | #endif | ||
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h index 80be15124697..2653ef5d55f1 100644 --- a/arch/xtensa/include/asm/highmem.h +++ b/arch/xtensa/include/asm/highmem.h | |||
@@ -6,11 +6,54 @@ | |||
6 | * this archive for more details. | 6 | * this archive for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 2003 - 2005 Tensilica Inc. | 8 | * Copyright (C) 2003 - 2005 Tensilica Inc. |
9 | * Copyright (C) 2014 Cadence Design Systems Inc. | ||
9 | */ | 10 | */ |
10 | 11 | ||
11 | #ifndef _XTENSA_HIGHMEM_H | 12 | #ifndef _XTENSA_HIGHMEM_H |
12 | #define _XTENSA_HIGHMEM_H | 13 | #define _XTENSA_HIGHMEM_H |
13 | 14 | ||
14 | extern void flush_cache_kmaps(void); | 15 | #include <asm/cacheflush.h> |
16 | #include <asm/fixmap.h> | ||
17 | #include <asm/kmap_types.h> | ||
18 | #include <asm/pgtable.h> | ||
19 | |||
20 | #define PKMAP_BASE (FIXADDR_START - PMD_SIZE) | ||
21 | #define LAST_PKMAP PTRS_PER_PTE | ||
22 | #define LAST_PKMAP_MASK (LAST_PKMAP - 1) | ||
23 | #define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT) | ||
24 | #define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT)) | ||
25 | |||
26 | #define kmap_prot PAGE_KERNEL | ||
27 | |||
28 | extern pte_t *pkmap_page_table; | ||
29 | |||
30 | void *kmap_high(struct page *page); | ||
31 | void kunmap_high(struct page *page); | ||
32 | |||
33 | static inline void *kmap(struct page *page) | ||
34 | { | ||
35 | BUG_ON(in_interrupt()); | ||
36 | if (!PageHighMem(page)) | ||
37 | return page_address(page); | ||
38 | return kmap_high(page); | ||
39 | } | ||
40 | |||
41 | static inline void kunmap(struct page *page) | ||
42 | { | ||
43 | BUG_ON(in_interrupt()); | ||
44 | if (!PageHighMem(page)) | ||
45 | return; | ||
46 | kunmap_high(page); | ||
47 | } | ||
48 | |||
49 | static inline void flush_cache_kmaps(void) | ||
50 | { | ||
51 | flush_cache_all(); | ||
52 | } | ||
53 | |||
54 | void *kmap_atomic(struct page *page); | ||
55 | void __kunmap_atomic(void *kvaddr); | ||
56 | |||
57 | void kmap_init(void); | ||
15 | 58 | ||
16 | #endif | 59 | #endif |
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 216446295ada..4b0ca35a93b1 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h | |||
@@ -310,6 +310,10 @@ set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) | |||
310 | update_pte(ptep, pteval); | 310 | update_pte(ptep, pteval); |
311 | } | 311 | } |
312 | 312 | ||
313 | static inline void set_pte(pte_t *ptep, pte_t pteval) | ||
314 | { | ||
315 | update_pte(ptep, pteval); | ||
316 | } | ||
313 | 317 | ||
314 | static inline void | 318 | static inline void |
315 | set_pmd(pmd_t *pmdp, pmd_t pmdval) | 319 | set_pmd(pmd_t *pmdp, pmd_t pmdval) |
diff --git a/arch/xtensa/include/asm/sysmem.h b/arch/xtensa/include/asm/sysmem.h new file mode 100644 index 000000000000..c015c5c8e3f7 --- /dev/null +++ b/arch/xtensa/include/asm/sysmem.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * sysmem-related prototypes. | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2014 Cadence Design Systems Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _XTENSA_SYSMEM_H | ||
12 | #define _XTENSA_SYSMEM_H | ||
13 | |||
14 | #define SYSMEM_BANKS_MAX 31 | ||
15 | |||
16 | struct meminfo { | ||
17 | unsigned long start; | ||
18 | unsigned long end; | ||
19 | }; | ||
20 | |||
21 | /* | ||
22 | * Bank array is sorted by .start. | ||
23 | * Banks don't overlap and there's at least one page gap | ||
24 | * between adjacent bank entries. | ||
25 | */ | ||
26 | struct sysmem_info { | ||
27 | int nr_banks; | ||
28 | struct meminfo bank[SYSMEM_BANKS_MAX]; | ||
29 | }; | ||
30 | |||
31 | extern struct sysmem_info sysmem; | ||
32 | |||
33 | int add_sysmem_bank(unsigned long start, unsigned long end); | ||
34 | int mem_reserve(unsigned long, unsigned long, int); | ||
35 | void bootmem_init(void); | ||
36 | void zones_init(void); | ||
37 | |||
38 | #endif /* _XTENSA_SYSMEM_H */ | ||
diff --git a/arch/xtensa/include/asm/tlbflush.h b/arch/xtensa/include/asm/tlbflush.h index fc34274ce41b..06875feb27c2 100644 --- a/arch/xtensa/include/asm/tlbflush.h +++ b/arch/xtensa/include/asm/tlbflush.h | |||
@@ -36,6 +36,7 @@ void local_flush_tlb_page(struct vm_area_struct *vma, | |||
36 | unsigned long page); | 36 | unsigned long page); |
37 | void local_flush_tlb_range(struct vm_area_struct *vma, | 37 | void local_flush_tlb_range(struct vm_area_struct *vma, |
38 | unsigned long start, unsigned long end); | 38 | unsigned long start, unsigned long end); |
39 | void local_flush_tlb_kernel_range(unsigned long start, unsigned long end); | ||
39 | 40 | ||
40 | #ifdef CONFIG_SMP | 41 | #ifdef CONFIG_SMP |
41 | 42 | ||
@@ -44,12 +45,7 @@ void flush_tlb_mm(struct mm_struct *); | |||
44 | void flush_tlb_page(struct vm_area_struct *, unsigned long); | 45 | void flush_tlb_page(struct vm_area_struct *, unsigned long); |
45 | void flush_tlb_range(struct vm_area_struct *, unsigned long, | 46 | void flush_tlb_range(struct vm_area_struct *, unsigned long, |
46 | unsigned long); | 47 | unsigned long); |
47 | 48 | void flush_tlb_kernel_range(unsigned long start, unsigned long end); | |
48 | static inline void flush_tlb_kernel_range(unsigned long start, | ||
49 | unsigned long end) | ||
50 | { | ||
51 | flush_tlb_all(); | ||
52 | } | ||
53 | 49 | ||
54 | #else /* !CONFIG_SMP */ | 50 | #else /* !CONFIG_SMP */ |
55 | 51 | ||
@@ -58,7 +54,8 @@ static inline void flush_tlb_kernel_range(unsigned long start, | |||
58 | #define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page) | 54 | #define flush_tlb_page(vma, page) local_flush_tlb_page(vma, page) |
59 | #define flush_tlb_range(vma, vmaddr, end) local_flush_tlb_range(vma, vmaddr, \ | 55 | #define flush_tlb_range(vma, vmaddr, end) local_flush_tlb_range(vma, vmaddr, \ |
60 | end) | 56 | end) |
61 | #define flush_tlb_kernel_range(start, end) local_flush_tlb_all() | 57 | #define flush_tlb_kernel_range(start, end) local_flush_tlb_kernel_range(start, \ |
58 | end) | ||
62 | 59 | ||
63 | #endif /* CONFIG_SMP */ | 60 | #endif /* CONFIG_SMP */ |
64 | 61 | ||
diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c index 84fe931bb60e..9757bb74e532 100644 --- a/arch/xtensa/kernel/setup.c +++ b/arch/xtensa/kernel/setup.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <asm/param.h> | 50 | #include <asm/param.h> |
51 | #include <asm/traps.h> | 51 | #include <asm/traps.h> |
52 | #include <asm/smp.h> | 52 | #include <asm/smp.h> |
53 | #include <asm/sysmem.h> | ||
53 | 54 | ||
54 | #include <platform/hardware.h> | 55 | #include <platform/hardware.h> |
55 | 56 | ||
@@ -88,12 +89,6 @@ static char __initdata command_line[COMMAND_LINE_SIZE]; | |||
88 | static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; | 89 | static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE; |
89 | #endif | 90 | #endif |
90 | 91 | ||
91 | sysmem_info_t __initdata sysmem; | ||
92 | |||
93 | extern int mem_reserve(unsigned long, unsigned long, int); | ||
94 | extern void bootmem_init(void); | ||
95 | extern void zones_init(void); | ||
96 | |||
97 | /* | 92 | /* |
98 | * Boot parameter parsing. | 93 | * Boot parameter parsing. |
99 | * | 94 | * |
@@ -113,31 +108,14 @@ typedef struct tagtable { | |||
113 | 108 | ||
114 | /* parse current tag */ | 109 | /* parse current tag */ |
115 | 110 | ||
116 | static int __init add_sysmem_bank(unsigned long type, unsigned long start, | ||
117 | unsigned long end) | ||
118 | { | ||
119 | if (sysmem.nr_banks >= SYSMEM_BANKS_MAX) { | ||
120 | printk(KERN_WARNING | ||
121 | "Ignoring memory bank 0x%08lx size %ldKB\n", | ||
122 | start, end - start); | ||
123 | return -EINVAL; | ||
124 | } | ||
125 | sysmem.bank[sysmem.nr_banks].type = type; | ||
126 | sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(start); | ||
127 | sysmem.bank[sysmem.nr_banks].end = end & PAGE_MASK; | ||
128 | sysmem.nr_banks++; | ||
129 | |||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | static int __init parse_tag_mem(const bp_tag_t *tag) | 111 | static int __init parse_tag_mem(const bp_tag_t *tag) |
134 | { | 112 | { |
135 | meminfo_t *mi = (meminfo_t *)(tag->data); | 113 | struct bp_meminfo *mi = (struct bp_meminfo *)(tag->data); |
136 | 114 | ||
137 | if (mi->type != MEMORY_TYPE_CONVENTIONAL) | 115 | if (mi->type != MEMORY_TYPE_CONVENTIONAL) |
138 | return -1; | 116 | return -1; |
139 | 117 | ||
140 | return add_sysmem_bank(mi->type, mi->start, mi->end); | 118 | return add_sysmem_bank(mi->start, mi->end); |
141 | } | 119 | } |
142 | 120 | ||
143 | __tagtable(BP_TAG_MEMORY, parse_tag_mem); | 121 | __tagtable(BP_TAG_MEMORY, parse_tag_mem); |
@@ -146,8 +124,8 @@ __tagtable(BP_TAG_MEMORY, parse_tag_mem); | |||
146 | 124 | ||
147 | static int __init parse_tag_initrd(const bp_tag_t* tag) | 125 | static int __init parse_tag_initrd(const bp_tag_t* tag) |
148 | { | 126 | { |
149 | meminfo_t* mi; | 127 | struct bp_meminfo *mi = (struct bp_meminfo *)(tag->data); |
150 | mi = (meminfo_t*)(tag->data); | 128 | |
151 | initrd_start = (unsigned long)__va(mi->start); | 129 | initrd_start = (unsigned long)__va(mi->start); |
152 | initrd_end = (unsigned long)__va(mi->end); | 130 | initrd_end = (unsigned long)__va(mi->end); |
153 | 131 | ||
@@ -255,7 +233,7 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) | |||
255 | return; | 233 | return; |
256 | 234 | ||
257 | size &= PAGE_MASK; | 235 | size &= PAGE_MASK; |
258 | add_sysmem_bank(MEMORY_TYPE_CONVENTIONAL, base, base + size); | 236 | add_sysmem_bank(base, base + size); |
259 | } | 237 | } |
260 | 238 | ||
261 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | 239 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) |
@@ -292,8 +270,6 @@ device_initcall(xtensa_device_probe); | |||
292 | 270 | ||
293 | void __init init_arch(bp_tag_t *bp_start) | 271 | void __init init_arch(bp_tag_t *bp_start) |
294 | { | 272 | { |
295 | sysmem.nr_banks = 0; | ||
296 | |||
297 | /* Parse boot parameters */ | 273 | /* Parse boot parameters */ |
298 | 274 | ||
299 | if (bp_start) | 275 | if (bp_start) |
@@ -304,10 +280,9 @@ void __init init_arch(bp_tag_t *bp_start) | |||
304 | #endif | 280 | #endif |
305 | 281 | ||
306 | if (sysmem.nr_banks == 0) { | 282 | if (sysmem.nr_banks == 0) { |
307 | sysmem.nr_banks = 1; | 283 | add_sysmem_bank(PLATFORM_DEFAULT_MEM_START, |
308 | sysmem.bank[0].start = PLATFORM_DEFAULT_MEM_START; | 284 | PLATFORM_DEFAULT_MEM_START + |
309 | sysmem.bank[0].end = PLATFORM_DEFAULT_MEM_START | 285 | PLATFORM_DEFAULT_MEM_SIZE); |
310 | + PLATFORM_DEFAULT_MEM_SIZE; | ||
311 | } | 286 | } |
312 | 287 | ||
313 | #ifdef CONFIG_CMDLINE_BOOL | 288 | #ifdef CONFIG_CMDLINE_BOOL |
@@ -487,7 +462,7 @@ void __init setup_arch(char **cmdline_p) | |||
487 | #ifdef CONFIG_BLK_DEV_INITRD | 462 | #ifdef CONFIG_BLK_DEV_INITRD |
488 | if (initrd_start < initrd_end) { | 463 | if (initrd_start < initrd_end) { |
489 | initrd_is_mapped = mem_reserve(__pa(initrd_start), | 464 | initrd_is_mapped = mem_reserve(__pa(initrd_start), |
490 | __pa(initrd_end), 0); | 465 | __pa(initrd_end), 0) == 0; |
491 | initrd_below_start_ok = 1; | 466 | initrd_below_start_ok = 1; |
492 | } else { | 467 | } else { |
493 | initrd_start = 0; | 468 | initrd_start = 0; |
@@ -532,6 +507,7 @@ void __init setup_arch(char **cmdline_p) | |||
532 | __pa(&_Level6InterruptVector_text_end), 0); | 507 | __pa(&_Level6InterruptVector_text_end), 0); |
533 | #endif | 508 | #endif |
534 | 509 | ||
510 | parse_early_param(); | ||
535 | bootmem_init(); | 511 | bootmem_init(); |
536 | 512 | ||
537 | unflatten_and_copy_device_tree(); | 513 | unflatten_and_copy_device_tree(); |
diff --git a/arch/xtensa/kernel/smp.c b/arch/xtensa/kernel/smp.c index aa8bd8717927..40b5a3771fb0 100644 --- a/arch/xtensa/kernel/smp.c +++ b/arch/xtensa/kernel/smp.c | |||
@@ -496,6 +496,21 @@ void flush_tlb_range(struct vm_area_struct *vma, | |||
496 | on_each_cpu(ipi_flush_tlb_range, &fd, 1); | 496 | on_each_cpu(ipi_flush_tlb_range, &fd, 1); |
497 | } | 497 | } |
498 | 498 | ||
499 | static void ipi_flush_tlb_kernel_range(void *arg) | ||
500 | { | ||
501 | struct flush_data *fd = arg; | ||
502 | local_flush_tlb_kernel_range(fd->addr1, fd->addr2); | ||
503 | } | ||
504 | |||
505 | void flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
506 | { | ||
507 | struct flush_data fd = { | ||
508 | .addr1 = start, | ||
509 | .addr2 = end, | ||
510 | }; | ||
511 | on_each_cpu(ipi_flush_tlb_kernel_range, &fd, 1); | ||
512 | } | ||
513 | |||
499 | /* Cache flush functions */ | 514 | /* Cache flush functions */ |
500 | 515 | ||
501 | static void ipi_flush_cache_all(void *arg) | 516 | static void ipi_flush_cache_all(void *arg) |
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index 80b33ed51f31..4d2872fd9bb5 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/in6.h> | 20 | #include <linux/in6.h> |
21 | 21 | ||
22 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
23 | #include <asm/cacheflush.h> | ||
23 | #include <asm/checksum.h> | 24 | #include <asm/checksum.h> |
24 | #include <asm/dma.h> | 25 | #include <asm/dma.h> |
25 | #include <asm/io.h> | 26 | #include <asm/io.h> |
@@ -105,6 +106,7 @@ EXPORT_SYMBOL(csum_partial_copy_generic); | |||
105 | * Architecture-specific symbols | 106 | * Architecture-specific symbols |
106 | */ | 107 | */ |
107 | EXPORT_SYMBOL(__xtensa_copy_user); | 108 | EXPORT_SYMBOL(__xtensa_copy_user); |
109 | EXPORT_SYMBOL(__invalidate_icache_range); | ||
108 | 110 | ||
109 | /* | 111 | /* |
110 | * Kernel hacking ... | 112 | * Kernel hacking ... |
@@ -127,3 +129,8 @@ EXPORT_SYMBOL(common_exception_return); | |||
127 | #ifdef CONFIG_FUNCTION_TRACER | 129 | #ifdef CONFIG_FUNCTION_TRACER |
128 | EXPORT_SYMBOL(_mcount); | 130 | EXPORT_SYMBOL(_mcount); |
129 | #endif | 131 | #endif |
132 | |||
133 | EXPORT_SYMBOL(__invalidate_dcache_range); | ||
134 | #if XCHAL_DCACHE_IS_WRITEBACK | ||
135 | EXPORT_SYMBOL(__flush_dcache_range); | ||
136 | #endif | ||
diff --git a/arch/xtensa/mm/Makefile b/arch/xtensa/mm/Makefile index f0b646d2f843..f54f78e24d7b 100644 --- a/arch/xtensa/mm/Makefile +++ b/arch/xtensa/mm/Makefile | |||
@@ -4,3 +4,4 @@ | |||
4 | 4 | ||
5 | obj-y := init.o cache.o misc.o | 5 | obj-y := init.o cache.o misc.o |
6 | obj-$(CONFIG_MMU) += fault.o mmu.o tlb.o | 6 | obj-$(CONFIG_MMU) += fault.o mmu.o tlb.o |
7 | obj-$(CONFIG_HIGHMEM) += highmem.o | ||
diff --git a/arch/xtensa/mm/cache.c b/arch/xtensa/mm/cache.c index ba4c47f291b1..63cbb867dadd 100644 --- a/arch/xtensa/mm/cache.c +++ b/arch/xtensa/mm/cache.c | |||
@@ -59,6 +59,10 @@ | |||
59 | * | 59 | * |
60 | */ | 60 | */ |
61 | 61 | ||
62 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) && defined(CONFIG_HIGHMEM) | ||
63 | #error "HIGHMEM is not supported on cores with aliasing cache." | ||
64 | #endif | ||
65 | |||
62 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK | 66 | #if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK |
63 | 67 | ||
64 | /* | 68 | /* |
@@ -179,10 +183,11 @@ update_mmu_cache(struct vm_area_struct * vma, unsigned long addr, pte_t *ptep) | |||
179 | #else | 183 | #else |
180 | if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags) | 184 | if (!PageReserved(page) && !test_bit(PG_arch_1, &page->flags) |
181 | && (vma->vm_flags & VM_EXEC) != 0) { | 185 | && (vma->vm_flags & VM_EXEC) != 0) { |
182 | unsigned long paddr = (unsigned long) page_address(page); | 186 | unsigned long paddr = (unsigned long)kmap_atomic(page); |
183 | __flush_dcache_page(paddr); | 187 | __flush_dcache_page(paddr); |
184 | __invalidate_icache_page(paddr); | 188 | __invalidate_icache_page(paddr); |
185 | set_bit(PG_arch_1, &page->flags); | 189 | set_bit(PG_arch_1, &page->flags); |
190 | kunmap_atomic((void *)paddr); | ||
186 | } | 191 | } |
187 | #endif | 192 | #endif |
188 | } | 193 | } |
diff --git a/arch/xtensa/mm/highmem.c b/arch/xtensa/mm/highmem.c new file mode 100644 index 000000000000..17a8c0d6fd17 --- /dev/null +++ b/arch/xtensa/mm/highmem.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * High memory support for Xtensa architecture | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General | ||
5 | * Public License. See the file "COPYING" in the main directory of | ||
6 | * this archive for more details. | ||
7 | * | ||
8 | * Copyright (C) 2014 Cadence Design Systems Inc. | ||
9 | */ | ||
10 | |||
11 | #include <linux/export.h> | ||
12 | #include <linux/highmem.h> | ||
13 | #include <asm/tlbflush.h> | ||
14 | |||
15 | static pte_t *kmap_pte; | ||
16 | |||
17 | void *kmap_atomic(struct page *page) | ||
18 | { | ||
19 | enum fixed_addresses idx; | ||
20 | unsigned long vaddr; | ||
21 | int type; | ||
22 | |||
23 | pagefault_disable(); | ||
24 | if (!PageHighMem(page)) | ||
25 | return page_address(page); | ||
26 | |||
27 | type = kmap_atomic_idx_push(); | ||
28 | idx = type + KM_TYPE_NR * smp_processor_id(); | ||
29 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | ||
30 | #ifdef CONFIG_DEBUG_HIGHMEM | ||
31 | BUG_ON(!pte_none(*(kmap_pte - idx))); | ||
32 | #endif | ||
33 | set_pte(kmap_pte - idx, mk_pte(page, PAGE_KERNEL_EXEC)); | ||
34 | |||
35 | return (void *)vaddr; | ||
36 | } | ||
37 | EXPORT_SYMBOL(kmap_atomic); | ||
38 | |||
39 | void __kunmap_atomic(void *kvaddr) | ||
40 | { | ||
41 | int idx, type; | ||
42 | |||
43 | if (kvaddr >= (void *)FIXADDR_START && | ||
44 | kvaddr < (void *)FIXADDR_TOP) { | ||
45 | type = kmap_atomic_idx(); | ||
46 | idx = type + KM_TYPE_NR * smp_processor_id(); | ||
47 | |||
48 | /* | ||
49 | * Force other mappings to Oops if they'll try to access this | ||
50 | * pte without first remap it. Keeping stale mappings around | ||
51 | * is a bad idea also, in case the page changes cacheability | ||
52 | * attributes or becomes a protected page in a hypervisor. | ||
53 | */ | ||
54 | pte_clear(&init_mm, kvaddr, kmap_pte - idx); | ||
55 | local_flush_tlb_kernel_range((unsigned long)kvaddr, | ||
56 | (unsigned long)kvaddr + PAGE_SIZE); | ||
57 | |||
58 | kmap_atomic_idx_pop(); | ||
59 | } | ||
60 | |||
61 | pagefault_enable(); | ||
62 | } | ||
63 | EXPORT_SYMBOL(__kunmap_atomic); | ||
64 | |||
65 | void __init kmap_init(void) | ||
66 | { | ||
67 | unsigned long kmap_vstart; | ||
68 | |||
69 | /* cache the first kmap pte */ | ||
70 | kmap_vstart = __fix_to_virt(FIX_KMAP_BEGIN); | ||
71 | kmap_pte = kmap_get_fixmap_pte(kmap_vstart); | ||
72 | } | ||
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c index aff108df92d3..4224256bb215 100644 --- a/arch/xtensa/mm/init.c +++ b/arch/xtensa/mm/init.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | * | 9 | * |
10 | * Copyright (C) 2001 - 2005 Tensilica Inc. | 10 | * Copyright (C) 2001 - 2005 Tensilica Inc. |
11 | * Copyright (C) 2014 Cadence Design Systems Inc. | ||
11 | * | 12 | * |
12 | * Chris Zankel <chris@zankel.net> | 13 | * Chris Zankel <chris@zankel.net> |
13 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> | 14 | * Joe Taylor <joe@tensilica.com, joetylr@yahoo.com> |
@@ -19,6 +20,7 @@ | |||
19 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
20 | #include <linux/bootmem.h> | 21 | #include <linux/bootmem.h> |
21 | #include <linux/gfp.h> | 22 | #include <linux/gfp.h> |
23 | #include <linux/highmem.h> | ||
22 | #include <linux/swap.h> | 24 | #include <linux/swap.h> |
23 | #include <linux/mman.h> | 25 | #include <linux/mman.h> |
24 | #include <linux/nodemask.h> | 26 | #include <linux/nodemask.h> |
@@ -27,11 +29,133 @@ | |||
27 | #include <asm/bootparam.h> | 29 | #include <asm/bootparam.h> |
28 | #include <asm/page.h> | 30 | #include <asm/page.h> |
29 | #include <asm/sections.h> | 31 | #include <asm/sections.h> |
32 | #include <asm/sysmem.h> | ||
33 | |||
34 | struct sysmem_info sysmem __initdata; | ||
35 | |||
36 | static void __init sysmem_dump(void) | ||
37 | { | ||
38 | unsigned i; | ||
39 | |||
40 | pr_debug("Sysmem:\n"); | ||
41 | for (i = 0; i < sysmem.nr_banks; ++i) | ||
42 | pr_debug(" 0x%08lx - 0x%08lx (%ldK)\n", | ||
43 | sysmem.bank[i].start, sysmem.bank[i].end, | ||
44 | (sysmem.bank[i].end - sysmem.bank[i].start) >> 10); | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * Find bank with maximal .start such that bank.start <= start | ||
49 | */ | ||
50 | static inline struct meminfo * __init find_bank(unsigned long start) | ||
51 | { | ||
52 | unsigned i; | ||
53 | struct meminfo *it = NULL; | ||
54 | |||
55 | for (i = 0; i < sysmem.nr_banks; ++i) | ||
56 | if (sysmem.bank[i].start <= start) | ||
57 | it = sysmem.bank + i; | ||
58 | else | ||
59 | break; | ||
60 | return it; | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * Move all memory banks starting at 'from' to a new place at 'to', | ||
65 | * adjust nr_banks accordingly. | ||
66 | * Both 'from' and 'to' must be inside the sysmem.bank. | ||
67 | * | ||
68 | * Returns: 0 (success), -ENOMEM (not enough space in the sysmem.bank). | ||
69 | */ | ||
70 | static int __init move_banks(struct meminfo *to, struct meminfo *from) | ||
71 | { | ||
72 | unsigned n = sysmem.nr_banks - (from - sysmem.bank); | ||
73 | |||
74 | if (to > from && to - from + sysmem.nr_banks > SYSMEM_BANKS_MAX) | ||
75 | return -ENOMEM; | ||
76 | if (to != from) | ||
77 | memmove(to, from, n * sizeof(struct meminfo)); | ||
78 | sysmem.nr_banks += to - from; | ||
79 | return 0; | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * Add new bank to sysmem. Resulting sysmem is the union of bytes of the | ||
84 | * original sysmem and the new bank. | ||
85 | * | ||
86 | * Returns: 0 (success), < 0 (error) | ||
87 | */ | ||
88 | int __init add_sysmem_bank(unsigned long start, unsigned long end) | ||
89 | { | ||
90 | unsigned i; | ||
91 | struct meminfo *it = NULL; | ||
92 | unsigned long sz; | ||
93 | unsigned long bank_sz = 0; | ||
94 | |||
95 | if (start == end || | ||
96 | (start < end) != (PAGE_ALIGN(start) < (end & PAGE_MASK))) { | ||
97 | pr_warn("Ignoring small memory bank 0x%08lx size: %ld bytes\n", | ||
98 | start, end - start); | ||
99 | return -EINVAL; | ||
100 | } | ||
101 | |||
102 | start = PAGE_ALIGN(start); | ||
103 | end &= PAGE_MASK; | ||
104 | sz = end - start; | ||
105 | |||
106 | it = find_bank(start); | ||
107 | |||
108 | if (it) | ||
109 | bank_sz = it->end - it->start; | ||
110 | |||
111 | if (it && bank_sz >= start - it->start) { | ||
112 | if (end - it->start > bank_sz) | ||
113 | it->end = end; | ||
114 | else | ||
115 | return 0; | ||
116 | } else { | ||
117 | if (!it) | ||
118 | it = sysmem.bank; | ||
119 | else | ||
120 | ++it; | ||
121 | |||
122 | if (it - sysmem.bank < sysmem.nr_banks && | ||
123 | it->start - start <= sz) { | ||
124 | it->start = start; | ||
125 | if (it->end - it->start < sz) | ||
126 | it->end = end; | ||
127 | else | ||
128 | return 0; | ||
129 | } else { | ||
130 | if (move_banks(it + 1, it) < 0) { | ||
131 | pr_warn("Ignoring memory bank 0x%08lx size %ld bytes\n", | ||
132 | start, end - start); | ||
133 | return -EINVAL; | ||
134 | } | ||
135 | it->start = start; | ||
136 | it->end = end; | ||
137 | return 0; | ||
138 | } | ||
139 | } | ||
140 | sz = it->end - it->start; | ||
141 | for (i = it + 1 - sysmem.bank; i < sysmem.nr_banks; ++i) | ||
142 | if (sysmem.bank[i].start - it->start <= sz) { | ||
143 | if (sz < sysmem.bank[i].end - it->start) | ||
144 | it->end = sysmem.bank[i].end; | ||
145 | } else { | ||
146 | break; | ||
147 | } | ||
148 | |||
149 | move_banks(it + 1, sysmem.bank + i); | ||
150 | return 0; | ||
151 | } | ||
30 | 152 | ||
31 | /* | 153 | /* |
32 | * mem_reserve(start, end, must_exist) | 154 | * mem_reserve(start, end, must_exist) |
33 | * | 155 | * |
34 | * Reserve some memory from the memory pool. | 156 | * Reserve some memory from the memory pool. |
157 | * If must_exist is set and a part of the region being reserved does not exist | ||
158 | * memory map is not altered. | ||
35 | * | 159 | * |
36 | * Parameters: | 160 | * Parameters: |
37 | * start Start of region, | 161 | * start Start of region, |
@@ -39,53 +163,69 @@ | |||
39 | * must_exist Must exist in memory pool. | 163 | * must_exist Must exist in memory pool. |
40 | * | 164 | * |
41 | * Returns: | 165 | * Returns: |
42 | * 0 (memory area couldn't be mapped) | 166 | * 0 (success) |
43 | * -1 (success) | 167 | * < 0 (error) |
44 | */ | 168 | */ |
45 | 169 | ||
46 | int __init mem_reserve(unsigned long start, unsigned long end, int must_exist) | 170 | int __init mem_reserve(unsigned long start, unsigned long end, int must_exist) |
47 | { | 171 | { |
48 | int i; | 172 | struct meminfo *it; |
49 | 173 | struct meminfo *rm = NULL; | |
50 | if (start == end) | 174 | unsigned long sz; |
51 | return 0; | 175 | unsigned long bank_sz = 0; |
52 | 176 | ||
53 | start = start & PAGE_MASK; | 177 | start = start & PAGE_MASK; |
54 | end = PAGE_ALIGN(end); | 178 | end = PAGE_ALIGN(end); |
179 | sz = end - start; | ||
180 | if (!sz) | ||
181 | return -EINVAL; | ||
55 | 182 | ||
56 | for (i = 0; i < sysmem.nr_banks; i++) | 183 | it = find_bank(start); |
57 | if (start < sysmem.bank[i].end | 184 | |
58 | && end >= sysmem.bank[i].start) | 185 | if (it) |
59 | break; | 186 | bank_sz = it->end - it->start; |
60 | 187 | ||
61 | if (i == sysmem.nr_banks) { | 188 | if ((!it || end - it->start > bank_sz) && must_exist) { |
62 | if (must_exist) | 189 | pr_warn("mem_reserve: [0x%0lx, 0x%0lx) not in any region!\n", |
63 | printk (KERN_WARNING "mem_reserve: [0x%0lx, 0x%0lx) " | 190 | start, end); |
64 | "not in any region!\n", start, end); | 191 | return -EINVAL; |
65 | return 0; | ||
66 | } | 192 | } |
67 | 193 | ||
68 | if (start > sysmem.bank[i].start) { | 194 | if (it && start - it->start < bank_sz) { |
69 | if (end < sysmem.bank[i].end) { | 195 | if (start == it->start) { |
70 | /* split entry */ | 196 | if (end - it->start < bank_sz) { |
71 | if (sysmem.nr_banks >= SYSMEM_BANKS_MAX) | 197 | it->start = end; |
72 | panic("meminfo overflow\n"); | 198 | return 0; |
73 | sysmem.bank[sysmem.nr_banks].start = end; | 199 | } else { |
74 | sysmem.bank[sysmem.nr_banks].end = sysmem.bank[i].end; | 200 | rm = it; |
75 | sysmem.nr_banks++; | 201 | } |
202 | } else { | ||
203 | it->end = start; | ||
204 | if (end - it->start < bank_sz) | ||
205 | return add_sysmem_bank(end, | ||
206 | it->start + bank_sz); | ||
207 | ++it; | ||
76 | } | 208 | } |
77 | sysmem.bank[i].end = start; | 209 | } |
78 | 210 | ||
79 | } else if (end < sysmem.bank[i].end) { | 211 | if (!it) |
80 | sysmem.bank[i].start = end; | 212 | it = sysmem.bank; |
81 | 213 | ||
82 | } else { | 214 | for (; it < sysmem.bank + sysmem.nr_banks; ++it) { |
83 | /* remove entry */ | 215 | if (it->end - start <= sz) { |
84 | sysmem.nr_banks--; | 216 | if (!rm) |
85 | sysmem.bank[i].start = sysmem.bank[sysmem.nr_banks].start; | 217 | rm = it; |
86 | sysmem.bank[i].end = sysmem.bank[sysmem.nr_banks].end; | 218 | } else { |
219 | if (it->start - start < sz) | ||
220 | it->start = end; | ||
221 | break; | ||
222 | } | ||
87 | } | 223 | } |
88 | return -1; | 224 | |
225 | if (rm) | ||
226 | move_banks(rm, it); | ||
227 | |||
228 | return 0; | ||
89 | } | 229 | } |
90 | 230 | ||
91 | 231 | ||
@@ -99,6 +239,7 @@ void __init bootmem_init(void) | |||
99 | unsigned long bootmap_start, bootmap_size; | 239 | unsigned long bootmap_start, bootmap_size; |
100 | int i; | 240 | int i; |
101 | 241 | ||
242 | sysmem_dump(); | ||
102 | max_low_pfn = max_pfn = 0; | 243 | max_low_pfn = max_pfn = 0; |
103 | min_low_pfn = ~0; | 244 | min_low_pfn = ~0; |
104 | 245 | ||
@@ -156,19 +297,13 @@ void __init bootmem_init(void) | |||
156 | 297 | ||
157 | void __init zones_init(void) | 298 | void __init zones_init(void) |
158 | { | 299 | { |
159 | unsigned long zones_size[MAX_NR_ZONES]; | ||
160 | int i; | ||
161 | |||
162 | /* All pages are DMA-able, so we put them all in the DMA zone. */ | 300 | /* All pages are DMA-able, so we put them all in the DMA zone. */ |
163 | 301 | unsigned long zones_size[MAX_NR_ZONES] = { | |
164 | zones_size[ZONE_DMA] = max_low_pfn - ARCH_PFN_OFFSET; | 302 | [ZONE_DMA] = max_low_pfn - ARCH_PFN_OFFSET, |
165 | for (i = 1; i < MAX_NR_ZONES; i++) | ||
166 | zones_size[i] = 0; | ||
167 | |||
168 | #ifdef CONFIG_HIGHMEM | 303 | #ifdef CONFIG_HIGHMEM |
169 | zones_size[ZONE_HIGHMEM] = max_pfn - max_low_pfn; | 304 | [ZONE_HIGHMEM] = max_pfn - max_low_pfn, |
170 | #endif | 305 | #endif |
171 | 306 | }; | |
172 | free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL); | 307 | free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL); |
173 | } | 308 | } |
174 | 309 | ||
@@ -178,16 +313,38 @@ void __init zones_init(void) | |||
178 | 313 | ||
179 | void __init mem_init(void) | 314 | void __init mem_init(void) |
180 | { | 315 | { |
181 | max_mapnr = max_low_pfn - ARCH_PFN_OFFSET; | ||
182 | high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT); | ||
183 | |||
184 | #ifdef CONFIG_HIGHMEM | 316 | #ifdef CONFIG_HIGHMEM |
185 | #error HIGHGMEM not implemented in init.c | 317 | unsigned long tmp; |
318 | |||
319 | reset_all_zones_managed_pages(); | ||
320 | for (tmp = max_low_pfn; tmp < max_pfn; tmp++) | ||
321 | free_highmem_page(pfn_to_page(tmp)); | ||
186 | #endif | 322 | #endif |
187 | 323 | ||
324 | max_mapnr = max_pfn - ARCH_PFN_OFFSET; | ||
325 | high_memory = (void *)__va(max_low_pfn << PAGE_SHIFT); | ||
326 | |||
188 | free_all_bootmem(); | 327 | free_all_bootmem(); |
189 | 328 | ||
190 | mem_init_print_info(NULL); | 329 | mem_init_print_info(NULL); |
330 | pr_info("virtual kernel memory layout:\n" | ||
331 | #ifdef CONFIG_HIGHMEM | ||
332 | " pkmap : 0x%08lx - 0x%08lx (%5lu kB)\n" | ||
333 | " fixmap : 0x%08lx - 0x%08lx (%5lu kB)\n" | ||
334 | #endif | ||
335 | " vmalloc : 0x%08x - 0x%08x (%5u MB)\n" | ||
336 | " lowmem : 0x%08x - 0x%08lx (%5lu MB)\n", | ||
337 | #ifdef CONFIG_HIGHMEM | ||
338 | PKMAP_BASE, PKMAP_BASE + LAST_PKMAP * PAGE_SIZE, | ||
339 | (LAST_PKMAP*PAGE_SIZE) >> 10, | ||
340 | FIXADDR_START, FIXADDR_TOP, | ||
341 | (FIXADDR_TOP - FIXADDR_START) >> 10, | ||
342 | #endif | ||
343 | VMALLOC_START, VMALLOC_END, | ||
344 | (VMALLOC_END - VMALLOC_START) >> 20, | ||
345 | PAGE_OFFSET, PAGE_OFFSET + | ||
346 | (max_low_pfn - min_low_pfn) * PAGE_SIZE, | ||
347 | ((max_low_pfn - min_low_pfn) * PAGE_SIZE) >> 20); | ||
191 | } | 348 | } |
192 | 349 | ||
193 | #ifdef CONFIG_BLK_DEV_INITRD | 350 | #ifdef CONFIG_BLK_DEV_INITRD |
@@ -204,3 +361,53 @@ void free_initmem(void) | |||
204 | { | 361 | { |
205 | free_initmem_default(-1); | 362 | free_initmem_default(-1); |
206 | } | 363 | } |
364 | |||
365 | static void __init parse_memmap_one(char *p) | ||
366 | { | ||
367 | char *oldp; | ||
368 | unsigned long start_at, mem_size; | ||
369 | |||
370 | if (!p) | ||
371 | return; | ||
372 | |||
373 | oldp = p; | ||
374 | mem_size = memparse(p, &p); | ||
375 | if (p == oldp) | ||
376 | return; | ||
377 | |||
378 | switch (*p) { | ||
379 | case '@': | ||
380 | start_at = memparse(p + 1, &p); | ||
381 | add_sysmem_bank(start_at, start_at + mem_size); | ||
382 | break; | ||
383 | |||
384 | case '$': | ||
385 | start_at = memparse(p + 1, &p); | ||
386 | mem_reserve(start_at, start_at + mem_size, 0); | ||
387 | break; | ||
388 | |||
389 | case 0: | ||
390 | mem_reserve(mem_size, 0, 0); | ||
391 | break; | ||
392 | |||
393 | default: | ||
394 | pr_warn("Unrecognized memmap syntax: %s\n", p); | ||
395 | break; | ||
396 | } | ||
397 | } | ||
398 | |||
399 | static int __init parse_memmap_opt(char *str) | ||
400 | { | ||
401 | while (str) { | ||
402 | char *k = strchr(str, ','); | ||
403 | |||
404 | if (k) | ||
405 | *k++ = 0; | ||
406 | |||
407 | parse_memmap_one(str); | ||
408 | str = k; | ||
409 | } | ||
410 | |||
411 | return 0; | ||
412 | } | ||
413 | early_param("memmap", parse_memmap_opt); | ||
diff --git a/arch/xtensa/mm/mmu.c b/arch/xtensa/mm/mmu.c index 861203e958da..3429b483d9f8 100644 --- a/arch/xtensa/mm/mmu.c +++ b/arch/xtensa/mm/mmu.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Extracted from init.c | 4 | * Extracted from init.c |
5 | */ | 5 | */ |
6 | #include <linux/bootmem.h> | ||
6 | #include <linux/percpu.h> | 7 | #include <linux/percpu.h> |
7 | #include <linux/init.h> | 8 | #include <linux/init.h> |
8 | #include <linux/string.h> | 9 | #include <linux/string.h> |
@@ -16,9 +17,44 @@ | |||
16 | #include <asm/initialize_mmu.h> | 17 | #include <asm/initialize_mmu.h> |
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
18 | 19 | ||
20 | #if defined(CONFIG_HIGHMEM) | ||
21 | static void * __init init_pmd(unsigned long vaddr) | ||
22 | { | ||
23 | pgd_t *pgd = pgd_offset_k(vaddr); | ||
24 | pmd_t *pmd = pmd_offset(pgd, vaddr); | ||
25 | |||
26 | if (pmd_none(*pmd)) { | ||
27 | unsigned i; | ||
28 | pte_t *pte = alloc_bootmem_low_pages(PAGE_SIZE); | ||
29 | |||
30 | for (i = 0; i < 1024; i++) | ||
31 | pte_clear(NULL, 0, pte + i); | ||
32 | |||
33 | set_pmd(pmd, __pmd(((unsigned long)pte) & PAGE_MASK)); | ||
34 | BUG_ON(pte != pte_offset_kernel(pmd, 0)); | ||
35 | pr_debug("%s: vaddr: 0x%08lx, pmd: 0x%p, pte: 0x%p\n", | ||
36 | __func__, vaddr, pmd, pte); | ||
37 | return pte; | ||
38 | } else { | ||
39 | return pte_offset_kernel(pmd, 0); | ||
40 | } | ||
41 | } | ||
42 | |||
43 | static void __init fixedrange_init(void) | ||
44 | { | ||
45 | BUILD_BUG_ON(FIXADDR_SIZE > PMD_SIZE); | ||
46 | init_pmd(__fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK); | ||
47 | } | ||
48 | #endif | ||
49 | |||
19 | void __init paging_init(void) | 50 | void __init paging_init(void) |
20 | { | 51 | { |
21 | memset(swapper_pg_dir, 0, PAGE_SIZE); | 52 | memset(swapper_pg_dir, 0, PAGE_SIZE); |
53 | #ifdef CONFIG_HIGHMEM | ||
54 | fixedrange_init(); | ||
55 | pkmap_page_table = init_pmd(PKMAP_BASE); | ||
56 | kmap_init(); | ||
57 | #endif | ||
22 | } | 58 | } |
23 | 59 | ||
24 | /* | 60 | /* |
diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c index ade623826788..5ece856c5725 100644 --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c | |||
@@ -149,6 +149,21 @@ void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) | |||
149 | local_irq_restore(flags); | 149 | local_irq_restore(flags); |
150 | } | 150 | } |
151 | 151 | ||
152 | void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) | ||
153 | { | ||
154 | if (end > start && start >= TASK_SIZE && end <= PAGE_OFFSET && | ||
155 | end - start < _TLB_ENTRIES << PAGE_SHIFT) { | ||
156 | start &= PAGE_MASK; | ||
157 | while (start < end) { | ||
158 | invalidate_itlb_mapping(start); | ||
159 | invalidate_dtlb_mapping(start); | ||
160 | start += PAGE_SIZE; | ||
161 | } | ||
162 | } else { | ||
163 | local_flush_tlb_all(); | ||
164 | } | ||
165 | } | ||
166 | |||
152 | #ifdef CONFIG_DEBUG_TLB_SANITY | 167 | #ifdef CONFIG_DEBUG_TLB_SANITY |
153 | 168 | ||
154 | static unsigned get_pte_for_vaddr(unsigned vaddr) | 169 | static unsigned get_pte_for_vaddr(unsigned vaddr) |
diff --git a/arch/xtensa/platforms/iss/Makefile b/arch/xtensa/platforms/iss/Makefile index d2369b799c50..b3e89291cfba 100644 --- a/arch/xtensa/platforms/iss/Makefile +++ b/arch/xtensa/platforms/iss/Makefile | |||
@@ -4,6 +4,7 @@ | |||
4 | # "prom monitor" library routines under Linux. | 4 | # "prom monitor" library routines under Linux. |
5 | # | 5 | # |
6 | 6 | ||
7 | obj-y = console.o setup.o | 7 | obj-y = setup.o |
8 | obj-$(CONFIG_TTY) += console.o | ||
8 | obj-$(CONFIG_NET) += network.o | 9 | obj-$(CONFIG_NET) += network.o |
9 | obj-$(CONFIG_BLK_DEV_SIMDISK) += simdisk.o | 10 | obj-$(CONFIG_BLK_DEV_SIMDISK) += simdisk.o |
diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c index f9bc87966290..b90555cb8089 100644 --- a/arch/xtensa/platforms/xt2000/setup.c +++ b/arch/xtensa/platforms/xt2000/setup.c | |||
@@ -92,18 +92,8 @@ void __init platform_setup(char** cmdline) | |||
92 | 92 | ||
93 | /* early initialization */ | 93 | /* early initialization */ |
94 | 94 | ||
95 | extern sysmem_info_t __initdata sysmem; | 95 | void __init platform_init(bp_tag_t *first) |
96 | |||
97 | void platform_init(bp_tag_t* first) | ||
98 | { | 96 | { |
99 | /* Set default memory block if not provided by the bootloader. */ | ||
100 | |||
101 | if (sysmem.nr_banks == 0) { | ||
102 | sysmem.nr_banks = 1; | ||
103 | sysmem.bank[0].start = PLATFORM_DEFAULT_MEM_START; | ||
104 | sysmem.bank[0].end = PLATFORM_DEFAULT_MEM_START | ||
105 | + PLATFORM_DEFAULT_MEM_SIZE; | ||
106 | } | ||
107 | } | 97 | } |
108 | 98 | ||
109 | /* Heartbeat. Let the LED blink. */ | 99 | /* Heartbeat. Let the LED blink. */ |