Merge branch '2021-03-17-assorted-fixes'
- Make tests search /sbin for tools, don't use ENODATA in host tools to
be more portable, avb fix when partition isn't found and a bugfix for
mediatek mmc.
diff --git a/common/avb_verify.c b/common/avb_verify.c
index db10d0f..0520a71 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -369,7 +369,7 @@
}
ret = part_get_info_by_name(mmc_blk, partition, &part->info);
- if (!ret) {
+ if (ret < 0) {
printf("Can't find partition '%s'\n", partition);
goto err;
}
diff --git a/common/image-fit.c b/common/image-fit.c
index 28b3d2b..94501b1 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1651,7 +1651,7 @@
/* mandatory / node 'timestamp' property */
if (!fdt_getprop(fit, 0, FIT_TIMESTAMP_PROP, NULL)) {
log_debug("Wrong FIT format: no timestamp\n");
- return -ENODATA;
+ return -EBADMSG;
}
}
diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c
index 3b9c122..48a764b 100644
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -1639,7 +1639,8 @@
else
cfg->f_min = host->src_clk_freq / (4 * 4095);
- cfg->f_max = host->src_clk_freq;
+ if (cfg->f_max < cfg->f_min || cfg->f_max > host->src_clk_freq)
+ cfg->f_max = host->src_clk_freq;
cfg->b_max = 1024;
cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
diff --git a/include/image.h b/include/image.h
index 138c83d..b4b284d 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1158,7 +1158,7 @@
* @fit: pointer to the FIT format image header
* @return 0 if OK, -ENOEXEC if not an FDT file, -EINVAL if the full FDT check
* failed (e.g. due to bad structure), -ENOMSG if the description is
- * missing, -ENODATA if the timestamp is missing, -ENOENT if the /images
+ * missing, -EBADMSG if the timestamp is missing, -ENOENT if the /images
* path is missing
*/
int fit_check_format(const void *fit, ulong size);
diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 9402796..9bed2f4 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -414,6 +414,8 @@
if os.path.exists(persistent):
c.log.action('Disk image file ' + persistent + ' already exists')
else:
+ # Some distributions do not add /sbin to the default PATH, where mkfs.ext4 lives
+ os.environ["PATH"] += os.pathsep + '/sbin'
try:
u_boot_utils.run_and_log(c, 'dd if=/dev/zero of=%s bs=1M count=16' % persistent)
u_boot_utils.run_and_log(c, 'mkfs.ext4 %s' % persistent)