From nobody Sat Apr 15 19:02:05 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PzN3K5Xwhz44scV; Sat, 15 Apr 2023 19:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PzN3K550pz447F; Sat, 15 Apr 2023 19:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681585325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E0LYKux10czamXFVLKJyTfo/0R/gH/E3XRTTRSbB8JI=; b=eD2t8YCqWkfOvDWOOtxerY2jzu3IugPhOPgpT4VxWCsJE59RUjZbc5wTztcoHLGein3kra 8U4pWM8FqjOOHgIeLWeYHJunrQxIcZ8BP7z6MQ4abXdElb5udxATmxW1MQbDBm7cFGd7kT W7wuIdUQFJEP+jfHRMOlGcKmmgu/5eHXucGg6krMGLS/SR1eGt3mRTUJ6VC48Sn9GSTqGl KR+aszVxg1/G/SnryfJm6Mmb1OFRaLEmI8MtG9LM1aZhsWg61PPg7pOolx+oVsDd+ZvVdG EDSQ0Se3u2VyVmAIqlPfh9fSbaZx96edPWVCb6+9+XHjvGQdwLIu04qgsGKjcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681585325; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E0LYKux10czamXFVLKJyTfo/0R/gH/E3XRTTRSbB8JI=; b=O/flx7i7FdPvagkv8BvfmwkW/G2rXpqsg8Z+LcszSeAYqohHofU8c0drH0PqEdG2LbJa64 LitSOcUEpoQ3HVpTlQs1uqoJ+e6mOXT7Qc3hPWmmv84gD/PIzqv3p365nPsUAhZpwqkzXy 1VIs/yAa86kmCnGij2BZ6H/ue52p04U4psd8QzjDeGe/Q9p2xUfZe6v3WRAUJi4Vkv9nrj v9TUflsP6+SQUnqyu2z4fJXpJF+ceFXhLR1NUv/qLYNSc0a+oeJvSzPCkyk3S8TR1OdlLX yTRXbANHUWgk83wp++eaGAoRX6K4wG/dO2rssE0Wfj+32f8Dc8MWHOBs04C6+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681585325; a=rsa-sha256; cv=none; b=MnzZOsdq5qpIdaCCv9wGhsf8JE0Eoenqf5ESQcrnKwzWqaDw5xvuKVWi2QqxwuioOlLdPj WYhqdMnO4JyuMHlSzsiQM8rNCwRlexdcy1ld8EuopNdDrncv1Xff09uA1udg2sXq8Nvl/S CyCon2Rk8gwfudS1ovTEgEkRBuwvHXKN67lTKbwTbLWoTlmZjwmYXlKXbyO4b1aK6PIoJH 1Ldeb7z4VaBqqxMKlrY9Qe/xVhTX2cnNZEAapqb0BkJ0tYumwnR68KISNNFxBzlmAdkv6+ cb7Dld8Y0y0vaMCL3F0flcXsMqLOPKhpaBDuVfuD1EaJtrSMdAgVL5VBgMcarg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PzN3K47f4zHWc; Sat, 15 Apr 2023 19:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33FJ25GN055051; Sat, 15 Apr 2023 19:02:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33FJ25l5055050; Sat, 15 Apr 2023 19:02:05 GMT (envelope-from git) Date: Sat, 15 Apr 2023 19:02:05 GMT Message-Id: <202304151902.33FJ25l5055050@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Marius Strobl Subject: git: ddc0ad6b45d6 - main - sysutils/mmc-utils: Update to 20230209 version List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marius X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddc0ad6b45d697222d335985d7a44ecfc04532ca Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by marius: URL: https://cgit.FreeBSD.org/ports/commit/?id=ddc0ad6b45d697222d335985d7a44ecfc04532ca commit ddc0ad6b45d697222d335985d7a44ecfc04532ca Author: Marius Strobl AuthorDate: 2023-04-14 20:54:46 +0000 Commit: Marius Strobl CommitDate: 2023-04-15 19:01:47 +0000 sysutils/mmc-utils: Update to 20230209 version This loops back some local fixes and enhancements but also brings initial support for writing EXT_CSD values and GEN_CMD (CMD56) read support, both for vendor-specific bits. Also: - Use more up-to-date location for WWW and pkg-descr. - Take back port. Approved by: netchild --- sysutils/mmc-utils/Makefile | 8 ++-- sysutils/mmc-utils/distinfo | 6 +-- sysutils/mmc-utils/files/patch-man_mmc.1 | 33 ----------------- sysutils/mmc-utils/files/patch-mmc.c | 22 +++++++++-- sysutils/mmc-utils/files/patch-mmc.h | 12 ++---- sysutils/mmc-utils/files/patch-mmc__cmds.c | 59 +++++++++++++++++------------- sysutils/mmc-utils/pkg-descr | 2 +- 7 files changed, 65 insertions(+), 77 deletions(-) diff --git a/sysutils/mmc-utils/Makefile b/sysutils/mmc-utils/Makefile index bfb7a0290b5e..031e7befa88d 100644 --- a/sysutils/mmc-utils/Makefile +++ b/sysutils/mmc-utils/Makefile @@ -1,18 +1,18 @@ PORTNAME= mmc-utils -DISTVERSION= 20211202 +DISTVERSION= 20230209 DISTVERSIONSUFFIX= -${MMC_GITSHASH} CATEGORIES= sysutils MASTER_SITES= https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/snapshot/${MMC_GITHASH}${EXTRACT_SUFX}?dummy=/ -MAINTAINER= ports@FreeBSD.org +MAINTAINER= marius@FreeBSD.org COMMENT= Userspace tools for MMC/SD devices -WWW= https://www.kernel.org/doc/Documentation/mmc/mmc-tools.txt +WWW= https://www.kernel.org/doc/html/latest/driver-api/mmc/mmc-tools.html LICENSE= BSD3CLAUSE GPLv2 LICENSE_COMB= multi IGNORE_DragonFly= only supported on FreeBSD -MMC_GITHASH= a1b233c2a31baa5b77cb67c0c3be4767be86f727 +MMC_GITHASH= d4c2910981ff99b983734426dfa99632fb81ac6b MMC_GITSHASH= ${MMC_GITHASH:C/^(........).*/\1/} PLIST_FILES= man/man1/mmc.1.gz sbin/mmc USES= gmake diff --git a/sysutils/mmc-utils/distinfo b/sysutils/mmc-utils/distinfo index 7278400b05f9..f98908a6048e 100644 --- a/sysutils/mmc-utils/distinfo +++ b/sysutils/mmc-utils/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1639924509 -SHA256 (mmc-utils-20211202-a1b233c2.tar.gz) = fb275b57353bb53ff97d9ba4716928ed159341a1e1539f6face40bc63b39e674 -SIZE (mmc-utils-20211202-a1b233c2.tar.gz) = 47220 +TIMESTAMP = 1676241599 +SHA256 (mmc-utils-20230209-d4c29109.tar.gz) = ba1414aaa31d87f0c37b6a8ddf6da67af4776a2e6b05c165d4d6d53294c7a628 +SIZE (mmc-utils-20230209-d4c29109.tar.gz) = 50506 diff --git a/sysutils/mmc-utils/files/patch-man_mmc.1 b/sysutils/mmc-utils/files/patch-man_mmc.1 deleted file mode 100644 index 284d221c1326..000000000000 --- a/sysutils/mmc-utils/files/patch-man_mmc.1 +++ /dev/null @@ -1,33 +0,0 @@ ---- man/mmc.1.orig 2021-12-18 19:59:21 UTC -+++ man/mmc.1 -@@ -30,21 +30,24 @@ This sets the eMMC to be write-protected until next bo - Set the eMMC data sector size to 4KB by disabling emulation on - . - .TP --.BR "gp create <-y|-n> " -+.BR "gp create <-y|-n|-c> " - create general purpose partition for the . --Dry-run only unless -y is passed. -+Dry-run only unless -y or -c is passed. -+Use -c if more partitioning settings are still to come. - To set enhanced attribute to general partition being created set to 1 else set it to 0. - To set extended attribute to general partition set to 1,2 else set it to 0. - NOTE! This is a one-time programmable (unreversible) change. - .TP --.BR "enh_area set <-y|-n> " -+.BR "enh_area set <-y|-n|-c> " - Enable the enhanced user area for the . --Dry-run only unless -y is passed. -+Dry-run only unless -y or -c is passed. -+Use -c if more partitioning settings are still to come. - NOTE! This is a one-time programmable (unreversible) change. - .TP --.BR "write_reliability set <-y|-n> " -+.BR "write_reliability set <-y|-n|-c> " - Enable write reliability per partition for the . --Dry-run only unless -y is passed. -+Dry-run only unless -y or -c is passed. -+Use -c if more partitioning settings are still to come. - NOTE! This is a one-time programmable (unreversible) change. - .TP - .BR "status get " diff --git a/sysutils/mmc-utils/files/patch-mmc.c b/sysutils/mmc-utils/files/patch-mmc.c index cf88845d082c..0255a194a82d 100644 --- a/sysutils/mmc-utils/files/patch-mmc.c +++ b/sysutils/mmc-utils/files/patch-mmc.c @@ -1,6 +1,6 @@ ---- mmc.c.orig 2021-12-18 19:59:21 UTC +--- mmc.c.orig 2023-02-09 14:16:51 UTC +++ mmc.c -@@ -229,6 +229,7 @@ static struct Command commands[] = { +@@ -234,6 +234,7 @@ static struct Command commands[] = { "Run Field Firmware Update with on .\n", NULL }, @@ -8,10 +8,26 @@ { do_erase, -4, "erase", " " " " " " "\n" "Send Erase CMD38 with specific argument to the \n\n" -@@ -237,6 +238,7 @@ static struct Command commands[] = { +@@ -242,6 +243,7 @@ static struct Command commands[] = { "secure-trim1 | secure-trim2 | trim \n", NULL }, ++#endif + { do_general_cmd_read, -1, + "gen_cmd read", " [arg]\n" + "Send GEN_CMD (CMD56) to read vendor-specific format/meaning data from \n\n" +@@ -260,6 +262,7 @@ static struct Command commands[] = { + "Issues a CMD0 GO_PRE_IDLE", + NULL + }, ++#if defined(__linux__) + { do_alt_boot_op, -1, + "boot_operation", " \n" + "Does the alternative boot operation and writes the specified starting blocks of boot data into the requested file.\n\n" +@@ -272,6 +275,7 @@ static struct Command commands[] = { + "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 + }, +#endif { 0, 0, 0, 0 } }; diff --git a/sysutils/mmc-utils/files/patch-mmc.h b/sysutils/mmc-utils/files/patch-mmc.h index b1b5eab3cb51..9db6d8ec4374 100644 --- a/sysutils/mmc-utils/files/patch-mmc.h +++ b/sysutils/mmc-utils/files/patch-mmc.h @@ -1,10 +1,11 @@ ---- mmc.h.orig 2021-12-18 19:59:21 UTC +--- mmc.h.orig 2023-02-09 14:16:51 UTC +++ mmc.h -@@ -17,10 +17,26 @@ +@@ -17,8 +17,22 @@ * those modifications are Copyright (c) 2016 SanDisk Corp. */ +#if defined(__linux__) + #include #include +#elif defined(__FreeBSD__) +#include @@ -20,10 +21,5 @@ +typedef uint64_t __u64; +#endif -+#if 0 - /* From kernel linux/major.h */ - #define MMC_BLOCK_MAJOR 179 -+#endif - /* From kernel linux/mmc/mmc.h */ - #define MMC_SWITCH 6 /* ac [31:0] See below R1b */ + #define MMC_GO_IDLE_STATE 0 /* bc */ diff --git a/sysutils/mmc-utils/files/patch-mmc__cmds.c b/sysutils/mmc-utils/files/patch-mmc__cmds.c index fdac6beabd56..305e2ec7461f 100644 --- a/sysutils/mmc-utils/files/patch-mmc__cmds.c +++ b/sysutils/mmc-utils/files/patch-mmc__cmds.c @@ -1,4 +1,4 @@ ---- mmc_cmds.c.orig 2021-12-18 19:59:21 UTC +--- mmc_cmds.c.orig 2023-02-09 14:16:51 UTC +++ mmc_cmds.c @@ -28,7 +28,12 @@ #include @@ -13,7 +13,23 @@ #include "mmc.h" #include "mmc_cmds.h" -@@ -120,8 +125,19 @@ static __u32 get_size_in_blks(int fd) +@@ -88,8 +93,15 @@ int write_extcsd_value(int fd, __u8 index, __u8 value, + (value << 8) | + EXT_CSD_CMD_SET_NORMAL; + idata.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC; ++#if defined(__FreeBSD__) ++ if (timeout_ms != 0) { ++ fprintf(stderr, "Command timeout not supported\n"); ++ return -EOPNOTSUPP; ++ } ++#else + /* Kernel will set cmd_timeout_ms if 0 is set */ + idata.cmd_timeout_ms = timeout_ms; ++#endif + + ret = ioctl(fd, MMC_IOC_CMD, &idata); + if (ret) +@@ -121,8 +133,19 @@ static __u32 get_size_in_blks(int fd) { int res; int size; @@ -33,27 +49,7 @@ if (res) { fprintf(stderr, "Error getting device size, errno: %d\n", errno); -@@ -1605,13 +1621,18 @@ int do_read_extcsd(int nargs, char **argv) - /* A441/A43: reserved [197] [195] [193] [190] [188] - * [186] [184] [182] [180] [176] */ - -- if (ext_csd_rev >= 6) -+ if (ext_csd_rev >= 6) { - printf("I/O Driver Strength [DRIVER_STRENGTH: 0x%02x]\n", - ext_csd[197]); -+ printf("Enhanced Strobe mode [STROBE_SUPPORT: 0x%02x]\n", -+ ext_csd[184]); -+ } - - /* DEVICE_TYPE in A45, CARD_TYPE in A441 */ - reg = ext_csd[196]; - printf("Card Type [CARD_TYPE: 0x%02x]\n", reg); -+ if (reg & 0x80) printf(" HS400 Dual Data Rate eMMC @200MHz 1.2VI/O\n"); -+ if (reg & 0x40) printf(" HS400 Dual Data Rate eMMC @200MHz 1.8VI/O\n"); - if (reg & 0x20) printf(" HS200 Single Data Rate eMMC @200MHz 1.2VI/O\n"); - if (reg & 0x10) printf(" HS200 Single Data Rate eMMC @200MHz 1.8VI/O\n"); - if (reg & 0x08) printf(" HS Dual Data Rate eMMC @52MHz 1.2VI/O\n"); -@@ -1881,8 +1902,10 @@ int do_read_extcsd(int nargs, char **argv) +@@ -1974,8 +1997,10 @@ int do_read_extcsd(int nargs, char **argv) (ext_csd[EXT_CSD_CMDQ_DEPTH] & 0x1f) + 1); printf("Command Enabled [CMDQ_MODE_EN]: 0x%02x\n", ext_csd[EXT_CSD_CMDQ_MODE_EN]); @@ -64,7 +60,7 @@ } out_free: return ret; -@@ -2515,6 +2538,7 @@ int do_cache_dis(int nargs, char **argv) +@@ -2646,6 +2671,7 @@ int do_cache_dis(int nargs, char **argv) return do_cache_ctrl(0, nargs, argv); } @@ -72,7 +68,7 @@ static int erase(int dev_fd, __u32 argin, __u32 start, __u32 end) { int ret = 0; -@@ -2657,6 +2681,7 @@ out: +@@ -2800,6 +2826,7 @@ out: close(dev_fd); return ret; } @@ -80,3 +76,16 @@ int do_ffu(int nargs, char **argv) +@@ -3145,6 +3172,7 @@ int do_preidle(int nargs, char **argv) + return 0; + } + ++#if defined(__linux__) + int do_alt_boot_op(int nargs, char **argv) + { + int fd, ret, boot_data_fd; +@@ -3247,3 +3275,4 @@ dev_fd_close: + exit(1); + return 0; + } ++#endif diff --git a/sysutils/mmc-utils/pkg-descr b/sysutils/mmc-utils/pkg-descr index 78c85514c224..d55ec10587e9 100644 --- a/sysutils/mmc-utils/pkg-descr +++ b/sysutils/mmc-utils/pkg-descr @@ -2,7 +2,7 @@ MMC tools introduction ====================== There is one MMC test tools called mmc-utils, which is maintained by -Chris Ball, you can find it at the below public git repository: +Ulf Hansson, you can find it at the below public git repository: https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git Functions