developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015, 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 | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 8 | #include <common/debug.h> |
| 9 | |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 10 | #include <power_tracer.h> |
| 11 | |
| 12 | #define trace_log(...) INFO("psci: " __VA_ARGS__) |
| 13 | |
| 14 | void trace_power_flow(unsigned long mpidr, unsigned char mode) |
| 15 | { |
| 16 | switch (mode) { |
| 17 | case CPU_UP: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 18 | trace_log("core %lld:%lld ON\n", |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 19 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS, |
| 20 | (mpidr & MPIDR_CPU_MASK)); |
| 21 | break; |
| 22 | case CPU_DOWN: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 23 | trace_log("core %lld:%lld OFF\n", |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 24 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS, |
| 25 | (mpidr & MPIDR_CPU_MASK)); |
| 26 | break; |
| 27 | case CPU_SUSPEND: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 28 | trace_log("core %lld:%lld SUSPEND\n", |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 29 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS, |
| 30 | (mpidr & MPIDR_CPU_MASK)); |
| 31 | break; |
| 32 | case CLUSTER_UP: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 33 | trace_log("cluster %lld ON\n", |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 34 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS); |
| 35 | break; |
| 36 | case CLUSTER_DOWN: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 37 | trace_log("cluster %lld OFF\n", |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 38 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS); |
| 39 | break; |
| 40 | case CLUSTER_SUSPEND: |
Antonio Nino Diaz | a3fbeaa | 2018-07-12 13:23:59 +0100 | [diff] [blame] | 41 | trace_log("cluster %lld SUSPEND\n", |
developer | 65014b8 | 2015-04-13 14:47:57 +0800 | [diff] [blame] | 42 | (mpidr & MPIDR_CLUSTER_MASK) >> MPIDR_AFFINITY_BITS); |
| 43 | break; |
| 44 | default: |
| 45 | trace_log("unknown power mode\n"); |
| 46 | break; |
| 47 | } |
| 48 | } |