summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-03-18 12:53:35 -0400
committerTom Rini <trini@konsulko.com>2021-03-18 12:53:35 -0400
commitd65bd5707324b11b4cf95c47b482252d3ea803a4 (patch)
treef0711e70e00a1eaacdcc135ace17a61ab469cbd1
parenteed127dbd4082ba21fd420449e68d1ad177cdc4b (diff)
parent9262fe15599a388e365cca3091e4852be8f23f11 (diff)
downloadu-boot-d65bd5707324b11b4cf95c47b482252d3ea803a4.tar.gz
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.
-rw-r--r--common/avb_verify.c2
-rw-r--r--common/image-fit.c2
-rw-r--r--drivers/mmc/mtk-sd.c3
-rw-r--r--include/image.h2
-rw-r--r--test/py/tests/test_env.py2
5 files changed, 7 insertions, 4 deletions
diff --git a/common/avb_verify.c b/common/avb_verify.c
index db10d0f21f..0520a71455 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -369,7 +369,7 @@ static struct mmc_part *get_partition(AvbOps *ops, const char *partition)
}
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 28b3d2b191..94501b1071 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1651,7 +1651,7 @@ int fit_check_format(const void *fit, ulong size)
/* 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 3b9c12266a..48a764be82 100644
--- a/drivers/mmc/mtk-sd.c
+++ b/drivers/mmc/mtk-sd.c
@@ -1639,7 +1639,8 @@ static int msdc_drv_probe(struct udevice *dev)
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 138c83dd28..b4b284d52b 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1158,7 +1158,7 @@ int fit_image_check_comp(const void *fit, int noffset, uint8_t comp);
* @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 940279651d..9bed2f48d7 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -414,6 +414,8 @@ def mk_env_ext4(state_test_env):
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)