Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mmc-utils for openSUSE:Factory checked in at 2024-08-26 22:11:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mmc-utils (Old) and /work/SRC/openSUSE:Factory/.mmc-utils.new.2698 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mmc-utils" Mon Aug 26 22:11:09 2024 rev:22 rq:1196052 version:0.1+git.20240801 Changes: -------- --- /work/SRC/openSUSE:Factory/mmc-utils/mmc-utils.changes 2024-03-14 17:47:46.295398278 +0100 +++ /work/SRC/openSUSE:Factory/.mmc-utils.new.2698/mmc-utils.changes 2024-08-26 22:13:58.119383472 +0200 @@ -1,0 +2,10 @@ +Mon Aug 26 11:14:14 UTC 2024 - Martin Pluskal <[email protected]> + +- Update to version 0.1+git.20240801: + * mmc-utils: create mandir during install + * mmc-utils: Make functions static for local scope enforcement + * mmc-utils: Add Read-the-Docs configuration + * mmc-utils: Add documentation section + * mmc-utils: man 1 mmc-utils + +------------------------------------------------------------------- Old: ---- mmc-utils-0.1+git.20240307.obscpio New: ---- mmc-utils-0.1+git.20240801.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mmc-utils.spec ++++++ --- /var/tmp/diff_new_pack.z27FAL/_old 2024-08-26 22:13:58.783411199 +0200 +++ /var/tmp/diff_new_pack.z27FAL/_new 2024-08-26 22:13:58.787411366 +0200 @@ -17,13 +17,14 @@ Name: mmc-utils -Version: 0.1+git.20240307 +Version: 0.1+git.20240801 Release: 0 Summary: Tools for MMC/SD devices License: GPL-2.0-only URL: https://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/ Source0: %{name}-%{version}.tar.gz Source1: https://www.gnu.org/licenses/gpl-2.0.txt +BuildRequires: sparse %description Userspace tools for controlling and querying MMC/SD storage devices ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.z27FAL/_old 2024-08-26 22:13:58.827413036 +0200 +++ /var/tmp/diff_new_pack.z27FAL/_new 2024-08-26 22:13:58.831413203 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git</param> - <param name="changesrevision">e1281d4de9166b7254ba30bb58f9191fc2c9e7fb</param></service></servicedata> + <param name="changesrevision">123fd8b2ac3933be1319486fb1f32236a4a86a7c</param></service></servicedata> (No newline at EOF) ++++++ mmc-utils-0.1+git.20240307.obscpio -> mmc-utils-0.1+git.20240801.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/.gitignore new/mmc-utils-0.1+git.20240801/.gitignore --- old/mmc-utils-0.1+git.20240307/.gitignore 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/.gitignore 2024-08-01 12:49:20.000000000 +0200 @@ -1,3 +1,4 @@ .*.o.d *.o +docs/_build /mmc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/.readthedocs.yaml new/mmc-utils-0.1+git.20240801/.readthedocs.yaml --- old/mmc-utils-0.1+git.20240307/.readthedocs.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/.readthedocs.yaml 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: GPL-2.0-only +# .readthedocs.yaml +version: 2 + +sphinx: + configuration: docs/conf.py + +formats: all + +python: + install: + - requirements: docs/requirements.txt + +build: + os: "ubuntu-22.04" # Specify the OS (if this option becomes available) + tools: + python: "3.8" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/3rdparty/hmac_sha/sha2.c new/mmc-utils-0.1+git.20240801/3rdparty/hmac_sha/sha2.c --- old/mmc-utils-0.1+git.20240307/3rdparty/hmac_sha/sha2.c 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/3rdparty/hmac_sha/sha2.c 2024-08-01 12:49:20.000000000 +0200 @@ -131,27 +131,27 @@ wv[h] = t1 + t2; \ } -uint32 sha224_h0[8] = +static uint32 sha224_h0[8] = {0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4}; -uint32 sha256_h0[8] = +static uint32 sha256_h0[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; -uint64 sha384_h0[8] = +static uint64 sha384_h0[8] = {0xcbbb9d5dc1059ed8ULL, 0x629a292a367cd507ULL, 0x9159015a3070dd17ULL, 0x152fecd8f70e5939ULL, 0x67332667ffc00b31ULL, 0x8eb44a8768581511ULL, 0xdb0c2e0d64f98fa7ULL, 0x47b5481dbefa4fa4ULL}; -uint64 sha512_h0[8] = +static uint64 sha512_h0[8] = {0x6a09e667f3bcc908ULL, 0xbb67ae8584caa73bULL, 0x3c6ef372fe94f82bULL, 0xa54ff53a5f1d36f1ULL, 0x510e527fade682d1ULL, 0x9b05688c2b3e6c1fULL, 0x1f83d9abfb41bd6bULL, 0x5be0cd19137e2179ULL}; -uint32 sha256_k[64] = +static uint32 sha256_k[64] = {0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, @@ -169,7 +169,7 @@ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2}; -uint64 sha512_k[80] = +static uint64 sha512_k[80] = {0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL, 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL, @@ -213,7 +213,7 @@ /* SHA-256 functions */ -void sha256_transf(sha256_ctx *ctx, const unsigned char *message, +static void sha256_transf(sha256_ctx *ctx, const unsigned char *message, unsigned int block_nb) { uint32 w[64]; @@ -429,8 +429,8 @@ /* SHA-512 functions */ -void sha512_transf(sha512_ctx *ctx, const unsigned char *message, - unsigned int block_nb) +static void sha512_transf(sha512_ctx *ctx, const unsigned char *message, + unsigned int block_nb) { uint64 w[80]; uint64 wv[8]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/Makefile new/mmc-utils-0.1+git.20240801/Makefile --- old/mmc-utils-0.1+git.20240307/Makefile 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/Makefile 2024-08-01 12:49:20.000000000 +0200 @@ -21,15 +21,17 @@ bindir = $(prefix)/bin LIBS= RESTORE_LIBS= +mandir = /usr/share/man progs = mmc -# make C=1 to enable sparse +# make C=1 to enable sparse - default +C ?= 1 ifdef C - check = sparse $(CHECKFLAGS) + check = sparse $(CHECKFLAGS) $(AM_CFLAGS) endif -all: $(progs) manpages +all: $(progs) .c.o: ifdef C @@ -43,17 +45,21 @@ manpages: $(MAKE) -C man -install-man: - $(MAKE) -C man install - clean: rm -f $(progs) $(objects) $(MAKE) -C man clean + $(MAKE) -C docs clean -install: $(progs) install-man +install: $(progs) $(INSTALL) -m755 -d $(DESTDIR)$(bindir) $(INSTALL) $(progs) $(DESTDIR)$(bindir) + $(INSTALL) -m755 -d $(DESTDIR)$(mandir)/man1 + $(INSTALL) -m 644 mmc.1 $(DESTDIR)$(mandir)/man1 -include $(foreach obj,$(objects), $(dir $(obj))/.$(notdir $(obj)).d) .PHONY: all clean install manpages install-man + +# Add this new target for building HTML documentation using docs/Makefile +html-docs: + $(MAKE) -C docs html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/README new/mmc-utils-0.1+git.20240801/README --- old/mmc-utils-0.1+git.20240307/README 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/README 2024-08-01 12:49:20.000000000 +0200 @@ -12,13 +12,17 @@ One can document themselves by reading how to submit a patch in the official Linux kernel documentation: https://www.kernel.org/doc/html/latest/process/submitting-patches.html - Not all sections apply but it should be a good way to get started. A patch should be sent as a mail (not as an attachement, see documentation above) to the [email protected] mailing list with maintainers as Cc recipients. +Documentation +------------- +https://mmc-utils.readthedocs.io/en/latest/ + + Maintainers ----------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/docs/HOWTO.rst new/mmc-utils-0.1+git.20240801/docs/HOWTO.rst --- old/mmc-utils-0.1+git.20240307/docs/HOWTO.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/docs/HOWTO.rst 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,67 @@ +.. SPDX-License-Identifier: GPL-2.0-only + +Running mmc-utils +----------------- +**Name** + mmc - a tool for configuring MMC storage devices +**Synopsis** + ``mmc [options] [mmc-block-device]...`` +**Description** + *mmc-utils* is a single-threaded tool that will perform a specified type of mmc action as specified by the user. + The typical use of mmc-utils is to access the mmc device either for configuring or reading its configuration registers. +**Options** + ``help | --help | -h | (no arguments)`` + Shows the abbreviated help menu in the terminal. + +**Commands** + ``extcsd read <device>`` + Print extcsd data from <device>. + + ``extcsd write <offset> <value> <device>`` + Write <value> at offset <offset> to <device>'s extcsd. + + ``writeprotect boot get <device>`` + Print the boot partitions write protect status for <device>. + + ``writeprotect boot set [-p] <device> [<number>]`` + Set the boot partition write protect status for <device>. + If <number> is passed (0 or 1), only protect that particular eMMC boot partition, otherwise protect both. It will be write-protected until the next boot. + -p Protect partition permanently instead. NOTE! -p is a one-time programmable (unreversible) change. + + ``writeprotect user set <type> <start block> <blocks> <device>`` + Set user area write protection. + + ``scr read <device path>`` + Print SCR data from <device path>. The device path should specify the scr file directory. + + ``ffu <image name> <device> [chunk-bytes]`` + Run Field Firmware Update with <image name> on <device>. [chunk-bytes] is optional and defaults to its max - 512k. Should be in decimal bytes and sector aligned. + + ``erase <type> <start address> <end address> <device>`` + Send Erase CMD38 with specific argument to the <device>. NOTE!: This will delete all user data in the specified region of the device. <type> must be one of: legacy, discard, secure-erase, secure-trim1, secure-trim2, or trim. + + ``gen_cmd read <device> [arg]`` + Send GEN_CMD (CMD56) to read vendor-specific format/meaning data from <device>. NOTE!: [arg] is optional and defaults to 0x1. If [arg] is specified, then [arg] must be a 32-bit hexadecimal number, prefixed with 0x/0X. And bit0 in [arg] must be 1. + + ``lock <parameter> <device> [password] [new_password]`` + Usage: mmc lock <s|c|l|u|e> <device> [password] [new_password]. <password> can be up to 16 character plaintext or hex string starting with 0x. s=set password, c=clear password, l=lock, sl=set password and lock, u=unlock, e=force erase. + + ``softreset <device>`` + Issues a CMD0 softreset, e.g., for testing if hardware reset for UHS works. + + ``preidle <device>`` + Issues a CMD0 GO_PRE_IDLE. + + ``boot_operation <boot_data_file> <device>`` + Does the alternative boot operation and writes the specified starting blocks of boot data into the requested file. Note some limitations: The boot operation must be configured, e.g., for legacy speed. The MMC must currently be running at the bus mode that is configured for the boot operation (HS200 and HS400 not supported at all). Only up to 512K bytes of boot data will be transferred. The MMC will perform a soft reset, if your system cannot handle that do not use the boot operation from mmc-utils. + + + + ``mmc rpmb write-block <rpmb device> <address> <256 byte data file> <key file>`` + Writes a block of data to the RPMB partition. + + ``mmc rpmb read-counter <rpmb device>`` + Reads the write counter from the RPMB partition. + + ``mmc rpmb read-block <rpmb device> <address> <blocks count> <output file> [key file]`` + Reads blocks of data from the RPMB partition. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/docs/Makefile new/mmc-utils-0.1+git.20240801/docs/Makefile --- old/mmc-utils-0.1+git.20240307/docs/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/docs/Makefile 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/docs/README.rst new/mmc-utils-0.1+git.20240801/docs/README.rst --- old/mmc-utils-0.1+git.20240307/docs/README.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/docs/README.rst 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,76 @@ +.. SPDX-License-Identifier: GPL-2.0-only + +README Intro +-------------------- + +mmc-utils is a tool for configuring MMC storage devices from userspace. + + +Source +------ + +mmc-utils resides in a git repo, the canonical place is: + +https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc-utils.git + + +Mailing list +------------ + +The project uses the kernel's mmc mailing list. There you should submit your +patches, ask for help, or discuss mmc-utils related issues. A patch should be +sent as a mail to the [email protected] mailing list with maintainers +as Cc recipients. Archives can be found here: + + https://www.spinics.net/lists/linux-mmc/ + +or here: + + https://lore.kernel.org/linux-mmc/ + + +Author +------ + +mmc-utils was written by Chris Ball <[email protected]> and <[email protected]>. + + +Maintainers +----------- + +Avri Altman <[email protected]> +Ulf Hansson <[email protected]> + + +Building +-------- + +Just type:: + + $ make + $ make install + +Note that GNU make is required. Make install also builds the man page + +To cross-compile mmc-utils you can use environment variables. e.g. to build +statically linked for ARM64:: + + $ make clean + $ CC=aarch64-linux-gnu-gcc CFLAGS=' -g -O2 -static' make + + +Documentation +------------- + +mmc-utils uses Sphinx_ to generate documentation from the reStructuredText_ files. +To build HTML formatted documentation run ``make html-docs`` and direct your +browser to :file:`./docs/_build/html/index.html`. + +.. _reStructuredText: https://www.sphinx-doc.org/rest.html +.. _Sphinx: https://www.sphinx-doc.org + + +License +------- + +This project is licensed under GPL-2.0-only. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/docs/conf.py new/mmc-utils-0.1+git.20240801/docs/conf.py --- old/mmc-utils-0.1+git.20240307/docs/conf.py 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/docs/conf.py 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0-only +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + + +# -- Project information ----------------------------------------------------- + +project = 'mmc-utils' +copyright = '2024, Chris Ball' +author = 'Chris Ball' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/docs/index.rst new/mmc-utils-0.1+git.20240801/docs/index.rst --- old/mmc-utils-0.1+git.20240307/docs/index.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/docs/index.rst 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,17 @@ +.. SPDX-License-Identifier: GPL-2.0-only +.. mmc-utils documentation master file, created by + sphinx-quickstart on Sat Jun 22 16:14:46 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to mmc-utils's documentation! +===================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents + + ../README.rst + ../HOWTO.rst + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/docs/requirements.txt new/mmc-utils-0.1+git.20240801/docs/requirements.txt --- old/mmc-utils-0.1+git.20240307/docs/requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/docs/requirements.txt 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,2 @@ +sphinx==4.3.2 +jinja2>=2.11 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/lsmmc.c new/mmc-utils-0.1+git.20240801/lsmmc.c --- old/mmc-utils-0.1+git.20240307/lsmmc.c 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/lsmmc.c 2024-08-01 12:49:20.000000000 +0200 @@ -47,6 +47,7 @@ #include <unistd.h> #include "mmc.h" +#include "mmc_cmds.h" #define MASKTOBIT0(high) \ ((high >= 0) ? ((1ull << ((high) + 1ull)) - 1ull) : 0ull) @@ -231,7 +232,7 @@ }; /* Command line parsing functions */ -void usage(void) +static void usage(void) { printf("Usage: print mmc [-h] [-v] <device path ...>\n"); printf("\n"); @@ -240,7 +241,7 @@ printf("\t-v\tEnable verbose mode.\n"); } -int parse_opts(int argc, char **argv, struct config *config) +static int parse_opts(int argc, char **argv, struct config *config) { int c; @@ -302,7 +303,7 @@ } /* MMC/SD file parsing functions */ -char *read_file(char *name) +static char *read_file(char *name) { char line[4096]; char *preparsed, *start = line; @@ -352,7 +353,7 @@ } /* Hexadecimal string parsing functions */ -char *to_binstr(char *hexstr) +static char *to_binstr(char *hexstr) { char *bindigits[] = { "0000", "0001", "0010", "0011", "0100", "0101", "0110", "0111", @@ -386,7 +387,7 @@ return binstr; } -void bin_to_unsigned(unsigned int *u, char *binstr, int width) +static void bin_to_unsigned(unsigned int *u, char *binstr, int width) { *u = 0; assert(width <= 32); @@ -400,7 +401,7 @@ } } -void bin_to_ascii(char *a, char *binstr, int width) +static void bin_to_ascii(char *a, char *binstr, int width) { assert(width % 8 == 0); *a = '\0'; @@ -419,7 +420,7 @@ } } -void parse_bin(char *hexstr, char *fmt, ...) +static void parse_bin(char *hexstr, char *fmt, ...) { va_list args; char *origstr; @@ -470,7 +471,7 @@ } /* MMC/SD information parsing functions */ -void print_sd_cid(struct config *config, char *cid) +static void print_sd_cid(struct config *config, char *cid) { static const char *months[] = { "jan", "feb", "mar", "apr", "may", "jun", @@ -528,7 +529,7 @@ } } -void print_mmc_cid(struct config *config, char *cid) +static void print_mmc_cid(struct config *config, char *cid) { static const char *months[] = { "jan", "feb", "mar", "apr", "may", "jun", @@ -602,7 +603,7 @@ } } -void print_sd_csd(struct config *config, char *csd) +static void print_sd_csd(struct config *config, char *csd) { unsigned int csd_structure; unsigned int taac_timevalue; @@ -1941,128 +1942,7 @@ } } -char *speed_class_speed(unsigned char id, bool ddr) -{ - if (ddr) { - switch (id) { - case 0x00: return "<4.8MB/s"; - case 0x08: return " 4.8MB/s"; - case 0x0a: return " 6.0MB/s"; - case 0x0f: return " 9.0MB/s"; - case 0x14: return "12.0MB/s"; - case 0x1e: return "18.0MB/s"; - case 0x28: return "24.0MB/s"; - case 0x32: return "30.0MB/s"; - case 0x3c: return "36.0MB/s"; - case 0x46: return "42.0MB/s"; - case 0x50: return "48.0MB/s"; - case 0x64: return "60.0MB/s"; - case 0x78: return "72.0MB/s"; - case 0x8c: return "84.0MB/s"; - case 0xa0: return "96.0MB/s"; - default: return "??.?MB/s"; - } - } else { - switch (id) { - case 0x00: return "<2.4MB/s"; - case 0x08: return " 2.4MB/s"; - case 0x0a: return " 3.0MB/s"; - case 0x0f: return " 4.5MB/s"; - case 0x14: return " 6.0MB/s"; - case 0x1e: return " 9.0MB/s"; - case 0x28: return "12.0MB/s"; - case 0x32: return "15.0MB/s"; - case 0x3c: return "18.0MB/s"; - case 0x46: return "21.0MB/s"; - case 0x50: return "24.0MB/s"; - case 0x64: return "30.0MB/s"; - case 0x78: return "36.0MB/s"; - case 0x8c: return "42.0MB/s"; - case 0xa0: return "48.0MB/s"; - default: return "??.?MB/s"; - } - } -} - -char speed_class_name(unsigned char id) -{ - switch (id) { - case 0x00: return '?'; - case 0x08: return 'A'; - case 0x0a: return 'B'; - case 0x0f: return 'C'; - case 0x14: return 'D'; - case 0x1e: return 'E'; - case 0x28: return 'F'; - case 0x32: return 'G'; - case 0x3c: return 'H'; - case 0x46: return 'J'; - case 0x50: return 'K'; - case 0x64: return 'M'; - case 0x78: return 'O'; - case 0x8c: return 'R'; - case 0xa0: return 'T'; - default: return '?'; - } -} - -char *power_class_consumption(unsigned int id, bool volt360) -{ - if (volt360) { - switch (id) { - case 0x0: return "100-200mA"; - case 0x1: return "120-220mA"; - case 0x2: return "150-250mA"; - case 0x3: return "180-280mA"; - case 0x4: return "200-300mA"; - case 0x5: return "220-320mA"; - case 0x6: return "250-350mA"; - case 0x7: return "300-400mA"; - case 0x8: return "350-450mA"; - case 0x9: return "400-500mA"; - case 0xa: return "450-550mA"; - default: return "reserved"; - } - } else { - switch (id) { - case 0x0: return "65-130mA"; - case 0x1: return "70-140mA"; - case 0x2: return "80-160mA"; - case 0x3: return "90-180mA"; - case 0x4: return "100-200mA"; - case 0x5: return "120-220mA"; - case 0x6: return "140-240mA"; - case 0x7: return "160-260mA"; - case 0x8: return "180-280mA"; - case 0x9: return "200-300mA"; - case 0xa: return "250-350mA"; - default: return "reserved"; - } - } -} - -char *sleep_consumption(unsigned int id) -{ - switch (id) { - case 0x00: return "not defined"; - case 0x01: return "2uA"; - case 0x02: return "4uA"; - case 0x03: return "8uA"; - case 0x04: return "16uA"; - case 0x05: return "32uA"; - case 0x06: return "64uA"; - case 0x07: return "128uA"; - case 0x08: return "0.256mA"; - case 0x09: return "0.512mA"; - case 0x0a: return "1.024mA"; - case 0x0b: return "2.048mA"; - case 0x0c: return "4.096mA"; - case 0x0d: return "8.192mA"; - default: return "reserved"; - } -} - -void print_sd_scr(struct config *config, char *scr) +static void print_sd_scr(struct config *config, char *scr) { unsigned int scr_structure; unsigned int sd_spec; @@ -2203,7 +2083,7 @@ } } -int process_dir(struct config *config, enum REG_TYPE reg) +static int process_dir(struct config *config, enum REG_TYPE reg) { char *type = NULL; char *reg_content = NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/mmc.1 new/mmc-utils-0.1+git.20240801/mmc.1 --- old/mmc-utils-0.1+git.20240307/mmc.1 1970-01-01 01:00:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/mmc.1 2024-08-01 12:49:20.000000000 +0200 @@ -0,0 +1,308 @@ +.TH mmc\-utils 1 "April 2024" "User Manual" +.SH NAME +mmc \- a tool for configuring MMC storage devices +.SH SYNOPSIS +.B mmc +[\fIoptions\fR] [\ mmc\-block\-device\fR]... +.SH DESCRIPTION +.B mmc-utils +is a single-threaded tool that will perform a specified type of mmc action as specified by the user. +.br +The typical use of mmc-utils is to access the mmc device either for configuring or reading its configuration registers. +.SH OPTIONS +.TP +.BI extcsd " " read " " \fIdevice\fR +Read and prints the extended csd register +.TP +.BI extcsd " " write " " \fIoffset\fR " " \fIvalue\fR " " \fIdevice\fR +Write \fIvalue\fR at \fIoffset\fR to the device's extcsd +.TP +.BI writeprotect " " boot " " get " " \fIdevice\fR +Print the boot partitions write protect status +.TP +.BI writeprotect " " boot " " set " " \fIdevice\fR " " [\fInumber\fR] +Set the boot partition write protect status for the device. +.br +If \fInumber\fR is passed (0 or 1), only protect that specified eMMC boot partition, otherwise protect both. +.br +It will be write-protected until the next boot. +.TP +.BI writeprotect " " user " " set " " \fItype\fR " " \fIstart\-block\fR " " \fIblocks\fR " " \fIdevice\fR +Set the write protect configuration for the specified region of the user area for the device. +.br +\fIstart\-block\fR specifies the first block of the protected area. +.br +\fIblocks\fR specifies the size of the protected area in blocks. +.br +NOTE! The area must start and end on Write Protect Group boundaries, Use the "writeprotect user get" command to get the Write Protect Group size. + \fItype\fR is one of the following: +.RS +.RS +.TP +.B none +Clear temporary write protection. +.TP +.B temp +Set temporary write protection. +.TP +.B pwron +Set write protection until the next power on. +.RE +.RE +.TP +.BI writeprotect " " user " " get " " \fIdevice\fR +Print the user area's write protect configuration for the device. +.TP +.BI disable " " 512B " " emulation " " \fIdevice\fR +Set the eMMC data sector size to 4KB by disabling emulation on the device. +.TP +.BI gp " " create " " \fIdry\-run\fR " " \fIlength\-KiB\fR " " \fIpartition\fR " " \fIenh\-attr\fR " " \fIext\-attr\fR " " \fIdevice\fR +Create general purpose partition for the device. +.br +NOTE! This is a one-time programmable (irreversible) change. +.br +To set enhanced attribute to general partition being created set \fIenh\-attr\fR to 1 else set it to 0. +.br +To set extended attribute to general partition set \fIenh\-attr\fR to 1,2 else set it to 0. +.br +\fIdry\-run\fR is one of the following: +.RS +.RS +.TP +.B \-y +PARTITION_SETTING_COMPLETED in the extcsd will get set and the partitioning operation will take effect and be finalized. +.TP +.B \-c +more partitioning settings are still to come - partitioning operation will not take effect. +.TP +.B otherwise +These changes will not take effect neither now nor after a power cycle. +.RE +.RE +.TP +.BI enh_area " " set " " \fIdry\-run\fR " " \fIstart\-KiB\fR " " \fIlength\-KiB\fR " " \fIdevice\fR +Enable the enhanced user area for the device. +.br +NOTE! This is a one-time programmable (irreversible) change. +\fIdry\-run\fR is as above. +.TP +.BI write_reliability " " set " " " \fIdry\-run\fR " " \fIpartition\fR " " \fIdevice\fR +Enable write reliability per partition for the device. +.br +NOTE! This is a one-time programmable (irreversible) change. +\fIdry\-run\fR is as above. +.TP +.BI status " " get " " \fIdevice\fR +Print the response to STATUS_SEND (CMD13). +.TP +.BI bootpart " " enable " " \fIboot\-partition\fR " " \fIsend\-ackn\fR " " \fIdevice\fR +Enable the boot partition for the device. +Disable the boot partition for the device if is \fIboot\-partition\fR set to 0. +.br +To receive acknowledgment of boot from the card set \fIsend\-ackn\fR to 1, else set it to 0. +.TP +.BI bootbus " " set " " \fIboot\-mode\fR " " \fIreset\-boot\-bus\-conditions\fR " " \fIboot\-bus\-width\fR " " \fIdevice\fR +Set Boot Bus Conditions. +.br +\fIboot\-mode\fR is one of the following: single_backward, single_hs, or dual. +.br +\fIreset\-boot\-bus\-conditions\fR is one of the following: x1 or retain. +.br +\fIboot\-bus\-width\fR is one of the following: x1, x4, or x8. +.TP +.BI bkops_en " " \fImode\fR " " \fIdevice\fR +Enable the eMMC BKOPS feature on the device. +The auto (AUTO_EN) setting is only supported on eMMC 5.0 or newer. +.br +NOTE! Setting manual (MANUAL_EN) is one-time programmable (irreversible) change. +.br +\fImode\fR is one of the following: +.RS +.RS +.TP +.B auto +Auto bkops is set +.TP +.B manual +Manual bkops is set +.RE +.RE +.TP +.BI hwreset " " enable " " \fIdevice\fR +Permanently enable the eMMC H/W Reset feature on the device. +.br +NOTE! This is a one-time programmable (irreversible) change. +.TP +.BI hwreset " " disable " " \fIdevice\fR +Permanently disable the eMMC H/W Reset feature on the device. +.br +NOTE! This is a one-time programmable (irreversible) change. +.TP +.BI sanitize " " \fIdevice\fR " " \fI[timeout_ms]\fR +Send Sanitize command to the device. +This will delete the unmapped memory region of the device. +.TP +.BI rpmb " " write\-key " " \fIrpmb\-device\fR " " \fIkey\-file\fR +Program authentication key which is 32 bytes length and stored in the specified file. +.br +Also you can specify '-' instead of key file path to read the key from stdin. +.br +NOTE! This is a one-time programmable (irreversible) change. +.TP +.BI rpmb " " read\-counter " " \fIrpmb\-device\fR +Counter value for the \fIrpmb\-device\fR will be read to stdout. +.TP +.BI rpmb " " read\-block " " \fIrpmb\-device\fR " " \fIaddress\fR " " \fIblocks-\count\fR " " \fIoutput-\file\fR " " [\fIkey\-file\fR] +Blocks of 256 bytes will be read from \fIrpmb\-device\fR to output +file or stdout if '-' is specified. If key is specified - read +data will be verified. +.TP +.BI rpmb " " write\-block " " \fIrpmb\-device\fR " " \fIaddress\fR " " \fI256\-byte\-data\-file\fR " " \fIkey\-file\fR +Block of 256 bytes will be written from data file to +\fIrpmb\-device\fR. +.br +Also you can specify '-' instead of key file path or data file to read the data from stdin. +.TP +.BI cache " " enable " " \fIdevice\fR +Enable the eMMC cache feature on the device. +.br +NOTE! The cache is an optional feature on devices >= eMMC4.5. +.TP +.BI cache " " disable " " \fIdevice\fR +Disable the eMMC cache feature on the device. +.br +NOTE! The cache is an optional feature on devices >= eMMC4.5. +.TP +.BI csd " " read " " \fidevice\-path\fR +Print CSD data from \fIdevice\-path\fR. +The device path should specify the csd sysfs file directory. +.TP +.BI cid " " read " " \fIdevice\-path\fR +Print CID data from \fIdevice\-path\fR. +The device path should specify the cid sysfs file directory. +.TP +.BI scr " " read " " \fIdevice\-path\fR +Print SCR data from \fIdevice\-path\fR. +The device path should specify the scr sysfs file directory. +.TP +.BI ffu " " \fIimage\-file\-name\fR " " \fIdevice\fR " " [\fIchunk\-bytes\fR] +Run Field Firmware Update with \fIimage\-file\-name\fR on the device. +.br +[\fIchunk\-bytes\fR] is optional and defaults to its max - 512k. should be in decimal bytes and sector aligned. +.br +if [\fIchunk\-bytes\fR] is omitted, mmc-utils will try to run ffu using the largest possible chunks: max(image-file, 512k). +.TP +.BI erase " " \fItype\fR " " \fIstart-address\fR " " \fIend\-address\fR " " \fIdevice\fR +Send Erase CMD38 with specific argument to the device. +.br +NOTE!: This will delete all user data in the specified region of the device. +.br +\fItype\fR is one of the following: legacy, discard, secure-erase, secure-trim1, secure-trim2, or trim. +.TP +.BI gen_cmd " " read " \fidevice\fR [\fIarg\fR] +Send GEN_CMD (CMD56) to read vendor-specific format/meaning data from the device. +.br +NOTE!: [\fIarg\fR] is optional and defaults to 0x1. If [\fIarg\fR] is specified, then [\fIarg\fR] +must be a 32-bit hexadecimal number, prefixed with 0x/0X. And bit0 in [\fIarg\fR] must be 1. +Normally this command is aimed to extract a device-health info from the device. +.TP +.BI softreset " " \fIdevice\fR +Issues a CMD0 softreset, e.g. for testing if hardware reset for UHS works +.TP +.BI boot_operation " " \fIboot\-data\-file\fR " " \fIdevice\fR + Does the alternative boot operation and writes the specified starting blocks of boot data into the requested file. +Note some limitations: +.RS +.RS +.TP +.B 1) +The boot operation must be configured first, e.g. via bootbus and/or bootpart commands +.TP +.B 2) +The MMC must currently be running at the bus mode that is configured for the boot operation (HS200 and HS400 not supported at all). +.TP +.B 3) +Only up to 512K bytes of boot data will be transferred. +.TP +.B 4) +The MMC will perform a soft reset, if your system cannot handle that do not use the boot operation from mmc-utils. +.RE +.RE +.TP +.BI \-\-help " " | " " help " " | " " \-h +Show the help +.TP +.BI \fIcmd\fR " " \-\-help +Show detailed help for that specific \fIcmd\fR or subset of commands. +.SH "RPMB COMMANDS" +The RPMB partition on the eMMC devices is a special area used for storing cryptographically safe information signed by a +special secret key. +.br +To write and read records from this special area, authentication is needed. +.br +The RPMB area is *only* and *exclusively* accessed using ioctl()s from user-space. +.br +RPMB commands are send using the mmc multi-ioctl, thus ensures that the atomic nature of the rpmb access operation. +.br +The rpmb device given as a parameter to the rpmb commands is not a block device but a char device. +.br +This was done to help the mmc driver to account for some of the rpmb peculiarities. +.SH "EXAMPLES" +.RE +.P +.B RPMB examples +.RS +Program rpmb key using the stdin option: +.RS +.P +$ echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH | mmc rpmb write-key /dev/mmcblk0rpmb - +.RE +.P +Read 2 blocks starting address 2 and output the received content to stdout. Verify the received frames using the key (not mandatory): +.RS +.P +$ echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH | mmc rpmb read-block /dev/mmcblk0rpmb 0x02 2 - +.RE +.P +Read 2 blocks without verification starting address 2 and output the received content to /tmp/block: +.RS +.P +$mmc rpmb read-block /dev/mmcblk0rpmb 0x02 2 /tmp/block +.RE +.P +Write a string of 'a's to address 2. both the input and key uses stdin interface: +.RS +.P +$ (awk 'BEGIN {while (c++<256) printf "a"}' | echo -n AAAABBBBCCCCDDDDEEEEFFFFGGGGHHHH) | mmc rpmb write-block /dev/mmcblk0rpmb 0x02 - - +.RE +.P +.RE +.P +.B Field Firmware Update (ffu) examples +.RS +Do ffu using max-possible chunk size: If the fluf size < 512k, it will be flushed in a single write sequence. +.RS +.P +$ mmc ffu IO4e0aC2056001801M1100042AE1.fluf /dev/mmcblk0 +.RE +.P +Same as above, this time use a 4k chunks: +.RS +.P +$ mmc ffu IO4e0aC2056001801M1100042AE1.fluf /dev/mmcblk0 4096 +.RE +.P +.RE +.SH AUTHORS +.B mmc-utils +was written by Chris Ball <[email protected]> and <[email protected]>. +.br +It is currently maintained by Ulf Hansson <[email protected]>. +.SH "REPORTING BUGS" +Report bugs to the \fBmmc\fR mailing list <[email protected]>. +.SH "SEE ALSO" +For further documentation see \fBREADME\fR. +.br +A short intro - https://docs.kernel.org/driver-api/mmc/mmc-tools.html +.br +official git tree - https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/mmc.c new/mmc-utils-0.1+git.20240801/mmc.c --- old/mmc-utils-0.1+git.20240307/mmc.c 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/mmc.c 2024-08-01 12:49:20.000000000 +0200 @@ -272,7 +272,7 @@ "4. The MMC will perform a soft reset, if your system cannot handle that do not use the boot operation from mmc-utils.\n", NULL }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, NULL } }; static char *get_prgname(char *programname) @@ -324,10 +324,10 @@ static int split_command(char *cmd, char ***commands) { - int c, l; - char *p, *s; + int c, l; + char *p, *s; - for( *commands = 0, l = c = 0, p = s = cmd ; ; p++, l++ ){ + for (*commands = NULL, l = c = 0, p = s = cmd ; ; p++, l++) { if ( *p && *p != ' ' ) continue; @@ -340,7 +340,7 @@ if( !*p ) break; } - (*commands)[c] = 0; + (*commands)[c] = NULL; return c; } @@ -444,7 +444,7 @@ int *nargs_, char **cmd_, char ***args_ ) { struct Command *cp; - struct Command *matchcmd=0; + struct Command *matchcmd = NULL; char *prgname = get_prgname(argv[0]); int i=0, helprequested=0; @@ -535,9 +535,9 @@ } int main(int ac, char **av ) { - char *cmd=0, **args=0; - int nargs=0, r; - CommandFunction func=0; + char *cmd = NULL, **args = NULL; + int nargs = 0, r; + CommandFunction func = NULL; r = parse_args(ac, av, &func, &nargs, &cmd, &args); if( r <= 0 ){ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mmc-utils-0.1+git.20240307/mmc_cmds.c new/mmc-utils-0.1+git.20240801/mmc_cmds.c --- old/mmc-utils-0.1+git.20240307/mmc_cmds.c 2024-03-07 11:59:00.000000000 +0100 +++ new/mmc-utils-0.1+git.20240801/mmc_cmds.c 2024-08-01 12:49:20.000000000 +0200 @@ -63,7 +63,7 @@ return arr[0] | arr[1] << 8 | arr[2] << 16 | arr[3] << 24; } -int read_extcsd(int fd, __u8 *ext_csd) +static int read_extcsd(int fd, __u8 *ext_csd) { int ret = 0; struct mmc_ioc_cmd idata; @@ -93,7 +93,8 @@ cmd->flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; } -int write_extcsd_value(int fd, __u8 index, __u8 value, unsigned int timeout_ms) +static int +write_extcsd_value(int fd, __u8 index, __u8 value, unsigned int timeout_ms) { int ret = 0; struct mmc_ioc_cmd idata = {}; @@ -110,7 +111,7 @@ return ret; } -int send_status(int fd, __u32 *response) +static int send_status(int fd, __u32 *response) { int ret = 0; struct mmc_ioc_cmd idata; @@ -744,7 +745,7 @@ return ret; } -int do_hwreset(int value, int nargs, char **argv) +static int do_hwreset(int value, int nargs, char **argv) { __u8 ext_csd[512]; int fd, ret; @@ -972,7 +973,7 @@ return ret; } -unsigned int get_sector_count(__u8 *ext_csd) +static unsigned int get_sector_count(__u8 *ext_csd) { return (ext_csd[EXT_CSD_SEC_COUNT_3] << 24) | (ext_csd[EXT_CSD_SEC_COUNT_2] << 16) | @@ -980,7 +981,7 @@ ext_csd[EXT_CSD_SEC_COUNT_0]; } -int is_blockaddresed(__u8 *ext_csd) +static int is_blockaddresed(__u8 *ext_csd) { unsigned int sectors = get_sector_count(ext_csd); @@ -988,18 +989,19 @@ return (sectors > (2u * 1024 * 1024 * 1024) / 512); } -unsigned int get_hc_wp_grp_size(__u8 *ext_csd) +static unsigned int get_hc_wp_grp_size(__u8 *ext_csd) { return ext_csd[221]; } -unsigned int get_hc_erase_grp_size(__u8 *ext_csd) +static unsigned int get_hc_erase_grp_size(__u8 *ext_csd) { return ext_csd[224]; } -int set_partitioning_setting_completed(int dry_run, const char * const device, - int fd) +static int +set_partitioning_setting_completed(int dry_run, const char *const device, + int fd) { int ret; @@ -1047,7 +1049,7 @@ return 0; } -int check_enhanced_area_total_limit(const char * const device, int fd) +static int check_enhanced_area_total_limit(const char *const device, int fd) { __u8 ext_csd[512]; __u32 regl; @@ -2267,7 +2269,7 @@ return ret; } -int rpmb_read_counter(int dev_fd, unsigned int *cnt) +static int rpmb_read_counter(int dev_fd, unsigned int *cnt) { int ret; struct rpmb_frame frame_in = { @@ -2589,7 +2591,7 @@ return ret; } -int do_cache_ctrl(int value, int nargs, char **argv) +static int do_cache_ctrl(int value, int nargs, char **argv) { __u8 ext_csd[512]; int fd, ret; ++++++ mmc-utils.obsinfo ++++++ --- /var/tmp/diff_new_pack.z27FAL/_old 2024-08-26 22:13:58.955418382 +0200 +++ /var/tmp/diff_new_pack.z27FAL/_new 2024-08-26 22:13:58.959418549 +0200 @@ -1,5 +1,5 @@ name: mmc-utils -version: 0.1+git.20240307 -mtime: 1709809140 -commit: e1281d4de9166b7254ba30bb58f9191fc2c9e7fb +version: 0.1+git.20240801 +mtime: 1722509360 +commit: 123fd8b2ac3933be1319486fb1f32236a4a86a7c
