Skip to content

Commit

Permalink
sysutils/mmc-utils: Update to 20230807 version
Browse files Browse the repository at this point in the history
This improves the ffu command.

Approved by:	netchild
  • Loading branch information
sparcplug committed Sep 19, 2023
1 parent 7506188 commit 1446317
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions sysutils/mmc-utils/Makefile
@@ -1,5 +1,5 @@
PORTNAME= mmc-utils
DISTVERSION= 20230612
DISTVERSION= 20230807
DISTVERSIONSUFFIX= -${MMC_GITSHASH}
CATEGORIES= sysutils
MASTER_SITES= https://git.kernel.org/pub/scm/utils/mmc/mmc-utils.git/snapshot/${MMC_GITHASH}${EXTRACT_SUFX}?dummy=/
Expand All @@ -13,7 +13,7 @@ LICENSE_COMB= multi

IGNORE_DragonFly= only supported on FreeBSD
CFLAGS+= -DVERSION='\"${MMC_GITSHASH}\"'
MMC_GITHASH= 6d593efc3cd00e4debd0ffc5806246390dc66242
MMC_GITHASH= 613495ecaca97a19fa7f8f3ea23306472b36453c
MMC_GITSHASH= ${MMC_GITHASH:C/^(........).*/\1/}
PLIST_FILES= man/man1/mmc.1.gz sbin/mmc
USES= gmake
Expand Down
6 changes: 3 additions & 3 deletions sysutils/mmc-utils/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1689355687
SHA256 (mmc-utils-20230612-6d593efc.tar.gz) = 9f1088b316762d10b3785ed84f1fbc075d63a3c3d0d72e4effb569e87d2cac34
SIZE (mmc-utils-20230612-6d593efc.tar.gz) = 50537
TIMESTAMP = 1695128311
SHA256 (mmc-utils-20230807-613495ec.tar.gz) = 1d45d75ac4c1178c4f33c9f0e63b5c9f87cf1442a00e9033b2cbba919549825d
SIZE (mmc-utils-20230807-613495ec.tar.gz) = 50739
26 changes: 13 additions & 13 deletions sysutils/mmc-utils/files/patch-mmc__cmds.c
@@ -1,4 +1,4 @@
--- mmc_cmds.c.orig 2023-02-09 14:16:51 UTC
--- mmc_cmds.c.orig 2023-08-07 11:14:42 UTC
+++ mmc_cmds.c
@@ -28,7 +28,12 @@
#include <errno.h>
Expand All @@ -13,10 +13,10 @@

#include "mmc.h"
#include "mmc_cmds.h"
@@ -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;
@@ -95,8 +100,15 @@ int write_extcsd_value(int fd, __u8 index, __u8 value,

fill_switch_cmd(&idata, index, value);

+#if defined(__FreeBSD__)
+ if (timeout_ms != 0) {
+ fprintf(stderr, "Command timeout not supported\n");
Expand All @@ -29,7 +29,7 @@

ret = ioctl(fd, MMC_IOC_CMD, &idata);
if (ret)
@@ -121,8 +133,19 @@ static __u32 get_size_in_blks(int fd)
@@ -128,8 +140,19 @@ static __u32 get_size_in_blks(int fd)
{
int res;
int size;
Expand All @@ -49,7 +49,7 @@
if (res) {
fprintf(stderr, "Error getting device size, errno: %d\n",
errno);
@@ -1974,8 +1997,10 @@ int do_read_extcsd(int nargs, char **argv)
@@ -1981,8 +2004,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]);
Expand All @@ -60,31 +60,31 @@
}
out_free:
return ret;
@@ -2646,6 +2671,7 @@ int do_cache_dis(int nargs, char **argv)
@@ -2648,6 +2673,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;
@@ -2800,6 +2826,7 @@ out:
@@ -2802,6 +2828,7 @@ out:
close(dev_fd);
return ret;
}
+#endif


int do_ffu(int nargs, char **argv)
@@ -3145,6 +3172,7 @@ int do_preidle(int nargs, char **argv)
static void set_ffu_single_cmd(struct mmc_ioc_multi_cmd *multi_cmd,
__u8 *ext_csd, unsigned int bytes, __u8 *buf,
@@ -3137,6 +3164,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:
@@ -3239,3 +3267,4 @@ dev_fd_close:
exit(1);
return 0;
}
Expand Down

0 comments on commit 1446317

Please sign in to comment.