mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-07 21:24:00 +08:00
4b8be38cf7
Core: * Support for the HS200 high-speed eMMC mode. * Support SDIO 3.0 Ultra High Speed cards. * Kill pending block requests immediately if card is removed. * Enable the eMMC feature for locking boot partitions read-only until next power on, exposed via sysfs. Drivers: * Runtime PM support for Intel Medfield SDIO. * Suspend/resume support for sdhci-spear. * sh-mmcif now processes requests asynchronously. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPD0P3AAoJEHNBYZ7TNxYMLBQP/1nwYE0Y1prrKsiv6PWQlcDu LZl6kylgkq1Nd7hEX1E+kXjv+ec5Z+7RxqmyMerRJIMsfBtowLL0r9rzAu+BsNjZ t7YSODLCzCp80WGMDSxhgQEOiAXMlpTzD46hXC2hOjNyTXCsGz1smUfryLPCP6v/ QbWZi43cDN+Ok5AEw8sdNIfdJYreIAPnziO6Mttvi9iFgozpxdmSJXco+kjJKd2U lYEG/kcfug2eJRxmsQP9v4W1Y274tFrV9VLP4mgBabFMvKlXN3uU9tqf2S9JDPv8 Y95OzKsyk6pwOTKKL8LLS/FVd3pUoHWkf5CwlH7QPR/NgiWV8DcC7bGCyBKdTAwZ 14yolNVAKdLday7+DoKCk4Eac69exmBNnED9Ky37B+STiob/5qd3iLqspFBITUQU F9bUSyw9HkdWfD4zeUD4qj9iyc6Xgzk5HbxOyJb8Wgg3VlhVESkIBeOQ/ZLT35EC ihYStdu/No/p9r5XLClHAUuo55vT5ypGWFHAeJeUtt/BMKB3ZrHcqoihge2PAjkz pnudMf5TXD4ZUYanIT8SFfmuGisoax0Qg99+xyuYZ1c8foJ7LsMSDqEicwrxi07e 0TT8Z37lrR+FRkusRA+nQ5Ba9/iOdVGq2DdiDUGlaYIaIWYVWNXEgjOPDzS5kfoA PVuJRYhR4fIeFb0aqa/p =LJnN -----END PGP SIGNATURE----- Merge tag 'mmc-merge-for-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc MMC highlights for 3.3: Core: * Support for the HS200 high-speed eMMC mode. * Support SDIO 3.0 Ultra High Speed cards. * Kill pending block requests immediately if card is removed. * Enable the eMMC feature for locking boot partitions read-only until next power on, exposed via sysfs. Drivers: * Runtime PM support for Intel Medfield SDIO. * Suspend/resume support for sdhci-spear. * sh-mmcif now processes requests asynchronously. * tag 'mmc-merge-for-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (58 commits) mmc: fix a deadlock between system suspend and MMC block IO mmc: sdhci: restore the enabled dma when do reset all mmc: dw_mmc: miscaculated the fifo-depth with wrong bit operation mmc: host: Adds support for eMMC 4.5 HS200 mode mmc: core: HS200 mode support for eMMC 4.5 mmc: dw_mmc: fixed wrong bit operation for SDMMC_GET_FCNT() mmc: core: Separate the timeout value for cache-ctrl mmc: sdhci-spear: Fix compilation error mmc: sdhci: Deal with failure case in sdhci_suspend_host mmc: dw_mmc: Clear the DDR mode for non-DDR mmc: sd: Fix SDR12 timing regression mmc: sdhci: Fix tuning timer incorrect setting when suspending host mmc: core: Add option to prevent eMMC sleep command mmc: omap_hsmmc: use threaded irq handler for card-detect. mmc: sdhci-pci: enable runtime PM for Medfield SDIO mmc: sdhci: Always pass clock request value zero to set_clock host op mmc: sdhci-pci: remove SDHCI_QUIRK2_OWN_CARD_DETECTION mmc: sdhci-pci: get gpio numbers from platform data mmc: sdhci-pci: add platform data mmc: sdhci: prevent card detection activity for non-removable cards ...
358 lines
11 KiB
C
358 lines
11 KiB
C
/* linux/arch/arm/plat-samsung/include/plat/sdhci.h
|
|
*
|
|
* Copyright (c) 2011 Samsung Electronics Co., Ltd.
|
|
* http://www.samsung.com
|
|
*
|
|
* Copyright 2008 Openmoko, Inc.
|
|
* Copyright 2008 Simtec Electronics
|
|
* http://armlinux.simtec.co.uk/
|
|
* Ben Dooks <ben@simtec.co.uk>
|
|
*
|
|
* S3C Platform - SDHCI (HSMMC) platform data definitions
|
|
*
|
|
* 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 __PLAT_S3C_SDHCI_H
|
|
#define __PLAT_S3C_SDHCI_H __FILE__
|
|
|
|
struct platform_device;
|
|
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 callback */
|
|
S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */
|
|
S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */
|
|
S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
|
|
};
|
|
|
|
enum clk_types {
|
|
S3C_SDHCI_CLK_DIV_INTERNAL, /* use mmc internal clock divider */
|
|
S3C_SDHCI_CLK_DIV_EXTERNAL, /* use external clock divider */
|
|
};
|
|
|
|
/**
|
|
* 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)
|
|
* @clk_type: Type of clock divider method (see clk_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.
|
|
* @ext_cd_gpio: gpio pin used for external CD line, valid only if
|
|
* cd_type == S3C_SDHCI_CD_GPIO
|
|
* @ext_cd_gpio_invert: invert values for external CD gpio line
|
|
* @cfg_gpio: Configure the GPIO for a specific card bit-width
|
|
*
|
|
* Initialisation data specific to either the machine or the platform
|
|
* for the device driver to use or call-back when configuring gpio or
|
|
* card speed information.
|
|
*/
|
|
struct s3c_sdhci_platdata {
|
|
unsigned int max_width;
|
|
unsigned int host_caps;
|
|
unsigned int pm_caps;
|
|
enum cd_types cd_type;
|
|
enum clk_types clk_type;
|
|
|
|
int ext_cd_gpio;
|
|
bool ext_cd_gpio_invert;
|
|
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);
|
|
};
|
|
|
|
/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
|
|
* @pd: The default platform data for this device.
|
|
* @set: Pointer to the platform data to fill in.
|
|
*/
|
|
extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
|
|
struct s3c_sdhci_platdata *set);
|
|
|
|
/**
|
|
* s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
|
|
* @pd: Platform data to register to device.
|
|
*
|
|
* Register the given platform data for use withe S3C SDHCI device.
|
|
* The call will copy the platform data, so the board definitions can
|
|
* make the structure itself __initdata.
|
|
*/
|
|
extern void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd);
|
|
extern void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd);
|
|
extern void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd);
|
|
extern void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd);
|
|
|
|
/* Default platform data, exported so that per-cpu initialisation can
|
|
* set the correct one when there are more than one cpu type selected.
|
|
*/
|
|
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata;
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata;
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata;
|
|
extern struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata;
|
|
|
|
/* Helper function availability */
|
|
|
|
extern void s3c2416_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
|
extern void s3c2416_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
|
extern void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
|
extern void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
|
extern void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);
|
|
extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);
|
|
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_sdhci2_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 */
|
|
|
|
#ifdef CONFIG_S3C2416_SETUP_SDHCI
|
|
static inline void s3c2416_default_sdhci0(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s3c2416_setup_sdhci0_cfg_gpio;
|
|
#endif /* CONFIG_S3C_DEV_HSMMC */
|
|
}
|
|
|
|
static inline void s3c2416_default_sdhci1(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s3c2416_setup_sdhci1_cfg_gpio;
|
|
#endif /* CONFIG_S3C_DEV_HSMMC1 */
|
|
}
|
|
|
|
#else
|
|
static inline void s3c2416_default_sdhci0(void) { }
|
|
static inline void s3c2416_default_sdhci1(void) { }
|
|
|
|
#endif /* CONFIG_S3C2416_SETUP_SDHCI */
|
|
|
|
/* S3C64XX SDHCI setup */
|
|
|
|
#ifdef CONFIG_S3C64XX_SETUP_SDHCI
|
|
static inline void s3c6400_default_sdhci0(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s3c6400_default_sdhci1(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s3c6400_default_sdhci2(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s3c6410_default_sdhci0(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s3c64xx_setup_sdhci0_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s3c6410_default_sdhci1(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s3c64xx_setup_sdhci1_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s3c6410_default_sdhci2(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = s3c64xx_setup_sdhci2_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
#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 */
|
|
|
|
/* 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 */
|
|
|
|
#ifdef CONFIG_S5PC100_SETUP_SDHCI
|
|
static inline void s5pc100_default_sdhci0(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s5pc100_setup_sdhci0_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s5pc100_default_sdhci1(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s5pc100_setup_sdhci1_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s5pc100_default_sdhci2(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = s5pc100_setup_sdhci2_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
#else
|
|
static inline void s5pc100_default_sdhci0(void) { }
|
|
static inline void s5pc100_default_sdhci1(void) { }
|
|
static inline void s5pc100_default_sdhci2(void) { }
|
|
|
|
#endif /* CONFIG_S5PC100_SETUP_SDHCI */
|
|
|
|
/* S5PV210 SDHCI setup */
|
|
|
|
#ifdef CONFIG_S5PV210_SETUP_SDHCI
|
|
static inline void s5pv210_default_sdhci0(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = s5pv210_setup_sdhci0_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s5pv210_default_sdhci1(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = s5pv210_setup_sdhci1_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s5pv210_default_sdhci2(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = s5pv210_setup_sdhci2_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void s5pv210_default_sdhci3(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC3
|
|
s3c_hsmmc3_def_platdata.cfg_gpio = s5pv210_setup_sdhci3_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
#else
|
|
static inline void s5pv210_default_sdhci0(void) { }
|
|
static inline void s5pv210_default_sdhci1(void) { }
|
|
static inline void s5pv210_default_sdhci2(void) { }
|
|
static inline void s5pv210_default_sdhci3(void) { }
|
|
|
|
#endif /* CONFIG_S5PV210_SETUP_SDHCI */
|
|
|
|
/* EXYNOS4 SDHCI setup */
|
|
#ifdef CONFIG_EXYNOS4_SETUP_SDHCI
|
|
static inline void exynos4_default_sdhci0(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC
|
|
s3c_hsmmc0_def_platdata.cfg_gpio = exynos4_setup_sdhci0_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void exynos4_default_sdhci1(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC1
|
|
s3c_hsmmc1_def_platdata.cfg_gpio = exynos4_setup_sdhci1_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void exynos4_default_sdhci2(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC2
|
|
s3c_hsmmc2_def_platdata.cfg_gpio = exynos4_setup_sdhci2_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
static inline void exynos4_default_sdhci3(void)
|
|
{
|
|
#ifdef CONFIG_S3C_DEV_HSMMC3
|
|
s3c_hsmmc3_def_platdata.cfg_gpio = exynos4_setup_sdhci3_cfg_gpio;
|
|
#endif
|
|
}
|
|
|
|
#else
|
|
static inline void exynos4_default_sdhci0(void) { }
|
|
static inline void exynos4_default_sdhci1(void) { }
|
|
static inline void exynos4_default_sdhci2(void) { }
|
|
static inline void exynos4_default_sdhci3(void) { }
|
|
|
|
#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
|
|
|
|
#endif /* __PLAT_S3C_SDHCI_H */
|