diff options
author | Ben Dooks <ben-linux@fluff.org> | 2009-08-14 10:23:34 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2009-08-14 10:23:34 -0400 |
commit | 0fbdd270078a3e3ce537a2fb6ffc8a9b2427500c (patch) | |
tree | b75f47e26372ffa2374b744a6991144032eea6ef /arch | |
parent | 69e372896791c2e43949b32d4cbe8a714961d3d7 (diff) | |
parent | a2c195fdde20772a90ee98ce3523dcfbda49eee6 (diff) |
Merge branch 'next-s3c24xx' into next-s3c
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/irqs.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/regs-gpio.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/include/mach/spi.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/devs.h | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/Kconfig | 6 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/devs.c | 50 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/include/plat/fiq.h | 13 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/irq.c | 36 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c | 38 |
10 files changed, 157 insertions, 1 deletions
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h index 2a2384ffa7b1..6c12c6312ad8 100644 --- a/arch/arm/mach-s3c2410/include/mach/irqs.h +++ b/arch/arm/mach-s3c2410/include/mach/irqs.h | |||
@@ -164,6 +164,12 @@ | |||
164 | #define IRQ_S3CUART_TX3 IRQ_S3C2443_TX3 | 164 | #define IRQ_S3CUART_TX3 IRQ_S3C2443_TX3 |
165 | #define IRQ_S3CUART_ERR3 IRQ_S3C2443_ERR3 | 165 | #define IRQ_S3CUART_ERR3 IRQ_S3C2443_ERR3 |
166 | 166 | ||
167 | #ifdef CONFIG_CPU_S3C2440 | ||
168 | #define IRQ_S3C244x_AC97 IRQ_S3C2440_AC97 | ||
169 | #else | ||
170 | #define IRQ_S3C244x_AC97 IRQ_S3C2443_AC97 | ||
171 | #endif | ||
172 | |||
167 | /* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */ | 173 | /* Our FIQs are routable from IRQ_EINT0 to IRQ_ADCPARENT */ |
168 | #define FIQ_START IRQ_EINT0 | 174 | #define FIQ_START IRQ_EINT0 |
169 | 175 | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h index b278d0c45ccf..f6e8eec879c8 100644 --- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h +++ b/arch/arm/mach-s3c2410/include/mach/regs-gpio.h | |||
@@ -328,13 +328,15 @@ | |||
328 | 328 | ||
329 | #define S3C2410_GPD8_VD16 (0x02 << 16) | 329 | #define S3C2410_GPD8_VD16 (0x02 << 16) |
330 | #define S3C2400_GPD8_TOUT3 (0x02 << 16) | 330 | #define S3C2400_GPD8_TOUT3 (0x02 << 16) |
331 | #define S3C2440_GPD8_SPIMISO1 (0x03 << 16) | ||
331 | 332 | ||
332 | #define S3C2410_GPD9_VD17 (0x02 << 18) | 333 | #define S3C2410_GPD9_VD17 (0x02 << 18) |
333 | #define S3C2400_GPD9_TCLK0 (0x02 << 18) | 334 | #define S3C2400_GPD9_TCLK0 (0x02 << 18) |
334 | #define S3C2410_GPD9_MASK (0x03 << 18) | 335 | #define S3C2440_GPD9_SPIMOSI1 (0x03 << 18) |
335 | 336 | ||
336 | #define S3C2410_GPD10_VD18 (0x02 << 20) | 337 | #define S3C2410_GPD10_VD18 (0x02 << 20) |
337 | #define S3C2400_GPD10_nWAIT (0x02 << 20) | 338 | #define S3C2400_GPD10_nWAIT (0x02 << 20) |
339 | #define S3C2440_GPD10_SPICLK1 (0x03 << 20) | ||
338 | 340 | ||
339 | #define S3C2410_GPD11_VD19 (0x02 << 22) | 341 | #define S3C2410_GPD11_VD19 (0x02 << 22) |
340 | 342 | ||
diff --git a/arch/arm/mach-s3c2410/include/mach/spi.h b/arch/arm/mach-s3c2410/include/mach/spi.h index 1d300fb112b1..193b39d654ed 100644 --- a/arch/arm/mach-s3c2410/include/mach/spi.h +++ b/arch/arm/mach-s3c2410/include/mach/spi.h | |||
@@ -30,4 +30,7 @@ extern void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi, | |||
30 | extern void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, | 30 | extern void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, |
31 | int enable); | 31 | int enable); |
32 | 32 | ||
33 | extern void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, | ||
34 | int enable); | ||
35 | |||
33 | #endif /* __ASM_ARCH_SPI_H */ | 36 | #endif /* __ASM_ARCH_SPI_H */ |
diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h index 1989ca1bb2b1..0f540ea1e999 100644 --- a/arch/arm/plat-s3c/include/plat/devs.h +++ b/arch/arm/plat-s3c/include/plat/devs.h | |||
@@ -58,5 +58,6 @@ extern struct platform_device s3c_device_usb_hsotg; | |||
58 | #ifdef CONFIG_CPU_S3C2440 | 58 | #ifdef CONFIG_CPU_S3C2440 |
59 | 59 | ||
60 | extern struct platform_device s3c_device_camif; | 60 | extern struct platform_device s3c_device_camif; |
61 | extern struct platform_device s3c_device_ac97; | ||
61 | 62 | ||
62 | #endif | 63 | #endif |
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig index 5b0bc914f58e..aaae456018b5 100644 --- a/arch/arm/plat-s3c24xx/Kconfig +++ b/arch/arm/plat-s3c24xx/Kconfig | |||
@@ -105,6 +105,12 @@ config S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7 | |||
105 | SPI GPIO configuration code for BUS 1 when connected to | 105 | SPI GPIO configuration code for BUS 1 when connected to |
106 | GPG5, GPG6 and GPG7. | 106 | GPG5, GPG6 and GPG7. |
107 | 107 | ||
108 | config S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10 | ||
109 | bool | ||
110 | help | ||
111 | SPI GPIO configuration code for BUS 1 when connected to | ||
112 | GPD8, GPD9 and GPD10. | ||
113 | |||
108 | # common code for s3c24xx based machines, such as the SMDKs. | 114 | # common code for s3c24xx based machines, such as the SMDKs. |
109 | 115 | ||
110 | config MACH_SMDK | 116 | config MACH_SMDK |
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile index 579a165c2827..59416796fb1d 100644 --- a/arch/arm/plat-s3c24xx/Makefile +++ b/arch/arm/plat-s3c24xx/Makefile | |||
@@ -41,6 +41,7 @@ obj-$(CONFIG_ARCH_S3C2410) += setup-i2c.o | |||
41 | 41 | ||
42 | obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o | 42 | obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o |
43 | obj-$(CONFIG_S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7) += spi-bus1-gpg5_6_7.o | 43 | obj-$(CONFIG_S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7) += spi-bus1-gpg5_6_7.o |
44 | obj-$(CONFIG_S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10) += spi-bus1-gpd8_9_10.o | ||
44 | 45 | ||
45 | # machine common support | 46 | # machine common support |
46 | 47 | ||
diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c index 3489019b5374..656b375db46f 100644 --- a/arch/arm/plat-s3c24xx/devs.c +++ b/arch/arm/plat-s3c24xx/devs.c | |||
@@ -26,6 +26,8 @@ | |||
26 | #include <asm/mach/irq.h> | 26 | #include <asm/mach/irq.h> |
27 | #include <mach/fb.h> | 27 | #include <mach/fb.h> |
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/dma.h> | ||
30 | #include <mach/irqs.h> | ||
29 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
30 | 32 | ||
31 | #include <plat/regs-serial.h> | 33 | #include <plat/regs-serial.h> |
@@ -473,4 +475,52 @@ struct platform_device s3c_device_camif = { | |||
473 | 475 | ||
474 | EXPORT_SYMBOL(s3c_device_camif); | 476 | EXPORT_SYMBOL(s3c_device_camif); |
475 | 477 | ||
478 | /* AC97 */ | ||
479 | |||
480 | static struct resource s3c_ac97_resource[] = { | ||
481 | [0] = { | ||
482 | .start = S3C2440_PA_AC97, | ||
483 | .end = S3C2440_PA_AC97 + S3C2440_SZ_AC97 -1, | ||
484 | .flags = IORESOURCE_MEM, | ||
485 | }, | ||
486 | [1] = { | ||
487 | .start = IRQ_S3C244x_AC97, | ||
488 | .end = IRQ_S3C244x_AC97, | ||
489 | .flags = IORESOURCE_IRQ, | ||
490 | }, | ||
491 | [2] = { | ||
492 | .name = "PCM out", | ||
493 | .start = DMACH_PCM_OUT, | ||
494 | .end = DMACH_PCM_OUT, | ||
495 | .flags = IORESOURCE_DMA, | ||
496 | }, | ||
497 | [3] = { | ||
498 | .name = "PCM in", | ||
499 | .start = DMACH_PCM_IN, | ||
500 | .end = DMACH_PCM_IN, | ||
501 | .flags = IORESOURCE_DMA, | ||
502 | }, | ||
503 | [4] = { | ||
504 | .name = "Mic in", | ||
505 | .start = DMACH_MIC_IN, | ||
506 | .end = DMACH_MIC_IN, | ||
507 | .flags = IORESOURCE_DMA, | ||
508 | }, | ||
509 | }; | ||
510 | |||
511 | static u64 s3c_device_ac97_dmamask = 0xffffffffUL; | ||
512 | |||
513 | struct platform_device s3c_device_ac97 = { | ||
514 | .name = "s3c-ac97", | ||
515 | .id = -1, | ||
516 | .num_resources = ARRAY_SIZE(s3c_ac97_resource), | ||
517 | .resource = s3c_ac97_resource, | ||
518 | .dev = { | ||
519 | .dma_mask = &s3c_device_ac97_dmamask, | ||
520 | .coherent_dma_mask = 0xffffffffUL | ||
521 | } | ||
522 | }; | ||
523 | |||
524 | EXPORT_SYMBOL(s3c_device_ac97); | ||
525 | |||
476 | #endif // CONFIG_CPU_S32440 | 526 | #endif // CONFIG_CPU_S32440 |
diff --git a/arch/arm/plat-s3c24xx/include/plat/fiq.h b/arch/arm/plat-s3c24xx/include/plat/fiq.h new file mode 100644 index 000000000000..8521b8372c5f --- /dev/null +++ b/arch/arm/plat-s3c24xx/include/plat/fiq.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* linux/include/asm-arm/plat-s3c24xx/fiq.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Header file for S3C24XX CPU FIQ support | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | extern int s3c24xx_set_fiq(unsigned int irq, bool on); | ||
diff --git a/arch/arm/plat-s3c24xx/irq.c b/arch/arm/plat-s3c24xx/irq.c index 958737775ad2..d02f5f02045e 100644 --- a/arch/arm/plat-s3c24xx/irq.c +++ b/arch/arm/plat-s3c24xx/irq.c | |||
@@ -493,6 +493,38 @@ s3c_irq_demux_extint4t7(unsigned int irq, | |||
493 | } | 493 | } |
494 | } | 494 | } |
495 | 495 | ||
496 | #ifdef CONFIG_FIQ | ||
497 | /** | ||
498 | * s3c24xx_set_fiq - set the FIQ routing | ||
499 | * @irq: IRQ number to route to FIQ on processor. | ||
500 | * @on: Whether to route @irq to the FIQ, or to remove the FIQ routing. | ||
501 | * | ||
502 | * Change the state of the IRQ to FIQ routing depending on @irq and @on. If | ||
503 | * @on is true, the @irq is checked to see if it can be routed and the | ||
504 | * interrupt controller updated to route the IRQ. If @on is false, the FIQ | ||
505 | * routing is cleared, regardless of which @irq is specified. | ||
506 | */ | ||
507 | int s3c24xx_set_fiq(unsigned int irq, bool on) | ||
508 | { | ||
509 | u32 intmod; | ||
510 | unsigned offs; | ||
511 | |||
512 | if (on) { | ||
513 | offs = irq - FIQ_START; | ||
514 | if (offs > 31) | ||
515 | return -EINVAL; | ||
516 | |||
517 | intmod = 1 << offs; | ||
518 | } else { | ||
519 | intmod = 0; | ||
520 | } | ||
521 | |||
522 | __raw_writel(intmod, S3C2410_INTMOD); | ||
523 | return 0; | ||
524 | } | ||
525 | #endif | ||
526 | |||
527 | |||
496 | /* s3c24xx_init_irq | 528 | /* s3c24xx_init_irq |
497 | * | 529 | * |
498 | * Initialise S3C2410 IRQ system | 530 | * Initialise S3C2410 IRQ system |
@@ -505,6 +537,10 @@ void __init s3c24xx_init_irq(void) | |||
505 | int irqno; | 537 | int irqno; |
506 | int i; | 538 | int i; |
507 | 539 | ||
540 | #ifdef CONFIG_FIQ | ||
541 | init_FIQ(); | ||
542 | #endif | ||
543 | |||
508 | irqdbf("s3c2410_init_irq: clearing interrupt status flags\n"); | 544 | irqdbf("s3c2410_init_irq: clearing interrupt status flags\n"); |
509 | 545 | ||
510 | /* first, clear all interrupts pending... */ | 546 | /* first, clear all interrupts pending... */ |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c new file mode 100644 index 000000000000..89fcf5308cf6 --- /dev/null +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/spi-bus0-gpd8_9_10.c | ||
2 | * | ||
3 | * Copyright (c) 2008 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * S3C24XX SPI - gpio configuration for bus 1 on gpd8,9,10 | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License. | ||
12 | */ | ||
13 | |||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/gpio.h> | ||
16 | |||
17 | #include <mach/spi.h> | ||
18 | #include <mach/regs-gpio.h> | ||
19 | |||
20 | void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, | ||
21 | int enable) | ||
22 | { | ||
23 | |||
24 | printk(KERN_INFO "%s(%d)\n", __func__, enable); | ||
25 | if (enable) { | ||
26 | s3c2410_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); | ||
27 | s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); | ||
28 | s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); | ||
29 | s3c2410_gpio_pullup(S3C2410_GPD(10), 0); | ||
30 | s3c2410_gpio_pullup(S3C2410_GPD(9), 0); | ||
31 | } else { | ||
32 | s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); | ||
33 | s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); | ||
34 | s3c2410_gpio_pullup(S3C2410_GPD(10), 1); | ||
35 | s3c2410_gpio_pullup(S3C2410_GPD(9), 1); | ||
36 | s3c2410_gpio_pullup(S3C2410_GPD(8), 1); | ||
37 | } | ||
38 | } | ||