[U-Boot] [PATCH 1/3] spl: fit: display a message when an FPGA image is loaded

A message should be displayed if an image is loaded to an FPGA, because the hardware might have changed, and the user should be informed
Signed-off-by: Luis Araneda luaraneda@gmail.com --- common/spl/spl_fit.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 5b51a28a08..9eabb1c105 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -412,6 +412,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, printf("%s: Cannot load the FPGA: %i\n", __func__, ret); return ret; } + puts("FPGA image loaded from FIT\n"); node = -1; } #endif

Disable the use of function zynq_loadfs when compiling the driver for the SPL, as the following filesystem functions are not found by the linker: - fs_set_blk_dev - fs_read - fs_set_blk_dev - fs_read - fs_read
Signed-off-by: Luis Araneda luaraneda@gmail.com --- drivers/fpga/zynqpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/fpga/zynqpl.c b/drivers/fpga/zynqpl.c index fd37d18c7f..8e49c7010e 100644 --- a/drivers/fpga/zynqpl.c +++ b/drivers/fpga/zynqpl.c @@ -410,7 +410,7 @@ static int zynq_load(xilinx_desc *desc, const void *buf, size_t bsize, return FPGA_SUCCESS; }
-#if defined(CONFIG_CMD_FPGA_LOADFS) +#if defined(CONFIG_CMD_FPGA_LOADFS) && !defined(CONFIG_SPL_BUILD) static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize, fpga_fs_info *fsinfo) { @@ -493,7 +493,7 @@ static int zynq_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
struct xilinx_fpga_op zynq_op = { .load = zynq_load, -#if defined(CONFIG_CMD_FPGA_LOADFS) +#if defined(CONFIG_CMD_FPGA_LOADFS) && !defined(CONFIG_SPL_BUILD) .loadfs = zynq_loadfs, #endif };

commit 4aba5fb857c1 ("arm: zynq: Rework FPGA initialization") moved FPGA initialization from board_init() to arch_early_init_r(), which is not called as part of the SPL
Fix this by calling arch_early_init_r() in the spl_board_init() function, so the FPGA is correctly initialized
Signed-off-by: Luis Araneda luaraneda@gmail.com --- arch/arm/mach-zynq/spl.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c index 83297d6c69..9b7c0be951 100644 --- a/arch/arm/mach-zynq/spl.c +++ b/arch/arm/mach-zynq/spl.c @@ -29,6 +29,9 @@ void board_init_f(ulong dummy) void spl_board_init(void) { preloader_console_init(); +#if defined(CONFIG_ARCH_EARLY_INIT_R) && defined(CONFIG_SPL_FPGA_SUPPORT) + arch_early_init_r(); +#endif board_init(); } #endif

On 19.7.2018 09:10, Luis Araneda wrote:
A message should be displayed if an image is loaded to an FPGA, because the hardware might have changed, and the user should be informed
Signed-off-by: Luis Araneda luaraneda@gmail.com
common/spl/spl_fit.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c index 5b51a28a08..9eabb1c105 100644 --- a/common/spl/spl_fit.c +++ b/common/spl/spl_fit.c @@ -412,6 +412,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image, printf("%s: Cannot load the FPGA: %i\n", __func__, ret); return ret; }
node = -1; }puts("FPGA image loaded from FIT\n");
#endif
Applied all.
Thanks, Michal
participants (2)
-
Luis Araneda
-
Michal Simek