blob: 787dad13fabec780e812d1cd38897ec8440f67d6 [file] [log] [blame]
developer65014b82015-04-13 14:47:57 +08001/*
2 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
developer65014b82015-04-13 14:47:57 +08005 */
6
7#include <arch.h>
8#include <debug.h>
9#include <power_tracer.h>
10
11#define trace_log(...) INFO("psci: " __VA_ARGS__)
12
13void trace_power_flow(unsigned long mpidr, unsigned char mode)
14{
15 switch (mode) {
16 case CPU_UP:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010017 trace_log("core %lld:%lld ON\n",
developer65014b82015-04-13 14:47:57 +080018 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
19 (mpidr & MPIDR_CPU_MASK));
20 break;
21 case CPU_DOWN:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010022 trace_log("core %lld:%lld OFF\n",
developer65014b82015-04-13 14:47:57 +080023 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
24 (mpidr & MPIDR_CPU_MASK));
25 break;
26 case CPU_SUSPEND:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010027 trace_log("core %lld:%lld SUSPEND\n",
developer65014b82015-04-13 14:47:57 +080028 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS,
29 (mpidr & MPIDR_CPU_MASK));
30 break;
31 case CLUSTER_UP:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010032 trace_log("cluster %lld ON\n",
developer65014b82015-04-13 14:47:57 +080033 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
34 break;
35 case CLUSTER_DOWN:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010036 trace_log("cluster %lld OFF\n",
developer65014b82015-04-13 14:47:57 +080037 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
38 break;
39 case CLUSTER_SUSPEND:
Antonio Nino Diaza3fbeaa2018-07-12 13:23:59 +010040 trace_log("cluster %lld SUSPEND\n",
developer65014b82015-04-13 14:47:57 +080041 (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS);
42 break;
43 default:
44 trace_log("unknown power mode\n");
45 break;
46 }
47}