Marc Bonnici | c66fc1b | 2021-12-16 18:31:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2022, Arm Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
Marc Bonnici | 503320e | 2022-02-21 15:02:36 +0000 | [diff] [blame] | 6 | #include <services/el3_spmc_ffa_memory.h> |
Marc Bonnici | c66fc1b | 2021-12-16 18:31:02 +0000 | [diff] [blame] | 7 | |
| 8 | #include <platform_def.h> |
| 9 | |
Shruti Gupta | a72adec | 2022-12-20 18:01:43 +0000 | [diff] [blame] | 10 | IMPORT_SYM(uintptr_t, __PLAT_SPMC_SHMEM_DATASTORE_START__, DATASTORE_BASE); |
Marc Bonnici | c66fc1b | 2021-12-16 18:31:02 +0000 | [diff] [blame] | 11 | |
Shruti Gupta | a72adec | 2022-12-20 18:01:43 +0000 | [diff] [blame] | 12 | __section(".arm_el3_tzc_dram") __unused static uint8_t |
Marc Bonnici | c66fc1b | 2021-12-16 18:31:02 +0000 | [diff] [blame] | 13 | plat_spmc_shmem_datastore[PLAT_SPMC_SHMEM_DATASTORE_SIZE]; |
| 14 | |
| 15 | int plat_spmc_shmem_datastore_get(uint8_t **datastore, size_t *size) |
| 16 | { |
Shruti Gupta | a72adec | 2022-12-20 18:01:43 +0000 | [diff] [blame] | 17 | *datastore = (uint8_t *)DATASTORE_BASE; |
Marc Bonnici | c66fc1b | 2021-12-16 18:31:02 +0000 | [diff] [blame] | 18 | *size = PLAT_SPMC_SHMEM_DATASTORE_SIZE; |
| 19 | return 0; |
| 20 | } |
Marc Bonnici | 503320e | 2022-02-21 15:02:36 +0000 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * Add dummy implementations of memory management related platform hooks. |
| 24 | * These can be used to implement platform specific functionality to support |
| 25 | * a memory sharing/lending operation. |
| 26 | * |
| 27 | * Note: The hooks must be located as part of the initial share request and |
| 28 | * final reclaim to prevent order dependencies with operations that may take |
| 29 | * place in the normal world without visibility of the SPMC. |
| 30 | */ |
| 31 | int plat_spmc_shmem_begin(struct ffa_mtd *desc) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | int plat_spmc_shmem_reclaim(struct ffa_mtd *desc) |
| 36 | { |
| 37 | return 0; |
| 38 | } |