1 #include <linux/platform_device.h>
2 #include <linux/mtd/mtd.h>
3 #include <linux/mtd/physmap.h>
4 #include <linux/gpio.h>
5 #include <linux/leds.h>
7 #include <mach/common.h>
8 #include <mach/hardware.h>
9 #include <asm/mach-types.h>
10 #include <asm/mach/arch.h>
11 #include <asm/mach/time.h>
12 #include <asm/mach/map.h>
13 #include <mach/imx-uart.h>
14 #include <mach/imxfb.h>
15 #include <mach/iomux-mx21.h>
16 #include <mach/board-vp6500.h>
20 #include <linux/input.h>
21 #include <linux/input/matrix_keypad.h>
22 #include <linux/gpio_keys.h>
24 static unsigned int vp6500_pins
[] = {
57 static struct physmap_flash_data vp6500_flash_data
= {
61 static struct resource vp6500_flash_resource
= {
62 .start
= MX21_CS0_BASE_ADDR
,
63 .end
= MX21_CS0_BASE_ADDR
+ SZ_64M
- 1,
64 .flags
= IORESOURCE_MEM
,
67 static struct platform_device vp6500_nor_mtd_device
= {
68 .name
= "physmap-flash",
71 .platform_data
= &vp6500_flash_data
,
74 .resource
= &vp6500_flash_resource
,
77 static struct gpio_led vp6500_leds
[] = {
79 .name
= "vp6500:orange:keypad",
80 .gpio
= VP6500_GPIO_LED_KEYPAD
,
83 .name
= "vp6500:green:",
84 .gpio
= VP6500_GPIO_LED_GREEN
,
86 .default_state
= LEDS_GPIO_DEFSTATE_ON
,
89 .name
= "vp6500:red:",
90 .gpio
= VP6500_GPIO_LED_RED
,
93 .name
= "vp6500:red:camera",
94 .gpio
= VP6500_GPIO_LED_CAMERA
,
98 static struct gpio_led_platform_data vp6500_leds_data
= {
100 .num_leds
= ARRAY_SIZE(vp6500_leds
),
103 static struct platform_device vp6500_leds_device
= {
107 .platform_data
= &vp6500_leds_data
,
111 static const uint32_t vp6500_keypad_keys
[] = {
113 KEY(0, 4, KEY_RIGHT
),
115 KEY(1, 1, KEY_NUMERIC_POUND
),
117 KEY(1, 3, KEY_ENTER
),
124 KEY(3, 0, KEY_CAMERA
),
125 KEY(3, 1, KEY_NUMERIC_STAR
),
136 static struct matrix_keymap_data vp6500_keypad_data
= {
137 .keymap
= vp6500_keypad_keys
,
138 .keymap_size
= ARRAY_SIZE(vp6500_keypad_keys
),
141 static struct resource vp6500_keypad_resources
[] = {
143 .start
= MX21_KPP_BASE_ADDR
,
144 .end
= MX21_KPP_BASE_ADDR
+ 0x10 - 1,
145 .flags
= IORESOURCE_MEM
,
148 .start
= MX21_INT_KPP
,
149 .flags
= IORESOURCE_IRQ
,
153 static struct platform_device vp6500_keypad_device
= {
154 .name
= "imx-keypad",
157 .platform_data
= &vp6500_keypad_data
,
159 .resource
= vp6500_keypad_resources
,
160 .num_resources
= ARRAY_SIZE(vp6500_keypad_resources
),
163 static struct gpio_keys_button vp6500_keys
= {
164 .gpio
= VP6500_GPIO_POWER_KEY
,
166 .desc
= "Power button",
170 static struct gpio_keys_platform_data vp6500_key_data
= {
171 .buttons
= &vp6500_keys
,
175 static struct platform_device vp6500_key_device
= {
179 .platform_data
= &vp6500_key_data
,
183 static struct platform_device
*platform_devices
[] __initdata
= {
184 &vp6500_nor_mtd_device
,
186 &vp6500_keypad_device
,
190 static void __init
vp6500_board_init(void)
192 mxc_gpio_setup_multiple_pins(vp6500_pins
, ARRAY_SIZE(vp6500_pins
),
195 mxc_register_device(&mxc_uart_device0
, NULL
);
197 platform_add_devices(platform_devices
, ARRAY_SIZE(platform_devices
));
200 static void __init
vp6500_timer_init(void)
202 mx21_clocks_init(32768, 26000000);
205 static struct sys_timer vp6500_timer
= {
206 .init
= vp6500_timer_init
,
209 MACHINE_START(VP6500
, "Phillips VP6500")
210 .phys_io
= MX21_AIPI_BASE_ADDR
,
211 .io_pg_offst
= ((MX21_AIPI_BASE_ADDR_VIRT
) >> 18) & 0xfffc,
212 .boot_params
= MX21_PHYS_OFFSET
+ 0x100,
213 .map_io
= mx21_map_io
,
214 .init_irq
= mx21_init_irq
,
215 .init_machine
= vp6500_board_init
,
216 .timer
= &vp6500_timer
,