1*54fd6939SJiyong Park /*
2*54fd6939SJiyong Park * Copyright (c) 2013-2021, ARM Limited and Contributors. All rights reserved.
3*54fd6939SJiyong Park *
4*54fd6939SJiyong Park * SPDX-License-Identifier: BSD-3-Clause
5*54fd6939SJiyong Park */
6*54fd6939SJiyong Park
7*54fd6939SJiyong Park #ifndef PLATFORM_H
8*54fd6939SJiyong Park #define PLATFORM_H
9*54fd6939SJiyong Park
10*54fd6939SJiyong Park #include <stdint.h>
11*54fd6939SJiyong Park
12*54fd6939SJiyong Park #include <lib/psci/psci.h>
13*54fd6939SJiyong Park #if defined(SPD_spmd)
14*54fd6939SJiyong Park #include <services/spm_core_manifest.h>
15*54fd6939SJiyong Park #endif
16*54fd6939SJiyong Park #if TRNG_SUPPORT
17*54fd6939SJiyong Park #include "plat_trng.h"
18*54fd6939SJiyong Park #endif
19*54fd6939SJiyong Park #include <drivers/fwu/fwu_metadata.h>
20*54fd6939SJiyong Park
21*54fd6939SJiyong Park /*******************************************************************************
22*54fd6939SJiyong Park * Forward declarations
23*54fd6939SJiyong Park ******************************************************************************/
24*54fd6939SJiyong Park struct auth_img_desc_s;
25*54fd6939SJiyong Park struct meminfo;
26*54fd6939SJiyong Park struct image_info;
27*54fd6939SJiyong Park struct entry_point_info;
28*54fd6939SJiyong Park struct image_desc;
29*54fd6939SJiyong Park struct bl_load_info;
30*54fd6939SJiyong Park struct bl_params;
31*54fd6939SJiyong Park struct mmap_region;
32*54fd6939SJiyong Park struct spm_mm_boot_info;
33*54fd6939SJiyong Park struct sp_res_desc;
34*54fd6939SJiyong Park enum fw_enc_status_t;
35*54fd6939SJiyong Park
36*54fd6939SJiyong Park /*******************************************************************************
37*54fd6939SJiyong Park * plat_get_rotpk_info() flags
38*54fd6939SJiyong Park ******************************************************************************/
39*54fd6939SJiyong Park #define ROTPK_IS_HASH (1 << 0)
40*54fd6939SJiyong Park /* Flag used to skip verification of the certificate ROTPK while the platform
41*54fd6939SJiyong Park ROTPK is not deployed */
42*54fd6939SJiyong Park #define ROTPK_NOT_DEPLOYED (1 << 1)
43*54fd6939SJiyong Park
44*54fd6939SJiyong Park /*******************************************************************************
45*54fd6939SJiyong Park * plat_get_enc_key_info() flags
46*54fd6939SJiyong Park ******************************************************************************/
47*54fd6939SJiyong Park /*
48*54fd6939SJiyong Park * Flag used to notify caller that information provided in key buffer is an
49*54fd6939SJiyong Park * identifier rather than an actual key.
50*54fd6939SJiyong Park */
51*54fd6939SJiyong Park #define ENC_KEY_IS_IDENTIFIER (1 << 0)
52*54fd6939SJiyong Park
53*54fd6939SJiyong Park /*******************************************************************************
54*54fd6939SJiyong Park * Function declarations
55*54fd6939SJiyong Park ******************************************************************************/
56*54fd6939SJiyong Park /*******************************************************************************
57*54fd6939SJiyong Park * Mandatory common functions
58*54fd6939SJiyong Park ******************************************************************************/
59*54fd6939SJiyong Park unsigned int plat_get_syscnt_freq2(void);
60*54fd6939SJiyong Park
61*54fd6939SJiyong Park int plat_get_image_source(unsigned int image_id,
62*54fd6939SJiyong Park uintptr_t *dev_handle,
63*54fd6939SJiyong Park uintptr_t *image_spec);
64*54fd6939SJiyong Park uintptr_t plat_get_ns_image_entrypoint(void);
65*54fd6939SJiyong Park unsigned int plat_my_core_pos(void);
66*54fd6939SJiyong Park int plat_core_pos_by_mpidr(u_register_t mpidr);
67*54fd6939SJiyong Park int plat_get_mbedtls_heap(void **heap_addr, size_t *heap_size);
68*54fd6939SJiyong Park
69*54fd6939SJiyong Park #if STACK_PROTECTOR_ENABLED
70*54fd6939SJiyong Park /*
71*54fd6939SJiyong Park * Return a new value to be used for the stack protection's canary.
72*54fd6939SJiyong Park *
73*54fd6939SJiyong Park * Ideally, this value is a random number that is impossible to predict by an
74*54fd6939SJiyong Park * attacker.
75*54fd6939SJiyong Park */
76*54fd6939SJiyong Park u_register_t plat_get_stack_protector_canary(void);
77*54fd6939SJiyong Park #endif /* STACK_PROTECTOR_ENABLED */
78*54fd6939SJiyong Park
79*54fd6939SJiyong Park /*******************************************************************************
80*54fd6939SJiyong Park * Mandatory interrupt management functions
81*54fd6939SJiyong Park ******************************************************************************/
82*54fd6939SJiyong Park uint32_t plat_ic_get_pending_interrupt_id(void);
83*54fd6939SJiyong Park uint32_t plat_ic_get_pending_interrupt_type(void);
84*54fd6939SJiyong Park uint32_t plat_ic_acknowledge_interrupt(void);
85*54fd6939SJiyong Park uint32_t plat_ic_get_interrupt_type(uint32_t id);
86*54fd6939SJiyong Park void plat_ic_end_of_interrupt(uint32_t id);
87*54fd6939SJiyong Park uint32_t plat_interrupt_type_to_line(uint32_t type,
88*54fd6939SJiyong Park uint32_t security_state);
89*54fd6939SJiyong Park
90*54fd6939SJiyong Park /*******************************************************************************
91*54fd6939SJiyong Park * Optional interrupt management functions, depending on chosen EL3 components.
92*54fd6939SJiyong Park ******************************************************************************/
93*54fd6939SJiyong Park unsigned int plat_ic_get_running_priority(void);
94*54fd6939SJiyong Park int plat_ic_is_spi(unsigned int id);
95*54fd6939SJiyong Park int plat_ic_is_ppi(unsigned int id);
96*54fd6939SJiyong Park int plat_ic_is_sgi(unsigned int id);
97*54fd6939SJiyong Park unsigned int plat_ic_get_interrupt_active(unsigned int id);
98*54fd6939SJiyong Park void plat_ic_disable_interrupt(unsigned int id);
99*54fd6939SJiyong Park void plat_ic_enable_interrupt(unsigned int id);
100*54fd6939SJiyong Park int plat_ic_has_interrupt_type(unsigned int type);
101*54fd6939SJiyong Park void plat_ic_set_interrupt_type(unsigned int id, unsigned int type);
102*54fd6939SJiyong Park void plat_ic_set_interrupt_priority(unsigned int id, unsigned int priority);
103*54fd6939SJiyong Park void plat_ic_raise_el3_sgi(int sgi_num, u_register_t target);
104*54fd6939SJiyong Park void plat_ic_set_spi_routing(unsigned int id, unsigned int routing_mode,
105*54fd6939SJiyong Park u_register_t mpidr);
106*54fd6939SJiyong Park void plat_ic_set_interrupt_pending(unsigned int id);
107*54fd6939SJiyong Park void plat_ic_clear_interrupt_pending(unsigned int id);
108*54fd6939SJiyong Park unsigned int plat_ic_set_priority_mask(unsigned int mask);
109*54fd6939SJiyong Park unsigned int plat_ic_get_interrupt_id(unsigned int raw);
110*54fd6939SJiyong Park
111*54fd6939SJiyong Park /*******************************************************************************
112*54fd6939SJiyong Park * Optional common functions (may be overridden)
113*54fd6939SJiyong Park ******************************************************************************/
114*54fd6939SJiyong Park uintptr_t plat_get_my_stack(void);
115*54fd6939SJiyong Park void plat_report_exception(unsigned int exception_type);
116*54fd6939SJiyong Park int plat_crash_console_init(void);
117*54fd6939SJiyong Park int plat_crash_console_putc(int c);
118*54fd6939SJiyong Park void plat_crash_console_flush(void);
119*54fd6939SJiyong Park void plat_error_handler(int err) __dead2;
120*54fd6939SJiyong Park void plat_panic_handler(void) __dead2;
121*54fd6939SJiyong Park const char *plat_log_get_prefix(unsigned int log_level);
122*54fd6939SJiyong Park void bl2_plat_preload_setup(void);
123*54fd6939SJiyong Park int plat_try_next_boot_source(void);
124*54fd6939SJiyong Park
125*54fd6939SJiyong Park #if MEASURED_BOOT
126*54fd6939SJiyong Park int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data);
127*54fd6939SJiyong Park #else
plat_mboot_measure_image(unsigned int image_id __unused,image_info_t * image_data __unused)128*54fd6939SJiyong Park static inline int plat_mboot_measure_image(unsigned int image_id __unused,
129*54fd6939SJiyong Park image_info_t *image_data __unused)
130*54fd6939SJiyong Park {
131*54fd6939SJiyong Park return 0;
132*54fd6939SJiyong Park }
133*54fd6939SJiyong Park #endif /* MEASURED_BOOT */
134*54fd6939SJiyong Park
135*54fd6939SJiyong Park /*******************************************************************************
136*54fd6939SJiyong Park * Mandatory BL1 functions
137*54fd6939SJiyong Park ******************************************************************************/
138*54fd6939SJiyong Park void bl1_early_platform_setup(void);
139*54fd6939SJiyong Park void bl1_plat_arch_setup(void);
140*54fd6939SJiyong Park void bl1_platform_setup(void);
141*54fd6939SJiyong Park struct meminfo *bl1_plat_sec_mem_layout(void);
142*54fd6939SJiyong Park
143*54fd6939SJiyong Park /*******************************************************************************
144*54fd6939SJiyong Park * Optional EL3 component functions in BL31
145*54fd6939SJiyong Park ******************************************************************************/
146*54fd6939SJiyong Park
147*54fd6939SJiyong Park /* SDEI platform functions */
148*54fd6939SJiyong Park #if SDEI_SUPPORT
149*54fd6939SJiyong Park void plat_sdei_setup(void);
150*54fd6939SJiyong Park int plat_sdei_validate_entry_point(uintptr_t ep, unsigned int client_mode);
151*54fd6939SJiyong Park void plat_sdei_handle_masked_trigger(uint64_t mpidr, unsigned int intr);
152*54fd6939SJiyong Park #endif
153*54fd6939SJiyong Park
154*54fd6939SJiyong Park void plat_default_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie,
155*54fd6939SJiyong Park void *handle, uint64_t flags);
156*54fd6939SJiyong Park void plat_ea_handler(unsigned int ea_reason, uint64_t syndrome, void *cookie,
157*54fd6939SJiyong Park void *handle, uint64_t flags);
158*54fd6939SJiyong Park
159*54fd6939SJiyong Park /*
160*54fd6939SJiyong Park * The following function is mandatory when the
161*54fd6939SJiyong Park * firmware update feature is used.
162*54fd6939SJiyong Park */
163*54fd6939SJiyong Park int bl1_plat_mem_check(uintptr_t mem_base, unsigned int mem_size,
164*54fd6939SJiyong Park unsigned int flags);
165*54fd6939SJiyong Park
166*54fd6939SJiyong Park /*******************************************************************************
167*54fd6939SJiyong Park * Optional BL1 functions (may be overridden)
168*54fd6939SJiyong Park ******************************************************************************/
169*54fd6939SJiyong Park /*
170*54fd6939SJiyong Park * The following functions are used for image loading process in BL1.
171*54fd6939SJiyong Park */
172*54fd6939SJiyong Park void bl1_plat_set_ep_info(unsigned int image_id,
173*54fd6939SJiyong Park struct entry_point_info *ep_info);
174*54fd6939SJiyong Park /*
175*54fd6939SJiyong Park * The following functions are mandatory when firmware update
176*54fd6939SJiyong Park * feature is used and optional otherwise.
177*54fd6939SJiyong Park */
178*54fd6939SJiyong Park unsigned int bl1_plat_get_next_image_id(void);
179*54fd6939SJiyong Park struct image_desc *bl1_plat_get_image_desc(unsigned int image_id);
180*54fd6939SJiyong Park
181*54fd6939SJiyong Park /*
182*54fd6939SJiyong Park * The following functions are used by firmware update
183*54fd6939SJiyong Park * feature and may optionally be overridden.
184*54fd6939SJiyong Park */
185*54fd6939SJiyong Park __dead2 void bl1_plat_fwu_done(void *client_cookie, void *reserved);
186*54fd6939SJiyong Park
187*54fd6939SJiyong Park /*
188*54fd6939SJiyong Park * This BL1 function can be used by the platforms to update/use image
189*54fd6939SJiyong Park * information for a given `image_id`.
190*54fd6939SJiyong Park */
191*54fd6939SJiyong Park int bl1_plat_handle_pre_image_load(unsigned int image_id);
192*54fd6939SJiyong Park int bl1_plat_handle_post_image_load(unsigned int image_id);
193*54fd6939SJiyong Park
194*54fd6939SJiyong Park #if MEASURED_BOOT
195*54fd6939SJiyong Park void bl1_plat_mboot_init(void);
196*54fd6939SJiyong Park void bl1_plat_mboot_finish(void);
197*54fd6939SJiyong Park #else
bl1_plat_mboot_init(void)198*54fd6939SJiyong Park static inline void bl1_plat_mboot_init(void)
199*54fd6939SJiyong Park {
200*54fd6939SJiyong Park }
bl1_plat_mboot_finish(void)201*54fd6939SJiyong Park static inline void bl1_plat_mboot_finish(void)
202*54fd6939SJiyong Park {
203*54fd6939SJiyong Park }
204*54fd6939SJiyong Park #endif /* MEASURED_BOOT */
205*54fd6939SJiyong Park
206*54fd6939SJiyong Park /*******************************************************************************
207*54fd6939SJiyong Park * Mandatory BL2 functions
208*54fd6939SJiyong Park ******************************************************************************/
209*54fd6939SJiyong Park void bl2_early_platform_setup2(u_register_t arg0, u_register_t arg1, u_register_t arg2, u_register_t arg3);
210*54fd6939SJiyong Park void bl2_plat_arch_setup(void);
211*54fd6939SJiyong Park void bl2_platform_setup(void);
212*54fd6939SJiyong Park struct meminfo *bl2_plat_sec_mem_layout(void);
213*54fd6939SJiyong Park
214*54fd6939SJiyong Park /*
215*54fd6939SJiyong Park * This function can be used by the platforms to update/use image
216*54fd6939SJiyong Park * information for given `image_id`.
217*54fd6939SJiyong Park */
218*54fd6939SJiyong Park int bl2_plat_handle_pre_image_load(unsigned int image_id);
219*54fd6939SJiyong Park int bl2_plat_handle_post_image_load(unsigned int image_id);
220*54fd6939SJiyong Park
221*54fd6939SJiyong Park /*******************************************************************************
222*54fd6939SJiyong Park * Optional BL2 functions (may be overridden)
223*54fd6939SJiyong Park ******************************************************************************/
224*54fd6939SJiyong Park #if MEASURED_BOOT
225*54fd6939SJiyong Park void bl2_plat_mboot_init(void);
226*54fd6939SJiyong Park void bl2_plat_mboot_finish(void);
227*54fd6939SJiyong Park #else
bl2_plat_mboot_init(void)228*54fd6939SJiyong Park static inline void bl2_plat_mboot_init(void)
229*54fd6939SJiyong Park {
230*54fd6939SJiyong Park }
bl2_plat_mboot_finish(void)231*54fd6939SJiyong Park static inline void bl2_plat_mboot_finish(void)
232*54fd6939SJiyong Park {
233*54fd6939SJiyong Park }
234*54fd6939SJiyong Park #endif /* MEASURED_BOOT */
235*54fd6939SJiyong Park
236*54fd6939SJiyong Park /*******************************************************************************
237*54fd6939SJiyong Park * Mandatory BL2 at EL3 functions: Must be implemented if BL2_AT_EL3 image is
238*54fd6939SJiyong Park * supported
239*54fd6939SJiyong Park ******************************************************************************/
240*54fd6939SJiyong Park void bl2_el3_early_platform_setup(u_register_t arg0, u_register_t arg1,
241*54fd6939SJiyong Park u_register_t arg2, u_register_t arg3);
242*54fd6939SJiyong Park void bl2_el3_plat_arch_setup(void);
243*54fd6939SJiyong Park
244*54fd6939SJiyong Park /*******************************************************************************
245*54fd6939SJiyong Park * Optional BL2 at EL3 functions (may be overridden)
246*54fd6939SJiyong Park ******************************************************************************/
247*54fd6939SJiyong Park void bl2_el3_plat_prepare_exit(void);
248*54fd6939SJiyong Park
249*54fd6939SJiyong Park /*******************************************************************************
250*54fd6939SJiyong Park * Mandatory BL2U functions.
251*54fd6939SJiyong Park ******************************************************************************/
252*54fd6939SJiyong Park void bl2u_early_platform_setup(struct meminfo *mem_layout,
253*54fd6939SJiyong Park void *plat_info);
254*54fd6939SJiyong Park void bl2u_plat_arch_setup(void);
255*54fd6939SJiyong Park void bl2u_platform_setup(void);
256*54fd6939SJiyong Park
257*54fd6939SJiyong Park /*******************************************************************************
258*54fd6939SJiyong Park * Conditionally mandatory BL2U functions for CSS platforms.
259*54fd6939SJiyong Park ******************************************************************************/
260*54fd6939SJiyong Park /*
261*54fd6939SJiyong Park * This function is used to perform any platform-specific actions required to
262*54fd6939SJiyong Park * handle the BL2U_SCP firmware.
263*54fd6939SJiyong Park */
264*54fd6939SJiyong Park int bl2u_plat_handle_scp_bl2u(void);
265*54fd6939SJiyong Park
266*54fd6939SJiyong Park /*******************************************************************************
267*54fd6939SJiyong Park * Mandatory BL31 functions
268*54fd6939SJiyong Park ******************************************************************************/
269*54fd6939SJiyong Park void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
270*54fd6939SJiyong Park u_register_t arg2, u_register_t arg3);
271*54fd6939SJiyong Park void bl31_plat_arch_setup(void);
272*54fd6939SJiyong Park void bl31_platform_setup(void);
273*54fd6939SJiyong Park void bl31_plat_runtime_setup(void);
274*54fd6939SJiyong Park struct entry_point_info *bl31_plat_get_next_image_ep_info(uint32_t type);
275*54fd6939SJiyong Park
276*54fd6939SJiyong Park /*******************************************************************************
277*54fd6939SJiyong Park * Mandatory PSCI functions (BL31)
278*54fd6939SJiyong Park ******************************************************************************/
279*54fd6939SJiyong Park int plat_setup_psci_ops(uintptr_t sec_entrypoint,
280*54fd6939SJiyong Park const struct plat_psci_ops **psci_ops);
281*54fd6939SJiyong Park const unsigned char *plat_get_power_domain_tree_desc(void);
282*54fd6939SJiyong Park
283*54fd6939SJiyong Park /*******************************************************************************
284*54fd6939SJiyong Park * Optional PSCI functions (BL31).
285*54fd6939SJiyong Park ******************************************************************************/
286*54fd6939SJiyong Park void plat_psci_stat_accounting_start(const psci_power_state_t *state_info);
287*54fd6939SJiyong Park void plat_psci_stat_accounting_stop(const psci_power_state_t *state_info);
288*54fd6939SJiyong Park u_register_t plat_psci_stat_get_residency(unsigned int lvl,
289*54fd6939SJiyong Park const psci_power_state_t *state_info,
290*54fd6939SJiyong Park unsigned int last_cpu_idx);
291*54fd6939SJiyong Park plat_local_state_t plat_get_target_pwr_state(unsigned int lvl,
292*54fd6939SJiyong Park const plat_local_state_t *states,
293*54fd6939SJiyong Park unsigned int ncpu);
294*54fd6939SJiyong Park
295*54fd6939SJiyong Park /*******************************************************************************
296*54fd6939SJiyong Park * Optional BL31 functions (may be overridden)
297*54fd6939SJiyong Park ******************************************************************************/
298*54fd6939SJiyong Park void bl31_plat_enable_mmu(uint32_t flags);
299*54fd6939SJiyong Park
300*54fd6939SJiyong Park /*******************************************************************************
301*54fd6939SJiyong Park * Optional BL32 functions (may be overridden)
302*54fd6939SJiyong Park ******************************************************************************/
303*54fd6939SJiyong Park void bl32_plat_enable_mmu(uint32_t flags);
304*54fd6939SJiyong Park
305*54fd6939SJiyong Park /*******************************************************************************
306*54fd6939SJiyong Park * Trusted Board Boot functions
307*54fd6939SJiyong Park ******************************************************************************/
308*54fd6939SJiyong Park int plat_get_rotpk_info(void *cookie, void **key_ptr, unsigned int *key_len,
309*54fd6939SJiyong Park unsigned int *flags);
310*54fd6939SJiyong Park int plat_get_nv_ctr(void *cookie, unsigned int *nv_ctr);
311*54fd6939SJiyong Park int plat_set_nv_ctr(void *cookie, unsigned int nv_ctr);
312*54fd6939SJiyong Park int plat_set_nv_ctr2(void *cookie, const struct auth_img_desc_s *img_desc,
313*54fd6939SJiyong Park unsigned int nv_ctr);
314*54fd6939SJiyong Park int get_mbedtls_heap_helper(void **heap_addr, size_t *heap_size);
315*54fd6939SJiyong Park int plat_get_enc_key_info(enum fw_enc_status_t fw_enc_status, uint8_t *key,
316*54fd6939SJiyong Park size_t *key_len, unsigned int *flags,
317*54fd6939SJiyong Park const uint8_t *img_id, size_t img_id_len);
318*54fd6939SJiyong Park
319*54fd6939SJiyong Park /*******************************************************************************
320*54fd6939SJiyong Park * Secure Partitions functions
321*54fd6939SJiyong Park ******************************************************************************/
322*54fd6939SJiyong Park const struct mmap_region *plat_get_secure_partition_mmap(void *cookie);
323*54fd6939SJiyong Park const struct spm_mm_boot_info *plat_get_secure_partition_boot_info(
324*54fd6939SJiyong Park void *cookie);
325*54fd6939SJiyong Park int plat_spm_sp_rd_load(struct sp_res_desc *rd, const void *ptr, size_t size);
326*54fd6939SJiyong Park int plat_spm_sp_get_next_address(void **sp_base, size_t *sp_size,
327*54fd6939SJiyong Park void **rd_base, size_t *rd_size);
328*54fd6939SJiyong Park #if defined(SPD_spmd)
329*54fd6939SJiyong Park int plat_spm_core_manifest_load(spmc_manifest_attribute_t *manifest,
330*54fd6939SJiyong Park const void *pm_addr);
331*54fd6939SJiyong Park #endif
332*54fd6939SJiyong Park /*******************************************************************************
333*54fd6939SJiyong Park * Mandatory BL image load functions(may be overridden).
334*54fd6939SJiyong Park ******************************************************************************/
335*54fd6939SJiyong Park /*
336*54fd6939SJiyong Park * This function returns pointer to the list of images that the
337*54fd6939SJiyong Park * platform has populated to load.
338*54fd6939SJiyong Park */
339*54fd6939SJiyong Park struct bl_load_info *plat_get_bl_image_load_info(void);
340*54fd6939SJiyong Park
341*54fd6939SJiyong Park /*
342*54fd6939SJiyong Park * This function returns a pointer to the shared memory that the
343*54fd6939SJiyong Park * platform has kept aside to pass trusted firmware related
344*54fd6939SJiyong Park * information that next BL image could need.
345*54fd6939SJiyong Park */
346*54fd6939SJiyong Park struct bl_params *plat_get_next_bl_params(void);
347*54fd6939SJiyong Park
348*54fd6939SJiyong Park /*
349*54fd6939SJiyong Park * This function flushes to main memory all the params that are
350*54fd6939SJiyong Park * passed to next image.
351*54fd6939SJiyong Park */
352*54fd6939SJiyong Park void plat_flush_next_bl_params(void);
353*54fd6939SJiyong Park
354*54fd6939SJiyong Park /*
355*54fd6939SJiyong Park * The below function enable Trusted Firmware components like SPDs which
356*54fd6939SJiyong Park * haven't migrated to the new platform API to compile on platforms which
357*54fd6939SJiyong Park * have the compatibility layer disabled.
358*54fd6939SJiyong Park */
359*54fd6939SJiyong Park unsigned int platform_core_pos_helper(unsigned long mpidr);
360*54fd6939SJiyong Park
361*54fd6939SJiyong Park /*
362*54fd6939SJiyong Park * Optional function to get SOC version
363*54fd6939SJiyong Park */
364*54fd6939SJiyong Park int32_t plat_get_soc_version(void);
365*54fd6939SJiyong Park
366*54fd6939SJiyong Park /*
367*54fd6939SJiyong Park * Optional function to get SOC revision
368*54fd6939SJiyong Park */
369*54fd6939SJiyong Park int32_t plat_get_soc_revision(void);
370*54fd6939SJiyong Park
371*54fd6939SJiyong Park /*
372*54fd6939SJiyong Park * Optional function to check for SMCCC function availability for platform
373*54fd6939SJiyong Park */
374*54fd6939SJiyong Park int32_t plat_is_smccc_feature_available(u_register_t fid);
375*54fd6939SJiyong Park
376*54fd6939SJiyong Park /*******************************************************************************
377*54fd6939SJiyong Park * FWU platform specific functions
378*54fd6939SJiyong Park ******************************************************************************/
379*54fd6939SJiyong Park int plat_fwu_set_metadata_image_source(unsigned int image_id,
380*54fd6939SJiyong Park uintptr_t *dev_handle,
381*54fd6939SJiyong Park uintptr_t *image_spec);
382*54fd6939SJiyong Park void plat_fwu_set_images_source(struct fwu_metadata *metadata);
383*54fd6939SJiyong Park
384*54fd6939SJiyong Park #endif /* PLATFORM_H */
385