mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-12-20 17:01:50 +01:00
spl: fat: load kernel image before args in falcon
Currently in falcon mode, the FS and raw mmc boot loads the args file first followed by the kernel image whereas others load in the opposite order. This inconsistency means falcon boot doesn't behave the same across various boot media. For example, in the case where the kernel file is a FIT with the kernel image present alongside the dtb and the args file is another DT, which DT should be picked? The one form the FIT or the one set by the args file? Currently this depends entirely on how the boot media handles falcon mode. Therefore, this patch enforces the load order of the kernel image first followed by the args file in FAT FS boot. So in the above example, the args file would take precedence. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Anshul Dalal <anshuld@ti.com>
This commit is contained in:
parent
d3074f3d69
commit
6b8e03a958
@ -119,15 +119,9 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
#if defined(CONFIG_SPL_ENV_SUPPORT) && defined(CONFIG_SPL_OS_BOOT)
|
||||
file = env_get("falcon_args_file");
|
||||
if (file) {
|
||||
err = file_fat_read(file, (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR, 0);
|
||||
if (err <= 0) {
|
||||
printf("spl: error reading image %s, err - %d, falling back to default\n",
|
||||
file, err);
|
||||
if (!CONFIG_IS_ENABLED(ENV_SUPPORT))
|
||||
goto defaults;
|
||||
}
|
||||
|
||||
file = env_get("falcon_image_file");
|
||||
if (file) {
|
||||
err = spl_load_image_fat(spl_image, bootdev, block_dev,
|
||||
@ -137,14 +131,28 @@ int spl_load_image_fat_os(struct spl_image_info *spl_image,
|
||||
goto defaults;
|
||||
}
|
||||
|
||||
file = env_get("falcon_args_file");
|
||||
if (file) {
|
||||
err = file_fat_read(
|
||||
file, (void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR, 0);
|
||||
if (err <= 0) {
|
||||
printf("spl: error reading args %s, err - %d, falling back to default\n",
|
||||
file, err);
|
||||
goto defaults;
|
||||
}
|
||||
return 0;
|
||||
} else
|
||||
puts("spl: falcon_image_file not set in environment, falling back to default\n");
|
||||
} else
|
||||
puts("spl: falcon_args_file not set in environment, falling back to default\n");
|
||||
} else
|
||||
puts("spl: falcon_image_file not set in environment, falling back to default\n");
|
||||
|
||||
defaults:
|
||||
#endif
|
||||
|
||||
err = spl_load_image_fat(spl_image, bootdev, block_dev, partition,
|
||||
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
|
||||
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = file_fat_read(CONFIG_SPL_FS_LOAD_ARGS_NAME,
|
||||
(void *)CONFIG_SPL_PAYLOAD_ARGS_ADDR, 0);
|
||||
@ -156,8 +164,7 @@ defaults:
|
||||
return -1;
|
||||
}
|
||||
|
||||
return spl_load_image_fat(spl_image, bootdev, block_dev, partition,
|
||||
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
int spl_load_image_fat_os(struct spl_image_info *spl_image,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user