]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 18 Oct 2010 14:20:21 +0000 (15:20 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 18 Oct 2010 14:20:21 +0000 (15:20 +0100)
75 files changed:
MAINTAINERS
arch/arm/Kconfig
arch/arm/mach-mmp/Kconfig
arch/arm/mach-mmp/Makefile
arch/arm/mach-mmp/aspenite.c
arch/arm/mach-mmp/common.c
arch/arm/mach-mmp/flint.c
arch/arm/mach-mmp/include/mach/cputype.h
arch/arm/mach-mmp/include/mach/irqs.h
arch/arm/mach-mmp/include/mach/mfp-pxa168.h
arch/arm/mach-mmp/include/mach/pxa168.h
arch/arm/mach-mmp/include/mach/regs-apmu.h
arch/arm/mach-mmp/include/mach/teton_bga.h [new file with mode: 0644]
arch/arm/mach-mmp/jasper.c
arch/arm/mach-mmp/pxa168.c
arch/arm/mach-mmp/teton_bga.c [new file with mode: 0644]
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/Makefile
arch/arm/mach-pxa/balloon3.c
arch/arm/mach-pxa/cm-x2xx.c
arch/arm/mach-pxa/cm-x300.c
arch/arm/mach-pxa/cpufreq-pxa3xx.c
arch/arm/mach-pxa/devices.c
arch/arm/mach-pxa/devices.h
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/eseries.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/generic.c
arch/arm/mach-pxa/generic.h
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/include/mach/balloon3.h
arch/arm/mach-pxa/include/mach/eseries-irq.h
arch/arm/mach-pxa/include/mach/hx4700.h
arch/arm/mach-pxa/include/mach/irqs.h
arch/arm/mach-pxa/include/mach/littleton.h
arch/arm/mach-pxa/include/mach/lpd270.h
arch/arm/mach-pxa/include/mach/lubbock.h
arch/arm/mach-pxa/include/mach/magician.h
arch/arm/mach-pxa/include/mach/mainstone.h
arch/arm/mach-pxa/include/mach/mfp-pxa930.h
arch/arm/mach-pxa/include/mach/pcm027.h
arch/arm/mach-pxa/include/mach/poodle.h
arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h [new file with mode: 0644]
arch/arm/mach-pxa/include/mach/tosa.h
arch/arm/mach-pxa/include/mach/zeus.h
arch/arm/mach-pxa/include/mach/zylonite.h
arch/arm/mach-pxa/littleton.c
arch/arm/mach-pxa/lpd270.c
arch/arm/mach-pxa/lubbock.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/mainstone.c
arch/arm/mach-pxa/mioa701.c
arch/arm/mach-pxa/palmld.c
arch/arm/mach-pxa/palmt5.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/palmtx.c
arch/arm/mach-pxa/palmz72.c
arch/arm/mach-pxa/pcm027.c
arch/arm/mach-pxa/poodle.c
arch/arm/mach-pxa/pxa3xx-ulpi.c [new file with mode: 0644]
arch/arm/mach-pxa/pxa3xx.c
arch/arm/mach-pxa/pxa930.c
arch/arm/mach-pxa/stargate2.c
arch/arm/mach-pxa/tavorevb.c
arch/arm/mach-pxa/tavorevb3.c [new file with mode: 0644]
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/z2.c
arch/arm/mach-pxa/zeus.c
arch/arm/mach-pxa/zylonite.c
arch/arm/plat-pxa/include/plat/pxa27x_keypad.h [moved from arch/arm/mach-pxa/include/mach/pxa27x_keypad.h with 83% similarity]
drivers/input/keyboard/Kconfig
drivers/input/keyboard/pxa27x_keypad.c
drivers/usb/host/ohci-pxa27x.c
drivers/video/pxa168fb.c

index 0c737460f7e9282708a30275e59d0e3bc5c5f729..e54f922075e2814724eaf3795ebc3ccaf6c2f8c2 100644 (file)
@@ -992,6 +992,11 @@ M: Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 
+ARM/TETON BGA MACHINE SUPPORT
+M:     Mark F. Brown <mark.brown314@gmail.com>
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
+S:     Maintained
+
 ARM/THECUS N2100 MACHINE SUPPORT
 M:     Lennert Buytenhek <kernel@wantstofly.org>
 L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
index ca5aa5aa39e0e529d3627267056a38d3d36b06bf..7949fe65ecd439525b93f1ab0cb5d2a2775b7034 100644 (file)
@@ -510,6 +510,7 @@ config ARCH_MMP
        select GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
        select PLAT_PXA
+       select SPARSE_IRQ
        help
          Support for Marvell's PXA168/PXA910(MMP) and MMP2 processor line.
 
@@ -587,6 +588,7 @@ config ARCH_PXA
        select GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
        select PLAT_PXA
+       select SPARSE_IRQ
        help
          Support for Intel/Marvell's PXA2xx/PXA3xx processor line.
 
index 6ab843eaa35b507b5df31773ecc6fe5a60200b23..0711d3b620ad2286ea5aaabd035fbc1e19627e81 100644 (file)
@@ -57,6 +57,13 @@ config MACH_MARVELL_JASPER
          PXA910-based development board. Since MMP2 is compatible to
          ARMv6 architecture.
 
+config MACH_TETON_BGA
+       bool "Marvell's PXA168 Teton BGA Development Board"
+       select CPU_PXA168
+       help
+         Say 'Y' here if you want to support the Marvell PXA168-based
+         Teton BGA Development Board.
+
 endmenu
 
 config CPU_PXA168
index 8b66d06739c4d9c02ea1c03e98b1d23548894e8d..751cdbf733c852c5970e77e32013d28931b0113e 100644 (file)
@@ -17,3 +17,4 @@ obj-$(CONFIG_MACH_TAVOREVB)   += tavorevb.o
 obj-$(CONFIG_MACH_TTC_DKB)     += ttc_dkb.o
 obj-$(CONFIG_MACH_FLINT)       += flint.o
 obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o
+obj-$(CONFIG_MACH_TETON_BGA)   += teton_bga.o
index 0629394a5fb9ad3dce6b73f0298a9ae56f52310f..4681bedbe788f9f4f920e5576c9ced6ed24f96b3 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
+#include <linux/interrupt.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -23,6 +24,9 @@
 #include <mach/mfp-pxa168.h>
 #include <mach/pxa168.h>
 #include <mach/gpio.h>
+#include <video/pxa168fb.h>
+#include <linux/input.h>
+#include <plat/pxa27x_keypad.h>
 
 #include "common.h"
 
@@ -66,6 +70,43 @@ static unsigned long common_pin_config[] __initdata = {
        GPIO115_I2S_BCLK,
        GPIO116_I2S_RXD,
        GPIO117_I2S_TXD,
+
+       /* LCD */
+       GPIO56_LCD_FCLK_RD,
+       GPIO57_LCD_LCLK_A0,
+       GPIO58_LCD_PCLK_WR,
+       GPIO59_LCD_DENA_BIAS,
+       GPIO60_LCD_DD0,
+       GPIO61_LCD_DD1,
+       GPIO62_LCD_DD2,
+       GPIO63_LCD_DD3,
+       GPIO64_LCD_DD4,
+       GPIO65_LCD_DD5,
+       GPIO66_LCD_DD6,
+       GPIO67_LCD_DD7,
+       GPIO68_LCD_DD8,
+       GPIO69_LCD_DD9,
+       GPIO70_LCD_DD10,
+       GPIO71_LCD_DD11,
+       GPIO72_LCD_DD12,
+       GPIO73_LCD_DD13,
+       GPIO74_LCD_DD14,
+       GPIO75_LCD_DD15,
+       GPIO76_LCD_DD16,
+       GPIO77_LCD_DD17,
+       GPIO78_LCD_DD18,
+       GPIO79_LCD_DD19,
+       GPIO80_LCD_DD20,
+       GPIO81_LCD_DD21,
+       GPIO82_LCD_DD22,
+       GPIO83_LCD_DD23,
+
+       /* Keypad */
+       GPIO109_KP_MKIN1,
+       GPIO110_KP_MKIN0,
+       GPIO111_KP_MKOUT7,
+       GPIO112_KP_MKOUT6,
+       GPIO121_KP_MKIN4,
 };
 
 static struct smc91x_platdata smc91x_info = {
@@ -134,6 +175,51 @@ static struct i2c_board_info aspenite_i2c_info[] __initdata = {
        { I2C_BOARD_INFO("wm8753", 0x1b), },
 };
 
+static struct fb_videomode video_modes[] = {
+       [0] = {
+               .pixclock       = 30120,
+               .refresh        = 60,
+               .xres           = 800,
+               .yres           = 480,
+               .hsync_len      = 1,
+               .left_margin    = 215,
+               .right_margin   = 40,
+               .vsync_len      = 1,
+               .upper_margin   = 34,
+               .lower_margin   = 10,
+               .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
+       },
+};
+
+struct pxa168fb_mach_info aspenite_lcd_info = {
+       .id                     = "Graphic Frame",
+       .modes                  = video_modes,
+       .num_modes              = ARRAY_SIZE(video_modes),
+       .pix_fmt                = PIX_FMT_RGB565,
+       .io_pin_allocation_mode = PIN_MODE_DUMB_24,
+       .dumb_mode              = DUMB_MODE_RGB888,
+       .active                 = 1,
+       .panel_rbswap           = 0,
+       .invert_pixclock        = 0,
+};
+
+static unsigned int aspenite_matrix_key_map[] = {
+       KEY(0, 6, KEY_UP),      /* SW 4 */
+       KEY(0, 7, KEY_DOWN),    /* SW 5 */
+       KEY(1, 6, KEY_LEFT),    /* SW 6 */
+       KEY(1, 7, KEY_RIGHT),   /* SW 7 */
+       KEY(4, 6, KEY_ENTER),   /* SW 8 */
+       KEY(4, 7, KEY_ESC),     /* SW 9 */
+};
+
+static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
+       .matrix_key_rows        = 5,
+       .matrix_key_cols        = 8,
+       .matrix_key_map         = aspenite_matrix_key_map,
+       .matrix_key_map_size    = ARRAY_SIZE(aspenite_matrix_key_map),
+       .debounce_interval      = 30,
+};
+
 static void __init common_init(void)
 {
        mfp_config(ARRAY_AND_SIZE(common_pin_config));
@@ -143,6 +229,8 @@ static void __init common_init(void)
        pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info));
        pxa168_add_ssp(1);
        pxa168_add_nand(&aspenite_nand_info);
+       pxa168_add_fb(&aspenite_lcd_info);
+       pxa168_add_keypad(&aspenite_keypad_info);
 
        /* off-chip devices */
        platform_device_register(&smc91x_device);
@@ -152,6 +240,7 @@ MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
        .phys_io        = APB_PHYS_BASE,
        .io_pg_offst    = (APB_VIRT_BASE >> 18) & 0xfffc,
        .map_io         = mmp_map_io,
+       .nr_irqs        = IRQ_BOARD_START,
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = common_init,
@@ -161,6 +250,7 @@ MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform")
        .phys_io        = APB_PHYS_BASE,
        .io_pg_offst    = (APB_VIRT_BASE >> 18) & 0xfffc,
        .map_io         = mmp_map_io,
+       .nr_irqs        = IRQ_BOARD_START,
        .init_irq       = pxa168_init_irq,
        .timer          = &pxa168_timer,
        .init_machine   = common_init,
index 3b29fa7e9b084c1c3891aea452d1e5cda5c35a03..0ec0ca80bb3ed4e87300030484ee21fa9ac6177a 100644 (file)
 
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/module.h>
 
 #include <asm/page.h>
 #include <asm/mach/map.h>
 #include <mach/addr-map.h>
+#include <mach/cputype.h>
 
 #include "common.h"
 
+#define MMP_CHIPID     (AXI_VIRT_BASE + 0x82c00)
+
+unsigned int mmp_chip_id;
+EXPORT_SYMBOL(mmp_chip_id);
+
 static struct map_desc standard_io_desc[] __initdata = {
        {
                .pfn            = __phys_to_pfn(APB_PHYS_BASE),
@@ -34,4 +41,7 @@ static struct map_desc standard_io_desc[] __initdata = {
 void __init mmp_map_io(void)
 {
        iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
+
+       /* this is early, initialize mmp_chip_id here */
+       mmp_chip_id = __raw_readl(MMP_CHIPID);
 }
index e4312d238eae3ec4e3a4b9a93564a5a265619549..c558425c36138698edf346e92e6d44015040954b 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/smc91x.h>
 #include <linux/io.h>
 #include <linux/gpio.h>
+#include <linux/interrupt.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -25,6 +26,8 @@
 
 #include "common.h"
 
+#define FLINT_NR_IRQS  (IRQ_BOARD_START + 48)
+
 static unsigned long flint_pin_config[] __initdata = {
        /* UART1 */
        GPIO45_UART1_RXD,
@@ -116,6 +119,7 @@ MACHINE_START(FLINT, "Flint Development Platform")
        .phys_io        = APB_PHYS_BASE,
        .io_pg_offst    = (APB_VIRT_BASE >> 18) & 0xfffc,
        .map_io         = mmp_map_io,
+       .nr_irqs        = FLINT_NR_IRQS,
        .init_irq       = mmp2_init_irq,
        .timer          = &mmp2_timer,
        .init_machine   = flint_init,
index 83b18721d93305f6c9f47b0989e21b3e2006b0e5..f43a68b213f111a200e0395638e3cc538e442b3e 100644 (file)
@@ -4,36 +4,51 @@
 #include <asm/cputype.h>
 
 /*
- *  CPU   Stepping   OLD_ID       CPU_ID      CHIP_ID
+ *  CPU   Stepping   CPU_ID      CHIP_ID
  *
- * PXA168    A0    0x41159263   0x56158400   0x00A0A333
- * PXA910    Y0    0x41159262   0x56158000   0x00F0C910
- * MMP2             Z0                 0x560f5811
+ * PXA168    S0    0x56158400   0x0000C910
+ * PXA168    A0    0x56158400   0x00A0A168
+ * PXA910    Y1    0x56158400   0x00F2C920
+ * PXA910    A0    0x56158400   0x00F2C910
+ * PXA910    A1    0x56158400   0x00A0C910
+ * PXA920    Y0    0x56158400   0x00F2C920
+ * PXA920    A0    0x56158400   0x00A0C920
+ * PXA920    A1    0x56158400   0x00A1C920
+ * MMP2             Z0    0x560f5811   0x00F00410
+ * MMP2      Z1    0x560f5811   0x00E00410
+ * MMP2      A0    0x560f5811   0x00A0A610
  */
 
+extern unsigned int mmp_chip_id;
+
 #ifdef CONFIG_CPU_PXA168
-#  define __cpu_is_pxa168(id)  \
-       ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x84; })
+static inline int cpu_is_pxa168(void)
+{
+       return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
+               ((mmp_chip_id & 0xfff) == 0x168);
+}
 #else
-#  define __cpu_is_pxa168(id)  (0)
+#define cpu_is_pxa168()        (0)
 #endif
 
+/* cpu_is_pxa910() is shared on both pxa910 and pxa920 */
 #ifdef CONFIG_CPU_PXA910
-#  define __cpu_is_pxa910(id)  \
-       ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x80; })
+static inline int cpu_is_pxa910(void)
+{
+       return (((read_cpuid_id() >> 8) & 0xff) == 0x84) &&
+               (((mmp_chip_id & 0xfff) == 0x910) ||
+                ((mmp_chip_id & 0xfff) == 0x920));
+}
 #else
-#  define __cpu_is_pxa910(id)  (0)
+#define cpu_is_pxa910()        (0)
 #endif
 
 #ifdef CONFIG_CPU_MMP2
-#  define __cpu_is_mmp2(id)    \
-       ({ unsigned int _id = ((id) >> 8) & 0xff; _id == 0x58; })
+static inline int cpu_is_mmp2(void)
+{
+       return (((cpu_readid_id() >> 8) & 0xff) == 0x58);
 #else
-#  define __cpu_is_mmp2(id)    (0)
+#define cpu_is_mmp2()  (0)
 #endif
 
-#define cpu_is_pxa168()                ({ __cpu_is_pxa168(read_cpuid_id()); })
-#define cpu_is_pxa910()                ({ __cpu_is_pxa910(read_cpuid_id()); })
-#define cpu_is_mmp2()          ({ __cpu_is_mmp2(read_cpuid_id()); })
-
 #endif /* __ASM_MACH_CPUTYPE_H */
index b379cdec4d38410d9caeedf927b6d8cbae4c9ef6..a09d328e2ddd02087cdd7d08c68d6950b0ff6250 100644 (file)
 #define IRQ_GPIO_NUM                   192
 #define IRQ_GPIO(x)                    (IRQ_GPIO_START + (x))
 
-/* Board IRQ - 64 by default, increase if not enough */
 #define IRQ_BOARD_START                        (IRQ_GPIO_START + IRQ_GPIO_NUM)
-#define IRQ_BOARD_END                  (IRQ_BOARD_START + 64)
 
-#define NR_IRQS                                (IRQ_BOARD_END)
+#define NR_IRQS                                (IRQ_BOARD_START)
 
 #endif /* __ASM_MACH_IRQS_H */
index ded43c455ec39870dab17e0da05d2c36d5a91329..4621067c7720f457b311faff80e19dddc87ecd3e 100644 (file)
 #define GPIO86_PWM1_OUT                MFP_CFG(GPIO86, AF2)
 #define GPIO86_PWM2_OUT                MFP_CFG(GPIO86, AF3)
 
+/* Keypad */
+#define GPIO109_KP_MKIN1        MFP_CFG(GPIO109, AF7)
+#define GPIO110_KP_MKIN0        MFP_CFG(GPIO110, AF7)
+#define GPIO111_KP_MKOUT7       MFP_CFG(GPIO111, AF7)
+#define GPIO112_KP_MKOUT6       MFP_CFG(GPIO112, AF7)
+#define GPIO121_KP_MKIN4        MFP_CFG(GPIO121, AF7)
+
 #endif /* __ASM_MACH_MFP_PXA168_H */
index 27e1bc758623808cb30ed6471ca2d45fb2b40dbd..1801e420623259a6a4004dd0f8f9ba280997fc0a 100644 (file)
@@ -5,11 +5,15 @@ struct sys_timer;
 
 extern struct sys_timer pxa168_timer;
 extern void __init pxa168_init_irq(void);
+extern void pxa168_clear_keypad_wakeup(void);
 
 #include <linux/i2c.h>
 #include <mach/devices.h>
 #include <plat/i2c.h>
 #include <plat/pxa3xx_nand.h>
+#include <video/pxa168fb.h>
+#include <plat/pxa27x_keypad.h>
+#include <mach/cputype.h>
 
 extern struct pxa_device_desc pxa168_device_uart1;
 extern struct pxa_device_desc pxa168_device_uart2;
@@ -25,6 +29,8 @@ extern struct pxa_device_desc pxa168_device_ssp3;
 extern struct pxa_device_desc pxa168_device_ssp4;
 extern struct pxa_device_desc pxa168_device_ssp5;
 extern struct pxa_device_desc pxa168_device_nand;
+extern struct pxa_device_desc pxa168_device_fb;
+extern struct pxa_device_desc pxa168_device_keypad;
 
 static inline int pxa168_add_uart(int id)
 {
@@ -97,4 +103,18 @@ static inline int pxa168_add_nand(struct pxa3xx_nand_platform_data *info)
 {
        return pxa_register_device(&pxa168_device_nand, info, sizeof(*info));
 }
+
+static inline int pxa168_add_fb(struct pxa168fb_mach_info *mi)
+{
+       return pxa_register_device(&pxa168_device_fb, mi, sizeof(*mi));
+}
+
+static inline int pxa168_add_keypad(struct pxa27x_keypad_platform_data *data)
+{
+       if (cpu_is_pxa168())
+               data->clear_wakeup_event = pxa168_clear_keypad_wakeup;
+
+       return pxa_register_device(&pxa168_device_keypad, data, sizeof(*data));
+}
+
 #endif /* __ASM_MACH_PXA168_H */
index 9190305141201cf5d99aead14375420c38b7d4ca..ac4702357a6e5b026d8939bdd93fdad9c2ed2c6d 100644 (file)
 #define APMU_FNRST_DIS (1 << 1)
 #define APMU_AXIRST_DIS        (1 << 0)
 
+/* Wake Clear Register */
+#define APMU_WAKE_CLR  APMU_REG(0x07c)
+
+#define APMU_PXA168_KP_WAKE_CLR                (1 << 7)
+#define APMU_PXA168_CFI_WAKE_CLR       (1 << 6)
+#define APMU_PXA168_XD_WAKE_CLR                (1 << 5)
+#define APMU_PXA168_MSP_WAKE_CLR       (1 << 4)
+#define APMU_PXA168_SD4_WAKE_CLR       (1 << 3)
+#define APMU_PXA168_SD3_WAKE_CLR       (1 << 2)
+#define APMU_PXA168_SD2_WAKE_CLR       (1 << 1)
+#define APMU_PXA168_SD1_WAKE_CLR       (1 << 0)
+
 #endif /* __ASM_MACH_REGS_APMU_H */
diff --git a/arch/arm/mach-mmp/include/mach/teton_bga.h b/arch/arm/mach-mmp/include/mach/teton_bga.h
new file mode 100644 (file)
index 0000000..61a539b
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *  linux/arch/arm/mach-mmp/include/mach/teton_bga.h
+ *
+ *  Support for the Marvell PXA168 Teton BGA Development Platform.
+ *
+ *  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
+ *  publishhed by the Free Software Foundation.
+ */
+#ifndef __ASM_MACH_TETON_BGA_H
+#define __ASM_MACH_TETON_BGA_H
+
+/* GPIOs */
+#define MMC_PWENA_GPIO         27
+#define USBHPENB_GPIO          55
+#define RTC_INT_GPIO           78
+#define LCD_VBLK_EN_GPIO       79
+#define LCD_DVDD_EN_GPIO       80
+#define RST_WIFI_GPIO          81
+#define CF_PWEN_GPIO           82
+#define USB_OC_GPIO            83
+#define PWM_GPIO               84
+#define USBHPENA_GPIO          85
+#define TS_INT_GPIO            86
+#define CIR_GPIO               108
+
+#endif /* __ASM_MACH_TETON_BGA_H */
index 80c3e7ab1e1700c2aa96bdb9270b0e5a57004b3f..940ee03e3682909449c3dd4fa36b839144276c08 100644 (file)
 #include <linux/regulator/machine.h>
 #include <linux/regulator/max8649.h>
 #include <linux/mfd/max8925.h>
+#include <linux/interrupt.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/addr-map.h>
 #include <mach/mfp-mmp2.h>
 #include <mach/mmp2.h>
-#include <mach/irqs.h>
 
 #include "common.h"
 
+#define JASPER_NR_IRQS         (IRQ_BOARD_START + 48)
+
 static unsigned long jasper_pin_config[] __initdata = {
        /* UART1 */
        GPIO29_UART1_RXD,
@@ -137,6 +139,7 @@ MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
        .phys_io        = APB_PHYS_BASE,
        .io_pg_offst    = (APB_VIRT_BASE >> 18) & 0xfffc,
        .map_io         = mmp_map_io,
+       .nr_irqs        = JASPER_NR_IRQS,
        .init_irq       = mmp2_init_irq,
        .timer          = &mmp2_timer,
        .init_machine   = jasper_init,
index 652ae660634c5fcd8409972994bd3f97d20acba2..72b4e76315830e91b9dad19dfdedcdf829021559 100644 (file)
@@ -77,8 +77,10 @@ static APBC_CLK(ssp2, PXA168_SSP2, 4, 0);
 static APBC_CLK(ssp3, PXA168_SSP3, 4, 0);
 static APBC_CLK(ssp4, PXA168_SSP4, 4, 0);
 static APBC_CLK(ssp5, PXA168_SSP5, 4, 0);
+static APBC_CLK(keypad, PXA168_KPC, 0, 32000);
 
 static APMU_CLK(nand, NAND, 0x01db, 208000000);
+static APMU_CLK(lcd, LCD, 0x7f, 312000000);
 
 /* device and clock bindings */
 static struct clk_lookup pxa168_clkregs[] = {
@@ -96,6 +98,8 @@ static struct clk_lookup pxa168_clkregs[] = {
        INIT_CLKREG(&clk_ssp4, "pxa168-ssp.3", NULL),
        INIT_CLKREG(&clk_ssp5, "pxa168-ssp.4", NULL),
        INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
+       INIT_CLKREG(&clk_lcd, "pxa168-fb", NULL),
+       INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
 };
 
 static int __init pxa168_init(void)
@@ -132,6 +136,16 @@ struct sys_timer pxa168_timer = {
        .init   = pxa168_timer_init,
 };
 
+void pxa168_clear_keypad_wakeup(void)
+{
+       uint32_t val;
+       uint32_t mask = APMU_PXA168_KP_WAKE_CLR;
+
+       /* wake event clear is needed in order to clear keypad interrupt */
+       val = __raw_readl(APMU_WAKE_CLR);
+       __raw_writel(val |  mask, APMU_WAKE_CLR);
+}
+
 /* on-chip devices */
 PXA168_DEVICE(uart1, "pxa2xx-uart", 0, UART1, 0xd4017000, 0x30, 21, 22);
 PXA168_DEVICE(uart2, "pxa2xx-uart", 1, UART2, 0xd4018000, 0x30, 23, 24);
@@ -147,3 +161,5 @@ PXA168_DEVICE(ssp2, "pxa168-ssp", 1, SSP2, 0xd401c000, 0x40, 54, 55);
 PXA168_DEVICE(ssp3, "pxa168-ssp", 2, SSP3, 0xd401f000, 0x40, 56, 57);
 PXA168_DEVICE(ssp4, "pxa168-ssp", 3, SSP4, 0xd4020000, 0x40, 58, 59);
 PXA168_DEVICE(ssp5, "pxa168-ssp", 4, SSP5, 0xd4021000, 0x40, 60, 61);
+PXA168_DEVICE(fb, "pxa168-fb", -1, LCD, 0xd420b000, 0x1c8);
+PXA168_DEVICE(keypad, "pxa27x-keypad", -1, KEYPAD, 0xd4012000, 0x4c);
diff --git a/arch/arm/mach-mmp/teton_bga.c b/arch/arm/mach-mmp/teton_bga.c
new file mode 100644 (file)
index 0000000..a4a375c
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ *  linux/arch/arm/mach-mmp/teton_bga.c
+ *
+ *  Support for the Marvell PXA168 Teton BGA Development Platform.
+ *
+ *  Author: Mark F. Brown <mark.brown314@gmail.com>
+ *
+ *  This code is based on aspenite.c
+ *
+ *  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
+ *  publishhed by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/gpio.h>
+#include <linux/input.h>
+#include <plat/pxa27x_keypad.h>
+#include <linux/i2c.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+#include <mach/addr-map.h>
+#include <mach/mfp-pxa168.h>
+#include <mach/pxa168.h>
+#include <mach/teton_bga.h>
+
+#include "common.h"
+
+static unsigned long teton_bga_pin_config[] __initdata = {
+       /* UART1 */
+       GPIO107_UART1_TXD,
+       GPIO108_UART1_RXD,
+
+       /* Keypad */
+       GPIO109_KP_MKIN1,
+       GPIO110_KP_MKIN0,
+       GPIO111_KP_MKOUT7,
+       GPIO112_KP_MKOUT6,
+
+       /* I2C Bus */
+       GPIO105_CI2C_SDA,
+       GPIO106_CI2C_SCL,
+
+       /* RTC */
+       GPIO78_GPIO,
+};
+
+static unsigned int teton_bga_matrix_key_map[] = {
+       KEY(0, 6, KEY_ESC),
+       KEY(0, 7, KEY_ENTER),
+       KEY(1, 6, KEY_LEFT),
+       KEY(1, 7, KEY_RIGHT),
+};
+
+static struct pxa27x_keypad_platform_data teton_bga_keypad_info __initdata = {
+       .matrix_key_rows        = 2,
+       .matrix_key_cols        = 8,
+       .matrix_key_map         = teton_bga_matrix_key_map,
+       .matrix_key_map_size    = ARRAY_SIZE(teton_bga_matrix_key_map),
+       .debounce_interval      = 30,
+};
+
+static struct i2c_board_info teton_bga_i2c_info[] __initdata = {
+       {
+               I2C_BOARD_INFO("ds1337", 0x68),
+               .irq = gpio_to_irq(RTC_INT_GPIO)
+       },
+};
+
+static void __init teton_bga_init(void)
+{
+       mfp_config(ARRAY_AND_SIZE(teton_bga_pin_config));
+
+       /* on-chip devices */
+       pxa168_add_uart(1);
+       pxa168_add_keypad(&teton_bga_keypad_info);
+       pxa168_add_twsi(0, NULL, ARRAY_AND_SIZE(teton_bga_i2c_info));
+}
+
+MACHINE_START(TETON_BGA, "PXA168-based Teton BGA Development Platform")
+       .phys_io        = APB_PHYS_BASE,
+       .io_pg_offst    = (APB_VIRT_BASE >> 18) & 0xfffc,
+       .map_io         = mmp_map_io,
+       .nr_irqs        = IRQ_BOARD_START,
+       .init_irq       = pxa168_init_irq,
+       .timer          = &pxa168_timer,
+       .init_machine   = teton_bga_init,
+MACHINE_END
index ee65e05f0cf15e0118461ce4a7b277e5038a77c2..54571139dc4b7e737ddfe4d95fd4cadeafe663b9 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/onenand.h>
+#include <linux/interrupt.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -24,6 +25,8 @@
 
 #include "common.h"
 
+#define TTCDKB_NR_IRQS         (IRQ_BOARD_START + 24)
+
 static unsigned long ttc_dkb_pin_config[] __initdata = {
        /* UART2 */
        GPIO47_UART2_RXD,
@@ -125,6 +128,7 @@ MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
        .phys_io        = APB_PHYS_BASE,
        .io_pg_offst    = (APB_VIRT_BASE >> 18) & 0xfffc,
        .map_io         = mmp_map_io,
+       .nr_irqs        = TTCDKB_NR_IRQS,
        .init_irq       = pxa910_init_irq,
        .timer          = &pxa910_timer,
        .init_machine   = ttc_dkb_init,
index 7aefb90748527ae5b68550b7e311d1244b55639d..dd235ecc9d6c5946d6610bb7adef42cb57476210 100644 (file)
@@ -8,19 +8,16 @@ config ARCH_LUBBOCK
        bool "Intel DBPXA250 Development Platform (aka Lubbock)"
        select PXA25x
        select SA1111
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_MAINSTONE
        bool "Intel HCDDBBVA0 Development Platform (aka Mainstone)"
        select PXA27x
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_ZYLONITE
        bool
        select PXA3xx
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_ZYLONITE300
        bool "PXA3xx Development Platform (aka Zylonite) PXA300/310"
@@ -44,6 +41,10 @@ config MACH_TAVOREVB
        select PXA3xx
        select CPU_PXA930
 
+config MACH_TAVOREVB3
+       bool "PXA95x Development Platform (aka TavorEVB III)"
+       select CPU_PXA950
+
 config MACH_SAAR
        bool "PXA930 Handheld Platform (aka SAAR)"
        select PXA3xx
@@ -61,7 +62,6 @@ config ARCH_VIPER
        select ISA
        select I2C_GPIO
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
        select PXA_HAVE_ISA_IRQS
        select ARCOM_PCMCIA
 
@@ -69,7 +69,6 @@ config MACH_ARCOM_ZEUS
        bool "Arcom/Eurotech ZEUS SBC"
        select PXA27x
        select ISA
-       select PXA_HAVE_BOARD_IRQS
        select PXA_HAVE_ISA_IRQS
        select ARCOM_PCMCIA
 
@@ -77,7 +76,6 @@ config MACH_BALLOON3
        bool "Balloon 3 board"
        select PXA27x
        select IWMMXT
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_CSB726
        bool "Enable Cogent CSB726 System On a Module"
@@ -140,13 +138,11 @@ config MACH_INTELMOTE2
        bool "Intel Mote 2 Platform"
        select PXA27x
        select IWMMXT
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_STARGATE2
        bool "Intel Stargate 2 Platform"
        select PXA27x
        select IWMMXT
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_XCEP
        bool "Iskratel Electronics XCEP"
@@ -206,13 +202,11 @@ config MACH_LOGICPD_PXA270
        bool "LogicPD PXA270 Card Engine Development Platform"
        select PXA27x
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_PCM027
        bool "Phytec phyCORE-PXA270 CPU module (PCM-027)"
        select PXA27x
        select IWMMXT
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_PCM990_BASEBOARD
        bool "PHYTEC PCM-990 development board"
@@ -247,7 +241,6 @@ config MACH_COLIBRI_PXA270_INCOME
        depends on MACH_COLIBRI
        select PXA27x
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_COLIBRI300
        bool "Toradex Colibri PXA300/310"
@@ -274,7 +267,6 @@ config MACH_H4700
        select PXA27x
        select IWMMXT
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_H5000
        bool "HP iPAQ h5000"
@@ -289,7 +281,6 @@ config MACH_MAGICIAN
        select PXA27x
        select IWMMXT
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_MIOA701
        bool "Mitac Mio A701 Support"
@@ -307,7 +298,6 @@ config PXA_EZX
        select PXA27x
        select IWMMXT
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_EZX_A780
        bool "Motorola EZX A780"
@@ -478,7 +468,6 @@ config MACH_POODLE
        depends on PXA_SHARPSL
        select PXA25x
        select SHARP_LOCOMO
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_CORGI
        bool "Enable Sharp SL-C700 (Corgi) Support"
@@ -523,7 +512,6 @@ config MACH_TOSA
        bool "Enable Sharp SL-6000x (Tosa) Support"
        depends on PXA_SHARPSL
        select PXA25x
-       select PXA_HAVE_BOARD_IRQS
 
 config TOSA_BT
        tristate "Control the state of built-in bluetooth chip on Sharp SL-6000"
@@ -552,7 +540,6 @@ config MACH_ICONTROL
 config ARCH_PXA_ESERIES
        bool "PXA based Toshiba e-series PDAs"
        select PXA25x
-       select PXA_HAVE_BOARD_IRQS
 
 config MACH_E330
        bool "Toshiba e330"
@@ -606,7 +593,6 @@ config MACH_ZIPIT2
        bool "Zipit Z2 Handheld"
        select PXA27x
        select HAVE_PWM
-       select PXA_HAVE_BOARD_IRQS
 
 endmenu
 
@@ -643,6 +629,7 @@ config CPU_PXA300
 config CPU_PXA310
        bool
        select CPU_PXA300
+       select PXA310_ULPI if USB_ULPI
        help
          PXA310 (codename Monahans-LV)
 
@@ -692,10 +679,10 @@ config SHARPSL_PM_MAX1111
        select HWMON
        select SENSORS_MAX1111
 
-config PXA_HAVE_BOARD_IRQS
+config PXA_HAVE_ISA_IRQS
        bool
 
-config PXA_HAVE_ISA_IRQS
+config PXA310_ULPI
        bool
 
 endif
index 85c7fb324dbb88ee68ce1d0da0cf0f9c0e92035c..e2f89c2c6f4962ea38a98ea9adb6e3dca8e63ed9 100644 (file)
@@ -18,7 +18,7 @@ endif
 # SoC-specific code
 obj-$(CONFIG_PXA25x)           += mfp-pxa2xx.o pxa2xx.o pxa25x.o
 obj-$(CONFIG_PXA27x)           += mfp-pxa2xx.o pxa2xx.o pxa27x.o
-obj-$(CONFIG_PXA3xx)           += mfp-pxa3xx.o pxa3xx.o smemc.o
+obj-$(CONFIG_PXA3xx)           += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o
 obj-$(CONFIG_CPU_PXA300)       += pxa300.o
 obj-$(CONFIG_CPU_PXA320)       += pxa320.o
 obj-$(CONFIG_CPU_PXA930)       += pxa930.o
@@ -32,6 +32,7 @@ obj-$(CONFIG_MACH_ZYLONITE300)        += zylonite.o zylonite_pxa300.o
 obj-$(CONFIG_MACH_ZYLONITE320) += zylonite.o zylonite_pxa320.o
 obj-$(CONFIG_MACH_LITTLETON)   += littleton.o
 obj-$(CONFIG_MACH_TAVOREVB)    += tavorevb.o
+obj-$(CONFIG_MACH_TAVOREVB3)   += tavorevb3.o
 obj-$(CONFIG_MACH_SAAR)                += saar.o
 
 # 3rd Party Dev Platforms
index 9041340fee1db17cdb6aa670ba43a2457a8193bf..79d0f6cf53d777b6c990e2d3dbcc2c33fec5834e 100644 (file)
@@ -68,42 +68,6 @@ static unsigned long balloon3_pin_config[] __initdata = {
 
        /* Reset, configured as GPIO wakeup source */
        GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
-
-       /* LEDs */
-       GPIO9_GPIO,     /* NAND activity LED */
-       GPIO10_GPIO,    /* Heartbeat LED */
-
-       /* AC97 */
-       GPIO28_AC97_BITCLK,
-       GPIO29_AC97_SDATA_IN_0,
-       GPIO30_AC97_SDATA_OUT,
-       GPIO31_AC97_SYNC,
-       GPIO113_AC97_nRESET,
-       GPIO95_GPIO,
-
-       /* MMC */
-       GPIO32_MMC_CLK,
-       GPIO92_MMC_DAT_0,
-       GPIO109_MMC_DAT_1,
-       GPIO110_MMC_DAT_2,
-       GPIO111_MMC_DAT_3,
-       GPIO112_MMC_CMD,
-
-       /* USB Host */
-       GPIO88_USBH1_PWR,
-       GPIO89_USBH1_PEN,
-
-       /* PC Card */
-       GPIO48_nPOE,
-       GPIO49_nPWE,
-       GPIO50_nPIOR,
-       GPIO51_nPIOW,
-       GPIO85_nPCE_1,
-       GPIO54_nPCE_2,
-       GPIO79_PSKTSEL,
-       GPIO55_nPREG,
-       GPIO56_nPWAIT,
-       GPIO57_nIOIS16,
 };
 
 /******************************************************************************
@@ -131,6 +95,34 @@ int __init parse_balloon3_features(char *arg)
 }
 early_param("balloon3_features", parse_balloon3_features);
 
+/******************************************************************************
+ * Compact Flash slot
+ ******************************************************************************/
+#if    defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
+static unsigned long balloon3_cf_pin_config[] __initdata = {
+       GPIO48_nPOE,
+       GPIO49_nPWE,
+       GPIO50_nPIOR,
+       GPIO51_nPIOW,
+       GPIO85_nPCE_1,
+       GPIO54_nPCE_2,
+       GPIO79_PSKTSEL,
+       GPIO55_nPREG,
+       GPIO56_nPWAIT,
+       GPIO57_nIOIS16,
+};
+
+static void __init balloon3_cf_init(void)
+{
+       if (!balloon3_has(BALLOON3_FEATURE_CF))
+               return;
+
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_cf_pin_config));
+}
+#else
+static inline void balloon3_cf_init(void) {}
+#endif
+
 /******************************************************************************
  * NOR Flash
  ******************************************************************************/
@@ -179,6 +171,15 @@ static inline void balloon3_nor_init(void) {}
  ******************************************************************************/
 #if    defined(CONFIG_TOUCHSCREEN_UCB1400) || \
        defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
+static unsigned long balloon3_ac97_pin_config[] __initdata = {
+       GPIO28_AC97_BITCLK,
+       GPIO29_AC97_SDATA_IN_0,
+       GPIO30_AC97_SDATA_OUT,
+       GPIO31_AC97_SYNC,
+       GPIO113_AC97_nRESET,
+       GPIO95_GPIO,
+};
+
 static struct ucb1400_pdata vpac270_ucb1400_pdata = {
        .irq            = IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ),
 };
@@ -197,6 +198,7 @@ static void __init balloon3_ts_init(void)
        if (!balloon3_has(BALLOON3_FEATURE_AUDIO))
                return;
 
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ac97_pin_config));
        pxa_set_ac97_info(NULL);
        platform_device_register(&balloon3_ucb1400_device);
 }
@@ -208,6 +210,11 @@ static inline void balloon3_ts_init(void) {}
  * Framebuffer
  ******************************************************************************/
 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
+static unsigned long balloon3_lcd_pin_config[] __initdata = {
+       GPIOxx_LCD_TFT_16BPP,
+       GPIO99_GPIO,
+};
+
 static struct pxafb_mode_info balloon3_lcd_modes[] = {
        {
                .pixclock               = 38000,
@@ -242,6 +249,8 @@ static void __init balloon3_lcd_init(void)
        if (!balloon3_has(BALLOON3_FEATURE_TOPPOLY))
                return;
 
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config));
+
        ret = gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT, "BKL-ON");
        if (ret) {
                pr_err("Requesting BKL-ON GPIO failed!\n");
@@ -271,6 +280,15 @@ static inline void balloon3_lcd_init(void) {}
  * SD/MMC card controller
  ******************************************************************************/
 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
+static unsigned long balloon3_mmc_pin_config[] __initdata = {
+       GPIO32_MMC_CLK,
+       GPIO92_MMC_DAT_0,
+       GPIO109_MMC_DAT_1,
+       GPIO110_MMC_DAT_2,
+       GPIO111_MMC_DAT_3,
+       GPIO112_MMC_CMD,
+};
+
 static struct pxamci_platform_data balloon3_mci_platform_data = {
        .ocr_mask               = MMC_VDD_32_33 | MMC_VDD_33_34,
        .gpio_card_detect       = -1,
@@ -281,6 +299,7 @@ static struct pxamci_platform_data balloon3_mci_platform_data = {
 
 static void __init balloon3_mmc_init(void)
 {
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_mmc_pin_config));
        pxa_set_mci_info(&balloon3_mci_platform_data);
 }
 #else
@@ -339,6 +358,11 @@ static inline void balloon3_irda_init(void) {}
  * USB Host
  ******************************************************************************/
 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
+static unsigned long balloon3_uhc_pin_config[] __initdata = {
+       GPIO88_USBH1_PWR,
+       GPIO89_USBH1_PEN,
+};
+
 static struct pxaohci_platform_data balloon3_ohci_info = {
        .port_mode      = PMM_PERPORT_MODE,
        .flags          = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
@@ -348,6 +372,7 @@ static void __init balloon3_uhc_init(void)
 {
        if (!balloon3_has(BALLOON3_FEATURE_OHCI))
                return;
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_uhc_pin_config));
        pxa_set_ohci_info(&balloon3_ohci_info);
 }
 #else
@@ -358,6 +383,11 @@ static inline void balloon3_uhc_init(void) {}
  * LEDs
  ******************************************************************************/
 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
+static unsigned long balloon3_led_pin_config[] __initdata = {
+       GPIO9_GPIO,     /* NAND activity LED */
+       GPIO10_GPIO,    /* Heartbeat LED */
+};
+
 struct gpio_led balloon3_gpio_leds[] = {
        {
                .name                   = "balloon3:green:idle",
@@ -436,6 +466,7 @@ static struct platform_device balloon3_pcf_leds = {
 
 static void __init balloon3_leds_init(void)
 {
+       pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_led_pin_config));
        platform_device_register(&balloon3_leds);
        platform_device_register(&balloon3_pcf_leds);
 }
@@ -757,6 +788,7 @@ static void __init balloon3_init(void)
        balloon3_ts_init();
        balloon3_udc_init();
        balloon3_uhc_init();
+       balloon3_cf_init();
 }
 
 static struct map_desc balloon3_io_desc[] __initdata = {
@@ -779,6 +811,7 @@ MACHINE_START(BALLOON3, "Balloon3")
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = balloon3_map_io,
+       .nr_irqs        = BALLOON3_NR_IRQS,
        .init_irq       = balloon3_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = balloon3_init,
index bff6e78f033d250d803c9a9bc82474ac3804b317..ad40e7b141e0efb554490c940dc51fb226096d68 100644 (file)
@@ -33,6 +33,9 @@
 extern void cmx255_init(void);
 extern void cmx270_init(void);
 
+/* reserve IRQs for IT8152 */
+#define CMX2XX_NR_IRQS         (IRQ_BOARD_START + 40)
+
 /* virtual addresses for statically mapped regions */
 #define CMX2XX_VIRT_BASE       (0xe8000000)
 #define CMX2XX_IT8152_VIRT     (CMX2XX_VIRT_BASE)
@@ -514,6 +517,7 @@ MACHINE_START(ARMCORE, "Compulab CM-X2XX")
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = cmx2xx_map_io,
+       .nr_irqs        = CMX2XX_NR_IRQS,
        .init_irq       = cmx2xx_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = cmx2xx_init,
index c70e6c2f4e7c47daf9c8a595bf6fafd11f2971d7..8e0b5622b2779c38b733dc1990b6bc4459a205e6 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/platform_device.h>
+#include <linux/clk.h>
 
 #include <linux/gpio.h>
 #include <linux/dm9000.h>
@@ -50,6 +51,7 @@
 #include <plat/i2c.h>
 #include <plat/pxa3xx_nand.h>
 #include <mach/audio.h>
+#include <mach/pxa3xx-u2d.h>
 
 #include <asm/mach/map.h>
 
@@ -68,6 +70,8 @@
 #define GPIO97_RTC_RD          (97)
 #define GPIO98_RTC_IO          (98)
 
+#define GPIO_ULPI_PHY_RST      (127)
+
 static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = {
        /* LCD */
        GPIO54_LCD_LDD_0,
@@ -472,6 +476,78 @@ static void __init cm_x300_init_mmc(void)
 static inline void cm_x300_init_mmc(void) {}
 #endif
 
+#if defined(CONFIG_PXA310_ULPI)
+static struct clk *pout_clk;
+
+static int cm_x300_ulpi_phy_reset(void)
+{
+       int err;
+
+       /* reset the PHY */
+       err = gpio_request(GPIO_ULPI_PHY_RST, "ulpi reset");
+       if (err) {
+               pr_err("%s: failed to request ULPI reset GPIO: %d\n",
+                      __func__, err);
+               return err;
+       }
+
+       gpio_direction_output(GPIO_ULPI_PHY_RST, 0);
+       msleep(10);
+       gpio_set_value(GPIO_ULPI_PHY_RST, 1);
+       msleep(10);
+
+       gpio_free(GPIO_ULPI_PHY_RST);
+
+       return 0;
+}
+
+static inline int cm_x300_u2d_init(struct device *dev)
+{
+       int err = 0;
+
+       if (cpu_is_pxa310()) {
+               /* CLK_POUT is connected to the ULPI PHY */
+               pout_clk = clk_get(NULL, "CLK_POUT");
+               if (IS_ERR(pout_clk)) {
+                       err = PTR_ERR(pout_clk);
+                       pr_err("%s: failed to get CLK_POUT: %d\n",
+                              __func__, err);
+                       return err;
+               }
+               clk_enable(pout_clk);
+
+               err = cm_x300_ulpi_phy_reset();
+               if (err) {
+                       clk_disable(pout_clk);
+                       clk_put(pout_clk);
+               }
+       }
+
+       return err;
+}
+
+static void cm_x300_u2d_exit(struct device *dev)
+{
+       if (cpu_is_pxa310()) {
+               clk_disable(pout_clk);
+               clk_put(pout_clk);
+       }
+}
+
+static struct pxa3xx_u2d_platform_data cm_x300_u2d_platform_data = {
+       .ulpi_mode      = ULPI_SER_6PIN,
+       .init           = cm_x300_u2d_init,
+       .exit           = cm_x300_u2d_exit,
+};
+
+static void cm_x300_init_u2d(void)
+{
+       pxa3xx_set_u2d_info(&cm_x300_u2d_platform_data);
+}
+#else
+static inline void cm_x300_init_u2d(void) {}
+#endif
+
 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
 static int cm_x300_ohci_init(struct device *dev)
 {
@@ -754,6 +830,7 @@ static void __init cm_x300_init(void)
        cm_x300_init_da9030();
        cm_x300_init_dm9000();
        cm_x300_init_lcd();
+       cm_x300_init_u2d();
        cm_x300_init_ohci();
        cm_x300_init_mmc();
        cm_x300_init_nand();
index 0a0d0fe99220d7f450e61dc04495d8dfe4492be3..88fbec05ec50f09e1724e431e761b1b9b4f1a261 100644 (file)
@@ -159,7 +159,7 @@ static int pxa3xx_cpufreq_verify(struct cpufreq_policy *policy)
 
 static unsigned int pxa3xx_cpufreq_get(unsigned int cpu)
 {
-       return get_clk_frequency_khz(0);
+       return pxa3xx_get_clk_frequency_khz(0);
 }
 
 static int pxa3xx_cpufreq_set(struct cpufreq_policy *policy,
@@ -212,7 +212,8 @@ static int pxa3xx_cpufreq_init(struct cpufreq_policy *policy)
        policy->cpuinfo.min_freq = 104000;
        policy->cpuinfo.max_freq = (cpu_is_pxa320()) ? 806000 : 624000;
        policy->cpuinfo.transition_latency = 1000; /* FIXME: 1 ms, assumed */
-       policy->cur = policy->min = policy->max = get_clk_frequency_khz(0);
+       policy->max = pxa3xx_get_clk_frequency_khz(0);
+       policy->cur = policy->min = policy->max;
 
        if (cpu_is_pxa300() || cpu_is_pxa310())
                ret = setup_freqs_table(policy, ARRAY_AND_SIZE(pxa300_freqs));
index 65447dc736c2fd5b3f0fd4e3ce4c46c3c9711dc3..08b410343870ae2518afb4303110d5807dfc12d1 100644 (file)
@@ -6,11 +6,12 @@
 
 #include <asm/pmu.h>
 #include <mach/udc.h>
+#include <mach/pxa3xx-u2d.h>
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
 #include <mach/irda.h>
 #include <mach/ohci.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/pxa2xx_spi.h>
 #include <mach/camera.h>
 #include <mach/audio.h>
@@ -134,6 +135,33 @@ struct platform_device pxa27x_device_udc = {
        }
 };
 
+#ifdef CONFIG_PXA3xx
+static struct resource pxa3xx_u2d_resources[] = {
+       [0] = {
+               .start  = 0x54100000,
+               .end    = 0x54100fff,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = IRQ_USB2,
+               .end    = IRQ_USB2,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device pxa3xx_device_u2d = {
+       .name           = "pxa3xx-u2d",
+       .id             = -1,
+       .resource       = pxa3xx_u2d_resources,
+       .num_resources  = ARRAY_SIZE(pxa3xx_u2d_resources),
+};
+
+void __init pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info)
+{
+       pxa_register_device(&pxa3xx_device_u2d, info);
+}
+#endif /* CONFIG_PXA3xx */
+
 static struct resource pxafb_resources[] = {
        [0] = {
                .start  = 0x44000000,
index 50353ea49ba455bc856d371f1e6170861337f8c4..715e8bd02e248930e449c4e6c2c169054c837c6e 100644 (file)
@@ -4,6 +4,7 @@ extern struct platform_device pxa3xx_device_mci2;
 extern struct platform_device pxa3xx_device_mci3;
 extern struct platform_device pxa25x_device_udc;
 extern struct platform_device pxa27x_device_udc;
+extern struct platform_device pxa3xx_device_u2d;
 extern struct platform_device pxa_device_fb;
 extern struct platform_device pxa_device_ffuart;
 extern struct platform_device pxa_device_btuart;
index 0517c17978f3103d96e51954237801fbf34088a0..51286a738a3b02322ebf87a658d55c87a89913d3 100644 (file)
@@ -43,7 +43,7 @@
 #include <mach/pxafb.h>
 #include <mach/ohci.h>
 #include <mach/mmc.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <plat/i2c.h>
 #include <mach/camera.h>
 #include <mach/pxa2xx_spi.h>
index 349212a1cbd3ab741a60412c431ab43fd1b17330..4971ce119501566a552c4398eca6d52726aeefe5 100644 (file)
@@ -29,6 +29,7 @@
 
 #include <mach/pxa25x.h>
 #include <mach/eseries-gpio.h>
+#include <mach/eseries-irq.h>
 #include <mach/audio.h>
 #include <mach/pxafb.h>
 #include <mach/udc.h>
@@ -183,6 +184,7 @@ MACHINE_START(E330, "Toshiba e330")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e330_init,
@@ -233,6 +235,7 @@ MACHINE_START(E350, "Toshiba e350")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e350_init,
@@ -356,6 +359,7 @@ MACHINE_START(E400, "Toshiba e400")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e400_init,
@@ -545,6 +549,7 @@ MACHINE_START(E740, "Toshiba e740")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e740_init,
@@ -737,6 +742,7 @@ MACHINE_START(E750, "Toshiba e750")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e750_init,
@@ -933,6 +939,7 @@ MACHINE_START(E800, "Toshiba e800")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ESERIES_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .fixup          = eseries_fixup,
        .init_machine   = e800_init,
index 626c82b1397031bef376ddf1acbfd5feb8a9fe41..f997e84555573ba16587ca98ba3e7b6669756382 100644 (file)
 #include <mach/ohci.h>
 #include <plat/i2c.h>
 #include <mach/hardware.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/camera.h>
 
 #include "devices.h"
 #include "generic.h"
 
+#define EZX_NR_IRQS                    (IRQ_BOARD_START + 24)
+
 #define GPIO12_A780_FLIP_LID           12
 #define GPIO15_A1200_FLIP_LID          15
 #define GPIO15_A910_FLIP_LID           15
@@ -800,6 +802,7 @@ MACHINE_START(EZX_A780, "Motorola EZX A780")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = a780_init,
@@ -866,6 +869,7 @@ MACHINE_START(EZX_E680, "Motorola EZX E680")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = e680_init,
@@ -932,6 +936,7 @@ MACHINE_START(EZX_A1200, "Motorola EZX A1200")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = a1200_init,
@@ -1124,6 +1129,7 @@ MACHINE_START(EZX_A910, "Motorola EZX A910")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = a910_init,
@@ -1190,6 +1196,7 @@ MACHINE_START(EZX_E6, "Motorola EZX E6")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = e6_init,
@@ -1230,6 +1237,7 @@ MACHINE_START(EZX_E2, "Motorola EZX E2")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = pxa_map_io,
+       .nr_irqs        = EZX_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = e2_init,
index baabb3ce088e842669bfd70e3a60e56489fcbe00..6451e9c3a93fba45a7a1b1d39693dc98f94a40d2 100644 (file)
@@ -66,8 +66,7 @@ unsigned int get_clk_frequency_khz(int info)
                return pxa25x_get_clk_frequency_khz(info);
        else if (cpu_is_pxa27x())
                return pxa27x_get_clk_frequency_khz(info);
-       else
-               return pxa3xx_get_clk_frequency_khz(info);
+       return 0;
 }
 EXPORT_SYMBOL(get_clk_frequency_khz);
 
@@ -80,8 +79,7 @@ unsigned int get_memclk_frequency_10khz(void)
                return pxa25x_get_memclk_frequency_10khz();
        else if (cpu_is_pxa27x())
                return pxa27x_get_memclk_frequency_10khz();
-       else
-               return pxa3xx_get_memclk_frequency_10khz();
+       return 0;
 }
 EXPORT_SYMBOL(get_memclk_frequency_10khz);
 
index c6305c5b8a72c1497ee05aee42d7795b07513c94..4b1ad2769ed70387fad13ba9e9a775f6e1ce2466 100644 (file)
@@ -54,11 +54,9 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
 
 #ifdef CONFIG_PXA3xx
 extern unsigned pxa3xx_get_clk_frequency_khz(int);
-extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
 extern void pxa3xx_clear_reset_status(unsigned int);
 #else
 #define pxa3xx_get_clk_frequency_khz(x)                (0)
-#define pxa3xx_get_memclk_frequency_10khz()    (0)
 static inline void pxa3xx_clear_reset_status(unsigned int mask) {}
 #endif
 
index 848c861dd23f20acbbd121d32a9e0721acbee45c..10104f16e6e42474bbc82a9ef330df45f08d7ac5 100644 (file)
@@ -874,6 +874,7 @@ MACHINE_START(H4700, "HP iPAQ HX4700")
        .io_pg_offst  = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params  = 0xa0000100,
        .map_io       = pxa_map_io,
+       .nr_irqs      = HX4700_NR_IRQS,
        .init_irq     = pxa27x_init_irq,
        .init_machine = hx4700_init,
        .timer        = &pxa_timer,
index eec92e6fd7cf804f3ba611325cdbc491da3dcf96..561562b4360b7b22477373c8d7fab7a6eb715478 100644 (file)
@@ -174,6 +174,8 @@ 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)
+
 extern int balloon3_has(enum balloon3_features feature);
 
 #endif
index f2a93d5e31d303034074425b2735e71f37227bf1..de292b269c63ead3a54c29acc920d5cab1786582 100644 (file)
@@ -25,3 +25,4 @@
 #define TMIO_SD_IRQ     IRQ_TMIO(1)
 #define TMIO_USB_IRQ    IRQ_TMIO(2)
 
+#define ESERIES_NR_IRQS        (IRQ_BOARD_START + 16)
index 9eaeed1f87f1fad6f8754dfa736473ecf113f33a..37408449ec25e023264ae8852fc3bec9feb381a6 100644 (file)
@@ -17,6 +17,7 @@
 
 #define HX4700_ASIC3_GPIO_BASE NR_BUILTIN_GPIO
 #define HX4700_EGPIO_BASE      (HX4700_ASIC3_GPIO_BASE + ASIC3_NUM_GPIOS)
+#define HX4700_NR_IRQS         (IRQ_BOARD_START + 70)
 
 /*
  * PXA GPIOs
index ffc8314520f2e109b5db96bfebdfb97096f90d90..d372caa75dc737d4ca51f4ddcc34c64ac530bd43 100644 (file)
 /*
  * The following interrupts are for board specific purposes. Since
  * the kernel can only run on one machine at a time, we can re-use
- * these.  There will be 16 IRQs by default.  If it is not enough,
- * IRQ_BOARD_END is allowed be customized for each board, but keep
- * the numbers within sensible limits and in descending order, so
- * when multiple config options are selected, the maximum will be
- * used.
+ * these.
+ * By default, no board IRQ is reserved. It should be finished in
+ * custom board since sparse IRQ is already enabled.
  */
 #define IRQ_BOARD_START                (PXA_GPIO_IRQ_BASE + PXA_GPIO_IRQ_NUM)
 
-#if defined(CONFIG_MACH_H4700)
-#define IRQ_BOARD_END          (IRQ_BOARD_START + 70)
-#elif defined(CONFIG_MACH_ZYLONITE)
-#define IRQ_BOARD_END          (IRQ_BOARD_START + 32)
-#elif defined(CONFIG_PXA_EZX)
-#define IRQ_BOARD_END          (IRQ_BOARD_START + 23)
-#else
-#define IRQ_BOARD_END          (IRQ_BOARD_START + 16)
-#endif
-
-/*
- * Figure out the MAX IRQ number.
- *
- * If we have an SA1111, the max IRQ is S1_BVD1_STSCHG+1.
- * If we have an LoCoMo, the max IRQ is IRQ_LOCOMO_SPI_TEND+1
- * Otherwise, we have the standard IRQs only.
- */
-#ifdef CONFIG_SA1111
-#define NR_IRQS                        (IRQ_BOARD_END + 55)
-#elif defined(CONFIG_PXA_HAVE_BOARD_IRQS)
-#define NR_IRQS                        (IRQ_BOARD_END)
-#else
 #define NR_IRQS                        (IRQ_BOARD_START)
-#endif
-
-/* add IT8152 IRQs beyond BOARD_END */
-#ifdef CONFIG_PCI_HOST_ITE8152
-#define IT8152_LAST_IRQ         (IRQ_BOARD_END + 40)
-
-#if NR_IRQS < (IT8152_LAST_IRQ+1)
-#undef NR_IRQS
-#define NR_IRQS (IT8152_LAST_IRQ+1)
-#endif
-
-#endif /* CONFIG_PCI_HOST_ITE8152 */
 
 #endif /* __ASM_MACH_IRQS_H */
index 6c9b21c5132254dad261aa1dba4097293248684d..2a5726c15e0e446f855f857d4e773a6785ba8486 100644 (file)
@@ -10,4 +10,6 @@
 #define EXT0_GPIO_BASE (NR_BUILTIN_GPIO)
 #define EXT0_GPIO(x)   (EXT0_GPIO_BASE + (x))
 
+#define LITTLETON_NR_IRQS      (IRQ_BOARD_START + 8)
+
 #endif /* __ASM_ARCH_LITTLETON_H */
index 0e6440c81683d0c18548bdd863016fa9444fe64e..cd070092b6eb708b1397fa82ba3e2e05b6104bf0 100644 (file)
@@ -38,5 +38,6 @@
 #define LPD270_USBC_IRQ                LPD270_IRQ(2)
 #define LPD270_ETHERNET_IRQ    LPD270_IRQ(3)
 #define LPD270_AC97_IRQ                LPD270_IRQ(4)
+#define LPD270_NR_IRQS         (IRQ_BOARD_START + 5)
 
 #endif
index a0d4247f08fc56aedcb845bb1c8403d64f64d11b..2a086e8373eb7bf1104892784aba7a5236a3bd5b 100644 (file)
@@ -45,6 +45,9 @@
 #define LUBBOCK_USB_DISC_IRQ   LUBBOCK_IRQ(6)  /* usb disconnect */
 #define LUBBOCK_LAST_IRQ       LUBBOCK_IRQ(6)
 
+#define LUBBOCK_SA1111_IRQ_BASE        (IRQ_BOARD_START + 16)
+#define LUBBOCK_NR_IRQS                (IRQ_BOARD_START + 16 + 55)
+
 #ifndef __ASSEMBLY__
 extern void lubbock_set_misc_wr(unsigned int mask, unsigned int set);
 #endif
index 20ef37d4a9a75b2567e73791d1ba8ee5056ae563..0a2efcf7947c5c4da26e7140f4256387f3387769 100644 (file)
@@ -71,6 +71,8 @@
 #define IRQ_MAGICIAN_BT                (IRQ_BOARD_START + 2)
 #define IRQ_MAGICIAN_VBUS      (IRQ_BOARD_START + 3)
 
+#define MAGICIAN_NR_IRQS       (IRQ_BOARD_START + 8)
+
 /*
  * CPLD EGPIOs
  */
index 86e623abd64d6404e3d39848d5fee8b1a50682d4..4c2d11cd824dda4415d1ad74af1a368ffdd9b439 100644 (file)
 #define MAINSTONE_S1_STSCHG_IRQ        MAINSTONE_IRQ(14)
 #define MAINSTONE_S1_IRQ       MAINSTONE_IRQ(15)
 
+#define MAINSTONE_NR_IRQS      (IRQ_BOARD_START + 16)
+
 #endif
index 0d119d3b922143211b12350244c3087209ba3cbd..04f7c97044f3bf4c1a8798b87bf4e86b31086975 100644 (file)
@@ -69,6 +69,7 @@
 #define nBE0_GPIO_60           MFP_CFG(nBE0, AF0)
 #define nBE1_GPIO_61           MFP_CFG(nBE1, AF0)
 #define RDY_GPIO_62            MFP_CFG(RDY, AF0)
+#define PMIC_INT_GPIO83                MFP_CFG_LPM(PMIC_INT, AF0, PULL_HIGH)
 
 /* Chip Select */
 #define DF_nCS0_nCS2           MFP_CFG_LPM(DF_nCS0, AF3, PULL_HIGH)
@@ -92,6 +93,9 @@
 #define GPIO63_CI2C_SCL                MFP_CFG_LPM(GPIO63, AF4, PULL_HIGH)
 #define GPIO64_CI2C_SDA                MFP_CFG_LPM(GPIO64, AF4, PULL_HIGH)
 
+#define GPIO73_CI2C_SCL                MFP_CFG_LPM(GPIO73, AF1, PULL_HIGH)
+#define GPIO74_CI2C_SDA                MFP_CFG_LPM(GPIO74, AF1, PULL_HIGH)
+
 #define GPIO77_CI2C_SCL                MFP_CFG_LPM(GPIO77, AF2, PULL_HIGH)
 #define GPIO78_CI2C_SDA                MFP_CFG_LPM(GPIO78, AF2, PULL_HIGH)
 
 #define GPIO69_UART1_CTS       MFP_CFG(GPIO69, AF2)
 #define GPIO70_UART1_RTS       MFP_CFG(GPIO70, AF2)
 
+#define GPIO53_UART1_TXD       MFP_CFG(GPIO53, AF2)
+#define GPIO54_UART1_RXD       MFP_CFG(GPIO54, AF2)
+
 /* UART2 - BTUART */
 #define GPIO91_UART2_RXD       MFP_CFG(GPIO91, AF1)
 #define GPIO92_UART2_TXD       MFP_CFG(GPIO92, AF1)
index 04083263167ed5ad0ab84a014cc14420c4175ffd..4bac588478a898ee6dae6107a9cd44fc7d365c69 100644 (file)
@@ -30,6 +30,8 @@
 #define PCM027_MMCDET_IRQ      PCM027_IRQ(2)
 #define PCM027_PM_5V_IRQ       PCM027_IRQ(3)
 
+#define PCM027_NR_IRQS         (IRQ_BOARD_START + 32)
+
 /* I2C RTC */
 #define PCM027_RTC_IRQ_GPIO    0
 #define PCM027_RTC_IRQ         IRQ_GPIO(PCM027_RTC_IRQ_GPIO)
index 0b3e6d051c6425d86238473ab31f25702cd29c92..83d1cfd00fc9f7d05e75c4a0c94383c479407179 100644 (file)
@@ -85,6 +85,8 @@
 #define POODLE_LOCOMO_GPIO_232VCC_ON   LOCOMO_GPIO(12)
 #define POODLE_LOCOMO_GPIO_JK_B        LOCOMO_GPIO(13)
 
+#define POODLE_NR_IRQS         (IRQ_BOARD_START + 4)   /* 4 for LoCoMo */
+
 extern struct platform_device poodle_locomo_device;
 
 #endif /* __ASM_ARCH_POODLE_H  */
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h b/arch/arm/mach-pxa/include/mach/pxa3xx-u2d.h
new file mode 100644 (file)
index 0000000..9d82cb6
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * PXA3xx U2D header
+ *
+ * Copyright (C) 2010 CompuLab Ltd.
+ *
+ * Igor Grinberg <grinberg@compulab.co.il>
+ *
+ * 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 __PXA310_U2D__
+#define __PXA310_U2D__
+
+#include <linux/usb/ulpi.h>
+
+struct pxa3xx_u2d_platform_data {
+
+#define ULPI_SER_6PIN  (1 << 0)
+#define ULPI_SER_3PIN  (1 << 1)
+       unsigned int ulpi_mode;
+
+       int (*init)(struct device *);
+       void (*exit)(struct device *);
+};
+
+
+/* Start PXA3xx U2D host */
+int pxa3xx_u2d_start_hc(struct usb_bus *host);
+/* Stop PXA3xx U2D host */
+void pxa3xx_u2d_stop_hc(struct usb_bus *host);
+
+extern void pxa3xx_set_u2d_info(struct pxa3xx_u2d_platform_data *info);
+
+#endif /* __PXA310_U2D__ */
index 1bbd1f2e4beb3065ff75d4204d375ac88dc10847..1272c4b56ceb8de05875e75310df11b86b377982 100644 (file)
@@ -20,6 +20,7 @@
 /* Jacket Scoop */
 #define TOSA_SCOOP_PHYS        (PXA_CS5_PHYS + 0x00800000)
 
+#define TOSA_NR_IRQS           (IRQ_BOARD_START + TC6393XB_NR_IRQS)
 /*
  * SCOOP2 internal GPIOs
  */
index 6e119976003e72979af443fb07e2b82c9441f74f..faa408ab7ad72f38c6951849008c86397b866c99 100644 (file)
@@ -15,6 +15,8 @@
 #ifndef _MACH_ZEUS_H
 #define _MACH_ZEUS_H
 
+#define ZEUS_NR_IRQS           (IRQ_BOARD_START + 48)
+
 /* Physical addresses */
 #define ZEUS_FLASH_PHYS                PXA_CS0_PHYS
 #define ZEUS_ETH0_PHYS         PXA_CS1_PHYS
index 9edf645368d65989376ca144a2d49a1fbc2d0f74..ea24998b923c27aed8b13d7aa091368b2f47a7ef 100644 (file)
@@ -5,6 +5,8 @@
 
 #define EXT_GPIO(x)            (128 + (x))
 
+#define ZYLONITE_NR_IRQS       (IRQ_BOARD_START + 32)
+
 /* the following variables are processor specific and initialized
  * by the corresponding zylonite_pxa3xx_init()
  */
index 9b9046185b00e3e8c2c7e47b13fd37c478f74640..eb5850624c1d39fdff54d98ca29391dbc87cc4d6 100644 (file)
@@ -43,7 +43,7 @@
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
 #include <mach/pxa2xx_spi.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/littleton.h>
 #include <plat/i2c.h>
 #include <plat/pxa3xx_nand.h>
@@ -441,6 +441,7 @@ MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleto
        .boot_params    = 0xa0000100,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = pxa_map_io,
+       .nr_irqs        = LITTLETON_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = littleton_init,
index d279507fc748275dfff6670544699cf6464eee7f..fc9502ef40240426a86bb61f364b71f9eaebd61e 100644 (file)
@@ -509,6 +509,7 @@ MACHINE_START(LOGICPD_PXA270, "LogicPD PXA270 Card Engine")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params    = 0xa0000100,
        .map_io         = lpd270_map_io,
+       .nr_irqs        = LPD270_NR_IRQS,
        .init_irq       = lpd270_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = lpd270_init,
index 330c3282856e620ec879563e16655c6d56d6d2a9..1956c23093d18a68c30340f2b9f9d6dfb1621f73 100644 (file)
@@ -229,7 +229,7 @@ static struct resource sa1111_resources[] = {
 };
 
 static struct sa1111_platform_data sa1111_info = {
-       .irq_base       = IRQ_BOARD_END,
+       .irq_base       = LUBBOCK_SA1111_IRQ_BASE,
 };
 
 static struct platform_device sa1111_device = {
@@ -560,6 +560,7 @@ MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = lubbock_map_io,
+       .nr_irqs        = LUBBOCK_NR_IRQS,
        .init_irq       = lubbock_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = lubbock_init,
index e81dd0c8e40dcced02770cb7dc57c4ca4634102b..42a0c2b41281118e108354e0ffb0f5366510defa 100644 (file)
@@ -768,6 +768,7 @@ MACHINE_START(MAGICIAN, "HTC Magician")
        .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .boot_params = 0xa0000100,
        .map_io = pxa_map_io,
+       .nr_irqs = MAGICIAN_NR_IRQS,
        .init_irq = pxa27x_init_irq,
        .init_machine = magician_init,
        .timer = &pxa_timer,
index 5543c64da9efbaedf903d8eaff3904616f90bd7e..8b710024601cf2d156a62ce814edd12c285d1626 100644 (file)
@@ -50,7 +50,7 @@
 #include <mach/mmc.h>
 #include <mach/irda.h>
 #include <mach/ohci.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 
 #include "generic.h"
 #include "devices.h"
@@ -628,6 +628,7 @@ MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
        .boot_params    = 0xa0000100,   /* BLOB boot parameter setting */
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = mainstone_map_io,
+       .nr_irqs        = MAINSTONE_NR_IRQS,
        .init_irq       = mainstone_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = mainstone_init,
index dc66942ef9ab47d6b911bfde28b70c1c43fb5feb..ffb3f5a8a086f88b41877f2ce48534d650299559 100644 (file)
@@ -45,7 +45,7 @@
 
 #include <mach/pxa27x.h>
 #include <mach/regs-rtc.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
 #include <mach/udc.h>
index 91038eeafe44c10680741f1266ed770d61755274..3ff0c4a1ca4c5ed9f79586bb9f151cad05a2696e 100644 (file)
@@ -39,7 +39,7 @@
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
 #include <mach/irda.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/palmasoc.h>
 #include <mach/palm27x.h>
 
index 1c281995f6583faf34faa0e5daa1a5d294a7c3de..5b9f766d14685a8a6cd2062cf6e4e4a4bcda4655 100644 (file)
@@ -39,7 +39,7 @@
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
 #include <mach/irda.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/udc.h>
 #include <mach/palmasoc.h>
 #include <mach/palm27x.h>
index 52defd5e42e520edb4912dbbaf676d6beb15d6d6..f685a600a18163b60a236f37f667564abda97055 100644 (file)
@@ -39,7 +39,7 @@
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
 #include <mach/irda.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/udc.h>
 #include <mach/ohci.h>
 #include <mach/pxa2xx-regs.h>
index 144dc2b6911f784f6630c8966f60d57befc7a330..89a37922b9d390441aa7365debe5bdd9dc3ed84f 100644 (file)
@@ -43,7 +43,7 @@
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
 #include <mach/irda.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/udc.h>
 #include <mach/palmasoc.h>
 #include <mach/palm27x.h>
index 87e4b1044e0b68564c12f27646453123c8eea16c..38f4425bfc95eec139aa4b3b9e2d0f65a122314c 100644 (file)
@@ -41,7 +41,7 @@
 #include <mach/mmc.h>
 #include <mach/pxafb.h>
 #include <mach/irda.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/udc.h>
 #include <mach/palmasoc.h>
 #include <mach/palm27x.h>
index 2190af066470e546a151293801f75b2311ed474c..90b08ba8ad1a55a445caffd4c0f93351c3e4f023 100644 (file)
@@ -262,6 +262,7 @@ MACHINE_START(PCM027, "Phytec Messtechnik GmbH phyCORE-PXA270")
        .phys_io        = 0x40000000,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = pcm027_map_io,
+       .nr_irqs        = PCM027_NR_IRQS,
        .init_irq       = pxa27x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = pcm027_init,
index 55e8fcde0141df75dccd32b49c6a452e4f2daaea..c04e025cd790875dc3dd8eb43114f943df28a5f4 100644 (file)
@@ -469,6 +469,7 @@ MACHINE_START(POODLE, "SHARP Poodle")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_poodle,
        .map_io         = pxa_map_io,
+       .nr_irqs        = POODLE_NR_IRQS,       /* 4 for LoCoMo */
        .init_irq       = pxa25x_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = poodle_init,
diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c
new file mode 100644 (file)
index 0000000..ce7168b
--- /dev/null
@@ -0,0 +1,400 @@
+/*
+ * linux/arch/arm/mach-pxa/pxa3xx-ulpi.c
+ *
+ * code specific to pxa3xx aka Monahans
+ *
+ * Copyright (C) 2010 CompuLab Ltd.
+ *
+ * 2010-13-07: Igor Grinberg <grinberg@compulab.co.il>
+ *             initial version: pxa310 USB Host mode support
+ *
+ * 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/kernel.h>
+#include <linux/slab.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/err.h>
+#include <linux/io.h>
+#include <linux/delay.h>
+#include <linux/clk.h>
+#include <linux/usb.h>
+#include <linux/usb/otg.h>
+
+#include <mach/hardware.h>
+#include <mach/regs-u2d.h>
+#include <mach/pxa3xx-u2d.h>
+
+struct pxa3xx_u2d_ulpi {
+       struct clk              *clk;
+       void __iomem            *mmio_base;
+
+       struct otg_transceiver  *otg;
+       unsigned int            ulpi_mode;
+};
+
+static struct pxa3xx_u2d_ulpi *u2d;
+
+static inline u32 u2d_readl(u32 reg)
+{
+       return __raw_readl(u2d->mmio_base + reg);
+}
+
+static inline void u2d_writel(u32 reg, u32 val)
+{
+       __raw_writel(val, u2d->mmio_base + reg);
+}
+
+#if defined(CONFIG_PXA310_ULPI)
+enum u2d_ulpi_phy_mode {
+       SYNCH           = 0,
+       CARKIT          = (1 << 0),
+       SER_3PIN        = (1 << 1),
+       SER_6PIN        = (1 << 2),
+       LOWPOWER        = (1 << 3),
+};
+
+static inline enum u2d_ulpi_phy_mode pxa310_ulpi_get_phymode(void)
+{
+       return (u2d_readl(U2DOTGUSR) >> 28) & 0xF;
+}
+
+static int pxa310_ulpi_poll(void)
+{
+       int timeout = 50000;
+
+       while (timeout--) {
+               if (!(u2d_readl(U2DOTGUCR) & U2DOTGUCR_RUN))
+                       return 0;
+
+               cpu_relax();
+       }
+
+       pr_warning("%s: ULPI access timed out!\n", __func__);
+
+       return -ETIMEDOUT;
+}
+
+static int pxa310_ulpi_read(struct otg_transceiver *otg, u32 reg)
+{
+       int err;
+
+       if (pxa310_ulpi_get_phymode() != SYNCH) {
+               pr_warning("%s: PHY is not in SYNCH mode!\n", __func__);
+               return -EBUSY;
+       }
+
+       u2d_writel(U2DOTGUCR, U2DOTGUCR_RUN | U2DOTGUCR_RNW | (reg << 16));
+       msleep(5);
+
+       err = pxa310_ulpi_poll();
+       if (err)
+               return err;
+
+       return u2d_readl(U2DOTGUCR) & U2DOTGUCR_RDATA;
+}
+
+static int pxa310_ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg)
+{
+       if (pxa310_ulpi_get_phymode() != SYNCH) {
+               pr_warning("%s: PHY is not in SYNCH mode!\n", __func__);
+               return -EBUSY;
+       }
+
+       u2d_writel(U2DOTGUCR, U2DOTGUCR_RUN | (reg << 16) | (val << 8));
+       msleep(5);
+
+       return pxa310_ulpi_poll();
+}
+
+struct otg_io_access_ops pxa310_ulpi_access_ops = {
+       .read   = pxa310_ulpi_read,
+       .write  = pxa310_ulpi_write,
+};
+
+static void pxa310_otg_transceiver_rtsm(void)
+{
+       u32 u2dotgcr;
+
+       /* put PHY to sync mode */
+       u2dotgcr = u2d_readl(U2DOTGCR);
+       u2dotgcr |=  U2DOTGCR_RTSM | U2DOTGCR_UTMID;
+       u2d_writel(U2DOTGCR, u2dotgcr);
+       msleep(10);
+
+       /* setup OTG sync mode */
+       u2dotgcr = u2d_readl(U2DOTGCR);
+       u2dotgcr |= U2DOTGCR_ULAF;
+       u2dotgcr &= ~(U2DOTGCR_SMAF | U2DOTGCR_CKAF);
+       u2d_writel(U2DOTGCR, u2dotgcr);
+}
+
+static int pxa310_start_otg_host_transcvr(struct usb_bus *host)
+{
+       int err;
+
+       pxa310_otg_transceiver_rtsm();
+
+       err = otg_init(u2d->otg);
+       if (err) {
+               pr_err("OTG transceiver init failed");
+               return err;
+       }
+
+       err = otg_set_vbus(u2d->otg, 1);
+       if (err) {
+               pr_err("OTG transceiver VBUS set failed");
+               return err;
+       }
+
+       err = otg_set_host(u2d->otg, host);
+       if (err)
+               pr_err("OTG transceiver Host mode set failed");
+
+       return err;
+}
+
+static int pxa310_start_otg_hc(struct usb_bus *host)
+{
+       u32 u2dotgcr;
+       int err;
+
+       /* disable USB device controller */
+       u2d_writel(U2DCR, u2d_readl(U2DCR) & ~U2DCR_UDE);
+       u2d_writel(U2DOTGCR, u2d_readl(U2DOTGCR) | U2DOTGCR_UTMID);
+       u2d_writel(U2DOTGICR, u2d_readl(U2DOTGICR) & ~0x37F7F);
+
+       err = pxa310_start_otg_host_transcvr(host);
+       if (err)
+               return err;
+
+       /* set xceiver mode */
+       if (u2d->ulpi_mode & ULPI_IC_6PIN_SERIAL)
+               u2d_writel(U2DP3CR, u2d_readl(U2DP3CR) & ~U2DP3CR_P2SS);
+       else if (u2d->ulpi_mode & ULPI_IC_3PIN_SERIAL)
+               u2d_writel(U2DP3CR, u2d_readl(U2DP3CR) | U2DP3CR_P2SS);
+
+       /* start OTG host controller */
+       u2dotgcr = u2d_readl(U2DOTGCR) | U2DOTGCR_SMAF;
+       u2d_writel(U2DOTGCR, u2dotgcr & ~(U2DOTGCR_ULAF | U2DOTGCR_CKAF));
+
+       return 0;
+}
+
+static void pxa310_stop_otg_hc(void)
+{
+       pxa310_otg_transceiver_rtsm();
+
+       otg_set_host(u2d->otg, NULL);
+       otg_set_vbus(u2d->otg, 0);
+       otg_shutdown(u2d->otg);
+}
+
+static void pxa310_u2d_setup_otg_hc(void)
+{
+       u32 u2dotgcr;
+
+       u2dotgcr = u2d_readl(U2DOTGCR);
+       u2dotgcr |= U2DOTGCR_ULAF | U2DOTGCR_UTMID;
+       u2dotgcr &= ~(U2DOTGCR_SMAF | U2DOTGCR_CKAF);
+       u2d_writel(U2DOTGCR, u2dotgcr);
+       msleep(5);
+       u2d_writel(U2DOTGCR, u2dotgcr | U2DOTGCR_ULE);
+       msleep(5);
+       u2d_writel(U2DOTGICR, u2d_readl(U2DOTGICR) & ~0x37F7F);
+}
+
+static int pxa310_otg_init(struct pxa3xx_u2d_platform_data *pdata)
+{
+       unsigned int ulpi_mode = ULPI_OTG_DRVVBUS;
+
+       if (pdata) {
+               if (pdata->ulpi_mode & ULPI_SER_6PIN)
+                       ulpi_mode |= ULPI_IC_6PIN_SERIAL;
+               else if (pdata->ulpi_mode & ULPI_SER_3PIN)
+                       ulpi_mode |= ULPI_IC_3PIN_SERIAL;
+       }
+
+       u2d->ulpi_mode = ulpi_mode;
+
+       u2d->otg = otg_ulpi_create(&pxa310_ulpi_access_ops, ulpi_mode);
+       if (!u2d->otg)
+               return -ENOMEM;
+
+       u2d->otg->io_priv = u2d->mmio_base;
+
+       return 0;
+}
+
+static void pxa310_otg_exit(void)
+{
+       kfree(u2d->otg);
+}
+#else
+static inline void pxa310_u2d_setup_otg_hc(void) {}
+static inline int pxa310_start_otg_hc(struct usb_bus *host)
+{
+       return 0;
+}
+static inline void pxa310_stop_otg_hc(void) {}
+static inline int pxa310_otg_init(struct pxa3xx_u2d_platform_data *pdata)
+{
+       return 0;
+}
+static inline void pxa310_otg_exit(void) {}
+#endif /* CONFIG_PXA310_ULPI */
+
+int pxa3xx_u2d_start_hc(struct usb_bus *host)
+{
+       int err = 0;
+
+       /* In case the PXA3xx ULPI isn't used, do nothing. */
+       if (!u2d)
+               return 0;
+
+       clk_enable(u2d->clk);
+
+       if (cpu_is_pxa310()) {
+               pxa310_u2d_setup_otg_hc();
+               err = pxa310_start_otg_hc(host);
+       }
+
+       return err;
+}
+
+void pxa3xx_u2d_stop_hc(struct usb_bus *host)
+{
+       /* In case the PXA3xx ULPI isn't used, do nothing. */
+       if (!u2d)
+               return;
+
+       if (cpu_is_pxa310())
+               pxa310_stop_otg_hc();
+
+       clk_disable(u2d->clk);
+}
+
+static int pxa3xx_u2d_probe(struct platform_device *pdev)
+{
+       struct pxa3xx_u2d_platform_data *pdata = pdev->dev.platform_data;
+       struct resource *r;
+       int err;
+
+       u2d = kzalloc(sizeof(struct pxa3xx_u2d_ulpi), GFP_KERNEL);
+       if (!u2d) {
+               dev_err(&pdev->dev, "failed to allocate memory\n");
+               return -ENOMEM;
+       }
+
+       u2d->clk = clk_get(&pdev->dev, NULL);
+       if (IS_ERR(u2d->clk)) {
+               dev_err(&pdev->dev, "failed to get u2d clock\n");
+               err = PTR_ERR(u2d->clk);
+               goto err_free_mem;
+       }
+
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!r) {
+               dev_err(&pdev->dev, "no IO memory resource defined\n");
+               err = -ENODEV;
+               goto err_put_clk;
+       }
+
+        r = request_mem_region(r->start, resource_size(r), pdev->name);
+        if (!r) {
+                dev_err(&pdev->dev, "failed to request memory resource\n");
+                err = -EBUSY;
+                goto err_put_clk;
+        }
+
+       u2d->mmio_base = ioremap(r->start, resource_size(r));
+       if (!u2d->mmio_base) {
+               dev_err(&pdev->dev, "ioremap() failed\n");
+               err = -ENODEV;
+               goto err_free_res;
+       }
+
+       if (pdata->init) {
+               err = pdata->init(&pdev->dev);
+               if (err)
+                       goto err_free_io;
+       }
+
+       /* Only PXA310 U2D has OTG functionality */
+       if (cpu_is_pxa310()) {
+               err = pxa310_otg_init(pdata);
+               if (err)
+                       goto err_free_plat;
+       }
+
+       platform_set_drvdata(pdev, &u2d);
+
+       return 0;
+
+err_free_plat:
+       if (pdata->exit)
+               pdata->exit(&pdev->dev);
+err_free_io:
+       iounmap(u2d->mmio_base);
+err_free_res:
+       release_mem_region(r->start, resource_size(r));
+err_put_clk:
+       clk_put(u2d->clk);
+err_free_mem:
+       kfree(u2d);
+       return err;
+}
+
+static int pxa3xx_u2d_remove(struct platform_device *pdev)
+{
+       struct pxa3xx_u2d_platform_data *pdata = pdev->dev.platform_data;
+       struct resource *r;
+
+       if (cpu_is_pxa310()) {
+               pxa310_stop_otg_hc();
+               pxa310_otg_exit();
+       }
+
+       if (pdata->exit)
+               pdata->exit(&pdev->dev);
+
+       platform_set_drvdata(pdev, NULL);
+       iounmap(u2d->mmio_base);
+       r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       release_mem_region(r->start, resource_size(r));
+
+       clk_put(u2d->clk);
+
+       kfree(u2d);
+
+       return 0;
+}
+
+static struct platform_driver pxa3xx_u2d_ulpi_driver = {
+        .driver                = {
+                .name   = "pxa3xx-u2d",
+               .owner  = THIS_MODULE,
+        },
+        .probe          = pxa3xx_u2d_probe,
+        .remove         = pxa3xx_u2d_remove,
+};
+
+static int pxa3xx_u2d_ulpi_init(void)
+{
+       return platform_driver_register(&pxa3xx_u2d_ulpi_driver);
+}
+module_init(pxa3xx_u2d_ulpi_init);
+
+static void __exit pxa3xx_u2d_ulpi_exit(void)
+{
+       platform_driver_unregister(&pxa3xx_u2d_ulpi_driver);
+}
+module_exit(pxa3xx_u2d_ulpi_exit);
+
+MODULE_DESCRIPTION("PXA3xx U2D ULPI driver");
+MODULE_AUTHOR("Igor Grinberg");
+MODULE_LICENSE("GPL v2");
index fa0014847c71503f4f929870cce2622deb0abd9d..c85c3a7abd314f84cce570a79d4f38ecce21ecce 100644 (file)
@@ -98,23 +98,6 @@ unsigned int pxa3xx_get_clk_frequency_khz(int info)
        return CLK / 1000;
 }
 
-/*
- * Return the current static memory controller clock frequency
- * in units of 10kHz
- */
-unsigned int pxa3xx_get_memclk_frequency_10khz(void)
-{
-       unsigned long acsr;
-       unsigned int smcfs, clk = 0;
-
-       acsr = ACSR;
-
-       smcfs = (acsr >> 23) & 0x7;
-       clk = (acsr & ACCR_D0CS) ? RO_CLK : smcfs_mult[smcfs] * BASE_CLK;
-
-       return (clk / 10000);
-}
-
 void pxa3xx_clear_reset_status(unsigned int mask)
 {
        /* RESET_STATUS_* has a 1:1 mapping with ARSR */
@@ -265,7 +248,7 @@ static struct clk_lookup pxa3xx_clkregs[] = {
        INIT_CLKREG(&clk_pxa3xx_i2c, "pxa2xx-i2c.0", NULL),
        INIT_CLKREG(&clk_pxa3xx_udc, "pxa27x-udc", NULL),
        INIT_CLKREG(&clk_pxa3xx_usbh, "pxa27x-ohci", NULL),
-       INIT_CLKREG(&clk_pxa3xx_u2d, NULL, "U2DCLK"),
+       INIT_CLKREG(&clk_pxa3xx_u2d, "pxa3xx-u2d", NULL),
        INIT_CLKREG(&clk_pxa3xx_keypad, "pxa27x-keypad", NULL),
        INIT_CLKREG(&clk_pxa3xx_ssp1, "pxa27x-ssp.0", NULL),
        INIT_CLKREG(&clk_pxa3xx_ssp2, "pxa27x-ssp.1", NULL),
index 064292008288c86f3b4b3bb9a9e7132092cf5067..7d29dd3af79d20cb55c1e20296c7f80adcd171f8 100644 (file)
@@ -192,7 +192,7 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = {
 
 static int __init pxa930_init(void)
 {
-       if (cpu_is_pxa930() || cpu_is_pxa935()) {
+       if (cpu_is_pxa930() || cpu_is_pxa935() || cpu_is_pxa950()) {
                mfp_init_base(io_p2v(MFPR_BASE));
                mfp_init_addr(pxa930_mfp_addr_map);
        }
index a654d1e6b38ad11eb6420667028c8395ab10c1ae..62de07341cc62d2177dbd764d8ff8458eec3d07b 100644 (file)
@@ -56,6 +56,8 @@
 #include "devices.h"
 #include "generic.h"
 
+#define STARGATE_NR_IRQS       (IRQ_BOARD_START + 8)
+
 /* Bluetooth */
 #define SG2_BT_RESET           81
 
@@ -1011,6 +1013,7 @@ MACHINE_START(STARGATE2, "Stargate 2")
        .phys_io = 0x40000000,
        .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io = pxa_map_io,
+       .nr_irqs = STARGATE_NR_IRQS,
        .init_irq = pxa27x_init_irq,
        .timer = &pxa_timer,
        .init_machine = stargate2_init,
index f02dcb5b4e97e53e14212e0b61892abc8f3f3046..0f440c9d7cbd5e3cf6a576b8e4500800a269bfb6 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <mach/pxa930.h>
 #include <mach/pxafb.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 
 #include "devices.h"
 #include "generic.h"
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c
new file mode 100644 (file)
index 0000000..5eeba64
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ *  linux/arch/arm/mach-pxa/tavorevb3.c
+ *
+ *  Support for the Marvell EVB3 Development Platform.
+ *
+ *  Copyright:  (C) Copyright 2008-2010 Marvell International Ltd.
+ *
+ *  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
+ *  publishhed by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/interrupt.h>
+#include <linux/i2c.h>
+#include <linux/gpio.h>
+#include <linux/mfd/88pm860x.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
+
+#include <mach/pxa930.h>
+
+#include <plat/i2c.h>
+
+#include "devices.h"
+#include "generic.h"
+
+#define TAVOREVB3_NR_IRQS      (IRQ_BOARD_START + 24)
+
+static mfp_cfg_t evb3_mfp_cfg[] __initdata = {
+       /* UART */
+       GPIO53_UART1_TXD,
+       GPIO54_UART1_RXD,
+
+       /* PMIC */
+       PMIC_INT_GPIO83,
+};
+
+#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
+static struct pm860x_touch_pdata evb3_touch = {
+       .gpadc_prebias  = 1,
+       .slot_cycle     = 1,
+       .tsi_prebias    = 6,
+       .pen_prebias    = 16,
+       .pen_prechg     = 2,
+       .res_x          = 300,
+};
+
+static struct pm860x_backlight_pdata evb3_backlight[] = {
+       {
+               .id     = PM8606_ID_BACKLIGHT,
+               .iset   = PM8606_WLED_CURRENT(24),
+               .flags  = PM8606_BACKLIGHT1,
+       },
+       {},
+};
+
+static struct pm860x_led_pdata evb3_led[] = {
+       {
+               .id     = PM8606_ID_LED,
+               .iset   = PM8606_LED_CURRENT(12),
+               .flags  = PM8606_LED1_RED,
+       }, {
+               .id     = PM8606_ID_LED,
+               .iset   = PM8606_LED_CURRENT(12),
+               .flags  = PM8606_LED1_GREEN,
+       }, {
+               .id     = PM8606_ID_LED,
+               .iset   = PM8606_LED_CURRENT(12),
+               .flags  = PM8606_LED1_BLUE,
+       }, {
+               .id     = PM8606_ID_LED,
+               .iset   = PM8606_LED_CURRENT(12),
+               .flags  = PM8606_LED2_RED,
+       }, {
+               .id     = PM8606_ID_LED,
+               .iset   = PM8606_LED_CURRENT(12),
+               .flags  = PM8606_LED2_GREEN,
+       }, {
+               .id     = PM8606_ID_LED,
+               .iset   = PM8606_LED_CURRENT(12),
+               .flags  = PM8606_LED2_BLUE,
+       },
+};
+
+static struct pm860x_platform_data evb3_pm8607_info = {
+       .touch                          = &evb3_touch,
+       .backlight                      = &evb3_backlight[0],
+       .led                            = &evb3_led[0],
+       .companion_addr                 = 0x10,
+       .irq_mode                       = 0,
+       .irq_base                       = IRQ_BOARD_START,
+
+       .i2c_port                       = GI2C_PORT,
+};
+
+static struct i2c_board_info evb3_i2c_info[] = {
+       {
+               .type           = "88PM860x",
+               .addr           = 0x34,
+               .platform_data  = &evb3_pm8607_info,
+               .irq            = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)),
+       },
+};
+
+static void __init evb3_init_i2c(void)
+{
+       pxa_set_i2c_info(NULL);
+       i2c_register_board_info(0, ARRAY_AND_SIZE(evb3_i2c_info));
+}
+#else
+static inline void evb3_init_i2c(void) {}
+#endif
+
+static void __init evb3_init(void)
+{
+       /* initialize MFP configurations */
+       pxa3xx_mfp_config(ARRAY_AND_SIZE(evb3_mfp_cfg));
+
+       pxa_set_ffuart_info(NULL);
+
+       evb3_init_i2c();
+}
+
+MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)")
+       .phys_io        = 0x40000000,
+       .boot_params    = 0xa0000100,
+       .map_io         = pxa_map_io,
+       .nr_irqs        = TAVOREVB3_NR_IRQS,
+       .init_irq       = pxa3xx_init_irq,
+       .timer          = &pxa_timer,
+       .init_machine   = evb3_init,
+MACHINE_END
index 83cc3a18c2e9a0ded180a0b223f29167b3a290f7..3a06e98b49209282f924932397ea5c30d65232be 100644 (file)
@@ -956,6 +956,7 @@ MACHINE_START(TOSA, "SHARP Tosa")
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .fixup          = fixup_tosa,
        .map_io         = pxa_map_io,
+       .nr_irqs        = TOSA_NR_IRQS,
        .init_irq       = pxa25x_init_irq,
        .init_machine   = tosa_init,
        .timer          = &pxa_timer,
index f0d02288b4ca3089e754dce9396ff28f23ceb3d4..8c44bc4381ba546be6e614561b3878b519015bfd 100644 (file)
@@ -37,7 +37,7 @@
 #include <mach/z2.h>
 #include <mach/pxafb.h>
 #include <mach/mmc.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <mach/pxa2xx_spi.h>
 
 #include <plat/i2c.h>
index 03b9cb910e085b1911465e77d57a12ac11a71c9f..9da2b624ba2093dd52de018bdde9da28b3084fc3 100644 (file)
@@ -904,6 +904,7 @@ MACHINE_START(ARCOM_ZEUS, "Arcom/Eurotech ZEUS")
        .io_pg_offst    = ((io_p2v(0x40000000) >> 18) & 0xfffc),
        .boot_params    = 0xa0000100,
        .map_io         = zeus_map_io,
+       .nr_irqs        = ZEUS_NR_IRQS,
        .init_irq       = zeus_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = zeus_init,
index c479cbecf784ac3c53f634d2b4fad3e1fefd4daa..69df3edcdd98b2d197b79f7679bdfe0f0af72530 100644 (file)
@@ -30,7 +30,7 @@
 #include <mach/zylonite.h>
 #include <mach/mmc.h>
 #include <mach/ohci.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 #include <plat/pxa3xx_nand.h>
 
 #include "devices.h"
@@ -415,6 +415,7 @@ MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
        .boot_params    = 0xa0000100,
        .io_pg_offst    = (io_p2v(0x40000000) >> 18) & 0xfffc,
        .map_io         = pxa_map_io,
+       .nr_irqs        = ZYLONITE_NR_IRQS,
        .init_irq       = pxa3xx_init_irq,
        .timer          = &pxa_timer,
        .init_machine   = zylonite_init,
similarity index 83%
rename from arch/arm/mach-pxa/include/mach/pxa27x_keypad.h
rename to arch/arm/plat-pxa/include/plat/pxa27x_keypad.h
index 7b4eadc6df3a8c7762329304b1cec2fefbc900ff..abcc36eb12425ac04a28da7e61f6e9fa171ddac0 100644 (file)
  *
  * 4. matrix key and direct key will use the same debounce_interval by
  *    default, which should be sufficient in most cases
+ *
+ * pxa168 keypad platform specific parameter
+ *
+ * NOTE:
+ * clear_wakeup_event callback is a workaround required to clear the
+ * keypad interrupt. The keypad wake must be cleared in addition to
+ * reading the MI/DI bits in the KPC register.
  */
 struct pxa27x_keypad_platform_data {
 
@@ -52,6 +59,9 @@ struct pxa27x_keypad_platform_data {
 
        /* key debounce interval */
        unsigned int    debounce_interval;
+
+       /* clear wakeup event requirement for pxa168 */
+       void            (*clear_wakeup_event)(void);
 };
 
 extern void pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info);
index 9cc488d2149019626101d3c5f76d0b2bdab0fe57..aa037fec2f86122500cbd5d14cfca0c59e614804 100644 (file)
@@ -338,7 +338,7 @@ config KEYBOARD_OPENCORES
 
 config KEYBOARD_PXA27x
        tristate "PXA27x/PXA3xx keypad support"
-       depends on PXA27x || PXA3xx
+       depends on PXA27x || PXA3xx || ARCH_MMP
        help
          Enable support for PXA27x/PXA3xx keypad controller.
 
index f32404f991893ef4584ab5540d213945cbb0c738..4b0ec35259a17f70357df965ae4f9b698bf4e01a 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/mach/map.h>
 
 #include <mach/hardware.h>
-#include <mach/pxa27x_keypad.h>
+#include <plat/pxa27x_keypad.h>
 /*
  * Keypad Controller registers
  */
@@ -330,11 +330,21 @@ static void pxa27x_keypad_scan_direct(struct pxa27x_keypad *keypad)
        keypad->direct_key_state = new_state;
 }
 
+static void clear_wakeup_event(struct pxa27x_keypad *keypad)
+{
+       struct pxa27x_keypad_platform_data *pdata = keypad->pdata;
+
+       if (pdata->clear_wakeup_event)
+               (pdata->clear_wakeup_event)();
+}
+
 static irqreturn_t pxa27x_keypad_irq_handler(int irq, void *dev_id)
 {
        struct pxa27x_keypad *keypad = dev_id;
        unsigned long kpc = keypad_readl(KPC);
 
+       clear_wakeup_event(keypad);
+
        if (kpc & KPC_DI)
                pxa27x_keypad_scan_direct(keypad);
 
index 418163894775e36ff129aa96ba107f7e6145ca20..afef7b0a419567ab92643d0809a1da5f1a4f13a9 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <mach/ohci.h>
+#include <mach/pxa3xx-u2d.h>
 
 /*
  * UHC: USB Host Controller (OHCI-like) register definitions
@@ -235,6 +236,9 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev)
        if (retval < 0)
                return retval;
 
+       if (cpu_is_pxa3xx())
+               pxa3xx_u2d_start_hc(&ohci_to_hcd(&ohci->ohci)->self);
+
        uhchr = __raw_readl(ohci->mmio_base + UHCHR) & ~UHCHR_SSE;
        __raw_writel(uhchr, ohci->mmio_base + UHCHR);
        __raw_writel(UHCHIE_UPRIE | UHCHIE_RWIE, ohci->mmio_base + UHCHIE);
@@ -251,6 +255,9 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev)
 
        inf = dev->platform_data;
 
+       if (cpu_is_pxa3xx())
+               pxa3xx_u2d_stop_hc(&ohci_to_hcd(&ohci->ohci)->self);
+
        if (inf->exit)
                inf->exit(dev);
 
index a31a77ff6f3d2a3ac2daa56baeb6ae55430f6177..cea6403ae71c16ffbcded14282db1552244f8833 100644 (file)
@@ -784,12 +784,53 @@ failed:
        return ret;
 }
 
+static int __devexit pxa168fb_remove(struct platform_device *pdev)
+{
+       struct pxa168fb_info *fbi = platform_get_drvdata(pdev);
+       struct fb_info *info;
+       int irq;
+       unsigned int data;
+
+       if (!fbi)
+               return 0;
+
+       /* disable DMA transfer */
+       data = readl(fbi->reg_base + LCD_SPU_DMA_CTRL0);
+       data &= ~CFG_GRA_ENA_MASK;
+       writel(data, fbi->reg_base + LCD_SPU_DMA_CTRL0);
+
+       info = fbi->info;
+
+       unregister_framebuffer(info);
+
+       writel(GRA_FRAME_IRQ0_ENA(0x0), fbi->reg_base + SPU_IRQ_ENA);
+
+       if (info->cmap.len)
+               fb_dealloc_cmap(&info->cmap);
+
+       irq = platform_get_irq(pdev, 0);
+       free_irq(irq, fbi);
+
+       dma_free_writecombine(fbi->dev, PAGE_ALIGN(info->fix.smem_len),
+                               info->screen_base, info->fix.smem_start);
+
+       iounmap(fbi->reg_base);
+
+       clk_disable(fbi->clk);
+       clk_put(fbi->clk);
+
+       framebuffer_release(info);
+
+       return 0;
+}
+
 static struct platform_driver pxa168fb_driver = {
        .driver         = {
                .name   = "pxa168-fb",
                .owner  = THIS_MODULE,
        },
        .probe          = pxa168fb_probe,
+       .remove         = __devexit_p(pxa168fb_remove),
 };
 
 static int __init pxa168fb_init(void)
@@ -798,6 +839,12 @@ static int __init pxa168fb_init(void)
 }
 module_init(pxa168fb_init);
 
+static void __exit pxa168fb_exit(void)
+{
+       platform_driver_unregister(&pxa168fb_driver);
+}
+module_exit(pxa168fb_exit);
+
 MODULE_AUTHOR("Lennert Buytenhek <buytenh@marvell.com> "
              "Green Wan <gwan@marvell.com>");
 MODULE_DESCRIPTION("Framebuffer driver for PXA168/910");