Add FFU mode 4 which enters FFU mode with CMD6, followed by repeated CMD24 commands to perform
single-block writes for the firmware download. After downloading all firmware data, CMD6 is issued
to exit FFU mode.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Message-ID: <20241025203454.162710-6-beanhuo@iokpp.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Add FFU optional mode 3, which initiates firmware download with CMD6 to enter FFU mode, followed
by CMD24 for single-block write, after each CMD24 single-block write, CMD6 is issued to exit FFU
mode. Which means in this mode, during FW downloading, the device will not remain FFU mode.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Message-ID: <20241025203454.162710-5-beanhuo@iokpp.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Introduced a new FFU mode 2 of leveraging CMD25+CMD12 for Open-ended Multiple-block write to
download the firmware bundle. In this mmode, the device remains in FFU mode during firmware
download until the downloading is completed.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Message-ID: <20241025203454.162710-4-beanhuo@iokpp.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Added optional FFU mode 1, in this mode, begins with CMD6, followed by repeated CMD23+CMD25
for downloading the firmware bundle. Once the entire firmware image is downloaded, the FFU
mode is exited with CMD6, ensuring the download is treated as an atomic operation.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Message-ID: <20241025203454.162710-3-beanhuo@iokpp.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Refactor common FFU code into functions to support additional FFU modes. Follow-up
patches will focus on implementing additional FFU modes and enhancements.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Message-ID: <20241025203454.162710-2-beanhuo@iokpp.de>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Run Sparse and fix its warnings. Apparently, running make C=1 is rarely
done, so make running sparse default.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20240706171412.1613019-1-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit adds the essentials for mmc-utils documentation to meet
read-the-docs requirements. run `make html-docs` and direct your browser
to ./docs/_build/html/index.html.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20240624112542.25657-2-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
I have put together a draft man page for mmc-utils. The contents are
from mmc-utils help documents and edited for brevity. The point is not
to replace the existing docmentation, but to serve as a quick reference.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20240329072839.1400-1-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
When building with -Werror=strict-aliasing error is thrown:
mmc_cmds.c: In function 'do_ffu':
mmc_cmds.c:2972:2: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
sect_done = htole32(*((__u32 *)&ext_csd[EXT_CSD_NUM_OF_FW_SEC_PROG_0]));
^
cc1: all warnings being treated as errors
Let's fix type-punned breaking strict-aliasing by implementing local
per_byte_htole32(__u8 *) and use it for the 2 present occurences of
htole32(). Let's also change sect_done type to __u32 for consistency.
Suggested-by: Avri Altman <Avri.Altman@wdc.com>
Fixes: a1b594ca73 ("mmc-utils: ffu: Simplify ext_csd bytes parsing")
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20240305184513.400364-1-giulio.benetti@benettiengineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
When the device capacity is larger than 2GB, it shouldn't use c_size but
instead it follows a different calculation using the SEC_COUNT field of
the ext-csd[215:212] - see eMMC spec JESD84-B51 paragraph 7.3.12.
This bug was already in lsmmc when it got merged into mmc-utils, hence
the fixes tag.
Fixes: 4af1749d23 (mmc-utils: Merge the lsmmc tool into mmc-utils)
Signed-off-by: wanggang26 <wanggang26@xiaomi.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230928180658.1795491-5-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Call those directly form process_dir() and remove the no longer needed
print_info().
While at it remove the deprecated EXT_CSD handling.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230928180658.1795491-3-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
We used to have this odd way of printing the manufacturer name. To that
end we cached the entire database beforehand which is completely
useless.
While at it, get rid of some more redundant code.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230928180658.1795491-2-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
All 3 register parsing: CID, CSD, and CSR follow the same structure -
reuse it instead of duplicating the code 3 times. No functional change.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230926100006.1789276-2-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Building with _FORTIFY_SOURCE=3 results in:
from mmc_cmds.c:20:
In function ‘read’,
inlined from ‘do_rpmb_write_key’ at mmc_cmds.c:2233:8:
..unistd.h:38:10: error: ‘__read_alias’ writing 228 or more bytes into a region of size 32 overflows the destination [-Werror=stringop-overflow=]
38 | return __glibc_fortify (read, __nbytes, sizeof (char),
| ^~~~~~~~~~~~~~~
mmc_cmds.c: In function ‘do_rpmb_write_key’:
mmc_cmds.c:2087:19: note: destination object ‘key_mac’ of size 32
2087 | u_int8_t key_mac[32];
| ^~~~~~~
..unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
| ^~~~~~~~~~
To work around this let's check if the return of read() is lower than the
nbyte requested instead of not equal.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230926131128.3771508-1-giulio.benetti@benettiengineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Normally one would like to perform ffu using the largest possible chunk.
However, since the ffu-timeout is vendor specific, there are times in
which smaller chunks would lead to a more robust ffu process. Allow
this via an additional optional argument.
Tested-by: Lund Austin <Austin.Lund@garmin.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230625103814.105-7-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
ffu is done using a single multi-ioctl to carry the entire firmware
image. This is limiting the fw image size to be at most 512KB, as the
mmc driver restricts each single ioc data to be at most
MMC_IOC_MAX_BYTES.
the spec however, allows the fw image to be written using multiple write
commands.
To overcome this limitation, if the fw image is larger than 512KB,
split it into a series of 512KB chunks.
fixes: 1b8b13beb4 (mmc-utils: let FFU mode use CMD23 and CMD25)
Reported-by: Lund Austin <Austin.Lund@garmin.com>
Tested-by: Lund Austin <Austin.Lund@garmin.com>
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230625103814.105-6-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
In preparation of sending the fw image in several chunks.
While at it, make use of set_single_cmd() to preapare CMD23 and CMD25.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230625103814.105-5-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
The ext_csd register has this habbit of linking a contiguous set of
bytes into one meaningful double-word. It does that where the least
significant value is in the lower index - hence little-endian.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230625103814.105-4-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Writing the ext_csd (MMC_SWITCH) is done in several places throught the
code. Prepare a single handler for that.
This patch has no functional change.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230625103814.105-2-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Notify of mult-ioctl violation during preprocessing instead of bailing out
in runtime. This prevents bogus copies of mmc-utils binaries wondering
about out there.
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230609083425.765-1-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Build tools like OpenEmbedded set the CFLAGS environment variable to be
in line with distro-wide decisions. Updating OpenEmbedded-core to point
at the new mmc-utils breaks, because VERSION would then be undefined.
Instead of having users workaround this by feeding in -DVERSION from
the outside, let's just move it out of environment-overridable CFLAGS
and into AM_CFLAGS instead.
This will inconvenience users that set their own VERSION a bit: The
Makefile sets -Werror and specifying -DVERSION twice will trigger it
because of the duplicate definition. This can be resolved by specifying
-UVERSION first. Given that the VERSION macro has only been there for a
month, this is deemed acceptable.
Fixes: 145c74ab6f ("mmc-utils: Change version string to git hash")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.kernel.org/r/20230526081100.1741293-1-a.fatoum@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reading the MID just to convert it to 'Unlisted' is quite unhelpful for
an info command.
Due to the (constantly increasing) amount of valid MIDs it is quite
unlikely to we have it in the database already anyway.
Thus simply always print the manufacturer ID as 0xNN and understand the
manufacturer name as an additional information held in parenthesis.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230522214818.2038252-3-ejo@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
It is parsed as an integer and printed as a char which does not really
make sense.
E.g. if OID is '0' (which does not seem to be uncommon), then this
prints a '\0' character and makes output nearly unreadable/unparsable.
Also, do not print it like it would be a string, instead use 0x<digit>
format.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20230522214818.2038252-2-ejo@pengutronix.de
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Since mmc-utils versioning has always been 0.1 and changes are not
made frequently and formal releases do not happen, packaged versions
are just pulled from git anyway, using the git hash for version is
probably the best idea for now.
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Link: https://lore.kernel.org/r/28623fa7390242e9b003a44016c0235f@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Check for erase specific R1 errors so e.g. an OOR erase is not
reported as successful when it never executed.
There could be checks for more error bits but R1_ERASE_SEQ_ERROR
on CMD38 should catch all that are reported by hardware anyway.
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/c91cdde6288d4db6aad45f5d50d129c8@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
There is a command to read the extcsd and some commands to configure
particular features, but no generic write extcsd command. Such a command
may be useful for not-yet-supported features and manufacturer-specific
registers.
Signed-off-by: Philippe Reynes <philippe.reynes@sagemcom.com>
[ rebased onto latest master and updated commit message ]
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20221216161625.2924013-1-sean.anderson@seco.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Implements the alternative boot operation for eMMCs.
Note the limitations of the help.
This is mostly useful for testing purposes if you set
up the boot partition configuration correctly.
Usage:
$ sudo dd if=/dev/mmcblk2boot0 of=bootdatammcblk count=2
2+0 records in
2+0 records out
1024 bytes (1.0 kB, 1.0 KiB) copied, 0.00482308 s, 212 kB/s
$ sudo ./mmc boot_operation bootdata /dev/mmcblk2
$ diff -s bootdata bootdatammcblk
Files bootdata and bootdatammcblk are identical
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/f999a7ed7bb645948ac74d5d5341e913@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
CMD0 may be used to see if the hardware can handle a UHS card
that completed the voltage switch. If a UHS card has problems
coming back up after CMD0 your hardware may not support a hard
reset properly.
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/0657285aa7c64cbe89f9275fd5598345@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Some cards with certain preconditioning require a higher timeout
when sanitizing. Let the user set the maximum timeout.
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/4ddb5a5510d74645b2724d274c96ab02@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Certain commands require a longer switch timeout.
Refactor accordingly to allow e.g. for future sanitize change.
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/a64ce8be9687452b8da6c9816ca42b5b@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Manufacturer id 0x44 is assign to ATP by 3c-LLC, and not to SanDisk.
mmc-utils inherited this typo when lsmmc got merged into it.
Reported-by: Mark Kanczak <Markk@us.atpinc.com>
Fixes: 4af1749d23 (mmc-utils: Merge the lsmmc tool into mmc-utils)
Signed-off-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220927084317.138-1-avri.altman@wdc.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Move up the return in case MODE_OPERATION_CODES is not supported.
According to the specification when MODE_OPERATION_CODES is not
supported no checks should be done against NUM_OF_FW_SEC_PROG.
Signed-off-by: Bruno Matic <bruno.matic@nokia.com>
Fixes: 89cd01ed86 (mmc_utils: add ffu support)
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220920124749.24073-1-bruno.matic@nokia.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
When building following warning shows up:
```
In function '__bswap_32',
inlined from 'do_rpmb_write_block' at mmc_cmds.c:2293:27:
/home/autobuild/autobuild/instance-15/output-1/host/aarch64-buildroot-linux-gnu/sysroot/usr/include/bits/byteswap.h:52:10: error: 'cnt' may be used uninitialized [-Werror=maybe-uninitialized]
52 | return __builtin_bswap32 (__bsx);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
mmc_cmds.c: In function 'do_rpmb_write_block':
mmc_cmds.c:2270:22: note: 'cnt' was declared here
2270 | unsigned int cnt;
| ^~~
cc1: all warnings being treated as errors
```
This is due to function rpmb_read_counter() that doesn't set its
argument 'unsigned int *cnt' in all return points. So let's set
*cnt to 0 in the return point that misses to initialize it.
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220918161751.1132590-1-giulio.benetti@benettiengineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Add the check if the whole firmware was loaded. Cleaned up the leftovers
of handling the file in chunks.
Signed-off-by: Bruno Matic <bruno.matic@nokia.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220909110322.25141-1-bruno.matic@nokia.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
FFU used the wrong assumption, that CMD23 work in
4k sector chunks when setting the block count.
Instead the CMD23 block count argument just needs
to be a multiple of 8, which the fw_size is anyway.
Fixes: 89cd01ed86 (mmc_utils: add ffu support)
Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/54477cf05b9148109996dd85c9afc30f@hyperstone.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
We can use GEN_CMD (CMD56) to read a data block with vendor-specific
format and meaning, which is very helpful and useful for customers to
analyze device health. This patch is to add support for this command.
At the same time, in order to make CMD56 universal, let more users of
mmc-utils can benefit from this. We will allow the user to enter [arg]
for special commands. Because some eMMC vendors provide an additional
set of commands beyond the GEN_CMD (CMD56) definition in the JEDEC
specification. These additional commands are implemented using generic
CMD56 commands, and they return a wealth of useful information about the
state of the NAND device. For these special purposes, the [31:1]stuff
bits in the CMD56 argument are used. You can refer to Micron eMMC
"TN-FC-32: e·MMC Device Health Report" as an example.
I didn't add data parsing, just print the raw data as it is vendor-specific.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <Avri.Altman@wdc.com>
Tested-by: Rossler Jakob (Nokia - DE/Ulm) <jakob.rossler@nokia.com>
Link: https://lore.kernel.org/r/20220417111622.621650-1-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
The reported build error:
In function read_extcsd: mmc_cmds.c:72:18: error: MMC_BLOCK_MAJOR
undeclared (first use in this function)
In commit 118dc4a090 ("mmc-utils: Remove unused MMC_BLOCK_MAJOR") the
define for MMC_BLOCK_MAJOR was dropped. In a way this commit is still
correct, but unfortunately it also introduced a dependency to a commit for
the Linux kernel (83fc5dd57f86 mmc: fix compilation of user API), which
fixes the mmc uapi header file.
Rather than relying on the commit in the kernel, let's include the missing
header for MMC_BLOCK_MAJOR.
Reported-by: Ming Liu <liu.ming50@gmail.com>
Fixes: 118dc4a090 ("mmc-utils: Remove unused MMC_BLOCK_MAJOR")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220426100605.36019-1-ulf.hansson@linaro.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Support for Enhanced Strobe mode introduced in eMMC 5.1 JESD84-B51
can be determined via EXT_CSD[184]. Along with the identification of
HS400 data rates added in commit 3969aa4804 ("mmc_cmds: add HS400
data rates"), this allows to differentiate support for HS400/HS400ES.
Signed-off-by: Marius Strobl <marius@FreeBSD.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220205205647.7677-3-marius@FreeBSD.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
It was added in commit 294bf86972 ("mmc-utils: Remove dependency on
linux/major.h.") but never actually used, apparently.
Signed-off-by: Marius Strobl <marius@FreeBSD.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Link: https://lore.kernel.org/r/20220205205647.7677-2-marius@FreeBSD.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
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>
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>
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>
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>