Skip to contentSkip to conversation

Exynos4: Add HSMMC channel 4 support

PATCH New Kyungmin Park 2 participants 4 messages Mar 8, 2011 – Mar 11, 2011

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Exynos4: Add HSMMC channel 4 support

From: Kyungmin Park <[email protected]>

Exynos4 has the DesignWare Host controller at channel 4.

---

arch/arm/mach-exynos4/include/mach/irqs.h +1 -0
index 2dc5900..aa32679 100644
@@ -104,6 +104,7 @@
 #define IRQ_HSMMC1		COMBINER_IRQ(29, 1)
 #define IRQ_HSMMC2		COMBINER_IRQ(29, 2)
 #define IRQ_HSMMC3		COMBINER_IRQ(29, 3)
+#define IRQ_HSMMC4		COMBINER_IRQ(29, 4)
 
 #define IRQ_MIPI_CSIS0		COMBINER_IRQ(30, 0)
 #define IRQ_MIPI_CSIS1		COMBINER_IRQ(30, 1)
arch/arm/mach-exynos4/include/mach/map.h +1 -0
index 80a41e0..ea79962 100644
@@ -107,6 +107,7 @@
 #define S3C_PA_HSMMC1			EXYNOS4_PA_HSMMC(1)
 #define S3C_PA_HSMMC2			EXYNOS4_PA_HSMMC(2)
 #define S3C_PA_HSMMC3			EXYNOS4_PA_HSMMC(3)
+#define S3C_PA_HSMMC4			EXYNOS4_PA_HSMMC(4)
 #define S3C_PA_IIC			EXYNOS4_PA_IIC(0)
 #define S3C_PA_IIC1			EXYNOS4_PA_IIC(1)
 #define S3C_PA_IIC2			EXYNOS4_PA_IIC(2)
arch/arm/plat-samsung/Kconfig +5 -0
index be72100..f816985 100644
@@ -171,6 +171,11 @@ config S3C_DEV_HSMMC3
 	help
 	  Compile in platform device definitions for HSMMC channel 3
 
+config S3C_DEV_HSMMC4
+	bool
+	help
+	  Compile in platform device definitions for HSMMC channel 4
+
 config S3C_DEV_HWMON
 	bool
 	help
arch/arm/plat-samsung/Makefile +1 -0
index e9de58a..7ddba03 100644
@@ -37,6 +37,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC)	+= dev-hsmmc.o
 obj-$(CONFIG_S3C_DEV_HSMMC1)	+= dev-hsmmc1.o
 obj-$(CONFIG_S3C_DEV_HSMMC2)	+= dev-hsmmc2.o
 obj-$(CONFIG_S3C_DEV_HSMMC3)	+= dev-hsmmc3.o
+obj-$(CONFIG_S3C_DEV_HSMMC4)	+= dev-hsmmc4.o
 obj-$(CONFIG_S3C_DEV_HWMON)	+= dev-hwmon.o
 obj-y				+= dev-i2c0.o
 obj-$(CONFIG_S3C_DEV_I2C1)	+= dev-i2c1.o
arch/arm/plat-samsung/dev-hsmmc4.c new file +54 -0

54 lines not on this page · raw message

arch/arm/plat-samsung/include/plat/devs.h +1 -0
index e2b3ab9..4e198ba 100644
@@ -65,6 +65,7 @@ extern struct platform_device s3c_device_hsmmc0;
 extern struct platform_device s3c_device_hsmmc1;
 extern struct platform_device s3c_device_hsmmc2;
 extern struct platform_device s3c_device_hsmmc3;
+extern struct platform_device s3c_device_hsmmc4;
 extern struct platform_device s3c_device_cfcon;
 
 extern struct platform_device s3c_device_spi0;
#1 lore raw

PATCH 1/1 Exynos4: Add HSMMC channel 4 support

Quoted 5 lines · Kyungmin Park

From: Kyungmin Park <[email protected]>

Exynos4 has the DesignWare Host controller at channel 4.

Yeah, Exynos4210 has it but it can be happened problem when used your approach later.
Because, we can't assume hsmmc4 to be used for dw_mmc on other SoCs.

I mean, other file, eg., dev-dwmmc.c or dev-dwmci.c should be added for its platform devices.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Review

Quoted 45 lines

---

arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/irqs.h +0 -0

exynos4/include/mach/irqs.h
index 2dc5900..aa32679 100644

arch/arm/mach-exynos4/include/mach/irqs.h +1 -0
@@ -104,6 +104,7 @@
 #define IRQ_HSMMC1		COMBINER_IRQ(29, 1)
 #define IRQ_HSMMC2		COMBINER_IRQ(29, 2)
 #define IRQ_HSMMC3		COMBINER_IRQ(29, 3)
+#define IRQ_HSMMC4		COMBINER_IRQ(29, 4)
 
 #define IRQ_MIPI_CSIS0		COMBINER_IRQ(30, 0)
 #define IRQ_MIPI_CSIS1		COMBINER_IRQ(30, 1)
arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/map.h +0 -0

exynos4/include/mach/map.h
index 80a41e0..ea79962 100644

arch/arm/mach-exynos4/include/mach/map.h +1 -0
@@ -107,6 +107,7 @@
 #define S3C_PA_HSMMC1			EXYNOS4_PA_HSMMC(1)
 #define S3C_PA_HSMMC2			EXYNOS4_PA_HSMMC(2)
 #define S3C_PA_HSMMC3			EXYNOS4_PA_HSMMC(3)
+#define S3C_PA_HSMMC4			EXYNOS4_PA_HSMMC(4)
 #define S3C_PA_IIC			EXYNOS4_PA_IIC(0)
 #define S3C_PA_IIC1			EXYNOS4_PA_IIC(1)
 #define S3C_PA_IIC2			EXYNOS4_PA_IIC(2)
arch/arm/plat-samsung/Kconfig +5 -0
index be72100..f816985 100644
@@ -171,6 +171,11 @@ config S3C_DEV_HSMMC3
 	help
 	  Compile in platform device definitions for HSMMC channel 3
 
+config S3C_DEV_HSMMC4
+	bool
+	help
+	  Compile in platform device definitions for HSMMC channel 4
+
 config S3C_DEV_HWMON
 	bool
 	help
(quoted diff) +0 -0

b/arch/arm/plat-samsung/Makefile

Review

Quoted 12 lines

index e9de58a..7ddba03 100644

arch/arm/plat-samsung/Makefile +1 -0
@@ -37,6 +37,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC)	+= dev-hsmmc.o
 obj-$(CONFIG_S3C_DEV_HSMMC1)	+= dev-hsmmc1.o
 obj-$(CONFIG_S3C_DEV_HSMMC2)	+= dev-hsmmc2.o
 obj-$(CONFIG_S3C_DEV_HSMMC3)	+= dev-hsmmc3.o
+obj-$(CONFIG_S3C_DEV_HSMMC4)	+= dev-hsmmc4.o
 obj-$(CONFIG_S3C_DEV_HWMON)	+= dev-hwmon.o
 obj-y				+= dev-i2c0.o
 obj-$(CONFIG_S3C_DEV_I2C1)	+= dev-i2c1.o
(quoted diff) +0 -0

b/arch/arm/plat-samsung/dev-

Quoted 73 lines

hsmmc4.c
new file mode 100644
index 0000000..c69a78f

arch/arm/plat-samsung/dev-hsmmc4.c new file +54 -0
@@ -0,0 +1,54 @@
+/* linux/arch/arm/plat-samsung/dev-hsmmc4.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Co., Ltd.
+ *
+ * Samsung device definition for hsmmc device 4
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/dw_mmc.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/map.h>
+#include <plat/sdhci.h>
+#include <plat/devs.h>
+
+#define S3C_SZ_HSMMC		0x1000
+
+static struct resource s3c_hsmmc4_resource[] = {
+	[0] = {
+		.start	= S3C_PA_HSMMC4,
+		.end	= S3C_PA_HSMMC4 + S3C_SZ_HSMMC - 1,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_HSMMC4,
+		.end	= IRQ_HSMMC4,
+		.flags	= IORESOURCE_IRQ,
+	}
+};
+
+static u64 s3c_device_hsmmc4_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_hsmmc4 = {
+	.name			= "dw_mmc",
+	.id			= -1,
+	.num_resources		= ARRAY_SIZE(s3c_hsmmc4_resource),
+	.resource		= s3c_hsmmc4_resource,
+	.dev			= {
+		.dma_mask		= &s3c_device_hsmmc4_dmamask,
+		.coherent_dma_mask	= DMA_BIT_MASK(32),
+	},
+};
+
+void s3c_hsmmc4_set_platdata(struct dw_mci_board *pdata)
+{
+	s3c_set_platdata(pdata, sizeof(struct dw_mci_board),
+			 &s3c_device_hsmmc4);
+}
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0 -0

samsung/include/plat/devs.h
index e2b3ab9..4e198ba 100644

arch/arm/plat-samsung/include/plat/devs.h +1 -0
@@ -65,6 +65,7 @@ extern struct platform_device s3c_device_hsmmc0;
 extern struct platform_device s3c_device_hsmmc1;
 extern struct platform_device s3c_device_hsmmc2;
 extern struct platform_device s3c_device_hsmmc3;
+extern struct platform_device s3c_device_hsmmc4;
 extern struct platform_device s3c_device_cfcon;
 
 extern struct platform_device s3c_device_spi0;
#2 lore raw

PATCH 1/1 Exynos4: Add HSMMC channel 4 support

Quoted 4 lines · Kukjin Kim
Quoted 3 lines · Kyungmin Park

From: Kyungmin Park <[email protected]>

Quoted 8 lines
Quoted 2 lines

Exynos4 has the DesignWare Host controller at channel 4.

Yeah, Exynos4210 has it but it can be happened problem when used your approach later.
Because, we can't assume hsmmc4 to be used for dw_mmc on other SoCs.

I mean, other file, eg., dev-dwmmc.c or dev-dwmci.c should be added for its platform devices.

Who's opinions? Please Cc the proper person at LSI. I want to listen his opinions.

Thank you,
Kyungmin Park

Quoted 147 lines

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 44 lines

---

arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/irqs.h +0 -0

exynos4/include/mach/irqs.h
index 2dc5900..aa32679 100644

arch/arm/mach-exynos4/include/mach/irqs.h +1 -0
@@ -104,6 +104,7 @@
 ?#define IRQ_HSMMC1 ? ? ? ? ? COMBINER_IRQ(29, 1)
 ?#define IRQ_HSMMC2 ? ? ? ? ? COMBINER_IRQ(29, 2)
 ?#define IRQ_HSMMC3 ? ? ? ? ? COMBINER_IRQ(29, 3)
+#define IRQ_HSMMC4 ? ? ? ? ? COMBINER_IRQ(29, 4)
 
 ?#define IRQ_MIPI_CSIS0 ? ? ? ? ? ? ? COMBINER_IRQ(30, 0)
 ?#define IRQ_MIPI_CSIS1 ? ? ? ? ? ? ? COMBINER_IRQ(30, 1)
arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/map.h +0 -0

exynos4/include/mach/map.h
index 80a41e0..ea79962 100644

arch/arm/mach-exynos4/include/mach/map.h +1 -0
@@ -107,6 +107,7 @@
 ?#define S3C_PA_HSMMC1 ? ? ? ? ? ? ? ? ? ? ? ?EXYNOS4_PA_HSMMC(1)
 ?#define S3C_PA_HSMMC2 ? ? ? ? ? ? ? ? ? ? ? ?EXYNOS4_PA_HSMMC(2)
 ?#define S3C_PA_HSMMC3 ? ? ? ? ? ? ? ? ? ? ? ?EXYNOS4_PA_HSMMC(3)
+#define S3C_PA_HSMMC4 ? ? ? ? ? ? ? ? ? ? ? ?EXYNOS4_PA_HSMMC(4)
 ?#define S3C_PA_IIC ? ? ? ? ? ? ? ? ? EXYNOS4_PA_IIC(0)
 ?#define S3C_PA_IIC1 ? ? ? ? ? ? ? ? ?EXYNOS4_PA_IIC(1)
 ?#define S3C_PA_IIC2 ? ? ? ? ? ? ? ? ?EXYNOS4_PA_IIC(2)
arch/arm/plat-samsung/Kconfig +0 -0
index be72100..f816985 100644
@@ -171,6 +171,11 @@ config S3C_DEV_HSMMC3

? ? ? help
? ? ? ? Compile in platform device definitions for HSMMC channel 3

arch/arm/plat-samsung/Kconfig +5 -0
+config S3C_DEV_HSMMC4
+ ? ? bool
+ ? ? help
+ ? ? ? Compile in platform device definitions for HSMMC channel 4
+

?config S3C_DEV_HWMON
? ? ? bool
? ? ? help

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-samsung/Makefile

Quoted 11 lines

index e9de58a..7ddba03 100644

arch/arm/plat-samsung/Makefile +0 -0
@@ -37,6 +37,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC) += dev-hsmmc.o

?obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o ?obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o ?obj-$(CONFIG_S3C_DEV_HSMMC3) += dev-hsmmc3.o +obj-$(CONFIG_S3C_DEV_HSMMC4) += dev-hsmmc4.o ?obj-$(CONFIG_S3C_DEV_HWMON) ?+= dev-hwmon.o ?obj-y ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?+= dev-i2c0.o ?obj-$(CONFIG_S3C_DEV_I2C1) ? += dev-i2c1.o

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/plat-samsung/dev-

Quoted 66 lines

hsmmc4.c
new file mode 100644
index 0000000..c69a78f

arch/arm/plat-samsung/dev-hsmmc4.c new file +54 -0
@@ -0,0 +1,54 @@
+/* linux/arch/arm/plat-samsung/dev-hsmmc4.c
+ *
+ * Copyright (C) 2011 Samsung Electronics Co., Ltd.
+ *
+ * Samsung device definition for hsmmc device 4
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/mmc/host.h>
+#include <linux/mmc/dw_mmc.h>
+#include <linux/dma-mapping.h>
+
+#include <mach/map.h>
+#include <plat/sdhci.h>
+#include <plat/devs.h>
+
+#define S3C_SZ_HSMMC ? ? ? ? 0x1000
+
+static struct resource s3c_hsmmc4_resource[] = {
+ ? ? [0] = {
+ ? ? ? ? ? ? .start ?= S3C_PA_HSMMC4,
+ ? ? ? ? ? ? .end ? ?= S3C_PA_HSMMC4 + S3C_SZ_HSMMC - 1,
+ ? ? ? ? ? ? .flags ?= IORESOURCE_MEM,
+ ? ? },
+ ? ? [1] = {
+ ? ? ? ? ? ? .start ?= IRQ_HSMMC4,
+ ? ? ? ? ? ? .end ? ?= IRQ_HSMMC4,
+ ? ? ? ? ? ? .flags ?= IORESOURCE_IRQ,
+ ? ? }
+};
+
+static u64 s3c_device_hsmmc4_dmamask = DMA_BIT_MASK(32);
+
+struct platform_device s3c_device_hsmmc4 = {
+ ? ? .name ? ? ? ? ? ? ? ? ? = "dw_mmc",
+ ? ? .id ? ? ? ? ? ? ? ? ? ? = -1,
+ ? ? .num_resources ? ? ? ? ?= ARRAY_SIZE(s3c_hsmmc4_resource),
+ ? ? .resource ? ? ? ? ? ? ? = s3c_hsmmc4_resource,
+ ? ? .dev ? ? ? ? ? ? ? ? ? ?= {
+ ? ? ? ? ? ? .dma_mask ? ? ? ? ? ? ? = &s3c_device_hsmmc4_dmamask,
+ ? ? ? ? ? ? .coherent_dma_mask ? ? ?= DMA_BIT_MASK(32),
+ ? ? },
+};
+
+void s3c_hsmmc4_set_platdata(struct dw_mci_board *pdata)
+{
+ ? ? s3c_set_platdata(pdata, sizeof(struct dw_mci_board),
+ ? ? ? ? ? ? ? ? ? ? ?&s3c_device_hsmmc4);
+}
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0 -0

samsung/include/plat/devs.h
index e2b3ab9..4e198ba 100644

arch/arm/plat-samsung/include/plat/devs.h extern struct platform_device s3c_device_hsmmc0; · line 71

Quoted 7 lines
arch/arm/plat-samsung/include/plat/devs.h +1 -0
@@ -65,6 +65,7 @@ extern struct platform_device s3c_device_hsmmc0;
 ?extern struct platform_device s3c_device_hsmmc1;
 ?extern struct platform_device s3c_device_hsmmc2;
 ?extern struct platform_device s3c_device_hsmmc3;
+extern struct platform_device s3c_device_hsmmc4;
 ?extern struct platform_device s3c_device_cfcon;
 
 ?extern struct platform_device s3c_device_spi0;

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH 1/1 Exynos4: Add HSMMC channel 4 support

Quoted 2 lines · Kyungmin Park

On Fri, Mar 11, 2011 at 11:30 AM, Kukjin Kim <[email protected]>

Quoted 11 lines · wrote:
Quoted 11 lines
Quoted 5 lines · Kyungmin Park

From: Kyungmin Park <[email protected]>

Exynos4 has the DesignWare Host controller at channel 4.

Yeah, Exynos4210 has it but it can be happened problem when used your approach later.
Because, we can't assume hsmmc4 to be used for dw_mmc on other SoCs.

I mean, other file, eg., dev-dwmmc.c or dev-dwmci.c should be added for

its

Quoted 5 lines
Quoted 1 line

platform devices.

Who's opinions? Please Cc the proper person at LSI. I want to listen his opinions.

It's mine.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.