#include <gzip.h>
#include <image.h>
#include <log.h>
-#include <malloc.h>
+#include <memalign.h>
#include <mapmem.h>
#include <spl.h>
#include <sysinfo.h>
if (CONFIG_IS_ENABLED(FIT_SIGNATURE)) {
printf("## Checking hash(es) for Image %s ... ",
fit_get_name(fit, node, NULL));
- if (!fit_image_verify_with_data(fit, node, src, length))
+ if (!fit_image_verify_with_data(fit, node, gd_fdt_blob(), src,
+ length))
return -EPERM;
puts("OK\n");
}
* depending on how the overlay is stored, so
* don't fail yet if the allocation failed.
*/
- tmpbuffer = malloc(CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ);
+ size_t size = CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ;
+
+ tmpbuffer = malloc_cache_aligned(size);
if (!tmpbuffer)
debug("%s: unable to allocate space for overlays\n",
__func__);
{
void *buf;
- buf = malloc(size);
+ buf = malloc_cache_aligned(size);
if (!buf) {
pr_err("Could not get FIT buffer of %lu bytes\n", (ulong)size);
pr_err("\tcheck CONFIG_SYS_SPL_MALLOC_SIZE\n");
{
const char *compatible;
int ret;
+ int devnum = 0;
+ int flags = 0;
debug("FPGA bitstream at: %x, size: %x\n",
(u32)fpga_image->load_addr, fpga_image->size);
compatible = fdt_getprop(ctx->fit, node, "compatible", NULL);
- if (!compatible)
+ if (!compatible) {
warn_deprecated("'fpga' image without 'compatible' property");
- else if (strcmp(compatible, "u-boot,fpga-legacy"))
- printf("Ignoring compatible = %s property\n", compatible);
+ } else {
+ if (CONFIG_IS_ENABLED(FPGA_LOAD_SECURE))
+ flags = fpga_compatible2flag(devnum, compatible);
+ if (strcmp(compatible, "u-boot,fpga-legacy"))
+ debug("Ignoring compatible = %s property\n",
+ compatible);
+ }
- ret = fpga_load(0, (void *)fpga_image->load_addr, fpga_image->size,
- BIT_FULL);
+ ret = fpga_load(devnum, (void *)fpga_image->load_addr,
+ fpga_image->size, BIT_FULL, flags);
if (ret) {
printf("%s: Cannot load the image to the FPGA\n", __func__);
return ret;
}
/*
- * If a platform does not provide CONFIG_SYS_UBOOT_START, U-Boot's
+ * If a platform does not provide CFG_SYS_UBOOT_START, U-Boot's
* Makefile will set it to 0 and it will end up as the entry point
* here. What it actually means is: use the load address.
*/