rpmsg_platform.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2016 Freescale Semiconductor, Inc.
  3. * Copyright 2016-2022 NXP
  4. * All rights reserved.
  5. *
  6. *
  7. * SPDX-License-Identifier: BSD-3-Clause
  8. */
  9. #ifndef RPMSG_PLATFORM_H_
  10. #define RPMSG_PLATFORM_H_
  11. #include <stdint.h>
  12. /* RPMSG MU channel index */
  13. #define RPMSG_MU_CHANNEL (1)
  14. /*
  15. * Linux requires the ALIGN to 0x1000(4KB) instead of 0x80
  16. */
  17. #ifndef VRING_ALIGN
  18. #define VRING_ALIGN (0x1000U)
  19. #endif
  20. /* contains pool of descriptors and two circular buffers */
  21. #ifndef VRING_SIZE
  22. #define VRING_SIZE (0x8000UL)
  23. #endif
  24. /* define shared memory space for VRINGS per one channel */
  25. #define RL_VRING_OVERHEAD (2UL * VRING_SIZE)
  26. #define RL_GET_VQ_ID(link_id, queue_id) (((queue_id)&0x1U) | (((link_id) << 1U) & 0xFFFFFFFEU))
  27. #define RL_GET_LINK_ID(id) (((id)&0xFFFFFFFEU) >> 1U)
  28. #define RL_GET_Q_ID(id) ((id)&0x1U)
  29. #define RL_PLATFORM_IMX7ULP_M4_SRTM_LINK_ID (0U)
  30. #define RL_PLATFORM_IMX7ULP_M4_USER_LINK_ID (1U)
  31. #define RL_PLATFORM_HIGHEST_LINK_ID (1U)
  32. /* platform interrupt related functions */
  33. int32_t platform_init_interrupt(uint32_t vector_id, void *isr_data);
  34. int32_t platform_deinit_interrupt(uint32_t vector_id);
  35. int32_t platform_interrupt_enable(uint32_t vector_id);
  36. int32_t platform_interrupt_disable(uint32_t vector_id);
  37. int32_t platform_in_isr(void);
  38. void platform_notify(uint32_t vector_id);
  39. /* platform low-level time-delay (busy loop) */
  40. void platform_time_delay(uint32_t num_msec);
  41. /* platform memory functions */
  42. void platform_map_mem_region(uint32_t vrt_addr, uint32_t phy_addr, uint32_t size, uint32_t flags);
  43. void platform_cache_all_flush_invalidate(void);
  44. void platform_cache_disable(void);
  45. uintptr_t platform_vatopa(void *addr);
  46. void *platform_patova(uintptr_t addr);
  47. /* platform init/deinit */
  48. int32_t platform_init(void);
  49. int32_t platform_deinit(void);
  50. #endif /* RPMSG_PLATFORM_H_ */