blob: 6d42a7111f2a37f382760d3cf2bd52689f027976 [file] [log] [blame]
Hou Zhiqiang505d7352016-06-28 20:18:13 +08001/*
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 Tangaec3b142017-04-19 13:27:39 +080010#define PSCI_INVALID_VER 0xffffffff
Ruchika Guptadb204d72017-08-16 15:58:10 +053011#define SEC_JR3_OFFSET 0x40000
Yuantian Tangaec3b142017-04-19 13:27:39 +080012
Hou Zhiqiang505d7352016-06-28 20:18:13 +080013int sec_firmware_init(const void *, u32 *, u32 *);
14int _sec_firmware_entry(const void *, u32 *, u32 *);
15bool sec_firmware_is_valid(const void *);
Ruchika Guptadb204d72017-08-16 15:58:10 +053016bool sec_firmware_support_hwrng(void);
17int sec_firmware_get_random(uint8_t *rand, int bytes);
18int fdt_fixup_kaslr(void *fdt);
Hou Zhiqiang6be115d2017-01-16 17:31:48 +080019#ifdef CONFIG_SEC_FIRMWARE_ARMV8_PSCI
Hou Zhiqiang505d7352016-06-28 20:18:13 +080020unsigned int sec_firmware_support_psci_version(void);
21unsigned int _sec_firmware_support_psci_version(void);
Yuantian Tangaec3b142017-04-19 13:27:39 +080022#else
23static inline unsigned int sec_firmware_support_psci_version(void)
24{
25 return PSCI_INVALID_VER;
26}
Hou Zhiqiang505d7352016-06-28 20:18:13 +080027#endif
28
Ruchika Guptadb204d72017-08-16 15:58:10 +053029static inline unsigned int sec_firmware_used_jobring_offset(void)
30{
31 return SEC_JR3_OFFSET;
32}
33
Hou Zhiqiang505d7352016-06-28 20:18:13 +080034#endif /* __SEC_FIRMWARE_H_ */