aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhilash Kesavan <a.kesavan@samsung.com>2010-06-08 04:11:43 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-08-05 05:31:01 -0400
commit4b9a5ad567af06d8929f022c71469ada1679a367 (patch)
tree9eced368d95901463a5565d465a1c3440fa48dc3
parentba149f3acdbbf143d70a64275917a6297c2373ba (diff)
ARM: S5PV210: Add support for Compact Flash driver on SMDKV210/C110
Following is added for the CF-ATA driver: - Platform data strucure instantiation - Platform device enabling code - Platform-specific gpio setup code - Fixed IRQ naming to match across 64xx and v210 Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r--arch/arm/mach-s5pv210/Kconfig9
-rw-r--r--arch/arm/mach-s5pv210/Makefile1
-rw-r--r--arch/arm/mach-s5pv210/cpu.c4
-rw-r--r--arch/arm/mach-s5pv210/include/mach/irqs.h2
-rw-r--r--arch/arm/mach-s5pv210/include/mach/map.h3
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkc110.c8
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c8
-rw-r--r--arch/arm/mach-s5pv210/setup-ide.c50
8 files changed, 83 insertions, 2 deletions
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 3a242ddc585..d7c40179585 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -27,6 +27,11 @@ config S5PV210_SETUP_I2C2
27 help 27 help
28 Common setup code for i2c bus 2. 28 Common setup code for i2c bus 2.
29 29
30config S5PV210_SETUP_IDE
31 bool
32 help
33 Common setup code for S5PV210 IDE GPIO configurations
34
30config S5PV210_SETUP_FB_24BPP 35config S5PV210_SETUP_FB_24BPP
31 bool 36 bool
32 help 37 help
@@ -76,9 +81,11 @@ config MACH_SMDKV210
76 select CPU_S5PV210 81 select CPU_S5PV210
77 select ARCH_SPARSEMEM_ENABLE 82 select ARCH_SPARSEMEM_ENABLE
78 select SAMSUNG_DEV_ADC 83 select SAMSUNG_DEV_ADC
84 select SAMSUNG_DEV_IDE
79 select SAMSUNG_DEV_TS 85 select SAMSUNG_DEV_TS
80 select S3C_DEV_WDT 86 select S3C_DEV_WDT
81 select HAVE_S3C2410_WATCHDOG 87 select HAVE_S3C2410_WATCHDOG
88 select S5PV210_SETUP_IDE
82 help 89 help
83 Machine support for Samsung SMDKV210 90 Machine support for Samsung SMDKV210
84 91
@@ -86,8 +93,10 @@ config MACH_SMDKC110
86 bool "SMDKC110" 93 bool "SMDKC110"
87 select CPU_S5PV210 94 select CPU_S5PV210
88 select ARCH_SPARSEMEM_ENABLE 95 select ARCH_SPARSEMEM_ENABLE
96 select SAMSUNG_DEV_IDE
89 select S3C_DEV_WDT 97 select S3C_DEV_WDT
90 select HAVE_S3C2410_WATCHDOG 98 select HAVE_S3C2410_WATCHDOG
99 select S5PV210_SETUP_IDE
91 help 100 help
92 Machine support for Samsung SMDKC110 101 Machine support for Samsung SMDKC110
93 S5PC110(MCP) is one of package option of S5PV210 102 S5PC110(MCP) is one of package option of S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 30be9a6a462..af557856b12 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -31,5 +31,6 @@ obj-$(CONFIG_S5PC110_DEV_ONENAND) += dev-onenand.o
31obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o 31obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
32obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o 32obj-$(CONFIG_S5PV210_SETUP_I2C1) += setup-i2c1.o
33obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o 33obj-$(CONFIG_S5PV210_SETUP_I2C2) += setup-i2c2.o
34obj-$(CONFIG_S5PV210_SETUP_IDE) += setup-ide.o
34obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o 35obj-$(CONFIG_S5PV210_SETUP_SDHCI) += setup-sdhci.o
35obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o 36obj-$(CONFIG_S5PV210_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
diff --git a/arch/arm/mach-s5pv210/cpu.c b/arch/arm/mach-s5pv210/cpu.c
index 411a4a9cbfc..8c4fdcde7f3 100644
--- a/arch/arm/mach-s5pv210/cpu.c
+++ b/arch/arm/mach-s5pv210/cpu.c
@@ -32,6 +32,7 @@
32#include <plat/devs.h> 32#include <plat/devs.h>
33#include <plat/clock.h> 33#include <plat/clock.h>
34#include <plat/s5pv210.h> 34#include <plat/s5pv210.h>
35#include <plat/ata-core.h>
35#include <plat/iic-core.h> 36#include <plat/iic-core.h>
36#include <plat/sdhci.h> 37#include <plat/sdhci.h>
37 38
@@ -79,7 +80,6 @@ void __init s5pv210_map_io(void)
79#ifdef CONFIG_S3C_DEV_ADC 80#ifdef CONFIG_S3C_DEV_ADC
80 s3c_device_adc.name = "s3c64xx-adc"; 81 s3c_device_adc.name = "s3c64xx-adc";
81#endif 82#endif
82
83 iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc)); 83 iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
84 84
85 /* initialise device information early */ 85 /* initialise device information early */
@@ -87,6 +87,8 @@ void __init s5pv210_map_io(void)
87 s5pv210_default_sdhci1(); 87 s5pv210_default_sdhci1();
88 s5pv210_default_sdhci2(); 88 s5pv210_default_sdhci2();
89 89
90 s3c_cfcon_setname("s5pv210-pata");
91
90 /* the i2c devices are directly compatible with s3c2440 */ 92 /* the i2c devices are directly compatible with s3c2440 */
91 s3c_i2c0_setname("s3c2440-i2c"); 93 s3c_i2c0_setname("s3c2440-i2c");
92 s3c_i2c1_setname("s3c2440-i2c"); 94 s3c_i2c1_setname("s3c2440-i2c");
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h
index 96895378ea2..e1d3c453db8 100644
--- a/arch/arm/mach-s5pv210/include/mach/irqs.h
+++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
@@ -45,7 +45,7 @@
45#define IRQ_IEMIEC S5P_IRQ_VIC1(6) 45#define IRQ_IEMIEC S5P_IRQ_VIC1(6)
46#define IRQ_ONENAND S5P_IRQ_VIC1(7) 46#define IRQ_ONENAND S5P_IRQ_VIC1(7)
47#define IRQ_NFC S5P_IRQ_VIC1(8) 47#define IRQ_NFC S5P_IRQ_VIC1(8)
48#define IRQ_CFC S5P_IRQ_VIC1(9) 48#define IRQ_CFCON S5P_IRQ_VIC1(9)
49#define IRQ_UART0 S5P_IRQ_VIC1(10) 49#define IRQ_UART0 S5P_IRQ_VIC1(10)
50#define IRQ_UART1 S5P_IRQ_VIC1(11) 50#define IRQ_UART1 S5P_IRQ_VIC1(11)
51#define IRQ_UART2 S5P_IRQ_VIC1(12) 51#define IRQ_UART2 S5P_IRQ_VIC1(12)
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index 34eb168ec95..3846a0be2fa 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -54,6 +54,8 @@
54 54
55#define S5PV210_PA_SROMC (0xE8000000) 55#define S5PV210_PA_SROMC (0xE8000000)
56 56
57#define S5PV210_PA_CFCON (0xE8200000)
58
57#define S5PV210_PA_MDMA 0xFA200000 59#define S5PV210_PA_MDMA 0xFA200000
58#define S5PV210_PA_PDMA0 0xE0900000 60#define S5PV210_PA_PDMA0 0xE0900000
59#define S5PV210_PA_PDMA1 0xE0A00000 61#define S5PV210_PA_PDMA1 0xE0A00000
@@ -104,5 +106,6 @@
104#define S3C_PA_WDT S5PV210_PA_WATCHDOG 106#define S3C_PA_WDT S5PV210_PA_WATCHDOG
105 107
106#define SAMSUNG_PA_ADC S5PV210_PA_ADC 108#define SAMSUNG_PA_ADC S5PV210_PA_ADC
109#define SAMSUNG_PA_CFCON S5PV210_PA_CFCON
107 110
108#endif /* __ASM_ARCH_MAP_H */ 111#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/mach-smdkc110.c b/arch/arm/mach-s5pv210/mach-smdkc110.c
index 4c8903c6d10..723e6078b97 100644
--- a/arch/arm/mach-s5pv210/mach-smdkc110.c
+++ b/arch/arm/mach-s5pv210/mach-smdkc110.c
@@ -25,6 +25,7 @@
25#include <plat/s5pv210.h> 25#include <plat/s5pv210.h>
26#include <plat/devs.h> 26#include <plat/devs.h>
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/ata.h>
28 29
29/* Following are default values for UCON, ULCON and UFCON UART registers */ 30/* Following are default values for UCON, ULCON and UFCON UART registers */
30#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 31#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -71,9 +72,14 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
71 }, 72 },
72}; 73};
73 74
75static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
76 .setup_gpio = s5pv210_ide_setup_gpio,
77};
78
74static struct platform_device *smdkc110_devices[] __initdata = { 79static struct platform_device *smdkc110_devices[] __initdata = {
75 &s5pv210_device_iis0, 80 &s5pv210_device_iis0,
76 &s5pv210_device_ac97, 81 &s5pv210_device_ac97,
82 &s3c_device_cfcon,
77 &s3c_device_wdt, 83 &s3c_device_wdt,
78}; 84};
79 85
@@ -86,6 +92,8 @@ static void __init smdkc110_map_io(void)
86 92
87static void __init smdkc110_machine_init(void) 93static void __init smdkc110_machine_init(void)
88{ 94{
95 s3c_ide_set_platdata(&smdkv210_ide_pdata);
96
89 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices)); 97 platform_add_devices(smdkc110_devices, ARRAY_SIZE(smdkc110_devices));
90} 98}
91 99
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index 0d462794804..cc902c1e8f9 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -27,6 +27,7 @@
27#include <plat/cpu.h> 27#include <plat/cpu.h>
28#include <plat/adc.h> 28#include <plat/adc.h>
29#include <plat/ts.h> 29#include <plat/ts.h>
30#include <plat/ata.h>
30 31
31/* Following are default values for UCON, ULCON and UFCON UART registers */ 32/* Following are default values for UCON, ULCON and UFCON UART registers */
32#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ 33#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -73,10 +74,15 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
73 }, 74 },
74}; 75};
75 76
77static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
78 .setup_gpio = s5pv210_ide_setup_gpio,
79};
80
76static struct platform_device *smdkv210_devices[] __initdata = { 81static struct platform_device *smdkv210_devices[] __initdata = {
77 &s5pv210_device_iis0, 82 &s5pv210_device_iis0,
78 &s5pv210_device_ac97, 83 &s5pv210_device_ac97,
79 &s3c_device_adc, 84 &s3c_device_adc,
85 &s3c_device_cfcon,
80 &s3c_device_ts, 86 &s3c_device_ts,
81 &s3c_device_wdt, 87 &s3c_device_wdt,
82}; 88};
@@ -97,6 +103,8 @@ static void __init smdkv210_map_io(void)
97static void __init smdkv210_machine_init(void) 103static void __init smdkv210_machine_init(void)
98{ 104{
99 s3c24xx_ts_set_platdata(&s3c_ts_platform); 105 s3c24xx_ts_set_platdata(&s3c_ts_platform);
106 s3c_ide_set_platdata(&smdkv210_ide_pdata);
107
100 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices)); 108 platform_add_devices(smdkv210_devices, ARRAY_SIZE(smdkv210_devices));
101} 109}
102 110
diff --git a/arch/arm/mach-s5pv210/setup-ide.c b/arch/arm/mach-s5pv210/setup-ide.c
new file mode 100644
index 00000000000..b558b1cc8d6
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-ide.c
@@ -0,0 +1,50 @@
1/* linux/arch/arm/mach-s5pv210/setup-ide.c
2 *
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com
5 *
6 * S5PV210 setup information for IDE
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/kernel.h>
14#include <linux/gpio.h>
15
16#include <plat/gpio-cfg.h>
17
18void s5pv210_ide_setup_gpio(void)
19{
20 unsigned int gpio = 0;
21
22 for (gpio = S5PV210_GPJ0(0); gpio <= S5PV210_GPJ0(7); gpio++) {
23 /* CF_Add[0 - 2], CF_IORDY, CF_INTRQ, CF_DMARQ, CF_DMARST,
24 CF_DMACK */
25 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
26 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
27 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
28 }
29
30 for (gpio = S5PV210_GPJ2(0); gpio <= S5PV210_GPJ2(7); gpio++) {
31 /*CF_Data[0 - 7] */
32 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
33 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
34 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
35 }
36
37 for (gpio = S5PV210_GPJ3(0); gpio <= S5PV210_GPJ3(7); gpio++) {
38 /* CF_Data[8 - 15] */
39 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
40 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
41 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
42 }
43
44 for (gpio = S5PV210_GPJ4(0); gpio <= S5PV210_GPJ4(3); gpio++) {
45 /* CF_CS0, CF_CS1, CF_IORD, CF_IOWR */
46 s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
47 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
48 s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
49 }
50}