eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-pxa/zylonite.c |
| 3 | * |
| 4 | * Support for the PXA3xx Development Platform (aka Zylonite) |
| 5 | * |
| 6 | * Copyright (C) 2006 Marvell International Ltd. |
| 7 | * |
eric miao | e9bba8e | 2007-10-30 08:01:38 +0100 | [diff] [blame] | 8 | * 2007-09-04: eric miao <eric.miao@marvell.com> |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 9 | * rewrite to align with latest kernel |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License version 2 as |
| 13 | * published by the Free Software Foundation. |
| 14 | */ |
| 15 | |
| 16 | #include <linux/module.h> |
| 17 | #include <linux/kernel.h> |
| 18 | #include <linux/interrupt.h> |
Ulf Hansson | 40d727a | 2017-01-13 14:14:02 +0100 | [diff] [blame] | 19 | #include <linux/leds.h> |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 20 | #include <linux/init.h> |
| 21 | #include <linux/platform_device.h> |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 22 | #include <linux/gpio/machine.h> |
Thierry Reding | 6f26f6f | 2015-10-05 10:49:57 +0200 | [diff] [blame] | 23 | #include <linux/pwm.h> |
eric miao | 5cca914 | 2008-04-13 21:46:34 +0100 | [diff] [blame] | 24 | #include <linux/pwm_backlight.h> |
Eric Miao | 88c36eb | 2008-06-24 16:47:37 +0800 | [diff] [blame] | 25 | #include <linux/smc91x.h> |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 26 | |
| 27 | #include <asm/mach-types.h> |
| 28 | #include <asm/mach/arch.h> |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 29 | #include "pxa3xx.h" |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 30 | #include <mach/audio.h> |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 31 | #include <linux/platform_data/video-pxafb.h> |
Arnd Bergmann | 4c25c5d | 2015-01-30 10:45:33 +0100 | [diff] [blame] | 32 | #include "zylonite.h" |
Arnd Bergmann | 293b2da | 2012-08-24 15:16:48 +0200 | [diff] [blame] | 33 | #include <linux/platform_data/mmc-pxamci.h> |
| 34 | #include <linux/platform_data/usb-ohci-pxa27x.h> |
| 35 | #include <linux/platform_data/keypad-pxa27x.h> |
| 36 | #include <linux/platform_data/mtd-nand-pxa3xx.h> |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 37 | |
eric miao | 5cca914 | 2008-04-13 21:46:34 +0100 | [diff] [blame] | 38 | #include "devices.h" |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 39 | #include "generic.h" |
| 40 | |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 41 | int gpio_eth_irq; |
Eric Miao | 5c9f50e | 2008-06-17 19:03:54 +0800 | [diff] [blame] | 42 | int gpio_debug_led1; |
| 43 | int gpio_debug_led2; |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 44 | |
Mark Brown | 768dec4 | 2008-04-15 15:50:49 +0100 | [diff] [blame] | 45 | int wm9713_irq; |
| 46 | |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 47 | int lcd_id; |
| 48 | int lcd_orientation; |
| 49 | |
| 50 | static struct resource smc91x_resources[] = { |
| 51 | [0] = { |
| 52 | .start = ZYLONITE_ETH_PHYS + 0x300, |
| 53 | .end = ZYLONITE_ETH_PHYS + 0xfffff, |
| 54 | .flags = IORESOURCE_MEM, |
| 55 | }, |
| 56 | [1] = { |
| 57 | .start = -1, /* for run-time assignment */ |
| 58 | .end = -1, |
Russell King | e7b3dc7 | 2008-01-14 22:30:10 +0000 | [diff] [blame] | 59 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 60 | } |
| 61 | }; |
| 62 | |
Eric Miao | 88c36eb | 2008-06-24 16:47:37 +0800 | [diff] [blame] | 63 | static struct smc91x_platdata zylonite_smc91x_info = { |
| 64 | .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | |
| 65 | SMC91X_NOWAIT | SMC91X_USE_DMA, |
| 66 | }; |
| 67 | |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 68 | static struct platform_device smc91x_device = { |
| 69 | .name = "smc91x", |
| 70 | .id = 0, |
| 71 | .num_resources = ARRAY_SIZE(smc91x_resources), |
| 72 | .resource = smc91x_resources, |
Eric Miao | 88c36eb | 2008-06-24 16:47:37 +0800 | [diff] [blame] | 73 | .dev = { |
| 74 | .platform_data = &zylonite_smc91x_info, |
| 75 | }, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 76 | }; |
| 77 | |
Eric Miao | 5c9f50e | 2008-06-17 19:03:54 +0800 | [diff] [blame] | 78 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
| 79 | static struct gpio_led zylonite_debug_leds[] = { |
| 80 | [0] = { |
| 81 | .name = "zylonite:yellow:1", |
| 82 | .default_trigger = "heartbeat", |
| 83 | }, |
| 84 | [1] = { |
| 85 | .name = "zylonite:yellow:2", |
| 86 | .default_trigger = "default-on", |
| 87 | }, |
| 88 | }; |
| 89 | |
| 90 | static struct gpio_led_platform_data zylonite_debug_leds_info = { |
| 91 | .leds = zylonite_debug_leds, |
| 92 | .num_leds = ARRAY_SIZE(zylonite_debug_leds), |
| 93 | }; |
| 94 | |
| 95 | static struct platform_device zylonite_device_leds = { |
| 96 | .name = "leds-gpio", |
| 97 | .id = -1, |
| 98 | .dev = { |
| 99 | .platform_data = &zylonite_debug_leds_info, |
| 100 | } |
| 101 | }; |
| 102 | |
| 103 | static void __init zylonite_init_leds(void) |
| 104 | { |
| 105 | zylonite_debug_leds[0].gpio = gpio_debug_led1; |
| 106 | zylonite_debug_leds[1].gpio = gpio_debug_led2; |
| 107 | |
| 108 | platform_device_register(&zylonite_device_leds); |
| 109 | } |
| 110 | #else |
| 111 | static inline void zylonite_init_leds(void) {} |
| 112 | #endif |
| 113 | |
eric miao | 7a987e8 | 2008-02-27 02:00:26 +0100 | [diff] [blame] | 114 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
Thierry Reding | 6f26f6f | 2015-10-05 10:49:57 +0200 | [diff] [blame] | 115 | static struct pwm_lookup zylonite_pwm_lookup[] = { |
| 116 | PWM_LOOKUP("pxa27x-pwm.1", 1, "pwm-backlight.0", NULL, 10000, |
| 117 | PWM_POLARITY_NORMAL), |
| 118 | }; |
| 119 | |
eric miao | 5cca914 | 2008-04-13 21:46:34 +0100 | [diff] [blame] | 120 | static struct platform_pwm_backlight_data zylonite_backlight_data = { |
eric miao | 5cca914 | 2008-04-13 21:46:34 +0100 | [diff] [blame] | 121 | .max_brightness = 100, |
| 122 | .dft_brightness = 100, |
Thierry Reding | db01120 | 2013-08-30 12:15:24 +0200 | [diff] [blame] | 123 | .enable_gpio = -1, |
eric miao | 5cca914 | 2008-04-13 21:46:34 +0100 | [diff] [blame] | 124 | }; |
| 125 | |
| 126 | static struct platform_device zylonite_backlight_device = { |
| 127 | .name = "pwm-backlight", |
| 128 | .dev = { |
| 129 | .parent = &pxa27x_device_pwm1.dev, |
| 130 | .platform_data = &zylonite_backlight_data, |
| 131 | }, |
| 132 | }; |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 133 | |
| 134 | static struct pxafb_mode_info toshiba_ltm035a776c_mode = { |
| 135 | .pixclock = 110000, |
| 136 | .xres = 240, |
| 137 | .yres = 320, |
| 138 | .bpp = 16, |
| 139 | .hsync_len = 4, |
| 140 | .left_margin = 6, |
| 141 | .right_margin = 4, |
| 142 | .vsync_len = 2, |
| 143 | .upper_margin = 2, |
| 144 | .lower_margin = 3, |
| 145 | .sync = FB_SYNC_VERT_HIGH_ACT, |
| 146 | }; |
| 147 | |
| 148 | static struct pxafb_mode_info toshiba_ltm04c380k_mode = { |
| 149 | .pixclock = 50000, |
| 150 | .xres = 640, |
| 151 | .yres = 480, |
| 152 | .bpp = 16, |
| 153 | .hsync_len = 1, |
| 154 | .left_margin = 0x9f, |
| 155 | .right_margin = 1, |
| 156 | .vsync_len = 44, |
| 157 | .upper_margin = 0, |
| 158 | .lower_margin = 0, |
| 159 | .sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT, |
| 160 | }; |
| 161 | |
| 162 | static struct pxafb_mach_info zylonite_toshiba_lcd_info = { |
| 163 | .num_modes = 1, |
eric miao | 0454bd0 | 2008-04-30 00:52:23 -0700 | [diff] [blame] | 164 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 165 | }; |
| 166 | |
| 167 | static struct pxafb_mode_info sharp_ls037_modes[] = { |
| 168 | [0] = { |
| 169 | .pixclock = 158000, |
| 170 | .xres = 240, |
| 171 | .yres = 320, |
| 172 | .bpp = 16, |
| 173 | .hsync_len = 4, |
| 174 | .left_margin = 39, |
| 175 | .right_margin = 39, |
| 176 | .vsync_len = 1, |
| 177 | .upper_margin = 2, |
| 178 | .lower_margin = 3, |
| 179 | .sync = 0, |
| 180 | }, |
| 181 | [1] = { |
| 182 | .pixclock = 39700, |
| 183 | .xres = 480, |
| 184 | .yres = 640, |
| 185 | .bpp = 16, |
| 186 | .hsync_len = 8, |
| 187 | .left_margin = 81, |
| 188 | .right_margin = 81, |
| 189 | .vsync_len = 1, |
| 190 | .upper_margin = 2, |
| 191 | .lower_margin = 7, |
| 192 | .sync = 0, |
| 193 | }, |
| 194 | }; |
| 195 | |
| 196 | static struct pxafb_mach_info zylonite_sharp_lcd_info = { |
| 197 | .modes = sharp_ls037_modes, |
| 198 | .num_modes = 2, |
eric miao | 0454bd0 | 2008-04-30 00:52:23 -0700 | [diff] [blame] | 199 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 200 | }; |
| 201 | |
| 202 | static void __init zylonite_init_lcd(void) |
| 203 | { |
Thierry Reding | 6f26f6f | 2015-10-05 10:49:57 +0200 | [diff] [blame] | 204 | pwm_add_table(zylonite_pwm_lookup, ARRAY_SIZE(zylonite_pwm_lookup)); |
eric miao | 5cca914 | 2008-04-13 21:46:34 +0100 | [diff] [blame] | 205 | platform_device_register(&zylonite_backlight_device); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 206 | |
| 207 | if (lcd_id & 0x20) { |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 208 | pxa_set_fb_info(NULL, &zylonite_sharp_lcd_info); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 209 | return; |
| 210 | } |
| 211 | |
| 212 | /* legacy LCD panels, it would be handy here if LCD panel type can |
| 213 | * be decided at run-time |
| 214 | */ |
| 215 | if (1) |
| 216 | zylonite_toshiba_lcd_info.modes = &toshiba_ltm035a776c_mode; |
| 217 | else |
| 218 | zylonite_toshiba_lcd_info.modes = &toshiba_ltm04c380k_mode; |
| 219 | |
Russell King - ARM Linux | 4321e1a | 2011-02-15 15:37:30 +0800 | [diff] [blame] | 220 | pxa_set_fb_info(NULL, &zylonite_toshiba_lcd_info); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 221 | } |
| 222 | #else |
| 223 | static inline void zylonite_init_lcd(void) {} |
| 224 | #endif |
| 225 | |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 226 | #if defined(CONFIG_MMC) |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 227 | static struct pxamci_platform_data zylonite_mci_platform_data = { |
Eric Miao | f97cab2 | 2010-04-14 07:00:42 +0800 | [diff] [blame] | 228 | .detect_delay_ms= 200, |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 229 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 230 | }; |
| 231 | |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 232 | #define PCA9539A_MCI_CD 0 |
| 233 | #define PCA9539A_MCI1_CD 1 |
| 234 | #define PCA9539A_MCI_WP 2 |
| 235 | #define PCA9539A_MCI1_WP 3 |
| 236 | #define PCA9539A_MCI3_CD 30 |
| 237 | #define PCA9539A_MCI3_WP 31 |
| 238 | |
| 239 | static struct gpiod_lookup_table zylonite_mci_gpio_table = { |
| 240 | .dev_id = "pxa2xx-mci.0", |
| 241 | .table = { |
| 242 | GPIO_LOOKUP("i2c-pca9539-a", PCA9539A_MCI_CD, |
| 243 | "cd", GPIO_ACTIVE_LOW), |
| 244 | GPIO_LOOKUP("i2c-pca9539-a", PCA9539A_MCI_WP, |
| 245 | "wp", GPIO_ACTIVE_LOW), |
| 246 | { }, |
| 247 | }, |
| 248 | }; |
| 249 | |
Bridge Wu | 8d33b05 | 2007-12-21 19:15:36 +0800 | [diff] [blame] | 250 | static struct pxamci_platform_data zylonite_mci2_platform_data = { |
Eric Miao | f97cab2 | 2010-04-14 07:00:42 +0800 | [diff] [blame] | 251 | .detect_delay_ms= 200, |
Bridge Wu | 8d33b05 | 2007-12-21 19:15:36 +0800 | [diff] [blame] | 252 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
Haojian Zhuang | f91e490 | 2009-12-22 07:29:40 -0500 | [diff] [blame] | 253 | }; |
| 254 | |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 255 | static struct gpiod_lookup_table zylonite_mci2_gpio_table = { |
| 256 | .dev_id = "pxa2xx-mci.1", |
| 257 | .table = { |
| 258 | GPIO_LOOKUP("i2c-pca9539-a", PCA9539A_MCI1_CD, |
| 259 | "cd", GPIO_ACTIVE_LOW), |
| 260 | GPIO_LOOKUP("i2c-pca9539-a", PCA9539A_MCI1_WP, |
| 261 | "wp", GPIO_ACTIVE_LOW), |
| 262 | { }, |
| 263 | }, |
| 264 | }; |
| 265 | |
Haojian Zhuang | f91e490 | 2009-12-22 07:29:40 -0500 | [diff] [blame] | 266 | static struct pxamci_platform_data zylonite_mci3_platform_data = { |
Eric Miao | f97cab2 | 2010-04-14 07:00:42 +0800 | [diff] [blame] | 267 | .detect_delay_ms= 200, |
Haojian Zhuang | f91e490 | 2009-12-22 07:29:40 -0500 | [diff] [blame] | 268 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
Bridge Wu | 8d33b05 | 2007-12-21 19:15:36 +0800 | [diff] [blame] | 269 | }; |
| 270 | |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 271 | static struct gpiod_lookup_table zylonite_mci3_gpio_table = { |
| 272 | .dev_id = "pxa2xx-mci.2", |
| 273 | .table = { |
| 274 | GPIO_LOOKUP("i2c-pca9539-a", PCA9539A_MCI3_CD, |
| 275 | "cd", GPIO_ACTIVE_LOW), |
| 276 | GPIO_LOOKUP("i2c-pca9539-a", PCA9539A_MCI3_WP, |
| 277 | "wp", GPIO_ACTIVE_LOW), |
| 278 | { }, |
| 279 | }, |
| 280 | }; |
| 281 | |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 282 | static void __init zylonite_init_mmc(void) |
| 283 | { |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 284 | gpiod_add_lookup_table(&zylonite_mci_gpio_table); |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 285 | pxa_set_mci_info(&zylonite_mci_platform_data); |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 286 | gpiod_add_lookup_table(&zylonite_mci2_gpio_table); |
Bridge Wu | 8d33b05 | 2007-12-21 19:15:36 +0800 | [diff] [blame] | 287 | pxa3xx_set_mci2_info(&zylonite_mci2_platform_data); |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 288 | if (cpu_is_pxa310()) { |
| 289 | gpiod_add_lookup_table(&zylonite_mci3_gpio_table); |
Haojian Zhuang | f91e490 | 2009-12-22 07:29:40 -0500 | [diff] [blame] | 290 | pxa3xx_set_mci3_info(&zylonite_mci3_platform_data); |
Linus Walleij | 32d1544 | 2018-12-02 09:43:22 +0100 | [diff] [blame] | 291 | } |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 292 | } |
| 293 | #else |
| 294 | static inline void zylonite_init_mmc(void) {} |
| 295 | #endif |
| 296 | |
Eric Miao | 36caeb4 | 2008-06-02 13:32:42 +0800 | [diff] [blame] | 297 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 298 | static const unsigned int zylonite_matrix_key_map[] = { |
eric miao | 468e086 | 2008-01-23 14:25:50 +0800 | [diff] [blame] | 299 | /* KEY(row, col, key_code) */ |
| 300 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_C), KEY(0, 5, KEY_D), |
| 301 | KEY(1, 0, KEY_E), KEY(1, 1, KEY_F), KEY(1, 2, KEY_G), KEY(1, 5, KEY_H), |
| 302 | KEY(2, 0, KEY_I), KEY(2, 1, KEY_J), KEY(2, 2, KEY_K), KEY(2, 5, KEY_L), |
| 303 | KEY(3, 0, KEY_M), KEY(3, 1, KEY_N), KEY(3, 2, KEY_O), KEY(3, 5, KEY_P), |
| 304 | KEY(5, 0, KEY_Q), KEY(5, 1, KEY_R), KEY(5, 2, KEY_S), KEY(5, 5, KEY_T), |
| 305 | KEY(6, 0, KEY_U), KEY(6, 1, KEY_V), KEY(6, 2, KEY_W), KEY(6, 5, KEY_X), |
| 306 | KEY(7, 1, KEY_Y), KEY(7, 2, KEY_Z), |
| 307 | |
| 308 | KEY(4, 4, KEY_0), KEY(1, 3, KEY_1), KEY(4, 1, KEY_2), KEY(1, 4, KEY_3), |
| 309 | KEY(2, 3, KEY_4), KEY(4, 2, KEY_5), KEY(2, 4, KEY_6), KEY(3, 3, KEY_7), |
| 310 | KEY(4, 3, KEY_8), KEY(3, 4, KEY_9), |
| 311 | |
| 312 | KEY(4, 5, KEY_SPACE), |
| 313 | KEY(5, 3, KEY_KPASTERISK), /* * */ |
| 314 | KEY(5, 4, KEY_KPDOT), /* #" */ |
| 315 | |
| 316 | KEY(0, 7, KEY_UP), |
| 317 | KEY(1, 7, KEY_DOWN), |
| 318 | KEY(2, 7, KEY_LEFT), |
| 319 | KEY(3, 7, KEY_RIGHT), |
| 320 | KEY(2, 6, KEY_HOME), |
| 321 | KEY(3, 6, KEY_END), |
| 322 | KEY(6, 4, KEY_DELETE), |
| 323 | KEY(6, 6, KEY_BACK), |
| 324 | KEY(6, 3, KEY_CAPSLOCK), /* KEY_LEFTSHIFT), */ |
| 325 | |
| 326 | KEY(4, 6, KEY_ENTER), /* scroll push */ |
| 327 | KEY(5, 7, KEY_ENTER), /* keypad action */ |
| 328 | |
| 329 | KEY(0, 4, KEY_EMAIL), |
| 330 | KEY(5, 6, KEY_SEND), |
| 331 | KEY(4, 0, KEY_CALENDAR), |
| 332 | KEY(7, 6, KEY_RECORD), |
| 333 | KEY(6, 7, KEY_VOLUMEUP), |
| 334 | KEY(7, 7, KEY_VOLUMEDOWN), |
| 335 | |
| 336 | KEY(0, 6, KEY_F22), /* soft1 */ |
| 337 | KEY(1, 6, KEY_F23), /* soft2 */ |
| 338 | KEY(0, 3, KEY_AUX), /* contact */ |
| 339 | }; |
| 340 | |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 341 | static struct matrix_keymap_data zylonite_matrix_keymap_data = { |
| 342 | .keymap = zylonite_matrix_key_map, |
| 343 | .keymap_size = ARRAY_SIZE(zylonite_matrix_key_map), |
| 344 | }; |
| 345 | |
eric miao | 468e086 | 2008-01-23 14:25:50 +0800 | [diff] [blame] | 346 | static struct pxa27x_keypad_platform_data zylonite_keypad_info = { |
| 347 | .matrix_key_rows = 8, |
| 348 | .matrix_key_cols = 8, |
Chao Xie | 0a085a9 | 2013-05-05 20:24:58 -0700 | [diff] [blame] | 349 | .matrix_keymap_data = &zylonite_matrix_keymap_data, |
eric miao | 468e086 | 2008-01-23 14:25:50 +0800 | [diff] [blame] | 350 | |
| 351 | .enable_rotary0 = 1, |
| 352 | .rotary0_up_key = KEY_UP, |
| 353 | .rotary0_down_key = KEY_DOWN, |
| 354 | |
| 355 | .debounce_interval = 30, |
| 356 | }; |
| 357 | |
| 358 | static void __init zylonite_init_keypad(void) |
| 359 | { |
| 360 | pxa_set_keypad_info(&zylonite_keypad_info); |
| 361 | } |
| 362 | #else |
| 363 | static inline void zylonite_init_keypad(void) {} |
| 364 | #endif |
| 365 | |
Miquel Raynal | 349dfe6 | 2018-02-19 23:35:52 +0100 | [diff] [blame] | 366 | #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) |
Eric Miao | 481b552 | 2008-06-02 15:37:20 +0800 | [diff] [blame] | 367 | static struct mtd_partition zylonite_nand_partitions[] = { |
| 368 | [0] = { |
| 369 | .name = "Bootloader", |
| 370 | .offset = 0, |
| 371 | .size = 0x060000, |
| 372 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 373 | }, |
| 374 | [1] = { |
| 375 | .name = "Kernel", |
| 376 | .offset = 0x060000, |
| 377 | .size = 0x200000, |
| 378 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 379 | }, |
| 380 | [2] = { |
| 381 | .name = "Filesystem", |
| 382 | .offset = 0x0260000, |
| 383 | .size = 0x3000000, /* 48M - rootfs */ |
| 384 | }, |
| 385 | [3] = { |
| 386 | .name = "MassStorage", |
| 387 | .offset = 0x3260000, |
| 388 | .size = 0x3d40000, |
| 389 | }, |
| 390 | [4] = { |
| 391 | .name = "BBT", |
| 392 | .offset = 0x6FA0000, |
| 393 | .size = 0x80000, |
| 394 | .mask_flags = MTD_WRITEABLE, /* force read-only */ |
| 395 | }, |
| 396 | /* NOTE: we reserve some blocks at the end of the NAND flash for |
| 397 | * bad block management, and the max number of relocation blocks |
| 398 | * differs on different platforms. Please take care with it when |
| 399 | * defining the partition table. |
| 400 | */ |
| 401 | }; |
| 402 | |
| 403 | static struct pxa3xx_nand_platform_data zylonite_nand_info = { |
Miquel Raynal | 7576594 | 2018-02-19 23:35:54 +0100 | [diff] [blame] | 404 | .parts = zylonite_nand_partitions, |
| 405 | .nr_parts = ARRAY_SIZE(zylonite_nand_partitions), |
Eric Miao | 481b552 | 2008-06-02 15:37:20 +0800 | [diff] [blame] | 406 | }; |
| 407 | |
| 408 | static void __init zylonite_init_nand(void) |
| 409 | { |
| 410 | pxa3xx_set_nand_info(&zylonite_nand_info); |
| 411 | } |
| 412 | #else |
| 413 | static inline void zylonite_init_nand(void) {} |
Miquel Raynal | 349dfe6 | 2018-02-19 23:35:52 +0100 | [diff] [blame] | 414 | #endif /* IS_ENABLED(CONFIG_MTD_NAND_MARVELL) */ |
Eric Miao | 481b552 | 2008-06-02 15:37:20 +0800 | [diff] [blame] | 415 | |
Eric Miao | 7ff4353 | 2008-09-27 18:05:49 +0800 | [diff] [blame] | 416 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
| 417 | static struct pxaohci_platform_data zylonite_ohci_info = { |
| 418 | .port_mode = PMM_PERPORT_MODE, |
| 419 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | |
| 420 | POWER_CONTROL_LOW | POWER_SENSE_LOW, |
| 421 | }; |
| 422 | |
| 423 | static void __init zylonite_init_ohci(void) |
| 424 | { |
| 425 | pxa_set_ohci_info(&zylonite_ohci_info); |
| 426 | } |
| 427 | #else |
| 428 | static inline void zylonite_init_ohci(void) {} |
| 429 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ |
| 430 | |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 431 | static void __init zylonite_init(void) |
| 432 | { |
Russell King | cc155c6 | 2009-11-09 13:34:08 +0800 | [diff] [blame] | 433 | pxa_set_ffuart_info(NULL); |
| 434 | pxa_set_btuart_info(NULL); |
| 435 | pxa_set_stuart_info(NULL); |
| 436 | |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 437 | /* board-processor specific initialization */ |
| 438 | zylonite_pxa300_init(); |
| 439 | zylonite_pxa320_init(); |
| 440 | |
| 441 | /* |
| 442 | * Note: We depend that the bootloader set |
| 443 | * the correct value to MSC register for SMC91x. |
| 444 | */ |
Haojian Zhuang | 4929f5a | 2011-10-10 16:03:51 +0800 | [diff] [blame] | 445 | smc91x_resources[1].start = PXA_GPIO_TO_IRQ(gpio_eth_irq); |
| 446 | smc91x_resources[1].end = PXA_GPIO_TO_IRQ(gpio_eth_irq); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 447 | platform_device_register(&smc91x_device); |
| 448 | |
Mark Brown | cabb352 | 2008-06-10 10:48:25 +0100 | [diff] [blame] | 449 | pxa_set_ac97_info(NULL); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 450 | zylonite_init_lcd(); |
Bridge Wu | fafc9d3 | 2007-12-21 19:00:13 +0800 | [diff] [blame] | 451 | zylonite_init_mmc(); |
eric miao | 468e086 | 2008-01-23 14:25:50 +0800 | [diff] [blame] | 452 | zylonite_init_keypad(); |
Eric Miao | 481b552 | 2008-06-02 15:37:20 +0800 | [diff] [blame] | 453 | zylonite_init_nand(); |
Eric Miao | 5c9f50e | 2008-06-17 19:03:54 +0800 | [diff] [blame] | 454 | zylonite_init_leds(); |
Eric Miao | 7ff4353 | 2008-09-27 18:05:49 +0800 | [diff] [blame] | 455 | zylonite_init_ohci(); |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") |
Nicolas Pitre | 7375aba | 2011-07-05 22:38:15 -0400 | [diff] [blame] | 459 | .atag_offset = 0x100, |
Marek Vasut | 851982c | 2010-10-11 02:20:19 +0200 | [diff] [blame] | 460 | .map_io = pxa3xx_map_io, |
Haojian Zhuang | 6ac6b81 | 2010-08-20 15:23:59 +0800 | [diff] [blame] | 461 | .nr_irqs = ZYLONITE_NR_IRQS, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 462 | .init_irq = pxa3xx_init_irq, |
Eric Miao | 8a97ae2 | 2011-05-18 21:30:04 +0800 | [diff] [blame] | 463 | .handle_irq = pxa3xx_handle_irq, |
Stephen Warren | 6bb27d7 | 2012-11-08 12:40:59 -0700 | [diff] [blame] | 464 | .init_time = pxa_timer_init, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 465 | .init_machine = zylonite_init, |
Russell King | 271a74f | 2011-11-04 14:15:53 +0000 | [diff] [blame] | 466 | .restart = pxa_restart, |
eric miao | 2c8086a | 2007-09-11 19:13:17 -0700 | [diff] [blame] | 467 | MACHINE_END |