xref: /rk3399_ARM-atf/plat/arm/board/juno/juno_el3_spmc.c (revision e9a457f4abf5e3849c863c7395dc3d973c033926)
1*e9a457f4SYeoreum Yun /*
2*e9a457f4SYeoreum Yun  * Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.
3*e9a457f4SYeoreum Yun  *
4*e9a457f4SYeoreum Yun  * SPDX-License-Identifier: BSD-3-Clause
5*e9a457f4SYeoreum Yun  */
6*e9a457f4SYeoreum Yun 
7*e9a457f4SYeoreum Yun #include <lib/xlat_tables/xlat_tables_defs.h>
8*e9a457f4SYeoreum Yun #include <services/el3_spmc_ffa_memory.h>
9*e9a457f4SYeoreum Yun 
10*e9a457f4SYeoreum Yun #include <platform_def.h>
11*e9a457f4SYeoreum Yun 
12*e9a457f4SYeoreum Yun __section(".arm_el3_tzc_dram") __unused static uint8_t plat_spmc_shmem_datastore[PAGE_SIZE];
13*e9a457f4SYeoreum Yun 
14*e9a457f4SYeoreum Yun int plat_spmc_shmem_datastore_get(uint8_t **datastore, size_t *size)
15*e9a457f4SYeoreum Yun {
16*e9a457f4SYeoreum Yun 	*datastore = (uint8_t *)plat_spmc_shmem_datastore;
17*e9a457f4SYeoreum Yun 	*size = PAGE_SIZE;
18*e9a457f4SYeoreum Yun 	return 0;
19*e9a457f4SYeoreum Yun }
20*e9a457f4SYeoreum Yun 
21*e9a457f4SYeoreum Yun /*
22*e9a457f4SYeoreum Yun  * Add dummy implementations of memory management related platform hooks.
23*e9a457f4SYeoreum Yun  * These can be used to implement platform specific functionality to support
24*e9a457f4SYeoreum Yun  * a memory sharing/lending operation.
25*e9a457f4SYeoreum Yun  *
26*e9a457f4SYeoreum Yun  * Note: The hooks must be located as part of the initial share request and
27*e9a457f4SYeoreum Yun  * final reclaim to prevent order dependencies with operations that may take
28*e9a457f4SYeoreum Yun  * place in the normal world without visibility of the SPMC.
29*e9a457f4SYeoreum Yun  */
30*e9a457f4SYeoreum Yun int plat_spmc_shmem_begin(struct ffa_mtd *desc)
31*e9a457f4SYeoreum Yun {
32*e9a457f4SYeoreum Yun 	return 0;
33*e9a457f4SYeoreum Yun }
34*e9a457f4SYeoreum Yun int plat_spmc_shmem_reclaim(struct ffa_mtd *desc)
35*e9a457f4SYeoreum Yun {
36*e9a457f4SYeoreum Yun 	return 0;
37*e9a457f4SYeoreum Yun }
38*e9a457f4SYeoreum Yun 
39*e9a457f4SYeoreum Yun int plat_spmd_handle_group0_interrupt(uint32_t intid)
40*e9a457f4SYeoreum Yun {
41*e9a457f4SYeoreum Yun 	/*
42*e9a457f4SYeoreum Yun 	 * As of now, there are no sources of Group0 secure interrupt enabled
43*e9a457f4SYeoreum Yun 	 * for Juno.
44*e9a457f4SYeoreum Yun 	 */
45*e9a457f4SYeoreum Yun 	(void)intid;
46*e9a457f4SYeoreum Yun 	return -1;
47*e9a457f4SYeoreum Yun }
48*e9a457f4SYeoreum Yun 
49