Merge branch 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm

* 'devel-stable' of master.kernel.org:/home/rmk/linux-2.6-arm: (161 commits)
ARM: pxa: fix building issue of missing physmap.h
ARM: mmp: PXA910 drive strength FAST using wrong value
ARM: mmp: MMP2 drive strength FAST using wrong value
ARM: pxa: fix recursive calls in pxa_low_gpio_chip
AT91: Support for gsia18s board
AT91: Acme Systems FOX Board G20 board files
AT91: board-sam9m10g45ek.c: Remove duplicate inclusion of mach/hardware.h
ARM: pxa: fix suspend/resume array index miscalculation
ARM: pxa: use cpu_has_ipr() consistently in irq.c
ARM: pxa: remove unused variable in clock-pxa3xx.c
ARM: pxa: fix warning in zeus.c
ARM: sa1111: fix typo in sa1111_retrigger_lowirq()
ARM mxs: clkdev related compile fixes
ARM i.MX mx31_3ds: Fix MC13783 regulator names
ARM: plat-stmp3xxx: irq_data conversion.
ARM: plat-spear: irq_data conversion.
ARM: plat-orion: irq_data conversion.
ARM: plat-omap: irq_data conversion.
ARM: plat-nomadik: irq_data conversion.
ARM: plat-mxc: irq_data conversion.
...

Fix up trivial conflict in arch/arm/plat-omap/gpio.c (Lennert
Buytenhek's irq_data conversion clashing with some omap irq updates)

+6534 -2397
+4 -17
arch/arm/Kconfig
··· 26 select HAVE_REGS_AND_STACK_ACCESS_API 27 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) 28 select HAVE_C_RECORDMCOUNT 29 help 30 The ARM series is a line of low-power-consumption RISC chip designs 31 licensed by ARM Ltd and targeted at embedded applications and ··· 98 laptops. It is a bus system similar to PCI or ISA. See 99 <file:Documentation/mca.txt> (and especially the web page given 100 there) before attempting to build an MCA bus kernel. 101 - 102 - config GENERIC_HARDIRQS 103 - bool 104 - default y 105 106 config STACKTRACE_SUPPORT 107 bool ··· 177 178 config ARCH_MTD_XIP 179 bool 180 - 181 - config GENERIC_HARDIRQS_NO__DO_IRQ 182 - def_bool y 183 184 config ARM_L1_CACHE_SHIFT_6 185 bool ··· 363 bool "Freescale MXS-based" 364 select GENERIC_CLOCKEVENTS 365 select ARCH_REQUIRE_GPIOLIB 366 - select COMMON_CLKDEV 367 help 368 Support for Freescale MXS-based family of processors 369 ··· 766 select ARCH_SPARSEMEM_ENABLE 767 select GENERIC_GPIO 768 select HAVE_CLK 769 select GENERIC_CLOCKEVENTS 770 select HAVE_S3C_RTC if RTC_CLASS 771 select HAVE_S3C2410_I2C if I2C ··· 1447 help 1448 Enable hardware performance counter support for perf events. If 1449 disabled, perf events will use software events only. 1450 - 1451 - config SPARSE_IRQ 1452 - def_bool n 1453 - help 1454 - This enables support for sparse irqs. This is useful in general 1455 - as most CPUs have a fairly sparse array of IRQ vectors, which 1456 - the irq_desc then maps directly on to. Systems with a high 1457 - number of off-chip IRQs will want to treat this as 1458 - experimental until they have been independently verified. 1459 1460 source "mm/Kconfig" 1461
··· 26 select HAVE_REGS_AND_STACK_ACCESS_API 27 select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V7)) 28 select HAVE_C_RECORDMCOUNT 29 + select HAVE_GENERIC_HARDIRQS 30 + select HAVE_SPARSE_IRQ 31 help 32 The ARM series is a line of low-power-consumption RISC chip designs 33 licensed by ARM Ltd and targeted at embedded applications and ··· 96 laptops. It is a bus system similar to PCI or ISA. See 97 <file:Documentation/mca.txt> (and especially the web page given 98 there) before attempting to build an MCA bus kernel. 99 100 config STACKTRACE_SUPPORT 101 bool ··· 179 180 config ARCH_MTD_XIP 181 bool 182 183 config ARM_L1_CACHE_SHIFT_6 184 bool ··· 368 bool "Freescale MXS-based" 369 select GENERIC_CLOCKEVENTS 370 select ARCH_REQUIRE_GPIOLIB 371 + select CLKDEV_LOOKUP 372 help 373 Support for Freescale MXS-based family of processors 374 ··· 771 select ARCH_SPARSEMEM_ENABLE 772 select GENERIC_GPIO 773 select HAVE_CLK 774 + select ARCH_HAS_CPUFREQ 775 select GENERIC_CLOCKEVENTS 776 select HAVE_S3C_RTC if RTC_CLASS 777 select HAVE_S3C2410_I2C if I2C ··· 1451 help 1452 Enable hardware performance counter support for perf events. If 1453 disabled, perf events will use software events only. 1454 1455 source "mm/Kconfig" 1456
+33 -33
arch/arm/common/gic.c
··· 50 51 static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly; 52 53 - static inline void __iomem *gic_dist_base(unsigned int irq) 54 { 55 - struct gic_chip_data *gic_data = get_irq_chip_data(irq); 56 return gic_data->dist_base; 57 } 58 59 - static inline void __iomem *gic_cpu_base(unsigned int irq) 60 { 61 - struct gic_chip_data *gic_data = get_irq_chip_data(irq); 62 return gic_data->cpu_base; 63 } 64 65 - static inline unsigned int gic_irq(unsigned int irq) 66 { 67 - struct gic_chip_data *gic_data = get_irq_chip_data(irq); 68 - return irq - gic_data->irq_offset; 69 } 70 71 /* 72 * Routines to acknowledge, disable and enable interrupts 73 */ 74 - static void gic_ack_irq(unsigned int irq) 75 { 76 - 77 spin_lock(&irq_controller_lock); 78 - writel(gic_irq(irq), gic_cpu_base(irq) + GIC_CPU_EOI); 79 spin_unlock(&irq_controller_lock); 80 } 81 82 - static void gic_mask_irq(unsigned int irq) 83 { 84 - u32 mask = 1 << (irq % 32); 85 86 spin_lock(&irq_controller_lock); 87 - writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_CLEAR + (gic_irq(irq) / 32) * 4); 88 spin_unlock(&irq_controller_lock); 89 } 90 91 - static void gic_unmask_irq(unsigned int irq) 92 { 93 - u32 mask = 1 << (irq % 32); 94 95 spin_lock(&irq_controller_lock); 96 - writel(mask, gic_dist_base(irq) + GIC_DIST_ENABLE_SET + (gic_irq(irq) / 32) * 4); 97 spin_unlock(&irq_controller_lock); 98 } 99 100 - static int gic_set_type(unsigned int irq, unsigned int type) 101 { 102 - void __iomem *base = gic_dist_base(irq); 103 - unsigned int gicirq = gic_irq(irq); 104 u32 enablemask = 1 << (gicirq % 32); 105 u32 enableoff = (gicirq / 32) * 4; 106 u32 confmask = 0x2 << ((gicirq % 16) * 2); ··· 142 } 143 144 #ifdef CONFIG_SMP 145 - static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val) 146 { 147 - void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3); 148 - unsigned int shift = (irq % 4) * 8; 149 unsigned int cpu = cpumask_first(mask_val); 150 u32 val; 151 struct irq_desc *desc; 152 153 spin_lock(&irq_controller_lock); 154 - desc = irq_to_desc(irq); 155 if (desc == NULL) { 156 spin_unlock(&irq_controller_lock); 157 return -EINVAL; 158 } 159 - desc->node = cpu; 160 val = readl(reg) & ~(0xff << shift); 161 val |= 1 << (cpu + shift); 162 writel(val, reg); ··· 175 unsigned long status; 176 177 /* primary controller ack'ing */ 178 - chip->ack(irq); 179 180 spin_lock(&irq_controller_lock); 181 status = readl(chip_data->cpu_base + GIC_CPU_INTACK); ··· 193 194 out: 195 /* primary controller unmasking */ 196 - chip->unmask(irq); 197 } 198 199 static struct irq_chip gic_chip = { 200 - .name = "GIC", 201 - .ack = gic_ack_irq, 202 - .mask = gic_mask_irq, 203 - .unmask = gic_unmask_irq, 204 - .set_type = gic_set_type, 205 #ifdef CONFIG_SMP 206 - .set_affinity = gic_set_cpu, 207 #endif 208 }; 209 ··· 337 338 local_irq_save(flags); 339 irq_to_desc(irq)->status |= IRQ_NOPROBE; 340 - gic_unmask_irq(irq); 341 local_irq_restore(flags); 342 } 343
··· 50 51 static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly; 52 53 + static inline void __iomem *gic_dist_base(struct irq_data *d) 54 { 55 + struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 56 return gic_data->dist_base; 57 } 58 59 + static inline void __iomem *gic_cpu_base(struct irq_data *d) 60 { 61 + struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 62 return gic_data->cpu_base; 63 } 64 65 + static inline unsigned int gic_irq(struct irq_data *d) 66 { 67 + struct gic_chip_data *gic_data = irq_data_get_irq_chip_data(d); 68 + return d->irq - gic_data->irq_offset; 69 } 70 71 /* 72 * Routines to acknowledge, disable and enable interrupts 73 */ 74 + static void gic_ack_irq(struct irq_data *d) 75 { 76 spin_lock(&irq_controller_lock); 77 + writel(gic_irq(d), gic_cpu_base(d) + GIC_CPU_EOI); 78 spin_unlock(&irq_controller_lock); 79 } 80 81 + static void gic_mask_irq(struct irq_data *d) 82 { 83 + u32 mask = 1 << (d->irq % 32); 84 85 spin_lock(&irq_controller_lock); 86 + writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_CLEAR + (gic_irq(d) / 32) * 4); 87 spin_unlock(&irq_controller_lock); 88 } 89 90 + static void gic_unmask_irq(struct irq_data *d) 91 { 92 + u32 mask = 1 << (d->irq % 32); 93 94 spin_lock(&irq_controller_lock); 95 + writel(mask, gic_dist_base(d) + GIC_DIST_ENABLE_SET + (gic_irq(d) / 32) * 4); 96 spin_unlock(&irq_controller_lock); 97 } 98 99 + static int gic_set_type(struct irq_data *d, unsigned int type) 100 { 101 + void __iomem *base = gic_dist_base(d); 102 + unsigned int gicirq = gic_irq(d); 103 u32 enablemask = 1 << (gicirq % 32); 104 u32 enableoff = (gicirq / 32) * 4; 105 u32 confmask = 0x2 << ((gicirq % 16) * 2); ··· 143 } 144 145 #ifdef CONFIG_SMP 146 + static int 147 + gic_set_cpu(struct irq_data *d, const struct cpumask *mask_val, bool force) 148 { 149 + void __iomem *reg = gic_dist_base(d) + GIC_DIST_TARGET + (gic_irq(d) & ~3); 150 + unsigned int shift = (d->irq % 4) * 8; 151 unsigned int cpu = cpumask_first(mask_val); 152 u32 val; 153 struct irq_desc *desc; 154 155 spin_lock(&irq_controller_lock); 156 + desc = irq_to_desc(d->irq); 157 if (desc == NULL) { 158 spin_unlock(&irq_controller_lock); 159 return -EINVAL; 160 } 161 + d->node = cpu; 162 val = readl(reg) & ~(0xff << shift); 163 val |= 1 << (cpu + shift); 164 writel(val, reg); ··· 175 unsigned long status; 176 177 /* primary controller ack'ing */ 178 + chip->irq_ack(&desc->irq_data); 179 180 spin_lock(&irq_controller_lock); 181 status = readl(chip_data->cpu_base + GIC_CPU_INTACK); ··· 193 194 out: 195 /* primary controller unmasking */ 196 + chip->irq_unmask(&desc->irq_data); 197 } 198 199 static struct irq_chip gic_chip = { 200 + .name = "GIC", 201 + .irq_ack = gic_ack_irq, 202 + .irq_mask = gic_mask_irq, 203 + .irq_unmask = gic_unmask_irq, 204 + .irq_set_type = gic_set_type, 205 #ifdef CONFIG_SMP 206 + .irq_set_affinity = gic_set_cpu, 207 #endif 208 }; 209 ··· 337 338 local_irq_save(flags); 339 irq_to_desc(irq)->status |= IRQ_NOPROBE; 340 + gic_unmask_irq(irq_get_irq_data(irq)); 341 local_irq_restore(flags); 342 } 343
+9 -5
arch/arm/common/it8152.c
··· 31 32 #define MAX_SLOTS 21 33 34 - static void it8152_mask_irq(unsigned int irq) 35 { 36 if (irq >= IT8152_LD_IRQ(0)) { 37 __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) | 38 (1 << (irq - IT8152_LD_IRQ(0)))), ··· 50 } 51 } 52 53 - static void it8152_unmask_irq(unsigned int irq) 54 { 55 if (irq >= IT8152_LD_IRQ(0)) { 56 __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) & 57 ~(1 << (irq - IT8152_LD_IRQ(0)))), ··· 71 72 static struct irq_chip it8152_irq_chip = { 73 .name = "it8152", 74 - .ack = it8152_mask_irq, 75 - .mask = it8152_mask_irq, 76 - .unmask = it8152_unmask_irq, 77 }; 78 79 void it8152_init_irq(void)
··· 31 32 #define MAX_SLOTS 21 33 34 + static void it8152_mask_irq(struct irq_data *d) 35 { 36 + unsigned int irq = d->irq; 37 + 38 if (irq >= IT8152_LD_IRQ(0)) { 39 __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) | 40 (1 << (irq - IT8152_LD_IRQ(0)))), ··· 48 } 49 } 50 51 + static void it8152_unmask_irq(struct irq_data *d) 52 { 53 + unsigned int irq = d->irq; 54 + 55 if (irq >= IT8152_LD_IRQ(0)) { 56 __raw_writel((__raw_readl(IT8152_INTC_LDCNIMR) & 57 ~(1 << (irq - IT8152_LD_IRQ(0)))), ··· 67 68 static struct irq_chip it8152_irq_chip = { 69 .name = "it8152", 70 + .irq_ack = it8152_mask_irq, 71 + .irq_mask = it8152_mask_irq, 72 + .irq_unmask = it8152_unmask_irq, 73 }; 74 75 void it8152_init_irq(void)
+12 -12
arch/arm/common/locomo.c
··· 144 int req, i; 145 146 /* Acknowledge the parent IRQ */ 147 - desc->chip->ack(irq); 148 149 /* check why this interrupt was generated */ 150 req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00; ··· 161 } 162 } 163 164 - static void locomo_ack_irq(unsigned int irq) 165 { 166 } 167 168 - static void locomo_mask_irq(unsigned int irq) 169 { 170 - struct locomo *lchip = get_irq_chip_data(irq); 171 unsigned int r; 172 r = locomo_readl(lchip->base + LOCOMO_ICR); 173 - r &= ~(0x0010 << (irq - lchip->irq_base)); 174 locomo_writel(r, lchip->base + LOCOMO_ICR); 175 } 176 177 - static void locomo_unmask_irq(unsigned int irq) 178 { 179 - struct locomo *lchip = get_irq_chip_data(irq); 180 unsigned int r; 181 r = locomo_readl(lchip->base + LOCOMO_ICR); 182 - r |= (0x0010 << (irq - lchip->irq_base)); 183 locomo_writel(r, lchip->base + LOCOMO_ICR); 184 } 185 186 static struct irq_chip locomo_chip = { 187 - .name = "LOCOMO", 188 - .ack = locomo_ack_irq, 189 - .mask = locomo_mask_irq, 190 - .unmask = locomo_unmask_irq, 191 }; 192 193 static void locomo_setup_irq(struct locomo *lchip)
··· 144 int req, i; 145 146 /* Acknowledge the parent IRQ */ 147 + desc->irq_data.chip->irq_ack(&desc->irq_data); 148 149 /* check why this interrupt was generated */ 150 req = locomo_readl(lchip->base + LOCOMO_ICR) & 0x0f00; ··· 161 } 162 } 163 164 + static void locomo_ack_irq(struct irq_data *d) 165 { 166 } 167 168 + static void locomo_mask_irq(struct irq_data *d) 169 { 170 + struct locomo *lchip = irq_data_get_irq_chip_data(d); 171 unsigned int r; 172 r = locomo_readl(lchip->base + LOCOMO_ICR); 173 + r &= ~(0x0010 << (d->irq - lchip->irq_base)); 174 locomo_writel(r, lchip->base + LOCOMO_ICR); 175 } 176 177 + static void locomo_unmask_irq(struct irq_data *d) 178 { 179 + struct locomo *lchip = irq_data_get_irq_chip_data(d); 180 unsigned int r; 181 r = locomo_readl(lchip->base + LOCOMO_ICR); 182 + r |= (0x0010 << (d->irq - lchip->irq_base)); 183 locomo_writel(r, lchip->base + LOCOMO_ICR); 184 } 185 186 static struct irq_chip locomo_chip = { 187 + .name = "LOCOMO", 188 + .irq_ack = locomo_ack_irq, 189 + .irq_mask = locomo_mask_irq, 190 + .irq_unmask = locomo_unmask_irq, 191 }; 192 193 static void locomo_setup_irq(struct locomo *lchip)
+48 -48
arch/arm/common/sa1111.c
··· 210 211 sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0); 212 213 - desc->chip->ack(irq); 214 215 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1); 216 ··· 228 generic_handle_irq(i + sachip->irq_base); 229 230 /* For level-based interrupts */ 231 - desc->chip->unmask(irq); 232 } 233 234 #define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base)) 235 #define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32)) 236 237 - static void sa1111_ack_irq(unsigned int irq) 238 { 239 } 240 241 - static void sa1111_mask_lowirq(unsigned int irq) 242 { 243 - struct sa1111 *sachip = get_irq_chip_data(irq); 244 void __iomem *mapbase = sachip->base + SA1111_INTC; 245 unsigned long ie0; 246 247 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 248 - ie0 &= ~SA1111_IRQMASK_LO(irq); 249 writel(ie0, mapbase + SA1111_INTEN0); 250 } 251 252 - static void sa1111_unmask_lowirq(unsigned int irq) 253 { 254 - struct sa1111 *sachip = get_irq_chip_data(irq); 255 void __iomem *mapbase = sachip->base + SA1111_INTC; 256 unsigned long ie0; 257 258 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 259 - ie0 |= SA1111_IRQMASK_LO(irq); 260 sa1111_writel(ie0, mapbase + SA1111_INTEN0); 261 } 262 ··· 267 * be triggered. In fact, its very difficult, if not impossible to get 268 * INTSET to re-trigger the interrupt. 269 */ 270 - static int sa1111_retrigger_lowirq(unsigned int irq) 271 { 272 - struct sa1111 *sachip = get_irq_chip_data(irq); 273 void __iomem *mapbase = sachip->base + SA1111_INTC; 274 - unsigned int mask = SA1111_IRQMASK_LO(irq); 275 unsigned long ip0; 276 int i; 277 ··· 279 for (i = 0; i < 8; i++) { 280 sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0); 281 sa1111_writel(ip0, mapbase + SA1111_INTPOL0); 282 - if (sa1111_readl(mapbase + SA1111_INTSTATCLR1) & mask) 283 break; 284 } 285 286 if (i == 8) 287 printk(KERN_ERR "Danger Will Robinson: failed to " 288 - "re-trigger IRQ%d\n", irq); 289 return i == 8 ? -1 : 0; 290 } 291 292 - static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) 293 { 294 - struct sa1111 *sachip = get_irq_chip_data(irq); 295 void __iomem *mapbase = sachip->base + SA1111_INTC; 296 - unsigned int mask = SA1111_IRQMASK_LO(irq); 297 unsigned long ip0; 298 299 if (flags == IRQ_TYPE_PROBE) ··· 313 return 0; 314 } 315 316 - static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) 317 { 318 - struct sa1111 *sachip = get_irq_chip_data(irq); 319 void __iomem *mapbase = sachip->base + SA1111_INTC; 320 - unsigned int mask = SA1111_IRQMASK_LO(irq); 321 unsigned long we0; 322 323 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0); ··· 332 333 static struct irq_chip sa1111_low_chip = { 334 .name = "SA1111-l", 335 - .ack = sa1111_ack_irq, 336 - .mask = sa1111_mask_lowirq, 337 - .unmask = sa1111_unmask_lowirq, 338 - .retrigger = sa1111_retrigger_lowirq, 339 - .set_type = sa1111_type_lowirq, 340 - .set_wake = sa1111_wake_lowirq, 341 }; 342 343 - static void sa1111_mask_highirq(unsigned int irq) 344 { 345 - struct sa1111 *sachip = get_irq_chip_data(irq); 346 void __iomem *mapbase = sachip->base + SA1111_INTC; 347 unsigned long ie1; 348 349 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 350 - ie1 &= ~SA1111_IRQMASK_HI(irq); 351 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 352 } 353 354 - static void sa1111_unmask_highirq(unsigned int irq) 355 { 356 - struct sa1111 *sachip = get_irq_chip_data(irq); 357 void __iomem *mapbase = sachip->base + SA1111_INTC; 358 unsigned long ie1; 359 360 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 361 - ie1 |= SA1111_IRQMASK_HI(irq); 362 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 363 } 364 ··· 369 * be triggered. In fact, its very difficult, if not impossible to get 370 * INTSET to re-trigger the interrupt. 371 */ 372 - static int sa1111_retrigger_highirq(unsigned int irq) 373 { 374 - struct sa1111 *sachip = get_irq_chip_data(irq); 375 void __iomem *mapbase = sachip->base + SA1111_INTC; 376 - unsigned int mask = SA1111_IRQMASK_HI(irq); 377 unsigned long ip1; 378 int i; 379 ··· 387 388 if (i == 8) 389 printk(KERN_ERR "Danger Will Robinson: failed to " 390 - "re-trigger IRQ%d\n", irq); 391 return i == 8 ? -1 : 0; 392 } 393 394 - static int sa1111_type_highirq(unsigned int irq, unsigned int flags) 395 { 396 - struct sa1111 *sachip = get_irq_chip_data(irq); 397 void __iomem *mapbase = sachip->base + SA1111_INTC; 398 - unsigned int mask = SA1111_IRQMASK_HI(irq); 399 unsigned long ip1; 400 401 if (flags == IRQ_TYPE_PROBE) ··· 415 return 0; 416 } 417 418 - static int sa1111_wake_highirq(unsigned int irq, unsigned int on) 419 { 420 - struct sa1111 *sachip = get_irq_chip_data(irq); 421 void __iomem *mapbase = sachip->base + SA1111_INTC; 422 - unsigned int mask = SA1111_IRQMASK_HI(irq); 423 unsigned long we1; 424 425 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1); ··· 434 435 static struct irq_chip sa1111_high_chip = { 436 .name = "SA1111-h", 437 - .ack = sa1111_ack_irq, 438 - .mask = sa1111_mask_highirq, 439 - .unmask = sa1111_unmask_highirq, 440 - .retrigger = sa1111_retrigger_highirq, 441 - .set_type = sa1111_type_highirq, 442 - .set_wake = sa1111_wake_highirq, 443 }; 444 445 static void sa1111_setup_irq(struct sa1111 *sachip)
··· 210 211 sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0); 212 213 + desc->irq_data.chip->irq_ack(&desc->irq_data); 214 215 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1); 216 ··· 228 generic_handle_irq(i + sachip->irq_base); 229 230 /* For level-based interrupts */ 231 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 232 } 233 234 #define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base)) 235 #define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32)) 236 237 + static void sa1111_ack_irq(struct irq_data *d) 238 { 239 } 240 241 + static void sa1111_mask_lowirq(struct irq_data *d) 242 { 243 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 244 void __iomem *mapbase = sachip->base + SA1111_INTC; 245 unsigned long ie0; 246 247 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 248 + ie0 &= ~SA1111_IRQMASK_LO(d->irq); 249 writel(ie0, mapbase + SA1111_INTEN0); 250 } 251 252 + static void sa1111_unmask_lowirq(struct irq_data *d) 253 { 254 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 255 void __iomem *mapbase = sachip->base + SA1111_INTC; 256 unsigned long ie0; 257 258 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 259 + ie0 |= SA1111_IRQMASK_LO(d->irq); 260 sa1111_writel(ie0, mapbase + SA1111_INTEN0); 261 } 262 ··· 267 * be triggered. In fact, its very difficult, if not impossible to get 268 * INTSET to re-trigger the interrupt. 269 */ 270 + static int sa1111_retrigger_lowirq(struct irq_data *d) 271 { 272 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 273 void __iomem *mapbase = sachip->base + SA1111_INTC; 274 + unsigned int mask = SA1111_IRQMASK_LO(d->irq); 275 unsigned long ip0; 276 int i; 277 ··· 279 for (i = 0; i < 8; i++) { 280 sa1111_writel(ip0 ^ mask, mapbase + SA1111_INTPOL0); 281 sa1111_writel(ip0, mapbase + SA1111_INTPOL0); 282 + if (sa1111_readl(mapbase + SA1111_INTSTATCLR0) & mask) 283 break; 284 } 285 286 if (i == 8) 287 printk(KERN_ERR "Danger Will Robinson: failed to " 288 + "re-trigger IRQ%d\n", d->irq); 289 return i == 8 ? -1 : 0; 290 } 291 292 + static int sa1111_type_lowirq(struct irq_data *d, unsigned int flags) 293 { 294 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 295 void __iomem *mapbase = sachip->base + SA1111_INTC; 296 + unsigned int mask = SA1111_IRQMASK_LO(d->irq); 297 unsigned long ip0; 298 299 if (flags == IRQ_TYPE_PROBE) ··· 313 return 0; 314 } 315 316 + static int sa1111_wake_lowirq(struct irq_data *d, unsigned int on) 317 { 318 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 319 void __iomem *mapbase = sachip->base + SA1111_INTC; 320 + unsigned int mask = SA1111_IRQMASK_LO(d->irq); 321 unsigned long we0; 322 323 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0); ··· 332 333 static struct irq_chip sa1111_low_chip = { 334 .name = "SA1111-l", 335 + .irq_ack = sa1111_ack_irq, 336 + .irq_mask = sa1111_mask_lowirq, 337 + .irq_unmask = sa1111_unmask_lowirq, 338 + .irq_retrigger = sa1111_retrigger_lowirq, 339 + .irq_set_type = sa1111_type_lowirq, 340 + .irq_set_wake = sa1111_wake_lowirq, 341 }; 342 343 + static void sa1111_mask_highirq(struct irq_data *d) 344 { 345 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 346 void __iomem *mapbase = sachip->base + SA1111_INTC; 347 unsigned long ie1; 348 349 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 350 + ie1 &= ~SA1111_IRQMASK_HI(d->irq); 351 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 352 } 353 354 + static void sa1111_unmask_highirq(struct irq_data *d) 355 { 356 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 357 void __iomem *mapbase = sachip->base + SA1111_INTC; 358 unsigned long ie1; 359 360 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 361 + ie1 |= SA1111_IRQMASK_HI(d->irq); 362 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 363 } 364 ··· 369 * be triggered. In fact, its very difficult, if not impossible to get 370 * INTSET to re-trigger the interrupt. 371 */ 372 + static int sa1111_retrigger_highirq(struct irq_data *d) 373 { 374 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 375 void __iomem *mapbase = sachip->base + SA1111_INTC; 376 + unsigned int mask = SA1111_IRQMASK_HI(d->irq); 377 unsigned long ip1; 378 int i; 379 ··· 387 388 if (i == 8) 389 printk(KERN_ERR "Danger Will Robinson: failed to " 390 + "re-trigger IRQ%d\n", d->irq); 391 return i == 8 ? -1 : 0; 392 } 393 394 + static int sa1111_type_highirq(struct irq_data *d, unsigned int flags) 395 { 396 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 397 void __iomem *mapbase = sachip->base + SA1111_INTC; 398 + unsigned int mask = SA1111_IRQMASK_HI(d->irq); 399 unsigned long ip1; 400 401 if (flags == IRQ_TYPE_PROBE) ··· 415 return 0; 416 } 417 418 + static int sa1111_wake_highirq(struct irq_data *d, unsigned int on) 419 { 420 + struct sa1111 *sachip = irq_data_get_irq_chip_data(d); 421 void __iomem *mapbase = sachip->base + SA1111_INTC; 422 + unsigned int mask = SA1111_IRQMASK_HI(d->irq); 423 unsigned long we1; 424 425 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1); ··· 434 435 static struct irq_chip sa1111_high_chip = { 436 .name = "SA1111-h", 437 + .irq_ack = sa1111_ack_irq, 438 + .irq_mask = sa1111_mask_highirq, 439 + .irq_unmask = sa1111_unmask_highirq, 440 + .irq_retrigger = sa1111_retrigger_highirq, 441 + .irq_set_type = sa1111_type_highirq, 442 + .irq_set_wake = sa1111_wake_highirq, 443 }; 444 445 static void sa1111_setup_irq(struct sa1111 *sachip)
+16 -16
arch/arm/common/vic.c
··· 204 static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { } 205 #endif /* CONFIG_PM */ 206 207 - static void vic_ack_irq(unsigned int irq) 208 { 209 - void __iomem *base = get_irq_chip_data(irq); 210 - irq &= 31; 211 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 212 /* moreover, clear the soft-triggered, in case it was the reason */ 213 writel(1 << irq, base + VIC_INT_SOFT_CLEAR); 214 } 215 216 - static void vic_mask_irq(unsigned int irq) 217 { 218 - void __iomem *base = get_irq_chip_data(irq); 219 - irq &= 31; 220 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 221 } 222 223 - static void vic_unmask_irq(unsigned int irq) 224 { 225 - void __iomem *base = get_irq_chip_data(irq); 226 - irq &= 31; 227 writel(1 << irq, base + VIC_INT_ENABLE); 228 } 229 ··· 242 return NULL; 243 } 244 245 - static int vic_set_wake(unsigned int irq, unsigned int on) 246 { 247 - struct vic_device *v = vic_from_irq(irq); 248 - unsigned int off = irq & 31; 249 u32 bit = 1 << off; 250 251 if (!v) ··· 267 268 static struct irq_chip vic_chip = { 269 .name = "VIC", 270 - .ack = vic_ack_irq, 271 - .mask = vic_mask_irq, 272 - .unmask = vic_unmask_irq, 273 - .set_wake = vic_set_wake, 274 }; 275 276 static void __init vic_disable(void __iomem *base)
··· 204 static inline void vic_pm_register(void __iomem *base, unsigned int irq, u32 arg1) { } 205 #endif /* CONFIG_PM */ 206 207 + static void vic_ack_irq(struct irq_data *d) 208 { 209 + void __iomem *base = irq_data_get_irq_chip_data(d); 210 + unsigned int irq = d->irq & 31; 211 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 212 /* moreover, clear the soft-triggered, in case it was the reason */ 213 writel(1 << irq, base + VIC_INT_SOFT_CLEAR); 214 } 215 216 + static void vic_mask_irq(struct irq_data *d) 217 { 218 + void __iomem *base = irq_data_get_irq_chip_data(d); 219 + unsigned int irq = d->irq & 31; 220 writel(1 << irq, base + VIC_INT_ENABLE_CLEAR); 221 } 222 223 + static void vic_unmask_irq(struct irq_data *d) 224 { 225 + void __iomem *base = irq_data_get_irq_chip_data(d); 226 + unsigned int irq = d->irq & 31; 227 writel(1 << irq, base + VIC_INT_ENABLE); 228 } 229 ··· 242 return NULL; 243 } 244 245 + static int vic_set_wake(struct irq_data *d, unsigned int on) 246 { 247 + struct vic_device *v = vic_from_irq(d->irq); 248 + unsigned int off = d->irq & 31; 249 u32 bit = 1 << off; 250 251 if (!v) ··· 267 268 static struct irq_chip vic_chip = { 269 .name = "VIC", 270 + .irq_ack = vic_ack_irq, 271 + .irq_mask = vic_mask_irq, 272 + .irq_unmask = vic_unmask_irq, 273 + .irq_set_wake = vic_set_wake, 274 }; 275 276 static void __init vic_disable(void __iomem *base)
+14 -14
arch/arm/kernel/ecard.c
··· 443 * 444 * They are not meant to be called directly, but via enable/disable_irq. 445 */ 446 - static void ecard_irq_unmask(unsigned int irqnr) 447 { 448 - ecard_t *ec = slot_to_ecard(irqnr - 32); 449 450 if (ec) { 451 if (!ec->ops) 452 ec->ops = &ecard_default_ops; 453 454 if (ec->claimed && ec->ops->irqenable) 455 - ec->ops->irqenable(ec, irqnr); 456 else 457 printk(KERN_ERR "ecard: rejecting request to " 458 - "enable IRQs for %d\n", irqnr); 459 } 460 } 461 462 - static void ecard_irq_mask(unsigned int irqnr) 463 { 464 - ecard_t *ec = slot_to_ecard(irqnr - 32); 465 466 if (ec) { 467 if (!ec->ops) 468 ec->ops = &ecard_default_ops; 469 470 if (ec->ops && ec->ops->irqdisable) 471 - ec->ops->irqdisable(ec, irqnr); 472 } 473 } 474 475 static struct irq_chip ecard_chip = { 476 - .name = "ECARD", 477 - .ack = ecard_irq_mask, 478 - .mask = ecard_irq_mask, 479 - .unmask = ecard_irq_unmask, 480 }; 481 482 void ecard_enablefiq(unsigned int fiqnr) ··· 551 printk(KERN_ERR "\nInterrupt lockup detected - " 552 "disabling all expansion card interrupts\n"); 553 554 - desc->chip->mask(IRQ_EXPANSIONCARD); 555 ecard_dump_irq_state(); 556 } 557 } else ··· 574 ecard_t *ec; 575 int called = 0; 576 577 - desc->chip->mask(irq); 578 for (ec = cards; ec; ec = ec->next) { 579 int pending; 580 ··· 591 called ++; 592 } 593 } 594 - desc->chip->unmask(irq); 595 596 if (called == 0) 597 ecard_check_lockup(desc);
··· 443 * 444 * They are not meant to be called directly, but via enable/disable_irq. 445 */ 446 + static void ecard_irq_unmask(struct irq_data *d) 447 { 448 + ecard_t *ec = slot_to_ecard(d->irq - 32); 449 450 if (ec) { 451 if (!ec->ops) 452 ec->ops = &ecard_default_ops; 453 454 if (ec->claimed && ec->ops->irqenable) 455 + ec->ops->irqenable(ec, d->irq); 456 else 457 printk(KERN_ERR "ecard: rejecting request to " 458 + "enable IRQs for %d\n", d->irq); 459 } 460 } 461 462 + static void ecard_irq_mask(struct irq_data *d) 463 { 464 + ecard_t *ec = slot_to_ecard(d->irq - 32); 465 466 if (ec) { 467 if (!ec->ops) 468 ec->ops = &ecard_default_ops; 469 470 if (ec->ops && ec->ops->irqdisable) 471 + ec->ops->irqdisable(ec, d->irq); 472 } 473 } 474 475 static struct irq_chip ecard_chip = { 476 + .name = "ECARD", 477 + .irq_ack = ecard_irq_mask, 478 + .irq_mask = ecard_irq_mask, 479 + .irq_unmask = ecard_irq_unmask, 480 }; 481 482 void ecard_enablefiq(unsigned int fiqnr) ··· 551 printk(KERN_ERR "\nInterrupt lockup detected - " 552 "disabling all expansion card interrupts\n"); 553 554 + desc->irq_data.chip->irq_mask(&desc->irq_data); 555 ecard_dump_irq_state(); 556 } 557 } else ··· 574 ecard_t *ec; 575 int called = 0; 576 577 + desc->irq_data.chip->irq_mask(&desc->irq_data); 578 for (ec = cards; ec; ec = ec->next) { 579 int pending; 580 ··· 591 called ++; 592 } 593 } 594 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 595 596 if (called == 0) 597 ecard_check_lockup(desc);
+10 -7
arch/arm/kernel/irq.c
··· 88 seq_printf(p, "%*d: ", prec, i); 89 for_each_present_cpu(cpu) 90 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); 91 - seq_printf(p, " %10s", desc->chip->name ? : "-"); 92 seq_printf(p, " %s", action->name); 93 for (action = action->next; action; action = action->next) 94 seq_printf(p, ", %s", action->name); ··· 181 182 static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu) 183 { 184 - pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->node, cpu); 185 186 raw_spin_lock_irq(&desc->lock); 187 - desc->chip->set_affinity(irq, cpumask_of(cpu)); 188 raw_spin_unlock_irq(&desc->lock); 189 } 190 ··· 200 struct irq_desc *desc; 201 202 for_each_irq_desc(i, desc) { 203 - if (desc->node == cpu) { 204 - unsigned int newcpu = cpumask_any_and(desc->affinity, 205 cpu_online_mask); 206 if (newcpu >= nr_cpu_ids) { 207 if (printk_ratelimit()) 208 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n", 209 i, cpu); 210 211 - cpumask_setall(desc->affinity); 212 - newcpu = cpumask_any_and(desc->affinity, 213 cpu_online_mask); 214 } 215
··· 88 seq_printf(p, "%*d: ", prec, i); 89 for_each_present_cpu(cpu) 90 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); 91 + seq_printf(p, " %10s", desc->irq_data.chip->name ? : "-"); 92 seq_printf(p, " %s", action->name); 93 for (action = action->next; action; action = action->next) 94 seq_printf(p, ", %s", action->name); ··· 181 182 static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu) 183 { 184 + pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->irq_data.node, cpu); 185 186 raw_spin_lock_irq(&desc->lock); 187 + desc->irq_data.chip->irq_set_affinity(&desc->irq_data, 188 + cpumask_of(cpu), false); 189 raw_spin_unlock_irq(&desc->lock); 190 } 191 ··· 199 struct irq_desc *desc; 200 201 for_each_irq_desc(i, desc) { 202 + struct irq_data *d = &desc->irq_data; 203 + 204 + if (d->node == cpu) { 205 + unsigned int newcpu = cpumask_any_and(d->affinity, 206 cpu_online_mask); 207 if (newcpu >= nr_cpu_ids) { 208 if (printk_ratelimit()) 209 printk(KERN_INFO "IRQ%u no longer affine to CPU%u\n", 210 i, cpu); 211 212 + cpumask_setall(d->affinity); 213 + newcpu = cpumask_any_and(d->affinity, 214 cpu_online_mask); 215 } 216
+9 -9
arch/arm/mach-aaec2000/core.c
··· 68 /* 69 * Interrupt handling routines 70 */ 71 - static void aaec2000_int_ack(unsigned int irq) 72 { 73 - IRQ_INTSR = 1 << irq; 74 } 75 76 - static void aaec2000_int_mask(unsigned int irq) 77 { 78 - IRQ_INTENC |= (1 << irq); 79 } 80 81 - static void aaec2000_int_unmask(unsigned int irq) 82 { 83 - IRQ_INTENS |= (1 << irq); 84 } 85 86 static struct irq_chip aaec2000_irq_chip = { 87 - .ack = aaec2000_int_ack, 88 - .mask = aaec2000_int_mask, 89 - .unmask = aaec2000_int_unmask, 90 }; 91 92 void __init aaec2000_init_irq(void)
··· 68 /* 69 * Interrupt handling routines 70 */ 71 + static void aaec2000_int_ack(struct irq_data *d) 72 { 73 + IRQ_INTSR = 1 << d->irq; 74 } 75 76 + static void aaec2000_int_mask(struct irq_data *d) 77 { 78 + IRQ_INTENC |= (1 << d->irq); 79 } 80 81 + static void aaec2000_int_unmask(struct irq_data *d) 82 { 83 + IRQ_INTENS |= (1 << d->irq); 84 } 85 86 static struct irq_chip aaec2000_irq_chip = { 87 + .irq_ack = aaec2000_int_ack, 88 + .irq_mask = aaec2000_int_mask, 89 + .irq_unmask = aaec2000_int_unmask, 90 }; 91 92 void __init aaec2000_init_irq(void)
+13
arch/arm/mach-at91/Kconfig
··· 362 Select this if you are using a Eukrea Electromatique's 363 CPU9G20 Board <http://www.eukrea.com/> 364 365 config MACH_PORTUXG20 366 bool "taskit PortuxG20" 367 help ··· 387 Select this if you are using taskit's Stamp9G20 CPU module on this 388 carrier board, beeing the decentralized unit of a building automation 389 system; featuring nvram, eth-switch, iso-rs485, display, io 390 endif 391 392 if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20)
··· 362 Select this if you are using a Eukrea Electromatique's 363 CPU9G20 Board <http://www.eukrea.com/> 364 365 + config MACH_ACMENETUSFOXG20 366 + bool "Acme Systems srl FOX Board G20" 367 + help 368 + Select this if you are using Acme Systems 369 + FOX Board G20 <http://www.acmesystems.it> 370 + 371 config MACH_PORTUXG20 372 bool "taskit PortuxG20" 373 help ··· 381 Select this if you are using taskit's Stamp9G20 CPU module on this 382 carrier board, beeing the decentralized unit of a building automation 383 system; featuring nvram, eth-switch, iso-rs485, display, io 384 + 385 + config MACH_GSIA18S 386 + bool "GS_IA18_S board" 387 + help 388 + This enables support for the GS_IA18_S board 389 + produced by GeoSIG Ltd company. This is an internet accelerograph. 390 + <http://www.geosig.com> 391 endif 392 393 if (ARCH_AT91SAM9260 || ARCH_AT91SAM9G20)
+2
arch/arm/mach-at91/Makefile
··· 63 # AT91SAM9G20 board-specific support 64 obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o 65 obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o 66 obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o 67 obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o 68 obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o 69 70 # AT91SAM9260/AT91SAM9G20 board-specific support 71 obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o
··· 63 # AT91SAM9G20 board-specific support 64 obj-$(CONFIG_MACH_AT91SAM9G20EK) += board-sam9g20ek.o 65 obj-$(CONFIG_MACH_CPU9G20) += board-cpu9krea.o 66 + obj-$(CONFIG_MACH_ACMENETUSFOXG20) += board-foxg20.o 67 obj-$(CONFIG_MACH_STAMP9G20) += board-stamp9g20.o 68 obj-$(CONFIG_MACH_PORTUXG20) += board-stamp9g20.o 69 obj-$(CONFIG_MACH_PCONTROL_G20) += board-pcontrol-g20.o board-stamp9g20.o 70 + obj-$(CONFIG_MACH_GSIA18S) += board-gsia18s.o board-stamp9g20.o 71 72 # AT91SAM9260/AT91SAM9G20 board-specific support 73 obj-$(CONFIG_MACH_SNAPPER_9260) += board-snapper9260.o
+274
arch/arm/mach-at91/board-foxg20.c
···
··· 1 + /* 2 + * Copyright (C) 2005 SAN People 3 + * Copyright (C) 2008 Atmel 4 + * Copyright (C) 2010 Lee McLoughlin - lee@lmmrtech.com 5 + * Copyright (C) 2010 Sergio Tanzilli - tanzilli@acmesystems.it 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 as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 + */ 21 + 22 + #include <linux/types.h> 23 + #include <linux/init.h> 24 + #include <linux/mm.h> 25 + #include <linux/module.h> 26 + #include <linux/platform_device.h> 27 + #include <linux/spi/spi.h> 28 + #include <linux/spi/at73c213.h> 29 + #include <linux/gpio.h> 30 + #include <linux/gpio_keys.h> 31 + #include <linux/input.h> 32 + #include <linux/clk.h> 33 + #include <linux/w1-gpio.h> 34 + 35 + #include <mach/hardware.h> 36 + #include <asm/setup.h> 37 + #include <asm/mach-types.h> 38 + #include <asm/irq.h> 39 + 40 + #include <asm/mach/arch.h> 41 + #include <asm/mach/map.h> 42 + #include <asm/mach/irq.h> 43 + 44 + #include <mach/board.h> 45 + #include <mach/at91sam9_smc.h> 46 + 47 + #include "sam9_smc.h" 48 + #include "generic.h" 49 + 50 + /* 51 + * The FOX Board G20 hardware comes as the "Netus G20" board with 52 + * just the cpu, ram, dataflash and two header connectors. 53 + * This is plugged into the FOX Board which provides the ethernet, 54 + * usb, rtc, leds, switch, ... 55 + * 56 + * For more info visit: http://www.acmesystems.it/foxg20 57 + */ 58 + 59 + 60 + static void __init foxg20_map_io(void) 61 + { 62 + /* Initialize processor: 18.432 MHz crystal */ 63 + at91sam9260_initialize(18432000); 64 + 65 + /* DBGU on ttyS0. (Rx & Tx only) */ 66 + at91_register_uart(0, 0, 0); 67 + 68 + /* USART0 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ 69 + at91_register_uart(AT91SAM9260_ID_US0, 1, 70 + ATMEL_UART_CTS 71 + | ATMEL_UART_RTS 72 + | ATMEL_UART_DTR 73 + | ATMEL_UART_DSR 74 + | ATMEL_UART_DCD 75 + | ATMEL_UART_RI); 76 + 77 + /* USART1 on ttyS2. (Rx, Tx, RTS, CTS) */ 78 + at91_register_uart(AT91SAM9260_ID_US1, 2, 79 + ATMEL_UART_CTS 80 + | ATMEL_UART_RTS); 81 + 82 + /* USART2 on ttyS3. (Rx & Tx only) */ 83 + at91_register_uart(AT91SAM9260_ID_US2, 3, 0); 84 + 85 + /* USART3 on ttyS4. (Rx, Tx, RTS, CTS) */ 86 + at91_register_uart(AT91SAM9260_ID_US3, 4, 87 + ATMEL_UART_CTS 88 + | ATMEL_UART_RTS); 89 + 90 + /* USART4 on ttyS5. (Rx & Tx only) */ 91 + at91_register_uart(AT91SAM9260_ID_US4, 5, 0); 92 + 93 + /* USART5 on ttyS6. (Rx & Tx only) */ 94 + at91_register_uart(AT91SAM9260_ID_US5, 6, 0); 95 + 96 + /* set serial console to ttyS0 (ie, DBGU) */ 97 + at91_set_serial_console(0); 98 + 99 + /* Set the internal pull-up resistor on DRXD */ 100 + at91_set_A_periph(AT91_PIN_PB14, 1); 101 + 102 + } 103 + 104 + static void __init foxg20_init_irq(void) 105 + { 106 + at91sam9260_init_interrupts(NULL); 107 + } 108 + 109 + 110 + /* 111 + * USB Host port 112 + */ 113 + static struct at91_usbh_data __initdata foxg20_usbh_data = { 114 + .ports = 2, 115 + }; 116 + 117 + /* 118 + * USB Device port 119 + */ 120 + static struct at91_udc_data __initdata foxg20_udc_data = { 121 + .vbus_pin = AT91_PIN_PC6, 122 + .pullup_pin = 0, /* pull-up driven by UDC */ 123 + }; 124 + 125 + 126 + /* 127 + * SPI devices. 128 + */ 129 + static struct spi_board_info foxg20_spi_devices[] = { 130 + #if !defined(CONFIG_MMC_AT91) 131 + { 132 + .modalias = "mtd_dataflash", 133 + .chip_select = 1, 134 + .max_speed_hz = 15 * 1000 * 1000, 135 + .bus_num = 0, 136 + }, 137 + #endif 138 + }; 139 + 140 + 141 + /* 142 + * MACB Ethernet device 143 + */ 144 + static struct at91_eth_data __initdata foxg20_macb_data = { 145 + .phy_irq_pin = AT91_PIN_PA7, 146 + .is_rmii = 1, 147 + }; 148 + 149 + /* 150 + * MCI (SD/MMC) 151 + * det_pin, wp_pin and vcc_pin are not connected 152 + */ 153 + static struct at91_mmc_data __initdata foxg20_mmc_data = { 154 + .slot_b = 1, 155 + .wire4 = 1, 156 + }; 157 + 158 + 159 + /* 160 + * LEDs 161 + */ 162 + static struct gpio_led foxg20_leds[] = { 163 + { /* user led, red */ 164 + .name = "user_led", 165 + .gpio = AT91_PIN_PC7, 166 + .active_low = 0, 167 + .default_trigger = "heartbeat", 168 + }, 169 + }; 170 + 171 + 172 + /* 173 + * GPIO Buttons 174 + */ 175 + #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 176 + static struct gpio_keys_button foxg20_buttons[] = { 177 + { 178 + .gpio = AT91_PIN_PC4, 179 + .code = BTN_1, 180 + .desc = "Button 1", 181 + .active_low = 1, 182 + .wakeup = 1, 183 + }, 184 + }; 185 + 186 + static struct gpio_keys_platform_data foxg20_button_data = { 187 + .buttons = foxg20_buttons, 188 + .nbuttons = ARRAY_SIZE(foxg20_buttons), 189 + }; 190 + 191 + static struct platform_device foxg20_button_device = { 192 + .name = "gpio-keys", 193 + .id = -1, 194 + .num_resources = 0, 195 + .dev = { 196 + .platform_data = &foxg20_button_data, 197 + } 198 + }; 199 + 200 + static void __init foxg20_add_device_buttons(void) 201 + { 202 + at91_set_gpio_input(AT91_PIN_PC4, 1); /* btn1 */ 203 + at91_set_deglitch(AT91_PIN_PC4, 1); 204 + 205 + platform_device_register(&foxg20_button_device); 206 + } 207 + #else 208 + static void __init foxg20_add_device_buttons(void) {} 209 + #endif 210 + 211 + 212 + #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) 213 + static struct w1_gpio_platform_data w1_gpio_pdata = { 214 + /* If you choose to use a pin other than PB16 it needs to be 3.3V */ 215 + .pin = AT91_PIN_PB16, 216 + .is_open_drain = 1, 217 + }; 218 + 219 + static struct platform_device w1_device = { 220 + .name = "w1-gpio", 221 + .id = -1, 222 + .dev.platform_data = &w1_gpio_pdata, 223 + }; 224 + 225 + static void __init at91_add_device_w1(void) 226 + { 227 + at91_set_GPIO_periph(w1_gpio_pdata.pin, 1); 228 + at91_set_multi_drive(w1_gpio_pdata.pin, 1); 229 + platform_device_register(&w1_device); 230 + } 231 + 232 + #endif 233 + 234 + 235 + static struct i2c_board_info __initdata foxg20_i2c_devices[] = { 236 + { 237 + I2C_BOARD_INFO("24c512", 0x50), 238 + }, 239 + }; 240 + 241 + 242 + static void __init foxg20_board_init(void) 243 + { 244 + /* Serial */ 245 + at91_add_device_serial(); 246 + /* USB Host */ 247 + at91_add_device_usbh(&foxg20_usbh_data); 248 + /* USB Device */ 249 + at91_add_device_udc(&foxg20_udc_data); 250 + /* SPI */ 251 + at91_add_device_spi(foxg20_spi_devices, ARRAY_SIZE(foxg20_spi_devices)); 252 + /* Ethernet */ 253 + at91_add_device_eth(&foxg20_macb_data); 254 + /* MMC */ 255 + at91_add_device_mmc(0, &foxg20_mmc_data); 256 + /* I2C */ 257 + at91_add_device_i2c(foxg20_i2c_devices, ARRAY_SIZE(foxg20_i2c_devices)); 258 + /* LEDs */ 259 + at91_gpio_leds(foxg20_leds, ARRAY_SIZE(foxg20_leds)); 260 + /* Push Buttons */ 261 + foxg20_add_device_buttons(); 262 + #if defined(CONFIG_W1_MASTER_GPIO) || defined(CONFIG_W1_MASTER_GPIO_MODULE) 263 + at91_add_device_w1(); 264 + #endif 265 + } 266 + 267 + MACHINE_START(ACMENETUSFOXG20, "Acme Systems srl FOX Board G20") 268 + /* Maintainer: Sergio Tanzilli */ 269 + .boot_params = AT91_SDRAM_BASE + 0x100, 270 + .timer = &at91sam926x_timer, 271 + .map_io = foxg20_map_io, 272 + .init_irq = foxg20_init_irq, 273 + .init_machine = foxg20_board_init, 274 + MACHINE_END
+584
arch/arm/mach-at91/board-gsia18s.c
···
··· 1 + /* 2 + * Copyright (C) 2010 Christian Glindkamp <christian.glindkamp@taskit.de> 3 + * taskit GmbH 4 + * 2010 Igor Plyatov <plyatov@gmail.com> 5 + * GeoSIG Ltd 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 as published by 9 + * the Free Software Foundation; either version 2 of the License, or 10 + * (at your option) any later version. 11 + * 12 + * This program is distributed in the hope that it will be useful, 13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 + * GNU General Public License for more details. 16 + * 17 + * You should have received a copy of the GNU General Public License 18 + * along with this program; if not, write to the Free Software 19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 + */ 21 + 22 + #include <linux/platform_device.h> 23 + #include <linux/gpio.h> 24 + #include <linux/w1-gpio.h> 25 + #include <linux/i2c.h> 26 + #include <linux/i2c/pcf857x.h> 27 + #include <linux/gpio_keys.h> 28 + #include <linux/input.h> 29 + 30 + #include <asm/mach-types.h> 31 + #include <asm/mach/arch.h> 32 + 33 + #include <mach/board.h> 34 + #include <mach/at91sam9_smc.h> 35 + #include <mach/gsia18s.h> 36 + #include <mach/stamp9g20.h> 37 + 38 + #include "sam9_smc.h" 39 + #include "generic.h" 40 + 41 + static void __init gsia18s_map_io(void) 42 + { 43 + stamp9g20_map_io(); 44 + 45 + /* 46 + * USART0 on ttyS1 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI). 47 + * Used for Internal Analog Modem. 48 + */ 49 + at91_register_uart(AT91SAM9260_ID_US0, 1, 50 + ATMEL_UART_CTS | ATMEL_UART_RTS | 51 + ATMEL_UART_DTR | ATMEL_UART_DSR | 52 + ATMEL_UART_DCD | ATMEL_UART_RI); 53 + /* 54 + * USART1 on ttyS2 (Rx, Tx, CTS, RTS). 55 + * Used for GPS or WiFi or Data stream. 56 + */ 57 + at91_register_uart(AT91SAM9260_ID_US1, 2, 58 + ATMEL_UART_CTS | ATMEL_UART_RTS); 59 + /* 60 + * USART2 on ttyS3 (Rx, Tx, CTS, RTS). 61 + * Used for External Modem. 62 + */ 63 + at91_register_uart(AT91SAM9260_ID_US2, 3, 64 + ATMEL_UART_CTS | ATMEL_UART_RTS); 65 + /* 66 + * USART3 on ttyS4 (Rx, Tx, RTS). 67 + * Used for RS-485. 68 + */ 69 + at91_register_uart(AT91SAM9260_ID_US3, 4, ATMEL_UART_RTS); 70 + 71 + /* 72 + * USART4 on ttyS5 (Rx, Tx). 73 + * Used for TRX433 Radio Module. 74 + */ 75 + at91_register_uart(AT91SAM9260_ID_US4, 5, 0); 76 + } 77 + 78 + static void __init init_irq(void) 79 + { 80 + at91sam9260_init_interrupts(NULL); 81 + } 82 + 83 + /* 84 + * Two USB Host ports 85 + */ 86 + static struct at91_usbh_data __initdata usbh_data = { 87 + .ports = 2, 88 + }; 89 + 90 + /* 91 + * USB Device port 92 + */ 93 + static struct at91_udc_data __initdata udc_data = { 94 + .vbus_pin = AT91_PIN_PA22, 95 + .pullup_pin = 0, /* pull-up driven by UDC */ 96 + }; 97 + 98 + /* 99 + * MACB Ethernet device 100 + */ 101 + static struct at91_eth_data __initdata macb_data = { 102 + .phy_irq_pin = AT91_PIN_PA28, 103 + .is_rmii = 1, 104 + }; 105 + 106 + /* 107 + * LEDs and GPOs 108 + */ 109 + static struct gpio_led gpio_leds[] = { 110 + { 111 + .name = "gpo:spi1reset", 112 + .gpio = AT91_PIN_PC1, 113 + .active_low = 0, 114 + .default_trigger = "none", 115 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 116 + }, 117 + { 118 + .name = "gpo:trig_net_out", 119 + .gpio = AT91_PIN_PB20, 120 + .active_low = 0, 121 + .default_trigger = "none", 122 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 123 + }, 124 + { 125 + .name = "gpo:trig_net_dir", 126 + .gpio = AT91_PIN_PB19, 127 + .active_low = 0, 128 + .default_trigger = "none", 129 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 130 + }, 131 + { 132 + .name = "gpo:charge_dis", 133 + .gpio = AT91_PIN_PC2, 134 + .active_low = 0, 135 + .default_trigger = "none", 136 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 137 + }, 138 + { 139 + .name = "led:event", 140 + .gpio = AT91_PIN_PB17, 141 + .active_low = 1, 142 + .default_trigger = "none", 143 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 144 + }, 145 + { 146 + .name = "led:lan", 147 + .gpio = AT91_PIN_PB18, 148 + .active_low = 1, 149 + .default_trigger = "none", 150 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 151 + }, 152 + { 153 + .name = "led:error", 154 + .gpio = AT91_PIN_PB16, 155 + .active_low = 1, 156 + .default_trigger = "none", 157 + .default_state = LEDS_GPIO_DEFSTATE_ON, 158 + } 159 + }; 160 + 161 + static struct gpio_led_platform_data gpio_led_info = { 162 + .leds = gpio_leds, 163 + .num_leds = ARRAY_SIZE(gpio_leds), 164 + }; 165 + 166 + static struct platform_device leds = { 167 + .name = "leds-gpio", 168 + .id = 0, 169 + .dev = { 170 + .platform_data = &gpio_led_info, 171 + } 172 + }; 173 + 174 + static void __init gsia18s_leds_init(void) 175 + { 176 + platform_device_register(&leds); 177 + } 178 + 179 + /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ 180 + static struct gpio_led pcf_gpio_leds1[] = { 181 + { /* bit 0 */ 182 + .name = "gpo:hdc_power", 183 + .gpio = PCF_GPIO_HDC_POWER, 184 + .active_low = 0, 185 + .default_trigger = "none", 186 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 187 + }, 188 + { /* bit 1 */ 189 + .name = "gpo:wifi_setup", 190 + .gpio = PCF_GPIO_WIFI_SETUP, 191 + .active_low = 1, 192 + .default_trigger = "none", 193 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 194 + }, 195 + { /* bit 2 */ 196 + .name = "gpo:wifi_enable", 197 + .gpio = PCF_GPIO_WIFI_ENABLE, 198 + .active_low = 1, 199 + .default_trigger = "none", 200 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 201 + }, 202 + { /* bit 3 */ 203 + .name = "gpo:wifi_reset", 204 + .gpio = PCF_GPIO_WIFI_RESET, 205 + .active_low = 1, 206 + .default_trigger = "none", 207 + .default_state = LEDS_GPIO_DEFSTATE_ON, 208 + }, 209 + /* bit 4 used as GPI */ 210 + { /* bit 5 */ 211 + .name = "gpo:gps_setup", 212 + .gpio = PCF_GPIO_GPS_SETUP, 213 + .active_low = 1, 214 + .default_trigger = "none", 215 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 216 + }, 217 + { /* bit 6 */ 218 + .name = "gpo:gps_standby", 219 + .gpio = PCF_GPIO_GPS_STANDBY, 220 + .active_low = 0, 221 + .default_trigger = "none", 222 + .default_state = LEDS_GPIO_DEFSTATE_ON, 223 + }, 224 + { /* bit 7 */ 225 + .name = "gpo:gps_power", 226 + .gpio = PCF_GPIO_GPS_POWER, 227 + .active_low = 0, 228 + .default_trigger = "none", 229 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 230 + } 231 + }; 232 + 233 + static struct gpio_led_platform_data pcf_gpio_led_info1 = { 234 + .leds = pcf_gpio_leds1, 235 + .num_leds = ARRAY_SIZE(pcf_gpio_leds1), 236 + }; 237 + 238 + static struct platform_device pcf_leds1 = { 239 + .name = "leds-gpio", /* GS_IA18-CB_board */ 240 + .id = 1, 241 + .dev = { 242 + .platform_data = &pcf_gpio_led_info1, 243 + } 244 + }; 245 + 246 + /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ 247 + static struct gpio_led pcf_gpio_leds2[] = { 248 + { /* bit 0 */ 249 + .name = "gpo:alarm_1", 250 + .gpio = PCF_GPIO_ALARM1, 251 + .active_low = 1, 252 + .default_trigger = "none", 253 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 254 + }, 255 + { /* bit 1 */ 256 + .name = "gpo:alarm_2", 257 + .gpio = PCF_GPIO_ALARM2, 258 + .active_low = 1, 259 + .default_trigger = "none", 260 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 261 + }, 262 + { /* bit 2 */ 263 + .name = "gpo:alarm_3", 264 + .gpio = PCF_GPIO_ALARM3, 265 + .active_low = 1, 266 + .default_trigger = "none", 267 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 268 + }, 269 + { /* bit 3 */ 270 + .name = "gpo:alarm_4", 271 + .gpio = PCF_GPIO_ALARM4, 272 + .active_low = 1, 273 + .default_trigger = "none", 274 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 275 + }, 276 + /* bits 4, 5, 6 not used */ 277 + { /* bit 7 */ 278 + .name = "gpo:alarm_v_relay_on", 279 + .gpio = PCF_GPIO_ALARM_V_RELAY_ON, 280 + .active_low = 0, 281 + .default_trigger = "none", 282 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 283 + }, 284 + }; 285 + 286 + static struct gpio_led_platform_data pcf_gpio_led_info2 = { 287 + .leds = pcf_gpio_leds2, 288 + .num_leds = ARRAY_SIZE(pcf_gpio_leds2), 289 + }; 290 + 291 + static struct platform_device pcf_leds2 = { 292 + .name = "leds-gpio", 293 + .id = 2, 294 + .dev = { 295 + .platform_data = &pcf_gpio_led_info2, 296 + } 297 + }; 298 + 299 + /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ 300 + static struct gpio_led pcf_gpio_leds3[] = { 301 + { /* bit 0 */ 302 + .name = "gpo:modem_power", 303 + .gpio = PCF_GPIO_MODEM_POWER, 304 + .active_low = 1, 305 + .default_trigger = "none", 306 + .default_state = LEDS_GPIO_DEFSTATE_OFF, 307 + }, 308 + /* bits 1 and 2 not used */ 309 + { /* bit 3 */ 310 + .name = "gpo:modem_reset", 311 + .gpio = PCF_GPIO_MODEM_RESET, 312 + .active_low = 1, 313 + .default_trigger = "none", 314 + .default_state = LEDS_GPIO_DEFSTATE_ON, 315 + }, 316 + /* bits 4, 5 and 6 not used */ 317 + { /* bit 7 */ 318 + .name = "gpo:trx_reset", 319 + .gpio = PCF_GPIO_TRX_RESET, 320 + .active_low = 1, 321 + .default_trigger = "none", 322 + .default_state = LEDS_GPIO_DEFSTATE_ON, 323 + } 324 + }; 325 + 326 + static struct gpio_led_platform_data pcf_gpio_led_info3 = { 327 + .leds = pcf_gpio_leds3, 328 + .num_leds = ARRAY_SIZE(pcf_gpio_leds3), 329 + }; 330 + 331 + static struct platform_device pcf_leds3 = { 332 + .name = "leds-gpio", 333 + .id = 3, 334 + .dev = { 335 + .platform_data = &pcf_gpio_led_info3, 336 + } 337 + }; 338 + 339 + static void __init gsia18s_pcf_leds_init(void) 340 + { 341 + platform_device_register(&pcf_leds1); 342 + platform_device_register(&pcf_leds2); 343 + platform_device_register(&pcf_leds3); 344 + } 345 + 346 + /* 347 + * SPI busses. 348 + */ 349 + static struct spi_board_info gsia18s_spi_devices[] = { 350 + { /* User accessible spi0, cs0 used for communication with MSP RTC */ 351 + .modalias = "spidev", 352 + .bus_num = 0, 353 + .chip_select = 0, 354 + .max_speed_hz = 580000, 355 + .mode = SPI_MODE_1, 356 + }, 357 + { /* User accessible spi1, cs0 used for communication with int. DSP */ 358 + .modalias = "spidev", 359 + .bus_num = 1, 360 + .chip_select = 0, 361 + .max_speed_hz = 5600000, 362 + .mode = SPI_MODE_0, 363 + }, 364 + { /* User accessible spi1, cs1 used for communication with ext. DSP */ 365 + .modalias = "spidev", 366 + .bus_num = 1, 367 + .chip_select = 1, 368 + .max_speed_hz = 5600000, 369 + .mode = SPI_MODE_0, 370 + }, 371 + { /* User accessible spi1, cs2 used for communication with ext. DSP */ 372 + .modalias = "spidev", 373 + .bus_num = 1, 374 + .chip_select = 2, 375 + .max_speed_hz = 5600000, 376 + .mode = SPI_MODE_0, 377 + }, 378 + { /* User accessible spi1, cs3 used for communication with ext. DSP */ 379 + .modalias = "spidev", 380 + .bus_num = 1, 381 + .chip_select = 3, 382 + .max_speed_hz = 5600000, 383 + .mode = SPI_MODE_0, 384 + } 385 + }; 386 + 387 + /* 388 + * GPI Buttons 389 + */ 390 + static struct gpio_keys_button buttons[] = { 391 + { 392 + .gpio = GPIO_TRIG_NET_IN, 393 + .code = BTN_1, 394 + .desc = "TRIG_NET_IN", 395 + .type = EV_KEY, 396 + .active_low = 0, 397 + .wakeup = 1, 398 + }, 399 + { /* SW80 on the GS_IA18_S-MN board*/ 400 + .gpio = GPIO_CARD_UNMOUNT_0, 401 + .code = BTN_2, 402 + .desc = "Card umount 0", 403 + .type = EV_KEY, 404 + .active_low = 1, 405 + .wakeup = 1, 406 + }, 407 + { /* SW79 on the GS_IA18_S-MN board*/ 408 + .gpio = GPIO_CARD_UNMOUNT_1, 409 + .code = BTN_3, 410 + .desc = "Card umount 1", 411 + .type = EV_KEY, 412 + .active_low = 1, 413 + .wakeup = 1, 414 + }, 415 + { /* SW280 on the GS_IA18-CB board*/ 416 + .gpio = GPIO_KEY_POWER, 417 + .code = KEY_POWER, 418 + .desc = "Power Off Button", 419 + .type = EV_KEY, 420 + .active_low = 0, 421 + .wakeup = 1, 422 + } 423 + }; 424 + 425 + static struct gpio_keys_platform_data button_data = { 426 + .buttons = buttons, 427 + .nbuttons = ARRAY_SIZE(buttons), 428 + }; 429 + 430 + static struct platform_device button_device = { 431 + .name = "gpio-keys", 432 + .id = -1, 433 + .num_resources = 0, 434 + .dev = { 435 + .platform_data = &button_data, 436 + } 437 + }; 438 + 439 + static void __init gsia18s_add_device_buttons(void) 440 + { 441 + at91_set_gpio_input(GPIO_TRIG_NET_IN, 1); 442 + at91_set_deglitch(GPIO_TRIG_NET_IN, 1); 443 + at91_set_gpio_input(GPIO_CARD_UNMOUNT_0, 1); 444 + at91_set_deglitch(GPIO_CARD_UNMOUNT_0, 1); 445 + at91_set_gpio_input(GPIO_CARD_UNMOUNT_1, 1); 446 + at91_set_deglitch(GPIO_CARD_UNMOUNT_1, 1); 447 + at91_set_gpio_input(GPIO_KEY_POWER, 0); 448 + at91_set_deglitch(GPIO_KEY_POWER, 1); 449 + 450 + platform_device_register(&button_device); 451 + } 452 + 453 + /* 454 + * I2C 455 + */ 456 + static int pcf8574x_0x20_setup(struct i2c_client *client, int gpio, 457 + unsigned int ngpio, void *context) 458 + { 459 + int status; 460 + 461 + status = gpio_request(gpio + PCF_GPIO_ETH_DETECT, "eth_det"); 462 + if (status < 0) { 463 + pr_err("error: can't request GPIO%d\n", 464 + gpio + PCF_GPIO_ETH_DETECT); 465 + return status; 466 + } 467 + status = gpio_direction_input(gpio + PCF_GPIO_ETH_DETECT); 468 + if (status < 0) { 469 + pr_err("error: can't setup GPIO%d as input\n", 470 + gpio + PCF_GPIO_ETH_DETECT); 471 + return status; 472 + } 473 + status = gpio_export(gpio + PCF_GPIO_ETH_DETECT, false); 474 + if (status < 0) { 475 + pr_err("error: can't export GPIO%d\n", 476 + gpio + PCF_GPIO_ETH_DETECT); 477 + return status; 478 + } 479 + status = gpio_sysfs_set_active_low(gpio + PCF_GPIO_ETH_DETECT, 1); 480 + if (status < 0) { 481 + pr_err("error: gpio_sysfs_set active_low(GPIO%d, 1)\n", 482 + gpio + PCF_GPIO_ETH_DETECT); 483 + return status; 484 + } 485 + 486 + return 0; 487 + } 488 + 489 + static int pcf8574x_0x20_teardown(struct i2c_client *client, int gpio, 490 + unsigned ngpio, void *context) 491 + { 492 + gpio_free(gpio + PCF_GPIO_ETH_DETECT); 493 + return 0; 494 + } 495 + 496 + static struct pcf857x_platform_data pcf20_pdata = { 497 + .gpio_base = GS_IA18_S_PCF_GPIO_BASE0, 498 + .n_latch = (1 << 4), 499 + .setup = pcf8574x_0x20_setup, 500 + .teardown = pcf8574x_0x20_teardown, 501 + }; 502 + 503 + static struct pcf857x_platform_data pcf22_pdata = { 504 + .gpio_base = GS_IA18_S_PCF_GPIO_BASE1, 505 + }; 506 + 507 + static struct pcf857x_platform_data pcf24_pdata = { 508 + .gpio_base = GS_IA18_S_PCF_GPIO_BASE2, 509 + }; 510 + 511 + static struct i2c_board_info __initdata gsia18s_i2c_devices[] = { 512 + { /* U1 on the GS_IA18-CB_V3 board */ 513 + I2C_BOARD_INFO("pcf8574", 0x20), 514 + .platform_data = &pcf20_pdata, 515 + }, 516 + { /* U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ 517 + I2C_BOARD_INFO("pcf8574", 0x22), 518 + .platform_data = &pcf22_pdata, 519 + }, 520 + { /* U1 on the GS_2G-OPT23-A_V0 board (Modem) */ 521 + I2C_BOARD_INFO("pcf8574", 0x24), 522 + .platform_data = &pcf24_pdata, 523 + }, 524 + { /* U161 on the GS_IA18_S-MN board */ 525 + I2C_BOARD_INFO("24c1024", 0x50), 526 + }, 527 + { /* U162 on the GS_IA18_S-MN board */ 528 + I2C_BOARD_INFO("24c01", 0x53), 529 + }, 530 + }; 531 + 532 + /* 533 + * Compact Flash 534 + */ 535 + static struct at91_cf_data __initdata gsia18s_cf1_data = { 536 + .irq_pin = AT91_PIN_PA27, 537 + .det_pin = AT91_PIN_PB30, 538 + .rst_pin = AT91_PIN_PB31, 539 + .chipselect = 5, 540 + .flags = AT91_CF_TRUE_IDE, 541 + }; 542 + 543 + /* Power Off by RTC */ 544 + static void gsia18s_power_off(void) 545 + { 546 + pr_notice("Power supply will be switched off automatically now or after 60 seconds without ArmDAS.\n"); 547 + at91_set_gpio_output(AT91_PIN_PA25, 1); 548 + /* Spin to death... */ 549 + while (1) 550 + ; 551 + } 552 + 553 + static int __init gsia18s_power_off_init(void) 554 + { 555 + pm_power_off = gsia18s_power_off; 556 + return 0; 557 + } 558 + 559 + /* ---------------------------------------------------------------------------*/ 560 + 561 + static void __init gsia18s_board_init(void) 562 + { 563 + stamp9g20_board_init(); 564 + at91_add_device_usbh(&usbh_data); 565 + at91_add_device_udc(&udc_data); 566 + at91_add_device_eth(&macb_data); 567 + gsia18s_leds_init(); 568 + gsia18s_pcf_leds_init(); 569 + gsia18s_add_device_buttons(); 570 + at91_add_device_i2c(gsia18s_i2c_devices, 571 + ARRAY_SIZE(gsia18s_i2c_devices)); 572 + at91_add_device_cf(&gsia18s_cf1_data); 573 + at91_add_device_spi(gsia18s_spi_devices, 574 + ARRAY_SIZE(gsia18s_spi_devices)); 575 + gsia18s_power_off_init(); 576 + } 577 + 578 + MACHINE_START(GSIA18S, "GS_IA18_S") 579 + .boot_params = AT91_SDRAM_BASE + 0x100, 580 + .timer = &at91sam926x_timer, 581 + .map_io = gsia18s_map_io, 582 + .init_irq = init_irq, 583 + .init_machine = gsia18s_board_init, 584 + MACHINE_END
-1
arch/arm/mach-at91/board-sam9m10g45ek.c
··· 37 #include <asm/mach/map.h> 38 #include <asm/mach/irq.h> 39 40 - #include <mach/hardware.h> 41 #include <mach/board.h> 42 #include <mach/gpio.h> 43 #include <mach/at91sam9_smc.h>
··· 37 #include <asm/mach/map.h> 38 #include <asm/mach/irq.h> 39 40 #include <mach/board.h> 41 #include <mach/gpio.h> 42 #include <mach/at91sam9_smc.h>
+17 -17
arch/arm/mach-at91/gpio.c
··· 274 static u32 wakeups[MAX_GPIO_BANKS]; 275 static u32 backups[MAX_GPIO_BANKS]; 276 277 - static int gpio_irq_set_wake(unsigned pin, unsigned state) 278 { 279 - unsigned mask = pin_to_mask(pin); 280 - unsigned bank = (pin - PIN_BASE) / 32; 281 282 if (unlikely(bank >= MAX_GPIO_BANKS)) 283 return -EINVAL; ··· 344 * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. 345 */ 346 347 - static void gpio_irq_mask(unsigned pin) 348 { 349 - void __iomem *pio = pin_to_controller(pin); 350 - unsigned mask = pin_to_mask(pin); 351 352 if (pio) 353 __raw_writel(mask, pio + PIO_IDR); 354 } 355 356 - static void gpio_irq_unmask(unsigned pin) 357 { 358 - void __iomem *pio = pin_to_controller(pin); 359 - unsigned mask = pin_to_mask(pin); 360 361 if (pio) 362 __raw_writel(mask, pio + PIO_IER); 363 } 364 365 - static int gpio_irq_type(unsigned pin, unsigned type) 366 { 367 switch (type) { 368 case IRQ_TYPE_NONE: ··· 375 376 static struct irq_chip gpio_irqchip = { 377 .name = "GPIO", 378 - .mask = gpio_irq_mask, 379 - .unmask = gpio_irq_unmask, 380 - .set_type = gpio_irq_type, 381 - .set_wake = gpio_irq_set_wake, 382 }; 383 384 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) ··· 393 pio = at91_gpio->regbase; 394 395 /* temporarily mask (level sensitive) parent IRQ */ 396 - desc->chip->ack(irq); 397 for (;;) { 398 /* Reading ISR acks pending (edge triggered) GPIO interrupts. 399 * When there none are pending, we're finished unless we need ··· 419 * another IRQ must be generated before it actually gets 420 * here to be disabled on the GPIO controller. 421 */ 422 - gpio_irq_mask(pin); 423 } 424 else 425 generic_handle_irq(pin); ··· 429 isr >>= 1; 430 } 431 } 432 - desc->chip->unmask(irq); 433 /* now it may re-trigger */ 434 } 435
··· 274 static u32 wakeups[MAX_GPIO_BANKS]; 275 static u32 backups[MAX_GPIO_BANKS]; 276 277 + static int gpio_irq_set_wake(struct irq_data *d, unsigned state) 278 { 279 + unsigned mask = pin_to_mask(d->irq); 280 + unsigned bank = (d->irq - PIN_BASE) / 32; 281 282 if (unlikely(bank >= MAX_GPIO_BANKS)) 283 return -EINVAL; ··· 344 * IRQ0..IRQ6 should be configurable, e.g. level vs edge triggering. 345 */ 346 347 + static void gpio_irq_mask(struct irq_data *d) 348 { 349 + void __iomem *pio = pin_to_controller(d->irq); 350 + unsigned mask = pin_to_mask(d->irq); 351 352 if (pio) 353 __raw_writel(mask, pio + PIO_IDR); 354 } 355 356 + static void gpio_irq_unmask(struct irq_data *d) 357 { 358 + void __iomem *pio = pin_to_controller(d->irq); 359 + unsigned mask = pin_to_mask(d->irq); 360 361 if (pio) 362 __raw_writel(mask, pio + PIO_IER); 363 } 364 365 + static int gpio_irq_type(struct irq_data *d, unsigned type) 366 { 367 switch (type) { 368 case IRQ_TYPE_NONE: ··· 375 376 static struct irq_chip gpio_irqchip = { 377 .name = "GPIO", 378 + .irq_mask = gpio_irq_mask, 379 + .irq_unmask = gpio_irq_unmask, 380 + .irq_set_type = gpio_irq_type, 381 + .irq_set_wake = gpio_irq_set_wake, 382 }; 383 384 static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) ··· 393 pio = at91_gpio->regbase; 394 395 /* temporarily mask (level sensitive) parent IRQ */ 396 + desc->irq_data.chip->irq_ack(&desc->irq_data); 397 for (;;) { 398 /* Reading ISR acks pending (edge triggered) GPIO interrupts. 399 * When there none are pending, we're finished unless we need ··· 419 * another IRQ must be generated before it actually gets 420 * here to be disabled on the GPIO controller. 421 */ 422 + gpio_irq_mask(irq_get_irq_data(pin)); 423 } 424 else 425 generic_handle_irq(pin); ··· 429 isr >>= 1; 430 } 431 } 432 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 433 /* now it may re-trigger */ 434 } 435
+33
arch/arm/mach-at91/include/mach/gsia18s.h
···
··· 1 + /* Buttons */ 2 + #define GPIO_TRIG_NET_IN AT91_PIN_PB21 3 + #define GPIO_CARD_UNMOUNT_0 AT91_PIN_PB13 4 + #define GPIO_CARD_UNMOUNT_1 AT91_PIN_PB12 5 + #define GPIO_KEY_POWER AT91_PIN_PA25 6 + 7 + /* PCF8574 0x20 GPIO - U1 on the GS_IA18-CB_V3 board */ 8 + #define GS_IA18_S_PCF_GPIO_BASE0 NR_BUILTIN_GPIO 9 + #define PCF_GPIO_HDC_POWER (GS_IA18_S_PCF_GPIO_BASE0 + 0) 10 + #define PCF_GPIO_WIFI_SETUP (GS_IA18_S_PCF_GPIO_BASE0 + 1) 11 + #define PCF_GPIO_WIFI_ENABLE (GS_IA18_S_PCF_GPIO_BASE0 + 2) 12 + #define PCF_GPIO_WIFI_RESET (GS_IA18_S_PCF_GPIO_BASE0 + 3) 13 + #define PCF_GPIO_ETH_DETECT 4 /* this is a GPI */ 14 + #define PCF_GPIO_GPS_SETUP (GS_IA18_S_PCF_GPIO_BASE0 + 5) 15 + #define PCF_GPIO_GPS_STANDBY (GS_IA18_S_PCF_GPIO_BASE0 + 6) 16 + #define PCF_GPIO_GPS_POWER (GS_IA18_S_PCF_GPIO_BASE0 + 7) 17 + 18 + /* PCF8574 0x22 GPIO - U1 on the GS_2G_OPT1-A_V0 board (Alarm) */ 19 + #define GS_IA18_S_PCF_GPIO_BASE1 (GS_IA18_S_PCF_GPIO_BASE0 + 8) 20 + #define PCF_GPIO_ALARM1 (GS_IA18_S_PCF_GPIO_BASE1 + 0) 21 + #define PCF_GPIO_ALARM2 (GS_IA18_S_PCF_GPIO_BASE1 + 1) 22 + #define PCF_GPIO_ALARM3 (GS_IA18_S_PCF_GPIO_BASE1 + 2) 23 + #define PCF_GPIO_ALARM4 (GS_IA18_S_PCF_GPIO_BASE1 + 3) 24 + /* bits 4, 5, 6 not used */ 25 + #define PCF_GPIO_ALARM_V_RELAY_ON (GS_IA18_S_PCF_GPIO_BASE1 + 7) 26 + 27 + /* PCF8574 0x24 GPIO U1 on the GS_2G-OPT23-A_V0 board (Modem) */ 28 + #define GS_IA18_S_PCF_GPIO_BASE2 (GS_IA18_S_PCF_GPIO_BASE1 + 8) 29 + #define PCF_GPIO_MODEM_POWER (GS_IA18_S_PCF_GPIO_BASE2 + 0) 30 + #define PCF_GPIO_MODEM_RESET (GS_IA18_S_PCF_GPIO_BASE2 + 3) 31 + /* bits 1, 2, 4, 5 not used */ 32 + #define PCF_GPIO_TRX_RESET (GS_IA18_S_PCF_GPIO_BASE2 + 6) 33 + /* bit 7 not used */
+18 -18
arch/arm/mach-at91/irq.c
··· 34 #include <asm/mach/map.h> 35 36 37 - static void at91_aic_mask_irq(unsigned int irq) 38 { 39 /* Disable interrupt on AIC */ 40 - at91_sys_write(AT91_AIC_IDCR, 1 << irq); 41 } 42 43 - static void at91_aic_unmask_irq(unsigned int irq) 44 { 45 /* Enable interrupt on AIC */ 46 - at91_sys_write(AT91_AIC_IECR, 1 << irq); 47 } 48 49 unsigned int at91_extern_irq; 50 51 #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) 52 53 - static int at91_aic_set_type(unsigned irq, unsigned type) 54 { 55 unsigned int smr, srctype; 56 ··· 62 srctype = AT91_AIC_SRCTYPE_RISING; 63 break; 64 case IRQ_TYPE_LEVEL_LOW: 65 - if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ 66 srctype = AT91_AIC_SRCTYPE_LOW; 67 else 68 return -EINVAL; 69 break; 70 case IRQ_TYPE_EDGE_FALLING: 71 - if ((irq == AT91_ID_FIQ) || is_extern_irq(irq)) /* only supported on external interrupts */ 72 srctype = AT91_AIC_SRCTYPE_FALLING; 73 else 74 return -EINVAL; ··· 77 return -EINVAL; 78 } 79 80 - smr = at91_sys_read(AT91_AIC_SMR(irq)) & ~AT91_AIC_SRCTYPE; 81 - at91_sys_write(AT91_AIC_SMR(irq), smr | srctype); 82 return 0; 83 } 84 ··· 87 static u32 wakeups; 88 static u32 backups; 89 90 - static int at91_aic_set_wake(unsigned irq, unsigned value) 91 { 92 - if (unlikely(irq >= 32)) 93 return -EINVAL; 94 95 if (value) 96 - wakeups |= (1 << irq); 97 else 98 - wakeups &= ~(1 << irq); 99 100 return 0; 101 } ··· 119 120 static struct irq_chip at91_aic_chip = { 121 .name = "AIC", 122 - .ack = at91_aic_mask_irq, 123 - .mask = at91_aic_mask_irq, 124 - .unmask = at91_aic_unmask_irq, 125 - .set_type = at91_aic_set_type, 126 - .set_wake = at91_aic_set_wake, 127 }; 128 129 /*
··· 34 #include <asm/mach/map.h> 35 36 37 + static void at91_aic_mask_irq(struct irq_data *d) 38 { 39 /* Disable interrupt on AIC */ 40 + at91_sys_write(AT91_AIC_IDCR, 1 << d->irq); 41 } 42 43 + static void at91_aic_unmask_irq(struct irq_data *d) 44 { 45 /* Enable interrupt on AIC */ 46 + at91_sys_write(AT91_AIC_IECR, 1 << d->irq); 47 } 48 49 unsigned int at91_extern_irq; 50 51 #define is_extern_irq(irq) ((1 << (irq)) & at91_extern_irq) 52 53 + static int at91_aic_set_type(struct irq_data *d, unsigned type) 54 { 55 unsigned int smr, srctype; 56 ··· 62 srctype = AT91_AIC_SRCTYPE_RISING; 63 break; 64 case IRQ_TYPE_LEVEL_LOW: 65 + if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ 66 srctype = AT91_AIC_SRCTYPE_LOW; 67 else 68 return -EINVAL; 69 break; 70 case IRQ_TYPE_EDGE_FALLING: 71 + if ((d->irq == AT91_ID_FIQ) || is_extern_irq(d->irq)) /* only supported on external interrupts */ 72 srctype = AT91_AIC_SRCTYPE_FALLING; 73 else 74 return -EINVAL; ··· 77 return -EINVAL; 78 } 79 80 + smr = at91_sys_read(AT91_AIC_SMR(d->irq)) & ~AT91_AIC_SRCTYPE; 81 + at91_sys_write(AT91_AIC_SMR(d->irq), smr | srctype); 82 return 0; 83 } 84 ··· 87 static u32 wakeups; 88 static u32 backups; 89 90 + static int at91_aic_set_wake(struct irq_data *d, unsigned value) 91 { 92 + if (unlikely(d->irq >= 32)) 93 return -EINVAL; 94 95 if (value) 96 + wakeups |= (1 << d->irq); 97 else 98 + wakeups &= ~(1 << d->irq); 99 100 return 0; 101 } ··· 119 120 static struct irq_chip at91_aic_chip = { 121 .name = "AIC", 122 + .irq_ack = at91_aic_mask_irq, 123 + .irq_mask = at91_aic_mask_irq, 124 + .irq_unmask = at91_aic_unmask_irq, 125 + .irq_set_type = at91_aic_set_type, 126 + .irq_set_wake = at91_aic_set_wake, 127 }; 128 129 /*
+21 -21
arch/arm/mach-bcmring/irq.c
··· 30 #include <mach/csp/intcHw_reg.h> 31 #include <mach/csp/mm_io.h> 32 33 - static void bcmring_mask_irq0(unsigned int irq) 34 { 35 - writel(1 << (irq - IRQ_INTC0_START), 36 MM_IO_BASE_INTC0 + INTCHW_INTENCLEAR); 37 } 38 39 - static void bcmring_unmask_irq0(unsigned int irq) 40 { 41 - writel(1 << (irq - IRQ_INTC0_START), 42 MM_IO_BASE_INTC0 + INTCHW_INTENABLE); 43 } 44 45 - static void bcmring_mask_irq1(unsigned int irq) 46 { 47 - writel(1 << (irq - IRQ_INTC1_START), 48 MM_IO_BASE_INTC1 + INTCHW_INTENCLEAR); 49 } 50 51 - static void bcmring_unmask_irq1(unsigned int irq) 52 { 53 - writel(1 << (irq - IRQ_INTC1_START), 54 MM_IO_BASE_INTC1 + INTCHW_INTENABLE); 55 } 56 57 - static void bcmring_mask_irq2(unsigned int irq) 58 { 59 - writel(1 << (irq - IRQ_SINTC_START), 60 MM_IO_BASE_SINTC + INTCHW_INTENCLEAR); 61 } 62 63 - static void bcmring_unmask_irq2(unsigned int irq) 64 { 65 - writel(1 << (irq - IRQ_SINTC_START), 66 MM_IO_BASE_SINTC + INTCHW_INTENABLE); 67 } 68 69 static struct irq_chip bcmring_irq0_chip = { 70 .name = "ARM-INTC0", 71 - .ack = bcmring_mask_irq0, 72 - .mask = bcmring_mask_irq0, /* mask a specific interrupt, blocking its delivery. */ 73 - .unmask = bcmring_unmask_irq0, /* unmaks an interrupt */ 74 }; 75 76 static struct irq_chip bcmring_irq1_chip = { 77 .name = "ARM-INTC1", 78 - .ack = bcmring_mask_irq1, 79 - .mask = bcmring_mask_irq1, 80 - .unmask = bcmring_unmask_irq1, 81 }; 82 83 static struct irq_chip bcmring_irq2_chip = { 84 .name = "ARM-SINTC", 85 - .ack = bcmring_mask_irq2, 86 - .mask = bcmring_mask_irq2, 87 - .unmask = bcmring_unmask_irq2, 88 }; 89 90 static void vic_init(void __iomem *base, struct irq_chip *chip,
··· 30 #include <mach/csp/intcHw_reg.h> 31 #include <mach/csp/mm_io.h> 32 33 + static void bcmring_mask_irq0(struct irq_data *d) 34 { 35 + writel(1 << (d->irq - IRQ_INTC0_START), 36 MM_IO_BASE_INTC0 + INTCHW_INTENCLEAR); 37 } 38 39 + static void bcmring_unmask_irq0(struct irq_data *d) 40 { 41 + writel(1 << (d->irq - IRQ_INTC0_START), 42 MM_IO_BASE_INTC0 + INTCHW_INTENABLE); 43 } 44 45 + static void bcmring_mask_irq1(struct irq_data *d) 46 { 47 + writel(1 << (d->irq - IRQ_INTC1_START), 48 MM_IO_BASE_INTC1 + INTCHW_INTENCLEAR); 49 } 50 51 + static void bcmring_unmask_irq1(struct irq_data *d) 52 { 53 + writel(1 << (d->irq - IRQ_INTC1_START), 54 MM_IO_BASE_INTC1 + INTCHW_INTENABLE); 55 } 56 57 + static void bcmring_mask_irq2(struct irq_data *d) 58 { 59 + writel(1 << (d->irq - IRQ_SINTC_START), 60 MM_IO_BASE_SINTC + INTCHW_INTENCLEAR); 61 } 62 63 + static void bcmring_unmask_irq2(struct irq_data *d) 64 { 65 + writel(1 << (d->irq - IRQ_SINTC_START), 66 MM_IO_BASE_SINTC + INTCHW_INTENABLE); 67 } 68 69 static struct irq_chip bcmring_irq0_chip = { 70 .name = "ARM-INTC0", 71 + .irq_ack = bcmring_mask_irq0, 72 + .irq_mask = bcmring_mask_irq0, /* mask a specific interrupt, blocking its delivery. */ 73 + .irq_unmask = bcmring_unmask_irq0, /* unmaks an interrupt */ 74 }; 75 76 static struct irq_chip bcmring_irq1_chip = { 77 .name = "ARM-INTC1", 78 + .irq_ack = bcmring_mask_irq1, 79 + .irq_mask = bcmring_mask_irq1, 80 + .irq_unmask = bcmring_unmask_irq1, 81 }; 82 83 static struct irq_chip bcmring_irq2_chip = { 84 .name = "ARM-SINTC", 85 + .irq_ack = bcmring_mask_irq2, 86 + .irq_mask = bcmring_mask_irq2, 87 + .irq_unmask = bcmring_unmask_irq2, 88 }; 89 90 static void vic_init(void __iomem *base, struct irq_chip *chip,
+20 -20
arch/arm/mach-clps711x/irq.c
··· 27 28 #include <asm/hardware/clps7111.h> 29 30 - static void int1_mask(unsigned int irq) 31 { 32 u32 intmr1; 33 34 intmr1 = clps_readl(INTMR1); 35 - intmr1 &= ~(1 << irq); 36 clps_writel(intmr1, INTMR1); 37 } 38 39 - static void int1_ack(unsigned int irq) 40 { 41 u32 intmr1; 42 43 intmr1 = clps_readl(INTMR1); 44 - intmr1 &= ~(1 << irq); 45 clps_writel(intmr1, INTMR1); 46 47 - switch (irq) { 48 case IRQ_CSINT: clps_writel(0, COEOI); break; 49 case IRQ_TC1OI: clps_writel(0, TC1EOI); break; 50 case IRQ_TC2OI: clps_writel(0, TC2EOI); break; ··· 54 } 55 } 56 57 - static void int1_unmask(unsigned int irq) 58 { 59 u32 intmr1; 60 61 intmr1 = clps_readl(INTMR1); 62 - intmr1 |= 1 << irq; 63 clps_writel(intmr1, INTMR1); 64 } 65 66 static struct irq_chip int1_chip = { 67 - .ack = int1_ack, 68 - .mask = int1_mask, 69 - .unmask = int1_unmask, 70 }; 71 72 - static void int2_mask(unsigned int irq) 73 { 74 u32 intmr2; 75 76 intmr2 = clps_readl(INTMR2); 77 - intmr2 &= ~(1 << (irq - 16)); 78 clps_writel(intmr2, INTMR2); 79 } 80 81 - static void int2_ack(unsigned int irq) 82 { 83 u32 intmr2; 84 85 intmr2 = clps_readl(INTMR2); 86 - intmr2 &= ~(1 << (irq - 16)); 87 clps_writel(intmr2, INTMR2); 88 89 - switch (irq) { 90 case IRQ_KBDINT: clps_writel(0, KBDEOI); break; 91 } 92 } 93 94 - static void int2_unmask(unsigned int irq) 95 { 96 u32 intmr2; 97 98 intmr2 = clps_readl(INTMR2); 99 - intmr2 |= 1 << (irq - 16); 100 clps_writel(intmr2, INTMR2); 101 } 102 103 static struct irq_chip int2_chip = { 104 - .ack = int2_ack, 105 - .mask = int2_mask, 106 - .unmask = int2_unmask, 107 }; 108 109 void __init clps711x_init_irq(void)
··· 27 28 #include <asm/hardware/clps7111.h> 29 30 + static void int1_mask(struct irq_data *d) 31 { 32 u32 intmr1; 33 34 intmr1 = clps_readl(INTMR1); 35 + intmr1 &= ~(1 << d->irq); 36 clps_writel(intmr1, INTMR1); 37 } 38 39 + static void int1_ack(struct irq_data *d) 40 { 41 u32 intmr1; 42 43 intmr1 = clps_readl(INTMR1); 44 + intmr1 &= ~(1 << d->irq); 45 clps_writel(intmr1, INTMR1); 46 47 + switch (d->irq) { 48 case IRQ_CSINT: clps_writel(0, COEOI); break; 49 case IRQ_TC1OI: clps_writel(0, TC1EOI); break; 50 case IRQ_TC2OI: clps_writel(0, TC2EOI); break; ··· 54 } 55 } 56 57 + static void int1_unmask(struct irq_data *d) 58 { 59 u32 intmr1; 60 61 intmr1 = clps_readl(INTMR1); 62 + intmr1 |= 1 << d->irq; 63 clps_writel(intmr1, INTMR1); 64 } 65 66 static struct irq_chip int1_chip = { 67 + .irq_ack = int1_ack, 68 + .irq_mask = int1_mask, 69 + .irq_unmask = int1_unmask, 70 }; 71 72 + static void int2_mask(struct irq_data *d) 73 { 74 u32 intmr2; 75 76 intmr2 = clps_readl(INTMR2); 77 + intmr2 &= ~(1 << (d->irq - 16)); 78 clps_writel(intmr2, INTMR2); 79 } 80 81 + static void int2_ack(struct irq_data *d) 82 { 83 u32 intmr2; 84 85 intmr2 = clps_readl(INTMR2); 86 + intmr2 &= ~(1 << (d->irq - 16)); 87 clps_writel(intmr2, INTMR2); 88 89 + switch (d->irq) { 90 case IRQ_KBDINT: clps_writel(0, KBDEOI); break; 91 } 92 } 93 94 + static void int2_unmask(struct irq_data *d) 95 { 96 u32 intmr2; 97 98 intmr2 = clps_readl(INTMR2); 99 + intmr2 |= 1 << (d->irq - 16); 100 clps_writel(intmr2, INTMR2); 101 } 102 103 static struct irq_chip int2_chip = { 104 + .irq_ack = int2_ack, 105 + .irq_mask = int2_mask, 106 + .irq_unmask = int2_unmask, 107 }; 108 109 void __init clps711x_init_irq(void)
+15 -15
arch/arm/mach-davinci/cp_intc.c
··· 26 __raw_writel(value, davinci_intc_base + offset); 27 } 28 29 - static void cp_intc_ack_irq(unsigned int irq) 30 { 31 - cp_intc_write(irq, CP_INTC_SYS_STAT_IDX_CLR); 32 } 33 34 /* Disable interrupt */ 35 - static void cp_intc_mask_irq(unsigned int irq) 36 { 37 /* XXX don't know why we need to disable nIRQ here... */ 38 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR); 39 - cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_CLR); 40 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); 41 } 42 43 /* Enable interrupt */ 44 - static void cp_intc_unmask_irq(unsigned int irq) 45 { 46 - cp_intc_write(irq, CP_INTC_SYS_ENABLE_IDX_SET); 47 } 48 49 - static int cp_intc_set_irq_type(unsigned int irq, unsigned int flow_type) 50 { 51 - unsigned reg = BIT_WORD(irq); 52 - unsigned mask = BIT_MASK(irq); 53 unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg)); 54 unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg)); 55 ··· 85 * generic drivers which call {enable|disable}_irq_wake for 86 * wake up interrupt sources (eg RTC on DA850). 87 */ 88 - static int cp_intc_set_wake(unsigned int irq, unsigned int on) 89 { 90 return 0; 91 } 92 93 static struct irq_chip cp_intc_irq_chip = { 94 .name = "cp_intc", 95 - .ack = cp_intc_ack_irq, 96 - .mask = cp_intc_mask_irq, 97 - .unmask = cp_intc_unmask_irq, 98 - .set_type = cp_intc_set_irq_type, 99 - .set_wake = cp_intc_set_wake, 100 }; 101 102 void __init cp_intc_init(void)
··· 26 __raw_writel(value, davinci_intc_base + offset); 27 } 28 29 + static void cp_intc_ack_irq(struct irq_data *d) 30 { 31 + cp_intc_write(d->irq, CP_INTC_SYS_STAT_IDX_CLR); 32 } 33 34 /* Disable interrupt */ 35 + static void cp_intc_mask_irq(struct irq_data *d) 36 { 37 /* XXX don't know why we need to disable nIRQ here... */ 38 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR); 39 + cp_intc_write(d->irq, CP_INTC_SYS_ENABLE_IDX_CLR); 40 cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET); 41 } 42 43 /* Enable interrupt */ 44 + static void cp_intc_unmask_irq(struct irq_data *d) 45 { 46 + cp_intc_write(d->irq, CP_INTC_SYS_ENABLE_IDX_SET); 47 } 48 49 + static int cp_intc_set_irq_type(struct irq_data *d, unsigned int flow_type) 50 { 51 + unsigned reg = BIT_WORD(d->irq); 52 + unsigned mask = BIT_MASK(d->irq); 53 unsigned polarity = cp_intc_read(CP_INTC_SYS_POLARITY(reg)); 54 unsigned type = cp_intc_read(CP_INTC_SYS_TYPE(reg)); 55 ··· 85 * generic drivers which call {enable|disable}_irq_wake for 86 * wake up interrupt sources (eg RTC on DA850). 87 */ 88 + static int cp_intc_set_wake(struct irq_data *d, unsigned int on) 89 { 90 return 0; 91 } 92 93 static struct irq_chip cp_intc_irq_chip = { 94 .name = "cp_intc", 95 + .irq_ack = cp_intc_ack_irq, 96 + .irq_mask = cp_intc_mask_irq, 97 + .irq_unmask = cp_intc_unmask_irq, 98 + .irq_set_type = cp_intc_set_irq_type, 99 + .irq_set_wake = cp_intc_set_wake, 100 }; 101 102 void __init cp_intc_init(void)
+23 -23
arch/arm/mach-davinci/gpio.c
··· 205 * serve as EDMA event triggers. 206 */ 207 208 - static void gpio_irq_disable(unsigned irq) 209 { 210 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 211 - u32 mask = (u32) get_irq_data(irq); 212 213 __raw_writel(mask, &g->clr_falling); 214 __raw_writel(mask, &g->clr_rising); 215 } 216 217 - static void gpio_irq_enable(unsigned irq) 218 { 219 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 220 - u32 mask = (u32) get_irq_data(irq); 221 - unsigned status = irq_desc[irq].status; 222 223 status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING; 224 if (!status) ··· 230 __raw_writel(mask, &g->set_rising); 231 } 232 233 - static int gpio_irq_type(unsigned irq, unsigned trigger) 234 { 235 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 236 - u32 mask = (u32) get_irq_data(irq); 237 238 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 239 return -EINVAL; 240 241 - irq_desc[irq].status &= ~IRQ_TYPE_SENSE_MASK; 242 - irq_desc[irq].status |= trigger; 243 244 /* don't enable the IRQ if it's currently disabled */ 245 - if (irq_desc[irq].depth == 0) { 246 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING) 247 ? &g->set_falling : &g->clr_falling); 248 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING) ··· 253 254 static struct irq_chip gpio_irqchip = { 255 .name = "GPIO", 256 - .enable = gpio_irq_enable, 257 - .disable = gpio_irq_disable, 258 - .set_type = gpio_irq_type, 259 }; 260 261 static void ··· 269 mask <<= 16; 270 271 /* temporarily mask (level sensitive) parent IRQ */ 272 - desc->chip->mask(irq); 273 - desc->chip->ack(irq); 274 while (1) { 275 u32 status; 276 int n; ··· 293 status >>= res; 294 } 295 } 296 - desc->chip->unmask(irq); 297 /* now it may re-trigger */ 298 } 299 ··· 320 return -ENODEV; 321 } 322 323 - static int gpio_irq_type_unbanked(unsigned irq, unsigned trigger) 324 { 325 - struct davinci_gpio_regs __iomem *g = irq2regs(irq); 326 - u32 mask = (u32) get_irq_data(irq); 327 328 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 329 return -EINVAL; ··· 397 irq = bank_irq; 398 gpio_irqchip_unbanked = *get_irq_desc_chip(irq_to_desc(irq)); 399 gpio_irqchip_unbanked.name = "GPIO-AINTC"; 400 - gpio_irqchip_unbanked.set_type = gpio_irq_type_unbanked; 401 402 /* default trigger: both edges */ 403 g = gpio2regs(0);
··· 205 * serve as EDMA event triggers. 206 */ 207 208 + static void gpio_irq_disable(struct irq_data *d) 209 { 210 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 211 + u32 mask = (u32) irq_data_get_irq_data(d); 212 213 __raw_writel(mask, &g->clr_falling); 214 __raw_writel(mask, &g->clr_rising); 215 } 216 217 + static void gpio_irq_enable(struct irq_data *d) 218 { 219 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 220 + u32 mask = (u32) irq_data_get_irq_data(d); 221 + unsigned status = irq_desc[d->irq].status; 222 223 status &= IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING; 224 if (!status) ··· 230 __raw_writel(mask, &g->set_rising); 231 } 232 233 + static int gpio_irq_type(struct irq_data *d, unsigned trigger) 234 { 235 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 236 + u32 mask = (u32) irq_data_get_irq_data(d); 237 238 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 239 return -EINVAL; 240 241 + irq_desc[d->irq].status &= ~IRQ_TYPE_SENSE_MASK; 242 + irq_desc[d->irq].status |= trigger; 243 244 /* don't enable the IRQ if it's currently disabled */ 245 + if (irq_desc[d->irq].depth == 0) { 246 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_FALLING) 247 ? &g->set_falling : &g->clr_falling); 248 __raw_writel(mask, (trigger & IRQ_TYPE_EDGE_RISING) ··· 253 254 static struct irq_chip gpio_irqchip = { 255 .name = "GPIO", 256 + .irq_enable = gpio_irq_enable, 257 + .irq_disable = gpio_irq_disable, 258 + .irq_set_type = gpio_irq_type, 259 }; 260 261 static void ··· 269 mask <<= 16; 270 271 /* temporarily mask (level sensitive) parent IRQ */ 272 + desc->irq_data.chip->irq_mask(&desc->irq_data); 273 + desc->irq_data.chip->irq_ack(&desc->irq_data); 274 while (1) { 275 u32 status; 276 int n; ··· 293 status >>= res; 294 } 295 } 296 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 297 /* now it may re-trigger */ 298 } 299 ··· 320 return -ENODEV; 321 } 322 323 + static int gpio_irq_type_unbanked(struct irq_data *d, unsigned trigger) 324 { 325 + struct davinci_gpio_regs __iomem *g = irq2regs(d->irq); 326 + u32 mask = (u32) irq_data_get_irq_data(d); 327 328 if (trigger & ~(IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 329 return -EINVAL; ··· 397 irq = bank_irq; 398 gpio_irqchip_unbanked = *get_irq_desc_chip(irq_to_desc(irq)); 399 gpio_irqchip_unbanked.name = "GPIO-AINTC"; 400 + gpio_irqchip_unbanked.irq_set_type = gpio_irq_type_unbanked; 401 402 /* default trigger: both edges */ 403 g = gpio2regs(0);
+13 -13
arch/arm/mach-davinci/irq.c
··· 53 } 54 55 /* Disable interrupt */ 56 - static void davinci_mask_irq(unsigned int irq) 57 { 58 unsigned int mask; 59 u32 l; 60 61 - mask = 1 << IRQ_BIT(irq); 62 63 - if (irq > 31) { 64 l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); 65 l &= ~mask; 66 davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); ··· 72 } 73 74 /* Enable interrupt */ 75 - static void davinci_unmask_irq(unsigned int irq) 76 { 77 unsigned int mask; 78 u32 l; 79 80 - mask = 1 << IRQ_BIT(irq); 81 82 - if (irq > 31) { 83 l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); 84 l |= mask; 85 davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); ··· 91 } 92 93 /* EOI interrupt */ 94 - static void davinci_ack_irq(unsigned int irq) 95 { 96 unsigned int mask; 97 98 - mask = 1 << IRQ_BIT(irq); 99 100 - if (irq > 31) 101 davinci_irq_writel(mask, IRQ_REG1_OFFSET); 102 else 103 davinci_irq_writel(mask, IRQ_REG0_OFFSET); 104 } 105 106 static struct irq_chip davinci_irq_chip_0 = { 107 - .name = "AINTC", 108 - .ack = davinci_ack_irq, 109 - .mask = davinci_mask_irq, 110 - .unmask = davinci_unmask_irq, 111 }; 112 113 /* ARM Interrupt Controller Initialization */
··· 53 } 54 55 /* Disable interrupt */ 56 + static void davinci_mask_irq(struct irq_data *d) 57 { 58 unsigned int mask; 59 u32 l; 60 61 + mask = 1 << IRQ_BIT(d->irq); 62 63 + if (d->irq > 31) { 64 l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); 65 l &= ~mask; 66 davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); ··· 72 } 73 74 /* Enable interrupt */ 75 + static void davinci_unmask_irq(struct irq_data *d) 76 { 77 unsigned int mask; 78 u32 l; 79 80 + mask = 1 << IRQ_BIT(d->irq); 81 82 + if (d->irq > 31) { 83 l = davinci_irq_readl(IRQ_ENT_REG1_OFFSET); 84 l |= mask; 85 davinci_irq_writel(l, IRQ_ENT_REG1_OFFSET); ··· 91 } 92 93 /* EOI interrupt */ 94 + static void davinci_ack_irq(struct irq_data *d) 95 { 96 unsigned int mask; 97 98 + mask = 1 << IRQ_BIT(d->irq); 99 100 + if (d->irq > 31) 101 davinci_irq_writel(mask, IRQ_REG1_OFFSET); 102 else 103 davinci_irq_writel(mask, IRQ_REG0_OFFSET); 104 } 105 106 static struct irq_chip davinci_irq_chip_0 = { 107 + .name = "AINTC", 108 + .irq_ack = davinci_ack_irq, 109 + .irq_mask = davinci_mask_irq, 110 + .irq_unmask = davinci_unmask_irq, 111 }; 112 113 /* ARM Interrupt Controller Initialization */
+9 -9
arch/arm/mach-dove/irq.c
··· 36 } 37 } 38 39 - static void pmu_irq_mask(unsigned int irq) 40 { 41 - int pin = irq_to_pmu(irq); 42 u32 u; 43 44 u = readl(PMU_INTERRUPT_MASK); ··· 46 writel(u, PMU_INTERRUPT_MASK); 47 } 48 49 - static void pmu_irq_unmask(unsigned int irq) 50 { 51 - int pin = irq_to_pmu(irq); 52 u32 u; 53 54 u = readl(PMU_INTERRUPT_MASK); ··· 56 writel(u, PMU_INTERRUPT_MASK); 57 } 58 59 - static void pmu_irq_ack(unsigned int irq) 60 { 61 - int pin = irq_to_pmu(irq); 62 u32 u; 63 64 u = ~(1 << (pin & 31)); ··· 67 68 static struct irq_chip pmu_irq_chip = { 69 .name = "pmu_irq", 70 - .mask = pmu_irq_mask, 71 - .unmask = pmu_irq_unmask, 72 - .ack = pmu_irq_ack, 73 }; 74 75 static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
··· 36 } 37 } 38 39 + static void pmu_irq_mask(struct irq_data *d) 40 { 41 + int pin = irq_to_pmu(d->irq); 42 u32 u; 43 44 u = readl(PMU_INTERRUPT_MASK); ··· 46 writel(u, PMU_INTERRUPT_MASK); 47 } 48 49 + static void pmu_irq_unmask(struct irq_data *d) 50 { 51 + int pin = irq_to_pmu(d->irq); 52 u32 u; 53 54 u = readl(PMU_INTERRUPT_MASK); ··· 56 writel(u, PMU_INTERRUPT_MASK); 57 } 58 59 + static void pmu_irq_ack(struct irq_data *d) 60 { 61 + int pin = irq_to_pmu(d->irq); 62 u32 u; 63 64 u = ~(1 << (pin & 31)); ··· 67 68 static struct irq_chip pmu_irq_chip = { 69 .name = "pmu_irq", 70 + .irq_mask = pmu_irq_mask, 71 + .irq_unmask = pmu_irq_unmask, 72 + .irq_ack = pmu_irq_ack, 73 }; 74 75 static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc)
+7 -7
arch/arm/mach-ebsa110/core.c
··· 35 #define IRQ_STAT 0xff000000 /* read */ 36 #define IRQ_MCLR 0xff000000 /* write */ 37 38 - static void ebsa110_mask_irq(unsigned int irq) 39 { 40 - __raw_writeb(1 << irq, IRQ_MCLR); 41 } 42 43 - static void ebsa110_unmask_irq(unsigned int irq) 44 { 45 - __raw_writeb(1 << irq, IRQ_MSET); 46 } 47 48 static struct irq_chip ebsa110_irq_chip = { 49 - .ack = ebsa110_mask_irq, 50 - .mask = ebsa110_mask_irq, 51 - .unmask = ebsa110_unmask_irq, 52 }; 53 54 static void __init ebsa110_init_irq(void)
··· 35 #define IRQ_STAT 0xff000000 /* read */ 36 #define IRQ_MCLR 0xff000000 /* write */ 37 38 + static void ebsa110_mask_irq(struct irq_data *d) 39 { 40 + __raw_writeb(1 << d->irq, IRQ_MCLR); 41 } 42 43 + static void ebsa110_unmask_irq(struct irq_data *d) 44 { 45 + __raw_writeb(1 << d->irq, IRQ_MSET); 46 } 47 48 static struct irq_chip ebsa110_irq_chip = { 49 + .irq_ack = ebsa110_mask_irq, 50 + .irq_mask = ebsa110_mask_irq, 51 + .irq_unmask = ebsa110_unmask_irq, 52 }; 53 54 static void __init ebsa110_init_irq(void)
+18 -18
arch/arm/mach-ep93xx/gpio.c
··· 112 generic_handle_irq(gpio_irq); 113 } 114 115 - static void ep93xx_gpio_irq_ack(unsigned int irq) 116 { 117 - int line = irq_to_gpio(irq); 118 int port = line >> 3; 119 int port_mask = 1 << (line & 7); 120 121 - if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 122 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 123 ep93xx_gpio_update_int_params(port); 124 } ··· 126 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 127 } 128 129 - static void ep93xx_gpio_irq_mask_ack(unsigned int irq) 130 { 131 - int line = irq_to_gpio(irq); 132 int port = line >> 3; 133 int port_mask = 1 << (line & 7); 134 135 - if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) 136 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 137 138 gpio_int_unmasked[port] &= ~port_mask; ··· 141 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 142 } 143 144 - static void ep93xx_gpio_irq_mask(unsigned int irq) 145 { 146 - int line = irq_to_gpio(irq); 147 int port = line >> 3; 148 149 gpio_int_unmasked[port] &= ~(1 << (line & 7)); 150 ep93xx_gpio_update_int_params(port); 151 } 152 153 - static void ep93xx_gpio_irq_unmask(unsigned int irq) 154 { 155 - int line = irq_to_gpio(irq); 156 int port = line >> 3; 157 158 gpio_int_unmasked[port] |= 1 << (line & 7); ··· 164 * edge (1) triggered, while gpio_int_type2 controls whether it 165 * triggers on low/falling (0) or high/rising (1). 166 */ 167 - static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type) 168 { 169 - struct irq_desc *desc = irq_desc + irq; 170 - const int gpio = irq_to_gpio(irq); 171 const int port = gpio >> 3; 172 const int port_mask = 1 << (gpio & 7); 173 ··· 220 221 static struct irq_chip ep93xx_gpio_irq_chip = { 222 .name = "GPIO", 223 - .ack = ep93xx_gpio_irq_ack, 224 - .mask_ack = ep93xx_gpio_irq_mask_ack, 225 - .mask = ep93xx_gpio_irq_mask, 226 - .unmask = ep93xx_gpio_irq_unmask, 227 - .set_type = ep93xx_gpio_irq_type, 228 }; 229 230 void __init ep93xx_gpio_init_irq(void)
··· 112 generic_handle_irq(gpio_irq); 113 } 114 115 + static void ep93xx_gpio_irq_ack(struct irq_data *d) 116 { 117 + int line = irq_to_gpio(d->irq); 118 int port = line >> 3; 119 int port_mask = 1 << (line & 7); 120 121 + if ((irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) { 122 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 123 ep93xx_gpio_update_int_params(port); 124 } ··· 126 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 127 } 128 129 + static void ep93xx_gpio_irq_mask_ack(struct irq_data *d) 130 { 131 + int line = irq_to_gpio(d->irq); 132 int port = line >> 3; 133 int port_mask = 1 << (line & 7); 134 135 + if ((irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) 136 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 137 138 gpio_int_unmasked[port] &= ~port_mask; ··· 141 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 142 } 143 144 + static void ep93xx_gpio_irq_mask(struct irq_data *d) 145 { 146 + int line = irq_to_gpio(d->irq); 147 int port = line >> 3; 148 149 gpio_int_unmasked[port] &= ~(1 << (line & 7)); 150 ep93xx_gpio_update_int_params(port); 151 } 152 153 + static void ep93xx_gpio_irq_unmask(struct irq_data *d) 154 { 155 + int line = irq_to_gpio(d->irq); 156 int port = line >> 3; 157 158 gpio_int_unmasked[port] |= 1 << (line & 7); ··· 164 * edge (1) triggered, while gpio_int_type2 controls whether it 165 * triggers on low/falling (0) or high/rising (1). 166 */ 167 + static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type) 168 { 169 + struct irq_desc *desc = irq_desc + d->irq; 170 + const int gpio = irq_to_gpio(d->irq); 171 const int port = gpio >> 3; 172 const int port_mask = 1 << (gpio & 7); 173 ··· 220 221 static struct irq_chip ep93xx_gpio_irq_chip = { 222 .name = "GPIO", 223 + .irq_ack = ep93xx_gpio_irq_ack, 224 + .irq_mask_ack = ep93xx_gpio_irq_mask_ack, 225 + .irq_mask = ep93xx_gpio_irq_mask, 226 + .irq_unmask = ep93xx_gpio_irq_unmask, 227 + .irq_set_type = ep93xx_gpio_irq_type, 228 }; 229 230 void __init ep93xx_gpio_init_irq(void)
+7 -7
arch/arm/mach-footbridge/common.c
··· 75 IRQ_MASK_PCI_PERR, /* 19 */ 76 }; 77 78 - static void fb_mask_irq(unsigned int irq) 79 { 80 - *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR(irq)]; 81 } 82 83 - static void fb_unmask_irq(unsigned int irq) 84 { 85 - *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR(irq)]; 86 } 87 88 static struct irq_chip fb_chip = { 89 - .ack = fb_mask_irq, 90 - .mask = fb_mask_irq, 91 - .unmask = fb_unmask_irq, 92 }; 93 94 static void __init __fb_init_irq(void)
··· 75 IRQ_MASK_PCI_PERR, /* 19 */ 76 }; 77 78 + static void fb_mask_irq(struct irq_data *d) 79 { 80 + *CSR_IRQ_DISABLE = fb_irq_mask[_DC21285_INR(d->irq)]; 81 } 82 83 + static void fb_unmask_irq(struct irq_data *d) 84 { 85 + *CSR_IRQ_ENABLE = fb_irq_mask[_DC21285_INR(d->irq)]; 86 } 87 88 static struct irq_chip fb_chip = { 89 + .irq_ack = fb_mask_irq, 90 + .irq_mask = fb_mask_irq, 91 + .irq_unmask = fb_unmask_irq, 92 }; 93 94 static void __init __fb_init_irq(void)
+18 -18
arch/arm/mach-footbridge/isa-irq.c
··· 30 31 #include "common.h" 32 33 - static void isa_mask_pic_lo_irq(unsigned int irq) 34 { 35 - unsigned int mask = 1 << (irq & 7); 36 37 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO); 38 } 39 40 - static void isa_ack_pic_lo_irq(unsigned int irq) 41 { 42 - unsigned int mask = 1 << (irq & 7); 43 44 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO); 45 outb(0x20, PIC_LO); 46 } 47 48 - static void isa_unmask_pic_lo_irq(unsigned int irq) 49 { 50 - unsigned int mask = 1 << (irq & 7); 51 52 outb(inb(PIC_MASK_LO) & ~mask, PIC_MASK_LO); 53 } 54 55 static struct irq_chip isa_lo_chip = { 56 - .ack = isa_ack_pic_lo_irq, 57 - .mask = isa_mask_pic_lo_irq, 58 - .unmask = isa_unmask_pic_lo_irq, 59 }; 60 61 - static void isa_mask_pic_hi_irq(unsigned int irq) 62 { 63 - unsigned int mask = 1 << (irq & 7); 64 65 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI); 66 } 67 68 - static void isa_ack_pic_hi_irq(unsigned int irq) 69 { 70 - unsigned int mask = 1 << (irq & 7); 71 72 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI); 73 outb(0x62, PIC_LO); 74 outb(0x20, PIC_HI); 75 } 76 77 - static void isa_unmask_pic_hi_irq(unsigned int irq) 78 { 79 - unsigned int mask = 1 << (irq & 7); 80 81 outb(inb(PIC_MASK_HI) & ~mask, PIC_MASK_HI); 82 } 83 84 static struct irq_chip isa_hi_chip = { 85 - .ack = isa_ack_pic_hi_irq, 86 - .mask = isa_mask_pic_hi_irq, 87 - .unmask = isa_unmask_pic_hi_irq, 88 }; 89 90 static void
··· 30 31 #include "common.h" 32 33 + static void isa_mask_pic_lo_irq(struct irq_data *d) 34 { 35 + unsigned int mask = 1 << (d->irq & 7); 36 37 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO); 38 } 39 40 + static void isa_ack_pic_lo_irq(struct irq_data *d) 41 { 42 + unsigned int mask = 1 << (d->irq & 7); 43 44 outb(inb(PIC_MASK_LO) | mask, PIC_MASK_LO); 45 outb(0x20, PIC_LO); 46 } 47 48 + static void isa_unmask_pic_lo_irq(struct irq_data *d) 49 { 50 + unsigned int mask = 1 << (d->irq & 7); 51 52 outb(inb(PIC_MASK_LO) & ~mask, PIC_MASK_LO); 53 } 54 55 static struct irq_chip isa_lo_chip = { 56 + .irq_ack = isa_ack_pic_lo_irq, 57 + .irq_mask = isa_mask_pic_lo_irq, 58 + .irq_unmask = isa_unmask_pic_lo_irq, 59 }; 60 61 + static void isa_mask_pic_hi_irq(struct irq_data *d) 62 { 63 + unsigned int mask = 1 << (d->irq & 7); 64 65 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI); 66 } 67 68 + static void isa_ack_pic_hi_irq(struct irq_data *d) 69 { 70 + unsigned int mask = 1 << (d->irq & 7); 71 72 outb(inb(PIC_MASK_HI) | mask, PIC_MASK_HI); 73 outb(0x62, PIC_LO); 74 outb(0x20, PIC_HI); 75 } 76 77 + static void isa_unmask_pic_hi_irq(struct irq_data *d) 78 { 79 + unsigned int mask = 1 << (d->irq & 7); 80 81 outb(inb(PIC_MASK_HI) & ~mask, PIC_MASK_HI); 82 } 83 84 static struct irq_chip isa_hi_chip = { 85 + .irq_ack = isa_ack_pic_hi_irq, 86 + .irq_mask = isa_mask_pic_hi_irq, 87 + .irq_unmask = isa_unmask_pic_hi_irq, 88 }; 89 90 static void
+13 -13
arch/arm/mach-gemini/gpio.c
··· 54 __raw_writel(reg, base + GPIO_INT_EN); 55 } 56 57 - static void gpio_ack_irq(unsigned int irq) 58 { 59 - unsigned int gpio = irq_to_gpio(irq); 60 unsigned int base = GPIO_BASE(gpio / 32); 61 62 __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR); 63 } 64 65 - static void gpio_mask_irq(unsigned int irq) 66 { 67 - unsigned int gpio = irq_to_gpio(irq); 68 unsigned int base = GPIO_BASE(gpio / 32); 69 70 _set_gpio_irqenable(base, gpio % 32, 0); 71 } 72 73 - static void gpio_unmask_irq(unsigned int irq) 74 { 75 - unsigned int gpio = irq_to_gpio(irq); 76 unsigned int base = GPIO_BASE(gpio / 32); 77 78 _set_gpio_irqenable(base, gpio % 32, 1); 79 } 80 81 - static int gpio_set_irq_type(unsigned int irq, unsigned int type) 82 { 83 - unsigned int gpio = irq_to_gpio(irq); 84 unsigned int gpio_mask = 1 << (gpio % 32); 85 unsigned int base = GPIO_BASE(gpio / 32); 86 unsigned int reg_both, reg_level, reg_type; ··· 120 __raw_writel(reg_level, base + GPIO_INT_LEVEL); 121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); 122 123 - gpio_ack_irq(irq); 124 125 return 0; 126 } ··· 146 147 static struct irq_chip gpio_irq_chip = { 148 .name = "GPIO", 149 - .ack = gpio_ack_irq, 150 - .mask = gpio_mask_irq, 151 - .unmask = gpio_unmask_irq, 152 - .set_type = gpio_set_irq_type, 153 }; 154 155 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
··· 54 __raw_writel(reg, base + GPIO_INT_EN); 55 } 56 57 + static void gpio_ack_irq(struct irq_data *d) 58 { 59 + unsigned int gpio = irq_to_gpio(d->irq); 60 unsigned int base = GPIO_BASE(gpio / 32); 61 62 __raw_writel(1 << (gpio % 32), base + GPIO_INT_CLR); 63 } 64 65 + static void gpio_mask_irq(struct irq_data *d) 66 { 67 + unsigned int gpio = irq_to_gpio(d->irq); 68 unsigned int base = GPIO_BASE(gpio / 32); 69 70 _set_gpio_irqenable(base, gpio % 32, 0); 71 } 72 73 + static void gpio_unmask_irq(struct irq_data *d) 74 { 75 + unsigned int gpio = irq_to_gpio(d->irq); 76 unsigned int base = GPIO_BASE(gpio / 32); 77 78 _set_gpio_irqenable(base, gpio % 32, 1); 79 } 80 81 + static int gpio_set_irq_type(struct irq_data *d, unsigned int type) 82 { 83 + unsigned int gpio = irq_to_gpio(d->irq); 84 unsigned int gpio_mask = 1 << (gpio % 32); 85 unsigned int base = GPIO_BASE(gpio / 32); 86 unsigned int reg_both, reg_level, reg_type; ··· 120 __raw_writel(reg_level, base + GPIO_INT_LEVEL); 121 __raw_writel(reg_both, base + GPIO_INT_BOTH_EDGE); 122 123 + gpio_ack_irq(d->irq); 124 125 return 0; 126 } ··· 146 147 static struct irq_chip gpio_irq_chip = { 148 .name = "GPIO", 149 + .irq_ack = gpio_ack_irq, 150 + .irq_mask = gpio_mask_irq, 151 + .irq_unmask = gpio_unmask_irq, 152 + .irq_set_type = gpio_set_irq_type, 153 }; 154 155 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
+10 -10
arch/arm/mach-gemini/irq.c
··· 32 #define FIQ_LEVEL(base_addr) (base_addr + 0x30) 33 #define FIQ_STATUS(base_addr) (base_addr + 0x34) 34 35 - static void gemini_ack_irq(unsigned int irq) 36 { 37 - __raw_writel(1 << irq, IRQ_CLEAR(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 38 } 39 40 - static void gemini_mask_irq(unsigned int irq) 41 { 42 unsigned int mask; 43 44 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 45 - mask &= ~(1 << irq); 46 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 47 } 48 49 - static void gemini_unmask_irq(unsigned int irq) 50 { 51 unsigned int mask; 52 53 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 54 - mask |= (1 << irq); 55 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 56 } 57 58 static struct irq_chip gemini_irq_chip = { 59 - .name = "INTC", 60 - .ack = gemini_ack_irq, 61 - .mask = gemini_mask_irq, 62 - .unmask = gemini_unmask_irq, 63 }; 64 65 static struct resource irq_resource = {
··· 32 #define FIQ_LEVEL(base_addr) (base_addr + 0x30) 33 #define FIQ_STATUS(base_addr) (base_addr + 0x34) 34 35 + static void gemini_ack_irq(struct irq_data *d) 36 { 37 + __raw_writel(1 << d->irq, IRQ_CLEAR(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 38 } 39 40 + static void gemini_mask_irq(struct irq_data *d) 41 { 42 unsigned int mask; 43 44 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 45 + mask &= ~(1 << d->irq); 46 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 47 } 48 49 + static void gemini_unmask_irq(struct irq_data *d) 50 { 51 unsigned int mask; 52 53 mask = __raw_readl(IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 54 + mask |= (1 << d->irq); 55 __raw_writel(mask, IRQ_MASK(IO_ADDRESS(GEMINI_INTERRUPT_BASE))); 56 } 57 58 static struct irq_chip gemini_irq_chip = { 59 + .name = "INTC", 60 + .irq_ack = gemini_ack_irq, 61 + .irq_mask = gemini_mask_irq, 62 + .irq_unmask = gemini_unmask_irq, 63 }; 64 65 static struct resource irq_resource = {
+19 -19
arch/arm/mach-h720x/common.c
··· 52 /* 53 * mask Global irq's 54 */ 55 - static void mask_global_irq (unsigned int irq ) 56 { 57 - CPU_REG (IRQC_VIRT, IRQC_IER) &= ~(1 << irq); 58 } 59 60 /* 61 * unmask Global irq's 62 */ 63 - static void unmask_global_irq (unsigned int irq ) 64 { 65 - CPU_REG (IRQC_VIRT, IRQC_IER) |= (1 << irq); 66 } 67 68 ··· 70 * ack GPIO irq's 71 * Ack only for edge triggered int's valid 72 */ 73 - static void inline ack_gpio_irq(u32 irq) 74 { 75 - u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); 76 - u32 bit = IRQ_TO_BIT(irq); 77 if ( (CPU_REG (reg_base, GPIO_EDGE) & bit)) 78 CPU_REG (reg_base, GPIO_CLR) = bit; 79 } ··· 81 /* 82 * mask GPIO irq's 83 */ 84 - static void inline mask_gpio_irq(u32 irq) 85 { 86 - u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); 87 - u32 bit = IRQ_TO_BIT(irq); 88 CPU_REG (reg_base, GPIO_MASK) &= ~bit; 89 } 90 91 /* 92 * unmask GPIO irq's 93 */ 94 - static void inline unmask_gpio_irq(u32 irq) 95 { 96 - u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(irq)); 97 - u32 bit = IRQ_TO_BIT(irq); 98 CPU_REG (reg_base, GPIO_MASK) |= bit; 99 } 100 ··· 170 #endif 171 172 static struct irq_chip h720x_global_chip = { 173 - .ack = mask_global_irq, 174 - .mask = mask_global_irq, 175 - .unmask = unmask_global_irq, 176 }; 177 178 static struct irq_chip h720x_gpio_chip = { 179 - .ack = ack_gpio_irq, 180 - .mask = mask_gpio_irq, 181 - .unmask = unmask_gpio_irq, 182 }; 183 184 /*
··· 52 /* 53 * mask Global irq's 54 */ 55 + static void mask_global_irq(struct irq_data *d) 56 { 57 + CPU_REG (IRQC_VIRT, IRQC_IER) &= ~(1 << d->irq); 58 } 59 60 /* 61 * unmask Global irq's 62 */ 63 + static void unmask_global_irq(struct irq_data *d) 64 { 65 + CPU_REG (IRQC_VIRT, IRQC_IER) |= (1 << d->irq); 66 } 67 68 ··· 70 * ack GPIO irq's 71 * Ack only for edge triggered int's valid 72 */ 73 + static void inline ack_gpio_irq(struct irq_data *d) 74 { 75 + u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq)); 76 + u32 bit = IRQ_TO_BIT(d->irq); 77 if ( (CPU_REG (reg_base, GPIO_EDGE) & bit)) 78 CPU_REG (reg_base, GPIO_CLR) = bit; 79 } ··· 81 /* 82 * mask GPIO irq's 83 */ 84 + static void inline mask_gpio_irq(struct irq_data *d) 85 { 86 + u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq)); 87 + u32 bit = IRQ_TO_BIT(d->irq); 88 CPU_REG (reg_base, GPIO_MASK) &= ~bit; 89 } 90 91 /* 92 * unmask GPIO irq's 93 */ 94 + static void inline unmask_gpio_irq(struct irq_data *d) 95 { 96 + u32 reg_base = GPIO_VIRT(IRQ_TO_REGNO(d->irq)); 97 + u32 bit = IRQ_TO_BIT(d->irq); 98 CPU_REG (reg_base, GPIO_MASK) |= bit; 99 } 100 ··· 170 #endif 171 172 static struct irq_chip h720x_global_chip = { 173 + .irq_ack = mask_global_irq, 174 + .irq_mask = mask_global_irq, 175 + .irq_unmask = unmask_global_irq, 176 }; 177 178 static struct irq_chip h720x_gpio_chip = { 179 + .irq_ack = ack_gpio_irq, 180 + .irq_mask = mask_gpio_irq, 181 + .irq_unmask = unmask_gpio_irq, 182 }; 183 184 /*
+7 -7
arch/arm/mach-h720x/cpu-h7202.c
··· 141 /* 142 * mask multiplexed timer IRQs 143 */ 144 - static void inline mask_timerx_irq (u32 irq) 145 { 146 unsigned int bit; 147 - bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1)); 148 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) &= ~bit; 149 } 150 151 /* 152 * unmask multiplexed timer IRQs 153 */ 154 - static void inline unmask_timerx_irq (u32 irq) 155 { 156 unsigned int bit; 157 - bit = 2 << ((irq == IRQ_TIMER64B) ? 4 : (irq - IRQ_TIMER1)); 158 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) |= bit; 159 } 160 161 static struct irq_chip h7202_timerx_chip = { 162 - .ack = mask_timerx_irq, 163 - .mask = mask_timerx_irq, 164 - .unmask = unmask_timerx_irq, 165 }; 166 167 static struct irqaction h7202_timer_irq = {
··· 141 /* 142 * mask multiplexed timer IRQs 143 */ 144 + static void inline mask_timerx_irq(struct irq_data *d) 145 { 146 unsigned int bit; 147 + bit = 2 << ((d->irq == IRQ_TIMER64B) ? 4 : (d->irq - IRQ_TIMER1)); 148 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) &= ~bit; 149 } 150 151 /* 152 * unmask multiplexed timer IRQs 153 */ 154 + static void inline unmask_timerx_irq(struct irq_data *d) 155 { 156 unsigned int bit; 157 + bit = 2 << ((d->irq == IRQ_TIMER64B) ? 4 : (d->irq - IRQ_TIMER1)); 158 CPU_REG (TIMER_VIRT, TIMER_TOPCTRL) |= bit; 159 } 160 161 static struct irq_chip h7202_timerx_chip = { 162 + .irq_ack = mask_timerx_irq, 163 + .irq_mask = mask_timerx_irq, 164 + .irq_unmask = unmask_timerx_irq, 165 }; 166 167 static struct irqaction h7202_timer_irq = {
+1
arch/arm/mach-imx/Kconfig
··· 243 select IMX_HAVE_PLATFORM_MXC_EHCI 244 select IMX_HAVE_PLATFORM_MXC_MMC 245 select IMX_HAVE_PLATFORM_SPI_IMX 246 select MXC_ULPI if USB_ULPI 247 help 248 Include support for MX27PDK platform. This includes specific
··· 243 select IMX_HAVE_PLATFORM_MXC_EHCI 244 select IMX_HAVE_PLATFORM_MXC_MMC 245 select IMX_HAVE_PLATFORM_SPI_IMX 246 + select MXC_DEBUG_BOARD 247 select MXC_ULPI if USB_ULPI 248 help 249 Include support for MX27PDK platform. This includes specific
+8 -2
arch/arm/mach-imx/mach-mx27_3ds.c
··· 37 #include <mach/common.h> 38 #include <mach/iomux-mx27.h> 39 #include <mach/ulpi.h> 40 41 #include "devices-imx27.h" 42 43 #define SD1_EN_GPIO (GPIO_PORTB + 25) 44 #define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23) 45 #define SPI2_SS0 (GPIO_PORTD + 21) 46 47 static const int mx27pdk_pins[] __initconst = { 48 /* UART1 */ ··· 218 219 static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { 220 { 221 - .id = MC13783_REGU_VMMC1, 222 .init_data = &vmmc1_init, 223 }, { 224 - .id = MC13783_REGU_VGEN, 225 .init_data = &vgen_init, 226 }, 227 }; ··· 279 imx27_add_spi_imx1(&spi2_pdata); 280 spi_register_board_info(mx27_3ds_spi_devs, 281 ARRAY_SIZE(mx27_3ds_spi_devs)); 282 } 283 284 static void __init mx27pdk_timer_init(void)
··· 37 #include <mach/common.h> 38 #include <mach/iomux-mx27.h> 39 #include <mach/ulpi.h> 40 + #include <mach/irqs.h> 41 + #include <mach/3ds_debugboard.h> 42 43 #include "devices-imx27.h" 44 45 #define SD1_EN_GPIO (GPIO_PORTB + 25) 46 #define OTG_PHY_RESET_GPIO (GPIO_PORTB + 23) 47 #define SPI2_SS0 (GPIO_PORTD + 21) 48 + #define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTC + 28) 49 50 static const int mx27pdk_pins[] __initconst = { 51 /* UART1 */ ··· 215 216 static struct mc13783_regulator_init_data mx27_3ds_regulators[] = { 217 { 218 + .id = MC13783_REG_VMMC1, 219 .init_data = &vmmc1_init, 220 }, { 221 + .id = MC13783_REG_VGEN, 222 .init_data = &vgen_init, 223 }, 224 }; ··· 276 imx27_add_spi_imx1(&spi2_pdata); 277 spi_register_board_info(mx27_3ds_spi_devs, 278 ARRAY_SIZE(mx27_3ds_spi_devs)); 279 + 280 + if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) 281 + pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); 282 } 283 284 static void __init mx27pdk_timer_init(void)
+8 -8
arch/arm/mach-integrator/integrator_ap.c
··· 156 157 #define INTEGRATOR_SC_VALID_INT 0x003fffff 158 159 - static void sc_mask_irq(unsigned int irq) 160 { 161 - writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); 162 } 163 164 - static void sc_unmask_irq(unsigned int irq) 165 { 166 - writel(1 << irq, VA_IC_BASE + IRQ_ENABLE_SET); 167 } 168 169 static struct irq_chip sc_chip = { 170 - .name = "SC", 171 - .ack = sc_mask_irq, 172 - .mask = sc_mask_irq, 173 - .unmask = sc_unmask_irq, 174 }; 175 176 static void __init ap_init_irq(void)
··· 156 157 #define INTEGRATOR_SC_VALID_INT 0x003fffff 158 159 + static void sc_mask_irq(struct irq_data *d) 160 { 161 + writel(1 << d->irq, VA_IC_BASE + IRQ_ENABLE_CLEAR); 162 } 163 164 + static void sc_unmask_irq(struct irq_data *d) 165 { 166 + writel(1 << d->irq, VA_IC_BASE + IRQ_ENABLE_SET); 167 } 168 169 static struct irq_chip sc_chip = { 170 + .name = "SC", 171 + .irq_ack = sc_mask_irq, 172 + .irq_mask = sc_mask_irq, 173 + .irq_unmask = sc_unmask_irq, 174 }; 175 176 static void __init ap_init_irq(void)
+24 -24
arch/arm/mach-integrator/integrator_cp.c
··· 146 #define sic_writel __raw_writel 147 #define sic_readl __raw_readl 148 149 - static void cic_mask_irq(unsigned int irq) 150 { 151 - irq -= IRQ_CIC_START; 152 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); 153 } 154 155 - static void cic_unmask_irq(unsigned int irq) 156 { 157 - irq -= IRQ_CIC_START; 158 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET); 159 } 160 161 static struct irq_chip cic_chip = { 162 - .name = "CIC", 163 - .ack = cic_mask_irq, 164 - .mask = cic_mask_irq, 165 - .unmask = cic_unmask_irq, 166 }; 167 168 - static void pic_mask_irq(unsigned int irq) 169 { 170 - irq -= IRQ_PIC_START; 171 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 172 } 173 174 - static void pic_unmask_irq(unsigned int irq) 175 { 176 - irq -= IRQ_PIC_START; 177 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET); 178 } 179 180 static struct irq_chip pic_chip = { 181 - .name = "PIC", 182 - .ack = pic_mask_irq, 183 - .mask = pic_mask_irq, 184 - .unmask = pic_unmask_irq, 185 }; 186 187 - static void sic_mask_irq(unsigned int irq) 188 { 189 - irq -= IRQ_SIC_START; 190 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); 191 } 192 193 - static void sic_unmask_irq(unsigned int irq) 194 { 195 - irq -= IRQ_SIC_START; 196 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET); 197 } 198 199 static struct irq_chip sic_chip = { 200 - .name = "SIC", 201 - .ack = sic_mask_irq, 202 - .mask = sic_mask_irq, 203 - .unmask = sic_unmask_irq, 204 }; 205 206 static void
··· 146 #define sic_writel __raw_writel 147 #define sic_readl __raw_readl 148 149 + static void cic_mask_irq(struct irq_data *d) 150 { 151 + unsigned int irq = d->irq - IRQ_CIC_START; 152 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_CLEAR); 153 } 154 155 + static void cic_unmask_irq(struct irq_data *d) 156 { 157 + unsigned int irq = d->irq - IRQ_CIC_START; 158 cic_writel(1 << irq, INTCP_VA_CIC_BASE + IRQ_ENABLE_SET); 159 } 160 161 static struct irq_chip cic_chip = { 162 + .name = "CIC", 163 + .irq_ack = cic_mask_irq, 164 + .irq_mask = cic_mask_irq, 165 + .irq_unmask = cic_unmask_irq, 166 }; 167 168 + static void pic_mask_irq(struct irq_data *d) 169 { 170 + unsigned int irq = d->irq - IRQ_PIC_START; 171 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_CLEAR); 172 } 173 174 + static void pic_unmask_irq(struct irq_data *d) 175 { 176 + unsigned int irq = d->irq - IRQ_PIC_START; 177 pic_writel(1 << irq, INTCP_VA_PIC_BASE + IRQ_ENABLE_SET); 178 } 179 180 static struct irq_chip pic_chip = { 181 + .name = "PIC", 182 + .irq_ack = pic_mask_irq, 183 + .irq_mask = pic_mask_irq, 184 + .irq_unmask = pic_unmask_irq, 185 }; 186 187 + static void sic_mask_irq(struct irq_data *d) 188 { 189 + unsigned int irq = d->irq - IRQ_SIC_START; 190 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_CLEAR); 191 } 192 193 + static void sic_unmask_irq(struct irq_data *d) 194 { 195 + unsigned int irq = d->irq - IRQ_SIC_START; 196 sic_writel(1 << irq, INTCP_VA_SIC_BASE + IRQ_ENABLE_SET); 197 } 198 199 static struct irq_chip sic_chip = { 200 + .name = "SIC", 201 + .irq_ack = sic_mask_irq, 202 + .irq_mask = sic_mask_irq, 203 + .irq_unmask = sic_unmask_irq, 204 }; 205 206 static void
+32 -32
arch/arm/mach-iop13xx/irq.c
··· 123 124 /* 0 = Interrupt Masked and 1 = Interrupt not masked */ 125 static void 126 - iop13xx_irq_mask0 (unsigned int irq) 127 { 128 - write_intctl_0(read_intctl_0() & ~(1 << (irq - 0))); 129 } 130 131 static void 132 - iop13xx_irq_mask1 (unsigned int irq) 133 { 134 - write_intctl_1(read_intctl_1() & ~(1 << (irq - 32))); 135 } 136 137 static void 138 - iop13xx_irq_mask2 (unsigned int irq) 139 { 140 - write_intctl_2(read_intctl_2() & ~(1 << (irq - 64))); 141 } 142 143 static void 144 - iop13xx_irq_mask3 (unsigned int irq) 145 { 146 - write_intctl_3(read_intctl_3() & ~(1 << (irq - 96))); 147 } 148 149 static void 150 - iop13xx_irq_unmask0(unsigned int irq) 151 { 152 - write_intctl_0(read_intctl_0() | (1 << (irq - 0))); 153 } 154 155 static void 156 - iop13xx_irq_unmask1(unsigned int irq) 157 { 158 - write_intctl_1(read_intctl_1() | (1 << (irq - 32))); 159 } 160 161 static void 162 - iop13xx_irq_unmask2(unsigned int irq) 163 { 164 - write_intctl_2(read_intctl_2() | (1 << (irq - 64))); 165 } 166 167 static void 168 - iop13xx_irq_unmask3(unsigned int irq) 169 { 170 - write_intctl_3(read_intctl_3() | (1 << (irq - 96))); 171 } 172 173 static struct irq_chip iop13xx_irqchip1 = { 174 - .name = "IOP13xx-1", 175 - .ack = iop13xx_irq_mask0, 176 - .mask = iop13xx_irq_mask0, 177 - .unmask = iop13xx_irq_unmask0, 178 }; 179 180 static struct irq_chip iop13xx_irqchip2 = { 181 - .name = "IOP13xx-2", 182 - .ack = iop13xx_irq_mask1, 183 - .mask = iop13xx_irq_mask1, 184 - .unmask = iop13xx_irq_unmask1, 185 }; 186 187 static struct irq_chip iop13xx_irqchip3 = { 188 - .name = "IOP13xx-3", 189 - .ack = iop13xx_irq_mask2, 190 - .mask = iop13xx_irq_mask2, 191 - .unmask = iop13xx_irq_unmask2, 192 }; 193 194 static struct irq_chip iop13xx_irqchip4 = { 195 - .name = "IOP13xx-4", 196 - .ack = iop13xx_irq_mask3, 197 - .mask = iop13xx_irq_mask3, 198 - .unmask = iop13xx_irq_unmask3, 199 }; 200 201 extern void iop_init_cp6_handler(void);
··· 123 124 /* 0 = Interrupt Masked and 1 = Interrupt not masked */ 125 static void 126 + iop13xx_irq_mask0 (struct irq_data *d) 127 { 128 + write_intctl_0(read_intctl_0() & ~(1 << (d->irq - 0))); 129 } 130 131 static void 132 + iop13xx_irq_mask1 (struct irq_data *d) 133 { 134 + write_intctl_1(read_intctl_1() & ~(1 << (d->irq - 32))); 135 } 136 137 static void 138 + iop13xx_irq_mask2 (struct irq_data *d) 139 { 140 + write_intctl_2(read_intctl_2() & ~(1 << (d->irq - 64))); 141 } 142 143 static void 144 + iop13xx_irq_mask3 (struct irq_data *d) 145 { 146 + write_intctl_3(read_intctl_3() & ~(1 << (d->irq - 96))); 147 } 148 149 static void 150 + iop13xx_irq_unmask0(struct irq_data *d) 151 { 152 + write_intctl_0(read_intctl_0() | (1 << (d->irq - 0))); 153 } 154 155 static void 156 + iop13xx_irq_unmask1(struct irq_data *d) 157 { 158 + write_intctl_1(read_intctl_1() | (1 << (d->irq - 32))); 159 } 160 161 static void 162 + iop13xx_irq_unmask2(struct irq_data *d) 163 { 164 + write_intctl_2(read_intctl_2() | (1 << (d->irq - 64))); 165 } 166 167 static void 168 + iop13xx_irq_unmask3(struct irq_data *d) 169 { 170 + write_intctl_3(read_intctl_3() | (1 << (d->irq - 96))); 171 } 172 173 static struct irq_chip iop13xx_irqchip1 = { 174 + .name = "IOP13xx-1", 175 + .irq_ack = iop13xx_irq_mask0, 176 + .irq_mask = iop13xx_irq_mask0, 177 + .irq_unmask = iop13xx_irq_unmask0, 178 }; 179 180 static struct irq_chip iop13xx_irqchip2 = { 181 + .name = "IOP13xx-2", 182 + .irq_ack = iop13xx_irq_mask1, 183 + .irq_mask = iop13xx_irq_mask1, 184 + .irq_unmask = iop13xx_irq_unmask1, 185 }; 186 187 static struct irq_chip iop13xx_irqchip3 = { 188 + .name = "IOP13xx-3", 189 + .irq_ack = iop13xx_irq_mask2, 190 + .irq_mask = iop13xx_irq_mask2, 191 + .irq_unmask = iop13xx_irq_unmask2, 192 }; 193 194 static struct irq_chip iop13xx_irqchip4 = { 195 + .name = "IOP13xx-4", 196 + .irq_ack = iop13xx_irq_mask3, 197 + .irq_mask = iop13xx_irq_mask3, 198 + .irq_unmask = iop13xx_irq_unmask3, 199 }; 200 201 extern void iop_init_cp6_handler(void);
+2 -2
arch/arm/mach-iop13xx/msi.c
··· 156 destroy_irq(irq); 157 } 158 159 - static void iop13xx_msi_nop(unsigned int irq) 160 { 161 return; 162 } 163 164 static struct irq_chip iop13xx_msi_chip = { 165 .name = "PCI-MSI", 166 - .ack = iop13xx_msi_nop, 167 .irq_enable = unmask_msi_irq, 168 .irq_disable = mask_msi_irq, 169 .irq_mask = mask_msi_irq,
··· 156 destroy_irq(irq); 157 } 158 159 + static void iop13xx_msi_nop(struct irq_data *d) 160 { 161 return; 162 } 163 164 static struct irq_chip iop13xx_msi_chip = { 165 .name = "PCI-MSI", 166 + .irq_ack = iop13xx_msi_nop, 167 .irq_enable = unmask_msi_irq, 168 .irq_disable = mask_msi_irq, 169 .irq_mask = mask_msi_irq,
+8 -8
arch/arm/mach-iop32x/irq.c
··· 32 } 33 34 static void 35 - iop32x_irq_mask(unsigned int irq) 36 { 37 - iop32x_mask &= ~(1 << irq); 38 intctl_write(iop32x_mask); 39 } 40 41 static void 42 - iop32x_irq_unmask(unsigned int irq) 43 { 44 - iop32x_mask |= 1 << irq; 45 intctl_write(iop32x_mask); 46 } 47 48 struct irq_chip ext_chip = { 49 - .name = "IOP32x", 50 - .ack = iop32x_irq_mask, 51 - .mask = iop32x_irq_mask, 52 - .unmask = iop32x_irq_unmask, 53 }; 54 55 void __init iop32x_init_irq(void)
··· 32 } 33 34 static void 35 + iop32x_irq_mask(struct irq_data *d) 36 { 37 + iop32x_mask &= ~(1 << d->irq); 38 intctl_write(iop32x_mask); 39 } 40 41 static void 42 + iop32x_irq_unmask(struct irq_data *d) 43 { 44 + iop32x_mask |= 1 << d->irq; 45 intctl_write(iop32x_mask); 46 } 47 48 struct irq_chip ext_chip = { 49 + .name = "IOP32x", 50 + .irq_ack = iop32x_irq_mask, 51 + .irq_mask = iop32x_irq_mask, 52 + .irq_unmask = iop32x_irq_unmask, 53 }; 54 55 void __init iop32x_init_irq(void)
+16 -16
arch/arm/mach-iop33x/irq.c
··· 53 } 54 55 static void 56 - iop33x_irq_mask1 (unsigned int irq) 57 { 58 - iop33x_mask0 &= ~(1 << irq); 59 intctl0_write(iop33x_mask0); 60 } 61 62 static void 63 - iop33x_irq_mask2 (unsigned int irq) 64 { 65 - iop33x_mask1 &= ~(1 << (irq - 32)); 66 intctl1_write(iop33x_mask1); 67 } 68 69 static void 70 - iop33x_irq_unmask1(unsigned int irq) 71 { 72 - iop33x_mask0 |= 1 << irq; 73 intctl0_write(iop33x_mask0); 74 } 75 76 static void 77 - iop33x_irq_unmask2(unsigned int irq) 78 { 79 - iop33x_mask1 |= (1 << (irq - 32)); 80 intctl1_write(iop33x_mask1); 81 } 82 83 struct irq_chip iop33x_irqchip1 = { 84 - .name = "IOP33x-1", 85 - .ack = iop33x_irq_mask1, 86 - .mask = iop33x_irq_mask1, 87 - .unmask = iop33x_irq_unmask1, 88 }; 89 90 struct irq_chip iop33x_irqchip2 = { 91 - .name = "IOP33x-2", 92 - .ack = iop33x_irq_mask2, 93 - .mask = iop33x_irq_mask2, 94 - .unmask = iop33x_irq_unmask2, 95 }; 96 97 void __init iop33x_init_irq(void)
··· 53 } 54 55 static void 56 + iop33x_irq_mask1 (struct irq_data *d) 57 { 58 + iop33x_mask0 &= ~(1 << d->irq); 59 intctl0_write(iop33x_mask0); 60 } 61 62 static void 63 + iop33x_irq_mask2 (struct irq_data *d) 64 { 65 + iop33x_mask1 &= ~(1 << (d->irq - 32)); 66 intctl1_write(iop33x_mask1); 67 } 68 69 static void 70 + iop33x_irq_unmask1(struct irq_data *d) 71 { 72 + iop33x_mask0 |= 1 << d->irq; 73 intctl0_write(iop33x_mask0); 74 } 75 76 static void 77 + iop33x_irq_unmask2(struct irq_data *d) 78 { 79 + iop33x_mask1 |= (1 << (d->irq - 32)); 80 intctl1_write(iop33x_mask1); 81 } 82 83 struct irq_chip iop33x_irqchip1 = { 84 + .name = "IOP33x-1", 85 + .irq_ack = iop33x_irq_mask1, 86 + .irq_mask = iop33x_irq_mask1, 87 + .irq_unmask = iop33x_irq_unmask1, 88 }; 89 90 struct irq_chip iop33x_irqchip2 = { 91 + .name = "IOP33x-2", 92 + .irq_ack = iop33x_irq_mask2, 93 + .irq_mask = iop33x_irq_mask2, 94 + .irq_unmask = iop33x_irq_unmask2, 95 }; 96 97 void __init iop33x_init_irq(void)
+38 -32
arch/arm/mach-ixp2000/core.c
··· 309 } 310 } 311 312 - static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type) 313 { 314 - int line = irq - IRQ_IXP2000_GPIO0; 315 316 /* 317 * First, configure this GPIO line as an input. ··· 342 return 0; 343 } 344 345 - static void ixp2000_GPIO_irq_mask_ack(unsigned int irq) 346 { 347 ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); 348 349 ixp2000_reg_write(IXP2000_GPIO_EDSR, (1 << (irq - IRQ_IXP2000_GPIO0))); ··· 353 ixp2000_reg_wrb(IXP2000_GPIO_INST, (1 << (irq - IRQ_IXP2000_GPIO0))); 354 } 355 356 - static void ixp2000_GPIO_irq_mask(unsigned int irq) 357 { 358 ixp2000_reg_wrb(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); 359 } 360 361 - static void ixp2000_GPIO_irq_unmask(unsigned int irq) 362 { 363 ixp2000_reg_write(IXP2000_GPIO_INSR, (1 << (irq - IRQ_IXP2000_GPIO0))); 364 } 365 366 static struct irq_chip ixp2000_GPIO_irq_chip = { 367 - .ack = ixp2000_GPIO_irq_mask_ack, 368 - .mask = ixp2000_GPIO_irq_mask, 369 - .unmask = ixp2000_GPIO_irq_unmask, 370 - .set_type = ixp2000_GPIO_irq_type, 371 }; 372 373 - static void ixp2000_pci_irq_mask(unsigned int irq) 374 { 375 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE; 376 - if (irq == IRQ_IXP2000_PCIA) 377 ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 26))); 378 - else if (irq == IRQ_IXP2000_PCIB) 379 ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 27))); 380 } 381 382 - static void ixp2000_pci_irq_unmask(unsigned int irq) 383 { 384 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE; 385 - if (irq == IRQ_IXP2000_PCIA) 386 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 26))); 387 - else if (irq == IRQ_IXP2000_PCIB) 388 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27))); 389 } 390 ··· 407 } 408 } 409 410 - static void ixp2000_err_irq_mask(unsigned int irq) 411 { 412 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR, 413 - (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 414 } 415 416 - static void ixp2000_err_irq_unmask(unsigned int irq) 417 { 418 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET, 419 - (1 << (irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 420 } 421 422 static struct irq_chip ixp2000_err_irq_chip = { 423 - .ack = ixp2000_err_irq_mask, 424 - .mask = ixp2000_err_irq_mask, 425 - .unmask = ixp2000_err_irq_unmask 426 }; 427 428 static struct irq_chip ixp2000_pci_irq_chip = { 429 - .ack = ixp2000_pci_irq_mask, 430 - .mask = ixp2000_pci_irq_mask, 431 - .unmask = ixp2000_pci_irq_unmask 432 }; 433 434 - static void ixp2000_irq_mask(unsigned int irq) 435 { 436 - ixp2000_reg_wrb(IXP2000_IRQ_ENABLE_CLR, (1 << irq)); 437 } 438 439 - static void ixp2000_irq_unmask(unsigned int irq) 440 { 441 - ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << irq)); 442 } 443 444 static struct irq_chip ixp2000_irq_chip = { 445 - .ack = ixp2000_irq_mask, 446 - .mask = ixp2000_irq_mask, 447 - .unmask = ixp2000_irq_unmask 448 }; 449 450 void __init ixp2000_init_irq(void)
··· 309 } 310 } 311 312 + static int ixp2000_GPIO_irq_type(struct irq_data *d, unsigned int type) 313 { 314 + int line = d->irq - IRQ_IXP2000_GPIO0; 315 316 /* 317 * First, configure this GPIO line as an input. ··· 342 return 0; 343 } 344 345 + static void ixp2000_GPIO_irq_mask_ack(struct irq_data *d) 346 { 347 + unsigned int irq = d->irq; 348 + 349 ixp2000_reg_write(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); 350 351 ixp2000_reg_write(IXP2000_GPIO_EDSR, (1 << (irq - IRQ_IXP2000_GPIO0))); ··· 351 ixp2000_reg_wrb(IXP2000_GPIO_INST, (1 << (irq - IRQ_IXP2000_GPIO0))); 352 } 353 354 + static void ixp2000_GPIO_irq_mask(struct irq_data *d) 355 { 356 + unsigned int irq = d->irq; 357 + 358 ixp2000_reg_wrb(IXP2000_GPIO_INCR, (1 << (irq - IRQ_IXP2000_GPIO0))); 359 } 360 361 + static void ixp2000_GPIO_irq_unmask(struct irq_data *d) 362 { 363 + unsigned int irq = d->irq; 364 + 365 ixp2000_reg_write(IXP2000_GPIO_INSR, (1 << (irq - IRQ_IXP2000_GPIO0))); 366 } 367 368 static struct irq_chip ixp2000_GPIO_irq_chip = { 369 + .irq_ack = ixp2000_GPIO_irq_mask_ack, 370 + .irq_mask = ixp2000_GPIO_irq_mask, 371 + .irq_unmask = ixp2000_GPIO_irq_unmask, 372 + .irq_set_type = ixp2000_GPIO_irq_type, 373 }; 374 375 + static void ixp2000_pci_irq_mask(struct irq_data *d) 376 { 377 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE; 378 + if (d->irq == IRQ_IXP2000_PCIA) 379 ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 26))); 380 + else if (d->irq == IRQ_IXP2000_PCIB) 381 ixp2000_reg_wrb(IXP2000_PCI_XSCALE_INT_ENABLE, (temp & ~(1 << 27))); 382 } 383 384 + static void ixp2000_pci_irq_unmask(struct irq_data *d) 385 { 386 unsigned long temp = *IXP2000_PCI_XSCALE_INT_ENABLE; 387 + if (d->irq == IRQ_IXP2000_PCIA) 388 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 26))); 389 + else if (d->irq == IRQ_IXP2000_PCIB) 390 ixp2000_reg_write(IXP2000_PCI_XSCALE_INT_ENABLE, (temp | (1 << 27))); 391 } 392 ··· 401 } 402 } 403 404 + static void ixp2000_err_irq_mask(struct irq_data *d) 405 { 406 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_CLR, 407 + (1 << (d->irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 408 } 409 410 + static void ixp2000_err_irq_unmask(struct irq_data *d) 411 { 412 ixp2000_reg_write(IXP2000_IRQ_ERR_ENABLE_SET, 413 + (1 << (d->irq - IRQ_IXP2000_DRAM0_MIN_ERR))); 414 } 415 416 static struct irq_chip ixp2000_err_irq_chip = { 417 + .irq_ack = ixp2000_err_irq_mask, 418 + .irq_mask = ixp2000_err_irq_mask, 419 + .irq_unmask = ixp2000_err_irq_unmask 420 }; 421 422 static struct irq_chip ixp2000_pci_irq_chip = { 423 + .irq_ack = ixp2000_pci_irq_mask, 424 + .irq_mask = ixp2000_pci_irq_mask, 425 + .irq_unmask = ixp2000_pci_irq_unmask 426 }; 427 428 + static void ixp2000_irq_mask(struct irq_data *d) 429 { 430 + ixp2000_reg_wrb(IXP2000_IRQ_ENABLE_CLR, (1 << d->irq)); 431 } 432 433 + static void ixp2000_irq_unmask(struct irq_data *d) 434 { 435 + ixp2000_reg_write(IXP2000_IRQ_ENABLE_SET, (1 << d->irq)); 436 } 437 438 static struct irq_chip ixp2000_irq_chip = { 439 + .irq_ack = ixp2000_irq_mask, 440 + .irq_mask = ixp2000_irq_mask, 441 + .irq_unmask = ixp2000_irq_unmask 442 }; 443 444 void __init ixp2000_init_irq(void)
+9 -9
arch/arm/mach-ixp2000/ixdp2x00.c
··· 63 }; 64 #endif 65 66 - static void ixdp2x00_irq_mask(unsigned int irq) 67 { 68 unsigned long dummy; 69 static struct slowport_cfg old_cfg; ··· 78 #endif 79 80 dummy = *board_irq_mask; 81 - dummy |= IXP2000_BOARD_IRQ_MASK(irq); 82 ixp2000_reg_wrb(board_irq_mask, dummy); 83 84 #ifdef CONFIG_ARCH_IXDP2400 ··· 87 #endif 88 } 89 90 - static void ixdp2x00_irq_unmask(unsigned int irq) 91 { 92 unsigned long dummy; 93 static struct slowport_cfg old_cfg; ··· 98 #endif 99 100 dummy = *board_irq_mask; 101 - dummy &= ~IXP2000_BOARD_IRQ_MASK(irq); 102 ixp2000_reg_wrb(board_irq_mask, dummy); 103 104 if (machine_is_ixdp2400()) ··· 111 static struct slowport_cfg old_cfg; 112 int i; 113 114 - desc->chip->mask(irq); 115 116 #ifdef CONFIG_ARCH_IXDP2400 117 if (machine_is_ixdp2400()) ··· 133 } 134 } 135 136 - desc->chip->unmask(irq); 137 } 138 139 static struct irq_chip ixdp2x00_cpld_irq_chip = { 140 - .ack = ixdp2x00_irq_mask, 141 - .mask = ixdp2x00_irq_mask, 142 - .unmask = ixdp2x00_irq_unmask 143 }; 144 145 void __init ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_of_irqs)
··· 63 }; 64 #endif 65 66 + static void ixdp2x00_irq_mask(struct irq_data *d) 67 { 68 unsigned long dummy; 69 static struct slowport_cfg old_cfg; ··· 78 #endif 79 80 dummy = *board_irq_mask; 81 + dummy |= IXP2000_BOARD_IRQ_MASK(d->irq); 82 ixp2000_reg_wrb(board_irq_mask, dummy); 83 84 #ifdef CONFIG_ARCH_IXDP2400 ··· 87 #endif 88 } 89 90 + static void ixdp2x00_irq_unmask(struct irq_data *d) 91 { 92 unsigned long dummy; 93 static struct slowport_cfg old_cfg; ··· 98 #endif 99 100 dummy = *board_irq_mask; 101 + dummy &= ~IXP2000_BOARD_IRQ_MASK(d->irq); 102 ixp2000_reg_wrb(board_irq_mask, dummy); 103 104 if (machine_is_ixdp2400()) ··· 111 static struct slowport_cfg old_cfg; 112 int i; 113 114 + desc->irq_data.chip->irq_mask(&desc->irq_data); 115 116 #ifdef CONFIG_ARCH_IXDP2400 117 if (machine_is_ixdp2400()) ··· 133 } 134 } 135 136 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 137 } 138 139 static struct irq_chip ixdp2x00_cpld_irq_chip = { 140 + .irq_ack = ixdp2x00_irq_mask, 141 + .irq_mask = ixdp2x00_irq_mask, 142 + .irq_unmask = ixdp2x00_irq_unmask 143 }; 144 145 void __init ixdp2x00_init_irq(volatile unsigned long *stat_reg, volatile unsigned long *mask_reg, unsigned long nr_of_irqs)
+9 -9
arch/arm/mach-ixp2000/ixdp2x01.c
··· 48 /************************************************************************* 49 * IXDP2x01 IRQ Handling 50 *************************************************************************/ 51 - static void ixdp2x01_irq_mask(unsigned int irq) 52 { 53 ixp2000_reg_wrb(IXDP2X01_INT_MASK_SET_REG, 54 - IXP2000_BOARD_IRQ_MASK(irq)); 55 } 56 57 - static void ixdp2x01_irq_unmask(unsigned int irq) 58 { 59 ixp2000_reg_write(IXDP2X01_INT_MASK_CLR_REG, 60 - IXP2000_BOARD_IRQ_MASK(irq)); 61 } 62 63 static u32 valid_irq_mask; ··· 67 u32 ex_interrupt; 68 int i; 69 70 - desc->chip->mask(irq); 71 72 ex_interrupt = *IXDP2X01_INT_STAT_REG & valid_irq_mask; 73 ··· 83 } 84 } 85 86 - desc->chip->unmask(irq); 87 } 88 89 static struct irq_chip ixdp2x01_irq_chip = { 90 - .mask = ixdp2x01_irq_mask, 91 - .ack = ixdp2x01_irq_mask, 92 - .unmask = ixdp2x01_irq_unmask 93 }; 94 95 /*
··· 48 /************************************************************************* 49 * IXDP2x01 IRQ Handling 50 *************************************************************************/ 51 + static void ixdp2x01_irq_mask(struct irq_data *d) 52 { 53 ixp2000_reg_wrb(IXDP2X01_INT_MASK_SET_REG, 54 + IXP2000_BOARD_IRQ_MASK(d->irq)); 55 } 56 57 + static void ixdp2x01_irq_unmask(struct irq_data *d) 58 { 59 ixp2000_reg_write(IXDP2X01_INT_MASK_CLR_REG, 60 + IXP2000_BOARD_IRQ_MASK(d->irq)); 61 } 62 63 static u32 valid_irq_mask; ··· 67 u32 ex_interrupt; 68 int i; 69 70 + desc->irq_data.chip->irq_mask(&desc->irq_data); 71 72 ex_interrupt = *IXDP2X01_INT_STAT_REG & valid_irq_mask; 73 ··· 83 } 84 } 85 86 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 87 } 88 89 static struct irq_chip ixdp2x01_irq_chip = { 90 + .irq_mask = ixdp2x01_irq_mask, 91 + .irq_ack = ixdp2x01_irq_mask, 92 + .irq_unmask = ixdp2x01_irq_unmask 93 }; 94 95 /*
+31 -24
arch/arm/mach-ixp23xx/core.c
··· 111 112 static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type); 113 114 - static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type) 115 { 116 - int line = irq - IRQ_IXP23XX_GPIO6 + 6; 117 u32 int_style; 118 enum ixp23xx_irq_type irq_type; 119 volatile u32 *int_reg; ··· 149 return -EINVAL; 150 } 151 152 - ixp23xx_config_irq(irq, irq_type); 153 154 if (line >= 8) { /* pins 8-15 */ 155 line -= 8; ··· 173 return 0; 174 } 175 176 - static void ixp23xx_irq_mask(unsigned int irq) 177 { 178 volatile unsigned long *intr_reg; 179 180 if (irq >= 56) 181 irq += 8; ··· 185 *intr_reg &= ~(1 << (irq % 32)); 186 } 187 188 - static void ixp23xx_irq_ack(unsigned int irq) 189 { 190 - int line = irq - IRQ_IXP23XX_GPIO6 + 6; 191 192 if ((line < 6) || (line > 15)) 193 return; ··· 199 * Level triggered interrupts on GPIO lines can only be cleared when the 200 * interrupt condition disappears. 201 */ 202 - static void ixp23xx_irq_level_unmask(unsigned int irq) 203 { 204 volatile unsigned long *intr_reg; 205 206 - ixp23xx_irq_ack(irq); 207 208 if (irq >= 56) 209 irq += 8; ··· 213 *intr_reg |= (1 << (irq % 32)); 214 } 215 216 - static void ixp23xx_irq_edge_unmask(unsigned int irq) 217 { 218 volatile unsigned long *intr_reg; 219 220 if (irq >= 56) 221 irq += 8; ··· 226 } 227 228 static struct irq_chip ixp23xx_irq_level_chip = { 229 - .ack = ixp23xx_irq_mask, 230 - .mask = ixp23xx_irq_mask, 231 - .unmask = ixp23xx_irq_level_unmask, 232 - .set_type = ixp23xx_irq_set_type 233 }; 234 235 static struct irq_chip ixp23xx_irq_edge_chip = { 236 - .ack = ixp23xx_irq_ack, 237 - .mask = ixp23xx_irq_mask, 238 - .unmask = ixp23xx_irq_edge_unmask, 239 - .set_type = ixp23xx_irq_set_type 240 }; 241 242 - static void ixp23xx_pci_irq_mask(unsigned int irq) 243 { 244 *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA + 27 - irq)); 245 } 246 247 - static void ixp23xx_pci_irq_unmask(unsigned int irq) 248 { 249 *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA + 27 - irq)); 250 } 251 ··· 263 264 pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS; 265 266 - desc->chip->ack(irq); 267 268 /* See which PCI_INTA, or PCI_INTB interrupted */ 269 if (pci_interrupt & (1 << 26)) { ··· 276 277 generic_handle_irq(irqno); 278 279 - desc->chip->unmask(irq); 280 } 281 282 static struct irq_chip ixp23xx_pci_irq_chip = { 283 - .ack = ixp23xx_pci_irq_mask, 284 - .mask = ixp23xx_pci_irq_mask, 285 - .unmask = ixp23xx_pci_irq_unmask 286 }; 287 288 static void ixp23xx_config_irq(unsigned int irq, enum ixp23xx_irq_type type)
··· 111 112 static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type); 113 114 + static int ixp23xx_irq_set_type(struct irq_data *d, unsigned int type) 115 { 116 + int line = d->irq - IRQ_IXP23XX_GPIO6 + 6; 117 u32 int_style; 118 enum ixp23xx_irq_type irq_type; 119 volatile u32 *int_reg; ··· 149 return -EINVAL; 150 } 151 152 + ixp23xx_config_irq(d->irq, irq_type); 153 154 if (line >= 8) { /* pins 8-15 */ 155 line -= 8; ··· 173 return 0; 174 } 175 176 + static void ixp23xx_irq_mask(struct irq_data *d) 177 { 178 volatile unsigned long *intr_reg; 179 + unsigned int irq = d->irq; 180 181 if (irq >= 56) 182 irq += 8; ··· 184 *intr_reg &= ~(1 << (irq % 32)); 185 } 186 187 + static void ixp23xx_irq_ack(struct irq_data *d) 188 { 189 + int line = d->irq - IRQ_IXP23XX_GPIO6 + 6; 190 191 if ((line < 6) || (line > 15)) 192 return; ··· 198 * Level triggered interrupts on GPIO lines can only be cleared when the 199 * interrupt condition disappears. 200 */ 201 + static void ixp23xx_irq_level_unmask(struct irq_data *d) 202 { 203 volatile unsigned long *intr_reg; 204 + unsigned int irq = d->irq; 205 206 + ixp23xx_irq_ack(d); 207 208 if (irq >= 56) 209 irq += 8; ··· 211 *intr_reg |= (1 << (irq % 32)); 212 } 213 214 + static void ixp23xx_irq_edge_unmask(struct irq_data *d) 215 { 216 volatile unsigned long *intr_reg; 217 + unsigned int irq = d->irq; 218 219 if (irq >= 56) 220 irq += 8; ··· 223 } 224 225 static struct irq_chip ixp23xx_irq_level_chip = { 226 + .irq_ack = ixp23xx_irq_mask, 227 + .irq_mask = ixp23xx_irq_mask, 228 + .irq_unmask = ixp23xx_irq_level_unmask, 229 + .irq_set_type = ixp23xx_irq_set_type 230 }; 231 232 static struct irq_chip ixp23xx_irq_edge_chip = { 233 + .irq_ack = ixp23xx_irq_ack, 234 + .irq_mask = ixp23xx_irq_mask, 235 + .irq_unmask = ixp23xx_irq_edge_unmask, 236 + .irq_set_type = ixp23xx_irq_set_type 237 }; 238 239 + static void ixp23xx_pci_irq_mask(struct irq_data *d) 240 { 241 + unsigned int irq = d->irq; 242 + 243 *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA + 27 - irq)); 244 } 245 246 + static void ixp23xx_pci_irq_unmask(struct irq_data *d) 247 { 248 + unsigned int irq = d->irq; 249 + 250 *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA + 27 - irq)); 251 } 252 ··· 256 257 pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS; 258 259 + desc->irq_data.chip->irq_ack(&desc->irq_data); 260 261 /* See which PCI_INTA, or PCI_INTB interrupted */ 262 if (pci_interrupt & (1 << 26)) { ··· 269 270 generic_handle_irq(irqno); 271 272 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 273 } 274 275 static struct irq_chip ixp23xx_pci_irq_chip = { 276 + .irq_ack = ixp23xx_pci_irq_mask, 277 + .irq_mask = ixp23xx_pci_irq_mask, 278 + .irq_unmask = ixp23xx_pci_irq_unmask 279 }; 280 281 static void ixp23xx_config_irq(unsigned int irq, enum ixp23xx_irq_type type)
+18 -18
arch/arm/mach-ixp23xx/ixdp2351.c
··· 48 /* 49 * IXDP2351 Interrupt Handling 50 */ 51 - static void ixdp2351_inta_mask(unsigned int irq) 52 { 53 - *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(irq); 54 } 55 56 - static void ixdp2351_inta_unmask(unsigned int irq) 57 { 58 - *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(irq); 59 } 60 61 static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc) ··· 64 *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID; 65 int i; 66 67 - desc->chip->mask(irq); 68 69 for (i = 0; i < IXDP2351_INTA_IRQ_NUM; i++) { 70 if (ex_interrupt & (1 << i)) { ··· 74 } 75 } 76 77 - desc->chip->unmask(irq); 78 } 79 80 static struct irq_chip ixdp2351_inta_chip = { 81 - .ack = ixdp2351_inta_mask, 82 - .mask = ixdp2351_inta_mask, 83 - .unmask = ixdp2351_inta_unmask 84 }; 85 86 - static void ixdp2351_intb_mask(unsigned int irq) 87 { 88 - *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(irq); 89 } 90 91 - static void ixdp2351_intb_unmask(unsigned int irq) 92 { 93 - *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(irq); 94 } 95 96 static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc) ··· 99 *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID; 100 int i; 101 102 - desc->chip->ack(irq); 103 104 for (i = 0; i < IXDP2351_INTB_IRQ_NUM; i++) { 105 if (ex_interrupt & (1 << i)) { ··· 109 } 110 } 111 112 - desc->chip->unmask(irq); 113 } 114 115 static struct irq_chip ixdp2351_intb_chip = { 116 - .ack = ixdp2351_intb_mask, 117 - .mask = ixdp2351_intb_mask, 118 - .unmask = ixdp2351_intb_unmask 119 }; 120 121 void __init ixdp2351_init_irq(void)
··· 48 /* 49 * IXDP2351 Interrupt Handling 50 */ 51 + static void ixdp2351_inta_mask(struct irq_data *d) 52 { 53 + *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(d->irq); 54 } 55 56 + static void ixdp2351_inta_unmask(struct irq_data *d) 57 { 58 + *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(d->irq); 59 } 60 61 static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc) ··· 64 *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID; 65 int i; 66 67 + desc->irq_data.chip->irq_mask(&desc->irq_data); 68 69 for (i = 0; i < IXDP2351_INTA_IRQ_NUM; i++) { 70 if (ex_interrupt & (1 << i)) { ··· 74 } 75 } 76 77 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 78 } 79 80 static struct irq_chip ixdp2351_inta_chip = { 81 + .irq_ack = ixdp2351_inta_mask, 82 + .irq_mask = ixdp2351_inta_mask, 83 + .irq_unmask = ixdp2351_inta_unmask 84 }; 85 86 + static void ixdp2351_intb_mask(struct irq_data *d) 87 { 88 + *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(d->irq); 89 } 90 91 + static void ixdp2351_intb_unmask(struct irq_data *d) 92 { 93 + *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(d->irq); 94 } 95 96 static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc) ··· 99 *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID; 100 int i; 101 102 + desc->irq_data.chip->irq_ack(&desc->irq_data); 103 104 for (i = 0; i < IXDP2351_INTB_IRQ_NUM; i++) { 105 if (ex_interrupt & (1 << i)) { ··· 109 } 110 } 111 112 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 113 } 114 115 static struct irq_chip ixdp2351_intb_chip = { 116 + .irq_ack = ixdp2351_intb_mask, 117 + .irq_mask = ixdp2351_intb_mask, 118 + .irq_unmask = ixdp2351_intb_unmask 119 }; 120 121 void __init ixdp2351_init_irq(void)
+21 -21
arch/arm/mach-ixp4xx/common.c
··· 128 } 129 EXPORT_SYMBOL(irq_to_gpio); 130 131 - static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) 132 { 133 - int line = irq2gpio[irq]; 134 u32 int_style; 135 enum ixp4xx_irq_type irq_type; 136 volatile u32 *int_reg; ··· 167 } 168 169 if (irq_type == IXP4XX_IRQ_EDGE) 170 - ixp4xx_irq_edge |= (1 << irq); 171 else 172 - ixp4xx_irq_edge &= ~(1 << irq); 173 174 if (line >= 8) { /* pins 8-15 */ 175 line -= 8; ··· 188 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 189 190 /* Configure the line as an input */ 191 - gpio_line_config(irq2gpio[irq], IXP4XX_GPIO_IN); 192 193 return 0; 194 } 195 196 - static void ixp4xx_irq_mask(unsigned int irq) 197 { 198 - if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32) 199 - *IXP4XX_ICMR2 &= ~(1 << (irq - 32)); 200 else 201 - *IXP4XX_ICMR &= ~(1 << irq); 202 } 203 204 - static void ixp4xx_irq_ack(unsigned int irq) 205 { 206 - int line = (irq < 32) ? irq2gpio[irq] : -1; 207 208 if (line >= 0) 209 *IXP4XX_GPIO_GPISR = (1 << line); ··· 213 * Level triggered interrupts on GPIO lines can only be cleared when the 214 * interrupt condition disappears. 215 */ 216 - static void ixp4xx_irq_unmask(unsigned int irq) 217 { 218 - if (!(ixp4xx_irq_edge & (1 << irq))) 219 - ixp4xx_irq_ack(irq); 220 221 - if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32) 222 - *IXP4XX_ICMR2 |= (1 << (irq - 32)); 223 else 224 - *IXP4XX_ICMR |= (1 << irq); 225 } 226 227 static struct irq_chip ixp4xx_irq_chip = { 228 .name = "IXP4xx", 229 - .ack = ixp4xx_irq_ack, 230 - .mask = ixp4xx_irq_mask, 231 - .unmask = ixp4xx_irq_unmask, 232 - .set_type = ixp4xx_set_irq_type, 233 }; 234 235 void __init ixp4xx_init_irq(void)
··· 128 } 129 EXPORT_SYMBOL(irq_to_gpio); 130 131 + static int ixp4xx_set_irq_type(struct irq_data *d, unsigned int type) 132 { 133 + int line = irq2gpio[d->irq]; 134 u32 int_style; 135 enum ixp4xx_irq_type irq_type; 136 volatile u32 *int_reg; ··· 167 } 168 169 if (irq_type == IXP4XX_IRQ_EDGE) 170 + ixp4xx_irq_edge |= (1 << d->irq); 171 else 172 + ixp4xx_irq_edge &= ~(1 << d->irq); 173 174 if (line >= 8) { /* pins 8-15 */ 175 line -= 8; ··· 188 *int_reg |= (int_style << (line * IXP4XX_GPIO_STYLE_SIZE)); 189 190 /* Configure the line as an input */ 191 + gpio_line_config(irq2gpio[d->irq], IXP4XX_GPIO_IN); 192 193 return 0; 194 } 195 196 + static void ixp4xx_irq_mask(struct irq_data *d) 197 { 198 + if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32) 199 + *IXP4XX_ICMR2 &= ~(1 << (d->irq - 32)); 200 else 201 + *IXP4XX_ICMR &= ~(1 << d->irq); 202 } 203 204 + static void ixp4xx_irq_ack(struct irq_data *d) 205 { 206 + int line = (d->irq < 32) ? irq2gpio[d->irq] : -1; 207 208 if (line >= 0) 209 *IXP4XX_GPIO_GPISR = (1 << line); ··· 213 * Level triggered interrupts on GPIO lines can only be cleared when the 214 * interrupt condition disappears. 215 */ 216 + static void ixp4xx_irq_unmask(struct irq_data *d) 217 { 218 + if (!(ixp4xx_irq_edge & (1 << d->irq))) 219 + ixp4xx_irq_ack(d); 220 221 + if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && d->irq >= 32) 222 + *IXP4XX_ICMR2 |= (1 << (d->irq - 32)); 223 else 224 + *IXP4XX_ICMR |= (1 << d->irq); 225 } 226 227 static struct irq_chip ixp4xx_irq_chip = { 228 .name = "IXP4xx", 229 + .irq_ack = ixp4xx_irq_ack, 230 + .irq_mask = ixp4xx_irq_mask, 231 + .irq_unmask = ixp4xx_irq_unmask, 232 + .irq_set_type = ixp4xx_set_irq_type, 233 }; 234 235 void __init ixp4xx_init_irq(void)
+22 -21
arch/arm/mach-ks8695/irq.c
··· 34 #include <mach/regs-irq.h> 35 #include <mach/regs-gpio.h> 36 37 - static void ks8695_irq_mask(unsigned int irqno) 38 { 39 unsigned long inten; 40 41 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 42 - inten &= ~(1 << irqno); 43 44 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 45 } 46 47 - static void ks8695_irq_unmask(unsigned int irqno) 48 { 49 unsigned long inten; 50 51 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 52 - inten |= (1 << irqno); 53 54 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 55 } 56 57 - static void ks8695_irq_ack(unsigned int irqno) 58 { 59 - __raw_writel((1 << irqno), KS8695_IRQ_VA + KS8695_INTST); 60 } 61 62 ··· 64 static struct irq_chip ks8695_irq_edge_chip; 65 66 67 - static int ks8695_irq_set_type(unsigned int irqno, unsigned int type) 68 { 69 unsigned long ctrl, mode; 70 unsigned short level_triggered = 0; ··· 93 return -EINVAL; 94 } 95 96 - switch (irqno) { 97 case KS8695_IRQ_EXTERN0: 98 ctrl &= ~IOPC_IOEINT0TM; 99 ctrl |= IOPC_IOEINT0_MODE(mode); ··· 115 } 116 117 if (level_triggered) { 118 - set_irq_chip(irqno, &ks8695_irq_level_chip); 119 - set_irq_handler(irqno, handle_level_irq); 120 } 121 else { 122 - set_irq_chip(irqno, &ks8695_irq_edge_chip); 123 - set_irq_handler(irqno, handle_edge_irq); 124 } 125 126 __raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC); ··· 128 } 129 130 static struct irq_chip ks8695_irq_level_chip = { 131 - .ack = ks8695_irq_mask, 132 - .mask = ks8695_irq_mask, 133 - .unmask = ks8695_irq_unmask, 134 - .set_type = ks8695_irq_set_type, 135 }; 136 137 static struct irq_chip ks8695_irq_edge_chip = { 138 - .ack = ks8695_irq_ack, 139 - .mask = ks8695_irq_mask, 140 - .unmask = ks8695_irq_unmask, 141 - .set_type = ks8695_irq_set_type, 142 }; 143 144 void __init ks8695_init_irq(void) ··· 164 165 /* Edge-triggered interrupts */ 166 default: 167 - ks8695_irq_ack(irq); /* clear pending bit */ 168 set_irq_chip(irq, &ks8695_irq_edge_chip); 169 set_irq_handler(irq, handle_edge_irq); 170 }
··· 34 #include <mach/regs-irq.h> 35 #include <mach/regs-gpio.h> 36 37 + static void ks8695_irq_mask(struct irq_data *d) 38 { 39 unsigned long inten; 40 41 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 42 + inten &= ~(1 << d->irq); 43 44 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 45 } 46 47 + static void ks8695_irq_unmask(struct irq_data *d) 48 { 49 unsigned long inten; 50 51 inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN); 52 + inten |= (1 << d->irq); 53 54 __raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN); 55 } 56 57 + static void ks8695_irq_ack(struct irq_data *d) 58 { 59 + __raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST); 60 } 61 62 ··· 64 static struct irq_chip ks8695_irq_edge_chip; 65 66 67 + static int ks8695_irq_set_type(struct irq_data *d, unsigned int type) 68 { 69 unsigned long ctrl, mode; 70 unsigned short level_triggered = 0; ··· 93 return -EINVAL; 94 } 95 96 + switch (d->irq) { 97 case KS8695_IRQ_EXTERN0: 98 ctrl &= ~IOPC_IOEINT0TM; 99 ctrl |= IOPC_IOEINT0_MODE(mode); ··· 115 } 116 117 if (level_triggered) { 118 + set_irq_chip(d->irq, &ks8695_irq_level_chip); 119 + set_irq_handler(d->irq, handle_level_irq); 120 } 121 else { 122 + set_irq_chip(d->irq, &ks8695_irq_edge_chip); 123 + set_irq_handler(d->irq, handle_edge_irq); 124 } 125 126 __raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC); ··· 128 } 129 130 static struct irq_chip ks8695_irq_level_chip = { 131 + .irq_ack = ks8695_irq_mask, 132 + .irq_mask = ks8695_irq_mask, 133 + .irq_unmask = ks8695_irq_unmask, 134 + .irq_set_type = ks8695_irq_set_type, 135 }; 136 137 static struct irq_chip ks8695_irq_edge_chip = { 138 + .irq_ack = ks8695_irq_ack, 139 + .irq_mask = ks8695_irq_mask, 140 + .irq_unmask = ks8695_irq_unmask, 141 + .irq_set_type = ks8695_irq_set_type, 142 }; 143 144 void __init ks8695_init_irq(void) ··· 164 165 /* Edge-triggered interrupts */ 166 default: 167 + /* clear pending bit */ 168 + ks8695_irq_ack(irq_get_irq_data(irq)); 169 set_irq_chip(irq, &ks8695_irq_edge_chip); 170 set_irq_handler(irq, handle_edge_irq); 171 }
+10 -10
arch/arm/mach-lh7a40x/arch-kev7a400.c
··· 46 47 static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */ 48 49 - static void kev7a400_ack_cpld_irq (u32 irq) 50 { 51 - CPLD_CL_INT = 1 << (irq - IRQ_KEV7A400_CPLD); 52 } 53 54 - static void kev7a400_mask_cpld_irq (u32 irq) 55 { 56 - CPLD_IRQ_mask &= ~(1 << (irq - IRQ_KEV7A400_CPLD)); 57 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 58 } 59 60 - static void kev7a400_unmask_cpld_irq (u32 irq) 61 { 62 - CPLD_IRQ_mask |= 1 << (irq - IRQ_KEV7A400_CPLD); 63 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 64 } 65 66 static struct irq_chip kev7a400_cpld_chip = { 67 - .name = "CPLD", 68 - .ack = kev7a400_ack_cpld_irq, 69 - .mask = kev7a400_mask_cpld_irq, 70 - .unmask = kev7a400_unmask_cpld_irq, 71 }; 72 73
··· 46 47 static u16 CPLD_IRQ_mask; /* Mask for CPLD IRQs, 1 == unmasked */ 48 49 + static void kev7a400_ack_cpld_irq(struct irq_data *d) 50 { 51 + CPLD_CL_INT = 1 << (d->irq - IRQ_KEV7A400_CPLD); 52 } 53 54 + static void kev7a400_mask_cpld_irq(struct irq_data *d) 55 { 56 + CPLD_IRQ_mask &= ~(1 << (d->irq - IRQ_KEV7A400_CPLD)); 57 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 58 } 59 60 + static void kev7a400_unmask_cpld_irq(struct irq_data *d) 61 { 62 + CPLD_IRQ_mask |= 1 << (d->irq - IRQ_KEV7A400_CPLD); 63 CPLD_WR_PB_INT_MASK = CPLD_IRQ_mask; 64 } 65 66 static struct irq_chip kev7a400_cpld_chip = { 67 + .name = "CPLD", 68 + .irq_ack = kev7a400_ack_cpld_irq, 69 + .irq_mask = kev7a400_mask_cpld_irq, 70 + .irq_unmask = kev7a400_unmask_cpld_irq, 71 }; 72 73
+13 -12
arch/arm/mach-lh7a40x/arch-lpd7a40x.c
··· 159 #endif 160 } 161 162 - static void lh7a40x_ack_cpld_irq (u32 irq) 163 { 164 /* CPLD doesn't have ack capability, but some devices may */ 165 ··· 167 /* The touch control *must* mask the interrupt because the 168 * interrupt bit is read by the driver to determine if the pen 169 * is still down. */ 170 - if (irq == IRQ_TOUCH) 171 CPLD_INTERRUPTS |= CPLD_INTMASK_TOUCH; 172 #endif 173 } 174 175 - static void lh7a40x_mask_cpld_irq (u32 irq) 176 { 177 - switch (irq) { 178 case IRQ_LPD7A40X_ETH_INT: 179 CPLD_INTERRUPTS |= CPLD_INTMASK_ETHERNET; 180 break; ··· 186 } 187 } 188 189 - static void lh7a40x_unmask_cpld_irq (u32 irq) 190 { 191 - switch (irq) { 192 case IRQ_LPD7A40X_ETH_INT: 193 CPLD_INTERRUPTS &= ~CPLD_INTMASK_ETHERNET; 194 break; ··· 201 } 202 203 static struct irq_chip lpd7a40x_cpld_chip = { 204 - .name = "CPLD", 205 - .ack = lh7a40x_ack_cpld_irq, 206 - .mask = lh7a40x_mask_cpld_irq, 207 - .unmask = lh7a40x_unmask_cpld_irq, 208 }; 209 210 static void lpd7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc) 211 { 212 unsigned int mask = CPLD_INTERRUPTS; 213 214 - desc->chip->ack (irq); 215 216 if ((mask & (1<<0)) == 0) /* WLAN */ 217 generic_handle_irq(IRQ_LPD7A40X_ETH_INT); ··· 221 generic_handle_irq(IRQ_TOUCH); 222 #endif 223 224 - desc->chip->unmask (irq); /* Level-triggered need this */ 225 } 226 227
··· 159 #endif 160 } 161 162 + static void lh7a40x_ack_cpld_irq(struct irq_data *d) 163 { 164 /* CPLD doesn't have ack capability, but some devices may */ 165 ··· 167 /* The touch control *must* mask the interrupt because the 168 * interrupt bit is read by the driver to determine if the pen 169 * is still down. */ 170 + if (d->irq == IRQ_TOUCH) 171 CPLD_INTERRUPTS |= CPLD_INTMASK_TOUCH; 172 #endif 173 } 174 175 + static void lh7a40x_mask_cpld_irq(struct irq_data *d) 176 { 177 + switch (d->irq) { 178 case IRQ_LPD7A40X_ETH_INT: 179 CPLD_INTERRUPTS |= CPLD_INTMASK_ETHERNET; 180 break; ··· 186 } 187 } 188 189 + static void lh7a40x_unmask_cpld_irq(struct irq_data *d) 190 { 191 + switch (d->irq) { 192 case IRQ_LPD7A40X_ETH_INT: 193 CPLD_INTERRUPTS &= ~CPLD_INTMASK_ETHERNET; 194 break; ··· 201 } 202 203 static struct irq_chip lpd7a40x_cpld_chip = { 204 + .name = "CPLD", 205 + .irq_ack = lh7a40x_ack_cpld_irq, 206 + .irq_mask = lh7a40x_mask_cpld_irq, 207 + .irq_unmask = lh7a40x_unmask_cpld_irq, 208 }; 209 210 static void lpd7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc) 211 { 212 unsigned int mask = CPLD_INTERRUPTS; 213 214 + desc->irq_data.chip->irq_ack(&desc->irq_data); 215 216 if ((mask & (1<<0)) == 0) /* WLAN */ 217 generic_handle_irq(IRQ_LPD7A40X_ETH_INT); ··· 221 generic_handle_irq(IRQ_TOUCH); 222 #endif 223 224 + /* Level-triggered need this */ 225 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 226 } 227 228
+15 -15
arch/arm/mach-lh7a40x/irq-lh7a400.c
··· 21 22 /* CPU IRQ handling */ 23 24 - static void lh7a400_mask_irq (u32 irq) 25 { 26 - INTC_INTENC = (1 << irq); 27 } 28 29 - static void lh7a400_unmask_irq (u32 irq) 30 { 31 - INTC_INTENS = (1 << irq); 32 } 33 34 - static void lh7a400_ack_gpio_irq (u32 irq) 35 { 36 - GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq)); 37 - INTC_INTENC = (1 << irq); 38 } 39 40 static struct irq_chip lh7a400_internal_chip = { 41 - .name = "MPU", 42 - .ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */ 43 - .mask = lh7a400_mask_irq, 44 - .unmask = lh7a400_unmask_irq, 45 }; 46 47 static struct irq_chip lh7a400_gpio_chip = { 48 - .name = "GPIO", 49 - .ack = lh7a400_ack_gpio_irq, 50 - .mask = lh7a400_mask_irq, 51 - .unmask = lh7a400_unmask_irq, 52 }; 53 54
··· 21 22 /* CPU IRQ handling */ 23 24 + static void lh7a400_mask_irq(struct irq_data *d) 25 { 26 + INTC_INTENC = (1 << d->irq); 27 } 28 29 + static void lh7a400_unmask_irq(struct irq_data *d) 30 { 31 + INTC_INTENS = (1 << d->irq); 32 } 33 34 + static void lh7a400_ack_gpio_irq(struct irq_data *d) 35 { 36 + GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq)); 37 + INTC_INTENC = (1 << d->irq); 38 } 39 40 static struct irq_chip lh7a400_internal_chip = { 41 + .name = "MPU", 42 + .irq_ack = lh7a400_mask_irq, /* Level triggering -> mask is ack */ 43 + .irq_mask = lh7a400_mask_irq, 44 + .irq_unmask = lh7a400_unmask_irq, 45 }; 46 47 static struct irq_chip lh7a400_gpio_chip = { 48 + .name = "GPIO", 49 + .irq_ack = lh7a400_ack_gpio_irq, 50 + .irq_mask = lh7a400_mask_irq, 51 + .irq_unmask = lh7a400_unmask_irq, 52 }; 53 54
+30 -30
arch/arm/mach-lh7a40x/irq-lh7a404.c
··· 43 44 /* CPU IRQ handling */ 45 46 - static void lh7a404_vic1_mask_irq (u32 irq) 47 { 48 - VIC1_INTENCLR = (1 << irq); 49 } 50 51 - static void lh7a404_vic1_unmask_irq (u32 irq) 52 { 53 - VIC1_INTEN = (1 << irq); 54 } 55 56 - static void lh7a404_vic2_mask_irq (u32 irq) 57 { 58 - VIC2_INTENCLR = (1 << (irq - 32)); 59 } 60 61 - static void lh7a404_vic2_unmask_irq (u32 irq) 62 { 63 - VIC2_INTEN = (1 << (irq - 32)); 64 } 65 66 - static void lh7a404_vic1_ack_gpio_irq (u32 irq) 67 { 68 - GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq)); 69 - VIC1_INTENCLR = (1 << irq); 70 } 71 72 - static void lh7a404_vic2_ack_gpio_irq (u32 irq) 73 { 74 - GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (irq)); 75 - VIC2_INTENCLR = (1 << irq); 76 } 77 78 static struct irq_chip lh7a404_vic1_chip = { 79 - .name = "VIC1", 80 - .ack = lh7a404_vic1_mask_irq, /* Because level-triggered */ 81 - .mask = lh7a404_vic1_mask_irq, 82 - .unmask = lh7a404_vic1_unmask_irq, 83 }; 84 85 static struct irq_chip lh7a404_vic2_chip = { 86 - .name = "VIC2", 87 - .ack = lh7a404_vic2_mask_irq, /* Because level-triggered */ 88 - .mask = lh7a404_vic2_mask_irq, 89 - .unmask = lh7a404_vic2_unmask_irq, 90 }; 91 92 static struct irq_chip lh7a404_gpio_vic1_chip = { 93 - .name = "GPIO-VIC1", 94 - .ack = lh7a404_vic1_ack_gpio_irq, 95 - .mask = lh7a404_vic1_mask_irq, 96 - .unmask = lh7a404_vic1_unmask_irq, 97 }; 98 99 static struct irq_chip lh7a404_gpio_vic2_chip = { 100 - .name = "GPIO-VIC2", 101 - .ack = lh7a404_vic2_ack_gpio_irq, 102 - .mask = lh7a404_vic2_mask_irq, 103 - .unmask = lh7a404_vic2_unmask_irq, 104 }; 105 106 /* IRQ initialization */
··· 43 44 /* CPU IRQ handling */ 45 46 + static void lh7a404_vic1_mask_irq(struct irq_data *d) 47 { 48 + VIC1_INTENCLR = (1 << d->irq); 49 } 50 51 + static void lh7a404_vic1_unmask_irq(struct irq_data *d) 52 { 53 + VIC1_INTEN = (1 << d->irq); 54 } 55 56 + static void lh7a404_vic2_mask_irq(struct irq_data *d) 57 { 58 + VIC2_INTENCLR = (1 << (d->irq - 32)); 59 } 60 61 + static void lh7a404_vic2_unmask_irq(struct irq_data *d) 62 { 63 + VIC2_INTEN = (1 << (d->irq - 32)); 64 } 65 66 + static void lh7a404_vic1_ack_gpio_irq(struct irq_data *d) 67 { 68 + GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq)); 69 + VIC1_INTENCLR = (1 << d->irq); 70 } 71 72 + static void lh7a404_vic2_ack_gpio_irq(struct irq_data *d) 73 { 74 + GPIO_GPIOFEOI = (1 << IRQ_TO_GPIO (d->irq)); 75 + VIC2_INTENCLR = (1 << d->irq); 76 } 77 78 static struct irq_chip lh7a404_vic1_chip = { 79 + .name = "VIC1", 80 + .irq_ack = lh7a404_vic1_mask_irq, /* Because level-triggered */ 81 + .irq_mask = lh7a404_vic1_mask_irq, 82 + .irq_unmask = lh7a404_vic1_unmask_irq, 83 }; 84 85 static struct irq_chip lh7a404_vic2_chip = { 86 + .name = "VIC2", 87 + .irq_ack = lh7a404_vic2_mask_irq, /* Because level-triggered */ 88 + .irq_mask = lh7a404_vic2_mask_irq, 89 + .irq_unmask = lh7a404_vic2_unmask_irq, 90 }; 91 92 static struct irq_chip lh7a404_gpio_vic1_chip = { 93 + .name = "GPIO-VIC1", 94 + .irq_ack = lh7a404_vic1_ack_gpio_irq, 95 + .irq_mask = lh7a404_vic1_mask_irq, 96 + .irq_unmask = lh7a404_vic1_unmask_irq, 97 }; 98 99 static struct irq_chip lh7a404_gpio_vic2_chip = { 100 + .name = "GPIO-VIC2", 101 + .irq_ack = lh7a404_vic2_ack_gpio_irq, 102 + .irq_mask = lh7a404_vic2_mask_irq, 103 + .irq_unmask = lh7a404_vic2_unmask_irq, 104 }; 105 106 /* IRQ initialization */
+11 -11
arch/arm/mach-lh7a40x/irq-lpd7a40x.c
··· 20 21 #include "common.h" 22 23 - static void lh7a40x_ack_cpld_irq (u32 irq) 24 { 25 /* CPLD doesn't have ack capability */ 26 } 27 28 - static void lh7a40x_mask_cpld_irq (u32 irq) 29 { 30 - switch (irq) { 31 case IRQ_LPD7A40X_ETH_INT: 32 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x4; 33 break; ··· 37 } 38 } 39 40 - static void lh7a40x_unmask_cpld_irq (u32 irq) 41 { 42 - switch (irq) { 43 case IRQ_LPD7A40X_ETH_INT: 44 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x4; 45 break; ··· 50 } 51 52 static struct irq_chip lh7a40x_cpld_chip = { 53 - .name = "CPLD", 54 - .ack = lh7a40x_ack_cpld_irq, 55 - .mask = lh7a40x_mask_cpld_irq, 56 - .unmask = lh7a40x_unmask_cpld_irq, 57 }; 58 59 static void lh7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc) 60 { 61 unsigned int mask = CPLD_INTERRUPTS; 62 63 - desc->chip->ack (irq); 64 65 if ((mask & 0x1) == 0) /* WLAN */ 66 generic_handle_irq(IRQ_LPD7A40X_ETH_INT); ··· 68 if ((mask & 0x2) == 0) /* Touch */ 69 generic_handle_irq(IRQ_LPD7A400_TS); 70 71 - desc->chip->unmask (irq); /* Level-triggered need this */ 72 } 73 74
··· 20 21 #include "common.h" 22 23 + static void lh7a40x_ack_cpld_irq(struct irq_data *d) 24 { 25 /* CPLD doesn't have ack capability */ 26 } 27 28 + static void lh7a40x_mask_cpld_irq(struct irq_data *d) 29 { 30 + switch (d->irq) { 31 case IRQ_LPD7A40X_ETH_INT: 32 CPLD_INTERRUPTS = CPLD_INTERRUPTS | 0x4; 33 break; ··· 37 } 38 } 39 40 + static void lh7a40x_unmask_cpld_irq(struct irq_data *d) 41 { 42 + switch (d->irq) { 43 case IRQ_LPD7A40X_ETH_INT: 44 CPLD_INTERRUPTS = CPLD_INTERRUPTS & ~ 0x4; 45 break; ··· 50 } 51 52 static struct irq_chip lh7a40x_cpld_chip = { 53 + .name = "CPLD", 54 + .irq_ack = lh7a40x_ack_cpld_irq, 55 + .irq_mask = lh7a40x_mask_cpld_irq, 56 + .irq_unmask = lh7a40x_unmask_cpld_irq, 57 }; 58 59 static void lh7a40x_cpld_handler (unsigned int irq, struct irq_desc *desc) 60 { 61 unsigned int mask = CPLD_INTERRUPTS; 62 63 + desc->irq_data.chip->ack (irq); 64 65 if ((mask & 0x1) == 0) /* WLAN */ 66 generic_handle_irq(IRQ_LPD7A40X_ETH_INT); ··· 68 if ((mask & 0x2) == 0) /* Touch */ 69 generic_handle_irq(IRQ_LPD7A400_TS); 70 71 + desc->irq_data.chip->unmask (irq); /* Level-triggered need this */ 72 } 73 74
+28 -28
arch/arm/mach-lpc32xx/irq.c
··· 191 } 192 } 193 194 - static void lpc32xx_mask_irq(unsigned int irq) 195 { 196 unsigned int reg, ctrl, mask; 197 198 - get_controller(irq, &ctrl, &mask); 199 200 reg = __raw_readl(LPC32XX_INTC_MASK(ctrl)) & ~mask; 201 __raw_writel(reg, LPC32XX_INTC_MASK(ctrl)); 202 } 203 204 - static void lpc32xx_unmask_irq(unsigned int irq) 205 { 206 unsigned int reg, ctrl, mask; 207 208 - get_controller(irq, &ctrl, &mask); 209 210 reg = __raw_readl(LPC32XX_INTC_MASK(ctrl)) | mask; 211 __raw_writel(reg, LPC32XX_INTC_MASK(ctrl)); 212 } 213 214 - static void lpc32xx_ack_irq(unsigned int irq) 215 { 216 unsigned int ctrl, mask; 217 218 - get_controller(irq, &ctrl, &mask); 219 220 __raw_writel(mask, LPC32XX_INTC_RAW_STAT(ctrl)); 221 222 /* Also need to clear pending wake event */ 223 - if (lpc32xx_events[irq].mask != 0) 224 - __raw_writel(lpc32xx_events[irq].mask, 225 - lpc32xx_events[irq].event_group->rawstat_reg); 226 } 227 228 static void __lpc32xx_set_irq_type(unsigned int irq, int use_high_level, ··· 261 } 262 } 263 264 - static int lpc32xx_set_irq_type(unsigned int irq, unsigned int type) 265 { 266 switch (type) { 267 case IRQ_TYPE_EDGE_RISING: 268 /* Rising edge sensitive */ 269 - __lpc32xx_set_irq_type(irq, 1, 1); 270 break; 271 272 case IRQ_TYPE_EDGE_FALLING: 273 /* Falling edge sensitive */ 274 - __lpc32xx_set_irq_type(irq, 0, 1); 275 break; 276 277 case IRQ_TYPE_LEVEL_LOW: 278 /* Low level sensitive */ 279 - __lpc32xx_set_irq_type(irq, 0, 0); 280 break; 281 282 case IRQ_TYPE_LEVEL_HIGH: 283 /* High level sensitive */ 284 - __lpc32xx_set_irq_type(irq, 1, 0); 285 break; 286 287 /* Other modes are not supported */ ··· 290 } 291 292 /* Ok to use the level handler for all types */ 293 - set_irq_handler(irq, handle_level_irq); 294 295 return 0; 296 } 297 298 - static int lpc32xx_irq_wake(unsigned int irqno, unsigned int state) 299 { 300 unsigned long eventreg; 301 302 - if (lpc32xx_events[irqno].mask != 0) { 303 - eventreg = __raw_readl(lpc32xx_events[irqno]. 304 event_group->enab_reg); 305 306 if (state) 307 - eventreg |= lpc32xx_events[irqno].mask; 308 else 309 - eventreg &= ~lpc32xx_events[irqno].mask; 310 311 __raw_writel(eventreg, 312 - lpc32xx_events[irqno].event_group->enab_reg); 313 314 return 0; 315 } 316 317 /* Clear event */ 318 - __raw_writel(lpc32xx_events[irqno].mask, 319 - lpc32xx_events[irqno].event_group->rawstat_reg); 320 321 return -ENODEV; 322 } ··· 336 } 337 338 static struct irq_chip lpc32xx_irq_chip = { 339 - .ack = lpc32xx_ack_irq, 340 - .mask = lpc32xx_mask_irq, 341 - .unmask = lpc32xx_unmask_irq, 342 - .set_type = lpc32xx_set_irq_type, 343 - .set_wake = lpc32xx_irq_wake 344 }; 345 346 static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc)
··· 191 } 192 } 193 194 + static void lpc32xx_mask_irq(struct irq_data *d) 195 { 196 unsigned int reg, ctrl, mask; 197 198 + get_controller(d->irq, &ctrl, &mask); 199 200 reg = __raw_readl(LPC32XX_INTC_MASK(ctrl)) & ~mask; 201 __raw_writel(reg, LPC32XX_INTC_MASK(ctrl)); 202 } 203 204 + static void lpc32xx_unmask_irq(struct irq_data *d) 205 { 206 unsigned int reg, ctrl, mask; 207 208 + get_controller(d->irq, &ctrl, &mask); 209 210 reg = __raw_readl(LPC32XX_INTC_MASK(ctrl)) | mask; 211 __raw_writel(reg, LPC32XX_INTC_MASK(ctrl)); 212 } 213 214 + static void lpc32xx_ack_irq(struct irq_data *d) 215 { 216 unsigned int ctrl, mask; 217 218 + get_controller(d->irq, &ctrl, &mask); 219 220 __raw_writel(mask, LPC32XX_INTC_RAW_STAT(ctrl)); 221 222 /* Also need to clear pending wake event */ 223 + if (lpc32xx_events[d->irq].mask != 0) 224 + __raw_writel(lpc32xx_events[d->irq].mask, 225 + lpc32xx_events[d->irq].event_group->rawstat_reg); 226 } 227 228 static void __lpc32xx_set_irq_type(unsigned int irq, int use_high_level, ··· 261 } 262 } 263 264 + static int lpc32xx_set_irq_type(struct irq_data *d, unsigned int type) 265 { 266 switch (type) { 267 case IRQ_TYPE_EDGE_RISING: 268 /* Rising edge sensitive */ 269 + __lpc32xx_set_irq_type(d->irq, 1, 1); 270 break; 271 272 case IRQ_TYPE_EDGE_FALLING: 273 /* Falling edge sensitive */ 274 + __lpc32xx_set_irq_type(d->irq, 0, 1); 275 break; 276 277 case IRQ_TYPE_LEVEL_LOW: 278 /* Low level sensitive */ 279 + __lpc32xx_set_irq_type(d->irq, 0, 0); 280 break; 281 282 case IRQ_TYPE_LEVEL_HIGH: 283 /* High level sensitive */ 284 + __lpc32xx_set_irq_type(d->irq, 1, 0); 285 break; 286 287 /* Other modes are not supported */ ··· 290 } 291 292 /* Ok to use the level handler for all types */ 293 + set_irq_handler(d->irq, handle_level_irq); 294 295 return 0; 296 } 297 298 + static int lpc32xx_irq_wake(struct irq_data *d, unsigned int state) 299 { 300 unsigned long eventreg; 301 302 + if (lpc32xx_events[d->irq].mask != 0) { 303 + eventreg = __raw_readl(lpc32xx_events[d->irq]. 304 event_group->enab_reg); 305 306 if (state) 307 + eventreg |= lpc32xx_events[d->irq].mask; 308 else 309 + eventreg &= ~lpc32xx_events[d->irq].mask; 310 311 __raw_writel(eventreg, 312 + lpc32xx_events[d->irq].event_group->enab_reg); 313 314 return 0; 315 } 316 317 /* Clear event */ 318 + __raw_writel(lpc32xx_events[d->irq].mask, 319 + lpc32xx_events[d->irq].event_group->rawstat_reg); 320 321 return -ENODEV; 322 } ··· 336 } 337 338 static struct irq_chip lpc32xx_irq_chip = { 339 + .irq_ack = lpc32xx_ack_irq, 340 + .irq_mask = lpc32xx_mask_irq, 341 + .irq_unmask = lpc32xx_unmask_irq, 342 + .irq_set_type = lpc32xx_set_irq_type, 343 + .irq_set_wake = lpc32xx_irq_wake 344 }; 345 346 static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc)
+1 -1
arch/arm/mach-mmp/include/mach/mfp-mmp2.h
··· 6 #define MFP_DRIVE_VERY_SLOW (0x0 << 13) 7 #define MFP_DRIVE_SLOW (0x2 << 13) 8 #define MFP_DRIVE_MEDIUM (0x4 << 13) 9 - #define MFP_DRIVE_FAST (0x8 << 13) 10 11 /* GPIO */ 12 #define GPIO0_GPIO MFP_CFG(GPIO0, AF0)
··· 6 #define MFP_DRIVE_VERY_SLOW (0x0 << 13) 7 #define MFP_DRIVE_SLOW (0x2 << 13) 8 #define MFP_DRIVE_MEDIUM (0x4 << 13) 9 + #define MFP_DRIVE_FAST (0x6 << 13) 10 11 /* GPIO */ 12 #define GPIO0_GPIO MFP_CFG(GPIO0, AF0)
+1 -1
arch/arm/mach-mmp/include/mach/mfp-pxa910.h
··· 6 #define MFP_DRIVE_VERY_SLOW (0x0 << 13) 7 #define MFP_DRIVE_SLOW (0x2 << 13) 8 #define MFP_DRIVE_MEDIUM (0x4 << 13) 9 - #define MFP_DRIVE_FAST (0x8 << 13) 10 11 /* UART2 */ 12 #define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF6)
··· 6 #define MFP_DRIVE_VERY_SLOW (0x0 << 13) 7 #define MFP_DRIVE_SLOW (0x2 << 13) 8 #define MFP_DRIVE_MEDIUM (0x4 << 13) 9 + #define MFP_DRIVE_FAST (0x6 << 13) 10 11 /* UART2 */ 12 #define GPIO47_UART2_RXD MFP_CFG(GPIO47, AF6)
+24 -22
arch/arm/mach-mmp/irq-mmp2.c
··· 20 21 #include "common.h" 22 23 - static void icu_mask_irq(unsigned int irq) 24 { 25 - uint32_t r = __raw_readl(ICU_INT_CONF(irq)); 26 27 r &= ~ICU_INT_ROUTE_PJ4_IRQ; 28 - __raw_writel(r, ICU_INT_CONF(irq)); 29 } 30 31 - static void icu_unmask_irq(unsigned int irq) 32 { 33 - uint32_t r = __raw_readl(ICU_INT_CONF(irq)); 34 35 r |= ICU_INT_ROUTE_PJ4_IRQ; 36 - __raw_writel(r, ICU_INT_CONF(irq)); 37 } 38 39 static struct irq_chip icu_irq_chip = { 40 .name = "icu_irq", 41 - .mask = icu_mask_irq, 42 - .mask_ack = icu_mask_irq, 43 - .unmask = icu_unmask_irq, 44 }; 45 46 - static void pmic_irq_ack(unsigned int irq) 47 { 48 - if (irq == IRQ_MMP2_PMIC) 49 mmp2_clear_pmic_int(); 50 } 51 52 #define SECOND_IRQ_MASK(_name_, irq_base, prefix) \ 53 - static void _name_##_mask_irq(unsigned int irq) \ 54 { \ 55 uint32_t r; \ 56 - r = __raw_readl(prefix##_MASK) | (1 << (irq - irq_base)); \ 57 __raw_writel(r, prefix##_MASK); \ 58 } 59 60 #define SECOND_IRQ_UNMASK(_name_, irq_base, prefix) \ 61 - static void _name_##_unmask_irq(unsigned int irq) \ 62 { \ 63 uint32_t r; \ 64 - r = __raw_readl(prefix##_MASK) & ~(1 << (irq - irq_base)); \ 65 __raw_writel(r, prefix##_MASK); \ 66 } 67 ··· 88 SECOND_IRQ_DEMUX(_name_, irq_base, prefix) \ 89 static struct irq_chip _name_##_irq_chip = { \ 90 .name = #_name_, \ 91 - .mask = _name_##_mask_irq, \ 92 - .unmask = _name_##_unmask_irq, \ 93 } 94 95 SECOND_IRQ_CHIP(pmic, IRQ_MMP2_PMIC_BASE, MMP2_ICU_INT4); ··· 103 int irq; 104 105 for (irq = start; num > 0; irq++, num--) { 106 /* mask and clear the IRQ */ 107 - chip->mask(irq); 108 - if (chip->ack) 109 - chip->ack(irq); 110 111 set_irq_chip(irq, chip); 112 set_irq_flags(irq, IRQF_VALID); ··· 121 int irq; 122 123 for (irq = 0; irq < IRQ_MMP2_MUX_BASE; irq++) { 124 - icu_mask_irq(irq); 125 set_irq_chip(irq, &icu_irq_chip); 126 set_irq_flags(irq, IRQF_VALID); 127 ··· 141 /* NOTE: IRQ_MMP2_PMIC requires the PMIC MFPR register 142 * to be written to clear the interrupt 143 */ 144 - pmic_irq_chip.ack = pmic_irq_ack; 145 146 init_mux_irq(&pmic_irq_chip, IRQ_MMP2_PMIC_BASE, 2); 147 init_mux_irq(&rtc_irq_chip, IRQ_MMP2_RTC_BASE, 2);
··· 20 21 #include "common.h" 22 23 + static void icu_mask_irq(struct irq_data *d) 24 { 25 + uint32_t r = __raw_readl(ICU_INT_CONF(d->irq)); 26 27 r &= ~ICU_INT_ROUTE_PJ4_IRQ; 28 + __raw_writel(r, ICU_INT_CONF(d->irq)); 29 } 30 31 + static void icu_unmask_irq(struct irq_data *d) 32 { 33 + uint32_t r = __raw_readl(ICU_INT_CONF(d->irq)); 34 35 r |= ICU_INT_ROUTE_PJ4_IRQ; 36 + __raw_writel(r, ICU_INT_CONF(d->irq)); 37 } 38 39 static struct irq_chip icu_irq_chip = { 40 .name = "icu_irq", 41 + .irq_mask = icu_mask_irq, 42 + .irq_mask_ack = icu_mask_irq, 43 + .irq_unmask = icu_unmask_irq, 44 }; 45 46 + static void pmic_irq_ack(struct irq_data *d) 47 { 48 + if (d->irq == IRQ_MMP2_PMIC) 49 mmp2_clear_pmic_int(); 50 } 51 52 #define SECOND_IRQ_MASK(_name_, irq_base, prefix) \ 53 + static void _name_##_mask_irq(struct irq_data *d) \ 54 { \ 55 uint32_t r; \ 56 + r = __raw_readl(prefix##_MASK) | (1 << (d->irq - irq_base)); \ 57 __raw_writel(r, prefix##_MASK); \ 58 } 59 60 #define SECOND_IRQ_UNMASK(_name_, irq_base, prefix) \ 61 + static void _name_##_unmask_irq(struct irq_data *d) \ 62 { \ 63 uint32_t r; \ 64 + r = __raw_readl(prefix##_MASK) & ~(1 << (d->irq - irq_base)); \ 65 __raw_writel(r, prefix##_MASK); \ 66 } 67 ··· 88 SECOND_IRQ_DEMUX(_name_, irq_base, prefix) \ 89 static struct irq_chip _name_##_irq_chip = { \ 90 .name = #_name_, \ 91 + .irq_mask = _name_##_mask_irq, \ 92 + .irq_unmask = _name_##_unmask_irq, \ 93 } 94 95 SECOND_IRQ_CHIP(pmic, IRQ_MMP2_PMIC_BASE, MMP2_ICU_INT4); ··· 103 int irq; 104 105 for (irq = start; num > 0; irq++, num--) { 106 + struct irq_data *d = irq_get_irq_data(irq); 107 + 108 /* mask and clear the IRQ */ 109 + chip->irq_mask(d); 110 + if (chip->irq_ack) 111 + chip->irq_ack(d); 112 113 set_irq_chip(irq, chip); 114 set_irq_flags(irq, IRQF_VALID); ··· 119 int irq; 120 121 for (irq = 0; irq < IRQ_MMP2_MUX_BASE; irq++) { 122 + icu_mask_irq(irq_get_irq_data(irq)); 123 set_irq_chip(irq, &icu_irq_chip); 124 set_irq_flags(irq, IRQF_VALID); 125 ··· 139 /* NOTE: IRQ_MMP2_PMIC requires the PMIC MFPR register 140 * to be written to clear the interrupt 141 */ 142 + pmic_irq_chip.irq_ack = pmic_irq_ack; 143 144 init_mux_irq(&pmic_irq_chip, IRQ_MMP2_PMIC_BASE, 2); 145 init_mux_irq(&rtc_irq_chip, IRQ_MMP2_RTC_BASE, 2);
+9 -9
arch/arm/mach-mmp/irq-pxa168.c
··· 25 #define PRIORITY_DEFAULT 0x1 26 #define PRIORITY_NONE 0x0 /* means IRQ disabled */ 27 28 - static void icu_mask_irq(unsigned int irq) 29 { 30 - __raw_writel(PRIORITY_NONE, ICU_INT_CONF(irq)); 31 } 32 33 - static void icu_unmask_irq(unsigned int irq) 34 { 35 - __raw_writel(IRQ_ROUTE_TO_AP | PRIORITY_DEFAULT, ICU_INT_CONF(irq)); 36 } 37 38 static struct irq_chip icu_irq_chip = { 39 - .name = "icu_irq", 40 - .ack = icu_mask_irq, 41 - .mask = icu_mask_irq, 42 - .unmask = icu_unmask_irq, 43 }; 44 45 void __init icu_init_irq(void) ··· 47 int irq; 48 49 for (irq = 0; irq < 64; irq++) { 50 - icu_mask_irq(irq); 51 set_irq_chip(irq, &icu_irq_chip); 52 set_irq_handler(irq, handle_level_irq); 53 set_irq_flags(irq, IRQF_VALID);
··· 25 #define PRIORITY_DEFAULT 0x1 26 #define PRIORITY_NONE 0x0 /* means IRQ disabled */ 27 28 + static void icu_mask_irq(struct irq_data *d) 29 { 30 + __raw_writel(PRIORITY_NONE, ICU_INT_CONF(d->irq)); 31 } 32 33 + static void icu_unmask_irq(struct irq_data *d) 34 { 35 + __raw_writel(IRQ_ROUTE_TO_AP | PRIORITY_DEFAULT, ICU_INT_CONF(d->irq)); 36 } 37 38 static struct irq_chip icu_irq_chip = { 39 + .name = "icu_irq", 40 + .irq_ack = icu_mask_irq, 41 + .irq_mask = icu_mask_irq, 42 + .irq_unmask = icu_unmask_irq, 43 }; 44 45 void __init icu_init_irq(void) ··· 47 int irq; 48 49 for (irq = 0; irq < 64; irq++) { 50 + icu_mask_irq(irq_get_irq_data(irq)); 51 set_irq_chip(irq, &icu_irq_chip); 52 set_irq_handler(irq, handle_level_irq); 53 set_irq_flags(irq, IRQF_VALID);
+21 -21
arch/arm/mach-msm/board-trout-gpio.c
··· 113 TROUT_GPIO_BANK("VIRTUAL", 0x12, TROUT_GPIO_VIRTUAL_BASE, 0), 114 }; 115 116 - static void trout_gpio_irq_ack(unsigned int irq) 117 { 118 - int bank = TROUT_INT_TO_BANK(irq); 119 - uint8_t mask = TROUT_INT_TO_MASK(irq); 120 int reg = TROUT_BANK_TO_STAT_REG(bank); 121 - /*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", irq);*/ 122 writeb(mask, TROUT_CPLD_BASE + reg); 123 } 124 125 - static void trout_gpio_irq_mask(unsigned int irq) 126 { 127 unsigned long flags; 128 uint8_t reg_val; 129 - int bank = TROUT_INT_TO_BANK(irq); 130 - uint8_t mask = TROUT_INT_TO_MASK(irq); 131 int reg = TROUT_BANK_TO_MASK_REG(bank); 132 133 local_irq_save(flags); 134 reg_val = trout_int_mask[bank] |= mask; 135 /*printk(KERN_INFO "trout_gpio_irq_mask irq %d => %d:%02x\n", 136 - irq, bank, reg_val);*/ 137 writeb(reg_val, TROUT_CPLD_BASE + reg); 138 local_irq_restore(flags); 139 } 140 141 - static void trout_gpio_irq_unmask(unsigned int irq) 142 { 143 unsigned long flags; 144 uint8_t reg_val; 145 - int bank = TROUT_INT_TO_BANK(irq); 146 - uint8_t mask = TROUT_INT_TO_MASK(irq); 147 int reg = TROUT_BANK_TO_MASK_REG(bank); 148 149 local_irq_save(flags); 150 reg_val = trout_int_mask[bank] &= ~mask; 151 /*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n", 152 - irq, bank, reg_val);*/ 153 writeb(reg_val, TROUT_CPLD_BASE + reg); 154 local_irq_restore(flags); 155 } 156 157 - int trout_gpio_irq_set_wake(unsigned int irq, unsigned int on) 158 { 159 unsigned long flags; 160 - int bank = TROUT_INT_TO_BANK(irq); 161 - uint8_t mask = TROUT_INT_TO_MASK(irq); 162 163 local_irq_save(flags); 164 if(on) ··· 198 } 199 int_base += TROUT_INT_BANK0_COUNT; 200 } 201 - desc->chip->ack(irq); 202 } 203 204 static struct irq_chip trout_gpio_irq_chip = { 205 - .name = "troutgpio", 206 - .ack = trout_gpio_irq_ack, 207 - .mask = trout_gpio_irq_mask, 208 - .unmask = trout_gpio_irq_unmask, 209 - .set_wake = trout_gpio_irq_set_wake, 210 }; 211 212 /*
··· 113 TROUT_GPIO_BANK("VIRTUAL", 0x12, TROUT_GPIO_VIRTUAL_BASE, 0), 114 }; 115 116 + static void trout_gpio_irq_ack(struct irq_data *d) 117 { 118 + int bank = TROUT_INT_TO_BANK(d->irq); 119 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 120 int reg = TROUT_BANK_TO_STAT_REG(bank); 121 + /*printk(KERN_INFO "trout_gpio_irq_ack irq %d\n", d->irq);*/ 122 writeb(mask, TROUT_CPLD_BASE + reg); 123 } 124 125 + static void trout_gpio_irq_mask(struct irq_data *d) 126 { 127 unsigned long flags; 128 uint8_t reg_val; 129 + int bank = TROUT_INT_TO_BANK(d->irq); 130 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 131 int reg = TROUT_BANK_TO_MASK_REG(bank); 132 133 local_irq_save(flags); 134 reg_val = trout_int_mask[bank] |= mask; 135 /*printk(KERN_INFO "trout_gpio_irq_mask irq %d => %d:%02x\n", 136 + d->irq, bank, reg_val);*/ 137 writeb(reg_val, TROUT_CPLD_BASE + reg); 138 local_irq_restore(flags); 139 } 140 141 + static void trout_gpio_irq_unmask(struct irq_data *d) 142 { 143 unsigned long flags; 144 uint8_t reg_val; 145 + int bank = TROUT_INT_TO_BANK(d->irq); 146 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 147 int reg = TROUT_BANK_TO_MASK_REG(bank); 148 149 local_irq_save(flags); 150 reg_val = trout_int_mask[bank] &= ~mask; 151 /*printk(KERN_INFO "trout_gpio_irq_unmask irq %d => %d:%02x\n", 152 + d->irq, bank, reg_val);*/ 153 writeb(reg_val, TROUT_CPLD_BASE + reg); 154 local_irq_restore(flags); 155 } 156 157 + int trout_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 158 { 159 unsigned long flags; 160 + int bank = TROUT_INT_TO_BANK(d->irq); 161 + uint8_t mask = TROUT_INT_TO_MASK(d->irq); 162 163 local_irq_save(flags); 164 if(on) ··· 198 } 199 int_base += TROUT_INT_BANK0_COUNT; 200 } 201 + desc->irq_data.chip->irq_ack(&desc->irq_data); 202 } 203 204 static struct irq_chip trout_gpio_irq_chip = { 205 + .name = "troutgpio", 206 + .irq_ack = trout_gpio_irq_ack, 207 + .irq_mask = trout_gpio_irq_mask, 208 + .irq_unmask = trout_gpio_irq_unmask, 209 + .irq_set_wake = trout_gpio_irq_set_wake, 210 }; 211 212 /*
+24 -24
arch/arm/mach-msm/gpio.c
··· 225 #endif 226 }; 227 228 - static void msm_gpio_irq_ack(unsigned int irq) 229 { 230 unsigned long irq_flags; 231 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 232 spin_lock_irqsave(&msm_chip->lock, irq_flags); 233 msm_gpio_clear_detect_status(msm_chip, 234 - irq - gpio_to_irq(msm_chip->chip.base)); 235 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 236 } 237 238 - static void msm_gpio_irq_mask(unsigned int irq) 239 { 240 unsigned long irq_flags; 241 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 242 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 243 244 spin_lock_irqsave(&msm_chip->lock, irq_flags); 245 /* level triggered interrupts are also latched */ ··· 250 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 251 } 252 253 - static void msm_gpio_irq_unmask(unsigned int irq) 254 { 255 unsigned long irq_flags; 256 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 257 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 258 259 spin_lock_irqsave(&msm_chip->lock, irq_flags); 260 /* level triggered interrupts are also latched */ ··· 265 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 266 } 267 268 - static int msm_gpio_irq_set_wake(unsigned int irq, unsigned int on) 269 { 270 unsigned long irq_flags; 271 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 272 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 273 274 spin_lock_irqsave(&msm_chip->lock, irq_flags); 275 ··· 282 return 0; 283 } 284 285 - static int msm_gpio_irq_set_type(unsigned int irq, unsigned int flow_type) 286 { 287 unsigned long irq_flags; 288 - struct msm_gpio_chip *msm_chip = get_irq_chip_data(irq); 289 - unsigned offset = irq - gpio_to_irq(msm_chip->chip.base); 290 unsigned val, mask = BIT(offset); 291 292 spin_lock_irqsave(&msm_chip->lock, irq_flags); 293 val = readl(msm_chip->regs.int_edge); 294 if (flow_type & IRQ_TYPE_EDGE_BOTH) { 295 writel(val | mask, msm_chip->regs.int_edge); 296 - irq_desc[irq].handle_irq = handle_edge_irq; 297 } else { 298 writel(val & ~mask, msm_chip->regs.int_edge); 299 - irq_desc[irq].handle_irq = handle_level_irq; 300 } 301 if ((flow_type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { 302 msm_chip->both_edge_detect |= mask; ··· 333 msm_chip->chip.base + j); 334 } 335 } 336 - desc->chip->ack(irq); 337 } 338 339 static struct irq_chip msm_gpio_irq_chip = { 340 - .name = "msmgpio", 341 - .ack = msm_gpio_irq_ack, 342 - .mask = msm_gpio_irq_mask, 343 - .unmask = msm_gpio_irq_unmask, 344 - .set_wake = msm_gpio_irq_set_wake, 345 - .set_type = msm_gpio_irq_set_type, 346 }; 347 348 static int __init msm_init_gpio(void)
··· 225 #endif 226 }; 227 228 + static void msm_gpio_irq_ack(struct irq_data *d) 229 { 230 unsigned long irq_flags; 231 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 232 spin_lock_irqsave(&msm_chip->lock, irq_flags); 233 msm_gpio_clear_detect_status(msm_chip, 234 + d->irq - gpio_to_irq(msm_chip->chip.base)); 235 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 236 } 237 238 + static void msm_gpio_irq_mask(struct irq_data *d) 239 { 240 unsigned long irq_flags; 241 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 242 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 243 244 spin_lock_irqsave(&msm_chip->lock, irq_flags); 245 /* level triggered interrupts are also latched */ ··· 250 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 251 } 252 253 + static void msm_gpio_irq_unmask(struct irq_data *d) 254 { 255 unsigned long irq_flags; 256 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 257 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 258 259 spin_lock_irqsave(&msm_chip->lock, irq_flags); 260 /* level triggered interrupts are also latched */ ··· 265 spin_unlock_irqrestore(&msm_chip->lock, irq_flags); 266 } 267 268 + static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 269 { 270 unsigned long irq_flags; 271 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 272 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 273 274 spin_lock_irqsave(&msm_chip->lock, irq_flags); 275 ··· 282 return 0; 283 } 284 285 + static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type) 286 { 287 unsigned long irq_flags; 288 + struct msm_gpio_chip *msm_chip = irq_data_get_irq_chip_data(d); 289 + unsigned offset = d->irq - gpio_to_irq(msm_chip->chip.base); 290 unsigned val, mask = BIT(offset); 291 292 spin_lock_irqsave(&msm_chip->lock, irq_flags); 293 val = readl(msm_chip->regs.int_edge); 294 if (flow_type & IRQ_TYPE_EDGE_BOTH) { 295 writel(val | mask, msm_chip->regs.int_edge); 296 + irq_desc[d->irq].handle_irq = handle_edge_irq; 297 } else { 298 writel(val & ~mask, msm_chip->regs.int_edge); 299 + irq_desc[d->irq].handle_irq = handle_level_irq; 300 } 301 if ((flow_type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH) { 302 msm_chip->both_edge_detect |= mask; ··· 333 msm_chip->chip.base + j); 334 } 335 } 336 + desc->irq_data.chip->irq_ack(&desc->irq_data); 337 } 338 339 static struct irq_chip msm_gpio_irq_chip = { 340 + .name = "msmgpio", 341 + .irq_ack = msm_gpio_irq_ack, 342 + .irq_mask = msm_gpio_irq_mask, 343 + .irq_unmask = msm_gpio_irq_unmask, 344 + .irq_set_wake = msm_gpio_irq_set_wake, 345 + .irq_set_type = msm_gpio_irq_set_type, 346 }; 347 348 static int __init msm_init_gpio(void)
+32 -33
arch/arm/mach-msm/irq-vic.c
··· 226 writel(val, base + (i * 4)); 227 } 228 229 - static void msm_irq_ack(unsigned int irq) 230 { 231 - void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, irq); 232 - irq = 1 << (irq & 31); 233 - writel(irq, reg); 234 } 235 236 - static void msm_irq_mask(unsigned int irq) 237 { 238 - void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, irq); 239 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 240 - uint32_t mask = 1UL << (irq & 31); 241 - int smsm_irq = msm_irq_to_smsm[irq]; 242 243 msm_irq_shadow_reg[index].int_en[0] &= ~mask; 244 writel(mask, reg); ··· 249 } 250 } 251 252 - static void msm_irq_unmask(unsigned int irq) 253 { 254 - void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, irq); 255 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 256 - uint32_t mask = 1UL << (irq & 31); 257 - int smsm_irq = msm_irq_to_smsm[irq]; 258 259 msm_irq_shadow_reg[index].int_en[0] |= mask; 260 writel(mask, reg); ··· 267 } 268 } 269 270 - static int msm_irq_set_wake(unsigned int irq, unsigned int on) 271 { 272 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 273 - uint32_t mask = 1UL << (irq & 31); 274 - int smsm_irq = msm_irq_to_smsm[irq]; 275 276 if (smsm_irq == 0) { 277 - printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", irq); 278 return -EINVAL; 279 } 280 if (on) ··· 293 return 0; 294 } 295 296 - static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) 297 { 298 - void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, irq); 299 - void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, irq); 300 - unsigned index = VIC_INT_TO_REG_INDEX(irq); 301 - int b = 1 << (irq & 31); 302 uint32_t polarity; 303 uint32_t type; 304 ··· 313 type = msm_irq_shadow_reg[index].int_type; 314 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 315 type |= b; 316 - irq_desc[irq].handle_irq = handle_edge_irq; 317 } 318 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 319 type &= ~b; 320 - irq_desc[irq].handle_irq = handle_level_irq; 321 } 322 writel(type, treg); 323 msm_irq_shadow_reg[index].int_type = type; ··· 325 } 326 327 static struct irq_chip msm_irq_chip = { 328 - .name = "msm", 329 - .disable = msm_irq_mask, 330 - .ack = msm_irq_ack, 331 - .mask = msm_irq_mask, 332 - .unmask = msm_irq_unmask, 333 - .set_wake = msm_irq_set_wake, 334 - .set_type = msm_irq_set_type, 335 }; 336 337 void __init msm_init_irq(void)
··· 226 writel(val, base + (i * 4)); 227 } 228 229 + static void msm_irq_ack(struct irq_data *d) 230 { 231 + void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, d->irq); 232 + writel(1 << (d->irq & 31), reg); 233 } 234 235 + static void msm_irq_mask(struct irq_data *d) 236 { 237 + void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENCLEAR0, d->irq); 238 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 239 + uint32_t mask = 1UL << (d->irq & 31); 240 + int smsm_irq = msm_irq_to_smsm[d->irq]; 241 242 msm_irq_shadow_reg[index].int_en[0] &= ~mask; 243 writel(mask, reg); ··· 250 } 251 } 252 253 + static void msm_irq_unmask(struct irq_data *d) 254 { 255 + void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_ENSET0, d->irq); 256 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 257 + uint32_t mask = 1UL << (d->irq & 31); 258 + int smsm_irq = msm_irq_to_smsm[d->irq]; 259 260 msm_irq_shadow_reg[index].int_en[0] |= mask; 261 writel(mask, reg); ··· 268 } 269 } 270 271 + static int msm_irq_set_wake(struct irq_data *d, unsigned int on) 272 { 273 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 274 + uint32_t mask = 1UL << (d->irq & 31); 275 + int smsm_irq = msm_irq_to_smsm[d->irq]; 276 277 if (smsm_irq == 0) { 278 + printk(KERN_ERR "msm_irq_set_wake: bad wakeup irq %d\n", d->irq); 279 return -EINVAL; 280 } 281 if (on) ··· 294 return 0; 295 } 296 297 + static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type) 298 { 299 + void __iomem *treg = VIC_INT_TO_REG_ADDR(VIC_INT_TYPE0, d->irq); 300 + void __iomem *preg = VIC_INT_TO_REG_ADDR(VIC_INT_POLARITY0, d->irq); 301 + unsigned index = VIC_INT_TO_REG_INDEX(d->irq); 302 + int b = 1 << (d->irq & 31); 303 uint32_t polarity; 304 uint32_t type; 305 ··· 314 type = msm_irq_shadow_reg[index].int_type; 315 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 316 type |= b; 317 + irq_desc[d->irq].handle_irq = handle_edge_irq; 318 } 319 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 320 type &= ~b; 321 + irq_desc[d->irq].handle_irq = handle_level_irq; 322 } 323 writel(type, treg); 324 msm_irq_shadow_reg[index].int_type = type; ··· 326 } 327 328 static struct irq_chip msm_irq_chip = { 329 + .name = "msm", 330 + .irq_disable = msm_irq_mask, 331 + .irq_ack = msm_irq_ack, 332 + .irq_mask = msm_irq_mask, 333 + .irq_unmask = msm_irq_unmask, 334 + .irq_set_wake = msm_irq_set_wake, 335 + .irq_set_type = msm_irq_set_type, 336 }; 337 338 void __init msm_init_irq(void)
+22 -23
arch/arm/mach-msm/irq.c
··· 64 #define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4)) 65 #define VIC_VECTADDR(n) VIC_REG(0x0400+((n) * 4)) 66 67 - static void msm_irq_ack(unsigned int irq) 68 { 69 - void __iomem *reg = VIC_INT_CLEAR0 + ((irq & 32) ? 4 : 0); 70 - irq = 1 << (irq & 31); 71 - writel(irq, reg); 72 } 73 74 - static void msm_irq_mask(unsigned int irq) 75 { 76 - void __iomem *reg = VIC_INT_ENCLEAR0 + ((irq & 32) ? 4 : 0); 77 - writel(1 << (irq & 31), reg); 78 } 79 80 - static void msm_irq_unmask(unsigned int irq) 81 { 82 - void __iomem *reg = VIC_INT_ENSET0 + ((irq & 32) ? 4 : 0); 83 - writel(1 << (irq & 31), reg); 84 } 85 86 - static int msm_irq_set_wake(unsigned int irq, unsigned int on) 87 { 88 return -EINVAL; 89 } 90 91 - static int msm_irq_set_type(unsigned int irq, unsigned int flow_type) 92 { 93 - void __iomem *treg = VIC_INT_TYPE0 + ((irq & 32) ? 4 : 0); 94 - void __iomem *preg = VIC_INT_POLARITY0 + ((irq & 32) ? 4 : 0); 95 - int b = 1 << (irq & 31); 96 97 if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) 98 writel(readl(preg) | b, preg); ··· 100 101 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 102 writel(readl(treg) | b, treg); 103 - irq_desc[irq].handle_irq = handle_edge_irq; 104 } 105 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 106 writel(readl(treg) & (~b), treg); 107 - irq_desc[irq].handle_irq = handle_level_irq; 108 } 109 return 0; 110 } 111 112 static struct irq_chip msm_irq_chip = { 113 - .name = "msm", 114 - .ack = msm_irq_ack, 115 - .mask = msm_irq_mask, 116 - .unmask = msm_irq_unmask, 117 - .set_wake = msm_irq_set_wake, 118 - .set_type = msm_irq_set_type, 119 }; 120 121 void __init msm_init_irq(void)
··· 64 #define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4)) 65 #define VIC_VECTADDR(n) VIC_REG(0x0400+((n) * 4)) 66 67 + static void msm_irq_ack(struct irq_data *d) 68 { 69 + void __iomem *reg = VIC_INT_CLEAR0 + ((d->irq & 32) ? 4 : 0); 70 + writel(1 << (d->irq & 31), reg); 71 } 72 73 + static void msm_irq_mask(struct irq_data *d) 74 { 75 + void __iomem *reg = VIC_INT_ENCLEAR0 + ((d->irq & 32) ? 4 : 0); 76 + writel(1 << (d->irq & 31), reg); 77 } 78 79 + static void msm_irq_unmask(struct irq_data *d) 80 { 81 + void __iomem *reg = VIC_INT_ENSET0 + ((d->irq & 32) ? 4 : 0); 82 + writel(1 << (d->irq & 31), reg); 83 } 84 85 + static int msm_irq_set_wake(struct irq_data *d, unsigned int on) 86 { 87 return -EINVAL; 88 } 89 90 + static int msm_irq_set_type(struct irq_data *d, unsigned int flow_type) 91 { 92 + void __iomem *treg = VIC_INT_TYPE0 + ((d->irq & 32) ? 4 : 0); 93 + void __iomem *preg = VIC_INT_POLARITY0 + ((d->irq & 32) ? 4 : 0); 94 + int b = 1 << (d->irq & 31); 95 96 if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW)) 97 writel(readl(preg) | b, preg); ··· 101 102 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 103 writel(readl(treg) | b, treg); 104 + irq_desc[d->irq].handle_irq = handle_edge_irq; 105 } 106 if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) { 107 writel(readl(treg) & (~b), treg); 108 + irq_desc[d->irq].handle_irq = handle_level_irq; 109 } 110 return 0; 111 } 112 113 static struct irq_chip msm_irq_chip = { 114 + .name = "msm", 115 + .irq_ack = msm_irq_ack, 116 + .irq_mask = msm_irq_mask, 117 + .irq_unmask = msm_irq_unmask, 118 + .irq_set_wake = msm_irq_set_wake, 119 + .irq_set_type = msm_irq_set_type, 120 }; 121 122 void __init msm_init_irq(void)
+19 -20
arch/arm/mach-msm/sirc.c
··· 42 43 /* Mask off the given interrupt. Keep the int_enable mask in sync with 44 the enable reg, so it can be restored after power collapse. */ 45 - static void sirc_irq_mask(unsigned int irq) 46 { 47 unsigned int mask; 48 49 - 50 - mask = 1 << (irq - FIRST_SIRC_IRQ); 51 writel(mask, sirc_regs.int_enable_clear); 52 int_enable &= ~mask; 53 return; ··· 54 55 /* Unmask the given interrupt. Keep the int_enable mask in sync with 56 the enable reg, so it can be restored after power collapse. */ 57 - static void sirc_irq_unmask(unsigned int irq) 58 { 59 unsigned int mask; 60 61 - mask = 1 << (irq - FIRST_SIRC_IRQ); 62 writel(mask, sirc_regs.int_enable_set); 63 int_enable |= mask; 64 return; 65 } 66 67 - static void sirc_irq_ack(unsigned int irq) 68 { 69 unsigned int mask; 70 71 - mask = 1 << (irq - FIRST_SIRC_IRQ); 72 writel(mask, sirc_regs.int_clear); 73 return; 74 } 75 76 - static int sirc_irq_set_wake(unsigned int irq, unsigned int on) 77 { 78 unsigned int mask; 79 80 /* Used to set the interrupt enable mask during power collapse. */ 81 - mask = 1 << (irq - FIRST_SIRC_IRQ); 82 if (on) 83 wake_enable |= mask; 84 else ··· 87 return 0; 88 } 89 90 - static int sirc_irq_set_type(unsigned int irq, unsigned int flow_type) 91 { 92 unsigned int mask; 93 unsigned int val; 94 95 - mask = 1 << (irq - FIRST_SIRC_IRQ); 96 val = readl(sirc_regs.int_polarity); 97 98 if (flow_type & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_FALLING)) ··· 105 val = readl(sirc_regs.int_type); 106 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 107 val |= mask; 108 - irq_desc[irq].handle_irq = handle_edge_irq; 109 } else { 110 val &= ~mask; 111 - irq_desc[irq].handle_irq = handle_level_irq; 112 } 113 114 writel(val, sirc_regs.int_type); ··· 138 ; 139 generic_handle_irq(sirq+FIRST_SIRC_IRQ); 140 141 - desc->chip->ack(irq); 142 } 143 144 static struct irq_chip sirc_irq_chip = { 145 - .name = "sirc", 146 - .ack = sirc_irq_ack, 147 - .mask = sirc_irq_mask, 148 - .unmask = sirc_irq_unmask, 149 - .set_wake = sirc_irq_set_wake, 150 - .set_type = sirc_irq_set_type, 151 }; 152 153 void __init msm_init_sirc(void)
··· 42 43 /* Mask off the given interrupt. Keep the int_enable mask in sync with 44 the enable reg, so it can be restored after power collapse. */ 45 + static void sirc_irq_mask(struct irq_data *d) 46 { 47 unsigned int mask; 48 49 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 50 writel(mask, sirc_regs.int_enable_clear); 51 int_enable &= ~mask; 52 return; ··· 55 56 /* Unmask the given interrupt. Keep the int_enable mask in sync with 57 the enable reg, so it can be restored after power collapse. */ 58 + static void sirc_irq_unmask(struct irq_data *d) 59 { 60 unsigned int mask; 61 62 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 63 writel(mask, sirc_regs.int_enable_set); 64 int_enable |= mask; 65 return; 66 } 67 68 + static void sirc_irq_ack(struct irq_data *d) 69 { 70 unsigned int mask; 71 72 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 73 writel(mask, sirc_regs.int_clear); 74 return; 75 } 76 77 + static int sirc_irq_set_wake(struct irq_data *d, unsigned int on) 78 { 79 unsigned int mask; 80 81 /* Used to set the interrupt enable mask during power collapse. */ 82 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 83 if (on) 84 wake_enable |= mask; 85 else ··· 88 return 0; 89 } 90 91 + static int sirc_irq_set_type(struct irq_data *d, unsigned int flow_type) 92 { 93 unsigned int mask; 94 unsigned int val; 95 96 + mask = 1 << (d->irq - FIRST_SIRC_IRQ); 97 val = readl(sirc_regs.int_polarity); 98 99 if (flow_type & (IRQF_TRIGGER_LOW | IRQF_TRIGGER_FALLING)) ··· 106 val = readl(sirc_regs.int_type); 107 if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) { 108 val |= mask; 109 + irq_desc[d->irq].handle_irq = handle_edge_irq; 110 } else { 111 val &= ~mask; 112 + irq_desc[d->irq].handle_irq = handle_level_irq; 113 } 114 115 writel(val, sirc_regs.int_type); ··· 139 ; 140 generic_handle_irq(sirq+FIRST_SIRC_IRQ); 141 142 + desc->irq_data.chip->irq_ack(&desc->irq_data); 143 } 144 145 static struct irq_chip sirc_irq_chip = { 146 + .name = "sirc", 147 + .irq_ack = sirc_irq_ack, 148 + .irq_mask = sirc_irq_mask, 149 + .irq_unmask = sirc_irq_unmask, 150 + .irq_set_wake = sirc_irq_set_wake, 151 + .irq_set_type = sirc_irq_set_type, 152 }; 153 154 void __init msm_init_sirc(void)
+2 -2
arch/arm/mach-mx3/mach-mx31_3ds.c
··· 147 .init_data = &pwgtx_init, 148 }, { 149 150 - .id = MC13783_REGU_GPO1, /* Turn on 1.8V */ 151 .init_data = &gpo_init, 152 }, { 153 - .id = MC13783_REGU_GPO3, /* Turn on 3.3V */ 154 .init_data = &gpo_init, 155 }, 156 };
··· 147 .init_data = &pwgtx_init, 148 }, { 149 150 + .id = MC13783_REG_GPO1, /* Turn on 1.8V */ 151 .init_data = &gpo_init, 152 }, { 153 + .id = MC13783_REG_GPO3, /* Turn on 3.3V */ 154 .init_data = &gpo_init, 155 }, 156 };
+9 -9
arch/arm/mach-mx3/mach-mx31ads.c
··· 162 * Disable an expio pin's interrupt by setting the bit in the imr. 163 * @param irq an expio virtual irq number 164 */ 165 - static void expio_mask_irq(u32 irq) 166 { 167 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 168 /* mask the interrupt */ 169 __raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG); 170 __raw_readw(PBC_INTMASK_CLEAR_REG); ··· 174 * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr. 175 * @param irq an expanded io virtual irq number 176 */ 177 - static void expio_ack_irq(u32 irq) 178 { 179 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 180 /* clear the interrupt status */ 181 __raw_writew(1 << expio, PBC_INTSTATUS_REG); 182 } ··· 185 * Enable a expio pin's interrupt by clearing the bit in the imr. 186 * @param irq a expio virtual irq number 187 */ 188 - static void expio_unmask_irq(u32 irq) 189 { 190 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 191 /* unmask the interrupt */ 192 __raw_writew(1 << expio, PBC_INTMASK_SET_REG); 193 } 194 195 static struct irq_chip expio_irq_chip = { 196 .name = "EXPIO(CPLD)", 197 - .ack = expio_ack_irq, 198 - .mask = expio_mask_irq, 199 - .unmask = expio_unmask_irq, 200 }; 201 202 static void __init mx31ads_init_expio(void)
··· 162 * Disable an expio pin's interrupt by setting the bit in the imr. 163 * @param irq an expio virtual irq number 164 */ 165 + static void expio_mask_irq(struct irq_data *d) 166 { 167 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 168 /* mask the interrupt */ 169 __raw_writew(1 << expio, PBC_INTMASK_CLEAR_REG); 170 __raw_readw(PBC_INTMASK_CLEAR_REG); ··· 174 * Acknowledge an expanded io pin's interrupt by clearing the bit in the isr. 175 * @param irq an expanded io virtual irq number 176 */ 177 + static void expio_ack_irq(struct irq_data *d) 178 { 179 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 180 /* clear the interrupt status */ 181 __raw_writew(1 << expio, PBC_INTSTATUS_REG); 182 } ··· 185 * Enable a expio pin's interrupt by clearing the bit in the imr. 186 * @param irq a expio virtual irq number 187 */ 188 + static void expio_unmask_irq(struct irq_data *d) 189 { 190 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 191 /* unmask the interrupt */ 192 __raw_writew(1 << expio, PBC_INTMASK_SET_REG); 193 } 194 195 static struct irq_chip expio_irq_chip = { 196 .name = "EXPIO(CPLD)", 197 + .irq_ack = expio_ack_irq, 198 + .irq_mask = expio_mask_irq, 199 + .irq_unmask = expio_unmask_irq, 200 }; 201 202 static void __init mx31ads_init_expio(void)
+20
arch/arm/mach-mx5/Kconfig
··· 50 config MACH_MX51_3DS 51 bool "Support MX51PDK (3DS)" 52 select SOC_IMX51 53 select IMX_HAVE_PLATFORM_IMX_UART 54 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 55 select IMX_HAVE_PLATFORM_SPI_IMX ··· 78 config MACH_EUKREA_MBIMX51_BASEBOARD 79 prompt "Eukrea MBIMX51 development board" 80 bool 81 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 82 help 83 This adds board specific devices that can be found on Eukrea's ··· 126 bool "Support MX53 EVK platforms" 127 select SOC_IMX53 128 select IMX_HAVE_PLATFORM_IMX_UART 129 help 130 Include support for MX53 EVK platform. This includes specific 131 configurations for the board and its peripherals. 132 133 134 config MACH_MX50_RDP 135 bool "Support MX50 reference design platform"
··· 50 config MACH_MX51_3DS 51 bool "Support MX51PDK (3DS)" 52 select SOC_IMX51 53 + select IMX_HAVE_PLATFORM_IMX_KEYPAD 54 select IMX_HAVE_PLATFORM_IMX_UART 55 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 56 select IMX_HAVE_PLATFORM_SPI_IMX ··· 77 config MACH_EUKREA_MBIMX51_BASEBOARD 78 prompt "Eukrea MBIMX51 development board" 79 bool 80 + select IMX_HAVE_PLATFORM_IMX_KEYPAD 81 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 82 help 83 This adds board specific devices that can be found on Eukrea's ··· 124 bool "Support MX53 EVK platforms" 125 select SOC_IMX53 126 select IMX_HAVE_PLATFORM_IMX_UART 127 + select IMX_HAVE_PLATFORM_IMX_I2C 128 + select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 129 + select IMX_HAVE_PLATFORM_SPI_IMX 130 help 131 Include support for MX53 EVK platform. This includes specific 132 configurations for the board and its peripherals. 133 134 + config MACH_MX53_SMD 135 + bool "Support MX53 SMD platforms" 136 + select SOC_IMX53 137 + select IMX_HAVE_PLATFORM_IMX_UART 138 + help 139 + Include support for MX53 SMD platform. This includes specific 140 + configurations for the board and its peripherals. 141 + 142 + config MACH_MX53_LOCO 143 + bool "Support MX53 LOCO platforms" 144 + select SOC_IMX53 145 + select IMX_HAVE_PLATFORM_IMX_UART 146 + help 147 + Include support for MX53 LOCO platform. This includes specific 148 + configurations for the board and its peripherals. 149 150 config MACH_MX50_RDP 151 bool "Support MX50 reference design platform"
+2
arch/arm/mach-mx5/Makefile
··· 10 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o 11 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o 12 obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o 13 obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o 14 obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 15 obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
··· 10 obj-$(CONFIG_MACH_MX51_BABBAGE) += board-mx51_babbage.o 11 obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o 12 obj-$(CONFIG_MACH_MX53_EVK) += board-mx53_evk.o 13 + obj-$(CONFIG_MACH_MX53_SMD) += board-mx53_smd.o 14 + obj-$(CONFIG_MACH_MX53_LOCO) += board-mx53_loco.o 15 obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o 16 obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o 17 obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += board-cpuimx51sd.o
+2 -3
arch/arm/mach-mx5/board-mx51_3ds.c
··· 12 13 #include <linux/irq.h> 14 #include <linux/platform_device.h> 15 - #include <linux/input/matrix_keypad.h> 16 #include <linux/spi/spi.h> 17 18 #include <asm/mach-types.h> ··· 119 KEY(3, 5, KEY_BACK) 120 }; 121 122 - static struct matrix_keymap_data mx51_3ds_map_data = { 123 .keymap = mx51_3ds_board_keymap, 124 .keymap_size = ARRAY_SIZE(mx51_3ds_board_keymap), 125 }; 126 127 static void mxc_init_keypad(void) 128 { 129 - mxc_register_device(&mxc_keypad_device, &mx51_3ds_map_data); 130 } 131 #else 132 static inline void mxc_init_keypad(void)
··· 12 13 #include <linux/irq.h> 14 #include <linux/platform_device.h> 15 #include <linux/spi/spi.h> 16 17 #include <asm/mach-types.h> ··· 120 KEY(3, 5, KEY_BACK) 121 }; 122 123 + static const struct matrix_keymap_data mx51_3ds_map_data __initconst = { 124 .keymap = mx51_3ds_board_keymap, 125 .keymap_size = ARRAY_SIZE(mx51_3ds_board_keymap), 126 }; 127 128 static void mxc_init_keypad(void) 129 { 130 + imx51_add_imx_keypad(&mx51_3ds_map_data); 131 } 132 #else 133 static inline void mxc_init_keypad(void)
+74
arch/arm/mach-mx5/board-mx53_evk.c
··· 21 22 #include <linux/init.h> 23 #include <linux/clk.h> 24 #include <mach/common.h> 25 #include <mach/hardware.h> 26 #include <asm/mach-types.h> ··· 33 #include <asm/mach/time.h> 34 #include <mach/imx-uart.h> 35 #include <mach/iomux-mx53.h> 36 37 #include "crm_regs.h" 38 #include "devices-imx53.h" ··· 56 MX53_PAD_ATA_CS_1__UART3_RXD, 57 MX53_PAD_ATA_DA_1__UART3_CTS, 58 MX53_PAD_ATA_DA_2__UART3_RTS, 59 }; 60 61 static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = { ··· 77 imx53_add_imx_uart(2, &mx53_evk_uart_pdata); 78 } 79 80 static void __init mx53_evk_board_init(void) 81 { 82 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, 83 ARRAY_SIZE(mx53_evk_pads)); 84 mx53_evk_init_uart(); 85 } 86 87 static void __init mx53_evk_timer_init(void)
··· 21 22 #include <linux/init.h> 23 #include <linux/clk.h> 24 + #include <linux/fec.h> 25 + #include <linux/delay.h> 26 + #include <linux/gpio.h> 27 + #include <linux/spi/flash.h> 28 + #include <linux/spi/spi.h> 29 #include <mach/common.h> 30 #include <mach/hardware.h> 31 #include <asm/mach-types.h> ··· 28 #include <asm/mach/time.h> 29 #include <mach/imx-uart.h> 30 #include <mach/iomux-mx53.h> 31 + 32 + #define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6) 33 + #define EVK_ECSPI1_CS0 IMX_GPIO_NR(2, 30) 34 + #define EVK_ECSPI1_CS1 IMX_GPIO_NR(3, 19) 35 36 #include "crm_regs.h" 37 #include "devices-imx53.h" ··· 47 MX53_PAD_ATA_CS_1__UART3_RXD, 48 MX53_PAD_ATA_DA_1__UART3_CTS, 49 MX53_PAD_ATA_DA_2__UART3_RTS, 50 + 51 + MX53_PAD_EIM_D16__CSPI1_SCLK, 52 + MX53_PAD_EIM_D17__CSPI1_MISO, 53 + MX53_PAD_EIM_D18__CSPI1_MOSI, 54 + 55 + /* ecspi chip select lines */ 56 + MX53_PAD_EIM_EB2__GPIO_2_30, 57 + MX53_PAD_EIM_D19__GPIO_3_19, 58 }; 59 60 static const struct imxuart_platform_data mx53_evk_uart_pdata __initconst = { ··· 60 imx53_add_imx_uart(2, &mx53_evk_uart_pdata); 61 } 62 63 + static const struct imxi2c_platform_data mx53_evk_i2c_data __initconst = { 64 + .bitrate = 100000, 65 + }; 66 + 67 + static inline void mx53_evk_fec_reset(void) 68 + { 69 + int ret; 70 + 71 + /* reset FEC PHY */ 72 + ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); 73 + if (ret) { 74 + printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); 75 + return; 76 + } 77 + gpio_direction_output(SMD_FEC_PHY_RST, 0); 78 + gpio_set_value(SMD_FEC_PHY_RST, 0); 79 + msleep(1); 80 + gpio_set_value(SMD_FEC_PHY_RST, 1); 81 + } 82 + 83 + static struct fec_platform_data mx53_evk_fec_pdata = { 84 + .phy = PHY_INTERFACE_MODE_RMII, 85 + }; 86 + 87 + static struct spi_board_info mx53_evk_spi_board_info[] __initdata = { 88 + { 89 + .modalias = "mtd_dataflash", 90 + .max_speed_hz = 25000000, 91 + .bus_num = 0, 92 + .chip_select = 1, 93 + .mode = SPI_MODE_0, 94 + .platform_data = NULL, 95 + }, 96 + }; 97 + 98 + static int mx53_evk_spi_cs[] = { 99 + EVK_ECSPI1_CS0, 100 + EVK_ECSPI1_CS1, 101 + }; 102 + 103 + static const struct spi_imx_master mx53_evk_spi_data __initconst = { 104 + .chipselect = mx53_evk_spi_cs, 105 + .num_chipselect = ARRAY_SIZE(mx53_evk_spi_cs), 106 + }; 107 + 108 static void __init mx53_evk_board_init(void) 109 { 110 mxc_iomux_v3_setup_multiple_pads(mx53_evk_pads, 111 ARRAY_SIZE(mx53_evk_pads)); 112 mx53_evk_init_uart(); 113 + mx53_evk_fec_reset(); 114 + imx53_add_fec(&mx53_evk_fec_pdata); 115 + 116 + imx53_add_imx_i2c(0, &mx53_evk_i2c_data); 117 + imx53_add_imx_i2c(1, &mx53_evk_i2c_data); 118 + 119 + imx53_add_sdhci_esdhc_imx(0, NULL); 120 + imx53_add_sdhci_esdhc_imx(1, NULL); 121 + 122 + spi_register_board_info(mx53_evk_spi_board_info, 123 + ARRAY_SIZE(mx53_evk_spi_board_info)); 124 + imx53_add_ecspi(0, &mx53_evk_spi_data); 125 } 126 127 static void __init mx53_evk_timer_init(void)
+111
arch/arm/mach-mx5/board-mx53_loco.c
···
··· 1 + /* 2 + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. 3 + */ 4 + 5 + /* 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + 16 + * You should have received a copy of the GNU General Public License along 17 + * with this program; if not, write to the Free Software Foundation, Inc., 18 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 + */ 20 + 21 + #include <linux/init.h> 22 + #include <linux/clk.h> 23 + #include <linux/fec.h> 24 + #include <linux/delay.h> 25 + #include <linux/gpio.h> 26 + 27 + #include <mach/common.h> 28 + #include <mach/hardware.h> 29 + #include <mach/imx-uart.h> 30 + #include <mach/iomux-mx53.h> 31 + 32 + #include <asm/mach-types.h> 33 + #include <asm/mach/arch.h> 34 + #include <asm/mach/time.h> 35 + 36 + #include "crm_regs.h" 37 + #include "devices-imx53.h" 38 + 39 + #define LOCO_FEC_PHY_RST IMX_GPIO_NR(7, 6) 40 + 41 + static iomux_v3_cfg_t mx53_loco_pads[] = { 42 + MX53_PAD_CSI0_D10__UART1_TXD, 43 + MX53_PAD_CSI0_D11__UART1_RXD, 44 + MX53_PAD_ATA_DIOW__UART1_TXD, 45 + MX53_PAD_ATA_DMACK__UART1_RXD, 46 + 47 + MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 48 + MX53_PAD_ATA_DMARQ__UART2_TXD, 49 + MX53_PAD_ATA_DIOR__UART2_RTS, 50 + MX53_PAD_ATA_INTRQ__UART2_CTS, 51 + 52 + MX53_PAD_ATA_CS_0__UART3_TXD, 53 + MX53_PAD_ATA_CS_1__UART3_RXD, 54 + MX53_PAD_ATA_DA_1__UART3_CTS, 55 + MX53_PAD_ATA_DA_2__UART3_RTS, 56 + }; 57 + 58 + static const struct imxuart_platform_data mx53_loco_uart_data __initconst = { 59 + .flags = IMXUART_HAVE_RTSCTS, 60 + }; 61 + 62 + static inline void mx53_loco_init_uart(void) 63 + { 64 + imx53_add_imx_uart(0, &mx53_loco_uart_data); 65 + imx53_add_imx_uart(1, &mx53_loco_uart_data); 66 + imx53_add_imx_uart(2, &mx53_loco_uart_data); 67 + } 68 + 69 + static inline void mx53_loco_fec_reset(void) 70 + { 71 + int ret; 72 + 73 + /* reset FEC PHY */ 74 + ret = gpio_request(LOCO_FEC_PHY_RST, "fec-phy-reset"); 75 + if (ret) { 76 + printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); 77 + return; 78 + } 79 + gpio_direction_output(LOCO_FEC_PHY_RST, 0); 80 + msleep(1); 81 + gpio_set_value(LOCO_FEC_PHY_RST, 1); 82 + } 83 + 84 + static struct fec_platform_data mx53_loco_fec_data = { 85 + .phy = PHY_INTERFACE_MODE_RMII, 86 + }; 87 + 88 + static void __init mx53_loco_board_init(void) 89 + { 90 + mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads, 91 + ARRAY_SIZE(mx53_loco_pads)); 92 + mx53_loco_init_uart(); 93 + mx53_loco_fec_reset(); 94 + imx53_add_fec(&mx53_loco_fec_data); 95 + } 96 + 97 + static void __init mx53_loco_timer_init(void) 98 + { 99 + mx53_clocks_init(32768, 24000000, 0, 0); 100 + } 101 + 102 + static struct sys_timer mx53_loco_timer = { 103 + .init = mx53_loco_timer_init, 104 + }; 105 + 106 + MACHINE_START(MX53_LOCO, "Freescale MX53 LOCO Board") 107 + .map_io = mx53_map_io, 108 + .init_irq = mx53_init_irq, 109 + .init_machine = mx53_loco_board_init, 110 + .timer = &mx53_loco_timer, 111 + MACHINE_END
+111
arch/arm/mach-mx5/board-mx53_smd.c
···
··· 1 + /* 2 + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. 3 + */ 4 + 5 + /* 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License as published by 8 + * the Free Software Foundation; either version 2 of the License, or 9 + * (at your option) any later version. 10 + 11 + * This program is distributed in the hope that it will be useful, 12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 + * GNU General Public License for more details. 15 + 16 + * You should have received a copy of the GNU General Public License along 17 + * with this program; if not, write to the Free Software Foundation, Inc., 18 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 + */ 20 + 21 + #include <linux/init.h> 22 + #include <linux/clk.h> 23 + #include <linux/fec.h> 24 + #include <linux/delay.h> 25 + #include <linux/gpio.h> 26 + 27 + #include <mach/common.h> 28 + #include <mach/hardware.h> 29 + #include <mach/imx-uart.h> 30 + #include <mach/iomux-mx53.h> 31 + 32 + #include <asm/mach-types.h> 33 + #include <asm/mach/arch.h> 34 + #include <asm/mach/time.h> 35 + 36 + #include "crm_regs.h" 37 + #include "devices-imx53.h" 38 + 39 + #define SMD_FEC_PHY_RST IMX_GPIO_NR(7, 6) 40 + 41 + static iomux_v3_cfg_t mx53_smd_pads[] = { 42 + MX53_PAD_CSI0_D10__UART1_TXD, 43 + MX53_PAD_CSI0_D11__UART1_RXD, 44 + MX53_PAD_ATA_DIOW__UART1_TXD, 45 + MX53_PAD_ATA_DMACK__UART1_RXD, 46 + 47 + MX53_PAD_ATA_BUFFER_EN__UART2_RXD, 48 + MX53_PAD_ATA_DMARQ__UART2_TXD, 49 + MX53_PAD_ATA_DIOR__UART2_RTS, 50 + MX53_PAD_ATA_INTRQ__UART2_CTS, 51 + 52 + MX53_PAD_ATA_CS_0__UART3_TXD, 53 + MX53_PAD_ATA_CS_1__UART3_RXD, 54 + MX53_PAD_ATA_DA_1__UART3_CTS, 55 + MX53_PAD_ATA_DA_2__UART3_RTS, 56 + }; 57 + 58 + static const struct imxuart_platform_data mx53_smd_uart_data __initconst = { 59 + .flags = IMXUART_HAVE_RTSCTS, 60 + }; 61 + 62 + static inline void mx53_smd_init_uart(void) 63 + { 64 + imx53_add_imx_uart(0, &mx53_smd_uart_data); 65 + imx53_add_imx_uart(1, &mx53_smd_uart_data); 66 + imx53_add_imx_uart(2, &mx53_smd_uart_data); 67 + } 68 + 69 + static inline void mx53_smd_fec_reset(void) 70 + { 71 + int ret; 72 + 73 + /* reset FEC PHY */ 74 + ret = gpio_request(SMD_FEC_PHY_RST, "fec-phy-reset"); 75 + if (ret) { 76 + printk(KERN_ERR"failed to get GPIO_FEC_PHY_RESET: %d\n", ret); 77 + return; 78 + } 79 + gpio_direction_output(SMD_FEC_PHY_RST, 0); 80 + msleep(1); 81 + gpio_set_value(SMD_FEC_PHY_RST, 1); 82 + } 83 + 84 + static struct fec_platform_data mx53_smd_fec_data = { 85 + .phy = PHY_INTERFACE_MODE_RMII, 86 + }; 87 + 88 + static void __init mx53_smd_board_init(void) 89 + { 90 + mxc_iomux_v3_setup_multiple_pads(mx53_smd_pads, 91 + ARRAY_SIZE(mx53_smd_pads)); 92 + mx53_smd_init_uart(); 93 + mx53_smd_fec_reset(); 94 + imx53_add_fec(&mx53_smd_fec_data); 95 + } 96 + 97 + static void __init mx53_smd_timer_init(void) 98 + { 99 + mx53_clocks_init(32768, 24000000, 22579200, 0); 100 + } 101 + 102 + static struct sys_timer mx53_smd_timer = { 103 + .init = mx53_smd_timer_init, 104 + }; 105 + 106 + MACHINE_START(MX53_SMD, "Freescale MX53 SMD Board") 107 + .map_io = mx53_map_io, 108 + .init_irq = mx53_init_irq, 109 + .init_machine = mx53_smd_board_init, 110 + .timer = &mx53_smd_timer, 111 + MACHINE_END
+16 -2
arch/arm/mach-mx5/clock-mx51-mx53.c
··· 1191 DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, 1192 NULL, NULL, &ipg_clk, &gpt_ipg_clk); 1193 1194 /* I2C */ 1195 DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, 1196 NULL, NULL, &ipg_clk, NULL); ··· 1288 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1289 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1290 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1291 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1292 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1293 _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) ··· 1302 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk) 1303 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) 1304 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) 1305 - _REGISTER_CLOCK("imx-keypad.0", NULL, kpp_clk) 1306 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) 1307 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1308 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) ··· 1333 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1334 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1335 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) 1336 }; 1337 1338 static void clk_tree_init(void) ··· 1377 1378 clk_tree_init(); 1379 1380 - clk_set_parent(&uart_root_clk, &pll3_sw_clk); 1381 clk_enable(&cpu_clk); 1382 clk_enable(&main_bus_clk); 1383 ··· 1419 1420 clk_tree_init(); 1421 1422 clk_enable(&cpu_clk); 1423 clk_enable(&main_bus_clk); 1424
··· 1191 DEFINE_CLOCK(gpt_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG9_OFFSET, 1192 NULL, NULL, &ipg_clk, &gpt_ipg_clk); 1193 1194 + DEFINE_CLOCK(pwm1_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG6_OFFSET, 1195 + NULL, NULL, &ipg_clk, NULL); 1196 + DEFINE_CLOCK(pwm2_clk, 0, MXC_CCM_CCGR2, MXC_CCM_CCGRx_CG8_OFFSET, 1197 + NULL, NULL, &ipg_clk, NULL); 1198 + 1199 /* I2C */ 1200 DEFINE_CLOCK(i2c1_clk, 0, MXC_CCM_CCGR1, MXC_CCM_CCGRx_CG9_OFFSET, 1201 NULL, NULL, &ipg_clk, NULL); ··· 1283 _REGISTER_CLOCK("imx-uart.2", NULL, uart3_clk) 1284 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1285 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1286 + _REGISTER_CLOCK("mxc_pwm.0", "pwm", pwm1_clk) 1287 + _REGISTER_CLOCK("mxc_pwm.1", "pwm", pwm2_clk) 1288 _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1289 _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1290 _REGISTER_CLOCK("imx-i2c.2", NULL, hsi2c_clk) ··· 1295 _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_ahb_clk) 1296 _REGISTER_CLOCK("fsl-usb2-udc", "usb", usboh3_clk) 1297 _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", ahb_clk) 1298 + _REGISTER_CLOCK("imx-keypad", NULL, kpp_clk) 1299 _REGISTER_CLOCK("mxc_nand", NULL, nfc_clk) 1300 _REGISTER_CLOCK("imx-ssi.0", NULL, ssi1_clk) 1301 _REGISTER_CLOCK("imx-ssi.1", NULL, ssi2_clk) ··· 1326 _REGISTER_CLOCK(NULL, "gpt", gpt_clk) 1327 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 1328 _REGISTER_CLOCK(NULL, "iim_clk", iim_clk) 1329 + _REGISTER_CLOCK("imx-i2c.0", NULL, i2c1_clk) 1330 + _REGISTER_CLOCK("imx-i2c.1", NULL, i2c2_clk) 1331 + _REGISTER_CLOCK("sdhci-esdhc-imx.0", NULL, esdhc1_clk) 1332 + _REGISTER_CLOCK("sdhci-esdhc-imx.1", NULL, esdhc2_clk) 1333 + _REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk) 1334 + _REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk) 1335 + _REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk) 1336 }; 1337 1338 static void clk_tree_init(void) ··· 1363 1364 clk_tree_init(); 1365 1366 clk_enable(&cpu_clk); 1367 clk_enable(&main_bus_clk); 1368 ··· 1406 1407 clk_tree_init(); 1408 1409 + clk_set_parent(&uart_root_clk, &pll3_sw_clk); 1410 clk_enable(&cpu_clk); 1411 clk_enable(&main_bus_clk); 1412
+8
arch/arm/mach-mx5/devices-imx51.h
··· 47 extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst; 48 #define imx51_add_imx2_wdt(id, pdata) \ 49 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id])
··· 47 extern const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst; 48 #define imx51_add_imx2_wdt(id, pdata) \ 49 imx_add_imx2_wdt(&imx51_imx2_wdt_data[id]) 50 + 51 + extern const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst; 52 + #define imx51_add_mxc_pwm(id) \ 53 + imx_add_mxc_pwm(&imx51_mxc_pwm_data[id]) 54 + 55 + extern const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst; 56 + #define imx51_add_imx_keypad(pdata) \ 57 + imx_add_imx_keypad(&imx51_imx_keypad_data, pdata)
+18
arch/arm/mach-mx5/devices-imx53.h
··· 8 #include <mach/mx53.h> 9 #include <mach/devices-common.h> 10 11 extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst; 12 #define imx53_add_imx_uart(id, pdata) \ 13 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata)
··· 8 #include <mach/mx53.h> 9 #include <mach/devices-common.h> 10 11 + extern const struct imx_fec_data imx53_fec_data __initconst; 12 + #define imx53_add_fec(pdata) \ 13 + imx_add_fec(&imx53_fec_data, pdata) 14 + 15 extern const struct imx_imx_uart_1irq_data imx53_imx_uart_data[] __initconst; 16 #define imx53_add_imx_uart(id, pdata) \ 17 imx_add_imx_uart_1irq(&imx53_imx_uart_data[id], pdata) 18 + 19 + 20 + extern const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst; 21 + #define imx53_add_imx_i2c(id, pdata) \ 22 + imx_add_imx_i2c(&imx53_imx_i2c_data[id], pdata) 23 + 24 + extern const struct imx_sdhci_esdhc_imx_data 25 + imx53_sdhci_esdhc_imx_data[] __initconst; 26 + #define imx53_add_sdhci_esdhc_imx(id, pdata) \ 27 + imx_add_sdhci_esdhc_imx(&imx53_sdhci_esdhc_imx_data[id], pdata) 28 + 29 + extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst; 30 + #define imx53_add_ecspi(id, pdata) \ 31 + imx_add_spi_imx(&imx53_ecspi_data[id], pdata)
-19
arch/arm/mach-mx5/devices.c
··· 120 }, 121 }; 122 123 - static struct resource mxc_kpp_resources[] = { 124 - { 125 - .start = MX51_MXC_INT_KPP, 126 - .end = MX51_MXC_INT_KPP, 127 - .flags = IORESOURCE_IRQ, 128 - } , { 129 - .start = MX51_KPP_BASE_ADDR, 130 - .end = MX51_KPP_BASE_ADDR + 0x8 - 1, 131 - .flags = IORESOURCE_MEM, 132 - }, 133 - }; 134 - 135 - struct platform_device mxc_keypad_device = { 136 - .name = "imx-keypad", 137 - .id = 0, 138 - .num_resources = ARRAY_SIZE(mxc_kpp_resources), 139 - .resource = mxc_kpp_resources, 140 - }; 141 - 142 static struct mxc_gpio_port mxc_gpio_ports[] = { 143 { 144 .chip.label = "gpio-0",
··· 120 }, 121 }; 122 123 static struct mxc_gpio_port mxc_gpio_ports[] = { 124 { 125 .chip.label = "gpio-0",
-1
arch/arm/mach-mx5/devices.h
··· 3 extern struct platform_device mxc_usbh2_device; 4 extern struct platform_device mxc_usbdr_udc_device; 5 extern struct platform_device mxc_hsi2c_device; 6 - extern struct platform_device mxc_keypad_device;
··· 3 extern struct platform_device mxc_usbh2_device; 4 extern struct platform_device mxc_usbdr_udc_device; 5 extern struct platform_device mxc_hsi2c_device;
+2 -3
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c
··· 21 #include <linux/fsl_devices.h> 22 #include <linux/i2c/tsc2007.h> 23 #include <linux/leds.h> 24 - #include <linux/input/matrix_keypad.h> 25 26 #include <mach/common.h> 27 #include <mach/hardware.h> ··· 156 KEY(3, 3, KEY_ENTER), 157 }; 158 159 - static struct matrix_keymap_data mbimx51_map_data = { 160 .keymap = mbimx51_keymap, 161 .keymap_size = ARRAY_SIZE(mbimx51_keymap), 162 }; ··· 208 209 platform_add_devices(devices, ARRAY_SIZE(devices)); 210 211 - mxc_register_device(&mxc_keypad_device, &mbimx51_map_data); 212 213 gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); 214 gpio_direction_input(MBIMX51_TSC2007_GPIO);
··· 21 #include <linux/fsl_devices.h> 22 #include <linux/i2c/tsc2007.h> 23 #include <linux/leds.h> 24 25 #include <mach/common.h> 26 #include <mach/hardware.h> ··· 157 KEY(3, 3, KEY_ENTER), 158 }; 159 160 + static const struct matrix_keymap_data mbimx51_map_data __initconst = { 161 .keymap = mbimx51_keymap, 162 .keymap_size = ARRAY_SIZE(mbimx51_keymap), 163 }; ··· 209 210 platform_add_devices(devices, ARRAY_SIZE(devices)); 211 212 + imx51_add_imx_keypad(&mbimx51_map_data); 213 214 gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq"); 215 gpio_direction_input(MBIMX51_TSC2007_GPIO);
+2 -2
arch/arm/mach-mxs/Kconfig
··· 15 config MACH_MX23EVK 16 bool "Support MX23EVK Platform" 17 select SOC_IMX23 18 - select MXS_HAVE_PLATFORM_DUART 19 default y 20 help 21 Include support for MX23EVK platform. This includes specific ··· 24 config MACH_MX28EVK 25 bool "Support MX28EVK Platform" 26 select SOC_IMX28 27 - select MXS_HAVE_PLATFORM_DUART 28 select MXS_HAVE_PLATFORM_FEC 29 default y 30 help
··· 15 config MACH_MX23EVK 16 bool "Support MX23EVK Platform" 17 select SOC_IMX23 18 + select MXS_HAVE_AMBA_DUART 19 default y 20 help 21 Include support for MX23EVK platform. This includes specific ··· 24 config MACH_MX28EVK 25 bool "Support MX28EVK Platform" 26 select SOC_IMX28 27 + select MXS_HAVE_AMBA_DUART 28 select MXS_HAVE_PLATFORM_FEC 29 default y 30 help
+11 -2
arch/arm/mach-mxs/clock-mx23.c
··· 21 #include <linux/clk.h> 22 #include <linux/io.h> 23 #include <linux/jiffies.h> 24 25 #include <asm/clkdev.h> 26 #include <asm/div64.h> ··· 438 }, 439 440 static struct clk_lookup lookups[] = { 441 - _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) 442 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 443 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 444 - _REGISTER_CLOCK(NULL, "xclk", xbus_clk) 445 _REGISTER_CLOCK(NULL, "usb", usb_clk) 446 _REGISTER_CLOCK(NULL, "audio", audio_clk) 447 _REGISTER_CLOCK(NULL, "pwm", pwm_clk) ··· 520 int __init mx23_clocks_init(void) 521 { 522 clk_misc_init(); 523 524 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 525
··· 21 #include <linux/clk.h> 22 #include <linux/io.h> 23 #include <linux/jiffies.h> 24 + #include <linux/clkdev.h> 25 26 #include <asm/clkdev.h> 27 #include <asm/div64.h> ··· 437 }, 438 439 static struct clk_lookup lookups[] = { 440 + /* for amba bus driver */ 441 + _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk) 442 + /* for amba-pl011 driver */ 443 + _REGISTER_CLOCK("duart", NULL, uart_clk) 444 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 445 _REGISTER_CLOCK(NULL, "hclk", hbus_clk) 446 _REGISTER_CLOCK(NULL, "usb", usb_clk) 447 _REGISTER_CLOCK(NULL, "audio", audio_clk) 448 _REGISTER_CLOCK(NULL, "pwm", pwm_clk) ··· 517 int __init mx23_clocks_init(void) 518 { 519 clk_misc_init(); 520 + 521 + clk_enable(&cpu_clk); 522 + clk_enable(&hbus_clk); 523 + clk_enable(&xbus_clk); 524 + clk_enable(&emi_clk); 525 + clk_enable(&uart_clk); 526 527 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 528
+13 -1
arch/arm/mach-mxs/clock-mx28.c
··· 21 #include <linux/clk.h> 22 #include <linux/io.h> 23 #include <linux/jiffies.h> 24 25 #include <asm/clkdev.h> 26 #include <asm/div64.h> ··· 603 }, 604 605 static struct clk_lookup lookups[] = { 606 - _REGISTER_CLOCK("mxs-duart.0", NULL, uart_clk) 607 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 608 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 609 _REGISTER_CLOCK("pll2", NULL, pll2_clk) ··· 731 int __init mx28_clocks_init(void) 732 { 733 clk_misc_init(); 734 735 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 736
··· 21 #include <linux/clk.h> 22 #include <linux/io.h> 23 #include <linux/jiffies.h> 24 + #include <linux/clkdev.h> 25 26 #include <asm/clkdev.h> 27 #include <asm/div64.h> ··· 602 }, 603 604 static struct clk_lookup lookups[] = { 605 + /* for amba bus driver */ 606 + _REGISTER_CLOCK("duart", "apb_pclk", xbus_clk) 607 + /* for amba-pl011 driver */ 608 + _REGISTER_CLOCK("duart", NULL, uart_clk) 609 + _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) 610 + _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) 611 _REGISTER_CLOCK("fec.0", NULL, fec_clk) 612 _REGISTER_CLOCK("rtc", NULL, rtc_clk) 613 _REGISTER_CLOCK("pll2", NULL, pll2_clk) ··· 725 int __init mx28_clocks_init(void) 726 { 727 clk_misc_init(); 728 + 729 + clk_enable(&cpu_clk); 730 + clk_enable(&hbus_clk); 731 + clk_enable(&xbus_clk); 732 + clk_enable(&emi_clk); 733 + clk_enable(&uart_clk); 734 735 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 736
+2 -2
arch/arm/mach-mxs/devices-mx23.h
··· 11 #include <mach/mx23.h> 12 #include <mach/devices-common.h> 13 14 - extern const struct mxs_duart_data mx23_duart_data __initconst; 15 #define mx23_add_duart() \ 16 - mxs_add_duart(&mx23_duart_data)
··· 11 #include <mach/mx23.h> 12 #include <mach/devices-common.h> 13 14 + extern const struct amba_device mx23_duart_device __initconst; 15 #define mx23_add_duart() \ 16 + mxs_add_duart(&mx23_duart_device)
+2 -2
arch/arm/mach-mxs/devices-mx28.h
··· 11 #include <mach/mx28.h> 12 #include <mach/devices-common.h> 13 14 - extern const struct mxs_duart_data mx28_duart_data __initconst; 15 #define mx28_add_duart() \ 16 - mxs_add_duart(&mx28_duart_data) 17 18 extern const struct mxs_fec_data mx28_fec_data[] __initconst; 19 #define mx28_add_fec(id, pdata) \
··· 11 #include <mach/mx28.h> 12 #include <mach/devices-common.h> 13 14 + extern const struct amba_device mx28_duart_device __initconst; 15 #define mx28_add_duart() \ 16 + mxs_add_duart(&mx28_duart_device) 17 18 extern const struct mxs_fec_data mx28_fec_data[] __initconst; 19 #define mx28_add_fec(id, pdata) \
+15 -2
arch/arm/mach-mxs/devices.c
··· 19 #include <linux/kernel.h> 20 #include <linux/slab.h> 21 #include <linux/init.h> 22 - #include <linux/err.h> 23 #include <linux/platform_device.h> 24 - #include <mach/common.h> 25 26 struct platform_device *__init mxs_add_platform_device_dmamask( 27 const char *name, int id, ··· 71 } 72 73 return pdev; 74 }
··· 19 #include <linux/kernel.h> 20 #include <linux/slab.h> 21 #include <linux/init.h> 22 #include <linux/platform_device.h> 23 + #include <linux/amba/bus.h> 24 25 struct platform_device *__init mxs_add_platform_device_dmamask( 26 const char *name, int id, ··· 72 } 73 74 return pdev; 75 + } 76 + 77 + int __init mxs_add_amba_device(const struct amba_device *dev) 78 + { 79 + struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL); 80 + 81 + if (!adev) { 82 + pr_err("%s: failed to allocate memory", __func__); 83 + return -ENOMEM; 84 + } 85 + 86 + *adev = *dev; 87 + 88 + return amba_device_register(adev, &iomem_resource); 89 }
+2 -1
arch/arm/mach-mxs/devices/Kconfig
··· 1 - config MXS_HAVE_PLATFORM_DUART 2 bool 3 4 config MXS_HAVE_PLATFORM_FEC 5 bool
··· 1 + config MXS_HAVE_AMBA_DUART 2 bool 3 + select ARM_AMBA 4 5 config MXS_HAVE_PLATFORM_FEC 6 bool
+1 -1
arch/arm/mach-mxs/devices/Makefile
··· 1 - obj-$(CONFIG_MXS_HAVE_PLATFORM_DUART) += platform-duart.o 2 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
··· 1 + obj-$(CONFIG_MXS_HAVE_AMBA_DUART) += amba-duart.o 2 obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o
+40
arch/arm/mach-mxs/devices/amba-duart.c
···
··· 1 + /* 2 + * Copyright (C) 2009-2010 Pengutronix 3 + * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 + * 5 + * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. 6 + * 7 + * This program is free software; you can redistribute it and/or modify it under 8 + * the terms of the GNU General Public License version 2 as published by the 9 + * Free Software Foundation. 10 + */ 11 + #include <asm/irq.h> 12 + #include <mach/mx23.h> 13 + #include <mach/mx28.h> 14 + #include <mach/devices-common.h> 15 + 16 + #define MXS_AMBA_DUART_DEVICE(name, soc) \ 17 + const struct amba_device name##_device __initconst = { \ 18 + .dev = { \ 19 + .init_name = "duart", \ 20 + }, \ 21 + .res = { \ 22 + .start = soc ## _DUART_BASE_ADDR, \ 23 + .end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1, \ 24 + .flags = IORESOURCE_MEM, \ 25 + }, \ 26 + .irq = {soc ## _INT_DUART, NO_IRQ}, \ 27 + } 28 + 29 + #ifdef CONFIG_SOC_IMX23 30 + MXS_AMBA_DUART_DEVICE(mx23_duart, MX23); 31 + #endif 32 + 33 + #ifdef CONFIG_SOC_IMX28 34 + MXS_AMBA_DUART_DEVICE(mx28_duart, MX28); 35 + #endif 36 + 37 + int __init mxs_add_duart(const struct amba_device *dev) 38 + { 39 + return mxs_add_amba_device(dev); 40 + }
-48
arch/arm/mach-mxs/devices/platform-duart.c
··· 1 - /* 2 - * Copyright (C) 2009-2010 Pengutronix 3 - * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> 4 - * 5 - * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. 6 - * 7 - * This program is free software; you can redistribute it and/or modify it under 8 - * the terms of the GNU General Public License version 2 as published by the 9 - * Free Software Foundation. 10 - */ 11 - #include <mach/mx23.h> 12 - #include <mach/mx28.h> 13 - #include <mach/devices-common.h> 14 - 15 - #define mxs_duart_data_entry(soc) \ 16 - { \ 17 - .iobase = soc ## _DUART_BASE_ADDR, \ 18 - .irq = soc ## _INT_DUART, \ 19 - } 20 - 21 - #ifdef CONFIG_SOC_IMX23 22 - const struct mxs_duart_data mx23_duart_data __initconst = 23 - mxs_duart_data_entry(MX23); 24 - #endif 25 - 26 - #ifdef CONFIG_SOC_IMX28 27 - const struct mxs_duart_data mx28_duart_data __initconst = 28 - mxs_duart_data_entry(MX28); 29 - #endif 30 - 31 - struct platform_device *__init mxs_add_duart( 32 - const struct mxs_duart_data *data) 33 - { 34 - struct resource res[] = { 35 - { 36 - .start = data->iobase, 37 - .end = data->iobase + SZ_8K - 1, 38 - .flags = IORESOURCE_MEM, 39 - }, { 40 - .start = data->irq, 41 - .end = data->irq, 42 - .flags = IORESOURCE_IRQ, 43 - }, 44 - }; 45 - 46 - return mxs_add_platform_device("mxs-duart", 0, res, ARRAY_SIZE(res), 47 - NULL, 0); 48 - }
···
+1 -1
arch/arm/mach-mxs/devices/platform-fec.c
··· 45 }, 46 }; 47 48 - return mxs_add_platform_device("fec", data->id, 49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 50 }
··· 45 }, 46 }; 47 48 + return mxs_add_platform_device("imx28-fec", data->id, 49 res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); 50 }
+4 -7
arch/arm/mach-mxs/include/mach/devices-common.h
··· 9 #include <linux/kernel.h> 10 #include <linux/platform_device.h> 11 #include <linux/init.h> 12 13 struct platform_device *mxs_add_platform_device_dmamask( 14 const char *name, int id, ··· 25 name, id, res, num_resources, data, size_data, 0); 26 } 27 28 /* duart */ 29 - struct mxs_duart_data { 30 - resource_size_t iobase; 31 - resource_size_t iosize; 32 - resource_size_t irq; 33 - }; 34 - struct platform_device *__init mxs_add_duart( 35 - const struct mxs_duart_data *data); 36 37 /* fec */ 38 #include <linux/fec.h>
··· 9 #include <linux/kernel.h> 10 #include <linux/platform_device.h> 11 #include <linux/init.h> 12 + #include <linux/amba/bus.h> 13 14 struct platform_device *mxs_add_platform_device_dmamask( 15 const char *name, int id, ··· 24 name, id, res, num_resources, data, size_data, 0); 25 } 26 27 + int __init mxs_add_amba_device(const struct amba_device *dev); 28 + 29 /* duart */ 30 + int __init mxs_add_duart(const struct amba_device *dev); 31 32 /* fec */ 33 #include <linux/fec.h>
+23 -3
arch/arm/mach-mxs/mach-mx28evk.c
··· 57 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 58 MX28_PAD_ENET_CLK__CLKCTRL_ENET | 59 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 60 /* phy power line */ 61 MX28_PAD_SSP1_DATA3__GPIO_2_15 | 62 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), ··· 119 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); 120 } 121 122 - static const struct fec_platform_data mx28_fec_pdata __initconst = { 123 - .phy = PHY_INTERFACE_MODE_RMII, 124 }; 125 126 static void __init mx28evk_init(void) ··· 136 mx28_add_duart(); 137 138 mx28evk_fec_reset(); 139 - mx28_add_fec(0, &mx28_fec_pdata); 140 } 141 142 static void __init mx28evk_timer_init(void)
··· 57 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 58 MX28_PAD_ENET_CLK__CLKCTRL_ENET | 59 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 60 + /* fec1 */ 61 + MX28_PAD_ENET0_CRS__ENET1_RX_EN | 62 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 63 + MX28_PAD_ENET0_RXD2__ENET1_RXD0 | 64 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 65 + MX28_PAD_ENET0_RXD3__ENET1_RXD1 | 66 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 67 + MX28_PAD_ENET0_COL__ENET1_TX_EN | 68 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 69 + MX28_PAD_ENET0_TXD2__ENET1_TXD0 | 70 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 71 + MX28_PAD_ENET0_TXD3__ENET1_TXD1 | 72 + (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP), 73 /* phy power line */ 74 MX28_PAD_SSP1_DATA3__GPIO_2_15 | 75 (MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL), ··· 106 gpio_set_value(MX28EVK_FEC_PHY_RESET, 1); 107 } 108 109 + static struct fec_platform_data mx28_fec_pdata[] = { 110 + { 111 + /* fec0 */ 112 + .phy = PHY_INTERFACE_MODE_RMII, 113 + }, { 114 + /* fec1 */ 115 + .phy = PHY_INTERFACE_MODE_RMII, 116 + }, 117 }; 118 119 static void __init mx28evk_init(void) ··· 117 mx28_add_duart(); 118 119 mx28evk_fec_reset(); 120 + mx28_add_fec(0, &mx28_fec_pdata[0]); 121 + mx28_add_fec(1, &mx28_fec_pdata[1]); 122 } 123 124 static void __init mx28evk_timer_init(void)
+15 -15
arch/arm/mach-netx/generic.c
··· 88 } 89 90 static int 91 - netx_hif_irq_type(unsigned int _irq, unsigned int type) 92 { 93 unsigned int val, irq; 94 95 val = readl(NETX_DPMAS_IF_CONF1); 96 97 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 98 99 if (type & IRQ_TYPE_EDGE_RISING) { 100 DEBUG_IRQ("rising edges\n"); ··· 119 } 120 121 static void 122 - netx_hif_ack_irq(unsigned int _irq) 123 { 124 unsigned int val, irq; 125 126 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 127 writel((1 << 24) << irq, NETX_DPMAS_INT_STAT); 128 129 val = readl(NETX_DPMAS_INT_EN); 130 val &= ~((1 << 24) << irq); 131 writel(val, NETX_DPMAS_INT_EN); 132 133 - DEBUG_IRQ("%s: irq %d\n", __func__, _irq); 134 } 135 136 static void 137 - netx_hif_mask_irq(unsigned int _irq) 138 { 139 unsigned int val, irq; 140 141 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 142 val = readl(NETX_DPMAS_INT_EN); 143 val &= ~((1 << 24) << irq); 144 writel(val, NETX_DPMAS_INT_EN); 145 - DEBUG_IRQ("%s: irq %d\n", __func__, _irq); 146 } 147 148 static void 149 - netx_hif_unmask_irq(unsigned int _irq) 150 { 151 unsigned int val, irq; 152 153 - irq = _irq - NETX_IRQ_HIF_CHAINED(0); 154 val = readl(NETX_DPMAS_INT_EN); 155 val |= (1 << 24) << irq; 156 writel(val, NETX_DPMAS_INT_EN); 157 - DEBUG_IRQ("%s: irq %d\n", __func__, _irq); 158 } 159 160 static struct irq_chip netx_hif_chip = { 161 - .ack = netx_hif_ack_irq, 162 - .mask = netx_hif_mask_irq, 163 - .unmask = netx_hif_unmask_irq, 164 - .set_type = netx_hif_irq_type, 165 }; 166 167 void __init netx_init_irq(void)
··· 88 } 89 90 static int 91 + netx_hif_irq_type(struct irq_data *d, unsigned int type) 92 { 93 unsigned int val, irq; 94 95 val = readl(NETX_DPMAS_IF_CONF1); 96 97 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 98 99 if (type & IRQ_TYPE_EDGE_RISING) { 100 DEBUG_IRQ("rising edges\n"); ··· 119 } 120 121 static void 122 + netx_hif_ack_irq(struct irq_data *d) 123 { 124 unsigned int val, irq; 125 126 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 127 writel((1 << 24) << irq, NETX_DPMAS_INT_STAT); 128 129 val = readl(NETX_DPMAS_INT_EN); 130 val &= ~((1 << 24) << irq); 131 writel(val, NETX_DPMAS_INT_EN); 132 133 + DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); 134 } 135 136 static void 137 + netx_hif_mask_irq(struct irq_data *d) 138 { 139 unsigned int val, irq; 140 141 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 142 val = readl(NETX_DPMAS_INT_EN); 143 val &= ~((1 << 24) << irq); 144 writel(val, NETX_DPMAS_INT_EN); 145 + DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); 146 } 147 148 static void 149 + netx_hif_unmask_irq(struct irq_data *d) 150 { 151 unsigned int val, irq; 152 153 + irq = d->irq - NETX_IRQ_HIF_CHAINED(0); 154 val = readl(NETX_DPMAS_INT_EN); 155 val |= (1 << 24) << irq; 156 writel(val, NETX_DPMAS_INT_EN); 157 + DEBUG_IRQ("%s: irq %d\n", __func__, d->irq); 158 } 159 160 static struct irq_chip netx_hif_chip = { 161 + .irq_ack = netx_hif_ack_irq, 162 + .irq_mask = netx_hif_mask_irq, 163 + .irq_unmask = netx_hif_unmask_irq, 164 + .irq_set_type = netx_hif_irq_type, 165 }; 166 167 void __init netx_init_irq(void)
+14 -14
arch/arm/mach-ns9xxx/board-a9m9750dev.c
··· 37 ARRAY_SIZE(board_a9m9750dev_io_desc)); 38 } 39 40 - static void a9m9750dev_fpga_ack_irq(unsigned int irq) 41 { 42 /* nothing */ 43 } 44 45 - static void a9m9750dev_fpga_mask_irq(unsigned int irq) 46 { 47 u8 ier; 48 49 ier = __raw_readb(FPGA_IER); 50 51 - ier &= ~(1 << (irq - FPGA_IRQ(0))); 52 53 __raw_writeb(ier, FPGA_IER); 54 } 55 56 - static void a9m9750dev_fpga_maskack_irq(unsigned int irq) 57 { 58 - a9m9750dev_fpga_mask_irq(irq); 59 - a9m9750dev_fpga_ack_irq(irq); 60 } 61 62 - static void a9m9750dev_fpga_unmask_irq(unsigned int irq) 63 { 64 u8 ier; 65 66 ier = __raw_readb(FPGA_IER); 67 68 - ier |= 1 << (irq - FPGA_IRQ(0)); 69 70 __raw_writeb(ier, FPGA_IER); 71 } 72 73 static struct irq_chip a9m9750dev_fpga_chip = { 74 - .ack = a9m9750dev_fpga_ack_irq, 75 - .mask = a9m9750dev_fpga_mask_irq, 76 - .mask_ack = a9m9750dev_fpga_maskack_irq, 77 - .unmask = a9m9750dev_fpga_unmask_irq, 78 }; 79 80 static void a9m9750dev_fpga_demux_handler(unsigned int irq, ··· 82 { 83 u8 stat = __raw_readb(FPGA_ISR); 84 85 - desc->chip->mask_ack(irq); 86 87 while (stat != 0) { 88 int irqno = fls(stat) - 1; ··· 92 generic_handle_irq(FPGA_IRQ(irqno)); 93 } 94 95 - desc->chip->unmask(irq); 96 } 97 98 void __init board_a9m9750dev_init_irq(void)
··· 37 ARRAY_SIZE(board_a9m9750dev_io_desc)); 38 } 39 40 + static void a9m9750dev_fpga_ack_irq(struct irq_data *d) 41 { 42 /* nothing */ 43 } 44 45 + static void a9m9750dev_fpga_mask_irq(struct irq_data *d) 46 { 47 u8 ier; 48 49 ier = __raw_readb(FPGA_IER); 50 51 + ier &= ~(1 << (d->irq - FPGA_IRQ(0))); 52 53 __raw_writeb(ier, FPGA_IER); 54 } 55 56 + static void a9m9750dev_fpga_maskack_irq(struct irq_data *d) 57 { 58 + a9m9750dev_fpga_mask_irq(d); 59 + a9m9750dev_fpga_ack_irq(d); 60 } 61 62 + static void a9m9750dev_fpga_unmask_irq(struct irq_data *d) 63 { 64 u8 ier; 65 66 ier = __raw_readb(FPGA_IER); 67 68 + ier |= 1 << (d->irq - FPGA_IRQ(0)); 69 70 __raw_writeb(ier, FPGA_IER); 71 } 72 73 static struct irq_chip a9m9750dev_fpga_chip = { 74 + .irq_ack = a9m9750dev_fpga_ack_irq, 75 + .irq_mask = a9m9750dev_fpga_mask_irq, 76 + .irq_mask_ack = a9m9750dev_fpga_maskack_irq, 77 + .irq_unmask = a9m9750dev_fpga_unmask_irq, 78 }; 79 80 static void a9m9750dev_fpga_demux_handler(unsigned int irq, ··· 82 { 83 u8 stat = __raw_readb(FPGA_ISR); 84 85 + desc->irq_data.chip->irq_mask_ack(&desc->irq_data); 86 87 while (stat != 0) { 88 int irqno = fls(stat) - 1; ··· 92 generic_handle_irq(FPGA_IRQ(irqno)); 93 } 94 95 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 96 } 97 98 void __init board_a9m9750dev_init_irq(void)
+14 -14
arch/arm/mach-ns9xxx/irq.c
··· 22 #define irq2prio(i) (i) 23 #define prio2irq(p) (p) 24 25 - static void ns9xxx_mask_irq(unsigned int irq) 26 { 27 /* XXX: better use cpp symbols */ 28 - int prio = irq2prio(irq); 29 u32 ic = __raw_readl(SYS_IC(prio / 4)); 30 ic &= ~(1 << (7 + 8 * (3 - (prio & 3)))); 31 __raw_writel(ic, SYS_IC(prio / 4)); 32 } 33 34 - static void ns9xxx_ack_irq(unsigned int irq) 35 { 36 __raw_writel(0, SYS_ISRADDR); 37 } 38 39 - static void ns9xxx_maskack_irq(unsigned int irq) 40 { 41 - ns9xxx_mask_irq(irq); 42 - ns9xxx_ack_irq(irq); 43 } 44 45 - static void ns9xxx_unmask_irq(unsigned int irq) 46 { 47 /* XXX: better use cpp symbols */ 48 - int prio = irq2prio(irq); 49 u32 ic = __raw_readl(SYS_IC(prio / 4)); 50 ic |= 1 << (7 + 8 * (3 - (prio & 3))); 51 __raw_writel(ic, SYS_IC(prio / 4)); 52 } 53 54 static struct irq_chip ns9xxx_chip = { 55 - .ack = ns9xxx_ack_irq, 56 - .mask = ns9xxx_mask_irq, 57 - .mask_ack = ns9xxx_maskack_irq, 58 - .unmask = ns9xxx_unmask_irq, 59 }; 60 61 #if 0 ··· 92 93 if (desc->status & IRQ_DISABLED) 94 out_mask: 95 - desc->chip->mask(irq); 96 97 /* ack unconditionally to unmask lower prio irqs */ 98 - desc->chip->ack(irq); 99 100 raw_spin_unlock(&desc->lock); 101 }
··· 22 #define irq2prio(i) (i) 23 #define prio2irq(p) (p) 24 25 + static void ns9xxx_mask_irq(struct irq_data *d) 26 { 27 /* XXX: better use cpp symbols */ 28 + int prio = irq2prio(d->irq); 29 u32 ic = __raw_readl(SYS_IC(prio / 4)); 30 ic &= ~(1 << (7 + 8 * (3 - (prio & 3)))); 31 __raw_writel(ic, SYS_IC(prio / 4)); 32 } 33 34 + static void ns9xxx_ack_irq(struct irq_data *d) 35 { 36 __raw_writel(0, SYS_ISRADDR); 37 } 38 39 + static void ns9xxx_maskack_irq(struct irq_data *d) 40 { 41 + ns9xxx_mask_irq(d); 42 + ns9xxx_ack_irq(d); 43 } 44 45 + static void ns9xxx_unmask_irq(struct irq_data *d) 46 { 47 /* XXX: better use cpp symbols */ 48 + int prio = irq2prio(d->irq); 49 u32 ic = __raw_readl(SYS_IC(prio / 4)); 50 ic |= 1 << (7 + 8 * (3 - (prio & 3))); 51 __raw_writel(ic, SYS_IC(prio / 4)); 52 } 53 54 static struct irq_chip ns9xxx_chip = { 55 + .irq_ack = ns9xxx_ack_irq, 56 + .irq_mask = ns9xxx_mask_irq, 57 + .irq_mask_ack = ns9xxx_maskack_irq, 58 + .irq_unmask = ns9xxx_unmask_irq, 59 }; 60 61 #if 0 ··· 92 93 if (desc->status & IRQ_DISABLED) 94 out_mask: 95 + desc->irq_data.chip->irq_mask(&desc->irq_data); 96 97 /* ack unconditionally to unmask lower prio irqs */ 98 + desc->irq_data.chip->irq_ack(&desc->irq_data); 99 100 raw_spin_unlock(&desc->lock); 101 }
+8 -8
arch/arm/mach-nuc93x/irq.c
··· 25 #include <mach/hardware.h> 26 #include <mach/regs-irq.h> 27 28 - static void nuc93x_irq_mask(unsigned int irq) 29 { 30 - __raw_writel(1 << irq, REG_AIC_MDCR); 31 } 32 33 /* ··· 35 * to REG_AIC_EOSCR for ACK 36 */ 37 38 - static void nuc93x_irq_ack(unsigned int irq) 39 { 40 __raw_writel(0x01, REG_AIC_EOSCR); 41 } 42 43 - static void nuc93x_irq_unmask(unsigned int irq) 44 { 45 - __raw_writel(1 << irq, REG_AIC_MECR); 46 47 } 48 49 static struct irq_chip nuc93x_irq_chip = { 50 - .ack = nuc93x_irq_ack, 51 - .mask = nuc93x_irq_mask, 52 - .unmask = nuc93x_irq_unmask, 53 }; 54 55 void __init nuc93x_init_irq(void)
··· 25 #include <mach/hardware.h> 26 #include <mach/regs-irq.h> 27 28 + static void nuc93x_irq_mask(struct irq_data *d) 29 { 30 + __raw_writel(1 << d->irq, REG_AIC_MDCR); 31 } 32 33 /* ··· 35 * to REG_AIC_EOSCR for ACK 36 */ 37 38 + static void nuc93x_irq_ack(struct irq_data *d) 39 { 40 __raw_writel(0x01, REG_AIC_EOSCR); 41 } 42 43 + static void nuc93x_irq_unmask(struct irq_data *d) 44 { 45 + __raw_writel(1 << d->irq, REG_AIC_MECR); 46 47 } 48 49 static struct irq_chip nuc93x_irq_chip = { 50 + .irq_ack = nuc93x_irq_ack, 51 + .irq_mask = nuc93x_irq_mask, 52 + .irq_unmask = nuc93x_irq_unmask, 53 }; 54 55 void __init nuc93x_init_irq(void)
+5 -3
arch/arm/mach-omap1/ams-delta-fiq.c
··· 49 50 irq_desc = irq_to_desc(IH_GPIO_BASE); 51 if (irq_desc) 52 - irq_chip = irq_desc->chip; 53 54 /* 55 * For each handled GPIO interrupt, keep calling its interrupt handler ··· 62 63 while (irq_counter[gpio] < fiq_count) { 64 if (gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) { 65 /* 66 * It looks like handle_edge_irq() that 67 * OMAP GPIO edge interrupts default to, 68 * expects interrupt already unmasked. 69 */ 70 - if (irq_chip && irq_chip->unmask) 71 - irq_chip->unmask(irq_num); 72 } 73 generic_handle_irq(irq_num); 74
··· 49 50 irq_desc = irq_to_desc(IH_GPIO_BASE); 51 if (irq_desc) 52 + irq_chip = irq_desc->irq_data.chip; 53 54 /* 55 * For each handled GPIO interrupt, keep calling its interrupt handler ··· 62 63 while (irq_counter[gpio] < fiq_count) { 64 if (gpio != AMS_DELTA_GPIO_PIN_KEYBRD_CLK) { 65 + struct irq_data *d = irq_get_irq_data(irq_num); 66 + 67 /* 68 * It looks like handle_edge_irq() that 69 * OMAP GPIO edge interrupts default to, 70 * expects interrupt already unmasked. 71 */ 72 + if (irq_chip && irq_chip->irq_unmask) 73 + irq_chip->irq_unmask(d); 74 } 75 generic_handle_irq(irq_num); 76
+14 -14
arch/arm/mach-omap1/fpga.c
··· 30 #include <plat/fpga.h> 31 #include <mach/gpio.h> 32 33 - static void fpga_mask_irq(unsigned int irq) 34 { 35 - irq -= OMAP_FPGA_IRQ_BASE; 36 37 if (irq < 8) 38 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) ··· 58 } 59 60 61 - static void fpga_ack_irq(unsigned int irq) 62 { 63 /* Don't need to explicitly ACK FPGA interrupts */ 64 } 65 66 - static void fpga_unmask_irq(unsigned int irq) 67 { 68 - irq -= OMAP_FPGA_IRQ_BASE; 69 70 if (irq < 8) 71 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)), ··· 78 | (1 << (irq - 16))), INNOVATOR_FPGA_IMR2); 79 } 80 81 - static void fpga_mask_ack_irq(unsigned int irq) 82 { 83 - fpga_mask_irq(irq); 84 - fpga_ack_irq(irq); 85 } 86 87 void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc) ··· 105 106 static struct irq_chip omap_fpga_irq_ack = { 107 .name = "FPGA-ack", 108 - .ack = fpga_mask_ack_irq, 109 - .mask = fpga_mask_irq, 110 - .unmask = fpga_unmask_irq, 111 }; 112 113 114 static struct irq_chip omap_fpga_irq = { 115 .name = "FPGA", 116 - .ack = fpga_ack_irq, 117 - .mask = fpga_mask_irq, 118 - .unmask = fpga_unmask_irq, 119 }; 120 121 /*
··· 30 #include <plat/fpga.h> 31 #include <mach/gpio.h> 32 33 + static void fpga_mask_irq(struct irq_data *d) 34 { 35 + unsigned int irq = d->irq - OMAP_FPGA_IRQ_BASE; 36 37 if (irq < 8) 38 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) ··· 58 } 59 60 61 + static void fpga_ack_irq(struct irq_data *d) 62 { 63 /* Don't need to explicitly ACK FPGA interrupts */ 64 } 65 66 + static void fpga_unmask_irq(struct irq_data *d) 67 { 68 + unsigned int irq = d->irq - OMAP_FPGA_IRQ_BASE; 69 70 if (irq < 8) 71 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)), ··· 78 | (1 << (irq - 16))), INNOVATOR_FPGA_IMR2); 79 } 80 81 + static void fpga_mask_ack_irq(struct irq_data *d) 82 { 83 + fpga_mask_irq(d); 84 + fpga_ack_irq(d); 85 } 86 87 void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc) ··· 105 106 static struct irq_chip omap_fpga_irq_ack = { 107 .name = "FPGA-ack", 108 + .irq_ack = fpga_mask_ack_irq, 109 + .irq_mask = fpga_mask_irq, 110 + .irq_unmask = fpga_unmask_irq, 111 }; 112 113 114 static struct irq_chip omap_fpga_irq = { 115 .name = "FPGA", 116 + .irq_ack = fpga_ack_irq, 117 + .irq_mask = fpga_mask_irq, 118 + .irq_unmask = fpga_unmask_irq, 119 }; 120 121 /*
+22 -22
arch/arm/mach-omap1/irq.c
··· 70 omap_writel(value, irq_banks[bank].base_reg + offset); 71 } 72 73 - static void omap_ack_irq(unsigned int irq) 74 { 75 - if (irq > 31) 76 omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET); 77 78 omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET); 79 } 80 81 - static void omap_mask_irq(unsigned int irq) 82 { 83 - int bank = IRQ_BANK(irq); 84 u32 l; 85 86 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 87 - l |= 1 << IRQ_BIT(irq); 88 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 89 } 90 91 - static void omap_unmask_irq(unsigned int irq) 92 { 93 - int bank = IRQ_BANK(irq); 94 u32 l; 95 96 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 97 - l &= ~(1 << IRQ_BIT(irq)); 98 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 99 } 100 101 - static void omap_mask_ack_irq(unsigned int irq) 102 { 103 - omap_mask_irq(irq); 104 - omap_ack_irq(irq); 105 } 106 107 - static int omap_wake_irq(unsigned int irq, unsigned int enable) 108 { 109 - int bank = IRQ_BANK(irq); 110 111 if (enable) 112 - irq_banks[bank].wake_enable |= IRQ_BIT(irq); 113 else 114 - irq_banks[bank].wake_enable &= ~IRQ_BIT(irq); 115 116 return 0; 117 } ··· 168 169 static struct irq_chip omap_irq_chip = { 170 .name = "MPU", 171 - .ack = omap_mask_ack_irq, 172 - .mask = omap_mask_irq, 173 - .unmask = omap_unmask_irq, 174 - .set_wake = omap_wake_irq, 175 }; 176 177 void __init omap_init_irq(void) ··· 239 /* Unmask level 2 handler */ 240 241 if (cpu_is_omap7xx()) 242 - omap_unmask_irq(INT_7XX_IH2_IRQ); 243 else if (cpu_is_omap15xx()) 244 - omap_unmask_irq(INT_1510_IH2_IRQ); 245 else if (cpu_is_omap16xx()) 246 - omap_unmask_irq(INT_1610_IH2_IRQ); 247 }
··· 70 omap_writel(value, irq_banks[bank].base_reg + offset); 71 } 72 73 + static void omap_ack_irq(struct irq_data *d) 74 { 75 + if (d->irq > 31) 76 omap_writel(0x1, OMAP_IH2_BASE + IRQ_CONTROL_REG_OFFSET); 77 78 omap_writel(0x1, OMAP_IH1_BASE + IRQ_CONTROL_REG_OFFSET); 79 } 80 81 + static void omap_mask_irq(struct irq_data *d) 82 { 83 + int bank = IRQ_BANK(d->irq); 84 u32 l; 85 86 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 87 + l |= 1 << IRQ_BIT(d->irq); 88 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 89 } 90 91 + static void omap_unmask_irq(struct irq_data *d) 92 { 93 + int bank = IRQ_BANK(d->irq); 94 u32 l; 95 96 l = omap_readl(irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 97 + l &= ~(1 << IRQ_BIT(d->irq)); 98 omap_writel(l, irq_banks[bank].base_reg + IRQ_MIR_REG_OFFSET); 99 } 100 101 + static void omap_mask_ack_irq(struct irq_data *d) 102 { 103 + omap_mask_irq(d); 104 + omap_ack_irq(d); 105 } 106 107 + static int omap_wake_irq(struct irq_data *d, unsigned int enable) 108 { 109 + int bank = IRQ_BANK(d->irq); 110 111 if (enable) 112 + irq_banks[bank].wake_enable |= IRQ_BIT(d->irq); 113 else 114 + irq_banks[bank].wake_enable &= ~IRQ_BIT(d->irq); 115 116 return 0; 117 } ··· 168 169 static struct irq_chip omap_irq_chip = { 170 .name = "MPU", 171 + .irq_ack = omap_mask_ack_irq, 172 + .irq_mask = omap_mask_irq, 173 + .irq_unmask = omap_unmask_irq, 174 + .irq_set_wake = omap_wake_irq, 175 }; 176 177 void __init omap_init_irq(void) ··· 239 /* Unmask level 2 handler */ 240 241 if (cpu_is_omap7xx()) 242 + omap_unmask_irq(irq_get_irq_data(INT_7XX_IH2_IRQ)); 243 else if (cpu_is_omap15xx()) 244 + omap_unmask_irq(irq_get_irq_data(INT_1510_IH2_IRQ)); 245 else if (cpu_is_omap16xx()) 246 + omap_unmask_irq(irq_get_irq_data(INT_1610_IH2_IRQ)); 247 }
+12 -10
arch/arm/mach-omap2/irq.c
··· 100 } 101 102 /* XXX: FIQ and additional INTC support (only MPU at the moment) */ 103 - static void omap_ack_irq(unsigned int irq) 104 { 105 intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL); 106 } 107 108 - static void omap_mask_irq(unsigned int irq) 109 { 110 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 111 112 if (cpu_is_omap34xx()) { ··· 129 intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset); 130 } 131 132 - static void omap_unmask_irq(unsigned int irq) 133 { 134 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 135 136 irq &= (IRQ_BITS_PER_REG - 1); ··· 139 intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset); 140 } 141 142 - static void omap_mask_ack_irq(unsigned int irq) 143 { 144 - omap_mask_irq(irq); 145 - omap_ack_irq(irq); 146 } 147 148 static struct irq_chip omap_irq_chip = { 149 - .name = "INTC", 150 - .ack = omap_mask_ack_irq, 151 - .mask = omap_mask_irq, 152 - .unmask = omap_unmask_irq, 153 }; 154 155 static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
··· 100 } 101 102 /* XXX: FIQ and additional INTC support (only MPU at the moment) */ 103 + static void omap_ack_irq(struct irq_data *d) 104 { 105 intc_bank_write_reg(0x1, &irq_banks[0], INTC_CONTROL); 106 } 107 108 + static void omap_mask_irq(struct irq_data *d) 109 { 110 + unsigned int irq = d->irq; 111 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 112 113 if (cpu_is_omap34xx()) { ··· 128 intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_SET0 + offset); 129 } 130 131 + static void omap_unmask_irq(struct irq_data *d) 132 { 133 + unsigned int irq = d->irq; 134 int offset = irq & (~(IRQ_BITS_PER_REG - 1)); 135 136 irq &= (IRQ_BITS_PER_REG - 1); ··· 137 intc_bank_write_reg(1 << irq, &irq_banks[0], INTC_MIR_CLEAR0 + offset); 138 } 139 140 + static void omap_mask_ack_irq(struct irq_data *d) 141 { 142 + omap_mask_irq(d); 143 + omap_ack_irq(d); 144 } 145 146 static struct irq_chip omap_irq_chip = { 147 + .name = "INTC", 148 + .irq_ack = omap_mask_ack_irq, 149 + .irq_mask = omap_mask_irq, 150 + .irq_unmask = omap_unmask_irq, 151 }; 152 153 static void __init omap_irq_bank_init_one(struct omap_irq_bank *bank)
+33 -29
arch/arm/mach-pnx4008/irq.c
··· 36 37 static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES; 38 39 - static void pnx4008_mask_irq(unsigned int irq) 40 { 41 - __raw_writel(__raw_readl(INTC_ER(irq)) & ~INTC_BIT(irq), INTC_ER(irq)); /* mask interrupt */ 42 } 43 44 - static void pnx4008_unmask_irq(unsigned int irq) 45 { 46 - __raw_writel(__raw_readl(INTC_ER(irq)) | INTC_BIT(irq), INTC_ER(irq)); /* unmask interrupt */ 47 } 48 49 - static void pnx4008_mask_ack_irq(unsigned int irq) 50 { 51 - __raw_writel(__raw_readl(INTC_ER(irq)) & ~INTC_BIT(irq), INTC_ER(irq)); /* mask interrupt */ 52 - __raw_writel(INTC_BIT(irq), INTC_SR(irq)); /* clear interrupt status */ 53 } 54 55 - static int pnx4008_set_irq_type(unsigned int irq, unsigned int type) 56 { 57 switch (type) { 58 case IRQ_TYPE_EDGE_RISING: 59 - __raw_writel(__raw_readl(INTC_ATR(irq)) | INTC_BIT(irq), INTC_ATR(irq)); /*edge sensitive */ 60 - __raw_writel(__raw_readl(INTC_APR(irq)) | INTC_BIT(irq), INTC_APR(irq)); /*rising edge */ 61 - set_irq_handler(irq, handle_edge_irq); 62 break; 63 case IRQ_TYPE_EDGE_FALLING: 64 - __raw_writel(__raw_readl(INTC_ATR(irq)) | INTC_BIT(irq), INTC_ATR(irq)); /*edge sensitive */ 65 - __raw_writel(__raw_readl(INTC_APR(irq)) & ~INTC_BIT(irq), INTC_APR(irq)); /*falling edge */ 66 - set_irq_handler(irq, handle_edge_irq); 67 break; 68 case IRQ_TYPE_LEVEL_LOW: 69 - __raw_writel(__raw_readl(INTC_ATR(irq)) & ~INTC_BIT(irq), INTC_ATR(irq)); /*level sensitive */ 70 - __raw_writel(__raw_readl(INTC_APR(irq)) & ~INTC_BIT(irq), INTC_APR(irq)); /*low level */ 71 - set_irq_handler(irq, handle_level_irq); 72 break; 73 case IRQ_TYPE_LEVEL_HIGH: 74 - __raw_writel(__raw_readl(INTC_ATR(irq)) & ~INTC_BIT(irq), INTC_ATR(irq)); /*level sensitive */ 75 - __raw_writel(__raw_readl(INTC_APR(irq)) | INTC_BIT(irq), INTC_APR(irq)); /* high level */ 76 - set_irq_handler(irq, handle_level_irq); 77 break; 78 79 /* IRQ_TYPE_EDGE_BOTH is not supported */ ··· 85 } 86 87 static struct irq_chip pnx4008_irq_chip = { 88 - .ack = pnx4008_mask_ack_irq, 89 - .mask = pnx4008_mask_irq, 90 - .unmask = pnx4008_unmask_irq, 91 - .set_type = pnx4008_set_irq_type, 92 }; 93 94 void __init pnx4008_init_irq(void) ··· 99 for (i = 0; i < NR_IRQS; i++) { 100 set_irq_flags(i, IRQF_VALID); 101 set_irq_chip(i, &pnx4008_irq_chip); 102 - pnx4008_set_irq_type(i, pnx4008_irq_type[i]); 103 } 104 105 /* configure and enable IRQ 0,1,30,31 (cascade interrupts) */ 106 - pnx4008_set_irq_type(SUB1_IRQ_N, pnx4008_irq_type[SUB1_IRQ_N]); 107 - pnx4008_set_irq_type(SUB2_IRQ_N, pnx4008_irq_type[SUB2_IRQ_N]); 108 - pnx4008_set_irq_type(SUB1_FIQ_N, pnx4008_irq_type[SUB1_FIQ_N]); 109 - pnx4008_set_irq_type(SUB2_FIQ_N, pnx4008_irq_type[SUB2_FIQ_N]); 110 111 /* mask all others */ 112 __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) |
··· 36 37 static u8 pnx4008_irq_type[NR_IRQS] = PNX4008_IRQ_TYPES; 38 39 + static void pnx4008_mask_irq(struct irq_data *d) 40 { 41 + __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */ 42 } 43 44 + static void pnx4008_unmask_irq(struct irq_data *d) 45 { 46 + __raw_writel(__raw_readl(INTC_ER(d->irq)) | INTC_BIT(d->irq), INTC_ER(d->irq)); /* unmask interrupt */ 47 } 48 49 + static void pnx4008_mask_ack_irq(struct irq_data *d) 50 { 51 + __raw_writel(__raw_readl(INTC_ER(d->irq)) & ~INTC_BIT(d->irq), INTC_ER(d->irq)); /* mask interrupt */ 52 + __raw_writel(INTC_BIT(d->irq), INTC_SR(d->irq)); /* clear interrupt status */ 53 } 54 55 + static int pnx4008_set_irq_type(struct irq_data *d, unsigned int type) 56 { 57 switch (type) { 58 case IRQ_TYPE_EDGE_RISING: 59 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */ 60 + __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /*rising edge */ 61 + set_irq_handler(d->irq, handle_edge_irq); 62 break; 63 case IRQ_TYPE_EDGE_FALLING: 64 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) | INTC_BIT(d->irq), INTC_ATR(d->irq)); /*edge sensitive */ 65 + __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*falling edge */ 66 + set_irq_handler(d->irq, handle_edge_irq); 67 break; 68 case IRQ_TYPE_LEVEL_LOW: 69 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */ 70 + __raw_writel(__raw_readl(INTC_APR(d->irq)) & ~INTC_BIT(d->irq), INTC_APR(d->irq)); /*low level */ 71 + set_irq_handler(d->irq, handle_level_irq); 72 break; 73 case IRQ_TYPE_LEVEL_HIGH: 74 + __raw_writel(__raw_readl(INTC_ATR(d->irq)) & ~INTC_BIT(d->irq), INTC_ATR(d->irq)); /*level sensitive */ 75 + __raw_writel(__raw_readl(INTC_APR(d->irq)) | INTC_BIT(d->irq), INTC_APR(d->irq)); /* high level */ 76 + set_irq_handler(d->irq, handle_level_irq); 77 break; 78 79 /* IRQ_TYPE_EDGE_BOTH is not supported */ ··· 85 } 86 87 static struct irq_chip pnx4008_irq_chip = { 88 + .irq_ack = pnx4008_mask_ack_irq, 89 + .irq_mask = pnx4008_mask_irq, 90 + .irq_unmask = pnx4008_unmask_irq, 91 + .irq_set_type = pnx4008_set_irq_type, 92 }; 93 94 void __init pnx4008_init_irq(void) ··· 99 for (i = 0; i < NR_IRQS; i++) { 100 set_irq_flags(i, IRQF_VALID); 101 set_irq_chip(i, &pnx4008_irq_chip); 102 + pnx4008_set_irq_type(irq_get_irq_data(i), pnx4008_irq_type[i]); 103 } 104 105 /* configure and enable IRQ 0,1,30,31 (cascade interrupts) */ 106 + pnx4008_set_irq_type(irq_get_irq_data(SUB1_IRQ_N), 107 + pnx4008_irq_type[SUB1_IRQ_N]); 108 + pnx4008_set_irq_type(irq_get_irq_data(SUB2_IRQ_N), 109 + pnx4008_irq_type[SUB2_IRQ_N]); 110 + pnx4008_set_irq_type(irq_get_irq_data(SUB1_FIQ_N), 111 + pnx4008_irq_type[SUB1_FIQ_N]); 112 + pnx4008_set_irq_type(irq_get_irq_data(SUB2_FIQ_N), 113 + pnx4008_irq_type[SUB2_FIQ_N]); 114 115 /* mask all others */ 116 __raw_writel((1 << SUB2_FIQ_N) | (1 << SUB1_FIQ_N) |
+14 -9
arch/arm/mach-pxa/balloon3.c
··· 477 /****************************************************************************** 478 * FPGA IRQ 479 ******************************************************************************/ 480 - static void balloon3_mask_irq(unsigned int irq) 481 { 482 - int balloon3_irq = (irq - BALLOON3_IRQ(0)); 483 balloon3_irq_enabled &= ~(1 << balloon3_irq); 484 __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG); 485 } 486 487 - static void balloon3_unmask_irq(unsigned int irq) 488 { 489 - int balloon3_irq = (irq - BALLOON3_IRQ(0)); 490 balloon3_irq_enabled |= (1 << balloon3_irq); 491 __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG); 492 } 493 494 static struct irq_chip balloon3_irq_chip = { 495 .name = "FPGA", 496 - .ack = balloon3_mask_irq, 497 - .mask = balloon3_mask_irq, 498 - .unmask = balloon3_unmask_irq, 499 }; 500 501 static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 504 balloon3_irq_enabled; 505 do { 506 /* clear useless edge notification */ 507 - if (desc->chip->ack) 508 - desc->chip->ack(BALLOON3_AUX_NIRQ); 509 while (pending) { 510 irq = BALLOON3_IRQ(0) + __ffs(pending); 511 generic_handle_irq(irq);
··· 477 /****************************************************************************** 478 * FPGA IRQ 479 ******************************************************************************/ 480 + static void balloon3_mask_irq(struct irq_data *d) 481 { 482 + int balloon3_irq = (d->irq - BALLOON3_IRQ(0)); 483 balloon3_irq_enabled &= ~(1 << balloon3_irq); 484 __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG); 485 } 486 487 + static void balloon3_unmask_irq(struct irq_data *d) 488 { 489 + int balloon3_irq = (d->irq - BALLOON3_IRQ(0)); 490 balloon3_irq_enabled |= (1 << balloon3_irq); 491 __raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG); 492 } 493 494 static struct irq_chip balloon3_irq_chip = { 495 .name = "FPGA", 496 + .irq_ack = balloon3_mask_irq, 497 + .irq_mask = balloon3_mask_irq, 498 + .irq_unmask = balloon3_unmask_irq, 499 }; 500 501 static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 504 balloon3_irq_enabled; 505 do { 506 /* clear useless edge notification */ 507 + if (desc->irq_data.chip->irq_ack) { 508 + struct irq_data *d; 509 + 510 + d = irq_get_irq_data(BALLOON3_AUX_NIRQ); 511 + desc->irq_data.chip->irq_ack(d); 512 + } 513 + 514 while (pending) { 515 irq = BALLOON3_IRQ(0) + __ffs(pending); 516 generic_handle_irq(irq);
-1
arch/arm/mach-pxa/clock-pxa3xx.c
··· 115 { 116 unsigned long acsr = ACSR; 117 unsigned long memclkcfg = __raw_readl(MEMCLKCFG); 118 - unsigned int smcfs = (acsr >> 23) & 0x7; 119 120 return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] / 121 df_clkdiv[(memclkcfg >> 16) & 0x3];
··· 115 { 116 unsigned long acsr = ACSR; 117 unsigned long memclkcfg = __raw_readl(MEMCLKCFG); 118 119 return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] / 120 df_clkdiv[(memclkcfg >> 16) & 0x3];
+1 -1
arch/arm/mach-pxa/cm-x2xx-pci.c
··· 59 static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 60 { 61 /* clear our parent irq */ 62 - desc->chip->ack(irq); 63 64 it8152_irq_demux(irq, desc); 65 }
··· 59 static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 60 { 61 /* clear our parent irq */ 62 + desc->irq_data.chip->irq_ack(&desc->irq_data); 63 64 it8152_irq_demux(irq, desc); 65 }
+3 -1
arch/arm/mach-pxa/generic.h
··· 9 * published by the Free Software Foundation. 10 */ 11 12 struct sys_timer; 13 14 extern struct sys_timer pxa_timer; 15 extern void __init pxa_init_irq(int irq_nr, 16 - int (*set_wake)(unsigned int, unsigned int)); 17 extern void __init pxa25x_init_irq(void); 18 #ifdef CONFIG_CPU_PXA26x 19 extern void __init pxa26x_init_irq(void);
··· 9 * published by the Free Software Foundation. 10 */ 11 12 + struct irq_data; 13 struct sys_timer; 14 15 extern struct sys_timer pxa_timer; 16 extern void __init pxa_init_irq(int irq_nr, 17 + int (*set_wake)(struct irq_data *, 18 + unsigned int)); 19 extern void __init pxa25x_init_irq(void); 20 #ifdef CONFIG_CPU_PXA26x 21 extern void __init pxa26x_init_irq(void);
+35 -48
arch/arm/mach-pxa/irq.c
··· 53 return !cpu_is_pxa25x(); 54 } 55 56 - static void pxa_mask_irq(unsigned int irq) 57 { 58 - void __iomem *base = get_irq_chip_data(irq); 59 uint32_t icmr = __raw_readl(base + ICMR); 60 61 - icmr &= ~(1 << IRQ_BIT(irq)); 62 __raw_writel(icmr, base + ICMR); 63 } 64 65 - static void pxa_unmask_irq(unsigned int irq) 66 { 67 - void __iomem *base = get_irq_chip_data(irq); 68 uint32_t icmr = __raw_readl(base + ICMR); 69 70 - icmr |= 1 << IRQ_BIT(irq); 71 __raw_writel(icmr, base + ICMR); 72 } 73 74 static struct irq_chip pxa_internal_irq_chip = { 75 .name = "SC", 76 - .ack = pxa_mask_irq, 77 - .mask = pxa_mask_irq, 78 - .unmask = pxa_unmask_irq, 79 }; 80 81 /* 82 * GPIO IRQs for GPIO 0 and 1 83 */ 84 - static int pxa_set_low_gpio_type(unsigned int irq, unsigned int type) 85 { 86 - int gpio = irq - IRQ_GPIO0; 87 88 if (__gpio_is_occupied(gpio)) { 89 pr_err("%s failed: GPIO is configured\n", __func__); ··· 114 return 0; 115 } 116 117 - static void pxa_ack_low_gpio(unsigned int irq) 118 { 119 - GEDR0 = (1 << (irq - IRQ_GPIO0)); 120 - } 121 - 122 - static void pxa_mask_low_gpio(unsigned int irq) 123 - { 124 - struct irq_desc *desc = irq_to_desc(irq); 125 - 126 - desc->chip->mask(irq); 127 - } 128 - 129 - static void pxa_unmask_low_gpio(unsigned int irq) 130 - { 131 - struct irq_desc *desc = irq_to_desc(irq); 132 - 133 - desc->chip->unmask(irq); 134 } 135 136 static struct irq_chip pxa_low_gpio_chip = { 137 .name = "GPIO-l", 138 - .ack = pxa_ack_low_gpio, 139 - .mask = pxa_mask_low_gpio, 140 - .unmask = pxa_unmask_low_gpio, 141 - .set_type = pxa_set_low_gpio_type, 142 }; 143 144 static void __init pxa_init_low_gpio_irq(set_wake_t fn) ··· 138 139 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) { 140 set_irq_chip(irq, &pxa_low_gpio_chip); 141 set_irq_handler(irq, handle_edge_irq); 142 set_irq_flags(irq, IRQF_VALID); 143 } 144 145 - pxa_low_gpio_chip.set_wake = fn; 146 - } 147 - 148 - static inline void __iomem *irq_base(int i) 149 - { 150 - static unsigned long phys_base[] = { 151 - 0x40d00000, 152 - 0x40d0009c, 153 - 0x40d00130, 154 - }; 155 - 156 - return (void __iomem *)io_p2v(phys_base[i >> 5]); 157 } 158 159 void __init pxa_init_irq(int irq_nr, set_wake_t fn) ··· 155 pxa_internal_irq_nr = irq_nr; 156 157 for (n = 0; n < irq_nr; n += 32) { 158 - void __iomem *base = irq_base(n); 159 160 __raw_writel(0, base + ICMR); /* disable all IRQs */ 161 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ ··· 175 /* only unmasked interrupts kick us out of idle */ 176 __raw_writel(1, irq_base(0) + ICCR); 177 178 - pxa_internal_irq_chip.set_wake = fn; 179 pxa_init_low_gpio_irq(fn); 180 } 181 ··· 187 { 188 int i; 189 190 - for (i = 0; i < pxa_internal_irq_nr; i += 32) { 191 void __iomem *base = irq_base(i); 192 193 saved_icmr[i] = __raw_readl(base + ICMR); ··· 206 { 207 int i; 208 209 - for (i = 0; i < pxa_internal_irq_nr; i += 32) { 210 void __iomem *base = irq_base(i); 211 212 __raw_writel(saved_icmr[i], base + ICMR); 213 __raw_writel(0, base + ICLR); 214 } 215 216 - if (!cpu_is_pxa25x()) 217 for (i = 0; i < pxa_internal_irq_nr; i++) 218 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); 219
··· 53 return !cpu_is_pxa25x(); 54 } 55 56 + static inline void __iomem *irq_base(int i) 57 { 58 + static unsigned long phys_base[] = { 59 + 0x40d00000, 60 + 0x40d0009c, 61 + 0x40d00130, 62 + }; 63 + 64 + return (void __iomem *)io_p2v(phys_base[i]); 65 + } 66 + 67 + static void pxa_mask_irq(struct irq_data *d) 68 + { 69 + void __iomem *base = irq_data_get_irq_chip_data(d); 70 uint32_t icmr = __raw_readl(base + ICMR); 71 72 + icmr &= ~(1 << IRQ_BIT(d->irq)); 73 __raw_writel(icmr, base + ICMR); 74 } 75 76 + static void pxa_unmask_irq(struct irq_data *d) 77 { 78 + void __iomem *base = irq_data_get_irq_chip_data(d); 79 uint32_t icmr = __raw_readl(base + ICMR); 80 81 + icmr |= 1 << IRQ_BIT(d->irq); 82 __raw_writel(icmr, base + ICMR); 83 } 84 85 static struct irq_chip pxa_internal_irq_chip = { 86 .name = "SC", 87 + .irq_ack = pxa_mask_irq, 88 + .irq_mask = pxa_mask_irq, 89 + .irq_unmask = pxa_unmask_irq, 90 }; 91 92 /* 93 * GPIO IRQs for GPIO 0 and 1 94 */ 95 + static int pxa_set_low_gpio_type(struct irq_data *d, unsigned int type) 96 { 97 + int gpio = d->irq - IRQ_GPIO0; 98 99 if (__gpio_is_occupied(gpio)) { 100 pr_err("%s failed: GPIO is configured\n", __func__); ··· 103 return 0; 104 } 105 106 + static void pxa_ack_low_gpio(struct irq_data *d) 107 { 108 + GEDR0 = (1 << (d->irq - IRQ_GPIO0)); 109 } 110 111 static struct irq_chip pxa_low_gpio_chip = { 112 .name = "GPIO-l", 113 + .irq_ack = pxa_ack_low_gpio, 114 + .irq_mask = pxa_mask_irq, 115 + .irq_unmask = pxa_unmask_irq, 116 + .irq_set_type = pxa_set_low_gpio_type, 117 }; 118 119 static void __init pxa_init_low_gpio_irq(set_wake_t fn) ··· 141 142 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) { 143 set_irq_chip(irq, &pxa_low_gpio_chip); 144 + set_irq_chip_data(irq, irq_base(0)); 145 set_irq_handler(irq, handle_edge_irq); 146 set_irq_flags(irq, IRQF_VALID); 147 } 148 149 + pxa_low_gpio_chip.irq_set_wake = fn; 150 } 151 152 void __init pxa_init_irq(int irq_nr, set_wake_t fn) ··· 168 pxa_internal_irq_nr = irq_nr; 169 170 for (n = 0; n < irq_nr; n += 32) { 171 + void __iomem *base = irq_base(n >> 5); 172 173 __raw_writel(0, base + ICMR); /* disable all IRQs */ 174 __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ ··· 188 /* only unmasked interrupts kick us out of idle */ 189 __raw_writel(1, irq_base(0) + ICCR); 190 191 + pxa_internal_irq_chip.irq_set_wake = fn; 192 pxa_init_low_gpio_irq(fn); 193 } 194 ··· 200 { 201 int i; 202 203 + for (i = 0; i < pxa_internal_irq_nr / 32; i++) { 204 void __iomem *base = irq_base(i); 205 206 saved_icmr[i] = __raw_readl(base + ICMR); ··· 219 { 220 int i; 221 222 + for (i = 0; i < pxa_internal_irq_nr / 32; i++) { 223 void __iomem *base = irq_base(i); 224 225 __raw_writel(saved_icmr[i], base + ICMR); 226 __raw_writel(0, base + ICLR); 227 } 228 229 + if (cpu_has_ipr()) 230 for (i = 0; i < pxa_internal_irq_nr; i++) 231 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); 232
+9 -8
arch/arm/mach-pxa/lpd270.c
··· 95 96 static unsigned int lpd270_irq_enabled; 97 98 - static void lpd270_mask_irq(unsigned int irq) 99 { 100 - int lpd270_irq = irq - LPD270_IRQ(0); 101 102 __raw_writew(~(1 << lpd270_irq), LPD270_INT_STATUS); 103 ··· 105 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); 106 } 107 108 - static void lpd270_unmask_irq(unsigned int irq) 109 { 110 - int lpd270_irq = irq - LPD270_IRQ(0); 111 112 lpd270_irq_enabled |= 1 << lpd270_irq; 113 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); ··· 115 116 static struct irq_chip lpd270_irq_chip = { 117 .name = "CPLD", 118 - .ack = lpd270_mask_irq, 119 - .mask = lpd270_mask_irq, 120 - .unmask = lpd270_unmask_irq, 121 }; 122 123 static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 126 127 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; 128 do { 129 - desc->chip->ack(irq); /* clear useless edge notification */ 130 if (likely(pending)) { 131 irq = LPD270_IRQ(0) + __ffs(pending); 132 generic_handle_irq(irq);
··· 95 96 static unsigned int lpd270_irq_enabled; 97 98 + static void lpd270_mask_irq(struct irq_data *d) 99 { 100 + int lpd270_irq = d->irq - LPD270_IRQ(0); 101 102 __raw_writew(~(1 << lpd270_irq), LPD270_INT_STATUS); 103 ··· 105 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); 106 } 107 108 + static void lpd270_unmask_irq(struct irq_data *d) 109 { 110 + int lpd270_irq = d->irq - LPD270_IRQ(0); 111 112 lpd270_irq_enabled |= 1 << lpd270_irq; 113 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); ··· 115 116 static struct irq_chip lpd270_irq_chip = { 117 .name = "CPLD", 118 + .irq_ack = lpd270_mask_irq, 119 + .irq_mask = lpd270_mask_irq, 120 + .irq_unmask = lpd270_unmask_irq, 121 }; 122 123 static void lpd270_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 126 127 pending = __raw_readw(LPD270_INT_STATUS) & lpd270_irq_enabled; 128 do { 129 + /* clear useless edge notification */ 130 + desc->irq_data.chip->irq_ack(&desc->irq_data); 131 if (likely(pending)) { 132 irq = LPD270_IRQ(0) + __ffs(pending); 133 generic_handle_irq(irq);
+9 -8
arch/arm/mach-pxa/lubbock.c
··· 122 123 static unsigned long lubbock_irq_enabled; 124 125 - static void lubbock_mask_irq(unsigned int irq) 126 { 127 - int lubbock_irq = (irq - LUBBOCK_IRQ(0)); 128 LUB_IRQ_MASK_EN = (lubbock_irq_enabled &= ~(1 << lubbock_irq)); 129 } 130 131 - static void lubbock_unmask_irq(unsigned int irq) 132 { 133 - int lubbock_irq = (irq - LUBBOCK_IRQ(0)); 134 /* the irq can be acknowledged only if deasserted, so it's done here */ 135 LUB_IRQ_SET_CLR &= ~(1 << lubbock_irq); 136 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq)); ··· 138 139 static struct irq_chip lubbock_irq_chip = { 140 .name = "FPGA", 141 - .ack = lubbock_mask_irq, 142 - .mask = lubbock_mask_irq, 143 - .unmask = lubbock_unmask_irq, 144 }; 145 146 static void lubbock_irq_handler(unsigned int irq, struct irq_desc *desc) 147 { 148 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; 149 do { 150 - desc->chip->ack(irq); /* clear our parent irq */ 151 if (likely(pending)) { 152 irq = LUBBOCK_IRQ(0) + __ffs(pending); 153 generic_handle_irq(irq);
··· 122 123 static unsigned long lubbock_irq_enabled; 124 125 + static void lubbock_mask_irq(struct irq_data *d) 126 { 127 + int lubbock_irq = (d->irq - LUBBOCK_IRQ(0)); 128 LUB_IRQ_MASK_EN = (lubbock_irq_enabled &= ~(1 << lubbock_irq)); 129 } 130 131 + static void lubbock_unmask_irq(struct irq_data *d) 132 { 133 + int lubbock_irq = (d->irq - LUBBOCK_IRQ(0)); 134 /* the irq can be acknowledged only if deasserted, so it's done here */ 135 LUB_IRQ_SET_CLR &= ~(1 << lubbock_irq); 136 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq)); ··· 138 139 static struct irq_chip lubbock_irq_chip = { 140 .name = "FPGA", 141 + .irq_ack = lubbock_mask_irq, 142 + .irq_mask = lubbock_mask_irq, 143 + .irq_unmask = lubbock_unmask_irq, 144 }; 145 146 static void lubbock_irq_handler(unsigned int irq, struct irq_desc *desc) 147 { 148 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled; 149 do { 150 + /* clear our parent irq */ 151 + desc->irq_data.chip->irq_ack(&desc->irq_data); 152 if (likely(pending)) { 153 irq = LUBBOCK_IRQ(0) + __ffs(pending); 154 generic_handle_irq(irq);
+9 -8
arch/arm/mach-pxa/mainstone.c
··· 123 124 static unsigned long mainstone_irq_enabled; 125 126 - static void mainstone_mask_irq(unsigned int irq) 127 { 128 - int mainstone_irq = (irq - MAINSTONE_IRQ(0)); 129 MST_INTMSKENA = (mainstone_irq_enabled &= ~(1 << mainstone_irq)); 130 } 131 132 - static void mainstone_unmask_irq(unsigned int irq) 133 { 134 - int mainstone_irq = (irq - MAINSTONE_IRQ(0)); 135 /* the irq can be acknowledged only if deasserted, so it's done here */ 136 MST_INTSETCLR &= ~(1 << mainstone_irq); 137 MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq)); ··· 139 140 static struct irq_chip mainstone_irq_chip = { 141 .name = "FPGA", 142 - .ack = mainstone_mask_irq, 143 - .mask = mainstone_mask_irq, 144 - .unmask = mainstone_unmask_irq, 145 }; 146 147 static void mainstone_irq_handler(unsigned int irq, struct irq_desc *desc) 148 { 149 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled; 150 do { 151 - desc->chip->ack(irq); /* clear useless edge notification */ 152 if (likely(pending)) { 153 irq = MAINSTONE_IRQ(0) + __ffs(pending); 154 generic_handle_irq(irq);
··· 123 124 static unsigned long mainstone_irq_enabled; 125 126 + static void mainstone_mask_irq(struct irq_data *d) 127 { 128 + int mainstone_irq = (d->irq - MAINSTONE_IRQ(0)); 129 MST_INTMSKENA = (mainstone_irq_enabled &= ~(1 << mainstone_irq)); 130 } 131 132 + static void mainstone_unmask_irq(struct irq_data *d) 133 { 134 + int mainstone_irq = (d->irq - MAINSTONE_IRQ(0)); 135 /* the irq can be acknowledged only if deasserted, so it's done here */ 136 MST_INTSETCLR &= ~(1 << mainstone_irq); 137 MST_INTMSKENA = (mainstone_irq_enabled |= (1 << mainstone_irq)); ··· 139 140 static struct irq_chip mainstone_irq_chip = { 141 .name = "FPGA", 142 + .irq_ack = mainstone_mask_irq, 143 + .irq_mask = mainstone_mask_irq, 144 + .irq_unmask = mainstone_unmask_irq, 145 }; 146 147 static void mainstone_irq_handler(unsigned int irq, struct irq_desc *desc) 148 { 149 unsigned long pending = MST_INTSETCLR & mainstone_irq_enabled; 150 do { 151 + /* clear useless edge notification */ 152 + desc->irq_data.chip->irq_ack(&desc->irq_data); 153 if (likely(pending)) { 154 irq = MAINSTONE_IRQ(0) + __ffs(pending); 155 generic_handle_irq(irq);
+8 -7
arch/arm/mach-pxa/pcm990-baseboard.c
··· 241 242 static unsigned long pcm990_irq_enabled; 243 244 - static void pcm990_mask_ack_irq(unsigned int irq) 245 { 246 - int pcm990_irq = (irq - PCM027_IRQ(0)); 247 PCM990_INTMSKENA = (pcm990_irq_enabled &= ~(1 << pcm990_irq)); 248 } 249 250 - static void pcm990_unmask_irq(unsigned int irq) 251 { 252 - int pcm990_irq = (irq - PCM027_IRQ(0)); 253 /* the irq can be acknowledged only if deasserted, so it's done here */ 254 PCM990_INTSETCLR |= 1 << pcm990_irq; 255 PCM990_INTMSKENA = (pcm990_irq_enabled |= (1 << pcm990_irq)); 256 } 257 258 static struct irq_chip pcm990_irq_chip = { 259 - .mask_ack = pcm990_mask_ack_irq, 260 - .unmask = pcm990_unmask_irq, 261 }; 262 263 static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 265 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 266 267 do { 268 - desc->chip->ack(irq); /* clear our parent IRQ */ 269 if (likely(pending)) { 270 irq = PCM027_IRQ(0) + __ffs(pending); 271 generic_handle_irq(irq);
··· 241 242 static unsigned long pcm990_irq_enabled; 243 244 + static void pcm990_mask_ack_irq(struct irq_data *d) 245 { 246 + int pcm990_irq = (d->irq - PCM027_IRQ(0)); 247 PCM990_INTMSKENA = (pcm990_irq_enabled &= ~(1 << pcm990_irq)); 248 } 249 250 + static void pcm990_unmask_irq(struct irq_data *d) 251 { 252 + int pcm990_irq = (d->irq - PCM027_IRQ(0)); 253 /* the irq can be acknowledged only if deasserted, so it's done here */ 254 PCM990_INTSETCLR |= 1 << pcm990_irq; 255 PCM990_INTMSKENA = (pcm990_irq_enabled |= (1 << pcm990_irq)); 256 } 257 258 static struct irq_chip pcm990_irq_chip = { 259 + .irq_mask_ack = pcm990_mask_ack_irq, 260 + .irq_unmask = pcm990_unmask_irq, 261 }; 262 263 static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 265 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 266 267 do { 268 + /* clear our parent IRQ */ 269 + desc->irq_data.chip->irq_ack(&desc->irq_data); 270 if (likely(pending)) { 271 irq = PCM027_IRQ(0) + __ffs(pending); 272 generic_handle_irq(irq);
+4 -3
arch/arm/mach-pxa/pxa25x.c
··· 22 #include <linux/platform_device.h> 23 #include <linux/suspend.h> 24 #include <linux/sysdev.h> 25 26 #include <asm/mach/map.h> 27 #include <mach/hardware.h> ··· 283 /* PXA25x: supports wakeup from GPIO0..GPIO15 and RTC alarm 284 */ 285 286 - static int pxa25x_set_wake(unsigned int irq, unsigned int on) 287 { 288 - int gpio = IRQ_TO_GPIO(irq); 289 uint32_t mask = 0; 290 291 if (gpio >= 0 && gpio < 85) 292 return gpio_set_wake(gpio, on); 293 294 - if (irq == IRQ_RTCAlrm) { 295 mask = PWER_RTC; 296 goto set_pwer; 297 }
··· 22 #include <linux/platform_device.h> 23 #include <linux/suspend.h> 24 #include <linux/sysdev.h> 25 + #include <linux/irq.h> 26 27 #include <asm/mach/map.h> 28 #include <mach/hardware.h> ··· 282 /* PXA25x: supports wakeup from GPIO0..GPIO15 and RTC alarm 283 */ 284 285 + static int pxa25x_set_wake(struct irq_data *d, unsigned int on) 286 { 287 + int gpio = IRQ_TO_GPIO(d->irq); 288 uint32_t mask = 0; 289 290 if (gpio >= 0 && gpio < 85) 291 return gpio_set_wake(gpio, on); 292 293 + if (d->irq == IRQ_RTCAlrm) { 294 mask = PWER_RTC; 295 goto set_pwer; 296 }
+5 -4
arch/arm/mach-pxa/pxa27x.c
··· 18 #include <linux/platform_device.h> 19 #include <linux/sysdev.h> 20 #include <linux/io.h> 21 22 #include <asm/mach/map.h> 23 #include <mach/hardware.h> ··· 344 /* PXA27x: Various gpios can issue wakeup events. This logic only 345 * handles the simple cases, not the WEMUX2 and WEMUX3 options 346 */ 347 - static int pxa27x_set_wake(unsigned int irq, unsigned int on) 348 { 349 - int gpio = IRQ_TO_GPIO(irq); 350 uint32_t mask; 351 352 if (gpio >= 0 && gpio < 128) 353 return gpio_set_wake(gpio, on); 354 355 - if (irq == IRQ_KEYPAD) 356 return keypad_set_wake(on); 357 358 - switch (irq) { 359 case IRQ_RTCAlrm: 360 mask = PWER_RTC; 361 break;
··· 18 #include <linux/platform_device.h> 19 #include <linux/sysdev.h> 20 #include <linux/io.h> 21 + #include <linux/irq.h> 22 23 #include <asm/mach/map.h> 24 #include <mach/hardware.h> ··· 343 /* PXA27x: Various gpios can issue wakeup events. This logic only 344 * handles the simple cases, not the WEMUX2 and WEMUX3 options 345 */ 346 + static int pxa27x_set_wake(struct irq_data *d, unsigned int on) 347 { 348 + int gpio = IRQ_TO_GPIO(d->irq); 349 uint32_t mask; 350 351 if (gpio >= 0 && gpio < 128) 352 return gpio_set_wake(gpio, on); 353 354 + if (d->irq == IRQ_KEYPAD) 355 return keypad_set_wake(on); 356 357 + switch (d->irq) { 358 case IRQ_RTCAlrm: 359 mask = PWER_RTC; 360 break;
+18 -18
arch/arm/mach-pxa/pxa3xx.c
··· 229 pxa_cpu_pm_fns = &pxa3xx_cpu_pm_fns; 230 } 231 232 - static int pxa3xx_set_wake(unsigned int irq, unsigned int on) 233 { 234 unsigned long flags, mask = 0; 235 236 - switch (irq) { 237 case IRQ_SSP3: 238 mask = ADXER_MFP_WSSP3; 239 break; ··· 322 #define pxa3xx_set_wake NULL 323 #endif 324 325 - static void pxa_ack_ext_wakeup(unsigned int irq) 326 { 327 - PECR |= PECR_IS(irq - IRQ_WAKEUP0); 328 } 329 330 - static void pxa_mask_ext_wakeup(unsigned int irq) 331 { 332 - ICMR2 &= ~(1 << ((irq - PXA_IRQ(0)) & 0x1f)); 333 - PECR &= ~PECR_IE(irq - IRQ_WAKEUP0); 334 } 335 336 - static void pxa_unmask_ext_wakeup(unsigned int irq) 337 { 338 - ICMR2 |= 1 << ((irq - PXA_IRQ(0)) & 0x1f); 339 - PECR |= PECR_IE(irq - IRQ_WAKEUP0); 340 } 341 342 - static int pxa_set_ext_wakeup_type(unsigned int irq, unsigned int flow_type) 343 { 344 if (flow_type & IRQ_TYPE_EDGE_RISING) 345 - PWER |= 1 << (irq - IRQ_WAKEUP0); 346 347 if (flow_type & IRQ_TYPE_EDGE_FALLING) 348 - PWER |= 1 << (irq - IRQ_WAKEUP0 + 2); 349 350 return 0; 351 } 352 353 static struct irq_chip pxa_ext_wakeup_chip = { 354 .name = "WAKEUP", 355 - .ack = pxa_ack_ext_wakeup, 356 - .mask = pxa_mask_ext_wakeup, 357 - .unmask = pxa_unmask_ext_wakeup, 358 - .set_type = pxa_set_ext_wakeup_type, 359 }; 360 361 static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) ··· 368 set_irq_flags(irq, IRQF_VALID); 369 } 370 371 - pxa_ext_wakeup_chip.set_wake = fn; 372 } 373 374 void __init pxa3xx_init_irq(void)
··· 229 pxa_cpu_pm_fns = &pxa3xx_cpu_pm_fns; 230 } 231 232 + static int pxa3xx_set_wake(struct irq_data *d, unsigned int on) 233 { 234 unsigned long flags, mask = 0; 235 236 + switch (d->irq) { 237 case IRQ_SSP3: 238 mask = ADXER_MFP_WSSP3; 239 break; ··· 322 #define pxa3xx_set_wake NULL 323 #endif 324 325 + static void pxa_ack_ext_wakeup(struct irq_data *d) 326 { 327 + PECR |= PECR_IS(d->irq - IRQ_WAKEUP0); 328 } 329 330 + static void pxa_mask_ext_wakeup(struct irq_data *d) 331 { 332 + ICMR2 &= ~(1 << ((d->irq - PXA_IRQ(0)) & 0x1f)); 333 + PECR &= ~PECR_IE(d->irq - IRQ_WAKEUP0); 334 } 335 336 + static void pxa_unmask_ext_wakeup(struct irq_data *d) 337 { 338 + ICMR2 |= 1 << ((d->irq - PXA_IRQ(0)) & 0x1f); 339 + PECR |= PECR_IE(d->irq - IRQ_WAKEUP0); 340 } 341 342 + static int pxa_set_ext_wakeup_type(struct irq_data *d, unsigned int flow_type) 343 { 344 if (flow_type & IRQ_TYPE_EDGE_RISING) 345 + PWER |= 1 << (d->irq - IRQ_WAKEUP0); 346 347 if (flow_type & IRQ_TYPE_EDGE_FALLING) 348 + PWER |= 1 << (d->irq - IRQ_WAKEUP0 + 2); 349 350 return 0; 351 } 352 353 static struct irq_chip pxa_ext_wakeup_chip = { 354 .name = "WAKEUP", 355 + .irq_ack = pxa_ack_ext_wakeup, 356 + .irq_mask = pxa_mask_ext_wakeup, 357 + .irq_unmask = pxa_unmask_ext_wakeup, 358 + .irq_set_type = pxa_set_ext_wakeup_type, 359 }; 360 361 static void __init pxa_init_ext_wakeup_irq(set_wake_t fn) ··· 368 set_irq_flags(irq, IRQF_VALID); 369 } 370 371 + pxa_ext_wakeup_chip.irq_set_wake = fn; 372 } 373 374 void __init pxa3xx_init_irq(void)
+1
arch/arm/mach-pxa/spitz.c
··· 25 #include <linux/spi/corgi_lcd.h> 26 #include <linux/spi/pxa2xx_spi.h> 27 #include <linux/mtd/sharpsl.h> 28 #include <linux/input/matrix_keypad.h> 29 #include <linux/regulator/machine.h> 30 #include <linux/io.h>
··· 25 #include <linux/spi/corgi_lcd.h> 26 #include <linux/spi/pxa2xx_spi.h> 27 #include <linux/mtd/sharpsl.h> 28 + #include <linux/mtd/physmap.h> 29 #include <linux/input/matrix_keypad.h> 30 #include <linux/regulator/machine.h> 31 #include <linux/io.h>
+11 -11
arch/arm/mach-pxa/viper.c
··· 249 return viper_isa_irqs[bit] + PXA_ISA_IRQ(0); 250 } 251 252 - static void viper_ack_irq(unsigned int irq) 253 { 254 - int viper_irq = viper_irq_to_bitmask(irq); 255 256 if (viper_irq & 0xff) 257 VIPER_LO_IRQ_STATUS = viper_irq; ··· 259 VIPER_HI_IRQ_STATUS = (viper_irq >> 8); 260 } 261 262 - static void viper_mask_irq(unsigned int irq) 263 { 264 - viper_irq_enabled_mask &= ~(viper_irq_to_bitmask(irq)); 265 } 266 267 - static void viper_unmask_irq(unsigned int irq) 268 { 269 - viper_irq_enabled_mask |= viper_irq_to_bitmask(irq); 270 } 271 272 static inline unsigned long viper_irq_pending(void) ··· 283 do { 284 /* we're in a chained irq handler, 285 * so ack the interrupt by hand */ 286 - desc->chip->ack(irq); 287 288 if (likely(pending)) { 289 irq = viper_bit_to_irq(__ffs(pending)); ··· 294 } 295 296 static struct irq_chip viper_irq_chip = { 297 - .name = "ISA", 298 - .ack = viper_ack_irq, 299 - .mask = viper_mask_irq, 300 - .unmask = viper_unmask_irq 301 }; 302 303 static void __init viper_init_irq(void)
··· 249 return viper_isa_irqs[bit] + PXA_ISA_IRQ(0); 250 } 251 252 + static void viper_ack_irq(struct irq_data *d) 253 { 254 + int viper_irq = viper_irq_to_bitmask(d->irq); 255 256 if (viper_irq & 0xff) 257 VIPER_LO_IRQ_STATUS = viper_irq; ··· 259 VIPER_HI_IRQ_STATUS = (viper_irq >> 8); 260 } 261 262 + static void viper_mask_irq(struct irq_data *d) 263 { 264 + viper_irq_enabled_mask &= ~(viper_irq_to_bitmask(d->irq)); 265 } 266 267 + static void viper_unmask_irq(struct irq_data *d) 268 { 269 + viper_irq_enabled_mask |= viper_irq_to_bitmask(d->irq); 270 } 271 272 static inline unsigned long viper_irq_pending(void) ··· 283 do { 284 /* we're in a chained irq handler, 285 * so ack the interrupt by hand */ 286 + desc->irq_data.chip->irq_ack(&desc->irq_data); 287 288 if (likely(pending)) { 289 irq = viper_bit_to_irq(__ffs(pending)); ··· 294 } 295 296 static struct irq_chip viper_irq_chip = { 297 + .name = "ISA", 298 + .irq_ack = viper_ack_irq, 299 + .irq_mask = viper_mask_irq, 300 + .irq_unmask = viper_unmask_irq 301 }; 302 303 static void __init viper_init_irq(void)
+13 -13
arch/arm/mach-pxa/zeus.c
··· 83 return zeus_isa_irqs[bit] + PXA_ISA_IRQ(0); 84 } 85 86 - static void zeus_ack_irq(unsigned int irq) 87 { 88 - __raw_writew(zeus_irq_to_bitmask(irq), ZEUS_CPLD_ISA_IRQ); 89 } 90 91 - static void zeus_mask_irq(unsigned int irq) 92 { 93 - zeus_irq_enabled_mask &= ~(zeus_irq_to_bitmask(irq)); 94 } 95 96 - static void zeus_unmask_irq(unsigned int irq) 97 { 98 - zeus_irq_enabled_mask |= zeus_irq_to_bitmask(irq); 99 } 100 101 static inline unsigned long zeus_irq_pending(void) ··· 111 do { 112 /* we're in a chained irq handler, 113 * so ack the interrupt by hand */ 114 - desc->chip->ack(gpio_to_irq(ZEUS_ISA_GPIO)); 115 116 if (likely(pending)) { 117 irq = zeus_bit_to_irq(__ffs(pending)); ··· 122 } 123 124 static struct irq_chip zeus_irq_chip = { 125 - .name = "ISA", 126 - .ack = zeus_ack_irq, 127 - .mask = zeus_mask_irq, 128 - .unmask = zeus_unmask_irq, 129 }; 130 131 static void __init zeus_init_irq(void) ··· 830 pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); 831 832 /* Fix timings for dm9000s (CS1/CS2)*/ 833 - msc0 = __raw_readl(MSC0) & 0x0000ffff | (dm9000_msc << 16); 834 - msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc; 835 __raw_writel(msc0, MSC0); 836 __raw_writel(msc1, MSC1); 837
··· 83 return zeus_isa_irqs[bit] + PXA_ISA_IRQ(0); 84 } 85 86 + static void zeus_ack_irq(struct irq_data *d) 87 { 88 + __raw_writew(zeus_irq_to_bitmask(d->irq), ZEUS_CPLD_ISA_IRQ); 89 } 90 91 + static void zeus_mask_irq(struct irq_data *d) 92 { 93 + zeus_irq_enabled_mask &= ~(zeus_irq_to_bitmask(d->irq)); 94 } 95 96 + static void zeus_unmask_irq(struct irq_data *d) 97 { 98 + zeus_irq_enabled_mask |= zeus_irq_to_bitmask(d->irq); 99 } 100 101 static inline unsigned long zeus_irq_pending(void) ··· 111 do { 112 /* we're in a chained irq handler, 113 * so ack the interrupt by hand */ 114 + desc->irq_data.chip->irq_ack(&desc->irq_data); 115 116 if (likely(pending)) { 117 irq = zeus_bit_to_irq(__ffs(pending)); ··· 122 } 123 124 static struct irq_chip zeus_irq_chip = { 125 + .name = "ISA", 126 + .irq_ack = zeus_ack_irq, 127 + .irq_mask = zeus_mask_irq, 128 + .irq_unmask = zeus_unmask_irq, 129 }; 130 131 static void __init zeus_init_irq(void) ··· 830 pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); 831 832 /* Fix timings for dm9000s (CS1/CS2)*/ 833 + msc0 = (__raw_readl(MSC0) & 0x0000ffff) | (dm9000_msc << 16); 834 + msc1 = (__raw_readl(MSC1) & 0xffff0000) | dm9000_msc; 835 __raw_writel(msc0, MSC0); 836 __raw_writel(msc1, MSC1); 837
+30 -30
arch/arm/mach-rpc/irq.c
··· 6 #include <asm/hardware/iomd.h> 7 #include <asm/irq.h> 8 9 - static void iomd_ack_irq_a(unsigned int irq) 10 { 11 unsigned int val, mask; 12 13 - mask = 1 << irq; 14 val = iomd_readb(IOMD_IRQMASKA); 15 iomd_writeb(val & ~mask, IOMD_IRQMASKA); 16 iomd_writeb(mask, IOMD_IRQCLRA); 17 } 18 19 - static void iomd_mask_irq_a(unsigned int irq) 20 { 21 unsigned int val, mask; 22 23 - mask = 1 << irq; 24 val = iomd_readb(IOMD_IRQMASKA); 25 iomd_writeb(val & ~mask, IOMD_IRQMASKA); 26 } 27 28 - static void iomd_unmask_irq_a(unsigned int irq) 29 { 30 unsigned int val, mask; 31 32 - mask = 1 << irq; 33 val = iomd_readb(IOMD_IRQMASKA); 34 iomd_writeb(val | mask, IOMD_IRQMASKA); 35 } 36 37 static struct irq_chip iomd_a_chip = { 38 - .ack = iomd_ack_irq_a, 39 - .mask = iomd_mask_irq_a, 40 - .unmask = iomd_unmask_irq_a, 41 }; 42 43 - static void iomd_mask_irq_b(unsigned int irq) 44 { 45 unsigned int val, mask; 46 47 - mask = 1 << (irq & 7); 48 val = iomd_readb(IOMD_IRQMASKB); 49 iomd_writeb(val & ~mask, IOMD_IRQMASKB); 50 } 51 52 - static void iomd_unmask_irq_b(unsigned int irq) 53 { 54 unsigned int val, mask; 55 56 - mask = 1 << (irq & 7); 57 val = iomd_readb(IOMD_IRQMASKB); 58 iomd_writeb(val | mask, IOMD_IRQMASKB); 59 } 60 61 static struct irq_chip iomd_b_chip = { 62 - .ack = iomd_mask_irq_b, 63 - .mask = iomd_mask_irq_b, 64 - .unmask = iomd_unmask_irq_b, 65 }; 66 67 - static void iomd_mask_irq_dma(unsigned int irq) 68 { 69 unsigned int val, mask; 70 71 - mask = 1 << (irq & 7); 72 val = iomd_readb(IOMD_DMAMASK); 73 iomd_writeb(val & ~mask, IOMD_DMAMASK); 74 } 75 76 - static void iomd_unmask_irq_dma(unsigned int irq) 77 { 78 unsigned int val, mask; 79 80 - mask = 1 << (irq & 7); 81 val = iomd_readb(IOMD_DMAMASK); 82 iomd_writeb(val | mask, IOMD_DMAMASK); 83 } 84 85 static struct irq_chip iomd_dma_chip = { 86 - .ack = iomd_mask_irq_dma, 87 - .mask = iomd_mask_irq_dma, 88 - .unmask = iomd_unmask_irq_dma, 89 }; 90 91 - static void iomd_mask_irq_fiq(unsigned int irq) 92 { 93 unsigned int val, mask; 94 95 - mask = 1 << (irq & 7); 96 val = iomd_readb(IOMD_FIQMASK); 97 iomd_writeb(val & ~mask, IOMD_FIQMASK); 98 } 99 100 - static void iomd_unmask_irq_fiq(unsigned int irq) 101 { 102 unsigned int val, mask; 103 104 - mask = 1 << (irq & 7); 105 val = iomd_readb(IOMD_FIQMASK); 106 iomd_writeb(val | mask, IOMD_FIQMASK); 107 } 108 109 static struct irq_chip iomd_fiq_chip = { 110 - .ack = iomd_mask_irq_fiq, 111 - .mask = iomd_mask_irq_fiq, 112 - .unmask = iomd_unmask_irq_fiq, 113 }; 114 115 void __init rpc_init_irq(void)
··· 6 #include <asm/hardware/iomd.h> 7 #include <asm/irq.h> 8 9 + static void iomd_ack_irq_a(struct irq_data *d) 10 { 11 unsigned int val, mask; 12 13 + mask = 1 << d->irq; 14 val = iomd_readb(IOMD_IRQMASKA); 15 iomd_writeb(val & ~mask, IOMD_IRQMASKA); 16 iomd_writeb(mask, IOMD_IRQCLRA); 17 } 18 19 + static void iomd_mask_irq_a(struct irq_data *d) 20 { 21 unsigned int val, mask; 22 23 + mask = 1 << d->irq; 24 val = iomd_readb(IOMD_IRQMASKA); 25 iomd_writeb(val & ~mask, IOMD_IRQMASKA); 26 } 27 28 + static void iomd_unmask_irq_a(struct irq_data *d) 29 { 30 unsigned int val, mask; 31 32 + mask = 1 << d->irq; 33 val = iomd_readb(IOMD_IRQMASKA); 34 iomd_writeb(val | mask, IOMD_IRQMASKA); 35 } 36 37 static struct irq_chip iomd_a_chip = { 38 + .irq_ack = iomd_ack_irq_a, 39 + .irq_mask = iomd_mask_irq_a, 40 + .irq_unmask = iomd_unmask_irq_a, 41 }; 42 43 + static void iomd_mask_irq_b(struct irq_data *d) 44 { 45 unsigned int val, mask; 46 47 + mask = 1 << (d->irq & 7); 48 val = iomd_readb(IOMD_IRQMASKB); 49 iomd_writeb(val & ~mask, IOMD_IRQMASKB); 50 } 51 52 + static void iomd_unmask_irq_b(struct irq_data *d) 53 { 54 unsigned int val, mask; 55 56 + mask = 1 << (d->irq & 7); 57 val = iomd_readb(IOMD_IRQMASKB); 58 iomd_writeb(val | mask, IOMD_IRQMASKB); 59 } 60 61 static struct irq_chip iomd_b_chip = { 62 + .irq_ack = iomd_mask_irq_b, 63 + .irq_mask = iomd_mask_irq_b, 64 + .irq_unmask = iomd_unmask_irq_b, 65 }; 66 67 + static void iomd_mask_irq_dma(struct irq_data *d) 68 { 69 unsigned int val, mask; 70 71 + mask = 1 << (d->irq & 7); 72 val = iomd_readb(IOMD_DMAMASK); 73 iomd_writeb(val & ~mask, IOMD_DMAMASK); 74 } 75 76 + static void iomd_unmask_irq_dma(struct irq_data *d) 77 { 78 unsigned int val, mask; 79 80 + mask = 1 << (d->irq & 7); 81 val = iomd_readb(IOMD_DMAMASK); 82 iomd_writeb(val | mask, IOMD_DMAMASK); 83 } 84 85 static struct irq_chip iomd_dma_chip = { 86 + .irq_ack = iomd_mask_irq_dma, 87 + .irq_mask = iomd_mask_irq_dma, 88 + .irq_unmask = iomd_unmask_irq_dma, 89 }; 90 91 + static void iomd_mask_irq_fiq(struct irq_data *d) 92 { 93 unsigned int val, mask; 94 95 + mask = 1 << (d->irq & 7); 96 val = iomd_readb(IOMD_FIQMASK); 97 iomd_writeb(val & ~mask, IOMD_FIQMASK); 98 } 99 100 + static void iomd_unmask_irq_fiq(struct irq_data *d) 101 { 102 unsigned int val, mask; 103 104 + mask = 1 << (d->irq & 7); 105 val = iomd_readb(IOMD_FIQMASK); 106 iomd_writeb(val | mask, IOMD_FIQMASK); 107 } 108 109 static struct irq_chip iomd_fiq_chip = { 110 + .irq_ack = iomd_mask_irq_fiq, 111 + .irq_mask = iomd_mask_irq_fiq, 112 + .irq_unmask = iomd_unmask_irq_fiq, 113 }; 114 115 void __init rpc_init_irq(void)
+11 -11
arch/arm/mach-s3c2410/bast-irq.c
··· 75 static unsigned char bast_pc104_irqs[] = { 3, 5, 7, 10 }; 76 77 static void 78 - bast_pc104_mask(unsigned int irqno) 79 { 80 unsigned long temp; 81 82 temp = __raw_readb(BAST_VA_PC104_IRQMASK); 83 - temp &= ~bast_pc104_irqmasks[irqno]; 84 __raw_writeb(temp, BAST_VA_PC104_IRQMASK); 85 } 86 87 static void 88 - bast_pc104_maskack(unsigned int irqno) 89 { 90 struct irq_desc *desc = irq_desc + IRQ_ISA; 91 92 - bast_pc104_mask(irqno); 93 - desc->chip->ack(IRQ_ISA); 94 } 95 96 static void 97 - bast_pc104_unmask(unsigned int irqno) 98 { 99 unsigned long temp; 100 101 temp = __raw_readb(BAST_VA_PC104_IRQMASK); 102 - temp |= bast_pc104_irqmasks[irqno]; 103 __raw_writeb(temp, BAST_VA_PC104_IRQMASK); 104 } 105 106 static struct irq_chip bast_pc104_chip = { 107 - .mask = bast_pc104_mask, 108 - .unmask = bast_pc104_unmask, 109 - .ack = bast_pc104_maskack 110 }; 111 112 static void ··· 123 /* ack if we get an irq with nothing (ie, startup) */ 124 125 desc = irq_desc + IRQ_ISA; 126 - desc->chip->ack(IRQ_ISA); 127 } else { 128 /* handle the IRQ */ 129
··· 75 static unsigned char bast_pc104_irqs[] = { 3, 5, 7, 10 }; 76 77 static void 78 + bast_pc104_mask(struct irq_data *data) 79 { 80 unsigned long temp; 81 82 temp = __raw_readb(BAST_VA_PC104_IRQMASK); 83 + temp &= ~bast_pc104_irqmasks[data->irq]; 84 __raw_writeb(temp, BAST_VA_PC104_IRQMASK); 85 } 86 87 static void 88 + bast_pc104_maskack(struct irq_data *data) 89 { 90 struct irq_desc *desc = irq_desc + IRQ_ISA; 91 92 + bast_pc104_mask(data); 93 + desc->irq_data.chip->irq_ack(&desc->irq_data); 94 } 95 96 static void 97 + bast_pc104_unmask(struct irq_data *data) 98 { 99 unsigned long temp; 100 101 temp = __raw_readb(BAST_VA_PC104_IRQMASK); 102 + temp |= bast_pc104_irqmasks[data->irq]; 103 __raw_writeb(temp, BAST_VA_PC104_IRQMASK); 104 } 105 106 static struct irq_chip bast_pc104_chip = { 107 + .irq_mask = bast_pc104_mask, 108 + .irq_unmask = bast_pc104_unmask, 109 + .irq_ack = bast_pc104_maskack 110 }; 111 112 static void ··· 123 /* ack if we get an irq with nothing (ie, startup) */ 124 125 desc = irq_desc + IRQ_ISA; 126 + desc->irq_data.chip->irq_ack(&desc->irq_data); 127 } else { 128 /* handle the IRQ */ 129
+2 -2
arch/arm/mach-s3c2410/include/mach/irqs.h
··· 152 153 #define IRQ_S3C2416_HSMMC0 S3C2410_IRQ(21) /* S3C2416/S3C2450 */ 154 155 - #define IRQ_HSMMC0 IRQ_S3C2443_HSMMC 156 - #define IRQ_HSMMC1 IRQ_S3C2416_HSMMC0 157 158 #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) 159 #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15)
··· 152 153 #define IRQ_S3C2416_HSMMC0 S3C2410_IRQ(21) /* S3C2416/S3C2450 */ 154 155 + #define IRQ_HSMMC0 IRQ_S3C2416_HSMMC0 156 + #define IRQ_HSMMC1 IRQ_S3C2443_HSMMC 157 158 #define IRQ_S3C2443_LCD1 S3C2410_IRQSUB(14) 159 #define IRQ_S3C2443_LCD2 S3C2410_IRQSUB(15)
+2 -2
arch/arm/mach-s3c2410/include/mach/map.h
··· 112 #define S3C_PA_IIC S3C2410_PA_IIC 113 #define S3C_PA_UART S3C24XX_PA_UART 114 #define S3C_PA_USBHOST S3C2410_PA_USBHOST 115 - #define S3C_PA_HSMMC0 S3C2443_PA_HSMMC 116 - #define S3C_PA_HSMMC1 S3C2416_PA_HSMMC0 117 #define S3C_PA_WDT S3C2410_PA_WATCHDOG 118 #define S3C_PA_NAND S3C24XX_PA_NAND 119
··· 112 #define S3C_PA_IIC S3C2410_PA_IIC 113 #define S3C_PA_UART S3C24XX_PA_UART 114 #define S3C_PA_USBHOST S3C2410_PA_USBHOST 115 + #define S3C_PA_HSMMC0 S3C2416_PA_HSMMC0 116 + #define S3C_PA_HSMMC1 S3C2443_PA_HSMMC 117 #define S3C_PA_WDT S3C2410_PA_WATCHDOG 118 #define S3C_PA_NAND S3C24XX_PA_NAND 119
+1
arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
··· 86 #define S3C2443_HCLKCON_LCDC (1<<9) 87 #define S3C2443_HCLKCON_USBH (1<<11) 88 #define S3C2443_HCLKCON_USBD (1<<12) 89 #define S3C2443_HCLKCON_HSMMC (1<<16) 90 #define S3C2443_HCLKCON_CFC (1<<17) 91 #define S3C2443_HCLKCON_SSMC (1<<18)
··· 86 #define S3C2443_HCLKCON_LCDC (1<<9) 87 #define S3C2443_HCLKCON_USBH (1<<11) 88 #define S3C2443_HCLKCON_USBD (1<<12) 89 + #define S3C2416_HCLKCON_HSMMC0 (1<<15) 90 #define S3C2443_HCLKCON_HSMMC (1<<16) 91 #define S3C2443_HCLKCON_CFC (1<<17) 92 #define S3C2443_HCLKCON_SSMC (1<<18)
+25 -25
arch/arm/mach-s3c2412/irq.c
··· 49 */ 50 51 static void 52 - s3c2412_irq_mask(unsigned int irqno) 53 { 54 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 55 unsigned long mask; 56 57 mask = __raw_readl(S3C2410_INTMSK); ··· 62 } 63 64 static inline void 65 - s3c2412_irq_ack(unsigned int irqno) 66 { 67 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 68 69 __raw_writel(bitval, S3C2412_EINTPEND); 70 __raw_writel(bitval, S3C2410_SRCPND); ··· 72 } 73 74 static inline void 75 - s3c2412_irq_maskack(unsigned int irqno) 76 { 77 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 78 unsigned long mask; 79 80 mask = __raw_readl(S3C2410_INTMSK); ··· 89 } 90 91 static void 92 - s3c2412_irq_unmask(unsigned int irqno) 93 { 94 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 95 unsigned long mask; 96 97 mask = __raw_readl(S3C2412_EINTMASK); ··· 102 } 103 104 static struct irq_chip s3c2412_irq_eint0t4 = { 105 - .ack = s3c2412_irq_ack, 106 - .mask = s3c2412_irq_mask, 107 - .unmask = s3c2412_irq_unmask, 108 - .set_wake = s3c_irq_wake, 109 - .set_type = s3c_irqext_type, 110 }; 111 112 #define INTBIT(x) (1 << ((x) - S3C2410_IRQSUB(0))) ··· 132 #define INTMSK_CFSDI (1UL << (IRQ_S3C2412_CFSDI - IRQ_EINT0)) 133 #define SUBMSK_CFSDI INTMSK_SUB(IRQ_S3C2412_SDI, IRQ_S3C2412_CF) 134 135 - static void s3c2412_irq_cfsdi_mask(unsigned int irqno) 136 { 137 - s3c_irqsub_mask(irqno, INTMSK_CFSDI, SUBMSK_CFSDI); 138 } 139 140 - static void s3c2412_irq_cfsdi_unmask(unsigned int irqno) 141 { 142 - s3c_irqsub_unmask(irqno, INTMSK_CFSDI); 143 } 144 145 - static void s3c2412_irq_cfsdi_ack(unsigned int irqno) 146 { 147 - s3c_irqsub_maskack(irqno, INTMSK_CFSDI, SUBMSK_CFSDI); 148 } 149 150 static struct irq_chip s3c2412_irq_cfsdi = { 151 .name = "s3c2412-cfsdi", 152 - .ack = s3c2412_irq_cfsdi_ack, 153 - .mask = s3c2412_irq_cfsdi_mask, 154 - .unmask = s3c2412_irq_cfsdi_unmask, 155 }; 156 157 - static int s3c2412_irq_rtc_wake(unsigned int irqno, unsigned int state) 158 { 159 unsigned long pwrcfg; 160 ··· 165 pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ; 166 __raw_writel(pwrcfg, S3C2412_PWRCFG); 167 168 - return s3c_irq_chip.set_wake(irqno, state); 169 } 170 171 static struct irq_chip s3c2412_irq_rtc_chip; ··· 193 /* change RTC IRQ's set wake method */ 194 195 s3c2412_irq_rtc_chip = s3c_irq_chip; 196 - s3c2412_irq_rtc_chip.set_wake = s3c2412_irq_rtc_wake; 197 198 set_irq_chip(IRQ_RTC, &s3c2412_irq_rtc_chip); 199
··· 49 */ 50 51 static void 52 + s3c2412_irq_mask(struct irq_data *data) 53 { 54 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 55 unsigned long mask; 56 57 mask = __raw_readl(S3C2410_INTMSK); ··· 62 } 63 64 static inline void 65 + s3c2412_irq_ack(struct irq_data *data) 66 { 67 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 68 69 __raw_writel(bitval, S3C2412_EINTPEND); 70 __raw_writel(bitval, S3C2410_SRCPND); ··· 72 } 73 74 static inline void 75 + s3c2412_irq_maskack(struct irq_data *data) 76 { 77 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 78 unsigned long mask; 79 80 mask = __raw_readl(S3C2410_INTMSK); ··· 89 } 90 91 static void 92 + s3c2412_irq_unmask(struct irq_data *data) 93 { 94 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 95 unsigned long mask; 96 97 mask = __raw_readl(S3C2412_EINTMASK); ··· 102 } 103 104 static struct irq_chip s3c2412_irq_eint0t4 = { 105 + .irq_ack = s3c2412_irq_ack, 106 + .irq_mask = s3c2412_irq_mask, 107 + .irq_unmask = s3c2412_irq_unmask, 108 + .irq_set_wake = s3c_irq_wake, 109 + .irq_set_type = s3c_irqext_type, 110 }; 111 112 #define INTBIT(x) (1 << ((x) - S3C2410_IRQSUB(0))) ··· 132 #define INTMSK_CFSDI (1UL << (IRQ_S3C2412_CFSDI - IRQ_EINT0)) 133 #define SUBMSK_CFSDI INTMSK_SUB(IRQ_S3C2412_SDI, IRQ_S3C2412_CF) 134 135 + static void s3c2412_irq_cfsdi_mask(struct irq_data *data) 136 { 137 + s3c_irqsub_mask(data->irq, INTMSK_CFSDI, SUBMSK_CFSDI); 138 } 139 140 + static void s3c2412_irq_cfsdi_unmask(struct irq_data *data) 141 { 142 + s3c_irqsub_unmask(data->irq, INTMSK_CFSDI); 143 } 144 145 + static void s3c2412_irq_cfsdi_ack(struct irq_data *data) 146 { 147 + s3c_irqsub_maskack(data->irq, INTMSK_CFSDI, SUBMSK_CFSDI); 148 } 149 150 static struct irq_chip s3c2412_irq_cfsdi = { 151 .name = "s3c2412-cfsdi", 152 + .irq_ack = s3c2412_irq_cfsdi_ack, 153 + .irq_mask = s3c2412_irq_cfsdi_mask, 154 + .irq_unmask = s3c2412_irq_cfsdi_unmask, 155 }; 156 157 + static int s3c2412_irq_rtc_wake(struct irq_data *data, unsigned int state) 158 { 159 unsigned long pwrcfg; 160 ··· 165 pwrcfg |= S3C2412_PWRCFG_RTC_MASKIRQ; 166 __raw_writel(pwrcfg, S3C2412_PWRCFG); 167 168 + return s3c_irq_chip.irq_set_wake(data, state); 169 } 170 171 static struct irq_chip s3c2412_irq_rtc_chip; ··· 193 /* change RTC IRQ's set wake method */ 194 195 s3c2412_irq_rtc_chip = s3c_irq_chip; 196 + s3c2412_irq_rtc_chip.irq_set_wake = s3c2412_irq_rtc_wake; 197 198 set_irq_chip(IRQ_RTC, &s3c2412_irq_rtc_chip); 199
+12
arch/arm/mach-s3c2416/Kconfig
··· 31 help 32 Internal config node to apply S3C2416 power management 33 34 menu "S3C2416 Machines" 35 36 config MACH_SMDK2416 ··· 53 select S3C_DEV_HSMMC1 54 select S3C_DEV_NAND 55 select S3C_DEV_USB_HOST 56 select S3C2416_PM if PM 57 help 58 Say Y here if you are using an SMDK2416
··· 31 help 32 Internal config node to apply S3C2416 power management 33 34 + config S3C2416_SETUP_SDHCI 35 + bool 36 + select S3C2416_SETUP_SDHCI_GPIO 37 + help 38 + Internal helper functions for S3C2416 based SDHCI systems 39 + 40 + config S3C2416_SETUP_SDHCI_GPIO 41 + bool 42 + help 43 + Common setup code for SDHCI gpio. 44 + 45 menu "S3C2416 Machines" 46 47 config MACH_SMDK2416 ··· 42 select S3C_DEV_HSMMC1 43 select S3C_DEV_NAND 44 select S3C_DEV_USB_HOST 45 + select S3C2416_SETUP_SDHCI 46 select S3C2416_PM if PM 47 help 48 Say Y here if you are using an SMDK2416
+4
arch/arm/mach-s3c2416/Makefile
··· 14 obj-$(CONFIG_S3C2416_PM) += pm.o 15 #obj-$(CONFIG_S3C2416_DMA) += dma.o 16 17 # Machine support 18 19 obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
··· 14 obj-$(CONFIG_S3C2416_PM) += pm.o 15 #obj-$(CONFIG_S3C2416_DMA) += dma.o 16 17 + # Device setup 18 + obj-$(CONFIG_S3C2416_SETUP_SDHCI) += setup-sdhci.o 19 + obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o 20 + 21 # Machine support 22 23 obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
+13 -5
arch/arm/mach-s3c2416/clock.c
··· 38 [7] = 8, 39 }; 40 41 - /* ID to hardware numbering, 0 is HSMMC1, 1 is HSMMC0 */ 42 static struct clksrc_clk hsmmc_div[] = { 43 [0] = { 44 .clk = { 45 .name = "hsmmc-div", 46 - .id = 1, 47 .parent = &clk_esysclk.clk, 48 }, 49 .reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 }, ··· 50 [1] = { 51 .clk = { 52 .name = "hsmmc-div", 53 - .id = 0, 54 .parent = &clk_esysclk.clk, 55 }, 56 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, ··· 60 static struct clksrc_clk hsmmc_mux[] = { 61 [0] = { 62 .clk = { 63 - .id = 1, 64 .name = "hsmmc-if", 65 .ctrlbit = (1 << 6), 66 .enable = s3c2443_clkcon_enable_s, ··· 76 }, 77 [1] = { 78 .clk = { 79 - .id = 0, 80 .name = "hsmmc-if", 81 .ctrlbit = (1 << 12), 82 .enable = s3c2443_clkcon_enable_s, ··· 92 }, 93 }; 94 95 96 static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0) 97 { ··· 135 136 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) 137 s3c_register_clksrc(clksrcs[ptr], 1); 138 139 s3c_pwmclk_init(); 140
··· 38 [7] = 8, 39 }; 40 41 static struct clksrc_clk hsmmc_div[] = { 42 [0] = { 43 .clk = { 44 .name = "hsmmc-div", 45 + .id = 0, 46 .parent = &clk_esysclk.clk, 47 }, 48 .reg_div = { .reg = S3C2416_CLKDIV2, .size = 2, .shift = 6 }, ··· 51 [1] = { 52 .clk = { 53 .name = "hsmmc-div", 54 + .id = 1, 55 .parent = &clk_esysclk.clk, 56 }, 57 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, ··· 61 static struct clksrc_clk hsmmc_mux[] = { 62 [0] = { 63 .clk = { 64 + .id = 0, 65 .name = "hsmmc-if", 66 .ctrlbit = (1 << 6), 67 .enable = s3c2443_clkcon_enable_s, ··· 77 }, 78 [1] = { 79 .clk = { 80 + .id = 1, 81 .name = "hsmmc-if", 82 .ctrlbit = (1 << 12), 83 .enable = s3c2443_clkcon_enable_s, ··· 93 }, 94 }; 95 96 + static struct clk hsmmc0_clk = { 97 + .name = "hsmmc", 98 + .id = 0, 99 + .parent = &clk_h, 100 + .enable = s3c2443_clkcon_enable_h, 101 + .ctrlbit = S3C2416_HCLKCON_HSMMC0, 102 + }; 103 104 static inline unsigned int s3c2416_fclk_div(unsigned long clkcon0) 105 { ··· 129 130 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) 131 s3c_register_clksrc(clksrcs[ptr], 1); 132 + 133 + s3c24xx_register_clock(&hsmmc0_clk); 134 135 s3c_pwmclk_init(); 136
+36 -40
arch/arm/mach-s3c2416/irq.c
··· 77 #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) 78 #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) 79 80 - static void s3c2416_irq_wdtac97_mask(unsigned int irqno) 81 { 82 - s3c_irqsub_mask(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 83 } 84 85 - static void s3c2416_irq_wdtac97_unmask(unsigned int irqno) 86 { 87 - s3c_irqsub_unmask(irqno, INTMSK_WDTAC97); 88 } 89 90 - static void s3c2416_irq_wdtac97_ack(unsigned int irqno) 91 { 92 - s3c_irqsub_maskack(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 93 } 94 95 static struct irq_chip s3c2416_irq_wdtac97 = { 96 - .mask = s3c2416_irq_wdtac97_mask, 97 - .unmask = s3c2416_irq_wdtac97_unmask, 98 - .ack = s3c2416_irq_wdtac97_ack, 99 }; 100 - 101 102 /* LCD sub interrupts */ 103 ··· 108 #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) 109 #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) 110 111 - static void s3c2416_irq_lcd_mask(unsigned int irqno) 112 { 113 - s3c_irqsub_mask(irqno, INTMSK_LCD, SUBMSK_LCD); 114 } 115 116 - static void s3c2416_irq_lcd_unmask(unsigned int irqno) 117 { 118 - s3c_irqsub_unmask(irqno, INTMSK_LCD); 119 } 120 121 - static void s3c2416_irq_lcd_ack(unsigned int irqno) 122 { 123 - s3c_irqsub_maskack(irqno, INTMSK_LCD, SUBMSK_LCD); 124 } 125 126 static struct irq_chip s3c2416_irq_lcd = { 127 - .mask = s3c2416_irq_lcd_mask, 128 - .unmask = s3c2416_irq_lcd_unmask, 129 - .ack = s3c2416_irq_lcd_ack, 130 }; 131 - 132 133 /* DMA sub interrupts */ 134 ··· 140 #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) 141 142 143 - static void s3c2416_irq_dma_mask(unsigned int irqno) 144 { 145 - s3c_irqsub_mask(irqno, INTMSK_DMA, SUBMSK_DMA); 146 } 147 148 - static void s3c2416_irq_dma_unmask(unsigned int irqno) 149 { 150 - s3c_irqsub_unmask(irqno, INTMSK_DMA); 151 } 152 153 - static void s3c2416_irq_dma_ack(unsigned int irqno) 154 { 155 - s3c_irqsub_maskack(irqno, INTMSK_DMA, SUBMSK_DMA); 156 } 157 158 static struct irq_chip s3c2416_irq_dma = { 159 - .mask = s3c2416_irq_dma_mask, 160 - .unmask = s3c2416_irq_dma_unmask, 161 - .ack = s3c2416_irq_dma_ack, 162 }; 163 - 164 165 /* UART3 sub interrupts */ 166 ··· 171 #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) 172 #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) 173 174 - static void s3c2416_irq_uart3_mask(unsigned int irqno) 175 { 176 - s3c_irqsub_mask(irqno, INTMSK_UART3, SUBMSK_UART3); 177 } 178 179 - static void s3c2416_irq_uart3_unmask(unsigned int irqno) 180 { 181 - s3c_irqsub_unmask(irqno, INTMSK_UART3); 182 } 183 184 - static void s3c2416_irq_uart3_ack(unsigned int irqno) 185 { 186 - s3c_irqsub_maskack(irqno, INTMSK_UART3, SUBMSK_UART3); 187 } 188 189 static struct irq_chip s3c2416_irq_uart3 = { 190 - .mask = s3c2416_irq_uart3_mask, 191 - .unmask = s3c2416_irq_uart3_unmask, 192 - .ack = s3c2416_irq_uart3_ack, 193 }; 194 - 195 196 /* IRQ initialisation code */ 197
··· 77 #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) 78 #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) 79 80 + static void s3c2416_irq_wdtac97_mask(struct irq_data *data) 81 { 82 + s3c_irqsub_mask(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 83 } 84 85 + static void s3c2416_irq_wdtac97_unmask(struct irq_data *data) 86 { 87 + s3c_irqsub_unmask(data->irq, INTMSK_WDTAC97); 88 } 89 90 + static void s3c2416_irq_wdtac97_ack(struct irq_data *data) 91 { 92 + s3c_irqsub_maskack(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 93 } 94 95 static struct irq_chip s3c2416_irq_wdtac97 = { 96 + .irq_mask = s3c2416_irq_wdtac97_mask, 97 + .irq_unmask = s3c2416_irq_wdtac97_unmask, 98 + .irq_ack = s3c2416_irq_wdtac97_ack, 99 }; 100 101 /* LCD sub interrupts */ 102 ··· 109 #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) 110 #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) 111 112 + static void s3c2416_irq_lcd_mask(struct irq_data *data) 113 { 114 + s3c_irqsub_mask(data->irq, INTMSK_LCD, SUBMSK_LCD); 115 } 116 117 + static void s3c2416_irq_lcd_unmask(struct irq_data *data) 118 { 119 + s3c_irqsub_unmask(data->irq, INTMSK_LCD); 120 } 121 122 + static void s3c2416_irq_lcd_ack(struct irq_data *data) 123 { 124 + s3c_irqsub_maskack(data->irq, INTMSK_LCD, SUBMSK_LCD); 125 } 126 127 static struct irq_chip s3c2416_irq_lcd = { 128 + .irq_mask = s3c2416_irq_lcd_mask, 129 + .irq_unmask = s3c2416_irq_lcd_unmask, 130 + .irq_ack = s3c2416_irq_lcd_ack, 131 }; 132 133 /* DMA sub interrupts */ 134 ··· 142 #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) 143 144 145 + static void s3c2416_irq_dma_mask(struct irq_data *data) 146 { 147 + s3c_irqsub_mask(data->irq, INTMSK_DMA, SUBMSK_DMA); 148 } 149 150 + static void s3c2416_irq_dma_unmask(struct irq_data *data) 151 { 152 + s3c_irqsub_unmask(data->irq, INTMSK_DMA); 153 } 154 155 + static void s3c2416_irq_dma_ack(struct irq_data *data) 156 { 157 + s3c_irqsub_maskack(data->irq, INTMSK_DMA, SUBMSK_DMA); 158 } 159 160 static struct irq_chip s3c2416_irq_dma = { 161 + .irq_mask = s3c2416_irq_dma_mask, 162 + .irq_unmask = s3c2416_irq_dma_unmask, 163 + .irq_ack = s3c2416_irq_dma_ack, 164 }; 165 166 /* UART3 sub interrupts */ 167 ··· 174 #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) 175 #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) 176 177 + static void s3c2416_irq_uart3_mask(struct irq_data *data) 178 { 179 + s3c_irqsub_mask(data->irq, INTMSK_UART3, SUBMSK_UART3); 180 } 181 182 + static void s3c2416_irq_uart3_unmask(struct irq_data *data) 183 { 184 + s3c_irqsub_unmask(data->irq, INTMSK_UART3); 185 } 186 187 + static void s3c2416_irq_uart3_ack(struct irq_data *data) 188 { 189 + s3c_irqsub_maskack(data->irq, INTMSK_UART3, SUBMSK_UART3); 190 } 191 192 static struct irq_chip s3c2416_irq_uart3 = { 193 + .irq_mask = s3c2416_irq_uart3_mask, 194 + .irq_unmask = s3c2416_irq_uart3_unmask, 195 + .irq_ack = s3c2416_irq_uart3_ack, 196 }; 197 198 /* IRQ initialisation code */ 199
+23
arch/arm/mach-s3c2416/mach-smdk2416.c
··· 46 #include <plat/devs.h> 47 #include <plat/cpu.h> 48 #include <plat/nand.h> 49 50 #include <plat/regs-fb-v4.h> 51 #include <plat/fb.h> ··· 111 .ucon = UCON, 112 .ulcon = ULCON | 0x50, 113 .ufcon = UFCON, 114 } 115 }; 116 ··· 167 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 168 }; 169 170 static struct platform_device *smdk2416_devices[] __initdata = { 171 &s3c_device_fb, 172 &s3c_device_wdt, ··· 199 { 200 s3c_i2c0_set_platdata(NULL); 201 s3c_fb_set_platdata(&smdk2416_fb_platdata); 202 203 gpio_request(S3C2410_GPB(4), "USBHost Power"); 204 gpio_direction_output(S3C2410_GPB(4), 1);
··· 46 #include <plat/devs.h> 47 #include <plat/cpu.h> 48 #include <plat/nand.h> 49 + #include <plat/sdhci.h> 50 51 #include <plat/regs-fb-v4.h> 52 #include <plat/fb.h> ··· 110 .ucon = UCON, 111 .ulcon = ULCON | 0x50, 112 .ufcon = UFCON, 113 + }, 114 + [3] = { 115 + .hwport = 3, 116 + .flags = 0, 117 + .ucon = UCON, 118 + .ulcon = ULCON, 119 + .ufcon = UFCON, 120 } 121 }; 122 ··· 159 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 160 }; 161 162 + static struct s3c_sdhci_platdata smdk2416_hsmmc0_pdata __initdata = { 163 + .max_width = 4, 164 + .cd_type = S3C_SDHCI_CD_GPIO, 165 + .ext_cd_gpio = S3C2410_GPF(1), 166 + .ext_cd_gpio_invert = 1, 167 + }; 168 + 169 + static struct s3c_sdhci_platdata smdk2416_hsmmc1_pdata __initdata = { 170 + .max_width = 4, 171 + .cd_type = S3C_SDHCI_CD_NONE, 172 + }; 173 + 174 static struct platform_device *smdk2416_devices[] __initdata = { 175 &s3c_device_fb, 176 &s3c_device_wdt, ··· 179 { 180 s3c_i2c0_set_platdata(NULL); 181 s3c_fb_set_platdata(&smdk2416_fb_platdata); 182 + 183 + s3c_sdhci0_set_platdata(&smdk2416_hsmmc0_pdata); 184 + s3c_sdhci1_set_platdata(&smdk2416_hsmmc1_pdata); 185 186 gpio_request(S3C2410_GPB(4), "USBHost Power"); 187 gpio_direction_output(S3C2410_GPB(4), 1);
+5
arch/arm/mach-s3c2416/s3c2416.c
··· 53 #include <plat/s3c2416.h> 54 #include <plat/devs.h> 55 #include <plat/cpu.h> 56 57 #include <plat/iic-core.h> 58 #include <plat/fb-core.h> ··· 115 { 116 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown; 117 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown; 118 119 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); 120 }
··· 53 #include <plat/s3c2416.h> 54 #include <plat/devs.h> 55 #include <plat/cpu.h> 56 + #include <plat/sdhci.h> 57 58 #include <plat/iic-core.h> 59 #include <plat/fb-core.h> ··· 114 { 115 s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_updown; 116 s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_updown; 117 + 118 + /* initialize device information early */ 119 + s3c2416_default_sdhci0(); 120 + s3c2416_default_sdhci1(); 121 122 iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); 123 }
+34
arch/arm/mach-s3c2416/setup-sdhci-gpio.c
···
··· 1 + /* linux/arch/arm/plat-s3c2416/setup-sdhci-gpio.c 2 + * 3 + * Copyright 2010 Promwad Innovation Company 4 + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> 5 + * 6 + * S3C2416 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC) 7 + * 8 + * Based on mach-s3c64xx/setup-sdhci-gpio.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 <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 + #include <linux/gpio.h> 21 + 22 + #include <mach/regs-gpio.h> 23 + #include <plat/gpio-cfg.h> 24 + 25 + void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) 26 + { 27 + s3c_gpio_cfgrange_nopull(S3C2410_GPE(5), 2 + width, S3C_GPIO_SFN(2)); 28 + } 29 + 30 + void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) 31 + { 32 + s3c_gpio_cfgrange_nopull(S3C2410_GPL(0), width, S3C_GPIO_SFN(2)); 33 + s3c_gpio_cfgrange_nopull(S3C2410_GPL(8), 2, S3C_GPIO_SFN(2)); 34 + }
+61
arch/arm/mach-s3c2416/setup-sdhci.c
···
··· 1 + /* linux/arch/arm/mach-s3c2416/setup-sdhci.c 2 + * 3 + * Copyright 2010 Promwad Innovation Company 4 + * Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> 5 + * 6 + * S3C2416 - Helper functions for settign up SDHCI device(s) (HSMMC) 7 + * 8 + * Based on mach-s3c64xx/setup-sdhci.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 <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 *s3c2416_hsmmc_clksrcs[4] = { 30 + [0] = "hsmmc", 31 + [1] = "hsmmc", 32 + [2] = "hsmmc-if", 33 + /* [3] = "48m", - note not successfully used yet */ 34 + }; 35 + 36 + void s3c2416_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 = __raw_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 + __raw_writel(ctrl2, r + S3C_SDHCI_CONTROL2); 60 + __raw_writel(ctrl3, r + S3C_SDHCI_CONTROL3); 61 + }
+9 -9
arch/arm/mach-s3c2440/irq.c
··· 69 #define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0)) 70 71 static void 72 - s3c_irq_wdtac97_mask(unsigned int irqno) 73 { 74 - s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13); 75 } 76 77 static void 78 - s3c_irq_wdtac97_unmask(unsigned int irqno) 79 { 80 - s3c_irqsub_unmask(irqno, INTMSK_WDT); 81 } 82 83 static void 84 - s3c_irq_wdtac97_ack(unsigned int irqno) 85 { 86 - s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13); 87 } 88 89 static struct irq_chip s3c_irq_wdtac97 = { 90 - .mask = s3c_irq_wdtac97_mask, 91 - .unmask = s3c_irq_wdtac97_unmask, 92 - .ack = s3c_irq_wdtac97_ack, 93 }; 94 95 static int s3c2440_irq_add(struct sys_device *sysdev)
··· 69 #define INTMSK_WDT (1UL << (IRQ_WDT - IRQ_EINT0)) 70 71 static void 72 + s3c_irq_wdtac97_mask(struct irq_data *data) 73 { 74 + s3c_irqsub_mask(data->irq, INTMSK_WDT, 3 << 13); 75 } 76 77 static void 78 + s3c_irq_wdtac97_unmask(struct irq_data *data) 79 { 80 + s3c_irqsub_unmask(data->irq, INTMSK_WDT); 81 } 82 83 static void 84 + s3c_irq_wdtac97_ack(struct irq_data *data) 85 { 86 + s3c_irqsub_maskack(data->irq, INTMSK_WDT, 3 << 13); 87 } 88 89 static struct irq_chip s3c_irq_wdtac97 = { 90 + .irq_mask = s3c_irq_wdtac97_mask, 91 + .irq_unmask = s3c_irq_wdtac97_unmask, 92 + .irq_ack = s3c_irq_wdtac97_ack, 93 }; 94 95 static int s3c2440_irq_add(struct sys_device *sysdev)
+9 -9
arch/arm/mach-s3c2440/s3c244x-irq.c
··· 68 #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) 69 70 static void 71 - s3c_irq_cam_mask(unsigned int irqno) 72 { 73 - s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11); 74 } 75 76 static void 77 - s3c_irq_cam_unmask(unsigned int irqno) 78 { 79 - s3c_irqsub_unmask(irqno, INTMSK_CAM); 80 } 81 82 static void 83 - s3c_irq_cam_ack(unsigned int irqno) 84 { 85 - s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11); 86 } 87 88 static struct irq_chip s3c_irq_cam = { 89 - .mask = s3c_irq_cam_mask, 90 - .unmask = s3c_irq_cam_unmask, 91 - .ack = s3c_irq_cam_ack, 92 }; 93 94 static int s3c244x_irq_add(struct sys_device *sysdev)
··· 68 #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) 69 70 static void 71 + s3c_irq_cam_mask(struct irq_data *data) 72 { 73 + s3c_irqsub_mask(data->irq, INTMSK_CAM, 3 << 11); 74 } 75 76 static void 77 + s3c_irq_cam_unmask(struct irq_data *data) 78 { 79 + s3c_irqsub_unmask(data->irq, INTMSK_CAM); 80 } 81 82 static void 83 + s3c_irq_cam_ack(struct irq_data *data) 84 { 85 + s3c_irqsub_maskack(data->irq, INTMSK_CAM, 3 << 11); 86 } 87 88 static struct irq_chip s3c_irq_cam = { 89 + .irq_mask = s3c_irq_cam_mask, 90 + .irq_unmask = s3c_irq_cam_unmask, 91 + .irq_ack = s3c_irq_cam_ack, 92 }; 93 94 static int s3c244x_irq_add(struct sys_device *sysdev)
+2 -1
arch/arm/mach-s3c2443/Kconfig
··· 10 select CPU_LLSERIAL_S3C2440 11 select SAMSUNG_CLKSRC 12 select S3C2443_CLOCK 13 help 14 Support for the S3C2443 SoC from the S3C24XX line 15 ··· 26 bool "SMDK2443" 27 select CPU_S3C2443 28 select MACH_SMDK 29 - select S3C_DEV_HSMMC 30 help 31 Say Y here if you are using an SMDK2443 32
··· 10 select CPU_LLSERIAL_S3C2440 11 select SAMSUNG_CLKSRC 12 select S3C2443_CLOCK 13 + select S3C_GPIO_PULL_S3C2443 14 help 15 Support for the S3C2443 SoC from the S3C24XX line 16 ··· 25 bool "SMDK2443" 26 select CPU_S3C2443 27 select MACH_SMDK 28 + select S3C_DEV_HSMMC1 29 help 30 Say Y here if you are using an SMDK2443 31
+2 -2
arch/arm/mach-s3c2443/clock.c
··· 196 static struct clksrc_clk clk_hsmmc_div = { 197 .clk = { 198 .name = "hsmmc-div", 199 - .id = -1, 200 .parent = &clk_esysclk.clk, 201 }, 202 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, ··· 231 232 static struct clk clk_hsmmc = { 233 .name = "hsmmc-if", 234 - .id = -1, 235 .parent = &clk_hsmmc_div.clk, 236 .enable = s3c2443_enable_hsmmc, 237 .ops = &(struct clk_ops) {
··· 196 static struct clksrc_clk clk_hsmmc_div = { 197 .clk = { 198 .name = "hsmmc-div", 199 + .id = 1, 200 .parent = &clk_esysclk.clk, 201 }, 202 .reg_div = { .reg = S3C2443_CLKDIV1, .size = 2, .shift = 6 }, ··· 231 232 static struct clk clk_hsmmc = { 233 .name = "hsmmc-if", 234 + .id = 1, 235 .parent = &clk_hsmmc_div.clk, 236 .enable = s3c2443_enable_hsmmc, 237 .ops = &(struct clk_ops) {
+45 -50
arch/arm/mach-s3c2443/irq.c
··· 75 #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) 76 #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) 77 78 - static void s3c2443_irq_wdtac97_mask(unsigned int irqno) 79 { 80 - s3c_irqsub_mask(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 81 } 82 83 - static void s3c2443_irq_wdtac97_unmask(unsigned int irqno) 84 { 85 - s3c_irqsub_unmask(irqno, INTMSK_WDTAC97); 86 } 87 88 - static void s3c2443_irq_wdtac97_ack(unsigned int irqno) 89 { 90 - s3c_irqsub_maskack(irqno, INTMSK_WDTAC97, SUBMSK_WDTAC97); 91 } 92 93 static struct irq_chip s3c2443_irq_wdtac97 = { 94 - .mask = s3c2443_irq_wdtac97_mask, 95 - .unmask = s3c2443_irq_wdtac97_unmask, 96 - .ack = s3c2443_irq_wdtac97_ack, 97 }; 98 - 99 100 /* LCD sub interrupts */ 101 ··· 106 #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) 107 #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) 108 109 - static void s3c2443_irq_lcd_mask(unsigned int irqno) 110 { 111 - s3c_irqsub_mask(irqno, INTMSK_LCD, SUBMSK_LCD); 112 } 113 114 - static void s3c2443_irq_lcd_unmask(unsigned int irqno) 115 { 116 - s3c_irqsub_unmask(irqno, INTMSK_LCD); 117 } 118 119 - static void s3c2443_irq_lcd_ack(unsigned int irqno) 120 { 121 - s3c_irqsub_maskack(irqno, INTMSK_LCD, SUBMSK_LCD); 122 } 123 124 static struct irq_chip s3c2443_irq_lcd = { 125 - .mask = s3c2443_irq_lcd_mask, 126 - .unmask = s3c2443_irq_lcd_unmask, 127 - .ack = s3c2443_irq_lcd_ack, 128 }; 129 - 130 131 /* DMA sub interrupts */ 132 ··· 137 #define INTMSK_DMA (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0)) 138 #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) 139 140 - 141 - static void s3c2443_irq_dma_mask(unsigned int irqno) 142 { 143 - s3c_irqsub_mask(irqno, INTMSK_DMA, SUBMSK_DMA); 144 } 145 146 - static void s3c2443_irq_dma_unmask(unsigned int irqno) 147 { 148 - s3c_irqsub_unmask(irqno, INTMSK_DMA); 149 } 150 151 - static void s3c2443_irq_dma_ack(unsigned int irqno) 152 { 153 - s3c_irqsub_maskack(irqno, INTMSK_DMA, SUBMSK_DMA); 154 } 155 156 static struct irq_chip s3c2443_irq_dma = { 157 - .mask = s3c2443_irq_dma_mask, 158 - .unmask = s3c2443_irq_dma_unmask, 159 - .ack = s3c2443_irq_dma_ack, 160 }; 161 - 162 163 /* UART3 sub interrupts */ 164 ··· 168 #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) 169 #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) 170 171 - static void s3c2443_irq_uart3_mask(unsigned int irqno) 172 { 173 - s3c_irqsub_mask(irqno, INTMSK_UART3, SUBMSK_UART3); 174 } 175 176 - static void s3c2443_irq_uart3_unmask(unsigned int irqno) 177 { 178 - s3c_irqsub_unmask(irqno, INTMSK_UART3); 179 } 180 181 - static void s3c2443_irq_uart3_ack(unsigned int irqno) 182 { 183 - s3c_irqsub_maskack(irqno, INTMSK_UART3, SUBMSK_UART3); 184 } 185 186 static struct irq_chip s3c2443_irq_uart3 = { 187 - .mask = s3c2443_irq_uart3_mask, 188 - .unmask = s3c2443_irq_uart3_unmask, 189 - .ack = s3c2443_irq_uart3_ack, 190 }; 191 - 192 193 /* CAM sub interrupts */ 194 ··· 199 #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) 200 #define SUBMSK_CAM INTMSK(IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P) 201 202 - static void s3c2443_irq_cam_mask(unsigned int irqno) 203 { 204 - s3c_irqsub_mask(irqno, INTMSK_CAM, SUBMSK_CAM); 205 } 206 207 - static void s3c2443_irq_cam_unmask(unsigned int irqno) 208 { 209 - s3c_irqsub_unmask(irqno, INTMSK_CAM); 210 } 211 212 - static void s3c2443_irq_cam_ack(unsigned int irqno) 213 { 214 - s3c_irqsub_maskack(irqno, INTMSK_CAM, SUBMSK_CAM); 215 } 216 217 static struct irq_chip s3c2443_irq_cam = { 218 - .mask = s3c2443_irq_cam_mask, 219 - .unmask = s3c2443_irq_cam_unmask, 220 - .ack = s3c2443_irq_cam_ack, 221 }; 222 223 /* IRQ initialisation code */
··· 75 #define INTMSK_WDTAC97 (1UL << (IRQ_WDT - IRQ_EINT0)) 76 #define SUBMSK_WDTAC97 INTMSK(IRQ_S3C2443_WDT, IRQ_S3C2443_AC97) 77 78 + static void s3c2443_irq_wdtac97_mask(struct irq_data *data) 79 { 80 + s3c_irqsub_mask(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 81 } 82 83 + static void s3c2443_irq_wdtac97_unmask(struct irq_data *data) 84 { 85 + s3c_irqsub_unmask(data->irq, INTMSK_WDTAC97); 86 } 87 88 + static void s3c2443_irq_wdtac97_ack(struct irq_data *data) 89 { 90 + s3c_irqsub_maskack(data->irq, INTMSK_WDTAC97, SUBMSK_WDTAC97); 91 } 92 93 static struct irq_chip s3c2443_irq_wdtac97 = { 94 + .irq_mask = s3c2443_irq_wdtac97_mask, 95 + .irq_unmask = s3c2443_irq_wdtac97_unmask, 96 + .irq_ack = s3c2443_irq_wdtac97_ack, 97 }; 98 99 /* LCD sub interrupts */ 100 ··· 107 #define INTMSK_LCD (1UL << (IRQ_LCD - IRQ_EINT0)) 108 #define SUBMSK_LCD INTMSK(IRQ_S3C2443_LCD1, IRQ_S3C2443_LCD4) 109 110 + static void s3c2443_irq_lcd_mask(struct irq_data *data) 111 { 112 + s3c_irqsub_mask(data->irq, INTMSK_LCD, SUBMSK_LCD); 113 } 114 115 + static void s3c2443_irq_lcd_unmask(struct irq_data *data) 116 { 117 + s3c_irqsub_unmask(data->irq, INTMSK_LCD); 118 } 119 120 + static void s3c2443_irq_lcd_ack(struct irq_data *data) 121 { 122 + s3c_irqsub_maskack(data->irq, INTMSK_LCD, SUBMSK_LCD); 123 } 124 125 static struct irq_chip s3c2443_irq_lcd = { 126 + .irq_mask = s3c2443_irq_lcd_mask, 127 + .irq_unmask = s3c2443_irq_lcd_unmask, 128 + .irq_ack = s3c2443_irq_lcd_ack, 129 }; 130 131 /* DMA sub interrupts */ 132 ··· 139 #define INTMSK_DMA (1UL << (IRQ_S3C2443_DMA - IRQ_EINT0)) 140 #define SUBMSK_DMA INTMSK(IRQ_S3C2443_DMA0, IRQ_S3C2443_DMA5) 141 142 + static void s3c2443_irq_dma_mask(struct irq_data *data) 143 { 144 + s3c_irqsub_mask(data->irq, INTMSK_DMA, SUBMSK_DMA); 145 } 146 147 + static void s3c2443_irq_dma_unmask(struct irq_data *data) 148 { 149 + s3c_irqsub_unmask(data->irq, INTMSK_DMA); 150 } 151 152 + static void s3c2443_irq_dma_ack(struct irq_data *data) 153 { 154 + s3c_irqsub_maskack(data->irq, INTMSK_DMA, SUBMSK_DMA); 155 } 156 157 static struct irq_chip s3c2443_irq_dma = { 158 + .irq_mask = s3c2443_irq_dma_mask, 159 + .irq_unmask = s3c2443_irq_dma_unmask, 160 + .irq_ack = s3c2443_irq_dma_ack, 161 }; 162 163 /* UART3 sub interrupts */ 164 ··· 172 #define INTMSK_UART3 (1UL << (IRQ_S3C2443_UART3 - IRQ_EINT0)) 173 #define SUBMSK_UART3 (0x7 << (IRQ_S3C2443_RX3 - S3C2410_IRQSUB(0))) 174 175 + static void s3c2443_irq_uart3_mask(struct irq_data *data) 176 { 177 + s3c_irqsub_mask(data->irq, INTMSK_UART3, SUBMSK_UART3); 178 } 179 180 + static void s3c2443_irq_uart3_unmask(struct irq_data *data) 181 { 182 + s3c_irqsub_unmask(data->irq, INTMSK_UART3); 183 } 184 185 + static void s3c2443_irq_uart3_ack(struct irq_data *data) 186 { 187 + s3c_irqsub_maskack(data->irq, INTMSK_UART3, SUBMSK_UART3); 188 } 189 190 static struct irq_chip s3c2443_irq_uart3 = { 191 + .irq_mask = s3c2443_irq_uart3_mask, 192 + .irq_unmask = s3c2443_irq_uart3_unmask, 193 + .irq_ack = s3c2443_irq_uart3_ack, 194 }; 195 196 /* CAM sub interrupts */ 197 ··· 204 #define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0)) 205 #define SUBMSK_CAM INTMSK(IRQ_S3C2440_CAM_C, IRQ_S3C2440_CAM_P) 206 207 + static void s3c2443_irq_cam_mask(struct irq_data *data) 208 { 209 + s3c_irqsub_mask(data->irq, INTMSK_CAM, SUBMSK_CAM); 210 } 211 212 + static void s3c2443_irq_cam_unmask(struct irq_data *data) 213 { 214 + s3c_irqsub_unmask(data->irq, INTMSK_CAM); 215 } 216 217 + static void s3c2443_irq_cam_ack(struct irq_data *data) 218 { 219 + s3c_irqsub_maskack(data->irq, INTMSK_CAM, SUBMSK_CAM); 220 } 221 222 static struct irq_chip s3c2443_irq_cam = { 223 + .irq_mask = s3c2443_irq_cam_mask, 224 + .irq_unmask = s3c2443_irq_cam_unmask, 225 + .irq_ack = s3c2443_irq_cam_ack, 226 }; 227 228 /* IRQ initialisation code */
+8 -1
arch/arm/mach-s3c2443/mach-smdk2443.c
··· 99 .ucon = 0x3c5, 100 .ulcon = 0x43, 101 .ufcon = 0x51, 102 } 103 }; 104 105 static struct platform_device *smdk2443_devices[] __initdata = { 106 &s3c_device_wdt, 107 &s3c_device_i2c0, 108 - &s3c_device_hsmmc0, 109 #ifdef CONFIG_SND_SOC_SMDK2443_WM9710 110 &s3c_device_ac97, 111 #endif
··· 99 .ucon = 0x3c5, 100 .ulcon = 0x43, 101 .ufcon = 0x51, 102 + }, 103 + [3] = { 104 + .hwport = 3, 105 + .flags = 0, 106 + .ucon = 0x3c5, 107 + .ulcon = 0x03, 108 + .ufcon = 0x51, 109 } 110 }; 111 112 static struct platform_device *smdk2443_devices[] __initdata = { 113 &s3c_device_wdt, 114 &s3c_device_i2c0, 115 + &s3c_device_hsmmc1, 116 #ifdef CONFIG_SND_SOC_SMDK2443_WM9710 117 &s3c_device_ac97, 118 #endif
+7
arch/arm/mach-s3c2443/s3c2443.c
··· 16 #include <linux/list.h> 17 #include <linux/timer.h> 18 #include <linux/init.h> 19 #include <linux/platform_device.h> 20 #include <linux/serial_core.h> 21 #include <linux/sysdev.h> ··· 33 #include <mach/regs-s3c2443-clock.h> 34 #include <mach/reset.h> 35 36 #include <plat/s3c2443.h> 37 #include <plat/devs.h> 38 #include <plat/cpu.h> ··· 90 91 void __init s3c2443_map_io(void) 92 { 93 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 94 } 95
··· 16 #include <linux/list.h> 17 #include <linux/timer.h> 18 #include <linux/init.h> 19 + #include <linux/gpio.h> 20 #include <linux/platform_device.h> 21 #include <linux/serial_core.h> 22 #include <linux/sysdev.h> ··· 32 #include <mach/regs-s3c2443-clock.h> 33 #include <mach/reset.h> 34 35 + #include <plat/gpio-core.h> 36 + #include <plat/gpio-cfg.h> 37 + #include <plat/gpio-cfg-helpers.h> 38 #include <plat/s3c2443.h> 39 #include <plat/devs.h> 40 #include <plat/cpu.h> ··· 86 87 void __init s3c2443_map_io(void) 88 { 89 + s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_s3c2443; 90 + s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_s3c2443; 91 + 92 iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); 93 } 94
+3 -16
arch/arm/mach-s3c64xx/clock.c
··· 127 return s3c64xx_gate(S3C_SCLK_GATE, clk, enable); 128 } 129 130 - static struct clk init_clocks_disable[] = { 131 { 132 .name = "nand", 133 .id = -1, ··· 834 void __init s3c64xx_register_clocks(unsigned long xtal, 835 unsigned armclk_divlimit) 836 { 837 - struct clk *clkp; 838 - int ret; 839 - int ptr; 840 - 841 armclk_mask = armclk_divlimit; 842 843 s3c24xx_register_baseclocks(xtal); ··· 841 842 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 843 844 - clkp = init_clocks_disable; 845 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 846 - 847 - ret = s3c24xx_register_clock(clkp); 848 - if (ret < 0) { 849 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 850 - clkp->name, ret); 851 - } 852 - 853 - (clkp->enable)(clkp, 0); 854 - } 855 856 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); 857 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
··· 127 return s3c64xx_gate(S3C_SCLK_GATE, clk, enable); 128 } 129 130 + static struct clk init_clocks_off[] = { 131 { 132 .name = "nand", 133 .id = -1, ··· 834 void __init s3c64xx_register_clocks(unsigned long xtal, 835 unsigned armclk_divlimit) 836 { 837 armclk_mask = armclk_divlimit; 838 839 s3c24xx_register_baseclocks(xtal); ··· 845 846 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 847 848 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 849 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 850 851 s3c24xx_register_clocks(clks1, ARRAY_SIZE(clks1)); 852 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs));
+1
arch/arm/mach-s3c64xx/dma.c
··· 212 213 config = readl(chan->regs + PL080S_CH_CONFIG); 214 config |= PL080_CONFIG_ENABLE; 215 216 pr_debug("%s: writing config %08x\n", __func__, config); 217 writel(config, chan->regs + PL080S_CH_CONFIG);
··· 212 213 config = readl(chan->regs + PL080S_CH_CONFIG); 214 config |= PL080_CONFIG_ENABLE; 215 + config &= ~PL080_CONFIG_HALT; 216 217 pr_debug("%s: writing config %08x\n", __func__, config); 218 writel(config, chan->regs + PL080S_CH_CONFIG);
+19 -18
arch/arm/mach-s3c64xx/irq-eint.c
··· 30 #include <plat/pm.h> 31 32 #define eint_offset(irq) ((irq) - IRQ_EINT(0)) 33 - #define eint_irq_to_bit(irq) (1 << eint_offset(irq)) 34 35 - static inline void s3c_irq_eint_mask(unsigned int irq) 36 { 37 u32 mask; 38 39 mask = __raw_readl(S3C64XX_EINT0MASK); 40 - mask |= eint_irq_to_bit(irq); 41 __raw_writel(mask, S3C64XX_EINT0MASK); 42 } 43 44 - static void s3c_irq_eint_unmask(unsigned int irq) 45 { 46 u32 mask; 47 48 mask = __raw_readl(S3C64XX_EINT0MASK); 49 - mask &= ~eint_irq_to_bit(irq); 50 __raw_writel(mask, S3C64XX_EINT0MASK); 51 } 52 53 - static inline void s3c_irq_eint_ack(unsigned int irq) 54 { 55 - __raw_writel(eint_irq_to_bit(irq), S3C64XX_EINT0PEND); 56 } 57 58 - static void s3c_irq_eint_maskack(unsigned int irq) 59 { 60 /* compiler should in-line these */ 61 - s3c_irq_eint_mask(irq); 62 - s3c_irq_eint_ack(irq); 63 } 64 65 - static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) 66 { 67 - int offs = eint_offset(irq); 68 int pin, pin_val; 69 int shift; 70 u32 ctrl, mask; ··· 140 141 static struct irq_chip s3c_irq_eint = { 142 .name = "s3c-eint", 143 - .mask = s3c_irq_eint_mask, 144 - .unmask = s3c_irq_eint_unmask, 145 - .mask_ack = s3c_irq_eint_maskack, 146 - .ack = s3c_irq_eint_ack, 147 - .set_type = s3c_irq_eint_set_type, 148 - .set_wake = s3c_irqext_wake, 149 }; 150 151 /* s3c_irq_demux_eint ··· 198 199 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { 200 set_irq_chip(irq, &s3c_irq_eint); 201 set_irq_handler(irq, handle_level_irq); 202 set_irq_flags(irq, IRQF_VALID); 203 }
··· 30 #include <plat/pm.h> 31 32 #define eint_offset(irq) ((irq) - IRQ_EINT(0)) 33 + #define eint_irq_to_bit(irq) ((u32)(1 << eint_offset(irq))) 34 35 + static inline void s3c_irq_eint_mask(struct irq_data *data) 36 { 37 u32 mask; 38 39 mask = __raw_readl(S3C64XX_EINT0MASK); 40 + mask |= (u32)data->chip_data; 41 __raw_writel(mask, S3C64XX_EINT0MASK); 42 } 43 44 + static void s3c_irq_eint_unmask(struct irq_data *data) 45 { 46 u32 mask; 47 48 mask = __raw_readl(S3C64XX_EINT0MASK); 49 + mask &= ~((u32)data->chip_data); 50 __raw_writel(mask, S3C64XX_EINT0MASK); 51 } 52 53 + static inline void s3c_irq_eint_ack(struct irq_data *data) 54 { 55 + __raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND); 56 } 57 58 + static void s3c_irq_eint_maskack(struct irq_data *data) 59 { 60 /* compiler should in-line these */ 61 + s3c_irq_eint_mask(data); 62 + s3c_irq_eint_ack(data); 63 } 64 65 + static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type) 66 { 67 + int offs = eint_offset(data->irq); 68 int pin, pin_val; 69 int shift; 70 u32 ctrl, mask; ··· 140 141 static struct irq_chip s3c_irq_eint = { 142 .name = "s3c-eint", 143 + .irq_mask = s3c_irq_eint_mask, 144 + .irq_unmask = s3c_irq_eint_unmask, 145 + .irq_mask_ack = s3c_irq_eint_maskack, 146 + .irq_ack = s3c_irq_eint_ack, 147 + .irq_set_type = s3c_irq_eint_set_type, 148 + .irq_set_wake = s3c_irqext_wake, 149 }; 150 151 /* s3c_irq_demux_eint ··· 198 199 for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) { 200 set_irq_chip(irq, &s3c_irq_eint); 201 + set_irq_chip_data(irq, (void *)eint_irq_to_bit(irq)); 202 set_irq_handler(irq, handle_level_irq); 203 set_irq_flags(irq, IRQF_VALID); 204 }
+3 -13
arch/arm/mach-s5p6442/clock.c
··· 340 clk_pclkd1.rate = pclkd1; 341 } 342 343 - static struct clk init_clocks_disable[] = { 344 { 345 .name = "pdma", 346 .id = -1, ··· 408 409 void __init s5p6442_register_clocks(void) 410 { 411 - struct clk *clkptr; 412 - int i, ret; 413 - 414 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 415 416 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 417 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 418 419 - clkptr = init_clocks_disable; 420 - for (i = 0; i < ARRAY_SIZE(init_clocks_disable); i++, clkptr++) { 421 - ret = s3c24xx_register_clock(clkptr); 422 - if (ret < 0) { 423 - printk(KERN_ERR "Fail to register clock %s (%d)\n", 424 - clkptr->name, ret); 425 - } else 426 - (clkptr->enable)(clkptr, 0); 427 - } 428 429 s3c_pwmclk_init(); 430 }
··· 340 clk_pclkd1.rate = pclkd1; 341 } 342 343 + static struct clk init_clocks_off[] = { 344 { 345 .name = "pdma", 346 .id = -1, ··· 408 409 void __init s5p6442_register_clocks(void) 410 { 411 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 412 413 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 414 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 415 416 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 417 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 418 419 s3c_pwmclk_init(); 420 }
+3
arch/arm/mach-s5p6442/include/mach/map.h
··· 28 #define S5P6442_PA_VIC1 (0xE4100000) 29 #define S5P6442_PA_VIC2 (0xE4200000) 30 31 #define S5P6442_PA_MDMA 0xE8000000 32 #define S5P6442_PA_PDMA 0xE9000000 33
··· 28 #define S5P6442_PA_VIC1 (0xE4100000) 29 #define S5P6442_PA_VIC2 (0xE4200000) 30 31 + #define S5P6442_PA_SROMC (0xE7000000) 32 + #define S5P_PA_SROMC S5P6442_PA_SROMC 33 + 34 #define S5P6442_PA_MDMA 0xE8000000 35 #define S5P6442_PA_PDMA 0xE9000000 36
+10
arch/arm/mach-s5p6442/mach-smdk6442.c
··· 12 #include <linux/types.h> 13 #include <linux/init.h> 14 #include <linux/serial_core.h> 15 16 #include <asm/mach/arch.h> 17 #include <asm/mach/map.h> ··· 26 #include <plat/s5p6442.h> 27 #include <plat/devs.h> 28 #include <plat/cpu.h> 29 30 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 #define SMDK6442_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 67 }; 68 69 static struct platform_device *smdk6442_devices[] __initdata = { 70 &s5p6442_device_iis0, 71 &s3c_device_wdt, 72 }; 73 74 static void __init smdk6442_map_io(void) ··· 85 86 static void __init smdk6442_machine_init(void) 87 { 88 platform_add_devices(smdk6442_devices, ARRAY_SIZE(smdk6442_devices)); 89 } 90
··· 12 #include <linux/types.h> 13 #include <linux/init.h> 14 #include <linux/serial_core.h> 15 + #include <linux/i2c.h> 16 17 #include <asm/mach/arch.h> 18 #include <asm/mach/map.h> ··· 25 #include <plat/s5p6442.h> 26 #include <plat/devs.h> 27 #include <plat/cpu.h> 28 + #include <plat/iic.h> 29 30 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 #define SMDK6442_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 65 }; 66 67 static struct platform_device *smdk6442_devices[] __initdata = { 68 + &s3c_device_i2c0, 69 &s5p6442_device_iis0, 70 &s3c_device_wdt, 71 + }; 72 + 73 + static struct i2c_board_info smdk6442_i2c_devs0[] __initdata = { 74 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 75 }; 76 77 static void __init smdk6442_map_io(void) ··· 78 79 static void __init smdk6442_machine_init(void) 80 { 81 + s3c_i2c0_set_platdata(NULL); 82 + i2c_register_board_info(0, smdk6442_i2c_devs0, 83 + ARRAY_SIZE(smdk6442_i2c_devs0)); 84 platform_add_devices(smdk6442_devices, ARRAY_SIZE(smdk6442_devices)); 85 } 86
+4 -1
arch/arm/mach-s5p6442/setup-i2c0.c
··· 14 15 #include <linux/kernel.h> 16 #include <linux/types.h> 17 18 struct platform_device; /* don't need the contents */ 19 20 #include <plat/iic.h> 21 22 void s3c_i2c0_cfg_gpio(struct platform_device *dev) 23 { 24 - /* Will be populated later */ 25 }
··· 14 15 #include <linux/kernel.h> 16 #include <linux/types.h> 17 + #include <linux/gpio.h> 18 19 struct platform_device; /* don't need the contents */ 20 21 + #include <plat/gpio-cfg.h> 22 #include <plat/iic.h> 23 24 void s3c_i2c0_cfg_gpio(struct platform_device *dev) 25 { 26 + s3c_gpio_cfgall_range(S5P6442_GPD1(0), 2, 27 + S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); 28 }
+2 -2
arch/arm/mach-s5p64x0/Makefile
··· 12 13 # Core support for S5P64X0 system 14 15 - obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o 16 obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o 17 - obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o gpio.o 18 obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o 19 20 # machine support
··· 12 13 # Core support for S5P64X0 system 14 15 + obj-$(CONFIG_ARCH_S5P64X0) += cpu.o init.o clock.o dma.o gpiolib.o 16 obj-$(CONFIG_ARCH_S5P64X0) += setup-i2c0.o 17 + obj-$(CONFIG_CPU_S5P6440) += clock-s5p6440.o 18 obj-$(CONFIG_CPU_S5P6450) += clock-s5p6450.o 19 20 # machine support
+6 -16
arch/arm/mach-s5p64x0/clock-s5p6440.c
··· 133 * recommended to keep the following clocks disabled until the driver requests 134 * for enabling the clock. 135 */ 136 - static struct clk init_clocks_disable[] = { 137 { 138 .name = "nand", 139 .id = -1, ··· 419 static struct clksrc_clk clksrcs[] = { 420 { 421 .clk = { 422 - .name = "mmc_bus", 423 .id = 0, 424 .ctrlbit = (1 << 24), 425 .enable = s5p64x0_sclk_ctrl, ··· 429 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, 430 }, { 431 .clk = { 432 - .name = "mmc_bus", 433 .id = 1, 434 .ctrlbit = (1 << 25), 435 .enable = s5p64x0_sclk_ctrl, ··· 439 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, 440 }, { 441 .clk = { 442 - .name = "mmc_bus", 443 .id = 2, 444 .ctrlbit = (1 << 26), 445 .enable = s5p64x0_sclk_ctrl, ··· 602 603 void __init s5p6440_register_clocks(void) 604 { 605 - struct clk *clkp; 606 - int ret; 607 int ptr; 608 609 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); ··· 612 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 613 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 614 615 - clkp = init_clocks_disable; 616 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 617 - 618 - ret = s3c24xx_register_clock(clkp); 619 - if (ret < 0) { 620 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 621 - clkp->name, ret); 622 - } 623 - (clkp->enable)(clkp, 0); 624 - } 625 626 s3c_pwmclk_init(); 627 }
··· 133 * recommended to keep the following clocks disabled until the driver requests 134 * for enabling the clock. 135 */ 136 + static struct clk init_clocks_off[] = { 137 { 138 .name = "nand", 139 .id = -1, ··· 419 static struct clksrc_clk clksrcs[] = { 420 { 421 .clk = { 422 + .name = "sclk_mmc", 423 .id = 0, 424 .ctrlbit = (1 << 24), 425 .enable = s5p64x0_sclk_ctrl, ··· 429 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 0, .size = 4 }, 430 }, { 431 .clk = { 432 + .name = "sclk_mmc", 433 .id = 1, 434 .ctrlbit = (1 << 25), 435 .enable = s5p64x0_sclk_ctrl, ··· 439 .reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 4, .size = 4 }, 440 }, { 441 .clk = { 442 + .name = "sclk_mmc", 443 .id = 2, 444 .ctrlbit = (1 << 26), 445 .enable = s5p64x0_sclk_ctrl, ··· 602 603 void __init s5p6440_register_clocks(void) 604 { 605 int ptr; 606 607 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); ··· 614 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 615 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 616 617 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 618 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 619 620 s3c_pwmclk_init(); 621 }
+21 -13
arch/arm/mach-s5p64x0/clock-s5p6450.c
··· 181 * recommended to keep the following clocks disabled until the driver requests 182 * for enabling the clock. 183 */ 184 - static struct clk init_clocks_disable[] = { 185 { 186 .name = "usbhost", 187 .id = -1, ··· 231 .enable = s5p64x0_pclk_ctrl, 232 .ctrlbit = (1 << 5), 233 }, { 234 .name = "adc", 235 .id = -1, 236 .parent = &clk_pclk_low.clk, ··· 266 .parent = &clk_pclk_low.clk, 267 .enable = s5p64x0_pclk_ctrl, 268 .ctrlbit = (1 << 26), 269 }, { 270 .name = "i2c", 271 .id = 1, ··· 651 652 void __init s5p6450_register_clocks(void) 653 { 654 - struct clk *clkp; 655 - int ret; 656 int ptr; 657 658 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) ··· 659 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 660 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 661 662 - clkp = init_clocks_disable; 663 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 664 - 665 - ret = s3c24xx_register_clock(clkp); 666 - if (ret < 0) { 667 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 668 - clkp->name, ret); 669 - } 670 - (clkp->enable)(clkp, 0); 671 - } 672 673 s3c_pwmclk_init(); 674 }
··· 181 * recommended to keep the following clocks disabled until the driver requests 182 * for enabling the clock. 183 */ 184 + static struct clk init_clocks_off[] = { 185 { 186 .name = "usbhost", 187 .id = -1, ··· 231 .enable = s5p64x0_pclk_ctrl, 232 .ctrlbit = (1 << 5), 233 }, { 234 + .name = "rtc", 235 + .id = -1, 236 + .parent = &clk_pclk_low.clk, 237 + .enable = s5p64x0_pclk_ctrl, 238 + .ctrlbit = (1 << 6), 239 + }, { 240 .name = "adc", 241 .id = -1, 242 .parent = &clk_pclk_low.clk, ··· 260 .parent = &clk_pclk_low.clk, 261 .enable = s5p64x0_pclk_ctrl, 262 .ctrlbit = (1 << 26), 263 + }, { 264 + .name = "iis", 265 + .id = 1, 266 + .parent = &clk_pclk_low.clk, 267 + .enable = s5p64x0_pclk_ctrl, 268 + .ctrlbit = (1 << 15), 269 + }, { 270 + .name = "iis", 271 + .id = 2, 272 + .parent = &clk_pclk_low.clk, 273 + .enable = s5p64x0_pclk_ctrl, 274 + .ctrlbit = (1 << 16), 275 }, { 276 .name = "i2c", 277 .id = 1, ··· 633 634 void __init s5p6450_register_clocks(void) 635 { 636 int ptr; 637 638 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) ··· 643 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 644 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 645 646 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 647 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 648 649 s3c_pwmclk_init(); 650 }
+110 -13
arch/arm/mach-s5p64x0/dev-audio.c
··· 24 [1] = "sclk_audio2", 25 }; 26 27 - static int s5p64x0_cfg_i2s(struct platform_device *pdev) 28 { 29 - /* configure GPIO for i2s port */ 30 switch (pdev->id) { 31 case 0: 32 - s3c_gpio_cfgpin_range(S5P6440_GPR(4), 5, S3C_GPIO_SFN(5)); 33 - s3c_gpio_cfgpin_range(S5P6440_GPR(13), 2, S3C_GPIO_SFN(5)); 34 break; 35 default: 36 printk(KERN_ERR "Invalid Device %d\n", pdev->id); ··· 40 return 0; 41 } 42 43 - static struct s3c_audio_pdata s5p64x0_i2s_pdata = { 44 - .cfg_gpio = s5p64x0_cfg_i2s, 45 .type = { 46 .i2s = { 47 .quirks = QUIRK_PRI_6CHAN, ··· 50 }, 51 }; 52 53 - static struct resource s5p64x0_iis0_resource[] = { 54 [0] = { 55 .start = S5P64X0_PA_I2S, 56 .end = S5P64X0_PA_I2S + 0x100 - 1, ··· 71 struct platform_device s5p6440_device_iis = { 72 .name = "samsung-i2s", 73 .id = 0, 74 - .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), 75 - .resource = s5p64x0_iis0_resource, 76 .dev = { 77 - .platform_data = &s5p64x0_i2s_pdata, 78 }, 79 }; 80 81 struct platform_device s5p6450_device_iis0 = { 82 .name = "samsung-i2s", 83 .id = 0, 84 - .num_resources = ARRAY_SIZE(s5p64x0_iis0_resource), 85 - .resource = s5p64x0_iis0_resource, 86 .dev = { 87 - .platform_data = &s5p64x0_i2s_pdata, 88 }, 89 }; 90
··· 24 [1] = "sclk_audio2", 25 }; 26 27 + static int s5p6440_cfg_i2s(struct platform_device *pdev) 28 { 29 switch (pdev->id) { 30 case 0: 31 + s3c_gpio_cfgpin_range(S5P6440_GPC(4), 2, S3C_GPIO_SFN(5)); 32 + s3c_gpio_cfgpin(S5P6440_GPC(7), S3C_GPIO_SFN(5)); 33 + s3c_gpio_cfgpin_range(S5P6440_GPH(6), 4, S3C_GPIO_SFN(5)); 34 break; 35 default: 36 printk(KERN_ERR "Invalid Device %d\n", pdev->id); ··· 40 return 0; 41 } 42 43 + static struct s3c_audio_pdata s5p6440_i2s_pdata = { 44 + .cfg_gpio = s5p6440_cfg_i2s, 45 .type = { 46 .i2s = { 47 .quirks = QUIRK_PRI_6CHAN, ··· 50 }, 51 }; 52 53 + static struct resource s5p64x0_i2s0_resource[] = { 54 [0] = { 55 .start = S5P64X0_PA_I2S, 56 .end = S5P64X0_PA_I2S + 0x100 - 1, ··· 71 struct platform_device s5p6440_device_iis = { 72 .name = "samsung-i2s", 73 .id = 0, 74 + .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource), 75 + .resource = s5p64x0_i2s0_resource, 76 .dev = { 77 + .platform_data = &s5p6440_i2s_pdata, 78 + }, 79 + }; 80 + 81 + static int s5p6450_cfg_i2s(struct platform_device *pdev) 82 + { 83 + switch (pdev->id) { 84 + case 0: 85 + s3c_gpio_cfgpin_range(S5P6450_GPR(4), 5, S3C_GPIO_SFN(5)); 86 + s3c_gpio_cfgpin_range(S5P6450_GPR(13), 2, S3C_GPIO_SFN(5)); 87 + break; 88 + case 1: 89 + s3c_gpio_cfgpin(S5P6440_GPB(4), S3C_GPIO_SFN(5)); 90 + s3c_gpio_cfgpin_range(S5P6450_GPC(0), 4, S3C_GPIO_SFN(5)); 91 + break; 92 + case 2: 93 + s3c_gpio_cfgpin_range(S5P6450_GPK(0), 5, S3C_GPIO_SFN(5)); 94 + break; 95 + default: 96 + printk(KERN_ERR "Invalid Device %d\n", pdev->id); 97 + return -EINVAL; 98 + } 99 + 100 + return 0; 101 + } 102 + 103 + static struct s3c_audio_pdata s5p6450_i2s0_pdata = { 104 + .cfg_gpio = s5p6450_cfg_i2s, 105 + .type = { 106 + .i2s = { 107 + .quirks = QUIRK_PRI_6CHAN, 108 + .src_clk = rclksrc, 109 + }, 110 }, 111 }; 112 113 struct platform_device s5p6450_device_iis0 = { 114 .name = "samsung-i2s", 115 .id = 0, 116 + .num_resources = ARRAY_SIZE(s5p64x0_i2s0_resource), 117 + .resource = s5p64x0_i2s0_resource, 118 .dev = { 119 + .platform_data = &s5p6450_i2s0_pdata, 120 + }, 121 + }; 122 + 123 + static struct s3c_audio_pdata s5p6450_i2s_pdata = { 124 + .cfg_gpio = s5p6450_cfg_i2s, 125 + .type = { 126 + .i2s = { 127 + .src_clk = rclksrc, 128 + }, 129 + }, 130 + }; 131 + 132 + static struct resource s5p6450_i2s1_resource[] = { 133 + [0] = { 134 + .start = S5P6450_PA_I2S1, 135 + .end = S5P6450_PA_I2S1 + 0x100 - 1, 136 + .flags = IORESOURCE_MEM, 137 + }, 138 + [1] = { 139 + .start = DMACH_I2S1_TX, 140 + .end = DMACH_I2S1_TX, 141 + .flags = IORESOURCE_DMA, 142 + }, 143 + [2] = { 144 + .start = DMACH_I2S1_RX, 145 + .end = DMACH_I2S1_RX, 146 + .flags = IORESOURCE_DMA, 147 + }, 148 + }; 149 + 150 + struct platform_device s5p6450_device_iis1 = { 151 + .name = "samsung-i2s", 152 + .id = 1, 153 + .num_resources = ARRAY_SIZE(s5p6450_i2s1_resource), 154 + .resource = s5p6450_i2s1_resource, 155 + .dev = { 156 + .platform_data = &s5p6450_i2s_pdata, 157 + }, 158 + }; 159 + 160 + static struct resource s5p6450_i2s2_resource[] = { 161 + [0] = { 162 + .start = S5P6450_PA_I2S2, 163 + .end = S5P6450_PA_I2S2 + 0x100 - 1, 164 + .flags = IORESOURCE_MEM, 165 + }, 166 + [1] = { 167 + .start = DMACH_I2S2_TX, 168 + .end = DMACH_I2S2_TX, 169 + .flags = IORESOURCE_DMA, 170 + }, 171 + [2] = { 172 + .start = DMACH_I2S2_RX, 173 + .end = DMACH_I2S2_RX, 174 + .flags = IORESOURCE_DMA, 175 + }, 176 + }; 177 + 178 + struct platform_device s5p6450_device_iis2 = { 179 + .name = "samsung-i2s", 180 + .id = 2, 181 + .num_resources = ARRAY_SIZE(s5p6450_i2s2_resource), 182 + .resource = s5p6450_i2s2_resource, 183 + .dev = { 184 + .platform_data = &s5p6450_i2s_pdata, 185 }, 186 }; 187
+195 -26
arch/arm/mach-s5p64x0/gpio.c arch/arm/mach-s5p64x0/gpiolib.c
··· 1 - /* linux/arch/arm/mach-s5p64x0/gpio.c 2 * 3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 4 * http://www.samsung.com ··· 17 18 #include <mach/map.h> 19 #include <mach/regs-gpio.h> 20 21 #include <plat/gpio-core.h> 22 #include <plat/gpio-cfg.h> 23 #include <plat/gpio-cfg-helpers.h> 24 - 25 - /* To be implemented S5P6450 GPIO */ 26 27 /* 28 * S5P6440 GPIO bank summary: ··· 38 * N 16 2Bit No IRQ_EINT 39 * P 8 2Bit Yes 8 40 * R 15 4Bit[2] Yes 8 41 * 42 * [1] BANKF pins 14,15 do not form part of the external interrupt sources 43 * [2] BANK has two control registers, GPxCON0 and GPxCON1 ··· 208 209 static struct s3c_gpio_chip s5p6440_gpio_4bit[] = { 210 { 211 - .base = S5P6440_GPA_BASE, 212 .config = &s5p64x0_gpio_cfgs[1], 213 .chip = { 214 .base = S5P6440_GPA(0), ··· 216 .label = "GPA", 217 }, 218 }, { 219 - .base = S5P6440_GPB_BASE, 220 .config = &s5p64x0_gpio_cfgs[1], 221 .chip = { 222 .base = S5P6440_GPB(0), ··· 224 .label = "GPB", 225 }, 226 }, { 227 - .base = S5P6440_GPC_BASE, 228 .config = &s5p64x0_gpio_cfgs[1], 229 .chip = { 230 .base = S5P6440_GPC(0), ··· 232 .label = "GPC", 233 }, 234 }, { 235 - .base = S5P6440_GPG_BASE, 236 .config = &s5p64x0_gpio_cfgs[1], 237 .chip = { 238 .base = S5P6440_GPG(0), ··· 244 245 static struct s3c_gpio_chip s5p6440_gpio_4bit2[] = { 246 { 247 - .base = S5P6440_GPH_BASE + 0x4, 248 .config = &s5p64x0_gpio_cfgs[1], 249 .chip = { 250 .base = S5P6440_GPH(0), ··· 256 257 static struct s3c_gpio_chip s5p6440_gpio_rbank_4bit2[] = { 258 { 259 - .base = S5P6440_GPR_BASE + 0x4, 260 .config = &s5p64x0_gpio_cfgs[2], 261 .chip = { 262 .base = S5P6440_GPR(0), ··· 268 269 static struct s3c_gpio_chip s5p6440_gpio_2bit[] = { 270 { 271 - .base = S5P6440_GPF_BASE, 272 .config = &s5p64x0_gpio_cfgs[5], 273 .chip = { 274 .base = S5P6440_GPF(0), ··· 276 .label = "GPF", 277 }, 278 }, { 279 - .base = S5P6440_GPI_BASE, 280 .config = &s5p64x0_gpio_cfgs[3], 281 .chip = { 282 .base = S5P6440_GPI(0), ··· 284 .label = "GPI", 285 }, 286 }, { 287 - .base = S5P6440_GPJ_BASE, 288 .config = &s5p64x0_gpio_cfgs[3], 289 .chip = { 290 .base = S5P6440_GPJ(0), ··· 292 .label = "GPJ", 293 }, 294 }, { 295 - .base = S5P6440_GPN_BASE, 296 .config = &s5p64x0_gpio_cfgs[4], 297 .chip = { 298 .base = S5P6440_GPN(0), ··· 300 .label = "GPN", 301 }, 302 }, { 303 - .base = S5P6440_GPP_BASE, 304 .config = &s5p64x0_gpio_cfgs[5], 305 .chip = { 306 .base = S5P6440_GPP(0), 307 .ngpio = S5P6440_GPIO_P_NR, 308 .label = "GPP", 309 }, 310 }, 311 }; ··· 471 } 472 } 473 474 - static int __init s5p6440_gpiolib_init(void) 475 { 476 - struct s3c_gpio_chip *chips = s5p6440_gpio_2bit; 477 - int nr_chips = ARRAY_SIZE(s5p6440_gpio_2bit); 478 479 s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs, 480 ARRAY_SIZE(s5p64x0_gpio_cfgs)); 481 482 - for (; nr_chips > 0; nr_chips--, chips++) 483 - s3c_gpiolib_add(chips); 484 485 - samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit, 486 - ARRAY_SIZE(s5p6440_gpio_4bit)); 487 488 - samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2, 489 - ARRAY_SIZE(s5p6440_gpio_4bit2)); 490 491 - s5p64x0_gpio_add_rbank_4bit2(s5p6440_gpio_rbank_4bit2, 492 - ARRAY_SIZE(s5p6440_gpio_rbank_4bit2)); 493 494 return 0; 495 } 496 - arch_initcall(s5p6440_gpiolib_init);
··· 1 + /* linux/arch/arm/mach-s5p64x0/gpiolib.c 2 * 3 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd. 4 * http://www.samsung.com ··· 17 18 #include <mach/map.h> 19 #include <mach/regs-gpio.h> 20 + #include <mach/regs-clock.h> 21 22 #include <plat/gpio-core.h> 23 #include <plat/gpio-cfg.h> 24 #include <plat/gpio-cfg-helpers.h> 25 26 /* 27 * S5P6440 GPIO bank summary: ··· 39 * N 16 2Bit No IRQ_EINT 40 * P 8 2Bit Yes 8 41 * R 15 4Bit[2] Yes 8 42 + * 43 + * S5P6450 GPIO bank summary: 44 + * 45 + * Bank GPIOs Style SlpCon ExtInt Group 46 + * A 6 4Bit Yes 1 47 + * B 7 4Bit Yes 1 48 + * C 8 4Bit Yes 2 49 + * D 8 4Bit Yes None 50 + * F 2 2Bit Yes None 51 + * G 14 4Bit[2] Yes 5 52 + * H 10 4Bit[2] Yes 6 53 + * I 16 2Bit Yes None 54 + * J 12 2Bit Yes None 55 + * K 5 4Bit Yes None 56 + * N 16 2Bit No IRQ_EINT 57 + * P 11 2Bit Yes 8 58 + * Q 14 2Bit Yes None 59 + * R 15 4Bit[2] Yes None 60 + * S 8 2Bit Yes None 61 * 62 * [1] BANKF pins 14,15 do not form part of the external interrupt sources 63 * [2] BANK has two control registers, GPxCON0 and GPxCON1 ··· 190 191 static struct s3c_gpio_chip s5p6440_gpio_4bit[] = { 192 { 193 + .base = S5P64X0_GPA_BASE, 194 .config = &s5p64x0_gpio_cfgs[1], 195 .chip = { 196 .base = S5P6440_GPA(0), ··· 198 .label = "GPA", 199 }, 200 }, { 201 + .base = S5P64X0_GPB_BASE, 202 .config = &s5p64x0_gpio_cfgs[1], 203 .chip = { 204 .base = S5P6440_GPB(0), ··· 206 .label = "GPB", 207 }, 208 }, { 209 + .base = S5P64X0_GPC_BASE, 210 .config = &s5p64x0_gpio_cfgs[1], 211 .chip = { 212 .base = S5P6440_GPC(0), ··· 214 .label = "GPC", 215 }, 216 }, { 217 + .base = S5P64X0_GPG_BASE, 218 .config = &s5p64x0_gpio_cfgs[1], 219 .chip = { 220 .base = S5P6440_GPG(0), ··· 226 227 static struct s3c_gpio_chip s5p6440_gpio_4bit2[] = { 228 { 229 + .base = S5P64X0_GPH_BASE + 0x4, 230 .config = &s5p64x0_gpio_cfgs[1], 231 .chip = { 232 .base = S5P6440_GPH(0), ··· 238 239 static struct s3c_gpio_chip s5p6440_gpio_rbank_4bit2[] = { 240 { 241 + .base = S5P64X0_GPR_BASE + 0x4, 242 .config = &s5p64x0_gpio_cfgs[2], 243 .chip = { 244 .base = S5P6440_GPR(0), ··· 250 251 static struct s3c_gpio_chip s5p6440_gpio_2bit[] = { 252 { 253 + .base = S5P64X0_GPF_BASE, 254 .config = &s5p64x0_gpio_cfgs[5], 255 .chip = { 256 .base = S5P6440_GPF(0), ··· 258 .label = "GPF", 259 }, 260 }, { 261 + .base = S5P64X0_GPI_BASE, 262 .config = &s5p64x0_gpio_cfgs[3], 263 .chip = { 264 .base = S5P6440_GPI(0), ··· 266 .label = "GPI", 267 }, 268 }, { 269 + .base = S5P64X0_GPJ_BASE, 270 .config = &s5p64x0_gpio_cfgs[3], 271 .chip = { 272 .base = S5P6440_GPJ(0), ··· 274 .label = "GPJ", 275 }, 276 }, { 277 + .base = S5P64X0_GPN_BASE, 278 .config = &s5p64x0_gpio_cfgs[4], 279 .chip = { 280 .base = S5P6440_GPN(0), ··· 282 .label = "GPN", 283 }, 284 }, { 285 + .base = S5P64X0_GPP_BASE, 286 .config = &s5p64x0_gpio_cfgs[5], 287 .chip = { 288 .base = S5P6440_GPP(0), 289 .ngpio = S5P6440_GPIO_P_NR, 290 .label = "GPP", 291 + }, 292 + }, 293 + }; 294 + 295 + static struct s3c_gpio_chip s5p6450_gpio_4bit[] = { 296 + { 297 + .base = S5P64X0_GPA_BASE, 298 + .config = &s5p64x0_gpio_cfgs[1], 299 + .chip = { 300 + .base = S5P6450_GPA(0), 301 + .ngpio = S5P6450_GPIO_A_NR, 302 + .label = "GPA", 303 + }, 304 + }, { 305 + .base = S5P64X0_GPB_BASE, 306 + .config = &s5p64x0_gpio_cfgs[1], 307 + .chip = { 308 + .base = S5P6450_GPB(0), 309 + .ngpio = S5P6450_GPIO_B_NR, 310 + .label = "GPB", 311 + }, 312 + }, { 313 + .base = S5P64X0_GPC_BASE, 314 + .config = &s5p64x0_gpio_cfgs[1], 315 + .chip = { 316 + .base = S5P6450_GPC(0), 317 + .ngpio = S5P6450_GPIO_C_NR, 318 + .label = "GPC", 319 + }, 320 + }, { 321 + .base = S5P6450_GPD_BASE, 322 + .config = &s5p64x0_gpio_cfgs[1], 323 + .chip = { 324 + .base = S5P6450_GPD(0), 325 + .ngpio = S5P6450_GPIO_D_NR, 326 + .label = "GPD", 327 + }, 328 + }, { 329 + .base = S5P6450_GPK_BASE, 330 + .config = &s5p64x0_gpio_cfgs[1], 331 + .chip = { 332 + .base = S5P6450_GPK(0), 333 + .ngpio = S5P6450_GPIO_K_NR, 334 + .label = "GPK", 335 + }, 336 + }, 337 + }; 338 + 339 + static struct s3c_gpio_chip s5p6450_gpio_4bit2[] = { 340 + { 341 + .base = S5P64X0_GPG_BASE + 0x4, 342 + .config = &s5p64x0_gpio_cfgs[1], 343 + .chip = { 344 + .base = S5P6450_GPG(0), 345 + .ngpio = S5P6450_GPIO_G_NR, 346 + .label = "GPG", 347 + }, 348 + }, { 349 + .base = S5P64X0_GPH_BASE + 0x4, 350 + .config = &s5p64x0_gpio_cfgs[1], 351 + .chip = { 352 + .base = S5P6450_GPH(0), 353 + .ngpio = S5P6450_GPIO_H_NR, 354 + .label = "GPH", 355 + }, 356 + }, 357 + }; 358 + 359 + static struct s3c_gpio_chip s5p6450_gpio_rbank_4bit2[] = { 360 + { 361 + .base = S5P64X0_GPR_BASE + 0x4, 362 + .config = &s5p64x0_gpio_cfgs[2], 363 + .chip = { 364 + .base = S5P6450_GPR(0), 365 + .ngpio = S5P6450_GPIO_R_NR, 366 + .label = "GPR", 367 + }, 368 + }, 369 + }; 370 + 371 + static struct s3c_gpio_chip s5p6450_gpio_2bit[] = { 372 + { 373 + .base = S5P64X0_GPF_BASE, 374 + .config = &s5p64x0_gpio_cfgs[5], 375 + .chip = { 376 + .base = S5P6450_GPF(0), 377 + .ngpio = S5P6450_GPIO_F_NR, 378 + .label = "GPF", 379 + }, 380 + }, { 381 + .base = S5P64X0_GPI_BASE, 382 + .config = &s5p64x0_gpio_cfgs[3], 383 + .chip = { 384 + .base = S5P6450_GPI(0), 385 + .ngpio = S5P6450_GPIO_I_NR, 386 + .label = "GPI", 387 + }, 388 + }, { 389 + .base = S5P64X0_GPJ_BASE, 390 + .config = &s5p64x0_gpio_cfgs[3], 391 + .chip = { 392 + .base = S5P6450_GPJ(0), 393 + .ngpio = S5P6450_GPIO_J_NR, 394 + .label = "GPJ", 395 + }, 396 + }, { 397 + .base = S5P64X0_GPN_BASE, 398 + .config = &s5p64x0_gpio_cfgs[4], 399 + .chip = { 400 + .base = S5P6450_GPN(0), 401 + .ngpio = S5P6450_GPIO_N_NR, 402 + .label = "GPN", 403 + }, 404 + }, { 405 + .base = S5P64X0_GPP_BASE, 406 + .config = &s5p64x0_gpio_cfgs[5], 407 + .chip = { 408 + .base = S5P6450_GPP(0), 409 + .ngpio = S5P6450_GPIO_P_NR, 410 + .label = "GPP", 411 + }, 412 + }, { 413 + .base = S5P6450_GPQ_BASE, 414 + .config = &s5p64x0_gpio_cfgs[4], 415 + .chip = { 416 + .base = S5P6450_GPQ(0), 417 + .ngpio = S5P6450_GPIO_Q_NR, 418 + .label = "GPQ", 419 + }, 420 + }, { 421 + .base = S5P6450_GPS_BASE, 422 + .config = &s5p64x0_gpio_cfgs[5], 423 + .chip = { 424 + .base = S5P6450_GPS(0), 425 + .ngpio = S5P6450_GPIO_S_NR, 426 + .label = "GPS", 427 }, 428 }, 429 }; ··· 317 } 318 } 319 320 + static int __init s5p64x0_gpiolib_init(void) 321 { 322 + unsigned int chipid; 323 + 324 + chipid = __raw_readl(S5P64X0_SYS_ID); 325 326 s5p64x0_gpiolib_set_cfg(s5p64x0_gpio_cfgs, 327 ARRAY_SIZE(s5p64x0_gpio_cfgs)); 328 329 + if ((chipid & 0xff000) == 0x50000) { 330 + samsung_gpiolib_add_2bit_chips(s5p6450_gpio_2bit, 331 + ARRAY_SIZE(s5p6450_gpio_2bit)); 332 333 + samsung_gpiolib_add_4bit_chips(s5p6450_gpio_4bit, 334 + ARRAY_SIZE(s5p6450_gpio_4bit)); 335 336 + samsung_gpiolib_add_4bit2_chips(s5p6450_gpio_4bit2, 337 + ARRAY_SIZE(s5p6450_gpio_4bit2)); 338 339 + s5p64x0_gpio_add_rbank_4bit2(s5p6450_gpio_rbank_4bit2, 340 + ARRAY_SIZE(s5p6450_gpio_rbank_4bit2)); 341 + } else { 342 + samsung_gpiolib_add_2bit_chips(s5p6440_gpio_2bit, 343 + ARRAY_SIZE(s5p6440_gpio_2bit)); 344 + 345 + samsung_gpiolib_add_4bit_chips(s5p6440_gpio_4bit, 346 + ARRAY_SIZE(s5p6440_gpio_4bit)); 347 + 348 + samsung_gpiolib_add_4bit2_chips(s5p6440_gpio_4bit2, 349 + ARRAY_SIZE(s5p6440_gpio_4bit2)); 350 + 351 + s5p64x0_gpio_add_rbank_4bit2(s5p6440_gpio_rbank_4bit2, 352 + ARRAY_SIZE(s5p6440_gpio_rbank_4bit2)); 353 + } 354 355 return 0; 356 } 357 + core_initcall(s5p64x0_gpiolib_init);
+5
arch/arm/mach-s5p64x0/include/mach/map.h
··· 29 #define S5P64X0_PA_VIC0 (0xE4000000) 30 #define S5P64X0_PA_VIC1 (0xE4100000) 31 32 #define S5P64X0_PA_PDMA (0xE9000000) 33 34 #define S5P64X0_PA_TIMER (0xEA000000) ··· 66 #define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) 67 68 #define S5P64X0_PA_I2S (0xF2000000) 69 70 #define S5P64X0_PA_PCM (0xF2100000) 71
··· 29 #define S5P64X0_PA_VIC0 (0xE4000000) 30 #define S5P64X0_PA_VIC1 (0xE4100000) 31 32 + #define S5P64X0_PA_SROMC (0xE7000000) 33 + #define S5P_PA_SROMC S5P64X0_PA_SROMC 34 + 35 #define S5P64X0_PA_PDMA (0xE9000000) 36 37 #define S5P64X0_PA_TIMER (0xEA000000) ··· 63 #define S5P64X0_PA_HSMMC(x) (0xED800000 + ((x) * 0x100000)) 64 65 #define S5P64X0_PA_I2S (0xF2000000) 66 + #define S5P6450_PA_I2S1 0xF2800000 67 + #define S5P6450_PA_I2S2 0xF2900000 68 69 #define S5P64X0_PA_PCM (0xF2100000) 70
+15 -40
arch/arm/mach-s5p64x0/include/mach/regs-gpio.h
··· 15 16 #include <mach/map.h> 17 18 - /* Will be implemented S5P6442 GPIOlib */ 19 - 20 /* Base addresses for each of the banks */ 21 22 - #define S5P6440_GPA_BASE (S5P_VA_GPIO + 0x0000) 23 - #define S5P6440_GPB_BASE (S5P_VA_GPIO + 0x0020) 24 - #define S5P6440_GPC_BASE (S5P_VA_GPIO + 0x0040) 25 - #define S5P6440_GPF_BASE (S5P_VA_GPIO + 0x00A0) 26 - #define S5P6440_GPG_BASE (S5P_VA_GPIO + 0x00C0) 27 - #define S5P6440_GPH_BASE (S5P_VA_GPIO + 0x00E0) 28 - #define S5P6440_GPI_BASE (S5P_VA_GPIO + 0x0100) 29 - #define S5P6440_GPJ_BASE (S5P_VA_GPIO + 0x0120) 30 - #define S5P6440_GPN_BASE (S5P_VA_GPIO + 0x0830) 31 - #define S5P6440_GPP_BASE (S5P_VA_GPIO + 0x0160) 32 - #define S5P6440_GPR_BASE (S5P_VA_GPIO + 0x0290) 33 34 - #define S5P6440_EINT0CON0 (S5P_VA_GPIO + 0x900) 35 - #define S5P6440_EINT0FLTCON0 (S5P_VA_GPIO + 0x910) 36 - #define S5P6440_EINT0FLTCON1 (S5P_VA_GPIO + 0x914) 37 - #define S5P6440_EINT0MASK (S5P_VA_GPIO + 0x920) 38 - #define S5P6440_EINT0PEND (S5P_VA_GPIO + 0x924) 39 - 40 - /* for LCD */ 41 - 42 - #define S5P6440_SPCON_LCD_SEL_RGB (1 << 0) 43 - #define S5P6440_SPCON_LCD_SEL_MASK (3 << 0) 44 - 45 - /* 46 - * These set of macros are not really useful for the 47 - * GPF/GPI/GPJ/GPN/GPP, useful for others set of GPIO's (4 bit) 48 - */ 49 - 50 - #define S5P6440_GPIO_CONMASK(__gpio) (0xf << ((__gpio) * 4)) 51 - #define S5P6440_GPIO_INPUT(__gpio) (0x0 << ((__gpio) * 4)) 52 - #define S5P6440_GPIO_OUTPUT(__gpio) (0x1 << ((__gpio) * 4)) 53 - 54 - /* 55 - * Use these macros for GPF/GPI/GPJ/GPN/GPP set of GPIO (2 bit) 56 - */ 57 - 58 - #define S5P6440_GPIO2_CONMASK(__gpio) (0x3 << ((__gpio) * 2)) 59 - #define S5P6440_GPIO2_INPUT(__gpio) (0x0 << ((__gpio) * 2)) 60 - #define S5P6440_GPIO2_OUTPUT(__gpio) (0x1 << ((__gpio) * 2)) 61 62 #endif /* __ASM_ARCH_REGS_GPIO_H */
··· 15 16 #include <mach/map.h> 17 18 /* Base addresses for each of the banks */ 19 20 + #define S5P64X0_GPA_BASE (S5P_VA_GPIO + 0x0000) 21 + #define S5P64X0_GPB_BASE (S5P_VA_GPIO + 0x0020) 22 + #define S5P64X0_GPC_BASE (S5P_VA_GPIO + 0x0040) 23 + #define S5P64X0_GPF_BASE (S5P_VA_GPIO + 0x00A0) 24 + #define S5P64X0_GPG_BASE (S5P_VA_GPIO + 0x00C0) 25 + #define S5P64X0_GPH_BASE (S5P_VA_GPIO + 0x00E0) 26 + #define S5P64X0_GPI_BASE (S5P_VA_GPIO + 0x0100) 27 + #define S5P64X0_GPJ_BASE (S5P_VA_GPIO + 0x0120) 28 + #define S5P64X0_GPN_BASE (S5P_VA_GPIO + 0x0830) 29 + #define S5P64X0_GPP_BASE (S5P_VA_GPIO + 0x0160) 30 + #define S5P64X0_GPR_BASE (S5P_VA_GPIO + 0x0290) 31 32 + #define S5P6450_GPD_BASE (S5P_VA_GPIO + 0x0060) 33 + #define S5P6450_GPK_BASE (S5P_VA_GPIO + 0x0140) 34 + #define S5P6450_GPQ_BASE (S5P_VA_GPIO + 0x0180) 35 + #define S5P6450_GPS_BASE (S5P_VA_GPIO + 0x0300) 36 37 #endif /* __ASM_ARCH_REGS_GPIO_H */
+1
arch/arm/mach-s5p64x0/mach-smdk6440.c
··· 117 118 static struct i2c_board_info smdk6440_i2c_devs0[] __initdata = { 119 { I2C_BOARD_INFO("24c08", 0x50), }, 120 }; 121 122 static struct i2c_board_info smdk6440_i2c_devs1[] __initdata = {
··· 117 118 static struct i2c_board_info smdk6440_i2c_devs0[] __initdata = { 119 { I2C_BOARD_INFO("24c08", 0x50), }, 120 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 121 }; 122 123 static struct i2c_board_info smdk6440_i2c_devs1[] __initdata = {
+1
arch/arm/mach-s5p64x0/mach-smdk6450.c
··· 135 }; 136 137 static struct i2c_board_info smdk6450_i2c_devs0[] __initdata = { 138 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung KS24C080C EEPROM */ 139 }; 140
··· 135 }; 136 137 static struct i2c_board_info smdk6450_i2c_devs0[] __initdata = { 138 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 139 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung KS24C080C EEPROM */ 140 }; 141
+3 -13
arch/arm/mach-s5pc100/clock.c
··· 396 * recommended to keep the following clocks disabled until the driver requests 397 * for enabling the clock. 398 */ 399 - static struct clk init_clocks_disable[] = { 400 { 401 .name = "cssys", 402 .id = -1, ··· 1381 1382 void __init s5pc100_register_clocks(void) 1383 { 1384 - struct clk *clkp; 1385 - int ret; 1386 int ptr; 1387 1388 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); ··· 1391 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1392 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1393 1394 - clkp = init_clocks_disable; 1395 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 1396 - 1397 - ret = s3c24xx_register_clock(clkp); 1398 - if (ret < 0) { 1399 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 1400 - clkp->name, ret); 1401 - } 1402 - (clkp->enable)(clkp, 0); 1403 - } 1404 1405 s3c_pwmclk_init(); 1406 }
··· 396 * recommended to keep the following clocks disabled until the driver requests 397 * for enabling the clock. 398 */ 399 + static struct clk init_clocks_off[] = { 400 { 401 .name = "cssys", 402 .id = -1, ··· 1381 1382 void __init s5pc100_register_clocks(void) 1383 { 1384 int ptr; 1385 1386 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); ··· 1393 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1394 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1395 1396 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1397 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1398 1399 s3c_pwmclk_init(); 1400 }
+2
arch/arm/mach-s5pc100/include/mach/map.h
··· 55 #define S5PC100_VA_VIC_OFFSET 0x10000 56 #define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) 57 58 59 #define S5PC100_PA_ONENAND (0xE7100000) 60
··· 55 #define S5PC100_VA_VIC_OFFSET 0x10000 56 #define S5PC1XX_VA_VIC(x) (S5PC100_VA_VIC + ((x) * S5PC100_VA_VIC_OFFSET)) 57 58 + #define S5PC100_PA_SROMC (0xE7000000) 59 + #define S5P_PA_SROMC S5PC100_PA_SROMC 60 61 #define S5PC100_PA_ONENAND (0xE7100000) 62
+2
arch/arm/mach-s5pv210/Kconfig
··· 118 config MACH_SMDKV210 119 bool "SMDKV210" 120 select CPU_S5PV210 121 select S3C_DEV_HSMMC 122 select S3C_DEV_HSMMC1 123 select S3C_DEV_HSMMC2 ··· 131 select SAMSUNG_DEV_IDE 132 select SAMSUNG_DEV_KEYPAD 133 select SAMSUNG_DEV_TS 134 select S5PV210_SETUP_I2C1 135 select S5PV210_SETUP_I2C2 136 select S5PV210_SETUP_IDE
··· 118 config MACH_SMDKV210 119 bool "SMDKV210" 120 select CPU_S5PV210 121 + select S3C_DEV_FB 122 select S3C_DEV_HSMMC 123 select S3C_DEV_HSMMC1 124 select S3C_DEV_HSMMC2 ··· 130 select SAMSUNG_DEV_IDE 131 select SAMSUNG_DEV_KEYPAD 132 select SAMSUNG_DEV_TS 133 + select S5PV210_SETUP_FB_24BPP 134 select S5PV210_SETUP_I2C1 135 select S5PV210_SETUP_I2C2 136 select S5PV210_SETUP_IDE
+10 -15
arch/arm/mach-s5pv210/clock.c
··· 309 .get_rate = s5pv210_clk_fout_apll_get_rate, 310 }; 311 312 - static struct clk init_clocks_disable[] = { 313 { 314 .name = "pdma", 315 .id = 0, ··· 525 .parent = &clk_pclk_psys.clk, 526 .enable = s5pv210_clk_ip3_ctrl, 527 .ctrlbit = (1 << 20), 528 }, 529 }; 530 ··· 1226 1227 void __init s5pv210_register_clocks(void) 1228 { 1229 - struct clk *clkp; 1230 - int ret; 1231 int ptr; 1232 1233 - ret = s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1234 - if (ret > 0) 1235 - printk(KERN_ERR "Failed to register %u clocks\n", ret); 1236 1237 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1238 s3c_register_clksrc(sysclks[ptr], 1); ··· 1236 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1237 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1238 1239 - clkp = init_clocks_disable; 1240 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 1241 - ret = s3c24xx_register_clock(clkp); 1242 - if (ret < 0) { 1243 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 1244 - clkp->name, ret); 1245 - } 1246 - (clkp->enable)(clkp, 0); 1247 - } 1248 1249 s3c_pwmclk_init(); 1250 }
··· 309 .get_rate = s5pv210_clk_fout_apll_get_rate, 310 }; 311 312 + static struct clk init_clocks_off[] = { 313 { 314 .name = "pdma", 315 .id = 0, ··· 525 .parent = &clk_pclk_psys.clk, 526 .enable = s5pv210_clk_ip3_ctrl, 527 .ctrlbit = (1 << 20), 528 + }, { 529 + .name = "sromc", 530 + .id = -1, 531 + .parent = &clk_hclk_psys.clk, 532 + .enable = s5pv210_clk_ip1_ctrl, 533 + .ctrlbit = (1 << 26), 534 }, 535 }; 536 ··· 1220 1221 void __init s5pv210_register_clocks(void) 1222 { 1223 int ptr; 1224 1225 + s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1226 1227 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1228 s3c_register_clksrc(sysclks[ptr], 1); ··· 1234 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1235 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1236 1237 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1238 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1239 1240 s3c_pwmclk_init(); 1241 }
-5
arch/arm/mach-s5pv210/cpu.c
··· 81 .length = SZ_512K, 82 .type = MT_DEVICE, 83 }, { 84 - .virtual = (unsigned long)S5P_VA_SROMC, 85 - .pfn = __phys_to_pfn(S5PV210_PA_SROMC), 86 - .length = SZ_4K, 87 - .type = MT_DEVICE, 88 - }, { 89 .virtual = (unsigned long)S5P_VA_DMC0, 90 .pfn = __phys_to_pfn(S5PV210_PA_DMC0), 91 .length = SZ_4K,
··· 81 .length = SZ_512K, 82 .type = MT_DEVICE, 83 }, { 84 .virtual = (unsigned long)S5P_VA_DMC0, 85 .pfn = __phys_to_pfn(S5PV210_PA_DMC0), 86 .length = SZ_4K,
+2 -1
arch/arm/mach-s5pv210/include/mach/irqs.h
··· 65 #define IRQ_HSMMC0 S5P_IRQ_VIC1(26) 66 #define IRQ_HSMMC1 S5P_IRQ_VIC1(27) 67 #define IRQ_HSMMC2 S5P_IRQ_VIC1(28) 68 - #define IRQ_MIPICSI S5P_IRQ_VIC1(29) 69 #define IRQ_MIPIDSI S5P_IRQ_VIC1(30) 70 #define IRQ_ONENAND_AUDI S5P_IRQ_VIC1(31) 71 ··· 132 #define IRQ_LCD_FIFO IRQ_LCD0 133 #define IRQ_LCD_VSYNC IRQ_LCD1 134 #define IRQ_LCD_SYSTEM IRQ_LCD2 135 136 #endif /* ASM_ARCH_IRQS_H */
··· 65 #define IRQ_HSMMC0 S5P_IRQ_VIC1(26) 66 #define IRQ_HSMMC1 S5P_IRQ_VIC1(27) 67 #define IRQ_HSMMC2 S5P_IRQ_VIC1(28) 68 + #define IRQ_MIPI_CSIS S5P_IRQ_VIC1(29) 69 #define IRQ_MIPIDSI S5P_IRQ_VIC1(30) 70 #define IRQ_ONENAND_AUDI S5P_IRQ_VIC1(31) 71 ··· 132 #define IRQ_LCD_FIFO IRQ_LCD0 133 #define IRQ_LCD_VSYNC IRQ_LCD1 134 #define IRQ_LCD_SYSTEM IRQ_LCD2 135 + #define IRQ_MIPI_CSIS0 IRQ_MIPI_CSIS 136 137 #endif /* ASM_ARCH_IRQS_H */
+6
arch/arm/mach-s5pv210/include/mach/map.h
··· 16 #include <plat/map-base.h> 17 #include <plat/map-s5p.h> 18 19 #define S5PC110_PA_ONENAND (0xB0000000) 20 #define S5P_PA_ONENAND S5PC110_PA_ONENAND 21 ··· 62 #define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) 63 64 #define S5PV210_PA_SROMC (0xE8000000) 65 66 #define S5PV210_PA_CFCON (0xE8200000) 67 ··· 110 #define S5PV210_PA_DMC0 (0xF0000000) 111 #define S5PV210_PA_DMC1 (0xF1400000) 112 113 /* compatibiltiy defines. */ 114 #define S3C_PA_UART S5PV210_PA_UART 115 #define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0) ··· 128 #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 129 #define S5P_PA_FIMC1 S5PV210_PA_FIMC1 130 #define S5P_PA_FIMC2 S5PV210_PA_FIMC2 131 132 #define SAMSUNG_PA_ADC S5PV210_PA_ADC 133 #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
··· 16 #include <plat/map-base.h> 17 #include <plat/map-s5p.h> 18 19 + #define S5PV210_PA_SROM_BANK5 (0xA8000000) 20 + 21 #define S5PC110_PA_ONENAND (0xB0000000) 22 #define S5P_PA_ONENAND S5PC110_PA_ONENAND 23 ··· 60 #define S3C_VA_UARTx(x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) 61 62 #define S5PV210_PA_SROMC (0xE8000000) 63 + #define S5P_PA_SROMC S5PV210_PA_SROMC 64 65 #define S5PV210_PA_CFCON (0xE8200000) 66 ··· 107 #define S5PV210_PA_DMC0 (0xF0000000) 108 #define S5PV210_PA_DMC1 (0xF1400000) 109 110 + #define S5PV210_PA_MIPI_CSIS 0xFA600000 111 + 112 /* compatibiltiy defines. */ 113 #define S3C_PA_UART S5PV210_PA_UART 114 #define S3C_PA_HSMMC0 S5PV210_PA_HSMMC(0) ··· 123 #define S5P_PA_FIMC0 S5PV210_PA_FIMC0 124 #define S5P_PA_FIMC1 S5PV210_PA_FIMC1 125 #define S5P_PA_FIMC2 S5PV210_PA_FIMC2 126 + #define S5P_PA_MIPI_CSIS0 S5PV210_PA_MIPI_CSIS 127 128 #define SAMSUNG_PA_ADC S5PV210_PA_ADC 129 #define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
+1 -4
arch/arm/mach-s5pv210/include/mach/regs-clock.h
··· 161 #define S5P_MDNIE_SEL S5P_CLKREG(0x7008) 162 #define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) 163 #define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) 164 - #define S5P_MIPI_CONTROL S5P_CLKREG(0xE814) 165 166 #define S5P_IDLE_CFG_TL_MASK (3 << 30) 167 #define S5P_IDLE_CFG_TM_MASK (3 << 28) ··· 194 #define S5P_OTHERS_RET_MMC (1 << 29) 195 #define S5P_OTHERS_RET_UART (1 << 28) 196 #define S5P_OTHERS_USB_SIG_MASK (1 << 16) 197 - 198 - /* MIPI */ 199 - #define S5P_MIPI_DPHY_EN (3) 200 201 /* S5P_DAC_CONTROL */ 202 #define S5P_DAC_ENABLE (1)
··· 161 #define S5P_MDNIE_SEL S5P_CLKREG(0x7008) 162 #define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200) 163 #define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204) 164 + #define S5P_MIPI_DPHY_CONTROL S5P_CLKREG(0xE814) 165 166 #define S5P_IDLE_CFG_TL_MASK (3 << 30) 167 #define S5P_IDLE_CFG_TM_MASK (3 << 28) ··· 194 #define S5P_OTHERS_RET_MMC (1 << 29) 195 #define S5P_OTHERS_RET_UART (1 << 28) 196 #define S5P_OTHERS_USB_SIG_MASK (1 << 16) 197 198 /* S5P_DAC_CONTROL */ 199 #define S5P_DAC_ENABLE (1)
+1
arch/arm/mach-s5pv210/mach-smdkc110.c
··· 94 95 static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { 96 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ 97 }; 98 99 static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
··· 94 95 static struct i2c_board_info smdkc110_i2c_devs0[] __initdata = { 96 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ 97 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 98 }; 99 100 static struct i2c_board_info smdkc110_i2c_devs1[] __initdata = {
+135 -4
arch/arm/mach-s5pv210/mach-smdkv210.c
··· 14 #include <linux/init.h> 15 #include <linux/serial_core.h> 16 #include <linux/sysdev.h> 17 18 #include <asm/mach/arch.h> 19 #include <asm/mach/map.h> 20 #include <asm/setup.h> 21 #include <asm/mach-types.h> 22 23 #include <mach/map.h> 24 #include <mach/regs-clock.h> 25 26 #include <plat/regs-serial.h> 27 #include <plat/s5pv210.h> 28 #include <plat/devs.h> 29 #include <plat/cpu.h> ··· 42 #include <plat/iic.h> 43 #include <plat/keypad.h> 44 #include <plat/pm.h> 45 46 /* Following are default values for UCON, ULCON and UFCON UART registers */ 47 #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 112 .cols = 8, 113 }; 114 115 static struct platform_device *smdkv210_devices[] __initdata = { 116 - &s5pv210_device_iis0, 117 - &s5pv210_device_ac97, 118 - &s5pv210_device_spdif, 119 &s3c_device_adc, 120 &s3c_device_cfcon, 121 &s3c_device_hsmmc0, 122 &s3c_device_hsmmc1, 123 &s3c_device_hsmmc2, ··· 219 &s3c_device_i2c0, 220 &s3c_device_i2c1, 221 &s3c_device_i2c2, 222 - &samsung_device_keypad, 223 &s3c_device_rtc, 224 &s3c_device_ts, 225 &s3c_device_wdt, 226 }; 227 228 static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { 229 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ 230 }; 231 232 static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = { ··· 277 { 278 s3c_pm_init(); 279 280 samsung_keypad_set_platdata(&smdkv210_keypad_data); 281 s3c24xx_ts_set_platdata(&s3c_ts_platform); 282 ··· 293 ARRAY_SIZE(smdkv210_i2c_devs2)); 294 295 s3c_ide_set_platdata(&smdkv210_ide_pdata); 296 297 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); 298 }
··· 14 #include <linux/init.h> 15 #include <linux/serial_core.h> 16 #include <linux/sysdev.h> 17 + #include <linux/dm9000.h> 18 + #include <linux/fb.h> 19 + #include <linux/gpio.h> 20 + #include <linux/delay.h> 21 22 #include <asm/mach/arch.h> 23 #include <asm/mach/map.h> 24 #include <asm/setup.h> 25 #include <asm/mach-types.h> 26 27 + #include <video/platform_lcd.h> 28 + 29 #include <mach/map.h> 30 #include <mach/regs-clock.h> 31 + #include <mach/regs-fb.h> 32 33 #include <plat/regs-serial.h> 34 + #include <plat/regs-srom.h> 35 + #include <plat/gpio-cfg.h> 36 #include <plat/s5pv210.h> 37 #include <plat/devs.h> 38 #include <plat/cpu.h> ··· 33 #include <plat/iic.h> 34 #include <plat/keypad.h> 35 #include <plat/pm.h> 36 + #include <plat/fb.h> 37 38 /* Following are default values for UCON, ULCON and UFCON UART registers */ 39 #define SMDKV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 102 .cols = 8, 103 }; 104 105 + static struct resource smdkv210_dm9000_resources[] = { 106 + [0] = { 107 + .start = S5PV210_PA_SROM_BANK5, 108 + .end = S5PV210_PA_SROM_BANK5, 109 + .flags = IORESOURCE_MEM, 110 + }, 111 + [1] = { 112 + .start = S5PV210_PA_SROM_BANK5 + 2, 113 + .end = S5PV210_PA_SROM_BANK5 + 2, 114 + .flags = IORESOURCE_MEM, 115 + }, 116 + [2] = { 117 + .start = IRQ_EINT(9), 118 + .end = IRQ_EINT(9), 119 + .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 120 + }, 121 + }; 122 + 123 + static struct dm9000_plat_data smdkv210_dm9000_platdata = { 124 + .flags = DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM, 125 + .dev_addr = { 0x00, 0x09, 0xc0, 0xff, 0xec, 0x48 }, 126 + }; 127 + 128 + struct platform_device smdkv210_dm9000 = { 129 + .name = "dm9000", 130 + .id = -1, 131 + .num_resources = ARRAY_SIZE(smdkv210_dm9000_resources), 132 + .resource = smdkv210_dm9000_resources, 133 + .dev = { 134 + .platform_data = &smdkv210_dm9000_platdata, 135 + }, 136 + }; 137 + 138 + static void smdkv210_lte480wv_set_power(struct plat_lcd_data *pd, 139 + unsigned int power) 140 + { 141 + if (power) { 142 + #if !defined(CONFIG_BACKLIGHT_PWM) 143 + gpio_request(S5PV210_GPD0(3), "GPD0"); 144 + gpio_direction_output(S5PV210_GPD0(3), 1); 145 + gpio_free(S5PV210_GPD0(3)); 146 + #endif 147 + 148 + /* fire nRESET on power up */ 149 + gpio_request(S5PV210_GPH0(6), "GPH0"); 150 + 151 + gpio_direction_output(S5PV210_GPH0(6), 1); 152 + 153 + gpio_set_value(S5PV210_GPH0(6), 0); 154 + mdelay(10); 155 + 156 + gpio_set_value(S5PV210_GPH0(6), 1); 157 + mdelay(10); 158 + 159 + gpio_free(S5PV210_GPH0(6)); 160 + } else { 161 + #if !defined(CONFIG_BACKLIGHT_PWM) 162 + gpio_request(S5PV210_GPD0(3), "GPD0"); 163 + gpio_direction_output(S5PV210_GPD0(3), 0); 164 + gpio_free(S5PV210_GPD0(3)); 165 + #endif 166 + } 167 + } 168 + 169 + static struct plat_lcd_data smdkv210_lcd_lte480wv_data = { 170 + .set_power = smdkv210_lte480wv_set_power, 171 + }; 172 + 173 + static struct platform_device smdkv210_lcd_lte480wv = { 174 + .name = "platform-lcd", 175 + .dev.parent = &s3c_device_fb.dev, 176 + .dev.platform_data = &smdkv210_lcd_lte480wv_data, 177 + }; 178 + 179 + static struct s3c_fb_pd_win smdkv210_fb_win0 = { 180 + .win_mode = { 181 + .left_margin = 13, 182 + .right_margin = 8, 183 + .upper_margin = 7, 184 + .lower_margin = 5, 185 + .hsync_len = 3, 186 + .vsync_len = 1, 187 + .xres = 800, 188 + .yres = 480, 189 + }, 190 + .max_bpp = 32, 191 + .default_bpp = 24, 192 + }; 193 + 194 + static struct s3c_fb_platdata smdkv210_lcd0_pdata __initdata = { 195 + .win[0] = &smdkv210_fb_win0, 196 + .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB, 197 + .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 198 + .setup_gpio = s5pv210_fb_gpio_setup_24bpp, 199 + }; 200 + 201 static struct platform_device *smdkv210_devices[] __initdata = { 202 &s3c_device_adc, 203 &s3c_device_cfcon, 204 + &s3c_device_fb, 205 &s3c_device_hsmmc0, 206 &s3c_device_hsmmc1, 207 &s3c_device_hsmmc2, ··· 115 &s3c_device_i2c0, 116 &s3c_device_i2c1, 117 &s3c_device_i2c2, 118 &s3c_device_rtc, 119 &s3c_device_ts, 120 &s3c_device_wdt, 121 + &s5pv210_device_ac97, 122 + &s5pv210_device_iis0, 123 + &s5pv210_device_spdif, 124 + &samsung_device_keypad, 125 + &smdkv210_dm9000, 126 + &smdkv210_lcd_lte480wv, 127 }; 128 + 129 + static void __init smdkv210_dm9000_init(void) 130 + { 131 + unsigned int tmp; 132 + 133 + gpio_request(S5PV210_MP01(5), "nCS5"); 134 + s3c_gpio_cfgpin(S5PV210_MP01(5), S3C_GPIO_SFN(2)); 135 + gpio_free(S5PV210_MP01(5)); 136 + 137 + tmp = (5 << S5P_SROM_BCX__TACC__SHIFT); 138 + __raw_writel(tmp, S5P_SROM_BC5); 139 + 140 + tmp = __raw_readl(S5P_SROM_BW); 141 + tmp &= (S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS5__SHIFT); 142 + tmp |= (1 << S5P_SROM_BW__NCS5__SHIFT); 143 + __raw_writel(tmp, S5P_SROM_BW); 144 + } 145 146 static struct i2c_board_info smdkv210_i2c_devs0[] __initdata = { 147 { I2C_BOARD_INFO("24c08", 0x50), }, /* Samsung S524AD0XD1 */ 148 + { I2C_BOARD_INFO("wm8580", 0x1b), }, 149 }; 150 151 static struct i2c_board_info smdkv210_i2c_devs1[] __initdata = { ··· 150 { 151 s3c_pm_init(); 152 153 + smdkv210_dm9000_init(); 154 + 155 samsung_keypad_set_platdata(&smdkv210_keypad_data); 156 s3c24xx_ts_set_platdata(&s3c_ts_platform); 157 ··· 164 ARRAY_SIZE(smdkv210_i2c_devs2)); 165 166 s3c_ide_set_platdata(&smdkv210_ide_pdata); 167 + 168 + s3c_fb_set_platdata(&smdkv210_lcd0_pdata); 169 170 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); 171 }
+21
arch/arm/mach-s5pv310/Kconfig
··· 15 help 16 Enable S5PV310 CPU support 17 18 config S5PV310_SETUP_I2C1 19 bool 20 help ··· 66 help 67 Common setup code for SDHCI gpio. 68 69 # machine support 70 71 menu "S5PC210 Machines" ··· 80 select CPU_S5PV310 81 select S3C_DEV_RTC 82 select S3C_DEV_WDT 83 select S3C_DEV_HSMMC 84 select S3C_DEV_HSMMC1 85 select S3C_DEV_HSMMC2 86 select S3C_DEV_HSMMC3 87 select S5PV310_SETUP_SDHCI 88 help 89 Machine support for Samsung SMDKC210 90 S5PC210(MCP) is one of package option of S5PV310 ··· 97 bool "Mobile UNIVERSAL_C210 Board" 98 select CPU_S5PV310 99 select S5P_DEV_ONENAND 100 select S3C_DEV_I2C1 101 select S5PV310_SETUP_I2C1 102 help ··· 116 select CPU_S5PV310 117 select S3C_DEV_RTC 118 select S3C_DEV_WDT 119 select S3C_DEV_HSMMC 120 select S3C_DEV_HSMMC1 121 select S3C_DEV_HSMMC2 122 select S3C_DEV_HSMMC3 123 select S5PV310_SETUP_SDHCI 124 help 125 Machine support for Samsung SMDKV310
··· 15 help 16 Enable S5PV310 CPU support 17 18 + config S5PV310_DEV_PD 19 + bool 20 + help 21 + Compile in platform device definitions for Power Domain 22 + 23 config S5PV310_SETUP_I2C1 24 bool 25 help ··· 61 help 62 Common setup code for SDHCI gpio. 63 64 + config S5PV310_DEV_SYSMMU 65 + bool 66 + help 67 + Common setup code for SYSTEM MMU in S5PV310 68 + 69 # machine support 70 71 menu "S5PC210 Machines" ··· 70 select CPU_S5PV310 71 select S3C_DEV_RTC 72 select S3C_DEV_WDT 73 + select S3C_DEV_I2C1 74 select S3C_DEV_HSMMC 75 select S3C_DEV_HSMMC1 76 select S3C_DEV_HSMMC2 77 select S3C_DEV_HSMMC3 78 + select S5PV310_DEV_PD 79 + select S5PV310_SETUP_I2C1 80 select S5PV310_SETUP_SDHCI 81 + select S5PV310_DEV_SYSMMU 82 help 83 Machine support for Samsung SMDKC210 84 S5PC210(MCP) is one of package option of S5PV310 ··· 83 bool "Mobile UNIVERSAL_C210 Board" 84 select CPU_S5PV310 85 select S5P_DEV_ONENAND 86 + select S3C_DEV_HSMMC 87 + select S3C_DEV_HSMMC2 88 + select S3C_DEV_HSMMC3 89 + select S5PV310_SETUP_SDHCI 90 select S3C_DEV_I2C1 91 select S5PV310_SETUP_I2C1 92 help ··· 98 select CPU_S5PV310 99 select S3C_DEV_RTC 100 select S3C_DEV_WDT 101 + select S3C_DEV_I2C1 102 select S3C_DEV_HSMMC 103 select S3C_DEV_HSMMC1 104 select S3C_DEV_HSMMC2 105 select S3C_DEV_HSMMC3 106 + select S5PV310_DEV_PD 107 + select S5PV310_SETUP_I2C1 108 select S5PV310_SETUP_SDHCI 109 help 110 Machine support for Samsung SMDKV310
+5 -1
arch/arm/mach-s5pv310/Makefile
··· 14 15 obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o 16 obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o dma.o 17 18 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 19 obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o ··· 28 29 # device support 30 31 - obj-y += dev-audio.o 32 obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o 33 obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o 34 obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
··· 14 15 obj-$(CONFIG_CPU_S5PV310) += cpu.o init.o clock.o irq-combiner.o 16 obj-$(CONFIG_CPU_S5PV310) += setup-i2c0.o time.o gpiolib.o irq-eint.o dma.o 17 + obj-$(CONFIG_CPU_FREQ) += cpufreq.o 18 19 obj-$(CONFIG_SMP) += platsmp.o headsmp.o 20 obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o ··· 27 28 # device support 29 30 + obj-y += dev-audio.o 31 + obj-$(CONFIG_S5PV310_DEV_PD) += dev-pd.o 32 + obj-$(CONFIG_S5PV310_DEV_SYSMMU) += dev-sysmmu.o 33 + 34 obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o 35 obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o 36 obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
+55 -22
arch/arm/mach-s5pv310/clock.c
··· 244 .id = -1, 245 }, 246 .sources = &clkset_mout_corebus, 247 - .reg_src = { .reg = S5P_CLKSRC_CORE, .shift = 4, .size = 1 }, 248 }; 249 250 static struct clksrc_clk clk_sclk_dmc = { ··· 253 .id = -1, 254 .parent = &clk_mout_corebus.clk, 255 }, 256 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 12, .size = 3 }, 257 }; 258 259 static struct clksrc_clk clk_aclk_cored = { ··· 262 .id = -1, 263 .parent = &clk_sclk_dmc.clk, 264 }, 265 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 16, .size = 3 }, 266 }; 267 268 static struct clksrc_clk clk_aclk_corep = { ··· 271 .id = -1, 272 .parent = &clk_aclk_cored.clk, 273 }, 274 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 20, .size = 3 }, 275 }; 276 277 static struct clksrc_clk clk_aclk_acp = { ··· 280 .id = -1, 281 .parent = &clk_mout_corebus.clk, 282 }, 283 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 0, .size = 3 }, 284 }; 285 286 static struct clksrc_clk clk_pclk_acp = { ··· 289 .id = -1, 290 .parent = &clk_aclk_acp.clk, 291 }, 292 - .reg_div = { .reg = S5P_CLKDIV_CORE0, .shift = 4, .size = 3 }, 293 }; 294 295 /* Core list of CMU_TOP side */ ··· 384 .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 8, .size = 1 }, 385 }; 386 387 - static struct clk init_clocks_disable[] = { 388 { 389 .name = "timers", 390 .id = -1, ··· 467 .enable = s5pv310_clk_ip_fsys_ctrl, 468 .ctrlbit = (1 << 10), 469 }, { 470 .name = "adc", 471 .id = -1, 472 .enable = s5pv310_clk_ip_peril_ctrl, ··· 516 .id = 2, 517 .enable = s5pv310_clk_ip_peril_ctrl, 518 .ctrlbit = (1 << 18), 519 }, { 520 .name = "fimg2d", 521 .id = -1, ··· 1020 &clk_dout_mmc4, 1021 }; 1022 1023 void __init_or_cpufreq s5pv310_setup_clocks(void) 1024 { 1025 struct clk *xtal_clk; ··· 1054 BUG_ON(IS_ERR(xtal_clk)); 1055 1056 xtal = clk_get_rate(xtal_clk); 1057 clk_put(xtal_clk); 1058 1059 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); ··· 1070 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), 1071 __raw_readl(S5P_VPLL_CON1), pll_4650); 1072 1073 - clk_fout_apll.rate = apll; 1074 clk_fout_mpll.rate = mpll; 1075 clk_fout_epll.rate = epll; 1076 clk_fout_vpll.rate = vpll; ··· 1105 1106 void __init s5pv310_register_clocks(void) 1107 { 1108 - struct clk *clkp; 1109 - int ret; 1110 int ptr; 1111 1112 - ret = s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1113 - if (ret > 0) 1114 - printk(KERN_ERR "Failed to register %u clocks\n", ret); 1115 1116 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1117 s3c_register_clksrc(sysclks[ptr], 1); ··· 1115 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1116 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1117 1118 - clkp = init_clocks_disable; 1119 - for (ptr = 0; ptr < ARRAY_SIZE(init_clocks_disable); ptr++, clkp++) { 1120 - ret = s3c24xx_register_clock(clkp); 1121 - if (ret < 0) { 1122 - printk(KERN_ERR "Failed to register clock %s (%d)\n", 1123 - clkp->name, ret); 1124 - } 1125 - (clkp->enable)(clkp, 0); 1126 - } 1127 1128 s3c_pwmclk_init(); 1129 }
··· 244 .id = -1, 245 }, 246 .sources = &clkset_mout_corebus, 247 + .reg_src = { .reg = S5P_CLKSRC_DMC, .shift = 4, .size = 1 }, 248 }; 249 250 static struct clksrc_clk clk_sclk_dmc = { ··· 253 .id = -1, 254 .parent = &clk_mout_corebus.clk, 255 }, 256 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 12, .size = 3 }, 257 }; 258 259 static struct clksrc_clk clk_aclk_cored = { ··· 262 .id = -1, 263 .parent = &clk_sclk_dmc.clk, 264 }, 265 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 16, .size = 3 }, 266 }; 267 268 static struct clksrc_clk clk_aclk_corep = { ··· 271 .id = -1, 272 .parent = &clk_aclk_cored.clk, 273 }, 274 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 20, .size = 3 }, 275 }; 276 277 static struct clksrc_clk clk_aclk_acp = { ··· 280 .id = -1, 281 .parent = &clk_mout_corebus.clk, 282 }, 283 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 0, .size = 3 }, 284 }; 285 286 static struct clksrc_clk clk_pclk_acp = { ··· 289 .id = -1, 290 .parent = &clk_aclk_acp.clk, 291 }, 292 + .reg_div = { .reg = S5P_CLKDIV_DMC0, .shift = 4, .size = 3 }, 293 }; 294 295 /* Core list of CMU_TOP side */ ··· 384 .reg_src = { .reg = S5P_CLKSRC_TOP0, .shift = 8, .size = 1 }, 385 }; 386 387 + static struct clk init_clocks_off[] = { 388 { 389 .name = "timers", 390 .id = -1, ··· 467 .enable = s5pv310_clk_ip_fsys_ctrl, 468 .ctrlbit = (1 << 10), 469 }, { 470 + .name = "pdma", 471 + .id = 0, 472 + .enable = s5pv310_clk_ip_fsys_ctrl, 473 + .ctrlbit = (1 << 0), 474 + }, { 475 + .name = "pdma", 476 + .id = 1, 477 + .enable = s5pv310_clk_ip_fsys_ctrl, 478 + .ctrlbit = (1 << 1), 479 + }, { 480 .name = "adc", 481 .id = -1, 482 .enable = s5pv310_clk_ip_peril_ctrl, ··· 506 .id = 2, 507 .enable = s5pv310_clk_ip_peril_ctrl, 508 .ctrlbit = (1 << 18), 509 + }, { 510 + .name = "iis", 511 + .id = 0, 512 + .enable = s5pv310_clk_ip_peril_ctrl, 513 + .ctrlbit = (1 << 19), 514 + }, { 515 + .name = "iis", 516 + .id = 1, 517 + .enable = s5pv310_clk_ip_peril_ctrl, 518 + .ctrlbit = (1 << 20), 519 + }, { 520 + .name = "iis", 521 + .id = 2, 522 + .enable = s5pv310_clk_ip_peril_ctrl, 523 + .ctrlbit = (1 << 21), 524 + }, { 525 + .name = "ac97", 526 + .id = -1, 527 + .enable = s5pv310_clk_ip_peril_ctrl, 528 + .ctrlbit = (1 << 27), 529 }, { 530 .name = "fimg2d", 531 .id = -1, ··· 990 &clk_dout_mmc4, 991 }; 992 993 + static int xtal_rate; 994 + 995 + static unsigned long s5pv310_fout_apll_get_rate(struct clk *clk) 996 + { 997 + return s5p_get_pll45xx(xtal_rate, __raw_readl(S5P_APLL_CON0), pll_4508); 998 + } 999 + 1000 + static struct clk_ops s5pv310_fout_apll_ops = { 1001 + .get_rate = s5pv310_fout_apll_get_rate, 1002 + }; 1003 + 1004 void __init_or_cpufreq s5pv310_setup_clocks(void) 1005 { 1006 struct clk *xtal_clk; ··· 1013 BUG_ON(IS_ERR(xtal_clk)); 1014 1015 xtal = clk_get_rate(xtal_clk); 1016 + 1017 + xtal_rate = xtal; 1018 + 1019 clk_put(xtal_clk); 1020 1021 printk(KERN_DEBUG "%s: xtal is %ld\n", __func__, xtal); ··· 1026 vpll = s5p_get_pll46xx(vpllsrc, __raw_readl(S5P_VPLL_CON0), 1027 __raw_readl(S5P_VPLL_CON1), pll_4650); 1028 1029 + clk_fout_apll.ops = &s5pv310_fout_apll_ops; 1030 clk_fout_mpll.rate = mpll; 1031 clk_fout_epll.rate = epll; 1032 clk_fout_vpll.rate = vpll; ··· 1061 1062 void __init s5pv310_register_clocks(void) 1063 { 1064 int ptr; 1065 1066 + s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 1067 1068 for (ptr = 0; ptr < ARRAY_SIZE(sysclks); ptr++) 1069 s3c_register_clksrc(sysclks[ptr], 1); ··· 1075 s3c_register_clksrc(clksrcs, ARRAY_SIZE(clksrcs)); 1076 s3c_register_clocks(init_clocks, ARRAY_SIZE(init_clocks)); 1077 1078 + s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1079 + s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); 1080 1081 s3c_pwmclk_init(); 1082 }
+20 -1
arch/arm/mach-s5pv310/cpu.c
··· 41 .length = SZ_128K, 42 .type = MT_DEVICE, 43 }, { 44 .virtual = (unsigned long)S5P_VA_COMBINER_BASE, 45 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER), 46 .length = SZ_4K, ··· 74 .virtual = (unsigned long)S5P_VA_GPIO3, 75 .pfn = __phys_to_pfn(S5PV310_PA_GPIO3), 76 .length = SZ_256, 77 .type = MT_DEVICE, 78 }, { 79 .virtual = (unsigned long)S3C_VA_UART, ··· 133 gic_init(0, IRQ_LOCALTIMER, S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 134 135 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 136 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), 137 COMBINER_IRQ(irq, 0)); 138 combiner_cascade_irq(irq, IRQ_SPI(irq)); ··· 183 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN, 184 S5P_VA_L2CC + L2X0_POWER_CTRL); 185 186 - l2x0_init(S5P_VA_L2CC, 0x7C070001, 0xC200ffff); 187 188 return 0; 189 }
··· 41 .length = SZ_128K, 42 .type = MT_DEVICE, 43 }, { 44 + .virtual = (unsigned long)S5P_VA_PMU, 45 + .pfn = __phys_to_pfn(S5PV310_PA_PMU), 46 + .length = SZ_64K, 47 + .type = MT_DEVICE, 48 + }, { 49 .virtual = (unsigned long)S5P_VA_COMBINER_BASE, 50 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER), 51 .length = SZ_4K, ··· 69 .virtual = (unsigned long)S5P_VA_GPIO3, 70 .pfn = __phys_to_pfn(S5PV310_PA_GPIO3), 71 .length = SZ_256, 72 + .type = MT_DEVICE, 73 + }, { 74 + .virtual = (unsigned long)S5P_VA_DMC0, 75 + .pfn = __phys_to_pfn(S5PV310_PA_DMC0), 76 + .length = SZ_4K, 77 .type = MT_DEVICE, 78 }, { 79 .virtual = (unsigned long)S3C_VA_UART, ··· 123 gic_init(0, IRQ_LOCALTIMER, S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 124 125 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 126 + 127 + /* 128 + * From SPI(0) to SPI(39) and SPI(51), SPI(53) are 129 + * connected to the interrupt combiner. These irqs 130 + * should be initialized to support cascade interrupt. 131 + */ 132 + if ((irq >= 40) && !(irq == 51) && !(irq == 53)) 133 + continue; 134 + 135 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), 136 COMBINER_IRQ(irq, 0)); 137 combiner_cascade_irq(irq, IRQ_SPI(irq)); ··· 164 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN, 165 S5P_VA_L2CC + L2X0_POWER_CTRL); 166 167 + l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff); 168 169 return 0; 170 }
+580
arch/arm/mach-s5pv310/cpufreq.c
···
··· 1 + /* linux/arch/arm/mach-s5pv310/cpufreq.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - CPU frequency scaling support 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/types.h> 14 + #include <linux/kernel.h> 15 + #include <linux/err.h> 16 + #include <linux/clk.h> 17 + #include <linux/io.h> 18 + #include <linux/slab.h> 19 + #include <linux/regulator/consumer.h> 20 + #include <linux/cpufreq.h> 21 + 22 + #include <mach/map.h> 23 + #include <mach/regs-clock.h> 24 + #include <mach/regs-mem.h> 25 + 26 + #include <plat/clock.h> 27 + #include <plat/pm.h> 28 + 29 + static struct clk *cpu_clk; 30 + static struct clk *moutcore; 31 + static struct clk *mout_mpll; 32 + static struct clk *mout_apll; 33 + 34 + #ifdef CONFIG_REGULATOR 35 + static struct regulator *arm_regulator; 36 + static struct regulator *int_regulator; 37 + #endif 38 + 39 + static struct cpufreq_freqs freqs; 40 + static unsigned int memtype; 41 + 42 + enum s5pv310_memory_type { 43 + DDR2 = 4, 44 + LPDDR2, 45 + DDR3, 46 + }; 47 + 48 + enum cpufreq_level_index { 49 + L0, L1, L2, L3, CPUFREQ_LEVEL_END, 50 + }; 51 + 52 + static struct cpufreq_frequency_table s5pv310_freq_table[] = { 53 + {L0, 1000*1000}, 54 + {L1, 800*1000}, 55 + {L2, 400*1000}, 56 + {L3, 100*1000}, 57 + {0, CPUFREQ_TABLE_END}, 58 + }; 59 + 60 + static unsigned int clkdiv_cpu0[CPUFREQ_LEVEL_END][7] = { 61 + /* 62 + * Clock divider value for following 63 + * { DIVCORE, DIVCOREM0, DIVCOREM1, DIVPERIPH, 64 + * DIVATB, DIVPCLK_DBG, DIVAPLL } 65 + */ 66 + 67 + /* ARM L0: 1000MHz */ 68 + { 0, 3, 7, 3, 3, 0, 1 }, 69 + 70 + /* ARM L1: 800MHz */ 71 + { 0, 3, 7, 3, 3, 0, 1 }, 72 + 73 + /* ARM L2: 400MHz */ 74 + { 0, 1, 3, 1, 3, 0, 1 }, 75 + 76 + /* ARM L3: 100MHz */ 77 + { 0, 0, 1, 0, 3, 1, 1 }, 78 + }; 79 + 80 + static unsigned int clkdiv_cpu1[CPUFREQ_LEVEL_END][2] = { 81 + /* 82 + * Clock divider value for following 83 + * { DIVCOPY, DIVHPM } 84 + */ 85 + 86 + /* ARM L0: 1000MHz */ 87 + { 3, 0 }, 88 + 89 + /* ARM L1: 800MHz */ 90 + { 3, 0 }, 91 + 92 + /* ARM L2: 400MHz */ 93 + { 3, 0 }, 94 + 95 + /* ARM L3: 100MHz */ 96 + { 3, 0 }, 97 + }; 98 + 99 + static unsigned int clkdiv_dmc0[CPUFREQ_LEVEL_END][8] = { 100 + /* 101 + * Clock divider value for following 102 + * { DIVACP, DIVACP_PCLK, DIVDPHY, DIVDMC, DIVDMCD 103 + * DIVDMCP, DIVCOPY2, DIVCORE_TIMERS } 104 + */ 105 + 106 + /* DMC L0: 400MHz */ 107 + { 3, 1, 1, 1, 1, 1, 3, 1 }, 108 + 109 + /* DMC L1: 400MHz */ 110 + { 3, 1, 1, 1, 1, 1, 3, 1 }, 111 + 112 + /* DMC L2: 266.7MHz */ 113 + { 7, 1, 1, 2, 1, 1, 3, 1 }, 114 + 115 + /* DMC L3: 200MHz */ 116 + { 7, 1, 1, 3, 1, 1, 3, 1 }, 117 + }; 118 + 119 + static unsigned int clkdiv_top[CPUFREQ_LEVEL_END][5] = { 120 + /* 121 + * Clock divider value for following 122 + * { DIVACLK200, DIVACLK100, DIVACLK160, DIVACLK133, DIVONENAND } 123 + */ 124 + 125 + /* ACLK200 L0: 200MHz */ 126 + { 3, 7, 4, 5, 1 }, 127 + 128 + /* ACLK200 L1: 200MHz */ 129 + { 3, 7, 4, 5, 1 }, 130 + 131 + /* ACLK200 L2: 160MHz */ 132 + { 4, 7, 5, 7, 1 }, 133 + 134 + /* ACLK200 L3: 133.3MHz */ 135 + { 5, 7, 7, 7, 1 }, 136 + }; 137 + 138 + static unsigned int clkdiv_lr_bus[CPUFREQ_LEVEL_END][2] = { 139 + /* 140 + * Clock divider value for following 141 + * { DIVGDL/R, DIVGPL/R } 142 + */ 143 + 144 + /* ACLK_GDL/R L0: 200MHz */ 145 + { 3, 1 }, 146 + 147 + /* ACLK_GDL/R L1: 200MHz */ 148 + { 3, 1 }, 149 + 150 + /* ACLK_GDL/R L2: 160MHz */ 151 + { 4, 1 }, 152 + 153 + /* ACLK_GDL/R L3: 133.3MHz */ 154 + { 5, 1 }, 155 + }; 156 + 157 + struct cpufreq_voltage_table { 158 + unsigned int index; /* any */ 159 + unsigned int arm_volt; /* uV */ 160 + unsigned int int_volt; 161 + }; 162 + 163 + static struct cpufreq_voltage_table s5pv310_volt_table[CPUFREQ_LEVEL_END] = { 164 + { 165 + .index = L0, 166 + .arm_volt = 1200000, 167 + .int_volt = 1100000, 168 + }, { 169 + .index = L1, 170 + .arm_volt = 1100000, 171 + .int_volt = 1100000, 172 + }, { 173 + .index = L2, 174 + .arm_volt = 1000000, 175 + .int_volt = 1000000, 176 + }, { 177 + .index = L3, 178 + .arm_volt = 900000, 179 + .int_volt = 1000000, 180 + }, 181 + }; 182 + 183 + static unsigned int s5pv310_apll_pms_table[CPUFREQ_LEVEL_END] = { 184 + /* APLL FOUT L0: 1000MHz */ 185 + ((250 << 16) | (6 << 8) | 1), 186 + 187 + /* APLL FOUT L1: 800MHz */ 188 + ((200 << 16) | (6 << 8) | 1), 189 + 190 + /* APLL FOUT L2 : 400MHz */ 191 + ((200 << 16) | (6 << 8) | 2), 192 + 193 + /* APLL FOUT L3: 100MHz */ 194 + ((200 << 16) | (6 << 8) | 4), 195 + }; 196 + 197 + int s5pv310_verify_speed(struct cpufreq_policy *policy) 198 + { 199 + return cpufreq_frequency_table_verify(policy, s5pv310_freq_table); 200 + } 201 + 202 + unsigned int s5pv310_getspeed(unsigned int cpu) 203 + { 204 + return clk_get_rate(cpu_clk) / 1000; 205 + } 206 + 207 + void s5pv310_set_clkdiv(unsigned int div_index) 208 + { 209 + unsigned int tmp; 210 + 211 + /* Change Divider - CPU0 */ 212 + 213 + tmp = __raw_readl(S5P_CLKDIV_CPU); 214 + 215 + tmp &= ~(S5P_CLKDIV_CPU0_CORE_MASK | S5P_CLKDIV_CPU0_COREM0_MASK | 216 + S5P_CLKDIV_CPU0_COREM1_MASK | S5P_CLKDIV_CPU0_PERIPH_MASK | 217 + S5P_CLKDIV_CPU0_ATB_MASK | S5P_CLKDIV_CPU0_PCLKDBG_MASK | 218 + S5P_CLKDIV_CPU0_APLL_MASK); 219 + 220 + tmp |= ((clkdiv_cpu0[div_index][0] << S5P_CLKDIV_CPU0_CORE_SHIFT) | 221 + (clkdiv_cpu0[div_index][1] << S5P_CLKDIV_CPU0_COREM0_SHIFT) | 222 + (clkdiv_cpu0[div_index][2] << S5P_CLKDIV_CPU0_COREM1_SHIFT) | 223 + (clkdiv_cpu0[div_index][3] << S5P_CLKDIV_CPU0_PERIPH_SHIFT) | 224 + (clkdiv_cpu0[div_index][4] << S5P_CLKDIV_CPU0_ATB_SHIFT) | 225 + (clkdiv_cpu0[div_index][5] << S5P_CLKDIV_CPU0_PCLKDBG_SHIFT) | 226 + (clkdiv_cpu0[div_index][6] << S5P_CLKDIV_CPU0_APLL_SHIFT)); 227 + 228 + __raw_writel(tmp, S5P_CLKDIV_CPU); 229 + 230 + do { 231 + tmp = __raw_readl(S5P_CLKDIV_STATCPU); 232 + } while (tmp & 0x1111111); 233 + 234 + /* Change Divider - CPU1 */ 235 + 236 + tmp = __raw_readl(S5P_CLKDIV_CPU1); 237 + 238 + tmp &= ~((0x7 << 4) | 0x7); 239 + 240 + tmp |= ((clkdiv_cpu1[div_index][0] << 4) | 241 + (clkdiv_cpu1[div_index][1] << 0)); 242 + 243 + __raw_writel(tmp, S5P_CLKDIV_CPU1); 244 + 245 + do { 246 + tmp = __raw_readl(S5P_CLKDIV_STATCPU1); 247 + } while (tmp & 0x11); 248 + 249 + /* Change Divider - DMC0 */ 250 + 251 + tmp = __raw_readl(S5P_CLKDIV_DMC0); 252 + 253 + tmp &= ~(S5P_CLKDIV_DMC0_ACP_MASK | S5P_CLKDIV_DMC0_ACPPCLK_MASK | 254 + S5P_CLKDIV_DMC0_DPHY_MASK | S5P_CLKDIV_DMC0_DMC_MASK | 255 + S5P_CLKDIV_DMC0_DMCD_MASK | S5P_CLKDIV_DMC0_DMCP_MASK | 256 + S5P_CLKDIV_DMC0_COPY2_MASK | S5P_CLKDIV_DMC0_CORETI_MASK); 257 + 258 + tmp |= ((clkdiv_dmc0[div_index][0] << S5P_CLKDIV_DMC0_ACP_SHIFT) | 259 + (clkdiv_dmc0[div_index][1] << S5P_CLKDIV_DMC0_ACPPCLK_SHIFT) | 260 + (clkdiv_dmc0[div_index][2] << S5P_CLKDIV_DMC0_DPHY_SHIFT) | 261 + (clkdiv_dmc0[div_index][3] << S5P_CLKDIV_DMC0_DMC_SHIFT) | 262 + (clkdiv_dmc0[div_index][4] << S5P_CLKDIV_DMC0_DMCD_SHIFT) | 263 + (clkdiv_dmc0[div_index][5] << S5P_CLKDIV_DMC0_DMCP_SHIFT) | 264 + (clkdiv_dmc0[div_index][6] << S5P_CLKDIV_DMC0_COPY2_SHIFT) | 265 + (clkdiv_dmc0[div_index][7] << S5P_CLKDIV_DMC0_CORETI_SHIFT)); 266 + 267 + __raw_writel(tmp, S5P_CLKDIV_DMC0); 268 + 269 + do { 270 + tmp = __raw_readl(S5P_CLKDIV_STAT_DMC0); 271 + } while (tmp & 0x11111111); 272 + 273 + /* Change Divider - TOP */ 274 + 275 + tmp = __raw_readl(S5P_CLKDIV_TOP); 276 + 277 + tmp &= ~(S5P_CLKDIV_TOP_ACLK200_MASK | S5P_CLKDIV_TOP_ACLK100_MASK | 278 + S5P_CLKDIV_TOP_ACLK160_MASK | S5P_CLKDIV_TOP_ACLK133_MASK | 279 + S5P_CLKDIV_TOP_ONENAND_MASK); 280 + 281 + tmp |= ((clkdiv_top[div_index][0] << S5P_CLKDIV_TOP_ACLK200_SHIFT) | 282 + (clkdiv_top[div_index][1] << S5P_CLKDIV_TOP_ACLK100_SHIFT) | 283 + (clkdiv_top[div_index][2] << S5P_CLKDIV_TOP_ACLK160_SHIFT) | 284 + (clkdiv_top[div_index][3] << S5P_CLKDIV_TOP_ACLK133_SHIFT) | 285 + (clkdiv_top[div_index][4] << S5P_CLKDIV_TOP_ONENAND_SHIFT)); 286 + 287 + __raw_writel(tmp, S5P_CLKDIV_TOP); 288 + 289 + do { 290 + tmp = __raw_readl(S5P_CLKDIV_STAT_TOP); 291 + } while (tmp & 0x11111); 292 + 293 + /* Change Divider - LEFTBUS */ 294 + 295 + tmp = __raw_readl(S5P_CLKDIV_LEFTBUS); 296 + 297 + tmp &= ~(S5P_CLKDIV_BUS_GDLR_MASK | S5P_CLKDIV_BUS_GPLR_MASK); 298 + 299 + tmp |= ((clkdiv_lr_bus[div_index][0] << S5P_CLKDIV_BUS_GDLR_SHIFT) | 300 + (clkdiv_lr_bus[div_index][1] << S5P_CLKDIV_BUS_GPLR_SHIFT)); 301 + 302 + __raw_writel(tmp, S5P_CLKDIV_LEFTBUS); 303 + 304 + do { 305 + tmp = __raw_readl(S5P_CLKDIV_STAT_LEFTBUS); 306 + } while (tmp & 0x11); 307 + 308 + /* Change Divider - RIGHTBUS */ 309 + 310 + tmp = __raw_readl(S5P_CLKDIV_RIGHTBUS); 311 + 312 + tmp &= ~(S5P_CLKDIV_BUS_GDLR_MASK | S5P_CLKDIV_BUS_GPLR_MASK); 313 + 314 + tmp |= ((clkdiv_lr_bus[div_index][0] << S5P_CLKDIV_BUS_GDLR_SHIFT) | 315 + (clkdiv_lr_bus[div_index][1] << S5P_CLKDIV_BUS_GPLR_SHIFT)); 316 + 317 + __raw_writel(tmp, S5P_CLKDIV_RIGHTBUS); 318 + 319 + do { 320 + tmp = __raw_readl(S5P_CLKDIV_STAT_RIGHTBUS); 321 + } while (tmp & 0x11); 322 + } 323 + 324 + static void s5pv310_set_apll(unsigned int index) 325 + { 326 + unsigned int tmp; 327 + 328 + /* 1. MUX_CORE_SEL = MPLL, ARMCLK uses MPLL for lock time */ 329 + clk_set_parent(moutcore, mout_mpll); 330 + 331 + do { 332 + tmp = (__raw_readl(S5P_CLKMUX_STATCPU) 333 + >> S5P_CLKSRC_CPU_MUXCORE_SHIFT); 334 + tmp &= 0x7; 335 + } while (tmp != 0x2); 336 + 337 + /* 2. Set APLL Lock time */ 338 + __raw_writel(S5P_APLL_LOCKTIME, S5P_APLL_LOCK); 339 + 340 + /* 3. Change PLL PMS values */ 341 + tmp = __raw_readl(S5P_APLL_CON0); 342 + tmp &= ~((0x3ff << 16) | (0x3f << 8) | (0x7 << 0)); 343 + tmp |= s5pv310_apll_pms_table[index]; 344 + __raw_writel(tmp, S5P_APLL_CON0); 345 + 346 + /* 4. wait_lock_time */ 347 + do { 348 + tmp = __raw_readl(S5P_APLL_CON0); 349 + } while (!(tmp & (0x1 << S5P_APLLCON0_LOCKED_SHIFT))); 350 + 351 + /* 5. MUX_CORE_SEL = APLL */ 352 + clk_set_parent(moutcore, mout_apll); 353 + 354 + do { 355 + tmp = __raw_readl(S5P_CLKMUX_STATCPU); 356 + tmp &= S5P_CLKMUX_STATCPU_MUXCORE_MASK; 357 + } while (tmp != (0x1 << S5P_CLKSRC_CPU_MUXCORE_SHIFT)); 358 + } 359 + 360 + static void s5pv310_set_frequency(unsigned int old_index, unsigned int new_index) 361 + { 362 + unsigned int tmp; 363 + 364 + if (old_index > new_index) { 365 + /* The frequency changing to L0 needs to change apll */ 366 + if (freqs.new == s5pv310_freq_table[L0].frequency) { 367 + /* 1. Change the system clock divider values */ 368 + s5pv310_set_clkdiv(new_index); 369 + 370 + /* 2. Change the apll m,p,s value */ 371 + s5pv310_set_apll(new_index); 372 + } else { 373 + /* 1. Change the system clock divider values */ 374 + s5pv310_set_clkdiv(new_index); 375 + 376 + /* 2. Change just s value in apll m,p,s value */ 377 + tmp = __raw_readl(S5P_APLL_CON0); 378 + tmp &= ~(0x7 << 0); 379 + tmp |= (s5pv310_apll_pms_table[new_index] & 0x7); 380 + __raw_writel(tmp, S5P_APLL_CON0); 381 + } 382 + } 383 + 384 + else if (old_index < new_index) { 385 + /* The frequency changing from L0 needs to change apll */ 386 + if (freqs.old == s5pv310_freq_table[L0].frequency) { 387 + /* 1. Change the apll m,p,s value */ 388 + s5pv310_set_apll(new_index); 389 + 390 + /* 2. Change the system clock divider values */ 391 + s5pv310_set_clkdiv(new_index); 392 + } else { 393 + /* 1. Change just s value in apll m,p,s value */ 394 + tmp = __raw_readl(S5P_APLL_CON0); 395 + tmp &= ~(0x7 << 0); 396 + tmp |= (s5pv310_apll_pms_table[new_index] & 0x7); 397 + __raw_writel(tmp, S5P_APLL_CON0); 398 + 399 + /* 2. Change the system clock divider values */ 400 + s5pv310_set_clkdiv(new_index); 401 + } 402 + } 403 + } 404 + 405 + static int s5pv310_target(struct cpufreq_policy *policy, 406 + unsigned int target_freq, 407 + unsigned int relation) 408 + { 409 + unsigned int index, old_index; 410 + unsigned int arm_volt, int_volt; 411 + 412 + freqs.old = s5pv310_getspeed(policy->cpu); 413 + 414 + if (cpufreq_frequency_table_target(policy, s5pv310_freq_table, 415 + freqs.old, relation, &old_index)) 416 + return -EINVAL; 417 + 418 + if (cpufreq_frequency_table_target(policy, s5pv310_freq_table, 419 + target_freq, relation, &index)) 420 + return -EINVAL; 421 + 422 + freqs.new = s5pv310_freq_table[index].frequency; 423 + freqs.cpu = policy->cpu; 424 + 425 + if (freqs.new == freqs.old) 426 + return 0; 427 + 428 + /* get the voltage value */ 429 + arm_volt = s5pv310_volt_table[index].arm_volt; 430 + int_volt = s5pv310_volt_table[index].int_volt; 431 + 432 + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 433 + 434 + /* control regulator */ 435 + if (freqs.new > freqs.old) { 436 + /* Voltage up */ 437 + #ifdef CONFIG_REGULATOR 438 + regulator_set_voltage(arm_regulator, arm_volt, arm_volt); 439 + regulator_set_voltage(int_regulator, int_volt, int_volt); 440 + #endif 441 + } 442 + 443 + /* Clock Configuration Procedure */ 444 + s5pv310_set_frequency(old_index, index); 445 + 446 + /* control regulator */ 447 + if (freqs.new < freqs.old) { 448 + /* Voltage down */ 449 + #ifdef CONFIG_REGULATOR 450 + regulator_set_voltage(arm_regulator, arm_volt, arm_volt); 451 + regulator_set_voltage(int_regulator, int_volt, int_volt); 452 + #endif 453 + } 454 + 455 + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 456 + 457 + return 0; 458 + } 459 + 460 + #ifdef CONFIG_PM 461 + static int s5pv310_cpufreq_suspend(struct cpufreq_policy *policy, 462 + pm_message_t pmsg) 463 + { 464 + return 0; 465 + } 466 + 467 + static int s5pv310_cpufreq_resume(struct cpufreq_policy *policy) 468 + { 469 + return 0; 470 + } 471 + #endif 472 + 473 + static int s5pv310_cpufreq_cpu_init(struct cpufreq_policy *policy) 474 + { 475 + policy->cur = policy->min = policy->max = s5pv310_getspeed(policy->cpu); 476 + 477 + cpufreq_frequency_table_get_attr(s5pv310_freq_table, policy->cpu); 478 + 479 + /* set the transition latency value */ 480 + policy->cpuinfo.transition_latency = 100000; 481 + 482 + /* 483 + * S5PV310 multi-core processors has 2 cores 484 + * that the frequency cannot be set independently. 485 + * Each cpu is bound to the same speed. 486 + * So the affected cpu is all of the cpus. 487 + */ 488 + cpumask_setall(policy->cpus); 489 + 490 + return cpufreq_frequency_table_cpuinfo(policy, s5pv310_freq_table); 491 + } 492 + 493 + static struct cpufreq_driver s5pv310_driver = { 494 + .flags = CPUFREQ_STICKY, 495 + .verify = s5pv310_verify_speed, 496 + .target = s5pv310_target, 497 + .get = s5pv310_getspeed, 498 + .init = s5pv310_cpufreq_cpu_init, 499 + .name = "s5pv310_cpufreq", 500 + #ifdef CONFIG_PM 501 + .suspend = s5pv310_cpufreq_suspend, 502 + .resume = s5pv310_cpufreq_resume, 503 + #endif 504 + }; 505 + 506 + static int __init s5pv310_cpufreq_init(void) 507 + { 508 + cpu_clk = clk_get(NULL, "armclk"); 509 + if (IS_ERR(cpu_clk)) 510 + return PTR_ERR(cpu_clk); 511 + 512 + moutcore = clk_get(NULL, "moutcore"); 513 + if (IS_ERR(moutcore)) 514 + goto out; 515 + 516 + mout_mpll = clk_get(NULL, "mout_mpll"); 517 + if (IS_ERR(mout_mpll)) 518 + goto out; 519 + 520 + mout_apll = clk_get(NULL, "mout_apll"); 521 + if (IS_ERR(mout_apll)) 522 + goto out; 523 + 524 + #ifdef CONFIG_REGULATOR 525 + arm_regulator = regulator_get(NULL, "vdd_arm"); 526 + if (IS_ERR(arm_regulator)) { 527 + printk(KERN_ERR "failed to get resource %s\n", "vdd_arm"); 528 + goto out; 529 + } 530 + 531 + int_regulator = regulator_get(NULL, "vdd_int"); 532 + if (IS_ERR(int_regulator)) { 533 + printk(KERN_ERR "failed to get resource %s\n", "vdd_int"); 534 + goto out; 535 + } 536 + #endif 537 + 538 + /* 539 + * Check DRAM type. 540 + * Because DVFS level is different according to DRAM type. 541 + */ 542 + memtype = __raw_readl(S5P_VA_DMC0 + S5P_DMC0_MEMCON_OFFSET); 543 + memtype = (memtype >> S5P_DMC0_MEMTYPE_SHIFT); 544 + memtype &= S5P_DMC0_MEMTYPE_MASK; 545 + 546 + if ((memtype < DDR2) && (memtype > DDR3)) { 547 + printk(KERN_ERR "%s: wrong memtype= 0x%x\n", __func__, memtype); 548 + goto out; 549 + } else { 550 + printk(KERN_DEBUG "%s: memtype= 0x%x\n", __func__, memtype); 551 + } 552 + 553 + return cpufreq_register_driver(&s5pv310_driver); 554 + 555 + out: 556 + if (!IS_ERR(cpu_clk)) 557 + clk_put(cpu_clk); 558 + 559 + if (!IS_ERR(moutcore)) 560 + clk_put(moutcore); 561 + 562 + if (!IS_ERR(mout_mpll)) 563 + clk_put(mout_mpll); 564 + 565 + if (!IS_ERR(mout_apll)) 566 + clk_put(mout_apll); 567 + 568 + #ifdef CONFIG_REGULATOR 569 + if (!IS_ERR(arm_regulator)) 570 + regulator_put(arm_regulator); 571 + 572 + if (!IS_ERR(int_regulator)) 573 + regulator_put(int_regulator); 574 + #endif 575 + 576 + printk(KERN_ERR "%s: failed initialization\n", __func__); 577 + 578 + return -EINVAL; 579 + } 580 + late_initcall(s5pv310_cpufreq_init);
+139
arch/arm/mach-s5pv310/dev-pd.c
···
··· 1 + /* linux/arch/arm/mach-s5pv310/dev-pd.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - Power Domain support 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/io.h> 14 + #include <linux/kernel.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/delay.h> 17 + 18 + #include <mach/regs-pmu.h> 19 + 20 + #include <plat/pd.h> 21 + 22 + static int s5pv310_pd_enable(struct device *dev) 23 + { 24 + struct samsung_pd_info *pdata = dev->platform_data; 25 + u32 timeout; 26 + 27 + __raw_writel(S5P_INT_LOCAL_PWR_EN, pdata->base); 28 + 29 + /* Wait max 1ms */ 30 + timeout = 10; 31 + while ((__raw_readl(pdata->base + 0x4) & S5P_INT_LOCAL_PWR_EN) 32 + != S5P_INT_LOCAL_PWR_EN) { 33 + if (timeout == 0) { 34 + printk(KERN_ERR "Power domain %s enable failed.\n", 35 + dev_name(dev)); 36 + return -ETIMEDOUT; 37 + } 38 + timeout--; 39 + udelay(100); 40 + } 41 + 42 + return 0; 43 + } 44 + 45 + static int s5pv310_pd_disable(struct device *dev) 46 + { 47 + struct samsung_pd_info *pdata = dev->platform_data; 48 + u32 timeout; 49 + 50 + __raw_writel(0, pdata->base); 51 + 52 + /* Wait max 1ms */ 53 + timeout = 10; 54 + while (__raw_readl(pdata->base + 0x4) & S5P_INT_LOCAL_PWR_EN) { 55 + if (timeout == 0) { 56 + printk(KERN_ERR "Power domain %s disable failed.\n", 57 + dev_name(dev)); 58 + return -ETIMEDOUT; 59 + } 60 + timeout--; 61 + udelay(100); 62 + } 63 + 64 + return 0; 65 + } 66 + 67 + struct platform_device s5pv310_device_pd[] = { 68 + { 69 + .name = "samsung-pd", 70 + .id = 0, 71 + .dev = { 72 + .platform_data = &(struct samsung_pd_info) { 73 + .enable = s5pv310_pd_enable, 74 + .disable = s5pv310_pd_disable, 75 + .base = S5P_PMU_MFC_CONF, 76 + }, 77 + }, 78 + }, { 79 + .name = "samsung-pd", 80 + .id = 1, 81 + .dev = { 82 + .platform_data = &(struct samsung_pd_info) { 83 + .enable = s5pv310_pd_enable, 84 + .disable = s5pv310_pd_disable, 85 + .base = S5P_PMU_G3D_CONF, 86 + }, 87 + }, 88 + }, { 89 + .name = "samsung-pd", 90 + .id = 2, 91 + .dev = { 92 + .platform_data = &(struct samsung_pd_info) { 93 + .enable = s5pv310_pd_enable, 94 + .disable = s5pv310_pd_disable, 95 + .base = S5P_PMU_LCD0_CONF, 96 + }, 97 + }, 98 + }, { 99 + .name = "samsung-pd", 100 + .id = 3, 101 + .dev = { 102 + .platform_data = &(struct samsung_pd_info) { 103 + .enable = s5pv310_pd_enable, 104 + .disable = s5pv310_pd_disable, 105 + .base = S5P_PMU_LCD1_CONF, 106 + }, 107 + }, 108 + }, { 109 + .name = "samsung-pd", 110 + .id = 4, 111 + .dev = { 112 + .platform_data = &(struct samsung_pd_info) { 113 + .enable = s5pv310_pd_enable, 114 + .disable = s5pv310_pd_disable, 115 + .base = S5P_PMU_TV_CONF, 116 + }, 117 + }, 118 + }, { 119 + .name = "samsung-pd", 120 + .id = 5, 121 + .dev = { 122 + .platform_data = &(struct samsung_pd_info) { 123 + .enable = s5pv310_pd_enable, 124 + .disable = s5pv310_pd_disable, 125 + .base = S5P_PMU_CAM_CONF, 126 + }, 127 + }, 128 + }, { 129 + .name = "samsung-pd", 130 + .id = 6, 131 + .dev = { 132 + .platform_data = &(struct samsung_pd_info) { 133 + .enable = s5pv310_pd_enable, 134 + .disable = s5pv310_pd_disable, 135 + .base = S5P_PMU_GPS_CONF, 136 + }, 137 + }, 138 + }, 139 + };
+187
arch/arm/mach-s5pv310/dev-sysmmu.c
···
··· 1 + /* linux/arch/arm/mach-s5pv310/dev-sysmmu.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 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 + #include <linux/platform_device.h> 12 + #include <linux/dma-mapping.h> 13 + 14 + #include <mach/map.h> 15 + #include <mach/irqs.h> 16 + 17 + static struct resource s5pv310_sysmmu_resource[] = { 18 + [0] = { 19 + .start = S5PV310_PA_SYSMMU_MDMA, 20 + .end = S5PV310_PA_SYSMMU_MDMA + SZ_64K - 1, 21 + .flags = IORESOURCE_MEM, 22 + }, 23 + [1] = { 24 + .start = IRQ_SYSMMU_MDMA0_0, 25 + .end = IRQ_SYSMMU_MDMA0_0, 26 + .flags = IORESOURCE_IRQ, 27 + }, 28 + [2] = { 29 + .start = S5PV310_PA_SYSMMU_SSS, 30 + .end = S5PV310_PA_SYSMMU_SSS + SZ_64K - 1, 31 + .flags = IORESOURCE_MEM, 32 + }, 33 + [3] = { 34 + .start = IRQ_SYSMMU_SSS_0, 35 + .end = IRQ_SYSMMU_SSS_0, 36 + .flags = IORESOURCE_IRQ, 37 + }, 38 + [4] = { 39 + .start = S5PV310_PA_SYSMMU_FIMC0, 40 + .end = S5PV310_PA_SYSMMU_FIMC0 + SZ_64K - 1, 41 + .flags = IORESOURCE_MEM, 42 + }, 43 + [5] = { 44 + .start = IRQ_SYSMMU_FIMC0_0, 45 + .end = IRQ_SYSMMU_FIMC0_0, 46 + .flags = IORESOURCE_IRQ, 47 + }, 48 + [6] = { 49 + .start = S5PV310_PA_SYSMMU_FIMC1, 50 + .end = S5PV310_PA_SYSMMU_FIMC1 + SZ_64K - 1, 51 + .flags = IORESOURCE_MEM, 52 + }, 53 + [7] = { 54 + .start = IRQ_SYSMMU_FIMC1_0, 55 + .end = IRQ_SYSMMU_FIMC1_0, 56 + .flags = IORESOURCE_IRQ, 57 + }, 58 + [8] = { 59 + .start = S5PV310_PA_SYSMMU_FIMC2, 60 + .end = S5PV310_PA_SYSMMU_FIMC2 + SZ_64K - 1, 61 + .flags = IORESOURCE_MEM, 62 + }, 63 + [9] = { 64 + .start = IRQ_SYSMMU_FIMC2_0, 65 + .end = IRQ_SYSMMU_FIMC2_0, 66 + .flags = IORESOURCE_IRQ, 67 + }, 68 + [10] = { 69 + .start = S5PV310_PA_SYSMMU_FIMC3, 70 + .end = S5PV310_PA_SYSMMU_FIMC3 + SZ_64K - 1, 71 + .flags = IORESOURCE_MEM, 72 + }, 73 + [11] = { 74 + .start = IRQ_SYSMMU_FIMC3_0, 75 + .end = IRQ_SYSMMU_FIMC3_0, 76 + .flags = IORESOURCE_IRQ, 77 + }, 78 + [12] = { 79 + .start = S5PV310_PA_SYSMMU_JPEG, 80 + .end = S5PV310_PA_SYSMMU_JPEG + SZ_64K - 1, 81 + .flags = IORESOURCE_MEM, 82 + }, 83 + [13] = { 84 + .start = IRQ_SYSMMU_JPEG_0, 85 + .end = IRQ_SYSMMU_JPEG_0, 86 + .flags = IORESOURCE_IRQ, 87 + }, 88 + [14] = { 89 + .start = S5PV310_PA_SYSMMU_FIMD0, 90 + .end = S5PV310_PA_SYSMMU_FIMD0 + SZ_64K - 1, 91 + .flags = IORESOURCE_MEM, 92 + }, 93 + [15] = { 94 + .start = IRQ_SYSMMU_LCD0_M0_0, 95 + .end = IRQ_SYSMMU_LCD0_M0_0, 96 + .flags = IORESOURCE_IRQ, 97 + }, 98 + [16] = { 99 + .start = S5PV310_PA_SYSMMU_FIMD1, 100 + .end = S5PV310_PA_SYSMMU_FIMD1 + SZ_64K - 1, 101 + .flags = IORESOURCE_MEM, 102 + }, 103 + [17] = { 104 + .start = IRQ_SYSMMU_LCD1_M1_0, 105 + .end = IRQ_SYSMMU_LCD1_M1_0, 106 + .flags = IORESOURCE_IRQ, 107 + }, 108 + [18] = { 109 + .start = S5PV310_PA_SYSMMU_PCIe, 110 + .end = S5PV310_PA_SYSMMU_PCIe + SZ_64K - 1, 111 + .flags = IORESOURCE_MEM, 112 + }, 113 + [19] = { 114 + .start = IRQ_SYSMMU_PCIE_0, 115 + .end = IRQ_SYSMMU_PCIE_0, 116 + .flags = IORESOURCE_IRQ, 117 + }, 118 + [20] = { 119 + .start = S5PV310_PA_SYSMMU_G2D, 120 + .end = S5PV310_PA_SYSMMU_G2D + SZ_64K - 1, 121 + .flags = IORESOURCE_MEM, 122 + }, 123 + [21] = { 124 + .start = IRQ_SYSMMU_2D_0, 125 + .end = IRQ_SYSMMU_2D_0, 126 + .flags = IORESOURCE_IRQ, 127 + }, 128 + [22] = { 129 + .start = S5PV310_PA_SYSMMU_ROTATOR, 130 + .end = S5PV310_PA_SYSMMU_ROTATOR + SZ_64K - 1, 131 + .flags = IORESOURCE_MEM, 132 + }, 133 + [23] = { 134 + .start = IRQ_SYSMMU_ROTATOR_0, 135 + .end = IRQ_SYSMMU_ROTATOR_0, 136 + .flags = IORESOURCE_IRQ, 137 + }, 138 + [24] = { 139 + .start = S5PV310_PA_SYSMMU_MDMA2, 140 + .end = S5PV310_PA_SYSMMU_MDMA2 + SZ_64K - 1, 141 + .flags = IORESOURCE_MEM, 142 + }, 143 + [25] = { 144 + .start = IRQ_SYSMMU_MDMA1_0, 145 + .end = IRQ_SYSMMU_MDMA1_0, 146 + .flags = IORESOURCE_IRQ, 147 + }, 148 + [26] = { 149 + .start = S5PV310_PA_SYSMMU_TV, 150 + .end = S5PV310_PA_SYSMMU_TV + SZ_64K - 1, 151 + .flags = IORESOURCE_MEM, 152 + }, 153 + [27] = { 154 + .start = IRQ_SYSMMU_TV_M0_0, 155 + .end = IRQ_SYSMMU_TV_M0_0, 156 + .flags = IORESOURCE_IRQ, 157 + }, 158 + [28] = { 159 + .start = S5PV310_PA_SYSMMU_MFC_L, 160 + .end = S5PV310_PA_SYSMMU_MFC_L + SZ_64K - 1, 161 + .flags = IORESOURCE_MEM, 162 + }, 163 + [29] = { 164 + .start = IRQ_SYSMMU_MFC_M0_0, 165 + .end = IRQ_SYSMMU_MFC_M0_0, 166 + .flags = IORESOURCE_IRQ, 167 + }, 168 + [30] = { 169 + .start = S5PV310_PA_SYSMMU_MFC_R, 170 + .end = S5PV310_PA_SYSMMU_MFC_R + SZ_64K - 1, 171 + .flags = IORESOURCE_MEM, 172 + }, 173 + [31] = { 174 + .start = IRQ_SYSMMU_MFC_M1_0, 175 + .end = IRQ_SYSMMU_MFC_M1_0, 176 + .flags = IORESOURCE_IRQ, 177 + }, 178 + }; 179 + 180 + struct platform_device s5pv310_device_sysmmu = { 181 + .name = "s5p-sysmmu", 182 + .id = 32, 183 + .num_resources = ARRAY_SIZE(s5pv310_sysmmu_resource), 184 + .resource = s5pv310_sysmmu_resource, 185 + }; 186 + 187 + EXPORT_SYMBOL(s5pv310_device_sysmmu);
+31 -3
arch/arm/mach-s5pv310/include/mach/irqs.h
··· 25 26 #define IRQ_SPI(x) S5P_IRQ(x+32) 27 28 #define IRQ_EINT0 IRQ_SPI(40) 29 #define IRQ_EINT1 IRQ_SPI(41) 30 #define IRQ_EINT2 IRQ_SPI(42) ··· 38 #define IRQ_JPEG IRQ_SPI(48) 39 #define IRQ_2D IRQ_SPI(49) 40 #define IRQ_PCIE IRQ_SPI(50) 41 - #define IRQ_SYSTEM_TIMER IRQ_SPI(51) 42 #define IRQ_MFC IRQ_SPI(52) 43 - #define IRQ_WDT IRQ_SPI(53) 44 #define IRQ_AUDIO_SS IRQ_SPI(54) 45 #define IRQ_AC97 IRQ_SPI(55) 46 #define IRQ_SPDIF IRQ_SPI(56) ··· 54 #define MAX_IRQ_IN_COMBINER 8 55 #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64)) 56 #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) 57 58 #define IRQ_PDMA0 COMBINER_IRQ(21, 0) 59 #define IRQ_PDMA1 COMBINER_IRQ(21, 1) ··· 105 #define IRQ_HSMMC2 COMBINER_IRQ(29, 2) 106 #define IRQ_HSMMC3 COMBINER_IRQ(29, 3) 107 108 #define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0) 109 110 #define IRQ_EINT4 COMBINER_IRQ(37, 0) 111 #define IRQ_EINT5 COMBINER_IRQ(37, 1) ··· 128 129 #define IRQ_EINT16_31 COMBINER_IRQ(39, 0) 130 131 - #define MAX_COMBINER_NR 40 132 133 #define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) 134
··· 25 26 #define IRQ_SPI(x) S5P_IRQ(x+32) 27 28 + #define IRQ_MCT1 IRQ_SPI(35) 29 + 30 #define IRQ_EINT0 IRQ_SPI(40) 31 #define IRQ_EINT1 IRQ_SPI(41) 32 #define IRQ_EINT2 IRQ_SPI(42) ··· 36 #define IRQ_JPEG IRQ_SPI(48) 37 #define IRQ_2D IRQ_SPI(49) 38 #define IRQ_PCIE IRQ_SPI(50) 39 + #define IRQ_MCT0 IRQ_SPI(51) 40 #define IRQ_MFC IRQ_SPI(52) 41 #define IRQ_AUDIO_SS IRQ_SPI(54) 42 #define IRQ_AC97 IRQ_SPI(55) 43 #define IRQ_SPDIF IRQ_SPI(56) ··· 53 #define MAX_IRQ_IN_COMBINER 8 54 #define COMBINER_GROUP(x) ((x) * MAX_IRQ_IN_COMBINER + IRQ_SPI(64)) 55 #define COMBINER_IRQ(x, y) (COMBINER_GROUP(x) + y) 56 + 57 + #define IRQ_SYSMMU_MDMA0_0 COMBINER_IRQ(4, 0) 58 + #define IRQ_SYSMMU_SSS_0 COMBINER_IRQ(4, 1) 59 + #define IRQ_SYSMMU_FIMC0_0 COMBINER_IRQ(4, 2) 60 + #define IRQ_SYSMMU_FIMC1_0 COMBINER_IRQ(4, 3) 61 + #define IRQ_SYSMMU_FIMC2_0 COMBINER_IRQ(4, 4) 62 + #define IRQ_SYSMMU_FIMC3_0 COMBINER_IRQ(4, 5) 63 + #define IRQ_SYSMMU_JPEG_0 COMBINER_IRQ(4, 6) 64 + #define IRQ_SYSMMU_2D_0 COMBINER_IRQ(4, 7) 65 + 66 + #define IRQ_SYSMMU_ROTATOR_0 COMBINER_IRQ(5, 0) 67 + #define IRQ_SYSMMU_MDMA1_0 COMBINER_IRQ(5, 1) 68 + #define IRQ_SYSMMU_LCD0_M0_0 COMBINER_IRQ(5, 2) 69 + #define IRQ_SYSMMU_LCD1_M1_0 COMBINER_IRQ(5, 3) 70 + #define IRQ_SYSMMU_TV_M0_0 COMBINER_IRQ(5, 4) 71 + #define IRQ_SYSMMU_MFC_M0_0 COMBINER_IRQ(5, 5) 72 + #define IRQ_SYSMMU_MFC_M1_0 COMBINER_IRQ(5, 6) 73 + #define IRQ_SYSMMU_PCIE_0 COMBINER_IRQ(5, 7) 74 75 #define IRQ_PDMA0 COMBINER_IRQ(21, 0) 76 #define IRQ_PDMA1 COMBINER_IRQ(21, 1) ··· 86 #define IRQ_HSMMC2 COMBINER_IRQ(29, 2) 87 #define IRQ_HSMMC3 COMBINER_IRQ(29, 3) 88 89 + #define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0) 90 + #define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1) 91 + 92 #define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0) 93 + 94 + #define IRQ_MCT_L1 COMBINER_IRQ(35, 3) 95 96 #define IRQ_EINT4 COMBINER_IRQ(37, 0) 97 #define IRQ_EINT5 COMBINER_IRQ(37, 1) ··· 104 105 #define IRQ_EINT16_31 COMBINER_IRQ(39, 0) 106 107 + #define IRQ_MCT_L0 COMBINER_IRQ(51, 0) 108 + 109 + #define IRQ_WDT COMBINER_IRQ(53, 0) 110 + 111 + #define MAX_COMBINER_NR 54 112 113 #define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) 114
+29
arch/arm/mach-s5pv310/include/mach/map.h
··· 39 #define S5PV310_PA_SYSCON (0x10010000) 40 #define S5P_PA_SYSCON S5PV310_PA_SYSCON 41 42 #define S5PV310_PA_CMU (0x10030000) 43 44 #define S5PV310_PA_WATCHDOG (0x10060000) 45 #define S5PV310_PA_RTC (0x10070000) 46 47 #define S5PV310_PA_COMBINER (0x10448000) 48 ··· 65 #define S5PV310_PA_GPIO2 (0x11000000) 66 #define S5PV310_PA_GPIO3 (0x03860000) 67 68 #define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) 69 70 #define S5PV310_PA_SROMC (0x12570000) 71 72 /* S/PDIF */ 73 #define S5PV310_PA_SPDIF 0xE1100000 ··· 108 #define S5PV310_PA_SDRAM (0x40000000) 109 #define S5P_PA_SDRAM S5PV310_PA_SDRAM 110 111 /* compatibiltiy defines. */ 112 #define S3C_PA_UART S5PV310_PA_UART 113 #define S3C_PA_HSMMC0 S5PV310_PA_HSMMC(0) ··· 143 #define S3C_PA_IIC7 S5PV310_PA_IIC(7) 144 #define S3C_PA_RTC S5PV310_PA_RTC 145 #define S3C_PA_WDT S5PV310_PA_WATCHDOG 146 147 #endif /* __ASM_ARCH_MAP_H */
··· 39 #define S5PV310_PA_SYSCON (0x10010000) 40 #define S5P_PA_SYSCON S5PV310_PA_SYSCON 41 42 + #define S5PV310_PA_PMU (0x10020000) 43 + 44 #define S5PV310_PA_CMU (0x10030000) 45 46 #define S5PV310_PA_WATCHDOG (0x10060000) 47 #define S5PV310_PA_RTC (0x10070000) 48 + 49 + #define S5PV310_PA_DMC0 (0x10400000) 50 51 #define S5PV310_PA_COMBINER (0x10448000) 52 ··· 61 #define S5PV310_PA_GPIO2 (0x11000000) 62 #define S5PV310_PA_GPIO3 (0x03860000) 63 64 + #define S5PV310_PA_MIPI_CSIS0 0x11880000 65 + #define S5PV310_PA_MIPI_CSIS1 0x11890000 66 + 67 #define S5PV310_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) 68 69 #define S5PV310_PA_SROMC (0x12570000) 70 + #define S5P_PA_SROMC S5PV310_PA_SROMC 71 72 /* S/PDIF */ 73 #define S5PV310_PA_SPDIF 0xE1100000 ··· 100 #define S5PV310_PA_SDRAM (0x40000000) 101 #define S5P_PA_SDRAM S5PV310_PA_SDRAM 102 103 + #define S5PV310_PA_SYSMMU_MDMA 0x10A40000 104 + #define S5PV310_PA_SYSMMU_SSS 0x10A50000 105 + #define S5PV310_PA_SYSMMU_FIMC0 0x11A20000 106 + #define S5PV310_PA_SYSMMU_FIMC1 0x11A30000 107 + #define S5PV310_PA_SYSMMU_FIMC2 0x11A40000 108 + #define S5PV310_PA_SYSMMU_FIMC3 0x11A50000 109 + #define S5PV310_PA_SYSMMU_JPEG 0x11A60000 110 + #define S5PV310_PA_SYSMMU_FIMD0 0x11E20000 111 + #define S5PV310_PA_SYSMMU_FIMD1 0x12220000 112 + #define S5PV310_PA_SYSMMU_PCIe 0x12620000 113 + #define S5PV310_PA_SYSMMU_G2D 0x12A20000 114 + #define S5PV310_PA_SYSMMU_ROTATOR 0x12A30000 115 + #define S5PV310_PA_SYSMMU_MDMA2 0x12A40000 116 + #define S5PV310_PA_SYSMMU_TV 0x12E20000 117 + #define S5PV310_PA_SYSMMU_MFC_L 0x13620000 118 + #define S5PV310_PA_SYSMMU_MFC_R 0x13630000 119 + #define S5PV310_SYSMMU_TOTAL_IPNUM 16 120 + #define S5P_SYSMMU_TOTAL_IPNUM S5PV310_SYSMMU_TOTAL_IPNUM 121 + 122 /* compatibiltiy defines. */ 123 #define S3C_PA_UART S5PV310_PA_UART 124 #define S3C_PA_HSMMC0 S5PV310_PA_HSMMC(0) ··· 116 #define S3C_PA_IIC7 S5PV310_PA_IIC(7) 117 #define S3C_PA_RTC S5PV310_PA_RTC 118 #define S3C_PA_WDT S5PV310_PA_WATCHDOG 119 + #define S5P_PA_MIPI_CSIS0 S5PV310_PA_MIPI_CSIS0 120 + #define S5P_PA_MIPI_CSIS1 S5PV310_PA_MIPI_CSIS1 121 122 #endif /* __ASM_ARCH_MAP_H */
+78 -2
arch/arm/mach-s5pv310/include/mach/regs-clock.h
··· 19 20 #define S5P_INFORM0 S5P_CLKREG(0x800) 21 22 #define S5P_EPLL_CON0 S5P_CLKREG(0x0C110) 23 #define S5P_EPLL_CON1 S5P_CLKREG(0x0C114) 24 #define S5P_VPLL_CON0 S5P_CLKREG(0x0C120) ··· 64 #define S5P_CLKSRC_MASK_PERIL0 S5P_CLKREG(0x0C350) 65 #define S5P_CLKSRC_MASK_PERIL1 S5P_CLKREG(0x0C354) 66 67 #define S5P_CLKGATE_IP_CAM S5P_CLKREG(0x0C920) 68 #define S5P_CLKGATE_IP_IMAGE S5P_CLKREG(0x0C930) 69 #define S5P_CLKGATE_IP_LCD0 S5P_CLKREG(0x0C934) ··· 74 #define S5P_CLKGATE_IP_PERIL S5P_CLKREG(0x0C950) 75 #define S5P_CLKGATE_IP_PERIR S5P_CLKREG(0x0C960) 76 77 - #define S5P_CLKSRC_CORE S5P_CLKREG(0x10200) 78 - #define S5P_CLKDIV_CORE0 S5P_CLKREG(0x10500) 79 80 #define S5P_APLL_LOCK S5P_CLKREG(0x14000) 81 #define S5P_MPLL_LOCK S5P_CLKREG(0x14004) ··· 89 #define S5P_CLKMUX_STATCPU S5P_CLKREG(0x14400) 90 91 #define S5P_CLKDIV_CPU S5P_CLKREG(0x14500) 92 #define S5P_CLKDIV_STATCPU S5P_CLKREG(0x14600) 93 94 #define S5P_CLKGATE_SCLKCPU S5P_CLKREG(0x14800) 95 96 /* Compatibility defines */ 97
··· 19 20 #define S5P_INFORM0 S5P_CLKREG(0x800) 21 22 + #define S5P_CLKDIV_LEFTBUS S5P_CLKREG(0x04500) 23 + #define S5P_CLKDIV_STAT_LEFTBUS S5P_CLKREG(0x04600) 24 + 25 + #define S5P_CLKDIV_RIGHTBUS S5P_CLKREG(0x08500) 26 + #define S5P_CLKDIV_STAT_RIGHTBUS S5P_CLKREG(0x08600) 27 + 28 #define S5P_EPLL_CON0 S5P_CLKREG(0x0C110) 29 #define S5P_EPLL_CON1 S5P_CLKREG(0x0C114) 30 #define S5P_VPLL_CON0 S5P_CLKREG(0x0C120) ··· 58 #define S5P_CLKSRC_MASK_PERIL0 S5P_CLKREG(0x0C350) 59 #define S5P_CLKSRC_MASK_PERIL1 S5P_CLKREG(0x0C354) 60 61 + #define S5P_CLKDIV_STAT_TOP S5P_CLKREG(0x0C610) 62 + 63 #define S5P_CLKGATE_IP_CAM S5P_CLKREG(0x0C920) 64 #define S5P_CLKGATE_IP_IMAGE S5P_CLKREG(0x0C930) 65 #define S5P_CLKGATE_IP_LCD0 S5P_CLKREG(0x0C934) ··· 66 #define S5P_CLKGATE_IP_PERIL S5P_CLKREG(0x0C950) 67 #define S5P_CLKGATE_IP_PERIR S5P_CLKREG(0x0C960) 68 69 + #define S5P_CLKSRC_DMC S5P_CLKREG(0x10200) 70 + #define S5P_CLKDIV_DMC0 S5P_CLKREG(0x10500) 71 + #define S5P_CLKDIV_STAT_DMC0 S5P_CLKREG(0x10600) 72 73 #define S5P_APLL_LOCK S5P_CLKREG(0x14000) 74 #define S5P_MPLL_LOCK S5P_CLKREG(0x14004) ··· 80 #define S5P_CLKMUX_STATCPU S5P_CLKREG(0x14400) 81 82 #define S5P_CLKDIV_CPU S5P_CLKREG(0x14500) 83 + #define S5P_CLKDIV_CPU1 S5P_CLKREG(0x14504) 84 #define S5P_CLKDIV_STATCPU S5P_CLKREG(0x14600) 85 + #define S5P_CLKDIV_STATCPU1 S5P_CLKREG(0x14604) 86 87 #define S5P_CLKGATE_SCLKCPU S5P_CLKREG(0x14800) 88 + 89 + /* APLL_LOCK */ 90 + #define S5P_APLL_LOCKTIME (0x1C20) /* 300us */ 91 + 92 + /* APLL_CON0 */ 93 + #define S5P_APLLCON0_ENABLE_SHIFT (31) 94 + #define S5P_APLLCON0_LOCKED_SHIFT (29) 95 + #define S5P_APLL_VAL_1000 ((250 << 16) | (6 << 8) | 1) 96 + #define S5P_APLL_VAL_800 ((200 << 16) | (6 << 8) | 1) 97 + 98 + /* CLK_SRC_CPU */ 99 + #define S5P_CLKSRC_CPU_MUXCORE_SHIFT (16) 100 + #define S5P_CLKMUX_STATCPU_MUXCORE_MASK (0x7 << S5P_CLKSRC_CPU_MUXCORE_SHIFT) 101 + 102 + /* CLKDIV_CPU0 */ 103 + #define S5P_CLKDIV_CPU0_CORE_SHIFT (0) 104 + #define S5P_CLKDIV_CPU0_CORE_MASK (0x7 << S5P_CLKDIV_CPU0_CORE_SHIFT) 105 + #define S5P_CLKDIV_CPU0_COREM0_SHIFT (4) 106 + #define S5P_CLKDIV_CPU0_COREM0_MASK (0x7 << S5P_CLKDIV_CPU0_COREM0_SHIFT) 107 + #define S5P_CLKDIV_CPU0_COREM1_SHIFT (8) 108 + #define S5P_CLKDIV_CPU0_COREM1_MASK (0x7 << S5P_CLKDIV_CPU0_COREM1_SHIFT) 109 + #define S5P_CLKDIV_CPU0_PERIPH_SHIFT (12) 110 + #define S5P_CLKDIV_CPU0_PERIPH_MASK (0x7 << S5P_CLKDIV_CPU0_PERIPH_SHIFT) 111 + #define S5P_CLKDIV_CPU0_ATB_SHIFT (16) 112 + #define S5P_CLKDIV_CPU0_ATB_MASK (0x7 << S5P_CLKDIV_CPU0_ATB_SHIFT) 113 + #define S5P_CLKDIV_CPU0_PCLKDBG_SHIFT (20) 114 + #define S5P_CLKDIV_CPU0_PCLKDBG_MASK (0x7 << S5P_CLKDIV_CPU0_PCLKDBG_SHIFT) 115 + #define S5P_CLKDIV_CPU0_APLL_SHIFT (24) 116 + #define S5P_CLKDIV_CPU0_APLL_MASK (0x7 << S5P_CLKDIV_CPU0_APLL_SHIFT) 117 + 118 + /* CLKDIV_DMC0 */ 119 + #define S5P_CLKDIV_DMC0_ACP_SHIFT (0) 120 + #define S5P_CLKDIV_DMC0_ACP_MASK (0x7 << S5P_CLKDIV_DMC0_ACP_SHIFT) 121 + #define S5P_CLKDIV_DMC0_ACPPCLK_SHIFT (4) 122 + #define S5P_CLKDIV_DMC0_ACPPCLK_MASK (0x7 << S5P_CLKDIV_DMC0_ACPPCLK_SHIFT) 123 + #define S5P_CLKDIV_DMC0_DPHY_SHIFT (8) 124 + #define S5P_CLKDIV_DMC0_DPHY_MASK (0x7 << S5P_CLKDIV_DMC0_DPHY_SHIFT) 125 + #define S5P_CLKDIV_DMC0_DMC_SHIFT (12) 126 + #define S5P_CLKDIV_DMC0_DMC_MASK (0x7 << S5P_CLKDIV_DMC0_DMC_SHIFT) 127 + #define S5P_CLKDIV_DMC0_DMCD_SHIFT (16) 128 + #define S5P_CLKDIV_DMC0_DMCD_MASK (0x7 << S5P_CLKDIV_DMC0_DMCD_SHIFT) 129 + #define S5P_CLKDIV_DMC0_DMCP_SHIFT (20) 130 + #define S5P_CLKDIV_DMC0_DMCP_MASK (0x7 << S5P_CLKDIV_DMC0_DMCP_SHIFT) 131 + #define S5P_CLKDIV_DMC0_COPY2_SHIFT (24) 132 + #define S5P_CLKDIV_DMC0_COPY2_MASK (0x7 << S5P_CLKDIV_DMC0_COPY2_SHIFT) 133 + #define S5P_CLKDIV_DMC0_CORETI_SHIFT (28) 134 + #define S5P_CLKDIV_DMC0_CORETI_MASK (0x7 << S5P_CLKDIV_DMC0_CORETI_SHIFT) 135 + 136 + /* CLKDIV_TOP */ 137 + #define S5P_CLKDIV_TOP_ACLK200_SHIFT (0) 138 + #define S5P_CLKDIV_TOP_ACLK200_MASK (0x7 << S5P_CLKDIV_TOP_ACLK200_SHIFT) 139 + #define S5P_CLKDIV_TOP_ACLK100_SHIFT (4) 140 + #define S5P_CLKDIV_TOP_ACLK100_MASK (0xf << S5P_CLKDIV_TOP_ACLK100_SHIFT) 141 + #define S5P_CLKDIV_TOP_ACLK160_SHIFT (8) 142 + #define S5P_CLKDIV_TOP_ACLK160_MASK (0x7 << S5P_CLKDIV_TOP_ACLK160_SHIFT) 143 + #define S5P_CLKDIV_TOP_ACLK133_SHIFT (12) 144 + #define S5P_CLKDIV_TOP_ACLK133_MASK (0x7 << S5P_CLKDIV_TOP_ACLK133_SHIFT) 145 + #define S5P_CLKDIV_TOP_ONENAND_SHIFT (16) 146 + #define S5P_CLKDIV_TOP_ONENAND_MASK (0x7 << S5P_CLKDIV_TOP_ONENAND_SHIFT) 147 + 148 + /* CLKDIV_LEFTBUS / CLKDIV_RIGHTBUS*/ 149 + #define S5P_CLKDIV_BUS_GDLR_SHIFT (0) 150 + #define S5P_CLKDIV_BUS_GDLR_MASK (0x7 << S5P_CLKDIV_BUS_GDLR_SHIFT) 151 + #define S5P_CLKDIV_BUS_GPLR_SHIFT (4) 152 + #define S5P_CLKDIV_BUS_GPLR_MASK (0x7 << S5P_CLKDIV_BUS_GPLR_SHIFT) 153 154 /* Compatibility defines */ 155
+23
arch/arm/mach-s5pv310/include/mach/regs-mem.h
···
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/regs-mem.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - SROMC and DMC register definitions 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_ARCH_REGS_MEM_H 14 + #define __ASM_ARCH_REGS_MEM_H __FILE__ 15 + 16 + #include <mach/map.h> 17 + 18 + #define S5P_DMC0_MEMCON_OFFSET 0x04 19 + 20 + #define S5P_DMC0_MEMTYPE_SHIFT 8 21 + #define S5P_DMC0_MEMTYPE_MASK 0xF 22 + 23 + #endif /* __ASM_ARCH_REGS_MEM_H */
+30
arch/arm/mach-s5pv310/include/mach/regs-pmu.h
···
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - Power management unit definition 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 + #ifndef __ASM_ARCH_REGS_PMU_H 14 + #define __ASM_ARCH_REGS_PMU_H __FILE__ 15 + 16 + #include <mach/map.h> 17 + 18 + #define S5P_PMUREG(x) (S5P_VA_PMU + (x)) 19 + 20 + #define S5P_PMU_CAM_CONF S5P_PMUREG(0x3C00) 21 + #define S5P_PMU_TV_CONF S5P_PMUREG(0x3C20) 22 + #define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40) 23 + #define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60) 24 + #define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80) 25 + #define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0) 26 + #define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0) 27 + 28 + #define S5P_INT_LOCAL_PWR_EN 0x7 29 + 30 + #endif /* __ASM_ARCH_REGS_PMU_H */
-50
arch/arm/mach-s5pv310/include/mach/regs-srom.h
··· 1 - /* linux/arch/arm/mach-s5pv310/include/mach/regs-srom.h 2 - * 3 - * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 - * http://www.samsung.com 5 - * 6 - * S5PV310 - SROMC register definitions 7 - * 8 - * This program is free software; you can redistribute it and/or modify 9 - * it under the terms of the GNU General Public License version 2 as 10 - * published by the Free Software Foundation. 11 - */ 12 - 13 - #ifndef __ASM_ARCH_REGS_SROM_H 14 - #define __ASM_ARCH_REGS_SROM_H __FILE__ 15 - 16 - #include <mach/map.h> 17 - 18 - #define S5PV310_SROMREG(x) (S5P_VA_SROMC + (x)) 19 - 20 - #define S5PV310_SROM_BW S5PV310_SROMREG(0x0) 21 - #define S5PV310_SROM_BC0 S5PV310_SROMREG(0x4) 22 - #define S5PV310_SROM_BC1 S5PV310_SROMREG(0x8) 23 - #define S5PV310_SROM_BC2 S5PV310_SROMREG(0xc) 24 - #define S5PV310_SROM_BC3 S5PV310_SROMREG(0x10) 25 - 26 - /* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */ 27 - 28 - #define S5PV310_SROM_BW__DATAWIDTH__SHIFT 0 29 - #define S5PV310_SROM_BW__ADDRMODE__SHIFT 1 30 - #define S5PV310_SROM_BW__WAITENABLE__SHIFT 2 31 - #define S5PV310_SROM_BW__BYTEENABLE__SHIFT 3 32 - 33 - #define S5PV310_SROM_BW__CS_MASK 0xf 34 - 35 - #define S5PV310_SROM_BW__NCS0__SHIFT 0 36 - #define S5PV310_SROM_BW__NCS1__SHIFT 4 37 - #define S5PV310_SROM_BW__NCS2__SHIFT 8 38 - #define S5PV310_SROM_BW__NCS3__SHIFT 12 39 - 40 - /* applies to same to BCS0 - BCS3 */ 41 - 42 - #define S5PV310_SROM_BCX__PMC__SHIFT 0 43 - #define S5PV310_SROM_BCX__TACP__SHIFT 4 44 - #define S5PV310_SROM_BCX__TCAH__SHIFT 8 45 - #define S5PV310_SROM_BCX__TCOH__SHIFT 12 46 - #define S5PV310_SROM_BCX__TACC__SHIFT 16 47 - #define S5PV310_SROM_BCX__TCOS__SHIFT 24 48 - #define S5PV310_SROM_BCX__TACS__SHIFT 28 49 - 50 - #endif /* __ASM_ARCH_REGS_SROM_H */
···
+24
arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h
···
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/regs-sysmmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5PV310 - System MMU register 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 + #ifndef __ASM_ARCH_REGS_SYSMMU_H 14 + #define __ASM_ARCH_REGS_SYSMMU_H __FILE__ 15 + 16 + #define S5P_MMU_CTRL 0x000 17 + #define S5P_MMU_CFG 0x004 18 + #define S5P_MMU_STATUS 0x008 19 + #define S5P_MMU_FLUSH 0x00C 20 + #define S5P_PT_BASE_ADDR 0x014 21 + #define S5P_INT_STATUS 0x018 22 + #define S5P_PAGE_FAULT_ADDR 0x024 23 + 24 + #endif /* __ASM_ARCH_REGS_SYSMMU_H */
+119
arch/arm/mach-s5pv310/include/mach/sysmmu.h
···
··· 1 + /* linux/arch/arm/mach-s5pv310/include/mach/sysmmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com/ 5 + * 6 + * Samsung sysmmu driver for S5PV310 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 + #ifndef __ASM_ARM_ARCH_SYSMMU_H 14 + #define __ASM_ARM_ARCH_SYSMMU_H __FILE__ 15 + 16 + enum s5pv310_sysmmu_ips { 17 + SYSMMU_MDMA, 18 + SYSMMU_SSS, 19 + SYSMMU_FIMC0, 20 + SYSMMU_FIMC1, 21 + SYSMMU_FIMC2, 22 + SYSMMU_FIMC3, 23 + SYSMMU_JPEG, 24 + SYSMMU_FIMD0, 25 + SYSMMU_FIMD1, 26 + SYSMMU_PCIe, 27 + SYSMMU_G2D, 28 + SYSMMU_ROTATOR, 29 + SYSMMU_MDMA2, 30 + SYSMMU_TV, 31 + SYSMMU_MFC_L, 32 + SYSMMU_MFC_R, 33 + }; 34 + 35 + static char *sysmmu_ips_name[S5P_SYSMMU_TOTAL_IPNUM] = { 36 + "SYSMMU_MDMA" , 37 + "SYSMMU_SSS" , 38 + "SYSMMU_FIMC0" , 39 + "SYSMMU_FIMC1" , 40 + "SYSMMU_FIMC2" , 41 + "SYSMMU_FIMC3" , 42 + "SYSMMU_JPEG" , 43 + "SYSMMU_FIMD0" , 44 + "SYSMMU_FIMD1" , 45 + "SYSMMU_PCIe" , 46 + "SYSMMU_G2D" , 47 + "SYSMMU_ROTATOR", 48 + "SYSMMU_MDMA2" , 49 + "SYSMMU_TV" , 50 + "SYSMMU_MFC_L" , 51 + "SYSMMU_MFC_R" , 52 + }; 53 + 54 + typedef enum s5pv310_sysmmu_ips sysmmu_ips; 55 + 56 + struct sysmmu_tt_info { 57 + unsigned long *pgd; 58 + unsigned long pgd_paddr; 59 + unsigned long *pte; 60 + }; 61 + 62 + struct sysmmu_controller { 63 + const char *name; 64 + 65 + /* channels registers */ 66 + void __iomem *regs; 67 + 68 + /* channel irq */ 69 + unsigned int irq; 70 + 71 + sysmmu_ips ips; 72 + 73 + /* Translation Table Info. */ 74 + struct sysmmu_tt_info *tt_info; 75 + 76 + struct resource *mem; 77 + struct device *dev; 78 + 79 + /* SysMMU controller enable - true : enable */ 80 + bool enable; 81 + }; 82 + 83 + /** 84 + * s5p_sysmmu_enable() - enable system mmu of ip 85 + * @ips: The ip connected system mmu. 86 + * 87 + * This function enable system mmu to transfer address 88 + * from virtual address to physical address 89 + */ 90 + int s5p_sysmmu_enable(sysmmu_ips ips); 91 + 92 + /** 93 + * s5p_sysmmu_disable() - disable sysmmu mmu of ip 94 + * @ips: The ip connected system mmu. 95 + * 96 + * This function disable system mmu to transfer address 97 + * from virtual address to physical address 98 + */ 99 + int s5p_sysmmu_disable(sysmmu_ips ips); 100 + 101 + /** 102 + * s5p_sysmmu_set_tablebase_pgd() - set page table base address to refer page table 103 + * @ips: The ip connected system mmu. 104 + * @pgd: The page table base address. 105 + * 106 + * This function set page table base address 107 + * When system mmu transfer address from virtaul address to physical address, 108 + * system mmu refer address information from page table 109 + */ 110 + int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd); 111 + 112 + /** 113 + * s5p_sysmmu_tlb_invalidate() - flush all TLB entry in system mmu 114 + * @ips: The ip connected system mmu. 115 + * 116 + * This function flush all TLB entry in system mmu 117 + */ 118 + int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips); 119 + #endif /* __ASM_ARM_ARCH_SYSMMU_H */
+19 -13
arch/arm/mach-s5pv310/irq-combiner.c
··· 24 25 struct combiner_chip_data { 26 unsigned int irq_offset; 27 void __iomem *base; 28 }; 29 30 static struct combiner_chip_data combiner_data[MAX_COMBINER_NR]; 31 32 - static inline void __iomem *combiner_base(unsigned int irq) 33 { 34 - struct combiner_chip_data *combiner_data = get_irq_chip_data(irq); 35 return combiner_data->base; 36 } 37 38 - static void combiner_mask_irq(unsigned int irq) 39 { 40 - u32 mask = 1 << (irq % 32); 41 42 - __raw_writel(mask, combiner_base(irq) + COMBINER_ENABLE_CLEAR); 43 } 44 45 - static void combiner_unmask_irq(unsigned int irq) 46 { 47 - u32 mask = 1 << (irq % 32); 48 49 - __raw_writel(mask, combiner_base(irq) + COMBINER_ENABLE_SET); 50 } 51 52 static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) ··· 60 unsigned long status; 61 62 /* primary controller ack'ing */ 63 - chip->ack(irq); 64 65 spin_lock(&irq_controller_lock); 66 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS); 67 spin_unlock(&irq_controller_lock); 68 69 if (status == 0) 70 goto out; ··· 80 81 out: 82 /* primary controller unmasking */ 83 - chip->unmask(irq); 84 } 85 86 static struct irq_chip combiner_chip = { 87 .name = "COMBINER", 88 - .mask = combiner_mask_irq, 89 - .unmask = combiner_unmask_irq, 90 }; 91 92 void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq) ··· 108 109 combiner_data[combiner_nr].base = base; 110 combiner_data[combiner_nr].irq_offset = irq_start; 111 112 /* Disable all interrupts */ 113 114 - __raw_writel(0xffffffff, base + COMBINER_ENABLE_CLEAR); 115 116 /* Setup the Linux IRQ subsystem */ 117
··· 24 25 struct combiner_chip_data { 26 unsigned int irq_offset; 27 + unsigned int irq_mask; 28 void __iomem *base; 29 }; 30 31 static struct combiner_chip_data combiner_data[MAX_COMBINER_NR]; 32 33 + static inline void __iomem *combiner_base(struct irq_data *data) 34 { 35 + struct combiner_chip_data *combiner_data = 36 + irq_data_get_irq_chip_data(data); 37 + 38 return combiner_data->base; 39 } 40 41 + static void combiner_mask_irq(struct irq_data *data) 42 { 43 + u32 mask = 1 << (data->irq % 32); 44 45 + __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_CLEAR); 46 } 47 48 + static void combiner_unmask_irq(struct irq_data *data) 49 { 50 + u32 mask = 1 << (data->irq % 32); 51 52 + __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET); 53 } 54 55 static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) ··· 57 unsigned long status; 58 59 /* primary controller ack'ing */ 60 + chip->irq_ack(&desc->irq_data); 61 62 spin_lock(&irq_controller_lock); 63 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS); 64 spin_unlock(&irq_controller_lock); 65 + status &= chip_data->irq_mask; 66 67 if (status == 0) 68 goto out; ··· 76 77 out: 78 /* primary controller unmasking */ 79 + chip->irq_unmask(&desc->irq_data); 80 } 81 82 static struct irq_chip combiner_chip = { 83 .name = "COMBINER", 84 + .irq_mask = combiner_mask_irq, 85 + .irq_unmask = combiner_unmask_irq, 86 }; 87 88 void __init combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq) ··· 104 105 combiner_data[combiner_nr].base = base; 106 combiner_data[combiner_nr].irq_offset = irq_start; 107 + combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3); 108 109 /* Disable all interrupts */ 110 111 + __raw_writel(combiner_data[combiner_nr].irq_mask, 112 + base + COMBINER_ENABLE_CLEAR); 113 114 /* Setup the Linux IRQ subsystem */ 115
+28 -27
arch/arm/mach-s5pv310/irq-eint.c
··· 48 return ret; 49 } 50 51 - static inline void s5pv310_irq_eint_mask(unsigned int irq) 52 { 53 u32 mask; 54 55 spin_lock(&eint_lock); 56 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 57 - mask |= eint_irq_to_bit(irq); 58 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 59 spin_unlock(&eint_lock); 60 } 61 62 - static void s5pv310_irq_eint_unmask(unsigned int irq) 63 { 64 u32 mask; 65 66 spin_lock(&eint_lock); 67 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 68 - mask &= ~(eint_irq_to_bit(irq)); 69 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 70 spin_unlock(&eint_lock); 71 } 72 73 - static inline void s5pv310_irq_eint_ack(unsigned int irq) 74 { 75 - __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); 76 } 77 78 - static void s5pv310_irq_eint_maskack(unsigned int irq) 79 { 80 - s5pv310_irq_eint_mask(irq); 81 - s5pv310_irq_eint_ack(irq); 82 } 83 84 - static int s5pv310_irq_eint_set_type(unsigned int irq, unsigned int type) 85 { 86 - int offs = EINT_OFFSET(irq); 87 int shift; 88 u32 ctrl, mask; 89 u32 newvalue = 0; ··· 119 mask = 0x7 << shift; 120 121 spin_lock(&eint_lock); 122 - ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(irq))); 123 ctrl &= ~mask; 124 ctrl |= newvalue << shift; 125 - __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(irq))); 126 spin_unlock(&eint_lock); 127 128 switch (offs) { ··· 147 148 static struct irq_chip s5pv310_irq_eint = { 149 .name = "s5pv310-eint", 150 - .mask = s5pv310_irq_eint_mask, 151 - .unmask = s5pv310_irq_eint_unmask, 152 - .mask_ack = s5pv310_irq_eint_maskack, 153 - .ack = s5pv310_irq_eint_ack, 154 - .set_type = s5pv310_irq_eint_set_type, 155 #ifdef CONFIG_PM 156 - .set_wake = s3c_irqext_wake, 157 #endif 158 }; 159 ··· 193 u32 *irq_data = get_irq_data(irq); 194 struct irq_chip *chip = get_irq_chip(irq); 195 196 - chip->mask(irq); 197 198 - if (chip->ack) 199 - chip->ack(irq); 200 201 generic_handle_irq(*irq_data); 202 203 - chip->unmask(irq); 204 } 205 206 int __init s5pv310_init_irq_eint(void)
··· 48 return ret; 49 } 50 51 + static inline void s5pv310_irq_eint_mask(struct irq_data *data) 52 { 53 u32 mask; 54 55 spin_lock(&eint_lock); 56 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 57 + mask |= eint_irq_to_bit(data->irq); 58 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 59 spin_unlock(&eint_lock); 60 } 61 62 + static void s5pv310_irq_eint_unmask(struct irq_data *data) 63 { 64 u32 mask; 65 66 spin_lock(&eint_lock); 67 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 68 + mask &= ~(eint_irq_to_bit(data->irq)); 69 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 70 spin_unlock(&eint_lock); 71 } 72 73 + static inline void s5pv310_irq_eint_ack(struct irq_data *data) 74 { 75 + __raw_writel(eint_irq_to_bit(data->irq), 76 + S5P_EINT_PEND(EINT_REG_NR(data->irq))); 77 } 78 79 + static void s5pv310_irq_eint_maskack(struct irq_data *data) 80 { 81 + s5pv310_irq_eint_mask(data); 82 + s5pv310_irq_eint_ack(data); 83 } 84 85 + static int s5pv310_irq_eint_set_type(struct irq_data *data, unsigned int type) 86 { 87 + int offs = EINT_OFFSET(data->irq); 88 int shift; 89 u32 ctrl, mask; 90 u32 newvalue = 0; ··· 118 mask = 0x7 << shift; 119 120 spin_lock(&eint_lock); 121 + ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq))); 122 ctrl &= ~mask; 123 ctrl |= newvalue << shift; 124 + __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq))); 125 spin_unlock(&eint_lock); 126 127 switch (offs) { ··· 146 147 static struct irq_chip s5pv310_irq_eint = { 148 .name = "s5pv310-eint", 149 + .irq_mask = s5pv310_irq_eint_mask, 150 + .irq_unmask = s5pv310_irq_eint_unmask, 151 + .irq_mask_ack = s5pv310_irq_eint_maskack, 152 + .irq_ack = s5pv310_irq_eint_ack, 153 + .irq_set_type = s5pv310_irq_eint_set_type, 154 #ifdef CONFIG_PM 155 + .irq_set_wake = s3c_irqext_wake, 156 #endif 157 }; 158 ··· 192 u32 *irq_data = get_irq_data(irq); 193 struct irq_chip *chip = get_irq_chip(irq); 194 195 + chip->irq_mask(&desc->irq_data); 196 197 + if (chip->irq_ack) 198 + chip->irq_ack(&desc->irq_data); 199 200 generic_handle_irq(*irq_data); 201 202 + chip->irq_unmask(&desc->irq_data); 203 } 204 205 int __init s5pv310_init_irq_eint(void)
+36 -16
arch/arm/mach-s5pv310/mach-smdkc210.c
··· 14 #include <linux/platform_device.h> 15 #include <linux/smsc911x.h> 16 #include <linux/io.h> 17 18 #include <asm/mach/arch.h> 19 #include <asm/mach-types.h> 20 21 #include <plat/regs-serial.h> 22 #include <plat/s5pv310.h> 23 #include <plat/cpu.h> 24 #include <plat/devs.h> 25 #include <plat/sdhci.h> 26 27 #include <mach/map.h> 28 - #include <mach/regs-srom.h> 29 30 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 #define SMDKC210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 142 }, 143 }; 144 145 static struct platform_device *smdkc210_devices[] __initdata = { 146 &s3c_device_hsmmc0, 147 &s3c_device_hsmmc1, 148 &s3c_device_hsmmc2, 149 &s3c_device_hsmmc3, 150 &s3c_device_rtc, 151 &s3c_device_wdt, 152 &smdkc210_smsc911x, 153 }; 154 155 static void __init smdkc210_smsc911x_init(void) ··· 172 u32 cs1; 173 174 /* configure nCS1 width to 16 bits */ 175 - cs1 = __raw_readl(S5PV310_SROM_BW) & 176 - ~(S5PV310_SROM_BW__CS_MASK << 177 - S5PV310_SROM_BW__NCS1__SHIFT); 178 - cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) | 179 - (1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) | 180 - (1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) << 181 - S5PV310_SROM_BW__NCS1__SHIFT; 182 - __raw_writel(cs1, S5PV310_SROM_BW); 183 184 /* set timing for nCS1 suitable for ethernet chip */ 185 - __raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) | 186 - (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) | 187 - (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) | 188 - (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) | 189 - (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) | 190 - (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) | 191 - (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1); 192 } 193 194 static void __init smdkc210_map_io(void) ··· 199 200 static void __init smdkc210_machine_init(void) 201 { 202 smdkc210_smsc911x_init(); 203 204 s3c_sdhci0_set_platdata(&smdkc210_hsmmc0_pdata);
··· 14 #include <linux/platform_device.h> 15 #include <linux/smsc911x.h> 16 #include <linux/io.h> 17 + #include <linux/i2c.h> 18 19 #include <asm/mach/arch.h> 20 #include <asm/mach-types.h> 21 22 #include <plat/regs-serial.h> 23 + #include <plat/regs-srom.h> 24 #include <plat/s5pv310.h> 25 #include <plat/cpu.h> 26 #include <plat/devs.h> 27 #include <plat/sdhci.h> 28 + #include <plat/iic.h> 29 + #include <plat/pd.h> 30 31 #include <mach/map.h> 32 33 /* Following are default values for UCON, ULCON and UFCON UART registers */ 34 #define SMDKC210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 139 }, 140 }; 141 142 + static struct i2c_board_info i2c_devs1[] __initdata = { 143 + {I2C_BOARD_INFO("wm8994", 0x1a),}, 144 + }; 145 + 146 static struct platform_device *smdkc210_devices[] __initdata = { 147 &s3c_device_hsmmc0, 148 &s3c_device_hsmmc1, 149 &s3c_device_hsmmc2, 150 &s3c_device_hsmmc3, 151 + &s3c_device_i2c1, 152 &s3c_device_rtc, 153 &s3c_device_wdt, 154 + &s5pv310_device_ac97, 155 + &s5pv310_device_i2s0, 156 + &s5pv310_device_pd[PD_MFC], 157 + &s5pv310_device_pd[PD_G3D], 158 + &s5pv310_device_pd[PD_LCD0], 159 + &s5pv310_device_pd[PD_LCD1], 160 + &s5pv310_device_pd[PD_CAM], 161 + &s5pv310_device_pd[PD_TV], 162 + &s5pv310_device_pd[PD_GPS], 163 &smdkc210_smsc911x, 164 + &s5pv310_device_sysmmu, 165 }; 166 167 static void __init smdkc210_smsc911x_init(void) ··· 154 u32 cs1; 155 156 /* configure nCS1 width to 16 bits */ 157 + cs1 = __raw_readl(S5P_SROM_BW) & 158 + ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT); 159 + cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) | 160 + (1 << S5P_SROM_BW__WAITENABLE__SHIFT) | 161 + (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) << 162 + S5P_SROM_BW__NCS1__SHIFT; 163 + __raw_writel(cs1, S5P_SROM_BW); 164 165 /* set timing for nCS1 suitable for ethernet chip */ 166 + __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) | 167 + (0x9 << S5P_SROM_BCX__TACP__SHIFT) | 168 + (0xc << S5P_SROM_BCX__TCAH__SHIFT) | 169 + (0x1 << S5P_SROM_BCX__TCOH__SHIFT) | 170 + (0x6 << S5P_SROM_BCX__TACC__SHIFT) | 171 + (0x1 << S5P_SROM_BCX__TCOS__SHIFT) | 172 + (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1); 173 } 174 175 static void __init smdkc210_map_io(void) ··· 182 183 static void __init smdkc210_machine_init(void) 184 { 185 + s3c_i2c1_set_platdata(NULL); 186 + i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 187 + 188 smdkc210_smsc911x_init(); 189 190 s3c_sdhci0_set_platdata(&smdkc210_hsmmc0_pdata);
+36 -16
arch/arm/mach-s5pv310/mach-smdkv310.c
··· 14 #include <linux/platform_device.h> 15 #include <linux/smsc911x.h> 16 #include <linux/io.h> 17 18 #include <asm/mach/arch.h> 19 #include <asm/mach-types.h> 20 21 #include <plat/regs-serial.h> 22 #include <plat/s5pv310.h> 23 #include <plat/cpu.h> 24 #include <plat/devs.h> 25 #include <plat/sdhci.h> 26 27 #include <mach/map.h> 28 - #include <mach/regs-srom.h> 29 30 /* Following are default values for UCON, ULCON and UFCON UART registers */ 31 #define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 142 }, 143 }; 144 145 static struct platform_device *smdkv310_devices[] __initdata = { 146 &s3c_device_hsmmc0, 147 &s3c_device_hsmmc1, 148 &s3c_device_hsmmc2, 149 &s3c_device_hsmmc3, 150 &s3c_device_rtc, 151 &s3c_device_wdt, 152 &smdkv310_smsc911x, 153 }; 154 155 static void __init smdkv310_smsc911x_init(void) ··· 172 u32 cs1; 173 174 /* configure nCS1 width to 16 bits */ 175 - cs1 = __raw_readl(S5PV310_SROM_BW) & 176 - ~(S5PV310_SROM_BW__CS_MASK << 177 - S5PV310_SROM_BW__NCS1__SHIFT); 178 - cs1 |= ((1 << S5PV310_SROM_BW__DATAWIDTH__SHIFT) | 179 - (1 << S5PV310_SROM_BW__WAITENABLE__SHIFT) | 180 - (1 << S5PV310_SROM_BW__BYTEENABLE__SHIFT)) << 181 - S5PV310_SROM_BW__NCS1__SHIFT; 182 - __raw_writel(cs1, S5PV310_SROM_BW); 183 184 /* set timing for nCS1 suitable for ethernet chip */ 185 - __raw_writel((0x1 << S5PV310_SROM_BCX__PMC__SHIFT) | 186 - (0x9 << S5PV310_SROM_BCX__TACP__SHIFT) | 187 - (0xc << S5PV310_SROM_BCX__TCAH__SHIFT) | 188 - (0x1 << S5PV310_SROM_BCX__TCOH__SHIFT) | 189 - (0x6 << S5PV310_SROM_BCX__TACC__SHIFT) | 190 - (0x1 << S5PV310_SROM_BCX__TCOS__SHIFT) | 191 - (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1); 192 } 193 194 static void __init smdkv310_map_io(void) ··· 199 200 static void __init smdkv310_machine_init(void) 201 { 202 smdkv310_smsc911x_init(); 203 204 s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
··· 14 #include <linux/platform_device.h> 15 #include <linux/smsc911x.h> 16 #include <linux/io.h> 17 + #include <linux/i2c.h> 18 19 #include <asm/mach/arch.h> 20 #include <asm/mach-types.h> 21 22 #include <plat/regs-serial.h> 23 + #include <plat/regs-srom.h> 24 #include <plat/s5pv310.h> 25 #include <plat/cpu.h> 26 #include <plat/devs.h> 27 #include <plat/sdhci.h> 28 + #include <plat/iic.h> 29 + #include <plat/pd.h> 30 31 #include <mach/map.h> 32 33 /* Following are default values for UCON, ULCON and UFCON UART registers */ 34 #define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ ··· 139 }, 140 }; 141 142 + static struct i2c_board_info i2c_devs1[] __initdata = { 143 + {I2C_BOARD_INFO("wm8994", 0x1a),}, 144 + }; 145 + 146 static struct platform_device *smdkv310_devices[] __initdata = { 147 &s3c_device_hsmmc0, 148 &s3c_device_hsmmc1, 149 &s3c_device_hsmmc2, 150 &s3c_device_hsmmc3, 151 + &s3c_device_i2c1, 152 &s3c_device_rtc, 153 &s3c_device_wdt, 154 + &s5pv310_device_ac97, 155 + &s5pv310_device_i2s0, 156 + &s5pv310_device_pd[PD_MFC], 157 + &s5pv310_device_pd[PD_G3D], 158 + &s5pv310_device_pd[PD_LCD0], 159 + &s5pv310_device_pd[PD_LCD1], 160 + &s5pv310_device_pd[PD_CAM], 161 + &s5pv310_device_pd[PD_TV], 162 + &s5pv310_device_pd[PD_GPS], 163 &smdkv310_smsc911x, 164 + &s5pv310_device_sysmmu, 165 }; 166 167 static void __init smdkv310_smsc911x_init(void) ··· 154 u32 cs1; 155 156 /* configure nCS1 width to 16 bits */ 157 + cs1 = __raw_readl(S5P_SROM_BW) & 158 + ~(S5P_SROM_BW__CS_MASK << S5P_SROM_BW__NCS1__SHIFT); 159 + cs1 |= ((1 << S5P_SROM_BW__DATAWIDTH__SHIFT) | 160 + (1 << S5P_SROM_BW__WAITENABLE__SHIFT) | 161 + (1 << S5P_SROM_BW__BYTEENABLE__SHIFT)) << 162 + S5P_SROM_BW__NCS1__SHIFT; 163 + __raw_writel(cs1, S5P_SROM_BW); 164 165 /* set timing for nCS1 suitable for ethernet chip */ 166 + __raw_writel((0x1 << S5P_SROM_BCX__PMC__SHIFT) | 167 + (0x9 << S5P_SROM_BCX__TACP__SHIFT) | 168 + (0xc << S5P_SROM_BCX__TCAH__SHIFT) | 169 + (0x1 << S5P_SROM_BCX__TCOH__SHIFT) | 170 + (0x6 << S5P_SROM_BCX__TACC__SHIFT) | 171 + (0x1 << S5P_SROM_BCX__TCOS__SHIFT) | 172 + (0x1 << S5P_SROM_BCX__TACS__SHIFT), S5P_SROM_BC1); 173 } 174 175 static void __init smdkv310_map_io(void) ··· 182 183 static void __init smdkv310_machine_init(void) 184 { 185 + s3c_i2c1_set_platdata(NULL); 186 + i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); 187 + 188 smdkv310_smsc911x_init(); 189 190 s3c_sdhci0_set_platdata(&smdkv310_hsmmc0_pdata);
+80
arch/arm/mach-s5pv310/mach-universal_c210.c
··· 13 #include <linux/i2c.h> 14 #include <linux/gpio_keys.h> 15 #include <linux/gpio.h> 16 17 #include <asm/mach/arch.h> 18 #include <asm/mach-types.h> ··· 24 #include <plat/s5pv310.h> 25 #include <plat/cpu.h> 26 #include <plat/devs.h> 27 28 #include <mach/map.h> 29 ··· 120 }, 121 }; 122 123 /* I2C0 */ 124 static struct i2c_board_info i2c0_devs[] __initdata = { 125 /* Camera, To be updated */ ··· 198 }; 199 200 static struct platform_device *universal_devices[] __initdata = { 201 &universal_gpio_keys, 202 &s5p_device_onenand, 203 }; ··· 218 219 static void __init universal_machine_init(void) 220 { 221 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); 222 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 223
··· 13 #include <linux/i2c.h> 14 #include <linux/gpio_keys.h> 15 #include <linux/gpio.h> 16 + #include <linux/regulator/machine.h> 17 + #include <linux/regulator/fixed.h> 18 + #include <linux/mmc/host.h> 19 20 #include <asm/mach/arch.h> 21 #include <asm/mach-types.h> ··· 21 #include <plat/s5pv310.h> 22 #include <plat/cpu.h> 23 #include <plat/devs.h> 24 + #include <plat/sdhci.h> 25 26 #include <mach/map.h> 27 ··· 116 }, 117 }; 118 119 + /* eMMC */ 120 + static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = { 121 + .max_width = 8, 122 + .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | 123 + MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 124 + MMC_CAP_DISABLE), 125 + .cd_type = S3C_SDHCI_CD_PERMANENT, 126 + .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 127 + }; 128 + 129 + static struct regulator_consumer_supply mmc0_supplies[] = { 130 + REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"), 131 + }; 132 + 133 + static struct regulator_init_data mmc0_fixed_voltage_init_data = { 134 + .constraints = { 135 + .name = "VMEM_VDD_2.8V", 136 + .valid_ops_mask = REGULATOR_CHANGE_STATUS, 137 + }, 138 + .num_consumer_supplies = ARRAY_SIZE(mmc0_supplies), 139 + .consumer_supplies = mmc0_supplies, 140 + }; 141 + 142 + static struct fixed_voltage_config mmc0_fixed_voltage_config = { 143 + .supply_name = "MASSMEMORY_EN", 144 + .microvolts = 2800000, 145 + .gpio = S5PV310_GPE1(3), 146 + .enable_high = true, 147 + .init_data = &mmc0_fixed_voltage_init_data, 148 + }; 149 + 150 + static struct platform_device mmc0_fixed_voltage = { 151 + .name = "reg-fixed-voltage", 152 + .id = 0, 153 + .dev = { 154 + .platform_data = &mmc0_fixed_voltage_config, 155 + }, 156 + }; 157 + 158 + /* SD */ 159 + static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = { 160 + .max_width = 4, 161 + .host_caps = MMC_CAP_4_BIT_DATA | 162 + MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 163 + MMC_CAP_DISABLE, 164 + .ext_cd_gpio = S5PV310_GPX3(4), /* XEINT_28 */ 165 + .ext_cd_gpio_invert = 1, 166 + .cd_type = S3C_SDHCI_CD_GPIO, 167 + .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 168 + }; 169 + 170 + /* WiFi */ 171 + static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = { 172 + .max_width = 4, 173 + .host_caps = MMC_CAP_4_BIT_DATA | 174 + MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 175 + MMC_CAP_DISABLE, 176 + .cd_type = S3C_SDHCI_CD_EXTERNAL, 177 + }; 178 + 179 + static void __init universal_sdhci_init(void) 180 + { 181 + s3c_sdhci0_set_platdata(&universal_hsmmc0_data); 182 + s3c_sdhci2_set_platdata(&universal_hsmmc2_data); 183 + s3c_sdhci3_set_platdata(&universal_hsmmc3_data); 184 + } 185 + 186 /* I2C0 */ 187 static struct i2c_board_info i2c0_devs[] __initdata = { 188 /* Camera, To be updated */ ··· 127 }; 128 129 static struct platform_device *universal_devices[] __initdata = { 130 + /* Samsung Platform Devices */ 131 + &mmc0_fixed_voltage, 132 + &s3c_device_hsmmc0, 133 + &s3c_device_hsmmc2, 134 + &s3c_device_hsmmc3, 135 + 136 + /* Universal Devices */ 137 &universal_gpio_keys, 138 &s5p_device_onenand, 139 }; ··· 140 141 static void __init universal_machine_init(void) 142 { 143 + universal_sdhci_init(); 144 + 145 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); 146 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 147
+42 -42
arch/arm/mach-sa1100/irq.c
··· 37 #define GPIO_11_27_IRQ(i) ((i) - 21) 38 #define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq)) 39 40 - static int sa1100_gpio_type(unsigned int irq, unsigned int type) 41 { 42 unsigned int mask; 43 44 - if (irq <= 10) 45 - mask = 1 << irq; 46 else 47 - mask = GPIO11_27_MASK(irq); 48 49 if (type == IRQ_TYPE_PROBE) { 50 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) ··· 70 /* 71 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10. 72 */ 73 - static void sa1100_low_gpio_ack(unsigned int irq) 74 { 75 - GEDR = (1 << irq); 76 } 77 78 - static void sa1100_low_gpio_mask(unsigned int irq) 79 { 80 - ICMR &= ~(1 << irq); 81 } 82 83 - static void sa1100_low_gpio_unmask(unsigned int irq) 84 { 85 - ICMR |= 1 << irq; 86 } 87 88 - static int sa1100_low_gpio_wake(unsigned int irq, unsigned int on) 89 { 90 if (on) 91 - PWER |= 1 << irq; 92 else 93 - PWER &= ~(1 << irq); 94 return 0; 95 } 96 97 static struct irq_chip sa1100_low_gpio_chip = { 98 .name = "GPIO-l", 99 - .ack = sa1100_low_gpio_ack, 100 - .mask = sa1100_low_gpio_mask, 101 - .unmask = sa1100_low_gpio_unmask, 102 - .set_type = sa1100_gpio_type, 103 - .set_wake = sa1100_low_gpio_wake, 104 }; 105 106 /* ··· 139 * In addition, the IRQs are all collected up into one bit in the 140 * interrupt controller registers. 141 */ 142 - static void sa1100_high_gpio_ack(unsigned int irq) 143 { 144 - unsigned int mask = GPIO11_27_MASK(irq); 145 146 GEDR = mask; 147 } 148 149 - static void sa1100_high_gpio_mask(unsigned int irq) 150 { 151 - unsigned int mask = GPIO11_27_MASK(irq); 152 153 GPIO_IRQ_mask &= ~mask; 154 ··· 156 GFER &= ~mask; 157 } 158 159 - static void sa1100_high_gpio_unmask(unsigned int irq) 160 { 161 - unsigned int mask = GPIO11_27_MASK(irq); 162 163 GPIO_IRQ_mask |= mask; 164 ··· 166 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; 167 } 168 169 - static int sa1100_high_gpio_wake(unsigned int irq, unsigned int on) 170 { 171 if (on) 172 - PWER |= GPIO11_27_MASK(irq); 173 else 174 - PWER &= ~GPIO11_27_MASK(irq); 175 return 0; 176 } 177 178 static struct irq_chip sa1100_high_gpio_chip = { 179 .name = "GPIO-h", 180 - .ack = sa1100_high_gpio_ack, 181 - .mask = sa1100_high_gpio_mask, 182 - .unmask = sa1100_high_gpio_unmask, 183 - .set_type = sa1100_gpio_type, 184 - .set_wake = sa1100_high_gpio_wake, 185 }; 186 187 /* 188 * We don't need to ACK IRQs on the SA1100 unless they're GPIOs 189 * this is for internal IRQs i.e. from 11 to 31. 190 */ 191 - static void sa1100_mask_irq(unsigned int irq) 192 { 193 - ICMR &= ~(1 << irq); 194 } 195 196 - static void sa1100_unmask_irq(unsigned int irq) 197 { 198 - ICMR |= (1 << irq); 199 } 200 201 /* 202 * Apart form GPIOs, only the RTC alarm can be a wakeup event. 203 */ 204 - static int sa1100_set_wake(unsigned int irq, unsigned int on) 205 { 206 - if (irq == IRQ_RTCAlrm) { 207 if (on) 208 PWER |= PWER_RTC; 209 else ··· 215 216 static struct irq_chip sa1100_normal_chip = { 217 .name = "SC", 218 - .ack = sa1100_mask_irq, 219 - .mask = sa1100_mask_irq, 220 - .unmask = sa1100_unmask_irq, 221 - .set_wake = sa1100_set_wake, 222 }; 223 224 static struct resource irq_resource = {
··· 37 #define GPIO_11_27_IRQ(i) ((i) - 21) 38 #define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq)) 39 40 + static int sa1100_gpio_type(struct irq_data *d, unsigned int type) 41 { 42 unsigned int mask; 43 44 + if (d->irq <= 10) 45 + mask = 1 << d->irq; 46 else 47 + mask = GPIO11_27_MASK(d->irq); 48 49 if (type == IRQ_TYPE_PROBE) { 50 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) ··· 70 /* 71 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10. 72 */ 73 + static void sa1100_low_gpio_ack(struct irq_data *d) 74 { 75 + GEDR = (1 << d->irq); 76 } 77 78 + static void sa1100_low_gpio_mask(struct irq_data *d) 79 { 80 + ICMR &= ~(1 << d->irq); 81 } 82 83 + static void sa1100_low_gpio_unmask(struct irq_data *d) 84 { 85 + ICMR |= 1 << d->irq; 86 } 87 88 + static int sa1100_low_gpio_wake(struct irq_data *d, unsigned int on) 89 { 90 if (on) 91 + PWER |= 1 << d->irq; 92 else 93 + PWER &= ~(1 << d->irq); 94 return 0; 95 } 96 97 static struct irq_chip sa1100_low_gpio_chip = { 98 .name = "GPIO-l", 99 + .irq_ack = sa1100_low_gpio_ack, 100 + .irq_mask = sa1100_low_gpio_mask, 101 + .irq_unmask = sa1100_low_gpio_unmask, 102 + .irq_set_type = sa1100_gpio_type, 103 + .irq_set_wake = sa1100_low_gpio_wake, 104 }; 105 106 /* ··· 139 * In addition, the IRQs are all collected up into one bit in the 140 * interrupt controller registers. 141 */ 142 + static void sa1100_high_gpio_ack(struct irq_data *d) 143 { 144 + unsigned int mask = GPIO11_27_MASK(d->irq); 145 146 GEDR = mask; 147 } 148 149 + static void sa1100_high_gpio_mask(struct irq_data *d) 150 { 151 + unsigned int mask = GPIO11_27_MASK(d->irq); 152 153 GPIO_IRQ_mask &= ~mask; 154 ··· 156 GFER &= ~mask; 157 } 158 159 + static void sa1100_high_gpio_unmask(struct irq_data *d) 160 { 161 + unsigned int mask = GPIO11_27_MASK(d->irq); 162 163 GPIO_IRQ_mask |= mask; 164 ··· 166 GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; 167 } 168 169 + static int sa1100_high_gpio_wake(struct irq_data *d, unsigned int on) 170 { 171 if (on) 172 + PWER |= GPIO11_27_MASK(d->irq); 173 else 174 + PWER &= ~GPIO11_27_MASK(d->irq); 175 return 0; 176 } 177 178 static struct irq_chip sa1100_high_gpio_chip = { 179 .name = "GPIO-h", 180 + .irq_ack = sa1100_high_gpio_ack, 181 + .irq_mask = sa1100_high_gpio_mask, 182 + .irq_unmask = sa1100_high_gpio_unmask, 183 + .irq_set_type = sa1100_gpio_type, 184 + .irq_set_wake = sa1100_high_gpio_wake, 185 }; 186 187 /* 188 * We don't need to ACK IRQs on the SA1100 unless they're GPIOs 189 * this is for internal IRQs i.e. from 11 to 31. 190 */ 191 + static void sa1100_mask_irq(struct irq_data *d) 192 { 193 + ICMR &= ~(1 << d->irq); 194 } 195 196 + static void sa1100_unmask_irq(struct irq_data *d) 197 { 198 + ICMR |= (1 << d->irq); 199 } 200 201 /* 202 * Apart form GPIOs, only the RTC alarm can be a wakeup event. 203 */ 204 + static int sa1100_set_wake(struct irq_data *d, unsigned int on) 205 { 206 + if (d->irq == IRQ_RTCAlrm) { 207 if (on) 208 PWER |= PWER_RTC; 209 else ··· 215 216 static struct irq_chip sa1100_normal_chip = { 217 .name = "SC", 218 + .irq_ack = sa1100_mask_irq, 219 + .irq_mask = sa1100_mask_irq, 220 + .irq_unmask = sa1100_unmask_irq, 221 + .irq_set_wake = sa1100_set_wake, 222 }; 223 224 static struct resource irq_resource = {
+4 -4
arch/arm/mach-sa1100/neponset.c
··· 35 /* 36 * Acknowledge the parent IRQ. 37 */ 38 - desc->chip->ack(irq); 39 40 /* 41 * Read the interrupt reason register. Let's have all ··· 53 * recheck the register for any pending IRQs. 54 */ 55 if (irr & (IRR_ETHERNET | IRR_USAR)) { 56 - desc->chip->mask(irq); 57 58 /* 59 * Ack the interrupt now to prevent re-entering ··· 61 * since we'll check the IRR register prior to 62 * leaving. 63 */ 64 - desc->chip->ack(irq); 65 66 if (irr & IRR_ETHERNET) { 67 generic_handle_irq(IRQ_NEPONSET_SMC9196); ··· 71 generic_handle_irq(IRQ_NEPONSET_USAR); 72 } 73 74 - desc->chip->unmask(irq); 75 } 76 77 if (irr & IRR_SA1111) {
··· 35 /* 36 * Acknowledge the parent IRQ. 37 */ 38 + desc->irq_data.chip->irq_ack(&desc->irq_data); 39 40 /* 41 * Read the interrupt reason register. Let's have all ··· 53 * recheck the register for any pending IRQs. 54 */ 55 if (irr & (IRR_ETHERNET | IRR_USAR)) { 56 + desc->irq_data.chip->irq_mask(&desc->irq_data); 57 58 /* 59 * Ack the interrupt now to prevent re-entering ··· 61 * since we'll check the IRR register prior to 62 * leaving. 63 */ 64 + desc->irq_data.chip->irq_ack(&desc->irq_data); 65 66 if (irr & IRR_ETHERNET) { 67 generic_handle_irq(IRQ_NEPONSET_SMC9196); ··· 71 generic_handle_irq(IRQ_NEPONSET_USAR); 72 } 73 74 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 75 } 76 77 if (irr & IRR_SA1111) {
+13 -13
arch/arm/mach-shark/irq.c
··· 30 * These have to be protected by the irq controller spinlock 31 * before being called. 32 */ 33 - static void shark_disable_8259A_irq(unsigned int irq) 34 { 35 unsigned int mask; 36 - if (irq<8) { 37 - mask = 1 << irq; 38 cached_irq_mask[0] |= mask; 39 outb(cached_irq_mask[1],0xA1); 40 } else { 41 - mask = 1 << (irq-8); 42 cached_irq_mask[1] |= mask; 43 outb(cached_irq_mask[0],0x21); 44 } 45 } 46 47 - static void shark_enable_8259A_irq(unsigned int irq) 48 { 49 unsigned int mask; 50 - if (irq<8) { 51 - mask = ~(1 << irq); 52 cached_irq_mask[0] &= mask; 53 outb(cached_irq_mask[0],0x21); 54 } else { 55 - mask = ~(1 << (irq-8)); 56 cached_irq_mask[1] &= mask; 57 outb(cached_irq_mask[1],0xA1); 58 } 59 } 60 61 - static void shark_ack_8259A_irq(unsigned int irq){} 62 63 static irqreturn_t bogus_int(int irq, void *dev_id) 64 { ··· 69 static struct irqaction cascade; 70 71 static struct irq_chip fb_chip = { 72 - .name = "XT-PIC", 73 - .ack = shark_ack_8259A_irq, 74 - .mask = shark_disable_8259A_irq, 75 - .unmask = shark_enable_8259A_irq, 76 }; 77 78 void __init shark_init_irq(void)
··· 30 * These have to be protected by the irq controller spinlock 31 * before being called. 32 */ 33 + static void shark_disable_8259A_irq(struct irq_data *d) 34 { 35 unsigned int mask; 36 + if (d->irq<8) { 37 + mask = 1 << d->irq; 38 cached_irq_mask[0] |= mask; 39 outb(cached_irq_mask[1],0xA1); 40 } else { 41 + mask = 1 << (d->irq-8); 42 cached_irq_mask[1] |= mask; 43 outb(cached_irq_mask[0],0x21); 44 } 45 } 46 47 + static void shark_enable_8259A_irq(struct irq_data *d) 48 { 49 unsigned int mask; 50 + if (d->irq<8) { 51 + mask = ~(1 << d->irq); 52 cached_irq_mask[0] &= mask; 53 outb(cached_irq_mask[0],0x21); 54 } else { 55 + mask = ~(1 << (d->irq-8)); 56 cached_irq_mask[1] &= mask; 57 outb(cached_irq_mask[1],0xA1); 58 } 59 } 60 61 + static void shark_ack_8259A_irq(struct irq_data *d){} 62 63 static irqreturn_t bogus_int(int irq, void *dev_id) 64 { ··· 69 static struct irqaction cascade; 70 71 static struct irq_chip fb_chip = { 72 + .name = "XT-PIC", 73 + .irq_ack = shark_ack_8259A_irq, 74 + .irq_mask = shark_disable_8259A_irq, 75 + .irq_unmask = shark_enable_8259A_irq, 76 }; 77 78 void __init shark_init_irq(void)
+8 -8
arch/arm/mach-stmp378x/stmp378x.c
··· 47 /* 48 * IRQ handling 49 */ 50 - static void stmp378x_ack_irq(unsigned int irq) 51 { 52 /* Tell ICOLL to release IRQ line */ 53 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR); ··· 60 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT); 61 } 62 63 - static void stmp378x_mask_irq(unsigned int irq) 64 { 65 /* IRQ disable */ 66 stmp3xxx_clearl(BM_ICOLL_INTERRUPTn_ENABLE, 67 - REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10); 68 } 69 70 - static void stmp378x_unmask_irq(unsigned int irq) 71 { 72 /* IRQ enable */ 73 stmp3xxx_setl(BM_ICOLL_INTERRUPTn_ENABLE, 74 - REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + irq * 0x10); 75 } 76 77 static struct irq_chip stmp378x_chip = { 78 - .ack = stmp378x_ack_irq, 79 - .mask = stmp378x_mask_irq, 80 - .unmask = stmp378x_unmask_irq, 81 }; 82 83 void __init stmp378x_init_irq(void)
··· 47 /* 48 * IRQ handling 49 */ 50 + static void stmp378x_ack_irq(struct irq_data *d) 51 { 52 /* Tell ICOLL to release IRQ line */ 53 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR); ··· 60 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT); 61 } 62 63 + static void stmp378x_mask_irq(struct irq_data *d) 64 { 65 /* IRQ disable */ 66 stmp3xxx_clearl(BM_ICOLL_INTERRUPTn_ENABLE, 67 + REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + d->irq * 0x10); 68 } 69 70 + static void stmp378x_unmask_irq(struct irq_data *d) 71 { 72 /* IRQ enable */ 73 stmp3xxx_setl(BM_ICOLL_INTERRUPTn_ENABLE, 74 + REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + d->irq * 0x10); 75 } 76 77 static struct irq_chip stmp378x_chip = { 78 + .irq_ack = stmp378x_ack_irq, 79 + .irq_mask = stmp378x_mask_irq, 80 + .irq_unmask = stmp378x_unmask_irq, 81 }; 82 83 void __init stmp378x_init_irq(void)
+12 -12
arch/arm/mach-stmp37xx/stmp37xx.c
··· 43 /* 44 * IRQ handling 45 */ 46 - static void stmp37xx_ack_irq(unsigned int irq) 47 { 48 /* Disable IRQ */ 49 - stmp3xxx_clearl(0x04 << ((irq % 4) * 8), 50 - REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10); 51 52 /* ACK current interrupt */ 53 __raw_writel(1, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK); ··· 56 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT); 57 } 58 59 - static void stmp37xx_mask_irq(unsigned int irq) 60 { 61 /* IRQ disable */ 62 - stmp3xxx_clearl(0x04 << ((irq % 4) * 8), 63 - REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10); 64 } 65 66 - static void stmp37xx_unmask_irq(unsigned int irq) 67 { 68 /* IRQ enable */ 69 - stmp3xxx_setl(0x04 << ((irq % 4) * 8), 70 - REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + irq / 4 * 0x10); 71 } 72 73 static struct irq_chip stmp37xx_chip = { 74 - .ack = stmp37xx_ack_irq, 75 - .mask = stmp37xx_mask_irq, 76 - .unmask = stmp37xx_unmask_irq, 77 }; 78 79 void __init stmp37xx_init_irq(void)
··· 43 /* 44 * IRQ handling 45 */ 46 + static void stmp37xx_ack_irq(struct irq_data *d) 47 { 48 /* Disable IRQ */ 49 + stmp3xxx_clearl(0x04 << ((d->irq % 4) * 8), 50 + REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10); 51 52 /* ACK current interrupt */ 53 __raw_writel(1, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK); ··· 56 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT); 57 } 58 59 + static void stmp37xx_mask_irq(struct irq_data *d) 60 { 61 /* IRQ disable */ 62 + stmp3xxx_clearl(0x04 << ((d->irq % 4) * 8), 63 + REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10); 64 } 65 66 + static void stmp37xx_unmask_irq(struct irq_data *d) 67 { 68 /* IRQ enable */ 69 + stmp3xxx_setl(0x04 << ((d->irq % 4) * 8), 70 + REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10); 71 } 72 73 static struct irq_chip stmp37xx_chip = { 74 + .irq_ack = stmp37xx_ack_irq, 75 + .irq_mask = stmp37xx_mask_irq, 76 + .irq_unmask = stmp37xx_unmask_irq, 77 }; 78 79 void __init stmp37xx_init_irq(void)
+28 -28
arch/arm/mach-tcc8k/irq.c
··· 18 #include "common.h" 19 20 /* Disable IRQ */ 21 - static void tcc8000_mask_ack_irq0(unsigned int irq) 22 { 23 - PIC0_IEN &= ~(1 << irq); 24 - PIC0_CREQ |= (1 << irq); 25 } 26 27 - static void tcc8000_mask_ack_irq1(unsigned int irq) 28 { 29 - PIC1_IEN &= ~(1 << (irq - 32)); 30 - PIC1_CREQ |= (1 << (irq - 32)); 31 } 32 33 - static void tcc8000_mask_irq0(unsigned int irq) 34 { 35 - PIC0_IEN &= ~(1 << irq); 36 } 37 38 - static void tcc8000_mask_irq1(unsigned int irq) 39 { 40 - PIC1_IEN &= ~(1 << (irq - 32)); 41 } 42 43 - static void tcc8000_ack_irq0(unsigned int irq) 44 { 45 - PIC0_CREQ |= (1 << irq); 46 } 47 48 - static void tcc8000_ack_irq1(unsigned int irq) 49 { 50 - PIC1_CREQ |= (1 << (irq - 32)); 51 } 52 53 /* Enable IRQ */ 54 - static void tcc8000_unmask_irq0(unsigned int irq) 55 { 56 - PIC0_IEN |= (1 << irq); 57 - PIC0_INTOEN |= (1 << irq); 58 } 59 60 - static void tcc8000_unmask_irq1(unsigned int irq) 61 { 62 - PIC1_IEN |= (1 << (irq - 32)); 63 - PIC1_INTOEN |= (1 << (irq - 32)); 64 } 65 66 static struct irq_chip tcc8000_irq_chip0 = { 67 .name = "tcc_irq0", 68 - .mask = tcc8000_mask_irq0, 69 - .ack = tcc8000_ack_irq0, 70 - .mask_ack = tcc8000_mask_ack_irq0, 71 - .unmask = tcc8000_unmask_irq0, 72 }; 73 74 static struct irq_chip tcc8000_irq_chip1 = { 75 .name = "tcc_irq1", 76 - .mask = tcc8000_mask_irq1, 77 - .ack = tcc8000_ack_irq1, 78 - .mask_ack = tcc8000_mask_ack_irq1, 79 - .unmask = tcc8000_unmask_irq1, 80 }; 81 82 void __init tcc8k_init_irq(void)
··· 18 #include "common.h" 19 20 /* Disable IRQ */ 21 + static void tcc8000_mask_ack_irq0(struct irq_data *d) 22 { 23 + PIC0_IEN &= ~(1 << d->irq); 24 + PIC0_CREQ |= (1 << d->irq); 25 } 26 27 + static void tcc8000_mask_ack_irq1(struct irq_data *d) 28 { 29 + PIC1_IEN &= ~(1 << (d->irq - 32)); 30 + PIC1_CREQ |= (1 << (d->irq - 32)); 31 } 32 33 + static void tcc8000_mask_irq0(struct irq_data *d) 34 { 35 + PIC0_IEN &= ~(1 << d->irq); 36 } 37 38 + static void tcc8000_mask_irq1(struct irq_data *d) 39 { 40 + PIC1_IEN &= ~(1 << (d->irq - 32)); 41 } 42 43 + static void tcc8000_ack_irq0(struct irq_data *d) 44 { 45 + PIC0_CREQ |= (1 << d->irq); 46 } 47 48 + static void tcc8000_ack_irq1(struct irq_data *d) 49 { 50 + PIC1_CREQ |= (1 << (d->irq - 32)); 51 } 52 53 /* Enable IRQ */ 54 + static void tcc8000_unmask_irq0(struct irq_data *d) 55 { 56 + PIC0_IEN |= (1 << d->irq); 57 + PIC0_INTOEN |= (1 << d->irq); 58 } 59 60 + static void tcc8000_unmask_irq1(struct irq_data *d) 61 { 62 + PIC1_IEN |= (1 << (d->irq - 32)); 63 + PIC1_INTOEN |= (1 << (d->irq - 32)); 64 } 65 66 static struct irq_chip tcc8000_irq_chip0 = { 67 .name = "tcc_irq0", 68 + .irq_mask = tcc8000_mask_irq0, 69 + .irq_ack = tcc8000_ack_irq0, 70 + .irq_mask_ack = tcc8000_mask_ack_irq0, 71 + .irq_unmask = tcc8000_unmask_irq0, 72 }; 73 74 static struct irq_chip tcc8000_irq_chip1 = { 75 .name = "tcc_irq1", 76 + .irq_mask = tcc8000_mask_irq1, 77 + .irq_ack = tcc8000_ack_irq1, 78 + .irq_mask_ack = tcc8000_mask_ack_irq1, 79 + .irq_unmask = tcc8000_unmask_irq1, 80 }; 81 82 void __init tcc8k_init_irq(void)
+19 -19
arch/arm/mach-tegra/gpio.c
··· 142 .ngpio = TEGRA_NR_GPIOS, 143 }; 144 145 - static void tegra_gpio_irq_ack(unsigned int irq) 146 { 147 - int gpio = irq - INT_GPIO_BASE; 148 149 __raw_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio)); 150 } 151 152 - static void tegra_gpio_irq_mask(unsigned int irq) 153 { 154 - int gpio = irq - INT_GPIO_BASE; 155 156 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0); 157 } 158 159 - static void tegra_gpio_irq_unmask(unsigned int irq) 160 { 161 - int gpio = irq - INT_GPIO_BASE; 162 163 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1); 164 } 165 166 - static int tegra_gpio_irq_set_type(unsigned int irq, unsigned int type) 167 { 168 - int gpio = irq - INT_GPIO_BASE; 169 - struct tegra_gpio_bank *bank = get_irq_chip_data(irq); 170 int port = GPIO_PORT(gpio); 171 int lvl_type; 172 int val; ··· 221 int pin; 222 int unmasked = 0; 223 224 - desc->chip->ack(irq); 225 226 bank = get_irq_data(irq); 227 ··· 240 */ 241 if (lvl & (0x100 << pin)) { 242 unmasked = 1; 243 - desc->chip->unmask(irq); 244 } 245 246 generic_handle_irq(gpio_to_irq(gpio + pin)); ··· 248 } 249 250 if (!unmasked) 251 - desc->chip->unmask(irq); 252 253 } 254 ··· 316 local_irq_restore(flags); 317 } 318 319 - static int tegra_gpio_wake_enable(unsigned int irq, unsigned int enable) 320 { 321 - struct tegra_gpio_bank *bank = get_irq_chip_data(irq); 322 return set_irq_wake(bank->irq, enable); 323 } 324 #endif 325 326 static struct irq_chip tegra_gpio_irq_chip = { 327 .name = "GPIO", 328 - .ack = tegra_gpio_irq_ack, 329 - .mask = tegra_gpio_irq_mask, 330 - .unmask = tegra_gpio_irq_unmask, 331 - .set_type = tegra_gpio_irq_set_type, 332 #ifdef CONFIG_PM 333 - .set_wake = tegra_gpio_wake_enable, 334 #endif 335 }; 336
··· 142 .ngpio = TEGRA_NR_GPIOS, 143 }; 144 145 + static void tegra_gpio_irq_ack(struct irq_data *d) 146 { 147 + int gpio = d->irq - INT_GPIO_BASE; 148 149 __raw_writel(1 << GPIO_BIT(gpio), GPIO_INT_CLR(gpio)); 150 } 151 152 + static void tegra_gpio_irq_mask(struct irq_data *d) 153 { 154 + int gpio = d->irq - INT_GPIO_BASE; 155 156 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 0); 157 } 158 159 + static void tegra_gpio_irq_unmask(struct irq_data *d) 160 { 161 + int gpio = d->irq - INT_GPIO_BASE; 162 163 tegra_gpio_mask_write(GPIO_MSK_INT_ENB(gpio), gpio, 1); 164 } 165 166 + static int tegra_gpio_irq_set_type(struct irq_data *d, unsigned int type) 167 { 168 + int gpio = d->irq - INT_GPIO_BASE; 169 + struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); 170 int port = GPIO_PORT(gpio); 171 int lvl_type; 172 int val; ··· 221 int pin; 222 int unmasked = 0; 223 224 + desc->irq_data.chip->irq_ack(&desc->irq_data); 225 226 bank = get_irq_data(irq); 227 ··· 240 */ 241 if (lvl & (0x100 << pin)) { 242 unmasked = 1; 243 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 244 } 245 246 generic_handle_irq(gpio_to_irq(gpio + pin)); ··· 248 } 249 250 if (!unmasked) 251 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 252 253 } 254 ··· 316 local_irq_restore(flags); 317 } 318 319 + static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable) 320 { 321 + struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d); 322 return set_irq_wake(bank->irq, enable); 323 } 324 #endif 325 326 static struct irq_chip tegra_gpio_irq_chip = { 327 .name = "GPIO", 328 + .irq_ack = tegra_gpio_irq_ack, 329 + .irq_mask = tegra_gpio_irq_mask, 330 + .irq_unmask = tegra_gpio_irq_unmask, 331 + .irq_set_type = tegra_gpio_irq_set_type, 332 #ifdef CONFIG_PM 333 + .irq_set_wake = tegra_gpio_wake_enable, 334 #endif 335 }; 336
+18 -18
arch/arm/mach-tegra/irq.c
··· 46 #define ICTLR_COP_IER_CLR 0x38 47 #define ICTLR_COP_IEP_CLASS 0x3c 48 49 - static void (*gic_mask_irq)(unsigned int irq); 50 - static void (*gic_unmask_irq)(unsigned int irq); 51 52 #define irq_to_ictlr(irq) (((irq)-32) >> 5) 53 static void __iomem *tegra_ictlr_base = IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE); 54 #define ictlr_to_virt(ictlr) (tegra_ictlr_base + (ictlr)*0x100) 55 56 - static void tegra_mask(unsigned int irq) 57 { 58 - void __iomem *addr = ictlr_to_virt(irq_to_ictlr(irq)); 59 - gic_mask_irq(irq); 60 - writel(1<<(irq&31), addr+ICTLR_CPU_IER_CLR); 61 } 62 63 - static void tegra_unmask(unsigned int irq) 64 { 65 - void __iomem *addr = ictlr_to_virt(irq_to_ictlr(irq)); 66 - gic_unmask_irq(irq); 67 - writel(1<<(irq&31), addr+ICTLR_CPU_IER_SET); 68 } 69 70 #ifdef CONFIG_PM 71 72 - static int tegra_set_wake(unsigned int irq, unsigned int on) 73 { 74 return 0; 75 } ··· 77 78 static struct irq_chip tegra_irq = { 79 .name = "PPI", 80 - .mask = tegra_mask, 81 - .unmask = tegra_unmask, 82 #ifdef CONFIG_PM 83 - .set_wake = tegra_set_wake, 84 #endif 85 }; 86 ··· 98 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 99 100 gic = get_irq_chip(29); 101 - gic_unmask_irq = gic->unmask; 102 - gic_mask_irq = gic->mask; 103 - tegra_irq.ack = gic->ack; 104 #ifdef CONFIG_SMP 105 - tegra_irq.set_affinity = gic->set_affinity; 106 #endif 107 108 for (i = INT_PRI_BASE; i < INT_GPIO_BASE; i++) {
··· 46 #define ICTLR_COP_IER_CLR 0x38 47 #define ICTLR_COP_IEP_CLASS 0x3c 48 49 + static void (*gic_mask_irq)(struct irq_data *d); 50 + static void (*gic_unmask_irq)(struct irq_data *d); 51 52 #define irq_to_ictlr(irq) (((irq)-32) >> 5) 53 static void __iomem *tegra_ictlr_base = IO_ADDRESS(TEGRA_PRIMARY_ICTLR_BASE); 54 #define ictlr_to_virt(ictlr) (tegra_ictlr_base + (ictlr)*0x100) 55 56 + static void tegra_mask(struct irq_data *d) 57 { 58 + void __iomem *addr = ictlr_to_virt(irq_to_ictlr(d->irq)); 59 + gic_mask_irq(d); 60 + writel(1<<(d->irq&31), addr+ICTLR_CPU_IER_CLR); 61 } 62 63 + static void tegra_unmask(struct irq_data *d) 64 { 65 + void __iomem *addr = ictlr_to_virt(irq_to_ictlr(d->irq)); 66 + gic_unmask_irq(d); 67 + writel(1<<(d->irq&31), addr+ICTLR_CPU_IER_SET); 68 } 69 70 #ifdef CONFIG_PM 71 72 + static int tegra_set_wake(struct irq_data *d, unsigned int on) 73 { 74 return 0; 75 } ··· 77 78 static struct irq_chip tegra_irq = { 79 .name = "PPI", 80 + .irq_mask = tegra_mask, 81 + .irq_unmask = tegra_unmask, 82 #ifdef CONFIG_PM 83 + .irq_set_wake = tegra_set_wake, 84 #endif 85 }; 86 ··· 98 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100)); 99 100 gic = get_irq_chip(29); 101 + gic_unmask_irq = gic->irq_unmask; 102 + gic_mask_irq = gic->irq_mask; 103 + tegra_irq.irq_ack = gic->irq_ack; 104 #ifdef CONFIG_SMP 105 + tegra_irq.irq_set_affinity = gic->irq_set_affinity; 106 #endif 107 108 for (i = INT_PRI_BASE; i < INT_GPIO_BASE; i++) {
+10 -8
arch/arm/mach-versatile/core.c
··· 63 #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) 64 #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) 65 66 - static void sic_mask_irq(unsigned int irq) 67 { 68 - irq -= IRQ_SIC_START; 69 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); 70 } 71 72 - static void sic_unmask_irq(unsigned int irq) 73 { 74 - irq -= IRQ_SIC_START; 75 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET); 76 } 77 78 static struct irq_chip sic_chip = { 79 - .name = "SIC", 80 - .ack = sic_mask_irq, 81 - .mask = sic_mask_irq, 82 - .unmask = sic_unmask_irq, 83 }; 84 85 static void
··· 63 #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) 64 #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) 65 66 + static void sic_mask_irq(struct irq_data *d) 67 { 68 + unsigned int irq = d->irq - IRQ_SIC_START; 69 + 70 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_CLEAR); 71 } 72 73 + static void sic_unmask_irq(struct irq_data *d) 74 { 75 + unsigned int irq = d->irq - IRQ_SIC_START; 76 + 77 writel(1 << irq, VA_SIC_BASE + SIC_IRQ_ENABLE_SET); 78 } 79 80 static struct irq_chip sic_chip = { 81 + .name = "SIC", 82 + .irq_ack = sic_mask_irq, 83 + .irq_mask = sic_mask_irq, 84 + .irq_unmask = sic_unmask_irq, 85 }; 86 87 static void
+10 -10
arch/arm/mach-w90x900/irq.c
··· 92 __raw_writel(regval, REG_AIC_GEN); 93 } 94 95 - static void nuc900_irq_mask(unsigned int irq) 96 { 97 struct group_irq *group_irq; 98 99 group_irq = NULL; 100 101 - __raw_writel(1 << irq, REG_AIC_MDCR); 102 103 - switch (irq) { 104 case IRQ_GROUP0: 105 group_irq = &group_nirq0; 106 break; ··· 143 * to REG_AIC_EOSCR for ACK 144 */ 145 146 - static void nuc900_irq_ack(unsigned int irq) 147 { 148 __raw_writel(0x01, REG_AIC_EOSCR); 149 } 150 151 - static void nuc900_irq_unmask(unsigned int irq) 152 { 153 struct group_irq *group_irq; 154 155 group_irq = NULL; 156 157 - __raw_writel(1 << irq, REG_AIC_MECR); 158 159 - switch (irq) { 160 case IRQ_GROUP0: 161 group_irq = &group_nirq0; 162 break; ··· 195 } 196 197 static struct irq_chip nuc900_irq_chip = { 198 - .ack = nuc900_irq_ack, 199 - .mask = nuc900_irq_mask, 200 - .unmask = nuc900_irq_unmask, 201 }; 202 203 void __init nuc900_init_irq(void)
··· 92 __raw_writel(regval, REG_AIC_GEN); 93 } 94 95 + static void nuc900_irq_mask(struct irq_data *d) 96 { 97 struct group_irq *group_irq; 98 99 group_irq = NULL; 100 101 + __raw_writel(1 << d->irq, REG_AIC_MDCR); 102 103 + switch (d->irq) { 104 case IRQ_GROUP0: 105 group_irq = &group_nirq0; 106 break; ··· 143 * to REG_AIC_EOSCR for ACK 144 */ 145 146 + static void nuc900_irq_ack(struct irq_data *d) 147 { 148 __raw_writel(0x01, REG_AIC_EOSCR); 149 } 150 151 + static void nuc900_irq_unmask(struct irq_data *d) 152 { 153 struct group_irq *group_irq; 154 155 group_irq = NULL; 156 157 + __raw_writel(1 << d->irq, REG_AIC_MECR); 158 159 + switch (d->irq) { 160 case IRQ_GROUP0: 161 group_irq = &group_nirq0; 162 break; ··· 195 } 196 197 static struct irq_chip nuc900_irq_chip = { 198 + .irq_ack = nuc900_irq_ack, 199 + .irq_mask = nuc900_irq_mask, 200 + .irq_unmask = nuc900_irq_unmask, 201 }; 202 203 void __init nuc900_init_irq(void)
+14 -14
arch/arm/plat-mxc/3ds_debugboard.c
··· 60 #define EXPIO_INT_BUTTON_B (MXC_BOARD_IRQ_START + 4) 61 62 static void __iomem *brd_io; 63 - static void expio_ack_irq(u32 irq); 64 65 static struct resource smsc911x_resources[] = { 66 { ··· 92 u32 int_valid; 93 u32 expio_irq; 94 95 - desc->chip->mask(irq); /* irq = gpio irq number */ 96 97 imr_val = __raw_readw(brd_io + INTR_MASK_REG); 98 int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val; ··· 110 d->handle_irq(expio_irq, d); 111 } 112 113 - desc->chip->ack(irq); 114 - desc->chip->unmask(irq); 115 } 116 117 /* 118 * Disable an expio pin's interrupt by setting the bit in the imr. 119 * Irq is an expio virtual irq number 120 */ 121 - static void expio_mask_irq(u32 irq) 122 { 123 u16 reg; 124 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 125 126 reg = __raw_readw(brd_io + INTR_MASK_REG); 127 reg |= (1 << expio); 128 __raw_writew(reg, brd_io + INTR_MASK_REG); 129 } 130 131 - static void expio_ack_irq(u32 irq) 132 { 133 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 134 135 __raw_writew(1 << expio, brd_io + INTR_RESET_REG); 136 __raw_writew(0, brd_io + INTR_RESET_REG); 137 - expio_mask_irq(irq); 138 } 139 140 - static void expio_unmask_irq(u32 irq) 141 { 142 u16 reg; 143 - u32 expio = MXC_IRQ_TO_EXPIO(irq); 144 145 reg = __raw_readw(brd_io + INTR_MASK_REG); 146 reg &= ~(1 << expio); ··· 148 } 149 150 static struct irq_chip expio_irq_chip = { 151 - .ack = expio_ack_irq, 152 - .mask = expio_mask_irq, 153 - .unmask = expio_unmask_irq, 154 }; 155 156 int __init mxc_expio_init(u32 base, u32 p_irq)
··· 60 #define EXPIO_INT_BUTTON_B (MXC_BOARD_IRQ_START + 4) 61 62 static void __iomem *brd_io; 63 64 static struct resource smsc911x_resources[] = { 65 { ··· 93 u32 int_valid; 94 u32 expio_irq; 95 96 + /* irq = gpio irq number */ 97 + desc->irq_data.chip->irq_mask(&desc->irq_data); 98 99 imr_val = __raw_readw(brd_io + INTR_MASK_REG); 100 int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val; ··· 110 d->handle_irq(expio_irq, d); 111 } 112 113 + desc->irq_data.chip->irq_ack(&desc->irq_data); 114 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 115 } 116 117 /* 118 * Disable an expio pin's interrupt by setting the bit in the imr. 119 * Irq is an expio virtual irq number 120 */ 121 + static void expio_mask_irq(struct irq_data *d) 122 { 123 u16 reg; 124 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 125 126 reg = __raw_readw(brd_io + INTR_MASK_REG); 127 reg |= (1 << expio); 128 __raw_writew(reg, brd_io + INTR_MASK_REG); 129 } 130 131 + static void expio_ack_irq(struct irq_data *d) 132 { 133 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 134 135 __raw_writew(1 << expio, brd_io + INTR_RESET_REG); 136 __raw_writew(0, brd_io + INTR_RESET_REG); 137 + expio_mask_irq(d); 138 } 139 140 + static void expio_unmask_irq(struct irq_data *d) 141 { 142 u16 reg; 143 + u32 expio = MXC_IRQ_TO_EXPIO(d->irq); 144 145 reg = __raw_readw(brd_io + INTR_MASK_REG); 146 reg &= ~(1 << expio); ··· 148 } 149 150 static struct irq_chip expio_irq_chip = { 151 + .irq_ack = expio_ack_irq, 152 + .irq_mask = expio_mask_irq, 153 + .irq_unmask = expio_unmask_irq, 154 }; 155 156 int __init mxc_expio_init(u32 base, u32 p_irq)
+7 -7
arch/arm/plat-mxc/avic.c
··· 89 #endif /* CONFIG_FIQ */ 90 91 /* Disable interrupt number "irq" in the AVIC */ 92 - static void mxc_mask_irq(unsigned int irq) 93 { 94 - __raw_writel(irq, avic_base + AVIC_INTDISNUM); 95 } 96 97 /* Enable interrupt number "irq" in the AVIC */ 98 - static void mxc_unmask_irq(unsigned int irq) 99 { 100 - __raw_writel(irq, avic_base + AVIC_INTENNUM); 101 } 102 103 static struct mxc_irq_chip mxc_avic_chip = { 104 .base = { 105 - .ack = mxc_mask_irq, 106 - .mask = mxc_mask_irq, 107 - .unmask = mxc_unmask_irq, 108 }, 109 #ifdef CONFIG_MXC_IRQ_PRIOR 110 .set_priority = avic_irq_set_priority,
··· 89 #endif /* CONFIG_FIQ */ 90 91 /* Disable interrupt number "irq" in the AVIC */ 92 + static void mxc_mask_irq(struct irq_data *d) 93 { 94 + __raw_writel(d->irq, avic_base + AVIC_INTDISNUM); 95 } 96 97 /* Enable interrupt number "irq" in the AVIC */ 98 + static void mxc_unmask_irq(struct irq_data *d) 99 { 100 + __raw_writel(d->irq, avic_base + AVIC_INTENNUM); 101 } 102 103 static struct mxc_irq_chip mxc_avic_chip = { 104 .base = { 105 + .irq_ack = mxc_mask_irq, 106 + .irq_mask = mxc_mask_irq, 107 + .irq_unmask = mxc_unmask_irq, 108 }, 109 #ifdef CONFIG_MXC_IRQ_PRIOR 110 .set_priority = avic_irq_set_priority,
+1 -1
arch/arm/plat-mxc/devices/Kconfig
··· 1 config IMX_HAVE_PLATFORM_FEC 2 bool 3 - default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 4 5 config IMX_HAVE_PLATFORM_FLEXCAN 6 select HAVE_CAN_FLEXCAN if CAN
··· 1 config IMX_HAVE_PLATFORM_FEC 2 bool 3 + default y if ARCH_MX25 || SOC_IMX27 || SOC_IMX35 || SOC_IMX51 || SOC_IMX53 4 5 config IMX_HAVE_PLATFORM_FLEXCAN 6 select HAVE_CAN_FLEXCAN if CAN
+5
arch/arm/plat-mxc/devices/platform-fec.c
··· 36 imx_fec_data_entry_single(MX51); 37 #endif 38 39 struct platform_device *__init imx_add_fec( 40 const struct imx_fec_data *data, 41 const struct fec_platform_data *pdata)
··· 36 imx_fec_data_entry_single(MX51); 37 #endif 38 39 + #ifdef CONFIG_SOC_IMX53 40 + const struct imx_fec_data imx53_fec_data __initconst = 41 + imx_fec_data_entry_single(MX53); 42 + #endif 43 + 44 struct platform_device *__init imx_add_fec( 45 const struct imx_fec_data *data, 46 const struct fec_platform_data *pdata)
+9
arch/arm/plat-mxc/devices/platform-imx-i2c.c
··· 78 }; 79 #endif /* ifdef CONFIG_SOC_IMX51 */ 80 81 struct platform_device *__init imx_add_imx_i2c( 82 const struct imx_imx_i2c_data *data, 83 const struct imxi2c_platform_data *pdata)
··· 78 }; 79 #endif /* ifdef CONFIG_SOC_IMX51 */ 80 81 + #ifdef CONFIG_SOC_IMX53 82 + const struct imx_imx_i2c_data imx53_imx_i2c_data[] __initconst = { 83 + #define imx53_imx_i2c_data_entry(_id, _hwid) \ 84 + imx_imx_i2c_data_entry(MX53, _id, _hwid, SZ_4K) 85 + imx53_imx_i2c_data_entry(0, 1), 86 + imx53_imx_i2c_data_entry(1, 2), 87 + }; 88 + #endif /* ifdef CONFIG_SOC_IMX51 */ 89 + 90 struct platform_device *__init imx_add_imx_i2c( 91 const struct imx_imx_i2c_data *data, 92 const struct imxi2c_platform_data *pdata)
+5
arch/arm/plat-mxc/devices/platform-imx-keypad.c
··· 41 imx_imx_keypad_data_entry_single(MX35, SZ_16); 42 #endif /* ifdef CONFIG_SOC_IMX35 */ 43 44 struct platform_device *__init imx_add_imx_keypad( 45 const struct imx_imx_keypad_data *data, 46 const struct matrix_keymap_data *pdata)
··· 41 imx_imx_keypad_data_entry_single(MX35, SZ_16); 42 #endif /* ifdef CONFIG_SOC_IMX35 */ 43 44 + #ifdef CONFIG_SOC_IMX51 45 + const struct imx_imx_keypad_data imx51_imx_keypad_data __initconst = 46 + imx_imx_keypad_data_entry_single(MX51, SZ_16); 47 + #endif /* ifdef CONFIG_SOC_IMX51 */ 48 + 49 struct platform_device *__init imx_add_imx_keypad( 50 const struct imx_imx_keypad_data *data, 51 const struct matrix_keymap_data *pdata)
+9
arch/arm/plat-mxc/devices/platform-mxc_pwm.c
··· 40 imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); 41 #endif /* ifdef CONFIG_SOC_IMX27 */ 42 43 struct platform_device *__init imx_add_mxc_pwm( 44 const struct imx_mxc_pwm_data *data) 45 {
··· 40 imx_mxc_pwm_data_entry_single(MX27, 0, , SZ_4K); 41 #endif /* ifdef CONFIG_SOC_IMX27 */ 42 43 + #ifdef CONFIG_SOC_IMX51 44 + const struct imx_mxc_pwm_data imx51_mxc_pwm_data[] __initconst = { 45 + #define imx51_mxc_pwm_data_entry(_id, _hwid) \ 46 + imx_mxc_pwm_data_entry(MX51, _id, _hwid, SZ_16K) 47 + imx51_mxc_pwm_data_entry(0, 1), 48 + imx51_mxc_pwm_data_entry(1, 2), 49 + }; 50 + #endif /* ifdef CONFIG_SOC_IMX51 */ 51 + 52 struct platform_device *__init imx_add_mxc_pwm( 53 const struct imx_mxc_pwm_data *data) 54 {
+12
arch/arm/plat-mxc/devices/platform-sdhci-esdhc-imx.c
··· 53 }; 54 #endif /* ifdef CONFIG_SOC_IMX51 */ 55 56 struct platform_device *__init imx_add_sdhci_esdhc_imx( 57 const struct imx_sdhci_esdhc_imx_data *data, 58 const struct esdhc_platform_data *pdata)
··· 53 }; 54 #endif /* ifdef CONFIG_SOC_IMX51 */ 55 56 + #ifdef CONFIG_SOC_IMX53 57 + const struct imx_sdhci_esdhc_imx_data 58 + imx53_sdhci_esdhc_imx_data[] __initconst = { 59 + #define imx53_sdhci_esdhc_imx_data_entry(_id, _hwid) \ 60 + imx_sdhci_esdhc_imx_data_entry(MX53, _id, _hwid) 61 + imx53_sdhci_esdhc_imx_data_entry(0, 1), 62 + imx53_sdhci_esdhc_imx_data_entry(1, 2), 63 + imx53_sdhci_esdhc_imx_data_entry(2, 3), 64 + imx53_sdhci_esdhc_imx_data_entry(3, 4), 65 + }; 66 + #endif /* ifdef CONFIG_SOC_IMX53 */ 67 + 68 struct platform_device *__init imx_add_sdhci_esdhc_imx( 69 const struct imx_sdhci_esdhc_imx_data *data, 70 const struct esdhc_platform_data *pdata)
+12
arch/arm/plat-mxc/devices/platform-spi_imx.c
··· 81 }; 82 #endif /* ifdef CONFIG_SOC_IMX51 */ 83 84 struct platform_device *__init imx_add_spi_imx( 85 const struct imx_spi_imx_data *data, 86 const struct spi_imx_master *pdata)
··· 81 }; 82 #endif /* ifdef CONFIG_SOC_IMX51 */ 83 84 + #ifdef CONFIG_SOC_IMX53 85 + const struct imx_spi_imx_data imx53_cspi_data __initconst = 86 + imx_spi_imx_data_entry_single(MX53, CSPI, "imx53-cspi", 0, , SZ_4K); 87 + 88 + const struct imx_spi_imx_data imx53_ecspi_data[] __initconst = { 89 + #define imx53_ecspi_data_entry(_id, _hwid) \ 90 + imx_spi_imx_data_entry(MX53, ECSPI, "imx53-ecspi", _id, _hwid, SZ_4K) 91 + imx53_ecspi_data_entry(0, 1), 92 + imx53_ecspi_data_entry(1, 2), 93 + }; 94 + #endif /* ifdef CONFIG_SOC_IMX53 */ 95 + 96 struct platform_device *__init imx_add_spi_imx( 97 const struct imx_spi_imx_data *data, 98 const struct spi_imx_master *pdata)
+15 -15
arch/arm/plat-mxc/gpio.c
··· 63 __raw_writel(l, port->base + GPIO_IMR); 64 } 65 66 - static void gpio_ack_irq(u32 irq) 67 { 68 - u32 gpio = irq_to_gpio(irq); 69 _clear_gpio_irqstatus(&mxc_gpio_ports[gpio / 32], gpio & 0x1f); 70 } 71 72 - static void gpio_mask_irq(u32 irq) 73 { 74 - u32 gpio = irq_to_gpio(irq); 75 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 0); 76 } 77 78 - static void gpio_unmask_irq(u32 irq) 79 { 80 - u32 gpio = irq_to_gpio(irq); 81 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1); 82 } 83 84 static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset); 85 86 - static int gpio_set_irq_type(u32 irq, u32 type) 87 { 88 - u32 gpio = irq_to_gpio(irq); 89 struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; 90 u32 bit, val; 91 int edge; ··· 211 * @param enable enable as wake-up if equal to non-zero 212 * @return This function returns 0 on success. 213 */ 214 - static int gpio_set_wake_irq(u32 irq, u32 enable) 215 { 216 - u32 gpio = irq_to_gpio(irq); 217 u32 gpio_idx = gpio & 0x1F; 218 struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; 219 ··· 233 } 234 235 static struct irq_chip gpio_irq_chip = { 236 - .ack = gpio_ack_irq, 237 - .mask = gpio_mask_irq, 238 - .unmask = gpio_unmask_irq, 239 - .set_type = gpio_set_irq_type, 240 - .set_wake = gpio_set_wake_irq, 241 }; 242 243 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
··· 63 __raw_writel(l, port->base + GPIO_IMR); 64 } 65 66 + static void gpio_ack_irq(struct irq_data *d) 67 { 68 + u32 gpio = irq_to_gpio(d->irq); 69 _clear_gpio_irqstatus(&mxc_gpio_ports[gpio / 32], gpio & 0x1f); 70 } 71 72 + static void gpio_mask_irq(struct irq_data *d) 73 { 74 + u32 gpio = irq_to_gpio(d->irq); 75 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 0); 76 } 77 78 + static void gpio_unmask_irq(struct irq_data *d) 79 { 80 + u32 gpio = irq_to_gpio(d->irq); 81 _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1); 82 } 83 84 static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset); 85 86 + static int gpio_set_irq_type(struct irq_data *d, u32 type) 87 { 88 + u32 gpio = irq_to_gpio(d->irq); 89 struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; 90 u32 bit, val; 91 int edge; ··· 211 * @param enable enable as wake-up if equal to non-zero 212 * @return This function returns 0 on success. 213 */ 214 + static int gpio_set_wake_irq(struct irq_data *d, u32 enable) 215 { 216 + u32 gpio = irq_to_gpio(d->irq); 217 u32 gpio_idx = gpio & 0x1F; 218 struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; 219 ··· 233 } 234 235 static struct irq_chip gpio_irq_chip = { 236 + .irq_ack = gpio_ack_irq, 237 + .irq_mask = gpio_mask_irq, 238 + .irq_unmask = gpio_unmask_irq, 239 + .irq_set_type = gpio_set_irq_type, 240 + .irq_set_wake = gpio_set_wake_irq, 241 }; 242 243 static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
+3 -1
arch/arm/plat-mxc/include/mach/iomux-mx53.h
··· 34 IOMUX_CONFIG_ALT6, 35 IOMUX_CONFIG_ALT7, 36 IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */ 37 - IOMUX_CONFIG_SION = 0x1 << 4, /* LOOPBACK:MUX SION bit */ 38 } iomux_pin_cfg_t; 39 40 /* These 2 defines are for pins that may not have a mux register, but could ··· 134 #define MX53_PAD_EIM_D16__GPIO_3_16 IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 135 #define MX53_PAD_EIM_D17__GPIO_3_17 IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 136 #define MX53_PAD_EIM_D18__GPIO_3_18 IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 137 #define MX53_PAD_EIM_D19__GPIO_3_19 IOMUX_PAD(0x46C, 0x124,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 138 #define MX53_PAD_EIM_D20__GPIO_3_20 IOMUX_PAD(0x470, 0x128,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 139 #define MX53_PAD_EIM_D21__GPIO_3_21 IOMUX_PAD(0x474, 0x12C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL)
··· 34 IOMUX_CONFIG_ALT6, 35 IOMUX_CONFIG_ALT7, 36 IOMUX_CONFIG_GPIO, /* added to help user use GPIO mode */ 37 } iomux_pin_cfg_t; 38 39 /* These 2 defines are for pins that may not have a mux register, but could ··· 135 #define MX53_PAD_EIM_D16__GPIO_3_16 IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 136 #define MX53_PAD_EIM_D17__GPIO_3_17 IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 137 #define MX53_PAD_EIM_D18__GPIO_3_18 IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 138 + #define MX53_PAD_EIM_D16__CSPI1_SCLK IOMUX_PAD(0x460, 0x118,IOMUX_CONFIG_ALT4, 0x79c, 3, NO_PAD_CTRL) 139 + #define MX53_PAD_EIM_D17__CSPI1_MISO IOMUX_PAD(0x464, 0x11C,IOMUX_CONFIG_ALT4, 0x7a0, 3, NO_PAD_CTRL) 140 + #define MX53_PAD_EIM_D18__CSPI1_MOSI IOMUX_PAD(0x468, 0x120,IOMUX_CONFIG_ALT4, 0x7a4, 3, NO_PAD_CTRL) 141 #define MX53_PAD_EIM_D19__GPIO_3_19 IOMUX_PAD(0x46C, 0x124,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 142 #define MX53_PAD_EIM_D20__GPIO_3_20 IOMUX_PAD(0x470, 0x128,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL) 143 #define MX53_PAD_EIM_D21__GPIO_3_21 IOMUX_PAD(0x474, 0x12C,IOMUX_CONFIG_ALT1, 0x0, 0, NO_PAD_CTRL)
+1
arch/arm/plat-mxc/include/mach/iomux-v3.h
··· 105 #define PAD_CTL_SRE_FAST (1 << 0) 106 #define PAD_CTL_SRE_SLOW (0 << 0) 107 108 109 #define MX51_NUM_GPIO_PORT 4 110
··· 105 #define PAD_CTL_SRE_FAST (1 << 0) 106 #define PAD_CTL_SRE_SLOW (0 << 0) 107 108 + #define IOMUX_CONFIG_SION (0x1 << 4) 109 110 #define MX51_NUM_GPIO_PORT 4 111
+3 -3
arch/arm/plat-mxc/include/mach/mx51.h
··· 301 #define MX51_MXC_INT_GPIO4_HIGH 57 302 #define MX51_MXC_INT_WDOG1 58 303 #define MX51_MXC_INT_WDOG2 59 304 - #define MX51_MXC_INT_KPP 60 305 - #define MX51_MXC_INT_PWM1 61 306 #define MX51_INT_I2C1 62 307 #define MX51_INT_I2C2 63 308 #define MX51_MXC_INT_HS_I2C 64 ··· 335 #define MX51_MXC_INT_SPDIF 91 336 #define MX51_MXC_INT_TVE 92 337 #define MX51_MXC_INT_FIRI 93 338 - #define MX51_MXC_INT_PWM2 94 339 #define MX51_MXC_INT_SLIM_EXP 95 340 #define MX51_INT_SSI3 96 341 #define MX51_MXC_INT_EMI_BOOT 97
··· 301 #define MX51_MXC_INT_GPIO4_HIGH 57 302 #define MX51_MXC_INT_WDOG1 58 303 #define MX51_MXC_INT_WDOG2 59 304 + #define MX51_INT_KPP 60 305 + #define MX51_INT_PWM1 61 306 #define MX51_INT_I2C1 62 307 #define MX51_INT_I2C2 63 308 #define MX51_MXC_INT_HS_I2C 64 ··· 335 #define MX51_MXC_INT_SPDIF 91 336 #define MX51_MXC_INT_TVE 92 337 #define MX51_MXC_INT_FIRI 93 338 + #define MX51_INT_PWM2 94 339 #define MX51_MXC_INT_SLIM_EXP 95 340 #define MX51_INT_SSI3 96 341 #define MX51_MXC_INT_EMI_BOOT 97
+14 -14
arch/arm/plat-mxc/include/mach/mx53.h
··· 53 #define MX53_SPBA0_BASE_ADDR 0x50000000 54 #define MX53_SPBA0_SIZE SZ_1M 55 56 - #define MX53_MMC_SDHC1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00004000) 57 - #define MX53_MMC_SDHC2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00008000) 58 #define MX53_UART3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0000C000) 59 - #define MX53_CSPI1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00010000) 60 #define MX53_SSI2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00014000) 61 - #define MX53_MMC_SDHC3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00020000) 62 - #define MX53_MMC_SDHC4_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00024000) 63 #define MX53_SPDIF_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00028000) 64 #define MX53_ASRC_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0002C000) 65 #define MX53_ATA_DMA_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00030000) ··· 117 #define MX53_ARM_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A0000) 118 #define MX53_OWIRE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A4000) 119 #define MX53_FIRI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A8000) 120 - #define MX53_CSPI2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000AC000) 121 #define MX53_SDMA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B0000) 122 #define MX53_SCC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B4000) 123 #define MX53_ROMCP_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B8000) 124 #define MX53_RTIC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000BC000) 125 - #define MX53_CSPI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C0000) 126 #define MX53_I2C2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C4000) 127 #define MX53_I2C1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C8000) 128 #define MX53_SSI1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000CC000) ··· 136 #define MX53_MIPI_HSC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DC000) 137 #define MX53_MLB_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E4000) 138 #define MX53_SSI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E8000) 139 - #define MX53_MXC_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000) 140 #define MX53_TVE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F0000) 141 #define MX53_VPU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F4000) 142 #define MX53_SAHARA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F8000) ··· 229 * Interrupt numbers 230 */ 231 #define MX53_INT_RESV0 0 232 - #define MX53_INT_MMC_SDHC1 1 233 - #define MX53_INT_MMC_SDHC2 2 234 - #define MX53_INT_MMC_SDHC3 3 235 - #define MX53_INT_MMC_SDHC4 4 236 #define MX53_INT_RESV5 5 237 #define MX53_INT_SDMA 6 238 #define MX53_INT_IOMUX 7 ··· 264 #define MX53_INT_UART3 33 265 #define MX53_INT_RESV34 34 266 #define MX53_INT_RESV35 35 267 - #define MX53_INT_CSPI1 36 268 - #define MX53_INT_CSPI2 37 269 #define MX53_INT_CSPI 38 270 #define MX53_INT_GPT 39 271 #define MX53_INT_EPIT1 40
··· 53 #define MX53_SPBA0_BASE_ADDR 0x50000000 54 #define MX53_SPBA0_SIZE SZ_1M 55 56 + #define MX53_ESDHC1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00004000) 57 + #define MX53_ESDHC2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00008000) 58 #define MX53_UART3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0000C000) 59 + #define MX53_ECSPI1_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00010000) 60 #define MX53_SSI2_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00014000) 61 + #define MX53_ESDHC3_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00020000) 62 + #define MX53_ESDHC4_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00024000) 63 #define MX53_SPDIF_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00028000) 64 #define MX53_ASRC_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x0002C000) 65 #define MX53_ATA_DMA_BASE_ADDR (MX53_SPBA0_BASE_ADDR + 0x00030000) ··· 117 #define MX53_ARM_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A0000) 118 #define MX53_OWIRE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A4000) 119 #define MX53_FIRI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000A8000) 120 + #define MX53_ECSPI2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000AC000) 121 #define MX53_SDMA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B0000) 122 #define MX53_SCC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B4000) 123 #define MX53_ROMCP_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000B8000) 124 #define MX53_RTIC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000BC000) 125 + #define MX53_CSPI_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C0000) 126 #define MX53_I2C2_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C4000) 127 #define MX53_I2C1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000C8000) 128 #define MX53_SSI1_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000CC000) ··· 136 #define MX53_MIPI_HSC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000DC000) 137 #define MX53_MLB_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E4000) 138 #define MX53_SSI3_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000E8000) 139 + #define MX53_FEC_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000EC000) 140 #define MX53_TVE_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F0000) 141 #define MX53_VPU_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F4000) 142 #define MX53_SAHARA_BASE_ADDR (MX53_AIPS2_BASE_ADDR + 0x000F8000) ··· 229 * Interrupt numbers 230 */ 231 #define MX53_INT_RESV0 0 232 + #define MX53_INT_ESDHC1 1 233 + #define MX53_INT_ESDHC2 2 234 + #define MX53_INT_ESDHC3 3 235 + #define MX53_INT_ESDHC4 4 236 #define MX53_INT_RESV5 5 237 #define MX53_INT_SDMA 6 238 #define MX53_INT_IOMUX 7 ··· 264 #define MX53_INT_UART3 33 265 #define MX53_INT_RESV34 34 266 #define MX53_INT_RESV35 35 267 + #define MX53_INT_ECSPI1 36 268 + #define MX53_INT_ECSPI2 37 269 #define MX53_INT_CSPI 38 270 #define MX53_INT_GPT 39 271 #define MX53_INT_EPIT1 40
+1 -1
arch/arm/plat-mxc/pwm.c
··· 57 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) 58 return -EINVAL; 59 60 - if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { 61 unsigned long long c; 62 unsigned long period_cycles, duty_cycles, prescale; 63 u32 cr;
··· 57 if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) 58 return -EINVAL; 59 60 + if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25() || cpu_is_mx51()) { 61 unsigned long long c; 62 unsigned long period_cycles, duty_cycles, prescale; 63 u32 cr;
+19 -19
arch/arm/plat-mxc/tzic.c
··· 69 #endif 70 71 /** 72 - * tzic_mask_irq() - Disable interrupt number "irq" in the TZIC 73 * 74 - * @param irq interrupt source number 75 */ 76 - static void tzic_mask_irq(unsigned int irq) 77 { 78 int index, off; 79 80 - index = irq >> 5; 81 - off = irq & 0x1F; 82 __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index)); 83 } 84 85 /** 86 - * tzic_unmask_irq() - Enable interrupt number "irq" in the TZIC 87 * 88 - * @param irq interrupt source number 89 */ 90 - static void tzic_unmask_irq(unsigned int irq) 91 { 92 int index, off; 93 94 - index = irq >> 5; 95 - off = irq & 0x1F; 96 __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index)); 97 } 98 99 static unsigned int wakeup_intr[4]; 100 101 /** 102 - * tzic_set_wake_irq() - Set interrupt number "irq" in the TZIC as a wake-up source. 103 * 104 - * @param irq interrupt source number 105 * @param enable enable as wake-up if equal to non-zero 106 * disble as wake-up if equal to zero 107 * 108 * @return This function returns 0 on success. 109 */ 110 - static int tzic_set_wake_irq(unsigned int irq, unsigned int enable) 111 { 112 unsigned int index, off; 113 114 - index = irq >> 5; 115 - off = irq & 0x1F; 116 117 if (index > 3) 118 return -EINVAL; ··· 128 static struct mxc_irq_chip mxc_tzic_chip = { 129 .base = { 130 .name = "MXC_TZIC", 131 - .ack = tzic_mask_irq, 132 - .mask = tzic_mask_irq, 133 - .unmask = tzic_unmask_irq, 134 - .set_wake = tzic_set_wake_irq, 135 }, 136 #ifdef CONFIG_FIQ 137 .set_irq_fiq = tzic_set_irq_fiq,
··· 69 #endif 70 71 /** 72 + * tzic_mask_irq() - Disable interrupt source "d" in the TZIC 73 * 74 + * @param d interrupt source 75 */ 76 + static void tzic_mask_irq(struct irq_data *d) 77 { 78 int index, off; 79 80 + index = d->irq >> 5; 81 + off = d->irq & 0x1F; 82 __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index)); 83 } 84 85 /** 86 + * tzic_unmask_irq() - Enable interrupt source "d" in the TZIC 87 * 88 + * @param d interrupt source 89 */ 90 + static void tzic_unmask_irq(struct irq_data *d) 91 { 92 int index, off; 93 94 + index = d->irq >> 5; 95 + off = d->irq & 0x1F; 96 __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index)); 97 } 98 99 static unsigned int wakeup_intr[4]; 100 101 /** 102 + * tzic_set_wake_irq() - Set interrupt source "d" in the TZIC as a wake-up source. 103 * 104 + * @param d interrupt source 105 * @param enable enable as wake-up if equal to non-zero 106 * disble as wake-up if equal to zero 107 * 108 * @return This function returns 0 on success. 109 */ 110 + static int tzic_set_wake_irq(struct irq_data *d, unsigned int enable) 111 { 112 unsigned int index, off; 113 114 + index = d->irq >> 5; 115 + off = d->irq & 0x1F; 116 117 if (index > 3) 118 return -EINVAL; ··· 128 static struct mxc_irq_chip mxc_tzic_chip = { 129 .base = { 130 .name = "MXC_TZIC", 131 + .irq_ack = tzic_mask_irq, 132 + .irq_mask = tzic_mask_irq, 133 + .irq_unmask = tzic_unmask_irq, 134 + .irq_set_wake = tzic_set_wake_irq, 135 }, 136 #ifdef CONFIG_FIQ 137 .set_irq_fiq = tzic_set_irq_fiq,
+28 -28
arch/arm/plat-nomadik/gpio.c
··· 356 return 1 << (gpio % 32); 357 } 358 359 - static void nmk_gpio_irq_ack(unsigned int irq) 360 { 361 int gpio; 362 struct nmk_gpio_chip *nmk_chip; 363 364 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 365 - nmk_chip = get_irq_chip_data(irq); 366 if (!nmk_chip) 367 return; 368 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); ··· 401 } 402 } 403 404 - static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which, 405 bool enable) 406 { 407 int gpio; ··· 409 unsigned long flags; 410 u32 bitmask; 411 412 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 413 - nmk_chip = get_irq_chip_data(irq); 414 bitmask = nmk_gpio_get_bitmask(gpio); 415 if (!nmk_chip) 416 return -EINVAL; ··· 422 return 0; 423 } 424 425 - static void nmk_gpio_irq_mask(unsigned int irq) 426 { 427 - nmk_gpio_irq_modify(irq, NORMAL, false); 428 } 429 430 - static void nmk_gpio_irq_unmask(unsigned int irq) 431 { 432 - nmk_gpio_irq_modify(irq, NORMAL, true); 433 } 434 435 - static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on) 436 { 437 struct nmk_gpio_chip *nmk_chip; 438 unsigned long flags; 439 int gpio; 440 441 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 442 - nmk_chip = get_irq_chip_data(irq); 443 if (!nmk_chip) 444 return -EINVAL; 445 ··· 457 return 0; 458 } 459 460 - static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type) 461 { 462 - struct irq_desc *desc = irq_to_desc(irq); 463 bool enabled = !(desc->status & IRQ_DISABLED); 464 bool wake = desc->wake_depth; 465 int gpio; ··· 467 unsigned long flags; 468 u32 bitmask; 469 470 - gpio = NOMADIK_IRQ_TO_GPIO(irq); 471 - nmk_chip = get_irq_chip_data(irq); 472 bitmask = nmk_gpio_get_bitmask(gpio); 473 if (!nmk_chip) 474 return -EINVAL; ··· 507 508 static struct irq_chip nmk_gpio_irq_chip = { 509 .name = "Nomadik-GPIO", 510 - .ack = nmk_gpio_irq_ack, 511 - .mask = nmk_gpio_irq_mask, 512 - .unmask = nmk_gpio_irq_unmask, 513 - .set_type = nmk_gpio_irq_set_type, 514 - .set_wake = nmk_gpio_irq_set_wake, 515 }; 516 517 static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 522 u32 pending; 523 unsigned int first_irq; 524 525 - if (host_chip->mask_ack) 526 - host_chip->mask_ack(irq); 527 else { 528 - host_chip->mask(irq); 529 - if (host_chip->ack) 530 - host_chip->ack(irq); 531 } 532 533 nmk_chip = get_irq_data(irq); ··· 537 generic_handle_irq(gpio_irq); 538 } 539 540 - host_chip->unmask(irq); 541 } 542 543 static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
··· 356 return 1 << (gpio % 32); 357 } 358 359 + static void nmk_gpio_irq_ack(struct irq_data *d) 360 { 361 int gpio; 362 struct nmk_gpio_chip *nmk_chip; 363 364 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 365 + nmk_chip = irq_data_get_irq_chip_data(d); 366 if (!nmk_chip) 367 return; 368 writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC); ··· 401 } 402 } 403 404 + static int nmk_gpio_irq_modify(struct irq_data *d, enum nmk_gpio_irq_type which, 405 bool enable) 406 { 407 int gpio; ··· 409 unsigned long flags; 410 u32 bitmask; 411 412 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 413 + nmk_chip = irq_data_get_irq_chip_data(d); 414 bitmask = nmk_gpio_get_bitmask(gpio); 415 if (!nmk_chip) 416 return -EINVAL; ··· 422 return 0; 423 } 424 425 + static void nmk_gpio_irq_mask(struct irq_data *d) 426 { 427 + nmk_gpio_irq_modify(d, NORMAL, false); 428 } 429 430 + static void nmk_gpio_irq_unmask(struct irq_data *d) 431 { 432 + nmk_gpio_irq_modify(d, NORMAL, true); 433 } 434 435 + static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) 436 { 437 struct nmk_gpio_chip *nmk_chip; 438 unsigned long flags; 439 int gpio; 440 441 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 442 + nmk_chip = irq_data_get_irq_chip_data(d); 443 if (!nmk_chip) 444 return -EINVAL; 445 ··· 457 return 0; 458 } 459 460 + static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) 461 { 462 + struct irq_desc *desc = irq_to_desc(d->irq); 463 bool enabled = !(desc->status & IRQ_DISABLED); 464 bool wake = desc->wake_depth; 465 int gpio; ··· 467 unsigned long flags; 468 u32 bitmask; 469 470 + gpio = NOMADIK_IRQ_TO_GPIO(d->irq); 471 + nmk_chip = irq_data_get_irq_chip_data(d); 472 bitmask = nmk_gpio_get_bitmask(gpio); 473 if (!nmk_chip) 474 return -EINVAL; ··· 507 508 static struct irq_chip nmk_gpio_irq_chip = { 509 .name = "Nomadik-GPIO", 510 + .irq_ack = nmk_gpio_irq_ack, 511 + .irq_mask = nmk_gpio_irq_mask, 512 + .irq_unmask = nmk_gpio_irq_unmask, 513 + .irq_set_type = nmk_gpio_irq_set_type, 514 + .irq_set_wake = nmk_gpio_irq_set_wake, 515 }; 516 517 static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) ··· 522 u32 pending; 523 unsigned int first_irq; 524 525 + if (host_chip->irq_mask_ack) 526 + host_chip->irq_mask_ack(&desc->irq_data); 527 else { 528 + host_chip->irq_mask(&desc->irq_data); 529 + if (host_chip->irq_ack) 530 + host_chip->irq_ack(&desc->irq_data); 531 } 532 533 nmk_chip = get_irq_data(irq); ··· 537 generic_handle_irq(gpio_irq); 538 } 539 540 + host_chip->irq_unmask(&desc->irq_data); 541 } 542 543 static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
+47 -48
arch/arm/plat-omap/gpio.c
··· 729 return -EINVAL; 730 } 731 732 - static int gpio_irq_type(unsigned irq, unsigned type) 733 { 734 struct gpio_bank *bank; 735 unsigned gpio; 736 int retval; 737 unsigned long flags; 738 739 - if (!cpu_class_is_omap2() && irq > IH_MPUIO_BASE) 740 - gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); 741 else 742 - gpio = irq - IH_GPIO_BASE; 743 744 if (check_gpio(gpio) < 0) 745 return -EINVAL; ··· 752 && (type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH))) 753 return -EINVAL; 754 755 - bank = get_irq_chip_data(irq); 756 spin_lock_irqsave(&bank->lock, flags); 757 retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); 758 if (retval == 0) { 759 - struct irq_desc *d = irq_to_desc(irq); 760 761 - d->status &= ~IRQ_TYPE_SENSE_MASK; 762 - d->status |= type; 763 } 764 spin_unlock_irqrestore(&bank->lock, flags); 765 766 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 767 - __set_irq_handler_unlocked(irq, handle_level_irq); 768 else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 769 - __set_irq_handler_unlocked(irq, handle_edge_irq); 770 771 return retval; 772 } ··· 1023 } 1024 1025 /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */ 1026 - static int gpio_wake_enable(unsigned int irq, unsigned int enable) 1027 { 1028 - unsigned int gpio = irq - IH_GPIO_BASE; 1029 struct gpio_bank *bank; 1030 int retval; 1031 1032 if (check_gpio(gpio) < 0) 1033 return -ENODEV; 1034 - bank = get_irq_chip_data(irq); 1035 retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable); 1036 1037 return retval; ··· 1144 u32 retrigger = 0; 1145 int unmasked = 0; 1146 1147 - desc->chip->ack(irq); 1148 1149 bank = get_irq_data(irq); 1150 #ifdef CONFIG_ARCH_OMAP1 ··· 1201 configured, we could unmask GPIO bank interrupt immediately */ 1202 if (!level_mask && !unmasked) { 1203 unmasked = 1; 1204 - desc->chip->unmask(irq); 1205 } 1206 1207 isr |= retrigger; ··· 1237 interrupt */ 1238 exit: 1239 if (!unmasked) 1240 - desc->chip->unmask(irq); 1241 - 1242 } 1243 1244 - static void gpio_irq_shutdown(unsigned int irq) 1245 { 1246 - unsigned int gpio = irq - IH_GPIO_BASE; 1247 - struct gpio_bank *bank = get_irq_chip_data(irq); 1248 1249 _reset_gpio(bank, gpio); 1250 } 1251 1252 - static void gpio_ack_irq(unsigned int irq) 1253 { 1254 - unsigned int gpio = irq - IH_GPIO_BASE; 1255 - struct gpio_bank *bank = get_irq_chip_data(irq); 1256 1257 _clear_gpio_irqstatus(bank, gpio); 1258 } 1259 1260 - static void gpio_mask_irq(unsigned int irq) 1261 { 1262 - unsigned int gpio = irq - IH_GPIO_BASE; 1263 - struct gpio_bank *bank = get_irq_chip_data(irq); 1264 1265 _set_gpio_irqenable(bank, gpio, 0); 1266 _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE); 1267 } 1268 1269 - static void gpio_unmask_irq(unsigned int irq) 1270 { 1271 - unsigned int gpio = irq - IH_GPIO_BASE; 1272 - struct gpio_bank *bank = get_irq_chip_data(irq); 1273 unsigned int irq_mask = 1 << get_gpio_index(gpio); 1274 - struct irq_desc *desc = irq_to_desc(irq); 1275 u32 trigger = desc->status & IRQ_TYPE_SENSE_MASK; 1276 1277 if (trigger) ··· 1288 1289 static struct irq_chip gpio_irq_chip = { 1290 .name = "GPIO", 1291 - .shutdown = gpio_irq_shutdown, 1292 - .ack = gpio_ack_irq, 1293 - .mask = gpio_mask_irq, 1294 - .unmask = gpio_unmask_irq, 1295 - .set_type = gpio_irq_type, 1296 - .set_wake = gpio_wake_enable, 1297 }; 1298 1299 /*---------------------------------------------------------------------*/ ··· 1302 1303 /* MPUIO uses the always-on 32k clock */ 1304 1305 - static void mpuio_ack_irq(unsigned int irq) 1306 { 1307 /* The ISR is reset automatically, so do nothing here. */ 1308 } 1309 1310 - static void mpuio_mask_irq(unsigned int irq) 1311 { 1312 - unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); 1313 - struct gpio_bank *bank = get_irq_chip_data(irq); 1314 1315 _set_gpio_irqenable(bank, gpio, 0); 1316 } 1317 1318 - static void mpuio_unmask_irq(unsigned int irq) 1319 { 1320 - unsigned int gpio = OMAP_MPUIO(irq - IH_MPUIO_BASE); 1321 - struct gpio_bank *bank = get_irq_chip_data(irq); 1322 1323 _set_gpio_irqenable(bank, gpio, 1); 1324 } 1325 1326 static struct irq_chip mpuio_irq_chip = { 1327 .name = "MPUIO", 1328 - .ack = mpuio_ack_irq, 1329 - .mask = mpuio_mask_irq, 1330 - .unmask = mpuio_unmask_irq, 1331 - .set_type = gpio_irq_type, 1332 #ifdef CONFIG_ARCH_OMAP16XX 1333 /* REVISIT: assuming only 16xx supports MPUIO wake events */ 1334 - .set_wake = gpio_wake_enable, 1335 #endif 1336 }; 1337
··· 729 return -EINVAL; 730 } 731 732 + static int gpio_irq_type(struct irq_data *d, unsigned type) 733 { 734 struct gpio_bank *bank; 735 unsigned gpio; 736 int retval; 737 unsigned long flags; 738 739 + if (!cpu_class_is_omap2() && d->irq > IH_MPUIO_BASE) 740 + gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 741 else 742 + gpio = d->irq - IH_GPIO_BASE; 743 744 if (check_gpio(gpio) < 0) 745 return -EINVAL; ··· 752 && (type & (IRQ_TYPE_LEVEL_LOW|IRQ_TYPE_LEVEL_HIGH))) 753 return -EINVAL; 754 755 + bank = irq_data_get_irq_chip_data(d); 756 spin_lock_irqsave(&bank->lock, flags); 757 retval = _set_gpio_triggering(bank, get_gpio_index(gpio), type); 758 if (retval == 0) { 759 + struct irq_desc *desc = irq_to_desc(d->irq); 760 761 + desc->status &= ~IRQ_TYPE_SENSE_MASK; 762 + desc->status |= type; 763 } 764 spin_unlock_irqrestore(&bank->lock, flags); 765 766 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) 767 + __set_irq_handler_unlocked(d->irq, handle_level_irq); 768 else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) 769 + __set_irq_handler_unlocked(d->irq, handle_edge_irq); 770 771 return retval; 772 } ··· 1023 } 1024 1025 /* Use disable_irq_wake() and enable_irq_wake() functions from drivers */ 1026 + static int gpio_wake_enable(struct irq_data *d, unsigned int enable) 1027 { 1028 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1029 struct gpio_bank *bank; 1030 int retval; 1031 1032 if (check_gpio(gpio) < 0) 1033 return -ENODEV; 1034 + bank = irq_data_get_irq_chip_data(d); 1035 retval = _set_gpio_wakeup(bank, get_gpio_index(gpio), enable); 1036 1037 return retval; ··· 1144 u32 retrigger = 0; 1145 int unmasked = 0; 1146 1147 + desc->irq_data.chip->irq_ack(&desc->irq_data); 1148 1149 bank = get_irq_data(irq); 1150 #ifdef CONFIG_ARCH_OMAP1 ··· 1201 configured, we could unmask GPIO bank interrupt immediately */ 1202 if (!level_mask && !unmasked) { 1203 unmasked = 1; 1204 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 1205 } 1206 1207 isr |= retrigger; ··· 1237 interrupt */ 1238 exit: 1239 if (!unmasked) 1240 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 1241 } 1242 1243 + static void gpio_irq_shutdown(struct irq_data *d) 1244 { 1245 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1246 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1247 1248 _reset_gpio(bank, gpio); 1249 } 1250 1251 + static void gpio_ack_irq(struct irq_data *d) 1252 { 1253 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1254 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1255 1256 _clear_gpio_irqstatus(bank, gpio); 1257 } 1258 1259 + static void gpio_mask_irq(struct irq_data *d) 1260 { 1261 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1262 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1263 1264 _set_gpio_irqenable(bank, gpio, 0); 1265 _set_gpio_triggering(bank, get_gpio_index(gpio), IRQ_TYPE_NONE); 1266 } 1267 1268 + static void gpio_unmask_irq(struct irq_data *d) 1269 { 1270 + unsigned int gpio = d->irq - IH_GPIO_BASE; 1271 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1272 unsigned int irq_mask = 1 << get_gpio_index(gpio); 1273 + struct irq_desc *desc = irq_to_desc(d->irq); 1274 u32 trigger = desc->status & IRQ_TYPE_SENSE_MASK; 1275 1276 if (trigger) ··· 1289 1290 static struct irq_chip gpio_irq_chip = { 1291 .name = "GPIO", 1292 + .irq_shutdown = gpio_irq_shutdown, 1293 + .irq_ack = gpio_ack_irq, 1294 + .irq_mask = gpio_mask_irq, 1295 + .irq_unmask = gpio_unmask_irq, 1296 + .irq_set_type = gpio_irq_type, 1297 + .irq_set_wake = gpio_wake_enable, 1298 }; 1299 1300 /*---------------------------------------------------------------------*/ ··· 1303 1304 /* MPUIO uses the always-on 32k clock */ 1305 1306 + static void mpuio_ack_irq(struct irq_data *d) 1307 { 1308 /* The ISR is reset automatically, so do nothing here. */ 1309 } 1310 1311 + static void mpuio_mask_irq(struct irq_data *d) 1312 { 1313 + unsigned int gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 1314 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1315 1316 _set_gpio_irqenable(bank, gpio, 0); 1317 } 1318 1319 + static void mpuio_unmask_irq(struct irq_data *d) 1320 { 1321 + unsigned int gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 1322 + struct gpio_bank *bank = irq_data_get_irq_chip_data(d); 1323 1324 _set_gpio_irqenable(bank, gpio, 1); 1325 } 1326 1327 static struct irq_chip mpuio_irq_chip = { 1328 .name = "MPUIO", 1329 + .irq_ack = mpuio_ack_irq, 1330 + .irq_mask = mpuio_mask_irq, 1331 + .irq_unmask = mpuio_unmask_irq, 1332 + .irq_set_type = gpio_irq_type, 1333 #ifdef CONFIG_ARCH_OMAP16XX 1334 /* REVISIT: assuming only 16xx supports MPUIO wake events */ 1335 + .irq_set_wake = gpio_wake_enable, 1336 #endif 1337 }; 1338
+18 -19
arch/arm/plat-orion/gpio.c
··· 232 * polarity LEVEL mask 233 * 234 ****************************************************************************/ 235 - 236 - static void gpio_irq_ack(u32 irq) 237 { 238 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; 239 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 240 - int pin = irq_to_gpio(irq); 241 writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); 242 } 243 } 244 245 - static void gpio_irq_mask(u32 irq) 246 { 247 - int pin = irq_to_gpio(irq); 248 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; 249 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 250 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 251 u32 u = readl(reg); ··· 252 writel(u, reg); 253 } 254 255 - static void gpio_irq_unmask(u32 irq) 256 { 257 - int pin = irq_to_gpio(irq); 258 - int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK; 259 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 260 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 261 u32 u = readl(reg); ··· 263 writel(u, reg); 264 } 265 266 - static int gpio_irq_set_type(u32 irq, u32 type) 267 { 268 - int pin = irq_to_gpio(irq); 269 struct irq_desc *desc; 270 u32 u; 271 272 u = readl(GPIO_IO_CONF(pin)) & (1 << (pin & 31)); 273 if (!u) { 274 printk(KERN_ERR "orion gpio_irq_set_type failed " 275 - "(irq %d, pin %d).\n", irq, pin); 276 return -EINVAL; 277 } 278 279 - desc = irq_desc + irq; 280 281 /* 282 * Set edge/level type. ··· 286 } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 287 desc->handle_irq = handle_level_irq; 288 } else { 289 - printk(KERN_ERR "failed to set irq=%d (type=%d)\n", irq, type); 290 return -EINVAL; 291 } 292 ··· 324 325 struct irq_chip orion_gpio_irq_chip = { 326 .name = "orion_gpio_irq", 327 - .ack = gpio_irq_ack, 328 - .mask = gpio_irq_mask, 329 - .unmask = gpio_irq_unmask, 330 - .set_type = gpio_irq_set_type, 331 }; 332 333 void orion_gpio_irq_handler(int pinoff)
··· 232 * polarity LEVEL mask 233 * 234 ****************************************************************************/ 235 + static void gpio_irq_ack(struct irq_data *d) 236 { 237 + int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 238 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 239 + int pin = irq_to_gpio(d->irq); 240 writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin)); 241 } 242 } 243 244 + static void gpio_irq_mask(struct irq_data *d) 245 { 246 + int pin = irq_to_gpio(d->irq); 247 + int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 248 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 249 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 250 u32 u = readl(reg); ··· 253 writel(u, reg); 254 } 255 256 + static void gpio_irq_unmask(struct irq_data *d) 257 { 258 + int pin = irq_to_gpio(d->irq); 259 + int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK; 260 u32 reg = (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) ? 261 GPIO_EDGE_MASK(pin) : GPIO_LEVEL_MASK(pin); 262 u32 u = readl(reg); ··· 264 writel(u, reg); 265 } 266 267 + static int gpio_irq_set_type(struct irq_data *d, u32 type) 268 { 269 + int pin = irq_to_gpio(d->irq); 270 struct irq_desc *desc; 271 u32 u; 272 273 u = readl(GPIO_IO_CONF(pin)) & (1 << (pin & 31)); 274 if (!u) { 275 printk(KERN_ERR "orion gpio_irq_set_type failed " 276 + "(irq %d, pin %d).\n", d->irq, pin); 277 return -EINVAL; 278 } 279 280 + desc = irq_desc + d->irq; 281 282 /* 283 * Set edge/level type. ··· 287 } else if (type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 288 desc->handle_irq = handle_level_irq; 289 } else { 290 + printk(KERN_ERR "failed to set irq=%d (type=%d)\n", d->irq, type); 291 return -EINVAL; 292 } 293 ··· 325 326 struct irq_chip orion_gpio_irq_chip = { 327 .name = "orion_gpio_irq", 328 + .irq_ack = gpio_irq_ack, 329 + .irq_mask = gpio_irq_mask, 330 + .irq_unmask = gpio_irq_unmask, 331 + .irq_set_type = gpio_irq_set_type, 332 }; 333 334 void orion_gpio_irq_handler(int pinoff)
+9 -9
arch/arm/plat-orion/irq.c
··· 14 #include <linux/io.h> 15 #include <plat/irq.h> 16 17 - static void orion_irq_mask(u32 irq) 18 { 19 - void __iomem *maskaddr = get_irq_chip_data(irq); 20 u32 mask; 21 22 mask = readl(maskaddr); 23 - mask &= ~(1 << (irq & 31)); 24 writel(mask, maskaddr); 25 } 26 27 - static void orion_irq_unmask(u32 irq) 28 { 29 - void __iomem *maskaddr = get_irq_chip_data(irq); 30 u32 mask; 31 32 mask = readl(maskaddr); 33 - mask |= 1 << (irq & 31); 34 writel(mask, maskaddr); 35 } 36 37 static struct irq_chip orion_irq_chip = { 38 .name = "orion_irq", 39 - .mask = orion_irq_mask, 40 - .mask_ack = orion_irq_mask, 41 - .unmask = orion_irq_unmask, 42 }; 43 44 void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
··· 14 #include <linux/io.h> 15 #include <plat/irq.h> 16 17 + static void orion_irq_mask(struct irq_data *d) 18 { 19 + void __iomem *maskaddr = irq_data_get_irq_chip_data(d); 20 u32 mask; 21 22 mask = readl(maskaddr); 23 + mask &= ~(1 << (d->irq & 31)); 24 writel(mask, maskaddr); 25 } 26 27 + static void orion_irq_unmask(struct irq_data *d) 28 { 29 + void __iomem *maskaddr = irq_data_get_irq_chip_data(d); 30 u32 mask; 31 32 mask = readl(maskaddr); 33 + mask |= 1 << (d->irq & 31); 34 writel(mask, maskaddr); 35 } 36 37 static struct irq_chip orion_irq_chip = { 38 .name = "orion_irq", 39 + .irq_mask = orion_irq_mask, 40 + .irq_mask_ack = orion_irq_mask, 41 + .irq_unmask = orion_irq_unmask, 42 }; 43 44 void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
+14 -14
arch/arm/plat-pxa/gpio.c
··· 155 __raw_writel(gfer, c->regbase + GFER_OFFSET); 156 } 157 158 - static int pxa_gpio_irq_type(unsigned int irq, unsigned int type) 159 { 160 struct pxa_gpio_chip *c; 161 - int gpio = irq_to_gpio(irq); 162 unsigned long gpdr, mask = GPIO_bit(gpio); 163 164 c = gpio_to_chip(gpio); ··· 195 196 update_edge_detect(c); 197 198 - pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio, 199 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""), 200 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : "")); 201 return 0; ··· 227 } while (loop); 228 } 229 230 - static void pxa_ack_muxed_gpio(unsigned int irq) 231 { 232 - int gpio = irq_to_gpio(irq); 233 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 234 235 __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET); 236 } 237 238 - static void pxa_mask_muxed_gpio(unsigned int irq) 239 { 240 - int gpio = irq_to_gpio(irq); 241 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 242 uint32_t grer, gfer; 243 ··· 249 __raw_writel(gfer, c->regbase + GFER_OFFSET); 250 } 251 252 - static void pxa_unmask_muxed_gpio(unsigned int irq) 253 { 254 - int gpio = irq_to_gpio(irq); 255 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 256 257 c->irq_mask |= GPIO_bit(gpio); ··· 260 261 static struct irq_chip pxa_muxed_gpio_chip = { 262 .name = "GPIO", 263 - .ack = pxa_ack_muxed_gpio, 264 - .mask = pxa_mask_muxed_gpio, 265 - .unmask = pxa_unmask_muxed_gpio, 266 - .set_type = pxa_gpio_irq_type, 267 }; 268 269 void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn) ··· 291 292 /* Install handler for GPIO>=2 edge detect interrupts */ 293 set_irq_chained_handler(mux_irq, pxa_gpio_demux_handler); 294 - pxa_muxed_gpio_chip.set_wake = fn; 295 } 296 297 #ifdef CONFIG_PM
··· 155 __raw_writel(gfer, c->regbase + GFER_OFFSET); 156 } 157 158 + static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type) 159 { 160 struct pxa_gpio_chip *c; 161 + int gpio = irq_to_gpio(d->irq); 162 unsigned long gpdr, mask = GPIO_bit(gpio); 163 164 c = gpio_to_chip(gpio); ··· 195 196 update_edge_detect(c); 197 198 + pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, d->irq, gpio, 199 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""), 200 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : "")); 201 return 0; ··· 227 } while (loop); 228 } 229 230 + static void pxa_ack_muxed_gpio(struct irq_data *d) 231 { 232 + int gpio = irq_to_gpio(d->irq); 233 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 234 235 __raw_writel(GPIO_bit(gpio), c->regbase + GEDR_OFFSET); 236 } 237 238 + static void pxa_mask_muxed_gpio(struct irq_data *d) 239 { 240 + int gpio = irq_to_gpio(d->irq); 241 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 242 uint32_t grer, gfer; 243 ··· 249 __raw_writel(gfer, c->regbase + GFER_OFFSET); 250 } 251 252 + static void pxa_unmask_muxed_gpio(struct irq_data *d) 253 { 254 + int gpio = irq_to_gpio(d->irq); 255 struct pxa_gpio_chip *c = gpio_to_chip(gpio); 256 257 c->irq_mask |= GPIO_bit(gpio); ··· 260 261 static struct irq_chip pxa_muxed_gpio_chip = { 262 .name = "GPIO", 263 + .irq_ack = pxa_ack_muxed_gpio, 264 + .irq_mask = pxa_mask_muxed_gpio, 265 + .irq_unmask = pxa_unmask_muxed_gpio, 266 + .irq_set_type = pxa_gpio_irq_type, 267 }; 268 269 void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn) ··· 291 292 /* Install handler for GPIO>=2 edge detect interrupts */ 293 set_irq_chained_handler(mux_irq, pxa_gpio_demux_handler); 294 + pxa_muxed_gpio_chip.irq_set_wake = fn; 295 } 296 297 #ifdef CONFIG_PM
+3 -1
arch/arm/plat-pxa/include/plat/gpio.h
··· 1 #ifndef __PLAT_GPIO_H 2 #define __PLAT_GPIO_H 3 4 /* 5 * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with 6 * one set of registers. The register offsets are organized below: ··· 58 */ 59 extern int pxa_last_gpio; 60 61 - typedef int (*set_wake_t)(unsigned int irq, unsigned int on); 62 63 extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn); 64 #endif /* __PLAT_GPIO_H */
··· 1 #ifndef __PLAT_GPIO_H 2 #define __PLAT_GPIO_H 3 4 + struct irq_data; 5 + 6 /* 7 * We handle the GPIOs by banks, each bank covers up to 32 GPIOs with 8 * one set of registers. The register offsets are organized below: ··· 56 */ 57 extern int pxa_last_gpio; 58 59 + typedef int (*set_wake_t)(struct irq_data *d, unsigned int on); 60 61 extern void pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn); 62 #endif /* __PLAT_GPIO_H */
-1
arch/arm/plat-s3c24xx/devs.c
··· 194 memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); 195 s3c_device_ts.dev.platform_data = &s3c2410ts_info; 196 } 197 - EXPORT_SYMBOL(s3c24xx_ts_set_platdata); 198 199 /* USB Device (Gadget)*/ 200
··· 194 memcpy(&s3c2410ts_info, hard_s3c2410ts_info, sizeof(struct s3c2410_ts_mach_info)); 195 s3c_device_ts.dev.platform_data = &s3c2410ts_info; 196 } 197 198 /* USB Device (Gadget)*/ 199
+2 -2
arch/arm/plat-s3c24xx/include/plat/irq.h
··· 107 /* exported for use in arch/arm/mach-s3c2410 */ 108 109 #ifdef CONFIG_PM 110 - extern int s3c_irq_wake(unsigned int irqno, unsigned int state); 111 #else 112 #define s3c_irq_wake NULL 113 #endif 114 115 - extern int s3c_irqext_type(unsigned int irq, unsigned int type);
··· 107 /* exported for use in arch/arm/mach-s3c2410 */ 108 109 #ifdef CONFIG_PM 110 + extern int s3c_irq_wake(struct irq_data *data, unsigned int state); 111 #else 112 #define s3c_irq_wake NULL 113 #endif 114 115 + extern int s3c_irqext_type(struct irq_data *d, unsigned int type);
+6 -3
arch/arm/plat-s3c24xx/irq-pm.c
··· 15 #include <linux/module.h> 16 #include <linux/interrupt.h> 17 #include <linux/sysdev.h> 18 19 #include <plat/cpu.h> 20 #include <plat/pm.h> 21 #include <plat/irq.h> 22 23 /* state for IRQs over sleep */ 24 ··· 33 unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL; 34 unsigned long s3c_irqwake_eintallow = 0x0000fff0L; 35 36 - int s3c_irq_wake(unsigned int irqno, unsigned int state) 37 { 38 - unsigned long irqbit = 1 << (irqno - IRQ_EINT0); 39 40 if (!(s3c_irqwake_intallow & irqbit)) 41 return -ENOENT; 42 43 printk(KERN_INFO "wake %s for irq %d\n", 44 - state ? "enabled" : "disabled", irqno); 45 46 if (!state) 47 s3c_irqwake_intmask |= irqbit;
··· 15 #include <linux/module.h> 16 #include <linux/interrupt.h> 17 #include <linux/sysdev.h> 18 + #include <linux/irq.h> 19 20 #include <plat/cpu.h> 21 #include <plat/pm.h> 22 #include <plat/irq.h> 23 + 24 + #include <asm/irq.h> 25 26 /* state for IRQs over sleep */ 27 ··· 30 unsigned long s3c_irqwake_intallow = 1L << (IRQ_RTC - IRQ_EINT0) | 0xfL; 31 unsigned long s3c_irqwake_eintallow = 0x0000fff0L; 32 33 + int s3c_irq_wake(struct irq_data *data, unsigned int state) 34 { 35 + unsigned long irqbit = 1 << (data->irq - IRQ_EINT0); 36 37 if (!(s3c_irqwake_intallow & irqbit)) 38 return -ENOENT; 39 40 printk(KERN_INFO "wake %s for irq %d\n", 41 + state ? "enabled" : "disabled", data->irq); 42 43 if (!state) 44 s3c_irqwake_intmask |= irqbit;
+87 -95
arch/arm/plat-s3c24xx/irq.c
··· 34 #include <plat/irq.h> 35 36 static void 37 - s3c_irq_mask(unsigned int irqno) 38 { 39 unsigned long mask; 40 - 41 - irqno -= IRQ_EINT0; 42 43 mask = __raw_readl(S3C2410_INTMSK); 44 mask |= 1UL << irqno; ··· 45 } 46 47 static inline void 48 - s3c_irq_ack(unsigned int irqno) 49 { 50 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 51 52 __raw_writel(bitval, S3C2410_SRCPND); 53 __raw_writel(bitval, S3C2410_INTPND); 54 } 55 56 static inline void 57 - s3c_irq_maskack(unsigned int irqno) 58 { 59 - unsigned long bitval = 1UL << (irqno - IRQ_EINT0); 60 unsigned long mask; 61 62 mask = __raw_readl(S3C2410_INTMSK); ··· 68 69 70 static void 71 - s3c_irq_unmask(unsigned int irqno) 72 { 73 unsigned long mask; 74 75 if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23) ··· 85 86 struct irq_chip s3c_irq_level_chip = { 87 .name = "s3c-level", 88 - .ack = s3c_irq_maskack, 89 - .mask = s3c_irq_mask, 90 - .unmask = s3c_irq_unmask, 91 - .set_wake = s3c_irq_wake 92 }; 93 94 struct irq_chip s3c_irq_chip = { 95 .name = "s3c", 96 - .ack = s3c_irq_ack, 97 - .mask = s3c_irq_mask, 98 - .unmask = s3c_irq_unmask, 99 - .set_wake = s3c_irq_wake 100 }; 101 102 static void 103 - s3c_irqext_mask(unsigned int irqno) 104 { 105 unsigned long mask; 106 - 107 - irqno -= EXTINT_OFF; 108 109 mask = __raw_readl(S3C24XX_EINTMASK); 110 mask |= ( 1UL << irqno); ··· 111 } 112 113 static void 114 - s3c_irqext_ack(unsigned int irqno) 115 { 116 unsigned long req; 117 unsigned long bit; 118 unsigned long mask; 119 120 - bit = 1UL << (irqno - EXTINT_OFF); 121 122 mask = __raw_readl(S3C24XX_EINTMASK); 123 ··· 128 129 /* not sure if we should be acking the parent irq... */ 130 131 - if (irqno <= IRQ_EINT7 ) { 132 if ((req & 0xf0) == 0) 133 - s3c_irq_ack(IRQ_EINT4t7); 134 } else { 135 if ((req >> 8) == 0) 136 - s3c_irq_ack(IRQ_EINT8t23); 137 } 138 } 139 140 static void 141 - s3c_irqext_unmask(unsigned int irqno) 142 { 143 unsigned long mask; 144 145 - irqno -= EXTINT_OFF; 146 - 147 mask = __raw_readl(S3C24XX_EINTMASK); 148 - mask &= ~( 1UL << irqno); 149 __raw_writel(mask, S3C24XX_EINTMASK); 150 } 151 152 int 153 - s3c_irqext_type(unsigned int irq, unsigned int type) 154 { 155 void __iomem *extint_reg; 156 void __iomem *gpcon_reg; 157 unsigned long gpcon_offset, extint_offset; 158 unsigned long newvalue = 0, value; 159 160 - if ((irq >= IRQ_EINT0) && (irq <= IRQ_EINT3)) 161 - { 162 gpcon_reg = S3C2410_GPFCON; 163 extint_reg = S3C24XX_EXTINT0; 164 - gpcon_offset = (irq - IRQ_EINT0) * 2; 165 - extint_offset = (irq - IRQ_EINT0) * 4; 166 - } 167 - else if ((irq >= IRQ_EINT4) && (irq <= IRQ_EINT7)) 168 - { 169 gpcon_reg = S3C2410_GPFCON; 170 extint_reg = S3C24XX_EXTINT0; 171 - gpcon_offset = (irq - (EXTINT_OFF)) * 2; 172 - extint_offset = (irq - (EXTINT_OFF)) * 4; 173 - } 174 - else if ((irq >= IRQ_EINT8) && (irq <= IRQ_EINT15)) 175 - { 176 gpcon_reg = S3C2410_GPGCON; 177 extint_reg = S3C24XX_EXTINT1; 178 - gpcon_offset = (irq - IRQ_EINT8) * 2; 179 - extint_offset = (irq - IRQ_EINT8) * 4; 180 - } 181 - else if ((irq >= IRQ_EINT16) && (irq <= IRQ_EINT23)) 182 - { 183 gpcon_reg = S3C2410_GPGCON; 184 extint_reg = S3C24XX_EXTINT2; 185 - gpcon_offset = (irq - IRQ_EINT8) * 2; 186 - extint_offset = (irq - IRQ_EINT16) * 4; 187 - } else 188 return -1; 189 190 /* Set the GPIO to external interrupt mode */ 191 value = __raw_readl(gpcon_reg); ··· 226 227 static struct irq_chip s3c_irqext_chip = { 228 .name = "s3c-ext", 229 - .mask = s3c_irqext_mask, 230 - .unmask = s3c_irqext_unmask, 231 - .ack = s3c_irqext_ack, 232 - .set_type = s3c_irqext_type, 233 - .set_wake = s3c_irqext_wake 234 }; 235 236 static struct irq_chip s3c_irq_eint0t4 = { 237 .name = "s3c-ext0", 238 - .ack = s3c_irq_ack, 239 - .mask = s3c_irq_mask, 240 - .unmask = s3c_irq_unmask, 241 - .set_wake = s3c_irq_wake, 242 - .set_type = s3c_irqext_type, 243 }; 244 245 /* mask values for the parent registers for each of the interrupt types */ ··· 253 /* UART0 */ 254 255 static void 256 - s3c_irq_uart0_mask(unsigned int irqno) 257 { 258 - s3c_irqsub_mask(irqno, INTMSK_UART0, 7); 259 } 260 261 static void 262 - s3c_irq_uart0_unmask(unsigned int irqno) 263 { 264 - s3c_irqsub_unmask(irqno, INTMSK_UART0); 265 } 266 267 static void 268 - s3c_irq_uart0_ack(unsigned int irqno) 269 { 270 - s3c_irqsub_maskack(irqno, INTMSK_UART0, 7); 271 } 272 273 static struct irq_chip s3c_irq_uart0 = { 274 .name = "s3c-uart0", 275 - .mask = s3c_irq_uart0_mask, 276 - .unmask = s3c_irq_uart0_unmask, 277 - .ack = s3c_irq_uart0_ack, 278 }; 279 280 /* UART1 */ 281 282 static void 283 - s3c_irq_uart1_mask(unsigned int irqno) 284 { 285 - s3c_irqsub_mask(irqno, INTMSK_UART1, 7 << 3); 286 } 287 288 static void 289 - s3c_irq_uart1_unmask(unsigned int irqno) 290 { 291 - s3c_irqsub_unmask(irqno, INTMSK_UART1); 292 } 293 294 static void 295 - s3c_irq_uart1_ack(unsigned int irqno) 296 { 297 - s3c_irqsub_maskack(irqno, INTMSK_UART1, 7 << 3); 298 } 299 300 static struct irq_chip s3c_irq_uart1 = { 301 .name = "s3c-uart1", 302 - .mask = s3c_irq_uart1_mask, 303 - .unmask = s3c_irq_uart1_unmask, 304 - .ack = s3c_irq_uart1_ack, 305 }; 306 307 /* UART2 */ 308 309 static void 310 - s3c_irq_uart2_mask(unsigned int irqno) 311 { 312 - s3c_irqsub_mask(irqno, INTMSK_UART2, 7 << 6); 313 } 314 315 static void 316 - s3c_irq_uart2_unmask(unsigned int irqno) 317 { 318 - s3c_irqsub_unmask(irqno, INTMSK_UART2); 319 } 320 321 static void 322 - s3c_irq_uart2_ack(unsigned int irqno) 323 { 324 - s3c_irqsub_maskack(irqno, INTMSK_UART2, 7 << 6); 325 } 326 327 static struct irq_chip s3c_irq_uart2 = { 328 .name = "s3c-uart2", 329 - .mask = s3c_irq_uart2_mask, 330 - .unmask = s3c_irq_uart2_unmask, 331 - .ack = s3c_irq_uart2_ack, 332 }; 333 334 /* ADC and Touchscreen */ 335 336 static void 337 - s3c_irq_adc_mask(unsigned int irqno) 338 { 339 - s3c_irqsub_mask(irqno, INTMSK_ADCPARENT, 3 << 9); 340 } 341 342 static void 343 - s3c_irq_adc_unmask(unsigned int irqno) 344 { 345 - s3c_irqsub_unmask(irqno, INTMSK_ADCPARENT); 346 } 347 348 static void 349 - s3c_irq_adc_ack(unsigned int irqno) 350 { 351 - s3c_irqsub_ack(irqno, INTMSK_ADCPARENT, 3 << 9); 352 } 353 354 static struct irq_chip s3c_irq_adc = { 355 .name = "s3c-adc", 356 - .mask = s3c_irq_adc_mask, 357 - .unmask = s3c_irq_adc_unmask, 358 - .ack = s3c_irq_adc_ack, 359 }; 360 361 /* irq demux for adc */
··· 34 #include <plat/irq.h> 35 36 static void 37 + s3c_irq_mask(struct irq_data *data) 38 { 39 + unsigned int irqno = data->irq - IRQ_EINT0; 40 unsigned long mask; 41 42 mask = __raw_readl(S3C2410_INTMSK); 43 mask |= 1UL << irqno; ··· 46 } 47 48 static inline void 49 + s3c_irq_ack(struct irq_data *data) 50 { 51 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 52 53 __raw_writel(bitval, S3C2410_SRCPND); 54 __raw_writel(bitval, S3C2410_INTPND); 55 } 56 57 static inline void 58 + s3c_irq_maskack(struct irq_data *data) 59 { 60 + unsigned long bitval = 1UL << (data->irq - IRQ_EINT0); 61 unsigned long mask; 62 63 mask = __raw_readl(S3C2410_INTMSK); ··· 69 70 71 static void 72 + s3c_irq_unmask(struct irq_data *data) 73 { 74 + unsigned int irqno = data->irq; 75 unsigned long mask; 76 77 if (irqno != IRQ_TIMER4 && irqno != IRQ_EINT8t23) ··· 85 86 struct irq_chip s3c_irq_level_chip = { 87 .name = "s3c-level", 88 + .irq_ack = s3c_irq_maskack, 89 + .irq_mask = s3c_irq_mask, 90 + .irq_unmask = s3c_irq_unmask, 91 + .irq_set_wake = s3c_irq_wake 92 }; 93 94 struct irq_chip s3c_irq_chip = { 95 .name = "s3c", 96 + .irq_ack = s3c_irq_ack, 97 + .irq_mask = s3c_irq_mask, 98 + .irq_unmask = s3c_irq_unmask, 99 + .irq_set_wake = s3c_irq_wake 100 }; 101 102 static void 103 + s3c_irqext_mask(struct irq_data *data) 104 { 105 + unsigned int irqno = data->irq - EXTINT_OFF; 106 unsigned long mask; 107 108 mask = __raw_readl(S3C24XX_EINTMASK); 109 mask |= ( 1UL << irqno); ··· 112 } 113 114 static void 115 + s3c_irqext_ack(struct irq_data *data) 116 { 117 unsigned long req; 118 unsigned long bit; 119 unsigned long mask; 120 121 + bit = 1UL << (data->irq - EXTINT_OFF); 122 123 mask = __raw_readl(S3C24XX_EINTMASK); 124 ··· 129 130 /* not sure if we should be acking the parent irq... */ 131 132 + if (data->irq <= IRQ_EINT7) { 133 if ((req & 0xf0) == 0) 134 + s3c_irq_ack(irq_get_irq_data(IRQ_EINT4t7)); 135 } else { 136 if ((req >> 8) == 0) 137 + s3c_irq_ack(irq_get_irq_data(IRQ_EINT8t23)); 138 } 139 } 140 141 static void 142 + s3c_irqext_unmask(struct irq_data *data) 143 { 144 + unsigned int irqno = data->irq - EXTINT_OFF; 145 unsigned long mask; 146 147 mask = __raw_readl(S3C24XX_EINTMASK); 148 + mask &= ~(1UL << irqno); 149 __raw_writel(mask, S3C24XX_EINTMASK); 150 } 151 152 int 153 + s3c_irqext_type(struct irq_data *data, unsigned int type) 154 { 155 void __iomem *extint_reg; 156 void __iomem *gpcon_reg; 157 unsigned long gpcon_offset, extint_offset; 158 unsigned long newvalue = 0, value; 159 160 + if ((data->irq >= IRQ_EINT0) && (data->irq <= IRQ_EINT3)) { 161 gpcon_reg = S3C2410_GPFCON; 162 extint_reg = S3C24XX_EXTINT0; 163 + gpcon_offset = (data->irq - IRQ_EINT0) * 2; 164 + extint_offset = (data->irq - IRQ_EINT0) * 4; 165 + } else if ((data->irq >= IRQ_EINT4) && (data->irq <= IRQ_EINT7)) { 166 gpcon_reg = S3C2410_GPFCON; 167 extint_reg = S3C24XX_EXTINT0; 168 + gpcon_offset = (data->irq - (EXTINT_OFF)) * 2; 169 + extint_offset = (data->irq - (EXTINT_OFF)) * 4; 170 + } else if ((data->irq >= IRQ_EINT8) && (data->irq <= IRQ_EINT15)) { 171 gpcon_reg = S3C2410_GPGCON; 172 extint_reg = S3C24XX_EXTINT1; 173 + gpcon_offset = (data->irq - IRQ_EINT8) * 2; 174 + extint_offset = (data->irq - IRQ_EINT8) * 4; 175 + } else if ((data->irq >= IRQ_EINT16) && (data->irq <= IRQ_EINT23)) { 176 gpcon_reg = S3C2410_GPGCON; 177 extint_reg = S3C24XX_EXTINT2; 178 + gpcon_offset = (data->irq - IRQ_EINT8) * 2; 179 + extint_offset = (data->irq - IRQ_EINT16) * 4; 180 + } else { 181 return -1; 182 + } 183 184 /* Set the GPIO to external interrupt mode */ 185 value = __raw_readl(gpcon_reg); ··· 234 235 static struct irq_chip s3c_irqext_chip = { 236 .name = "s3c-ext", 237 + .irq_mask = s3c_irqext_mask, 238 + .irq_unmask = s3c_irqext_unmask, 239 + .irq_ack = s3c_irqext_ack, 240 + .irq_set_type = s3c_irqext_type, 241 + .irq_set_wake = s3c_irqext_wake 242 }; 243 244 static struct irq_chip s3c_irq_eint0t4 = { 245 .name = "s3c-ext0", 246 + .irq_ack = s3c_irq_ack, 247 + .irq_mask = s3c_irq_mask, 248 + .irq_unmask = s3c_irq_unmask, 249 + .irq_set_wake = s3c_irq_wake, 250 + .irq_set_type = s3c_irqext_type, 251 }; 252 253 /* mask values for the parent registers for each of the interrupt types */ ··· 261 /* UART0 */ 262 263 static void 264 + s3c_irq_uart0_mask(struct irq_data *data) 265 { 266 + s3c_irqsub_mask(data->irq, INTMSK_UART0, 7); 267 } 268 269 static void 270 + s3c_irq_uart0_unmask(struct irq_data *data) 271 { 272 + s3c_irqsub_unmask(data->irq, INTMSK_UART0); 273 } 274 275 static void 276 + s3c_irq_uart0_ack(struct irq_data *data) 277 { 278 + s3c_irqsub_maskack(data->irq, INTMSK_UART0, 7); 279 } 280 281 static struct irq_chip s3c_irq_uart0 = { 282 .name = "s3c-uart0", 283 + .irq_mask = s3c_irq_uart0_mask, 284 + .irq_unmask = s3c_irq_uart0_unmask, 285 + .irq_ack = s3c_irq_uart0_ack, 286 }; 287 288 /* UART1 */ 289 290 static void 291 + s3c_irq_uart1_mask(struct irq_data *data) 292 { 293 + s3c_irqsub_mask(data->irq, INTMSK_UART1, 7 << 3); 294 } 295 296 static void 297 + s3c_irq_uart1_unmask(struct irq_data *data) 298 { 299 + s3c_irqsub_unmask(data->irq, INTMSK_UART1); 300 } 301 302 static void 303 + s3c_irq_uart1_ack(struct irq_data *data) 304 { 305 + s3c_irqsub_maskack(data->irq, INTMSK_UART1, 7 << 3); 306 } 307 308 static struct irq_chip s3c_irq_uart1 = { 309 .name = "s3c-uart1", 310 + .irq_mask = s3c_irq_uart1_mask, 311 + .irq_unmask = s3c_irq_uart1_unmask, 312 + .irq_ack = s3c_irq_uart1_ack, 313 }; 314 315 /* UART2 */ 316 317 static void 318 + s3c_irq_uart2_mask(struct irq_data *data) 319 { 320 + s3c_irqsub_mask(data->irq, INTMSK_UART2, 7 << 6); 321 } 322 323 static void 324 + s3c_irq_uart2_unmask(struct irq_data *data) 325 { 326 + s3c_irqsub_unmask(data->irq, INTMSK_UART2); 327 } 328 329 static void 330 + s3c_irq_uart2_ack(struct irq_data *data) 331 { 332 + s3c_irqsub_maskack(data->irq, INTMSK_UART2, 7 << 6); 333 } 334 335 static struct irq_chip s3c_irq_uart2 = { 336 .name = "s3c-uart2", 337 + .irq_mask = s3c_irq_uart2_mask, 338 + .irq_unmask = s3c_irq_uart2_unmask, 339 + .irq_ack = s3c_irq_uart2_ack, 340 }; 341 342 /* ADC and Touchscreen */ 343 344 static void 345 + s3c_irq_adc_mask(struct irq_data *d) 346 { 347 + s3c_irqsub_mask(d->irq, INTMSK_ADCPARENT, 3 << 9); 348 } 349 350 static void 351 + s3c_irq_adc_unmask(struct irq_data *d) 352 { 353 + s3c_irqsub_unmask(d->irq, INTMSK_ADCPARENT); 354 } 355 356 static void 357 + s3c_irq_adc_ack(struct irq_data *d) 358 { 359 + s3c_irqsub_ack(d->irq, INTMSK_ADCPARENT, 3 << 9); 360 } 361 362 static struct irq_chip s3c_irq_adc = { 363 .name = "s3c-adc", 364 + .irq_mask = s3c_irq_adc_mask, 365 + .irq_unmask = s3c_irq_adc_unmask, 366 + .irq_ack = s3c_irq_adc_ack, 367 }; 368 369 /* irq demux for adc */
+1 -1
arch/arm/plat-s3c24xx/s3c2443-clock.c
··· 271 .ctrlbit = S3C2443_HCLKCON_DMA5, 272 }, { 273 .name = "hsmmc", 274 - .id = 0, 275 .parent = &clk_h, 276 .enable = s3c2443_clkcon_enable_h, 277 .ctrlbit = S3C2443_HCLKCON_HSMMC,
··· 271 .ctrlbit = S3C2443_HCLKCON_DMA5, 272 }, { 273 .name = "hsmmc", 274 + .id = 1, 275 .parent = &clk_h, 276 .enable = s3c2443_clkcon_enable_h, 277 .ctrlbit = S3C2443_HCLKCON_HSMMC,
+26
arch/arm/plat-s5p/Kconfig
··· 56 bool 57 help 58 Compile in platform device definition for OneNAND controller
··· 56 bool 57 help 58 Compile in platform device definition for OneNAND controller 59 + 60 + config S5P_DEV_CSIS0 61 + bool 62 + help 63 + Compile in platform device definitions for MIPI-CSIS channel 0 64 + 65 + config S5P_DEV_CSIS1 66 + bool 67 + help 68 + Compile in platform device definitions for MIPI-CSIS channel 1 69 + 70 + menuconfig S5P_SYSMMU 71 + bool "SYSMMU support" 72 + depends on ARCH_S5PV310 73 + help 74 + This is a System MMU driver for Samsung ARM based Soc. 75 + 76 + if S5P_SYSMMU 77 + 78 + config S5P_SYSMMU_DEBUG 79 + bool "Enables debug messages" 80 + depends on S5P_SYSMMU 81 + help 82 + This enables SYSMMU driver debug massages. 83 + 84 + endif
+3
arch/arm/plat-s5p/Makefile
··· 28 obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o 29 obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o 30 obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o
··· 28 obj-$(CONFIG_S5P_DEV_FIMC1) += dev-fimc1.o 29 obj-$(CONFIG_S5P_DEV_FIMC2) += dev-fimc2.o 30 obj-$(CONFIG_S5P_DEV_ONENAND) += dev-onenand.o 31 + obj-$(CONFIG_S5P_DEV_CSIS0) += dev-csis0.o 32 + obj-$(CONFIG_S5P_DEV_CSIS1) += dev-csis1.o 33 + obj-$(CONFIG_S5P_SYSMMU) += sysmmu.o
+5
arch/arm/plat-s5p/cpu.c
··· 108 .pfn = __phys_to_pfn(S3C_PA_WDT), 109 .length = SZ_4K, 110 .type = MT_DEVICE, 111 }, 112 }; 113
··· 108 .pfn = __phys_to_pfn(S3C_PA_WDT), 109 .length = SZ_4K, 110 .type = MT_DEVICE, 111 + }, { 112 + .virtual = (unsigned long)S5P_VA_SROMC, 113 + .pfn = __phys_to_pfn(S5P_PA_SROMC), 114 + .length = SZ_4K, 115 + .type = MT_DEVICE, 116 }, 117 }; 118
+34
arch/arm/plat-s5p/dev-csis0.c
···
··· 1 + /* 2 + * Copyright (C) 2010 Samsung Electronics 3 + * 4 + * S5P series device definition for MIPI-CSIS channel 0 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 + #include <linux/kernel.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/platform_device.h> 14 + #include <mach/map.h> 15 + 16 + static struct resource s5p_mipi_csis0_resource[] = { 17 + [0] = { 18 + .start = S5P_PA_MIPI_CSIS0, 19 + .end = S5P_PA_MIPI_CSIS0 + SZ_4K - 1, 20 + .flags = IORESOURCE_MEM, 21 + }, 22 + [1] = { 23 + .start = IRQ_MIPI_CSIS0, 24 + .end = IRQ_MIPI_CSIS0, 25 + .flags = IORESOURCE_IRQ, 26 + } 27 + }; 28 + 29 + struct platform_device s5p_device_mipi_csis0 = { 30 + .name = "s5p-mipi-csis", 31 + .id = 0, 32 + .num_resources = ARRAY_SIZE(s5p_mipi_csis0_resource), 33 + .resource = s5p_mipi_csis0_resource, 34 + };
+34
arch/arm/plat-s5p/dev-csis1.c
···
··· 1 + /* 2 + * Copyright (C) 2010 Samsung Electronics 3 + * 4 + * S5P series device definition for MIPI-CSIS channel 1 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 + #include <linux/kernel.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/platform_device.h> 14 + #include <mach/map.h> 15 + 16 + static struct resource s5p_mipi_csis1_resource[] = { 17 + [0] = { 18 + .start = S5P_PA_MIPI_CSIS1, 19 + .end = S5P_PA_MIPI_CSIS1 + SZ_4K - 1, 20 + .flags = IORESOURCE_MEM, 21 + }, 22 + [1] = { 23 + .start = IRQ_MIPI_CSIS1, 24 + .end = IRQ_MIPI_CSIS1, 25 + .flags = IORESOURCE_IRQ, 26 + }, 27 + }; 28 + 29 + struct platform_device s5p_device_mipi_csis1 = { 30 + .name = "s5p-mipi-csis", 31 + .id = 1, 32 + .num_resources = ARRAY_SIZE(s5p_mipi_csis1_resource), 33 + .resource = s5p_mipi_csis1_resource, 34 + };
+28
arch/arm/plat-s5p/include/plat/csis.h
···
··· 1 + /* 2 + * Copyright (C) 2010 Samsung Electronics 3 + * 4 + * S5P series MIPI CSI slave device support 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 + #ifndef PLAT_S5P_CSIS_H_ 12 + #define PLAT_S5P_CSIS_H_ __FILE__ 13 + 14 + /** 15 + * struct s5p_platform_mipi_csis - platform data for MIPI-CSIS 16 + * @clk_rate: bus clock frequency 17 + * @lanes: number of data lanes used 18 + * @alignment: data alignment in bits 19 + * @hs_settle: HS-RX settle time 20 + */ 21 + struct s5p_platform_mipi_csis { 22 + unsigned long clk_rate; 23 + u8 lanes; 24 + u8 alignment; 25 + u8 hs_settle; 26 + }; 27 + 28 + #endif /* PLAT_S5P_CSIS_H_ */
+1
arch/arm/plat-s5p/include/plat/map-s5p.h
··· 15 16 #define S5P_VA_CHIPID S3C_ADDR(0x02000000) 17 #define S5P_VA_CMU S3C_ADDR(0x02100000) 18 #define S5P_VA_GPIO S3C_ADDR(0x02200000) 19 #define S5P_VA_GPIO1 S5P_VA_GPIO 20 #define S5P_VA_GPIO2 S3C_ADDR(0x02240000)
··· 15 16 #define S5P_VA_CHIPID S3C_ADDR(0x02000000) 17 #define S5P_VA_CMU S3C_ADDR(0x02100000) 18 + #define S5P_VA_PMU S3C_ADDR(0x02180000) 19 #define S5P_VA_GPIO S3C_ADDR(0x02200000) 20 #define S5P_VA_GPIO1 S5P_VA_GPIO 21 #define S5P_VA_GPIO2 S3C_ADDR(0x02240000)
+54
arch/arm/plat-s5p/include/plat/regs-srom.h
···
··· 1 + /* linux/arch/arm/plat-s5p/include/plat/regs-srom.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * S5P SROMC register definitions 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #ifndef __ASM_PLAT_S5P_REGS_SROM_H 14 + #define __ASM_PLAT_S5P_REGS_SROM_H __FILE__ 15 + 16 + #include <mach/map.h> 17 + 18 + #define S5P_SROMREG(x) (S5P_VA_SROMC + (x)) 19 + 20 + #define S5P_SROM_BW S5P_SROMREG(0x0) 21 + #define S5P_SROM_BC0 S5P_SROMREG(0x4) 22 + #define S5P_SROM_BC1 S5P_SROMREG(0x8) 23 + #define S5P_SROM_BC2 S5P_SROMREG(0xc) 24 + #define S5P_SROM_BC3 S5P_SROMREG(0x10) 25 + #define S5P_SROM_BC4 S5P_SROMREG(0x14) 26 + #define S5P_SROM_BC5 S5P_SROMREG(0x18) 27 + 28 + /* one register BW holds 4 x 4-bit packed settings for NCS0 - NCS3 */ 29 + 30 + #define S5P_SROM_BW__DATAWIDTH__SHIFT 0 31 + #define S5P_SROM_BW__ADDRMODE__SHIFT 1 32 + #define S5P_SROM_BW__WAITENABLE__SHIFT 2 33 + #define S5P_SROM_BW__BYTEENABLE__SHIFT 3 34 + 35 + #define S5P_SROM_BW__CS_MASK 0xf 36 + 37 + #define S5P_SROM_BW__NCS0__SHIFT 0 38 + #define S5P_SROM_BW__NCS1__SHIFT 4 39 + #define S5P_SROM_BW__NCS2__SHIFT 8 40 + #define S5P_SROM_BW__NCS3__SHIFT 12 41 + #define S5P_SROM_BW__NCS4__SHIFT 16 42 + #define S5P_SROM_BW__NCS5__SHIFT 20 43 + 44 + /* applies to same to BCS0 - BCS3 */ 45 + 46 + #define S5P_SROM_BCX__PMC__SHIFT 0 47 + #define S5P_SROM_BCX__TACP__SHIFT 4 48 + #define S5P_SROM_BCX__TCAH__SHIFT 8 49 + #define S5P_SROM_BCX__TCOH__SHIFT 12 50 + #define S5P_SROM_BCX__TACC__SHIFT 16 51 + #define S5P_SROM_BCX__TCOS__SHIFT 24 52 + #define S5P_SROM_BCX__TACS__SHIFT 28 53 + 54 + #endif /* __ASM_PLAT_S5P_REGS_SROM_H */
+23
arch/arm/plat-s5p/include/plat/sysmmu.h
···
··· 1 + /* linux/arch/arm/plat-s5p/include/plat/sysmmu.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com/ 5 + * 6 + * Samsung sysmmu driver 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 + #ifndef __ASM_PLAT_S5P_SYSMMU_H 14 + #define __ASM_PLAT_S5P_SYSMMU_H __FILE__ 15 + 16 + /* debug macro */ 17 + #ifdef CONFIG_S5P_SYSMMU_DEBUG 18 + #define sysmmu_debug(fmt, arg...) printk(KERN_INFO "[%s] " fmt, __func__, ## arg) 19 + #else 20 + #define sysmmu_debug(fmt, arg...) do { } while (0) 21 + #endif 22 + 23 + #endif /* __ASM_PLAT_S5P_SYSMMU_H */
+44 -42
arch/arm/plat-s5p/irq-eint.c
··· 28 #include <plat/gpio-cfg.h> 29 #include <mach/regs-gpio.h> 30 31 - static inline void s5p_irq_eint_mask(unsigned int irq) 32 { 33 u32 mask; 34 35 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 36 - mask |= eint_irq_to_bit(irq); 37 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 38 } 39 40 - static void s5p_irq_eint_unmask(unsigned int irq) 41 { 42 u32 mask; 43 44 - mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); 45 - mask &= ~(eint_irq_to_bit(irq)); 46 - __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); 47 } 48 49 - static inline void s5p_irq_eint_ack(unsigned int irq) 50 { 51 - __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); 52 } 53 54 - static void s5p_irq_eint_maskack(unsigned int irq) 55 { 56 /* compiler should in-line these */ 57 - s5p_irq_eint_mask(irq); 58 - s5p_irq_eint_ack(irq); 59 } 60 61 - static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) 62 { 63 - int offs = EINT_OFFSET(irq); 64 int shift; 65 u32 ctrl, mask; 66 u32 newvalue = 0; ··· 95 shift = (offs & 0x7) * 4; 96 mask = 0x7 << shift; 97 98 - ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(irq))); 99 ctrl &= ~mask; 100 ctrl |= newvalue << shift; 101 - __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(irq))); 102 103 if ((0 <= offs) && (offs < 8)) 104 s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE); ··· 120 121 static struct irq_chip s5p_irq_eint = { 122 .name = "s5p-eint", 123 - .mask = s5p_irq_eint_mask, 124 - .unmask = s5p_irq_eint_unmask, 125 - .mask_ack = s5p_irq_eint_maskack, 126 - .ack = s5p_irq_eint_ack, 127 - .set_type = s5p_irq_eint_set_type, 128 #ifdef CONFIG_PM 129 - .set_wake = s3c_irqext_wake, 130 #endif 131 }; 132 ··· 160 s5p_irq_demux_eint(IRQ_EINT(24)); 161 } 162 163 - static inline void s5p_irq_vic_eint_mask(unsigned int irq) 164 { 165 - void __iomem *base = get_irq_chip_data(irq); 166 167 - s5p_irq_eint_mask(irq); 168 - writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE_CLEAR); 169 } 170 171 - static void s5p_irq_vic_eint_unmask(unsigned int irq) 172 { 173 - void __iomem *base = get_irq_chip_data(irq); 174 175 - s5p_irq_eint_unmask(irq); 176 - writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE); 177 } 178 179 - static inline void s5p_irq_vic_eint_ack(unsigned int irq) 180 { 181 - __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); 182 } 183 184 - static void s5p_irq_vic_eint_maskack(unsigned int irq) 185 { 186 - s5p_irq_vic_eint_mask(irq); 187 - s5p_irq_vic_eint_ack(irq); 188 } 189 190 static struct irq_chip s5p_irq_vic_eint = { 191 .name = "s5p_vic_eint", 192 - .mask = s5p_irq_vic_eint_mask, 193 - .unmask = s5p_irq_vic_eint_unmask, 194 - .mask_ack = s5p_irq_vic_eint_maskack, 195 - .ack = s5p_irq_vic_eint_ack, 196 - .set_type = s5p_irq_eint_set_type, 197 #ifdef CONFIG_PM 198 - .set_wake = s3c_irqext_wake, 199 #endif 200 }; 201
··· 28 #include <plat/gpio-cfg.h> 29 #include <mach/regs-gpio.h> 30 31 + static inline void s5p_irq_eint_mask(struct irq_data *data) 32 { 33 u32 mask; 34 35 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 36 + mask |= eint_irq_to_bit(data->irq); 37 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 38 } 39 40 + static void s5p_irq_eint_unmask(struct irq_data *data) 41 { 42 u32 mask; 43 44 + mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); 45 + mask &= ~(eint_irq_to_bit(data->irq)); 46 + __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); 47 } 48 49 + static inline void s5p_irq_eint_ack(struct irq_data *data) 50 { 51 + __raw_writel(eint_irq_to_bit(data->irq), 52 + S5P_EINT_PEND(EINT_REG_NR(data->irq))); 53 } 54 55 + static void s5p_irq_eint_maskack(struct irq_data *data) 56 { 57 /* compiler should in-line these */ 58 + s5p_irq_eint_mask(data); 59 + s5p_irq_eint_ack(data); 60 } 61 62 + static int s5p_irq_eint_set_type(struct irq_data *data, unsigned int type) 63 { 64 + int offs = EINT_OFFSET(data->irq); 65 int shift; 66 u32 ctrl, mask; 67 u32 newvalue = 0; ··· 94 shift = (offs & 0x7) * 4; 95 mask = 0x7 << shift; 96 97 + ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq))); 98 ctrl &= ~mask; 99 ctrl |= newvalue << shift; 100 + __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq))); 101 102 if ((0 <= offs) && (offs < 8)) 103 s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE); ··· 119 120 static struct irq_chip s5p_irq_eint = { 121 .name = "s5p-eint", 122 + .irq_mask = s5p_irq_eint_mask, 123 + .irq_unmask = s5p_irq_eint_unmask, 124 + .irq_mask_ack = s5p_irq_eint_maskack, 125 + .irq_ack = s5p_irq_eint_ack, 126 + .irq_set_type = s5p_irq_eint_set_type, 127 #ifdef CONFIG_PM 128 + .irq_set_wake = s3c_irqext_wake, 129 #endif 130 }; 131 ··· 159 s5p_irq_demux_eint(IRQ_EINT(24)); 160 } 161 162 + static inline void s5p_irq_vic_eint_mask(struct irq_data *data) 163 { 164 + void __iomem *base = irq_data_get_irq_chip_data(data); 165 166 + s5p_irq_eint_mask(data); 167 + writel(1 << EINT_OFFSET(data->irq), base + VIC_INT_ENABLE_CLEAR); 168 } 169 170 + static void s5p_irq_vic_eint_unmask(struct irq_data *data) 171 { 172 + void __iomem *base = irq_data_get_irq_chip_data(data); 173 174 + s5p_irq_eint_unmask(data); 175 + writel(1 << EINT_OFFSET(data->irq), base + VIC_INT_ENABLE); 176 } 177 178 + static inline void s5p_irq_vic_eint_ack(struct irq_data *data) 179 { 180 + __raw_writel(eint_irq_to_bit(data->irq), 181 + S5P_EINT_PEND(EINT_REG_NR(data->irq))); 182 } 183 184 + static void s5p_irq_vic_eint_maskack(struct irq_data *data) 185 { 186 + s5p_irq_vic_eint_mask(data); 187 + s5p_irq_vic_eint_ack(data); 188 } 189 190 static struct irq_chip s5p_irq_vic_eint = { 191 .name = "s5p_vic_eint", 192 + .irq_mask = s5p_irq_vic_eint_mask, 193 + .irq_unmask = s5p_irq_vic_eint_unmask, 194 + .irq_mask_ack = s5p_irq_vic_eint_maskack, 195 + .irq_ack = s5p_irq_vic_eint_ack, 196 + .irq_set_type = s5p_irq_eint_set_type, 197 #ifdef CONFIG_PM 198 + .irq_set_wake = s3c_irqext_wake, 199 #endif 200 }; 201
+25 -25
arch/arm/plat-s5p/irq-gpioint.c
··· 30 31 static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR]; 32 33 - static int s5p_gpioint_get_group(unsigned int irq) 34 { 35 - struct gpio_chip *chip = get_irq_data(irq); 36 struct s3c_gpio_chip *s3c_chip = container_of(chip, 37 struct s3c_gpio_chip, chip); 38 int group; ··· 44 return group; 45 } 46 47 - static int s5p_gpioint_get_offset(unsigned int irq) 48 { 49 - struct gpio_chip *chip = get_irq_data(irq); 50 struct s3c_gpio_chip *s3c_chip = container_of(chip, 51 struct s3c_gpio_chip, chip); 52 53 - return irq - s3c_chip->irq_base; 54 } 55 56 - static void s5p_gpioint_ack(unsigned int irq) 57 { 58 int group, offset, pend_offset; 59 unsigned int value; 60 61 - group = s5p_gpioint_get_group(irq); 62 - offset = s5p_gpioint_get_offset(irq); 63 pend_offset = group << 2; 64 65 value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); ··· 67 __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); 68 } 69 70 - static void s5p_gpioint_mask(unsigned int irq) 71 { 72 int group, offset, mask_offset; 73 unsigned int value; 74 75 - group = s5p_gpioint_get_group(irq); 76 - offset = s5p_gpioint_get_offset(irq); 77 mask_offset = group << 2; 78 79 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); ··· 81 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 82 } 83 84 - static void s5p_gpioint_unmask(unsigned int irq) 85 { 86 int group, offset, mask_offset; 87 unsigned int value; 88 89 - group = s5p_gpioint_get_group(irq); 90 - offset = s5p_gpioint_get_offset(irq); 91 mask_offset = group << 2; 92 93 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); ··· 95 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 96 } 97 98 - static void s5p_gpioint_mask_ack(unsigned int irq) 99 { 100 - s5p_gpioint_mask(irq); 101 - s5p_gpioint_ack(irq); 102 } 103 104 - static int s5p_gpioint_set_type(unsigned int irq, unsigned int type) 105 { 106 int group, offset, con_offset; 107 unsigned int value; 108 109 - group = s5p_gpioint_get_group(irq); 110 - offset = s5p_gpioint_get_offset(irq); 111 con_offset = group << 2; 112 113 switch (type) { ··· 142 143 struct irq_chip s5p_gpioint = { 144 .name = "s5p_gpioint", 145 - .ack = s5p_gpioint_ack, 146 - .mask = s5p_gpioint_mask, 147 - .mask_ack = s5p_gpioint_mask_ack, 148 - .unmask = s5p_gpioint_unmask, 149 - .set_type = s5p_gpioint_set_type, 150 }; 151 152 static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
··· 30 31 static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR]; 32 33 + static int s5p_gpioint_get_group(struct irq_data *data) 34 { 35 + struct gpio_chip *chip = irq_data_get_irq_data(data); 36 struct s3c_gpio_chip *s3c_chip = container_of(chip, 37 struct s3c_gpio_chip, chip); 38 int group; ··· 44 return group; 45 } 46 47 + static int s5p_gpioint_get_offset(struct irq_data *data) 48 { 49 + struct gpio_chip *chip = irq_data_get_irq_data(data); 50 struct s3c_gpio_chip *s3c_chip = container_of(chip, 51 struct s3c_gpio_chip, chip); 52 53 + return data->irq - s3c_chip->irq_base; 54 } 55 56 + static void s5p_gpioint_ack(struct irq_data *data) 57 { 58 int group, offset, pend_offset; 59 unsigned int value; 60 61 + group = s5p_gpioint_get_group(data); 62 + offset = s5p_gpioint_get_offset(data); 63 pend_offset = group << 2; 64 65 value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); ··· 67 __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); 68 } 69 70 + static void s5p_gpioint_mask(struct irq_data *data) 71 { 72 int group, offset, mask_offset; 73 unsigned int value; 74 75 + group = s5p_gpioint_get_group(data); 76 + offset = s5p_gpioint_get_offset(data); 77 mask_offset = group << 2; 78 79 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); ··· 81 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 82 } 83 84 + static void s5p_gpioint_unmask(struct irq_data *data) 85 { 86 int group, offset, mask_offset; 87 unsigned int value; 88 89 + group = s5p_gpioint_get_group(data); 90 + offset = s5p_gpioint_get_offset(data); 91 mask_offset = group << 2; 92 93 value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); ··· 95 __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); 96 } 97 98 + static void s5p_gpioint_mask_ack(struct irq_data *data) 99 { 100 + s5p_gpioint_mask(data); 101 + s5p_gpioint_ack(data); 102 } 103 104 + static int s5p_gpioint_set_type(struct irq_data *data, unsigned int type) 105 { 106 int group, offset, con_offset; 107 unsigned int value; 108 109 + group = s5p_gpioint_get_group(data); 110 + offset = s5p_gpioint_get_offset(data); 111 con_offset = group << 2; 112 113 switch (type) { ··· 142 143 struct irq_chip s5p_gpioint = { 144 .name = "s5p_gpioint", 145 + .irq_ack = s5p_gpioint_ack, 146 + .irq_mask = s5p_gpioint_mask, 147 + .irq_mask_ack = s5p_gpioint_mask_ack, 148 + .irq_unmask = s5p_gpioint_unmask, 149 + .irq_set_type = s5p_gpioint_set_type, 150 }; 151 152 static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)
+3 -3
arch/arm/plat-s5p/irq-pm.c
··· 37 unsigned long s3c_irqwake_intallow = 0x00000006L; 38 unsigned long s3c_irqwake_eintallow = 0xffffffffL; 39 40 - int s3c_irq_wake(unsigned int irqno, unsigned int state) 41 { 42 unsigned long irqbit; 43 44 - switch (irqno) { 45 case IRQ_RTC_TIC: 46 case IRQ_RTC_ALARM: 47 - irqbit = 1 << (irqno + 1 - IRQ_RTC_ALARM); 48 if (!state) 49 s3c_irqwake_intmask |= irqbit; 50 else
··· 37 unsigned long s3c_irqwake_intallow = 0x00000006L; 38 unsigned long s3c_irqwake_eintallow = 0xffffffffL; 39 40 + int s3c_irq_wake(struct irq_data *data, unsigned int state) 41 { 42 unsigned long irqbit; 43 44 + switch (data->irq) { 45 case IRQ_RTC_TIC: 46 case IRQ_RTC_ALARM: 47 + irqbit = 1 << (data->irq + 1 - IRQ_RTC_ALARM); 48 if (!state) 49 s3c_irqwake_intmask |= irqbit; 50 else
+328
arch/arm/plat-s5p/sysmmu.c
···
··· 1 + /* linux/arch/arm/plat-s5p/sysmmu.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 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 + #include <linux/io.h> 12 + #include <linux/interrupt.h> 13 + #include <linux/platform_device.h> 14 + 15 + #include <mach/map.h> 16 + #include <mach/regs-sysmmu.h> 17 + #include <mach/sysmmu.h> 18 + 19 + #include <plat/sysmmu.h> 20 + 21 + struct sysmmu_controller s5p_sysmmu_cntlrs[S5P_SYSMMU_TOTAL_IPNUM]; 22 + 23 + void s5p_sysmmu_register(struct sysmmu_controller *sysmmuconp) 24 + { 25 + unsigned int reg_mmu_ctrl; 26 + unsigned int reg_mmu_status; 27 + unsigned int reg_pt_base_addr; 28 + unsigned int reg_int_status; 29 + unsigned int reg_page_ft_addr; 30 + 31 + reg_int_status = __raw_readl(sysmmuconp->regs + S5P_INT_STATUS); 32 + reg_mmu_ctrl = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 33 + reg_mmu_status = __raw_readl(sysmmuconp->regs + S5P_MMU_STATUS); 34 + reg_pt_base_addr = __raw_readl(sysmmuconp->regs + S5P_PT_BASE_ADDR); 35 + reg_page_ft_addr = __raw_readl(sysmmuconp->regs + S5P_PAGE_FAULT_ADDR); 36 + 37 + printk(KERN_INFO "%s: ips:%s\n", __func__, sysmmuconp->name); 38 + printk(KERN_INFO "%s: MMU_CTRL:0x%X, ", __func__, reg_mmu_ctrl); 39 + printk(KERN_INFO "MMU_STATUS:0x%X, PT_BASE_ADDR:0x%X\n", reg_mmu_status, reg_pt_base_addr); 40 + printk(KERN_INFO "%s: INT_STATUS:0x%X, PAGE_FAULT_ADDR:0x%X\n", __func__, reg_int_status, reg_page_ft_addr); 41 + 42 + switch (reg_int_status & 0xFF) { 43 + case 0x1: 44 + printk(KERN_INFO "%s: Page fault\n", __func__); 45 + printk(KERN_INFO "%s: Virtual address causing last page fault or bus error : 0x%x\n", __func__ , reg_page_ft_addr); 46 + break; 47 + case 0x2: 48 + printk(KERN_INFO "%s: AR multi-hit fault\n", __func__); 49 + break; 50 + case 0x4: 51 + printk(KERN_INFO "%s: AW multi-hit fault\n", __func__); 52 + break; 53 + case 0x8: 54 + printk(KERN_INFO "%s: Bus error\n", __func__); 55 + break; 56 + case 0x10: 57 + printk(KERN_INFO "%s: AR Security protection fault\n", __func__); 58 + break; 59 + case 0x20: 60 + printk(KERN_INFO "%s: AR Access protection fault\n", __func__); 61 + break; 62 + case 0x40: 63 + printk(KERN_INFO "%s: AW Security protection fault\n", __func__); 64 + break; 65 + case 0x80: 66 + printk(KERN_INFO "%s: AW Access protection fault\n", __func__); 67 + break; 68 + } 69 + } 70 + 71 + static irqreturn_t s5p_sysmmu_irq(int irq, void *dev_id) 72 + { 73 + unsigned int i; 74 + unsigned int reg_int_status; 75 + struct sysmmu_controller *sysmmuconp; 76 + 77 + for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) { 78 + sysmmuconp = &s5p_sysmmu_cntlrs[i]; 79 + 80 + if (sysmmuconp->enable == true) { 81 + reg_int_status = __raw_readl(sysmmuconp->regs + S5P_INT_STATUS); 82 + 83 + if (reg_int_status & 0xFF) 84 + s5p_sysmmu_register(sysmmuconp); 85 + } 86 + } 87 + return IRQ_HANDLED; 88 + } 89 + 90 + int s5p_sysmmu_set_tablebase_pgd(sysmmu_ips ips, unsigned long pgd) 91 + { 92 + struct sysmmu_controller *sysmmuconp = NULL; 93 + 94 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 95 + 96 + if (sysmmuconp == NULL) { 97 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 98 + return 1; 99 + } 100 + 101 + /* Set sysmmu page table base address */ 102 + __raw_writel(pgd, sysmmuconp->regs + S5P_PT_BASE_ADDR); 103 + 104 + if (s5p_sysmmu_tlb_invalidate(ips) != 0) 105 + printk(KERN_ERR "failed s5p_sysmmu_tlb_invalidate\n"); 106 + 107 + return 0; 108 + } 109 + 110 + static int s5p_sysmmu_set_tablebase(sysmmu_ips ips) 111 + { 112 + unsigned int pg; 113 + struct sysmmu_controller *sysmmuconp; 114 + 115 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 116 + 117 + if (sysmmuconp == NULL) { 118 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 119 + return 1; 120 + } 121 + 122 + __asm__("mrc p15, 0, %0, c2, c0, 0" \ 123 + : "=r" (pg) : : "cc"); \ 124 + pg &= ~0x3fff; 125 + 126 + sysmmu_debug("CP15 TTBR0 : 0x%x\n", pg); 127 + 128 + /* Set sysmmu page table base address */ 129 + __raw_writel(pg, sysmmuconp->regs + S5P_PT_BASE_ADDR); 130 + 131 + return 0; 132 + } 133 + 134 + int s5p_sysmmu_enable(sysmmu_ips ips) 135 + { 136 + unsigned int reg; 137 + 138 + struct sysmmu_controller *sysmmuconp; 139 + 140 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 141 + 142 + if (sysmmuconp == NULL) { 143 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 144 + return 1; 145 + } 146 + 147 + s5p_sysmmu_set_tablebase(ips); 148 + 149 + /* replacement policy : LRU */ 150 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CFG); 151 + reg |= 0x1; 152 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CFG); 153 + 154 + /* Enable interrupt, Enable MMU */ 155 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 156 + reg |= (0x1 << 2) | (0x1 << 0); 157 + 158 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 159 + 160 + sysmmuconp->enable = true; 161 + 162 + return 0; 163 + } 164 + 165 + int s5p_sysmmu_disable(sysmmu_ips ips) 166 + { 167 + unsigned int reg; 168 + 169 + struct sysmmu_controller *sysmmuconp = NULL; 170 + 171 + if (ips > S5P_SYSMMU_TOTAL_IPNUM) 172 + printk(KERN_ERR "failed to get ips parameter\n"); 173 + 174 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 175 + 176 + if (sysmmuconp == NULL) { 177 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 178 + return 1; 179 + } 180 + 181 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CFG); 182 + 183 + /* replacement policy : LRU */ 184 + reg |= 0x1; 185 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CFG); 186 + 187 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 188 + 189 + /* Disable MMU */ 190 + reg &= ~0x1; 191 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 192 + 193 + sysmmuconp->enable = false; 194 + 195 + return 0; 196 + } 197 + 198 + int s5p_sysmmu_tlb_invalidate(sysmmu_ips ips) 199 + { 200 + unsigned int reg; 201 + struct sysmmu_controller *sysmmuconp = NULL; 202 + 203 + sysmmuconp = &s5p_sysmmu_cntlrs[ips]; 204 + 205 + if (sysmmuconp == NULL) { 206 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 207 + return 1; 208 + } 209 + 210 + /* set Block MMU for flush TLB */ 211 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 212 + reg |= 0x1 << 1; 213 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 214 + 215 + /* flush all TLB entry */ 216 + __raw_writel(0x1, sysmmuconp->regs + S5P_MMU_FLUSH); 217 + 218 + /* set Un-block MMU after flush TLB */ 219 + reg = __raw_readl(sysmmuconp->regs + S5P_MMU_CTRL); 220 + reg &= ~(0x1 << 1); 221 + __raw_writel(reg, sysmmuconp->regs + S5P_MMU_CTRL); 222 + 223 + return 0; 224 + } 225 + 226 + static int s5p_sysmmu_probe(struct platform_device *pdev) 227 + { 228 + int i; 229 + int ret; 230 + struct resource *res; 231 + struct sysmmu_controller *sysmmuconp; 232 + sysmmu_ips ips; 233 + 234 + for (i = 0; i < S5P_SYSMMU_TOTAL_IPNUM; i++) { 235 + sysmmuconp = &s5p_sysmmu_cntlrs[i]; 236 + if (sysmmuconp == NULL) { 237 + printk(KERN_ERR "failed to get ip's sysmmu info\n"); 238 + ret = -ENOENT; 239 + goto err_res; 240 + } 241 + 242 + sysmmuconp->name = sysmmu_ips_name[i]; 243 + 244 + res = platform_get_resource(pdev, IORESOURCE_MEM, i); 245 + if (!res) { 246 + printk(KERN_ERR "failed to get sysmmu resource\n"); 247 + ret = -ENODEV; 248 + goto err_res; 249 + } 250 + 251 + sysmmuconp->mem = request_mem_region(res->start, 252 + ((res->end) - (res->start)) + 1, pdev->name); 253 + if (!sysmmuconp->mem) { 254 + pr_err("failed to request sysmmu memory region\n"); 255 + ret = -EBUSY; 256 + goto err_res; 257 + } 258 + 259 + sysmmuconp->regs = ioremap(res->start, res->end - res->start + 1); 260 + if (!sysmmuconp->regs) { 261 + pr_err("failed to sysmmu ioremap\n"); 262 + ret = -ENXIO; 263 + goto err_reg; 264 + } 265 + 266 + sysmmuconp->irq = platform_get_irq(pdev, i); 267 + if (sysmmuconp->irq <= 0) { 268 + pr_err("failed to get sysmmu irq resource\n"); 269 + ret = -ENOENT; 270 + goto err_map; 271 + } 272 + 273 + ret = request_irq(sysmmuconp->irq, s5p_sysmmu_irq, IRQF_DISABLED, pdev->name, sysmmuconp); 274 + if (ret) { 275 + pr_err("failed to request irq\n"); 276 + ret = -ENOENT; 277 + goto err_map; 278 + } 279 + 280 + ips = (sysmmu_ips)i; 281 + 282 + sysmmuconp->ips = ips; 283 + } 284 + 285 + return 0; 286 + 287 + err_reg: 288 + release_mem_region((resource_size_t)sysmmuconp->mem, (resource_size_t)((res->end) - (res->start) + 1)); 289 + err_map: 290 + iounmap(sysmmuconp->regs); 291 + err_res: 292 + return ret; 293 + } 294 + 295 + static int s5p_sysmmu_remove(struct platform_device *pdev) 296 + { 297 + return 0; 298 + } 299 + int s5p_sysmmu_runtime_suspend(struct device *dev) 300 + { 301 + return 0; 302 + } 303 + 304 + int s5p_sysmmu_runtime_resume(struct device *dev) 305 + { 306 + return 0; 307 + } 308 + 309 + const struct dev_pm_ops s5p_sysmmu_pm_ops = { 310 + .runtime_suspend = s5p_sysmmu_runtime_suspend, 311 + .runtime_resume = s5p_sysmmu_runtime_resume, 312 + }; 313 + 314 + static struct platform_driver s5p_sysmmu_driver = { 315 + .probe = s5p_sysmmu_probe, 316 + .remove = s5p_sysmmu_remove, 317 + .driver = { 318 + .owner = THIS_MODULE, 319 + .name = "s5p-sysmmu", 320 + .pm = &s5p_sysmmu_pm_ops, 321 + } 322 + }; 323 + 324 + static int __init s5p_sysmmu_init(void) 325 + { 326 + return platform_driver_register(&s5p_sysmmu_driver); 327 + } 328 + arch_initcall(s5p_sysmmu_init);
+14
arch/arm/plat-samsung/Kconfig
··· 95 help 96 Internal configuration to enable the correct GPIO pull helper 97 98 config S3C_GPIO_PULL_DOWN 99 bool 100 help ··· 338 Compile support for wakeup-mask controls found on the S3C6400 339 and above. This code allows a set of interrupt to wakeup-mask 340 mappings. See <plat/wakeup-mask.h> 341 342 endif
··· 95 help 96 Internal configuration to enable the correct GPIO pull helper 97 98 + config S3C_GPIO_PULL_S3C2443 99 + bool 100 + select S3C_GPIO_PULL_UPDOWN 101 + help 102 + Internal configuration to enable the correct GPIO pull helper for S3C2443-style GPIO 103 + 104 config S3C_GPIO_PULL_DOWN 105 bool 106 help ··· 332 Compile support for wakeup-mask controls found on the S3C6400 333 and above. This code allows a set of interrupt to wakeup-mask 334 mappings. See <plat/wakeup-mask.h> 335 + 336 + comment "Power Domain" 337 + 338 + config SAMSUNG_PD 339 + bool "Samsung Power Domain" 340 + depends on PM_RUNTIME 341 + help 342 + Say Y here if you want to control Power Domain by Runtime PM. 343 344 endif
+4
arch/arm/plat-samsung/Makefile
··· 74 75 obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o 76 77 # PWM support 78 79 obj-$(CONFIG_HAVE_PWM) += pwm.o
··· 74 75 obj-$(CONFIG_SAMSUNG_WAKEMASK) += wakeup-mask.o 76 77 + # PD support 78 + 79 + obj-$(CONFIG_SAMSUNG_PD) += pd.o 80 + 81 # PWM support 82 83 obj-$(CONFIG_HAVE_PWM) += pwm.o
+92
arch/arm/plat-samsung/clock.c
··· 39 #include <linux/clk.h> 40 #include <linux/spinlock.h> 41 #include <linux/io.h> 42 43 #include <mach/hardware.h> 44 #include <asm/irq.h> ··· 450 return 0; 451 } 452
··· 39 #include <linux/clk.h> 40 #include <linux/spinlock.h> 41 #include <linux/io.h> 42 + #if defined(CONFIG_DEBUG_FS) 43 + #include <linux/debugfs.h> 44 + #endif 45 46 #include <mach/hardware.h> 47 #include <asm/irq.h> ··· 447 return 0; 448 } 449 450 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 451 + /* debugfs support to trace clock tree hierarchy and attributes */ 452 + 453 + static struct dentry *clk_debugfs_root; 454 + 455 + static int clk_debugfs_register_one(struct clk *c) 456 + { 457 + int err; 458 + struct dentry *d, *child, *child_tmp; 459 + struct clk *pa = c->parent; 460 + char s[255]; 461 + char *p = s; 462 + 463 + p += sprintf(p, "%s", c->name); 464 + 465 + if (c->id >= 0) 466 + sprintf(p, ":%d", c->id); 467 + 468 + d = debugfs_create_dir(s, pa ? pa->dent : clk_debugfs_root); 469 + if (!d) 470 + return -ENOMEM; 471 + 472 + c->dent = d; 473 + 474 + d = debugfs_create_u8("usecount", S_IRUGO, c->dent, (u8 *)&c->usage); 475 + if (!d) { 476 + err = -ENOMEM; 477 + goto err_out; 478 + } 479 + 480 + d = debugfs_create_u32("rate", S_IRUGO, c->dent, (u32 *)&c->rate); 481 + if (!d) { 482 + err = -ENOMEM; 483 + goto err_out; 484 + } 485 + return 0; 486 + 487 + err_out: 488 + d = c->dent; 489 + list_for_each_entry_safe(child, child_tmp, &d->d_subdirs, d_u.d_child) 490 + debugfs_remove(child); 491 + debugfs_remove(c->dent); 492 + return err; 493 + } 494 + 495 + static int clk_debugfs_register(struct clk *c) 496 + { 497 + int err; 498 + struct clk *pa = c->parent; 499 + 500 + if (pa && !pa->dent) { 501 + err = clk_debugfs_register(pa); 502 + if (err) 503 + return err; 504 + } 505 + 506 + if (!c->dent) { 507 + err = clk_debugfs_register_one(c); 508 + if (err) 509 + return err; 510 + } 511 + return 0; 512 + } 513 + 514 + static int __init clk_debugfs_init(void) 515 + { 516 + struct clk *c; 517 + struct dentry *d; 518 + int err; 519 + 520 + d = debugfs_create_dir("clock", NULL); 521 + if (!d) 522 + return -ENOMEM; 523 + clk_debugfs_root = d; 524 + 525 + list_for_each_entry(c, &clocks, list) { 526 + err = clk_debugfs_register(c); 527 + if (err) 528 + goto err_out; 529 + } 530 + return 0; 531 + 532 + err_out: 533 + debugfs_remove_recursive(clk_debugfs_root); 534 + return err; 535 + } 536 + late_initcall(clk_debugfs_init); 537 + 538 + #endif /* defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) */
-2
arch/arm/plat-samsung/dev-nand.c
··· 126 127 s3c_device_nand.dev.platform_data = npd; 128 } 129 - 130 - EXPORT_SYMBOL_GPL(s3c_nand_set_platdata);
··· 126 127 s3c_device_nand.dev.platform_data = npd; 128 }
+42
arch/arm/plat-samsung/gpio-config.c
··· 278 pup &= 0x3; 279 return (__force s3c_gpio_pull_t)pup; 280 } 281 #endif 282 283 #if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN)
··· 278 pup &= 0x3; 279 return (__force s3c_gpio_pull_t)pup; 280 } 281 + 282 + #ifdef CONFIG_S3C_GPIO_PULL_S3C2443 283 + int s3c_gpio_setpull_s3c2443(struct s3c_gpio_chip *chip, 284 + unsigned int off, s3c_gpio_pull_t pull) 285 + { 286 + switch (pull) { 287 + case S3C_GPIO_PULL_NONE: 288 + pull = 0x01; 289 + break; 290 + case S3C_GPIO_PULL_UP: 291 + pull = 0x00; 292 + break; 293 + case S3C_GPIO_PULL_DOWN: 294 + pull = 0x02; 295 + break; 296 + } 297 + return s3c_gpio_setpull_updown(chip, off, pull); 298 + } 299 + 300 + s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip, 301 + unsigned int off) 302 + { 303 + s3c_gpio_pull_t pull; 304 + 305 + pull = s3c_gpio_getpull_updown(chip, off); 306 + 307 + switch (pull) { 308 + case 0x00: 309 + pull = S3C_GPIO_PULL_UP; 310 + break; 311 + case 0x01: 312 + case 0x03: 313 + pull = S3C_GPIO_PULL_NONE; 314 + break; 315 + case 0x02: 316 + pull = S3C_GPIO_PULL_DOWN; 317 + break; 318 + } 319 + 320 + return pull; 321 + } 322 + #endif 323 #endif 324 325 #if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN)
+7
arch/arm/plat-samsung/gpiolib.c
··· 197 s3c_gpiolib_add(chip); 198 } 199 }
··· 197 s3c_gpiolib_add(chip); 198 } 199 } 200 + 201 + void __init samsung_gpiolib_add_2bit_chips(struct s3c_gpio_chip *chip, 202 + int nr_chips) 203 + { 204 + for (; nr_chips > 0; nr_chips--, chip++) 205 + s3c_gpiolib_add(chip); 206 + }
+3
arch/arm/plat-samsung/include/plat/clock.h
··· 47 48 struct clk_ops *ops; 49 int (*enable)(struct clk *, int enable); 50 }; 51 52 /* other clocks which may be registered by board support */
··· 47 48 struct clk_ops *ops; 49 int (*enable)(struct clk *, int enable); 50 + #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) 51 + struct dentry *dent; /* For visible tree hierarchy */ 52 + #endif 53 }; 54 55 /* other clocks which may be registered by board support */
+8
arch/arm/plat-samsung/include/plat/devs.h
··· 104 extern struct platform_device s5pv310_device_i2s1; 105 extern struct platform_device s5pv310_device_i2s2; 106 extern struct platform_device s5pv310_device_spdif; 107 108 extern struct platform_device s5p6442_device_pcm0; 109 extern struct platform_device s5p6442_device_pcm1; ··· 116 extern struct platform_device s5p6440_device_iis; 117 118 extern struct platform_device s5p6450_device_iis0; 119 extern struct platform_device s5p6450_device_pcm0; 120 121 extern struct platform_device s5pc100_device_ac97; ··· 133 extern struct platform_device s5p_device_fimc0; 134 extern struct platform_device s5p_device_fimc1; 135 extern struct platform_device s5p_device_fimc2; 136 137 /* s3c2440 specific devices */ 138
··· 104 extern struct platform_device s5pv310_device_i2s1; 105 extern struct platform_device s5pv310_device_i2s2; 106 extern struct platform_device s5pv310_device_spdif; 107 + extern struct platform_device s5pv310_device_pd[]; 108 109 extern struct platform_device s5p6442_device_pcm0; 110 extern struct platform_device s5p6442_device_pcm1; ··· 115 extern struct platform_device s5p6440_device_iis; 116 117 extern struct platform_device s5p6450_device_iis0; 118 + extern struct platform_device s5p6450_device_iis1; 119 + extern struct platform_device s5p6450_device_iis2; 120 extern struct platform_device s5p6450_device_pcm0; 121 122 extern struct platform_device s5pc100_device_ac97; ··· 130 extern struct platform_device s5p_device_fimc0; 131 extern struct platform_device s5p_device_fimc1; 132 extern struct platform_device s5p_device_fimc2; 133 + 134 + extern struct platform_device s5p_device_mipi_csis0; 135 + extern struct platform_device s5p_device_mipi_csis1; 136 + 137 + extern struct platform_device s5pv310_device_sysmmu; 138 139 /* s3c2440 specific devices */ 140
+1 -1
arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h
··· 244 * This helper function reads the state of the pull-{up,down} resistor for the 245 * given GPIO in the same case as s3c_gpio_setpull_upown. 246 */ 247 - extern s3c_gpio_pull_t s3c_gpio_getpull_s3c24xx(struct s3c_gpio_chip *chip, 248 unsigned int off); 249 250 #endif /* __PLAT_GPIO_CFG_HELPERS_H */
··· 244 * This helper function reads the state of the pull-{up,down} resistor for the 245 * given GPIO in the same case as s3c_gpio_setpull_upown. 246 */ 247 + extern s3c_gpio_pull_t s3c_gpio_getpull_s3c2443(struct s3c_gpio_chip *chip, 248 unsigned int off); 249 250 #endif /* __PLAT_GPIO_CFG_HELPERS_H */
+2
arch/arm/plat-samsung/include/plat/gpio-core.h
··· 118 int nr_chips); 119 extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip, 120 int nr_chips); 121 122 extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); 123 extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
··· 118 int nr_chips); 119 extern void samsung_gpiolib_add_4bit2_chips(struct s3c_gpio_chip *chip, 120 int nr_chips); 121 + extern void samsung_gpiolib_add_2bit_chips(struct s3c_gpio_chip *chip, 122 + int nr_chips); 123 124 extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip); 125 extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);
+30
arch/arm/plat-samsung/include/plat/pd.h
···
··· 1 + /* linux/arch/arm/plat-samsung/include/plat/pd.h 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 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 + #ifndef __ASM_PLAT_SAMSUNG_PD_H 12 + #define __ASM_PLAT_SAMSUNG_PD_H __FILE__ 13 + 14 + struct samsung_pd_info { 15 + int (*enable)(struct device *dev); 16 + int (*disable)(struct device *dev); 17 + void __iomem *base; 18 + }; 19 + 20 + enum s5pv310_pd_block { 21 + PD_MFC, 22 + PD_G3D, 23 + PD_LCD0, 24 + PD_LCD1, 25 + PD_TV, 26 + PD_CAM, 27 + PD_GPS 28 + }; 29 + 30 + #endif /* __ASM_PLAT_SAMSUNG_PD_H */
+3 -1
arch/arm/plat-samsung/include/plat/pm.h
··· 15 * management 16 */ 17 18 #ifdef CONFIG_PM 19 20 extern __init int s3c_pm_init(void); ··· 102 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); 103 104 #ifdef CONFIG_PM 105 - extern int s3c_irqext_wake(unsigned int irqno, unsigned int state); 106 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); 107 extern int s3c24xx_irq_resume(struct sys_device *dev); 108 #else
··· 15 * management 16 */ 17 18 + #include <linux/irq.h> 19 + 20 #ifdef CONFIG_PM 21 22 extern __init int s3c_pm_init(void); ··· 100 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count); 101 102 #ifdef CONFIG_PM 103 + extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); 104 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); 105 extern int s3c24xx_irq_resume(struct sys_device *dev); 106 #else
+35
arch/arm/plat-samsung/include/plat/sdhci.h
··· 107 108 /* Helper function availablity */ 109 110 extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 111 extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 112 extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); ··· 124 extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 125 extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w); 126 127 /* S3C64XX SDHCI setup */ 128 129 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
··· 107 108 /* Helper function availablity */ 109 110 + extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 111 + extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 112 extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w); 113 extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w); 114 extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w); ··· 122 extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w); 123 extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w); 124 125 + /* S3C2416 SDHCI setup */ 126 + 127 + #ifdef CONFIG_S3C2416_SETUP_SDHCI 128 + extern char *s3c2416_hsmmc_clksrcs[4]; 129 + 130 + extern void s3c2416_setup_sdhci_cfg_card(struct platform_device *dev, 131 + void __iomem *r, 132 + struct mmc_ios *ios, 133 + struct mmc_card *card); 134 + 135 + static inline void s3c2416_default_sdhci0(void) 136 + { 137 + #ifdef CONFIG_S3C_DEV_HSMMC 138 + s3c_hsmmc0_def_platdata.clocks = s3c2416_hsmmc_clksrcs; 139 + s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio; 140 + s3c_hsmmc0_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card; 141 + #endif /* CONFIG_S3C_DEV_HSMMC */ 142 + } 143 + 144 + static inline void s3c2416_default_sdhci1(void) 145 + { 146 + #ifdef CONFIG_S3C_DEV_HSMMC1 147 + s3c_hsmmc1_def_platdata.clocks = s3c2416_hsmmc_clksrcs; 148 + s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio; 149 + s3c_hsmmc1_def_platdata.cfg_card = s3c2416_setup_sdhci_cfg_card; 150 + #endif /* CONFIG_S3C_DEV_HSMMC1 */ 151 + } 152 + 153 + #else 154 + static inline void s3c2416_default_sdhci0(void) { } 155 + static inline void s3c2416_default_sdhci1(void) { } 156 + 157 + #endif /* CONFIG_S3C2416_SETUP_SDHCI */ 158 /* S3C64XX SDHCI setup */ 159 160 #ifdef CONFIG_S3C64XX_SETUP_SDHCI
+20 -20
arch/arm/plat-samsung/irq-uart.c
··· 28 * are consecutive when looking up the interrupt in the demux routines. 29 */ 30 31 - static inline void __iomem *s3c_irq_uart_base(unsigned int irq) 32 { 33 - struct s3c_uart_irq *uirq = get_irq_chip_data(irq); 34 return uirq->regs; 35 } 36 ··· 39 return irq & 3; 40 } 41 42 - static void s3c_irq_uart_mask(unsigned int irq) 43 { 44 - void __iomem *regs = s3c_irq_uart_base(irq); 45 - unsigned int bit = s3c_irq_uart_bit(irq); 46 u32 reg; 47 48 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 50 __raw_writel(reg, regs + S3C64XX_UINTM); 51 } 52 53 - static void s3c_irq_uart_maskack(unsigned int irq) 54 { 55 - void __iomem *regs = s3c_irq_uart_base(irq); 56 - unsigned int bit = s3c_irq_uart_bit(irq); 57 u32 reg; 58 59 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 62 __raw_writel(1 << bit, regs + S3C64XX_UINTP); 63 } 64 65 - static void s3c_irq_uart_unmask(unsigned int irq) 66 { 67 - void __iomem *regs = s3c_irq_uart_base(irq); 68 - unsigned int bit = s3c_irq_uart_bit(irq); 69 u32 reg; 70 71 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 73 __raw_writel(reg, regs + S3C64XX_UINTM); 74 } 75 76 - static void s3c_irq_uart_ack(unsigned int irq) 77 { 78 - void __iomem *regs = s3c_irq_uart_base(irq); 79 - unsigned int bit = s3c_irq_uart_bit(irq); 80 81 __raw_writel(1 << bit, regs + S3C64XX_UINTP); 82 } 83 84 static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc) 85 { 86 - struct s3c_uart_irq *uirq = desc->handler_data; 87 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP); 88 int base = uirq->base_irq; 89 ··· 99 100 static struct irq_chip s3c_irq_uart = { 101 .name = "s3c-uart", 102 - .mask = s3c_irq_uart_mask, 103 - .unmask = s3c_irq_uart_unmask, 104 - .mask_ack = s3c_irq_uart_maskack, 105 - .ack = s3c_irq_uart_ack, 106 }; 107 108 static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq) ··· 124 set_irq_flags(irq, IRQF_VALID); 125 } 126 127 - desc->handler_data = uirq; 128 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart); 129 } 130
··· 28 * are consecutive when looking up the interrupt in the demux routines. 29 */ 30 31 + static inline void __iomem *s3c_irq_uart_base(struct irq_data *data) 32 { 33 + struct s3c_uart_irq *uirq = irq_data_get_irq_chip_data(data); 34 return uirq->regs; 35 } 36 ··· 39 return irq & 3; 40 } 41 42 + static void s3c_irq_uart_mask(struct irq_data *data) 43 { 44 + void __iomem *regs = s3c_irq_uart_base(data); 45 + unsigned int bit = s3c_irq_uart_bit(data->irq); 46 u32 reg; 47 48 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 50 __raw_writel(reg, regs + S3C64XX_UINTM); 51 } 52 53 + static void s3c_irq_uart_maskack(struct irq_data *data) 54 { 55 + void __iomem *regs = s3c_irq_uart_base(data); 56 + unsigned int bit = s3c_irq_uart_bit(data->irq); 57 u32 reg; 58 59 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 62 __raw_writel(1 << bit, regs + S3C64XX_UINTP); 63 } 64 65 + static void s3c_irq_uart_unmask(struct irq_data *data) 66 { 67 + void __iomem *regs = s3c_irq_uart_base(data); 68 + unsigned int bit = s3c_irq_uart_bit(data->irq); 69 u32 reg; 70 71 reg = __raw_readl(regs + S3C64XX_UINTM); ··· 73 __raw_writel(reg, regs + S3C64XX_UINTM); 74 } 75 76 + static void s3c_irq_uart_ack(struct irq_data *data) 77 { 78 + void __iomem *regs = s3c_irq_uart_base(data); 79 + unsigned int bit = s3c_irq_uart_bit(data->irq); 80 81 __raw_writel(1 << bit, regs + S3C64XX_UINTP); 82 } 83 84 static void s3c_irq_demux_uart(unsigned int irq, struct irq_desc *desc) 85 { 86 + struct s3c_uart_irq *uirq = desc->irq_data.handler_data; 87 u32 pend = __raw_readl(uirq->regs + S3C64XX_UINTP); 88 int base = uirq->base_irq; 89 ··· 99 100 static struct irq_chip s3c_irq_uart = { 101 .name = "s3c-uart", 102 + .irq_mask = s3c_irq_uart_mask, 103 + .irq_unmask = s3c_irq_uart_unmask, 104 + .irq_mask_ack = s3c_irq_uart_maskack, 105 + .irq_ack = s3c_irq_uart_ack, 106 }; 107 108 static void __init s3c_init_uart_irq(struct s3c_uart_irq *uirq) ··· 124 set_irq_flags(irq, IRQF_VALID); 125 } 126 127 + desc->irq_data.handler_data = uirq; 128 set_irq_chained_handler(uirq->parent_irq, s3c_irq_demux_uart); 129 } 130
+15 -11
arch/arm/plat-samsung/irq-vic-timer.c
··· 24 25 static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) 26 { 27 - generic_handle_irq((int)desc->handler_data); 28 } 29 30 /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ 31 32 - static void s3c_irq_timer_mask(unsigned int irq) 33 { 34 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 35 36 reg &= 0x1f; /* mask out pending interrupts */ 37 - reg &= ~(1 << (irq - IRQ_TIMER0)); 38 __raw_writel(reg, S3C64XX_TINT_CSTAT); 39 } 40 41 - static void s3c_irq_timer_unmask(unsigned int irq) 42 { 43 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 44 45 reg &= 0x1f; /* mask out pending interrupts */ 46 - reg |= 1 << (irq - IRQ_TIMER0); 47 __raw_writel(reg, S3C64XX_TINT_CSTAT); 48 } 49 50 - static void s3c_irq_timer_ack(unsigned int irq) 51 { 52 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 53 54 reg &= 0x1f; 55 - reg |= (1 << 5) << (irq - IRQ_TIMER0); 56 __raw_writel(reg, S3C64XX_TINT_CSTAT); 57 } 58 59 static struct irq_chip s3c_irq_timer = { 60 .name = "s3c-timer", 61 - .mask = s3c_irq_timer_mask, 62 - .unmask = s3c_irq_timer_unmask, 63 - .ack = s3c_irq_timer_ack, 64 }; 65 66 /** ··· 82 set_irq_chained_handler(parent_irq, s3c_irq_demux_vic_timer); 83 84 set_irq_chip(timer_irq, &s3c_irq_timer); 85 set_irq_handler(timer_irq, handle_level_irq); 86 set_irq_flags(timer_irq, IRQF_VALID); 87 88 - desc->handler_data = (void *)timer_irq; 89 }
··· 24 25 static void s3c_irq_demux_vic_timer(unsigned int irq, struct irq_desc *desc) 26 { 27 + generic_handle_irq((int)desc->irq_data.handler_data); 28 } 29 30 /* We assume the IRQ_TIMER0..IRQ_TIMER4 range is continuous. */ 31 32 + static void s3c_irq_timer_mask(struct irq_data *data) 33 { 34 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 35 + u32 mask = (u32)data->chip_data; 36 37 reg &= 0x1f; /* mask out pending interrupts */ 38 + reg &= ~mask; 39 __raw_writel(reg, S3C64XX_TINT_CSTAT); 40 } 41 42 + static void s3c_irq_timer_unmask(struct irq_data *data) 43 { 44 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 45 + u32 mask = (u32)data->chip_data; 46 47 reg &= 0x1f; /* mask out pending interrupts */ 48 + reg |= mask; 49 __raw_writel(reg, S3C64XX_TINT_CSTAT); 50 } 51 52 + static void s3c_irq_timer_ack(struct irq_data *data) 53 { 54 u32 reg = __raw_readl(S3C64XX_TINT_CSTAT); 55 + u32 mask = (u32)data->chip_data; 56 57 reg &= 0x1f; 58 + reg |= mask << 5; 59 __raw_writel(reg, S3C64XX_TINT_CSTAT); 60 } 61 62 static struct irq_chip s3c_irq_timer = { 63 .name = "s3c-timer", 64 + .irq_mask = s3c_irq_timer_mask, 65 + .irq_unmask = s3c_irq_timer_unmask, 66 + .irq_ack = s3c_irq_timer_ack, 67 }; 68 69 /** ··· 79 set_irq_chained_handler(parent_irq, s3c_irq_demux_vic_timer); 80 81 set_irq_chip(timer_irq, &s3c_irq_timer); 82 + set_irq_chip_data(timer_irq, (void *)(1 << (timer_irq - IRQ_TIMER0))); 83 set_irq_handler(timer_irq, handle_level_irq); 84 set_irq_flags(timer_irq, IRQF_VALID); 85 86 + desc->irq_data.handler_data = (void *)timer_irq; 87 }
+95
arch/arm/plat-samsung/pd.c
···
··· 1 + /* linux/arch/arm/plat-samsung/pd.c 2 + * 3 + * Copyright (c) 2010 Samsung Electronics Co., Ltd. 4 + * http://www.samsung.com 5 + * 6 + * Samsung Power domain support 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + */ 12 + 13 + #include <linux/init.h> 14 + #include <linux/module.h> 15 + #include <linux/platform_device.h> 16 + #include <linux/err.h> 17 + #include <linux/pm_runtime.h> 18 + 19 + #include <plat/pd.h> 20 + 21 + static int samsung_pd_probe(struct platform_device *pdev) 22 + { 23 + struct samsung_pd_info *pdata = pdev->dev.platform_data; 24 + struct device *dev = &pdev->dev; 25 + 26 + if (!pdata) { 27 + dev_err(dev, "no device data specified\n"); 28 + return -ENOENT; 29 + } 30 + 31 + pm_runtime_set_active(dev); 32 + pm_runtime_enable(dev); 33 + 34 + dev_info(dev, "power domain registered\n"); 35 + return 0; 36 + } 37 + 38 + static int __devexit samsung_pd_remove(struct platform_device *pdev) 39 + { 40 + struct device *dev = &pdev->dev; 41 + 42 + pm_runtime_disable(dev); 43 + return 0; 44 + } 45 + 46 + static int samsung_pd_runtime_suspend(struct device *dev) 47 + { 48 + struct samsung_pd_info *pdata = dev->platform_data; 49 + int ret = 0; 50 + 51 + if (pdata->disable) 52 + ret = pdata->disable(dev); 53 + 54 + dev_dbg(dev, "suspended\n"); 55 + return ret; 56 + } 57 + 58 + static int samsung_pd_runtime_resume(struct device *dev) 59 + { 60 + struct samsung_pd_info *pdata = dev->platform_data; 61 + int ret = 0; 62 + 63 + if (pdata->enable) 64 + ret = pdata->enable(dev); 65 + 66 + dev_dbg(dev, "resumed\n"); 67 + return ret; 68 + } 69 + 70 + static const struct dev_pm_ops samsung_pd_pm_ops = { 71 + .runtime_suspend = samsung_pd_runtime_suspend, 72 + .runtime_resume = samsung_pd_runtime_resume, 73 + }; 74 + 75 + static struct platform_driver samsung_pd_driver = { 76 + .driver = { 77 + .name = "samsung-pd", 78 + .owner = THIS_MODULE, 79 + .pm = &samsung_pd_pm_ops, 80 + }, 81 + .probe = samsung_pd_probe, 82 + .remove = __devexit_p(samsung_pd_remove), 83 + }; 84 + 85 + static int __init samsung_pd_init(void) 86 + { 87 + int ret; 88 + 89 + ret = platform_driver_register(&samsung_pd_driver); 90 + if (ret) 91 + printk(KERN_ERR "%s: failed to add PD driver\n", __func__); 92 + 93 + return ret; 94 + } 95 + arch_initcall(samsung_pd_init);
+3 -3
arch/arm/plat-samsung/pm.c
··· 136 unsigned long s3c_irqwake_intmask = 0xffffffffL; 137 unsigned long s3c_irqwake_eintmask = 0xffffffffL; 138 139 - int s3c_irqext_wake(unsigned int irqno, unsigned int state) 140 { 141 - unsigned long bit = 1L << IRQ_EINT_BIT(irqno); 142 143 if (!(s3c_irqwake_eintallow & bit)) 144 return -ENOENT; 145 146 printk(KERN_INFO "wake %s for irq %d\n", 147 - state ? "enabled" : "disabled", irqno); 148 149 if (!state) 150 s3c_irqwake_eintmask |= bit;
··· 136 unsigned long s3c_irqwake_intmask = 0xffffffffL; 137 unsigned long s3c_irqwake_eintmask = 0xffffffffL; 138 139 + int s3c_irqext_wake(struct irq_data *data, unsigned int state) 140 { 141 + unsigned long bit = 1L << IRQ_EINT_BIT(data->irq); 142 143 if (!(s3c_irqwake_eintallow & bit)) 144 return -ENOENT; 145 146 printk(KERN_INFO "wake %s for irq %d\n", 147 + state ? "enabled" : "disabled", data->irq); 148 149 if (!state) 150 s3c_irqwake_eintmask |= bit;
+11 -11
arch/arm/plat-spear/shirq.c
··· 20 struct spear_shirq *shirq; 21 static DEFINE_SPINLOCK(lock); 22 23 - static void shirq_irq_mask(unsigned irq) 24 { 25 - struct spear_shirq *shirq = get_irq_chip_data(irq); 26 - u32 val, id = irq - shirq->dev_config[0].virq; 27 unsigned long flags; 28 29 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) ··· 39 spin_unlock_irqrestore(&lock, flags); 40 } 41 42 - static void shirq_irq_unmask(unsigned irq) 43 { 44 - struct spear_shirq *shirq = get_irq_chip_data(irq); 45 - u32 val, id = irq - shirq->dev_config[0].virq; 46 unsigned long flags; 47 48 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) ··· 60 61 static struct irq_chip shirq_chip = { 62 .name = "spear_shirq", 63 - .ack = shirq_irq_mask, 64 - .mask = shirq_irq_mask, 65 - .unmask = shirq_irq_unmask, 66 }; 67 68 static void shirq_handler(unsigned irq, struct irq_desc *desc) ··· 70 u32 i, val, mask; 71 struct spear_shirq *shirq = get_irq_data(irq); 72 73 - desc->chip->ack(irq); 74 while ((val = readl(shirq->regs.base + shirq->regs.status_reg) & 75 shirq->regs.status_reg_mask)) { 76 for (i = 0; (i < shirq->dev_count) && val; i++) { ··· 92 writel(mask, shirq->regs.base + shirq->regs.clear_reg); 93 } 94 } 95 - desc->chip->unmask(irq); 96 } 97 98 int spear_shirq_register(struct spear_shirq *shirq)
··· 20 struct spear_shirq *shirq; 21 static DEFINE_SPINLOCK(lock); 22 23 + static void shirq_irq_mask(struct irq_data *d) 24 { 25 + struct spear_shirq *shirq = irq_data_get_irq_chip_data(d); 26 + u32 val, id = d->irq - shirq->dev_config[0].virq; 27 unsigned long flags; 28 29 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) ··· 39 spin_unlock_irqrestore(&lock, flags); 40 } 41 42 + static void shirq_irq_unmask(struct irq_data *d) 43 { 44 + struct spear_shirq *shirq = irq_data_get_irq_chip_data(d); 45 + u32 val, id = d->irq - shirq->dev_config[0].virq; 46 unsigned long flags; 47 48 if ((shirq->regs.enb_reg == -1) || shirq->dev_config[id].enb_mask == -1) ··· 60 61 static struct irq_chip shirq_chip = { 62 .name = "spear_shirq", 63 + .irq_ack = shirq_irq_mask, 64 + .irq_mask = shirq_irq_mask, 65 + .irq_unmask = shirq_irq_unmask, 66 }; 67 68 static void shirq_handler(unsigned irq, struct irq_desc *desc) ··· 70 u32 i, val, mask; 71 struct spear_shirq *shirq = get_irq_data(irq); 72 73 + desc->irq_data.chip->irq_ack(&desc->irq_data); 74 while ((val = readl(shirq->regs.base + shirq->regs.status_reg) & 75 shirq->regs.status_reg_mask)) { 76 for (i = 0; (i < shirq->dev_count) && val; i++) { ··· 92 writel(mask, shirq->regs.base + shirq->regs.clear_reg); 93 } 94 } 95 + desc->irq_data.chip->irq_unmask(&desc->irq_data); 96 } 97 98 int spear_shirq_register(struct spear_shirq *shirq)
+1 -1
arch/arm/plat-stmp3xxx/irq.c
··· 34 35 /* Disable all interrupts initially */ 36 for (i = 0; i < NR_REAL_IRQS; i++) { 37 - chip->mask(i); 38 set_irq_chip(i, chip); 39 set_irq_handler(i, handle_level_irq); 40 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
··· 34 35 /* Disable all interrupts initially */ 36 for (i = 0; i < NR_REAL_IRQS; i++) { 37 + chip->irq_mask(irq_get_irq_data(i)); 38 set_irq_chip(i, chip); 39 set_irq_handler(i, handle_level_irq); 40 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
+16 -16
arch/arm/plat-stmp3xxx/pinmux.c
··· 351 } 352 EXPORT_SYMBOL(stmp3xxx_release_pin_group); 353 354 - static int stmp3xxx_irq_to_gpio(int irq, 355 struct stmp3xxx_pinmux_bank **bank, unsigned *gpio) 356 { 357 struct stmp3xxx_pinmux_bank *pm; 358 359 for (pm = pinmux_banks; pm < pinmux_banks + NR_BANKS; pm++) 360 - if (pm->virq <= irq && irq < pm->virq + 32) { 361 *bank = pm; 362 - *gpio = irq - pm->virq; 363 return 0; 364 } 365 return -ENOENT; 366 } 367 368 - static int stmp3xxx_set_irqtype(unsigned irq, unsigned type) 369 { 370 struct stmp3xxx_pinmux_bank *pm; 371 unsigned gpio; 372 int l, p; 373 374 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 375 switch (type) { 376 case IRQ_TYPE_EDGE_RISING: 377 l = 0; p = 1; break; ··· 398 return 0; 399 } 400 401 - static void stmp3xxx_pin_ack_irq(unsigned irq) 402 { 403 u32 stat; 404 struct stmp3xxx_pinmux_bank *pm; 405 unsigned gpio; 406 407 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 408 stat = __raw_readl(pm->irqstat) & (1 << gpio); 409 stmp3xxx_clearl(stat, pm->irqstat); 410 } 411 412 - static void stmp3xxx_pin_mask_irq(unsigned irq) 413 { 414 struct stmp3xxx_pinmux_bank *pm; 415 unsigned gpio; 416 417 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 418 stmp3xxx_clearl(1 << gpio, pm->irqen); 419 stmp3xxx_clearl(1 << gpio, pm->pin2irq); 420 } 421 422 - static void stmp3xxx_pin_unmask_irq(unsigned irq) 423 { 424 struct stmp3xxx_pinmux_bank *pm; 425 unsigned gpio; 426 427 - stmp3xxx_irq_to_gpio(irq, &pm, &gpio); 428 stmp3xxx_setl(1 << gpio, pm->irqen); 429 stmp3xxx_setl(1 << gpio, pm->pin2irq); 430 } ··· 503 } 504 505 static struct irq_chip gpio_irq_chip = { 506 - .ack = stmp3xxx_pin_ack_irq, 507 - .mask = stmp3xxx_pin_mask_irq, 508 - .unmask = stmp3xxx_pin_unmask_irq, 509 - .set_type = stmp3xxx_set_irqtype, 510 }; 511 512 int __init stmp3xxx_pinmux_init(int virtual_irq_start) ··· 533 pm->virq = virtual_irq_start + b * 32; 534 535 for (virq = pm->virq; virq < pm->virq; virq++) { 536 - gpio_irq_chip.mask(virq); 537 set_irq_chip(virq, &gpio_irq_chip); 538 set_irq_handler(virq, handle_level_irq); 539 set_irq_flags(virq, IRQF_VALID);
··· 351 } 352 EXPORT_SYMBOL(stmp3xxx_release_pin_group); 353 354 + static int stmp3xxx_irq_data_to_gpio(struct irq_data *d, 355 struct stmp3xxx_pinmux_bank **bank, unsigned *gpio) 356 { 357 struct stmp3xxx_pinmux_bank *pm; 358 359 for (pm = pinmux_banks; pm < pinmux_banks + NR_BANKS; pm++) 360 + if (pm->virq <= d->irq && d->irq < pm->virq + 32) { 361 *bank = pm; 362 + *gpio = d->irq - pm->virq; 363 return 0; 364 } 365 return -ENOENT; 366 } 367 368 + static int stmp3xxx_set_irqtype(struct irq_data *d, unsigned type) 369 { 370 struct stmp3xxx_pinmux_bank *pm; 371 unsigned gpio; 372 int l, p; 373 374 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 375 switch (type) { 376 case IRQ_TYPE_EDGE_RISING: 377 l = 0; p = 1; break; ··· 398 return 0; 399 } 400 401 + static void stmp3xxx_pin_ack_irq(struct irq_data *d) 402 { 403 u32 stat; 404 struct stmp3xxx_pinmux_bank *pm; 405 unsigned gpio; 406 407 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 408 stat = __raw_readl(pm->irqstat) & (1 << gpio); 409 stmp3xxx_clearl(stat, pm->irqstat); 410 } 411 412 + static void stmp3xxx_pin_mask_irq(struct irq_data *d) 413 { 414 struct stmp3xxx_pinmux_bank *pm; 415 unsigned gpio; 416 417 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 418 stmp3xxx_clearl(1 << gpio, pm->irqen); 419 stmp3xxx_clearl(1 << gpio, pm->pin2irq); 420 } 421 422 + static void stmp3xxx_pin_unmask_irq(struct irq_data *d) 423 { 424 struct stmp3xxx_pinmux_bank *pm; 425 unsigned gpio; 426 427 + stmp3xxx_irq_data_to_gpio(d, &pm, &gpio); 428 stmp3xxx_setl(1 << gpio, pm->irqen); 429 stmp3xxx_setl(1 << gpio, pm->pin2irq); 430 } ··· 503 } 504 505 static struct irq_chip gpio_irq_chip = { 506 + .irq_ack = stmp3xxx_pin_ack_irq, 507 + .irq_mask = stmp3xxx_pin_mask_irq, 508 + .irq_unmask = stmp3xxx_pin_unmask_irq, 509 + .irq_set_type = stmp3xxx_set_irqtype, 510 }; 511 512 int __init stmp3xxx_pinmux_init(int virtual_irq_start) ··· 533 pm->virq = virtual_irq_start + b * 32; 534 535 for (virq = pm->virq; virq < pm->virq; virq++) { 536 + gpio_irq_chip.irq_mask(irq_get_irq_data(virq)); 537 set_irq_chip(virq, &gpio_irq_chip); 538 set_irq_handler(virq, handle_level_irq); 539 set_irq_flags(virq, IRQF_VALID);
+2 -2
drivers/serial/samsung.c
··· 883 884 static struct uart_driver s3c24xx_uart_drv = { 885 .owner = THIS_MODULE, 886 - .dev_name = "s3c2410_serial", 887 .nr = CONFIG_SERIAL_SAMSUNG_UARTS, 888 .cons = S3C24XX_SERIAL_CONSOLE, 889 - .driver_name = S3C24XX_SERIAL_NAME, 890 .major = S3C24XX_SERIAL_MAJOR, 891 .minor = S3C24XX_SERIAL_MINOR, 892 };
··· 883 884 static struct uart_driver s3c24xx_uart_drv = { 885 .owner = THIS_MODULE, 886 + .driver_name = "s3c2410_serial", 887 .nr = CONFIG_SERIAL_SAMSUNG_UARTS, 888 .cons = S3C24XX_SERIAL_CONSOLE, 889 + .dev_name = S3C24XX_SERIAL_NAME, 890 .major = S3C24XX_SERIAL_MAJOR, 891 .minor = S3C24XX_SERIAL_MINOR, 892 };