1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright 2016 NXP Semiconductor, Inc.
4  */
5 
6 #ifndef __SEC_FIRMWARE_H_
7 #define __SEC_FIRMWARE_H_
8 
9 #define PSCI_INVALID_VER		0xffffffff
10 #define SEC_JR3_OFFSET			0x40000
11 #define WORD_MASK			0xffffffff
12 #define WORD_SHIFT			32
13 
14 int sec_firmware_init(const void *, u32 *, u32 *, u32 *, u32 *);
15 int _sec_firmware_entry(const void *, u32 *, u32 *);
16 bool sec_firmware_is_valid(const void *);
17 bool sec_firmware_support_hwrng(void);
18 int sec_firmware_get_random(uint8_t *rand, int bytes);
19 int fdt_fixup_kaslr(void *fdt);
20 #ifdef CONFIG_SEC_FIRMWARE_ARMV8_PSCI
21 unsigned int sec_firmware_support_psci_version(void);
22 unsigned int _sec_firmware_support_psci_version(void);
23 #else
24 static inline unsigned int sec_firmware_support_psci_version(void)
25 {
26 	return PSCI_INVALID_VER;
27 }
28 #endif
29 
30 static inline unsigned int sec_firmware_used_jobring_offset(void)
31 {
32 	return SEC_JR3_OFFSET;
33 }
34 
35 #endif /* __SEC_FIRMWARE_H_ */
36