aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/configs/h3600_defconfig22
-rw-r--r--arch/arm/kernel/entry-armv.S1
-rw-r--r--arch/arm/kernel/signal.c14
-rw-r--r--arch/arm/mach-highbank/Kconfig2
-rw-r--r--arch/arm/mach-sa1100/assabet.c3
-rw-r--r--arch/arm/mach-sa1100/include/mach/gpio.h55
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3xxx.h2
-rw-r--r--arch/arm/mach-sa1100/simpad.c1
-rw-r--r--arch/arm/mach-tegra/Kconfig2
-rw-r--r--arch/arm/mm/dma-mapping.c4
-rw-r--r--arch/arm/mm/extable.c7
-rw-r--r--arch/arm/vfp/vfpmodule.c6
-rw-r--r--drivers/gpio/gpio-sa1100.c2
-rw-r--r--drivers/mmc/host/mmci.c78
-rw-r--r--drivers/mmc/host/mmci.h4
16 files changed, 98 insertions, 106 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 1dbb58c1feed..9f2d203162b2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -696,7 +696,6 @@ config ARCH_SA1100
696 select GENERIC_CLOCKEVENTS 696 select GENERIC_CLOCKEVENTS
697 select HAVE_IDE 697 select HAVE_IDE
698 select ISA 698 select ISA
699 select NEED_MACH_GPIO_H
700 select NEED_MACH_MEMORY_H 699 select NEED_MACH_MEMORY_H
701 select SPARSE_IRQ 700 select SPARSE_IRQ
702 help 701 help
diff --git a/arch/arm/configs/h3600_defconfig b/arch/arm/configs/h3600_defconfig
index 317960f12488..0142ec37e0be 100644
--- a/arch/arm/configs/h3600_defconfig
+++ b/arch/arm/configs/h3600_defconfig
@@ -1,5 +1,6 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y 1CONFIG_SYSVIPC=y
2CONFIG_NO_HZ_IDLE=y
3CONFIG_HIGH_RES_TIMERS=y
3CONFIG_LOG_BUF_SHIFT=14 4CONFIG_LOG_BUF_SHIFT=14
4CONFIG_BLK_DEV_INITRD=y 5CONFIG_BLK_DEV_INITRD=y
5CONFIG_MODULES=y 6CONFIG_MODULES=y
@@ -11,11 +12,11 @@ CONFIG_ARCH_SA1100=y
11CONFIG_SA1100_H3600=y 12CONFIG_SA1100_H3600=y
12CONFIG_PCCARD=y 13CONFIG_PCCARD=y
13CONFIG_PCMCIA_SA1100=y 14CONFIG_PCMCIA_SA1100=y
15CONFIG_PREEMPT=y
14CONFIG_ZBOOT_ROM_TEXT=0x0 16CONFIG_ZBOOT_ROM_TEXT=0x0
15CONFIG_ZBOOT_ROM_BSS=0x0 17CONFIG_ZBOOT_ROM_BSS=0x0
16# CONFIG_CPU_FREQ_STAT is not set 18# CONFIG_CPU_FREQ_STAT is not set
17CONFIG_FPE_NWFPE=y 19CONFIG_FPE_NWFPE=y
18CONFIG_PM=y
19CONFIG_NET=y 20CONFIG_NET=y
20CONFIG_UNIX=y 21CONFIG_UNIX=y
21CONFIG_INET=y 22CONFIG_INET=y
@@ -24,13 +25,10 @@ CONFIG_IRDA=m
24CONFIG_IRLAN=m 25CONFIG_IRLAN=m
25CONFIG_IRNET=m 26CONFIG_IRNET=m
26CONFIG_IRCOMM=m 27CONFIG_IRCOMM=m
27CONFIG_SA1100_FIR=m
28# CONFIG_WIRELESS is not set 28# CONFIG_WIRELESS is not set
29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 29CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
30CONFIG_MTD=y 30CONFIG_MTD=y
31CONFIG_MTD_PARTITIONS=y
32CONFIG_MTD_REDBOOT_PARTS=y 31CONFIG_MTD_REDBOOT_PARTS=y
33CONFIG_MTD_CHAR=y
34CONFIG_MTD_BLOCK=y 32CONFIG_MTD_BLOCK=y
35CONFIG_MTD_CFI=y 33CONFIG_MTD_CFI=y
36CONFIG_MTD_CFI_ADV_OPTIONS=y 34CONFIG_MTD_CFI_ADV_OPTIONS=y
@@ -41,19 +39,15 @@ CONFIG_MTD_SA1100=y
41CONFIG_BLK_DEV_LOOP=m 39CONFIG_BLK_DEV_LOOP=m
42CONFIG_BLK_DEV_RAM=y 40CONFIG_BLK_DEV_RAM=y
43CONFIG_BLK_DEV_RAM_SIZE=8192 41CONFIG_BLK_DEV_RAM_SIZE=8192
44# CONFIG_MISC_DEVICES is not set
45CONFIG_IDE=y 42CONFIG_IDE=y
46CONFIG_BLK_DEV_IDECS=y 43CONFIG_BLK_DEV_IDECS=y
47CONFIG_NETDEVICES=y 44CONFIG_NETDEVICES=y
48# CONFIG_NETDEV_1000 is not set
49# CONFIG_NETDEV_10000 is not set
50# CONFIG_WLAN is not set
51CONFIG_NET_PCMCIA=y
52CONFIG_PCMCIA_PCNET=y 45CONFIG_PCMCIA_PCNET=y
53CONFIG_PPP=m 46CONFIG_PPP=m
54CONFIG_PPP_ASYNC=m
55CONFIG_PPP_DEFLATE=m
56CONFIG_PPP_BSDCOMP=m 47CONFIG_PPP_BSDCOMP=m
48CONFIG_PPP_DEFLATE=m
49CONFIG_PPP_ASYNC=m
50# CONFIG_WLAN is not set
57# CONFIG_KEYBOARD_ATKBD is not set 51# CONFIG_KEYBOARD_ATKBD is not set
58CONFIG_KEYBOARD_GPIO=y 52CONFIG_KEYBOARD_GPIO=y
59# CONFIG_INPUT_MOUSE is not set 53# CONFIG_INPUT_MOUSE is not set
@@ -64,8 +58,6 @@ CONFIG_SERIAL_SA1100_CONSOLE=y
64# CONFIG_HWMON is not set 58# CONFIG_HWMON is not set
65CONFIG_FB=y 59CONFIG_FB=y
66CONFIG_FB_SA1100=y 60CONFIG_FB_SA1100=y
67# CONFIG_VGA_CONSOLE is not set
68# CONFIG_HID_SUPPORT is not set
69# CONFIG_USB_SUPPORT is not set 61# CONFIG_USB_SUPPORT is not set
70CONFIG_EXT2_FS=y 62CONFIG_EXT2_FS=y
71CONFIG_MSDOS_FS=m 63CONFIG_MSDOS_FS=m
@@ -74,6 +66,4 @@ CONFIG_JFFS2_FS=y
74CONFIG_CRAMFS=m 66CONFIG_CRAMFS=m
75CONFIG_NFS_FS=y 67CONFIG_NFS_FS=y
76CONFIG_NFSD=m 68CONFIG_NFSD=m
77CONFIG_SMB_FS=m
78CONFIG_NLS=y 69CONFIG_NLS=y
79# CONFIG_RCU_CPU_STALL_DETECTOR is not set
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 55090fbb81a2..b3fb8c9e1ff2 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -192,6 +192,7 @@ __dabt_svc:
192 svc_entry 192 svc_entry
193 mov r2, sp 193 mov r2, sp
194 dabt_helper 194 dabt_helper
195 THUMB( ldr r5, [sp, #S_PSR] ) @ potentially updated CPSR
195 svc_exit r5 @ return from exception 196 svc_exit r5 @ return from exception
196 UNWIND(.fnend ) 197 UNWIND(.fnend )
197ENDPROC(__dabt_svc) 198ENDPROC(__dabt_svc)
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 64845fc4152a..04d63880037f 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -353,12 +353,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
353 */ 353 */
354 thumb = handler & 1; 354 thumb = handler & 1;
355 355
356 if (thumb) {
357 cpsr |= PSR_T_BIT;
358#if __LINUX_ARM_ARCH__ >= 7 356#if __LINUX_ARM_ARCH__ >= 7
359 /* clear the If-Then Thumb-2 execution state */ 357 /*
360 cpsr &= ~PSR_IT_MASK; 358 * Clear the If-Then Thumb-2 execution state
359 * ARM spec requires this to be all 000s in ARM mode
360 * Snapdragon S4/Krait misbehaves on a Thumb=>ARM
361 * signal transition without this.
362 */
363 cpsr &= ~PSR_IT_MASK;
361#endif 364#endif
365
366 if (thumb) {
367 cpsr |= PSR_T_BIT;
362 } else 368 } else
363 cpsr &= ~PSR_T_BIT; 369 cpsr &= ~PSR_T_BIT;
364 } 370 }
diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index 3c3bff715b47..0ca7377746c8 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -9,7 +9,7 @@ config ARCH_HIGHBANK
9 select ARM_AMBA 9 select ARM_AMBA
10 select ARM_ERRATA_764369 10 select ARM_ERRATA_764369
11 select ARM_ERRATA_775420 11 select ARM_ERRATA_775420
12 select ARM_ERRATA_798181 12 select ARM_ERRATA_798181 if SMP
13 select ARM_GIC 13 select ARM_GIC
14 select ARM_TIMER_SP804 14 select ARM_TIMER_SP804
15 select CACHE_L2X0 15 select CACHE_L2X0
diff --git a/arch/arm/mach-sa1100/assabet.c b/arch/arm/mach-sa1100/assabet.c
index e838ba27e443..c9808c684152 100644
--- a/arch/arm/mach-sa1100/assabet.c
+++ b/arch/arm/mach-sa1100/assabet.c
@@ -512,6 +512,9 @@ static void __init assabet_map_io(void)
512 * Its called GPCLKR0 in my SA1110 manual. 512 * Its called GPCLKR0 in my SA1110 manual.
513 */ 513 */
514 Ser1SDCR0 |= SDCR0_SUS; 514 Ser1SDCR0 |= SDCR0_SUS;
515 MSC1 = (MSC1 & ~0xffff) |
516 MSC_NonBrst | MSC_32BitStMem |
517 MSC_RdAcc(2) | MSC_WrAcc(2) | MSC_Rec(0);
515 518
516 if (!machine_has_neponset()) 519 if (!machine_has_neponset())
517 sa1100_register_uart_fns(&assabet_port_fns); 520 sa1100_register_uart_fns(&assabet_port_fns);
diff --git a/arch/arm/mach-sa1100/include/mach/gpio.h b/arch/arm/mach-sa1100/include/mach/gpio.h
deleted file mode 100644
index 6a9eecf3137e..000000000000
--- a/arch/arm/mach-sa1100/include/mach/gpio.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * arch/arm/mach-sa1100/include/mach/gpio.h
3 *
4 * SA1100 GPIO wrappers for arch-neutral GPIO calls
5 *
6 * Written by Philipp Zabel <philipp.zabel@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23
24#ifndef __ASM_ARCH_SA1100_GPIO_H
25#define __ASM_ARCH_SA1100_GPIO_H
26
27#include <linux/io.h>
28#include <mach/hardware.h>
29#include <asm/irq.h>
30#include <asm-generic/gpio.h>
31
32#define __ARM_GPIOLIB_COMPLEX
33
34static inline int gpio_get_value(unsigned gpio)
35{
36 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
37 return GPLR & GPIO_GPIO(gpio);
38 else
39 return __gpio_get_value(gpio);
40}
41
42static inline void gpio_set_value(unsigned gpio, int value)
43{
44 if (__builtin_constant_p(gpio) && (gpio <= GPIO_MAX))
45 if (value)
46 GPSR = GPIO_GPIO(gpio);
47 else
48 GPCR = GPIO_GPIO(gpio);
49 else
50 __gpio_set_value(gpio, value);
51}
52
53#define gpio_cansleep __gpio_cansleep
54
55#endif
diff --git a/arch/arm/mach-sa1100/include/mach/h3xxx.h b/arch/arm/mach-sa1100/include/mach/h3xxx.h
index 7d9df16f04a2..c810620db53d 100644
--- a/arch/arm/mach-sa1100/include/mach/h3xxx.h
+++ b/arch/arm/mach-sa1100/include/mach/h3xxx.h
@@ -13,6 +13,8 @@
13#ifndef _INCLUDE_H3XXX_H_ 13#ifndef _INCLUDE_H3XXX_H_
14#define _INCLUDE_H3XXX_H_ 14#define _INCLUDE_H3XXX_H_
15 15
16#include "hardware.h" /* Gives GPIO_MAX */
17
16/* Physical memory regions corresponding to chip selects */ 18/* Physical memory regions corresponding to chip selects */
17#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000) 19#define H3600_EGPIO_PHYS (SA1100_CS5_PHYS + 0x01000000)
18#define H3600_BANK_2_PHYS SA1100_CS2_PHYS 20#define H3600_BANK_2_PHYS SA1100_CS2_PHYS
diff --git a/arch/arm/mach-sa1100/simpad.c b/arch/arm/mach-sa1100/simpad.c
index bcbc94540e45..41e476e571d7 100644
--- a/arch/arm/mach-sa1100/simpad.c
+++ b/arch/arm/mach-sa1100/simpad.c
@@ -19,6 +19,7 @@
19 19
20#include <mach/hardware.h> 20#include <mach/hardware.h>
21#include <asm/setup.h> 21#include <asm/setup.h>
22#include <asm/irq.h>
22 23
23#include <asm/mach-types.h> 24#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 67a76f2dfb9f..f26428d8b62a 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -54,7 +54,7 @@ config ARCH_TEGRA_3x_SOC
54config ARCH_TEGRA_114_SOC 54config ARCH_TEGRA_114_SOC
55 bool "Enable support for Tegra114 family" 55 bool "Enable support for Tegra114 family"
56 select HAVE_ARM_ARCH_TIMER 56 select HAVE_ARM_ARCH_TIMER
57 select ARM_ERRATA_798181 57 select ARM_ERRATA_798181 if SMP
58 select ARM_L1_CACHE_SHIFT_6 58 select ARM_L1_CACHE_SHIFT_6
59 select PINCTRL_TEGRA114 59 select PINCTRL_TEGRA114
60 help 60 help
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 1272ed202dde..b5a3f6031146 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -687,7 +687,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
687void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, 687void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
688 gfp_t gfp, struct dma_attrs *attrs) 688 gfp_t gfp, struct dma_attrs *attrs)
689{ 689{
690 pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); 690 pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
691 void *memory; 691 void *memory;
692 692
693 if (dma_alloc_from_coherent(dev, size, handle, &memory)) 693 if (dma_alloc_from_coherent(dev, size, handle, &memory))
@@ -700,7 +700,7 @@ void *arm_dma_alloc(struct device *dev, size_t size, dma_addr_t *handle,
700static void *arm_coherent_dma_alloc(struct device *dev, size_t size, 700static void *arm_coherent_dma_alloc(struct device *dev, size_t size,
701 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs) 701 dma_addr_t *handle, gfp_t gfp, struct dma_attrs *attrs)
702{ 702{
703 pgprot_t prot = __get_dma_pgprot(attrs, pgprot_kernel); 703 pgprot_t prot = __get_dma_pgprot(attrs, PAGE_KERNEL);
704 void *memory; 704 void *memory;
705 705
706 if (dma_alloc_from_coherent(dev, size, handle, &memory)) 706 if (dma_alloc_from_coherent(dev, size, handle, &memory))
diff --git a/arch/arm/mm/extable.c b/arch/arm/mm/extable.c
index 9d285626bc7d..312e15e6d00b 100644
--- a/arch/arm/mm/extable.c
+++ b/arch/arm/mm/extable.c
@@ -9,8 +9,13 @@ int fixup_exception(struct pt_regs *regs)
9 const struct exception_table_entry *fixup; 9 const struct exception_table_entry *fixup;
10 10
11 fixup = search_exception_tables(instruction_pointer(regs)); 11 fixup = search_exception_tables(instruction_pointer(regs));
12 if (fixup) 12 if (fixup) {
13 regs->ARM_pc = fixup->fixup; 13 regs->ARM_pc = fixup->fixup;
14#ifdef CONFIG_THUMB2_KERNEL
15 /* Clear the IT state to avoid nasty surprises in the fixup */
16 regs->ARM_cpsr &= ~PSR_IT_MASK;
17#endif
18 }
14 19
15 return fixup != NULL; 20 return fixup != NULL;
16} 21}
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 52b8f40b1c73..2f37e1d6cb45 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -642,9 +642,9 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp,
642static int vfp_hotplug(struct notifier_block *b, unsigned long action, 642static int vfp_hotplug(struct notifier_block *b, unsigned long action,
643 void *hcpu) 643 void *hcpu)
644{ 644{
645 if (action == CPU_DYING || action == CPU_DYING_FROZEN) { 645 if (action == CPU_DYING || action == CPU_DYING_FROZEN)
646 vfp_force_reload((long)hcpu, current_thread_info()); 646 vfp_current_hw_state[(long)hcpu] = NULL;
647 } else if (action == CPU_STARTING || action == CPU_STARTING_FROZEN) 647 else if (action == CPU_STARTING || action == CPU_STARTING_FROZEN)
648 vfp_enable(NULL); 648 vfp_enable(NULL);
649 return NOTIFY_OK; 649 return NOTIFY_OK;
650} 650}
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c
index 8ea3b33d4b40..a90be34e4d5c 100644
--- a/drivers/gpio/gpio-sa1100.c
+++ b/drivers/gpio/gpio-sa1100.c
@@ -10,7 +10,7 @@
10#include <linux/gpio.h> 10#include <linux/gpio.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/module.h> 12#include <linux/module.h>
13 13#include <linux/io.h>
14#include <mach/hardware.h> 14#include <mach/hardware.h>
15#include <mach/irqs.h> 15#include <mach/irqs.h>
16 16
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index c3785edc0e92..d135c76c4855 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -62,6 +62,7 @@ static unsigned int fmax = 515633;
62 * @signal_direction: input/out direction of bus signals can be indicated 62 * @signal_direction: input/out direction of bus signals can be indicated
63 * @pwrreg_clkgate: MMCIPOWER register must be used to gate the clock 63 * @pwrreg_clkgate: MMCIPOWER register must be used to gate the clock
64 * @busy_detect: true if busy detection on dat0 is supported 64 * @busy_detect: true if busy detection on dat0 is supported
65 * @pwrreg_nopower: bits in MMCIPOWER don't controls ext. power supply
65 */ 66 */
66struct variant_data { 67struct variant_data {
67 unsigned int clkreg; 68 unsigned int clkreg;
@@ -76,6 +77,7 @@ struct variant_data {
76 bool signal_direction; 77 bool signal_direction;
77 bool pwrreg_clkgate; 78 bool pwrreg_clkgate;
78 bool busy_detect; 79 bool busy_detect;
80 bool pwrreg_nopower;
79}; 81};
80 82
81static struct variant_data variant_arm = { 83static struct variant_data variant_arm = {
@@ -109,6 +111,7 @@ static struct variant_data variant_u300 = {
109 .pwrreg_powerup = MCI_PWR_ON, 111 .pwrreg_powerup = MCI_PWR_ON,
110 .signal_direction = true, 112 .signal_direction = true,
111 .pwrreg_clkgate = true, 113 .pwrreg_clkgate = true,
114 .pwrreg_nopower = true,
112}; 115};
113 116
114static struct variant_data variant_nomadik = { 117static struct variant_data variant_nomadik = {
@@ -121,6 +124,7 @@ static struct variant_data variant_nomadik = {
121 .pwrreg_powerup = MCI_PWR_ON, 124 .pwrreg_powerup = MCI_PWR_ON,
122 .signal_direction = true, 125 .signal_direction = true,
123 .pwrreg_clkgate = true, 126 .pwrreg_clkgate = true,
127 .pwrreg_nopower = true,
124}; 128};
125 129
126static struct variant_data variant_ux500 = { 130static struct variant_data variant_ux500 = {
@@ -135,6 +139,7 @@ static struct variant_data variant_ux500 = {
135 .signal_direction = true, 139 .signal_direction = true,
136 .pwrreg_clkgate = true, 140 .pwrreg_clkgate = true,
137 .busy_detect = true, 141 .busy_detect = true,
142 .pwrreg_nopower = true,
138}; 143};
139 144
140static struct variant_data variant_ux500v2 = { 145static struct variant_data variant_ux500v2 = {
@@ -150,6 +155,7 @@ static struct variant_data variant_ux500v2 = {
150 .signal_direction = true, 155 .signal_direction = true,
151 .pwrreg_clkgate = true, 156 .pwrreg_clkgate = true,
152 .busy_detect = true, 157 .busy_detect = true,
158 .pwrreg_nopower = true,
153}; 159};
154 160
155static int mmci_card_busy(struct mmc_host *mmc) 161static int mmci_card_busy(struct mmc_host *mmc)
@@ -189,6 +195,21 @@ static int mmci_validate_data(struct mmci_host *host,
189 return 0; 195 return 0;
190} 196}
191 197
198static void mmci_reg_delay(struct mmci_host *host)
199{
200 /*
201 * According to the spec, at least three feedback clock cycles
202 * of max 52 MHz must pass between two writes to the MMCICLOCK reg.
203 * Three MCLK clock cycles must pass between two MMCIPOWER reg writes.
204 * Worst delay time during card init is at 100 kHz => 30 us.
205 * Worst delay time when up and running is at 25 MHz => 120 ns.
206 */
207 if (host->cclk < 25000000)
208 udelay(30);
209 else
210 ndelay(120);
211}
212
192/* 213/*
193 * This must be called with host->lock held 214 * This must be called with host->lock held
194 */ 215 */
@@ -1264,6 +1285,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
1264 1285
1265 mmci_set_clkreg(host, ios->clock); 1286 mmci_set_clkreg(host, ios->clock);
1266 mmci_write_pwrreg(host, pwr); 1287 mmci_write_pwrreg(host, pwr);
1288 mmci_reg_delay(host);
1267 1289
1268 spin_unlock_irqrestore(&host->lock, flags); 1290 spin_unlock_irqrestore(&host->lock, flags);
1269 1291
@@ -1510,23 +1532,6 @@ static int mmci_probe(struct amba_device *dev,
1510 mmc->f_max = min(host->mclk, fmax); 1532 mmc->f_max = min(host->mclk, fmax);
1511 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max); 1533 dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
1512 1534
1513 host->pinctrl = devm_pinctrl_get(&dev->dev);
1514 if (IS_ERR(host->pinctrl)) {
1515 ret = PTR_ERR(host->pinctrl);
1516 goto clk_disable;
1517 }
1518
1519 host->pins_default = pinctrl_lookup_state(host->pinctrl,
1520 PINCTRL_STATE_DEFAULT);
1521
1522 /* enable pins to be muxed in and configured */
1523 if (!IS_ERR(host->pins_default)) {
1524 ret = pinctrl_select_state(host->pinctrl, host->pins_default);
1525 if (ret)
1526 dev_warn(&dev->dev, "could not set default pins\n");
1527 } else
1528 dev_warn(&dev->dev, "could not get default pinstate\n");
1529
1530 /* Get regulators and the supported OCR mask */ 1535 /* Get regulators and the supported OCR mask */
1531 mmc_regulator_get_supply(mmc); 1536 mmc_regulator_get_supply(mmc);
1532 if (!mmc->ocr_avail) 1537 if (!mmc->ocr_avail)
@@ -1760,6 +1765,41 @@ static int mmci_resume(struct device *dev)
1760#endif 1765#endif
1761 1766
1762#ifdef CONFIG_PM_RUNTIME 1767#ifdef CONFIG_PM_RUNTIME
1768static void mmci_save(struct mmci_host *host)
1769{
1770 unsigned long flags;
1771
1772 if (host->variant->pwrreg_nopower) {
1773 spin_lock_irqsave(&host->lock, flags);
1774
1775 writel(0, host->base + MMCIMASK0);
1776 writel(0, host->base + MMCIDATACTRL);
1777 writel(0, host->base + MMCIPOWER);
1778 writel(0, host->base + MMCICLOCK);
1779 mmci_reg_delay(host);
1780
1781 spin_unlock_irqrestore(&host->lock, flags);
1782 }
1783
1784}
1785
1786static void mmci_restore(struct mmci_host *host)
1787{
1788 unsigned long flags;
1789
1790 if (host->variant->pwrreg_nopower) {
1791 spin_lock_irqsave(&host->lock, flags);
1792
1793 writel(host->clk_reg, host->base + MMCICLOCK);
1794 writel(host->datactrl_reg, host->base + MMCIDATACTRL);
1795 writel(host->pwr_reg, host->base + MMCIPOWER);
1796 writel(MCI_IRQENABLE, host->base + MMCIMASK0);
1797 mmci_reg_delay(host);
1798
1799 spin_unlock_irqrestore(&host->lock, flags);
1800 }
1801}
1802
1763static int mmci_runtime_suspend(struct device *dev) 1803static int mmci_runtime_suspend(struct device *dev)
1764{ 1804{
1765 struct amba_device *adev = to_amba_device(dev); 1805 struct amba_device *adev = to_amba_device(dev);
@@ -1767,6 +1807,8 @@ static int mmci_runtime_suspend(struct device *dev)
1767 1807
1768 if (mmc) { 1808 if (mmc) {
1769 struct mmci_host *host = mmc_priv(mmc); 1809 struct mmci_host *host = mmc_priv(mmc);
1810 pinctrl_pm_select_sleep_state(dev);
1811 mmci_save(host);
1770 clk_disable_unprepare(host->clk); 1812 clk_disable_unprepare(host->clk);
1771 } 1813 }
1772 1814
@@ -1781,6 +1823,8 @@ static int mmci_runtime_resume(struct device *dev)
1781 if (mmc) { 1823 if (mmc) {
1782 struct mmci_host *host = mmc_priv(mmc); 1824 struct mmci_host *host = mmc_priv(mmc);
1783 clk_prepare_enable(host->clk); 1825 clk_prepare_enable(host->clk);
1826 mmci_restore(host);
1827 pinctrl_pm_select_default_state(dev);
1784 } 1828 }
1785 1829
1786 return 0; 1830 return 0;
diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h
index 69080fab6375..168bc72f7a94 100644
--- a/drivers/mmc/host/mmci.h
+++ b/drivers/mmc/host/mmci.h
@@ -200,10 +200,6 @@ struct mmci_host {
200 struct sg_mapping_iter sg_miter; 200 struct sg_mapping_iter sg_miter;
201 unsigned int size; 201 unsigned int size;
202 202
203 /* pinctrl handles */
204 struct pinctrl *pinctrl;
205 struct pinctrl_state *pins_default;
206
207#ifdef CONFIG_DMA_ENGINE 203#ifdef CONFIG_DMA_ENGINE
208 /* DMA stuff */ 204 /* DMA stuff */
209 struct dma_chan *dma_current; 205 struct dma_chan *dma_current;