/*
 * 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_ctr>;

			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_ctr>;

			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_ctr>;

			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_ctr>;

			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_ctr>;
			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_ctr>;

			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_ctr>;

			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_ctr>;

			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_ctr>;

			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_ctr>;

			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_ctr>;

			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_ctr: trusted_nv_ctr {
		id  = <TRUSTED_NV_CTR_ID>;
		oid = TRUSTED_FW_NVCOUNTER_OID;
	};

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

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