mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
MMC highlights for 3.7:
Core:
- Add DT properties for card detection (broken-cd, cd-gpios, non-removable)
- Don't poll non-removable devices
- Fixup/rework eMMC sleep mode/"power off notify" feature
- Support eMMC background operations (BKOPS). To set the one-time
programmable fuse that enables bkops on an eMMC that doesn't already
have it set, you can use the "mmc bkops enable" command in:
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
Drivers:
- atmel-mci, dw_mmc, pxa-mci, dove, s3c, spear: Add device tree support
- bfin_sdh: Add support for the controller in bf60x
- dw_mmc: Support Samsung Exynos SoCs
- eSDHC: Add ADMA support
- sdhci: Support testing a cd-gpio (from slot-gpio) instead of presence bit
- sdhci-pltfm: Support broken-cd DT property
- tegra: Convert to only supporting DT (mach-tegra has gone DT-only)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJQcfc/AAoJEHNBYZ7TNxYMB3wQALPObZUjKBsR38N2llPUOz5M
nTMNYa99Pg3/Du5EgXKwYDkoYG1M9yjNTdxBmz3Sz9cIkLueZHoDmqvpgZJv9vRn
5l0TncExC+T2Tn7qjE5axgM7fus5r9SLKCOtbE+V8jATTWeG0d/X0DdzvKPpJLmb
uLPmqNG50LdQQUoCkcDU3hiDONqQnOx4tDq4C7rTlf+Cr8pJXRoBPEF0C1PTvs64
0AP8oXDtirz+RIR5xTELy08o4SVS4Wcn63PH1H56kmAIjdT5FeVnAOeyF9Aer/+R
Sz3qMrN/sNSEEkbgCGQLJVVYACNdgB1WXdxhqk2d996iwtEQgkVB8S2ziyhpZTZ2
SxgCMvfYf5ySOIuzvyEScGdKjw6DSV01HDr9eyFJqIYaDOBp+kUJkbM2O8ISf+Kb
rudrc58mdfPPhX5rqjEYBKGtyC6q+LvRGOwO8QJNvZ0wAFAg4nCzcD9btAl65QR1
7aM0qp+55pyc2xyUO9q5AvOwiaBU2sYYuBCUm1zzK3HQ8x5ZKpueQwa2KBmEa2f+
Qp6oflWNeG/X53WHCurl/ECZY5Y4w4esHPMWXVXJP8Ao+3D2Wofkp4CSGcQClZSd
/OBGSw9g70BIKwOTUvU9tD3ALQsG+A9UHmG7RQBhmcQFaKY709bfhzSG3/jHymSg
AKr0VSezE/DTj6URvxaq
=qyY5
-----END PGP SIGNATURE-----
Merge tag 'mmc-merge-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
Pull MMC updates from Chris Ball:
"Core:
- Add DT properties for card detection (broken-cd, cd-gpios,
non-removable)
- Don't poll non-removable devices
- Fixup/rework eMMC sleep mode/"power off notify" feature
- Support eMMC background operations (BKOPS). To set the one-time
programmable fuse that enables bkops on an eMMC that doesn't
already have it set, you can use the "mmc bkops enable" command in:
git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
Drivers:
- atmel-mci, dw_mmc, pxa-mci, dove, s3c, spear: Add device tree
support
- bfin_sdh: Add support for the controller in bf60x
- dw_mmc: Support Samsung Exynos SoCs
- eSDHC: Add ADMA support
- sdhci: Support testing a cd-gpio (from slot-gpio) instead of
presence bit
- sdhci-pltfm: Support broken-cd DT property
- tegra: Convert to only supporting DT (mach-tegra has gone DT-only)"
* tag 'mmc-merge-for-3.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (67 commits)
mmc: core: Fixup broken suspend and eMMC4.5 power off notify
mmc: sdhci-spear: Add clk_{un}prepare() support
mmc: sdhci-spear: add device tree bindings
mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume
mmc: core: Replace MMC_CAP2_BROKEN_VOLTAGE with test for fixed regulator
mmc: sdhci-pxav3: Use sdhci_get_of_property for parsing DT quirks
mmc: dt: Support "broken-cd" property in sdhci-pltfm
mmc: sdhci-s3c: fix the wrong number of max bus clocks
mmc: sh-mmcif: avoid oops on spurious interrupts
mmc: sh-mmcif: properly handle MMC_WRITE_MULTIPLE_BLOCK completion IRQ
mmc: sdhci-s3c: Fix crash on module insertion for second time
mmc: sdhci-s3c: Enable only required bus clock
mmc: Revert "mmc: dw_mmc: Add check for IDMAC configuration"
mmc: mxcmmc: fix bug that may block a data transfer forever
mmc: omap_hsmmc: Pass on the suspend failure to the PM core
mmc: atmel-mci: AP700x PDC is not connected to MCI
mmc: atmel-mci: DMA can be used with other controllers
mmc: mmci: use clk_prepare_enable and clk_disable_unprepare
mmc: sdhci-s3c: Add device tree support
mmc: dw_mmc: add support for exynos specific implementation of dw-mshc
...
This commit is contained in:
commit
943c2acea5
55 changed files with 2277 additions and 809 deletions
|
|
@ -57,6 +57,7 @@ struct mmc_ext_csd {
|
|||
unsigned int sa_timeout; /* Units: 100ns */
|
||||
unsigned int generic_cmd6_time; /* Units: 10ms */
|
||||
unsigned int power_off_longtime; /* Units: ms */
|
||||
u8 power_off_notification; /* state */
|
||||
unsigned int hs_max_dtr;
|
||||
#define MMC_HIGH_26_MAX_DTR 26000000
|
||||
#define MMC_HIGH_52_MAX_DTR 52000000
|
||||
|
|
@ -76,10 +77,13 @@ struct mmc_ext_csd {
|
|||
bool hpi_en; /* HPI enablebit */
|
||||
bool hpi; /* HPI support bit */
|
||||
unsigned int hpi_cmd; /* cmd used as HPI */
|
||||
bool bkops; /* background support bit */
|
||||
bool bkops_en; /* background enable bit */
|
||||
unsigned int data_sector_size; /* 512 bytes or 4KB */
|
||||
unsigned int data_tag_unit_size; /* DATA TAG UNIT size */
|
||||
unsigned int boot_ro_lock; /* ro lock support */
|
||||
bool boot_ro_lockable;
|
||||
u8 raw_exception_status; /* 53 */
|
||||
u8 raw_partition_support; /* 160 */
|
||||
u8 raw_erased_mem_count; /* 181 */
|
||||
u8 raw_ext_csd_structure; /* 194 */
|
||||
|
|
@ -93,6 +97,7 @@ struct mmc_ext_csd {
|
|||
u8 raw_sec_erase_mult; /* 230 */
|
||||
u8 raw_sec_feature_support;/* 231 */
|
||||
u8 raw_trim_mult; /* 232 */
|
||||
u8 raw_bkops_status; /* 246 */
|
||||
u8 raw_sectors[4]; /* 212 - 4 bytes */
|
||||
|
||||
unsigned int feature_support;
|
||||
|
|
@ -225,7 +230,7 @@ struct mmc_card {
|
|||
#define MMC_CARD_SDXC (1<<6) /* card is SDXC */
|
||||
#define MMC_CARD_REMOVED (1<<7) /* card has been removed */
|
||||
#define MMC_STATE_HIGHSPEED_200 (1<<8) /* card is in HS200 mode */
|
||||
#define MMC_STATE_SLEEP (1<<9) /* card is in sleep state */
|
||||
#define MMC_STATE_DOING_BKOPS (1<<10) /* card is doing BKOPS */
|
||||
unsigned int quirks; /* card quirks */
|
||||
#define MMC_QUIRK_LENIENT_FN0 (1<<0) /* allow SDIO FN0 writes outside of the VS CCCR range */
|
||||
#define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1) /* use func->cur_blksize */
|
||||
|
|
@ -241,11 +246,6 @@ struct mmc_card {
|
|||
#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */
|
||||
#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */
|
||||
/* byte mode */
|
||||
unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */
|
||||
#define MMC_NO_POWER_NOTIFICATION 0
|
||||
#define MMC_POWERED_ON 1
|
||||
#define MMC_POWEROFF_SHORT 2
|
||||
#define MMC_POWEROFF_LONG 3
|
||||
|
||||
unsigned int erase_size; /* erase size in sectors */
|
||||
unsigned int erase_shift; /* if erase unit is power 2 */
|
||||
|
|
@ -392,7 +392,7 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
|
|||
#define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED)
|
||||
#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
|
||||
#define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED))
|
||||
#define mmc_card_is_sleep(c) ((c)->state & MMC_STATE_SLEEP)
|
||||
#define mmc_card_doing_bkops(c) ((c)->state & MMC_STATE_DOING_BKOPS)
|
||||
|
||||
#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
|
||||
#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
|
||||
|
|
@ -404,9 +404,9 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
|
|||
#define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED)
|
||||
#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
|
||||
#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
|
||||
#define mmc_card_set_sleep(c) ((c)->state |= MMC_STATE_SLEEP)
|
||||
#define mmc_card_set_doing_bkops(c) ((c)->state |= MMC_STATE_DOING_BKOPS)
|
||||
#define mmc_card_clr_doing_bkops(c) ((c)->state &= ~MMC_STATE_DOING_BKOPS)
|
||||
|
||||
#define mmc_card_clr_sleep(c) ((c)->state &= ~MMC_STATE_SLEEP)
|
||||
/*
|
||||
* Quirk add/remove for MMC products.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ struct mmc_host;
|
|||
struct mmc_card;
|
||||
struct mmc_async_req;
|
||||
|
||||
extern int mmc_stop_bkops(struct mmc_card *);
|
||||
extern int mmc_read_bkops_status(struct mmc_card *);
|
||||
extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
|
||||
struct mmc_async_req *, int *);
|
||||
extern int mmc_interrupt_hpi(struct mmc_card *);
|
||||
|
|
@ -142,6 +144,8 @@ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
|
|||
extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
|
||||
extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
|
||||
struct mmc_command *, int);
|
||||
extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
|
||||
extern int __mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int, bool);
|
||||
extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
|
||||
|
||||
#define MMC_ERASE_ARG 0x00000000
|
||||
|
|
|
|||
|
|
@ -78,6 +78,10 @@ struct mmc_data;
|
|||
* @data_offset: Set the offset of DATA register according to VERID.
|
||||
* @dev: Device associated with the MMC controller.
|
||||
* @pdata: Platform data associated with the MMC controller.
|
||||
* @drv_data: Driver specific data for identified variant of the controller
|
||||
* @priv: Implementation defined private data.
|
||||
* @biu_clk: Pointer to bus interface unit clock instance.
|
||||
* @ciu_clk: Pointer to card interface unit clock instance.
|
||||
* @slot: Slots sharing this MMC controller.
|
||||
* @fifo_depth: depth of FIFO.
|
||||
* @data_shift: log2 of FIFO item size.
|
||||
|
|
@ -156,8 +160,12 @@ struct dw_mci {
|
|||
u32 fifoth_val;
|
||||
u16 verid;
|
||||
u16 data_offset;
|
||||
struct device dev;
|
||||
struct device *dev;
|
||||
struct dw_mci_board *pdata;
|
||||
struct dw_mci_drv_data *drv_data;
|
||||
void *priv;
|
||||
struct clk *biu_clk;
|
||||
struct clk *ciu_clk;
|
||||
struct dw_mci_slot *slot[MAX_MCI_SLOTS];
|
||||
|
||||
/* FIFO push and pull */
|
||||
|
|
@ -201,7 +209,8 @@ struct dw_mci_dma_ops {
|
|||
#define DW_MCI_QUIRK_HIGHSPEED BIT(2)
|
||||
/* Unreliable card detection */
|
||||
#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3)
|
||||
|
||||
/* Write Protect detection not available */
|
||||
#define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4)
|
||||
|
||||
struct dma_pdata;
|
||||
|
||||
|
|
@ -218,7 +227,7 @@ struct dw_mci_board {
|
|||
u32 num_slots;
|
||||
|
||||
u32 quirks; /* Workaround / Quirk flags */
|
||||
unsigned int bus_hz; /* Bus speed */
|
||||
unsigned int bus_hz; /* Clock speed at the cclk_in pad */
|
||||
|
||||
unsigned int caps; /* Capabilities */
|
||||
unsigned int caps2; /* More capabilities */
|
||||
|
|
|
|||
|
|
@ -259,10 +259,6 @@ struct mmc_host {
|
|||
#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
|
||||
|
||||
mmc_pm_flag_t pm_caps; /* supported pm features */
|
||||
unsigned int power_notify_type;
|
||||
#define MMC_HOST_PW_NOTIFY_NONE 0
|
||||
#define MMC_HOST_PW_NOTIFY_SHORT 1
|
||||
#define MMC_HOST_PW_NOTIFY_LONG 2
|
||||
|
||||
#ifdef CONFIG_MMC_CLKGATE
|
||||
int clk_requests; /* internal reference counter */
|
||||
|
|
@ -300,6 +296,7 @@ struct mmc_host {
|
|||
#endif
|
||||
|
||||
int rescan_disable; /* disable card detection */
|
||||
int rescan_entered; /* used with nonremovable devices */
|
||||
|
||||
struct mmc_card *card; /* device attached to this host */
|
||||
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ static inline bool mmc_op_multi(u32 opcode)
|
|||
#define R1_CURRENT_STATE(x) ((x & 0x00001E00) >> 9) /* sx, b (4 bits) */
|
||||
#define R1_READY_FOR_DATA (1 << 8) /* sx, a */
|
||||
#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
|
||||
#define R1_EXCEPTION_EVENT (1 << 6) /* sx, a */
|
||||
#define R1_APP_CMD (1 << 5) /* sr, c */
|
||||
|
||||
#define R1_STATE_IDLE 0
|
||||
|
|
@ -274,12 +275,15 @@ struct _mmc_csd {
|
|||
#define EXT_CSD_FLUSH_CACHE 32 /* W */
|
||||
#define EXT_CSD_CACHE_CTRL 33 /* R/W */
|
||||
#define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */
|
||||
#define EXT_CSD_EXP_EVENTS_STATUS 54 /* RO */
|
||||
#define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */
|
||||
#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
|
||||
#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
|
||||
#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
|
||||
#define EXT_CSD_HPI_MGMT 161 /* R/W */
|
||||
#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
|
||||
#define EXT_CSD_BKOPS_EN 163 /* R/W */
|
||||
#define EXT_CSD_BKOPS_START 164 /* W */
|
||||
#define EXT_CSD_SANITIZE_START 165 /* W */
|
||||
#define EXT_CSD_WR_REL_PARAM 166 /* RO */
|
||||
#define EXT_CSD_BOOT_WP 173 /* R/W */
|
||||
|
|
@ -313,11 +317,13 @@ struct _mmc_csd {
|
|||
#define EXT_CSD_PWR_CL_200_360 237 /* RO */
|
||||
#define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */
|
||||
#define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */
|
||||
#define EXT_CSD_BKOPS_STATUS 246 /* RO */
|
||||
#define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */
|
||||
#define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */
|
||||
#define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */
|
||||
#define EXT_CSD_TAG_UNIT_SIZE 498 /* RO */
|
||||
#define EXT_CSD_DATA_TAG_SUPPORT 499 /* RO */
|
||||
#define EXT_CSD_BKOPS_SUPPORT 502 /* RO */
|
||||
#define EXT_CSD_HPI_FEATURES 503 /* RO */
|
||||
|
||||
/*
|
||||
|
|
@ -377,6 +383,19 @@ struct _mmc_csd {
|
|||
#define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */
|
||||
#define EXT_CSD_PWR_CL_8BIT_SHIFT 4
|
||||
#define EXT_CSD_PWR_CL_4BIT_SHIFT 0
|
||||
/*
|
||||
* EXCEPTION_EVENT_STATUS field
|
||||
*/
|
||||
#define EXT_CSD_URGENT_BKOPS BIT(0)
|
||||
#define EXT_CSD_DYNCAP_NEEDED BIT(1)
|
||||
#define EXT_CSD_SYSPOOL_EXHAUSTED BIT(2)
|
||||
#define EXT_CSD_PACKED_FAILURE BIT(3)
|
||||
|
||||
/*
|
||||
* BKOPS status level
|
||||
*/
|
||||
#define EXT_CSD_BKOPS_LEVEL_2 0x2
|
||||
|
||||
/*
|
||||
* MMC_SWITCH access modes
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -97,7 +97,8 @@ struct sdhci_host {
|
|||
|
||||
const struct sdhci_ops *ops; /* Low level hw interface */
|
||||
|
||||
struct regulator *vmmc; /* Power regulator */
|
||||
struct regulator *vmmc; /* Power regulator (vmmc) */
|
||||
struct regulator *vqmmc; /* Signaling regulator (vccq) */
|
||||
|
||||
/* Internal data */
|
||||
struct mmc_host *mmc; /* MMC structure */
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ struct sdhci_pxa_platdata {
|
|||
bool ext_cd_gpio_invert;
|
||||
unsigned int max_speed;
|
||||
unsigned int host_caps;
|
||||
unsigned int host_caps2;
|
||||
unsigned int quirks;
|
||||
unsigned int pm_caps;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue