[PATCH] mmc: Prevent 1.8V switch for SD hosts that don't support UHS modes.

2012-03-16 Thread Al Cooper
and SDR25 in the host capabilities data structure for all V3.0 host controllers, only set them if SDR104, SDR50 or DDR50 is set in the host capabilities register. This will prevent the switch to 1.8V later. Signed-off-by: Al Cooper acoo...@gmail.com --- drivers/mmc/host/sdhci.c |5 +++-- 1

[PATCH] mmc: Limit MMC speed to 25MHz if HIGHSPEED CAPS bit is not set.

2012-05-14 Thread Al Cooper
If the HIGHSPEED capabilities bit is not set, limit the MMC clock speed to 25MHz. Signed-off-by: Al Cooper acoo...@gmail.com --- drivers/mmc/core/mmc.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 54df5ad..912c893

[PATCH] mmc: SD tuning is broken for some controllers

2014-05-09 Thread Al Cooper
not be as simple as snapping the time at the loop start and checking for 150ms to pass because the loop queues the CMD19's and uses events to wait for completion so the time would include all the normal scheduler latencies. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/host/sdhci.c | 24

[PATCH 2/7] mmc: lock: Add low level LOCK_UNLOCK command

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com Add support for the LOCK_UNLOCK command. This command can lock, unlock, set password, clear password and force erase SD and MMC cards. refs #SWLINUX-2545 Signed-off-by: Al Cooper acoo...@broadcom.com --- drivers/mmc/core/mmc_ops.c | 112

[PATCH 3/7] mmc: lock: Add funtion to unlock a password locked card

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com This function will try to get a password for the card and use the password to unlock it. It will leave the card state flag set appropriately. refs #SWLINUX-2545 Signed-off-by: Al Cooper acoo...@broadcom.com --- drivers/mmc/core/core.c | 28

[PATCH 4/7] mmc: lock: Add card lock/unlock maintenance commands

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com Create a sysfs interface that allows a user to manage an inserted cards lock state. The sysfs attribute lock will be added to the device's sysfs directory. The following commands are supported: setpw - Set the cards password clearpw - Clear the cards

[PATCH 6/7] mmc: lock: Prevent partition table read for locked cards.

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com Change the MMC block layer to avoid reading the partition table when the card is locked because read commands will fail. refs #SWLINUX-2545 Signed-off-by: Al Cooper acoo...@broadcom.com --- drivers/mmc/card/block.c | 7 +++ 1 file changed, 7 insertions

[PATCH 7/7] mmc: lock: Change MMC init to handle locked cards.

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com - Change mmc_init_card() to check for a locked card and, if found, try to get a password using the kernel KEYS subsystem, unlock the card and continue. Unlike SD cards, MMC cards support all initialization commands when locked so the init sequence can

[PATCH 5/7] mmc: lock: Change SD init functionality to handle locked SD cards

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com - Change mmc_sd_init_card() to check for a locked card and, if found, try to get a password using the kernel KEYS subsystem, unlock the card and continue. The unlock can fail due to a bad password, no password or during boot when the rootfs that holds

[PATCH 0/7] Add password protected lock/unlock support for SD/MMC

2013-08-13 Thread Al Cooper
, unlock, assign a password, clear a password and force erase a card. The unlock_retry attribute is used to retry an unlock that failed during boot because the rootfs was not yet available with the password. Al Cooper (7): mmc: lock: Use the kernel KEYS subsystem to get a card's password mmc: lock

[PATCH 1/7] mmc: lock: Use the kernel KEYS subsystem to get a card's password

2013-08-13 Thread Al Cooper
From: Al Cooper acoo...@broadcom.com Use the kernel KEYS subsystem to get a password for a card based on the card's CID. This code was based on a patch set submitted by Anderson Briglia in 2006. refs #SWLINUX-2545 Signed-off-by: Al Cooper acoo...@broadcom.com --- drivers/mmc/core/Kconfig | 8

[PATCH V2 4/7] mmc: lock: Add card lock/unlock maintenance commands

2013-08-30 Thread Al Cooper
- Unlock the card erase - Force erase the card, clear the password and unlock it Commands that require a password will request the password through the kernels KEYS subsystem. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c | 81

[PATCH V2 2/7] mmc: lock: Add low level LOCK_UNLOCK command

2013-08-30 Thread Al Cooper
Add support for the LOCK_UNLOCK command. This command can lock, unlock, set password, clear password and force erase SD and MMC cards. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc_ops.c | 112 + drivers/mmc/core/mmc_ops.h | 13

[PATCH V2 1/7] mmc: lock: Use the kernel KEYS subsystem to get a card's password

2013-08-30 Thread Al Cooper
Use the kernel KEYS subsystem to get a password for a card based on the card's CID. This code was based on a patch set submitted by Anderson Briglia in 2006. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/Kconfig | 8 drivers/mmc/core/core.c | 105

[PATCH V2 7/7] mmc: lock: Change MMC init to handle locked cards.

2013-08-30 Thread Al Cooper
state will be cleared and the block layer restarted which will now read the partition table. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c | 46 -- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core

[PATCH V2 0/7] Add password protected lock/unlock support for SD/MMC

2013-08-30 Thread Al Cooper
functions to reduce the number of CONFIG ifdefs. - Add static to a few functions that were local. - Use pr_warn instead of pr_warning. - Improve a few variable names and messages. Al Cooper (7): mmc: lock: Use the kernel KEYS subsystem to get a card's password mmc: lock: Add low level

[PATCH V2 3/7] mmc: lock: Add function to unlock a password locked card

2013-08-30 Thread Al Cooper
This function will try to get a password for the card and use the password to unlock it. It will leave the card state flag set appropriately. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/core.c | 26 ++ 1 file changed, 26 insertions(+) diff --git

[PATCH V2 5/7] mmc: lock: Change SD init functionality to handle locked SD cards

2013-08-30 Thread Al Cooper
commands or to trigger a retry, presumably after the password has be made available by user space. - Add sysfs attribute unlock_retry that will try again to unlock and fully init the card. - Add sysfs attribute lock to enable sysfs LOCK maintenance commands Signed-off-by: Al Cooper alcoop

[PATCH V2 6/7] mmc: lock: Prevent partition table read for locked cards.

2013-08-30 Thread Al Cooper
Change the MMC block layer to avoid reading the partition table when the card is locked because read commands will fail. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/card/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/card/block.c b/drivers/mmc

[PATCH V3 0/7] Add password protected lock/unlock support for SD/MMC

2014-03-05 Thread Al Cooper
the rootfs was not yet available to setup the keys password. The unlock_retry attribute is a NOP for unlocked cards, so user space init processing can write a 1 to all instances found in the sysfs once the rootfs with keyutils functionality is available. Al Cooper (7): mmc: lock: Use the kernel

[PATCH V3 5/7] mmc: lock: Change SD init functionality to handle locked SD cards

2014-03-05 Thread Al Cooper
commands or to trigger a retry, presumably after the password has be made available by user space. - Add sysfs attribute unlock_retry that will try again to unlock and fully init the card. - Add sysfs attribute lock to enable sysfs LOCK maintenance commands Signed-off-by: Al Cooper alcoop

[PATCH V3 6/7] mmc: lock: Prevent block device from coming up for locked cards.

2014-03-05 Thread Al Cooper
A locked card will return an error for all reads/writes to the block device, so prevent the block layer from coming up until the card is unlocked. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/card/block.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/mmc

[PATCH V3 7/7] mmc: lock: Change MMC init to handle locked cards.

2014-03-05 Thread Al Cooper
will be cleared and the block layer will be allowed to come up. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c | 46 -- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index

[PATCH V3 2/7] mmc: lock: Add low level LOCK_UNLOCK command

2014-03-05 Thread Al Cooper
Add support for the LOCK_UNLOCK command. This command can lock, unlock, set password, clear password and force erase SD and MMC cards. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc_ops.c | 109 + drivers/mmc/core/mmc_ops.h | 13

[PATCH V3 1/7] mmc: lock: Use the kernel KEYS subsystem to get a card's password

2014-03-05 Thread Al Cooper
Use the kernel KEYS subsystem to get a password for a card based on the card's CID. This code was based on a patch set submitted by Anderson Briglia in 2006. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/Kconfig | 8 drivers/mmc/core/core.c | 105

[PATCH V3 4/7] mmc: lock: Add card lock/unlock maintenance commands

2014-03-05 Thread Al Cooper
- Unlock the card erase - Force erase the card, clear the password and unlock it Commands that require a password will request the password through the kernels KEYS subsystem. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c | 81

[PATCH] mmc: Limit MMC speed to 52MHz if not HS200

2012-11-15 Thread Al Cooper
on BASE_CLK_FREQ in the host CAPS register). This means that a host controller that doesn't support HS200 mode but has a base clock of 100MHz and an eMMC module that supports HS200 speeds will end up using a 100MHz clock. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c |2 ++ 1

[RESEND PATCH] mmc: Limit MMC speed to 52MHz if not HS200

2012-11-30 Thread Al Cooper
on BASE_CLK_FREQ in the host CAPS register). This means that a host controller that doesn't support HS200 mode but has a base clock of 100MHz and an eMMC module that supports HS200 speeds will end up using a 100MHz clock. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c |2 ++ 1

[PATCH] mmc: Allow sdhci platform drivers to set quirks2 from platform data

2013-04-30 Thread Al Cooper
Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/host/sdhci-pltfm.c |4 +++- drivers/mmc/host/sdhci-pltfm.h |1 + 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 3145a78..e605509 100644

[PATCH] mmc: mkfs takes hours on some combinations of eMMC device and host controller

2015-02-25 Thread Al Cooper
before converting to write blocks. This allow mkfs.ext4 to run in 30 secs instead of 10 hours. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index

[PATCH V3 4/8] mmc: lock: Add card lock/unlock maintenance commands

2015-06-05 Thread Al Cooper
- Unlock the card erase - Force erase the card, clear the password and unlock it Commands that require a password will request the password through the kernels KEYS subsystem. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c | 81

[PATCH V3 5/8] mmc: lock: Change SD init functionality to handle locked SD cards

2015-06-05 Thread Al Cooper
commands or to trigger a retry, presumably after the password has be made available by user space. - Add sysfs attribute unlock_retry that will try again to unlock and fully init the card. - Add sysfs attribute lock to enable sysfs LOCK maintenance commands Signed-off-by: Al Cooper alcoop

[PATCH V3 0/8 RESEND] Add password protected lock/unlock support for SD/MMC

2015-06-05 Thread Al Cooper
, CMD16 and lock card command class. Thus, the host is allowed to reset, initialize, select, query for status, etc., but not to access data on the card. Al Cooper (7): mmc: lock: Use the kernel KEYS subsystem to get a card's password mmc: lock: Add low level LOCK_UNLOCK command mmc: lock

[PATCH V3 6/8] mmc: lock: Prevent partition table read for locked cards.

2015-06-05 Thread Al Cooper
Change the MMC block layer to avoid reading the partition table when the card is locked because read commands will fail. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/card/block.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/card/block.c b/drivers/mmc

[PATCH V3 2/8] mmc: lock: Add low level LOCK_UNLOCK command

2015-06-05 Thread Al Cooper
Add support for the LOCK_UNLOCK command. This command can lock, unlock, set password, clear password and force erase SD and MMC cards. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/core.c| 5 +- drivers/mmc/core/mmc_ops.c | 150

[PATCH V3 7/8] mmc: lock: Change MMC init to handle locked cards.

2015-06-05 Thread Al Cooper
state will be cleared and the block layer restarted which will now read the partition table. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/mmc.c | 46 -- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core

[PATCH V3 3/8] mmc: lock: Add function to unlock a password locked card

2015-06-05 Thread Al Cooper
This function will try to get a password for the card and use the password to unlock it. It will leave the card state flag set appropriately. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/core.c | 26 ++ 1 file changed, 26 insertions(+) diff --git

[PATCH V3 1/8] mmc: lock: Use the kernel KEYS subsystem to get a card's password

2015-06-05 Thread Al Cooper
Use the kernel KEYS subsystem to get a password for a card based on the card's CID. This code was based on a patch set submitted by Anderson Briglia in 2006. Signed-off-by: Al Cooper alcoop...@gmail.com --- drivers/mmc/core/Kconfig | 8 drivers/mmc/core/core.c | 97

[PATCH V3 8/8] According to SD Physical Layer Specifications: Locked cards respond to (and execute) all commands in the basic command class (class 0), ACMD41, CMD16 and lock card command class. Th

2015-06-05 Thread Al Cooper
operations if the card is locked. One can unlock the card after system boot by following below steps 1) Add key for this card. 2) Unlock the card using sysfs attribute 'unlock_retry' for this card. Cc: Al Cooper alcoop...@gmail.com Cc: Chris Ball c...@laptop.org Signed-off-by: Abbas Raza abbas_r

[PATCH 4/4] mmc: sdhci-brcmstb: Add sdhci driver for Broadcom BRCMSTB/BMIPS SOCs

2015-11-05 Thread Al Cooper
Signed-off-by: Al Cooper <alcoop...@gmail.com> --- .../devicetree/bindings/mmc/sdhci-brcmstb.txt | 16 +++ drivers/mmc/host/Kconfig | 12 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-brcmstb.c

[PATCH 1/4] mmc: Add quirk to disable SDR50 mode

2015-11-05 Thread Al Cooper
Add quirk to disable SDR50 mode for controllers/boards that have problems with this mode. Signed-off-by: Al Cooper <alcoop...@gmail.com> --- drivers/mmc/host/sdhci.c | 3 +++ drivers/mmc/host/sdhci.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drive

[PATCH 3/4] mmc: Add Device Tree binding supported by sdhci-pltfm.c

2015-11-05 Thread Al Cooper
This includes both newly added and previously undocumented properties. Signed-off-by: Al Cooper <alcoop...@gmail.com> --- Documentation/devicetree/bindings/mmc/mmc.txt | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documen

[PATCH 2/4] mmc: sdhci-pltfm: Add DT properties to set various QUIRKS

2015-11-05 Thread Al Cooper
t of the driver and into the Device Tree node. Signed-off-by: Al Cooper <alcoop...@gmail.com> --- drivers/mmc/host/sdhci-pltfm.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 87fb5ea..81eb4

[PATCH V2 0/3] Add SDHCI driver for Broadcom BRCMSTB/BMIPS Soc's

2015-11-06 Thread Al Cooper
- Don't create a new QUIRK to handle broken SDR50 mode in the controller. The functionality was moved into the sdhci-brcmstb driver. Al Cooper (3): mmc: sdhci-pltfm: Add DT properties to set various QUIRKS mmc: Add Device Tree binding supported by sdhci-pltfm.c mmc: sdhci-brcmstb: Add

[PATCH V2 1/3] mmc: sdhci-pltfm: Add DT properties to set various QUIRKS

2015-11-06 Thread Al Cooper
the Device Tree node. Signed-off-by: Al Cooper <alcoop...@gmail.com> --- drivers/mmc/host/sdhci-pltfm.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 87fb5ea..cc0730c 100644 --- a/drivers/mmc/

[PATCH V2 3/3] mmc: sdhci-brcmstb: Add sdhci driver for Broadcom BRCMSTB/BMIPS SOCs

2015-11-06 Thread Al Cooper
Signed-off-by: Al Cooper <alcoop...@gmail.com> --- .../devicetree/bindings/mmc/sdhci-brcmstb.txt | 36 + drivers/mmc/host/Kconfig | 12 ++ drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-brcmstb.c

[PATCH V2 2/3] mmc: Add Device Tree binding supported by sdhci-pltfm.c

2015-11-06 Thread Al Cooper
This includes both newly added and previously undocumented properties. Signed-off-by: Al Cooper <alcoop...@gmail.com> --- Documentation/devicetree/bindings/mmc/mmc.txt | 8 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documen