summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 20:05:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 20:05:08 -0400
commit24e44913aa746098349370a0f279733c0cadcba7 (patch)
tree51edd7b13d889653b0400d67dd3e7e91a11db75b
parent31cc088a4f5d83481c6f5041bd6eb06115b974af (diff)
parent7e8a0f10899075ac2665c78c4e49dbaf32bf3346 (diff)
Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC platform updates from Olof Johansson: "SoC platform changes. Main theme this merge window: - The Netx platform (Netx 100/500) platform is removed by Linus Walleij-- the SoC doesn't have active maintainers with hardware, and in discussions with the vendor the agreement was that it's OK to remove. - Russell King has a series of patches that cleans up and refactors SA1101 and RiscPC support" * tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (47 commits) ARM: stm32: use "depends on" instead of "if" after prompt ARM: sa1100: convert to common clock framework ARM: exynos: Cleanup cppcheck shifting warning ARM: pxa/lubbock: remove lubbock_set_misc_wr() from global view ARM: exynos: Only build MCPM support if used arm: add missing include platform-data/atmel.h ARM: davinci: Use GPIO lookup table for DA850 LEDs ARM: OMAP2: drop explicit assembler architecture ARM: use arch_extension directive instead of arch argument ARM: imx: Switch imx7d to imx-cpufreq-dt for speed-grading ARM: bcm: Enable PINCTRL for ARCH_BRCMSTB ARM: bcm: Enable ARCH_HAS_RESET_CONTROLLER for ARCH_BRCMSTB ARM: riscpc: enable chained scatterlist support ARM: riscpc: reduce IRQ handling code ARM: riscpc: move RiscPC assembly files from arch/arm/lib to mach-rpc ARM: riscpc: parse video information from tagged list ARM: riscpc: add ecard quirk for Atomwide 3port serial card MAINTAINERS: mvebu: Add git entry soc: ti: pm33xx: Add a print while entering RTC only mode with DDR in self-refresh ARM: OMAP2+: Make some variables static ...
-rw-r--r--MAINTAINERS4
-rw-r--r--arch/arm/Kconfig14
-rw-r--r--arch/arm/Kconfig.debug7
-rw-r--r--arch/arm/Makefile1
-rw-r--r--arch/arm/configs/netx_defconfig80
-rw-r--r--arch/arm/include/debug/netx.S32
-rw-r--r--arch/arm/lib/Makefile1
-rw-r--r--arch/arm/mach-at91/pm.c1
-rw-r--r--arch/arm/mach-bcm/Kconfig2
-rw-r--r--arch/arm/mach-bcm/Makefile3
-rw-r--r--arch/arm/mach-bcm/bcm63xx_smp.c1
-rw-r--r--arch/arm/mach-bcm/bcm_kona_smc.c2
-rw-r--r--arch/arm/mach-bcm/board_bcm281xx.c1
-rw-r--r--arch/arm/mach-bcm/platsmp-brcmstb.c7
-rw-r--r--arch/arm/mach-davinci/board-da850-evm.c43
-rw-r--r--arch/arm/mach-exynos/Kconfig7
-rw-r--r--arch/arm/mach-exynos/Makefile6
-rw-r--r--arch/arm/mach-exynos/exynos-smc.S3
-rw-r--r--arch/arm/mach-exynos/sleep.S3
-rw-r--r--arch/arm/mach-exynos/suspend.c8
-rw-r--r--arch/arm/mach-highbank/Makefile3
-rw-r--r--arch/arm/mach-highbank/smc.S3
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6q.c10
-rw-r--r--arch/arm/mach-imx/mach-imx7d.c7
-rw-r--r--arch/arm/mach-keystone/Makefile3
-rw-r--r--arch/arm/mach-keystone/smc.S1
-rw-r--r--arch/arm/mach-omap2/Makefile13
-rw-r--r--arch/arm/mach-omap2/omap-headsmp.S2
-rw-r--r--arch/arm/mach-omap2/omap-smc.S3
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c8
-rw-r--r--arch/arm/mach-omap2/sleep33xx.S1
-rw-r--r--arch/arm/mach-omap2/sleep34xx.S2
-rw-r--r--arch/arm/mach-omap2/sleep43xx.S2
-rw-r--r--arch/arm/mach-omap2/sleep44xx.S3
-rw-r--r--arch/arm/mach-pxa/include/mach/lubbock.h4
-rw-r--r--arch/arm/mach-pxa/lubbock.c3
-rw-r--r--arch/arm/mach-rockchip/platsmp.c12
-rw-r--r--arch/arm/mach-rockchip/pm.c2
-rw-r--r--arch/arm/mach-rpc/Makefile3
-rw-r--r--arch/arm/mach-rpc/dma.c97
-rw-r--r--arch/arm/mach-rpc/ecard-loader.S (renamed from arch/arm/lib/ecard.S)0
-rw-r--r--arch/arm/mach-rpc/ecard.c32
-rw-r--r--arch/arm/mach-rpc/floppydma.S (renamed from arch/arm/lib/floppydma.S)0
-rw-r--r--arch/arm/mach-rpc/include/mach/uncompress.h23
-rw-r--r--arch/arm/mach-rpc/io-acorn.S (renamed from arch/arm/lib/io-acorn.S)0
-rw-r--r--arch/arm/mach-rpc/irq.c136
-rw-r--r--arch/arm/mach-rpc/time.c38
-rw-r--r--arch/arm/mach-sa1100/assabet.c91
-rw-r--r--arch/arm/mach-sa1100/badge4.c2
-rw-r--r--arch/arm/mach-sa1100/clock.c220
-rw-r--r--arch/arm/mach-sa1100/h3xxx.c64
-rw-r--r--arch/arm/mach-sa1100/hackkit.c48
-rw-r--r--arch/arm/mach-sa1100/neponset.c109
-rw-r--r--arch/arm/mach-shmobile/setup-rcar-gen2.c17
-rw-r--r--arch/arm/mach-stm32/Kconfig3
-rw-r--r--arch/arm/mach-tango/Makefile3
-rw-r--r--arch/arm/mach-tango/smc.S2
-rw-r--r--arch/arm/mach-versatile/versatile_dt.c164
-rw-r--r--arch/arm64/Kconfig.platforms3
-rw-r--r--drivers/soc/renesas/Kconfig4
-rw-r--r--drivers/soc/ti/pm33xx.c1
-rw-r--r--drivers/tty/serial/Kconfig1
-rw-r--r--drivers/tty/serial/sa1100.c46
-rw-r--r--include/linux/platform_data/video-clcd-versatile.h28
64 files changed, 492 insertions, 951 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index a63d465d3e2d..9bd4c3b154e8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1264,7 +1264,7 @@ F: include/uapi/drm/panfrost_drm.h
1264ARM MFM AND FLOPPY DRIVERS 1264ARM MFM AND FLOPPY DRIVERS
1265M: Ian Molton <spyro@f2s.com> 1265M: Ian Molton <spyro@f2s.com>
1266S: Maintained 1266S: Maintained
1267F: arch/arm/lib/floppydma.S 1267F: arch/arm/mach-rpc/floppydma.S
1268F: arch/arm/include/asm/floppy.h 1268F: arch/arm/include/asm/floppy.h
1269 1269
1270ARM PMU PROFILING AND DEBUGGING 1270ARM PMU PROFILING AND DEBUGGING
@@ -1863,6 +1863,7 @@ F: arch/arm/mach-orion5x/
1863F: arch/arm/plat-orion/ 1863F: arch/arm/plat-orion/
1864F: arch/arm/boot/dts/dove* 1864F: arch/arm/boot/dts/dove*
1865F: arch/arm/boot/dts/orion5x* 1865F: arch/arm/boot/dts/orion5x*
1866T: git git://git.infradead.org/linux-mvebu.git
1866 1867
1867ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K SOC support 1868ARM/Marvell Kirkwood and Armada 370, 375, 38x, 39x, XP, 3700, 7K/8K SOC support
1868M: Jason Cooper <jason@lakedaemon.net> 1869M: Jason Cooper <jason@lakedaemon.net>
@@ -1883,6 +1884,7 @@ F: drivers/irqchip/irq-armada-370-xp.c
1883F: drivers/irqchip/irq-mvebu-* 1884F: drivers/irqchip/irq-mvebu-*
1884F: drivers/pinctrl/mvebu/ 1885F: drivers/pinctrl/mvebu/
1885F: drivers/rtc/rtc-armada38x.c 1886F: drivers/rtc/rtc-armada38x.c
1887T: git git://git.infradead.org/linux-mvebu.git
1886 1888
1887ARM/Mediatek RTC DRIVER 1889ARM/Mediatek RTC DRIVER
1888M: Eddie Huang <eddie.huang@mediatek.com> 1890M: Eddie Huang <eddie.huang@mediatek.com>
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 600c5ba1af41..33b00579beff 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -377,15 +377,6 @@ config ARCH_FOOTBRIDGE
377 Support for systems based on the DC21285 companion chip 377 Support for systems based on the DC21285 companion chip
378 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder. 378 ("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
379 379
380config ARCH_NETX
381 bool "Hilscher NetX based"
382 select ARM_VIC
383 select CLKSRC_MMIO
384 select CPU_ARM926T
385 select GENERIC_CLOCKEVENTS
386 help
387 This enables support for systems based on the Hilscher NetX Soc
388
389config ARCH_IOP13XX 380config ARCH_IOP13XX
390 bool "IOP13xx-based" 381 bool "IOP13xx-based"
391 depends on MMU 382 depends on MMU
@@ -531,7 +522,7 @@ config ARCH_RPC
531 select ARCH_ACORN 522 select ARCH_ACORN
532 select ARCH_MAY_HAVE_PC_FDC 523 select ARCH_MAY_HAVE_PC_FDC
533 select ARCH_SPARSEMEM_ENABLE 524 select ARCH_SPARSEMEM_ENABLE
534 select ARCH_USES_GETTIMEOFFSET 525 select ARM_HAS_SG_CHAIN
535 select CPU_SA110 526 select CPU_SA110
536 select FIQ 527 select FIQ
537 select HAVE_IDE 528 select HAVE_IDE
@@ -552,6 +543,7 @@ config ARCH_SA1100
552 select CLKSRC_MMIO 543 select CLKSRC_MMIO
553 select CLKSRC_PXA 544 select CLKSRC_PXA
554 select TIMER_OF if OF 545 select TIMER_OF if OF
546 select COMMON_CLK
555 select CPU_FREQ 547 select CPU_FREQ
556 select CPU_SA1100 548 select CPU_SA1100
557 select GENERIC_CLOCKEVENTS 549 select GENERIC_CLOCKEVENTS
@@ -770,8 +762,6 @@ source "arch/arm/mach-mvebu/Kconfig"
770 762
771source "arch/arm/mach-mxs/Kconfig" 763source "arch/arm/mach-mxs/Kconfig"
772 764
773source "arch/arm/mach-netx/Kconfig"
774
775source "arch/arm/mach-nomadik/Kconfig" 765source "arch/arm/mach-nomadik/Kconfig"
776 766
777source "arch/arm/mach-npcm/Kconfig" 767source "arch/arm/mach-npcm/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 9a8862fee738..c929bea9a9ff 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -638,13 +638,6 @@ choice
638 Say Y here if you want kernel low-level debugging support 638 Say Y here if you want kernel low-level debugging support
639 for Mediatek mt8135 based platforms on UART3. 639 for Mediatek mt8135 based platforms on UART3.
640 640
641 config DEBUG_NETX_UART
642 bool "Kernel low-level debugging messages via NetX UART"
643 depends on ARCH_NETX
644 help
645 Say Y here if you want kernel low-level debugging support
646 on Hilscher NetX based platforms.
647
648 config DEBUG_NOMADIK_UART 641 config DEBUG_NOMADIK_UART
649 bool "Kernel low-level debugging messages via NOMADIK UART" 642 bool "Kernel low-level debugging messages via NOMADIK UART"
650 depends on ARCH_NOMADIK 643 depends on ARCH_NOMADIK
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index f863c6935d0e..c3624ca6c0bc 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -191,7 +191,6 @@ machine-$(CONFIG_ARCH_MXC) += imx
191machine-$(CONFIG_ARCH_MEDIATEK) += mediatek 191machine-$(CONFIG_ARCH_MEDIATEK) += mediatek
192machine-$(CONFIG_ARCH_MILBEAUT) += milbeaut 192machine-$(CONFIG_ARCH_MILBEAUT) += milbeaut
193machine-$(CONFIG_ARCH_MXS) += mxs 193machine-$(CONFIG_ARCH_MXS) += mxs
194machine-$(CONFIG_ARCH_NETX) += netx
195machine-$(CONFIG_ARCH_NOMADIK) += nomadik 194machine-$(CONFIG_ARCH_NOMADIK) += nomadik
196machine-$(CONFIG_ARCH_NPCM) += npcm 195machine-$(CONFIG_ARCH_NPCM) += npcm
197machine-$(CONFIG_ARCH_NSPIRE) += nspire 196machine-$(CONFIG_ARCH_NSPIRE) += nspire
diff --git a/arch/arm/configs/netx_defconfig b/arch/arm/configs/netx_defconfig
deleted file mode 100644
index cc5c5f9ef720..000000000000
--- a/arch/arm/configs/netx_defconfig
+++ /dev/null
@@ -1,80 +0,0 @@
1CONFIG_SYSVIPC=y
2CONFIG_POSIX_MQUEUE=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_IKCONFIG=y
5CONFIG_IKCONFIG_PROC=y
6CONFIG_SLAB=y
7CONFIG_MODULES=y
8CONFIG_MODULE_UNLOAD=y
9CONFIG_MODULE_FORCE_UNLOAD=y
10CONFIG_ARCH_NETX=y
11CONFIG_MACH_NXDKN=y
12CONFIG_MACH_NXDB500=y
13CONFIG_MACH_NXEB500HMI=y
14CONFIG_PREEMPT=y
15CONFIG_ZBOOT_ROM_TEXT=0x0
16CONFIG_ZBOOT_ROM_BSS=0x0
17CONFIG_CMDLINE="console=ttySMX0,115200"
18CONFIG_NET=y
19CONFIG_PACKET=y
20CONFIG_UNIX=y
21CONFIG_XFRM_USER=m
22CONFIG_NET_KEY=y
23CONFIG_INET=y
24CONFIG_IP_MULTICAST=y
25CONFIG_IP_PNP=y
26CONFIG_IP_PNP_DHCP=y
27CONFIG_NET_IPGRE=m
28CONFIG_SYN_COOKIES=y
29CONFIG_INET_AH=y
30CONFIG_INET_ESP=y
31CONFIG_INET_IPCOMP=y
32CONFIG_INET6_AH=m
33CONFIG_INET6_ESP=m
34CONFIG_INET6_IPCOMP=m
35CONFIG_NETFILTER=y
36CONFIG_NET_PKTGEN=m
37CONFIG_MTD=y
38CONFIG_MTD_CMDLINE_PARTS=y
39CONFIG_MTD_BLOCK=y
40CONFIG_MTD_CFI=y
41CONFIG_MTD_CFI_INTELEXT=y
42CONFIG_MTD_PLATRAM=y
43CONFIG_BLK_DEV_LOOP=m
44CONFIG_BLK_DEV_CRYPTOLOOP=m
45CONFIG_NETDEVICES=y
46CONFIG_NET_ETHERNET=y
47CONFIG_NET_NETX=y
48# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
49# CONFIG_INPUT_KEYBOARD is not set
50# CONFIG_INPUT_MOUSE is not set
51CONFIG_SERIAL_NETX=y
52CONFIG_SERIAL_NETX_CONSOLE=y
53# CONFIG_HWMON is not set
54CONFIG_FB=y
55CONFIG_FB_ARMCLCD=y
56# CONFIG_VGA_CONSOLE is not set
57CONFIG_FRAMEBUFFER_CONSOLE=y
58CONFIG_LOGO=y
59CONFIG_RTC_CLASS=y
60CONFIG_TMPFS=y
61CONFIG_JFFS2_FS=y
62CONFIG_NFS_FS=y
63CONFIG_NFS_V3=y
64CONFIG_NFS_V4=y
65CONFIG_ROOT_NFS=y
66CONFIG_MAGIC_SYSRQ=y
67CONFIG_DEBUG_KERNEL=y
68CONFIG_CRYPTO_NULL=m
69CONFIG_CRYPTO_MD4=m
70CONFIG_CRYPTO_MICHAEL_MIC=m
71CONFIG_CRYPTO_SHA256=m
72CONFIG_CRYPTO_SHA512=m
73CONFIG_CRYPTO_ARC4=m
74CONFIG_CRYPTO_BLOWFISH=m
75CONFIG_CRYPTO_CAST5=m
76CONFIG_CRYPTO_CAST6=m
77CONFIG_CRYPTO_SERPENT=m
78CONFIG_CRYPTO_TWOFISH=m
79CONFIG_CRC_CCITT=m
80CONFIG_LIBCRC32C=m
diff --git a/arch/arm/include/debug/netx.S b/arch/arm/include/debug/netx.S
deleted file mode 100644
index 08afc58885d3..000000000000
--- a/arch/arm/include/debug/netx.S
+++ /dev/null
@@ -1,32 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-only */
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
9#define UART_DATA 0
10#define UART_FLAG 0x18
11#define UART_FLAG_BUSY (1 << 3)
12
13 .macro addruart, rp, rv, tmp
14 ldr \rp, =CONFIG_DEBUG_UART_PHYS
15 ldr \rv, =CONFIG_DEBUG_UART_VIRT
16 .endm
17
18 .macro senduart,rd,rx
19 str \rd, [\rx, #UART_DATA]
20 .endm
21
22 .macro busyuart,rd,rx
231002: ldr \rd, [\rx, #UART_FLAG]
24 tst \rd, #UART_FLAG_BUSY
25 bne 1002b
26 .endm
27
28 .macro waituart,rd,rx
291001: ldr \rd, [\rx, #UART_FLAG]
30 tst \rd, #UART_FLAG_BUSY
31 bne 1001b
32 .endm
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 0bff0176db2c..b25c54585048 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -31,7 +31,6 @@ else
31endif 31endif
32 32
33ifeq ($(CONFIG_ARCH_RPC),y) 33ifeq ($(CONFIG_ARCH_RPC),y)
34 lib-y += ecard.o io-acorn.o floppydma.o
35 AFLAGS_delay-loop.o += -march=armv4 34 AFLAGS_delay-loop.o += -march=armv4
36endif 35endif
37 36
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index da85e64143e9..d5af6aedc02c 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -15,6 +15,7 @@
15#include <linux/suspend.h> 15#include <linux/suspend.h>
16 16
17#include <linux/clk/at91_pmc.h> 17#include <linux/clk/at91_pmc.h>
18#include <linux/platform_data/atmel.h>
18 19
19#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
20#include <asm/fncpy.h> 21#include <asm/fncpy.h>
diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig
index 4ef1e55f4a0b..5e5f1fabc3d4 100644
--- a/arch/arm/mach-bcm/Kconfig
+++ b/arch/arm/mach-bcm/Kconfig
@@ -208,6 +208,7 @@ config ARCH_BCM_63XX
208config ARCH_BRCMSTB 208config ARCH_BRCMSTB
209 bool "Broadcom BCM7XXX based boards" 209 bool "Broadcom BCM7XXX based boards"
210 depends on ARCH_MULTI_V7 210 depends on ARCH_MULTI_V7
211 select ARCH_HAS_RESET_CONTROLLER
211 select ARM_GIC 212 select ARM_GIC
212 select ARM_ERRATA_798181 if SMP 213 select ARM_ERRATA_798181 if SMP
213 select HAVE_ARM_ARCH_TIMER 214 select HAVE_ARM_ARCH_TIMER
@@ -217,6 +218,7 @@ config ARCH_BRCMSTB
217 select ZONE_DMA if ARM_LPAE 218 select ZONE_DMA if ARM_LPAE
218 select SOC_BRCMSTB 219 select SOC_BRCMSTB
219 select SOC_BUS 220 select SOC_BUS
221 select PINCTRL
220 help 222 help
221 Say Y if you intend to run the kernel on a Broadcom ARM-based STB 223 Say Y if you intend to run the kernel on a Broadcom ARM-based STB
222 chipset. 224 chipset.
diff --git a/arch/arm/mach-bcm/Makefile b/arch/arm/mach-bcm/Makefile
index 8fd23b263c60..b59c813b1af4 100644
--- a/arch/arm/mach-bcm/Makefile
+++ b/arch/arm/mach-bcm/Makefile
@@ -40,9 +40,6 @@ obj-$(CONFIG_ARCH_BCM_MOBILE_L2_CACHE) += kona_l2_cache.o
40 40
41# Support for secure monitor traps 41# Support for secure monitor traps
42obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o 42obj-$(CONFIG_ARCH_BCM_MOBILE_SMC) += bcm_kona_smc.o
43ifeq ($(call as-instr,.arch_extension sec,as_has_sec),as_has_sec)
44CFLAGS_bcm_kona_smc.o += -Wa,-march=armv7-a+sec -DREQUIRES_SEC
45endif
46 43
47# BCM2835 44# BCM2835
48obj-$(CONFIG_ARCH_BCM2835) += board_bcm2835.o 45obj-$(CONFIG_ARCH_BCM2835) += board_bcm2835.o
diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
index 83dd0c10fa47..641e1f8fcf5e 100644
--- a/arch/arm/mach-bcm/bcm63xx_smp.c
+++ b/arch/arm/mach-bcm/bcm63xx_smp.c
@@ -141,6 +141,7 @@ static int bcm63138_smp_boot_secondary(unsigned int cpu,
141 * return 141 * return
142 */ 142 */
143 ret = bcm63xx_pmb_power_on_cpu(dn); 143 ret = bcm63xx_pmb_power_on_cpu(dn);
144 of_node_put(dn);
144 if (ret) 145 if (ret)
145 goto out; 146 goto out;
146out: 147out:
diff --git a/arch/arm/mach-bcm/bcm_kona_smc.c b/arch/arm/mach-bcm/bcm_kona_smc.c
index a55a7ecf146a..541e850a736c 100644
--- a/arch/arm/mach-bcm/bcm_kona_smc.c
+++ b/arch/arm/mach-bcm/bcm_kona_smc.c
@@ -125,9 +125,7 @@ static int bcm_kona_do_smc(u32 service_id, u32 buffer_phys)
125 __asmeq("%2", "r4") 125 __asmeq("%2", "r4")
126 __asmeq("%3", "r5") 126 __asmeq("%3", "r5")
127 __asmeq("%4", "r6") 127 __asmeq("%4", "r6")
128#ifdef REQUIRES_SEC
129 ".arch_extension sec\n" 128 ".arch_extension sec\n"
130#endif
131 " smc #0\n" 129 " smc #0\n"
132 : "=r" (ip), "=r" (r0) 130 : "=r" (ip), "=r" (r0)
133 : "r" (r4), "r" (r5), "r" (r6) 131 : "r" (r4), "r" (r5), "r" (r6)
diff --git a/arch/arm/mach-bcm/board_bcm281xx.c b/arch/arm/mach-bcm/board_bcm281xx.c
index b81bb386951d..1238ac801530 100644
--- a/arch/arm/mach-bcm/board_bcm281xx.c
+++ b/arch/arm/mach-bcm/board_bcm281xx.c
@@ -38,6 +38,7 @@ static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)
38 return; 38 return;
39 } 39 }
40 base = of_iomap(np_wdog, 0); 40 base = of_iomap(np_wdog, 0);
41 of_node_put(np_wdog);
41 if (!base) { 42 if (!base) {
42 pr_emerg("Couldn't map brcm,kona-wdt\n"); 43 pr_emerg("Couldn't map brcm,kona-wdt\n");
43 return; 44 return;
diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c b/arch/arm/mach-bcm/platsmp-brcmstb.c
index 12379960e982..4555f21e7077 100644
--- a/arch/arm/mach-bcm/platsmp-brcmstb.c
+++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
@@ -334,11 +334,14 @@ static void __init brcmstb_cpu_ctrl_setup(unsigned int max_cpus)
334 334
335 rc = setup_hifcpubiuctrl_regs(np); 335 rc = setup_hifcpubiuctrl_regs(np);
336 if (rc) 336 if (rc)
337 return; 337 goto out_put_node;
338 338
339 rc = setup_hifcont_regs(np); 339 rc = setup_hifcont_regs(np);
340 if (rc) 340 if (rc)
341 return; 341 goto out_put_node;
342
343out_put_node:
344 of_node_put(np);
342} 345}
343 346
344static int brcmstb_boot_secondary(unsigned int cpu, struct task_struct *idle) 347static int brcmstb_boot_secondary(unsigned int cpu, struct task_struct *idle)
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index 31ae3be5741d..0628e7d7dcf3 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -631,13 +631,12 @@ static void da850_evm_bb_keys_init(unsigned gpio)
631 } 631 }
632} 632}
633 633
634#define DA850_N_BB_USER_LED 2
635
636static struct gpio_led da850_evm_bb_leds[] = { 634static struct gpio_led da850_evm_bb_leds[] = {
637 [0 ... DA850_N_BB_USER_LED - 1] = { 635 {
638 .active_low = 1, 636 .name = "user_led2",
639 .gpio = -1, /* assigned at runtime */ 637 },
640 .name = NULL, /* assigned at runtime */ 638 {
639 .name = "user_led1",
641 }, 640 },
642}; 641};
643 642
@@ -646,6 +645,20 @@ static struct gpio_led_platform_data da850_evm_bb_leds_pdata = {
646 .num_leds = ARRAY_SIZE(da850_evm_bb_leds), 645 .num_leds = ARRAY_SIZE(da850_evm_bb_leds),
647}; 646};
648 647
648static struct gpiod_lookup_table da850_evm_bb_leds_gpio_table = {
649 .dev_id = "leds-gpio",
650 .table = {
651 GPIO_LOOKUP_IDX("i2c-bb-expander",
652 DA850_EVM_BB_EXP_USER_LED2, NULL,
653 0, GPIO_ACTIVE_LOW),
654 GPIO_LOOKUP_IDX("i2c-bb-expander",
655 DA850_EVM_BB_EXP_USER_LED2 + 1, NULL,
656 1, GPIO_ACTIVE_LOW),
657
658 { },
659 },
660};
661
649static struct platform_device da850_evm_bb_leds_device = { 662static struct platform_device da850_evm_bb_leds_device = {
650 .name = "leds-gpio", 663 .name = "leds-gpio",
651 .id = -1, 664 .id = -1,
@@ -654,20 +667,6 @@ static struct platform_device da850_evm_bb_leds_device = {
654 } 667 }
655}; 668};
656 669
657static void da850_evm_bb_leds_init(unsigned gpio)
658{
659 int i;
660 struct gpio_led *led;
661
662 for (i = 0; i < DA850_N_BB_USER_LED; i++) {
663 led = &da850_evm_bb_leds[i];
664
665 led->gpio = gpio + DA850_EVM_BB_EXP_USER_LED2 + i;
666 led->name =
667 da850_evm_bb_exp[DA850_EVM_BB_EXP_USER_LED2 + i];
668 }
669}
670
671static int da850_evm_bb_expander_setup(struct i2c_client *client, 670static int da850_evm_bb_expander_setup(struct i2c_client *client,
672 unsigned gpio, unsigned ngpio, 671 unsigned gpio, unsigned ngpio,
673 void *c) 672 void *c)
@@ -685,7 +684,7 @@ static int da850_evm_bb_expander_setup(struct i2c_client *client,
685 goto io_exp_setup_sw_fail; 684 goto io_exp_setup_sw_fail;
686 } 685 }
687 686
688 da850_evm_bb_leds_init(gpio); 687 gpiod_add_lookup_table(&da850_evm_bb_leds_gpio_table);
689 ret = platform_device_register(&da850_evm_bb_leds_device); 688 ret = platform_device_register(&da850_evm_bb_leds_device);
690 if (ret) { 689 if (ret) {
691 pr_warn("Could not register baseboard GPIO expander LEDs"); 690 pr_warn("Could not register baseboard GPIO expander LEDs");
@@ -729,10 +728,12 @@ static struct i2c_board_info __initdata da850_evm_i2c_devices[] = {
729 }, 728 },
730 { 729 {
731 I2C_BOARD_INFO("tca6416", 0x20), 730 I2C_BOARD_INFO("tca6416", 0x20),
731 .dev_name = "ui-expander",
732 .platform_data = &da850_evm_ui_expander_info, 732 .platform_data = &da850_evm_ui_expander_info,
733 }, 733 },
734 { 734 {
735 I2C_BOARD_INFO("tca6416", 0x21), 735 I2C_BOARD_INFO("tca6416", 0x21),
736 .dev_name = "bb-expander",
736 .platform_data = &da850_evm_bb_expander_info, 737 .platform_data = &da850_evm_bb_expander_info,
737 }, 738 },
738}; 739};
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 1c518b8ee520..d7422233a130 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -49,6 +49,7 @@ config S5P_DEV_MFC
49 49
50config ARCH_EXYNOS3 50config ARCH_EXYNOS3
51 bool "SAMSUNG EXYNOS3" 51 bool "SAMSUNG EXYNOS3"
52 default y
52 select ARM_CPU_SUSPEND if PM 53 select ARM_CPU_SUSPEND if PM
53 help 54 help
54 Samsung EXYNOS3 (Cortex-A7) SoC based systems 55 Samsung EXYNOS3 (Cortex-A7) SoC based systems
@@ -106,7 +107,7 @@ config SOC_EXYNOS5420
106 bool "SAMSUNG EXYNOS5420" 107 bool "SAMSUNG EXYNOS5420"
107 default y 108 default y
108 depends on ARCH_EXYNOS5 109 depends on ARCH_EXYNOS5
109 select MCPM if SMP 110 select EXYNOS_MCPM if SMP
110 select ARM_CCI400_PORT_CTRL 111 select ARM_CCI400_PORT_CTRL
111 select ARM_CPU_SUSPEND 112 select ARM_CPU_SUSPEND
112 113
@@ -115,6 +116,10 @@ config SOC_EXYNOS5800
115 default y 116 default y
116 depends on SOC_EXYNOS5420 117 depends on SOC_EXYNOS5420
117 118
119config EXYNOS_MCPM
120 bool
121 select MCPM
122
118config EXYNOS_CPU_SUSPEND 123config EXYNOS_CPU_SUSPEND
119 bool 124 bool
120 select ARM_CPU_SUSPEND 125 select ARM_CPU_SUSPEND
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile
index 264dbaa89c3d..0fd3fcf8bfb0 100644
--- a/arch/arm/mach-exynos/Makefile
+++ b/arch/arm/mach-exynos/Makefile
@@ -14,9 +14,5 @@ obj-$(CONFIG_PM_SLEEP) += suspend.o
14 14
15obj-$(CONFIG_SMP) += platsmp.o headsmp.o 15obj-$(CONFIG_SMP) += platsmp.o headsmp.o
16 16
17plus_sec := $(call as-instr,.arch_extension sec,+sec) 17obj-$(CONFIG_EXYNOS_MCPM) += mcpm-exynos.o
18AFLAGS_exynos-smc.o :=-Wa,-march=armv7-a$(plus_sec)
19AFLAGS_sleep.o :=-Wa,-march=armv7-a$(plus_sec)
20
21obj-$(CONFIG_MCPM) += mcpm-exynos.o
22CFLAGS_mcpm-exynos.o += -march=armv7-a 18CFLAGS_mcpm-exynos.o += -march=armv7-a
diff --git a/arch/arm/mach-exynos/exynos-smc.S b/arch/arm/mach-exynos/exynos-smc.S
index d259532ba937..6da31e6a7acb 100644
--- a/arch/arm/mach-exynos/exynos-smc.S
+++ b/arch/arm/mach-exynos/exynos-smc.S
@@ -10,7 +10,8 @@
10/* 10/*
11 * Function signature: void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3) 11 * Function signature: void exynos_smc(u32 cmd, u32 arg1, u32 arg2, u32 arg3)
12 */ 12 */
13 13 .arch armv7-a
14 .arch_extension sec
14ENTRY(exynos_smc) 15ENTRY(exynos_smc)
15 stmfd sp!, {r4-r11, lr} 16 stmfd sp!, {r4-r11, lr}
16 dsb 17 dsb
diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S
index 2783c3a0c06a..ed93f91853b8 100644
--- a/arch/arm/mach-exynos/sleep.S
+++ b/arch/arm/mach-exynos/sleep.S
@@ -44,7 +44,8 @@ ENTRY(exynos_cpu_resume)
44ENDPROC(exynos_cpu_resume) 44ENDPROC(exynos_cpu_resume)
45 45
46 .align 46 .align
47 47 .arch armv7-a
48 .arch_extension sec
48ENTRY(exynos_cpu_resume_ns) 49ENTRY(exynos_cpu_resume_ns)
49 mrc p15, 0, r0, c0, c0, 0 50 mrc p15, 0, r0, c0, c0, 0
50 ldr r1, =CPU_MASK 51 ldr r1, =CPU_MASK
diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c
index be122af0de8f..6a0d3448ea00 100644
--- a/arch/arm/mach-exynos/suspend.c
+++ b/arch/arm/mach-exynos/suspend.c
@@ -268,7 +268,7 @@ static int exynos5420_cpu_suspend(unsigned long arg)
268 unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 268 unsigned int cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
269 unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 269 unsigned int cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
270 270
271 if (IS_ENABLED(CONFIG_MCPM)) { 271 if (IS_ENABLED(CONFIG_EXYNOS_MCPM)) {
272 mcpm_set_entry_vector(cpu, cluster, exynos_cpu_resume); 272 mcpm_set_entry_vector(cpu, cluster, exynos_cpu_resume);
273 mcpm_cpu_suspend(); 273 mcpm_cpu_suspend();
274 } 274 }
@@ -285,7 +285,7 @@ static void exynos_pm_set_wakeup_mask(void)
285 * Set wake-up mask registers 285 * Set wake-up mask registers
286 * EXYNOS_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend. 286 * EXYNOS_EINT_WAKEUP_MASK is set by pinctrl driver in late suspend.
287 */ 287 */
288 pmu_raw_writel(exynos_irqwake_intmask & ~(1 << 31), S5P_WAKEUP_MASK); 288 pmu_raw_writel(exynos_irqwake_intmask & ~BIT(31), S5P_WAKEUP_MASK);
289} 289}
290 290
291static void exynos_pm_enter_sleep_mode(void) 291static void exynos_pm_enter_sleep_mode(void)
@@ -351,7 +351,7 @@ static void exynos5420_pm_prepare(void)
351 exynos_pm_enter_sleep_mode(); 351 exynos_pm_enter_sleep_mode();
352 352
353 /* ensure at least INFORM0 has the resume address */ 353 /* ensure at least INFORM0 has the resume address */
354 if (IS_ENABLED(CONFIG_MCPM)) 354 if (IS_ENABLED(CONFIG_EXYNOS_MCPM))
355 pmu_raw_writel(__pa_symbol(mcpm_entry_point), S5P_INFORM0); 355 pmu_raw_writel(__pa_symbol(mcpm_entry_point), S5P_INFORM0);
356 356
357 tmp = pmu_raw_readl(EXYNOS_L2_OPTION(0)); 357 tmp = pmu_raw_readl(EXYNOS_L2_OPTION(0));
@@ -455,7 +455,7 @@ static void exynos5420_prepare_pm_resume(void)
455 mpidr = read_cpuid_mpidr(); 455 mpidr = read_cpuid_mpidr();
456 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 456 cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
457 457
458 if (IS_ENABLED(CONFIG_MCPM)) 458 if (IS_ENABLED(CONFIG_EXYNOS_MCPM))
459 WARN_ON(mcpm_cpu_powered_up()); 459 WARN_ON(mcpm_cpu_powered_up());
460 460
461 if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) { 461 if (IS_ENABLED(CONFIG_HW_PERF_EVENTS) && cluster != 0) {
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile
index 7e6732c16862..71cc68041d92 100644
--- a/arch/arm/mach-highbank/Makefile
+++ b/arch/arm/mach-highbank/Makefile
@@ -1,7 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2obj-y := highbank.o system.o smc.o 2obj-y := highbank.o system.o smc.o
3 3
4plus_sec := $(call as-instr,.arch_extension sec,+sec)
5AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec)
6
7obj-$(CONFIG_PM_SLEEP) += pm.o 4obj-$(CONFIG_PM_SLEEP) += pm.o
diff --git a/arch/arm/mach-highbank/smc.S b/arch/arm/mach-highbank/smc.S
index b16c0442e812..78b3f19e7f37 100644
--- a/arch/arm/mach-highbank/smc.S
+++ b/arch/arm/mach-highbank/smc.S
@@ -13,7 +13,8 @@
13 * the monitor API number. 13 * the monitor API number.
14 * Function signature : void highbank_smc1(u32 fn, u32 arg) 14 * Function signature : void highbank_smc1(u32 fn, u32 arg)
15 */ 15 */
16 16 .arch armv7-a
17 .arch_extension sec
17ENTRY(highbank_smc1) 18ENTRY(highbank_smc1)
18 stmfd sp!, {r4-r11, lr} 19 stmfd sp!, {r4-r11, lr}
19 mov r12, r0 20 mov r12, r0
diff --git a/arch/arm/mach-imx/cpuidle-imx6q.c b/arch/arm/mach-imx/cpuidle-imx6q.c
index a2441ed6b673..39a7d9393641 100644
--- a/arch/arm/mach-imx/cpuidle-imx6q.c
+++ b/arch/arm/mach-imx/cpuidle-imx6q.c
@@ -14,22 +14,22 @@
14#include "hardware.h" 14#include "hardware.h"
15 15
16static int num_idle_cpus = 0; 16static int num_idle_cpus = 0;
17static DEFINE_SPINLOCK(cpuidle_lock); 17static DEFINE_RAW_SPINLOCK(cpuidle_lock);
18 18
19static int imx6q_enter_wait(struct cpuidle_device *dev, 19static int imx6q_enter_wait(struct cpuidle_device *dev,
20 struct cpuidle_driver *drv, int index) 20 struct cpuidle_driver *drv, int index)
21{ 21{
22 spin_lock(&cpuidle_lock); 22 raw_spin_lock(&cpuidle_lock);
23 if (++num_idle_cpus == num_online_cpus()) 23 if (++num_idle_cpus == num_online_cpus())
24 imx6_set_lpm(WAIT_UNCLOCKED); 24 imx6_set_lpm(WAIT_UNCLOCKED);
25 spin_unlock(&cpuidle_lock); 25 raw_spin_unlock(&cpuidle_lock);
26 26
27 cpu_do_idle(); 27 cpu_do_idle();
28 28
29 spin_lock(&cpuidle_lock); 29 raw_spin_lock(&cpuidle_lock);
30 if (num_idle_cpus-- == num_online_cpus()) 30 if (num_idle_cpus-- == num_online_cpus())
31 imx6_set_lpm(WAIT_CLOCKED); 31 imx6_set_lpm(WAIT_CLOCKED);
32 spin_unlock(&cpuidle_lock); 32 raw_spin_unlock(&cpuidle_lock);
33 33
34 return index; 34 return index;
35} 35}
diff --git a/arch/arm/mach-imx/mach-imx7d.c b/arch/arm/mach-imx/mach-imx7d.c
index dec5d90a66ce..95713450591a 100644
--- a/arch/arm/mach-imx/mach-imx7d.c
+++ b/arch/arm/mach-imx/mach-imx7d.c
@@ -94,6 +94,12 @@ static void __init imx7d_init_machine(void)
94 imx7d_enet_init(); 94 imx7d_enet_init();
95} 95}
96 96
97static void __init imx7d_init_late(void)
98{
99 if (IS_ENABLED(CONFIG_ARM_IMX_CPUFREQ_DT))
100 platform_device_register_simple("imx-cpufreq-dt", -1, NULL, 0);
101}
102
97static void __init imx7d_init_irq(void) 103static void __init imx7d_init_irq(void)
98{ 104{
99 imx_init_revision_from_anatop(); 105 imx_init_revision_from_anatop();
@@ -110,5 +116,6 @@ static const char *const imx7d_dt_compat[] __initconst = {
110DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)") 116DT_MACHINE_START(IMX7D, "Freescale i.MX7 Dual (Device Tree)")
111 .init_irq = imx7d_init_irq, 117 .init_irq = imx7d_init_irq,
112 .init_machine = imx7d_init_machine, 118 .init_machine = imx7d_init_machine,
119 .init_late = imx7d_init_late,
113 .dt_compat = imx7d_dt_compat, 120 .dt_compat = imx7d_dt_compat,
114MACHINE_END 121MACHINE_END
diff --git a/arch/arm/mach-keystone/Makefile b/arch/arm/mach-keystone/Makefile
index f8b0dccac8dc..739b38be5696 100644
--- a/arch/arm/mach-keystone/Makefile
+++ b/arch/arm/mach-keystone/Makefile
@@ -1,9 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2obj-y := keystone.o smc.o 2obj-y := keystone.o smc.o
3 3
4plus_sec := $(call as-instr,.arch_extension sec,+sec)
5AFLAGS_smc.o :=-Wa,-march=armv7-a$(plus_sec)
6
7obj-$(CONFIG_SMP) += platsmp.o 4obj-$(CONFIG_SMP) += platsmp.o
8 5
9# PM domain driver for Keystone SOCs 6# PM domain driver for Keystone SOCs
diff --git a/arch/arm/mach-keystone/smc.S b/arch/arm/mach-keystone/smc.S
index 76d0bf6ac73c..21ef75cf5370 100644
--- a/arch/arm/mach-keystone/smc.S
+++ b/arch/arm/mach-keystone/smc.S
@@ -18,6 +18,7 @@
18 * 18 *
19 * Return: Non zero value on failure 19 * Return: Non zero value on failure
20 */ 20 */
21 .arch_extension sec
21ENTRY(keystone_cpu_smc) 22ENTRY(keystone_cpu_smc)
22 stmfd sp!, {r4-r11, lr} 23 stmfd sp!, {r4-r11, lr}
23 smc #0 24 smc #0
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 85d1b13c9215..600650551621 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -41,18 +41,10 @@ obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-common) $(smp-y) sleep44xx.o
41obj-$(CONFIG_SOC_AM43XX) += $(omap-4-5-common) 41obj-$(CONFIG_SOC_AM43XX) += $(omap-4-5-common)
42obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-common) $(smp-y) sleep44xx.o 42obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-common) $(smp-y) sleep44xx.o
43 43
44plus_sec := $(call as-instr,.arch_extension sec,+sec)
45AFLAGS_omap-headsmp.o :=-Wa,-march=armv7-a$(plus_sec)
46AFLAGS_omap-smc.o :=-Wa,-march=armv7-a$(plus_sec)
47AFLAGS_sleep44xx.o :=-Wa,-march=armv7-a$(plus_sec)
48
49# Functions loaded to SRAM 44# Functions loaded to SRAM
50obj-$(CONFIG_SOC_OMAP2420) += sram242x.o 45obj-$(CONFIG_SOC_OMAP2420) += sram242x.o
51obj-$(CONFIG_SOC_OMAP2430) += sram243x.o 46obj-$(CONFIG_SOC_OMAP2430) += sram243x.o
52 47
53AFLAGS_sram242x.o :=-Wa,-march=armv6
54AFLAGS_sram243x.o :=-Wa,-march=armv6
55
56# Restart code (OMAP4/5 currently in omap4-common.c) 48# Restart code (OMAP4/5 currently in omap4-common.c)
57obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o 49obj-$(CONFIG_SOC_OMAP2420) += omap2-restart.o
58obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o 50obj-$(CONFIG_SOC_OMAP2430) += omap2-restart.o
@@ -94,11 +86,6 @@ obj-$(CONFIG_PM_DEBUG) += pm-debug.o
94obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o 86obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o
95obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o 87obj-$(CONFIG_POWER_AVS_OMAP_CLASS3) += smartreflex-class3.o
96 88
97AFLAGS_sleep24xx.o :=-Wa,-march=armv6
98AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec)
99AFLAGS_sleep33xx.o :=-Wa,-march=armv7-a$(plus_sec)
100AFLAGS_sleep43xx.o :=-Wa,-march=armv7-a$(plus_sec)
101
102endif 89endif
103 90
104ifeq ($(CONFIG_CPU_IDLE),y) 91ifeq ($(CONFIG_CPU_IDLE),y)
diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S
index 7d0db77ab8cb..1762f919941f 100644
--- a/arch/arm/mach-omap2/omap-headsmp.S
+++ b/arch/arm/mach-omap2/omap-headsmp.S
@@ -55,6 +55,8 @@ ENDPROC(omap5_secondary_startup)
55 * omap5_secondary_startup if the primary CPU was put into HYP mode by 55 * omap5_secondary_startup if the primary CPU was put into HYP mode by
56 * the boot loader. 56 * the boot loader.
57 */ 57 */
58 .arch armv7-a
59 .arch_extension sec
58ENTRY(omap5_secondary_hyp_startup) 60ENTRY(omap5_secondary_hyp_startup)
59wait_2: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0 61wait_2: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0
60 ldr r0, [r2] 62 ldr r0, [r2]
diff --git a/arch/arm/mach-omap2/omap-smc.S b/arch/arm/mach-omap2/omap-smc.S
index 630b9bd099e0..fd2bcd91f4a1 100644
--- a/arch/arm/mach-omap2/omap-smc.S
+++ b/arch/arm/mach-omap2/omap-smc.S
@@ -20,7 +20,8 @@
20 * link register "lr". 20 * link register "lr".
21 * Function signature : void omap_smc1(u32 fn, u32 arg) 21 * Function signature : void omap_smc1(u32 fn, u32 arg)
22 */ 22 */
23 23 .arch armv7-a
24 .arch_extension sec
24ENTRY(omap_smc1) 25ENTRY(omap_smc1)
25 stmfd sp!, {r2-r12, lr} 26 stmfd sp!, {r2-r12, lr}
26 mov r12, r0 27 mov r12, r0
diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
index 4c3543bae562..adb6271f819b 100644
--- a/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
@@ -529,7 +529,7 @@ static struct omap_hwmod_class_sysconfig am33xx_gpio_sysc = {
529 .sysc_fields = &omap_hwmod_sysc_type1, 529 .sysc_fields = &omap_hwmod_sysc_type1,
530}; 530};
531 531
532struct omap_hwmod_class am33xx_gpio_hwmod_class = { 532static struct omap_hwmod_class am33xx_gpio_hwmod_class = {
533 .name = "gpio", 533 .name = "gpio",
534 .sysc = &am33xx_gpio_sysc, 534 .sysc = &am33xx_gpio_sysc,
535}; 535};
@@ -539,7 +539,7 @@ static struct omap_hwmod_opt_clk gpio1_opt_clks[] = {
539 { .role = "dbclk", .clk = "gpio1_dbclk" }, 539 { .role = "dbclk", .clk = "gpio1_dbclk" },
540}; 540};
541 541
542struct omap_hwmod am33xx_gpio1_hwmod = { 542static struct omap_hwmod am33xx_gpio1_hwmod = {
543 .name = "gpio2", 543 .name = "gpio2",
544 .class = &am33xx_gpio_hwmod_class, 544 .class = &am33xx_gpio_hwmod_class,
545 .clkdm_name = "l4ls_clkdm", 545 .clkdm_name = "l4ls_clkdm",
@@ -559,7 +559,7 @@ static struct omap_hwmod_opt_clk gpio2_opt_clks[] = {
559 { .role = "dbclk", .clk = "gpio2_dbclk" }, 559 { .role = "dbclk", .clk = "gpio2_dbclk" },
560}; 560};
561 561
562struct omap_hwmod am33xx_gpio2_hwmod = { 562static struct omap_hwmod am33xx_gpio2_hwmod = {
563 .name = "gpio3", 563 .name = "gpio3",
564 .class = &am33xx_gpio_hwmod_class, 564 .class = &am33xx_gpio_hwmod_class,
565 .clkdm_name = "l4ls_clkdm", 565 .clkdm_name = "l4ls_clkdm",
@@ -579,7 +579,7 @@ static struct omap_hwmod_opt_clk gpio3_opt_clks[] = {
579 { .role = "dbclk", .clk = "gpio3_dbclk" }, 579 { .role = "dbclk", .clk = "gpio3_dbclk" },
580}; 580};
581 581
582struct omap_hwmod am33xx_gpio3_hwmod = { 582static struct omap_hwmod am33xx_gpio3_hwmod = {
583 .name = "gpio4", 583 .name = "gpio4",
584 .class = &am33xx_gpio_hwmod_class, 584 .class = &am33xx_gpio_hwmod_class,
585 .clkdm_name = "l4ls_clkdm", 585 .clkdm_name = "l4ls_clkdm",
diff --git a/arch/arm/mach-omap2/sleep33xx.S b/arch/arm/mach-omap2/sleep33xx.S
index 47a816468cdb..68fee339d3f1 100644
--- a/arch/arm/mach-omap2/sleep33xx.S
+++ b/arch/arm/mach-omap2/sleep33xx.S
@@ -24,6 +24,7 @@
24#define BIT(nr) (1 << (nr)) 24#define BIT(nr) (1 << (nr))
25 25
26 .arm 26 .arm
27 .arch armv7-a
27 .align 3 28 .align 3
28 29
29ENTRY(am33xx_do_wfi) 30ENTRY(am33xx_do_wfi)
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 75ea4723ec0e..ac1324c6453b 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -83,6 +83,8 @@ ENDPROC(enable_omap3630_toggle_l2_on_restore)
83 * 83 *
84 * r0 = physical address of the parameters 84 * r0 = physical address of the parameters
85 */ 85 */
86 .arch armv7-a
87 .arch_extension sec
86ENTRY(save_secure_ram_context) 88ENTRY(save_secure_ram_context)
87 stmfd sp!, {r4 - r11, lr} @ save registers on stack 89 stmfd sp!, {r4 - r11, lr} @ save registers on stack
88 mov r3, r0 @ physical address of parameters 90 mov r3, r0 @ physical address of parameters
diff --git a/arch/arm/mach-omap2/sleep43xx.S b/arch/arm/mach-omap2/sleep43xx.S
index 0c1031442571..c1f4e4852644 100644
--- a/arch/arm/mach-omap2/sleep43xx.S
+++ b/arch/arm/mach-omap2/sleep43xx.S
@@ -56,6 +56,8 @@
56#define RTC_PMIC_EXT_WAKEUP_EN BIT(0) 56#define RTC_PMIC_EXT_WAKEUP_EN BIT(0)
57 57
58 .arm 58 .arm
59 .arch armv7-a
60 .arch_extension sec
59 .align 3 61 .align 3
60 62
61ENTRY(am43xx_do_wfi) 63ENTRY(am43xx_do_wfi)
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
index 934033ad847f..f60f6a9aed73 100644
--- a/arch/arm/mach-omap2/sleep44xx.S
+++ b/arch/arm/mach-omap2/sleep44xx.S
@@ -18,8 +18,11 @@
18#include "omap44xx.h" 18#include "omap44xx.h"
19#include "omap4-sar-layout.h" 19#include "omap4-sar-layout.h"
20 20
21 .arch armv7-a
22
21#if defined(CONFIG_SMP) && defined(CONFIG_PM) 23#if defined(CONFIG_SMP) && defined(CONFIG_PM)
22 24
25 .arch_extension sec
23.macro DO_SMC 26.macro DO_SMC
24 dsb 27 dsb
25 smc #0 28 smc #0
diff --git a/arch/arm/mach-pxa/include/mach/lubbock.h b/arch/arm/mach-pxa/include/mach/lubbock.h
index 72b5c3db37dc..a3af4a2f9446 100644
--- a/arch/arm/mach-pxa/include/mach/lubbock.h
+++ b/arch/arm/mach-pxa/include/mach/lubbock.h
@@ -47,7 +47,3 @@
47#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6) 47#define LUBBOCK_LAST_IRQ LUBBOCK_IRQ(6)
48 48
49#define LUBBOCK_SA1111_IRQ_BASE (LUBBOCK_NR_IRQS + 32) 49#define LUBBOCK_SA1111_IRQ_BASE (LUBBOCK_NR_IRQS + 32)
50
51#ifndef __ASSEMBLY__
52extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
53#endif
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index a3ecccc24ec5..742d18a1f7dc 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -116,12 +116,11 @@ void lubbock_set_hexled(uint32_t value)
116 116
117static struct gpio_chip *lubbock_misc_wr_gc; 117static struct gpio_chip *lubbock_misc_wr_gc;
118 118
119void lubbock_set_misc_wr(unsigned int mask, unsigned int set) 119static void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
120{ 120{
121 unsigned long m = mask, v = set; 121 unsigned long m = mask, v = set;
122 lubbock_misc_wr_gc->set_multiple(lubbock_misc_wr_gc, &m, &v); 122 lubbock_misc_wr_gc->set_multiple(lubbock_misc_wr_gc, &m, &v);
123} 123}
124EXPORT_SYMBOL(lubbock_set_misc_wr);
125 124
126static int lubbock_udc_is_connected(void) 125static int lubbock_udc_is_connected(void)
127{ 126{
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 909fffee0240..649e0a54784c 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -269,19 +269,25 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
269 sram_base_addr = of_iomap(node, 0); 269 sram_base_addr = of_iomap(node, 0);
270 if (!sram_base_addr) { 270 if (!sram_base_addr) {
271 pr_err("%s: could not map sram registers\n", __func__); 271 pr_err("%s: could not map sram registers\n", __func__);
272 of_node_put(node);
272 return; 273 return;
273 } 274 }
274 275
275 if (has_pmu && rockchip_smp_prepare_pmu()) 276 if (has_pmu && rockchip_smp_prepare_pmu()) {
277 of_node_put(node);
276 return; 278 return;
279 }
277 280
278 if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) { 281 if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
279 if (rockchip_smp_prepare_sram(node)) 282 if (rockchip_smp_prepare_sram(node)) {
283 of_node_put(node);
280 return; 284 return;
285 }
281 286
282 /* enable the SCU power domain */ 287 /* enable the SCU power domain */
283 pmu_set_power_domain(PMU_PWRDN_SCU, true); 288 pmu_set_power_domain(PMU_PWRDN_SCU, true);
284 289
290 of_node_put(node);
285 node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); 291 node = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu");
286 if (!node) { 292 if (!node) {
287 pr_err("%s: missing scu\n", __func__); 293 pr_err("%s: missing scu\n", __func__);
@@ -291,6 +297,7 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
291 scu_base_addr = of_iomap(node, 0); 297 scu_base_addr = of_iomap(node, 0);
292 if (!scu_base_addr) { 298 if (!scu_base_addr) {
293 pr_err("%s: could not map scu registers\n", __func__); 299 pr_err("%s: could not map scu registers\n", __func__);
300 of_node_put(node);
294 return; 301 return;
295 } 302 }
296 303
@@ -309,6 +316,7 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
309 asm ("mrc p15, 1, %0, c9, c0, 2\n" : "=r" (l2ctlr)); 316 asm ("mrc p15, 1, %0, c9, c0, 2\n" : "=r" (l2ctlr));
310 ncores = ((l2ctlr >> 24) & 0x3) + 1; 317 ncores = ((l2ctlr >> 24) & 0x3) + 1;
311 } 318 }
319 of_node_put(node);
312 320
313 /* Make sure that all cores except the first are really off */ 321 /* Make sure that all cores except the first are really off */
314 for (i = 1; i < ncores; i++) 322 for (i = 1; i < ncores; i++)
diff --git a/arch/arm/mach-rockchip/pm.c b/arch/arm/mach-rockchip/pm.c
index 744b5b332e42..87389d9456b9 100644
--- a/arch/arm/mach-rockchip/pm.c
+++ b/arch/arm/mach-rockchip/pm.c
@@ -257,12 +257,14 @@ static int __init rk3288_suspend_init(struct device_node *np)
257 rk3288_bootram_base = of_iomap(sram_np, 0); 257 rk3288_bootram_base = of_iomap(sram_np, 0);
258 if (!rk3288_bootram_base) { 258 if (!rk3288_bootram_base) {
259 pr_err("%s: could not map bootram base\n", __func__); 259 pr_err("%s: could not map bootram base\n", __func__);
260 of_node_put(sram_np);
260 return -ENOMEM; 261 return -ENOMEM;
261 } 262 }
262 263
263 ret = of_address_to_resource(sram_np, 0, &res); 264 ret = of_address_to_resource(sram_np, 0, &res);
264 if (ret) { 265 if (ret) {
265 pr_err("%s: could not get bootram phy addr\n", __func__); 266 pr_err("%s: could not get bootram phy addr\n", __func__);
267 of_node_put(sram_np);
266 return ret; 268 return ret;
267 } 269 }
268 rk3288_bootram_phy = res.start; 270 rk3288_bootram_phy = res.start;
diff --git a/arch/arm/mach-rpc/Makefile b/arch/arm/mach-rpc/Makefile
index 056ef5460290..90a645a18444 100644
--- a/arch/arm/mach-rpc/Makefile
+++ b/arch/arm/mach-rpc/Makefile
@@ -5,4 +5,5 @@
5 5
6# Object file lists. 6# Object file lists.
7 7
8obj-y := dma.o ecard.o fiq.o irq.o riscpc.o time.o 8obj-y :=dma.o ecard.o ecard-loader.o fiq.o floppydma.o io-acorn.o irq.o \
9 riscpc.o time.o
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
index 488d5c3b37f4..50e0f97afd75 100644
--- a/arch/arm/mach-rpc/dma.c
+++ b/arch/arm/mach-rpc/dma.c
@@ -24,10 +24,11 @@
24 24
25struct iomd_dma { 25struct iomd_dma {
26 struct dma_struct dma; 26 struct dma_struct dma;
27 unsigned int state; 27 void __iomem *base; /* Controller base address */
28 unsigned long base; /* Controller base address */
29 int irq; /* Controller IRQ */ 28 int irq; /* Controller IRQ */
30 struct scatterlist cur_sg; /* Current controller buffer */ 29 unsigned int state;
30 dma_addr_t cur_addr;
31 unsigned int cur_len;
31 dma_addr_t dma_addr; 32 dma_addr_t dma_addr;
32 unsigned int dma_len; 33 unsigned int dma_len;
33}; 34};
@@ -50,13 +51,13 @@ typedef enum {
50#define CR (IOMD_IO0CR - IOMD_IO0CURA) 51#define CR (IOMD_IO0CR - IOMD_IO0CURA)
51#define ST (IOMD_IO0ST - IOMD_IO0CURA) 52#define ST (IOMD_IO0ST - IOMD_IO0CURA)
52 53
53static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma) 54static void iomd_get_next_sg(struct iomd_dma *idma)
54{ 55{
55 unsigned long end, offset, flags = 0; 56 unsigned long end, offset, flags = 0;
56 57
57 if (idma->dma.sg) { 58 if (idma->dma.sg) {
58 sg->dma_address = idma->dma_addr; 59 idma->cur_addr = idma->dma_addr;
59 offset = sg->dma_address & ~PAGE_MASK; 60 offset = idma->cur_addr & ~PAGE_MASK;
60 61
61 end = offset + idma->dma_len; 62 end = offset + idma->dma_len;
62 63
@@ -66,7 +67,7 @@ static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma)
66 if (offset + TRANSFER_SIZE >= end) 67 if (offset + TRANSFER_SIZE >= end)
67 flags |= DMA_END_L; 68 flags |= DMA_END_L;
68 69
69 sg->length = end - TRANSFER_SIZE; 70 idma->cur_len = end - TRANSFER_SIZE;
70 71
71 idma->dma_len -= end - offset; 72 idma->dma_len -= end - offset;
72 idma->dma_addr += end - offset; 73 idma->dma_addr += end - offset;
@@ -84,52 +85,49 @@ static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma)
84 } 85 }
85 } else { 86 } else {
86 flags = DMA_END_S | DMA_END_L; 87 flags = DMA_END_S | DMA_END_L;
87 sg->dma_address = 0; 88 idma->cur_addr = 0;
88 sg->length = 0; 89 idma->cur_len = 0;
89 } 90 }
90 91
91 sg->length |= flags; 92 idma->cur_len |= flags;
92} 93}
93 94
94static irqreturn_t iomd_dma_handle(int irq, void *dev_id) 95static irqreturn_t iomd_dma_handle(int irq, void *dev_id)
95{ 96{
96 struct iomd_dma *idma = dev_id; 97 struct iomd_dma *idma = dev_id;
97 unsigned long base = idma->base; 98 void __iomem *base = idma->base;
99 unsigned int state = idma->state;
100 unsigned int status, cur, end;
98 101
99 do { 102 do {
100 unsigned int status; 103 status = readb(base + ST);
101
102 status = iomd_readb(base + ST);
103 if (!(status & DMA_ST_INT)) 104 if (!(status & DMA_ST_INT))
104 return IRQ_HANDLED; 105 goto out;
105 106
106 if ((idma->state ^ status) & DMA_ST_AB) 107 if ((state ^ status) & DMA_ST_AB)
107 iomd_get_next_sg(&idma->cur_sg, idma); 108 iomd_get_next_sg(idma);
108 109
109 switch (status & (DMA_ST_OFL | DMA_ST_AB)) { 110 // This efficiently implements state = OFL != AB ? AB : 0
110 case DMA_ST_OFL: /* OIA */ 111 state = ((status >> 2) ^ status) & DMA_ST_AB;
111 case DMA_ST_AB: /* .IB */ 112 if (state) {
112 iomd_writel(idma->cur_sg.dma_address, base + CURA); 113 cur = CURA;
113 iomd_writel(idma->cur_sg.length, base + ENDA); 114 end = ENDA;
114 idma->state = DMA_ST_AB; 115 } else {
115 break; 116 cur = CURB;
116 117 end = ENDB;
117 case DMA_ST_OFL | DMA_ST_AB: /* OIB */
118 case 0: /* .IA */
119 iomd_writel(idma->cur_sg.dma_address, base + CURB);
120 iomd_writel(idma->cur_sg.length, base + ENDB);
121 idma->state = 0;
122 break;
123 } 118 }
119 writel(idma->cur_addr, base + cur);
120 writel(idma->cur_len, base + end);
124 121
125 if (status & DMA_ST_OFL && 122 if (status & DMA_ST_OFL &&
126 idma->cur_sg.length == (DMA_END_S|DMA_END_L)) 123 idma->cur_len == (DMA_END_S|DMA_END_L))
127 break; 124 break;
128 } while (1); 125 } while (1);
129 126
130 idma->state = ~DMA_ST_AB; 127 state = ~DMA_ST_AB;
131 disable_irq(irq); 128 disable_irq_nosync(irq);
132 129out:
130 idma->state = state;
133 return IRQ_HANDLED; 131 return IRQ_HANDLED;
134} 132}
135 133
@@ -157,7 +155,7 @@ static struct device isa_dma_dev = {
157static void iomd_enable_dma(unsigned int chan, dma_t *dma) 155static void iomd_enable_dma(unsigned int chan, dma_t *dma)
158{ 156{
159 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); 157 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
160 unsigned long dma_base = idma->base; 158 void __iomem *base = idma->base;
161 unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E; 159 unsigned int ctrl = TRANSFER_SIZE | DMA_CR_E;
162 160
163 if (idma->dma.invalid) { 161 if (idma->dma.invalid) {
@@ -177,27 +175,30 @@ static void iomd_enable_dma(unsigned int chan, dma_t *dma)
177 DMA_FROM_DEVICE : DMA_TO_DEVICE); 175 DMA_FROM_DEVICE : DMA_TO_DEVICE);
178 } 176 }
179 177
180 iomd_writeb(DMA_CR_C, dma_base + CR); 178 idma->dma_addr = idma->dma.sg->dma_address;
179 idma->dma_len = idma->dma.sg->length;
180
181 writeb(DMA_CR_C, base + CR);
181 idma->state = DMA_ST_AB; 182 idma->state = DMA_ST_AB;
182 } 183 }
183 184
184 if (idma->dma.dma_mode == DMA_MODE_READ) 185 if (idma->dma.dma_mode == DMA_MODE_READ)
185 ctrl |= DMA_CR_D; 186 ctrl |= DMA_CR_D;
186 187
187 iomd_writeb(ctrl, dma_base + CR); 188 writeb(ctrl, base + CR);
188 enable_irq(idma->irq); 189 enable_irq(idma->irq);
189} 190}
190 191
191static void iomd_disable_dma(unsigned int chan, dma_t *dma) 192static void iomd_disable_dma(unsigned int chan, dma_t *dma)
192{ 193{
193 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); 194 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
194 unsigned long dma_base = idma->base; 195 void __iomem *base = idma->base;
195 unsigned long flags; 196 unsigned long flags;
196 197
197 local_irq_save(flags); 198 local_irq_save(flags);
198 if (idma->state != ~DMA_ST_AB) 199 if (idma->state != ~DMA_ST_AB)
199 disable_irq(idma->irq); 200 disable_irq(idma->irq);
200 iomd_writeb(0, dma_base + CR); 201 writeb(0, base + CR);
201 local_irq_restore(flags); 202 local_irq_restore(flags);
202} 203}
203 204
@@ -360,17 +361,17 @@ static int __init rpc_dma_init(void)
360 */ 361 */
361 iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT); 362 iomd_writeb(DMA_EXT_IO3|DMA_EXT_IO2, IOMD_DMAEXT);
362 363
363 iomd_dma[DMA_0].base = IOMD_IO0CURA; 364 iomd_dma[DMA_0].base = IOMD_BASE + IOMD_IO0CURA;
364 iomd_dma[DMA_0].irq = IRQ_DMA0; 365 iomd_dma[DMA_0].irq = IRQ_DMA0;
365 iomd_dma[DMA_1].base = IOMD_IO1CURA; 366 iomd_dma[DMA_1].base = IOMD_BASE + IOMD_IO1CURA;
366 iomd_dma[DMA_1].irq = IRQ_DMA1; 367 iomd_dma[DMA_1].irq = IRQ_DMA1;
367 iomd_dma[DMA_2].base = IOMD_IO2CURA; 368 iomd_dma[DMA_2].base = IOMD_BASE + IOMD_IO2CURA;
368 iomd_dma[DMA_2].irq = IRQ_DMA2; 369 iomd_dma[DMA_2].irq = IRQ_DMA2;
369 iomd_dma[DMA_3].base = IOMD_IO3CURA; 370 iomd_dma[DMA_3].base = IOMD_BASE + IOMD_IO3CURA;
370 iomd_dma[DMA_3].irq = IRQ_DMA3; 371 iomd_dma[DMA_3].irq = IRQ_DMA3;
371 iomd_dma[DMA_S0].base = IOMD_SD0CURA; 372 iomd_dma[DMA_S0].base = IOMD_BASE + IOMD_SD0CURA;
372 iomd_dma[DMA_S0].irq = IRQ_DMAS0; 373 iomd_dma[DMA_S0].irq = IRQ_DMAS0;
373 iomd_dma[DMA_S1].base = IOMD_SD1CURA; 374 iomd_dma[DMA_S1].base = IOMD_BASE + IOMD_SD1CURA;
374 iomd_dma[DMA_S1].irq = IRQ_DMAS1; 375 iomd_dma[DMA_S1].irq = IRQ_DMAS1;
375 376
376 for (i = DMA_0; i <= DMA_S1; i++) { 377 for (i = DMA_0; i <= DMA_S1; i++) {
diff --git a/arch/arm/lib/ecard.S b/arch/arm/mach-rpc/ecard-loader.S
index eb8ac0412da6..eb8ac0412da6 100644
--- a/arch/arm/lib/ecard.S
+++ b/arch/arm/mach-rpc/ecard-loader.S
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index cf0593bc42d2..75cfad2cb143 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -67,17 +67,21 @@ struct expcard_blacklist {
67 unsigned short manufacturer; 67 unsigned short manufacturer;
68 unsigned short product; 68 unsigned short product;
69 const char *type; 69 const char *type;
70 void (*init)(ecard_t *ec);
70}; 71};
71 72
72static ecard_t *cards; 73static ecard_t *cards;
73static ecard_t *slot_to_expcard[MAX_ECARDS]; 74static ecard_t *slot_to_expcard[MAX_ECARDS];
74static unsigned int ectcr; 75static unsigned int ectcr;
75 76
77static void atomwide_3p_quirk(ecard_t *ec);
78
76/* List of descriptions of cards which don't have an extended 79/* List of descriptions of cards which don't have an extended
77 * identification, or chunk directories containing a description. 80 * identification, or chunk directories containing a description.
78 */ 81 */
79static struct expcard_blacklist __initdata blacklist[] = { 82static struct expcard_blacklist __initdata blacklist[] = {
80 { MANU_ACORN, PROD_ACORN_ETHER1, "Acorn Ether1" } 83 { MANU_ACORN, PROD_ACORN_ETHER1, "Acorn Ether1" },
84 { MANU_ATOMWIDE, PROD_ATOMWIDE_3PSERIAL, NULL, atomwide_3p_quirk },
81}; 85};
82 86
83asmlinkage extern int 87asmlinkage extern int
@@ -493,18 +497,21 @@ static void ecard_dump_irq_state(void)
493 printk("Expansion card IRQ state:\n"); 497 printk("Expansion card IRQ state:\n");
494 498
495 for (ec = cards; ec; ec = ec->next) { 499 for (ec = cards; ec; ec = ec->next) {
500 const char *claimed;
501
496 if (ec->slot_no == 8) 502 if (ec->slot_no == 8)
497 continue; 503 continue;
498 504
499 printk(" %d: %sclaimed, ", 505 claimed = ec->claimed ? "" : "not ";
500 ec->slot_no, ec->claimed ? "" : "not ");
501 506
502 if (ec->ops && ec->ops->irqpending && 507 if (ec->ops && ec->ops->irqpending &&
503 ec->ops != &ecard_default_ops) 508 ec->ops != &ecard_default_ops)
504 printk("irq %spending\n", 509 printk(" %d: %sclaimed irq %spending\n",
510 ec->slot_no, claimed,
505 ec->ops->irqpending(ec) ? "" : "not "); 511 ec->ops->irqpending(ec) ? "" : "not ");
506 else 512 else
507 printk("irqaddr %p, mask = %02X, status = %02X\n", 513 printk(" %d: %sclaimed irqaddr %p, mask = %02X, status = %02X\n",
514 ec->slot_no, claimed,
508 ec->irqaddr, ec->irqmask, readb(ec->irqaddr)); 515 ec->irqaddr, ec->irqmask, readb(ec->irqaddr));
509 } 516 }
510} 517}
@@ -865,6 +872,16 @@ void __iomem *ecardm_iomap(struct expansion_card *ec, unsigned int res,
865} 872}
866EXPORT_SYMBOL(ecardm_iomap); 873EXPORT_SYMBOL(ecardm_iomap);
867 874
875static void atomwide_3p_quirk(ecard_t *ec)
876{
877 void __iomem *addr = __ecard_address(ec, ECARD_IOC, ECARD_SYNC);
878 unsigned int i;
879
880 /* Disable interrupts on each port */
881 for (i = 0x2000; i <= 0x2800; i += 0x0400)
882 writeb(0, addr + i + 4);
883}
884
868/* 885/*
869 * Probe for an expansion card. 886 * Probe for an expansion card.
870 * 887 *
@@ -921,7 +938,10 @@ static int __init ecard_probe(int slot, unsigned irq, card_type_t type)
921 for (i = 0; i < ARRAY_SIZE(blacklist); i++) 938 for (i = 0; i < ARRAY_SIZE(blacklist); i++)
922 if (blacklist[i].manufacturer == ec->cid.manufacturer && 939 if (blacklist[i].manufacturer == ec->cid.manufacturer &&
923 blacklist[i].product == ec->cid.product) { 940 blacklist[i].product == ec->cid.product) {
924 ec->card_desc = blacklist[i].type; 941 if (blacklist[i].type)
942 ec->card_desc = blacklist[i].type;
943 if (blacklist[i].init)
944 blacklist[i].init(ec);
925 break; 945 break;
926 } 946 }
927 947
diff --git a/arch/arm/lib/floppydma.S b/arch/arm/mach-rpc/floppydma.S
index 6698b83050dc..6698b83050dc 100644
--- a/arch/arm/lib/floppydma.S
+++ b/arch/arm/mach-rpc/floppydma.S
diff --git a/arch/arm/mach-rpc/include/mach/uncompress.h b/arch/arm/mach-rpc/include/mach/uncompress.h
index a023b5f9bbbb..1fbe7eb956fd 100644
--- a/arch/arm/mach-rpc/include/mach/uncompress.h
+++ b/arch/arm/mach-rpc/include/mach/uncompress.h
@@ -115,29 +115,22 @@ static void arch_decomp_setup(void)
115 struct tag *t = (struct tag *)params; 115 struct tag *t = (struct tag *)params;
116 unsigned int nr_pages = 0, page_size = PAGE_SIZE; 116 unsigned int nr_pages = 0, page_size = PAGE_SIZE;
117 117
118 if (t->hdr.tag == ATAG_CORE) 118 if (t->hdr.tag == ATAG_CORE) {
119 { 119 for (; t->hdr.size; t = tag_next(t)) {
120 for (; t->hdr.size; t = tag_next(t)) 120 if (t->hdr.tag == ATAG_VIDEOTEXT) {
121 {
122 if (t->hdr.tag == ATAG_VIDEOTEXT)
123 {
124 video_num_rows = t->u.videotext.video_lines; 121 video_num_rows = t->u.videotext.video_lines;
125 video_num_cols = t->u.videotext.video_cols; 122 video_num_cols = t->u.videotext.video_cols;
126 bytes_per_char_h = t->u.videotext.video_points;
127 bytes_per_char_v = t->u.videotext.video_points;
128 video_x = t->u.videotext.x; 123 video_x = t->u.videotext.x;
129 video_y = t->u.videotext.y; 124 video_y = t->u.videotext.y;
130 } 125 } else if (t->hdr.tag == ATAG_VIDEOLFB) {
131 126 bytes_per_char_h = t->u.videolfb.lfb_depth;
132 if (t->hdr.tag == ATAG_MEM) 127 bytes_per_char_v = 8;
133 { 128 } else if (t->hdr.tag == ATAG_MEM) {
134 page_size = PAGE_SIZE; 129 page_size = PAGE_SIZE;
135 nr_pages += (t->u.mem.size / PAGE_SIZE); 130 nr_pages += (t->u.mem.size / PAGE_SIZE);
136 } 131 }
137 } 132 }
138 } 133 } else {
139 else
140 {
141 nr_pages = params->nr_pages; 134 nr_pages = params->nr_pages;
142 page_size = params->page_size; 135 page_size = params->page_size;
143 video_num_rows = params->video_num_rows; 136 video_num_rows = params->video_num_rows;
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/mach-rpc/io-acorn.S
index b9082a2a2a01..b9082a2a2a01 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/mach-rpc/io-acorn.S
diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c
index b8a61cb11207..803aeb126f0e 100644
--- a/arch/arm/mach-rpc/irq.c
+++ b/arch/arm/mach-rpc/irq.c
@@ -8,117 +8,71 @@
8#include <asm/irq.h> 8#include <asm/irq.h>
9#include <asm/fiq.h> 9#include <asm/fiq.h>
10 10
11static void iomd_ack_irq_a(struct irq_data *d) 11// These are offsets from the stat register for each IRQ bank
12{ 12#define STAT 0x00
13 unsigned int val, mask; 13#define REQ 0x04
14 14#define CLR 0x04
15 mask = 1 << d->irq; 15#define MASK 0x08
16 val = iomd_readb(IOMD_IRQMASKA);
17 iomd_writeb(val & ~mask, IOMD_IRQMASKA);
18 iomd_writeb(mask, IOMD_IRQCLRA);
19}
20
21static void iomd_mask_irq_a(struct irq_data *d)
22{
23 unsigned int val, mask;
24 16
25 mask = 1 << d->irq; 17static void __iomem *iomd_get_base(struct irq_data *d)
26 val = iomd_readb(IOMD_IRQMASKA);
27 iomd_writeb(val & ~mask, IOMD_IRQMASKA);
28}
29
30static void iomd_unmask_irq_a(struct irq_data *d)
31{ 18{
32 unsigned int val, mask; 19 void *cd = irq_data_get_irq_chip_data(d);
33 20
34 mask = 1 << d->irq; 21 return (void __iomem *)(unsigned long)cd;
35 val = iomd_readb(IOMD_IRQMASKA);
36 iomd_writeb(val | mask, IOMD_IRQMASKA);
37} 22}
38 23
39static struct irq_chip iomd_a_chip = { 24static void iomd_set_base_mask(unsigned int irq, void __iomem *base, u32 mask)
40 .irq_ack = iomd_ack_irq_a,
41 .irq_mask = iomd_mask_irq_a,
42 .irq_unmask = iomd_unmask_irq_a,
43};
44
45static void iomd_mask_irq_b(struct irq_data *d)
46{ 25{
47 unsigned int val, mask; 26 struct irq_data *d = irq_get_irq_data(irq);
48 27
49 mask = 1 << (d->irq & 7); 28 d->mask = mask;
50 val = iomd_readb(IOMD_IRQMASKB); 29 irq_set_chip_data(irq, (void *)(unsigned long)base);
51 iomd_writeb(val & ~mask, IOMD_IRQMASKB);
52} 30}
53 31
54static void iomd_unmask_irq_b(struct irq_data *d) 32static void iomd_irq_mask_ack(struct irq_data *d)
55{ 33{
56 unsigned int val, mask; 34 void __iomem *base = iomd_get_base(d);
35 unsigned int val, mask = d->mask;
57 36
58 mask = 1 << (d->irq & 7); 37 val = readb(base + MASK);
59 val = iomd_readb(IOMD_IRQMASKB); 38 writeb(val & ~mask, base + MASK);
60 iomd_writeb(val | mask, IOMD_IRQMASKB); 39 writeb(mask, base + CLR);
61} 40}
62 41
63static struct irq_chip iomd_b_chip = { 42static void iomd_irq_mask(struct irq_data *d)
64 .irq_ack = iomd_mask_irq_b,
65 .irq_mask = iomd_mask_irq_b,
66 .irq_unmask = iomd_unmask_irq_b,
67};
68
69static void iomd_mask_irq_dma(struct irq_data *d)
70{ 43{
71 unsigned int val, mask; 44 void __iomem *base = iomd_get_base(d);
45 unsigned int val, mask = d->mask;
72 46
73 mask = 1 << (d->irq & 7); 47 val = readb(base + MASK);
74 val = iomd_readb(IOMD_DMAMASK); 48 writeb(val & ~mask, base + MASK);
75 iomd_writeb(val & ~mask, IOMD_DMAMASK);
76} 49}
77 50
78static void iomd_unmask_irq_dma(struct irq_data *d) 51static void iomd_irq_unmask(struct irq_data *d)
79{ 52{
80 unsigned int val, mask; 53 void __iomem *base = iomd_get_base(d);
54 unsigned int val, mask = d->mask;
81 55
82 mask = 1 << (d->irq & 7); 56 val = readb(base + MASK);
83 val = iomd_readb(IOMD_DMAMASK); 57 writeb(val | mask, base + MASK);
84 iomd_writeb(val | mask, IOMD_DMAMASK);
85} 58}
86 59
87static struct irq_chip iomd_dma_chip = { 60static struct irq_chip iomd_chip_clr = {
88 .irq_ack = iomd_mask_irq_dma, 61 .irq_mask_ack = iomd_irq_mask_ack,
89 .irq_mask = iomd_mask_irq_dma, 62 .irq_mask = iomd_irq_mask,
90 .irq_unmask = iomd_unmask_irq_dma, 63 .irq_unmask = iomd_irq_unmask,
91}; 64};
92 65
93static void iomd_mask_irq_fiq(struct irq_data *d) 66static struct irq_chip iomd_chip_noclr = {
94{ 67 .irq_mask = iomd_irq_mask,
95 unsigned int val, mask; 68 .irq_unmask = iomd_irq_unmask,
96
97 mask = 1 << (d->irq & 7);
98 val = iomd_readb(IOMD_FIQMASK);
99 iomd_writeb(val & ~mask, IOMD_FIQMASK);
100}
101
102static void iomd_unmask_irq_fiq(struct irq_data *d)
103{
104 unsigned int val, mask;
105
106 mask = 1 << (d->irq & 7);
107 val = iomd_readb(IOMD_FIQMASK);
108 iomd_writeb(val | mask, IOMD_FIQMASK);
109}
110
111static struct irq_chip iomd_fiq_chip = {
112 .irq_ack = iomd_mask_irq_fiq,
113 .irq_mask = iomd_mask_irq_fiq,
114 .irq_unmask = iomd_unmask_irq_fiq,
115}; 69};
116 70
117extern unsigned char rpc_default_fiq_start, rpc_default_fiq_end; 71extern unsigned char rpc_default_fiq_start, rpc_default_fiq_end;
118 72
119void __init rpc_init_irq(void) 73void __init rpc_init_irq(void)
120{ 74{
121 unsigned int irq, clr, set = 0; 75 unsigned int irq, clr, set;
122 76
123 iomd_writeb(0, IOMD_IRQMASKA); 77 iomd_writeb(0, IOMD_IRQMASKA);
124 iomd_writeb(0, IOMD_IRQMASKB); 78 iomd_writeb(0, IOMD_IRQMASKB);
@@ -130,6 +84,7 @@ void __init rpc_init_irq(void)
130 84
131 for (irq = 0; irq < NR_IRQS; irq++) { 85 for (irq = 0; irq < NR_IRQS; irq++) {
132 clr = IRQ_NOREQUEST; 86 clr = IRQ_NOREQUEST;
87 set = 0;
133 88
134 if (irq <= 6 || (irq >= 9 && irq <= 15)) 89 if (irq <= 6 || (irq >= 9 && irq <= 15))
135 clr |= IRQ_NOPROBE; 90 clr |= IRQ_NOPROBE;
@@ -140,30 +95,37 @@ void __init rpc_init_irq(void)
140 95
141 switch (irq) { 96 switch (irq) {
142 case 0 ... 7: 97 case 0 ... 7:
143 irq_set_chip_and_handler(irq, &iomd_a_chip, 98 irq_set_chip_and_handler(irq, &iomd_chip_clr,
144 handle_level_irq); 99 handle_level_irq);
145 irq_modify_status(irq, clr, set); 100 irq_modify_status(irq, clr, set);
101 iomd_set_base_mask(irq, IOMD_BASE + IOMD_IRQSTATA,
102 BIT(irq));
146 break; 103 break;
147 104
148 case 8 ... 15: 105 case 8 ... 15:
149 irq_set_chip_and_handler(irq, &iomd_b_chip, 106 irq_set_chip_and_handler(irq, &iomd_chip_noclr,
150 handle_level_irq); 107 handle_level_irq);
151 irq_modify_status(irq, clr, set); 108 irq_modify_status(irq, clr, set);
109 iomd_set_base_mask(irq, IOMD_BASE + IOMD_IRQSTATB,
110 BIT(irq - 8));
152 break; 111 break;
153 112
154 case 16 ... 21: 113 case 16 ... 21:
155 irq_set_chip_and_handler(irq, &iomd_dma_chip, 114 irq_set_chip_and_handler(irq, &iomd_chip_noclr,
156 handle_level_irq); 115 handle_level_irq);
157 irq_modify_status(irq, clr, set); 116 irq_modify_status(irq, clr, set);
117 iomd_set_base_mask(irq, IOMD_BASE + IOMD_DMASTAT,
118 BIT(irq - 16));
158 break; 119 break;
159 120
160 case 64 ... 71: 121 case 64 ... 71:
161 irq_set_chip(irq, &iomd_fiq_chip); 122 irq_set_chip(irq, &iomd_chip_noclr);
162 irq_modify_status(irq, clr, set); 123 irq_modify_status(irq, clr, set);
124 iomd_set_base_mask(irq, IOMD_BASE + IOMD_FIQSTAT,
125 BIT(irq - 64));
163 break; 126 break;
164 } 127 }
165 } 128 }
166 129
167 init_FIQ(FIQ_START); 130 init_FIQ(FIQ_START);
168} 131}
169
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c
index e97f93a0af1d..1d750152b160 100644
--- a/arch/arm/mach-rpc/time.c
+++ b/arch/arm/mach-rpc/time.c
@@ -10,7 +10,7 @@
10 * 04-Dec-1997 RMK Updated for new arch/arm/time.c 10 * 04-Dec-1997 RMK Updated for new arch/arm/time.c
11 * 13=Jun-2004 DS Moved to arch/arm/common b/c shared w/CLPS7500 11 * 13=Jun-2004 DS Moved to arch/arm/common b/c shared w/CLPS7500
12 */ 12 */
13#include <linux/timex.h> 13#include <linux/clocksource.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
@@ -24,11 +24,15 @@
24#define RPC_CLOCK_FREQ 2000000 24#define RPC_CLOCK_FREQ 2000000
25#define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ) 25#define RPC_LATCH DIV_ROUND_CLOSEST(RPC_CLOCK_FREQ, HZ)
26 26
27static u32 ioc_timer_gettimeoffset(void) 27static u32 ioc_time;
28
29static u64 ioc_timer_read(struct clocksource *cs)
28{ 30{
29 unsigned int count1, count2, status; 31 unsigned int count1, count2, status;
30 long offset; 32 unsigned long flags;
33 u32 ticks;
31 34
35 local_irq_save(flags);
32 ioc_writeb (0, IOC_T0LATCH); 36 ioc_writeb (0, IOC_T0LATCH);
33 barrier (); 37 barrier ();
34 count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); 38 count1 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8);
@@ -38,27 +42,34 @@ static u32 ioc_timer_gettimeoffset(void)
38 ioc_writeb (0, IOC_T0LATCH); 42 ioc_writeb (0, IOC_T0LATCH);
39 barrier (); 43 barrier ();
40 count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8); 44 count2 = ioc_readb(IOC_T0CNTL) | (ioc_readb(IOC_T0CNTH) << 8);
45 ticks = ioc_time + RPC_LATCH - count2;
46 local_irq_restore(flags);
41 47
42 offset = count2;
43 if (count2 < count1) { 48 if (count2 < count1) {
44 /* 49 /*
45 * We have not had an interrupt between reading count1 50 * The timer has not reloaded between reading count1 and
46 * and count2. 51 * count2, check whether an interrupt was actually pending.
47 */ 52 */
48 if (status & (1 << 5)) 53 if (status & (1 << 5))
49 offset -= RPC_LATCH; 54 ticks += RPC_LATCH;
50 } else if (count2 > count1) { 55 } else if (count2 > count1) {
51 /* 56 /*
52 * We have just had another interrupt between reading 57 * The timer has reloaded, so count2 indicates the new
53 * count1 and count2. 58 * count since the wrap. The interrupt would not have
59 * been processed, so add the missed ticks.
54 */ 60 */
55 offset -= RPC_LATCH; 61 ticks += RPC_LATCH;
56 } 62 }
57 63
58 offset = (RPC_LATCH - offset) * (tick_nsec / 1000); 64 return ticks;
59 return DIV_ROUND_CLOSEST(offset, RPC_LATCH) * 1000;
60} 65}
61 66
67static struct clocksource ioctime_clocksource = {
68 .read = ioc_timer_read,
69 .mask = CLOCKSOURCE_MASK(32),
70 .rating = 100,
71};
72
62void __init ioctime_init(void) 73void __init ioctime_init(void)
63{ 74{
64 ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL); 75 ioc_writeb(RPC_LATCH & 255, IOC_T0LTCHL);
@@ -69,6 +80,7 @@ void __init ioctime_init(void)
69static irqreturn_t 80static irqreturn_t
70ioc_timer_interrupt(int irq, void *dev_id) 81ioc_timer_interrupt(int irq, void *dev_id)
71{ 82{
83 ioc_time += RPC_LATCH;
72 timer_tick(); 84 timer_tick();
73 return IRQ_HANDLED; 85 return IRQ_HANDLED;
74} 86}
@@ -83,7 +95,7 @@ static struct irqaction ioc_timer_irq = {
83 */ 95 */
84void __init ioc_timer_init(void) 96void __init ioc_timer_init(void)
85{ 97{
86 arch_gettimeoffset = ioc_timer_gettimeoffset; 98 WARN_ON(clocksource_register_hz(&ioctime_clocksource, RPC_CLOCK_FREQ));
87 ioctime_init(); 99 ioctime_init();
88 setup_irq(IRQ_TIMER0, &ioc_timer_irq); 100 setup_irq(IRQ_TIMER0, &ioc_timer_irq);
89} 101}
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index dd8d13fb8450..d96a101e5504 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -519,6 +519,29 @@ static const struct gpio_keys_platform_data assabet_keys_pdata = {
519 .rep = 0, 519 .rep = 0,
520}; 520};
521 521
522static struct gpiod_lookup_table assabet_uart1_gpio_table = {
523 .dev_id = "sa11x0-uart.1",
524 .table = {
525 GPIO_LOOKUP("assabet", 16, "dtr", GPIO_ACTIVE_LOW),
526 GPIO_LOOKUP("assabet", 17, "rts", GPIO_ACTIVE_LOW),
527 GPIO_LOOKUP("assabet", 25, "dcd", GPIO_ACTIVE_LOW),
528 GPIO_LOOKUP("assabet", 26, "cts", GPIO_ACTIVE_LOW),
529 GPIO_LOOKUP("assabet", 27, "dsr", GPIO_ACTIVE_LOW),
530 { },
531 },
532};
533
534static struct gpiod_lookup_table assabet_uart3_gpio_table = {
535 .dev_id = "sa11x0-uart.3",
536 .table = {
537 GPIO_LOOKUP("assabet", 28, "cts", GPIO_ACTIVE_LOW),
538 GPIO_LOOKUP("assabet", 29, "dsr", GPIO_ACTIVE_LOW),
539 GPIO_LOOKUP("assabet", 30, "dcd", GPIO_ACTIVE_LOW),
540 GPIO_LOOKUP("assabet", 31, "rng", GPIO_ACTIVE_LOW),
541 { },
542 },
543};
544
522static void __init assabet_init(void) 545static void __init assabet_init(void)
523{ 546{
524 /* 547 /*
@@ -565,7 +588,10 @@ static void __init assabet_init(void)
565 neponset_resources, ARRAY_SIZE(neponset_resources)); 588 neponset_resources, ARRAY_SIZE(neponset_resources));
566#endif 589#endif
567 } else { 590 } else {
591 gpiod_add_lookup_table(&assabet_uart1_gpio_table);
592 gpiod_add_lookup_table(&assabet_uart3_gpio_table);
568 gpiod_add_lookup_table(&assabet_cf_vcc_gpio_table); 593 gpiod_add_lookup_table(&assabet_cf_vcc_gpio_table);
594
569 sa11x0_register_fixed_regulator(0, &assabet_cf_vcc_pdata, 595 sa11x0_register_fixed_regulator(0, &assabet_cf_vcc_pdata,
570 assabet_cf_vcc_consumers, 596 assabet_cf_vcc_consumers,
571 ARRAY_SIZE(assabet_cf_vcc_consumers), 597 ARRAY_SIZE(assabet_cf_vcc_consumers),
@@ -655,74 +681,13 @@ static void assabet_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
655{ 681{
656 if (port->mapbase == _Ser1UTCR0) { 682 if (port->mapbase == _Ser1UTCR0) {
657 if (state) 683 if (state)
658 ASSABET_BCR_clear(ASSABET_BCR_RS232EN | 684 ASSABET_BCR_clear(ASSABET_BCR_RS232EN);
659 ASSABET_BCR_COM_RTS |
660 ASSABET_BCR_COM_DTR);
661 else
662 ASSABET_BCR_set(ASSABET_BCR_RS232EN |
663 ASSABET_BCR_COM_RTS |
664 ASSABET_BCR_COM_DTR);
665 }
666}
667
668/*
669 * Assabet uses COM_RTS and COM_DTR for both UART1 (com port)
670 * and UART3 (radio module). We only handle them for UART1 here.
671 */
672static void assabet_set_mctrl(struct uart_port *port, u_int mctrl)
673{
674 if (port->mapbase == _Ser1UTCR0) {
675 u_int set = 0, clear = 0;
676
677 if (mctrl & TIOCM_RTS)
678 clear |= ASSABET_BCR_COM_RTS;
679 else 685 else
680 set |= ASSABET_BCR_COM_RTS; 686 ASSABET_BCR_set(ASSABET_BCR_RS232EN);
681
682 if (mctrl & TIOCM_DTR)
683 clear |= ASSABET_BCR_COM_DTR;
684 else
685 set |= ASSABET_BCR_COM_DTR;
686
687 ASSABET_BCR_clear(clear);
688 ASSABET_BCR_set(set);
689 }
690}
691
692static u_int assabet_get_mctrl(struct uart_port *port)
693{
694 u_int ret = 0;
695 u_int bsr = ASSABET_BSR;
696
697 /* need 2 reads to read current value */
698 bsr = ASSABET_BSR;
699
700 if (port->mapbase == _Ser1UTCR0) {
701 if (bsr & ASSABET_BSR_COM_DCD)
702 ret |= TIOCM_CD;
703 if (bsr & ASSABET_BSR_COM_CTS)
704 ret |= TIOCM_CTS;
705 if (bsr & ASSABET_BSR_COM_DSR)
706 ret |= TIOCM_DSR;
707 } else if (port->mapbase == _Ser3UTCR0) {
708 if (bsr & ASSABET_BSR_RAD_DCD)
709 ret |= TIOCM_CD;
710 if (bsr & ASSABET_BSR_RAD_CTS)
711 ret |= TIOCM_CTS;
712 if (bsr & ASSABET_BSR_RAD_DSR)
713 ret |= TIOCM_DSR;
714 if (bsr & ASSABET_BSR_RAD_RI)
715 ret |= TIOCM_RI;
716 } else {
717 ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
718 } 687 }
719
720 return ret;
721} 688}
722 689
723static struct sa1100_port_fns assabet_port_fns __initdata = { 690static struct sa1100_port_fns assabet_port_fns __initdata = {
724 .set_mctrl = assabet_set_mctrl,
725 .get_mctrl = assabet_get_mctrl,
726 .pm = assabet_uart_pm, 691 .pm = assabet_uart_pm,
727}; 692};
728 693
diff --git a/arch/arm/mach-sa1100/badge4.c b/arch/arm/mach-sa1100/badge4.c
index bc0e0e24ecb7..de79f3502045 100644
--- a/arch/arm/mach-sa1100/badge4.c
+++ b/arch/arm/mach-sa1100/badge4.c
@@ -311,8 +311,6 @@ badge4_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
311} 311}
312 312
313static struct sa1100_port_fns badge4_port_fns __initdata = { 313static struct sa1100_port_fns badge4_port_fns __initdata = {
314 //.get_mctrl = badge4_get_mctrl,
315 //.set_mctrl = badge4_set_mctrl,
316 .pm = badge4_uart_pm, 314 .pm = badge4_uart_pm,
317}; 315};
318 316
diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c
index 6199e87447ca..e8691921c69a 100644
--- a/arch/arm/mach-sa1100/clock.c
+++ b/arch/arm/mach-sa1100/clock.c
@@ -2,176 +2,144 @@
2/* 2/*
3 * linux/arch/arm/mach-sa1100/clock.c 3 * linux/arch/arm/mach-sa1100/clock.c
4 */ 4 */
5#include <linux/module.h>
6#include <linux/kernel.h> 5#include <linux/kernel.h>
7#include <linux/device.h>
8#include <linux/list.h>
9#include <linux/errno.h> 6#include <linux/errno.h>
10#include <linux/err.h> 7#include <linux/err.h>
11#include <linux/string.h>
12#include <linux/clk.h> 8#include <linux/clk.h>
13#include <linux/spinlock.h>
14#include <linux/mutex.h>
15#include <linux/io.h>
16#include <linux/clkdev.h> 9#include <linux/clkdev.h>
10#include <linux/clk-provider.h>
11#include <linux/io.h>
12#include <linux/spinlock.h>
17 13
18#include <mach/hardware.h> 14#include <mach/hardware.h>
19#include <mach/generic.h> 15#include <mach/generic.h>
20 16
21struct clkops { 17static const char * const clk_tucr_parents[] = {
22 void (*enable)(struct clk *); 18 "clk32768", "clk3686400",
23 void (*disable)(struct clk *);
24 unsigned long (*get_rate)(struct clk *);
25}; 19};
26 20
27struct clk { 21static DEFINE_SPINLOCK(tucr_lock);
28 const struct clkops *ops;
29 unsigned int enabled;
30};
31
32#define DEFINE_CLK(_name, _ops) \
33struct clk clk_##_name = { \
34 .ops = _ops, \
35 }
36
37static DEFINE_SPINLOCK(clocks_lock);
38
39/* Dummy clk routine to build generic kernel parts that may be using them */
40long clk_round_rate(struct clk *clk, unsigned long rate)
41{
42 return clk_get_rate(clk);
43}
44EXPORT_SYMBOL(clk_round_rate);
45
46int clk_set_rate(struct clk *clk, unsigned long rate)
47{
48 return 0;
49}
50EXPORT_SYMBOL(clk_set_rate);
51
52int clk_set_parent(struct clk *clk, struct clk *parent)
53{
54 return 0;
55}
56EXPORT_SYMBOL(clk_set_parent);
57 22
58struct clk *clk_get_parent(struct clk *clk) 23static int clk_gpio27_enable(struct clk_hw *hw)
59{ 24{
60 return NULL; 25 unsigned long flags;
61}
62EXPORT_SYMBOL(clk_get_parent);
63 26
64static void clk_gpio27_enable(struct clk *clk)
65{
66 /* 27 /*
67 * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111: 28 * First, set up the 3.6864MHz clock on GPIO 27 for the SA-1111:
68 * (SA-1110 Developer's Manual, section 9.1.2.1) 29 * (SA-1110 Developer's Manual, section 9.1.2.1)
69 */ 30 */
31 local_irq_save(flags);
70 GAFR |= GPIO_32_768kHz; 32 GAFR |= GPIO_32_768kHz;
71 GPDR |= GPIO_32_768kHz; 33 GPDR |= GPIO_32_768kHz;
72 TUCR = TUCR_3_6864MHz; 34 local_irq_restore(flags);
35
36 return 0;
73} 37}
74 38
75static void clk_gpio27_disable(struct clk *clk) 39static void clk_gpio27_disable(struct clk_hw *hw)
76{ 40{
77 TUCR = 0; 41 unsigned long flags;
42
43 local_irq_save(flags);
78 GPDR &= ~GPIO_32_768kHz; 44 GPDR &= ~GPIO_32_768kHz;
79 GAFR &= ~GPIO_32_768kHz; 45 GAFR &= ~GPIO_32_768kHz;
46 local_irq_restore(flags);
80} 47}
81 48
82static void clk_cpu_enable(struct clk *clk) 49static const struct clk_ops clk_gpio27_ops = {
83{ 50 .enable = clk_gpio27_enable,
84} 51 .disable = clk_gpio27_disable,
52};
85 53
86static void clk_cpu_disable(struct clk *clk) 54static const char * const clk_gpio27_parents[] = {
87{ 55 "tucr-mux",
88} 56};
89 57
90static unsigned long clk_cpu_get_rate(struct clk *clk) 58static const struct clk_init_data clk_gpio27_init_data __initconst = {
59 .name = "gpio27",
60 .ops = &clk_gpio27_ops,
61 .parent_names = clk_gpio27_parents,
62 .num_parents = ARRAY_SIZE(clk_gpio27_parents),
63};
64
65/*
66 * Derived from the table 8-1 in the SA1110 manual, the MPLL appears to
67 * multiply its input rate by 4 x (4 + PPCR). This calculation gives
68 * the exact rate. The figures given in the table are the rates rounded
69 * to 100kHz. Stick with sa11x0_getspeed() for the time being.
70 */
71static unsigned long clk_mpll_recalc_rate(struct clk_hw *hw,
72 unsigned long prate)
91{ 73{
92 return sa11x0_getspeed(0) * 1000; 74 return sa11x0_getspeed(0) * 1000;
93} 75}
94 76
95int clk_enable(struct clk *clk) 77static const struct clk_ops clk_mpll_ops = {
96{ 78 .recalc_rate = clk_mpll_recalc_rate,
97 unsigned long flags; 79};
98
99 if (clk) {
100 spin_lock_irqsave(&clocks_lock, flags);
101 if (clk->enabled++ == 0)
102 clk->ops->enable(clk);
103 spin_unlock_irqrestore(&clocks_lock, flags);
104 }
105
106 return 0;
107}
108EXPORT_SYMBOL(clk_enable);
109 80
110void clk_disable(struct clk *clk) 81static const char * const clk_mpll_parents[] = {
111{ 82 "clk3686400",
112 unsigned long flags; 83};
113 84
114 if (clk) { 85static const struct clk_init_data clk_mpll_init_data __initconst = {
115 WARN_ON(clk->enabled == 0); 86 .name = "mpll",
116 spin_lock_irqsave(&clocks_lock, flags); 87 .ops = &clk_mpll_ops,
117 if (--clk->enabled == 0) 88 .parent_names = clk_mpll_parents,
118 clk->ops->disable(clk); 89 .num_parents = ARRAY_SIZE(clk_mpll_parents),
119 spin_unlock_irqrestore(&clocks_lock, flags); 90 .flags = CLK_GET_RATE_NOCACHE | CLK_IS_CRITICAL,
120 } 91};
121}
122EXPORT_SYMBOL(clk_disable);
123 92
124unsigned long clk_get_rate(struct clk *clk) 93int __init sa11xx_clk_init(void)
125{ 94{
126 if (clk && clk->ops && clk->ops->get_rate) 95 struct clk_hw *hw;
127 return clk->ops->get_rate(clk); 96 int ret;
128
129 return 0;
130}
131EXPORT_SYMBOL(clk_get_rate);
132 97
133const struct clkops clk_gpio27_ops = { 98 hw = clk_hw_register_fixed_rate(NULL, "clk32768", NULL, 0, 32768);
134 .enable = clk_gpio27_enable, 99 if (IS_ERR(hw))
135 .disable = clk_gpio27_disable, 100 return PTR_ERR(hw);
136};
137 101
138const struct clkops clk_cpu_ops = { 102 clk_hw_register_clkdev(hw, NULL, "sa1100-rtc");
139 .enable = clk_cpu_enable,
140 .disable = clk_cpu_disable,
141 .get_rate = clk_cpu_get_rate,
142};
143 103
144static DEFINE_CLK(gpio27, &clk_gpio27_ops); 104 hw = clk_hw_register_fixed_rate(NULL, "clk3686400", NULL, 0, 3686400);
105 if (IS_ERR(hw))
106 return PTR_ERR(hw);
145 107
146static DEFINE_CLK(cpu, &clk_cpu_ops); 108 clk_hw_register_clkdev(hw, "OSTIMER0", NULL);
147 109
148static unsigned long clk_36864_get_rate(struct clk *clk) 110 hw = kzalloc(sizeof(*hw), GFP_KERNEL);
149{ 111 if (!hw)
150 return 3686400; 112 return -ENOMEM;
151} 113 hw->init = &clk_mpll_init_data;
114 ret = clk_hw_register(NULL, hw);
115 if (ret) {
116 kfree(hw);
117 return ret;
118 }
152 119
153static struct clkops clk_36864_ops = { 120 clk_hw_register_clkdev(hw, NULL, "sa11x0-fb");
154 .enable = clk_cpu_enable, 121 clk_hw_register_clkdev(hw, NULL, "sa11x0-pcmcia");
155 .disable = clk_cpu_disable, 122 clk_hw_register_clkdev(hw, NULL, "sa11x0-pcmcia.0");
156 .get_rate = clk_36864_get_rate, 123 clk_hw_register_clkdev(hw, NULL, "sa11x0-pcmcia.1");
157}; 124 clk_hw_register_clkdev(hw, NULL, "1800");
125
126 hw = clk_hw_register_mux(NULL, "tucr-mux", clk_tucr_parents,
127 ARRAY_SIZE(clk_tucr_parents), 0,
128 (void __iomem *)&TUCR, FShft(TUCR_TSEL),
129 FAlnMsk(TUCR_TSEL), 0, &tucr_lock);
130 clk_set_rate(hw->clk, 3686400);
131
132 hw = kzalloc(sizeof(*hw), GFP_KERNEL);
133 if (!hw)
134 return -ENOMEM;
135 hw->init = &clk_gpio27_init_data;
136 ret = clk_hw_register(NULL, hw);
137 if (ret) {
138 kfree(hw);
139 return ret;
140 }
158 141
159static DEFINE_CLK(36864, &clk_36864_ops); 142 clk_hw_register_clkdev(hw, NULL, "sa1111.0");
160
161static struct clk_lookup sa11xx_clkregs[] = {
162 CLKDEV_INIT("sa1111.0", NULL, &clk_gpio27),
163 CLKDEV_INIT("sa1100-rtc", NULL, NULL),
164 CLKDEV_INIT("sa11x0-fb", NULL, &clk_cpu),
165 CLKDEV_INIT("sa11x0-pcmcia", NULL, &clk_cpu),
166 CLKDEV_INIT("sa11x0-pcmcia.0", NULL, &clk_cpu),
167 CLKDEV_INIT("sa11x0-pcmcia.1", NULL, &clk_cpu),
168 /* sa1111 names devices using internal offsets, PCMCIA is at 0x1800 */
169 CLKDEV_INIT("1800", NULL, &clk_cpu),
170 CLKDEV_INIT(NULL, "OSTIMER0", &clk_36864),
171};
172 143
173int __init sa11xx_clk_init(void)
174{
175 clkdev_add_table(sa11xx_clkregs, ARRAY_SIZE(sa11xx_clkregs));
176 return 0; 144 return 0;
177} 145}
diff --git a/arch/arm/mach-sa1100/h3xxx.c b/arch/arm/mach-sa1100/h3xxx.c
index e93e3a1d60d5..d685f03f51f3 100644
--- a/arch/arm/mach-sa1100/h3xxx.c
+++ b/arch/arm/mach-sa1100/h3xxx.c
@@ -83,57 +83,6 @@ static struct resource h3xxx_flash_resource =
83/* 83/*
84 * H3xxx uart support 84 * H3xxx uart support
85 */ 85 */
86static struct gpio h3xxx_uart_gpio[] = {
87 { H3XXX_GPIO_COM_DCD, GPIOF_IN, "COM DCD" },
88 { H3XXX_GPIO_COM_CTS, GPIOF_IN, "COM CTS" },
89 { H3XXX_GPIO_COM_RTS, GPIOF_OUT_INIT_LOW, "COM RTS" },
90};
91
92static bool h3xxx_uart_request_gpios(void)
93{
94 static bool h3xxx_uart_gpio_ok;
95 int rc;
96
97 if (h3xxx_uart_gpio_ok)
98 return true;
99
100 rc = gpio_request_array(h3xxx_uart_gpio, ARRAY_SIZE(h3xxx_uart_gpio));
101 if (rc)
102 pr_err("h3xxx_uart_request_gpios: error %d\n", rc);
103 else
104 h3xxx_uart_gpio_ok = true;
105
106 return h3xxx_uart_gpio_ok;
107}
108
109static void h3xxx_uart_set_mctrl(struct uart_port *port, u_int mctrl)
110{
111 if (port->mapbase == _Ser3UTCR0) {
112 if (!h3xxx_uart_request_gpios())
113 return;
114 gpio_set_value(H3XXX_GPIO_COM_RTS, !(mctrl & TIOCM_RTS));
115 }
116}
117
118static u_int h3xxx_uart_get_mctrl(struct uart_port *port)
119{
120 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
121
122 if (port->mapbase == _Ser3UTCR0) {
123 if (!h3xxx_uart_request_gpios())
124 return ret;
125 /*
126 * DCD and CTS bits are inverted in GPLR by RS232 transceiver
127 */
128 if (gpio_get_value(H3XXX_GPIO_COM_DCD))
129 ret &= ~TIOCM_CD;
130 if (gpio_get_value(H3XXX_GPIO_COM_CTS))
131 ret &= ~TIOCM_CTS;
132 }
133
134 return ret;
135}
136
137static void h3xxx_uart_pm(struct uart_port *port, u_int state, u_int oldstate) 86static void h3xxx_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
138{ 87{
139 if (port->mapbase == _Ser3UTCR0) { 88 if (port->mapbase == _Ser3UTCR0) {
@@ -166,12 +115,20 @@ static int h3xxx_uart_set_wake(struct uart_port *port, u_int enable)
166} 115}
167 116
168static struct sa1100_port_fns h3xxx_port_fns __initdata = { 117static struct sa1100_port_fns h3xxx_port_fns __initdata = {
169 .set_mctrl = h3xxx_uart_set_mctrl,
170 .get_mctrl = h3xxx_uart_get_mctrl,
171 .pm = h3xxx_uart_pm, 118 .pm = h3xxx_uart_pm,
172 .set_wake = h3xxx_uart_set_wake, 119 .set_wake = h3xxx_uart_set_wake,
173}; 120};
174 121
122static struct gpiod_lookup_table h3xxx_uart3_gpio_table = {
123 .dev_id = "sa11x0-uart.3",
124 .table = {
125 GPIO_LOOKUP("gpio", H3XXX_GPIO_COM_DCD, "dcd", GPIO_ACTIVE_LOW),
126 GPIO_LOOKUP("gpio", H3XXX_GPIO_COM_CTS, "cts", GPIO_ACTIVE_LOW),
127 GPIO_LOOKUP("gpio", H3XXX_GPIO_COM_RTS, "rts", GPIO_ACTIVE_LOW),
128 { },
129 },
130};
131
175/* 132/*
176 * EGPIO 133 * EGPIO
177 */ 134 */
@@ -279,6 +236,7 @@ static struct gpiod_lookup_table h3xxx_pcmcia_gpio_table = {
279void __init h3xxx_mach_init(void) 236void __init h3xxx_mach_init(void)
280{ 237{
281 gpiod_add_lookup_table(&h3xxx_pcmcia_gpio_table); 238 gpiod_add_lookup_table(&h3xxx_pcmcia_gpio_table);
239 gpiod_add_lookup_table(&h3xxx_uart3_gpio_table);
282 sa1100_register_uart_fns(&h3xxx_port_fns); 240 sa1100_register_uart_fns(&h3xxx_port_fns);
283 sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1); 241 sa11x0_register_mtd(&h3xxx_flash_data, &h3xxx_flash_resource, 1);
284 platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices)); 242 platform_add_devices(h3xxx_devices, ARRAY_SIZE(h3xxx_devices));
diff --git a/arch/arm/mach-sa1100/hackkit.c b/arch/arm/mach-sa1100/hackkit.c
index 4f4c1bb890e0..6d37d263e0d2 100644
--- a/arch/arm/mach-sa1100/hackkit.c
+++ b/arch/arm/mach-sa1100/hackkit.c
@@ -45,8 +45,6 @@
45/* init funcs */ 45/* init funcs */
46static void __init hackkit_map_io(void); 46static void __init hackkit_map_io(void);
47 47
48static u_int hackkit_get_mctrl(struct uart_port *port);
49static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl);
50static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate); 48static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate);
51 49
52/********************************************************************** 50/**********************************************************************
@@ -67,8 +65,6 @@ static struct map_desc hackkit_io_desc[] __initdata = {
67}; 65};
68 66
69static struct sa1100_port_fns hackkit_port_fns __initdata = { 67static struct sa1100_port_fns hackkit_port_fns __initdata = {
70 .set_mctrl = hackkit_set_mctrl,
71 .get_mctrl = hackkit_get_mctrl,
72 .pm = hackkit_uart_pm, 68 .pm = hackkit_uart_pm,
73}; 69};
74 70
@@ -101,50 +97,6 @@ static void hackkit_uart_pm(struct uart_port *port, u_int state, u_int oldstate)
101 /* TODO: switch on/off uart in powersave mode */ 97 /* TODO: switch on/off uart in powersave mode */
102} 98}
103 99
104/*
105 * Note! this can be called from IRQ context.
106 * FIXME: No modem ctrl lines yet.
107 */
108static void hackkit_set_mctrl(struct uart_port *port, u_int mctrl)
109{
110#if 0
111 if (port->mapbase == _Ser1UTCR0) {
112 u_int set = 0, clear = 0;
113
114 if (mctrl & TIOCM_RTS)
115 set |= PT_CTRL2_RS1_RTS;
116 else
117 clear |= PT_CTRL2_RS1_RTS;
118
119 if (mctrl & TIOCM_DTR)
120 set |= PT_CTRL2_RS1_DTR;
121 else
122 clear |= PT_CTRL2_RS1_DTR;
123
124 PTCTRL2_clear(clear);
125 PTCTRL2_set(set);
126 }
127#endif
128}
129
130static u_int hackkit_get_mctrl(struct uart_port *port)
131{
132 u_int ret = 0;
133#if 0
134 u_int irqsr = PT_IRQSR;
135
136 /* need 2 reads to read current value */
137 irqsr = PT_IRQSR;
138
139 /* TODO: check IRQ source register for modem/com
140 status lines and set them correctly. */
141#endif
142
143 ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
144
145 return ret;
146}
147
148static struct mtd_partition hackkit_partitions[] = { 100static struct mtd_partition hackkit_partitions[] = {
149 { 101 {
150 .name = "BLOB", 102 .name = "BLOB",
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
index a671e4c994cf..6876bc1e33b4 100644
--- a/arch/arm/mach-sa1100/neponset.c
+++ b/arch/arm/mach-sa1100/neponset.c
@@ -11,7 +11,6 @@
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/platform_data/sa11x0-serial.h>
15#include <linux/platform_device.h> 14#include <linux/platform_device.h>
16#include <linux/pm.h> 15#include <linux/pm.h>
17#include <linux/serial_core.h> 16#include <linux/serial_core.h>
@@ -49,23 +48,8 @@
49#define IRR_SA1111 (1 << 2) 48#define IRR_SA1111 (1 << 2)
50 49
51#define NCR_NGPIO 7 50#define NCR_NGPIO 7
52
53#define MDM_CTL0_RTS1 (1 << 0)
54#define MDM_CTL0_DTR1 (1 << 1)
55#define MDM_CTL0_RTS2 (1 << 2)
56#define MDM_CTL0_DTR2 (1 << 3)
57#define MDM_CTL0_NGPIO 4 51#define MDM_CTL0_NGPIO 4
58
59#define MDM_CTL1_CTS1 (1 << 0)
60#define MDM_CTL1_DSR1 (1 << 1)
61#define MDM_CTL1_DCD1 (1 << 2)
62#define MDM_CTL1_CTS2 (1 << 3)
63#define MDM_CTL1_DSR2 (1 << 4)
64#define MDM_CTL1_DCD2 (1 << 5)
65#define MDM_CTL1_NGPIO 6 52#define MDM_CTL1_NGPIO 6
66
67#define AUD_SEL_1341 (1 << 0)
68#define AUD_MUTE_1341 (1 << 1)
69#define AUD_NGPIO 2 53#define AUD_NGPIO 2
70 54
71extern void sa1110_mb_disable(void); 55extern void sa1110_mb_disable(void);
@@ -97,6 +81,30 @@ struct neponset_drvdata {
97 struct gpio_chip *gpio[4]; 81 struct gpio_chip *gpio[4];
98}; 82};
99 83
84static struct gpiod_lookup_table neponset_uart1_gpio_table = {
85 .dev_id = "sa11x0-uart.1",
86 .table = {
87 GPIO_LOOKUP("neponset-mdm-ctl0", 2, "rts", GPIO_ACTIVE_LOW),
88 GPIO_LOOKUP("neponset-mdm-ctl0", 3, "dtr", GPIO_ACTIVE_LOW),
89 GPIO_LOOKUP("neponset-mdm-ctl1", 3, "cts", GPIO_ACTIVE_LOW),
90 GPIO_LOOKUP("neponset-mdm-ctl1", 4, "dsr", GPIO_ACTIVE_LOW),
91 GPIO_LOOKUP("neponset-mdm-ctl1", 5, "dcd", GPIO_ACTIVE_LOW),
92 { },
93 },
94};
95
96static struct gpiod_lookup_table neponset_uart3_gpio_table = {
97 .dev_id = "sa11x0-uart.3",
98 .table = {
99 GPIO_LOOKUP("neponset-mdm-ctl0", 0, "rts", GPIO_ACTIVE_LOW),
100 GPIO_LOOKUP("neponset-mdm-ctl0", 1, "dtr", GPIO_ACTIVE_LOW),
101 GPIO_LOOKUP("neponset-mdm-ctl1", 0, "cts", GPIO_ACTIVE_LOW),
102 GPIO_LOOKUP("neponset-mdm-ctl1", 1, "dsr", GPIO_ACTIVE_LOW),
103 GPIO_LOOKUP("neponset-mdm-ctl1", 2, "dcd", GPIO_ACTIVE_LOW),
104 { },
105 },
106};
107
100static struct gpiod_lookup_table neponset_pcmcia_table = { 108static struct gpiod_lookup_table neponset_pcmcia_table = {
101 .dev_id = "1800", 109 .dev_id = "1800",
102 .table = { 110 .table = {
@@ -124,69 +132,6 @@ void neponset_ncr_frob(unsigned int mask, unsigned int val)
124} 132}
125EXPORT_SYMBOL(neponset_ncr_frob); 133EXPORT_SYMBOL(neponset_ncr_frob);
126 134
127static void neponset_set_mctrl(struct uart_port *port, u_int mctrl)
128{
129 struct neponset_drvdata *n = nep;
130 unsigned long mask, val = 0;
131
132 if (!n)
133 return;
134
135 if (port->mapbase == _Ser1UTCR0) {
136 mask = MDM_CTL0_RTS2 | MDM_CTL0_DTR2;
137
138 if (!(mctrl & TIOCM_RTS))
139 val |= MDM_CTL0_RTS2;
140
141 if (!(mctrl & TIOCM_DTR))
142 val |= MDM_CTL0_DTR2;
143 } else if (port->mapbase == _Ser3UTCR0) {
144 mask = MDM_CTL0_RTS1 | MDM_CTL0_DTR1;
145
146 if (!(mctrl & TIOCM_RTS))
147 val |= MDM_CTL0_RTS1;
148
149 if (!(mctrl & TIOCM_DTR))
150 val |= MDM_CTL0_DTR1;
151 }
152
153 n->gpio[1]->set_multiple(n->gpio[1], &mask, &val);
154}
155
156static u_int neponset_get_mctrl(struct uart_port *port)
157{
158 void __iomem *base = nep->base;
159 u_int ret = TIOCM_CD | TIOCM_CTS | TIOCM_DSR;
160 u_int mdm_ctl1;
161
162 if (!base)
163 return ret;
164
165 mdm_ctl1 = readb_relaxed(base + MDM_CTL_1);
166 if (port->mapbase == _Ser1UTCR0) {
167 if (mdm_ctl1 & MDM_CTL1_DCD2)
168 ret &= ~TIOCM_CD;
169 if (mdm_ctl1 & MDM_CTL1_CTS2)
170 ret &= ~TIOCM_CTS;
171 if (mdm_ctl1 & MDM_CTL1_DSR2)
172 ret &= ~TIOCM_DSR;
173 } else if (port->mapbase == _Ser3UTCR0) {
174 if (mdm_ctl1 & MDM_CTL1_DCD1)
175 ret &= ~TIOCM_CD;
176 if (mdm_ctl1 & MDM_CTL1_CTS1)
177 ret &= ~TIOCM_CTS;
178 if (mdm_ctl1 & MDM_CTL1_DSR1)
179 ret &= ~TIOCM_DSR;
180 }
181
182 return ret;
183}
184
185static struct sa1100_port_fns neponset_port_fns = {
186 .set_mctrl = neponset_set_mctrl,
187 .get_mctrl = neponset_get_mctrl,
188};
189
190/* 135/*
191 * Install handler for Neponset IRQ. Note that we have to loop here 136 * Install handler for Neponset IRQ. Note that we have to loop here
192 * since the ETHERNET and USAR IRQs are level based, and we need to 137 * since the ETHERNET and USAR IRQs are level based, and we need to
@@ -388,6 +333,8 @@ static int neponset_probe(struct platform_device *dev)
388 d->base + AUD_CTL, AUD_NGPIO, false, 333 d->base + AUD_CTL, AUD_NGPIO, false,
389 neponset_aud_names); 334 neponset_aud_names);
390 335
336 gpiod_add_lookup_table(&neponset_uart1_gpio_table);
337 gpiod_add_lookup_table(&neponset_uart3_gpio_table);
391 gpiod_add_lookup_table(&neponset_pcmcia_table); 338 gpiod_add_lookup_table(&neponset_pcmcia_table);
392 339
393 /* 340 /*
@@ -402,8 +349,6 @@ static int neponset_probe(struct platform_device *dev)
402 d->irq_base, d->irq_base + NEP_IRQ_NR - 1); 349 d->irq_base, d->irq_base + NEP_IRQ_NR - 1);
403 nep = d; 350 nep = d;
404 351
405 sa1100_register_uart_fns(&neponset_port_fns);
406
407 /* Ensure that the memory bus request/grant signals are setup */ 352 /* Ensure that the memory bus request/grant signals are setup */
408 sa1110_mb_disable(); 353 sa1110_mb_disable();
409 354
@@ -442,6 +387,8 @@ static int neponset_remove(struct platform_device *dev)
442 platform_device_unregister(d->smc91x); 387 platform_device_unregister(d->smc91x);
443 388
444 gpiod_remove_lookup_table(&neponset_pcmcia_table); 389 gpiod_remove_lookup_table(&neponset_pcmcia_table);
390 gpiod_remove_lookup_table(&neponset_uart3_gpio_table);
391 gpiod_remove_lookup_table(&neponset_uart1_gpio_table);
445 392
446 irq_set_chained_handler(irq, NULL); 393 irq_set_chained_handler(irq, NULL);
447 irq_free_descs(d->irq_base, NEP_IRQ_NR); 394 irq_free_descs(d->irq_base, NEP_IRQ_NR);
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index eea60b20c6b4..9e4bc1865f84 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -17,6 +17,7 @@
17#include <linux/of.h> 17#include <linux/of.h>
18#include <linux/of_fdt.h> 18#include <linux/of_fdt.h>
19#include <linux/of_platform.h> 19#include <linux/of_platform.h>
20#include <linux/psci.h>
20#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
21#include <asm/secure_cntvoff.h> 22#include <asm/secure_cntvoff.h>
22#include "common.h" 23#include "common.h"
@@ -60,9 +61,24 @@ static unsigned int __init get_extal_freq(void)
60 61
61void __init rcar_gen2_timer_init(void) 62void __init rcar_gen2_timer_init(void)
62{ 63{
64 bool need_update = true;
63 void __iomem *base; 65 void __iomem *base;
64 u32 freq; 66 u32 freq;
65 67
68 /*
69 * If PSCI is available then most likely we are running on PSCI-enabled
70 * U-Boot which, we assume, has already taken care of resetting CNTVOFF
71 * and updating counter module before switching to non-secure mode
72 * and we don't need to.
73 */
74#ifdef CONFIG_ARM_PSCI_FW
75 if (psci_ops.cpu_on)
76 need_update = false;
77#endif
78
79 if (need_update == false)
80 goto skip_update;
81
66 secure_cntvoff_init(); 82 secure_cntvoff_init();
67 83
68 if (of_machine_is_compatible("renesas,r8a7745") || 84 if (of_machine_is_compatible("renesas,r8a7745") ||
@@ -102,6 +118,7 @@ void __init rcar_gen2_timer_init(void)
102 118
103 iounmap(base); 119 iounmap(base);
104 120
121skip_update:
105 of_clk_init(NULL); 122 of_clk_init(NULL);
106 timer_probe(); 123 timer_probe();
107} 124}
diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig
index 05d6b5aada80..57699bd8f107 100644
--- a/arch/arm/mach-stm32/Kconfig
+++ b/arch/arm/mach-stm32/Kconfig
@@ -1,6 +1,7 @@
1# SPDX-License-Identifier: GPL-2.0-only 1# SPDX-License-Identifier: GPL-2.0-only
2menuconfig ARCH_STM32 2menuconfig ARCH_STM32
3 bool "STMicroelectronics STM32 family" if ARM_SINGLE_ARMV7M || ARCH_MULTI_V7 3 bool "STMicroelectronics STM32 family"
4 depends on ARM_SINGLE_ARMV7M || ARCH_MULTI_V7
4 select ARMV7M_SYSTICK if ARM_SINGLE_ARMV7M 5 select ARMV7M_SYSTICK if ARM_SINGLE_ARMV7M
5 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7 6 select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7
6 select ARM_GIC if ARCH_MULTI_V7 7 select ARM_GIC if ARCH_MULTI_V7
diff --git a/arch/arm/mach-tango/Makefile b/arch/arm/mach-tango/Makefile
index da6c633d3cc0..97cd04508fa1 100644
--- a/arch/arm/mach-tango/Makefile
+++ b/arch/arm/mach-tango/Makefile
@@ -1,7 +1,4 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2plus_sec := $(call as-instr,.arch_extension sec,+sec)
3AFLAGS_smc.o := -Wa,-march=armv7-a$(plus_sec)
4
5obj-y += setup.o smc.o 2obj-y += setup.o smc.o
6obj-$(CONFIG_SMP) += platsmp.o 3obj-$(CONFIG_SMP) += platsmp.o
7obj-$(CONFIG_SUSPEND) += pm.o 4obj-$(CONFIG_SUSPEND) += pm.o
diff --git a/arch/arm/mach-tango/smc.S b/arch/arm/mach-tango/smc.S
index 361a8dc89804..b1752aaa72bc 100644
--- a/arch/arm/mach-tango/smc.S
+++ b/arch/arm/mach-tango/smc.S
@@ -1,6 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0 */ 1/* SPDX-License-Identifier: GPL-2.0 */
2#include <linux/linkage.h> 2#include <linux/linkage.h>
3 3
4 .arch armv7-a
5 .arch_extension sec
4ENTRY(tango_smc) 6ENTRY(tango_smc)
5 push {lr} 7 push {lr}
6 mov ip, r1 8 mov ip, r1
diff --git a/arch/arm/mach-versatile/versatile_dt.c b/arch/arm/mach-versatile/versatile_dt.c
index 0b763239c0f8..c00ea4f77af6 100644
--- a/arch/arm/mach-versatile/versatile_dt.c
+++ b/arch/arm/mach-versatile/versatile_dt.c
@@ -16,8 +16,6 @@
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/amba/bus.h> 18#include <linux/amba/bus.h>
19#include <linux/amba/clcd.h>
20#include <linux/platform_data/video-clcd-versatile.h>
21#include <linux/amba/mmci.h> 19#include <linux/amba/mmci.h>
22#include <asm/mach-types.h> 20#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 21#include <asm/mach/arch.h>
@@ -34,14 +32,12 @@
34 */ 32 */
35#define VERSATILE_SYS_PCICTL_OFFSET 0x44 33#define VERSATILE_SYS_PCICTL_OFFSET 0x44
36#define VERSATILE_SYS_MCI_OFFSET 0x48 34#define VERSATILE_SYS_MCI_OFFSET 0x48
37#define VERSATILE_SYS_CLCD_OFFSET 0x50
38 35
39/* 36/*
40 * VERSATILE peripheral addresses 37 * VERSATILE peripheral addresses
41 */ 38 */
42#define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */ 39#define VERSATILE_MMCI0_BASE 0x10005000 /* MMC interface */
43#define VERSATILE_MMCI1_BASE 0x1000B000 /* MMC Interface */ 40#define VERSATILE_MMCI1_BASE 0x1000B000 /* MMC Interface */
44#define VERSATILE_CLCD_BASE 0x10120000 /* CLCD */
45#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */ 41#define VERSATILE_SCTL_BASE 0x101E0000 /* System controller */
46#define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */ 42#define VERSATILE_IB2_BASE 0x24000000 /* IB2 module */
47#define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000) 43#define VERSATILE_IB2_CTL_BASE (VERSATILE_IB2_BASE + 0x03000000)
@@ -84,158 +80,6 @@ static struct mmci_platform_data mmc1_plat_data = {
84}; 80};
85 81
86/* 82/*
87 * CLCD support.
88 */
89#define SYS_CLCD_MODE_MASK (3 << 0)
90#define SYS_CLCD_MODE_888 (0 << 0)
91#define SYS_CLCD_MODE_5551 (1 << 0)
92#define SYS_CLCD_MODE_565_RLSB (2 << 0)
93#define SYS_CLCD_MODE_565_BLSB (3 << 0)
94#define SYS_CLCD_NLCDIOON (1 << 2)
95#define SYS_CLCD_VDDPOSSWITCH (1 << 3)
96#define SYS_CLCD_PWR3V5SWITCH (1 << 4)
97#define SYS_CLCD_ID_MASK (0x1f << 8)
98#define SYS_CLCD_ID_SANYO_3_8 (0x00 << 8)
99#define SYS_CLCD_ID_UNKNOWN_8_4 (0x01 << 8)
100#define SYS_CLCD_ID_EPSON_2_2 (0x02 << 8)
101#define SYS_CLCD_ID_SANYO_2_5 (0x07 << 8)
102#define SYS_CLCD_ID_VGA (0x1f << 8)
103
104static bool is_sanyo_2_5_lcd;
105
106/*
107 * Disable all display connectors on the interface module.
108 */
109static void versatile_clcd_disable(struct clcd_fb *fb)
110{
111 void __iomem *sys_clcd = versatile_sys_base + VERSATILE_SYS_CLCD_OFFSET;
112 u32 val;
113
114 val = readl(sys_clcd);
115 val &= ~SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
116 writel(val, sys_clcd);
117
118 /*
119 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off
120 */
121 if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
122 unsigned long ctrl;
123
124 ctrl = readl(versatile_ib2_ctrl);
125 ctrl &= ~0x01;
126 writel(ctrl, versatile_ib2_ctrl);
127 }
128}
129
130/*
131 * Enable the relevant connector on the interface module.
132 */
133static void versatile_clcd_enable(struct clcd_fb *fb)
134{
135 struct fb_var_screeninfo *var = &fb->fb.var;
136 void __iomem *sys_clcd = versatile_sys_base + VERSATILE_SYS_CLCD_OFFSET;
137 u32 val;
138
139 val = readl(sys_clcd);
140 val &= ~SYS_CLCD_MODE_MASK;
141
142 switch (var->green.length) {
143 case 5:
144 val |= SYS_CLCD_MODE_5551;
145 break;
146 case 6:
147 if (var->red.offset == 0)
148 val |= SYS_CLCD_MODE_565_RLSB;
149 else
150 val |= SYS_CLCD_MODE_565_BLSB;
151 break;
152 case 8:
153 val |= SYS_CLCD_MODE_888;
154 break;
155 }
156
157 /*
158 * Set the MUX
159 */
160 writel(val, sys_clcd);
161
162 /*
163 * And now enable the PSUs
164 */
165 val |= SYS_CLCD_NLCDIOON | SYS_CLCD_PWR3V5SWITCH;
166 writel(val, sys_clcd);
167
168 /*
169 * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on
170 */
171 if (of_machine_is_compatible("arm,versatile-ab") && is_sanyo_2_5_lcd) {
172 unsigned long ctrl;
173
174 ctrl = readl(versatile_ib2_ctrl);
175 ctrl |= 0x01;
176 writel(ctrl, versatile_ib2_ctrl);
177 }
178}
179
180/*
181 * Detect which LCD panel is connected, and return the appropriate
182 * clcd_panel structure. Note: we do not have any information on
183 * the required timings for the 8.4in panel, so we presently assume
184 * VGA timings.
185 */
186static int versatile_clcd_setup(struct clcd_fb *fb)
187{
188 void __iomem *sys_clcd = versatile_sys_base + VERSATILE_SYS_CLCD_OFFSET;
189 const char *panel_name;
190 u32 val;
191
192 is_sanyo_2_5_lcd = false;
193
194 val = readl(sys_clcd) & SYS_CLCD_ID_MASK;
195 if (val == SYS_CLCD_ID_SANYO_3_8)
196 panel_name = "Sanyo TM38QV67A02A";
197 else if (val == SYS_CLCD_ID_SANYO_2_5) {
198 panel_name = "Sanyo QVGA Portrait";
199 is_sanyo_2_5_lcd = true;
200 } else if (val == SYS_CLCD_ID_EPSON_2_2)
201 panel_name = "Epson L2F50113T00";
202 else if (val == SYS_CLCD_ID_VGA)
203 panel_name = "VGA";
204 else {
205 printk(KERN_ERR "CLCD: unknown LCD panel ID 0x%08x, using VGA\n",
206 val);
207 panel_name = "VGA";
208 }
209
210 fb->panel = versatile_clcd_get_panel(panel_name);
211 if (!fb->panel)
212 return -EINVAL;
213
214 return versatile_clcd_setup_dma(fb, SZ_1M);
215}
216
217static void versatile_clcd_decode(struct clcd_fb *fb, struct clcd_regs *regs)
218{
219 clcdfb_decode(fb, regs);
220
221 /* Always clear BGR for RGB565: we do the routing externally */
222 if (fb->fb.var.green.length == 6)
223 regs->cntl &= ~CNTL_BGR;
224}
225
226static struct clcd_board clcd_plat_data = {
227 .name = "Versatile",
228 .caps = CLCD_CAP_5551 | CLCD_CAP_565 | CLCD_CAP_888,
229 .check = clcdfb_check,
230 .decode = versatile_clcd_decode,
231 .disable = versatile_clcd_disable,
232 .enable = versatile_clcd_enable,
233 .setup = versatile_clcd_setup,
234 .mmap = versatile_clcd_mmap_dma,
235 .remove = versatile_clcd_remove_dma,
236};
237
238/*
239 * Lookup table for attaching a specific name and platform_data pointer to 83 * Lookup table for attaching a specific name and platform_data pointer to
240 * devices as they get created by of_platform_populate(). Ideally this table 84 * devices as they get created by of_platform_populate(). Ideally this table
241 * would not exist, but the current clock implementation depends on some devices 85 * would not exist, but the current clock implementation depends on some devices
@@ -244,7 +88,6 @@ static struct clcd_board clcd_plat_data = {
244struct of_dev_auxdata versatile_auxdata_lookup[] __initdata = { 88struct of_dev_auxdata versatile_auxdata_lookup[] __initdata = {
245 OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", &mmc0_plat_data), 89 OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI0_BASE, "fpga:05", &mmc0_plat_data),
246 OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", &mmc1_plat_data), 90 OF_DEV_AUXDATA("arm,primecell", VERSATILE_MMCI1_BASE, "fpga:0b", &mmc1_plat_data),
247 OF_DEV_AUXDATA("arm,primecell", VERSATILE_CLCD_BASE, "dev:20", &clcd_plat_data),
248 {} 91 {}
249}; 92};
250 93
@@ -299,12 +142,12 @@ static void __init versatile_dt_pci_init(void)
299 * driver had it so we will keep it. 142 * driver had it so we will keep it.
300 */ 143 */
301 writel(1, versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET); 144 writel(1, versatile_sys_base + VERSATILE_SYS_PCICTL_OFFSET);
302 return; 145 goto out_put_node;
303 } 146 }
304 147
305 newprop = kzalloc(sizeof(*newprop), GFP_KERNEL); 148 newprop = kzalloc(sizeof(*newprop), GFP_KERNEL);
306 if (!newprop) 149 if (!newprop)
307 return; 150 goto out_put_node;
308 151
309 newprop->name = kstrdup("status", GFP_KERNEL); 152 newprop->name = kstrdup("status", GFP_KERNEL);
310 newprop->value = kstrdup("disabled", GFP_KERNEL); 153 newprop->value = kstrdup("disabled", GFP_KERNEL);
@@ -312,6 +155,9 @@ static void __init versatile_dt_pci_init(void)
312 of_update_property(np, newprop); 155 of_update_property(np, newprop);
313 156
314 pr_info("Not plugged into PCI backplane!\n"); 157 pr_info("Not plugged into PCI backplane!\n");
158
159out_put_node:
160 of_node_put(np);
315} 161}
316 162
317static void __init versatile_dt_init(void) 163static void __init versatile_dt_init(void)
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index d07fc063c930..4778c775de1b 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -66,8 +66,11 @@ config ARCH_BITMAIN
66 66
67config ARCH_BRCMSTB 67config ARCH_BRCMSTB
68 bool "Broadcom Set-Top-Box SoCs" 68 bool "Broadcom Set-Top-Box SoCs"
69 select ARCH_HAS_RESET_CONTROLLER
70 select BCM7038_L1_IRQ
69 select BRCMSTB_L2_IRQ 71 select BRCMSTB_L2_IRQ
70 select GENERIC_IRQ_CHIP 72 select GENERIC_IRQ_CHIP
73 select PINCTRL
71 help 74 help
72 This enables support for Broadcom's ARMv8 Set Top Box SoCs 75 This enables support for Broadcom's ARMv8 Set Top Box SoCs
73 76
diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig
index 68bfca6f20dd..2bbf49e5d441 100644
--- a/drivers/soc/renesas/Kconfig
+++ b/drivers/soc/renesas/Kconfig
@@ -57,14 +57,16 @@ config ARCH_R7S72100
57 bool "RZ/A1H (R7S72100)" 57 bool "RZ/A1H (R7S72100)"
58 select PM 58 select PM
59 select PM_GENERIC_DOMAINS 59 select PM_GENERIC_DOMAINS
60 select SYS_SUPPORTS_SH_MTU2
61 select RENESAS_OSTM 60 select RENESAS_OSTM
61 select RENESAS_RZA1_IRQC
62 select SYS_SUPPORTS_SH_MTU2
62 63
63config ARCH_R7S9210 64config ARCH_R7S9210
64 bool "RZ/A2 (R7S9210)" 65 bool "RZ/A2 (R7S9210)"
65 select PM 66 select PM
66 select PM_GENERIC_DOMAINS 67 select PM_GENERIC_DOMAINS
67 select RENESAS_OSTM 68 select RENESAS_OSTM
69 select RENESAS_RZA1_IRQC
68 70
69config ARCH_R8A73A4 71config ARCH_R8A73A4
70 bool "R-Mobile APE6 (R8A73A40)" 72 bool "R-Mobile APE6 (R8A73A40)"
diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c
index fc5802ccb1c0..bb77c220b6f8 100644
--- a/drivers/soc/ti/pm33xx.c
+++ b/drivers/soc/ti/pm33xx.c
@@ -178,6 +178,7 @@ static int am33xx_pm_suspend(suspend_state_t suspend_state)
178 suspend_wfi_flags); 178 suspend_wfi_flags);
179 179
180 suspend_wfi_flags &= ~WFI_FLAG_RTC_ONLY; 180 suspend_wfi_flags &= ~WFI_FLAG_RTC_ONLY;
181 dev_info(pm33xx_dev, "Entering RTC Only mode with DDR in self-refresh\n");
181 182
182 if (!ret) { 183 if (!ret) {
183 clk_restore_context(); 184 clk_restore_context();
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 04c23951b831..fd385c8c53a5 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -497,6 +497,7 @@ config SERIAL_SA1100
497 bool "SA1100 serial port support" 497 bool "SA1100 serial port support"
498 depends on ARCH_SA1100 498 depends on ARCH_SA1100
499 select SERIAL_CORE 499 select SERIAL_CORE
500 select SERIAL_MCTRL_GPIO if GPIOLIB
500 help 501 help
501 If you have a machine based on a SA1100/SA1110 StrongARM(R) CPU you 502 If you have a machine based on a SA1100/SA1110 StrongARM(R) CPU you
502 can enable its onboard serial port by enabling this option. 503 can enable its onboard serial port by enabling this option.
diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c
index a399772be3fc..8e618129e65c 100644
--- a/drivers/tty/serial/sa1100.c
+++ b/drivers/tty/serial/sa1100.c
@@ -28,6 +28,8 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/irqs.h> 29#include <mach/irqs.h>
30 30
31#include "serial_mctrl_gpio.h"
32
31/* We've been assigned a range on the "Low-density serial ports" major */ 33/* We've been assigned a range on the "Low-density serial ports" major */
32#define SERIAL_SA1100_MAJOR 204 34#define SERIAL_SA1100_MAJOR 204
33#define MINOR_START 5 35#define MINOR_START 5
@@ -77,6 +79,7 @@ struct sa1100_port {
77 struct uart_port port; 79 struct uart_port port;
78 struct timer_list timer; 80 struct timer_list timer;
79 unsigned int old_status; 81 unsigned int old_status;
82 struct mctrl_gpios *gpios;
80}; 83};
81 84
82/* 85/*
@@ -174,6 +177,8 @@ static void sa1100_enable_ms(struct uart_port *port)
174 container_of(port, struct sa1100_port, port); 177 container_of(port, struct sa1100_port, port);
175 178
176 mod_timer(&sport->timer, jiffies); 179 mod_timer(&sport->timer, jiffies);
180
181 mctrl_gpio_enable_ms(sport->gpios);
177} 182}
178 183
179static void 184static void
@@ -322,11 +327,21 @@ static unsigned int sa1100_tx_empty(struct uart_port *port)
322 327
323static unsigned int sa1100_get_mctrl(struct uart_port *port) 328static unsigned int sa1100_get_mctrl(struct uart_port *port)
324{ 329{
325 return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; 330 struct sa1100_port *sport =
331 container_of(port, struct sa1100_port, port);
332 int ret = TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
333
334 mctrl_gpio_get(sport->gpios, &ret);
335
336 return ret;
326} 337}
327 338
328static void sa1100_set_mctrl(struct uart_port *port, unsigned int mctrl) 339static void sa1100_set_mctrl(struct uart_port *port, unsigned int mctrl)
329{ 340{
341 struct sa1100_port *sport =
342 container_of(port, struct sa1100_port, port);
343
344 mctrl_gpio_set(sport->gpios, mctrl);
330} 345}
331 346
332/* 347/*
@@ -842,6 +857,31 @@ static int sa1100_serial_resume(struct platform_device *dev)
842 return 0; 857 return 0;
843} 858}
844 859
860static int sa1100_serial_add_one_port(struct sa1100_port *sport, struct platform_device *dev)
861{
862 sport->port.dev = &dev->dev;
863
864 // mctrl_gpio_init() requires that the GPIO driver supports interrupts,
865 // but we need to support GPIO drivers for hardware that has no such
866 // interrupts. Use mctrl_gpio_init_noauto() instead.
867 sport->gpios = mctrl_gpio_init_noauto(sport->port.dev, 0);
868 if (IS_ERR(sport->gpios)) {
869 int err = PTR_ERR(sport->gpios);
870
871 dev_err(sport->port.dev, "failed to get mctrl gpios: %d\n",
872 err);
873
874 if (err == -EPROBE_DEFER)
875 return err;
876
877 sport->gpios = NULL;
878 }
879
880 platform_set_drvdata(dev, sport);
881
882 return uart_add_one_port(&sa1100_reg, &sport->port);
883}
884
845static int sa1100_serial_probe(struct platform_device *dev) 885static int sa1100_serial_probe(struct platform_device *dev)
846{ 886{
847 struct resource *res = dev->resource; 887 struct resource *res = dev->resource;
@@ -856,9 +896,7 @@ static int sa1100_serial_probe(struct platform_device *dev)
856 if (sa1100_ports[i].port.mapbase != res->start) 896 if (sa1100_ports[i].port.mapbase != res->start)
857 continue; 897 continue;
858 898
859 sa1100_ports[i].port.dev = &dev->dev; 899 sa1100_serial_add_one_port(&sa1100_ports[i], dev);
860 uart_add_one_port(&sa1100_reg, &sa1100_ports[i].port);
861 platform_set_drvdata(dev, &sa1100_ports[i]);
862 break; 900 break;
863 } 901 }
864 } 902 }
diff --git a/include/linux/platform_data/video-clcd-versatile.h b/include/linux/platform_data/video-clcd-versatile.h
deleted file mode 100644
index 305ebaec3afd..000000000000
--- a/include/linux/platform_data/video-clcd-versatile.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef PLAT_CLCD_H
3#define PLAT_CLCD_H
4
5#ifdef CONFIG_PLAT_VERSATILE_CLCD
6struct clcd_panel *versatile_clcd_get_panel(const char *);
7int versatile_clcd_setup_dma(struct clcd_fb *, unsigned long);
8int versatile_clcd_mmap_dma(struct clcd_fb *, struct vm_area_struct *);
9void versatile_clcd_remove_dma(struct clcd_fb *);
10#else
11static inline struct clcd_panel *versatile_clcd_get_panel(const char *s)
12{
13 return NULL;
14}
15static inline int versatile_clcd_setup_dma(struct clcd_fb *fb, unsigned long framesize)
16{
17 return -ENODEV;
18}
19static inline int versatile_clcd_mmap_dma(struct clcd_fb *fb, struct vm_area_struct *vm)
20{
21 return -ENODEV;
22}
23static inline void versatile_clcd_remove_dma(struct clcd_fb *fb)
24{
25}
26#endif
27
28#endif