diff options
author | Matej Kenda <matejken@gmail.com> | 2009-09-07 02:08:34 -0400 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-09-10 06:49:38 -0400 |
commit | 51238bfefb92d15d07c15aec8c6a8fcc7b228e8c (patch) | |
tree | 762eb6cf90bf9e1ab1198000caae8d039950a61e | |
parent | 28d7a94680b16673af27779b289b4be2abd2e248 (diff) |
[ARM] pxa: add support for the IskraTel XCEP board
Added support for the Iskratel XCEP single board computer, embedded in
instruments used in particle accelerators.
The patch contains the platform specific code, Makefile and Kconfig
changes for platform arm-pxa.
Signed-off-by: Aleš Bardorfer <ales.bardorfer@i-tech.si>
Signed-off-by: Michael Abbott <michael.abbott@diamond.ac.uk>
Signed-off-by: Matej Kenda <matej.kenda@i-tech.si>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 15 | ||||
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/xcep.c | 187 |
3 files changed, 204 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index d1dcb1cf0758..b3cdfe55c031 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -504,6 +504,21 @@ config MACH_EZX_E2 | |||
504 | default y | 504 | default y |
505 | depends on PXA_EZX | 505 | depends on PXA_EZX |
506 | 506 | ||
507 | config MACH_XCEP | ||
508 | bool "Iskratel Electronics XCEP" | ||
509 | select PXA25x | ||
510 | select MTD | ||
511 | select MTD_PARTITIONS | ||
512 | select MTD_PHYSMAP | ||
513 | select MTD_CFI_INTELEXT | ||
514 | select MTD_CFI | ||
515 | select MTD_CHAR | ||
516 | select SMC91X | ||
517 | select PXA_SSP | ||
518 | help | ||
519 | PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash. | ||
520 | Tuned for usage in Libera instruments for particle accelerators. | ||
521 | |||
507 | endmenu | 522 | endmenu |
508 | 523 | ||
509 | config PXA25x | 524 | config PXA25x |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index aa8f83e9421e..c9890a124cf3 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -79,6 +79,8 @@ obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o | |||
79 | obj-$(CONFIG_MACH_CM_X300) += cm-x300.o | 79 | obj-$(CONFIG_MACH_CM_X300) += cm-x300.o |
80 | obj-$(CONFIG_PXA_EZX) += ezx.o | 80 | obj-$(CONFIG_PXA_EZX) += ezx.o |
81 | 81 | ||
82 | obj-$(CONFIG_MACH_XCEP) += xcep.o | ||
83 | |||
82 | obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o | 84 | obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o |
83 | obj-$(CONFIG_MACH_STARGATE2) += stargate2.o | 85 | obj-$(CONFIG_MACH_STARGATE2) += stargate2.o |
84 | obj-$(CONFIG_MACH_CSB726) += csb726.o | 86 | obj-$(CONFIG_MACH_CSB726) += csb726.o |
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c new file mode 100644 index 000000000000..3fd79cbb36c8 --- /dev/null +++ b/arch/arm/mach-pxa/xcep.c | |||
@@ -0,0 +1,187 @@ | |||
1 | /* linux/arch/arm/mach-pxa/xcep.c | ||
2 | * | ||
3 | * Support for the Iskratel Electronics XCEP platform as used in | ||
4 | * the Libera instruments from Instrumentation Technologies. | ||
5 | * | ||
6 | * Author: Ales Bardorfer <ales@i-tech.si> | ||
7 | * Contributions by: Abbott, MG (Michael) <michael.abbott@diamond.ac.uk> | ||
8 | * Contributions by: Matej Kenda <matej.kenda@i-tech.si> | ||
9 | * Created: June 2006 | ||
10 | * Copyright: (C) 2006-2009 Instrumentation Technologies | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | ||
13 | * it under the terms of the GNU General Public License version 2 as | ||
14 | * published by the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/i2c.h> | ||
19 | #include <linux/smc91x.h> | ||
20 | #include <linux/mtd/mtd.h> | ||
21 | #include <linux/mtd/partitions.h> | ||
22 | #include <linux/mtd/physmap.h> | ||
23 | |||
24 | #include <asm/mach-types.h> | ||
25 | #include <asm/mach/arch.h> | ||
26 | #include <asm/mach/irq.h> | ||
27 | #include <asm/mach/map.h> | ||
28 | |||
29 | #include <plat/i2c.h> | ||
30 | |||
31 | #include <mach/hardware.h> | ||
32 | #include <mach/pxa2xx-regs.h> | ||
33 | #include <mach/mfp-pxa25x.h> | ||
34 | |||
35 | #include "generic.h" | ||
36 | |||
37 | #define XCEP_ETH_PHYS (PXA_CS3_PHYS + 0x00000300) | ||
38 | #define XCEP_ETH_PHYS_END (PXA_CS3_PHYS + 0x000fffff) | ||
39 | #define XCEP_ETH_ATTR (PXA_CS3_PHYS + 0x02000000) | ||
40 | #define XCEP_ETH_ATTR_END (PXA_CS3_PHYS + 0x020fffff) | ||
41 | #define XCEP_ETH_IRQ IRQ_GPIO0 | ||
42 | |||
43 | /* XCEP CPLD base */ | ||
44 | #define XCEP_CPLD_BASE 0xf0000000 | ||
45 | |||
46 | |||
47 | /* Flash partitions. */ | ||
48 | |||
49 | static struct mtd_partition xcep_partitions[] = { | ||
50 | { | ||
51 | .name = "Bootloader", | ||
52 | .size = 0x00040000, | ||
53 | .offset = 0, | ||
54 | .mask_flags = MTD_WRITEABLE | ||
55 | }, { | ||
56 | .name = "Bootloader ENV", | ||
57 | .size = 0x00040000, | ||
58 | .offset = 0x00040000, | ||
59 | .mask_flags = MTD_WRITEABLE | ||
60 | }, { | ||
61 | .name = "Kernel", | ||
62 | .size = 0x00100000, | ||
63 | .offset = 0x00080000, | ||
64 | }, { | ||
65 | .name = "Rescue fs", | ||
66 | .size = 0x00280000, | ||
67 | .offset = 0x00180000, | ||
68 | }, { | ||
69 | .name = "Filesystem", | ||
70 | .size = MTDPART_SIZ_FULL, | ||
71 | .offset = 0x00400000 | ||
72 | } | ||
73 | }; | ||
74 | |||
75 | static struct physmap_flash_data xcep_flash_data[] = { | ||
76 | { | ||
77 | .width = 4, /* bankwidth in bytes */ | ||
78 | .parts = xcep_partitions, | ||
79 | .nr_parts = ARRAY_SIZE(xcep_partitions) | ||
80 | } | ||
81 | }; | ||
82 | |||
83 | static struct resource flash_resource = { | ||
84 | .start = PXA_CS0_PHYS, | ||
85 | .end = PXA_CS0_PHYS + SZ_32M - 1, | ||
86 | .flags = IORESOURCE_MEM, | ||
87 | }; | ||
88 | |||
89 | static struct platform_device flash_device = { | ||
90 | .name = "physmap-flash", | ||
91 | .id = 0, | ||
92 | .dev = { | ||
93 | .platform_data = xcep_flash_data, | ||
94 | }, | ||
95 | .resource = &flash_resource, | ||
96 | .num_resources = 1, | ||
97 | }; | ||
98 | |||
99 | |||
100 | |||
101 | /* SMC LAN91C111 network controller. */ | ||
102 | |||
103 | static struct resource smc91x_resources[] = { | ||
104 | [0] = { | ||
105 | .name = "smc91x-regs", | ||
106 | .start = XCEP_ETH_PHYS, | ||
107 | .end = XCEP_ETH_PHYS_END, | ||
108 | .flags = IORESOURCE_MEM, | ||
109 | }, | ||
110 | [1] = { | ||
111 | .start = XCEP_ETH_IRQ, | ||
112 | .end = XCEP_ETH_IRQ, | ||
113 | .flags = IORESOURCE_IRQ, | ||
114 | }, | ||
115 | [2] = { | ||
116 | .name = "smc91x-attrib", | ||
117 | .start = XCEP_ETH_ATTR, | ||
118 | .end = XCEP_ETH_ATTR_END, | ||
119 | .flags = IORESOURCE_MEM, | ||
120 | }, | ||
121 | }; | ||
122 | |||
123 | static struct smc91x_platdata xcep_smc91x_info = { | ||
124 | .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT | SMC91X_USE_DMA, | ||
125 | }; | ||
126 | |||
127 | static struct platform_device smc91x_device = { | ||
128 | .name = "smc91x", | ||
129 | .id = -1, | ||
130 | .num_resources = ARRAY_SIZE(smc91x_resources), | ||
131 | .resource = smc91x_resources, | ||
132 | .dev = { | ||
133 | .platform_data = &xcep_smc91x_info, | ||
134 | }, | ||
135 | }; | ||
136 | |||
137 | |||
138 | static struct platform_device *devices[] __initdata = { | ||
139 | &flash_device, | ||
140 | &smc91x_device, | ||
141 | }; | ||
142 | |||
143 | |||
144 | /* We have to state that there are HWMON devices on the I2C bus on XCEP. | ||
145 | * Drivers for HWMON verify capabilities of the adapter when loading and | ||
146 | * refuse to attach if the adapter doesn't support HWMON class of devices. | ||
147 | * See also Documentation/i2c/porting-clients. */ | ||
148 | static struct i2c_pxa_platform_data xcep_i2c_platform_data = { | ||
149 | .class = I2C_CLASS_HWMON | ||
150 | }; | ||
151 | |||
152 | |||
153 | static mfp_cfg_t xcep_pin_config[] __initdata = { | ||
154 | GPIO79_nCS_3, /* SMC 91C111 chip select. */ | ||
155 | GPIO80_nCS_4, /* CPLD chip select. */ | ||
156 | /* SSP communication to MSP430 */ | ||
157 | GPIO23_SSP1_SCLK, | ||
158 | GPIO24_SSP1_SFRM, | ||
159 | GPIO25_SSP1_TXD, | ||
160 | GPIO26_SSP1_RXD, | ||
161 | GPIO27_SSP1_EXTCLK | ||
162 | }; | ||
163 | |||
164 | static void __init xcep_init(void) | ||
165 | { | ||
166 | pxa2xx_mfp_config(ARRAY_AND_SIZE(xcep_pin_config)); | ||
167 | |||
168 | /* See Intel XScale Developer's Guide for details */ | ||
169 | /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ | ||
170 | MSC1 = (MSC1 & 0xffff) | 0xD5540000; | ||
171 | /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */ | ||
172 | MSC2 = (MSC2 & 0xffff) | 0x72A00000; | ||
173 | |||
174 | platform_add_devices(ARRAY_AND_SIZE(devices)); | ||
175 | pxa_set_i2c_info(&xcep_i2c_platform_data); | ||
176 | } | ||
177 | |||
178 | MACHINE_START(XCEP, "Iskratel XCEP") | ||
179 | .phys_io = 0x40000000, | ||
180 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
181 | .boot_params = 0xa0000100, | ||
182 | .init_machine = xcep_init, | ||
183 | .map_io = pxa_map_io, | ||
184 | .init_irq = pxa25x_init_irq, | ||
185 | .timer = &pxa_timer, | ||
186 | MACHINE_END | ||
187 | |||