aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/colibri.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.org>2008-01-23 08:54:50 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-28 08:13:27 -0500
commit4e4fc05a2b6e7bd2e0facd96e0c18dceb34d9349 (patch)
tree61070cb71e3f1ee55f20a7e6c35ca1512db78685 /arch/arm/mach-pxa/colibri.c
parent2687bd38573ff6f10d13f60c5c3576cce9cf260d (diff)
[ARM] 4762/1: Basic support for Toradex Colibri module
This patch adds support for Toradex' PXA27x based Colibri module. It's kept as simple as possible to only provide basic functionality. A default config is also included. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/colibri.c')
-rw-r--r--arch/arm/mach-pxa/colibri.c134
1 files changed, 134 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/colibri.c b/arch/arm/mach-pxa/colibri.c
new file mode 100644
index 000000000000..6db54e31c397
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri.c
@@ -0,0 +1,134 @@
1/*
2 * linux/arch/arm/mach-pxa/colibri.c
3 *
4 * Support for Toradex PXA27x 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/sysdev.h>
16#include <linux/interrupt.h>
17#include <linux/bitops.h>
18#include <linux/ioport.h>
19#include <linux/delay.h>
20#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h>
23#include <asm/mach-types.h>
24#include <asm/hardware.h>
25#include <asm/irq.h>
26#include <asm/sizes.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30#include <asm/mach/flash.h>
31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/colibri.h>
33
34#include "generic.h"
35#include "devices.h"
36
37/*
38 * Flash
39 */
40static struct mtd_partition colibri_partitions[] = {
41 {
42 .name = "Bootloader",
43 .offset = 0x00000000,
44 .size = 0x00040000,
45 .mask_flags = MTD_WRITEABLE /* force read-only */
46 }, {
47 .name = "Kernel",
48 .offset = 0x00040000,
49 .size = 0x00400000,
50 .mask_flags = 0
51 }, {
52 .name = "Rootfs",
53 .offset = 0x00440000,
54 .size = MTDPART_SIZ_FULL,
55 .mask_flags = 0
56 }
57};
58
59static struct physmap_flash_data colibri_flash_data[] = {
60 {
61 .width = 4, /* bankwidth in bytes */
62 .parts = colibri_partitions,
63 .nr_parts = ARRAY_SIZE(colibri_partitions)
64 }
65};
66
67static struct resource flash_resource = {
68 .start = PXA_CS0_PHYS,
69 .end = PXA_CS0_PHYS + SZ_32M - 1,
70 .flags = IORESOURCE_MEM,
71};
72
73static struct platform_device flash_device = {
74 .name = "physmap-flash",
75 .id = 0,
76 .dev = {
77 .platform_data = colibri_flash_data,
78 },
79 .resource = &flash_resource,
80 .num_resources = 1,
81};
82
83/*
84 * DM9000 Ethernet
85 */
86static struct resource dm9000_resources[] = {
87 [0] = {
88 .start = COLIBRI_ETH_PHYS,
89 .end = COLIBRI_ETH_PHYS + 3,
90 .flags = IORESOURCE_MEM,
91 },
92 [1] = {
93 .start = COLIBRI_ETH_PHYS + 4,
94 .end = COLIBRI_ETH_PHYS + 4 + 500,
95 .flags = IORESOURCE_MEM,
96 },
97 [2] = {
98 .start = COLIBRI_ETH_IRQ,
99 .end = COLIBRI_ETH_IRQ,
100 .flags = IORESOURCE_IRQ,
101 },
102};
103
104static struct platform_device dm9000_device = {
105 .name = "dm9000",
106 .id = -1,
107 .num_resources = ARRAY_SIZE(dm9000_resources),
108 .resource = dm9000_resources,
109};
110
111static struct platform_device *colibri_devices[] __initdata = {
112 &flash_device,
113 &dm9000_device,
114};
115
116static void __init colibri_init(void)
117{
118 /* DM9000 LAN */
119 pxa_gpio_mode(GPIO78_nCS_2_MD);
120 pxa_gpio_mode(GPIO_DM9000 | GPIO_IN);
121 set_irq_type(COLIBRI_ETH_IRQ, IRQT_FALLING);
122
123 platform_add_devices(colibri_devices, ARRAY_SIZE(colibri_devices));
124}
125
126MACHINE_START(COLIBRI, "Toradex Colibri PXA27x")
127 .phys_io = 0x40000000,
128 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
129 .boot_params = COLIBRI_SDRAM_BASE + 0x100,
130 .init_machine = colibri_init,
131 .map_io = pxa_map_io,
132 .init_irq = pxa27x_init_irq,
133 .timer = &pxa_timer,
134MACHINE_END