apusys_rv_mbox_mpu.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2024, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef APUSYS_RV_MBOX_MPU_H
  7. #define APUSYS_RV_MBOX_MPU_H
  8. #define MPU_EN (0)
  9. #define MPU_DIS (1)
  10. #define MBOX0_TX_DOMAIN (0)
  11. #define MBOX0_TX_NS (1)
  12. #define MBOX1_TX_DOMAIN (11)
  13. #define MBOX1_TX_NS (1)
  14. #define MBOX3_TX_DOMAIN (3)
  15. #define MBOX3_TX_NS (0)
  16. #define MBOX4_RX_DOMAIN (0)
  17. #define MBOX4_RX_NS (0)
  18. #define MBOX5_TX_DOMAIN (8)
  19. #define MBOX5_TX_NS (0)
  20. #define MBOX6_TX_DOMAIN (4)
  21. #define MBOX6_TX_NS (1)
  22. #define MBOX7_RX_DOMAIN (0)
  23. #define MBOX7_RX_NS (0)
  24. #define MBOXN_RX_DOMAIN (5)
  25. #define MBOXN_RX_NS (0)
  26. #define MBOXN_TX_DOMAIN (0)
  27. #define MBOXN_TX_NS (0)
  28. struct mbox_mpu_setting {
  29. uint32_t no_mpu;
  30. uint32_t rx_ns;
  31. uint32_t rx_domain;
  32. uint32_t tx_ns;
  33. uint32_t tx_domain;
  34. };
  35. static const struct mbox_mpu_setting mbox_mpu_setting_tab[] = {
  36. /* no_mpu, rx_ns, rx_domain, tx_ns, tx_domain */
  37. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOX0_TX_NS, MBOX0_TX_DOMAIN},
  38. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOX1_TX_NS, MBOX1_TX_DOMAIN},
  39. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOXN_TX_NS, MBOXN_TX_DOMAIN},
  40. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOX3_TX_NS, MBOX3_TX_DOMAIN},
  41. {MPU_DIS, MBOX4_RX_NS, MBOX4_RX_DOMAIN, MBOXN_TX_NS, MBOXN_TX_DOMAIN},
  42. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOX5_TX_NS, MBOX5_TX_DOMAIN},
  43. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOX6_TX_NS, MBOX6_TX_DOMAIN},
  44. {MPU_DIS, MBOX7_RX_NS, MBOX7_RX_DOMAIN, MBOXN_TX_NS, MBOXN_TX_DOMAIN},
  45. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOXN_TX_NS, MBOXN_TX_DOMAIN},
  46. {MPU_EN, MBOXN_RX_NS, MBOXN_RX_DOMAIN, MBOXN_TX_NS, MBOXN_TX_DOMAIN},
  47. };
  48. #define APU_MBOX_NUM ARRAY_SIZE(mbox_mpu_setting_tab)
  49. #endif /* APUSYS_RV_MBOX_MPU_H */