diff options
author | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 19:18:56 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2011-12-27 19:18:56 -0500 |
commit | a46117836e23f97cf4660b0ebf8404ad151fb63d (patch) | |
tree | 2739f48d6ba3a7a8820f54929778ab69db314dba /arch/arm/mach-exynos | |
parent | bd4b9ba4cf9338932a065cd752fb5f28b26e4e39 (diff) | |
parent | 155bc27fdfbdf65a07a4f8ef3eafa25e57d8b511 (diff) |
Merge branch 'samsung/driver' into next/drivers
* samsung/driver:
ARM: EXYNOS: Modified files for SPI consolidation work
ARM: S5P64X0: Enable SDHCI support
ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names
ARM: S5P64X0: Add HSMMC setup for host Controller
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-exynos/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/clock.c | 73 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/irqs.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/map.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-exynos/include/mach/spi-clocks.h | 16 | ||||
-rw-r--r-- | arch/arm/mach-exynos/setup-spi.c | 72 |
7 files changed, 147 insertions, 30 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig index 0da2ced1ae48..4e36e8f4e157 100644 --- a/arch/arm/mach-exynos/Kconfig +++ b/arch/arm/mach-exynos/Kconfig | |||
@@ -153,6 +153,11 @@ config EXYNOS4_SETUP_USB_PHY | |||
153 | help | 153 | help |
154 | Common setup code for USB PHY controller | 154 | Common setup code for USB PHY controller |
155 | 155 | ||
156 | config EXYNOS4_SETUP_SPI | ||
157 | bool | ||
158 | help | ||
159 | Common setup code for SPI GPIO configurations. | ||
160 | |||
156 | # machine support | 161 | # machine support |
157 | 162 | ||
158 | if ARCH_EXYNOS4 | 163 | if ARCH_EXYNOS4 |
diff --git a/arch/arm/mach-exynos/Makefile b/arch/arm/mach-exynos/Makefile index a0959ad04077..db527ab4759c 100644 --- a/arch/arm/mach-exynos/Makefile +++ b/arch/arm/mach-exynos/Makefile | |||
@@ -61,3 +61,4 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C7) += setup-i2c7.o | |||
61 | obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o | 61 | obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o |
62 | obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o | 62 | obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o |
63 | obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o | 63 | obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o |
64 | obj-$(CONFIG_EXYNOS4_SETUP_SPI) += setup-spi.o | ||
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c index 5d8d4831e244..da50b1af7568 100644 --- a/arch/arm/mach-exynos/clock.c +++ b/arch/arm/mach-exynos/clock.c | |||
@@ -1111,36 +1111,6 @@ static struct clksrc_clk clksrcs[] = { | |||
1111 | .reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 }, | 1111 | .reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 }, |
1112 | }, { | 1112 | }, { |
1113 | .clk = { | 1113 | .clk = { |
1114 | .name = "sclk_spi", | ||
1115 | .devname = "s3c64xx-spi.0", | ||
1116 | .enable = exynos4_clksrc_mask_peril1_ctrl, | ||
1117 | .ctrlbit = (1 << 16), | ||
1118 | }, | ||
1119 | .sources = &clkset_group, | ||
1120 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 }, | ||
1121 | .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 }, | ||
1122 | }, { | ||
1123 | .clk = { | ||
1124 | .name = "sclk_spi", | ||
1125 | .devname = "s3c64xx-spi.1", | ||
1126 | .enable = exynos4_clksrc_mask_peril1_ctrl, | ||
1127 | .ctrlbit = (1 << 20), | ||
1128 | }, | ||
1129 | .sources = &clkset_group, | ||
1130 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 }, | ||
1131 | .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 }, | ||
1132 | }, { | ||
1133 | .clk = { | ||
1134 | .name = "sclk_spi", | ||
1135 | .devname = "s3c64xx-spi.2", | ||
1136 | .enable = exynos4_clksrc_mask_peril1_ctrl, | ||
1137 | .ctrlbit = (1 << 24), | ||
1138 | }, | ||
1139 | .sources = &clkset_group, | ||
1140 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 }, | ||
1141 | .reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 }, | ||
1142 | }, { | ||
1143 | .clk = { | ||
1144 | .name = "sclk_fimg2d", | 1114 | .name = "sclk_fimg2d", |
1145 | }, | 1115 | }, |
1146 | .sources = &clkset_mout_g2d, | 1116 | .sources = &clkset_mout_g2d, |
@@ -1257,6 +1227,42 @@ static struct clksrc_clk clk_sclk_mmc3 = { | |||
1257 | .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 }, | 1227 | .reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 }, |
1258 | }; | 1228 | }; |
1259 | 1229 | ||
1230 | static struct clksrc_clk clk_sclk_spi0 = { | ||
1231 | .clk = { | ||
1232 | .name = "sclk_spi", | ||
1233 | .devname = "s3c64xx-spi.0", | ||
1234 | .enable = exynos4_clksrc_mask_peril1_ctrl, | ||
1235 | .ctrlbit = (1 << 16), | ||
1236 | }, | ||
1237 | .sources = &clkset_group, | ||
1238 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 }, | ||
1239 | .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 }, | ||
1240 | }; | ||
1241 | |||
1242 | static struct clksrc_clk clk_sclk_spi1 = { | ||
1243 | .clk = { | ||
1244 | .name = "sclk_spi", | ||
1245 | .devname = "s3c64xx-spi.1", | ||
1246 | .enable = exynos4_clksrc_mask_peril1_ctrl, | ||
1247 | .ctrlbit = (1 << 20), | ||
1248 | }, | ||
1249 | .sources = &clkset_group, | ||
1250 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 }, | ||
1251 | .reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 }, | ||
1252 | }; | ||
1253 | |||
1254 | static struct clksrc_clk clk_sclk_spi2 = { | ||
1255 | .clk = { | ||
1256 | .name = "sclk_spi", | ||
1257 | .devname = "s3c64xx-spi.2", | ||
1258 | .enable = exynos4_clksrc_mask_peril1_ctrl, | ||
1259 | .ctrlbit = (1 << 24), | ||
1260 | }, | ||
1261 | .sources = &clkset_group, | ||
1262 | .reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 }, | ||
1263 | .reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 }, | ||
1264 | }; | ||
1265 | |||
1260 | /* Clock initialization code */ | 1266 | /* Clock initialization code */ |
1261 | static struct clksrc_clk *sysclks[] = { | 1267 | static struct clksrc_clk *sysclks[] = { |
1262 | &clk_mout_apll, | 1268 | &clk_mout_apll, |
@@ -1305,6 +1311,10 @@ static struct clksrc_clk *clksrc_cdev[] = { | |||
1305 | &clk_sclk_mmc1, | 1311 | &clk_sclk_mmc1, |
1306 | &clk_sclk_mmc2, | 1312 | &clk_sclk_mmc2, |
1307 | &clk_sclk_mmc3, | 1313 | &clk_sclk_mmc3, |
1314 | &clk_sclk_spi0, | ||
1315 | &clk_sclk_spi1, | ||
1316 | &clk_sclk_spi2, | ||
1317 | |||
1308 | }; | 1318 | }; |
1309 | 1319 | ||
1310 | static struct clk_lookup exynos4_clk_lookup[] = { | 1320 | static struct clk_lookup exynos4_clk_lookup[] = { |
@@ -1318,6 +1328,9 @@ static struct clk_lookup exynos4_clk_lookup[] = { | |||
1318 | CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk), | 1328 | CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk), |
1319 | CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0), | 1329 | CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0), |
1320 | CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1), | 1330 | CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1), |
1331 | CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk0", &clk_sclk_spi0.clk), | ||
1332 | CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk0", &clk_sclk_spi1.clk), | ||
1333 | CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk0", &clk_sclk_spi2.clk), | ||
1321 | }; | 1334 | }; |
1322 | 1335 | ||
1323 | static int xtal_rate; | 1336 | static int xtal_rate; |
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h index 713dd5251c64..f77bce04789a 100644 --- a/arch/arm/mach-exynos/include/mach/irqs.h +++ b/arch/arm/mach-exynos/include/mach/irqs.h | |||
@@ -72,6 +72,9 @@ | |||
72 | #define IRQ_IIC5 IRQ_SPI(63) | 72 | #define IRQ_IIC5 IRQ_SPI(63) |
73 | #define IRQ_IIC6 IRQ_SPI(64) | 73 | #define IRQ_IIC6 IRQ_SPI(64) |
74 | #define IRQ_IIC7 IRQ_SPI(65) | 74 | #define IRQ_IIC7 IRQ_SPI(65) |
75 | #define IRQ_SPI0 IRQ_SPI(66) | ||
76 | #define IRQ_SPI1 IRQ_SPI(67) | ||
77 | #define IRQ_SPI2 IRQ_SPI(68) | ||
75 | 78 | ||
76 | #define IRQ_USB_HOST IRQ_SPI(70) | 79 | #define IRQ_USB_HOST IRQ_SPI(70) |
77 | #define IRQ_USB_HSOTG IRQ_SPI(71) | 80 | #define IRQ_USB_HSOTG IRQ_SPI(71) |
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h index 01e1cf3f9341..05ff18706776 100644 --- a/arch/arm/mach-exynos/include/mach/map.h +++ b/arch/arm/mach-exynos/include/mach/map.h | |||
@@ -87,6 +87,10 @@ | |||
87 | #define EXYNOS4_PA_SYSMMU_TV 0x12E20000 | 87 | #define EXYNOS4_PA_SYSMMU_TV 0x12E20000 |
88 | #define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000 | 88 | #define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000 |
89 | #define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000 | 89 | #define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000 |
90 | #define EXYNOS4_PA_SPI0 0x13920000 | ||
91 | #define EXYNOS4_PA_SPI1 0x13930000 | ||
92 | #define EXYNOS4_PA_SPI2 0x13940000 | ||
93 | |||
90 | 94 | ||
91 | #define EXYNOS4_PA_GPIO1 0x11400000 | 95 | #define EXYNOS4_PA_GPIO1 0x11400000 |
92 | #define EXYNOS4_PA_GPIO2 0x11000000 | 96 | #define EXYNOS4_PA_GPIO2 0x11000000 |
@@ -149,6 +153,9 @@ | |||
149 | #define S3C_PA_RTC EXYNOS4_PA_RTC | 153 | #define S3C_PA_RTC EXYNOS4_PA_RTC |
150 | #define S3C_PA_WDT EXYNOS4_PA_WATCHDOG | 154 | #define S3C_PA_WDT EXYNOS4_PA_WATCHDOG |
151 | #define S3C_PA_UART EXYNOS4_PA_UART | 155 | #define S3C_PA_UART EXYNOS4_PA_UART |
156 | #define S3C_PA_SPI0 EXYNOS4_PA_SPI0 | ||
157 | #define S3C_PA_SPI1 EXYNOS4_PA_SPI1 | ||
158 | #define S3C_PA_SPI2 EXYNOS4_PA_SPI2 | ||
152 | 159 | ||
153 | #define S5P_PA_CHIPID EXYNOS4_PA_CHIPID | 160 | #define S5P_PA_CHIPID EXYNOS4_PA_CHIPID |
154 | #define S5P_PA_EHCI EXYNOS4_PA_EHCI | 161 | #define S5P_PA_EHCI EXYNOS4_PA_EHCI |
diff --git a/arch/arm/mach-exynos/include/mach/spi-clocks.h b/arch/arm/mach-exynos/include/mach/spi-clocks.h new file mode 100644 index 000000000000..576efdf6d091 --- /dev/null +++ b/arch/arm/mach-exynos/include/mach/spi-clocks.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* linux/arch/arm/mach-exynos4/include/mach/spi-clocks.h | ||
2 | * | ||
3 | * Copyright (C) 2011 Samsung Electronics Co. Ltd. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __ASM_ARCH_SPI_CLKS_H | ||
11 | #define __ASM_ARCH_SPI_CLKS_H __FILE__ | ||
12 | |||
13 | /* Must source from SCLK_SPI */ | ||
14 | #define EXYNOS4_SPI_SRCCLK_SCLK 0 | ||
15 | |||
16 | #endif /* __ASM_ARCH_SPI_CLKS_H */ | ||
diff --git a/arch/arm/mach-exynos/setup-spi.c b/arch/arm/mach-exynos/setup-spi.c new file mode 100644 index 000000000000..833ff40ee0e8 --- /dev/null +++ b/arch/arm/mach-exynos/setup-spi.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /* linux/arch/arm/mach-exynos4/setup-spi.c | ||
2 | * | ||
3 | * Copyright (C) 2011 Samsung Electronics 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/gpio.h> | ||
12 | #include <linux/platform_device.h> | ||
13 | |||
14 | #include <plat/gpio-cfg.h> | ||
15 | #include <plat/s3c64xx-spi.h> | ||
16 | |||
17 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | ||
18 | struct s3c64xx_spi_info s3c64xx_spi0_pdata __initdata = { | ||
19 | .fifo_lvl_mask = 0x1ff, | ||
20 | .rx_lvl_offset = 15, | ||
21 | .high_speed = 1, | ||
22 | .clk_from_cmu = true, | ||
23 | .tx_st_done = 25, | ||
24 | }; | ||
25 | |||
26 | int s3c64xx_spi0_cfg_gpio(struct platform_device *dev) | ||
27 | { | ||
28 | s3c_gpio_cfgpin(EXYNOS4_GPB(0), S3C_GPIO_SFN(2)); | ||
29 | s3c_gpio_setpull(EXYNOS4_GPB(0), S3C_GPIO_PULL_UP); | ||
30 | s3c_gpio_cfgall_range(EXYNOS4_GPB(2), 2, | ||
31 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
32 | return 0; | ||
33 | } | ||
34 | #endif | ||
35 | |||
36 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | ||
37 | struct s3c64xx_spi_info s3c64xx_spi1_pdata __initdata = { | ||
38 | .fifo_lvl_mask = 0x7f, | ||
39 | .rx_lvl_offset = 15, | ||
40 | .high_speed = 1, | ||
41 | .clk_from_cmu = true, | ||
42 | .tx_st_done = 25, | ||
43 | }; | ||
44 | |||
45 | int s3c64xx_spi1_cfg_gpio(struct platform_device *dev) | ||
46 | { | ||
47 | s3c_gpio_cfgpin(EXYNOS4_GPB(4), S3C_GPIO_SFN(2)); | ||
48 | s3c_gpio_setpull(EXYNOS4_GPB(4), S3C_GPIO_PULL_UP); | ||
49 | s3c_gpio_cfgall_range(EXYNOS4_GPB(6), 2, | ||
50 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP); | ||
51 | return 0; | ||
52 | } | ||
53 | #endif | ||
54 | |||
55 | #ifdef CONFIG_S3C64XX_DEV_SPI2 | ||
56 | struct s3c64xx_spi_info s3c64xx_spi2_pdata __initdata = { | ||
57 | .fifo_lvl_mask = 0x7f, | ||
58 | .rx_lvl_offset = 15, | ||
59 | .high_speed = 1, | ||
60 | .clk_from_cmu = true, | ||
61 | .tx_st_done = 25, | ||
62 | }; | ||
63 | |||
64 | int s3c64xx_spi2_cfg_gpio(struct platform_device *dev) | ||
65 | { | ||
66 | s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_SFN(5)); | ||
67 | s3c_gpio_setpull(EXYNOS4_GPC1(1), S3C_GPIO_PULL_UP); | ||
68 | s3c_gpio_cfgall_range(EXYNOS4_GPC1(3), 2, | ||
69 | S3C_GPIO_SFN(5), S3C_GPIO_PULL_UP); | ||
70 | return 0; | ||
71 | } | ||
72 | #endif | ||