git: b8155c2990b0 - main - sysutils/mmc-utils: Update to 20211130 version

From: Marius Strobl <marius_at_FreeBSD.org>
Date: Sat, 18 Dec 2021 22:40:26 UTC
The branch main has been updated by marius:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b8155c2990b08d5f387d235f59299152f39fc162

commit b8155c2990b08d5f387d235f59299152f39fc162
Author:     Marius Strobl <marius@FreeBSD.org>
AuthorDate: 2021-12-18 22:27:50 +0000
Commit:     Marius Strobl <marius@FreeBSD.org>
CommitDate: 2021-12-18 22:40:19 +0000

    sysutils/mmc-utils: Update to 20211130 version
---
 sysutils/mmc-utils/Makefile                |  4 ++--
 sysutils/mmc-utils/distinfo                |  6 ++---
 sysutils/mmc-utils/files/patch-man_mmc.1   |  4 ++--
 sysutils/mmc-utils/files/patch-mmc.c       | 18 ++++++++++++++
 sysutils/mmc-utils/files/patch-mmc.h       |  2 +-
 sysutils/mmc-utils/files/patch-mmc__cmds.c | 38 ++++++++++++++++++++++--------
 6 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/sysutils/mmc-utils/Makefile b/sysutils/mmc-utils/Makefile
index c12815178a01..c593023d166c 100644
--- a/sysutils/mmc-utils/Makefile
+++ b/sysutils/mmc-utils/Makefile
@@ -1,8 +1,8 @@
 # Created by: Marius Strobl <marius@FreeBSD.org>
 
 PORTNAME=	mmc-utils
-PORTVERSION=	20191004
-DISTVERSIONSUFFIX=	-73d6c59a
+PORTVERSION=	20211130
+DISTVERSIONSUFFIX=	-a1b233c2
 CATEGORIES=	sysutils
 MASTER_SITES=	LOCAL/marius
 
diff --git a/sysutils/mmc-utils/distinfo b/sysutils/mmc-utils/distinfo
index 9321537d587e..f978889f5446 100644
--- a/sysutils/mmc-utils/distinfo
+++ b/sysutils/mmc-utils/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1571606199
-SHA256 (mmc-utils-20191004-73d6c59a.tar.bz2) = ec15feab72548412cdbf6112b75ade526d6bfd39e237cef4253594d07346a4db
-SIZE (mmc-utils-20191004-73d6c59a.tar.bz2) = 40584
+TIMESTAMP = 1639857562
+SHA256 (mmc-utils-20211130-a1b233c2.tar.bz2) = 08580126453b7ca20988236030d98d5e59c82ebbd990a4b9bbf9a8b6dfaa59aa
+SIZE (mmc-utils-20211130-a1b233c2.tar.bz2) = 42512
diff --git a/sysutils/mmc-utils/files/patch-man_mmc.1 b/sysutils/mmc-utils/files/patch-man_mmc.1
index 421843e900a1..284d221c1326 100644
--- a/sysutils/mmc-utils/files/patch-man_mmc.1
+++ b/sysutils/mmc-utils/files/patch-man_mmc.1
@@ -1,6 +1,6 @@
---- man/mmc.1.orig	2018-02-26 22:10:51 UTC
+--- 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
+@@ -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
  <device>.
  .TP
diff --git a/sysutils/mmc-utils/files/patch-mmc.c b/sysutils/mmc-utils/files/patch-mmc.c
new file mode 100644
index 000000000000..cf88845d082c
--- /dev/null
+++ b/sysutils/mmc-utils/files/patch-mmc.c
@@ -0,0 +1,18 @@
+--- mmc.c.orig	2021-12-18 19:59:21 UTC
++++ mmc.c
+@@ -229,6 +229,7 @@ static struct Command commands[] = {
+ 		"Run Field Firmware Update with <image name> on <device>.\n",
+ 	  NULL
+ 	},
++#if defined(__linux__)
+ 	{ do_erase, -4,
+ 	"erase", "<type> " "<start address> " "<end address> " "<device>\n"
+ 		"Send Erase CMD38 with specific argument to the <device>\n\n"
+@@ -237,6 +238,7 @@ static struct Command commands[] = {
+ 		"secure-trim1 | secure-trim2 | trim \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 06e2590edf25..b1b5eab3cb51 100644
--- a/sysutils/mmc-utils/files/patch-mmc.h
+++ b/sysutils/mmc-utils/files/patch-mmc.h
@@ -1,4 +1,4 @@
---- mmc.h.orig	2018-02-26 22:10:51 UTC
+--- mmc.h.orig	2021-12-18 19:59:21 UTC
 +++ mmc.h
 @@ -17,10 +17,26 @@
   * those modifications are Copyright (c) 2016 SanDisk Corp.
diff --git a/sysutils/mmc-utils/files/patch-mmc__cmds.c b/sysutils/mmc-utils/files/patch-mmc__cmds.c
index e58640a03985..fdac6beabd56 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	2018-12-26 19:54:04 UTC
+--- mmc_cmds.c.orig	2021-12-18 19:59:21 UTC
 +++ mmc_cmds.c
 @@ -28,7 +28,12 @@
  #include <errno.h>
@@ -33,7 +33,7 @@
  	if (res) {
  		fprintf(stderr, "Error getting device size, errno: %d\n",
  			errno);
-@@ -1530,13 +1546,18 @@ int do_read_extcsd(int nargs, char **arg
+@@ -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] */
  
@@ -53,12 +53,30 @@
  	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");
-@@ -1883,7 +1904,7 @@ static int do_rpmb_op(int fd,
- 	u_int16_t rpmb_type;
- 	struct mmc_ioc_multi_cmd *mioc;
- 	struct mmc_ioc_cmd *ioc;
--	struct rpmb_frame frame_status = {0};
-+	struct rpmb_frame frame_status = {{0}};
+@@ -1881,8 +1902,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]);
++#if defined(__linux__)
+ 		printf("Note: CMDQ_MODE_EN may not indicate the runtime CMDQ ON or OFF.\n"
+ 		       "Please check sysfs node '/sys/devices/.../mmc_host/mmcX/mmcX:XXXX/cmdq_en'\n");
++#endif
+ 	}
+ out_free:
+ 	return ret;
+@@ -2515,6 +2538,7 @@ int do_cache_dis(int nargs, char **argv)
+ 	return do_cache_ctrl(0, nargs, argv);
+ }
+ 
++#if defined(__linux__)
+ static int erase(int dev_fd, __u32 argin, __u32 start, __u32 end)
+ {
+ 	int ret = 0;
+@@ -2657,6 +2681,7 @@ out:
+ 	close(dev_fd);
+ 	return ret;
+ }
++#endif
+ 
  
- 	if (!frame_in || !frame_out || !out_cnt)
- 		return -EINVAL;
+ int do_ffu(int nargs, char **argv)