Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch for-rmk-devel of git://aeryn.fluff.org.uk/bjdooks/linux into devel

authored by

Russell King and committed by
Russell King
547c32ae b0efb424

+4530 -1359
+5 -5
Documentation/arm/Samsung-S3C24XX/GPIO.txt
··· 51 51 ----------- 52 52 53 53 Each pin has an unique number associated with it in regs-gpio.h, 54 - eg S3C2410_GPA0 or S3C2410_GPF1. These defines are used to tell 54 + eg S3C2410_GPA(0) or S3C2410_GPF(1). These defines are used to tell 55 55 the GPIO functions which pin is to be used. 56 56 57 57 ··· 65 65 66 66 Eg: 67 67 68 - s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0); 69 - s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1); 68 + s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); 69 + s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); 70 70 71 - which would turn GPA0 into the lowest Address line A0, and set 72 - GPE8 to be connected to the SDIO/MMC controller's SDDAT1 line. 71 + which would turn GPA(0) into the lowest Address line A0, and set 72 + GPE(8) to be connected to the SDIO/MMC controller's SDDAT1 line. 73 73 74 74 75 75 Reading the current configuration
+7
arch/arm/common/Kconfig
··· 4 4 config ARM_VIC 5 5 bool 6 6 7 + config ARM_VIC_NR 8 + int 9 + default 2 10 + help 11 + The maximum number of VICs available in the system, for 12 + power management. 13 + 7 14 config ICST525 8 15 bool 9 16
+214 -7
arch/arm/common/vic.c
··· 21 21 #include <linux/init.h> 22 22 #include <linux/list.h> 23 23 #include <linux/io.h> 24 + #include <linux/sysdev.h> 24 25 25 26 #include <asm/mach/irq.h> 26 27 #include <asm/hardware/vic.h> ··· 40 39 writel(1 << irq, base + VIC_INT_ENABLE); 41 40 } 42 41 42 + /** 43 + * vic_init2 - common initialisation code 44 + * @base: Base of the VIC. 45 + * 46 + * Common initialisation code for registeration 47 + * and resume. 48 + */ 49 + static void vic_init2(void __iomem *base) 50 + { 51 + int i; 52 + 53 + for (i = 0; i < 16; i++) { 54 + void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); 55 + writel(VIC_VECT_CNTL_ENABLE | i, reg); 56 + } 57 + 58 + writel(32, base + VIC_PL190_DEF_VECT_ADDR); 59 + } 60 + 61 + #if defined(CONFIG_PM) 62 + /** 63 + * struct vic_device - VIC PM device 64 + * @sysdev: The system device which is registered. 65 + * @irq: The IRQ number for the base of the VIC. 66 + * @base: The register base for the VIC. 67 + * @resume_sources: A bitmask of interrupts for resume. 68 + * @resume_irqs: The IRQs enabled for resume. 69 + * @int_select: Save for VIC_INT_SELECT. 70 + * @int_enable: Save for VIC_INT_ENABLE. 71 + * @soft_int: Save for VIC_INT_SOFT. 72 + * @protect: Save for VIC_PROTECT. 73 + */ 74 + struct vic_device { 75 + struct sys_device sysdev; 76 + 77 + void __iomem *base; 78 + int irq; 79 + u32 resume_sources; 80 + u32 resume_irqs; 81 + u32 int_select; 82 + u32 int_enable; 83 + u32 soft_int; 84 + u32 protect; 85 + }; 86 + 87 + /* we cannot allocate memory when VICs are initially registered */ 88 + static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; 89 + 90 + static inline struct vic_device *to_vic(struct sys_device *sys) 91 + { 92 + return container_of(sys, struct vic_device, sysdev); 93 + } 94 + 95 + static int vic_id; 96 + 97 + static int vic_class_resume(struct sys_device *dev) 98 + { 99 + struct vic_device *vic = to_vic(dev); 100 + void __iomem *base = vic->base; 101 + 102 + printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base); 103 + 104 + /* re-initialise static settings */ 105 + vic_init2(base); 106 + 107 + writel(vic->int_select, base + VIC_INT_SELECT); 108 + writel(vic->protect, base + VIC_PROTECT); 109 + 110 + /* set the enabled ints and then clear the non-enabled */ 111 + writel(vic->int_enable, base + VIC_INT_ENABLE); 112 + writel(~vic->int_enable, base + VIC_INT_ENABLE_CLEAR); 113 + 114 + /* and the same for the soft-int register */ 115 + 116 + writel(vic->soft_int, base + VIC_INT_SOFT); 117 + writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR); 118 + 119 + return 0; 120 + } 121 + 122 + static int vic_class_suspend(struct sys_device *dev, pm_message_t state) 123 + { 124 + struct vic_device *vic = to_vic(dev); 125 + void __iomem *base = vic->base; 126 + 127 + printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base); 128 + 129 + vic->int_select = readl(base + VIC_INT_SELECT); 130 + vic->int_enable = readl(base + VIC_INT_ENABLE); 131 + vic->soft_int = readl(base + VIC_INT_SOFT); 132 + vic->protect = readl(base + VIC_PROTECT); 133 + 134 + /* set the interrupts (if any) that are used for 135 + * resuming the system */ 136 + 137 + writel(vic->resume_irqs, base + VIC_INT_ENABLE); 138 + writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR); 139 + 140 + return 0; 141 + } 142 + 143 + struct sysdev_class vic_class = { 144 + .name = "vic", 145 + .suspend = vic_class_suspend, 146 + .resume = vic_class_resume, 147 + }; 148 + 149 + /** 150 + * vic_pm_register - Register a VIC for later power management control 151 + * @base: The base address of the VIC. 152 + * @irq: The base IRQ for the VIC. 153 + * @resume_sources: bitmask of interrupts allowed for resume sources. 154 + * 155 + * Register the VIC with the system device tree so that it can be notified 156 + * of suspend and resume requests and ensure that the correct actions are 157 + * taken to re-instate the settings on resume. 158 + */ 159 + static void __init vic_pm_register(void __iomem *base, unsigned int irq, u32 resume_sources) 160 + { 161 + struct vic_device *v; 162 + 163 + if (vic_id >= ARRAY_SIZE(vic_devices)) 164 + printk(KERN_ERR "%s: too few VICs, increase CONFIG_ARM_VIC_NR\n", __func__); 165 + else { 166 + v = &vic_devices[vic_id]; 167 + v->base = base; 168 + v->resume_sources = resume_sources; 169 + v->irq = irq; 170 + vic_id++; 171 + } 172 + } 173 + 174 + /** 175 + * vic_pm_init - initicall to register VIC pm 176 + * 177 + * This is called via late_initcall() to register 178 + * the resources for the VICs due to the early 179 + * nature of the VIC's registration. 180 + */ 181 + static int __init vic_pm_init(void) 182 + { 183 + struct vic_device *dev = vic_devices; 184 + int err; 185 + int id; 186 + 187 + if (vic_id == 0) 188 + return 0; 189 + 190 + err = sysdev_class_register(&vic_class); 191 + if (err) { 192 + printk(KERN_ERR "%s: cannot register class\n", __func__); 193 + return err; 194 + } 195 + 196 + for (id = 0; id < vic_id; id++, dev++) { 197 + dev->sysdev.id = id; 198 + dev->sysdev.cls = &vic_class; 199 + 200 + err = sysdev_register(&dev->sysdev); 201 + if (err) { 202 + printk(KERN_ERR "%s: failed to register device\n", 203 + __func__); 204 + return err; 205 + } 206 + } 207 + 208 + return 0; 209 + } 210 + 211 + late_initcall(vic_pm_init); 212 + 213 + static struct vic_device *vic_from_irq(unsigned int irq) 214 + { 215 + struct vic_device *v = vic_devices; 216 + unsigned int base_irq = irq & ~31; 217 + int id; 218 + 219 + for (id = 0; id < vic_id; id++, v++) { 220 + if (v->irq == base_irq) 221 + return v; 222 + } 223 + 224 + return NULL; 225 + } 226 + 227 + static int vic_set_wake(unsigned int irq, unsigned int on) 228 + { 229 + struct vic_device *v = vic_from_irq(irq); 230 + unsigned int off = irq & 31; 231 + 232 + if (!v) 233 + return -EINVAL; 234 + 235 + if (on) 236 + v->resume_irqs |= 1 << off; 237 + else 238 + v->resume_irqs &= ~(1 << off); 239 + 240 + return 0; 241 + } 242 + 243 + #else 244 + static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { } 245 + 246 + #define vic_set_wake NULL 247 + #endif /* CONFIG_PM */ 248 + 43 249 static struct irq_chip vic_chip = { 44 250 .name = "VIC", 45 251 .ack = vic_mask_irq, 46 252 .mask = vic_mask_irq, 47 253 .unmask = vic_unmask_irq, 254 + .set_wake = vic_set_wake, 48 255 }; 49 256 50 257 /** ··· 260 51 * @base: iomem base address 261 52 * @irq_start: starting interrupt number, must be muliple of 32 262 53 * @vic_sources: bitmask of interrupt sources to allow 54 + * @resume_sources: bitmask of interrupt sources to allow for resume 263 55 */ 264 56 void __init vic_init(void __iomem *base, unsigned int irq_start, 265 - u32 vic_sources) 57 + u32 vic_sources, u32 resume_sources) 266 58 { 267 59 unsigned int i; 268 60 ··· 287 77 writel(value, base + VIC_PL190_VECT_ADDR); 288 78 } 289 79 290 - for (i = 0; i < 16; i++) { 291 - void __iomem *reg = base + VIC_VECT_CNTL0 + (i * 4); 292 - writel(VIC_VECT_CNTL_ENABLE | i, reg); 293 - } 294 - 295 - writel(32, base + VIC_PL190_DEF_VECT_ADDR); 80 + vic_init2(base); 296 81 297 82 for (i = 0; i < 32; i++) { 298 83 if (vic_sources & (1 << i)) { ··· 299 94 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 300 95 } 301 96 } 97 + 98 + vic_pm_register(base, irq_start, resume_sources); 302 99 }
+138
arch/arm/include/asm/hardware/pl080.h
··· 1 + /* arch/arm/include/asm/hardware/pl080.h 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * http://armlinux.simtec.co.uk/ 6 + * Ben Dooks <ben@simtec.co.uk> 7 + * 8 + * ARM PrimeCell PL080 DMA controller 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 + /* Note, there are some Samsung updates to this controller block which 16 + * make it not entierly compatible with the PL080 specification from 17 + * ARM. When in doubt, check the Samsung documentation first. 18 + * 19 + * The Samsung defines are PL080S, and add an extra controll register, 20 + * the ability to move more than 2^11 counts of data and some extra 21 + * OneNAND features. 22 + */ 23 + 24 + #define PL080_INT_STATUS (0x00) 25 + #define PL080_TC_STATUS (0x04) 26 + #define PL080_TC_CLEAR (0x08) 27 + #define PL080_ERR_STATUS (0x0C) 28 + #define PL080_ERR_CLEAR (0x10) 29 + #define PL080_RAW_TC_STATUS (0x14) 30 + #define PL080_RAW_ERR_STATUS (0x18) 31 + #define PL080_EN_CHAN (0x1c) 32 + #define PL080_SOFT_BREQ (0x20) 33 + #define PL080_SOFT_SREQ (0x24) 34 + #define PL080_SOFT_LBREQ (0x28) 35 + #define PL080_SOFT_LSREQ (0x2C) 36 + 37 + #define PL080_CONFIG (0x30) 38 + #define PL080_CONFIG_M2_BE (1 << 2) 39 + #define PL080_CONFIG_M1_BE (1 << 1) 40 + #define PL080_CONFIG_ENABLE (1 << 0) 41 + 42 + #define PL080_SYNC (0x34) 43 + 44 + /* Per channel configuration registers */ 45 + 46 + #define PL008_Cx_STRIDE (0x20) 47 + #define PL080_Cx_BASE(x) ((0x100 + (x * 0x20))) 48 + #define PL080_Cx_SRC_ADDR(x) ((0x100 + (x * 0x20))) 49 + #define PL080_Cx_DST_ADDR(x) ((0x104 + (x * 0x20))) 50 + #define PL080_Cx_LLI(x) ((0x108 + (x * 0x20))) 51 + #define PL080_Cx_CONTROL(x) ((0x10C + (x * 0x20))) 52 + #define PL080_Cx_CONFIG(x) ((0x110 + (x * 0x20))) 53 + #define PL080S_Cx_CONTROL2(x) ((0x110 + (x * 0x20))) 54 + #define PL080S_Cx_CONFIG(x) ((0x114 + (x * 0x20))) 55 + 56 + #define PL080_CH_SRC_ADDR (0x00) 57 + #define PL080_CH_DST_ADDR (0x04) 58 + #define PL080_CH_LLI (0x08) 59 + #define PL080_CH_CONTROL (0x0C) 60 + #define PL080_CH_CONFIG (0x10) 61 + #define PL080S_CH_CONTROL2 (0x10) 62 + #define PL080S_CH_CONFIG (0x14) 63 + 64 + #define PL080_LLI_ADDR_MASK (0x3fffffff << 2) 65 + #define PL080_LLI_ADDR_SHIFT (2) 66 + #define PL080_LLI_LM_AHB2 (1 << 0) 67 + 68 + #define PL080_CONTROL_TC_IRQ_EN (1 << 31) 69 + #define PL080_CONTROL_PROT_MASK (0x7 << 28) 70 + #define PL080_CONTROL_PROT_SHIFT (28) 71 + #define PL080_CONTROL_PROT_SYS (1 << 28) 72 + #define PL080_CONTROL_DST_INCR (1 << 27) 73 + #define PL080_CONTROL_SRC_INCR (1 << 26) 74 + #define PL080_CONTROL_DST_AHB2 (1 << 25) 75 + #define PL080_CONTROL_SRC_AHB2 (1 << 24) 76 + #define PL080_CONTROL_DWIDTH_MASK (0x7 << 21) 77 + #define PL080_CONTROL_DWIDTH_SHIFT (21) 78 + #define PL080_CONTROL_SWIDTH_MASK (0x7 << 18) 79 + #define PL080_CONTROL_SWIDTH_SHIFT (18) 80 + #define PL080_CONTROL_DB_SIZE_MASK (0x7 << 15) 81 + #define PL080_CONTROL_DB_SIZE_SHIFT (15) 82 + #define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12) 83 + #define PL080_CONTROL_SB_SIZE_SHIFT (12) 84 + #define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0) 85 + #define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0) 86 + 87 + #define PL080_BSIZE_1 (0x0) 88 + #define PL080_BSIZE_4 (0x1) 89 + #define PL080_BSIZE_8 (0x2) 90 + #define PL080_BSIZE_16 (0x3) 91 + #define PL080_BSIZE_32 (0x4) 92 + #define PL080_BSIZE_64 (0x5) 93 + #define PL080_BSIZE_128 (0x6) 94 + #define PL080_BSIZE_256 (0x7) 95 + 96 + #define PL080_WIDTH_8BIT (0x0) 97 + #define PL080_WIDTH_16BIT (0x1) 98 + #define PL080_WIDTH_32BIT (0x2) 99 + 100 + #define PL080_CONFIG_HALT (1 << 18) 101 + #define PL080_CONFIG_ACTIVE (1 << 17) /* RO */ 102 + #define PL080_CONFIG_LOCK (1 << 16) 103 + #define PL080_CONFIG_TC_IRQ_MASK (1 << 15) 104 + #define PL080_CONFIG_ERR_IRQ_MASK (1 << 14) 105 + #define PL080_CONFIG_FLOW_CONTROL_MASK (0x7 << 11) 106 + #define PL080_CONFIG_FLOW_CONTROL_SHIFT (11) 107 + #define PL080_CONFIG_DST_SEL_MASK (0xf << 6) 108 + #define PL080_CONFIG_DST_SEL_SHIFT (6) 109 + #define PL080_CONFIG_SRC_SEL_MASK (0xf << 1) 110 + #define PL080_CONFIG_SRC_SEL_SHIFT (1) 111 + #define PL080_CONFIG_ENABLE (1 << 0) 112 + 113 + #define PL080_FLOW_MEM2MEM (0x0) 114 + #define PL080_FLOW_MEM2PER (0x1) 115 + #define PL080_FLOW_PER2MEM (0x2) 116 + #define PL080_FLOW_SRC2DST (0x3) 117 + #define PL080_FLOW_SRC2DST_DST (0x4) 118 + #define PL080_FLOW_MEM2PER_PER (0x5) 119 + #define PL080_FLOW_PER2MEM_PER (0x6) 120 + #define PL080_FLOW_SRC2DST_SRC (0x7) 121 + 122 + /* DMA linked list chain structure */ 123 + 124 + struct pl080_lli { 125 + u32 src_addr; 126 + u32 dst_addr; 127 + u32 next_lli; 128 + u32 control0; 129 + }; 130 + 131 + struct pl080s_lli { 132 + u32 src_addr; 133 + u32 dst_addr; 134 + u32 next_lli; 135 + u32 control0; 136 + u32 control1; 137 + }; 138 +
+1 -1
arch/arm/include/asm/hardware/vic.h
··· 41 41 #define VIC_PL192_VECT_ADDR 0xF00 42 42 43 43 #ifndef __ASSEMBLY__ 44 - void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources); 44 + void vic_init(void __iomem *base, unsigned int irq_start, u32 vic_sources, u32 resume_sources); 45 45 #endif 46 46 47 47 #endif
+2 -2
arch/arm/mach-ep93xx/core.c
··· 362 362 { 363 363 int gpio_irq; 364 364 365 - vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK); 366 - vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK); 365 + vic_init((void *)EP93XX_VIC1_BASE, 0, EP93XX_VIC1_VALID_IRQ_MASK, 0); 366 + vic_init((void *)EP93XX_VIC2_BASE, 32, EP93XX_VIC2_VALID_IRQ_MASK, 0); 367 367 368 368 for (gpio_irq = gpio_to_irq(0); 369 369 gpio_irq <= gpio_to_irq(EP93XX_GPIO_LINE_MAX_IRQ); ++gpio_irq) {
+1 -1
arch/arm/mach-netx/generic.c
··· 168 168 { 169 169 int irq; 170 170 171 - vic_init(__io(io_p2v(NETX_PA_VIC)), 0, ~0); 171 + vic_init(__io(io_p2v(NETX_PA_VIC)), 0, ~0, 0); 172 172 173 173 for (irq = NETX_IRQ_HIF_CHAINED(0); irq <= NETX_IRQ_HIF_LAST; irq++) { 174 174 set_irq_chip(irq, &netx_hif_chip);
+3 -3
arch/arm/mach-s3c2400/gpio.c
··· 33 33 34 34 int s3c2400_gpio_getirq(unsigned int pin) 35 35 { 36 - if (pin < S3C2410_GPE0 || pin > S3C2400_GPE7_EINT7) 37 - return -1; /* not valid interrupts */ 36 + if (pin < S3C2410_GPE(0) || pin > S3C2400_GPE(7)) 37 + return -EINVAL; /* not valid interrupts */ 38 38 39 - return (pin - S3C2410_GPE0) + IRQ_EINT0; 39 + return (pin - S3C2410_GPE(0)) + IRQ_EINT0; 40 40 } 41 41 42 42 EXPORT_SYMBOL(s3c2400_gpio_getirq);
+8
arch/arm/mach-s3c2410/Kconfig
··· 59 59 bool "IPAQ H1940" 60 60 select CPU_S3C2410 61 61 select PM_H1940 if PM 62 + select S3C_DEV_USB_HOST 62 63 help 63 64 Say Y here if you are using the HP IPAQ H1940 64 65 ··· 71 70 config MACH_N30 72 71 bool "Acer N30 family" 73 72 select CPU_S3C2410 73 + select S3C_DEV_USB_HOST 74 74 help 75 75 Say Y here if you want suppt for the Acer N30, Acer N35, 76 76 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs. ··· 84 82 select MACH_BAST_IDE 85 83 select S3C24XX_DCLK 86 84 select ISA 85 + select S3C_DEV_USB_HOST 87 86 help 88 87 Say Y here if you are using the Simtec Electronics EB2410ITX 89 88 development board (also known as BAST) ··· 92 89 config MACH_OTOM 93 90 bool "NexVision OTOM Board" 94 91 select CPU_S3C2410 92 + select S3C_DEV_USB_HOST 95 93 help 96 94 Say Y here if you are using the Nex Vision OTOM board 97 95 ··· 100 96 bool "AML M5900 Series" 101 97 select CPU_S3C2410 102 98 select PM_SIMTEC if PM 99 + select S3C_DEV_USB_HOST 103 100 help 104 101 Say Y here if you are using the American Microsystems M5900 Series 105 102 <http://www.amltd.com> ··· 116 111 config MACH_TCT_HAMMER 117 112 bool "TCT Hammer Board" 118 113 select CPU_S3C2410 114 + select S3C_DEV_USB_HOST 119 115 help 120 116 Say Y here if you are using the TinCanTools Hammer Board 121 117 <http://www.tincantools.com> ··· 128 122 select SIMTEC_NOR 129 123 select MACH_BAST_IDE 130 124 select CPU_S3C2410 125 + select S3C_DEV_USB_HOST 131 126 help 132 127 Say Y here if you are using the Thorcom VR1000 board. 133 128 134 129 config MACH_QT2410 135 130 bool "QT2410" 136 131 select CPU_S3C2410 132 + select S3C_DEV_USB_HOST 137 133 help 138 134 Say Y here if you are using the Armzone QT2410 139 135
+3 -1
arch/arm/mach-s3c2410/dma.c
··· 17 17 #include <linux/sysdev.h> 18 18 #include <linux/serial_core.h> 19 19 20 + #include <mach/map.h> 20 21 #include <mach/dma.h> 21 22 22 23 #include <plat/cpu.h> 23 - #include <plat/dma.h> 24 + #include <plat/dma-plat.h> 24 25 25 26 #include <plat/regs-serial.h> 26 27 #include <mach/regs-gpio.h> 27 28 #include <plat/regs-ac97.h> 29 + #include <plat/regs-dma.h> 28 30 #include <mach/regs-mem.h> 29 31 #include <mach/regs-lcd.h> 30 32 #include <mach/regs-sdi.h>
+3 -3
arch/arm/mach-s3c2410/gpio.c
··· 39 39 unsigned long flags; 40 40 unsigned long val; 41 41 42 - if (pin < S3C2410_GPG8 || pin > S3C2410_GPG15) 43 - return -1; 42 + if (pin < S3C2410_GPG(8) || pin > S3C2410_GPG(15)) 43 + return -EINVAL; 44 44 45 45 config &= 0xff; 46 46 47 - pin -= S3C2410_GPG8; 47 + pin -= S3C2410_GPG(8); 48 48 reg += pin & ~3; 49 49 50 50 local_irq_save(flags);
+14 -12
arch/arm/mach-s3c2410/h1940-bluetooth.c
··· 16 16 #include <linux/string.h> 17 17 #include <linux/ctype.h> 18 18 #include <linux/leds.h> 19 + #include <linux/gpio.h> 20 + 19 21 #include <mach/regs-gpio.h> 20 22 #include <mach/hardware.h> 21 23 #include <mach/h1940-latch.h> ··· 43 41 h1940_latch_control(0, H1940_LATCH_BLUETOOTH_POWER); 44 42 /* Reset the chip */ 45 43 mdelay(10); 46 - s3c2410_gpio_setpin(S3C2410_GPH1, 1); 44 + s3c2410_gpio_setpin(S3C2410_GPH(1), 1); 47 45 mdelay(10); 48 - s3c2410_gpio_setpin(S3C2410_GPH1, 0); 46 + s3c2410_gpio_setpin(S3C2410_GPH(1), 0); 49 47 50 48 state = 1; 51 49 } ··· 54 52 led_trigger_event(bt_led_trigger, 0); 55 53 #endif 56 54 57 - s3c2410_gpio_setpin(S3C2410_GPH1, 1); 55 + s3c2410_gpio_setpin(S3C2410_GPH(1), 1); 58 56 mdelay(10); 59 - s3c2410_gpio_setpin(S3C2410_GPH1, 0); 57 + s3c2410_gpio_setpin(S3C2410_GPH(1), 0); 60 58 mdelay(10); 61 59 h1940_latch_control(H1940_LATCH_BLUETOOTH_POWER, 0); 62 60 ··· 89 87 static int __init h1940bt_probe(struct platform_device *pdev) 90 88 { 91 89 /* Configures BT serial port GPIOs */ 92 - s3c2410_gpio_cfgpin(S3C2410_GPH0, S3C2410_GPH0_nCTS0); 93 - s3c2410_gpio_pullup(S3C2410_GPH0, 1); 94 - s3c2410_gpio_cfgpin(S3C2410_GPH1, S3C2410_GPH1_OUTP); 95 - s3c2410_gpio_pullup(S3C2410_GPH1, 1); 96 - s3c2410_gpio_cfgpin(S3C2410_GPH2, S3C2410_GPH2_TXD0); 97 - s3c2410_gpio_pullup(S3C2410_GPH2, 1); 98 - s3c2410_gpio_cfgpin(S3C2410_GPH3, S3C2410_GPH3_RXD0); 99 - s3c2410_gpio_pullup(S3C2410_GPH3, 1); 90 + s3c2410_gpio_cfgpin(S3C2410_GPH(0), S3C2410_GPH0_nCTS0); 91 + s3c2410_gpio_pullup(S3C2410_GPH(0), 1); 92 + s3c2410_gpio_cfgpin(S3C2410_GPH(1), S3C2410_GPIO_OUTPUT); 93 + s3c2410_gpio_pullup(S3C2410_GPH(1), 1); 94 + s3c2410_gpio_cfgpin(S3C2410_GPH(2), S3C2410_GPH2_TXD0); 95 + s3c2410_gpio_pullup(S3C2410_GPH(2), 1); 96 + s3c2410_gpio_cfgpin(S3C2410_GPH(3), S3C2410_GPH3_RXD0); 97 + s3c2410_gpio_pullup(S3C2410_GPH(3), 1); 100 98 101 99 #ifdef CONFIG_LEDS_H1940 102 100 led_trigger_register_simple("h1940-bluetooth", &bt_led_trigger);
+7 -258
arch/arm/mach-s3c2410/include/mach/dma.h
··· 3 3 * Copyright (C) 2003,2004,2006 Simtec Electronics 4 4 * Ben Dooks <ben@simtec.co.uk> 5 5 * 6 - * Samsung S3C241XX DMA support 6 + * Samsung S3C24XX DMA support 7 7 * 8 8 * This program is free software; you can redistribute it and/or modify 9 9 * it under the terms of the GNU General Public License version 2 as ··· 13 13 #ifndef __ASM_ARCH_DMA_H 14 14 #define __ASM_ARCH_DMA_H __FILE__ 15 15 16 + #include <plat/dma.h> 16 17 #include <linux/sysdev.h> 17 - #include <mach/hardware.h> 18 18 19 19 #define MAX_DMA_TRANSFER_SIZE 0x100000 /* Data Unit is half word */ 20 20 ··· 55 55 56 56 /* we have 4 dma channels */ 57 57 #ifndef CONFIG_CPU_S3C2443 58 - #define S3C2410_DMA_CHANNELS (4) 58 + #define S3C_DMA_CHANNELS (4) 59 59 #else 60 - #define S3C2410_DMA_CHANNELS (6) 60 + #define S3C_DMA_CHANNELS (6) 61 61 #endif 62 62 63 63 /* types */ ··· 67 67 S3C2410_DMA_RUNNING, 68 68 S3C2410_DMA_PAUSED 69 69 }; 70 - 71 70 72 71 /* enum s3c2410_dma_loadst 73 72 * ··· 103 104 S3C2410_DMALOAD_1LOADED_1RUNNING, 104 105 }; 105 106 106 - enum s3c2410_dma_buffresult { 107 - S3C2410_RES_OK, 108 - S3C2410_RES_ERR, 109 - S3C2410_RES_ABORT 110 - }; 111 - 112 - enum s3c2410_dmasrc { 113 - S3C2410_DMASRC_HW, /* source is memory */ 114 - S3C2410_DMASRC_MEM /* source is hardware */ 115 - }; 116 - 117 - /* enum s3c2410_chan_op 118 - * 119 - * operation codes passed to the DMA code by the user, and also used 120 - * to inform the current channel owner of any changes to the system state 121 - */ 122 - 123 - enum s3c2410_chan_op { 124 - S3C2410_DMAOP_START, 125 - S3C2410_DMAOP_STOP, 126 - S3C2410_DMAOP_PAUSE, 127 - S3C2410_DMAOP_RESUME, 128 - S3C2410_DMAOP_FLUSH, 129 - S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */ 130 - S3C2410_DMAOP_STARTED, /* indicate channel started */ 131 - }; 132 107 133 108 /* flags */ 134 109 ··· 112 139 113 140 /* dma buffer */ 114 141 115 - struct s3c2410_dma_client { 116 - char *name; 117 - }; 142 + struct s3c2410_dma_buf; 118 143 119 - /* s3c2410_dma_buf_s 144 + /* s3c2410_dma_buf 120 145 * 121 146 * internally used buffer structure to describe a queued or running 122 147 * buffer. 123 148 */ 124 149 125 - struct s3c2410_dma_buf; 126 150 struct s3c2410_dma_buf { 127 151 struct s3c2410_dma_buf *next; 128 152 int magic; /* magic */ ··· 130 160 }; 131 161 132 162 /* [1] is this updated for both recv/send modes? */ 133 - 134 - struct s3c2410_dma_chan; 135 - 136 - /* s3c2410_dma_cbfn_t 137 - * 138 - * buffer callback routine type 139 - */ 140 - 141 - typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *, 142 - void *buf, int size, 143 - enum s3c2410_dma_buffresult result); 144 - 145 - typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *, 146 - enum s3c2410_chan_op ); 147 163 148 164 struct s3c2410_dma_stats { 149 165 unsigned long loads; ··· 162 206 163 207 /* channel configuration */ 164 208 enum s3c2410_dmasrc source; 209 + enum dma_ch req_ch; 165 210 unsigned long dev_addr; 166 211 unsigned long load_timeout; 167 212 unsigned int flags; /* channel flags */ 168 - unsigned int hw_cfg; /* last hw config */ 169 213 170 214 struct s3c24xx_dma_map *map; /* channel hw maps */ 171 215 ··· 192 236 struct sys_device dev; 193 237 }; 194 238 195 - /* the currently allocated channel information */ 196 - extern struct s3c2410_dma_chan s3c2410_chans[]; 197 - 198 - /* note, we don't really use dma_device_t at the moment */ 199 239 typedef unsigned long dma_device_t; 200 - 201 - /* functions --------------------------------------------------------------- */ 202 - 203 - /* s3c2410_dma_request 204 - * 205 - * request a dma channel exclusivley 206 - */ 207 - 208 - extern int s3c2410_dma_request(unsigned int channel, 209 - struct s3c2410_dma_client *, void *dev); 210 - 211 - 212 - /* s3c2410_dma_ctrl 213 - * 214 - * change the state of the dma channel 215 - */ 216 - 217 - extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); 218 - 219 - /* s3c2410_dma_setflags 220 - * 221 - * set the channel's flags to a given state 222 - */ 223 - 224 - extern int s3c2410_dma_setflags(unsigned int channel, 225 - unsigned int flags); 226 - 227 - /* s3c2410_dma_free 228 - * 229 - * free the dma channel (will also abort any outstanding operations) 230 - */ 231 - 232 - extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); 233 - 234 - /* s3c2410_dma_enqueue 235 - * 236 - * place the given buffer onto the queue of operations for the channel. 237 - * The buffer must be allocated from dma coherent memory, or the Dcache/WB 238 - * drained before the buffer is given to the DMA system. 239 - */ 240 - 241 - extern int s3c2410_dma_enqueue(unsigned int channel, void *id, 242 - dma_addr_t data, int size); 243 - 244 - /* s3c2410_dma_config 245 - * 246 - * configure the dma channel 247 - */ 248 - 249 - extern int s3c2410_dma_config(unsigned int channel, int xferunit, int dcon); 250 - 251 - /* s3c2410_dma_devconfig 252 - * 253 - * configure the device we're talking to 254 - */ 255 - 256 - extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source, 257 - int hwcfg, unsigned long devaddr); 258 - 259 - /* s3c2410_dma_getposition 260 - * 261 - * get the position that the dma transfer is currently at 262 - */ 263 - 264 - extern int s3c2410_dma_getposition(unsigned int channel, 265 - dma_addr_t *src, dma_addr_t *dest); 266 - 267 - extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); 268 - extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); 269 - 270 - /* DMA Register definitions */ 271 - 272 - #define S3C2410_DMA_DISRC (0x00) 273 - #define S3C2410_DMA_DISRCC (0x04) 274 - #define S3C2410_DMA_DIDST (0x08) 275 - #define S3C2410_DMA_DIDSTC (0x0C) 276 - #define S3C2410_DMA_DCON (0x10) 277 - #define S3C2410_DMA_DSTAT (0x14) 278 - #define S3C2410_DMA_DCSRC (0x18) 279 - #define S3C2410_DMA_DCDST (0x1C) 280 - #define S3C2410_DMA_DMASKTRIG (0x20) 281 - #define S3C2412_DMA_DMAREQSEL (0x24) 282 - #define S3C2443_DMA_DMAREQSEL (0x24) 283 - 284 - #define S3C2410_DISRCC_INC (1<<0) 285 - #define S3C2410_DISRCC_APB (1<<1) 286 - 287 - #define S3C2410_DMASKTRIG_STOP (1<<2) 288 - #define S3C2410_DMASKTRIG_ON (1<<1) 289 - #define S3C2410_DMASKTRIG_SWTRIG (1<<0) 290 - 291 - #define S3C2410_DCON_DEMAND (0<<31) 292 - #define S3C2410_DCON_HANDSHAKE (1<<31) 293 - #define S3C2410_DCON_SYNC_PCLK (0<<30) 294 - #define S3C2410_DCON_SYNC_HCLK (1<<30) 295 - 296 - #define S3C2410_DCON_INTREQ (1<<29) 297 - 298 - #define S3C2410_DCON_CH0_XDREQ0 (0<<24) 299 - #define S3C2410_DCON_CH0_UART0 (1<<24) 300 - #define S3C2410_DCON_CH0_SDI (2<<24) 301 - #define S3C2410_DCON_CH0_TIMER (3<<24) 302 - #define S3C2410_DCON_CH0_USBEP1 (4<<24) 303 - 304 - #define S3C2410_DCON_CH1_XDREQ1 (0<<24) 305 - #define S3C2410_DCON_CH1_UART1 (1<<24) 306 - #define S3C2410_DCON_CH1_I2SSDI (2<<24) 307 - #define S3C2410_DCON_CH1_SPI (3<<24) 308 - #define S3C2410_DCON_CH1_USBEP2 (4<<24) 309 - 310 - #define S3C2410_DCON_CH2_I2SSDO (0<<24) 311 - #define S3C2410_DCON_CH2_I2SSDI (1<<24) 312 - #define S3C2410_DCON_CH2_SDI (2<<24) 313 - #define S3C2410_DCON_CH2_TIMER (3<<24) 314 - #define S3C2410_DCON_CH2_USBEP3 (4<<24) 315 - 316 - #define S3C2410_DCON_CH3_UART2 (0<<24) 317 - #define S3C2410_DCON_CH3_SDI (1<<24) 318 - #define S3C2410_DCON_CH3_SPI (2<<24) 319 - #define S3C2410_DCON_CH3_TIMER (3<<24) 320 - #define S3C2410_DCON_CH3_USBEP4 (4<<24) 321 - 322 - #define S3C2410_DCON_SRCSHIFT (24) 323 - #define S3C2410_DCON_SRCMASK (7<<24) 324 - 325 - #define S3C2410_DCON_BYTE (0<<20) 326 - #define S3C2410_DCON_HALFWORD (1<<20) 327 - #define S3C2410_DCON_WORD (2<<20) 328 - 329 - #define S3C2410_DCON_AUTORELOAD (0<<22) 330 - #define S3C2410_DCON_NORELOAD (1<<22) 331 - #define S3C2410_DCON_HWTRIG (1<<23) 332 - 333 - #ifdef CONFIG_CPU_S3C2440 334 - #define S3C2440_DIDSTC_CHKINT (1<<2) 335 - 336 - #define S3C2440_DCON_CH0_I2SSDO (5<<24) 337 - #define S3C2440_DCON_CH0_PCMIN (6<<24) 338 - 339 - #define S3C2440_DCON_CH1_PCMOUT (5<<24) 340 - #define S3C2440_DCON_CH1_SDI (6<<24) 341 - 342 - #define S3C2440_DCON_CH2_PCMIN (5<<24) 343 - #define S3C2440_DCON_CH2_MICIN (6<<24) 344 - 345 - #define S3C2440_DCON_CH3_MICIN (5<<24) 346 - #define S3C2440_DCON_CH3_PCMOUT (6<<24) 347 - #endif 348 - 349 - #ifdef CONFIG_CPU_S3C2412 350 - 351 - #define S3C2412_DMAREQSEL_SRC(x) ((x)<<1) 352 - 353 - #define S3C2412_DMAREQSEL_HW (1) 354 - 355 - #define S3C2412_DMAREQSEL_SPI0TX S3C2412_DMAREQSEL_SRC(0) 356 - #define S3C2412_DMAREQSEL_SPI0RX S3C2412_DMAREQSEL_SRC(1) 357 - #define S3C2412_DMAREQSEL_SPI1TX S3C2412_DMAREQSEL_SRC(2) 358 - #define S3C2412_DMAREQSEL_SPI1RX S3C2412_DMAREQSEL_SRC(3) 359 - #define S3C2412_DMAREQSEL_I2STX S3C2412_DMAREQSEL_SRC(4) 360 - #define S3C2412_DMAREQSEL_I2SRX S3C2412_DMAREQSEL_SRC(5) 361 - #define S3C2412_DMAREQSEL_TIMER S3C2412_DMAREQSEL_SRC(9) 362 - #define S3C2412_DMAREQSEL_SDI S3C2412_DMAREQSEL_SRC(10) 363 - #define S3C2412_DMAREQSEL_USBEP1 S3C2412_DMAREQSEL_SRC(13) 364 - #define S3C2412_DMAREQSEL_USBEP2 S3C2412_DMAREQSEL_SRC(14) 365 - #define S3C2412_DMAREQSEL_USBEP3 S3C2412_DMAREQSEL_SRC(15) 366 - #define S3C2412_DMAREQSEL_USBEP4 S3C2412_DMAREQSEL_SRC(16) 367 - #define S3C2412_DMAREQSEL_XDREQ0 S3C2412_DMAREQSEL_SRC(17) 368 - #define S3C2412_DMAREQSEL_XDREQ1 S3C2412_DMAREQSEL_SRC(18) 369 - #define S3C2412_DMAREQSEL_UART0_0 S3C2412_DMAREQSEL_SRC(19) 370 - #define S3C2412_DMAREQSEL_UART0_1 S3C2412_DMAREQSEL_SRC(20) 371 - #define S3C2412_DMAREQSEL_UART1_0 S3C2412_DMAREQSEL_SRC(21) 372 - #define S3C2412_DMAREQSEL_UART1_1 S3C2412_DMAREQSEL_SRC(22) 373 - #define S3C2412_DMAREQSEL_UART2_0 S3C2412_DMAREQSEL_SRC(23) 374 - #define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) 375 - 376 - #endif 377 - 378 - #define S3C2443_DMAREQSEL_SRC(x) ((x)<<1) 379 - 380 - #define S3C2443_DMAREQSEL_HW (1) 381 - 382 - #define S3C2443_DMAREQSEL_SPI0TX S3C2443_DMAREQSEL_SRC(0) 383 - #define S3C2443_DMAREQSEL_SPI0RX S3C2443_DMAREQSEL_SRC(1) 384 - #define S3C2443_DMAREQSEL_SPI1TX S3C2443_DMAREQSEL_SRC(2) 385 - #define S3C2443_DMAREQSEL_SPI1RX S3C2443_DMAREQSEL_SRC(3) 386 - #define S3C2443_DMAREQSEL_I2STX S3C2443_DMAREQSEL_SRC(4) 387 - #define S3C2443_DMAREQSEL_I2SRX S3C2443_DMAREQSEL_SRC(5) 388 - #define S3C2443_DMAREQSEL_TIMER S3C2443_DMAREQSEL_SRC(9) 389 - #define S3C2443_DMAREQSEL_SDI S3C2443_DMAREQSEL_SRC(10) 390 - #define S3C2443_DMAREQSEL_XDREQ0 S3C2443_DMAREQSEL_SRC(17) 391 - #define S3C2443_DMAREQSEL_XDREQ1 S3C2443_DMAREQSEL_SRC(18) 392 - #define S3C2443_DMAREQSEL_UART0_0 S3C2443_DMAREQSEL_SRC(19) 393 - #define S3C2443_DMAREQSEL_UART0_1 S3C2443_DMAREQSEL_SRC(20) 394 - #define S3C2443_DMAREQSEL_UART1_0 S3C2443_DMAREQSEL_SRC(21) 395 - #define S3C2443_DMAREQSEL_UART1_1 S3C2443_DMAREQSEL_SRC(22) 396 - #define S3C2443_DMAREQSEL_UART2_0 S3C2443_DMAREQSEL_SRC(23) 397 - #define S3C2443_DMAREQSEL_UART2_1 S3C2443_DMAREQSEL_SRC(24) 398 - #define S3C2443_DMAREQSEL_UART3_0 S3C2443_DMAREQSEL_SRC(25) 399 - #define S3C2443_DMAREQSEL_UART3_1 S3C2443_DMAREQSEL_SRC(26) 400 - #define S3C2443_DMAREQSEL_PCMOUT S3C2443_DMAREQSEL_SRC(27) 401 - #define S3C2443_DMAREQSEL_PCMIN S3C2443_DMAREQSEL_SRC(28) 402 - #define S3C2443_DMAREQSEL_MICIN S3C2443_DMAREQSEL_SRC(29) 403 240 404 241 #endif /* __ASM_ARCH_DMA_H */
+1 -1
arch/arm/mach-s3c2410/include/mach/gpio-core.h
··· 24 24 { 25 25 struct s3c_gpio_chip *chip; 26 26 27 - if (pin > S3C2410_GPG10) 27 + if (pin > S3C2410_GPG(10)) 28 28 return NULL; 29 29 30 30 chip = &s3c24xx_gpios[pin/32];
+103
arch/arm/mach-s3c2410/include/mach/gpio-fns.h
··· 1 + /* arch/arm/mach-s3c2410/include/mach/gpio-fns.h 2 + * 3 + * Copyright (c) 2003,2009 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * 6 + * S3C2410 - hardware 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 + /* These functions are in the to-be-removed category and it is strongly 14 + * encouraged not to use these in new code. They will be marked deprecated 15 + * very soon. 16 + * 17 + * Most of the functionality can be either replaced by the gpiocfg calls 18 + * for the s3c platform or by the generic GPIOlib API. 19 + */ 20 + 21 + /* external functions for GPIO support 22 + * 23 + * These allow various different clients to access the same GPIO 24 + * registers without conflicting. If your driver only owns the entire 25 + * GPIO register, then it is safe to ioremap/__raw_{read|write} to it. 26 + */ 27 + 28 + /* s3c2410_gpio_cfgpin 29 + * 30 + * set the configuration of the given pin to the value passed. 31 + * 32 + * eg: 33 + * s3c2410_gpio_cfgpin(S3C2410_GPA(0), S3C2410_GPA0_ADDR0); 34 + * s3c2410_gpio_cfgpin(S3C2410_GPE(8), S3C2410_GPE8_SDDAT1); 35 + */ 36 + 37 + extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); 38 + 39 + extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); 40 + 41 + /* s3c2410_gpio_getirq 42 + * 43 + * turn the given pin number into the corresponding IRQ number 44 + * 45 + * returns: 46 + * < 0 = no interrupt for this pin 47 + * >=0 = interrupt number for the pin 48 + */ 49 + 50 + extern int s3c2410_gpio_getirq(unsigned int pin); 51 + 52 + #ifdef CONFIG_CPU_S3C2400 53 + 54 + extern int s3c2400_gpio_getirq(unsigned int pin); 55 + 56 + #endif /* CONFIG_CPU_S3C2400 */ 57 + 58 + /* s3c2410_gpio_irqfilter 59 + * 60 + * set the irq filtering on the given pin 61 + * 62 + * on = 0 => disable filtering 63 + * 1 => enable filtering 64 + * 65 + * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with 66 + * width of filter (0 through 63) 67 + * 68 + * 69 + */ 70 + 71 + extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, 72 + unsigned int config); 73 + 74 + /* s3c2410_gpio_pullup 75 + * 76 + * configure the pull-up control on the given pin 77 + * 78 + * to = 1 => disable the pull-up 79 + * 0 => enable the pull-up 80 + * 81 + * eg; 82 + * 83 + * s3c2410_gpio_pullup(S3C2410_GPB(0), 0); 84 + * s3c2410_gpio_pullup(S3C2410_GPE(8), 0); 85 + */ 86 + 87 + extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); 88 + 89 + /* s3c2410_gpio_getpull 90 + * 91 + * Read the state of the pull-up on a given pin 92 + * 93 + * return: 94 + * < 0 => error code 95 + * 0 => enabled 96 + * 1 => disabled 97 + */ 98 + 99 + extern int s3c2410_gpio_getpull(unsigned int pin); 100 + 101 + extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); 102 + 103 + extern unsigned int s3c2410_gpio_getpin(unsigned int pin);
+70
arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
··· 11 11 * published by the Free Software Foundation. 12 12 */ 13 13 14 + #ifndef __MACH_GPIONRS_H 15 + #define __MACH_GPIONRS_H 16 + 14 17 #define S3C2410_GPIONO(bank,offset) ((bank) + (offset)) 15 18 16 19 #define S3C2410_GPIO_BANKA (32*0) ··· 24 21 #define S3C2410_GPIO_BANKF (32*5) 25 22 #define S3C2410_GPIO_BANKG (32*6) 26 23 #define S3C2410_GPIO_BANKH (32*7) 24 + 25 + /* GPIO bank sizes */ 26 + #define S3C2410_GPIO_A_NR (32) 27 + #define S3C2410_GPIO_B_NR (32) 28 + #define S3C2410_GPIO_C_NR (32) 29 + #define S3C2410_GPIO_D_NR (32) 30 + #define S3C2410_GPIO_E_NR (32) 31 + #define S3C2410_GPIO_F_NR (32) 32 + #define S3C2410_GPIO_G_NR (32) 33 + #define S3C2410_GPIO_H_NR (32) 34 + 35 + #if CONFIG_S3C_GPIO_SPACE != 0 36 + #error CONFIG_S3C_GPIO_SPACE cannot be zero at the moment 37 + #endif 38 + 39 + #define S3C2410_GPIO_NEXT(__gpio) \ 40 + ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 0) 41 + 42 + #ifndef __ASSEMBLY__ 43 + 44 + enum s3c_gpio_number { 45 + S3C2410_GPIO_A_START = 0, 46 + S3C2410_GPIO_B_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_A), 47 + S3C2410_GPIO_C_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_B), 48 + S3C2410_GPIO_D_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_C), 49 + S3C2410_GPIO_E_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_D), 50 + S3C2410_GPIO_F_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_E), 51 + S3C2410_GPIO_G_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_F), 52 + S3C2410_GPIO_H_START = S3C2410_GPIO_NEXT(S3C2410_GPIO_G), 53 + }; 54 + 55 + #endif /* __ASSEMBLY__ */ 56 + 57 + /* S3C2410 GPIO number definitions. */ 58 + 59 + #define S3C2410_GPA(_nr) (S3C2410_GPIO_A_START + (_nr)) 60 + #define S3C2410_GPB(_nr) (S3C2410_GPIO_B_START + (_nr)) 61 + #define S3C2410_GPC(_nr) (S3C2410_GPIO_C_START + (_nr)) 62 + #define S3C2410_GPD(_nr) (S3C2410_GPIO_D_START + (_nr)) 63 + #define S3C2410_GPE(_nr) (S3C2410_GPIO_E_START + (_nr)) 64 + #define S3C2410_GPF(_nr) (S3C2410_GPIO_F_START + (_nr)) 65 + #define S3C2410_GPG(_nr) (S3C2410_GPIO_G_START + (_nr)) 66 + #define S3C2410_GPH(_nr) (S3C2410_GPIO_H_START + (_nr)) 67 + 68 + /* compatibility until drivers can be modified */ 69 + 70 + #define S3C2410_GPA0 S3C2410_GPA(0) 71 + #define S3C2410_GPA1 S3C2410_GPA(1) 72 + #define S3C2410_GPA3 S3C2410_GPA(3) 73 + #define S3C2410_GPA7 S3C2410_GPA(7) 74 + 75 + #define S3C2410_GPE0 S3C2410_GPE(0) 76 + #define S3C2410_GPE1 S3C2410_GPE(1) 77 + #define S3C2410_GPE2 S3C2410_GPE(2) 78 + #define S3C2410_GPE3 S3C2410_GPE(3) 79 + #define S3C2410_GPE4 S3C2410_GPE(4) 80 + #define S3C2410_GPE5 S3C2410_GPE(5) 81 + #define S3C2410_GPE6 S3C2410_GPE(6) 82 + #define S3C2410_GPE7 S3C2410_GPE(7) 83 + #define S3C2410_GPE8 S3C2410_GPE(8) 84 + #define S3C2410_GPE9 S3C2410_GPE(9) 85 + #define S3C2410_GPE10 S3C2410_GPE(10) 86 + 87 + #define S3C2410_GPH10 S3C2410_GPH(10) 88 + 89 + #endif /* __MACH_GPIONRS_H */ 90 +
+1
arch/arm/mach-s3c2410/include/mach/gpio.h
··· 24 24 25 25 #include <asm-generic/gpio.h> 26 26 #include <mach/gpio-nrs.h> 27 + #include <mach/gpio-fns.h> 27 28 28 29 #define S3C_GPIO_END (S3C2410_GPIO_BANKH + 32)
-95
arch/arm/mach-s3c2410/include/mach/hardware.h
··· 15 15 16 16 #ifndef __ASSEMBLY__ 17 17 18 - /* external functions for GPIO support 19 - * 20 - * These allow various different clients to access the same GPIO 21 - * registers without conflicting. If your driver only owns the entire 22 - * GPIO register, then it is safe to ioremap/__raw_{read|write} to it. 23 - */ 24 - 25 - /* s3c2410_gpio_cfgpin 26 - * 27 - * set the configuration of the given pin to the value passed. 28 - * 29 - * eg: 30 - * s3c2410_gpio_cfgpin(S3C2410_GPA0, S3C2410_GPA0_ADDR0); 31 - * s3c2410_gpio_cfgpin(S3C2410_GPE8, S3C2410_GPE8_SDDAT1); 32 - */ 33 - 34 - extern void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function); 35 - 36 - extern unsigned int s3c2410_gpio_getcfg(unsigned int pin); 37 - 38 - /* s3c2410_gpio_getirq 39 - * 40 - * turn the given pin number into the corresponding IRQ number 41 - * 42 - * returns: 43 - * < 0 = no interrupt for this pin 44 - * >=0 = interrupt number for the pin 45 - */ 46 - 47 - extern int s3c2410_gpio_getirq(unsigned int pin); 48 - 49 - /* s3c2410_gpio_irq2pin 50 - * 51 - * turn the given irq number into the corresponding GPIO number 52 - * 53 - * returns: 54 - * < 0 = no pin 55 - * >=0 = gpio pin number 56 - */ 57 - 58 - extern int s3c2410_gpio_irq2pin(unsigned int irq); 59 - 60 - #ifdef CONFIG_CPU_S3C2400 61 - 62 - extern int s3c2400_gpio_getirq(unsigned int pin); 63 - 64 - #endif /* CONFIG_CPU_S3C2400 */ 65 - 66 - /* s3c2410_gpio_irqfilter 67 - * 68 - * set the irq filtering on the given pin 69 - * 70 - * on = 0 => disable filtering 71 - * 1 => enable filtering 72 - * 73 - * config = S3C2410_EINTFLT_PCLK or S3C2410_EINTFLT_EXTCLK orred with 74 - * width of filter (0 through 63) 75 - * 76 - * 77 - */ 78 - 79 - extern int s3c2410_gpio_irqfilter(unsigned int pin, unsigned int on, 80 - unsigned int config); 81 - 82 - /* s3c2410_gpio_pullup 83 - * 84 - * configure the pull-up control on the given pin 85 - * 86 - * to = 1 => disable the pull-up 87 - * 0 => enable the pull-up 88 - * 89 - * eg; 90 - * 91 - * s3c2410_gpio_pullup(S3C2410_GPB0, 0); 92 - * s3c2410_gpio_pullup(S3C2410_GPE8, 0); 93 - */ 94 - 95 - extern void s3c2410_gpio_pullup(unsigned int pin, unsigned int to); 96 - 97 - /* s3c2410_gpio_getpull 98 - * 99 - * Read the state of the pull-up on a given pin 100 - * 101 - * return: 102 - * < 0 => error code 103 - * 0 => enabled 104 - * 1 => disabled 105 - */ 106 - 107 - extern int s3c2410_gpio_getpull(unsigned int pin); 108 - 109 - extern void s3c2410_gpio_setpin(unsigned int pin, unsigned int to); 110 - 111 - extern unsigned int s3c2410_gpio_getpin(unsigned int pin); 112 - 113 18 extern unsigned int s3c2410_modify_misccr(unsigned int clr, unsigned int chg); 114 19 115 20 #ifdef CONFIG_CPU_S3C2440
+1 -1
arch/arm/mach-s3c2410/include/mach/map.h
··· 84 84 85 85 #define S3C24XX_PA_IRQ S3C2410_PA_IRQ 86 86 #define S3C24XX_PA_MEMCTRL S3C2410_PA_MEMCTRL 87 - #define S3C24XX_PA_USBHOST S3C2410_PA_USBHOST 88 87 #define S3C24XX_PA_DMA S3C2410_PA_DMA 89 88 #define S3C24XX_PA_CLKPWR S3C2410_PA_CLKPWR 90 89 #define S3C24XX_PA_LCD S3C2410_PA_LCD ··· 101 102 102 103 #define S3C_PA_IIC S3C2410_PA_IIC 103 104 #define S3C_PA_UART S3C24XX_PA_UART 105 + #define S3C_PA_USBHOST S3C2410_PA_USBHOST 104 106 #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 105 107 106 108 #endif /* __ASM_ARCH_MAP_H */
-333
arch/arm/mach-s3c2410/include/mach/regs-gpio.h
··· 69 69 #define S3C2400_GPACON S3C2410_GPIOREG(0x00) 70 70 #define S3C2400_GPADAT S3C2410_GPIOREG(0x04) 71 71 72 - #define S3C2410_GPA0 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 0) 73 - #define S3C2410_GPA0_OUT (0<<0) 74 72 #define S3C2410_GPA0_ADDR0 (1<<0) 75 73 76 - #define S3C2410_GPA1 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 1) 77 - #define S3C2410_GPA1_OUT (0<<1) 78 74 #define S3C2410_GPA1_ADDR16 (1<<1) 79 75 80 - #define S3C2410_GPA2 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 2) 81 - #define S3C2410_GPA2_OUT (0<<2) 82 76 #define S3C2410_GPA2_ADDR17 (1<<2) 83 77 84 - #define S3C2410_GPA3 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 3) 85 - #define S3C2410_GPA3_OUT (0<<3) 86 78 #define S3C2410_GPA3_ADDR18 (1<<3) 87 79 88 - #define S3C2410_GPA4 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 4) 89 - #define S3C2410_GPA4_OUT (0<<4) 90 80 #define S3C2410_GPA4_ADDR19 (1<<4) 91 81 92 - #define S3C2410_GPA5 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 5) 93 - #define S3C2410_GPA5_OUT (0<<5) 94 82 #define S3C2410_GPA5_ADDR20 (1<<5) 95 83 96 - #define S3C2410_GPA6 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 6) 97 - #define S3C2410_GPA6_OUT (0<<6) 98 84 #define S3C2410_GPA6_ADDR21 (1<<6) 99 85 100 - #define S3C2410_GPA7 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 7) 101 - #define S3C2410_GPA7_OUT (0<<7) 102 86 #define S3C2410_GPA7_ADDR22 (1<<7) 103 87 104 - #define S3C2410_GPA8 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 8) 105 - #define S3C2410_GPA8_OUT (0<<8) 106 88 #define S3C2410_GPA8_ADDR23 (1<<8) 107 89 108 - #define S3C2410_GPA9 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 9) 109 - #define S3C2410_GPA9_OUT (0<<9) 110 90 #define S3C2410_GPA9_ADDR24 (1<<9) 111 91 112 - #define S3C2410_GPA10 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 10) 113 - #define S3C2410_GPA10_OUT (0<<10) 114 92 #define S3C2410_GPA10_ADDR25 (1<<10) 115 93 #define S3C2400_GPA10_SCKE (1<<10) 116 94 117 - #define S3C2410_GPA11 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 11) 118 - #define S3C2410_GPA11_OUT (0<<11) 119 95 #define S3C2410_GPA11_ADDR26 (1<<11) 120 96 #define S3C2400_GPA11_nCAS0 (1<<11) 121 97 122 - #define S3C2410_GPA12 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 12) 123 - #define S3C2410_GPA12_OUT (0<<12) 124 98 #define S3C2410_GPA12_nGCS1 (1<<12) 125 99 #define S3C2400_GPA12_nCAS1 (1<<12) 126 100 127 - #define S3C2410_GPA13 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 13) 128 - #define S3C2410_GPA13_OUT (0<<13) 129 101 #define S3C2410_GPA13_nGCS2 (1<<13) 130 102 #define S3C2400_GPA13_nGCS1 (1<<13) 131 103 132 - #define S3C2410_GPA14 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 14) 133 - #define S3C2410_GPA14_OUT (0<<14) 134 104 #define S3C2410_GPA14_nGCS3 (1<<14) 135 105 #define S3C2400_GPA14_nGCS2 (1<<14) 136 106 137 - #define S3C2410_GPA15 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 15) 138 - #define S3C2410_GPA15_OUT (0<<15) 139 107 #define S3C2410_GPA15_nGCS4 (1<<15) 140 108 #define S3C2400_GPA15_nGCS3 (1<<15) 141 109 142 - #define S3C2410_GPA16 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 16) 143 - #define S3C2410_GPA16_OUT (0<<16) 144 110 #define S3C2410_GPA16_nGCS5 (1<<16) 145 111 #define S3C2400_GPA16_nGCS4 (1<<16) 146 112 147 - #define S3C2410_GPA17 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 17) 148 - #define S3C2410_GPA17_OUT (0<<17) 149 113 #define S3C2410_GPA17_CLE (1<<17) 150 114 #define S3C2400_GPA17_nGCS5 (1<<17) 151 115 152 - #define S3C2410_GPA18 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 18) 153 - #define S3C2410_GPA18_OUT (0<<18) 154 116 #define S3C2410_GPA18_ALE (1<<18) 155 117 156 - #define S3C2410_GPA19 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 19) 157 - #define S3C2410_GPA19_OUT (0<<19) 158 118 #define S3C2410_GPA19_nFWE (1<<19) 159 119 160 - #define S3C2410_GPA20 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 20) 161 - #define S3C2410_GPA20_OUT (0<<20) 162 120 #define S3C2410_GPA20_nFRE (1<<20) 163 121 164 - #define S3C2410_GPA21 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 21) 165 - #define S3C2410_GPA21_OUT (0<<21) 166 122 #define S3C2410_GPA21_nRSTOUT (1<<21) 167 123 168 - #define S3C2410_GPA22 S3C2410_GPIONO(S3C2410_GPIO_BANKA, 22) 169 - #define S3C2410_GPA22_OUT (0<<22) 170 124 #define S3C2410_GPA22_nFCE (1<<22) 171 125 172 126 /* 0x08 and 0x0c are reserved on S3C2410 */ ··· 148 194 149 195 /* no i/o pin in port b can have value 3 (unless it is a s3c2443) ! */ 150 196 151 - #define S3C2410_GPB0 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 0) 152 - #define S3C2410_GPB0_INP (0x00 << 0) 153 - #define S3C2410_GPB0_OUTP (0x01 << 0) 154 197 #define S3C2410_GPB0_TOUT0 (0x02 << 0) 155 198 #define S3C2400_GPB0_DATA16 (0x02 << 0) 156 199 157 - #define S3C2410_GPB1 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 1) 158 - #define S3C2410_GPB1_INP (0x00 << 2) 159 - #define S3C2410_GPB1_OUTP (0x01 << 2) 160 200 #define S3C2410_GPB1_TOUT1 (0x02 << 2) 161 201 #define S3C2400_GPB1_DATA17 (0x02 << 2) 162 202 163 - #define S3C2410_GPB2 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 2) 164 - #define S3C2410_GPB2_INP (0x00 << 4) 165 - #define S3C2410_GPB2_OUTP (0x01 << 4) 166 203 #define S3C2410_GPB2_TOUT2 (0x02 << 4) 167 204 #define S3C2400_GPB2_DATA18 (0x02 << 4) 168 205 #define S3C2400_GPB2_TCLK1 (0x03 << 4) 169 206 170 - #define S3C2410_GPB3 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 3) 171 - #define S3C2410_GPB3_INP (0x00 << 6) 172 - #define S3C2410_GPB3_OUTP (0x01 << 6) 173 207 #define S3C2410_GPB3_TOUT3 (0x02 << 6) 174 208 #define S3C2400_GPB3_DATA19 (0x02 << 6) 175 209 #define S3C2400_GPB3_TXD1 (0x03 << 6) 176 210 177 - #define S3C2410_GPB4 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 4) 178 - #define S3C2410_GPB4_INP (0x00 << 8) 179 - #define S3C2410_GPB4_OUTP (0x01 << 8) 180 211 #define S3C2410_GPB4_TCLK0 (0x02 << 8) 181 212 #define S3C2400_GPB4_DATA20 (0x02 << 8) 182 213 #define S3C2410_GPB4_MASK (0x03 << 8) 183 214 #define S3C2400_GPB4_RXD1 (0x03 << 8) 184 215 #define S3C2400_GPB4_MASK (0x03 << 8) 185 216 186 - #define S3C2410_GPB5 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 5) 187 - #define S3C2410_GPB5_INP (0x00 << 10) 188 - #define S3C2410_GPB5_OUTP (0x01 << 10) 189 217 #define S3C2410_GPB5_nXBACK (0x02 << 10) 190 218 #define S3C2443_GPB5_XBACK (0x03 << 10) 191 219 #define S3C2400_GPB5_DATA21 (0x02 << 10) 192 220 #define S3C2400_GPB5_nCTS1 (0x03 << 10) 193 221 194 - #define S3C2410_GPB6 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 6) 195 - #define S3C2410_GPB6_INP (0x00 << 12) 196 - #define S3C2410_GPB6_OUTP (0x01 << 12) 197 222 #define S3C2410_GPB6_nXBREQ (0x02 << 12) 198 223 #define S3C2443_GPB6_XBREQ (0x03 << 12) 199 224 #define S3C2400_GPB6_DATA22 (0x02 << 12) 200 225 #define S3C2400_GPB6_nRTS1 (0x03 << 12) 201 226 202 - #define S3C2410_GPB7 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 7) 203 - #define S3C2410_GPB7_INP (0x00 << 14) 204 - #define S3C2410_GPB7_OUTP (0x01 << 14) 205 227 #define S3C2410_GPB7_nXDACK1 (0x02 << 14) 206 228 #define S3C2443_GPB7_XDACK1 (0x03 << 14) 207 229 #define S3C2400_GPB7_DATA23 (0x02 << 14) 208 230 209 - #define S3C2410_GPB8 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 8) 210 - #define S3C2410_GPB8_INP (0x00 << 16) 211 - #define S3C2410_GPB8_OUTP (0x01 << 16) 212 231 #define S3C2410_GPB8_nXDREQ1 (0x02 << 16) 213 232 #define S3C2400_GPB8_DATA24 (0x02 << 16) 214 233 215 - #define S3C2410_GPB9 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 9) 216 - #define S3C2410_GPB9_INP (0x00 << 18) 217 - #define S3C2410_GPB9_OUTP (0x01 << 18) 218 234 #define S3C2410_GPB9_nXDACK0 (0x02 << 18) 219 235 #define S3C2443_GPB9_XDACK0 (0x03 << 18) 220 236 #define S3C2400_GPB9_DATA25 (0x02 << 18) 221 237 #define S3C2400_GPB9_I2SSDI (0x03 << 18) 222 238 223 - #define S3C2410_GPB10 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 10) 224 - #define S3C2410_GPB10_INP (0x00 << 20) 225 - #define S3C2410_GPB10_OUTP (0x01 << 20) 226 239 #define S3C2410_GPB10_nXDRE0 (0x02 << 20) 227 240 #define S3C2443_GPB10_XDREQ0 (0x03 << 20) 228 241 #define S3C2400_GPB10_DATA26 (0x02 << 20) 229 242 #define S3C2400_GPB10_nSS (0x03 << 20) 230 243 231 - #define S3C2400_GPB11 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 11) 232 244 #define S3C2400_GPB11_INP (0x00 << 22) 233 245 #define S3C2400_GPB11_OUTP (0x01 << 22) 234 246 #define S3C2400_GPB11_DATA27 (0x02 << 22) 235 247 236 - #define S3C2400_GPB12 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 12) 237 248 #define S3C2400_GPB12_INP (0x00 << 24) 238 249 #define S3C2400_GPB12_OUTP (0x01 << 24) 239 250 #define S3C2400_GPB12_DATA28 (0x02 << 24) 240 251 241 - #define S3C2400_GPB13 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 13) 242 252 #define S3C2400_GPB13_INP (0x00 << 26) 243 253 #define S3C2400_GPB13_OUTP (0x01 << 26) 244 254 #define S3C2400_GPB13_DATA29 (0x02 << 26) 245 255 246 - #define S3C2400_GPB14 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 14) 247 256 #define S3C2400_GPB14_INP (0x00 << 28) 248 257 #define S3C2400_GPB14_OUTP (0x01 << 28) 249 258 #define S3C2400_GPB14_DATA30 (0x02 << 28) 250 259 251 - #define S3C2400_GPB15 S3C2410_GPIONO(S3C2410_GPIO_BANKB, 15) 252 260 #define S3C2400_GPB15_INP (0x00 << 30) 253 261 #define S3C2400_GPB15_OUTP (0x01 << 30) 254 262 #define S3C2400_GPB15_DATA31 (0x02 << 30) ··· 231 315 #define S3C2400_GPCDAT S3C2410_GPIOREG(0x18) 232 316 #define S3C2400_GPCUP S3C2410_GPIOREG(0x1C) 233 317 234 - #define S3C2410_GPC0 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 0) 235 - #define S3C2410_GPC0_INP (0x00 << 0) 236 - #define S3C2410_GPC0_OUTP (0x01 << 0) 237 318 #define S3C2410_GPC0_LEND (0x02 << 0) 238 319 #define S3C2400_GPC0_VD0 (0x02 << 0) 239 320 240 - #define S3C2410_GPC1 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 1) 241 - #define S3C2410_GPC1_INP (0x00 << 2) 242 - #define S3C2410_GPC1_OUTP (0x01 << 2) 243 321 #define S3C2410_GPC1_VCLK (0x02 << 2) 244 322 #define S3C2400_GPC1_VD1 (0x02 << 2) 245 323 246 - #define S3C2410_GPC2 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 2) 247 - #define S3C2410_GPC2_INP (0x00 << 4) 248 - #define S3C2410_GPC2_OUTP (0x01 << 4) 249 324 #define S3C2410_GPC2_VLINE (0x02 << 4) 250 325 #define S3C2400_GPC2_VD2 (0x02 << 4) 251 326 252 - #define S3C2410_GPC3 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 3) 253 - #define S3C2410_GPC3_INP (0x00 << 6) 254 - #define S3C2410_GPC3_OUTP (0x01 << 6) 255 327 #define S3C2410_GPC3_VFRAME (0x02 << 6) 256 328 #define S3C2400_GPC3_VD3 (0x02 << 6) 257 329 258 - #define S3C2410_GPC4 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 4) 259 - #define S3C2410_GPC4_INP (0x00 << 8) 260 - #define S3C2410_GPC4_OUTP (0x01 << 8) 261 330 #define S3C2410_GPC4_VM (0x02 << 8) 262 331 #define S3C2400_GPC4_VD4 (0x02 << 8) 263 332 264 - #define S3C2410_GPC5 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 5) 265 - #define S3C2410_GPC5_INP (0x00 << 10) 266 - #define S3C2410_GPC5_OUTP (0x01 << 10) 267 333 #define S3C2410_GPC5_LCDVF0 (0x02 << 10) 268 334 #define S3C2400_GPC5_VD5 (0x02 << 10) 269 335 270 - #define S3C2410_GPC6 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 6) 271 - #define S3C2410_GPC6_INP (0x00 << 12) 272 - #define S3C2410_GPC6_OUTP (0x01 << 12) 273 336 #define S3C2410_GPC6_LCDVF1 (0x02 << 12) 274 337 #define S3C2400_GPC6_VD6 (0x02 << 12) 275 338 276 - #define S3C2410_GPC7 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 7) 277 - #define S3C2410_GPC7_INP (0x00 << 14) 278 - #define S3C2410_GPC7_OUTP (0x01 << 14) 279 339 #define S3C2410_GPC7_LCDVF2 (0x02 << 14) 280 340 #define S3C2400_GPC7_VD7 (0x02 << 14) 281 341 282 - #define S3C2410_GPC8 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 8) 283 - #define S3C2410_GPC8_INP (0x00 << 16) 284 - #define S3C2410_GPC8_OUTP (0x01 << 16) 285 342 #define S3C2410_GPC8_VD0 (0x02 << 16) 286 343 #define S3C2400_GPC8_VD8 (0x02 << 16) 287 344 288 - #define S3C2410_GPC9 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 9) 289 - #define S3C2410_GPC9_INP (0x00 << 18) 290 - #define S3C2410_GPC9_OUTP (0x01 << 18) 291 345 #define S3C2410_GPC9_VD1 (0x02 << 18) 292 346 #define S3C2400_GPC9_VD9 (0x02 << 18) 293 347 294 - #define S3C2410_GPC10 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 10) 295 - #define S3C2410_GPC10_INP (0x00 << 20) 296 - #define S3C2410_GPC10_OUTP (0x01 << 20) 297 348 #define S3C2410_GPC10_VD2 (0x02 << 20) 298 349 #define S3C2400_GPC10_VD10 (0x02 << 20) 299 350 300 - #define S3C2410_GPC11 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 11) 301 - #define S3C2410_GPC11_INP (0x00 << 22) 302 - #define S3C2410_GPC11_OUTP (0x01 << 22) 303 351 #define S3C2410_GPC11_VD3 (0x02 << 22) 304 352 #define S3C2400_GPC11_VD11 (0x02 << 22) 305 353 306 - #define S3C2410_GPC12 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 12) 307 - #define S3C2410_GPC12_INP (0x00 << 24) 308 - #define S3C2410_GPC12_OUTP (0x01 << 24) 309 354 #define S3C2410_GPC12_VD4 (0x02 << 24) 310 355 #define S3C2400_GPC12_VD12 (0x02 << 24) 311 356 312 - #define S3C2410_GPC13 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 13) 313 - #define S3C2410_GPC13_INP (0x00 << 26) 314 - #define S3C2410_GPC13_OUTP (0x01 << 26) 315 357 #define S3C2410_GPC13_VD5 (0x02 << 26) 316 358 #define S3C2400_GPC13_VD13 (0x02 << 26) 317 359 318 - #define S3C2410_GPC14 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 14) 319 - #define S3C2410_GPC14_INP (0x00 << 28) 320 - #define S3C2410_GPC14_OUTP (0x01 << 28) 321 360 #define S3C2410_GPC14_VD6 (0x02 << 28) 322 361 #define S3C2400_GPC14_VD14 (0x02 << 28) 323 362 324 - #define S3C2410_GPC15 S3C2410_GPIONO(S3C2410_GPIO_BANKC, 15) 325 - #define S3C2410_GPC15_INP (0x00 << 30) 326 - #define S3C2410_GPC15_OUTP (0x01 << 30) 327 363 #define S3C2410_GPC15_VD7 (0x02 << 30) 328 364 #define S3C2400_GPC15_VD15 (0x02 << 30) 329 365 ··· 300 432 #define S3C2400_GPDDAT S3C2410_GPIOREG(0x24) 301 433 #define S3C2400_GPDUP S3C2410_GPIOREG(0x28) 302 434 303 - #define S3C2410_GPD0 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 0) 304 - #define S3C2410_GPD0_INP (0x00 << 0) 305 - #define S3C2410_GPD0_OUTP (0x01 << 0) 306 435 #define S3C2410_GPD0_VD8 (0x02 << 0) 307 436 #define S3C2400_GPD0_VFRAME (0x02 << 0) 308 437 #define S3C2442_GPD0_nSPICS1 (0x03 << 0) 309 438 310 - #define S3C2410_GPD1 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 1) 311 - #define S3C2410_GPD1_INP (0x00 << 2) 312 - #define S3C2410_GPD1_OUTP (0x01 << 2) 313 439 #define S3C2410_GPD1_VD9 (0x02 << 2) 314 440 #define S3C2400_GPD1_VM (0x02 << 2) 315 441 #define S3C2442_GPD1_SPICLK1 (0x03 << 2) 316 442 317 - #define S3C2410_GPD2 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 2) 318 - #define S3C2410_GPD2_INP (0x00 << 4) 319 - #define S3C2410_GPD2_OUTP (0x01 << 4) 320 443 #define S3C2410_GPD2_VD10 (0x02 << 4) 321 444 #define S3C2400_GPD2_VLINE (0x02 << 4) 322 445 323 - #define S3C2410_GPD3 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 3) 324 - #define S3C2410_GPD3_INP (0x00 << 6) 325 - #define S3C2410_GPD3_OUTP (0x01 << 6) 326 446 #define S3C2410_GPD3_VD11 (0x02 << 6) 327 447 #define S3C2400_GPD3_VCLK (0x02 << 6) 328 448 329 - #define S3C2410_GPD4 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 4) 330 - #define S3C2410_GPD4_INP (0x00 << 8) 331 - #define S3C2410_GPD4_OUTP (0x01 << 8) 332 449 #define S3C2410_GPD4_VD12 (0x02 << 8) 333 450 #define S3C2400_GPD4_LEND (0x02 << 8) 334 451 335 - #define S3C2410_GPD5 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 5) 336 - #define S3C2410_GPD5_INP (0x00 << 10) 337 - #define S3C2410_GPD5_OUTP (0x01 << 10) 338 452 #define S3C2410_GPD5_VD13 (0x02 << 10) 339 453 #define S3C2400_GPD5_TOUT0 (0x02 << 10) 340 454 341 - #define S3C2410_GPD6 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 6) 342 - #define S3C2410_GPD6_INP (0x00 << 12) 343 - #define S3C2410_GPD6_OUTP (0x01 << 12) 344 455 #define S3C2410_GPD6_VD14 (0x02 << 12) 345 456 #define S3C2400_GPD6_TOUT1 (0x02 << 12) 346 457 347 - #define S3C2410_GPD7 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 7) 348 - #define S3C2410_GPD7_INP (0x00 << 14) 349 - #define S3C2410_GPD7_OUTP (0x01 << 14) 350 458 #define S3C2410_GPD7_VD15 (0x02 << 14) 351 459 #define S3C2400_GPD7_TOUT2 (0x02 << 14) 352 460 353 - #define S3C2410_GPD8 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 8) 354 - #define S3C2410_GPD8_INP (0x00 << 16) 355 - #define S3C2410_GPD8_OUTP (0x01 << 16) 356 461 #define S3C2410_GPD8_VD16 (0x02 << 16) 357 462 #define S3C2400_GPD8_TOUT3 (0x02 << 16) 358 463 359 - #define S3C2410_GPD9 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 9) 360 - #define S3C2410_GPD9_INP (0x00 << 18) 361 - #define S3C2410_GPD9_OUTP (0x01 << 18) 362 464 #define S3C2410_GPD9_VD17 (0x02 << 18) 363 465 #define S3C2400_GPD9_TCLK0 (0x02 << 18) 364 466 #define S3C2410_GPD9_MASK (0x03 << 18) 365 467 366 - #define S3C2410_GPD10 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 10) 367 - #define S3C2410_GPD10_INP (0x00 << 20) 368 - #define S3C2410_GPD10_OUTP (0x01 << 20) 369 468 #define S3C2410_GPD10_VD18 (0x02 << 20) 370 469 #define S3C2400_GPD10_nWAIT (0x02 << 20) 371 470 372 - #define S3C2410_GPD11 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 11) 373 - #define S3C2410_GPD11_INP (0x00 << 22) 374 - #define S3C2410_GPD11_OUTP (0x01 << 22) 375 471 #define S3C2410_GPD11_VD19 (0x02 << 22) 376 472 377 - #define S3C2410_GPD12 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 12) 378 - #define S3C2410_GPD12_INP (0x00 << 24) 379 - #define S3C2410_GPD12_OUTP (0x01 << 24) 380 473 #define S3C2410_GPD12_VD20 (0x02 << 24) 381 474 382 - #define S3C2410_GPD13 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 13) 383 - #define S3C2410_GPD13_INP (0x00 << 26) 384 - #define S3C2410_GPD13_OUTP (0x01 << 26) 385 475 #define S3C2410_GPD13_VD21 (0x02 << 26) 386 476 387 - #define S3C2410_GPD14 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 14) 388 - #define S3C2410_GPD14_INP (0x00 << 28) 389 - #define S3C2410_GPD14_OUTP (0x01 << 28) 390 477 #define S3C2410_GPD14_VD22 (0x02 << 28) 391 478 #define S3C2410_GPD14_nSS1 (0x03 << 28) 392 479 393 - #define S3C2410_GPD15 S3C2410_GPIONO(S3C2410_GPIO_BANKD, 15) 394 - #define S3C2410_GPD15_INP (0x00 << 30) 395 - #define S3C2410_GPD15_OUTP (0x01 << 30) 396 480 #define S3C2410_GPD15_VD23 (0x02 << 30) 397 481 #define S3C2410_GPD15_nSS0 (0x03 << 30) 398 482 ··· 370 550 #define S3C2400_GPEDAT S3C2410_GPIOREG(0x30) 371 551 #define S3C2400_GPEUP S3C2410_GPIOREG(0x34) 372 552 373 - #define S3C2410_GPE0 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 0) 374 - #define S3C2410_GPE0_INP (0x00 << 0) 375 - #define S3C2410_GPE0_OUTP (0x01 << 0) 376 553 #define S3C2410_GPE0_I2SLRCK (0x02 << 0) 377 554 #define S3C2443_GPE0_AC_nRESET (0x03 << 0) 378 555 #define S3C2400_GPE0_EINT0 (0x02 << 0) 379 556 #define S3C2410_GPE0_MASK (0x03 << 0) 380 557 381 - #define S3C2410_GPE1 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 1) 382 - #define S3C2410_GPE1_INP (0x00 << 2) 383 - #define S3C2410_GPE1_OUTP (0x01 << 2) 384 558 #define S3C2410_GPE1_I2SSCLK (0x02 << 2) 385 559 #define S3C2443_GPE1_AC_SYNC (0x03 << 2) 386 560 #define S3C2400_GPE1_EINT1 (0x02 << 2) 387 561 #define S3C2400_GPE1_nSS (0x03 << 2) 388 562 #define S3C2410_GPE1_MASK (0x03 << 2) 389 563 390 - #define S3C2410_GPE2 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 2) 391 - #define S3C2410_GPE2_INP (0x00 << 4) 392 - #define S3C2410_GPE2_OUTP (0x01 << 4) 393 564 #define S3C2410_GPE2_CDCLK (0x02 << 4) 394 565 #define S3C2443_GPE2_AC_BITCLK (0x03 << 4) 395 566 #define S3C2400_GPE2_EINT2 (0x02 << 4) 396 567 #define S3C2400_GPE2_I2SSDI (0x03 << 4) 397 568 398 - #define S3C2410_GPE3 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 3) 399 - #define S3C2410_GPE3_INP (0x00 << 6) 400 - #define S3C2410_GPE3_OUTP (0x01 << 6) 401 569 #define S3C2410_GPE3_I2SSDI (0x02 << 6) 402 570 #define S3C2443_GPE3_AC_SDI (0x03 << 6) 403 571 #define S3C2400_GPE3_EINT3 (0x02 << 6) ··· 393 585 #define S3C2410_GPE3_nSS0 (0x03 << 6) 394 586 #define S3C2410_GPE3_MASK (0x03 << 6) 395 587 396 - #define S3C2410_GPE4 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 4) 397 - #define S3C2410_GPE4_INP (0x00 << 8) 398 - #define S3C2410_GPE4_OUTP (0x01 << 8) 399 588 #define S3C2410_GPE4_I2SSDO (0x02 << 8) 400 589 #define S3C2443_GPE4_AC_SDO (0x03 << 8) 401 590 #define S3C2400_GPE4_EINT4 (0x02 << 8) ··· 400 595 #define S3C2410_GPE4_I2SSDI (0x03 << 8) 401 596 #define S3C2410_GPE4_MASK (0x03 << 8) 402 597 403 - #define S3C2410_GPE5 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 5) 404 - #define S3C2410_GPE5_INP (0x00 << 10) 405 - #define S3C2410_GPE5_OUTP (0x01 << 10) 406 598 #define S3C2410_GPE5_SDCLK (0x02 << 10) 407 599 #define S3C2443_GPE5_SD1_CLK (0x02 << 10) 408 600 #define S3C2400_GPE5_EINT5 (0x02 << 10) 409 601 #define S3C2400_GPE5_TCLK1 (0x03 << 10) 410 602 411 - #define S3C2410_GPE6 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 6) 412 - #define S3C2410_GPE6_INP (0x00 << 12) 413 - #define S3C2410_GPE6_OUTP (0x01 << 12) 414 603 #define S3C2410_GPE6_SDCMD (0x02 << 12) 415 604 #define S3C2443_GPE6_SD1_CMD (0x02 << 12) 416 605 #define S3C2443_GPE6_AC_BITCLK (0x03 << 12) 417 606 #define S3C2400_GPE6_EINT6 (0x02 << 12) 418 607 419 - #define S3C2410_GPE7 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 7) 420 - #define S3C2410_GPE7_INP (0x00 << 14) 421 - #define S3C2410_GPE7_OUTP (0x01 << 14) 422 608 #define S3C2410_GPE7_SDDAT0 (0x02 << 14) 423 609 #define S3C2443_GPE5_SD1_DAT0 (0x02 << 14) 424 610 #define S3C2443_GPE7_AC_SDI (0x03 << 14) 425 611 #define S3C2400_GPE7_EINT7 (0x02 << 14) 426 612 427 - #define S3C2410_GPE8 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 8) 428 - #define S3C2410_GPE8_INP (0x00 << 16) 429 - #define S3C2410_GPE8_OUTP (0x01 << 16) 430 613 #define S3C2410_GPE8_SDDAT1 (0x02 << 16) 431 614 #define S3C2443_GPE8_SD1_DAT1 (0x02 << 16) 432 615 #define S3C2443_GPE8_AC_SDO (0x03 << 16) 433 616 #define S3C2400_GPE8_nXDACK0 (0x02 << 16) 434 617 435 - #define S3C2410_GPE9 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 9) 436 - #define S3C2410_GPE9_INP (0x00 << 18) 437 - #define S3C2410_GPE9_OUTP (0x01 << 18) 438 618 #define S3C2410_GPE9_SDDAT2 (0x02 << 18) 439 619 #define S3C2443_GPE9_SD1_DAT2 (0x02 << 18) 440 620 #define S3C2443_GPE9_AC_SYNC (0x03 << 18) 441 621 #define S3C2400_GPE9_nXDACK1 (0x02 << 18) 442 622 #define S3C2400_GPE9_nXBACK (0x03 << 18) 443 623 444 - #define S3C2410_GPE10 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 10) 445 - #define S3C2410_GPE10_INP (0x00 << 20) 446 - #define S3C2410_GPE10_OUTP (0x01 << 20) 447 624 #define S3C2410_GPE10_SDDAT3 (0x02 << 20) 448 625 #define S3C2443_GPE10_SD1_DAT3 (0x02 << 20) 449 626 #define S3C2443_GPE10_AC_nRESET (0x03 << 20) 450 627 #define S3C2400_GPE10_nXDREQ0 (0x02 << 20) 451 628 452 - #define S3C2410_GPE11 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 11) 453 - #define S3C2410_GPE11_INP (0x00 << 22) 454 - #define S3C2410_GPE11_OUTP (0x01 << 22) 455 629 #define S3C2410_GPE11_SPIMISO0 (0x02 << 22) 456 630 #define S3C2400_GPE11_nXDREQ1 (0x02 << 22) 457 631 #define S3C2400_GPE11_nXBREQ (0x03 << 22) 458 632 459 - #define S3C2410_GPE12 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 12) 460 - #define S3C2410_GPE12_INP (0x00 << 24) 461 - #define S3C2410_GPE12_OUTP (0x01 << 24) 462 633 #define S3C2410_GPE12_SPIMOSI0 (0x02 << 24) 463 634 464 - #define S3C2410_GPE13 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 13) 465 - #define S3C2410_GPE13_INP (0x00 << 26) 466 - #define S3C2410_GPE13_OUTP (0x01 << 26) 467 635 #define S3C2410_GPE13_SPICLK0 (0x02 << 26) 468 636 469 - #define S3C2410_GPE14 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 14) 470 - #define S3C2410_GPE14_INP (0x00 << 28) 471 - #define S3C2410_GPE14_OUTP (0x01 << 28) 472 637 #define S3C2410_GPE14_IICSCL (0x02 << 28) 473 638 #define S3C2410_GPE14_MASK (0x03 << 28) 474 639 475 - #define S3C2410_GPE15 S3C2410_GPIONO(S3C2410_GPIO_BANKE, 15) 476 - #define S3C2410_GPE15_INP (0x00 << 30) 477 - #define S3C2410_GPE15_OUTP (0x01 << 30) 478 640 #define S3C2410_GPE15_IICSDA (0x02 << 30) 479 641 #define S3C2410_GPE15_MASK (0x03 << 30) 480 642 ··· 477 705 #define S3C2400_GPFDAT S3C2410_GPIOREG(0x3C) 478 706 #define S3C2400_GPFUP S3C2410_GPIOREG(0x40) 479 707 480 - #define S3C2410_GPF0 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 0) 481 - #define S3C2410_GPF0_INP (0x00 << 0) 482 - #define S3C2410_GPF0_OUTP (0x01 << 0) 483 708 #define S3C2410_GPF0_EINT0 (0x02 << 0) 484 709 #define S3C2400_GPF0_RXD0 (0x02 << 0) 485 710 486 - #define S3C2410_GPF1 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 1) 487 - #define S3C2410_GPF1_INP (0x00 << 2) 488 - #define S3C2410_GPF1_OUTP (0x01 << 2) 489 711 #define S3C2410_GPF1_EINT1 (0x02 << 2) 490 712 #define S3C2400_GPF1_RXD1 (0x02 << 2) 491 713 #define S3C2400_GPF1_IICSDA (0x03 << 2) 492 714 493 - #define S3C2410_GPF2 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 2) 494 - #define S3C2410_GPF2_INP (0x00 << 4) 495 - #define S3C2410_GPF2_OUTP (0x01 << 4) 496 715 #define S3C2410_GPF2_EINT2 (0x02 << 4) 497 716 #define S3C2400_GPF2_TXD0 (0x02 << 4) 498 717 499 - #define S3C2410_GPF3 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 3) 500 - #define S3C2410_GPF3_INP (0x00 << 6) 501 - #define S3C2410_GPF3_OUTP (0x01 << 6) 502 718 #define S3C2410_GPF3_EINT3 (0x02 << 6) 503 719 #define S3C2400_GPF3_TXD1 (0x02 << 6) 504 720 #define S3C2400_GPF3_IICSCL (0x03 << 6) 505 721 506 - #define S3C2410_GPF4 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 4) 507 - #define S3C2410_GPF4_INP (0x00 << 8) 508 - #define S3C2410_GPF4_OUTP (0x01 << 8) 509 722 #define S3C2410_GPF4_EINT4 (0x02 << 8) 510 723 #define S3C2400_GPF4_nRTS0 (0x02 << 8) 511 724 #define S3C2400_GPF4_nXBACK (0x03 << 8) 512 725 513 - #define S3C2410_GPF5 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 5) 514 - #define S3C2410_GPF5_INP (0x00 << 10) 515 - #define S3C2410_GPF5_OUTP (0x01 << 10) 516 726 #define S3C2410_GPF5_EINT5 (0x02 << 10) 517 727 #define S3C2400_GPF5_nCTS0 (0x02 << 10) 518 728 #define S3C2400_GPF5_nXBREQ (0x03 << 10) 519 729 520 - #define S3C2410_GPF6 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 6) 521 - #define S3C2410_GPF6_INP (0x00 << 12) 522 - #define S3C2410_GPF6_OUTP (0x01 << 12) 523 730 #define S3C2410_GPF6_EINT6 (0x02 << 12) 524 731 #define S3C2400_GPF6_CLKOUT (0x02 << 12) 525 732 526 - #define S3C2410_GPF7 S3C2410_GPIONO(S3C2410_GPIO_BANKF, 7) 527 - #define S3C2410_GPF7_INP (0x00 << 14) 528 - #define S3C2410_GPF7_OUTP (0x01 << 14) 529 733 #define S3C2410_GPF7_EINT7 (0x02 << 14) 530 734 531 735 #define S3C2410_GPF_PUPDIS(x) (1<<(x)) ··· 526 778 #define S3C2400_GPGDAT S3C2410_GPIOREG(0x48) 527 779 #define S3C2400_GPGUP S3C2410_GPIOREG(0x4C) 528 780 529 - #define S3C2410_GPG0 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 0) 530 - #define S3C2410_GPG0_INP (0x00 << 0) 531 - #define S3C2410_GPG0_OUTP (0x01 << 0) 532 781 #define S3C2410_GPG0_EINT8 (0x02 << 0) 533 782 #define S3C2400_GPG0_I2SLRCK (0x02 << 0) 534 783 535 - #define S3C2410_GPG1 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 1) 536 - #define S3C2410_GPG1_INP (0x00 << 2) 537 - #define S3C2410_GPG1_OUTP (0x01 << 2) 538 784 #define S3C2410_GPG1_EINT9 (0x02 << 2) 539 785 #define S3C2400_GPG1_I2SSCLK (0x02 << 2) 540 786 541 - #define S3C2410_GPG2 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 2) 542 - #define S3C2410_GPG2_INP (0x00 << 4) 543 - #define S3C2410_GPG2_OUTP (0x01 << 4) 544 787 #define S3C2410_GPG2_EINT10 (0x02 << 4) 545 788 #define S3C2410_GPG2_nSS0 (0x03 << 4) 546 789 #define S3C2400_GPG2_CDCLK (0x02 << 4) 547 790 548 - #define S3C2410_GPG3 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 3) 549 - #define S3C2410_GPG3_INP (0x00 << 6) 550 - #define S3C2410_GPG3_OUTP (0x01 << 6) 551 791 #define S3C2410_GPG3_EINT11 (0x02 << 6) 552 792 #define S3C2410_GPG3_nSS1 (0x03 << 6) 553 793 #define S3C2400_GPG3_I2SSDO (0x02 << 6) 554 794 #define S3C2400_GPG3_I2SSDI (0x03 << 6) 555 795 556 - #define S3C2410_GPG4 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 4) 557 - #define S3C2410_GPG4_INP (0x00 << 8) 558 - #define S3C2410_GPG4_OUTP (0x01 << 8) 559 796 #define S3C2410_GPG4_EINT12 (0x02 << 8) 560 797 #define S3C2400_GPG4_MMCCLK (0x02 << 8) 561 798 #define S3C2400_GPG4_I2SSDI (0x03 << 8) 562 799 #define S3C2410_GPG4_LCDPWREN (0x03 << 8) 563 800 #define S3C2443_GPG4_LCDPWRDN (0x03 << 8) 564 801 565 - #define S3C2410_GPG5 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 5) 566 - #define S3C2410_GPG5_INP (0x00 << 10) 567 - #define S3C2410_GPG5_OUTP (0x01 << 10) 568 802 #define S3C2410_GPG5_EINT13 (0x02 << 10) 569 803 #define S3C2400_GPG5_MMCCMD (0x02 << 10) 570 804 #define S3C2400_GPG5_IICSDA (0x03 << 10) 571 805 #define S3C2410_GPG5_SPIMISO1 (0x03 << 10) /* not s3c2443 */ 572 806 573 - #define S3C2410_GPG6 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 6) 574 - #define S3C2410_GPG6_INP (0x00 << 12) 575 - #define S3C2410_GPG6_OUTP (0x01 << 12) 576 807 #define S3C2410_GPG6_EINT14 (0x02 << 12) 577 808 #define S3C2400_GPG6_MMCDAT (0x02 << 12) 578 809 #define S3C2400_GPG6_IICSCL (0x03 << 12) 579 810 #define S3C2410_GPG6_SPIMOSI1 (0x03 << 12) 580 811 581 - #define S3C2410_GPG7 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 7) 582 - #define S3C2410_GPG7_INP (0x00 << 14) 583 - #define S3C2410_GPG7_OUTP (0x01 << 14) 584 812 #define S3C2410_GPG7_EINT15 (0x02 << 14) 585 813 #define S3C2410_GPG7_SPICLK1 (0x03 << 14) 586 814 #define S3C2400_GPG7_SPIMISO (0x02 << 14) 587 815 #define S3C2400_GPG7_IICSDA (0x03 << 14) 588 816 589 - #define S3C2410_GPG8 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 8) 590 - #define S3C2410_GPG8_INP (0x00 << 16) 591 - #define S3C2410_GPG8_OUTP (0x01 << 16) 592 817 #define S3C2410_GPG8_EINT16 (0x02 << 16) 593 818 #define S3C2400_GPG8_SPIMOSI (0x02 << 16) 594 819 #define S3C2400_GPG8_IICSCL (0x03 << 16) 595 820 596 - #define S3C2410_GPG9 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 9) 597 - #define S3C2410_GPG9_INP (0x00 << 18) 598 - #define S3C2410_GPG9_OUTP (0x01 << 18) 599 821 #define S3C2410_GPG9_EINT17 (0x02 << 18) 600 822 #define S3C2400_GPG9_SPICLK (0x02 << 18) 601 823 #define S3C2400_GPG9_MMCCLK (0x03 << 18) 602 824 603 - #define S3C2410_GPG10 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 10) 604 - #define S3C2410_GPG10_INP (0x00 << 20) 605 - #define S3C2410_GPG10_OUTP (0x01 << 20) 606 825 #define S3C2410_GPG10_EINT18 (0x02 << 20) 607 826 608 - #define S3C2410_GPG11 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 11) 609 - #define S3C2410_GPG11_INP (0x00 << 22) 610 - #define S3C2410_GPG11_OUTP (0x01 << 22) 611 827 #define S3C2410_GPG11_EINT19 (0x02 << 22) 612 828 #define S3C2410_GPG11_TCLK1 (0x03 << 22) 613 829 #define S3C2443_GPG11_CF_nIREQ (0x03 << 22) 614 830 615 - #define S3C2410_GPG12 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 12) 616 - #define S3C2410_GPG12_INP (0x00 << 24) 617 - #define S3C2410_GPG12_OUTP (0x01 << 24) 618 831 #define S3C2410_GPG12_EINT20 (0x02 << 24) 619 832 #define S3C2410_GPG12_XMON (0x03 << 24) 620 833 #define S3C2442_GPG12_nSPICS0 (0x03 << 24) 621 834 #define S3C2443_GPG12_nINPACK (0x03 << 24) 622 835 623 - #define S3C2410_GPG13 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 13) 624 - #define S3C2410_GPG13_INP (0x00 << 26) 625 - #define S3C2410_GPG13_OUTP (0x01 << 26) 626 836 #define S3C2410_GPG13_EINT21 (0x02 << 26) 627 837 #define S3C2410_GPG13_nXPON (0x03 << 26) 628 838 #define S3C2443_GPG13_CF_nREG (0x03 << 26) 629 839 630 - #define S3C2410_GPG14 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 14) 631 - #define S3C2410_GPG14_INP (0x00 << 28) 632 - #define S3C2410_GPG14_OUTP (0x01 << 28) 633 840 #define S3C2410_GPG14_EINT22 (0x02 << 28) 634 841 #define S3C2410_GPG14_YMON (0x03 << 28) 635 842 #define S3C2443_GPG14_CF_RESET (0x03 << 28) 636 843 637 - #define S3C2410_GPG15 S3C2410_GPIONO(S3C2410_GPIO_BANKG, 15) 638 - #define S3C2410_GPG15_INP (0x00 << 30) 639 - #define S3C2410_GPG15_OUTP (0x01 << 30) 640 844 #define S3C2410_GPG15_EINT23 (0x02 << 30) 641 845 #define S3C2410_GPG15_nYPON (0x03 << 30) 642 846 #define S3C2443_GPG15_CF_PWR (0x03 << 30) ··· 607 907 #define S3C2410_GPHDAT S3C2410_GPIOREG(0x74) 608 908 #define S3C2410_GPHUP S3C2410_GPIOREG(0x78) 609 909 610 - #define S3C2410_GPH0 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 0) 611 - #define S3C2410_GPH0_INP (0x00 << 0) 612 - #define S3C2410_GPH0_OUTP (0x01 << 0) 613 910 #define S3C2410_GPH0_nCTS0 (0x02 << 0) 614 911 615 - #define S3C2410_GPH1 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 1) 616 - #define S3C2410_GPH1_INP (0x00 << 2) 617 - #define S3C2410_GPH1_OUTP (0x01 << 2) 618 912 #define S3C2410_GPH1_nRTS0 (0x02 << 2) 619 913 620 - #define S3C2410_GPH2 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 2) 621 - #define S3C2410_GPH2_INP (0x00 << 4) 622 - #define S3C2410_GPH2_OUTP (0x01 << 4) 623 914 #define S3C2410_GPH2_TXD0 (0x02 << 4) 624 915 625 - #define S3C2410_GPH3 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 3) 626 - #define S3C2410_GPH3_INP (0x00 << 6) 627 - #define S3C2410_GPH3_OUTP (0x01 << 6) 628 916 #define S3C2410_GPH3_RXD0 (0x02 << 6) 629 917 630 - #define S3C2410_GPH4 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 4) 631 - #define S3C2410_GPH4_INP (0x00 << 8) 632 - #define S3C2410_GPH4_OUTP (0x01 << 8) 633 918 #define S3C2410_GPH4_TXD1 (0x02 << 8) 634 919 635 - #define S3C2410_GPH5 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 5) 636 - #define S3C2410_GPH5_INP (0x00 << 10) 637 - #define S3C2410_GPH5_OUTP (0x01 << 10) 638 920 #define S3C2410_GPH5_RXD1 (0x02 << 10) 639 921 640 - #define S3C2410_GPH6 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 6) 641 - #define S3C2410_GPH6_INP (0x00 << 12) 642 - #define S3C2410_GPH6_OUTP (0x01 << 12) 643 922 #define S3C2410_GPH6_TXD2 (0x02 << 12) 644 923 #define S3C2410_GPH6_nRTS1 (0x03 << 12) 645 924 646 - #define S3C2410_GPH7 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 7) 647 - #define S3C2410_GPH7_INP (0x00 << 14) 648 - #define S3C2410_GPH7_OUTP (0x01 << 14) 649 925 #define S3C2410_GPH7_RXD2 (0x02 << 14) 650 926 #define S3C2410_GPH7_nCTS1 (0x03 << 14) 651 927 652 - #define S3C2410_GPH8 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 8) 653 - #define S3C2410_GPH8_INP (0x00 << 16) 654 - #define S3C2410_GPH8_OUTP (0x01 << 16) 655 928 #define S3C2410_GPH8_UCLK (0x02 << 16) 656 929 657 - #define S3C2410_GPH9 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 9) 658 - #define S3C2410_GPH9_INP (0x00 << 18) 659 - #define S3C2410_GPH9_OUTP (0x01 << 18) 660 930 #define S3C2410_GPH9_CLKOUT0 (0x02 << 18) 661 931 #define S3C2442_GPH9_nSPICS0 (0x03 << 18) 662 932 663 - #define S3C2410_GPH10 S3C2410_GPIONO(S3C2410_GPIO_BANKH, 10) 664 - #define S3C2410_GPH10_INP (0x00 << 20) 665 - #define S3C2410_GPH10_OUTP (0x01 << 20) 666 933 #define S3C2410_GPH10_CLKOUT1 (0x02 << 20) 667 934 668 935 /* The S3C2412 and S3C2413 move the GPJ register set to after
+2 -34
arch/arm/mach-s3c2410/include/mach/system-reset.h
··· 11 11 */ 12 12 13 13 #include <mach/hardware.h> 14 - #include <linux/io.h> 15 - 16 - #include <plat/regs-watchdog.h> 17 - #include <mach/regs-clock.h> 18 - 19 - #include <linux/clk.h> 20 - #include <linux/err.h> 14 + #include <plat/watchdog-reset.h> 21 15 22 16 extern void (*s3c24xx_reset_hook)(void); 23 17 24 18 static void 25 19 arch_reset(char mode, const char *cmd) 26 20 { 27 - struct clk *wdtclk; 28 - 29 21 if (mode == 's') { 30 22 cpu_reset(0); 31 23 } ··· 25 33 if (s3c24xx_reset_hook) 26 34 s3c24xx_reset_hook(); 27 35 28 - printk("arch_reset: attempting watchdog reset\n"); 29 - 30 - __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ 31 - 32 - wdtclk = clk_get(NULL, "watchdog"); 33 - if (!IS_ERR(wdtclk)) { 34 - clk_enable(wdtclk); 35 - } else 36 - printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); 37 - 38 - /* put initial values into count and data */ 39 - __raw_writel(0x80, S3C2410_WTCNT); 40 - __raw_writel(0x80, S3C2410_WTDAT); 41 - 42 - /* set the watchdog to go and reset... */ 43 - __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | 44 - S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); 45 - 46 - /* wait for reset to assert... */ 47 - mdelay(500); 48 - 49 - printk(KERN_ERR "Watchdog reset failed to assert reset\n"); 50 - 51 - /* delay to allow the serial port to show the message */ 52 - mdelay(50); 36 + arch_wdt_reset(); 53 37 54 38 /* we'll take a jump through zero as a poor second */ 55 39 cpu_reset(0);
+3 -2
arch/arm/mach-s3c2410/mach-amlm5900.c
··· 32 32 #include <linux/list.h> 33 33 #include <linux/timer.h> 34 34 #include <linux/init.h> 35 + #include <linux/gpio.h> 35 36 #include <linux/device.h> 36 37 #include <linux/platform_device.h> 37 38 #include <linux/proc_fs.h> ··· 225 224 } else { 226 225 enable_irq_wake(IRQ_EINT9); 227 226 /* configure the suspend/resume status pin */ 228 - s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); 229 - s3c2410_gpio_pullup(S3C2410_GPF2, 0); 227 + s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); 228 + s3c2410_gpio_pullup(S3C2410_GPF(2), 0); 230 229 } 231 230 } 232 231 static void __init amlm5900_init(void)
+5 -5
arch/arm/mach-s3c2410/mach-bast.c
··· 16 16 #include <linux/list.h> 17 17 #include <linux/timer.h> 18 18 #include <linux/init.h> 19 + #include <linux/gpio.h> 19 20 #include <linux/sysdev.h> 20 21 #include <linux/serial_core.h> 21 22 #include <linux/platform_device.h> ··· 213 212 static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) 214 213 { 215 214 /* ensure that an nRESET is not generated on resume. */ 216 - s3c2410_gpio_setpin(S3C2410_GPA21, 1); 217 - s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT); 215 + s3c2410_gpio_setpin(S3C2410_GPA(21), 1); 216 + s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); 218 217 219 218 return 0; 220 219 } 221 220 222 221 static int bast_pm_resume(struct sys_device *sd) 223 222 { 224 - s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT); 223 + s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); 225 224 return 0; 226 225 } 227 226 ··· 592 591 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 593 592 s3c24xx_init_clocks(0); 594 593 s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); 595 - 596 - usb_simtec_init(); 597 594 } 598 595 599 596 static void __init bast_init(void) ··· 606 607 i2c_register_board_info(0, bast_i2c_devs, 607 608 ARRAY_SIZE(bast_i2c_devs)); 608 609 610 + usb_simtec_init(); 609 611 nor_simtec_init(); 610 612 } 611 613
+1 -1
arch/arm/mach-s3c2410/mach-h1940.c
··· 127 127 128 128 static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = { 129 129 .udc_command = h1940_udc_pullup, 130 - .vbus_pin = S3C2410_GPG5, 130 + .vbus_pin = S3C2410_GPG(5), 131 131 .vbus_pin_inverted = 1, 132 132 }; 133 133
+26 -25
arch/arm/mach-s3c2410/mach-n30.c
··· 19 19 20 20 #include <linux/gpio_keys.h> 21 21 #include <linux/init.h> 22 + #include <linux/gpio.h> 22 23 #include <linux/input.h> 23 24 #include <linux/interrupt.h> 24 25 #include <linux/platform_device.h> ··· 86 85 { 87 86 switch (cmd) { 88 87 case S3C2410_UDC_P_ENABLE : 89 - s3c2410_gpio_setpin(S3C2410_GPB3, 1); 88 + s3c2410_gpio_setpin(S3C2410_GPB(3), 1); 90 89 break; 91 90 case S3C2410_UDC_P_DISABLE : 92 - s3c2410_gpio_setpin(S3C2410_GPB3, 0); 91 + s3c2410_gpio_setpin(S3C2410_GPB(3), 0); 93 92 break; 94 93 case S3C2410_UDC_P_RESET : 95 94 break; ··· 100 99 101 100 static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = { 102 101 .udc_command = n30_udc_pullup, 103 - .vbus_pin = S3C2410_GPG1, 102 + .vbus_pin = S3C2410_GPG(1), 104 103 .vbus_pin_inverted = 0, 105 104 }; 106 105 107 106 static struct gpio_keys_button n30_buttons[] = { 108 107 { 109 - .gpio = S3C2410_GPF0, 108 + .gpio = S3C2410_GPF(0), 110 109 .code = KEY_POWER, 111 110 .desc = "Power", 112 111 .active_low = 0, 113 112 }, 114 113 { 115 - .gpio = S3C2410_GPG9, 114 + .gpio = S3C2410_GPG(9), 116 115 .code = KEY_UP, 117 116 .desc = "Thumbwheel Up", 118 117 .active_low = 0, 119 118 }, 120 119 { 121 - .gpio = S3C2410_GPG8, 120 + .gpio = S3C2410_GPG(8), 122 121 .code = KEY_DOWN, 123 122 .desc = "Thumbwheel Down", 124 123 .active_low = 0, 125 124 }, 126 125 { 127 - .gpio = S3C2410_GPG7, 126 + .gpio = S3C2410_GPG(7), 128 127 .code = KEY_ENTER, 129 128 .desc = "Thumbwheel Press", 130 129 .active_low = 0, 131 130 }, 132 131 { 133 - .gpio = S3C2410_GPF7, 132 + .gpio = S3C2410_GPF(7), 134 133 .code = KEY_HOMEPAGE, 135 134 .desc = "Home", 136 135 .active_low = 0, 137 136 }, 138 137 { 139 - .gpio = S3C2410_GPF6, 138 + .gpio = S3C2410_GPF(6), 140 139 .code = KEY_CALENDAR, 141 140 .desc = "Calendar", 142 141 .active_low = 0, 143 142 }, 144 143 { 145 - .gpio = S3C2410_GPF5, 144 + .gpio = S3C2410_GPF(5), 146 145 .code = KEY_ADDRESSBOOK, 147 146 .desc = "Contacts", 148 147 .active_low = 0, 149 148 }, 150 149 { 151 - .gpio = S3C2410_GPF4, 150 + .gpio = S3C2410_GPF(4), 152 151 .code = KEY_MAIL, 153 152 .desc = "Mail", 154 153 .active_low = 0, ··· 170 169 171 170 static struct gpio_keys_button n35_buttons[] = { 172 171 { 173 - .gpio = S3C2410_GPF0, 172 + .gpio = S3C2410_GPF(0), 174 173 .code = KEY_POWER, 175 174 .desc = "Power", 176 175 .active_low = 0, 177 176 }, 178 177 { 179 - .gpio = S3C2410_GPG9, 178 + .gpio = S3C2410_GPG(9), 180 179 .code = KEY_UP, 181 180 .desc = "Joystick Up", 182 181 .active_low = 0, 183 182 }, 184 183 { 185 - .gpio = S3C2410_GPG8, 184 + .gpio = S3C2410_GPG(8), 186 185 .code = KEY_DOWN, 187 186 .desc = "Joystick Down", 188 187 .active_low = 0, 189 188 }, 190 189 { 191 - .gpio = S3C2410_GPG6, 190 + .gpio = S3C2410_GPG(6), 192 191 .code = KEY_DOWN, 193 192 .desc = "Joystick Left", 194 193 .active_low = 0, 195 194 }, 196 195 { 197 - .gpio = S3C2410_GPG5, 196 + .gpio = S3C2410_GPG(5), 198 197 .code = KEY_DOWN, 199 198 .desc = "Joystick Right", 200 199 .active_low = 0, 201 200 }, 202 201 { 203 - .gpio = S3C2410_GPG7, 202 + .gpio = S3C2410_GPG(7), 204 203 .code = KEY_ENTER, 205 204 .desc = "Joystick Press", 206 205 .active_low = 0, 207 206 }, 208 207 { 209 - .gpio = S3C2410_GPF7, 208 + .gpio = S3C2410_GPF(7), 210 209 .code = KEY_HOMEPAGE, 211 210 .desc = "Home", 212 211 .active_low = 0, 213 212 }, 214 213 { 215 - .gpio = S3C2410_GPF6, 214 + .gpio = S3C2410_GPF(6), 216 215 .code = KEY_CALENDAR, 217 216 .desc = "Calendar", 218 217 .active_low = 0, 219 218 }, 220 219 { 221 - .gpio = S3C2410_GPF5, 220 + .gpio = S3C2410_GPF(5), 222 221 .code = KEY_ADDRESSBOOK, 223 222 .desc = "Contacts", 224 223 .active_low = 0, 225 224 }, 226 225 { 227 - .gpio = S3C2410_GPF4, 226 + .gpio = S3C2410_GPF(4), 228 227 .code = KEY_MAIL, 229 228 .desc = "Mail", 230 229 .active_low = 0, 231 230 }, 232 231 { 233 - .gpio = S3C2410_GPF3, 232 + .gpio = S3C2410_GPF(3), 234 233 .code = SW_RADIO, 235 234 .desc = "GPS Antenna", 236 235 .active_low = 0, 237 236 }, 238 237 { 239 - .gpio = S3C2410_GPG2, 238 + .gpio = S3C2410_GPG(2), 240 239 .code = SW_HEADPHONE_INSERT, 241 240 .desc = "Headphone", 242 241 .active_low = 0, ··· 260 259 /* This is the bluetooth LED on the device. */ 261 260 static struct s3c24xx_led_platdata n30_blue_led_pdata = { 262 261 .name = "blue_led", 263 - .gpio = S3C2410_GPG6, 262 + .gpio = S3C2410_GPG(6), 264 263 .def_trigger = "", 265 264 }; 266 265 ··· 271 270 static struct s3c24xx_led_platdata n30_warning_led_pdata = { 272 271 .name = "warning_led", 273 272 .flags = S3C24XX_LEDF_ACTLOW, 274 - .gpio = S3C2410_GPD9, 273 + .gpio = S3C2410_GPD(9), 275 274 .def_trigger = "", 276 275 }; 277 276
+10 -9
arch/arm/mach-s3c2410/mach-qt2410.c
··· 27 27 #include <linux/list.h> 28 28 #include <linux/timer.h> 29 29 #include <linux/init.h> 30 + #include <linux/gpio.h> 30 31 #include <linux/sysdev.h> 31 32 #include <linux/platform_device.h> 32 33 #include <linux/serial_core.h> ··· 199 198 /* LED */ 200 199 201 200 static struct s3c24xx_led_platdata qt2410_pdata_led = { 202 - .gpio = S3C2410_GPB0, 201 + .gpio = S3C2410_GPB(0), 203 202 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 204 203 .name = "led", 205 204 .def_trigger = "timer", ··· 219 218 { 220 219 switch (cs) { 221 220 case BITBANG_CS_ACTIVE: 222 - s3c2410_gpio_setpin(S3C2410_GPB5, 0); 221 + s3c2410_gpio_setpin(S3C2410_GPB(5), 0); 223 222 break; 224 223 case BITBANG_CS_INACTIVE: 225 - s3c2410_gpio_setpin(S3C2410_GPB5, 1); 224 + s3c2410_gpio_setpin(S3C2410_GPB(5), 1); 226 225 break; 227 226 } 228 227 } 229 228 230 229 static struct s3c2410_spigpio_info spi_gpio_cfg = { 231 - .pin_clk = S3C2410_GPG7, 232 - .pin_mosi = S3C2410_GPG6, 233 - .pin_miso = S3C2410_GPG5, 230 + .pin_clk = S3C2410_GPG(7), 231 + .pin_mosi = S3C2410_GPG(6), 232 + .pin_miso = S3C2410_GPG(5), 234 233 .chip_select = &spi_gpio_cs, 235 234 }; 236 235 ··· 347 346 } 348 347 s3c24xx_fb_set_platdata(&qt2410_fb_info); 349 348 350 - s3c2410_gpio_cfgpin(S3C2410_GPB0, S3C2410_GPIO_OUTPUT); 351 - s3c2410_gpio_setpin(S3C2410_GPB0, 1); 349 + s3c2410_gpio_cfgpin(S3C2410_GPB(0), S3C2410_GPIO_OUTPUT); 350 + s3c2410_gpio_setpin(S3C2410_GPB(0), 1); 352 351 353 352 s3c24xx_udc_set_platdata(&qt2410_udc_cfg); 354 353 s3c_i2c0_set_platdata(NULL); 355 354 356 - s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT); 355 + s3c2410_gpio_cfgpin(S3C2410_GPB(5), S3C2410_GPIO_OUTPUT); 357 356 358 357 platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); 359 358 s3c_pm_init();
+6 -5
arch/arm/mach-s3c2410/mach-vr1000.c
··· 18 18 #include <linux/list.h> 19 19 #include <linux/timer.h> 20 20 #include <linux/init.h> 21 + #include <linux/gpio.h> 21 22 #include <linux/dm9000.h> 22 23 #include <linux/i2c.h> 23 24 ··· 278 277 279 278 static struct s3c24xx_led_platdata vr1000_led1_pdata = { 280 279 .name = "led1", 281 - .gpio = S3C2410_GPB0, 280 + .gpio = S3C2410_GPB(0), 282 281 .def_trigger = "", 283 282 }; 284 283 285 284 static struct s3c24xx_led_platdata vr1000_led2_pdata = { 286 285 .name = "led2", 287 - .gpio = S3C2410_GPB1, 286 + .gpio = S3C2410_GPB(1), 288 287 .def_trigger = "", 289 288 }; 290 289 291 290 static struct s3c24xx_led_platdata vr1000_led3_pdata = { 292 291 .name = "led3", 293 - .gpio = S3C2410_GPB2, 292 + .gpio = S3C2410_GPB(2), 294 293 .def_trigger = "", 295 294 }; 296 295 ··· 356 355 357 356 static void vr1000_power_off(void) 358 357 { 359 - s3c2410_gpio_cfgpin(S3C2410_GPB9, S3C2410_GPB9_OUTP); 360 - s3c2410_gpio_setpin(S3C2410_GPB9, 1); 358 + s3c2410_gpio_cfgpin(S3C2410_GPB(9), S3C2410_GPIO_OUTPUT); 359 + s3c2410_gpio_setpin(S3C2410_GPB(9), 1); 361 360 } 362 361 363 362 static void __init vr1000_map_io(void)
+3 -2
arch/arm/mach-s3c2410/pm.c
··· 25 25 #include <linux/errno.h> 26 26 #include <linux/time.h> 27 27 #include <linux/sysdev.h> 28 + #include <linux/gpio.h> 28 29 #include <linux/io.h> 29 30 30 31 #include <mach/hardware.h> ··· 77 76 } 78 77 79 78 if ( machine_is_aml_m5900() ) 80 - s3c2410_gpio_setpin(S3C2410_GPF2, 1); 79 + s3c2410_gpio_setpin(S3C2410_GPF(2), 1); 81 80 82 81 } 83 82 ··· 92 91 __raw_writel(tmp, S3C2410_GSTATUS2); 93 92 94 93 if ( machine_is_aml_m5900() ) 95 - s3c2410_gpio_setpin(S3C2410_GPF2, 0); 94 + s3c2410_gpio_setpin(S3C2410_GPF(2), 0); 96 95 97 96 return 0; 98 97 }
+26 -8
arch/arm/mach-s3c2410/usb-simtec.c
··· 18 18 #include <linux/types.h> 19 19 #include <linux/interrupt.h> 20 20 #include <linux/list.h> 21 + #include <linux/gpio.h> 21 22 #include <linux/timer.h> 22 23 #include <linux/init.h> 23 24 #include <linux/device.h> 25 + #include <linux/gpio.h> 24 26 #include <linux/io.h> 25 27 26 28 #include <asm/mach/arch.h> ··· 31 29 32 30 #include <mach/bast-map.h> 33 31 #include <mach/bast-irq.h> 34 - #include <mach/regs-gpio.h> 35 32 36 33 #include <mach/hardware.h> 37 34 #include <asm/irq.h> ··· 54 53 power_state[port] = to; 55 54 56 55 if (power_state[0] && power_state[1]) 57 - s3c2410_gpio_setpin(S3C2410_GPB4, 0); 56 + gpio_set_value(S3C2410_GPB(4), 0); 58 57 else 59 - s3c2410_gpio_setpin(S3C2410_GPB4, 1); 58 + gpio_set_value(S3C2410_GPB(4), 1); 60 59 } 61 60 62 61 static irqreturn_t ··· 64 63 { 65 64 struct s3c2410_hcd_info *info = pw; 66 65 67 - if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { 66 + if (gpio_get_value(S3C2410_GPG(10)) == 0) { 68 67 pr_debug("usb_simtec: over-current irq (oc detected)\n"); 69 68 s3c2410_usb_report_oc(info, 3); 70 69 } else { ··· 107 106 108 107 int usb_simtec_init(void) 109 108 { 110 - printk("USB Power Control, (c) 2004 Simtec Electronics\n"); 111 - s3c_device_usb.dev.platform_data = &usb_simtec_info; 109 + int ret; 112 110 113 - s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP); 114 - s3c2410_gpio_setpin(S3C2410_GPB4, 1); 111 + printk("USB Power Control, (c) 2004 Simtec Electronics\n"); 112 + 113 + ret = gpio_request(S3C2410_GPB(4), "USB power control"); 114 + if (ret < 0) { 115 + pr_err("%s: failed to get GPB4\n", __func__); 116 + return ret; 117 + } 118 + 119 + ret = gpio_request(S3C2410_GPG(10), "USB overcurrent"); 120 + if (ret < 0) { 121 + pr_err("%s: failed to get GPG10\n", __func__); 122 + gpio_free(S3C2410_GPB(4)); 123 + return ret; 124 + } 125 + 126 + /* turn power on */ 127 + gpio_direction_output(S3C2410_GPB(4), 1); 128 + gpio_direction_input(S3C2410_GPG(10)); 129 + 130 + s3c_device_usb.dev.platform_data = &usb_simtec_info; 115 131 return 0; 116 132 }
+3
arch/arm/mach-s3c2412/Kconfig
··· 38 38 config MACH_JIVE 39 39 bool "Logitech Jive" 40 40 select CPU_S3C2412 41 + select S3C_DEV_USB_HOST 41 42 help 42 43 Say Y here if you are using the Logitech Jive. 43 44 ··· 51 50 select CPU_S3C2412 52 51 select MACH_S3C2413 53 52 select MACH_SMDK 53 + select S3C_DEV_USB_HOST 54 54 help 55 55 Say Y here if you are using an SMDK2413 56 56 ··· 74 72 config MACH_VSTMS 75 73 bool "VMSTMS" 76 74 select CPU_S3C2412 75 + select S3C_DEV_USB_HOST 77 76 help 78 77 Say Y here if you are using an VSTMS board 79 78
+2 -1
arch/arm/mach-s3c2412/dma.c
··· 20 20 21 21 #include <mach/dma.h> 22 22 23 - #include <plat/dma.h> 23 + #include <plat/dma-plat.h> 24 24 #include <plat/cpu.h> 25 25 26 26 #include <plat/regs-serial.h> 27 27 #include <mach/regs-gpio.h> 28 28 #include <plat/regs-ac97.h> 29 + #include <plat/regs-dma.h> 29 30 #include <mach/regs-mem.h> 30 31 #include <mach/regs-lcd.h> 31 32 #include <mach/regs-sdi.h>
+22 -21
arch/arm/mach-s3c2412/mach-jive.c
··· 16 16 #include <linux/list.h> 17 17 #include <linux/timer.h> 18 18 #include <linux/init.h> 19 + #include <linux/gpio.h> 19 20 #include <linux/sysdev.h> 20 21 #include <linux/serial_core.h> 21 22 #include <linux/platform_device.h> ··· 357 356 { 358 357 printk(KERN_DEBUG "%s(%d)\n", __func__, set); 359 358 360 - s3c2410_gpio_setpin(S3C2410_GPG13, set); 361 - s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPIO_OUTPUT); 359 + s3c2410_gpio_setpin(S3C2410_GPG(13), set); 360 + s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT); 362 361 } 363 362 364 363 #undef LCD_UPPER_MARGIN ··· 391 390 392 391 static void jive_lcd_spi_chipselect(struct s3c2410_spigpio_info *spi, int cs) 393 392 { 394 - s3c2410_gpio_setpin(S3C2410_GPB7, cs ? 0 : 1); 393 + s3c2410_gpio_setpin(S3C2410_GPB(7), cs ? 0 : 1); 395 394 } 396 395 397 396 static struct s3c2410_spigpio_info jive_lcd_spi = { 398 397 .bus_num = 1, 399 - .pin_clk = S3C2410_GPG8, 400 - .pin_mosi = S3C2410_GPB8, 398 + .pin_clk = S3C2410_GPG(8), 399 + .pin_mosi = S3C2410_GPB(8), 401 400 .num_chipselect = 1, 402 401 .chip_select = jive_lcd_spi_chipselect, 403 402 }; ··· 413 412 414 413 static void jive_wm8750_chipselect(struct s3c2410_spigpio_info *spi, int cs) 415 414 { 416 - s3c2410_gpio_setpin(S3C2410_GPH10, cs ? 0 : 1); 415 + s3c2410_gpio_setpin(S3C2410_GPH(10), cs ? 0 : 1); 417 416 } 418 417 419 418 static struct s3c2410_spigpio_info jive_wm8750_spi = { 420 419 .bus_num = 2, 421 - .pin_clk = S3C2410_GPB4, 422 - .pin_mosi = S3C2410_GPB9, 420 + .pin_clk = S3C2410_GPB(4), 421 + .pin_mosi = S3C2410_GPB(9), 423 422 .num_chipselect = 1, 424 423 .chip_select = jive_wm8750_chipselect, 425 424 }; ··· 480 479 }; 481 480 482 481 static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = { 483 - .vbus_pin = S3C2410_GPG1, /* detect is on GPG1 */ 482 + .vbus_pin = S3C2410_GPG(1), /* detect is on GPG1 */ 484 483 }; 485 484 486 485 /* Jive power management device */ ··· 530 529 { 531 530 printk(KERN_INFO "powering system down...\n"); 532 531 533 - s3c2410_gpio_setpin(S3C2410_GPC5, 1); 534 - s3c2410_gpio_cfgpin(S3C2410_GPC5, S3C2410_GPIO_OUTPUT); 532 + s3c2410_gpio_setpin(S3C2410_GPC(5), 1); 533 + s3c2410_gpio_cfgpin(S3C2410_GPC(5), S3C2410_GPIO_OUTPUT); 535 534 } 536 535 537 536 static void __init jive_machine_init(void) ··· 635 634 636 635 /* initialise the spi */ 637 636 638 - s3c2410_gpio_setpin(S3C2410_GPG13, 0); 639 - s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPIO_OUTPUT); 637 + s3c2410_gpio_setpin(S3C2410_GPG(13), 0); 638 + s3c2410_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_OUTPUT); 640 639 641 - s3c2410_gpio_setpin(S3C2410_GPB7, 1); 642 - s3c2410_gpio_cfgpin(S3C2410_GPB7, S3C2410_GPIO_OUTPUT); 640 + s3c2410_gpio_setpin(S3C2410_GPB(7), 1); 641 + s3c2410_gpio_cfgpin(S3C2410_GPB(7), S3C2410_GPIO_OUTPUT); 643 642 644 - s3c2410_gpio_setpin(S3C2410_GPB6, 0); 645 - s3c2410_gpio_cfgpin(S3C2410_GPB6, S3C2410_GPIO_OUTPUT); 643 + s3c2410_gpio_setpin(S3C2410_GPB(6), 0); 644 + s3c2410_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT); 646 645 647 - s3c2410_gpio_setpin(S3C2410_GPG8, 1); 648 - s3c2410_gpio_cfgpin(S3C2410_GPG8, S3C2410_GPIO_OUTPUT); 646 + s3c2410_gpio_setpin(S3C2410_GPG(8), 1); 647 + s3c2410_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT); 649 648 650 649 /* initialise the WM8750 spi */ 651 650 652 - s3c2410_gpio_setpin(S3C2410_GPH10, 1); 653 - s3c2410_gpio_cfgpin(S3C2410_GPH10, S3C2410_GPIO_OUTPUT); 651 + s3c2410_gpio_setpin(S3C2410_GPH(10), 1); 652 + s3c2410_gpio_cfgpin(S3C2410_GPH(10), S3C2410_GPIO_OUTPUT); 654 653 655 654 /* Turn off suspend on both USB ports, and switch the 656 655 * selectable USB port to USB device mode. */
+5 -4
arch/arm/mach-s3c2412/mach-smdk2413.c
··· 17 17 #include <linux/list.h> 18 18 #include <linux/timer.h> 19 19 #include <linux/init.h> 20 + #include <linux/gpio.h> 20 21 #include <linux/serial_core.h> 21 22 #include <linux/platform_device.h> 22 23 #include <linux/io.h> ··· 85 84 switch (cmd) 86 85 { 87 86 case S3C2410_UDC_P_ENABLE : 88 - s3c2410_gpio_setpin(S3C2410_GPF2, 1); 87 + s3c2410_gpio_setpin(S3C2410_GPF(2), 1); 89 88 break; 90 89 case S3C2410_UDC_P_DISABLE : 91 - s3c2410_gpio_setpin(S3C2410_GPF2, 0); 90 + s3c2410_gpio_setpin(S3C2410_GPF(2), 0); 92 91 break; 93 92 case S3C2410_UDC_P_RESET : 94 93 break; ··· 135 134 { /* Turn off suspend on both USB ports, and switch the 136 135 * selectable USB port to USB device mode. */ 137 136 138 - s3c2410_gpio_setpin(S3C2410_GPF2, 0); 139 - s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPIO_OUTPUT); 137 + s3c2410_gpio_setpin(S3C2410_GPF(2), 0); 138 + s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); 140 139 141 140 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | 142 141 S3C2410_MISCCR_USBSUSPND0 |
+5
arch/arm/mach-s3c2440/Kconfig
··· 33 33 select PM_SIMTEC if PM 34 34 select HAVE_PATA_PLATFORM 35 35 select S3C24XX_GPIO_EXTRA64 36 + select S3C_DEV_USB_HOST 36 37 help 37 38 Say Y here if you are using the Simtec Electronics ANUBIS 38 39 development system ··· 44 43 select S3C24XX_DCLK 45 44 select PM_SIMTEC if PM 46 45 select S3C24XX_GPIO_EXTRA128 46 + select S3C_DEV_USB_HOST 47 47 help 48 48 Say Y here if you are using the Simtec IM2440D20 module, also 49 49 known as the Osiris. ··· 60 58 bool "SMDK2440" 61 59 select CPU_S3C2440 62 60 select MACH_SMDK 61 + select S3C_DEV_USB_HOST 63 62 help 64 63 Say Y here if you are using the SMDK2440. 65 64 66 65 config MACH_NEXCODER_2440 67 66 bool "NexVision NEXCODER 2440 Light Board" 68 67 select CPU_S3C2440 68 + select S3C_DEV_USB_HOST 69 69 help 70 70 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board 71 71 ··· 80 76 config MACH_AT2440EVB 81 77 bool "Avantech AT2440EVB development board" 82 78 select CPU_S3C2440 79 + select S3C_DEV_USB_HOST 83 80 help 84 81 Say Y here if you are using the AT2440EVB development board 85 82
+3 -1
arch/arm/mach-s3c2440/dma.c
··· 17 17 #include <linux/sysdev.h> 18 18 #include <linux/serial_core.h> 19 19 20 + #include <mach/map.h> 20 21 #include <mach/dma.h> 21 22 22 - #include <plat/dma.h> 23 + #include <plat/dma-plat.h> 23 24 #include <plat/cpu.h> 24 25 25 26 #include <plat/regs-serial.h> 26 27 #include <mach/regs-gpio.h> 27 28 #include <plat/regs-ac97.h> 29 + #include <plat/regs-dma.h> 28 30 #include <mach/regs-mem.h> 29 31 #include <mach/regs-lcd.h> 30 32 #include <mach/regs-sdi.h>
+2 -1
arch/arm/mach-s3c2440/mach-anubis.c
··· 15 15 #include <linux/list.h> 16 16 #include <linux/timer.h> 17 17 #include <linux/init.h> 18 + #include <linux/gpio.h> 18 19 #include <linux/serial_core.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/ata_platform.h> ··· 469 468 anubis_nand_sets[0].nr_partitions = ARRAY_SIZE(anubis_default_nand_part_large); 470 469 } else { 471 470 /* ensure that the GPIO is setup */ 472 - s3c2410_gpio_setpin(S3C2410_GPA0, 1); 471 + s3c2410_gpio_setpin(S3C2410_GPA(0), 1); 473 472 } 474 473 } 475 474
+1 -1
arch/arm/mach-s3c2440/mach-at2440evb.c
··· 166 166 }; 167 167 168 168 static struct s3c24xx_mci_pdata at2440evb_mci_pdata = { 169 - .gpio_detect = S3C2410_GPG10, 169 + .gpio_detect = S3C2410_GPG(10), 170 170 }; 171 171 172 172 /* 7" LCD panel */
+9 -8
arch/arm/mach-s3c2440/mach-nexcoder.c
··· 18 18 #include <linux/list.h> 19 19 #include <linux/timer.h> 20 20 #include <linux/init.h> 21 + #include <linux/gpio.h> 21 22 #include <linux/string.h> 22 23 #include <linux/serial_core.h> 23 24 #include <linux/platform_device.h> ··· 121 120 static void __init nexcoder_sensorboard_init(void) 122 121 { 123 122 // Initialize SCCB bus 124 - s3c2410_gpio_setpin(S3C2410_GPE14, 1); // IICSCL 125 - s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_OUTP); 126 - s3c2410_gpio_setpin(S3C2410_GPE15, 1); // IICSDA 127 - s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_OUTP); 123 + s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL 124 + s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT); 125 + s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA 126 + s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT); 128 127 129 128 // Power up the sensor board 130 - s3c2410_gpio_setpin(S3C2410_GPF1, 1); 131 - s3c2410_gpio_cfgpin(S3C2410_GPF1, S3C2410_GPF1_OUTP); // CAM_GPIO7 => nLDO_PWRDN 132 - s3c2410_gpio_setpin(S3C2410_GPF2, 0); 133 - s3c2410_gpio_cfgpin(S3C2410_GPF2, S3C2410_GPF2_OUTP); // CAM_GPIO6 => CAM_PWRDN 129 + s3c2410_gpio_setpin(S3C2410_GPF(1), 1); 130 + s3c2410_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN 131 + s3c2410_gpio_setpin(S3C2410_GPF(2), 0); 132 + s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN 134 133 } 135 134 136 135 static void __init nexcoder_map_io(void)
+5 -4
arch/arm/mach-s3c2440/mach-osiris.c
··· 15 15 #include <linux/list.h> 16 16 #include <linux/timer.h> 17 17 #include <linux/init.h> 18 + #include <linux/gpio.h> 18 19 #include <linux/device.h> 19 20 #include <linux/sysdev.h> 20 21 #include <linux/serial_core.h> ··· 292 291 __raw_writeb(tmp, OSIRIS_VA_CTRL0); 293 292 294 293 /* ensure that an nRESET is not generated on resume. */ 295 - s3c2410_gpio_setpin(S3C2410_GPA21, 1); 296 - s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT); 294 + s3c2410_gpio_setpin(S3C2410_GPA(21), 1); 295 + s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPIO_OUTPUT); 297 296 298 297 return 0; 299 298 } ··· 305 304 306 305 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); 307 306 308 - s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT); 307 + s3c2410_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); 309 308 310 309 return 0; 311 310 } ··· 385 384 osiris_nand_sets[0].nr_partitions = ARRAY_SIZE(osiris_default_nand_part_large); 386 385 } else { 387 386 /* write-protect line to the NAND */ 388 - s3c2410_gpio_setpin(S3C2410_GPA0, 1); 387 + s3c2410_gpio_setpin(S3C2410_GPA(0), 1); 389 388 } 390 389 391 390 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
+2 -1
arch/arm/mach-s3c2443/dma.c
··· 20 20 21 21 #include <mach/dma.h> 22 22 23 - #include <plat/dma.h> 23 + #include <plat/dma-plat.h> 24 24 #include <plat/cpu.h> 25 25 26 26 #include <plat/regs-serial.h> 27 27 #include <mach/regs-gpio.h> 28 28 #include <plat/regs-ac97.h> 29 + #include <plat/regs-dma.h> 29 30 #include <mach/regs-mem.h> 30 31 #include <mach/regs-lcd.h> 31 32 #include <mach/regs-sdi.h>
+24 -1
arch/arm/mach-s3c6400/Kconfig
··· 5 5 # 6 6 # Licensed under GPLv2 7 7 8 - # Currently nothing here, this will be added later 8 + # Configuration options for the S3C6410 CPU 9 + 10 + config CPU_S3C6400 11 + bool 12 + select CPU_S3C6400_INIT 13 + select CPU_S3C6400_CLOCK 14 + help 15 + Enable S3C6400 CPU support 16 + 17 + config S3C6400_SETUP_SDHCI 18 + bool 19 + help 20 + Internal configuration for default SDHCI 21 + setup for S3C6400. 22 + 23 + # S36400 Macchine support 24 + 25 + config MACH_SMDK6400 26 + bool "SMDK6400" 27 + select CPU_S3C6400 28 + select S3C_DEV_HSMMC 29 + select S3C6400_SETUP_SDHCI 30 + help 31 + Machine support for the Samsung SMDK6400
+9 -1
arch/arm/mach-s3c6400/Makefile
··· 12 12 13 13 # Core support for S3C6400 system 14 14 15 - obj-n += blank.o 15 + obj-$(CONFIG_CPU_S3C6400) += s3c6400.o 16 + 17 + # setup support 18 + 19 + obj-$(CONFIG_S3C6400_SETUP_SDHCI) += setup-sdhci.o 20 + 21 + # Machine support 22 + 23 + obj-$(CONFIG_MACH_SMDK6400) += mach-smdk6400.o
+58 -1
arch/arm/mach-s3c6400/include/mach/dma.h
··· 11 11 #ifndef __ASM_ARCH_DMA_H 12 12 #define __ASM_ARCH_DMA_H __FILE__ 13 13 14 - /* currently nothing here, placeholder */ 14 + #define S3C_DMA_CHANNELS (16) 15 + 16 + /* see mach-s3c2410/dma.h for notes on dma channel numbers */ 17 + 18 + /* Note, for the S3C64XX architecture we keep the DMACH_ 19 + * defines in the order they are allocated to [S]DMA0/[S]DMA1 20 + * so that is easy to do DHACH_ -> DMA controller conversion 21 + */ 22 + enum dma_ch { 23 + /* DMA0/SDMA0 */ 24 + DMACH_UART0 = 0, 25 + DMACH_UART0_SRC2, 26 + DMACH_UART1, 27 + DMACH_UART1_SRC2, 28 + DMACH_UART2, 29 + DMACH_UART2_SRC2, 30 + DMACH_UART3, 31 + DMACH_UART3_SRC2, 32 + DMACH_PCM0_TX, 33 + DMACH_PCM0_RX, 34 + DMACH_I2S0_OUT, 35 + DMACH_I2S0_IN, 36 + DMACH_SPI0_TX, 37 + DMACH_SPI0_RX, 38 + DMACH_HSI_I2SV40_TX, 39 + DMACH_HSI_I2SV40_RX, 40 + 41 + /* DMA1/SDMA1 */ 42 + DMACH_PCM1_TX = 16, 43 + DMACH_PCM1_RX, 44 + DMACH_I2S1_OUT, 45 + DMACH_I2S1_IN, 46 + DMACH_SPI1_TX, 47 + DMACH_SPI1_RX, 48 + DMACH_AC97_PCMOUT, 49 + DMACH_AC97_PCMIN, 50 + DMACH_AC97_MICIN, 51 + DMACH_PWM, 52 + DMACH_IRDA, 53 + DMACH_EXTERNAL, 54 + DMACH_RES1, 55 + DMACH_RES2, 56 + DMACH_SECURITY_RX, /* SDMA1 only */ 57 + DMACH_SECURITY_TX, /* SDMA1 only */ 58 + DMACH_MAX /* the end */ 59 + }; 60 + 61 + static __inline__ int s3c_dma_has_circular(void) 62 + { 63 + /* we will be supporting ciruclar buffers as soon as we have DMA 64 + * engine support. 65 + */ 66 + return 1; 67 + } 68 + 69 + #define S3C2410_DMAF_CIRCULAR (1 << 0) 70 + 71 + #include <plat/dma.h> 15 72 16 73 #endif /* __ASM_ARCH_IRQ_H */
+6
arch/arm/mach-s3c6400/include/mach/map.h
··· 39 39 #define S3C_VA_UART3 S3C_VA_UARTx(3) 40 40 41 41 #define S3C64XX_PA_FB (0x77100000) 42 + #define S3C64XX_PA_USB_HSOTG (0x7C000000) 43 + #define S3C64XX_PA_WATCHDOG (0x7E004000) 42 44 #define S3C64XX_PA_SYSCON (0x7E00F000) 43 45 #define S3C64XX_PA_IIS0 (0x7F002000) 44 46 #define S3C64XX_PA_IIS1 (0x7F003000) ··· 59 57 #define S3C64XX_PA_MODEM (0x74108000) 60 58 #define S3C64XX_VA_MODEM S3C_ADDR(0x00600000) 61 59 60 + #define S3C64XX_PA_USBHOST (0x74300000) 61 + 62 62 /* place VICs close together */ 63 63 #define S3C_VA_VIC0 (S3C_VA_IRQ + 0x00) 64 64 #define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) ··· 73 69 #define S3C_PA_IIC S3C64XX_PA_IIC0 74 70 #define S3C_PA_IIC1 S3C64XX_PA_IIC1 75 71 #define S3C_PA_FB S3C64XX_PA_FB 72 + #define S3C_PA_USBHOST S3C64XX_PA_USBHOST 73 + #define S3C_PA_USB_HSOTG S3C64XX_PA_USB_HSOTG 76 74 77 75 #endif /* __ASM_ARCH_6400_MAP_H */
+16
arch/arm/mach-s3c6400/include/mach/regs-clock.h
··· 1 + /* linux/arch/arm/mach-s3c6400/include/mach/regs-clock.h 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * http://armlinux.simtec.co.uk/ 6 + * Ben Dooks <ben@simtec.co.uk> 7 + * 8 + * S3C64XX - clock register compatibility with s3c24xx 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 + #include <plat/regs-clock.h> 16 +
+7 -1
arch/arm/mach-s3c6400/include/mach/system.h
··· 11 11 #ifndef __ASM_ARCH_SYSTEM_H 12 12 #define __ASM_ARCH_SYSTEM_H __FILE__ 13 13 14 + #include <plat/watchdog-reset.h> 15 + 14 16 static void arch_idle(void) 15 17 { 16 18 /* nothing here yet */ ··· 20 18 21 19 static void arch_reset(char mode, const char *cmd) 22 20 { 23 - /* nothing here yet */ 21 + if (mode != 's') 22 + arch_wdt_reset(); 23 + 24 + /* if all else fails, or mode was for soft, jump to 0 */ 25 + cpu_reset(0); 24 26 } 25 27 26 28 #endif /* __ASM_ARCH_IRQ_H */
+96
arch/arm/mach-s3c6400/mach-smdk6400.c
··· 1 + /* linux/arch/arm/mach-s3c6400/mach-smdk6400.c 2 + * 3 + * Copyright 2008 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * http://armlinux.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 + 12 + #include <linux/kernel.h> 13 + #include <linux/types.h> 14 + #include <linux/interrupt.h> 15 + #include <linux/list.h> 16 + #include <linux/timer.h> 17 + #include <linux/init.h> 18 + #include <linux/serial_core.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/i2c.h> 21 + #include <linux/io.h> 22 + 23 + #include <asm/mach-types.h> 24 + 25 + #include <asm/mach/arch.h> 26 + #include <asm/mach/map.h> 27 + #include <asm/mach/irq.h> 28 + 29 + #include <mach/hardware.h> 30 + #include <mach/map.h> 31 + 32 + #include <plat/regs-serial.h> 33 + 34 + #include <plat/s3c6400.h> 35 + #include <plat/clock.h> 36 + #include <plat/devs.h> 37 + #include <plat/cpu.h> 38 + #include <plat/iic.h> 39 + 40 + #define UCON S3C2410_UCON_DEFAULT | S3C2410_UCON_UCLK 41 + #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB 42 + #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 43 + 44 + static struct s3c2410_uartcfg smdk6400_uartcfgs[] __initdata = { 45 + [0] = { 46 + .hwport = 0, 47 + .flags = 0, 48 + .ucon = 0x3c5, 49 + .ulcon = 0x03, 50 + .ufcon = 0x51, 51 + }, 52 + [1] = { 53 + .hwport = 1, 54 + .flags = 0, 55 + .ucon = 0x3c5, 56 + .ulcon = 0x03, 57 + .ufcon = 0x51, 58 + }, 59 + }; 60 + 61 + static struct map_desc smdk6400_iodesc[] = {}; 62 + 63 + static void __init smdk6400_map_io(void) 64 + { 65 + s3c64xx_init_io(smdk6400_iodesc, ARRAY_SIZE(smdk6400_iodesc)); 66 + s3c24xx_init_clocks(12000000); 67 + s3c24xx_init_uarts(smdk6400_uartcfgs, ARRAY_SIZE(smdk6400_uartcfgs)); 68 + } 69 + 70 + static struct platform_device *smdk6400_devices[] __initdata = { 71 + &s3c_device_hsmmc1, 72 + &s3c_device_i2c0, 73 + }; 74 + 75 + static struct i2c_board_info i2c_devs[] __initdata = { 76 + { I2C_BOARD_INFO("wm8753", 0x1A), }, 77 + { I2C_BOARD_INFO("24c08", 0x50), }, 78 + }; 79 + 80 + static void __init smdk6400_machine_init(void) 81 + { 82 + i2c_register_board_info(0, i2c_devs, ARRAY_SIZE(i2c_devs)); 83 + platform_add_devices(smdk6400_devices, ARRAY_SIZE(smdk6400_devices)); 84 + } 85 + 86 + MACHINE_START(SMDK6400, "SMDK6400") 87 + /* Maintainer: Ben Dooks <ben@fluff.org> */ 88 + .phys_io = S3C_PA_UART & 0xfff00000, 89 + .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, 90 + .boot_params = S3C64XX_PA_SDRAM + 0x100, 91 + 92 + .init_irq = s3c6400_init_irq, 93 + .map_io = smdk6400_map_io, 94 + .init_machine = smdk6400_machine_init, 95 + .timer = &s3c24xx_timer, 96 + MACHINE_END
+89
arch/arm/mach-s3c6400/s3c6400.c
··· 1 + /* linux/arch/arm/mach-s3c6410/cpu.c 2 + * 3 + * Copyright 2009 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * http://armlinux.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 + 12 + #include <linux/kernel.h> 13 + #include <linux/types.h> 14 + #include <linux/interrupt.h> 15 + #include <linux/list.h> 16 + #include <linux/timer.h> 17 + #include <linux/init.h> 18 + #include <linux/clk.h> 19 + #include <linux/io.h> 20 + #include <linux/sysdev.h> 21 + #include <linux/serial_core.h> 22 + #include <linux/platform_device.h> 23 + 24 + #include <asm/mach/arch.h> 25 + #include <asm/mach/map.h> 26 + #include <asm/mach/irq.h> 27 + 28 + #include <mach/hardware.h> 29 + #include <asm/irq.h> 30 + 31 + #include <plat/cpu-freq.h> 32 + #include <plat/regs-serial.h> 33 + #include <plat/regs-clock.h> 34 + 35 + #include <plat/cpu.h> 36 + #include <plat/devs.h> 37 + #include <plat/clock.h> 38 + #include <plat/sdhci.h> 39 + #include <plat/iic-core.h> 40 + #include <plat/s3c6400.h> 41 + 42 + void __init s3c6400_map_io(void) 43 + { 44 + /* setup SDHCI */ 45 + 46 + s3c6400_default_sdhci0(); 47 + s3c6400_default_sdhci1(); 48 + 49 + /* the i2c devices are directly compatible with s3c2440 */ 50 + s3c_i2c0_setname("s3c2440-i2c"); 51 + } 52 + 53 + void __init s3c6400_init_clocks(int xtal) 54 + { 55 + printk(KERN_DEBUG "%s: initialising clocks\n", __func__); 56 + s3c24xx_register_baseclocks(xtal); 57 + s3c64xx_register_clocks(); 58 + s3c6400_register_clocks(S3C6400_CLKDIV0_ARM_MASK); 59 + s3c6400_setup_clocks(); 60 + } 61 + 62 + void __init s3c6400_init_irq(void) 63 + { 64 + /* VIC0 does not have IRQS 5..7, 65 + * VIC1 is fully populated. */ 66 + s3c64xx_init_irq(~0 & ~(0xf << 5), ~0); 67 + } 68 + 69 + struct sysdev_class s3c6400_sysclass = { 70 + .name = "s3c6400-core", 71 + }; 72 + 73 + static struct sys_device s3c6400_sysdev = { 74 + .cls = &s3c6400_sysclass, 75 + }; 76 + 77 + static int __init s3c6400_core_init(void) 78 + { 79 + return sysdev_class_register(&s3c6400_sysclass); 80 + } 81 + 82 + core_initcall(s3c6400_core_init); 83 + 84 + int __init s3c6400_init(void) 85 + { 86 + printk("S3C6400: Initialising architecture\n"); 87 + 88 + return sysdev_register(&s3c6400_sysdev); 89 + }
+63
arch/arm/mach-s3c6400/setup-sdhci.c
··· 1 + /* linux/arch/arm/mach-s3c6410/setup-sdhci.c 2 + * 3 + * Copyright 2008 Simtec Electronics 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC) 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 + #include <linux/kernel.h> 16 + #include <linux/types.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/io.h> 20 + 21 + #include <linux/mmc/card.h> 22 + #include <linux/mmc/host.h> 23 + 24 + #include <plat/regs-sdhci.h> 25 + #include <plat/sdhci.h> 26 + 27 + /* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ 28 + 29 + char *s3c6400_hsmmc_clksrcs[4] = { 30 + [0] = "hsmmc", 31 + [1] = "hsmmc", 32 + [2] = "mmc_bus", 33 + /* [3] = "48m", - note not succesfully used yet */ 34 + }; 35 + 36 + void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, 37 + void __iomem *r, 38 + struct mmc_ios *ios, 39 + struct mmc_card *card) 40 + { 41 + u32 ctrl2, ctrl3; 42 + 43 + ctrl2 = readl(r + S3C_SDHCI_CONTROL2); 44 + ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; 45 + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | 46 + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | 47 + S3C_SDHCI_CTRL2_ENFBCLKRX | 48 + S3C_SDHCI_CTRL2_DFCNT_NONE | 49 + S3C_SDHCI_CTRL2_ENCLKOUTHOLD); 50 + 51 + if (ios->clock < 25 * 1000000) 52 + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 | 53 + S3C_SDHCI_CTRL3_FCSEL2 | 54 + S3C_SDHCI_CTRL3_FCSEL1 | 55 + S3C_SDHCI_CTRL3_FCSEL0); 56 + else 57 + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); 58 + 59 + printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); 60 + writel(ctrl2, r + S3C_SDHCI_CONTROL2); 61 + writel(ctrl3, r + S3C_SDHCI_CONTROL3); 62 + } 63 +
+37
arch/arm/mach-s3c6410/Kconfig
··· 16 16 17 17 config S3C6410_SETUP_SDHCI 18 18 bool 19 + select S3C64XX_SETUP_SDHCI_GPIO 19 20 help 20 21 Internal helper functions for S3C6410 based SDHCI systems 22 + 23 + config MACH_ANW6410 24 + bool "A&W6410" 25 + select CPU_S3C6410 26 + select S3C_DEV_FB 27 + select S3C64XX_SETUP_FB_24BPP 28 + help 29 + Machine support for the A&W6410 21 30 22 31 config MACH_SMDK6410 23 32 bool "SMDK6410" ··· 35 26 select S3C_DEV_HSMMC1 36 27 select S3C_DEV_I2C1 37 28 select S3C_DEV_FB 29 + select S3C_DEV_USB_HOST 30 + select S3C_DEV_USB_HSOTG 38 31 select S3C6410_SETUP_SDHCI 39 32 select S3C64XX_SETUP_I2C1 40 33 select S3C64XX_SETUP_FB_24BPP ··· 71 60 channels 0 and 1 are the same. 72 61 73 62 endchoice 63 + 64 + config SMDK6410_WM1190_EV1 65 + bool "Support Wolfson Microelectronics 1190-EV1 PMIC card" 66 + depends on MACH_SMDK6410 67 + select REGULATOR 68 + select REGULATOR_WM8350 69 + select MFD_WM8350_I2C 70 + select MFD_WM8350_CONFIG_MODE_0 71 + select MFD_WM8350_CONFIG_MODE_3 72 + select MFD_WM8352_CONFIG_MODE_0 73 + help 74 + The Wolfson Microelectronics 1190-EV1 is a WM835x based PMIC 75 + and audio daughtercard for the Samsung SMDK6410 reference 76 + platform. Enabling this option will build support for this 77 + module into the kernel. The presence of the module will be 78 + detected at runtime so the the resulting kernel can be used 79 + with or without the 1190-EV1 fitted. 80 + 81 + config MACH_NCP 82 + bool "NCP" 83 + select CPU_S3C6410 84 + select S3C_DEV_I2C1 85 + select S3C_DEV_HSMMC1 86 + select S3C64XX_SETUP_I2C1 87 + help 88 + Machine support for the Samsung NCP
+4
arch/arm/mach-s3c6410/Makefile
··· 20 20 21 21 # machine support 22 22 23 + obj-$(CONFIG_MACH_ANW6410) += mach-anw6410.o 23 24 obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o 25 + obj-$(CONFIG_MACH_NCP) += mach-ncp.o 26 + 27 +
+2 -1
arch/arm/mach-s3c6410/cpu.c
··· 31 31 32 32 #include <plat/cpu-freq.h> 33 33 #include <plat/regs-serial.h> 34 + #include <plat/regs-clock.h> 34 35 35 36 #include <plat/cpu.h> 36 37 #include <plat/devs.h> ··· 69 68 printk(KERN_DEBUG "%s: initialising clocks\n", __func__); 70 69 s3c24xx_register_baseclocks(xtal); 71 70 s3c64xx_register_clocks(); 72 - s3c6400_register_clocks(); 71 + s3c6400_register_clocks(S3C6410_CLKDIV0_ARM_MASK); 73 72 s3c6400_setup_clocks(); 74 73 } 75 74
+245
arch/arm/mach-s3c6410/mach-anw6410.c
··· 1 + /* linux/arch/arm/mach-s3c6410/mach-anw6410.c 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * Copyright 2009 Kwangwoo Lee 8 + * Kwangwoo Lee <kwangwoo.lee@gmail.com> 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 + 16 + #include <linux/kernel.h> 17 + #include <linux/types.h> 18 + #include <linux/interrupt.h> 19 + #include <linux/list.h> 20 + #include <linux/timer.h> 21 + #include <linux/init.h> 22 + #include <linux/serial_core.h> 23 + #include <linux/platform_device.h> 24 + #include <linux/io.h> 25 + #include <linux/i2c.h> 26 + #include <linux/fb.h> 27 + #include <linux/gpio.h> 28 + #include <linux/delay.h> 29 + #include <linux/dm9000.h> 30 + 31 + #include <video/platform_lcd.h> 32 + 33 + #include <asm/mach/arch.h> 34 + #include <asm/mach/map.h> 35 + #include <asm/mach/irq.h> 36 + 37 + #include <mach/hardware.h> 38 + #include <mach/regs-fb.h> 39 + #include <mach/map.h> 40 + 41 + #include <asm/irq.h> 42 + #include <asm/mach-types.h> 43 + 44 + #include <plat/regs-serial.h> 45 + #include <plat/iic.h> 46 + #include <plat/fb.h> 47 + 48 + #include <plat/s3c6410.h> 49 + #include <plat/clock.h> 50 + #include <plat/devs.h> 51 + #include <plat/cpu.h> 52 + #include <plat/regs-gpio.h> 53 + #include <plat/regs-modem.h> 54 + 55 + /* DM9000 */ 56 + #define ANW6410_PA_DM9000 (0x18000000) 57 + 58 + /* A hardware buffer to control external devices is mapped at 0x30000000. 59 + * It can not be read. So current status must be kept in anw6410_extdev_status. 60 + */ 61 + #define ANW6410_VA_EXTDEV S3C_ADDR(0x02000000) 62 + #define ANW6410_PA_EXTDEV (0x30000000) 63 + 64 + #define ANW6410_EN_DM9000 (1<<11) 65 + #define ANW6410_EN_LCD (1<<14) 66 + 67 + static __u32 anw6410_extdev_status; 68 + 69 + static struct s3c2410_uartcfg anw6410_uartcfgs[] __initdata = { 70 + [0] = { 71 + .hwport = 0, 72 + .flags = 0, 73 + .ucon = 0x3c5, 74 + .ulcon = 0x03, 75 + .ufcon = 0x51, 76 + }, 77 + [1] = { 78 + .hwport = 1, 79 + .flags = 0, 80 + .ucon = 0x3c5, 81 + .ulcon = 0x03, 82 + .ufcon = 0x51, 83 + }, 84 + }; 85 + 86 + /* framebuffer and LCD setup. */ 87 + static void __init anw6410_lcd_mode_set(void) 88 + { 89 + u32 tmp; 90 + 91 + /* set the LCD type */ 92 + tmp = __raw_readl(S3C64XX_SPCON); 93 + tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK; 94 + tmp |= S3C64XX_SPCON_LCD_SEL_RGB; 95 + __raw_writel(tmp, S3C64XX_SPCON); 96 + 97 + /* remove the LCD bypass */ 98 + tmp = __raw_readl(S3C64XX_MODEM_MIFPCON); 99 + tmp &= ~MIFPCON_LCD_BYPASS; 100 + __raw_writel(tmp, S3C64XX_MODEM_MIFPCON); 101 + } 102 + 103 + /* GPF1 = LCD panel power 104 + * GPF4 = LCD backlight control 105 + */ 106 + static void anw6410_lcd_power_set(struct plat_lcd_data *pd, 107 + unsigned int power) 108 + { 109 + if (power) { 110 + anw6410_extdev_status |= (ANW6410_EN_LCD << 16); 111 + __raw_writel(anw6410_extdev_status, ANW6410_VA_EXTDEV); 112 + 113 + gpio_direction_output(S3C64XX_GPF(1), 1); 114 + gpio_direction_output(S3C64XX_GPF(4), 1); 115 + } else { 116 + anw6410_extdev_status &= ~(ANW6410_EN_LCD << 16); 117 + __raw_writel(anw6410_extdev_status, ANW6410_VA_EXTDEV); 118 + 119 + gpio_direction_output(S3C64XX_GPF(1), 0); 120 + gpio_direction_output(S3C64XX_GPF(4), 0); 121 + } 122 + } 123 + 124 + static struct plat_lcd_data anw6410_lcd_power_data = { 125 + .set_power = anw6410_lcd_power_set, 126 + }; 127 + 128 + static struct platform_device anw6410_lcd_powerdev = { 129 + .name = "platform-lcd", 130 + .dev.parent = &s3c_device_fb.dev, 131 + .dev.platform_data = &anw6410_lcd_power_data, 132 + }; 133 + 134 + static struct s3c_fb_pd_win anw6410_fb_win0 = { 135 + /* this is to ensure we use win0 */ 136 + .win_mode = { 137 + .pixclock = 41094, 138 + .left_margin = 8, 139 + .right_margin = 13, 140 + .upper_margin = 7, 141 + .lower_margin = 5, 142 + .hsync_len = 3, 143 + .vsync_len = 1, 144 + .xres = 800, 145 + .yres = 480, 146 + }, 147 + .max_bpp = 32, 148 + .default_bpp = 16, 149 + }; 150 + 151 + /* 405566 clocks per frame => 60Hz refresh requires 24333960Hz clock */ 152 + static struct s3c_fb_platdata anw6410_lcd_pdata __initdata = { 153 + .setup_gpio = s3c64xx_fb_gpio_setup_24bpp, 154 + .win[0] = &anw6410_fb_win0, 155 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 156 + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 157 + }; 158 + 159 + /* DM9000AEP 10/100 ethernet controller */ 160 + static void __init anw6410_dm9000_enable(void) 161 + { 162 + anw6410_extdev_status |= (ANW6410_EN_DM9000 << 16); 163 + __raw_writel(anw6410_extdev_status, ANW6410_VA_EXTDEV); 164 + } 165 + 166 + static struct resource anw6410_dm9000_resource[] = { 167 + [0] = { 168 + .start = ANW6410_PA_DM9000, 169 + .end = ANW6410_PA_DM9000 + 3, 170 + .flags = IORESOURCE_MEM, 171 + }, 172 + [1] = { 173 + .start = ANW6410_PA_DM9000 + 4, 174 + .end = ANW6410_PA_DM9000 + 4 + 500, 175 + .flags = IORESOURCE_MEM, 176 + }, 177 + [2] = { 178 + .start = IRQ_EINT(15), 179 + .end = IRQ_EINT(15), 180 + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, 181 + }, 182 + }; 183 + 184 + static struct dm9000_plat_data anw6410_dm9000_pdata = { 185 + .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), 186 + /* dev_addr can be set to provide hwaddr. */ 187 + }; 188 + 189 + static struct platform_device anw6410_device_eth = { 190 + .name = "dm9000", 191 + .id = -1, 192 + .num_resources = ARRAY_SIZE(anw6410_dm9000_resource), 193 + .resource = anw6410_dm9000_resource, 194 + .dev = { 195 + .platform_data = &anw6410_dm9000_pdata, 196 + }, 197 + }; 198 + 199 + static struct map_desc anw6410_iodesc[] __initdata = { 200 + { 201 + .virtual = (unsigned long)ANW6410_VA_EXTDEV, 202 + .pfn = __phys_to_pfn(ANW6410_PA_EXTDEV), 203 + .length = SZ_64K, 204 + .type = MT_DEVICE, 205 + }, 206 + }; 207 + 208 + static struct platform_device *anw6410_devices[] __initdata = { 209 + &s3c_device_fb, 210 + &anw6410_lcd_powerdev, 211 + &anw6410_device_eth, 212 + }; 213 + 214 + static void __init anw6410_map_io(void) 215 + { 216 + s3c64xx_init_io(anw6410_iodesc, ARRAY_SIZE(anw6410_iodesc)); 217 + s3c24xx_init_clocks(12000000); 218 + s3c24xx_init_uarts(anw6410_uartcfgs, ARRAY_SIZE(anw6410_uartcfgs)); 219 + 220 + anw6410_lcd_mode_set(); 221 + } 222 + 223 + static void __init anw6410_machine_init(void) 224 + { 225 + s3c_fb_set_platdata(&anw6410_lcd_pdata); 226 + 227 + gpio_request(S3C64XX_GPF(1), "panel power"); 228 + gpio_request(S3C64XX_GPF(4), "LCD backlight"); 229 + 230 + anw6410_dm9000_enable(); 231 + 232 + platform_add_devices(anw6410_devices, ARRAY_SIZE(anw6410_devices)); 233 + } 234 + 235 + MACHINE_START(ANW6410, "A&W6410") 236 + /* Maintainer: Kwangwoo Lee <kwangwoo.lee@gmail.com> */ 237 + .phys_io = S3C_PA_UART & 0xfff00000, 238 + .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, 239 + .boot_params = S3C64XX_PA_SDRAM + 0x100, 240 + 241 + .init_irq = s3c6410_init_irq, 242 + .map_io = anw6410_map_io, 243 + .init_machine = anw6410_machine_init, 244 + .timer = &s3c24xx_timer, 245 + MACHINE_END
+107
arch/arm/mach-s3c6410/mach-ncp.c
··· 1 + /* 2 + * linux/arch/arm/mach-s3c6410/mach-ncp.c 3 + * 4 + * Copyright (C) 2008-2009 Samsung Electronics 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 + 12 + #include <linux/kernel.h> 13 + #include <linux/types.h> 14 + #include <linux/interrupt.h> 15 + #include <linux/list.h> 16 + #include <linux/timer.h> 17 + #include <linux/init.h> 18 + #include <linux/serial_core.h> 19 + #include <linux/platform_device.h> 20 + #include <linux/io.h> 21 + #include <linux/i2c.h> 22 + #include <linux/fb.h> 23 + #include <linux/gpio.h> 24 + #include <linux/delay.h> 25 + 26 + #include <video/platform_lcd.h> 27 + 28 + #include <asm/mach/arch.h> 29 + #include <asm/mach/map.h> 30 + #include <asm/mach/irq.h> 31 + 32 + #include <mach/hardware.h> 33 + #include <mach/regs-fb.h> 34 + #include <mach/map.h> 35 + 36 + #include <asm/irq.h> 37 + #include <asm/mach-types.h> 38 + 39 + #include <plat/regs-serial.h> 40 + #include <plat/iic.h> 41 + #include <plat/fb.h> 42 + 43 + #include <plat/s3c6410.h> 44 + #include <plat/clock.h> 45 + #include <plat/devs.h> 46 + #include <plat/cpu.h> 47 + 48 + #define UCON S3C2410_UCON_DEFAULT 49 + #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE 50 + #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE 51 + 52 + static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = { 53 + /* REVISIT: NCP uses only serial 1, 2 */ 54 + [0] = { 55 + .hwport = 0, 56 + .flags = 0, 57 + .ucon = UCON, 58 + .ulcon = ULCON, 59 + .ufcon = UFCON, 60 + }, 61 + [1] = { 62 + .hwport = 1, 63 + .flags = 0, 64 + .ucon = UCON, 65 + .ulcon = ULCON, 66 + .ufcon = UFCON, 67 + }, 68 + [2] = { 69 + .hwport = 2, 70 + .flags = 0, 71 + .ucon = UCON, 72 + .ulcon = ULCON, 73 + .ufcon = UFCON, 74 + }, 75 + }; 76 + 77 + static struct platform_device *ncp_devices[] __initdata = { 78 + &s3c_device_hsmmc1, 79 + &s3c_device_i2c0, 80 + }; 81 + 82 + struct map_desc ncp_iodesc[] = {}; 83 + 84 + static void __init ncp_map_io(void) 85 + { 86 + s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc)); 87 + s3c24xx_init_clocks(12000000); 88 + s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs)); 89 + } 90 + 91 + static void __init ncp_machine_init(void) 92 + { 93 + s3c_i2c0_set_platdata(NULL); 94 + 95 + platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices)); 96 + } 97 + 98 + MACHINE_START(NCP, "NCP") 99 + /* Maintainer: Samsung Electronics */ 100 + .phys_io = S3C_PA_UART & 0xfff00000, 101 + .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc, 102 + .boot_params = S3C64XX_PA_SDRAM + 0x100, 103 + .init_irq = s3c6410_init_irq, 104 + .map_io = ncp_map_io, 105 + .init_machine = ncp_machine_init, 106 + .timer = &s3c24xx_timer, 107 + MACHINE_END
+198
arch/arm/mach-s3c6410/mach-smdk6410.c
··· 24 24 #include <linux/fb.h> 25 25 #include <linux/gpio.h> 26 26 #include <linux/delay.h> 27 + #include <linux/smsc911x.h> 28 + 29 + #ifdef CONFIG_SMDK6410_WM1190_EV1 30 + #include <linux/mfd/wm8350/core.h> 31 + #include <linux/mfd/wm8350/pmic.h> 32 + #endif 27 33 28 34 #include <video/platform_lcd.h> 29 35 ··· 45 39 #include <asm/mach-types.h> 46 40 47 41 #include <plat/regs-serial.h> 42 + #include <plat/regs-modem.h> 43 + #include <plat/regs-gpio.h> 44 + #include <plat/regs-sys.h> 48 45 #include <plat/iic.h> 49 46 #include <plat/fb.h> 47 + #include <plat/gpio-cfg.h> 50 48 51 49 #include <plat/s3c6410.h> 52 50 #include <plat/clock.h> ··· 139 129 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 140 130 }; 141 131 132 + static struct resource smdk6410_smsc911x_resources[] = { 133 + [0] = { 134 + .start = 0x18000000, 135 + .end = 0x18000000 + SZ_64K - 1, 136 + .flags = IORESOURCE_MEM, 137 + }, 138 + [1] = { 139 + .start = S3C_EINT(10), 140 + .end = S3C_EINT(10), 141 + .flags = IORESOURCE_IRQ | IRQ_TYPE_LEVEL_LOW, 142 + }, 143 + }; 144 + 145 + static struct smsc911x_platform_config smdk6410_smsc911x_pdata = { 146 + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 147 + .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN, 148 + .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY, 149 + .phy_interface = PHY_INTERFACE_MODE_MII, 150 + }; 151 + 152 + 153 + static struct platform_device smdk6410_smsc911x = { 154 + .name = "smsc911x", 155 + .id = -1, 156 + .num_resources = ARRAY_SIZE(smdk6410_smsc911x_resources), 157 + .resource = &smdk6410_smsc911x_resources[0], 158 + .dev = { 159 + .platform_data = &smdk6410_smsc911x_pdata, 160 + }, 161 + }; 162 + 142 163 static struct map_desc smdk6410_iodesc[] = {}; 143 164 144 165 static struct platform_device *smdk6410_devices[] __initdata = { ··· 182 141 &s3c_device_i2c0, 183 142 &s3c_device_i2c1, 184 143 &s3c_device_fb, 144 + &s3c_device_usb, 145 + &s3c_device_usb_hsotg, 185 146 &smdk6410_lcd_powerdev, 147 + 148 + &smdk6410_smsc911x, 186 149 }; 150 + 151 + #ifdef CONFIG_SMDK6410_WM1190_EV1 152 + /* S3C64xx internal logic & PLL */ 153 + static struct regulator_init_data wm8350_dcdc1_data = { 154 + .constraints = { 155 + .name = "PVDD_INT/PVDD_PLL", 156 + .min_uV = 1200000, 157 + .max_uV = 1200000, 158 + .always_on = 1, 159 + .apply_uV = 1, 160 + }, 161 + }; 162 + 163 + /* Memory */ 164 + static struct regulator_init_data wm8350_dcdc3_data = { 165 + .constraints = { 166 + .name = "PVDD_MEM", 167 + .min_uV = 1800000, 168 + .max_uV = 1800000, 169 + .always_on = 1, 170 + .state_mem = { 171 + .uV = 1800000, 172 + .mode = REGULATOR_MODE_NORMAL, 173 + .enabled = 1, 174 + }, 175 + .initial_state = PM_SUSPEND_MEM, 176 + }, 177 + }; 178 + 179 + /* USB, EXT, PCM, ADC/DAC, USB, MMC */ 180 + static struct regulator_init_data wm8350_dcdc4_data = { 181 + .constraints = { 182 + .name = "PVDD_HI/PVDD_EXT/PVDD_SYS/PVCCM2MTV", 183 + .min_uV = 3000000, 184 + .max_uV = 3000000, 185 + .always_on = 1, 186 + }, 187 + }; 188 + 189 + /* ARM core */ 190 + static struct regulator_consumer_supply dcdc6_consumers[] = { 191 + { 192 + .supply = "vddarm", 193 + } 194 + }; 195 + 196 + static struct regulator_init_data wm8350_dcdc6_data = { 197 + .constraints = { 198 + .name = "PVDD_ARM", 199 + .min_uV = 1000000, 200 + .max_uV = 1300000, 201 + .always_on = 1, 202 + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, 203 + }, 204 + .num_consumer_supplies = ARRAY_SIZE(dcdc6_consumers), 205 + .consumer_supplies = dcdc6_consumers, 206 + }; 207 + 208 + /* Alive */ 209 + static struct regulator_init_data wm8350_ldo1_data = { 210 + .constraints = { 211 + .name = "PVDD_ALIVE", 212 + .min_uV = 1200000, 213 + .max_uV = 1200000, 214 + .always_on = 1, 215 + .apply_uV = 1, 216 + }, 217 + }; 218 + 219 + /* OTG */ 220 + static struct regulator_init_data wm8350_ldo2_data = { 221 + .constraints = { 222 + .name = "PVDD_OTG", 223 + .min_uV = 3300000, 224 + .max_uV = 3300000, 225 + .always_on = 1, 226 + }, 227 + }; 228 + 229 + /* LCD */ 230 + static struct regulator_init_data wm8350_ldo3_data = { 231 + .constraints = { 232 + .name = "PVDD_LCD", 233 + .min_uV = 3000000, 234 + .max_uV = 3000000, 235 + .always_on = 1, 236 + }, 237 + }; 238 + 239 + /* OTGi/1190-EV1 HPVDD & AVDD */ 240 + static struct regulator_init_data wm8350_ldo4_data = { 241 + .constraints = { 242 + .name = "PVDD_OTGI/HPVDD/AVDD", 243 + .min_uV = 1200000, 244 + .max_uV = 1200000, 245 + .apply_uV = 1, 246 + .always_on = 1, 247 + }, 248 + }; 249 + 250 + static struct { 251 + int regulator; 252 + struct regulator_init_data *initdata; 253 + } wm1190_regulators[] = { 254 + { WM8350_DCDC_1, &wm8350_dcdc1_data }, 255 + { WM8350_DCDC_3, &wm8350_dcdc3_data }, 256 + { WM8350_DCDC_4, &wm8350_dcdc4_data }, 257 + { WM8350_DCDC_6, &wm8350_dcdc6_data }, 258 + { WM8350_LDO_1, &wm8350_ldo1_data }, 259 + { WM8350_LDO_2, &wm8350_ldo2_data }, 260 + { WM8350_LDO_3, &wm8350_ldo3_data }, 261 + { WM8350_LDO_4, &wm8350_ldo4_data }, 262 + }; 263 + 264 + static int __init smdk6410_wm8350_init(struct wm8350 *wm8350) 265 + { 266 + int i; 267 + 268 + /* Instantiate the regulators */ 269 + for (i = 0; i < ARRAY_SIZE(wm1190_regulators); i++) 270 + wm8350_register_regulator(wm8350, 271 + wm1190_regulators[i].regulator, 272 + wm1190_regulators[i].initdata); 273 + 274 + return 0; 275 + } 276 + 277 + static struct wm8350_platform_data __initdata smdk6410_wm8350_pdata = { 278 + .init = smdk6410_wm8350_init, 279 + .irq_high = 1, 280 + }; 281 + #endif 187 282 188 283 static struct i2c_board_info i2c_devs0[] __initdata = { 189 284 { I2C_BOARD_INFO("24c08", 0x50), }, 190 285 { I2C_BOARD_INFO("wm8580", 0x1b), }, 286 + 287 + #ifdef CONFIG_SMDK6410_WM1190_EV1 288 + { I2C_BOARD_INFO("wm8350", 0x1a), 289 + .platform_data = &smdk6410_wm8350_pdata, 290 + .irq = S3C_EINT(12), 291 + }, 292 + #endif 191 293 }; 192 294 193 295 static struct i2c_board_info i2c_devs1[] __initdata = { ··· 339 155 340 156 static void __init smdk6410_map_io(void) 341 157 { 158 + u32 tmp; 159 + 342 160 s3c64xx_init_io(smdk6410_iodesc, ARRAY_SIZE(smdk6410_iodesc)); 343 161 s3c24xx_init_clocks(12000000); 344 162 s3c24xx_init_uarts(smdk6410_uartcfgs, ARRAY_SIZE(smdk6410_uartcfgs)); 163 + 164 + /* set the LCD type */ 165 + 166 + tmp = __raw_readl(S3C64XX_SPCON); 167 + tmp &= ~S3C64XX_SPCON_LCD_SEL_MASK; 168 + tmp |= S3C64XX_SPCON_LCD_SEL_RGB; 169 + __raw_writel(tmp, S3C64XX_SPCON); 170 + 171 + /* remove the lcd bypass */ 172 + tmp = __raw_readl(S3C64XX_MODEM_MIFPCON); 173 + tmp &= ~MIFPCON_LCD_BYPASS; 174 + __raw_writel(tmp, S3C64XX_MODEM_MIFPCON); 345 175 } 346 176 347 177 static void __init smdk6410_machine_init(void)
-34
arch/arm/mach-s3c6410/setup-sdhci.c
··· 21 21 #include <linux/mmc/card.h> 22 22 #include <linux/mmc/host.h> 23 23 24 - #include <mach/gpio.h> 25 - #include <plat/gpio-cfg.h> 26 24 #include <plat/regs-sdhci.h> 27 25 #include <plat/sdhci.h> 28 26 ··· 33 35 /* [3] = "48m", - note not succesfully used yet */ 34 36 }; 35 37 36 - void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) 37 - { 38 - unsigned int gpio; 39 - unsigned int end; 40 - 41 - end = S3C64XX_GPG(2 + width); 42 - 43 - /* Set all the necessary GPG pins to special-function 0 */ 44 - for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) { 45 - s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 46 - s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 47 - } 48 - 49 - s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); 50 - s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2)); 51 - } 52 38 53 39 void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, 54 40 void __iomem *r, ··· 66 84 writel(ctrl3, r + S3C_SDHCI_CONTROL3); 67 85 } 68 86 69 - void s3c6410_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) 70 - { 71 - unsigned int gpio; 72 - unsigned int end; 73 - 74 - end = S3C64XX_GPH(2 + width); 75 - 76 - /* Set all the necessary GPG pins to special-function 0 */ 77 - for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) { 78 - s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 79 - s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 80 - } 81 - 82 - s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); 83 - s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3)); 84 - }
+1 -1
arch/arm/mach-versatile/core.c
··· 116 116 { 117 117 unsigned int i; 118 118 119 - vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0); 119 + vic_init(VA_VIC_BASE, IRQ_VIC_START, ~0, 0); 120 120 121 121 set_irq_chained_handler(IRQ_VICSOURCE31, sic_handle_irq); 122 122
+26
arch/arm/plat-s3c/Kconfig
··· 71 71 Resume code. See <file:Documentation/arm/Samsung-S3C24XX/Suspend.txt> 72 72 for more information. 73 73 74 + config S3C_PM_DEBUG_LED_SMDK 75 + bool "SMDK LED suspend/resume debugging" 76 + depends on PM && (MACH_SMDK6410) 77 + help 78 + Say Y here to enable the use of the SMDK LEDs on the baseboard 79 + for debugging of the state of the suspend and resume process. 80 + 81 + Note, this currently only works for S3C64XX based SMDK boards. 82 + 74 83 config S3C2410_PM_CHECK 75 84 bool "S3C2410 PM Suspend Memory CRC" 76 85 depends on PM && CRC32 ··· 159 150 Internal configuration to enable S3C64XX style GPIO configuration 160 151 functions. 161 152 153 + # DMA 154 + 155 + config S3C_DMA 156 + bool 157 + help 158 + Internal configuration for S3C DMA core 159 + 162 160 # device definitions to compile in 163 161 164 162 config S3C_DEV_HSMMC ··· 187 171 bool 188 172 help 189 173 Compile in platform device definition for framebuffer 174 + 175 + config S3C_DEV_USB_HOST 176 + bool 177 + help 178 + Compile in platform device definition for USB host. 179 + 180 + config S3C_DEV_USB_HSOTG 181 + bool 182 + help 183 + Compile in platform device definition for USB high-speed OtG 190 184 191 185 endif
+7
arch/arm/plat-s3c/Makefile
··· 18 18 obj-y += gpio.o 19 19 obj-y += gpio-config.o 20 20 21 + # DMA support 22 + 23 + obj-$(CONFIG_S3C_DMA) += dma.o 24 + 21 25 # PM support 22 26 23 27 obj-$(CONFIG_PM) += pm.o 28 + obj-$(CONFIG_PM) += pm-gpio.o 24 29 obj-$(CONFIG_S3C2410_PM_CHECK) += pm-check.o 25 30 26 31 # devices ··· 35 30 obj-y += dev-i2c0.o 36 31 obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o 37 32 obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o 33 + obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o 34 + obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
+41
arch/arm/plat-s3c/dev-usb-hsotg.c
··· 1 + /* linux/arch/arm/plat-s3c/dev-usb-hsotg.c 2 + * 3 + * Copyright 2008 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * http://armlinux.simtec.co.uk/ 6 + * 7 + * S3C series device definition for USB high-speed UDC/OtG block 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 <linux/kernel.h> 15 + #include <linux/string.h> 16 + #include <linux/platform_device.h> 17 + 18 + #include <mach/irqs.h> 19 + #include <mach/map.h> 20 + 21 + #include <plat/devs.h> 22 + 23 + static struct resource s3c_usb_hsotg_resources[] = { 24 + [0] = { 25 + .start = S3C_PA_USB_HSOTG, 26 + .end = S3C_PA_USB_HSOTG + 0x10000 - 1, 27 + .flags = IORESOURCE_MEM, 28 + }, 29 + [1] = { 30 + .start = IRQ_OTG, 31 + .end = IRQ_OTG, 32 + .flags = IORESOURCE_IRQ, 33 + }, 34 + }; 35 + 36 + struct platform_device s3c_device_usb_hsotg = { 37 + .name = "s3c-hsotg", 38 + .id = -1, 39 + .num_resources = ARRAY_SIZE(s3c_usb_hsotg_resources), 40 + .resource = s3c_usb_hsotg_resources, 41 + };
+50
arch/arm/plat-s3c/dev-usb.c
··· 1 + /* linux/arch/arm/plat-s3c/dev-usb.c 2 + * 3 + * Copyright 2008 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * http://armlinux.simtec.co.uk/ 6 + * 7 + * S3C series device definition for USB host 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 <linux/kernel.h> 15 + #include <linux/string.h> 16 + #include <linux/platform_device.h> 17 + 18 + #include <mach/irqs.h> 19 + #include <mach/map.h> 20 + 21 + #include <plat/devs.h> 22 + 23 + 24 + static struct resource s3c_usb_resource[] = { 25 + [0] = { 26 + .start = S3C_PA_USBHOST, 27 + .end = S3C_PA_USBHOST + 0x100 - 1, 28 + .flags = IORESOURCE_MEM, 29 + }, 30 + [1] = { 31 + .start = IRQ_USBH, 32 + .end = IRQ_USBH, 33 + .flags = IORESOURCE_IRQ, 34 + } 35 + }; 36 + 37 + static u64 s3c_device_usb_dmamask = 0xffffffffUL; 38 + 39 + struct platform_device s3c_device_usb = { 40 + .name = "s3c2410-ohci", 41 + .id = -1, 42 + .num_resources = ARRAY_SIZE(s3c_usb_resource), 43 + .resource = s3c_usb_resource, 44 + .dev = { 45 + .dma_mask = &s3c_device_usb_dmamask, 46 + .coherent_dma_mask = 0xffffffffUL 47 + } 48 + }; 49 + 50 + EXPORT_SYMBOL(s3c_device_usb);
+86
arch/arm/plat-s3c/dma.c
··· 1 + /* linux/arch/arm/plat-s3c/dma.c 2 + * 3 + * Copyright (c) 2003-2005,2006,2009 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * http://armlinux.simtec.co.uk/ 6 + * 7 + * S3C DMA core 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 + struct s3c2410_dma_buf; 15 + 16 + #include <linux/kernel.h> 17 + #include <linux/module.h> 18 + #include <linux/errno.h> 19 + 20 + #include <mach/dma.h> 21 + #include <mach/irqs.h> 22 + 23 + #include <plat/dma-plat.h> 24 + 25 + /* dma channel state information */ 26 + struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; 27 + struct s3c2410_dma_chan *s3c_dma_chan_map[DMACH_MAX]; 28 + 29 + /* s3c_dma_lookup_channel 30 + * 31 + * change the dma channel number given into a real dma channel id 32 + */ 33 + 34 + struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel) 35 + { 36 + if (channel & DMACH_LOW_LEVEL) 37 + return &s3c2410_chans[channel & ~DMACH_LOW_LEVEL]; 38 + else 39 + return s3c_dma_chan_map[channel]; 40 + } 41 + 42 + /* do we need to protect the settings of the fields from 43 + * irq? 44 + */ 45 + 46 + int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn) 47 + { 48 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 49 + 50 + if (chan == NULL) 51 + return -EINVAL; 52 + 53 + pr_debug("%s: chan=%p, op rtn=%p\n", __func__, chan, rtn); 54 + 55 + chan->op_fn = rtn; 56 + 57 + return 0; 58 + } 59 + EXPORT_SYMBOL(s3c2410_dma_set_opfn); 60 + 61 + int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn) 62 + { 63 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 64 + 65 + if (chan == NULL) 66 + return -EINVAL; 67 + 68 + pr_debug("%s: chan=%p, callback rtn=%p\n", __func__, chan, rtn); 69 + 70 + chan->callback_fn = rtn; 71 + 72 + return 0; 73 + } 74 + EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); 75 + 76 + int s3c2410_dma_setflags(unsigned int channel, unsigned int flags) 77 + { 78 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 79 + 80 + if (chan == NULL) 81 + return -EINVAL; 82 + 83 + chan->flags = flags; 84 + return 0; 85 + } 86 + EXPORT_SYMBOL(s3c2410_dma_setflags);
+10 -1
arch/arm/plat-s3c/gpio.c
··· 16 16 #include <linux/io.h> 17 17 #include <linux/gpio.h> 18 18 19 - #include <plat/gpio-core.h> 19 + #include <mach/gpio-core.h> 20 20 21 21 #ifdef CONFIG_S3C_GPIO_TRACK 22 22 struct s3c_gpio_chip *s3c_gpios[S3C_GPIO_END]; ··· 139 139 gc->set = s3c_gpiolib_set; 140 140 if (!gc->get) 141 141 gc->get = s3c_gpiolib_get; 142 + 143 + #ifdef CONFIG_PM 144 + if (chip->pm != NULL) { 145 + if (!chip->pm->save || !chip->pm->resume) 146 + printk(KERN_ERR "gpio: %s has missing PM functions\n", 147 + gc->label); 148 + } else 149 + printk(KERN_ERR "gpio: %s has no PM function\n", gc->label); 150 + #endif 142 151 143 152 /* gpiochip_add() prints own failure message on error. */ 144 153 ret = gpiochip_add(gc);
+6 -4
arch/arm/plat-s3c/include/plat/adc.h
··· 19 19 extern int s3c_adc_start(struct s3c_adc_client *client, 20 20 unsigned int channel, unsigned int nr_samples); 21 21 22 - extern struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, 23 - void (*select)(unsigned selected), 24 - void (*conv)(unsigned d0, unsigned d1), 25 - unsigned int is_ts); 22 + extern struct s3c_adc_client * 23 + s3c_adc_register(struct platform_device *pdev, 24 + void (*select)(unsigned selected), 25 + void (*conv)(unsigned d0, unsigned d1, 26 + unsigned *samples_left), 27 + unsigned int is_ts); 26 28 27 29 extern void s3c_adc_release(struct s3c_adc_client *client); 28 30
+1
arch/arm/plat-s3c/include/plat/clock.h
··· 50 50 extern struct clk clk_ext; 51 51 52 52 /* S3C64XX specific clocks */ 53 + extern struct clk clk_h2; 53 54 extern struct clk clk_27m; 54 55 extern struct clk clk_48m; 55 56
+3
arch/arm/plat-s3c/include/plat/cpu.h
··· 69 69 extern struct sysdev_class s3c2440_sysclass; 70 70 extern struct sysdev_class s3c2442_sysclass; 71 71 extern struct sysdev_class s3c2443_sysclass; 72 + extern struct sysdev_class s3c6410_sysclass; 73 + extern struct sysdev_class s3c64xx_sysclass; 74 +
+1
arch/arm/plat-s3c/include/plat/devs.h
··· 45 45 extern struct platform_device s3c_device_nand; 46 46 47 47 extern struct platform_device s3c_device_usbgadget; 48 + extern struct platform_device s3c_device_usb_hsotg; 48 49 49 50 /* s3c2440 specific devices */ 50 51
+22
arch/arm/plat-s3c/include/plat/dma-core.h
··· 1 + /* arch/arm/plat-s3c/include/plat/dma.h 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * Samsung S3C DMA core support 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 struct s3c2410_dma_chan *s3c_dma_lookup_channel(unsigned int channel); 16 + 17 + extern struct s3c2410_dma_chan *s3c_dma_chan_map[]; 18 + 19 + /* the currently allocated channel information */ 20 + extern struct s3c2410_dma_chan s3c2410_chans[]; 21 + 22 +
+127
arch/arm/plat-s3c/include/plat/dma.h
··· 1 + /* arch/arm/plat-s3c/include/plat/dma.h 2 + * 3 + * Copyright (C) 2003,2004,2006 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * 6 + * Samsung S3C 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 + enum s3c2410_dma_buffresult { 14 + S3C2410_RES_OK, 15 + S3C2410_RES_ERR, 16 + S3C2410_RES_ABORT 17 + }; 18 + 19 + enum s3c2410_dmasrc { 20 + S3C2410_DMASRC_HW, /* source is memory */ 21 + S3C2410_DMASRC_MEM /* source is hardware */ 22 + }; 23 + 24 + /* enum s3c2410_chan_op 25 + * 26 + * operation codes passed to the DMA code by the user, and also used 27 + * to inform the current channel owner of any changes to the system state 28 + */ 29 + 30 + enum s3c2410_chan_op { 31 + S3C2410_DMAOP_START, 32 + S3C2410_DMAOP_STOP, 33 + S3C2410_DMAOP_PAUSE, 34 + S3C2410_DMAOP_RESUME, 35 + S3C2410_DMAOP_FLUSH, 36 + S3C2410_DMAOP_TIMEOUT, /* internal signal to handler */ 37 + S3C2410_DMAOP_STARTED, /* indicate channel started */ 38 + }; 39 + 40 + struct s3c2410_dma_client { 41 + char *name; 42 + }; 43 + 44 + struct s3c2410_dma_chan; 45 + 46 + /* s3c2410_dma_cbfn_t 47 + * 48 + * buffer callback routine type 49 + */ 50 + 51 + typedef void (*s3c2410_dma_cbfn_t)(struct s3c2410_dma_chan *, 52 + void *buf, int size, 53 + enum s3c2410_dma_buffresult result); 54 + 55 + typedef int (*s3c2410_dma_opfn_t)(struct s3c2410_dma_chan *, 56 + enum s3c2410_chan_op ); 57 + 58 + 59 + 60 + /* s3c2410_dma_request 61 + * 62 + * request a dma channel exclusivley 63 + */ 64 + 65 + extern int s3c2410_dma_request(unsigned int channel, 66 + struct s3c2410_dma_client *, void *dev); 67 + 68 + 69 + /* s3c2410_dma_ctrl 70 + * 71 + * change the state of the dma channel 72 + */ 73 + 74 + extern int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op); 75 + 76 + /* s3c2410_dma_setflags 77 + * 78 + * set the channel's flags to a given state 79 + */ 80 + 81 + extern int s3c2410_dma_setflags(unsigned int channel, 82 + unsigned int flags); 83 + 84 + /* s3c2410_dma_free 85 + * 86 + * free the dma channel (will also abort any outstanding operations) 87 + */ 88 + 89 + extern int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *); 90 + 91 + /* s3c2410_dma_enqueue 92 + * 93 + * place the given buffer onto the queue of operations for the channel. 94 + * The buffer must be allocated from dma coherent memory, or the Dcache/WB 95 + * drained before the buffer is given to the DMA system. 96 + */ 97 + 98 + extern int s3c2410_dma_enqueue(unsigned int channel, void *id, 99 + dma_addr_t data, int size); 100 + 101 + /* s3c2410_dma_config 102 + * 103 + * configure the dma channel 104 + */ 105 + 106 + extern int s3c2410_dma_config(unsigned int channel, int xferunit); 107 + 108 + /* s3c2410_dma_devconfig 109 + * 110 + * configure the device we're talking to 111 + */ 112 + 113 + extern int s3c2410_dma_devconfig(int channel, enum s3c2410_dmasrc source, 114 + unsigned long devaddr); 115 + 116 + /* s3c2410_dma_getposition 117 + * 118 + * get the position that the dma transfer is currently at 119 + */ 120 + 121 + extern int s3c2410_dma_getposition(unsigned int channel, 122 + dma_addr_t *src, dma_addr_t *dest); 123 + 124 + extern int s3c2410_dma_set_opfn(unsigned int, s3c2410_dma_opfn_t rtn); 125 + extern int s3c2410_dma_set_buffdone_fn(unsigned int, s3c2410_dma_cbfn_t rtn); 126 + 127 +
+30
arch/arm/plat-s3c/include/plat/gpio-core.h
··· 20 20 * specific code. 21 21 */ 22 22 23 + struct s3c_gpio_chip; 24 + 25 + /** 26 + * struct s3c_gpio_pm - power management (suspend/resume) information 27 + * @save: Routine to save the state of the GPIO block 28 + * @resume: Routine to resume the GPIO block. 29 + */ 30 + struct s3c_gpio_pm { 31 + void (*save)(struct s3c_gpio_chip *chip); 32 + void (*resume)(struct s3c_gpio_chip *chip); 33 + }; 34 + 23 35 struct s3c_gpio_cfg; 24 36 25 37 /** ··· 39 27 * @chip: The chip structure to be exported via gpiolib. 40 28 * @base: The base pointer to the gpio configuration registers. 41 29 * @config: special function and pull-resistor control information. 30 + * @pm_save: Save information for suspend/resume support. 42 31 * 43 32 * This wrapper provides the necessary information for the Samsung 44 33 * specific gpios being registered with gpiolib. ··· 47 34 struct s3c_gpio_chip { 48 35 struct gpio_chip chip; 49 36 struct s3c_gpio_cfg *config; 37 + struct s3c_gpio_pm *pm; 50 38 void __iomem *base; 39 + #ifdef CONFIG_PM 40 + u32 pm_save[4]; 41 + #endif 51 42 }; 52 43 53 44 static inline struct s3c_gpio_chip *to_s3c_gpio(struct gpio_chip *gpc) ··· 92 75 93 76 static inline void s3c_gpiolib_track(struct s3c_gpio_chip *chip) { } 94 77 #endif 78 + 79 + #ifdef CONFIG_PM 80 + extern struct s3c_gpio_pm s3c_gpio_pm_1bit; 81 + extern struct s3c_gpio_pm s3c_gpio_pm_2bit; 82 + extern struct s3c_gpio_pm s3c_gpio_pm_4bit; 83 + #define __gpio_pm(x) x 84 + #else 85 + #define s3c_gpio_pm_1bit NULL 86 + #define s3c_gpio_pm_2bit NULL 87 + #define s3c_gpio_pm_4bit NULL 88 + #define __gpio_pm(x) NULL 89 + 90 + #endif /* CONFIG_PM */
+15
arch/arm/plat-s3c/include/plat/pm.h
··· 44 44 45 45 extern unsigned long s3c_pm_flags; 46 46 47 + extern unsigned char pm_uart_udivslot; /* true to save UART UDIVSLOT */ 48 + 47 49 /* from sleep.S */ 48 50 49 51 extern int s3c_cpu_save(unsigned long *saveblk); ··· 90 88 u32 ufcon; 91 89 u32 umcon; 92 90 u32 ubrdiv; 91 + u32 udivslot; 93 92 }; 94 93 95 94 /* helper functions to save/restore lists of registers. */ ··· 126 123 #else 127 124 #define S3C_PMDBG(fmt...) printk(KERN_DEBUG fmt) 128 125 #endif 126 + 127 + #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 128 + /** 129 + * s3c_pm_debug_smdkled() - Debug PM suspend/resume via SMDK Board LEDs 130 + * @set: set bits for the state of the LEDs 131 + * @clear: clear bits for the state of the LEDs. 132 + */ 133 + extern void s3c_pm_debug_smdkled(u32 set, u32 clear); 134 + 135 + #else 136 + static inline void s3c_pm_debug_smdkled(u32 set, u32 clear) { } 137 + #endif /* CONFIG_S3C_PM_DEBUG_LED_SMDK */ 129 138 130 139 /* suspend memory checking */ 131 140
+5
arch/arm/plat-s3c/include/plat/regs-serial.h
··· 189 189 190 190 #define S3C2443_DIVSLOT (0x2C) 191 191 192 + /* S3C64XX interrupt registers. */ 193 + #define S3C64XX_UINTP 0x30 194 + #define S3C64XX_UINTSP 0x34 195 + #define S3C64XX_UINTM 0x38 196 + 192 197 #ifndef __ASSEMBLY__ 193 198 194 199 /* struct s3c24xx_uart_clksrc
+45 -5
arch/arm/plat-s3c/include/plat/sdhci.h
··· 67 67 68 68 /* Helper function availablity */ 69 69 70 + extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 71 + extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 72 + 73 + /* S3C6400 SDHCI setup */ 74 + 75 + #ifdef CONFIG_S3C6400_SETUP_SDHCI 76 + extern char *s3c6400_hsmmc_clksrcs[4]; 77 + 78 + #ifdef CONFIG_S3C_DEV_HSMMC 79 + extern void s3c6400_setup_sdhci_cfg_card(struct platform_device *dev, 80 + void __iomem *r, 81 + struct mmc_ios *ios, 82 + struct mmc_card *card); 83 + 84 + static inline void s3c6400_default_sdhci0(void) 85 + { 86 + s3c_hsmmc0_def_platdata.clocks = s3c6400_hsmmc_clksrcs; 87 + s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; 88 + s3c_hsmmc0_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; 89 + } 90 + 91 + #else 92 + static inline void s3c6400_default_sdhci0(void) { } 93 + #endif /* CONFIG_S3C_DEV_HSMMC */ 94 + 95 + #ifdef CONFIG_S3C_DEV_HSMMC1 96 + static inline void s3c6400_default_sdhci1(void) 97 + { 98 + s3c_hsmmc1_def_platdata.clocks = s3c6400_hsmmc_clksrcs; 99 + s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; 100 + s3c_hsmmc1_def_platdata.cfg_card = s3c6400_setup_sdhci_cfg_card; 101 + } 102 + #else 103 + static inline void s3c6400_default_sdhci1(void) { } 104 + #endif /* CONFIG_S3C_DEV_HSMMC1 */ 105 + 106 + #else 107 + static inline void s3c6400_default_sdhci0(void) { } 108 + static inline void s3c6400_default_sdhci1(void) { } 109 + #endif /* CONFIG_S3C6400_SETUP_SDHCI */ 110 + 111 + /* S3C6410 SDHCI setup */ 112 + 70 113 #ifdef CONFIG_S3C6410_SETUP_SDHCI 71 114 extern char *s3c6410_hsmmc_clksrcs[4]; 72 - 73 - extern void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 74 - extern void s3c6410_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 75 115 76 116 extern void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, 77 117 void __iomem *r, ··· 122 82 static inline void s3c6410_default_sdhci0(void) 123 83 { 124 84 s3c_hsmmc0_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 125 - s3c_hsmmc0_def_platdata.cfg_gpio = s3c6410_setup_sdhci0_cfg_gpio; 85 + s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio; 126 86 s3c_hsmmc0_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 127 87 } 128 88 #else ··· 133 93 static inline void s3c6410_default_sdhci1(void) 134 94 { 135 95 s3c_hsmmc1_def_platdata.clocks = s3c6410_hsmmc_clksrcs; 136 - s3c_hsmmc1_def_platdata.cfg_gpio = s3c6410_setup_sdhci1_cfg_gpio; 96 + s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio; 137 97 s3c_hsmmc1_def_platdata.cfg_card = s3c6410_setup_sdhci0_cfg_card; 138 98 } 139 99 #else
+29
arch/arm/plat-s3c/include/plat/udc-hs.h
··· 1 + /* arch/arm/plat-s3c/include/plat/udc-hs.h 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C USB2.0 High-speed / OtG platform information 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 + enum s3c_hostg_dmamode { 16 + S3C_HSOTG_DMA_NONE, /* do not use DMA at-all */ 17 + S3C_HSOTG_DMA_ONLY, /* always use DMA */ 18 + S3C_HSOTG_DMA_DRV, /* DMA is chosen by driver */ 19 + }; 20 + 21 + /** 22 + * struct s3c_hsotg_plat - platform data for high-speed otg/udc 23 + * @dma: Whether to use DMA or not. 24 + * @is_osc: The clock source is an oscillator, not a crystal 25 + */ 26 + struct s3c_hsotg_plat { 27 + enum s3c_hostg_dmamode dma; 28 + unsigned int is_osc : 1; 29 + };
+49
arch/arm/plat-s3c/include/plat/watchdog-reset.h
··· 1 + /* arch/arm/plat-s3c/include/plat/watchdog-reset.h 2 + * 3 + * Copyright (c) 2008 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * 6 + * S3C2410 - System define for arch_reset() function 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 <plat/regs-watchdog.h> 14 + #include <mach/map.h> 15 + 16 + #include <linux/clk.h> 17 + #include <linux/err.h> 18 + #include <linux/io.h> 19 + 20 + static inline void arch_wdt_reset(void) 21 + { 22 + struct clk *wdtclk; 23 + 24 + printk("arch_reset: attempting watchdog reset\n"); 25 + 26 + __raw_writel(0, S3C2410_WTCON); /* disable watchdog, to be safe */ 27 + 28 + wdtclk = clk_get(NULL, "watchdog"); 29 + if (!IS_ERR(wdtclk)) { 30 + clk_enable(wdtclk); 31 + } else 32 + printk(KERN_WARNING "%s: warning: cannot get watchdog clock\n", __func__); 33 + 34 + /* put initial values into count and data */ 35 + __raw_writel(0x80, S3C2410_WTCNT); 36 + __raw_writel(0x80, S3C2410_WTDAT); 37 + 38 + /* set the watchdog to go and reset... */ 39 + __raw_writel(S3C2410_WTCON_ENABLE|S3C2410_WTCON_DIV16|S3C2410_WTCON_RSTEN | 40 + S3C2410_WTCON_PRESCALE(0x20), S3C2410_WTCON); 41 + 42 + /* wait for reset to assert... */ 43 + mdelay(500); 44 + 45 + printk(KERN_ERR "Watchdog reset failed to assert reset\n"); 46 + 47 + /* delay to allow the serial port to show the message */ 48 + mdelay(50); 49 + }
+380
arch/arm/plat-s3c/pm-gpio.c
··· 1 + 2 + /* linux/arch/arm/plat-s3c/pm-gpio.c 3 + * 4 + * Copyright 2008 Openmoko, Inc. 5 + * Copyright 2008 Simtec Electronics 6 + * Ben Dooks <ben@simtec.co.uk> 7 + * http://armlinux.simtec.co.uk/ 8 + * 9 + * S3C series GPIO PM code 10 + * 11 + * This program is free software; you can redistribute it and/or modify 12 + * it under the terms of the GNU General Public License version 2 as 13 + * published by the Free Software Foundation. 14 + */ 15 + 16 + #include <linux/kernel.h> 17 + #include <linux/sysdev.h> 18 + #include <linux/init.h> 19 + #include <linux/io.h> 20 + #include <linux/gpio.h> 21 + 22 + #include <mach/gpio-core.h> 23 + #include <plat/pm.h> 24 + 25 + /* PM GPIO helpers */ 26 + 27 + #define OFFS_CON (0x00) 28 + #define OFFS_DAT (0x04) 29 + #define OFFS_UP (0x08) 30 + 31 + static void s3c_gpio_pm_1bit_save(struct s3c_gpio_chip *chip) 32 + { 33 + chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON); 34 + chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT); 35 + } 36 + 37 + static void s3c_gpio_pm_1bit_resume(struct s3c_gpio_chip *chip) 38 + { 39 + void __iomem *base = chip->base; 40 + u32 old_gpcon = __raw_readl(base + OFFS_CON); 41 + u32 old_gpdat = __raw_readl(base + OFFS_DAT); 42 + u32 gps_gpcon = chip->pm_save[0]; 43 + u32 gps_gpdat = chip->pm_save[1]; 44 + u32 gpcon; 45 + 46 + /* GPACON only has one bit per control / data and no PULLUPs. 47 + * GPACON[x] = 0 => Output, 1 => SFN */ 48 + 49 + /* first set all SFN bits to SFN */ 50 + 51 + gpcon = old_gpcon | gps_gpcon; 52 + __raw_writel(gpcon, base + OFFS_CON); 53 + 54 + /* now set all the other bits */ 55 + 56 + __raw_writel(gps_gpdat, base + OFFS_DAT); 57 + __raw_writel(gps_gpcon, base + OFFS_CON); 58 + 59 + S3C_PMDBG("%s: CON %08x => %08x, DAT %08x => %08x\n", 60 + chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); 61 + } 62 + 63 + struct s3c_gpio_pm s3c_gpio_pm_1bit = { 64 + .save = s3c_gpio_pm_1bit_save, 65 + .resume = s3c_gpio_pm_1bit_resume, 66 + }; 67 + 68 + static void s3c_gpio_pm_2bit_save(struct s3c_gpio_chip *chip) 69 + { 70 + chip->pm_save[0] = __raw_readl(chip->base + OFFS_CON); 71 + chip->pm_save[1] = __raw_readl(chip->base + OFFS_DAT); 72 + chip->pm_save[2] = __raw_readl(chip->base + OFFS_UP); 73 + } 74 + 75 + /* Test whether the given masked+shifted bits of an GPIO configuration 76 + * are one of the SFN (special function) modes. */ 77 + 78 + static inline int is_sfn(unsigned long con) 79 + { 80 + return con >= 2; 81 + } 82 + 83 + /* Test if the given masked+shifted GPIO configuration is an input */ 84 + 85 + static inline int is_in(unsigned long con) 86 + { 87 + return con == 0; 88 + } 89 + 90 + /* Test if the given masked+shifted GPIO configuration is an output */ 91 + 92 + static inline int is_out(unsigned long con) 93 + { 94 + return con == 1; 95 + } 96 + 97 + /** 98 + * s3c_gpio_pm_2bit_resume() - restore the given GPIO bank 99 + * @chip: The chip information to resume. 100 + * 101 + * Restore one of the GPIO banks that was saved during suspend. This is 102 + * not as simple as once thought, due to the possibility of glitches 103 + * from the order that the CON and DAT registers are set in. 104 + * 105 + * The three states the pin can be are {IN,OUT,SFN} which gives us 9 106 + * combinations of changes to check. Three of these, if the pin stays 107 + * in the same configuration can be discounted. This leaves us with 108 + * the following: 109 + * 110 + * { IN => OUT } Change DAT first 111 + * { IN => SFN } Change CON first 112 + * { OUT => SFN } Change CON first, so new data will not glitch 113 + * { OUT => IN } Change CON first, so new data will not glitch 114 + * { SFN => IN } Change CON first 115 + * { SFN => OUT } Change DAT first, so new data will not glitch [1] 116 + * 117 + * We do not currently deal with the UP registers as these control 118 + * weak resistors, so a small delay in change should not need to bring 119 + * these into the calculations. 120 + * 121 + * [1] this assumes that writing to a pin DAT whilst in SFN will set the 122 + * state for when it is next output. 123 + */ 124 + static void s3c_gpio_pm_2bit_resume(struct s3c_gpio_chip *chip) 125 + { 126 + void __iomem *base = chip->base; 127 + u32 old_gpcon = __raw_readl(base + OFFS_CON); 128 + u32 old_gpdat = __raw_readl(base + OFFS_DAT); 129 + u32 gps_gpcon = chip->pm_save[0]; 130 + u32 gps_gpdat = chip->pm_save[1]; 131 + u32 gpcon, old, new, mask; 132 + u32 change_mask = 0x0; 133 + int nr; 134 + 135 + /* restore GPIO pull-up settings */ 136 + __raw_writel(chip->pm_save[2], base + OFFS_UP); 137 + 138 + /* Create a change_mask of all the items that need to have 139 + * their CON value changed before their DAT value, so that 140 + * we minimise the work between the two settings. 141 + */ 142 + 143 + for (nr = 0, mask = 0x03; nr < 32; nr += 2, mask <<= 2) { 144 + old = (old_gpcon & mask) >> nr; 145 + new = (gps_gpcon & mask) >> nr; 146 + 147 + /* If there is no change, then skip */ 148 + 149 + if (old == new) 150 + continue; 151 + 152 + /* If both are special function, then skip */ 153 + 154 + if (is_sfn(old) && is_sfn(new)) 155 + continue; 156 + 157 + /* Change is IN => OUT, do not change now */ 158 + 159 + if (is_in(old) && is_out(new)) 160 + continue; 161 + 162 + /* Change is SFN => OUT, do not change now */ 163 + 164 + if (is_sfn(old) && is_out(new)) 165 + continue; 166 + 167 + /* We should now be at the case of IN=>SFN, 168 + * OUT=>SFN, OUT=>IN, SFN=>IN. */ 169 + 170 + change_mask |= mask; 171 + } 172 + 173 + 174 + /* Write the new CON settings */ 175 + 176 + gpcon = old_gpcon & ~change_mask; 177 + gpcon |= gps_gpcon & change_mask; 178 + 179 + __raw_writel(gpcon, base + OFFS_CON); 180 + 181 + /* Now change any items that require DAT,CON */ 182 + 183 + __raw_writel(gps_gpdat, base + OFFS_DAT); 184 + __raw_writel(gps_gpcon, base + OFFS_CON); 185 + 186 + S3C_PMDBG("%s: CON %08x => %08x, DAT %08x => %08x\n", 187 + chip->chip.label, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); 188 + } 189 + 190 + struct s3c_gpio_pm s3c_gpio_pm_2bit = { 191 + .save = s3c_gpio_pm_2bit_save, 192 + .resume = s3c_gpio_pm_2bit_resume, 193 + }; 194 + 195 + #ifdef CONFIG_ARCH_S3C64XX 196 + static void s3c_gpio_pm_4bit_save(struct s3c_gpio_chip *chip) 197 + { 198 + chip->pm_save[1] = __raw_readl(chip->base + OFFS_CON); 199 + chip->pm_save[2] = __raw_readl(chip->base + OFFS_DAT); 200 + chip->pm_save[3] = __raw_readl(chip->base + OFFS_UP); 201 + 202 + if (chip->chip.ngpio > 8) 203 + chip->pm_save[0] = __raw_readl(chip->base - 4); 204 + } 205 + 206 + static u32 s3c_gpio_pm_4bit_mask(u32 old_gpcon, u32 gps_gpcon) 207 + { 208 + u32 old, new, mask; 209 + u32 change_mask = 0x0; 210 + int nr; 211 + 212 + for (nr = 0, mask = 0x0f; nr < 16; nr += 4, mask <<= 4) { 213 + old = (old_gpcon & mask) >> nr; 214 + new = (gps_gpcon & mask) >> nr; 215 + 216 + /* If there is no change, then skip */ 217 + 218 + if (old == new) 219 + continue; 220 + 221 + /* If both are special function, then skip */ 222 + 223 + if (is_sfn(old) && is_sfn(new)) 224 + continue; 225 + 226 + /* Change is IN => OUT, do not change now */ 227 + 228 + if (is_in(old) && is_out(new)) 229 + continue; 230 + 231 + /* Change is SFN => OUT, do not change now */ 232 + 233 + if (is_sfn(old) && is_out(new)) 234 + continue; 235 + 236 + /* We should now be at the case of IN=>SFN, 237 + * OUT=>SFN, OUT=>IN, SFN=>IN. */ 238 + 239 + change_mask |= mask; 240 + } 241 + 242 + return change_mask; 243 + } 244 + 245 + static void s3c_gpio_pm_4bit_con(struct s3c_gpio_chip *chip, int index) 246 + { 247 + void __iomem *con = chip->base + (index * 4); 248 + u32 old_gpcon = __raw_readl(con); 249 + u32 gps_gpcon = chip->pm_save[index + 1]; 250 + u32 gpcon, mask; 251 + 252 + mask = s3c_gpio_pm_4bit_mask(old_gpcon, gps_gpcon); 253 + 254 + gpcon = old_gpcon & ~mask; 255 + gpcon |= gps_gpcon & mask; 256 + 257 + __raw_writel(gpcon, con); 258 + } 259 + 260 + static void s3c_gpio_pm_4bit_resume(struct s3c_gpio_chip *chip) 261 + { 262 + void __iomem *base = chip->base; 263 + u32 old_gpcon[2]; 264 + u32 old_gpdat = __raw_readl(base + OFFS_DAT); 265 + u32 gps_gpdat = chip->pm_save[2]; 266 + 267 + /* First, modify the CON settings */ 268 + 269 + old_gpcon[0] = 0; 270 + old_gpcon[1] = __raw_readl(base + OFFS_CON); 271 + 272 + s3c_gpio_pm_4bit_con(chip, 0); 273 + if (chip->chip.ngpio > 8) { 274 + old_gpcon[0] = __raw_readl(base - 4); 275 + s3c_gpio_pm_4bit_con(chip, -1); 276 + } 277 + 278 + /* Now change the configurations that require DAT,CON */ 279 + 280 + __raw_writel(chip->pm_save[2], base + OFFS_DAT); 281 + __raw_writel(chip->pm_save[1], base + OFFS_CON); 282 + if (chip->chip.ngpio > 8) 283 + __raw_writel(chip->pm_save[0], base - 4); 284 + 285 + __raw_writel(chip->pm_save[2], base + OFFS_DAT); 286 + __raw_writel(chip->pm_save[3], base + OFFS_UP); 287 + 288 + if (chip->chip.ngpio > 8) { 289 + S3C_PMDBG("%s: CON4 %08x,%08x => %08x,%08x, DAT %08x => %08x\n", 290 + chip->chip.label, old_gpcon[0], old_gpcon[1], 291 + __raw_readl(base - 4), 292 + __raw_readl(base + OFFS_CON), 293 + old_gpdat, gps_gpdat); 294 + } else 295 + S3C_PMDBG("%s: CON4 %08x => %08x, DAT %08x => %08x\n", 296 + chip->chip.label, old_gpcon[1], 297 + __raw_readl(base + OFFS_CON), 298 + old_gpdat, gps_gpdat); 299 + } 300 + 301 + struct s3c_gpio_pm s3c_gpio_pm_4bit = { 302 + .save = s3c_gpio_pm_4bit_save, 303 + .resume = s3c_gpio_pm_4bit_resume, 304 + }; 305 + #endif /* CONFIG_ARCH_S3C64XX */ 306 + 307 + /** 308 + * s3c_pm_save_gpio() - save gpio chip data for suspend 309 + * @ourchip: The chip for suspend. 310 + */ 311 + static void s3c_pm_save_gpio(struct s3c_gpio_chip *ourchip) 312 + { 313 + struct s3c_gpio_pm *pm = ourchip->pm; 314 + 315 + if (pm == NULL || pm->save == NULL) 316 + S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label); 317 + else 318 + pm->save(ourchip); 319 + } 320 + 321 + /** 322 + * s3c_pm_save_gpios() - Save the state of the GPIO banks. 323 + * 324 + * For all the GPIO banks, save the state of each one ready for going 325 + * into a suspend mode. 326 + */ 327 + void s3c_pm_save_gpios(void) 328 + { 329 + struct s3c_gpio_chip *ourchip; 330 + unsigned int gpio_nr; 331 + 332 + for (gpio_nr = 0; gpio_nr < S3C_GPIO_END; gpio_nr++) { 333 + ourchip = s3c_gpiolib_getchip(gpio_nr); 334 + if (!ourchip) 335 + continue; 336 + 337 + s3c_pm_save_gpio(ourchip); 338 + 339 + S3C_PMDBG("%s: save %08x,%08x,%08x,%08x\n", 340 + ourchip->chip.label, 341 + ourchip->pm_save[0], 342 + ourchip->pm_save[1], 343 + ourchip->pm_save[2], 344 + ourchip->pm_save[3]); 345 + 346 + gpio_nr += ourchip->chip.ngpio; 347 + gpio_nr += CONFIG_S3C_GPIO_SPACE; 348 + } 349 + } 350 + 351 + /** 352 + * s3c_pm_resume_gpio() - restore gpio chip data after suspend 353 + * @ourchip: The suspended chip. 354 + */ 355 + static void s3c_pm_resume_gpio(struct s3c_gpio_chip *ourchip) 356 + { 357 + struct s3c_gpio_pm *pm = ourchip->pm; 358 + 359 + if (pm == NULL || pm->resume == NULL) 360 + S3C_PMDBG("%s: no pm for %s\n", __func__, ourchip->chip.label); 361 + else 362 + pm->resume(ourchip); 363 + } 364 + 365 + void s3c_pm_restore_gpios(void) 366 + { 367 + struct s3c_gpio_chip *ourchip; 368 + unsigned int gpio_nr; 369 + 370 + for (gpio_nr = 0; gpio_nr < S3C_GPIO_END; gpio_nr++) { 371 + ourchip = s3c_gpiolib_getchip(gpio_nr); 372 + if (!ourchip) 373 + continue; 374 + 375 + s3c_pm_resume_gpio(ourchip); 376 + 377 + gpio_nr += ourchip->chip.ngpio; 378 + gpio_nr += CONFIG_S3C_GPIO_SPACE; 379 + } 380 + }
+17 -2
arch/arm/plat-s3c/pm.c
··· 21 21 22 22 #include <asm/cacheflush.h> 23 23 #include <mach/hardware.h> 24 + #include <mach/map.h> 24 25 25 26 #include <plat/regs-serial.h> 26 27 #include <mach/regs-clock.h> 27 - #include <mach/regs-gpio.h> 28 - #include <mach/regs-mem.h> 29 28 #include <mach/regs-irq.h> 30 29 #include <asm/irq.h> 31 30 ··· 69 70 70 71 /* Save the UART configurations if we are configured for debug. */ 71 72 73 + unsigned char pm_uart_udivslot; 74 + 72 75 #ifdef CONFIG_S3C2410_PM_DEBUG 73 76 74 77 struct pm_uart_save uart_save[CONFIG_SERIAL_SAMSUNG_UARTS]; ··· 84 83 save->ufcon = __raw_readl(regs + S3C2410_UFCON); 85 84 save->umcon = __raw_readl(regs + S3C2410_UMCON); 86 85 save->ubrdiv = __raw_readl(regs + S3C2410_UBRDIV); 86 + 87 + if (pm_uart_udivslot) 88 + save->udivslot = __raw_readl(regs + S3C2443_DIVSLOT); 89 + 90 + S3C_PMDBG("UART[%d]: ULCON=%04x, UCON=%04x, UFCON=%04x, UBRDIV=%04x\n", 91 + uart, save->ulcon, save->ucon, save->ufcon, save->ubrdiv); 87 92 } 88 93 89 94 static void s3c_pm_save_uarts(void) ··· 105 98 { 106 99 void __iomem *regs = S3C_VA_UARTx(uart); 107 100 101 + s3c_pm_arch_update_uart(regs, save); 102 + 108 103 __raw_writel(save->ulcon, regs + S3C2410_ULCON); 109 104 __raw_writel(save->ucon, regs + S3C2410_UCON); 110 105 __raw_writel(save->ufcon, regs + S3C2410_UFCON); 111 106 __raw_writel(save->umcon, regs + S3C2410_UMCON); 112 107 __raw_writel(save->ubrdiv, regs + S3C2410_UBRDIV); 108 + 109 + if (pm_uart_udivslot) 110 + __raw_writel(save->udivslot, regs + S3C2443_DIVSLOT); 113 111 } 114 112 115 113 static void s3c_pm_restore_uarts(void) ··· 324 312 s3c_pm_arch_show_resume_irqs(); 325 313 326 314 S3C_PMDBG("%s: post sleep, preparing to return\n", __func__); 315 + 316 + /* LEDs should now be 1110 */ 317 + s3c_pm_debug_smdkled(1 << 1, 0); 327 318 328 319 s3c_pm_check_restore(); 329 320
+1
arch/arm/plat-s3c24xx/Kconfig
··· 71 71 config S3C2410_DMA 72 72 bool "S3C2410 DMA support" 73 73 depends on ARCH_S3C2410 74 + select S3C_DMA 74 75 help 75 76 S3C2410 DMA support. This is needed for drivers like sound which 76 77 use the S3C2410's DMA system to move data to and from the
+7 -4
arch/arm/plat-s3c24xx/adc.c
··· 45 45 unsigned char channel; 46 46 47 47 void (*select_cb)(unsigned selected); 48 - void (*convert_cb)(unsigned val1, unsigned val2); 48 + void (*convert_cb)(unsigned val1, unsigned val2, 49 + unsigned *samples_left); 49 50 }; 50 51 51 52 struct adc_device { ··· 159 158 160 159 struct s3c_adc_client *s3c_adc_register(struct platform_device *pdev, 161 160 void (*select)(unsigned int selected), 162 - void (*conv)(unsigned d0, unsigned d1), 161 + void (*conv)(unsigned d0, unsigned d1, 162 + unsigned *samples_left), 163 163 unsigned int is_ts) 164 164 { 165 165 struct s3c_adc_client *client; ··· 229 227 data1 = readl(adc->regs + S3C2410_ADCDAT1); 230 228 adc_dbg(adc, "read %d: 0x%04x, 0x%04x\n", client->nr_samples, data0, data1); 231 229 232 - (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff); 230 + client->nr_samples--; 231 + (client->convert_cb)(data0 & 0x3ff, data1 & 0x3ff, &client->nr_samples); 233 232 234 - if (--client->nr_samples > 0) { 233 + if (client->nr_samples > 0) { 235 234 /* fire another conversion for this */ 236 235 237 236 client->select_cb(1);
+13 -12
arch/arm/plat-s3c24xx/common-smdk.c
··· 18 18 #include <linux/list.h> 19 19 #include <linux/timer.h> 20 20 #include <linux/init.h> 21 + #include <linux/gpio.h> 21 22 #include <linux/sysdev.h> 22 23 #include <linux/platform_device.h> 23 24 ··· 48 47 /* LED devices */ 49 48 50 49 static struct s3c24xx_led_platdata smdk_pdata_led4 = { 51 - .gpio = S3C2410_GPF4, 50 + .gpio = S3C2410_GPF(4), 52 51 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 53 52 .name = "led4", 54 53 .def_trigger = "timer", 55 54 }; 56 55 57 56 static struct s3c24xx_led_platdata smdk_pdata_led5 = { 58 - .gpio = S3C2410_GPF5, 57 + .gpio = S3C2410_GPF(5), 59 58 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 60 59 .name = "led5", 61 60 .def_trigger = "nand-disk", 62 61 }; 63 62 64 63 static struct s3c24xx_led_platdata smdk_pdata_led6 = { 65 - .gpio = S3C2410_GPF6, 64 + .gpio = S3C2410_GPF(6), 66 65 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 67 66 .name = "led6", 68 67 }; 69 68 70 69 static struct s3c24xx_led_platdata smdk_pdata_led7 = { 71 - .gpio = S3C2410_GPF7, 70 + .gpio = S3C2410_GPF(7), 72 71 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, 73 72 .name = "led7", 74 73 }; ··· 185 184 { 186 185 /* Configure the LEDs (even if we have no LED support)*/ 187 186 188 - s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); 189 - s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); 190 - s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); 191 - s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); 187 + s3c2410_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); 188 + s3c2410_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); 189 + s3c2410_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); 190 + s3c2410_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); 192 191 193 - s3c2410_gpio_setpin(S3C2410_GPF4, 1); 194 - s3c2410_gpio_setpin(S3C2410_GPF5, 1); 195 - s3c2410_gpio_setpin(S3C2410_GPF6, 1); 196 - s3c2410_gpio_setpin(S3C2410_GPF7, 1); 192 + s3c2410_gpio_setpin(S3C2410_GPF(4), 1); 193 + s3c2410_gpio_setpin(S3C2410_GPF(5), 1); 194 + s3c2410_gpio_setpin(S3C2410_GPF(6), 1); 195 + s3c2410_gpio_setpin(S3C2410_GPF(7), 1); 197 196 198 197 if (machine_is_smdk2443()) 199 198 smdk_nand_info.twrph0 = 50;
-30
arch/arm/plat-s3c24xx/devs.c
··· 136 136 struct platform_device *s3c24xx_uart_devs[4] = { 137 137 }; 138 138 139 - /* USB Host Controller */ 140 - 141 - static struct resource s3c_usb_resource[] = { 142 - [0] = { 143 - .start = S3C24XX_PA_USBHOST, 144 - .end = S3C24XX_PA_USBHOST + S3C24XX_SZ_USBHOST - 1, 145 - .flags = IORESOURCE_MEM, 146 - }, 147 - [1] = { 148 - .start = IRQ_USBH, 149 - .end = IRQ_USBH, 150 - .flags = IORESOURCE_IRQ, 151 - } 152 - }; 153 - 154 - static u64 s3c_device_usb_dmamask = 0xffffffffUL; 155 - 156 - struct platform_device s3c_device_usb = { 157 - .name = "s3c2410-ohci", 158 - .id = -1, 159 - .num_resources = ARRAY_SIZE(s3c_usb_resource), 160 - .resource = s3c_usb_resource, 161 - .dev = { 162 - .dma_mask = &s3c_device_usb_dmamask, 163 - .coherent_dma_mask = 0xffffffffUL 164 - } 165 - }; 166 - 167 - EXPORT_SYMBOL(s3c_device_usb); 168 - 169 139 /* LCD Controller */ 170 140 171 141 static struct resource s3c_lcd_resource[] = {
+56 -95
arch/arm/plat-s3c24xx/dma.c
··· 31 31 #include <asm/irq.h> 32 32 #include <mach/hardware.h> 33 33 #include <mach/dma.h> 34 - 35 34 #include <mach/map.h> 36 35 37 - #include <plat/dma.h> 36 + #include <plat/dma-plat.h> 37 + #include <plat/regs-dma.h> 38 38 39 39 /* io map for dma */ 40 40 static void __iomem *dma_base; ··· 44 44 45 45 static struct s3c24xx_dma_selection dma_sel; 46 46 47 - /* dma channel state information */ 48 - struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS]; 49 47 50 48 /* debugging functions */ 51 49 ··· 133 135 #define dbg_showchan(chan) do { } while(0) 134 136 #endif /* CONFIG_S3C2410_DMA_DEBUG */ 135 137 136 - static struct s3c2410_dma_chan *dma_chan_map[DMACH_MAX]; 137 - 138 - /* lookup_dma_channel 139 - * 140 - * change the dma channel number given into a real dma channel id 141 - */ 142 - 143 - static struct s3c2410_dma_chan *lookup_dma_channel(unsigned int channel) 144 - { 145 - if (channel & DMACH_LOW_LEVEL) 146 - return &s3c2410_chans[channel & ~DMACH_LOW_LEVEL]; 147 - else 148 - return dma_chan_map[channel]; 149 - } 150 - 151 138 /* s3c2410_dma_stats_timeout 152 139 * 153 140 * Update DMA stats from timeout info ··· 196 213 197 214 return 0; 198 215 } 199 - 200 - 201 216 202 217 /* s3c2410_dma_loadbuffer 203 218 * ··· 434 453 int s3c2410_dma_enqueue(unsigned int channel, void *id, 435 454 dma_addr_t data, int size) 436 455 { 437 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 456 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 438 457 struct s3c2410_dma_buf *buf; 439 458 unsigned long flags; 440 459 ··· 785 804 786 805 int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 787 806 { 788 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 807 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 789 808 unsigned long flags; 790 809 791 810 if (chan == NULL) ··· 817 836 chan->irq_claimed = 0; 818 837 819 838 if (!(channel & DMACH_LOW_LEVEL)) 820 - dma_chan_map[channel] = NULL; 839 + s3c_dma_chan_map[channel] = NULL; 821 840 822 841 local_irq_restore(flags); 823 842 ··· 976 995 int 977 996 s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 978 997 { 979 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 998 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 980 999 981 1000 if (chan == NULL) 982 1001 return -EINVAL; ··· 1019 1038 /* s3c2410_dma_config 1020 1039 * 1021 1040 * xfersize: size of unit in bytes (1,2,4) 1022 - * dcon: base value of the DCONx register 1023 1041 */ 1024 1042 1025 1043 int s3c2410_dma_config(unsigned int channel, 1026 - int xferunit, 1027 - int dcon) 1044 + int xferunit) 1028 1045 { 1029 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1046 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 1047 + unsigned int dcon; 1030 1048 1031 1049 pr_debug("%s: chan=%d, xfer_unit=%d, dcon=%08x\n", 1032 1050 __func__, channel, xferunit, dcon); ··· 1035 1055 1036 1056 pr_debug("%s: Initial dcon is %08x\n", __func__, dcon); 1037 1057 1038 - dcon |= chan->dcon & dma_sel.dcon_mask; 1058 + dcon = chan->dcon & dma_sel.dcon_mask; 1039 1059 1040 1060 pr_debug("%s: New dcon is %08x\n", __func__, dcon); 1061 + 1062 + switch (chan->req_ch) { 1063 + case DMACH_I2S_IN: 1064 + case DMACH_I2S_OUT: 1065 + case DMACH_PCM_IN: 1066 + case DMACH_PCM_OUT: 1067 + case DMACH_MIC_IN: 1068 + default: 1069 + dcon |= S3C2410_DCON_HANDSHAKE; 1070 + dcon |= S3C2410_DCON_SYNC_PCLK; 1071 + break; 1072 + 1073 + case DMACH_SDI: 1074 + /* note, ensure if need HANDSHAKE or not */ 1075 + dcon |= S3C2410_DCON_SYNC_PCLK; 1076 + break; 1077 + 1078 + case DMACH_XD0: 1079 + case DMACH_XD1: 1080 + dcon |= S3C2410_DCON_HANDSHAKE; 1081 + dcon |= S3C2410_DCON_SYNC_HCLK; 1082 + break; 1083 + } 1041 1084 1042 1085 switch (xferunit) { 1043 1086 case 1: ··· 1093 1090 1094 1091 EXPORT_SYMBOL(s3c2410_dma_config); 1095 1092 1096 - int s3c2410_dma_setflags(unsigned int channel, unsigned int flags) 1097 - { 1098 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1099 - 1100 - if (chan == NULL) 1101 - return -EINVAL; 1102 - 1103 - pr_debug("%s: chan=%p, flags=%08x\n", __func__, chan, flags); 1104 - 1105 - chan->flags = flags; 1106 - 1107 - return 0; 1108 - } 1109 - 1110 - EXPORT_SYMBOL(s3c2410_dma_setflags); 1111 - 1112 - 1113 - /* do we need to protect the settings of the fields from 1114 - * irq? 1115 - */ 1116 - 1117 - int s3c2410_dma_set_opfn(unsigned int channel, s3c2410_dma_opfn_t rtn) 1118 - { 1119 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1120 - 1121 - if (chan == NULL) 1122 - return -EINVAL; 1123 - 1124 - pr_debug("%s: chan=%p, op rtn=%p\n", __func__, chan, rtn); 1125 - 1126 - chan->op_fn = rtn; 1127 - 1128 - return 0; 1129 - } 1130 - 1131 - EXPORT_SYMBOL(s3c2410_dma_set_opfn); 1132 - 1133 - int s3c2410_dma_set_buffdone_fn(unsigned int channel, s3c2410_dma_cbfn_t rtn) 1134 - { 1135 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1136 - 1137 - if (chan == NULL) 1138 - return -EINVAL; 1139 - 1140 - pr_debug("%s: chan=%p, callback rtn=%p\n", __func__, chan, rtn); 1141 - 1142 - chan->callback_fn = rtn; 1143 - 1144 - return 0; 1145 - } 1146 - 1147 - EXPORT_SYMBOL(s3c2410_dma_set_buffdone_fn); 1148 1093 1149 1094 /* s3c2410_dma_devconfig 1150 1095 * ··· 1101 1150 * source: S3C2410_DMASRC_HW: source is hardware 1102 1151 * S3C2410_DMASRC_MEM: source is memory 1103 1152 * 1104 - * hwcfg: the value for xxxSTCn register, 1105 - * bit 0: 0=increment pointer, 1=leave pointer 1106 - * bit 1: 0=source is AHB, 1=source is APB 1107 - * 1108 1153 * devaddr: physical address of the source 1109 1154 */ 1110 1155 1111 1156 int s3c2410_dma_devconfig(int channel, 1112 1157 enum s3c2410_dmasrc source, 1113 - int hwcfg, 1114 1158 unsigned long devaddr) 1115 1159 { 1116 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1160 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 1161 + unsigned int hwcfg; 1117 1162 1118 1163 if (chan == NULL) 1119 1164 return -EINVAL; 1120 1165 1121 - pr_debug("%s: source=%d, hwcfg=%08x, devaddr=%08lx\n", 1122 - __func__, (int)source, hwcfg, devaddr); 1166 + pr_debug("%s: source=%d, devaddr=%08lx\n", 1167 + __func__, (int)source, devaddr); 1123 1168 1124 1169 chan->source = source; 1125 1170 chan->dev_addr = devaddr; 1126 - chan->hw_cfg = hwcfg; 1171 + 1172 + switch (chan->req_ch) { 1173 + case DMACH_XD0: 1174 + case DMACH_XD1: 1175 + hwcfg = 0; /* AHB */ 1176 + break; 1177 + 1178 + default: 1179 + hwcfg = S3C2410_DISRCC_APB; 1180 + } 1181 + 1182 + /* always assume our peripheral desintation is a fixed 1183 + * address in memory. */ 1184 + hwcfg |= S3C2410_DISRCC_INC; 1127 1185 1128 1186 switch (source) { 1129 1187 case S3C2410_DMASRC_HW: ··· 1179 1219 1180 1220 int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *dst) 1181 1221 { 1182 - struct s3c2410_dma_chan *chan = lookup_dma_channel(channel); 1222 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 1183 1223 1184 1224 if (chan == NULL) 1185 1225 return -EINVAL; ··· 1238 1278 1239 1279 printk(KERN_INFO "dma%d: restoring configuration\n", cp->number); 1240 1280 1241 - s3c2410_dma_config(no, cp->xfer_unit, cp->dcon); 1242 - s3c2410_dma_devconfig(no, cp->source, cp->hw_cfg, cp->dev_addr); 1281 + s3c2410_dma_config(no, cp->xfer_unit); 1282 + s3c2410_dma_devconfig(no, cp->source, cp->dev_addr); 1243 1283 1244 1284 /* re-select the dma source for this channel */ 1245 1285 ··· 1436 1476 found: 1437 1477 dmach = &s3c2410_chans[ch]; 1438 1478 dmach->map = ch_map; 1439 - dma_chan_map[channel] = dmach; 1479 + dmach->req_ch = channel; 1480 + s3c_dma_chan_map[channel] = dmach; 1440 1481 1441 1482 /* select the channel */ 1442 1483
+9 -25
arch/arm/plat-s3c24xx/gpio.c
··· 183 183 184 184 int s3c2410_gpio_getirq(unsigned int pin) 185 185 { 186 - if (pin < S3C2410_GPF0 || pin > S3C2410_GPG15) 187 - return -1; /* not valid interrupts */ 186 + if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) 187 + return -EINVAL; /* not valid interrupts */ 188 188 189 - if (pin < S3C2410_GPG0 && pin > S3C2410_GPF7) 190 - return -1; /* not valid pin */ 189 + if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) 190 + return -EINVAL; /* not valid pin */ 191 191 192 - if (pin < S3C2410_GPF4) 193 - return (pin - S3C2410_GPF0) + IRQ_EINT0; 192 + if (pin < S3C2410_GPF(4)) 193 + return (pin - S3C2410_GPF(0)) + IRQ_EINT0; 194 194 195 - if (pin < S3C2410_GPG0) 196 - return (pin - S3C2410_GPF4) + IRQ_EINT4; 195 + if (pin < S3C2410_GPG(0)) 196 + return (pin - S3C2410_GPF(4)) + IRQ_EINT4; 197 197 198 - return (pin - S3C2410_GPG0) + IRQ_EINT8; 198 + return (pin - S3C2410_GPG(0)) + IRQ_EINT8; 199 199 } 200 200 201 201 EXPORT_SYMBOL(s3c2410_gpio_getirq); 202 - 203 - int s3c2410_gpio_irq2pin(unsigned int irq) 204 - { 205 - if (irq >= IRQ_EINT0 && irq <= IRQ_EINT3) 206 - return S3C2410_GPF0 + (irq - IRQ_EINT0); 207 - 208 - if (irq >= IRQ_EINT4 && irq <= IRQ_EINT7) 209 - return S3C2410_GPF4 + (irq - IRQ_EINT4); 210 - 211 - if (irq >= IRQ_EINT8 && irq <= IRQ_EINT23) 212 - return S3C2410_GPG0 + (irq - IRQ_EINT8); 213 - 214 - return -EINVAL; 215 - } 216 - 217 - EXPORT_SYMBOL(s3c2410_gpio_irq2pin);
+34 -16
arch/arm/plat-s3c24xx/gpiolib.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/module.h> 17 17 #include <linux/interrupt.h> 18 + #include <linux/sysdev.h> 18 19 #include <linux/ioport.h> 19 20 #include <linux/io.h> 20 21 #include <linux/gpio.h> ··· 23 22 #include <mach/gpio-core.h> 24 23 #include <mach/hardware.h> 25 24 #include <asm/irq.h> 25 + #include <plat/pm.h> 26 26 27 27 #include <mach/regs-gpio.h> 28 28 ··· 79 77 80 78 struct s3c_gpio_chip s3c24xx_gpios[] = { 81 79 [0] = { 82 - .base = S3C24XX_GPIO_BASE(S3C2410_GPA0), 80 + .base = S3C2410_GPACON, 81 + .pm = __gpio_pm(&s3c_gpio_pm_1bit), 83 82 .chip = { 84 - .base = S3C2410_GPA0, 83 + .base = S3C2410_GPA(0), 85 84 .owner = THIS_MODULE, 86 85 .label = "GPIOA", 87 86 .ngpio = 24, ··· 91 88 }, 92 89 }, 93 90 [1] = { 94 - .base = S3C24XX_GPIO_BASE(S3C2410_GPB0), 91 + .base = S3C2410_GPBCON, 92 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 95 93 .chip = { 96 - .base = S3C2410_GPB0, 94 + .base = S3C2410_GPB(0), 97 95 .owner = THIS_MODULE, 98 96 .label = "GPIOB", 99 97 .ngpio = 16, 100 98 }, 101 99 }, 102 100 [2] = { 103 - .base = S3C24XX_GPIO_BASE(S3C2410_GPC0), 101 + .base = S3C2410_GPCCON, 102 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 104 103 .chip = { 105 - .base = S3C2410_GPC0, 104 + .base = S3C2410_GPC(0), 106 105 .owner = THIS_MODULE, 107 106 .label = "GPIOC", 108 107 .ngpio = 16, 109 108 }, 110 109 }, 111 110 [3] = { 112 - .base = S3C24XX_GPIO_BASE(S3C2410_GPD0), 111 + .base = S3C2410_GPDCON, 112 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 113 113 .chip = { 114 - .base = S3C2410_GPD0, 114 + .base = S3C2410_GPD(0), 115 115 .owner = THIS_MODULE, 116 116 .label = "GPIOD", 117 117 .ngpio = 16, 118 118 }, 119 119 }, 120 120 [4] = { 121 - .base = S3C24XX_GPIO_BASE(S3C2410_GPE0), 121 + .base = S3C2410_GPECON, 122 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 122 123 .chip = { 123 - .base = S3C2410_GPE0, 124 + .base = S3C2410_GPE(0), 124 125 .label = "GPIOE", 125 126 .owner = THIS_MODULE, 126 127 .ngpio = 16, 127 128 }, 128 129 }, 129 130 [5] = { 130 - .base = S3C24XX_GPIO_BASE(S3C2410_GPF0), 131 + .base = S3C2410_GPFCON, 132 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 131 133 .chip = { 132 - .base = S3C2410_GPF0, 134 + .base = S3C2410_GPF(0), 133 135 .owner = THIS_MODULE, 134 136 .label = "GPIOF", 135 137 .ngpio = 8, ··· 142 134 }, 143 135 }, 144 136 [6] = { 145 - .base = S3C24XX_GPIO_BASE(S3C2410_GPG0), 137 + .base = S3C2410_GPGCON, 138 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 146 139 .chip = { 147 - .base = S3C2410_GPG0, 140 + .base = S3C2410_GPG(0), 148 141 .owner = THIS_MODULE, 149 142 .label = "GPIOG", 150 - .ngpio = 10, 143 + .ngpio = 16, 151 144 .to_irq = s3c24xx_gpiolib_bankg_toirq, 145 + }, 146 + }, { 147 + .base = S3C2410_GPHCON, 148 + .pm = __gpio_pm(&s3c_gpio_pm_2bit), 149 + .chip = { 150 + .base = S3C2410_GPH(0), 151 + .owner = THIS_MODULE, 152 + .label = "GPIOH", 153 + .ngpio = 11, 152 154 }, 153 155 }, 154 156 }; ··· 174 156 return 0; 175 157 } 176 158 177 - arch_initcall(s3c24xx_gpiolib_init); 159 + core_initcall(s3c24xx_gpiolib_init);
+7 -5
arch/arm/plat-s3c24xx/include/plat/dma.h arch/arm/plat-s3c24xx/include/plat/dma-plat.h
··· 1 - /* linux/include/asm-arm/plat-s3c24xx/dma.h 1 + /* linux/arch/arm/plat-s3c24xx/include/plat/dma-plat.h 2 2 * 3 3 * Copyright (C) 2006 Simtec Electronics 4 4 * Ben Dooks <ben@simtec.co.uk> ··· 10 10 * published by the Free Software Foundation. 11 11 */ 12 12 13 + #include <plat/dma-core.h> 14 + 13 15 extern struct sysdev_class dma_sysclass; 14 - extern struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS]; 16 + extern struct s3c2410_dma_chan s3c2410_chans[S3C_DMA_CHANNELS]; 15 17 16 18 #define DMA_CH_VALID (1<<31) 17 19 #define DMA_CH_NEVER (1<<30) ··· 33 31 const char *name; 34 32 struct s3c24xx_dma_addr hw_addr; 35 33 36 - unsigned long channels[S3C2410_DMA_CHANNELS]; 37 - unsigned long channels_rx[S3C2410_DMA_CHANNELS]; 34 + unsigned long channels[S3C_DMA_CHANNELS]; 35 + unsigned long channels_rx[S3C_DMA_CHANNELS]; 38 36 }; 39 37 40 38 struct s3c24xx_dma_selection { ··· 60 58 */ 61 59 62 60 struct s3c24xx_dma_order_ch { 63 - unsigned int list[S3C2410_DMA_CHANNELS]; /* list of channels */ 61 + unsigned int list[S3C_DMA_CHANNELS]; /* list of channels */ 64 62 unsigned int flags; /* flags */ 65 63 }; 66 64
-1
arch/arm/plat-s3c24xx/include/plat/map.h
··· 58 58 #define S3C24XX_SZ_SPI SZ_1M 59 59 #define S3C24XX_SZ_SDI SZ_1M 60 60 #define S3C24XX_SZ_NAND SZ_1M 61 - #define S3C24XX_SZ_USBHOST SZ_1M 62 61 63 62 /* GPIO ports */ 64 63
+5
arch/arm/plat-s3c24xx/include/plat/pm-core.h
··· 57 57 s3c_pm_show_resume_irqs(IRQ_EINT4-4, __raw_readl(S3C2410_EINTPEND), 58 58 s3c_irqwake_eintmask); 59 59 } 60 + 61 + static inline void s3c_pm_arch_update_uart(void __iomem *regs, 62 + struct pm_uart_save *save) 63 + { 64 + }
+145
arch/arm/plat-s3c24xx/include/plat/regs-dma.h
··· 1 + /* arch/arm/mach-s3c2410/include/mach/dma.h 2 + * 3 + * Copyright (C) 2003,2004,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)
+5 -217
arch/arm/plat-s3c24xx/pm.c
··· 30 30 #include <linux/suspend.h> 31 31 #include <linux/errno.h> 32 32 #include <linux/time.h> 33 + #include <linux/gpio.h> 33 34 #include <linux/interrupt.h> 34 35 #include <linux/serial_core.h> 35 36 #include <linux/io.h> ··· 76 75 SAVE_ITEM(S3C2410_CLKSLOW), 77 76 }; 78 77 79 - static struct gpio_sleep { 80 - void __iomem *base; 81 - unsigned int gpcon; 82 - unsigned int gpdat; 83 - unsigned int gpup; 84 - } gpio_save[] = { 85 - [0] = { 86 - .base = S3C2410_GPACON, 87 - }, 88 - [1] = { 89 - .base = S3C2410_GPBCON, 90 - }, 91 - [2] = { 92 - .base = S3C2410_GPCCON, 93 - }, 94 - [3] = { 95 - .base = S3C2410_GPDCON, 96 - }, 97 - [4] = { 98 - .base = S3C2410_GPECON, 99 - }, 100 - [5] = { 101 - .base = S3C2410_GPFCON, 102 - }, 103 - [6] = { 104 - .base = S3C2410_GPGCON, 105 - }, 106 - [7] = { 107 - .base = S3C2410_GPHCON, 108 - }, 109 - }; 110 - 111 78 static struct sleep_save misc_save[] = { 112 79 SAVE_ITEM(S3C2410_DCLKCON), 113 80 }; 114 - 115 81 116 82 /* s3c_pm_check_resume_pin 117 83 * ··· 124 156 * and then configure it as an input if it is not 125 157 */ 126 158 127 - for (pin = S3C2410_GPF0; pin <= S3C2410_GPF7; pin++) { 128 - s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF0); 159 + for (pin = S3C2410_GPF(0); pin <= S3C2410_GPF(7); pin++) { 160 + s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF(0)); 129 161 } 130 162 131 - for (pin = S3C2410_GPG0; pin <= S3C2410_GPG7; pin++) { 132 - s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG0)+8); 133 - } 134 - } 135 - 136 - /* offsets for CON/DAT/UP registers */ 137 - 138 - #define OFFS_CON (S3C2410_GPACON - S3C2410_GPACON) 139 - #define OFFS_DAT (S3C2410_GPADAT - S3C2410_GPACON) 140 - #define OFFS_UP (S3C2410_GPBUP - S3C2410_GPBCON) 141 - 142 - /* s3c_pm_save_gpios() 143 - * 144 - * Save the state of the GPIOs 145 - */ 146 - 147 - void s3c_pm_save_gpios(void) 148 - { 149 - struct gpio_sleep *gps = gpio_save; 150 - unsigned int gpio; 151 - 152 - for (gpio = 0; gpio < ARRAY_SIZE(gpio_save); gpio++, gps++) { 153 - void __iomem *base = gps->base; 154 - 155 - gps->gpcon = __raw_readl(base + OFFS_CON); 156 - gps->gpdat = __raw_readl(base + OFFS_DAT); 157 - 158 - if (gpio > 0) 159 - gps->gpup = __raw_readl(base + OFFS_UP); 160 - 163 + for (pin = S3C2410_GPG(0); pin <= S3C2410_GPG(7); pin++) { 164 + s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG(0))+8); 161 165 } 162 166 } 163 167 164 - /* Test whether the given masked+shifted bits of an GPIO configuration 165 - * are one of the SFN (special function) modes. */ 166 - 167 - static inline int is_sfn(unsigned long con) 168 - { 169 - return (con == 2 || con == 3); 170 - } 171 - 172 - /* Test if the given masked+shifted GPIO configuration is an input */ 173 - 174 - static inline int is_in(unsigned long con) 175 - { 176 - return con == 0; 177 - } 178 - 179 - /* Test if the given masked+shifted GPIO configuration is an output */ 180 - 181 - static inline int is_out(unsigned long con) 182 - { 183 - return con == 1; 184 - } 185 - 186 - /** 187 - * s3c2410_pm_restore_gpio() - restore the given GPIO bank 188 - * @index: The number of the GPIO bank being resumed. 189 - * @gps: The sleep confgiuration for the bank. 190 - * 191 - * Restore one of the GPIO banks that was saved during suspend. This is 192 - * not as simple as once thought, due to the possibility of glitches 193 - * from the order that the CON and DAT registers are set in. 194 - * 195 - * The three states the pin can be are {IN,OUT,SFN} which gives us 9 196 - * combinations of changes to check. Three of these, if the pin stays 197 - * in the same configuration can be discounted. This leaves us with 198 - * the following: 199 - * 200 - * { IN => OUT } Change DAT first 201 - * { IN => SFN } Change CON first 202 - * { OUT => SFN } Change CON first, so new data will not glitch 203 - * { OUT => IN } Change CON first, so new data will not glitch 204 - * { SFN => IN } Change CON first 205 - * { SFN => OUT } Change DAT first, so new data will not glitch [1] 206 - * 207 - * We do not currently deal with the UP registers as these control 208 - * weak resistors, so a small delay in change should not need to bring 209 - * these into the calculations. 210 - * 211 - * [1] this assumes that writing to a pin DAT whilst in SFN will set the 212 - * state for when it is next output. 213 - */ 214 - 215 - static void s3c2410_pm_restore_gpio(int index, struct gpio_sleep *gps) 216 - { 217 - void __iomem *base = gps->base; 218 - unsigned long gps_gpcon = gps->gpcon; 219 - unsigned long gps_gpdat = gps->gpdat; 220 - unsigned long old_gpcon; 221 - unsigned long old_gpdat; 222 - unsigned long old_gpup = 0x0; 223 - unsigned long gpcon; 224 - int nr; 225 - 226 - old_gpcon = __raw_readl(base + OFFS_CON); 227 - old_gpdat = __raw_readl(base + OFFS_DAT); 228 - 229 - if (base == S3C2410_GPACON) { 230 - /* GPACON only has one bit per control / data and no PULLUPs. 231 - * GPACON[x] = 0 => Output, 1 => SFN */ 232 - 233 - /* first set all SFN bits to SFN */ 234 - 235 - gpcon = old_gpcon | gps->gpcon; 236 - __raw_writel(gpcon, base + OFFS_CON); 237 - 238 - /* now set all the other bits */ 239 - 240 - __raw_writel(gps_gpdat, base + OFFS_DAT); 241 - __raw_writel(gps_gpcon, base + OFFS_CON); 242 - } else { 243 - unsigned long old, new, mask; 244 - unsigned long change_mask = 0x0; 245 - 246 - old_gpup = __raw_readl(base + OFFS_UP); 247 - 248 - /* Create a change_mask of all the items that need to have 249 - * their CON value changed before their DAT value, so that 250 - * we minimise the work between the two settings. 251 - */ 252 - 253 - for (nr = 0, mask = 0x03; nr < 32; nr += 2, mask <<= 2) { 254 - old = (old_gpcon & mask) >> nr; 255 - new = (gps_gpcon & mask) >> nr; 256 - 257 - /* If there is no change, then skip */ 258 - 259 - if (old == new) 260 - continue; 261 - 262 - /* If both are special function, then skip */ 263 - 264 - if (is_sfn(old) && is_sfn(new)) 265 - continue; 266 - 267 - /* Change is IN => OUT, do not change now */ 268 - 269 - if (is_in(old) && is_out(new)) 270 - continue; 271 - 272 - /* Change is SFN => OUT, do not change now */ 273 - 274 - if (is_sfn(old) && is_out(new)) 275 - continue; 276 - 277 - /* We should now be at the case of IN=>SFN, 278 - * OUT=>SFN, OUT=>IN, SFN=>IN. */ 279 - 280 - change_mask |= mask; 281 - } 282 - 283 - /* Write the new CON settings */ 284 - 285 - gpcon = old_gpcon & ~change_mask; 286 - gpcon |= gps_gpcon & change_mask; 287 - 288 - __raw_writel(gpcon, base + OFFS_CON); 289 - 290 - /* Now change any items that require DAT,CON */ 291 - 292 - __raw_writel(gps_gpdat, base + OFFS_DAT); 293 - __raw_writel(gps_gpcon, base + OFFS_CON); 294 - __raw_writel(gps->gpup, base + OFFS_UP); 295 - } 296 - 297 - S3C_PMDBG("GPIO[%d] CON %08lx => %08lx, DAT %08lx => %08lx\n", 298 - index, old_gpcon, gps_gpcon, old_gpdat, gps_gpdat); 299 - } 300 - 301 - 302 - /** s3c2410_pm_restore_gpios() 303 - * 304 - * Restore the state of the GPIOs 305 - */ 306 - 307 - void s3c_pm_restore_gpios(void) 308 - { 309 - struct gpio_sleep *gps = gpio_save; 310 - int gpio; 311 - 312 - for (gpio = 0; gpio < ARRAY_SIZE(gpio_save); gpio++, gps++) { 313 - s3c2410_pm_restore_gpio(gpio, gps); 314 - } 315 - } 316 168 317 169 void s3c_pm_restore_core(void) 318 170 {
+3 -2
arch/arm/plat-s3c24xx/setup-i2c.c
··· 11 11 */ 12 12 13 13 #include <linux/kernel.h> 14 + #include <linux/gpio.h> 14 15 15 16 struct platform_device; 16 17 ··· 21 20 22 21 void s3c_i2c0_cfg_gpio(struct platform_device *dev) 23 22 { 24 - s3c2410_gpio_cfgpin(S3C2410_GPE15, S3C2410_GPE15_IICSDA); 25 - s3c2410_gpio_cfgpin(S3C2410_GPE14, S3C2410_GPE14_IICSCL); 23 + s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA); 24 + s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL); 26 25 }
+10 -10
arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
··· 22 22 int enable) 23 23 { 24 24 if (enable) { 25 - s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPE13_SPICLK0); 26 - s3c2410_gpio_cfgpin(S3C2410_GPE12, S3C2410_GPE12_SPIMOSI0); 27 - s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPE11_SPIMISO0); 28 - s3c2410_gpio_pullup(S3C2410_GPE11, 0); 29 - s3c2410_gpio_pullup(S3C2410_GPE13, 0); 25 + s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0); 26 + s3c2410_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0); 27 + s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0); 28 + s3c2410_gpio_pullup(S3C2410_GPE(11), 0); 29 + s3c2410_gpio_pullup(S3C2410_GPE(13), 0); 30 30 } else { 31 - s3c2410_gpio_cfgpin(S3C2410_GPE13, S3C2410_GPIO_INPUT); 32 - s3c2410_gpio_cfgpin(S3C2410_GPE11, S3C2410_GPIO_INPUT); 33 - s3c2410_gpio_pullup(S3C2410_GPE11, 1); 34 - s3c2410_gpio_pullup(S3C2410_GPE12, 1); 35 - s3c2410_gpio_pullup(S3C2410_GPE13, 1); 31 + s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); 32 + s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); 33 + s3c2410_gpio_pullup(S3C2410_GPE(11), 1); 34 + s3c2410_gpio_pullup(S3C2410_GPE(12), 1); 35 + s3c2410_gpio_pullup(S3C2410_GPE(13), 1); 36 36 } 37 37 }
+10 -10
arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
··· 22 22 int enable) 23 23 { 24 24 if (enable) { 25 - s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPG7_SPICLK1); 26 - s3c2410_gpio_cfgpin(S3C2410_GPG6, S3C2410_GPG6_SPIMOSI1); 27 - s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPG5_SPIMISO1); 28 - s3c2410_gpio_pullup(S3C2410_GPG5, 0); 29 - s3c2410_gpio_pullup(S3C2410_GPG6, 0); 25 + s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1); 26 + s3c2410_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1); 27 + s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1); 28 + s3c2410_gpio_pullup(S3C2410_GPG(5), 0); 29 + s3c2410_gpio_pullup(S3C2410_GPG(6), 0); 30 30 } else { 31 - s3c2410_gpio_cfgpin(S3C2410_GPG7, S3C2410_GPIO_INPUT); 32 - s3c2410_gpio_cfgpin(S3C2410_GPG5, S3C2410_GPIO_INPUT); 33 - s3c2410_gpio_pullup(S3C2410_GPG5, 1); 34 - s3c2410_gpio_pullup(S3C2410_GPG6, 1); 35 - s3c2410_gpio_pullup(S3C2410_GPG7, 1); 31 + s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); 32 + s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); 33 + s3c2410_gpio_pullup(S3C2410_GPG(5), 1); 34 + s3c2410_gpio_pullup(S3C2410_GPG(6), 1); 35 + s3c2410_gpio_pullup(S3C2410_GPG(7), 1); 36 36 } 37 37 }
+10
arch/arm/plat-s3c64xx/Kconfig
··· 19 19 select S3C_GPIO_PULL_UPDOWN 20 20 select S3C_GPIO_CFG_S3C24XX 21 21 select S3C_GPIO_CFG_S3C64XX 22 + select USB_ARCH_HAS_OHCI 22 23 help 23 24 Base platform code for any Samsung S3C64XX device 24 25 ··· 38 37 help 39 38 Common clock support code for the S3C6400 that is shared 40 39 by other CPUs in the series, such as the S3C6410. 40 + 41 + config S3C64XX_DMA 42 + bool "S3C64XX DMA" 43 + select S3C_DMA 41 44 42 45 # platform specific device setup 43 46 ··· 63 58 bool 64 59 help 65 60 Common setup code for S3C64XX with an 24bpp RGB display helper. 61 + 62 + config S3C64XX_SETUP_SDHCI_GPIO 63 + bool 64 + help 65 + Common setup code for S3C64XX SDHCI GPIO configurations 66 66 67 67 endif
+11
arch/arm/plat-s3c64xx/Makefile
··· 24 24 obj-$(CONFIG_CPU_S3C6400_INIT) += s3c6400-init.o 25 25 obj-$(CONFIG_CPU_S3C6400_CLOCK) += s3c6400-clock.o 26 26 27 + # PM support 28 + 29 + obj-$(CONFIG_PM) += pm.o 30 + obj-$(CONFIG_PM) += sleep.o 31 + obj-$(CONFIG_PM) += irq-pm.o 32 + 33 + # DMA support 34 + 35 + obj-$(CONFIG_S3C64XX_DMA) += dma.o 36 + 27 37 # Device setup 28 38 29 39 obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o 30 40 obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o 31 41 obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o 42 + obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
+19
arch/arm/plat-s3c64xx/clock.c
··· 27 27 #include <plat/devs.h> 28 28 #include <plat/clock.h> 29 29 30 + struct clk clk_h2 = { 31 + .name = "hclk2", 32 + .id = -1, 33 + .rate = 0, 34 + }; 35 + 30 36 struct clk clk_27m = { 31 37 .name = "clk_27m", 32 38 .id = -1, ··· 158 152 .parent = &clk_48m, 159 153 .enable = s3c64xx_sclk_ctrl, 160 154 .ctrlbit = S3C_CLKCON_SCLK_MMC2_48, 155 + }, { 156 + .name = "dma0", 157 + .id = -1, 158 + .parent = &clk_h, 159 + .enable = s3c64xx_hclk_ctrl, 160 + .ctrlbit = S3C_CLKCON_HCLK_DMA0, 161 + }, { 162 + .name = "dma1", 163 + .id = -1, 164 + .parent = &clk_h, 165 + .enable = s3c64xx_hclk_ctrl, 166 + .ctrlbit = S3C_CLKCON_HCLK_DMA1, 161 167 }, 162 168 }; 163 169 ··· 264 246 &clk_epll, 265 247 &clk_27m, 266 248 &clk_48m, 249 + &clk_h2, 267 250 }; 268 251 269 252 void __init s3c64xx_register_clocks(void)
+32
arch/arm/plat-s3c64xx/cpu.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/interrupt.h> 18 18 #include <linux/ioport.h> 19 + #include <linux/sysdev.h> 19 20 #include <linux/serial_core.h> 20 21 #include <linux/platform_device.h> 21 22 #include <linux/io.h> ··· 102 101 .pfn = __phys_to_pfn(S3C64XX_PA_MODEM), 103 102 .length = SZ_4K, 104 103 .type = MT_DEVICE, 104 + }, { 105 + .virtual = (unsigned long)S3C_VA_WATCHDOG, 106 + .pfn = __phys_to_pfn(S3C64XX_PA_WATCHDOG), 107 + .length = SZ_4K, 108 + .type = MT_DEVICE, 105 109 }, 106 110 }; 111 + 112 + 113 + struct sysdev_class s3c64xx_sysclass = { 114 + .name = "s3c64xx-core", 115 + }; 116 + 117 + static struct sys_device s3c64xx_sysdev = { 118 + .cls = &s3c64xx_sysclass, 119 + }; 120 + 107 121 108 122 /* read cpu identification code */ 109 123 ··· 131 115 iotable_init(mach_desc, size); 132 116 133 117 idcode = __raw_readl(S3C_VA_SYS + 0x118); 118 + if (!idcode) { 119 + /* S3C6400 has the ID register in a different place, 120 + * and needs a write before it can be read. */ 121 + 122 + __raw_writel(0x0, S3C_VA_SYS + 0xA1C); 123 + idcode = __raw_readl(S3C_VA_SYS + 0xA1C); 124 + } 125 + 134 126 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); 135 127 } 128 + 129 + static __init int s3c64xx_sysdev_init(void) 130 + { 131 + sysdev_class_register(&s3c64xx_sysclass); 132 + return sysdev_register(&s3c64xx_sysdev); 133 + } 134 + 135 + core_initcall(s3c64xx_sysdev_init);
+722
arch/arm/plat-s3c64xx/dma.c
··· 1 + /* linux/arch/arm/plat-s3c64xx/dma.c 2 + * 3 + * Copyright 2009 Openmoko, Inc. 4 + * Copyright 2009 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C64XX DMA core 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 + #include <linux/kernel.h> 16 + #include <linux/module.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/dmapool.h> 19 + #include <linux/sysdev.h> 20 + #include <linux/errno.h> 21 + #include <linux/delay.h> 22 + #include <linux/clk.h> 23 + #include <linux/err.h> 24 + #include <linux/io.h> 25 + 26 + #include <mach/dma.h> 27 + #include <mach/map.h> 28 + #include <mach/irqs.h> 29 + 30 + #include <plat/dma-plat.h> 31 + #include <plat/regs-sys.h> 32 + 33 + #include <asm/hardware/pl080.h> 34 + 35 + /* dma channel state information */ 36 + 37 + struct s3c64xx_dmac { 38 + struct sys_device sysdev; 39 + struct clk *clk; 40 + void __iomem *regs; 41 + struct s3c2410_dma_chan *channels; 42 + enum dma_ch chanbase; 43 + }; 44 + 45 + /* pool to provide LLI buffers */ 46 + static struct dma_pool *dma_pool; 47 + 48 + /* Debug configuration and code */ 49 + 50 + static unsigned char debug_show_buffs = 0; 51 + 52 + static void dbg_showchan(struct s3c2410_dma_chan *chan) 53 + { 54 + pr_debug("DMA%d: %08x->%08x L %08x C %08x,%08x S %08x\n", 55 + chan->number, 56 + readl(chan->regs + PL080_CH_SRC_ADDR), 57 + readl(chan->regs + PL080_CH_DST_ADDR), 58 + readl(chan->regs + PL080_CH_LLI), 59 + readl(chan->regs + PL080_CH_CONTROL), 60 + readl(chan->regs + PL080S_CH_CONTROL2), 61 + readl(chan->regs + PL080S_CH_CONFIG)); 62 + } 63 + 64 + static void show_lli(struct pl080s_lli *lli) 65 + { 66 + pr_debug("LLI[%p] %08x->%08x, NL %08x C %08x,%08x\n", 67 + lli, lli->src_addr, lli->dst_addr, lli->next_lli, 68 + lli->control0, lli->control1); 69 + } 70 + 71 + static void dbg_showbuffs(struct s3c2410_dma_chan *chan) 72 + { 73 + struct s3c64xx_dma_buff *ptr; 74 + struct s3c64xx_dma_buff *end; 75 + 76 + pr_debug("DMA%d: buffs next %p, curr %p, end %p\n", 77 + chan->number, chan->next, chan->curr, chan->end); 78 + 79 + ptr = chan->next; 80 + end = chan->end; 81 + 82 + if (debug_show_buffs) { 83 + for (; ptr != NULL; ptr = ptr->next) { 84 + pr_debug("DMA%d: %08x ", 85 + chan->number, ptr->lli_dma); 86 + show_lli(ptr->lli); 87 + } 88 + } 89 + } 90 + 91 + /* End of Debug */ 92 + 93 + static struct s3c2410_dma_chan *s3c64xx_dma_map_channel(unsigned int channel) 94 + { 95 + struct s3c2410_dma_chan *chan; 96 + unsigned int start, offs; 97 + 98 + start = 0; 99 + 100 + if (channel >= DMACH_PCM1_TX) 101 + start = 8; 102 + 103 + for (offs = 0; offs < 8; offs++) { 104 + chan = &s3c2410_chans[start + offs]; 105 + if (!chan->in_use) 106 + goto found; 107 + } 108 + 109 + return NULL; 110 + 111 + found: 112 + s3c_dma_chan_map[channel] = chan; 113 + return chan; 114 + } 115 + 116 + int s3c2410_dma_config(unsigned int channel, int xferunit) 117 + { 118 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 119 + 120 + if (chan == NULL) 121 + return -EINVAL; 122 + 123 + switch (xferunit) { 124 + case 1: 125 + chan->hw_width = 0; 126 + break; 127 + case 2: 128 + chan->hw_width = 1; 129 + break; 130 + case 4: 131 + chan->hw_width = 2; 132 + break; 133 + default: 134 + printk(KERN_ERR "%s: illegal width %d\n", __func__, xferunit); 135 + return -EINVAL; 136 + } 137 + 138 + return 0; 139 + } 140 + EXPORT_SYMBOL(s3c2410_dma_config); 141 + 142 + static void s3c64xx_dma_fill_lli(struct s3c2410_dma_chan *chan, 143 + struct pl080s_lli *lli, 144 + dma_addr_t data, int size) 145 + { 146 + dma_addr_t src, dst; 147 + u32 control0, control1; 148 + 149 + switch (chan->source) { 150 + case S3C2410_DMASRC_HW: 151 + src = chan->dev_addr; 152 + dst = data; 153 + control0 = PL080_CONTROL_SRC_AHB2; 154 + control0 |= (u32)chan->hw_width << PL080_CONTROL_SWIDTH_SHIFT; 155 + control0 |= 2 << PL080_CONTROL_DWIDTH_SHIFT; 156 + control0 |= PL080_CONTROL_DST_INCR; 157 + break; 158 + 159 + case S3C2410_DMASRC_MEM: 160 + src = data; 161 + dst = chan->dev_addr; 162 + control0 = PL080_CONTROL_DST_AHB2; 163 + control0 |= (u32)chan->hw_width << PL080_CONTROL_DWIDTH_SHIFT; 164 + control0 |= 2 << PL080_CONTROL_SWIDTH_SHIFT; 165 + control0 |= PL080_CONTROL_SRC_INCR; 166 + break; 167 + default: 168 + BUG(); 169 + } 170 + 171 + /* note, we do not currently setup any of the burst controls */ 172 + 173 + control1 = size >> chan->hw_width; /* size in no of xfers */ 174 + control0 |= PL080_CONTROL_PROT_SYS; /* always in priv. mode */ 175 + control0 |= PL080_CONTROL_TC_IRQ_EN; /* always fire IRQ */ 176 + 177 + lli->src_addr = src; 178 + lli->dst_addr = dst; 179 + lli->next_lli = 0; 180 + lli->control0 = control0; 181 + lli->control1 = control1; 182 + } 183 + 184 + static void s3c64xx_lli_to_regs(struct s3c2410_dma_chan *chan, 185 + struct pl080s_lli *lli) 186 + { 187 + void __iomem *regs = chan->regs; 188 + 189 + pr_debug("%s: LLI %p => regs\n", __func__, lli); 190 + show_lli(lli); 191 + 192 + writel(lli->src_addr, regs + PL080_CH_SRC_ADDR); 193 + writel(lli->dst_addr, regs + PL080_CH_DST_ADDR); 194 + writel(lli->next_lli, regs + PL080_CH_LLI); 195 + writel(lli->control0, regs + PL080_CH_CONTROL); 196 + writel(lli->control1, regs + PL080S_CH_CONTROL2); 197 + } 198 + 199 + static int s3c64xx_dma_start(struct s3c2410_dma_chan *chan) 200 + { 201 + struct s3c64xx_dmac *dmac = chan->dmac; 202 + u32 config; 203 + u32 bit = chan->bit; 204 + 205 + dbg_showchan(chan); 206 + 207 + pr_debug("%s: clearing interrupts\n", __func__); 208 + 209 + /* clear interrupts */ 210 + writel(bit, dmac->regs + PL080_TC_CLEAR); 211 + writel(bit, dmac->regs + PL080_ERR_CLEAR); 212 + 213 + pr_debug("%s: starting channel\n", __func__); 214 + 215 + config = readl(chan->regs + PL080S_CH_CONFIG); 216 + config |= PL080_CONFIG_ENABLE; 217 + 218 + pr_debug("%s: writing config %08x\n", __func__, config); 219 + writel(config, chan->regs + PL080S_CH_CONFIG); 220 + 221 + return 0; 222 + } 223 + 224 + static int s3c64xx_dma_stop(struct s3c2410_dma_chan *chan) 225 + { 226 + u32 config; 227 + int timeout; 228 + 229 + pr_debug("%s: stopping channel\n", __func__); 230 + 231 + dbg_showchan(chan); 232 + 233 + config = readl(chan->regs + PL080S_CH_CONFIG); 234 + config |= PL080_CONFIG_HALT; 235 + writel(config, chan->regs + PL080S_CH_CONFIG); 236 + 237 + timeout = 1000; 238 + do { 239 + config = readl(chan->regs + PL080S_CH_CONFIG); 240 + pr_debug("%s: %d - config %08x\n", __func__, timeout, config); 241 + if (config & PL080_CONFIG_ACTIVE) 242 + udelay(10); 243 + else 244 + break; 245 + } while (--timeout > 0); 246 + 247 + if (config & PL080_CONFIG_ACTIVE) { 248 + printk(KERN_ERR "%s: channel still active\n", __func__); 249 + return -EFAULT; 250 + } 251 + 252 + config = readl(chan->regs + PL080S_CH_CONFIG); 253 + config &= ~PL080_CONFIG_ENABLE; 254 + writel(config, chan->regs + PL080S_CH_CONFIG); 255 + 256 + return 0; 257 + } 258 + 259 + static inline void s3c64xx_dma_bufffdone(struct s3c2410_dma_chan *chan, 260 + struct s3c64xx_dma_buff *buf, 261 + enum s3c2410_dma_buffresult result) 262 + { 263 + if (chan->callback_fn != NULL) 264 + (chan->callback_fn)(chan, buf->pw, 0, result); 265 + } 266 + 267 + static void s3c64xx_dma_freebuff(struct s3c64xx_dma_buff *buff) 268 + { 269 + dma_pool_free(dma_pool, buff->lli, buff->lli_dma); 270 + kfree(buff); 271 + } 272 + 273 + static int s3c64xx_dma_flush(struct s3c2410_dma_chan *chan) 274 + { 275 + struct s3c64xx_dma_buff *buff, *next; 276 + u32 config; 277 + 278 + dbg_showchan(chan); 279 + 280 + pr_debug("%s: flushing channel\n", __func__); 281 + 282 + config = readl(chan->regs + PL080S_CH_CONFIG); 283 + config &= ~PL080_CONFIG_ENABLE; 284 + writel(config, chan->regs + PL080S_CH_CONFIG); 285 + 286 + /* dump all the buffers associated with this channel */ 287 + 288 + for (buff = chan->curr; buff != NULL; buff = next) { 289 + next = buff->next; 290 + pr_debug("%s: buff %p (next %p)\n", __func__, buff, buff->next); 291 + 292 + s3c64xx_dma_bufffdone(chan, buff, S3C2410_RES_ABORT); 293 + s3c64xx_dma_freebuff(buff); 294 + } 295 + 296 + chan->curr = chan->next = chan->end = NULL; 297 + 298 + return 0; 299 + } 300 + 301 + int s3c2410_dma_ctrl(unsigned int channel, enum s3c2410_chan_op op) 302 + { 303 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 304 + 305 + WARN_ON(!chan); 306 + if (!chan) 307 + return -EINVAL; 308 + 309 + switch (op) { 310 + case S3C2410_DMAOP_START: 311 + return s3c64xx_dma_start(chan); 312 + 313 + case S3C2410_DMAOP_STOP: 314 + return s3c64xx_dma_stop(chan); 315 + 316 + case S3C2410_DMAOP_FLUSH: 317 + return s3c64xx_dma_flush(chan); 318 + 319 + /* belive PAUSE/RESUME are no-ops */ 320 + case S3C2410_DMAOP_PAUSE: 321 + case S3C2410_DMAOP_RESUME: 322 + case S3C2410_DMAOP_STARTED: 323 + case S3C2410_DMAOP_TIMEOUT: 324 + return 0; 325 + } 326 + 327 + return -ENOENT; 328 + } 329 + EXPORT_SYMBOL(s3c2410_dma_ctrl); 330 + 331 + /* s3c2410_dma_enque 332 + * 333 + */ 334 + 335 + int s3c2410_dma_enqueue(unsigned int channel, void *id, 336 + dma_addr_t data, int size) 337 + { 338 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 339 + struct s3c64xx_dma_buff *next; 340 + struct s3c64xx_dma_buff *buff; 341 + struct pl080s_lli *lli; 342 + int ret; 343 + 344 + WARN_ON(!chan); 345 + if (!chan) 346 + return -EINVAL; 347 + 348 + buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL); 349 + if (!buff) { 350 + printk(KERN_ERR "%s: no memory for buffer\n", __func__); 351 + return -ENOMEM; 352 + } 353 + 354 + lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma); 355 + if (!lli) { 356 + printk(KERN_ERR "%s: no memory for lli\n", __func__); 357 + ret = -ENOMEM; 358 + goto err_buff; 359 + } 360 + 361 + pr_debug("%s: buff %p, dp %08x lli (%p, %08x) %d\n", 362 + __func__, buff, data, lli, (u32)buff->lli_dma, size); 363 + 364 + buff->lli = lli; 365 + buff->pw = id; 366 + 367 + s3c64xx_dma_fill_lli(chan, lli, data, size); 368 + 369 + if ((next = chan->next) != NULL) { 370 + struct s3c64xx_dma_buff *end = chan->end; 371 + struct pl080s_lli *endlli = end->lli; 372 + 373 + pr_debug("enquing onto channel\n"); 374 + 375 + end->next = buff; 376 + endlli->next_lli = buff->lli_dma; 377 + 378 + if (chan->flags & S3C2410_DMAF_CIRCULAR) { 379 + struct s3c64xx_dma_buff *curr = chan->curr; 380 + lli->next_lli = curr->lli_dma; 381 + } 382 + 383 + if (next == chan->curr) { 384 + writel(buff->lli_dma, chan->regs + PL080_CH_LLI); 385 + chan->next = buff; 386 + } 387 + 388 + show_lli(endlli); 389 + chan->end = buff; 390 + } else { 391 + pr_debug("enquing onto empty channel\n"); 392 + 393 + chan->curr = buff; 394 + chan->next = buff; 395 + chan->end = buff; 396 + 397 + s3c64xx_lli_to_regs(chan, lli); 398 + } 399 + 400 + show_lli(lli); 401 + 402 + dbg_showchan(chan); 403 + dbg_showbuffs(chan); 404 + return 0; 405 + 406 + err_buff: 407 + kfree(buff); 408 + return ret; 409 + } 410 + 411 + EXPORT_SYMBOL(s3c2410_dma_enqueue); 412 + 413 + 414 + int s3c2410_dma_devconfig(int channel, 415 + enum s3c2410_dmasrc source, 416 + unsigned long devaddr) 417 + { 418 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 419 + u32 peripheral; 420 + u32 config = 0; 421 + 422 + pr_debug("%s: channel %d, source %d, dev %08lx, chan %p\n", 423 + __func__, channel, source, devaddr, chan); 424 + 425 + WARN_ON(!chan); 426 + if (!chan) 427 + return -EINVAL; 428 + 429 + peripheral = (chan->peripheral & 0xf); 430 + chan->source = source; 431 + chan->dev_addr = devaddr; 432 + 433 + pr_debug("%s: peripheral %d\n", __func__, peripheral); 434 + 435 + switch (source) { 436 + case S3C2410_DMASRC_HW: 437 + config = 2 << PL080_CONFIG_FLOW_CONTROL_SHIFT; 438 + config |= peripheral << PL080_CONFIG_SRC_SEL_SHIFT; 439 + break; 440 + case S3C2410_DMASRC_MEM: 441 + config = 1 << PL080_CONFIG_FLOW_CONTROL_SHIFT; 442 + config |= peripheral << PL080_CONFIG_DST_SEL_SHIFT; 443 + break; 444 + default: 445 + printk(KERN_ERR "%s: bad source\n", __func__); 446 + return -EINVAL; 447 + } 448 + 449 + /* allow TC and ERR interrupts */ 450 + config |= PL080_CONFIG_TC_IRQ_MASK; 451 + config |= PL080_CONFIG_ERR_IRQ_MASK; 452 + 453 + pr_debug("%s: config %08x\n", __func__, config); 454 + 455 + writel(config, chan->regs + PL080S_CH_CONFIG); 456 + 457 + return 0; 458 + } 459 + EXPORT_SYMBOL(s3c2410_dma_devconfig); 460 + 461 + 462 + int s3c2410_dma_getposition(unsigned int channel, 463 + dma_addr_t *src, dma_addr_t *dst) 464 + { 465 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 466 + 467 + WARN_ON(!chan); 468 + if (!chan) 469 + return -EINVAL; 470 + 471 + if (src != NULL) 472 + *src = readl(chan->regs + PL080_CH_SRC_ADDR); 473 + 474 + if (dst != NULL) 475 + *dst = readl(chan->regs + PL080_CH_DST_ADDR); 476 + 477 + return 0; 478 + } 479 + EXPORT_SYMBOL(s3c2410_dma_getposition); 480 + 481 + /* s3c2410_request_dma 482 + * 483 + * get control of an dma channel 484 + */ 485 + 486 + int s3c2410_dma_request(unsigned int channel, 487 + struct s3c2410_dma_client *client, 488 + void *dev) 489 + { 490 + struct s3c2410_dma_chan *chan; 491 + unsigned long flags; 492 + 493 + pr_debug("dma%d: s3c2410_request_dma: client=%s, dev=%p\n", 494 + channel, client->name, dev); 495 + 496 + local_irq_save(flags); 497 + 498 + chan = s3c64xx_dma_map_channel(channel); 499 + if (chan == NULL) { 500 + local_irq_restore(flags); 501 + return -EBUSY; 502 + } 503 + 504 + dbg_showchan(chan); 505 + 506 + chan->client = client; 507 + chan->in_use = 1; 508 + chan->peripheral = channel; 509 + 510 + local_irq_restore(flags); 511 + 512 + /* need to setup */ 513 + 514 + pr_debug("%s: channel initialised, %p\n", __func__, chan); 515 + 516 + return chan->number | DMACH_LOW_LEVEL; 517 + } 518 + 519 + EXPORT_SYMBOL(s3c2410_dma_request); 520 + 521 + /* s3c2410_dma_free 522 + * 523 + * release the given channel back to the system, will stop and flush 524 + * any outstanding transfers, and ensure the channel is ready for the 525 + * next claimant. 526 + * 527 + * Note, although a warning is currently printed if the freeing client 528 + * info is not the same as the registrant's client info, the free is still 529 + * allowed to go through. 530 + */ 531 + 532 + int s3c2410_dma_free(unsigned int channel, struct s3c2410_dma_client *client) 533 + { 534 + struct s3c2410_dma_chan *chan = s3c_dma_lookup_channel(channel); 535 + unsigned long flags; 536 + 537 + if (chan == NULL) 538 + return -EINVAL; 539 + 540 + local_irq_save(flags); 541 + 542 + if (chan->client != client) { 543 + printk(KERN_WARNING "dma%d: possible free from different client (channel %p, passed %p)\n", 544 + channel, chan->client, client); 545 + } 546 + 547 + /* sort out stopping and freeing the channel */ 548 + 549 + 550 + chan->client = NULL; 551 + chan->in_use = 0; 552 + 553 + if (!(channel & DMACH_LOW_LEVEL)) 554 + s3c_dma_chan_map[channel] = NULL; 555 + 556 + local_irq_restore(flags); 557 + 558 + return 0; 559 + } 560 + 561 + EXPORT_SYMBOL(s3c2410_dma_free); 562 + 563 + 564 + static void s3c64xx_dma_tcirq(struct s3c64xx_dmac *dmac, int offs) 565 + { 566 + struct s3c2410_dma_chan *chan = dmac->channels + offs; 567 + 568 + /* note, we currently do not bother to work out which buffer 569 + * or buffers have been completed since the last tc-irq. */ 570 + 571 + if (chan->callback_fn) 572 + (chan->callback_fn)(chan, chan->curr->pw, 0, S3C2410_RES_OK); 573 + } 574 + 575 + static void s3c64xx_dma_errirq(struct s3c64xx_dmac *dmac, int offs) 576 + { 577 + printk(KERN_DEBUG "%s: offs %d\n", __func__, offs); 578 + } 579 + 580 + static irqreturn_t s3c64xx_dma_irq(int irq, void *pw) 581 + { 582 + struct s3c64xx_dmac *dmac = pw; 583 + u32 tcstat, errstat; 584 + u32 bit; 585 + int offs; 586 + 587 + tcstat = readl(dmac->regs + PL080_TC_STATUS); 588 + errstat = readl(dmac->regs + PL080_ERR_STATUS); 589 + 590 + for (offs = 0, bit = 1; offs < 8; offs++, bit <<= 1) { 591 + if (tcstat & bit) { 592 + writel(bit, dmac->regs + PL080_TC_CLEAR); 593 + s3c64xx_dma_tcirq(dmac, offs); 594 + } 595 + 596 + if (errstat & bit) { 597 + s3c64xx_dma_errirq(dmac, offs); 598 + writel(bit, dmac->regs + PL080_ERR_CLEAR); 599 + } 600 + } 601 + 602 + return IRQ_HANDLED; 603 + } 604 + 605 + static struct sysdev_class dma_sysclass = { 606 + .name = "s3c64xx-dma", 607 + }; 608 + 609 + static int s3c64xx_dma_init1(int chno, enum dma_ch chbase, 610 + int irq, unsigned int base) 611 + { 612 + struct s3c2410_dma_chan *chptr = &s3c2410_chans[chno]; 613 + struct s3c64xx_dmac *dmac; 614 + char clkname[16]; 615 + void __iomem *regs; 616 + void __iomem *regptr; 617 + int err, ch; 618 + 619 + dmac = kzalloc(sizeof(struct s3c64xx_dmac), GFP_KERNEL); 620 + if (!dmac) { 621 + printk(KERN_ERR "%s: failed to alloc mem\n", __func__); 622 + return -ENOMEM; 623 + } 624 + 625 + dmac->sysdev.id = chno / 8; 626 + dmac->sysdev.cls = &dma_sysclass; 627 + 628 + err = sysdev_register(&dmac->sysdev); 629 + if (err) { 630 + printk(KERN_ERR "%s: failed to register sysdevice\n", __func__); 631 + goto err_alloc; 632 + } 633 + 634 + regs = ioremap(base, 0x200); 635 + if (!regs) { 636 + printk(KERN_ERR "%s: failed to ioremap()\n", __func__); 637 + err = -ENXIO; 638 + goto err_dev; 639 + } 640 + 641 + snprintf(clkname, sizeof(clkname), "dma%d", dmac->sysdev.id); 642 + 643 + dmac->clk = clk_get(NULL, clkname); 644 + if (IS_ERR(dmac->clk)) { 645 + printk(KERN_ERR "%s: failed to get clock %s\n", __func__, clkname); 646 + err = PTR_ERR(dmac->clk); 647 + goto err_map; 648 + } 649 + 650 + clk_enable(dmac->clk); 651 + 652 + dmac->regs = regs; 653 + dmac->chanbase = chbase; 654 + dmac->channels = chptr; 655 + 656 + err = request_irq(irq, s3c64xx_dma_irq, 0, "DMA", dmac); 657 + if (err < 0) { 658 + printk(KERN_ERR "%s: failed to get irq\n", __func__); 659 + goto err_clk; 660 + } 661 + 662 + regptr = regs + PL080_Cx_BASE(0); 663 + 664 + for (ch = 0; ch < 8; ch++, chno++, chptr++) { 665 + printk(KERN_INFO "%s: registering DMA %d (%p)\n", 666 + __func__, chno, regptr); 667 + 668 + chptr->bit = 1 << ch; 669 + chptr->number = chno; 670 + chptr->dmac = dmac; 671 + chptr->regs = regptr; 672 + regptr += PL008_Cx_STRIDE; 673 + } 674 + 675 + /* for the moment, permanently enable the controller */ 676 + writel(PL080_CONFIG_ENABLE, regs + PL080_CONFIG); 677 + 678 + printk(KERN_INFO "PL080: IRQ %d, at %p\n", irq, regs); 679 + 680 + return 0; 681 + 682 + err_clk: 683 + clk_disable(dmac->clk); 684 + clk_put(dmac->clk); 685 + err_map: 686 + iounmap(regs); 687 + err_dev: 688 + sysdev_unregister(&dmac->sysdev); 689 + err_alloc: 690 + kfree(dmac); 691 + return err; 692 + } 693 + 694 + static int __init s3c64xx_dma_init(void) 695 + { 696 + int ret; 697 + 698 + printk(KERN_INFO "%s: Registering DMA channels\n", __func__); 699 + 700 + dma_pool = dma_pool_create("DMA-LLI", NULL, 32, 16, 0); 701 + if (!dma_pool) { 702 + printk(KERN_ERR "%s: failed to create pool\n", __func__); 703 + return -ENOMEM; 704 + } 705 + 706 + ret = sysdev_class_register(&dma_sysclass); 707 + if (ret) { 708 + printk(KERN_ERR "%s: failed to create sysclass\n", __func__); 709 + return -ENOMEM; 710 + } 711 + 712 + /* Set all DMA configuration to be DMA, not SDMA */ 713 + writel(0xffffff, S3C_SYSREG(0x110)); 714 + 715 + /* Register standard DMA controlers */ 716 + s3c64xx_dma_init1(0, DMACH_UART0, IRQ_DMA0, 0x75000000); 717 + s3c64xx_dma_init1(8, DMACH_PCM1_TX, IRQ_DMA1, 0x75100000); 718 + 719 + return 0; 720 + } 721 + 722 + arch_initcall(s3c64xx_dma_init);
+9 -1
arch/arm/plat-s3c64xx/gpiolib.c
··· 385 385 { 386 386 chip->chip.direction_input = s3c64xx_gpiolib_4bit_input; 387 387 chip->chip.direction_output = s3c64xx_gpiolib_4bit_output; 388 + chip->pm = __gpio_pm(&s3c_gpio_pm_4bit); 388 389 } 389 390 390 391 static __init void s3c64xx_gpiolib_add_4bit2(struct s3c_gpio_chip *chip) 391 392 { 392 393 chip->chip.direction_input = s3c64xx_gpiolib_4bit2_input; 393 394 chip->chip.direction_output = s3c64xx_gpiolib_4bit2_output; 395 + chip->pm = __gpio_pm(&s3c_gpio_pm_4bit); 396 + } 397 + 398 + static __init void s3c64xx_gpiolib_add_2bit(struct s3c_gpio_chip *chip) 399 + { 400 + chip->pm = __gpio_pm(&s3c_gpio_pm_2bit); 394 401 } 395 402 396 403 static __init void s3c64xx_gpiolib_add(struct s3c_gpio_chip *chips, ··· 419 412 s3c64xx_gpiolib_add(gpio_4bit2, ARRAY_SIZE(gpio_4bit2), 420 413 s3c64xx_gpiolib_add_4bit2); 421 414 422 - s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit), NULL); 415 + s3c64xx_gpiolib_add(gpio_2bit, ARRAY_SIZE(gpio_2bit), 416 + s3c64xx_gpiolib_add_2bit); 423 417 424 418 return 0; 425 419 }
+70
arch/arm/plat-s3c64xx/include/plat/dma-plat.h
··· 1 + /* linux/arch/arm/plat-s3c64xx/include/plat/dma-plat.h 2 + * 3 + * Copyright 2009 Openmoko, Inc. 4 + * Copyright 2009 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C64XX DMA core 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 + #define DMACH_LOW_LEVEL (1<<28) /* use this to specifiy hardware ch no */ 16 + 17 + struct s3c64xx_dma_buff; 18 + 19 + /** s3c64xx_dma_buff - S3C64XX DMA buffer descriptor 20 + * @next: Pointer to next buffer in queue or ring. 21 + * @pw: Client provided identifier 22 + * @lli: Pointer to hardware descriptor this buffer is associated with. 23 + * @lli_dma: Hardare address of the descriptor. 24 + */ 25 + struct s3c64xx_dma_buff { 26 + struct s3c64xx_dma_buff *next; 27 + 28 + void *pw; 29 + struct pl080_lli *lli; 30 + dma_addr_t lli_dma; 31 + }; 32 + 33 + struct s3c64xx_dmac; 34 + 35 + struct s3c2410_dma_chan { 36 + unsigned char number; /* number of this dma channel */ 37 + unsigned char in_use; /* channel allocated */ 38 + unsigned char bit; /* bit for enable/disable/etc */ 39 + unsigned char hw_width; 40 + unsigned char peripheral; 41 + 42 + unsigned int flags; 43 + enum s3c2410_dmasrc source; 44 + 45 + 46 + dma_addr_t dev_addr; 47 + 48 + struct s3c2410_dma_client *client; 49 + struct s3c64xx_dmac *dmac; /* pointer to controller */ 50 + 51 + void __iomem *regs; 52 + 53 + /* cdriver callbacks */ 54 + s3c2410_dma_cbfn_t callback_fn; /* buffer done callback */ 55 + s3c2410_dma_opfn_t op_fn; /* channel op callback */ 56 + 57 + /* buffer list and information */ 58 + struct s3c64xx_dma_buff *curr; /* current dma buffer */ 59 + struct s3c64xx_dma_buff *next; /* next buffer to load */ 60 + struct s3c64xx_dma_buff *end; /* end of queue */ 61 + 62 + /* note, when channel is running in circular mode, curr is the 63 + * first buffer enqueued, end is the last and curr is where the 64 + * last buffer-done event is set-at. The buffers are not freed 65 + * and the last buffer hardware descriptor points back to the 66 + * first. 67 + */ 68 + }; 69 + 70 + #include <plat/dma-core.h>
+1
arch/arm/plat-s3c64xx/include/plat/irqs.h
··· 157 157 158 158 #define S3C_EINT(x) ((x) + S3C_IRQ_EINT_BASE) 159 159 #define IRQ_EINT(x) S3C_EINT(x) 160 + #define IRQ_EINT_BIT(x) ((x) - S3C_EINT(0)) 160 161 161 162 /* Next the external interrupt groups. These are similar to the IRQ_EINT(x) 162 163 * that they are sourced from the GPIO pins but with a different scheme for
+98
arch/arm/plat-s3c64xx/include/plat/pm-core.h
··· 1 + /* linux/arch/arm/plat-s3c64xx/include/plat/pm-core.h 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C64XX - PM core support for arch/arm/plat-s3c/pm.c 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 + #include <plat/regs-gpio.h> 16 + 17 + static inline void s3c_pm_debug_init_uart(void) 18 + { 19 + u32 tmp = __raw_readl(S3C_PCLK_GATE); 20 + 21 + /* As a note, since the S3C64XX UARTs generally have multiple 22 + * clock sources, we simply enable PCLK at the moment and hope 23 + * that the resume settings for the UART are suitable for the 24 + * use with PCLK. 25 + */ 26 + 27 + tmp |= S3C_CLKCON_PCLK_UART0; 28 + tmp |= S3C_CLKCON_PCLK_UART1; 29 + tmp |= S3C_CLKCON_PCLK_UART2; 30 + tmp |= S3C_CLKCON_PCLK_UART3; 31 + 32 + __raw_writel(tmp, S3C_PCLK_GATE); 33 + udelay(10); 34 + } 35 + 36 + static inline void s3c_pm_arch_prepare_irqs(void) 37 + { 38 + /* VIC should have already been taken care of */ 39 + 40 + /* clear any pending EINT0 interrupts */ 41 + __raw_writel(__raw_readl(S3C64XX_EINT0PEND), S3C64XX_EINT0PEND); 42 + } 43 + 44 + static inline void s3c_pm_arch_stop_clocks(void) 45 + { 46 + } 47 + 48 + static inline void s3c_pm_arch_show_resume_irqs(void) 49 + { 50 + } 51 + 52 + /* make these defines, we currently do not have any need to change 53 + * the IRQ wake controls depending on the CPU we are running on */ 54 + 55 + #define s3c_irqwake_eintallow ((1 << 28) - 1) 56 + #define s3c_irqwake_intallow (0) 57 + 58 + static inline void s3c_pm_arch_update_uart(void __iomem *regs, 59 + struct pm_uart_save *save) 60 + { 61 + u32 ucon = __raw_readl(regs + S3C2410_UCON); 62 + u32 ucon_clk = ucon & S3C6400_UCON_CLKMASK; 63 + u32 save_clk = save->ucon & S3C6400_UCON_CLKMASK; 64 + u32 new_ucon; 65 + u32 delta; 66 + 67 + /* S3C64XX UART blocks only support level interrupts, so ensure that 68 + * when we restore unused UART blocks we force the level interrupt 69 + * settigs. */ 70 + save->ucon |= S3C2410_UCON_TXILEVEL | S3C2410_UCON_RXILEVEL; 71 + 72 + /* We have a constraint on changing the clock type of the UART 73 + * between UCLKx and PCLK, so ensure that when we restore UCON 74 + * that the CLK field is correctly modified if the bootloader 75 + * has changed anything. 76 + */ 77 + if (ucon_clk != save_clk) { 78 + new_ucon = save->ucon; 79 + delta = ucon_clk ^ save_clk; 80 + 81 + /* change from UCLKx => wrong PCLK, 82 + * either UCLK can be tested for by a bit-test 83 + * with UCLK0 */ 84 + if (ucon_clk & S3C6400_UCON_UCLK0 && 85 + !(save_clk & S3C6400_UCON_UCLK0) && 86 + delta & S3C6400_UCON_PCLK2) { 87 + new_ucon &= ~S3C6400_UCON_UCLK0; 88 + } else if (delta == S3C6400_UCON_PCLK2) { 89 + /* as an precaution, don't change from 90 + * PCLK2 => PCLK or vice-versa */ 91 + new_ucon ^= S3C6400_UCON_PCLK2; 92 + } 93 + 94 + S3C_PMDBG("ucon change %04x => %04x (save=%04x)\n", 95 + ucon, new_ucon, save->ucon); 96 + save->ucon = new_ucon; 97 + } 98 + }
+1
arch/arm/plat-s3c64xx/include/plat/regs-clock.h
··· 32 32 #define S3C_HCLK_GATE S3C_CLKREG(0x30) 33 33 #define S3C_PCLK_GATE S3C_CLKREG(0x34) 34 34 #define S3C_SCLK_GATE S3C_CLKREG(0x38) 35 + #define S3C_MEM0_GATE S3C_CLKREG(0x3C) 35 36 36 37 /* CLKDIV0 */ 37 38 #define S3C6400_CLKDIV0_MFC_MASK (0xf << 28)
+2 -1
arch/arm/plat-s3c64xx/include/plat/s3c6400.h
··· 15 15 /* Common init code for S3C6400 related SoCs */ 16 16 17 17 extern void s3c6400_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); 18 - extern void s3c6400_register_clocks(void); 18 + extern void s3c6400_register_clocks(unsigned armclk_divlimit); 19 19 extern void s3c6400_setup_clocks(void); 20 20 21 21 #ifdef CONFIG_CPU_S3C6400 22 22 23 23 extern int s3c6400_init(void); 24 + extern void s3c6400_init_irq(void); 24 25 extern void s3c6400_map_io(void); 25 26 extern void s3c6400_init_clocks(int xtal); 26 27
+3
arch/arm/plat-s3c64xx/irq-eint.c
··· 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/interrupt.h> 17 + #include <linux/sysdev.h> 17 18 #include <linux/gpio.h> 18 19 #include <linux/irq.h> 19 20 #include <linux/io.h> ··· 27 26 28 27 #include <mach/map.h> 29 28 #include <plat/cpu.h> 29 + #include <plat/pm.h> 30 30 31 31 #define eint_offset(irq) ((irq) - IRQ_EINT(0)) 32 32 #define eint_irq_to_bit(irq) (1 << eint_offset(irq)) ··· 136 134 .mask_ack = s3c_irq_eint_maskack, 137 135 .ack = s3c_irq_eint_ack, 138 136 .set_type = s3c_irq_eint_set_type, 137 + .set_wake = s3c_irqext_wake, 139 138 }; 140 139 141 140 /* s3c_irq_demux_eint
+111
arch/arm/plat-s3c64xx/irq-pm.c
··· 1 + /* arch/arm/plat-s3c64xx/irq-pm.c 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C64XX - Interrupt handling Power Management 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 + #include <linux/kernel.h> 16 + #include <linux/sysdev.h> 17 + #include <linux/interrupt.h> 18 + #include <linux/serial_core.h> 19 + #include <linux/irq.h> 20 + #include <linux/io.h> 21 + 22 + #include <mach/map.h> 23 + 24 + #include <plat/regs-serial.h> 25 + #include <plat/regs-timer.h> 26 + #include <plat/regs-gpio.h> 27 + #include <plat/cpu.h> 28 + #include <plat/pm.h> 29 + 30 + /* We handled all the IRQ types in this code, to save having to make several 31 + * small files to handle each different type separately. Having the EINT_GRP 32 + * code here shouldn't be as much bloat as the IRQ table space needed when 33 + * they are enabled. The added benefit is we ensure that these registers are 34 + * in the same state as we suspended. 35 + */ 36 + 37 + static struct sleep_save irq_save[] = { 38 + SAVE_ITEM(S3C64XX_PRIORITY), 39 + SAVE_ITEM(S3C64XX_EINT0CON0), 40 + SAVE_ITEM(S3C64XX_EINT0CON1), 41 + SAVE_ITEM(S3C64XX_EINT0FLTCON0), 42 + SAVE_ITEM(S3C64XX_EINT0FLTCON1), 43 + SAVE_ITEM(S3C64XX_EINT0FLTCON2), 44 + SAVE_ITEM(S3C64XX_EINT0FLTCON3), 45 + SAVE_ITEM(S3C64XX_EINT0MASK), 46 + SAVE_ITEM(S3C64XX_TINT_CSTAT), 47 + }; 48 + 49 + static struct irq_grp_save { 50 + u32 fltcon; 51 + u32 con; 52 + u32 mask; 53 + } eint_grp_save[5]; 54 + 55 + static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; 56 + 57 + static int s3c64xx_irq_pm_suspend(struct sys_device *dev, pm_message_t state) 58 + { 59 + struct irq_grp_save *grp = eint_grp_save; 60 + int i; 61 + 62 + S3C_PMDBG("%s: suspending IRQs\n", __func__); 63 + 64 + s3c_pm_do_save(irq_save, ARRAY_SIZE(irq_save)); 65 + 66 + for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 67 + irq_uart_mask[i] = __raw_readl(S3C_VA_UARTx(i) + S3C64XX_UINTM); 68 + 69 + for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 70 + grp->con = __raw_readl(S3C64XX_EINT12CON + (i * 4)); 71 + grp->mask = __raw_readl(S3C64XX_EINT12MASK + (i * 4)); 72 + grp->fltcon = __raw_readl(S3C64XX_EINT12FLTCON + (i * 4)); 73 + } 74 + 75 + return 0; 76 + } 77 + 78 + static int s3c64xx_irq_pm_resume(struct sys_device *dev) 79 + { 80 + struct irq_grp_save *grp = eint_grp_save; 81 + int i; 82 + 83 + S3C_PMDBG("%s: resuming IRQs\n", __func__); 84 + 85 + s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 86 + 87 + for (i = 0; i < CONFIG_SERIAL_SAMSUNG_UARTS; i++) 88 + __raw_writel(irq_uart_mask[i], S3C_VA_UARTx(i) + S3C64XX_UINTM); 89 + 90 + for (i = 0; i < ARRAY_SIZE(eint_grp_save); i++, grp++) { 91 + __raw_writel(grp->con, S3C64XX_EINT12CON + (i * 4)); 92 + __raw_writel(grp->mask, S3C64XX_EINT12MASK + (i * 4)); 93 + __raw_writel(grp->fltcon, S3C64XX_EINT12FLTCON + (i * 4)); 94 + } 95 + 96 + S3C_PMDBG("%s: IRQ configuration restored\n", __func__); 97 + return 0; 98 + } 99 + 100 + static struct sysdev_driver s3c64xx_irq_driver = { 101 + .suspend = s3c64xx_irq_pm_suspend, 102 + .resume = s3c64xx_irq_pm_resume, 103 + }; 104 + 105 + static int __init s3c64xx_irq_pm_init(void) 106 + { 107 + return sysdev_driver_register(&s3c64xx_sysclass, &s3c64xx_irq_driver); 108 + } 109 + 110 + arch_initcall(s3c64xx_irq_pm_init); 111 +
+4 -5
arch/arm/plat-s3c64xx/irq.c
··· 14 14 15 15 #include <linux/kernel.h> 16 16 #include <linux/interrupt.h> 17 + #include <linux/serial_core.h> 17 18 #include <linux/irq.h> 18 19 #include <linux/io.h> 19 20 20 21 #include <asm/hardware/vic.h> 21 22 22 23 #include <mach/map.h> 24 + #include <plat/regs-serial.h> 23 25 #include <plat/regs-timer.h> 24 26 #include <plat/cpu.h> 25 27 ··· 137 135 } 138 136 139 137 /* UART interrupt registers, not worth adding to seperate include header */ 140 - #define S3C64XX_UINTP 0x30 141 - #define S3C64XX_UINTSP 0x34 142 - #define S3C64XX_UINTM 0x38 143 138 144 139 static void s3c_irq_uart_mask(unsigned int irq) 145 140 { ··· 232 233 printk(KERN_DEBUG "%s: initialising interrupts\n", __func__); 233 234 234 235 /* initialise the pair of VICs */ 235 - vic_init(S3C_VA_VIC0, S3C_VIC0_BASE, vic0_valid); 236 - vic_init(S3C_VA_VIC1, S3C_VIC1_BASE, vic1_valid); 236 + vic_init(S3C_VA_VIC0, S3C_VIC0_BASE, vic0_valid, 0); 237 + vic_init(S3C_VA_VIC1, S3C_VIC1_BASE, vic1_valid, 0); 237 238 238 239 /* add the timer sub-irqs */ 239 240
+175
arch/arm/plat-s3c64xx/pm.c
··· 1 + /* linux/arch/arm/plat-s3c64xx/pm.c 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C64XX CPU PM support. 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 + #include <linux/init.h> 16 + #include <linux/suspend.h> 17 + #include <linux/serial_core.h> 18 + #include <linux/io.h> 19 + 20 + #include <mach/map.h> 21 + 22 + #include <plat/pm.h> 23 + #include <plat/regs-sys.h> 24 + #include <plat/regs-gpio.h> 25 + #include <plat/regs-clock.h> 26 + #include <plat/regs-syscon-power.h> 27 + #include <plat/regs-gpio-memport.h> 28 + 29 + #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 30 + #include <plat/gpio-bank-n.h> 31 + 32 + void s3c_pm_debug_smdkled(u32 set, u32 clear) 33 + { 34 + unsigned long flags; 35 + u32 reg; 36 + 37 + local_irq_save(flags); 38 + reg = __raw_readl(S3C64XX_GPNCON); 39 + reg &= ~(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) | 40 + S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15)); 41 + reg |= S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) | 42 + S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15); 43 + __raw_writel(reg, S3C64XX_GPNCON); 44 + 45 + reg = __raw_readl(S3C64XX_GPNDAT); 46 + reg &= ~(clear << 12); 47 + reg |= set << 12; 48 + __raw_writel(reg, S3C64XX_GPNDAT); 49 + 50 + local_irq_restore(flags); 51 + } 52 + #endif 53 + 54 + static struct sleep_save core_save[] = { 55 + SAVE_ITEM(S3C_APLL_LOCK), 56 + SAVE_ITEM(S3C_MPLL_LOCK), 57 + SAVE_ITEM(S3C_EPLL_LOCK), 58 + SAVE_ITEM(S3C_CLK_SRC), 59 + SAVE_ITEM(S3C_CLK_DIV0), 60 + SAVE_ITEM(S3C_CLK_DIV1), 61 + SAVE_ITEM(S3C_CLK_DIV2), 62 + SAVE_ITEM(S3C_CLK_OUT), 63 + SAVE_ITEM(S3C_HCLK_GATE), 64 + SAVE_ITEM(S3C_PCLK_GATE), 65 + SAVE_ITEM(S3C_SCLK_GATE), 66 + SAVE_ITEM(S3C_MEM0_GATE), 67 + 68 + SAVE_ITEM(S3C_EPLL_CON1), 69 + SAVE_ITEM(S3C_EPLL_CON0), 70 + 71 + SAVE_ITEM(S3C64XX_MEM0DRVCON), 72 + SAVE_ITEM(S3C64XX_MEM1DRVCON), 73 + 74 + #ifndef CONFIG_CPU_FREQ 75 + SAVE_ITEM(S3C_APLL_CON), 76 + SAVE_ITEM(S3C_MPLL_CON), 77 + #endif 78 + }; 79 + 80 + static struct sleep_save misc_save[] = { 81 + SAVE_ITEM(S3C64XX_AHB_CON0), 82 + SAVE_ITEM(S3C64XX_AHB_CON1), 83 + SAVE_ITEM(S3C64XX_AHB_CON2), 84 + 85 + SAVE_ITEM(S3C64XX_SPCON), 86 + 87 + SAVE_ITEM(S3C64XX_MEM0CONSTOP), 88 + SAVE_ITEM(S3C64XX_MEM1CONSTOP), 89 + SAVE_ITEM(S3C64XX_MEM0CONSLP0), 90 + SAVE_ITEM(S3C64XX_MEM0CONSLP1), 91 + SAVE_ITEM(S3C64XX_MEM1CONSLP), 92 + }; 93 + 94 + void s3c_pm_configure_extint(void) 95 + { 96 + __raw_writel(s3c_irqwake_eintmask, S3C64XX_EINT_MASK); 97 + } 98 + 99 + void s3c_pm_restore_core(void) 100 + { 101 + __raw_writel(0, S3C64XX_EINT_MASK); 102 + 103 + s3c_pm_debug_smdkled(1 << 2, 0); 104 + 105 + s3c_pm_do_restore_core(core_save, ARRAY_SIZE(core_save)); 106 + s3c_pm_do_restore(misc_save, ARRAY_SIZE(misc_save)); 107 + } 108 + 109 + void s3c_pm_save_core(void) 110 + { 111 + s3c_pm_do_save(misc_save, ARRAY_SIZE(misc_save)); 112 + s3c_pm_do_save(core_save, ARRAY_SIZE(core_save)); 113 + } 114 + 115 + /* since both s3c6400 and s3c6410 share the same sleep pm calls, we 116 + * put the per-cpu code in here until any new cpu comes along and changes 117 + * this. 118 + */ 119 + 120 + #include <plat/regs-gpio.h> 121 + 122 + static void s3c64xx_cpu_suspend(void) 123 + { 124 + unsigned long tmp; 125 + 126 + /* set our standby method to sleep */ 127 + 128 + tmp = __raw_readl(S3C64XX_PWR_CFG); 129 + tmp &= ~S3C64XX_PWRCFG_CFG_WFI_MASK; 130 + tmp |= S3C64XX_PWRCFG_CFG_WFI_SLEEP; 131 + __raw_writel(tmp, S3C64XX_PWR_CFG); 132 + 133 + /* clear any old wakeup */ 134 + 135 + __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), 136 + S3C64XX_WAKEUP_STAT); 137 + 138 + /* set the LED state to 0110 over sleep */ 139 + s3c_pm_debug_smdkled(3 << 1, 0xf); 140 + 141 + /* issue the standby signal into the pm unit. Note, we 142 + * issue a write-buffer drain just in case */ 143 + 144 + tmp = 0; 145 + 146 + asm("b 1f\n\t" 147 + ".align 5\n\t" 148 + "1:\n\t" 149 + "mcr p15, 0, %0, c7, c10, 5\n\t" 150 + "mcr p15, 0, %0, c7, c10, 4\n\t" 151 + "mcr p15, 0, %0, c7, c0, 4" :: "r" (tmp)); 152 + 153 + /* we should never get past here */ 154 + 155 + panic("sleep resumed to originator?"); 156 + } 157 + 158 + static void s3c64xx_pm_prepare(void) 159 + { 160 + /* store address of resume. */ 161 + __raw_writel(virt_to_phys(s3c_cpu_resume), S3C64XX_INFORM0); 162 + 163 + /* ensure previous wakeup state is cleared before sleeping */ 164 + __raw_writel(__raw_readl(S3C64XX_WAKEUP_STAT), S3C64XX_WAKEUP_STAT); 165 + } 166 + 167 + static int s3c64xx_pm_init(void) 168 + { 169 + pm_cpu_prep = s3c64xx_pm_prepare; 170 + pm_cpu_sleep = s3c64xx_cpu_suspend; 171 + pm_uart_udivslot = 1; 172 + return 0; 173 + } 174 + 175 + arch_initcall(s3c64xx_pm_init);
+105 -1
arch/arm/plat-s3c64xx/s3c6400-clock.c
··· 133 133 .sources = &clk_src_mpll, 134 134 }; 135 135 136 + static unsigned int armclk_mask; 137 + 138 + static unsigned long s3c64xx_clk_arm_get_rate(struct clk *clk) 139 + { 140 + unsigned long rate = clk_get_rate(clk->parent); 141 + u32 clkdiv; 142 + 143 + /* divisor mask starts at bit0, so no need to shift */ 144 + clkdiv = __raw_readl(S3C_CLK_DIV0) & armclk_mask; 145 + 146 + return rate / (clkdiv + 1); 147 + } 148 + 149 + static unsigned long s3c64xx_clk_arm_round_rate(struct clk *clk, 150 + unsigned long rate) 151 + { 152 + unsigned long parent = clk_get_rate(clk->parent); 153 + u32 div; 154 + 155 + if (parent < rate) 156 + return rate; 157 + 158 + div = (parent / rate) - 1; 159 + if (div > armclk_mask) 160 + div = armclk_mask; 161 + 162 + return parent / (div + 1); 163 + } 164 + 165 + static int s3c64xx_clk_arm_set_rate(struct clk *clk, unsigned long rate) 166 + { 167 + unsigned long parent = clk_get_rate(clk->parent); 168 + u32 div; 169 + u32 val; 170 + 171 + if (rate < parent / (armclk_mask + 1)) 172 + return -EINVAL; 173 + 174 + rate = clk_round_rate(clk, rate); 175 + div = clk_get_rate(clk->parent) / rate; 176 + 177 + val = __raw_readl(S3C_CLK_DIV0); 178 + val &= armclk_mask; 179 + val |= (div - 1); 180 + __raw_writel(val, S3C_CLK_DIV0); 181 + 182 + return 0; 183 + 184 + } 185 + 186 + static struct clk clk_arm = { 187 + .name = "armclk", 188 + .id = -1, 189 + .parent = &clk_mout_apll.clk, 190 + .get_rate = s3c64xx_clk_arm_get_rate, 191 + .set_rate = s3c64xx_clk_arm_set_rate, 192 + .round_rate = s3c64xx_clk_arm_round_rate, 193 + }; 194 + 136 195 static unsigned long s3c64xx_clk_doutmpll_get_rate(struct clk *clk) 137 196 { 138 197 unsigned long rate = clk_get_rate(clk->parent); ··· 579 520 .reg_divider = S3C_CLK_DIV2, 580 521 }; 581 522 523 + static struct clk *clkset_camif_list[] = { 524 + &clk_h2, 525 + }; 526 + 527 + static struct clk_sources clkset_camif = { 528 + .sources = clkset_camif_list, 529 + .nr_sources = ARRAY_SIZE(clkset_camif_list), 530 + }; 531 + 532 + static struct clksrc_clk clk_camif = { 533 + .clk = { 534 + .name = "camera", 535 + .id = -1, 536 + .ctrlbit = S3C_CLKCON_SCLK_CAM, 537 + .enable = s3c64xx_sclk_ctrl, 538 + .set_parent = s3c64xx_setparent_clksrc, 539 + .get_rate = s3c64xx_getrate_clksrc, 540 + .set_rate = s3c64xx_setrate_clksrc, 541 + .round_rate = s3c64xx_roundrate_clksrc, 542 + }, 543 + .shift = 0, 544 + .mask = 0, 545 + .sources = &clkset_camif, 546 + .divider_shift = S3C6400_CLKDIV0_CAM_SHIFT, 547 + .reg_divider = S3C_CLK_DIV0, 548 + }; 549 + 582 550 /* Clock initialisation code */ 583 551 584 552 static struct clksrc_clk *init_parents[] = { ··· 622 536 &clk_audio0, 623 537 &clk_audio1, 624 538 &clk_irda, 539 + &clk_camif, 625 540 }; 626 541 627 542 static void __init_or_cpufreq s3c6400_set_clksrc(struct clksrc_clk *clk) ··· 695 608 clk_fout_epll.rate = epll; 696 609 clk_fout_apll.rate = apll; 697 610 611 + clk_h2.rate = hclk2; 698 612 clk_h.rate = hclk; 699 613 clk_p.rate = pclk; 700 614 clk_f.rate = fclk; ··· 723 635 &clk_audio0.clk, 724 636 &clk_audio1.clk, 725 637 &clk_irda.clk, 638 + &clk_camif.clk, 639 + &clk_arm, 726 640 }; 727 641 728 - void __init s3c6400_register_clocks(void) 642 + /** 643 + * s3c6400_register_clocks - register clocks for s3c6400 and above 644 + * @armclk_divlimit: Divisor mask for ARMCLK 645 + * 646 + * Register the clocks for the S3C6400 and above SoC range, such 647 + * as ARMCLK and the clocks which have divider chains attached. 648 + * 649 + * This call does not setup the clocks, which is left to the 650 + * s3c6400_setup_clocks() call which may be needed by the cpufreq 651 + * or resume code to re-set the clocks if the bootloader has changed 652 + * them. 653 + */ 654 + void __init s3c6400_register_clocks(unsigned armclk_divlimit) 729 655 { 730 656 struct clk *clkp; 731 657 int ret; 732 658 int ptr; 659 + 660 + armclk_mask = armclk_divlimit; 733 661 734 662 for (ptr = 0; ptr < ARRAY_SIZE(clks); ptr++) { 735 663 clkp = clks[ptr];
+55
arch/arm/plat-s3c64xx/setup-sdhci-gpio.c
··· 1 + /* linux/arch/arm/plat-s3c64xx/setup-sdhci-gpio.c 2 + * 3 + * Copyright 2008 Simtec Electronics 4 + * Ben Dooks <ben@simtec.co.uk> 5 + * http://armlinux.simtec.co.uk/ 6 + * 7 + * S3C64XX - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) 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 <linux/kernel.h> 15 + #include <linux/types.h> 16 + #include <linux/interrupt.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/io.h> 19 + 20 + #include <mach/gpio.h> 21 + #include <plat/gpio-cfg.h> 22 + 23 + void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) 24 + { 25 + unsigned int gpio; 26 + unsigned int end; 27 + 28 + end = S3C64XX_GPG(2 + width); 29 + 30 + /* Set all the necessary GPG pins to special-function 0 */ 31 + for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) { 32 + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 33 + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 34 + } 35 + 36 + s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); 37 + s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2)); 38 + } 39 + 40 + void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) 41 + { 42 + unsigned int gpio; 43 + unsigned int end; 44 + 45 + end = S3C64XX_GPH(2 + width); 46 + 47 + /* Set all the necessary GPG pins to special-function 0 */ 48 + for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) { 49 + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); 50 + s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 51 + } 52 + 53 + s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP); 54 + s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3)); 55 + }
+144
arch/arm/plat-s3c64xx/sleep.S
··· 1 + /* linux/0arch/arm/plat-s3c64xx/sleep.S 2 + * 3 + * Copyright 2008 Openmoko, Inc. 4 + * Copyright 2008 Simtec Electronics 5 + * Ben Dooks <ben@simtec.co.uk> 6 + * http://armlinux.simtec.co.uk/ 7 + * 8 + * S3C64XX CPU sleep code 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 + #include <linux/linkage.h> 16 + #include <asm/assembler.h> 17 + #include <mach/map.h> 18 + 19 + #undef S3C64XX_VA_GPIO 20 + #define S3C64XX_VA_GPIO (0x0) 21 + 22 + #include <plat/regs-gpio.h> 23 + #include <plat/gpio-bank-n.h> 24 + 25 + #define LL_UART (S3C_PA_UART + (0x400 * CONFIG_S3C_LOWLEVEL_UART_PORT)) 26 + 27 + .text 28 + 29 + /* s3c_cpu_save 30 + * 31 + * Save enough processor state to allow the restart of the pm.c 32 + * code after resume. 33 + * 34 + * entry: 35 + * r0 = pointer to the save block 36 + */ 37 + 38 + ENTRY(s3c_cpu_save) 39 + stmfd sp!, { r4 - r12, lr } 40 + 41 + mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID 42 + mrc p15, 0, r5, c3, c0, 0 @ Domain ID 43 + mrc p15, 0, r6, c2, c0, 0 @ Translation Table BASE0 44 + mrc p15, 0, r7, c2, c0, 1 @ Translation Table BASE1 45 + mrc p15, 0, r8, c2, c0, 2 @ Translation Table Control 46 + mrc p15, 0, r9, c1, c0, 0 @ Control register 47 + mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register 48 + mrc p15, 0, r11, c1, c0, 2 @ Co-processor access controls 49 + 50 + stmia r0, { r4 - r13 } @ Save CP registers and SP 51 + 52 + @@ save our state to ram 53 + bl s3c_pm_cb_flushcache 54 + 55 + @@ call final suspend code 56 + ldr r0, =pm_cpu_sleep 57 + ldr pc, [r0] 58 + 59 + @@ return to the caller, after the MMU is turned on. 60 + @@ restore the last bits of the stack and return. 61 + resume_with_mmu: 62 + ldmfd sp!, { r4 - r12, pc } @ return, from sp from s3c_cpu_save 63 + 64 + .data 65 + 66 + /* the next bit is code, but it requires easy access to the 67 + * s3c_sleep_save_phys data before the MMU is switched on, so 68 + * we store the code that needs this variable in the .data where 69 + * the value can be written to (the .text segment is RO). 70 + */ 71 + 72 + .global s3c_sleep_save_phys 73 + s3c_sleep_save_phys: 74 + .word 0 75 + 76 + /* Sleep magic, the word before the resume entry point so that the 77 + * bootloader can check for a resumeable image. */ 78 + 79 + .word 0x2bedf00d 80 + 81 + /* s3c_cpu_reusme 82 + * 83 + * This is the entry point, stored by whatever method the bootloader 84 + * requires to get the kernel runnign again. This code expects to be 85 + * entered with no caches live and the MMU disabled. It will then 86 + * restore the MMU and other basic CP registers saved and restart 87 + * the kernel C code to finish the resume code. 88 + */ 89 + 90 + ENTRY(s3c_cpu_resume) 91 + msr cpsr_c, #PSR_I_BIT | PSR_F_BIT | SVC_MODE 92 + ldr r2, =LL_UART /* for debug */ 93 + 94 + #ifdef CONFIG_S3C_PM_DEBUG_LED_SMDK 95 + /* Initialise the GPIO state if we are debugging via the SMDK LEDs, 96 + * as the uboot version supplied resets these to inputs during the 97 + * resume checks. 98 + */ 99 + 100 + ldr r3, =S3C64XX_PA_GPIO 101 + ldr r0, [ r3, #S3C64XX_GPNCON ] 102 + bic r0, r0, #(S3C64XX_GPN_CONMASK(12) | S3C64XX_GPN_CONMASK(13) | \ 103 + S3C64XX_GPN_CONMASK(14) | S3C64XX_GPN_CONMASK(15)) 104 + orr r0, r0, #(S3C64XX_GPN_OUTPUT(12) | S3C64XX_GPN_OUTPUT(13) | \ 105 + S3C64XX_GPN_OUTPUT(14) | S3C64XX_GPN_OUTPUT(15)) 106 + str r0, [ r3, #S3C64XX_GPNCON ] 107 + 108 + ldr r0, [ r3, #S3C64XX_GPNDAT ] 109 + bic r0, r0, #0xf << 12 @ GPN12..15 110 + orr r0, r0, #1 << 15 @ GPN15 111 + str r0, [ r3, #S3C64XX_GPNDAT ] 112 + #endif 113 + 114 + /* __v6_setup from arch/arm/mm/proc-v6.S, ensure that the caches 115 + * are thoroughly cleaned just in case the bootloader didn't do it 116 + * for us. */ 117 + mov r0, #0 118 + mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache 119 + mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache 120 + mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache 121 + mcr p15, 0, r0, c7, c10, 4 @ drain write buffer 122 + @@mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs 123 + @@mcr p15, 0, r0, c7, c7, 0 @ Invalidate I + D caches 124 + 125 + ldr r0, s3c_sleep_save_phys 126 + ldmia r0, { r4 - r13 } 127 + 128 + mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID 129 + mcr p15, 0, r5, c3, c0, 0 @ Domain ID 130 + mcr p15, 0, r6, c2, c0, 0 @ Translation Table BASE0 131 + mcr p15, 0, r7, c2, c0, 1 @ Translation Table BASE1 132 + mcr p15, 0, r8, c2, c0, 2 @ Translation Table Control 133 + mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register 134 + 135 + mov r0, #0 @ restore copro access controls 136 + mcr p15, 0, r11, c1, c0, 2 @ Co-processor access controls 137 + mcr p15, 0, r0, c7, c5, 4 138 + 139 + ldr r2, =resume_with_mmu 140 + mcr p15, 0, r9, c1, c0, 0 /* turn mmu back on */ 141 + nop 142 + mov pc, r2 /* jump back */ 143 + 144 + .end
+2
drivers/leds/leds-h1940.c
··· 16 16 #include <linux/string.h> 17 17 #include <linux/ctype.h> 18 18 #include <linux/leds.h> 19 + #include <linux/gpio.h> 20 + 19 21 #include <mach/regs-gpio.h> 20 22 #include <mach/hardware.h> 21 23 #include <mach/h1940-latch.h>
+1
drivers/leds/leds-s3c24xx.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/leds.h> 18 + #include <linux/gpio.h> 18 19 19 20 #include <mach/hardware.h> 20 21 #include <mach/regs-gpio.h>
+3 -2
drivers/mmc/host/s3cmci.c
··· 17 17 #include <linux/mmc/host.h> 18 18 #include <linux/platform_device.h> 19 19 #include <linux/cpufreq.h> 20 + #include <linux/gpio.h> 20 21 #include <linux/irq.h> 21 22 #include <linux/io.h> 22 23 ··· 790 789 791 790 last_source = source; 792 791 793 - s3c2410_dma_devconfig(host->dma, source, 3, 792 + s3c2410_dma_devconfig(host->dma, source, 794 793 host->mem->start + host->sdidata); 795 794 796 795 if (!setup_ok) { ··· 1122 1121 case MMC_POWER_OFF: 1123 1122 default: 1124 1123 s3c2410_gpio_setpin(S3C2410_GPE5, 0); 1125 - s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2410_GPE5_OUTP); 1124 + s3c2410_gpio_cfgpin(S3C2410_GPE5, S3C2410_GPIO_OUTPUT); 1126 1125 1127 1126 if (host->is2440) 1128 1127 mci_con |= S3C2440_SDICON_SDRESET;
+1
drivers/spi/spi_s3c24xx_gpio.c
··· 17 17 #include <linux/spinlock.h> 18 18 #include <linux/workqueue.h> 19 19 #include <linux/platform_device.h> 20 + #include <linux/gpio.h> 20 21 21 22 #include <linux/spi/spi.h> 22 23 #include <linux/spi/spi_bitbang.h>
+1
sound/soc/s3c24xx/s3c2412-i2s.c
··· 20 20 #include <linux/module.h> 21 21 #include <linux/device.h> 22 22 #include <linux/delay.h> 23 + #include <linux/gpio.h> 23 24 #include <linux/clk.h> 24 25 #include <linux/kernel.h> 25 26 #include <linux/io.h>
+1
sound/soc/s3c24xx/s3c2443-ac97.c
··· 19 19 #include <linux/io.h> 20 20 #include <linux/wait.h> 21 21 #include <linux/delay.h> 22 + #include <linux/gpio.h> 22 23 #include <linux/clk.h> 23 24 24 25 #include <sound/core.h>
+2
sound/soc/s3c24xx/s3c24xx-i2s.c
··· 21 21 #include <linux/clk.h> 22 22 #include <linux/jiffies.h> 23 23 #include <linux/io.h> 24 + #include <linux/gpio.h> 25 + 24 26 #include <sound/core.h> 25 27 #include <sound/pcm.h> 26 28 #include <sound/pcm_params.h>
+7 -14
sound/soc/s3c24xx/s3c24xx-pcm.c
··· 218 218 * sync to pclk, half-word transfers to the IIS-FIFO. */ 219 219 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { 220 220 s3c2410_dma_devconfig(prtd->params->channel, 221 - S3C2410_DMASRC_MEM, S3C2410_DISRCC_INC | 222 - S3C2410_DISRCC_APB, prtd->params->dma_addr); 223 - 224 - s3c2410_dma_config(prtd->params->channel, 225 - prtd->params->dma_size, 226 - S3C2410_DCON_SYNC_PCLK | 227 - S3C2410_DCON_HANDSHAKE); 221 + S3C2410_DMASRC_MEM, 222 + prtd->params->dma_addr); 228 223 } else { 229 - s3c2410_dma_config(prtd->params->channel, 230 - prtd->params->dma_size, 231 - S3C2410_DCON_HANDSHAKE | 232 - S3C2410_DCON_SYNC_PCLK); 233 - 234 224 s3c2410_dma_devconfig(prtd->params->channel, 235 - S3C2410_DMASRC_HW, 0x3, 236 - prtd->params->dma_addr); 225 + S3C2410_DMASRC_HW, 226 + prtd->params->dma_addr); 237 227 } 228 + 229 + s3c2410_dma_config(prtd->params->channel, 230 + prtd->params->dma_size); 238 231 239 232 /* flush the DMA channel */ 240 233 s3c2410_dma_ctrl(prtd->params->channel, S3C2410_DMAOP_FLUSH);