aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-03-22 21:04:18 -0400
committerEric Miao <eric.miao@marvell.com>2009-03-22 21:59:30 -0400
commitbac07ecd6c9b16656aced6dc4f9f070120153046 (patch)
treebf6fc36d562adef347acc8a6b48c7f39eefbc6c5 /arch/arm/mach-pxa
parentacb3655973de30cb74549986e5e118a374967702 (diff)
[ARM] pxa: Colibri PXA320 module basics
This adds basic support for Colibri PXA320 modules. The file colibri-320.c only contains settings specific to this module, such as the Ethernet interface. Cc: Matthias Meier <matthias.j.meier@gmx.net> Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/Kconfig5
-rw-r--r--arch/arm/mach-pxa/Makefile1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa320.c128
3 files changed, 134 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 142fd59a40b..96a2006cb59 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -270,6 +270,11 @@ config MACH_COLIBRI300
270 select PXA3xx 270 select PXA3xx
271 select CPU_PXA300 271 select CPU_PXA300
272 272
273config MACH_COLIBRI320
274 bool "Toradex Colibri PXA320"
275 select PXA3xx
276 select CPU_PXA320
277
273config MACH_ZYLONITE 278config MACH_ZYLONITE
274 bool "PXA3xx Development Platform (aka Zylonite)" 279 bool "PXA3xx Development Platform (aka Zylonite)"
275 select PXA3xx 280 select PXA3xx
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 772569383b3..fc96e7d454b 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -37,6 +37,7 @@ obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
37obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o 37obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
38obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 38obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
39obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 39obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
40obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
40obj-$(CONFIG_MACH_H5000) += h5000.o 41obj-$(CONFIG_MACH_H5000) += h5000.o
41obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o 42obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o
42obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o 43obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c
new file mode 100644
index 00000000000..86cb202847e
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa320.c
@@ -0,0 +1,128 @@
1/*
2 * arch/arm/mach-pxa/colibri-pxa320.c
3 *
4 * Support for Toradex PXA320/310 based Colibri module
5 *
6 * Daniel Mack <daniel@caiaq.de>
7 * Matthias Meier <matthias.j.meier@gmx.net>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/platform_device.h>
17#include <linux/gpio.h>
18#include <net/ax88796.h>
19
20#include <asm/mach-types.h>
21#include <asm/sizes.h>
22#include <asm/mach/arch.h>
23#include <asm/mach/irq.h>
24
25#include <mach/pxa3xx-regs.h>
26#include <mach/mfp-pxa320.h>
27#include <mach/colibri.h>
28#include <mach/ohci.h>
29
30#include "generic.h"
31#include "devices.h"
32
33#if defined(CONFIG_AX88796)
34#define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO)
35
36/*
37 * Asix AX88796 Ethernet
38 */
39static struct ax_plat_data colibri_asix_platdata = {
40 .flags = AXFLG_MAC_FROMDEV,
41 .wordlength = 2
42};
43
44static struct resource colibri_asix_resource[] = {
45 [0] = {
46 .start = PXA3xx_CS2_PHYS,
47 .end = PXA3xx_CS2_PHYS + (0x20 * 2) - 1,
48 .flags = IORESOURCE_MEM,
49 },
50 [1] = {
51 .start = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
52 .end = gpio_to_irq(COLIBRI_ETH_IRQ_GPIO),
53 .flags = IORESOURCE_IRQ
54 }
55};
56
57static struct platform_device asix_device = {
58 .name = "ax88796",
59 .id = 0,
60 .num_resources = ARRAY_SIZE(colibri_asix_resource),
61 .resource = colibri_asix_resource,
62 .dev = {
63 .platform_data = &colibri_asix_platdata
64 }
65};
66
67static mfp_cfg_t colibri_pxa320_eth_pin_config[] __initdata = {
68 GPIO3_nCS2, /* AX88796 chip select */
69 GPIO36_GPIO | MFP_PULL_HIGH /* AX88796 IRQ */
70};
71
72static void __init colibri_pxa320_init_eth(void)
73{
74 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_eth_pin_config));
75 set_irq_type(gpio_to_irq(COLIBRI_ETH_IRQ_GPIO), IRQ_TYPE_EDGE_FALLING);
76 platform_device_register(&asix_device);
77}
78#else
79static inline void __init colibri_pxa320_init_eth(void) {}
80#endif /* CONFIG_AX88796 */
81
82#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
83static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = {
84 GPIO2_2_USBH_PEN,
85 GPIO3_2_USBH_PWR,
86};
87
88static struct pxaohci_platform_data colibri_pxa320_ohci_info = {
89 .port_mode = PMM_GLOBAL_MODE,
90 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
91};
92
93void __init colibri_pxa320_init_ohci(void)
94{
95 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config));
96 pxa_set_ohci_info(&colibri_pxa320_ohci_info);
97}
98#else
99static inline void colibri_pxa320_init_ohci(void) {}
100#endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */
101
102static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = {
103 GPIO22_MMC1_CLK,
104 GPIO23_MMC1_CMD,
105 GPIO18_MMC1_DAT0,
106 GPIO19_MMC1_DAT1,
107 GPIO20_MMC1_DAT2,
108 GPIO21_MMC1_DAT3
109};
110
111void __init colibri_pxa320_init(void)
112{
113 colibri_pxa320_init_eth();
114 colibri_pxa320_init_ohci();
115 colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
116 mfp_to_gpio(MFP_PIN_GPIO28));
117}
118
119MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
120 .phys_io = 0x40000000,
121 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
122 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
123 .init_machine = colibri_pxa320_init,
124 .map_io = pxa_map_io,
125 .init_irq = pxa3xx_init_irq,
126 .timer = &pxa_timer,
127MACHINE_END
128