Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Sascha Hauer, Pengutronix |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; either version 2 of the License, or |
| 7 | * (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | */ |
| 18 | |
| 19 | #include <linux/types.h> |
| 20 | #include <linux/init.h> |
| 21 | |
| 22 | #include <linux/platform_device.h> |
| 23 | #include <linux/mtd/physmap.h> |
Sascha Hauer | 3dad21a | 2008-11-23 17:32:49 +0100 | [diff] [blame] | 24 | #include <linux/mtd/plat-ram.h> |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 25 | #include <linux/memory.h> |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 26 | #include <linux/gpio.h> |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 27 | #include <linux/smsc911x.h> |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 28 | #include <linux/interrupt.h> |
Sascha Hauer | 7920675 | 2009-01-28 17:10:32 +0100 | [diff] [blame] | 29 | #include <linux/i2c.h> |
| 30 | #include <linux/i2c/at24.h> |
Sascha Hauer | dddd4a4 | 2009-03-10 11:56:10 +0100 | [diff] [blame] | 31 | #include <linux/delay.h> |
| 32 | #include <linux/spi/spi.h> |
| 33 | #include <linux/irq.h> |
Guennadi Liakhovetski | eb05bbe | 2009-05-04 13:13:52 +0200 | [diff] [blame^] | 34 | #include <linux/fsl_devices.h> |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 35 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 36 | #include <mach/hardware.h> |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 37 | #include <asm/mach-types.h> |
| 38 | #include <asm/mach/arch.h> |
| 39 | #include <asm/mach/time.h> |
| 40 | #include <asm/mach/map.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 41 | #include <mach/common.h> |
| 42 | #include <mach/imx-uart.h> |
| 43 | #include <mach/iomux-mx3.h> |
Guennadi Liakhovetski | a8df0ee | 2009-04-15 14:32:52 +0200 | [diff] [blame] | 44 | #include <mach/ipu.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 45 | #include <mach/board-pcm037.h> |
Guennadi Liakhovetski | a8df0ee | 2009-04-15 14:32:52 +0200 | [diff] [blame] | 46 | #include <mach/mx3fb.h> |
Sascha Hauer | 3287abb | 2008-11-23 17:34:04 +0100 | [diff] [blame] | 47 | #include <mach/mxc_nand.h> |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 48 | #include <mach/mmc.h> |
Sascha Hauer | 7920675 | 2009-01-28 17:10:32 +0100 | [diff] [blame] | 49 | #ifdef CONFIG_I2C_IMX |
| 50 | #include <mach/i2c.h> |
| 51 | #endif |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 52 | |
Sascha Hauer | 5cf0942 | 2008-09-09 10:19:41 +0200 | [diff] [blame] | 53 | #include "devices.h" |
| 54 | |
Sascha Hauer | 01ac7d5 | 2009-03-13 19:52:41 +0100 | [diff] [blame] | 55 | static unsigned int pcm037_pins[] = { |
| 56 | /* I2C */ |
| 57 | MX31_PIN_CSPI2_MOSI__SCL, |
| 58 | MX31_PIN_CSPI2_MISO__SDA, |
| 59 | /* SDHC1 */ |
| 60 | MX31_PIN_SD1_DATA3__SD1_DATA3, |
| 61 | MX31_PIN_SD1_DATA2__SD1_DATA2, |
| 62 | MX31_PIN_SD1_DATA1__SD1_DATA1, |
| 63 | MX31_PIN_SD1_DATA0__SD1_DATA0, |
| 64 | MX31_PIN_SD1_CLK__SD1_CLK, |
| 65 | MX31_PIN_SD1_CMD__SD1_CMD, |
| 66 | IOMUX_MODE(MX31_PIN_SCK6, IOMUX_CONFIG_GPIO), /* card detect */ |
| 67 | IOMUX_MODE(MX31_PIN_SFS6, IOMUX_CONFIG_GPIO), /* write protect */ |
| 68 | /* SPI1 */ |
| 69 | MX31_PIN_CSPI1_MOSI__MOSI, |
| 70 | MX31_PIN_CSPI1_MISO__MISO, |
| 71 | MX31_PIN_CSPI1_SCLK__SCLK, |
| 72 | MX31_PIN_CSPI1_SPI_RDY__SPI_RDY, |
| 73 | MX31_PIN_CSPI1_SS0__SS0, |
| 74 | MX31_PIN_CSPI1_SS1__SS1, |
| 75 | MX31_PIN_CSPI1_SS2__SS2, |
| 76 | /* UART1 */ |
| 77 | MX31_PIN_CTS1__CTS1, |
| 78 | MX31_PIN_RTS1__RTS1, |
| 79 | MX31_PIN_TXD1__TXD1, |
| 80 | MX31_PIN_RXD1__RXD1, |
| 81 | /* UART2 */ |
| 82 | MX31_PIN_TXD2__TXD2, |
| 83 | MX31_PIN_RXD2__RXD2, |
| 84 | MX31_PIN_CTS2__CTS2, |
| 85 | MX31_PIN_RTS2__RTS2, |
| 86 | /* UART3 */ |
| 87 | MX31_PIN_CSPI3_MOSI__RXD3, |
| 88 | MX31_PIN_CSPI3_MISO__TXD3, |
| 89 | MX31_PIN_CSPI3_SCLK__RTS3, |
| 90 | MX31_PIN_CSPI3_SPI_RDY__CTS3, |
| 91 | /* LAN9217 irq pin */ |
| 92 | IOMUX_MODE(MX31_PIN_GPIO3_1, IOMUX_CONFIG_GPIO), |
| 93 | /* Onewire */ |
| 94 | MX31_PIN_BATT_LINE__OWIRE, |
| 95 | /* Framebuffer */ |
| 96 | MX31_PIN_LD0__LD0, |
| 97 | MX31_PIN_LD1__LD1, |
| 98 | MX31_PIN_LD2__LD2, |
| 99 | MX31_PIN_LD3__LD3, |
| 100 | MX31_PIN_LD4__LD4, |
| 101 | MX31_PIN_LD5__LD5, |
| 102 | MX31_PIN_LD6__LD6, |
| 103 | MX31_PIN_LD7__LD7, |
| 104 | MX31_PIN_LD8__LD8, |
| 105 | MX31_PIN_LD9__LD9, |
| 106 | MX31_PIN_LD10__LD10, |
| 107 | MX31_PIN_LD11__LD11, |
| 108 | MX31_PIN_LD12__LD12, |
| 109 | MX31_PIN_LD13__LD13, |
| 110 | MX31_PIN_LD14__LD14, |
| 111 | MX31_PIN_LD15__LD15, |
| 112 | MX31_PIN_LD16__LD16, |
| 113 | MX31_PIN_LD17__LD17, |
| 114 | MX31_PIN_VSYNC3__VSYNC3, |
| 115 | MX31_PIN_HSYNC__HSYNC, |
| 116 | MX31_PIN_FPSHIFT__FPSHIFT, |
| 117 | MX31_PIN_DRDY0__DRDY0, |
| 118 | MX31_PIN_D3_REV__D3_REV, |
| 119 | MX31_PIN_CONTRAST__CONTRAST, |
| 120 | MX31_PIN_D3_SPL__D3_SPL, |
| 121 | MX31_PIN_D3_CLS__D3_CLS, |
| 122 | MX31_PIN_LCS0__GPI03_23, |
| 123 | }; |
| 124 | |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 125 | static struct physmap_flash_data pcm037_flash_data = { |
| 126 | .width = 2, |
| 127 | }; |
| 128 | |
| 129 | static struct resource pcm037_flash_resource = { |
| 130 | .start = 0xa0000000, |
| 131 | .end = 0xa1ffffff, |
| 132 | .flags = IORESOURCE_MEM, |
| 133 | }; |
| 134 | |
Guennadi Liakhovetski | eb05bbe | 2009-05-04 13:13:52 +0200 | [diff] [blame^] | 135 | static int usbotg_pins[] = { |
| 136 | MX31_PIN_USBOTG_DATA0__USBOTG_DATA0, |
| 137 | MX31_PIN_USBOTG_DATA1__USBOTG_DATA1, |
| 138 | MX31_PIN_USBOTG_DATA2__USBOTG_DATA2, |
| 139 | MX31_PIN_USBOTG_DATA3__USBOTG_DATA3, |
| 140 | MX31_PIN_USBOTG_DATA4__USBOTG_DATA4, |
| 141 | MX31_PIN_USBOTG_DATA5__USBOTG_DATA5, |
| 142 | MX31_PIN_USBOTG_DATA6__USBOTG_DATA6, |
| 143 | MX31_PIN_USBOTG_DATA7__USBOTG_DATA7, |
| 144 | MX31_PIN_USBOTG_CLK__USBOTG_CLK, |
| 145 | MX31_PIN_USBOTG_DIR__USBOTG_DIR, |
| 146 | MX31_PIN_USBOTG_NXT__USBOTG_NXT, |
| 147 | MX31_PIN_USBOTG_STP__USBOTG_STP, |
| 148 | }; |
| 149 | |
| 150 | /* USB OTG HS port */ |
| 151 | static int __init gpio_usbotg_hs_activate(void) |
| 152 | { |
| 153 | int ret = mxc_iomux_setup_multiple_pins(usbotg_pins, |
| 154 | ARRAY_SIZE(usbotg_pins), "usbotg"); |
| 155 | |
| 156 | if (ret < 0) { |
| 157 | printk(KERN_ERR "Cannot set up OTG pins\n"); |
| 158 | return ret; |
| 159 | } |
| 160 | |
| 161 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA0, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 162 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA1, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 163 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA2, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 164 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA3, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 165 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA4, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 166 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA5, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 167 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA6, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 168 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DATA7, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 169 | mxc_iomux_set_pad(MX31_PIN_USBOTG_CLK, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 170 | mxc_iomux_set_pad(MX31_PIN_USBOTG_DIR, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 171 | mxc_iomux_set_pad(MX31_PIN_USBOTG_NXT, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 172 | mxc_iomux_set_pad(MX31_PIN_USBOTG_STP, PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST); |
| 173 | |
| 174 | return 0; |
| 175 | } |
| 176 | |
| 177 | /* OTG config */ |
| 178 | static struct fsl_usb2_platform_data usb_pdata = { |
| 179 | .operating_mode = FSL_USB2_DR_DEVICE, |
| 180 | .phy_mode = FSL_USB2_PHY_ULPI, |
| 181 | }; |
| 182 | |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 183 | static struct platform_device pcm037_flash = { |
| 184 | .name = "physmap-flash", |
| 185 | .id = 0, |
| 186 | .dev = { |
| 187 | .platform_data = &pcm037_flash_data, |
| 188 | }, |
| 189 | .resource = &pcm037_flash_resource, |
| 190 | .num_resources = 1, |
| 191 | }; |
| 192 | |
| 193 | static struct imxuart_platform_data uart_pdata = { |
Sascha Hauer | a9b0623 | 2008-09-02 10:19:29 +0200 | [diff] [blame] | 194 | .flags = IMXUART_HAVE_RTSCTS, |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 195 | }; |
| 196 | |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 197 | static struct resource smsc911x_resources[] = { |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 198 | [0] = { |
| 199 | .start = CS1_BASE_ADDR + 0x300, |
| 200 | .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, |
| 201 | .flags = IORESOURCE_MEM, |
| 202 | }, |
| 203 | [1] = { |
| 204 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), |
| 205 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 206 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 207 | }, |
| 208 | }; |
| 209 | |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 210 | static struct smsc911x_platform_config smsc911x_info = { |
| 211 | .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY | |
| 212 | SMSC911X_SAVE_MAC_ADDRESS, |
| 213 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
| 214 | .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, |
| 215 | .phy_interface = PHY_INTERFACE_MODE_MII, |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 216 | }; |
| 217 | |
| 218 | static struct platform_device pcm037_eth = { |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 219 | .name = "smsc911x", |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 220 | .id = -1, |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 221 | .num_resources = ARRAY_SIZE(smsc911x_resources), |
| 222 | .resource = smsc911x_resources, |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 223 | .dev = { |
Steve Glendinning | 4353318 | 2009-01-20 13:22:29 +0000 | [diff] [blame] | 224 | .platform_data = &smsc911x_info, |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 225 | }, |
| 226 | }; |
| 227 | |
Sascha Hauer | 3dad21a | 2008-11-23 17:32:49 +0100 | [diff] [blame] | 228 | static struct platdata_mtd_ram pcm038_sram_data = { |
| 229 | .bankwidth = 2, |
| 230 | }; |
| 231 | |
| 232 | static struct resource pcm038_sram_resource = { |
| 233 | .start = CS4_BASE_ADDR, |
| 234 | .end = CS4_BASE_ADDR + 512 * 1024 - 1, |
| 235 | .flags = IORESOURCE_MEM, |
| 236 | }; |
| 237 | |
| 238 | static struct platform_device pcm037_sram_device = { |
| 239 | .name = "mtd-ram", |
| 240 | .id = 0, |
| 241 | .dev = { |
| 242 | .platform_data = &pcm038_sram_data, |
| 243 | }, |
| 244 | .num_resources = 1, |
| 245 | .resource = &pcm038_sram_resource, |
| 246 | }; |
| 247 | |
Sascha Hauer | 3287abb | 2008-11-23 17:34:04 +0100 | [diff] [blame] | 248 | static struct mxc_nand_platform_data pcm037_nand_board_info = { |
| 249 | .width = 1, |
| 250 | .hw_ecc = 1, |
| 251 | }; |
| 252 | |
Sascha Hauer | 7920675 | 2009-01-28 17:10:32 +0100 | [diff] [blame] | 253 | #ifdef CONFIG_I2C_IMX |
Sascha Hauer | 7920675 | 2009-01-28 17:10:32 +0100 | [diff] [blame] | 254 | static struct imxi2c_platform_data pcm037_i2c_1_data = { |
| 255 | .bitrate = 100000, |
Sascha Hauer | 7920675 | 2009-01-28 17:10:32 +0100 | [diff] [blame] | 256 | }; |
| 257 | |
| 258 | static struct at24_platform_data board_eeprom = { |
| 259 | .byte_len = 4096, |
| 260 | .page_size = 32, |
| 261 | .flags = AT24_FLAG_ADDR16, |
| 262 | }; |
| 263 | |
| 264 | static struct i2c_board_info pcm037_i2c_devices[] = { |
| 265 | { |
| 266 | I2C_BOARD_INFO("at24", 0x52), /* E0=0, E1=1, E2=0 */ |
| 267 | .platform_data = &board_eeprom, |
| 268 | }, { |
| 269 | I2C_BOARD_INFO("rtc-pcf8563", 0x51), |
| 270 | .type = "pcf8563", |
| 271 | } |
| 272 | }; |
| 273 | #endif |
| 274 | |
Sascha Hauer | dddd4a4 | 2009-03-10 11:56:10 +0100 | [diff] [blame] | 275 | /* Not connected by default */ |
| 276 | #ifdef PCM970_SDHC_RW_SWITCH |
| 277 | static int pcm970_sdhc1_get_ro(struct device *dev) |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 278 | { |
Sascha Hauer | dddd4a4 | 2009-03-10 11:56:10 +0100 | [diff] [blame] | 279 | return gpio_get_value(IOMUX_TO_GPIO(MX31_PIN_SFS6)); |
| 280 | } |
| 281 | #endif |
| 282 | |
| 283 | static int pcm970_sdhc1_init(struct device *dev, irq_handler_t detect_irq, |
| 284 | void *data) |
| 285 | { |
| 286 | int ret; |
| 287 | int gpio_det, gpio_wp; |
| 288 | |
| 289 | gpio_det = IOMUX_TO_GPIO(MX31_PIN_SCK6); |
| 290 | gpio_wp = IOMUX_TO_GPIO(MX31_PIN_SFS6); |
| 291 | |
| 292 | gpio_direction_input(gpio_det); |
| 293 | gpio_direction_input(gpio_wp); |
| 294 | |
| 295 | ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq, |
| 296 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, |
| 297 | "sdhc-detect", data); |
| 298 | return ret; |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 299 | } |
| 300 | |
| 301 | static void pcm970_sdhc1_exit(struct device *dev, void *data) |
| 302 | { |
Sascha Hauer | dddd4a4 | 2009-03-10 11:56:10 +0100 | [diff] [blame] | 303 | free_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), data); |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 304 | } |
| 305 | |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 306 | static struct imxmmc_platform_data sdhc_pdata = { |
Sascha Hauer | dddd4a4 | 2009-03-10 11:56:10 +0100 | [diff] [blame] | 307 | #ifdef PCM970_SDHC_RW_SWITCH |
| 308 | .get_ro = pcm970_sdhc1_get_ro, |
| 309 | #endif |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 310 | .init = pcm970_sdhc1_init, |
| 311 | .exit = pcm970_sdhc1_exit, |
| 312 | }; |
| 313 | |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 314 | static struct platform_device *devices[] __initdata = { |
| 315 | &pcm037_flash, |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 316 | &pcm037_eth, |
Sascha Hauer | 3dad21a | 2008-11-23 17:32:49 +0100 | [diff] [blame] | 317 | &pcm037_sram_device, |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 318 | }; |
| 319 | |
Guennadi Liakhovetski | a8df0ee | 2009-04-15 14:32:52 +0200 | [diff] [blame] | 320 | static struct ipu_platform_data mx3_ipu_data = { |
| 321 | .irq_base = MXC_IPU_IRQ_START, |
| 322 | }; |
| 323 | |
| 324 | static const struct fb_videomode fb_modedb[] = { |
| 325 | { |
| 326 | /* 240x320 @ 60 Hz Sharp */ |
| 327 | .name = "Sharp-LQ035Q7DH06-QVGA", |
| 328 | .refresh = 60, |
| 329 | .xres = 240, |
| 330 | .yres = 320, |
| 331 | .pixclock = 185925, |
| 332 | .left_margin = 9, |
| 333 | .right_margin = 16, |
| 334 | .upper_margin = 7, |
| 335 | .lower_margin = 9, |
| 336 | .hsync_len = 1, |
| 337 | .vsync_len = 1, |
| 338 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_SHARP_MODE | |
| 339 | FB_SYNC_CLK_INVERT | FB_SYNC_CLK_IDLE_EN, |
| 340 | .vmode = FB_VMODE_NONINTERLACED, |
| 341 | .flag = 0, |
| 342 | }, { |
| 343 | /* 240x320 @ 60 Hz */ |
| 344 | .name = "TX090", |
| 345 | .refresh = 60, |
| 346 | .xres = 240, |
| 347 | .yres = 320, |
| 348 | .pixclock = 38255, |
| 349 | .left_margin = 144, |
| 350 | .right_margin = 0, |
| 351 | .upper_margin = 7, |
| 352 | .lower_margin = 40, |
| 353 | .hsync_len = 96, |
| 354 | .vsync_len = 1, |
| 355 | .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_OE_ACT_HIGH, |
| 356 | .vmode = FB_VMODE_NONINTERLACED, |
| 357 | .flag = 0, |
| 358 | }, |
| 359 | }; |
| 360 | |
| 361 | static struct mx3fb_platform_data mx3fb_pdata = { |
| 362 | .dma_dev = &mx3_ipu.dev, |
| 363 | .name = "Sharp-LQ035Q7DH06-QVGA", |
| 364 | .mode = fb_modedb, |
| 365 | .num_modes = ARRAY_SIZE(fb_modedb), |
| 366 | }; |
| 367 | |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 368 | /* |
| 369 | * Board specific initialization. |
| 370 | */ |
| 371 | static void __init mxc_board_init(void) |
| 372 | { |
Sascha Hauer | 01ac7d5 | 2009-03-13 19:52:41 +0100 | [diff] [blame] | 373 | mxc_iomux_setup_multiple_pins(pcm037_pins, ARRAY_SIZE(pcm037_pins), |
| 374 | "pcm037"); |
| 375 | |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 376 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 377 | |
Sascha Hauer | 5cf0942 | 2008-09-09 10:19:41 +0200 | [diff] [blame] | 378 | mxc_register_device(&mxc_uart_device0, &uart_pdata); |
Sascha Hauer | 13e9f61 | 2009-03-30 15:04:38 +0200 | [diff] [blame] | 379 | mxc_register_device(&mxc_uart_device1, &uart_pdata); |
Sascha Hauer | 5cf0942 | 2008-09-09 10:19:41 +0200 | [diff] [blame] | 380 | mxc_register_device(&mxc_uart_device2, &uart_pdata); |
Sascha Hauer | d517cab | 2008-12-01 14:15:40 -0800 | [diff] [blame] | 381 | |
Sascha Hauer | d517cab | 2008-12-01 14:15:40 -0800 | [diff] [blame] | 382 | mxc_register_device(&mxc_w1_master_device, NULL); |
Guennadi Liakhovetski | ba54b95 | 2008-11-11 15:12:00 +0100 | [diff] [blame] | 383 | |
Sascha Hauer | f8e5143 | 2009-04-04 13:40:39 +0200 | [diff] [blame] | 384 | /* LAN9217 IRQ pin */ |
Sascha Hauer | 01ac7d5 | 2009-03-13 19:52:41 +0100 | [diff] [blame] | 385 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); |
Sascha Hauer | 3287abb | 2008-11-23 17:34:04 +0100 | [diff] [blame] | 386 | |
Sascha Hauer | 7920675 | 2009-01-28 17:10:32 +0100 | [diff] [blame] | 387 | #ifdef CONFIG_I2C_IMX |
| 388 | i2c_register_board_info(1, pcm037_i2c_devices, |
| 389 | ARRAY_SIZE(pcm037_i2c_devices)); |
| 390 | |
| 391 | mxc_register_device(&mxc_i2c_device1, &pcm037_i2c_1_data); |
| 392 | #endif |
Sascha Hauer | 3287abb | 2008-11-23 17:34:04 +0100 | [diff] [blame] | 393 | mxc_register_device(&mxc_nand_device, &pcm037_nand_board_info); |
Sascha Hauer | f2cb641 | 2008-11-11 15:03:28 +0100 | [diff] [blame] | 394 | mxc_register_device(&mxcsdhc_device0, &sdhc_pdata); |
Guennadi Liakhovetski | a8df0ee | 2009-04-15 14:32:52 +0200 | [diff] [blame] | 395 | mxc_register_device(&mx3_ipu, &mx3_ipu_data); |
| 396 | mxc_register_device(&mx3_fb, &mx3fb_pdata); |
Guennadi Liakhovetski | eb05bbe | 2009-05-04 13:13:52 +0200 | [diff] [blame^] | 397 | if (!gpio_usbotg_hs_activate()) |
| 398 | mxc_register_device(&mxc_otg_udc_device, &usb_pdata); |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 399 | } |
| 400 | |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 401 | static void __init pcm037_timer_init(void) |
| 402 | { |
Sascha Hauer | 30c730f | 2009-02-16 14:36:49 +0100 | [diff] [blame] | 403 | mx31_clocks_init(26000000); |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | struct sys_timer pcm037_timer = { |
| 407 | .init = pcm037_timer_init, |
| 408 | }; |
| 409 | |
| 410 | MACHINE_START(PCM037, "Phytec Phycore pcm037") |
| 411 | /* Maintainer: Pengutronix */ |
| 412 | .phys_io = AIPS1_BASE_ADDR, |
| 413 | .io_pg_offst = ((AIPS1_BASE_ADDR_VIRT) >> 18) & 0xfffc, |
| 414 | .boot_params = PHYS_OFFSET + 0x100, |
Sascha Hauer | cd4a05f | 2009-04-02 22:32:10 +0200 | [diff] [blame] | 415 | .map_io = mx31_map_io, |
Sascha Hauer | ce8ffef | 2008-07-05 10:02:52 +0200 | [diff] [blame] | 416 | .init_irq = mxc_init_irq, |
| 417 | .init_machine = mxc_board_init, |
| 418 | .timer = &pcm037_timer, |
| 419 | MACHINE_END |
| 420 | |