ARM: EXYNOS4: Add platform device for dwmci driver.
Subsystems (3)
PATCH v2 1/1 ARM: EXYNOS4: Add platform device for dwmci driver.
This patch add platform devices for Synopsys DesignWare Multimedia Card Interface driver.
--- arch/arm/mach-exynos4/Kconfig | 12 ++++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/dev-dwmci.c | 88 +++++++++++++++++++++++++++++ arch/arm/mach-exynos4/include/mach/irqs.h | 1 + arch/arm/mach-exynos4/include/mach/map.h | 1 + arch/arm/plat-samsung/include/plat/devs.h | 1 + 6 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-exynos4/dev-dwmci.c
arch/arm/mach-exynos4/Kconfig +12 -0
@@ -35,6 +35,11 @@ config EXYNOS4_DEV_SYSMMU help Common setup code for SYSTEM MMU in EXYNOS4 +config EXYNOS4_DEV_DWMCI + bool + help + Compile in platform device definitions for DWMCI + config EXYNOS4_SETUP_I2C1 bool help
@@ -200,6 +205,13 @@ comment "Configuration for HSMMC bus width" menu "Use 8-bit bus width" +config EXYNOS4_DWMCI_8BIT + bool "DWMCI with 8-bit bus" + depends on EXYNOS4_DEV_DWMCI + help + Support DWMCI 8-bit bus. + If selected, Channel 1 is disabled. + config EXYNOS4_SDHCI_CH0_8BIT bool "Channel 0 with 8-bit bus" help
arch/arm/mach-exynos4/Makefile +1 -0
@@ -43,6 +43,7 @@ obj-y += dev-audio.o obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o +obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.o
arch/arm/mach-exynos4/dev-dwmci.c new file +88 -0
88 lines not on this page · raw message
arch/arm/mach-exynos4/include/mach/irqs.h +1 -0
@@ -107,6 +107,7 @@#define IRQ_HSMMC1 COMBINER_IRQ(29, 1)#define IRQ_HSMMC2 COMBINER_IRQ(29, 2)#define IRQ_HSMMC3 COMBINER_IRQ(29, 3) +#define IRQ_DWMCI 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
@@ -94,6 +94,7 @@#define EXYNOS4_PA_MIPI_CSIS1 0x11890000#define EXYNOS4_PA_HSMMC (x) (0x12510000 + ((x) * 0x10000)) +#define EXYNOS4_PA_DWMCI 0x12550000#define EXYNOS4_PA_SATA 0x12560000#define EXYNOS4_PA_SATAPHY 0x125D0000
arch/arm/plat-samsung/include/plat/devs.h +1 -0
@@ -112,6 +112,7 @@ extern struct platform_device exynos4_device_i2s2;extern struct platform_device exynos4_device_spdif;extern struct platform_device exynos4_device_pd[];extern struct platform_device exynos4_device_ahci; +extern struct platform_device exynos4_device_dwmci;extern struct platform_device s5p6440_device_pcm;extern struct platform_device s5p6440_device_iis;
Signature · 1 line
1.7.2.3
PATCH v2 1/1 ARM: EXYNOS4: Add platform device for dwmci driver.
Quoted 34 lines · Seungwon Jeon
This patch add platform devices for Synopsys DesignWare Multimedia Card Interface driver.
Signed-off-by Seungwon Jeon <[email protected]>---
?arch/arm/mach-exynos4/Kconfig ? ? ? ? ? ? | ? 12 ++++ ?arch/arm/mach-exynos4/Makefile ? ? ? ? ? ?| ? ?1 + ?arch/arm/mach-exynos4/dev-dwmci.c ? ? ? ? | ? 88 +++++++++++++++++++++++++++++ ?arch/arm/mach-exynos4/include/mach/irqs.h | ? ?1 + ?arch/arm/mach-exynos4/include/mach/map.h ?| ? ?1 + ?arch/arm/plat-samsung/include/plat/devs.h | ? ?1 +?6 files changed, 104 insertions(+), 0 deletions(-) ?create mode 100644
arch/arm/mach-exynos4/dev-dwmci.carch/arm/mach-exynos4/Kconfig +0
-0@@ -35,6 +35,11 @@ config EXYNOS4_DEV_SYSMMU? ? ? ?help
? ? ? ? ?Common setup code for SYSTEM MMU in EXYNOS4arch/arm/mach-exynos4/Kconfig +5
-0+config EXYNOS4_DEV_DWMCI + ? ? ? bool + ? ? ? help + ? ? ? ? Compile in platform device definitions for DWMCI +?config
EXYNOS4_SETUP_I2C1
? ? ? ?bool
? ? ? ?helparch/arm/mach-exynos4/Kconfig +0
-0@@ -200,6 +205,13 @@ comment "Configuration for HSMMC bus width"?menu "Use 8-bit bus width"
Quoted 6 lines
+config
EXYNOS4_DWMCI_8BIT
+ ? ? ? bool "DWMCI with 8-bit bus"
+ ? ? ? depends onEXYNOS4_DEV_DWMCI
+ ? ? ? help
+ ? ? ? ? Support DWMCI 8-bit bus.
+ ? ? ? ? If selected, Channel 1 is disabled.
No it should be determined at runtime instead of compile time.
Quoted 46 lines
+
?configEXYNOS4_SDHCI_CH0_8BIT
? ? ? ?bool "Channel 0 with 8-bit bus"
? ? ? ?helparch/arm/mach-exynos4/Makefile +0
-0@@ -43,6 +43,7 @@ obj-y ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? += dev-audio.o?obj-$(CONFIG_EXYNOS4_DEV_AHCI) ? ? ? ? += dev-ahci.o ?obj-$(CONFIG_EXYNOS4_DEV_PD) ? ? ? ? ? += dev-pd.o ?obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) ? ? ? += dev-sysmmu.o +obj-$(CONFIG_EXYNOS4_DEV_DWMCI) ? ? ? ?+= dev-dwmci.o
?obj-$(CONFIG_EXYNOS4_SETUP_FIMC) ? ? ? += setup-fimc.o ?obj-$(CONFIG_EXYNOS4_SETUP_I2C1) ? ? ? += setup-i2c1.o
arch/arm/mach-exynos4/dev-dwmci.c new file +24
-0@@ -0,0 +1,88 @@ +/* +* linuxarch/arm/mach-exynos4/dev-dwmci.c +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* ? ? ? ? ? ? http://www.samsung.com +* +* Platform device for Synopsys DesignWare Mobile Storage IP +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/dma-mapping.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/mmc/dw_mmc.h> +#include <linux/mmc/host.h> +#include <linux/io.h> +#include <linux/gpio.h> + +#include <plat/devs.h>
arch/arm/mach-exynos4/dev-dwmci.c line 34
Quoted 10 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +10
-0+#include <plat/cpu.h> +#include <plat/gpio-cfg.h> + +#include <mach/map.h> + +#ifdef EXYNOS4_DWMCI_8BIT +#define BUS_WIDTH 8 +#else +#define BUS_WIDTH 4 +#endif
Right, each board can modify the bus width. so it needs the helper function to setup.
Quoted 98 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +54
-0+ +static int exynos4_dwmci_get_ocr (u32 slot_id) +{ + ? ? ? return MMC_VDD_32_33 | MMC_VDD_33_34; +} + +static int exynos4_dwmci_get_bus_wd (u32 slot_id) +{ + ? ? ? return BUS_WIDTH; +} + +static int exynos4_dwmci_init (u32 slot_id,irq_handler_t handler,void *data) +{ + ? ? ? return 0; +} + +static struct resource exynos4_dwmci_resource[] = { + ? ? ? [0] = { + ? ? ? ? ? ? ? .start = EXYNOS4_PA_DWMCI, + ? ? ? ? ? ? ? .end ? = EXYNOS4_PA_DWMCI + SZ_4K - 1, + ? ? ? ? ? ? ? .flags = IORESOURCE_MEM, + ? ? ? }, + ? ? ? [1] = { + ? ? ? ? ? ? ? .start = IRQ_DWMCI, + ? ? ? ? ? ? ? .end ? = IRQ_DWMCI, + ? ? ? ? ? ? ? .flags = IORESOURCE_IRQ, + ? ? ? } +}; + +static struct dw_mci_board exynos4_dwci_pdata = { + ? ? ? .num_slots ? ? ? ? ? ? ? ? ? ? ?= 1, + ? ? ? .quirks ? ? ? ? ? ? ? ? ? ? ? ? = DW_MCI_QUIRK_BROKEN_CARD_DETECTION, + ? ? ? .bus_hz ? ? ? ? ? ? ? ? ? ? ? ? = 80*1000*1000, + ? ? ? .detect_delay_ms ? ? ? ?= 200, + ? ? ? .init ? ? ? ? ? ? ? ? ? ? ? ? ? = exynos4_dwmci_init, + ? ? ? .get_ocr ? ? ? ? ? ? ? ? ? ? ? ?= exynos4_dwmci_get_ocr, + ? ? ? .get_bus_wd ? ? ? ? ? ? ? ? ? ? = exynos4_dwmci_get_bus_wd, + ? ? ? .select_slot ? ? ? ? ? ?= NULL, +}; + +static u64 exynos4_dwmci_dmamask =DMA_BIT_MASK (32 ); + +struct platform_device exynos4_device_dwmci = { + ? ? ? .name ? ? ? ? ? = "dw_mmc", + ? ? ? .id ? ? ? ? ? ? = -1, + ? ? ? .num_resources ?= ARRAY_SIZE(exynos4_dwmci_resource), + ? ? ? .resource ? ? ? = exynos4_dwmci_resource, + ? ? ? .dev ? ? ? ? ? ?= { + ? ? ? ? ? ? ? .dma_mask ? ? ? ? ? ? ? = &exynos4_dwmci_dmamask, + ? ? ? ? ? ? ? .coherent_dma_mask ? ? ?= DMA_BIT_MASK(32), + ? ? ? ? ? ? ? .platform_data ?= &exynos4_dwci_pdata, + ? ? ? }, +}; +arch/arm/mach-exynos4/include/mach/irqs.h +1
-0@@ -107,6 +107,7 @@ ?#define IRQ_HSMMC1 ? ? ? ? ? ? COMBINER_IRQ(29, 1) ?#define IRQ_HSMMC2 ? ? ? ? ? ? COMBINER_IRQ(29, 2) ?#define IRQ_HSMMC3 ? ? ? ? ? ? COMBINER_IRQ(29, 3) +#define IRQ_DWMCI ? ? ? ? ? ? ?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 +0
-0@@ -94,6 +94,7 @@?#define
EXYNOS4_PA_MIPI_CSIS1? ? ? ? ?0x11890000?#define
EXYNOS4_PA_HSMMC(x)? ? ? ? ? ?(0x12510000 + ((x) *0x10000)) +#defineEXYNOS4_PA_DWMCI? ? ? ? ? ? ?0x12550000?#define
EXYNOS4_PA_SATA? ? ? ? ? ? ? ? ? ? ? ?0x12560000 ?#defineEXYNOS4_PA_SATAPHY? ? ? ? ? ?0x125D0000arch/arm/plat-samsung/include/plat/devs.h +1
-1@@ -112,6 +112,7 @@ extern struct platform_device exynos4_device_i2s2; ?extern struct platform_device exynos4_device_spdif; ?extern struct platform_device exynos4_device_pd[]; ?extern struct platform_device exynos4_device_ahci; +extern struct platform_device exynos4_device_dwmci; ?extern struct platform_device s5p6440_device_pcm; ?extern struct platform_device s5p6440_device_iis; --1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 ARM: EXYNOS4: Add platform device for dwmci driver.
Hi,
Quoted 38 lines · Kyungmin Park
Quoted 8 lines · Seungwon Jeon
This patch add platform devices for Synopsys DesignWare Multimedia Card Interface driver.
Signed-off-by Seungwon Jeon <[email protected]>--- arch/arm/mach-exynos4/Kconfig | 12 ++++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/dev-dwmci.c | 88+++++++++++++++++++++++++++++
arch/arm/mach-
Quoted 7 lines
arch/arm/mach-exynos4/include/mach/irqs.h | 1 + arch/arm/mach-exynos4/include/mach/map.h | 1 + arch/arm/plat-samsung/include/plat/devs.h | 1 + 6 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-exynos4/dev-dwmci.carch/arm/mach- renamed from arch/arm/mach-exynos4/Kconfig +0
-0exynos4/Kconfig
Quoted 19 lines
index 5115b90..2ec5b96 100644
arch/arm/mach-exynos4/Kconfig +5
-0@@ -35,6 +35,11 @@ config EXYNOS4_DEV_SYSMMU help Common setup code for SYSTEM MMU in EXYNOS4 +config EXYNOS4_DEV_DWMCI + bool + help + Compile in platform device definitions for DWMCI + config EXYNOS4_SETUP_I2C1 bool help@@ -200,6 +205,13 @@ comment "Configuration for HSMMC bus width" menu "Use 8-bit bus width"
Quoted 8 lines
arch/arm/mach-exynos4/Kconfig comment "Configuration for HSMMC bus width" · line 213
Quoted 6 lines
arch/arm/mach-exynos4/Kconfig +6
-0+config EXYNOS4_DWMCI_8BIT + bool "DWMCI with 8-bit bus" + depends on EXYNOS4_DEV_DWMCI + help + Support DWMCI 8-bit bus. + If selected, Channel 1 is disabled.No it should be determined at runtime instead of compile time.
Sorry for that I don't understand your meaning.
Perhaps, you want to decide the width according to the board type at runtime? I expect the reason and description about your comment.
Bus width is board-specific information related with capability which is not determined in runtime.
So we should decide and choice bus width considering the board target before compiling.
Best regards,
Seungwon Jeon.
Quoted 170 lines
arch/arm/mach-
Quoted 6 lines
arch/arm/mach-exynos4/Kconfig +1
-0+ config EXYNOS4_SDHCI_CH0_8BIT bool "Channel 0 with 8-bit bus" helparch/arm/mach- renamed from arch/arm/mach-exynos4/Makefile +0
-0exynos4/Makefile
arch/arm/mach-
Quoted 12 lines
index 60fe5ec..eeeaada 100644
arch/arm/mach-exynos4/Makefile +1
-0@@ -43,6 +43,7 @@ obj-y += dev-audio.o obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o +obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.oarch/arm/mach- renamed from arch/arm/mach-exynos4/dev-dwmci.c +0
-0
exynos4/dev-dwmci.cQuoted 29 lines
new file mode 100644
index 0000000..a0defa4arch/arm/mach-exynos4/dev-dwmci.c new file +24
-0@@ -0,0 +1,88 @@ +/* +* linuxarch/arm/mach-exynos4/dev-dwmci.c +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com +* +* Platform device for Synopsys DesignWare Mobile Storage IP +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/dma-mapping.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/mmc/dw_mmc.h> +#include <linux/mmc/host.h> +#include <linux/io.h> +#include <linux/gpio.h> + +#include <plat/devs.h> arch/arm/mach-exynos4/dev-dwmci.c line 34
Quoted 10 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +10
-0+#include <plat/cpu.h> +#include <plat/gpio-cfg.h> + +#include <mach/map.h> + +#ifdef EXYNOS4_DWMCI_8BIT +#define BUS_WIDTH 8 +#else +#define BUS_WIDTH 4 +#endif Right, each board can modify the bus width. so it needs the helper function to setup.
arch/arm/mach-exynos4/dev-dwmci.c
Quoted 12 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +12
-0+ +static int exynos4_dwmci_get_ocr (u32 slot_id) +{ +return MMC_VDD_32_33 |MMC_VDD_33_34 ; +} + +static int exynos4_dwmci_get_bus_wd (u32 slot_id) +{ +return BUS_WIDTH ; +} + +static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void*data)
arch/arm/mach-
Quoted 43 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +42
-0+{ +return 0 ; +} + +static struct resource exynos4_dwmci_resource[] = { + [0 ] = { + .start =EXYNOS4_PA_DWMCI , + .end =EXYNOS4_PA_DWMCI +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_DWMCI , + .end =IRQ_DWMCI , + .flags =IORESOURCE_IRQ , + } +}; + +static struct dw_mci_board exynos4_dwci_pdata = { + .num_slots =1 , + .quirks =DW_MCI_QUIRK_BROKEN_CARD_DETECTION , + .bus_hz =80 *1000 *1000 , + .detect_delay_ms =200 , + .init = exynos4_dwmci_init, + .get_ocr = exynos4_dwmci_get_ocr, + .get_bus_wd = exynos4_dwmci_get_bus_wd, + .select_slot =NULL , +}; + +static u64 exynos4_dwmci_dmamask =DMA_BIT_MASK (32 ); + +struct platform_device exynos4_device_dwmci = { + .name ="dw_mmc" , + .id =-1 , + .num_resources =ARRAY_SIZE (exynos4_dwmci_resource), + .resource = exynos4_dwmci_resource, + .dev = { + .dma_mask = &exynos4_dwmci_dmamask, + .coherent_dma_mask =DMA_BIT_MASK (32 ), + .platform_data = &exynos4_dwci_pdata, + }, +}; +arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/irqs.h +0
-0
exynos4/include/mach/irqs.harch/arm/mach-
Quoted 12 lines
index 5d03730..b720246 100644
arch/arm/mach-exynos4/include/mach/irqs.h +1
-0@@ -107,6 +107,7 @@#define IRQ_HSMMC1 COMBINER_IRQ(29, 1)#define IRQ_HSMMC2 COMBINER_IRQ(29, 2)#define IRQ_HSMMC3 COMBINER_IRQ(29, 3) +#define IRQ_DWMCI 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.harch/arm/plat-
Quoted 12 lines
index 0009e77..352e500 100644
arch/arm/mach-exynos4/include/mach/map.h +1
-0@@ -94,6 +94,7 @@#define EXYNOS4_PA_MIPI_CSIS1 0x11890000#define EXYNOS4_PA_HSMMC (x) (0x12510000 + ((x) * 0x10000)) +#define EXYNOS4_PA_DWMCI 0x12550000#define EXYNOS4_PA_SATA 0x12560000#define EXYNOS4_PA_SATAPHY 0x125D0000arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.hQuoted 14 lines
index e3b31c2..29fa1cf 100644
arch/arm/plat-samsung/include/plat/devs.h +1
-1@@ -112,6 +112,7 @@ extern struct platform_device exynos4_device_i2s2;extern struct platform_device exynos4_device_spdif;extern struct platform_device exynos4_device_pd[];extern struct platform_device exynos4_device_ahci; +extern struct platform_device exynos4_device_dwmci;extern struct platform_device s5p6440_device_pcm;extern struct platform_device s5p6440_device_iis; --1.7.2.3
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
Quoted 3 lines
the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung- soc" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 ARM: EXYNOS4: Add platform device for dwmci driver.
Quoted 50 lines · Seungwon Jeon
Hi,
Quoted 38 lines · Kyungmin Park
Quoted 8 lines · Seungwon Jeon
This patch add platform devices for Synopsys DesignWare Multimedia Card Interface driver.
Signed-off-by Seungwon Jeon <[email protected]>---
?arch/arm/mach-exynos4/Kconfig ? ? ? ? ? ? | ? 12 ++++ ?arch/arm/mach-exynos4/Makefile ? ? ? ? ? ?| ? ?1 + ?arch/arm/mach-exynos4/dev-dwmci.c ? ? ? ? | ? 88+++++++++++++++++++++++++++++
arch/arm/mach-
Quoted 7 lines
?arch/arm/mach-exynos4/include/mach/irqs.h | ? ?1 + ?arch/arm/mach-exynos4/include/mach/map.h ?| ? ?1 + ?arch/arm/plat-samsung/include/plat/devs.h | ? ?1 +?6 files changed, 104 insertions(+), 0 deletions(-) ?create mode 100644
arch/arm/mach-exynos4/dev-dwmci.carch/arm/mach- renamed from arch/arm/mach-exynos4/Kconfig +0
-0exynos4/Kconfig
Quoted 19 lines
index 5115b90..2ec5b96 100644
arch/arm/mach-exynos4/Kconfig +0
-0@@ -35,6 +35,11 @@ config EXYNOS4_DEV_SYSMMU? ? ? ?help
? ? ? ? ?Common setup code for SYSTEM MMU in EXYNOS4arch/arm/mach-exynos4/Kconfig +5
-0+config EXYNOS4_DEV_DWMCI + ? ? ? bool + ? ? ? help + ? ? ? ? Compile in platform device definitions for DWMCI +?config
EXYNOS4_SETUP_I2C1
? ? ? ?bool
? ? ? ?helparch/arm/mach-exynos4/Kconfig +0
-0@@ -200,6 +205,13 @@ comment "Configuration for HSMMC bus width"?menu "Use 8-bit bus width"
Quoted 8 lines
Quoted 6 lines
+config
EXYNOS4_DWMCI_8BIT
+ ? ? ? bool "DWMCI with 8-bit bus"
+ ? ? ? depends onEXYNOS4_DEV_DWMCI
+ ? ? ? help
+ ? ? ? ? Support DWMCI 8-bit bus.
+ ? ? ? ? If selected, Channel 1 is disabled.No it should be determined at runtime instead of compile time.
Quoted 7 lines
Sorry for that I don't understand your meaning.
Perhaps, you want to decide the width according to the board type at runtime? I expect the reason and description about your comment.
Bus width is board-specific information related with capability which is not determined in runtime.
So we should decide and choice bus width considering the board target before compiling.
It prohibit to make a single kernel as other platform does. As you know, now we can select multiple board support at exynos4. some board want to use 4-bit, other board want to use 8-bit. then how to select proper bus width?
Quoted 176 lines
Best regards,
Seungwon Jeon.Quoted 170 lines
arch/arm/mach-
Quoted 6 lines
+
?configEXYNOS4_SDHCI_CH0_8BIT
? ? ? ?bool "Channel 0 with 8-bit bus"
? ? ? ?helparch/arm/mach- renamed from arch/arm/mach-exynos4/Makefile +0
-0exynos4/Makefile
arch/arm/mach-
Quoted 12 lines
index 60fe5ec..eeeaada 100644
arch/arm/mach-exynos4/Makefile +0
-0@@ -43,6 +43,7 @@ obj-y ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? += dev-audio.o?obj-$(CONFIG_EXYNOS4_DEV_AHCI) ? ? ? ? += dev-ahci.o ?obj-$(CONFIG_EXYNOS4_DEV_PD) ? ? ? ? ? += dev-pd.o ?obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) ? ? ? += dev-sysmmu.o +obj-$(CONFIG_EXYNOS4_DEV_DWMCI) ? ? ? ?+= dev-dwmci.o
?obj-$(CONFIG_EXYNOS4_SETUP_FIMC) ? ? ? += setup-fimc.o ?obj-$(CONFIG_EXYNOS4_SETUP_I2C1) ? ? ? += setup-i2c1.o
arch/arm/mach- renamed from arch/arm/mach-exynos4/dev-dwmci.c +0
-0
exynos4/dev-dwmci.cQuoted 29 lines
new file mode 100644
index 0000000..a0defa4arch/arm/mach-exynos4/dev-dwmci.c new file +24
-0@@ -0,0 +1,88 @@ +/* +* linuxarch/arm/mach-exynos4/dev-dwmci.c +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* ? ? ? ? ? ? http://www.samsung.com +* +* Platform device for Synopsys DesignWare Mobile Storage IP +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/dma-mapping.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/mmc/dw_mmc.h> +#include <linux/mmc/host.h> +#include <linux/io.h> +#include <linux/gpio.h> + +#include <plat/devs.h> arch/arm/mach-exynos4/dev-dwmci.c line 34
Quoted 10 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +10
-0+#include <plat/cpu.h> +#include <plat/gpio-cfg.h> + +#include <mach/map.h> + +#ifdef EXYNOS4_DWMCI_8BIT +#define BUS_WIDTH 8 +#else +#define BUS_WIDTH 4 +#endif Right, each board can modify the bus width. so it needs the helper function to setup.
arch/arm/mach-exynos4/dev-dwmci.c
Quoted 12 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +12
-0+ +static int exynos4_dwmci_get_ocr (u32 slot_id) +{ + ? ? ? return MMC_VDD_32_33 | MMC_VDD_33_34; +} + +static int exynos4_dwmci_get_bus_wd (u32 slot_id) +{ + ? ? ? return BUS_WIDTH; +} + +static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void*data)
arch/arm/mach-
Quoted 43 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +42
-0+{ + ? ? ? return 0; +} + +static struct resource exynos4_dwmci_resource[] = { + ? ? ? [0] = { + ? ? ? ? ? ? ? .start = EXYNOS4_PA_DWMCI, + ? ? ? ? ? ? ? .end ? = EXYNOS4_PA_DWMCI + SZ_4K - 1, + ? ? ? ? ? ? ? .flags = IORESOURCE_MEM, + ? ? ? }, + ? ? ? [1] = { + ? ? ? ? ? ? ? .start = IRQ_DWMCI, + ? ? ? ? ? ? ? .end ? = IRQ_DWMCI, + ? ? ? ? ? ? ? .flags = IORESOURCE_IRQ, + ? ? ? } +}; + +static struct dw_mci_board exynos4_dwci_pdata = { + ? ? ? .num_slots ? ? ? ? ? ? ? ? ? ? ?= 1, + ? ? ? .quirks ? ? ? ? ? ? ? ? ? ? ? ? = DW_MCI_QUIRK_BROKEN_CARD_DETECTION, + ? ? ? .bus_hz ? ? ? ? ? ? ? ? ? ? ? ? = 80*1000*1000, + ? ? ? .detect_delay_ms ? ? ? ?= 200, + ? ? ? .init ? ? ? ? ? ? ? ? ? ? ? ? ? = exynos4_dwmci_init, + ? ? ? .get_ocr ? ? ? ? ? ? ? ? ? ? ? ?= exynos4_dwmci_get_ocr, + ? ? ? .get_bus_wd ? ? ? ? ? ? ? ? ? ? = exynos4_dwmci_get_bus_wd, + ? ? ? .select_slot ? ? ? ? ? ?= NULL, +}; + +static u64 exynos4_dwmci_dmamask =DMA_BIT_MASK (32 ); + +struct platform_device exynos4_device_dwmci = { + ? ? ? .name ? ? ? ? ? = "dw_mmc", + ? ? ? .id ? ? ? ? ? ? = -1, + ? ? ? .num_resources ?= ARRAY_SIZE(exynos4_dwmci_resource), + ? ? ? .resource ? ? ? = exynos4_dwmci_resource, + ? ? ? .dev ? ? ? ? ? ?= { + ? ? ? ? ? ? ? .dma_mask ? ? ? ? ? ? ? = &exynos4_dwmci_dmamask, + ? ? ? ? ? ? ? .coherent_dma_mask ? ? ?= DMA_BIT_MASK(32), + ? ? ? ? ? ? ? .platform_data ?= &exynos4_dwci_pdata, + ? ? ? }, +}; +arch/arm/mach- renamed from arch/arm/mach-exynos4/include/mach/irqs.h +0
-0
exynos4/include/mach/irqs.harch/arm/mach-
Quoted 12 lines
index 5d03730..b720246 100644
arch/arm/mach-exynos4/include/mach/irqs.h +1
-0@@ -107,6 +107,7 @@ ?#define IRQ_HSMMC1 ? ? ? ? ? ? COMBINER_IRQ(29, 1) ?#define IRQ_HSMMC2 ? ? ? ? ? ? COMBINER_IRQ(29, 2) ?#define IRQ_HSMMC3 ? ? ? ? ? ? COMBINER_IRQ(29, 3) +#define IRQ_DWMCI ? ? ? ? ? ? ?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.harch/arm/plat-
Quoted 12 lines
index 0009e77..352e500 100644
arch/arm/mach-exynos4/include/mach/map.h +0
-0@@ -94,6 +94,7 @@?#define
EXYNOS4_PA_MIPI_CSIS1? ? ? ? ?0x11890000?#define
EXYNOS4_PA_HSMMC(x)? ? ? ? ? ?(0x12510000 + ((x) *0x10000)) +#defineEXYNOS4_PA_DWMCI? ? ? ? ? ? ?0x12550000?#define
EXYNOS4_PA_SATA? ? ? ? ? ? ? ? ? ? ? ?0x12560000 ?#defineEXYNOS4_PA_SATAPHY? ? ? ? ? ?0x125D0000arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/devs.h +0
-0
samsung/include/plat/devs.hQuoted 14 lines
index e3b31c2..29fa1cf 100644
arch/arm/plat-samsung/include/plat/devs.h +1
-1@@ -112,6 +112,7 @@ extern struct platform_device exynos4_device_i2s2; ?extern struct platform_device exynos4_device_spdif; ?extern struct platform_device exynos4_device_pd[]; ?extern struct platform_device exynos4_device_ahci; +extern struct platform_device exynos4_device_dwmci; ?extern struct platform_device s5p6440_device_pcm; ?extern struct platform_device s5p6440_device_iis; --1.7.2.3
Quoted 2 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
Quoted 3 lines
the body of a message to majordomo at vger.kernel.org More majordomo info at ?http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung- soc" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at ?http://vger.kernel.org/majordomo-info.html
PATCH v2 1/1 ARM: EXYNOS4: Add platform device for dwmci driver.
Hi
Quoted 61 lines · Kyungmin Park
Quoted 6 lines · Seungwon Jeon
Hi,
Quoted 3 lines · Kyungmin Park
Quoted 1 line · Seungwon Jeon
This patch add platform devices for Synopsys DesignWare Multimedia
Card
Quoted 44 lines
Quoted 35 lines
Quoted 7 lines
Interface driver.
Signed-off-by Seungwon Jeon <[email protected]>--- arch/arm/mach-exynos4/Kconfig | 12 ++++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/dev-dwmci.c | 88+++++++++++++++++++++++++++++
arch/arm/mach-
Quoted 7 lines
arch/arm/mach-exynos4/include/mach/irqs.h | 1 + arch/arm/mach-exynos4/include/mach/map.h | 1 + arch/arm/plat-samsung/include/plat/devs.h | 1 + 6 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-exynos4/dev-dwmci.carch/arm/mach- renamed from arch/arm/mach-exynos4/Kconfig +0
-0exynos4/Kconfig
Quoted 19 lines
index 5115b90..2ec5b96 100644
arch/arm/mach-exynos4/Kconfig +5
-0@@ -35,6 +35,11 @@ config EXYNOS4_DEV_SYSMMU help Common setup code for SYSTEM MMU in EXYNOS4 +config EXYNOS4_DEV_DWMCI + bool + help + Compile in platform device definitions for DWMCI + config EXYNOS4_SETUP_I2C1 bool help@@ -200,6 +205,13 @@ comment "Configuration for HSMMC bus width" menu "Use 8-bit bus width"Quoted 8 lines
arch/arm/mach-exynos4/Kconfig comment "Configuration for HSMMC bus width" · line 213
Quoted 6 lines
arch/arm/mach-exynos4/Kconfig +6
-0+config EXYNOS4_DWMCI_8BIT + bool "DWMCI with 8-bit bus" + depends on EXYNOS4_DEV_DWMCI + help + Support DWMCI 8-bit bus. + If selected, Channel 1 is disabled.No it should be determined at runtime instead of compile time.
Quoted 2 lines
Sorry for that I don't understand your meaning.
Perhaps, you want to decide the width according to the board type atruntime?
Quoted 5 lines
I expect the reason and description about your comment. Bus width is board-specific information related with capability which is not determined in runtime.
So we should decide and choice bus width considering the board target before compiling.
Quoted 4 lines
It prohibit to make a single kernel as other platform does. As you know, now we can select multiple board support at exynos4. some board want to use 4-bit, other board want to use 8-bit. then how to select proper bus width?
Right, it can't be satisfied in single kernel image.
But device driver seems not to be bothered about value of get_bus_wd(). If value is more than four, it doesn't matter whether 4 or 8. I'll remove the configuration option.
Thank you.
Quoted 186 lines
Quoted 25 lines
Best regards,
Seungwon Jeon.Quoted 20 lines
arch/arm/mach-
Quoted 6 lines
arch/arm/mach-exynos4/Kconfig +1
-0+ config EXYNOS4_SDHCI_CH0_8BIT bool "Channel 0 with 8-bit bus" helparch/arm/mach- renamed from arch/arm/mach-exynos4/Makefile +0
-0exynos4/Makefile
arch/arm/mach-
Quoted 12 lines
index 60fe5ec..eeeaada 100644
arch/arm/mach-exynos4/Makefile +1
-0@@ -43,6 +43,7 @@ obj-y += dev-audio.o obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o obj-$(CONFIG_EXYNOS4_DEV_PD) += dev-pd.o obj-$(CONFIG_EXYNOS4_DEV_SYSMMU) += dev-sysmmu.o +obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o obj-$(CONFIG_EXYNOS4_SETUP_FIMC) += setup-fimc.o obj-$(CONFIG_EXYNOS4_SETUP_I2C1) += setup-i2c1.oarch/arm/mach- renamed from arch/arm/mach-exynos4/dev-dwmci.c +0
-0
exynos4/dev-dwmci.cQuoted 14 lines
Quoted 6 lines
Quoted 6 lines
new file mode 100644
index 0000000..a0defa4arch/arm/mach-exynos4/dev-dwmci.c new file +1
-0@@ -0,0 +1,88 @@ +/* Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c
Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +8
-0+* linuxarch/arm/mach-exynos4/dev-dwmci.c +* +* Copyright (c) 2011 Samsung Electronics Co., Ltd. +* http://www.samsung.com +* +* Platform device for Synopsys DesignWare Mobile Storage IP +* +* This program is free software; you can redistribute it and/or modify
Quoted 1 line
Quoted 1 line
arch/arm/mach-exynos4/dev-dwmci.c line 10
Quoted 1 line
arch/arm/mach-exynos4/dev-dwmci.c new file +1
-0+* it under the terms of the GNU General Public License as published by
Quoted 27 lines
Quoted 27 lines
Quoted 14 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +14
-0+* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +*/ + +#include <linux/kernel.h> +#include <linux/dma-mapping.h> +#include <linux/platform_device.h> +#include <linux/interrupt.h> +#include <linux/mmc/dw_mmc.h> +#include <linux/mmc/host.h> +#include <linux/io.h> +#include <linux/gpio.h> + +#include <plat/devs.h> arch/arm/mach-exynos4/dev-dwmci.c line 34
Quoted 10 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +10
-0+#include <plat/cpu.h> +#include <plat/gpio-cfg.h> + +#include <mach/map.h> + +#ifdef EXYNOS4_DWMCI_8BIT +#define BUS_WIDTH 8 +#else +#define BUS_WIDTH 4 +#endif Right, each board can modify the bus width. so it needs the helper function to setup.
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +4
-0+ +static int exynos4_dwmci_get_ocr (u32 slot_id) +{ +return MMC_VDD_32_33 |MMC_VDD_33_34 ;Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c
Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +8
-0+} + +static int exynos4_dwmci_get_bus_wd (u32 slot_id) +{ +return BUS_WIDTH ; +} + +static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler,void
Quoted 13 lines
Quoted 13 lines
*data)
Quoted 12 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +12
-0+{ +return 0 ; +} + +static struct resource exynos4_dwmci_resource[] = { + [0 ] = { + .start =EXYNOS4_PA_DWMCI , + .end =EXYNOS4_PA_DWMCI +SZ_4K -1 , + .flags =IORESOURCE_MEM , + }, + [1 ] = { + .start =IRQ_DWMCI ,Quoted 8 lines
Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c
Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +8
-0+ .end = IRQ_DWMCI, + .flags = IORESOURCE_IRQ, + } +}; + +static struct dw_mci_board exynos4_dwci_pdata = { + .num_slots =1 , + .quirks =
DW_MCI_QUIRK_BROKEN_CARD_DETECTION,Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +15
-0+ .bus_hz = 80*1000*1000, + .detect_delay_ms = 200, + .init = exynos4_dwmci_init, + .get_ocr = exynos4_dwmci_get_ocr, + .get_bus_wd = exynos4_dwmci_get_bus_wd, + .select_slot = NULL, +}; + +static u64 exynos4_dwmci_dmamask =DMA_BIT_MASK (32 ); + +struct platform_device exynos4_device_dwmci = { + .name ="dw_mmc" , + .id =-1 , + .num_resources =ARRAY_SIZE (exynos4_dwmci_resource), + .resource = exynos4_dwmci_resource,Quoted 8 lines
Quoted 8 lines
Review
Quoted 8 lines
arch/arm/mach-exynos4/dev-dwmci.c new file +7
-0+ .dev = { + .dma_mask = &exynos4_dwmci_dmamask, + .coherent_dma_mask = DMA_BIT_MASK(32), + .platform_data = &exynos4_dwci_pdata, + }, +}; +(quoted diff) +0
-0b/arch/arm/mach-
Quoted 10 lines
Quoted 10 lines
exynos4/include/mach/irqs.hQuoted 9 lines
index 5d03730..b720246 100644
arch/arm/mach-exynos4/include/mach/irqs.h +1
-0@@ -107,6 +107,7 @@#define IRQ_HSMMC1 COMBINER_IRQ(29, 1)#define IRQ_HSMMC2 COMBINER_IRQ(29, 2)#define IRQ_HSMMC3 COMBINER_IRQ(29, 3) +#define IRQ_DWMCI COMBINER_IRQ(29, 4)Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
arch/arm/mach-exynos4/include/mach/irqs.h +0
-0#define IRQ_MIPI_CSIS0 COMBINER_IRQ(30, 0)#define IRQ_MIPI_CSIS1 COMBINER_IRQ(30, 1)(quoted diff) +0
-0b/arch/arm/mach-
Quoted 7 lines
Quoted 7 lines
exynos4/include/mach/map.hQuoted 6 lines
index 0009e77..352e500 100644
arch/arm/mach-exynos4/include/mach/map.h +0
-0@@ -94,6 +94,7 @@#define EXYNOS4_PA_MIPI_CSIS1 0x11890000Quoted 6 lines
Quoted 6 lines
Review
Quoted 6 lines
arch/arm/mach-exynos4/include/mach/map.h +1
-0#define EXYNOS4_PA_HSMMC (x) (0x12510000 + ((x) * 0x10000)) +#define EXYNOS4_PA_DWMCI 0x12550000#define EXYNOS4_PA_SATA 0x12560000#define EXYNOS4_PA_SATAPHY 0x125D0000(quoted diff) +0
-0b/arch/arm/plat-
Quoted 10 lines
Quoted 10 lines
samsung/include/plat/devs.hQuoted 9 lines
index e3b31c2..29fa1cf 100644
arch/arm/plat-samsung/include/plat/devs.h +1
-0@@ -112,6 +112,7 @@ extern struct platform_device exynos4_device_i2s2;extern struct platform_device exynos4_device_spdif;extern struct platform_device exynos4_device_pd[];extern struct platform_device exynos4_device_ahci; +extern struct platform_device exynos4_device_dwmci;Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
arch/arm/plat-samsung/include/plat/devs.h +0
-1extern struct platform_device s5p6440_device_pcm;extern struct platform_device s5p6440_device_iis; --1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-
Quoted 6 lines
Quoted 6 lines
soc" in
Quoted 3 lines
the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-
Quoted 5 lines
Quoted 3 lines
soc" in
the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html