Support added for HS and GP boot binaries for AM65x.

tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img: For HS devices
tiboot3.bin_unsigned, sysfw.itb, tispl.bin_unsigned,
u-boot.img_unsigned: For GP devices

Note that the bootflow followed by AM65x requires:

tiboot3.bin:
        * R5 SPL
        * R5 SPL dtbs
sysfw.itb:
        * sysfw
        * board-cfg
        * pm-cfg
        * sec-cfg
        * rm-cfg

tispl.bin:
        * ATF
        * OPTEE
        * A53 SPL
        * A53 SPL dtbs

u-boot.img:
        * A53 U-Boot
        * A53 U-Boot dtbs

Signed-off-by: Neha Malcom Francis <n-fran...@ti.com>
---
 arch/arm/dts/k3-am654-base-board-u-boot.dtsi  |   1 +
 .../dts/k3-am654-r5-base-board-u-boot.dtsi    |   1 +
 arch/arm/dts/k3-am65x-binman.dtsi             | 482 ++++++++++++++++++
 board/ti/am65x/Kconfig                        |   2 +
 4 files changed, 486 insertions(+)
 create mode 100644 arch/arm/dts/k3-am65x-binman.dtsi

diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi 
b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi
index 0c1305df7e..e4cbc47c2a 100644
--- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi
+++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi
@@ -4,6 +4,7 @@
  */
 
 #include "k3-am654-r5-base-board-u-boot.dtsi"
+#include "k3-am65x-binman.dtsi"
 
 &pru0_0 {
        remoteproc-name = "pru0_0";
diff --git a/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi 
b/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi
index 1d0659ea8f..de45a6a67a 100644
--- a/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi
+++ b/arch/arm/dts/k3-am654-r5-base-board-u-boot.dtsi
@@ -5,6 +5,7 @@
 
 #include <dt-bindings/pinctrl/k3.h>
 #include <dt-bindings/net/ti-dp83867.h>
+#include "k3-am65x-binman.dtsi"
 
 / {
        chosen {
diff --git a/arch/arm/dts/k3-am65x-binman.dtsi 
b/arch/arm/dts/k3-am65x-binman.dtsi
new file mode 100644
index 0000000000..68c5e10a60
--- /dev/null
+++ b/arch/arm/dts/k3-am65x-binman.dtsi
@@ -0,0 +1,482 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/ {
+       binman: binman {
+               multiple-images;
+       };
+};
+
+#ifdef CONFIG_TARGET_AM654_R5_EVM
+
+&binman {
+       tiboot3 {
+               filename = "tiboot3.bin";
+               ti-secure {
+                       filename = "spl/u-boot-spl.bin";
+                       core = <16>;
+                       load = <CONFIG_SPL_TEXT_BASE>;
+                       key = "/keys/custMpk.pem";
+               };
+       };
+       ti-sci-cert.bin {
+               filename = "ti-sci-cert.bin";
+               ti-sci-firmware-am65x-hs-cert.bin {
+                       filename = "ti-sci-firmware-am65x-hs-cert.bin";
+                       type = "blob-ext";
+                       optional;
+               };
+       };
+       sysfw {
+               filename = "sysfw.bin";
+               ti-secure {
+                       filename = "ti-sci-cert.bin";
+                       core = <0>;
+                       load = <0x40000>;
+                       key = "/keys/custMpk.pem";
+                       sysfw-cert;
+               };
+               ti-sci-firmware-am65x-hs-enc.bin {
+                       filename = "ti-sci-firmware-am65x-hs-enc.bin";
+                       type = "blob-ext";
+                       optional;
+               };
+       };
+       itb {
+               filename = "sysfw-am65x-hs.itb";
+               fit {
+                       description = "SYSFW and Config fragments";
+                       #address-cells = <1>;
+                       images {
+                               sysfw.bin {
+                                       description = "sysfw";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob-ext {
+                                           filename = "sysfw.bin";
+                                       };
+                               };
+                               board-cfg.bin {
+                                       description = "board-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       ti-secure {
+                                               filename = "board-cfg.bin";
+                                               secure;
+                                       };
+                               };
+                               pm-cfg.bin {
+                                       description = "pm-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       ti-secure {
+                                               filename = "pm-cfg.bin";
+                                               secure;
+                                       };
+                               };
+                               rm-cfg.bin {
+                                       description = "rm-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       ti-secure {
+                                               filename = "rm-cfg.bin";
+                                               secure;
+                                       };
+                               };
+                               sec-cfg.bin {
+                                       description = "sec-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       ti-secure {
+                                               filename = "sec-cfg.bin";
+                                               secure;
+                                       };
+                               };
+                       };
+               };
+       };
+};
+
+&binman {
+       tiboot3_unsigned {
+               filename = "tiboot3.bin_unsigned";
+               ti-secure {
+                       filename = "spl/u-boot-spl.bin";
+                       core = <16>;
+                       load = <CONFIG_SPL_TEXT_BASE>;
+                       sw-rev = <CONFIG_K3_X509_SWRV>;
+               };
+       };
+       ti-sci.bin {
+               filename = "ti-sci.bin";
+               ti-sci-firmware-am65x-gp.bin {
+                       filename = "ti-sci-firmware-am65x-gp.bin";
+                       type = "blob-ext";
+                       optional;
+               };
+       };
+       sysfw_gp {
+               filename = "sysfw.bin_gp";
+               ti-secure {
+                       filename = "ti-sci.bin";
+                       core = <0>;
+                       load = <0x40000>;
+                       sw-rev = <CONFIG_K3_X509_SWRV>;
+               };
+       };
+       itb_gp {
+               filename = "sysfw-am65x-gp-evm.itb";
+               symlink = "sysfw.itb";
+               fit {
+                       description = "SYSFW and Config fragments";
+                       #address-cells = <1>;
+                       images {
+                               sysfw.bin {
+                                       description = "sysfw";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob-ext {
+                                           filename = "sysfw.bin_gp";
+                                       };
+                               };
+                               board-cfg.bin {
+                                       description = "board-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob-ext {
+                                               filename = "board-cfg.bin";
+                                       };
+                               };
+                               pm-cfg.bin {
+                                       description = "pm-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob-ext {
+                                               filename = "pm-cfg.bin";
+                                       };
+                               };
+                               rm-cfg.bin {
+                                       description = "rm-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob-ext {
+                                               filename = "rm-cfg.bin";
+                                       };
+                               };
+                               sec-cfg.bin {
+                                       description = "sec-cfg";
+                                       type = "firmware";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob-ext {
+                                               filename = "sec-cfg.bin";
+                                       };
+                               };
+                       };
+               };
+       };
+};
+#endif
+
+#ifdef CONFIG_TARGET_AM654_A53_EVM
+
+#define SPL_NODTB "spl/u-boot-spl-nodtb.bin"
+#define SPL_AM654_EVM_DTB "spl/dts/k3-am654-base-board.dtb"
+
+#define UBOOT_NODTB "u-boot-nodtb.bin"
+#define AM654_EVM_DTB "arch/arm/dts/k3-am654-base-board.dtb"
+
+&binman {
+       ti-spl {
+               filename = "tispl.bin";
+               pad-byte = <0xff>;
+
+               fit {
+                       description = "Configuration to load ATF and SPL";
+                       #address-cells = <1>;
+
+                       images {
+
+                               atf {
+                                       description = "ARM Trusted Firmware";
+                                       type = "firmware";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       os = "arm-trusted-firmware";
+                                       load = <CONFIG_K3_ATF_LOAD_ADDR>;
+                                       entry = <CONFIG_K3_ATF_LOAD_ADDR>;
+                                       atf-bl31 {
+                                       };
+                               };
+
+                               tee {
+                                       description = "OPTEE";
+                                       type = "tee";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       os = "tee";
+                                       load = <0x9e800000>;
+                                       entry = <0x9e800000>;
+                                       tee-os {
+                                       };
+                               };
+
+                               dm {
+                                       description = "DM binary";
+                                       type = "firmware";
+                                       arch = "arm32";
+                                       compression = "none";
+                                       os = "DM";
+                                       load = <0x89000000>;
+                                       entry = <0x89000000>;
+                                       blob-ext {
+                                               filename = "/dev/null";
+                                       };
+                               };
+
+                               spl {
+                                       description = "SPL (64-bit)";
+                                       type = "standalone";
+                                       os = "U-Boot";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       load = <CONFIG_SPL_TEXT_BASE>;
+                                       entry = <CONFIG_SPL_TEXT_BASE>;
+                                       ti-secure {
+                                               filename = SPL_NODTB;
+                                               secure;
+                                       };
+                               };
+
+                               fdt-0 {
+                                       description = "k3-am654-base-board";
+                                       type = "flat_dt";
+                                       arch = "arm";
+                                       compression = "none";
+                                       ti-secure {
+                                               filename = SPL_AM654_EVM_DTB;
+                                               secure;
+                                       };
+                               };
+                       };
+
+                       configurations {
+                               default = "conf-0";
+
+                               conf-0 {
+                                       description = "k3-am654-base-board";
+                                       firmware = "atf";
+                                       loadables = "tee", "dm", "spl";
+                                       fdt = "fdt-0";
+                               };
+                       };
+               };
+       };
+};
+
+&binman {
+       u-boot {
+               filename = "u-boot.img";
+               pad-byte = <0xff>;
+
+               fit {
+                       description = "FIT image with multiple configurations";
+
+                       images {
+                               uboot {
+                                       description = "U-Boot for AM65 board";
+                                       type = "firmware";
+                                       os = "u-boot";
+                                       arch = "arm";
+                                       compression = "none";
+                                       load = <CONFIG_TEXT_BASE>;
+                                       ti-secure {
+                                               filename = UBOOT_NODTB;
+                                               secure;
+                                       };
+                                       hash {
+                                               algo = "crc32";
+                                       };
+                               };
+
+                               fdt-0 {
+                                       description = "k3-am654-base-board";
+                                       type = "flat_dt";
+                                       arch = "arm";
+                                       compression = "none";
+                                       ti-secure {
+                                               filename = AM654_EVM_DTB;
+                                               secure;
+                                       };
+                                       hash {
+                                               algo = "crc32";
+                                       };
+                               };
+
+                       };
+
+                       configurations {
+                               default = "conf-0";
+
+                               conf-0 {
+                                       description = "k3-am654-base-board";
+                                       firmware = "uboot";
+                                       loadables = "uboot";
+                                       fdt = "fdt-0";
+                               };
+                       };
+               };
+       };
+};
+
+&binman {
+       ti-spl_unsigned {
+               filename = "tispl.bin_unsigned";
+               pad-byte = <0xff>;
+
+               fit {
+                       description = "Configuration to load ATF and SPL";
+                       #address-cells = <1>;
+
+                       images {
+
+                               atf {
+                                       description = "ARM Trusted Firmware";
+                                       type = "firmware";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       os = "arm-trusted-firmware";
+                                       load = <CONFIG_K3_ATF_LOAD_ADDR>;
+                                       entry = <CONFIG_K3_ATF_LOAD_ADDR>;
+                                       atf-bl31 {
+                                               filename = "bl31.bin";
+                                       };
+                               };
+
+                               tee {
+                                       description = "OPTEE";
+                                       type = "tee";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       os = "tee";
+                                       load = <0x9e800000>;
+                                       entry = <0x9e800000>;
+                                       tee-os {
+                                               filename = "tee-pager_v2.bin";
+                                       };
+                               };
+
+                               dm {
+                                       description = "DM binary";
+                                       type = "firmware";
+                                       arch = "arm32";
+                                       compression = "none";
+                                       os = "DM";
+                                       load = <0x89000000>;
+                                       entry = <0x89000000>;
+                                       blob-ext {
+                                               filename = "/dev/null";
+                                       };
+                               };
+
+                               spl {
+                                       description = "SPL (64-bit)";
+                                       type = "standalone";
+                                       os = "U-Boot";
+                                       arch = "arm64";
+                                       compression = "none";
+                                       load = <CONFIG_SPL_TEXT_BASE>;
+                                       entry = <CONFIG_SPL_TEXT_BASE>;
+                                       blob {
+                                               filename = 
"spl/u-boot-spl-nodtb.bin";
+                                       };
+                               };
+
+                               fdt-1 {
+                                       description = 
"k3-j721e-common-proc-board";
+                                       type = "flat_dt";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob {
+                                               filename = SPL_AM654_EVM_DTB;
+                                       };
+                               };
+                       };
+
+                       configurations {
+                               default = "conf-1";
+
+                               conf-1 {
+                                       description = "k3-am654-base-board";
+                                       firmware = "atf";
+                                       loadables = "tee", "dm", "spl";
+                                       fdt = "fdt-1";
+                               };
+                       };
+               };
+       };
+};
+
+&binman {
+       u-boot_unsigned {
+               filename = "u-boot.img_unsigned";
+               pad-byte = <0xff>;
+
+               fit {
+                       description = "FIT image with multiple configurations";
+
+                       images {
+                               uboot {
+                                       description = "U-Boot for AM65 board";
+                                       type = "firmware";
+                                       os = "u-boot";
+                                       arch = "arm";
+                                       compression = "none";
+                                       load = <CONFIG_TEXT_BASE>;
+                                       blob {
+                                               filename = UBOOT_NODTB;
+                                       };
+                                       hash {
+                                               algo = "crc32";
+                                       };
+                               };
+
+                               fdt-1 {
+                                       description = "k3-am654-base-board";
+                                       type = "flat_dt";
+                                       arch = "arm";
+                                       compression = "none";
+                                       blob {
+                                               filename = AM654_EVM_DTB;
+                                       };
+                                       hash {
+                                               algo = "crc32";
+                                       };
+                               };
+                       };
+
+                       configurations {
+                               default = "conf-1";
+
+                               conf-1 {
+                                       description = "k3-am654-base-board";
+                                       firmware = "uboot";
+                                       loadables = "uboot";
+                                       fdt = "fdt-1";
+                               };
+                       };
+               };
+       };
+};
+#endif
diff --git a/board/ti/am65x/Kconfig b/board/ti/am65x/Kconfig
index 4765b13ba0..262a8e5ddb 100644
--- a/board/ti/am65x/Kconfig
+++ b/board/ti/am65x/Kconfig
@@ -13,6 +13,7 @@ config TARGET_AM654_A53_EVM
        select SOC_K3_AM654
        select SYS_DISABLE_DCACHE_OPS
        select BOARD_LATE_INIT
+       select BINMAN
        imply TI_I2C_BOARD_DETECT
 
 config TARGET_AM654_R5_EVM
@@ -22,6 +23,7 @@ config TARGET_AM654_R5_EVM
        select SOC_K3_AM654
        select K3_LOAD_SYSFW
        select K3_AM654_DDRSS
+       select BINMAN
        imply SYS_K3_SPL_ATF
        imply TI_I2C_BOARD_DETECT
 
-- 
2.34.1

Reply via email to