apusys_rv_pwr_ctrl.h 875 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2024, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef APUSYS_RV_PWR_CTL_H
  7. #define APUSYS_RV_PWR_CTL_H
  8. #include "apusys_rv.h"
  9. /* APU MBOX */
  10. #define MBOX_FUNC_CFG (0xb0)
  11. #define MBOX_DOMAIN_CFG (0xe0)
  12. #define MBOX_CTRL_LOCK BIT(0)
  13. #define MBOX_NO_MPU_SHIFT (16)
  14. #define MBOX_RX_NS_SHIFT (16)
  15. #define MBOX_RX_DOMAIN_SHIFT (17)
  16. #define MBOX_TX_NS_SHIFT (24)
  17. #define MBOX_TX_DOMAIN_SHIFT (25)
  18. #define MBOX_SIZE (0x100)
  19. #define MBOX_NUM (8)
  20. #define APU_MBOX(i) (((i) < MBOX_NUM) ? (APU_MBOX0 + MBOX_SIZE * (i)) : \
  21. (APU_MBOX1 + MBOX_SIZE * ((i) - MBOX_NUM)))
  22. #define APU_MBOX_FUNC_CFG(i) (APU_MBOX(i) + MBOX_FUNC_CFG)
  23. #define APU_MBOX_DOMAIN_CFG(i) (APU_MBOX(i) + MBOX_DOMAIN_CFG)
  24. #define HW_SEM_TIMEOUT (0)
  25. int apusys_rv_pwr_ctrl(enum APU_PWR_OP op);
  26. #endif /* APUSYS_RV_PWR_CTL_H */