diff options
Diffstat (limited to 'arch/arm/mach-s3c24xx')
-rw-r--r-- | arch/arm/mach-s3c24xx/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/clock-s3c2416.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/clock-s3c2443.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/common-s3c2443.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/dma-s3c2443.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/include/mach/dma.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/include/mach/map.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/setup-spi.c | 39 |
9 files changed, 83 insertions, 9 deletions
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index b34287ab5afd..e24961109b70 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig | |||
@@ -518,6 +518,11 @@ config S3C2443_DMA | |||
518 | help | 518 | help |
519 | Internal config node for S3C2443 DMA support | 519 | Internal config node for S3C2443 DMA support |
520 | 520 | ||
521 | config S3C2443_SETUP_SPI | ||
522 | bool | ||
523 | help | ||
524 | Common setup code for SPI GPIO configurations | ||
525 | |||
521 | endif # CPU_S3C2443 || CPU_S3C2416 | 526 | endif # CPU_S3C2443 || CPU_S3C2416 |
522 | 527 | ||
523 | if CPU_S3C2443 | 528 | if CPU_S3C2443 |
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile index 270a0b6f4f22..0ab6ab15da4c 100644 --- a/arch/arm/mach-s3c24xx/Makefile +++ b/arch/arm/mach-s3c24xx/Makefile | |||
@@ -97,5 +97,6 @@ obj-$(CONFIG_MACH_OSIRIS_DVS) += mach-osiris-dvs.o | |||
97 | # device setup | 97 | # device setup |
98 | 98 | ||
99 | obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 99 | obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
100 | obj-$(CONFIG_S3C2443_SETUP_SPI) += setup-spi.o | ||
100 | obj-$(CONFIG_ARCH_S3C24XX) += setup-i2c.o | 101 | obj-$(CONFIG_ARCH_S3C24XX) += setup-i2c.o |
101 | obj-$(CONFIG_S3C24XX_SETUP_TS) += setup-ts.o | 102 | obj-$(CONFIG_S3C24XX_SETUP_TS) += setup-ts.o |
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2416.c b/arch/arm/mach-s3c24xx/clock-s3c2416.c index dbc9ab4aaca2..8702ecfaab30 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2416.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2416.c | |||
@@ -144,6 +144,7 @@ static struct clk_lookup s3c2416_clk_lookup[] = { | |||
144 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &hsmmc0_clk), | 144 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.0", &hsmmc0_clk), |
145 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &hsmmc_mux0.clk), | 145 | CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &hsmmc_mux0.clk), |
146 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &hsmmc_mux1.clk), | 146 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &hsmmc_mux1.clk), |
147 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk2", &hsspi_mux.clk), | ||
147 | }; | 148 | }; |
148 | 149 | ||
149 | void __init s3c2416_init_clocks(int xtal) | 150 | void __init s3c2416_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s3c24xx/clock-s3c2443.c b/arch/arm/mach-s3c24xx/clock-s3c2443.c index efb3ac359566..a4c5a520d994 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2443.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2443.c | |||
@@ -179,6 +179,11 @@ static struct clk *clks[] __initdata = { | |||
179 | &clk_hsmmc, | 179 | &clk_hsmmc, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static struct clk_lookup s3c2443_clk_lookup[] = { | ||
183 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &clk_hsmmc), | ||
184 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk2", &clk_hsspi.clk), | ||
185 | }; | ||
186 | |||
182 | void __init s3c2443_init_clocks(int xtal) | 187 | void __init s3c2443_init_clocks(int xtal) |
183 | { | 188 | { |
184 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); | 189 | unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); |
@@ -210,6 +215,7 @@ void __init s3c2443_init_clocks(int xtal) | |||
210 | 215 | ||
211 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 216 | s3c_register_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
212 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); | 217 | s3c_disable_clocks(init_clocks_off, ARRAY_SIZE(init_clocks_off)); |
218 | clkdev_add_table(s3c2443_clk_lookup, ARRAY_SIZE(s3c2443_clk_lookup)); | ||
213 | 219 | ||
214 | s3c_pwmclk_init(); | 220 | s3c_pwmclk_init(); |
215 | } | 221 | } |
diff --git a/arch/arm/mach-s3c24xx/common-s3c2443.c b/arch/arm/mach-s3c24xx/common-s3c2443.c index 460431589f39..aeeb2be283fa 100644 --- a/arch/arm/mach-s3c24xx/common-s3c2443.c +++ b/arch/arm/mach-s3c24xx/common-s3c2443.c | |||
@@ -424,11 +424,6 @@ static struct clk init_clocks_off[] = { | |||
424 | .enable = s3c2443_clkcon_enable_p, | 424 | .enable = s3c2443_clkcon_enable_p, |
425 | .ctrlbit = S3C2443_PCLKCON_IIS, | 425 | .ctrlbit = S3C2443_PCLKCON_IIS, |
426 | }, { | 426 | }, { |
427 | .name = "hsspi", | ||
428 | .parent = &clk_p, | ||
429 | .enable = s3c2443_clkcon_enable_p, | ||
430 | .ctrlbit = S3C2443_PCLKCON_HSSPI, | ||
431 | }, { | ||
432 | .name = "adc", | 427 | .name = "adc", |
433 | .parent = &clk_p, | 428 | .parent = &clk_p, |
434 | .enable = s3c2443_clkcon_enable_p, | 429 | .enable = s3c2443_clkcon_enable_p, |
@@ -562,6 +557,14 @@ static struct clk hsmmc1_clk = { | |||
562 | .ctrlbit = S3C2443_HCLKCON_HSMMC, | 557 | .ctrlbit = S3C2443_HCLKCON_HSMMC, |
563 | }; | 558 | }; |
564 | 559 | ||
560 | static struct clk hsspi_clk = { | ||
561 | .name = "spi", | ||
562 | .devname = "s3c64xx-spi.0", | ||
563 | .parent = &clk_p, | ||
564 | .enable = s3c2443_clkcon_enable_p, | ||
565 | .ctrlbit = S3C2443_PCLKCON_HSSPI, | ||
566 | }; | ||
567 | |||
565 | /* EPLLCON compatible enough to get on/off information */ | 568 | /* EPLLCON compatible enough to get on/off information */ |
566 | 569 | ||
567 | void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll) | 570 | void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll) |
@@ -612,6 +615,7 @@ static struct clk *clks[] __initdata = { | |||
612 | &clk_usb_bus, | 615 | &clk_usb_bus, |
613 | &clk_armdiv, | 616 | &clk_armdiv, |
614 | &hsmmc1_clk, | 617 | &hsmmc1_clk, |
618 | &hsspi_clk, | ||
615 | }; | 619 | }; |
616 | 620 | ||
617 | static struct clksrc_clk *clksrcs[] __initdata = { | 621 | static struct clksrc_clk *clksrcs[] __initdata = { |
@@ -629,6 +633,7 @@ static struct clk_lookup s3c2443_clk_lookup[] = { | |||
629 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), | 633 | CLKDEV_INIT(NULL, "clk_uart_baud2", &clk_p), |
630 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk), | 634 | CLKDEV_INIT(NULL, "clk_uart_baud3", &clk_esys_uart.clk), |
631 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &hsmmc1_clk), | 635 | CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.0", &hsmmc1_clk), |
636 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk0", &hsspi_clk), | ||
632 | }; | 637 | }; |
633 | 638 | ||
634 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, | 639 | void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll, |
diff --git a/arch/arm/mach-s3c24xx/dma-s3c2443.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c index e227c472a40a..2d94228d2866 100644 --- a/arch/arm/mach-s3c24xx/dma-s3c2443.c +++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c | |||
@@ -55,12 +55,20 @@ static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = { | |||
55 | .name = "sdi", | 55 | .name = "sdi", |
56 | .channels = MAP(S3C2443_DMAREQSEL_SDI), | 56 | .channels = MAP(S3C2443_DMAREQSEL_SDI), |
57 | }, | 57 | }, |
58 | [DMACH_SPI0] = { | 58 | [DMACH_SPI0_RX] = { |
59 | .name = "spi0", | 59 | .name = "spi0-rx", |
60 | .channels = MAP(S3C2443_DMAREQSEL_SPI0RX), | ||
61 | }, | ||
62 | [DMACH_SPI0_TX] = { | ||
63 | .name = "spi0-tx", | ||
60 | .channels = MAP(S3C2443_DMAREQSEL_SPI0TX), | 64 | .channels = MAP(S3C2443_DMAREQSEL_SPI0TX), |
61 | }, | 65 | }, |
62 | [DMACH_SPI1] = { /* only on S3C2443/S3C2450 */ | 66 | [DMACH_SPI1_RX] = { /* only on S3C2443/S3C2450 */ |
63 | .name = "spi1", | 67 | .name = "spi1-rx", |
68 | .channels = MAP(S3C2443_DMAREQSEL_SPI1RX), | ||
69 | }, | ||
70 | [DMACH_SPI1_TX] = { /* only on S3C2443/S3C2450 */ | ||
71 | .name = "spi1-tx", | ||
64 | .channels = MAP(S3C2443_DMAREQSEL_SPI1TX), | 72 | .channels = MAP(S3C2443_DMAREQSEL_SPI1TX), |
65 | }, | 73 | }, |
66 | [DMACH_UART0] = { | 74 | [DMACH_UART0] = { |
diff --git a/arch/arm/mach-s3c24xx/include/mach/dma.h b/arch/arm/mach-s3c24xx/include/mach/dma.h index acbdfecd4186..454831b66037 100644 --- a/arch/arm/mach-s3c24xx/include/mach/dma.h +++ b/arch/arm/mach-s3c24xx/include/mach/dma.h | |||
@@ -47,6 +47,10 @@ enum dma_ch { | |||
47 | DMACH_UART2_SRC2, | 47 | DMACH_UART2_SRC2, |
48 | DMACH_UART3, /* s3c2443 has extra uart */ | 48 | DMACH_UART3, /* s3c2443 has extra uart */ |
49 | DMACH_UART3_SRC2, | 49 | DMACH_UART3_SRC2, |
50 | DMACH_SPI0_TX, /* s3c2443/2416/2450 hsspi0 */ | ||
51 | DMACH_SPI0_RX, /* s3c2443/2416/2450 hsspi0 */ | ||
52 | DMACH_SPI1_TX, /* s3c2443/2450 hsspi1 */ | ||
53 | DMACH_SPI1_RX, /* s3c2443/2450 hsspi1 */ | ||
50 | DMACH_MAX, /* the end entry */ | 54 | DMACH_MAX, /* the end entry */ |
51 | }; | 55 | }; |
52 | 56 | ||
diff --git a/arch/arm/mach-s3c24xx/include/mach/map.h b/arch/arm/mach-s3c24xx/include/mach/map.h index 78ae807f1281..8ba381f2dbe1 100644 --- a/arch/arm/mach-s3c24xx/include/mach/map.h +++ b/arch/arm/mach-s3c24xx/include/mach/map.h | |||
@@ -98,6 +98,8 @@ | |||
98 | 98 | ||
99 | /* SPI */ | 99 | /* SPI */ |
100 | #define S3C2410_PA_SPI (0x59000000) | 100 | #define S3C2410_PA_SPI (0x59000000) |
101 | #define S3C2443_PA_SPI0 (0x52000000) | ||
102 | #define S3C2443_PA_SPI1 S3C2410_PA_SPI | ||
101 | 103 | ||
102 | /* SDI */ | 104 | /* SDI */ |
103 | #define S3C2410_PA_SDI (0x5A000000) | 105 | #define S3C2410_PA_SDI (0x5A000000) |
@@ -162,4 +164,7 @@ | |||
162 | #define S3C_PA_WDT S3C2410_PA_WATCHDOG | 164 | #define S3C_PA_WDT S3C2410_PA_WATCHDOG |
163 | #define S3C_PA_NAND S3C24XX_PA_NAND | 165 | #define S3C_PA_NAND S3C24XX_PA_NAND |
164 | 166 | ||
167 | #define S3C_PA_SPI0 S3C2443_PA_SPI0 | ||
168 | #define S3C_PA_SPI1 S3C2443_PA_SPI1 | ||
169 | |||
165 | #endif /* __ASM_ARCH_MAP_H */ | 170 | #endif /* __ASM_ARCH_MAP_H */ |
diff --git a/arch/arm/mach-s3c24xx/setup-spi.c b/arch/arm/mach-s3c24xx/setup-spi.c new file mode 100644 index 000000000000..5712c85f39b1 --- /dev/null +++ b/arch/arm/mach-s3c24xx/setup-spi.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * HS-SPI device setup for S3C2443/S3C2416 | ||
3 | * | ||
4 | * Copyright (C) 2011 Samsung Electronics Ltd. | ||
5 | * http://www.samsung.com/ | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/gpio.h> | ||
13 | #include <linux/platform_device.h> | ||
14 | |||
15 | #include <plat/gpio-cfg.h> | ||
16 | #include <plat/s3c64xx-spi.h> | ||
17 | |||
18 | #include <mach/hardware.h> | ||
19 | #include <mach/regs-gpio.h> | ||
20 | |||
21 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | ||
22 | struct s3c64xx_spi_info s3c64xx_spi0_pdata __initdata = { | ||
23 | .fifo_lvl_mask = 0x7f, | ||
24 | .rx_lvl_offset = 13, | ||
25 | .tx_st_done = 21, | ||
26 | .high_speed = 1, | ||
27 | }; | ||
28 | |||
29 | int s3c64xx_spi0_cfg_gpio(struct platform_device *pdev) | ||
30 | { | ||
31 | /* enable hsspi bit in misccr */ | ||
32 | s3c2410_modify_misccr(S3C2416_MISCCR_HSSPI_EN2, 1); | ||
33 | |||
34 | s3c_gpio_cfgall_range(S3C2410_GPE(11), 3, | ||
35 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
36 | |||
37 | return 0; | ||
38 | } | ||
39 | #endif | ||