aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv310
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2010-12-30 20:52:05 -0500
committerKukjin Kim <kgene.kim@samsung.com>2010-12-30 20:52:05 -0500
commit285dee7ff4fb4b32838694d4378f4aa938cf5b43 (patch)
treefa15cd1b385898f01ead4649712f6e4fbcd055cd /arch/arm/mach-s5pv310
parent0ae9a22b45b9e9d0f6058e5257b2daf48036dd35 (diff)
parentfa353e9f409340cefc7650854065cbcea85c347d (diff)
Merge branch 'next-s5pv310' into for-next
Conflicts: arch/arm/mach-s5pv310/Kconfig arch/arm/mach-s5pv310/Makefile arch/arm/mach-s5pv310/mach-smdkc210.c arch/arm/mach-s5pv310/mach-smdkv310.c arch/arm/plat-samsung/include/plat/devs.h
Diffstat (limited to 'arch/arm/mach-s5pv310')
-rw-r--r--arch/arm/mach-s5pv310/Kconfig11
-rw-r--r--arch/arm/mach-s5pv310/Makefile4
-rw-r--r--arch/arm/mach-s5pv310/cpu.c16
-rw-r--r--arch/arm/mach-s5pv310/dev-pd.c139
-rw-r--r--arch/arm/mach-s5pv310/include/mach/irqs.h13
-rw-r--r--arch/arm/mach-s5pv310/include/mach/map.h2
-rw-r--r--arch/arm/mach-s5pv310/include/mach/regs-pmu.h30
-rw-r--r--arch/arm/mach-s5pv310/irq-combiner.c6
-rw-r--r--arch/arm/mach-s5pv310/mach-smdkc210.c12
-rw-r--r--arch/arm/mach-s5pv310/mach-smdkv310.c12
-rw-r--r--arch/arm/mach-s5pv310/mach-universal_c210.c80
11 files changed, 315 insertions, 10 deletions
diff --git a/arch/arm/mach-s5pv310/Kconfig b/arch/arm/mach-s5pv310/Kconfig
index 3e1fe9d6b1fa..b7aa3cd2198a 100644
--- a/arch/arm/mach-s5pv310/Kconfig
+++ b/arch/arm/mach-s5pv310/Kconfig
@@ -15,6 +15,11 @@ config CPU_S5PV310
15 help 15 help
16 Enable S5PV310 CPU support 16 Enable S5PV310 CPU support
17 17
18config S5PV310_DEV_PD
19 bool
20 help
21 Compile in platform device definitions for Power Domain
22
18config S5PV310_SETUP_I2C1 23config S5PV310_SETUP_I2C1
19 bool 24 bool
20 help 25 help
@@ -75,6 +80,7 @@ config MACH_SMDKC210
75 select S3C_DEV_HSMMC1 80 select S3C_DEV_HSMMC1
76 select S3C_DEV_HSMMC2 81 select S3C_DEV_HSMMC2
77 select S3C_DEV_HSMMC3 82 select S3C_DEV_HSMMC3
83 select S5PV310_DEV_PD
78 select S5PV310_SETUP_I2C1 84 select S5PV310_SETUP_I2C1
79 select S5PV310_SETUP_SDHCI 85 select S5PV310_SETUP_SDHCI
80 help 86 help
@@ -85,6 +91,10 @@ config MACH_UNIVERSAL_C210
85 bool "Mobile UNIVERSAL_C210 Board" 91 bool "Mobile UNIVERSAL_C210 Board"
86 select CPU_S5PV310 92 select CPU_S5PV310
87 select S5P_DEV_ONENAND 93 select S5P_DEV_ONENAND
94 select S3C_DEV_HSMMC
95 select S3C_DEV_HSMMC2
96 select S3C_DEV_HSMMC3
97 select S5PV310_SETUP_SDHCI
88 select S3C_DEV_I2C1 98 select S3C_DEV_I2C1
89 select S5PV310_SETUP_I2C1 99 select S5PV310_SETUP_I2C1
90 help 100 help
@@ -105,6 +115,7 @@ config MACH_SMDKV310
105 select S3C_DEV_HSMMC1 115 select S3C_DEV_HSMMC1
106 select S3C_DEV_HSMMC2 116 select S3C_DEV_HSMMC2
107 select S3C_DEV_HSMMC3 117 select S3C_DEV_HSMMC3
118 select S5PV310_DEV_PD
108 select S5PV310_SETUP_I2C1 119 select S5PV310_SETUP_I2C1
109 select S5PV310_SETUP_SDHCI 120 select S5PV310_SETUP_SDHCI
110 help 121 help
diff --git a/arch/arm/mach-s5pv310/Makefile b/arch/arm/mach-s5pv310/Makefile
index 61e3cb654269..e01a4d050a4c 100644
--- a/arch/arm/mach-s5pv310/Makefile
+++ b/arch/arm/mach-s5pv310/Makefile
@@ -27,7 +27,9 @@ obj-$(CONFIG_MACH_UNIVERSAL_C210) += mach-universal_c210.o
27 27
28# device support 28# device support
29 29
30obj-y += dev-audio.o 30obj-y += dev-audio.o
31obj-$(CONFIG_S5PV310_DEV_PD) += dev-pd.o
32
31obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o 33obj-$(CONFIG_S5PV310_SETUP_I2C1) += setup-i2c1.o
32obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o 34obj-$(CONFIG_S5PV310_SETUP_I2C2) += setup-i2c2.o
33obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o 35obj-$(CONFIG_S5PV310_SETUP_I2C3) += setup-i2c3.o
diff --git a/arch/arm/mach-s5pv310/cpu.c b/arch/arm/mach-s5pv310/cpu.c
index 82ce4aa6d61a..9900464082db 100644
--- a/arch/arm/mach-s5pv310/cpu.c
+++ b/arch/arm/mach-s5pv310/cpu.c
@@ -43,6 +43,11 @@ static struct map_desc s5pv310_iodesc[] __initdata = {
43 .length = SZ_128K, 43 .length = SZ_128K,
44 .type = MT_DEVICE, 44 .type = MT_DEVICE,
45 }, { 45 }, {
46 .virtual = (unsigned long)S5P_VA_PMU,
47 .pfn = __phys_to_pfn(S5PV310_PA_PMU),
48 .length = SZ_64K,
49 .type = MT_DEVICE,
50 }, {
46 .virtual = (unsigned long)S5P_VA_COMBINER_BASE, 51 .virtual = (unsigned long)S5P_VA_COMBINER_BASE,
47 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER), 52 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER),
48 .length = SZ_4K, 53 .length = SZ_4K,
@@ -127,6 +132,15 @@ void __init s5pv310_init_irq(void)
127 gic_cpu_init(0, S5P_VA_GIC_CPU); 132 gic_cpu_init(0, S5P_VA_GIC_CPU);
128 133
129 for (irq = 0; irq < MAX_COMBINER_NR; irq++) { 134 for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
135
136 /*
137 * From SPI(0) to SPI(39) and SPI(51), SPI(53) are
138 * connected to the interrupt combiner. These irqs
139 * should be initialized to support cascade interrupt.
140 */
141 if ((irq >= 40) && !(irq == 51) && !(irq == 53))
142 continue;
143
130 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), 144 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
131 COMBINER_IRQ(irq, 0)); 145 COMBINER_IRQ(irq, 0));
132 combiner_cascade_irq(irq, IRQ_SPI(irq)); 146 combiner_cascade_irq(irq, IRQ_SPI(irq));
@@ -168,7 +182,7 @@ static int __init s5pv310_l2x0_cache_init(void)
168 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN, 182 __raw_writel(L2X0_DYNAMIC_CLK_GATING_EN | L2X0_STNDBY_MODE_EN,
169 S5P_VA_L2CC + L2X0_POWER_CTRL); 183 S5P_VA_L2CC + L2X0_POWER_CTRL);
170 184
171 l2x0_init(S5P_VA_L2CC, 0x7C070001, 0xC200ffff); 185 l2x0_init(S5P_VA_L2CC, 0x7C470001, 0xC200ffff);
172 186
173 return 0; 187 return 0;
174} 188}
diff --git a/arch/arm/mach-s5pv310/dev-pd.c b/arch/arm/mach-s5pv310/dev-pd.c
new file mode 100644
index 000000000000..58a50c2d0b67
--- /dev/null
+++ b/arch/arm/mach-s5pv310/dev-pd.c
@@ -0,0 +1,139 @@
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
22static 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
45static 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
67struct 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};
diff --git a/arch/arm/mach-s5pv310/include/mach/irqs.h b/arch/arm/mach-s5pv310/include/mach/irqs.h
index 34f214444f27..1dd130a34782 100644
--- a/arch/arm/mach-s5pv310/include/mach/irqs.h
+++ b/arch/arm/mach-s5pv310/include/mach/irqs.h
@@ -25,6 +25,8 @@
25 25
26#define IRQ_SPI(x) S5P_IRQ(x+32) 26#define IRQ_SPI(x) S5P_IRQ(x+32)
27 27
28#define IRQ_MCT1 IRQ_SPI(35)
29
28#define IRQ_EINT0 IRQ_SPI(40) 30#define IRQ_EINT0 IRQ_SPI(40)
29#define IRQ_EINT1 IRQ_SPI(41) 31#define IRQ_EINT1 IRQ_SPI(41)
30#define IRQ_EINT2 IRQ_SPI(42) 32#define IRQ_EINT2 IRQ_SPI(42)
@@ -36,9 +38,8 @@
36#define IRQ_JPEG IRQ_SPI(48) 38#define IRQ_JPEG IRQ_SPI(48)
37#define IRQ_2D IRQ_SPI(49) 39#define IRQ_2D IRQ_SPI(49)
38#define IRQ_PCIE IRQ_SPI(50) 40#define IRQ_PCIE IRQ_SPI(50)
39#define IRQ_SYSTEM_TIMER IRQ_SPI(51) 41#define IRQ_MCT0 IRQ_SPI(51)
40#define IRQ_MFC IRQ_SPI(52) 42#define IRQ_MFC IRQ_SPI(52)
41#define IRQ_WDT IRQ_SPI(53)
42#define IRQ_AUDIO_SS IRQ_SPI(54) 43#define IRQ_AUDIO_SS IRQ_SPI(54)
43#define IRQ_AC97 IRQ_SPI(55) 44#define IRQ_AC97 IRQ_SPI(55)
44#define IRQ_SPDIF IRQ_SPI(56) 45#define IRQ_SPDIF IRQ_SPI(56)
@@ -91,6 +92,8 @@
91 92
92#define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0) 93#define IRQ_ONENAND_AUDI COMBINER_IRQ(34, 0)
93 94
95#define IRQ_MCT_L1 COMBINER_IRQ(35, 3)
96
94#define IRQ_EINT4 COMBINER_IRQ(37, 0) 97#define IRQ_EINT4 COMBINER_IRQ(37, 0)
95#define IRQ_EINT5 COMBINER_IRQ(37, 1) 98#define IRQ_EINT5 COMBINER_IRQ(37, 1)
96#define IRQ_EINT6 COMBINER_IRQ(37, 2) 99#define IRQ_EINT6 COMBINER_IRQ(37, 2)
@@ -107,7 +110,11 @@
107 110
108#define IRQ_EINT16_31 COMBINER_IRQ(39, 0) 111#define IRQ_EINT16_31 COMBINER_IRQ(39, 0)
109 112
110#define MAX_COMBINER_NR 40 113#define IRQ_MCT_L0 COMBINER_IRQ(51, 0)
114
115#define IRQ_WDT COMBINER_IRQ(53, 0)
116
117#define MAX_COMBINER_NR 54
111 118
112#define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0) 119#define S5P_IRQ_EINT_BASE COMBINER_IRQ(MAX_COMBINER_NR, 0)
113 120
diff --git a/arch/arm/mach-s5pv310/include/mach/map.h b/arch/arm/mach-s5pv310/include/mach/map.h
index 0d0e7eb5b391..44af3e821da2 100644
--- a/arch/arm/mach-s5pv310/include/mach/map.h
+++ b/arch/arm/mach-s5pv310/include/mach/map.h
@@ -39,6 +39,8 @@
39#define S5PV310_PA_SYSCON (0x10010000) 39#define S5PV310_PA_SYSCON (0x10010000)
40#define S5P_PA_SYSCON S5PV310_PA_SYSCON 40#define S5P_PA_SYSCON S5PV310_PA_SYSCON
41 41
42#define S5PV310_PA_PMU (0x10020000)
43
42#define S5PV310_PA_CMU (0x10030000) 44#define S5PV310_PA_CMU (0x10030000)
43 45
44#define S5PV310_PA_WATCHDOG (0x10060000) 46#define S5PV310_PA_WATCHDOG (0x10060000)
diff --git a/arch/arm/mach-s5pv310/include/mach/regs-pmu.h b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
new file mode 100644
index 000000000000..fb333d0f6073
--- /dev/null
+++ b/arch/arm/mach-s5pv310/include/mach/regs-pmu.h
@@ -0,0 +1,30 @@
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 */
diff --git a/arch/arm/mach-s5pv310/irq-combiner.c b/arch/arm/mach-s5pv310/irq-combiner.c
index c3f88c3faf6c..aad5c3d525d1 100644
--- a/arch/arm/mach-s5pv310/irq-combiner.c
+++ b/arch/arm/mach-s5pv310/irq-combiner.c
@@ -24,6 +24,7 @@ static DEFINE_SPINLOCK(irq_controller_lock);
24 24
25struct combiner_chip_data { 25struct combiner_chip_data {
26 unsigned int irq_offset; 26 unsigned int irq_offset;
27 unsigned int irq_mask;
27 void __iomem *base; 28 void __iomem *base;
28}; 29};
29 30
@@ -62,6 +63,7 @@ static void combiner_handle_cascade_irq(unsigned int irq, struct irq_desc *desc)
62 spin_lock(&irq_controller_lock); 63 spin_lock(&irq_controller_lock);
63 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS); 64 status = __raw_readl(chip_data->base + COMBINER_INT_STATUS);
64 spin_unlock(&irq_controller_lock); 65 spin_unlock(&irq_controller_lock);
66 status &= chip_data->irq_mask;
65 67
66 if (status == 0) 68 if (status == 0)
67 goto out; 69 goto out;
@@ -104,10 +106,12 @@ void __init combiner_init(unsigned int combiner_nr, void __iomem *base,
104 106
105 combiner_data[combiner_nr].base = base; 107 combiner_data[combiner_nr].base = base;
106 combiner_data[combiner_nr].irq_offset = irq_start; 108 combiner_data[combiner_nr].irq_offset = irq_start;
109 combiner_data[combiner_nr].irq_mask = 0xff << ((combiner_nr % 4) << 3);
107 110
108 /* Disable all interrupts */ 111 /* Disable all interrupts */
109 112
110 __raw_writel(0xffffffff, base + COMBINER_ENABLE_CLEAR); 113 __raw_writel(combiner_data[combiner_nr].irq_mask,
114 base + COMBINER_ENABLE_CLEAR);
111 115
112 /* Setup the Linux IRQ subsystem */ 116 /* Setup the Linux IRQ subsystem */
113 117
diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-s5pv310/mach-smdkc210.c
index f3bc283df119..9262966cd269 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -26,6 +26,7 @@
26#include <plat/devs.h> 26#include <plat/devs.h>
27#include <plat/sdhci.h> 27#include <plat/sdhci.h>
28#include <plat/iic.h> 28#include <plat/iic.h>
29#include <plat/pd.h>
29 30
30#include <mach/map.h> 31#include <mach/map.h>
31 32
@@ -146,16 +147,23 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
146}; 147};
147 148
148static struct platform_device *smdkc210_devices[] __initdata = { 149static struct platform_device *smdkc210_devices[] __initdata = {
149 &s3c_device_i2c1,
150 &s3c_device_hsmmc0, 150 &s3c_device_hsmmc0,
151 &s3c_device_hsmmc1, 151 &s3c_device_hsmmc1,
152 &s3c_device_hsmmc2, 152 &s3c_device_hsmmc2,
153 &s3c_device_hsmmc3, 153 &s3c_device_hsmmc3,
154 &s3c_device_i2c1,
154 &s3c_device_rtc, 155 &s3c_device_rtc,
155 &s3c_device_wdt, 156 &s3c_device_wdt,
156 &smdkc210_smsc911x,
157 &s5pv310_device_ac97, 157 &s5pv310_device_ac97,
158 &s5pv310_device_i2s0, 158 &s5pv310_device_i2s0,
159 &s5pv310_device_pd[PD_MFC],
160 &s5pv310_device_pd[PD_G3D],
161 &s5pv310_device_pd[PD_LCD0],
162 &s5pv310_device_pd[PD_LCD1],
163 &s5pv310_device_pd[PD_CAM],
164 &s5pv310_device_pd[PD_TV],
165 &s5pv310_device_pd[PD_GPS],
166 &smdkc210_smsc911x,
159}; 167};
160 168
161static void __init smdkc210_smsc911x_init(void) 169static void __init smdkc210_smsc911x_init(void)
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index e4a826ac3c1d..3eb029ca2073 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
@@ -26,6 +26,7 @@
26#include <plat/devs.h> 26#include <plat/devs.h>
27#include <plat/sdhci.h> 27#include <plat/sdhci.h>
28#include <plat/iic.h> 28#include <plat/iic.h>
29#include <plat/pd.h>
29 30
30#include <mach/map.h> 31#include <mach/map.h>
31 32
@@ -146,16 +147,23 @@ static struct i2c_board_info i2c_devs1[] __initdata = {
146}; 147};
147 148
148static struct platform_device *smdkv310_devices[] __initdata = { 149static struct platform_device *smdkv310_devices[] __initdata = {
149 &s3c_device_i2c1,
150 &s3c_device_hsmmc0, 150 &s3c_device_hsmmc0,
151 &s3c_device_hsmmc1, 151 &s3c_device_hsmmc1,
152 &s3c_device_hsmmc2, 152 &s3c_device_hsmmc2,
153 &s3c_device_hsmmc3, 153 &s3c_device_hsmmc3,
154 &s3c_device_i2c1,
154 &s3c_device_rtc, 155 &s3c_device_rtc,
155 &s3c_device_wdt, 156 &s3c_device_wdt,
156 &smdkv310_smsc911x,
157 &s5pv310_device_ac97, 157 &s5pv310_device_ac97,
158 &s5pv310_device_i2s0, 158 &s5pv310_device_i2s0,
159 &s5pv310_device_pd[PD_MFC],
160 &s5pv310_device_pd[PD_G3D],
161 &s5pv310_device_pd[PD_LCD0],
162 &s5pv310_device_pd[PD_LCD1],
163 &s5pv310_device_pd[PD_CAM],
164 &s5pv310_device_pd[PD_TV],
165 &s5pv310_device_pd[PD_GPS],
166 &smdkv310_smsc911x,
159}; 167};
160 168
161static void __init smdkv310_smsc911x_init(void) 169static void __init smdkv310_smsc911x_init(void)
diff --git a/arch/arm/mach-s5pv310/mach-universal_c210.c b/arch/arm/mach-s5pv310/mach-universal_c210.c
index 16d8fc00cafd..36bc3cf825e3 100644
--- a/arch/arm/mach-s5pv310/mach-universal_c210.c
+++ b/arch/arm/mach-s5pv310/mach-universal_c210.c
@@ -13,6 +13,9 @@
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/gpio_keys.h> 14#include <linux/gpio_keys.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/regulator/machine.h>
17#include <linux/regulator/fixed.h>
18#include <linux/mmc/host.h>
16 19
17#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
18#include <asm/mach-types.h> 21#include <asm/mach-types.h>
@@ -21,6 +24,7 @@
21#include <plat/s5pv310.h> 24#include <plat/s5pv310.h>
22#include <plat/cpu.h> 25#include <plat/cpu.h>
23#include <plat/devs.h> 26#include <plat/devs.h>
27#include <plat/sdhci.h>
24 28
25#include <mach/map.h> 29#include <mach/map.h>
26 30
@@ -116,6 +120,73 @@ static struct platform_device universal_gpio_keys = {
116 }, 120 },
117}; 121};
118 122
123/* eMMC */
124static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
125 .max_width = 8,
126 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
127 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
128 MMC_CAP_DISABLE),
129 .cd_type = S3C_SDHCI_CD_PERMANENT,
130 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
131};
132
133static struct regulator_consumer_supply mmc0_supplies[] = {
134 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.0"),
135};
136
137static struct regulator_init_data mmc0_fixed_voltage_init_data = {
138 .constraints = {
139 .name = "VMEM_VDD_2.8V",
140 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
141 },
142 .num_consumer_supplies = ARRAY_SIZE(mmc0_supplies),
143 .consumer_supplies = mmc0_supplies,
144};
145
146static struct fixed_voltage_config mmc0_fixed_voltage_config = {
147 .supply_name = "MASSMEMORY_EN",
148 .microvolts = 2800000,
149 .gpio = S5PV310_GPE1(3),
150 .enable_high = true,
151 .init_data = &mmc0_fixed_voltage_init_data,
152};
153
154static struct platform_device mmc0_fixed_voltage = {
155 .name = "reg-fixed-voltage",
156 .id = 0,
157 .dev = {
158 .platform_data = &mmc0_fixed_voltage_config,
159 },
160};
161
162/* SD */
163static struct s3c_sdhci_platdata universal_hsmmc2_data __initdata = {
164 .max_width = 4,
165 .host_caps = MMC_CAP_4_BIT_DATA |
166 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
167 MMC_CAP_DISABLE,
168 .ext_cd_gpio = S5PV310_GPX3(4), /* XEINT_28 */
169 .ext_cd_gpio_invert = 1,
170 .cd_type = S3C_SDHCI_CD_GPIO,
171 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
172};
173
174/* WiFi */
175static struct s3c_sdhci_platdata universal_hsmmc3_data __initdata = {
176 .max_width = 4,
177 .host_caps = MMC_CAP_4_BIT_DATA |
178 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
179 MMC_CAP_DISABLE,
180 .cd_type = S3C_SDHCI_CD_EXTERNAL,
181};
182
183static void __init universal_sdhci_init(void)
184{
185 s3c_sdhci0_set_platdata(&universal_hsmmc0_data);
186 s3c_sdhci2_set_platdata(&universal_hsmmc2_data);
187 s3c_sdhci3_set_platdata(&universal_hsmmc3_data);
188}
189
119/* I2C0 */ 190/* I2C0 */
120static struct i2c_board_info i2c0_devs[] __initdata = { 191static struct i2c_board_info i2c0_devs[] __initdata = {
121 /* Camera, To be updated */ 192 /* Camera, To be updated */
@@ -127,6 +198,13 @@ static struct i2c_board_info i2c1_devs[] __initdata = {
127}; 198};
128 199
129static struct platform_device *universal_devices[] __initdata = { 200static struct platform_device *universal_devices[] __initdata = {
201 /* Samsung Platform Devices */
202 &mmc0_fixed_voltage,
203 &s3c_device_hsmmc0,
204 &s3c_device_hsmmc2,
205 &s3c_device_hsmmc3,
206
207 /* Universal Devices */
130 &universal_gpio_keys, 208 &universal_gpio_keys,
131 &s5p_device_onenand, 209 &s5p_device_onenand,
132}; 210};
@@ -140,6 +218,8 @@ static void __init universal_map_io(void)
140 218
141static void __init universal_machine_init(void) 219static void __init universal_machine_init(void)
142{ 220{
221 universal_sdhci_init();
222
143 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); 223 i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs));
144 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); 224 i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs));
145 225