mt_smp.h 788 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (c) 2022, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_SMP_H
  7. #define MT_SMP_H
  8. #include <lib/mmio.h>
  9. #include <platform_def.h>
  10. #define CPU_PWR_STATUS (MCUCFG_BASE + 0xA840)
  11. #define SMP_CORE_TIMEOUT_MAX (50000)
  12. #define DO_SMP_CORE_ON_WAIT_TIMEOUT(k_cnt) ({ \
  13. CPU_PM_ASSERT(k_cnt < SMP_CORE_TIMEOUT_MAX); \
  14. k_cnt++; udelay(1); })
  15. void mt_smp_core_init_arch(unsigned int cluster, unsigned int cpu, int arm64,
  16. struct cpu_pwr_ctrl *pwr_ctrl);
  17. void mt_smp_core_bootup_address_set(struct cpu_pwr_ctrl *pwr_ctrl, uintptr_t entry);
  18. int mt_smp_power_core_on(unsigned int cpu_id, struct cpu_pwr_ctrl *pwr_ctrl);
  19. int mt_smp_power_core_off(struct cpu_pwr_ctrl *pwr_ctrl);
  20. void mt_smp_init(void);
  21. #endif /* MT_SMP_H */