Hou Zhiqiang | 505d735 | 2016-06-28 20:18:13 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 NXP Semiconductor, Inc. |
| 3 | * |
| 4 | * SPDX-License-Identifier: GPL-2.0+ |
| 5 | */ |
| 6 | |
| 7 | #ifndef __SEC_FIRMWARE_H_ |
| 8 | #define __SEC_FIRMWARE_H_ |
| 9 | |
Yuantian Tang | aec3b14 | 2017-04-19 13:27:39 +0800 | [diff] [blame] | 10 | #define PSCI_INVALID_VER 0xffffffff |
Ruchika Gupta | db204d7 | 2017-08-16 15:58:10 +0530 | [diff] [blame^] | 11 | #define SEC_JR3_OFFSET 0x40000 |
Yuantian Tang | aec3b14 | 2017-04-19 13:27:39 +0800 | [diff] [blame] | 12 | |
Hou Zhiqiang | 505d735 | 2016-06-28 20:18:13 +0800 | [diff] [blame] | 13 | int sec_firmware_init(const void *, u32 *, u32 *); |
| 14 | int _sec_firmware_entry(const void *, u32 *, u32 *); |
| 15 | bool sec_firmware_is_valid(const void *); |
Ruchika Gupta | db204d7 | 2017-08-16 15:58:10 +0530 | [diff] [blame^] | 16 | bool sec_firmware_support_hwrng(void); |
| 17 | int sec_firmware_get_random(uint8_t *rand, int bytes); |
| 18 | int fdt_fixup_kaslr(void *fdt); |
Hou Zhiqiang | 6be115d | 2017-01-16 17:31:48 +0800 | [diff] [blame] | 19 | #ifdef CONFIG_SEC_FIRMWARE_ARMV8_PSCI |
Hou Zhiqiang | 505d735 | 2016-06-28 20:18:13 +0800 | [diff] [blame] | 20 | unsigned int sec_firmware_support_psci_version(void); |
| 21 | unsigned int _sec_firmware_support_psci_version(void); |
Yuantian Tang | aec3b14 | 2017-04-19 13:27:39 +0800 | [diff] [blame] | 22 | #else |
| 23 | static inline unsigned int sec_firmware_support_psci_version(void) |
| 24 | { |
| 25 | return PSCI_INVALID_VER; |
| 26 | } |
Hou Zhiqiang | 505d735 | 2016-06-28 20:18:13 +0800 | [diff] [blame] | 27 | #endif |
| 28 | |
Ruchika Gupta | db204d7 | 2017-08-16 15:58:10 +0530 | [diff] [blame^] | 29 | static inline unsigned int sec_firmware_used_jobring_offset(void) |
| 30 | { |
| 31 | return SEC_JR3_OFFSET; |
| 32 | } |
| 33 | |
Hou Zhiqiang | 505d735 | 2016-06-28 20:18:13 +0800 | [diff] [blame] | 34 | #endif /* __SEC_FIRMWARE_H_ */ |