| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * linux/arch/arm/mach-pxa/poodle.c | 
|  | 3 | * | 
|  | 4 | *  Support for the SHARP Poodle Board. | 
|  | 5 | * | 
|  | 6 | * Based on: | 
|  | 7 | *  linux/arch/arm/mach-pxa/lubbock.c Author:	Nicolas Pitre | 
|  | 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 | * Change Log | 
|  | 14 | *  12-Dec-2002 Sharp Corporation for Poodle | 
|  | 15 | *  John Lenz <lenz@cs.wisc.edu> updates to 2.6 | 
|  | 16 | */ | 
|  | 17 | #include <linux/kernel.h> | 
|  | 18 | #include <linux/init.h> | 
| Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 19 | #include <linux/platform_device.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <linux/fb.h> | 
| Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 21 | #include <linux/pm.h> | 
| Richard Purdie | 8866035 | 2006-06-19 19:58:51 +0100 | [diff] [blame] | 22 | #include <linux/delay.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 |  | 
|  | 24 | #include <asm/hardware.h> | 
|  | 25 | #include <asm/mach-types.h> | 
|  | 26 | #include <asm/irq.h> | 
|  | 27 | #include <asm/setup.h> | 
| Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 28 | #include <asm/system.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 |  | 
|  | 30 | #include <asm/mach/arch.h> | 
|  | 31 | #include <asm/mach/map.h> | 
|  | 32 | #include <asm/mach/irq.h> | 
|  | 33 |  | 
|  | 34 | #include <asm/arch/pxa-regs.h> | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 35 | #include <asm/arch/mmc.h> | 
|  | 36 | #include <asm/arch/udc.h> | 
| Richard Purdie | 8e4b871 | 2005-10-30 14:38:52 +0000 | [diff] [blame] | 37 | #include <asm/arch/irda.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | #include <asm/arch/poodle.h> | 
|  | 39 | #include <asm/arch/pxafb.h> | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 40 | #include <asm/arch/sharpsl.h> | 
|  | 41 | #include <asm/arch/ssp.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 |  | 
|  | 43 | #include <asm/hardware/scoop.h> | 
|  | 44 | #include <asm/hardware/locomo.h> | 
|  | 45 | #include <asm/mach/sharpsl_param.h> | 
|  | 46 |  | 
|  | 47 | #include "generic.h" | 
| Russell King | 46c41e6 | 2007-05-15 15:39:36 +0100 | [diff] [blame] | 48 | #include "devices.h" | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 49 | #include "sharpsl.h" | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 |  | 
|  | 51 | static struct resource poodle_scoop_resources[] = { | 
|  | 52 | [0] = { | 
|  | 53 | .start		= 0x10800000, | 
|  | 54 | .end		= 0x10800fff, | 
|  | 55 | .flags		= IORESOURCE_MEM, | 
|  | 56 | }, | 
|  | 57 | }; | 
|  | 58 |  | 
|  | 59 | static struct scoop_config poodle_scoop_setup = { | 
|  | 60 | .io_dir		= POODLE_SCOOP_IO_DIR, | 
|  | 61 | .io_out		= POODLE_SCOOP_IO_OUT, | 
|  | 62 | }; | 
|  | 63 |  | 
|  | 64 | struct platform_device poodle_scoop_device = { | 
|  | 65 | .name		= "sharp-scoop", | 
|  | 66 | .id		= -1, | 
|  | 67 | .dev		= { | 
|  | 68 | .platform_data	= &poodle_scoop_setup, | 
|  | 69 | }, | 
|  | 70 | .num_resources	= ARRAY_SIZE(poodle_scoop_resources), | 
|  | 71 | .resource	= poodle_scoop_resources, | 
|  | 72 | }; | 
|  | 73 |  | 
| Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 74 | static void poodle_pcmcia_init(void) | 
|  | 75 | { | 
|  | 76 | /* Setup default state of GPIO outputs | 
|  | 77 | before we enable them as outputs. */ | 
|  | 78 | GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) | | 
|  | 79 | GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) | | 
|  | 80 | GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) | | 
|  | 81 | GPIO_bit(GPIO53_nPCE_2); | 
|  | 82 |  | 
|  | 83 | pxa_gpio_mode(GPIO48_nPOE_MD); | 
|  | 84 | pxa_gpio_mode(GPIO49_nPWE_MD); | 
|  | 85 | pxa_gpio_mode(GPIO50_nPIOR_MD); | 
|  | 86 | pxa_gpio_mode(GPIO51_nPIOW_MD); | 
|  | 87 | pxa_gpio_mode(GPIO55_nPREG_MD); | 
|  | 88 | pxa_gpio_mode(GPIO56_nPWAIT_MD); | 
|  | 89 | pxa_gpio_mode(GPIO57_nIOIS16_MD); | 
|  | 90 | pxa_gpio_mode(GPIO52_nPCE_1_MD); | 
|  | 91 | pxa_gpio_mode(GPIO53_nPCE_2_MD); | 
|  | 92 | pxa_gpio_mode(GPIO54_pSKTSEL_MD); | 
|  | 93 | } | 
|  | 94 |  | 
| Richard Purdie | 0ce7625 | 2005-09-05 20:49:54 +0100 | [diff] [blame] | 95 | static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = { | 
|  | 96 | { | 
|  | 97 | .dev        = &poodle_scoop_device.dev, | 
|  | 98 | .irq        = POODLE_IRQ_GPIO_CF_IRQ, | 
|  | 99 | .cd_irq     = POODLE_IRQ_GPIO_CF_CD, | 
|  | 100 | .cd_irq_str = "PCMCIA0 CD", | 
|  | 101 | }, | 
|  | 102 | }; | 
|  | 103 |  | 
| Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 104 | static struct scoop_pcmcia_config poodle_pcmcia_config = { | 
|  | 105 | .devs         = &poodle_pcmcia_scoop[0], | 
|  | 106 | .num_devs     = 1, | 
|  | 107 | .pcmcia_init  = poodle_pcmcia_init, | 
|  | 108 | }; | 
|  | 109 |  | 
|  | 110 | EXPORT_SYMBOL(poodle_scoop_device); | 
|  | 111 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 |  | 
|  | 113 | /* LoCoMo device */ | 
|  | 114 | static struct resource locomo_resources[] = { | 
|  | 115 | [0] = { | 
|  | 116 | .start		= 0x10000000, | 
|  | 117 | .end		= 0x10001fff, | 
|  | 118 | .flags		= IORESOURCE_MEM, | 
|  | 119 | }, | 
|  | 120 | [1] = { | 
|  | 121 | .start		= IRQ_GPIO(10), | 
|  | 122 | .end		= IRQ_GPIO(10), | 
|  | 123 | .flags		= IORESOURCE_IRQ, | 
|  | 124 | }, | 
|  | 125 | }; | 
|  | 126 |  | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 127 | struct platform_device poodle_locomo_device = { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 128 | .name		= "locomo", | 
|  | 129 | .id		= 0, | 
|  | 130 | .num_resources	= ARRAY_SIZE(locomo_resources), | 
|  | 131 | .resource	= locomo_resources, | 
|  | 132 | }; | 
|  | 133 |  | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 134 | EXPORT_SYMBOL(poodle_locomo_device); | 
|  | 135 |  | 
|  | 136 | /* | 
|  | 137 | * Poodle SSP Device | 
|  | 138 | */ | 
|  | 139 |  | 
|  | 140 | struct platform_device poodle_ssp_device = { | 
|  | 141 | .name		= "corgi-ssp", | 
|  | 142 | .id		= -1, | 
|  | 143 | }; | 
|  | 144 |  | 
|  | 145 | struct corgissp_machinfo poodle_ssp_machinfo = { | 
|  | 146 | .port		= 1, | 
|  | 147 | .cs_lcdcon	= -1, | 
|  | 148 | .cs_ads7846	= -1, | 
|  | 149 | .cs_max1111	= -1, | 
|  | 150 | .clk_lcdcon	= 2, | 
|  | 151 | .clk_ads7846	= 36, | 
|  | 152 | .clk_max1111	= 2, | 
|  | 153 | }; | 
|  | 154 |  | 
|  | 155 |  | 
|  | 156 | /* | 
|  | 157 | * Poodle Touch Screen Device | 
|  | 158 | */ | 
|  | 159 | static struct resource poodlets_resources[] = { | 
|  | 160 | [0] = { | 
|  | 161 | .start		= POODLE_IRQ_GPIO_TP_INT, | 
|  | 162 | .end		= POODLE_IRQ_GPIO_TP_INT, | 
|  | 163 | .flags		= IORESOURCE_IRQ, | 
|  | 164 | }, | 
|  | 165 | }; | 
|  | 166 |  | 
|  | 167 | static unsigned long poodle_get_hsync_len(void) | 
|  | 168 | { | 
|  | 169 | return 0; | 
|  | 170 | } | 
|  | 171 |  | 
|  | 172 | static void poodle_null_hsync(void) | 
|  | 173 | { | 
|  | 174 | } | 
|  | 175 |  | 
|  | 176 | static struct corgits_machinfo  poodle_ts_machinfo = { | 
|  | 177 | .get_hsync_len   = poodle_get_hsync_len, | 
|  | 178 | .put_hsync       = poodle_null_hsync, | 
|  | 179 | .wait_hsync      = poodle_null_hsync, | 
|  | 180 | }; | 
|  | 181 |  | 
|  | 182 | static struct platform_device poodle_ts_device = { | 
|  | 183 | .name		= "corgi-ts", | 
|  | 184 | .dev		= { | 
|  | 185 | .platform_data	= &poodle_ts_machinfo, | 
|  | 186 | }, | 
|  | 187 | .id		= -1, | 
|  | 188 | .num_resources	= ARRAY_SIZE(poodlets_resources), | 
|  | 189 | .resource	= poodlets_resources, | 
|  | 190 | }; | 
|  | 191 |  | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 192 |  | 
|  | 193 | /* | 
|  | 194 | * MMC/SD Device | 
|  | 195 | * | 
|  | 196 | * The card detect interrupt isn't debounced so we delay it by 250ms | 
|  | 197 | * to give the card a chance to fully insert/eject. | 
|  | 198 | */ | 
|  | 199 | static struct pxamci_platform_data poodle_mci_platform_data; | 
|  | 200 |  | 
| David Howells | 40220c1 | 2006-10-09 12:19:47 +0100 | [diff] [blame] | 201 | static int poodle_mci_init(struct device *dev, irq_handler_t poodle_detect_int, void *data) | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 202 | { | 
|  | 203 | int err; | 
|  | 204 |  | 
|  | 205 | /* setup GPIO for PXA25x MMC controller	*/ | 
|  | 206 | pxa_gpio_mode(GPIO6_MMCCLK_MD); | 
|  | 207 | pxa_gpio_mode(GPIO8_MMCCS0_MD); | 
|  | 208 | pxa_gpio_mode(POODLE_GPIO_nSD_DETECT | GPIO_IN); | 
| Richard Purdie | 8866035 | 2006-06-19 19:58:51 +0100 | [diff] [blame] | 209 | pxa_gpio_mode(POODLE_GPIO_nSD_WP | GPIO_IN); | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 210 | pxa_gpio_mode(POODLE_GPIO_SD_PWR | GPIO_OUT); | 
| Richard Purdie | 8866035 | 2006-06-19 19:58:51 +0100 | [diff] [blame] | 211 | pxa_gpio_mode(POODLE_GPIO_SD_PWR1 | GPIO_OUT); | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 212 |  | 
|  | 213 | poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); | 
|  | 214 |  | 
| Russell King | 9ded96f | 2006-01-08 01:02:07 -0800 | [diff] [blame] | 215 | err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, | 
| Thomas Gleixner | 52e405e | 2006-07-03 02:20:05 +0200 | [diff] [blame] | 216 | IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 
| Russell King | 9ded96f | 2006-01-08 01:02:07 -0800 | [diff] [blame] | 217 | "MMC card detect", data); | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 218 | if (err) { | 
|  | 219 | printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); | 
|  | 220 | return -1; | 
|  | 221 | } | 
|  | 222 |  | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 223 | return 0; | 
|  | 224 | } | 
|  | 225 |  | 
|  | 226 | static void poodle_mci_setpower(struct device *dev, unsigned int vdd) | 
|  | 227 | { | 
|  | 228 | struct pxamci_platform_data* p_d = dev->platform_data; | 
|  | 229 |  | 
| Richard Purdie | 8866035 | 2006-06-19 19:58:51 +0100 | [diff] [blame] | 230 | if (( 1 << vdd) & p_d->ocr_mask) { | 
|  | 231 | GPSR(POODLE_GPIO_SD_PWR) = GPIO_bit(POODLE_GPIO_SD_PWR); | 
|  | 232 | mdelay(2); | 
|  | 233 | GPSR(POODLE_GPIO_SD_PWR1) = GPIO_bit(POODLE_GPIO_SD_PWR1); | 
|  | 234 | } else { | 
|  | 235 | GPCR(POODLE_GPIO_SD_PWR1) = GPIO_bit(POODLE_GPIO_SD_PWR1); | 
|  | 236 | GPCR(POODLE_GPIO_SD_PWR) = GPIO_bit(POODLE_GPIO_SD_PWR); | 
|  | 237 | } | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 238 | } | 
|  | 239 |  | 
| Richard Purdie | 8866035 | 2006-06-19 19:58:51 +0100 | [diff] [blame] | 240 | static int poodle_mci_get_ro(struct device *dev) | 
|  | 241 | { | 
|  | 242 | return GPLR(POODLE_GPIO_nSD_WP) & GPIO_bit(POODLE_GPIO_nSD_WP); | 
|  | 243 | } | 
|  | 244 |  | 
|  | 245 |  | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 246 | static void poodle_mci_exit(struct device *dev, void *data) | 
|  | 247 | { | 
|  | 248 | free_irq(POODLE_IRQ_GPIO_nSD_DETECT, data); | 
|  | 249 | } | 
|  | 250 |  | 
|  | 251 | static struct pxamci_platform_data poodle_mci_platform_data = { | 
|  | 252 | .ocr_mask	= MMC_VDD_32_33|MMC_VDD_33_34, | 
|  | 253 | .init 		= poodle_mci_init, | 
| Richard Purdie | 8866035 | 2006-06-19 19:58:51 +0100 | [diff] [blame] | 254 | .get_ro		= poodle_mci_get_ro, | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 255 | .setpower 	= poodle_mci_setpower, | 
|  | 256 | .exit		= poodle_mci_exit, | 
|  | 257 | }; | 
|  | 258 |  | 
|  | 259 |  | 
|  | 260 | /* | 
| Richard Purdie | 8e4b871 | 2005-10-30 14:38:52 +0000 | [diff] [blame] | 261 | * Irda | 
|  | 262 | */ | 
|  | 263 | static void poodle_irda_transceiver_mode(struct device *dev, int mode) | 
|  | 264 | { | 
|  | 265 | if (mode & IR_OFF) { | 
|  | 266 | GPSR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON); | 
|  | 267 | } else { | 
|  | 268 | GPCR(POODLE_GPIO_IR_ON) = GPIO_bit(POODLE_GPIO_IR_ON); | 
|  | 269 | } | 
|  | 270 | } | 
|  | 271 |  | 
|  | 272 | static struct pxaficp_platform_data poodle_ficp_platform_data = { | 
|  | 273 | .transceiver_cap  = IR_SIRMODE | IR_OFF, | 
|  | 274 | .transceiver_mode = poodle_irda_transceiver_mode, | 
|  | 275 | }; | 
|  | 276 |  | 
|  | 277 |  | 
|  | 278 | /* | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 279 | * USB Device Controller | 
|  | 280 | */ | 
|  | 281 | static void poodle_udc_command(int cmd) | 
|  | 282 | { | 
|  | 283 | switch(cmd)	{ | 
|  | 284 | case PXA2XX_UDC_CMD_CONNECT: | 
|  | 285 | GPSR(POODLE_GPIO_USB_PULLUP) = GPIO_bit(POODLE_GPIO_USB_PULLUP); | 
|  | 286 | break; | 
|  | 287 | case PXA2XX_UDC_CMD_DISCONNECT: | 
|  | 288 | GPCR(POODLE_GPIO_USB_PULLUP) = GPIO_bit(POODLE_GPIO_USB_PULLUP); | 
|  | 289 | break; | 
|  | 290 | } | 
|  | 291 | } | 
|  | 292 |  | 
|  | 293 | static struct pxa2xx_udc_mach_info udc_info __initdata = { | 
|  | 294 | /* no connect GPIO; poodle can't tell connection status */ | 
|  | 295 | .udc_command		= poodle_udc_command, | 
|  | 296 | }; | 
|  | 297 |  | 
|  | 298 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | /* PXAFB device */ | 
| Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 300 | static struct pxafb_mode_info poodle_fb_mode = { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | .pixclock	= 144700, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 302 | .xres		= 320, | 
|  | 303 | .yres		= 240, | 
|  | 304 | .bpp		= 16, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | .hsync_len	= 7, | 
|  | 306 | .left_margin	= 11, | 
|  | 307 | .right_margin	= 30, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | .vsync_len	= 2, | 
|  | 309 | .upper_margin	= 2, | 
|  | 310 | .lower_margin	= 0, | 
|  | 311 | .sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 
| Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 312 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 |  | 
| Richard Purdie | d14b272 | 2006-09-20 22:54:21 +0100 | [diff] [blame] | 314 | static struct pxafb_mach_info poodle_fb_info = { | 
|  | 315 | .modes		= &poodle_fb_mode, | 
|  | 316 | .num_modes	= 1, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 317 | .lccr0		= LCCR0_Act | LCCR0_Sngl | LCCR0_Color, | 
|  | 318 | .lccr3		= 0, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | }; | 
|  | 320 |  | 
|  | 321 | static struct platform_device *devices[] __initdata = { | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 322 | &poodle_locomo_device, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | &poodle_scoop_device, | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 324 | &poodle_ssp_device, | 
|  | 325 | &poodle_ts_device, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | }; | 
|  | 327 |  | 
| Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 328 | static void poodle_poweroff(void) | 
|  | 329 | { | 
|  | 330 | RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR; | 
|  | 331 | arm_machine_restart('h'); | 
|  | 332 | } | 
|  | 333 |  | 
|  | 334 | static void poodle_restart(char mode) | 
|  | 335 | { | 
|  | 336 | RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR; | 
|  | 337 | arm_machine_restart('h'); | 
|  | 338 | } | 
|  | 339 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | static void __init poodle_init(void) | 
|  | 341 | { | 
|  | 342 | int ret = 0; | 
|  | 343 |  | 
| Richard Purdie | 74617fb | 2006-06-19 19:57:12 +0100 | [diff] [blame] | 344 | pm_power_off = poodle_poweroff; | 
|  | 345 | arm_pm_restart = poodle_restart; | 
|  | 346 |  | 
| Richard Purdie | f29d245 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 347 | /* setup sleep mode values */ | 
|  | 348 | PWER  = 0x00000002; | 
|  | 349 | PFER  = 0x00000000; | 
|  | 350 | PRER  = 0x00000002; | 
|  | 351 | PGSR0 = 0x00008000; | 
|  | 352 | PGSR1 = 0x003F0202; | 
|  | 353 | PGSR2 = 0x0001C000; | 
|  | 354 | PCFR |= PCFR_OPDE; | 
|  | 355 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 356 | /* cpu initialize */ | 
|  | 357 | /* Pgsr Register */ | 
|  | 358 | PGSR0 = 0x0146dd80; | 
|  | 359 | PGSR1 = 0x03bf0890; | 
|  | 360 | PGSR2 = 0x0001c000; | 
|  | 361 |  | 
|  | 362 | /* Alternate Register */ | 
|  | 363 | GAFR0_L = 0x01001000; | 
|  | 364 | GAFR0_U = 0x591a8010; | 
|  | 365 | GAFR1_L = 0x900a8451; | 
|  | 366 | GAFR1_U = 0xaaa5aaaa; | 
|  | 367 | GAFR2_L = 0x8aaaaaaa; | 
|  | 368 | GAFR2_U = 0x00000002; | 
|  | 369 |  | 
|  | 370 | /* Direction Register */ | 
|  | 371 | GPDR0 = 0xd3f0904c; | 
|  | 372 | GPDR1 = 0xfcffb7d3; | 
|  | 373 | GPDR2 = 0x0001ffff; | 
|  | 374 |  | 
|  | 375 | /* Output Register */ | 
|  | 376 | GPCR0 = 0x00000000; | 
|  | 377 | GPCR1 = 0x00000000; | 
|  | 378 | GPCR2 = 0x00000000; | 
|  | 379 |  | 
|  | 380 | GPSR0 = 0x00400000; | 
|  | 381 | GPSR1 = 0x00000000; | 
|  | 382 | GPSR2 = 0x00000000; | 
|  | 383 |  | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 384 | set_pxa_fb_parent(&poodle_locomo_device.dev); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 385 | set_pxa_fb_info(&poodle_fb_info); | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 386 | pxa_gpio_mode(POODLE_GPIO_USB_PULLUP | GPIO_OUT); | 
| Richard Purdie | 8e4b871 | 2005-10-30 14:38:52 +0000 | [diff] [blame] | 387 | pxa_gpio_mode(POODLE_GPIO_IR_ON | GPIO_OUT); | 
| Richard Purdie | 13b9d47 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 388 | pxa_set_udc_info(&udc_info); | 
|  | 389 | pxa_set_mci_info(&poodle_mci_platform_data); | 
| Richard Purdie | 8e4b871 | 2005-10-30 14:38:52 +0000 | [diff] [blame] | 390 | pxa_set_ficp_info(&poodle_ficp_platform_data); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 391 |  | 
| Richard Purdie | a63ae44 | 2005-11-08 19:15:43 +0000 | [diff] [blame] | 392 | platform_scoop_config = &poodle_pcmcia_config; | 
| Richard Purdie | 0ce7625 | 2005-09-05 20:49:54 +0100 | [diff] [blame] | 393 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 394 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 
|  | 395 | if (ret) { | 
|  | 396 | printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n"); | 
|  | 397 | } | 
| Richard Purdie | faed568 | 2006-06-19 20:46:05 +0100 | [diff] [blame] | 398 | corgi_ssp_set_machinfo(&poodle_ssp_machinfo); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 399 | } | 
|  | 400 |  | 
|  | 401 | static void __init fixup_poodle(struct machine_desc *desc, | 
|  | 402 | struct tag *tags, char **cmdline, struct meminfo *mi) | 
|  | 403 | { | 
|  | 404 | sharpsl_save_param(); | 
| Richard Purdie | b2e6f75 | 2006-04-02 17:11:00 +0100 | [diff] [blame] | 405 | mi->nr_banks=1; | 
|  | 406 | mi->bank[0].start = 0xa0000000; | 
|  | 407 | mi->bank[0].node = 0; | 
|  | 408 | mi->bank[0].size = (32*1024*1024); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 409 | } | 
|  | 410 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 411 | MACHINE_START(POODLE, "SHARP Poodle") | 
| Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 412 | .phys_io	= 0x40000000, | 
| Russell King | 68070bd | 2005-07-04 10:44:34 +0100 | [diff] [blame] | 413 | .io_pg_offst	= (io_p2v(0x40000000) >> 18) & 0xfffc, | 
| Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 414 | .fixup		= fixup_poodle, | 
| Richard Purdie | f29d245 | 2005-09-15 14:53:22 +0100 | [diff] [blame] | 415 | .map_io		= pxa_map_io, | 
| Eric Miao | cd49104 | 2007-06-22 04:14:09 +0100 | [diff] [blame] | 416 | .init_irq	= pxa25x_init_irq, | 
| Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 417 | .timer		= &pxa_timer, | 
|  | 418 | .init_machine	= poodle_init, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 419 | MACHINE_END |