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