blob: 64d086d800de66fbaa803edde777934d772167ab [file] [log] [blame]
developer550bf5e2016-07-11 16:05:23 +08001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
developer550bf5e2016-07-11 16:05:23 +08005 */
6
7#include <arch.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00008#include <common/debug.h>
9
developer550bf5e2016-07-11 16:05:23 +080010#include <power_tracer.h>
11
12#define trace_log(...) INFO("psci: " __VA_ARGS__)
13
14void trace_power_flow(unsigned long mpidr, unsigned char mode)
15{
16 switch (mode) {
17 case CPU_UP:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010018 trace_log("core %lld:%lld ON\n",
developer550bf5e2016-07-11 16:05:23 +080019 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
20 (mpidr & MPIDR_CPU_MASK));
21 break;
22 case CPU_DOWN:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010023 trace_log("core %lld:%lld OFF\n",
developer550bf5e2016-07-11 16:05:23 +080024 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
25 (mpidr & MPIDR_CPU_MASK));
26 break;
27 case CPU_SUSPEND:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010028 trace_log("core %lld:%lld SUSPEND\n",
developer550bf5e2016-07-11 16:05:23 +080029 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
30 (mpidr & MPIDR_CPU_MASK));
31 break;
32 case CLUSTER_UP:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010033 trace_log("cluster %lld ON\n",
developer550bf5e2016-07-11 16:05:23 +080034 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
35 break;
36 case CLUSTER_DOWN:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010037 trace_log("cluster %lld OFF\n",
developer550bf5e2016-07-11 16:05:23 +080038 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
39 break;
40 case CLUSTER_SUSPEND:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010041 trace_log("cluster %lld SUSPEND\n",
developer550bf5e2016-07-11 16:05:23 +080042 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
43 break;
44 default:
45 trace_log("unknown power mode\n");
46 break;
47 }
48}