Svyatoslav Ryhel | 964440c | 2024-11-21 14:42:39 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | |
| 3 | #ifndef _BCT_H_ |
| 4 | #define _BCT_H_ |
| 5 | |
| 6 | /* |
| 7 | * Defines the BCT parametres for T124 |
| 8 | */ |
| 9 | #define UBCT_LENGTH 0x6b0 /* bytes */ |
| 10 | #define SBCT_LENGTH 0x1950 /* bytes */ |
| 11 | |
| 12 | #define BCT_HASH 0x10 |
| 13 | #define EBT_ALIGNMENT 0x10 |
| 14 | |
| 15 | /* |
| 16 | * Defines the CMAC-AES-128 hash length in 32 bit words. (128 bits = 4 words) |
| 17 | */ |
| 18 | #define NVBOOT_CMAC_AES_HASH_LENGTH 4 |
| 19 | |
| 20 | /* |
| 21 | * Defines the RSA modulus length in 32 bit words used for PKC secure boot. |
| 22 | */ |
| 23 | #define NVBOOT_SE_RSA_MODULUS_LENGTH 64 |
| 24 | |
| 25 | /* |
| 26 | * Defines the maximum number of bootloader descriptions in the BCT. |
| 27 | */ |
| 28 | #define NVBOOT_MAX_BOOTLOADERS 4 |
| 29 | |
| 30 | struct nv_bootloader_info { |
| 31 | u32 version; |
| 32 | u32 start_blk; |
| 33 | u32 start_page; |
| 34 | u32 length; |
| 35 | u32 load_addr; |
| 36 | u32 entry_point; |
| 37 | u32 attribute; |
| 38 | |
| 39 | /* Specifies the AES-CMAC MAC or RSASSA-PSS signature of the BL. */ |
| 40 | u32 crypto_hash[NVBOOT_CMAC_AES_HASH_LENGTH]; |
| 41 | u32 bl_rsa_sig[NVBOOT_SE_RSA_MODULUS_LENGTH]; |
| 42 | }; |
| 43 | |
| 44 | struct nvboot_config_table { |
| 45 | u32 ubct_unused1[196]; |
| 46 | u32 crypto_hash[NVBOOT_CMAC_AES_HASH_LENGTH]; |
| 47 | u32 ubct_unused2[228]; |
| 48 | |
| 49 | u32 sbct_unused1[1318]; |
| 50 | u32 bootloader_used; |
| 51 | struct nv_bootloader_info bootloader[NVBOOT_MAX_BOOTLOADERS]; |
| 52 | u32 sbct_unused2; |
| 53 | }; |
| 54 | |
| 55 | #endif /* _BCT_H_ */ |