Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Support for Sharp SL-Cxx00 Series of PDAs |
| 3 | * Models: SL-C3000 (Spitz), SL-C1000 (Akita) and SL-C3100 (Borzoi) |
| 4 | * |
| 5 | * Copyright (c) 2005 Richard Purdie |
| 6 | * |
| 7 | * Based on Sharp's 2.4 kernel patches/lubbock.c |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | * |
| 13 | */ |
| 14 | |
| 15 | #include <linux/kernel.h> |
Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 16 | #include <linux/platform_device.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 17 | #include <linux/delay.h> |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 18 | #include <linux/gpio.h> |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 19 | #include <linux/leds.h> |
Dmitry Baryshkov | e5d3bf3 | 2008-11-25 00:57:28 +0300 | [diff] [blame] | 20 | #include <linux/mtd/physmap.h> |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 21 | #include <linux/i2c.h> |
| 22 | #include <linux/i2c/pca953x.h> |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 23 | #include <linux/spi/spi.h> |
| 24 | #include <linux/spi/ads7846.h> |
| 25 | #include <linux/spi/corgi_lcd.h> |
Dmitry Baryshkov | 6af7a8e | 2008-10-16 19:17:05 +0400 | [diff] [blame] | 26 | #include <linux/mtd/sharpsl.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 27 | |
| 28 | #include <asm/setup.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 29 | #include <asm/mach-types.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 30 | #include <asm/mach/arch.h> |
Dmitry Eremin-Solenikov | f0ba401 | 2009-05-17 17:05:23 +0400 | [diff] [blame] | 31 | #include <asm/mach/sharpsl_param.h> |
| 32 | #include <asm/hardware/scoop.h> |
| 33 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 34 | |
Eric Miao | 51c6298 | 2009-01-02 23:17:22 +0800 | [diff] [blame] | 35 | #include <mach/pxa27x.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 36 | #include <mach/pxa27x-udc.h> |
Russell King | afd2fc0 | 2008-08-07 11:05:25 +0100 | [diff] [blame] | 37 | #include <mach/reset.h> |
Eric Miao | f0a8370 | 2009-04-13 15:03:11 +0800 | [diff] [blame] | 38 | #include <plat/i2c.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 39 | #include <mach/irda.h> |
| 40 | #include <mach/mmc.h> |
| 41 | #include <mach/ohci.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 42 | #include <mach/pxafb.h> |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 43 | #include <mach/pxa2xx_spi.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 44 | #include <mach/spitz.h> |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 45 | |
| 46 | #include "generic.h" |
Russell King | 46c41e6 | 2007-05-15 15:39:36 +0100 | [diff] [blame] | 47 | #include "devices.h" |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 48 | #include "sharpsl.h" |
| 49 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 50 | static unsigned long spitz_pin_config[] __initdata = { |
| 51 | /* Chip Selects */ |
| 52 | GPIO78_nCS_2, /* SCOOP #2 */ |
Eric Miao | faf2f0a | 2008-11-16 15:56:58 +0800 | [diff] [blame] | 53 | GPIO79_nCS_3, /* NAND */ |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 54 | GPIO80_nCS_4, /* SCOOP #1 */ |
| 55 | |
| 56 | /* LCD - 16bpp Active TFT */ |
| 57 | GPIO58_LCD_LDD_0, |
| 58 | GPIO59_LCD_LDD_1, |
| 59 | GPIO60_LCD_LDD_2, |
| 60 | GPIO61_LCD_LDD_3, |
| 61 | GPIO62_LCD_LDD_4, |
| 62 | GPIO63_LCD_LDD_5, |
| 63 | GPIO64_LCD_LDD_6, |
| 64 | GPIO65_LCD_LDD_7, |
| 65 | GPIO66_LCD_LDD_8, |
| 66 | GPIO67_LCD_LDD_9, |
| 67 | GPIO68_LCD_LDD_10, |
| 68 | GPIO69_LCD_LDD_11, |
| 69 | GPIO70_LCD_LDD_12, |
| 70 | GPIO71_LCD_LDD_13, |
| 71 | GPIO72_LCD_LDD_14, |
| 72 | GPIO73_LCD_LDD_15, |
| 73 | GPIO74_LCD_FCLK, |
| 74 | GPIO75_LCD_LCLK, |
| 75 | GPIO76_LCD_PCLK, |
| 76 | |
| 77 | /* PC Card */ |
| 78 | GPIO48_nPOE, |
| 79 | GPIO49_nPWE, |
| 80 | GPIO50_nPIOR, |
| 81 | GPIO51_nPIOW, |
| 82 | GPIO85_nPCE_1, |
| 83 | GPIO54_nPCE_2, |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 84 | GPIO55_nPREG, |
| 85 | GPIO56_nPWAIT, |
| 86 | GPIO57_nIOIS16, |
Eric Miao | faf2f0a | 2008-11-16 15:56:58 +0800 | [diff] [blame] | 87 | GPIO104_PSKTSEL, |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 88 | |
Philipp Zabel | 772885c | 2009-02-05 17:48:20 +0100 | [diff] [blame] | 89 | /* I2S */ |
| 90 | GPIO28_I2S_BITCLK_OUT, |
| 91 | GPIO29_I2S_SDATA_IN, |
| 92 | GPIO30_I2S_SDATA_OUT, |
| 93 | GPIO31_I2S_SYNC, |
| 94 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 95 | /* MMC */ |
| 96 | GPIO32_MMC_CLK, |
| 97 | GPIO112_MMC_CMD, |
| 98 | GPIO92_MMC_DAT_0, |
| 99 | GPIO109_MMC_DAT_1, |
| 100 | GPIO110_MMC_DAT_2, |
| 101 | GPIO111_MMC_DAT_3, |
| 102 | |
| 103 | /* GPIOs */ |
| 104 | GPIO9_GPIO, /* SPITZ_GPIO_nSD_DETECT */ |
| 105 | GPIO81_GPIO, /* SPITZ_GPIO_nSD_WP */ |
| 106 | GPIO41_GPIO, /* SPITZ_GPIO_USB_CONNECT */ |
| 107 | GPIO37_GPIO, /* SPITZ_GPIO_USB_HOST */ |
| 108 | GPIO35_GPIO, /* SPITZ_GPIO_USB_DEVICE */ |
| 109 | GPIO22_GPIO, /* SPITZ_GPIO_HSYNC */ |
| 110 | GPIO94_GPIO, /* SPITZ_GPIO_CF_CD */ |
| 111 | GPIO105_GPIO, /* SPITZ_GPIO_CF_IRQ */ |
| 112 | GPIO106_GPIO, /* SPITZ_GPIO_CF2_IRQ */ |
| 113 | |
Eric Miao | 6f584cf | 2008-11-28 16:00:24 +0800 | [diff] [blame] | 114 | /* I2C */ |
| 115 | GPIO117_I2C_SCL, |
| 116 | GPIO118_I2C_SDA, |
| 117 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 118 | GPIO1_GPIO | WAKEUP_ON_EDGE_RISE, |
| 119 | }; |
| 120 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 121 | /* |
| 122 | * Spitz SCOOP Device #1 |
| 123 | */ |
| 124 | static struct resource spitz_scoop_resources[] = { |
| 125 | [0] = { |
| 126 | .start = 0x10800000, |
| 127 | .end = 0x10800fff, |
| 128 | .flags = IORESOURCE_MEM, |
| 129 | }, |
| 130 | }; |
| 131 | |
| 132 | static struct scoop_config spitz_scoop_setup = { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 133 | .io_dir = SPITZ_SCP_IO_DIR, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 134 | .io_out = SPITZ_SCP_IO_OUT, |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 135 | .suspend_clr = SPITZ_SCP_SUS_CLR, |
| 136 | .suspend_set = SPITZ_SCP_SUS_SET, |
| 137 | .gpio_base = SPITZ_SCP_GPIO_BASE, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 138 | }; |
| 139 | |
| 140 | struct platform_device spitzscoop_device = { |
| 141 | .name = "sharp-scoop", |
| 142 | .id = 0, |
| 143 | .dev = { |
| 144 | .platform_data = &spitz_scoop_setup, |
| 145 | }, |
| 146 | .num_resources = ARRAY_SIZE(spitz_scoop_resources), |
| 147 | .resource = spitz_scoop_resources, |
| 148 | }; |
| 149 | |
| 150 | /* |
| 151 | * Spitz SCOOP Device #2 |
| 152 | */ |
| 153 | static struct resource spitz_scoop2_resources[] = { |
| 154 | [0] = { |
| 155 | .start = 0x08800040, |
| 156 | .end = 0x08800fff, |
| 157 | .flags = IORESOURCE_MEM, |
| 158 | }, |
| 159 | }; |
| 160 | |
| 161 | static struct scoop_config spitz_scoop2_setup = { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 162 | .io_dir = SPITZ_SCP2_IO_DIR, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 163 | .io_out = SPITZ_SCP2_IO_OUT, |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 164 | .suspend_clr = SPITZ_SCP2_SUS_CLR, |
| 165 | .suspend_set = SPITZ_SCP2_SUS_SET, |
| 166 | .gpio_base = SPITZ_SCP2_GPIO_BASE, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 167 | }; |
| 168 | |
| 169 | struct platform_device spitzscoop2_device = { |
| 170 | .name = "sharp-scoop", |
| 171 | .id = 1, |
| 172 | .dev = { |
| 173 | .platform_data = &spitz_scoop2_setup, |
| 174 | }, |
| 175 | .num_resources = ARRAY_SIZE(spitz_scoop2_resources), |
| 176 | .resource = spitz_scoop2_resources, |
| 177 | }; |
| 178 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 179 | #define SPITZ_PWR_SD 0x01 |
| 180 | #define SPITZ_PWR_CF 0x02 |
| 181 | |
| 182 | /* Power control is shared with between one of the CF slots and SD */ |
| 183 | static void spitz_card_pwr_ctrl(int device, unsigned short new_cpr) |
| 184 | { |
| 185 | unsigned short cpr = read_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR); |
| 186 | |
| 187 | if (new_cpr & 0x0007) { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 188 | gpio_set_value(SPITZ_GPIO_CF_POWER, 1); |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 189 | if (!(cpr & 0x0002) && !(cpr & 0x0004)) |
| 190 | mdelay(5); |
| 191 | if (device == SPITZ_PWR_CF) |
| 192 | cpr |= 0x0002; |
| 193 | if (device == SPITZ_PWR_SD) |
| 194 | cpr |= 0x0004; |
| 195 | write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); |
| 196 | } else { |
| 197 | if (device == SPITZ_PWR_CF) |
| 198 | cpr &= ~0x0002; |
| 199 | if (device == SPITZ_PWR_SD) |
| 200 | cpr &= ~0x0004; |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 201 | if (!(cpr & 0x0002) && !(cpr & 0x0004)) { |
Richard Purdie | 945b957 | 2006-01-05 20:44:57 +0000 | [diff] [blame] | 202 | write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, 0x0000); |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 203 | mdelay(1); |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 204 | gpio_set_value(SPITZ_GPIO_CF_POWER, 0); |
Richard Purdie | 945b957 | 2006-01-05 20:44:57 +0000 | [diff] [blame] | 205 | } else { |
| 206 | write_scoop_reg(&spitzscoop_device.dev, SCOOP_CPR, cpr | new_cpr); |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 207 | } |
| 208 | } |
| 209 | } |
| 210 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 211 | static void spitz_pcmcia_pwr(struct device *scoop, unsigned short cpr, int nr) |
| 212 | { |
| 213 | /* Only need to override behaviour for slot 0 */ |
| 214 | if (nr == 0) |
| 215 | spitz_card_pwr_ctrl(SPITZ_PWR_CF, cpr); |
| 216 | else |
| 217 | write_scoop_reg(scoop, SCOOP_CPR, cpr); |
| 218 | } |
| 219 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 220 | static struct scoop_pcmcia_dev spitz_pcmcia_scoop[] = { |
| 221 | { |
| 222 | .dev = &spitzscoop_device.dev, |
| 223 | .irq = SPITZ_IRQ_GPIO_CF_IRQ, |
| 224 | .cd_irq = SPITZ_IRQ_GPIO_CF_CD, |
| 225 | .cd_irq_str = "PCMCIA0 CD", |
| 226 | },{ |
| 227 | .dev = &spitzscoop2_device.dev, |
| 228 | .irq = SPITZ_IRQ_GPIO_CF2_IRQ, |
| 229 | .cd_irq = -1, |
| 230 | }, |
| 231 | }; |
| 232 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 233 | static struct scoop_pcmcia_config spitz_pcmcia_config = { |
| 234 | .devs = &spitz_pcmcia_scoop[0], |
| 235 | .num_devs = 2, |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 236 | .power_ctrl = spitz_pcmcia_pwr, |
| 237 | }; |
| 238 | |
| 239 | EXPORT_SYMBOL(spitzscoop_device); |
| 240 | EXPORT_SYMBOL(spitzscoop2_device); |
| 241 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 242 | /* |
| 243 | * Spitz Keyboard Device |
| 244 | */ |
| 245 | static struct platform_device spitzkbd_device = { |
| 246 | .name = "spitz-keyboard", |
| 247 | .id = -1, |
| 248 | }; |
| 249 | |
| 250 | |
| 251 | /* |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 252 | * Spitz LEDs |
| 253 | */ |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 254 | static struct gpio_led spitz_gpio_leds[] = { |
| 255 | { |
| 256 | .name = "spitz:amber:charge", |
| 257 | .default_trigger = "sharpsl-charge", |
| 258 | .gpio = SPITZ_GPIO_LED_ORANGE, |
| 259 | }, |
| 260 | { |
| 261 | .name = "spitz:green:hddactivity", |
| 262 | .default_trigger = "ide-disk", |
| 263 | .gpio = SPITZ_GPIO_LED_GREEN, |
| 264 | }, |
| 265 | }; |
| 266 | |
| 267 | static struct gpio_led_platform_data spitz_gpio_leds_info = { |
| 268 | .leds = spitz_gpio_leds, |
| 269 | .num_leds = ARRAY_SIZE(spitz_gpio_leds), |
| 270 | }; |
| 271 | |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 272 | static struct platform_device spitzled_device = { |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 273 | .name = "leds-gpio", |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 274 | .id = -1, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 275 | .dev = { |
Eric Miao | 4fe3224 | 2008-09-05 22:38:23 +0800 | [diff] [blame] | 276 | .platform_data = &spitz_gpio_leds_info, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 277 | }, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 278 | }; |
| 279 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 280 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) |
| 281 | static struct pxa2xx_spi_master spitz_spi_info = { |
| 282 | .num_chipselect = 3, |
| 283 | }; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 284 | |
Eric Miao | 3e36c0d | 2009-02-06 16:49:23 +0800 | [diff] [blame] | 285 | static void spitz_wait_for_hsync(void) |
| 286 | { |
| 287 | while (gpio_get_value(SPITZ_GPIO_HSYNC)) |
| 288 | cpu_relax(); |
| 289 | |
| 290 | while (!gpio_get_value(SPITZ_GPIO_HSYNC)) |
| 291 | cpu_relax(); |
| 292 | } |
| 293 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 294 | static struct ads7846_platform_data spitz_ads7846_info = { |
| 295 | .model = 7846, |
| 296 | .vref_delay_usecs = 100, |
| 297 | .x_plate_ohms = 419, |
| 298 | .y_plate_ohms = 486, |
| 299 | .gpio_pendown = SPITZ_GPIO_TP_INT, |
Eric Miao | 3e36c0d | 2009-02-06 16:49:23 +0800 | [diff] [blame] | 300 | .wait_for_sync = spitz_wait_for_hsync, |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 301 | }; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 302 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 303 | static struct pxa2xx_spi_chip spitz_ads7846_chip = { |
Mike Rapoport | 46580c0 | 2009-04-14 08:33:49 +0300 | [diff] [blame] | 304 | .gpio_cs = SPITZ_GPIO_ADS7846_CS, |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 305 | }; |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 306 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 307 | static void spitz_bl_kick_battery(void) |
| 308 | { |
| 309 | void (*kick_batt)(void); |
| 310 | |
| 311 | kick_batt = symbol_get(sharpsl_battery_kick); |
| 312 | if (kick_batt) { |
| 313 | kick_batt(); |
| 314 | symbol_put(sharpsl_battery_kick); |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | static struct corgi_lcd_platform_data spitz_lcdcon_info = { |
| 319 | .init_mode = CORGI_LCD_MODE_VGA, |
| 320 | .max_intensity = 0x2f, |
| 321 | .default_intensity = 0x1f, |
| 322 | .limit_mask = 0x0b, |
Eric Miao | ff7a4c7 | 2008-09-07 11:30:06 +0800 | [diff] [blame] | 323 | .gpio_backlight_cont = SPITZ_GPIO_BACKLIGHT_CONT, |
| 324 | .gpio_backlight_on = SPITZ_GPIO_BACKLIGHT_ON, |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 325 | .kick_battery = spitz_bl_kick_battery, |
| 326 | }; |
| 327 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 328 | static struct pxa2xx_spi_chip spitz_lcdcon_chip = { |
Mike Rapoport | 46580c0 | 2009-04-14 08:33:49 +0300 | [diff] [blame] | 329 | .gpio_cs = SPITZ_GPIO_LCDCON_CS, |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 330 | }; |
| 331 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 332 | static struct pxa2xx_spi_chip spitz_max1111_chip = { |
Mike Rapoport | 46580c0 | 2009-04-14 08:33:49 +0300 | [diff] [blame] | 333 | .gpio_cs = SPITZ_GPIO_MAX1111_CS, |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 334 | }; |
| 335 | |
| 336 | static struct spi_board_info spitz_spi_devices[] = { |
| 337 | { |
| 338 | .modalias = "ads7846", |
| 339 | .max_speed_hz = 1200000, |
| 340 | .bus_num = 2, |
| 341 | .chip_select = 0, |
| 342 | .platform_data = &spitz_ads7846_info, |
| 343 | .controller_data= &spitz_ads7846_chip, |
| 344 | .irq = gpio_to_irq(SPITZ_GPIO_TP_INT), |
| 345 | }, { |
| 346 | .modalias = "corgi-lcd", |
| 347 | .max_speed_hz = 50000, |
| 348 | .bus_num = 2, |
| 349 | .chip_select = 1, |
| 350 | .platform_data = &spitz_lcdcon_info, |
| 351 | .controller_data= &spitz_lcdcon_chip, |
| 352 | }, { |
| 353 | .modalias = "max1111", |
| 354 | .max_speed_hz = 450000, |
| 355 | .bus_num = 2, |
| 356 | .chip_select = 2, |
| 357 | .controller_data= &spitz_max1111_chip, |
| 358 | }, |
| 359 | }; |
| 360 | |
| 361 | static void __init spitz_init_spi(void) |
| 362 | { |
Eric Miao | ff7a4c7 | 2008-09-07 11:30:06 +0800 | [diff] [blame] | 363 | if (machine_is_akita()) { |
| 364 | spitz_lcdcon_info.gpio_backlight_cont = AKITA_GPIO_BACKLIGHT_CONT; |
| 365 | spitz_lcdcon_info.gpio_backlight_on = AKITA_GPIO_BACKLIGHT_ON; |
| 366 | } |
| 367 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 368 | pxa2xx_set_spi_info(2, &spitz_spi_info); |
| 369 | spi_register_board_info(ARRAY_AND_SIZE(spitz_spi_devices)); |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 370 | } |
| 371 | #else |
| 372 | static inline void spitz_init_spi(void) {} |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 373 | #endif |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 374 | |
| 375 | /* |
| 376 | * MMC/SD Device |
| 377 | * |
| 378 | * The card detect interrupt isn't debounced so we delay it by 250ms |
| 379 | * to give the card a chance to fully insert/eject. |
| 380 | */ |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 381 | static void spitz_mci_setpower(struct device *dev, unsigned int vdd) |
| 382 | { |
| 383 | struct pxamci_platform_data* p_d = dev->platform_data; |
| 384 | |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 385 | if (( 1 << vdd) & p_d->ocr_mask) |
| 386 | spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0004); |
| 387 | else |
| 388 | spitz_card_pwr_ctrl(SPITZ_PWR_SD, 0x0000); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 389 | } |
| 390 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 391 | static struct pxamci_platform_data spitz_mci_platform_data = { |
Robert Jarzmik | 7a64825 | 2009-07-06 22:16:42 +0200 | [diff] [blame] | 392 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, |
| 393 | .setpower = spitz_mci_setpower, |
| 394 | .gpio_card_detect = SPITZ_GPIO_nSD_DETECT, |
| 395 | .gpio_card_ro = SPITZ_GPIO_nSD_WP, |
| 396 | .gpio_power = -1, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 397 | }; |
| 398 | |
| 399 | |
| 400 | /* |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 401 | * USB Host (OHCI) |
| 402 | */ |
| 403 | static int spitz_ohci_init(struct device *dev) |
| 404 | { |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 405 | int err; |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 406 | |
Eric Miao | dd5980d | 2008-09-02 17:34:33 +0800 | [diff] [blame] | 407 | err = gpio_request(SPITZ_GPIO_USB_HOST, "USB_HOST"); |
| 408 | if (err) |
| 409 | return err; |
| 410 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 411 | /* Only Port 2 is connected |
| 412 | * Setup USB Port 2 Output Control Register |
| 413 | */ |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 414 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; |
| 415 | |
Eric Miao | 097b533 | 2008-09-27 15:49:57 +0800 | [diff] [blame] | 416 | return gpio_direction_output(SPITZ_GPIO_USB_HOST, 1); |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 417 | } |
| 418 | |
Dmitry Eremin-Solenikov | a81b386 | 2009-05-15 10:11:22 +0400 | [diff] [blame] | 419 | static void spitz_ohci_exit(struct device *dev) |
| 420 | { |
| 421 | gpio_free(SPITZ_GPIO_USB_HOST); |
| 422 | } |
| 423 | |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 424 | static struct pxaohci_platform_data spitz_ohci_platform_data = { |
| 425 | .port_mode = PMM_NPS_MODE, |
| 426 | .init = spitz_ohci_init, |
Dmitry Eremin-Solenikov | a81b386 | 2009-05-15 10:11:22 +0400 | [diff] [blame] | 427 | .exit = spitz_ohci_exit, |
Eric Miao | 097b533 | 2008-09-27 15:49:57 +0800 | [diff] [blame] | 428 | .flags = ENABLE_PORT_ALL | NO_OC_PROTECTION, |
Richard Purdie | 0c27c5d | 2006-06-08 22:44:07 +0100 | [diff] [blame] | 429 | .power_budget = 150, |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 430 | }; |
| 431 | |
| 432 | |
| 433 | /* |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 434 | * Irda |
| 435 | */ |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 436 | static int spitz_irda_startup(struct device *dev) |
| 437 | { |
| 438 | int rc; |
| 439 | |
| 440 | rc = gpio_request(SPITZ_GPIO_IR_ON, "IrDA on"); |
| 441 | if (rc) |
| 442 | goto err; |
| 443 | |
| 444 | rc = gpio_direction_output(SPITZ_GPIO_IR_ON, 1); |
| 445 | if (rc) |
| 446 | goto err_dir; |
| 447 | |
| 448 | return 0; |
| 449 | |
| 450 | err_dir: |
| 451 | gpio_free(SPITZ_GPIO_IR_ON); |
| 452 | err: |
| 453 | return rc; |
| 454 | } |
| 455 | |
| 456 | static void spitz_irda_shutdown(struct device *dev) |
| 457 | { |
| 458 | gpio_free(SPITZ_GPIO_IR_ON); |
| 459 | } |
| 460 | |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 461 | static void spitz_irda_transceiver_mode(struct device *dev, int mode) |
| 462 | { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 463 | gpio_set_value(SPITZ_GPIO_IR_ON, mode & IR_OFF); |
Dmitry Baryshkov | 0fc3ff3 | 2008-07-02 13:54:46 +0100 | [diff] [blame] | 464 | pxa2xx_transceiver_mode(dev, mode); |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 465 | } |
| 466 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 467 | #ifdef CONFIG_MACH_AKITA |
| 468 | static void akita_irda_transceiver_mode(struct device *dev, int mode) |
| 469 | { |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 470 | gpio_set_value(AKITA_GPIO_IR_ON, mode & IR_OFF); |
Dmitry Baryshkov | 0fc3ff3 | 2008-07-02 13:54:46 +0100 | [diff] [blame] | 471 | pxa2xx_transceiver_mode(dev, mode); |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 472 | } |
| 473 | #endif |
| 474 | |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 475 | static struct pxaficp_platform_data spitz_ficp_platform_data = { |
Eric Miao | fff1472 | 2008-09-05 22:15:23 +0800 | [diff] [blame] | 476 | .transceiver_cap = IR_SIRMODE | IR_OFF, |
| 477 | .transceiver_mode = spitz_irda_transceiver_mode, |
| 478 | .startup = spitz_irda_startup, |
| 479 | .shutdown = spitz_irda_shutdown, |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 480 | }; |
| 481 | |
| 482 | |
| 483 | /* |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 484 | * Spitz PXA Framebuffer |
| 485 | */ |
Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 486 | |
| 487 | static struct pxafb_mode_info spitz_pxafb_modes[] = { |
| 488 | { |
| 489 | .pixclock = 19231, |
| 490 | .xres = 480, |
| 491 | .yres = 640, |
| 492 | .bpp = 16, |
| 493 | .hsync_len = 40, |
| 494 | .left_margin = 46, |
| 495 | .right_margin = 125, |
| 496 | .vsync_len = 3, |
| 497 | .upper_margin = 1, |
| 498 | .lower_margin = 0, |
| 499 | .sync = 0, |
| 500 | },{ |
| 501 | .pixclock = 134617, |
| 502 | .xres = 240, |
| 503 | .yres = 320, |
| 504 | .bpp = 16, |
| 505 | .hsync_len = 20, |
| 506 | .left_margin = 20, |
| 507 | .right_margin = 46, |
| 508 | .vsync_len = 2, |
| 509 | .upper_margin = 1, |
| 510 | .lower_margin = 0, |
| 511 | .sync = 0, |
| 512 | }, |
| 513 | }; |
| 514 | |
| 515 | static struct pxafb_mach_info spitz_pxafb_info = { |
| 516 | .modes = &spitz_pxafb_modes[0], |
| 517 | .num_modes = 2, |
| 518 | .fixed_modes = 1, |
Eric Miao | 79009a0 | 2008-09-03 10:00:38 +0800 | [diff] [blame] | 519 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 520 | }; |
| 521 | |
Dmitry Baryshkov | 6af7a8e | 2008-10-16 19:17:05 +0400 | [diff] [blame] | 522 | static struct mtd_partition sharpsl_nand_partitions[] = { |
| 523 | { |
| 524 | .name = "System Area", |
| 525 | .offset = 0, |
| 526 | .size = 7 * 1024 * 1024, |
| 527 | }, |
| 528 | { |
| 529 | .name = "Root Filesystem", |
| 530 | .offset = 7 * 1024 * 1024, |
| 531 | }, |
| 532 | { |
| 533 | .name = "Home Filesystem", |
| 534 | .offset = MTDPART_OFS_APPEND, |
| 535 | .size = MTDPART_SIZ_FULL, |
| 536 | }, |
| 537 | }; |
| 538 | |
| 539 | static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; |
| 540 | |
| 541 | static struct nand_bbt_descr sharpsl_bbt = { |
| 542 | .options = 0, |
| 543 | .offs = 4, |
| 544 | .len = 2, |
| 545 | .pattern = scan_ff_pattern |
| 546 | }; |
| 547 | |
| 548 | static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { |
| 549 | .badblock_pattern = &sharpsl_bbt, |
| 550 | .partitions = sharpsl_nand_partitions, |
| 551 | .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), |
| 552 | }; |
| 553 | |
| 554 | static struct resource sharpsl_nand_resources[] = { |
| 555 | { |
| 556 | .start = 0x0C000000, |
| 557 | .end = 0x0C000FFF, |
| 558 | .flags = IORESOURCE_MEM, |
| 559 | }, |
| 560 | }; |
| 561 | |
| 562 | static struct platform_device sharpsl_nand_device = { |
| 563 | .name = "sharpsl-nand", |
| 564 | .id = -1, |
| 565 | .resource = sharpsl_nand_resources, |
| 566 | .num_resources = ARRAY_SIZE(sharpsl_nand_resources), |
| 567 | .dev.platform_data = &sharpsl_nand_platform_data, |
| 568 | }; |
| 569 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 570 | |
Dmitry Baryshkov | e5d3bf3 | 2008-11-25 00:57:28 +0300 | [diff] [blame] | 571 | static struct mtd_partition sharpsl_rom_parts[] = { |
| 572 | { |
| 573 | .name ="Boot PROM Filesystem", |
| 574 | .offset = 0x00140000, |
| 575 | .size = MTDPART_SIZ_FULL, |
| 576 | }, |
| 577 | }; |
| 578 | |
| 579 | static struct physmap_flash_data sharpsl_rom_data = { |
| 580 | .width = 2, |
| 581 | .nr_parts = ARRAY_SIZE(sharpsl_rom_parts), |
| 582 | .parts = sharpsl_rom_parts, |
| 583 | }; |
| 584 | |
| 585 | static struct resource sharpsl_rom_resources[] = { |
| 586 | { |
| 587 | .start = 0x00000000, |
| 588 | .end = 0x007fffff, |
| 589 | .flags = IORESOURCE_MEM, |
| 590 | }, |
| 591 | }; |
| 592 | |
| 593 | static struct platform_device sharpsl_rom_device = { |
| 594 | .name = "physmap-flash", |
| 595 | .id = -1, |
| 596 | .resource = sharpsl_rom_resources, |
| 597 | .num_resources = ARRAY_SIZE(sharpsl_rom_resources), |
| 598 | .dev.platform_data = &sharpsl_rom_data, |
| 599 | }; |
| 600 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 601 | static struct platform_device *devices[] __initdata = { |
| 602 | &spitzscoop_device, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 603 | &spitzkbd_device, |
Richard Purdie | 3179108 | 2006-03-31 02:31:09 -0800 | [diff] [blame] | 604 | &spitzled_device, |
Dmitry Baryshkov | 6af7a8e | 2008-10-16 19:17:05 +0400 | [diff] [blame] | 605 | &sharpsl_nand_device, |
Dmitry Baryshkov | e5d3bf3 | 2008-11-25 00:57:28 +0300 | [diff] [blame] | 606 | &sharpsl_rom_device, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 607 | }; |
| 608 | |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 609 | static void spitz_poweroff(void) |
| 610 | { |
Russell King | be093be | 2009-03-19 16:20:24 +0000 | [diff] [blame] | 611 | arm_machine_restart('g', NULL); |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 612 | } |
| 613 | |
Russell King | be093be | 2009-03-19 16:20:24 +0000 | [diff] [blame] | 614 | static void spitz_restart(char mode, const char *cmd) |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 615 | { |
| 616 | /* Bootloader magic for a reboot */ |
| 617 | if((MSC0 & 0xffff0000) == 0x7ff00000) |
| 618 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; |
| 619 | |
| 620 | spitz_poweroff(); |
| 621 | } |
| 622 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 623 | static void __init common_init(void) |
| 624 | { |
Daniel Ribeiro | 216e3b7 | 2009-05-05 22:43:18 -0300 | [diff] [blame] | 625 | init_gpio_reset(SPITZ_GPIO_ON_RESET, 1, 0); |
Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 626 | pm_power_off = spitz_poweroff; |
| 627 | arm_pm_restart = spitz_restart; |
| 628 | |
Dmitry Baryshkov | 6af7a8e | 2008-10-16 19:17:05 +0400 | [diff] [blame] | 629 | if (machine_is_spitz()) { |
| 630 | sharpsl_nand_partitions[1].size = 5 * 1024 * 1024; |
| 631 | } else if (machine_is_akita()) { |
| 632 | sharpsl_nand_partitions[1].size = 58 * 1024 * 1024; |
| 633 | } else if (machine_is_borzoi()) { |
| 634 | sharpsl_nand_partitions[1].size = 32 * 1024 * 1024; |
| 635 | } |
| 636 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 637 | PMCR = 0x00; |
| 638 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 639 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ |
| 640 | PCFR |= PCFR_OPDE; |
| 641 | |
Eric Miao | 5e96ade | 2008-09-03 09:47:42 +0800 | [diff] [blame] | 642 | pxa2xx_mfp_config(ARRAY_AND_SIZE(spitz_pin_config)); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 643 | |
Eric Miao | 859b796 | 2008-09-03 12:09:24 +0800 | [diff] [blame] | 644 | spitz_init_spi(); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 645 | |
| 646 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
Robert Jarzmik | 7a64825 | 2009-07-06 22:16:42 +0200 | [diff] [blame] | 647 | spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 648 | pxa_set_mci_info(&spitz_mci_platform_data); |
Richard Purdie | 3125c68 | 2006-01-05 20:44:52 +0000 | [diff] [blame] | 649 | pxa_set_ohci_info(&spitz_ohci_platform_data); |
Richard Purdie | dc07845 | 2005-10-30 14:50:25 +0000 | [diff] [blame] | 650 | pxa_set_ficp_info(&spitz_ficp_platform_data); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 651 | set_pxa_fb_info(&spitz_pxafb_info); |
Mark Brown | f8787fd | 2008-08-26 13:30:03 +0100 | [diff] [blame] | 652 | pxa_set_i2c_info(NULL); |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 653 | } |
| 654 | |
Richard Purdie | ca4d6cf | 2008-01-02 01:09:54 +0100 | [diff] [blame] | 655 | #if defined(CONFIG_MACH_SPITZ) || defined(CONFIG_MACH_BORZOI) |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 656 | static void __init spitz_init(void) |
| 657 | { |
Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 658 | platform_scoop_config = &spitz_pcmcia_config; |
| 659 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 660 | common_init(); |
| 661 | |
| 662 | platform_device_register(&spitzscoop2_device); |
| 663 | } |
Richard Purdie | ca4d6cf | 2008-01-02 01:09:54 +0100 | [diff] [blame] | 664 | #endif |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 665 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 666 | #ifdef CONFIG_MACH_AKITA |
| 667 | /* |
| 668 | * Akita IO Expander |
| 669 | */ |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 670 | static struct pca953x_platform_data akita_ioexp = { |
| 671 | .gpio_base = AKITA_IOEXP_GPIO_BASE, |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 672 | }; |
| 673 | |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 674 | static struct i2c_board_info akita_i2c_board_info[] = { |
| 675 | { |
| 676 | .type = "max7310", |
| 677 | .addr = 0x18, |
| 678 | .platform_data = &akita_ioexp, |
| 679 | }, |
| 680 | }; |
Richard Purdie | ca4d6cf | 2008-01-02 01:09:54 +0100 | [diff] [blame] | 681 | |
Dmitry Baryshkov | 6af7a8e | 2008-10-16 19:17:05 +0400 | [diff] [blame] | 682 | static struct nand_bbt_descr sharpsl_akita_bbt = { |
| 683 | .options = 0, |
| 684 | .offs = 4, |
| 685 | .len = 1, |
| 686 | .pattern = scan_ff_pattern |
| 687 | }; |
| 688 | |
| 689 | static struct nand_ecclayout akita_oobinfo = { |
| 690 | .eccbytes = 24, |
| 691 | .eccpos = { |
| 692 | 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11, |
| 693 | 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23, |
| 694 | 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37}, |
| 695 | .oobfree = {{0x08, 0x09}} |
| 696 | }; |
| 697 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 698 | static void __init akita_init(void) |
| 699 | { |
| 700 | spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; |
| 701 | |
Dmitry Baryshkov | 6af7a8e | 2008-10-16 19:17:05 +0400 | [diff] [blame] | 702 | sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt; |
| 703 | sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo; |
| 704 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 705 | /* We just pretend the second element of the array doesn't exist */ |
| 706 | spitz_pcmcia_config.num_devs = 1; |
| 707 | platform_scoop_config = &spitz_pcmcia_config; |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 708 | |
Eric Miao | f72de66 | 2008-09-06 08:46:23 +0800 | [diff] [blame] | 709 | i2c_register_board_info(0, ARRAY_AND_SIZE(akita_i2c_board_info)); |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 710 | |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 711 | common_init(); |
| 712 | } |
| 713 | #endif |
| 714 | |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 715 | static void __init fixup_spitz(struct machine_desc *desc, |
| 716 | struct tag *tags, char **cmdline, struct meminfo *mi) |
| 717 | { |
| 718 | sharpsl_save_param(); |
| 719 | mi->nr_banks = 1; |
| 720 | mi->bank[0].start = 0xa0000000; |
| 721 | mi->bank[0].node = 0; |
| 722 | mi->bank[0].size = (64*1024*1024); |
| 723 | } |
| 724 | |
| 725 | #ifdef CONFIG_MACH_SPITZ |
| 726 | MACHINE_START(SPITZ, "SHARP Spitz") |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 727 | .phys_io = 0x40000000, |
| 728 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 729 | .fixup = fixup_spitz, |
| 730 | .map_io = pxa_map_io, |
Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 731 | .init_irq = pxa27x_init_irq, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 732 | .init_machine = spitz_init, |
| 733 | .timer = &pxa_timer, |
| 734 | MACHINE_END |
| 735 | #endif |
| 736 | |
| 737 | #ifdef CONFIG_MACH_BORZOI |
| 738 | MACHINE_START(BORZOI, "SHARP Borzoi") |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 739 | .phys_io = 0x40000000, |
| 740 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 741 | .fixup = fixup_spitz, |
| 742 | .map_io = pxa_map_io, |
Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 743 | .init_irq = pxa27x_init_irq, |
Richard Purdie | 0dd28f1 | 2005-09-13 01:25:34 -0700 | [diff] [blame] | 744 | .init_machine = spitz_init, |
| 745 | .timer = &pxa_timer, |
| 746 | MACHINE_END |
| 747 | #endif |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 748 | |
| 749 | #ifdef CONFIG_MACH_AKITA |
| 750 | MACHINE_START(AKITA, "SHARP Akita") |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 751 | .phys_io = 0x40000000, |
| 752 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
| 753 | .fixup = fixup_spitz, |
| 754 | .map_io = pxa_map_io, |
Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 755 | .init_irq = pxa27x_init_irq, |
Richard Purdie | 94cabd0 | 2005-11-12 18:53:48 +0000 | [diff] [blame] | 756 | .init_machine = akita_init, |
| 757 | .timer = &pxa_timer, |
| 758 | MACHINE_END |
| 759 | #endif |