Commit | Line | Data |
---|---|---|
49cbe786 EM |
1 | /* |
2 | * linux/arch/arm/mach-mmp/aspenite.c | |
3 | * | |
4 | * Support for the Marvell PXA168-based Aspenite and Zylonite2 | |
5 | * Development Platform. | |
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 | * publishhed by the Free Software Foundation. | |
10 | */ | |
11 | ||
12 | #include <linux/init.h> | |
9c291f0f | 13 | #include <linux/kernel.h> |
a6b993c6 EM |
14 | #include <linux/platform_device.h> |
15 | #include <linux/smc91x.h> | |
ef559def HZ |
16 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/partitions.h> | |
18 | #include <linux/mtd/nand.h> | |
49cbe786 EM |
19 | |
20 | #include <asm/mach-types.h> | |
21 | #include <asm/mach/arch.h> | |
22 | #include <mach/addr-map.h> | |
9c291f0f EM |
23 | #include <mach/mfp-pxa168.h> |
24 | #include <mach/pxa168.h> | |
a6b993c6 | 25 | #include <mach/gpio.h> |
884646a5 | 26 | #include <video/pxa168fb.h> |
6aafc5f3 MB |
27 | #include <linux/input.h> |
28 | #include <plat/pxa27x_keypad.h> | |
49cbe786 EM |
29 | |
30 | #include "common.h" | |
31 | ||
9c291f0f | 32 | static unsigned long common_pin_config[] __initdata = { |
a6b993c6 EM |
33 | /* Data Flash Interface */ |
34 | GPIO0_DFI_D15, | |
35 | GPIO1_DFI_D14, | |
36 | GPIO2_DFI_D13, | |
37 | GPIO3_DFI_D12, | |
38 | GPIO4_DFI_D11, | |
39 | GPIO5_DFI_D10, | |
40 | GPIO6_DFI_D9, | |
41 | GPIO7_DFI_D8, | |
42 | GPIO8_DFI_D7, | |
43 | GPIO9_DFI_D6, | |
44 | GPIO10_DFI_D5, | |
45 | GPIO11_DFI_D4, | |
46 | GPIO12_DFI_D3, | |
47 | GPIO13_DFI_D2, | |
48 | GPIO14_DFI_D1, | |
49 | GPIO15_DFI_D0, | |
50 | ||
51 | /* Static Memory Controller */ | |
52 | GPIO18_SMC_nCS0, | |
53 | GPIO34_SMC_nCS1, | |
54 | GPIO23_SMC_nLUA, | |
55 | GPIO25_SMC_nLLA, | |
56 | GPIO28_SMC_RDY, | |
57 | GPIO29_SMC_SCLK, | |
58 | GPIO35_SMC_BE1, | |
59 | GPIO36_SMC_BE2, | |
60 | GPIO27_GPIO, /* Ethernet IRQ */ | |
61 | ||
9c291f0f EM |
62 | /* UART1 */ |
63 | GPIO107_UART1_RXD, | |
64 | GPIO108_UART1_TXD, | |
07871c19 HZ |
65 | |
66 | /* SSP1 */ | |
67 | GPIO113_I2S_MCLK, | |
68 | GPIO114_I2S_FRM, | |
69 | GPIO115_I2S_BCLK, | |
70 | GPIO116_I2S_RXD, | |
71 | GPIO117_I2S_TXD, | |
884646a5 MB |
72 | |
73 | /* LCD */ | |
74 | GPIO56_LCD_FCLK_RD, | |
75 | GPIO57_LCD_LCLK_A0, | |
76 | GPIO58_LCD_PCLK_WR, | |
77 | GPIO59_LCD_DENA_BIAS, | |
78 | GPIO60_LCD_DD0, | |
79 | GPIO61_LCD_DD1, | |
80 | GPIO62_LCD_DD2, | |
81 | GPIO63_LCD_DD3, | |
82 | GPIO64_LCD_DD4, | |
83 | GPIO65_LCD_DD5, | |
84 | GPIO66_LCD_DD6, | |
85 | GPIO67_LCD_DD7, | |
86 | GPIO68_LCD_DD8, | |
87 | GPIO69_LCD_DD9, | |
88 | GPIO70_LCD_DD10, | |
89 | GPIO71_LCD_DD11, | |
90 | GPIO72_LCD_DD12, | |
91 | GPIO73_LCD_DD13, | |
92 | GPIO74_LCD_DD14, | |
93 | GPIO75_LCD_DD15, | |
94 | GPIO76_LCD_DD16, | |
95 | GPIO77_LCD_DD17, | |
96 | GPIO78_LCD_DD18, | |
97 | GPIO79_LCD_DD19, | |
98 | GPIO80_LCD_DD20, | |
99 | GPIO81_LCD_DD21, | |
100 | GPIO82_LCD_DD22, | |
101 | GPIO83_LCD_DD23, | |
6aafc5f3 MB |
102 | |
103 | /* Keypad */ | |
104 | GPIO109_KP_MKIN1, | |
105 | GPIO110_KP_MKIN0, | |
106 | GPIO111_KP_MKOUT7, | |
107 | GPIO112_KP_MKOUT6, | |
108 | GPIO121_KP_MKIN4, | |
9c291f0f EM |
109 | }; |
110 | ||
a6b993c6 EM |
111 | static struct smc91x_platdata smc91x_info = { |
112 | .flags = SMC91X_USE_16BIT | SMC91X_NOWAIT, | |
113 | }; | |
114 | ||
115 | static struct resource smc91x_resources[] = { | |
116 | [0] = { | |
117 | .start = SMC_CS1_PHYS_BASE + 0x300, | |
118 | .end = SMC_CS1_PHYS_BASE + 0xfffff, | |
119 | .flags = IORESOURCE_MEM, | |
120 | }, | |
121 | [1] = { | |
122 | .start = gpio_to_irq(27), | |
123 | .end = gpio_to_irq(27), | |
124 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | |
125 | } | |
126 | }; | |
127 | ||
128 | static struct platform_device smc91x_device = { | |
129 | .name = "smc91x", | |
130 | .id = 0, | |
131 | .dev = { | |
132 | .platform_data = &smc91x_info, | |
133 | }, | |
134 | .num_resources = ARRAY_SIZE(smc91x_resources), | |
135 | .resource = smc91x_resources, | |
136 | }; | |
137 | ||
ef559def HZ |
138 | static struct mtd_partition aspenite_nand_partitions[] = { |
139 | { | |
140 | .name = "bootloader", | |
141 | .offset = 0, | |
142 | .size = SZ_1M, | |
143 | .mask_flags = MTD_WRITEABLE, | |
144 | }, { | |
145 | .name = "reserved", | |
146 | .offset = MTDPART_OFS_APPEND, | |
147 | .size = SZ_128K, | |
148 | .mask_flags = MTD_WRITEABLE, | |
149 | }, { | |
150 | .name = "reserved", | |
151 | .offset = MTDPART_OFS_APPEND, | |
152 | .size = SZ_8M, | |
153 | .mask_flags = MTD_WRITEABLE, | |
154 | }, { | |
155 | .name = "kernel", | |
156 | .offset = MTDPART_OFS_APPEND, | |
157 | .size = (SZ_2M + SZ_1M), | |
158 | .mask_flags = 0, | |
159 | }, { | |
160 | .name = "filesystem", | |
161 | .offset = MTDPART_OFS_APPEND, | |
162 | .size = SZ_48M, | |
163 | .mask_flags = 0, | |
164 | } | |
165 | }; | |
166 | ||
167 | static struct pxa3xx_nand_platform_data aspenite_nand_info = { | |
168 | .enable_arbiter = 1, | |
169 | .parts = aspenite_nand_partitions, | |
170 | .nr_parts = ARRAY_SIZE(aspenite_nand_partitions), | |
171 | }; | |
172 | ||
07871c19 HZ |
173 | static struct i2c_board_info aspenite_i2c_info[] __initdata = { |
174 | { I2C_BOARD_INFO("wm8753", 0x1b), }, | |
175 | }; | |
176 | ||
884646a5 MB |
177 | static struct fb_videomode video_modes[] = { |
178 | [0] = { | |
179 | .pixclock = 30120, | |
180 | .refresh = 60, | |
181 | .xres = 800, | |
182 | .yres = 480, | |
183 | .hsync_len = 1, | |
184 | .left_margin = 215, | |
185 | .right_margin = 40, | |
186 | .vsync_len = 1, | |
187 | .upper_margin = 34, | |
188 | .lower_margin = 10, | |
189 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT, | |
190 | }, | |
191 | }; | |
192 | ||
193 | struct pxa168fb_mach_info aspenite_lcd_info = { | |
194 | .id = "Graphic Frame", | |
195 | .modes = video_modes, | |
196 | .num_modes = ARRAY_SIZE(video_modes), | |
197 | .pix_fmt = PIX_FMT_RGB565, | |
198 | .io_pin_allocation_mode = PIN_MODE_DUMB_24, | |
199 | .dumb_mode = DUMB_MODE_RGB888, | |
200 | .active = 1, | |
201 | .panel_rbswap = 0, | |
202 | .invert_pixclock = 0, | |
203 | }; | |
204 | ||
6aafc5f3 MB |
205 | static unsigned int aspenite_matrix_key_map[] = { |
206 | KEY(0, 6, KEY_UP), /* SW 4 */ | |
207 | KEY(0, 7, KEY_DOWN), /* SW 5 */ | |
208 | KEY(1, 6, KEY_LEFT), /* SW 6 */ | |
209 | KEY(1, 7, KEY_RIGHT), /* SW 7 */ | |
210 | KEY(4, 6, KEY_ENTER), /* SW 8 */ | |
211 | KEY(4, 7, KEY_ESC), /* SW 9 */ | |
212 | }; | |
213 | ||
214 | static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = { | |
215 | .matrix_key_rows = 5, | |
216 | .matrix_key_cols = 8, | |
217 | .matrix_key_map = aspenite_matrix_key_map, | |
218 | .matrix_key_map_size = ARRAY_SIZE(aspenite_matrix_key_map), | |
219 | .debounce_interval = 30, | |
220 | }; | |
221 | ||
49cbe786 EM |
222 | static void __init common_init(void) |
223 | { | |
9c291f0f EM |
224 | mfp_config(ARRAY_AND_SIZE(common_pin_config)); |
225 | ||
a6b993c6 | 226 | /* on-chip devices */ |
9c291f0f | 227 | pxa168_add_uart(1); |
07871c19 HZ |
228 | pxa168_add_twsi(1, NULL, ARRAY_AND_SIZE(aspenite_i2c_info)); |
229 | pxa168_add_ssp(1); | |
ef559def | 230 | pxa168_add_nand(&aspenite_nand_info); |
884646a5 | 231 | pxa168_add_fb(&aspenite_lcd_info); |
6aafc5f3 | 232 | pxa168_add_keypad(&aspenite_keypad_info); |
a6b993c6 EM |
233 | |
234 | /* off-chip devices */ | |
235 | platform_device_register(&smc91x_device); | |
49cbe786 EM |
236 | } |
237 | ||
238 | MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform") | |
239 | .phys_io = APB_PHYS_BASE, | |
49cbe786 | 240 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
8022887c | 241 | .map_io = mmp_map_io, |
49cbe786 EM |
242 | .init_irq = pxa168_init_irq, |
243 | .timer = &pxa168_timer, | |
244 | .init_machine = common_init, | |
245 | MACHINE_END | |
246 | ||
247 | MACHINE_START(ZYLONITE2, "PXA168-based Zylonite2 Development Platform") | |
248 | .phys_io = APB_PHYS_BASE, | |
49cbe786 | 249 | .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc, |
8022887c | 250 | .map_io = mmp_map_io, |
49cbe786 EM |
251 | .init_irq = pxa168_init_irq, |
252 | .timer = &pxa168_timer, | |
253 | .init_machine = common_init, | |
254 | MACHINE_END |