Thomas Gleixner | 1d0ea06 | 2019-05-29 16:57:46 -0700 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 2 | /* |
| 3 | * linux/arch/arm/mach-pxa/littleton.c |
| 4 | * |
| 5 | * Support for the Marvell Littleton Development Platform. |
| 6 | * |
| 7 | * Author: Jason Chagas (largely modified code) |
| 8 | * Created: Nov 20, 2006 |
| 9 | * Copyright: (C) Copyright 2006 Marvell International Ltd. |
| 10 | * |
| 11 | * 2007-11-22 modified to align with latest kernel |
| 12 | * eric miao <eric.miao@marvell.com> |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | #include <linux/init.h> |
| 16 | #include <linux/interrupt.h> |
| 17 | #include <linux/delay.h> |
| 18 | #include <linux/platform_device.h> |
| 19 | #include <linux/clk.h> |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 20 | #include <linux/gpio/machine.h> |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 21 | #include <linux/spi/spi.h> |
Sebastian Andrzej Siewior | 8348c25 | 2010-11-22 17:12:15 -0800 | [diff] [blame] | 22 | #include <linux/spi/pxa2xx_spi.h> |
Eric Miao | e1719da | 2008-06-24 16:49:41 +0800 | [diff] [blame] | 23 | #include <linux/smc91x.h> |
Eric Miao | 3b24f30 | 2008-12-10 17:04:38 +0800 | [diff] [blame] | 24 | #include <linux/i2c.h> |
| 25 | #include <linux/leds.h> |
| 26 | #include <linux/mfd/da903x.h> |
Wolfram Sang | 0a848d6 | 2017-05-21 23:57:25 +0200 | [diff] [blame] | 27 | #include <linux/platform_data/max732x.h> |
Wolfram Sang | f15fc9b | 2017-11-13 18:27:39 +0100 | [diff] [blame] | 28 | #include <linux/platform_data/i2c-pxa.h> |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 29 | |
| 30 | #include <asm/types.h> |
| 31 | #include <asm/setup.h> |
| 32 | #include <asm/memory.h> |
| 33 | #include <asm/mach-types.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 34 | #include <mach/hardware.h> |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 35 | #include <asm/irq.h> |
| 36 | |
| 37 | #include <asm/mach/arch.h> |
| 38 | #include <asm/mach/map.h> |
| 39 | #include <asm/mach/irq.h> |
| 40 | |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 41 | #include "pxa300.h" |
Wolfram Sang | cb74dc3 | 2017-11-13 18:27:38 +0100 | [diff] [blame] | 42 | #include "devices.h" |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 43 | #include <linux/platform_data/video-pxafb.h> |
| 44 | #include <linux/platform_data/mmc-pxamci.h> |
| 45 | #include <linux/platform_data/keypad-pxa27x.h> |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 46 | #include "littleton.h" |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 47 | #include <linux/platform_data/mtd-nand-pxa3xx.h> |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 48 | |
| 49 | #include "generic.h" |
| 50 | |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 51 | /* Littleton MFP configurations */ |
| 52 | static mfp_cfg_t littleton_mfp_cfg[] __initdata = { |
| 53 | /* LCD */ |
| 54 | GPIO54_LCD_LDD_0, |
| 55 | GPIO55_LCD_LDD_1, |
| 56 | GPIO56_LCD_LDD_2, |
| 57 | GPIO57_LCD_LDD_3, |
| 58 | GPIO58_LCD_LDD_4, |
| 59 | GPIO59_LCD_LDD_5, |
| 60 | GPIO60_LCD_LDD_6, |
| 61 | GPIO61_LCD_LDD_7, |
| 62 | GPIO62_LCD_LDD_8, |
| 63 | GPIO63_LCD_LDD_9, |
| 64 | GPIO64_LCD_LDD_10, |
| 65 | GPIO65_LCD_LDD_11, |
| 66 | GPIO66_LCD_LDD_12, |
| 67 | GPIO67_LCD_LDD_13, |
| 68 | GPIO68_LCD_LDD_14, |
| 69 | GPIO69_LCD_LDD_15, |
| 70 | GPIO70_LCD_LDD_16, |
| 71 | GPIO71_LCD_LDD_17, |
| 72 | GPIO72_LCD_FCLK, |
| 73 | GPIO73_LCD_LCLK, |
| 74 | GPIO74_LCD_PCLK, |
| 75 | GPIO75_LCD_BIAS, |
| 76 | |
| 77 | /* SSP2 */ |
| 78 | GPIO25_SSP2_SCLK, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 79 | GPIO27_SSP2_TXD, |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 80 | GPIO17_GPIO, /* SFRM as chip-select */ |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 81 | |
| 82 | /* Debug Ethernet */ |
| 83 | GPIO90_GPIO, |
eric miao | 5fa4151 | 2008-01-23 15:07:22 +0800 | [diff] [blame] | 84 | |
| 85 | /* Keypad */ |
| 86 | GPIO107_KP_DKIN_0, |
| 87 | GPIO108_KP_DKIN_1, |
| 88 | GPIO115_KP_MKIN_0, |
| 89 | GPIO116_KP_MKIN_1, |
| 90 | GPIO117_KP_MKIN_2, |
| 91 | GPIO118_KP_MKIN_3, |
| 92 | GPIO119_KP_MKIN_4, |
| 93 | GPIO120_KP_MKIN_5, |
| 94 | GPIO121_KP_MKOUT_0, |
| 95 | GPIO122_KP_MKOUT_1, |
| 96 | GPIO123_KP_MKOUT_2, |
| 97 | GPIO124_KP_MKOUT_3, |
| 98 | GPIO125_KP_MKOUT_4, |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 99 | |
| 100 | /* MMC1 */ |
| 101 | GPIO3_MMC1_DAT0, |
| 102 | GPIO4_MMC1_DAT1, |
| 103 | GPIO5_MMC1_DAT2, |
| 104 | GPIO6_MMC1_DAT3, |
| 105 | GPIO7_MMC1_CLK, |
| 106 | GPIO8_MMC1_CMD, |
| 107 | GPIO15_GPIO, /* card detect */ |
Marek Vasut | 6d26ce6 | 2009-12-27 16:04:35 +0100 | [diff] [blame] | 108 | |
| 109 | /* UART3 */ |
| 110 | GPIO107_UART3_CTS, |
| 111 | GPIO108_UART3_RTS, |
| 112 | GPIO109_UART3_TXD, |
| 113 | GPIO110_UART3_RXD, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 114 | }; |
| 115 | |
| 116 | static struct resource smc91x_resources[] = { |
| 117 | [0] = { |
| 118 | .start = (LITTLETON_ETH_PHYS + 0x300), |
| 119 | .end = (LITTLETON_ETH_PHYS + 0xfffff), |
| 120 | .flags = IORESOURCE_MEM, |
| 121 | }, |
| 122 | [1] = { |
Haojian Zhuang | 6384fda | 2011-10-10 14:21:08 +0800 | [diff] [blame] | 123 | .start = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)), |
| 124 | .end = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO90)), |
Eric Miao | 8a6e887 | 2008-06-02 13:30:24 +0800 | [diff] [blame] | 125 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 126 | } |
| 127 | }; |
| 128 | |
Eric Miao | e1719da | 2008-06-24 16:49:41 +0800 | [diff] [blame] | 129 | static struct smc91x_platdata littleton_smc91x_info = { |
| 130 | .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | |
| 131 | SMC91X_NOWAIT | SMC91X_USE_DMA, |
| 132 | }; |
| 133 | |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 134 | static struct platform_device smc91x_device = { |
| 135 | .name = "smc91x", |
| 136 | .id = 0, |
| 137 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 138 | .resource = smc91x_resources, |
Eric Miao | e1719da | 2008-06-24 16:49:41 +0800 | [diff] [blame] | 139 | .dev = { |
| 140 | .platform_data = &littleton_smc91x_info, |
| 141 | }, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 142 | }; |
| 143 | |
Eric Miao | 36caeb4 | 2008-06-02 13:32:42 +0800 | [diff] [blame] | 144 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 145 | static struct pxafb_mode_info tpo_tdo24mtea1_modes[] = { |
| 146 | [0] = { |
| 147 | /* VGA */ |
| 148 | .pixclock = 38250, |
| 149 | .xres = 480, |
| 150 | .yres = 640, |
| 151 | .bpp = 16, |
| 152 | .hsync_len = 8, |
| 153 | .left_margin = 8, |
| 154 | .right_margin = 24, |
| 155 | .vsync_len = 2, |
| 156 | .upper_margin = 2, |
| 157 | .lower_margin = 4, |
| 158 | .sync = 0, |
| 159 | }, |
| 160 | [1] = { |
| 161 | /* QVGA */ |
| 162 | .pixclock = 153000, |
| 163 | .xres = 240, |
| 164 | .yres = 320, |
| 165 | .bpp = 16, |
| 166 | .hsync_len = 8, |
| 167 | .left_margin = 8, |
| 168 | .right_margin = 88, |
| 169 | .vsync_len = 2, |
| 170 | .upper_margin = 2, |
| 171 | .lower_margin = 2, |
| 172 | .sync = 0, |
| 173 | }, |
| 174 | }; |
| 175 | |
| 176 | static struct pxafb_mach_info littleton_lcd_info = { |
| 177 | .modes = tpo_tdo24mtea1_modes, |
| 178 | .num_modes = 2, |
eric miao | 0454bd0 | 2008-04-30 00:52:23 -0700 | [diff] [blame] | 179 | .lcd_conn = LCD_COLOR_TFT_16BPP, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 180 | }; |
| 181 | |
Arnd Bergmann | 88af320 | 2018-12-10 22:58:39 +0100 | [diff] [blame] | 182 | static void __init littleton_init_lcd(void) |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 183 | { |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 184 | pxa_set_fb_info(NULL, &littleton_lcd_info); |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 185 | } |
| 186 | #else |
| 187 | static inline void littleton_init_lcd(void) {}; |
Eric Miao | 36caeb4 | 2008-06-02 13:32:42 +0800 | [diff] [blame] | 188 | #endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULE */ |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 189 | |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 190 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) |
Lubomir Rintel | 51eea52 | 2019-01-16 16:13:31 +0100 | [diff] [blame] | 191 | static struct pxa2xx_spi_controller littleton_spi_info = { |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 192 | .num_chipselect = 1, |
| 193 | }; |
| 194 | |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 195 | static struct pxa2xx_spi_chip littleton_tdo24m_chip = { |
| 196 | .rx_threshold = 1, |
| 197 | .tx_threshold = 1, |
Mike Rapoport | 46580c0 | 2009-04-14 08:33:49 +0300 | [diff] [blame] | 198 | .gpio_cs = LITTLETON_GPIO_LCD_CS, |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 199 | }; |
| 200 | |
| 201 | static struct spi_board_info littleton_spi_devices[] __initdata = { |
| 202 | { |
| 203 | .modalias = "tdo24m", |
| 204 | .max_speed_hz = 1000000, |
| 205 | .bus_num = 2, |
| 206 | .chip_select = 0, |
| 207 | .controller_data= &littleton_tdo24m_chip, |
| 208 | }, |
| 209 | }; |
| 210 | |
| 211 | static void __init littleton_init_spi(void) |
| 212 | { |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 213 | pxa2xx_set_spi_info(2, &littleton_spi_info); |
| 214 | spi_register_board_info(ARRAY_AND_SIZE(littleton_spi_devices)); |
| 215 | } |
| 216 | #else |
| 217 | static inline void littleton_init_spi(void) {} |
| 218 | #endif |
| 219 | |
Eric Miao | 36caeb4 | 2008-06-02 13:32:42 +0800 | [diff] [blame] | 220 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 221 | static const unsigned int littleton_matrix_key_map[] = { |
eric miao | 5fa4151 | 2008-01-23 15:07:22 +0800 | [diff] [blame] | 222 | /* KEY(row, col, key_code) */ |
| 223 | KEY(1, 3, KEY_0), KEY(0, 0, KEY_1), KEY(1, 0, KEY_2), KEY(2, 0, KEY_3), |
| 224 | KEY(0, 1, KEY_4), KEY(1, 1, KEY_5), KEY(2, 1, KEY_6), KEY(0, 2, KEY_7), |
| 225 | KEY(1, 2, KEY_8), KEY(2, 2, KEY_9), |
| 226 | |
| 227 | KEY(0, 3, KEY_KPASTERISK), /* * */ |
| 228 | KEY(2, 3, KEY_KPDOT), /* # */ |
| 229 | |
| 230 | KEY(5, 4, KEY_ENTER), |
| 231 | |
| 232 | KEY(5, 0, KEY_UP), |
| 233 | KEY(5, 1, KEY_DOWN), |
| 234 | KEY(5, 2, KEY_LEFT), |
| 235 | KEY(5, 3, KEY_RIGHT), |
| 236 | KEY(3, 2, KEY_HOME), |
| 237 | KEY(4, 1, KEY_END), |
| 238 | KEY(3, 3, KEY_BACK), |
| 239 | |
| 240 | KEY(4, 0, KEY_SEND), |
| 241 | KEY(4, 2, KEY_VOLUMEUP), |
| 242 | KEY(4, 3, KEY_VOLUMEDOWN), |
| 243 | |
| 244 | KEY(3, 0, KEY_F22), /* soft1 */ |
| 245 | KEY(3, 1, KEY_F23), /* soft2 */ |
| 246 | }; |
| 247 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 248 | static struct matrix_keymap_data littleton_matrix_keymap_data = { |
| 249 | .keymap = littleton_matrix_key_map, |
| 250 | .keymap_size = ARRAY_SIZE(littleton_matrix_key_map), |
| 251 | }; |
| 252 | |
eric miao | 5fa4151 | 2008-01-23 15:07:22 +0800 | [diff] [blame] | 253 | static struct pxa27x_keypad_platform_data littleton_keypad_info = { |
| 254 | .matrix_key_rows = 6, |
| 255 | .matrix_key_cols = 5, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 256 | .matrix_keymap_data = &littleton_matrix_keymap_data, |
eric miao | 5fa4151 | 2008-01-23 15:07:22 +0800 | [diff] [blame] | 257 | |
| 258 | .enable_rotary0 = 1, |
| 259 | .rotary0_up_key = KEY_UP, |
| 260 | .rotary0_down_key = KEY_DOWN, |
| 261 | |
| 262 | .debounce_interval = 30, |
| 263 | }; |
| 264 | static void __init littleton_init_keypad(void) |
| 265 | { |
| 266 | pxa_set_keypad_info(&littleton_keypad_info); |
| 267 | } |
| 268 | #else |
| 269 | static inline void littleton_init_keypad(void) {} |
| 270 | #endif |
| 271 | |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 272 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 273 | static struct pxamci_platform_data littleton_mci_platform_data = { |
Eric Miao | f97cab2 | 2010-04-14 07:00:42 +0800 | [diff] [blame] | 274 | .detect_delay_ms = 200, |
Eric Miao | 70f6d3e8 | 2009-07-13 22:57:56 +0800 | [diff] [blame] | 275 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 276 | }; |
| 277 | |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 278 | static struct gpiod_lookup_table littleton_mci_gpio_table = { |
| 279 | .dev_id = "pxa2xx-mci.0", |
| 280 | .table = { |
| 281 | /* Card detect on MFP (gpio-pxa) GPIO 15 */ |
| 282 | GPIO_LOOKUP("gpio-pxa", MFP_PIN_GPIO15, |
| 283 | "cd", GPIO_ACTIVE_LOW), |
| 284 | { }, |
| 285 | }, |
| 286 | }; |
| 287 | |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 288 | static void __init littleton_init_mmc(void) |
| 289 | { |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 290 | gpiod_add_lookup_table(&littleton_mci_gpio_table); |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 291 | pxa_set_mci_info(&littleton_mci_platform_data); |
| 292 | } |
| 293 | #else |
| 294 | static inline void littleton_init_mmc(void) {} |
| 295 | #endif |
| 296 | |
Miquel Raynal | 349dfe6 | 2018-02-19 23:35:52 +0100 | [diff] [blame] | 297 | #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) |
Eric Miao | 9c1db1a | 2008-06-02 15:42:14 +0800 | [diff] [blame] | 298 | static struct mtd_partition littleton_nand_partitions[] = { |
| 299 | [0] = { |
| 300 | .name = "Bootloader", |
| 301 | .offset = 0, |
| 302 | .size = 0x060000, |
| 303 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 304 | }, |
| 305 | [1] = { |
| 306 | .name = "Kernel", |
| 307 | .offset = 0x060000, |
| 308 | .size = 0x200000, |
| 309 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 310 | }, |
| 311 | [2] = { |
| 312 | .name = "Filesystem", |
| 313 | .offset = 0x0260000, |
| 314 | .size = 0x3000000, /* 48M - rootfs */ |
| 315 | }, |
| 316 | [3] = { |
| 317 | .name = "MassStorage", |
| 318 | .offset = 0x3260000, |
| 319 | .size = 0x3d40000, |
| 320 | }, |
| 321 | [4] = { |
| 322 | .name = "BBT", |
| 323 | .offset = 0x6FA0000, |
| 324 | .size = 0x80000, |
| 325 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 326 | }, |
| 327 | /* NOTE: we reserve some blocks at the end of the NAND flash for |
| 328 | * bad block management, and the max number of relocation blocks |
| 329 | * differs on different platforms. Please take care with it when |
| 330 | * defining the partition table. |
| 331 | */ |
| 332 | }; |
| 333 | |
| 334 | static struct pxa3xx_nand_platform_data littleton_nand_info = { |
Miquel Raynal | 7576594 | 2018-02-19 23:35:54 +0100 | [diff] [blame] | 335 | .parts = littleton_nand_partitions, |
| 336 | .nr_parts = ARRAY_SIZE(littleton_nand_partitions), |
Eric Miao | 9c1db1a | 2008-06-02 15:42:14 +0800 | [diff] [blame] | 337 | }; |
| 338 | |
| 339 | static void __init littleton_init_nand(void) |
| 340 | { |
| 341 | pxa3xx_set_nand_info(&littleton_nand_info); |
| 342 | } |
| 343 | #else |
| 344 | static inline void littleton_init_nand(void) {} |
Miquel Raynal | 349dfe6 | 2018-02-19 23:35:52 +0100 | [diff] [blame] | 345 | #endif /* IS_ENABLED(CONFIG_MTD_NAND_MARVELL) */ |
Eric Miao | 9c1db1a | 2008-06-02 15:42:14 +0800 | [diff] [blame] | 346 | |
Eric Miao | 3b24f30 | 2008-12-10 17:04:38 +0800 | [diff] [blame] | 347 | #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) |
| 348 | static struct led_info littleton_da9034_leds[] = { |
| 349 | [0] = { |
| 350 | .name = "littleton:keypad1", |
| 351 | .flags = DA9034_LED_RAMP, |
| 352 | }, |
| 353 | [1] = { |
| 354 | .name = "littleton:keypad2", |
| 355 | .flags = DA9034_LED_RAMP, |
| 356 | }, |
| 357 | [2] = { |
| 358 | .name = "littleton:vibra", |
| 359 | .flags = 0, |
| 360 | }, |
| 361 | }; |
| 362 | |
Eric Miao | fc76132 | 2009-04-13 11:06:49 +0800 | [diff] [blame] | 363 | static struct da9034_touch_pdata littleton_da9034_touch = { |
| 364 | .x_inverted = 1, |
| 365 | .interval_ms = 20, |
| 366 | }; |
| 367 | |
Eric Miao | 3b24f30 | 2008-12-10 17:04:38 +0800 | [diff] [blame] | 368 | static struct da903x_subdev_info littleton_da9034_subdevs[] = { |
| 369 | { |
| 370 | .name = "da903x-led", |
| 371 | .id = DA9034_ID_LED_1, |
| 372 | .platform_data = &littleton_da9034_leds[0], |
| 373 | }, { |
| 374 | .name = "da903x-led", |
| 375 | .id = DA9034_ID_LED_2, |
| 376 | .platform_data = &littleton_da9034_leds[1], |
| 377 | }, { |
| 378 | .name = "da903x-led", |
| 379 | .id = DA9034_ID_VIBRA, |
| 380 | .platform_data = &littleton_da9034_leds[2], |
| 381 | }, { |
| 382 | .name = "da903x-backlight", |
| 383 | .id = DA9034_ID_WLED, |
Eric Miao | fc76132 | 2009-04-13 11:06:49 +0800 | [diff] [blame] | 384 | }, { |
| 385 | .name = "da9034-touch", |
| 386 | .id = DA9034_ID_TOUCH, |
| 387 | .platform_data = &littleton_da9034_touch, |
Eric Miao | 3b24f30 | 2008-12-10 17:04:38 +0800 | [diff] [blame] | 388 | }, |
| 389 | }; |
| 390 | |
| 391 | static struct da903x_platform_data littleton_da9034_info = { |
| 392 | .num_subdevs = ARRAY_SIZE(littleton_da9034_subdevs), |
| 393 | .subdevs = littleton_da9034_subdevs, |
| 394 | }; |
| 395 | |
| 396 | static struct max732x_platform_data littleton_max7320_info = { |
| 397 | .gpio_base = EXT0_GPIO_BASE, |
| 398 | }; |
| 399 | |
| 400 | static struct i2c_board_info littleton_i2c_info[] = { |
| 401 | [0] = { |
| 402 | .type = "da9034", |
| 403 | .addr = 0x34, |
| 404 | .platform_data = &littleton_da9034_info, |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 405 | .irq = PXA_GPIO_TO_IRQ(mfp_to_gpio(MFP_PIN_GPIO18)), |
Eric Miao | 3b24f30 | 2008-12-10 17:04:38 +0800 | [diff] [blame] | 406 | }, |
| 407 | [1] = { |
| 408 | .type = "max7320", |
| 409 | .addr = 0x50, |
| 410 | .platform_data = &littleton_max7320_info, |
| 411 | }, |
| 412 | }; |
| 413 | |
| 414 | static void __init littleton_init_i2c(void) |
| 415 | { |
| 416 | pxa_set_i2c_info(NULL); |
| 417 | i2c_register_board_info(0, ARRAY_AND_SIZE(littleton_i2c_info)); |
| 418 | } |
| 419 | #else |
| 420 | static inline void littleton_init_i2c(void) {} |
| 421 | #endif /* CONFIG_I2C_PXA || CONFIG_I2C_PXA_MODULE */ |
| 422 | |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 423 | static void __init littleton_init(void) |
| 424 | { |
| 425 | /* initialize MFP configurations */ |
| 426 | pxa3xx_mfp_config(ARRAY_AND_SIZE(littleton_mfp_cfg)); |
| 427 | |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 428 | pxa_set_ffuart_info(NULL); |
| 429 | pxa_set_btuart_info(NULL); |
| 430 | pxa_set_stuart_info(NULL); |
| 431 | |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 432 | /* |
| 433 | * Note: we depend bootloader set the correct |
| 434 | * value to MSC register for SMC91x. |
| 435 | */ |
| 436 | platform_device_register(&smc91x_device); |
| 437 | |
Eric Miao | 24ff4cd | 2008-09-01 06:56:07 +0800 | [diff] [blame] | 438 | littleton_init_spi(); |
Eric Miao | 3b24f30 | 2008-12-10 17:04:38 +0800 | [diff] [blame] | 439 | littleton_init_i2c(); |
Eric Miao | 361778d | 2009-06-05 16:42:29 +0800 | [diff] [blame] | 440 | littleton_init_mmc(); |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 441 | littleton_init_lcd(); |
eric miao | 5fa4151 | 2008-01-23 15:07:22 +0800 | [diff] [blame] | 442 | littleton_init_keypad(); |
Eric Miao | 9c1db1a | 2008-06-02 15:42:14 +0800 | [diff] [blame] | 443 | littleton_init_nand(); |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 444 | } |
| 445 | |
| 446 | MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 447 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 448 | .map_io = pxa3xx_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 449 | .nr_irqs = LITTLETON_NR_IRQS, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 450 | .init_irq = pxa3xx_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 451 | .handle_irq = pxa3xx_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 452 | .init_time = pxa_timer_init, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 453 | .init_machine = littleton_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 454 | .restart = pxa_restart, |
eric miao | e1d9b95 | 2007-12-13 10:41:43 +0800 | [diff] [blame] | 455 | MACHINE_END |