On 7/5/22 21:23, Oleksandr Suvorov wrote:
CAUTION: This message has originated from an External Source. Please use proper
judgment and caution when opening attachments, clicking links, or responding to
this email.
Convert taken FPGA image "compatible" string to a binary compatible
flag and pass it to an FPGA driver.
Signed-off-by: Oleksandr Suvorov <oleksandr.suvo...@foundries.io>
Tested-by: Ricardo Salveti <rica...@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergol...@fastree3d.com>
---
(no changes since v10)
Changes in v10:
- made the message about ignoring legacy compatibe option as debug
common/spl/spl_fit.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 3c5a91916cc..1bf953b44a4 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -588,10 +588,14 @@ static int spl_fit_upload_fpga(struct spl_fit_info *ctx,
int node,
(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 {
+ flags = fpga_compatible2flag(devnum, compatible);
+ if (strcmp(compatible, "u-boot,fpga-legacy"))
+ debug("Ignoring compatible = %s property\n",
+ compatible);
+ }
I have problem with this.
This really matters only when FPGA_LOAD_SECURE is enabled. If this option is not
enabled there is no reason to call fpga_compatible2flag() because all the time
it returns only 0 no matter what compatible string is used.
That also mean that in 4/13 and 5/13 you can enable str2flag and
fpga_compatible2flag only when secure bitstreams are enabled.
250 /* If flags is not set, the image treats as legacy */
251 flags = FPGA_LEGACY;
Thanks,
Michal