From 5b323c7beb1b10b137f9e21981050319d89d55dd Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:28 +0000 Subject: [ARM] S3C: Move HSMMC device definition to plat-s3ec Move the definition for the hsmmc device to plat-s3c to be shared between the s3c24xx and s3c64xx platforms. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index 75b1244cf8ab..d7ccc269086c 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -17,5 +17,6 @@ config CPU_S3C6410 config MACH_SMDK6410 bool "SMDK6410" select CPU_S3C6410 + select S3C_DEV_HSMMC help Machine support for the Samsung SMDK6410 -- cgit v1.2.3 From 39057f237dc9aff2a5ea41995029eeef7b677fae Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:29 +0000 Subject: [ARM] SMDK6410: Add HSMMC0 device Add HSMMC0 device to SMDK6410. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/mach-smdk6410.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 35d42e8cab92..609d5bd0812f 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -62,6 +62,7 @@ static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = { struct map_desc smdk6410_iodesc[] = {}; static struct platform_device *smdk6410_devices[] __initdata = { + &s3c_device_hsmmc0, }; extern void s3c64xx_init_io(struct map_desc *, int); -- cgit v1.2.3 From 5cc7fd88fc96072c333184ff359c818665ce2506 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:38 +0000 Subject: [ARM] S3C6410: Add helper for setting SDHCI device information Add the necessary helper functions for setting up the SDHCI device information. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 6 +++ arch/arm/mach-s3c6410/Makefile | 4 ++ arch/arm/mach-s3c6410/cpu.c | 4 ++ arch/arm/mach-s3c6410/setup-sdhci.c | 102 ++++++++++++++++++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 arch/arm/mach-s3c6410/setup-sdhci.c (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index d7ccc269086c..32bdc93fc1ff 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -14,9 +14,15 @@ config CPU_S3C6410 help Enable S3C6410 CPU support +config S3C6410_SETUP_SDHCI + bool + help + Internal helper functions for S3C6410 based SDHCI systems + config MACH_SMDK6410 bool "SMDK6410" select CPU_S3C6410 select S3C_DEV_HSMMC + select S3C6410_SETUP_SDHCI help Machine support for the Samsung SMDK6410 diff --git a/arch/arm/mach-s3c6410/Makefile b/arch/arm/mach-s3c6410/Makefile index 4a20a009990a..2cd4f189036b 100644 --- a/arch/arm/mach-s3c6410/Makefile +++ b/arch/arm/mach-s3c6410/Makefile @@ -14,6 +14,10 @@ obj- := obj-$(CONFIG_CPU_S3C6410) += cpu.o +# Helper and device support + +obj-$(CONFIG_S3C6410_SETUP_SDHCI) += setup-sdhci.o + # machine support obj-$(CONFIG_MACH_SMDK6410) += mach-smdk6410.o diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index 975cf88f0e84..84fb65b59999 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -51,6 +52,9 @@ static struct map_desc s3c6410_iodesc[] __initdata = { void __init s3c6410_map_io(void) { iotable_init(s3c6410_iodesc, ARRAY_SIZE(s3c6410_iodesc)); + + /* initialise device information early */ + s3c6410_default_sdhci0(); } void __init s3c6410_init_clocks(int xtal) diff --git a/arch/arm/mach-s3c6410/setup-sdhci.c b/arch/arm/mach-s3c6410/setup-sdhci.c new file mode 100644 index 000000000000..0b5788bd5985 --- /dev/null +++ b/arch/arm/mach-s3c6410/setup-sdhci.c @@ -0,0 +1,102 @@ +/* linux/arch/arm/mach-s3c6410/setup-sdhci.c + * + * Copyright 2008 Simtec Electronics + * Copyright 2008 Simtec Electronics + * Ben Dooks + * http://armlinux.simtec.co.uk/ + * + * S3C6410 - Helper functions for settign up SDHCI device(s) (HSMMC) + * + * 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 +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */ + +char *s3c6410_hsmmc_clksrcs[4] = { + [0] = "hsmmc", + [1] = "hsmmc", + [2] = "mmc_bus", + /* [3] = "48m", - note not succesfully used yet */ +}; + +void s3c6410_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) +{ + unsigned int gpio; + unsigned int end; + + end = S3C64XX_GPG(2 + width); + + /* Set all the necessary GPG pins to special-function 0 */ + for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) { + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); + 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)); +} + +void s3c6410_setup_sdhci0_cfg_card(struct platform_device *dev, + void __iomem *r, + struct mmc_ios *ios, + struct mmc_card *card) +{ + u32 ctrl2, ctrl3; + + /* don't need to alter anything acording to card-type */ + + writel(S3C64XX_SDHCI_CONTROL4_DRIVE_9mA, r + S3C64XX_SDHCI_CONTROL4); + + ctrl2 = readl(r + S3C_SDHCI_CONTROL2); + ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK; + ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR | + S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK | + S3C_SDHCI_CTRL2_ENFBCLKRX | + S3C_SDHCI_CTRL2_DFCNT_NONE | + S3C_SDHCI_CTRL2_ENCLKOUTHOLD); + + if (ios->clock < 25 * 1000000) + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 | + S3C_SDHCI_CTRL3_FCSEL2 | + S3C_SDHCI_CTRL3_FCSEL1 | + S3C_SDHCI_CTRL3_FCSEL0); + else + ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0); + + printk(KERN_INFO "%s: CTRL 2=%08x, 3=%08x\n", __func__, ctrl2, ctrl3); + writel(ctrl2, r + S3C_SDHCI_CONTROL2); + writel(ctrl3, r + S3C_SDHCI_CONTROL3); +} + +void s3c6410_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) +{ + unsigned int gpio; + unsigned int end; + + end = S3C64XX_GPH(2 + width); + + /* Set all the necessary GPG pins to special-function 0 */ + for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) { + s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); + 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)); +} -- cgit v1.2.3 From a2205cd2cbfb8fb217e6036f08773a09d1b6d75e Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:39 +0000 Subject: [ARM] S3C: Add SDHCI (HSMMC) channel 1 device definition Add device definition and support code for the Samsung HSMMC channel 1 device. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/cpu.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index 84fb65b59999..137918e7711f 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -55,6 +55,7 @@ void __init s3c6410_map_io(void) /* initialise device information early */ s3c6410_default_sdhci0(); + s3c6410_default_sdhci1(); } void __init s3c6410_init_clocks(int xtal) -- cgit v1.2.3 From d85fa24c517b5f67646ed42bffa870bcf8bdda63 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:52 +0000 Subject: [ARM] SMDK6410: Add i2c device Add i2c bus 0 to the configuration Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/mach-smdk6410.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 609d5bd0812f..d58c83d31a06 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -63,6 +64,7 @@ struct map_desc smdk6410_iodesc[] = {}; static struct platform_device *smdk6410_devices[] __initdata = { &s3c_device_hsmmc0, + &s3c_device_i2c0, }; extern void s3c64xx_init_io(struct map_desc *, int); @@ -76,6 +78,7 @@ static void __init smdk6410_map_io(void) static void __init smdk6410_machine_init(void) { + s3c_i2c0_set_platdata(NULL); platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); } -- cgit v1.2.3 From d7ea3743ca9939eb71931dedb613d14ff7201d02 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:57 +0000 Subject: [ARM] SMDK6410: Add second I2C channel. Add the second I2C channel on the SMDK6410. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 2 ++ arch/arm/mach-s3c6410/mach-smdk6410.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index 32bdc93fc1ff..2462693a1128 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -23,6 +23,8 @@ config MACH_SMDK6410 bool "SMDK6410" select CPU_S3C6410 select S3C_DEV_HSMMC + select S3C_DEV_I2C1 select S3C6410_SETUP_SDHCI + select S3C64XX_SETUP_I2C1 help Machine support for the Samsung SMDK6410 diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index d58c83d31a06..8d7101aab759 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -65,6 +65,7 @@ struct map_desc smdk6410_iodesc[] = {}; static struct platform_device *smdk6410_devices[] __initdata = { &s3c_device_hsmmc0, &s3c_device_i2c0, + &s3c_device_i2c1, }; extern void s3c64xx_init_io(struct map_desc *, int); @@ -79,6 +80,7 @@ static void __init smdk6410_map_io(void) static void __init smdk6410_machine_init(void) { s3c_i2c0_set_platdata(NULL); + s3c_i2c1_set_platdata(NULL); platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); } -- cgit v1.2.3 From 096941ed1e4b3ded5eded1b3f4208b8e35d5d3c3 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:14:59 +0000 Subject: [ARM] SMDK6410: Add I2C device board information Add the I2C devices on the SMDK6410. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/mach-smdk6410.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index 8d7101aab759..e845b2a1becf 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -68,6 +69,16 @@ static struct platform_device *smdk6410_devices[] __initdata = { &s3c_device_i2c1, }; + +static struct i2c_board_info i2c_devs0[] __initdata = { + { I2C_BOARD_INFO("24c08", 0x50), }, + { I2C_BOARD_INFO("WM8580", 0X1b), }, +}; + +static struct i2c_board_info i2c_devs1[] __initdata = { + { I2C_BOARD_INFO("24c128", 0x57), }, /* Samsung S524AD0XD1 */ +}; + extern void s3c64xx_init_io(struct map_desc *, int); static void __init smdk6410_map_io(void) @@ -81,6 +92,10 @@ static void __init smdk6410_machine_init(void) { s3c_i2c0_set_platdata(NULL); s3c_i2c1_set_platdata(NULL); + + i2c_register_board_info(0, i2c_devs0, ARRAY_SIZE(i2c_devs0)); + i2c_register_board_info(1, i2c_devs1, ARRAY_SIZE(i2c_devs1)); + platform_add_devices(smdk6410_devices, ARRAY_SIZE(smdk6410_devices)); } -- cgit v1.2.3 From 4f507d19ca9e2d703527072f7d8eeb0f0241d6b9 Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Fri, 31 Oct 2008 16:15:00 +0000 Subject: [ARM] S3C: Add header for initial i2c device core setup. Add a header to define setup functions for the i2c devices. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/cpu.c b/arch/arm/mach-s3c6410/cpu.c index 137918e7711f..6a73ca6b7a3a 100644 --- a/arch/arm/mach-s3c6410/cpu.c +++ b/arch/arm/mach-s3c6410/cpu.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -56,6 +57,10 @@ void __init s3c6410_map_io(void) /* initialise device information early */ s3c6410_default_sdhci0(); s3c6410_default_sdhci1(); + + /* the i2c devices are directly compatible with s3c2440 */ + s3c_i2c0_setname("s3c2440-i2c"); + s3c_i2c1_setname("s3c2440-i2c"); } void __init s3c6410_init_clocks(int xtal) -- cgit v1.2.3 From b24636cff11fc7953e3a7f1a9b905349c0b838bf Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Mon, 3 Nov 2008 20:14:53 +0000 Subject: [ARM] SMDK6410: Add availability of second hsmmc channel Add SDHCI channel 1. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 30 ++++++++++++++++++++++++++++++ arch/arm/mach-s3c6410/mach-smdk6410.c | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index 2462693a1128..d00b5605100d 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -23,8 +23,38 @@ config MACH_SMDK6410 bool "SMDK6410" select CPU_S3C6410 select S3C_DEV_HSMMC + select S3C_DEV_HSMMC1 select S3C_DEV_I2C1 select S3C6410_SETUP_SDHCI select S3C64XX_SETUP_I2C1 help Machine support for the Samsung SMDK6410 + +# At least some of the SMDK6410s were shipped with the card detect +# for the MMC/SD slots connected to the same input. This means that +# either the boards need to be altered to have channel0 to an alternate +# configuration or that only one slot can be used. + +choice + prompt "SMDK6410 MMC/SD slot setup" + depends on MACH_SMDK6410 + +config SMDK6410_SD_CH0 + bool "Use channel 0 only" + depends on MACH_SMDK6410 + help + Select CON7 (channel 0) as the MMC/SD slot, as + at least some SMDK6410 boards come with the + resistors fitted so that the card detects for + channels 0 and 1 are the same. + +config SMDK6410_SD_CH1 + bool "Use channel 1 only" + depends on MACH_SMDK6410 + help + Select CON6 (channel 1) as the MMC/SD slot, as + at least some SMDK6410 boards come with the + resistors fitted so that the card detects for + channels 0 and 1 are the same. + +endchoice diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index e845b2a1becf..b900244a91d3 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -64,12 +64,16 @@ static struct s3c2410_uartcfg smdk6410_uartcfgs[] __initdata = { struct map_desc smdk6410_iodesc[] = {}; static struct platform_device *smdk6410_devices[] __initdata = { +#ifdef CONFIG_SMDK6410_SD_CH0 &s3c_device_hsmmc0, +#endif +#ifdef CONFIG_SMDK6410_SD_CH1 + &s3c_device_hsmmc1, +#endif &s3c_device_i2c0, &s3c_device_i2c1, }; - static struct i2c_board_info i2c_devs0[] __initdata = { { I2C_BOARD_INFO("24c08", 0x50), }, { I2C_BOARD_INFO("WM8580", 0X1b), }, -- cgit v1.2.3 From 438a5d42e052ec6126c5f1e24763b711210db33e Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Wed, 19 Nov 2008 15:41:34 +0000 Subject: [ARM] SMDK6410: Add LCD (LCD48WVGA) definitions Add support for the LCD 48WVGA module attached to the SMDK6410. Signed-off-by: Ben Dooks --- arch/arm/mach-s3c6410/Kconfig | 2 + arch/arm/mach-s3c6410/mach-smdk6410.c | 71 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) (limited to 'arch/arm/mach-s3c6410') diff --git a/arch/arm/mach-s3c6410/Kconfig b/arch/arm/mach-s3c6410/Kconfig index d00b5605100d..1d5010070027 100644 --- a/arch/arm/mach-s3c6410/Kconfig +++ b/arch/arm/mach-s3c6410/Kconfig @@ -25,8 +25,10 @@ config MACH_SMDK6410 select S3C_DEV_HSMMC select S3C_DEV_HSMMC1 select S3C_DEV_I2C1 + select S3C_DEV_FB select S3C6410_SETUP_SDHCI select S3C64XX_SETUP_I2C1 + select S3C64XX_SETUP_FB_24BPP help Machine support for the Samsung SMDK6410 diff --git a/arch/arm/mach-s3c6410/mach-smdk6410.c b/arch/arm/mach-s3c6410/mach-smdk6410.c index b900244a91d3..ae3bd5c2b8c6 100644 --- a/arch/arm/mach-s3c6410/mach-smdk6410.c +++ b/arch/arm/mach-s3c6410/mach-smdk6410.c @@ -21,12 +21,18 @@ #include #include #include +#include +#include +#include + +#include