fvp_el3_spmc.c 1.4 KB

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