diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-11 06:34:22 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-11 06:34:22 -0400 |
| commit | f43b179bbd84d2106c6fb8c7f2db1bfacff19f62 (patch) | |
| tree | 581e60846d1298276fac0b768ba12e06d7600d1e /include/linux | |
| parent | a2ce35273c2f1aa0dcddd8822681d64ee5f31852 (diff) | |
| parent | 583f958b8a23343c904ec0790c25c96f5f82d409 (diff) | |
Merge tag 'mmc-v3.18-1' of git://git.linaro.org/people/ulf.hansson/mmc
Pull MMC updates from Ulf Hansson:
"MMC core:
- Fix SDIO IRQ bug
- MMC regulator improvements
- Fix slot-gpio card detect bug
- Add support for Driver Stage Register
- Convert the common MMC OF parser to use GPIO descriptors
- Convert MMC_CAP2_NO_MULTI_READ into a callback, ->multi_io_quirk()
- Some additional minor fixes
MMC host:
- mmci: Support Qualcomm specific DML layer for DMA
- dw_mmc: Use common MMC regulators
- dw_mmc: Add support for Rock-chips RK3288
- tmio: Enable runtime PM support
- tmio: Add support for R-Car Gen2 SoCs
- tmio: Several fixes and improvements
- omap_hsmmc: Removed Balaji from MAINTAINERS
- jz4740: add DMA and pre/post support
- sdhci: Add support for Intel Braswell
- sdhci: Several fixes and improvements"
* tag 'mmc-v3.18-1' of git://git.linaro.org/people/ulf.hansson/mmc: (119 commits)
ARM: dts: fix MMC2 regulators for Exynos5420 Arndale Octa board
mmc: sdhci-acpi: Fix Braswell eMMC timeout clock frequency
mmc: sdhci-acpi: Pass HID and UID to probe_slot
mmc: sdhci-acpi: Get UID directly from acpi_device
mmc, sdhci, bcm-kona, LLVMLinux: Remove use of __initconst
mmc: sdhci-pci: Fix Braswell eMMC timeout clock frequency
mmc: sdhci: Let a driver override timeout clock frequency
mmc: sdhci-pci: Add Bay Trail and Braswell SD card detect
mmc: sdhci-pci: Set SDHCI_QUIRK2_STOP_WITH_TC for Intel BYT host controllers
mmc: sdhci-acpi: Add a HID and UID for a SD Card host controller
mmc: sdhci-acpi: Set SDHCI_QUIRK2_STOP_WITH_TC for Intel host controllers
mmc: sdhci: Add quirk for always getting TC with stop cmd
mmc: core: restore detect line inversion semantics
mmc: Fix incorrect warning when setting 0 Hz via debugfs
mmc: Fix use of wrong device in mmc_gpiod_free_cd()
mmc: atmel-mci: fix mismatched section on atmci_cleanup_slot
mmc: rtsx_pci: Set power related cap2 macros
mmc: core: Add new power_mode MMC_POWER_UNDEFINED
mmc: sdhci: execute tuning when device is not busy
mmc: atmel-mci: Release mmc resources on failure in probe
..
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/atmel-mci.h | 2 | ||||
| -rw-r--r-- | include/linux/mfd/tmio.h | 25 | ||||
| -rw-r--r-- | include/linux/mmc/card.h | 10 | ||||
| -rw-r--r-- | include/linux/mmc/dw_mmc.h | 4 | ||||
| -rw-r--r-- | include/linux/mmc/host.h | 12 | ||||
| -rw-r--r-- | include/linux/mmc/mmc.h | 7 | ||||
| -rw-r--r-- | include/linux/mmc/sdhci.h | 3 | ||||
| -rw-r--r-- | include/linux/mmc/slot-gpio.h | 5 |
8 files changed, 61 insertions, 7 deletions
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h index 4c7a4b2104bf..91b77f8d495d 100644 --- a/include/linux/atmel-mci.h +++ b/include/linux/atmel-mci.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef __LINUX_ATMEL_MCI_H | 1 | #ifndef __LINUX_ATMEL_MCI_H |
| 2 | #define __LINUX_ATMEL_MCI_H | 2 | #define __LINUX_ATMEL_MCI_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 4 | #define ATMCI_MAX_NR_SLOTS 2 | 6 | #define ATMCI_MAX_NR_SLOTS 2 |
| 5 | 7 | ||
| 6 | /** | 8 | /** |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 8f6f2e91e7ae..57388171610d 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/fb.h> | 5 | #include <linux/fb.h> |
| 6 | #include <linux/io.h> | 6 | #include <linux/io.h> |
| 7 | #include <linux/jiffies.h> | 7 | #include <linux/jiffies.h> |
| 8 | #include <linux/mmc/card.h> | ||
| 8 | #include <linux/platform_device.h> | 9 | #include <linux/platform_device.h> |
| 9 | #include <linux/pm_runtime.h> | 10 | #include <linux/pm_runtime.h> |
| 10 | 11 | ||
| @@ -83,6 +84,27 @@ | |||
| 83 | */ | 84 | */ |
| 84 | #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) | 85 | #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) |
| 85 | 86 | ||
| 87 | /* | ||
| 88 | * Some controllers have CMD12 automatically | ||
| 89 | * issue/non-issue register | ||
| 90 | */ | ||
| 91 | #define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) | ||
| 92 | |||
| 93 | /* | ||
| 94 | * Some controllers needs to set 1 on SDIO status reserved bits | ||
| 95 | */ | ||
| 96 | #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Some controllers have DMA enable/disable register | ||
| 100 | */ | ||
| 101 | #define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) | ||
| 102 | |||
| 103 | /* | ||
| 104 | * Some controllers allows to set SDx actual clock | ||
| 105 | */ | ||
| 106 | #define TMIO_MMC_CLK_ACTUAL (1 << 10) | ||
| 107 | |||
| 86 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | 108 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); |
| 87 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | 109 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); |
| 88 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); | 110 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); |
| @@ -96,6 +118,7 @@ struct tmio_mmc_dma { | |||
| 96 | int slave_id_tx; | 118 | int slave_id_tx; |
| 97 | int slave_id_rx; | 119 | int slave_id_rx; |
| 98 | int alignment_shift; | 120 | int alignment_shift; |
| 121 | dma_addr_t dma_rx_offset; | ||
| 99 | bool (*filter)(struct dma_chan *chan, void *arg); | 122 | bool (*filter)(struct dma_chan *chan, void *arg); |
| 100 | }; | 123 | }; |
| 101 | 124 | ||
| @@ -120,6 +143,8 @@ struct tmio_mmc_data { | |||
| 120 | /* clock management callbacks */ | 143 | /* clock management callbacks */ |
| 121 | int (*clk_enable)(struct platform_device *pdev, unsigned int *f); | 144 | int (*clk_enable)(struct platform_device *pdev, unsigned int *f); |
| 122 | void (*clk_disable)(struct platform_device *pdev); | 145 | void (*clk_disable)(struct platform_device *pdev); |
| 146 | int (*multi_io_quirk)(struct mmc_card *card, | ||
| 147 | unsigned int direction, int blk_size); | ||
| 123 | }; | 148 | }; |
| 124 | 149 | ||
| 125 | /* | 150 | /* |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index d424b9de3aff..b0692d28f8e6 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -42,7 +42,8 @@ struct mmc_csd { | |||
| 42 | unsigned int read_partial:1, | 42 | unsigned int read_partial:1, |
| 43 | read_misalign:1, | 43 | read_misalign:1, |
| 44 | write_partial:1, | 44 | write_partial:1, |
| 45 | write_misalign:1; | 45 | write_misalign:1, |
| 46 | dsr_imp:1; | ||
| 46 | }; | 47 | }; |
| 47 | 48 | ||
| 48 | struct mmc_ext_csd { | 49 | struct mmc_ext_csd { |
| @@ -74,7 +75,7 @@ struct mmc_ext_csd { | |||
| 74 | unsigned int sec_trim_mult; /* Secure trim multiplier */ | 75 | unsigned int sec_trim_mult; /* Secure trim multiplier */ |
| 75 | unsigned int sec_erase_mult; /* Secure erase multiplier */ | 76 | unsigned int sec_erase_mult; /* Secure erase multiplier */ |
| 76 | unsigned int trim_timeout; /* In milliseconds */ | 77 | unsigned int trim_timeout; /* In milliseconds */ |
| 77 | bool enhanced_area_en; /* enable bit */ | 78 | bool partition_setting_completed; /* enable bit */ |
| 78 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 79 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
| 79 | unsigned int enhanced_area_size; /* Units: KB */ | 80 | unsigned int enhanced_area_size; /* Units: KB */ |
| 80 | unsigned int cache_size; /* Units: KB */ | 81 | unsigned int cache_size; /* Units: KB */ |
| @@ -214,11 +215,12 @@ enum mmc_blk_status { | |||
| 214 | }; | 215 | }; |
| 215 | 216 | ||
| 216 | /* The number of MMC physical partitions. These consist of: | 217 | /* The number of MMC physical partitions. These consist of: |
| 217 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. | 218 | * boot partitions (2), general purpose partitions (4) and |
| 219 | * RPMB partition (1) in MMC v4.4. | ||
| 218 | */ | 220 | */ |
| 219 | #define MMC_NUM_BOOT_PARTITION 2 | 221 | #define MMC_NUM_BOOT_PARTITION 2 |
| 220 | #define MMC_NUM_GP_PARTITION 4 | 222 | #define MMC_NUM_GP_PARTITION 4 |
| 221 | #define MMC_NUM_PHY_PARTITION 6 | 223 | #define MMC_NUM_PHY_PARTITION 7 |
| 222 | #define MAX_MMC_PART_NAME_LEN 20 | 224 | #define MAX_MMC_PART_NAME_LEN 20 |
| 223 | 225 | ||
| 224 | /* | 226 | /* |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 29ce014ab421..001366927cf4 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -26,6 +26,8 @@ enum dw_mci_state { | |||
| 26 | STATE_DATA_BUSY, | 26 | STATE_DATA_BUSY, |
| 27 | STATE_SENDING_STOP, | 27 | STATE_SENDING_STOP, |
| 28 | STATE_DATA_ERROR, | 28 | STATE_DATA_ERROR, |
| 29 | STATE_SENDING_CMD11, | ||
| 30 | STATE_WAITING_CMD11_DONE, | ||
| 29 | }; | 31 | }; |
| 30 | 32 | ||
| 31 | enum { | 33 | enum { |
| @@ -188,7 +190,7 @@ struct dw_mci { | |||
| 188 | /* Workaround flags */ | 190 | /* Workaround flags */ |
| 189 | u32 quirks; | 191 | u32 quirks; |
| 190 | 192 | ||
| 191 | struct regulator *vmmc; /* Power regulator */ | 193 | bool vqmmc_enabled; |
| 192 | unsigned long irq_flags; /* IRQ flags */ | 194 | unsigned long irq_flags; /* IRQ flags */ |
| 193 | int irq; | 195 | int irq; |
| 194 | }; | 196 | }; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 7960424d0bc0..df0c15396bbf 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -42,6 +42,7 @@ struct mmc_ios { | |||
| 42 | #define MMC_POWER_OFF 0 | 42 | #define MMC_POWER_OFF 0 |
| 43 | #define MMC_POWER_UP 1 | 43 | #define MMC_POWER_UP 1 |
| 44 | #define MMC_POWER_ON 2 | 44 | #define MMC_POWER_ON 2 |
| 45 | #define MMC_POWER_UNDEFINED 3 | ||
| 45 | 46 | ||
| 46 | unsigned char bus_width; /* data bus width */ | 47 | unsigned char bus_width; /* data bus width */ |
| 47 | 48 | ||
| @@ -139,6 +140,13 @@ struct mmc_host_ops { | |||
| 139 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); | 140 | int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); |
| 140 | void (*hw_reset)(struct mmc_host *host); | 141 | void (*hw_reset)(struct mmc_host *host); |
| 141 | void (*card_event)(struct mmc_host *host); | 142 | void (*card_event)(struct mmc_host *host); |
| 143 | |||
| 144 | /* | ||
| 145 | * Optional callback to support controllers with HW issues for multiple | ||
| 146 | * I/O. Returns the number of supported blocks for the request. | ||
| 147 | */ | ||
| 148 | int (*multi_io_quirk)(struct mmc_card *card, | ||
| 149 | unsigned int direction, int blk_size); | ||
| 142 | }; | 150 | }; |
| 143 | 151 | ||
| 144 | struct mmc_card; | 152 | struct mmc_card; |
| @@ -265,7 +273,6 @@ struct mmc_host { | |||
| 265 | 273 | ||
| 266 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | 274 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ |
| 267 | #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */ | 275 | #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */ |
| 268 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | ||
| 269 | #define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ | 276 | #define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ |
| 270 | #define MMC_CAP2_HS200_1_2V_SDR (1 << 6) /* can support */ | 277 | #define MMC_CAP2_HS200_1_2V_SDR (1 << 6) /* can support */ |
| 271 | #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ | 278 | #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ |
| @@ -365,6 +372,9 @@ struct mmc_host { | |||
| 365 | 372 | ||
| 366 | unsigned int slotno; /* used for sdio acpi binding */ | 373 | unsigned int slotno; /* used for sdio acpi binding */ |
| 367 | 374 | ||
| 375 | int dsr_req; /* DSR value is valid */ | ||
| 376 | u32 dsr; /* optional driver stage (DSR) value */ | ||
| 377 | |||
| 368 | unsigned long private[0] ____cacheline_aligned; | 378 | unsigned long private[0] ____cacheline_aligned; |
| 369 | }; | 379 | }; |
| 370 | 380 | ||
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 64ec963ed347..1cd00b3a75b9 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -53,6 +53,11 @@ | |||
| 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ | 53 | #define MMC_SEND_TUNING_BLOCK 19 /* adtc R1 */ |
| 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ | 54 | #define MMC_SEND_TUNING_BLOCK_HS200 21 /* adtc R1 */ |
| 55 | 55 | ||
| 56 | #define MMC_TUNING_BLK_PATTERN_4BIT_SIZE 64 | ||
| 57 | #define MMC_TUNING_BLK_PATTERN_8BIT_SIZE 128 | ||
| 58 | extern const u8 tuning_blk_pattern_4bit[MMC_TUNING_BLK_PATTERN_4BIT_SIZE]; | ||
| 59 | extern const u8 tuning_blk_pattern_8bit[MMC_TUNING_BLK_PATTERN_8BIT_SIZE]; | ||
| 60 | |||
| 56 | /* class 3 */ | 61 | /* class 3 */ |
| 57 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ | 62 | #define MMC_WRITE_DAT_UNTIL_STOP 20 /* adtc [31:0] data addr R1 */ |
| 58 | 63 | ||
| @@ -281,6 +286,7 @@ struct _mmc_csd { | |||
| 281 | #define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ | 286 | #define EXT_CSD_EXP_EVENTS_CTRL 56 /* R/W, 2 bytes */ |
| 282 | #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ | 287 | #define EXT_CSD_DATA_SECTOR_SIZE 61 /* R */ |
| 283 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | 288 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ |
| 289 | #define EXT_CSD_PARTITION_SETTING_COMPLETED 155 /* R/W */ | ||
| 284 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 290 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
| 285 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | 291 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ |
| 286 | #define EXT_CSD_HPI_MGMT 161 /* R/W */ | 292 | #define EXT_CSD_HPI_MGMT 161 /* R/W */ |
| @@ -349,6 +355,7 @@ struct _mmc_csd { | |||
| 349 | #define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3) | 355 | #define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3) |
| 350 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) | 356 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
| 351 | 357 | ||
| 358 | #define EXT_CSD_PART_SETTING_COMPLETED (0x1) | ||
| 352 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) | 359 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) |
| 353 | 360 | ||
| 354 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | 361 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 09ebe57d5ce9..dba793e3a331 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -98,6 +98,8 @@ struct sdhci_host { | |||
| 98 | #define SDHCI_QUIRK2_BROKEN_HS200 (1<<6) | 98 | #define SDHCI_QUIRK2_BROKEN_HS200 (1<<6) |
| 99 | /* Controller does not support DDR50 */ | 99 | /* Controller does not support DDR50 */ |
| 100 | #define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7) | 100 | #define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7) |
| 101 | /* Stop command (CMD12) can set Transfer Complete when not using MMC_RSP_BUSY */ | ||
| 102 | #define SDHCI_QUIRK2_STOP_WITH_TC (1<<8) | ||
| 101 | 103 | ||
| 102 | int irq; /* Device IRQ */ | 104 | int irq; /* Device IRQ */ |
| 103 | void __iomem *ioaddr; /* Mapped address */ | 105 | void __iomem *ioaddr; /* Mapped address */ |
| @@ -146,6 +148,7 @@ struct sdhci_host { | |||
| 146 | struct mmc_command *cmd; /* Current command */ | 148 | struct mmc_command *cmd; /* Current command */ |
| 147 | struct mmc_data *data; /* Current data request */ | 149 | struct mmc_data *data; /* Current data request */ |
| 148 | unsigned int data_early:1; /* Data finished before cmd */ | 150 | unsigned int data_early:1; /* Data finished before cmd */ |
| 151 | unsigned int busy_handle:1; /* Handling the order of Busy-end */ | ||
| 149 | 152 | ||
| 150 | struct sg_mapping_iter sg_miter; /* SG state for PIO */ | 153 | struct sg_mapping_iter sg_miter; /* SG state for PIO */ |
| 151 | unsigned int blocks; /* remaining PIO blocks */ | 154 | unsigned int blocks; /* remaining PIO blocks */ |
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h index d2433381e828..e56fa24c9322 100644 --- a/include/linux/mmc/slot-gpio.h +++ b/include/linux/mmc/slot-gpio.h | |||
| @@ -24,7 +24,10 @@ void mmc_gpio_free_cd(struct mmc_host *host); | |||
| 24 | 24 | ||
| 25 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, | 25 | int mmc_gpiod_request_cd(struct mmc_host *host, const char *con_id, |
| 26 | unsigned int idx, bool override_active_level, | 26 | unsigned int idx, bool override_active_level, |
| 27 | unsigned int debounce); | 27 | unsigned int debounce, bool *gpio_invert); |
| 28 | int mmc_gpiod_request_ro(struct mmc_host *host, const char *con_id, | ||
| 29 | unsigned int idx, bool override_active_level, | ||
| 30 | unsigned int debounce, bool *gpio_invert); | ||
| 28 | void mmc_gpiod_free_cd(struct mmc_host *host); | 31 | void mmc_gpiod_free_cd(struct mmc_host *host); |
| 29 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); | 32 | void mmc_gpiod_request_cd_irq(struct mmc_host *host); |
| 30 | 33 | ||
