Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved. |
| 3 | * |
| 4 | * Author: Fabio Estevam <fabio.estevam@freescale.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 2 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 15 | */ |
| 16 | |
Uwe Kleine-König | 8fdca37 | 2010-03-08 10:46:11 +0100 | [diff] [blame] | 17 | /* |
| 18 | * This machine is known as: |
| 19 | * - i.MX27 3-Stack Development System |
| 20 | * - i.MX27 Platform Development Kit (i.MX27 PDK) |
| 21 | */ |
| 22 | |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 23 | #include <linux/platform_device.h> |
| 24 | #include <linux/gpio.h> |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 25 | #include <linux/irq.h> |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 26 | #include <linux/usb/otg.h> |
| 27 | #include <linux/usb/ulpi.h> |
| 28 | #include <linux/delay.h> |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 29 | #include <linux/mfd/mc13783.h> |
| 30 | #include <linux/spi/spi.h> |
| 31 | #include <linux/regulator/machine.h> |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 32 | #include <linux/spi/l4f00242t03.h> |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 33 | |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 34 | #include <asm/mach-types.h> |
| 35 | #include <asm/mach/arch.h> |
| 36 | #include <asm/mach/time.h> |
| 37 | #include <mach/hardware.h> |
| 38 | #include <mach/common.h> |
Uwe Kleine-König | e835d88 | 2010-02-16 11:07:49 +0100 | [diff] [blame] | 39 | #include <mach/iomux-mx27.h> |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 40 | #include <mach/ulpi.h> |
Fabio Estevam | 92cb33f | 2011-01-10 18:17:37 -0200 | [diff] [blame] | 41 | #include <mach/irqs.h> |
| 42 | #include <mach/3ds_debugboard.h> |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 43 | |
Uwe Kleine-König | d5dac4a | 2010-06-23 09:36:01 +0200 | [diff] [blame] | 44 | #include "devices-imx27.h" |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 45 | |
Fabio Estevam | 98618cf | 2011-06-22 09:25:23 -0300 | [diff] [blame] | 46 | #define SD1_EN_GPIO IMX_GPIO_NR(2, 25) |
| 47 | #define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23) |
| 48 | #define SPI2_SS0 IMX_GPIO_NR(4, 21) |
| 49 | #define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(3, 28)) |
Fabio Estevam | aec250d | 2011-06-22 09:25:24 -0300 | [diff] [blame] | 50 | #define PMIC_INT IMX_GPIO_NR(3, 14) |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 51 | #define SPI1_SS0 IMX_GPIO_NR(4, 28) |
Fabio Estevam | c084473d | 2011-06-22 09:25:27 -0300 | [diff] [blame] | 52 | #define SD1_CD IMX_GPIO_NR(2, 26) |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 53 | #define LCD_RESET IMX_GPIO_NR(1, 3) |
| 54 | #define LCD_ENABLE IMX_GPIO_NR(1, 31) |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 55 | |
Uwe Kleine-König | 6c80ee5 | 2010-09-28 21:53:31 +0200 | [diff] [blame] | 56 | static const int mx27pdk_pins[] __initconst = { |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 57 | /* UART1 */ |
| 58 | PE12_PF_UART1_TXD, |
| 59 | PE13_PF_UART1_RXD, |
| 60 | PE14_PF_UART1_CTS, |
| 61 | PE15_PF_UART1_RTS, |
| 62 | /* FEC */ |
| 63 | PD0_AIN_FEC_TXD0, |
| 64 | PD1_AIN_FEC_TXD1, |
| 65 | PD2_AIN_FEC_TXD2, |
| 66 | PD3_AIN_FEC_TXD3, |
| 67 | PD4_AOUT_FEC_RX_ER, |
| 68 | PD5_AOUT_FEC_RXD1, |
| 69 | PD6_AOUT_FEC_RXD2, |
| 70 | PD7_AOUT_FEC_RXD3, |
| 71 | PD8_AF_FEC_MDIO, |
| 72 | PD9_AIN_FEC_MDC, |
| 73 | PD10_AOUT_FEC_CRS, |
| 74 | PD11_AOUT_FEC_TX_CLK, |
| 75 | PD12_AOUT_FEC_RXD0, |
| 76 | PD13_AOUT_FEC_RX_DV, |
| 77 | PD14_AOUT_FEC_RX_CLK, |
| 78 | PD15_AOUT_FEC_COL, |
| 79 | PD16_AIN_FEC_TX_ER, |
| 80 | PF23_AIN_FEC_TX_EN, |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 81 | /* SDHC1 */ |
| 82 | PE18_PF_SD1_D0, |
| 83 | PE19_PF_SD1_D1, |
| 84 | PE20_PF_SD1_D2, |
| 85 | PE21_PF_SD1_D3, |
| 86 | PE22_PF_SD1_CMD, |
| 87 | PE23_PF_SD1_CLK, |
| 88 | SD1_EN_GPIO | GPIO_GPIO | GPIO_OUT, |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 89 | /* OTG */ |
| 90 | OTG_PHY_RESET_GPIO | GPIO_GPIO | GPIO_OUT, |
| 91 | PC7_PF_USBOTG_DATA5, |
| 92 | PC8_PF_USBOTG_DATA6, |
| 93 | PC9_PF_USBOTG_DATA0, |
| 94 | PC10_PF_USBOTG_DATA2, |
| 95 | PC11_PF_USBOTG_DATA1, |
| 96 | PC12_PF_USBOTG_DATA4, |
| 97 | PC13_PF_USBOTG_DATA3, |
| 98 | PE0_PF_USBOTG_NXT, |
| 99 | PE1_PF_USBOTG_STP, |
| 100 | PE2_PF_USBOTG_DIR, |
| 101 | PE24_PF_USBOTG_CLK, |
| 102 | PE25_PF_USBOTG_DATA7, |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 103 | /* CSPI1 */ |
| 104 | PD31_PF_CSPI1_MOSI, |
| 105 | PD30_PF_CSPI1_MISO, |
| 106 | PD29_PF_CSPI1_SCLK, |
| 107 | PD25_PF_CSPI1_RDY, |
| 108 | SPI1_SS0 | GPIO_GPIO | GPIO_OUT, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 109 | /* CSPI2 */ |
| 110 | PD22_PF_CSPI2_SCLK, |
| 111 | PD23_PF_CSPI2_MISO, |
| 112 | PD24_PF_CSPI2_MOSI, |
Fabio Estevam | aec250d | 2011-06-22 09:25:24 -0300 | [diff] [blame] | 113 | SPI2_SS0 | GPIO_GPIO | GPIO_OUT, |
Fabio Estevam | 5885f03 | 2011-03-01 16:59:46 -0300 | [diff] [blame] | 114 | /* I2C1 */ |
| 115 | PD17_PF_I2C_DATA, |
| 116 | PD18_PF_I2C_CLK, |
Fabio Estevam | aec250d | 2011-06-22 09:25:24 -0300 | [diff] [blame] | 117 | /* PMIC INT */ |
| 118 | PMIC_INT | GPIO_GPIO | GPIO_IN, |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 119 | /* LCD */ |
| 120 | PA5_PF_LSCLK, |
| 121 | PA6_PF_LD0, |
| 122 | PA7_PF_LD1, |
| 123 | PA8_PF_LD2, |
| 124 | PA9_PF_LD3, |
| 125 | PA10_PF_LD4, |
| 126 | PA11_PF_LD5, |
| 127 | PA12_PF_LD6, |
| 128 | PA13_PF_LD7, |
| 129 | PA14_PF_LD8, |
| 130 | PA15_PF_LD9, |
| 131 | PA16_PF_LD10, |
| 132 | PA17_PF_LD11, |
| 133 | PA18_PF_LD12, |
| 134 | PA19_PF_LD13, |
| 135 | PA20_PF_LD14, |
| 136 | PA21_PF_LD15, |
| 137 | PA22_PF_LD16, |
| 138 | PA23_PF_LD17, |
| 139 | PA28_PF_HSYNC, |
| 140 | PA29_PF_VSYNC, |
| 141 | PA30_PF_CONTRAST, |
| 142 | LCD_ENABLE | GPIO_GPIO | GPIO_OUT, |
| 143 | LCD_RESET | GPIO_GPIO | GPIO_OUT, |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 144 | }; |
| 145 | |
Uwe Kleine-König | d5dac4a | 2010-06-23 09:36:01 +0200 | [diff] [blame] | 146 | static const struct imxuart_platform_data uart_pdata __initconst = { |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 147 | .flags = IMXUART_HAVE_RTSCTS, |
| 148 | }; |
| 149 | |
Rogerio Pimentel | 3fac6cf | 2010-06-25 10:31:33 -0300 | [diff] [blame] | 150 | /* |
| 151 | * Matrix keyboard |
| 152 | */ |
| 153 | |
| 154 | static const uint32_t mx27_3ds_keymap[] = { |
| 155 | KEY(0, 0, KEY_UP), |
| 156 | KEY(0, 1, KEY_DOWN), |
| 157 | KEY(1, 0, KEY_RIGHT), |
| 158 | KEY(1, 1, KEY_LEFT), |
| 159 | KEY(1, 2, KEY_ENTER), |
| 160 | KEY(2, 0, KEY_F6), |
| 161 | KEY(2, 1, KEY_F8), |
| 162 | KEY(2, 2, KEY_F9), |
| 163 | KEY(2, 3, KEY_F10), |
| 164 | }; |
| 165 | |
Uwe Kleine-König | 3f88014 | 2010-11-10 09:58:56 +0100 | [diff] [blame] | 166 | static const struct matrix_keymap_data mx27_3ds_keymap_data __initconst = { |
Rogerio Pimentel | 3fac6cf | 2010-06-25 10:31:33 -0300 | [diff] [blame] | 167 | .keymap = mx27_3ds_keymap, |
| 168 | .keymap_size = ARRAY_SIZE(mx27_3ds_keymap), |
| 169 | }; |
| 170 | |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 171 | static int mx27_3ds_sdhc1_init(struct device *dev, irq_handler_t detect_irq, |
| 172 | void *data) |
| 173 | { |
Fabio Estevam | c084473d | 2011-06-22 09:25:27 -0300 | [diff] [blame] | 174 | return request_irq(gpio_to_irq(SD1_CD), detect_irq, |
| 175 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "sdhc1-card-detect", data); |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | static void mx27_3ds_sdhc1_exit(struct device *dev, void *data) |
| 179 | { |
Fabio Estevam | c084473d | 2011-06-22 09:25:27 -0300 | [diff] [blame] | 180 | free_irq(gpio_to_irq(SD1_CD), data); |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 181 | } |
| 182 | |
Uwe Kleine-König | 9d3d945 | 2010-11-05 17:26:09 +0100 | [diff] [blame] | 183 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 184 | .init = mx27_3ds_sdhc1_init, |
| 185 | .exit = mx27_3ds_sdhc1_exit, |
| 186 | }; |
| 187 | |
| 188 | static void mx27_3ds_sdhc1_enable_level_translator(void) |
| 189 | { |
| 190 | /* Turn on TXB0108 OE pin */ |
| 191 | gpio_request(SD1_EN_GPIO, "sd1_enable"); |
| 192 | gpio_direction_output(SD1_EN_GPIO, 1); |
| 193 | } |
| 194 | |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 195 | |
| 196 | static int otg_phy_init(void) |
| 197 | { |
| 198 | gpio_request(OTG_PHY_RESET_GPIO, "usb-otg-reset"); |
| 199 | gpio_direction_output(OTG_PHY_RESET_GPIO, 0); |
| 200 | mdelay(1); |
| 201 | gpio_set_value(OTG_PHY_RESET_GPIO, 1); |
| 202 | return 0; |
| 203 | } |
| 204 | |
Sascha Hauer | 4bd597b | 2011-01-03 11:30:28 +0100 | [diff] [blame] | 205 | static int mx27_3ds_otg_init(struct platform_device *pdev) |
| 206 | { |
| 207 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); |
| 208 | } |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 209 | |
| 210 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
Sascha Hauer | 4bd597b | 2011-01-03 11:30:28 +0100 | [diff] [blame] | 211 | .init = mx27_3ds_otg_init, |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 212 | .portsc = MXC_EHCI_MODE_ULPI, |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 213 | }; |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 214 | |
| 215 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
| 216 | .operating_mode = FSL_USB2_DR_DEVICE, |
| 217 | .phy_mode = FSL_USB2_PHY_ULPI, |
| 218 | }; |
| 219 | |
| 220 | static int otg_mode_host; |
| 221 | |
| 222 | static int __init mx27_3ds_otg_mode(char *options) |
| 223 | { |
| 224 | if (!strcmp(options, "host")) |
| 225 | otg_mode_host = 1; |
| 226 | else if (!strcmp(options, "device")) |
| 227 | otg_mode_host = 0; |
| 228 | else |
| 229 | pr_info("otg_mode neither \"host\" nor \"device\". " |
| 230 | "Defaulting to device\n"); |
| 231 | return 0; |
| 232 | } |
| 233 | __setup("otg_mode=", mx27_3ds_otg_mode); |
| 234 | |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 235 | /* Regulators */ |
Fabio Estevam | aec250d | 2011-06-22 09:25:24 -0300 | [diff] [blame] | 236 | static struct regulator_init_data gpo_init = { |
| 237 | .constraints = { |
| 238 | .boot_on = 1, |
| 239 | .always_on = 1, |
| 240 | } |
| 241 | }; |
| 242 | |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 243 | static struct regulator_consumer_supply vmmc1_consumers[] = { |
| 244 | REGULATOR_SUPPLY("lcd_2v8", NULL), |
| 245 | }; |
| 246 | |
| 247 | static struct regulator_init_data vmmc1_init = { |
| 248 | .constraints = { |
| 249 | .min_uV = 2800000, |
| 250 | .max_uV = 2800000, |
Fabio Estevam | aec250d | 2011-06-22 09:25:24 -0300 | [diff] [blame] | 251 | .apply_uV = 1, |
| 252 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | |
| 253 | REGULATOR_CHANGE_STATUS, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 254 | }, |
| 255 | .num_consumer_supplies = ARRAY_SIZE(vmmc1_consumers), |
| 256 | .consumer_supplies = vmmc1_consumers, |
| 257 | }; |
| 258 | |
| 259 | static struct regulator_consumer_supply vgen_consumers[] = { |
| 260 | REGULATOR_SUPPLY("vdd_lcdio", NULL), |
| 261 | }; |
| 262 | |
| 263 | static struct regulator_init_data vgen_init = { |
| 264 | .constraints = { |
| 265 | .min_uV = 1800000, |
| 266 | .max_uV = 1800000, |
| 267 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, |
| 268 | }, |
| 269 | .num_consumer_supplies = ARRAY_SIZE(vgen_consumers), |
| 270 | .consumer_supplies = vgen_consumers, |
| 271 | }; |
| 272 | |
David Jander | 5836372 | 2011-02-10 10:59:44 +0100 | [diff] [blame] | 273 | static struct mc13xxx_regulator_init_data mx27_3ds_regulators[] = { |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 274 | { |
Sascha Hauer | 074cee9 | 2011-01-07 17:07:22 +0100 | [diff] [blame] | 275 | .id = MC13783_REG_VMMC1, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 276 | .init_data = &vmmc1_init, |
| 277 | }, { |
Sascha Hauer | 074cee9 | 2011-01-07 17:07:22 +0100 | [diff] [blame] | 278 | .id = MC13783_REG_VGEN, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 279 | .init_data = &vgen_init, |
Fabio Estevam | aec250d | 2011-06-22 09:25:24 -0300 | [diff] [blame] | 280 | }, { |
| 281 | .id = MC13783_REG_GPO1, /* Turn on 1.8V */ |
| 282 | .init_data = &gpo_init, |
| 283 | }, { |
| 284 | .id = MC13783_REG_GPO3, /* Turn on 3.3V */ |
| 285 | .init_data = &gpo_init, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 286 | }, |
| 287 | }; |
| 288 | |
| 289 | /* MC13783 */ |
Andres Salomon | 4ec1b54 | 2011-02-17 19:07:23 -0800 | [diff] [blame] | 290 | static struct mc13xxx_platform_data mc13783_pdata = { |
| 291 | .regulators = { |
| 292 | .regulators = mx27_3ds_regulators, |
| 293 | .num_regulators = ARRAY_SIZE(mx27_3ds_regulators), |
| 294 | |
| 295 | }, |
| 296 | .flags = MC13783_USE_REGULATOR, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 297 | }; |
| 298 | |
| 299 | /* SPI */ |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 300 | static int spi1_chipselect[] = {SPI1_SS0}; |
| 301 | |
| 302 | static const struct spi_imx_master spi1_pdata __initconst = { |
| 303 | .chipselect = spi1_chipselect, |
| 304 | .num_chipselect = ARRAY_SIZE(spi1_chipselect), |
| 305 | }; |
| 306 | |
Fabio Estevam | 6d2385a | 2011-06-22 09:25:28 -0300 | [diff] [blame] | 307 | static int spi2_chipselect[] = {SPI2_SS0}; |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 308 | |
| 309 | static const struct spi_imx_master spi2_pdata __initconst = { |
Fabio Estevam | 6d2385a | 2011-06-22 09:25:28 -0300 | [diff] [blame] | 310 | .chipselect = spi2_chipselect, |
| 311 | .num_chipselect = ARRAY_SIZE(spi2_chipselect), |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 312 | }; |
| 313 | |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 314 | static struct imx_fb_videomode mx27_3ds_modes[] = { |
| 315 | { /* 480x640 @ 60 Hz */ |
| 316 | .mode = { |
| 317 | .name = "Epson-VGA", |
| 318 | .refresh = 60, |
| 319 | .xres = 480, |
| 320 | .yres = 640, |
| 321 | .pixclock = 41701, |
| 322 | .left_margin = 20, |
| 323 | .right_margin = 41, |
| 324 | .upper_margin = 10, |
| 325 | .lower_margin = 5, |
| 326 | .hsync_len = 20, |
| 327 | .vsync_len = 10, |
| 328 | .sync = FB_SYNC_OE_ACT_HIGH | |
| 329 | FB_SYNC_CLK_INVERT, |
| 330 | .vmode = FB_VMODE_NONINTERLACED, |
| 331 | .flag = 0, |
| 332 | }, |
| 333 | .bpp = 16, |
| 334 | .pcr = 0xFAC08B82, |
| 335 | }, |
| 336 | }; |
| 337 | |
| 338 | static const struct imx_fb_platform_data mx27_3ds_fb_data __initconst = { |
| 339 | .mode = mx27_3ds_modes, |
| 340 | .num_modes = ARRAY_SIZE(mx27_3ds_modes), |
| 341 | .pwmr = 0x00A903FF, |
| 342 | .lscr1 = 0x00120300, |
| 343 | .dmacr = 0x00020010, |
| 344 | }; |
| 345 | |
| 346 | /* LCD */ |
| 347 | static struct l4f00242t03_pdata mx27_3ds_lcd_pdata = { |
| 348 | .reset_gpio = LCD_RESET, |
| 349 | .data_enable_gpio = LCD_ENABLE, |
| 350 | .core_supply = "lcd_2v8", |
| 351 | .io_supply = "vdd_lcdio", |
| 352 | }; |
| 353 | |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 354 | static struct spi_board_info mx27_3ds_spi_devs[] __initdata = { |
| 355 | { |
| 356 | .modalias = "mc13783", |
| 357 | .max_speed_hz = 1000000, |
| 358 | .bus_num = 1, |
| 359 | .chip_select = 0, /* SS0 */ |
| 360 | .platform_data = &mc13783_pdata, |
Fabio Estevam | c084473d | 2011-06-22 09:25:27 -0300 | [diff] [blame] | 361 | .irq = gpio_to_irq(PMIC_INT), |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 362 | .mode = SPI_CS_HIGH, |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 363 | }, { |
| 364 | .modalias = "l4f00242t03", |
| 365 | .max_speed_hz = 5000000, |
| 366 | .bus_num = 0, |
| 367 | .chip_select = 0, /* SS0 */ |
| 368 | .platform_data = &mx27_3ds_lcd_pdata, |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 369 | }, |
| 370 | }; |
| 371 | |
Fabio Estevam | 5885f03 | 2011-03-01 16:59:46 -0300 | [diff] [blame] | 372 | static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = { |
| 373 | .bitrate = 100000, |
| 374 | }; |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 375 | |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 376 | static void __init mx27pdk_init(void) |
| 377 | { |
Shawn Guo | b78d8e5 | 2011-06-06 00:07:55 +0800 | [diff] [blame] | 378 | imx27_soc_init(); |
| 379 | |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 380 | mxc_gpio_setup_multiple_pins(mx27pdk_pins, ARRAY_SIZE(mx27pdk_pins), |
| 381 | "mx27pdk"); |
Rogerio Pimentel | b5ec73e | 2010-10-22 11:03:54 -0200 | [diff] [blame] | 382 | mx27_3ds_sdhc1_enable_level_translator(); |
Uwe Kleine-König | d5dac4a | 2010-06-23 09:36:01 +0200 | [diff] [blame] | 383 | imx27_add_imx_uart0(&uart_pdata); |
Uwe Kleine-König | 6bd96f3 | 2010-10-06 12:00:18 +0200 | [diff] [blame] | 384 | imx27_add_fec(NULL); |
Uwe Kleine-König | 3f88014 | 2010-11-10 09:58:56 +0100 | [diff] [blame] | 385 | imx27_add_imx_keypad(&mx27_3ds_keymap_data); |
Uwe Kleine-König | 9d3d945 | 2010-11-05 17:26:09 +0100 | [diff] [blame] | 386 | imx27_add_mxc_mmc(0, &sdhc1_pdata); |
Fabio Estevam | 8be9252 | 2010-12-07 17:14:45 -0200 | [diff] [blame] | 387 | imx27_add_imx2_wdt(NULL); |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 388 | otg_phy_init(); |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 389 | |
Sascha Hauer | 48f6b09 | 2011-03-02 09:27:42 +0100 | [diff] [blame] | 390 | if (otg_mode_host) { |
| 391 | otg_pdata.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | |
| 392 | ULPI_OTG_DRVVBUS_EXT); |
| 393 | |
| 394 | if (otg_pdata.otg) |
| 395 | imx27_add_mxc_ehci_otg(&otg_pdata); |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 396 | } |
Sascha Hauer | 48f6b09 | 2011-03-02 09:27:42 +0100 | [diff] [blame] | 397 | |
Fabio Estevam | 96cf423 | 2010-12-22 12:25:31 -0200 | [diff] [blame] | 398 | if (!otg_mode_host) |
| 399 | imx27_add_fsl_usb2_udc(&otg_device_pdata); |
| 400 | |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 401 | imx27_add_spi_imx1(&spi2_pdata); |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 402 | imx27_add_spi_imx0(&spi1_pdata); |
Fabio Estevam | c67a3e0 | 2011-01-03 11:16:39 -0200 | [diff] [blame] | 403 | spi_register_board_info(mx27_3ds_spi_devs, |
| 404 | ARRAY_SIZE(mx27_3ds_spi_devs)); |
Fabio Estevam | 92cb33f | 2011-01-10 18:17:37 -0200 | [diff] [blame] | 405 | |
| 406 | if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) |
| 407 | pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); |
Fabio Estevam | 5885f03 | 2011-03-01 16:59:46 -0300 | [diff] [blame] | 408 | imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); |
Fabio Estevam | 1abcb4c | 2011-06-22 09:25:25 -0300 | [diff] [blame^] | 409 | imx27_add_imx_fb(&mx27_3ds_fb_data); |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 410 | } |
| 411 | |
| 412 | static void __init mx27pdk_timer_init(void) |
| 413 | { |
| 414 | mx27_clocks_init(26000000); |
| 415 | } |
| 416 | |
| 417 | static struct sys_timer mx27pdk_timer = { |
| 418 | .init = mx27pdk_timer_init, |
| 419 | }; |
| 420 | |
| 421 | MACHINE_START(MX27_3DS, "Freescale MX27PDK") |
| 422 | /* maintainer: Freescale Semiconductor, Inc. */ |
Uwe Kleine-König | 3dac219 | 2011-02-07 16:35:19 +0100 | [diff] [blame] | 423 | .boot_params = MX27_PHYS_OFFSET + 0x100, |
| 424 | .map_io = mx27_map_io, |
| 425 | .init_early = imx27_init_early, |
| 426 | .init_irq = mx27_init_irq, |
| 427 | .timer = &mx27pdk_timer, |
| 428 | .init_machine = mx27pdk_init, |
Fabio Estevam | ec9be0d | 2009-04-16 12:45:01 -0700 | [diff] [blame] | 429 | MACHINE_END |