Commit 1d0ad843b08f7655b8ac011bca1e3e0c69a554de
Committed by
Thomas Kunze
1 parent
f151ccf76b
Exists in
master
and in
4 other branches
collie: prepare for gpiolib use
prefix gpio definitions for direct register access with '_' so we can use the other names for gpio_request & co
Showing 2 changed files with 33 additions and 21 deletions Inline Diff
arch/arm/mach-sa1100/collie.c
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-sa1100/collie.c | 2 | * linux/arch/arm/mach-sa1100/collie.c |
| 3 | * | 3 | * |
| 4 | * May be copied or modified under the terms of the GNU General Public | 4 | * May be copied or modified under the terms of the GNU General Public |
| 5 | * License. See linux/COPYING for more information. | 5 | * License. See linux/COPYING for more information. |
| 6 | * | 6 | * |
| 7 | * This file contains all Collie-specific tweaks. | 7 | * This file contains all Collie-specific tweaks. |
| 8 | * | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify | 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 | 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
| 12 | * | 12 | * |
| 13 | * ChangeLog: | 13 | * ChangeLog: |
| 14 | * 2006 Pavel Machek <pavel@suse.cz> | 14 | * 2006 Pavel Machek <pavel@suse.cz> |
| 15 | * 03-06-2004 John Lenz <lenz@cs.wisc.edu> | 15 | * 03-06-2004 John Lenz <lenz@cs.wisc.edu> |
| 16 | * 06-04-2002 Chris Larson <kergoth@digitalnemesis.net> | 16 | * 06-04-2002 Chris Larson <kergoth@digitalnemesis.net> |
| 17 | * 04-16-2001 Lineo Japan,Inc. ... | 17 | * 04-16-2001 Lineo Japan,Inc. ... |
| 18 | */ | 18 | */ |
| 19 | 19 | ||
| 20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/tty.h> | 22 | #include <linux/tty.h> |
| 23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/mtd/mtd.h> | 25 | #include <linux/mtd/mtd.h> |
| 26 | #include <linux/mtd/partitions.h> | 26 | #include <linux/mtd/partitions.h> |
| 27 | #include <linux/timer.h> | 27 | #include <linux/timer.h> |
| 28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
| 29 | 29 | ||
| 30 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
| 31 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
| 32 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
| 33 | #include <asm/setup.h> | 33 | #include <asm/setup.h> |
| 34 | #include <mach/collie.h> | 34 | #include <mach/collie.h> |
| 35 | 35 | ||
| 36 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
| 37 | #include <asm/mach/flash.h> | 37 | #include <asm/mach/flash.h> |
| 38 | #include <asm/mach/map.h> | 38 | #include <asm/mach/map.h> |
| 39 | #include <asm/mach/serial_sa1100.h> | 39 | #include <asm/mach/serial_sa1100.h> |
| 40 | 40 | ||
| 41 | #include <asm/hardware/scoop.h> | 41 | #include <asm/hardware/scoop.h> |
| 42 | #include <asm/mach/sharpsl_param.h> | 42 | #include <asm/mach/sharpsl_param.h> |
| 43 | #include <asm/hardware/locomo.h> | 43 | #include <asm/hardware/locomo.h> |
| 44 | #include <mach/mcp.h> | 44 | #include <mach/mcp.h> |
| 45 | 45 | ||
| 46 | #include "generic.h" | 46 | #include "generic.h" |
| 47 | 47 | ||
| 48 | static struct resource collie_scoop_resources[] = { | 48 | static struct resource collie_scoop_resources[] = { |
| 49 | [0] = { | 49 | [0] = { |
| 50 | .start = 0x40800000, | 50 | .start = 0x40800000, |
| 51 | .end = 0x40800fff, | 51 | .end = 0x40800fff, |
| 52 | .flags = IORESOURCE_MEM, | 52 | .flags = IORESOURCE_MEM, |
| 53 | }, | 53 | }, |
| 54 | }; | 54 | }; |
| 55 | 55 | ||
| 56 | static struct scoop_config collie_scoop_setup = { | 56 | static struct scoop_config collie_scoop_setup = { |
| 57 | .io_dir = COLLIE_SCOOP_IO_DIR, | 57 | .io_dir = COLLIE_SCOOP_IO_DIR, |
| 58 | .io_out = COLLIE_SCOOP_IO_OUT, | 58 | .io_out = COLLIE_SCOOP_IO_OUT, |
| 59 | .gpio_base = COLLIE_SCOOP_GPIO_BASE, | 59 | .gpio_base = COLLIE_SCOOP_GPIO_BASE, |
| 60 | }; | 60 | }; |
| 61 | 61 | ||
| 62 | struct platform_device colliescoop_device = { | 62 | struct platform_device colliescoop_device = { |
| 63 | .name = "sharp-scoop", | 63 | .name = "sharp-scoop", |
| 64 | .id = -1, | 64 | .id = -1, |
| 65 | .dev = { | 65 | .dev = { |
| 66 | .platform_data = &collie_scoop_setup, | 66 | .platform_data = &collie_scoop_setup, |
| 67 | }, | 67 | }, |
| 68 | .num_resources = ARRAY_SIZE(collie_scoop_resources), | 68 | .num_resources = ARRAY_SIZE(collie_scoop_resources), |
| 69 | .resource = collie_scoop_resources, | 69 | .resource = collie_scoop_resources, |
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | static struct scoop_pcmcia_dev collie_pcmcia_scoop[] = { | 72 | static struct scoop_pcmcia_dev collie_pcmcia_scoop[] = { |
| 73 | { | 73 | { |
| 74 | .dev = &colliescoop_device.dev, | 74 | .dev = &colliescoop_device.dev, |
| 75 | .irq = COLLIE_IRQ_GPIO_CF_IRQ, | 75 | .irq = COLLIE_IRQ_GPIO_CF_IRQ, |
| 76 | .cd_irq = COLLIE_IRQ_GPIO_CF_CD, | 76 | .cd_irq = COLLIE_IRQ_GPIO_CF_CD, |
| 77 | .cd_irq_str = "PCMCIA0 CD", | 77 | .cd_irq_str = "PCMCIA0 CD", |
| 78 | }, | 78 | }, |
| 79 | }; | 79 | }; |
| 80 | 80 | ||
| 81 | static struct scoop_pcmcia_config collie_pcmcia_config = { | 81 | static struct scoop_pcmcia_config collie_pcmcia_config = { |
| 82 | .devs = &collie_pcmcia_scoop[0], | 82 | .devs = &collie_pcmcia_scoop[0], |
| 83 | .num_devs = 1, | 83 | .num_devs = 1, |
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | static struct mcp_plat_data collie_mcp_data = { | 86 | static struct mcp_plat_data collie_mcp_data = { |
| 87 | .mccr0 = MCCR0_ADM | MCCR0_ExtClk, | 87 | .mccr0 = MCCR0_ADM | MCCR0_ExtClk, |
| 88 | .sclk_rate = 9216000, | 88 | .sclk_rate = 9216000, |
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | #ifdef CONFIG_SHARP_LOCOMO | 91 | #ifdef CONFIG_SHARP_LOCOMO |
| 92 | /* | 92 | /* |
| 93 | * low-level UART features. | 93 | * low-level UART features. |
| 94 | */ | 94 | */ |
| 95 | struct platform_device collie_locomo_device; | 95 | struct platform_device collie_locomo_device; |
| 96 | 96 | ||
| 97 | static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl) | 97 | static void collie_uart_set_mctrl(struct uart_port *port, u_int mctrl) |
| 98 | { | 98 | { |
| 99 | if (mctrl & TIOCM_RTS) | 99 | if (mctrl & TIOCM_RTS) |
| 100 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0); | 100 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 0); |
| 101 | else | 101 | else |
| 102 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1); | 102 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_RTS, 1); |
| 103 | 103 | ||
| 104 | if (mctrl & TIOCM_DTR) | 104 | if (mctrl & TIOCM_DTR) |
| 105 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0); | 105 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 0); |
| 106 | else | 106 | else |
| 107 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1); | 107 | locomo_gpio_write(&collie_locomo_device.dev, LOCOMO_GPIO_DTR, 1); |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static u_int collie_uart_get_mctrl(struct uart_port *port) | 110 | static u_int collie_uart_get_mctrl(struct uart_port *port) |
| 111 | { | 111 | { |
| 112 | int ret = TIOCM_CD; | 112 | int ret = TIOCM_CD; |
| 113 | unsigned int r; | 113 | unsigned int r; |
| 114 | 114 | ||
| 115 | r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR); | 115 | r = locomo_gpio_read_output(&collie_locomo_device.dev, LOCOMO_GPIO_CTS & LOCOMO_GPIO_DSR); |
| 116 | if (r == -ENODEV) | 116 | if (r == -ENODEV) |
| 117 | return ret; | 117 | return ret; |
| 118 | if (r & LOCOMO_GPIO_CTS) | 118 | if (r & LOCOMO_GPIO_CTS) |
| 119 | ret |= TIOCM_CTS; | 119 | ret |= TIOCM_CTS; |
| 120 | if (r & LOCOMO_GPIO_DSR) | 120 | if (r & LOCOMO_GPIO_DSR) |
| 121 | ret |= TIOCM_DSR; | 121 | ret |= TIOCM_DSR; |
| 122 | 122 | ||
| 123 | return ret; | 123 | return ret; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | static struct sa1100_port_fns collie_port_fns __initdata = { | 126 | static struct sa1100_port_fns collie_port_fns __initdata = { |
| 127 | .set_mctrl = collie_uart_set_mctrl, | 127 | .set_mctrl = collie_uart_set_mctrl, |
| 128 | .get_mctrl = collie_uart_get_mctrl, | 128 | .get_mctrl = collie_uart_get_mctrl, |
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | static int collie_uart_probe(struct locomo_dev *dev) | 131 | static int collie_uart_probe(struct locomo_dev *dev) |
| 132 | { | 132 | { |
| 133 | return 0; | 133 | return 0; |
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | static int collie_uart_remove(struct locomo_dev *dev) | 136 | static int collie_uart_remove(struct locomo_dev *dev) |
| 137 | { | 137 | { |
| 138 | return 0; | 138 | return 0; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | static struct locomo_driver collie_uart_driver = { | 141 | static struct locomo_driver collie_uart_driver = { |
| 142 | .drv = { | 142 | .drv = { |
| 143 | .name = "collie_uart", | 143 | .name = "collie_uart", |
| 144 | }, | 144 | }, |
| 145 | .devid = LOCOMO_DEVID_UART, | 145 | .devid = LOCOMO_DEVID_UART, |
| 146 | .probe = collie_uart_probe, | 146 | .probe = collie_uart_probe, |
| 147 | .remove = collie_uart_remove, | 147 | .remove = collie_uart_remove, |
| 148 | }; | 148 | }; |
| 149 | 149 | ||
| 150 | static int __init collie_uart_init(void) | 150 | static int __init collie_uart_init(void) |
| 151 | { | 151 | { |
| 152 | return locomo_driver_register(&collie_uart_driver); | 152 | return locomo_driver_register(&collie_uart_driver); |
| 153 | } | 153 | } |
| 154 | device_initcall(collie_uart_init); | 154 | device_initcall(collie_uart_init); |
| 155 | 155 | ||
| 156 | #endif | 156 | #endif |
| 157 | 157 | ||
| 158 | 158 | ||
| 159 | static struct resource locomo_resources[] = { | 159 | static struct resource locomo_resources[] = { |
| 160 | [0] = { | 160 | [0] = { |
| 161 | .start = 0x40000000, | 161 | .start = 0x40000000, |
| 162 | .end = 0x40001fff, | 162 | .end = 0x40001fff, |
| 163 | .flags = IORESOURCE_MEM, | 163 | .flags = IORESOURCE_MEM, |
| 164 | }, | 164 | }, |
| 165 | [1] = { | 165 | [1] = { |
| 166 | .start = IRQ_GPIO25, | 166 | .start = IRQ_GPIO25, |
| 167 | .end = IRQ_GPIO25, | 167 | .end = IRQ_GPIO25, |
| 168 | .flags = IORESOURCE_IRQ, | 168 | .flags = IORESOURCE_IRQ, |
| 169 | }, | 169 | }, |
| 170 | }; | 170 | }; |
| 171 | 171 | ||
| 172 | struct platform_device collie_locomo_device = { | 172 | struct platform_device collie_locomo_device = { |
| 173 | .name = "locomo", | 173 | .name = "locomo", |
| 174 | .id = 0, | 174 | .id = 0, |
| 175 | .num_resources = ARRAY_SIZE(locomo_resources), | 175 | .num_resources = ARRAY_SIZE(locomo_resources), |
| 176 | .resource = locomo_resources, | 176 | .resource = locomo_resources, |
| 177 | }; | 177 | }; |
| 178 | 178 | ||
| 179 | static struct platform_device *devices[] __initdata = { | 179 | static struct platform_device *devices[] __initdata = { |
| 180 | &collie_locomo_device, | 180 | &collie_locomo_device, |
| 181 | &colliescoop_device, | 181 | &colliescoop_device, |
| 182 | }; | 182 | }; |
| 183 | 183 | ||
| 184 | static struct mtd_partition collie_partitions[] = { | 184 | static struct mtd_partition collie_partitions[] = { |
| 185 | { | 185 | { |
| 186 | .name = "bootloader", | 186 | .name = "bootloader", |
| 187 | .offset = 0, | 187 | .offset = 0, |
| 188 | .size = 0x000C0000, | 188 | .size = 0x000C0000, |
| 189 | .mask_flags = MTD_WRITEABLE | 189 | .mask_flags = MTD_WRITEABLE |
| 190 | }, { | 190 | }, { |
| 191 | .name = "kernel", | 191 | .name = "kernel", |
| 192 | .offset = MTDPART_OFS_APPEND, | 192 | .offset = MTDPART_OFS_APPEND, |
| 193 | .size = 0x00100000, | 193 | .size = 0x00100000, |
| 194 | }, { | 194 | }, { |
| 195 | .name = "rootfs", | 195 | .name = "rootfs", |
| 196 | .offset = MTDPART_OFS_APPEND, | 196 | .offset = MTDPART_OFS_APPEND, |
| 197 | .size = 0x00e20000, | 197 | .size = 0x00e20000, |
| 198 | } | 198 | } |
| 199 | }; | 199 | }; |
| 200 | 200 | ||
| 201 | static int collie_flash_init(void) | 201 | static int collie_flash_init(void) |
| 202 | { | 202 | { |
| 203 | int rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable"); | 203 | int rc = gpio_request(COLLIE_GPIO_VPEN, "flash Vpp enable"); |
| 204 | if (rc) | 204 | if (rc) |
| 205 | return rc; | 205 | return rc; |
| 206 | 206 | ||
| 207 | rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1); | 207 | rc = gpio_direction_output(COLLIE_GPIO_VPEN, 1); |
| 208 | if (rc) | 208 | if (rc) |
| 209 | gpio_free(COLLIE_GPIO_VPEN); | 209 | gpio_free(COLLIE_GPIO_VPEN); |
| 210 | 210 | ||
| 211 | return rc; | 211 | return rc; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | static void collie_set_vpp(int vpp) | 214 | static void collie_set_vpp(int vpp) |
| 215 | { | 215 | { |
| 216 | gpio_set_value(COLLIE_GPIO_VPEN, vpp); | 216 | gpio_set_value(COLLIE_GPIO_VPEN, vpp); |
| 217 | } | 217 | } |
| 218 | 218 | ||
| 219 | static void collie_flash_exit(void) | 219 | static void collie_flash_exit(void) |
| 220 | { | 220 | { |
| 221 | gpio_free(COLLIE_GPIO_VPEN); | 221 | gpio_free(COLLIE_GPIO_VPEN); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static struct flash_platform_data collie_flash_data = { | 224 | static struct flash_platform_data collie_flash_data = { |
| 225 | .map_name = "cfi_probe", | 225 | .map_name = "cfi_probe", |
| 226 | .init = collie_flash_init, | 226 | .init = collie_flash_init, |
| 227 | .set_vpp = collie_set_vpp, | 227 | .set_vpp = collie_set_vpp, |
| 228 | .exit = collie_flash_exit, | 228 | .exit = collie_flash_exit, |
| 229 | .parts = collie_partitions, | 229 | .parts = collie_partitions, |
| 230 | .nr_parts = ARRAY_SIZE(collie_partitions), | 230 | .nr_parts = ARRAY_SIZE(collie_partitions), |
| 231 | }; | 231 | }; |
| 232 | 232 | ||
| 233 | static struct resource collie_flash_resources[] = { | 233 | static struct resource collie_flash_resources[] = { |
| 234 | { | 234 | { |
| 235 | .start = SA1100_CS0_PHYS, | 235 | .start = SA1100_CS0_PHYS, |
| 236 | .end = SA1100_CS0_PHYS + SZ_32M - 1, | 236 | .end = SA1100_CS0_PHYS + SZ_32M - 1, |
| 237 | .flags = IORESOURCE_MEM, | 237 | .flags = IORESOURCE_MEM, |
| 238 | } | 238 | } |
| 239 | }; | 239 | }; |
| 240 | 240 | ||
| 241 | static void __init collie_init(void) | 241 | static void __init collie_init(void) |
| 242 | { | 242 | { |
| 243 | int ret = 0; | 243 | int ret = 0; |
| 244 | 244 | ||
| 245 | /* cpu initialize */ | 245 | /* cpu initialize */ |
| 246 | GAFR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK | | 246 | GAFR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK | |
| 247 | GPIO_MCP_CLK | GPIO_32_768kHz; | 247 | GPIO_MCP_CLK | GPIO_32_768kHz; |
| 248 | 248 | ||
| 249 | GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 | | 249 | GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 | |
| 250 | GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD | | 250 | GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD | |
| 251 | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK | | 251 | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK | |
| 252 | COLLIE_GPIO_UCB1x00_RESET | COLLIE_GPIO_nMIC_ON | | 252 | _COLLIE_GPIO_UCB1x00_RESET | _COLLIE_GPIO_nMIC_ON | |
| 253 | COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz; | 253 | _COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz; |
| 254 | 254 | ||
| 255 | PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 | | 255 | PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 | |
| 256 | PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS | | 256 | PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS | |
| 257 | PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM; | 257 | PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM; |
| 258 | 258 | ||
| 259 | PWER = COLLIE_GPIO_AC_IN | COLLIE_GPIO_CO | COLLIE_GPIO_ON_KEY | | 259 | PWER = _COLLIE_GPIO_AC_IN | _COLLIE_GPIO_CO | _COLLIE_GPIO_ON_KEY | |
| 260 | COLLIE_GPIO_WAKEUP | COLLIE_GPIO_nREMOCON_INT | PWER_RTC; | 260 | _COLLIE_GPIO_WAKEUP | _COLLIE_GPIO_nREMOCON_INT | PWER_RTC; |
| 261 | 261 | ||
| 262 | PGSR = COLLIE_GPIO_nREMOCON_ON; | 262 | PGSR = _COLLIE_GPIO_nREMOCON_ON; |
| 263 | 263 | ||
| 264 | PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4; | 264 | PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4; |
| 265 | 265 | ||
| 266 | PCFR = PCFR_OPDE; | 266 | PCFR = PCFR_OPDE; |
| 267 | |||
| 268 | GPSR |= _COLLIE_GPIO_UCB1x00_RESET; | ||
| 267 | 269 | ||
| 268 | 270 | ||
| 269 | platform_scoop_config = &collie_pcmcia_config; | 271 | platform_scoop_config = &collie_pcmcia_config; |
| 270 | 272 | ||
| 271 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | 273 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); |
| 272 | if (ret) { | 274 | if (ret) { |
| 273 | printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); | 275 | printk(KERN_WARNING "collie: Unable to register LoCoMo device\n"); |
| 274 | } | 276 | } |
| 275 | 277 | ||
| 276 | sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources, | 278 | sa11x0_set_flash_data(&collie_flash_data, collie_flash_resources, |
| 277 | ARRAY_SIZE(collie_flash_resources)); | 279 | ARRAY_SIZE(collie_flash_resources)); |
| 278 | sa11x0_set_mcp_data(&collie_mcp_data); | 280 | sa11x0_set_mcp_data(&collie_mcp_data); |
| 279 | 281 | ||
| 280 | sharpsl_save_param(); | 282 | sharpsl_save_param(); |
| 281 | } | 283 | } |
| 282 | 284 | ||
| 283 | static struct map_desc collie_io_desc[] __initdata = { | 285 | static struct map_desc collie_io_desc[] __initdata = { |
| 284 | { /* 32M main flash (cs0) */ | 286 | { /* 32M main flash (cs0) */ |
| 285 | .virtual = 0xe8000000, | 287 | .virtual = 0xe8000000, |
| 286 | .pfn = __phys_to_pfn(0x00000000), | 288 | .pfn = __phys_to_pfn(0x00000000), |
| 287 | .length = 0x02000000, | 289 | .length = 0x02000000, |
| 288 | .type = MT_DEVICE | 290 | .type = MT_DEVICE |
| 289 | }, { /* 32M boot flash (cs1) */ | 291 | }, { /* 32M boot flash (cs1) */ |
| 290 | .virtual = 0xea000000, | 292 | .virtual = 0xea000000, |
| 291 | .pfn = __phys_to_pfn(0x08000000), | 293 | .pfn = __phys_to_pfn(0x08000000), |
| 292 | .length = 0x02000000, | 294 | .length = 0x02000000, |
| 293 | .type = MT_DEVICE | 295 | .type = MT_DEVICE |
| 294 | } | 296 | } |
| 295 | }; | 297 | }; |
| 296 | 298 | ||
| 297 | static void __init collie_map_io(void) | 299 | static void __init collie_map_io(void) |
| 298 | { | 300 | { |
| 299 | sa1100_map_io(); | 301 | sa1100_map_io(); |
| 300 | iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc)); | 302 | iotable_init(collie_io_desc, ARRAY_SIZE(collie_io_desc)); |
| 301 | 303 | ||
| 302 | #ifdef CONFIG_SHARP_LOCOMO | 304 | #ifdef CONFIG_SHARP_LOCOMO |
| 303 | sa1100_register_uart_fns(&collie_port_fns); | 305 | sa1100_register_uart_fns(&collie_port_fns); |
| 304 | #endif | 306 | #endif |
| 305 | sa1100_register_uart(0, 3); | 307 | sa1100_register_uart(0, 3); |
| 306 | sa1100_register_uart(1, 1); | 308 | sa1100_register_uart(1, 1); |
| 307 | } | 309 | } |
| 308 | 310 | ||
| 309 | MACHINE_START(COLLIE, "Sharp-Collie") | 311 | MACHINE_START(COLLIE, "Sharp-Collie") |
| 310 | .phys_io = 0x80000000, | 312 | .phys_io = 0x80000000, |
| 311 | .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, | 313 | .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, |
| 312 | .map_io = collie_map_io, | 314 | .map_io = collie_map_io, |
| 313 | .init_irq = sa1100_init_irq, | 315 | .init_irq = sa1100_init_irq, |
| 314 | .timer = &sa1100_timer, | 316 | .timer = &sa1100_timer, |
| 315 | .init_machine = collie_init, | 317 | .init_machine = collie_init, |
| 316 | MACHINE_END | 318 | MACHINE_END |
| 317 | 319 |
arch/arm/mach-sa1100/include/mach/collie.h
| 1 | /* | 1 | /* |
| 2 | * arch/arm/mach-sa1100/include/mach/collie.h | 2 | * arch/arm/mach-sa1100/include/mach/collie.h |
| 3 | * | 3 | * |
| 4 | * This file contains the hardware specific definitions for Assabet | 4 | * This file contains the hardware specific definitions for Assabet |
| 5 | * Only include this file from SA1100-specific files. | 5 | * Only include this file from SA1100-specific files. |
| 6 | * | 6 | * |
| 7 | * ChangeLog: | 7 | * ChangeLog: |
| 8 | * 04-06-2001 Lineo Japan, Inc. | 8 | * 04-06-2001 Lineo Japan, Inc. |
| 9 | * 04-16-2001 SHARP Corporation | 9 | * 04-16-2001 SHARP Corporation |
| 10 | * 07-07-2002 Chris Larson <clarson@digi.com> | 10 | * 07-07-2002 Chris Larson <clarson@digi.com> |
| 11 | * | 11 | * |
| 12 | */ | 12 | */ |
| 13 | #ifndef __ASM_ARCH_COLLIE_H | 13 | #ifndef __ASM_ARCH_COLLIE_H |
| 14 | #define __ASM_ARCH_COLLIE_H | 14 | #define __ASM_ARCH_COLLIE_H |
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) | 17 | #define COLLIE_SCOOP_GPIO_BASE (GPIO_MAX + 1) |
| 18 | #define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0) | 18 | #define COLLIE_GPIO_CHARGE_ON (COLLIE_SCOOP_GPIO_BASE + 0) |
| 19 | #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 | 19 | #define COLLIE_SCP_DIAG_BOOT1 SCOOP_GPCR_PA12 |
| 20 | #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 | 20 | #define COLLIE_SCP_DIAG_BOOT2 SCOOP_GPCR_PA13 |
| 21 | #define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14 | 21 | #define COLLIE_SCP_MUTE_L SCOOP_GPCR_PA14 |
| 22 | #define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15 | 22 | #define COLLIE_SCP_MUTE_R SCOOP_GPCR_PA15 |
| 23 | #define COLLIE_SCP_5VON SCOOP_GPCR_PA16 | 23 | #define COLLIE_SCP_5VON SCOOP_GPCR_PA16 |
| 24 | #define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17 | 24 | #define COLLIE_SCP_AMP_ON SCOOP_GPCR_PA17 |
| 25 | #define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) | 25 | #define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7) |
| 26 | #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 | 26 | #define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 |
| 27 | 27 | ||
| 28 | #define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ | 28 | #define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ |
| 29 | COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ | 29 | COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ |
| 30 | COLLIE_SCP_LB_VOL_CHG ) | 30 | COLLIE_SCP_LB_VOL_CHG ) |
| 31 | #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R ) | 31 | #define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R ) |
| 32 | 32 | ||
| 33 | /* GPIOs for which the generic definition doesn't say much */ | 33 | /* GPIOs for gpiolib */ |
| 34 | 34 | ||
| 35 | #define COLLIE_GPIO_ON_KEY GPIO_GPIO (0) | 35 | #define COLLIE_GPIO_ON_KEY (0) |
| 36 | #define COLLIE_GPIO_AC_IN GPIO_GPIO (1) | 36 | #define COLLIE_GPIO_AC_IN (1) |
| 37 | #define COLLIE_GPIO_SDIO_INT GPIO_GPIO (11) | 37 | #define COLLIE_GPIO_SDIO_INT (11) |
| 38 | #define COLLIE_GPIO_CF_IRQ GPIO_GPIO (14) | 38 | #define COLLIE_GPIO_CF_IRQ (14) |
| 39 | #define COLLIE_GPIO_nREMOCON_INT GPIO_GPIO (15) | 39 | #define COLLIE_GPIO_nREMOCON_INT (15) |
| 40 | #define COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO (16) | 40 | #define COLLIE_GPIO_UCB1x00_RESET (16) |
| 41 | #define COLLIE_GPIO_nMIC_ON GPIO_GPIO (17) | 41 | #define COLLIE_GPIO_nMIC_ON (17) |
| 42 | #define COLLIE_GPIO_nREMOCON_ON GPIO_GPIO (18) | 42 | #define COLLIE_GPIO_nREMOCON_ON (18) |
| 43 | #define COLLIE_GPIO_CO GPIO_GPIO (20) | 43 | #define COLLIE_GPIO_CO (20) |
| 44 | #define COLLIE_GPIO_MCP_CLK GPIO_GPIO (21) | 44 | #define COLLIE_GPIO_MCP_CLK (21) |
| 45 | #define COLLIE_GPIO_CF_CD GPIO_GPIO (22) | 45 | #define COLLIE_GPIO_CF_CD (22) |
| 46 | #define COLLIE_GPIO_UCB1x00_IRQ GPIO_GPIO (23) | 46 | #define COLLIE_GPIO_UCB1x00_IRQ (23) |
| 47 | #define COLLIE_GPIO_WAKEUP GPIO_GPIO (24) | 47 | #define COLLIE_GPIO_WAKEUP (24) |
| 48 | #define COLLIE_GPIO_GA_INT GPIO_GPIO (25) | 48 | #define COLLIE_GPIO_GA_INT (25) |
| 49 | #define COLLIE_GPIO_MAIN_BAT_LOW GPIO_GPIO (26) | 49 | #define COLLIE_GPIO_MAIN_BAT_LOW (26) |
| 50 | 50 | ||
| 51 | /* GPIO definitions for direct register access */ | ||
| 52 | |||
| 53 | #define _COLLIE_GPIO_ON_KEY GPIO_GPIO(0) | ||
| 54 | #define _COLLIE_GPIO_AC_IN GPIO_GPIO(1) | ||
| 55 | #define _COLLIE_GPIO_nREMOCON_INT GPIO_GPIO(15) | ||
| 56 | #define _COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO(16) | ||
| 57 | #define _COLLIE_GPIO_nMIC_ON GPIO_GPIO(17) | ||
| 58 | #define _COLLIE_GPIO_nREMOCON_ON GPIO_GPIO(18) | ||
| 59 | #define _COLLIE_GPIO_CO GPIO_GPIO(20) | ||
| 60 | #define _COLLIE_GPIO_WAKEUP GPIO_GPIO(24) | ||
| 51 | /* Interrupts */ | 61 | /* Interrupts */ |
| 52 | 62 | ||
| 53 | #define COLLIE_IRQ_GPIO_ON_KEY IRQ_GPIO0 | 63 | #define COLLIE_IRQ_GPIO_ON_KEY IRQ_GPIO0 |
| 54 | #define COLLIE_IRQ_GPIO_AC_IN IRQ_GPIO1 | 64 | #define COLLIE_IRQ_GPIO_AC_IN IRQ_GPIO1 |
| 55 | #define COLLIE_IRQ_GPIO_SDIO_IRQ IRQ_GPIO11 | 65 | #define COLLIE_IRQ_GPIO_SDIO_IRQ IRQ_GPIO11 |
| 56 | #define COLLIE_IRQ_GPIO_CF_IRQ IRQ_GPIO14 | 66 | #define COLLIE_IRQ_GPIO_CF_IRQ IRQ_GPIO14 |
| 57 | #define COLLIE_IRQ_GPIO_nREMOCON_INT IRQ_GPIO15 | 67 | #define COLLIE_IRQ_GPIO_nREMOCON_INT IRQ_GPIO15 |
| 58 | #define COLLIE_IRQ_GPIO_CO IRQ_GPIO20 | 68 | #define COLLIE_IRQ_GPIO_CO IRQ_GPIO20 |
| 59 | #define COLLIE_IRQ_GPIO_CF_CD IRQ_GPIO22 | 69 | #define COLLIE_IRQ_GPIO_CF_CD IRQ_GPIO22 |
| 60 | #define COLLIE_IRQ_GPIO_UCB1x00_IRQ IRQ_GPIO23 | 70 | #define COLLIE_IRQ_GPIO_UCB1x00_IRQ IRQ_GPIO23 |
| 61 | #define COLLIE_IRQ_GPIO_WAKEUP IRQ_GPIO24 | 71 | #define COLLIE_IRQ_GPIO_WAKEUP IRQ_GPIO24 |
| 62 | #define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25 | 72 | #define COLLIE_IRQ_GPIO_GA_INT IRQ_GPIO25 |
| 63 | #define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26 | 73 | #define COLLIE_IRQ_GPIO_MAIN_BAT_LOW IRQ_GPIO26 |
| 64 | 74 | ||
| 65 | #define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0 | 75 | #define COLLIE_LCM_IRQ_GPIO_RTS IRQ_LOCOMO_GPIO0 |
| 66 | #define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1 | 76 | #define COLLIE_LCM_IRQ_GPIO_CTS IRQ_LOCOMO_GPIO1 |
| 67 | #define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2 | 77 | #define COLLIE_LCM_IRQ_GPIO_DSR IRQ_LOCOMO_GPIO2 |
| 68 | #define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3 | 78 | #define COLLIE_LCM_IRQ_GPIO_DTR IRQ_LOCOMO_GPIO3 |
| 69 | #define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13 | 79 | #define COLLIE_LCM_IRQ_GPIO_nSD_DETECT IRQ_LOCOMO_GPIO13 |
| 70 | #define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14 | 80 | #define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14 |
| 71 | 81 | ||
| 72 | /* GPIO's on the TC35143AF (Toshiba Analog Frontend) */ | 82 | /* GPIO's on the TC35143AF (Toshiba Analog Frontend) */ |
| 73 | #define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 /* GPIO0=Version */ | 83 | #define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 /* GPIO0=Version */ |
| 74 | #define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 /* GPIO1=TBL_CHK */ | 84 | #define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 /* GPIO1=TBL_CHK */ |
| 75 | #define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 /* GPIO2=VPNE_ON */ | 85 | #define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 /* GPIO2=VPNE_ON */ |
| 76 | #define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 /* GPIO3=IR_ON */ | 86 | #define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 /* GPIO3=IR_ON */ |
| 77 | #define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 /* GPIO4=AMP_ON */ | 87 | #define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 /* GPIO4=AMP_ON */ |
| 78 | #define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 /* GPIO5=Version */ | 88 | #define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 /* GPIO5=Version */ |
| 79 | #define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 /* GPIO5=fs 8k LPF */ | 89 | #define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 /* GPIO5=fs 8k LPF */ |
| 80 | #define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6 /* GPIO6=BUZZER BIAS */ | 90 | #define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6 /* GPIO6=BUZZER BIAS */ |
| 81 | #define COLLIE_TC35143_GPIO_MBAT_ON UCB_IO_7 /* GPIO7=MBAT_ON */ | 91 | #define COLLIE_TC35143_GPIO_MBAT_ON UCB_IO_7 /* GPIO7=MBAT_ON */ |
| 82 | #define COLLIE_TC35143_GPIO_BBAT_ON UCB_IO_8 /* GPIO8=BBAT_ON */ | 92 | #define COLLIE_TC35143_GPIO_BBAT_ON UCB_IO_8 /* GPIO8=BBAT_ON */ |
| 83 | #define COLLIE_TC35143_GPIO_TMP_ON UCB_IO_9 /* GPIO9=TMP_ON */ | 93 | #define COLLIE_TC35143_GPIO_TMP_ON UCB_IO_9 /* GPIO9=TMP_ON */ |
| 84 | #define COLLIE_TC35143_GPIO_IN ( UCB_IO_0 | UCB_IO_2 | UCB_IO_5 ) | 94 | #define COLLIE_TC35143_GPIO_IN ( UCB_IO_0 | UCB_IO_2 | UCB_IO_5 ) |
| 85 | #define COLLIE_TC35143_GPIO_OUT ( UCB_IO_1 | UCB_IO_3 | UCB_IO_4 | UCB_IO_6 | \ | 95 | #define COLLIE_TC35143_GPIO_OUT ( UCB_IO_1 | UCB_IO_3 | UCB_IO_4 | UCB_IO_6 | \ |
| 86 | UCB_IO_7 | UCB_IO_8 | UCB_IO_9 ) | 96 | UCB_IO_7 | UCB_IO_8 | UCB_IO_9 ) |
| 87 | 97 | ||
| 88 | #endif | 98 | #endif |
| 89 | 99 |