mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-20 00:11:22 +00:00
Merge branch 'samsung/driver' into next/drivers
* samsung/driver: ARM: EXYNOS: Modified files for SPI consolidation work ARM: S5P64X0: Enable SDHCI support ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names ARM: S5P64X0: Add HSMMC setup for host Controller
This commit is contained in:
commit
a46117836e
@ -153,6 +153,11 @@ config EXYNOS4_SETUP_USB_PHY
|
|||||||
help
|
help
|
||||||
Common setup code for USB PHY controller
|
Common setup code for USB PHY controller
|
||||||
|
|
||||||
|
config EXYNOS4_SETUP_SPI
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Common setup code for SPI GPIO configurations.
|
||||||
|
|
||||||
# machine support
|
# machine support
|
||||||
|
|
||||||
if ARCH_EXYNOS4
|
if ARCH_EXYNOS4
|
||||||
|
@ -61,3 +61,4 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C7) += setup-i2c7.o
|
|||||||
obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o
|
obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o
|
||||||
obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
|
obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
|
||||||
obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o
|
obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o
|
||||||
|
obj-$(CONFIG_EXYNOS4_SETUP_SPI) += setup-spi.o
|
||||||
|
@ -1109,36 +1109,6 @@ static struct clksrc_clk clksrcs[] = {
|
|||||||
.sources = &clkset_group,
|
.sources = &clkset_group,
|
||||||
.reg_src = { .reg = S5P_CLKSRC_LCD0, .shift = 0, .size = 4 },
|
.reg_src = { .reg = S5P_CLKSRC_LCD0, .shift = 0, .size = 4 },
|
||||||
.reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 },
|
.reg_div = { .reg = S5P_CLKDIV_LCD0, .shift = 0, .size = 4 },
|
||||||
}, {
|
|
||||||
.clk = {
|
|
||||||
.name = "sclk_spi",
|
|
||||||
.devname = "s3c64xx-spi.0",
|
|
||||||
.enable = exynos4_clksrc_mask_peril1_ctrl,
|
|
||||||
.ctrlbit = (1 << 16),
|
|
||||||
},
|
|
||||||
.sources = &clkset_group,
|
|
||||||
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 },
|
|
||||||
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 },
|
|
||||||
}, {
|
|
||||||
.clk = {
|
|
||||||
.name = "sclk_spi",
|
|
||||||
.devname = "s3c64xx-spi.1",
|
|
||||||
.enable = exynos4_clksrc_mask_peril1_ctrl,
|
|
||||||
.ctrlbit = (1 << 20),
|
|
||||||
},
|
|
||||||
.sources = &clkset_group,
|
|
||||||
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 },
|
|
||||||
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 },
|
|
||||||
}, {
|
|
||||||
.clk = {
|
|
||||||
.name = "sclk_spi",
|
|
||||||
.devname = "s3c64xx-spi.2",
|
|
||||||
.enable = exynos4_clksrc_mask_peril1_ctrl,
|
|
||||||
.ctrlbit = (1 << 24),
|
|
||||||
},
|
|
||||||
.sources = &clkset_group,
|
|
||||||
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 },
|
|
||||||
.reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 },
|
|
||||||
}, {
|
}, {
|
||||||
.clk = {
|
.clk = {
|
||||||
.name = "sclk_fimg2d",
|
.name = "sclk_fimg2d",
|
||||||
@ -1257,6 +1227,42 @@ static struct clksrc_clk clk_sclk_mmc3 = {
|
|||||||
.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
|
.reg_div = { .reg = S5P_CLKDIV_FSYS2, .shift = 24, .size = 8 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct clksrc_clk clk_sclk_spi0 = {
|
||||||
|
.clk = {
|
||||||
|
.name = "sclk_spi",
|
||||||
|
.devname = "s3c64xx-spi.0",
|
||||||
|
.enable = exynos4_clksrc_mask_peril1_ctrl,
|
||||||
|
.ctrlbit = (1 << 16),
|
||||||
|
},
|
||||||
|
.sources = &clkset_group,
|
||||||
|
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 16, .size = 4 },
|
||||||
|
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 0, .size = 4 },
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct clksrc_clk clk_sclk_spi1 = {
|
||||||
|
.clk = {
|
||||||
|
.name = "sclk_spi",
|
||||||
|
.devname = "s3c64xx-spi.1",
|
||||||
|
.enable = exynos4_clksrc_mask_peril1_ctrl,
|
||||||
|
.ctrlbit = (1 << 20),
|
||||||
|
},
|
||||||
|
.sources = &clkset_group,
|
||||||
|
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 20, .size = 4 },
|
||||||
|
.reg_div = { .reg = S5P_CLKDIV_PERIL1, .shift = 16, .size = 4 },
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct clksrc_clk clk_sclk_spi2 = {
|
||||||
|
.clk = {
|
||||||
|
.name = "sclk_spi",
|
||||||
|
.devname = "s3c64xx-spi.2",
|
||||||
|
.enable = exynos4_clksrc_mask_peril1_ctrl,
|
||||||
|
.ctrlbit = (1 << 24),
|
||||||
|
},
|
||||||
|
.sources = &clkset_group,
|
||||||
|
.reg_src = { .reg = S5P_CLKSRC_PERIL1, .shift = 24, .size = 4 },
|
||||||
|
.reg_div = { .reg = S5P_CLKDIV_PERIL2, .shift = 0, .size = 4 },
|
||||||
|
};
|
||||||
|
|
||||||
/* Clock initialization code */
|
/* Clock initialization code */
|
||||||
static struct clksrc_clk *sysclks[] = {
|
static struct clksrc_clk *sysclks[] = {
|
||||||
&clk_mout_apll,
|
&clk_mout_apll,
|
||||||
@ -1305,6 +1311,10 @@ static struct clksrc_clk *clksrc_cdev[] = {
|
|||||||
&clk_sclk_mmc1,
|
&clk_sclk_mmc1,
|
||||||
&clk_sclk_mmc2,
|
&clk_sclk_mmc2,
|
||||||
&clk_sclk_mmc3,
|
&clk_sclk_mmc3,
|
||||||
|
&clk_sclk_spi0,
|
||||||
|
&clk_sclk_spi1,
|
||||||
|
&clk_sclk_spi2,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct clk_lookup exynos4_clk_lookup[] = {
|
static struct clk_lookup exynos4_clk_lookup[] = {
|
||||||
@ -1318,6 +1328,9 @@ static struct clk_lookup exynos4_clk_lookup[] = {
|
|||||||
CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
|
CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &clk_sclk_mmc3.clk),
|
||||||
CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0),
|
CLKDEV_INIT("dma-pl330.0", "apb_pclk", &clk_pdma0),
|
||||||
CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1),
|
CLKDEV_INIT("dma-pl330.1", "apb_pclk", &clk_pdma1),
|
||||||
|
CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk0", &clk_sclk_spi0.clk),
|
||||||
|
CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk0", &clk_sclk_spi1.clk),
|
||||||
|
CLKDEV_INIT("s3c64xx-spi.2", "spi_busclk0", &clk_sclk_spi2.clk),
|
||||||
};
|
};
|
||||||
|
|
||||||
static int xtal_rate;
|
static int xtal_rate;
|
||||||
|
@ -72,6 +72,9 @@
|
|||||||
#define IRQ_IIC5 IRQ_SPI(63)
|
#define IRQ_IIC5 IRQ_SPI(63)
|
||||||
#define IRQ_IIC6 IRQ_SPI(64)
|
#define IRQ_IIC6 IRQ_SPI(64)
|
||||||
#define IRQ_IIC7 IRQ_SPI(65)
|
#define IRQ_IIC7 IRQ_SPI(65)
|
||||||
|
#define IRQ_SPI0 IRQ_SPI(66)
|
||||||
|
#define IRQ_SPI1 IRQ_SPI(67)
|
||||||
|
#define IRQ_SPI2 IRQ_SPI(68)
|
||||||
|
|
||||||
#define IRQ_USB_HOST IRQ_SPI(70)
|
#define IRQ_USB_HOST IRQ_SPI(70)
|
||||||
#define IRQ_USB_HSOTG IRQ_SPI(71)
|
#define IRQ_USB_HSOTG IRQ_SPI(71)
|
||||||
|
@ -87,6 +87,10 @@
|
|||||||
#define EXYNOS4_PA_SYSMMU_TV 0x12E20000
|
#define EXYNOS4_PA_SYSMMU_TV 0x12E20000
|
||||||
#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000
|
#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000
|
||||||
#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000
|
#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000
|
||||||
|
#define EXYNOS4_PA_SPI0 0x13920000
|
||||||
|
#define EXYNOS4_PA_SPI1 0x13930000
|
||||||
|
#define EXYNOS4_PA_SPI2 0x13940000
|
||||||
|
|
||||||
|
|
||||||
#define EXYNOS4_PA_GPIO1 0x11400000
|
#define EXYNOS4_PA_GPIO1 0x11400000
|
||||||
#define EXYNOS4_PA_GPIO2 0x11000000
|
#define EXYNOS4_PA_GPIO2 0x11000000
|
||||||
@ -149,6 +153,9 @@
|
|||||||
#define S3C_PA_RTC EXYNOS4_PA_RTC
|
#define S3C_PA_RTC EXYNOS4_PA_RTC
|
||||||
#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG
|
#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG
|
||||||
#define S3C_PA_UART EXYNOS4_PA_UART
|
#define S3C_PA_UART EXYNOS4_PA_UART
|
||||||
|
#define S3C_PA_SPI0 EXYNOS4_PA_SPI0
|
||||||
|
#define S3C_PA_SPI1 EXYNOS4_PA_SPI1
|
||||||
|
#define S3C_PA_SPI2 EXYNOS4_PA_SPI2
|
||||||
|
|
||||||
#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID
|
#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID
|
||||||
#define S5P_PA_EHCI EXYNOS4_PA_EHCI
|
#define S5P_PA_EHCI EXYNOS4_PA_EHCI
|
||||||
|
16
arch/arm/mach-exynos/include/mach/spi-clocks.h
Normal file
16
arch/arm/mach-exynos/include/mach/spi-clocks.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/* linux/arch/arm/mach-exynos4/include/mach/spi-clocks.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Samsung Electronics Co. Ltd.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM_ARCH_SPI_CLKS_H
|
||||||
|
#define __ASM_ARCH_SPI_CLKS_H __FILE__
|
||||||
|
|
||||||
|
/* Must source from SCLK_SPI */
|
||||||
|
#define EXYNOS4_SPI_SRCCLK_SCLK 0
|
||||||
|
|
||||||
|
#endif /* __ASM_ARCH_SPI_CLKS_H */
|
72
arch/arm/mach-exynos/setup-spi.c
Normal file
72
arch/arm/mach-exynos/setup-spi.c
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/* linux/arch/arm/mach-exynos4/setup-spi.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Samsung Electronics Ltd.
|
||||||
|
* http://www.samsung.com/
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
|
#include <plat/gpio-cfg.h>
|
||||||
|
#include <plat/s3c64xx-spi.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_S3C64XX_DEV_SPI0
|
||||||
|
struct s3c64xx_spi_info s3c64xx_spi0_pdata __initdata = {
|
||||||
|
.fifo_lvl_mask = 0x1ff,
|
||||||
|
.rx_lvl_offset = 15,
|
||||||
|
.high_speed = 1,
|
||||||
|
.clk_from_cmu = true,
|
||||||
|
.tx_st_done = 25,
|
||||||
|
};
|
||||||
|
|
||||||
|
int s3c64xx_spi0_cfg_gpio(struct platform_device *dev)
|
||||||
|
{
|
||||||
|
s3c_gpio_cfgpin(EXYNOS4_GPB(0), S3C_GPIO_SFN(2));
|
||||||
|
s3c_gpio_setpull(EXYNOS4_GPB(0), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgall_range(EXYNOS4_GPB(2), 2,
|
||||||
|
S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_S3C64XX_DEV_SPI1
|
||||||
|
struct s3c64xx_spi_info s3c64xx_spi1_pdata __initdata = {
|
||||||
|
.fifo_lvl_mask = 0x7f,
|
||||||
|
.rx_lvl_offset = 15,
|
||||||
|
.high_speed = 1,
|
||||||
|
.clk_from_cmu = true,
|
||||||
|
.tx_st_done = 25,
|
||||||
|
};
|
||||||
|
|
||||||
|
int s3c64xx_spi1_cfg_gpio(struct platform_device *dev)
|
||||||
|
{
|
||||||
|
s3c_gpio_cfgpin(EXYNOS4_GPB(4), S3C_GPIO_SFN(2));
|
||||||
|
s3c_gpio_setpull(EXYNOS4_GPB(4), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgall_range(EXYNOS4_GPB(6), 2,
|
||||||
|
S3C_GPIO_SFN(2), S3C_GPIO_PULL_UP);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_S3C64XX_DEV_SPI2
|
||||||
|
struct s3c64xx_spi_info s3c64xx_spi2_pdata __initdata = {
|
||||||
|
.fifo_lvl_mask = 0x7f,
|
||||||
|
.rx_lvl_offset = 15,
|
||||||
|
.high_speed = 1,
|
||||||
|
.clk_from_cmu = true,
|
||||||
|
.tx_st_done = 25,
|
||||||
|
};
|
||||||
|
|
||||||
|
int s3c64xx_spi2_cfg_gpio(struct platform_device *dev)
|
||||||
|
{
|
||||||
|
s3c_gpio_cfgpin(EXYNOS4_GPC1(1), S3C_GPIO_SFN(5));
|
||||||
|
s3c_gpio_setpull(EXYNOS4_GPC1(1), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgall_range(EXYNOS4_GPC1(3), 2,
|
||||||
|
S3C_GPIO_SFN(5), S3C_GPIO_PULL_UP);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
@ -41,6 +41,11 @@ config S5P64X0_SETUP_SPI
|
|||||||
help
|
help
|
||||||
Common setup code for SPI GPIO configurations
|
Common setup code for SPI GPIO configurations
|
||||||
|
|
||||||
|
config S5P64X0_SETUP_SDHCI_GPIO
|
||||||
|
bool
|
||||||
|
help
|
||||||
|
Common setup code for SDHCI gpio.
|
||||||
|
|
||||||
# machine support
|
# machine support
|
||||||
|
|
||||||
config MACH_SMDK6440
|
config MACH_SMDK6440
|
||||||
@ -50,12 +55,16 @@ config MACH_SMDK6440
|
|||||||
select S3C_DEV_I2C1
|
select S3C_DEV_I2C1
|
||||||
select S3C_DEV_RTC
|
select S3C_DEV_RTC
|
||||||
select S3C_DEV_WDT
|
select S3C_DEV_WDT
|
||||||
|
select S3C_DEV_HSMMC
|
||||||
|
select S3C_DEV_HSMMC1
|
||||||
|
select S3C_DEV_HSMMC2
|
||||||
select SAMSUNG_DEV_ADC
|
select SAMSUNG_DEV_ADC
|
||||||
select SAMSUNG_DEV_BACKLIGHT
|
select SAMSUNG_DEV_BACKLIGHT
|
||||||
select SAMSUNG_DEV_PWM
|
select SAMSUNG_DEV_PWM
|
||||||
select SAMSUNG_DEV_TS
|
select SAMSUNG_DEV_TS
|
||||||
select S5P64X0_SETUP_FB_24BPP
|
select S5P64X0_SETUP_FB_24BPP
|
||||||
select S5P64X0_SETUP_I2C1
|
select S5P64X0_SETUP_I2C1
|
||||||
|
select S5P64X0_SETUP_SDHCI_GPIO
|
||||||
help
|
help
|
||||||
Machine support for the Samsung SMDK6440
|
Machine support for the Samsung SMDK6440
|
||||||
|
|
||||||
@ -66,13 +75,28 @@ config MACH_SMDK6450
|
|||||||
select S3C_DEV_I2C1
|
select S3C_DEV_I2C1
|
||||||
select S3C_DEV_RTC
|
select S3C_DEV_RTC
|
||||||
select S3C_DEV_WDT
|
select S3C_DEV_WDT
|
||||||
|
select S3C_DEV_HSMMC
|
||||||
|
select S3C_DEV_HSMMC1
|
||||||
|
select S3C_DEV_HSMMC2
|
||||||
select SAMSUNG_DEV_ADC
|
select SAMSUNG_DEV_ADC
|
||||||
select SAMSUNG_DEV_BACKLIGHT
|
select SAMSUNG_DEV_BACKLIGHT
|
||||||
select SAMSUNG_DEV_PWM
|
select SAMSUNG_DEV_PWM
|
||||||
select SAMSUNG_DEV_TS
|
select SAMSUNG_DEV_TS
|
||||||
select S5P64X0_SETUP_FB_24BPP
|
select S5P64X0_SETUP_FB_24BPP
|
||||||
select S5P64X0_SETUP_I2C1
|
select S5P64X0_SETUP_I2C1
|
||||||
|
select S5P64X0_SETUP_SDHCI_GPIO
|
||||||
help
|
help
|
||||||
Machine support for the Samsung SMDK6450
|
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
|
endif
|
||||||
|
@ -30,3 +30,4 @@ obj-y += dev-audio.o
|
|||||||
obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o
|
obj-$(CONFIG_S5P64X0_SETUP_I2C1) += setup-i2c1.o
|
||||||
obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o
|
obj-$(CONFIG_S5P64X0_SETUP_FB_24BPP) += setup-fb-24bpp.o
|
||||||
obj-$(CONFIG_S5P64X0_SETUP_SPI) += setup-spi.o
|
obj-$(CONFIG_S5P64X0_SETUP_SPI) += setup-spi.o
|
||||||
|
obj-$(CONFIG_S5P64X0_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
|
||||||
|
@ -378,36 +378,6 @@ static struct clksrc_sources clkset_audio = {
|
|||||||
|
|
||||||
static struct clksrc_clk clksrcs[] = {
|
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 = {
|
.clk = {
|
||||||
.name = "sclk_post",
|
.name = "sclk_post",
|
||||||
.ctrlbit = (1 << 10),
|
.ctrlbit = (1 << 10),
|
||||||
@ -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 = {
|
static struct clksrc_clk clk_sclk_uclk = {
|
||||||
.clk = {
|
.clk = {
|
||||||
.name = "uclk1",
|
.name = "uclk1",
|
||||||
@ -503,6 +509,9 @@ static struct clksrc_clk *clksrc_cdev[] = {
|
|||||||
&clk_sclk_uclk,
|
&clk_sclk_uclk,
|
||||||
&clk_sclk_spi0,
|
&clk_sclk_spi0,
|
||||||
&clk_sclk_spi1,
|
&clk_sclk_spi1,
|
||||||
|
&clk_sclk_mmc0,
|
||||||
|
&clk_sclk_mmc1,
|
||||||
|
&clk_sclk_mmc2
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct clk_lookup s5p6440_clk_lookup[] = {
|
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(NULL, "spi_busclk0", &clk_p),
|
||||||
CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
|
CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
|
||||||
CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.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)
|
void __init_or_cpufreq s5p6440_setup_clocks(void)
|
||||||
|
@ -412,36 +412,6 @@ static struct clksrc_clk clk_sclk_audio0 = {
|
|||||||
|
|
||||||
static struct clksrc_clk clksrcs[] = {
|
static struct clksrc_clk clksrcs[] = {
|
||||||
{
|
{
|
||||||
.clk = {
|
|
||||||
.name = "sclk_mmc",
|
|
||||||
.devname = "s3c-sdhci.0",
|
|
||||||
.ctrlbit = (1 << 24),
|
|
||||||
.enable = s5p64x0_sclk_ctrl,
|
|
||||||
},
|
|
||||||
.sources = &clkset_group2,
|
|
||||||
.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_group2,
|
|
||||||
.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_group2,
|
|
||||||
.reg_src = { .reg = S5P64X0_CLK_SRC0, .shift = 22, .size = 2 },
|
|
||||||
.reg_div = { .reg = S5P64X0_CLK_DIV1, .shift = 8, .size = 4 },
|
|
||||||
}, {
|
|
||||||
.clk = {
|
.clk = {
|
||||||
.name = "sclk_fimc",
|
.name = "sclk_fimc",
|
||||||
.ctrlbit = (1 << 10),
|
.ctrlbit = (1 << 10),
|
||||||
@ -507,6 +477,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_group2,
|
||||||
|
.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_group2,
|
||||||
|
.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_group2,
|
||||||
|
.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 = {
|
static struct clksrc_clk clk_sclk_uclk = {
|
||||||
.clk = {
|
.clk = {
|
||||||
.name = "uclk1",
|
.name = "uclk1",
|
||||||
@ -546,6 +552,9 @@ static struct clksrc_clk *clksrc_cdev[] = {
|
|||||||
&clk_sclk_uclk,
|
&clk_sclk_uclk,
|
||||||
&clk_sclk_spi0,
|
&clk_sclk_spi0,
|
||||||
&clk_sclk_spi1,
|
&clk_sclk_spi1,
|
||||||
|
&clk_sclk_mmc0,
|
||||||
|
&clk_sclk_mmc1,
|
||||||
|
&clk_sclk_mmc2,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct clk_lookup s5p6450_clk_lookup[] = {
|
static struct clk_lookup s5p6450_clk_lookup[] = {
|
||||||
@ -554,6 +563,9 @@ static struct clk_lookup s5p6450_clk_lookup[] = {
|
|||||||
CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
|
CLKDEV_INIT(NULL, "spi_busclk0", &clk_p),
|
||||||
CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
|
CLKDEV_INIT("s3c64xx-spi.0", "spi_busclk1", &clk_sclk_spi0.clk),
|
||||||
CLKDEV_INIT("s3c64xx-spi.1", "spi_busclk1", &clk_sclk_spi1.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),
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Clock initialization code */
|
/* Clock initialization code */
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include <plat/s5p6450.h>
|
#include <plat/s5p6450.h>
|
||||||
#include <plat/adc-core.h>
|
#include <plat/adc-core.h>
|
||||||
#include <plat/fb-core.h>
|
#include <plat/fb-core.h>
|
||||||
|
#include <plat/sdhci.h>
|
||||||
|
|
||||||
/* Initial IO mappings */
|
/* Initial IO mappings */
|
||||||
|
|
||||||
@ -112,6 +113,10 @@ void __init s5p6440_map_io(void)
|
|||||||
s3c_adc_setname("s3c64xx-adc");
|
s3c_adc_setname("s3c64xx-adc");
|
||||||
s3c_fb_setname("s5p64x0-fb");
|
s3c_fb_setname("s5p64x0-fb");
|
||||||
|
|
||||||
|
s5p64x0_default_sdhci0();
|
||||||
|
s5p64x0_default_sdhci1();
|
||||||
|
s5p6440_default_sdhci2();
|
||||||
|
|
||||||
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
|
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
|
||||||
iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
|
iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
|
||||||
init_consistent_dma_size(SZ_8M);
|
init_consistent_dma_size(SZ_8M);
|
||||||
@ -123,6 +128,10 @@ void __init s5p6450_map_io(void)
|
|||||||
s3c_adc_setname("s3c64xx-adc");
|
s3c_adc_setname("s3c64xx-adc");
|
||||||
s3c_fb_setname("s5p64x0-fb");
|
s3c_fb_setname("s5p64x0-fb");
|
||||||
|
|
||||||
|
s5p64x0_default_sdhci0();
|
||||||
|
s5p64x0_default_sdhci1();
|
||||||
|
s5p6450_default_sdhci2();
|
||||||
|
|
||||||
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
|
iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
|
||||||
iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
|
iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
|
||||||
init_consistent_dma_size(SZ_8M);
|
init_consistent_dma_size(SZ_8M);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/pwm_backlight.h>
|
#include <linux/pwm_backlight.h>
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
#include <linux/mmc/host.h>
|
||||||
|
|
||||||
#include <video/platform_lcd.h>
|
#include <video/platform_lcd.h>
|
||||||
|
|
||||||
@ -52,6 +53,7 @@
|
|||||||
#include <plat/backlight.h>
|
#include <plat/backlight.h>
|
||||||
#include <plat/fb.h>
|
#include <plat/fb.h>
|
||||||
#include <plat/regs-fb.h>
|
#include <plat/regs-fb.h>
|
||||||
|
#include <plat/sdhci.h>
|
||||||
|
|
||||||
#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
|
#define SMDK6440_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
|
||||||
S3C2410_UCON_RXILEVEL | \
|
S3C2410_UCON_RXILEVEL | \
|
||||||
@ -161,6 +163,25 @@ static struct platform_device *smdk6440_devices[] __initdata = {
|
|||||||
&s5p6440_device_iis,
|
&s5p6440_device_iis,
|
||||||
&s3c_device_fb,
|
&s3c_device_fb,
|
||||||
&smdk6440_lcd_lte480wv,
|
&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 = {
|
static struct s3c2410_platform_i2c s5p6440_i2c0_data __initdata = {
|
||||||
@ -234,6 +255,10 @@ static void __init smdk6440_machine_init(void)
|
|||||||
s5p6440_set_lcd_interface();
|
s5p6440_set_lcd_interface();
|
||||||
s3c_fb_set_platdata(&smdk6440_lcd_pdata);
|
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));
|
platform_add_devices(smdk6440_devices, ARRAY_SIZE(smdk6440_devices));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <linux/gpio.h>
|
#include <linux/gpio.h>
|
||||||
#include <linux/pwm_backlight.h>
|
#include <linux/pwm_backlight.h>
|
||||||
#include <linux/fb.h>
|
#include <linux/fb.h>
|
||||||
|
#include <linux/mmc/host.h>
|
||||||
|
|
||||||
#include <video/platform_lcd.h>
|
#include <video/platform_lcd.h>
|
||||||
|
|
||||||
@ -52,6 +53,7 @@
|
|||||||
#include <plat/backlight.h>
|
#include <plat/backlight.h>
|
||||||
#include <plat/fb.h>
|
#include <plat/fb.h>
|
||||||
#include <plat/regs-fb.h>
|
#include <plat/regs-fb.h>
|
||||||
|
#include <plat/sdhci.h>
|
||||||
|
|
||||||
#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
|
#define SMDK6450_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
|
||||||
S3C2410_UCON_RXILEVEL | \
|
S3C2410_UCON_RXILEVEL | \
|
||||||
@ -179,10 +181,28 @@ static struct platform_device *smdk6450_devices[] __initdata = {
|
|||||||
&s5p6450_device_iis0,
|
&s5p6450_device_iis0,
|
||||||
&s3c_device_fb,
|
&s3c_device_fb,
|
||||||
&smdk6450_lcd_lte480wv,
|
&smdk6450_lcd_lte480wv,
|
||||||
|
&s3c_device_hsmmc0,
|
||||||
|
&s3c_device_hsmmc1,
|
||||||
|
&s3c_device_hsmmc2,
|
||||||
/* s5p6450_device_spi0 will be added */
|
/* 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 = {
|
static struct s3c2410_platform_i2c s5p6450_i2c0_data __initdata = {
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.slave_addr = 0x10,
|
.slave_addr = 0x10,
|
||||||
@ -254,6 +274,10 @@ static void __init smdk6450_machine_init(void)
|
|||||||
s5p6450_set_lcd_interface();
|
s5p6450_set_lcd_interface();
|
||||||
s3c_fb_set_platdata(&smdk6450_lcd_pdata);
|
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));
|
platform_add_devices(smdk6450_devices, ARRAY_SIZE(smdk6450_devices));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
104
arch/arm/mach-s5p64x0/setup-sdhci-gpio.c
Normal file
104
arch/arm/mach-s5p64x0/setup-sdhci-gpio.c
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
/* linux/arch/arm/mach-s5p64x0/setup-sdhci-gpio.c
|
||||||
|
*
|
||||||
|
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
||||||
|
* http://www.samsung.com/
|
||||||
|
*
|
||||||
|
* S5P64X0 - Helper functions for setting up SDHCI device(s) GPIO (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 <linux/platform_device.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
|
||||||
|
#include <mach/regs-gpio.h>
|
||||||
|
#include <mach/regs-clock.h>
|
||||||
|
|
||||||
|
#include <plat/gpio-cfg.h>
|
||||||
|
#include <plat/sdhci.h>
|
||||||
|
#include <plat/cpu.h>
|
||||||
|
|
||||||
|
void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
|
||||||
|
{
|
||||||
|
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
|
||||||
|
|
||||||
|
/* Set all the necessary GPG pins to special-function 2 */
|
||||||
|
if (soc_is_s5p6450())
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6450_GPG(0), 2 + width,
|
||||||
|
S3C_GPIO_SFN(2));
|
||||||
|
else
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6440_GPG(0), 2 + width,
|
||||||
|
S3C_GPIO_SFN(2));
|
||||||
|
|
||||||
|
/* Set GPG[6] pin to special-function 2 - MMC0 CDn */
|
||||||
|
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
|
||||||
|
if (soc_is_s5p6450()) {
|
||||||
|
s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(2));
|
||||||
|
} else {
|
||||||
|
s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
|
||||||
|
{
|
||||||
|
struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
|
||||||
|
|
||||||
|
/* Set GPH[0:1] pins to special-function 2 - CLK and CMD */
|
||||||
|
if (soc_is_s5p6450())
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6450_GPH(0), 2, S3C_GPIO_SFN(2));
|
||||||
|
else
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6440_GPH(0), 2 , S3C_GPIO_SFN(2));
|
||||||
|
|
||||||
|
switch (width) {
|
||||||
|
case 8:
|
||||||
|
/* Set data pins GPH[6:9] special-function 2 */
|
||||||
|
if (soc_is_s5p6450())
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6450_GPH(6), 4,
|
||||||
|
S3C_GPIO_SFN(2));
|
||||||
|
else
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6440_GPH(6), 4,
|
||||||
|
S3C_GPIO_SFN(2));
|
||||||
|
case 4:
|
||||||
|
/* set data pins GPH[2:5] special-function 2 */
|
||||||
|
if (soc_is_s5p6450())
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6450_GPH(2), 4,
|
||||||
|
S3C_GPIO_SFN(2));
|
||||||
|
else
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6440_GPH(2), 4,
|
||||||
|
S3C_GPIO_SFN(2));
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set GPG[6] pin to special-funtion 3 : MMC1 CDn */
|
||||||
|
if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
|
||||||
|
if (soc_is_s5p6450()) {
|
||||||
|
s3c_gpio_setpull(S5P6450_GPG(6), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgpin(S5P6450_GPG(6), S3C_GPIO_SFN(3));
|
||||||
|
} else {
|
||||||
|
s3c_gpio_setpull(S5P6440_GPG(6), S3C_GPIO_PULL_UP);
|
||||||
|
s3c_gpio_cfgpin(S5P6440_GPG(6), S3C_GPIO_SFN(3));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
|
||||||
|
{
|
||||||
|
/* Set GPC[4:5] pins to special-function 3 - CLK and CMD */
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6440_GPC(4), 2, S3C_GPIO_SFN(3));
|
||||||
|
|
||||||
|
/* Set data pins GPH[6:9] pins to special-function 3 */
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6440_GPH(6), 4, S3C_GPIO_SFN(3));
|
||||||
|
}
|
||||||
|
|
||||||
|
void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
|
||||||
|
{
|
||||||
|
/* Set all the necessary GPG pins to special-function 3 */
|
||||||
|
s3c_gpio_cfgrange_nopull(S5P6450_GPG(7), 2 + width, S3C_GPIO_SFN(3));
|
||||||
|
}
|
@ -123,6 +123,10 @@ extern void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
|||||||
extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
extern void exynos4_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
||||||
extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
extern void exynos4_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
||||||
extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
|
extern void exynos4_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
|
||||||
|
extern void s5p64x0_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
||||||
|
extern void s5p64x0_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
||||||
|
extern void s5p6440_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
||||||
|
extern void s5p6450_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
||||||
|
|
||||||
/* S3C2416 SDHCI setup */
|
/* S3C2416 SDHCI setup */
|
||||||
|
|
||||||
@ -146,6 +150,7 @@ static inline void s3c2416_default_sdhci0(void) { }
|
|||||||
static inline void s3c2416_default_sdhci1(void) { }
|
static inline void s3c2416_default_sdhci1(void) { }
|
||||||
|
|
||||||
#endif /* CONFIG_S3C2416_SETUP_SDHCI */
|
#endif /* CONFIG_S3C2416_SETUP_SDHCI */
|
||||||
|
|
||||||
/* S3C64XX SDHCI setup */
|
/* S3C64XX SDHCI setup */
|
||||||
|
|
||||||
#ifdef CONFIG_S3C64XX_SETUP_SDHCI
|
#ifdef CONFIG_S3C64XX_SETUP_SDHCI
|
||||||
@ -201,6 +206,45 @@ static inline void s3c6400_default_sdhci2(void) { }
|
|||||||
|
|
||||||
#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
|
#endif /* CONFIG_S3C64XX_SETUP_SDHCI */
|
||||||
|
|
||||||
|
/* S5P64X0 SDHCI setup */
|
||||||
|
|
||||||
|
#ifdef CONFIG_S5P64X0_SETUP_SDHCI
|
||||||
|
static inline void s5p64x0_default_sdhci0(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
||||||
|
s3c_hsmmc0_def_platdata.cfg_gpio = s5p64x0_setup_sdhci0_cfg_gpio;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void s5p64x0_default_sdhci1(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
||||||
|
s3c_hsmmc1_def_platdata.cfg_gpio = s5p64x0_setup_sdhci1_cfg_gpio;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void s5p6440_default_sdhci2(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
||||||
|
s3c_hsmmc2_def_platdata.cfg_gpio = s5p6440_setup_sdhci2_cfg_gpio;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void s5p6450_default_sdhci2(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
||||||
|
s3c_hsmmc2_def_platdata.cfg_gpio = s5p6450_setup_sdhci2_cfg_gpio;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
static inline void s5p64x0_default_sdhci0(void) { }
|
||||||
|
static inline void s5p64x0_default_sdhci1(void) { }
|
||||||
|
static inline void s5p6440_default_sdhci2(void) { }
|
||||||
|
static inline void s5p6450_default_sdhci2(void) { }
|
||||||
|
|
||||||
|
#endif /* CONFIG_S5P64X0_SETUP_SDHCI */
|
||||||
|
|
||||||
/* S5PC100 SDHCI setup */
|
/* S5PC100 SDHCI setup */
|
||||||
|
|
||||||
#ifdef CONFIG_S5PC100_SETUP_SDHCI
|
#ifdef CONFIG_S5PC100_SETUP_SDHCI
|
||||||
|
Loading…
Reference in New Issue
Block a user