blob: 2b347ed62e23ce13c10aaff6528623acad7745d4 [file] [log] [blame]
Marc Bonnicic66fc1b2021-12-16 18:31:02 +00001/*
2 * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
Marc Bonnici503320e2022-02-21 15:02:36 +00006#include <services/el3_spmc_ffa_memory.h>
Marc Bonnicic66fc1b2021-12-16 18:31:02 +00007
8#include <platform_def.h>
9
10/*
11 * On the FVP platform when using the EL3 SPMC implementation allocate the
12 * datastore for tracking shared memory descriptors in the TZC DRAM section
13 * to ensure sufficient storage can be allocated.
14 * Provide an implementation of the accessor method to allow the datastore
15 * details to be retrieved by the SPMC.
16 * The SPMC will take care of initializing the memory region.
17 */
18
19#define PLAT_SPMC_SHMEM_DATASTORE_SIZE 512 * 1024
20
21__section("arm_el3_tzc_dram") static uint8_t
22plat_spmc_shmem_datastore[PLAT_SPMC_SHMEM_DATASTORE_SIZE];
23
24int plat_spmc_shmem_datastore_get(uint8_t **datastore, size_t *size)
25{
26 *datastore = plat_spmc_shmem_datastore;
27 *size = PLAT_SPMC_SHMEM_DATASTORE_SIZE;
28 return 0;
29}
Marc Bonnici503320e2022-02-21 15:02:36 +000030
31/*
32 * Add dummy implementations of memory management related platform hooks.
33 * These can be used to implement platform specific functionality to support
34 * a memory sharing/lending operation.
35 *
36 * Note: The hooks must be located as part of the initial share request and
37 * final reclaim to prevent order dependencies with operations that may take
38 * place in the normal world without visibility of the SPMC.
39 */
40int plat_spmc_shmem_begin(struct ffa_mtd *desc)
41{
42 return 0;
43}
44int plat_spmc_shmem_reclaim(struct ffa_mtd *desc)
45{
46 return 0;
47}