aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig65
-rw-r--r--arch/arm/Kconfig.debug574
-rw-r--r--arch/arm/boot/dts/am335x-bone.dts29
-rw-r--r--arch/arm/boot/dts/am335x-evm.dts29
-rw-r--r--arch/arm/boot/dts/am335x-evmsk.dts19
-rw-r--r--arch/arm/boot/dts/am33xx.dtsi143
-rw-r--r--arch/arm/boot/dts/at91sam9n12ek.dts4
-rw-r--r--arch/arm/boot/dts/at91sam9x5ek.dtsi5
-rw-r--r--arch/arm/boot/dts/atlas6.dtsi6
-rw-r--r--arch/arm/boot/dts/exynos5250.dtsi9
-rw-r--r--arch/arm/boot/dts/exynos5440.dtsi2
-rw-r--r--arch/arm/boot/dts/imx28-evk.dts1
-rw-r--r--arch/arm/boot/dts/msm8660-surf.dts2
-rw-r--r--arch/arm/boot/dts/msm8960-cdp.dts2
-rw-r--r--arch/arm/boot/dts/omap5.dtsi2
-rw-r--r--arch/arm/boot/dts/sama5d3xmb.dtsi8
-rw-r--r--arch/arm/boot/dts/tegra20-seaboard.dts3
-rw-r--r--arch/arm/boot/dts/tegra20-trimslice.dts3
-rw-r--r--arch/arm/boot/dts/tegra20-whistler.dts6
-rw-r--r--arch/arm/boot/dts/tegra20.dtsi28
-rw-r--r--arch/arm/boot/dts/wm8850-w70v2.dts3
-rw-r--r--arch/arm/common/mcpm_head.S2
-rw-r--r--arch/arm/common/vlock.S4
-rw-r--r--arch/arm/configs/bockw_defconfig7
-rw-r--r--arch/arm/configs/keystone_defconfig1
-rw-r--r--arch/arm/configs/marzen_defconfig7
-rw-r--r--arch/arm/configs/omap2plus_defconfig13
-rw-r--r--arch/arm/configs/tegra_defconfig1
-rw-r--r--arch/arm/include/asm/arch_timer.h14
-rw-r--r--arch/arm/include/asm/assembler.h4
-rw-r--r--arch/arm/include/asm/barrier.h32
-rw-r--r--arch/arm/include/asm/cacheflush.h5
-rw-r--r--arch/arm/include/asm/dma-contiguous.h2
-rw-r--r--arch/arm/include/asm/hardware/debug-8250.S29
-rw-r--r--arch/arm/include/asm/kvm_mmu.h2
-rw-r--r--arch/arm/include/asm/mach/arch.h4
-rw-r--r--arch/arm/include/asm/memblock.h3
-rw-r--r--arch/arm/include/asm/module.h2
-rw-r--r--arch/arm/include/asm/neon.h36
-rw-r--r--arch/arm/include/asm/pgtable.h2
-rw-r--r--arch/arm/include/asm/prom.h4
-rw-r--r--arch/arm/include/asm/smp_plat.h3
-rw-r--r--arch/arm/include/asm/spinlock.h53
-rw-r--r--arch/arm/include/asm/switch_to.h10
-rw-r--r--arch/arm/include/asm/thread_info.h11
-rw-r--r--arch/arm/include/asm/tlb.h7
-rw-r--r--arch/arm/include/asm/tlbflush.h181
-rw-r--r--arch/arm/include/asm/types.h40
-rw-r--r--arch/arm/include/asm/v7m.h12
-rw-r--r--arch/arm/include/asm/xor.h73
-rw-r--r--arch/arm/include/debug/8250.S54
-rw-r--r--arch/arm/include/debug/8250_32.S27
-rw-r--r--arch/arm/include/debug/bcm2835.S22
-rw-r--r--arch/arm/include/debug/cns3xxx.S19
-rw-r--r--arch/arm/include/debug/highbank.S17
-rw-r--r--arch/arm/include/debug/keystone.S43
-rw-r--r--arch/arm/include/debug/mvebu.S30
-rw-r--r--arch/arm/include/debug/mxs.S27
-rw-r--r--arch/arm/include/debug/nomadik.S20
-rw-r--r--arch/arm/include/debug/nspire.S28
-rw-r--r--arch/arm/include/debug/picoxcell.S19
-rw-r--r--arch/arm/include/debug/pl01x.S (renamed from arch/arm/include/asm/hardware/debug-pl01x.S)9
-rw-r--r--arch/arm/include/debug/pxa.S33
-rw-r--r--arch/arm/include/debug/rockchip.S42
-rw-r--r--arch/arm/include/debug/socfpga.S21
-rw-r--r--arch/arm/include/debug/sunxi.S27
-rw-r--r--arch/arm/include/debug/tegra.S29
-rw-r--r--arch/arm/include/debug/u300.S18
-rw-r--r--arch/arm/include/debug/ux500.S2
-rw-r--r--arch/arm/include/debug/vexpress.S48
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/atags.h5
-rw-r--r--arch/arm/kernel/atags_parse.c6
-rw-r--r--arch/arm/kernel/bios32.c5
-rw-r--r--arch/arm/kernel/devtree.c11
-rw-r--r--arch/arm/kernel/entry-armv.S3
-rw-r--r--arch/arm/kernel/entry-common.S4
-rw-r--r--arch/arm/kernel/fiq.c9
-rw-r--r--arch/arm/kernel/machine_kexec.c21
-rw-r--r--arch/arm/kernel/module.c8
-rw-r--r--arch/arm/kernel/perf_event.c10
-rw-r--r--arch/arm/kernel/perf_event_cpu.c3
-rw-r--r--arch/arm/kernel/process.c2
-rw-r--r--arch/arm/kernel/setup.c21
-rw-r--r--arch/arm/kernel/smp.c23
-rw-r--r--arch/arm/kernel/smp_tlb.c10
-rw-r--r--arch/arm/kernel/topology.c61
-rw-r--r--arch/arm/kernel/traps.c66
-rw-r--r--arch/arm/kernel/v7m.c19
-rw-r--r--arch/arm/kvm/arm.c4
-rw-r--r--arch/arm/kvm/coproc.c26
-rw-r--r--arch/arm/kvm/coproc.h3
-rw-r--r--arch/arm/kvm/coproc_a15.c6
-rw-r--r--arch/arm/kvm/init.S2
-rw-r--r--arch/arm/kvm/interrupts.S12
-rw-r--r--arch/arm/kvm/mmio.c3
-rw-r--r--arch/arm/kvm/mmu.c37
-rw-r--r--arch/arm/kvm/reset.c2
-rw-r--r--arch/arm/kvm/trace.h7
-rw-r--r--arch/arm/lib/Makefile6
-rw-r--r--arch/arm/lib/xor-neon.c42
-rw-r--r--arch/arm/mach-at91/at91sam9x5.c2
-rw-r--r--arch/arm/mach-at91/include/mach/at91_adc.h16
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c6
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c1
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c1
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c1
-rw-r--r--arch/arm/mach-davinci/cpuidle.c2
-rw-r--r--arch/arm/mach-davinci/include/mach/debug-macro.S65
-rw-r--r--arch/arm/mach-dove/common.c4
-rw-r--r--arch/arm/mach-dove/include/mach/debug-macro.S19
-rw-r--r--arch/arm/mach-ebsa110/include/mach/debug-macro.S22
-rw-r--r--arch/arm/mach-ep93xx/Kconfig14
-rw-r--r--arch/arm/mach-ep93xx/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-ep93xx/include/mach/uncompress.h14
-rw-r--r--arch/arm/mach-footbridge/include/mach/debug-macro.S15
-rw-r--r--arch/arm/mach-gemini/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-imx/mach-imx6q.c3
-rw-r--r--arch/arm/mach-integrator/include/mach/debug-macro.S20
-rw-r--r--arch/arm/mach-iop13xx/include/mach/debug-macro.S24
-rw-r--r--arch/arm/mach-iop32x/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-iop33x/include/mach/debug-macro.S22
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/debug-macro.S26
-rw-r--r--arch/arm/mach-kirkwood/common.c24
-rw-r--r--arch/arm/mach-kirkwood/include/mach/debug-macro.S19
-rw-r--r--arch/arm/mach-lpc32xx/include/mach/debug-macro.S29
-rw-r--r--arch/arm/mach-msm/devices-msm7x00.c6
-rw-r--r--arch/arm/mach-msm/devices-msm7x30.c2
-rw-r--r--arch/arm/mach-msm/devices-qsd8x50.c6
-rw-r--r--arch/arm/mach-mv78xx0/include/mach/debug-macro.S19
-rw-r--r--arch/arm/mach-mvebu/platsmp.c51
-rw-r--r--arch/arm/mach-omap2/board-2430sdp.c57
-rw-r--r--arch/arm/mach-omap2/board-3430sdp.c83
-rw-r--r--arch/arm/mach-omap2/board-am3517evm.c113
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c100
-rw-r--r--arch/arm/mach-omap2/board-devkit8000.c96
-rw-r--r--arch/arm/mach-omap2/board-h4.c48
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c36
-rw-r--r--arch/arm/mach-omap2/board-ldp.c68
-rw-r--r--arch/arm/mach-omap2/board-n8x0.c4
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c60
-rw-r--r--arch/arm/mach-omap2/board-omap3evm.c91
-rw-r--r--arch/arm/mach-omap2/board-omap3pandora.c50
-rw-r--r--arch/arm/mach-omap2/board-omap3stalker.c61
-rw-r--r--arch/arm/mach-omap2/board-overo.c160
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c12
-rw-r--r--arch/arm/mach-omap2/board-rx51-video.c35
-rw-r--r--arch/arm/mach-omap2/board-rx51.c2
-rw-r--r--arch/arm/mach-omap2/board-zoom-display.c30
-rw-r--r--arch/arm/mach-omap2/display.c4
-rw-r--r--arch/arm/mach-omap2/dss-common.c244
-rw-r--r--arch/arm/mach-omap2/dss-common.h2
-rw-r--r--arch/arm/mach-omap2/i2c.c2
-rw-r--r--arch/arm/mach-omap2/usb-host.c10
-rw-r--r--arch/arm/mach-omap2/usb-musb.c5
-rw-r--r--arch/arm/mach-orion5x/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-prima2/common.c2
-rw-r--r--arch/arm/mach-pxa/icontrol.c3
-rw-r--r--arch/arm/mach-pxa/zeus.c46
-rw-r--r--arch/arm/mach-realview/include/mach/debug-macro.S29
-rw-r--r--arch/arm/mach-rpc/include/mach/debug-macro.S23
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c1
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c42
-rw-r--r--arch/arm/mach-shmobile/board-marzen.c44
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7778.c5
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c10
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7778.h3
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7779.h3
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c34
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c37
-rw-r--r--arch/arm/mach-spear/include/mach/debug-macro.S36
-rw-r--r--arch/arm/mach-spear/include/mach/spear.h2
-rw-r--r--arch/arm/mach-tegra/tegra.c38
-rw-r--r--arch/arm/mach-ux500/Makefile1
-rw-r--r--arch/arm/mach-ux500/cpuidle.c128
-rw-r--r--arch/arm/mach-versatile/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mm/Kconfig9
-rw-r--r--arch/arm/mm/cache-l2x0.c12
-rw-r--r--arch/arm/mm/cache-v7.S4
-rw-r--r--arch/arm/mm/context.c7
-rw-r--r--arch/arm/mm/dma-mapping.c7
-rw-r--r--arch/arm/mm/hugetlbpage.c43
-rw-r--r--arch/arm/mm/init.c5
-rw-r--r--arch/arm/mm/mmu.c4
-rw-r--r--arch/arm/mm/nommu.c2
-rw-r--r--arch/arm/mm/proc-feroceon.S26
-rw-r--r--arch/arm/mm/proc-v7.S16
-rw-r--r--arch/arm/mm/tlb-v7.S8
-rw-r--r--arch/arm/plat-pxa/ssp.c171
-rw-r--r--arch/arm/plat-samsung/init.c5
-rw-r--r--arch/arm/plat-samsung/s3c-dma-ops.c13
-rw-r--r--arch/arm/vfp/vfphw.S5
-rw-r--r--arch/arm/vfp/vfpmodule.c69
-rw-r--r--arch/arm/xen/enlighten.c1
195 files changed, 2870 insertions, 2417 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 43594d5116ef..5d1f5704a284 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -52,6 +52,7 @@ config ARM
52 select HAVE_REGS_AND_STACK_ACCESS_API 52 select HAVE_REGS_AND_STACK_ACCESS_API
53 select HAVE_SYSCALL_TRACEPOINTS 53 select HAVE_SYSCALL_TRACEPOINTS
54 select HAVE_UID16 54 select HAVE_UID16
55 select IRQ_FORCED_THREADING
55 select KTIME_SCALAR 56 select KTIME_SCALAR
56 select PERF_USE_VMALLOC 57 select PERF_USE_VMALLOC
57 select RTC_LIB 58 select RTC_LIB
@@ -1372,6 +1373,15 @@ config ARM_ERRATA_798181
1372 which sends an IPI to the CPUs that are running the same ASID 1373 which sends an IPI to the CPUs that are running the same ASID
1373 as the one being invalidated. 1374 as the one being invalidated.
1374 1375
1376config ARM_ERRATA_773022
1377 bool "ARM errata: incorrect instructions may be executed from loop buffer"
1378 depends on CPU_V7
1379 help
1380 This option enables the workaround for the 773022 Cortex-A15
1381 (up to r0p4) erratum. In certain rare sequences of code, the
1382 loop buffer may deliver incorrect instructions. This
1383 workaround disables the loop buffer to avoid the erratum.
1384
1375endmenu 1385endmenu
1376 1386
1377source "arch/arm/common/Kconfig" 1387source "arch/arm/common/Kconfig"
@@ -1613,13 +1623,49 @@ config ARCH_NR_GPIO
1613 1623
1614source kernel/Kconfig.preempt 1624source kernel/Kconfig.preempt
1615 1625
1616config HZ 1626config HZ_FIXED
1617 int 1627 int
1618 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \ 1628 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \
1619 ARCH_S5PV210 || ARCH_EXYNOS4 1629 ARCH_S5PV210 || ARCH_EXYNOS4
1620 default AT91_TIMER_HZ if ARCH_AT91 1630 default AT91_TIMER_HZ if ARCH_AT91
1621 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE 1631 default SHMOBILE_TIMER_HZ if ARCH_SHMOBILE
1622 default 100 1632
1633choice
1634 depends on !HZ_FIXED
1635 prompt "Timer frequency"
1636
1637config HZ_100
1638 bool "100 Hz"
1639
1640config HZ_200
1641 bool "200 Hz"
1642
1643config HZ_250
1644 bool "250 Hz"
1645
1646config HZ_300
1647 bool "300 Hz"
1648
1649config HZ_500
1650 bool "500 Hz"
1651
1652config HZ_1000
1653 bool "1000 Hz"
1654
1655endchoice
1656
1657config HZ
1658 int
1659 default HZ_FIXED if HZ_FIXED
1660 default 100 if HZ_100
1661 default 200 if HZ_200
1662 default 250 if HZ_250
1663 default 300 if HZ_300
1664 default 500 if HZ_500
1665 default 1000
1666
1667config SCHED_HRTICK
1668 def_bool HIGH_RES_TIMERS
1623 1669
1624config SCHED_HRTICK 1670config SCHED_HRTICK
1625 def_bool HIGH_RES_TIMERS 1671 def_bool HIGH_RES_TIMERS
@@ -1756,6 +1802,9 @@ config HAVE_ARCH_TRANSPARENT_HUGEPAGE
1756 def_bool y 1802 def_bool y
1757 depends on ARM_LPAE 1803 depends on ARM_LPAE
1758 1804
1805config ARCH_WANT_GENERAL_HUGETLB
1806 def_bool y
1807
1759source "mm/Kconfig" 1808source "mm/Kconfig"
1760 1809
1761config FORCE_MAX_ZONEORDER 1810config FORCE_MAX_ZONEORDER
@@ -2064,8 +2113,7 @@ config KEXEC
2064 2113
2065 It is an ongoing process to be certain the hardware in a machine 2114 It is an ongoing process to be certain the hardware in a machine
2066 is properly shutdown, so do not be surprised if this code does not 2115 is properly shutdown, so do not be surprised if this code does not
2067 initially work for you. It may help to enable device hotplugging 2116 initially work for you.
2068 support.
2069 2117
2070config ATAGS_PROC 2118config ATAGS_PROC
2071 bool "Export atags in procfs" 2119 bool "Export atags in procfs"
@@ -2175,6 +2223,13 @@ config NEON
2175 Say Y to include support code for NEON, the ARMv7 Advanced SIMD 2223 Say Y to include support code for NEON, the ARMv7 Advanced SIMD
2176 Extension. 2224 Extension.
2177 2225
2226config KERNEL_MODE_NEON
2227 bool "Support for NEON in kernel mode"
2228 default n
2229 depends on NEON
2230 help
2231 Say Y to include support for NEON in kernel mode.
2232
2178endmenu 2233endmenu
2179 2234
2180menu "Userspace binary formats" 2235menu "Userspace binary formats"
@@ -2199,7 +2254,7 @@ source "kernel/power/Kconfig"
2199 2254
2200config ARCH_SUSPEND_POSSIBLE 2255config ARCH_SUSPEND_POSSIBLE
2201 depends on !ARCH_S5PC100 2256 depends on !ARCH_S5PC100
2202 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ 2257 depends on CPU_ARM920T || CPU_ARM926T || CPU_FEROCEON || CPU_SA1100 || \
2203 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK 2258 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE || CPU_MOHAWK
2204 def_bool y 2259 def_bool y
2205 2260
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 583f4a00ec32..4137529850cb 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -92,6 +92,7 @@ choice
92 config DEBUG_BCM2835 92 config DEBUG_BCM2835
93 bool "Kernel low-level debugging on BCM2835 PL011 UART" 93 bool "Kernel low-level debugging on BCM2835 PL011 UART"
94 depends on ARCH_BCM2835 94 depends on ARCH_BCM2835
95 select DEBUG_UART_PL01X
95 96
96 config DEBUG_CLPS711X_UART1 97 config DEBUG_CLPS711X_UART1
97 bool "Kernel low-level debugging messages via UART1" 98 bool "Kernel low-level debugging messages via UART1"
@@ -110,6 +111,7 @@ choice
110 config DEBUG_CNS3XXX 111 config DEBUG_CNS3XXX
111 bool "Kernel Kernel low-level debugging on Cavium Networks CNS3xxx" 112 bool "Kernel Kernel low-level debugging on Cavium Networks CNS3xxx"
112 depends on ARCH_CNS3XXX 113 depends on ARCH_CNS3XXX
114 select DEBUG_UART_PL01X
113 help 115 help
114 Say Y here if you want the debug print routines to direct 116 Say Y here if you want the debug print routines to direct
115 their output to the CNS3xxx UART0. 117 their output to the CNS3xxx UART0.
@@ -117,6 +119,7 @@ choice
117 config DEBUG_DAVINCI_DA8XX_UART1 119 config DEBUG_DAVINCI_DA8XX_UART1
118 bool "Kernel low-level debugging on DaVinci DA8XX using UART1" 120 bool "Kernel low-level debugging on DaVinci DA8XX using UART1"
119 depends on ARCH_DAVINCI_DA8XX 121 depends on ARCH_DAVINCI_DA8XX
122 select DEBUG_UART_8250
120 help 123 help
121 Say Y here if you want the debug print routines to direct 124 Say Y here if you want the debug print routines to direct
122 their output to UART1 serial port on DaVinci DA8XX devices. 125 their output to UART1 serial port on DaVinci DA8XX devices.
@@ -124,6 +127,7 @@ choice
124 config DEBUG_DAVINCI_DA8XX_UART2 127 config DEBUG_DAVINCI_DA8XX_UART2
125 bool "Kernel low-level debugging on DaVinci DA8XX using UART2" 128 bool "Kernel low-level debugging on DaVinci DA8XX using UART2"
126 depends on ARCH_DAVINCI_DA8XX 129 depends on ARCH_DAVINCI_DA8XX
130 select DEBUG_UART_8250
127 help 131 help
128 Say Y here if you want the debug print routines to direct 132 Say Y here if you want the debug print routines to direct
129 their output to UART2 serial port on DaVinci DA8XX devices. 133 their output to UART2 serial port on DaVinci DA8XX devices.
@@ -131,6 +135,7 @@ choice
131 config DEBUG_DAVINCI_DMx_UART0 135 config DEBUG_DAVINCI_DMx_UART0
132 bool "Kernel low-level debugging on DaVinci DMx using UART0" 136 bool "Kernel low-level debugging on DaVinci DMx using UART0"
133 depends on ARCH_DAVINCI_DMx 137 depends on ARCH_DAVINCI_DMx
138 select DEBUG_UART_8250
134 help 139 help
135 Say Y here if you want the debug print routines to direct 140 Say Y here if you want the debug print routines to direct
136 their output to UART0 serial port on DaVinci DMx devices. 141 their output to UART0 serial port on DaVinci DMx devices.
@@ -138,6 +143,7 @@ choice
138 config DEBUG_DAVINCI_TNETV107X_UART1 143 config DEBUG_DAVINCI_TNETV107X_UART1
139 bool "Kernel low-level debugging on DaVinci TNETV107x using UART1" 144 bool "Kernel low-level debugging on DaVinci TNETV107x using UART1"
140 depends on ARCH_DAVINCI_TNETV107X 145 depends on ARCH_DAVINCI_TNETV107X
146 select DEBUG_UART_8250
141 help 147 help
142 Say Y here if you want the debug print routines to direct 148 Say Y here if you want the debug print routines to direct
143 their output to UART1 serial port on DaVinci TNETV107X 149 their output to UART1 serial port on DaVinci TNETV107X
@@ -174,9 +180,26 @@ choice
174 Say Y here if you want the debug print routines to direct 180 Say Y here if you want the debug print routines to direct
175 their output to the 8250 at PCI COM1. 181 their output to the 8250 at PCI COM1.
176 182
183 config DEBUG_HI3620_UART
184 bool "Hisilicon HI3620 Debug UART"
185 depends on ARCH_HI3xxx
186 select DEBUG_UART_PL01X
187 help
188 Say Y here if you want kernel low-level debugging support
189 on HI3620 UART.
190
191 config DEBUG_HI3716_UART
192 bool "Hisilicon Hi3716 Debug UART"
193 depends on ARCH_HI3xxx
194 select DEBUG_UART_PL01X
195 help
196 Say Y here if you want kernel low-level debugging support
197 on HI3716 UART.
198
177 config DEBUG_HIGHBANK_UART 199 config DEBUG_HIGHBANK_UART
178 bool "Kernel low-level debugging messages via Highbank UART" 200 bool "Kernel low-level debugging messages via Highbank UART"
179 depends on ARCH_HIGHBANK 201 depends on ARCH_HIGHBANK
202 select DEBUG_UART_PL01X
180 help 203 help
181 Say Y here if you want the debug print routines to direct 204 Say Y here if you want the debug print routines to direct
182 their output to the UART on Highbank based devices. 205 their output to the UART on Highbank based devices.
@@ -191,6 +214,7 @@ choice
191 config DEBUG_IMX23_UART 214 config DEBUG_IMX23_UART
192 bool "i.MX23 Debug UART" 215 bool "i.MX23 Debug UART"
193 depends on SOC_IMX23 216 depends on SOC_IMX23
217 select DEBUG_UART_PL01X
194 help 218 help
195 Say Y here if you want kernel low-level debugging support 219 Say Y here if you want kernel low-level debugging support
196 on i.MX23. 220 on i.MX23.
@@ -212,6 +236,7 @@ choice
212 config DEBUG_IMX28_UART 236 config DEBUG_IMX28_UART
213 bool "i.MX28 Debug UART" 237 bool "i.MX28 Debug UART"
214 depends on SOC_IMX28 238 depends on SOC_IMX28
239 select DEBUG_UART_PL01X
215 help 240 help
216 Say Y here if you want kernel low-level debugging support 241 Say Y here if you want kernel low-level debugging support
217 on i.MX28. 242 on i.MX28.
@@ -261,6 +286,7 @@ choice
261 config DEBUG_KEYSTONE_UART0 286 config DEBUG_KEYSTONE_UART0
262 bool "Kernel low-level debugging on KEYSTONE2 using UART0" 287 bool "Kernel low-level debugging on KEYSTONE2 using UART0"
263 depends on ARCH_KEYSTONE 288 depends on ARCH_KEYSTONE
289 select DEBUG_UART_8250
264 help 290 help
265 Say Y here if you want the debug print routines to direct 291 Say Y here if you want the debug print routines to direct
266 their output to UART0 serial port on KEYSTONE2 devices. 292 their output to UART0 serial port on KEYSTONE2 devices.
@@ -268,6 +294,7 @@ choice
268 config DEBUG_KEYSTONE_UART1 294 config DEBUG_KEYSTONE_UART1
269 bool "Kernel low-level debugging on KEYSTONE2 using UART1" 295 bool "Kernel low-level debugging on KEYSTONE2 using UART1"
270 depends on ARCH_KEYSTONE 296 depends on ARCH_KEYSTONE
297 select DEBUG_UART_8250
271 help 298 help
272 Say Y here if you want the debug print routines to direct 299 Say Y here if you want the debug print routines to direct
273 their output to UART1 serial port on KEYSTONE2 devices. 300 their output to UART1 serial port on KEYSTONE2 devices.
@@ -275,6 +302,7 @@ choice
275 config DEBUG_MMP_UART2 302 config DEBUG_MMP_UART2
276 bool "Kernel low-level debugging message via MMP UART2" 303 bool "Kernel low-level debugging message via MMP UART2"
277 depends on ARCH_MMP 304 depends on ARCH_MMP
305 select DEBUG_UART_8250
278 help 306 help
279 Say Y here if you want kernel low-level debugging support 307 Say Y here if you want kernel low-level debugging support
280 on MMP UART2. 308 on MMP UART2.
@@ -282,6 +310,7 @@ choice
282 config DEBUG_MMP_UART3 310 config DEBUG_MMP_UART3
283 bool "Kernel low-level debugging message via MMP UART3" 311 bool "Kernel low-level debugging message via MMP UART3"
284 depends on ARCH_MMP 312 depends on ARCH_MMP
313 select DEBUG_UART_8250
285 help 314 help
286 Say Y here if you want kernel low-level debugging support 315 Say Y here if you want kernel low-level debugging support
287 on MMP UART3. 316 on MMP UART3.
@@ -326,6 +355,7 @@ choice
326 config DEBUG_MVEBU_UART 355 config DEBUG_MVEBU_UART
327 bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)" 356 bool "Kernel low-level debugging messages via MVEBU UART (old bootloaders)"
328 depends on ARCH_MVEBU 357 depends on ARCH_MVEBU
358 select DEBUG_UART_8250
329 help 359 help
330 Say Y here if you want kernel low-level debugging support 360 Say Y here if you want kernel low-level debugging support
331 on MVEBU based platforms. 361 on MVEBU based platforms.
@@ -344,6 +374,7 @@ choice
344 config DEBUG_MVEBU_UART_ALTERNATE 374 config DEBUG_MVEBU_UART_ALTERNATE
345 bool "Kernel low-level debugging messages via MVEBU UART (new bootloaders)" 375 bool "Kernel low-level debugging messages via MVEBU UART (new bootloaders)"
346 depends on ARCH_MVEBU 376 depends on ARCH_MVEBU
377 select DEBUG_UART_8250
347 help 378 help
348 Say Y here if you want kernel low-level debugging support 379 Say Y here if you want kernel low-level debugging support
349 on MVEBU based platforms. 380 on MVEBU based platforms.
@@ -358,6 +389,7 @@ choice
358 config DEBUG_NOMADIK_UART 389 config DEBUG_NOMADIK_UART
359 bool "Kernel low-level debugging messages via NOMADIK UART" 390 bool "Kernel low-level debugging messages via NOMADIK UART"
360 depends on ARCH_NOMADIK 391 depends on ARCH_NOMADIK
392 select DEBUG_UART_PL01X
361 help 393 help
362 Say Y here if you want kernel low-level debugging support 394 Say Y here if you want kernel low-level debugging support
363 on NOMADIK based platforms. 395 on NOMADIK based platforms.
@@ -365,6 +397,7 @@ choice
365 config DEBUG_NSPIRE_CLASSIC_UART 397 config DEBUG_NSPIRE_CLASSIC_UART
366 bool "Kernel low-level debugging via TI-NSPIRE 8250 UART" 398 bool "Kernel low-level debugging via TI-NSPIRE 8250 UART"
367 depends on ARCH_NSPIRE 399 depends on ARCH_NSPIRE
400 select DEBUG_UART_8250
368 help 401 help
369 Say Y here if you want kernel low-level debugging support 402 Say Y here if you want kernel low-level debugging support
370 on TI-NSPIRE classic models. 403 on TI-NSPIRE classic models.
@@ -372,20 +405,82 @@ choice
372 config DEBUG_NSPIRE_CX_UART 405 config DEBUG_NSPIRE_CX_UART
373 bool "Kernel low-level debugging via TI-NSPIRE PL011 UART" 406 bool "Kernel low-level debugging via TI-NSPIRE PL011 UART"
374 depends on ARCH_NSPIRE 407 depends on ARCH_NSPIRE
408 select DEBUG_UART_PL01X
375 help 409 help
376 Say Y here if you want kernel low-level debugging support 410 Say Y here if you want kernel low-level debugging support
377 on TI-NSPIRE CX models. 411 on TI-NSPIRE CX models.
378 412
379 config DEBUG_OMAP2PLUS_UART 413 config DEBUG_OMAP2UART1
380 bool "Kernel low-level debugging messages via OMAP2PLUS UART" 414 bool "OMAP2/3/4 UART1 (omap2/3 sdp boards and some omap3 boards)"
381 depends on ARCH_OMAP2PLUS 415 depends on ARCH_OMAP2PLUS
416 select DEBUG_OMAP2PLUS_UART
382 help 417 help
383 Say Y here if you want kernel low-level debugging support 418 This covers at least h4, 2430sdp, 3430sdp, 3630sdp,
384 on OMAP2PLUS based platforms. 419 omap3 torpedo and 3530 lv som.
420
421 config DEBUG_OMAP2UART2
422 bool "Kernel low-level debugging messages via OMAP2/3/4 UART2"
423 depends on ARCH_OMAP2PLUS
424 select DEBUG_OMAP2PLUS_UART
425
426 config DEBUG_OMAP2UART3
427 bool "Kernel low-level debugging messages via OMAP2 UART3 (n8x0)"
428 depends on ARCH_OMAP2PLUS
429 select DEBUG_OMAP2PLUS_UART
430
431 config DEBUG_OMAP3UART3
432 bool "Kernel low-level debugging messages via OMAP3 UART3 (most omap3 boards)"
433 depends on ARCH_OMAP2PLUS
434 select DEBUG_OMAP2PLUS_UART
435 help
436 This covers at least cm_t3x, beagle, crane, devkit8000,
437 igep00x0, ldp, n900, n9(50), pandora, overo, touchbook,
438 and 3517evm.
439
440 config DEBUG_OMAP4UART3
441 bool "Kernel low-level debugging messages via OMAP4/5 UART3 (omap4 blaze, panda, omap5 sevm)"
442 depends on ARCH_OMAP2PLUS
443 select DEBUG_OMAP2PLUS_UART
444
445 config DEBUG_OMAP3UART4
446 bool "Kernel low-level debugging messages via OMAP36XX UART4"
447 depends on ARCH_OMAP2PLUS
448 select DEBUG_OMAP2PLUS_UART
449
450 config DEBUG_OMAP4UART4
451 bool "Kernel low-level debugging messages via OMAP4/5 UART4"
452 depends on ARCH_OMAP2PLUS
453 select DEBUG_OMAP2PLUS_UART
454
455 config DEBUG_TI81XXUART1
456 bool "Kernel low-level debugging messages via TI81XX UART1 (ti8148evm)"
457 depends on ARCH_OMAP2PLUS
458 select DEBUG_OMAP2PLUS_UART
459
460 config DEBUG_TI81XXUART2
461 bool "Kernel low-level debugging messages via TI81XX UART2"
462 depends on ARCH_OMAP2PLUS
463 select DEBUG_OMAP2PLUS_UART
464
465 config DEBUG_TI81XXUART3
466 bool "Kernel low-level debugging messages via TI81XX UART3 (ti8168evm)"
467 depends on ARCH_OMAP2PLUS
468 select DEBUG_OMAP2PLUS_UART
469
470 config DEBUG_AM33XXUART1
471 bool "Kernel low-level debugging messages via AM33XX UART1"
472 depends on ARCH_OMAP2PLUS
473 select DEBUG_OMAP2PLUS_UART
474
475 config DEBUG_ZOOM_UART
476 bool "Kernel low-level debugging messages via Zoom2/3 UART"
477 depends on ARCH_OMAP2PLUS
478 select DEBUG_OMAP2PLUS_UART
385 479
386 config DEBUG_PICOXCELL_UART 480 config DEBUG_PICOXCELL_UART
387 depends on ARCH_PICOXCELL 481 depends on ARCH_PICOXCELL
388 bool "Use PicoXcell UART for low-level debug" 482 bool "Use PicoXcell UART for low-level debug"
483 select DEBUG_UART_8250
389 help 484 help
390 Say Y here if you want kernel low-level debugging support 485 Say Y here if you want kernel low-level debugging support
391 on PicoXcell based platforms. 486 on PicoXcell based platforms.
@@ -393,6 +488,7 @@ choice
393 config DEBUG_PXA_UART1 488 config DEBUG_PXA_UART1
394 depends on ARCH_PXA 489 depends on ARCH_PXA
395 bool "Use PXA UART1 for low-level debug" 490 bool "Use PXA UART1 for low-level debug"
491 select DEBUG_UART_8250
396 help 492 help
397 Say Y here if you want kernel low-level debugging support 493 Say Y here if you want kernel low-level debugging support
398 on PXA UART1. 494 on PXA UART1.
@@ -400,6 +496,7 @@ choice
400 config DEBUG_REALVIEW_STD_PORT 496 config DEBUG_REALVIEW_STD_PORT
401 bool "RealView Default UART" 497 bool "RealView Default UART"
402 depends on ARCH_REALVIEW 498 depends on ARCH_REALVIEW
499 select DEBUG_UART_PL01X
403 help 500 help
404 Say Y here if you want the debug print routines to direct 501 Say Y here if you want the debug print routines to direct
405 their output to the serial port on RealView EB, PB11MP, PBA8 502 their output to the serial port on RealView EB, PB11MP, PBA8
@@ -408,14 +505,64 @@ choice
408 config DEBUG_REALVIEW_PB1176_PORT 505 config DEBUG_REALVIEW_PB1176_PORT
409 bool "RealView PB1176 UART" 506 bool "RealView PB1176 UART"
410 depends on MACH_REALVIEW_PB1176 507 depends on MACH_REALVIEW_PB1176
508 select DEBUG_UART_PL01X
411 help 509 help
412 Say Y here if you want the debug print routines to direct 510 Say Y here if you want the debug print routines to direct
413 their output to the standard serial port on the RealView 511 their output to the standard serial port on the RealView
414 PB1176 platform. 512 PB1176 platform.
415 513
416 config DEBUG_ROCKCHIP_UART 514 config DEBUG_RK29_UART0
417 bool "Kernel low-level debugging messages via Rockchip UART" 515 bool "Kernel low-level debugging messages via Rockchip RK29 UART0"
516 depends on ARCH_ROCKCHIP
517 select DEBUG_UART_8250
518 help
519 Say Y here if you want kernel low-level debugging support
520 on Rockchip based platforms.
521
522 config DEBUG_RK29_UART1
523 bool "Kernel low-level debugging messages via Rockchip RK29 UART1"
524 depends on ARCH_ROCKCHIP
525 select DEBUG_UART_8250
526 help
527 Say Y here if you want kernel low-level debugging support
528 on Rockchip based platforms.
529
530 config DEBUG_RK29_UART2
531 bool "Kernel low-level debugging messages via Rockchip RK29 UART2"
532 depends on ARCH_ROCKCHIP
533 select DEBUG_UART_8250
534 help
535 Say Y here if you want kernel low-level debugging support
536 on Rockchip based platforms.
537
538 config DEBUG_RK3X_UART0
539 bool "Kernel low-level debugging messages via Rockchip RK3X UART0"
540 depends on ARCH_ROCKCHIP
541 select DEBUG_UART_8250
542 help
543 Say Y here if you want kernel low-level debugging support
544 on Rockchip based platforms.
545
546 config DEBUG_RK3X_UART1
547 bool "Kernel low-level debugging messages via Rockchip RK3X UART1"
548 depends on ARCH_ROCKCHIP
549 select DEBUG_UART_8250
550 help
551 Say Y here if you want kernel low-level debugging support
552 on Rockchip based platforms.
553
554 config DEBUG_RK3X_UART2
555 bool "Kernel low-level debugging messages via Rockchip RK3X UART2"
556 depends on ARCH_ROCKCHIP
557 select DEBUG_UART_8250
558 help
559 Say Y here if you want kernel low-level debugging support
560 on Rockchip based platforms.
561
562 config DEBUG_RK3X_UART3
563 bool "Kernel low-level debugging messages via Rockchip RK3X UART3"
418 depends on ARCH_ROCKCHIP 564 depends on ARCH_ROCKCHIP
565 select DEBUG_UART_8250
419 help 566 help
420 Say Y here if you want kernel low-level debugging support 567 Say Y here if you want kernel low-level debugging support
421 on Rockchip based platforms. 568 on Rockchip based platforms.
@@ -471,6 +618,7 @@ choice
471 config DEBUG_SOCFPGA_UART 618 config DEBUG_SOCFPGA_UART
472 depends on ARCH_SOCFPGA 619 depends on ARCH_SOCFPGA
473 bool "Use SOCFPGA UART for low-level debug" 620 bool "Use SOCFPGA UART for low-level debug"
621 select DEBUG_UART_8250
474 help 622 help
475 Say Y here if you want kernel low-level debugging support 623 Say Y here if you want kernel low-level debugging support
476 on SOCFPGA based platforms. 624 on SOCFPGA based platforms.
@@ -478,6 +626,7 @@ choice
478 config DEBUG_SUNXI_UART0 626 config DEBUG_SUNXI_UART0
479 bool "Kernel low-level debugging messages via sunXi UART0" 627 bool "Kernel low-level debugging messages via sunXi UART0"
480 depends on ARCH_SUNXI 628 depends on ARCH_SUNXI
629 select DEBUG_UART_8250
481 help 630 help
482 Say Y here if you want kernel low-level debugging support 631 Say Y here if you want kernel low-level debugging support
483 on Allwinner A1X based platforms on the UART0. 632 on Allwinner A1X based platforms on the UART0.
@@ -485,13 +634,59 @@ choice
485 config DEBUG_SUNXI_UART1 634 config DEBUG_SUNXI_UART1
486 bool "Kernel low-level debugging messages via sunXi UART1" 635 bool "Kernel low-level debugging messages via sunXi UART1"
487 depends on ARCH_SUNXI 636 depends on ARCH_SUNXI
637 select DEBUG_UART_8250
488 help 638 help
489 Say Y here if you want kernel low-level debugging support 639 Say Y here if you want kernel low-level debugging support
490 on Allwinner A1X based platforms on the UART1. 640 on Allwinner A1X based platforms on the UART1.
491 641
492 config DEBUG_TEGRA_UART 642 config TEGRA_DEBUG_UART_AUTO_ODMDATA
643 bool "Kernel low-level debugging messages via Tegra UART via ODMDATA"
644 depends on ARCH_TEGRA
645 select DEBUG_TEGRA_UART
646 help
647 Automatically determines which UART to use for low-level
648 debug based on the ODMDATA value. This value is part of
649 the BCT, and is written to the boot memory device using
650 nvflash, or other flashing tool. When bits 19:18 are 3,
651 then bits 17:15 indicate which UART to use; 0/1/2/3/4
652 are UART A/B/C/D/E.
653
654 config TEGRA_DEBUG_UARTA
655 bool "Kernel low-level debugging messages via Tegra UART A"
656 depends on ARCH_TEGRA
657 select DEBUG_TEGRA_UART
658 help
659 Say Y here if you want kernel low-level debugging support
660 on Tegra based platforms.
661
662 config TEGRA_DEBUG_UARTB
663 bool "Kernel low-level debugging messages via Tegra UART B"
664 depends on ARCH_TEGRA
665 select DEBUG_TEGRA_UART
666 help
667 Say Y here if you want kernel low-level debugging support
668 on Tegra based platforms.
669
670 config TEGRA_DEBUG_UARTC
671 bool "Kernel low-level debugging messages via Tegra UART C"
672 depends on ARCH_TEGRA
673 select DEBUG_TEGRA_UART
674 help
675 Say Y here if you want kernel low-level debugging support
676 on Tegra based platforms.
677
678 config TEGRA_DEBUG_UARTD
679 bool "Kernel low-level debugging messages via Tegra UART D"
680 depends on ARCH_TEGRA
681 select DEBUG_TEGRA_UART
682 help
683 Say Y here if you want kernel low-level debugging support
684 on Tegra based platforms.
685
686 config TEGRA_DEBUG_UARTE
687 bool "Kernel low-level debugging messages via Tegra UART E"
493 depends on ARCH_TEGRA 688 depends on ARCH_TEGRA
494 bool "Use Tegra UART for low-level debug" 689 select DEBUG_TEGRA_UART
495 help 690 help
496 Say Y here if you want kernel low-level debugging support 691 Say Y here if you want kernel low-level debugging support
497 on Tegra based platforms. 692 on Tegra based platforms.
@@ -510,19 +705,32 @@ choice
510 Say Y here if you want the debug print routines to direct 705 Say Y here if you want the debug print routines to direct
511 their output to the uart1 port on SiRFmarco devices. 706 their output to the uart1 port on SiRFmarco devices.
512 707
513 config DEBUG_STI_UART 708 config STIH41X_DEBUG_ASC2
709 bool "Use StiH415/416 ASC2 UART for low-level debug"
710 depends on ARCH_STI
711 select DEBUG_STI_UART
712 help
713 Say Y here if you want kernel low-level debugging support
714 on STiH415/416 based platforms like b2000, which has
715 default UART wired up to ASC2.
716
717 If unsure, say N.
718
719 config STIH41X_DEBUG_SBC_ASC1
720 bool "Use StiH415/416 SBC ASC1 UART for low-level debug"
514 depends on ARCH_STI 721 depends on ARCH_STI
515 bool "Use StiH415/416 ASC for low-level debug" 722 select DEBUG_STI_UART
516 help 723 help
517 Say Y here if you want kernel low-level debugging support 724 Say Y here if you want kernel low-level debugging support
518 on StiH415/416 based platforms like B2000, B2020. 725 on STiH415/416 based platforms like b2020. which has
519 It support UART2 and SBC_UART1. 726 default UART wired up to SBC ASC1.
520 727
521 If unsure, say N. 728 If unsure, say N.
522 729
523 config DEBUG_U300_UART 730 config DEBUG_U300_UART
524 bool "Kernel low-level debugging messages via U300 UART0" 731 bool "Kernel low-level debugging messages via U300 UART0"
525 depends on ARCH_U300 732 depends on ARCH_U300
733 select DEBUG_UART_PL01X
526 help 734 help
527 Say Y here if you want the debug print routines to direct 735 Say Y here if you want the debug print routines to direct
528 their output to the uart port on U300 devices. 736 their output to the uart port on U300 devices.
@@ -548,6 +756,7 @@ choice
548 config DEBUG_VEXPRESS_UART0_CA9 756 config DEBUG_VEXPRESS_UART0_CA9
549 bool "Use PL011 UART0 at 0x10009000 (V2P-CA9 core tile)" 757 bool "Use PL011 UART0 at 0x10009000 (V2P-CA9 core tile)"
550 depends on ARCH_VEXPRESS 758 depends on ARCH_VEXPRESS
759 select DEBUG_UART_PL01X
551 help 760 help
552 This option selects UART0 at 0x10009000. Except for custom models, 761 This option selects UART0 at 0x10009000. Except for custom models,
553 this applies only to the V2P-CA9 tile. 762 this applies only to the V2P-CA9 tile.
@@ -555,6 +764,7 @@ choice
555 config DEBUG_VEXPRESS_UART0_RS1 764 config DEBUG_VEXPRESS_UART0_RS1
556 bool "Use PL011 UART0 at 0x1c090000 (RS1 complaint tiles)" 765 bool "Use PL011 UART0 at 0x1c090000 (RS1 complaint tiles)"
557 depends on ARCH_VEXPRESS 766 depends on ARCH_VEXPRESS
767 select DEBUG_UART_PL01X
558 help 768 help
559 This option selects UART0 at 0x1c090000. This applies to most 769 This option selects UART0 at 0x1c090000. This applies to most
560 of the tiles using the RS1 memory map, including all new A-class 770 of the tiles using the RS1 memory map, including all new A-class
@@ -563,6 +773,7 @@ choice
563 config DEBUG_VEXPRESS_UART0_CRX 773 config DEBUG_VEXPRESS_UART0_CRX
564 bool "Use PL011 UART0 at 0xb0090000 (Cortex-R compliant tiles)" 774 bool "Use PL011 UART0 at 0xb0090000 (Cortex-R compliant tiles)"
565 depends on ARCH_VEXPRESS && !MMU 775 depends on ARCH_VEXPRESS && !MMU
776 select DEBUG_UART_PL01X
566 help 777 help
567 This option selects UART0 at 0xb0090000. This is appropriate for 778 This option selects UART0 at 0xb0090000. This is appropriate for
568 Cortex-R series tiles and SMMs, such as Cortex-R5 and Cortex-R7 779 Cortex-R series tiles and SMMs, such as Cortex-R5 and Cortex-R7
@@ -579,7 +790,7 @@ choice
579 depends on !ARCH_MULTIPLATFORM 790 depends on !ARCH_MULTIPLATFORM
580 help 791 help
581 Say Y here if your platform doesn't provide a UART option 792 Say Y here if your platform doesn't provide a UART option
582 below. This relies on your platform choosing the right UART 793 above. This relies on your platform choosing the right UART
583 definition internally in order for low-level debugging to 794 definition internally in order for low-level debugging to
584 work. 795 work.
585 796
@@ -610,11 +821,41 @@ choice
610 For more details about semihosting, please see 821 For more details about semihosting, please see
611 chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd. 822 chapter 8 of DUI0203I_rvct_developer_guide.pdf from ARM Ltd.
612 823
824 config DEBUG_LL_UART_8250
825 bool "Kernel low-level debugging via 8250 UART"
826 help
827 Say Y here if you wish the debug print routes to direct
828 their output to an 8250 UART. You can use this option
829 to provide the parameters for the 8250 UART rather than
830 selecting one of the platform specific options above if
831 you know the parameters for the port.
832
833 This option is preferred over the platform specific
834 options; the platform specific options are deprecated
835 and will be soon removed.
836
837 config DEBUG_LL_UART_PL01X
838 bool "Kernel low-level debugging via ARM Ltd PL01x Primecell UART"
839 help
840 Say Y here if you wish the debug print routes to direct
841 their output to a PL01x Primecell UART. You can use
842 this option to provide the parameters for the UART
843 rather than selecting one of the platform specific
844 options above if you know the parameters for the port.
845
846 This option is preferred over the platform specific
847 options; the platform specific options are deprecated
848 and will be soon removed.
849
613endchoice 850endchoice
614 851
615config DEBUG_EXYNOS_UART 852config DEBUG_EXYNOS_UART
616 bool 853 bool
617 854
855config DEBUG_OMAP2PLUS_UART
856 bool
857 depends on ARCH_OMAP2PLUS
858
618config DEBUG_IMX_UART_PORT 859config DEBUG_IMX_UART_PORT
619 int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \ 860 int "i.MX Debug UART Port Selection" if DEBUG_IMX1_UART || \
620 DEBUG_IMX25_UART || \ 861 DEBUG_IMX25_UART || \
@@ -631,140 +872,19 @@ config DEBUG_IMX_UART_PORT
631 Choose UART port on which kernel low-level debug messages 872 Choose UART port on which kernel low-level debug messages
632 should be output. 873 should be output.
633 874
634choice 875config DEBUG_TEGRA_UART
635 prompt "Low-level debug console UART" 876 bool
636 depends on DEBUG_OMAP2PLUS_UART 877 depends on ARCH_TEGRA
637
638 config DEBUG_OMAP2UART1
639 bool "OMAP2/3/4 UART1 (omap2/3 sdp boards and some omap3 boards)"
640 help
641 This covers at least h4, 2430sdp, 3430sdp, 3630sdp,
642 omap3 torpedo and 3530 lv som.
643
644 config DEBUG_OMAP2UART2
645 bool "OMAP2/3/4 UART2"
646
647 config DEBUG_OMAP2UART3
648 bool "OMAP2 UART3 (n8x0)"
649
650 config DEBUG_OMAP3UART3
651 bool "OMAP3 UART3 (most omap3 boards)"
652 help
653 This covers at least cm_t3x, beagle, crane, devkit8000,
654 igep00x0, ldp, n900, n9(50), pandora, overo, touchbook,
655 and 3517evm.
656
657 config DEBUG_OMAP4UART3
658 bool "OMAP4/5 UART3 (omap4 blaze, panda, omap5 sevm)"
659
660 config DEBUG_OMAP3UART4
661 bool "OMAP36XX UART4"
662
663 config DEBUG_OMAP4UART4
664 bool "OMAP4/5 UART4"
665
666 config DEBUG_TI81XXUART1
667 bool "TI81XX UART1 (ti8148evm)"
668
669 config DEBUG_TI81XXUART2
670 bool "TI81XX UART2"
671
672 config DEBUG_TI81XXUART3
673 bool "TI81XX UART3 (ti8168evm)"
674
675 config DEBUG_AM33XXUART1
676 bool "AM33XX UART1"
677
678 config DEBUG_ZOOM_UART
679 bool "Zoom2/3 UART"
680endchoice
681
682choice
683 prompt "Low-level debug console UART"
684 depends on DEBUG_ROCKCHIP_UART
685
686 config DEBUG_RK29_UART0
687 bool "RK29 UART0"
688
689 config DEBUG_RK29_UART1
690 bool "RK29 UART1"
691
692 config DEBUG_RK29_UART2
693 bool "RK29 UART2"
694
695 config DEBUG_RK3X_UART0
696 bool "RK3X UART0"
697
698 config DEBUG_RK3X_UART1
699 bool "RK3X UART1"
700
701 config DEBUG_RK3X_UART2
702 bool "RK3X UART2"
703
704 config DEBUG_RK3X_UART3
705 bool "RK3X UART3"
706endchoice
707
708choice
709 prompt "Low-level debug console UART"
710 depends on DEBUG_LL && DEBUG_TEGRA_UART
711
712 config TEGRA_DEBUG_UART_AUTO_ODMDATA
713 bool "Via ODMDATA"
714 help
715 Automatically determines which UART to use for low-level debug based
716 on the ODMDATA value. This value is part of the BCT, and is written
717 to the boot memory device using nvflash, or other flashing tool.
718 When bits 19:18 are 3, then bits 17:15 indicate which UART to use;
719 0/1/2/3/4 are UART A/B/C/D/E.
720
721 config TEGRA_DEBUG_UARTA
722 bool "UART A"
723
724 config TEGRA_DEBUG_UARTB
725 bool "UART B"
726
727 config TEGRA_DEBUG_UARTC
728 bool "UART C"
729
730 config TEGRA_DEBUG_UARTD
731 bool "UART D"
732
733 config TEGRA_DEBUG_UARTE
734 bool "UART E"
735
736endchoice
737
738choice
739 prompt "Low-level debug console UART"
740 depends on DEBUG_LL && DEBUG_STI_UART
741
742 config STIH41X_DEBUG_ASC2
743 bool "ASC2 UART"
744 help
745 Say Y here if you want kernel low-level debugging support
746 on STiH415/416 based platforms like b2000, which has
747 default UART wired up to ASC2.
748
749 If unsure, say N.
750
751 config STIH41X_DEBUG_SBC_ASC1
752 bool "SBC ASC1 UART"
753 help
754 Say Y here if you want kernel low-level debugging support
755 on STiH415/416 based platforms like b2020. which has
756 default UART wired up to SBC ASC1.
757
758 If unsure, say N.
759 878
760endchoice 879config DEBUG_STI_UART
880 bool
881 depends on ARCH_STI
761 882
762config DEBUG_LL_INCLUDE 883config DEBUG_LL_INCLUDE
763 string 884 string
764 default "debug/bcm2835.S" if DEBUG_BCM2835 885 default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
765 default "debug/cns3xxx.S" if DEBUG_CNS3XXX 886 default "debug/pl01x.S" if DEBUG_LL_UART_PL01X || DEBUG_UART_PL01X
766 default "debug/exynos.S" if DEBUG_EXYNOS_UART 887 default "debug/exynos.S" if DEBUG_EXYNOS_UART
767 default "debug/highbank.S" if DEBUG_HIGHBANK_UART
768 default "debug/icedcc.S" if DEBUG_ICEDCC 888 default "debug/icedcc.S" if DEBUG_ICEDCC
769 default "debug/imx.S" if DEBUG_IMX1_UART || \ 889 default "debug/imx.S" if DEBUG_IMX1_UART || \
770 DEBUG_IMX25_UART || \ 890 DEBUG_IMX25_UART || \
@@ -775,38 +895,170 @@ config DEBUG_LL_INCLUDE
775 DEBUG_IMX53_UART ||\ 895 DEBUG_IMX53_UART ||\
776 DEBUG_IMX6Q_UART || \ 896 DEBUG_IMX6Q_UART || \
777 DEBUG_IMX6SL_UART 897 DEBUG_IMX6SL_UART
778 default "debug/keystone.S" if DEBUG_KEYSTONE_UART0 || \
779 DEBUG_KEYSTONE_UART1
780 default "debug/mvebu.S" if DEBUG_MVEBU_UART || \
781 DEBUG_MVEBU_UART_ALTERNATE
782 default "debug/mxs.S" if DEBUG_IMX23_UART || DEBUG_IMX28_UART
783 default "debug/nomadik.S" if DEBUG_NOMADIK_UART
784 default "debug/nspire.S" if DEBUG_NSPIRE_CX_UART || \
785 DEBUG_NSPIRE_CLASSIC_UART
786 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART 898 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART
787 default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART
788 default "debug/pxa.S" if DEBUG_PXA_UART1 || DEBUG_MMP_UART2 || \
789 DEBUG_MMP_UART3
790 default "debug/rockchip.S" if DEBUG_ROCKCHIP_UART
791 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 899 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1
792 default "debug/socfpga.S" if DEBUG_SOCFPGA_UART
793 default "debug/sti.S" if DEBUG_STI_UART 900 default "debug/sti.S" if DEBUG_STI_UART
794 default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
795 default "debug/tegra.S" if DEBUG_TEGRA_UART 901 default "debug/tegra.S" if DEBUG_TEGRA_UART
796 default "debug/u300.S" if DEBUG_U300_UART
797 default "debug/ux500.S" if DEBUG_UX500_UART 902 default "debug/ux500.S" if DEBUG_UX500_UART
798 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \ 903 default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT
799 DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1 || \
800 DEBUG_VEXPRESS_UART0_CRX
801 default "debug/vt8500.S" if DEBUG_VT8500_UART0 904 default "debug/vt8500.S" if DEBUG_VT8500_UART0
802 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 905 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
803 default "mach/debug-macro.S" 906 default "mach/debug-macro.S"
804 907
908# Compatibility options for PL01x
909config DEBUG_UART_PL01X
910 def_bool ARCH_EP93XX || \
911 ARCH_INTEGRATOR || \
912 ARCH_SPEAR3XX || \
913 ARCH_SPEAR6XX || \
914 ARCH_SPEAR13XX || \
915 ARCH_VERSATILE
916
917# Compatibility options for 8250
918config DEBUG_UART_8250
919 def_bool ARCH_DOVE || ARCH_EBSA110 || \
920 (FOOTBRIDGE && !DEBUG_DC21285_PORT) || \
921 ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \
922 ARCH_IOP33X || ARCH_IXP4XX || ARCH_KIRKWOOD || \
923 ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC
924
925config DEBUG_UART_PHYS
926 hex "Physical base address of debug UART"
927 default 0x01c20000 if DEBUG_DAVINCI_DMx_UART0
928 default 0x01c28000 if DEBUG_SUNXI_UART0
929 default 0x01c28400 if DEBUG_SUNXI_UART1
930 default 0x01d0c000 if DEBUG_DAVINCI_DA8XX_UART1
931 default 0x01d0d000 if DEBUG_DAVINCI_DA8XX_UART2
932 default 0x02530c00 if DEBUG_KEYSTONE_UART0
933 default 0x02531000 if DEBUG_KEYSTONE_UART1
934 default 0x03010fe0 if ARCH_RPC
935 default 0x08108300 if DEBUG_DAVINCI_TNETV107X_UART1
936 default 0x10009000 if DEBUG_REALVIEW_STD_PORT || DEBUG_CNS3XXX || \
937 DEBUG_VEXPRESS_UART0_CA9
938 default 0x1010c000 if DEBUG_REALVIEW_PB1176_PORT
939 default 0x10124000 if DEBUG_RK3X_UART0
940 default 0x10126000 if DEBUG_RK3X_UART1
941 default 0x101f1000 if ARCH_VERSATILE
942 default 0x101fb000 if DEBUG_NOMADIK_UART
943 default 0x16000000 if ARCH_INTEGRATOR
944 default 0x1c090000 if DEBUG_VEXPRESS_UART0_RS1
945 default 0x20060000 if DEBUG_RK29_UART0
946 default 0x20064000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
947 default 0x20068000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3
948 default 0x20201000 if DEBUG_BCM2835
949 default 0x40090000 if ARCH_LPC32XX
950 default 0x40100000 if DEBUG_PXA_UART1
951 default 0x42000000 if ARCH_GEMINI
952 default 0x7c0003f8 if FOOTBRIDGE
953 default 0x80230000 if DEBUG_PICOXCELL_UART
954 default 0x80070000 if DEBUG_IMX23_UART
955 default 0x80074000 if DEBUG_IMX28_UART
956 default 0x808c0000 if ARCH_EP93XX
957 default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
958 default 0xb0090000 if DEBUG_VEXPRESS_UART0_CRX
959 default 0xc0013000 if DEBUG_U300_UART
960 default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
961 default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
962 default 0xd0000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
963 default 0xd0012000 if DEBUG_MVEBU_UART
964 default 0xd4017000 if DEBUG_MMP_UART2
965 default 0xd4018000 if DEBUG_MMP_UART3
966 default 0xe0000000 if ARCH_SPEAR13XX
967 default 0xf0000be0 if ARCH_EBSA110
968 default 0xf1012000 if DEBUG_MVEBU_UART_ALTERNATE
969 default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \
970 ARCH_ORION5X
971 default 0xf8b00000 if DEBUG_HI3716_UART
972 default 0xfcb00000 if DEBUG_HI3620_UART
973 default 0xfe800000 if ARCH_IOP32X
974 default 0xffc02000 if DEBUG_SOCFPGA_UART
975 default 0xffd82340 if ARCH_IOP13XX
976 default 0xfff36000 if DEBUG_HIGHBANK_UART
977 default 0xfffff700 if ARCH_IOP33X
978 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
979 DEBUG_UART_8250 || DEBUG_UART_PL01X
980
981config DEBUG_UART_VIRT
982 hex "Virtual base address of debug UART"
983 default 0xe0010fe0 if ARCH_RPC
984 default 0xf0000be0 if ARCH_EBSA110
985 default 0xf0009000 if DEBUG_CNS3XXX
986 default 0xf01fb000 if DEBUG_NOMADIK_UART
987 default 0xf0201000 if DEBUG_BCM2835
988 default 0xf11f1000 if ARCH_VERSATILE
989 default 0xf1600000 if ARCH_INTEGRATOR
990 default 0xf1c28000 if DEBUG_SUNXI_UART0
991 default 0xf1c28400 if DEBUG_SUNXI_UART1
992 default 0xf2100000 if DEBUG_PXA_UART1
993 default 0xf4090000 if ARCH_LPC32XX
994 default 0xf4200000 if ARCH_GEMINI
995 default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9
996 default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1
997 default 0xfb009000 if DEBUG_REALVIEW_STD_PORT
998 default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT
999 default 0xfd000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX
1000 default 0xfd000000 if ARCH_SPEAR13XX
1001 default 0xfd012000 if ARCH_MV78XX0
1002 default 0xfde12000 if ARCH_DOVE
1003 default 0xfe012000 if ARCH_ORION5X
1004 default 0xfe017000 if DEBUG_MMP_UART2
1005 default 0xfe018000 if DEBUG_MMP_UART3
1006 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART
1007 default 0xfe230000 if DEBUG_PICOXCELL_UART
1008 default 0xfe800000 if ARCH_IOP32X
1009 default 0xfeb00000 if DEBUG_HI3620_UART || DEBUG_HI3716_UART
1010 default 0xfeb24000 if DEBUG_RK3X_UART0
1011 default 0xfeb26000 if DEBUG_RK3X_UART1
1012 default 0xfeb30c00 if DEBUG_KEYSTONE_UART0
1013 default 0xfeb31000 if DEBUG_KEYSTONE_UART1
1014 default 0xfec12000 if DEBUG_MVEBU_UART || DEBUG_MVEBU_UART_ALTERNATE
1015 default 0xfed60000 if DEBUG_RK29_UART0
1016 default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2
1017 default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3
1018 default 0xfec02000 if DEBUG_SOCFPGA_UART
1019 default 0xfec20000 if DEBUG_DAVINCI_DMx_UART0
1020 default 0xfed0c000 if DEBUG_DAVINCI_DA8XX_UART1
1021 default 0xfed0d000 if DEBUG_DAVINCI_DA8XX_UART2
1022 default 0xfed12000 if ARCH_KIRKWOOD
1023 default 0xfedc0000 if ARCH_EP93XX
1024 default 0xfee003f8 if FOOTBRIDGE
1025 default 0xfee08300 if DEBUG_DAVINCI_TNETV107X_UART1
1026 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART || DEBUG_NSPIRE_CX_UART
1027 default 0xfef36000 if DEBUG_HIGHBANK_UART
1028 default 0xfee82340 if ARCH_IOP13XX
1029 default 0xfef00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN
1030 default 0xfef00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN
1031 default 0xfefff700 if ARCH_IOP33X
1032 default 0xff003000 if DEBUG_U300_UART
1033 default DEBUG_UART_PHYS if !MMU
1034 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \
1035 DEBUG_UART_8250 || DEBUG_UART_PL01X
1036
1037config DEBUG_UART_8250_SHIFT
1038 int "Register offset shift for the 8250 debug UART"
1039 depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
1040 default 0 if FOOTBRIDGE || ARCH_IOP32X
1041 default 2
1042
1043config DEBUG_UART_8250_WORD
1044 bool "Use 32-bit accesses for 8250 UART"
1045 depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
1046 depends on DEBUG_UART_8250_SHIFT >= 2
1047 default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART || \
1048 ARCH_KEYSTONE || \
1049 DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
1050 DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_DAVINCI_TNETV107X_UART1
1051
1052config DEBUG_UART_8250_FLOW_CONTROL
1053 bool "Enable flow control for 8250 UART"
1054 depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250
1055 default y if ARCH_EBSA110 || FOOTBRIDGE || ARCH_GEMINI || ARCH_RPC
1056
805config DEBUG_UNCOMPRESS 1057config DEBUG_UNCOMPRESS
806 bool 1058 bool
807 depends on ARCH_MULTIPLATFORM 1059 depends on ARCH_MULTIPLATFORM
808 default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \ 1060 default y if DEBUG_LL && !DEBUG_OMAP2PLUS_UART && \
809 !DEBUG_TEGRA_UART 1061 (!DEBUG_TEGRA_UART || !ZBOOT_ROM)
810 help 1062 help
811 This option influences the normal decompressor output for 1063 This option influences the normal decompressor output for
812 multiplatform kernels. Normally, multiplatform kernels disable 1064 multiplatform kernels. Normally, multiplatform kernels disable
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 444b4ede0d60..d318987d44a1 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -120,6 +120,35 @@
120 status = "okay"; 120 status = "okay";
121 }; 121 };
122 122
123 musb: usb@47400000 {
124 status = "okay";
125
126 control@44e10000 {
127 status = "okay";
128 };
129
130 usb-phy@47401300 {
131 status = "okay";
132 };
133
134 usb-phy@47401b00 {
135 status = "okay";
136 };
137
138 usb@47401000 {
139 status = "okay";
140 };
141
142 usb@47401800 {
143 status = "okay";
144 dr_mode = "host";
145 };
146
147 dma-controller@07402000 {
148 status = "okay";
149 };
150 };
151
123 i2c0: i2c@44e0b000 { 152 i2c0: i2c@44e0b000 {
124 pinctrl-names = "default"; 153 pinctrl-names = "default";
125 pinctrl-0 = <&i2c0_pins>; 154 pinctrl-0 = <&i2c0_pins>;
diff --git a/arch/arm/boot/dts/am335x-evm.dts b/arch/arm/boot/dts/am335x-evm.dts
index 3aee1a43782d..e8ec8756e498 100644
--- a/arch/arm/boot/dts/am335x-evm.dts
+++ b/arch/arm/boot/dts/am335x-evm.dts
@@ -171,6 +171,35 @@
171 }; 171 };
172 }; 172 };
173 173
174 musb: usb@47400000 {
175 status = "okay";
176
177 control@44e10000 {
178 status = "okay";
179 };
180
181 usb-phy@47401300 {
182 status = "okay";
183 };
184
185 usb-phy@47401b00 {
186 status = "okay";
187 };
188
189 usb@47401000 {
190 status = "okay";
191 };
192
193 usb@47401800 {
194 status = "okay";
195 dr_mode = "host";
196 };
197
198 dma-controller@07402000 {
199 status = "okay";
200 };
201 };
202
174 i2c1: i2c@4802a000 { 203 i2c1: i2c@4802a000 {
175 pinctrl-names = "default"; 204 pinctrl-names = "default";
176 pinctrl-0 = <&i2c1_pins>; 205 pinctrl-0 = <&i2c1_pins>;
diff --git a/arch/arm/boot/dts/am335x-evmsk.dts b/arch/arm/boot/dts/am335x-evmsk.dts
index 0c8ad173d2b0..4f339fa91c57 100644
--- a/arch/arm/boot/dts/am335x-evmsk.dts
+++ b/arch/arm/boot/dts/am335x-evmsk.dts
@@ -14,6 +14,7 @@
14/dts-v1/; 14/dts-v1/;
15 15
16#include "am33xx.dtsi" 16#include "am33xx.dtsi"
17#include <dt-bindings/pwm/pwm.h>
17 18
18/ { 19/ {
19 model = "TI AM335x EVM-SK"; 20 model = "TI AM335x EVM-SK";
@@ -207,6 +208,22 @@
207 }; 208 };
208 }; 209 };
209 210
211 musb: usb@47400000 {
212 status = "okay";
213
214 control@44e10000 {
215 status = "okay";
216 };
217
218 usb-phy@47401300 {
219 status = "okay";
220 };
221
222 usb@47401000 {
223 status = "okay";
224 };
225 };
226
210 epwmss2: epwmss@48304000 { 227 epwmss2: epwmss@48304000 {
211 status = "okay"; 228 status = "okay";
212 229
@@ -298,7 +315,7 @@
298 315
299 backlight { 316 backlight {
300 compatible = "pwm-backlight"; 317 compatible = "pwm-backlight";
301 pwms = <&ecap2 0 50000 1>; 318 pwms = <&ecap2 0 50000 PWM_POLARITY_INVERTED>;
302 brightness-levels = <0 58 61 66 75 90 125 170 255>; 319 brightness-levels = <0 58 61 66 75 90 125 170 255>;
303 default-brightness-level = <8>; 320 default-brightness-level = <8>;
304 }; 321 };
diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
index 38b446ba1ce1..f9c5da9c7fe1 100644
--- a/arch/arm/boot/dts/am33xx.dtsi
+++ b/arch/arm/boot/dts/am33xx.dtsi
@@ -26,6 +26,10 @@
26 serial5 = &uart5; 26 serial5 = &uart5;
27 d_can0 = &dcan0; 27 d_can0 = &dcan0;
28 d_can1 = &dcan1; 28 d_can1 = &dcan1;
29 usb0 = &usb0;
30 usb1 = &usb1;
31 phy0 = &usb0_phy;
32 phy1 = &usb1_phy;
29 }; 33 };
30 34
31 cpus { 35 cpus {
@@ -333,21 +337,132 @@
333 status = "disabled"; 337 status = "disabled";
334 }; 338 };
335 339
336 usb@47400000 { 340 usb: usb@47400000 {
337 compatible = "ti,musb-am33xx"; 341 compatible = "ti,am33xx-usb";
338 reg = <0x47400000 0x1000 /* usbss */ 342 reg = <0x47400000 0x1000>;
339 0x47401000 0x800 /* musb instance 0 */ 343 ranges;
340 0x47401800 0x800>; /* musb instance 1 */ 344 #address-cells = <1>;
341 interrupts = <17 /* usbss */ 345 #size-cells = <1>;
342 18 /* musb instance 0 */
343 19>; /* musb instance 1 */
344 multipoint = <1>;
345 num-eps = <16>;
346 ram-bits = <12>;
347 port0-mode = <3>;
348 port1-mode = <3>;
349 power = <250>;
350 ti,hwmods = "usb_otg_hs"; 346 ti,hwmods = "usb_otg_hs";
347 status = "disabled";
348
349 ctrl_mod: control@44e10000 {
350 compatible = "ti,am335x-usb-ctrl-module";
351 reg = <0x44e10620 0x10
352 0x44e10648 0x4>;
353 reg-names = "phy_ctrl", "wakeup";
354 status = "disabled";
355 };
356
357 usb0_phy: usb-phy@47401300 {
358 compatible = "ti,am335x-usb-phy";
359 reg = <0x47401300 0x100>;
360 reg-names = "phy";
361 status = "disabled";
362 ti,ctrl_mod = <&ctrl_mod>;
363 };
364
365 usb0: usb@47401000 {
366 compatible = "ti,musb-am33xx";
367 status = "disabled";
368 reg = <0x47401400 0x400
369 0x47401000 0x200>;
370 reg-names = "mc", "control";
371
372 interrupts = <18>;
373 interrupt-names = "mc";
374 dr_mode = "otg";
375 mentor,multipoint = <1>;
376 mentor,num-eps = <16>;
377 mentor,ram-bits = <12>;
378 mentor,power = <500>;
379 phys = <&usb0_phy>;
380
381 dmas = <&cppi41dma 0 0 &cppi41dma 1 0
382 &cppi41dma 2 0 &cppi41dma 3 0
383 &cppi41dma 4 0 &cppi41dma 5 0
384 &cppi41dma 6 0 &cppi41dma 7 0
385 &cppi41dma 8 0 &cppi41dma 9 0
386 &cppi41dma 10 0 &cppi41dma 11 0
387 &cppi41dma 12 0 &cppi41dma 13 0
388 &cppi41dma 14 0 &cppi41dma 0 1
389 &cppi41dma 1 1 &cppi41dma 2 1
390 &cppi41dma 3 1 &cppi41dma 4 1
391 &cppi41dma 5 1 &cppi41dma 6 1
392 &cppi41dma 7 1 &cppi41dma 8 1
393 &cppi41dma 9 1 &cppi41dma 10 1
394 &cppi41dma 11 1 &cppi41dma 12 1
395 &cppi41dma 13 1 &cppi41dma 14 1>;
396 dma-names =
397 "rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7",
398 "rx8", "rx9", "rx10", "rx11", "rx12", "rx13",
399 "rx14", "rx15",
400 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
401 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
402 "tx14", "tx15";
403 };
404
405 usb1_phy: usb-phy@47401b00 {
406 compatible = "ti,am335x-usb-phy";
407 reg = <0x47401b00 0x100>;
408 reg-names = "phy";
409 status = "disabled";
410 ti,ctrl_mod = <&ctrl_mod>;
411 };
412
413 usb1: usb@47401800 {
414 compatible = "ti,musb-am33xx";
415 status = "disabled";
416 reg = <0x47401c00 0x400
417 0x47401800 0x200>;
418 reg-names = "mc", "control";
419 interrupts = <19>;
420 interrupt-names = "mc";
421 dr_mode = "otg";
422 mentor,multipoint = <1>;
423 mentor,num-eps = <16>;
424 mentor,ram-bits = <12>;
425 mentor,power = <500>;
426 phys = <&usb1_phy>;
427
428 dmas = <&cppi41dma 15 0 &cppi41dma 16 0
429 &cppi41dma 17 0 &cppi41dma 18 0
430 &cppi41dma 19 0 &cppi41dma 20 0
431 &cppi41dma 21 0 &cppi41dma 22 0
432 &cppi41dma 23 0 &cppi41dma 24 0
433 &cppi41dma 25 0 &cppi41dma 26 0
434 &cppi41dma 27 0 &cppi41dma 28 0
435 &cppi41dma 29 0 &cppi41dma 15 1
436 &cppi41dma 16 1 &cppi41dma 17 1
437 &cppi41dma 18 1 &cppi41dma 19 1
438 &cppi41dma 20 1 &cppi41dma 21 1
439 &cppi41dma 22 1 &cppi41dma 23 1
440 &cppi41dma 24 1 &cppi41dma 25 1
441 &cppi41dma 26 1 &cppi41dma 27 1
442 &cppi41dma 28 1 &cppi41dma 29 1>;
443 dma-names =
444 "rx1", "rx2", "rx3", "rx4", "rx5", "rx6", "rx7",
445 "rx8", "rx9", "rx10", "rx11", "rx12", "rx13",
446 "rx14", "rx15",
447 "tx1", "tx2", "tx3", "tx4", "tx5", "tx6", "tx7",
448 "tx8", "tx9", "tx10", "tx11", "tx12", "tx13",
449 "tx14", "tx15";
450 };
451
452 cppi41dma: dma-controller@07402000 {
453 compatible = "ti,am3359-cppi41";
454 reg = <0x47400000 0x1000
455 0x47402000 0x1000
456 0x47403000 0x1000
457 0x47404000 0x4000>;
458 reg-names = "glue", "controller", "scheduler", "queuemgr";
459 interrupts = <17>;
460 interrupt-names = "glue";
461 #dma-cells = <2>;
462 #dma-channels = <30>;
463 #dma-requests = <256>;
464 status = "disabled";
465 };
351 }; 466 };
352 467
353 epwmss0: epwmss@48300000 { 468 epwmss0: epwmss@48300000 {
diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts b/arch/arm/boot/dts/at91sam9n12ek.dts
index d59b70c6a6a0..3d77dbe406f4 100644
--- a/arch/arm/boot/dts/at91sam9n12ek.dts
+++ b/arch/arm/boot/dts/at91sam9n12ek.dts
@@ -14,11 +14,11 @@
14 compatible = "atmel,at91sam9n12ek", "atmel,at91sam9n12", "atmel,at91sam9"; 14 compatible = "atmel,at91sam9n12ek", "atmel,at91sam9n12", "atmel,at91sam9";
15 15
16 chosen { 16 chosen {
17 bootargs = "mem=128M console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2"; 17 bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=jffs2";
18 }; 18 };
19 19
20 memory { 20 memory {
21 reg = <0x20000000 0x10000000>; 21 reg = <0x20000000 0x8000000>;
22 }; 22 };
23 23
24 clocks { 24 clocks {
diff --git a/arch/arm/boot/dts/at91sam9x5ek.dtsi b/arch/arm/boot/dts/at91sam9x5ek.dtsi
index b753855b2058..49e3c45818c2 100644
--- a/arch/arm/boot/dts/at91sam9x5ek.dtsi
+++ b/arch/arm/boot/dts/at91sam9x5ek.dtsi
@@ -94,8 +94,9 @@
94 94
95 usb0: ohci@00600000 { 95 usb0: ohci@00600000 {
96 status = "okay"; 96 status = "okay";
97 num-ports = <2>; 97 num-ports = <3>;
98 atmel,vbus-gpio = <&pioD 19 GPIO_ACTIVE_LOW 98 atmel,vbus-gpio = <0 /* &pioD 18 GPIO_ACTIVE_LOW *//* Activate to have access to port A */
99 &pioD 19 GPIO_ACTIVE_LOW
99 &pioD 20 GPIO_ACTIVE_LOW 100 &pioD 20 GPIO_ACTIVE_LOW
100 >; 101 >;
101 }; 102 };
diff --git a/arch/arm/boot/dts/atlas6.dtsi b/arch/arm/boot/dts/atlas6.dtsi
index a0f2721ea583..8678e0c11119 100644
--- a/arch/arm/boot/dts/atlas6.dtsi
+++ b/arch/arm/boot/dts/atlas6.dtsi
@@ -329,6 +329,12 @@
329 sirf,function = "uart0"; 329 sirf,function = "uart0";
330 }; 330 };
331 }; 331 };
332 uart0_noflow_pins_a: uart0@1 {
333 uart {
334 sirf,pins = "uart0_nostreamctrlgrp";
335 sirf,function = "uart0_nostreamctrl";
336 };
337 };
332 uart1_pins_a: uart1@0 { 338 uart1_pins_a: uart1@0 {
333 uart { 339 uart {
334 sirf,pins = "uart1grp"; 340 sirf,pins = "uart1grp";
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index ef57277fc38f..376090f07231 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -405,7 +405,7 @@
405 }; 405 };
406 406
407 i2s0: i2s@03830000 { 407 i2s0: i2s@03830000 {
408 compatible = "samsung,i2s-v5"; 408 compatible = "samsung,s5pv210-i2s";
409 reg = <0x03830000 0x100>; 409 reg = <0x03830000 0x100>;
410 dmas = <&pdma0 10 410 dmas = <&pdma0 10
411 &pdma0 9 411 &pdma0 9
@@ -415,16 +415,13 @@
415 <&clock_audss EXYNOS_I2S_BUS>, 415 <&clock_audss EXYNOS_I2S_BUS>,
416 <&clock_audss EXYNOS_SCLK_I2S>; 416 <&clock_audss EXYNOS_SCLK_I2S>;
417 clock-names = "iis", "i2s_opclk0", "i2s_opclk1"; 417 clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
418 samsung,supports-6ch;
419 samsung,supports-rstclr;
420 samsung,supports-secdai;
421 samsung,idma-addr = <0x03000000>; 418 samsung,idma-addr = <0x03000000>;
422 pinctrl-names = "default"; 419 pinctrl-names = "default";
423 pinctrl-0 = <&i2s0_bus>; 420 pinctrl-0 = <&i2s0_bus>;
424 }; 421 };
425 422
426 i2s1: i2s@12D60000 { 423 i2s1: i2s@12D60000 {
427 compatible = "samsung,i2s-v5"; 424 compatible = "samsung,s3c6410-i2s";
428 reg = <0x12D60000 0x100>; 425 reg = <0x12D60000 0x100>;
429 dmas = <&pdma1 12 426 dmas = <&pdma1 12
430 &pdma1 11>; 427 &pdma1 11>;
@@ -436,7 +433,7 @@
436 }; 433 };
437 434
438 i2s2: i2s@12D70000 { 435 i2s2: i2s@12D70000 {
439 compatible = "samsung,i2s-v5"; 436 compatible = "samsung,s3c6410-i2s";
440 reg = <0x12D70000 0x100>; 437 reg = <0x12D70000 0x100>;
441 dmas = <&pdma0 12 438 dmas = <&pdma0 12
442 &pdma0 11>; 439 &pdma0 11>;
diff --git a/arch/arm/boot/dts/exynos5440.dtsi b/arch/arm/boot/dts/exynos5440.dtsi
index ff7f5d855845..586134e2a382 100644
--- a/arch/arm/boot/dts/exynos5440.dtsi
+++ b/arch/arm/boot/dts/exynos5440.dtsi
@@ -248,6 +248,7 @@
248 #interrupt-cells = <1>; 248 #interrupt-cells = <1>;
249 interrupt-map-mask = <0 0 0 0>; 249 interrupt-map-mask = <0 0 0 0>;
250 interrupt-map = <0x0 0 &gic 53>; 250 interrupt-map = <0x0 0 &gic 53>;
251 num-lanes = <4>;
251 }; 252 };
252 253
253 pcie@2a0000 { 254 pcie@2a0000 {
@@ -267,5 +268,6 @@
267 #interrupt-cells = <1>; 268 #interrupt-cells = <1>;
268 interrupt-map-mask = <0 0 0 0>; 269 interrupt-map-mask = <0 0 0 0>;
269 interrupt-map = <0x0 0 &gic 56>; 270 interrupt-map = <0x0 0 &gic 56>;
271 num-lanes = <4>;
270 }; 272 };
271}; 273};
diff --git a/arch/arm/boot/dts/imx28-evk.dts b/arch/arm/boot/dts/imx28-evk.dts
index e035f4664b97..15715d921d14 100644
--- a/arch/arm/boot/dts/imx28-evk.dts
+++ b/arch/arm/boot/dts/imx28-evk.dts
@@ -220,6 +220,7 @@
220 auart0: serial@8006a000 { 220 auart0: serial@8006a000 {
221 pinctrl-names = "default"; 221 pinctrl-names = "default";
222 pinctrl-0 = <&auart0_pins_a>; 222 pinctrl-0 = <&auart0_pins_a>;
223 fsl,uart-has-rtscts;
223 status = "okay"; 224 status = "okay";
224 }; 225 };
225 226
diff --git a/arch/arm/boot/dts/msm8660-surf.dts b/arch/arm/boot/dts/msm8660-surf.dts
index cdc010e0f93e..386d42870215 100644
--- a/arch/arm/boot/dts/msm8660-surf.dts
+++ b/arch/arm/boot/dts/msm8660-surf.dts
@@ -38,7 +38,7 @@
38 }; 38 };
39 39
40 serial@19c40000 { 40 serial@19c40000 {
41 compatible = "qcom,msm-hsuart", "qcom,msm-uart"; 41 compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
42 reg = <0x19c40000 0x1000>, 42 reg = <0x19c40000 0x1000>,
43 <0x19c00000 0x1000>; 43 <0x19c00000 0x1000>;
44 interrupts = <0 195 0x0>; 44 interrupts = <0 195 0x0>;
diff --git a/arch/arm/boot/dts/msm8960-cdp.dts b/arch/arm/boot/dts/msm8960-cdp.dts
index 9c1167b0459b..93e9f7e0b7ad 100644
--- a/arch/arm/boot/dts/msm8960-cdp.dts
+++ b/arch/arm/boot/dts/msm8960-cdp.dts
@@ -38,7 +38,7 @@
38 }; 38 };
39 39
40 serial@16440000 { 40 serial@16440000 {
41 compatible = "qcom,msm-hsuart", "qcom,msm-uart"; 41 compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
42 reg = <0x16440000 0x1000>, 42 reg = <0x16440000 0x1000>,
43 <0x16400000 0x1000>; 43 <0x16400000 0x1000>;
44 interrupts = <0 154 0x0>; 44 interrupts = <0 154 0x0>;
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index e643620417a9..07be2cd7b318 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -644,7 +644,7 @@
644 utmi-mode = <2>; 644 utmi-mode = <2>;
645 ranges; 645 ranges;
646 dwc3@4a030000 { 646 dwc3@4a030000 {
647 compatible = "synopsys,dwc3"; 647 compatible = "snps,dwc3";
648 reg = <0x4a030000 0x1000>; 648 reg = <0x4a030000 0x1000>;
649 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; 649 interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>;
650 usb-phy = <&usb2_phy>, <&usb3_phy>; 650 usb-phy = <&usb2_phy>, <&usb3_phy>;
diff --git a/arch/arm/boot/dts/sama5d3xmb.dtsi b/arch/arm/boot/dts/sama5d3xmb.dtsi
index 8a9e05d8a4b8..dba739b6ef36 100644
--- a/arch/arm/boot/dts/sama5d3xmb.dtsi
+++ b/arch/arm/boot/dts/sama5d3xmb.dtsi
@@ -81,6 +81,14 @@
81 81
82 macb1: ethernet@f802c000 { 82 macb1: ethernet@f802c000 {
83 phy-mode = "rmii"; 83 phy-mode = "rmii";
84
85 #address-cells = <1>;
86 #size-cells = <0>;
87 phy0: ethernet-phy@1 {
88 interrupt-parent = <&pioE>;
89 interrupts = <30 IRQ_TYPE_EDGE_FALLING>;
90 reg = <1>;
91 };
84 }; 92 };
85 93
86 pinctrl@fffff200 { 94 pinctrl@fffff200 {
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts
index 365760b33a26..c8242533268f 100644
--- a/arch/arm/boot/dts/tegra20-seaboard.dts
+++ b/arch/arm/boot/dts/tegra20-seaboard.dts
@@ -566,7 +566,6 @@
566 566
567 usb@c5000000 { 567 usb@c5000000 {
568 status = "okay"; 568 status = "okay";
569 nvidia,vbus-gpio = <&gpio TEGRA_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
570 dr_mode = "otg"; 569 dr_mode = "otg";
571 }; 570 };
572 571
@@ -830,6 +829,8 @@
830 regulator-max-microvolt = <5000000>; 829 regulator-max-microvolt = <5000000>;
831 enable-active-high; 830 enable-active-high;
832 gpio = <&gpio 24 0>; /* PD0 */ 831 gpio = <&gpio 24 0>; /* PD0 */
832 regulator-always-on;
833 regulator-boot-on;
833 }; 834 };
834 }; 835 };
835 836
diff --git a/arch/arm/boot/dts/tegra20-trimslice.dts b/arch/arm/boot/dts/tegra20-trimslice.dts
index ed4b901b0227..1e9d33adb925 100644
--- a/arch/arm/boot/dts/tegra20-trimslice.dts
+++ b/arch/arm/boot/dts/tegra20-trimslice.dts
@@ -312,7 +312,6 @@
312 312
313 usb@c5000000 { 313 usb@c5000000 {
314 status = "okay"; 314 status = "okay";
315 nvidia,vbus-gpio = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_HIGH>;
316 }; 315 };
317 316
318 usb-phy@c5000000 { 317 usb-phy@c5000000 {
@@ -412,6 +411,8 @@
412 regulator-max-microvolt = <5000000>; 411 regulator-max-microvolt = <5000000>;
413 enable-active-high; 412 enable-active-high;
414 gpio = <&gpio 170 0>; /* PV2 */ 413 gpio = <&gpio 170 0>; /* PV2 */
414 regulator-always-on;
415 regulator-boot-on;
415 }; 416 };
416 }; 417 };
417 418
diff --git a/arch/arm/boot/dts/tegra20-whistler.dts b/arch/arm/boot/dts/tegra20-whistler.dts
index ab67c94db280..c703197dca6e 100644
--- a/arch/arm/boot/dts/tegra20-whistler.dts
+++ b/arch/arm/boot/dts/tegra20-whistler.dts
@@ -509,7 +509,6 @@
509 509
510 usb@c5000000 { 510 usb@c5000000 {
511 status = "okay"; 511 status = "okay";
512 nvidia,vbus-gpio = <&tca6416 0 GPIO_ACTIVE_HIGH>;
513 }; 512 };
514 513
515 usb-phy@c5000000 { 514 usb-phy@c5000000 {
@@ -519,7 +518,6 @@
519 518
520 usb@c5008000 { 519 usb@c5008000 {
521 status = "okay"; 520 status = "okay";
522 nvidia,vbus-gpio = <&tca6416 1 GPIO_ACTIVE_HIGH>;
523 }; 521 };
524 522
525 usb-phy@c5008000 { 523 usb-phy@c5008000 {
@@ -588,6 +586,8 @@
588 regulator-max-microvolt = <5000000>; 586 regulator-max-microvolt = <5000000>;
589 enable-active-high; 587 enable-active-high;
590 gpio = <&tca6416 0 0>; /* GPIO_PMU0 */ 588 gpio = <&tca6416 0 0>; /* GPIO_PMU0 */
589 regulator-always-on;
590 regulator-boot-on;
591 }; 591 };
592 592
593 vbus3_reg: regulator@3 { 593 vbus3_reg: regulator@3 {
@@ -598,6 +598,8 @@
598 regulator-max-microvolt = <5000000>; 598 regulator-max-microvolt = <5000000>;
599 enable-active-high; 599 enable-active-high;
600 gpio = <&tca6416 1 0>; /* GPIO_PMU1 */ 600 gpio = <&tca6416 1 0>; /* GPIO_PMU1 */
601 regulator-always-on;
602 regulator-boot-on;
601 }; 603 };
602 }; 604 };
603 605
diff --git a/arch/arm/boot/dts/tegra20.dtsi b/arch/arm/boot/dts/tegra20.dtsi
index 9653fd8288d2..e4570834512e 100644
--- a/arch/arm/boot/dts/tegra20.dtsi
+++ b/arch/arm/boot/dts/tegra20.dtsi
@@ -477,13 +477,13 @@
477 <&tegra_car TEGRA20_CLK_USBD>; 477 <&tegra_car TEGRA20_CLK_USBD>;
478 clock-names = "reg", "pll_u", "timer", "utmi-pads"; 478 clock-names = "reg", "pll_u", "timer", "utmi-pads";
479 nvidia,has-legacy-mode; 479 nvidia,has-legacy-mode;
480 hssync_start_delay = <9>; 480 nvidia,hssync-start-delay = <9>;
481 idle_wait_delay = <17>; 481 nvidia,idle-wait-delay = <17>;
482 elastic_limit = <16>; 482 nvidia,elastic-limit = <16>;
483 term_range_adj = <6>; 483 nvidia,term-range-adj = <6>;
484 xcvr_setup = <9>; 484 nvidia,xcvr-setup = <9>;
485 xcvr_lsfslew = <1>; 485 nvidia,xcvr-lsfslew = <1>;
486 xcvr_lsrslew = <1>; 486 nvidia,xcvr-lsrslew = <1>;
487 status = "disabled"; 487 status = "disabled";
488 }; 488 };
489 489
@@ -527,13 +527,13 @@
527 <&tegra_car TEGRA20_CLK_CLK_M>, 527 <&tegra_car TEGRA20_CLK_CLK_M>,
528 <&tegra_car TEGRA20_CLK_USBD>; 528 <&tegra_car TEGRA20_CLK_USBD>;
529 clock-names = "reg", "pll_u", "timer", "utmi-pads"; 529 clock-names = "reg", "pll_u", "timer", "utmi-pads";
530 hssync_start_delay = <9>; 530 nvidia,hssync-start-delay = <9>;
531 idle_wait_delay = <17>; 531 nvidia,idle-wait-delay = <17>;
532 elastic_limit = <16>; 532 nvidia,elastic-limit = <16>;
533 term_range_adj = <6>; 533 nvidia,term-range-adj = <6>;
534 xcvr_setup = <9>; 534 nvidia,xcvr-setup = <9>;
535 xcvr_lsfslew = <2>; 535 nvidia,xcvr-lsfslew = <2>;
536 xcvr_lsrslew = <2>; 536 nvidia,xcvr-lsrslew = <2>;
537 status = "disabled"; 537 status = "disabled";
538 }; 538 };
539 539
diff --git a/arch/arm/boot/dts/wm8850-w70v2.dts b/arch/arm/boot/dts/wm8850-w70v2.dts
index 90e913fb64be..7a563d2523b0 100644
--- a/arch/arm/boot/dts/wm8850-w70v2.dts
+++ b/arch/arm/boot/dts/wm8850-w70v2.dts
@@ -11,13 +11,14 @@
11 11
12/dts-v1/; 12/dts-v1/;
13/include/ "wm8850.dtsi" 13/include/ "wm8850.dtsi"
14#include <dt-bindings/pwm/pwm.h>
14 15
15/ { 16/ {
16 model = "Wondermedia WM8850-W70v2 Tablet"; 17 model = "Wondermedia WM8850-W70v2 Tablet";
17 18
18 backlight { 19 backlight {
19 compatible = "pwm-backlight"; 20 compatible = "pwm-backlight";
20 pwms = <&pwm 0 50000 1>; /* duty inverted */ 21 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
21 22
22 brightness-levels = <0 40 60 80 100 130 190 255>; 23 brightness-levels = <0 40 60 80 100 130 190 255>;
23 default-brightness-level = <5>; 24 default-brightness-level = <5>;
diff --git a/arch/arm/common/mcpm_head.S b/arch/arm/common/mcpm_head.S
index 80f033614a1f..39c96df3477a 100644
--- a/arch/arm/common/mcpm_head.S
+++ b/arch/arm/common/mcpm_head.S
@@ -151,7 +151,7 @@ mcpm_setup_leave:
151 151
152 mov r0, #INBOUND_NOT_COMING_UP 152 mov r0, #INBOUND_NOT_COMING_UP
153 strb r0, [r8, #MCPM_SYNC_CLUSTER_INBOUND] 153 strb r0, [r8, #MCPM_SYNC_CLUSTER_INBOUND]
154 dsb 154 dsb st
155 sev 155 sev
156 156
157 mov r0, r11 157 mov r0, r11
diff --git a/arch/arm/common/vlock.S b/arch/arm/common/vlock.S
index ff198583f683..8b7df283fedf 100644
--- a/arch/arm/common/vlock.S
+++ b/arch/arm/common/vlock.S
@@ -42,7 +42,7 @@
42 dmb 42 dmb
43 mov \rscratch, #0 43 mov \rscratch, #0
44 strb \rscratch, [\rbase, \rcpu] 44 strb \rscratch, [\rbase, \rcpu]
45 dsb 45 dsb st
46 sev 46 sev
47.endm 47.endm
48 48
@@ -102,7 +102,7 @@ ENTRY(vlock_unlock)
102 dmb 102 dmb
103 mov r1, #VLOCK_OWNER_NONE 103 mov r1, #VLOCK_OWNER_NONE
104 strb r1, [r0, #VLOCK_OWNER_OFFSET] 104 strb r1, [r0, #VLOCK_OWNER_OFFSET]
105 dsb 105 dsb st
106 sev 106 sev
107 bx lr 107 bx lr
108ENDPROC(vlock_unlock) 108ENDPROC(vlock_unlock)
diff --git a/arch/arm/configs/bockw_defconfig b/arch/arm/configs/bockw_defconfig
index 845f5cdf62b5..e7e94948d194 100644
--- a/arch/arm/configs/bockw_defconfig
+++ b/arch/arm/configs/bockw_defconfig
@@ -82,6 +82,13 @@ CONFIG_SERIAL_SH_SCI_CONSOLE=y
82# CONFIG_HWMON is not set 82# CONFIG_HWMON is not set
83CONFIG_I2C=y 83CONFIG_I2C=y
84CONFIG_I2C_RCAR=y 84CONFIG_I2C_RCAR=y
85CONFIG_MEDIA_SUPPORT=y
86CONFIG_MEDIA_CAMERA_SUPPORT=y
87CONFIG_V4L_PLATFORM_DRIVERS=y
88CONFIG_SOC_CAMERA=y
89CONFIG_VIDEO_RCAR_VIN=y
90# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
91CONFIG_VIDEO_ML86V7667=y
85CONFIG_SPI=y 92CONFIG_SPI=y
86CONFIG_SPI_SH_HSPI=y 93CONFIG_SPI_SH_HSPI=y
87CONFIG_USB=y 94CONFIG_USB=y
diff --git a/arch/arm/configs/keystone_defconfig b/arch/arm/configs/keystone_defconfig
index 62e968cac9dc..1f36b823905f 100644
--- a/arch/arm/configs/keystone_defconfig
+++ b/arch/arm/configs/keystone_defconfig
@@ -104,6 +104,7 @@ CONFIG_IP_SCTP=y
104CONFIG_VLAN_8021Q=y 104CONFIG_VLAN_8021Q=y
105CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 105CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
106CONFIG_CMA=y 106CONFIG_CMA=y
107CONFIG_DMA_CMA=y
107CONFIG_MTD=y 108CONFIG_MTD=y
108CONFIG_MTD_CMDLINE_PARTS=y 109CONFIG_MTD_CMDLINE_PARTS=y
109CONFIG_MTD_BLOCK=y 110CONFIG_MTD_BLOCK=y
diff --git a/arch/arm/configs/marzen_defconfig b/arch/arm/configs/marzen_defconfig
index 494e70aeb9e1..c50e52be4463 100644
--- a/arch/arm/configs/marzen_defconfig
+++ b/arch/arm/configs/marzen_defconfig
@@ -84,6 +84,13 @@ CONFIG_GPIO_RCAR=y
84CONFIG_THERMAL=y 84CONFIG_THERMAL=y
85CONFIG_RCAR_THERMAL=y 85CONFIG_RCAR_THERMAL=y
86CONFIG_SSB=y 86CONFIG_SSB=y
87CONFIG_MEDIA_SUPPORT=y
88CONFIG_MEDIA_CAMERA_SUPPORT=y
89CONFIG_V4L_PLATFORM_DRIVERS=y
90CONFIG_SOC_CAMERA=y
91CONFIG_VIDEO_RCAR_VIN=y
92# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
93CONFIG_VIDEO_ADV7180=y
87CONFIG_USB=y 94CONFIG_USB=y
88CONFIG_USB_RCAR_PHY=y 95CONFIG_USB_RCAR_PHY=y
89CONFIG_MMC=y 96CONFIG_MMC=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index 5339e6a4d639..056b27aafbe6 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -78,6 +78,7 @@ CONFIG_MAC80211_RC_PID=y
78CONFIG_MAC80211_RC_DEFAULT_PID=y 78CONFIG_MAC80211_RC_DEFAULT_PID=y
79CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 79CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
80CONFIG_CMA=y 80CONFIG_CMA=y
81CONFIG_DMA_CMA=y
81CONFIG_CONNECTOR=y 82CONFIG_CONNECTOR=y
82CONFIG_DEVTMPFS=y 83CONFIG_DEVTMPFS=y
83CONFIG_DEVTMPFS_MOUNT=y 84CONFIG_DEVTMPFS_MOUNT=y
@@ -185,13 +186,11 @@ CONFIG_OMAP2_DSS_RFBI=y
185CONFIG_OMAP2_DSS_SDI=y 186CONFIG_OMAP2_DSS_SDI=y
186CONFIG_OMAP2_DSS_DSI=y 187CONFIG_OMAP2_DSS_DSI=y
187CONFIG_FB_OMAP2=m 188CONFIG_FB_OMAP2=m
188CONFIG_PANEL_GENERIC_DPI=m 189CONFIG_DISPLAY_ENCODER_TFP410=m
189CONFIG_PANEL_TFP410=m 190CONFIG_DISPLAY_ENCODER_TPD12S015=m
190CONFIG_PANEL_SHARP_LS037V7DW01=m 191CONFIG_DISPLAY_CONNECTOR_DVI=m
191CONFIG_PANEL_NEC_NL8048HL11_01B=m 192CONFIG_DISPLAY_CONNECTOR_HDMI=m
192CONFIG_PANEL_TAAL=m 193CONFIG_DISPLAY_PANEL_DPI=m
193CONFIG_PANEL_TPO_TD043MTEA1=m
194CONFIG_PANEL_ACX565AKM=m
195CONFIG_BACKLIGHT_LCD_SUPPORT=y 194CONFIG_BACKLIGHT_LCD_SUPPORT=y
196CONFIG_LCD_CLASS_DEVICE=y 195CONFIG_LCD_CLASS_DEVICE=y
197CONFIG_LCD_PLATFORM=y 196CONFIG_LCD_PLATFORM=y
diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig
index 1effb43dab80..92d0a149aeb5 100644
--- a/arch/arm/configs/tegra_defconfig
+++ b/arch/arm/configs/tegra_defconfig
@@ -79,6 +79,7 @@ CONFIG_DEVTMPFS=y
79CONFIG_DEVTMPFS_MOUNT=y 79CONFIG_DEVTMPFS_MOUNT=y
80# CONFIG_FIRMWARE_IN_KERNEL is not set 80# CONFIG_FIRMWARE_IN_KERNEL is not set
81CONFIG_CMA=y 81CONFIG_CMA=y
82CONFIG_DMA_CMA=y
82CONFIG_MTD=y 83CONFIG_MTD=y
83CONFIG_MTD_M25P80=y 84CONFIG_MTD_M25P80=y
84CONFIG_PROC_DEVICETREE=y 85CONFIG_PROC_DEVICETREE=y
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index e406d575c94f..5665134bfa3e 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -17,7 +17,8 @@ int arch_timer_arch_init(void);
17 * nicely work out which register we want, and chuck away the rest of 17 * nicely work out which register we want, and chuck away the rest of
18 * the code. At least it does so with a recent GCC (4.6.3). 18 * the code. At least it does so with a recent GCC (4.6.3).
19 */ 19 */
20static inline void arch_timer_reg_write(const int access, const int reg, u32 val) 20static __always_inline
21void arch_timer_reg_write_cp15(int access, enum arch_timer_reg reg, u32 val)
21{ 22{
22 if (access == ARCH_TIMER_PHYS_ACCESS) { 23 if (access == ARCH_TIMER_PHYS_ACCESS) {
23 switch (reg) { 24 switch (reg) {
@@ -28,9 +29,7 @@ static inline void arch_timer_reg_write(const int access, const int reg, u32 val
28 asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val)); 29 asm volatile("mcr p15, 0, %0, c14, c2, 0" : : "r" (val));
29 break; 30 break;
30 } 31 }
31 } 32 } else if (access == ARCH_TIMER_VIRT_ACCESS) {
32
33 if (access == ARCH_TIMER_VIRT_ACCESS) {
34 switch (reg) { 33 switch (reg) {
35 case ARCH_TIMER_REG_CTRL: 34 case ARCH_TIMER_REG_CTRL:
36 asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val)); 35 asm volatile("mcr p15, 0, %0, c14, c3, 1" : : "r" (val));
@@ -44,7 +43,8 @@ static inline void arch_timer_reg_write(const int access, const int reg, u32 val
44 isb(); 43 isb();
45} 44}
46 45
47static inline u32 arch_timer_reg_read(const int access, const int reg) 46static __always_inline
47u32 arch_timer_reg_read_cp15(int access, enum arch_timer_reg reg)
48{ 48{
49 u32 val = 0; 49 u32 val = 0;
50 50
@@ -57,9 +57,7 @@ static inline u32 arch_timer_reg_read(const int access, const int reg)
57 asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val)); 57 asm volatile("mrc p15, 0, %0, c14, c2, 0" : "=r" (val));
58 break; 58 break;
59 } 59 }
60 } 60 } else if (access == ARCH_TIMER_VIRT_ACCESS) {
61
62 if (access == ARCH_TIMER_VIRT_ACCESS) {
63 switch (reg) { 61 switch (reg) {
64 case ARCH_TIMER_REG_CTRL: 62 case ARCH_TIMER_REG_CTRL:
65 asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val)); 63 asm volatile("mrc p15, 0, %0, c14, c3, 1" : "=r" (val));
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index a5fef710af32..fcc1b5bf6979 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -220,9 +220,9 @@
220#ifdef CONFIG_SMP 220#ifdef CONFIG_SMP
221#if __LINUX_ARM_ARCH__ >= 7 221#if __LINUX_ARM_ARCH__ >= 7
222 .ifeqs "\mode","arm" 222 .ifeqs "\mode","arm"
223 ALT_SMP(dmb) 223 ALT_SMP(dmb ish)
224 .else 224 .else
225 ALT_SMP(W(dmb)) 225 ALT_SMP(W(dmb) ish)
226 .endif 226 .endif
227#elif __LINUX_ARM_ARCH__ == 6 227#elif __LINUX_ARM_ARCH__ == 6
228 ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb 228 ALT_SMP(mcr p15, 0, r0, c7, c10, 5) @ dmb
diff --git a/arch/arm/include/asm/barrier.h b/arch/arm/include/asm/barrier.h
index 8dcd9c702d90..60f15e274e6d 100644
--- a/arch/arm/include/asm/barrier.h
+++ b/arch/arm/include/asm/barrier.h
@@ -14,27 +14,27 @@
14#endif 14#endif
15 15
16#if __LINUX_ARM_ARCH__ >= 7 16#if __LINUX_ARM_ARCH__ >= 7
17#define isb() __asm__ __volatile__ ("isb" : : : "memory") 17#define isb(option) __asm__ __volatile__ ("isb " #option : : : "memory")
18#define dsb() __asm__ __volatile__ ("dsb" : : : "memory") 18#define dsb(option) __asm__ __volatile__ ("dsb " #option : : : "memory")
19#define dmb() __asm__ __volatile__ ("dmb" : : : "memory") 19#define dmb(option) __asm__ __volatile__ ("dmb " #option : : : "memory")
20#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6 20#elif defined(CONFIG_CPU_XSC3) || __LINUX_ARM_ARCH__ == 6
21#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ 21#define isb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
22 : : "r" (0) : "memory") 22 : : "r" (0) : "memory")
23#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ 23#define dsb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
24 : : "r" (0) : "memory") 24 : : "r" (0) : "memory")
25#define dmb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \ 25#define dmb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" \
26 : : "r" (0) : "memory") 26 : : "r" (0) : "memory")
27#elif defined(CONFIG_CPU_FA526) 27#elif defined(CONFIG_CPU_FA526)
28#define isb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \ 28#define isb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c5, 4" \
29 : : "r" (0) : "memory") 29 : : "r" (0) : "memory")
30#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ 30#define dsb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
31 : : "r" (0) : "memory") 31 : : "r" (0) : "memory")
32#define dmb() __asm__ __volatile__ ("" : : : "memory") 32#define dmb(x) __asm__ __volatile__ ("" : : : "memory")
33#else 33#else
34#define isb() __asm__ __volatile__ ("" : : : "memory") 34#define isb(x) __asm__ __volatile__ ("" : : : "memory")
35#define dsb() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \ 35#define dsb(x) __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 4" \
36 : : "r" (0) : "memory") 36 : : "r" (0) : "memory")
37#define dmb() __asm__ __volatile__ ("" : : : "memory") 37#define dmb(x) __asm__ __volatile__ ("" : : : "memory")
38#endif 38#endif
39 39
40#ifdef CONFIG_ARCH_HAS_BARRIERS 40#ifdef CONFIG_ARCH_HAS_BARRIERS
@@ -42,7 +42,7 @@
42#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) 42#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
43#define mb() do { dsb(); outer_sync(); } while (0) 43#define mb() do { dsb(); outer_sync(); } while (0)
44#define rmb() dsb() 44#define rmb() dsb()
45#define wmb() mb() 45#define wmb() do { dsb(st); outer_sync(); } while (0)
46#else 46#else
47#define mb() barrier() 47#define mb() barrier()
48#define rmb() barrier() 48#define rmb() barrier()
@@ -54,9 +54,9 @@
54#define smp_rmb() barrier() 54#define smp_rmb() barrier()
55#define smp_wmb() barrier() 55#define smp_wmb() barrier()
56#else 56#else
57#define smp_mb() dmb() 57#define smp_mb() dmb(ish)
58#define smp_rmb() dmb() 58#define smp_rmb() smp_mb()
59#define smp_wmb() dmb() 59#define smp_wmb() dmb(ishst)
60#endif 60#endif
61 61
62#define read_barrier_depends() do { } while(0) 62#define read_barrier_depends() do { } while(0)
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index 17d0ae8672fa..15f2d5bf8875 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -268,8 +268,7 @@ extern void flush_cache_page(struct vm_area_struct *vma, unsigned long user_addr
268 * Harvard caches are synchronised for the user space address range. 268 * Harvard caches are synchronised for the user space address range.
269 * This is used for the ARM private sys_cacheflush system call. 269 * This is used for the ARM private sys_cacheflush system call.
270 */ 270 */
271#define flush_cache_user_range(start,end) \ 271#define flush_cache_user_range(s,e) __cpuc_coherent_user_range(s,e)
272 __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
273 272
274/* 273/*
275 * Perform necessary cache operations to ensure that data previously 274 * Perform necessary cache operations to ensure that data previously
@@ -352,7 +351,7 @@ static inline void flush_cache_vmap(unsigned long start, unsigned long end)
352 * set_pte_at() called from vmap_pte_range() does not 351 * set_pte_at() called from vmap_pte_range() does not
353 * have a DSB after cleaning the cache line. 352 * have a DSB after cleaning the cache line.
354 */ 353 */
355 dsb(); 354 dsb(ishst);
356} 355}
357 356
358static inline void flush_cache_vunmap(unsigned long start, unsigned long end) 357static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
diff --git a/arch/arm/include/asm/dma-contiguous.h b/arch/arm/include/asm/dma-contiguous.h
index 3ed37b4d93da..e072bb2ba1b1 100644
--- a/arch/arm/include/asm/dma-contiguous.h
+++ b/arch/arm/include/asm/dma-contiguous.h
@@ -2,7 +2,7 @@
2#define ASMARM_DMA_CONTIGUOUS_H 2#define ASMARM_DMA_CONTIGUOUS_H
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5#ifdef CONFIG_CMA 5#ifdef CONFIG_DMA_CMA
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <asm-generic/dma-contiguous.h> 8#include <asm-generic/dma-contiguous.h>
diff --git a/arch/arm/include/asm/hardware/debug-8250.S b/arch/arm/include/asm/hardware/debug-8250.S
deleted file mode 100644
index 22c689255e6e..000000000000
--- a/arch/arm/include/asm/hardware/debug-8250.S
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * arch/arm/include/asm/hardware/debug-8250.S
3 *
4 * Copyright (C) 1994-1999 Russell King
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#include <linux/serial_reg.h>
11
12 .macro senduart,rd,rx
13 strb \rd, [\rx, #UART_TX << UART_SHIFT]
14 .endm
15
16 .macro busyuart,rd,rx
171002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT]
18 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
19 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
20 bne 1002b
21 .endm
22
23 .macro waituart,rd,rx
24#ifdef FLOW_CONTROL
251001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
26 tst \rd, #UART_MSR_CTS
27 beq 1001b
28#endif
29 .endm
diff --git a/arch/arm/include/asm/kvm_mmu.h b/arch/arm/include/asm/kvm_mmu.h
index 472ac7091003..9b28c41f4ba9 100644
--- a/arch/arm/include/asm/kvm_mmu.h
+++ b/arch/arm/include/asm/kvm_mmu.h
@@ -64,7 +64,7 @@ void kvm_clear_hyp_idmap(void);
64 64
65static inline void kvm_set_pte(pte_t *pte, pte_t new_pte) 65static inline void kvm_set_pte(pte_t *pte, pte_t new_pte)
66{ 66{
67 pte_val(*pte) = new_pte; 67 *pte = new_pte;
68 /* 68 /*
69 * flush_pmd_entry just takes a void pointer and cleans the necessary 69 * flush_pmd_entry just takes a void pointer and cleans the necessary
70 * cache entries, so we can reuse the function for ptes. 70 * cache entries, so we can reuse the function for ptes.
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 441efc491b50..69b879ac0289 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -65,12 +65,12 @@ struct machine_desc {
65/* 65/*
66 * Current machine - only accessible during boot. 66 * Current machine - only accessible during boot.
67 */ 67 */
68extern struct machine_desc *machine_desc; 68extern const struct machine_desc *machine_desc;
69 69
70/* 70/*
71 * Machine type table - also only accessible during boot 71 * Machine type table - also only accessible during boot
72 */ 72 */
73extern struct machine_desc __arch_info_begin[], __arch_info_end[]; 73extern const struct machine_desc __arch_info_begin[], __arch_info_end[];
74#define for_each_machine_desc(p) \ 74#define for_each_machine_desc(p) \
75 for (p = __arch_info_begin; p < __arch_info_end; p++) 75 for (p = __arch_info_begin; p < __arch_info_end; p++)
76 76
diff --git a/arch/arm/include/asm/memblock.h b/arch/arm/include/asm/memblock.h
index 00ca5f92648e..c2f5102ae659 100644
--- a/arch/arm/include/asm/memblock.h
+++ b/arch/arm/include/asm/memblock.h
@@ -4,8 +4,7 @@
4struct meminfo; 4struct meminfo;
5struct machine_desc; 5struct machine_desc;
6 6
7extern void arm_memblock_init(struct meminfo *, struct machine_desc *); 7void arm_memblock_init(struct meminfo *, const struct machine_desc *);
8
9phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align); 8phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align);
10 9
11#endif 10#endif
diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h
index 0d3a28dbc8e5..ed690c49ef93 100644
--- a/arch/arm/include/asm/module.h
+++ b/arch/arm/include/asm/module.h
@@ -12,6 +12,8 @@ enum {
12 ARM_SEC_CORE, 12 ARM_SEC_CORE,
13 ARM_SEC_EXIT, 13 ARM_SEC_EXIT,
14 ARM_SEC_DEVEXIT, 14 ARM_SEC_DEVEXIT,
15 ARM_SEC_HOT,
16 ARM_SEC_UNLIKELY,
15 ARM_SEC_MAX, 17 ARM_SEC_MAX,
16}; 18};
17 19
diff --git a/arch/arm/include/asm/neon.h b/arch/arm/include/asm/neon.h
new file mode 100644
index 000000000000..8f730fe70093
--- /dev/null
+++ b/arch/arm/include/asm/neon.h
@@ -0,0 +1,36 @@
1/*
2 * linux/arch/arm/include/asm/neon.h
3 *
4 * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org>
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
11#include <asm/hwcap.h>
12
13#define cpu_has_neon() (!!(elf_hwcap & HWCAP_NEON))
14
15#ifdef __ARM_NEON__
16
17/*
18 * If you are affected by the BUILD_BUG below, it probably means that you are
19 * using NEON code /and/ calling the kernel_neon_begin() function from the same
20 * compilation unit. To prevent issues that may arise from GCC reordering or
21 * generating(1) NEON instructions outside of these begin/end functions, the
22 * only supported way of using NEON code in the kernel is by isolating it in a
23 * separate compilation unit, and calling it from another unit from inside a
24 * kernel_neon_begin/kernel_neon_end pair.
25 *
26 * (1) Current GCC (4.7) might generate NEON instructions at O3 level if
27 * -mpfu=neon is set.
28 */
29
30#define kernel_neon_begin() \
31 BUILD_BUG_ON_MSG(1, "kernel_neon_begin() called from NEON code")
32
33#else
34void kernel_neon_begin(void);
35#endif
36void kernel_neon_end(void);
diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
index 04aeb02d2e11..be956dbf6bae 100644
--- a/arch/arm/include/asm/pgtable.h
+++ b/arch/arm/include/asm/pgtable.h
@@ -100,7 +100,7 @@ extern pgprot_t pgprot_s2_device;
100#define PAGE_HYP _MOD_PROT(pgprot_kernel, L_PTE_HYP) 100#define PAGE_HYP _MOD_PROT(pgprot_kernel, L_PTE_HYP)
101#define PAGE_HYP_DEVICE _MOD_PROT(pgprot_hyp_device, L_PTE_HYP) 101#define PAGE_HYP_DEVICE _MOD_PROT(pgprot_hyp_device, L_PTE_HYP)
102#define PAGE_S2 _MOD_PROT(pgprot_s2, L_PTE_S2_RDONLY) 102#define PAGE_S2 _MOD_PROT(pgprot_s2, L_PTE_S2_RDONLY)
103#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_USER | L_PTE_S2_RDONLY) 103#define PAGE_S2_DEVICE _MOD_PROT(pgprot_s2_device, L_PTE_S2_RDWR)
104 104
105#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN | L_PTE_NONE) 105#define __PAGE_NONE __pgprot(_L_PTE_DEFAULT | L_PTE_RDONLY | L_PTE_XN | L_PTE_NONE)
106#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN) 106#define __PAGE_SHARED __pgprot(_L_PTE_DEFAULT | L_PTE_USER | L_PTE_XN)
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h
index a219227c3e43..4a2985e21969 100644
--- a/arch/arm/include/asm/prom.h
+++ b/arch/arm/include/asm/prom.h
@@ -15,13 +15,13 @@
15 15
16#ifdef CONFIG_OF 16#ifdef CONFIG_OF
17 17
18extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys); 18extern const struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
19extern void arm_dt_memblock_reserve(void); 19extern void arm_dt_memblock_reserve(void);
20extern void __init arm_dt_init_cpu_maps(void); 20extern void __init arm_dt_init_cpu_maps(void);
21 21
22#else /* CONFIG_OF */ 22#else /* CONFIG_OF */
23 23
24static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys) 24static inline const struct machine_desc *setup_machine_fdt(unsigned int dt_phys)
25{ 25{
26 return NULL; 26 return NULL;
27} 27}
diff --git a/arch/arm/include/asm/smp_plat.h b/arch/arm/include/asm/smp_plat.h
index 6462a721ebd4..a252c0bfacf5 100644
--- a/arch/arm/include/asm/smp_plat.h
+++ b/arch/arm/include/asm/smp_plat.h
@@ -88,4 +88,7 @@ static inline u32 mpidr_hash_size(void)
88{ 88{
89 return 1 << mpidr_hash.bits; 89 return 1 << mpidr_hash.bits;
90} 90}
91
92extern int platform_can_cpu_hotplug(void);
93
91#endif 94#endif
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index f8b8965666e9..4f2c28060c9a 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -46,7 +46,7 @@ static inline void dsb_sev(void)
46{ 46{
47#if __LINUX_ARM_ARCH__ >= 7 47#if __LINUX_ARM_ARCH__ >= 7
48 __asm__ __volatile__ ( 48 __asm__ __volatile__ (
49 "dsb\n" 49 "dsb ishst\n"
50 SEV 50 SEV
51 ); 51 );
52#else 52#else
@@ -107,7 +107,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
107 " subs %1, %0, %0, ror #16\n" 107 " subs %1, %0, %0, ror #16\n"
108 " addeq %0, %0, %4\n" 108 " addeq %0, %0, %4\n"
109 " strexeq %2, %0, [%3]" 109 " strexeq %2, %0, [%3]"
110 : "=&r" (slock), "=&r" (contended), "=r" (res) 110 : "=&r" (slock), "=&r" (contended), "=&r" (res)
111 : "r" (&lock->slock), "I" (1 << TICKET_SHIFT) 111 : "r" (&lock->slock), "I" (1 << TICKET_SHIFT)
112 : "cc"); 112 : "cc");
113 } while (res); 113 } while (res);
@@ -168,17 +168,20 @@ static inline void arch_write_lock(arch_rwlock_t *rw)
168 168
169static inline int arch_write_trylock(arch_rwlock_t *rw) 169static inline int arch_write_trylock(arch_rwlock_t *rw)
170{ 170{
171 unsigned long tmp; 171 unsigned long contended, res;
172 172
173 __asm__ __volatile__( 173 do {
174" ldrex %0, [%1]\n" 174 __asm__ __volatile__(
175" teq %0, #0\n" 175 " ldrex %0, [%2]\n"
176" strexeq %0, %2, [%1]" 176 " mov %1, #0\n"
177 : "=&r" (tmp) 177 " teq %0, #0\n"
178 : "r" (&rw->lock), "r" (0x80000000) 178 " strexeq %1, %3, [%2]"
179 : "cc"); 179 : "=&r" (contended), "=&r" (res)
180 : "r" (&rw->lock), "r" (0x80000000)
181 : "cc");
182 } while (res);
180 183
181 if (tmp == 0) { 184 if (!contended) {
182 smp_mb(); 185 smp_mb();
183 return 1; 186 return 1;
184 } else { 187 } else {
@@ -254,18 +257,26 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
254 257
255static inline int arch_read_trylock(arch_rwlock_t *rw) 258static inline int arch_read_trylock(arch_rwlock_t *rw)
256{ 259{
257 unsigned long tmp, tmp2 = 1; 260 unsigned long contended, res;
258 261
259 __asm__ __volatile__( 262 do {
260" ldrex %0, [%2]\n" 263 __asm__ __volatile__(
261" adds %0, %0, #1\n" 264 " ldrex %0, [%2]\n"
262" strexpl %1, %0, [%2]\n" 265 " mov %1, #0\n"
263 : "=&r" (tmp), "+r" (tmp2) 266 " adds %0, %0, #1\n"
264 : "r" (&rw->lock) 267 " strexpl %1, %0, [%2]"
265 : "cc"); 268 : "=&r" (contended), "=&r" (res)
269 : "r" (&rw->lock)
270 : "cc");
271 } while (res);
266 272
267 smp_mb(); 273 /* If the lock is negative, then it is already held for write. */
268 return tmp2 == 0; 274 if (contended < 0x80000000) {
275 smp_mb();
276 return 1;
277 } else {
278 return 0;
279 }
269} 280}
270 281
271/* read_can_lock - would read_trylock() succeed? */ 282/* read_can_lock - would read_trylock() succeed? */
diff --git a/arch/arm/include/asm/switch_to.h b/arch/arm/include/asm/switch_to.h
index fa09e6b49bf1..c99e259469f7 100644
--- a/arch/arm/include/asm/switch_to.h
+++ b/arch/arm/include/asm/switch_to.h
@@ -4,6 +4,16 @@
4#include <linux/thread_info.h> 4#include <linux/thread_info.h>
5 5
6/* 6/*
7 * For v7 SMP cores running a preemptible kernel we may be pre-empted
8 * during a TLB maintenance operation, so execute an inner-shareable dsb
9 * to ensure that the maintenance completes in case we migrate to another
10 * CPU.
11 */
12#if defined(CONFIG_PREEMPT) && defined(CONFIG_SMP) && defined(CONFIG_CPU_V7)
13#define finish_arch_switch(prev) dsb(ish)
14#endif
15
16/*
7 * switch_to(prev, next) should switch from task `prev' to `next' 17 * switch_to(prev, next) should switch from task `prev' to `next'
8 * `prev' will never be the same as `next'. schedule() itself 18 * `prev' will never be the same as `next'. schedule() itself
9 * contains the memory barrier to tell GCC not to cache `current'. 19 * contains the memory barrier to tell GCC not to cache `current'.
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index 2b8114fcba09..df5e13d64f2c 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -43,6 +43,16 @@ struct cpu_context_save {
43 __u32 extra[2]; /* Xscale 'acc' register, etc */ 43 __u32 extra[2]; /* Xscale 'acc' register, etc */
44}; 44};
45 45
46struct arm_restart_block {
47 union {
48 /* For user cache flushing */
49 struct {
50 unsigned long start;
51 unsigned long end;
52 } cache;
53 };
54};
55
46/* 56/*
47 * low level task data that entry.S needs immediate access to. 57 * low level task data that entry.S needs immediate access to.
48 * __switch_to() assumes cpu_context follows immediately after cpu_domain. 58 * __switch_to() assumes cpu_context follows immediately after cpu_domain.
@@ -68,6 +78,7 @@ struct thread_info {
68 unsigned long thumbee_state; /* ThumbEE Handler Base register */ 78 unsigned long thumbee_state; /* ThumbEE Handler Base register */
69#endif 79#endif
70 struct restart_block restart_block; 80 struct restart_block restart_block;
81 struct arm_restart_block arm_restart_block;
71}; 82};
72 83
73#define INIT_THREAD_INFO(tsk) \ 84#define INIT_THREAD_INFO(tsk) \
diff --git a/arch/arm/include/asm/tlb.h b/arch/arm/include/asm/tlb.h
index 46e7cfb3e721..0baf7f0d9394 100644
--- a/arch/arm/include/asm/tlb.h
+++ b/arch/arm/include/asm/tlb.h
@@ -43,6 +43,7 @@ struct mmu_gather {
43 struct mm_struct *mm; 43 struct mm_struct *mm;
44 unsigned int fullmm; 44 unsigned int fullmm;
45 struct vm_area_struct *vma; 45 struct vm_area_struct *vma;
46 unsigned long start, end;
46 unsigned long range_start; 47 unsigned long range_start;
47 unsigned long range_end; 48 unsigned long range_end;
48 unsigned int nr; 49 unsigned int nr;
@@ -107,10 +108,12 @@ static inline void tlb_flush_mmu(struct mmu_gather *tlb)
107} 108}
108 109
109static inline void 110static inline void
110tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned int fullmm) 111tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end)
111{ 112{
112 tlb->mm = mm; 113 tlb->mm = mm;
113 tlb->fullmm = fullmm; 114 tlb->fullmm = !(start | (end+1));
115 tlb->start = start;
116 tlb->end = end;
114 tlb->vma = NULL; 117 tlb->vma = NULL;
115 tlb->max = ARRAY_SIZE(tlb->local); 118 tlb->max = ARRAY_SIZE(tlb->local);
116 tlb->pages = tlb->local; 119 tlb->pages = tlb->local;
diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
index f467e9b3f8d5..38960264040c 100644
--- a/arch/arm/include/asm/tlbflush.h
+++ b/arch/arm/include/asm/tlbflush.h
@@ -319,67 +319,110 @@ extern struct cpu_tlb_fns cpu_tlb;
319#define tlb_op(f, regs, arg) __tlb_op(f, "p15, 0, %0, " regs, arg) 319#define tlb_op(f, regs, arg) __tlb_op(f, "p15, 0, %0, " regs, arg)
320#define tlb_l2_op(f, regs, arg) __tlb_op(f, "p15, 1, %0, " regs, arg) 320#define tlb_l2_op(f, regs, arg) __tlb_op(f, "p15, 1, %0, " regs, arg)
321 321
322static inline void local_flush_tlb_all(void) 322static inline void __local_flush_tlb_all(void)
323{ 323{
324 const int zero = 0; 324 const int zero = 0;
325 const unsigned int __tlb_flag = __cpu_tlb_flags; 325 const unsigned int __tlb_flag = __cpu_tlb_flags;
326 326
327 if (tlb_flag(TLB_WB))
328 dsb();
329
330 tlb_op(TLB_V4_U_FULL | TLB_V6_U_FULL, "c8, c7, 0", zero); 327 tlb_op(TLB_V4_U_FULL | TLB_V6_U_FULL, "c8, c7, 0", zero);
331 tlb_op(TLB_V4_D_FULL | TLB_V6_D_FULL, "c8, c6, 0", zero); 328 tlb_op(TLB_V4_D_FULL | TLB_V6_D_FULL, "c8, c6, 0", zero);
332 tlb_op(TLB_V4_I_FULL | TLB_V6_I_FULL, "c8, c5, 0", zero); 329 tlb_op(TLB_V4_I_FULL | TLB_V6_I_FULL, "c8, c5, 0", zero);
333 tlb_op(TLB_V7_UIS_FULL, "c8, c3, 0", zero); 330}
331
332static inline void local_flush_tlb_all(void)
333{
334 const int zero = 0;
335 const unsigned int __tlb_flag = __cpu_tlb_flags;
336
337 if (tlb_flag(TLB_WB))
338 dsb(nshst);
339
340 __local_flush_tlb_all();
341 tlb_op(TLB_V7_UIS_FULL, "c8, c7, 0", zero);
334 342
335 if (tlb_flag(TLB_BARRIER)) { 343 if (tlb_flag(TLB_BARRIER)) {
336 dsb(); 344 dsb(nsh);
337 isb(); 345 isb();
338 } 346 }
339} 347}
340 348
341static inline void local_flush_tlb_mm(struct mm_struct *mm) 349static inline void __flush_tlb_all(void)
342{ 350{
343 const int zero = 0; 351 const int zero = 0;
344 const int asid = ASID(mm);
345 const unsigned int __tlb_flag = __cpu_tlb_flags; 352 const unsigned int __tlb_flag = __cpu_tlb_flags;
346 353
347 if (tlb_flag(TLB_WB)) 354 if (tlb_flag(TLB_WB))
348 dsb(); 355 dsb(ishst);
356
357 __local_flush_tlb_all();
358 tlb_op(TLB_V7_UIS_FULL, "c8, c3, 0", zero);
359
360 if (tlb_flag(TLB_BARRIER)) {
361 dsb(ish);
362 isb();
363 }
364}
365
366static inline void __local_flush_tlb_mm(struct mm_struct *mm)
367{
368 const int zero = 0;
369 const int asid = ASID(mm);
370 const unsigned int __tlb_flag = __cpu_tlb_flags;
349 371
350 if (possible_tlb_flags & (TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) { 372 if (possible_tlb_flags & (TLB_V4_U_FULL|TLB_V4_D_FULL|TLB_V4_I_FULL)) {
351 if (cpumask_test_cpu(get_cpu(), mm_cpumask(mm))) { 373 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(mm))) {
352 tlb_op(TLB_V4_U_FULL, "c8, c7, 0", zero); 374 tlb_op(TLB_V4_U_FULL, "c8, c7, 0", zero);
353 tlb_op(TLB_V4_D_FULL, "c8, c6, 0", zero); 375 tlb_op(TLB_V4_D_FULL, "c8, c6, 0", zero);
354 tlb_op(TLB_V4_I_FULL, "c8, c5, 0", zero); 376 tlb_op(TLB_V4_I_FULL, "c8, c5, 0", zero);
355 } 377 }
356 put_cpu();
357 } 378 }
358 379
359 tlb_op(TLB_V6_U_ASID, "c8, c7, 2", asid); 380 tlb_op(TLB_V6_U_ASID, "c8, c7, 2", asid);
360 tlb_op(TLB_V6_D_ASID, "c8, c6, 2", asid); 381 tlb_op(TLB_V6_D_ASID, "c8, c6, 2", asid);
361 tlb_op(TLB_V6_I_ASID, "c8, c5, 2", asid); 382 tlb_op(TLB_V6_I_ASID, "c8, c5, 2", asid);
383}
384
385static inline void local_flush_tlb_mm(struct mm_struct *mm)
386{
387 const int asid = ASID(mm);
388 const unsigned int __tlb_flag = __cpu_tlb_flags;
389
390 if (tlb_flag(TLB_WB))
391 dsb(nshst);
392
393 __local_flush_tlb_mm(mm);
394 tlb_op(TLB_V7_UIS_ASID, "c8, c7, 2", asid);
395
396 if (tlb_flag(TLB_BARRIER))
397 dsb(nsh);
398}
399
400static inline void __flush_tlb_mm(struct mm_struct *mm)
401{
402 const unsigned int __tlb_flag = __cpu_tlb_flags;
403
404 if (tlb_flag(TLB_WB))
405 dsb(ishst);
406
407 __local_flush_tlb_mm(mm);
362#ifdef CONFIG_ARM_ERRATA_720789 408#ifdef CONFIG_ARM_ERRATA_720789
363 tlb_op(TLB_V7_UIS_ASID, "c8, c3, 0", zero); 409 tlb_op(TLB_V7_UIS_ASID, "c8, c3, 0", 0);
364#else 410#else
365 tlb_op(TLB_V7_UIS_ASID, "c8, c3, 2", asid); 411 tlb_op(TLB_V7_UIS_ASID, "c8, c3, 2", ASID(mm));
366#endif 412#endif
367 413
368 if (tlb_flag(TLB_BARRIER)) 414 if (tlb_flag(TLB_BARRIER))
369 dsb(); 415 dsb(ish);
370} 416}
371 417
372static inline void 418static inline void
373local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr) 419__local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
374{ 420{
375 const int zero = 0; 421 const int zero = 0;
376 const unsigned int __tlb_flag = __cpu_tlb_flags; 422 const unsigned int __tlb_flag = __cpu_tlb_flags;
377 423
378 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm); 424 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
379 425
380 if (tlb_flag(TLB_WB))
381 dsb();
382
383 if (possible_tlb_flags & (TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) && 426 if (possible_tlb_flags & (TLB_V4_U_PAGE|TLB_V4_D_PAGE|TLB_V4_I_PAGE|TLB_V4_I_FULL) &&
384 cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) { 427 cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
385 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", uaddr); 428 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", uaddr);
@@ -392,6 +435,36 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
392 tlb_op(TLB_V6_U_PAGE, "c8, c7, 1", uaddr); 435 tlb_op(TLB_V6_U_PAGE, "c8, c7, 1", uaddr);
393 tlb_op(TLB_V6_D_PAGE, "c8, c6, 1", uaddr); 436 tlb_op(TLB_V6_D_PAGE, "c8, c6, 1", uaddr);
394 tlb_op(TLB_V6_I_PAGE, "c8, c5, 1", uaddr); 437 tlb_op(TLB_V6_I_PAGE, "c8, c5, 1", uaddr);
438}
439
440static inline void
441local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
442{
443 const unsigned int __tlb_flag = __cpu_tlb_flags;
444
445 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
446
447 if (tlb_flag(TLB_WB))
448 dsb(nshst);
449
450 __local_flush_tlb_page(vma, uaddr);
451 tlb_op(TLB_V7_UIS_PAGE, "c8, c7, 1", uaddr);
452
453 if (tlb_flag(TLB_BARRIER))
454 dsb(nsh);
455}
456
457static inline void
458__flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
459{
460 const unsigned int __tlb_flag = __cpu_tlb_flags;
461
462 uaddr = (uaddr & PAGE_MASK) | ASID(vma->vm_mm);
463
464 if (tlb_flag(TLB_WB))
465 dsb(ishst);
466
467 __local_flush_tlb_page(vma, uaddr);
395#ifdef CONFIG_ARM_ERRATA_720789 468#ifdef CONFIG_ARM_ERRATA_720789
396 tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 3", uaddr & PAGE_MASK); 469 tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 3", uaddr & PAGE_MASK);
397#else 470#else
@@ -399,19 +472,14 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
399#endif 472#endif
400 473
401 if (tlb_flag(TLB_BARRIER)) 474 if (tlb_flag(TLB_BARRIER))
402 dsb(); 475 dsb(ish);
403} 476}
404 477
405static inline void local_flush_tlb_kernel_page(unsigned long kaddr) 478static inline void __local_flush_tlb_kernel_page(unsigned long kaddr)
406{ 479{
407 const int zero = 0; 480 const int zero = 0;
408 const unsigned int __tlb_flag = __cpu_tlb_flags; 481 const unsigned int __tlb_flag = __cpu_tlb_flags;
409 482
410 kaddr &= PAGE_MASK;
411
412 if (tlb_flag(TLB_WB))
413 dsb();
414
415 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", kaddr); 483 tlb_op(TLB_V4_U_PAGE, "c8, c7, 1", kaddr);
416 tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", kaddr); 484 tlb_op(TLB_V4_D_PAGE, "c8, c6, 1", kaddr);
417 tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", kaddr); 485 tlb_op(TLB_V4_I_PAGE, "c8, c5, 1", kaddr);
@@ -421,26 +489,75 @@ static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
421 tlb_op(TLB_V6_U_PAGE, "c8, c7, 1", kaddr); 489 tlb_op(TLB_V6_U_PAGE, "c8, c7, 1", kaddr);
422 tlb_op(TLB_V6_D_PAGE, "c8, c6, 1", kaddr); 490 tlb_op(TLB_V6_D_PAGE, "c8, c6, 1", kaddr);
423 tlb_op(TLB_V6_I_PAGE, "c8, c5, 1", kaddr); 491 tlb_op(TLB_V6_I_PAGE, "c8, c5, 1", kaddr);
492}
493
494static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
495{
496 const unsigned int __tlb_flag = __cpu_tlb_flags;
497
498 kaddr &= PAGE_MASK;
499
500 if (tlb_flag(TLB_WB))
501 dsb(nshst);
502
503 __local_flush_tlb_kernel_page(kaddr);
504 tlb_op(TLB_V7_UIS_PAGE, "c8, c7, 1", kaddr);
505
506 if (tlb_flag(TLB_BARRIER)) {
507 dsb(nsh);
508 isb();
509 }
510}
511
512static inline void __flush_tlb_kernel_page(unsigned long kaddr)
513{
514 const unsigned int __tlb_flag = __cpu_tlb_flags;
515
516 kaddr &= PAGE_MASK;
517
518 if (tlb_flag(TLB_WB))
519 dsb(ishst);
520
521 __local_flush_tlb_kernel_page(kaddr);
424 tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 1", kaddr); 522 tlb_op(TLB_V7_UIS_PAGE, "c8, c3, 1", kaddr);
425 523
426 if (tlb_flag(TLB_BARRIER)) { 524 if (tlb_flag(TLB_BARRIER)) {
427 dsb(); 525 dsb(ish);
428 isb(); 526 isb();
429 } 527 }
430} 528}
431 529
530/*
531 * Branch predictor maintenance is paired with full TLB invalidation, so
532 * there is no need for any barriers here.
533 */
534static inline void __local_flush_bp_all(void)
535{
536 const int zero = 0;
537 const unsigned int __tlb_flag = __cpu_tlb_flags;
538
539 if (tlb_flag(TLB_V6_BP))
540 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero));
541}
542
432static inline void local_flush_bp_all(void) 543static inline void local_flush_bp_all(void)
433{ 544{
434 const int zero = 0; 545 const int zero = 0;
435 const unsigned int __tlb_flag = __cpu_tlb_flags; 546 const unsigned int __tlb_flag = __cpu_tlb_flags;
436 547
548 __local_flush_bp_all();
437 if (tlb_flag(TLB_V7_UIS_BP)) 549 if (tlb_flag(TLB_V7_UIS_BP))
438 asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero));
439 else if (tlb_flag(TLB_V6_BP))
440 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero)); 550 asm("mcr p15, 0, %0, c7, c5, 6" : : "r" (zero));
551}
441 552
442 if (tlb_flag(TLB_BARRIER)) 553static inline void __flush_bp_all(void)
443 isb(); 554{
555 const int zero = 0;
556 const unsigned int __tlb_flag = __cpu_tlb_flags;
557
558 __local_flush_bp_all();
559 if (tlb_flag(TLB_V7_UIS_BP))
560 asm("mcr p15, 0, %0, c7, c1, 6" : : "r" (zero));
444} 561}
445 562
446#include <asm/cputype.h> 563#include <asm/cputype.h>
@@ -461,7 +578,7 @@ static inline void dummy_flush_tlb_a15_erratum(void)
461 * Dummy TLBIMVAIS. Using the unmapped address 0 and ASID 0. 578 * Dummy TLBIMVAIS. Using the unmapped address 0 and ASID 0.
462 */ 579 */
463 asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (0)); 580 asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (0));
464 dsb(); 581 dsb(ish);
465} 582}
466#else 583#else
467static inline int erratum_a15_798181(void) 584static inline int erratum_a15_798181(void)
@@ -495,7 +612,7 @@ static inline void flush_pmd_entry(void *pmd)
495 tlb_l2_op(TLB_L2CLEAN_FR, "c15, c9, 1 @ L2 flush_pmd", pmd); 612 tlb_l2_op(TLB_L2CLEAN_FR, "c15, c9, 1 @ L2 flush_pmd", pmd);
496 613
497 if (tlb_flag(TLB_WB)) 614 if (tlb_flag(TLB_WB))
498 dsb(); 615 dsb(ishst);
499} 616}
500 617
501static inline void clean_pmd_entry(void *pmd) 618static inline void clean_pmd_entry(void *pmd)
diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h
new file mode 100644
index 000000000000..a53cdb8f068c
--- /dev/null
+++ b/arch/arm/include/asm/types.h
@@ -0,0 +1,40 @@
1#ifndef _ASM_TYPES_H
2#define _ASM_TYPES_H
3
4#include <asm-generic/int-ll64.h>
5
6/*
7 * The C99 types uintXX_t that are usually defined in 'stdint.h' are not as
8 * unambiguous on ARM as you would expect. For the types below, there is a
9 * difference on ARM between GCC built for bare metal ARM, GCC built for glibc
10 * and the kernel itself, which results in build errors if you try to build with
11 * -ffreestanding and include 'stdint.h' (such as when you include 'arm_neon.h'
12 * in order to use NEON intrinsics)
13 *
14 * As the typedefs for these types in 'stdint.h' are based on builtin defines
15 * supplied by GCC, we can tweak these to align with the kernel's idea of those
16 * types, so 'linux/types.h' and 'stdint.h' can be safely included from the same
17 * source file (provided that -ffreestanding is used).
18 *
19 * int32_t uint32_t uintptr_t
20 * bare metal GCC long unsigned long unsigned int
21 * glibc GCC int unsigned int unsigned int
22 * kernel int unsigned int unsigned long
23 */
24
25#ifdef __INT32_TYPE__
26#undef __INT32_TYPE__
27#define __INT32_TYPE__ int
28#endif
29
30#ifdef __UINT32_TYPE__
31#undef __UINT32_TYPE__
32#define __UINT32_TYPE__ unsigned int
33#endif
34
35#ifdef __UINTPTR_TYPE__
36#undef __UINTPTR_TYPE__
37#define __UINTPTR_TYPE__ unsigned long
38#endif
39
40#endif /* _ASM_TYPES_H */
diff --git a/arch/arm/include/asm/v7m.h b/arch/arm/include/asm/v7m.h
index fa88d09fa3d9..615781c61627 100644
--- a/arch/arm/include/asm/v7m.h
+++ b/arch/arm/include/asm/v7m.h
@@ -15,6 +15,10 @@
15 15
16#define V7M_SCB_VTOR 0x08 16#define V7M_SCB_VTOR 0x08
17 17
18#define V7M_SCB_AIRCR 0x0c
19#define V7M_SCB_AIRCR_VECTKEY (0x05fa << 16)
20#define V7M_SCB_AIRCR_SYSRESETREQ (1 << 2)
21
18#define V7M_SCB_SCR 0x10 22#define V7M_SCB_SCR 0x10
19#define V7M_SCB_SCR_SLEEPDEEP (1 << 2) 23#define V7M_SCB_SCR_SLEEPDEEP (1 << 2)
20 24
@@ -42,3 +46,11 @@
42 */ 46 */
43#define EXC_RET_STACK_MASK 0x00000004 47#define EXC_RET_STACK_MASK 0x00000004
44#define EXC_RET_THREADMODE_PROCESSSTACK 0xfffffffd 48#define EXC_RET_THREADMODE_PROCESSSTACK 0xfffffffd
49
50#ifndef __ASSEMBLY__
51
52enum reboot_mode;
53
54void armv7m_restart(enum reboot_mode mode, const char *cmd);
55
56#endif /* __ASSEMBLY__ */
diff --git a/arch/arm/include/asm/xor.h b/arch/arm/include/asm/xor.h
index 7604673dc427..4ffb26d4cad8 100644
--- a/arch/arm/include/asm/xor.h
+++ b/arch/arm/include/asm/xor.h
@@ -7,7 +7,10 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/hardirq.h>
10#include <asm-generic/xor.h> 11#include <asm-generic/xor.h>
12#include <asm/hwcap.h>
13#include <asm/neon.h>
11 14
12#define __XOR(a1, a2) a1 ^= a2 15#define __XOR(a1, a2) a1 ^= a2
13 16
@@ -138,4 +141,74 @@ static struct xor_block_template xor_block_arm4regs = {
138 xor_speed(&xor_block_arm4regs); \ 141 xor_speed(&xor_block_arm4regs); \
139 xor_speed(&xor_block_8regs); \ 142 xor_speed(&xor_block_8regs); \
140 xor_speed(&xor_block_32regs); \ 143 xor_speed(&xor_block_32regs); \
144 NEON_TEMPLATES; \
141 } while (0) 145 } while (0)
146
147#ifdef CONFIG_KERNEL_MODE_NEON
148
149extern struct xor_block_template const xor_block_neon_inner;
150
151static void
152xor_neon_2(unsigned long bytes, unsigned long *p1, unsigned long *p2)
153{
154 if (in_interrupt()) {
155 xor_arm4regs_2(bytes, p1, p2);
156 } else {
157 kernel_neon_begin();
158 xor_block_neon_inner.do_2(bytes, p1, p2);
159 kernel_neon_end();
160 }
161}
162
163static void
164xor_neon_3(unsigned long bytes, unsigned long *p1, unsigned long *p2,
165 unsigned long *p3)
166{
167 if (in_interrupt()) {
168 xor_arm4regs_3(bytes, p1, p2, p3);
169 } else {
170 kernel_neon_begin();
171 xor_block_neon_inner.do_3(bytes, p1, p2, p3);
172 kernel_neon_end();
173 }
174}
175
176static void
177xor_neon_4(unsigned long bytes, unsigned long *p1, unsigned long *p2,
178 unsigned long *p3, unsigned long *p4)
179{
180 if (in_interrupt()) {
181 xor_arm4regs_4(bytes, p1, p2, p3, p4);
182 } else {
183 kernel_neon_begin();
184 xor_block_neon_inner.do_4(bytes, p1, p2, p3, p4);
185 kernel_neon_end();
186 }
187}
188
189static void
190xor_neon_5(unsigned long bytes, unsigned long *p1, unsigned long *p2,
191 unsigned long *p3, unsigned long *p4, unsigned long *p5)
192{
193 if (in_interrupt()) {
194 xor_arm4regs_5(bytes, p1, p2, p3, p4, p5);
195 } else {
196 kernel_neon_begin();
197 xor_block_neon_inner.do_5(bytes, p1, p2, p3, p4, p5);
198 kernel_neon_end();
199 }
200}
201
202static struct xor_block_template xor_block_neon = {
203 .name = "neon",
204 .do_2 = xor_neon_2,
205 .do_3 = xor_neon_3,
206 .do_4 = xor_neon_4,
207 .do_5 = xor_neon_5
208};
209
210#define NEON_TEMPLATES \
211 do { if (cpu_has_neon()) xor_speed(&xor_block_neon); } while (0)
212#else
213#define NEON_TEMPLATES
214#endif
diff --git a/arch/arm/include/debug/8250.S b/arch/arm/include/debug/8250.S
new file mode 100644
index 000000000000..7a2baf913aa0
--- /dev/null
+++ b/arch/arm/include/debug/8250.S
@@ -0,0 +1,54 @@
1/*
2 * arch/arm/include/debug/8250.S
3 *
4 * Copyright (C) 1994-2013 Russell King
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#include <linux/serial_reg.h>
11
12 .macro addruart, rp, rv, tmp
13 ldr \rp, =CONFIG_DEBUG_UART_PHYS
14 ldr \rv, =CONFIG_DEBUG_UART_VIRT
15 .endm
16
17#ifdef CONFIG_DEBUG_UART_8250_WORD
18 .macro store, rd, rx:vararg
19 str \rd, \rx
20 .endm
21
22 .macro load, rd, rx:vararg
23 ldr \rd, \rx
24 .endm
25#else
26 .macro store, rd, rx:vararg
27 strb \rd, \rx
28 .endm
29
30 .macro load, rd, rx:vararg
31 ldrb \rd, \rx
32 .endm
33#endif
34
35#define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT
36
37 .macro senduart,rd,rx
38 store \rd, [\rx, #UART_TX << UART_SHIFT]
39 .endm
40
41 .macro busyuart,rd,rx
421002: load \rd, [\rx, #UART_LSR << UART_SHIFT]
43 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
44 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
45 bne 1002b
46 .endm
47
48 .macro waituart,rd,rx
49#ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL
501001: load \rd, [\rx, #UART_MSR << UART_SHIFT]
51 tst \rd, #UART_MSR_CTS
52 beq 1001b
53#endif
54 .endm
diff --git a/arch/arm/include/debug/8250_32.S b/arch/arm/include/debug/8250_32.S
deleted file mode 100644
index 8db01eeabbb4..000000000000
--- a/arch/arm/include/debug/8250_32.S
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
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 * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit
9 * accesses to the 8250.
10 */
11
12#include <linux/serial_reg.h>
13
14 .macro senduart,rd,rx
15 str \rd, [\rx, #UART_TX << UART_SHIFT]
16 .endm
17
18 .macro busyuart,rd,rx
191002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
20 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
21 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
22 bne 1002b
23 .endm
24
25 /* The UART's don't have any flow control IO's wired up. */
26 .macro waituart,rd,rx
27 .endm
diff --git a/arch/arm/include/debug/bcm2835.S b/arch/arm/include/debug/bcm2835.S
deleted file mode 100644
index aed9199bd847..000000000000
--- a/arch/arm/include/debug/bcm2835.S
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 2010 Broadcom
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12 */
13
14#define BCM2835_DEBUG_PHYS 0x20201000
15#define BCM2835_DEBUG_VIRT 0xf0201000
16
17 .macro addruart, rp, rv, tmp
18 ldr \rp, =BCM2835_DEBUG_PHYS
19 ldr \rv, =BCM2835_DEBUG_VIRT
20 .endm
21
22#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/cns3xxx.S b/arch/arm/include/debug/cns3xxx.S
deleted file mode 100644
index d04c150baa1c..000000000000
--- a/arch/arm/include/debug/cns3xxx.S
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright 1994-1999 Russell King
5 * Copyright 2008 Cavium Networks
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This file is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License, Version 2, as
10 * published by the Free Software Foundation.
11 */
12
13 .macro addruart,rp,rv,tmp
14 mov \rp, #0x00009000
15 orr \rv, \rp, #0xf0000000 @ virtual base
16 orr \rp, \rp, #0x10000000
17 .endm
18
19#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/highbank.S b/arch/arm/include/debug/highbank.S
deleted file mode 100644
index 8cad4322a5a2..000000000000
--- a/arch/arm/include/debug/highbank.S
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 1994-1999 Russell King
5 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12 .macro addruart,rp,rv,tmp
13 ldr \rv, =0xfee36000
14 ldr \rp, =0xfff36000
15 .endm
16
17#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/keystone.S b/arch/arm/include/debug/keystone.S
deleted file mode 100644
index 9aef9ba3f4f0..000000000000
--- a/arch/arm/include/debug/keystone.S
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * Early serial debug output macro for Keystone SOCs
3 *
4 * Copyright 2013 Texas Instruments, Inc.
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
6 *
7 * Based on RMKs low level debug code.
8 * Copyright (C) 1994-1999 Russell King
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/serial_reg.h>
16
17#define UART_SHIFT 2
18#if defined(CONFIG_DEBUG_KEYSTONE_UART0)
19#define UART_PHYS 0x02530c00
20#define UART_VIRT 0xfeb30c00
21#elif defined(CONFIG_DEBUG_KEYSTONE_UART1)
22#define UART_PHYS 0x02531000
23#define UART_VIRT 0xfeb31000
24#endif
25
26 .macro addruart, rp, rv, tmp
27 ldr \rv, =UART_VIRT @ physical base address
28 ldr \rp, =UART_PHYS @ virtual base address
29 .endm
30
31 .macro senduart,rd,rx
32 str \rd, [\rx, #UART_TX << UART_SHIFT]
33 .endm
34
35 .macro busyuart,rd,rx
361002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
37 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
38 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
39 bne 1002b
40 .endm
41
42 .macro waituart,rd,rx
43 .endm
diff --git a/arch/arm/include/debug/mvebu.S b/arch/arm/include/debug/mvebu.S
deleted file mode 100644
index 6517311a1c91..000000000000
--- a/arch/arm/include/debug/mvebu.S
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Early serial output macro for Marvell SoC
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory Clement <gregory.clement@free-electrons.com>
8 *
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
11 * published by the Free Software Foundation.
12*/
13
14#ifdef CONFIG_DEBUG_MVEBU_UART_ALTERNATE
15#define ARMADA_370_XP_REGS_PHYS_BASE 0xf1000000
16#else
17#define ARMADA_370_XP_REGS_PHYS_BASE 0xd0000000
18#endif
19
20#define ARMADA_370_XP_REGS_VIRT_BASE 0xfec00000
21
22 .macro addruart, rp, rv, tmp
23 ldr \rp, =ARMADA_370_XP_REGS_PHYS_BASE
24 ldr \rv, =ARMADA_370_XP_REGS_VIRT_BASE
25 orr \rp, \rp, #0x00012000
26 orr \rv, \rv, #0x00012000
27 .endm
28
29#define UART_SHIFT 2
30#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/include/debug/mxs.S b/arch/arm/include/debug/mxs.S
deleted file mode 100644
index d86951551ca1..000000000000
--- a/arch/arm/include/debug/mxs.S
+++ /dev/null
@@ -1,27 +0,0 @@
1/* arch/arm/mach-mxs/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12 */
13
14#ifdef CONFIG_DEBUG_IMX23_UART
15#define UART_PADDR 0x80070000
16#elif defined (CONFIG_DEBUG_IMX28_UART)
17#define UART_PADDR 0x80074000
18#endif
19
20#define UART_VADDR 0xfe100000
21
22 .macro addruart, rp, rv, tmp
23 ldr \rp, =UART_PADDR @ physical
24 ldr \rv, =UART_VADDR @ virtual
25 .endm
26
27#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/nomadik.S b/arch/arm/include/debug/nomadik.S
deleted file mode 100644
index 735417922ce2..000000000000
--- a/arch/arm/include/debug/nomadik.S
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 1994-1999 Russell King
5 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11*/
12
13 .macro addruart, rp, rv, tmp
14 mov \rp, #0x00100000
15 add \rp, \rp, #0x000fb000
16 add \rv, \rp, #0xf0000000 @ virtual base
17 add \rp, \rp, #0x10000000 @ physical base address
18 .endm
19
20#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/nspire.S b/arch/arm/include/debug/nspire.S
deleted file mode 100644
index 886fd276fcbc..000000000000
--- a/arch/arm/include/debug/nspire.S
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * linux/arch/arm/include/debug/nspire.S
3 *
4 * Copyright (C) 2013 Daniel Tang <tangrs@tangrs.id.au>
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 */
11
12#define NSPIRE_EARLY_UART_PHYS_BASE 0x90020000
13#define NSPIRE_EARLY_UART_VIRT_BASE 0xfee20000
14
15.macro addruart, rp, rv, tmp
16 ldr \rp, =(NSPIRE_EARLY_UART_PHYS_BASE) @ physical base address
17 ldr \rv, =(NSPIRE_EARLY_UART_VIRT_BASE) @ virtual base address
18.endm
19
20
21#ifdef CONFIG_DEBUG_NSPIRE_CX_UART
22#include <asm/hardware/debug-pl01x.S>
23#endif
24
25#ifdef CONFIG_DEBUG_NSPIRE_CLASSIC_UART
26#define UART_SHIFT 2
27#include <asm/hardware/debug-8250.S>
28#endif
diff --git a/arch/arm/include/debug/picoxcell.S b/arch/arm/include/debug/picoxcell.S
deleted file mode 100644
index bc1f07c49cd4..000000000000
--- a/arch/arm/include/debug/picoxcell.S
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright (c) 2011 Picochip Ltd., Jamie Iles
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
10#define UART_SHIFT 2
11#define PICOXCELL_UART1_BASE 0x80230000
12#define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000)
13
14 .macro addruart, rp, rv, tmp
15 ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE)
16 ldr \rp, =PICOXCELL_UART1_BASE
17 .endm
18
19#include "8250_32.S"
diff --git a/arch/arm/include/asm/hardware/debug-pl01x.S b/arch/arm/include/debug/pl01x.S
index f9fd083eff63..37c6895b87e6 100644
--- a/arch/arm/include/asm/hardware/debug-pl01x.S
+++ b/arch/arm/include/debug/pl01x.S
@@ -1,4 +1,4 @@
1/* arch/arm/include/asm/hardware/debug-pl01x.S 1/* arch/arm/include/debug/pl01x.S
2 * 2 *
3 * Debugging macro include header 3 * Debugging macro include header
4 * 4 *
@@ -12,6 +12,13 @@
12*/ 12*/
13#include <linux/amba/serial.h> 13#include <linux/amba/serial.h>
14 14
15#ifdef CONFIG_DEBUG_UART_PHYS
16 .macro addruart, rp, rv, tmp
17 ldr \rp, =CONFIG_DEBUG_UART_PHYS
18 ldr \rv, =CONFIG_DEBUG_UART_VIRT
19 .endm
20#endif
21
15 .macro senduart,rd,rx 22 .macro senduart,rd,rx
16 strb \rd, [\rx, #UART01x_DR] 23 strb \rd, [\rx, #UART01x_DR]
17 .endm 24 .endm
diff --git a/arch/arm/include/debug/pxa.S b/arch/arm/include/debug/pxa.S
deleted file mode 100644
index e1e795aa3d7f..000000000000
--- a/arch/arm/include/debug/pxa.S
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Early serial output macro for Marvell PXA/MMP SoC
3 *
4 * Copyright (C) 1994-1999 Russell King
5 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
6 *
7 * Copyright (C) 2013 Haojian Zhuang
8 *
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
11 * published by the Free Software Foundation.
12*/
13
14#if defined(CONFIG_DEBUG_PXA_UART1)
15#define PXA_UART_REG_PHYS_BASE 0x40100000
16#define PXA_UART_REG_VIRT_BASE 0xf2100000
17#elif defined(CONFIG_DEBUG_MMP_UART2)
18#define PXA_UART_REG_PHYS_BASE 0xd4017000
19#define PXA_UART_REG_VIRT_BASE 0xfe017000
20#elif defined(CONFIG_DEBUG_MMP_UART3)
21#define PXA_UART_REG_PHYS_BASE 0xd4018000
22#define PXA_UART_REG_VIRT_BASE 0xfe018000
23#else
24#error "Select uart for DEBUG_LL"
25#endif
26
27 .macro addruart, rp, rv, tmp
28 ldr \rp, =PXA_UART_REG_PHYS_BASE
29 ldr \rv, =PXA_UART_REG_VIRT_BASE
30 .endm
31
32#define UART_SHIFT 2
33#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/include/debug/rockchip.S b/arch/arm/include/debug/rockchip.S
deleted file mode 100644
index cfd883e69588..000000000000
--- a/arch/arm/include/debug/rockchip.S
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * Early serial output macro for Rockchip SoCs
3 *
4 * Copyright (C) 2012 Maxime Ripard
5 *
6 * Maxime Ripard <maxime.ripard@free-electrons.com>
7 *
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
10 * published by the Free Software Foundation.
11*/
12
13#if defined(CONFIG_DEBUG_RK29_UART0)
14#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20060000
15#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed60000
16#elif defined(CONFIG_DEBUG_RK29_UART1)
17#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20064000
18#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed64000
19#elif defined(CONFIG_DEBUG_RK29_UART2)
20#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20068000
21#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed68000
22#elif defined(CONFIG_DEBUG_RK3X_UART0)
23#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x10124000
24#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfeb24000
25#elif defined(CONFIG_DEBUG_RK3X_UART1)
26#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x10126000
27#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfeb26000
28#elif defined(CONFIG_DEBUG_RK3X_UART2)
29#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20064000
30#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed64000
31#elif defined(CONFIG_DEBUG_RK3X_UART3)
32#define ROCKCHIP_UART_DEBUG_PHYS_BASE 0x20068000
33#define ROCKCHIP_UART_DEBUG_VIRT_BASE 0xfed68000
34#endif
35
36 .macro addruart, rp, rv, tmp
37 ldr \rp, =ROCKCHIP_UART_DEBUG_PHYS_BASE
38 ldr \rv, =ROCKCHIP_UART_DEBUG_VIRT_BASE
39 .endm
40
41#define UART_SHIFT 2
42#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/include/debug/socfpga.S b/arch/arm/include/debug/socfpga.S
deleted file mode 100644
index 966b2f994946..000000000000
--- a/arch/arm/include/debug/socfpga.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Copyright (C) 1994-1999 Russell King
3 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
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 version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#define UART_SHIFT 2
11#define DEBUG_LL_UART_OFFSET 0x00002000
12
13 .macro addruart, rp, rv, tmp
14 mov \rp, #DEBUG_LL_UART_OFFSET
15 orr \rp, \rp, #0x00c00000
16 orr \rv, \rp, #0xfe000000 @ virtual base
17 orr \rp, \rp, #0xff000000 @ physical base
18 .endm
19
20#include "8250_32.S"
21
diff --git a/arch/arm/include/debug/sunxi.S b/arch/arm/include/debug/sunxi.S
deleted file mode 100644
index 04eb56d5db2c..000000000000
--- a/arch/arm/include/debug/sunxi.S
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * Early serial output macro for Allwinner A1X SoCs
3 *
4 * Copyright (C) 2012 Maxime Ripard
5 *
6 * Maxime Ripard <maxime.ripard@free-electrons.com>
7 *
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
10 * published by the Free Software Foundation.
11*/
12
13#if defined(CONFIG_DEBUG_SUNXI_UART0)
14#define SUNXI_UART_DEBUG_PHYS_BASE 0x01c28000
15#define SUNXI_UART_DEBUG_VIRT_BASE 0xf1c28000
16#elif defined(CONFIG_DEBUG_SUNXI_UART1)
17#define SUNXI_UART_DEBUG_PHYS_BASE 0x01c28400
18#define SUNXI_UART_DEBUG_VIRT_BASE 0xf1c28400
19#endif
20
21 .macro addruart, rp, rv, tmp
22 ldr \rp, =SUNXI_UART_DEBUG_PHYS_BASE
23 ldr \rv, =SUNXI_UART_DEBUG_VIRT_BASE
24 .endm
25
26#define UART_SHIFT 2
27#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S
index 883d7c22fd9d..be6a720dd183 100644
--- a/arch/arm/include/debug/tegra.S
+++ b/arch/arm/include/debug/tegra.S
@@ -221,3 +221,32 @@
2211002: 2211002:
222#endif 222#endif
223 .endm 223 .endm
224
225/*
226 * Storage for the state maintained by the macros above.
227 *
228 * In the kernel proper, this data is located in arch/arm/mach-tegra/common.c.
229 * That's because this header is included from multiple files, and we only
230 * want a single copy of the data. In particular, the UART probing code above
231 * assumes it's running using physical addresses. This is true when this file
232 * is included from head.o, but not when included from debug.o. So we need
233 * to share the probe results between the two copies, rather than having
234 * to re-run the probing again later.
235 *
236 * In the decompressor, we put the symbol/storage right here, since common.c
237 * isn't included in the decompressor build. This symbol gets put in .text
238 * even though it's really data, since .data is discarded from the
239 * decompressor. Luckily, .text is writeable in the decompressor, unless
240 * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
241 */
242#if defined(ZIMAGE)
243tegra_uart_config:
244 /* Debug UART initialization required */
245 .word 1
246 /* Debug UART physical address */
247 .word 0
248 /* Debug UART virtual address */
249 .word 0
250 /* Scratch space for debug macro */
251 .word 0
252#endif
diff --git a/arch/arm/include/debug/u300.S b/arch/arm/include/debug/u300.S
deleted file mode 100644
index 6f04f08a203c..000000000000
--- a/arch/arm/include/debug/u300.S
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * Copyright (C) 2006-2013 ST-Ericsson AB
3 * License terms: GNU General Public License (GPL) version 2
4 * Debugging macro include header.
5 * Author: Linus Walleij <linus.walleij@stericsson.com>
6 */
7#define U300_SLOW_PER_PHYS_BASE 0xc0010000
8#define U300_SLOW_PER_VIRT_BASE 0xff000000
9
10 .macro addruart, rp, rv, tmp
11 /* If we move the address using MMU, use this. */
12 ldr \rp, = U300_SLOW_PER_PHYS_BASE @ MMU off, physical address
13 ldr \rv, = U300_SLOW_PER_VIRT_BASE @ MMU on, virtual address
14 orr \rp, \rp, #0x00003000
15 orr \rv, \rv, #0x00003000
16 .endm
17
18#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/include/debug/ux500.S b/arch/arm/include/debug/ux500.S
index fbd24beeb1fa..aa7f63a8b5e0 100644
--- a/arch/arm/include/debug/ux500.S
+++ b/arch/arm/include/debug/ux500.S
@@ -45,4 +45,4 @@
45 ldr \rv, =UART_VIRT_BASE @ yes, virtual address 45 ldr \rv, =UART_VIRT_BASE @ yes, virtual address
46 .endm 46 .endm
47 47
48#include <asm/hardware/debug-pl01x.S> 48#include <debug/pl01x.S>
diff --git a/arch/arm/include/debug/vexpress.S b/arch/arm/include/debug/vexpress.S
index acafb229e2b6..524acd5a223e 100644
--- a/arch/arm/include/debug/vexpress.S
+++ b/arch/arm/include/debug/vexpress.S
@@ -47,51 +47,5 @@
47 47
48 .endm 48 .endm
49 49
50#include <asm/hardware/debug-pl01x.S> 50#include <debug/pl01x.S>
51
52#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CA9)
53
54 .macro addruart,rp,rv,tmp
55 mov \rp, #DEBUG_LL_UART_OFFSET
56 orr \rv, \rp, #DEBUG_LL_VIRT_BASE
57 orr \rp, \rp, #DEBUG_LL_PHYS_BASE
58 .endm
59
60#include <asm/hardware/debug-pl01x.S>
61
62#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_RS1)
63
64 .macro addruart,rp,rv,tmp
65 mov \rp, #DEBUG_LL_UART_OFFSET_RS1
66 orr \rv, \rp, #DEBUG_LL_VIRT_BASE
67 orr \rp, \rp, #DEBUG_LL_PHYS_BASE_RS1
68 .endm
69
70#include <asm/hardware/debug-pl01x.S>
71
72#elif defined(CONFIG_DEBUG_VEXPRESS_UART0_CRX)
73
74 .macro addruart,rp,tmp,tmp2
75 ldr \rp, =DEBUG_LL_UART_PHYS_CRX
76 .endm
77
78#include <asm/hardware/debug-pl01x.S>
79
80#else /* CONFIG_DEBUG_LL_UART_NONE */
81
82 .macro addruart, rp, rv, tmp
83 /* Safe dummy values */
84 mov \rp, #0
85 mov \rv, #DEBUG_LL_VIRT_BASE
86 .endm
87
88 .macro senduart,rd,rx
89 .endm
90
91 .macro waituart,rd,rx
92 .endm
93
94 .macro busyuart,rd,rx
95 .endm
96
97#endif 51#endif
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 86d10dd47dc4..5140df5f23aa 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -24,7 +24,7 @@ obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
24obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o 24obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
25 25
26ifeq ($(CONFIG_CPU_V7M),y) 26ifeq ($(CONFIG_CPU_V7M),y)
27obj-y += entry-v7m.o 27obj-y += entry-v7m.o v7m.o
28else 28else
29obj-y += entry-armv.o 29obj-y += entry-armv.o
30endif 30endif
diff --git a/arch/arm/kernel/atags.h b/arch/arm/kernel/atags.h
index 9edc9692332d..ec4164da6e30 100644
--- a/arch/arm/kernel/atags.h
+++ b/arch/arm/kernel/atags.h
@@ -7,9 +7,10 @@ static inline void save_atags(struct tag *tags) { }
7void convert_to_tag_list(struct tag *tags); 7void convert_to_tag_list(struct tag *tags);
8 8
9#ifdef CONFIG_ATAGS 9#ifdef CONFIG_ATAGS
10struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr); 10const struct machine_desc *setup_machine_tags(phys_addr_t __atags_pointer,
11 unsigned int machine_nr);
11#else 12#else
12static inline struct machine_desc * 13static inline const struct machine_desc *
13setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr) 14setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
14{ 15{
15 early_print("no ATAGS support: can't continue\n"); 16 early_print("no ATAGS support: can't continue\n");
diff --git a/arch/arm/kernel/atags_parse.c b/arch/arm/kernel/atags_parse.c
index 14512e6931d8..8c14de8180c0 100644
--- a/arch/arm/kernel/atags_parse.c
+++ b/arch/arm/kernel/atags_parse.c
@@ -178,11 +178,11 @@ static void __init squash_mem_tags(struct tag *tag)
178 tag->hdr.tag = ATAG_NONE; 178 tag->hdr.tag = ATAG_NONE;
179} 179}
180 180
181struct machine_desc * __init setup_machine_tags(phys_addr_t __atags_pointer, 181const struct machine_desc * __init
182 unsigned int machine_nr) 182setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
183{ 183{
184 struct tag *tags = (struct tag *)&default_tags; 184 struct tag *tags = (struct tag *)&default_tags;
185 struct machine_desc *mdesc = NULL, *p; 185 const struct machine_desc *mdesc = NULL, *p;
186 char *from = default_command_line; 186 char *from = default_command_line;
187 187
188 default_tags.mem.start = PHYS_OFFSET; 188 default_tags.mem.start = PHYS_OFFSET;
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 261fcc826169..88e14d74b6de 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -525,11 +525,6 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
525 * Assign resources. 525 * Assign resources.
526 */ 526 */
527 pci_bus_assign_resources(bus); 527 pci_bus_assign_resources(bus);
528
529 /*
530 * Enable bridges
531 */
532 pci_enable_bridges(bus);
533 } 528 }
534 529
535 /* 530 /*
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index 5859c8bc727c..f35906b3d8c9 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -169,6 +169,11 @@ void __init arm_dt_init_cpu_maps(void)
169 } 169 }
170} 170}
171 171
172bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
173{
174 return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
175}
176
172/** 177/**
173 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel 178 * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
174 * @dt_phys: physical address of dt blob 179 * @dt_phys: physical address of dt blob
@@ -176,10 +181,10 @@ void __init arm_dt_init_cpu_maps(void)
176 * If a dtb was passed to the kernel in r2, then use it to choose the 181 * If a dtb was passed to the kernel in r2, then use it to choose the
177 * correct machine_desc and to setup the system. 182 * correct machine_desc and to setup the system.
178 */ 183 */
179struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys) 184const struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
180{ 185{
181 struct boot_param_header *devtree; 186 struct boot_param_header *devtree;
182 struct machine_desc *mdesc, *mdesc_best = NULL; 187 const struct machine_desc *mdesc, *mdesc_best = NULL;
183 unsigned int score, mdesc_score = ~1; 188 unsigned int score, mdesc_score = ~1;
184 unsigned long dt_root; 189 unsigned long dt_root;
185 const char *model; 190 const char *model;
@@ -188,7 +193,7 @@ struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
188 DT_MACHINE_START(GENERIC_DT, "Generic DT based system") 193 DT_MACHINE_START(GENERIC_DT, "Generic DT based system")
189 MACHINE_END 194 MACHINE_END
190 195
191 mdesc_best = (struct machine_desc *)&__mach_desc_GENERIC_DT; 196 mdesc_best = &__mach_desc_GENERIC_DT;
192#endif 197#endif
193 198
194 if (!dt_phys) 199 if (!dt_phys)
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index d40d0ef389db..9cbe70c8b0ef 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -357,7 +357,8 @@ ENDPROC(__pabt_svc)
357 .endm 357 .endm
358 358
359 .macro kuser_cmpxchg_check 359 .macro kuser_cmpxchg_check
360#if !defined(CONFIG_CPU_32v6K) && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) 360#if !defined(CONFIG_CPU_32v6K) && defined(CONFIG_KUSER_HELPERS) && \
361 !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
361#ifndef CONFIG_MMU 362#ifndef CONFIG_MMU
362#warning "NPTL on non MMU needs fixing" 363#warning "NPTL on non MMU needs fixing"
363#else 364#else
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 94104bf69719..74ad15d1a065 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -442,10 +442,10 @@ local_restart:
442 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine 442 ldrcc pc, [tbl, scno, lsl #2] @ call sys_* routine
443 443
444 add r1, sp, #S_OFF 444 add r1, sp, #S_OFF
4452: mov why, #0 @ no longer a real syscall
446 cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) 445 cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE)
447 eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back 446 eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back
448 bcs arm_syscall 447 bcs arm_syscall
4482: mov why, #0 @ no longer a real syscall
449 b sys_ni_syscall @ not private func 449 b sys_ni_syscall @ not private func
450 450
451#if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI) 451#if defined(CONFIG_OABI_COMPAT) || !defined(CONFIG_AEABI)
diff --git a/arch/arm/kernel/fiq.c b/arch/arm/kernel/fiq.c
index 25442f451148..918875d96d5d 100644
--- a/arch/arm/kernel/fiq.c
+++ b/arch/arm/kernel/fiq.c
@@ -84,17 +84,14 @@ int show_fiq_list(struct seq_file *p, int prec)
84 84
85void set_fiq_handler(void *start, unsigned int length) 85void set_fiq_handler(void *start, unsigned int length)
86{ 86{
87#if defined(CONFIG_CPU_USE_DOMAINS)
88 void *base = (void *)0xffff0000;
89#else
90 void *base = vectors_page; 87 void *base = vectors_page;
91#endif
92 unsigned offset = FIQ_OFFSET; 88 unsigned offset = FIQ_OFFSET;
93 89
94 memcpy(base + offset, start, length); 90 memcpy(base + offset, start, length);
91 if (!cache_is_vipt_nonaliasing())
92 flush_icache_range((unsigned long)base + offset, offset +
93 length);
95 flush_icache_range(0xffff0000 + offset, 0xffff0000 + offset + length); 94 flush_icache_range(0xffff0000 + offset, 0xffff0000 + offset + length);
96 if (!vectors_high())
97 flush_icache_range(offset, offset + length);
98} 95}
99 96
100int claim_fiq(struct fiq_handler *f) 97int claim_fiq(struct fiq_handler *f)
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c
index 4fb074c446bf..57221e349a7c 100644
--- a/arch/arm/kernel/machine_kexec.c
+++ b/arch/arm/kernel/machine_kexec.c
@@ -15,6 +15,7 @@
15#include <asm/mmu_context.h> 15#include <asm/mmu_context.h>
16#include <asm/cacheflush.h> 16#include <asm/cacheflush.h>
17#include <asm/mach-types.h> 17#include <asm/mach-types.h>
18#include <asm/smp_plat.h>
18#include <asm/system_misc.h> 19#include <asm/system_misc.h>
19 20
20extern const unsigned char relocate_new_kernel[]; 21extern const unsigned char relocate_new_kernel[];
@@ -39,6 +40,14 @@ int machine_kexec_prepare(struct kimage *image)
39 int i, err; 40 int i, err;
40 41
41 /* 42 /*
43 * Validate that if the current HW supports SMP, then the SW supports
44 * and implements CPU hotplug for the current HW. If not, we won't be
45 * able to kexec reliably, so fail the prepare operation.
46 */
47 if (num_possible_cpus() > 1 && !platform_can_cpu_hotplug())
48 return -EINVAL;
49
50 /*
42 * No segment at default ATAGs address. try to locate 51 * No segment at default ATAGs address. try to locate
43 * a dtb using magic. 52 * a dtb using magic.
44 */ 53 */
@@ -73,6 +82,7 @@ void machine_crash_nonpanic_core(void *unused)
73 crash_save_cpu(&regs, smp_processor_id()); 82 crash_save_cpu(&regs, smp_processor_id());
74 flush_cache_all(); 83 flush_cache_all();
75 84
85 set_cpu_online(smp_processor_id(), false);
76 atomic_dec(&waiting_for_crash_ipi); 86 atomic_dec(&waiting_for_crash_ipi);
77 while (1) 87 while (1)
78 cpu_relax(); 88 cpu_relax();
@@ -134,10 +144,13 @@ void machine_kexec(struct kimage *image)
134 unsigned long reboot_code_buffer_phys; 144 unsigned long reboot_code_buffer_phys;
135 void *reboot_code_buffer; 145 void *reboot_code_buffer;
136 146
137 if (num_online_cpus() > 1) { 147 /*
138 pr_err("kexec: error: multiple CPUs still online\n"); 148 * This can only happen if machine_shutdown() failed to disable some
139 return; 149 * CPU, and that can only happen if the checks in
140 } 150 * machine_kexec_prepare() were not correct. If this fails, we can't
151 * reliably kexec anyway, so BUG_ON is appropriate.
152 */
153 BUG_ON(num_online_cpus() > 1);
141 154
142 page_list = image->head & PAGE_MASK; 155 page_list = image->head & PAGE_MASK;
143 156
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 85c3fb6c93c2..084dc8896986 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -292,12 +292,20 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs,
292 maps[ARM_SEC_CORE].unw_sec = s; 292 maps[ARM_SEC_CORE].unw_sec = s;
293 else if (strcmp(".ARM.exidx.exit.text", secname) == 0) 293 else if (strcmp(".ARM.exidx.exit.text", secname) == 0)
294 maps[ARM_SEC_EXIT].unw_sec = s; 294 maps[ARM_SEC_EXIT].unw_sec = s;
295 else if (strcmp(".ARM.exidx.text.unlikely", secname) == 0)
296 maps[ARM_SEC_UNLIKELY].unw_sec = s;
297 else if (strcmp(".ARM.exidx.text.hot", secname) == 0)
298 maps[ARM_SEC_HOT].unw_sec = s;
295 else if (strcmp(".init.text", secname) == 0) 299 else if (strcmp(".init.text", secname) == 0)
296 maps[ARM_SEC_INIT].txt_sec = s; 300 maps[ARM_SEC_INIT].txt_sec = s;
297 else if (strcmp(".text", secname) == 0) 301 else if (strcmp(".text", secname) == 0)
298 maps[ARM_SEC_CORE].txt_sec = s; 302 maps[ARM_SEC_CORE].txt_sec = s;
299 else if (strcmp(".exit.text", secname) == 0) 303 else if (strcmp(".exit.text", secname) == 0)
300 maps[ARM_SEC_EXIT].txt_sec = s; 304 maps[ARM_SEC_EXIT].txt_sec = s;
305 else if (strcmp(".text.unlikely", secname) == 0)
306 maps[ARM_SEC_UNLIKELY].txt_sec = s;
307 else if (strcmp(".text.hot", secname) == 0)
308 maps[ARM_SEC_HOT].txt_sec = s;
301 } 309 }
302 310
303 for (i = 0; i < ARM_SEC_MAX; i++) 311 for (i = 0; i < ARM_SEC_MAX; i++)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index d9f5cd4e533f..e186ee1e63f6 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -53,7 +53,12 @@ armpmu_map_cache_event(const unsigned (*cache_map)
53static int 53static int
54armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config) 54armpmu_map_hw_event(const unsigned (*event_map)[PERF_COUNT_HW_MAX], u64 config)
55{ 55{
56 int mapping = (*event_map)[config]; 56 int mapping;
57
58 if (config >= PERF_COUNT_HW_MAX)
59 return -EINVAL;
60
61 mapping = (*event_map)[config];
57 return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping; 62 return mapping == HW_OP_UNSUPPORTED ? -ENOENT : mapping;
58} 63}
59 64
@@ -253,6 +258,9 @@ validate_event(struct pmu_hw_events *hw_events,
253 struct arm_pmu *armpmu = to_arm_pmu(event->pmu); 258 struct arm_pmu *armpmu = to_arm_pmu(event->pmu);
254 struct pmu *leader_pmu = event->group_leader->pmu; 259 struct pmu *leader_pmu = event->group_leader->pmu;
255 260
261 if (is_software_event(event))
262 return 1;
263
256 if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF) 264 if (event->pmu != leader_pmu || event->state < PERF_EVENT_STATE_OFF)
257 return 1; 265 return 1;
258 266
diff --git a/arch/arm/kernel/perf_event_cpu.c b/arch/arm/kernel/perf_event_cpu.c
index aebe0e99c153..8d6147b2001f 100644
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -118,7 +118,8 @@ static int cpu_pmu_request_irq(struct arm_pmu *cpu_pmu, irq_handler_t handler)
118 continue; 118 continue;
119 } 119 }
120 120
121 err = request_irq(irq, handler, IRQF_NOBALANCING, "arm-pmu", 121 err = request_irq(irq, handler,
122 IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
122 cpu_pmu); 123 cpu_pmu);
123 if (err) { 124 if (err) {
124 pr_err("unable to request IRQ%d for ARM PMU counters\n", 125 pr_err("unable to request IRQ%d for ARM PMU counters\n",
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 536c85fe72a8..94f6b05f9e24 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -462,7 +462,7 @@ int in_gate_area_no_mm(unsigned long addr)
462{ 462{
463 return in_gate_area(NULL, addr); 463 return in_gate_area(NULL, addr);
464} 464}
465#define is_gate_vma(vma) ((vma) = &gate_vma) 465#define is_gate_vma(vma) ((vma) == &gate_vma)
466#else 466#else
467#define is_gate_vma(vma) 0 467#define is_gate_vma(vma) 0
468#endif 468#endif
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index afc2489ee13b..0e1e2b3afa45 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -72,10 +72,10 @@ static int __init fpe_setup(char *line)
72__setup("fpe=", fpe_setup); 72__setup("fpe=", fpe_setup);
73#endif 73#endif
74 74
75extern void paging_init(struct machine_desc *desc); 75extern void paging_init(const struct machine_desc *desc);
76extern void sanity_check_meminfo(void); 76extern void sanity_check_meminfo(void);
77extern enum reboot_mode reboot_mode; 77extern enum reboot_mode reboot_mode;
78extern void setup_dma_zone(struct machine_desc *desc); 78extern void setup_dma_zone(const struct machine_desc *desc);
79 79
80unsigned int processor_id; 80unsigned int processor_id;
81EXPORT_SYMBOL(processor_id); 81EXPORT_SYMBOL(processor_id);
@@ -139,7 +139,7 @@ EXPORT_SYMBOL(elf_platform);
139static const char *cpu_name; 139static const char *cpu_name;
140static const char *machine_name; 140static const char *machine_name;
141static char __initdata cmd_line[COMMAND_LINE_SIZE]; 141static char __initdata cmd_line[COMMAND_LINE_SIZE];
142struct machine_desc *machine_desc __initdata; 142const struct machine_desc *machine_desc __initdata;
143 143
144static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } }; 144static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
145#define ENDIANNESS ((char)endian_test.l) 145#define ENDIANNESS ((char)endian_test.l)
@@ -607,7 +607,7 @@ static void __init setup_processor(void)
607 607
608void __init dump_machine_table(void) 608void __init dump_machine_table(void)
609{ 609{
610 struct machine_desc *p; 610 const struct machine_desc *p;
611 611
612 early_print("Available machine support:\n\nID (hex)\tNAME\n"); 612 early_print("Available machine support:\n\nID (hex)\tNAME\n");
613 for_each_machine_desc(p) 613 for_each_machine_desc(p)
@@ -694,7 +694,7 @@ static int __init early_mem(char *p)
694} 694}
695early_param("mem", early_mem); 695early_param("mem", early_mem);
696 696
697static void __init request_standard_resources(struct machine_desc *mdesc) 697static void __init request_standard_resources(const struct machine_desc *mdesc)
698{ 698{
699 struct memblock_region *region; 699 struct memblock_region *region;
700 struct resource *res; 700 struct resource *res;
@@ -852,7 +852,7 @@ void __init hyp_mode_check(void)
852 852
853void __init setup_arch(char **cmdline_p) 853void __init setup_arch(char **cmdline_p)
854{ 854{
855 struct machine_desc *mdesc; 855 const struct machine_desc *mdesc;
856 856
857 setup_processor(); 857 setup_processor();
858 mdesc = setup_machine_fdt(__atags_pointer); 858 mdesc = setup_machine_fdt(__atags_pointer);
@@ -994,15 +994,6 @@ static int c_show(struct seq_file *m, void *v)
994 seq_printf(m, "model name\t: %s rev %d (%s)\n", 994 seq_printf(m, "model name\t: %s rev %d (%s)\n",
995 cpu_name, cpuid & 15, elf_platform); 995 cpu_name, cpuid & 15, elf_platform);
996 996
997#if defined(CONFIG_SMP)
998 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
999 per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
1000 (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
1001#else
1002 seq_printf(m, "BogoMIPS\t: %lu.%02lu\n",
1003 loops_per_jiffy / (500000/HZ),
1004 (loops_per_jiffy / (5000/HZ)) % 100);
1005#endif
1006 /* dump out the processor features */ 997 /* dump out the processor features */
1007 seq_puts(m, "Features\t: "); 998 seq_puts(m, "Features\t: ");
1008 999
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index c2b4f8f0be9a..92d10e503746 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -145,6 +145,16 @@ int boot_secondary(unsigned int cpu, struct task_struct *idle)
145 return -ENOSYS; 145 return -ENOSYS;
146} 146}
147 147
148int platform_can_cpu_hotplug(void)
149{
150#ifdef CONFIG_HOTPLUG_CPU
151 if (smp_ops.cpu_kill)
152 return 1;
153#endif
154
155 return 0;
156}
157
148#ifdef CONFIG_HOTPLUG_CPU 158#ifdef CONFIG_HOTPLUG_CPU
149static void percpu_timer_stop(void); 159static void percpu_timer_stop(void);
150 160
@@ -388,17 +398,8 @@ asmlinkage void secondary_start_kernel(void)
388 398
389void __init smp_cpus_done(unsigned int max_cpus) 399void __init smp_cpus_done(unsigned int max_cpus)
390{ 400{
391 int cpu; 401 printk(KERN_INFO "SMP: Total of %d processors activated.\n",
392 unsigned long bogosum = 0; 402 num_online_cpus());
393
394 for_each_online_cpu(cpu)
395 bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
396
397 printk(KERN_INFO "SMP: Total of %d processors activated "
398 "(%lu.%02lu BogoMIPS).\n",
399 num_online_cpus(),
400 bogosum / (500000/HZ),
401 (bogosum / (5000/HZ)) % 100);
402 403
403 hyp_mode_check(); 404 hyp_mode_check();
404} 405}
diff --git a/arch/arm/kernel/smp_tlb.c b/arch/arm/kernel/smp_tlb.c
index c2edfff573c2..83ccca303df8 100644
--- a/arch/arm/kernel/smp_tlb.c
+++ b/arch/arm/kernel/smp_tlb.c
@@ -104,7 +104,7 @@ void flush_tlb_all(void)
104 if (tlb_ops_need_broadcast()) 104 if (tlb_ops_need_broadcast())
105 on_each_cpu(ipi_flush_tlb_all, NULL, 1); 105 on_each_cpu(ipi_flush_tlb_all, NULL, 1);
106 else 106 else
107 local_flush_tlb_all(); 107 __flush_tlb_all();
108 broadcast_tlb_a15_erratum(); 108 broadcast_tlb_a15_erratum();
109} 109}
110 110
@@ -113,7 +113,7 @@ void flush_tlb_mm(struct mm_struct *mm)
113 if (tlb_ops_need_broadcast()) 113 if (tlb_ops_need_broadcast())
114 on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1); 114 on_each_cpu_mask(mm_cpumask(mm), ipi_flush_tlb_mm, mm, 1);
115 else 115 else
116 local_flush_tlb_mm(mm); 116 __flush_tlb_mm(mm);
117 broadcast_tlb_mm_a15_erratum(mm); 117 broadcast_tlb_mm_a15_erratum(mm);
118} 118}
119 119
@@ -126,7 +126,7 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
126 on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page, 126 on_each_cpu_mask(mm_cpumask(vma->vm_mm), ipi_flush_tlb_page,
127 &ta, 1); 127 &ta, 1);
128 } else 128 } else
129 local_flush_tlb_page(vma, uaddr); 129 __flush_tlb_page(vma, uaddr);
130 broadcast_tlb_mm_a15_erratum(vma->vm_mm); 130 broadcast_tlb_mm_a15_erratum(vma->vm_mm);
131} 131}
132 132
@@ -137,7 +137,7 @@ void flush_tlb_kernel_page(unsigned long kaddr)
137 ta.ta_start = kaddr; 137 ta.ta_start = kaddr;
138 on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1); 138 on_each_cpu(ipi_flush_tlb_kernel_page, &ta, 1);
139 } else 139 } else
140 local_flush_tlb_kernel_page(kaddr); 140 __flush_tlb_kernel_page(kaddr);
141 broadcast_tlb_a15_erratum(); 141 broadcast_tlb_a15_erratum();
142} 142}
143 143
@@ -173,5 +173,5 @@ void flush_bp_all(void)
173 if (tlb_ops_need_broadcast()) 173 if (tlb_ops_need_broadcast())
174 on_each_cpu(ipi_flush_bp_all, NULL, 1); 174 on_each_cpu(ipi_flush_bp_all, NULL, 1);
175 else 175 else
176 local_flush_bp_all(); 176 __flush_bp_all();
177} 177}
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
index c5a59546a256..85a87370f144 100644
--- a/arch/arm/kernel/topology.c
+++ b/arch/arm/kernel/topology.c
@@ -74,12 +74,8 @@ struct cpu_efficiency table_efficiency[] = {
74 {NULL, }, 74 {NULL, },
75}; 75};
76 76
77struct cpu_capacity { 77unsigned long *__cpu_capacity;
78 unsigned long hwid; 78#define cpu_capacity(cpu) __cpu_capacity[cpu]
79 unsigned long capacity;
80};
81
82struct cpu_capacity *cpu_capacity;
83 79
84unsigned long middle_capacity = 1; 80unsigned long middle_capacity = 1;
85 81
@@ -100,15 +96,19 @@ static void __init parse_dt_topology(void)
100 unsigned long capacity = 0; 96 unsigned long capacity = 0;
101 int alloc_size, cpu = 0; 97 int alloc_size, cpu = 0;
102 98
103 alloc_size = nr_cpu_ids * sizeof(struct cpu_capacity); 99 alloc_size = nr_cpu_ids * sizeof(*__cpu_capacity);
104 cpu_capacity = kzalloc(alloc_size, GFP_NOWAIT); 100 __cpu_capacity = kzalloc(alloc_size, GFP_NOWAIT);
105 101
106 while ((cn = of_find_node_by_type(cn, "cpu"))) { 102 for_each_possible_cpu(cpu) {
107 const u32 *rate, *reg; 103 const u32 *rate;
108 int len; 104 int len;
109 105
110 if (cpu >= num_possible_cpus()) 106 /* too early to use cpu->of_node */
111 break; 107 cn = of_get_cpu_node(cpu, NULL);
108 if (!cn) {
109 pr_err("missing device node for CPU %d\n", cpu);
110 continue;
111 }
112 112
113 for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++) 113 for (cpu_eff = table_efficiency; cpu_eff->compatible; cpu_eff++)
114 if (of_device_is_compatible(cn, cpu_eff->compatible)) 114 if (of_device_is_compatible(cn, cpu_eff->compatible))
@@ -124,12 +124,6 @@ static void __init parse_dt_topology(void)
124 continue; 124 continue;
125 } 125 }
126 126
127 reg = of_get_property(cn, "reg", &len);
128 if (!reg || len != 4) {
129 pr_err("%s missing reg property\n", cn->full_name);
130 continue;
131 }
132
133 capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency; 127 capacity = ((be32_to_cpup(rate)) >> 20) * cpu_eff->efficiency;
134 128
135 /* Save min capacity of the system */ 129 /* Save min capacity of the system */
@@ -140,13 +134,9 @@ static void __init parse_dt_topology(void)
140 if (capacity > max_capacity) 134 if (capacity > max_capacity)
141 max_capacity = capacity; 135 max_capacity = capacity;
142 136
143 cpu_capacity[cpu].capacity = capacity; 137 cpu_capacity(cpu) = capacity;
144 cpu_capacity[cpu++].hwid = be32_to_cpup(reg);
145 } 138 }
146 139
147 if (cpu < num_possible_cpus())
148 cpu_capacity[cpu].hwid = (unsigned long)(-1);
149
150 /* If min and max capacities are equals, we bypass the update of the 140 /* If min and max capacities are equals, we bypass the update of the
151 * cpu_scale because all CPUs have the same capacity. Otherwise, we 141 * cpu_scale because all CPUs have the same capacity. Otherwise, we
152 * compute a middle_capacity factor that will ensure that the capacity 142 * compute a middle_capacity factor that will ensure that the capacity
@@ -154,9 +144,7 @@ static void __init parse_dt_topology(void)
154 * SCHED_POWER_SCALE, which is the default value, but with the 144 * SCHED_POWER_SCALE, which is the default value, but with the
155 * constraint explained near table_efficiency[]. 145 * constraint explained near table_efficiency[].
156 */ 146 */
157 if (min_capacity == max_capacity) 147 if (4*max_capacity < (3*(max_capacity + min_capacity)))
158 cpu_capacity[0].hwid = (unsigned long)(-1);
159 else if (4*max_capacity < (3*(max_capacity + min_capacity)))
160 middle_capacity = (min_capacity + max_capacity) 148 middle_capacity = (min_capacity + max_capacity)
161 >> (SCHED_POWER_SHIFT+1); 149 >> (SCHED_POWER_SHIFT+1);
162 else 150 else
@@ -170,23 +158,12 @@ static void __init parse_dt_topology(void)
170 * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the 158 * boot. The update of all CPUs is in O(n^2) for heteregeneous system but the
171 * function returns directly for SMP system. 159 * function returns directly for SMP system.
172 */ 160 */
173void update_cpu_power(unsigned int cpu, unsigned long hwid) 161void update_cpu_power(unsigned int cpu)
174{ 162{
175 unsigned int idx = 0; 163 if (!cpu_capacity(cpu))
176
177 /* look for the cpu's hwid in the cpu capacity table */
178 for (idx = 0; idx < num_possible_cpus(); idx++) {
179 if (cpu_capacity[idx].hwid == hwid)
180 break;
181
182 if (cpu_capacity[idx].hwid == -1)
183 return;
184 }
185
186 if (idx == num_possible_cpus())
187 return; 164 return;
188 165
189 set_power_scale(cpu, cpu_capacity[idx].capacity / middle_capacity); 166 set_power_scale(cpu, cpu_capacity(cpu) / middle_capacity);
190 167
191 printk(KERN_INFO "CPU%u: update cpu_power %lu\n", 168 printk(KERN_INFO "CPU%u: update cpu_power %lu\n",
192 cpu, arch_scale_freq_power(NULL, cpu)); 169 cpu, arch_scale_freq_power(NULL, cpu));
@@ -194,7 +171,7 @@ void update_cpu_power(unsigned int cpu, unsigned long hwid)
194 171
195#else 172#else
196static inline void parse_dt_topology(void) {} 173static inline void parse_dt_topology(void) {}
197static inline void update_cpu_power(unsigned int cpuid, unsigned int mpidr) {} 174static inline void update_cpu_power(unsigned int cpuid) {}
198#endif 175#endif
199 176
200 /* 177 /*
@@ -281,7 +258,7 @@ void store_cpu_topology(unsigned int cpuid)
281 258
282 update_siblings_masks(cpuid); 259 update_siblings_masks(cpuid);
283 260
284 update_cpu_power(cpuid, mpidr & MPIDR_HWID_BITMASK); 261 update_cpu_power(cpuid);
285 262
286 printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n", 263 printk(KERN_INFO "CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n",
287 cpuid, cpu_topology[cpuid].thread_id, 264 cpuid, cpu_topology[cpuid].thread_id,
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index ab517fcce21b..8fcda140358d 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -497,28 +497,64 @@ static int bad_syscall(int n, struct pt_regs *regs)
497 return regs->ARM_r0; 497 return regs->ARM_r0;
498} 498}
499 499
500static long do_cache_op_restart(struct restart_block *);
501
500static inline int 502static inline int
501do_cache_op(unsigned long start, unsigned long end, int flags) 503__do_cache_op(unsigned long start, unsigned long end)
502{ 504{
503 struct mm_struct *mm = current->active_mm; 505 int ret;
504 struct vm_area_struct *vma; 506 unsigned long chunk = PAGE_SIZE;
507
508 do {
509 if (signal_pending(current)) {
510 struct thread_info *ti = current_thread_info();
511
512 ti->restart_block = (struct restart_block) {
513 .fn = do_cache_op_restart,
514 };
515
516 ti->arm_restart_block = (struct arm_restart_block) {
517 {
518 .cache = {
519 .start = start,
520 .end = end,
521 },
522 },
523 };
524
525 return -ERESTART_RESTARTBLOCK;
526 }
527
528 ret = flush_cache_user_range(start, start + chunk);
529 if (ret)
530 return ret;
505 531
532 cond_resched();
533 start += chunk;
534 } while (start < end);
535
536 return 0;
537}
538
539static long do_cache_op_restart(struct restart_block *unused)
540{
541 struct arm_restart_block *restart_block;
542
543 restart_block = &current_thread_info()->arm_restart_block;
544 return __do_cache_op(restart_block->cache.start,
545 restart_block->cache.end);
546}
547
548static inline int
549do_cache_op(unsigned long start, unsigned long end, int flags)
550{
506 if (end < start || flags) 551 if (end < start || flags)
507 return -EINVAL; 552 return -EINVAL;
508 553
509 down_read(&mm->mmap_sem); 554 if (!access_ok(VERIFY_READ, start, end - start))
510 vma = find_vma(mm, start); 555 return -EFAULT;
511 if (vma && vma->vm_start < end) {
512 if (start < vma->vm_start)
513 start = vma->vm_start;
514 if (end > vma->vm_end)
515 end = vma->vm_end;
516 556
517 up_read(&mm->mmap_sem); 557 return __do_cache_op(start, end);
518 return flush_cache_user_range(start, end);
519 }
520 up_read(&mm->mmap_sem);
521 return -EINVAL;
522} 558}
523 559
524/* 560/*
diff --git a/arch/arm/kernel/v7m.c b/arch/arm/kernel/v7m.c
new file mode 100644
index 000000000000..4d2cba94f5cc
--- /dev/null
+++ b/arch/arm/kernel/v7m.c
@@ -0,0 +1,19 @@
1/*
2 * Copyright (C) 2013 Uwe Kleine-Koenig for Pengutronix
3 *
4 * This program is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License version 2 as published by the
6 * Free Software Foundation.
7 */
8#include <linux/io.h>
9#include <linux/reboot.h>
10#include <asm/barrier.h>
11#include <asm/v7m.h>
12
13void armv7m_restart(enum reboot_mode mode, const char *cmd)
14{
15 dsb();
16 __raw_writel(V7M_SCB_AIRCR_VECTKEY | V7M_SCB_AIRCR_SYSRESETREQ,
17 BASEADDR_V7M_SCB + V7M_SCB_AIRCR);
18 dsb();
19}
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 741f66a2edbd..9c697db2787e 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -219,6 +219,10 @@ long kvm_arch_dev_ioctl(struct file *filp,
219 return -EINVAL; 219 return -EINVAL;
220} 220}
221 221
222void kvm_arch_memslots_updated(struct kvm *kvm)
223{
224}
225
222int kvm_arch_prepare_memory_region(struct kvm *kvm, 226int kvm_arch_prepare_memory_region(struct kvm *kvm,
223 struct kvm_memory_slot *memslot, 227 struct kvm_memory_slot *memslot,
224 struct kvm_userspace_memory_region *mem, 228 struct kvm_userspace_memory_region *mem,
diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
index 4a5199070430..db9cf692d4dd 100644
--- a/arch/arm/kvm/coproc.c
+++ b/arch/arm/kvm/coproc.c
@@ -146,7 +146,11 @@ static bool pm_fake(struct kvm_vcpu *vcpu,
146#define access_pmintenclr pm_fake 146#define access_pmintenclr pm_fake
147 147
148/* Architected CP15 registers. 148/* Architected CP15 registers.
149 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 149 * CRn denotes the primary register number, but is copied to the CRm in the
150 * user space API for 64-bit register access in line with the terminology used
151 * in the ARM ARM.
152 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit
153 * registers preceding 32-bit ones.
150 */ 154 */
151static const struct coproc_reg cp15_regs[] = { 155static const struct coproc_reg cp15_regs[] = {
152 /* CSSELR: swapped by interrupt.S. */ 156 /* CSSELR: swapped by interrupt.S. */
@@ -154,8 +158,8 @@ static const struct coproc_reg cp15_regs[] = {
154 NULL, reset_unknown, c0_CSSELR }, 158 NULL, reset_unknown, c0_CSSELR },
155 159
156 /* TTBR0/TTBR1: swapped by interrupt.S. */ 160 /* TTBR0/TTBR1: swapped by interrupt.S. */
157 { CRm( 2), Op1( 0), is64, NULL, reset_unknown64, c2_TTBR0 }, 161 { CRm64( 2), Op1( 0), is64, NULL, reset_unknown64, c2_TTBR0 },
158 { CRm( 2), Op1( 1), is64, NULL, reset_unknown64, c2_TTBR1 }, 162 { CRm64( 2), Op1( 1), is64, NULL, reset_unknown64, c2_TTBR1 },
159 163
160 /* TTBCR: swapped by interrupt.S. */ 164 /* TTBCR: swapped by interrupt.S. */
161 { CRn( 2), CRm( 0), Op1( 0), Op2( 2), is32, 165 { CRn( 2), CRm( 0), Op1( 0), Op2( 2), is32,
@@ -182,7 +186,7 @@ static const struct coproc_reg cp15_regs[] = {
182 NULL, reset_unknown, c6_IFAR }, 186 NULL, reset_unknown, c6_IFAR },
183 187
184 /* PAR swapped by interrupt.S */ 188 /* PAR swapped by interrupt.S */
185 { CRn( 7), Op1( 0), is64, NULL, reset_unknown64, c7_PAR }, 189 { CRm64( 7), Op1( 0), is64, NULL, reset_unknown64, c7_PAR },
186 190
187 /* 191 /*
188 * DC{C,I,CI}SW operations: 192 * DC{C,I,CI}SW operations:
@@ -399,12 +403,13 @@ static bool index_to_params(u64 id, struct coproc_params *params)
399 | KVM_REG_ARM_OPC1_MASK)) 403 | KVM_REG_ARM_OPC1_MASK))
400 return false; 404 return false;
401 params->is_64bit = true; 405 params->is_64bit = true;
402 params->CRm = ((id & KVM_REG_ARM_CRM_MASK) 406 /* CRm to CRn: see cp15_to_index for details */
407 params->CRn = ((id & KVM_REG_ARM_CRM_MASK)
403 >> KVM_REG_ARM_CRM_SHIFT); 408 >> KVM_REG_ARM_CRM_SHIFT);
404 params->Op1 = ((id & KVM_REG_ARM_OPC1_MASK) 409 params->Op1 = ((id & KVM_REG_ARM_OPC1_MASK)
405 >> KVM_REG_ARM_OPC1_SHIFT); 410 >> KVM_REG_ARM_OPC1_SHIFT);
406 params->Op2 = 0; 411 params->Op2 = 0;
407 params->CRn = 0; 412 params->CRm = 0;
408 return true; 413 return true;
409 default: 414 default:
410 return false; 415 return false;
@@ -898,7 +903,14 @@ static u64 cp15_to_index(const struct coproc_reg *reg)
898 if (reg->is_64) { 903 if (reg->is_64) {
899 val |= KVM_REG_SIZE_U64; 904 val |= KVM_REG_SIZE_U64;
900 val |= (reg->Op1 << KVM_REG_ARM_OPC1_SHIFT); 905 val |= (reg->Op1 << KVM_REG_ARM_OPC1_SHIFT);
901 val |= (reg->CRm << KVM_REG_ARM_CRM_SHIFT); 906 /*
907 * CRn always denotes the primary coproc. reg. nr. for the
908 * in-kernel representation, but the user space API uses the
909 * CRm for the encoding, because it is modelled after the
910 * MRRC/MCRR instructions: see the ARM ARM rev. c page
911 * B3-1445
912 */
913 val |= (reg->CRn << KVM_REG_ARM_CRM_SHIFT);
902 } else { 914 } else {
903 val |= KVM_REG_SIZE_U32; 915 val |= KVM_REG_SIZE_U32;
904 val |= (reg->Op1 << KVM_REG_ARM_OPC1_SHIFT); 916 val |= (reg->Op1 << KVM_REG_ARM_OPC1_SHIFT);
diff --git a/arch/arm/kvm/coproc.h b/arch/arm/kvm/coproc.h
index b7301d3e4799..0461d5c8d3de 100644
--- a/arch/arm/kvm/coproc.h
+++ b/arch/arm/kvm/coproc.h
@@ -135,6 +135,8 @@ static inline int cmp_reg(const struct coproc_reg *i1,
135 return -1; 135 return -1;
136 if (i1->CRn != i2->CRn) 136 if (i1->CRn != i2->CRn)
137 return i1->CRn - i2->CRn; 137 return i1->CRn - i2->CRn;
138 if (i1->is_64 != i2->is_64)
139 return i2->is_64 - i1->is_64;
138 if (i1->CRm != i2->CRm) 140 if (i1->CRm != i2->CRm)
139 return i1->CRm - i2->CRm; 141 return i1->CRm - i2->CRm;
140 if (i1->Op1 != i2->Op1) 142 if (i1->Op1 != i2->Op1)
@@ -145,6 +147,7 @@ static inline int cmp_reg(const struct coproc_reg *i1,
145 147
146#define CRn(_x) .CRn = _x 148#define CRn(_x) .CRn = _x
147#define CRm(_x) .CRm = _x 149#define CRm(_x) .CRm = _x
150#define CRm64(_x) .CRn = _x, .CRm = 0
148#define Op1(_x) .Op1 = _x 151#define Op1(_x) .Op1 = _x
149#define Op2(_x) .Op2 = _x 152#define Op2(_x) .Op2 = _x
150#define is64 .is_64 = true 153#define is64 .is_64 = true
diff --git a/arch/arm/kvm/coproc_a15.c b/arch/arm/kvm/coproc_a15.c
index 685063a6d0cf..cf93472b9dd6 100644
--- a/arch/arm/kvm/coproc_a15.c
+++ b/arch/arm/kvm/coproc_a15.c
@@ -114,7 +114,11 @@ static bool access_l2ectlr(struct kvm_vcpu *vcpu,
114 114
115/* 115/*
116 * A15-specific CP15 registers. 116 * A15-specific CP15 registers.
117 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 117 * CRn denotes the primary register number, but is copied to the CRm in the
118 * user space API for 64-bit register access in line with the terminology used
119 * in the ARM ARM.
120 * Important: Must be sorted ascending by CRn, CRM, Op1, Op2 and with 64-bit
121 * registers preceding 32-bit ones.
118 */ 122 */
119static const struct coproc_reg a15_regs[] = { 123static const struct coproc_reg a15_regs[] = {
120 /* MPIDR: we use VMPIDR for guest access. */ 124 /* MPIDR: we use VMPIDR for guest access. */
diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
index f048338135f7..1b9844d369cc 100644
--- a/arch/arm/kvm/init.S
+++ b/arch/arm/kvm/init.S
@@ -142,7 +142,7 @@ target: @ We're now in the trampoline code, switch page tables
142 142
143 @ Invalidate the old TLBs 143 @ Invalidate the old TLBs
144 mcr p15, 4, r0, c8, c7, 0 @ TLBIALLH 144 mcr p15, 4, r0, c8, c7, 0 @ TLBIALLH
145 dsb 145 dsb ish
146 146
147 eret 147 eret
148 148
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 16cd4ba5d7fd..ddc15539bad2 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -55,7 +55,7 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
55 mcrr p15, 6, r2, r3, c2 @ Write VTTBR 55 mcrr p15, 6, r2, r3, c2 @ Write VTTBR
56 isb 56 isb
57 mcr p15, 0, r0, c8, c3, 0 @ TLBIALLIS (rt ignored) 57 mcr p15, 0, r0, c8, c3, 0 @ TLBIALLIS (rt ignored)
58 dsb 58 dsb ish
59 isb 59 isb
60 mov r2, #0 60 mov r2, #0
61 mov r3, #0 61 mov r3, #0
@@ -79,7 +79,7 @@ ENTRY(__kvm_flush_vm_context)
79 mcr p15, 4, r0, c8, c3, 4 79 mcr p15, 4, r0, c8, c3, 4
80 /* Invalidate instruction caches Inner Shareable (ICIALLUIS) */ 80 /* Invalidate instruction caches Inner Shareable (ICIALLUIS) */
81 mcr p15, 0, r0, c7, c1, 0 81 mcr p15, 0, r0, c7, c1, 0
82 dsb 82 dsb ish
83 isb @ Not necessary if followed by eret 83 isb @ Not necessary if followed by eret
84 84
85 bx lr 85 bx lr
@@ -492,10 +492,10 @@ __kvm_hyp_code_end:
492 .section ".rodata" 492 .section ".rodata"
493 493
494und_die_str: 494und_die_str:
495 .ascii "unexpected undefined exception in Hyp mode at: %#08x" 495 .ascii "unexpected undefined exception in Hyp mode at: %#08x\n"
496pabt_die_str: 496pabt_die_str:
497 .ascii "unexpected prefetch abort in Hyp mode at: %#08x" 497 .ascii "unexpected prefetch abort in Hyp mode at: %#08x\n"
498dabt_die_str: 498dabt_die_str:
499 .ascii "unexpected data abort in Hyp mode at: %#08x" 499 .ascii "unexpected data abort in Hyp mode at: %#08x\n"
500svc_die_str: 500svc_die_str:
501 .ascii "unexpected HVC/SVC trap in Hyp mode at: %#08x" 501 .ascii "unexpected HVC/SVC trap in Hyp mode at: %#08x\n"
diff --git a/arch/arm/kvm/mmio.c b/arch/arm/kvm/mmio.c
index b8e06b7a2833..0c25d9487d53 100644
--- a/arch/arm/kvm/mmio.c
+++ b/arch/arm/kvm/mmio.c
@@ -63,7 +63,8 @@ int kvm_handle_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run)
63static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, 63static int decode_hsr(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
64 struct kvm_exit_mmio *mmio) 64 struct kvm_exit_mmio *mmio)
65{ 65{
66 unsigned long rt, len; 66 unsigned long rt;
67 int len;
67 bool is_write, sign_extend; 68 bool is_write, sign_extend;
68 69
69 if (kvm_vcpu_dabt_isextabt(vcpu)) { 70 if (kvm_vcpu_dabt_isextabt(vcpu)) {
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index ca6bea4859b4..b0de86b56c13 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -85,6 +85,12 @@ static void *mmu_memory_cache_alloc(struct kvm_mmu_memory_cache *mc)
85 return p; 85 return p;
86} 86}
87 87
88static bool page_empty(void *ptr)
89{
90 struct page *ptr_page = virt_to_page(ptr);
91 return page_count(ptr_page) == 1;
92}
93
88static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr) 94static void clear_pud_entry(struct kvm *kvm, pud_t *pud, phys_addr_t addr)
89{ 95{
90 pmd_t *pmd_table = pmd_offset(pud, 0); 96 pmd_t *pmd_table = pmd_offset(pud, 0);
@@ -103,12 +109,6 @@ static void clear_pmd_entry(struct kvm *kvm, pmd_t *pmd, phys_addr_t addr)
103 put_page(virt_to_page(pmd)); 109 put_page(virt_to_page(pmd));
104} 110}
105 111
106static bool pmd_empty(pmd_t *pmd)
107{
108 struct page *pmd_page = virt_to_page(pmd);
109 return page_count(pmd_page) == 1;
110}
111
112static void clear_pte_entry(struct kvm *kvm, pte_t *pte, phys_addr_t addr) 112static void clear_pte_entry(struct kvm *kvm, pte_t *pte, phys_addr_t addr)
113{ 113{
114 if (pte_present(*pte)) { 114 if (pte_present(*pte)) {
@@ -118,12 +118,6 @@ static void clear_pte_entry(struct kvm *kvm, pte_t *pte, phys_addr_t addr)
118 } 118 }
119} 119}
120 120
121static bool pte_empty(pte_t *pte)
122{
123 struct page *pte_page = virt_to_page(pte);
124 return page_count(pte_page) == 1;
125}
126
127static void unmap_range(struct kvm *kvm, pgd_t *pgdp, 121static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
128 unsigned long long start, u64 size) 122 unsigned long long start, u64 size)
129{ 123{
@@ -132,37 +126,37 @@ static void unmap_range(struct kvm *kvm, pgd_t *pgdp,
132 pmd_t *pmd; 126 pmd_t *pmd;
133 pte_t *pte; 127 pte_t *pte;
134 unsigned long long addr = start, end = start + size; 128 unsigned long long addr = start, end = start + size;
135 u64 range; 129 u64 next;
136 130
137 while (addr < end) { 131 while (addr < end) {
138 pgd = pgdp + pgd_index(addr); 132 pgd = pgdp + pgd_index(addr);
139 pud = pud_offset(pgd, addr); 133 pud = pud_offset(pgd, addr);
140 if (pud_none(*pud)) { 134 if (pud_none(*pud)) {
141 addr += PUD_SIZE; 135 addr = pud_addr_end(addr, end);
142 continue; 136 continue;
143 } 137 }
144 138
145 pmd = pmd_offset(pud, addr); 139 pmd = pmd_offset(pud, addr);
146 if (pmd_none(*pmd)) { 140 if (pmd_none(*pmd)) {
147 addr += PMD_SIZE; 141 addr = pmd_addr_end(addr, end);
148 continue; 142 continue;
149 } 143 }
150 144
151 pte = pte_offset_kernel(pmd, addr); 145 pte = pte_offset_kernel(pmd, addr);
152 clear_pte_entry(kvm, pte, addr); 146 clear_pte_entry(kvm, pte, addr);
153 range = PAGE_SIZE; 147 next = addr + PAGE_SIZE;
154 148
155 /* If we emptied the pte, walk back up the ladder */ 149 /* If we emptied the pte, walk back up the ladder */
156 if (pte_empty(pte)) { 150 if (page_empty(pte)) {
157 clear_pmd_entry(kvm, pmd, addr); 151 clear_pmd_entry(kvm, pmd, addr);
158 range = PMD_SIZE; 152 next = pmd_addr_end(addr, end);
159 if (pmd_empty(pmd)) { 153 if (page_empty(pmd) && !page_empty(pud)) {
160 clear_pud_entry(kvm, pud, addr); 154 clear_pud_entry(kvm, pud, addr);
161 range = PUD_SIZE; 155 next = pud_addr_end(addr, end);
162 } 156 }
163 } 157 }
164 158
165 addr += range; 159 addr = next;
166 } 160 }
167} 161}
168 162
@@ -495,7 +489,6 @@ int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa,
495 489
496 for (addr = guest_ipa; addr < end; addr += PAGE_SIZE) { 490 for (addr = guest_ipa; addr < end; addr += PAGE_SIZE) {
497 pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE); 491 pte_t pte = pfn_pte(pfn, PAGE_S2_DEVICE);
498 kvm_set_s2pte_writable(&pte);
499 492
500 ret = mmu_topup_memory_cache(&cache, 2, 2); 493 ret = mmu_topup_memory_cache(&cache, 2, 2);
501 if (ret) 494 if (ret)
diff --git a/arch/arm/kvm/reset.c b/arch/arm/kvm/reset.c
index b7840e7aa452..71e08baee209 100644
--- a/arch/arm/kvm/reset.c
+++ b/arch/arm/kvm/reset.c
@@ -40,7 +40,7 @@ static struct kvm_regs a15_regs_reset = {
40}; 40};
41 41
42static const struct kvm_irq_level a15_vtimer_irq = { 42static const struct kvm_irq_level a15_vtimer_irq = {
43 .irq = 27, 43 { .irq = 27 },
44 .level = 1, 44 .level = 1,
45}; 45};
46 46
diff --git a/arch/arm/kvm/trace.h b/arch/arm/kvm/trace.h
index a8e73ed5ad5b..b1d640f78623 100644
--- a/arch/arm/kvm/trace.h
+++ b/arch/arm/kvm/trace.h
@@ -59,10 +59,9 @@ TRACE_EVENT(kvm_guest_fault,
59 __entry->ipa = ipa; 59 __entry->ipa = ipa;
60 ), 60 ),
61 61
62 TP_printk("guest fault at PC %#08lx (hxfar %#08lx, " 62 TP_printk("ipa %#llx, hsr %#08lx, hxfar %#08lx, pc %#08lx",
63 "ipa %#16llx, hsr %#08lx", 63 __entry->ipa, __entry->hsr,
64 __entry->vcpu_pc, __entry->hxfar, 64 __entry->hxfar, __entry->vcpu_pc)
65 __entry->ipa, __entry->hsr)
66); 65);
67 66
68TRACE_EVENT(kvm_irq_line, 67TRACE_EVENT(kvm_irq_line,
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index af72969820b4..aaf3a8731136 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -45,3 +45,9 @@ lib-$(CONFIG_ARCH_SHARK) += io-shark.o
45 45
46$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S 46$(obj)/csumpartialcopy.o: $(obj)/csumpartialcopygeneric.S
47$(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S 47$(obj)/csumpartialcopyuser.o: $(obj)/csumpartialcopygeneric.S
48
49ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
50 NEON_FLAGS := -mfloat-abi=softfp -mfpu=neon
51 CFLAGS_xor-neon.o += $(NEON_FLAGS)
52 lib-$(CONFIG_XOR_BLOCKS) += xor-neon.o
53endif
diff --git a/arch/arm/lib/xor-neon.c b/arch/arm/lib/xor-neon.c
new file mode 100644
index 000000000000..f485e5a2af4b
--- /dev/null
+++ b/arch/arm/lib/xor-neon.c
@@ -0,0 +1,42 @@
1/*
2 * linux/arch/arm/lib/xor-neon.c
3 *
4 * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org>
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
11#include <linux/raid/xor.h>
12
13#ifndef __ARM_NEON__
14#error You should compile this file with '-mfloat-abi=softfp -mfpu=neon'
15#endif
16
17/*
18 * Pull in the reference implementations while instructing GCC (through
19 * -ftree-vectorize) to attempt to exploit implicit parallelism and emit
20 * NEON instructions.
21 */
22#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
23#pragma GCC optimize "tree-vectorize"
24#else
25/*
26 * While older versions of GCC do not generate incorrect code, they fail to
27 * recognize the parallel nature of these functions, and emit plain ARM code,
28 * which is known to be slower than the optimized ARM code in asm-arm/xor.h.
29 */
30#warning This code requires at least version 4.6 of GCC
31#endif
32
33#pragma GCC diagnostic ignored "-Wunused-variable"
34#include <asm-generic/xor.h>
35
36struct xor_block_template const xor_block_neon_inner = {
37 .name = "__inner_neon__",
38 .do_2 = xor_8regs_2,
39 .do_3 = xor_8regs_3,
40 .do_4 = xor_8regs_4,
41 .do_5 = xor_8regs_5,
42};
diff --git a/arch/arm/mach-at91/at91sam9x5.c b/arch/arm/mach-at91/at91sam9x5.c
index 2abee6626aac..916e5a142917 100644
--- a/arch/arm/mach-at91/at91sam9x5.c
+++ b/arch/arm/mach-at91/at91sam9x5.c
@@ -227,6 +227,8 @@ static struct clk_lookup periph_clocks_lookups[] = {
227 CLKDEV_CON_DEV_ID("usart", "f8020000.serial", &usart1_clk), 227 CLKDEV_CON_DEV_ID("usart", "f8020000.serial", &usart1_clk),
228 CLKDEV_CON_DEV_ID("usart", "f8024000.serial", &usart2_clk), 228 CLKDEV_CON_DEV_ID("usart", "f8024000.serial", &usart2_clk),
229 CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk), 229 CLKDEV_CON_DEV_ID("usart", "f8028000.serial", &usart3_clk),
230 CLKDEV_CON_DEV_ID("usart", "f8040000.serial", &uart0_clk),
231 CLKDEV_CON_DEV_ID("usart", "f8044000.serial", &uart1_clk),
230 CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb0_clk), 232 CLKDEV_CON_DEV_ID("t0_clk", "f8008000.timer", &tcb0_clk),
231 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk), 233 CLKDEV_CON_DEV_ID("t0_clk", "f800c000.timer", &tcb0_clk),
232 CLKDEV_CON_DEV_ID("mci_clk", "f0008000.mmc", &mmc0_clk), 234 CLKDEV_CON_DEV_ID("mci_clk", "f0008000.mmc", &mmc0_clk),
diff --git a/arch/arm/mach-at91/include/mach/at91_adc.h b/arch/arm/mach-at91/include/mach/at91_adc.h
index 8e7ed5c90817..048a57f76bd3 100644
--- a/arch/arm/mach-at91/include/mach/at91_adc.h
+++ b/arch/arm/mach-at91/include/mach/at91_adc.h
@@ -28,9 +28,12 @@
28#define AT91_ADC_TRGSEL_EXTERNAL (6 << 1) 28#define AT91_ADC_TRGSEL_EXTERNAL (6 << 1)
29#define AT91_ADC_LOWRES (1 << 4) /* Low Resolution */ 29#define AT91_ADC_LOWRES (1 << 4) /* Low Resolution */
30#define AT91_ADC_SLEEP (1 << 5) /* Sleep Mode */ 30#define AT91_ADC_SLEEP (1 << 5) /* Sleep Mode */
31#define AT91_ADC_PRESCAL (0x3f << 8) /* Prescalar Rate Selection */ 31#define AT91_ADC_PRESCAL_9260 (0x3f << 8) /* Prescalar Rate Selection */
32#define AT91_ADC_PRESCAL_9G45 (0xff << 8)
32#define AT91_ADC_PRESCAL_(x) ((x) << 8) 33#define AT91_ADC_PRESCAL_(x) ((x) << 8)
33#define AT91_ADC_STARTUP (0x1f << 16) /* Startup Up Time */ 34#define AT91_ADC_STARTUP_9260 (0x1f << 16) /* Startup Up Time */
35#define AT91_ADC_STARTUP_9G45 (0x7f << 16)
36#define AT91_ADC_STARTUP_9X5 (0xf << 16)
34#define AT91_ADC_STARTUP_(x) ((x) << 16) 37#define AT91_ADC_STARTUP_(x) ((x) << 16)
35#define AT91_ADC_SHTIM (0xf << 24) /* Sample & Hold Time */ 38#define AT91_ADC_SHTIM (0xf << 24) /* Sample & Hold Time */
36#define AT91_ADC_SHTIM_(x) ((x) << 24) 39#define AT91_ADC_SHTIM_(x) ((x) << 24)
@@ -48,6 +51,9 @@
48#define AT91_ADC_ENDRX (1 << 18) /* End of RX Buffer */ 51#define AT91_ADC_ENDRX (1 << 18) /* End of RX Buffer */
49#define AT91_ADC_RXFUFF (1 << 19) /* RX Buffer Full */ 52#define AT91_ADC_RXFUFF (1 << 19) /* RX Buffer Full */
50 53
54#define AT91_ADC_SR_9X5 0x30 /* Status Register for 9x5 */
55#define AT91_ADC_SR_DRDY_9X5 (1 << 24) /* Data Ready */
56
51#define AT91_ADC_LCDR 0x20 /* Last Converted Data Register */ 57#define AT91_ADC_LCDR 0x20 /* Last Converted Data Register */
52#define AT91_ADC_LDATA (0x3ff) 58#define AT91_ADC_LDATA (0x3ff)
53 59
@@ -58,4 +64,10 @@
58#define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */ 64#define AT91_ADC_CHR(n) (0x30 + ((n) * 4)) /* Channel Data Register N */
59#define AT91_ADC_DATA (0x3ff) 65#define AT91_ADC_DATA (0x3ff)
60 66
67#define AT91_ADC_CDR0_9X5 (0x50) /* Channel Data Register 0 for 9X5 */
68
69#define AT91_ADC_TRGR_9260 AT91_ADC_MR
70#define AT91_ADC_TRGR_9G45 0x08
71#define AT91_ADC_TRGR_9X5 0xC0
72
61#endif 73#endif
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index bea6793a7ede..9f09f45835f8 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -1249,12 +1249,10 @@ static struct vpif_capture_config da850_vpif_capture_config = {
1249 1249
1250static struct adv7343_platform_data adv7343_pdata = { 1250static struct adv7343_platform_data adv7343_pdata = {
1251 .mode_config = { 1251 .mode_config = {
1252 .dac_3 = 1, 1252 .dac = { 1, 1, 1 },
1253 .dac_2 = 1,
1254 .dac_1 = 1,
1255 }, 1253 },
1256 .sd_config = { 1254 .sd_config = {
1257 .sd_dac_out1 = 1, 1255 .sd_dac_out = { 1 },
1258 }, 1256 },
1259}; 1257};
1260 1258
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index dff4ddc5ef81..139e42da25f0 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -75,6 +75,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
75 .parts = davinci_nand_partitions, 75 .parts = davinci_nand_partitions,
76 .nr_parts = ARRAY_SIZE(davinci_nand_partitions), 76 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
77 .ecc_mode = NAND_ECC_HW_SYNDROME, 77 .ecc_mode = NAND_ECC_HW_SYNDROME,
78 .ecc_bits = 4,
78 .bbt_options = NAND_BBT_USE_FLASH, 79 .bbt_options = NAND_BBT_USE_FLASH,
79}; 80};
80 81
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index a33686a6fbb2..fa4bfaf952d8 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -153,6 +153,7 @@ static struct davinci_nand_pdata davinci_evm_nandflash_data = {
153 .parts = davinci_evm_nandflash_partition, 153 .parts = davinci_evm_nandflash_partition,
154 .nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition), 154 .nr_parts = ARRAY_SIZE(davinci_evm_nandflash_partition),
155 .ecc_mode = NAND_ECC_HW, 155 .ecc_mode = NAND_ECC_HW,
156 .ecc_bits = 1,
156 .bbt_options = NAND_BBT_USE_FLASH, 157 .bbt_options = NAND_BBT_USE_FLASH,
157 .timing = &davinci_evm_nandflash_timing, 158 .timing = &davinci_evm_nandflash_timing,
158}; 159};
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index fbb8e5ab1dc1..0c005e876cac 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -90,6 +90,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
90 .parts = davinci_nand_partitions, 90 .parts = davinci_nand_partitions,
91 .nr_parts = ARRAY_SIZE(davinci_nand_partitions), 91 .nr_parts = ARRAY_SIZE(davinci_nand_partitions),
92 .ecc_mode = NAND_ECC_HW, 92 .ecc_mode = NAND_ECC_HW,
93 .ecc_bits = 1,
93 .options = 0, 94 .options = 0,
94}; 95};
95 96
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 2bc112adf565..808233b60e3d 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -88,6 +88,7 @@ static struct davinci_nand_pdata davinci_ntosd2_nandflash_data = {
88 .parts = davinci_ntosd2_nandflash_partition, 88 .parts = davinci_ntosd2_nandflash_partition,
89 .nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition), 89 .nr_parts = ARRAY_SIZE(davinci_ntosd2_nandflash_partition),
90 .ecc_mode = NAND_ECC_HW, 90 .ecc_mode = NAND_ECC_HW,
91 .ecc_bits = 1,
91 .bbt_options = NAND_BBT_USE_FLASH, 92 .bbt_options = NAND_BBT_USE_FLASH,
92}; 93};
93 94
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c
index 36aef3a7dedb..f1ac1c94ac0f 100644
--- a/arch/arm/mach-davinci/cpuidle.c
+++ b/arch/arm/mach-davinci/cpuidle.c
@@ -65,7 +65,7 @@ static struct cpuidle_driver davinci_idle_driver = {
65 .states[1] = { 65 .states[1] = {
66 .enter = davinci_enter_idle, 66 .enter = davinci_enter_idle,
67 .exit_latency = 10, 67 .exit_latency = 10,
68 .target_residency = 100000, 68 .target_residency = 10000,
69 .flags = CPUIDLE_FLAG_TIME_VALID, 69 .flags = CPUIDLE_FLAG_TIME_VALID,
70 .name = "DDR SR", 70 .name = "DDR SR",
71 .desc = "WFI and DDR Self Refresh", 71 .desc = "WFI and DDR Self Refresh",
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S
deleted file mode 100644
index b18b8ebc6508..000000000000
--- a/arch/arm/mach-davinci/include/mach/debug-macro.S
+++ /dev/null
@@ -1,65 +0,0 @@
1/*
2 * Debugging macro for DaVinci
3 *
4 * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
5 *
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12/* Modifications
13 * Jan 2009 Chaithrika U S Added senduart, busyuart, waituart
14 * macros, based on debug-8250.S file
15 * but using 32-bit accesses required for
16 * some davinci devices.
17 */
18
19#include <linux/serial_reg.h>
20
21#include <mach/serial.h>
22
23#define UART_SHIFT 2
24
25#if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0)
26#define UART_BASE DAVINCI_UART0_BASE
27#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1)
28#define UART_BASE DA8XX_UART1_BASE
29#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2)
30#define UART_BASE DA8XX_UART2_BASE
31#elif defined(CONFIG_DEBUG_DAVINCI_TNETV107X_UART1)
32#define UART_BASE TNETV107X_UART2_BASE
33#define UART_VIRTBASE TNETV107X_UART2_VIRT
34#else
35#error "Select a specifc port for DEBUG_LL"
36#endif
37
38#ifndef UART_VIRTBASE
39#define UART_VIRTBASE IO_ADDRESS(UART_BASE)
40#endif
41
42 .macro addruart, rp, rv, tmp
43 ldr \rp, =UART_BASE
44 ldr \rv, =UART_VIRTBASE
45 .endm
46
47 .macro senduart,rd,rx
48 str \rd, [\rx, #UART_TX << UART_SHIFT]
49 .endm
50
51 .macro busyuart,rd,rx
521002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
53 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
54 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
55 bne 1002b
56 .endm
57
58 .macro waituart,rd,rx
59#ifdef FLOW_CONTROL
601001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
61 tst \rd, #UART_MSR_CTS
62 beq 1001b
63#endif
64 .endm
65
diff --git a/arch/arm/mach-dove/common.c b/arch/arm/mach-dove/common.c
index 00247c771313..304f069ebf50 100644
--- a/arch/arm/mach-dove/common.c
+++ b/arch/arm/mach-dove/common.c
@@ -108,8 +108,8 @@ static void __init dove_clk_init(void)
108 orion_clkdev_add(NULL, "sdhci-dove.1", sdio1); 108 orion_clkdev_add(NULL, "sdhci-dove.1", sdio1);
109 orion_clkdev_add(NULL, "orion_nand", nand); 109 orion_clkdev_add(NULL, "orion_nand", nand);
110 orion_clkdev_add(NULL, "cafe1000-ccic.0", camera); 110 orion_clkdev_add(NULL, "cafe1000-ccic.0", camera);
111 orion_clkdev_add(NULL, "kirkwood-i2s.0", i2s0); 111 orion_clkdev_add(NULL, "mvebu-audio.0", i2s0);
112 orion_clkdev_add(NULL, "kirkwood-i2s.1", i2s1); 112 orion_clkdev_add(NULL, "mvebu-audio.1", i2s1);
113 orion_clkdev_add(NULL, "mv_crypto", crypto); 113 orion_clkdev_add(NULL, "mv_crypto", crypto);
114 orion_clkdev_add(NULL, "dove-ac97", ac97); 114 orion_clkdev_add(NULL, "dove-ac97", ac97);
115 orion_clkdev_add(NULL, "dove-pdma", pdma); 115 orion_clkdev_add(NULL, "dove-pdma", pdma);
diff --git a/arch/arm/mach-dove/include/mach/debug-macro.S b/arch/arm/mach-dove/include/mach/debug-macro.S
deleted file mode 100644
index 5929cbc59161..000000000000
--- a/arch/arm/mach-dove/include/mach/debug-macro.S
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-dove/include/mach/debug-macro.S
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 <mach/bridge-regs.h>
10
11 .macro addruart, rp, rv, tmp
12 ldr \rp, =DOVE_SB_REGS_PHYS_BASE
13 ldr \rv, =DOVE_SB_REGS_VIRT_BASE
14 orr \rp, \rp, #0x00012000
15 orr \rv, \rv, #0x00012000
16 .endm
17
18#define UART_SHIFT 2
19#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-ebsa110/include/mach/debug-macro.S b/arch/arm/mach-ebsa110/include/mach/debug-macro.S
deleted file mode 100644
index bb02c05e6812..000000000000
--- a/arch/arm/mach-ebsa110/include/mach/debug-macro.S
+++ /dev/null
@@ -1,22 +0,0 @@
1/* arch/arm/mach-ebsa110/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12**/
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0xf0000000
16 orr \rp, \rp, #0x00000be0
17 mov \rp, \rv
18 .endm
19
20#define UART_SHIFT 2
21#define FLOW_CONTROL
22#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index fe3c1fa5462b..93e54fd4e3d5 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -194,20 +194,6 @@ config MACH_VISION_EP9307
194 Say 'Y' here if you want your kernel to support the 194 Say 'Y' here if you want your kernel to support the
195 Vision Engraving Systems EP9307 SoM. 195 Vision Engraving Systems EP9307 SoM.
196 196
197choice
198 prompt "Select a UART for early kernel messages"
199
200config EP93XX_EARLY_UART1
201 bool "UART1"
202
203config EP93XX_EARLY_UART2
204 bool "UART2"
205
206config EP93XX_EARLY_UART3
207 bool "UART3"
208
209endchoice
210
211endmenu 197endmenu
212 198
213endif 199endif
diff --git a/arch/arm/mach-ep93xx/include/mach/debug-macro.S b/arch/arm/mach-ep93xx/include/mach/debug-macro.S
deleted file mode 100644
index af54e43132cf..000000000000
--- a/arch/arm/mach-ep93xx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-ep93xx/include/mach/debug-macro.S
3 * Debugging macro include header
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12#include <mach/ep93xx-regs.h>
13
14 .macro addruart, rp, rv, tmp
15 ldr \rp, =EP93XX_APB_PHYS_BASE @ Physical base
16 ldr \rv, =EP93XX_APB_VIRT_BASE @ virtual base
17 orr \rp, \rp, #0x000c0000
18 orr \rv, \rv, #0x000c0000
19 .endm
20
21#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-ep93xx/include/mach/uncompress.h b/arch/arm/mach-ep93xx/include/mach/uncompress.h
index b5cc77d2380b..03c42e5400d2 100644
--- a/arch/arm/mach-ep93xx/include/mach/uncompress.h
+++ b/arch/arm/mach-ep93xx/include/mach/uncompress.h
@@ -31,18 +31,8 @@ static void __raw_writel(unsigned int value, unsigned int ptr)
31 *((volatile unsigned int *)ptr) = value; 31 *((volatile unsigned int *)ptr) = value;
32} 32}
33 33
34#if defined(CONFIG_EP93XX_EARLY_UART1) 34#define PHYS_UART_DATA (CONFIG_DEBUG_UART_PHYS + 0x00)
35#define UART_BASE EP93XX_UART1_PHYS_BASE 35#define PHYS_UART_FLAG (CONFIG_DEBUG_UART_PHYS + 0x18)
36#elif defined(CONFIG_EP93XX_EARLY_UART2)
37#define UART_BASE EP93XX_UART2_PHYS_BASE
38#elif defined(CONFIG_EP93XX_EARLY_UART3)
39#define UART_BASE EP93XX_UART3_PHYS_BASE
40#else
41#define UART_BASE EP93XX_UART1_PHYS_BASE
42#endif
43
44#define PHYS_UART_DATA (UART_BASE + 0x00)
45#define PHYS_UART_FLAG (UART_BASE + 0x18)
46#define UART_FLAG_TXFF 0x20 36#define UART_FLAG_TXFF 0x20
47 37
48static inline void putc(int c) 38static inline void putc(int c)
diff --git a/arch/arm/mach-footbridge/include/mach/debug-macro.S b/arch/arm/mach-footbridge/include/mach/debug-macro.S
index c169f0c99b2a..02247f313e94 100644
--- a/arch/arm/mach-footbridge/include/mach/debug-macro.S
+++ b/arch/arm/mach-footbridge/include/mach/debug-macro.S
@@ -13,20 +13,6 @@
13 13
14#include <asm/hardware/dec21285.h> 14#include <asm/hardware/dec21285.h>
15 15
16#ifndef CONFIG_DEBUG_DC21285_PORT
17 /* For NetWinder debugging */
18 .macro addruart, rp, rv, tmp
19 mov \rp, #0x000003f8
20 orr \rv, \rp, #0xfe000000 @ virtual
21 orr \rv, \rv, #0x00e00000 @ virtual
22 orr \rp, \rp, #0x7c000000 @ physical
23 .endm
24
25#define UART_SHIFT 0
26#define FLOW_CONTROL
27#include <asm/hardware/debug-8250.S>
28
29#else
30#include <mach/hardware.h> 16#include <mach/hardware.h>
31 /* For EBSA285 debugging */ 17 /* For EBSA285 debugging */
32 .equ dc21285_high, ARMCSR_BASE & 0xff000000 18 .equ dc21285_high, ARMCSR_BASE & 0xff000000
@@ -54,4 +40,3 @@
54 40
55 .macro waituart,rd,rx 41 .macro waituart,rd,rx
56 .endm 42 .endm
57#endif
diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S
deleted file mode 100644
index 837670763b85..000000000000
--- a/arch/arm/mach-gemini/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Copyright (C) 1994-1999 Russell King
5 * Copyright (C) 2001-2006 Storlink, Corp.
6 * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
7 *
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
10 * published by the Free Software Foundation.
11 */
12#include <mach/hardware.h>
13
14 .macro addruart, rp, rv, tmp
15 ldr \rp, =GEMINI_UART_BASE @ physical
16 ldr \rv, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual
17 .endm
18
19#define UART_SHIFT 2
20#define FLOW_CONTROL
21#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 7be13f8e69a0..a02f275a198d 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -254,13 +254,12 @@ static void __init imx6q_opp_init(struct device *cpu_dev)
254{ 254{
255 struct device_node *np; 255 struct device_node *np;
256 256
257 np = of_find_node_by_path("/cpus/cpu@0"); 257 np = of_node_get(cpu_dev->of_node);
258 if (!np) { 258 if (!np) {
259 pr_warn("failed to find cpu0 node\n"); 259 pr_warn("failed to find cpu0 node\n");
260 return; 260 return;
261 } 261 }
262 262
263 cpu_dev->of_node = np;
264 if (of_init_opp_table(cpu_dev)) { 263 if (of_init_opp_table(cpu_dev)) {
265 pr_warn("failed to init OPP table\n"); 264 pr_warn("failed to init OPP table\n");
266 goto put_node; 265 goto put_node;
diff --git a/arch/arm/mach-integrator/include/mach/debug-macro.S b/arch/arm/mach-integrator/include/mach/debug-macro.S
deleted file mode 100644
index 411b116077e4..000000000000
--- a/arch/arm/mach-integrator/include/mach/debug-macro.S
+++ /dev/null
@@ -1,20 +0,0 @@
1/* arch/arm/mach-integrator/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0x16000000 @ physical base address
16 mov \rv, #0xf0000000 @ virtual base
17 add \rv, \rv, #0x16000000 >> 4
18 .endm
19
20#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-iop13xx/include/mach/debug-macro.S b/arch/arm/mach-iop13xx/include/mach/debug-macro.S
deleted file mode 100644
index d869a6f67e5c..000000000000
--- a/arch/arm/mach-iop13xx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-iop13xx/include/mach/debug-macro.S
3 *
4 * Debugging macro include header
5 *
6 * Copyright (C) 1994-1999 Russell King
7 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8 *
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
11 * published by the Free Software Foundation.
12 */
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0x00002300
16 orr \rp, \rp, #0x00000040
17 orr \rv, \rp, #0xfe000000 @ virtual
18 orr \rv, \rv, #0x00e80000
19 orr \rp, \rp, #0xff000000 @ physical
20 orr \rp, \rp, #0x00d80000
21 .endm
22
23#define UART_SHIFT 2
24#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-iop32x/include/mach/debug-macro.S b/arch/arm/mach-iop32x/include/mach/debug-macro.S
deleted file mode 100644
index 363bdf90b34d..000000000000
--- a/arch/arm/mach-iop32x/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-iop32x/include/mach/debug-macro.S
3 *
4 * Debugging macro include header
5 *
6 * Copyright (C) 1994-1999 Russell King
7 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8 *
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
11 * published by the Free Software Foundation.
12 */
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0xfe000000 @ physical as well as virtual
16 orr \rp, \rp, #0x00800000 @ location of the UART
17 mov \rv, \rp
18 .endm
19
20#define UART_SHIFT 0
21#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-iop33x/include/mach/debug-macro.S b/arch/arm/mach-iop33x/include/mach/debug-macro.S
deleted file mode 100644
index 361be1f6026e..000000000000
--- a/arch/arm/mach-iop33x/include/mach/debug-macro.S
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * arch/arm/mach-iop33x/include/mach/debug-macro.S
3 *
4 * Debugging macro include header
5 *
6 * Copyright (C) 1994-1999 Russell King
7 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
8 *
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
11 * published by the Free Software Foundation.
12 */
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0x00ff0000
16 orr \rp, \rp, #0x0000f700
17 orr \rv, #0xfe000000 @ virtual
18 orr \rp, #0xff000000 @ physical
19 .endm
20
21#define UART_SHIFT 2
22#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S b/arch/arm/mach-ixp4xx/include/mach/debug-macro.S
deleted file mode 100644
index ff686cbc5df4..000000000000
--- a/arch/arm/mach-ixp4xx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,26 +0,0 @@
1/* arch/arm/mach-ixp4xx/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11*/
12
13 .macro addruart, rp, rv, tmp
14#ifdef __ARMEB__
15 mov \rp, #3 @ Uart regs are at off set of 3 if
16 @ byte writes used - Big Endian.
17#else
18 mov \rp, #0
19#endif
20 orr \rv, \rp, #0xfe000000 @ virtual
21 orr \rv, \rv, #0x00f00000
22 orr \rp, \rp, #0xc8000000 @ physical
23 .endm
24
25#define UART_SHIFT 2
26#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index e9238b5567ee..1663de090984 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -264,7 +264,7 @@ void __init kirkwood_clk_init(void)
264 orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1); 264 orion_clkdev_add(NULL, MV_XOR_NAME ".1", xor1);
265 orion_clkdev_add("0", "pcie", pex0); 265 orion_clkdev_add("0", "pcie", pex0);
266 orion_clkdev_add("1", "pcie", pex1); 266 orion_clkdev_add("1", "pcie", pex1);
267 orion_clkdev_add(NULL, "kirkwood-i2s", audio); 267 orion_clkdev_add(NULL, "mvebu-audio", audio);
268 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit); 268 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".0", runit);
269 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit); 269 orion_clkdev_add(NULL, MV64XXX_I2C_CTLR_NAME ".1", runit);
270 270
@@ -560,7 +560,7 @@ void __init kirkwood_timer_init(void)
560/***************************************************************************** 560/*****************************************************************************
561 * Audio 561 * Audio
562 ****************************************************************************/ 562 ****************************************************************************/
563static struct resource kirkwood_i2s_resources[] = { 563static struct resource kirkwood_audio_resources[] = {
564 [0] = { 564 [0] = {
565 .start = AUDIO_PHYS_BASE, 565 .start = AUDIO_PHYS_BASE,
566 .end = AUDIO_PHYS_BASE + SZ_16K - 1, 566 .end = AUDIO_PHYS_BASE + SZ_16K - 1,
@@ -573,29 +573,23 @@ static struct resource kirkwood_i2s_resources[] = {
573 }, 573 },
574}; 574};
575 575
576static struct kirkwood_asoc_platform_data kirkwood_i2s_data = { 576static struct kirkwood_asoc_platform_data kirkwood_audio_data = {
577 .burst = 128, 577 .burst = 128,
578}; 578};
579 579
580static struct platform_device kirkwood_i2s_device = { 580static struct platform_device kirkwood_audio_device = {
581 .name = "kirkwood-i2s", 581 .name = "mvebu-audio",
582 .id = -1, 582 .id = -1,
583 .num_resources = ARRAY_SIZE(kirkwood_i2s_resources), 583 .num_resources = ARRAY_SIZE(kirkwood_audio_resources),
584 .resource = kirkwood_i2s_resources, 584 .resource = kirkwood_audio_resources,
585 .dev = { 585 .dev = {
586 .platform_data = &kirkwood_i2s_data, 586 .platform_data = &kirkwood_audio_data,
587 }, 587 },
588}; 588};
589 589
590static struct platform_device kirkwood_pcm_device = {
591 .name = "kirkwood-pcm-audio",
592 .id = -1,
593};
594
595void __init kirkwood_audio_init(void) 590void __init kirkwood_audio_init(void)
596{ 591{
597 platform_device_register(&kirkwood_i2s_device); 592 platform_device_register(&kirkwood_audio_device);
598 platform_device_register(&kirkwood_pcm_device);
599} 593}
600 594
601/***************************************************************************** 595/*****************************************************************************
diff --git a/arch/arm/mach-kirkwood/include/mach/debug-macro.S b/arch/arm/mach-kirkwood/include/mach/debug-macro.S
deleted file mode 100644
index f785d401a607..000000000000
--- a/arch/arm/mach-kirkwood/include/mach/debug-macro.S
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-kirkwood/include/mach/debug-macro.S
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 <mach/bridge-regs.h>
10
11 .macro addruart, rp, rv, tmp
12 ldr \rp, =KIRKWOOD_REGS_PHYS_BASE
13 ldr \rv, =KIRKWOOD_REGS_VIRT_BASE
14 orr \rp, \rp, #0x00012000
15 orr \rv, \rv, #0x00012000
16 .endm
17
18#define UART_SHIFT 2
19#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S b/arch/arm/mach-lpc32xx/include/mach/debug-macro.S
deleted file mode 100644
index 351bd6c84909..000000000000
--- a/arch/arm/mach-lpc32xx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * arch/arm/mach-lpc32xx/include/mach/debug-macro.S
3 *
4 * Author: Kevin Wells <kevin.wells@nxp.com>
5 *
6 * Copyright (C) 2010 NXP Semiconductors
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19/*
20 * Debug output is hardcoded to standard UART 5
21*/
22
23 .macro addruart, rp, rv, tmp
24 ldreq \rp, =0x40090000
25 ldrne \rv, =0xF4090000
26 .endm
27
28#define UART_SHIFT 2
29#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-msm/devices-msm7x00.c b/arch/arm/mach-msm/devices-msm7x00.c
index 6d50fb964863..d83404d4b328 100644
--- a/arch/arm/mach-msm/devices-msm7x00.c
+++ b/arch/arm/mach-msm/devices-msm7x00.c
@@ -456,9 +456,9 @@ static struct clk_pcom_desc msm_clocks_7x01a[] = {
456 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 456 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
457 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 457 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
458 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 458 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
459 CLK_PCOM("uart_clk", UART1_CLK, "msm_serial.0", OFF), 459 CLK_PCOM("core", UART1_CLK, "msm_serial.0", OFF),
460 CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), 460 CLK_PCOM("core", UART2_CLK, "msm_serial.1", 0),
461 CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), 461 CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF),
462 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF), 462 CLK_PCOM("uart1dm_clk", UART1DM_CLK, NULL, OFF),
463 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0), 463 CLK_PCOM("uart2dm_clk", UART2DM_CLK, NULL, 0),
464 CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF), 464 CLK_PCOM("usb_hs_clk", USB_HS_CLK, "msm_hsusb", OFF),
diff --git a/arch/arm/mach-msm/devices-msm7x30.c b/arch/arm/mach-msm/devices-msm7x30.c
index d4db75acff56..14e286948f69 100644
--- a/arch/arm/mach-msm/devices-msm7x30.c
+++ b/arch/arm/mach-msm/devices-msm7x30.c
@@ -211,7 +211,7 @@ static struct clk_pcom_desc msm_clocks_7x30[] = {
211 CLK_PCOM("spi_pclk", SPI_P_CLK, NULL, 0), 211 CLK_PCOM("spi_pclk", SPI_P_CLK, NULL, 0),
212 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 212 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
213 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 213 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
214 CLK_PCOM("uart_clk", UART2_CLK, "msm_serial.1", 0), 214 CLK_PCOM("core", UART2_CLK, "msm_serial.1", 0),
215 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0), 215 CLK_PCOM("usb_phy_clk", USB_PHY_CLK, NULL, 0),
216 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 216 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
217 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF), 217 CLK_PCOM("usb_hs_pclk", USB_HS_P_CLK, NULL, OFF),
diff --git a/arch/arm/mach-msm/devices-qsd8x50.c b/arch/arm/mach-msm/devices-qsd8x50.c
index f5518112284b..2ed89b25d304 100644
--- a/arch/arm/mach-msm/devices-qsd8x50.c
+++ b/arch/arm/mach-msm/devices-qsd8x50.c
@@ -358,9 +358,9 @@ static struct clk_pcom_desc msm_clocks_8x50[] = {
358 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0), 358 CLK_PCOM("tsif_ref_clk", TSIF_REF_CLK, NULL, 0),
359 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0), 359 CLK_PCOM("tv_dac_clk", TV_DAC_CLK, NULL, 0),
360 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0), 360 CLK_PCOM("tv_enc_clk", TV_ENC_CLK, NULL, 0),
361 CLK_PCOM("uart_clk", UART1_CLK, NULL, OFF), 361 CLK_PCOM("core", UART1_CLK, NULL, OFF),
362 CLK_PCOM("uart_clk", UART2_CLK, NULL, 0), 362 CLK_PCOM("core", UART2_CLK, NULL, 0),
363 CLK_PCOM("uart_clk", UART3_CLK, "msm_serial.2", OFF), 363 CLK_PCOM("core", UART3_CLK, "msm_serial.2", OFF),
364 CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF), 364 CLK_PCOM("uartdm_clk", UART1DM_CLK, NULL, OFF),
365 CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0), 365 CLK_PCOM("uartdm_clk", UART2DM_CLK, NULL, 0),
366 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF), 366 CLK_PCOM("usb_hs_clk", USB_HS_CLK, NULL, OFF),
diff --git a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S b/arch/arm/mach-mv78xx0/include/mach/debug-macro.S
deleted file mode 100644
index a7df02b049b7..000000000000
--- a/arch/arm/mach-mv78xx0/include/mach/debug-macro.S
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-mv78xx0/include/mach/debug-macro.S
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 <mach/mv78xx0.h>
10
11 .macro addruart, rp, rv, tmp
12 ldr \rp, =MV78XX0_REGS_PHYS_BASE
13 ldr \rv, =MV78XX0_REGS_VIRT_BASE
14 orr \rp, \rp, #0x00012000
15 orr \rv, \rv, #0x00012000
16 .endm
17
18#define UART_SHIFT 2
19#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index ce81d3031405..594b63db4215 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -29,45 +29,40 @@
29#include "pmsu.h" 29#include "pmsu.h"
30#include "coherency.h" 30#include "coherency.h"
31 31
32static struct clk *__init get_cpu_clk(int cpu)
33{
34 struct clk *cpu_clk;
35 struct device_node *np = of_get_cpu_node(cpu, NULL);
36
37 if (WARN(!np, "missing cpu node\n"))
38 return NULL;
39 cpu_clk = of_clk_get(np, 0);
40 if (WARN_ON(IS_ERR(cpu_clk)))
41 return NULL;
42 return cpu_clk;
43}
44
32void __init set_secondary_cpus_clock(void) 45void __init set_secondary_cpus_clock(void)
33{ 46{
34 int thiscpu; 47 int thiscpu, cpu;
35 unsigned long rate; 48 unsigned long rate;
36 struct clk *cpu_clk = NULL; 49 struct clk *cpu_clk;
37 struct device_node *np = NULL;
38 50
39 thiscpu = smp_processor_id(); 51 thiscpu = smp_processor_id();
40 for_each_node_by_type(np, "cpu") { 52 cpu_clk = get_cpu_clk(thiscpu);
41 int err; 53 if (!cpu_clk)
42 int cpu;
43
44 err = of_property_read_u32(np, "reg", &cpu);
45 if (WARN_ON(err))
46 return;
47
48 if (cpu == thiscpu) {
49 cpu_clk = of_clk_get(np, 0);
50 break;
51 }
52 }
53 if (WARN_ON(IS_ERR(cpu_clk)))
54 return; 54 return;
55 clk_prepare_enable(cpu_clk); 55 clk_prepare_enable(cpu_clk);
56 rate = clk_get_rate(cpu_clk); 56 rate = clk_get_rate(cpu_clk);
57 57
58 /* set all the other CPU clk to the same rate than the boot CPU */ 58 /* set all the other CPU clk to the same rate than the boot CPU */
59 for_each_node_by_type(np, "cpu") { 59 for_each_possible_cpu(cpu) {
60 int err; 60 if (cpu == thiscpu)
61 int cpu; 61 continue;
62 62 cpu_clk = get_cpu_clk(cpu);
63 err = of_property_read_u32(np, "reg", &cpu); 63 if (!cpu_clk)
64 if (WARN_ON(err))
65 return; 64 return;
66 65 clk_set_rate(cpu_clk, rate);
67 if (cpu != thiscpu) {
68 cpu_clk = of_clk_get(np, 0);
69 clk_set_rate(cpu_clk, rate);
70 }
71 } 66 }
72} 67}
73 68
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c
index 244d8a5aa54b..c711ad6ac067 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -100,39 +100,52 @@ static struct platform_device sdp2430_flash_device = {
100 .resource = &sdp2430_flash_resource, 100 .resource = &sdp2430_flash_resource,
101}; 101};
102 102
103static struct platform_device *sdp2430_devices[] __initdata = {
104 &sdp2430_flash_device,
105};
106
107/* LCD */ 103/* LCD */
108#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91 104#define SDP2430_LCD_PANEL_BACKLIGHT_GPIO 91
109#define SDP2430_LCD_PANEL_ENABLE_GPIO 154 105#define SDP2430_LCD_PANEL_ENABLE_GPIO 154
110 106
111static struct panel_generic_dpi_data sdp2430_panel_data = { 107static const struct display_timing sdp2430_lcd_videomode = {
112 .name = "nec_nl2432dr22-11b", 108 .pixelclock = { 0, 5400000, 0 },
113 .num_gpios = 2, 109
114 .gpios = { 110 .hactive = { 0, 240, 0 },
115 SDP2430_LCD_PANEL_ENABLE_GPIO, 111 .hfront_porch = { 0, 3, 0 },
116 SDP2430_LCD_PANEL_BACKLIGHT_GPIO, 112 .hback_porch = { 0, 39, 0 },
117 }, 113 .hsync_len = { 0, 3, 0 },
114
115 .vactive = { 0, 320, 0 },
116 .vfront_porch = { 0, 2, 0 },
117 .vback_porch = { 0, 7, 0 },
118 .vsync_len = { 0, 1, 0 },
119
120 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
121 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
118}; 122};
119 123
120static struct omap_dss_device sdp2430_lcd_device = { 124static struct panel_dpi_platform_data sdp2430_lcd_pdata = {
121 .name = "lcd", 125 .name = "lcd",
122 .driver_name = "generic_dpi_panel", 126 .source = "dpi.0",
123 .type = OMAP_DISPLAY_TYPE_DPI, 127
124 .phy.dpi.data_lines = 16, 128 .data_lines = 16,
125 .data = &sdp2430_panel_data, 129
130 .display_timing = &sdp2430_lcd_videomode,
131
132 .enable_gpio = SDP2430_LCD_PANEL_ENABLE_GPIO,
133 .backlight_gpio = SDP2430_LCD_PANEL_BACKLIGHT_GPIO,
126}; 134};
127 135
128static struct omap_dss_device *sdp2430_dss_devices[] = { 136static struct platform_device sdp2430_lcd_device = {
129 &sdp2430_lcd_device, 137 .name = "panel-dpi",
138 .id = 0,
139 .dev.platform_data = &sdp2430_lcd_pdata,
130}; 140};
131 141
132static struct omap_dss_board_info sdp2430_dss_data = { 142static struct omap_dss_board_info sdp2430_dss_data = {
133 .num_devices = ARRAY_SIZE(sdp2430_dss_devices), 143 .default_display_name = "lcd",
134 .devices = sdp2430_dss_devices, 144};
135 .default_device = &sdp2430_lcd_device, 145
146static struct platform_device *sdp2430_devices[] __initdata = {
147 &sdp2430_flash_device,
148 &sdp2430_lcd_device,
136}; 149};
137 150
138#if IS_ENABLED(CONFIG_SMC91X) 151#if IS_ENABLED(CONFIG_SMC91X)
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index 23b004afa3f8..d95d0ef1354a 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -126,53 +126,65 @@ static void __init sdp3430_display_init(void)
126 126
127} 127}
128 128
129static struct panel_sharp_ls037v7dw01_data sdp3430_lcd_data = { 129static struct panel_sharp_ls037v7dw01_platform_data sdp3430_lcd_pdata = {
130 .resb_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO, 130 .name = "lcd",
131 .ini_gpio = -1, 131 .source = "dpi.0",
132 .mo_gpio = -1, 132
133 .lr_gpio = -1, 133 .data_lines = 16,
134 .ud_gpio = -1, 134
135 .resb_gpio = SDP3430_LCD_PANEL_ENABLE_GPIO,
136 .ini_gpio = -1,
137 .mo_gpio = -1,
138 .lr_gpio = -1,
139 .ud_gpio = -1,
140};
141
142static struct platform_device sdp3430_lcd_device = {
143 .name = "panel-sharp-ls037v7dw01",
144 .id = 0,
145 .dev.platform_data = &sdp3430_lcd_pdata,
135}; 146};
136 147
137static struct omap_dss_device sdp3430_lcd_device = { 148static struct connector_dvi_platform_data sdp3430_dvi_connector_pdata = {
138 .name = "lcd", 149 .name = "dvi",
139 .driver_name = "sharp_ls_panel", 150 .source = "tfp410.0",
140 .type = OMAP_DISPLAY_TYPE_DPI, 151 .i2c_bus_num = -1,
141 .phy.dpi.data_lines = 16,
142 .data = &sdp3430_lcd_data,
143}; 152};
144 153
145static struct tfp410_platform_data dvi_panel = { 154static struct platform_device sdp3430_dvi_connector_device = {
146 .power_down_gpio = -1, 155 .name = "connector-dvi",
147 .i2c_bus_num = -1, 156 .id = 0,
157 .dev.platform_data = &sdp3430_dvi_connector_pdata,
148}; 158};
149 159
150static struct omap_dss_device sdp3430_dvi_device = { 160static struct encoder_tfp410_platform_data sdp3430_tfp410_pdata = {
151 .name = "dvi", 161 .name = "tfp410.0",
152 .type = OMAP_DISPLAY_TYPE_DPI, 162 .source = "dpi.0",
153 .driver_name = "tfp410", 163 .data_lines = 24,
154 .data = &dvi_panel, 164 .power_down_gpio = -1,
155 .phy.dpi.data_lines = 24,
156}; 165};
157 166
158static struct omap_dss_device sdp3430_tv_device = { 167static struct platform_device sdp3430_tfp410_device = {
159 .name = "tv", 168 .name = "tfp410",
160 .driver_name = "venc", 169 .id = 0,
161 .type = OMAP_DISPLAY_TYPE_VENC, 170 .dev.platform_data = &sdp3430_tfp410_pdata,
162 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
163}; 171};
164 172
173static struct connector_atv_platform_data sdp3430_tv_pdata = {
174 .name = "tv",
175 .source = "venc.0",
176 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
177 .invert_polarity = false,
178};
165 179
166static struct omap_dss_device *sdp3430_dss_devices[] = { 180static struct platform_device sdp3430_tv_connector_device = {
167 &sdp3430_lcd_device, 181 .name = "connector-analog-tv",
168 &sdp3430_dvi_device, 182 .id = 0,
169 &sdp3430_tv_device, 183 .dev.platform_data = &sdp3430_tv_pdata,
170}; 184};
171 185
172static struct omap_dss_board_info sdp3430_dss_data = { 186static struct omap_dss_board_info sdp3430_dss_data = {
173 .num_devices = ARRAY_SIZE(sdp3430_dss_devices), 187 .default_display_name = "lcd",
174 .devices = sdp3430_dss_devices,
175 .default_device = &sdp3430_lcd_device,
176}; 188};
177 189
178static struct omap2_hsmmc_info mmc[] = { 190static struct omap2_hsmmc_info mmc[] = {
@@ -583,6 +595,11 @@ static void __init omap_3430sdp_init(void)
583 omap_hsmmc_init(mmc); 595 omap_hsmmc_init(mmc);
584 omap3430_i2c_init(); 596 omap3430_i2c_init();
585 omap_display_init(&sdp3430_dss_data); 597 omap_display_init(&sdp3430_dss_data);
598 platform_device_register(&sdp3430_lcd_device);
599 platform_device_register(&sdp3430_tfp410_device);
600 platform_device_register(&sdp3430_dvi_connector_device);
601 platform_device_register(&sdp3430_tv_connector_device);
602
586 if (omap_rev() > OMAP3430_REV_ES1_0) 603 if (omap_rev() > OMAP3430_REV_ES1_0)
587 gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV2; 604 gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV2;
588 else 605 else
diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c
index d63f14b534b5..8cc2c9e9fb03 100644
--- a/arch/arm/mach-omap2/board-am3517evm.c
+++ b/arch/arm/mach-omap2/board-am3517evm.c
@@ -120,56 +120,95 @@ static int __init am3517_evm_i2c_init(void)
120 return 0; 120 return 0;
121} 121}
122 122
123static struct panel_generic_dpi_data lcd_panel = { 123static const struct display_timing am3517_evm_lcd_videomode = {
124 .name = "sharp_lq", 124 .pixelclock = { 0, 9000000, 0 },
125 .num_gpios = 3, 125
126 .gpios = { 126 .hactive = { 0, 480, 0 },
127 LCD_PANEL_PWR, 127 .hfront_porch = { 0, 3, 0 },
128 LCD_PANEL_BKLIGHT_PWR, 128 .hback_porch = { 0, 2, 0 },
129 LCD_PANEL_PWM, 129 .hsync_len = { 0, 42, 0 },
130 }, 130
131 .vactive = { 0, 272, 0 },
132 .vfront_porch = { 0, 3, 0 },
133 .vback_porch = { 0, 2, 0 },
134 .vsync_len = { 0, 11, 0 },
135
136 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
137 DISPLAY_FLAGS_DE_LOW | DISPLAY_FLAGS_PIXDATA_POSEDGE,
138};
139
140static struct panel_dpi_platform_data am3517_evm_lcd_pdata = {
141 .name = "lcd",
142 .source = "dpi.0",
143
144 .data_lines = 16,
145
146 .display_timing = &am3517_evm_lcd_videomode,
147
148 .enable_gpio = LCD_PANEL_PWR,
149 .backlight_gpio = LCD_PANEL_BKLIGHT_PWR,
150};
151
152static struct platform_device am3517_evm_lcd_device = {
153 .name = "panel-dpi",
154 .id = 0,
155 .dev.platform_data = &am3517_evm_lcd_pdata,
131}; 156};
132 157
133static struct omap_dss_device am3517_evm_lcd_device = { 158static struct connector_dvi_platform_data am3517_evm_dvi_connector_pdata = {
134 .type = OMAP_DISPLAY_TYPE_DPI, 159 .name = "dvi",
135 .name = "lcd", 160 .source = "tfp410.0",
136 .driver_name = "generic_dpi_panel", 161 .i2c_bus_num = -1,
137 .data = &lcd_panel,
138 .phy.dpi.data_lines = 16,
139}; 162};
140 163
141static struct omap_dss_device am3517_evm_tv_device = { 164static struct platform_device am3517_evm_dvi_connector_device = {
142 .type = OMAP_DISPLAY_TYPE_VENC, 165 .name = "connector-dvi",
143 .name = "tv", 166 .id = 0,
144 .driver_name = "venc", 167 .dev.platform_data = &am3517_evm_dvi_connector_pdata,
145 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
146}; 168};
147 169
148static struct tfp410_platform_data dvi_panel = { 170static struct encoder_tfp410_platform_data am3517_evm_tfp410_pdata = {
149 .power_down_gpio = -1, 171 .name = "tfp410.0",
150 .i2c_bus_num = -1, 172 .source = "dpi.0",
173 .data_lines = 24,
174 .power_down_gpio = -1,
151}; 175};
152 176
153static struct omap_dss_device am3517_evm_dvi_device = { 177static struct platform_device am3517_evm_tfp410_device = {
154 .type = OMAP_DISPLAY_TYPE_DPI, 178 .name = "tfp410",
155 .name = "dvi", 179 .id = 0,
156 .driver_name = "tfp410", 180 .dev.platform_data = &am3517_evm_tfp410_pdata,
157 .data = &dvi_panel,
158 .phy.dpi.data_lines = 24,
159}; 181};
160 182
161static struct omap_dss_device *am3517_evm_dss_devices[] = { 183static struct connector_atv_platform_data am3517_evm_tv_pdata = {
162 &am3517_evm_lcd_device, 184 .name = "tv",
163 &am3517_evm_tv_device, 185 .source = "venc.0",
164 &am3517_evm_dvi_device, 186 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
187 .invert_polarity = false,
188};
189
190static struct platform_device am3517_evm_tv_connector_device = {
191 .name = "connector-analog-tv",
192 .id = 0,
193 .dev.platform_data = &am3517_evm_tv_pdata,
165}; 194};
166 195
167static struct omap_dss_board_info am3517_evm_dss_data = { 196static struct omap_dss_board_info am3517_evm_dss_data = {
168 .num_devices = ARRAY_SIZE(am3517_evm_dss_devices), 197 .default_display_name = "lcd",
169 .devices = am3517_evm_dss_devices,
170 .default_device = &am3517_evm_lcd_device,
171}; 198};
172 199
200static void __init am3517_evm_display_init(void)
201{
202 gpio_request_one(LCD_PANEL_PWM, GPIOF_OUT_INIT_HIGH, "lcd panel pwm");
203
204 omap_display_init(&am3517_evm_dss_data);
205
206 platform_device_register(&am3517_evm_tfp410_device);
207 platform_device_register(&am3517_evm_dvi_connector_device);
208 platform_device_register(&am3517_evm_lcd_device);
209 platform_device_register(&am3517_evm_tv_connector_device);
210}
211
173/* 212/*
174 * Board initialization 213 * Board initialization
175 */ 214 */
@@ -295,7 +334,9 @@ static void __init am3517_evm_init(void)
295 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 334 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
296 335
297 am3517_evm_i2c_init(); 336 am3517_evm_i2c_init();
298 omap_display_init(&am3517_evm_dss_data); 337
338 am3517_evm_display_init();
339
299 omap_serial_init(); 340 omap_serial_init();
300 omap_sdrc_init(NULL, NULL); 341 omap_sdrc_init(NULL, NULL);
301 342
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index d4622ed26252..33d159e2386e 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -190,52 +190,81 @@ static inline void cm_t35_init_nand(void) {}
190#define CM_T35_LCD_BL_GPIO 58 190#define CM_T35_LCD_BL_GPIO 58
191#define CM_T35_DVI_EN_GPIO 54 191#define CM_T35_DVI_EN_GPIO 54
192 192
193static struct panel_generic_dpi_data lcd_panel = { 193static const struct display_timing cm_t35_lcd_videomode = {
194 .name = "toppoly_tdo35s", 194 .pixelclock = { 0, 26000000, 0 },
195 .num_gpios = 1, 195
196 .gpios = { 196 .hactive = { 0, 480, 0 },
197 CM_T35_LCD_BL_GPIO, 197 .hfront_porch = { 0, 104, 0 },
198 }, 198 .hback_porch = { 0, 8, 0 },
199 .hsync_len = { 0, 8, 0 },
200
201 .vactive = { 0, 640, 0 },
202 .vfront_porch = { 0, 4, 0 },
203 .vback_porch = { 0, 2, 0 },
204 .vsync_len = { 0, 2, 0 },
205
206 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
207 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_NEGEDGE,
208};
209
210static struct panel_dpi_platform_data cm_t35_lcd_pdata = {
211 .name = "lcd",
212 .source = "dpi.0",
213
214 .data_lines = 18,
215
216 .display_timing = &cm_t35_lcd_videomode,
217
218 .enable_gpio = -1,
219 .backlight_gpio = CM_T35_LCD_BL_GPIO,
220};
221
222static struct platform_device cm_t35_lcd_device = {
223 .name = "panel-dpi",
224 .id = 0,
225 .dev.platform_data = &cm_t35_lcd_pdata,
199}; 226};
200 227
201static struct omap_dss_device cm_t35_lcd_device = { 228static struct connector_dvi_platform_data cm_t35_dvi_connector_pdata = {
202 .name = "lcd", 229 .name = "dvi",
203 .type = OMAP_DISPLAY_TYPE_DPI, 230 .source = "tfp410.0",
204 .driver_name = "generic_dpi_panel", 231 .i2c_bus_num = -1,
205 .data = &lcd_panel,
206 .phy.dpi.data_lines = 18,
207}; 232};
208 233
209static struct tfp410_platform_data dvi_panel = { 234static struct platform_device cm_t35_dvi_connector_device = {
210 .power_down_gpio = CM_T35_DVI_EN_GPIO, 235 .name = "connector-dvi",
211 .i2c_bus_num = -1, 236 .id = 0,
237 .dev.platform_data = &cm_t35_dvi_connector_pdata,
212}; 238};
213 239
214static struct omap_dss_device cm_t35_dvi_device = { 240static struct encoder_tfp410_platform_data cm_t35_tfp410_pdata = {
215 .name = "dvi", 241 .name = "tfp410.0",
216 .type = OMAP_DISPLAY_TYPE_DPI, 242 .source = "dpi.0",
217 .driver_name = "tfp410", 243 .data_lines = 24,
218 .data = &dvi_panel, 244 .power_down_gpio = CM_T35_DVI_EN_GPIO,
219 .phy.dpi.data_lines = 24,
220}; 245};
221 246
222static struct omap_dss_device cm_t35_tv_device = { 247static struct platform_device cm_t35_tfp410_device = {
223 .name = "tv", 248 .name = "tfp410",
224 .driver_name = "venc", 249 .id = 0,
225 .type = OMAP_DISPLAY_TYPE_VENC, 250 .dev.platform_data = &cm_t35_tfp410_pdata,
226 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
227}; 251};
228 252
229static struct omap_dss_device *cm_t35_dss_devices[] = { 253static struct connector_atv_platform_data cm_t35_tv_pdata = {
230 &cm_t35_lcd_device, 254 .name = "tv",
231 &cm_t35_dvi_device, 255 .source = "venc.0",
232 &cm_t35_tv_device, 256 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
257 .invert_polarity = false,
258};
259
260static struct platform_device cm_t35_tv_connector_device = {
261 .name = "connector-analog-tv",
262 .id = 0,
263 .dev.platform_data = &cm_t35_tv_pdata,
233}; 264};
234 265
235static struct omap_dss_board_info cm_t35_dss_data = { 266static struct omap_dss_board_info cm_t35_dss_data = {
236 .num_devices = ARRAY_SIZE(cm_t35_dss_devices), 267 .default_display_name = "dvi",
237 .devices = cm_t35_dss_devices,
238 .default_device = &cm_t35_dvi_device,
239}; 268};
240 269
241static struct omap2_mcspi_device_config tdo24m_mcspi_config = { 270static struct omap2_mcspi_device_config tdo24m_mcspi_config = {
@@ -280,6 +309,11 @@ static void __init cm_t35_init_display(void)
280 pr_err("CM-T35: failed to register DSS device\n"); 309 pr_err("CM-T35: failed to register DSS device\n");
281 gpio_free(CM_T35_LCD_EN_GPIO); 310 gpio_free(CM_T35_LCD_EN_GPIO);
282 } 311 }
312
313 platform_device_register(&cm_t35_tfp410_device);
314 platform_device_register(&cm_t35_dvi_connector_device);
315 platform_device_register(&cm_t35_lcd_device);
316 platform_device_register(&cm_t35_tv_connector_device);
283} 317}
284 318
285static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = { 319static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = {
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index f1d91ba5d1ac..cdc4fb9960a9 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -112,50 +112,81 @@ static struct regulator_consumer_supply devkit8000_vio_supply[] = {
112 REGULATOR_SUPPLY("vcc", "spi2.0"), 112 REGULATOR_SUPPLY("vcc", "spi2.0"),
113}; 113};
114 114
115static struct panel_generic_dpi_data lcd_panel = { 115static const struct display_timing devkit8000_lcd_videomode = {
116 .name = "innolux_at070tn83", 116 .pixelclock = { 0, 40000000, 0 },
117 /* gpios filled in code */ 117
118 .hactive = { 0, 800, 0 },
119 .hfront_porch = { 0, 1, 0 },
120 .hback_porch = { 0, 1, 0 },
121 .hsync_len = { 0, 48, 0 },
122
123 .vactive = { 0, 480, 0 },
124 .vfront_porch = { 0, 12, 0 },
125 .vback_porch = { 0, 25, 0 },
126 .vsync_len = { 0, 3, 0 },
127
128 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
129 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
118}; 130};
119 131
120static struct omap_dss_device devkit8000_lcd_device = { 132static struct panel_dpi_platform_data devkit8000_lcd_pdata = {
121 .name = "lcd", 133 .name = "lcd",
122 .type = OMAP_DISPLAY_TYPE_DPI, 134 .source = "dpi.0",
123 .driver_name = "generic_dpi_panel", 135
124 .data = &lcd_panel, 136 .data_lines = 24,
125 .phy.dpi.data_lines = 24, 137
138 .display_timing = &devkit8000_lcd_videomode,
139
140 .enable_gpio = -1, /* filled in code */
141 .backlight_gpio = -1,
126}; 142};
127 143
128static struct tfp410_platform_data dvi_panel = { 144static struct platform_device devkit8000_lcd_device = {
129 .power_down_gpio = -1, 145 .name = "panel-dpi",
130 .i2c_bus_num = 1, 146 .id = 0,
147 .dev.platform_data = &devkit8000_lcd_pdata,
131}; 148};
132 149
133static struct omap_dss_device devkit8000_dvi_device = { 150static struct connector_dvi_platform_data devkit8000_dvi_connector_pdata = {
134 .name = "dvi", 151 .name = "dvi",
135 .type = OMAP_DISPLAY_TYPE_DPI, 152 .source = "tfp410.0",
136 .driver_name = "tfp410", 153 .i2c_bus_num = 1,
137 .data = &dvi_panel,
138 .phy.dpi.data_lines = 24,
139}; 154};
140 155
141static struct omap_dss_device devkit8000_tv_device = { 156static struct platform_device devkit8000_dvi_connector_device = {
142 .name = "tv", 157 .name = "connector-dvi",
143 .driver_name = "venc", 158 .id = 0,
144 .type = OMAP_DISPLAY_TYPE_VENC, 159 .dev.platform_data = &devkit8000_dvi_connector_pdata,
145 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
146}; 160};
147 161
162static struct encoder_tfp410_platform_data devkit8000_tfp410_pdata = {
163 .name = "tfp410.0",
164 .source = "dpi.0",
165 .data_lines = 24,
166 .power_down_gpio = -1, /* filled in code */
167};
148 168
149static struct omap_dss_device *devkit8000_dss_devices[] = { 169static struct platform_device devkit8000_tfp410_device = {
150 &devkit8000_lcd_device, 170 .name = "tfp410",
151 &devkit8000_dvi_device, 171 .id = 0,
152 &devkit8000_tv_device, 172 .dev.platform_data = &devkit8000_tfp410_pdata,
173};
174
175static struct connector_atv_platform_data devkit8000_tv_pdata = {
176 .name = "tv",
177 .source = "venc.0",
178 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
179 .invert_polarity = false,
180};
181
182static struct platform_device devkit8000_tv_connector_device = {
183 .name = "connector-analog-tv",
184 .id = 0,
185 .dev.platform_data = &devkit8000_tv_pdata,
153}; 186};
154 187
155static struct omap_dss_board_info devkit8000_dss_data = { 188static struct omap_dss_board_info devkit8000_dss_data = {
156 .num_devices = ARRAY_SIZE(devkit8000_dss_devices), 189 .default_display_name = "lcd",
157 .devices = devkit8000_dss_devices,
158 .default_device = &devkit8000_lcd_device,
159}; 190};
160 191
161static uint32_t board_keymap[] = { 192static uint32_t board_keymap[] = {
@@ -204,11 +235,10 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
204 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; 235 gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
205 236
206 /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */ 237 /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
207 lcd_panel.num_gpios = 1; 238 devkit8000_lcd_pdata.enable_gpio = gpio + TWL4030_GPIO_MAX + 0;
208 lcd_panel.gpios[0] = gpio + TWL4030_GPIO_MAX + 0;
209 239
210 /* gpio + 7 is "DVI_PD" (out, active low) */ 240 /* gpio + 7 is "DVI_PD" (out, active low) */
211 dvi_panel.power_down_gpio = gpio + 7; 241 devkit8000_tfp410_pdata.power_down_gpio = gpio + 7;
212 242
213 return 0; 243 return 0;
214} 244}
@@ -413,6 +443,10 @@ static struct platform_device *devkit8000_devices[] __initdata = {
413 &leds_gpio, 443 &leds_gpio,
414 &keys_gpio, 444 &keys_gpio,
415 &omap_dm9000_dev, 445 &omap_dm9000_dev,
446 &devkit8000_lcd_device,
447 &devkit8000_tfp410_device,
448 &devkit8000_dvi_connector_device,
449 &devkit8000_tv_connector_device,
416}; 450};
417 451
418static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 452static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c
index 69c0acf5aa63..87e41a8b8d46 100644
--- a/arch/arm/mach-omap2/board-h4.c
+++ b/arch/arm/mach-omap2/board-h4.c
@@ -194,30 +194,48 @@ static struct platform_device h4_flash_device = {
194 .resource = &h4_flash_resource, 194 .resource = &h4_flash_resource,
195}; 195};
196 196
197static struct platform_device *h4_devices[] __initdata = { 197static const struct display_timing cm_t35_lcd_videomode = {
198 &h4_flash_device, 198 .pixelclock = { 0, 6250000, 0 },
199
200 .hactive = { 0, 240, 0 },
201 .hfront_porch = { 0, 15, 0 },
202 .hback_porch = { 0, 60, 0 },
203 .hsync_len = { 0, 15, 0 },
204
205 .vactive = { 0, 320, 0 },
206 .vfront_porch = { 0, 1, 0 },
207 .vback_porch = { 0, 1, 0 },
208 .vsync_len = { 0, 1, 0 },
209
210 .flags = DISPLAY_FLAGS_HSYNC_HIGH | DISPLAY_FLAGS_VSYNC_HIGH |
211 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
199}; 212};
200 213
201static struct panel_generic_dpi_data h4_panel_data = { 214static struct panel_dpi_platform_data cm_t35_lcd_pdata = {
202 .name = "h4", 215 .name = "lcd",
216 .source = "dpi.0",
217
218 .data_lines = 16,
219
220 .display_timing = &cm_t35_lcd_videomode,
221
222 .enable_gpio = -1,
223 .backlight_gpio = -1,
203}; 224};
204 225
205static struct omap_dss_device h4_lcd_device = { 226static struct platform_device cm_t35_lcd_device = {
206 .name = "lcd", 227 .name = "panel-dpi",
207 .driver_name = "generic_dpi_panel", 228 .id = 0,
208 .type = OMAP_DISPLAY_TYPE_DPI, 229 .dev.platform_data = &cm_t35_lcd_pdata,
209 .phy.dpi.data_lines = 16,
210 .data = &h4_panel_data,
211}; 230};
212 231
213static struct omap_dss_device *h4_dss_devices[] = { 232static struct platform_device *h4_devices[] __initdata = {
214 &h4_lcd_device, 233 &h4_flash_device,
234 &cm_t35_lcd_device,
215}; 235};
216 236
217static struct omap_dss_board_info h4_dss_data = { 237static struct omap_dss_board_info h4_dss_data = {
218 .num_devices = ARRAY_SIZE(h4_dss_devices), 238 .default_display_name = "lcd",
219 .devices = h4_dss_devices,
220 .default_device = &h4_lcd_device,
221}; 239};
222 240
223/* 2420 Sysboot setup (2430 is different) */ 241/* 2420 Sysboot setup (2430 is different) */
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 87e65dde8e13..06dbb2d3d38b 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -429,31 +429,39 @@ static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = {
429 .setup = igep_twl_gpio_setup, 429 .setup = igep_twl_gpio_setup,
430}; 430};
431 431
432static struct tfp410_platform_data dvi_panel = { 432static struct connector_dvi_platform_data omap3stalker_dvi_connector_pdata = {
433 .i2c_bus_num = 3, 433 .name = "dvi",
434 .power_down_gpio = IGEP2_GPIO_DVI_PUP, 434 .source = "tfp410.0",
435 .i2c_bus_num = 3,
435}; 436};
436 437
437static struct omap_dss_device igep2_dvi_device = { 438static struct platform_device omap3stalker_dvi_connector_device = {
438 .type = OMAP_DISPLAY_TYPE_DPI, 439 .name = "connector-dvi",
439 .name = "dvi", 440 .id = 0,
440 .driver_name = "tfp410", 441 .dev.platform_data = &omap3stalker_dvi_connector_pdata,
441 .data = &dvi_panel,
442 .phy.dpi.data_lines = 24,
443}; 442};
444 443
445static struct omap_dss_device *igep2_dss_devices[] = { 444static struct encoder_tfp410_platform_data omap3stalker_tfp410_pdata = {
446 &igep2_dvi_device 445 .name = "tfp410.0",
446 .source = "dpi.0",
447 .data_lines = 24,
448 .power_down_gpio = IGEP2_GPIO_DVI_PUP,
449};
450
451static struct platform_device omap3stalker_tfp410_device = {
452 .name = "tfp410",
453 .id = 0,
454 .dev.platform_data = &omap3stalker_tfp410_pdata,
447}; 455};
448 456
449static struct omap_dss_board_info igep2_dss_data = { 457static struct omap_dss_board_info igep2_dss_data = {
450 .num_devices = ARRAY_SIZE(igep2_dss_devices), 458 .default_display_name = "dvi",
451 .devices = igep2_dss_devices,
452 .default_device = &igep2_dvi_device,
453}; 459};
454 460
455static struct platform_device *igep_devices[] __initdata = { 461static struct platform_device *igep_devices[] __initdata = {
456 &igep_vwlan_device, 462 &igep_vwlan_device,
463 &omap3stalker_tfp410_device,
464 &omap3stalker_dvi_connector_device,
457}; 465};
458 466
459static int igep2_keymap[] = { 467static int igep2_keymap[] = {
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 62e4f701b63b..dd8da2c5399f 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -184,45 +184,70 @@ static inline void __init ldp_init_smsc911x(void)
184#define LCD_PANEL_RESET_GPIO 55 184#define LCD_PANEL_RESET_GPIO 55
185#define LCD_PANEL_QVGA_GPIO 56 185#define LCD_PANEL_QVGA_GPIO 56
186 186
187static struct panel_generic_dpi_data ldp_panel_data = { 187static const struct display_timing ldp_lcd_videomode = {
188 .name = "nec_nl2432dr22-11b", 188 .pixelclock = { 0, 5400000, 0 },
189 .num_gpios = 4, 189
190 /* gpios filled in code */ 190 .hactive = { 0, 240, 0 },
191 .hfront_porch = { 0, 3, 0 },
192 .hback_porch = { 0, 39, 0 },
193 .hsync_len = { 0, 3, 0 },
194
195 .vactive = { 0, 320, 0 },
196 .vfront_porch = { 0, 2, 0 },
197 .vback_porch = { 0, 7, 0 },
198 .vsync_len = { 0, 1, 0 },
199
200 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
201 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
191}; 202};
192 203
193static struct omap_dss_device ldp_lcd_device = { 204static struct panel_dpi_platform_data ldp_lcd_pdata = {
194 .name = "lcd", 205 .name = "lcd",
195 .driver_name = "generic_dpi_panel", 206 .source = "dpi.0",
196 .type = OMAP_DISPLAY_TYPE_DPI, 207
197 .phy.dpi.data_lines = 18, 208 .data_lines = 18,
198 .data = &ldp_panel_data, 209
210 .display_timing = &ldp_lcd_videomode,
211
212 .enable_gpio = -1, /* filled in code */
213 .backlight_gpio = -1, /* filled in code */
199}; 214};
200 215
201static struct omap_dss_device *ldp_dss_devices[] = { 216static struct platform_device ldp_lcd_device = {
202 &ldp_lcd_device, 217 .name = "panel-dpi",
218 .id = 0,
219 .dev.platform_data = &ldp_lcd_pdata,
203}; 220};
204 221
205static struct omap_dss_board_info ldp_dss_data = { 222static struct omap_dss_board_info ldp_dss_data = {
206 .num_devices = ARRAY_SIZE(ldp_dss_devices), 223 .default_display_name = "lcd",
207 .devices = ldp_dss_devices,
208 .default_device = &ldp_lcd_device,
209}; 224};
210 225
211static void __init ldp_display_init(void) 226static void __init ldp_display_init(void)
212{ 227{
213 ldp_panel_data.gpios[2] = LCD_PANEL_RESET_GPIO; 228 int r;
214 ldp_panel_data.gpios[3] = LCD_PANEL_QVGA_GPIO; 229
230 static struct gpio gpios[] __initdata = {
231 {LCD_PANEL_RESET_GPIO, GPIOF_OUT_INIT_HIGH, "LCD RESET"},
232 {LCD_PANEL_QVGA_GPIO, GPIOF_OUT_INIT_HIGH, "LCD QVGA"},
233 };
234
235 r = gpio_request_array(gpios, ARRAY_SIZE(gpios));
236 if (r) {
237 pr_err("Cannot request LCD GPIOs, error %d\n", r);
238 return;
239 }
215 240
216 omap_display_init(&ldp_dss_data); 241 omap_display_init(&ldp_dss_data);
217} 242}
218 243
219static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) 244static int ldp_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio)
220{ 245{
221 ldp_panel_data.gpios[0] = gpio + 7; 246 /* LCD enable GPIO */
222 ldp_panel_data.gpio_invert[0] = true; 247 ldp_lcd_pdata.enable_gpio = gpio + 7;
223 248
224 ldp_panel_data.gpios[1] = gpio + 15; 249 /* Backlight enable GPIO */
225 ldp_panel_data.gpio_invert[1] = true; 250 ldp_lcd_pdata.backlight_gpio = gpio + 15;
226 251
227 return 0; 252 return 0;
228} 253}
@@ -322,6 +347,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
322 347
323static struct platform_device *ldp_devices[] __initdata = { 348static struct platform_device *ldp_devices[] __initdata = {
324 &ldp_gpio_keys_device, 349 &ldp_gpio_keys_device,
350 &ldp_lcd_device,
325}; 351};
326 352
327#ifdef CONFIG_OMAP_MUX 353#ifdef CONFIG_OMAP_MUX
diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c
index f6eeb87e4e95..827d15009a86 100644
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -122,11 +122,7 @@ static struct musb_hdrc_config musb_config = {
122}; 122};
123 123
124static struct musb_hdrc_platform_data tusb_data = { 124static struct musb_hdrc_platform_data tusb_data = {
125#ifdef CONFIG_USB_GADGET_MUSB_HDRC
126 .mode = MUSB_OTG, 125 .mode = MUSB_OTG,
127#else
128 .mode = MUSB_HOST,
129#endif
130 .set_power = tusb_set_power, 126 .set_power = tusb_set_power,
131 .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */ 127 .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
132 .power = 100, /* Max 100 mA VBUS for host mode */ 128 .power = 100, /* Max 100 mA VBUS for host mode */
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 04c116555412..f26918467efc 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -33,7 +33,7 @@
33#include <linux/mtd/nand.h> 33#include <linux/mtd/nand.h>
34#include <linux/mmc/host.h> 34#include <linux/mmc/host.h>
35#include <linux/usb/phy.h> 35#include <linux/usb/phy.h>
36#include <linux/usb/nop-usb-xceiv.h> 36#include <linux/usb/usb_phy_gen_xceiv.h>
37 37
38#include <linux/regulator/machine.h> 38#include <linux/regulator/machine.h>
39#include <linux/i2c/twl.h> 39#include <linux/i2c/twl.h>
@@ -225,35 +225,46 @@ static struct mtd_partition omap3beagle_nand_partitions[] = {
225 225
226/* DSS */ 226/* DSS */
227 227
228static struct tfp410_platform_data dvi_panel = { 228static struct connector_dvi_platform_data beagle_dvi_connector_pdata = {
229 .i2c_bus_num = 3, 229 .name = "dvi",
230 .power_down_gpio = -1, 230 .source = "tfp410.0",
231 .i2c_bus_num = 3,
231}; 232};
232 233
233static struct omap_dss_device beagle_dvi_device = { 234static struct platform_device beagle_dvi_connector_device = {
234 .type = OMAP_DISPLAY_TYPE_DPI, 235 .name = "connector-dvi",
235 .name = "dvi", 236 .id = 0,
236 .driver_name = "tfp410", 237 .dev.platform_data = &beagle_dvi_connector_pdata,
237 .data = &dvi_panel,
238 .phy.dpi.data_lines = 24,
239}; 238};
240 239
241static struct omap_dss_device beagle_tv_device = { 240static struct encoder_tfp410_platform_data beagle_tfp410_pdata = {
241 .name = "tfp410.0",
242 .source = "dpi.0",
243 .data_lines = 24,
244 .power_down_gpio = -1,
245};
246
247static struct platform_device beagle_tfp410_device = {
248 .name = "tfp410",
249 .id = 0,
250 .dev.platform_data = &beagle_tfp410_pdata,
251};
252
253static struct connector_atv_platform_data beagle_tv_pdata = {
242 .name = "tv", 254 .name = "tv",
243 .driver_name = "venc", 255 .source = "venc.0",
244 .type = OMAP_DISPLAY_TYPE_VENC, 256 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
245 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, 257 .invert_polarity = false,
246}; 258};
247 259
248static struct omap_dss_device *beagle_dss_devices[] = { 260static struct platform_device beagle_tv_connector_device = {
249 &beagle_dvi_device, 261 .name = "connector-analog-tv",
250 &beagle_tv_device, 262 .id = 0,
263 .dev.platform_data = &beagle_tv_pdata,
251}; 264};
252 265
253static struct omap_dss_board_info beagle_dss_data = { 266static struct omap_dss_board_info beagle_dss_data = {
254 .num_devices = ARRAY_SIZE(beagle_dss_devices), 267 .default_display_name = "dvi",
255 .devices = beagle_dss_devices,
256 .default_device = &beagle_dvi_device,
257}; 268};
258 269
259#include "sdram-micron-mt46h32m32lf-6.h" 270#include "sdram-micron-mt46h32m32lf-6.h"
@@ -279,7 +290,7 @@ static struct regulator_consumer_supply beagle_vsim_supply[] = {
279static struct gpio_led gpio_leds[]; 290static struct gpio_led gpio_leds[];
280 291
281/* PHY's VCC regulator might be added later, so flag that we need it */ 292/* PHY's VCC regulator might be added later, so flag that we need it */
282static struct nop_usb_xceiv_platform_data hsusb2_phy_data = { 293static struct usb_phy_gen_xceiv_platform_data hsusb2_phy_data = {
283 .needs_vcc = true, 294 .needs_vcc = true,
284}; 295};
285 296
@@ -332,7 +343,11 @@ static int beagle_twl_gpio_setup(struct device *dev,
332 if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC")) 343 if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC"))
333 pr_err("%s: unable to configure EHCI_nOC\n", __func__); 344 pr_err("%s: unable to configure EHCI_nOC\n", __func__);
334 } 345 }
335 dvi_panel.power_down_gpio = beagle_config.dvi_pd_gpio; 346 beagle_tfp410_pdata.power_down_gpio = beagle_config.dvi_pd_gpio;
347
348 platform_device_register(&beagle_tfp410_device);
349 platform_device_register(&beagle_dvi_connector_device);
350 platform_device_register(&beagle_tv_connector_device);
336 351
337 /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */ 352 /* TWL4030_GPIO_MAX i.e. LED_GPO controls HS USB Port 2 power */
338 phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX; 353 phy_data[0].vcc_gpio = gpio + TWL4030_GPIO_MAX;
@@ -547,6 +562,7 @@ static void __init omap3_beagle_init(void)
547 if (gpio_is_valid(beagle_config.dvi_pd_gpio)) 562 if (gpio_is_valid(beagle_config.dvi_pd_gpio))
548 omap_mux_init_gpio(beagle_config.dvi_pd_gpio, OMAP_PIN_OUTPUT); 563 omap_mux_init_gpio(beagle_config.dvi_pd_gpio, OMAP_PIN_OUTPUT);
549 omap_display_init(&beagle_dss_data); 564 omap_display_init(&beagle_dss_data);
565
550 omap_serial_init(); 566 omap_serial_init();
551 omap_sdrc_init(mt46h32m32lf6_sdrc_params, 567 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
552 mt46h32m32lf6_sdrc_params); 568 mt46h32m32lf6_sdrc_params);
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index 8c026269baca..18143873346c 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -33,7 +33,7 @@
33#include <linux/i2c/twl.h> 33#include <linux/i2c/twl.h>
34#include <linux/usb/otg.h> 34#include <linux/usb/otg.h>
35#include <linux/usb/musb.h> 35#include <linux/usb/musb.h>
36#include <linux/usb/nop-usb-xceiv.h> 36#include <linux/usb/usb_phy_gen_xceiv.h>
37#include <linux/smsc911x.h> 37#include <linux/smsc911x.h>
38 38
39#include <linux/wl12xx.h> 39#include <linux/wl12xx.h>
@@ -166,14 +166,6 @@ static inline void __init omap3evm_init_smsc911x(void) { return; }
166 */ 166 */
167#define OMAP3EVM_DVI_PANEL_EN_GPIO 199 167#define OMAP3EVM_DVI_PANEL_EN_GPIO 199
168 168
169static struct panel_sharp_ls037v7dw01_data omap3_evm_lcd_data = {
170 .resb_gpio = OMAP3EVM_LCD_PANEL_RESB,
171 .ini_gpio = OMAP3EVM_LCD_PANEL_INI,
172 .mo_gpio = OMAP3EVM_LCD_PANEL_QVGA,
173 .lr_gpio = OMAP3EVM_LCD_PANEL_LR,
174 .ud_gpio = OMAP3EVM_LCD_PANEL_UD,
175};
176
177#ifdef CONFIG_BROKEN 169#ifdef CONFIG_BROKEN
178static void __init omap3_evm_display_init(void) 170static void __init omap3_evm_display_init(void)
179{ 171{
@@ -196,44 +188,65 @@ static void __init omap3_evm_display_init(void)
196} 188}
197#endif 189#endif
198 190
199static struct omap_dss_device omap3_evm_lcd_device = { 191static struct panel_sharp_ls037v7dw01_platform_data omap3_evm_lcd_pdata = {
200 .name = "lcd", 192 .name = "lcd",
201 .driver_name = "sharp_ls_panel", 193 .source = "dpi.0",
202 .type = OMAP_DISPLAY_TYPE_DPI, 194
203 .phy.dpi.data_lines = 18, 195 .data_lines = 18,
204 .data = &omap3_evm_lcd_data, 196
197 .resb_gpio = OMAP3EVM_LCD_PANEL_RESB,
198 .ini_gpio = OMAP3EVM_LCD_PANEL_INI,
199 .mo_gpio = OMAP3EVM_LCD_PANEL_QVGA,
200 .lr_gpio = OMAP3EVM_LCD_PANEL_LR,
201 .ud_gpio = OMAP3EVM_LCD_PANEL_UD,
202};
203
204static struct platform_device omap3_evm_lcd_device = {
205 .name = "panel-sharp-ls037v7dw01",
206 .id = 0,
207 .dev.platform_data = &omap3_evm_lcd_pdata,
208};
209
210static struct connector_dvi_platform_data omap3_evm_dvi_connector_pdata = {
211 .name = "dvi",
212 .source = "tfp410.0",
213 .i2c_bus_num = -1,
214};
215
216static struct platform_device omap3_evm_dvi_connector_device = {
217 .name = "connector-dvi",
218 .id = 0,
219 .dev.platform_data = &omap3_evm_dvi_connector_pdata,
205}; 220};
206 221
207static struct omap_dss_device omap3_evm_tv_device = { 222static struct encoder_tfp410_platform_data omap3_evm_tfp410_pdata = {
208 .name = "tv", 223 .name = "tfp410.0",
209 .driver_name = "venc", 224 .source = "dpi.0",
210 .type = OMAP_DISPLAY_TYPE_VENC, 225 .data_lines = 24,
211 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, 226 .power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO,
212}; 227};
213 228
214static struct tfp410_platform_data dvi_panel = { 229static struct platform_device omap3_evm_tfp410_device = {
215 .power_down_gpio = OMAP3EVM_DVI_PANEL_EN_GPIO, 230 .name = "tfp410",
216 .i2c_bus_num = -1, 231 .id = 0,
232 .dev.platform_data = &omap3_evm_tfp410_pdata,
217}; 233};
218 234
219static struct omap_dss_device omap3_evm_dvi_device = { 235static struct connector_atv_platform_data omap3_evm_tv_pdata = {
220 .name = "dvi", 236 .name = "tv",
221 .type = OMAP_DISPLAY_TYPE_DPI, 237 .source = "venc.0",
222 .driver_name = "tfp410", 238 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
223 .data = &dvi_panel, 239 .invert_polarity = false,
224 .phy.dpi.data_lines = 24,
225}; 240};
226 241
227static struct omap_dss_device *omap3_evm_dss_devices[] = { 242static struct platform_device omap3_evm_tv_connector_device = {
228 &omap3_evm_lcd_device, 243 .name = "connector-analog-tv",
229 &omap3_evm_tv_device, 244 .id = 0,
230 &omap3_evm_dvi_device, 245 .dev.platform_data = &omap3_evm_tv_pdata,
231}; 246};
232 247
233static struct omap_dss_board_info omap3_evm_dss_data = { 248static struct omap_dss_board_info omap3_evm_dss_data = {
234 .num_devices = ARRAY_SIZE(omap3_evm_dss_devices), 249 .default_display_name = "lcd",
235 .devices = omap3_evm_dss_devices,
236 .default_device = &omap3_evm_lcd_device,
237}; 250};
238 251
239static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = { 252static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = {
@@ -468,7 +481,7 @@ struct wl12xx_platform_data omap3evm_wlan_data __initdata = {
468static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = { 481static struct regulator_consumer_supply omap3evm_vaux2_supplies[] = {
469 REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */ 482 REGULATOR_SUPPLY("VDD_CSIPHY1", "omap3isp"), /* OMAP ISP */
470 REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */ 483 REGULATOR_SUPPLY("VDD_CSIPHY2", "omap3isp"), /* OMAP ISP */
471 REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */ 484 REGULATOR_SUPPLY("vcc", "usb_phy_gen_xceiv.2"), /* hsusb port 2 */
472 REGULATOR_SUPPLY("vaux2", NULL), 485 REGULATOR_SUPPLY("vaux2", NULL),
473}; 486};
474 487
@@ -678,6 +691,10 @@ static void __init omap3_evm_init(void)
678 omap3_evm_i2c_init(); 691 omap3_evm_i2c_init();
679 692
680 omap_display_init(&omap3_evm_dss_data); 693 omap_display_init(&omap3_evm_dss_data);
694 platform_device_register(&omap3_evm_lcd_device);
695 platform_device_register(&omap3_evm_tfp410_device);
696 platform_device_register(&omap3_evm_dvi_connector_device);
697 platform_device_register(&omap3_evm_tv_connector_device);
681 698
682 omap_serial_init(); 699 omap_serial_init();
683 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL); 700 omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL);
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index b1547a0edfcd..de1bc6bbe585 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -231,34 +231,21 @@ static struct twl4030_keypad_data pandora_kp_data = {
231 .rep = 1, 231 .rep = 1,
232}; 232};
233 233
234static struct panel_tpo_td043_data lcd_data = { 234static struct connector_atv_platform_data pandora_tv_pdata = {
235 .nreset_gpio = 157, 235 .name = "tv",
236}; 236 .source = "venc.0",
237 237 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
238static struct omap_dss_device pandora_lcd_device = { 238 .invert_polarity = false,
239 .name = "lcd",
240 .driver_name = "tpo_td043mtea1_panel",
241 .type = OMAP_DISPLAY_TYPE_DPI,
242 .phy.dpi.data_lines = 24,
243 .data = &lcd_data,
244};
245
246static struct omap_dss_device pandora_tv_device = {
247 .name = "tv",
248 .driver_name = "venc",
249 .type = OMAP_DISPLAY_TYPE_VENC,
250 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
251}; 239};
252 240
253static struct omap_dss_device *pandora_dss_devices[] = { 241static struct platform_device pandora_tv_connector_device = {
254 &pandora_lcd_device, 242 .name = "connector-analog-tv",
255 &pandora_tv_device, 243 .id = 0,
244 .dev.platform_data = &pandora_tv_pdata,
256}; 245};
257 246
258static struct omap_dss_board_info pandora_dss_data = { 247static struct omap_dss_board_info pandora_dss_data = {
259 .num_devices = ARRAY_SIZE(pandora_dss_devices), 248 .default_display_name = "lcd",
260 .devices = pandora_dss_devices,
261 .default_device = &pandora_lcd_device,
262}; 249};
263 250
264static void pandora_wl1251_init_card(struct mmc_card *card) 251static void pandora_wl1251_init_card(struct mmc_card *card)
@@ -348,11 +335,11 @@ static struct regulator_consumer_supply pandora_vdds_supplies[] = {
348}; 335};
349 336
350static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { 337static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = {
351 REGULATOR_SUPPLY("vcc", "display0"), 338 REGULATOR_SUPPLY("vcc", "spi1.1"),
352}; 339};
353 340
354static struct regulator_consumer_supply pandora_usb_phy_supply[] = { 341static struct regulator_consumer_supply pandora_usb_phy_supply[] = {
355 REGULATOR_SUPPLY("vcc", "nop_usb_xceiv.2"), /* hsusb port 2 */ 342 REGULATOR_SUPPLY("vcc", "usb_phy_gen_xceiv.2"), /* hsusb port 2 */
356}; 343};
357 344
358/* ads7846 on SPI and 2 nub controllers on I2C */ 345/* ads7846 on SPI and 2 nub controllers on I2C */
@@ -529,13 +516,21 @@ static int __init omap3pandora_i2c_init(void)
529 return 0; 516 return 0;
530} 517}
531 518
519static struct panel_tpo_td043mtea1_platform_data pandora_lcd_pdata = {
520 .name = "lcd",
521 .source = "dpi.0",
522
523 .data_lines = 24,
524 .nreset_gpio = 157,
525};
526
532static struct spi_board_info omap3pandora_spi_board_info[] __initdata = { 527static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
533 { 528 {
534 .modalias = "tpo_td043mtea1_panel_spi", 529 .modalias = "panel-tpo-td043mtea1",
535 .bus_num = 1, 530 .bus_num = 1,
536 .chip_select = 1, 531 .chip_select = 1,
537 .max_speed_hz = 375000, 532 .max_speed_hz = 375000,
538 .platform_data = &pandora_lcd_device, 533 .platform_data = &pandora_lcd_pdata,
539 } 534 }
540}; 535};
541 536
@@ -580,6 +575,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
580 &pandora_keys_gpio, 575 &pandora_keys_gpio,
581 &pandora_vwlan_device, 576 &pandora_vwlan_device,
582 &pandora_backlight, 577 &pandora_backlight,
578 &pandora_tv_connector_device,
583}; 579};
584 580
585static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 581static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c
index d37e6b187ae4..ba8342fef799 100644
--- a/arch/arm/mach-omap2/board-omap3stalker.c
+++ b/arch/arm/mach-omap2/board-omap3stalker.c
@@ -93,40 +93,50 @@ static void __init omap3_stalker_display_init(void)
93{ 93{
94 return; 94 return;
95} 95}
96static struct connector_dvi_platform_data omap3stalker_dvi_connector_pdata = {
97 .name = "dvi",
98 .source = "tfp410.0",
99 .i2c_bus_num = -1,
100};
96 101
97static struct omap_dss_device omap3_stalker_tv_device = { 102static struct platform_device omap3stalker_dvi_connector_device = {
98 .name = "tv", 103 .name = "connector-dvi",
99 .driver_name = "venc", 104 .id = 0,
100 .type = OMAP_DISPLAY_TYPE_VENC, 105 .dev.platform_data = &omap3stalker_dvi_connector_pdata,
101#if defined(CONFIG_OMAP2_VENC_OUT_TYPE_SVIDEO)
102 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
103#elif defined(CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE)
104 .u.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
105#endif
106}; 106};
107 107
108static struct tfp410_platform_data dvi_panel = { 108static struct encoder_tfp410_platform_data omap3stalker_tfp410_pdata = {
109 .power_down_gpio = DSS_ENABLE_GPIO, 109 .name = "tfp410.0",
110 .i2c_bus_num = -1, 110 .source = "dpi.0",
111 .data_lines = 24,
112 .power_down_gpio = DSS_ENABLE_GPIO,
111}; 113};
112 114
113static struct omap_dss_device omap3_stalker_dvi_device = { 115static struct platform_device omap3stalker_tfp410_device = {
114 .name = "dvi", 116 .name = "tfp410",
115 .type = OMAP_DISPLAY_TYPE_DPI, 117 .id = 0,
116 .driver_name = "tfp410", 118 .dev.platform_data = &omap3stalker_tfp410_pdata,
117 .data = &dvi_panel, 119};
118 .phy.dpi.data_lines = 24, 120
121static struct connector_atv_platform_data omap3stalker_tv_pdata = {
122 .name = "tv",
123 .source = "venc.0",
124#if defined(CONFIG_OMAP2_VENC_OUT_TYPE_SVIDEO)
125 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
126#elif defined(CONFIG_OMAP2_VENC_OUT_TYPE_COMPOSITE)
127 .connector_type = OMAP_DSS_VENC_TYPE_COMPOSITE,
128#endif
129 .invert_polarity = false,
119}; 130};
120 131
121static struct omap_dss_device *omap3_stalker_dss_devices[] = { 132static struct platform_device omap3stalker_tv_connector_device = {
122 &omap3_stalker_tv_device, 133 .name = "connector-analog-tv",
123 &omap3_stalker_dvi_device, 134 .id = 0,
135 .dev.platform_data = &omap3stalker_tv_pdata,
124}; 136};
125 137
126static struct omap_dss_board_info omap3_stalker_dss_data = { 138static struct omap_dss_board_info omap3_stalker_dss_data = {
127 .num_devices = ARRAY_SIZE(omap3_stalker_dss_devices), 139 .default_display_name = "dvi",
128 .devices = omap3_stalker_dss_devices,
129 .default_device = &omap3_stalker_dvi_device,
130}; 140};
131 141
132static struct regulator_consumer_supply omap3stalker_vmmc1_supply[] = { 142static struct regulator_consumer_supply omap3stalker_vmmc1_supply[] = {
@@ -356,6 +366,9 @@ static struct usbhs_phy_data phy_data[] __initdata = {
356 366
357static struct platform_device *omap3_stalker_devices[] __initdata = { 367static struct platform_device *omap3_stalker_devices[] __initdata = {
358 &keys_gpio, 368 &keys_gpio,
369 &omap3stalker_tfp410_device,
370 &omap3stalker_dvi_connector_device,
371 &omap3stalker_tv_connector_device,
359}; 372};
360 373
361static struct usbhs_omap_platform_data usbhs_bdata __initdata = { 374static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index 5748b5d06c23..f6d384111911 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -72,6 +72,9 @@
72#define OVERO_SMSC911X2_CS 4 72#define OVERO_SMSC911X2_CS 4
73#define OVERO_SMSC911X2_GPIO 65 73#define OVERO_SMSC911X2_GPIO 65
74 74
75/* whether to register LCD35 instead of LCD43 */
76static bool overo_use_lcd35;
77
75#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 78#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
76 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 79 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
77 80
@@ -149,78 +152,94 @@ static inline void __init overo_init_smsc911x(void) { return; }
149#define OVERO_GPIO_LCD_EN 144 152#define OVERO_GPIO_LCD_EN 144
150#define OVERO_GPIO_LCD_BL 145 153#define OVERO_GPIO_LCD_BL 145
151 154
152static struct tfp410_platform_data dvi_panel = { 155static struct connector_atv_platform_data overo_tv_pdata = {
153 .i2c_bus_num = 3, 156 .name = "tv",
154 .power_down_gpio = -1, 157 .source = "venc.0",
158 .connector_type = OMAP_DSS_VENC_TYPE_SVIDEO,
159 .invert_polarity = false,
155}; 160};
156 161
157static struct omap_dss_device overo_dvi_device = { 162static struct platform_device overo_tv_connector_device = {
158 .name = "dvi", 163 .name = "connector-analog-tv",
159 .type = OMAP_DISPLAY_TYPE_DPI, 164 .id = 0,
160 .driver_name = "tfp410", 165 .dev.platform_data = &overo_tv_pdata,
161 .data = &dvi_panel,
162 .phy.dpi.data_lines = 24,
163}; 166};
164 167
165static struct omap_dss_device overo_tv_device = { 168static const struct display_timing overo_lcd43_videomode = {
166 .name = "tv", 169 .pixelclock = { 0, 9200000, 0 },
167 .driver_name = "venc", 170
168 .type = OMAP_DISPLAY_TYPE_VENC, 171 .hactive = { 0, 480, 0 },
169 .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, 172 .hfront_porch = { 0, 8, 0 },
173 .hback_porch = { 0, 4, 0 },
174 .hsync_len = { 0, 41, 0 },
175
176 .vactive = { 0, 272, 0 },
177 .vfront_porch = { 0, 4, 0 },
178 .vback_porch = { 0, 2, 0 },
179 .vsync_len = { 0, 10, 0 },
180
181 .flags = DISPLAY_FLAGS_HSYNC_LOW | DISPLAY_FLAGS_VSYNC_LOW |
182 DISPLAY_FLAGS_DE_HIGH | DISPLAY_FLAGS_PIXDATA_POSEDGE,
170}; 183};
171 184
172static struct panel_generic_dpi_data lcd43_panel = { 185static struct panel_dpi_platform_data overo_lcd43_pdata = {
173 .name = "samsung_lte430wq_f0c", 186 .name = "lcd43",
174 .num_gpios = 2, 187 .source = "dpi.0",
175 .gpios = { 188
176 OVERO_GPIO_LCD_EN, 189 .data_lines = 24,
177 OVERO_GPIO_LCD_BL 190
178 }, 191 .display_timing = &overo_lcd43_videomode,
192
193 .enable_gpio = OVERO_GPIO_LCD_EN,
194 .backlight_gpio = OVERO_GPIO_LCD_BL,
179}; 195};
180 196
181static struct omap_dss_device overo_lcd43_device = { 197static struct platform_device overo_lcd43_device = {
182 .name = "lcd43", 198 .name = "panel-dpi",
183 .type = OMAP_DISPLAY_TYPE_DPI, 199 .id = 0,
184 .driver_name = "generic_dpi_panel", 200 .dev.platform_data = &overo_lcd43_pdata,
185 .data = &lcd43_panel,
186 .phy.dpi.data_lines = 24,
187}; 201};
188 202
189#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ 203static struct connector_dvi_platform_data overo_dvi_connector_pdata = {
190 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) 204 .name = "dvi",
191static struct panel_generic_dpi_data lcd35_panel = { 205 .source = "tfp410.0",
192 .num_gpios = 2, 206 .i2c_bus_num = 3,
193 .gpios = {
194 OVERO_GPIO_LCD_EN,
195 OVERO_GPIO_LCD_BL
196 },
197}; 207};
198 208
199static struct omap_dss_device overo_lcd35_device = { 209static struct platform_device overo_dvi_connector_device = {
200 .type = OMAP_DISPLAY_TYPE_DPI, 210 .name = "connector-dvi",
201 .name = "lcd35", 211 .id = 0,
202 .driver_name = "lgphilips_lb035q02_panel", 212 .dev.platform_data = &overo_dvi_connector_pdata,
203 .phy.dpi.data_lines = 24,
204 .data = &lcd35_panel,
205}; 213};
206#endif
207 214
208static struct omap_dss_device *overo_dss_devices[] = { 215static struct encoder_tfp410_platform_data overo_tfp410_pdata = {
209 &overo_dvi_device, 216 .name = "tfp410.0",
210 &overo_tv_device, 217 .source = "dpi.0",
211#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \ 218 .data_lines = 24,
212 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE) 219 .power_down_gpio = -1,
213 &overo_lcd35_device, 220};
214#endif 221
215 &overo_lcd43_device, 222static struct platform_device overo_tfp410_device = {
223 .name = "tfp410",
224 .id = 0,
225 .dev.platform_data = &overo_tfp410_pdata,
216}; 226};
217 227
218static struct omap_dss_board_info overo_dss_data = { 228static struct omap_dss_board_info overo_dss_data = {
219 .num_devices = ARRAY_SIZE(overo_dss_devices), 229 .default_display_name = "lcd43",
220 .devices = overo_dss_devices,
221 .default_device = &overo_dvi_device,
222}; 230};
223 231
232static void __init overo_display_init(void)
233{
234 omap_display_init(&overo_dss_data);
235
236 if (!overo_use_lcd35)
237 platform_device_register(&overo_lcd43_device);
238 platform_device_register(&overo_tfp410_device);
239 platform_device_register(&overo_dvi_connector_device);
240 platform_device_register(&overo_tv_connector_device);
241}
242
224static struct mtd_partition overo_nand_partitions[] = { 243static struct mtd_partition overo_nand_partitions[] = {
225 { 244 {
226 .name = "xloader", 245 .name = "xloader",
@@ -408,24 +427,41 @@ static int __init overo_i2c_init(void)
408 return 0; 427 return 0;
409} 428}
410 429
430static struct panel_lb035q02_platform_data overo_lcd35_pdata = {
431 .name = "lcd35",
432 .source = "dpi.0",
433
434 .data_lines = 24,
435
436 .enable_gpio = OVERO_GPIO_LCD_EN,
437 .backlight_gpio = OVERO_GPIO_LCD_BL,
438};
439
440/*
441 * NOTE: We need to add either the lgphilips panel, or the lcd43 panel. The
442 * selection is done based on the overo_use_lcd35 field. If new SPI
443 * devices are added here, extra work is needed to make only the lgphilips panel
444 * affected by the overo_use_lcd35 field.
445 */
411static struct spi_board_info overo_spi_board_info[] __initdata = { 446static struct spi_board_info overo_spi_board_info[] __initdata = {
412#if defined(CONFIG_PANEL_LGPHILIPS_LB035Q02) || \
413 defined(CONFIG_PANEL_LGPHILIPS_LB035Q02_MODULE)
414 { 447 {
415 .modalias = "lgphilips_lb035q02_panel-spi", 448 .modalias = "panel_lgphilips_lb035q02",
416 .bus_num = 1, 449 .bus_num = 1,
417 .chip_select = 1, 450 .chip_select = 1,
418 .max_speed_hz = 500000, 451 .max_speed_hz = 500000,
419 .mode = SPI_MODE_3, 452 .mode = SPI_MODE_3,
453 .platform_data = &overo_lcd35_pdata,
420 }, 454 },
421#endif
422}; 455};
423 456
424static int __init overo_spi_init(void) 457static int __init overo_spi_init(void)
425{ 458{
426 overo_ads7846_init(); 459 overo_ads7846_init();
427 spi_register_board_info(overo_spi_board_info, 460
428 ARRAY_SIZE(overo_spi_board_info)); 461 if (overo_use_lcd35) {
462 spi_register_board_info(overo_spi_board_info,
463 ARRAY_SIZE(overo_spi_board_info));
464 }
429 return 0; 465 return 0;
430} 466}
431 467
@@ -463,11 +499,13 @@ static void __init overo_init(void)
463{ 499{
464 int ret; 500 int ret;
465 501
502 if (strstr(boot_command_line, "omapdss.def_disp=lcd35"))
503 overo_use_lcd35 = true;
504
466 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 505 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
467 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 506 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
468 overo_i2c_init(); 507 overo_i2c_init();
469 omap_hsmmc_init(mmc); 508 omap_hsmmc_init(mmc);
470 omap_display_init(&overo_dss_data);
471 omap_serial_init(); 509 omap_serial_init();
472 omap_sdrc_init(mt46h32m32lf6_sdrc_params, 510 omap_sdrc_init(mt46h32m32lf6_sdrc_params,
473 mt46h32m32lf6_sdrc_params); 511 mt46h32m32lf6_sdrc_params);
@@ -484,6 +522,8 @@ static void __init overo_init(void)
484 overo_init_keys(); 522 overo_init_keys();
485 omap_twl4030_audio_init("overo", NULL); 523 omap_twl4030_audio_init("overo", NULL);
486 524
525 overo_display_init();
526
487 /* Ensure SDRC pins are mux'd for self-refresh */ 527 /* Ensure SDRC pins are mux'd for self-refresh */
488 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 528 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
489 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 529 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index 9c2dd102fbbb..c3270c0f1fce 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -45,6 +45,8 @@
45#include <linux/platform_data/tsl2563.h> 45#include <linux/platform_data/tsl2563.h>
46#include <linux/lis3lv02d.h> 46#include <linux/lis3lv02d.h>
47 47
48#include <video/omap-panel-data.h>
49
48#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE) 50#if defined(CONFIG_IR_RX51) || defined(CONFIG_IR_RX51_MODULE)
49#include <media/ir-rx51.h> 51#include <media/ir-rx51.h>
50#endif 52#endif
@@ -226,6 +228,15 @@ static struct lp55xx_platform_data rx51_lp5523_platform_data = {
226}; 228};
227#endif 229#endif
228 230
231#define RX51_LCD_RESET_GPIO 90
232
233static struct panel_acx565akm_platform_data acx_pdata = {
234 .name = "lcd",
235 .source = "sdi.0",
236 .reset_gpio = RX51_LCD_RESET_GPIO,
237 .datapairs = 2,
238};
239
229static struct omap2_mcspi_device_config wl1251_mcspi_config = { 240static struct omap2_mcspi_device_config wl1251_mcspi_config = {
230 .turbo_mode = 0, 241 .turbo_mode = 0,
231}; 242};
@@ -254,6 +265,7 @@ static struct spi_board_info rx51_peripherals_spi_board_info[] __initdata = {
254 .chip_select = 2, 265 .chip_select = 2,
255 .max_speed_hz = 6000000, 266 .max_speed_hz = 6000000,
256 .controller_data = &mipid_mcspi_config, 267 .controller_data = &mipid_mcspi_config,
268 .platform_data = &acx_pdata,
257 }, 269 },
258 [RX51_SPI_TSC2005] = { 270 [RX51_SPI_TSC2005] = {
259 .modalias = "tsc2005", 271 .modalias = "tsc2005",
diff --git a/arch/arm/mach-omap2/board-rx51-video.c b/arch/arm/mach-omap2/board-rx51-video.c
index bdd1e3a179e1..43a90c8d6837 100644
--- a/arch/arm/mach-omap2/board-rx51-video.c
+++ b/arch/arm/mach-omap2/board-rx51-video.c
@@ -29,34 +29,21 @@
29 29
30#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE) 30#if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
31 31
32static struct panel_acx565akm_data lcd_data = { 32static struct connector_atv_platform_data rx51_tv_pdata = {
33 .reset_gpio = RX51_LCD_RESET_GPIO, 33 .name = "tv",
34 .source = "venc.0",
35 .connector_type = OMAP_DSS_VENC_TYPE_COMPOSITE,
36 .invert_polarity = false,
34}; 37};
35 38
36static struct omap_dss_device rx51_lcd_device = { 39static struct platform_device rx51_tv_connector_device = {
37 .name = "lcd", 40 .name = "connector-analog-tv",
38 .driver_name = "panel-acx565akm", 41 .id = 0,
39 .type = OMAP_DISPLAY_TYPE_SDI, 42 .dev.platform_data = &rx51_tv_pdata,
40 .phy.sdi.datapairs = 2,
41 .data = &lcd_data,
42};
43
44static struct omap_dss_device rx51_tv_device = {
45 .name = "tv",
46 .type = OMAP_DISPLAY_TYPE_VENC,
47 .driver_name = "venc",
48 .phy.venc.type = OMAP_DSS_VENC_TYPE_COMPOSITE,
49};
50
51static struct omap_dss_device *rx51_dss_devices[] = {
52 &rx51_lcd_device,
53 &rx51_tv_device,
54}; 43};
55 44
56static struct omap_dss_board_info rx51_dss_board_info = { 45static struct omap_dss_board_info rx51_dss_board_info = {
57 .num_devices = ARRAY_SIZE(rx51_dss_devices), 46 .default_display_name = "lcd",
58 .devices = rx51_dss_devices,
59 .default_device = &rx51_lcd_device,
60}; 47};
61 48
62static int __init rx51_video_init(void) 49static int __init rx51_video_init(void)
@@ -71,6 +58,8 @@ static int __init rx51_video_init(void)
71 58
72 omap_display_init(&rx51_dss_board_info); 59 omap_display_init(&rx51_dss_board_info);
73 60
61 platform_device_register(&rx51_tv_connector_device);
62
74 return 0; 63 return 0;
75} 64}
76 65
diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c
index d2ea68ea678a..7735105561d8 100644
--- a/arch/arm/mach-omap2/board-rx51.c
+++ b/arch/arm/mach-omap2/board-rx51.c
@@ -85,7 +85,7 @@ static struct omap_board_mux board_mux[] __initdata = {
85 85
86static struct omap_musb_board_data musb_board_data = { 86static struct omap_musb_board_data musb_board_data = {
87 .interface_type = MUSB_INTERFACE_ULPI, 87 .interface_type = MUSB_INTERFACE_ULPI,
88 .mode = MUSB_PERIPHERAL, 88 .mode = MUSB_OTG,
89 .power = 0, 89 .power = 0,
90}; 90};
91 91
diff --git a/arch/arm/mach-omap2/board-zoom-display.c b/arch/arm/mach-omap2/board-zoom-display.c
index c2a079cb76fc..3d8ecc1e05bd 100644
--- a/arch/arm/mach-omap2/board-zoom-display.c
+++ b/arch/arm/mach-omap2/board-zoom-display.c
@@ -25,32 +25,23 @@
25#define LCD_PANEL_RESET_GPIO_PILOT 55 25#define LCD_PANEL_RESET_GPIO_PILOT 55
26#define LCD_PANEL_QVGA_GPIO 56 26#define LCD_PANEL_QVGA_GPIO 56
27 27
28static struct panel_nec_nl8048_data zoom_lcd_data = { 28static struct panel_nec_nl8048hl11_platform_data zoom_lcd_pdata = {
29 /* res_gpio filled in code */ 29 .name = "lcd",
30 .qvga_gpio = LCD_PANEL_QVGA_GPIO, 30 .source = "dpi.0",
31};
32 31
33static struct omap_dss_device zoom_lcd_device = { 32 .data_lines = 24,
34 .name = "lcd",
35 .driver_name = "NEC_8048_panel",
36 .type = OMAP_DISPLAY_TYPE_DPI,
37 .phy.dpi.data_lines = 24,
38 .data = &zoom_lcd_data,
39};
40 33
41static struct omap_dss_device *zoom_dss_devices[] = { 34 .res_gpio = -1, /* filled in code */
42 &zoom_lcd_device, 35 .qvga_gpio = LCD_PANEL_QVGA_GPIO,
43}; 36};
44 37
45static struct omap_dss_board_info zoom_dss_data = { 38static struct omap_dss_board_info zoom_dss_data = {
46 .num_devices = ARRAY_SIZE(zoom_dss_devices), 39 .default_display_name = "lcd",
47 .devices = zoom_dss_devices,
48 .default_device = &zoom_lcd_device,
49}; 40};
50 41
51static void __init zoom_lcd_panel_init(void) 42static void __init zoom_lcd_panel_init(void)
52{ 43{
53 zoom_lcd_data.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ? 44 zoom_lcd_pdata.res_gpio = (omap_rev() > OMAP3430_REV_ES3_0) ?
54 LCD_PANEL_RESET_GPIO_PROD : 45 LCD_PANEL_RESET_GPIO_PROD :
55 LCD_PANEL_RESET_GPIO_PILOT; 46 LCD_PANEL_RESET_GPIO_PILOT;
56} 47}
@@ -61,19 +52,20 @@ static struct omap2_mcspi_device_config dss_lcd_mcspi_config = {
61 52
62static struct spi_board_info nec_8048_spi_board_info[] __initdata = { 53static struct spi_board_info nec_8048_spi_board_info[] __initdata = {
63 [0] = { 54 [0] = {
64 .modalias = "nec_8048_spi", 55 .modalias = "panel-nec-nl8048hl11",
65 .bus_num = 1, 56 .bus_num = 1,
66 .chip_select = 2, 57 .chip_select = 2,
67 .max_speed_hz = 375000, 58 .max_speed_hz = 375000,
68 .controller_data = &dss_lcd_mcspi_config, 59 .controller_data = &dss_lcd_mcspi_config,
60 .platform_data = &zoom_lcd_pdata,
69 }, 61 },
70}; 62};
71 63
72void __init zoom_display_init(void) 64void __init zoom_display_init(void)
73{ 65{
74 omap_display_init(&zoom_dss_data); 66 omap_display_init(&zoom_dss_data);
67 zoom_lcd_panel_init();
75 spi_register_board_info(nec_8048_spi_board_info, 68 spi_register_board_info(nec_8048_spi_board_info,
76 ARRAY_SIZE(nec_8048_spi_board_info)); 69 ARRAY_SIZE(nec_8048_spi_board_info));
77 zoom_lcd_panel_init();
78} 70}
79 71
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index ff37be1f6f93..03a0516c7f67 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -400,7 +400,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
400 400
401 /* Create devices for DPI and SDI */ 401 /* Create devices for DPI and SDI */
402 402
403 pdev = create_simple_dss_pdev("omapdss_dpi", -1, 403 pdev = create_simple_dss_pdev("omapdss_dpi", 0,
404 board_data, sizeof(*board_data), dss_pdev); 404 board_data, sizeof(*board_data), dss_pdev);
405 if (IS_ERR(pdev)) { 405 if (IS_ERR(pdev)) {
406 pr_err("Could not build platform_device for omapdss_dpi\n"); 406 pr_err("Could not build platform_device for omapdss_dpi\n");
@@ -408,7 +408,7 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
408 } 408 }
409 409
410 if (cpu_is_omap34xx()) { 410 if (cpu_is_omap34xx()) {
411 pdev = create_simple_dss_pdev("omapdss_sdi", -1, 411 pdev = create_simple_dss_pdev("omapdss_sdi", 0,
412 board_data, sizeof(*board_data), dss_pdev); 412 board_data, sizeof(*board_data), dss_pdev);
413 if (IS_ERR(pdev)) { 413 if (IS_ERR(pdev)) {
414 pr_err("Could not build platform_device for omapdss_sdi\n"); 414 pr_err("Could not build platform_device for omapdss_sdi\n");
diff --git a/arch/arm/mach-omap2/dss-common.c b/arch/arm/mach-omap2/dss-common.c
index 043e5705f2a6..bf89effa4c99 100644
--- a/arch/arm/mach-omap2/dss-common.c
+++ b/arch/arm/mach-omap2/dss-common.c
@@ -25,6 +25,7 @@
25 25
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/platform_device.h>
28 29
29#include <video/omapdss.h> 30#include <video/omapdss.h>
30#include <video/omap-panel-data.h> 31#include <video/omap-panel-data.h>
@@ -37,70 +38,76 @@
37#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */ 38#define HDMI_GPIO_LS_OE 41 /* Level shifter for HDMI */
38#define HDMI_GPIO_HPD 63 /* Hotplug detect */ 39#define HDMI_GPIO_HPD 63 /* Hotplug detect */
39 40
40/* Display DVI */
41#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0 41#define PANDA_DVI_TFP410_POWER_DOWN_GPIO 0
42 42
43/* Using generic display panel */ 43/* DVI Connector */
44static struct tfp410_platform_data omap4_dvi_panel = { 44static struct connector_dvi_platform_data omap4_panda_dvi_connector_pdata = {
45 .i2c_bus_num = 2, 45 .name = "dvi",
46 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO, 46 .source = "tfp410.0",
47 .i2c_bus_num = 2,
47}; 48};
48 49
49static struct omap_dss_device omap4_panda_dvi_device = { 50static struct platform_device omap4_panda_dvi_connector_device = {
50 .type = OMAP_DISPLAY_TYPE_DPI, 51 .name = "connector-dvi",
51 .name = "dvi", 52 .id = 0,
52 .driver_name = "tfp410", 53 .dev.platform_data = &omap4_panda_dvi_connector_pdata,
53 .data = &omap4_dvi_panel,
54 .phy.dpi.data_lines = 24,
55 .channel = OMAP_DSS_CHANNEL_LCD2,
56}; 54};
57 55
58static struct omap_dss_hdmi_data omap4_panda_hdmi_data = { 56/* TFP410 DPI-to-DVI chip */
57static struct encoder_tfp410_platform_data omap4_panda_tfp410_pdata = {
58 .name = "tfp410.0",
59 .source = "dpi.0",
60 .data_lines = 24,
61 .power_down_gpio = PANDA_DVI_TFP410_POWER_DOWN_GPIO,
62};
63
64static struct platform_device omap4_panda_tfp410_device = {
65 .name = "tfp410",
66 .id = 0,
67 .dev.platform_data = &omap4_panda_tfp410_pdata,
68};
69
70/* HDMI Connector */
71static struct connector_hdmi_platform_data omap4_panda_hdmi_connector_pdata = {
72 .name = "hdmi",
73 .source = "tpd12s015.0",
74};
75
76static struct platform_device omap4_panda_hdmi_connector_device = {
77 .name = "connector-hdmi",
78 .id = 0,
79 .dev.platform_data = &omap4_panda_hdmi_connector_pdata,
80};
81
82/* TPD12S015 HDMI ESD protection & level shifter chip */
83static struct encoder_tpd12s015_platform_data omap4_panda_tpd_pdata = {
84 .name = "tpd12s015.0",
85 .source = "hdmi.0",
86
59 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD, 87 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
60 .ls_oe_gpio = HDMI_GPIO_LS_OE, 88 .ls_oe_gpio = HDMI_GPIO_LS_OE,
61 .hpd_gpio = HDMI_GPIO_HPD, 89 .hpd_gpio = HDMI_GPIO_HPD,
62}; 90};
63 91
64static struct omap_dss_device omap4_panda_hdmi_device = { 92static struct platform_device omap4_panda_tpd_device = {
65 .name = "hdmi", 93 .name = "tpd12s015",
66 .driver_name = "hdmi_panel", 94 .id = 0,
67 .type = OMAP_DISPLAY_TYPE_HDMI, 95 .dev.platform_data = &omap4_panda_tpd_pdata,
68 .channel = OMAP_DSS_CHANNEL_DIGIT,
69 .data = &omap4_panda_hdmi_data,
70};
71
72static struct omap_dss_device *omap4_panda_dss_devices[] = {
73 &omap4_panda_dvi_device,
74 &omap4_panda_hdmi_device,
75}; 96};
76 97
77static struct omap_dss_board_info omap4_panda_dss_data = { 98static struct omap_dss_board_info omap4_panda_dss_data = {
78 .num_devices = ARRAY_SIZE(omap4_panda_dss_devices), 99 .default_display_name = "dvi",
79 .devices = omap4_panda_dss_devices,
80 .default_device = &omap4_panda_dvi_device,
81}; 100};
82 101
83void __init omap4_panda_display_init(void) 102void __init omap4_panda_display_init_of(void)
84{ 103{
85 omap_display_init(&omap4_panda_dss_data); 104 omap_display_init(&omap4_panda_dss_data);
86 105
87 /* 106 platform_device_register(&omap4_panda_tfp410_device);
88 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and 107 platform_device_register(&omap4_panda_dvi_connector_device);
89 * later have external pull up on the HDMI I2C lines
90 */
91 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
92 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
93 else
94 omap_hdmi_init(0);
95
96 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
97 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
98 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
99}
100 108
101void __init omap4_panda_display_init_of(void) 109 platform_device_register(&omap4_panda_tpd_device);
102{ 110 platform_device_register(&omap4_panda_hdmi_connector_device);
103 omap_display_init(&omap4_panda_dss_data);
104} 111}
105 112
106 113
@@ -109,93 +116,73 @@ void __init omap4_panda_display_init_of(void)
109#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */ 116#define DISPLAY_SEL_GPIO 59 /* LCD2/PicoDLP switch */
110#define DLP_POWER_ON_GPIO 40 117#define DLP_POWER_ON_GPIO 40
111 118
112static struct nokia_dsi_panel_data dsi1_panel = { 119static struct panel_dsicm_platform_data dsi1_panel = {
113 .name = "taal", 120 .name = "lcd",
114 .reset_gpio = 102, 121 .source = "dsi.0",
115 .use_ext_te = false, 122 .reset_gpio = 102,
116 .ext_te_gpio = 101, 123 .use_ext_te = false,
117 .esd_interval = 0, 124 .ext_te_gpio = 101,
118 .pin_config = { 125 .pin_config = {
119 .num_pins = 6, 126 .num_pins = 6,
120 .pins = { 0, 1, 2, 3, 4, 5 }, 127 .pins = { 0, 1, 2, 3, 4, 5 },
121 },
122};
123
124static struct omap_dss_device sdp4430_lcd_device = {
125 .name = "lcd",
126 .driver_name = "taal",
127 .type = OMAP_DISPLAY_TYPE_DSI,
128 .data = &dsi1_panel,
129 .phy.dsi = {
130 .module = 0,
131 }, 128 },
132 .channel = OMAP_DSS_CHANNEL_LCD,
133}; 129};
134 130
135static struct nokia_dsi_panel_data dsi2_panel = { 131static struct platform_device sdp4430_lcd_device = {
136 .name = "taal", 132 .name = "panel-dsi-cm",
137 .reset_gpio = 104, 133 .id = 0,
138 .use_ext_te = false, 134 .dev.platform_data = &dsi1_panel,
139 .ext_te_gpio = 103,
140 .esd_interval = 0,
141 .pin_config = {
142 .num_pins = 6,
143 .pins = { 0, 1, 2, 3, 4, 5 },
144 },
145}; 135};
146 136
147static struct omap_dss_device sdp4430_lcd2_device = { 137static struct panel_dsicm_platform_data dsi2_panel = {
148 .name = "lcd2", 138 .name = "lcd2",
149 .driver_name = "taal", 139 .source = "dsi.1",
150 .type = OMAP_DISPLAY_TYPE_DSI, 140 .reset_gpio = 104,
151 .data = &dsi2_panel, 141 .use_ext_te = false,
152 .phy.dsi = { 142 .ext_te_gpio = 103,
153 143 .pin_config = {
154 .module = 1, 144 .num_pins = 6,
145 .pins = { 0, 1, 2, 3, 4, 5 },
155 }, 146 },
156 .channel = OMAP_DSS_CHANNEL_LCD2,
157}; 147};
158 148
159static struct omap_dss_hdmi_data sdp4430_hdmi_data = { 149static struct platform_device sdp4430_lcd2_device = {
160 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD, 150 .name = "panel-dsi-cm",
161 .ls_oe_gpio = HDMI_GPIO_LS_OE, 151 .id = 1,
162 .hpd_gpio = HDMI_GPIO_HPD, 152 .dev.platform_data = &dsi2_panel,
163}; 153};
164 154
165static struct omap_dss_device sdp4430_hdmi_device = { 155/* HDMI Connector */
166 .name = "hdmi", 156static struct connector_hdmi_platform_data sdp4430_hdmi_connector_pdata = {
167 .driver_name = "hdmi_panel", 157 .name = "hdmi",
168 .type = OMAP_DISPLAY_TYPE_HDMI, 158 .source = "tpd12s015.0",
169 .channel = OMAP_DSS_CHANNEL_DIGIT,
170 .data = &sdp4430_hdmi_data,
171}; 159};
172 160
173static struct picodlp_panel_data sdp4430_picodlp_pdata = { 161static struct platform_device sdp4430_hdmi_connector_device = {
174 .picodlp_adapter_id = 2, 162 .name = "connector-hdmi",
175 .emu_done_gpio = 44, 163 .id = 0,
176 .pwrgood_gpio = 45, 164 .dev.platform_data = &sdp4430_hdmi_connector_pdata,
177}; 165};
178 166
179static struct omap_dss_device sdp4430_picodlp_device = { 167/* TPD12S015 HDMI ESD protection & level shifter chip */
180 .name = "picodlp", 168static struct encoder_tpd12s015_platform_data sdp4430_tpd_pdata = {
181 .driver_name = "picodlp_panel", 169 .name = "tpd12s015.0",
182 .type = OMAP_DISPLAY_TYPE_DPI, 170 .source = "hdmi.0",
183 .phy.dpi.data_lines = 24, 171
184 .channel = OMAP_DSS_CHANNEL_LCD2, 172 .ct_cp_hpd_gpio = HDMI_GPIO_CT_CP_HPD,
185 .data = &sdp4430_picodlp_pdata, 173 .ls_oe_gpio = HDMI_GPIO_LS_OE,
174 .hpd_gpio = HDMI_GPIO_HPD,
186}; 175};
187 176
188static struct omap_dss_device *sdp4430_dss_devices[] = { 177static struct platform_device sdp4430_tpd_device = {
189 &sdp4430_lcd_device, 178 .name = "tpd12s015",
190 &sdp4430_lcd2_device, 179 .id = 0,
191 &sdp4430_hdmi_device, 180 .dev.platform_data = &sdp4430_tpd_pdata,
192 &sdp4430_picodlp_device,
193}; 181};
194 182
183
195static struct omap_dss_board_info sdp4430_dss_data = { 184static struct omap_dss_board_info sdp4430_dss_data = {
196 .num_devices = ARRAY_SIZE(sdp4430_dss_devices), 185 .default_display_name = "lcd",
197 .devices = sdp4430_dss_devices,
198 .default_device = &sdp4430_lcd_device,
199}; 186};
200 187
201/* 188/*
@@ -204,7 +191,7 @@ static struct omap_dss_board_info sdp4430_dss_data = {
204 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is 191 * used by picodlp on the 4430sdp platform. Keep this gpio disabled as LCD2 is
205 * selected by default 192 * selected by default
206 */ 193 */
207void __init omap_4430sdp_display_init(void) 194void __init omap_4430sdp_display_init_of(void)
208{ 195{
209 int r; 196 int r;
210 197
@@ -219,33 +206,10 @@ void __init omap_4430sdp_display_init(void)
219 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__); 206 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
220 207
221 omap_display_init(&sdp4430_dss_data); 208 omap_display_init(&sdp4430_dss_data);
222 /*
223 * OMAP4460SDP/Blaze and OMAP4430 ES2.3 SDP/Blaze boards and
224 * later have external pull up on the HDMI I2C lines
225 */
226 if (cpu_is_omap446x() || omap_rev() > OMAP4430_REV_ES2_2)
227 omap_hdmi_init(OMAP_HDMI_SDA_SCL_EXTERNAL_PULLUP);
228 else
229 omap_hdmi_init(0);
230
231 omap_mux_init_gpio(HDMI_GPIO_LS_OE, OMAP_PIN_OUTPUT);
232 omap_mux_init_gpio(HDMI_GPIO_CT_CP_HPD, OMAP_PIN_OUTPUT);
233 omap_mux_init_gpio(HDMI_GPIO_HPD, OMAP_PIN_INPUT_PULLDOWN);
234}
235
236void __init omap_4430sdp_display_init_of(void)
237{
238 int r;
239 209
240 r = gpio_request_one(DISPLAY_SEL_GPIO, GPIOF_OUT_INIT_HIGH, 210 platform_device_register(&sdp4430_lcd_device);
241 "display_sel"); 211 platform_device_register(&sdp4430_lcd2_device);
242 if (r)
243 pr_err("%s: Could not get display_sel GPIO\n", __func__);
244
245 r = gpio_request_one(DLP_POWER_ON_GPIO, GPIOF_OUT_INIT_LOW,
246 "DLP POWER ON");
247 if (r)
248 pr_err("%s: Could not get DLP POWER ON GPIO\n", __func__);
249 212
250 omap_display_init(&sdp4430_dss_data); 213 platform_device_register(&sdp4430_tpd_device);
214 platform_device_register(&sdp4430_hdmi_connector_device);
251} 215}
diff --git a/arch/arm/mach-omap2/dss-common.h b/arch/arm/mach-omap2/dss-common.h
index 915f6fff5106..c28fe3c03588 100644
--- a/arch/arm/mach-omap2/dss-common.h
+++ b/arch/arm/mach-omap2/dss-common.h
@@ -6,9 +6,7 @@
6 * This file will be removed when DSS supports DT. 6 * This file will be removed when DSS supports DT.
7 */ 7 */
8 8
9void __init omap4_panda_display_init(void);
10void __init omap4_panda_display_init_of(void); 9void __init omap4_panda_display_init_of(void);
11void __init omap_4430sdp_display_init(void);
12void __init omap_4430sdp_display_init_of(void); 10void __init omap_4430sdp_display_init_of(void);
13 11
14#endif 12#endif
diff --git a/arch/arm/mach-omap2/i2c.c b/arch/arm/mach-omap2/i2c.c
index d940e53dd9f2..b456b4471f35 100644
--- a/arch/arm/mach-omap2/i2c.c
+++ b/arch/arm/mach-omap2/i2c.c
@@ -181,7 +181,7 @@ int __init omap_i2c_add_bus(struct omap_i2c_bus_platform_data *i2c_pdata,
181 sizeof(struct omap_i2c_bus_platform_data)); 181 sizeof(struct omap_i2c_bus_platform_data));
182 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name); 182 WARN(IS_ERR(pdev), "Could not build omap_device for %s\n", name);
183 183
184 return PTR_RET(pdev); 184 return PTR_ERR_OR_ZERO(pdev);
185} 185}
186 186
187static int __init omap_i2c_cmdline(void) 187static int __init omap_i2c_cmdline(void)
diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 2eb19d4d0aa1..e83a6a4b184a 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -28,7 +28,7 @@
28#include <linux/io.h> 28#include <linux/io.h>
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/usb/phy.h> 30#include <linux/usb/phy.h>
31#include <linux/usb/nop-usb-xceiv.h> 31#include <linux/usb/usb_phy_gen_xceiv.h>
32 32
33#include "soc.h" 33#include "soc.h"
34#include "omap_device.h" 34#include "omap_device.h"
@@ -349,7 +349,7 @@ static struct fixed_voltage_config hsusb_reg_config = {
349 /* .init_data filled later */ 349 /* .init_data filled later */
350}; 350};
351 351
352static const char *nop_name = "nop_usb_xceiv"; /* NOP PHY driver */ 352static const char *nop_name = "usb_phy_gen_xceiv"; /* NOP PHY driver */
353static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */ 353static const char *reg_name = "reg-fixed-voltage"; /* Regulator driver */
354 354
355/** 355/**
@@ -460,9 +460,9 @@ int usbhs_init_phys(struct usbhs_phy_data *phy, int num_phys)
460 pdevinfo.name = nop_name; 460 pdevinfo.name = nop_name;
461 pdevinfo.id = phy->port; 461 pdevinfo.id = phy->port;
462 pdevinfo.data = phy->platform_data; 462 pdevinfo.data = phy->platform_data;
463 pdevinfo.size_data = sizeof(struct nop_usb_xceiv_platform_data); 463 pdevinfo.size_data =
464 464 sizeof(struct usb_phy_gen_xceiv_platform_data);
465 scnprintf(phy_id, MAX_STR, "nop_usb_xceiv.%d", 465 scnprintf(phy_id, MAX_STR, "usb_phy_gen_xceiv.%d",
466 phy->port); 466 phy->port);
467 pdev = platform_device_register_full(&pdevinfo); 467 pdev = platform_device_register_full(&pdevinfo);
468 if (IS_ERR(pdev)) { 468 if (IS_ERR(pdev)) {
diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c
index 8c4de2708cf2..bc897231bd10 100644
--- a/arch/arm/mach-omap2/usb-musb.c
+++ b/arch/arm/mach-omap2/usb-musb.c
@@ -38,11 +38,8 @@ static struct musb_hdrc_config musb_config = {
38}; 38};
39 39
40static struct musb_hdrc_platform_data musb_plat = { 40static struct musb_hdrc_platform_data musb_plat = {
41#ifdef CONFIG_USB_GADGET_MUSB_HDRC
42 .mode = MUSB_OTG, 41 .mode = MUSB_OTG,
43#else 42
44 .mode = MUSB_HOST,
45#endif
46 /* .clock is set dynamically */ 43 /* .clock is set dynamically */
47 .config = &musb_config, 44 .config = &musb_config,
48 45
diff --git a/arch/arm/mach-orion5x/include/mach/debug-macro.S b/arch/arm/mach-orion5x/include/mach/debug-macro.S
deleted file mode 100644
index f340ed8f8dd0..000000000000
--- a/arch/arm/mach-orion5x/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-orion5x/include/mach/debug-macro.S
3 *
4 * Debugging macro include header
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
11#include <mach/orion5x.h>
12
13 .macro addruart, rp, rv, tmp
14 ldr \rp, =ORION5X_REGS_PHYS_BASE
15 ldr \rv, =ORION5X_REGS_VIRT_BASE
16 orr \rp, \rp, #0x00012000
17 orr \rv, \rv, #0x00012000
18 .endm
19
20#define UART_SHIFT 2
21#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-prima2/common.c b/arch/arm/mach-prima2/common.c
index 2c70f74fed5d..e110b6d4ae8c 100644
--- a/arch/arm/mach-prima2/common.c
+++ b/arch/arm/mach-prima2/common.c
@@ -42,7 +42,6 @@ static const char *atlas6_dt_match[] __initdata = {
42 42
43DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)") 43DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
44 /* Maintainer: Barry Song <baohua.song@csr.com> */ 44 /* Maintainer: Barry Song <baohua.song@csr.com> */
45 .nr_irqs = 128,
46 .map_io = sirfsoc_map_io, 45 .map_io = sirfsoc_map_io,
47 .init_time = sirfsoc_init_time, 46 .init_time = sirfsoc_init_time,
48 .init_late = sirfsoc_init_late, 47 .init_late = sirfsoc_init_late,
@@ -59,7 +58,6 @@ static const char *prima2_dt_match[] __initdata = {
59 58
60DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)") 59DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
61 /* Maintainer: Barry Song <baohua.song@csr.com> */ 60 /* Maintainer: Barry Song <baohua.song@csr.com> */
62 .nr_irqs = 128,
63 .map_io = sirfsoc_map_io, 61 .map_io = sirfsoc_map_io,
64 .init_time = sirfsoc_init_time, 62 .init_time = sirfsoc_init_time,
65 .dma_zone_size = SZ_256M, 63 .dma_zone_size = SZ_256M,
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c
index fe31bfcbb8df..c98511c5abd1 100644
--- a/arch/arm/mach-pxa/icontrol.c
+++ b/arch/arm/mach-pxa/icontrol.c
@@ -73,9 +73,6 @@ static struct pxa2xx_spi_chip mcp251x_chip_info4 = {
73 73
74static struct mcp251x_platform_data mcp251x_info = { 74static struct mcp251x_platform_data mcp251x_info = {
75 .oscillator_frequency = 16E6, 75 .oscillator_frequency = 16E6,
76 .board_specific_setup = NULL,
77 .power_enable = NULL,
78 .transceiver_enable = NULL
79}; 76};
80 77
81static struct spi_board_info mcp251x_board_info[] = { 78static struct spi_board_info mcp251x_board_info[] = {
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index f5d436434566..04a0aea23873 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -29,6 +29,8 @@
29#include <linux/i2c/pca953x.h> 29#include <linux/i2c/pca953x.h>
30#include <linux/apm-emulation.h> 30#include <linux/apm-emulation.h>
31#include <linux/can/platform/mcp251x.h> 31#include <linux/can/platform/mcp251x.h>
32#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h>
32 34
33#include <asm/mach-types.h> 35#include <asm/mach-types.h>
34#include <asm/suspend.h> 36#include <asm/suspend.h>
@@ -391,33 +393,34 @@ static struct pxa2xx_spi_master pxa2xx_spi_ssp3_master_info = {
391}; 393};
392 394
393/* CAN bus on SPI */ 395/* CAN bus on SPI */
394static int zeus_mcp2515_setup(struct spi_device *sdev) 396static struct regulator_consumer_supply can_regulator_consumer =
395{ 397 REGULATOR_SUPPLY("vdd", "spi3.0");
396 int err;
397
398 err = gpio_request(ZEUS_CAN_SHDN_GPIO, "CAN shutdown");
399 if (err)
400 return err;
401 398
402 err = gpio_direction_output(ZEUS_CAN_SHDN_GPIO, 1); 399static struct regulator_init_data can_regulator_init_data = {
403 if (err) { 400 .constraints = {
404 gpio_free(ZEUS_CAN_SHDN_GPIO); 401 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
405 return err; 402 },
406 } 403 .consumer_supplies = &can_regulator_consumer,
404 .num_consumer_supplies = 1,
405};
407 406
408 return 0; 407static struct fixed_voltage_config can_regulator_pdata = {
409} 408 .supply_name = "CAN_SHDN",
409 .microvolts = 3300000,
410 .gpio = ZEUS_CAN_SHDN_GPIO,
411 .init_data = &can_regulator_init_data,
412};
410 413
411static int zeus_mcp2515_transceiver_enable(int enable) 414static struct platform_device can_regulator_device = {
412{ 415 .name = "reg-fixed-volage",
413 gpio_set_value(ZEUS_CAN_SHDN_GPIO, !enable); 416 .id = -1,
414 return 0; 417 .dev = {
415} 418 .platform_data = &can_regulator_pdata,
419 },
420};
416 421
417static struct mcp251x_platform_data zeus_mcp2515_pdata = { 422static struct mcp251x_platform_data zeus_mcp2515_pdata = {
418 .oscillator_frequency = 16*1000*1000, 423 .oscillator_frequency = 16*1000*1000,
419 .board_specific_setup = zeus_mcp2515_setup,
420 .power_enable = zeus_mcp2515_transceiver_enable,
421}; 424};
422 425
423static struct spi_board_info zeus_spi_board_info[] = { 426static struct spi_board_info zeus_spi_board_info[] = {
@@ -516,6 +519,7 @@ static struct platform_device *zeus_devices[] __initdata = {
516 &zeus_leds_device, 519 &zeus_leds_device,
517 &zeus_pcmcia_device, 520 &zeus_pcmcia_device,
518 &zeus_max6369_device, 521 &zeus_max6369_device,
522 &can_regulator_device,
519}; 523};
520 524
521/* AC'97 */ 525/* AC'97 */
diff --git a/arch/arm/mach-realview/include/mach/debug-macro.S b/arch/arm/mach-realview/include/mach/debug-macro.S
deleted file mode 100644
index 8cc372dc66a8..000000000000
--- a/arch/arm/mach-realview/include/mach/debug-macro.S
+++ /dev/null
@@ -1,29 +0,0 @@
1/* arch/arm/mach-realview/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 */
12
13#ifdef CONFIG_DEBUG_REALVIEW_STD_PORT
14#define DEBUG_LL_UART_OFFSET 0x00009000
15#elif defined(CONFIG_DEBUG_REALVIEW_PB1176_PORT)
16#define DEBUG_LL_UART_OFFSET 0x0010c000
17#endif
18
19#ifndef DEBUG_LL_UART_OFFSET
20#error "Unknown RealView platform"
21#endif
22
23 .macro addruart, rp, rv, tmp
24 mov \rp, #DEBUG_LL_UART_OFFSET
25 orr \rv, \rp, #0xfb000000 @ virtual base
26 orr \rp, \rp, #0x10000000 @ physical base
27 .endm
28
29#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mach-rpc/include/mach/debug-macro.S b/arch/arm/mach-rpc/include/mach/debug-macro.S
deleted file mode 100644
index 6d28cc99b124..000000000000
--- a/arch/arm/mach-rpc/include/mach/debug-macro.S
+++ /dev/null
@@ -1,23 +0,0 @@
1/* arch/arm/mach-rpc/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0x00010000
16 orr \rp, \rp, #0x00000fe0
17 orr \rv, \rp, #0xe0000000 @ virtual
18 orr \rp, \rp, #0x03000000 @ physical
19 .endm
20
21#define UART_SHIFT 2
22#define FLOW_CONTROL
23#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index c5be60d85e4b..3a6ffa250fb1 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -358,7 +358,6 @@ static struct platform_device usbhsf_device = {
358static struct sh_eth_plat_data sh_eth_platdata = { 358static struct sh_eth_plat_data sh_eth_platdata = {
359 .phy = 0x00, /* LAN8710A */ 359 .phy = 0x00, /* LAN8710A */
360 .edmac_endian = EDMAC_LITTLE_ENDIAN, 360 .edmac_endian = EDMAC_LITTLE_ENDIAN,
361 .register_type = SH_ETH_REG_GIGABIT,
362 .phy_interface = PHY_INTERFACE_MODE_MII, 361 .phy_interface = PHY_INTERFACE_MODE_MII,
363}; 362};
364 363
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index 3354a85c90f7..35dd7f201a16 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Copyright (C) 2013 Renesas Solutions Corp. 4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 5 * Copyright (C) 2013 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 * Copyright (C) 2013 Cogent Embedded, Inc.
6 * 7 *
7 * 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
8 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -28,6 +29,7 @@
28#include <linux/smsc911x.h> 29#include <linux/smsc911x.h>
29#include <linux/spi/spi.h> 30#include <linux/spi/spi.h>
30#include <linux/spi/flash.h> 31#include <linux/spi/flash.h>
32#include <media/soc_camera.h>
31#include <mach/common.h> 33#include <mach/common.h>
32#include <mach/irqs.h> 34#include <mach/irqs.h>
33#include <mach/r8a7778.h> 35#include <mach/r8a7778.h>
@@ -89,7 +91,6 @@ static struct sh_mobile_sdhi_info sdhi0_info = {
89static struct sh_eth_plat_data ether_platform_data __initdata = { 91static struct sh_eth_plat_data ether_platform_data __initdata = {
90 .phy = 0x01, 92 .phy = 0x01,
91 .edmac_endian = EDMAC_LITTLE_ENDIAN, 93 .edmac_endian = EDMAC_LITTLE_ENDIAN,
92 .register_type = SH_ETH_REG_FAST_RCAR,
93 .phy_interface = PHY_INTERFACE_MODE_RMII, 94 .phy_interface = PHY_INTERFACE_MODE_RMII,
94 /* 95 /*
95 * Although the LINK signal is available on the board, it's connected to 96 * Although the LINK signal is available on the board, it's connected to
@@ -143,6 +144,25 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
143 MMC_CAP_NEEDS_POLL, 144 MMC_CAP_NEEDS_POLL,
144}; 145};
145 146
147static struct rcar_vin_platform_data vin_platform_data __initdata = {
148 .flags = RCAR_VIN_BT656,
149};
150
151/* In the default configuration both decoders reside on I2C bus 0 */
152#define BOCKW_CAMERA(idx) \
153static struct i2c_board_info camera##idx##_info = { \
154 I2C_BOARD_INFO("ml86v7667", 0x41 + 2 * (idx)), \
155}; \
156 \
157static struct soc_camera_link iclink##idx##_ml86v7667 __initdata = { \
158 .bus_id = idx, \
159 .i2c_adapter_id = 0, \
160 .board_info = &camera##idx##_info, \
161}
162
163BOCKW_CAMERA(0);
164BOCKW_CAMERA(1);
165
146static const struct pinctrl_map bockw_pinctrl_map[] = { 166static const struct pinctrl_map bockw_pinctrl_map[] = {
147 /* Ether */ 167 /* Ether */
148 PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778", 168 PIN_MAP_MUX_GROUP_DEFAULT("r8a777x-ether", "pfc-r8a7778",
@@ -174,6 +194,16 @@ static const struct pinctrl_map bockw_pinctrl_map[] = {
174 "sdhi0_cd", "sdhi0"), 194 "sdhi0_cd", "sdhi0"),
175 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778", 195 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-r8a7778",
176 "sdhi0_wp", "sdhi0"), 196 "sdhi0_wp", "sdhi0"),
197 /* VIN0 */
198 PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778",
199 "vin0_clk", "vin0"),
200 PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.0", "pfc-r8a7778",
201 "vin0_data8", "vin0"),
202 /* VIN1 */
203 PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778",
204 "vin1_clk", "vin1"),
205 PIN_MAP_MUX_GROUP_DEFAULT("r8a7778-vin.1", "pfc-r8a7778",
206 "vin1_data8", "vin1"),
177}; 207};
178 208
179#define FPGA 0x18200000 209#define FPGA 0x18200000
@@ -192,6 +222,16 @@ static void __init bockw_init(void)
192 r8a7778_add_i2c_device(0); 222 r8a7778_add_i2c_device(0);
193 r8a7778_add_hspi_device(0); 223 r8a7778_add_hspi_device(0);
194 r8a7778_add_mmc_device(&sh_mmcif_plat); 224 r8a7778_add_mmc_device(&sh_mmcif_plat);
225 r8a7778_add_vin_device(0, &vin_platform_data);
226 /* VIN1 has a pin conflict with Ether */
227 if (!IS_ENABLED(CONFIG_SH_ETH))
228 r8a7778_add_vin_device(1, &vin_platform_data);
229 platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0,
230 &iclink0_ml86v7667,
231 sizeof(iclink0_ml86v7667));
232 platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
233 &iclink1_ml86v7667,
234 sizeof(iclink1_ml86v7667));
195 235
196 i2c_register_board_info(0, i2c0_devices, 236 i2c_register_board_info(0, i2c0_devices,
197 ARRAY_SIZE(i2c0_devices)); 237 ARRAY_SIZE(i2c0_devices));
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
index a7d1010505bf..ca7fb2e63c60 100644
--- a/arch/arm/mach-shmobile/board-marzen.c
+++ b/arch/arm/mach-shmobile/board-marzen.c
@@ -1,8 +1,9 @@
1/* 1/*
2 * marzen board support 2 * marzen board support
3 * 3 *
4 * Copyright (C) 2011 Renesas Solutions Corp. 4 * Copyright (C) 2011, 2013 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm 5 * Copyright (C) 2011 Magnus Damm
6 * Copyright (C) 2013 Cogent Embedded, Inc.
6 * 7 *
7 * 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
8 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -37,6 +38,7 @@
37#include <linux/mmc/host.h> 38#include <linux/mmc/host.h>
38#include <linux/mmc/sh_mobile_sdhi.h> 39#include <linux/mmc/sh_mobile_sdhi.h>
39#include <linux/mfd/tmio.h> 40#include <linux/mfd/tmio.h>
41#include <media/soc_camera.h>
40#include <mach/hardware.h> 42#include <mach/hardware.h>
41#include <mach/r8a7779.h> 43#include <mach/r8a7779.h>
42#include <mach/common.h> 44#include <mach/common.h>
@@ -178,12 +180,40 @@ static struct platform_device leds_device = {
178 }, 180 },
179}; 181};
180 182
183static struct rcar_vin_platform_data vin_platform_data __initdata = {
184 .flags = RCAR_VIN_BT656,
185};
186
187#define MARZEN_CAMERA(idx) \
188static struct i2c_board_info camera##idx##_info = { \
189 I2C_BOARD_INFO("adv7180", 0x20 + (idx)), \
190}; \
191 \
192static struct soc_camera_link iclink##idx##_adv7180 = { \
193 .bus_id = 1 + 2 * (idx), \
194 .i2c_adapter_id = 0, \
195 .board_info = &camera##idx##_info, \
196}; \
197 \
198static struct platform_device camera##idx##_device = { \
199 .name = "soc-camera-pdrv", \
200 .id = idx, \
201 .dev = { \
202 .platform_data = &iclink##idx##_adv7180, \
203 }, \
204};
205
206MARZEN_CAMERA(0);
207MARZEN_CAMERA(1);
208
181static struct platform_device *marzen_devices[] __initdata = { 209static struct platform_device *marzen_devices[] __initdata = {
182 &eth_device, 210 &eth_device,
183 &sdhi0_device, 211 &sdhi0_device,
184 &thermal_device, 212 &thermal_device,
185 &hspi_device, 213 &hspi_device,
186 &leds_device, 214 &leds_device,
215 &camera0_device,
216 &camera1_device,
187}; 217};
188 218
189static const struct pinctrl_map marzen_pinctrl_map[] = { 219static const struct pinctrl_map marzen_pinctrl_map[] = {
@@ -219,6 +249,16 @@ static const struct pinctrl_map marzen_pinctrl_map[] = {
219 /* USB2 */ 249 /* USB2 */
220 PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779", 250 PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform.1", "pfc-r8a7779",
221 "usb2", "usb2"), 251 "usb2", "usb2"),
252 /* VIN1 */
253 PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779",
254 "vin1_clk", "vin1"),
255 PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.1", "pfc-r8a7779",
256 "vin1_data8", "vin1"),
257 /* VIN3 */
258 PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779",
259 "vin3_clk", "vin3"),
260 PIN_MAP_MUX_GROUP_DEFAULT("r8a7779-vin.3", "pfc-r8a7779",
261 "vin3_data8", "vin3"),
222}; 262};
223 263
224static void __init marzen_init(void) 264static void __init marzen_init(void)
@@ -235,6 +275,8 @@ static void __init marzen_init(void)
235 275
236 r8a7779_add_standard_devices(); 276 r8a7779_add_standard_devices();
237 r8a7779_add_usb_phy_device(&usb_phy_platform_data); 277 r8a7779_add_usb_phy_device(&usb_phy_platform_data);
278 r8a7779_add_vin_device(1, &vin_platform_data);
279 r8a7779_add_vin_device(3, &vin_platform_data);
238 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices)); 280 platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
239} 281}
240 282
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index a0e9eb72e46d..c4bf2d8fb111 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -106,6 +106,7 @@ enum {
106 MSTP331, 106 MSTP331,
107 MSTP323, MSTP322, MSTP321, 107 MSTP323, MSTP322, MSTP321,
108 MSTP114, 108 MSTP114,
109 MSTP110, MSTP109,
109 MSTP100, 110 MSTP100,
110 MSTP030, 111 MSTP030,
111 MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, 112 MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
@@ -119,6 +120,8 @@ static struct clk mstp_clks[MSTP_NR] = {
119 [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */ 120 [MSTP322] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 22, 0), /* SDHI1 */
120 [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */ 121 [MSTP321] = SH_CLK_MSTP32(&p_clk, MSTPCR3, 21, 0), /* SDHI2 */
121 [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */ 122 [MSTP114] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 14, 0), /* Ether */
123 [MSTP110] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 10, 0), /* VIN0 */
124 [MSTP109] = SH_CLK_MSTP32(&s_clk, MSTPCR1, 9, 0), /* VIN1 */
122 [MSTP100] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 0, 0), /* USB0/1 */ 125 [MSTP100] = SH_CLK_MSTP32(&p_clk, MSTPCR1, 0, 0), /* USB0/1 */
123 [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */ 126 [MSTP030] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 30, 0), /* I2C0 */
124 [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */ 127 [MSTP029] = SH_CLK_MSTP32(&p_clk, MSTPCR0, 29, 0), /* I2C1 */
@@ -146,6 +149,8 @@ static struct clk_lookup lookups[] = {
146 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */ 149 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP322]), /* SDHI1 */
147 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */ 150 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP321]), /* SDHI2 */
148 CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */ 151 CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */
152 CLKDEV_DEV_ID("r8a7778-vin.0", &mstp_clks[MSTP110]), /* VIN0 */
153 CLKDEV_DEV_ID("r8a7778-vin.1", &mstp_clks[MSTP109]), /* VIN1 */
149 CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 154 CLKDEV_DEV_ID("ehci-platform", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
150 CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 155 CLKDEV_DEV_ID("ohci-platform", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
151 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 156 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 10340f5becbb..bd6ad922eb7e 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -112,7 +112,9 @@ static struct clk *main_clks[] = {
112}; 112};
113 113
114enum { MSTP323, MSTP322, MSTP321, MSTP320, 114enum { MSTP323, MSTP322, MSTP321, MSTP320,
115 MSTP120,
115 MSTP116, MSTP115, MSTP114, 116 MSTP116, MSTP115, MSTP114,
117 MSTP110, MSTP109, MSTP108,
116 MSTP103, MSTP101, MSTP100, 118 MSTP103, MSTP101, MSTP100,
117 MSTP030, 119 MSTP030,
118 MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021, 120 MSTP029, MSTP028, MSTP027, MSTP026, MSTP025, MSTP024, MSTP023, MSTP022, MSTP021,
@@ -125,9 +127,13 @@ static struct clk mstp_clks[MSTP_NR] = {
125 [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */ 127 [MSTP322] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 22, 0), /* SDHI1 */
126 [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */ 128 [MSTP321] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 21, 0), /* SDHI2 */
127 [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */ 129 [MSTP320] = SH_CLK_MSTP32(&clkp_clk, MSTPCR3, 20, 0), /* SDHI3 */
130 [MSTP120] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 20, 0), /* VIN3 */
128 [MSTP116] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 16, 0), /* PCIe */ 131 [MSTP116] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 16, 0), /* PCIe */
129 [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */ 132 [MSTP115] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 15, 0), /* SATA */
130 [MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */ 133 [MSTP114] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 14, 0), /* Ether */
134 [MSTP110] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 10, 0), /* VIN0 */
135 [MSTP109] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 9, 0), /* VIN1 */
136 [MSTP108] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 8, 0), /* VIN2 */
131 [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */ 137 [MSTP103] = SH_CLK_MSTP32(&clks_clk, MSTPCR1, 3, 0), /* DU */
132 [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */ 138 [MSTP101] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 1, 0), /* USB2 */
133 [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */ 139 [MSTP100] = SH_CLK_MSTP32(&clkp_clk, MSTPCR1, 0, 0), /* USB0/1 */
@@ -162,10 +168,14 @@ static struct clk_lookup lookups[] = {
162 CLKDEV_CON_ID("peripheral_clk", &clkp_clk), 168 CLKDEV_CON_ID("peripheral_clk", &clkp_clk),
163 169
164 /* MSTP32 clocks */ 170 /* MSTP32 clocks */
171 CLKDEV_DEV_ID("r8a7779-vin.3", &mstp_clks[MSTP120]), /* VIN3 */
165 CLKDEV_DEV_ID("rcar-pcie", &mstp_clks[MSTP116]), /* PCIe */ 172 CLKDEV_DEV_ID("rcar-pcie", &mstp_clks[MSTP116]), /* PCIe */
166 CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */ 173 CLKDEV_DEV_ID("sata_rcar", &mstp_clks[MSTP115]), /* SATA */
167 CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */ 174 CLKDEV_DEV_ID("fc600000.sata", &mstp_clks[MSTP115]), /* SATA w/DT */
168 CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */ 175 CLKDEV_DEV_ID("r8a777x-ether", &mstp_clks[MSTP114]), /* Ether */
176 CLKDEV_DEV_ID("r8a7779-vin.0", &mstp_clks[MSTP110]), /* VIN0 */
177 CLKDEV_DEV_ID("r8a7779-vin.1", &mstp_clks[MSTP109]), /* VIN1 */
178 CLKDEV_DEV_ID("r8a7779-vin.2", &mstp_clks[MSTP108]), /* VIN2 */
169 CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */ 179 CLKDEV_DEV_ID("ehci-platform.1", &mstp_clks[MSTP101]), /* USB EHCI port2 */
170 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 180 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */
171 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 181 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7778.h b/arch/arm/mach-shmobile/include/mach/r8a7778.h
index 851d027a2f06..a7c6d151cdd5 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7778.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7778.h
@@ -22,6 +22,7 @@
22#include <linux/mmc/sh_mobile_sdhi.h> 22#include <linux/mmc/sh_mobile_sdhi.h>
23#include <linux/sh_eth.h> 23#include <linux/sh_eth.h>
24#include <linux/platform_data/usb-rcar-phy.h> 24#include <linux/platform_data/usb-rcar-phy.h>
25#include <linux/platform_data/camera-rcar.h>
25 26
26extern void r8a7778_add_standard_devices(void); 27extern void r8a7778_add_standard_devices(void);
27extern void r8a7778_add_standard_devices_dt(void); 28extern void r8a7778_add_standard_devices_dt(void);
@@ -30,6 +31,8 @@ extern void r8a7778_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
30extern void r8a7778_add_i2c_device(int id); 31extern void r8a7778_add_i2c_device(int id);
31extern void r8a7778_add_hspi_device(int id); 32extern void r8a7778_add_hspi_device(int id);
32extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info); 33extern void r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info);
34extern void r8a7778_add_vin_device(int id,
35 struct rcar_vin_platform_data *pdata);
33 36
34extern void r8a7778_init_late(void); 37extern void r8a7778_init_late(void);
35extern void r8a7778_init_delay(void); 38extern void r8a7778_init_delay(void);
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h
index fc47073c7ba9..6d2b6417fe2a 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -5,6 +5,7 @@
5#include <linux/pm_domain.h> 5#include <linux/pm_domain.h>
6#include <linux/sh_eth.h> 6#include <linux/sh_eth.h>
7#include <linux/platform_data/usb-rcar-phy.h> 7#include <linux/platform_data/usb-rcar-phy.h>
8#include <linux/platform_data/camera-rcar.h>
8 9
9struct platform_device; 10struct platform_device;
10 11
@@ -35,6 +36,8 @@ extern void r8a7779_add_standard_devices(void);
35extern void r8a7779_add_standard_devices_dt(void); 36extern void r8a7779_add_standard_devices_dt(void);
36extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata); 37extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
37extern void r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata); 38extern void r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
39extern void r8a7779_add_vin_device(int idx,
40 struct rcar_vin_platform_data *pdata);
38extern void r8a7779_init_late(void); 41extern void r8a7779_init_late(void);
39extern void r8a7779_clock_init(void); 42extern void r8a7779_clock_init(void);
40extern void r8a7779_pinmux_init(void); 43extern void r8a7779_pinmux_init(void);
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 80c20392ad7c..0174f059eac3 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -333,6 +333,40 @@ void __init r8a7778_add_mmc_device(struct sh_mmcif_plat_data *info)
333 info, sizeof(*info)); 333 info, sizeof(*info));
334} 334}
335 335
336/* VIN */
337#define R8A7778_VIN(idx) \
338static struct resource vin##idx##_resources[] __initdata = { \
339 DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
340 DEFINE_RES_IRQ(gic_iid(0x5a)), \
341}; \
342 \
343static struct platform_device_info vin##idx##_info __initdata = { \
344 .parent = &platform_bus, \
345 .name = "r8a7778-vin", \
346 .id = idx, \
347 .res = vin##idx##_resources, \
348 .num_res = ARRAY_SIZE(vin##idx##_resources), \
349 .dma_mask = DMA_BIT_MASK(32), \
350}
351
352R8A7778_VIN(0);
353R8A7778_VIN(1);
354
355static struct platform_device_info *vin_info_table[] __initdata = {
356 &vin0_info,
357 &vin1_info,
358};
359
360void __init r8a7778_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
361{
362 BUG_ON(id < 0 || id > 1);
363
364 vin_info_table[id]->data = pdata;
365 vin_info_table[id]->size_data = sizeof(*pdata);
366
367 platform_device_register_full(vin_info_table[id]);
368}
369
336void __init r8a7778_add_standard_devices(void) 370void __init r8a7778_add_standard_devices(void)
337{ 371{
338 int i; 372 int i;
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 398687761f50..3d8928895503 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -559,6 +559,33 @@ static struct resource ether_resources[] = {
559 }, 559 },
560}; 560};
561 561
562#define R8A7779_VIN(idx) \
563static struct resource vin##idx##_resources[] __initdata = { \
564 DEFINE_RES_MEM(0xffc50000 + 0x1000 * (idx), 0x1000), \
565 DEFINE_RES_IRQ(gic_iid(0x5f + (idx))), \
566}; \
567 \
568static struct platform_device_info vin##idx##_info __initdata = { \
569 .parent = &platform_bus, \
570 .name = "r8a7779-vin", \
571 .id = idx, \
572 .res = vin##idx##_resources, \
573 .num_res = ARRAY_SIZE(vin##idx##_resources), \
574 .dma_mask = DMA_BIT_MASK(32), \
575}
576
577R8A7779_VIN(0);
578R8A7779_VIN(1);
579R8A7779_VIN(2);
580R8A7779_VIN(3);
581
582static struct platform_device_info *vin_info_table[] __initdata = {
583 &vin0_info,
584 &vin1_info,
585 &vin2_info,
586 &vin3_info,
587};
588
562static struct platform_device *r8a7779_devices_dt[] __initdata = { 589static struct platform_device *r8a7779_devices_dt[] __initdata = {
563 &scif0_device, 590 &scif0_device,
564 &scif1_device, 591 &scif1_device,
@@ -610,6 +637,16 @@ void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
610 pdata, sizeof(*pdata)); 637 pdata, sizeof(*pdata));
611} 638}
612 639
640void __init r8a7779_add_vin_device(int id, struct rcar_vin_platform_data *pdata)
641{
642 BUG_ON(id < 0 || id > 3);
643
644 vin_info_table[id]->data = pdata;
645 vin_info_table[id]->size_data = sizeof(*pdata);
646
647 platform_device_register_full(vin_info_table[id]);
648}
649
613/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ 650/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
614void __init __weak r8a7779_register_twd(void) { } 651void __init __weak r8a7779_register_twd(void) { }
615 652
diff --git a/arch/arm/mach-spear/include/mach/debug-macro.S b/arch/arm/mach-spear/include/mach/debug-macro.S
deleted file mode 100644
index 75b05ad0fbad..000000000000
--- a/arch/arm/mach-spear/include/mach/debug-macro.S
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * arch/arm/plat-spear/include/plat/debug-macro.S
3 *
4 * Debugging macro include header for spear platform
5 *
6 * Copyright (C) 2009 ST Microelectronics
7 * Viresh Kumar <viresh.linux@gmail.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/amba/serial.h>
15#include <mach/spear.h>
16
17 .macro addruart, rp, rv, tmp
18 mov \rp, #SPEAR_DBG_UART_BASE @ Physical base
19 mov \rv, #VA_SPEAR_DBG_UART_BASE @ Virtual base
20 .endm
21
22 .macro senduart, rd, rx
23 strb \rd, [\rx, #UART01x_DR] @ ASC_TX_BUFFER
24 .endm
25
26 .macro waituart, rd, rx
271001: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
28 tst \rd, #UART01x_FR_TXFF @ TX_FULL
29 bne 1001b
30 .endm
31
32 .macro busyuart, rd, rx
331002: ldr \rd, [\rx, #UART01x_FR] @ FLAG REGISTER
34 tst \rd, #UART011_FR_TXFE @ TX_EMPTY
35 beq 1002b
36 .endm
diff --git a/arch/arm/mach-spear/include/mach/spear.h b/arch/arm/mach-spear/include/mach/spear.h
index cf3a5369eeca..5cdc53d9b653 100644
--- a/arch/arm/mach-spear/include/mach/spear.h
+++ b/arch/arm/mach-spear/include/mach/spear.h
@@ -39,7 +39,6 @@
39 39
40/* Debug uart for linux, will be used for debug and uncompress messages */ 40/* Debug uart for linux, will be used for debug and uncompress messages */
41#define SPEAR_DBG_UART_BASE SPEAR_ICM1_UART_BASE 41#define SPEAR_DBG_UART_BASE SPEAR_ICM1_UART_BASE
42#define VA_SPEAR_DBG_UART_BASE VA_SPEAR_ICM1_UART_BASE
43 42
44/* Sysctl base for spear platform */ 43/* Sysctl base for spear platform */
45#define SPEAR_SYS_CTRL_BASE SPEAR_ICM3_SYS_CTRL_BASE 44#define SPEAR_SYS_CTRL_BASE SPEAR_ICM3_SYS_CTRL_BASE
@@ -86,7 +85,6 @@
86 85
87/* Debug uart for linux, will be used for debug and uncompress messages */ 86/* Debug uart for linux, will be used for debug and uncompress messages */
88#define SPEAR_DBG_UART_BASE UART_BASE 87#define SPEAR_DBG_UART_BASE UART_BASE
89#define VA_SPEAR_DBG_UART_BASE VA_UART_BASE
90 88
91#endif /* SPEAR13XX */ 89#endif /* SPEAR13XX */
92 90
diff --git a/arch/arm/mach-tegra/tegra.c b/arch/arm/mach-tegra/tegra.c
index 0d1e4128d460..fc97cfd52769 100644
--- a/arch/arm/mach-tegra/tegra.c
+++ b/arch/arm/mach-tegra/tegra.c
@@ -29,7 +29,6 @@
29#include <linux/of_fdt.h> 29#include <linux/of_fdt.h>
30#include <linux/of_platform.h> 30#include <linux/of_platform.h>
31#include <linux/pda_power.h> 31#include <linux/pda_power.h>
32#include <linux/platform_data/tegra_usb.h>
33#include <linux/io.h> 32#include <linux/io.h>
34#include <linux/slab.h> 33#include <linux/slab.h>
35#include <linux/sys_soc.h> 34#include <linux/sys_soc.h>
@@ -46,40 +45,6 @@
46#include "fuse.h" 45#include "fuse.h"
47#include "iomap.h" 46#include "iomap.h"
48 47
49static struct tegra_ehci_platform_data tegra_ehci1_pdata = {
50 .operating_mode = TEGRA_USB_OTG,
51 .power_down_on_bus_suspend = 1,
52 .vbus_gpio = -1,
53};
54
55static struct tegra_ulpi_config tegra_ehci2_ulpi_phy_config = {
56 .reset_gpio = -1,
57 .clk = "cdev2",
58};
59
60static struct tegra_ehci_platform_data tegra_ehci2_pdata = {
61 .phy_config = &tegra_ehci2_ulpi_phy_config,
62 .operating_mode = TEGRA_USB_HOST,
63 .power_down_on_bus_suspend = 1,
64 .vbus_gpio = -1,
65};
66
67static struct tegra_ehci_platform_data tegra_ehci3_pdata = {
68 .operating_mode = TEGRA_USB_HOST,
69 .power_down_on_bus_suspend = 1,
70 .vbus_gpio = -1,
71};
72
73static struct of_dev_auxdata tegra20_auxdata_lookup[] __initdata = {
74 OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5000000, "tegra-ehci.0",
75 &tegra_ehci1_pdata),
76 OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5004000, "tegra-ehci.1",
77 &tegra_ehci2_pdata),
78 OF_DEV_AUXDATA("nvidia,tegra20-ehci", 0xC5008000, "tegra-ehci.2",
79 &tegra_ehci3_pdata),
80 {}
81};
82
83static void __init tegra_dt_init(void) 48static void __init tegra_dt_init(void)
84{ 49{
85 struct soc_device_attribute *soc_dev_attr; 50 struct soc_device_attribute *soc_dev_attr;
@@ -112,8 +77,7 @@ static void __init tegra_dt_init(void)
112 * devices 77 * devices
113 */ 78 */
114out: 79out:
115 of_platform_populate(NULL, of_default_bus_match_table, 80 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
116 tegra20_auxdata_lookup, parent);
117} 81}
118 82
119static void __init trimslice_init(void) 83static void __init trimslice_init(void)
diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile
index bf9b6be5b180..fe1f3e26b88b 100644
--- a/arch/arm/mach-ux500/Makefile
+++ b/arch/arm/mach-ux500/Makefile
@@ -4,7 +4,6 @@
4 4
5obj-y := cpu.o devices.o devices-common.o \ 5obj-y := cpu.o devices.o devices-common.o \
6 id.o usb.o timer.o pm.o 6 id.o usb.o timer.o pm.o
7obj-$(CONFIG_CPU_IDLE) += cpuidle.o
8obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 7obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
9obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o 8obj-$(CONFIG_UX500_SOC_DB8500) += cpu-db8500.o devices-db8500.o
10obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \ 9obj-$(CONFIG_MACH_MOP500) += board-mop500.o board-mop500-sdi.o \
diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c
deleted file mode 100644
index a45dd09daed9..000000000000
--- a/arch/arm/mach-ux500/cpuidle.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Copyright (c) 2012 Linaro : Daniel Lezcano <daniel.lezcano@linaro.org> (IBM)
3 *
4 * Based on the work of Rickard Andersson <rickard.andersson@stericsson.com>
5 * and Jonas Aaberg <jonas.aberg@stericsson.com>.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/module.h>
13#include <linux/cpuidle.h>
14#include <linux/spinlock.h>
15#include <linux/atomic.h>
16#include <linux/smp.h>
17#include <linux/mfd/dbx500-prcmu.h>
18#include <linux/platform_data/arm-ux500-pm.h>
19
20#include <asm/cpuidle.h>
21#include <asm/proc-fns.h>
22
23#include "db8500-regs.h"
24#include "id.h"
25
26static atomic_t master = ATOMIC_INIT(0);
27static DEFINE_SPINLOCK(master_lock);
28
29static inline int ux500_enter_idle(struct cpuidle_device *dev,
30 struct cpuidle_driver *drv, int index)
31{
32 int this_cpu = smp_processor_id();
33 bool recouple = false;
34
35 if (atomic_inc_return(&master) == num_online_cpus()) {
36
37 /* With this lock, we prevent the other cpu to exit and enter
38 * this function again and become the master */
39 if (!spin_trylock(&master_lock))
40 goto wfi;
41
42 /* decouple the gic from the A9 cores */
43 if (prcmu_gic_decouple()) {
44 spin_unlock(&master_lock);
45 goto out;
46 }
47
48 /* If an error occur, we will have to recouple the gic
49 * manually */
50 recouple = true;
51
52 /* At this state, as the gic is decoupled, if the other
53 * cpu is in WFI, we have the guarantee it won't be wake
54 * up, so we can safely go to retention */
55 if (!prcmu_is_cpu_in_wfi(this_cpu ? 0 : 1))
56 goto out;
57
58 /* The prcmu will be in charge of watching the interrupts
59 * and wake up the cpus */
60 if (prcmu_copy_gic_settings())
61 goto out;
62
63 /* Check in the meantime an interrupt did
64 * not occur on the gic ... */
65 if (prcmu_gic_pending_irq())
66 goto out;
67
68 /* ... and the prcmu */
69 if (prcmu_pending_irq())
70 goto out;
71
72 /* Go to the retention state, the prcmu will wait for the
73 * cpu to go WFI and this is what happens after exiting this
74 * 'master' critical section */
75 if (prcmu_set_power_state(PRCMU_AP_IDLE, true, true))
76 goto out;
77
78 /* When we switch to retention, the prcmu is in charge
79 * of recoupling the gic automatically */
80 recouple = false;
81
82 spin_unlock(&master_lock);
83 }
84wfi:
85 cpu_do_idle();
86out:
87 atomic_dec(&master);
88
89 if (recouple) {
90 prcmu_gic_recouple();
91 spin_unlock(&master_lock);
92 }
93
94 return index;
95}
96
97static struct cpuidle_driver ux500_idle_driver = {
98 .name = "ux500_idle",
99 .owner = THIS_MODULE,
100 .states = {
101 ARM_CPUIDLE_WFI_STATE,
102 {
103 .enter = ux500_enter_idle,
104 .exit_latency = 70,
105 .target_residency = 260,
106 .flags = CPUIDLE_FLAG_TIME_VALID |
107 CPUIDLE_FLAG_TIMER_STOP,
108 .name = "ApIdle",
109 .desc = "ARM Retention",
110 },
111 },
112 .safe_state_index = 0,
113 .state_count = 2,
114};
115
116int __init ux500_idle_init(void)
117{
118 if (!(cpu_is_u8500_family() || cpu_is_ux540_family()))
119 return -ENODEV;
120
121 /* Configure wake up reasons */
122 prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) |
123 PRCMU_WAKEUP(ABB));
124
125 return cpuidle_register(&ux500_idle_driver, NULL);
126}
127
128device_initcall(ux500_idle_init);
diff --git a/arch/arm/mach-versatile/include/mach/debug-macro.S b/arch/arm/mach-versatile/include/mach/debug-macro.S
deleted file mode 100644
index d0fbd7f1cb00..000000000000
--- a/arch/arm/mach-versatile/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/* arch/arm/mach-versatile/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
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
10 * published by the Free Software Foundation.
11 *
12*/
13
14 .macro addruart, rp, rv, tmp
15 mov \rp, #0x001F0000
16 orr \rp, \rp, #0x00001000
17 orr \rv, \rp, #0xf1000000 @ virtual base
18 orr \rp, \rp, #0x10000000 @ physical base
19 .endm
20
21#include <asm/hardware/debug-pl01x.S>
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index db5c2cab8fda..cd2c88e7a8f7 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -809,15 +809,18 @@ config KUSER_HELPERS
809 the CPU type fitted to the system. This permits binaries to be 809 the CPU type fitted to the system. This permits binaries to be
810 run on ARMv4 through to ARMv7 without modification. 810 run on ARMv4 through to ARMv7 without modification.
811 811
812 See Documentation/arm/kernel_user_helpers.txt for details.
813
812 However, the fixed address nature of these helpers can be used 814 However, the fixed address nature of these helpers can be used
813 by ROP (return orientated programming) authors when creating 815 by ROP (return orientated programming) authors when creating
814 exploits. 816 exploits.
815 817
816 If all of the binaries and libraries which run on your platform 818 If all of the binaries and libraries which run on your platform
817 are built specifically for your platform, and make no use of 819 are built specifically for your platform, and make no use of
818 these helpers, then you can turn this option off. However, 820 these helpers, then you can turn this option off to hinder
819 when such an binary or library is run, it will receive a SIGILL 821 such exploits. However, in that case, if a binary or library
820 signal, which will terminate the program. 822 relying on those helpers is run, it will receive a SIGILL signal,
823 which will terminate the program.
821 824
822 Say N here only if you are absolutely certain that you do not 825 Say N here only if you are absolutely certain that you do not
823 need these helpers; otherwise, the safe option is to say Y. 826 need these helpers; otherwise, the safe option is to say Y.
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index d70e0aba0c9d..447da6ffadd5 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -290,7 +290,7 @@ static void l2x0_disable(void)
290 raw_spin_lock_irqsave(&l2x0_lock, flags); 290 raw_spin_lock_irqsave(&l2x0_lock, flags);
291 __l2x0_flush_all(); 291 __l2x0_flush_all();
292 writel_relaxed(0, l2x0_base + L2X0_CTRL); 292 writel_relaxed(0, l2x0_base + L2X0_CTRL);
293 dsb(); 293 dsb(st);
294 raw_spin_unlock_irqrestore(&l2x0_lock, flags); 294 raw_spin_unlock_irqrestore(&l2x0_lock, flags);
295} 295}
296 296
@@ -417,9 +417,9 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
417 outer_cache.disable = l2x0_disable; 417 outer_cache.disable = l2x0_disable;
418 } 418 }
419 419
420 printk(KERN_INFO "%s cache controller enabled\n", type); 420 pr_info("%s cache controller enabled\n", type);
421 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", 421 pr_info("l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d kB\n",
422 ways, cache_id, aux, l2x0_size); 422 ways, cache_id, aux, l2x0_size >> 10);
423} 423}
424 424
425#ifdef CONFIG_OF 425#ifdef CONFIG_OF
@@ -929,7 +929,9 @@ static const struct of_device_id l2x0_ids[] __initconst = {
929 .data = (void *)&aurora_no_outer_data}, 929 .data = (void *)&aurora_no_outer_data},
930 { .compatible = "marvell,aurora-outer-cache", 930 { .compatible = "marvell,aurora-outer-cache",
931 .data = (void *)&aurora_with_outer_data}, 931 .data = (void *)&aurora_with_outer_data},
932 { .compatible = "bcm,bcm11351-a2-pl310-cache", 932 { .compatible = "brcm,bcm11351-a2-pl310-cache",
933 .data = (void *)&bcm_l2x0_data},
934 { .compatible = "bcm,bcm11351-a2-pl310-cache", /* deprecated name */
933 .data = (void *)&bcm_l2x0_data}, 935 .data = (void *)&bcm_l2x0_data},
934 {} 936 {}
935}; 937};
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 515b00064da8..b5c467a65c27 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -282,7 +282,7 @@ ENTRY(v7_coherent_user_range)
282 add r12, r12, r2 282 add r12, r12, r2
283 cmp r12, r1 283 cmp r12, r1
284 blo 1b 284 blo 1b
285 dsb 285 dsb ishst
286 icache_line_size r2, r3 286 icache_line_size r2, r3
287 sub r3, r2, #1 287 sub r3, r2, #1
288 bic r12, r0, r3 288 bic r12, r0, r3
@@ -294,7 +294,7 @@ ENTRY(v7_coherent_user_range)
294 mov r0, #0 294 mov r0, #0
295 ALT_SMP(mcr p15, 0, r0, c7, c1, 6) @ invalidate BTB Inner Shareable 295 ALT_SMP(mcr p15, 0, r0, c7, c1, 6) @ invalidate BTB Inner Shareable
296 ALT_UP(mcr p15, 0, r0, c7, c5, 6) @ invalidate BTB 296 ALT_UP(mcr p15, 0, r0, c7, c5, 6) @ invalidate BTB
297 dsb 297 dsb ishst
298 isb 298 isb
299 mov pc, lr 299 mov pc, lr
300 300
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 4a0544492f10..84e6f772e204 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -162,10 +162,7 @@ static void flush_context(unsigned int cpu)
162 } 162 }
163 163
164 /* Queue a TLB invalidate and flush the I-cache if necessary. */ 164 /* Queue a TLB invalidate and flush the I-cache if necessary. */
165 if (!tlb_ops_need_broadcast()) 165 cpumask_setall(&tlb_flush_pending);
166 cpumask_set_cpu(cpu, &tlb_flush_pending);
167 else
168 cpumask_setall(&tlb_flush_pending);
169 166
170 if (icache_is_vivt_asid_tagged()) 167 if (icache_is_vivt_asid_tagged())
171 __flush_icache_all(); 168 __flush_icache_all();
@@ -245,8 +242,6 @@ void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk)
245 if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) { 242 if (cpumask_test_and_clear_cpu(cpu, &tlb_flush_pending)) {
246 local_flush_bp_all(); 243 local_flush_bp_all();
247 local_flush_tlb_all(); 244 local_flush_tlb_all();
248 if (erratum_a15_798181())
249 dummy_flush_tlb_a15_erratum();
250 } 245 }
251 246
252 atomic64_set(&per_cpu(active_asids, cpu), asid); 247 atomic64_set(&per_cpu(active_asids, cpu), asid);
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 7f9b1798c6cf..f5e1a8471714 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -358,7 +358,7 @@ static int __init atomic_pool_init(void)
358 if (!pages) 358 if (!pages)
359 goto no_pages; 359 goto no_pages;
360 360
361 if (IS_ENABLED(CONFIG_CMA)) 361 if (IS_ENABLED(CONFIG_DMA_CMA))
362 ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page, 362 ptr = __alloc_from_contiguous(NULL, pool->size, prot, &page,
363 atomic_pool_init); 363 atomic_pool_init);
364 else 364 else
@@ -455,7 +455,6 @@ static void __dma_remap(struct page *page, size_t size, pgprot_t prot)
455 unsigned end = start + size; 455 unsigned end = start + size;
456 456
457 apply_to_page_range(&init_mm, start, size, __dma_update_pte, &prot); 457 apply_to_page_range(&init_mm, start, size, __dma_update_pte, &prot);
458 dsb();
459 flush_tlb_kernel_range(start, end); 458 flush_tlb_kernel_range(start, end);
460} 459}
461 460
@@ -670,7 +669,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
670 addr = __alloc_simple_buffer(dev, size, gfp, &page); 669 addr = __alloc_simple_buffer(dev, size, gfp, &page);
671 else if (!(gfp & __GFP_WAIT)) 670 else if (!(gfp & __GFP_WAIT))
672 addr = __alloc_from_pool(size, &page); 671 addr = __alloc_from_pool(size, &page);
673 else if (!IS_ENABLED(CONFIG_CMA)) 672 else if (!IS_ENABLED(CONFIG_DMA_CMA))
674 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller); 673 addr = __alloc_remap_buffer(dev, size, gfp, prot, &page, caller);
675 else 674 else
676 addr = __alloc_from_contiguous(dev, size, prot, &page, caller); 675 addr = __alloc_from_contiguous(dev, size, prot, &page, caller);
@@ -759,7 +758,7 @@ static void __arm_dma_free(struct device *dev, size_t size, void *cpu_addr,
759 __dma_free_buffer(page, size); 758 __dma_free_buffer(page, size);
760 } else if (__free_from_pool(cpu_addr, size)) { 759 } else if (__free_from_pool(cpu_addr, size)) {
761 return; 760 return;
762 } else if (!IS_ENABLED(CONFIG_CMA)) { 761 } else if (!IS_ENABLED(CONFIG_DMA_CMA)) {
763 __dma_free_remap(cpu_addr, size); 762 __dma_free_remap(cpu_addr, size);
764 __dma_free_buffer(page, size); 763 __dma_free_buffer(page, size);
765 } else { 764 } else {
diff --git a/arch/arm/mm/hugetlbpage.c b/arch/arm/mm/hugetlbpage.c
index 3d1e4a205b0b..66781bf34077 100644
--- a/arch/arm/mm/hugetlbpage.c
+++ b/arch/arm/mm/hugetlbpage.c
@@ -36,22 +36,6 @@
36 * of type casting from pmd_t * to pte_t *. 36 * of type casting from pmd_t * to pte_t *.
37 */ 37 */
38 38
39pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
40{
41 pgd_t *pgd;
42 pud_t *pud;
43 pmd_t *pmd = NULL;
44
45 pgd = pgd_offset(mm, addr);
46 if (pgd_present(*pgd)) {
47 pud = pud_offset(pgd, addr);
48 if (pud_present(*pud))
49 pmd = pmd_offset(pud, addr);
50 }
51
52 return (pte_t *)pmd;
53}
54
55struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, 39struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
56 int write) 40 int write)
57{ 41{
@@ -68,33 +52,6 @@ int huge_pmd_unshare(struct mm_struct *mm, unsigned long *addr, pte_t *ptep)
68 return 0; 52 return 0;
69} 53}
70 54
71pte_t *huge_pte_alloc(struct mm_struct *mm,
72 unsigned long addr, unsigned long sz)
73{
74 pgd_t *pgd;
75 pud_t *pud;
76 pte_t *pte = NULL;
77
78 pgd = pgd_offset(mm, addr);
79 pud = pud_alloc(mm, pgd, addr);
80 if (pud)
81 pte = (pte_t *)pmd_alloc(mm, pud, addr);
82
83 return pte;
84}
85
86struct page *
87follow_huge_pmd(struct mm_struct *mm, unsigned long address,
88 pmd_t *pmd, int write)
89{
90 struct page *page;
91
92 page = pte_page(*(pte_t *)pmd);
93 if (page)
94 page += ((address & ~PMD_MASK) >> PAGE_SHIFT);
95 return page;
96}
97
98int pmd_huge(pmd_t pmd) 55int pmd_huge(pmd_t pmd)
99{ 56{
100 return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT); 57 return pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT);
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 15225d829d71..2958e74fc42c 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -231,7 +231,7 @@ static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
231} 231}
232#endif 232#endif
233 233
234void __init setup_dma_zone(struct machine_desc *mdesc) 234void __init setup_dma_zone(const struct machine_desc *mdesc)
235{ 235{
236#ifdef CONFIG_ZONE_DMA 236#ifdef CONFIG_ZONE_DMA
237 if (mdesc->dma_zone_size) { 237 if (mdesc->dma_zone_size) {
@@ -335,7 +335,8 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
335 return phys; 335 return phys;
336} 336}
337 337
338void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) 338void __init arm_memblock_init(struct meminfo *mi,
339 const struct machine_desc *mdesc)
339{ 340{
340 int i; 341 int i;
341 342
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 53cdbd39ec8e..b1d17eeb59b8 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -1186,7 +1186,7 @@ void __init arm_mm_memblock_reserve(void)
1186 * called function. This means you can't use any function or debugging 1186 * called function. This means you can't use any function or debugging
1187 * method which may touch any device, otherwise the kernel _will_ crash. 1187 * method which may touch any device, otherwise the kernel _will_ crash.
1188 */ 1188 */
1189static void __init devicemaps_init(struct machine_desc *mdesc) 1189static void __init devicemaps_init(const struct machine_desc *mdesc)
1190{ 1190{
1191 struct map_desc map; 1191 struct map_desc map;
1192 unsigned long addr; 1192 unsigned long addr;
@@ -1319,7 +1319,7 @@ static void __init map_lowmem(void)
1319 * paging_init() sets up the page tables, initialises the zone memory 1319 * paging_init() sets up the page tables, initialises the zone memory
1320 * maps, and sets up the zero page, bad page and bad page tables. 1320 * maps, and sets up the zero page, bad page and bad page tables.
1321 */ 1321 */
1322void __init paging_init(struct machine_desc *mdesc) 1322void __init paging_init(const struct machine_desc *mdesc)
1323{ 1323{
1324 void *zero_page; 1324 void *zero_page;
1325 1325
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 1fa50100ab6a..34d4ab217bab 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -299,7 +299,7 @@ void __init sanity_check_meminfo(void)
299 * paging_init() sets up the page tables, initialises the zone memory 299 * paging_init() sets up the page tables, initialises the zone memory
300 * maps, and sets up the zero page, bad page and bad page tables. 300 * maps, and sets up the zero page, bad page and bad page tables.
301 */ 301 */
302void __init paging_init(struct machine_desc *mdesc) 302void __init paging_init(const struct machine_desc *mdesc)
303{ 303{
304 early_trap_init((void *)CONFIG_VECTORS_BASE); 304 early_trap_init((void *)CONFIG_VECTORS_BASE);
305 mpu_setup(); 305 mpu_setup();
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index d5146b98c8d1..db79b62c92fb 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -514,6 +514,32 @@ ENTRY(cpu_feroceon_set_pte_ext)
514#endif 514#endif
515 mov pc, lr 515 mov pc, lr
516 516
517/* Suspend/resume support: taken from arch/arm/mm/proc-arm926.S */
518.globl cpu_feroceon_suspend_size
519.equ cpu_feroceon_suspend_size, 4 * 3
520#ifdef CONFIG_ARM_CPU_SUSPEND
521ENTRY(cpu_feroceon_do_suspend)
522 stmfd sp!, {r4 - r6, lr}
523 mrc p15, 0, r4, c13, c0, 0 @ PID
524 mrc p15, 0, r5, c3, c0, 0 @ Domain ID
525 mrc p15, 0, r6, c1, c0, 0 @ Control register
526 stmia r0, {r4 - r6}
527 ldmfd sp!, {r4 - r6, pc}
528ENDPROC(cpu_feroceon_do_suspend)
529
530ENTRY(cpu_feroceon_do_resume)
531 mov ip, #0
532 mcr p15, 0, ip, c8, c7, 0 @ invalidate I+D TLBs
533 mcr p15, 0, ip, c7, c7, 0 @ invalidate I+D caches
534 ldmia r0, {r4 - r6}
535 mcr p15, 0, r4, c13, c0, 0 @ PID
536 mcr p15, 0, r5, c3, c0, 0 @ Domain ID
537 mcr p15, 0, r1, c2, c0, 0 @ TTB address
538 mov r0, r6 @ control register
539 b cpu_resume_mmu
540ENDPROC(cpu_feroceon_do_resume)
541#endif
542
517 .type __feroceon_setup, #function 543 .type __feroceon_setup, #function
518__feroceon_setup: 544__feroceon_setup:
519 mov r0, #0 545 mov r0, #0
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 73398bcf9bd8..c63d9bdee51e 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -83,7 +83,7 @@ ENTRY(cpu_v7_dcache_clean_area)
83 add r0, r0, r2 83 add r0, r0, r2
84 subs r1, r1, r2 84 subs r1, r1, r2
85 bhi 2b 85 bhi 2b
86 dsb 86 dsb ishst
87 mov pc, lr 87 mov pc, lr
88ENDPROC(cpu_v7_dcache_clean_area) 88ENDPROC(cpu_v7_dcache_clean_area)
89 89
@@ -330,7 +330,19 @@ __v7_setup:
3301: 3301:
331#endif 331#endif
332 332
3333: mov r10, #0 333 /* Cortex-A15 Errata */
3343: ldr r10, =0x00000c0f @ Cortex-A15 primary part number
335 teq r0, r10
336 bne 4f
337
338#ifdef CONFIG_ARM_ERRATA_773022
339 cmp r6, #0x4 @ only present up to r0p4
340 mrcle p15, 0, r10, c1, c0, 1 @ read aux control register
341 orrle r10, r10, #1 << 1 @ disable loop buffer
342 mcrle p15, 0, r10, c1, c0, 1 @ write aux control register
343#endif
344
3454: mov r10, #0
334 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate 346 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
335 dsb 347 dsb
336#ifdef CONFIG_MMU 348#ifdef CONFIG_MMU
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index ea94765acf9a..355308767bae 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -35,7 +35,7 @@
35ENTRY(v7wbi_flush_user_tlb_range) 35ENTRY(v7wbi_flush_user_tlb_range)
36 vma_vm_mm r3, r2 @ get vma->vm_mm 36 vma_vm_mm r3, r2 @ get vma->vm_mm
37 mmid r3, r3 @ get vm_mm->context.id 37 mmid r3, r3 @ get vm_mm->context.id
38 dsb 38 dsb ish
39 mov r0, r0, lsr #PAGE_SHIFT @ align address 39 mov r0, r0, lsr #PAGE_SHIFT @ align address
40 mov r1, r1, lsr #PAGE_SHIFT 40 mov r1, r1, lsr #PAGE_SHIFT
41 asid r3, r3 @ mask ASID 41 asid r3, r3 @ mask ASID
@@ -56,7 +56,7 @@ ENTRY(v7wbi_flush_user_tlb_range)
56 add r0, r0, #PAGE_SZ 56 add r0, r0, #PAGE_SZ
57 cmp r0, r1 57 cmp r0, r1
58 blo 1b 58 blo 1b
59 dsb 59 dsb ish
60 mov pc, lr 60 mov pc, lr
61ENDPROC(v7wbi_flush_user_tlb_range) 61ENDPROC(v7wbi_flush_user_tlb_range)
62 62
@@ -69,7 +69,7 @@ ENDPROC(v7wbi_flush_user_tlb_range)
69 * - end - end address (exclusive, may not be aligned) 69 * - end - end address (exclusive, may not be aligned)
70 */ 70 */
71ENTRY(v7wbi_flush_kern_tlb_range) 71ENTRY(v7wbi_flush_kern_tlb_range)
72 dsb 72 dsb ish
73 mov r0, r0, lsr #PAGE_SHIFT @ align address 73 mov r0, r0, lsr #PAGE_SHIFT @ align address
74 mov r1, r1, lsr #PAGE_SHIFT 74 mov r1, r1, lsr #PAGE_SHIFT
75 mov r0, r0, lsl #PAGE_SHIFT 75 mov r0, r0, lsl #PAGE_SHIFT
@@ -84,7 +84,7 @@ ENTRY(v7wbi_flush_kern_tlb_range)
84 add r0, r0, #PAGE_SZ 84 add r0, r0, #PAGE_SZ
85 cmp r0, r1 85 cmp r0, r1
86 blo 1b 86 blo 1b
87 dsb 87 dsb ish
88 isb 88 isb
89 mov pc, lr 89 mov pc, lr
90ENDPROC(v7wbi_flush_kern_tlb_range) 90ENDPROC(v7wbi_flush_kern_tlb_range)
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index 8e11e96eab5e..c83f27b6bdda 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -30,6 +30,8 @@
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/spi/pxa2xx_spi.h> 31#include <linux/spi/pxa2xx_spi.h>
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/of.h>
34#include <linux/of_device.h>
33 35
34#include <asm/irq.h> 36#include <asm/irq.h>
35#include <mach/hardware.h> 37#include <mach/hardware.h>
@@ -60,6 +62,30 @@ struct ssp_device *pxa_ssp_request(int port, const char *label)
60} 62}
61EXPORT_SYMBOL(pxa_ssp_request); 63EXPORT_SYMBOL(pxa_ssp_request);
62 64
65struct ssp_device *pxa_ssp_request_of(const struct device_node *of_node,
66 const char *label)
67{
68 struct ssp_device *ssp = NULL;
69
70 mutex_lock(&ssp_lock);
71
72 list_for_each_entry(ssp, &ssp_list, node) {
73 if (ssp->of_node == of_node && ssp->use_count == 0) {
74 ssp->use_count++;
75 ssp->label = label;
76 break;
77 }
78 }
79
80 mutex_unlock(&ssp_lock);
81
82 if (&ssp->node == &ssp_list)
83 return NULL;
84
85 return ssp;
86}
87EXPORT_SYMBOL(pxa_ssp_request_of);
88
63void pxa_ssp_free(struct ssp_device *ssp) 89void pxa_ssp_free(struct ssp_device *ssp)
64{ 90{
65 mutex_lock(&ssp_lock); 91 mutex_lock(&ssp_lock);
@@ -72,96 +98,126 @@ void pxa_ssp_free(struct ssp_device *ssp)
72} 98}
73EXPORT_SYMBOL(pxa_ssp_free); 99EXPORT_SYMBOL(pxa_ssp_free);
74 100
101#ifdef CONFIG_OF
102static const struct of_device_id pxa_ssp_of_ids[] = {
103 { .compatible = "mrvl,pxa25x-ssp", .data = (void *) PXA25x_SSP },
104 { .compatible = "mvrl,pxa25x-nssp", .data = (void *) PXA25x_NSSP },
105 { .compatible = "mrvl,pxa27x-ssp", .data = (void *) PXA27x_SSP },
106 { .compatible = "mrvl,pxa3xx-ssp", .data = (void *) PXA3xx_SSP },
107 { .compatible = "mvrl,pxa168-ssp", .data = (void *) PXA168_SSP },
108 { .compatible = "mrvl,pxa910-ssp", .data = (void *) PXA910_SSP },
109 { .compatible = "mrvl,ce4100-ssp", .data = (void *) CE4100_SSP },
110 { .compatible = "mrvl,lpss-ssp", .data = (void *) LPSS_SSP },
111 { },
112};
113MODULE_DEVICE_TABLE(of, pxa_ssp_of_ids);
114#endif
115
75static int pxa_ssp_probe(struct platform_device *pdev) 116static int pxa_ssp_probe(struct platform_device *pdev)
76{ 117{
77 const struct platform_device_id *id = platform_get_device_id(pdev);
78 struct resource *res; 118 struct resource *res;
79 struct ssp_device *ssp; 119 struct ssp_device *ssp;
80 int ret = 0; 120 struct device *dev = &pdev->dev;
81 121
82 ssp = kzalloc(sizeof(struct ssp_device), GFP_KERNEL); 122 ssp = devm_kzalloc(dev, sizeof(struct ssp_device), GFP_KERNEL);
83 if (ssp == NULL) { 123 if (ssp == NULL)
84 dev_err(&pdev->dev, "failed to allocate memory");
85 return -ENOMEM; 124 return -ENOMEM;
86 }
87 ssp->pdev = pdev;
88 125
89 ssp->clk = clk_get(&pdev->dev, NULL); 126 ssp->pdev = pdev;
90 if (IS_ERR(ssp->clk)) {
91 ret = PTR_ERR(ssp->clk);
92 goto err_free;
93 }
94 127
95 res = platform_get_resource(pdev, IORESOURCE_DMA, 0); 128 ssp->clk = devm_clk_get(dev, NULL);
96 if (res == NULL) { 129 if (IS_ERR(ssp->clk))
97 dev_err(&pdev->dev, "no SSP RX DRCMR defined\n"); 130 return PTR_ERR(ssp->clk);
98 ret = -ENODEV; 131
99 goto err_free_clk; 132 if (dev->of_node) {
100 } 133 struct of_phandle_args dma_spec;
101 ssp->drcmr_rx = res->start; 134 struct device_node *np = dev->of_node;
135
136 /*
137 * FIXME: we should allocate the DMA channel from this
138 * context and pass the channel down to the ssp users.
139 * For now, we lookup the rx and tx indices manually
140 */
141
142 /* rx */
143 of_parse_phandle_with_args(np, "dmas", "#dma-cells",
144 0, &dma_spec);
145 ssp->drcmr_rx = dma_spec.args[0];
146 of_node_put(dma_spec.np);
147
148 /* tx */
149 of_parse_phandle_with_args(np, "dmas", "#dma-cells",
150 1, &dma_spec);
151 ssp->drcmr_tx = dma_spec.args[0];
152 of_node_put(dma_spec.np);
153 } else {
154 res = platform_get_resource(pdev, IORESOURCE_DMA, 0);
155 if (res == NULL) {
156 dev_err(dev, "no SSP RX DRCMR defined\n");
157 return -ENODEV;
158 }
159 ssp->drcmr_rx = res->start;
102 160
103 res = platform_get_resource(pdev, IORESOURCE_DMA, 1); 161 res = platform_get_resource(pdev, IORESOURCE_DMA, 1);
104 if (res == NULL) { 162 if (res == NULL) {
105 dev_err(&pdev->dev, "no SSP TX DRCMR defined\n"); 163 dev_err(dev, "no SSP TX DRCMR defined\n");
106 ret = -ENODEV; 164 return -ENODEV;
107 goto err_free_clk; 165 }
166 ssp->drcmr_tx = res->start;
108 } 167 }
109 ssp->drcmr_tx = res->start;
110 168
111 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 169 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
112 if (res == NULL) { 170 if (res == NULL) {
113 dev_err(&pdev->dev, "no memory resource defined\n"); 171 dev_err(dev, "no memory resource defined\n");
114 ret = -ENODEV; 172 return -ENODEV;
115 goto err_free_clk;
116 } 173 }
117 174
118 res = request_mem_region(res->start, resource_size(res), 175 res = devm_request_mem_region(dev, res->start, resource_size(res),
119 pdev->name); 176 pdev->name);
120 if (res == NULL) { 177 if (res == NULL) {
121 dev_err(&pdev->dev, "failed to request memory resource\n"); 178 dev_err(dev, "failed to request memory resource\n");
122 ret = -EBUSY; 179 return -EBUSY;
123 goto err_free_clk;
124 } 180 }
125 181
126 ssp->phys_base = res->start; 182 ssp->phys_base = res->start;
127 183
128 ssp->mmio_base = ioremap(res->start, resource_size(res)); 184 ssp->mmio_base = devm_ioremap(dev, res->start, resource_size(res));
129 if (ssp->mmio_base == NULL) { 185 if (ssp->mmio_base == NULL) {
130 dev_err(&pdev->dev, "failed to ioremap() registers\n"); 186 dev_err(dev, "failed to ioremap() registers\n");
131 ret = -ENODEV; 187 return -ENODEV;
132 goto err_free_mem;
133 } 188 }
134 189
135 ssp->irq = platform_get_irq(pdev, 0); 190 ssp->irq = platform_get_irq(pdev, 0);
136 if (ssp->irq < 0) { 191 if (ssp->irq < 0) {
137 dev_err(&pdev->dev, "no IRQ resource defined\n"); 192 dev_err(dev, "no IRQ resource defined\n");
138 ret = -ENODEV; 193 return -ENODEV;
139 goto err_free_io; 194 }
195
196 if (dev->of_node) {
197 const struct of_device_id *id =
198 of_match_device(of_match_ptr(pxa_ssp_of_ids), dev);
199 ssp->type = (int) id->data;
200 } else {
201 const struct platform_device_id *id =
202 platform_get_device_id(pdev);
203 ssp->type = (int) id->driver_data;
204
205 /* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id
206 * starts from 0, do a translation here
207 */
208 ssp->port_id = pdev->id + 1;
140 } 209 }
141 210
142 /* PXA2xx/3xx SSP ports starts from 1 and the internal pdev->id
143 * starts from 0, do a translation here
144 */
145 ssp->port_id = pdev->id + 1;
146 ssp->use_count = 0; 211 ssp->use_count = 0;
147 ssp->type = (int)id->driver_data; 212 ssp->of_node = dev->of_node;
148 213
149 mutex_lock(&ssp_lock); 214 mutex_lock(&ssp_lock);
150 list_add(&ssp->node, &ssp_list); 215 list_add(&ssp->node, &ssp_list);
151 mutex_unlock(&ssp_lock); 216 mutex_unlock(&ssp_lock);
152 217
153 platform_set_drvdata(pdev, ssp); 218 platform_set_drvdata(pdev, ssp);
154 return 0;
155 219
156err_free_io: 220 return 0;
157 iounmap(ssp->mmio_base);
158err_free_mem:
159 release_mem_region(res->start, resource_size(res));
160err_free_clk:
161 clk_put(ssp->clk);
162err_free:
163 kfree(ssp);
164 return ret;
165} 221}
166 222
167static int pxa_ssp_remove(struct platform_device *pdev) 223static int pxa_ssp_remove(struct platform_device *pdev)
@@ -201,8 +257,9 @@ static struct platform_driver pxa_ssp_driver = {
201 .probe = pxa_ssp_probe, 257 .probe = pxa_ssp_probe,
202 .remove = pxa_ssp_remove, 258 .remove = pxa_ssp_remove,
203 .driver = { 259 .driver = {
204 .owner = THIS_MODULE, 260 .owner = THIS_MODULE,
205 .name = "pxa2xx-ssp", 261 .name = "pxa2xx-ssp",
262 .of_match_table = of_match_ptr(pxa_ssp_of_ids),
206 }, 263 },
207 .id_table = ssp_id_table, 264 .id_table = ssp_id_table,
208}; 265};
diff --git a/arch/arm/plat-samsung/init.c b/arch/arm/plat-samsung/init.c
index 3e5c4619caa5..50a3ea0037db 100644
--- a/arch/arm/plat-samsung/init.c
+++ b/arch/arm/plat-samsung/init.c
@@ -55,12 +55,13 @@ void __init s3c_init_cpu(unsigned long idcode,
55 55
56 printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode); 56 printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode);
57 57
58 if (cpu->map_io == NULL || cpu->init == NULL) { 58 if (cpu->init == NULL) {
59 printk(KERN_ERR "CPU %s support not enabled\n", cpu->name); 59 printk(KERN_ERR "CPU %s support not enabled\n", cpu->name);
60 panic("Unsupported Samsung CPU"); 60 panic("Unsupported Samsung CPU");
61 } 61 }
62 62
63 cpu->map_io(); 63 if (cpu->map_io)
64 cpu->map_io();
64} 65}
65 66
66/* s3c24xx_init_clocks 67/* s3c24xx_init_clocks
diff --git a/arch/arm/plat-samsung/s3c-dma-ops.c b/arch/arm/plat-samsung/s3c-dma-ops.c
index 0cc40aea3f5a..98b10ba67dc7 100644
--- a/arch/arm/plat-samsung/s3c-dma-ops.c
+++ b/arch/arm/plat-samsung/s3c-dma-ops.c
@@ -82,7 +82,8 @@ static int s3c_dma_config(unsigned ch, struct samsung_dma_config *param)
82static int s3c_dma_prepare(unsigned ch, struct samsung_dma_prep *param) 82static int s3c_dma_prepare(unsigned ch, struct samsung_dma_prep *param)
83{ 83{
84 struct cb_data *data; 84 struct cb_data *data;
85 int len = (param->cap == DMA_CYCLIC) ? param->period : param->len; 85 dma_addr_t pos = param->buf;
86 dma_addr_t end = param->buf + param->len;
86 87
87 list_for_each_entry(data, &dma_list, node) 88 list_for_each_entry(data, &dma_list, node)
88 if (data->ch == ch) 89 if (data->ch == ch)
@@ -94,7 +95,15 @@ static int s3c_dma_prepare(unsigned ch, struct samsung_dma_prep *param)
94 data->fp_param = param->fp_param; 95 data->fp_param = param->fp_param;
95 } 96 }
96 97
97 s3c2410_dma_enqueue(ch, (void *)data, param->buf, len); 98 if (param->cap != DMA_CYCLIC) {
99 s3c2410_dma_enqueue(ch, (void *)data, param->buf, param->len);
100 return 0;
101 }
102
103 while (pos < end) {
104 s3c2410_dma_enqueue(ch, (void *)data, pos, param->period);
105 pos += param->period;
106 }
98 107
99 return 0; 108 return 0;
100} 109}
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index 8d10dc8a1e17..3e5d3115a2a6 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -78,6 +78,11 @@
78ENTRY(vfp_support_entry) 78ENTRY(vfp_support_entry)
79 DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10 79 DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10
80 80
81 ldr r3, [sp, #S_PSR] @ Neither lazy restore nor FP exceptions
82 and r3, r3, #MODE_MASK @ are supported in kernel mode
83 teq r3, #USR_MODE
84 bne vfp_kmode_exception @ Returns through lr
85
81 VFPFMRX r1, FPEXC @ Is the VFP enabled? 86 VFPFMRX r1, FPEXC @ Is the VFP enabled?
82 DBGSTR1 "fpexc %08x", r1 87 DBGSTR1 "fpexc %08x", r1
83 tst r1, #FPEXC_EN 88 tst r1, #FPEXC_EN
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 5dfbb0b8e7f4..52b8f40b1c73 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -20,6 +20,7 @@
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <linux/user.h> 22#include <linux/user.h>
23#include <linux/export.h>
23 24
24#include <asm/cp15.h> 25#include <asm/cp15.h>
25#include <asm/cputype.h> 26#include <asm/cputype.h>
@@ -648,6 +649,72 @@ static int vfp_hotplug(struct notifier_block *b, unsigned long action,
648 return NOTIFY_OK; 649 return NOTIFY_OK;
649} 650}
650 651
652void vfp_kmode_exception(void)
653{
654 /*
655 * If we reach this point, a floating point exception has been raised
656 * while running in kernel mode. If the NEON/VFP unit was enabled at the
657 * time, it means a VFP instruction has been issued that requires
658 * software assistance to complete, something which is not currently
659 * supported in kernel mode.
660 * If the NEON/VFP unit was disabled, and the location pointed to below
661 * is properly preceded by a call to kernel_neon_begin(), something has
662 * caused the task to be scheduled out and back in again. In this case,
663 * rebuilding and running with CONFIG_DEBUG_ATOMIC_SLEEP enabled should
664 * be helpful in localizing the problem.
665 */
666 if (fmrx(FPEXC) & FPEXC_EN)
667 pr_crit("BUG: unsupported FP instruction in kernel mode\n");
668 else
669 pr_crit("BUG: FP instruction issued in kernel mode with FP unit disabled\n");
670}
671
672#ifdef CONFIG_KERNEL_MODE_NEON
673
674/*
675 * Kernel-side NEON support functions
676 */
677void kernel_neon_begin(void)
678{
679 struct thread_info *thread = current_thread_info();
680 unsigned int cpu;
681 u32 fpexc;
682
683 /*
684 * Kernel mode NEON is only allowed outside of interrupt context
685 * with preemption disabled. This will make sure that the kernel
686 * mode NEON register contents never need to be preserved.
687 */
688 BUG_ON(in_interrupt());
689 cpu = get_cpu();
690
691 fpexc = fmrx(FPEXC) | FPEXC_EN;
692 fmxr(FPEXC, fpexc);
693
694 /*
695 * Save the userland NEON/VFP state. Under UP,
696 * the owner could be a task other than 'current'
697 */
698 if (vfp_state_in_hw(cpu, thread))
699 vfp_save_state(&thread->vfpstate, fpexc);
700#ifndef CONFIG_SMP
701 else if (vfp_current_hw_state[cpu] != NULL)
702 vfp_save_state(vfp_current_hw_state[cpu], fpexc);
703#endif
704 vfp_current_hw_state[cpu] = NULL;
705}
706EXPORT_SYMBOL(kernel_neon_begin);
707
708void kernel_neon_end(void)
709{
710 /* Disable the NEON/VFP unit. */
711 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
712 put_cpu();
713}
714EXPORT_SYMBOL(kernel_neon_end);
715
716#endif /* CONFIG_KERNEL_MODE_NEON */
717
651/* 718/*
652 * VFP support code initialisation. 719 * VFP support code initialisation.
653 */ 720 */
@@ -731,4 +798,4 @@ static int __init vfp_init(void)
731 return 0; 798 return 0;
732} 799}
733 800
734late_initcall(vfp_init); 801core_initcall(vfp_init);
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index c9770ba5c7df..8a6295c86209 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -170,6 +170,7 @@ static void __init xen_percpu_init(void *unused)
170 per_cpu(xen_vcpu, cpu) = vcpup; 170 per_cpu(xen_vcpu, cpu) = vcpup;
171 171
172 enable_percpu_irq(xen_events_irq, 0); 172 enable_percpu_irq(xen_events_irq, 0);
173 put_cpu();
173} 174}
174 175
175static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) 176static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)