You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc
Pull MMC updates from Ulf Hansson:
"MMC core:
- Fix ABI regression of MMC BLK ioctl
- Remove the unused MMC_DATA_STREAM flag
- Enable asynchronous system PM for the host device
- Minor fixes and clean-ups
SDHCI host:
Throughout the years, the numbers of SDHCI variants have increased
and so has also the numbers of SDHCI callbacks/quirks. The purpose
of these callbacks/quirks were to enable SDHCI to deal with variant
specific requirements, but unfortunate this method didn't scale.
Instead we have ended up with a mess. Not only did the code become
suboptimal but also highly fragile.
Lately many discussions of how to move forward with SDHCI has taken
place at the MMC mailing list. Step by step, we aim to turn
SDHCI's common code into a set of library functions. This will
enable for optimizations and allow some of the existing callbacks
and quirks to be removed, which also should help to make the code
less fragile.
Therefore I am also really pleased to announce that Adrian Hunter
(Intel) has volunteered to step in as the maintainer for SDHCI.
Future wise, I hope the community around SDHCI will continue to
grow and that this release cycle can be the starting point of
moving SDHCI into a better shape. As a matter of fact, already in
this cycle the re-factoring has begun, but of course there are also
fixes and new features included. Some highlights:
- sdhci-iproc: Add support for Broadcom's BCM2835 eMMC IP
- sdhci-acpi: Add support for QCOM controllers
- sdhci-pic32: Add new SDHCI variant for PIC32MZDA
Other hosts:
- atmel-mci: Fix a NULL pointer dereference
- mediatek: Add SD write-protect support
- mmc_spi: Fix card detect in GPIO case
- tmio/sdhi: Add r8a7795 support
- tmio/sdhi: Some fixes and clean-ups
- dw_mmc: Add HW reset support
- dw_mmc: Some fixes and clean-ups
- sunxi: Add support for MMC DDR52 mode"
* tag 'mmc-v4.6' of git://git.linaro.org/people/ulf.hansson/mmc: (123 commits)
mmc: sdhci-of-at91: fix wake-up issue when using runtime pm
mmc: sdhci-pci: Do not set DMA mask in enable_dma()
mmc: sdhci-acpi: Remove enable_dma() hook
mmc: sdhci: Set DMA mask when adding host
mmc: block: fix ABI regression of mmc_blk_ioctl
mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config
mmc: core: remove redundant memset of sdio_read_cccr
mmc: core: remove redundant memset of mmc_decode_cid
mmc: of_mmc_spi: fix unused warning
mmc: sdhci-of-arasan: add phy support for sdhci-of-arasan
mmc: sdhci-of-arasan: fix missing sdhci_pltfm_free for err handling
mmc: sdhci-of-arasan: remove disable clk_ahb from sdhci_arasan_resume
Documentation: bindings: add description of phy for sdhci-of-arasan
mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout
mmc: mmci: Remove unnecessary header file
mmc: sdhci-acpi: add QCOM controllers
mmc: tegra: implement memcomp pad calibration
mmc: mediatek: Use mmc_regulator_set_vqmmc in start_signal_voltage_switch
mmc: mediatek: Change signal voltage error to dev_dbg()
mmc: sh_mmcif, tmio: Use ARCH_RENESAS
...
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
Device Tree Bindings for the Arasan SDHCI Controller
|
Device Tree Bindings for the Arasan SDHCI Controller
|
||||||
|
|
||||||
The bindings follow the mmc[1], clock[2] and interrupt[3] bindings. Only
|
The bindings follow the mmc[1], clock[2], interrupt[3] and phy[4] bindings.
|
||||||
deviations are documented here.
|
Only deviations are documented here.
|
||||||
|
|
||||||
[1] Documentation/devicetree/bindings/mmc/mmc.txt
|
[1] Documentation/devicetree/bindings/mmc/mmc.txt
|
||||||
[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||||
[3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
|
[3] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
|
||||||
|
[4] Documentation/devicetree/bindings/phy/phy-bindings.txt
|
||||||
|
|
||||||
Required Properties:
|
Required Properties:
|
||||||
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
|
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
|
||||||
@@ -17,6 +18,10 @@ Required Properties:
|
|||||||
- interrupt-parent: Phandle for the interrupt controller that services
|
- interrupt-parent: Phandle for the interrupt controller that services
|
||||||
interrupts for this device.
|
interrupts for this device.
|
||||||
|
|
||||||
|
Required Properties for "arasan,sdhci-5.1":
|
||||||
|
- phys: From PHY bindings: Phandle for the Generic PHY for arasan.
|
||||||
|
- phy-names: MUST be "phy_arasan".
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
sdhci@e0100000 {
|
sdhci@e0100000 {
|
||||||
compatible = "arasan,sdhci-8.9a";
|
compatible = "arasan,sdhci-8.9a";
|
||||||
@@ -26,3 +31,14 @@ Example:
|
|||||||
interrupt-parent = <&gic>;
|
interrupt-parent = <&gic>;
|
||||||
interrupts = <0 24 4>;
|
interrupts = <0 24 4>;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
sdhci@e2800000 {
|
||||||
|
compatible = "arasan,sdhci-5.1";
|
||||||
|
reg = <0xe2800000 0x1000>;
|
||||||
|
clock-names = "clk_xin", "clk_ahb";
|
||||||
|
clocks = <&cru 8>, <&cru 18>;
|
||||||
|
interrupt-parent = <&gic>;
|
||||||
|
interrupts = <0 24 4>;
|
||||||
|
phys = <&emmc_phy>;
|
||||||
|
phy-names = "phy_arasan";
|
||||||
|
} ;
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ This file documents differences between the core properties described
|
|||||||
by mmc.txt and the properties that represent the IPROC SDHCI controller.
|
by mmc.txt and the properties that represent the IPROC SDHCI controller.
|
||||||
|
|
||||||
Required properties:
|
Required properties:
|
||||||
- compatible : Should be "brcm,sdhci-iproc-cygnus".
|
- compatible : Should be one of the following
|
||||||
|
"brcm,bcm2835-sdhci"
|
||||||
|
"brcm,sdhci-iproc-cygnus"
|
||||||
|
|
||||||
- clocks : The clock feeding the SDHCI controller.
|
- clocks : The clock feeding the SDHCI controller.
|
||||||
|
|
||||||
Optional properties:
|
Optional properties:
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
* Microchip PIC32 SDHCI Controller
|
||||||
|
|
||||||
|
This file documents differences between the core properties in mmc.txt
|
||||||
|
and the properties used by the sdhci-pic32 driver.
|
||||||
|
|
||||||
|
Required properties:
|
||||||
|
- compatible: Should be "microchip,pic32mzda-sdhci"
|
||||||
|
- interrupts: Should contain interrupt
|
||||||
|
- clock-names: Should be "base_clk", "sys_clk".
|
||||||
|
See: Documentation/devicetree/bindings/resource-names.txt
|
||||||
|
- clocks: Phandle to the clock.
|
||||||
|
See: Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||||
|
- pinctrl-names: A pinctrl state names "default" must be defined.
|
||||||
|
- pinctrl-0: Phandle referencing pin configuration of the SDHCI controller.
|
||||||
|
See: Documentation/devicetree/bindings/pinctrl/pinctrl-binding.txt
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
sdhci@1f8ec000 {
|
||||||
|
compatible = "microchip,pic32mzda-sdhci";
|
||||||
|
reg = <0x1f8ec000 0x100>;
|
||||||
|
interrupts = <191 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
|
clocks = <&REFCLKO4>, <&PBCLK5>;
|
||||||
|
clock-names = "base_clk", "sys_clk";
|
||||||
|
bus-width = <4>;
|
||||||
|
cap-sd-highspeed;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&pinctrl_sdhc1>;
|
||||||
|
};
|
||||||
@@ -22,6 +22,7 @@ Required properties:
|
|||||||
"renesas,sdhi-r8a7792" - SDHI IP on R8A7792 SoC
|
"renesas,sdhi-r8a7792" - SDHI IP on R8A7792 SoC
|
||||||
"renesas,sdhi-r8a7793" - SDHI IP on R8A7793 SoC
|
"renesas,sdhi-r8a7793" - SDHI IP on R8A7793 SoC
|
||||||
"renesas,sdhi-r8a7794" - SDHI IP on R8A7794 SoC
|
"renesas,sdhi-r8a7794" - SDHI IP on R8A7794 SoC
|
||||||
|
"renesas,sdhi-r8a7795" - SDHI IP on R8A7795 SoC
|
||||||
|
|
||||||
Optional properties:
|
Optional properties:
|
||||||
- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
|
- toshiba,mmc-wrprotect-disable: write-protect detection is unavailable
|
||||||
|
|||||||
+5
-3
@@ -9836,10 +9836,12 @@ S: Maintained
|
|||||||
F: drivers/mmc/host/sdricoh_cs.c
|
F: drivers/mmc/host/sdricoh_cs.c
|
||||||
|
|
||||||
SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
|
SECURE DIGITAL HOST CONTROLLER INTERFACE (SDHCI) DRIVER
|
||||||
|
M: Adrian Hunter <adrian.hunter@intel.com>
|
||||||
L: linux-mmc@vger.kernel.org
|
L: linux-mmc@vger.kernel.org
|
||||||
S: Orphan
|
T: git git://git.infradead.org/users/ahunter/linux-sdhci.git
|
||||||
F: drivers/mmc/host/sdhci.*
|
S: Maintained
|
||||||
F: drivers/mmc/host/sdhci-pltfm.[ch]
|
F: drivers/mmc/host/sdhci*
|
||||||
|
F: include/linux/mmc/sdhci*
|
||||||
|
|
||||||
SECURE COMPUTING
|
SECURE COMPUTING
|
||||||
M: Kees Cook <keescook@chromium.org>
|
M: Kees Cook <keescook@chromium.org>
|
||||||
|
|||||||
+20
-12
@@ -589,6 +589,14 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
|
|||||||
struct mmc_card *card;
|
struct mmc_card *card;
|
||||||
int err = 0, ioc_err = 0;
|
int err = 0, ioc_err = 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The caller must have CAP_SYS_RAWIO, and must be calling this on the
|
||||||
|
* whole block device, not on a partition. This prevents overspray
|
||||||
|
* between sibling partitions.
|
||||||
|
*/
|
||||||
|
if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
idata = mmc_blk_ioctl_copy_from_user(ic_ptr);
|
idata = mmc_blk_ioctl_copy_from_user(ic_ptr);
|
||||||
if (IS_ERR(idata))
|
if (IS_ERR(idata))
|
||||||
return PTR_ERR(idata);
|
return PTR_ERR(idata);
|
||||||
@@ -631,6 +639,14 @@ static int mmc_blk_ioctl_multi_cmd(struct block_device *bdev,
|
|||||||
int i, err = 0, ioc_err = 0;
|
int i, err = 0, ioc_err = 0;
|
||||||
__u64 num_of_cmds;
|
__u64 num_of_cmds;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The caller must have CAP_SYS_RAWIO, and must be calling this on the
|
||||||
|
* whole block device, not on a partition. This prevents overspray
|
||||||
|
* between sibling partitions.
|
||||||
|
*/
|
||||||
|
if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains))
|
||||||
|
return -EPERM;
|
||||||
|
|
||||||
if (copy_from_user(&num_of_cmds, &user->num_of_cmds,
|
if (copy_from_user(&num_of_cmds, &user->num_of_cmds,
|
||||||
sizeof(num_of_cmds)))
|
sizeof(num_of_cmds)))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
@@ -688,14 +704,6 @@ cmd_err:
|
|||||||
static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode,
|
static int mmc_blk_ioctl(struct block_device *bdev, fmode_t mode,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* The caller must have CAP_SYS_RAWIO, and must be calling this on the
|
|
||||||
* whole block device, not on a partition. This prevents overspray
|
|
||||||
* between sibling partitions.
|
|
||||||
*/
|
|
||||||
if ((!capable(CAP_SYS_RAWIO)) || (bdev != bdev->bd_contains))
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case MMC_IOC_CMD:
|
case MMC_IOC_CMD:
|
||||||
return mmc_blk_ioctl_cmd(bdev,
|
return mmc_blk_ioctl_cmd(bdev,
|
||||||
@@ -1362,7 +1370,7 @@ static int mmc_blk_err_check(struct mmc_card *card,
|
|||||||
|
|
||||||
if (brq->data.error) {
|
if (brq->data.error) {
|
||||||
if (need_retune && !brq->retune_retry_done) {
|
if (need_retune && !brq->retune_retry_done) {
|
||||||
pr_info("%s: retrying because a re-tune was needed\n",
|
pr_debug("%s: retrying because a re-tune was needed\n",
|
||||||
req->rq_disk->disk_name);
|
req->rq_disk->disk_name);
|
||||||
brq->retune_retry_done = 1;
|
brq->retune_retry_done = 1;
|
||||||
return MMC_BLK_RETRY;
|
return MMC_BLK_RETRY;
|
||||||
@@ -1524,13 +1532,13 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,
|
|||||||
}
|
}
|
||||||
if (rq_data_dir(req) == READ) {
|
if (rq_data_dir(req) == READ) {
|
||||||
brq->cmd.opcode = readcmd;
|
brq->cmd.opcode = readcmd;
|
||||||
brq->data.flags |= MMC_DATA_READ;
|
brq->data.flags = MMC_DATA_READ;
|
||||||
if (brq->mrq.stop)
|
if (brq->mrq.stop)
|
||||||
brq->stop.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 |
|
brq->stop.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 |
|
||||||
MMC_CMD_AC;
|
MMC_CMD_AC;
|
||||||
} else {
|
} else {
|
||||||
brq->cmd.opcode = writecmd;
|
brq->cmd.opcode = writecmd;
|
||||||
brq->data.flags |= MMC_DATA_WRITE;
|
brq->data.flags = MMC_DATA_WRITE;
|
||||||
if (brq->mrq.stop)
|
if (brq->mrq.stop)
|
||||||
brq->stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B |
|
brq->stop.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B |
|
||||||
MMC_CMD_AC;
|
MMC_CMD_AC;
|
||||||
@@ -1799,7 +1807,7 @@ static void mmc_blk_packed_hdr_wrq_prep(struct mmc_queue_req *mqrq,
|
|||||||
|
|
||||||
brq->data.blksz = 512;
|
brq->data.blksz = 512;
|
||||||
brq->data.blocks = packed->blocks + hdr_blocks;
|
brq->data.blocks = packed->blocks + hdr_blocks;
|
||||||
brq->data.flags |= MMC_DATA_WRITE;
|
brq->data.flags = MMC_DATA_WRITE;
|
||||||
|
|
||||||
brq->stop.opcode = MMC_STOP_TRANSMISSION;
|
brq->stop.opcode = MMC_STOP_TRANSMISSION;
|
||||||
brq->stop.arg = 0;
|
brq->stop.arg = 0;
|
||||||
|
|||||||
@@ -2829,6 +2829,7 @@ static int mtf_testlist_show(struct seq_file *sf, void *data)
|
|||||||
|
|
||||||
mutex_lock(&mmc_test_lock);
|
mutex_lock(&mmc_test_lock);
|
||||||
|
|
||||||
|
seq_printf(sf, "0:\tRun all tests\n");
|
||||||
for (i = 0; i < ARRAY_SIZE(mmc_test_cases); i++)
|
for (i = 0; i < ARRAY_SIZE(mmc_test_cases); i++)
|
||||||
seq_printf(sf, "%d:\t%s\n", i+1, mmc_test_cases[i].name);
|
seq_printf(sf, "%d:\t%s\n", i+1, mmc_test_cases[i].name);
|
||||||
|
|
||||||
|
|||||||
+17
-12
@@ -1033,7 +1033,7 @@ static inline void mmc_set_ios(struct mmc_host *host)
|
|||||||
"width %u timing %u\n",
|
"width %u timing %u\n",
|
||||||
mmc_hostname(host), ios->clock, ios->bus_mode,
|
mmc_hostname(host), ios->clock, ios->bus_mode,
|
||||||
ios->power_mode, ios->chip_select, ios->vdd,
|
ios->power_mode, ios->chip_select, ios->vdd,
|
||||||
ios->bus_width, ios->timing);
|
1 << ios->bus_width, ios->timing);
|
||||||
|
|
||||||
host->ops->set_ios(host, ios);
|
host->ops->set_ios(host, ios);
|
||||||
}
|
}
|
||||||
@@ -1079,7 +1079,8 @@ int mmc_execute_tuning(struct mmc_card *card)
|
|||||||
err = host->ops->execute_tuning(host, opcode);
|
err = host->ops->execute_tuning(host, opcode);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
pr_err("%s: tuning execution failed\n", mmc_hostname(host));
|
pr_err("%s: tuning execution failed: %d\n",
|
||||||
|
mmc_hostname(host), err);
|
||||||
else
|
else
|
||||||
mmc_retune_enable(host);
|
mmc_retune_enable(host);
|
||||||
|
|
||||||
@@ -1204,8 +1205,9 @@ EXPORT_SYMBOL(mmc_vddrange_to_ocrmask);
|
|||||||
* @np: The device node need to be parsed.
|
* @np: The device node need to be parsed.
|
||||||
* @mask: mask of voltages available for MMC/SD/SDIO
|
* @mask: mask of voltages available for MMC/SD/SDIO
|
||||||
*
|
*
|
||||||
* 1. Return zero on success.
|
* Parse the "voltage-ranges" DT property, returning zero if it is not
|
||||||
* 2. Return negative errno: voltage-range is invalid.
|
* found, negative errno if the voltage-range specification is invalid,
|
||||||
|
* or one if the voltage-range is specified and successfully parsed.
|
||||||
*/
|
*/
|
||||||
int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
|
int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
|
||||||
{
|
{
|
||||||
@@ -1214,8 +1216,12 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
|
|||||||
|
|
||||||
voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
|
voltage_ranges = of_get_property(np, "voltage-ranges", &num_ranges);
|
||||||
num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
|
num_ranges = num_ranges / sizeof(*voltage_ranges) / 2;
|
||||||
if (!voltage_ranges || !num_ranges) {
|
if (!voltage_ranges) {
|
||||||
pr_info("%s: voltage-ranges unspecified\n", np->full_name);
|
pr_debug("%s: voltage-ranges unspecified\n", np->full_name);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (!num_ranges) {
|
||||||
|
pr_err("%s: voltage-ranges empty\n", np->full_name);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1234,7 +1240,7 @@ int mmc_of_parse_voltage(struct device_node *np, u32 *mask)
|
|||||||
*mask |= ocr_mask;
|
*mask |= ocr_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(mmc_of_parse_voltage);
|
EXPORT_SYMBOL(mmc_of_parse_voltage);
|
||||||
|
|
||||||
@@ -2532,7 +2538,7 @@ int mmc_detect_card_removed(struct mmc_host *host)
|
|||||||
if (!card)
|
if (!card)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (host->caps & MMC_CAP_NONREMOVABLE)
|
if (!mmc_card_is_removable(host))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
ret = mmc_card_removed(card);
|
ret = mmc_card_removed(card);
|
||||||
@@ -2570,7 +2576,7 @@ void mmc_rescan(struct work_struct *work)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* If there is a non-removable card registered, only scan once */
|
/* If there is a non-removable card registered, only scan once */
|
||||||
if ((host->caps & MMC_CAP_NONREMOVABLE) && host->rescan_entered)
|
if (!mmc_card_is_removable(host) && host->rescan_entered)
|
||||||
return;
|
return;
|
||||||
host->rescan_entered = 1;
|
host->rescan_entered = 1;
|
||||||
|
|
||||||
@@ -2587,8 +2593,7 @@ void mmc_rescan(struct work_struct *work)
|
|||||||
* if there is a _removable_ card registered, check whether it is
|
* if there is a _removable_ card registered, check whether it is
|
||||||
* still present
|
* still present
|
||||||
*/
|
*/
|
||||||
if (host->bus_ops && !host->bus_dead
|
if (host->bus_ops && !host->bus_dead && mmc_card_is_removable(host))
|
||||||
&& !(host->caps & MMC_CAP_NONREMOVABLE))
|
|
||||||
host->bus_ops->detect(host);
|
host->bus_ops->detect(host);
|
||||||
|
|
||||||
host->detect_change = 0;
|
host->detect_change = 0;
|
||||||
@@ -2613,7 +2618,7 @@ void mmc_rescan(struct work_struct *work)
|
|||||||
mmc_bus_put(host);
|
mmc_bus_put(host);
|
||||||
|
|
||||||
mmc_claim_host(host);
|
mmc_claim_host(host);
|
||||||
if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd &&
|
if (mmc_card_is_removable(host) && host->ops->get_cd &&
|
||||||
host->ops->get_cd(host) == 0) {
|
host->ops->get_cd(host) == 0) {
|
||||||
mmc_power_off(host);
|
mmc_power_off(host);
|
||||||
mmc_release_host(host);
|
mmc_release_host(host);
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ static int mmc_clock_opt_set(void *data, u64 val)
|
|||||||
struct mmc_host *host = data;
|
struct mmc_host *host = data;
|
||||||
|
|
||||||
/* We need this check due to input value is u64 */
|
/* We need this check due to input value is u64 */
|
||||||
if (val > host->f_max)
|
if (val != 0 && (val > host->f_max || val < host->f_min))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
mmc_claim_host(host);
|
mmc_claim_host(host);
|
||||||
|
|||||||
@@ -339,6 +339,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
|
|||||||
host->class_dev.parent = dev;
|
host->class_dev.parent = dev;
|
||||||
host->class_dev.class = &mmc_host_class;
|
host->class_dev.class = &mmc_host_class;
|
||||||
device_initialize(&host->class_dev);
|
device_initialize(&host->class_dev);
|
||||||
|
device_enable_async_suspend(&host->class_dev);
|
||||||
|
|
||||||
if (mmc_gpio_alloc(host)) {
|
if (mmc_gpio_alloc(host)) {
|
||||||
put_device(&host->class_dev);
|
put_device(&host->class_dev);
|
||||||
|
|||||||
@@ -501,7 +501,7 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
|
|||||||
card->ext_csd.raw_bkops_status =
|
card->ext_csd.raw_bkops_status =
|
||||||
ext_csd[EXT_CSD_BKOPS_STATUS];
|
ext_csd[EXT_CSD_BKOPS_STATUS];
|
||||||
if (!card->ext_csd.man_bkops_en)
|
if (!card->ext_csd.man_bkops_en)
|
||||||
pr_info("%s: MAN_BKOPS_EN bit is not set\n",
|
pr_debug("%s: MAN_BKOPS_EN bit is not set\n",
|
||||||
mmc_hostname(card->host));
|
mmc_hostname(card->host));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -945,7 +945,7 @@ static int mmc_select_bus_width(struct mmc_card *card)
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
pr_warn("%s: switch to bus width %d failed\n",
|
pr_warn("%s: switch to bus width %d failed\n",
|
||||||
mmc_hostname(host), ext_csd_bits[idx]);
|
mmc_hostname(host), 1 << bus_width);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,6 @@ int mmc_send_status(struct mmc_card *card, u32 *status)
|
|||||||
|
|
||||||
static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card)
|
static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card)
|
||||||
{
|
{
|
||||||
int err;
|
|
||||||
struct mmc_command cmd = {0};
|
struct mmc_command cmd = {0};
|
||||||
|
|
||||||
BUG_ON(!host);
|
BUG_ON(!host);
|
||||||
@@ -105,11 +104,7 @@ static int _mmc_select_card(struct mmc_host *host, struct mmc_card *card)
|
|||||||
cmd.flags = MMC_RSP_NONE | MMC_CMD_AC;
|
cmd.flags = MMC_RSP_NONE | MMC_CMD_AC;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
|
return mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mmc_select_card(struct mmc_card *card)
|
int mmc_select_card(struct mmc_card *card)
|
||||||
@@ -244,7 +239,6 @@ int mmc_all_send_cid(struct mmc_host *host, u32 *cid)
|
|||||||
|
|
||||||
int mmc_set_relative_addr(struct mmc_card *card)
|
int mmc_set_relative_addr(struct mmc_card *card)
|
||||||
{
|
{
|
||||||
int err;
|
|
||||||
struct mmc_command cmd = {0};
|
struct mmc_command cmd = {0};
|
||||||
|
|
||||||
BUG_ON(!card);
|
BUG_ON(!card);
|
||||||
@@ -254,11 +248,7 @@ int mmc_set_relative_addr(struct mmc_card *card)
|
|||||||
cmd.arg = card->rca << 16;
|
cmd.arg = card->rca << 16;
|
||||||
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
|
cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
|
||||||
|
|
||||||
err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
|
return mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -743,7 +733,7 @@ mmc_send_bus_test(struct mmc_card *card, struct mmc_host *host, u8 opcode,
|
|||||||
|
|
||||||
int mmc_bus_test(struct mmc_card *card, u8 bus_width)
|
int mmc_bus_test(struct mmc_card *card, u8 bus_width)
|
||||||
{
|
{
|
||||||
int err, width;
|
int width;
|
||||||
|
|
||||||
if (bus_width == MMC_BUS_WIDTH_8)
|
if (bus_width == MMC_BUS_WIDTH_8)
|
||||||
width = 8;
|
width = 8;
|
||||||
@@ -759,8 +749,7 @@ int mmc_bus_test(struct mmc_card *card, u8 bus_width)
|
|||||||
* is a problem. This improves chances that the test will work.
|
* is a problem. This improves chances that the test will work.
|
||||||
*/
|
*/
|
||||||
mmc_send_bus_test(card, card->host, MMC_BUS_TEST_W, width);
|
mmc_send_bus_test(card, card->host, MMC_BUS_TEST_W, width);
|
||||||
err = mmc_send_bus_test(card, card->host, MMC_BUS_TEST_R, width);
|
return mmc_send_bus_test(card, card->host, MMC_BUS_TEST_R, width);
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
|
int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status)
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/of_gpio.h>
|
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
|
|
||||||
#include <linux/mmc/host.h>
|
#include <linux/mmc/host.h>
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ void mmc_decode_cid(struct mmc_card *card)
|
|||||||
{
|
{
|
||||||
u32 *resp = card->raw_cid;
|
u32 *resp = card->raw_cid;
|
||||||
|
|
||||||
memset(&card->cid, 0, sizeof(struct mmc_cid));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SD doesn't currently have a version field so we will
|
* SD doesn't currently have a version field so we will
|
||||||
* have to assume we can parse this.
|
* have to assume we can parse this.
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ EXPORT_SYMBOL(mmc_wait_for_app_cmd);
|
|||||||
|
|
||||||
int mmc_app_set_bus_width(struct mmc_card *card, int width)
|
int mmc_app_set_bus_width(struct mmc_card *card, int width)
|
||||||
{
|
{
|
||||||
int err;
|
|
||||||
struct mmc_command cmd = {0};
|
struct mmc_command cmd = {0};
|
||||||
|
|
||||||
BUG_ON(!card);
|
BUG_ON(!card);
|
||||||
@@ -140,11 +139,7 @@ int mmc_app_set_bus_width(struct mmc_card *card, int width)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
err = mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES);
|
return mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES);
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
|
int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
|
||||||
|
|||||||
@@ -106,8 +106,6 @@ static int sdio_read_cccr(struct mmc_card *card, u32 ocr)
|
|||||||
unsigned char data;
|
unsigned char data;
|
||||||
unsigned char speed;
|
unsigned char speed;
|
||||||
|
|
||||||
memset(&card->cccr, 0, sizeof(struct sdio_cccr));
|
|
||||||
|
|
||||||
ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_CCCR, 0, &data);
|
ret = mmc_io_rw_direct(card, 0, 0, SDIO_CCCR_CCCR, 0, &data);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
@@ -217,7 +217,6 @@ int sdio_reset(struct mmc_host *host)
|
|||||||
else
|
else
|
||||||
abort |= 0x08;
|
abort |= 0x08;
|
||||||
|
|
||||||
ret = mmc_io_rw_direct_host(host, 1, 0, SDIO_CCCR_ABORT, abort, NULL);
|
return mmc_io_rw_direct_host(host, 1, 0, SDIO_CCCR_ABORT, abort, NULL);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -318,15 +318,15 @@ config MMC_SDHCI_F_SDH30
|
|||||||
If unsure, say N.
|
If unsure, say N.
|
||||||
|
|
||||||
config MMC_SDHCI_IPROC
|
config MMC_SDHCI_IPROC
|
||||||
tristate "SDHCI platform support for the iProc SD/MMC Controller"
|
tristate "SDHCI support for the BCM2835 & iProc SD/MMC Controller"
|
||||||
depends on ARCH_BCM_IPROC || COMPILE_TEST
|
depends on ARCH_BCM2835 || ARCH_BCM_IPROC || COMPILE_TEST
|
||||||
depends on MMC_SDHCI_PLTFM
|
depends on MMC_SDHCI_PLTFM
|
||||||
default ARCH_BCM_IPROC
|
default ARCH_BCM_IPROC
|
||||||
select MMC_SDHCI_IO_ACCESSORS
|
select MMC_SDHCI_IO_ACCESSORS
|
||||||
help
|
help
|
||||||
This selects the iProc SD/MMC controller.
|
This selects the iProc SD/MMC controller.
|
||||||
|
|
||||||
If you have an IPROC platform with SD or MMC devices,
|
If you have a BCM2835 or IPROC platform with SD or MMC devices,
|
||||||
say Y or M here.
|
say Y or M here.
|
||||||
|
|
||||||
If unsure, say N.
|
If unsure, say N.
|
||||||
@@ -560,8 +560,8 @@ config MMC_TMIO
|
|||||||
|
|
||||||
config MMC_SDHI
|
config MMC_SDHI
|
||||||
tristate "SH-Mobile SDHI SD/SDIO controller support"
|
tristate "SH-Mobile SDHI SD/SDIO controller support"
|
||||||
depends on SUPERH || ARM
|
depends on SUPERH || ARM || ARM64
|
||||||
depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
|
depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
|
||||||
select MMC_TMIO_CORE
|
select MMC_TMIO_CORE
|
||||||
help
|
help
|
||||||
This provides support for the SDHI SD/SDIO controller found in
|
This provides support for the SDHI SD/SDIO controller found in
|
||||||
@@ -673,8 +673,8 @@ config MMC_DW_ROCKCHIP
|
|||||||
|
|
||||||
config MMC_SH_MMCIF
|
config MMC_SH_MMCIF
|
||||||
tristate "SuperH Internal MMCIF support"
|
tristate "SuperH Internal MMCIF support"
|
||||||
depends on MMC_BLOCK && HAS_DMA
|
depends on HAS_DMA
|
||||||
depends on SUPERH || ARCH_SHMOBILE || COMPILE_TEST
|
depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
|
||||||
help
|
help
|
||||||
This selects the MMC Host Interface controller (MMCIF).
|
This selects the MMC Host Interface controller (MMCIF).
|
||||||
|
|
||||||
@@ -786,3 +786,14 @@ config MMC_MTK
|
|||||||
If you have a machine with a integrated SD/MMC card reader, say Y or M here.
|
If you have a machine with a integrated SD/MMC card reader, say Y or M here.
|
||||||
This is needed if support for any SD/SDIO/MMC devices is required.
|
This is needed if support for any SD/SDIO/MMC devices is required.
|
||||||
If unsure, say N.
|
If unsure, say N.
|
||||||
|
|
||||||
|
config MMC_SDHCI_MICROCHIP_PIC32
|
||||||
|
tristate "Microchip PIC32MZDA SDHCI support"
|
||||||
|
depends on MMC_SDHCI && PIC32MZDA && MMC_SDHCI_PLTFM
|
||||||
|
help
|
||||||
|
This selects the Secure Digital Host Controller Interface (SDHCI)
|
||||||
|
for PIC32MZDA platform.
|
||||||
|
|
||||||
|
If you have a controller with this interface, say Y or M here.
|
||||||
|
|
||||||
|
If unsure, say N.
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ obj-$(CONFIG_MMC_SDHCI_BCM2835) += sdhci-bcm2835.o
|
|||||||
obj-$(CONFIG_MMC_SDHCI_IPROC) += sdhci-iproc.o
|
obj-$(CONFIG_MMC_SDHCI_IPROC) += sdhci-iproc.o
|
||||||
obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o
|
obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o
|
||||||
obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o
|
obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o
|
||||||
|
obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o
|
||||||
|
|
||||||
ifeq ($(CONFIG_CB710_DEBUG),y)
|
ifeq ($(CONFIG_CB710_DEBUG),y)
|
||||||
CFLAGS-cb710-mmc += -DDEBUG
|
CFLAGS-cb710-mmc += -DDEBUG
|
||||||
|
|||||||
@@ -848,9 +848,7 @@ static u32 atmci_prepare_command(struct mmc_host *mmc,
|
|||||||
if (cmd->opcode == SD_IO_RW_EXTENDED) {
|
if (cmd->opcode == SD_IO_RW_EXTENDED) {
|
||||||
cmdr |= ATMCI_CMDR_SDIO_BLOCK;
|
cmdr |= ATMCI_CMDR_SDIO_BLOCK;
|
||||||
} else {
|
} else {
|
||||||
if (data->flags & MMC_DATA_STREAM)
|
if (data->blocks > 1)
|
||||||
cmdr |= ATMCI_CMDR_STREAM;
|
|
||||||
else if (data->blocks > 1)
|
|
||||||
cmdr |= ATMCI_CMDR_MULTI_BLOCK;
|
cmdr |= ATMCI_CMDR_MULTI_BLOCK;
|
||||||
else
|
else
|
||||||
cmdr |= ATMCI_CMDR_BLOCK;
|
cmdr |= ATMCI_CMDR_BLOCK;
|
||||||
@@ -1371,9 +1369,6 @@ static void atmci_start_request(struct atmel_mci *host,
|
|||||||
host->stop_cmdr |= ATMCI_CMDR_STOP_XFER;
|
host->stop_cmdr |= ATMCI_CMDR_STOP_XFER;
|
||||||
if (!(data->flags & MMC_DATA_WRITE))
|
if (!(data->flags & MMC_DATA_WRITE))
|
||||||
host->stop_cmdr |= ATMCI_CMDR_TRDIR_READ;
|
host->stop_cmdr |= ATMCI_CMDR_TRDIR_READ;
|
||||||
if (data->flags & MMC_DATA_STREAM)
|
|
||||||
host->stop_cmdr |= ATMCI_CMDR_STREAM;
|
|
||||||
else
|
|
||||||
host->stop_cmdr |= ATMCI_CMDR_MULTI_BLOCK;
|
host->stop_cmdr |= ATMCI_CMDR_MULTI_BLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2443,7 +2438,7 @@ static int atmci_configure_dma(struct atmel_mci *host)
|
|||||||
struct mci_platform_data *pdata = host->pdev->dev.platform_data;
|
struct mci_platform_data *pdata = host->pdev->dev.platform_data;
|
||||||
dma_cap_mask_t mask;
|
dma_cap_mask_t mask;
|
||||||
|
|
||||||
if (!pdata->dma_filter)
|
if (!pdata || !pdata->dma_filter)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
dma_cap_zero(mask);
|
dma_cap_zero(mask);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user