blob: 0f86c72b24d378b4394ba583dc06ad4da309b3b2 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Hou Zhiqiang505d7352016-06-28 20:18:13 +08002/*
3 * Copyright 2016 NXP Semiconductor, Inc.
Hou Zhiqiang505d7352016-06-28 20:18:13 +08004 */
5
6#ifndef __SEC_FIRMWARE_H_
7#define __SEC_FIRMWARE_H_
8
Yuantian Tangaec3b142017-04-19 13:27:39 +08009#define PSCI_INVALID_VER 0xffffffff
Ruchika Guptadb204d72017-08-16 15:58:10 +053010#define SEC_JR3_OFFSET 0x40000
Sumit Gargb6fa55e2017-09-01 13:55:01 +053011#define WORD_MASK 0xffffffff
12#define WORD_SHIFT 32
Yuantian Tangaec3b142017-04-19 13:27:39 +080013
Sumit Gargb6fa55e2017-09-01 13:55:01 +053014int sec_firmware_init(const void *, u32 *, u32 *, u32 *, u32 *);
Hou Zhiqiang505d7352016-06-28 20:18:13 +080015int _sec_firmware_entry(const void *, u32 *, u32 *);
16bool sec_firmware_is_valid(const void *);
Ruchika Guptadb204d72017-08-16 15:58:10 +053017bool sec_firmware_support_hwrng(void);
18int sec_firmware_get_random(uint8_t *rand, int bytes);
19int fdt_fixup_kaslr(void *fdt);
Hou Zhiqiang6be115d2017-01-16 17:31:48 +080020#ifdef CONFIG_SEC_FIRMWARE_ARMV8_PSCI
Hou Zhiqiang505d7352016-06-28 20:18:13 +080021unsigned int sec_firmware_support_psci_version(void);
22unsigned int _sec_firmware_support_psci_version(void);
Yuantian Tangaec3b142017-04-19 13:27:39 +080023#else
24static inline unsigned int sec_firmware_support_psci_version(void)
25{
26 return PSCI_INVALID_VER;
27}
Hou Zhiqiang505d7352016-06-28 20:18:13 +080028#endif
29
Ruchika Guptadb204d72017-08-16 15:58:10 +053030static inline unsigned int sec_firmware_used_jobring_offset(void)
31{
32 return SEC_JR3_OFFSET;
33}
34
Hou Zhiqiang505d7352016-06-28 20:18:13 +080035#endif /* __SEC_FIRMWARE_H_ */