| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| /// System Control Power Interface |
| library fuchsia.scpi; |
| |
| const uint32 MAX_DVFS_OPPS = 16; |
| |
| enum Status { |
| /// the call completed successfully |
| OK = 0; |
| /// failed to get the DVFS operating |
| /// points information |
| ERR_DVFS_INFO = 1; |
| /// failed to get the dvfs opp index |
| /// which is set currently |
| ERR_DVFS_OPP_IDX = 2; |
| /// failed to get the temperature |
| ERR_TEMPERATURE = 3; |
| /// failed to get the fan level |
| ERR_FAN_LEVEL = 4; |
| /// failed to get cpu stats info |
| ERR_CPU_STATS = 5; |
| /// failed to get memory stat info |
| ERR_MEM_STATS = 6; |
| }; |
| |
| struct DvfsOpp { |
| uint32 freq_hz; |
| uint32 volt_uv; |
| }; |
| |
| struct SystemStatus { |
| /// operating point index for big cluster |
| uint32 big_cluster_op_index; |
| |
| /// operating point index for small cluster |
| uint32 small_cluster_op_index; |
| |
| /// current CPU temperature in degrees Celsius |
| float32 temperature_celsius; |
| |
| /// current Fan Level |
| uint32 fan_level; |
| |
| /// current CPU utilization |
| uint32 cpu_utilization; |
| |
| /// current Memory usage |
| uint32 memory_utilization; |
| }; |
| |
| [Discoverable] |
| protocol SystemController { |
| GetDvfsInfo(uint32 power_domain) -> (Status err, vector<DvfsOpp> opps); |
| GetSystemStatus() -> (Status err, SystemStatus sys_status); |
| }; |