cortex_a75_pubsub.c 713 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2017-2018, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <cortex_a75.h>
  7. #include <cpuamu.h>
  8. #include <lib/el3_runtime/pubsub_events.h>
  9. static void *cortex_a75_context_save(const void *arg)
  10. {
  11. if (midr_match(CORTEX_A75_MIDR) != 0)
  12. cpuamu_context_save(CORTEX_A75_AMU_NR_COUNTERS);
  13. return (void *)0;
  14. }
  15. static void *cortex_a75_context_restore(const void *arg)
  16. {
  17. if (midr_match(CORTEX_A75_MIDR) != 0)
  18. cpuamu_context_restore(CORTEX_A75_AMU_NR_COUNTERS);
  19. return (void *)0;
  20. }
  21. SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_start, cortex_a75_context_save);
  22. SUBSCRIBE_TO_EVENT(psci_suspend_pwrdown_finish, cortex_a75_context_restore);