/*
 * Copyright (c) 2024, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <tools_share/dualroot_oid.h>
#include <common/tbbr/tbbr_img_def.h>
#include <common/nv_cntr_ids.h>

cot {
	manifests {
		compatible = "arm, cert-descs";

		trusted_boot_fw_cert: trusted_boot_fw_cert {
			root-certificate;
			image-id =<TRUSTED_BOOT_FW_CERT_ID>;
			antirollback-counter = <&trusted_nv_counter>;

			tb_fw_hash: tb_fw_hash {
				oid = TRUSTED_BOOT_FW_HASH_OID;
			};
			tb_fw_config_hash: tb_fw_config_hash {
				oid = TRUSTED_BOOT_FW_CONFIG_HASH_OID;
			};
			hw_config_hash: hw_config_hash {
				oid = HW_CONFIG_HASH_OID;
			};
			fw_config_hash: fw_config_hash {
				oid = FW_CONFIG_HASH_OID;
			};
		};

		trusted_key_cert: trusted_key_cert {
			root-certificate;
			image-id = <TRUSTED_KEY_CERT_ID>;
			antirollback-counter = <&trusted_nv_counter>;

			trusted_world_pk: trusted_world_pk {
				oid = TRUSTED_WORLD_PK_OID;
			};
		};

		scp_fw_key_cert: scp_fw_key_cert {
			image-id = <SCP_FW_KEY_CERT_ID>;
			parent = <&trusted_key_cert>;
			signing-key = <&trusted_world_pk>;
			antirollback-counter = <&trusted_nv_counter>;

			scp_fw_content_pk: scp_fw_content_pk {
				oid = SCP_FW_CONTENT_CERT_PK_OID;
			};
		};

		scp_fw_content_cert: scp_fw_content_cert {
			image-id = <SCP_FW_CONTENT_CERT_ID>;
			parent = <&scp_fw_key_cert>;
			signing-key = <&scp_fw_content_pk>;
			antirollback-counter = <&trusted_nv_counter>;

			scp_fw_hash: scp_fw_hash {
				oid = SCP_FW_HASH_OID;
			};
		};

		soc_fw_key_cert: soc_fw_key_cert {
			image-id = <SOC_FW_KEY_CERT_ID>;
			parent = <&trusted_key_cert>;
			signing-key = <&trusted_world_pk>;
			antirollback-counter = <&trusted_nv_counter>;
			soc_fw_content_pk: soc_fw_content_pk {
				oid = SOC_FW_CONTENT_CERT_PK_OID;
			};
		};

		soc_fw_content_cert: soc_fw_content_cert {
			image-id = <SOC_FW_CONTENT_CERT_ID>;
			parent = <&soc_fw_key_cert>;
			signing-key = <&soc_fw_content_pk>;
			antirollback-counter = <&trusted_nv_counter>;

			soc_fw_hash: soc_fw_hash {
				oid = SOC_AP_FW_HASH_OID;
			};
			soc_fw_config_hash: soc_fw_config_hash {
				oid = SOC_FW_CONFIG_HASH_OID;
			};
		};

		trusted_os_fw_key_cert: trusted_os_fw_key_cert {
			image-id = <TRUSTED_OS_FW_KEY_CERT_ID>;
			parent = <&trusted_key_cert>;
			signing-key = <&trusted_world_pk>;
			antirollback-counter = <&trusted_nv_counter>;

			tos_fw_content_pk: tos_fw_content_pk {
				oid = TRUSTED_OS_FW_CONTENT_CERT_PK_OID;
			};
		};

		trusted_os_fw_content_cert: trusted_os_fw_content_cert {
			image-id = <TRUSTED_OS_FW_CONTENT_CERT_ID>;
			parent = <&trusted_os_fw_key_cert>;
			signing-key = <&tos_fw_content_pk>;
			antirollback-counter = <&trusted_nv_counter>;

			tos_fw_hash: tos_fw_hash {
				oid = TRUSTED_OS_FW_HASH_OID;
			};
			tos_fw_extra1_hash: tos_fw_extra1_hash {
				oid = TRUSTED_OS_FW_EXTRA1_HASH_OID;
			};
			tos_fw_extra2_hash: tos_fw_extra2_hash {
				oid = TRUSTED_OS_FW_EXTRA2_HASH_OID;
			};
			tos_fw_config_hash: tos_fw_config_hash {
				oid = TRUSTED_OS_FW_CONFIG_HASH_OID;
			};
		};

		non_trusted_fw_content_cert: non_trusted_fw_content_cert {
			root-certificate;
			image-id = <NON_TRUSTED_FW_CONTENT_CERT_ID>;
			signing-key = <&prot_pk>;
			antirollback-counter = <&non_trusted_nv_counter>;

			nt_world_bl_hash: nt_world_bl_hash {
				oid = NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID;
			};
			nt_fw_config_hash: nt_fw_config_hash {
				oid = NON_TRUSTED_FW_CONFIG_HASH_OID;
			};
		};

#if defined(SPD_spmd)
		sip_sp_content_cert: sip_sp_content_cert {
			image-id = <SIP_SP_CONTENT_CERT_ID>;
			parent = <&trusted_key_cert>;
			signing-key = <&trusted_world_pk>;
			antirollback-counter = <&trusted_nv_counter>;

			sp_pkg1_hash: sp_pkg1_hash {
				oid = SP_PKG1_HASH_OID;
			};
			sp_pkg2_hash: sp_pkg2_hash {
				oid = SP_PKG2_HASH_OID;
			};
			sp_pkg3_hash: sp_pkg3_hash {
				oid = SP_PKG3_HASH_OID;
			};
			sp_pkg4_hash: sp_pkg4_hash {
				oid = SP_PKG4_HASH_OID;
			};
		};

		plat_sp_content_cert: plat_sp_content_cert {
			root-certificate;
			image-id = <PLAT_SP_CONTENT_CERT_ID>;
			signing-key = <&prot_pk>;
			antirollback-counter = <&non_trusted_nv_counter>;

			sp_pkg5_hash: sp_pkg5_hash {
				oid = SP_PKG5_HASH_OID;
			};
			sp_pkg6_hash: sp_pkg6_hash {
				oid = SP_PKG6_HASH_OID;
			};
			sp_pkg7_hash: sp_pkg7_hash {
				oid = SP_PKG7_HASH_OID;
			};
			sp_pkg8_hash: sp_pkg8_hash {
				oid = SP_PKG8_HASH_OID;
			};
		};
#endif
	};

	images {
		compatible = "arm, img-descs";

		hw_config {
			image-id = <HW_CONFIG_ID>;
			parent = <&trusted_boot_fw_cert>;
			hash = <&hw_config_hash>;
		};

		scp_bl2_image {
			image-id = <SCP_BL2_IMAGE_ID>;
			parent = <&scp_fw_content_cert>;
			hash = <&scp_fw_hash>;
		};

		bl31_image {
			image-id = <BL31_IMAGE_ID>;
			parent = <&soc_fw_content_cert>;
			hash = <&soc_fw_hash>;
		};

		soc_fw_config {
			image-id = <SOC_FW_CONFIG_ID>;
			parent = <&soc_fw_content_cert>;
			hash = <&soc_fw_config_hash>;
		};

		bl32_image {
			image-id = <BL32_IMAGE_ID>;
			parent = <&trusted_os_fw_content_cert>;
			hash = <&tos_fw_hash>;
		};

		bl32_extra1_image {
			image-id = <BL32_EXTRA1_IMAGE_ID>;
			parent = <&trusted_os_fw_content_cert>;
			hash = <&tos_fw_extra1_hash>;
		};

		bl32_extra2_image {
			image-id = <BL32_EXTRA2_IMAGE_ID>;
			parent = <&trusted_os_fw_content_cert>;
			hash = <&tos_fw_extra2_hash>;
		};

		tos_fw_config {
			image-id = <TOS_FW_CONFIG_ID>;
			parent = <&trusted_os_fw_content_cert>;
			hash = <&tos_fw_config_hash>;
		};

		bl33_image {
			image-id = <BL33_IMAGE_ID>;
			parent = <&non_trusted_fw_content_cert>;
			hash = <&nt_world_bl_hash>;
		};

		nt_fw_config {
			image-id = <NT_FW_CONFIG_ID>;
			parent = <&non_trusted_fw_content_cert>;
			hash = <&nt_fw_config_hash>;
		};

#if defined(SPD_spmd)
		sp_pkg1 {
			image-id = <SP_PKG1_ID>;
			parent = <&sip_sp_content_cert>;
			hash = <&sp_pkg1_hash>;
		};

		sp_pkg2 {
			image-id = <SP_PKG2_ID>;
			parent = <&sip_sp_content_cert>;
			hash = <&sp_pkg2_hash>;
		};

		sp_pkg3 {
			image-id = <SP_PKG3_ID>;
			parent = <&sip_sp_content_cert>;
			hash = <&sp_pkg3_hash>;
		};

		sp_pkg4 {
			image-id = <SP_PKG4_ID>;
			parent = <&sip_sp_content_cert>;
			hash = <&sp_pkg4_hash>;
		};

		sp_pkg5 {
			image-id = <SP_PKG5_ID>;
			parent = <&plat_sp_content_cert>;
			hash = <&sp_pkg5_hash>;
		};

		sp_pkg6 {
			image-id = <SP_PKG6_ID>;
			parent = <&plat_sp_content_cert>;
			hash = <&sp_pkg6_hash>;
		};

		sp_pkg7 {
			image-id = <SP_PKG7_ID>;
			parent = <&plat_sp_content_cert>;
			hash = <&sp_pkg7_hash>;
		};

		sp_pkg8 {
			image-id = <SP_PKG8_ID>;
			parent = <&plat_sp_content_cert>;
			hash = <&sp_pkg8_hash>;
		};
#endif
	};
};

non_volatile_counters: non_volatile_counters {
	compatible = "arm, non-volatile-counter";

	#address-cells = <1>;
	#size-cells = <0>;

	trusted_nv_counter: trusted_nv_counter {
		id  = <TRUSTED_NV_CTR_ID>;
		oid = TRUSTED_FW_NVCOUNTER_OID;
	};

	non_trusted_nv_counter: non_trusted_nv_counter {
		id  = <NON_TRUSTED_NV_CTR_ID>;
		oid = NON_TRUSTED_FW_NVCOUNTER_OID;
	};
};

rot_keys {
	prot_pk: prot_pk {
		oid = PROT_PK_OID;
	};
};
