aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-03-13 11:37:09 -0400
committerEric Miao <eric.miao@marvell.com>2009-03-22 21:57:54 -0400
commit5fc9f9a1deefc9999af721fba249cd58ee7e273b (patch)
tree2c9a31bb6a74ba8580b0d9155149f180bbdf8648
parent5c0dbb8fc2b36619684cbb7486491ecac950a595 (diff)
[ARM] pxa: add basic support for Colibri PXA300 module
This patch add basic support for Toradex' Colibri PXA300 module. Ethernet is enabled conditionally, depdending on CONFIG_AX88796. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Eric Miao <eric.miao@marvell.com>
-rw-r--r--arch/arm/mach-pxa/Kconfig5
-rw-r--r--arch/arm/mach-pxa/Makefile1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa300.c99
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h17
4 files changed, 122 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index fd21bba62170..1a93888c68a8 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -265,6 +265,11 @@ config MACH_COLIBRI
265 bool "Toradex Colibri PXA270" 265 bool "Toradex Colibri PXA270"
266 select PXA27x 266 select PXA27x
267 267
268config MACH_COLIBRI300
269 bool "Toradex Colibri PXA300"
270 select PXA3xx
271 select CPU_PXA300
272
268config MACH_ZYLONITE 273config MACH_ZYLONITE
269 bool "PXA3xx Development Platform (aka Zylonite)" 274 bool "PXA3xx Development Platform (aka Zylonite)"
270 select PXA3xx 275 select PXA3xx
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index fbbda93b73ae..df6534b49e31 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_MACH_MP900C) += mp900.o
36obj-$(CONFIG_ARCH_PXA_IDP) += idp.o 36obj-$(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-pxa300.o
39obj-$(CONFIG_MACH_H5000) += h5000.o 40obj-$(CONFIG_MACH_H5000) += h5000.o
40obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o 41obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o sharpsl_pm.o corgi_pm.o
41obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o 42obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o sharpsl_pm.o spitz_pm.o
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c
new file mode 100644
index 000000000000..b271e028da35
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa300.c
@@ -0,0 +1,99 @@
1/*
2 * arch/arm/mach-pxa/colibri-pxa300.c
3 *
4 * Support for Toradex PXA300 based Colibri module
5 * Daniel Mack <daniel@caiaq.de>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/platform_device.h>
15#include <linux/gpio.h>
16#include <net/ax88796.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/irq.h>
21
22#include <mach/pxa300.h>
23#include <mach/colibri.h>
24
25#include "generic.h"
26#include "devices.h"
27
28/*
29 * GPIO configuration
30 */
31static mfp_cfg_t colibri_pxa300_pin_config[] __initdata = {
32 GPIO1_nCS2, /* AX88796 chip select */
33 GPIO26_GPIO | MFP_PULL_HIGH, /* AX88796 IRQ */
34};
35
36#if defined(CONFIG_AX88796)
37/*
38 * Asix AX88796 Ethernet
39 */
40static struct ax_plat_data colibri_asix_platdata = {
41 .flags = AXFLG_MAC_FROMDEV,
42 .wordlength = 2,
43 .dcr_val = 0x01,
44 .rcr_val = 0x0e,
45 .gpoc_val = 0x19
46};
47
48static struct resource colibri_asix_resource[] = {
49 [0] = {
50 .start = PXA3xx_CS2_PHYS,
51 .end = PXA3xx_CS2_PHYS + (0x18 * 0x2) - 1,
52 .flags = IORESOURCE_MEM,
53 },
54 [1] = {
55 .start = PXA3xx_CS2_PHYS + (1 << 11),
56 .end = PXA3xx_CS2_PHYS + (1 << 11) + 0x3fff,
57 .flags = IORESOURCE_MEM,
58 },
59 [2] = {
60 .start = COLIBRI_PXA300_ETH_IRQ,
61 .end = COLIBRI_PXA300_ETH_IRQ,
62 .flags = IORESOURCE_IRQ
63 }
64};
65
66static struct platform_device asix_device = {
67 .name = "ax88796",
68 .id = 0,
69 .num_resources = ARRAY_SIZE(colibri_asix_resource),
70 .resource = colibri_asix_resource,
71 .dev = {
72 .platform_data = &colibri_asix_platdata
73 }
74};
75#endif /* CONFIG_AX88796 */
76
77static struct platform_device *colibri_pxa300_devices[] __initdata = {
78#if defined(CONFIG_AX88796)
79 &asix_device
80#endif
81};
82
83static void __init colibri_pxa300_init(void)
84{
85 set_irq_type(COLIBRI_PXA300_ETH_IRQ, IRQ_TYPE_EDGE_FALLING);
86 pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_pin_config));
87 platform_add_devices(ARRAY_AND_SIZE(colibri_pxa300_devices));
88}
89
90MACHINE_START(COLIBRI300, "Toradex Colibri PXA300")
91 .phys_io = 0x40000000,
92 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
93 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
94 .init_machine = colibri_pxa300_init,
95 .map_io = pxa_map_io,
96 .init_irq = pxa3xx_init_irq,
97 .timer = &pxa_timer,
98MACHINE_END
99
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index c7c99d078817..e295e8df8d64 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -1,14 +1,31 @@
1#ifndef _COLIBRI_H_ 1#ifndef _COLIBRI_H_
2#define _COLIBRI_H_ 2#define _COLIBRI_H_
3/*
4 * common settings for all modules
5 */
3 6
4/* physical memory regions */ 7/* physical memory regions */
5#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */ 8#define COLIBRI_SDRAM_BASE 0xa0000000 /* SDRAM region */
6 9
10/* definitions for Colibri PXA270 */
11
7#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */ 12#define COLIBRI_PXA270_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
8#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */ 13#define COLIBRI_PXA270_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet */
9#define COLIBRI_PXA270_ETH_IRQ_GPIO 114 14#define COLIBRI_PXA270_ETH_IRQ_GPIO 114
10#define COLIBRI_PXA270_ETH_IRQ \ 15#define COLIBRI_PXA270_ETH_IRQ \
11 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO)) 16 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA270_ETH_IRQ_GPIO))
12 17
18/* definitions for Colibri PXA300 */
19
20#define COLIBRI_PXA300_ETH_IRQ_GPIO 26
21#define COLIBRI_PXA300_ETH_IRQ \
22 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA300_ETH_IRQ_GPIO))
23
24/* definitions for Colibri PXA320 */
25
26#define COLIBRI_PXA320_ETH_IRQ_GPIO 36
27#define COLIBRI_PXA320_ETH_IRQ \
28 gpio_to_irq(mfp_to_gpio(COLIBRI_PXA320_ETH_IRQ_GPIO))
29
13#endif /* _COLIBRI_H_ */ 30#endif /* _COLIBRI_H_ */
14 31