diff options
| author | Shawn Lin <shawn.lin@rock-chips.com> | 2025-11-04 16:41:53 +0800 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2025-11-11 17:59:17 +0100 |
| commit | 5f87aaf5b62e30539dae41371f15730db549bc9b (patch) | |
| tree | e66a1d893bdd067744cac38e89f0637711bb160d | |
| parent | fda1e0af7c28f96d4f33e57cf51565b0e9c14e63 (diff) | |
mmc: core: Allow more host caps to be modified through debugfs
This makes various signal and function tests more convenient
without the need to modify the DTB.
/sys/kernel/debug/mmc0# echo $(($(cat caps) | (1 << 7))) > caps
/sys/kernel/debug/mmc0# echo on > /sys/bus/mmc/devices/mmc0\:0001/power/control
/sys/kernel/debug/mmc0# echo auto > /sys/bus/mmc/devices/mmc0\:0001/power/control
// Disable 8-bit support
echo $(($(cat caps) & ~(1 << 6))) > caps
// Enable 8-bit support
echo $(($(cat caps) | (1 << 6))) > caps
// Disable 4-bit support
echo $(($(cat caps) & ~(1 << 0))) > caps
// Enable 4-bit support
echo $(($(cat caps) | (1 << 0))) > caps
// Disable CMD23 support
echo $(($(cat caps) & ~(1 << 30))) > caps
// Enable CMD23 support
echo $(($(cat caps) | (1 << 30))) > caps
// Disable CMD23 support
echo $(($(cat caps) & ~(1 << 30))) > caps
// Enable CMD23 support
echo $(($(cat caps) | (1 << 30))) > caps
// Disable CQE support
echo $(($(cat caps2) & ~(1 << 23))) > caps2
// Enable CQE support
echo $(($(cat caps2) | (1 << 23))) > caps2
// Disable CQE DCMD support
echo $(($(cat caps2) & ~(1 << 24))) > caps2
// Enable CQE DCMD support
echo $(($(cat caps2) | (1 << 24))) > caps2
/sys/kernel/debug/mmc0# echo on > /sys/bus/mmc/devices/mmc0\:0001/power/control
/sys/kernel/debug/mmc0# cat ios
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
| -rw-r--r-- | drivers/mmc/core/debugfs.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index f10a4dcf1f95..91ea00a0f61d 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c @@ -315,7 +315,10 @@ static int mmc_caps_set(void *data, u64 val) MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED | MMC_CAP_UHS | - MMC_CAP_DDR; + MMC_CAP_DDR | + MMC_CAP_4_BIT_DATA | + MMC_CAP_8_BIT_DATA | + MMC_CAP_CMD23; if (diff & ~allowed) return -EINVAL; @@ -327,7 +330,10 @@ static int mmc_caps_set(void *data, u64 val) static int mmc_caps2_set(void *data, u64 val) { - u32 allowed = MMC_CAP2_HSX00_1_8V | MMC_CAP2_HSX00_1_2V; + u32 allowed = MMC_CAP2_HSX00_1_8V | + MMC_CAP2_HSX00_1_2V | + MMC_CAP2_CQE | + MMC_CAP2_CQE_DCMD; u32 *caps = data; u32 diff = *caps ^ val; |
