developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <debug.h> |
| 9 | #include <power_tracer.h> |
| 10 | |
| 11 | #define trace_log(...) INFO("psci: " __VA_ARGS__) |
| 12 | |
| 13 | void trace_power_flow(unsigned long mpidr, unsigned char mode) |
| 14 | { |
| 15 | switch (mode) { |
| 16 | case CPU_UP: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 17 | trace_log("core %lld:%lld ON\n", |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 18 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS, |
| 19 | (mpidr & MPIDR_CPU_MASK)); |
| 20 | break; |
| 21 | case CPU_DOWN: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 22 | trace_log("core %lld:%lld OFF\n", |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 23 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS, |
| 24 | (mpidr & MPIDR_CPU_MASK)); |
| 25 | break; |
| 26 | case CPU_SUSPEND: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 27 | trace_log("core %lld:%lld SUSPEND\n", |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 28 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS, |
| 29 | (mpidr & MPIDR_CPU_MASK)); |
| 30 | break; |
| 31 | case CLUSTER_UP: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 32 | trace_log("cluster %lld ON\n", |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 33 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS); |
| 34 | break; |
| 35 | case CLUSTER_DOWN: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 36 | trace_log("cluster %lld OFF\n", |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 37 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS); |
| 38 | break; |
| 39 | case CLUSTER_SUSPEND: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 40 | trace_log("cluster %lld SUSPEND\n", |
developer | 550bf5e | 2016-07-11 16:05:23 +0800 | [diff] [blame] | 41 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS); |
| 42 | break; |
| 43 | default: |
| 44 | trace_log("unknown power mode\n"); |
| 45 | break; |
| 46 | } |
| 47 | } |