ARM: S5P64X0: Add SDMMC support
Subsystems (3)
cover ARM: S5P64X0: Add SDMMC support
This patchset adds support for sdhci controller on S5P6440 and S5P6450.
Since this patchset is based on "mmc: sdhci-s3c: Rework platform data and add device tree support" clk_type member has been removed from platform data.
This patchset depends on the patchs:
ARM: S5P64X0: Modified files for SPI consolidation work.
mmc: sdhci-s3c: Rework platform data and add device tree support.
Rajeshwari Shinde (3):
ARM: S5P64X0: Add HSMMC setup for host Controller
ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names
ARM: S5P64X0: Enable SDHCI support
arch/arm/mach-s5p64x0/Kconfig | 24 +++++++ arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/clock-s5p6440.c | 72 +++++++++++-------- arch/arm/mach-s5p64x0/clock-s5p6450.c | 72 +++++++++++-------- arch/arm/mach-s5p64x0/cpu.c | 9 +++ arch/arm/mach-s5p64x0/mach-smdk6440.c | 25 +++++++ arch/arm/mach-s5p64x0/mach-smdk6450.c | 26 +++++++- arch/arm/mach-s5p64x0/setup-sdhci-gpio.c | 104 ++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/sdhci.h | 42 +++++++++++ 9 files changed, 314 insertions(+), 61 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/setup-sdhci-gpio.c
Signature · 1 line
1.7.4.4
PATCH 1/3 ARM: S5P64X0: Add HSMMC setup for host Controller
Adds support for HSMMC for S5P64X0 platform, performs setup for host controller and related GPIO.
--- arch/arm/mach-s5p64x0/Kconfig | 24 +++++++ arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/cpu.c | 9 +++ arch/arm/mach-s5p64x0/setup-sdhci-gpio.c | 104 ++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/sdhci.h | 42 +++++++++++ 5 files changed, 180 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/setup-sdhci-gpio.c
arch/arm/mach-s5p64x0/Kconfig +24 -0
@@ -41,6 +41,11 @@ config S5P64X0_SETUP_SPI help Common setup code for SPI GPIO configurations +config S5P64X0_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + # machine support config MACH_SMDK6440
@@ -50,12 +55,16 @@ config MACH_SMDK6440 select S3C_DEV_I2C1 select S3C_DEV_RTC select S3C_DEV_WDT + select S3C_DEV_HSMMC + select S3C_DEV_HSMMC1 + select S3C_DEV_HSMMC2 select SAMSUNG_DEV_ADC select SAMSUNG_DEV_BACKLIGHT select SAMSUNG_DEV_PWM select SAMSUNG_DEV_TS select S5P64X0_SETUP_FB_24BPP select S5P64X0_SETUP_I2C1 + select S5P64X0_SETUP_SDHCI_GPIO help Machine support for the Samsung SMDK6440
@@ -66,13 +75,28 @@ config MACH_SMDK6450 select S3C_DEV_I2C1 select S3C_DEV_RTC select S3C_DEV_WDT + select S3C_DEV_HSMMC + select S3C_DEV_HSMMC1 + select S3C_DEV_HSMMC2 select SAMSUNG_DEV_ADC select SAMSUNG_DEV_BACKLIGHT select SAMSUNG_DEV_PWM select SAMSUNG_DEV_TS select S5P64X0_SETUP_FB_24BPP select S5P64X0_SETUP_I2C1 + select S5P64X0_SETUP_SDHCI_GPIO help Machine support for the Samsung SMDK6450 +menu "Use 8-bit SDHCI bus width" + +config S5P64X0_SD_CH1_8BIT + bool "SDHCI Channel 1 (Slot 1)" + depends on MACH_SMDK6450 || MACH_SMDK6440 + help + Support SDHCI Channel 1 8-bit bus. + If selected, Channel 2 is disabled. + +endmenu + endif
arch/arm/mach-s5p64x0/Makefile +1 -0
@@ -31,3 +31,4 @@ obj-$(CONFIG_S3C64XX_DEV_SPI) += dev-spi.o obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5P64X0_SETUP_SPI) += setup-spi.o +obj-$(CONFIG_S5P64X0_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
arch/arm/mach-s5p64x0/cpu.c +9 -0
@@ -40,6 +40,7 @@#include <plat/s5p6450.h> #include <plat/adc-core.h> #include <plat/fb-core.h> +#include <plat/sdhci.h> /* Initial IO mappings */
@@ -112,6 +113,10 @@ void __init s5p6440_map_io(void)s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s5p64x0_default_sdhci0 (); +s5p64x0_default_sdhci1 (); +s5p6440_default_sdhci2 (); +iotable_init (s5p64x0_iodesc,ARRAY_SIZE (s5p64x0_iodesc));iotable_init (s5p6440_iodesc,ARRAY_SIZE (s5p6440_iodesc));init_consistent_dma_size (SZ_8M );
@@ -123,6 +128,10 @@ void __init s5p6450_map_io(void)s3c_adc_setname ("s3c64xx-adc" );s3c_fb_setname ("s5p64x0-fb" ); +s5p64x0_default_sdhci0 (); +s5p64x0_default_sdhci1 (); +s5p6450_default_sdhci2 (); +iotable_init (s5p64x0_iodesc,ARRAY_SIZE (s5p64x0_iodesc));iotable_init (s5p6450_iodesc,ARRAY_SIZE (s5p6450_iodesc));init_consistent_dma_size (SZ_8M );
arch/arm/mach-s5p64x0/setup-sdhci-gpio.c new file +104 -0
104 lines not on this page · raw message
arch/arm/plat-samsung/include/plat/sdhci.h +42 -0
52 lines not on this page · raw message
Signature · 1 line
1.7.4.4
PATCH 2/3 ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names
In reply to Rajeshwari ShindeAdd support for lookup of sdhci-s3c controller clocks using generic names for s5p64x0
--- arch/arm/mach-s5p64x0/clock-s5p6440.c | 72 +++++++++++++++++++-------------- arch/arm/mach-s5p64x0/clock-s5p6450.c | 72 +++++++++++++++++++-------------- 2 files changed, 84 insertions(+), 60 deletions(-)
arch/arm/mach-s5p64x0/clock-s5p6440.c +42 -30
@@ -379,36 +379,6 @@ static struct clksrc_sources clkset_audio = {static struct clksrc_clk clksrcs[] = { { .clk = { - .name ="sclk_mmc" , - .devname ="s3c-sdhci.0" , - .ctrlbit = (1 <<24 ), - .enable = s5p64x0_sclk_ctrl, - }, - .sources = &clkset_group1, - .reg_src = { .reg =S5P64X0_CLK_SRC0 , .shift =18 , .size =2 }, - .reg_div = { .reg =S5P64X0_CLK_DIV1 , .shift =0 , .size =4 }, - }, { - .clk = { - .name ="sclk_mmc" , - .devname ="s3c-sdhci.1" , - .ctrlbit = (1 <<25 ), - .enable = s5p64x0_sclk_ctrl, - }, - .sources = &clkset_group1, - .reg_src = { .reg =S5P64X0_CLK_SRC0 , .shift =20 , .size =2 }, - .reg_div = { .reg =S5P64X0_CLK_DIV1 , .shift =4 , .size =4 }, - }, { - .clk = { - .name ="sclk_mmc" , - .devname ="s3c-sdhci.2" , - .ctrlbit = (1 <<26 ), - .enable = s5p64x0_sclk_ctrl, - }, - .sources = &clkset_group1, - .reg_src = { .reg =S5P64X0_CLK_SRC0 , .shift =22 , .size =2 }, - .reg_div = { .reg =S5P64X0_CLK_DIV1 , .shift =8 , .size =4 }, - }, { - .clk = { .name ="sclk_post" , .ctrlbit = (1 <<10 ), .enable = s5p64x0_sclk_ctrl,
@@ -446,6 +416,42 @@ static struct clksrc_clk clksrcs[] = { }, }; +static struct clksrc_clk clk_sclk_mmc0 = { + .clk = { + .name ="sclk_mmc" , + .devname ="s3c-sdhci.0" , + .ctrlbit = (1 <<24 ), + .enable = s5p64x0_sclk_ctrl, + }, + .sources = &clkset_group1, + .reg_src = { .reg =S5P64X0_CLK_SRC0 , .shift =18 , .size =2 }, + .reg_div = { .reg =S5P64X0_CLK_DIV1 , .shift =0 , .size =4 }, +}; + +static struct clksrc_clk clk_sclk_mmc1 = { + .clk = { + .name ="sclk_mmc" , + .devname ="s3c-sdhci.1" , + .ctrlbit = (1 <<25 ), + .enable = s5p64x0_sclk_ctrl, + }, + .sources = &clkset_group1, + .reg_src = { .reg =S5P64X0_CLK_SRC0 , .shift =20 , .size =2 }, + .reg_div = { .reg =S5P64X0_CLK_DIV1 , .shift =4 , .size =4 }, +}; + +static struct clksrc_clk clk_sclk_mmc2 = { + .clk = { + .name ="sclk_mmc" , + .devname ="s3c-sdhci.2" , + .ctrlbit = (1 <<26 ), + .enable = s5p64x0_sclk_ctrl, + }, + .sources = &clkset_group1, + .reg_src = { .reg =S5P64X0_CLK_SRC0 , .shift =22 , .size =2 }, + .reg_div = { .reg =S5P64X0_CLK_DIV1 , .shift =8 , .size =4 }, +}; +static struct clksrc_clk clk_sclk_uclk = { .clk = { .name ="uclk1" ,
@@ -503,6 +509,9 @@ static struct clksrc_clk *clksrc_cdev[] = { &clk_sclk_uclk, &clk_sclk_spi0, &clk_sclk_spi1, + &clk_sclk_mmc0, + &clk_sclk_mmc1, + &clk_sclk_mmc2 }; static struct clk_lookup s5p6440_clk_lookup[] = {
@@ -511,6 +520,9 @@ static struct clk_lookup s5p6440_clk_lookup[] = {CLKDEV_INIT (NULL ,"spi_busclk0" , &clk_p),CLKDEV_INIT ("s3c64xx-spi.0" ,"spi_busclk1" , &clk_sclk_spi0.clk),CLKDEV_INIT ("s3c64xx-spi.1" ,"spi_busclk1" , &clk_sclk_spi1.clk), +CLKDEV_INIT ("s3c-sdhci.0" ,"mmc_busclk.2" , &clk_sclk_mmc0.clk), +CLKDEV_INIT ("s3c-sdhci.1" ,"mmc_busclk.2" , &clk_sclk_mmc1.clk), + CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &clk_sclk_mmc2.clk), }; void __init_or_cpufreq s5p6440_setup_clocks(void)
arch/arm/mach-s5p64x0/clock-s5p6450.c +42 -30
96 lines not on this page · raw message
Signature · 1 line
1.7.4.4
PATCH 3/3 ARM: S5P64X0: Enable SDHCI support
In reply to Rajeshwari ShindeEnables SDHCI supports for SMDK6440 and SMDK6450.
--- arch/arm/mach-s5p64x0/mach-smdk6440.c | 25 +++++++++++++++++++++++++ arch/arm/mach-s5p64x0/mach-smdk6450.c | 26 +++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletions(-)
arch/arm/mach-s5p64x0/mach-smdk6440.c +25 -0
@@ -24,6 +24,7 @@#include <linux/gpio.h> #include <linux/pwm_backlight.h> #include <linux/fb.h> +#include <linux/mmc/host.h> #include <video/platform_lcd.h>
@@ -53,6 +54,7 @@#include <plat/fb.h> #include <plat/regs-fb.h> #include <plat/s3c64xx-spi.h> +#include <plat/sdhci.h> #define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ S3C2410_UCON_RXILEVEL | \
@@ -162,6 +164,25 @@ static struct platform_device *smdk6440_devices[] __initdata = { &s5p6440_device_iis, &s3c_device_fb, &smdk6440_lcd_lte480wv, + &s3c_device_hsmmc0, + &s3c_device_hsmmc1, + &s3c_device_hsmmc2, +}; + +static struct s3c_sdhci_platdata smdk6440_hsmmc0_pdata__initdata = { + .cd_type =S3C_SDHCI_CD_NONE , +}; + +static struct s3c_sdhci_platdata smdk6440_hsmmc1_pdata__initdata = { + .cd_type =S3C_SDHCI_CD_INTERNAL , +#if defined(CONFIG_S5P64X0_SD_CH1_8BIT) + .max_width =8 , + .host_caps =MMC_CAP_8_BIT_DATA , +#endif +}; + +static struct s3c_sdhci_platdata smdk6440_hsmmc2_pdata__initdata = { + .cd_type =S3C_SDHCI_CD_NONE , }; static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
@@ -253,6 +274,10 @@ static void __init smdk6440_machine_init(void)s5p6440_set_lcd_interface ();s3c_fb_set_platdata (&smdk6440_lcd_pdata); +s3c_sdhci0_set_platdata (&smdk6440_hsmmc0_pdata); +s3c_sdhci1_set_platdata (&smdk6440_hsmmc1_pdata); +s3c_sdhci2_set_platdata (&smdk6440_hsmmc2_pdata); +platform_add_devices (smdk6440_devices,ARRAY_SIZE (smdk6440_devices)); }
arch/arm/mach-s5p64x0/mach-smdk6450.c +25 -1
@@ -24,6 +24,7 @@#include <linux/gpio.h> #include <linux/pwm_backlight.h> #include <linux/fb.h> +#include <linux/mmc/host.h> #include <video/platform_lcd.h>
@@ -53,6 +54,7 @@#include <plat/fb.h> #include <plat/regs-fb.h> #include <plat/s3c64xx-spi.h> +#include <plat/sdhci.h> #define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \ S3C2410_UCON_RXILEVEL | \
@@ -180,10 +182,28 @@ static struct platform_device *smdk6450_devices[] __initdata = { &s5p6450_device_iis0, &s3c_device_fb, &smdk6450_lcd_lte480wv, - + &s3c_device_hsmmc0, + &s3c_device_hsmmc1, + &s3c_device_hsmmc2, /* s5p6450_device_spi0 will be added */ }; +static struct s3c_sdhci_platdata smdk6450_hsmmc0_pdata__initdata = { + .cd_type =S3C_SDHCI_CD_NONE , +}; + +static struct s3c_sdhci_platdata smdk6450_hsmmc1_pdata__initdata = { + .cd_type =S3C_SDHCI_CD_NONE , +#if defined(CONFIG_S5P64X0_SD_CH1_8BIT) + .max_width =8 , + .host_caps =MMC_CAP_8_BIT_DATA , +#endif +}; + +static struct s3c_sdhci_platdata smdk6450_hsmmc2_pdata__initdata = { + .cd_type =S3C_SDHCI_CD_NONE , +}; +static struct s3c2410_platform_i2c s5p6450_i2c0_data__initdata = { .flags =0 , .slave_addr = 0x10,
@@ -273,6 +293,10 @@ static void __init smdk6450_machine_init(void)s5p6450_set_lcd_interface ();s3c_fb_set_platdata (&smdk6450_lcd_pdata); +s3c_sdhci0_set_platdata (&smdk6450_hsmmc0_pdata); +s3c_sdhci1_set_platdata (&smdk6450_hsmmc1_pdata); +s3c_sdhci2_set_platdata (&smdk6450_hsmmc2_pdata); +platform_add_devices (smdk6450_devices,ARRAY_SIZE (smdk6450_devices)); }
Signature · 1 line
1.7.4.4
cover ARM: S5P64X0: Add SDMMC support
In reply to Rajeshwari ShindeQuoted 29 lines · Rajeshwari Shinde
This patchset adds support for sdhci controller on S5P6440 and S5P6450.
Since this patchset is based on "mmc: sdhci-s3c: Rework platform data and add device tree support"
clk_typemember has been removed from platform data.This patchset depends on the patchs:
ARM: S5P64X0: Modified files for SPI consolidation work.
mmc: sdhci-s3c: Rework platform data and add device tree support.Rajeshwari Shinde (3):
ARM: S5P64X0: Add HSMMC setup for host Controller
ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names
ARM: S5P64X0: Enable SDHCI supportarch/arm/mach-s5p64x0/Kconfig | 24 +++++++ arch/arm/mach-s5p64x0/Makefile | 1 + arch/arm/mach-s5p64x0/clock-s5p6440.c | 72 +++++++++++-------- arch/arm/mach-s5p64x0/clock-s5p6450.c | 72 +++++++++++-------- arch/arm/mach-s5p64x0/cpu.c | 9 +++ arch/arm/mach-s5p64x0/mach-smdk6440.c | 25 +++++++ arch/arm/mach-s5p64x0/mach-smdk6450.c | 26 +++++++- arch/arm/mach-s5p64x0/setup-sdhci-gpio.c | 104 ++++++++++++++++++++++++++++ arch/arm/plat-samsung/include/plat/sdhci.h | 42 +++++++++++ 9 files changed, 314 insertions(+), 61 deletions(-) create mode 100644 arch/arm/mach-s5p64x0/setup-sdhci-gpio.c
Quoted 2 lines
--
1.7.4.4
Hi Rajeshwari,
I need to sort out your this patches and Thomas' sdhci dt patches. And it's merge window, so will be back on this after that.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.