All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/17] ARM: pxa: Fix missing includes
@ 2010-11-02 23:51 Marek Vasut
  2010-11-02 23:51 ` [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses Marek Vasut
                   ` (16 more replies)
  0 siblings, 17 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

After the "ARM: pxa: Introduce pxa{25x,27x,3xx}_map_io()" patch, forged by me
and Eric, was applied, some variables were misnamed and some includes missing.
This patch corrects these errors.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/pxa25x.c |    2 ++
 arch/arm/mach-pxa/pxa27x.c |    5 ++++-
 arch/arm/mach-pxa/pxa3xx.c |    4 +++-
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 4596b98..acde987 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -31,6 +31,8 @@
 #include <mach/pm.h>
 #include <mach/dma.h>
 
+#include <asm/mach/map.h>
+
 #include "generic.h"
 #include "devices.h"
 #include "clock.h"
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index af47bef..764b9ac 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -27,8 +27,11 @@
 #include <mach/ohci.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
+
 #include <plat/i2c.h>
 
+#include <asm/mach/map.h>
+
 #include "generic.h"
 #include "devices.h"
 #include "clock.h"
@@ -387,7 +390,7 @@ static struct map_desc pxa27x_io_desc[] __initdata = {
 void __init pxa27x_map_io(void)
 {
 	pxa_map_io();
-	iotable_init(ARRAY_AND_SIZE(pxa27x_io_table));
+	iotable_init(ARRAY_AND_SIZE(pxa27x_io_desc));
 	pxa27x_get_clk_frequency_khz(1);
 }
 
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index af7f701..bb60664 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -32,6 +32,8 @@
 #include <mach/regs-intc.h>
 #include <plat/i2c.h>
 
+#include <asm/mach/map.h>
+
 #include "generic.h"
 #include "devices.h"
 #include "clock.h"
@@ -592,7 +594,7 @@ static struct map_desc pxa3xx_io_desc[] __initdata = {
 void __init pxa3xx_map_io(void)
 {
 	pxa_map_io();
-	iotable_init(ARRAY_AND_SIZE(common_io_desc));
+	iotable_init(ARRAY_AND_SIZE(pxa3xx_io_desc));
 	pxa3xx_get_clk_frequency_khz(1);
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-03 14:37   ` Eric Miao
  2010-11-02 23:51 ` [PATCH 03/17] ARM: pxa: Toradex Colibri PXA270 CF support Marek Vasut
                   ` (15 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This is important because on PXA3xx, the physical mapping of SMEMC registers
differs from the one on PXA2xx. In order to get PCMCIA working on both PXA2xx
and PXA320, the PCMCIA driver was adjusted accordingly as well.

Also, various places in the kernel had to be patched to use
__raw_read/__raw_write.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
---
 arch/arm/mach-pxa/cm-x2xx.c                  |   13 +++--
 arch/arm/mach-pxa/cpufreq-pxa2xx.c           |   10 ++--
 arch/arm/mach-pxa/csb726.c                   |    7 ++-
 arch/arm/mach-pxa/generic.c                  |    1 +
 arch/arm/mach-pxa/h5000.c                    |    9 ++--
 arch/arm/mach-pxa/include/mach/pxa-smemc.h   |   74 ++++++++++++++++++++++++++
 arch/arm/mach-pxa/include/mach/pxa2xx-regs.h |   55 -------------------
 arch/arm/mach-pxa/lpd270.c                   |    3 +-
 arch/arm/mach-pxa/lubbock.c                  |    3 +-
 arch/arm/mach-pxa/mainstone.c                |    5 +-
 arch/arm/mach-pxa/pxa25x.c                   |    5 +-
 arch/arm/mach-pxa/pxa27x.c                   |   10 ++--
 arch/arm/mach-pxa/pxa3xx.c                   |    5 +-
 arch/arm/mach-pxa/sleep.S                    |    2 +-
 arch/arm/mach-pxa/smemc.c                    |   51 ++++++------------
 arch/arm/mach-pxa/spitz.c                    |    5 +-
 arch/arm/mach-pxa/stargate2.c                |    3 +-
 arch/arm/mach-pxa/tosa.c                     |    7 ++-
 arch/arm/mach-pxa/trizeps4.c                 |    3 +-
 arch/arm/mach-pxa/xcep.c                     |    5 +-
 arch/arm/mach-pxa/zeus.c                     |    5 +-
 drivers/pcmcia/pxa2xx_base.c                 |   65 +++++++++++++++-------
 22 files changed, 196 insertions(+), 150 deletions(-)
 create mode 100644 arch/arm/mach-pxa/include/mach/pxa-smemc.h

diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index ca8ad86..bb33b0f 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -24,6 +24,7 @@
 #include <mach/pxa2xx-regs.h>
 #include <mach/audio.h>
 #include <mach/pxafb.h>
+#include <mach/pxa-smemc.h>
 
 #include <asm/hardware/it8152.h>
 
@@ -392,9 +393,9 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
 	cmx2xx_pci_suspend();
 
 	/* save MSC registers */
-	sleep_save_msc[0] = MSC0;
-	sleep_save_msc[1] = MSC1;
-	sleep_save_msc[2] = MSC2;
+	sleep_save_msc[0] = __raw_readl(MSC0);
+	sleep_save_msc[1] = __raw_readl(MSC1);
+	sleep_save_msc[2] = __raw_readl(MSC2);
 
 	/* setup power saving mode registers */
 	PCFR = 0x0;
@@ -416,9 +417,9 @@ static int cmx2xx_resume(struct sys_device *dev)
 	cmx2xx_pci_resume();
 
 	/* restore MSC registers */
-	MSC0 = sleep_save_msc[0];
-	MSC1 = sleep_save_msc[1];
-	MSC2 = sleep_save_msc[2];
+	__raw_writel(sleep_save_msc[0], MSC0);
+	__raw_writel(sleep_save_msc[1], MSC1);
+	__raw_writel(sleep_save_msc[2], MSC2);
 
 	return 0;
 }
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
index 58093d9..1af67ad 100644
--- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
+++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
@@ -38,8 +38,10 @@
 #include <linux/cpufreq.h>
 #include <linux/err.h>
 #include <linux/regulator/consumer.h>
+#include <linux/io.h>
 
 #include <mach/pxa2xx-regs.h>
+#include <mach/pxa-smemc.h>
 
 #ifdef DEBUG
 static unsigned int freq_debug;
@@ -242,7 +244,7 @@ static void pxa27x_guess_max_freq(void)
 
 static void init_sdram_rows(void)
 {
-	uint32_t mdcnfg = MDCNFG;
+	uint32_t mdcnfg = __raw_readl(MDCNFG);
 	unsigned int drac2 = 0, drac0 = 0;
 
 	if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3))
@@ -331,8 +333,8 @@ static int pxa_set_target(struct cpufreq_policy *policy,
 	 * we need to preset the smaller DRI before the change.	 If we're
 	 * speeding up we need to set the larger DRI value after the change.
 	 */
-	preset_mdrefr = postset_mdrefr = MDREFR;
-	if ((MDREFR & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
+	preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR);
+	if ((__raw_readl(MDREFR) & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
 		preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK);
 		preset_mdrefr |= mdrefr_dri(new_freq_mem);
 	}
@@ -370,7 +372,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
 3:		nop							\n\
 	  "
 		     : "=&r" (unused)
-		     : "r" (&MDREFR), "r" (cclkcfg),
+		     : "r" (MDREFR), "r" (cclkcfg),
 		       "r" (preset_mdrefr), "r" (postset_mdrefr)
 		     : "r4", "r5");
 	local_irq_restore(flags);
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
index 225a2a1..2429666 100644
--- a/arch/arm/mach-pxa/csb726.c
+++ b/arch/arm/mach-pxa/csb726.c
@@ -27,6 +27,7 @@
 #include <mach/ohci.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/audio.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -255,9 +256,9 @@ static struct platform_device *devices[] __initdata = {
 static void __init csb726_init(void)
 {
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
-/*	MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */
-/*	MSC2 = 0x06697ff4; *//* none/SM501 */
-	MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */
+/*	__raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */
+/*	__raw_writel(0x06697ff4, MSC2); *//* none/SM501 */
+	__raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */
 
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 6a5f379..05f6227 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -28,6 +28,7 @@
 
 #include <mach/reset.h>
 #include <mach/gpio.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
index 0ef1635..42e60c6 100644
--- a/arch/arm/mach-pxa/h5000.c
+++ b/arch/arm/mach-pxa/h5000.c
@@ -32,6 +32,7 @@
 #include <mach/pxa25x.h>
 #include <mach/h5000.h>
 #include <mach/udc.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 
@@ -172,11 +173,11 @@ static unsigned long h5000_pin_config[] __initdata = {
 
 static void fix_msc(void)
 {
-	MSC0 = 0x129c24f2;
-	MSC1 = 0x7ff424fa;
-	MSC2 = 0x7ff47ff4;
+	__raw_writel(0x129c24f2, MSC0);
+	__raw_writel(0x7ff424fa, MSC1);
+	__raw_writel(0x7ff47ff4, MSC2);
 
-	MDREFR |= 0x02080000;
+	__raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR);
 }
 
 /*
diff --git a/arch/arm/mach-pxa/include/mach/pxa-smemc.h b/arch/arm/mach-pxa/include/mach/pxa-smemc.h
new file mode 100644
index 0000000..e3b270b
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa-smemc.h
@@ -0,0 +1,74 @@
+/*
+ * Static memory controller register definitions for PXA CPUs
+ *
+ * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __PXA_SMEMC_REGS_H
+#define __PXA_SMEMC_REGS_H
+
+#define	PXA2XX_SMEMC_BASE	0x48000000
+#define	PXA3XX_SMEMC_BASE	0x4a000000
+#define	PXA_SMEMC_VIRT		0xf6000000
+
+#define MDCNFG		(PXA_SMEMC_VIRT + 0x00)  /* SDRAM Configuration Register 0 */
+#define MDREFR		(PXA_SMEMC_VIRT + 0x04)  /* SDRAM Refresh Control Register */
+#define MSC0		(PXA_SMEMC_VIRT + 0x08)  /* Static Memory Control Register 0 */
+#define MSC1		(PXA_SMEMC_VIRT + 0x0C)  /* Static Memory Control Register 1 */
+#define MSC2		(PXA_SMEMC_VIRT + 0x10)  /* Static Memory Control Register 2 */
+#define MECR		(PXA_SMEMC_VIRT + 0x14)  /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
+#define SXLCR		(PXA_SMEMC_VIRT + 0x18)  /* LCR value to be written to SDRAM-Timing Synchronous Flash */
+#define SXCNFG		(PXA_SMEMC_VIRT + 0x1C)  /* Synchronous Static Memory Control Register */
+#define SXMRS		(PXA_SMEMC_VIRT + 0x24)  /* MRS value to be written to Synchronous Flash or SMROM */
+#define MCMEM0		(PXA_SMEMC_VIRT + 0x28)  /* Card interface Common Memory Space Socket 0 Timing */
+#define MCMEM1		(PXA_SMEMC_VIRT + 0x2C)  /* Card interface Common Memory Space Socket 1 Timing */
+#define MCATT0		(PXA_SMEMC_VIRT + 0x30)  /* Card interface Attribute Space Socket 0 Timing Configuration */
+#define MCATT1		(PXA_SMEMC_VIRT + 0x34)  /* Card interface Attribute Space Socket 1 Timing Configuration */
+#define MCIO0		(PXA_SMEMC_VIRT + 0x38)  /* Card interface I/O Space Socket 0 Timing Configuration */
+#define MCIO1		(PXA_SMEMC_VIRT + 0x3C)  /* Card interface I/O Space Socket 1 Timing Configuration */
+#define MDMRS		(PXA_SMEMC_VIRT + 0x40)  /* MRS value to be written to SDRAM */
+#define BOOT_DEF	(PXA_SMEMC_VIRT + 0x44)  /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
+#define MEMCLKCFG	(PXA_SMEMC_VIRT + 0x68)	/* Clock Configuration */
+#define CSADRCFG0	(PXA_SMEMC_VIRT + 0x80)	/* Address Configuration Register for CS0 */
+#define CSADRCFG1	(PXA_SMEMC_VIRT + 0x84)	/* Address Configuration Register for CS1 */
+#define CSADRCFG2	(PXA_SMEMC_VIRT + 0x88)	/* Address Configuration Register for CS2 */
+#define CSADRCFG3	(PXA_SMEMC_VIRT + 0x8C)	/* Address Configuration Register for CS3 */
+
+/*
+ * More handy macros for PCMCIA
+ *
+ * Arg is socket number
+ */
+#define MCMEM(s)	(PXA_SMEMC_VIRT + 0x28 + ((s)<<2))  /* Card interface Common Memory Space Socket s Timing */
+#define MCATT(s)	(PXA_SMEMC_VIRT + 0x30 + ((s)<<2))  /* Card interface Attribute Space Socket s Timing Configuration */
+#define MCIO(s)		(PXA_SMEMC_VIRT + 0x38 + ((s)<<2))  /* Card interface I/O Space Socket s Timing Configuration */
+
+/* MECR register defines */
+#define MECR_NOS	(1 << 0)	/* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
+#define MECR_CIT	(1 << 1)	/* Card Is There: 0 -> no card, 1 -> card inserted */
+
+#define MDCNFG_DE0	(1 << 0)	/* SDRAM Bank 0 Enable */
+#define MDCNFG_DE1	(1 << 1)	/* SDRAM Bank 1 Enable */
+#define MDCNFG_DE2	(1 << 16)	/* SDRAM Bank 2 Enable */
+#define MDCNFG_DE3	(1 << 17)	/* SDRAM Bank 3 Enable */
+
+#define MDREFR_K0DB4	(1 << 29)	/* SDCLK0 Divide by 4 Control/Status */
+#define MDREFR_K2FREE	(1 << 25)	/* SDRAM Free-Running Control */
+#define MDREFR_K1FREE	(1 << 24)	/* SDRAM Free-Running Control */
+#define MDREFR_K0FREE	(1 << 23)	/* SDRAM Free-Running Control */
+#define MDREFR_SLFRSH	(1 << 22)	/* SDRAM Self-Refresh Control/Status */
+#define MDREFR_APD	(1 << 20)	/* SDRAM/SSRAM Auto-Power-Down Enable */
+#define MDREFR_K2DB2	(1 << 19)	/* SDCLK2 Divide by 2 Control/Status */
+#define MDREFR_K2RUN	(1 << 18)	/* SDCLK2 Run Control/Status */
+#define MDREFR_K1DB2	(1 << 17)	/* SDCLK1 Divide by 2 Control/Status */
+#define MDREFR_K1RUN	(1 << 16)	/* SDCLK1 Run Control/Status */
+#define MDREFR_E1PIN	(1 << 15)	/* SDCKE1 Level Control/Status */
+#define MDREFR_K0DB2	(1 << 14)	/* SDCLK0 Divide by 2 Control/Status */
+#define MDREFR_K0RUN	(1 << 13)	/* SDCLK0 Run Control/Status */
+#define MDREFR_E0PIN	(1 << 12)	/* SDCKE0 Level Control/Status */
+
+#endif
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
index dd0fc1c..ee6ced1 100644
--- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
@@ -17,61 +17,6 @@
 #include <mach/hardware.h>
 
 /*
- * Memory controller
- */
-
-#define MDCNFG		__REG(0x48000000)  /* SDRAM Configuration Register 0 */
-#define MDREFR		__REG(0x48000004)  /* SDRAM Refresh Control Register */
-#define MSC0		__REG(0x48000008)  /* Static Memory Control Register 0 */
-#define MSC1		__REG(0x4800000C)  /* Static Memory Control Register 1 */
-#define MSC2		__REG(0x48000010)  /* Static Memory Control Register 2 */
-#define MECR		__REG(0x48000014)  /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
-#define SXLCR		__REG(0x48000018)  /* LCR value to be written to SDRAM-Timing Synchronous Flash */
-#define SXCNFG		__REG(0x4800001C)  /* Synchronous Static Memory Control Register */
-#define SXMRS		__REG(0x48000024)  /* MRS value to be written to Synchronous Flash or SMROM */
-#define MCMEM0		__REG(0x48000028)  /* Card interface Common Memory Space Socket 0 Timing */
-#define MCMEM1		__REG(0x4800002C)  /* Card interface Common Memory Space Socket 1 Timing */
-#define MCATT0		__REG(0x48000030)  /* Card interface Attribute Space Socket 0 Timing Configuration */
-#define MCATT1		__REG(0x48000034)  /* Card interface Attribute Space Socket 1 Timing Configuration */
-#define MCIO0		__REG(0x48000038)  /* Card interface I/O Space Socket 0 Timing Configuration */
-#define MCIO1		__REG(0x4800003C)  /* Card interface I/O Space Socket 1 Timing Configuration */
-#define MDMRS		__REG(0x48000040)  /* MRS value to be written to SDRAM */
-#define BOOT_DEF	__REG(0x48000044)  /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
-
-/*
- * More handy macros for PCMCIA
- *
- * Arg is socket number
- */
-#define MCMEM(s)	__REG2(0x48000028, (s)<<2 )  /* Card interface Common Memory Space Socket s Timing */
-#define MCATT(s)	__REG2(0x48000030, (s)<<2 )  /* Card interface Attribute Space Socket s Timing Configuration */
-#define MCIO(s)		__REG2(0x48000038, (s)<<2 )  /* Card interface I/O Space Socket s Timing Configuration */
-
-/* MECR register defines */
-#define MECR_NOS	(1 << 0)	/* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
-#define MECR_CIT	(1 << 1)	/* Card Is There: 0 -> no card, 1 -> card inserted */
-
-#define MDCNFG_DE0	(1 << 0)	/* SDRAM Bank 0 Enable */
-#define MDCNFG_DE1	(1 << 1)	/* SDRAM Bank 1 Enable */
-#define MDCNFG_DE2	(1 << 16)	/* SDRAM Bank 2 Enable */
-#define MDCNFG_DE3	(1 << 17)	/* SDRAM Bank 3 Enable */
-
-#define MDREFR_K0DB4	(1 << 29)	/* SDCLK0 Divide by 4 Control/Status */
-#define MDREFR_K2FREE	(1 << 25)	/* SDRAM Free-Running Control */
-#define MDREFR_K1FREE	(1 << 24)	/* SDRAM Free-Running Control */
-#define MDREFR_K0FREE	(1 << 23)	/* SDRAM Free-Running Control */
-#define MDREFR_SLFRSH	(1 << 22)	/* SDRAM Self-Refresh Control/Status */
-#define MDREFR_APD	(1 << 20)	/* SDRAM/SSRAM Auto-Power-Down Enable */
-#define MDREFR_K2DB2	(1 << 19)	/* SDCLK2 Divide by 2 Control/Status */
-#define MDREFR_K2RUN	(1 << 18)	/* SDCLK2 Run Control/Status */
-#define MDREFR_K1DB2	(1 << 17)	/* SDCLK1 Divide by 2 Control/Status */
-#define MDREFR_K1RUN	(1 << 16)	/* SDCLK1 Run Control/Status */
-#define MDREFR_E1PIN	(1 << 15)	/* SDCKE1 Level Control/Status */
-#define MDREFR_K0DB2	(1 << 14)	/* SDCLK0 Divide by 2 Control/Status */
-#define MDREFR_K0RUN	(1 << 13)	/* SDCLK0 Run Control/Status */
-#define MDREFR_E0PIN	(1 << 12)	/* SDCKE0 Level Control/Status */
-
-/*
  * Power Manager
  */
 
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index db615d5..86d94a3 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -46,6 +46,7 @@
 #include <mach/mmc.h>
 #include <mach/irda.h>
 #include <mach/ohci.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -463,7 +464,7 @@ static void __init lpd270_init(void)
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
 
-	lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
+	lpd270_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
 	lpd270_flash_data[1].width = 4;
 
 	/*
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 5b1cc1c..f9dfea7 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -50,6 +50,7 @@
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
 #include <mach/pm.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 #include "clock.h"
@@ -525,7 +526,7 @@ static void __init lubbock_init(void)
 	pxa_set_ac97_info(NULL);
 
 	lubbock_flash_data[0].width = lubbock_flash_data[1].width =
-		(BOOT_DEF & 1) ? 2 : 4;
+		(__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
 	/* Compensate for the nROMBT switch which swaps the flash banks */
 	printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n",
 	       flashboot?"Flash":"ROM", flashboot);
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 63f4e1c..31729ee 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -41,7 +41,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/flash.h>
 
-#include <plat/pxa27x.h>
+#include <mach/pxa27x.h>
 #include <mach/gpio.h>
 #include <mach/mainstone.h>
 #include <mach/audio.h>
@@ -51,6 +51,7 @@
 #include <mach/irda.h>
 #include <mach/ohci.h>
 #include <plat/pxa27x_keypad.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -565,7 +566,7 @@ static void __init mainstone_init(void)
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
 
-	mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
+	mst_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
 	mst_flash_data[1].width = 4;
 
 	/* Compensate for SW7 which swaps the flash banks */
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index acde987..3aefcbc 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -30,6 +30,7 @@
 #include <mach/reset.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
+#include <mach/pxa-smemc.h>
 
 #include <asm/mach/map.h>
 
@@ -324,8 +325,8 @@ void __init pxa26x_init_irq(void)
 
 static struct map_desc pxa25x_io_desc[] __initdata = {
 	{	/* Mem Ctl */
-		.virtual	=  0xf6000000,
-		.pfn		= __phys_to_pfn(0x48000000),
+		.virtual	=  PXA_SMEMC_VIRT,
+		.pfn		= __phys_to_pfn(PXA2XX_SMEMC_BASE),
 		.length		= 0x00200000,
 		.type		= MT_DEVICE
 	},
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 764b9ac..dd0cb80 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -17,6 +17,7 @@
 #include <linux/suspend.h>
 #include <linux/platform_device.h>
 #include <linux/sysdev.h>
+#include <linux/io.h>
 
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -27,6 +28,7 @@
 #include <mach/ohci.h>
 #include <mach/pm.h>
 #include <mach/dma.h>
+#include <mach/pxa-smemc.h>
 
 #include <plat/i2c.h>
 
@@ -257,7 +259,7 @@ enum {
 
 void pxa27x_cpu_pm_save(unsigned long *sleep_save)
 {
-	SAVE(MDREFR);
+	sleep_save[SLEEP_SAVE_MDREFR] = __raw_readl(MDREFR);
 	SAVE(PCFR);
 
 	SAVE(CKEN);
@@ -266,7 +268,7 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save)
 
 void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
 {
-	RESTORE(MDREFR);
+	__raw_writel(sleep_save[SLEEP_SAVE_MDREFR], MDREFR);
 	RESTORE(PCFR);
 
 	PSSR = PSSR_RDH | PSSR_PH;
@@ -375,8 +377,8 @@ void __init pxa27x_init_irq(void)
 
 static struct map_desc pxa27x_io_desc[] __initdata = {
 	{	/* Mem Ctl */
-		.virtual	=  0xf6000000,
-		.pfn		= __phys_to_pfn(0x48000000),
+		.virtual	=  PXA_SMEMC_VIRT,
+		.pfn		= __phys_to_pfn(PXA2XX_SMEMC_BASE),
 		.length		= 0x00200000,
 		.type		= MT_DEVICE
 	}, {	/* IMem ctl */
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index bb60664..0ed26a0 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -30,6 +30,7 @@
 #include <mach/pm.h>
 #include <mach/dma.h>
 #include <mach/regs-intc.h>
+#include <mach/pxa-smemc.h>
 #include <plat/i2c.h>
 
 #include <asm/mach/map.h>
@@ -584,8 +585,8 @@ void __init pxa3xx_init_irq(void)
 
 static struct map_desc pxa3xx_io_desc[] __initdata = {
 	{	/* Mem Ctl */
-		.virtual	=  0xf6000000,
-		.pfn		= __phys_to_pfn(0x4a000000),
+		.virtual	=  PXA_SMEMC_VIRT,
+		.pfn		= __phys_to_pfn(PXA3XX_SMEMC_BASE),
 		.length		= 0x00200000,
 		.type		= MT_DEVICE
 	}
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
index 52c30b0..227df3a 100644
--- a/arch/arm/mach-pxa/sleep.S
+++ b/arch/arm/mach-pxa/sleep.S
@@ -14,7 +14,7 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <mach/hardware.h>
-
+#include <mach/pxa-smemc.h>
 #include <mach/pxa2xx-regs.h>
 
 #define MDREFR_KDIV	0x200a4000	// all banks
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
index d6f6904..91edda8 100644
--- a/arch/arm/mach-pxa/smemc.c
+++ b/arch/arm/mach-pxa/smemc.c
@@ -9,50 +9,37 @@
 #include <linux/sysdev.h>
 
 #include <mach/hardware.h>
-
-#define SMEMC_PHYS_BASE	(0x4A000000)
-#define SMEMC_PHYS_SIZE	(0x90)
-
-#define MSC0		(0x08)	/* Static Memory Controller Register 0 */
-#define MSC1		(0x0C)	/* Static Memory Controller Register 1 */
-#define SXCNFG		(0x1C)	/* Synchronous Static Memory Control Register */
-#define MEMCLKCFG	(0x68)	/* Clock Configuration */
-#define CSADRCFG0	(0x80)	/* Address Configuration Register for CS0 */
-#define CSADRCFG1	(0x84)	/* Address Configuration Register for CS1 */
-#define CSADRCFG2	(0x88)	/* Address Configuration Register for CS2 */
-#define CSADRCFG3	(0x8C)	/* Address Configuration Register for CS3 */
+#include <mach/pxa-smemc.h>
 
 #ifdef CONFIG_PM
-static void __iomem *smemc_mmio_base;
-
 static unsigned long msc[2];
 static unsigned long sxcnfg, memclkcfg;
 static unsigned long csadrcfg[4];
 
 static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state)
 {
-	msc[0] = __raw_readl(smemc_mmio_base + MSC0);
-	msc[1] = __raw_readl(smemc_mmio_base + MSC1);
-	sxcnfg = __raw_readl(smemc_mmio_base + SXCNFG);
-	memclkcfg = __raw_readl(smemc_mmio_base + MEMCLKCFG);
-	csadrcfg[0] = __raw_readl(smemc_mmio_base + CSADRCFG0);
-	csadrcfg[1] = __raw_readl(smemc_mmio_base + CSADRCFG1);
-	csadrcfg[2] = __raw_readl(smemc_mmio_base + CSADRCFG2);
-	csadrcfg[3] = __raw_readl(smemc_mmio_base + CSADRCFG3);
+	msc[0] = __raw_readl(MSC0);
+	msc[1] = __raw_readl(MSC1);
+	sxcnfg = __raw_readl(SXCNFG);
+	memclkcfg = __raw_readl(MEMCLKCFG);
+	csadrcfg[0] = __raw_readl(CSADRCFG0);
+	csadrcfg[1] = __raw_readl(CSADRCFG1);
+	csadrcfg[2] = __raw_readl(CSADRCFG2);
+	csadrcfg[3] = __raw_readl(CSADRCFG3);
 
 	return 0;
 }
 
 static int pxa3xx_smemc_resume(struct sys_device *dev)
 {
-	__raw_writel(msc[0], smemc_mmio_base + MSC0);
-	__raw_writel(msc[1], smemc_mmio_base + MSC1);
-	__raw_writel(sxcnfg, smemc_mmio_base + SXCNFG);
-	__raw_writel(memclkcfg, smemc_mmio_base + MEMCLKCFG);
-	__raw_writel(csadrcfg[0], smemc_mmio_base + CSADRCFG0);
-	__raw_writel(csadrcfg[1], smemc_mmio_base + CSADRCFG1);
-	__raw_writel(csadrcfg[2], smemc_mmio_base + CSADRCFG2);
-	__raw_writel(csadrcfg[3], smemc_mmio_base + CSADRCFG3);
+	__raw_writel(msc[0], MSC0);
+	__raw_writel(msc[1], MSC1);
+	__raw_writel(sxcnfg, SXCNFG);
+	__raw_writel(memclkcfg, MEMCLKCFG);
+	__raw_writel(csadrcfg[0], CSADRCFG0);
+	__raw_writel(csadrcfg[1], CSADRCFG1);
+	__raw_writel(csadrcfg[2], CSADRCFG2);
+	__raw_writel(csadrcfg[3], CSADRCFG3);
 
 	return 0;
 }
@@ -73,10 +60,6 @@ static int __init smemc_init(void)
 	int ret = 0;
 
 	if (cpu_is_pxa3xx()) {
-		smemc_mmio_base = ioremap(SMEMC_PHYS_BASE, SMEMC_PHYS_SIZE);
-		if (smemc_mmio_base == NULL)
-			return -ENODEV;
-
 		ret = sysdev_class_register(&smemc_sysclass);
 		if (ret)
 			return ret;
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 38bcc2a..3ead559 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -45,6 +45,7 @@
 #include <mach/pxa2xx_spi.h>
 #include <mach/spitz.h>
 #include <mach/sharpsl_pm.h>
+#include <mach/pxa-smemc.h>
 
 #include <plat/i2c.h>
 
@@ -931,8 +932,8 @@ static void spitz_poweroff(void)
 static void spitz_restart(char mode, const char *cmd)
 {
 	/* Bootloader magic for a reboot */
-	if ((MSC0 & 0xffff0000) == 0x7ff00000)
-		MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
+	if ((__raw_readl(MSC0) & 0xffff0000) == 0x7ff00000)
+		__raw_writel((__raw_readl(MSC0) & 0xffff) | 0x7ee00000, MSC0);
 
 	spitz_poweroff();
 }
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 19f5378..70ffc36 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -48,6 +48,7 @@
 #include <mach/udc.h>
 #include <mach/pxa2xx_spi.h>
 #include <mach/pxa27x-udc.h>
+#include <mach/pxa-smemc.h>
 
 #include <linux/spi/spi.h>
 #include <linux/mfd/da903x.h>
@@ -976,7 +977,7 @@ static void __init stargate2_init(void)
 {
 	/* This is probably a board specific hack as this must be set
 	   prior to connecting the MFP stuff up. */
-	MECR &= ~MECR_NOS;
+	__raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR);
 
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
 
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index 3883385..e36c3c3 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -46,6 +46,7 @@
 #include <mach/tosa_bt.h>
 #include <mach/pxa2xx_spi.h>
 #include <mach/audio.h>
+#include <mach/pxa-smemc.h>
 
 #include <asm/mach/arch.h>
 #include <mach/tosa.h>
@@ -893,9 +894,11 @@ static void tosa_poweroff(void)
 
 static void tosa_restart(char mode, const char *cmd)
 {
+	uint32_t msc0 = __raw_readl(MSC0);
+
 	/* Bootloader magic for a reboot */
-	if((MSC0 & 0xffff0000) == 0x7ff00000)
-		MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
+	if((msc0 & 0xffff0000) == 0x7ff00000)
+		__raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0);
 
 	tosa_poweroff();
 }
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index ab3b933..2a3c28c 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -47,6 +47,7 @@
 #include <mach/mmc.h>
 #include <mach/irda.h>
 #include <mach/ohci.h>
+#include <mach/pxa-smemc.h>
 #include <plat/i2c.h>
 
 #include "generic.h"
@@ -542,7 +543,7 @@ static void __init trizeps4_map_io(void)
 	pxa27x_map_io();
 	iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
 
-	if ((MSC0 & 0x8) && (BOOT_DEF & 0x1)) {
+	if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) {
 		/* if flash is 16 bit wide its a Trizeps4 WL */
 		__machine_arch_type = MACH_TYPE_TRIZEPS4WL;
 		trizeps4_flash_data[0].width = 2;
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
index 99744f4..67073e0 100644
--- a/arch/arm/mach-pxa/xcep.c
+++ b/arch/arm/mach-pxa/xcep.c
@@ -31,6 +31,7 @@
 #include <mach/hardware.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/mfp-pxa25x.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 
@@ -172,9 +173,9 @@ static void __init xcep_init(void)
 
 	/* See Intel XScale Developer's Guide for details */
 	/* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */
-	MSC1 = (MSC1 & 0xffff) | 0xD5540000;
+	__raw_writel((__raw_readl(MSC1) & 0xffff) | 0xD5540000, MSC1);
 	/* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */
-	MSC2 = (MSC2 & 0xffff) | 0x72A00000;
+	__raw_writel((__raw_readl(MSC2) & 0xffff) | 0x72A00000, MSC2);
 
 	platform_add_devices(ARRAY_AND_SIZE(devices));
 	pxa_set_i2c_info(&xcep_i2c_platform_data);
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 0909df2..2f21144 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -47,6 +47,7 @@
 #include <mach/audio.h>
 #include <mach/arcom-pcmcia.h>
 #include <mach/zeus.h>
+#include <mach/pxa-smemc.h>
 
 #include "generic.h"
 
@@ -828,8 +829,8 @@ static void __init zeus_init(void)
 	pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f));
 
 	/* Fix timings for dm9000s (CS1/CS2)*/
-	MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
-	MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
+	__raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
+	__raw_writel((MSC1 & 0xffff0000) | dm9000_msc, MSC1);
 
 	pm_power_off = zeus_power_off;
 	zeus_setup_apm();
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
index ae07b4d..65a8b6f 100644
--- a/drivers/pcmcia/pxa2xx_base.c
+++ b/drivers/pcmcia/pxa2xx_base.c
@@ -26,6 +26,7 @@
 #include <linux/platform_device.h>
 
 #include <mach/hardware.h>
+#include <mach/pxa-smemc.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/system.h>
@@ -116,37 +117,49 @@ static inline u_int pxa2xx_pcmcia_cmd_time(u_int mem_clk_10khz,
 
 static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock )
 {
-	MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+	uint32_t val;
+
+	val = ((pxa2xx_mcxx_setup(speed, clock)
 		& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
 		| ((pxa2xx_mcxx_asst(speed, clock)
 		& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
 		| ((pxa2xx_mcxx_hold(speed, clock)
 		& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
 
+	__raw_writel(val, MCMEM(sock));
+
 	return 0;
 }
 
 static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock )
 {
-	MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+	uint32_t val;
+
+	val = ((pxa2xx_mcxx_setup(speed, clock)
 		& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
 		| ((pxa2xx_mcxx_asst(speed, clock)
 		& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
 		| ((pxa2xx_mcxx_hold(speed, clock)
 		& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
 
+	__raw_writel(val, MCIO(sock));
+
 	return 0;
 }
 
 static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock )
 {
-	MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock)
+	uint32_t val;
+
+	val = ((pxa2xx_mcxx_setup(speed, clock)
 		& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
 		| ((pxa2xx_mcxx_asst(speed, clock)
 		& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
 		| ((pxa2xx_mcxx_hold(speed, clock)
 		& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
 
+	__raw_writel(val, MCATT(sock));
+
 	return 0;
 }
 
@@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
 static void pxa2xx_configure_sockets(struct device *dev)
 {
 	struct pcmcia_low_level *ops = dev->platform_data;
-
 	/*
 	 * We have at least one socket, so set MECR:CIT
 	 * (Card Is There)
 	 */
-	MECR |= MECR_CIT;
+	uint32_t mecr = MECR_CIT;
 
 	/* Set MECR:NOS (Number Of Sockets) */
 	if ((ops->first + ops->nr) > 1 ||
 	    machine_is_viper() || machine_is_arcom_zeus())
-		MECR |= MECR_NOS;
-	else
-		MECR &= ~MECR_NOS;
+		mecr |= MECR_NOS;
+
+	__raw_writel(mecr, MECR);
 }
 
 static const char *skt_names[] = {
@@ -272,14 +284,24 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
 	struct soc_pcmcia_socket *skt;
 
 	ops = (struct pcmcia_low_level *)dev->dev.platform_data;
-	if (!ops)
-		return -ENODEV;
+	if (!ops) {
+		ret = -ENODEV;
+		goto err0;
+	}
+
+	if (cpu_is_pxa320() && ops->nr > 1) {
+		dev_err(&dev->dev, "pxa320 supports only one pcmcia slot");
+		ret = -EINVAL;
+		goto err0;
+	}
 
 	pxa2xx_drv_pcmcia_ops(ops);
 
 	sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
-	if (!sinfo)
-		return -ENOMEM;
+	if (!sinfo) {
+		ret = -ENOMEM;
+		goto err0;
+	}
 
 	sinfo->nskt = ops->nr;
 
@@ -295,18 +317,19 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
 
 		ret = pxa2xx_drv_pcmcia_add_one(skt);
 		if (ret)
-			break;
+			goto err1;
 	}
 
-	if (ret) {
-		while (--i >= 0)
-			soc_pcmcia_remove_one(&sinfo->skt[i]);
-		kfree(sinfo);
-	} else {
-		pxa2xx_configure_sockets(&dev->dev);
-		dev_set_drvdata(&dev->dev, sinfo);
-	}
+	pxa2xx_configure_sockets(&dev->dev);
+	dev_set_drvdata(&dev->dev, sinfo);
 
+	return 0;
+
+err1:
+	while (--i >= 0)
+		soc_pcmcia_remove_one(&sinfo->skt[i]);
+	kfree(sinfo);
+err0:
 	return ret;
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 03/17] ARM: pxa: Toradex Colibri PXA270 CF support
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
  2010-11-02 23:51 ` [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-03 14:44   ` Eric Miao
  2010-11-02 23:51 ` [PATCH 04/17] ARM: pxa: Push Colibri evalboard MFP into module files Marek Vasut
                   ` (14 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This driver also contains structures to eventually support PXA320. This is
planned to be added in a later patch.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
---
 arch/arm/mach-pxa/colibri-pxa270-evalboard.c |   18 ++
 drivers/pcmcia/Kconfig                       |    2 +-
 drivers/pcmcia/Makefile                      |    1 +
 drivers/pcmcia/pxa2xx_colibri.c              |  214 ++++++++++++++++++++++++++
 4 files changed, 234 insertions(+), 1 deletions(-)
 create mode 100644 drivers/pcmcia/pxa2xx_colibri.c

diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
index 0f3b632..6177ff5 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -51,6 +51,24 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
 	GPIO89_USBH1_PEN,
 	GPIO119_USBH2_PWR,
 	GPIO120_USBH2_PEN,
+
+	/* PCMCIA */
+	GPIO85_nPCE_1,
+	GPIO54_nPCE_2,
+	GPIO55_nPREG,
+	GPIO50_nPIOR,
+	GPIO51_nPIOW,
+	GPIO49_nPWE,
+	GPIO48_nPOE,
+	GPIO57_nIOIS16,
+	GPIO56_nPWAIT,
+	GPIO104_PSKTSEL,
+	GPIO53_GPIO,	/* RESET */
+	GPIO83_GPIO,	/* BVD1 */
+	GPIO82_GPIO,	/* BVD2 */
+	GPIO1_GPIO,	/* READY */
+	GPIO84_GPIO,	/* DETECT */
+	GPIO107_GPIO,	/* PPEN */
 };
 
 /******************************************************************************
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index c80a7a6..e9acf03 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -215,7 +215,7 @@ config PCMCIA_PXA2XX
 	depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
 		    || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \
 		    || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \
-		    || MACH_VPAC270 || MACH_BALLOON3)
+		    || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI)
 	select PCMCIA_SOC_COMMON
 	help
 	  Say Y here to include support for the PXA2xx PCMCIA controller
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 8d9386a..2fee7ef 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -70,6 +70,7 @@ pxa2xx-obj-$(CONFIG_MACH_E740)			+= pxa2xx_e740.o
 pxa2xx-obj-$(CONFIG_MACH_STARGATE2)		+= pxa2xx_stargate2.o
 pxa2xx-obj-$(CONFIG_MACH_VPAC270)		+= pxa2xx_vpac270.o
 pxa2xx-obj-$(CONFIG_MACH_BALLOON3)		+= pxa2xx_balloon3.o
+pxa2xx-obj-$(CONFIG_MACH_COLIBRI)		+= pxa2xx_colibri.o
 
 obj-$(CONFIG_PCMCIA_PXA2XX)			+= pxa2xx_base.o $(pxa2xx-obj-y)
 
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
new file mode 100644
index 0000000..4ed876c
--- /dev/null
+++ b/drivers/pcmcia/pxa2xx_colibri.c
@@ -0,0 +1,214 @@
+/*
+ * linux/drivers/pcmcia/pxa2xx_colibri.c
+ *
+ * Driver for Toradex Colibri PXA270 CF socket
+ *
+ * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/delay.h>
+#include <linux/gpio.h>
+
+#include <asm/mach-types.h>
+
+#include "soc_common.h"
+
+#define	COLIBRI270_RESET_GPIO	53
+#define	COLIBRI270_PPEN_GPIO	107
+#define	COLIBRI270_BVD1_GPIO	83
+#define	COLIBRI270_BVD2_GPIO	82
+#define	COLIBRI270_DETECT_GPIO	84
+#define	COLIBRI270_READY_GPIO	1
+
+static struct {
+	int	reset_gpio;
+	int	ppen_gpio;
+	int	bvd1_gpio;
+	int	bvd2_gpio;
+	int	detect_gpio;
+	int	ready_gpio;
+} colibri_pcmcia_gpio;
+
+static struct pcmcia_irqs colibri_irqs[] = {
+	{
+		.sock = 0,
+		.str  = "PCMCIA CD"
+	},
+};
+
+static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
+{
+	int ret;
+
+	ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT");
+	if (ret)
+		goto err1;
+	ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio);
+	if (ret)
+		goto err2;
+
+	ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY");
+	if (ret)
+		goto err2;
+	ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio);
+	if (ret)
+		goto err3;
+
+	ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1");
+	if (ret)
+		goto err3;
+	ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio);
+	if (ret)
+		goto err4;
+
+	ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2");
+	if (ret)
+		goto err4;
+	ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio);
+	if (ret)
+		goto err5;
+
+	ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN");
+	if (ret)
+		goto err5;
+	ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0);
+	if (ret)
+		goto err6;
+
+	ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET");
+	if (ret)
+		goto err6;
+	ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1);
+	if (ret)
+		goto err7;
+
+	colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio);
+	skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio);
+
+	return soc_pcmcia_request_irqs(skt, colibri_irqs,
+					ARRAY_SIZE(colibri_irqs));
+
+err7:
+	gpio_free(colibri_pcmcia_gpio.detect_gpio);
+err6:
+	gpio_free(colibri_pcmcia_gpio.ready_gpio);
+err5:
+	gpio_free(colibri_pcmcia_gpio.bvd1_gpio);
+err4:
+	gpio_free(colibri_pcmcia_gpio.bvd2_gpio);
+err3:
+	gpio_free(colibri_pcmcia_gpio.reset_gpio);
+err2:
+	gpio_free(colibri_pcmcia_gpio.ppen_gpio);
+err1:
+	return ret;
+}
+
+static void colibri_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
+{
+	gpio_free(colibri_pcmcia_gpio.detect_gpio);
+	gpio_free(colibri_pcmcia_gpio.ready_gpio);
+	gpio_free(colibri_pcmcia_gpio.bvd1_gpio);
+	gpio_free(colibri_pcmcia_gpio.bvd2_gpio);
+	gpio_free(colibri_pcmcia_gpio.reset_gpio);
+	gpio_free(colibri_pcmcia_gpio.ppen_gpio);
+}
+
+static void colibri_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
+					struct pcmcia_state *state)
+{
+
+	state->detect = !!gpio_get_value(colibri_pcmcia_gpio.detect_gpio);
+	state->ready  = !!gpio_get_value(colibri_pcmcia_gpio.ready_gpio);
+	state->bvd1   = !!gpio_get_value(colibri_pcmcia_gpio.bvd1_gpio);
+	state->bvd2   = !!gpio_get_value(colibri_pcmcia_gpio.bvd2_gpio);
+	state->wrprot = 0;
+	state->vs_3v  = 1;
+	state->vs_Xv  = 0;
+}
+
+static int
+colibri_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
+				const socket_state_t *state)
+{
+	gpio_set_value(colibri_pcmcia_gpio.ppen_gpio,
+			!(state->Vcc == 33 && state->Vpp < 50));
+	gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags & SS_RESET);
+	return 0;
+}
+
+static void colibri_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
+{
+}
+
+static void colibri_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
+{
+}
+
+static struct pcmcia_low_level colibri_pcmcia_ops = {
+	.owner			= THIS_MODULE,
+
+	.first			= 0,
+	.nr			= 1,
+
+	.hw_init		= colibri_pcmcia_hw_init,
+	.hw_shutdown		= colibri_pcmcia_hw_shutdown,
+
+	.socket_state		= colibri_pcmcia_socket_state,
+	.configure_socket	= colibri_pcmcia_configure_socket,
+
+	.socket_init		= colibri_pcmcia_socket_init,
+	.socket_suspend		= colibri_pcmcia_socket_suspend,
+};
+
+static struct platform_device *colibri_pcmcia_device;
+
+static int __init colibri_pcmcia_init(void)
+{
+	int ret;
+
+	colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
+	if (!colibri_pcmcia_device)
+		return -ENOMEM;
+
+	/* Colibri PXA270 */
+	if (machine_is_colibri()) {
+		colibri_pcmcia_gpio.reset_gpio	= COLIBRI270_RESET_GPIO;
+		colibri_pcmcia_gpio.ppen_gpio	= COLIBRI270_PPEN_GPIO;
+		colibri_pcmcia_gpio.bvd1_gpio	= COLIBRI270_BVD1_GPIO;
+		colibri_pcmcia_gpio.bvd2_gpio	= COLIBRI270_BVD2_GPIO;
+		colibri_pcmcia_gpio.detect_gpio	= COLIBRI270_DETECT_GPIO;
+		colibri_pcmcia_gpio.ready_gpio	= COLIBRI270_READY_GPIO;
+	}
+
+	ret = platform_device_add_data(colibri_pcmcia_device,
+		&colibri_pcmcia_ops, sizeof(colibri_pcmcia_ops));
+
+	if (!ret)
+		ret = platform_device_add(colibri_pcmcia_device);
+
+	if (ret)
+		platform_device_put(colibri_pcmcia_device);
+
+	return ret;
+}
+
+static void __exit colibri_pcmcia_exit(void)
+{
+	platform_device_unregister(colibri_pcmcia_device);
+}
+
+module_init(colibri_pcmcia_init);
+module_exit(colibri_pcmcia_exit);
+
+MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
+MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270");
+MODULE_ALIAS("platform:pxa2xx-pcmcia");
+MODULE_LICENSE("GPL");
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 04/17] ARM: pxa: Push Colibri evalboard MFP into module files
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
  2010-11-02 23:51 ` [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses Marek Vasut
  2010-11-02 23:51 ` [PATCH 03/17] ARM: pxa: Toradex Colibri PXA270 CF support Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-03 14:47   ` Eric Miao
  2010-11-02 23:51 ` [PATCH 05/17] ARM: pxa: Add M41T00 RTC support into Colibri evalboard Marek Vasut
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

This change -- pushing the MFP configuration back into Module files -- is
necessary because some evalboards can be used with multiple modules, where MFP
differs from module to module. Therefore MFP isn't board-specific, but
module-specific and the module should preconfigure itself for the board.

(And there is also the C preprocesor limitation and conflicting #define-s)

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
---
 arch/arm/mach-pxa/Kconfig                    |    8 +-
 arch/arm/mach-pxa/colibri-pxa270-evalboard.c |   61 ++++-----------
 arch/arm/mach-pxa/colibri-pxa270-income.c    |   47 -----------
 arch/arm/mach-pxa/colibri-pxa270.c           |   96 ++++++++++++++++++++++
 arch/arm/mach-pxa/colibri-pxa300.c           |   61 ++++++---------
 arch/arm/mach-pxa/colibri-pxa320.c           |  112 ++++++++++----------------
 arch/arm/mach-pxa/colibri-pxa3xx.c           |   49 -----------
 arch/arm/mach-pxa/include/mach/colibri.h     |    6 ++
 8 files changed, 188 insertions(+), 252 deletions(-)

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index dd235ec..b44d613 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -232,10 +232,6 @@ config MACH_COLIBRI
 	bool "Toradex Colibri PXA270"
 	select PXA27x
 
-config MACH_COLIBRI_PXA270_EVALBOARD
-	bool "Toradex Colibri Evaluation Carrier Board support (PXA270)"
-	depends on MACH_COLIBRI
-
 config MACH_COLIBRI_PXA270_INCOME
 	bool "Income s.r.o. PXA270 SBC"
 	depends on MACH_COLIBRI
@@ -253,6 +249,10 @@ config MACH_COLIBRI320
 	select PXA3xx
 	select CPU_PXA320
 
+config MACH_COLIBRI_PXA270_EVALBOARD
+	bool "Toradex Colibri Evaluation Carrier Board support"
+	depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
+
 config MACH_VPAC270
 	bool "Voipac PXA270"
 	select PXA27x
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
index 6177ff5..e1a2b52 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -30,61 +30,28 @@
 #include "devices.h"
 
 /******************************************************************************
- * Pin configuration
- ******************************************************************************/
-static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
-	/* MMC */
-	GPIO32_MMC_CLK,
-	GPIO92_MMC_DAT_0,
-	GPIO109_MMC_DAT_1,
-	GPIO110_MMC_DAT_2,
-	GPIO111_MMC_DAT_3,
-	GPIO112_MMC_CMD,
-	GPIO0_GPIO,	/* SD detect */
-
-	/* FFUART */
-	GPIO39_FFUART_TXD,
-	GPIO34_FFUART_RXD,
-
-	/* UHC */
-	GPIO88_USBH1_PWR,
-	GPIO89_USBH1_PEN,
-	GPIO119_USBH2_PWR,
-	GPIO120_USBH2_PEN,
-
-	/* PCMCIA */
-	GPIO85_nPCE_1,
-	GPIO54_nPCE_2,
-	GPIO55_nPREG,
-	GPIO50_nPIOR,
-	GPIO51_nPIOW,
-	GPIO49_nPWE,
-	GPIO48_nPOE,
-	GPIO57_nIOIS16,
-	GPIO56_nPWAIT,
-	GPIO104_PSKTSEL,
-	GPIO53_GPIO,	/* RESET */
-	GPIO83_GPIO,	/* BVD1 */
-	GPIO82_GPIO,	/* BVD2 */
-	GPIO1_GPIO,	/* READY */
-	GPIO84_GPIO,	/* DETECT */
-	GPIO107_GPIO,	/* PPEN */
-};
-
-/******************************************************************************
  * SD/MMC card controller
  ******************************************************************************/
 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
 static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
 	.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34,
 	.gpio_power		= -1,
-	.gpio_card_detect	= GPIO0_COLIBRI_PXA270_SD_DETECT,
 	.gpio_card_ro		= -1,
 	.detect_delay_ms	= 200,
 };
 
 static void __init colibri_pxa270_mmc_init(void)
 {
+	if (machine_is_colibri())	/* PXA270 Colibri */
+		colibri_pxa270_mci_platform_data.gpio_card_detect =
+			GPIO0_COLIBRI_PXA270_SD_DETECT;
+	if (machine_is_colibri300())	/* PXA300 Colibri */
+		colibri_pxa270_mci_platform_data.gpio_card_detect =
+			GPIO39_COLIBRI_PXA300_SD_DETECT;
+	else				/* PXA320 Colibri */
+		colibri_pxa270_mci_platform_data.gpio_card_detect =
+			GPIO28_COLIBRI_PXA320_SD_DETECT;
+
 	pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
 }
 #else
@@ -103,13 +70,17 @@ static int colibri_pxa270_ohci_init(struct device *dev)
 
 static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
 	.port_mode	= PMM_PERPORT_MODE,
-	.flags		= ENABLE_PORT1 | ENABLE_PORT2 |
+	.flags		= ENABLE_PORT1 |
 			  POWER_CONTROL_LOW | POWER_SENSE_LOW,
 	.init		= colibri_pxa270_ohci_init,
 };
 
 static void __init colibri_pxa270_uhc_init(void)
 {
+	/* Colibri PXA270 has two usb ports, TBA for 320 */
+	if (machine_is_colibri())
+		colibri_pxa270_ohci_info.flags	|= ENABLE_PORT2;
+
 	pxa_set_ohci_info(&colibri_pxa270_ohci_info);
 }
 #else
@@ -118,7 +89,6 @@ static inline void colibri_pxa270_uhc_init(void) {}
 
 void __init colibri_pxa270_evalboard_init(void)
 {
-	pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
@@ -126,4 +96,3 @@ void __init colibri_pxa270_evalboard_init(void)
 	colibri_pxa270_mmc_init();
 	colibri_pxa270_uhc_init();
 }
-
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 37f0f3e..07b62a0 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -46,52 +46,6 @@
 #define GPIO113_INCOME_TS_IRQ   (113)
 
 /******************************************************************************
- * Pin configuration
- ******************************************************************************/
-static mfp_cfg_t income_pin_config[] __initdata = {
-	/* MMC */
-	GPIO32_MMC_CLK,
-	GPIO92_MMC_DAT_0,
-	GPIO109_MMC_DAT_1,
-	GPIO110_MMC_DAT_2,
-	GPIO111_MMC_DAT_3,
-	GPIO112_MMC_CMD,
-	GPIO0_GPIO,	/* SD detect */
-	GPIO1_GPIO,	/* SD read-only */
-
-	/* FFUART */
-	GPIO39_FFUART_TXD,
-	GPIO34_FFUART_RXD,
-
-	/* BFUART */
-	GPIO42_BTUART_RXD,
-	GPIO43_BTUART_TXD,
-	GPIO45_BTUART_RTS,
-
-	/* STUART */
-	GPIO46_STUART_RXD,
-	GPIO47_STUART_TXD,
-
-	/* UHC */
-	GPIO88_USBH1_PWR,
-	GPIO89_USBH1_PEN,
-
-	/* LCD */
-	GPIOxx_LCD_TFT_16BPP,
-
-	/* PWM */
-	GPIO16_PWM0_OUT,
-
-	/* I2C */
-	GPIO117_I2C_SCL,
-	GPIO118_I2C_SDA,
-
-	/* LED */
-	GPIO54_GPIO,	/* LED A */
-	GPIO55_GPIO,	/* LED B */
-};
-
-/******************************************************************************
  * SD/MMC card controller
  ******************************************************************************/
 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
@@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {}
 
 void __init colibri_pxa270_income_boardinit(void)
 {
-	pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
 	pxa_set_ffuart_info(NULL);
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 73205bc..e940004 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -33,6 +33,99 @@
 #include "generic.h"
 
 /******************************************************************************
+ * Evaluation board MFP
+ ******************************************************************************/
+#ifdef	 CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
+	/* MMC */
+	GPIO32_MMC_CLK,
+	GPIO92_MMC_DAT_0,
+	GPIO109_MMC_DAT_1,
+	GPIO110_MMC_DAT_2,
+	GPIO111_MMC_DAT_3,
+	GPIO112_MMC_CMD,
+	GPIO0_GPIO,	/* SD detect */
+
+	/* FFUART */
+	GPIO39_FFUART_TXD,
+	GPIO34_FFUART_RXD,
+
+	/* UHC */
+	GPIO88_USBH1_PWR,
+	GPIO89_USBH1_PEN,
+	GPIO119_USBH2_PWR,
+	GPIO120_USBH2_PEN,
+
+	/* PCMCIA */
+	GPIO85_nPCE_1,
+	GPIO54_nPCE_2,
+	GPIO55_nPREG,
+	GPIO50_nPIOR,
+	GPIO51_nPIOW,
+	GPIO49_nPWE,
+	GPIO48_nPOE,
+	GPIO57_nIOIS16,
+	GPIO56_nPWAIT,
+	GPIO104_PSKTSEL,
+	GPIO53_GPIO,	/* RESET */
+	GPIO83_GPIO,	/* BVD1 */
+	GPIO82_GPIO,	/* BVD2 */
+	GPIO1_GPIO,	/* READY */
+	GPIO84_GPIO,	/* DETECT */
+	GPIO107_GPIO,	/* PPEN */
+};
+#else
+static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {};
+#endif
+
+#ifdef	CONFIG_MACH_COLIBRI_PXA270_INCOME
+static mfp_cfg_t income_pin_config[] __initdata = {
+	/* MMC */
+	GPIO32_MMC_CLK,
+	GPIO92_MMC_DAT_0,
+	GPIO109_MMC_DAT_1,
+	GPIO110_MMC_DAT_2,
+	GPIO111_MMC_DAT_3,
+	GPIO112_MMC_CMD,
+	GPIO0_GPIO,	/* SD detect */
+	GPIO1_GPIO,	/* SD read-only */
+
+	/* FFUART */
+	GPIO39_FFUART_TXD,
+	GPIO34_FFUART_RXD,
+
+	/* BFUART */
+	GPIO42_BTUART_RXD,
+	GPIO43_BTUART_TXD,
+	GPIO45_BTUART_RTS,
+
+	/* STUART */
+	GPIO46_STUART_RXD,
+	GPIO47_STUART_TXD,
+
+	/* UHC */
+	GPIO88_USBH1_PWR,
+	GPIO89_USBH1_PEN,
+
+	/* LCD */
+	GPIOxx_LCD_TFT_16BPP,
+
+	/* PWM */
+	GPIO16_PWM0_OUT,
+
+	/* I2C */
+	GPIO117_I2C_SCL,
+	GPIO118_I2C_SDA,
+
+	/* LED */
+	GPIO54_GPIO,	/* LED A */
+	GPIO55_GPIO,	/* LED B */
+};
+#else
+static mfp_cfg_t income_pin_config[] __initdata = {};
+#endif
+
+/******************************************************************************
  * Pin configuration
  ******************************************************************************/
 static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
@@ -185,9 +278,12 @@ static void __init colibri_pxa270_init(void)
 
 	switch (colibri_pxa270_baseboard) {
 	case COLIBRI_PXA270_EVALBOARD:
+		pxa2xx_mfp_config(ARRAY_AND_SIZE(
+			colibri_pxa270_evalboard_pin_config));
 		colibri_pxa270_evalboard_init();
 		break;
 	case COLIBRI_PXA270_INCOME:
+		pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
 		colibri_pxa270_income_boardinit();
 		break;
 	default:
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index d039bd1..649c83c 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -31,9 +31,28 @@
 #include "generic.h"
 #include "devices.h"
 
+
+#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
+	/* MMC */
+	GPIO7_MMC1_CLK,
+	GPIO14_MMC1_CMD,
+	GPIO3_MMC1_DAT0,
+	GPIO4_MMC1_DAT1,
+	GPIO5_MMC1_DAT2,
+	GPIO6_MMC1_DAT3,
+	GPIO39_GPIO,	/* SD detect */
+
+	/* UHC */
+	GPIO0_2_USBH_PEN,
+	GPIO1_2_USBH_PWR,
+};
+#else
+static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {};
+#endif
+
 #if defined(CONFIG_AX88796)
 #define COLIBRI_ETH_IRQ_GPIO	mfp_to_gpio(GPIO26_GPIO)
-
 /*
  * Asix AX88796 Ethernet
  */
@@ -80,35 +99,6 @@ static void __init colibri_pxa300_init_eth(void)
 static inline void __init colibri_pxa300_init_eth(void) {}
 #endif /* CONFIG_AX88796 */
 
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = {
-	GPIO0_2_USBH_PEN,
-	GPIO1_2_USBH_PWR,
-};
-
-static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
-	.port_mode	= PMM_GLOBAL_MODE,
-	.flags		= ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
-};
-
-void __init colibri_pxa300_init_ohci(void)
-{
-	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config));
-	pxa_set_ohci_info(&colibri_pxa300_ohci_info);
-}
-#else
-static inline void colibri_pxa300_init_ohci(void) {}
-#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
-
-static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
-	GPIO7_MMC1_CLK,
-	GPIO14_MMC1_CMD,
-	GPIO3_MMC1_DAT0,
-	GPIO4_MMC1_DAT1,
-	GPIO5_MMC1_DAT2,
-	GPIO6_MMC1_DAT3,
-};
-
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
 static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
 	GPIO54_LCD_LDD_0,
@@ -171,18 +161,15 @@ static inline void colibri_pxa310_init_ac97(void) {}
 
 void __init colibri_pxa300_init(void)
 {
-	pxa_set_ffuart_info(NULL);
-	pxa_set_btuart_info(NULL);
-	pxa_set_stuart_info(NULL);
-
 	colibri_pxa300_init_eth();
-	colibri_pxa300_init_ohci();
 	colibri_pxa3xx_init_nand();
 	colibri_pxa300_init_lcd();
 	colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
 	colibri_pxa310_init_ac97();
-	colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config),
-				mfp_to_gpio(MFP_PIN_GPIO13));
+
+	/* Evalboard init */
+	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
+	colibri_pxa270_evalboard_init();
 }
 
 MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index ccb2c59..6f15f2a 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -35,9 +35,47 @@
 #include "generic.h"
 #include "devices.h"
 
+#ifdef	CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
+	/* MMC */
+	GPIO22_MMC1_CLK,
+	GPIO23_MMC1_CMD,
+	GPIO18_MMC1_DAT0,
+	GPIO19_MMC1_DAT1,
+	GPIO20_MMC1_DAT2,
+	GPIO21_MMC1_DAT3,
+	GPIO28_GPIO,	/* SD detect */
+
+	/* UART 1 configuration (may be set by bootloader) */
+	GPIO99_UART1_CTS,
+	GPIO104_UART1_RTS,
+	GPIO97_UART1_RXD,
+	GPIO98_UART1_TXD,
+	GPIO101_UART1_DTR,
+	GPIO103_UART1_DSR,
+	GPIO100_UART1_DCD,
+	GPIO102_UART1_RI,
+
+	/* UART 2 configuration */
+	GPIO109_UART2_CTS,
+	GPIO112_UART2_RTS,
+	GPIO110_UART2_RXD,
+	GPIO111_UART2_TXD,
+
+	/* UART 3 configuration */
+	GPIO30_UART3_RXD,
+	GPIO31_UART3_TXD,
+
+	/* UHC */
+	GPIO2_2_USBH_PEN,
+	GPIO3_2_USBH_PWR,
+};
+#else
+static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
+#endif
+
 #if defined(CONFIG_AX88796)
 #define COLIBRI_ETH_IRQ_GPIO	mfp_to_gpio(GPIO36_GPIO)
-
 /*
  * Asix AX88796 Ethernet
  */
@@ -84,26 +122,6 @@ static void __init colibri_pxa320_init_eth(void)
 static inline void __init colibri_pxa320_init_eth(void) {}
 #endif /* CONFIG_AX88796 */
 
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = {
-	GPIO2_2_USBH_PEN,
-	GPIO3_2_USBH_PWR,
-};
-
-static struct pxaohci_platform_data colibri_pxa320_ohci_info = {
-	.port_mode	= PMM_GLOBAL_MODE,
-	.flags		= ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
-};
-
-void __init colibri_pxa320_init_ohci(void)
-{
-	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config));
-	pxa_set_ohci_info(&colibri_pxa320_ohci_info);
-}
-#else
-static inline void colibri_pxa320_init_ohci(void) {}
-#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
-
 #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
 static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
 	.gpio_vbus		= mfp_to_gpio(MFP_PIN_GPIO96),
@@ -140,15 +158,6 @@ static void __init colibri_pxa320_init_udc(void)
 static inline void colibri_pxa320_init_udc(void) {}
 #endif
 
-static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
-	GPIO22_MMC1_CLK,
-	GPIO23_MMC1_CMD,
-	GPIO18_MMC1_DAT0,
-	GPIO19_MMC1_DAT1,
-	GPIO20_MMC1_DAT2,
-	GPIO21_MMC1_DAT3
-};
-
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
 static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
 	GPIO6_2_LCD_LDD_0,
@@ -205,53 +214,18 @@ static inline void __init colibri_pxa320_init_ac97(void)
 static inline void colibri_pxa320_init_ac97(void) {}
 #endif
 
-/*
- * The following configuration is verified to work with the Toradex Orchid
- * carrier board
- */
-static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = {
-	/* UART 1 configuration (may be set by bootloader) */
-	GPIO99_UART1_CTS,
-	GPIO104_UART1_RTS,
-	GPIO97_UART1_RXD,
-	GPIO98_UART1_TXD,
-	GPIO101_UART1_DTR,
-	GPIO103_UART1_DSR,
-	GPIO100_UART1_DCD,
-	GPIO102_UART1_RI,
-
-	/* UART 2 configuration */
-	GPIO109_UART2_CTS,
-	GPIO112_UART2_RTS,
-	GPIO110_UART2_RXD,
-	GPIO111_UART2_TXD,
-
-	/* UART 3 configuration */
-	GPIO30_UART3_RXD,
-	GPIO31_UART3_TXD,
-};
-
-static void __init colibri_pxa320_init_uart(void)
-{
-	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
-}
-
 void __init colibri_pxa320_init(void)
 {
-	pxa_set_ffuart_info(NULL);
-	pxa_set_btuart_info(NULL);
-	pxa_set_stuart_info(NULL);
-
 	colibri_pxa320_init_eth();
-	colibri_pxa320_init_ohci();
 	colibri_pxa3xx_init_nand();
 	colibri_pxa320_init_lcd();
 	colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
 	colibri_pxa320_init_ac97();
-	colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
-				mfp_to_gpio(MFP_PIN_GPIO28));
-	colibri_pxa320_init_uart();
 	colibri_pxa320_init_udc();
+
+	/* Evalboard init */
+	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
+	colibri_pxa270_evalboard_init();
 }
 
 MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 199afa2..96b2d9f 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data)
 }
 #endif
 
-#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
-static int mmc_detect_pin;
-
-static int colibri_pxa3xx_mci_init(struct device *dev,
-				   irq_handler_t colibri_mmc_detect_int,
-				   void *data)
-{
-	int ret;
-
-	ret = gpio_request(mmc_detect_pin, "mmc card detect");
-	if (ret)
-		return ret;
-
-	gpio_direction_input(mmc_detect_pin);
-	ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int,
-			  IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
-			  "MMC card detect", data);
-	if (ret) {
-		gpio_free(mmc_detect_pin);
-		return ret;
-	}
-
-	return 0;
-}
-
-static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
-{
-	free_irq(mmc_detect_pin, data);
-	gpio_free(gpio_to_irq(mmc_detect_pin));
-}
-
-static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
-	.detect_delay_ms	= 200,
-	.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34,
-	.init			= colibri_pxa3xx_mci_init,
-	.exit			= colibri_pxa3xx_mci_exit,
-	.gpio_card_detect	= -1,
-	.gpio_card_ro		= -1,
-	.gpio_power		= -1,
-};
-
-void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
-{
-	pxa3xx_mfp_config(pins, len);
-	mmc_detect_pin = detect_pin;
-	pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data);
-}
-#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
-
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
 static int lcd_bl_pin;
 
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 58dada1..63a948a 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {}
 #define GPIO0_COLIBRI_PXA270_SD_DETECT	0
 #define GPIO113_COLIBRI_PXA270_TS_IRQ	113
 
+/* GPIO definitions for Colibri PXA300/310 */
+#define GPIO39_COLIBRI_PXA300_SD_DETECT	39
+
+/* GPIO definitions for Colibri PXA320 */
+#define GPIO28_COLIBRI_PXA320_SD_DETECT	28
+
 #endif /* _COLIBRI_H_ */
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 05/17] ARM: pxa: Add M41T00 RTC support into Colibri evalboard
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (2 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 04/17] ARM: pxa: Push Colibri evalboard MFP into module files Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 06/17] ARM: pxa: Rename " Marek Vasut
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
---
 arch/arm/mach-pxa/colibri-pxa270-evalboard.c |   23 +++++++++++++++++++++++
 arch/arm/mach-pxa/colibri-pxa270.c           |    4 ++++
 arch/arm/mach-pxa/colibri-pxa300.c           |    4 ++++
 arch/arm/mach-pxa/colibri-pxa320.c           |    4 ++++
 4 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
index e1a2b52..7f27aec 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
@@ -19,6 +19,7 @@
 #include <asm/mach-types.h>
 #include <mach/hardware.h>
 #include <asm/mach/arch.h>
+#include <linux/i2c.h>
 
 #include <mach/pxa27x.h>
 #include <mach/colibri.h>
@@ -26,6 +27,8 @@
 #include <mach/ohci.h>
 #include <mach/pxa27x-udc.h>
 
+#include <plat/i2c.h>
+
 #include "generic.h"
 #include "devices.h"
 
@@ -87,6 +90,25 @@ static void __init colibri_pxa270_uhc_init(void)
 static inline void colibri_pxa270_uhc_init(void) {}
 #endif
 
+/******************************************************************************
+ * I2C RTC
+ ******************************************************************************/
+#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
+static struct i2c_board_info __initdata colibri_pxa270_i2c_devs[] = {
+	{
+		I2C_BOARD_INFO("m41t00", 0x68),
+	},
+};
+
+static void __init colibri_pxa270_rtc_init(void)
+{
+	pxa_set_i2c_info(NULL);
+	i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_pxa270_i2c_devs));
+}
+#else
+static inline void colibri_pxa270_rtc_init(void) {}
+#endif
+
 void __init colibri_pxa270_evalboard_init(void)
 {
 	pxa_set_ffuart_info(NULL);
@@ -95,4 +117,5 @@ void __init colibri_pxa270_evalboard_init(void)
 
 	colibri_pxa270_mmc_init();
 	colibri_pxa270_uhc_init();
+	colibri_pxa270_rtc_init();
 }
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index e940004..eecbb8b 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -73,6 +73,10 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
 	GPIO1_GPIO,	/* READY */
 	GPIO84_GPIO,	/* DETECT */
 	GPIO107_GPIO,	/* PPEN */
+
+	/* I2C */
+	GPIO117_I2C_SCL,
+	GPIO118_I2C_SDA,
 };
 #else
 static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {};
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 649c83c..9b8d72d 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -46,6 +46,10 @@ static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
 	/* UHC */
 	GPIO0_2_USBH_PEN,
 	GPIO1_2_USBH_PWR,
+
+	/* I2C */
+	GPIO21_I2C_SCL,
+	GPIO22_I2C_SDA,
 };
 #else
 static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {};
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 6f15f2a..0d8faf8 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -69,6 +69,10 @@ static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
 	/* UHC */
 	GPIO2_2_USBH_PEN,
 	GPIO3_2_USBH_PWR,
+
+	/* I2C */
+	GPIO32_I2C_SCL,
+	GPIO33_I2C_SDA,
 };
 #else
 static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 06/17] ARM: pxa: Rename Colibri evalboard
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (3 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 05/17] ARM: pxa: Add M41T00 RTC support into Colibri evalboard Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-03 14:53   ` Eric Miao
  2010-11-02 23:51 ` [PATCH 07/17] ARM: pxa: Colibri PXA320 PCMCIA driver Marek Vasut
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Rename colibri-pxa270-evalboard to colibri-evalboard as this board is used with
all Colibri modules.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
---
 arch/arm/mach-pxa/Kconfig                    |    2 +-
 arch/arm/mach-pxa/Makefile                   |    2 +-
 arch/arm/mach-pxa/colibri-evalboard.c        |  121 ++++++++++++++++++++++++++
 arch/arm/mach-pxa/colibri-pxa270-evalboard.c |  121 --------------------------
 arch/arm/mach-pxa/colibri-pxa270.c           |    6 +-
 arch/arm/mach-pxa/colibri-pxa300.c           |    4 +-
 arch/arm/mach-pxa/colibri-pxa320.c           |    4 +-
 arch/arm/mach-pxa/include/mach/colibri.h     |    8 +-
 8 files changed, 134 insertions(+), 134 deletions(-)
 create mode 100644 arch/arm/mach-pxa/colibri-evalboard.c
 delete mode 100644 arch/arm/mach-pxa/colibri-pxa270-evalboard.c

diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index b44d613..e0ac5aa 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -249,7 +249,7 @@ config MACH_COLIBRI320
 	select PXA3xx
 	select CPU_PXA320
 
-config MACH_COLIBRI_PXA270_EVALBOARD
+config MACH_COLIBRI_EVALBOARD
 	bool "Toradex Colibri Evaluation Carrier Board support"
 	depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
 
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index e2f89c2..3197756 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -60,7 +60,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270)	+= lpd270.o
 obj-$(CONFIG_MACH_PCM027)		+= pcm027.o
 obj-$(CONFIG_MACH_PCM990_BASEBOARD)	+= pcm990-baseboard.o
 obj-$(CONFIG_MACH_COLIBRI)			+= colibri-pxa270.o
-obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD)	+= colibri-pxa270-evalboard.o
+obj-$(CONFIG_MACH_COLIBRI_EVALBOARD)	+= colibri-evalboard.o
 obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME)	+= colibri-pxa270-income.o
 obj-$(CONFIG_MACH_COLIBRI300)	+= colibri-pxa3xx.o colibri-pxa300.o
 obj-$(CONFIG_MACH_COLIBRI320)	+= colibri-pxa3xx.o colibri-pxa320.o
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
new file mode 100644
index 0000000..6b2c800
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -0,0 +1,121 @@
+/*
+ *  linux/arch/arm/mach-pxa/colibri-evalboard.c
+ *
+ *  Support for Toradex Colibri Evaluation Carrier Board
+ *  Daniel Mack <daniel@caiaq.de>
+ *  Marek Vasut <marek.vasut@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/sysdev.h>
+#include <linux/interrupt.h>
+#include <linux/gpio.h>
+#include <asm/mach-types.h>
+#include <mach/hardware.h>
+#include <asm/mach/arch.h>
+#include <linux/i2c.h>
+
+#include <mach/pxa27x.h>
+#include <mach/colibri.h>
+#include <mach/mmc.h>
+#include <mach/ohci.h>
+#include <mach/pxa27x-udc.h>
+
+#include <plat/i2c.h>
+
+#include "generic.h"
+#include "devices.h"
+
+/******************************************************************************
+ * SD/MMC card controller
+ ******************************************************************************/
+#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
+static struct pxamci_platform_data colibri_mci_platform_data = {
+	.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34,
+	.gpio_power		= -1,
+	.gpio_card_ro		= -1,
+	.detect_delay_ms	= 200,
+};
+
+static void __init colibri_mmc_init(void)
+{
+	if (machine_is_colibri())	/* PXA270 Colibri */
+		colibri_mci_platform_data.gpio_card_detect =
+			GPIO0_COLIBRI_PXA270_SD_DETECT;
+	if (machine_is_colibri300())	/* PXA300 Colibri */
+		colibri_mci_platform_data.gpio_card_detect =
+			GPIO39_COLIBRI_PXA300_SD_DETECT;
+	else				/* PXA320 Colibri */
+		colibri_mci_platform_data.gpio_card_detect =
+			GPIO28_COLIBRI_PXA320_SD_DETECT;
+
+	pxa_set_mci_info(&colibri_mci_platform_data);
+}
+#else
+static inline void colibri_mmc_init(void) {}
+#endif
+
+/******************************************************************************
+ * USB Host
+ ******************************************************************************/
+#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static int colibri_ohci_init(struct device *dev)
+{
+	UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
+	return 0;
+}
+
+static struct pxaohci_platform_data colibri_ohci_info = {
+	.port_mode	= PMM_PERPORT_MODE,
+	.flags		= ENABLE_PORT1 |
+			  POWER_CONTROL_LOW | POWER_SENSE_LOW,
+	.init		= colibri_ohci_init,
+};
+
+static void __init colibri_uhc_init(void)
+{
+	/* Colibri PXA270 has two usb ports, TBA for 320 */
+	if (machine_is_colibri())
+		colibri_ohci_info.flags	|= ENABLE_PORT2;
+
+	pxa_set_ohci_info(&colibri_ohci_info);
+}
+#else
+static inline void colibri_uhc_init(void) {}
+#endif
+
+/******************************************************************************
+ * I2C RTC
+ ******************************************************************************/
+#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
+static struct i2c_board_info __initdata colibri_i2c_devs[] = {
+	{
+		I2C_BOARD_INFO("m41t00", 0x68),
+	},
+};
+
+static void __init colibri_rtc_init(void)
+{
+	pxa_set_i2c_info(NULL);
+	i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs));
+}
+#else
+static inline void colibri_rtc_init(void) {}
+#endif
+
+void __init colibri_evalboard_init(void)
+{
+	pxa_set_ffuart_info(NULL);
+	pxa_set_btuart_info(NULL);
+	pxa_set_stuart_info(NULL);
+
+	colibri_mmc_init();
+	colibri_uhc_init();
+	colibri_rtc_init();
+}
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
deleted file mode 100644
index 7f27aec..0000000
--- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *  linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
- *
- *  Support for Toradex PXA270 based Colibri Evaluation Carrier Board
- *  Daniel Mack <daniel@caiaq.de>
- *  Marek Vasut <marek.vasut@gmail.com>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- */
-
-#include <linux/init.h>
-#include <linux/kernel.h>
-#include <linux/platform_device.h>
-#include <linux/sysdev.h>
-#include <linux/interrupt.h>
-#include <linux/gpio.h>
-#include <asm/mach-types.h>
-#include <mach/hardware.h>
-#include <asm/mach/arch.h>
-#include <linux/i2c.h>
-
-#include <mach/pxa27x.h>
-#include <mach/colibri.h>
-#include <mach/mmc.h>
-#include <mach/ohci.h>
-#include <mach/pxa27x-udc.h>
-
-#include <plat/i2c.h>
-
-#include "generic.h"
-#include "devices.h"
-
-/******************************************************************************
- * SD/MMC card controller
- ******************************************************************************/
-#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
-static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
-	.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34,
-	.gpio_power		= -1,
-	.gpio_card_ro		= -1,
-	.detect_delay_ms	= 200,
-};
-
-static void __init colibri_pxa270_mmc_init(void)
-{
-	if (machine_is_colibri())	/* PXA270 Colibri */
-		colibri_pxa270_mci_platform_data.gpio_card_detect =
-			GPIO0_COLIBRI_PXA270_SD_DETECT;
-	if (machine_is_colibri300())	/* PXA300 Colibri */
-		colibri_pxa270_mci_platform_data.gpio_card_detect =
-			GPIO39_COLIBRI_PXA300_SD_DETECT;
-	else				/* PXA320 Colibri */
-		colibri_pxa270_mci_platform_data.gpio_card_detect =
-			GPIO28_COLIBRI_PXA320_SD_DETECT;
-
-	pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
-}
-#else
-static inline void colibri_pxa270_mmc_init(void) {}
-#endif
-
-/******************************************************************************
- * USB Host
- ******************************************************************************/
-#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
-static int colibri_pxa270_ohci_init(struct device *dev)
-{
-	UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
-	return 0;
-}
-
-static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
-	.port_mode	= PMM_PERPORT_MODE,
-	.flags		= ENABLE_PORT1 |
-			  POWER_CONTROL_LOW | POWER_SENSE_LOW,
-	.init		= colibri_pxa270_ohci_init,
-};
-
-static void __init colibri_pxa270_uhc_init(void)
-{
-	/* Colibri PXA270 has two usb ports, TBA for 320 */
-	if (machine_is_colibri())
-		colibri_pxa270_ohci_info.flags	|= ENABLE_PORT2;
-
-	pxa_set_ohci_info(&colibri_pxa270_ohci_info);
-}
-#else
-static inline void colibri_pxa270_uhc_init(void) {}
-#endif
-
-/******************************************************************************
- * I2C RTC
- ******************************************************************************/
-#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
-static struct i2c_board_info __initdata colibri_pxa270_i2c_devs[] = {
-	{
-		I2C_BOARD_INFO("m41t00", 0x68),
-	},
-};
-
-static void __init colibri_pxa270_rtc_init(void)
-{
-	pxa_set_i2c_info(NULL);
-	i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_pxa270_i2c_devs));
-}
-#else
-static inline void colibri_pxa270_rtc_init(void) {}
-#endif
-
-void __init colibri_pxa270_evalboard_init(void)
-{
-	pxa_set_ffuart_info(NULL);
-	pxa_set_btuart_info(NULL);
-	pxa_set_stuart_info(NULL);
-
-	colibri_pxa270_mmc_init();
-	colibri_pxa270_uhc_init();
-	colibri_pxa270_rtc_init();
-}
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index eecbb8b..6fc5d32 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -35,7 +35,7 @@
 /******************************************************************************
  * Evaluation board MFP
  ******************************************************************************/
-#ifdef	 CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+#ifdef	 CONFIG_MACH_COLIBRI_EVALBOARD
 static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
 	/* MMC */
 	GPIO32_MMC_CLK,
@@ -281,10 +281,10 @@ static void __init colibri_pxa270_init(void)
 	colibri_pxa270_tsc_init();
 
 	switch (colibri_pxa270_baseboard) {
-	case COLIBRI_PXA270_EVALBOARD:
+	case COLIBRI_EVALBOARD:
 		pxa2xx_mfp_config(ARRAY_AND_SIZE(
 			colibri_pxa270_evalboard_pin_config));
-		colibri_pxa270_evalboard_init();
+		colibri_evalboard_init();
 		break;
 	case COLIBRI_PXA270_INCOME:
 		pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index 9b8d72d..b5bb248 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -32,7 +32,7 @@
 #include "devices.h"
 
 
-#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+#ifdef CONFIG_MACH_COLIBRI_EVALBOARD
 static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
 	/* MMC */
 	GPIO7_MMC1_CLK,
@@ -173,7 +173,7 @@ void __init colibri_pxa300_init(void)
 
 	/* Evalboard init */
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
-	colibri_pxa270_evalboard_init();
+	colibri_evalboard_init();
 }
 
 MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 0d8faf8..3d2c944 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -35,7 +35,7 @@
 #include "generic.h"
 #include "devices.h"
 
-#ifdef	CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
+#ifdef	CONFIG_MACH_COLIBRI_EVALBOARD
 static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
 	/* MMC */
 	GPIO22_MMC1_CLK,
@@ -229,7 +229,7 @@ void __init colibri_pxa320_init(void)
 
 	/* Evalboard init */
 	pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
-	colibri_pxa270_evalboard_init();
+	colibri_evalboard_init();
 }
 
 MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 63a948a..388a96f 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -9,14 +9,14 @@
  */
 
 enum {
-	COLIBRI_PXA270_EVALBOARD = 0,
+	COLIBRI_EVALBOARD = 0,
 	COLIBRI_PXA270_INCOME,
 };
 
-#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD)
-extern void colibri_pxa270_evalboard_init(void);
+#if defined(CONFIG_MACH_COLIBRI_EVALBOARD)
+extern void colibri_evalboard_init(void);
 #else
-static inline void colibri_pxa270_evalboard_init(void) {}
+static inline void colibri_evalboard_init(void) {}
 #endif
 
 #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 07/17] ARM: pxa: Colibri PXA320 PCMCIA driver
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (4 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 06/17] ARM: pxa: Rename " Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 08/17] ARM: pxa: Modularize Palm Tungsten|C Marek Vasut
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Daniel Mack <daniel@caiaq.de>
---
 arch/arm/mach-pxa/colibri-pxa320.c |   21 +++++++++++++++++++++
 drivers/pcmcia/Kconfig             |    3 ++-
 drivers/pcmcia/Makefile            |    1 +
 drivers/pcmcia/pxa2xx_colibri.c    |   17 ++++++++++++++++-
 4 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
index 3d2c944..ff9ff5f 100644
--- a/arch/arm/mach-pxa/colibri-pxa320.c
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -73,6 +73,27 @@ static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
 	/* I2C */
 	GPIO32_I2C_SCL,
 	GPIO33_I2C_SDA,
+
+	/* PCMCIA */
+	MFP_CFG(GPIO59, AF7),	/* PRST ; AF7 to tristate */
+	MFP_CFG(GPIO61, AF7),	/* PCE1 ; AF7 to tristate */
+	MFP_CFG(GPIO60, AF7),	/* PCE2 ; AF7 to tristate */
+	MFP_CFG(GPIO62, AF7),	/* PCD ; AF7 to tristate */
+	MFP_CFG(GPIO56, AF7),	/* PSKTSEL ; AF7 to tristate */
+	GPIO27_GPIO,		/* RDnWR ; input/tristate */
+	GPIO50_GPIO,		/* PREG ; input/tristate */
+	GPIO2_RDY,
+	GPIO5_NPIOR,
+	GPIO6_NPIOW,
+	GPIO7_NPIOS16,
+	GPIO8_NPWAIT,
+	GPIO29_GPIO,		/* PRDY (READY GPIO) */
+	GPIO57_GPIO,		/* PPEN (POWER GPIO) */
+	GPIO81_GPIO,		/* PCD (DETECT GPIO) */
+	GPIO77_GPIO,		/* PRST (RESET GPIO) */
+	GPIO53_GPIO,		/* PBVD1 */
+	GPIO79_GPIO,		/* PBVD2 */
+	GPIO54_GPIO,		/* POE */
 };
 #else
 static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
index e9acf03..de886f3 100644
--- a/drivers/pcmcia/Kconfig
+++ b/drivers/pcmcia/Kconfig
@@ -215,7 +215,8 @@ config PCMCIA_PXA2XX
 	depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
 		    || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \
 		    || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \
-		    || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI)
+		    || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \
+		    || MACH_COLIBRI320)
 	select PCMCIA_SOC_COMMON
 	help
 	  Say Y here to include support for the PXA2xx PCMCIA controller
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
index 2fee7ef..9a44a90 100644
--- a/drivers/pcmcia/Makefile
+++ b/drivers/pcmcia/Makefile
@@ -71,6 +71,7 @@ pxa2xx-obj-$(CONFIG_MACH_STARGATE2)		+= pxa2xx_stargate2.o
 pxa2xx-obj-$(CONFIG_MACH_VPAC270)		+= pxa2xx_vpac270.o
 pxa2xx-obj-$(CONFIG_MACH_BALLOON3)		+= pxa2xx_balloon3.o
 pxa2xx-obj-$(CONFIG_MACH_COLIBRI)		+= pxa2xx_colibri.o
+pxa2xx-obj-$(CONFIG_MACH_COLIBRI320)		+= pxa2xx_colibri.o
 
 obj-$(CONFIG_PCMCIA_PXA2XX)			+= pxa2xx_base.o $(pxa2xx-obj-y)
 
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
index 4ed876c..c3f7219 100644
--- a/drivers/pcmcia/pxa2xx_colibri.c
+++ b/drivers/pcmcia/pxa2xx_colibri.c
@@ -27,6 +27,13 @@
 #define	COLIBRI270_DETECT_GPIO	84
 #define	COLIBRI270_READY_GPIO	1
 
+#define	COLIBRI320_RESET_GPIO	77
+#define	COLIBRI320_PPEN_GPIO	57
+#define	COLIBRI320_BVD1_GPIO	53
+#define	COLIBRI320_BVD2_GPIO	79
+#define	COLIBRI320_DETECT_GPIO	81
+#define	COLIBRI320_READY_GPIO	29
+
 static struct {
 	int	reset_gpio;
 	int	ppen_gpio;
@@ -186,6 +193,14 @@ static int __init colibri_pcmcia_init(void)
 		colibri_pcmcia_gpio.bvd2_gpio	= COLIBRI270_BVD2_GPIO;
 		colibri_pcmcia_gpio.detect_gpio	= COLIBRI270_DETECT_GPIO;
 		colibri_pcmcia_gpio.ready_gpio	= COLIBRI270_READY_GPIO;
+	/* Colibri PXA320 */
+	} else if (machine_is_colibri320()) {
+		colibri_pcmcia_gpio.reset_gpio	= COLIBRI320_RESET_GPIO;
+		colibri_pcmcia_gpio.ppen_gpio	= COLIBRI320_PPEN_GPIO;
+		colibri_pcmcia_gpio.bvd1_gpio	= COLIBRI320_BVD1_GPIO;
+		colibri_pcmcia_gpio.bvd2_gpio	= COLIBRI320_BVD2_GPIO;
+		colibri_pcmcia_gpio.detect_gpio	= COLIBRI320_DETECT_GPIO;
+		colibri_pcmcia_gpio.ready_gpio	= COLIBRI320_READY_GPIO;
 	}
 
 	ret = platform_device_add_data(colibri_pcmcia_device,
@@ -209,6 +224,6 @@ module_init(colibri_pcmcia_init);
 module_exit(colibri_pcmcia_exit);
 
 MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
-MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270");
+MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270/PXA320");
 MODULE_ALIAS("platform:pxa2xx-pcmcia");
 MODULE_LICENSE("GPL");
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 08/17] ARM: pxa: Modularize Palm Tungsten|C
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (5 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 07/17] ARM: pxa: Colibri PXA320 PCMCIA driver Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/palmtc.c |  147 ++++++++++++++++++++++++++++++++++---------
 1 files changed, 116 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index b8cda11..73de8c5 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -25,6 +25,7 @@
 #include <linux/power_supply.h>
 #include <linux/gpio_keys.h>
 #include <linux/mtd/physmap.h>
+#include <linux/usb/gpio_vbus.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -116,6 +117,7 @@ static unsigned long palmtc_pin_config[] __initdata = {
 /******************************************************************************
  * SD/MMC card controller
  ******************************************************************************/
+#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
 static struct pxamci_platform_data palmtc_mci_platform_data = {
 	.ocr_mask		= MMC_VDD_32_33 | MMC_VDD_33_34,
 	.gpio_power		= GPIO_NR_PALMTC_SD_POWER,
@@ -124,9 +126,18 @@ static struct pxamci_platform_data palmtc_mci_platform_data = {
 	.detect_delay_ms	= 200,
 };
 
+static void __init palmtc_mmc_init(void)
+{
+	pxa_set_mci_info(&palmtc_mci_platform_data);
+}
+#else
+static inline void palmtc_mmc_init(void) {}
+#endif
+
 /******************************************************************************
  * GPIO keys
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 static struct gpio_keys_button palmtc_pxa_buttons[] = {
 	{KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1},
 };
@@ -144,9 +155,18 @@ static struct platform_device palmtc_pxa_keys = {
 	},
 };
 
+static void __init palmtc_keys_init(void)
+{
+	platform_device_register(&palmtc_pxa_keys);
+}
+#else
+static inline void palmtc_keys_init(void) {}
+#endif
+
 /******************************************************************************
  * Backlight
  ******************************************************************************/
+#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE)
 static int palmtc_backlight_init(struct device *dev)
 {
 	int ret;
@@ -196,17 +216,35 @@ static struct platform_device palmtc_backlight = {
 	},
 };
 
+static void __init palmtc_pwm_init(void)
+{
+	platform_device_register(&palmtc_backlight);
+}
+#else
+static inline void palmtc_pwm_init(void) {}
+#endif
+
 /******************************************************************************
  * IrDA
  ******************************************************************************/
+#if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE)
 static struct pxaficp_platform_data palmtc_ficp_platform_data = {
 	.gpio_pwdown		= GPIO_NR_PALMTC_IR_DISABLE,
 	.transceiver_cap	= IR_SIRMODE | IR_OFF,
 };
 
+static void __init palmtc_irda_init(void)
+{
+	pxa_set_ficp_info(&palmtc_ficp_platform_data);
+}
+#else
+static inline void palmtc_irda_init(void) {}
+#endif
+
 /******************************************************************************
  * Keyboard
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE)
 static const uint32_t palmtc_matrix_keys[] = {
 	KEY(0, 0, KEY_F1),
 	KEY(0, 1, KEY_X),
@@ -290,27 +328,63 @@ static struct platform_device palmtc_keyboard = {
 		.platform_data = &palmtc_keypad_platform_data,
 	},
 };
+static void __init palmtc_mkp_init(void)
+{
+	platform_device_register(&palmtc_keyboard);
+}
+#else
+static inline void palmtc_mkp_init(void) {}
+#endif
 
 /******************************************************************************
  * UDC
  ******************************************************************************/
-static struct pxa2xx_udc_mach_info palmtc_udc_info __initdata = {
+#if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE)
+static struct gpio_vbus_mach_info palmtc_udc_info = {
 	.gpio_vbus		= GPIO_NR_PALMTC_USB_DETECT_N,
 	.gpio_vbus_inverted	= 1,
 	.gpio_pullup		= GPIO_NR_PALMTC_USB_POWER,
 };
 
+static struct platform_device palmtc_gpio_vbus = {
+	.name	= "gpio-vbus",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &palmtc_udc_info,
+	},
+};
+
+static void __init palmtc_udc_init(void)
+{
+	platform_device_register(&palmtc_gpio_vbus);
+};
+#else
+static inline void palmtc_udc_init(void) {}
+#endif
+
 /******************************************************************************
  * Touchscreen / Battery / GPIO-extender
  ******************************************************************************/
-static struct platform_device palmtc_ucb1400_core = {
+#if	defined(CONFIG_TOUCHSCREEN_UCB1400) || \
+	defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
+static struct platform_device palmtc_ucb1400_device = {
 	.name	= "ucb1400_core",
 	.id	= -1,
 };
 
+static void __init palmtc_ts_init(void)
+{
+	pxa_set_ac97_info(NULL);
+	platform_device_register(&palmtc_ucb1400_device);
+}
+#else
+static inline void palmtc_ts_init(void) {}
+#endif
+
 /******************************************************************************
  * NOR Flash
  ******************************************************************************/
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct resource palmtc_flash_resource = {
 	.start	= PXA_CS0_PHYS,
 	.end	= PXA_CS0_PHYS + SZ_16M - 1,
@@ -356,24 +430,33 @@ static struct platform_device palmtc_flash = {
 	},
 };
 
+static void __init palmtc_nor_init(void)
+{
+	platform_device_register(&palmtc_flash);
+}
+#else
+static inline void palmtc_nor_init(void) {}
+#endif
+
 /******************************************************************************
  * Framebuffer
  ******************************************************************************/
+#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
 static struct pxafb_mode_info palmtc_lcd_modes[] = {
-{
-	.pixclock	= 115384,
-	.xres		= 320,
-	.yres		= 320,
-	.bpp		= 16,
-
-	.left_margin	= 27,
-	.right_margin	= 7,
-	.upper_margin	= 7,
-	.lower_margin	= 8,
-
-	.hsync_len	= 6,
-	.vsync_len	= 1,
-},
+	{
+		.pixclock	= 115384,
+		.xres		= 320,
+		.yres		= 320,
+		.bpp		= 16,
+
+		.left_margin	= 27,
+		.right_margin	= 7,
+		.upper_margin	= 7,
+		.lower_margin	= 8,
+
+		.hsync_len	= 6,
+		.vsync_len	= 1,
+	},
 };
 
 static struct pxafb_mach_info palmtc_lcd_screen = {
@@ -382,17 +465,17 @@ static struct pxafb_mach_info palmtc_lcd_screen = {
 	.lcd_conn		= LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
 };
 
+static void __init palmtc_lcd_init(void)
+{
+	set_pxa_fb_info(&palmtc_lcd_screen);
+}
+#else
+static inline void palmtc_lcd_init(void) {}
+#endif
+
 /******************************************************************************
  * Machine init
  ******************************************************************************/
-static struct platform_device *devices[] __initdata = {
-	&palmtc_backlight,
-	&palmtc_ucb1400_core,
-	&palmtc_keyboard,
-	&palmtc_pxa_keys,
-	&palmtc_flash,
-};
-
 static void __init palmtc_init(void)
 {
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config));
@@ -402,13 +485,15 @@ static void __init palmtc_init(void)
 	pxa_set_stuart_info(NULL);
 	pxa_set_hwuart_info(NULL);
 
-	set_pxa_fb_info(&palmtc_lcd_screen);
-	pxa_set_mci_info(&palmtc_mci_platform_data);
-	pxa_set_udc_info(&palmtc_udc_info);
-	pxa_set_ac97_info(NULL);
-	pxa_set_ficp_info(&palmtc_ficp_platform_data);
-
-	platform_add_devices(devices, ARRAY_SIZE(devices));
+	palmtc_mmc_init();
+	palmtc_keys_init();
+	palmtc_pwm_init();
+	palmtc_irda_init();
+	palmtc_mkp_init();
+	palmtc_udc_init();
+	palmtc_ts_init();
+	palmtc_nor_init();
+	palmtc_lcd_init();
 };
 
 MACHINE_START(PALMTC, "Palm Tungsten|C")
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (6 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 08/17] ARM: pxa: Modularize Palm Tungsten|C Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-12-01  2:51   ` Eric Miao
  2010-11-02 23:51 ` [PATCH 10/17] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270 Marek Vasut
                   ` (8 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/gpio/ucb1400_gpio.c |   19 ++++++-------------
 drivers/mfd/ucb1400_core.c  |    5 +++++
 include/linux/ucb1400.h     |   19 ++++++-------------
 3 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/drivers/gpio/ucb1400_gpio.c b/drivers/gpio/ucb1400_gpio.c
index 50e6bd1..fba45a5 100644
--- a/drivers/gpio/ucb1400_gpio.c
+++ b/drivers/gpio/ucb1400_gpio.c
@@ -12,8 +12,6 @@
 #include <linux/module.h>
 #include <linux/ucb1400.h>
 
-struct ucb1400_gpio_data *ucbdata;
-
 static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off)
 {
 	struct ucb1400_gpio *gpio;
@@ -50,7 +48,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
 	struct ucb1400_gpio *ucb = dev->dev.platform_data;
 	int err = 0;
 
-	if (!(ucbdata && ucbdata->gpio_offset)) {
+	if (!(ucb && ucb->gpio_offset)) {
 		err = -EINVAL;
 		goto err;
 	}
@@ -58,7 +56,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
 	platform_set_drvdata(dev, ucb);
 
 	ucb->gc.label = "ucb1400_gpio";
-	ucb->gc.base = ucbdata->gpio_offset;
+	ucb->gc.base = ucb->gpio_offset;
 	ucb->gc.ngpio = 10;
 	ucb->gc.owner = THIS_MODULE;
 
@@ -72,8 +70,8 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
 	if (err)
 		goto err;
 
-	if (ucbdata && ucbdata->gpio_setup)
-		err = ucbdata->gpio_setup(&dev->dev, ucb->gc.ngpio);
+	if (ucb && ucb->gpio_setup)
+		err = ucb->gpio_setup(&dev->dev, ucb->gc.ngpio);
 
 err:
 	return err;
@@ -85,8 +83,8 @@ static int ucb1400_gpio_remove(struct platform_device *dev)
 	int err = 0;
 	struct ucb1400_gpio *ucb = platform_get_drvdata(dev);
 
-	if (ucbdata && ucbdata->gpio_teardown) {
-		err = ucbdata->gpio_teardown(&dev->dev, ucb->gc.ngpio);
+	if (ucb && ucb->gpio_teardown) {
+		err = ucb->gpio_teardown(&dev->dev, ucb->gc.ngpio);
 		if (err)
 			return err;
 	}
@@ -113,11 +111,6 @@ static void __exit ucb1400_gpio_exit(void)
 	platform_driver_unregister(&ucb1400_gpio_driver);
 }
 
-void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data)
-{
-	ucbdata = data;
-}
-
 module_init(ucb1400_gpio_init);
 module_exit(ucb1400_gpio_exit);
 
diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
index d73f84b..63f4969 100644
--- a/drivers/mfd/ucb1400_core.c
+++ b/drivers/mfd/ucb1400_core.c
@@ -75,6 +75,11 @@ static int ucb1400_core_probe(struct device *dev)
 
 	/* GPIO */
 	ucb_gpio.ac97 = ac97;
+	if (pdata) {
+		ucb_gpio.gpio_setup = pdata->gpio_setup;
+		ucb_gpio.gpio_teardown = pdata->gpio_teardown;
+		ucb_gpio.gpio_offset = pdata->gpio_offset;
+	}
 	ucb->ucb1400_gpio = platform_device_alloc("ucb1400_gpio", -1);
 	if (!ucb->ucb1400_gpio) {
 		err = -ENOMEM;
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
index 1b47909..1a6bfdd 100644
--- a/include/linux/ucb1400.h
+++ b/include/linux/ucb1400.h
@@ -83,15 +83,12 @@
 #define UCB_ID			0x7e
 #define UCB_ID_1400             0x4304
 
-struct ucb1400_gpio_data {
-	int gpio_offset;
-	int (*gpio_setup)(struct device *dev, int ngpio);
-	int (*gpio_teardown)(struct device *dev, int ngpio);
-};
-
 struct ucb1400_gpio {
 	struct gpio_chip	gc;
 	struct snd_ac97		*ac97;
+	int			gpio_offset;
+	int (*gpio_setup)(struct device *dev, int ngpio);
+	int (*gpio_teardown)(struct device *dev, int ngpio);
 };
 
 struct ucb1400_ts {
@@ -112,6 +109,9 @@ struct ucb1400 {
 
 struct ucb1400_pdata {
 	int	irq;
+	int	gpio_offset;
+	int (*gpio_setup)(struct device *dev, int ngpio);
+	int (*gpio_teardown)(struct device *dev, int ngpio);
 };
 
 static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
@@ -163,11 +163,4 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)
 
 unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
 			      int adcsync);
-
-#ifdef CONFIG_GPIO_UCB1400
-void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data);
-#else
-static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {}
-#endif
-
 #endif
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 10/17] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (7 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-12-14 14:07   ` Eric Miao
  2010-11-02 23:51 ` [PATCH 11/17] ARM: pxa: Pass GPIO offset to ucb1400-gpio on PalmTC Marek Vasut
                   ` (7 subsequent siblings)
  16 siblings, 1 reply; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/vpac270.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index b9b5797..5e206fd 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -430,20 +430,18 @@ static inline void vpac270_eth_init(void) {}
  ******************************************************************************/
 #if	defined(CONFIG_TOUCHSCREEN_UCB1400) || \
 	defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
-static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
-	.reset_gpio	= 95,
-};
-
 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
 	.irq		= IRQ_GPIO(GPIO113_VPAC270_TS_IRQ),
 };
 
+static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
+	.reset_gpio	= 95,
+	.codec_pdata	= { &vpac270_ucb1400_pdata, },
+};
+
 static struct platform_device vpac270_ucb1400_device = {
 	.name		= "ucb1400_core",
 	.id		= -1,
-	.dev		= {
-		.platform_data = &vpac270_ucb1400_pdata,
-	},
 };
 
 static void __init vpac270_ts_init(void)
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 11/17] ARM: pxa: Pass GPIO offset to ucb1400-gpio on PalmTC
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (8 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 10/17] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270 Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 12/17] ARM: pxa: Add gpio-leds and vibrator support to PalmTC Marek Vasut
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/palmtc.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index 73de8c5..d83eee4 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -367,6 +367,14 @@ static inline void palmtc_udc_init(void) {}
  ******************************************************************************/
 #if	defined(CONFIG_TOUCHSCREEN_UCB1400) || \
 	defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
+static struct ucb1400_pdata palmtc_ucb1400_pdata = {
+	.gpio_offset	= PALMTC_UCB1400_GPIO_OFFSET,
+};
+
+static pxa2xx_audio_ops_t palmtc_ac97_pdata = {
+	.codec_pdata	= { &palmtc_ucb1400_pdata, },
+};
+
 static struct platform_device palmtc_ucb1400_device = {
 	.name	= "ucb1400_core",
 	.id	= -1,
@@ -374,7 +382,7 @@ static struct platform_device palmtc_ucb1400_device = {
 
 static void __init palmtc_ts_init(void)
 {
-	pxa_set_ac97_info(NULL);
+	pxa_set_ac97_info(&palmtc_ac97_pdata);
 	platform_device_register(&palmtc_ucb1400_device);
 }
 #else
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 12/17] ARM: pxa: Add gpio-leds and vibrator support to PalmTC
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (9 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 11/17] ARM: pxa: Pass GPIO offset to ucb1400-gpio on PalmTC Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 13/17] ARM: pxa: Fix pxa2xx-flash section mismatch Marek Vasut
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
---
 arch/arm/mach-pxa/palmtc.c |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c
index d83eee4..fdc5ba6 100644
--- a/arch/arm/mach-pxa/palmtc.c
+++ b/arch/arm/mach-pxa/palmtc.c
@@ -390,6 +390,46 @@ static inline void palmtc_ts_init(void) {}
 #endif
 
 /******************************************************************************
+ * LEDs
+ ******************************************************************************/
+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
+struct gpio_led palmtc_gpio_leds[] = {
+{
+	.name			= "palmtc:green:user",
+	.default_trigger	= "none",
+	.gpio			= GPIO_NR_PALMTC_LED_POWER,
+	.active_low		= 1,
+}, {
+	.name			= "palmtc:vibra:vibra",
+	.default_trigger	= "none",
+	.gpio			= GPIO_NR_PALMTC_VIBRA_POWER,
+	.active_low		= 1,
+}
+
+};
+
+static struct gpio_led_platform_data palmtc_gpio_led_info = {
+	.leds		= palmtc_gpio_leds,
+	.num_leds	= ARRAY_SIZE(palmtc_gpio_leds),
+};
+
+static struct platform_device palmtc_leds = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &palmtc_gpio_led_info,
+	}
+};
+
+static void __init palmtc_leds_init(void)
+{
+	platform_device_register(&palmtc_leds);
+}
+#else
+static inline void palmtc_leds_init(void) {}
+#endif
+
+/******************************************************************************
  * NOR Flash
  ******************************************************************************/
 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
@@ -502,6 +542,7 @@ static void __init palmtc_init(void)
 	palmtc_ts_init();
 	palmtc_nor_init();
 	palmtc_lcd_init();
+	palmtc_leds_init();
 };
 
 MACHINE_START(PALMTC, "Palm Tungsten|C")
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 13/17] ARM: pxa: Fix pxa2xx-flash section mismatch
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (10 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 12/17] ARM: pxa: Add gpio-leds and vibrator support to PalmTC Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 14/17] ARM: pxa: Fix number of IRQs on Balloon3 Marek Vasut
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
---
 drivers/mtd/maps/pxa2xx-flash.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index dd90880..d8ae634 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -51,7 +51,7 @@ struct pxa2xx_flash_info {
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 
-static int __init pxa2xx_flash_probe(struct platform_device *pdev)
+static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
 {
 	struct flash_platform_data *flash = pdev->dev.platform_data;
 	struct pxa2xx_flash_info *info;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 14/17] ARM: pxa: Fix number of IRQs on Balloon3
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (11 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 13/17] ARM: pxa: Fix pxa2xx-flash section mismatch Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 15/17] ARM: pxa: Update Balloon3 for new FPGA firmware Marek Vasut
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/include/mach/balloon3.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index 561562b..3506da1 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -174,7 +174,7 @@ enum balloon3_features {
 #define BALLOON3_CODEC_IRQ	IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ)
 #define BALLOON3_S0_CD_IRQ	IRQ_GPIO(BALLOON3_GPIO_S0_CD)
 
-#define BALLOON3_NR_IRQS	(IRQ_BOARD_START + 4)
+#define BALLOON3_NR_IRQS	(IRQ_BOARD_START + 16)
 
 extern int balloon3_has(enum balloon3_features feature);
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 15/17] ARM: pxa: Update Balloon3 for new FPGA firmware
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (12 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 14/17] ARM: pxa: Fix number of IRQs on Balloon3 Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 16/17] SND: Tosa: Fix pointer to codec location Marek Vasut
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

The new FPGA firmware in Balloon3 uses different methods to control it's bus
control lines. In the new version, there are separate registers to set/clear
bus control lines. This patch updates affected places.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/balloon3.c              |   51 ++++++++++++++++------------
 arch/arm/mach-pxa/include/mach/balloon3.h |    2 +
 drivers/pcmcia/pxa2xx_balloon3.c          |   11 +++---
 3 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index adb8e9f..d4649c0 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -567,27 +567,29 @@ static inline void balloon3_i2c_init(void) {}
  * NAND
  ******************************************************************************/
 #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
-static uint16_t balloon3_ctl =
-	BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
-	BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 |
-	BALLOON3_NAND_CONTROL_FLWP;
-
 static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 {
 	struct nand_chip *this = mtd->priv;
+	uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0;
 
 	if (ctrl & NAND_CTRL_CHANGE) {
 		if (ctrl & NAND_CLE)
-			balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCLE;
+			balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLCLE;
 		else
-			balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLCLE;
+			balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLCLE;
 
 		if (ctrl & NAND_ALE)
-			balloon3_ctl |= BALLOON3_NAND_CONTROL_FLALE;
+			balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLALE;
 		else
-			balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLALE;
-
-		__raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG);
+			balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLALE;
+
+		if (balloon3_ctl_clr)
+			__raw_writel(balloon3_ctl_clr,
+				BALLOON3_NAND_CONTROL_REG);
+		if (balloon3_ctl_set)
+			__raw_writel(balloon3_ctl_set,
+				BALLOON3_NAND_CONTROL_REG |
+				BALLOON3_FPGA_SETnCLR);
 	}
 
 	if (cmd != NAND_CMD_NONE)
@@ -599,15 +601,15 @@ static void balloon3_nand_select_chip(struct mtd_info *mtd, int chip)
 	if (chip < 0 || chip > 3)
 		return;
 
-	balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCE0 |
-			BALLOON3_NAND_CONTROL_FLCE1 |
-			BALLOON3_NAND_CONTROL_FLCE2 |
-			BALLOON3_NAND_CONTROL_FLCE3;
+	/* Assert all nCE lines */
+	__raw_writew(
+		BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
+		BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3,
+		BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR);
 
 	/* Deassert correct nCE line */
-	balloon3_ctl &= ~(BALLOON3_NAND_CONTROL_FLCE0 << chip);
-
-	__raw_writew(balloon3_ctl, BALLOON3_NAND_CONTROL_REG);
+	__raw_writew(BALLOON3_NAND_CONTROL_FLCE0 << chip,
+		BALLOON3_NAND_CONTROL_REG);
 }
 
 static int balloon3_nand_probe(struct platform_device *pdev)
@@ -616,11 +618,12 @@ static int balloon3_nand_probe(struct platform_device *pdev)
 	uint16_t ver;
 	int ret;
 
-	__raw_writew(BALLOON3_NAND_CONTROL2_16BIT, BALLOON3_NAND_CONTROL2_REG);
+	__raw_writew(BALLOON3_NAND_CONTROL2_16BIT,
+		BALLOON3_NAND_CONTROL2_REG | BALLOON3_FPGA_SETnCLR);
 
 	ver = __raw_readw(BALLOON3_FPGA_VER);
-	if (ver > 0x0201)
-		pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. "
+	if (ver < 0x4f08)
+		pr_warn("The FPGA code, version 0x%04x, is too old. "
 			"NAND support might be broken in this version!", ver);
 
 	/* Power up the NAND chips */
@@ -635,7 +638,11 @@ static int balloon3_nand_probe(struct platform_device *pdev)
 	gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1);
 
 	/* Deassert all nCE lines and write protect line */
-	__raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG);
+	__raw_writel(
+		BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 |
+		BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 |
+		BALLOON3_NAND_CONTROL_FLWP,
+		BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR);
 	return 0;
 
 err2:
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h
index 3506da1..f6c81ea 100644
--- a/arch/arm/mach-pxa/include/mach/balloon3.h
+++ b/arch/arm/mach-pxa/include/mach/balloon3.h
@@ -26,6 +26,8 @@ enum balloon3_features {
 #define BALLOON3_FPGA_VIRT	(0xf1000000)	/* as per balloon2 */
 #define BALLOON3_FPGA_LENGTH	0x01000000
 
+#define	BALLOON3_FPGA_SETnCLR		(0x1000)
+
 /* FPGA / CPLD registers for CF socket */
 #define	BALLOON3_CF_STATUS_REG		(BALLOON3_FPGA_VIRT + 0x00e00008)
 #define	BALLOON3_CF_CONTROL_REG		(BALLOON3_FPGA_VIRT + 0x00e00008)
diff --git a/drivers/pcmcia/pxa2xx_balloon3.c b/drivers/pcmcia/pxa2xx_balloon3.c
index dbbdd00..453c54c 100644
--- a/drivers/pcmcia/pxa2xx_balloon3.c
+++ b/drivers/pcmcia/pxa2xx_balloon3.c
@@ -39,12 +39,10 @@ static struct pcmcia_irqs irqs[] = {
 static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	uint16_t ver;
-	int ret;
-	static void __iomem *fpga_ver;
 
 	ver = __raw_readw(BALLOON3_FPGA_VER);
-	if (ver > 0x0201)
-		pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. "
+	if (ver < 0x4f08)
+		pr_warn("The FPGA code, version 0x%04x, is too old. "
 			"PCMCIA/CF support might be broken in this version!",
 			ver);
 
@@ -97,8 +95,9 @@ static void balloon3_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 static int balloon3_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 				       const socket_state_t *state)
 {
-	__raw_writew((state->flags & SS_RESET) ? BALLOON3_CF_RESET : 0,
-			BALLOON3_CF_CONTROL_REG);
+	__raw_writew(BALLOON3_CF_RESET, BALLOON3_CF_CONTROL_REG |
+			((state->flags & SS_RESET) ?
+			BALLOON3_FPGA_SETnCLR : 0));
 	return 0;
 }
 
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 16/17] SND: Tosa: Fix pointer to codec location
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (13 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 15/17] ARM: pxa: Update Balloon3 for new FPGA firmware Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-02 23:51 ` [PATCH 17/17] ARM: pxa/colibri: setup pins for USB host port 3 Marek Vasut
  2010-11-03 13:33 ` [PATCH 01/17] ARM: pxa: Fix missing includes Eric Miao
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 sound/soc/pxa/tosa.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index a3bfb2e..73d0edd 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -79,7 +79,7 @@ static void tosa_ext_control(struct snd_soc_codec *codec)
 static int tosa_startup(struct snd_pcm_substream *substream)
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
-	struct snd_soc_codec *codec = rtd->card->codec;
+	struct snd_soc_codec *codec = rtd->codec;
 
 	/* check the jack status at stream startup */
 	tosa_ext_control(codec);
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 17/17] ARM: pxa/colibri: setup pins for USB host port 3
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (14 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 16/17] SND: Tosa: Fix pointer to codec location Marek Vasut
@ 2010-11-02 23:51 ` Marek Vasut
  2010-11-03 13:33 ` [PATCH 01/17] ARM: pxa: Fix missing includes Eric Miao
  16 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-02 23:51 UTC (permalink / raw)
  To: linux-arm-kernel

From: Bjorn Forsman <bjorn.forsman@gmail.com>

Tested on a Colibri Evaluation Board Rev.2.1 with a Colibri PXA310 module.

Signed-off-by: Bjorn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
 arch/arm/mach-pxa/colibri-pxa300.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
index b5bb248..fddb16d 100644
--- a/arch/arm/mach-pxa/colibri-pxa300.c
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -46,6 +46,12 @@ static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
 	/* UHC */
 	GPIO0_2_USBH_PEN,
 	GPIO1_2_USBH_PWR,
+	GPIO77_USB_P3_1,
+	GPIO78_USB_P3_2,
+	GPIO79_USB_P3_3,
+	GPIO80_USB_P3_4,
+	GPIO81_USB_P3_5,
+	GPIO82_USB_P3_6,
 
 	/* I2C */
 	GPIO21_I2C_SCL,
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 29+ messages in thread

* [PATCH 01/17] ARM: pxa: Fix missing includes
  2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
                   ` (15 preceding siblings ...)
  2010-11-02 23:51 ` [PATCH 17/17] ARM: pxa/colibri: setup pins for USB host port 3 Marek Vasut
@ 2010-11-03 13:33 ` Eric Miao
  16 siblings, 0 replies; 29+ messages in thread
From: Eric Miao @ 2010-11-03 13:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> After the "ARM: pxa: Introduce pxa{25x,27x,3xx}_map_io()" patch, forged by me
> and Eric, was applied, some variables were misnamed and some includes missing.
> This patch corrects these errors.

Already fixed in my tree, but thanks again for spotting this.

>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> ?arch/arm/mach-pxa/pxa25x.c | ? ?2 ++
> ?arch/arm/mach-pxa/pxa27x.c | ? ?5 ++++-
> ?arch/arm/mach-pxa/pxa3xx.c | ? ?4 +++-
> ?3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
> index 4596b98..acde987 100644
> --- a/arch/arm/mach-pxa/pxa25x.c
> +++ b/arch/arm/mach-pxa/pxa25x.c
> @@ -31,6 +31,8 @@
> ?#include <mach/pm.h>
> ?#include <mach/dma.h>
>
> +#include <asm/mach/map.h>
> +
> ?#include "generic.h"
> ?#include "devices.h"
> ?#include "clock.h"
> diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
> index af47bef..764b9ac 100644
> --- a/arch/arm/mach-pxa/pxa27x.c
> +++ b/arch/arm/mach-pxa/pxa27x.c
> @@ -27,8 +27,11 @@
> ?#include <mach/ohci.h>
> ?#include <mach/pm.h>
> ?#include <mach/dma.h>
> +
> ?#include <plat/i2c.h>
>
> +#include <asm/mach/map.h>
> +
> ?#include "generic.h"
> ?#include "devices.h"
> ?#include "clock.h"
> @@ -387,7 +390,7 @@ static struct map_desc pxa27x_io_desc[] __initdata = {
> ?void __init pxa27x_map_io(void)
> ?{
> ? ? ? ?pxa_map_io();
> - ? ? ? iotable_init(ARRAY_AND_SIZE(pxa27x_io_table));
> + ? ? ? iotable_init(ARRAY_AND_SIZE(pxa27x_io_desc));
> ? ? ? ?pxa27x_get_clk_frequency_khz(1);
> ?}
>
> diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
> index af7f701..bb60664 100644
> --- a/arch/arm/mach-pxa/pxa3xx.c
> +++ b/arch/arm/mach-pxa/pxa3xx.c
> @@ -32,6 +32,8 @@
> ?#include <mach/regs-intc.h>
> ?#include <plat/i2c.h>
>
> +#include <asm/mach/map.h>
> +
> ?#include "generic.h"
> ?#include "devices.h"
> ?#include "clock.h"
> @@ -592,7 +594,7 @@ static struct map_desc pxa3xx_io_desc[] __initdata = {
> ?void __init pxa3xx_map_io(void)
> ?{
> ? ? ? ?pxa_map_io();
> - ? ? ? iotable_init(ARRAY_AND_SIZE(common_io_desc));
> + ? ? ? iotable_init(ARRAY_AND_SIZE(pxa3xx_io_desc));
> ? ? ? ?pxa3xx_get_clk_frequency_khz(1);
> ?}
>
> --
> 1.7.2.3
>
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses
  2010-11-02 23:51 ` [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses Marek Vasut
@ 2010-11-03 14:37   ` Eric Miao
  2010-11-03 15:30     ` Marek Vasut
  0 siblings, 1 reply; 29+ messages in thread
From: Eric Miao @ 2010-11-03 14:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> This is important because on PXA3xx, the physical mapping of SMEMC registers
> differs from the one on PXA2xx. In order to get PCMCIA working on both PXA2xx
> and PXA320, the PCMCIA driver was adjusted accordingly as well.
>
> Also, various places in the kernel had to be patched to use
> __raw_read/__raw_write.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> ---
> ?arch/arm/mach-pxa/cm-x2xx.c ? ? ? ? ? ? ? ? ?| ? 13 +++--
> ?arch/arm/mach-pxa/cpufreq-pxa2xx.c ? ? ? ? ? | ? 10 ++--
> ?arch/arm/mach-pxa/csb726.c ? ? ? ? ? ? ? ? ? | ? ?7 ++-
> ?arch/arm/mach-pxa/generic.c ? ? ? ? ? ? ? ? ?| ? ?1 +
> ?arch/arm/mach-pxa/h5000.c ? ? ? ? ? ? ? ? ? ?| ? ?9 ++--
> ?arch/arm/mach-pxa/include/mach/pxa-smemc.h ? | ? 74 ++++++++++++++++++++++++++
> ?arch/arm/mach-pxa/include/mach/pxa2xx-regs.h | ? 55 -------------------
> ?arch/arm/mach-pxa/lpd270.c ? ? ? ? ? ? ? ? ? | ? ?3 +-
> ?arch/arm/mach-pxa/lubbock.c ? ? ? ? ? ? ? ? ?| ? ?3 +-
> ?arch/arm/mach-pxa/mainstone.c ? ? ? ? ? ? ? ?| ? ?5 +-
> ?arch/arm/mach-pxa/pxa25x.c ? ? ? ? ? ? ? ? ? | ? ?5 +-
> ?arch/arm/mach-pxa/pxa27x.c ? ? ? ? ? ? ? ? ? | ? 10 ++--
> ?arch/arm/mach-pxa/pxa3xx.c ? ? ? ? ? ? ? ? ? | ? ?5 +-
> ?arch/arm/mach-pxa/sleep.S ? ? ? ? ? ? ? ? ? ?| ? ?2 +-
> ?arch/arm/mach-pxa/smemc.c ? ? ? ? ? ? ? ? ? ?| ? 51 ++++++------------
> ?arch/arm/mach-pxa/spitz.c ? ? ? ? ? ? ? ? ? ?| ? ?5 +-
> ?arch/arm/mach-pxa/stargate2.c ? ? ? ? ? ? ? ?| ? ?3 +-
> ?arch/arm/mach-pxa/tosa.c ? ? ? ? ? ? ? ? ? ? | ? ?7 ++-
> ?arch/arm/mach-pxa/trizeps4.c ? ? ? ? ? ? ? ? | ? ?3 +-
> ?arch/arm/mach-pxa/xcep.c ? ? ? ? ? ? ? ? ? ? | ? ?5 +-
> ?arch/arm/mach-pxa/zeus.c ? ? ? ? ? ? ? ? ? ? | ? ?5 +-
> ?drivers/pcmcia/pxa2xx_base.c ? ? ? ? ? ? ? ? | ? 65 +++++++++++++++-------
> ?22 files changed, 196 insertions(+), 150 deletions(-)
> ?create mode 100644 arch/arm/mach-pxa/include/mach/pxa-smemc.h
>
> diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
> index ca8ad86..bb33b0f 100644
> --- a/arch/arm/mach-pxa/cm-x2xx.c
> +++ b/arch/arm/mach-pxa/cm-x2xx.c
> @@ -24,6 +24,7 @@
> ?#include <mach/pxa2xx-regs.h>
> ?#include <mach/audio.h>
> ?#include <mach/pxafb.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include <asm/hardware/it8152.h>
>
> @@ -392,9 +393,9 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
> ? ? ? ?cmx2xx_pci_suspend();
>
> ? ? ? ?/* save MSC registers */
> - ? ? ? sleep_save_msc[0] = MSC0;
> - ? ? ? sleep_save_msc[1] = MSC1;
> - ? ? ? sleep_save_msc[2] = MSC2;
> + ? ? ? sleep_save_msc[0] = __raw_readl(MSC0);
> + ? ? ? sleep_save_msc[1] = __raw_readl(MSC1);
> + ? ? ? sleep_save_msc[2] = __raw_readl(MSC2);
>
> ? ? ? ?/* setup power saving mode registers */
> ? ? ? ?PCFR = 0x0;
> @@ -416,9 +417,9 @@ static int cmx2xx_resume(struct sys_device *dev)
> ? ? ? ?cmx2xx_pci_resume();
>
> ? ? ? ?/* restore MSC registers */
> - ? ? ? MSC0 = sleep_save_msc[0];
> - ? ? ? MSC1 = sleep_save_msc[1];
> - ? ? ? MSC2 = sleep_save_msc[2];
> + ? ? ? __raw_writel(sleep_save_msc[0], MSC0);
> + ? ? ? __raw_writel(sleep_save_msc[1], MSC1);
> + ? ? ? __raw_writel(sleep_save_msc[2], MSC2);
>
> ? ? ? ?return 0;
> ?}
> diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> index 58093d9..1af67ad 100644
> --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c
> @@ -38,8 +38,10 @@
> ?#include <linux/cpufreq.h>
> ?#include <linux/err.h>
> ?#include <linux/regulator/consumer.h>
> +#include <linux/io.h>
>
> ?#include <mach/pxa2xx-regs.h>
> +#include <mach/pxa-smemc.h>
>
> ?#ifdef DEBUG
> ?static unsigned int freq_debug;
> @@ -242,7 +244,7 @@ static void pxa27x_guess_max_freq(void)
>
> ?static void init_sdram_rows(void)
> ?{
> - ? ? ? uint32_t mdcnfg = MDCNFG;
> + ? ? ? uint32_t mdcnfg = __raw_readl(MDCNFG);
> ? ? ? ?unsigned int drac2 = 0, drac0 = 0;
>
> ? ? ? ?if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3))
> @@ -331,8 +333,8 @@ static int pxa_set_target(struct cpufreq_policy *policy,
> ? ? ? ? * we need to preset the smaller DRI before the change. ?If we're
> ? ? ? ? * speeding up we need to set the larger DRI value after the change.
> ? ? ? ? */
> - ? ? ? preset_mdrefr = postset_mdrefr = MDREFR;
> - ? ? ? if ((MDREFR & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
> + ? ? ? preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR);
> + ? ? ? if ((__raw_readl(MDREFR) & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {

The second __raw_readl() isn't necessary actually, could be something like
below:

	preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR);
	if ((preset_mdrefr & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) {
		preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK);
		preset_mdrefr |= mdrefr_dri(new_freq_mem);
	}
	postset_mdrefr =
		(postset_mdrefr & ~MDREFR_DRI_MASK) | mdrefr_dri(new_freq_mem);



> ? ? ? ? ? ? ? ?preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK);
> ? ? ? ? ? ? ? ?preset_mdrefr |= mdrefr_dri(new_freq_mem);
> ? ? ? ?}
> @@ -370,7 +372,7 @@ static int pxa_set_target(struct cpufreq_policy *policy,
> ?3: ? ? ? ? ? ? nop ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \n\
> ? ? ? ? ?"
> ? ? ? ? ? ? ? ? ? ? : "=&r" (unused)
> - ? ? ? ? ? ? ? ? ? ?: "r" (&MDREFR), "r" (cclkcfg),
> + ? ? ? ? ? ? ? ? ? ?: "r" (MDREFR), "r" (cclkcfg),
> ? ? ? ? ? ? ? ? ? ? ? "r" (preset_mdrefr), "r" (postset_mdrefr)
> ? ? ? ? ? ? ? ? ? ? : "r4", "r5");
> ? ? ? ?local_irq_restore(flags);
> diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c
> index 225a2a1..2429666 100644
> --- a/arch/arm/mach-pxa/csb726.c
> +++ b/arch/arm/mach-pxa/csb726.c
> @@ -27,6 +27,7 @@
> ?#include <mach/ohci.h>
> ?#include <mach/pxa2xx-regs.h>
> ?#include <mach/audio.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
> ?#include "devices.h"
> @@ -255,9 +256,9 @@ static struct platform_device *devices[] __initdata = {
> ?static void __init csb726_init(void)
> ?{
> ? ? ? ?pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config));
> -/* ? ? MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */
> -/* ? ? MSC2 = 0x06697ff4; *//* none/SM501 */
> - ? ? ? MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */
> +/* ? ? __raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */
> +/* ? ? __raw_writel(0x06697ff4, MSC2); *//* none/SM501 */
> + ? ? ? __raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */
>
> ? ? ? ?pxa_set_ffuart_info(NULL);
> ? ? ? ?pxa_set_btuart_info(NULL);
> diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
> index 6a5f379..05f6227 100644
> --- a/arch/arm/mach-pxa/generic.c
> +++ b/arch/arm/mach-pxa/generic.c
> @@ -28,6 +28,7 @@
>
> ?#include <mach/reset.h>
> ?#include <mach/gpio.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
>
> diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c
> index 0ef1635..42e60c6 100644
> --- a/arch/arm/mach-pxa/h5000.c
> +++ b/arch/arm/mach-pxa/h5000.c
> @@ -32,6 +32,7 @@
> ?#include <mach/pxa25x.h>
> ?#include <mach/h5000.h>
> ?#include <mach/udc.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
>
> @@ -172,11 +173,11 @@ static unsigned long h5000_pin_config[] __initdata = {
>
> ?static void fix_msc(void)
> ?{
> - ? ? ? MSC0 = 0x129c24f2;
> - ? ? ? MSC1 = 0x7ff424fa;
> - ? ? ? MSC2 = 0x7ff47ff4;
> + ? ? ? __raw_writel(0x129c24f2, MSC0);
> + ? ? ? __raw_writel(0x7ff424fa, MSC1);
> + ? ? ? __raw_writel(0x7ff47ff4, MSC2);
>
> - ? ? ? MDREFR |= 0x02080000;
> + ? ? ? __raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR);
> ?}
>
> ?/*
> diff --git a/arch/arm/mach-pxa/include/mach/pxa-smemc.h b/arch/arm/mach-pxa/include/mach/pxa-smemc.h
> new file mode 100644
> index 0000000..e3b270b
> --- /dev/null
> +++ b/arch/arm/mach-pxa/include/mach/pxa-smemc.h

I'd rather this being short as smemc.h, or regs-smemc.h, but not
necessarily pxa-, it's being implied by arch/arm/mach-pxa/ already.

> @@ -0,0 +1,74 @@
> +/*
> + * Static memory controller register definitions for PXA CPUs
> + *
> + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#ifndef __PXA_SMEMC_REGS_H
> +#define __PXA_SMEMC_REGS_H
> +
> +#define ? ? ? ?PXA2XX_SMEMC_BASE ? ? ? 0x48000000
> +#define ? ? ? ?PXA3XX_SMEMC_BASE ? ? ? 0x4a000000
> +#define ? ? ? ?PXA_SMEMC_VIRT ? ? ? ? ?0xf6000000

I'd rather this being short as SMEMC_VIRT, we have PXA_ all over already.

> +
> +#define MDCNFG ? ? ? ? (PXA_SMEMC_VIRT + 0x00) ?/* SDRAM Configuration Register 0 */
> +#define MDREFR ? ? ? ? (PXA_SMEMC_VIRT + 0x04) ?/* SDRAM Refresh Control Register */

These two registers are actually referenced in sleep.S and standby.S as
well, so you might check those two files as well.

> +#define MSC0 ? ? ? ? ? (PXA_SMEMC_VIRT + 0x08) ?/* Static Memory Control Register 0 */
> +#define MSC1 ? ? ? ? ? (PXA_SMEMC_VIRT + 0x0C) ?/* Static Memory Control Register 1 */
> +#define MSC2 ? ? ? ? ? (PXA_SMEMC_VIRT + 0x10) ?/* Static Memory Control Register 2 */
> +#define MECR ? ? ? ? ? (PXA_SMEMC_VIRT + 0x14) ?/* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
> +#define SXLCR ? ? ? ? ?(PXA_SMEMC_VIRT + 0x18) ?/* LCR value to be written to SDRAM-Timing Synchronous Flash */
> +#define SXCNFG ? ? ? ? (PXA_SMEMC_VIRT + 0x1C) ?/* Synchronous Static Memory Control Register */
> +#define SXMRS ? ? ? ? ?(PXA_SMEMC_VIRT + 0x24) ?/* MRS value to be written to Synchronous Flash or SMROM */
> +#define MCMEM0 ? ? ? ? (PXA_SMEMC_VIRT + 0x28) ?/* Card interface Common Memory Space Socket 0 Timing */
> +#define MCMEM1 ? ? ? ? (PXA_SMEMC_VIRT + 0x2C) ?/* Card interface Common Memory Space Socket 1 Timing */
> +#define MCATT0 ? ? ? ? (PXA_SMEMC_VIRT + 0x30) ?/* Card interface Attribute Space Socket 0 Timing Configuration */
> +#define MCATT1 ? ? ? ? (PXA_SMEMC_VIRT + 0x34) ?/* Card interface Attribute Space Socket 1 Timing Configuration */
> +#define MCIO0 ? ? ? ? ?(PXA_SMEMC_VIRT + 0x38) ?/* Card interface I/O Space Socket 0 Timing Configuration */
> +#define MCIO1 ? ? ? ? ?(PXA_SMEMC_VIRT + 0x3C) ?/* Card interface I/O Space Socket 1 Timing Configuration */
> +#define MDMRS ? ? ? ? ?(PXA_SMEMC_VIRT + 0x40) ?/* MRS value to be written to SDRAM */
> +#define BOOT_DEF ? ? ? (PXA_SMEMC_VIRT + 0x44) ?/* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
> +#define MEMCLKCFG ? ? ?(PXA_SMEMC_VIRT + 0x68) /* Clock Configuration */
> +#define CSADRCFG0 ? ? ?(PXA_SMEMC_VIRT + 0x80) /* Address Configuration Register for CS0 */
> +#define CSADRCFG1 ? ? ?(PXA_SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */
> +#define CSADRCFG2 ? ? ?(PXA_SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */
> +#define CSADRCFG3 ? ? ?(PXA_SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */
> +
> +/*
> + * More handy macros for PCMCIA
> + *
> + * Arg is socket number
> + */
> +#define MCMEM(s) ? ? ? (PXA_SMEMC_VIRT + 0x28 + ((s)<<2)) ?/* Card interface Common Memory Space Socket s Timing */
> +#define MCATT(s) ? ? ? (PXA_SMEMC_VIRT + 0x30 + ((s)<<2)) ?/* Card interface Attribute Space Socket s Timing Configuration */
> +#define MCIO(s) ? ? ? ? ? ? ? ?(PXA_SMEMC_VIRT + 0x38 + ((s)<<2)) ?/* Card interface I/O Space Socket s Timing Configuration */
> +
> +/* MECR register defines */
> +#define MECR_NOS ? ? ? (1 << 0) ? ? ? ?/* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
> +#define MECR_CIT ? ? ? (1 << 1) ? ? ? ?/* Card Is There: 0 -> no card, 1 -> card inserted */
> +
> +#define MDCNFG_DE0 ? ? (1 << 0) ? ? ? ?/* SDRAM Bank 0 Enable */
> +#define MDCNFG_DE1 ? ? (1 << 1) ? ? ? ?/* SDRAM Bank 1 Enable */
> +#define MDCNFG_DE2 ? ? (1 << 16) ? ? ? /* SDRAM Bank 2 Enable */
> +#define MDCNFG_DE3 ? ? (1 << 17) ? ? ? /* SDRAM Bank 3 Enable */
> +
> +#define MDREFR_K0DB4 ? (1 << 29) ? ? ? /* SDCLK0 Divide by 4 Control/Status */
> +#define MDREFR_K2FREE ?(1 << 25) ? ? ? /* SDRAM Free-Running Control */
> +#define MDREFR_K1FREE ?(1 << 24) ? ? ? /* SDRAM Free-Running Control */
> +#define MDREFR_K0FREE ?(1 << 23) ? ? ? /* SDRAM Free-Running Control */
> +#define MDREFR_SLFRSH ?(1 << 22) ? ? ? /* SDRAM Self-Refresh Control/Status */
> +#define MDREFR_APD ? ? (1 << 20) ? ? ? /* SDRAM/SSRAM Auto-Power-Down Enable */
> +#define MDREFR_K2DB2 ? (1 << 19) ? ? ? /* SDCLK2 Divide by 2 Control/Status */
> +#define MDREFR_K2RUN ? (1 << 18) ? ? ? /* SDCLK2 Run Control/Status */
> +#define MDREFR_K1DB2 ? (1 << 17) ? ? ? /* SDCLK1 Divide by 2 Control/Status */
> +#define MDREFR_K1RUN ? (1 << 16) ? ? ? /* SDCLK1 Run Control/Status */
> +#define MDREFR_E1PIN ? (1 << 15) ? ? ? /* SDCKE1 Level Control/Status */
> +#define MDREFR_K0DB2 ? (1 << 14) ? ? ? /* SDCLK0 Divide by 2 Control/Status */
> +#define MDREFR_K0RUN ? (1 << 13) ? ? ? /* SDCLK0 Run Control/Status */
> +#define MDREFR_E0PIN ? (1 << 12) ? ? ? /* SDCKE0 Level Control/Status */
> +
> +#endif
> diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
> index dd0fc1c..ee6ced1 100644
> --- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
> +++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
> @@ -17,61 +17,6 @@
> ?#include <mach/hardware.h>
>
> ?/*
> - * Memory controller
> - */
> -
> -#define MDCNFG ? ? ? ? __REG(0x48000000) ?/* SDRAM Configuration Register 0 */
> -#define MDREFR ? ? ? ? __REG(0x48000004) ?/* SDRAM Refresh Control Register */
> -#define MSC0 ? ? ? ? ? __REG(0x48000008) ?/* Static Memory Control Register 0 */
> -#define MSC1 ? ? ? ? ? __REG(0x4800000C) ?/* Static Memory Control Register 1 */
> -#define MSC2 ? ? ? ? ? __REG(0x48000010) ?/* Static Memory Control Register 2 */
> -#define MECR ? ? ? ? ? __REG(0x48000014) ?/* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */
> -#define SXLCR ? ? ? ? ?__REG(0x48000018) ?/* LCR value to be written to SDRAM-Timing Synchronous Flash */
> -#define SXCNFG ? ? ? ? __REG(0x4800001C) ?/* Synchronous Static Memory Control Register */
> -#define SXMRS ? ? ? ? ?__REG(0x48000024) ?/* MRS value to be written to Synchronous Flash or SMROM */
> -#define MCMEM0 ? ? ? ? __REG(0x48000028) ?/* Card interface Common Memory Space Socket 0 Timing */
> -#define MCMEM1 ? ? ? ? __REG(0x4800002C) ?/* Card interface Common Memory Space Socket 1 Timing */
> -#define MCATT0 ? ? ? ? __REG(0x48000030) ?/* Card interface Attribute Space Socket 0 Timing Configuration */
> -#define MCATT1 ? ? ? ? __REG(0x48000034) ?/* Card interface Attribute Space Socket 1 Timing Configuration */
> -#define MCIO0 ? ? ? ? ?__REG(0x48000038) ?/* Card interface I/O Space Socket 0 Timing Configuration */
> -#define MCIO1 ? ? ? ? ?__REG(0x4800003C) ?/* Card interface I/O Space Socket 1 Timing Configuration */
> -#define MDMRS ? ? ? ? ?__REG(0x48000040) ?/* MRS value to be written to SDRAM */
> -#define BOOT_DEF ? ? ? __REG(0x48000044) ?/* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */
> -
> -/*
> - * More handy macros for PCMCIA
> - *
> - * Arg is socket number
> - */
> -#define MCMEM(s) ? ? ? __REG2(0x48000028, (s)<<2 ) ?/* Card interface Common Memory Space Socket s Timing */
> -#define MCATT(s) ? ? ? __REG2(0x48000030, (s)<<2 ) ?/* Card interface Attribute Space Socket s Timing Configuration */
> -#define MCIO(s) ? ? ? ? ? ? ? ?__REG2(0x48000038, (s)<<2 ) ?/* Card interface I/O Space Socket s Timing Configuration */
> -
> -/* MECR register defines */
> -#define MECR_NOS ? ? ? (1 << 0) ? ? ? ?/* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */
> -#define MECR_CIT ? ? ? (1 << 1) ? ? ? ?/* Card Is There: 0 -> no card, 1 -> card inserted */
> -
> -#define MDCNFG_DE0 ? ? (1 << 0) ? ? ? ?/* SDRAM Bank 0 Enable */
> -#define MDCNFG_DE1 ? ? (1 << 1) ? ? ? ?/* SDRAM Bank 1 Enable */
> -#define MDCNFG_DE2 ? ? (1 << 16) ? ? ? /* SDRAM Bank 2 Enable */
> -#define MDCNFG_DE3 ? ? (1 << 17) ? ? ? /* SDRAM Bank 3 Enable */
> -
> -#define MDREFR_K0DB4 ? (1 << 29) ? ? ? /* SDCLK0 Divide by 4 Control/Status */
> -#define MDREFR_K2FREE ?(1 << 25) ? ? ? /* SDRAM Free-Running Control */
> -#define MDREFR_K1FREE ?(1 << 24) ? ? ? /* SDRAM Free-Running Control */
> -#define MDREFR_K0FREE ?(1 << 23) ? ? ? /* SDRAM Free-Running Control */
> -#define MDREFR_SLFRSH ?(1 << 22) ? ? ? /* SDRAM Self-Refresh Control/Status */
> -#define MDREFR_APD ? ? (1 << 20) ? ? ? /* SDRAM/SSRAM Auto-Power-Down Enable */
> -#define MDREFR_K2DB2 ? (1 << 19) ? ? ? /* SDCLK2 Divide by 2 Control/Status */
> -#define MDREFR_K2RUN ? (1 << 18) ? ? ? /* SDCLK2 Run Control/Status */
> -#define MDREFR_K1DB2 ? (1 << 17) ? ? ? /* SDCLK1 Divide by 2 Control/Status */
> -#define MDREFR_K1RUN ? (1 << 16) ? ? ? /* SDCLK1 Run Control/Status */
> -#define MDREFR_E1PIN ? (1 << 15) ? ? ? /* SDCKE1 Level Control/Status */
> -#define MDREFR_K0DB2 ? (1 << 14) ? ? ? /* SDCLK0 Divide by 2 Control/Status */
> -#define MDREFR_K0RUN ? (1 << 13) ? ? ? /* SDCLK0 Run Control/Status */
> -#define MDREFR_E0PIN ? (1 << 12) ? ? ? /* SDCKE0 Level Control/Status */
> -
> -/*
> ?* Power Manager
> ?*/
>
> diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
> index db615d5..86d94a3 100644
> --- a/arch/arm/mach-pxa/lpd270.c
> +++ b/arch/arm/mach-pxa/lpd270.c
> @@ -46,6 +46,7 @@
> ?#include <mach/mmc.h>
> ?#include <mach/irda.h>
> ?#include <mach/ohci.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
> ?#include "devices.h"
> @@ -463,7 +464,7 @@ static void __init lpd270_init(void)
> ? ? ? ?pxa_set_btuart_info(NULL);
> ? ? ? ?pxa_set_stuart_info(NULL);
>
> - ? ? ? lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
> + ? ? ? lpd270_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
> ? ? ? ?lpd270_flash_data[1].width = 4;
>
> ? ? ? ?/*
> diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
> index 5b1cc1c..f9dfea7 100644
> --- a/arch/arm/mach-pxa/lubbock.c
> +++ b/arch/arm/mach-pxa/lubbock.c
> @@ -50,6 +50,7 @@
> ?#include <mach/pxafb.h>
> ?#include <mach/mmc.h>
> ?#include <mach/pm.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
> ?#include "clock.h"
> @@ -525,7 +526,7 @@ static void __init lubbock_init(void)
> ? ? ? ?pxa_set_ac97_info(NULL);
>
> ? ? ? ?lubbock_flash_data[0].width = lubbock_flash_data[1].width =
> - ? ? ? ? ? ? ? (BOOT_DEF & 1) ? 2 : 4;
> + ? ? ? ? ? ? ? (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
> ? ? ? ?/* Compensate for the nROMBT switch which swaps the flash banks */
> ? ? ? ?printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n",
> ? ? ? ? ? ? ? flashboot?"Flash":"ROM", flashboot);
> diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
> index 63f4e1c..31729ee 100644
> --- a/arch/arm/mach-pxa/mainstone.c
> +++ b/arch/arm/mach-pxa/mainstone.c
> @@ -41,7 +41,7 @@
> ?#include <asm/mach/irq.h>
> ?#include <asm/mach/flash.h>
>
> -#include <plat/pxa27x.h>
> +#include <mach/pxa27x.h>
> ?#include <mach/gpio.h>
> ?#include <mach/mainstone.h>
> ?#include <mach/audio.h>
> @@ -51,6 +51,7 @@
> ?#include <mach/irda.h>
> ?#include <mach/ohci.h>
> ?#include <plat/pxa27x_keypad.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
> ?#include "devices.h"
> @@ -565,7 +566,7 @@ static void __init mainstone_init(void)
> ? ? ? ?pxa_set_btuart_info(NULL);
> ? ? ? ?pxa_set_stuart_info(NULL);
>
> - ? ? ? mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
> + ? ? ? mst_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4;
> ? ? ? ?mst_flash_data[1].width = 4;
>
> ? ? ? ?/* Compensate for SW7 which swaps the flash banks */
> diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
> index acde987..3aefcbc 100644
> --- a/arch/arm/mach-pxa/pxa25x.c
> +++ b/arch/arm/mach-pxa/pxa25x.c
> @@ -30,6 +30,7 @@
> ?#include <mach/reset.h>
> ?#include <mach/pm.h>
> ?#include <mach/dma.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include <asm/mach/map.h>
>
> @@ -324,8 +325,8 @@ void __init pxa26x_init_irq(void)
>
> ?static struct map_desc pxa25x_io_desc[] __initdata = {
> ? ? ? ?{ ? ? ? /* Mem Ctl */
> - ? ? ? ? ? ? ? .virtual ? ? ? ?= ?0xf6000000,
> - ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(0x48000000),
> + ? ? ? ? ? ? ? .virtual ? ? ? ?= ?PXA_SMEMC_VIRT,
> + ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(PXA2XX_SMEMC_BASE),
> ? ? ? ? ? ? ? ?.length ? ? ? ? = 0x00200000,
> ? ? ? ? ? ? ? ?.type ? ? ? ? ? = MT_DEVICE
> ? ? ? ?},
> diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
> index 764b9ac..dd0cb80 100644
> --- a/arch/arm/mach-pxa/pxa27x.c
> +++ b/arch/arm/mach-pxa/pxa27x.c
> @@ -17,6 +17,7 @@
> ?#include <linux/suspend.h>
> ?#include <linux/platform_device.h>
> ?#include <linux/sysdev.h>
> +#include <linux/io.h>
>
> ?#include <mach/hardware.h>
> ?#include <asm/irq.h>
> @@ -27,6 +28,7 @@
> ?#include <mach/ohci.h>
> ?#include <mach/pm.h>
> ?#include <mach/dma.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include <plat/i2c.h>
>
> @@ -257,7 +259,7 @@ enum {
>
> ?void pxa27x_cpu_pm_save(unsigned long *sleep_save)
> ?{
> - ? ? ? SAVE(MDREFR);
> + ? ? ? sleep_save[SLEEP_SAVE_MDREFR] = __raw_readl(MDREFR);
> ? ? ? ?SAVE(PCFR);
>
> ? ? ? ?SAVE(CKEN);
> @@ -266,7 +268,7 @@ void pxa27x_cpu_pm_save(unsigned long *sleep_save)
>
> ?void pxa27x_cpu_pm_restore(unsigned long *sleep_save)
> ?{
> - ? ? ? RESTORE(MDREFR);
> + ? ? ? __raw_writel(sleep_save[SLEEP_SAVE_MDREFR], MDREFR);
> ? ? ? ?RESTORE(PCFR);
>
> ? ? ? ?PSSR = PSSR_RDH | PSSR_PH;
> @@ -375,8 +377,8 @@ void __init pxa27x_init_irq(void)
>
> ?static struct map_desc pxa27x_io_desc[] __initdata = {
> ? ? ? ?{ ? ? ? /* Mem Ctl */
> - ? ? ? ? ? ? ? .virtual ? ? ? ?= ?0xf6000000,
> - ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(0x48000000),
> + ? ? ? ? ? ? ? .virtual ? ? ? ?= ?PXA_SMEMC_VIRT,
> + ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(PXA2XX_SMEMC_BASE),
> ? ? ? ? ? ? ? ?.length ? ? ? ? = 0x00200000,
> ? ? ? ? ? ? ? ?.type ? ? ? ? ? = MT_DEVICE
> ? ? ? ?}, { ? ?/* IMem ctl */
> diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
> index bb60664..0ed26a0 100644
> --- a/arch/arm/mach-pxa/pxa3xx.c
> +++ b/arch/arm/mach-pxa/pxa3xx.c
> @@ -30,6 +30,7 @@
> ?#include <mach/pm.h>
> ?#include <mach/dma.h>
> ?#include <mach/regs-intc.h>
> +#include <mach/pxa-smemc.h>
> ?#include <plat/i2c.h>
>
> ?#include <asm/mach/map.h>
> @@ -584,8 +585,8 @@ void __init pxa3xx_init_irq(void)
>
> ?static struct map_desc pxa3xx_io_desc[] __initdata = {
> ? ? ? ?{ ? ? ? /* Mem Ctl */
> - ? ? ? ? ? ? ? .virtual ? ? ? ?= ?0xf6000000,
> - ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(0x4a000000),
> + ? ? ? ? ? ? ? .virtual ? ? ? ?= ?PXA_SMEMC_VIRT,
> + ? ? ? ? ? ? ? .pfn ? ? ? ? ? ?= __phys_to_pfn(PXA3XX_SMEMC_BASE),
> ? ? ? ? ? ? ? ?.length ? ? ? ? = 0x00200000,
> ? ? ? ? ? ? ? ?.type ? ? ? ? ? = MT_DEVICE
> ? ? ? ?}
> diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S
> index 52c30b0..227df3a 100644
> --- a/arch/arm/mach-pxa/sleep.S
> +++ b/arch/arm/mach-pxa/sleep.S
> @@ -14,7 +14,7 @@
> ?#include <linux/linkage.h>
> ?#include <asm/assembler.h>
> ?#include <mach/hardware.h>
> -
> +#include <mach/pxa-smemc.h>
> ?#include <mach/pxa2xx-regs.h>
>
> ?#define MDREFR_KDIV ? ?0x200a4000 ? ? ?// all banks
> diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
> index d6f6904..91edda8 100644
> --- a/arch/arm/mach-pxa/smemc.c
> +++ b/arch/arm/mach-pxa/smemc.c
> @@ -9,50 +9,37 @@
> ?#include <linux/sysdev.h>
>
> ?#include <mach/hardware.h>
> -
> -#define SMEMC_PHYS_BASE ? ? ? ?(0x4A000000)
> -#define SMEMC_PHYS_SIZE ? ? ? ?(0x90)
> -
> -#define MSC0 ? ? ? ? ? (0x08) ?/* Static Memory Controller Register 0 */
> -#define MSC1 ? ? ? ? ? (0x0C) ?/* Static Memory Controller Register 1 */
> -#define SXCNFG ? ? ? ? (0x1C) ?/* Synchronous Static Memory Control Register */
> -#define MEMCLKCFG ? ? ?(0x68) ?/* Clock Configuration */
> -#define CSADRCFG0 ? ? ?(0x80) ?/* Address Configuration Register for CS0 */
> -#define CSADRCFG1 ? ? ?(0x84) ?/* Address Configuration Register for CS1 */
> -#define CSADRCFG2 ? ? ?(0x88) ?/* Address Configuration Register for CS2 */
> -#define CSADRCFG3 ? ? ?(0x8C) ?/* Address Configuration Register for CS3 */
> +#include <mach/pxa-smemc.h>
>
> ?#ifdef CONFIG_PM
> -static void __iomem *smemc_mmio_base;
> -
> ?static unsigned long msc[2];
> ?static unsigned long sxcnfg, memclkcfg;
> ?static unsigned long csadrcfg[4];
>
> ?static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state)
> ?{
> - ? ? ? msc[0] = __raw_readl(smemc_mmio_base + MSC0);
> - ? ? ? msc[1] = __raw_readl(smemc_mmio_base + MSC1);
> - ? ? ? sxcnfg = __raw_readl(smemc_mmio_base + SXCNFG);
> - ? ? ? memclkcfg = __raw_readl(smemc_mmio_base + MEMCLKCFG);
> - ? ? ? csadrcfg[0] = __raw_readl(smemc_mmio_base + CSADRCFG0);
> - ? ? ? csadrcfg[1] = __raw_readl(smemc_mmio_base + CSADRCFG1);
> - ? ? ? csadrcfg[2] = __raw_readl(smemc_mmio_base + CSADRCFG2);
> - ? ? ? csadrcfg[3] = __raw_readl(smemc_mmio_base + CSADRCFG3);
> + ? ? ? msc[0] = __raw_readl(MSC0);
> + ? ? ? msc[1] = __raw_readl(MSC1);
> + ? ? ? sxcnfg = __raw_readl(SXCNFG);
> + ? ? ? memclkcfg = __raw_readl(MEMCLKCFG);
> + ? ? ? csadrcfg[0] = __raw_readl(CSADRCFG0);
> + ? ? ? csadrcfg[1] = __raw_readl(CSADRCFG1);
> + ? ? ? csadrcfg[2] = __raw_readl(CSADRCFG2);
> + ? ? ? csadrcfg[3] = __raw_readl(CSADRCFG3);
>
> ? ? ? ?return 0;
> ?}
>
> ?static int pxa3xx_smemc_resume(struct sys_device *dev)
> ?{
> - ? ? ? __raw_writel(msc[0], smemc_mmio_base + MSC0);
> - ? ? ? __raw_writel(msc[1], smemc_mmio_base + MSC1);
> - ? ? ? __raw_writel(sxcnfg, smemc_mmio_base + SXCNFG);
> - ? ? ? __raw_writel(memclkcfg, smemc_mmio_base + MEMCLKCFG);
> - ? ? ? __raw_writel(csadrcfg[0], smemc_mmio_base + CSADRCFG0);
> - ? ? ? __raw_writel(csadrcfg[1], smemc_mmio_base + CSADRCFG1);
> - ? ? ? __raw_writel(csadrcfg[2], smemc_mmio_base + CSADRCFG2);
> - ? ? ? __raw_writel(csadrcfg[3], smemc_mmio_base + CSADRCFG3);
> + ? ? ? __raw_writel(msc[0], MSC0);
> + ? ? ? __raw_writel(msc[1], MSC1);
> + ? ? ? __raw_writel(sxcnfg, SXCNFG);
> + ? ? ? __raw_writel(memclkcfg, MEMCLKCFG);
> + ? ? ? __raw_writel(csadrcfg[0], CSADRCFG0);
> + ? ? ? __raw_writel(csadrcfg[1], CSADRCFG1);
> + ? ? ? __raw_writel(csadrcfg[2], CSADRCFG2);
> + ? ? ? __raw_writel(csadrcfg[3], CSADRCFG3);
>
> ? ? ? ?return 0;
> ?}
> @@ -73,10 +60,6 @@ static int __init smemc_init(void)
> ? ? ? ?int ret = 0;
>
> ? ? ? ?if (cpu_is_pxa3xx()) {
> - ? ? ? ? ? ? ? smemc_mmio_base = ioremap(SMEMC_PHYS_BASE, SMEMC_PHYS_SIZE);
> - ? ? ? ? ? ? ? if (smemc_mmio_base == NULL)
> - ? ? ? ? ? ? ? ? ? ? ? return -ENODEV;
> -
> ? ? ? ? ? ? ? ?ret = sysdev_class_register(&smemc_sysclass);
> ? ? ? ? ? ? ? ?if (ret)
> ? ? ? ? ? ? ? ? ? ? ? ?return ret;
> diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
> index 38bcc2a..3ead559 100644
> --- a/arch/arm/mach-pxa/spitz.c
> +++ b/arch/arm/mach-pxa/spitz.c
> @@ -45,6 +45,7 @@
> ?#include <mach/pxa2xx_spi.h>
> ?#include <mach/spitz.h>
> ?#include <mach/sharpsl_pm.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include <plat/i2c.h>
>
> @@ -931,8 +932,8 @@ static void spitz_poweroff(void)
> ?static void spitz_restart(char mode, const char *cmd)
> ?{
> ? ? ? ?/* Bootloader magic for a reboot */
> - ? ? ? if ((MSC0 & 0xffff0000) == 0x7ff00000)
> - ? ? ? ? ? ? ? MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
> + ? ? ? if ((__raw_readl(MSC0) & 0xffff0000) == 0x7ff00000)
> + ? ? ? ? ? ? ? __raw_writel((__raw_readl(MSC0) & 0xffff) | 0x7ee00000, MSC0);

introduce a intermediate variable for the result of a read to avoid it
being read twice.

>
> ? ? ? ?spitz_poweroff();
> ?}
> diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
> index 19f5378..70ffc36 100644
> --- a/arch/arm/mach-pxa/stargate2.c
> +++ b/arch/arm/mach-pxa/stargate2.c
> @@ -48,6 +48,7 @@
> ?#include <mach/udc.h>
> ?#include <mach/pxa2xx_spi.h>
> ?#include <mach/pxa27x-udc.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include <linux/spi/spi.h>
> ?#include <linux/mfd/da903x.h>
> @@ -976,7 +977,7 @@ static void __init stargate2_init(void)
> ?{
> ? ? ? ?/* This is probably a board specific hack as this must be set
> ? ? ? ? ? prior to connecting the MFP stuff up. */
> - ? ? ? MECR &= ~MECR_NOS;
> + ? ? ? __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR);
>
> ? ? ? ?pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config));
>
> diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
> index 3883385..e36c3c3 100644
> --- a/arch/arm/mach-pxa/tosa.c
> +++ b/arch/arm/mach-pxa/tosa.c
> @@ -46,6 +46,7 @@
> ?#include <mach/tosa_bt.h>
> ?#include <mach/pxa2xx_spi.h>
> ?#include <mach/audio.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include <asm/mach/arch.h>
> ?#include <mach/tosa.h>
> @@ -893,9 +894,11 @@ static void tosa_poweroff(void)
>
> ?static void tosa_restart(char mode, const char *cmd)
> ?{
> + ? ? ? uint32_t msc0 = __raw_readl(MSC0);
> +
> ? ? ? ?/* Bootloader magic for a reboot */
> - ? ? ? if((MSC0 & 0xffff0000) == 0x7ff00000)
> - ? ? ? ? ? ? ? MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
> + ? ? ? if((msc0 & 0xffff0000) == 0x7ff00000)
> + ? ? ? ? ? ? ? __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0);
>
> ? ? ? ?tosa_poweroff();
> ?}
> diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
> index ab3b933..2a3c28c 100644
> --- a/arch/arm/mach-pxa/trizeps4.c
> +++ b/arch/arm/mach-pxa/trizeps4.c
> @@ -47,6 +47,7 @@
> ?#include <mach/mmc.h>
> ?#include <mach/irda.h>
> ?#include <mach/ohci.h>
> +#include <mach/pxa-smemc.h>
> ?#include <plat/i2c.h>
>
> ?#include "generic.h"
> @@ -542,7 +543,7 @@ static void __init trizeps4_map_io(void)
> ? ? ? ?pxa27x_map_io();
> ? ? ? ?iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc));
>
> - ? ? ? if ((MSC0 & 0x8) && (BOOT_DEF & 0x1)) {
> + ? ? ? if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) {
> ? ? ? ? ? ? ? ?/* if flash is 16 bit wide its a Trizeps4 WL */
> ? ? ? ? ? ? ? ?__machine_arch_type = MACH_TYPE_TRIZEPS4WL;
> ? ? ? ? ? ? ? ?trizeps4_flash_data[0].width = 2;
> diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c
> index 99744f4..67073e0 100644
> --- a/arch/arm/mach-pxa/xcep.c
> +++ b/arch/arm/mach-pxa/xcep.c
> @@ -31,6 +31,7 @@
> ?#include <mach/hardware.h>
> ?#include <mach/pxa2xx-regs.h>
> ?#include <mach/mfp-pxa25x.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
>
> @@ -172,9 +173,9 @@ static void __init xcep_init(void)
>
> ? ? ? ?/* See Intel XScale Developer's Guide for details */
> ? ? ? ?/* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */
> - ? ? ? MSC1 = (MSC1 & 0xffff) | 0xD5540000;
> + ? ? ? __raw_writel((__raw_readl(MSC1) & 0xffff) | 0xD5540000, MSC1);
> ? ? ? ?/* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */
> - ? ? ? MSC2 = (MSC2 & 0xffff) | 0x72A00000;
> + ? ? ? __raw_writel((__raw_readl(MSC2) & 0xffff) | 0x72A00000, MSC2);
>
> ? ? ? ?platform_add_devices(ARRAY_AND_SIZE(devices));
> ? ? ? ?pxa_set_i2c_info(&xcep_i2c_platform_data);
> diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
> index 0909df2..2f21144 100644
> --- a/arch/arm/mach-pxa/zeus.c
> +++ b/arch/arm/mach-pxa/zeus.c
> @@ -47,6 +47,7 @@
> ?#include <mach/audio.h>
> ?#include <mach/arcom-pcmcia.h>
> ?#include <mach/zeus.h>
> +#include <mach/pxa-smemc.h>
>
> ?#include "generic.h"
>
> @@ -828,8 +829,8 @@ static void __init zeus_init(void)
> ? ? ? ?pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f));
>
> ? ? ? ?/* Fix timings for dm9000s (CS1/CS2)*/
> - ? ? ? MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
> - ? ? ? MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
> + ? ? ? __raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
> + ? ? ? __raw_writel((MSC1 & 0xffff0000) | dm9000_msc, MSC1);

This isn't correct.

>
> ? ? ? ?pm_power_off = zeus_power_off;
> ? ? ? ?zeus_setup_apm();
> diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
> index ae07b4d..65a8b6f 100644
> --- a/drivers/pcmcia/pxa2xx_base.c
> +++ b/drivers/pcmcia/pxa2xx_base.c
> @@ -26,6 +26,7 @@
> ?#include <linux/platform_device.h>
>
> ?#include <mach/hardware.h>
> +#include <mach/pxa-smemc.h>
> ?#include <asm/io.h>
> ?#include <asm/irq.h>
> ?#include <asm/system.h>
> @@ -116,37 +117,49 @@ static inline u_int pxa2xx_pcmcia_cmd_time(u_int mem_clk_10khz,
>
> ?static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock )
> ?{
> - ? ? ? MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock)
> + ? ? ? uint32_t val;
> +
> + ? ? ? val = ((pxa2xx_mcxx_setup(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
> ? ? ? ? ? ? ? ?| ((pxa2xx_mcxx_asst(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
> ? ? ? ? ? ? ? ?| ((pxa2xx_mcxx_hold(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
>
> + ? ? ? __raw_writel(val, MCMEM(sock));
> +
> ? ? ? ?return 0;
> ?}
>
> ?static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock )
> ?{
> - ? ? ? MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock)
> + ? ? ? uint32_t val;
> +
> + ? ? ? val = ((pxa2xx_mcxx_setup(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
> ? ? ? ? ? ? ? ?| ((pxa2xx_mcxx_asst(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
> ? ? ? ? ? ? ? ?| ((pxa2xx_mcxx_hold(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
>
> + ? ? ? __raw_writel(val, MCIO(sock));
> +
> ? ? ? ?return 0;
> ?}
>
> ?static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock )
> ?{
> - ? ? ? MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock)
> + ? ? ? uint32_t val;
> +
> + ? ? ? val = ((pxa2xx_mcxx_setup(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
> ? ? ? ? ? ? ? ?| ((pxa2xx_mcxx_asst(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
> ? ? ? ? ? ? ? ?| ((pxa2xx_mcxx_hold(speed, clock)
> ? ? ? ? ? ? ? ?& MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
>
> + ? ? ? __raw_writel(val, MCATT(sock));
> +
> ? ? ? ?return 0;
> ?}
>
> @@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt,
> ?static void pxa2xx_configure_sockets(struct device *dev)
> ?{
> ? ? ? ?struct pcmcia_low_level *ops = dev->platform_data;
> -
> ? ? ? ?/*
> ? ? ? ? * We have at least one socket, so set MECR:CIT
> ? ? ? ? * (Card Is There)
> ? ? ? ? */
> - ? ? ? MECR |= MECR_CIT;
> + ? ? ? uint32_t mecr = MECR_CIT;
>
> ? ? ? ?/* Set MECR:NOS (Number Of Sockets) */
> ? ? ? ?if ((ops->first + ops->nr) > 1 ||
> ? ? ? ? ? ?machine_is_viper() || machine_is_arcom_zeus())
> - ? ? ? ? ? ? ? MECR |= MECR_NOS;
> - ? ? ? else
> - ? ? ? ? ? ? ? MECR &= ~MECR_NOS;
> + ? ? ? ? ? ? ? mecr |= MECR_NOS;
> +
> + ? ? ? __raw_writel(mecr, MECR);

This looks to be a bit inconsistent with the original code?

> ?}
>
> ?static const char *skt_names[] = {
> @@ -272,14 +284,24 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
> ? ? ? ?struct soc_pcmcia_socket *skt;
>
> ? ? ? ?ops = (struct pcmcia_low_level *)dev->dev.platform_data;
> - ? ? ? if (!ops)
> - ? ? ? ? ? ? ? return -ENODEV;
> + ? ? ? if (!ops) {
> + ? ? ? ? ? ? ? ret = -ENODEV;
> + ? ? ? ? ? ? ? goto err0;
> + ? ? ? }
> +
> + ? ? ? if (cpu_is_pxa320() && ops->nr > 1) {
> + ? ? ? ? ? ? ? dev_err(&dev->dev, "pxa320 supports only one pcmcia slot");
> + ? ? ? ? ? ? ? ret = -EINVAL;
> + ? ? ? ? ? ? ? goto err0;
> + ? ? ? }

This change doesn't look to be part of this patch?

>
> ? ? ? ?pxa2xx_drv_pcmcia_ops(ops);
>
> ? ? ? ?sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
> - ? ? ? if (!sinfo)
> - ? ? ? ? ? ? ? return -ENOMEM;
> + ? ? ? if (!sinfo) {
> + ? ? ? ? ? ? ? ret = -ENOMEM;
> + ? ? ? ? ? ? ? goto err0;
> + ? ? ? }
>
> ? ? ? ?sinfo->nskt = ops->nr;
>
> @@ -295,18 +317,19 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev)
>
> ? ? ? ? ? ? ? ?ret = pxa2xx_drv_pcmcia_add_one(skt);
> ? ? ? ? ? ? ? ?if (ret)
> - ? ? ? ? ? ? ? ? ? ? ? break;
> + ? ? ? ? ? ? ? ? ? ? ? goto err1;
> ? ? ? ?}
>
> - ? ? ? if (ret) {
> - ? ? ? ? ? ? ? while (--i >= 0)
> - ? ? ? ? ? ? ? ? ? ? ? soc_pcmcia_remove_one(&sinfo->skt[i]);
> - ? ? ? ? ? ? ? kfree(sinfo);
> - ? ? ? } else {
> - ? ? ? ? ? ? ? pxa2xx_configure_sockets(&dev->dev);
> - ? ? ? ? ? ? ? dev_set_drvdata(&dev->dev, sinfo);
> - ? ? ? }
> + ? ? ? pxa2xx_configure_sockets(&dev->dev);
> + ? ? ? dev_set_drvdata(&dev->dev, sinfo);
>
> + ? ? ? return 0;
> +
> +err1:
> + ? ? ? while (--i >= 0)
> + ? ? ? ? ? ? ? soc_pcmcia_remove_one(&sinfo->skt[i]);
> + ? ? ? kfree(sinfo);
> +err0:
> ? ? ? ?return ret;
> ?}
>
> --
> 1.7.2.3
>
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 03/17] ARM: pxa: Toradex Colibri PXA270 CF support
  2010-11-02 23:51 ` [PATCH 03/17] ARM: pxa: Toradex Colibri PXA270 CF support Marek Vasut
@ 2010-11-03 14:44   ` Eric Miao
  0 siblings, 0 replies; 29+ messages in thread
From: Eric Miao @ 2010-11-03 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> This driver also contains structures to eventually support PXA320. This is
> planned to be added in a later patch.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Acked-by: Daniel Mack <daniel@caiaq.de>
> ---
> ?arch/arm/mach-pxa/colibri-pxa270-evalboard.c | ? 18 ++
> ?drivers/pcmcia/Kconfig ? ? ? ? ? ? ? ? ? ? ? | ? ?2 +-
> ?drivers/pcmcia/Makefile ? ? ? ? ? ? ? ? ? ? ?| ? ?1 +
> ?drivers/pcmcia/pxa2xx_colibri.c ? ? ? ? ? ? ?| ?214 ++++++++++++++++++++++++++
> ?4 files changed, 234 insertions(+), 1 deletions(-)
> ?create mode 100644 drivers/pcmcia/pxa2xx_colibri.c
>
> diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> index 0f3b632..6177ff5 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> @@ -51,6 +51,24 @@ static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
> ? ? ? ?GPIO89_USBH1_PEN,
> ? ? ? ?GPIO119_USBH2_PWR,
> ? ? ? ?GPIO120_USBH2_PEN,
> +
> + ? ? ? /* PCMCIA */
> + ? ? ? GPIO85_nPCE_1,
> + ? ? ? GPIO54_nPCE_2,
> + ? ? ? GPIO55_nPREG,
> + ? ? ? GPIO50_nPIOR,
> + ? ? ? GPIO51_nPIOW,
> + ? ? ? GPIO49_nPWE,
> + ? ? ? GPIO48_nPOE,
> + ? ? ? GPIO57_nIOIS16,
> + ? ? ? GPIO56_nPWAIT,
> + ? ? ? GPIO104_PSKTSEL,
> + ? ? ? GPIO53_GPIO, ? ?/* RESET */
> + ? ? ? GPIO83_GPIO, ? ?/* BVD1 */
> + ? ? ? GPIO82_GPIO, ? ?/* BVD2 */
> + ? ? ? GPIO1_GPIO, ? ? /* READY */
> + ? ? ? GPIO84_GPIO, ? ?/* DETECT */
> + ? ? ? GPIO107_GPIO, ? /* PPEN */
> ?};
>
> ?/******************************************************************************
> diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig
> index c80a7a6..e9acf03 100644
> --- a/drivers/pcmcia/Kconfig
> +++ b/drivers/pcmcia/Kconfig
> @@ -215,7 +215,7 @@ config PCMCIA_PXA2XX
> ? ? ? ?depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \
> ? ? ? ? ? ? ? ? ? ?|| MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \
> ? ? ? ? ? ? ? ? ? ?|| ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \
> - ? ? ? ? ? ? ? ? ? || MACH_VPAC270 || MACH_BALLOON3)
> + ? ? ? ? ? ? ? ? ? || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI)
> ? ? ? ?select PCMCIA_SOC_COMMON
> ? ? ? ?help
> ? ? ? ? ?Say Y here to include support for the PXA2xx PCMCIA controller
> diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile
> index 8d9386a..2fee7ef 100644
> --- a/drivers/pcmcia/Makefile
> +++ b/drivers/pcmcia/Makefile
> @@ -70,6 +70,7 @@ pxa2xx-obj-$(CONFIG_MACH_E740) ? ? ? ? ? ? ? ? ? ? ? ?+= pxa2xx_e740.o
> ?pxa2xx-obj-$(CONFIG_MACH_STARGATE2) ? ? ? ? ? ?+= pxa2xx_stargate2.o
> ?pxa2xx-obj-$(CONFIG_MACH_VPAC270) ? ? ? ? ? ? ?+= pxa2xx_vpac270.o
> ?pxa2xx-obj-$(CONFIG_MACH_BALLOON3) ? ? ? ? ? ? += pxa2xx_balloon3.o
> +pxa2xx-obj-$(CONFIG_MACH_COLIBRI) ? ? ? ? ? ? ?+= pxa2xx_colibri.o
>
> ?obj-$(CONFIG_PCMCIA_PXA2XX) ? ? ? ? ? ? ? ? ? ?+= pxa2xx_base.o $(pxa2xx-obj-y)
>
> diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c
> new file mode 100644
> index 0000000..4ed876c
> --- /dev/null
> +++ b/drivers/pcmcia/pxa2xx_colibri.c
> @@ -0,0 +1,214 @@
> +/*
> + * linux/drivers/pcmcia/pxa2xx_colibri.c
> + *
> + * Driver for Toradex Colibri PXA270 CF socket
> + *
> + * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + *
> + */
> +
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/delay.h>
> +#include <linux/gpio.h>
> +
> +#include <asm/mach-types.h>
> +
> +#include "soc_common.h"
> +
> +#define ? ? ? ?COLIBRI270_RESET_GPIO ? 53
> +#define ? ? ? ?COLIBRI270_PPEN_GPIO ? ?107
> +#define ? ? ? ?COLIBRI270_BVD1_GPIO ? ?83
> +#define ? ? ? ?COLIBRI270_BVD2_GPIO ? ?82
> +#define ? ? ? ?COLIBRI270_DETECT_GPIO ?84
> +#define ? ? ? ?COLIBRI270_READY_GPIO ? 1
> +
> +static struct {
> + ? ? ? int ? ? reset_gpio;
> + ? ? ? int ? ? ppen_gpio;
> + ? ? ? int ? ? bvd1_gpio;
> + ? ? ? int ? ? bvd2_gpio;
> + ? ? ? int ? ? detect_gpio;
> + ? ? ? int ? ? ready_gpio;
> +} colibri_pcmcia_gpio;
> +
> +static struct pcmcia_irqs colibri_irqs[] = {
> + ? ? ? {
> + ? ? ? ? ? ? ? .sock = 0,
> + ? ? ? ? ? ? ? .str ?= "PCMCIA CD"
> + ? ? ? },
> +};
> +
> +static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
> +{
> + ? ? ? int ret;
> +
> + ? ? ? ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT");
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err1;
> + ? ? ? ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio);
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err2;
> +
> + ? ? ? ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY");
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err2;
> + ? ? ? ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio);
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err3;
> +
> + ? ? ? ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1");
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err3;
> + ? ? ? ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio);
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err4;
> +
> + ? ? ? ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2");
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err4;
> + ? ? ? ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio);
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err5;
> +
> + ? ? ? ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN");
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err5;
> + ? ? ? ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0);
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err6;
> +
> + ? ? ? ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET");
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err6;
> + ? ? ? ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1);
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? goto err7;
> +

You may want to look at the newly introduced API gpio_request_array(), so
that you can use a static array for all these GPIOs, and no worry about the
error exiting path. You can leave it for the next step optimization though.

> + ? ? ? colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio);
> + ? ? ? skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio);
> +
> + ? ? ? return soc_pcmcia_request_irqs(skt, colibri_irqs,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(colibri_irqs));
> +
> +err7:
> + ? ? ? gpio_free(colibri_pcmcia_gpio.detect_gpio);
> +err6:
> + ? ? ? gpio_free(colibri_pcmcia_gpio.ready_gpio);
> +err5:
> + ? ? ? gpio_free(colibri_pcmcia_gpio.bvd1_gpio);
> +err4:
> + ? ? ? gpio_free(colibri_pcmcia_gpio.bvd2_gpio);
> +err3:
> + ? ? ? gpio_free(colibri_pcmcia_gpio.reset_gpio);
> +err2:
> + ? ? ? gpio_free(colibri_pcmcia_gpio.ppen_gpio);
> +err1:
> + ? ? ? return ret;
> +}
> +
> +static void colibri_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
> +{
> + ? ? ? gpio_free(colibri_pcmcia_gpio.detect_gpio);
> + ? ? ? gpio_free(colibri_pcmcia_gpio.ready_gpio);
> + ? ? ? gpio_free(colibri_pcmcia_gpio.bvd1_gpio);
> + ? ? ? gpio_free(colibri_pcmcia_gpio.bvd2_gpio);
> + ? ? ? gpio_free(colibri_pcmcia_gpio.reset_gpio);
> + ? ? ? gpio_free(colibri_pcmcia_gpio.ppen_gpio);

gpio_free_array() as well.

> +}
> +
> +static void colibri_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? struct pcmcia_state *state)
> +{
> +
> + ? ? ? state->detect = !!gpio_get_value(colibri_pcmcia_gpio.detect_gpio);
> + ? ? ? state->ready ?= !!gpio_get_value(colibri_pcmcia_gpio.ready_gpio);
> + ? ? ? state->bvd1 ? = !!gpio_get_value(colibri_pcmcia_gpio.bvd1_gpio);
> + ? ? ? state->bvd2 ? = !!gpio_get_value(colibri_pcmcia_gpio.bvd2_gpio);
> + ? ? ? state->wrprot = 0;
> + ? ? ? state->vs_3v ?= 1;
> + ? ? ? state->vs_Xv ?= 0;
> +}
> +
> +static int
> +colibri_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? const socket_state_t *state)
> +{
> + ? ? ? gpio_set_value(colibri_pcmcia_gpio.ppen_gpio,
> + ? ? ? ? ? ? ? ? ? ? ? !(state->Vcc == 33 && state->Vpp < 50));
> + ? ? ? gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags & SS_RESET);
> + ? ? ? return 0;
> +}
> +
> +static void colibri_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
> +{
> +}
> +
> +static void colibri_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
> +{
> +}
> +
> +static struct pcmcia_low_level colibri_pcmcia_ops = {
> + ? ? ? .owner ? ? ? ? ? ? ? ? ?= THIS_MODULE,
> +
> + ? ? ? .first ? ? ? ? ? ? ? ? ?= 0,
> + ? ? ? .nr ? ? ? ? ? ? ? ? ? ? = 1,
> +
> + ? ? ? .hw_init ? ? ? ? ? ? ? ?= colibri_pcmcia_hw_init,
> + ? ? ? .hw_shutdown ? ? ? ? ? ?= colibri_pcmcia_hw_shutdown,
> +
> + ? ? ? .socket_state ? ? ? ? ? = colibri_pcmcia_socket_state,
> + ? ? ? .configure_socket ? ? ? = colibri_pcmcia_configure_socket,
> +
> + ? ? ? .socket_init ? ? ? ? ? ?= colibri_pcmcia_socket_init,
> + ? ? ? .socket_suspend ? ? ? ? = colibri_pcmcia_socket_suspend,
> +};
> +
> +static struct platform_device *colibri_pcmcia_device;
> +
> +static int __init colibri_pcmcia_init(void)
> +{
> + ? ? ? int ret;
> +
> + ? ? ? colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);
> + ? ? ? if (!colibri_pcmcia_device)
> + ? ? ? ? ? ? ? return -ENOMEM;
> +
> + ? ? ? /* Colibri PXA270 */
> + ? ? ? if (machine_is_colibri()) {
> + ? ? ? ? ? ? ? colibri_pcmcia_gpio.reset_gpio ?= COLIBRI270_RESET_GPIO;
> + ? ? ? ? ? ? ? colibri_pcmcia_gpio.ppen_gpio ? = COLIBRI270_PPEN_GPIO;
> + ? ? ? ? ? ? ? colibri_pcmcia_gpio.bvd1_gpio ? = COLIBRI270_BVD1_GPIO;
> + ? ? ? ? ? ? ? colibri_pcmcia_gpio.bvd2_gpio ? = COLIBRI270_BVD2_GPIO;
> + ? ? ? ? ? ? ? colibri_pcmcia_gpio.detect_gpio = COLIBRI270_DETECT_GPIO;
> + ? ? ? ? ? ? ? colibri_pcmcia_gpio.ready_gpio ?= COLIBRI270_READY_GPIO;
> + ? ? ? }

Why do we need a structure here? I'd rather they are static variables named
like:

gpio_reset = COLIBRI270_RESET_GPIO;

and use like:

gpio_get_value(gpio_reset)?

much cleaner? Anyway, you can leave this for the next refinement though.

> +
> + ? ? ? ret = platform_device_add_data(colibri_pcmcia_device,
> + ? ? ? ? ? ? ? &colibri_pcmcia_ops, sizeof(colibri_pcmcia_ops));
> +
> + ? ? ? if (!ret)
> + ? ? ? ? ? ? ? ret = platform_device_add(colibri_pcmcia_device);
> +
> + ? ? ? if (ret)
> + ? ? ? ? ? ? ? platform_device_put(colibri_pcmcia_device);
> +
> + ? ? ? return ret;
> +}
> +
> +static void __exit colibri_pcmcia_exit(void)
> +{
> + ? ? ? platform_device_unregister(colibri_pcmcia_device);
> +}
> +
> +module_init(colibri_pcmcia_init);
> +module_exit(colibri_pcmcia_exit);
> +
> +MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
> +MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270");
> +MODULE_ALIAS("platform:pxa2xx-pcmcia");
> +MODULE_LICENSE("GPL");
> --
> 1.7.2.3
>
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 04/17] ARM: pxa: Push Colibri evalboard MFP into module files
  2010-11-02 23:51 ` [PATCH 04/17] ARM: pxa: Push Colibri evalboard MFP into module files Marek Vasut
@ 2010-11-03 14:47   ` Eric Miao
  0 siblings, 0 replies; 29+ messages in thread
From: Eric Miao @ 2010-11-03 14:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> This change -- pushing the MFP configuration back into Module files -- is
> necessary because some evalboards can be used with multiple modules, where MFP
> differs from module to module. Therefore MFP isn't board-specific, but
> module-specific and the module should preconfigure itself for the board.
>
> (And there is also the C preprocesor limitation and conflicting #define-s)
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Acked-by: Daniel Mack <daniel@caiaq.de>

OK.

> ---
> ?arch/arm/mach-pxa/Kconfig ? ? ? ? ? ? ? ? ? ?| ? ?8 +-
> ?arch/arm/mach-pxa/colibri-pxa270-evalboard.c | ? 61 ++++-----------
> ?arch/arm/mach-pxa/colibri-pxa270-income.c ? ?| ? 47 -----------
> ?arch/arm/mach-pxa/colibri-pxa270.c ? ? ? ? ? | ? 96 ++++++++++++++++++++++
> ?arch/arm/mach-pxa/colibri-pxa300.c ? ? ? ? ? | ? 61 ++++++---------
> ?arch/arm/mach-pxa/colibri-pxa320.c ? ? ? ? ? | ?112 ++++++++++----------------
> ?arch/arm/mach-pxa/colibri-pxa3xx.c ? ? ? ? ? | ? 49 -----------
> ?arch/arm/mach-pxa/include/mach/colibri.h ? ? | ? ?6 ++
> ?8 files changed, 188 insertions(+), 252 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> index dd235ec..b44d613 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -232,10 +232,6 @@ config MACH_COLIBRI
> ? ? ? ?bool "Toradex Colibri PXA270"
> ? ? ? ?select PXA27x
>
> -config MACH_COLIBRI_PXA270_EVALBOARD
> - ? ? ? bool "Toradex Colibri Evaluation Carrier Board support (PXA270)"
> - ? ? ? depends on MACH_COLIBRI
> -
> ?config MACH_COLIBRI_PXA270_INCOME
> ? ? ? ?bool "Income s.r.o. PXA270 SBC"
> ? ? ? ?depends on MACH_COLIBRI
> @@ -253,6 +249,10 @@ config MACH_COLIBRI320
> ? ? ? ?select PXA3xx
> ? ? ? ?select CPU_PXA320
>
> +config MACH_COLIBRI_PXA270_EVALBOARD
> + ? ? ? bool "Toradex Colibri Evaluation Carrier Board support"
> + ? ? ? depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
> +
> ?config MACH_VPAC270
> ? ? ? ?bool "Voipac PXA270"
> ? ? ? ?select PXA27x
> diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> index 6177ff5..e1a2b52 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> @@ -30,61 +30,28 @@
> ?#include "devices.h"
>
> ?/******************************************************************************
> - * Pin configuration
> - ******************************************************************************/
> -static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
> - ? ? ? /* MMC */
> - ? ? ? GPIO32_MMC_CLK,
> - ? ? ? GPIO92_MMC_DAT_0,
> - ? ? ? GPIO109_MMC_DAT_1,
> - ? ? ? GPIO110_MMC_DAT_2,
> - ? ? ? GPIO111_MMC_DAT_3,
> - ? ? ? GPIO112_MMC_CMD,
> - ? ? ? GPIO0_GPIO, ? ? /* SD detect */
> -
> - ? ? ? /* FFUART */
> - ? ? ? GPIO39_FFUART_TXD,
> - ? ? ? GPIO34_FFUART_RXD,
> -
> - ? ? ? /* UHC */
> - ? ? ? GPIO88_USBH1_PWR,
> - ? ? ? GPIO89_USBH1_PEN,
> - ? ? ? GPIO119_USBH2_PWR,
> - ? ? ? GPIO120_USBH2_PEN,
> -
> - ? ? ? /* PCMCIA */
> - ? ? ? GPIO85_nPCE_1,
> - ? ? ? GPIO54_nPCE_2,
> - ? ? ? GPIO55_nPREG,
> - ? ? ? GPIO50_nPIOR,
> - ? ? ? GPIO51_nPIOW,
> - ? ? ? GPIO49_nPWE,
> - ? ? ? GPIO48_nPOE,
> - ? ? ? GPIO57_nIOIS16,
> - ? ? ? GPIO56_nPWAIT,
> - ? ? ? GPIO104_PSKTSEL,
> - ? ? ? GPIO53_GPIO, ? ?/* RESET */
> - ? ? ? GPIO83_GPIO, ? ?/* BVD1 */
> - ? ? ? GPIO82_GPIO, ? ?/* BVD2 */
> - ? ? ? GPIO1_GPIO, ? ? /* READY */
> - ? ? ? GPIO84_GPIO, ? ?/* DETECT */
> - ? ? ? GPIO107_GPIO, ? /* PPEN */
> -};
> -
> -/******************************************************************************
> ?* SD/MMC card controller
> ?******************************************************************************/
> ?#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
> ?static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
> ? ? ? ?.ocr_mask ? ? ? ? ? ? ? = MMC_VDD_32_33 | MMC_VDD_33_34,
> ? ? ? ?.gpio_power ? ? ? ? ? ? = -1,
> - ? ? ? .gpio_card_detect ? ? ? = GPIO0_COLIBRI_PXA270_SD_DETECT,
> ? ? ? ?.gpio_card_ro ? ? ? ? ? = -1,
> ? ? ? ?.detect_delay_ms ? ? ? ?= 200,
> ?};
>
> ?static void __init colibri_pxa270_mmc_init(void)
> ?{
> + ? ? ? if (machine_is_colibri()) ? ? ? /* PXA270 Colibri */
> + ? ? ? ? ? ? ? colibri_pxa270_mci_platform_data.gpio_card_detect =
> + ? ? ? ? ? ? ? ? ? ? ? GPIO0_COLIBRI_PXA270_SD_DETECT;
> + ? ? ? if (machine_is_colibri300()) ? ?/* PXA300 Colibri */
> + ? ? ? ? ? ? ? colibri_pxa270_mci_platform_data.gpio_card_detect =
> + ? ? ? ? ? ? ? ? ? ? ? GPIO39_COLIBRI_PXA300_SD_DETECT;
> + ? ? ? else ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* PXA320 Colibri */
> + ? ? ? ? ? ? ? colibri_pxa270_mci_platform_data.gpio_card_detect =
> + ? ? ? ? ? ? ? ? ? ? ? GPIO28_COLIBRI_PXA320_SD_DETECT;
> +
> ? ? ? ?pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
> ?}
> ?#else
> @@ -103,13 +70,17 @@ static int colibri_pxa270_ohci_init(struct device *dev)
>
> ?static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
> ? ? ? ?.port_mode ? ? ?= PMM_PERPORT_MODE,
> - ? ? ? .flags ? ? ? ? ?= ENABLE_PORT1 | ENABLE_PORT2 |
> + ? ? ? .flags ? ? ? ? ?= ENABLE_PORT1 |
> ? ? ? ? ? ? ? ? ? ? ? ? ?POWER_CONTROL_LOW | POWER_SENSE_LOW,
> ? ? ? ?.init ? ? ? ? ? = colibri_pxa270_ohci_init,
> ?};
>
> ?static void __init colibri_pxa270_uhc_init(void)
> ?{
> + ? ? ? /* Colibri PXA270 has two usb ports, TBA for 320 */
> + ? ? ? if (machine_is_colibri())
> + ? ? ? ? ? ? ? colibri_pxa270_ohci_info.flags ?|= ENABLE_PORT2;
> +
> ? ? ? ?pxa_set_ohci_info(&colibri_pxa270_ohci_info);
> ?}
> ?#else
> @@ -118,7 +89,6 @@ static inline void colibri_pxa270_uhc_init(void) {}
>
> ?void __init colibri_pxa270_evalboard_init(void)
> ?{
> - ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
> ? ? ? ?pxa_set_ffuart_info(NULL);
> ? ? ? ?pxa_set_btuart_info(NULL);
> ? ? ? ?pxa_set_stuart_info(NULL);
> @@ -126,4 +96,3 @@ void __init colibri_pxa270_evalboard_init(void)
> ? ? ? ?colibri_pxa270_mmc_init();
> ? ? ? ?colibri_pxa270_uhc_init();
> ?}
> -
> diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
> index 37f0f3e..07b62a0 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270-income.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
> @@ -46,52 +46,6 @@
> ?#define GPIO113_INCOME_TS_IRQ ? (113)
>
> ?/******************************************************************************
> - * Pin configuration
> - ******************************************************************************/
> -static mfp_cfg_t income_pin_config[] __initdata = {
> - ? ? ? /* MMC */
> - ? ? ? GPIO32_MMC_CLK,
> - ? ? ? GPIO92_MMC_DAT_0,
> - ? ? ? GPIO109_MMC_DAT_1,
> - ? ? ? GPIO110_MMC_DAT_2,
> - ? ? ? GPIO111_MMC_DAT_3,
> - ? ? ? GPIO112_MMC_CMD,
> - ? ? ? GPIO0_GPIO, ? ? /* SD detect */
> - ? ? ? GPIO1_GPIO, ? ? /* SD read-only */
> -
> - ? ? ? /* FFUART */
> - ? ? ? GPIO39_FFUART_TXD,
> - ? ? ? GPIO34_FFUART_RXD,
> -
> - ? ? ? /* BFUART */
> - ? ? ? GPIO42_BTUART_RXD,
> - ? ? ? GPIO43_BTUART_TXD,
> - ? ? ? GPIO45_BTUART_RTS,
> -
> - ? ? ? /* STUART */
> - ? ? ? GPIO46_STUART_RXD,
> - ? ? ? GPIO47_STUART_TXD,
> -
> - ? ? ? /* UHC */
> - ? ? ? GPIO88_USBH1_PWR,
> - ? ? ? GPIO89_USBH1_PEN,
> -
> - ? ? ? /* LCD */
> - ? ? ? GPIOxx_LCD_TFT_16BPP,
> -
> - ? ? ? /* PWM */
> - ? ? ? GPIO16_PWM0_OUT,
> -
> - ? ? ? /* I2C */
> - ? ? ? GPIO117_I2C_SCL,
> - ? ? ? GPIO118_I2C_SDA,
> -
> - ? ? ? /* LED */
> - ? ? ? GPIO54_GPIO, ? ?/* LED A */
> - ? ? ? GPIO55_GPIO, ? ?/* LED B */
> -};
> -
> -/******************************************************************************
> ?* SD/MMC card controller
> ?******************************************************************************/
> ?#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
> @@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {}
>
> ?void __init colibri_pxa270_income_boardinit(void)
> ?{
> - ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
> ? ? ? ?pxa_set_ffuart_info(NULL);
> ? ? ? ?pxa_set_btuart_info(NULL);
> ? ? ? ?pxa_set_stuart_info(NULL);
> diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
> index 73205bc..e940004 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270.c
> @@ -33,6 +33,99 @@
> ?#include "generic.h"
>
> ?/******************************************************************************
> + * Evaluation board MFP
> + ******************************************************************************/
> +#ifdef ?CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
> +static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
> + ? ? ? /* MMC */
> + ? ? ? GPIO32_MMC_CLK,
> + ? ? ? GPIO92_MMC_DAT_0,
> + ? ? ? GPIO109_MMC_DAT_1,
> + ? ? ? GPIO110_MMC_DAT_2,
> + ? ? ? GPIO111_MMC_DAT_3,
> + ? ? ? GPIO112_MMC_CMD,
> + ? ? ? GPIO0_GPIO, ? ? /* SD detect */
> +
> + ? ? ? /* FFUART */
> + ? ? ? GPIO39_FFUART_TXD,
> + ? ? ? GPIO34_FFUART_RXD,
> +
> + ? ? ? /* UHC */
> + ? ? ? GPIO88_USBH1_PWR,
> + ? ? ? GPIO89_USBH1_PEN,
> + ? ? ? GPIO119_USBH2_PWR,
> + ? ? ? GPIO120_USBH2_PEN,
> +
> + ? ? ? /* PCMCIA */
> + ? ? ? GPIO85_nPCE_1,
> + ? ? ? GPIO54_nPCE_2,
> + ? ? ? GPIO55_nPREG,
> + ? ? ? GPIO50_nPIOR,
> + ? ? ? GPIO51_nPIOW,
> + ? ? ? GPIO49_nPWE,
> + ? ? ? GPIO48_nPOE,
> + ? ? ? GPIO57_nIOIS16,
> + ? ? ? GPIO56_nPWAIT,
> + ? ? ? GPIO104_PSKTSEL,
> + ? ? ? GPIO53_GPIO, ? ?/* RESET */
> + ? ? ? GPIO83_GPIO, ? ?/* BVD1 */
> + ? ? ? GPIO82_GPIO, ? ?/* BVD2 */
> + ? ? ? GPIO1_GPIO, ? ? /* READY */
> + ? ? ? GPIO84_GPIO, ? ?/* DETECT */
> + ? ? ? GPIO107_GPIO, ? /* PPEN */
> +};
> +#else
> +static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {};
> +#endif
> +
> +#ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME
> +static mfp_cfg_t income_pin_config[] __initdata = {
> + ? ? ? /* MMC */
> + ? ? ? GPIO32_MMC_CLK,
> + ? ? ? GPIO92_MMC_DAT_0,
> + ? ? ? GPIO109_MMC_DAT_1,
> + ? ? ? GPIO110_MMC_DAT_2,
> + ? ? ? GPIO111_MMC_DAT_3,
> + ? ? ? GPIO112_MMC_CMD,
> + ? ? ? GPIO0_GPIO, ? ? /* SD detect */
> + ? ? ? GPIO1_GPIO, ? ? /* SD read-only */
> +
> + ? ? ? /* FFUART */
> + ? ? ? GPIO39_FFUART_TXD,
> + ? ? ? GPIO34_FFUART_RXD,
> +
> + ? ? ? /* BFUART */
> + ? ? ? GPIO42_BTUART_RXD,
> + ? ? ? GPIO43_BTUART_TXD,
> + ? ? ? GPIO45_BTUART_RTS,
> +
> + ? ? ? /* STUART */
> + ? ? ? GPIO46_STUART_RXD,
> + ? ? ? GPIO47_STUART_TXD,
> +
> + ? ? ? /* UHC */
> + ? ? ? GPIO88_USBH1_PWR,
> + ? ? ? GPIO89_USBH1_PEN,
> +
> + ? ? ? /* LCD */
> + ? ? ? GPIOxx_LCD_TFT_16BPP,
> +
> + ? ? ? /* PWM */
> + ? ? ? GPIO16_PWM0_OUT,
> +
> + ? ? ? /* I2C */
> + ? ? ? GPIO117_I2C_SCL,
> + ? ? ? GPIO118_I2C_SDA,
> +
> + ? ? ? /* LED */
> + ? ? ? GPIO54_GPIO, ? ?/* LED A */
> + ? ? ? GPIO55_GPIO, ? ?/* LED B */
> +};
> +#else
> +static mfp_cfg_t income_pin_config[] __initdata = {};
> +#endif
> +
> +/******************************************************************************
> ?* Pin configuration
> ?******************************************************************************/
> ?static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = {
> @@ -185,9 +278,12 @@ static void __init colibri_pxa270_init(void)
>
> ? ? ? ?switch (colibri_pxa270_baseboard) {
> ? ? ? ?case COLIBRI_PXA270_EVALBOARD:
> + ? ? ? ? ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(
> + ? ? ? ? ? ? ? ? ? ? ? colibri_pxa270_evalboard_pin_config));
> ? ? ? ? ? ? ? ?colibri_pxa270_evalboard_init();
> ? ? ? ? ? ? ? ?break;
> ? ? ? ?case COLIBRI_PXA270_INCOME:
> + ? ? ? ? ? ? ? pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
> ? ? ? ? ? ? ? ?colibri_pxa270_income_boardinit();
> ? ? ? ? ? ? ? ?break;
> ? ? ? ?default:
> diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
> index d039bd1..649c83c 100644
> --- a/arch/arm/mach-pxa/colibri-pxa300.c
> +++ b/arch/arm/mach-pxa/colibri-pxa300.c
> @@ -31,9 +31,28 @@
> ?#include "generic.h"
> ?#include "devices.h"
>
> +
> +#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
> +static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
> + ? ? ? /* MMC */
> + ? ? ? GPIO7_MMC1_CLK,
> + ? ? ? GPIO14_MMC1_CMD,
> + ? ? ? GPIO3_MMC1_DAT0,
> + ? ? ? GPIO4_MMC1_DAT1,
> + ? ? ? GPIO5_MMC1_DAT2,
> + ? ? ? GPIO6_MMC1_DAT3,
> + ? ? ? GPIO39_GPIO, ? ?/* SD detect */
> +
> + ? ? ? /* UHC */
> + ? ? ? GPIO0_2_USBH_PEN,
> + ? ? ? GPIO1_2_USBH_PWR,
> +};
> +#else
> +static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {};
> +#endif
> +
> ?#if defined(CONFIG_AX88796)
> ?#define COLIBRI_ETH_IRQ_GPIO ? mfp_to_gpio(GPIO26_GPIO)
> -
> ?/*
> ?* Asix AX88796 Ethernet
> ?*/
> @@ -80,35 +99,6 @@ static void __init colibri_pxa300_init_eth(void)
> ?static inline void __init colibri_pxa300_init_eth(void) {}
> ?#endif /* CONFIG_AX88796 */
>
> -#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> -static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = {
> - ? ? ? GPIO0_2_USBH_PEN,
> - ? ? ? GPIO1_2_USBH_PWR,
> -};
> -
> -static struct pxaohci_platform_data colibri_pxa300_ohci_info = {
> - ? ? ? .port_mode ? ? ?= PMM_GLOBAL_MODE,
> - ? ? ? .flags ? ? ? ? ?= ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
> -};
> -
> -void __init colibri_pxa300_init_ohci(void)
> -{
> - ? ? ? pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config));
> - ? ? ? pxa_set_ohci_info(&colibri_pxa300_ohci_info);
> -}
> -#else
> -static inline void colibri_pxa300_init_ohci(void) {}
> -#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
> -
> -static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = {
> - ? ? ? GPIO7_MMC1_CLK,
> - ? ? ? GPIO14_MMC1_CMD,
> - ? ? ? GPIO3_MMC1_DAT0,
> - ? ? ? GPIO4_MMC1_DAT1,
> - ? ? ? GPIO5_MMC1_DAT2,
> - ? ? ? GPIO6_MMC1_DAT3,
> -};
> -
> ?#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
> ?static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = {
> ? ? ? ?GPIO54_LCD_LDD_0,
> @@ -171,18 +161,15 @@ static inline void colibri_pxa310_init_ac97(void) {}
>
> ?void __init colibri_pxa300_init(void)
> ?{
> - ? ? ? pxa_set_ffuart_info(NULL);
> - ? ? ? pxa_set_btuart_info(NULL);
> - ? ? ? pxa_set_stuart_info(NULL);
> -
> ? ? ? ?colibri_pxa300_init_eth();
> - ? ? ? colibri_pxa300_init_ohci();
> ? ? ? ?colibri_pxa3xx_init_nand();
> ? ? ? ?colibri_pxa300_init_lcd();
> ? ? ? ?colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
> ? ? ? ?colibri_pxa310_init_ac97();
> - ? ? ? colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config),
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mfp_to_gpio(MFP_PIN_GPIO13));
> +
> + ? ? ? /* Evalboard init */
> + ? ? ? pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
> + ? ? ? colibri_pxa270_evalboard_init();
> ?}
>
> ?MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
> diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
> index ccb2c59..6f15f2a 100644
> --- a/arch/arm/mach-pxa/colibri-pxa320.c
> +++ b/arch/arm/mach-pxa/colibri-pxa320.c
> @@ -35,9 +35,47 @@
> ?#include "generic.h"
> ?#include "devices.h"
>
> +#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
> +static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
> + ? ? ? /* MMC */
> + ? ? ? GPIO22_MMC1_CLK,
> + ? ? ? GPIO23_MMC1_CMD,
> + ? ? ? GPIO18_MMC1_DAT0,
> + ? ? ? GPIO19_MMC1_DAT1,
> + ? ? ? GPIO20_MMC1_DAT2,
> + ? ? ? GPIO21_MMC1_DAT3,
> + ? ? ? GPIO28_GPIO, ? ?/* SD detect */
> +
> + ? ? ? /* UART 1 configuration (may be set by bootloader) */
> + ? ? ? GPIO99_UART1_CTS,
> + ? ? ? GPIO104_UART1_RTS,
> + ? ? ? GPIO97_UART1_RXD,
> + ? ? ? GPIO98_UART1_TXD,
> + ? ? ? GPIO101_UART1_DTR,
> + ? ? ? GPIO103_UART1_DSR,
> + ? ? ? GPIO100_UART1_DCD,
> + ? ? ? GPIO102_UART1_RI,
> +
> + ? ? ? /* UART 2 configuration */
> + ? ? ? GPIO109_UART2_CTS,
> + ? ? ? GPIO112_UART2_RTS,
> + ? ? ? GPIO110_UART2_RXD,
> + ? ? ? GPIO111_UART2_TXD,
> +
> + ? ? ? /* UART 3 configuration */
> + ? ? ? GPIO30_UART3_RXD,
> + ? ? ? GPIO31_UART3_TXD,
> +
> + ? ? ? /* UHC */
> + ? ? ? GPIO2_2_USBH_PEN,
> + ? ? ? GPIO3_2_USBH_PWR,
> +};
> +#else
> +static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {};
> +#endif
> +
> ?#if defined(CONFIG_AX88796)
> ?#define COLIBRI_ETH_IRQ_GPIO ? mfp_to_gpio(GPIO36_GPIO)
> -
> ?/*
> ?* Asix AX88796 Ethernet
> ?*/
> @@ -84,26 +122,6 @@ static void __init colibri_pxa320_init_eth(void)
> ?static inline void __init colibri_pxa320_init_eth(void) {}
> ?#endif /* CONFIG_AX88796 */
>
> -#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> -static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = {
> - ? ? ? GPIO2_2_USBH_PEN,
> - ? ? ? GPIO3_2_USBH_PWR,
> -};
> -
> -static struct pxaohci_platform_data colibri_pxa320_ohci_info = {
> - ? ? ? .port_mode ? ? ?= PMM_GLOBAL_MODE,
> - ? ? ? .flags ? ? ? ? ?= ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
> -};
> -
> -void __init colibri_pxa320_init_ohci(void)
> -{
> - ? ? ? pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config));
> - ? ? ? pxa_set_ohci_info(&colibri_pxa320_ohci_info);
> -}
> -#else
> -static inline void colibri_pxa320_init_ohci(void) {}
> -#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
> -
> ?#if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE)
> ?static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = {
> ? ? ? ?.gpio_vbus ? ? ? ? ? ? ?= mfp_to_gpio(MFP_PIN_GPIO96),
> @@ -140,15 +158,6 @@ static void __init colibri_pxa320_init_udc(void)
> ?static inline void colibri_pxa320_init_udc(void) {}
> ?#endif
>
> -static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
> - ? ? ? GPIO22_MMC1_CLK,
> - ? ? ? GPIO23_MMC1_CMD,
> - ? ? ? GPIO18_MMC1_DAT0,
> - ? ? ? GPIO19_MMC1_DAT1,
> - ? ? ? GPIO20_MMC1_DAT2,
> - ? ? ? GPIO21_MMC1_DAT3
> -};
> -
> ?#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
> ?static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = {
> ? ? ? ?GPIO6_2_LCD_LDD_0,
> @@ -205,53 +214,18 @@ static inline void __init colibri_pxa320_init_ac97(void)
> ?static inline void colibri_pxa320_init_ac97(void) {}
> ?#endif
>
> -/*
> - * The following configuration is verified to work with the Toradex Orchid
> - * carrier board
> - */
> -static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = {
> - ? ? ? /* UART 1 configuration (may be set by bootloader) */
> - ? ? ? GPIO99_UART1_CTS,
> - ? ? ? GPIO104_UART1_RTS,
> - ? ? ? GPIO97_UART1_RXD,
> - ? ? ? GPIO98_UART1_TXD,
> - ? ? ? GPIO101_UART1_DTR,
> - ? ? ? GPIO103_UART1_DSR,
> - ? ? ? GPIO100_UART1_DCD,
> - ? ? ? GPIO102_UART1_RI,
> -
> - ? ? ? /* UART 2 configuration */
> - ? ? ? GPIO109_UART2_CTS,
> - ? ? ? GPIO112_UART2_RTS,
> - ? ? ? GPIO110_UART2_RXD,
> - ? ? ? GPIO111_UART2_TXD,
> -
> - ? ? ? /* UART 3 configuration */
> - ? ? ? GPIO30_UART3_RXD,
> - ? ? ? GPIO31_UART3_TXD,
> -};
> -
> -static void __init colibri_pxa320_init_uart(void)
> -{
> - ? ? ? pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
> -}
> -
> ?void __init colibri_pxa320_init(void)
> ?{
> - ? ? ? pxa_set_ffuart_info(NULL);
> - ? ? ? pxa_set_btuart_info(NULL);
> - ? ? ? pxa_set_stuart_info(NULL);
> -
> ? ? ? ?colibri_pxa320_init_eth();
> - ? ? ? colibri_pxa320_init_ohci();
> ? ? ? ?colibri_pxa3xx_init_nand();
> ? ? ? ?colibri_pxa320_init_lcd();
> ? ? ? ?colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
> ? ? ? ?colibri_pxa320_init_ac97();
> - ? ? ? colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? mfp_to_gpio(MFP_PIN_GPIO28));
> - ? ? ? colibri_pxa320_init_uart();
> ? ? ? ?colibri_pxa320_init_udc();
> +
> + ? ? ? /* Evalboard init */
> + ? ? ? pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
> + ? ? ? colibri_pxa270_evalboard_init();
> ?}
>
> ?MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
> diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
> index 199afa2..96b2d9f 100644
> --- a/arch/arm/mach-pxa/colibri-pxa3xx.c
> +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
> @@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data)
> ?}
> ?#endif
>
> -#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
> -static int mmc_detect_pin;
> -
> -static int colibri_pxa3xx_mci_init(struct device *dev,
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?irq_handler_t colibri_mmc_detect_int,
> - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?void *data)
> -{
> - ? ? ? int ret;
> -
> - ? ? ? ret = gpio_request(mmc_detect_pin, "mmc card detect");
> - ? ? ? if (ret)
> - ? ? ? ? ? ? ? return ret;
> -
> - ? ? ? gpio_direction_input(mmc_detect_pin);
> - ? ? ? ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int,
> - ? ? ? ? ? ? ? ? ? ? ? ? IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
> - ? ? ? ? ? ? ? ? ? ? ? ? "MMC card detect", data);
> - ? ? ? if (ret) {
> - ? ? ? ? ? ? ? gpio_free(mmc_detect_pin);
> - ? ? ? ? ? ? ? return ret;
> - ? ? ? }
> -
> - ? ? ? return 0;
> -}
> -
> -static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
> -{
> - ? ? ? free_irq(mmc_detect_pin, data);
> - ? ? ? gpio_free(gpio_to_irq(mmc_detect_pin));
> -}
> -
> -static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
> - ? ? ? .detect_delay_ms ? ? ? ?= 200,
> - ? ? ? .ocr_mask ? ? ? ? ? ? ? = MMC_VDD_32_33 | MMC_VDD_33_34,
> - ? ? ? .init ? ? ? ? ? ? ? ? ? = colibri_pxa3xx_mci_init,
> - ? ? ? .exit ? ? ? ? ? ? ? ? ? = colibri_pxa3xx_mci_exit,
> - ? ? ? .gpio_card_detect ? ? ? = -1,
> - ? ? ? .gpio_card_ro ? ? ? ? ? = -1,
> - ? ? ? .gpio_power ? ? ? ? ? ? = -1,
> -};
> -
> -void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
> -{
> - ? ? ? pxa3xx_mfp_config(pins, len);
> - ? ? ? mmc_detect_pin = detect_pin;
> - ? ? ? pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data);
> -}
> -#endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */
> -
> ?#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
> ?static int lcd_bl_pin;
>
> diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
> index 58dada1..63a948a 100644
> --- a/arch/arm/mach-pxa/include/mach/colibri.h
> +++ b/arch/arm/mach-pxa/include/mach/colibri.h
> @@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {}
> ?#define GPIO0_COLIBRI_PXA270_SD_DETECT 0
> ?#define GPIO113_COLIBRI_PXA270_TS_IRQ ?113
>
> +/* GPIO definitions for Colibri PXA300/310 */
> +#define GPIO39_COLIBRI_PXA300_SD_DETECT ? ? ? ?39
> +
> +/* GPIO definitions for Colibri PXA320 */
> +#define GPIO28_COLIBRI_PXA320_SD_DETECT ? ? ? ?28
> +
> ?#endif /* _COLIBRI_H_ */
>
> --
> 1.7.2.3
>
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 06/17] ARM: pxa: Rename Colibri evalboard
  2010-11-02 23:51 ` [PATCH 06/17] ARM: pxa: Rename " Marek Vasut
@ 2010-11-03 14:53   ` Eric Miao
  0 siblings, 0 replies; 29+ messages in thread
From: Eric Miao @ 2010-11-03 14:53 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Rename colibri-pxa270-evalboard to colibri-evalboard as this board is used with
> all Colibri modules.
>
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> Acked-by: Daniel Mack <daniel@caiaq.de>

Marek,

The rest of the patches look good to me, could you get them into branch
firstly for pull? You can leave the SMEMC changes later if they don't have
any dependency issue.


> ---
> ?arch/arm/mach-pxa/Kconfig ? ? ? ? ? ? ? ? ? ?| ? ?2 +-
> ?arch/arm/mach-pxa/Makefile ? ? ? ? ? ? ? ? ? | ? ?2 +-
> ?arch/arm/mach-pxa/colibri-evalboard.c ? ? ? ?| ?121 ++++++++++++++++++++++++++
> ?arch/arm/mach-pxa/colibri-pxa270-evalboard.c | ?121 --------------------------
> ?arch/arm/mach-pxa/colibri-pxa270.c ? ? ? ? ? | ? ?6 +-
> ?arch/arm/mach-pxa/colibri-pxa300.c ? ? ? ? ? | ? ?4 +-
> ?arch/arm/mach-pxa/colibri-pxa320.c ? ? ? ? ? | ? ?4 +-
> ?arch/arm/mach-pxa/include/mach/colibri.h ? ? | ? ?8 +-
> ?8 files changed, 134 insertions(+), 134 deletions(-)
> ?create mode 100644 arch/arm/mach-pxa/colibri-evalboard.c
> ?delete mode 100644 arch/arm/mach-pxa/colibri-pxa270-evalboard.c
>
> diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
> index b44d613..e0ac5aa 100644
> --- a/arch/arm/mach-pxa/Kconfig
> +++ b/arch/arm/mach-pxa/Kconfig
> @@ -249,7 +249,7 @@ config MACH_COLIBRI320
> ? ? ? ?select PXA3xx
> ? ? ? ?select CPU_PXA320
>
> -config MACH_COLIBRI_PXA270_EVALBOARD
> +config MACH_COLIBRI_EVALBOARD
> ? ? ? ?bool "Toradex Colibri Evaluation Carrier Board support"
> ? ? ? ?depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320
>
> diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
> index e2f89c2..3197756 100644
> --- a/arch/arm/mach-pxa/Makefile
> +++ b/arch/arm/mach-pxa/Makefile
> @@ -60,7 +60,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270) ? ? += lpd270.o
> ?obj-$(CONFIG_MACH_PCM027) ? ? ? ? ? ? ?+= pcm027.o
> ?obj-$(CONFIG_MACH_PCM990_BASEBOARD) ? ?+= pcm990-baseboard.o
> ?obj-$(CONFIG_MACH_COLIBRI) ? ? ? ? ? ? ? ? ? ? += colibri-pxa270.o
> -obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) ? ?+= colibri-pxa270-evalboard.o
> +obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) ? += colibri-evalboard.o
> ?obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) ? ? ? += colibri-pxa270-income.o
> ?obj-$(CONFIG_MACH_COLIBRI300) ?+= colibri-pxa3xx.o colibri-pxa300.o
> ?obj-$(CONFIG_MACH_COLIBRI320) ?+= colibri-pxa3xx.o colibri-pxa320.o
> diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
> new file mode 100644
> index 0000000..6b2c800
> --- /dev/null
> +++ b/arch/arm/mach-pxa/colibri-evalboard.c
> @@ -0,0 +1,121 @@
> +/*
> + * ?linux/arch/arm/mach-pxa/colibri-evalboard.c
> + *
> + * ?Support for Toradex Colibri Evaluation Carrier Board
> + * ?Daniel Mack <daniel@caiaq.de>
> + * ?Marek Vasut <marek.vasut@gmail.com>
> + *
> + * ?This program is free software; you can redistribute it and/or modify
> + * ?it under the terms of the GNU General Public License version 2 as
> + * ?published by the Free Software Foundation.
> + */
> +
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <linux/sysdev.h>
> +#include <linux/interrupt.h>
> +#include <linux/gpio.h>
> +#include <asm/mach-types.h>
> +#include <mach/hardware.h>
> +#include <asm/mach/arch.h>
> +#include <linux/i2c.h>
> +
> +#include <mach/pxa27x.h>
> +#include <mach/colibri.h>
> +#include <mach/mmc.h>
> +#include <mach/ohci.h>
> +#include <mach/pxa27x-udc.h>
> +
> +#include <plat/i2c.h>
> +
> +#include "generic.h"
> +#include "devices.h"
> +
> +/******************************************************************************
> + * SD/MMC card controller
> + ******************************************************************************/
> +#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
> +static struct pxamci_platform_data colibri_mci_platform_data = {
> + ? ? ? .ocr_mask ? ? ? ? ? ? ? = MMC_VDD_32_33 | MMC_VDD_33_34,
> + ? ? ? .gpio_power ? ? ? ? ? ? = -1,
> + ? ? ? .gpio_card_ro ? ? ? ? ? = -1,
> + ? ? ? .detect_delay_ms ? ? ? ?= 200,
> +};
> +
> +static void __init colibri_mmc_init(void)
> +{
> + ? ? ? if (machine_is_colibri()) ? ? ? /* PXA270 Colibri */
> + ? ? ? ? ? ? ? colibri_mci_platform_data.gpio_card_detect =
> + ? ? ? ? ? ? ? ? ? ? ? GPIO0_COLIBRI_PXA270_SD_DETECT;
> + ? ? ? if (machine_is_colibri300()) ? ?/* PXA300 Colibri */
> + ? ? ? ? ? ? ? colibri_mci_platform_data.gpio_card_detect =
> + ? ? ? ? ? ? ? ? ? ? ? GPIO39_COLIBRI_PXA300_SD_DETECT;
> + ? ? ? else ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* PXA320 Colibri */
> + ? ? ? ? ? ? ? colibri_mci_platform_data.gpio_card_detect =
> + ? ? ? ? ? ? ? ? ? ? ? GPIO28_COLIBRI_PXA320_SD_DETECT;
> +
> + ? ? ? pxa_set_mci_info(&colibri_mci_platform_data);
> +}
> +#else
> +static inline void colibri_mmc_init(void) {}
> +#endif
> +
> +/******************************************************************************
> + * USB Host
> + ******************************************************************************/
> +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> +static int colibri_ohci_init(struct device *dev)
> +{
> + ? ? ? UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
> + ? ? ? return 0;
> +}
> +
> +static struct pxaohci_platform_data colibri_ohci_info = {
> + ? ? ? .port_mode ? ? ?= PMM_PERPORT_MODE,
> + ? ? ? .flags ? ? ? ? ?= ENABLE_PORT1 |
> + ? ? ? ? ? ? ? ? ? ? ? ? POWER_CONTROL_LOW | POWER_SENSE_LOW,
> + ? ? ? .init ? ? ? ? ? = colibri_ohci_init,
> +};
> +
> +static void __init colibri_uhc_init(void)
> +{
> + ? ? ? /* Colibri PXA270 has two usb ports, TBA for 320 */
> + ? ? ? if (machine_is_colibri())
> + ? ? ? ? ? ? ? colibri_ohci_info.flags |= ENABLE_PORT2;
> +
> + ? ? ? pxa_set_ohci_info(&colibri_ohci_info);
> +}
> +#else
> +static inline void colibri_uhc_init(void) {}
> +#endif
> +
> +/******************************************************************************
> + * I2C RTC
> + ******************************************************************************/
> +#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
> +static struct i2c_board_info __initdata colibri_i2c_devs[] = {
> + ? ? ? {
> + ? ? ? ? ? ? ? I2C_BOARD_INFO("m41t00", 0x68),
> + ? ? ? },
> +};
> +
> +static void __init colibri_rtc_init(void)
> +{
> + ? ? ? pxa_set_i2c_info(NULL);
> + ? ? ? i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs));
> +}
> +#else
> +static inline void colibri_rtc_init(void) {}
> +#endif
> +
> +void __init colibri_evalboard_init(void)
> +{
> + ? ? ? pxa_set_ffuart_info(NULL);
> + ? ? ? pxa_set_btuart_info(NULL);
> + ? ? ? pxa_set_stuart_info(NULL);
> +
> + ? ? ? colibri_mmc_init();
> + ? ? ? colibri_uhc_init();
> + ? ? ? colibri_rtc_init();
> +}
> diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> deleted file mode 100644
> index 7f27aec..0000000
> --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> +++ /dev/null
> @@ -1,121 +0,0 @@
> -/*
> - * ?linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
> - *
> - * ?Support for Toradex PXA270 based Colibri Evaluation Carrier Board
> - * ?Daniel Mack <daniel@caiaq.de>
> - * ?Marek Vasut <marek.vasut@gmail.com>
> - *
> - * ?This program is free software; you can redistribute it and/or modify
> - * ?it under the terms of the GNU General Public License version 2 as
> - * ?published by the Free Software Foundation.
> - */
> -
> -#include <linux/init.h>
> -#include <linux/kernel.h>
> -#include <linux/platform_device.h>
> -#include <linux/sysdev.h>
> -#include <linux/interrupt.h>
> -#include <linux/gpio.h>
> -#include <asm/mach-types.h>
> -#include <mach/hardware.h>
> -#include <asm/mach/arch.h>
> -#include <linux/i2c.h>
> -
> -#include <mach/pxa27x.h>
> -#include <mach/colibri.h>
> -#include <mach/mmc.h>
> -#include <mach/ohci.h>
> -#include <mach/pxa27x-udc.h>
> -
> -#include <plat/i2c.h>
> -
> -#include "generic.h"
> -#include "devices.h"
> -
> -/******************************************************************************
> - * SD/MMC card controller
> - ******************************************************************************/
> -#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
> -static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
> - ? ? ? .ocr_mask ? ? ? ? ? ? ? = MMC_VDD_32_33 | MMC_VDD_33_34,
> - ? ? ? .gpio_power ? ? ? ? ? ? = -1,
> - ? ? ? .gpio_card_ro ? ? ? ? ? = -1,
> - ? ? ? .detect_delay_ms ? ? ? ?= 200,
> -};
> -
> -static void __init colibri_pxa270_mmc_init(void)
> -{
> - ? ? ? if (machine_is_colibri()) ? ? ? /* PXA270 Colibri */
> - ? ? ? ? ? ? ? colibri_pxa270_mci_platform_data.gpio_card_detect =
> - ? ? ? ? ? ? ? ? ? ? ? GPIO0_COLIBRI_PXA270_SD_DETECT;
> - ? ? ? if (machine_is_colibri300()) ? ?/* PXA300 Colibri */
> - ? ? ? ? ? ? ? colibri_pxa270_mci_platform_data.gpio_card_detect =
> - ? ? ? ? ? ? ? ? ? ? ? GPIO39_COLIBRI_PXA300_SD_DETECT;
> - ? ? ? else ? ? ? ? ? ? ? ? ? ? ? ? ? ?/* PXA320 Colibri */
> - ? ? ? ? ? ? ? colibri_pxa270_mci_platform_data.gpio_card_detect =
> - ? ? ? ? ? ? ? ? ? ? ? GPIO28_COLIBRI_PXA320_SD_DETECT;
> -
> - ? ? ? pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
> -}
> -#else
> -static inline void colibri_pxa270_mmc_init(void) {}
> -#endif
> -
> -/******************************************************************************
> - * USB Host
> - ******************************************************************************/
> -#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
> -static int colibri_pxa270_ohci_init(struct device *dev)
> -{
> - ? ? ? UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
> - ? ? ? return 0;
> -}
> -
> -static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
> - ? ? ? .port_mode ? ? ?= PMM_PERPORT_MODE,
> - ? ? ? .flags ? ? ? ? ?= ENABLE_PORT1 |
> - ? ? ? ? ? ? ? ? ? ? ? ? POWER_CONTROL_LOW | POWER_SENSE_LOW,
> - ? ? ? .init ? ? ? ? ? = colibri_pxa270_ohci_init,
> -};
> -
> -static void __init colibri_pxa270_uhc_init(void)
> -{
> - ? ? ? /* Colibri PXA270 has two usb ports, TBA for 320 */
> - ? ? ? if (machine_is_colibri())
> - ? ? ? ? ? ? ? colibri_pxa270_ohci_info.flags ?|= ENABLE_PORT2;
> -
> - ? ? ? pxa_set_ohci_info(&colibri_pxa270_ohci_info);
> -}
> -#else
> -static inline void colibri_pxa270_uhc_init(void) {}
> -#endif
> -
> -/******************************************************************************
> - * I2C RTC
> - ******************************************************************************/
> -#if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE)
> -static struct i2c_board_info __initdata colibri_pxa270_i2c_devs[] = {
> - ? ? ? {
> - ? ? ? ? ? ? ? I2C_BOARD_INFO("m41t00", 0x68),
> - ? ? ? },
> -};
> -
> -static void __init colibri_pxa270_rtc_init(void)
> -{
> - ? ? ? pxa_set_i2c_info(NULL);
> - ? ? ? i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_pxa270_i2c_devs));
> -}
> -#else
> -static inline void colibri_pxa270_rtc_init(void) {}
> -#endif
> -
> -void __init colibri_pxa270_evalboard_init(void)
> -{
> - ? ? ? pxa_set_ffuart_info(NULL);
> - ? ? ? pxa_set_btuart_info(NULL);
> - ? ? ? pxa_set_stuart_info(NULL);
> -
> - ? ? ? colibri_pxa270_mmc_init();
> - ? ? ? colibri_pxa270_uhc_init();
> - ? ? ? colibri_pxa270_rtc_init();
> -}
> diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
> index eecbb8b..6fc5d32 100644
> --- a/arch/arm/mach-pxa/colibri-pxa270.c
> +++ b/arch/arm/mach-pxa/colibri-pxa270.c
> @@ -35,7 +35,7 @@
> ?/******************************************************************************
> ?* Evaluation board MFP
> ?******************************************************************************/
> -#ifdef ?CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
> +#ifdef ?CONFIG_MACH_COLIBRI_EVALBOARD
> ?static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
> ? ? ? ?/* MMC */
> ? ? ? ?GPIO32_MMC_CLK,
> @@ -281,10 +281,10 @@ static void __init colibri_pxa270_init(void)
> ? ? ? ?colibri_pxa270_tsc_init();
>
> ? ? ? ?switch (colibri_pxa270_baseboard) {
> - ? ? ? case COLIBRI_PXA270_EVALBOARD:
> + ? ? ? case COLIBRI_EVALBOARD:
> ? ? ? ? ? ? ? ?pxa2xx_mfp_config(ARRAY_AND_SIZE(
> ? ? ? ? ? ? ? ? ? ? ? ?colibri_pxa270_evalboard_pin_config));
> - ? ? ? ? ? ? ? colibri_pxa270_evalboard_init();
> + ? ? ? ? ? ? ? colibri_evalboard_init();
> ? ? ? ? ? ? ? ?break;
> ? ? ? ?case COLIBRI_PXA270_INCOME:
> ? ? ? ? ? ? ? ?pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
> diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
> index 9b8d72d..b5bb248 100644
> --- a/arch/arm/mach-pxa/colibri-pxa300.c
> +++ b/arch/arm/mach-pxa/colibri-pxa300.c
> @@ -32,7 +32,7 @@
> ?#include "devices.h"
>
>
> -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
> +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD
> ?static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {
> ? ? ? ?/* MMC */
> ? ? ? ?GPIO7_MMC1_CLK,
> @@ -173,7 +173,7 @@ void __init colibri_pxa300_init(void)
>
> ? ? ? ?/* Evalboard init */
> ? ? ? ?pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config));
> - ? ? ? colibri_pxa270_evalboard_init();
> + ? ? ? colibri_evalboard_init();
> ?}
>
> ?MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
> diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
> index 0d8faf8..3d2c944 100644
> --- a/arch/arm/mach-pxa/colibri-pxa320.c
> +++ b/arch/arm/mach-pxa/colibri-pxa320.c
> @@ -35,7 +35,7 @@
> ?#include "generic.h"
> ?#include "devices.h"
>
> -#ifdef CONFIG_MACH_COLIBRI_PXA270_EVALBOARD
> +#ifdef CONFIG_MACH_COLIBRI_EVALBOARD
> ?static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {
> ? ? ? ?/* MMC */
> ? ? ? ?GPIO22_MMC1_CLK,
> @@ -229,7 +229,7 @@ void __init colibri_pxa320_init(void)
>
> ? ? ? ?/* Evalboard init */
> ? ? ? ?pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config));
> - ? ? ? colibri_pxa270_evalboard_init();
> + ? ? ? colibri_evalboard_init();
> ?}
>
> ?MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
> diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
> index 63a948a..388a96f 100644
> --- a/arch/arm/mach-pxa/include/mach/colibri.h
> +++ b/arch/arm/mach-pxa/include/mach/colibri.h
> @@ -9,14 +9,14 @@
> ?*/
>
> ?enum {
> - ? ? ? COLIBRI_PXA270_EVALBOARD = 0,
> + ? ? ? COLIBRI_EVALBOARD = 0,
> ? ? ? ?COLIBRI_PXA270_INCOME,
> ?};
>
> -#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD)
> -extern void colibri_pxa270_evalboard_init(void);
> +#if defined(CONFIG_MACH_COLIBRI_EVALBOARD)
> +extern void colibri_evalboard_init(void);
> ?#else
> -static inline void colibri_pxa270_evalboard_init(void) {}
> +static inline void colibri_evalboard_init(void) {}
> ?#endif
>
> ?#if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME)
> --
> 1.7.2.3
>
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses
  2010-11-03 14:37   ` Eric Miao
@ 2010-11-03 15:30     ` Marek Vasut
  2010-11-03 16:40       ` Russell King - ARM Linux
  2010-11-03 17:30       ` Eric Miao
  0 siblings, 2 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-03 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 03 November 2010 15:37:14 Eric Miao wrote:
> On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > This is important because on PXA3xx, the physical mapping of SMEMC
> > registers differs from the one on PXA2xx. In order to get PCMCIA working
> > on both PXA2xx and PXA320, the PCMCIA driver was adjusted accordingly as
> > well.
> > 
> > Also, various places in the kernel had to be patched to use
> > __raw_read/__raw_write.
> > 
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
> > ---
> >  arch/arm/mach-pxa/cm-x2xx.c                  |   13 +++--
> >  arch/arm/mach-pxa/cpufreq-pxa2xx.c           |   10 ++--
> >  arch/arm/mach-pxa/csb726.c                   |    7 ++-
> >  arch/arm/mach-pxa/generic.c                  |    1 +
> >  arch/arm/mach-pxa/h5000.c                    |    9 ++--
> >  arch/arm/mach-pxa/include/mach/pxa-smemc.h   |   74
> > ++++++++++++++++++++++++++ arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
> > |   55 ------------------- arch/arm/mach-pxa/lpd270.c                  
> > |    3 +-
> >  arch/arm/mach-pxa/lubbock.c                  |    3 +-
> >  arch/arm/mach-pxa/mainstone.c                |    5 +-
> >  arch/arm/mach-pxa/pxa25x.c                   |    5 +-
> >  arch/arm/mach-pxa/pxa27x.c                   |   10 ++--
> >  arch/arm/mach-pxa/pxa3xx.c                   |    5 +-
> >  arch/arm/mach-pxa/sleep.S                    |    2 +-
> >  arch/arm/mach-pxa/smemc.c                    |   51 ++++++------------
> >  arch/arm/mach-pxa/spitz.c                    |    5 +-
> >  arch/arm/mach-pxa/stargate2.c                |    3 +-
> >  arch/arm/mach-pxa/tosa.c                     |    7 ++-
> >  arch/arm/mach-pxa/trizeps4.c                 |    3 +-
> >  arch/arm/mach-pxa/xcep.c                     |    5 +-
> >  arch/arm/mach-pxa/zeus.c                     |    5 +-
> >  drivers/pcmcia/pxa2xx_base.c                 |   65
> > +++++++++++++++------- 22 files changed, 196 insertions(+), 150
> > deletions(-)
> >  create mode 100644 arch/arm/mach-pxa/include/mach/pxa-smemc.h
> > 

SNIP

> > diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
> > index 0909df2..2f21144 100644
> > --- a/arch/arm/mach-pxa/zeus.c
> > +++ b/arch/arm/mach-pxa/zeus.c
> > @@ -47,6 +47,7 @@
> >  #include <mach/audio.h>
> >  #include <mach/arcom-pcmcia.h>
> >  #include <mach/zeus.h>
> > +#include <mach/pxa-smemc.h>
> > 
> >  #include "generic.h"
> > 
> > @@ -828,8 +829,8 @@ static void __init zeus_init(void)
> >        pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4,
> > (system_rev & 0x0f));
> > 
> >        /* Fix timings for dm9000s (CS1/CS2)*/
> > -       MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
> > -       MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
> > +       __raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
> > +       __raw_writel((MSC1 & 0xffff0000) | dm9000_msc, MSC1);
> 
> This isn't correct.

I don't see the difference (well, besides that this should be adjusted by 
bootloader).

> 
> >        pm_power_off = zeus_power_off;
> >        zeus_setup_apm();
> > diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c
> > index ae07b4d..65a8b6f 100644
> > --- a/drivers/pcmcia/pxa2xx_base.c
> > +++ b/drivers/pcmcia/pxa2xx_base.c
> > @@ -26,6 +26,7 @@
> >  #include <linux/platform_device.h>
> > 
> >  #include <mach/hardware.h>
> > +#include <mach/pxa-smemc.h>
> >  #include <asm/io.h>
> >  #include <asm/irq.h>
> >  #include <asm/system.h>
> > @@ -116,37 +117,49 @@ static inline u_int pxa2xx_pcmcia_cmd_time(u_int
> > mem_clk_10khz,
> > 
> >  static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock )
> >  {
> > -       MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock)
> > +       uint32_t val;
> > +
> > +       val = ((pxa2xx_mcxx_setup(speed, clock)
> >                & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
> >                | ((pxa2xx_mcxx_asst(speed, clock)
> >                & MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
> >                | ((pxa2xx_mcxx_hold(speed, clock)
> >                & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
> > 
> > +       __raw_writel(val, MCMEM(sock));
> > +
> >        return 0;
> >  }
> > 
> >  static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock )
> >  {
> > -       MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock)
> > +       uint32_t val;
> > +
> > +       val = ((pxa2xx_mcxx_setup(speed, clock)
> >                & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
> >                | ((pxa2xx_mcxx_asst(speed, clock)
> >                & MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
> >                | ((pxa2xx_mcxx_hold(speed, clock)
> >                & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
> > 
> > +       __raw_writel(val, MCIO(sock));
> > +
> >        return 0;
> >  }
> > 
> >  static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock )
> >  {
> > -       MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock)
> > +       uint32_t val;
> > +
> > +       val = ((pxa2xx_mcxx_setup(speed, clock)
> >                & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT)
> >                | ((pxa2xx_mcxx_asst(speed, clock)
> >                & MCXX_ASST_MASK) << MCXX_ASST_SHIFT)
> >                | ((pxa2xx_mcxx_hold(speed, clock)
> >                & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT);
> > 
> > +       __raw_writel(val, MCATT(sock));
> > +
> >        return 0;
> >  }
> > 
> > @@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct
> > soc_pcmcia_socket *skt, static void pxa2xx_configure_sockets(struct
> > device *dev)
> >  {
> >        struct pcmcia_low_level *ops = dev->platform_data;
> > -
> >        /*
> >         * We have at least one socket, so set MECR:CIT
> >         * (Card Is There)
> >         */
> > -       MECR |= MECR_CIT;
> > +       uint32_t mecr = MECR_CIT;
> > 
> >        /* Set MECR:NOS (Number Of Sockets) */
> >        if ((ops->first + ops->nr) > 1 ||
> >            machine_is_viper() || machine_is_arcom_zeus())
> > -               MECR |= MECR_NOS;
> > -       else
> > -               MECR &= ~MECR_NOS;
> > +               mecr |= MECR_NOS;
> > +
> > +       __raw_writel(mecr, MECR);
> 
> This looks to be a bit inconsistent with the original code?
> 
> >  }
> > 
> >  static const char *skt_names[] = {
> > @@ -272,14 +284,24 @@ static int pxa2xx_drv_pcmcia_probe(struct
> > platform_device *dev) struct soc_pcmcia_socket *skt;
> > 
> >        ops = (struct pcmcia_low_level *)dev->dev.platform_data;
> > -       if (!ops)
> > -               return -ENODEV;
> > +       if (!ops) {
> > +               ret = -ENODEV;
> > +               goto err0;
> > +       }
> > +
> > +       if (cpu_is_pxa320() && ops->nr > 1) {
> > +               dev_err(&dev->dev, "pxa320 supports only one pcmcia
> > slot"); +               ret = -EINVAL;
> > +               goto err0;
> > +       }
> 
> This change doesn't look to be part of this patch?
> 
> >        pxa2xx_drv_pcmcia_ops(ops);
> > 
> >        sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL);
> > -       if (!sinfo)
> > -               return -ENOMEM;
> > +       if (!sinfo) {
> > +               ret = -ENOMEM;
> > +               goto err0;
> > +       }
> > 
> >        sinfo->nskt = ops->nr;
> > 
> > @@ -295,18 +317,19 @@ static int pxa2xx_drv_pcmcia_probe(struct
> > platform_device *dev)
> > 
> >                ret = pxa2xx_drv_pcmcia_add_one(skt);
> >                if (ret)
> > -                       break;
> > +                       goto err1;
> >        }
> > 
> > -       if (ret) {
> > -               while (--i >= 0)
> > -                       soc_pcmcia_remove_one(&sinfo->skt[i]);
> > -               kfree(sinfo);
> > -       } else {
> > -               pxa2xx_configure_sockets(&dev->dev);
> > -               dev_set_drvdata(&dev->dev, sinfo);
> > -       }
> > +       pxa2xx_configure_sockets(&dev->dev);
> > +       dev_set_drvdata(&dev->dev, sinfo);
> > 
> > +       return 0;
> > +
> > +err1:
> > +       while (--i >= 0)
> > +               soc_pcmcia_remove_one(&sinfo->skt[i]);
> > +       kfree(sinfo);
> > +err0:
> >        return ret;
> >  }
> > 
> > --
> > 1.7.2.3

Splited into two patches. Thanks

Cheers

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses
  2010-11-03 15:30     ` Marek Vasut
@ 2010-11-03 16:40       ` Russell King - ARM Linux
  2010-11-03 16:48         ` Marek Vasut
  2010-11-03 17:30       ` Eric Miao
  1 sibling, 1 reply; 29+ messages in thread
From: Russell King - ARM Linux @ 2010-11-03 16:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 03, 2010 at 04:30:03PM +0100, Marek Vasut wrote:
> > >        /* Fix timings for dm9000s (CS1/CS2)*/
> > > -       MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
> > > -       MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
> > > +       __raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
> > > +       __raw_writel((MSC1 & 0xffff0000) | dm9000_msc, MSC1);
> > 
> > This isn't correct.
> 
> I don't see the difference (well, besides that this should be adjusted by 
> bootloader).

Eric is quite right - the above is not a correct conversion - it's a
functional change.

	MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);

Reads the MSC0 register, modifies its value, and writes it back.

	__raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);

Uses the MSC0 register address, modifies that address value, and then
writes it to the MSC0 register.

> > > @@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct
> > > soc_pcmcia_socket *skt, static void pxa2xx_configure_sockets(struct
> > > device *dev)
> > >  {
> > >        struct pcmcia_low_level *ops = dev->platform_data;
> > > -
> > >        /*
> > >         * We have at least one socket, so set MECR:CIT
> > >         * (Card Is There)
> > >         */
> > > -       MECR |= MECR_CIT;
> > > +       uint32_t mecr = MECR_CIT;
> > > 
> > >        /* Set MECR:NOS (Number Of Sockets) */
> > >        if ((ops->first + ops->nr) > 1 ||
> > >            machine_is_viper() || machine_is_arcom_zeus())
> > > -               MECR |= MECR_NOS;
> > > -       else
> > > -               MECR &= ~MECR_NOS;
> > > +               mecr |= MECR_NOS;
> > > +
> > > +       __raw_writel(mecr, MECR);
> > 
> > This looks to be a bit inconsistent with the original code?

No comment for this - and I agree with Eric.  This again is not just a
conversion from having MECR accessing the register, to using __raw_readl
and __raw_writel.  It always forces MECR_CIT to be set - which may not
be what was there originally.

It's another functional change.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses
  2010-11-03 16:40       ` Russell King - ARM Linux
@ 2010-11-03 16:48         ` Marek Vasut
  0 siblings, 0 replies; 29+ messages in thread
From: Marek Vasut @ 2010-11-03 16:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Wednesday 03 November 2010 17:40:23 Russell King - ARM Linux wrote:
> On Wed, Nov 03, 2010 at 04:30:03PM +0100, Marek Vasut wrote:
> > > >        /* Fix timings for dm9000s (CS1/CS2)*/
> > > > 
> > > > -       MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
> > > > -       MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
> > > > +       __raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
> > > > +       __raw_writel((MSC1 & 0xffff0000) | dm9000_msc, MSC1);
> > > 
> > > This isn't correct.
> > 
> > I don't see the difference (well, besides that this should be adjusted by
> > bootloader).
> 
> Eric is quite right - the above is not a correct conversion - it's a
> functional change.
> 
> 	MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
> 
> Reads the MSC0 register, modifies its value, and writes it back.
> 
> 	__raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
> 
> Uses the MSC0 register address, modifies that address value, and then
> writes it to the MSC0 register.

AAH!

Stupid and blind me !
> 
> > > > @@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct
> > > > soc_pcmcia_socket *skt, static void pxa2xx_configure_sockets(struct
> > > > device *dev)
> > > > 
> > > >  {
> > > >  
> > > >        struct pcmcia_low_level *ops = dev->platform_data;
> > > > 
> > > > -
> > > > 
> > > >        /*
> > > >        
> > > >         * We have at least one socket, so set MECR:CIT
> > > >         * (Card Is There)
> > > >         */
> > > > 
> > > > -       MECR |= MECR_CIT;
> > > > +       uint32_t mecr = MECR_CIT;
> > > > 
> > > >        /* Set MECR:NOS (Number Of Sockets) */
> > > >        if ((ops->first + ops->nr) > 1 ||
> > > >        
> > > >            machine_is_viper() || machine_is_arcom_zeus())
> > > > 
> > > > -               MECR |= MECR_NOS;
> > > > -       else
> > > > -               MECR &= ~MECR_NOS;
> > > > +               mecr |= MECR_NOS;
> > > > +
> > > > +       __raw_writel(mecr, MECR);
> > > 
> > > This looks to be a bit inconsistent with the original code?
> 
> No comment for this - and I agree with Eric.  This again is not just a
> conversion from having MECR accessing the register, to using __raw_readl
> and __raw_writel.  It always forces MECR_CIT to be set - which may not
> be what was there originally.
> 
> It's another functional change.

You're right, sorry.

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses
  2010-11-03 15:30     ` Marek Vasut
  2010-11-03 16:40       ` Russell King - ARM Linux
@ 2010-11-03 17:30       ` Eric Miao
  1 sibling, 0 replies; 29+ messages in thread
From: Eric Miao @ 2010-11-03 17:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 11:30 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
> On Wednesday 03 November 2010 15:37:14 Eric Miao wrote:
>> On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
>> > This is important because on PXA3xx, the physical mapping of SMEMC
>> > registers differs from the one on PXA2xx. In order to get PCMCIA working
>> > on both PXA2xx and PXA320, the PCMCIA driver was adjusted accordingly as
>> > well.
>> >
>> > Also, various places in the kernel had to be patched to use
>> > __raw_read/__raw_write.
>> >
>> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
>> > Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
>> > ---
>> > ?arch/arm/mach-pxa/cm-x2xx.c ? ? ? ? ? ? ? ? ?| ? 13 +++--
>> > ?arch/arm/mach-pxa/cpufreq-pxa2xx.c ? ? ? ? ? | ? 10 ++--
>> > ?arch/arm/mach-pxa/csb726.c ? ? ? ? ? ? ? ? ? | ? ?7 ++-
>> > ?arch/arm/mach-pxa/generic.c ? ? ? ? ? ? ? ? ?| ? ?1 +
>> > ?arch/arm/mach-pxa/h5000.c ? ? ? ? ? ? ? ? ? ?| ? ?9 ++--
>> > ?arch/arm/mach-pxa/include/mach/pxa-smemc.h ? | ? 74
>> > ++++++++++++++++++++++++++ arch/arm/mach-pxa/include/mach/pxa2xx-regs.h
>> > | ? 55 ------------------- arch/arm/mach-pxa/lpd270.c
>> > | ? ?3 +-
>> > ?arch/arm/mach-pxa/lubbock.c ? ? ? ? ? ? ? ? ?| ? ?3 +-
>> > ?arch/arm/mach-pxa/mainstone.c ? ? ? ? ? ? ? ?| ? ?5 +-
>> > ?arch/arm/mach-pxa/pxa25x.c ? ? ? ? ? ? ? ? ? | ? ?5 +-
>> > ?arch/arm/mach-pxa/pxa27x.c ? ? ? ? ? ? ? ? ? | ? 10 ++--
>> > ?arch/arm/mach-pxa/pxa3xx.c ? ? ? ? ? ? ? ? ? | ? ?5 +-
>> > ?arch/arm/mach-pxa/sleep.S ? ? ? ? ? ? ? ? ? ?| ? ?2 +-
>> > ?arch/arm/mach-pxa/smemc.c ? ? ? ? ? ? ? ? ? ?| ? 51 ++++++------------
>> > ?arch/arm/mach-pxa/spitz.c ? ? ? ? ? ? ? ? ? ?| ? ?5 +-
>> > ?arch/arm/mach-pxa/stargate2.c ? ? ? ? ? ? ? ?| ? ?3 +-
>> > ?arch/arm/mach-pxa/tosa.c ? ? ? ? ? ? ? ? ? ? | ? ?7 ++-
>> > ?arch/arm/mach-pxa/trizeps4.c ? ? ? ? ? ? ? ? | ? ?3 +-
>> > ?arch/arm/mach-pxa/xcep.c ? ? ? ? ? ? ? ? ? ? | ? ?5 +-
>> > ?arch/arm/mach-pxa/zeus.c ? ? ? ? ? ? ? ? ? ? | ? ?5 +-
>> > ?drivers/pcmcia/pxa2xx_base.c ? ? ? ? ? ? ? ? | ? 65
>> > +++++++++++++++------- 22 files changed, 196 insertions(+), 150
>> > deletions(-)
>> > ?create mode 100644 arch/arm/mach-pxa/include/mach/pxa-smemc.h
>> >
>
> SNIP
>
>> > diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
>> > index 0909df2..2f21144 100644
>> > --- a/arch/arm/mach-pxa/zeus.c
>> > +++ b/arch/arm/mach-pxa/zeus.c
>> > @@ -47,6 +47,7 @@
>> > ?#include <mach/audio.h>
>> > ?#include <mach/arcom-pcmcia.h>
>> > ?#include <mach/zeus.h>
>> > +#include <mach/pxa-smemc.h>
>> >
>> > ?#include "generic.h"
>> >
>> > @@ -828,8 +829,8 @@ static void __init zeus_init(void)
>> > ? ? ? ?pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4,
>> > (system_rev & 0x0f));
>> >
>> > ? ? ? ?/* Fix timings for dm9000s (CS1/CS2)*/
>> > - ? ? ? MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16);
>> > - ? ? ? MSC1 = (MSC1 & 0xffff0000) | dm9000_msc;
>> > + ? ? ? __raw_writel((MSC0 & 0xffff) | (dm9000_msc << 16), MSC0);
>> > + ? ? ? __raw_writel((MSC1 & 0xffff0000) | dm9000_msc, MSC1);
>>
>> This isn't correct.
>
> I don't see the difference (well, besides that this should be adjusted by
> bootloader).
>

Shouldn't this being written as:

msc0 = __raw_readl(MSC0) & 0xffff | (dm9000_msc << 16);
__raw_writel(msc0, MSC00);
msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc;
__raw_writel(msc1, MSC1);

??

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus
  2010-11-02 23:51 ` [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
@ 2010-12-01  2:51   ` Eric Miao
  2010-12-01  9:38     ` Samuel Ortiz
  0 siblings, 1 reply; 29+ messages in thread
From: Eric Miao @ 2010-12-01  2:51 UTC (permalink / raw)
  To: linux-arm-kernel

Cc'ed Samuel for the MFD part.

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> ?drivers/gpio/ucb1400_gpio.c | ? 19 ++++++-------------
> ?drivers/mfd/ucb1400_core.c ?| ? ?5 +++++
> ?include/linux/ucb1400.h ? ? | ? 19 ++++++-------------
> ?3 files changed, 17 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpio/ucb1400_gpio.c b/drivers/gpio/ucb1400_gpio.c
> index 50e6bd1..fba45a5 100644
> --- a/drivers/gpio/ucb1400_gpio.c
> +++ b/drivers/gpio/ucb1400_gpio.c
> @@ -12,8 +12,6 @@
> ?#include <linux/module.h>
> ?#include <linux/ucb1400.h>
>
> -struct ucb1400_gpio_data *ucbdata;
> -
> ?static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off)
> ?{
> ? ? ? ?struct ucb1400_gpio *gpio;
> @@ -50,7 +48,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
> ? ? ? ?struct ucb1400_gpio *ucb = dev->dev.platform_data;
> ? ? ? ?int err = 0;
>
> - ? ? ? if (!(ucbdata && ucbdata->gpio_offset)) {
> + ? ? ? if (!(ucb && ucb->gpio_offset)) {
> ? ? ? ? ? ? ? ?err = -EINVAL;
> ? ? ? ? ? ? ? ?goto err;
> ? ? ? ?}
> @@ -58,7 +56,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
> ? ? ? ?platform_set_drvdata(dev, ucb);
>
> ? ? ? ?ucb->gc.label = "ucb1400_gpio";
> - ? ? ? ucb->gc.base = ucbdata->gpio_offset;
> + ? ? ? ucb->gc.base = ucb->gpio_offset;
> ? ? ? ?ucb->gc.ngpio = 10;
> ? ? ? ?ucb->gc.owner = THIS_MODULE;
>
> @@ -72,8 +70,8 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
> ? ? ? ?if (err)
> ? ? ? ? ? ? ? ?goto err;
>
> - ? ? ? if (ucbdata && ucbdata->gpio_setup)
> - ? ? ? ? ? ? ? err = ucbdata->gpio_setup(&dev->dev, ucb->gc.ngpio);
> + ? ? ? if (ucb && ucb->gpio_setup)
> + ? ? ? ? ? ? ? err = ucb->gpio_setup(&dev->dev, ucb->gc.ngpio);
>
> ?err:
> ? ? ? ?return err;
> @@ -85,8 +83,8 @@ static int ucb1400_gpio_remove(struct platform_device *dev)
> ? ? ? ?int err = 0;
> ? ? ? ?struct ucb1400_gpio *ucb = platform_get_drvdata(dev);
>
> - ? ? ? if (ucbdata && ucbdata->gpio_teardown) {
> - ? ? ? ? ? ? ? err = ucbdata->gpio_teardown(&dev->dev, ucb->gc.ngpio);
> + ? ? ? if (ucb && ucb->gpio_teardown) {
> + ? ? ? ? ? ? ? err = ucb->gpio_teardown(&dev->dev, ucb->gc.ngpio);
> ? ? ? ? ? ? ? ?if (err)
> ? ? ? ? ? ? ? ? ? ? ? ?return err;
> ? ? ? ?}
> @@ -113,11 +111,6 @@ static void __exit ucb1400_gpio_exit(void)
> ? ? ? ?platform_driver_unregister(&ucb1400_gpio_driver);
> ?}
>
> -void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data)
> -{
> - ? ? ? ucbdata = data;
> -}
> -
> ?module_init(ucb1400_gpio_init);
> ?module_exit(ucb1400_gpio_exit);
>
> diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
> index d73f84b..63f4969 100644
> --- a/drivers/mfd/ucb1400_core.c
> +++ b/drivers/mfd/ucb1400_core.c
> @@ -75,6 +75,11 @@ static int ucb1400_core_probe(struct device *dev)
>
> ? ? ? ?/* GPIO */
> ? ? ? ?ucb_gpio.ac97 = ac97;
> + ? ? ? if (pdata) {
> + ? ? ? ? ? ? ? ucb_gpio.gpio_setup = pdata->gpio_setup;
> + ? ? ? ? ? ? ? ucb_gpio.gpio_teardown = pdata->gpio_teardown;
> + ? ? ? ? ? ? ? ucb_gpio.gpio_offset = pdata->gpio_offset;
> + ? ? ? }
> ? ? ? ?ucb->ucb1400_gpio = platform_device_alloc("ucb1400_gpio", -1);
> ? ? ? ?if (!ucb->ucb1400_gpio) {
> ? ? ? ? ? ? ? ?err = -ENOMEM;
> diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
> index 1b47909..1a6bfdd 100644
> --- a/include/linux/ucb1400.h
> +++ b/include/linux/ucb1400.h
> @@ -83,15 +83,12 @@
> ?#define UCB_ID ? ? ? ? ? ? ? ? 0x7e
> ?#define UCB_ID_1400 ? ? ? ? ? ? 0x4304
>
> -struct ucb1400_gpio_data {
> - ? ? ? int gpio_offset;
> - ? ? ? int (*gpio_setup)(struct device *dev, int ngpio);
> - ? ? ? int (*gpio_teardown)(struct device *dev, int ngpio);
> -};
> -
> ?struct ucb1400_gpio {
> ? ? ? ?struct gpio_chip ? ? ? ?gc;
> ? ? ? ?struct snd_ac97 ? ? ? ? *ac97;
> + ? ? ? int ? ? ? ? ? ? ? ? ? ? gpio_offset;
> + ? ? ? int (*gpio_setup)(struct device *dev, int ngpio);
> + ? ? ? int (*gpio_teardown)(struct device *dev, int ngpio);
> ?};
>
> ?struct ucb1400_ts {
> @@ -112,6 +109,9 @@ struct ucb1400 {
>
> ?struct ucb1400_pdata {
> ? ? ? ?int ? ? irq;
> + ? ? ? int ? ? gpio_offset;
> + ? ? ? int (*gpio_setup)(struct device *dev, int ngpio);
> + ? ? ? int (*gpio_teardown)(struct device *dev, int ngpio);
> ?};
>
> ?static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
> @@ -163,11 +163,4 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)
>
> ?unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int adcsync);
> -
> -#ifdef CONFIG_GPIO_UCB1400
> -void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data);
> -#else
> -static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {}
> -#endif
> -
> ?#endif
> --
> 1.7.2.3
>
>

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus
  2010-12-01  2:51   ` Eric Miao
@ 2010-12-01  9:38     ` Samuel Ortiz
  0 siblings, 0 replies; 29+ messages in thread
From: Samuel Ortiz @ 2010-12-01  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Eric,

On Wed, Dec 01, 2010 at 10:51:12AM +0800, Eric Miao wrote:
> Cc'ed Samuel for the MFD part.
The MFD part looks fine, please go ahead and add my Acked-By to this patch.

Cheers,
Samuel.


> On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> > ---
> > ?drivers/gpio/ucb1400_gpio.c | ? 19 ++++++-------------
> > ?drivers/mfd/ucb1400_core.c ?| ? ?5 +++++
> > ?include/linux/ucb1400.h ? ? | ? 19 ++++++-------------
> > ?3 files changed, 17 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/gpio/ucb1400_gpio.c b/drivers/gpio/ucb1400_gpio.c
> > index 50e6bd1..fba45a5 100644
> > --- a/drivers/gpio/ucb1400_gpio.c
> > +++ b/drivers/gpio/ucb1400_gpio.c
> > @@ -12,8 +12,6 @@
> > ?#include <linux/module.h>
> > ?#include <linux/ucb1400.h>
> >
> > -struct ucb1400_gpio_data *ucbdata;
> > -
> > ?static int ucb1400_gpio_dir_in(struct gpio_chip *gc, unsigned off)
> > ?{
> > ? ? ? ?struct ucb1400_gpio *gpio;
> > @@ -50,7 +48,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
> > ? ? ? ?struct ucb1400_gpio *ucb = dev->dev.platform_data;
> > ? ? ? ?int err = 0;
> >
> > - ? ? ? if (!(ucbdata && ucbdata->gpio_offset)) {
> > + ? ? ? if (!(ucb && ucb->gpio_offset)) {
> > ? ? ? ? ? ? ? ?err = -EINVAL;
> > ? ? ? ? ? ? ? ?goto err;
> > ? ? ? ?}
> > @@ -58,7 +56,7 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
> > ? ? ? ?platform_set_drvdata(dev, ucb);
> >
> > ? ? ? ?ucb->gc.label = "ucb1400_gpio";
> > - ? ? ? ucb->gc.base = ucbdata->gpio_offset;
> > + ? ? ? ucb->gc.base = ucb->gpio_offset;
> > ? ? ? ?ucb->gc.ngpio = 10;
> > ? ? ? ?ucb->gc.owner = THIS_MODULE;
> >
> > @@ -72,8 +70,8 @@ static int ucb1400_gpio_probe(struct platform_device *dev)
> > ? ? ? ?if (err)
> > ? ? ? ? ? ? ? ?goto err;
> >
> > - ? ? ? if (ucbdata && ucbdata->gpio_setup)
> > - ? ? ? ? ? ? ? err = ucbdata->gpio_setup(&dev->dev, ucb->gc.ngpio);
> > + ? ? ? if (ucb && ucb->gpio_setup)
> > + ? ? ? ? ? ? ? err = ucb->gpio_setup(&dev->dev, ucb->gc.ngpio);
> >
> > ?err:
> > ? ? ? ?return err;
> > @@ -85,8 +83,8 @@ static int ucb1400_gpio_remove(struct platform_device *dev)
> > ? ? ? ?int err = 0;
> > ? ? ? ?struct ucb1400_gpio *ucb = platform_get_drvdata(dev);
> >
> > - ? ? ? if (ucbdata && ucbdata->gpio_teardown) {
> > - ? ? ? ? ? ? ? err = ucbdata->gpio_teardown(&dev->dev, ucb->gc.ngpio);
> > + ? ? ? if (ucb && ucb->gpio_teardown) {
> > + ? ? ? ? ? ? ? err = ucb->gpio_teardown(&dev->dev, ucb->gc.ngpio);
> > ? ? ? ? ? ? ? ?if (err)
> > ? ? ? ? ? ? ? ? ? ? ? ?return err;
> > ? ? ? ?}
> > @@ -113,11 +111,6 @@ static void __exit ucb1400_gpio_exit(void)
> > ? ? ? ?platform_driver_unregister(&ucb1400_gpio_driver);
> > ?}
> >
> > -void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data)
> > -{
> > - ? ? ? ucbdata = data;
> > -}
> > -
> > ?module_init(ucb1400_gpio_init);
> > ?module_exit(ucb1400_gpio_exit);
> >
> > diff --git a/drivers/mfd/ucb1400_core.c b/drivers/mfd/ucb1400_core.c
> > index d73f84b..63f4969 100644
> > --- a/drivers/mfd/ucb1400_core.c
> > +++ b/drivers/mfd/ucb1400_core.c
> > @@ -75,6 +75,11 @@ static int ucb1400_core_probe(struct device *dev)
> >
> > ? ? ? ?/* GPIO */
> > ? ? ? ?ucb_gpio.ac97 = ac97;
> > + ? ? ? if (pdata) {
> > + ? ? ? ? ? ? ? ucb_gpio.gpio_setup = pdata->gpio_setup;
> > + ? ? ? ? ? ? ? ucb_gpio.gpio_teardown = pdata->gpio_teardown;
> > + ? ? ? ? ? ? ? ucb_gpio.gpio_offset = pdata->gpio_offset;
> > + ? ? ? }
> > ? ? ? ?ucb->ucb1400_gpio = platform_device_alloc("ucb1400_gpio", -1);
> > ? ? ? ?if (!ucb->ucb1400_gpio) {
> > ? ? ? ? ? ? ? ?err = -ENOMEM;
> > diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h
> > index 1b47909..1a6bfdd 100644
> > --- a/include/linux/ucb1400.h
> > +++ b/include/linux/ucb1400.h
> > @@ -83,15 +83,12 @@
> > ?#define UCB_ID ? ? ? ? ? ? ? ? 0x7e
> > ?#define UCB_ID_1400 ? ? ? ? ? ? 0x4304
> >
> > -struct ucb1400_gpio_data {
> > - ? ? ? int gpio_offset;
> > - ? ? ? int (*gpio_setup)(struct device *dev, int ngpio);
> > - ? ? ? int (*gpio_teardown)(struct device *dev, int ngpio);
> > -};
> > -
> > ?struct ucb1400_gpio {
> > ? ? ? ?struct gpio_chip ? ? ? ?gc;
> > ? ? ? ?struct snd_ac97 ? ? ? ? *ac97;
> > + ? ? ? int ? ? ? ? ? ? ? ? ? ? gpio_offset;
> > + ? ? ? int (*gpio_setup)(struct device *dev, int ngpio);
> > + ? ? ? int (*gpio_teardown)(struct device *dev, int ngpio);
> > ?};
> >
> > ?struct ucb1400_ts {
> > @@ -112,6 +109,9 @@ struct ucb1400 {
> >
> > ?struct ucb1400_pdata {
> > ? ? ? ?int ? ? irq;
> > + ? ? ? int ? ? gpio_offset;
> > + ? ? ? int (*gpio_setup)(struct device *dev, int ngpio);
> > + ? ? ? int (*gpio_teardown)(struct device *dev, int ngpio);
> > ?};
> >
> > ?static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg)
> > @@ -163,11 +163,4 @@ static inline void ucb1400_adc_disable(struct snd_ac97 *ac97)
> >
> > ?unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel,
> > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int adcsync);
> > -
> > -#ifdef CONFIG_GPIO_UCB1400
> > -void __init ucb1400_gpio_set_data(struct ucb1400_gpio_data *data);
> > -#else
> > -static inline void ucb1400_gpio_set_data(struct ucb1400_gpio_data *data) {}
> > -#endif
> > -
> > ?#endif
> > --
> > 1.7.2.3
> >
> >

-- 
Intel Open Source Technology Centre
http://oss.intel.com/

^ permalink raw reply	[flat|nested] 29+ messages in thread

* [PATCH 10/17] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270
  2010-11-02 23:51 ` [PATCH 10/17] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270 Marek Vasut
@ 2010-12-14 14:07   ` Eric Miao
  0 siblings, 0 replies; 29+ messages in thread
From: Eric Miao @ 2010-12-14 14:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 3, 2010 at 7:51 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
> ---
> ?arch/arm/mach-pxa/vpac270.c | ? 12 +++++-------
> ?1 files changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
> index b9b5797..5e206fd 100644
> --- a/arch/arm/mach-pxa/vpac270.c
> +++ b/arch/arm/mach-pxa/vpac270.c
> @@ -430,20 +430,18 @@ static inline void vpac270_eth_init(void) {}
> ?******************************************************************************/
> ?#if ? ?defined(CONFIG_TOUCHSCREEN_UCB1400) || \
> ? ? ? ?defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
> -static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
> - ? ? ? .reset_gpio ? ? = 95,
> -};
> -
> ?static struct ucb1400_pdata vpac270_ucb1400_pdata = {
> ? ? ? ?.irq ? ? ? ? ? ?= IRQ_GPIO(GPIO113_VPAC270_TS_IRQ),
> ?};
>
> +static pxa2xx_audio_ops_t vpac270_ac97_pdata = {
> + ? ? ? .reset_gpio ? ? = 95,
> + ? ? ? .codec_pdata ? ?= { &vpac270_ucb1400_pdata, },
> +};
> +
> ?static struct platform_device vpac270_ucb1400_device = {
> ? ? ? ?.name ? ? ? ? ? = "ucb1400_core",
> ? ? ? ?.id ? ? ? ? ? ? = -1,
> - ? ? ? .dev ? ? ? ? ? ?= {
> - ? ? ? ? ? ? ? .platform_data = &vpac270_ucb1400_pdata,
> - ? ? ? },
> ?};

It's a bit strange that a platform device version of ucb1400_core is
needed here as it's on AC97 bus. Could you please check if this
is necessary, and there seems to be same issue in other files.

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2010-12-14 14:07 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-02 23:51 [PATCH 01/17] ARM: pxa: Fix missing includes Marek Vasut
2010-11-02 23:51 ` [PATCH 02/17] ARM: pxa: Access SMEMC via virtual addresses Marek Vasut
2010-11-03 14:37   ` Eric Miao
2010-11-03 15:30     ` Marek Vasut
2010-11-03 16:40       ` Russell King - ARM Linux
2010-11-03 16:48         ` Marek Vasut
2010-11-03 17:30       ` Eric Miao
2010-11-02 23:51 ` [PATCH 03/17] ARM: pxa: Toradex Colibri PXA270 CF support Marek Vasut
2010-11-03 14:44   ` Eric Miao
2010-11-02 23:51 ` [PATCH 04/17] ARM: pxa: Push Colibri evalboard MFP into module files Marek Vasut
2010-11-03 14:47   ` Eric Miao
2010-11-02 23:51 ` [PATCH 05/17] ARM: pxa: Add M41T00 RTC support into Colibri evalboard Marek Vasut
2010-11-02 23:51 ` [PATCH 06/17] ARM: pxa: Rename " Marek Vasut
2010-11-03 14:53   ` Eric Miao
2010-11-02 23:51 ` [PATCH 07/17] ARM: pxa: Colibri PXA320 PCMCIA driver Marek Vasut
2010-11-02 23:51 ` [PATCH 08/17] ARM: pxa: Modularize Palm Tungsten|C Marek Vasut
2010-11-02 23:51 ` [PATCH 09/17] UCB1400: Pass ucb1400-gpio data through ac97 bus Marek Vasut
2010-12-01  2:51   ` Eric Miao
2010-12-01  9:38     ` Samuel Ortiz
2010-11-02 23:51 ` [PATCH 10/17] ARM: pxa: Correct touch IRQ passing to UCB1400 on vpac270 Marek Vasut
2010-12-14 14:07   ` Eric Miao
2010-11-02 23:51 ` [PATCH 11/17] ARM: pxa: Pass GPIO offset to ucb1400-gpio on PalmTC Marek Vasut
2010-11-02 23:51 ` [PATCH 12/17] ARM: pxa: Add gpio-leds and vibrator support to PalmTC Marek Vasut
2010-11-02 23:51 ` [PATCH 13/17] ARM: pxa: Fix pxa2xx-flash section mismatch Marek Vasut
2010-11-02 23:51 ` [PATCH 14/17] ARM: pxa: Fix number of IRQs on Balloon3 Marek Vasut
2010-11-02 23:51 ` [PATCH 15/17] ARM: pxa: Update Balloon3 for new FPGA firmware Marek Vasut
2010-11-02 23:51 ` [PATCH 16/17] SND: Tosa: Fix pointer to codec location Marek Vasut
2010-11-02 23:51 ` [PATCH 17/17] ARM: pxa/colibri: setup pins for USB host port 3 Marek Vasut
2010-11-03 13:33 ` [PATCH 01/17] ARM: pxa: Fix missing includes Eric Miao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.