power_tracer.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <arch.h>
  7. #include <common/debug.h>
  8. #include <power_tracer.h>
  9. #define trace_log(...) INFO("psci: " __VA_ARGS__)
  10. void trace_power_flow(unsigned long mpidr, unsigned char mode)
  11. {
  12. switch (mode) {
  13. case CPU_UP:
  14. trace_log("core %lld:%lld ON\n",
  15. (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
  16. (mpidr & MPIDR_CPU_MASK));
  17. break;
  18. case CPU_DOWN:
  19. trace_log("core %lld:%lld OFF\n",
  20. (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
  21. (mpidr & MPIDR_CPU_MASK));
  22. break;
  23. case CPU_SUSPEND:
  24. trace_log("core %lld:%lld SUSPEND\n",
  25. (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
  26. (mpidr & MPIDR_CPU_MASK));
  27. break;
  28. case CLUSTER_UP:
  29. trace_log("cluster %lld ON\n",
  30. (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
  31. break;
  32. case CLUSTER_DOWN:
  33. trace_log("cluster %lld OFF\n",
  34. (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
  35. break;
  36. case CLUSTER_SUSPEND:
  37. trace_log("cluster %lld SUSPEND\n",
  38. (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
  39. break;
  40. default:
  41. trace_log("unknown power mode\n");
  42. break;
  43. }
  44. }