x86, cpu: Call verify_cpu during 32bit CPU startup
[linux-2.6.git] / arch / arm / mach-mx3 / mach-pcm037_eet.c
blob99e0894e07db320f3e4bbd668768b24803b62f1c
1 /*
2 * Copyright (C) 2009
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9 #include <linux/gpio.h>
10 #include <linux/gpio_keys.h>
11 #include <linux/input.h>
12 #include <linux/platform_device.h>
13 #include <linux/spi/spi.h>
15 #include <mach/common.h>
16 #include <mach/iomux-mx3.h>
18 #include <asm/mach-types.h>
20 #include "pcm037.h"
21 #include "devices.h"
22 #include "devices-imx31.h"
24 static unsigned int pcm037_eet_pins[] = {
25 /* Reserve and hardwire GPIO 57 high - S6E63D6 chipselect */
26 IOMUX_MODE(MX31_PIN_KEY_COL7, IOMUX_CONFIG_GPIO),
27 /* GPIO keys */
28 IOMUX_MODE(MX31_PIN_GPIO1_0, IOMUX_CONFIG_GPIO), /* 0 */
29 IOMUX_MODE(MX31_PIN_GPIO1_1, IOMUX_CONFIG_GPIO), /* 1 */
30 IOMUX_MODE(MX31_PIN_GPIO1_2, IOMUX_CONFIG_GPIO), /* 2 */
31 IOMUX_MODE(MX31_PIN_GPIO1_3, IOMUX_CONFIG_GPIO), /* 3 */
32 IOMUX_MODE(MX31_PIN_SVEN0, IOMUX_CONFIG_GPIO), /* 32 */
33 IOMUX_MODE(MX31_PIN_STX0, IOMUX_CONFIG_GPIO), /* 33 */
34 IOMUX_MODE(MX31_PIN_SRX0, IOMUX_CONFIG_GPIO), /* 34 */
35 IOMUX_MODE(MX31_PIN_SIMPD0, IOMUX_CONFIG_GPIO), /* 35 */
36 IOMUX_MODE(MX31_PIN_RTS1, IOMUX_CONFIG_GPIO), /* 38 */
37 IOMUX_MODE(MX31_PIN_CTS1, IOMUX_CONFIG_GPIO), /* 39 */
38 IOMUX_MODE(MX31_PIN_KEY_ROW4, IOMUX_CONFIG_GPIO), /* 50 */
39 IOMUX_MODE(MX31_PIN_KEY_ROW5, IOMUX_CONFIG_GPIO), /* 51 */
40 IOMUX_MODE(MX31_PIN_KEY_ROW6, IOMUX_CONFIG_GPIO), /* 52 */
41 IOMUX_MODE(MX31_PIN_KEY_ROW7, IOMUX_CONFIG_GPIO), /* 53 */
43 /* LEDs */
44 IOMUX_MODE(MX31_PIN_DTR_DTE1, IOMUX_CONFIG_GPIO), /* 44 */
45 IOMUX_MODE(MX31_PIN_DSR_DTE1, IOMUX_CONFIG_GPIO), /* 45 */
46 IOMUX_MODE(MX31_PIN_KEY_COL5, IOMUX_CONFIG_GPIO), /* 55 */
47 IOMUX_MODE(MX31_PIN_KEY_COL6, IOMUX_CONFIG_GPIO), /* 56 */
50 /* SPI */
51 static struct spi_board_info pcm037_spi_dev[] = {
53 .modalias = "dac124s085",
54 .max_speed_hz = 400000,
55 .bus_num = 0,
56 .chip_select = 0, /* Index in pcm037_spi1_cs[] */
57 .mode = SPI_CPHA,
61 /* Platform Data for MXC CSPI */
62 #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
63 static int pcm037_spi1_cs[] = {MXC_SPI_CS(1), IOMUX_TO_GPIO(MX31_PIN_KEY_COL7)};
65 static const struct spi_imx_master pcm037_spi1_pdata __initconst = {
66 .chipselect = pcm037_spi1_cs,
67 .num_chipselect = ARRAY_SIZE(pcm037_spi1_cs),
69 #endif
71 /* GPIO-keys input device */
72 static struct gpio_keys_button pcm037_gpio_keys[] = {
74 .type = EV_KEY,
75 .code = KEY_L,
76 .gpio = 0,
77 .desc = "Wheel Manual",
78 .wakeup = 0,
79 }, {
80 .type = EV_KEY,
81 .code = KEY_A,
82 .gpio = 1,
83 .desc = "Wheel AF",
84 .wakeup = 0,
85 }, {
86 .type = EV_KEY,
87 .code = KEY_V,
88 .gpio = 2,
89 .desc = "Wheel View",
90 .wakeup = 0,
91 }, {
92 .type = EV_KEY,
93 .code = KEY_M,
94 .gpio = 3,
95 .desc = "Wheel Menu",
96 .wakeup = 0,
97 }, {
98 .type = EV_KEY,
99 .code = KEY_UP,
100 .gpio = 32,
101 .desc = "Nav Pad Up",
102 .wakeup = 0,
103 }, {
104 .type = EV_KEY,
105 .code = KEY_RIGHT,
106 .gpio = 33,
107 .desc = "Nav Pad Right",
108 .wakeup = 0,
109 }, {
110 .type = EV_KEY,
111 .code = KEY_DOWN,
112 .gpio = 34,
113 .desc = "Nav Pad Down",
114 .wakeup = 0,
115 }, {
116 .type = EV_KEY,
117 .code = KEY_LEFT,
118 .gpio = 35,
119 .desc = "Nav Pad Left",
120 .wakeup = 0,
121 }, {
122 .type = EV_KEY,
123 .code = KEY_ENTER,
124 .gpio = 38,
125 .desc = "Nav Pad Ok",
126 .wakeup = 0,
127 }, {
128 .type = EV_KEY,
129 .code = KEY_O,
130 .gpio = 39,
131 .desc = "Wheel Off",
132 .wakeup = 0,
133 }, {
134 .type = EV_KEY,
135 .code = BTN_FORWARD,
136 .gpio = 50,
137 .desc = "Focus Forward",
138 .wakeup = 0,
139 }, {
140 .type = EV_KEY,
141 .code = BTN_BACK,
142 .gpio = 51,
143 .desc = "Focus Backward",
144 .wakeup = 0,
145 }, {
146 .type = EV_KEY,
147 .code = BTN_MIDDLE,
148 .gpio = 52,
149 .desc = "Release Half",
150 .wakeup = 0,
151 }, {
152 .type = EV_KEY,
153 .code = BTN_EXTRA,
154 .gpio = 53,
155 .desc = "Release Full",
156 .wakeup = 0,
160 static struct gpio_keys_platform_data pcm037_gpio_keys_platform_data = {
161 .buttons = pcm037_gpio_keys,
162 .nbuttons = ARRAY_SIZE(pcm037_gpio_keys),
163 .rep = 0, /* No auto-repeat */
166 static struct platform_device pcm037_gpio_keys_device = {
167 .name = "gpio-keys",
168 .id = -1,
169 .dev = {
170 .platform_data = &pcm037_gpio_keys_platform_data,
174 static int eet_init_devices(void)
176 if (!machine_is_pcm037() || pcm037_variant() != PCM037_EET)
177 return 0;
179 mxc_iomux_setup_multiple_pins(pcm037_eet_pins,
180 ARRAY_SIZE(pcm037_eet_pins), "pcm037_eet");
182 /* SPI */
183 spi_register_board_info(pcm037_spi_dev, ARRAY_SIZE(pcm037_spi_dev));
184 #if defined(CONFIG_SPI_IMX) || defined(CONFIG_SPI_IMX_MODULE)
185 imx31_add_spi_imx0(&pcm037_spi1_pdata);
186 #endif
188 platform_device_register(&pcm037_gpio_keys_device);
190 return 0;
193 late_initcall(eet_init_devices);