* [PATCH] SDHCI-S3C fixes and enhancements (platform specific code)
@ 2010-06-09 9:39 Marek Szyprowski
2010-06-09 9:39 ` [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers Marek Szyprowski
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
This series includes various fixes to sdhci-s3c driver as well as a
major feature enhancement. This patch series is prepared to get complete
sdhci support on Samsung Aquila board.
A quick overview on the patches:
#1 - trivial compilation break fix
#2 - add support for various methods of notifying the host driver about
the card insertion/removal (should be compatible with existing code)
#3 - add sdhci driver platform data for all hsmmc controllers on Samsung
Aquila board
Changes to the sdhci-s3c driver itself will be posted in a separate
patch series for easier merging, please refer to the "[PATCH] SDHCI-S3C
fixes and enhancements (driver specific code)" thread.
A complete list of patches:
[PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
[PATCH 2/3] Samsung: sdhci-s3c: add support for new card detection methods
[PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (platform specific code) Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-11 0:56 ` Kukjin Kim
2010-06-09 9:39 ` [PATCH 2/3] Samsung: sdhci-s3c: add support for new card detection methods Marek Szyprowski
2010-06-09 9:39 ` [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices Marek Szyprowski
2 siblings, 1 reply; 14+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
This patch fixes the following compilation problem if only NCP machine
is selected:
arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function ?s3c6410_default_sdhci2?
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/plat-samsung/include/plat/sdhci.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 13f9fb2..c2044e5 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void) { }
#else
static inline void s3c6410_default_sdhci0(void) { }
static inline void s3c6410_default_sdhci1(void) { }
+static inline void s3c6410_default_sdhci2(void) { }
static inline void s3c6400_default_sdhci0(void) { }
static inline void s3c6400_default_sdhci1(void) { }
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/3] Samsung: sdhci-s3c: add support for new card detection methods
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (platform specific code) Marek Szyprowski
2010-06-09 9:39 ` [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-09 9:39 ` [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices Marek Szyprowski
2 siblings, 0 replies; 14+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
On some Samsung SoCs not all SDHCI controllers have card detect (CD)
line. For some embedded designs it is not even needed, because ususally
the device (like SDIO flash memory or wifi controller) is permanently
wired to the controller. There are also systems which have a card detect
line connected to some of the external interrupt lines or the presence
of the card depends on some other actions (like enabling a power
regulator).
This patch adds support for all these cases. The following card
detection methods are possible:
1. internal sdhci host card detect line
2. external event
3. no card detect line, controller will poll for the card
4. no card detect line, card is permanently wired to the controller
(once detected host won't poll it any more)
By default, all existing code would use method #1, what is compatible
with the previous version of the driver.
In case of external event, two callbacks must be provided in platdata:
ext_cd_init and ext_cd_cleanup. Both of them get a callback to a
function that notifies the s3c-sdhci host contoller as their argument.
That callback function should be called from the even dispatcher to let
host notice the card insertion/removal.
This patch adds all required changes to platform support code.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s3c64xx/setup-sdhci-gpio.c | 14 ++++++++++----
arch/arm/mach-s5pc100/setup-sdhci-gpio.c | 21 +++++++++++++++------
arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 22 ++++++++++++++++------
arch/arm/plat-samsung/dev-hsmmc.c | 3 +++
arch/arm/plat-samsung/dev-hsmmc1.c | 3 +++
arch/arm/plat-samsung/dev-hsmmc2.c | 3 +++
arch/arm/plat-samsung/include/plat/sdhci.h | 23 +++++++++++++++++++++++
7 files changed, 73 insertions(+), 16 deletions(-)
diff --git a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
index a58c0cc..54c311c 100644
--- a/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
@@ -22,6 +22,7 @@
void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
unsigned int end;
@@ -33,12 +34,15 @@ void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
- s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(2));
+ }
}
void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
unsigned int end;
@@ -50,8 +54,10 @@ void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
- s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S3C64XX_GPG(6), S3C_GPIO_SFN(3));
+ }
}
void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 7769c76..e4b6739 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -23,6 +23,7 @@
void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
unsigned int end;
unsigned int num;
@@ -47,12 +48,15 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
}
}
- s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
+ }
}
void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
unsigned int end;
@@ -64,12 +68,15 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
- s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
+ }
}
void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
unsigned int end;
@@ -81,6 +88,8 @@ void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
- s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
+ }
}
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
index fe7d86d..b3ad243 100644
--- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c
@@ -21,9 +21,11 @@
#include <mach/gpio.h>
#include <plat/gpio-cfg.h>
#include <plat/regs-sdhci.h>
+#include <plat/sdhci.h>
void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
/* Set all the necessary GPG0/GPG1 pins to special-function 2 */
@@ -48,12 +50,15 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
break;
}
- s3c_gpio_setpull(S5PV210_GPG0(2), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV210_GPG0(2), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S5PV210_GPG0(2), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV210_GPG0(2), S3C_GPIO_SFN(2));
+ }
}
void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
/* Set all the necessary GPG1[0:1] pins to special-function 2 */
@@ -68,12 +73,15 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
- s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV210_GPG1(2), S3C_GPIO_SFN(2));
+ }
}
void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
{
+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio;
/* Set all the necessary GPG2[0:1] pins to special-function 2 */
@@ -99,6 +107,8 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
break;
}
- s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP);
- s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2));
+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
+ s3c_gpio_setpull(S5PV210_GPG2(2), S3C_GPIO_PULL_UP);
+ s3c_gpio_cfgpin(S5PV210_GPG2(2), S3C_GPIO_SFN(2));
+ }
}
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
index 4c05b39..238c6a1 100644
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
@@ -60,6 +60,9 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata;
set->max_width = pd->max_width;
+ set->cd_type = pd->cd_type;
+ set->ext_cd_init = pd->ext_cd_init;
+ set->ext_cd_cleanup = pd->ext_cd_cleanup;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
index e49bc4c..1da8481 100644
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -60,6 +60,9 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata;
set->max_width = pd->max_width;
+ set->cd_type = pd->cd_type;
+ set->ext_cd_init = pd->ext_cd_init;
+ set->ext_cd_cleanup = pd->ext_cd_cleanup;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
index 824580b..f11b1ca 100644
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -61,6 +61,9 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata;
set->max_width = pd->max_width;
+ set->cd_type = pd->cd_type;
+ set->ext_cd_init = pd->ext_cd_init;
+ set->ext_cd_cleanup = pd->ext_cd_cleanup;
if (pd->cfg_gpio)
set->cfg_gpio = pd->cfg_gpio;
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index c2044e5..6f00a76 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -20,10 +20,27 @@ struct mmc_host;
struct mmc_card;
struct mmc_ios;
+enum cd_types {
+ S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */
+ S3C_SDHCI_CD_EXTERNAL, /* use external method (like GPIO interrupt) */
+ S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */
+ S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
+};
+
/**
* struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
* @max_width: The maximum number of data bits supported.
* @host_caps: Standard MMC host capabilities bit field.
+ * @cd_type: Type of Card Detection method (see cd_types enum above)
+ * @ext_cd_init: Initialize external card detect subsystem. Called on
+ * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
+ * notify_func argument is a callback to the sdhci-s3c driver
+ * that triggers the card detection event. Callback arguments:
+ * dev is pointer to platform device of the host controller,
+ * state is new state of the card (0 - removed, 1 - inserted).
+ * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
+ * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
+ * notify_func argument is the same callback as for ext_cd_init.
* @cfg_gpio: Configure the GPIO for a specific card bit-width
* @cfg_card: Configure the interface for a specific card and speed. This
* is necessary the controllers and/or GPIO blocks require the
@@ -37,9 +54,15 @@ struct mmc_ios;
struct s3c_sdhci_platdata {
unsigned int max_width;
unsigned int host_caps;
+ enum cd_types cd_type;
char **clocks; /* set of clock sources */
+ int (*ext_cd_init)(void (*notify_func)(struct platform_device *,
+ int state));
+ int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
+ int state));
+
void (*cfg_gpio)(struct platform_device *dev, int width);
void (*cfg_card)(struct platform_device *dev,
void __iomem *regbase,
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (platform specific code) Marek Szyprowski
2010-06-09 9:39 ` [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers Marek Szyprowski
2010-06-09 9:39 ` [PATCH 2/3] Samsung: sdhci-s3c: add support for new card detection methods Marek Szyprowski
@ 2010-06-09 9:39 ` Marek Szyprowski
2010-06-11 5:18 ` Ben Dooks
2 siblings, 1 reply; 14+ messages in thread
From: Marek Szyprowski @ 2010-06-09 9:39 UTC (permalink / raw)
To: linux-arm-kernel
This patch add support for SDHCI blocks on Samsung Aquila board. The
following host controllers are defined:
1. Internal MoviNAND device (permanently wired to the controller)
2. Internal WiFI SDIO device (card is activated by power regualor)
3. External MMC/SD socket (card detection is provided by external
gpio interrupt)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/Kconfig | 4 ++
arch/arm/mach-s5pv210/mach-aquila.c | 66 +++++++++++++++++++++++++++++++++++
2 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index b7a2f38..dcc9d74 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -57,7 +57,11 @@ config MACH_AQUILA
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
select S5PV210_SETUP_FB_24BPP
+ select S5PV210_SETUP_SDHCI
select S3C_DEV_FB
+ select S3C_DEV_HSMMC
+ select S3C_DEV_HSMMC1
+ select S3C_DEV_HSMMC2
select S5PC110_DEV_ONENAND
help
Machine support for the Samsung Aquila target based on S5PC110 SoC
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index fb9dbb2..1b7fe79 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/serial_core.h>
#include <linux/fb.h>
+#include <linux/gpio.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -22,12 +23,15 @@
#include <mach/map.h>
#include <mach/regs-clock.h>
#include <mach/regs-fb.h>
+#include <mach/regs-gpio.h>
#include <plat/regs-serial.h>
#include <plat/s5pv210.h>
#include <plat/devs.h>
#include <plat/cpu.h>
#include <plat/fb.h>
+#include <plat/gpio-cfg.h>
+#include <plat/sdhci.h>
/* Following are default values for UCON, ULCON and UFCON UART registers */
#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -116,9 +120,66 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
.setup_gpio = s5pv210_fb_gpio_setup_24bpp,
};
+/* MoviNAND */
+static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
+ .max_width = 4,
+ .cd_type = S3C_SDHCI_CD_PERMANENT,
+};
+
+/* Wireless LAN */
+static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
+ .max_width = 4,
+ .cd_type = S3C_SDHCI_CD_EXTERNAL,
+ /* ext_cd_{init,cleanup} callbacks will be added later */
+};
+
+/* External Flash */
+#define AQUILA_EXT_FLASH_IRQ IRQ_EINT(28) /* S5PV210_GPH3(4) */
+#define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
+#define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
+
+static irqreturn_t aquila_ext_flash_card_detect_isr(int irq, void *dev_id)
+{
+ void (*notify_func)(struct platform_device *, int state) = dev_id;
+ notify_func(&s3c_device_hsmmc2, !gpio_get_value(AQUILA_EXT_FLASH_CD));
+ return IRQ_HANDLED;
+}
+
+static int aquila_ext_flash_card_detect_init(
+ void (*notify_func)(struct platform_device *, int state))
+{
+ gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN");
+ gpio_direction_output(AQUILA_EXT_FLASH_EN, 1);
+
+ if (request_irq(AQUILA_EXT_FLASH_IRQ, aquila_ext_flash_card_detect_isr,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
+ "SDHCI card detect", notify_func))
+ printk(KERN_ERR "Error: cannot request irq for External Flash\n");
+ return 0;
+}
+
+static int aquila_ext_flash_card_detect_cleanup(
+ void (*notify_func)(struct platform_device *, int state))
+{
+ free_irq(AQUILA_EXT_FLASH_IRQ, notify_func);
+ gpio_direction_output(AQUILA_EXT_FLASH_EN, 0);
+ gpio_free(AQUILA_EXT_FLASH_EN);
+ return 0;
+}
+
+static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
+ .max_width = 4,
+ .cd_type = S3C_SDHCI_CD_EXTERNAL,
+ .ext_cd_init = aquila_ext_flash_card_detect_init,
+ .ext_cd_cleanup = aquila_ext_flash_card_detect_cleanup,
+};
+
static struct platform_device *aquila_devices[] __initdata = {
&s3c_device_fb,
&s5pc110_device_onenand,
+ &s3c_device_hsmmc0,
+ &s3c_device_hsmmc1,
+ &s3c_device_hsmmc2,
};
static void __init aquila_map_io(void)
@@ -130,6 +191,11 @@ static void __init aquila_map_io(void)
static void __init aquila_machine_init(void)
{
+ /* SDHCI */
+ s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
+ s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
+ s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
+
/* FB */
s3c_fb_set_platdata(&aquila_lcd_pdata);
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
2010-06-09 9:39 ` [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers Marek Szyprowski
@ 2010-06-11 0:56 ` Kukjin Kim
2010-06-11 3:30 ` Kyungmin Park
2010-06-11 5:59 ` [PATCH v2] " Marek Szyprowski
0 siblings, 2 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-06-11 0:56 UTC (permalink / raw)
To: linux-arm-kernel
Marek Szyprowski wrote:
>
> This patch fixes the following compilation problem if only NCP machine
> is selected:
>
> arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
> arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function
> ?s3c6410_default_sdhci2?
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> arch/arm/plat-samsung/include/plat/sdhci.h | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
> samsung/include/plat/sdhci.h
> index 13f9fb2..c2044e5 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void) { }
> #else
> static inline void s3c6410_default_sdhci0(void) { }
> static inline void s3c6410_default_sdhci1(void) { }
> +static inline void s3c6410_default_sdhci2(void) { }
> static inline void s3c6400_default_sdhci0(void) { }
> static inline void s3c6400_default_sdhci1(void) { }
>
> --
Maybe missed in Maurus' patch 'S3C64XX: add HSMMC2 support'
commit 92b118f6968ae0788ac659af47b464acd9a754a1
Also need 'static inline s3c6400_default_sdhci2(void) { }'
Could you re-submit updated patch including s3c6400_default_sdhci2()?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
2010-06-11 0:56 ` Kukjin Kim
@ 2010-06-11 3:30 ` Kyungmin Park
2010-06-11 3:58 ` Kukjin Kim
2010-06-11 5:59 ` [PATCH v2] " Marek Szyprowski
1 sibling, 1 reply; 14+ messages in thread
From: Kyungmin Park @ 2010-06-11 3:30 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 11, 2010 at 9:56 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> Marek Szyprowski wrote:
>>
>> This patch fixes the following compilation problem if only NCP machine
>> is selected:
>>
>> arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
>> arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function
>> ?s3c6410_default_sdhci2?
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> ?arch/arm/plat-samsung/include/plat/sdhci.h | ? ?1 +
>> ?1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
>> samsung/include/plat/sdhci.h
>> index 13f9fb2..c2044e5 100644
>> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
>> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
>> @@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void) { }
>> ?#else
>> ?static inline void s3c6410_default_sdhci0(void) { }
>> ?static inline void s3c6410_default_sdhci1(void) { }
>> +static inline void s3c6410_default_sdhci2(void) { }
>> ?static inline void s3c6400_default_sdhci0(void) { }
>> ?static inline void s3c6400_default_sdhci1(void) { }
>>
>> --
>
> Maybe missed in Maurus' patch 'S3C64XX: add HSMMC2 support'
> commit 92b118f6968ae0788ac659af47b464acd9a754a1
Which kernel tree do you use?
it's against the latest kernel.
Thank you,
Kyungmin Park
>
> Also need 'static inline s3c6400_default_sdhci2(void) { }'
> Could you re-submit updated patch including s3c6400_default_sdhci2()?
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
>
> --
> 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
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
2010-06-11 3:30 ` Kyungmin Park
@ 2010-06-11 3:58 ` Kukjin Kim
2010-06-11 4:34 ` Kyungmin Park
0 siblings, 1 reply; 14+ messages in thread
From: Kukjin Kim @ 2010-06-11 3:58 UTC (permalink / raw)
To: linux-arm-kernel
Kyungmin Park wrote:
>
> On Fri, Jun 11, 2010 at 9:56 AM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> > Marek Szyprowski wrote:
> >>
> >> This patch fixes the following compilation problem if only NCP machine
> >> is selected:
> >>
> >> arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
> >> arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function
> >> ?s3c6410_default_sdhci2?
> >>
> >> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >> ---
> >> arch/arm/plat-samsung/include/plat/sdhci.h | 1 +
> >> 1 files changed, 1 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
> >> samsung/include/plat/sdhci.h
> >> index 13f9fb2..c2044e5 100644
> >> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> >> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> >> @@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void) { }
> >> #else
> >> static inline void s3c6410_default_sdhci0(void) { }
> >> static inline void s3c6410_default_sdhci1(void) { }
> >> +static inline void s3c6410_default_sdhci2(void) { }
> >> static inline void s3c6400_default_sdhci0(void) { }
> >> static inline void s3c6400_default_sdhci1(void) { }
> >>
> >> --
> >
> > Maybe missed in Maurus' patch 'S3C64XX: add HSMMC2 support'
> > commit 92b118f6968ae0788ac659af47b464acd9a754a1
>
> Which kernel tree do you use?
> it's against the latest kernel.
>
Of course, Linus' 35-rc2.
Any problem?
> >
> > Also need 'static inline s3c6400_default_sdhci2(void) { }'
> > Could you re-submit updated patch including s3c6400_default_sdhci2()?
> >
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
2010-06-11 3:58 ` Kukjin Kim
@ 2010-06-11 4:34 ` Kyungmin Park
2010-06-11 6:26 ` Kukjin Kim
0 siblings, 1 reply; 14+ messages in thread
From: Kyungmin Park @ 2010-06-11 4:34 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Kukjin Kim [mailto:kgene.kim at samsung.com]
> Sent: Friday, June 11, 2010 12:59 PM
> To: 'Kyungmin Park'
> Cc: 'Marek Szyprowski'; linux-arm-kernel at lists.infradead.org; linux-
> samsung-soc at vger.kernel.org; linux-mmc at vger.kernel.org; ben-
> linux at fluff.org
> Subject: RE: [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
>
> Kyungmin Park wrote:
> >
> > On Fri, Jun 11, 2010 at 9:56 AM, Kukjin Kim <kgene.kim@samsung.com>
> wrote:
> > > Marek Szyprowski wrote:
> > >>
> > >> This patch fixes the following compilation problem if only NCP
> machine
> > >> is selected:
> > >>
> > >> arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
> > >> arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of
> function
> > >> ?s3c6410_default_sdhci2?
> > >>
> > >> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > >> ---
> > >> arch/arm/plat-samsung/include/plat/sdhci.h | 1 +
> > >> 1 files changed, 1 insertions(+), 0 deletions(-)
> > >>
> > >> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h
> b/arch/arm/plat-
> > >> samsung/include/plat/sdhci.h
> > >> index 13f9fb2..c2044e5 100644
> > >> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> > >> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> > >> @@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void)
> { }
> > >> #else
> > >> static inline void s3c6410_default_sdhci0(void) { }
> > >> static inline void s3c6410_default_sdhci1(void) { }
> > >> +static inline void s3c6410_default_sdhci2(void) { }
> > >> static inline void s3c6400_default_sdhci0(void) { }
> > >> static inline void s3c6400_default_sdhci1(void) { }
> > >>
> > >> --
> > >
> > > Maybe missed in Maurus' patch 'S3C64XX: add HSMMC2 support'
> > > commit 92b118f6968ae0788ac659af47b464acd9a754a1
> >
> > Which kernel tree do you use?
> > it's against the latest kernel.
> >
> Of course, Linus' 35-rc2.
We used 63a07cb64ccc3ceae619d3298545d602ab5ecd38
And there's no s3c6410_default_sdhci2(void) .
Thank you,
Kyungmin Park
> Any problem?
>
> > >
> > > Also need 'static inline s3c6400_default_sdhci2(void) { }'
> > > Could you re-submit updated patch including s3c6400_default_sdhci2()?
> > >
>
>
> Thanks.
>
> Best regards,
> Kgene.
> --
> Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
> SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices
2010-06-09 9:39 ` [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices Marek Szyprowski
@ 2010-06-11 5:18 ` Ben Dooks
2010-06-11 5:29 ` Marek Szyprowski
2010-06-11 6:05 ` Kyungmin Park
0 siblings, 2 replies; 14+ messages in thread
From: Ben Dooks @ 2010-06-11 5:18 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 09, 2010 at 11:39:05AM +0200, Marek Szyprowski wrote:
> This patch add support for SDHCI blocks on Samsung Aquila board. The
> following host controllers are defined:
> 1. Internal MoviNAND device (permanently wired to the controller)
> 2. Internal WiFI SDIO device (card is activated by power regualor)
> 3. External MMC/SD socket (card detection is provided by external
> gpio interrupt)
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
> arch/arm/mach-s5pv210/Kconfig | 4 ++
> arch/arm/mach-s5pv210/mach-aquila.c | 66 +++++++++++++++++++++++++++++++++++
> 2 files changed, 70 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
> index b7a2f38..dcc9d74 100644
> --- a/arch/arm/mach-s5pv210/Kconfig
> +++ b/arch/arm/mach-s5pv210/Kconfig
> @@ -57,7 +57,11 @@ config MACH_AQUILA
> select CPU_S5PV210
> select ARCH_SPARSEMEM_ENABLE
> select S5PV210_SETUP_FB_24BPP
> + select S5PV210_SETUP_SDHCI
> select S3C_DEV_FB
> + select S3C_DEV_HSMMC
> + select S3C_DEV_HSMMC1
> + select S3C_DEV_HSMMC2
> select S5PC110_DEV_ONENAND
> help
> Machine support for the Samsung Aquila target based on S5PC110 SoC
> diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
> index fb9dbb2..1b7fe79 100644
> --- a/arch/arm/mach-s5pv210/mach-aquila.c
> +++ b/arch/arm/mach-s5pv210/mach-aquila.c
> @@ -13,6 +13,7 @@
> #include <linux/init.h>
> #include <linux/serial_core.h>
> #include <linux/fb.h>
> +#include <linux/gpio.h>
>
> #include <asm/mach/arch.h>
> #include <asm/mach/map.h>
> @@ -22,12 +23,15 @@
> #include <mach/map.h>
> #include <mach/regs-clock.h>
> #include <mach/regs-fb.h>
> +#include <mach/regs-gpio.h>
>
> #include <plat/regs-serial.h>
> #include <plat/s5pv210.h>
> #include <plat/devs.h>
> #include <plat/cpu.h>
> #include <plat/fb.h>
> +#include <plat/gpio-cfg.h>
> +#include <plat/sdhci.h>
>
> /* Following are default values for UCON, ULCON and UFCON UART registers */
> #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
> @@ -116,9 +120,66 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
> .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
> };
>
> +/* MoviNAND */
> +static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
> + .max_width = 4,
> + .cd_type = S3C_SDHCI_CD_PERMANENT,
> +};
> +
> +/* Wireless LAN */
> +static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
> + .max_width = 4,
> + .cd_type = S3C_SDHCI_CD_EXTERNAL,
> + /* ext_cd_{init,cleanup} callbacks will be added later */
> +};
> +
> +/* External Flash */
> +#define AQUILA_EXT_FLASH_IRQ IRQ_EINT(28) /* S5PV210_GPH3(4) */
> +#define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
> +#define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
> +
> +static irqreturn_t aquila_ext_flash_card_detect_isr(int irq, void *dev_id)
> +{
> + void (*notify_func)(struct platform_device *, int state) = dev_id;
> + notify_func(&s3c_device_hsmmc2, !gpio_get_value(AQUILA_EXT_FLASH_CD));
> + return IRQ_HANDLED;
> +}
hmm, not very nice this.
I'd much prefer to see a gpio-based handler in either the sdhci core or
at-least in the driver's directory since I'm sure that his is (a) something
Thomas Abrahama has already published patches for (which do need work) and
(b) probably going to be needed by other boards and/or other architectures.
> +static int aquila_ext_flash_card_detect_init(
> + void (*notify_func)(struct platform_device *, int state))
> +{
> + gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN");
> + gpio_direction_output(AQUILA_EXT_FLASH_EN, 1);
> +
> + if (request_irq(AQUILA_EXT_FLASH_IRQ, aquila_ext_flash_card_detect_isr,
> + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
> + "SDHCI card detect", notify_func))
> + printk(KERN_ERR "Error: cannot request irq for External Flash\n");
> + return 0;
> +}
> +
> +static int aquila_ext_flash_card_detect_cleanup(
> + void (*notify_func)(struct platform_device *, int state))
> +{
> + free_irq(AQUILA_EXT_FLASH_IRQ, notify_func);
> + gpio_direction_output(AQUILA_EXT_FLASH_EN, 0);
> + gpio_free(AQUILA_EXT_FLASH_EN);
> + return 0;
> +}
> +
> +static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
> + .max_width = 4,
> + .cd_type = S3C_SDHCI_CD_EXTERNAL,
> + .ext_cd_init = aquila_ext_flash_card_detect_init,
> + .ext_cd_cleanup = aquila_ext_flash_card_detect_cleanup,
> +};
> +
> static struct platform_device *aquila_devices[] __initdata = {
> &s3c_device_fb,
> &s5pc110_device_onenand,
> + &s3c_device_hsmmc0,
> + &s3c_device_hsmmc1,
> + &s3c_device_hsmmc2,
> };
>
> static void __init aquila_map_io(void)
> @@ -130,6 +191,11 @@ static void __init aquila_map_io(void)
>
> static void __init aquila_machine_init(void)
> {
> + /* SDHCI */
> + s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
> + s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
> + s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
> +
> /* FB */
> s3c_fb_set_platdata(&aquila_lcd_pdata);
>
> --
> 1.7.1.240.g225c
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices
2010-06-11 5:18 ` Ben Dooks
@ 2010-06-11 5:29 ` Marek Szyprowski
2010-06-11 6:05 ` Kyungmin Park
1 sibling, 0 replies; 14+ messages in thread
From: Marek Szyprowski @ 2010-06-11 5:29 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Friday, June 11, 2010 7:18 AM Ben Dooks wrote:
> On Wed, Jun 09, 2010 at 11:39:05AM +0200, Marek Szyprowski wrote:
> > This patch add support for SDHCI blocks on Samsung Aquila board. The
> > following host controllers are defined:
> > 1. Internal MoviNAND device (permanently wired to the controller)
> > 2. Internal WiFI SDIO device (card is activated by power regualor)
> > 3. External MMC/SD socket (card detection is provided by external
> > gpio interrupt)
> >
> > Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> > arch/arm/mach-s5pv210/Kconfig | 4 ++
> > arch/arm/mach-s5pv210/mach-aquila.c | 66
> +++++++++++++++++++++++++++++++++++
> > 2 files changed, 70 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-
> s5pv210/Kconfig
> > index b7a2f38..dcc9d74 100644
> > --- a/arch/arm/mach-s5pv210/Kconfig
> > +++ b/arch/arm/mach-s5pv210/Kconfig
> > @@ -57,7 +57,11 @@ config MACH_AQUILA
> > select CPU_S5PV210
> > select ARCH_SPARSEMEM_ENABLE
> > select S5PV210_SETUP_FB_24BPP
> > + select S5PV210_SETUP_SDHCI
> > select S3C_DEV_FB
> > + select S3C_DEV_HSMMC
> > + select S3C_DEV_HSMMC1
> > + select S3C_DEV_HSMMC2
> > select S5PC110_DEV_ONENAND
> > help
> > Machine support for the Samsung Aquila target based on S5PC110 SoC
> > diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-
> s5pv210/mach-aquila.c
> > index fb9dbb2..1b7fe79 100644
> > --- a/arch/arm/mach-s5pv210/mach-aquila.c
> > +++ b/arch/arm/mach-s5pv210/mach-aquila.c
> > @@ -13,6 +13,7 @@
> > #include <linux/init.h>
> > #include <linux/serial_core.h>
> > #include <linux/fb.h>
> > +#include <linux/gpio.h>
> >
> > #include <asm/mach/arch.h>
> > #include <asm/mach/map.h>
> > @@ -22,12 +23,15 @@
> > #include <mach/map.h>
> > #include <mach/regs-clock.h>
> > #include <mach/regs-fb.h>
> > +#include <mach/regs-gpio.h>
> >
> > #include <plat/regs-serial.h>
> > #include <plat/s5pv210.h>
> > #include <plat/devs.h>
> > #include <plat/cpu.h>
> > #include <plat/fb.h>
> > +#include <plat/gpio-cfg.h>
> > +#include <plat/sdhci.h>
> >
> > /* Following are default values for UCON, ULCON and UFCON UART registers
> */
> > #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
> > @@ -116,9 +120,66 @@ static struct s3c_fb_platdata aquila_lcd_pdata
> __initdata = {
> > .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
> > };
> >
> > +/* MoviNAND */
> > +static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
> > + .max_width = 4,
> > + .cd_type = S3C_SDHCI_CD_PERMANENT,
> > +};
> > +
> > +/* Wireless LAN */
> > +static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
> > + .max_width = 4,
> > + .cd_type = S3C_SDHCI_CD_EXTERNAL,
> > + /* ext_cd_{init,cleanup} callbacks will be added later */
> > +};
> > +
> > +/* External Flash */
> > +#define AQUILA_EXT_FLASH_IRQ IRQ_EINT(28) /* S5PV210_GPH3(4) */
> > +#define AQUILA_EXT_FLASH_EN S5PV210_MP05(4)
> > +#define AQUILA_EXT_FLASH_CD S5PV210_GPH3(4)
> > +
> > +static irqreturn_t aquila_ext_flash_card_detect_isr(int irq, void
> *dev_id)
> > +{
> > + void (*notify_func)(struct platform_device *, int state) = dev_id;
> > + notify_func(&s3c_device_hsmmc2, !gpio_get_value(AQUILA_EXT_FLASH_CD));
> > + return IRQ_HANDLED;
> > +}
>
> hmm, not very nice this.
>
> I'd much prefer to see a gpio-based handler in either the sdhci core or
> at-least in the driver's directory since I'm sure that his is (a) something
> Thomas Abrahama has already published patches for (which do need work) and
> (b) probably going to be needed by other boards and/or other architectures.
I thought about adding the external gpio logic directly to sdhci-s3c driver,
but then I realized that it would not cover all our cases. For wifi sdio
card we need different solution - the card will be 'inserted' and 'removed'
by a power regulator glue code (called by rfkill framework). I'm really
convinced that adding support for such special case to sdhci-s3c driver is
not a good idea, that's why I came with the idea of 'external event' support
for card detect. I can move support for the gpio case to the sdhci-s3c driver
(it will be just a new CD type - SDHCI_S3C_GPIO).
I'm really open for the discussion how this can be handled in other ways.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] s3c64xx: Fix build without SDHCI controllers
2010-06-11 0:56 ` Kukjin Kim
2010-06-11 3:30 ` Kyungmin Park
@ 2010-06-11 5:59 ` Marek Szyprowski
2010-06-22 12:29 ` Kukjin Kim
1 sibling, 1 reply; 14+ messages in thread
From: Marek Szyprowski @ 2010-06-11 5:59 UTC (permalink / raw)
To: linux-arm-kernel
This patch fixes the following compilation problem if only NCP machine
is selected:
arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function ?s3c6410_default_sdhci2?
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/plat-samsung/include/plat/sdhci.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 13f9fb2..2e263a8 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -166,8 +166,10 @@ static inline void s3c6410_default_sdhci2(void) { }
#else
static inline void s3c6410_default_sdhci0(void) { }
static inline void s3c6410_default_sdhci1(void) { }
+static inline void s3c6410_default_sdhci2(void) { }
static inline void s3c6400_default_sdhci0(void) { }
static inline void s3c6400_default_sdhci1(void) { }
+static inline void s3c6400_default_sdhci2(void) { }
#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
--
1.7.1.240.g225c
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices
2010-06-11 5:18 ` Ben Dooks
2010-06-11 5:29 ` Marek Szyprowski
@ 2010-06-11 6:05 ` Kyungmin Park
1 sibling, 0 replies; 14+ messages in thread
From: Kyungmin Park @ 2010-06-11 6:05 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 11, 2010 at 2:18 PM, Ben Dooks <ben-linux@fluff.org> wrote:
> On Wed, Jun 09, 2010 at 11:39:05AM +0200, Marek Szyprowski wrote:
>> This patch add support for SDHCI blocks on Samsung Aquila board. The
>> following host controllers are defined:
>> 1. Internal MoviNAND device (permanently wired to the controller)
>> 2. Internal WiFI SDIO device (card is activated by power regualor)
>> 3. External MMC/SD socket (card detection is provided by external
>> gpio interrupt)
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>> ---
>> ?arch/arm/mach-s5pv210/Kconfig ? ? ? | ? ?4 ++
>> ?arch/arm/mach-s5pv210/mach-aquila.c | ? 66 +++++++++++++++++++++++++++++++++++
>> ?2 files changed, 70 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
>> index b7a2f38..dcc9d74 100644
>> --- a/arch/arm/mach-s5pv210/Kconfig
>> +++ b/arch/arm/mach-s5pv210/Kconfig
>> @@ -57,7 +57,11 @@ config MACH_AQUILA
>> ? ? ? select CPU_S5PV210
>> ? ? ? select ARCH_SPARSEMEM_ENABLE
>> ? ? ? select S5PV210_SETUP_FB_24BPP
>> + ? ? select S5PV210_SETUP_SDHCI
>> ? ? ? select S3C_DEV_FB
>> + ? ? select S3C_DEV_HSMMC
>> + ? ? select S3C_DEV_HSMMC1
>> + ? ? select S3C_DEV_HSMMC2
>> ? ? ? select S5PC110_DEV_ONENAND
>> ? ? ? help
>> ? ? ? ? Machine support for the Samsung Aquila target based on S5PC110 SoC
>> diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
>> index fb9dbb2..1b7fe79 100644
>> --- a/arch/arm/mach-s5pv210/mach-aquila.c
>> +++ b/arch/arm/mach-s5pv210/mach-aquila.c
>> @@ -13,6 +13,7 @@
>> ?#include <linux/init.h>
>> ?#include <linux/serial_core.h>
>> ?#include <linux/fb.h>
>> +#include <linux/gpio.h>
>>
>> ?#include <asm/mach/arch.h>
>> ?#include <asm/mach/map.h>
>> @@ -22,12 +23,15 @@
>> ?#include <mach/map.h>
>> ?#include <mach/regs-clock.h>
>> ?#include <mach/regs-fb.h>
>> +#include <mach/regs-gpio.h>
>>
>> ?#include <plat/regs-serial.h>
>> ?#include <plat/s5pv210.h>
>> ?#include <plat/devs.h>
>> ?#include <plat/cpu.h>
>> ?#include <plat/fb.h>
>> +#include <plat/gpio-cfg.h>
>> +#include <plat/sdhci.h>
>>
>> ?/* Following are default values for UCON, ULCON and UFCON UART registers */
>> ?#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | ? ? ? ?\
>> @@ -116,9 +120,66 @@ static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
>> ? ? ? .setup_gpio ? ? = s5pv210_fb_gpio_setup_24bpp,
>> ?};
>>
>> +/* MoviNAND */
>> +static struct s3c_sdhci_platdata aquila_hsmmc0_data __initdata = {
>> + ? ? .max_width ? ? ? ? ? ? ?= 4,
>> + ? ? .cd_type ? ? ? ? ? ? ? ?= S3C_SDHCI_CD_PERMANENT,
>> +};
>> +
>> +/* Wireless LAN */
>> +static struct s3c_sdhci_platdata aquila_hsmmc1_data __initdata = {
>> + ? ? .max_width ? ? ? ? ? ? ?= 4,
>> + ? ? .cd_type ? ? ? ? ? ? ? ?= S3C_SDHCI_CD_EXTERNAL,
>> + ? ? /* ext_cd_{init,cleanup} callbacks will be added later */
>> +};
>> +
>> +/* External Flash */
>> +#define AQUILA_EXT_FLASH_IRQ IRQ_EINT(28) ? ?/* S5PV210_GPH3(4) */
>> +#define AQUILA_EXT_FLASH_EN ?S5PV210_MP05(4)
>> +#define AQUILA_EXT_FLASH_CD ?S5PV210_GPH3(4)
>> +
>> +static irqreturn_t aquila_ext_flash_card_detect_isr(int irq, void *dev_id)
>> +{
>> + ? ? void (*notify_func)(struct platform_device *, int state) = dev_id;
>> + ? ? notify_func(&s3c_device_hsmmc2, !gpio_get_value(AQUILA_EXT_FLASH_CD));
>> + ? ? return IRQ_HANDLED;
>> +}
>
> hmm, not very nice this.
>
> I'd much prefer to see a gpio-based handler in either the sdhci core or
> at-least in the driver's directory since I'm sure that his is (a) something
> Thomas Abrahama has already published patches for (which do need work) and
Maybe you see the samsung internal codes. but I think the baseline is
mailing list, others are implement the same functionality with
different place. can you tell me which mail has these one?
Thank you,
Kyungmin Park
> (b) probably going to be needed by other boards and/or other architectures.
>
>> +static int aquila_ext_flash_card_detect_init(
>> + ? ? ? ? ? ? void (*notify_func)(struct platform_device *, int state))
>> +{
>> + ? ? gpio_request(AQUILA_EXT_FLASH_EN, "FLASH_EN");
>> + ? ? gpio_direction_output(AQUILA_EXT_FLASH_EN, 1);
>> +
>> + ? ? if (request_irq(AQUILA_EXT_FLASH_IRQ, aquila_ext_flash_card_detect_isr,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? "SDHCI card detect", notify_func))
>> + ? ? ? ? ? ? printk(KERN_ERR "Error: cannot request irq for External Flash\n");
>> + ? ? return 0;
>> +}
>> +
>> +static int aquila_ext_flash_card_detect_cleanup(
>> + ? ? ? ? ? ? void (*notify_func)(struct platform_device *, int state))
>> +{
>> + ? ? free_irq(AQUILA_EXT_FLASH_IRQ, notify_func);
>> + ? ? gpio_direction_output(AQUILA_EXT_FLASH_EN, 0);
>> + ? ? gpio_free(AQUILA_EXT_FLASH_EN);
>> + ? ? return 0;
>> +}
>> +
>> +static struct s3c_sdhci_platdata aquila_hsmmc2_data __initdata = {
>> + ? ? .max_width ? ? ? ? ? ? ?= 4,
>> + ? ? .cd_type ? ? ? ? ? ? ? ?= S3C_SDHCI_CD_EXTERNAL,
>> + ? ? .ext_cd_init ? ? ? ? ? ?= aquila_ext_flash_card_detect_init,
>> + ? ? .ext_cd_cleanup ? ? ? ? = aquila_ext_flash_card_detect_cleanup,
>> +};
>> +
>> ?static struct platform_device *aquila_devices[] __initdata = {
>> ? ? ? &s3c_device_fb,
>> ? ? ? &s5pc110_device_onenand,
>> + ? ? &s3c_device_hsmmc0,
>> + ? ? &s3c_device_hsmmc1,
>> + ? ? &s3c_device_hsmmc2,
>> ?};
>>
>> ?static void __init aquila_map_io(void)
>> @@ -130,6 +191,11 @@ static void __init aquila_map_io(void)
>>
>> ?static void __init aquila_machine_init(void)
>> ?{
>> + ? ? /* SDHCI */
>> + ? ? s3c_sdhci0_set_platdata(&aquila_hsmmc0_data);
>> + ? ? s3c_sdhci1_set_platdata(&aquila_hsmmc1_data);
>> + ? ? s3c_sdhci2_set_platdata(&aquila_hsmmc2_data);
>> +
>> ? ? ? /* FB */
>> ? ? ? s3c_fb_set_platdata(&aquila_lcd_pdata);
>>
>> --
>> 1.7.1.240.g225c
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
> --
> --
> Ben
>
> Q: ? ? ?What's a light-year?
> A: ? ? ?One-third less calories than a regular year.
>
> --
> 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
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
2010-06-11 4:34 ` Kyungmin Park
@ 2010-06-11 6:26 ` Kukjin Kim
0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-06-11 6:26 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: Kyungmin Park [mailto:kyungmin.park at samsung.com]
> Sent: Friday, June 11, 2010 1:35 PM
> To: 'Kukjin Kim'
> Cc: 'Marek Szyprowski'; linux-arm-kernel at lists.infradead.org; linux-samsung-
> soc at vger.kernel.org; linux-mmc at vger.kernel.org; ben-linux at fluff.org
> Subject: RE: [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
>
>
>
> > -----Original Message-----
> > From: Kukjin Kim [mailto:kgene.kim at samsung.com]
> > Sent: Friday, June 11, 2010 12:59 PM
> > To: 'Kyungmin Park'
> > Cc: 'Marek Szyprowski'; linux-arm-kernel at lists.infradead.org; linux-
> > samsung-soc at vger.kernel.org; linux-mmc at vger.kernel.org; ben-
> > linux at fluff.org
> > Subject: RE: [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers
> >
> > Kyungmin Park wrote:
> > >
> > > On Fri, Jun 11, 2010 at 9:56 AM, Kukjin Kim <kgene.kim@samsung.com>
> > wrote:
> > > > Marek Szyprowski wrote:
> > > >>
> > > >> This patch fixes the following compilation problem if only NCP
> > machine
> > > >> is selected:
> > > >>
> > > >> arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
> > > >> arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of
> > function
> > > >> ?s3c6410_default_sdhci2?
> > > >>
> > > >> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > > >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> > > >> ---
> > > >> arch/arm/plat-samsung/include/plat/sdhci.h | 1 +
> > > >> 1 files changed, 1 insertions(+), 0 deletions(-)
> > > >>
> > > >> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h
> > b/arch/arm/plat-
> > > >> samsung/include/plat/sdhci.h
> > > >> index 13f9fb2..c2044e5 100644
> > > >> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> > > >> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> > > >> @@ -166,6 +166,7 @@ static inline void s3c6410_default_sdhci2(void)
> > { }
> > > >> #else
> > > >> static inline void s3c6410_default_sdhci0(void) { }
> > > >> static inline void s3c6410_default_sdhci1(void) { }
> > > >> +static inline void s3c6410_default_sdhci2(void) { }
> > > >> static inline void s3c6400_default_sdhci0(void) { }
> > > >> static inline void s3c6400_default_sdhci1(void) { }
> > > >>
> > > >> --
> > > >
> > > > Maybe missed in Maurus' patch 'S3C64XX: add HSMMC2 support'
> > > > commit 92b118f6968ae0788ac659af47b464acd9a754a1
> > >
> > > Which kernel tree do you use?
> > > it's against the latest kernel.
> > >
> > Of course, Linus' 35-rc2.
>
> We used 63a07cb64ccc3ceae619d3298545d602ab5ecd38
> And there's no s3c6410_default_sdhci2(void) .
>
Hmm. Maybe some misunderstanding.
I meant maybe Maurus missed when he submitted HSMMC2 support patch.
(it means Marek's patch is correct)
And need 's3c6400_default_sdhci2()' as well as 's36410_default_sdhci2()' in Marek's patch.
So requested to re-submit updated patch.
>
> > Any problem?
> >
> > > >
> > > > Also need 'static inline s3c6400_default_sdhci2(void) { }'
> > > > Could you re-submit updated patch including s3c6400_default_sdhci2()?
> > > >
> >
> >
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2] s3c64xx: Fix build without SDHCI controllers
2010-06-11 5:59 ` [PATCH v2] " Marek Szyprowski
@ 2010-06-22 12:29 ` Kukjin Kim
0 siblings, 0 replies; 14+ messages in thread
From: Kukjin Kim @ 2010-06-22 12:29 UTC (permalink / raw)
To: linux-arm-kernel
Marek Szyprowski wrote:
>
> This patch fixes the following compilation problem if only NCP machine
> is selected:
>
> arch/arm/mach-s3c64xx/s3c6410.c: In function ?s3c6410_map_io?:
> arch/arm/mach-s3c64xx/s3c6410.c:51: error: implicit declaration of function
> ?s3c6410_default_sdhci2?
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Applied :-)
> ---
> arch/arm/plat-samsung/include/plat/sdhci.h | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-
> samsung/include/plat/sdhci.h
> index 13f9fb2..2e263a8 100644
> --- a/arch/arm/plat-samsung/include/plat/sdhci.h
> +++ b/arch/arm/plat-samsung/include/plat/sdhci.h
> @@ -166,8 +166,10 @@ static inline void s3c6410_default_sdhci2(void) { }
> #else
> static inline void s3c6410_default_sdhci0(void) { }
> static inline void s3c6410_default_sdhci1(void) { }
> +static inline void s3c6410_default_sdhci2(void) { }
> static inline void s3c6400_default_sdhci0(void) { }
> static inline void s3c6400_default_sdhci1(void) { }
> +static inline void s3c6400_default_sdhci2(void) { }
>
> #endif /* CONFIG_S3C64XX_SETUP_SDHCI */
>
> --
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <kgene.kim@samsung.com>, Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2010-06-22 12:29 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 9:39 [PATCH] SDHCI-S3C fixes and enhancements (platform specific code) Marek Szyprowski
2010-06-09 9:39 ` [PATCH 1/3] s3c64xx: Fix build without SDHCI controllers Marek Szyprowski
2010-06-11 0:56 ` Kukjin Kim
2010-06-11 3:30 ` Kyungmin Park
2010-06-11 3:58 ` Kukjin Kim
2010-06-11 4:34 ` Kyungmin Park
2010-06-11 6:26 ` Kukjin Kim
2010-06-11 5:59 ` [PATCH v2] " Marek Szyprowski
2010-06-22 12:29 ` Kukjin Kim
2010-06-09 9:39 ` [PATCH 2/3] Samsung: sdhci-s3c: add support for new card detection methods Marek Szyprowski
2010-06-09 9:39 ` [PATCH 3/3] s5pv210: Aquila: add definitions for sdhci devices Marek Szyprowski
2010-06-11 5:18 ` Ben Dooks
2010-06-11 5:29 ` Marek Szyprowski
2010-06-11 6:05 ` Kyungmin Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).