Commit Graph
91 Commits
Author SHA1 Message Date
Shankar Athanikar fd41dca5b1 mmc_cmds: Display BARRIER_CTRL Status when printing EXT_CSD
The status of BARRIER_CTRL can be read from this byte: EXT_CSD[31](R/W)
Signed-off-by: Shankar Athanikar <shankar.ma@samsung.com>
Reviewed-by: <mohanraj.v@samsung.com>
Link: https://lore.kernel.org/r/20211224111917.707440-1-shankar.ma@samsung.com
[Ulf: Cleaned up whitespace and corrected sob-tag]
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-01-25 18:29:56 +01:00
Quentin Schulz 4465006b3c add README
This adds a README to the project so that the contribution process is
explicit as well as the licenses that apply to the source code.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://lore.kernel.org/r/20220113094404.64510-1-quentin.schulz@theobroma-systems.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2022-01-25 17:19:41 +01:00
Quentin Schulz 3969aa4804 mmc_cmds: add HS400 data rates
JEDEC 5.1 JESD84-B50.1 DEVICE_TYPE [196] specifies that bit 6 is for
"HS400 Dual Data Rate e•MMC at 200 MHz – 1.8 V I/O" and bit 7 for
"HS400 Dual Data Rate e•MMC at 200 MHz – 1.2 V I/O" so let's add those.

Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://lore.kernel.org/r/20211202161910.3944640-1-quentin.schulz@theobroma-systems.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-12-20 11:04:18 +01:00
Oleh Kravchenko a1b233c2a3 mmc-utils: Use printf() to extract and print fw version
This patch also fixes a compile error with a newer version of GCC:
error: '__builtin_strncpy' output may be truncated copying 8 bytes from
a string of length 511 [-Werror=stringop-truncation]

Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Fixes: 0eea71e4f2 (mmc-utils: Fix for Firmware Version string printing)
Link: https://lore.kernel.org/r/20211130142715.11014-1-oleg@kaa.org.ua
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-12-02 15:23:52 +01:00
Bean Huo ad3fb9fe14 mmc-utils: Add note for CMDQ_MODE_EN runtime value
Since the Linux kernel commit 70b52f090805 ("mmc: block: Disable CMDQ on
the ioctl path"), CMDQ in CMDQ_MODE_EN[15] is disabled before reading EXT_CSD.
Therefore, it is more accurate to use sysfs node to check CMDQ_MODE_EN value.
Add a note print to highlight.

Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20211114204331.39555-3-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-11-15 15:59:55 +01:00
Michael Heimpold 7769a4d7ab mmc-utils: One further optimization of trimming routine
The last change to the trimming routine made it more efficient,
however, we can even get rid of the memmove() as we leave the
function with strdup() anyway.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20210920194633.814-1-mhei@heimpold.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-09-30 11:46:07 +02:00
Kimito Sakata 0eea71e4f2 mmc-utils: Fix for Firmware Version string printing
Added a local buffer to create a NULL terminated string to print the
Firmware Version instead of attempting to print directly from
ext_csd buffer. The last byte of the Firmware Version field may not
be NULL and the next field may also not be which may cause it to
print garbage.

Tested on x86 platform.

Signed-off-by: Kimito Sakata <kimito.sakata@oracle.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Fixes: 89cd01ed86 (mmc_utils: add ffu support)
Link: https://lore.kernel.org/r/20210713053458.1441-1-oracleks043021@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-08-24 10:57:33 +02:00
Kimito Sakata 43282e80e1 mmc-utils: Add eMMC erase command support
we have been using this erase feature for a while, but it is
still not merged into the upstream mmc-utils. Especially, for
the customer, every time when they update the mmc-utils, they
should re-install this patch again, let's try to make this
erase command upstreamed in the mmc-utils.

We need to send 3 MMC commands and it is important that they
stay in sequence. Therefore we are using MMC_IOC_MULTI_CMD.

Co-developed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Kimito Sakata <kimito.sakata@oracle.com>
Reviewed-by: Kenneth Gibbons <kenny.gibbons@oracle.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20210506191041.1178-1-oracleks043021@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-05-11 12:45:55 +02:00
Stephane Fillod e9654ebc4a Various fixes
These warnings were mainly found using cppcheck.

Signed-off-by: Stephane Fillod <f8cfe@free.fr>
Reviewed-by: Michael Heimpold <mhei@heimpold.de>
Link: https://lore.kernel.org/r/1254580747.16828401.1547561163645.JavaMail.root@zimbra64-e11.priv.proxad.net
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-30 15:28:34 +02:00
Stephane Fillod 5edc6a4ed1 Add various SD/eMMC vendors to table
Part if this list update comes from a compilation of this web site[1].

[1] https://www.cameramemoryspeed.com/sd-memory-card-faq/reading-sd-card-cid-serial-psn-internal-numbers/

Signed-off-by: Stephane Fillod <f8cfe@free.fr>
Link: https://lore.kernel.org/r/886907785.16708970.1547560575203.JavaMail.root@zimbra64-e11.priv.proxad.net
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-30 15:28:10 +02:00
Stephane Fillod 51434a7ab2 Fix parsing of Product Revision and Serial Number
According to MMC Standard (similar to SDCard Standard).

Signed-off-by: Stephane Fillod <f8cfe@free.fr>
Acked-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/1823652044.3512532.1547484650178.JavaMail.root@zimbra64-e11.priv.proxad.net
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-30 15:19:53 +02:00
Fabrice Fontaine 520f54eb94 mmc_cmds.c: fix build with gcc 4.9
Fix following error with gcc 4.9:

mmc_cmds.c:1918:9: error: missing braces around initializer [-Werror=missing-braces]
  struct rpmb_frame frame_status = {0};

Fixes:
 - http://autobuild.buildroot.org/results/bf3b6f9f6ef39b99842b3c92495b7bf359c68158

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Link: https://lore.kernel.org/r/20190928185107.21125-1-fontaine.fabrice@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2021-03-30 15:17:07 +02:00
Lars Pedersen ad6890a2dd mmc-utils: Add AUTO_EN support in the BKOPS_EN
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>
2021-03-30 15:12:23 +02:00
Julius Werner be4cac34ea mmc-utils: Expand 'writeprotect boot'
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>
2021-03-30 15:09:25 +02:00
Patrick Oppenlander 5b3e56f708 mmc-utils: Fix scaling of cache size
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>
2021-03-30 15:05:57 +02:00
John Ernberg 271bdfc6f2 rpmb: Zero-init MMC_IOC_MULTI_CMD structures
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>
2021-03-30 15:02:54 +02:00
Shivamurthy Shastri (sshivamurthy) 1b8b13beb4 mmc-utils: let FFU mode use CMD23 and CMD25
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>
2021-03-30 14:55:52 +02:00
Michael Heimpold 73d6c59af8 Add eMMC vendor Micron to 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>
2019-10-04 20:47:33 -04:00
Michael Heimpold 6c595aea07 Optimize to_binstr() function
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>
2019-10-04 20:47:30 -04:00
Michael Heimpold c19c7694d2 Fix parsing of character in to_binstr()
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>
2019-10-04 20:47:27 -04:00
Michael Heimpold de27fd9752 Cleanup memory in error case
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>
2019-10-04 20:47:24 -04:00
Michael Heimpold de0715d5b0 Check calloc's return value before using the pointer
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>
2019-10-04 20:47:11 -04:00
Jungseung Lee d40ec535b9 mmc-utils: feature spec 5.0+, add secure removal type fields to Extended CSD
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>
2019-08-08 18:42:38 -04:00
Nikita Maslov aef913e31b mmc-utils: use MMC_IOC_MULTI_CMD for RPMB access
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>
2018-12-14 20:11:14 -05:00
Wolfram Sang 485b05ec40 use proper type for RPMB blocks_cnt
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>
2018-12-08 00:51:37 -05:00
Wolfram Sang bd23a79e34 fix GCC7 build by refactoring trimming routines
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>
2018-12-08 00:03:54 -05:00
jason.zeng b4fe0c8c0e fix ENH_START_ADDR overflow
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>
2018-03-27 02:17:10 -04:00
Uwe Kleine-König 7bcad17117 mmc-utils: manpage: fix arguments for TH macro
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>
2018-02-16 20:19:47 -05:00
Uwe Kleine-König 247191a0f7 mmc-utils: remove unused #includes
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>
2018-02-16 20:19:43 -05:00
Uwe Kleine-König a1a6120c34 mmc-utils: move offsetof from mmc.h to only user
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>
2018-02-16 20:19:40 -05:00
Uwe Kleine-König cf7b3fe489 mmc-utils: expand .gitignore
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>
2018-02-16 20:19:35 -05:00
Uwe Kleine-König a04361659d mmc-utils: make use of dependency information generated by gcc
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>
2018-02-16 20:19:31 -05:00
Uwe Kleine-König d8cf8d34c0 mmc-utils: drop unused header
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Chris Ball <chris@printf.net>
2018-02-16 20:19:13 -05:00
Uwe Kleine-König fcef164b23 mmc-utils: drop macro CHECK
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>
2018-02-16 20:17:09 -05:00
Alexander Stein 37c86e60c0 mmc-utils: Check for ext_csd_rev only once
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Chris Ball <chris@printf.net>
2017-03-20 09:58:49 -04:00
Alexander Stein c22a92f948 mmc-utils: feature spec 5.0+, Pre EOL information
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Chris Ball <chris@printf.net>
2017-03-20 09:58:40 -04:00
Boris Schmidt 34a954b87c mmc-utils: feature spec 5.0+, device life time estimation for MLC and pSLC mode
Signed-off-by: Boris Schmidt <boris.schmidt@siemens.com>
2017-03-16 12:10:37 -04:00
Tomas Melin 2cb6695e8d Add missing -c for write_reliability
Fixes upstream-merge in 752072dafe
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>
2016-09-01 11:49:01 -04:00
Tomas Melin e094e28d56 Fix return value check from set_partitioning_setting_completed()
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>
2016-08-29 12:03:17 -04:00
Tomas Melin f90eac4ecc Add help texts for -c option
-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>
2016-08-29 12:03:16 -04:00
Tomas Melin 752072dafe Add -c option for partitioning commands
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>
2016-08-29 12:03:14 -04:00
Tomas Melin 55380d9748 Register being set is other than mentioned in printed message.
Signed-off-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Chris Ball <chris@printf.net>
2016-08-29 12:03:06 -04:00
Tomas Melin 3c02759595 Fix reported offset for enhanced user area start address
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>
2016-08-29 12:02:59 -04:00
Adrian Hunter a3d3331e68 mmc-utils: Add Command Queue fields to Extended CSD
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>
2016-06-23 16:28:08 -04:00
Al Cooper 0ca049f251 mmc-utils: Add ability to configure write protect on an eMMC device
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>
2016-06-07 16:55:09 -04:00
Markus Schuetterle bb779acfc3 mmc-utils: Add disable partition boot to 'mmc bootpart enable'
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>
2016-05-11 09:33:01 -04:00
Avi Shchislowski 89cd01ed86 mmc_utils: add ffu support
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>
2016-03-08 14:22:41 -05:00
Sebastian Rasmussen 4af1749d23 mmc-utils: Merge the lsmmc tool into mmc-utils
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>
2016-02-26 09:42:38 -05:00
Marcus Folkesson 44f94b9258 mmc_utils: doc: add man-page
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
2015-11-18 15:11:14 -05:00
Marcus Folkesson 928ff072be mmc_utils: gp create: only allow partition [1-4] to be selected
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
2015-11-18 15:06:16 -05:00