1 /*
2  * Copyright (c) 2022-2023, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __CONFIG_PARTITION_PS_H__
9 #define __CONFIG_PARTITION_PS_H__
10 
11 #include "config_tfm.h"
12 
13 /* Check invalid configs. */
14 #if PS_ROLLBACK_PROTECTION && PLATFORM_NV_COUNTER_MODULE_DISABLED
15 #error "Invalid config: PS_ROLLBACK_PROTECTION and PLATFORM_NV_COUNTER_MODULE_DISABLED!"
16 #endif
17 
18 #if PS_ROLLBACK_PROTECTION && (!defined(PS_ENCRYPTION))
19 #error "Invalid config: PS_ROLLBACK_PROTECTION and NOT PS_ENCRYPTION!"
20 #endif
21 
22 #if (!PS_ROLLBACK_PROTECTION) && defined(PS_ENCRYPTION) && \
23     (defined(PS_CRYPTO_AEAD_ALG_GCM) || defined(PS_CRYPTO_AEAD_ALG_CCM))
24 #error "Invalid config: NOT PS_ROLLBACK_PROTECTION and PS_ENCRYPTION and PSA_ALG_GCM or PSA_ALG_CCM!"
25 #endif
26 
27 /*
28  * ITS_VALIDATE_METADATA_FROM_FLASH shall be enabled when PS_VALIDATE_METADATA_FROM_FLASH is
29  * enabled
30  */
31 #if PS_VALIDATE_METADATA_FROM_FLASH && (!ITS_VALIDATE_METADATA_FROM_FLASH)
32 #error "Invalid config: ITS_VALIDATE_METADATA_FROM_FLASH shall be enabled when PS_VALIDATE_METADATA_FROM_FLASH is enabled"
33 #endif
34 
35 #endif /* __CONFIG_PARTITION_PS_H__ */
36