1
2
3
4
5
6
7
8
9
10
11
12
13
14
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#include <mach/smemc.h>
35
36#include "generic.h"
37
38#define XCEP_ETH_PHYS (PXA_CS3_PHYS + 0x00000300)
39#define XCEP_ETH_PHYS_END (PXA_CS3_PHYS + 0x000fffff)
40#define XCEP_ETH_ATTR (PXA_CS3_PHYS + 0x02000000)
41#define XCEP_ETH_ATTR_END (PXA_CS3_PHYS + 0x020fffff)
42#define XCEP_ETH_IRQ IRQ_GPIO0
43
44
45#define XCEP_CPLD_BASE 0xf0000000
46
47
48
49
50static struct mtd_partition xcep_partitions[] = {
51 {
52 .name = "Bootloader",
53 .size = 0x00040000,
54 .offset = 0,
55 .mask_flags = MTD_WRITEABLE
56 }, {
57 .name = "Bootloader ENV",
58 .size = 0x00040000,
59 .offset = 0x00040000,
60 .mask_flags = MTD_WRITEABLE
61 }, {
62 .name = "Kernel",
63 .size = 0x00100000,
64 .offset = 0x00080000,
65 }, {
66 .name = "Rescue fs",
67 .size = 0x00280000,
68 .offset = 0x00180000,
69 }, {
70 .name = "Filesystem",
71 .size = MTDPART_SIZ_FULL,
72 .offset = 0x00400000
73 }
74};
75
76static struct physmap_flash_data xcep_flash_data[] = {
77 {
78 .width = 4,
79 .parts = xcep_partitions,
80 .nr_parts = ARRAY_SIZE(xcep_partitions)
81 }
82};
83
84static struct resource flash_resource = {
85 .start = PXA_CS0_PHYS,
86 .end = PXA_CS0_PHYS + SZ_32M - 1,
87 .flags = IORESOURCE_MEM,
88};
89
90static struct platform_device flash_device = {
91 .name = "physmap-flash",
92 .id = 0,
93 .dev = {
94 .platform_data = xcep_flash_data,
95 },
96 .resource = &flash_resource,
97 .num_resources = 1,
98};
99
100
101
102
103
104static struct resource smc91x_resources[] = {
105 [0] = {
106 .name = "smc91x-regs",
107 .start = XCEP_ETH_PHYS,
108 .end = XCEP_ETH_PHYS_END,
109 .flags = IORESOURCE_MEM,
110 },
111 [1] = {
112 .start = XCEP_ETH_IRQ,
113 .end = XCEP_ETH_IRQ,
114 .flags = IORESOURCE_IRQ,
115 },
116 [2] = {
117 .name = "smc91x-attrib",
118 .start = XCEP_ETH_ATTR,
119 .end = XCEP_ETH_ATTR_END,
120 .flags = IORESOURCE_MEM,
121 },
122};
123
124static struct smc91x_platdata xcep_smc91x_info = {
125 .flags = SMC91X_USE_32BIT | SMC91X_NOWAIT | SMC91X_USE_DMA,
126};
127
128static struct platform_device smc91x_device = {
129 .name = "smc91x",
130 .id = -1,
131 .num_resources = ARRAY_SIZE(smc91x_resources),
132 .resource = smc91x_resources,
133 .dev = {
134 .platform_data = &xcep_smc91x_info,
135 },
136};
137
138
139static struct platform_device *devices[] __initdata = {
140 &flash_device,
141 &smc91x_device,
142};
143
144
145
146
147
148
149static struct i2c_pxa_platform_data xcep_i2c_platform_data = {
150 .class = I2C_CLASS_HWMON
151};
152
153
154static mfp_cfg_t xcep_pin_config[] __initdata = {
155 GPIO79_nCS_3,
156 GPIO80_nCS_4,
157
158 GPIO23_SSP1_SCLK,
159 GPIO24_SSP1_SFRM,
160 GPIO25_SSP1_TXD,
161 GPIO26_SSP1_RXD,
162 GPIO27_SSP1_EXTCLK
163};
164
165static void __init xcep_init(void)
166{
167 pxa2xx_mfp_config(ARRAY_AND_SIZE(xcep_pin_config));
168
169 pxa_set_ffuart_info(NULL);
170 pxa_set_btuart_info(NULL);
171 pxa_set_stuart_info(NULL);
172 pxa_set_hwuart_info(NULL);
173
174
175
176 __raw_writel((__raw_readl(MSC1) & 0xffff) | 0xD5540000, MSC1);
177
178 __raw_writel((__raw_readl(MSC2) & 0xffff) | 0x72A00000, MSC2);
179
180 platform_add_devices(ARRAY_AND_SIZE(devices));
181 pxa_set_i2c_info(&xcep_i2c_platform_data);
182}
183
184MACHINE_START(XCEP, "Iskratel XCEP")
185 .boot_params = 0xa0000100,
186 .init_machine = xcep_init,
187 .map_io = pxa25x_map_io,
188 .init_irq = pxa25x_init_irq,
189 .timer = &pxa_timer,
190MACHINE_END
191
192