diff options
Diffstat (limited to 'arch/arm/plat-s3c24xx')
27 files changed, 293 insertions, 2200 deletions
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig index 8c5b3029b39f..d8973ac46bc4 100644 --- a/arch/arm/plat-s3c24xx/Kconfig +++ b/arch/arm/plat-s3c24xx/Kconfig | |||
| @@ -9,7 +9,6 @@ config PLAT_S3C24XX | |||
| 9 | select NO_IOPORT | 9 | select NO_IOPORT |
| 10 | select ARCH_REQUIRE_GPIOLIB | 10 | select ARCH_REQUIRE_GPIOLIB |
| 11 | select S3C_DEV_NAND | 11 | select S3C_DEV_NAND |
| 12 | select S3C_GPIO_CFG_S3C24XX | ||
| 13 | help | 12 | help |
| 14 | Base platform code for any Samsung S3C24XX device | 13 | Base platform code for any Samsung S3C24XX device |
| 15 | 14 | ||
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile index 0291bd6e236e..b2b01125de66 100644 --- a/arch/arm/plat-s3c24xx/Makefile +++ b/arch/arm/plat-s3c24xx/Makefile | |||
| @@ -14,9 +14,7 @@ obj- := | |||
| 14 | 14 | ||
| 15 | obj-y += cpu.o | 15 | obj-y += cpu.o |
| 16 | obj-y += irq.o | 16 | obj-y += irq.o |
| 17 | obj-y += devs.o | 17 | obj-y += dev-uart.o |
| 18 | obj-y += gpio.o | ||
| 19 | obj-y += gpiolib.o | ||
| 20 | obj-y += clock.o | 18 | obj-y += clock.o |
| 21 | obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o | 19 | obj-$(CONFIG_S3C24XX_DCLK) += clock-dclk.o |
| 22 | 20 | ||
diff --git a/arch/arm/plat-s3c24xx/dev-uart.c b/arch/arm/plat-s3c24xx/dev-uart.c new file mode 100644 index 000000000000..9ab22e662fff --- /dev/null +++ b/arch/arm/plat-s3c24xx/dev-uart.c | |||
| @@ -0,0 +1,100 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/dev-uart.c | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Base S3C24XX UART resource and platform device definitions | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/kernel.h> | ||
| 14 | #include <linux/types.h> | ||
| 15 | #include <linux/interrupt.h> | ||
| 16 | #include <linux/list.h> | ||
| 17 | #include <linux/serial_core.h> | ||
| 18 | #include <linux/platform_device.h> | ||
| 19 | |||
| 20 | #include <asm/mach/arch.h> | ||
| 21 | #include <asm/mach/map.h> | ||
| 22 | #include <asm/mach/irq.h> | ||
| 23 | #include <mach/hardware.h> | ||
| 24 | #include <mach/map.h> | ||
| 25 | |||
| 26 | #include <plat/devs.h> | ||
| 27 | #include <plat/regs-serial.h> | ||
| 28 | |||
| 29 | /* Serial port registrations */ | ||
| 30 | |||
| 31 | static struct resource s3c2410_uart0_resource[] = { | ||
| 32 | [0] = { | ||
| 33 | .start = S3C2410_PA_UART0, | ||
| 34 | .end = S3C2410_PA_UART0 + 0x3fff, | ||
| 35 | .flags = IORESOURCE_MEM, | ||
| 36 | }, | ||
| 37 | [1] = { | ||
| 38 | .start = IRQ_S3CUART_RX0, | ||
| 39 | .end = IRQ_S3CUART_ERR0, | ||
| 40 | .flags = IORESOURCE_IRQ, | ||
| 41 | } | ||
| 42 | }; | ||
| 43 | |||
| 44 | static struct resource s3c2410_uart1_resource[] = { | ||
| 45 | [0] = { | ||
| 46 | .start = S3C2410_PA_UART1, | ||
| 47 | .end = S3C2410_PA_UART1 + 0x3fff, | ||
| 48 | .flags = IORESOURCE_MEM, | ||
| 49 | }, | ||
| 50 | [1] = { | ||
| 51 | .start = IRQ_S3CUART_RX1, | ||
| 52 | .end = IRQ_S3CUART_ERR1, | ||
| 53 | .flags = IORESOURCE_IRQ, | ||
| 54 | } | ||
| 55 | }; | ||
| 56 | |||
| 57 | static struct resource s3c2410_uart2_resource[] = { | ||
| 58 | [0] = { | ||
| 59 | .start = S3C2410_PA_UART2, | ||
| 60 | .end = S3C2410_PA_UART2 + 0x3fff, | ||
| 61 | .flags = IORESOURCE_MEM, | ||
| 62 | }, | ||
| 63 | [1] = { | ||
| 64 | .start = IRQ_S3CUART_RX2, | ||
| 65 | .end = IRQ_S3CUART_ERR2, | ||
| 66 | .flags = IORESOURCE_IRQ, | ||
| 67 | } | ||
| 68 | }; | ||
| 69 | |||
| 70 | static struct resource s3c2410_uart3_resource[] = { | ||
| 71 | [0] = { | ||
| 72 | .start = S3C2443_PA_UART3, | ||
| 73 | .end = S3C2443_PA_UART3 + 0x3fff, | ||
| 74 | .flags = IORESOURCE_MEM, | ||
| 75 | }, | ||
| 76 | [1] = { | ||
| 77 | .start = IRQ_S3CUART_RX3, | ||
| 78 | .end = IRQ_S3CUART_ERR3, | ||
| 79 | .flags = IORESOURCE_IRQ, | ||
| 80 | }, | ||
| 81 | }; | ||
| 82 | |||
| 83 | struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { | ||
| 84 | [0] = { | ||
| 85 | .resources = s3c2410_uart0_resource, | ||
| 86 | .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource), | ||
| 87 | }, | ||
| 88 | [1] = { | ||
| 89 | .resources = s3c2410_uart1_resource, | ||
| 90 | .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource), | ||
| 91 | }, | ||
| 92 | [2] = { | ||
| 93 | .resources = s3c2410_uart2_resource, | ||
| 94 | .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource), | ||
| 95 | }, | ||
| 96 | [3] = { | ||
| 97 | .resources = s3c2410_uart3_resource, | ||
| 98 | .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource), | ||
| 99 | }, | ||
| 100 | }; | ||
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c deleted file mode 100644 index a76bf2df3333..000000000000 --- a/arch/arm/plat-s3c24xx/devs.c +++ /dev/null | |||
| @@ -1,528 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/devs.c | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Base S3C24XX platform device definitions | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/interrupt.h> | ||
| 17 | #include <linux/list.h> | ||
| 18 | #include <linux/timer.h> | ||
| 19 | #include <linux/init.h> | ||
| 20 | #include <linux/serial_core.h> | ||
| 21 | #include <linux/platform_device.h> | ||
| 22 | #include <linux/io.h> | ||
| 23 | #include <linux/slab.h> | ||
| 24 | #include <linux/string.h> | ||
| 25 | #include <linux/dma-mapping.h> | ||
| 26 | |||
| 27 | #include <asm/mach/arch.h> | ||
| 28 | #include <asm/mach/map.h> | ||
| 29 | #include <asm/mach/irq.h> | ||
| 30 | #include <mach/fb.h> | ||
| 31 | #include <mach/hardware.h> | ||
| 32 | #include <mach/dma.h> | ||
| 33 | #include <mach/irqs.h> | ||
| 34 | #include <asm/irq.h> | ||
| 35 | |||
| 36 | #include <plat/regs-serial.h> | ||
| 37 | #include <plat/udc.h> | ||
| 38 | #include <plat/mci.h> | ||
| 39 | |||
| 40 | #include <plat/devs.h> | ||
| 41 | #include <plat/cpu.h> | ||
| 42 | #include <plat/regs-spi.h> | ||
| 43 | #include <plat/ts.h> | ||
| 44 | |||
| 45 | /* Serial port registrations */ | ||
| 46 | |||
| 47 | static struct resource s3c2410_uart0_resource[] = { | ||
| 48 | [0] = { | ||
| 49 | .start = S3C2410_PA_UART0, | ||
| 50 | .end = S3C2410_PA_UART0 + 0x3fff, | ||
| 51 | .flags = IORESOURCE_MEM, | ||
| 52 | }, | ||
| 53 | [1] = { | ||
| 54 | .start = IRQ_S3CUART_RX0, | ||
| 55 | .end = IRQ_S3CUART_ERR0, | ||
| 56 | .flags = IORESOURCE_IRQ, | ||
| 57 | } | ||
| 58 | }; | ||
| 59 | |||
| 60 | static struct resource s3c2410_uart1_resource[] = { | ||
| 61 | [0] = { | ||
| 62 | .start = S3C2410_PA_UART1, | ||
| 63 | .end = S3C2410_PA_UART1 + 0x3fff, | ||
| 64 | .flags = IORESOURCE_MEM, | ||
| 65 | }, | ||
| 66 | [1] = { | ||
| 67 | .start = IRQ_S3CUART_RX1, | ||
| 68 | .end = IRQ_S3CUART_ERR1, | ||
| 69 | .flags = IORESOURCE_IRQ, | ||
| 70 | } | ||
| 71 | }; | ||
| 72 | |||
| 73 | static struct resource s3c2410_uart2_resource[] = { | ||
| 74 | [0] = { | ||
| 75 | .start = S3C2410_PA_UART2, | ||
| 76 | .end = S3C2410_PA_UART2 + 0x3fff, | ||
| 77 | .flags = IORESOURCE_MEM, | ||
| 78 | }, | ||
| 79 | [1] = { | ||
| 80 | .start = IRQ_S3CUART_RX2, | ||
| 81 | .end = IRQ_S3CUART_ERR2, | ||
| 82 | .flags = IORESOURCE_IRQ, | ||
| 83 | } | ||
| 84 | }; | ||
| 85 | |||
| 86 | static struct resource s3c2410_uart3_resource[] = { | ||
| 87 | [0] = { | ||
| 88 | .start = S3C2443_PA_UART3, | ||
| 89 | .end = S3C2443_PA_UART3 + 0x3fff, | ||
| 90 | .flags = IORESOURCE_MEM, | ||
| 91 | }, | ||
| 92 | [1] = { | ||
| 93 | .start = IRQ_S3CUART_RX3, | ||
| 94 | .end = IRQ_S3CUART_ERR3, | ||
| 95 | .flags = IORESOURCE_IRQ, | ||
| 96 | }, | ||
| 97 | }; | ||
| 98 | |||
| 99 | struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = { | ||
| 100 | [0] = { | ||
| 101 | .resources = s3c2410_uart0_resource, | ||
| 102 | .nr_resources = ARRAY_SIZE(s3c2410_uart0_resource), | ||
| 103 | }, | ||
| 104 | [1] = { | ||
| 105 | .resources = s3c2410_uart1_resource, | ||
| 106 | .nr_resources = ARRAY_SIZE(s3c2410_uart1_resource), | ||
| 107 | }, | ||
| 108 | [2] = { | ||
| 109 | .resources = s3c2410_uart2_resource, | ||
| 110 | .nr_resources = ARRAY_SIZE(s3c2410_uart2_resource), | ||
| 111 | }, | ||
| 112 | [3] = { | ||
| 113 | .resources = s3c2410_uart3_resource, | ||
| 114 | .nr_resources = ARRAY_SIZE(s3c2410_uart3_resource), | ||
| 115 | }, | ||
| 116 | }; | ||
| 117 | |||
| 118 | /* LCD Controller */ | ||
| 119 | |||
| 120 | static struct resource s3c_lcd_resource[] = { | ||
| 121 | [0] = { | ||
| 122 | .start = S3C24XX_PA_LCD, | ||
| 123 | .end = S3C24XX_PA_LCD + S3C24XX_SZ_LCD - 1, | ||
| 124 | .flags = IORESOURCE_MEM, | ||
| 125 | }, | ||
| 126 | [1] = { | ||
| 127 | .start = IRQ_LCD, | ||
| 128 | .end = IRQ_LCD, | ||
| 129 | .flags = IORESOURCE_IRQ, | ||
| 130 | } | ||
| 131 | |||
| 132 | }; | ||
| 133 | |||
| 134 | static u64 s3c_device_lcd_dmamask = 0xffffffffUL; | ||
| 135 | |||
| 136 | struct platform_device s3c_device_lcd = { | ||
| 137 | .name = "s3c2410-lcd", | ||
| 138 | .id = -1, | ||
| 139 | .num_resources = ARRAY_SIZE(s3c_lcd_resource), | ||
| 140 | .resource = s3c_lcd_resource, | ||
| 141 | .dev = { | ||
| 142 | .dma_mask = &s3c_device_lcd_dmamask, | ||
| 143 | .coherent_dma_mask = 0xffffffffUL | ||
| 144 | } | ||
| 145 | }; | ||
| 146 | |||
| 147 | EXPORT_SYMBOL(s3c_device_lcd); | ||
| 148 | |||
| 149 | void __init s3c24xx_fb_set_platdata(struct s3c2410fb_mach_info *pd) | ||
| 150 | { | ||
| 151 | struct s3c2410fb_mach_info *npd; | ||
| 152 | |||
| 153 | npd = s3c_set_platdata(pd, sizeof(*npd), &s3c_device_lcd); | ||
| 154 | if (npd) { | ||
| 155 | npd->displays = kmemdup(pd->displays, | ||
| 156 | sizeof(struct s3c2410fb_display) * npd->num_displays, | ||
| 157 | GFP_KERNEL); | ||
| 158 | if (!npd->displays) | ||
| 159 | printk(KERN_ERR "no memory for LCD display data\n"); | ||
| 160 | } else { | ||
| 161 | printk(KERN_ERR "no memory for LCD platform data\n"); | ||
| 162 | } | ||
| 163 | } | ||
| 164 | |||
| 165 | /* Touchscreen */ | ||
| 166 | |||
| 167 | static struct resource s3c_ts_resource[] = { | ||
| 168 | [0] = { | ||
| 169 | .start = S3C24XX_PA_ADC, | ||
| 170 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | ||
| 171 | .flags = IORESOURCE_MEM, | ||
| 172 | }, | ||
| 173 | [1] = { | ||
| 174 | .start = IRQ_TC, | ||
| 175 | .end = IRQ_TC, | ||
| 176 | .flags = IORESOURCE_IRQ, | ||
| 177 | }, | ||
| 178 | |||
| 179 | }; | ||
| 180 | |||
| 181 | struct platform_device s3c_device_ts = { | ||
| 182 | .name = "s3c2410-ts", | ||
| 183 | .id = -1, | ||
| 184 | .dev.parent = &s3c_device_adc.dev, | ||
| 185 | .num_resources = ARRAY_SIZE(s3c_ts_resource), | ||
| 186 | .resource = s3c_ts_resource, | ||
| 187 | }; | ||
| 188 | EXPORT_SYMBOL(s3c_device_ts); | ||
| 189 | |||
| 190 | void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) | ||
| 191 | { | ||
| 192 | s3c_set_platdata(hard_s3c2410ts_info, | ||
| 193 | sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts); | ||
| 194 | } | ||
| 195 | |||
| 196 | /* USB Device (Gadget)*/ | ||
| 197 | |||
| 198 | static struct resource s3c_usbgadget_resource[] = { | ||
| 199 | [0] = { | ||
| 200 | .start = S3C24XX_PA_USBDEV, | ||
| 201 | .end = S3C24XX_PA_USBDEV + S3C24XX_SZ_USBDEV - 1, | ||
| 202 | .flags = IORESOURCE_MEM, | ||
| 203 | }, | ||
| 204 | [1] = { | ||
| 205 | .start = IRQ_USBD, | ||
| 206 | .end = IRQ_USBD, | ||
| 207 | .flags = IORESOURCE_IRQ, | ||
| 208 | } | ||
| 209 | |||
| 210 | }; | ||
| 211 | |||
| 212 | struct platform_device s3c_device_usbgadget = { | ||
| 213 | .name = "s3c2410-usbgadget", | ||
| 214 | .id = -1, | ||
| 215 | .num_resources = ARRAY_SIZE(s3c_usbgadget_resource), | ||
| 216 | .resource = s3c_usbgadget_resource, | ||
| 217 | }; | ||
| 218 | |||
| 219 | EXPORT_SYMBOL(s3c_device_usbgadget); | ||
| 220 | |||
| 221 | void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *pd) | ||
| 222 | { | ||
| 223 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usbgadget); | ||
| 224 | } | ||
| 225 | |||
| 226 | /* USB High Speed 2.0 Device (Gadget) */ | ||
| 227 | static struct resource s3c_hsudc_resource[] = { | ||
| 228 | [0] = { | ||
| 229 | .start = S3C2416_PA_HSUDC, | ||
| 230 | .end = S3C2416_PA_HSUDC + S3C2416_SZ_HSUDC - 1, | ||
| 231 | .flags = IORESOURCE_MEM, | ||
| 232 | }, | ||
| 233 | [1] = { | ||
| 234 | .start = IRQ_USBD, | ||
| 235 | .end = IRQ_USBD, | ||
| 236 | .flags = IORESOURCE_IRQ, | ||
| 237 | } | ||
| 238 | }; | ||
| 239 | |||
| 240 | static u64 s3c_hsudc_dmamask = DMA_BIT_MASK(32); | ||
| 241 | |||
| 242 | struct platform_device s3c_device_usb_hsudc = { | ||
| 243 | .name = "s3c-hsudc", | ||
| 244 | .id = -1, | ||
| 245 | .num_resources = ARRAY_SIZE(s3c_hsudc_resource), | ||
| 246 | .resource = s3c_hsudc_resource, | ||
| 247 | .dev = { | ||
| 248 | .dma_mask = &s3c_hsudc_dmamask, | ||
| 249 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 250 | }, | ||
| 251 | }; | ||
| 252 | |||
| 253 | void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd) | ||
| 254 | { | ||
| 255 | s3c_set_platdata(pd, sizeof(*pd), &s3c_device_usb_hsudc); | ||
| 256 | } | ||
| 257 | |||
| 258 | /* IIS */ | ||
| 259 | |||
| 260 | static struct resource s3c_iis_resource[] = { | ||
| 261 | [0] = { | ||
| 262 | .start = S3C24XX_PA_IIS, | ||
| 263 | .end = S3C24XX_PA_IIS + S3C24XX_SZ_IIS -1, | ||
| 264 | .flags = IORESOURCE_MEM, | ||
| 265 | } | ||
| 266 | }; | ||
| 267 | |||
| 268 | static u64 s3c_device_iis_dmamask = 0xffffffffUL; | ||
| 269 | |||
| 270 | struct platform_device s3c_device_iis = { | ||
| 271 | .name = "s3c24xx-iis", | ||
| 272 | .id = -1, | ||
| 273 | .num_resources = ARRAY_SIZE(s3c_iis_resource), | ||
| 274 | .resource = s3c_iis_resource, | ||
| 275 | .dev = { | ||
| 276 | .dma_mask = &s3c_device_iis_dmamask, | ||
| 277 | .coherent_dma_mask = 0xffffffffUL | ||
| 278 | } | ||
| 279 | }; | ||
| 280 | |||
| 281 | EXPORT_SYMBOL(s3c_device_iis); | ||
| 282 | |||
| 283 | /* RTC */ | ||
| 284 | |||
| 285 | static struct resource s3c_rtc_resource[] = { | ||
| 286 | [0] = { | ||
| 287 | .start = S3C24XX_PA_RTC, | ||
| 288 | .end = S3C24XX_PA_RTC + 0xff, | ||
| 289 | .flags = IORESOURCE_MEM, | ||
| 290 | }, | ||
| 291 | [1] = { | ||
| 292 | .start = IRQ_RTC, | ||
| 293 | .end = IRQ_RTC, | ||
| 294 | .flags = IORESOURCE_IRQ, | ||
| 295 | }, | ||
| 296 | [2] = { | ||
| 297 | .start = IRQ_TICK, | ||
| 298 | .end = IRQ_TICK, | ||
| 299 | .flags = IORESOURCE_IRQ | ||
| 300 | } | ||
| 301 | }; | ||
| 302 | |||
| 303 | struct platform_device s3c_device_rtc = { | ||
| 304 | .name = "s3c2410-rtc", | ||
| 305 | .id = -1, | ||
| 306 | .num_resources = ARRAY_SIZE(s3c_rtc_resource), | ||
| 307 | .resource = s3c_rtc_resource, | ||
| 308 | }; | ||
| 309 | |||
| 310 | EXPORT_SYMBOL(s3c_device_rtc); | ||
| 311 | |||
| 312 | /* ADC */ | ||
| 313 | |||
| 314 | static struct resource s3c_adc_resource[] = { | ||
| 315 | [0] = { | ||
| 316 | .start = S3C24XX_PA_ADC, | ||
| 317 | .end = S3C24XX_PA_ADC + S3C24XX_SZ_ADC - 1, | ||
| 318 | .flags = IORESOURCE_MEM, | ||
| 319 | }, | ||
| 320 | [1] = { | ||
| 321 | .start = IRQ_TC, | ||
| 322 | .end = IRQ_TC, | ||
| 323 | .flags = IORESOURCE_IRQ, | ||
| 324 | }, | ||
| 325 | [2] = { | ||
| 326 | .start = IRQ_ADC, | ||
| 327 | .end = IRQ_ADC, | ||
| 328 | .flags = IORESOURCE_IRQ, | ||
| 329 | } | ||
| 330 | |||
| 331 | }; | ||
| 332 | |||
| 333 | struct platform_device s3c_device_adc = { | ||
| 334 | .name = "s3c24xx-adc", | ||
| 335 | .id = -1, | ||
| 336 | .num_resources = ARRAY_SIZE(s3c_adc_resource), | ||
| 337 | .resource = s3c_adc_resource, | ||
| 338 | }; | ||
| 339 | |||
| 340 | /* SDI */ | ||
| 341 | |||
| 342 | static struct resource s3c_sdi_resource[] = { | ||
| 343 | [0] = { | ||
| 344 | .start = S3C24XX_PA_SDI, | ||
| 345 | .end = S3C24XX_PA_SDI + S3C24XX_SZ_SDI - 1, | ||
| 346 | .flags = IORESOURCE_MEM, | ||
| 347 | }, | ||
| 348 | [1] = { | ||
| 349 | .start = IRQ_SDI, | ||
| 350 | .end = IRQ_SDI, | ||
| 351 | .flags = IORESOURCE_IRQ, | ||
| 352 | } | ||
| 353 | |||
| 354 | }; | ||
| 355 | |||
| 356 | struct platform_device s3c_device_sdi = { | ||
| 357 | .name = "s3c2410-sdi", | ||
| 358 | .id = -1, | ||
| 359 | .num_resources = ARRAY_SIZE(s3c_sdi_resource), | ||
| 360 | .resource = s3c_sdi_resource, | ||
| 361 | }; | ||
| 362 | |||
| 363 | EXPORT_SYMBOL(s3c_device_sdi); | ||
| 364 | |||
| 365 | void __init s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata) | ||
| 366 | { | ||
| 367 | s3c_set_platdata(pdata, sizeof(struct s3c24xx_mci_pdata), | ||
| 368 | &s3c_device_sdi); | ||
| 369 | } | ||
| 370 | |||
| 371 | |||
| 372 | /* SPI (0) */ | ||
| 373 | |||
| 374 | static struct resource s3c_spi0_resource[] = { | ||
| 375 | [0] = { | ||
| 376 | .start = S3C24XX_PA_SPI, | ||
| 377 | .end = S3C24XX_PA_SPI + 0x1f, | ||
| 378 | .flags = IORESOURCE_MEM, | ||
| 379 | }, | ||
| 380 | [1] = { | ||
| 381 | .start = IRQ_SPI0, | ||
| 382 | .end = IRQ_SPI0, | ||
| 383 | .flags = IORESOURCE_IRQ, | ||
| 384 | } | ||
| 385 | |||
| 386 | }; | ||
| 387 | |||
| 388 | static u64 s3c_device_spi0_dmamask = 0xffffffffUL; | ||
| 389 | |||
| 390 | struct platform_device s3c_device_spi0 = { | ||
| 391 | .name = "s3c2410-spi", | ||
| 392 | .id = 0, | ||
| 393 | .num_resources = ARRAY_SIZE(s3c_spi0_resource), | ||
| 394 | .resource = s3c_spi0_resource, | ||
| 395 | .dev = { | ||
| 396 | .dma_mask = &s3c_device_spi0_dmamask, | ||
| 397 | .coherent_dma_mask = 0xffffffffUL | ||
| 398 | } | ||
| 399 | }; | ||
| 400 | |||
| 401 | EXPORT_SYMBOL(s3c_device_spi0); | ||
| 402 | |||
| 403 | /* SPI (1) */ | ||
| 404 | |||
| 405 | static struct resource s3c_spi1_resource[] = { | ||
| 406 | [0] = { | ||
| 407 | .start = S3C24XX_PA_SPI + S3C2410_SPI1, | ||
| 408 | .end = S3C24XX_PA_SPI + S3C2410_SPI1 + 0x1f, | ||
| 409 | .flags = IORESOURCE_MEM, | ||
| 410 | }, | ||
| 411 | [1] = { | ||
| 412 | .start = IRQ_SPI1, | ||
| 413 | .end = IRQ_SPI1, | ||
| 414 | .flags = IORESOURCE_IRQ, | ||
| 415 | } | ||
| 416 | |||
| 417 | }; | ||
| 418 | |||
| 419 | static u64 s3c_device_spi1_dmamask = 0xffffffffUL; | ||
| 420 | |||
| 421 | struct platform_device s3c_device_spi1 = { | ||
| 422 | .name = "s3c2410-spi", | ||
| 423 | .id = 1, | ||
| 424 | .num_resources = ARRAY_SIZE(s3c_spi1_resource), | ||
| 425 | .resource = s3c_spi1_resource, | ||
| 426 | .dev = { | ||
| 427 | .dma_mask = &s3c_device_spi1_dmamask, | ||
| 428 | .coherent_dma_mask = 0xffffffffUL | ||
| 429 | } | ||
| 430 | }; | ||
| 431 | |||
| 432 | EXPORT_SYMBOL(s3c_device_spi1); | ||
| 433 | |||
| 434 | #ifdef CONFIG_CPU_S3C2440 | ||
| 435 | |||
| 436 | /* Camif Controller */ | ||
| 437 | |||
| 438 | static struct resource s3c_camif_resource[] = { | ||
| 439 | [0] = { | ||
| 440 | .start = S3C2440_PA_CAMIF, | ||
| 441 | .end = S3C2440_PA_CAMIF + S3C2440_SZ_CAMIF - 1, | ||
| 442 | .flags = IORESOURCE_MEM, | ||
| 443 | }, | ||
| 444 | [1] = { | ||
| 445 | .start = IRQ_CAM, | ||
| 446 | .end = IRQ_CAM, | ||
| 447 | .flags = IORESOURCE_IRQ, | ||
| 448 | } | ||
| 449 | |||
| 450 | }; | ||
| 451 | |||
| 452 | static u64 s3c_device_camif_dmamask = 0xffffffffUL; | ||
| 453 | |||
| 454 | struct platform_device s3c_device_camif = { | ||
| 455 | .name = "s3c2440-camif", | ||
| 456 | .id = -1, | ||
| 457 | .num_resources = ARRAY_SIZE(s3c_camif_resource), | ||
| 458 | .resource = s3c_camif_resource, | ||
| 459 | .dev = { | ||
| 460 | .dma_mask = &s3c_device_camif_dmamask, | ||
| 461 | .coherent_dma_mask = 0xffffffffUL | ||
| 462 | } | ||
| 463 | }; | ||
| 464 | |||
| 465 | EXPORT_SYMBOL(s3c_device_camif); | ||
| 466 | |||
| 467 | /* AC97 */ | ||
| 468 | |||
| 469 | static struct resource s3c_ac97_resource[] = { | ||
| 470 | [0] = { | ||
| 471 | .start = S3C2440_PA_AC97, | ||
| 472 | .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1, | ||
| 473 | .flags = IORESOURCE_MEM, | ||
| 474 | }, | ||
| 475 | [1] = { | ||
| 476 | .start = IRQ_S3C244x_AC97, | ||
| 477 | .end = IRQ_S3C244x_AC97, | ||
| 478 | .flags = IORESOURCE_IRQ, | ||
| 479 | }, | ||
| 480 | [2] = { | ||
| 481 | .name = "PCM out", | ||
| 482 | .start = DMACH_PCM_OUT, | ||
| 483 | .end = DMACH_PCM_OUT, | ||
| 484 | .flags = IORESOURCE_DMA, | ||
| 485 | }, | ||
| 486 | [3] = { | ||
| 487 | .name = "PCM in", | ||
| 488 | .start = DMACH_PCM_IN, | ||
| 489 | .end = DMACH_PCM_IN, | ||
| 490 | .flags = IORESOURCE_DMA, | ||
| 491 | }, | ||
| 492 | [4] = { | ||
| 493 | .name = "Mic in", | ||
| 494 | .start = DMACH_MIC_IN, | ||
| 495 | .end = DMACH_MIC_IN, | ||
| 496 | .flags = IORESOURCE_DMA, | ||
| 497 | }, | ||
| 498 | }; | ||
| 499 | |||
| 500 | static u64 s3c_device_audio_dmamask = 0xffffffffUL; | ||
| 501 | |||
| 502 | struct platform_device s3c_device_ac97 = { | ||
| 503 | .name = "samsung-ac97", | ||
| 504 | .id = -1, | ||
| 505 | .num_resources = ARRAY_SIZE(s3c_ac97_resource), | ||
| 506 | .resource = s3c_ac97_resource, | ||
| 507 | .dev = { | ||
| 508 | .dma_mask = &s3c_device_audio_dmamask, | ||
| 509 | .coherent_dma_mask = 0xffffffffUL | ||
| 510 | } | ||
| 511 | }; | ||
| 512 | |||
| 513 | EXPORT_SYMBOL(s3c_device_ac97); | ||
| 514 | |||
| 515 | /* ASoC I2S */ | ||
| 516 | |||
| 517 | struct platform_device s3c2412_device_iis = { | ||
| 518 | .name = "s3c2412-iis", | ||
| 519 | .id = -1, | ||
| 520 | .dev = { | ||
| 521 | .dma_mask = &s3c_device_audio_dmamask, | ||
| 522 | .coherent_dma_mask = 0xffffffffUL | ||
| 523 | } | ||
| 524 | }; | ||
| 525 | |||
| 526 | EXPORT_SYMBOL(s3c2412_device_iis); | ||
| 527 | |||
| 528 | #endif // CONFIG_CPU_S32440 | ||
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c index 539bd0e3defd..53754bcf15a7 100644 --- a/arch/arm/plat-s3c24xx/dma.c +++ b/arch/arm/plat-s3c24xx/dma.c | |||
| @@ -1094,14 +1094,14 @@ EXPORT_SYMBOL(s3c2410_dma_config); | |||
| 1094 | * | 1094 | * |
| 1095 | * configure the dma source/destination hardware type and address | 1095 | * configure the dma source/destination hardware type and address |
| 1096 | * | 1096 | * |
| 1097 | * source: S3C2410_DMASRC_HW: source is hardware | 1097 | * source: DMA_FROM_DEVICE: source is hardware |
| 1098 | * S3C2410_DMASRC_MEM: source is memory | 1098 | * DMA_TO_DEVICE: source is memory |
| 1099 | * | 1099 | * |
| 1100 | * devaddr: physical address of the source | 1100 | * devaddr: physical address of the source |
| 1101 | */ | 1101 | */ |
| 1102 | 1102 | ||
| 1103 | int s3c2410_dma_devconfig(enum dma_ch channel, | 1103 | int s3c2410_dma_devconfig(enum dma_ch channel, |
| 1104 | enum s3c2410_dmasrc source, | 1104 | enum dma_data_direction source, |
| 1105 | unsigned long devaddr) | 1105 | unsigned long devaddr) |
| 1106 | { | 1106 | { |
| 1107 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); | 1107 | struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); |
| @@ -1131,7 +1131,7 @@ int s3c2410_dma_devconfig(enum dma_ch channel, | |||
| 1131 | hwcfg |= S3C2410_DISRCC_INC; | 1131 | hwcfg |= S3C2410_DISRCC_INC; |
| 1132 | 1132 | ||
| 1133 | switch (source) { | 1133 | switch (source) { |
| 1134 | case S3C2410_DMASRC_HW: | 1134 | case DMA_FROM_DEVICE: |
| 1135 | /* source is hardware */ | 1135 | /* source is hardware */ |
| 1136 | pr_debug("%s: hw source, devaddr=%08lx, hwcfg=%d\n", | 1136 | pr_debug("%s: hw source, devaddr=%08lx, hwcfg=%d\n", |
| 1137 | __func__, devaddr, hwcfg); | 1137 | __func__, devaddr, hwcfg); |
| @@ -1142,7 +1142,7 @@ int s3c2410_dma_devconfig(enum dma_ch channel, | |||
| 1142 | chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DIDST); | 1142 | chan->addr_reg = dma_regaddr(chan, S3C2410_DMA_DIDST); |
| 1143 | break; | 1143 | break; |
| 1144 | 1144 | ||
| 1145 | case S3C2410_DMASRC_MEM: | 1145 | case DMA_TO_DEVICE: |
| 1146 | /* source is memory */ | 1146 | /* source is memory */ |
| 1147 | pr_debug("%s: mem source, devaddr=%08lx, hwcfg=%d\n", | 1147 | pr_debug("%s: mem source, devaddr=%08lx, hwcfg=%d\n", |
| 1148 | __func__, devaddr, hwcfg); | 1148 | __func__, devaddr, hwcfg); |
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c deleted file mode 100644 index 2f3d7c089dfa..000000000000 --- a/arch/arm/plat-s3c24xx/gpio.c +++ /dev/null | |||
| @@ -1,96 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/gpio.c | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004-2010 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * S3C24XX GPIO support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License as published by | ||
| 10 | * the Free Software Foundation; either version 2 of the License, or | ||
| 11 | * (at your option) any later version. | ||
| 12 | * | ||
| 13 | * This program is distributed in the hope that it will be useful, | ||
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 16 | * GNU General Public License for more details. | ||
| 17 | * | ||
| 18 | * You should have received a copy of the GNU General Public License | ||
| 19 | * along with this program; if not, write to the Free Software | ||
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 21 | */ | ||
| 22 | |||
| 23 | #include <linux/kernel.h> | ||
| 24 | #include <linux/init.h> | ||
| 25 | #include <linux/module.h> | ||
| 26 | #include <linux/interrupt.h> | ||
| 27 | #include <linux/ioport.h> | ||
| 28 | #include <linux/gpio.h> | ||
| 29 | #include <linux/io.h> | ||
| 30 | |||
| 31 | #include <mach/hardware.h> | ||
| 32 | #include <mach/gpio-fns.h> | ||
| 33 | #include <asm/irq.h> | ||
| 34 | |||
| 35 | #include <mach/regs-gpio.h> | ||
| 36 | |||
| 37 | #include <plat/gpio-core.h> | ||
| 38 | |||
| 39 | /* gpiolib wrappers until these are totally eliminated */ | ||
| 40 | |||
| 41 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) | ||
| 42 | { | ||
| 43 | int ret; | ||
| 44 | |||
| 45 | WARN_ON(to); /* should be none of these left */ | ||
| 46 | |||
| 47 | if (!to) { | ||
| 48 | /* if pull is enabled, try first with up, and if that | ||
| 49 | * fails, try using down */ | ||
| 50 | |||
| 51 | ret = s3c_gpio_setpull(pin, S3C_GPIO_PULL_UP); | ||
| 52 | if (ret) | ||
| 53 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_DOWN); | ||
| 54 | } else { | ||
| 55 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE); | ||
| 56 | } | ||
| 57 | } | ||
| 58 | EXPORT_SYMBOL(s3c2410_gpio_pullup); | ||
| 59 | |||
| 60 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) | ||
| 61 | { | ||
| 62 | /* do this via gpiolib until all users removed */ | ||
| 63 | |||
| 64 | gpio_request(pin, "temporary"); | ||
| 65 | gpio_set_value(pin, to); | ||
| 66 | gpio_free(pin); | ||
| 67 | } | ||
| 68 | |||
| 69 | EXPORT_SYMBOL(s3c2410_gpio_setpin); | ||
| 70 | |||
| 71 | unsigned int s3c2410_gpio_getpin(unsigned int pin) | ||
| 72 | { | ||
| 73 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); | ||
| 74 | unsigned long offs = pin - chip->chip.base; | ||
| 75 | |||
| 76 | return __raw_readl(chip->base + 0x04) & (1<< offs); | ||
| 77 | } | ||
| 78 | |||
| 79 | EXPORT_SYMBOL(s3c2410_gpio_getpin); | ||
| 80 | |||
| 81 | unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change) | ||
| 82 | { | ||
| 83 | unsigned long flags; | ||
| 84 | unsigned long misccr; | ||
| 85 | |||
| 86 | local_irq_save(flags); | ||
| 87 | misccr = __raw_readl(S3C24XX_MISCCR); | ||
| 88 | misccr &= ~clear; | ||
| 89 | misccr ^= change; | ||
| 90 | __raw_writel(misccr, S3C24XX_MISCCR); | ||
| 91 | local_irq_restore(flags); | ||
| 92 | |||
| 93 | return misccr; | ||
| 94 | } | ||
| 95 | |||
| 96 | EXPORT_SYMBOL(s3c2410_modify_misccr); | ||
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c deleted file mode 100644 index 243b6411050d..000000000000 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ /dev/null | |||
| @@ -1,229 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/gpiolib.c | ||
| 2 | * | ||
| 3 | * Copyright (c) 2008-2010 Simtec Electronics | ||
| 4 | * http://armlinux.simtec.co.uk/ | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * S3C24XX GPIOlib support | ||
| 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 as published by | ||
| 11 | * the Free Software Foundation; either version 2 of the License. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <linux/kernel.h> | ||
| 15 | #include <linux/init.h> | ||
| 16 | #include <linux/module.h> | ||
| 17 | #include <linux/interrupt.h> | ||
| 18 | #include <linux/sysdev.h> | ||
| 19 | #include <linux/ioport.h> | ||
| 20 | #include <linux/io.h> | ||
| 21 | #include <linux/gpio.h> | ||
| 22 | |||
| 23 | #include <plat/gpio-core.h> | ||
| 24 | #include <plat/gpio-cfg.h> | ||
| 25 | #include <plat/gpio-cfg-helpers.h> | ||
| 26 | #include <mach/hardware.h> | ||
| 27 | #include <asm/irq.h> | ||
| 28 | #include <plat/pm.h> | ||
| 29 | |||
| 30 | #include <mach/regs-gpio.h> | ||
| 31 | |||
| 32 | static int s3c24xx_gpiolib_banka_input(struct gpio_chip *chip, unsigned offset) | ||
| 33 | { | ||
| 34 | return -EINVAL; | ||
| 35 | } | ||
| 36 | |||
| 37 | static int s3c24xx_gpiolib_banka_output(struct gpio_chip *chip, | ||
| 38 | unsigned offset, int value) | ||
| 39 | { | ||
| 40 | struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip); | ||
| 41 | void __iomem *base = ourchip->base; | ||
| 42 | unsigned long flags; | ||
| 43 | unsigned long dat; | ||
| 44 | unsigned long con; | ||
| 45 | |||
| 46 | local_irq_save(flags); | ||
| 47 | |||
| 48 | con = __raw_readl(base + 0x00); | ||
| 49 | dat = __raw_readl(base + 0x04); | ||
| 50 | |||
| 51 | dat &= ~(1 << offset); | ||
| 52 | if (value) | ||
| 53 | dat |= 1 << offset; | ||
| 54 | |||
| 55 | __raw_writel(dat, base + 0x04); | ||
| 56 | |||
| 57 | con &= ~(1 << offset); | ||
| 58 | |||
| 59 | __raw_writel(con, base + 0x00); | ||
| 60 | __raw_writel(dat, base + 0x04); | ||
| 61 | |||
| 62 | local_irq_restore(flags); | ||
| 63 | return 0; | ||
| 64 | } | ||
| 65 | |||
| 66 | static int s3c24xx_gpiolib_bankf_toirq(struct gpio_chip *chip, unsigned offset) | ||
| 67 | { | ||
| 68 | if (offset < 4) | ||
| 69 | return IRQ_EINT0 + offset; | ||
| 70 | |||
| 71 | if (offset < 8) | ||
| 72 | return IRQ_EINT4 + offset - 4; | ||
| 73 | |||
| 74 | return -EINVAL; | ||
| 75 | } | ||
| 76 | |||
| 77 | static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = { | ||
| 78 | .set_config = s3c_gpio_setcfg_s3c24xx_a, | ||
| 79 | .get_config = s3c_gpio_getcfg_s3c24xx_a, | ||
| 80 | }; | ||
| 81 | |||
| 82 | struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { | ||
| 83 | .set_config = s3c_gpio_setcfg_s3c24xx, | ||
| 84 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
| 85 | }; | ||
| 86 | |||
| 87 | struct s3c_gpio_chip s3c24xx_gpios[] = { | ||
| 88 | [0] = { | ||
| 89 | .base = S3C2410_GPACON, | ||
| 90 | .pm = __gpio_pm(&s3c_gpio_pm_1bit), | ||
| 91 | .config = &s3c24xx_gpiocfg_banka, | ||
| 92 | .chip = { | ||
| 93 | .base = S3C2410_GPA(0), | ||
| 94 | .owner = THIS_MODULE, | ||
| 95 | .label = "GPIOA", | ||
| 96 | .ngpio = 24, | ||
| 97 | .direction_input = s3c24xx_gpiolib_banka_input, | ||
| 98 | .direction_output = s3c24xx_gpiolib_banka_output, | ||
| 99 | }, | ||
| 100 | }, | ||
| 101 | [1] = { | ||
| 102 | .base = S3C2410_GPBCON, | ||
| 103 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 104 | .chip = { | ||
| 105 | .base = S3C2410_GPB(0), | ||
| 106 | .owner = THIS_MODULE, | ||
| 107 | .label = "GPIOB", | ||
| 108 | .ngpio = 16, | ||
| 109 | }, | ||
| 110 | }, | ||
| 111 | [2] = { | ||
| 112 | .base = S3C2410_GPCCON, | ||
| 113 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 114 | .chip = { | ||
| 115 | .base = S3C2410_GPC(0), | ||
| 116 | .owner = THIS_MODULE, | ||
| 117 | .label = "GPIOC", | ||
| 118 | .ngpio = 16, | ||
| 119 | }, | ||
| 120 | }, | ||
| 121 | [3] = { | ||
| 122 | .base = S3C2410_GPDCON, | ||
| 123 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 124 | .chip = { | ||
| 125 | .base = S3C2410_GPD(0), | ||
| 126 | .owner = THIS_MODULE, | ||
| 127 | .label = "GPIOD", | ||
| 128 | .ngpio = 16, | ||
| 129 | }, | ||
| 130 | }, | ||
| 131 | [4] = { | ||
| 132 | .base = S3C2410_GPECON, | ||
| 133 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 134 | .chip = { | ||
| 135 | .base = S3C2410_GPE(0), | ||
| 136 | .label = "GPIOE", | ||
| 137 | .owner = THIS_MODULE, | ||
| 138 | .ngpio = 16, | ||
| 139 | }, | ||
| 140 | }, | ||
| 141 | [5] = { | ||
| 142 | .base = S3C2410_GPFCON, | ||
| 143 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 144 | .chip = { | ||
| 145 | .base = S3C2410_GPF(0), | ||
| 146 | .owner = THIS_MODULE, | ||
| 147 | .label = "GPIOF", | ||
| 148 | .ngpio = 8, | ||
| 149 | .to_irq = s3c24xx_gpiolib_bankf_toirq, | ||
| 150 | }, | ||
| 151 | }, | ||
| 152 | [6] = { | ||
| 153 | .base = S3C2410_GPGCON, | ||
| 154 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 155 | .irq_base = IRQ_EINT8, | ||
| 156 | .chip = { | ||
| 157 | .base = S3C2410_GPG(0), | ||
| 158 | .owner = THIS_MODULE, | ||
| 159 | .label = "GPIOG", | ||
| 160 | .ngpio = 16, | ||
| 161 | .to_irq = samsung_gpiolib_to_irq, | ||
| 162 | }, | ||
| 163 | }, { | ||
| 164 | .base = S3C2410_GPHCON, | ||
| 165 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 166 | .chip = { | ||
| 167 | .base = S3C2410_GPH(0), | ||
| 168 | .owner = THIS_MODULE, | ||
| 169 | .label = "GPIOH", | ||
| 170 | .ngpio = 11, | ||
| 171 | }, | ||
| 172 | }, | ||
| 173 | /* GPIOS for the S3C2443 and later devices. */ | ||
| 174 | { | ||
| 175 | .base = S3C2440_GPJCON, | ||
| 176 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 177 | .chip = { | ||
| 178 | .base = S3C2410_GPJ(0), | ||
| 179 | .owner = THIS_MODULE, | ||
| 180 | .label = "GPIOJ", | ||
| 181 | .ngpio = 16, | ||
| 182 | }, | ||
| 183 | }, { | ||
| 184 | .base = S3C2443_GPKCON, | ||
| 185 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 186 | .chip = { | ||
| 187 | .base = S3C2410_GPK(0), | ||
| 188 | .owner = THIS_MODULE, | ||
| 189 | .label = "GPIOK", | ||
| 190 | .ngpio = 16, | ||
| 191 | }, | ||
| 192 | }, { | ||
| 193 | .base = S3C2443_GPLCON, | ||
| 194 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 195 | .chip = { | ||
| 196 | .base = S3C2410_GPL(0), | ||
| 197 | .owner = THIS_MODULE, | ||
| 198 | .label = "GPIOL", | ||
| 199 | .ngpio = 15, | ||
| 200 | }, | ||
| 201 | }, { | ||
| 202 | .base = S3C2443_GPMCON, | ||
| 203 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
| 204 | .chip = { | ||
| 205 | .base = S3C2410_GPM(0), | ||
| 206 | .owner = THIS_MODULE, | ||
| 207 | .label = "GPIOM", | ||
| 208 | .ngpio = 2, | ||
| 209 | }, | ||
| 210 | }, | ||
| 211 | }; | ||
| 212 | |||
| 213 | |||
| 214 | static __init int s3c24xx_gpiolib_init(void) | ||
| 215 | { | ||
| 216 | struct s3c_gpio_chip *chip = s3c24xx_gpios; | ||
| 217 | int gpn; | ||
| 218 | |||
| 219 | for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) { | ||
| 220 | if (!chip->config) | ||
| 221 | chip->config = &s3c24xx_gpiocfg_default; | ||
| 222 | |||
| 223 | s3c_gpiolib_add(chip); | ||
| 224 | } | ||
| 225 | |||
| 226 | return 0; | ||
| 227 | } | ||
| 228 | |||
| 229 | core_initcall(s3c24xx_gpiolib_init); | ||
diff --git a/arch/arm/plat-s3c24xx/include/mach/clkdev.h b/arch/arm/plat-s3c24xx/include/mach/clkdev.h deleted file mode 100644 index 7dffa83d23ff..000000000000 --- a/arch/arm/plat-s3c24xx/include/mach/clkdev.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef __MACH_CLKDEV_H__ | ||
| 2 | #define __MACH_CLKDEV_H__ | ||
| 3 | |||
| 4 | #define __clk_get(clk) ({ 1; }) | ||
| 5 | #define __clk_put(clk) do {} while (0) | ||
| 6 | |||
| 7 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h b/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h deleted file mode 100644 index a087de21bc20..000000000000 --- a/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/include/mach/pwm-clock.h | ||
| 2 | * | ||
| 3 | * Copyright 2008 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * http://armlinux.simtec.co.uk/ | ||
| 6 | * | ||
| 7 | * S3C24xx - pwm clock and timer support | ||
| 8 | */ | ||
| 9 | |||
| 10 | /** | ||
| 11 | * pwm_cfg_src_is_tclk() - return whether the given mux config is a tclk | ||
| 12 | * @cfg: The timer TCFG1 register bits shifted down to 0. | ||
| 13 | * | ||
| 14 | * Return true if the given configuration from TCFG1 is a TCLK instead | ||
| 15 | * any of the TDIV clocks. | ||
| 16 | */ | ||
| 17 | static inline int pwm_cfg_src_is_tclk(unsigned long tcfg) | ||
| 18 | { | ||
| 19 | return tcfg == S3C2410_TCFG1_MUX_TCLK; | ||
| 20 | } | ||
| 21 | |||
| 22 | /** | ||
| 23 | * tcfg_to_divisor() - convert tcfg1 setting to a divisor | ||
| 24 | * @tcfg1: The tcfg1 setting, shifted down. | ||
| 25 | * | ||
| 26 | * Get the divisor value for the given tcfg1 setting. We assume the | ||
| 27 | * caller has already checked to see if this is not a TCLK source. | ||
| 28 | */ | ||
| 29 | static inline unsigned long tcfg_to_divisor(unsigned long tcfg1) | ||
| 30 | { | ||
| 31 | return 1 << (1 + tcfg1); | ||
| 32 | } | ||
| 33 | |||
| 34 | /** | ||
| 35 | * pwm_tdiv_has_div1() - does the tdiv setting have a /1 | ||
| 36 | * | ||
| 37 | * Return true if we have a /1 in the tdiv setting. | ||
| 38 | */ | ||
| 39 | static inline unsigned int pwm_tdiv_has_div1(void) | ||
| 40 | { | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | |||
| 44 | /** | ||
| 45 | * pwm_tdiv_div_bits() - calculate TCFG1 divisor value. | ||
| 46 | * @div: The divisor to calculate the bit information for. | ||
| 47 | * | ||
| 48 | * Turn a divisor into the necessary bit field for TCFG1. | ||
| 49 | */ | ||
| 50 | static inline unsigned long pwm_tdiv_div_bits(unsigned int div) | ||
| 51 | { | ||
| 52 | return ilog2(div) - 1; | ||
| 53 | } | ||
| 54 | |||
| 55 | #define S3C_TCFG1_MUX_TCLK S3C2410_TCFG1_MUX_TCLK | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h b/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h deleted file mode 100644 index de5e88fdcb31..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/audio-simtec.h +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | /* arch/arm/plat-s3c24xx/include/plat/audio-simtec.h | ||
| 2 | * | ||
| 3 | * Copyright 2008 Simtec Electronics | ||
| 4 | * http://armlinux.simtec.co.uk/ | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * Simtec Audio support. | ||
| 12 | */ | ||
| 13 | |||
| 14 | /** | ||
| 15 | * struct s3c24xx_audio_simtec_pdata - platform data for simtec audio | ||
| 16 | * @use_mpllin: Select codec clock from MPLLin | ||
| 17 | * @output_cdclk: Need to output CDCLK to the codec | ||
| 18 | * @have_mic: Set if we have a MIC socket | ||
| 19 | * @have_lout: Set if we have a LineOut socket | ||
| 20 | * @amp_gpio: GPIO pin to enable the AMP | ||
| 21 | * @amp_gain: Option GPIO to control AMP gain | ||
| 22 | */ | ||
| 23 | struct s3c24xx_audio_simtec_pdata { | ||
| 24 | unsigned int use_mpllin:1; | ||
| 25 | unsigned int output_cdclk:1; | ||
| 26 | |||
| 27 | unsigned int have_mic:1; | ||
| 28 | unsigned int have_lout:1; | ||
| 29 | |||
| 30 | int amp_gpio; | ||
| 31 | int amp_gain[2]; | ||
| 32 | |||
| 33 | void (*startup)(void); | ||
| 34 | }; | ||
| 35 | |||
| 36 | extern int simtec_audio_add(const char *codec_name, bool has_lr_routing, | ||
| 37 | struct s3c24xx_audio_simtec_pdata *pdata); | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/common-smdk.h b/arch/arm/plat-s3c24xx/include/plat/common-smdk.h deleted file mode 100644 index 58d9094c935c..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/common-smdk.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/common-smdk.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2006 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Common code for SMDK2410 and SMDK2440 boards | ||
| 7 | * | ||
| 8 | * http://www.fluff.org/ben/smdk2440/ | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | extern void smdk_machine_init(void); | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h b/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h deleted file mode 100644 index d623235ae961..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/cpu-freq-core.h +++ /dev/null | |||
| @@ -1,287 +0,0 @@ | |||
| 1 | /* arch/arm/plat-s3c/include/plat/cpu-freq.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2006-2009 Simtec Electronics | ||
| 4 | * http://armlinux.simtec.co.uk/ | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * S3C CPU frequency scaling support - core support | ||
| 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 | #include <plat/cpu-freq.h> | ||
| 15 | |||
| 16 | struct seq_file; | ||
| 17 | |||
| 18 | #define MAX_BANKS (8) | ||
| 19 | #define S3C2412_MAX_IO (8) | ||
| 20 | |||
| 21 | /** | ||
| 22 | * struct s3c2410_iobank_timing - IO bank timings for S3C2410 style timings | ||
| 23 | * @bankcon: The cached version of settings in this structure. | ||
| 24 | * @tacp: | ||
| 25 | * @tacs: Time from address valid to nCS asserted. | ||
| 26 | * @tcos: Time from nCS asserted to nOE or nWE asserted. | ||
| 27 | * @tacc: Time that nOE or nWE is asserted. | ||
| 28 | * @tcoh: Time nCS is held after nOE or nWE are released. | ||
| 29 | * @tcah: Time address is held for after | ||
| 30 | * @nwait_en: Whether nWAIT is enabled for this bank. | ||
| 31 | * | ||
| 32 | * This structure represents the IO timings for a S3C2410 style IO bank | ||
| 33 | * used by the CPU frequency support if it needs to change the settings | ||
| 34 | * of the IO. | ||
| 35 | */ | ||
| 36 | struct s3c2410_iobank_timing { | ||
| 37 | unsigned long bankcon; | ||
| 38 | unsigned int tacp; | ||
| 39 | unsigned int tacs; | ||
| 40 | unsigned int tcos; | ||
| 41 | unsigned int tacc; | ||
| 42 | unsigned int tcoh; /* nCS hold afrer nOE/nWE */ | ||
| 43 | unsigned int tcah; /* Address hold after nCS */ | ||
| 44 | unsigned char nwait_en; /* nWait enabled for bank. */ | ||
| 45 | }; | ||
| 46 | |||
| 47 | /** | ||
| 48 | * struct s3c2412_iobank_timing - io timings for PL092 (S3C2412) style IO | ||
| 49 | * @idcy: The idle cycle time between transactions. | ||
| 50 | * @wstrd: nCS release to end of read cycle. | ||
| 51 | * @wstwr: nCS release to end of write cycle. | ||
| 52 | * @wstoen: nCS assertion to nOE assertion time. | ||
| 53 | * @wstwen: nCS assertion to nWE assertion time. | ||
| 54 | * @wstbrd: Burst ready delay. | ||
| 55 | * @smbidcyr: Register cache for smbidcyr value. | ||
| 56 | * @smbwstrd: Register cache for smbwstrd value. | ||
| 57 | * @smbwstwr: Register cache for smbwstwr value. | ||
| 58 | * @smbwstoen: Register cache for smbwstoen value. | ||
| 59 | * @smbwstwen: Register cache for smbwstwen value. | ||
| 60 | * @smbwstbrd: Register cache for smbwstbrd value. | ||
| 61 | * | ||
| 62 | * Timing information for a IO bank on an S3C2412 or similar system which | ||
| 63 | * uses a PL093 block. | ||
| 64 | */ | ||
| 65 | struct s3c2412_iobank_timing { | ||
| 66 | unsigned int idcy; | ||
| 67 | unsigned int wstrd; | ||
| 68 | unsigned int wstwr; | ||
| 69 | unsigned int wstoen; | ||
| 70 | unsigned int wstwen; | ||
| 71 | unsigned int wstbrd; | ||
| 72 | |||
| 73 | /* register cache */ | ||
| 74 | unsigned char smbidcyr; | ||
| 75 | unsigned char smbwstrd; | ||
| 76 | unsigned char smbwstwr; | ||
| 77 | unsigned char smbwstoen; | ||
| 78 | unsigned char smbwstwen; | ||
| 79 | unsigned char smbwstbrd; | ||
| 80 | }; | ||
| 81 | |||
| 82 | union s3c_iobank { | ||
| 83 | struct s3c2410_iobank_timing *io_2410; | ||
| 84 | struct s3c2412_iobank_timing *io_2412; | ||
| 85 | }; | ||
| 86 | |||
| 87 | /** | ||
| 88 | * struct s3c_iotimings - Chip IO timings holder | ||
| 89 | * @bank: The timings for each IO bank. | ||
| 90 | */ | ||
| 91 | struct s3c_iotimings { | ||
| 92 | union s3c_iobank bank[MAX_BANKS]; | ||
| 93 | }; | ||
| 94 | |||
| 95 | /** | ||
| 96 | * struct s3c_plltab - PLL table information. | ||
| 97 | * @vals: List of PLL values. | ||
| 98 | * @size: Size of the PLL table @vals. | ||
| 99 | */ | ||
| 100 | struct s3c_plltab { | ||
| 101 | struct s3c_pllval *vals; | ||
| 102 | int size; | ||
| 103 | }; | ||
| 104 | |||
| 105 | /** | ||
| 106 | * struct s3c_cpufreq_config - current cpu frequency configuration | ||
| 107 | * @freq: The current settings for the core clocks. | ||
| 108 | * @max: Maxium settings, derived from core, board and user settings. | ||
| 109 | * @pll: The PLL table entry for the current PLL settings. | ||
| 110 | * @divs: The divisor settings for the core clocks. | ||
| 111 | * @info: The current core driver information. | ||
| 112 | * @board: The information for the board we are running on. | ||
| 113 | * @lock_pll: Set if the PLL settings cannot be changed. | ||
| 114 | * | ||
| 115 | * This is for the core drivers that need to know information about | ||
| 116 | * the current settings and values. It should not be needed by any | ||
| 117 | * device drivers. | ||
| 118 | */ | ||
| 119 | struct s3c_cpufreq_config { | ||
| 120 | struct s3c_freq freq; | ||
| 121 | struct s3c_freq max; | ||
| 122 | struct cpufreq_frequency_table pll; | ||
| 123 | struct s3c_clkdivs divs; | ||
| 124 | struct s3c_cpufreq_info *info; /* for core, not drivers */ | ||
| 125 | struct s3c_cpufreq_board *board; | ||
| 126 | |||
| 127 | unsigned int lock_pll:1; | ||
| 128 | }; | ||
| 129 | |||
| 130 | /** | ||
| 131 | * struct s3c_cpufreq_info - Information for the CPU frequency driver. | ||
| 132 | * @name: The name of this implementation. | ||
| 133 | * @max: The maximum frequencies for the system. | ||
| 134 | * @latency: Transition latency to give to cpufreq. | ||
| 135 | * @locktime_m: The lock-time in uS for the MPLL. | ||
| 136 | * @locktime_u: The lock-time in uS for the UPLL. | ||
| 137 | * @locttime_bits: The number of bits each LOCKTIME field. | ||
| 138 | * @need_pll: Set if this driver needs to change the PLL values to achieve | ||
| 139 | * any frequency changes. This is really only need by devices like the | ||
| 140 | * S3C2410 where there is no or limited divider between the PLL and the | ||
| 141 | * ARMCLK. | ||
| 142 | * @resume_clocks: Update the clocks on resume. | ||
| 143 | * @get_iotiming: Get the current IO timing data, mainly for use at start. | ||
| 144 | * @set_iotiming: Update the IO timings from the cached copies calculated | ||
| 145 | * from the @calc_iotiming entry when changing the frequency. | ||
| 146 | * @calc_iotiming: Calculate and update the cached copies of the IO timings | ||
| 147 | * from the newly calculated frequencies. | ||
| 148 | * @calc_freqtable: Calculate (fill in) the given frequency table from the | ||
| 149 | * current frequency configuration. If the table passed in is NULL, | ||
| 150 | * then the return is the number of elements to be filled for allocation | ||
| 151 | * of the table. | ||
| 152 | * @set_refresh: Set the memory refresh configuration. | ||
| 153 | * @set_fvco: Set the PLL frequencies. | ||
| 154 | * @set_divs: Update the clock divisors. | ||
| 155 | * @calc_divs: Calculate the clock divisors. | ||
| 156 | */ | ||
| 157 | struct s3c_cpufreq_info { | ||
| 158 | const char *name; | ||
| 159 | struct s3c_freq max; | ||
| 160 | |||
| 161 | unsigned int latency; | ||
| 162 | |||
| 163 | unsigned int locktime_m; | ||
| 164 | unsigned int locktime_u; | ||
| 165 | unsigned char locktime_bits; | ||
| 166 | |||
| 167 | unsigned int need_pll:1; | ||
| 168 | |||
| 169 | /* driver routines */ | ||
| 170 | |||
| 171 | void (*resume_clocks)(void); | ||
| 172 | |||
| 173 | int (*get_iotiming)(struct s3c_cpufreq_config *cfg, | ||
| 174 | struct s3c_iotimings *timings); | ||
| 175 | |||
| 176 | void (*set_iotiming)(struct s3c_cpufreq_config *cfg, | ||
| 177 | struct s3c_iotimings *timings); | ||
| 178 | |||
| 179 | int (*calc_iotiming)(struct s3c_cpufreq_config *cfg, | ||
| 180 | struct s3c_iotimings *timings); | ||
| 181 | |||
| 182 | int (*calc_freqtable)(struct s3c_cpufreq_config *cfg, | ||
| 183 | struct cpufreq_frequency_table *t, | ||
| 184 | size_t table_size); | ||
| 185 | |||
| 186 | void (*debug_io_show)(struct seq_file *seq, | ||
| 187 | struct s3c_cpufreq_config *cfg, | ||
| 188 | union s3c_iobank *iob); | ||
| 189 | |||
| 190 | void (*set_refresh)(struct s3c_cpufreq_config *cfg); | ||
| 191 | void (*set_fvco)(struct s3c_cpufreq_config *cfg); | ||
| 192 | void (*set_divs)(struct s3c_cpufreq_config *cfg); | ||
| 193 | int (*calc_divs)(struct s3c_cpufreq_config *cfg); | ||
| 194 | }; | ||
| 195 | |||
| 196 | extern int s3c_cpufreq_register(struct s3c_cpufreq_info *info); | ||
| 197 | |||
| 198 | extern int s3c_plltab_register(struct cpufreq_frequency_table *plls, unsigned int plls_no); | ||
| 199 | |||
| 200 | /* exports and utilities for debugfs */ | ||
| 201 | extern struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void); | ||
| 202 | extern struct s3c_iotimings *s3c_cpufreq_getiotimings(void); | ||
| 203 | |||
| 204 | extern void s3c2410_iotiming_debugfs(struct seq_file *seq, | ||
| 205 | struct s3c_cpufreq_config *cfg, | ||
| 206 | union s3c_iobank *iob); | ||
| 207 | |||
| 208 | extern void s3c2412_iotiming_debugfs(struct seq_file *seq, | ||
| 209 | struct s3c_cpufreq_config *cfg, | ||
| 210 | union s3c_iobank *iob); | ||
| 211 | |||
| 212 | #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS | ||
| 213 | #define s3c_cpufreq_debugfs_call(x) x | ||
| 214 | #else | ||
| 215 | #define s3c_cpufreq_debugfs_call(x) NULL | ||
| 216 | #endif | ||
| 217 | |||
| 218 | /* Useful utility functions. */ | ||
| 219 | |||
| 220 | extern struct clk *s3c_cpufreq_clk_get(struct device *, const char *); | ||
| 221 | |||
| 222 | /* S3C2410 and compatible exported functions */ | ||
| 223 | |||
| 224 | extern void s3c2410_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg); | ||
| 225 | extern void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg); | ||
| 226 | |||
| 227 | #ifdef CONFIG_S3C2410_IOTIMING | ||
| 228 | extern int s3c2410_iotiming_calc(struct s3c_cpufreq_config *cfg, | ||
| 229 | struct s3c_iotimings *iot); | ||
| 230 | |||
| 231 | extern int s3c2410_iotiming_get(struct s3c_cpufreq_config *cfg, | ||
| 232 | struct s3c_iotimings *timings); | ||
| 233 | |||
| 234 | extern void s3c2410_iotiming_set(struct s3c_cpufreq_config *cfg, | ||
| 235 | struct s3c_iotimings *iot); | ||
| 236 | #else | ||
| 237 | #define s3c2410_iotiming_calc NULL | ||
| 238 | #define s3c2410_iotiming_get NULL | ||
| 239 | #define s3c2410_iotiming_set NULL | ||
| 240 | #endif /* CONFIG_S3C2410_IOTIMING */ | ||
| 241 | |||
| 242 | /* S3C2412 compatible routines */ | ||
| 243 | |||
| 244 | extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, | ||
| 245 | struct s3c_iotimings *timings); | ||
| 246 | |||
| 247 | extern int s3c2412_iotiming_get(struct s3c_cpufreq_config *cfg, | ||
| 248 | struct s3c_iotimings *timings); | ||
| 249 | |||
| 250 | extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg, | ||
| 251 | struct s3c_iotimings *iot); | ||
| 252 | |||
| 253 | extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg, | ||
| 254 | struct s3c_iotimings *iot); | ||
| 255 | |||
| 256 | #ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUG | ||
| 257 | #define s3c_freq_dbg(x...) printk(KERN_INFO x) | ||
| 258 | #else | ||
| 259 | #define s3c_freq_dbg(x...) do { if (0) printk(x); } while (0) | ||
| 260 | #endif /* CONFIG_CPU_FREQ_S3C24XX_DEBUG */ | ||
| 261 | |||
| 262 | #ifdef CONFIG_CPU_FREQ_S3C24XX_IODEBUG | ||
| 263 | #define s3c_freq_iodbg(x...) printk(KERN_INFO x) | ||
| 264 | #else | ||
| 265 | #define s3c_freq_iodbg(x...) do { if (0) printk(x); } while (0) | ||
| 266 | #endif /* CONFIG_CPU_FREQ_S3C24XX_IODEBUG */ | ||
| 267 | |||
| 268 | static inline int s3c_cpufreq_addfreq(struct cpufreq_frequency_table *table, | ||
| 269 | int index, size_t table_size, | ||
| 270 | unsigned int freq) | ||
| 271 | { | ||
| 272 | if (index < 0) | ||
| 273 | return index; | ||
| 274 | |||
| 275 | if (table) { | ||
| 276 | if (index >= table_size) | ||
| 277 | return -ENOMEM; | ||
| 278 | |||
| 279 | s3c_freq_dbg("%s: { %d = %u kHz }\n", | ||
| 280 | __func__, index, freq); | ||
| 281 | |||
| 282 | table[index].index = index; | ||
| 283 | table[index].frequency = freq; | ||
| 284 | } | ||
| 285 | |||
| 286 | return index + 1; | ||
| 287 | } | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/fiq.h b/arch/arm/plat-s3c24xx/include/plat/fiq.h deleted file mode 100644 index 8521b8372c5f..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/fiq.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/fiq.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2009 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Header file for S3C24XX CPU FIQ support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | extern int s3c24xx_set_fiq(unsigned int irq, bool on); | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/irq.h b/arch/arm/plat-s3c24xx/include/plat/irq.h deleted file mode 100644 index ec087d6054b1..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/irq.h +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/irq.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Header file for S3C24XX CPU IRQ support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/io.h> | ||
| 14 | |||
| 15 | #include <mach/hardware.h> | ||
| 16 | #include <mach/regs-irq.h> | ||
| 17 | #include <mach/regs-gpio.h> | ||
| 18 | |||
| 19 | #define irqdbf(x...) | ||
| 20 | #define irqdbf2(x...) | ||
| 21 | |||
| 22 | #define EXTINT_OFF (IRQ_EINT4 - 4) | ||
| 23 | |||
| 24 | /* these are exported for arch/arm/mach-* usage */ | ||
| 25 | extern struct irq_chip s3c_irq_level_chip; | ||
| 26 | extern struct irq_chip s3c_irq_chip; | ||
| 27 | |||
| 28 | static inline void | ||
| 29 | s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit, | ||
| 30 | int subcheck) | ||
| 31 | { | ||
| 32 | unsigned long mask; | ||
| 33 | unsigned long submask; | ||
| 34 | |||
| 35 | submask = __raw_readl(S3C2410_INTSUBMSK); | ||
| 36 | mask = __raw_readl(S3C2410_INTMSK); | ||
| 37 | |||
| 38 | submask |= (1UL << (irqno - IRQ_S3CUART_RX0)); | ||
| 39 | |||
| 40 | /* check to see if we need to mask the parent IRQ */ | ||
| 41 | |||
| 42 | if ((submask & subcheck) == subcheck) { | ||
| 43 | __raw_writel(mask | parentbit, S3C2410_INTMSK); | ||
| 44 | } | ||
| 45 | |||
| 46 | /* write back masks */ | ||
| 47 | __raw_writel(submask, S3C2410_INTSUBMSK); | ||
| 48 | |||
| 49 | } | ||
| 50 | |||
| 51 | static inline void | ||
| 52 | s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit) | ||
| 53 | { | ||
| 54 | unsigned long mask; | ||
| 55 | unsigned long submask; | ||
| 56 | |||
| 57 | submask = __raw_readl(S3C2410_INTSUBMSK); | ||
| 58 | mask = __raw_readl(S3C2410_INTMSK); | ||
| 59 | |||
| 60 | submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0)); | ||
| 61 | mask &= ~parentbit; | ||
| 62 | |||
| 63 | /* write back masks */ | ||
| 64 | __raw_writel(submask, S3C2410_INTSUBMSK); | ||
| 65 | __raw_writel(mask, S3C2410_INTMSK); | ||
| 66 | } | ||
| 67 | |||
| 68 | |||
| 69 | static inline void | ||
| 70 | s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group) | ||
| 71 | { | ||
| 72 | unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0); | ||
| 73 | |||
| 74 | s3c_irqsub_mask(irqno, parentmask, group); | ||
| 75 | |||
| 76 | __raw_writel(bit, S3C2410_SUBSRCPND); | ||
| 77 | |||
| 78 | /* only ack parent if we've got all the irqs (seems we must | ||
| 79 | * ack, all and hope that the irq system retriggers ok when | ||
| 80 | * the interrupt goes off again) | ||
| 81 | */ | ||
| 82 | |||
| 83 | if (1) { | ||
| 84 | __raw_writel(parentmask, S3C2410_SRCPND); | ||
| 85 | __raw_writel(parentmask, S3C2410_INTPND); | ||
| 86 | } | ||
| 87 | } | ||
| 88 | |||
| 89 | static inline void | ||
| 90 | s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group) | ||
| 91 | { | ||
| 92 | unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0); | ||
| 93 | |||
| 94 | __raw_writel(bit, S3C2410_SUBSRCPND); | ||
| 95 | |||
| 96 | /* only ack parent if we've got all the irqs (seems we must | ||
| 97 | * ack, all and hope that the irq system retriggers ok when | ||
| 98 | * the interrupt goes off again) | ||
| 99 | */ | ||
| 100 | |||
| 101 | if (1) { | ||
| 102 | __raw_writel(parentmask, S3C2410_SRCPND); | ||
| 103 | __raw_writel(parentmask, S3C2410_INTPND); | ||
| 104 | } | ||
| 105 | } | ||
| 106 | |||
| 107 | /* exported for use in arch/arm/mach-s3c2410 */ | ||
| 108 | |||
| 109 | #ifdef CONFIG_PM | ||
| 110 | extern int s3c_irq_wake(struct irq_data *data, unsigned int state); | ||
| 111 | #else | ||
| 112 | #define s3c_irq_wake NULL | ||
| 113 | #endif | ||
| 114 | |||
| 115 | extern int s3c_irqext_type(struct irq_data *d, unsigned int type); | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/mci.h b/arch/arm/plat-s3c24xx/include/plat/mci.h deleted file mode 100644 index 2ac2b21ec490..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/mci.h +++ /dev/null | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | #ifndef _ARCH_MCI_H | ||
| 2 | #define _ARCH_MCI_H | ||
| 3 | |||
| 4 | /** | ||
| 5 | * struct s3c24xx_mci_pdata - sd/mmc controller platform data | ||
| 6 | * @no_wprotect: Set this to indicate there is no write-protect switch. | ||
| 7 | * @no_detect: Set this if there is no detect switch. | ||
| 8 | * @wprotect_invert: Invert the default sense of the write protect switch. | ||
| 9 | * @detect_invert: Invert the default sense of the write protect switch. | ||
| 10 | * @use_dma: Set to allow the use of DMA. | ||
| 11 | * @gpio_detect: GPIO number for the card detect line. | ||
| 12 | * @gpio_wprotect: GPIO number for the write protect line. | ||
| 13 | * @ocr_avail: The mask of the available power states, non-zero to use. | ||
| 14 | * @set_power: Callback to control the power mode. | ||
| 15 | * | ||
| 16 | * The @gpio_detect is used for card detection when @no_wprotect is unset, | ||
| 17 | * and the default sense is that 0 returned from gpio_get_value() means | ||
| 18 | * that a card is inserted. If @detect_invert is set, then the value from | ||
| 19 | * gpio_get_value() is inverted, which makes 1 mean card inserted. | ||
| 20 | * | ||
| 21 | * The driver will use @gpio_wprotect to signal whether the card is write | ||
| 22 | * protected if @no_wprotect is not set. A 0 returned from gpio_get_value() | ||
| 23 | * means the card is read/write, and 1 means read-only. The @wprotect_invert | ||
| 24 | * will invert the value returned from gpio_get_value(). | ||
| 25 | * | ||
| 26 | * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set | ||
| 27 | * to a non-zero value, otherwise the default of 3.2-3.4V is used. | ||
| 28 | */ | ||
| 29 | struct s3c24xx_mci_pdata { | ||
| 30 | unsigned int no_wprotect : 1; | ||
| 31 | unsigned int no_detect : 1; | ||
| 32 | unsigned int wprotect_invert : 1; | ||
| 33 | unsigned int detect_invert : 1; /* set => detect active high. */ | ||
| 34 | unsigned int use_dma : 1; | ||
| 35 | |||
| 36 | unsigned int gpio_detect; | ||
| 37 | unsigned int gpio_wprotect; | ||
| 38 | unsigned long ocr_avail; | ||
| 39 | void (*set_power)(unsigned char power_mode, | ||
| 40 | unsigned short vdd); | ||
| 41 | }; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device | ||
| 45 | * @pdata: The platform data | ||
| 46 | * | ||
| 47 | * Copy the platform data supplied by @pdata so that this can be marked | ||
| 48 | * __initdata. | ||
| 49 | */ | ||
| 50 | extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata); | ||
| 51 | |||
| 52 | #endif /* _ARCH_NCI_H */ | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/pll.h b/arch/arm/plat-s3c24xx/include/plat/pll.h deleted file mode 100644 index 005729a1077a..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/pll.h +++ /dev/null | |||
| @@ -1,62 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/include/plat/pll.h | ||
| 2 | * | ||
| 3 | * Copyright 2008 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * http://armlinux.simtec.co.uk/ | ||
| 6 | * | ||
| 7 | * S3C24xx - common pll registers and code | ||
| 8 | */ | ||
| 9 | |||
| 10 | #define S3C24XX_PLLCON_MDIVSHIFT 12 | ||
| 11 | #define S3C24XX_PLLCON_PDIVSHIFT 4 | ||
| 12 | #define S3C24XX_PLLCON_SDIVSHIFT 0 | ||
| 13 | #define S3C24XX_PLLCON_MDIVMASK ((1<<(1+(19-12)))-1) | ||
| 14 | #define S3C24XX_PLLCON_PDIVMASK ((1<<5)-1) | ||
| 15 | #define S3C24XX_PLLCON_SDIVMASK 3 | ||
| 16 | |||
| 17 | #include <asm/div64.h> | ||
| 18 | |||
| 19 | static inline unsigned int | ||
| 20 | s3c24xx_get_pll(unsigned int pllval, unsigned int baseclk) | ||
| 21 | { | ||
| 22 | unsigned int mdiv, pdiv, sdiv; | ||
| 23 | uint64_t fvco; | ||
| 24 | |||
| 25 | mdiv = pllval >> S3C24XX_PLLCON_MDIVSHIFT; | ||
| 26 | pdiv = pllval >> S3C24XX_PLLCON_PDIVSHIFT; | ||
| 27 | sdiv = pllval >> S3C24XX_PLLCON_SDIVSHIFT; | ||
| 28 | |||
| 29 | mdiv &= S3C24XX_PLLCON_MDIVMASK; | ||
| 30 | pdiv &= S3C24XX_PLLCON_PDIVMASK; | ||
| 31 | sdiv &= S3C24XX_PLLCON_SDIVMASK; | ||
| 32 | |||
| 33 | fvco = (uint64_t)baseclk * (mdiv + 8); | ||
| 34 | do_div(fvco, (pdiv + 2) << sdiv); | ||
| 35 | |||
| 36 | return (unsigned int)fvco; | ||
| 37 | } | ||
| 38 | |||
| 39 | #define S3C2416_PLL_M_SHIFT (14) | ||
| 40 | #define S3C2416_PLL_P_SHIFT (5) | ||
| 41 | #define S3C2416_PLL_S_MASK (7) | ||
| 42 | #define S3C2416_PLL_M_MASK ((1 << 10) - 1) | ||
| 43 | #define S3C2416_PLL_P_MASK (63) | ||
| 44 | |||
| 45 | static inline unsigned int | ||
| 46 | s3c2416_get_pll(unsigned int pllval, unsigned int baseclk) | ||
| 47 | { | ||
| 48 | unsigned int m, p, s; | ||
| 49 | uint64_t fvco; | ||
| 50 | |||
| 51 | m = pllval >> S3C2416_PLL_M_SHIFT; | ||
| 52 | p = pllval >> S3C2416_PLL_P_SHIFT; | ||
| 53 | |||
| 54 | s = pllval & S3C2416_PLL_S_MASK; | ||
| 55 | m &= S3C2416_PLL_M_MASK; | ||
| 56 | p &= S3C2416_PLL_P_MASK; | ||
| 57 | |||
| 58 | fvco = (uint64_t)baseclk * m; | ||
| 59 | do_div(fvco, (p << s)); | ||
| 60 | |||
| 61 | return (unsigned int)fvco; | ||
| 62 | } | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h b/arch/arm/plat-s3c24xx/include/plat/regs-dma.h deleted file mode 100644 index 1b0f4c36d384..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/regs-dma.h +++ /dev/null | |||
| @@ -1,145 +0,0 @@ | |||
| 1 | /* arch/arm/mach-s3c2410/include/mach/dma.h | ||
| 2 | * | ||
| 3 | * Copyright (C) 2003-2006 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Samsung S3C24XX DMA support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | /* DMA Register definitions */ | ||
| 14 | |||
| 15 | #define S3C2410_DMA_DISRC (0x00) | ||
| 16 | #define S3C2410_DMA_DISRCC (0x04) | ||
| 17 | #define S3C2410_DMA_DIDST (0x08) | ||
| 18 | #define S3C2410_DMA_DIDSTC (0x0C) | ||
| 19 | #define S3C2410_DMA_DCON (0x10) | ||
| 20 | #define S3C2410_DMA_DSTAT (0x14) | ||
| 21 | #define S3C2410_DMA_DCSRC (0x18) | ||
| 22 | #define S3C2410_DMA_DCDST (0x1C) | ||
| 23 | #define S3C2410_DMA_DMASKTRIG (0x20) | ||
| 24 | #define S3C2412_DMA_DMAREQSEL (0x24) | ||
| 25 | #define S3C2443_DMA_DMAREQSEL (0x24) | ||
| 26 | |||
| 27 | #define S3C2410_DISRCC_INC (1<<0) | ||
| 28 | #define S3C2410_DISRCC_APB (1<<1) | ||
| 29 | |||
| 30 | #define S3C2410_DMASKTRIG_STOP (1<<2) | ||
| 31 | #define S3C2410_DMASKTRIG_ON (1<<1) | ||
| 32 | #define S3C2410_DMASKTRIG_SWTRIG (1<<0) | ||
| 33 | |||
| 34 | #define S3C2410_DCON_DEMAND (0<<31) | ||
| 35 | #define S3C2410_DCON_HANDSHAKE (1<<31) | ||
| 36 | #define S3C2410_DCON_SYNC_PCLK (0<<30) | ||
| 37 | #define S3C2410_DCON_SYNC_HCLK (1<<30) | ||
| 38 | |||
| 39 | #define S3C2410_DCON_INTREQ (1<<29) | ||
| 40 | |||
| 41 | #define S3C2410_DCON_CH0_XDREQ0 (0<<24) | ||
| 42 | #define S3C2410_DCON_CH0_UART0 (1<<24) | ||
| 43 | #define S3C2410_DCON_CH0_SDI (2<<24) | ||
| 44 | #define S3C2410_DCON_CH0_TIMER (3<<24) | ||
| 45 | #define S3C2410_DCON_CH0_USBEP1 (4<<24) | ||
| 46 | |||
| 47 | #define S3C2410_DCON_CH1_XDREQ1 (0<<24) | ||
| 48 | #define S3C2410_DCON_CH1_UART1 (1<<24) | ||
| 49 | #define S3C2410_DCON_CH1_I2SSDI (2<<24) | ||
| 50 | #define S3C2410_DCON_CH1_SPI (3<<24) | ||
| 51 | #define S3C2410_DCON_CH1_USBEP2 (4<<24) | ||
| 52 | |||
| 53 | #define S3C2410_DCON_CH2_I2SSDO (0<<24) | ||
| 54 | #define S3C2410_DCON_CH2_I2SSDI (1<<24) | ||
| 55 | #define S3C2410_DCON_CH2_SDI (2<<24) | ||
| 56 | #define S3C2410_DCON_CH2_TIMER (3<<24) | ||
| 57 | #define S3C2410_DCON_CH2_USBEP3 (4<<24) | ||
| 58 | |||
| 59 | #define S3C2410_DCON_CH3_UART2 (0<<24) | ||
| 60 | #define S3C2410_DCON_CH3_SDI (1<<24) | ||
| 61 | #define S3C2410_DCON_CH3_SPI (2<<24) | ||
| 62 | #define S3C2410_DCON_CH3_TIMER (3<<24) | ||
| 63 | #define S3C2410_DCON_CH3_USBEP4 (4<<24) | ||
| 64 | |||
| 65 | #define S3C2410_DCON_SRCSHIFT (24) | ||
| 66 | #define S3C2410_DCON_SRCMASK (7<<24) | ||
| 67 | |||
| 68 | #define S3C2410_DCON_BYTE (0<<20) | ||
| 69 | #define S3C2410_DCON_HALFWORD (1<<20) | ||
| 70 | #define S3C2410_DCON_WORD (2<<20) | ||
| 71 | |||
| 72 | #define S3C2410_DCON_AUTORELOAD (0<<22) | ||
| 73 | #define S3C2410_DCON_NORELOAD (1<<22) | ||
| 74 | #define S3C2410_DCON_HWTRIG (1<<23) | ||
| 75 | |||
| 76 | #ifdef CONFIG_CPU_S3C2440 | ||
| 77 | #define S3C2440_DIDSTC_CHKINT (1<<2) | ||
| 78 | |||
| 79 | #define S3C2440_DCON_CH0_I2SSDO (5<<24) | ||
| 80 | #define S3C2440_DCON_CH0_PCMIN (6<<24) | ||
| 81 | |||
| 82 | #define S3C2440_DCON_CH1_PCMOUT (5<<24) | ||
| 83 | #define S3C2440_DCON_CH1_SDI (6<<24) | ||
| 84 | |||
| 85 | #define S3C2440_DCON_CH2_PCMIN (5<<24) | ||
| 86 | #define S3C2440_DCON_CH2_MICIN (6<<24) | ||
| 87 | |||
| 88 | #define S3C2440_DCON_CH3_MICIN (5<<24) | ||
| 89 | #define S3C2440_DCON_CH3_PCMOUT (6<<24) | ||
| 90 | #endif | ||
| 91 | |||
| 92 | #ifdef CONFIG_CPU_S3C2412 | ||
| 93 | |||
| 94 | #define S3C2412_DMAREQSEL_SRC(x) ((x)<<1) | ||
| 95 | |||
| 96 | #define S3C2412_DMAREQSEL_HW (1) | ||
| 97 | |||
| 98 | #define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0) | ||
| 99 | #define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1) | ||
| 100 | #define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2) | ||
| 101 | #define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3) | ||
| 102 | #define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4) | ||
| 103 | #define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5) | ||
| 104 | #define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9) | ||
| 105 | #define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10) | ||
| 106 | #define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13) | ||
| 107 | #define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14) | ||
| 108 | #define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15) | ||
| 109 | #define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16) | ||
| 110 | #define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17) | ||
| 111 | #define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18) | ||
| 112 | #define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19) | ||
| 113 | #define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20) | ||
| 114 | #define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21) | ||
| 115 | #define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22) | ||
| 116 | #define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23) | ||
| 117 | #define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) | ||
| 118 | |||
| 119 | #endif | ||
| 120 | |||
| 121 | #define S3C2443_DMAREQSEL_SRC(x) ((x)<<1) | ||
| 122 | |||
| 123 | #define S3C2443_DMAREQSEL_HW (1) | ||
| 124 | |||
| 125 | #define S3C2443_DMAREQSEL_SPI0TX S3C2443_DMAREQSEL_SRC(0) | ||
| 126 | #define S3C2443_DMAREQSEL_SPI0RX S3C2443_DMAREQSEL_SRC(1) | ||
| 127 | #define S3C2443_DMAREQSEL_SPI1TX S3C2443_DMAREQSEL_SRC(2) | ||
| 128 | #define S3C2443_DMAREQSEL_SPI1RX S3C2443_DMAREQSEL_SRC(3) | ||
| 129 | #define S3C2443_DMAREQSEL_I2STX S3C2443_DMAREQSEL_SRC(4) | ||
| 130 | #define S3C2443_DMAREQSEL_I2SRX S3C2443_DMAREQSEL_SRC(5) | ||
| 131 | #define S3C2443_DMAREQSEL_TIMER S3C2443_DMAREQSEL_SRC(9) | ||
| 132 | #define S3C2443_DMAREQSEL_SDI S3C2443_DMAREQSEL_SRC(10) | ||
| 133 | #define S3C2443_DMAREQSEL_XDREQ0 S3C2443_DMAREQSEL_SRC(17) | ||
| 134 | #define S3C2443_DMAREQSEL_XDREQ1 S3C2443_DMAREQSEL_SRC(18) | ||
| 135 | #define S3C2443_DMAREQSEL_UART0_0 S3C2443_DMAREQSEL_SRC(19) | ||
| 136 | #define S3C2443_DMAREQSEL_UART0_1 S3C2443_DMAREQSEL_SRC(20) | ||
| 137 | #define S3C2443_DMAREQSEL_UART1_0 S3C2443_DMAREQSEL_SRC(21) | ||
| 138 | #define S3C2443_DMAREQSEL_UART1_1 S3C2443_DMAREQSEL_SRC(22) | ||
| 139 | #define S3C2443_DMAREQSEL_UART2_0 S3C2443_DMAREQSEL_SRC(23) | ||
| 140 | #define S3C2443_DMAREQSEL_UART2_1 S3C2443_DMAREQSEL_SRC(24) | ||
| 141 | #define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25) | ||
| 142 | #define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26) | ||
| 143 | #define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27) | ||
| 144 | #define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28) | ||
| 145 | #define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29) | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-iis.h b/arch/arm/plat-s3c24xx/include/plat/regs-iis.h deleted file mode 100644 index cc44e0e931e9..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/regs-iis.h +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | /* arch/arm/mach-s3c2410/include/mach/regs-iis.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk> | ||
| 4 | * http://www.simtec.co.uk/products/SWLINUX/ | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * S3C2410 IIS register definition | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __ASM_ARCH_REGS_IIS_H | ||
| 14 | #define __ASM_ARCH_REGS_IIS_H | ||
| 15 | |||
| 16 | #define S3C2410_IISCON (0x00) | ||
| 17 | |||
| 18 | #define S3C2410_IISCON_LRINDEX (1<<8) | ||
| 19 | #define S3C2410_IISCON_TXFIFORDY (1<<7) | ||
| 20 | #define S3C2410_IISCON_RXFIFORDY (1<<6) | ||
| 21 | #define S3C2410_IISCON_TXDMAEN (1<<5) | ||
| 22 | #define S3C2410_IISCON_RXDMAEN (1<<4) | ||
| 23 | #define S3C2410_IISCON_TXIDLE (1<<3) | ||
| 24 | #define S3C2410_IISCON_RXIDLE (1<<2) | ||
| 25 | #define S3C2410_IISCON_PSCEN (1<<1) | ||
| 26 | #define S3C2410_IISCON_IISEN (1<<0) | ||
| 27 | |||
| 28 | #define S3C2410_IISMOD (0x04) | ||
| 29 | |||
| 30 | #define S3C2440_IISMOD_MPLL (1<<9) | ||
| 31 | #define S3C2410_IISMOD_SLAVE (1<<8) | ||
| 32 | #define S3C2410_IISMOD_NOXFER (0<<6) | ||
| 33 | #define S3C2410_IISMOD_RXMODE (1<<6) | ||
| 34 | #define S3C2410_IISMOD_TXMODE (2<<6) | ||
| 35 | #define S3C2410_IISMOD_TXRXMODE (3<<6) | ||
| 36 | #define S3C2410_IISMOD_LR_LLOW (0<<5) | ||
| 37 | #define S3C2410_IISMOD_LR_RLOW (1<<5) | ||
| 38 | #define S3C2410_IISMOD_IIS (0<<4) | ||
| 39 | #define S3C2410_IISMOD_MSB (1<<4) | ||
| 40 | #define S3C2410_IISMOD_8BIT (0<<3) | ||
| 41 | #define S3C2410_IISMOD_16BIT (1<<3) | ||
| 42 | #define S3C2410_IISMOD_BITMASK (1<<3) | ||
| 43 | #define S3C2410_IISMOD_256FS (0<<2) | ||
| 44 | #define S3C2410_IISMOD_384FS (1<<2) | ||
| 45 | #define S3C2410_IISMOD_16FS (0<<0) | ||
| 46 | #define S3C2410_IISMOD_32FS (1<<0) | ||
| 47 | #define S3C2410_IISMOD_48FS (2<<0) | ||
| 48 | #define S3C2410_IISMOD_FS_MASK (3<<0) | ||
| 49 | |||
| 50 | #define S3C2410_IISPSR (0x08) | ||
| 51 | #define S3C2410_IISPSR_INTMASK (31<<5) | ||
| 52 | #define S3C2410_IISPSR_INTSHIFT (5) | ||
| 53 | #define S3C2410_IISPSR_EXTMASK (31<<0) | ||
| 54 | #define S3C2410_IISPSR_EXTSHFIT (0) | ||
| 55 | |||
| 56 | #define S3C2410_IISFCON (0x0c) | ||
| 57 | |||
| 58 | #define S3C2410_IISFCON_TXDMA (1<<15) | ||
| 59 | #define S3C2410_IISFCON_RXDMA (1<<14) | ||
| 60 | #define S3C2410_IISFCON_TXENABLE (1<<13) | ||
| 61 | #define S3C2410_IISFCON_RXENABLE (1<<12) | ||
| 62 | #define S3C2410_IISFCON_TXMASK (0x3f << 6) | ||
| 63 | #define S3C2410_IISFCON_TXSHIFT (6) | ||
| 64 | #define S3C2410_IISFCON_RXMASK (0x3f) | ||
| 65 | #define S3C2410_IISFCON_RXSHIFT (0) | ||
| 66 | |||
| 67 | #define S3C2410_IISFIFO (0x10) | ||
| 68 | #endif /* __ASM_ARCH_REGS_IIS_H */ | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-spi.h b/arch/arm/plat-s3c24xx/include/plat/regs-spi.h deleted file mode 100644 index 892e2f680fca..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/regs-spi.h +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | /* arch/arm/mach-s3c2410/include/mach/regs-spi.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004 Fetron GmbH | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify | ||
| 6 | * it under the terms of the GNU General Public License version 2 as | ||
| 7 | * published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * S3C2410 SPI register definition | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef __ASM_ARCH_REGS_SPI_H | ||
| 13 | #define __ASM_ARCH_REGS_SPI_H | ||
| 14 | |||
| 15 | #define S3C2410_SPI1 (0x20) | ||
| 16 | #define S3C2412_SPI1 (0x100) | ||
| 17 | |||
| 18 | #define S3C2410_SPCON (0x00) | ||
| 19 | |||
| 20 | #define S3C2412_SPCON_RXFIFO_RB2 (0<<14) | ||
| 21 | #define S3C2412_SPCON_RXFIFO_RB4 (1<<14) | ||
| 22 | #define S3C2412_SPCON_RXFIFO_RB12 (2<<14) | ||
| 23 | #define S3C2412_SPCON_RXFIFO_RB14 (3<<14) | ||
| 24 | #define S3C2412_SPCON_TXFIFO_RB2 (0<<12) | ||
| 25 | #define S3C2412_SPCON_TXFIFO_RB4 (1<<12) | ||
| 26 | #define S3C2412_SPCON_TXFIFO_RB12 (2<<12) | ||
| 27 | #define S3C2412_SPCON_TXFIFO_RB14 (3<<12) | ||
| 28 | #define S3C2412_SPCON_RXFIFO_RESET (1<<11) /* RxFIFO reset */ | ||
| 29 | #define S3C2412_SPCON_TXFIFO_RESET (1<<10) /* TxFIFO reset */ | ||
| 30 | #define S3C2412_SPCON_RXFIFO_EN (1<<9) /* RxFIFO Enable */ | ||
| 31 | #define S3C2412_SPCON_TXFIFO_EN (1<<8) /* TxFIFO Enable */ | ||
| 32 | |||
| 33 | #define S3C2412_SPCON_DIRC_RX (1<<7) | ||
| 34 | |||
| 35 | #define S3C2410_SPCON_SMOD_DMA (2<<5) /* DMA mode */ | ||
| 36 | #define S3C2410_SPCON_SMOD_INT (1<<5) /* interrupt mode */ | ||
| 37 | #define S3C2410_SPCON_SMOD_POLL (0<<5) /* polling mode */ | ||
| 38 | #define S3C2410_SPCON_ENSCK (1<<4) /* Enable SCK */ | ||
| 39 | #define S3C2410_SPCON_MSTR (1<<3) /* Master/Slave select | ||
| 40 | 0: slave, 1: master */ | ||
| 41 | #define S3C2410_SPCON_CPOL_HIGH (1<<2) /* Clock polarity select */ | ||
| 42 | #define S3C2410_SPCON_CPOL_LOW (0<<2) /* Clock polarity select */ | ||
| 43 | |||
| 44 | #define S3C2410_SPCON_CPHA_FMTB (1<<1) /* Clock Phase Select */ | ||
| 45 | #define S3C2410_SPCON_CPHA_FMTA (0<<1) /* Clock Phase Select */ | ||
| 46 | |||
| 47 | #define S3C2410_SPCON_TAGD (1<<0) /* Tx auto garbage data mode */ | ||
| 48 | |||
| 49 | |||
| 50 | #define S3C2410_SPSTA (0x04) | ||
| 51 | |||
| 52 | #define S3C2412_SPSTA_RXFIFO_AE (1<<11) | ||
| 53 | #define S3C2412_SPSTA_TXFIFO_AE (1<<10) | ||
| 54 | #define S3C2412_SPSTA_RXFIFO_ERROR (1<<9) | ||
| 55 | #define S3C2412_SPSTA_TXFIFO_ERROR (1<<8) | ||
| 56 | #define S3C2412_SPSTA_RXFIFO_FIFO (1<<7) | ||
| 57 | #define S3C2412_SPSTA_RXFIFO_EMPTY (1<<6) | ||
| 58 | #define S3C2412_SPSTA_TXFIFO_NFULL (1<<5) | ||
| 59 | #define S3C2412_SPSTA_TXFIFO_EMPTY (1<<4) | ||
| 60 | |||
| 61 | #define S3C2410_SPSTA_DCOL (1<<2) /* Data Collision Error */ | ||
| 62 | #define S3C2410_SPSTA_MULD (1<<1) /* Multi Master Error */ | ||
| 63 | #define S3C2410_SPSTA_READY (1<<0) /* Data Tx/Rx ready */ | ||
| 64 | #define S3C2412_SPSTA_READY_ORG (1<<3) | ||
| 65 | |||
| 66 | #define S3C2410_SPPIN (0x08) | ||
| 67 | |||
| 68 | #define S3C2410_SPPIN_ENMUL (1<<2) /* Multi Master Error detect */ | ||
| 69 | #define S3C2410_SPPIN_RESERVED (1<<1) | ||
| 70 | #define S3C2410_SPPIN_KEEP (1<<0) /* Master Out keep */ | ||
| 71 | |||
| 72 | #define S3C2410_SPPRE (0x0C) | ||
| 73 | #define S3C2410_SPTDAT (0x10) | ||
| 74 | #define S3C2410_SPRDAT (0x14) | ||
| 75 | |||
| 76 | #define S3C2412_TXFIFO (0x18) | ||
| 77 | #define S3C2412_RXFIFO (0x18) | ||
| 78 | #define S3C2412_SPFIC (0x24) | ||
| 79 | |||
| 80 | |||
| 81 | #endif /* __ASM_ARCH_REGS_SPI_H */ | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/regs-udc.h b/arch/arm/plat-s3c24xx/include/plat/regs-udc.h deleted file mode 100644 index f0dd4a41b37b..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/regs-udc.h +++ /dev/null | |||
| @@ -1,153 +0,0 @@ | |||
| 1 | /* arch/arm/mach-s3c2410/include/mach/regs-udc.h | ||
| 2 | * | ||
| 3 | * Copyright (C) 2004 Herbert Poetzl <herbert@13thfloor.at> | ||
| 4 | * | ||
| 5 | * This include file is free software; you can redistribute it and/or | ||
| 6 | * modify it under the terms of the GNU General Public License as | ||
| 7 | * published by the Free Software Foundation; either version 2 of | ||
| 8 | * the License, or (at your option) any later version. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __ASM_ARCH_REGS_UDC_H | ||
| 12 | #define __ASM_ARCH_REGS_UDC_H | ||
| 13 | |||
| 14 | #define S3C2410_USBDREG(x) (x) | ||
| 15 | |||
| 16 | #define S3C2410_UDC_FUNC_ADDR_REG S3C2410_USBDREG(0x0140) | ||
| 17 | #define S3C2410_UDC_PWR_REG S3C2410_USBDREG(0x0144) | ||
| 18 | #define S3C2410_UDC_EP_INT_REG S3C2410_USBDREG(0x0148) | ||
| 19 | |||
| 20 | #define S3C2410_UDC_USB_INT_REG S3C2410_USBDREG(0x0158) | ||
| 21 | #define S3C2410_UDC_EP_INT_EN_REG S3C2410_USBDREG(0x015c) | ||
| 22 | |||
| 23 | #define S3C2410_UDC_USB_INT_EN_REG S3C2410_USBDREG(0x016c) | ||
| 24 | |||
| 25 | #define S3C2410_UDC_FRAME_NUM1_REG S3C2410_USBDREG(0x0170) | ||
| 26 | #define S3C2410_UDC_FRAME_NUM2_REG S3C2410_USBDREG(0x0174) | ||
| 27 | |||
| 28 | #define S3C2410_UDC_EP0_FIFO_REG S3C2410_USBDREG(0x01c0) | ||
| 29 | #define S3C2410_UDC_EP1_FIFO_REG S3C2410_USBDREG(0x01c4) | ||
| 30 | #define S3C2410_UDC_EP2_FIFO_REG S3C2410_USBDREG(0x01c8) | ||
| 31 | #define S3C2410_UDC_EP3_FIFO_REG S3C2410_USBDREG(0x01cc) | ||
| 32 | #define S3C2410_UDC_EP4_FIFO_REG S3C2410_USBDREG(0x01d0) | ||
| 33 | |||
| 34 | #define S3C2410_UDC_EP1_DMA_CON S3C2410_USBDREG(0x0200) | ||
| 35 | #define S3C2410_UDC_EP1_DMA_UNIT S3C2410_USBDREG(0x0204) | ||
| 36 | #define S3C2410_UDC_EP1_DMA_FIFO S3C2410_USBDREG(0x0208) | ||
| 37 | #define S3C2410_UDC_EP1_DMA_TTC_L S3C2410_USBDREG(0x020c) | ||
| 38 | #define S3C2410_UDC_EP1_DMA_TTC_M S3C2410_USBDREG(0x0210) | ||
| 39 | #define S3C2410_UDC_EP1_DMA_TTC_H S3C2410_USBDREG(0x0214) | ||
| 40 | |||
| 41 | #define S3C2410_UDC_EP2_DMA_CON S3C2410_USBDREG(0x0218) | ||
| 42 | #define S3C2410_UDC_EP2_DMA_UNIT S3C2410_USBDREG(0x021c) | ||
| 43 | #define S3C2410_UDC_EP2_DMA_FIFO S3C2410_USBDREG(0x0220) | ||
| 44 | #define S3C2410_UDC_EP2_DMA_TTC_L S3C2410_USBDREG(0x0224) | ||
| 45 | #define S3C2410_UDC_EP2_DMA_TTC_M S3C2410_USBDREG(0x0228) | ||
| 46 | #define S3C2410_UDC_EP2_DMA_TTC_H S3C2410_USBDREG(0x022c) | ||
| 47 | |||
| 48 | #define S3C2410_UDC_EP3_DMA_CON S3C2410_USBDREG(0x0240) | ||
| 49 | #define S3C2410_UDC_EP3_DMA_UNIT S3C2410_USBDREG(0x0244) | ||
| 50 | #define S3C2410_UDC_EP3_DMA_FIFO S3C2410_USBDREG(0x0248) | ||
| 51 | #define S3C2410_UDC_EP3_DMA_TTC_L S3C2410_USBDREG(0x024c) | ||
| 52 | #define S3C2410_UDC_EP3_DMA_TTC_M S3C2410_USBDREG(0x0250) | ||
| 53 | #define S3C2410_UDC_EP3_DMA_TTC_H S3C2410_USBDREG(0x0254) | ||
| 54 | |||
| 55 | #define S3C2410_UDC_EP4_DMA_CON S3C2410_USBDREG(0x0258) | ||
| 56 | #define S3C2410_UDC_EP4_DMA_UNIT S3C2410_USBDREG(0x025c) | ||
| 57 | #define S3C2410_UDC_EP4_DMA_FIFO S3C2410_USBDREG(0x0260) | ||
| 58 | #define S3C2410_UDC_EP4_DMA_TTC_L S3C2410_USBDREG(0x0264) | ||
| 59 | #define S3C2410_UDC_EP4_DMA_TTC_M S3C2410_USBDREG(0x0268) | ||
| 60 | #define S3C2410_UDC_EP4_DMA_TTC_H S3C2410_USBDREG(0x026c) | ||
| 61 | |||
| 62 | #define S3C2410_UDC_INDEX_REG S3C2410_USBDREG(0x0178) | ||
| 63 | |||
| 64 | /* indexed registers */ | ||
| 65 | |||
| 66 | #define S3C2410_UDC_MAXP_REG S3C2410_USBDREG(0x0180) | ||
| 67 | |||
| 68 | #define S3C2410_UDC_EP0_CSR_REG S3C2410_USBDREG(0x0184) | ||
| 69 | |||
| 70 | #define S3C2410_UDC_IN_CSR1_REG S3C2410_USBDREG(0x0184) | ||
| 71 | #define S3C2410_UDC_IN_CSR2_REG S3C2410_USBDREG(0x0188) | ||
| 72 | |||
| 73 | #define S3C2410_UDC_OUT_CSR1_REG S3C2410_USBDREG(0x0190) | ||
| 74 | #define S3C2410_UDC_OUT_CSR2_REG S3C2410_USBDREG(0x0194) | ||
| 75 | #define S3C2410_UDC_OUT_FIFO_CNT1_REG S3C2410_USBDREG(0x0198) | ||
| 76 | #define S3C2410_UDC_OUT_FIFO_CNT2_REG S3C2410_USBDREG(0x019c) | ||
| 77 | |||
| 78 | #define S3C2410_UDC_FUNCADDR_UPDATE (1<<7) | ||
| 79 | |||
| 80 | #define S3C2410_UDC_PWR_ISOUP (1<<7) // R/W | ||
| 81 | #define S3C2410_UDC_PWR_RESET (1<<3) // R | ||
| 82 | #define S3C2410_UDC_PWR_RESUME (1<<2) // R/W | ||
| 83 | #define S3C2410_UDC_PWR_SUSPEND (1<<1) // R | ||
| 84 | #define S3C2410_UDC_PWR_ENSUSPEND (1<<0) // R/W | ||
| 85 | |||
| 86 | #define S3C2410_UDC_PWR_DEFAULT 0x00 | ||
| 87 | |||
| 88 | #define S3C2410_UDC_INT_EP4 (1<<4) // R/W (clear only) | ||
| 89 | #define S3C2410_UDC_INT_EP3 (1<<3) // R/W (clear only) | ||
| 90 | #define S3C2410_UDC_INT_EP2 (1<<2) // R/W (clear only) | ||
| 91 | #define S3C2410_UDC_INT_EP1 (1<<1) // R/W (clear only) | ||
| 92 | #define S3C2410_UDC_INT_EP0 (1<<0) // R/W (clear only) | ||
| 93 | |||
| 94 | #define S3C2410_UDC_USBINT_RESET (1<<2) // R/W (clear only) | ||
| 95 | #define S3C2410_UDC_USBINT_RESUME (1<<1) // R/W (clear only) | ||
| 96 | #define S3C2410_UDC_USBINT_SUSPEND (1<<0) // R/W (clear only) | ||
| 97 | |||
| 98 | #define S3C2410_UDC_INTE_EP4 (1<<4) // R/W | ||
| 99 | #define S3C2410_UDC_INTE_EP3 (1<<3) // R/W | ||
| 100 | #define S3C2410_UDC_INTE_EP2 (1<<2) // R/W | ||
| 101 | #define S3C2410_UDC_INTE_EP1 (1<<1) // R/W | ||
| 102 | #define S3C2410_UDC_INTE_EP0 (1<<0) // R/W | ||
| 103 | |||
| 104 | #define S3C2410_UDC_USBINTE_RESET (1<<2) // R/W | ||
| 105 | #define S3C2410_UDC_USBINTE_SUSPEND (1<<0) // R/W | ||
| 106 | |||
| 107 | |||
| 108 | #define S3C2410_UDC_INDEX_EP0 (0x00) | ||
| 109 | #define S3C2410_UDC_INDEX_EP1 (0x01) // ?? | ||
| 110 | #define S3C2410_UDC_INDEX_EP2 (0x02) // ?? | ||
| 111 | #define S3C2410_UDC_INDEX_EP3 (0x03) // ?? | ||
| 112 | #define S3C2410_UDC_INDEX_EP4 (0x04) // ?? | ||
| 113 | |||
| 114 | #define S3C2410_UDC_ICSR1_CLRDT (1<<6) // R/W | ||
| 115 | #define S3C2410_UDC_ICSR1_SENTSTL (1<<5) // R/W (clear only) | ||
| 116 | #define S3C2410_UDC_ICSR1_SENDSTL (1<<4) // R/W | ||
| 117 | #define S3C2410_UDC_ICSR1_FFLUSH (1<<3) // W (set only) | ||
| 118 | #define S3C2410_UDC_ICSR1_UNDRUN (1<<2) // R/W (clear only) | ||
| 119 | #define S3C2410_UDC_ICSR1_PKTRDY (1<<0) // R/W (set only) | ||
| 120 | |||
| 121 | #define S3C2410_UDC_ICSR2_AUTOSET (1<<7) // R/W | ||
| 122 | #define S3C2410_UDC_ICSR2_ISO (1<<6) // R/W | ||
| 123 | #define S3C2410_UDC_ICSR2_MODEIN (1<<5) // R/W | ||
| 124 | #define S3C2410_UDC_ICSR2_DMAIEN (1<<4) // R/W | ||
| 125 | |||
| 126 | #define S3C2410_UDC_OCSR1_CLRDT (1<<7) // R/W | ||
| 127 | #define S3C2410_UDC_OCSR1_SENTSTL (1<<6) // R/W (clear only) | ||
| 128 | #define S3C2410_UDC_OCSR1_SENDSTL (1<<5) // R/W | ||
| 129 | #define S3C2410_UDC_OCSR1_FFLUSH (1<<4) // R/W | ||
| 130 | #define S3C2410_UDC_OCSR1_DERROR (1<<3) // R | ||
| 131 | #define S3C2410_UDC_OCSR1_OVRRUN (1<<2) // R/W (clear only) | ||
| 132 | #define S3C2410_UDC_OCSR1_PKTRDY (1<<0) // R/W (clear only) | ||
| 133 | |||
| 134 | #define S3C2410_UDC_OCSR2_AUTOCLR (1<<7) // R/W | ||
| 135 | #define S3C2410_UDC_OCSR2_ISO (1<<6) // R/W | ||
| 136 | #define S3C2410_UDC_OCSR2_DMAIEN (1<<5) // R/W | ||
| 137 | |||
| 138 | #define S3C2410_UDC_EP0_CSR_OPKRDY (1<<0) | ||
| 139 | #define S3C2410_UDC_EP0_CSR_IPKRDY (1<<1) | ||
| 140 | #define S3C2410_UDC_EP0_CSR_SENTSTL (1<<2) | ||
| 141 | #define S3C2410_UDC_EP0_CSR_DE (1<<3) | ||
| 142 | #define S3C2410_UDC_EP0_CSR_SE (1<<4) | ||
| 143 | #define S3C2410_UDC_EP0_CSR_SENDSTL (1<<5) | ||
| 144 | #define S3C2410_UDC_EP0_CSR_SOPKTRDY (1<<6) | ||
| 145 | #define S3C2410_UDC_EP0_CSR_SSE (1<<7) | ||
| 146 | |||
| 147 | #define S3C2410_UDC_MAXP_8 (1<<0) | ||
| 148 | #define S3C2410_UDC_MAXP_16 (1<<1) | ||
| 149 | #define S3C2410_UDC_MAXP_32 (1<<2) | ||
| 150 | #define S3C2410_UDC_MAXP_64 (1<<3) | ||
| 151 | |||
| 152 | |||
| 153 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h b/arch/arm/plat-s3c24xx/include/plat/s3c2410.h deleted file mode 100644 index 82ab4aad1bbe..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2410.h +++ /dev/null | |||
| @@ -1,33 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2410.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Header file for s3c2410 machine directory | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | * | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifdef CONFIG_CPU_S3C2410 | ||
| 15 | |||
| 16 | extern int s3c2410_init(void); | ||
| 17 | extern int s3c2410a_init(void); | ||
| 18 | |||
| 19 | extern void s3c2410_map_io(void); | ||
| 20 | |||
| 21 | extern void s3c2410_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
| 22 | |||
| 23 | extern void s3c2410_init_clocks(int xtal); | ||
| 24 | |||
| 25 | #else | ||
| 26 | #define s3c2410_init_clocks NULL | ||
| 27 | #define s3c2410_init_uarts NULL | ||
| 28 | #define s3c2410_map_io NULL | ||
| 29 | #define s3c2410_init NULL | ||
| 30 | #define s3c2410a_init NULL | ||
| 31 | #endif | ||
| 32 | |||
| 33 | extern int s3c2410_baseclk_add(void); | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h b/arch/arm/plat-s3c24xx/include/plat/s3c2412.h deleted file mode 100644 index bb15d3b68be5..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2412.h +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2412.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2006 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Header file for s3c2412 cpu support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifdef CONFIG_CPU_S3C2412 | ||
| 14 | |||
| 15 | extern int s3c2412_init(void); | ||
| 16 | |||
| 17 | extern void s3c2412_map_io(void); | ||
| 18 | |||
| 19 | extern void s3c2412_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
| 20 | |||
| 21 | extern void s3c2412_init_clocks(int xtal); | ||
| 22 | |||
| 23 | extern int s3c2412_baseclk_add(void); | ||
| 24 | #else | ||
| 25 | #define s3c2412_init_clocks NULL | ||
| 26 | #define s3c2412_init_uarts NULL | ||
| 27 | #define s3c2412_map_io NULL | ||
| 28 | #define s3c2412_init NULL | ||
| 29 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h b/arch/arm/plat-s3c24xx/include/plat/s3c2416.h deleted file mode 100644 index dc3c0907d221..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2416.h +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2443.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2009 Yauhen Kharuzhy <jekhor@gmail.com> | ||
| 4 | * | ||
| 5 | * Header file for s3c2416 cpu support | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifdef CONFIG_CPU_S3C2416 | ||
| 13 | |||
| 14 | struct s3c2410_uartcfg; | ||
| 15 | |||
| 16 | extern int s3c2416_init(void); | ||
| 17 | |||
| 18 | extern void s3c2416_map_io(void); | ||
| 19 | |||
| 20 | extern void s3c2416_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
| 21 | |||
| 22 | extern void s3c2416_init_clocks(int xtal); | ||
| 23 | |||
| 24 | extern int s3c2416_baseclk_add(void); | ||
| 25 | |||
| 26 | #else | ||
| 27 | #define s3c2416_init_clocks NULL | ||
| 28 | #define s3c2416_init_uarts NULL | ||
| 29 | #define s3c2416_map_io NULL | ||
| 30 | #define s3c2416_init NULL | ||
| 31 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h b/arch/arm/plat-s3c24xx/include/plat/s3c2443.h deleted file mode 100644 index a19715feb798..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c2443.h +++ /dev/null | |||
| @@ -1,51 +0,0 @@ | |||
| 1 | /* linux/include/asm-arm/plat-s3c24xx/s3c2443.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Header file for s3c2443 cpu support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifdef CONFIG_CPU_S3C2443 | ||
| 14 | |||
| 15 | struct s3c2410_uartcfg; | ||
| 16 | |||
| 17 | extern int s3c2443_init(void); | ||
| 18 | |||
| 19 | extern void s3c2443_map_io(void); | ||
| 20 | |||
| 21 | extern void s3c2443_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
| 22 | |||
| 23 | extern void s3c2443_init_clocks(int xtal); | ||
| 24 | |||
| 25 | extern int s3c2443_baseclk_add(void); | ||
| 26 | |||
| 27 | #else | ||
| 28 | #define s3c2443_init_clocks NULL | ||
| 29 | #define s3c2443_init_uarts NULL | ||
| 30 | #define s3c2443_map_io NULL | ||
| 31 | #define s3c2443_init NULL | ||
| 32 | #endif | ||
| 33 | |||
| 34 | /* common code used by s3c2443 and others. | ||
| 35 | * note, not to be used outside of arch/arm/mach-s3c* */ | ||
| 36 | |||
| 37 | struct clk; /* some files don't need clk.h otherwise */ | ||
| 38 | |||
| 39 | typedef unsigned int (*pll_fn)(unsigned int reg, unsigned int base); | ||
| 40 | typedef unsigned int (*fdiv_fn)(unsigned long clkcon0); | ||
| 41 | |||
| 42 | extern void s3c2443_common_setup_clocks(pll_fn get_mpll, fdiv_fn fdiv); | ||
| 43 | extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, fdiv_fn fdiv); | ||
| 44 | |||
| 45 | extern int s3c2443_clkcon_enable_h(struct clk *clk, int enable); | ||
| 46 | extern int s3c2443_clkcon_enable_p(struct clk *clk, int enable); | ||
| 47 | extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable); | ||
| 48 | |||
| 49 | extern struct clksrc_clk clk_epllref; | ||
| 50 | extern struct clksrc_clk clk_esysclk; | ||
| 51 | extern struct clksrc_clk clk_msysclk; | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h deleted file mode 100644 index 89e8d0a25f87..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h +++ /dev/null | |||
| @@ -1,42 +0,0 @@ | |||
| 1 | /* linux/arch/arm/plat-s3c24xx/include/plat/s3c244x.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2004-2005 Simtec Electronics | ||
| 4 | * Ben Dooks <ben@simtec.co.uk> | ||
| 5 | * | ||
| 6 | * Header file for S3C2440 and S3C2442 cpu support | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442) | ||
| 14 | |||
| 15 | extern void s3c244x_map_io(void); | ||
| 16 | |||
| 17 | extern void s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
| 18 | |||
| 19 | extern void s3c244x_init_clocks(int xtal); | ||
| 20 | |||
| 21 | #else | ||
| 22 | #define s3c244x_init_clocks NULL | ||
| 23 | #define s3c244x_init_uarts NULL | ||
| 24 | #endif | ||
| 25 | |||
| 26 | #ifdef CONFIG_CPU_S3C2440 | ||
| 27 | extern int s3c2440_init(void); | ||
| 28 | |||
| 29 | extern void s3c2440_map_io(void); | ||
| 30 | #else | ||
| 31 | #define s3c2440_init NULL | ||
| 32 | #define s3c2440_map_io NULL | ||
| 33 | #endif | ||
| 34 | |||
| 35 | #ifdef CONFIG_CPU_S3C2442 | ||
| 36 | extern int s3c2442_init(void); | ||
| 37 | |||
| 38 | extern void s3c2442_map_io(void); | ||
| 39 | #else | ||
| 40 | #define s3c2442_init NULL | ||
| 41 | #define s3c2442_map_io NULL | ||
| 42 | #endif | ||
diff --git a/arch/arm/plat-s3c24xx/include/plat/udc.h b/arch/arm/plat-s3c24xx/include/plat/udc.h deleted file mode 100644 index f63884242506..000000000000 --- a/arch/arm/plat-s3c24xx/include/plat/udc.h +++ /dev/null | |||
| @@ -1,57 +0,0 @@ | |||
| 1 | /* arch/arm/mach-s3c2410/include/mach/udc.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2005 Arnaud Patard <arnaud.patard@rtp-net.org> | ||
| 4 | * | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * | ||
| 11 | * Changelog: | ||
| 12 | * 14-Mar-2005 RTP Created file | ||
| 13 | * 02-Aug-2005 RTP File rename | ||
| 14 | * 07-Sep-2005 BJD Minor cleanups, changed cmd to enum | ||
| 15 | * 18-Jan-2007 HMW Add per-platform vbus_draw function | ||
| 16 | */ | ||
| 17 | |||
| 18 | #ifndef __ASM_ARM_ARCH_UDC_H | ||
| 19 | #define __ASM_ARM_ARCH_UDC_H | ||
| 20 | |||
| 21 | enum s3c2410_udc_cmd_e { | ||
| 22 | S3C2410_UDC_P_ENABLE = 1, /* Pull-up enable */ | ||
| 23 | S3C2410_UDC_P_DISABLE = 2, /* Pull-up disable */ | ||
| 24 | S3C2410_UDC_P_RESET = 3, /* UDC reset, in case of */ | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct s3c2410_udc_mach_info { | ||
| 28 | void (*udc_command)(enum s3c2410_udc_cmd_e); | ||
| 29 | void (*vbus_draw)(unsigned int ma); | ||
| 30 | |||
| 31 | unsigned int pullup_pin; | ||
| 32 | unsigned int pullup_pin_inverted; | ||
| 33 | |||
| 34 | unsigned int vbus_pin; | ||
| 35 | unsigned char vbus_pin_inverted; | ||
| 36 | }; | ||
| 37 | |||
| 38 | extern void __init s3c24xx_udc_set_platdata(struct s3c2410_udc_mach_info *); | ||
| 39 | |||
| 40 | /** | ||
| 41 | * s3c24xx_hsudc_platdata - Platform data for USB High-Speed gadget controller. | ||
| 42 | * @epnum: Number of endpoints to be instantiated by the controller driver. | ||
| 43 | * @gpio_init: Platform specific USB related GPIO initialization. | ||
| 44 | * @gpio_uninit: Platform specific USB releted GPIO uninitialzation. | ||
| 45 | * | ||
| 46 | * Representation of platform data for the S3C24XX USB 2.0 High Speed gadget | ||
| 47 | * controllers. | ||
| 48 | */ | ||
| 49 | struct s3c24xx_hsudc_platdata { | ||
| 50 | unsigned int epnum; | ||
| 51 | void (*gpio_init)(void); | ||
| 52 | void (*gpio_uninit)(void); | ||
| 53 | }; | ||
| 54 | |||
| 55 | extern void __init s3c24xx_hsudc_set_platdata(struct s3c24xx_hsudc_platdata *pd); | ||
| 56 | |||
| 57 | #endif /* __ASM_ARM_ARCH_UDC_H */ | ||
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/plat-s3c24xx/s3c2443-clock.c index 59552c0ea5fb..5a21b15b2a97 100644 --- a/arch/arm/plat-s3c24xx/s3c2443-clock.c +++ b/arch/arm/plat-s3c24xx/s3c2443-clock.c | |||
| @@ -160,6 +160,124 @@ static struct clk clk_prediv = { | |||
| 160 | }, | 160 | }, |
| 161 | }; | 161 | }; |
| 162 | 162 | ||
| 163 | /* armdiv | ||
| 164 | * | ||
| 165 | * this clock is sourced from msysclk and can have a number of | ||
| 166 | * divider values applied to it to then be fed into armclk. | ||
| 167 | */ | ||
| 168 | |||
| 169 | static unsigned int *armdiv; | ||
| 170 | static int nr_armdiv; | ||
| 171 | static int armdivmask; | ||
| 172 | |||
| 173 | static unsigned long s3c2443_armclk_roundrate(struct clk *clk, | ||
| 174 | unsigned long rate) | ||
| 175 | { | ||
| 176 | unsigned long parent = clk_get_rate(clk->parent); | ||
| 177 | unsigned long calc; | ||
| 178 | unsigned best = 256; /* bigger than any value */ | ||
| 179 | unsigned div; | ||
| 180 | int ptr; | ||
| 181 | |||
| 182 | if (!nr_armdiv) | ||
| 183 | return -EINVAL; | ||
| 184 | |||
| 185 | for (ptr = 0; ptr < nr_armdiv; ptr++) { | ||
| 186 | div = armdiv[ptr]; | ||
| 187 | if (div) { | ||
| 188 | /* cpufreq provides 266mhz as 266666000 not 266666666 */ | ||
| 189 | calc = (parent / div / 1000) * 1000; | ||
| 190 | if (calc <= rate && div < best) | ||
| 191 | best = div; | ||
| 192 | } | ||
| 193 | } | ||
| 194 | |||
| 195 | return parent / best; | ||
| 196 | } | ||
| 197 | |||
| 198 | static unsigned long s3c2443_armclk_getrate(struct clk *clk) | ||
| 199 | { | ||
| 200 | unsigned long rate = clk_get_rate(clk->parent); | ||
| 201 | unsigned long clkcon0; | ||
| 202 | int val; | ||
| 203 | |||
| 204 | if (!nr_armdiv || !armdivmask) | ||
| 205 | return -EINVAL; | ||
| 206 | |||
| 207 | clkcon0 = __raw_readl(S3C2443_CLKDIV0); | ||
| 208 | clkcon0 &= armdivmask; | ||
| 209 | val = clkcon0 >> S3C2443_CLKDIV0_ARMDIV_SHIFT; | ||
| 210 | |||
| 211 | return rate / armdiv[val]; | ||
| 212 | } | ||
| 213 | |||
| 214 | static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate) | ||
| 215 | { | ||
| 216 | unsigned long parent = clk_get_rate(clk->parent); | ||
| 217 | unsigned long calc; | ||
| 218 | unsigned div; | ||
| 219 | unsigned best = 256; /* bigger than any value */ | ||
| 220 | int ptr; | ||
| 221 | int val = -1; | ||
| 222 | |||
| 223 | if (!nr_armdiv || !armdivmask) | ||
| 224 | return -EINVAL; | ||
| 225 | |||
| 226 | for (ptr = 0; ptr < nr_armdiv; ptr++) { | ||
| 227 | div = armdiv[ptr]; | ||
| 228 | if (div) { | ||
| 229 | /* cpufreq provides 266mhz as 266666000 not 266666666 */ | ||
| 230 | calc = (parent / div / 1000) * 1000; | ||
| 231 | if (calc <= rate && div < best) { | ||
| 232 | best = div; | ||
| 233 | val = ptr; | ||
| 234 | } | ||
| 235 | } | ||
| 236 | } | ||
| 237 | |||
| 238 | if (val >= 0) { | ||
| 239 | unsigned long clkcon0; | ||
| 240 | |||
| 241 | clkcon0 = __raw_readl(S3C2443_CLKDIV0); | ||
| 242 | clkcon0 &= ~armdivmask; | ||
| 243 | clkcon0 |= val << S3C2443_CLKDIV0_ARMDIV_SHIFT; | ||
| 244 | __raw_writel(clkcon0, S3C2443_CLKDIV0); | ||
| 245 | } | ||
| 246 | |||
| 247 | return (val == -1) ? -EINVAL : 0; | ||
| 248 | } | ||
| 249 | |||
| 250 | static struct clk clk_armdiv = { | ||
| 251 | .name = "armdiv", | ||
| 252 | .parent = &clk_msysclk.clk, | ||
| 253 | .ops = &(struct clk_ops) { | ||
| 254 | .round_rate = s3c2443_armclk_roundrate, | ||
| 255 | .get_rate = s3c2443_armclk_getrate, | ||
| 256 | .set_rate = s3c2443_armclk_setrate, | ||
| 257 | }, | ||
| 258 | }; | ||
| 259 | |||
| 260 | /* armclk | ||
| 261 | * | ||
| 262 | * this is the clock fed into the ARM core itself, from armdiv or from hclk. | ||
| 263 | */ | ||
| 264 | |||
| 265 | static struct clk *clk_arm_sources[] = { | ||
| 266 | [0] = &clk_armdiv, | ||
| 267 | [1] = &clk_h, | ||
| 268 | }; | ||
| 269 | |||
| 270 | static struct clksrc_clk clk_arm = { | ||
| 271 | .clk = { | ||
| 272 | .name = "armclk", | ||
| 273 | }, | ||
| 274 | .sources = &(struct clksrc_sources) { | ||
| 275 | .sources = clk_arm_sources, | ||
| 276 | .nr_sources = ARRAY_SIZE(clk_arm_sources), | ||
| 277 | }, | ||
| 278 | .reg_src = { .reg = S3C2443_CLKDIV0, .size = 1, .shift = 13 }, | ||
| 279 | }; | ||
| 280 | |||
| 163 | /* usbhost | 281 | /* usbhost |
| 164 | * | 282 | * |
| 165 | * usb host bus-clock, usually 48MHz to provide USB bus clock timing | 283 | * usb host bus-clock, usually 48MHz to provide USB bus clock timing |
| @@ -205,9 +323,64 @@ static struct clksrc_clk clksrc_clks[] = { | |||
| 205 | }, | 323 | }, |
| 206 | }; | 324 | }; |
| 207 | 325 | ||
| 326 | static struct clk clk_i2s_ext = { | ||
| 327 | .name = "i2s-ext", | ||
| 328 | }; | ||
| 329 | |||
| 330 | /* i2s_eplldiv | ||
| 331 | * | ||
| 332 | * This clock is the output from the I2S divisor of ESYSCLK, and is separate | ||
| 333 | * from the mux that comes after it (cannot merge into one single clock) | ||
| 334 | */ | ||
| 335 | |||
| 336 | static struct clksrc_clk clk_i2s_eplldiv = { | ||
| 337 | .clk = { | ||
| 338 | .name = "i2s-eplldiv", | ||
| 339 | .parent = &clk_esysclk.clk, | ||
| 340 | }, | ||
| 341 | .reg_div = { .reg = S3C2443_CLKDIV1, .size = 4, .shift = 12, }, | ||
| 342 | }; | ||
| 343 | |||
| 344 | /* i2s-ref | ||
| 345 | * | ||
| 346 | * i2s bus reference clock, selectable from external, esysclk or epllref | ||
| 347 | * | ||
| 348 | * Note, this used to be two clocks, but was compressed into one. | ||
| 349 | */ | ||
| 350 | |||
| 351 | static struct clk *clk_i2s_srclist[] = { | ||
| 352 | [0] = &clk_i2s_eplldiv.clk, | ||
| 353 | [1] = &clk_i2s_ext, | ||
| 354 | [2] = &clk_epllref.clk, | ||
| 355 | [3] = &clk_epllref.clk, | ||
| 356 | }; | ||
| 357 | |||
| 358 | static struct clksrc_clk clk_i2s = { | ||
| 359 | .clk = { | ||
| 360 | .name = "i2s-if", | ||
| 361 | .ctrlbit = S3C2443_SCLKCON_I2SCLK, | ||
| 362 | .enable = s3c2443_clkcon_enable_s, | ||
| 363 | |||
| 364 | }, | ||
| 365 | .sources = &(struct clksrc_sources) { | ||
| 366 | .sources = clk_i2s_srclist, | ||
| 367 | .nr_sources = ARRAY_SIZE(clk_i2s_srclist), | ||
| 368 | }, | ||
| 369 | .reg_src = { .reg = S3C2443_CLKSRC, .size = 2, .shift = 14 }, | ||
| 370 | }; | ||
| 208 | 371 | ||
| 209 | static struct clk init_clocks_off[] = { | 372 | static struct clk init_clocks_off[] = { |
| 210 | { | 373 | { |
| 374 | .name = "iis", | ||
| 375 | .parent = &clk_p, | ||
| 376 | .enable = s3c2443_clkcon_enable_p, | ||
| 377 | .ctrlbit = S3C2443_PCLKCON_IIS, | ||
| 378 | }, { | ||
| 379 | .name = "hsspi", | ||
| 380 | .parent = &clk_p, | ||
| 381 | .enable = s3c2443_clkcon_enable_p, | ||
| 382 | .ctrlbit = S3C2443_PCLKCON_HSSPI, | ||
| 383 | }, { | ||
| 211 | .name = "adc", | 384 | .name = "adc", |
| 212 | .parent = &clk_p, | 385 | .parent = &clk_p, |
| 213 | .enable = s3c2443_clkcon_enable_p, | 386 | .enable = s3c2443_clkcon_enable_p, |
| @@ -253,6 +426,7 @@ static struct clk init_clocks[] = { | |||
| 253 | .ctrlbit = S3C2443_HCLKCON_DMA5, | 426 | .ctrlbit = S3C2443_HCLKCON_DMA5, |
| 254 | }, { | 427 | }, { |
| 255 | .name = "hsmmc", | 428 | .name = "hsmmc", |
| 429 | .devname = "s3c-sdhci.1", | ||
| 256 | .parent = &clk_h, | 430 | .parent = &clk_h, |
| 257 | .enable = s3c2443_clkcon_enable_h, | 431 | .enable = s3c2443_clkcon_enable_h, |
| 258 | .ctrlbit = S3C2443_HCLKCON_HSMMC, | 432 | .ctrlbit = S3C2443_HCLKCON_HSMMC, |
| @@ -347,8 +521,7 @@ static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0) | |||
| 347 | 521 | ||
| 348 | /* EPLLCON compatible enough to get on/off information */ | 522 | /* EPLLCON compatible enough to get on/off information */ |
| 349 | 523 | ||
| 350 | void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll, | 524 | void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll) |
| 351 | fdiv_fn get_fdiv) | ||
| 352 | { | 525 | { |
| 353 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); | 526 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); |
| 354 | unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON); | 527 | unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON); |
| @@ -368,7 +541,7 @@ void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll, | |||
| 368 | pll = get_mpll(mpllcon, xtal); | 541 | pll = get_mpll(mpllcon, xtal); |
| 369 | clk_msysclk.clk.rate = pll; | 542 | clk_msysclk.clk.rate = pll; |
| 370 | 543 | ||
| 371 | fclk = pll / get_fdiv(clkdiv0); | 544 | fclk = clk_get_rate(&clk_armdiv); |
| 372 | hclk = s3c2443_prediv_getrate(&clk_prediv); | 545 | hclk = s3c2443_prediv_getrate(&clk_prediv); |
| 373 | hclk /= s3c2443_get_hdiv(clkdiv0); | 546 | hclk /= s3c2443_get_hdiv(clkdiv0); |
| 374 | pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1); | 547 | pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1); |
| @@ -403,20 +576,29 @@ static struct clk *clks[] __initdata = { | |||
| 403 | &clk_ext, | 576 | &clk_ext, |
| 404 | &clk_epll, | 577 | &clk_epll, |
| 405 | &clk_usb_bus, | 578 | &clk_usb_bus, |
| 579 | &clk_armdiv, | ||
| 406 | }; | 580 | }; |
| 407 | 581 | ||
| 408 | static struct clksrc_clk *clksrcs[] __initdata = { | 582 | static struct clksrc_clk *clksrcs[] __initdata = { |
| 583 | &clk_i2s_eplldiv, | ||
| 584 | &clk_i2s, | ||
| 409 | &clk_usb_bus_host, | 585 | &clk_usb_bus_host, |
| 410 | &clk_epllref, | 586 | &clk_epllref, |
| 411 | &clk_esysclk, | 587 | &clk_esysclk, |
| 412 | &clk_msysclk, | 588 | &clk_msysclk, |
| 589 | &clk_arm, | ||
| 413 | }; | 590 | }; |
| 414 | 591 | ||
| 415 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, | 592 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, |
| 416 | fdiv_fn get_fdiv) | 593 | unsigned int *divs, int nr_divs, |
| 594 | int divmask) | ||
| 417 | { | 595 | { |
| 418 | int ptr; | 596 | int ptr; |
| 419 | 597 | ||
| 598 | armdiv = divs; | ||
| 599 | nr_armdiv = nr_divs; | ||
| 600 | armdivmask = divmask; | ||
| 601 | |||
| 420 | /* s3c2443 parents h and p clocks from prediv */ | 602 | /* s3c2443 parents h and p clocks from prediv */ |
| 421 | clk_h.parent = &clk_prediv; | 603 | clk_h.parent = &clk_prediv; |
| 422 | clk_p.parent = &clk_prediv; | 604 | clk_p.parent = &clk_prediv; |
| @@ -437,5 +619,5 @@ void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, | |||
| 437 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 619 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
| 438 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 620 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
| 439 | 621 | ||
| 440 | s3c2443_common_setup_clocks(get_mpll, get_fdiv); | 622 | s3c2443_common_setup_clocks(get_mpll); |
| 441 | } | 623 | } |
