- 30 Mar, 2021 5 commits
-
-
Lars Pedersen authored
This patch adds support to enable auto(AUTO_EN) and manual(MANUAL_EN) in BKOPS_EN register. Auto bkops can only be used on eMMC 5.0 or newer. Signed-off-by: Lars Pedersen <lapeddk@gmail.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Link: https://lore.kernel.org/r/20191111110051.16490-1-lapeddk@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Julius Werner authored
This patch updates 'mmc writeprotect boot set' with a few more optional parameters, so that it can be used to enable permanent write-protection and so that the two boot partitions can be protected independently. It also splits protection information output by 'mmc writeprotect boot get' by partition. (Note: eMMC boot partitions are named "Area 1" and "Area 2" by the eMMC spec, but mmcblk0boot0 and mmcblk0boot1 by Linux. To avoid confusion between the two numbering schemes, this patch uses 0 and 1 throughout, even when defining EXT_CSD register bits.) Signed-off-by: Julius Werner <jwerner@chromium.org> Link: https://lore.kernel.org/r/20200316202221.107714-1-jwerner@chromium.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Patrick Oppenlander authored
JESD84-B51 7.4.30 CACHE_SIZE [252:249] states that "the size is indicated as multiple of kilobits". This is also supported by Table 39, "e.MMC internal sizes and related Units / Granularities" which lists "32Kb (=4KB)" as the cache size granularity for 4KiB native devices. Signed-off-by: Patrick Oppenlander <patrick.oppenlander@gmail.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Link: https://lore.kernel.org/r/20200401221453.267360-1-patrick.oppenlander@gmail.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
John Ernberg authored
On our board we would occationally see what looked like a kernel hang while doing RPMB operations, some additional printk debugging revealed that in the trouble case data such as this was being sent to the kernel: [ 109.076981] idata[0]->ic->opcode = 0x19 [ 109.077027] idata[0]->ic->arg = 0x0 [ 109.080954] idata[0]->ic->write_flag = 0x1 [ 109.084691] idata[0]->ic->is_acmd = 0x0 [ 109.089007] idata[0]->ic->flags = 0xb5 [ 109.092949] idata[0]->ic->blocks = 0x1 [ 109.096865] idata[0]->ic->blksz = 0x200 [ 109.100791] idata[0]->ic->postsleep_min_us = 0x7473696e [ 109.104745] idata[0]->ic->postsleep_max_us = 0x34383370 [ 109.110167] idata[0]->ic->data_timeout_ns = 0x7265632d [ 109.115494] idata[0]->ic->data_ptr = 00000000e7ddd4cd [ 109.120832] idata[0]->rpmb = 00000000ffab5640 [ 109.126077] idata[1]->ic->opcode = 0x12 [ 109.130622] idata[1]->ic->arg = 0x0 [ 109.135451] idata[1]->ic->write_flag = 0x0 [ 109.139153] idata[1]->ic->is_acmd = 0x0 [ 109.143437] idata[1]->ic->flags = 0xb5 [ 109.147553] idata[1]->ic->blocks = 0x1 [ 109.151420] idata[1]->ic->blksz = 0x200 [ 109.155251] idata[1]->ic->postsleep_min_us = 0x652d6873 [ 109.159166] idata[1]->ic->postsleep_max_us = 0x35353264 [ 109.164561] idata[1]->ic->data_timeout_ns = 0x632d3931 [ 109.169915] idata[1]->ic->data_ptr = 00000000bc641ed4 [ 109.175152] idata[1]->rpmb = 00000000ffab5640 Therefor, zero-init the MMC_IOC_MULTI_CMD structures to avoid the obscene sleep values. Signed-off-by: John Ernberg <john.ernberg@actia.se> Link: https://lore.kernel.org/r/20201216093146.6218-1-john.ernberg@actia.se Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
Shivamurthy Shastri (sshivamurthy) authored
As per specification, the host can use either CMD24 or CMD25 in closed-ended or open-ended way. CMD25 is better option as it can flash the firmware image in one go. Signed-off-by: Shivamurthy Shastri <sshivamurthy@micron.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Reviewed-by: Bean Huo <beanhuo@micron.com> Tested-by: Bean Huo <beanhuo@micron.com> Link: https://lore.kernel.org/r/MN2PR08MB63973BF8F3C6959487BF5707B86A9@MN2PR08MB6397.namprd08.prod.outlook.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-
- 05 Oct, 2019 5 commits
-
-
Michael Heimpold authored
Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
Appending multiple times to same string is slow since strcat() needs to determine the end during each run. So manually maintain a pointer to the end to speed-up things. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
When a hex-digit > 'a' or 'A' is read, we have to add an offset of 10 to access the valid symbol in our mapping table. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
In case that we leave due to malformed string, free the allocated memory before returning. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Michael Heimpold authored
If calloc fails, bail out immediately instead of trying to use the NULL pointer. Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com> Cc: Michael Heimpold <mhei@heimpold.de> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 08 Aug, 2019 1 commit
-
-
Jungseung Lee authored
Display secure removal type when printing Extended CSD Example: # mmc extcsd read /dev/mmcblk0 ... Secure Removal Type [SECURE_REMOVAL_TYPE]: 0x39 information is configured to be removed using a vendor defined Supported Secure Removal Type: information removed by an erase of the physical memory information removed using a vendor defined Signed-off-by: Jungseung Lee <js07.lee@samsung.com> Reviewed-by: Avri Altman <Avri.Altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 15 Dec, 2018 1 commit
-
-
Nikita Maslov authored
On some systems which use MMC as a main storage device it is possible that RPMB commands are mixed with generic MMC access commands which invalidates RPMB. This patch uses MMC_IOC_MULTI_CMD. Signed-off-by: Clément Péron <peron.clem@gmail.com> Reviewed-by: Avri Altman <avri.altman@wdc.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 08 Dec, 2018 2 commits
-
-
Wolfram Sang authored
The JEDEC standard is confusing. The number of max blocks for reading RPMB is determined by CMD23 which can hold an unsigned int and not only u16. It is true that the current maximum is 64K of blocks, yet this may be extended in the future. Let's not apply a limit here which should be checked by the card. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Wolfram Sang authored
I got a compile error with GCC7. When trimming white spaces from strings lsmmc uses strncpy with overlapping memory areas. This is not allowed. In addition, the implementation was not efficient with calling strlen and strncpy once per iteration. Refactor the code to be valid and more effective. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 27 Mar, 2018 1 commit
-
-
jason.zeng authored
Fix enh_start_addr overflow when converting emmc enh_area which will cause do_enh_area_set failure. Signed-off-by: jason.zeng <jasonzvz@gmail.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 17 Feb, 2018 7 commits
-
-
Uwe Kleine-König authored
According to man-pages(7) the TH macro takes the following parameters: .TH title section date source manual with some recommendations for the individual parameters. Adapt the usage of TH accordingly. The motivating change is to drop "man" in the title in favor of "MMC". Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
Uwe Kleine-König authored
I didn't find any functions used for which the documentation specifies to use (at least) one of the dropped headers. The only Linux specific header <linux/fs.h> is needed for BLKGETSIZE, document that. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
Uwe Kleine-König authored
offsetof isn't mmc specific, so remove it from mmc.h. As there is only a single user define it there. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
Uwe Kleine-König authored
Instead of adding .o and .o.d files for the files that are not explicitly mentioned, add a pattern matching also all future files of these types. This makes git status stop to mention 3rdparty/hmac_sha/.hmac_sha2.o.d 3rdparty/hmac_sha/.sha2.o.d 3rdparty/hmac_sha/hmac_sha2.o 3rdparty/hmac_sha/sha2.o .lsmmc.o.d lsmmc.o Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
Uwe Kleine-König authored
While these dependency information was generated from the start of mmc-utils it was never used. Using these informations results in mmc being rebuild when e.g. mmc.h was touched. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
Uwe Kleine-König authored
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
Uwe Kleine-König authored
This macro saves a few lines of code but is harder to read than the equivalent code spelled out. IMHO the latter is more important, so expand the macro everywhere and drop it. While touching this also unbreak the strings used there for better grepability. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-
- 20 Mar, 2017 2 commits
-
-
Alexander Stein authored
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Alexander Stein authored
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 16 Mar, 2017 1 commit
-
-
Boris Schmidt authored
Signed-off-by: Boris Schmidt <boris.schmidt@siemens.com>
-
- 01 Sep, 2016 1 commit
-
-
Tomas Melin authored
Fixes upstream-merge in 752072da Write_reliability -c addition from patch was missing. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 29 Aug, 2016 5 commits
-
-
Tomas Melin authored
Test was wrong way around. Function returns non-zero value on fail. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Tomas Melin authored
-c option added to gp create, enh_area set and write_reliability set commands. Signed-off by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Tomas Melin authored
Adding 'continue' option to: gp create enh_area set write_reliability set Partitioning commands are connected, register PARTITION_SETTING_COMPLETED should not be written until all settings have been done. The continue option enables writing more than one partitioning setting before sealing settings. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Tomas Melin authored
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Tomas Melin authored
Block-addressed devices should have address multiplied with sector size. Clarify with comment how is_blockaddressed() is calculated. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 23 Jun, 2016 1 commit
-
-
Adrian Hunter authored
Display Command Queue information when printing Extended CSD Example: # mmc extcsd read /dev/mmcblk0 | grep CMDQ Command Queue Support [CMDQ_SUPPORT]: 0x01 Command Queue Depth [CMDQ_DEPTH]: 16 Command Enabled [CMDQ_MODE_EN]: 0x01 Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
-
- 07 Jun, 2016 1 commit
-
-
Al Cooper authored
Add commands to get and set write protect modes for the specified areas of the user partition. The ability to set permanent write protect is #ifdef'd with "DANGEROUS_COMMANDS_ENABLED" because it has the ability to make the eMMC device and possibly the system permanently unusable. Signed-off-by: Al Cooper <alcooperx@gmail.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 11 May, 2016 1 commit
-
-
Markus Schuetterle authored
Modified 'bootpart enable' function to disable partition boot by setting the <partition> parameter to 0. Signed-off-by: Markus Schuetterle <markus.schuetterle@intel.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 08 Mar, 2016 1 commit
-
-
Avi Shchislowski authored
Adding support for field firmware update over multiple command ioctl. As multiple command ioctl is supported only from kernel 4.4, this patch should be used against kernel 4.4 and above. Known issues: - There is no support for Multiple Block write commands (CMD25) in existing IOCTL implementation - In case MODE_OPERATION_CODES field is not supported by the device manual reset of the device/platform is required. The reset issue discussed in another email thread - " [RFC 0/6] mmc: Field Firmware Update" Signed-off-by: Yaniv Agman <yaniv.agman@sandisk.com> Signed-off-by: Avi Shchislowski <avi.shchislowski@sandisk.com> Signed-off-by: Chris Ball <chris@printf.net>
-
- 26 Feb, 2016 1 commit
-
-
Sebastian Rasmussen authored
The lsmmc tools contains an extensive parser of the CID, CSD, SCR registers from userspace. The utility works as-is and uses sysfs to read the register values. The original code is created by Sebastian Rasmussen and still lives in an attachment in the mail archive of linux-mmc. It need to be merged into mmc-utils repository, which is convenient for testing MMC device from userspace. Change since v3: - Remove the unused EXT_CSD parser in lsmmc.c file. Signed-off-by: Sebastian Rasmussen <sebras@gmail.com> Signed-off-by: Chris Ball <chris@printf.net> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
-
- 18 Nov, 2015 2 commits
-
-
Marcus Folkesson authored
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
-
Marcus Folkesson authored
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
-
- 01 May, 2015 2 commits
-
-
Al Cooper authored
The MMC4.5 specification added an optional cache for eMMC devices. This change will add the ability to enable/disable the cache. Signed-off-by: Al Cooper <acooperx@gmail.com> Signed-off-by: Chris Ball <chris@printf.net>
-
Al Cooper authored
This was added because some eMMC devices had the boot bus conditions set incorrectly causing them to hang on boot. Signed-off-by: Al Cooper <acooperx@gmail.com> Signed-off-by: Chris Ball <chris@printf.net>
-