]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
fpga: add option for loading FPGA secure bitstreams
authorOleksandr Suvorov <oleksandr.suvorov@foundries.io>
Fri, 22 Jul 2022 14:16:02 +0000 (17:16 +0300)
committerMichal Simek <michal.simek@amd.com>
Tue, 26 Jul 2022 06:42:16 +0000 (08:42 +0200)
It allows using this feature without enabling the "fpga loads"
command.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Co-developed-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Tested-by: Ricardo Salveti <ricardo@foundries.io>
Tested-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Link: https://lore.kernel.org/r/20220722141614.297383-2-oleksandr.suvorov@foundries.io
Signed-off-by: Michal Simek <michal.simek@amd.com>
cmd/Kconfig
drivers/fpga/Kconfig
drivers/fpga/fpga.c
drivers/fpga/xilinx.c
drivers/fpga/zynqmppl.c

index b3820f1e0439e0275527f85c7cf7070b00c489b5..a8260aa170d073febfe96178d6b38400c6964d48 100644 (file)
@@ -1038,8 +1038,9 @@ config CMD_FPGA_LOADP
          a partial bitstream.
 
 config CMD_FPGA_LOAD_SECURE
-       bool "fpga loads - loads secure bitstreams (Xilinx only)"
+       bool "fpga loads - loads secure bitstreams"
        depends on CMD_FPGA
+       select FPGA_LOAD_SECURE
        help
          Enables the fpga loads command which is used to load secure
          (authenticated or encrypted or both) bitstreams on to FPGA.
index 696ea92c6e9572278622d77c8e5f41e3ab0565f2..e07a9cf80ea43db8bdf1bd052943ea898bf71e2a 100644 (file)
@@ -104,4 +104,18 @@ config SYS_FPGA_PROG_FEEDBACK
        help
          Enable printing of hash marks during FPGA configuration.
 
+config FPGA_LOAD_SECURE
+       bool "Enable loading secure bitstreams"
+       depends on FPGA
+       help
+         Enables the fpga loads() functions that are used to load secure
+         (authenticated or encrypted or both) bitstreams on to FPGA.
+
+config SPL_FPGA_LOAD_SECURE
+       bool "Enable loading secure bitstreams for SPL"
+       depends on SPL_FPGA
+       help
+         Enables the fpga loads() functions that are used to load secure
+         (authenticated or encrypted or both) bitstreams on to FPGA.
+
 endmenu
index fe3dfa12335d59d4a737fc005b3ceb1bac71f3b1..3b0a44b2420050cb2716e865b54d367a53280810 100644 (file)
@@ -220,7 +220,7 @@ int fpga_fsload(int devnum, const void *buf, size_t size,
 }
 #endif
 
-#if defined(CONFIG_CMD_FPGA_LOAD_SECURE)
+#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
 int fpga_loads(int devnum, const void *buf, size_t size,
               struct fpga_secure_info *fpga_sec_info)
 {
index cbebefb55fe42e84e5ab80bd319498625459a7a8..6bc1bc491fbea4a17ca816e26410d1ce5fdfc235 100644 (file)
@@ -172,7 +172,7 @@ int xilinx_loadfs(xilinx_desc *desc, const void *buf, size_t bsize,
 }
 #endif
 
-#if defined(CONFIG_CMD_FPGA_LOAD_SECURE)
+#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
 int xilinx_loads(xilinx_desc *desc, const void *buf, size_t bsize,
                 struct fpga_secure_info *fpga_sec_info)
 {
index 6b394869dbf6b69befc4cdf27763027bf12e5be1..8ff12bf50a0c2a8bd1ea24c23d5d1ca27ca7c02d 100644 (file)
@@ -245,7 +245,7 @@ static int zynqmp_load(xilinx_desc *desc, const void *buf, size_t bsize,
        return ret;
 }
 
-#if defined(CONFIG_CMD_FPGA_LOAD_SECURE) && !defined(CONFIG_SPL_BUILD)
+#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
 static int zynqmp_loads(xilinx_desc *desc, const void *buf, size_t bsize,
                        struct fpga_secure_info *fpga_sec_info)
 {
@@ -306,7 +306,7 @@ static int zynqmp_pcap_info(xilinx_desc *desc)
 
 struct xilinx_fpga_op zynqmp_op = {
        .load = zynqmp_load,
-#if defined(CONFIG_CMD_FPGA_LOAD_SECURE) && !defined(CONFIG_SPL_BUILD)
+#if CONFIG_IS_ENABLED(FPGA_LOAD_SECURE)
        .loads = zynqmp_loads,
 #endif
        .info = zynqmp_pcap_info,