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> |
| 19 | #include <linux/device.h> |
| 20 | #include <linux/fb.h> |
| 21 | |
| 22 | #include <asm/hardware.h> |
| 23 | #include <asm/mach-types.h> |
| 24 | #include <asm/irq.h> |
| 25 | #include <asm/setup.h> |
| 26 | |
| 27 | #include <asm/mach/arch.h> |
| 28 | #include <asm/mach/map.h> |
| 29 | #include <asm/mach/irq.h> |
| 30 | |
| 31 | #include <asm/arch/pxa-regs.h> |
| 32 | #include <asm/arch/irq.h> |
| 33 | #include <asm/arch/poodle.h> |
| 34 | #include <asm/arch/pxafb.h> |
| 35 | |
| 36 | #include <asm/hardware/scoop.h> |
| 37 | #include <asm/hardware/locomo.h> |
| 38 | #include <asm/mach/sharpsl_param.h> |
| 39 | |
| 40 | #include "generic.h" |
| 41 | |
| 42 | static struct resource poodle_scoop_resources[] = { |
| 43 | [0] = { |
| 44 | .start = 0x10800000, |
| 45 | .end = 0x10800fff, |
| 46 | .flags = IORESOURCE_MEM, |
| 47 | }, |
| 48 | }; |
| 49 | |
| 50 | static struct scoop_config poodle_scoop_setup = { |
| 51 | .io_dir = POODLE_SCOOP_IO_DIR, |
| 52 | .io_out = POODLE_SCOOP_IO_OUT, |
| 53 | }; |
| 54 | |
| 55 | struct platform_device poodle_scoop_device = { |
| 56 | .name = "sharp-scoop", |
| 57 | .id = -1, |
| 58 | .dev = { |
| 59 | .platform_data = &poodle_scoop_setup, |
| 60 | }, |
| 61 | .num_resources = ARRAY_SIZE(poodle_scoop_resources), |
| 62 | .resource = poodle_scoop_resources, |
| 63 | }; |
| 64 | |
Richard Purdie | 0ce7625 | 2005-09-05 20:49:54 +0100 | [diff] [blame] | 65 | static struct scoop_pcmcia_dev poodle_pcmcia_scoop[] = { |
| 66 | { |
| 67 | .dev = &poodle_scoop_device.dev, |
| 68 | .irq = POODLE_IRQ_GPIO_CF_IRQ, |
| 69 | .cd_irq = POODLE_IRQ_GPIO_CF_CD, |
| 70 | .cd_irq_str = "PCMCIA0 CD", |
| 71 | }, |
| 72 | }; |
| 73 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | |
| 75 | /* LoCoMo device */ |
| 76 | static struct resource locomo_resources[] = { |
| 77 | [0] = { |
| 78 | .start = 0x10000000, |
| 79 | .end = 0x10001fff, |
| 80 | .flags = IORESOURCE_MEM, |
| 81 | }, |
| 82 | [1] = { |
| 83 | .start = IRQ_GPIO(10), |
| 84 | .end = IRQ_GPIO(10), |
| 85 | .flags = IORESOURCE_IRQ, |
| 86 | }, |
| 87 | }; |
| 88 | |
| 89 | static struct platform_device locomo_device = { |
| 90 | .name = "locomo", |
| 91 | .id = 0, |
| 92 | .num_resources = ARRAY_SIZE(locomo_resources), |
| 93 | .resource = locomo_resources, |
| 94 | }; |
| 95 | |
| 96 | /* PXAFB device */ |
| 97 | static struct pxafb_mach_info poodle_fb_info __initdata = { |
| 98 | .pixclock = 144700, |
| 99 | |
| 100 | .xres = 320, |
| 101 | .yres = 240, |
| 102 | .bpp = 16, |
| 103 | |
| 104 | .hsync_len = 7, |
| 105 | .left_margin = 11, |
| 106 | .right_margin = 30, |
| 107 | |
| 108 | .vsync_len = 2, |
| 109 | .upper_margin = 2, |
| 110 | .lower_margin = 0, |
| 111 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
| 112 | |
| 113 | .lccr0 = LCCR0_Act | LCCR0_Sngl | LCCR0_Color, |
| 114 | .lccr3 = 0, |
| 115 | |
| 116 | .pxafb_backlight_power = NULL, |
| 117 | .pxafb_lcd_power = NULL, |
| 118 | }; |
| 119 | |
| 120 | static struct platform_device *devices[] __initdata = { |
| 121 | &locomo_device, |
| 122 | &poodle_scoop_device, |
| 123 | }; |
| 124 | |
| 125 | static void __init poodle_init(void) |
| 126 | { |
| 127 | int ret = 0; |
| 128 | |
Richard Purdie | f29d245 | 2005-09-15 14:53:22 +0100 | [diff] [blame^] | 129 | /* setup sleep mode values */ |
| 130 | PWER = 0x00000002; |
| 131 | PFER = 0x00000000; |
| 132 | PRER = 0x00000002; |
| 133 | PGSR0 = 0x00008000; |
| 134 | PGSR1 = 0x003F0202; |
| 135 | PGSR2 = 0x0001C000; |
| 136 | PCFR |= PCFR_OPDE; |
| 137 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | /* cpu initialize */ |
| 139 | /* Pgsr Register */ |
| 140 | PGSR0 = 0x0146dd80; |
| 141 | PGSR1 = 0x03bf0890; |
| 142 | PGSR2 = 0x0001c000; |
| 143 | |
| 144 | /* Alternate Register */ |
| 145 | GAFR0_L = 0x01001000; |
| 146 | GAFR0_U = 0x591a8010; |
| 147 | GAFR1_L = 0x900a8451; |
| 148 | GAFR1_U = 0xaaa5aaaa; |
| 149 | GAFR2_L = 0x8aaaaaaa; |
| 150 | GAFR2_U = 0x00000002; |
| 151 | |
| 152 | /* Direction Register */ |
| 153 | GPDR0 = 0xd3f0904c; |
| 154 | GPDR1 = 0xfcffb7d3; |
| 155 | GPDR2 = 0x0001ffff; |
| 156 | |
| 157 | /* Output Register */ |
| 158 | GPCR0 = 0x00000000; |
| 159 | GPCR1 = 0x00000000; |
| 160 | GPCR2 = 0x00000000; |
| 161 | |
| 162 | GPSR0 = 0x00400000; |
| 163 | GPSR1 = 0x00000000; |
| 164 | GPSR2 = 0x00000000; |
| 165 | |
| 166 | set_pxa_fb_info(&poodle_fb_info); |
| 167 | |
Richard Purdie | 0ce7625 | 2005-09-05 20:49:54 +0100 | [diff] [blame] | 168 | scoop_num = 1; |
| 169 | scoop_devs = &poodle_pcmcia_scoop[0]; |
| 170 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 172 | if (ret) { |
| 173 | printk(KERN_WARNING "poodle: Unable to register LoCoMo device\n"); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | static void __init fixup_poodle(struct machine_desc *desc, |
| 178 | struct tag *tags, char **cmdline, struct meminfo *mi) |
| 179 | { |
| 180 | sharpsl_save_param(); |
| 181 | } |
| 182 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | MACHINE_START(POODLE, "SHARP Poodle") |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 184 | .phys_ram = 0xa0000000, |
| 185 | .phys_io = 0x40000000, |
Russell King | 68070bd | 2005-07-04 10:44:34 +0100 | [diff] [blame] | 186 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 187 | .fixup = fixup_poodle, |
Richard Purdie | f29d245 | 2005-09-15 14:53:22 +0100 | [diff] [blame^] | 188 | .map_io = pxa_map_io, |
Russell King | e9dea0c | 2005-07-03 17:38:58 +0100 | [diff] [blame] | 189 | .init_irq = pxa_init_irq, |
| 190 | .timer = &pxa_timer, |
| 191 | .init_machine = poodle_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 192 | MACHINE_END |