LCOV - code coverage report
Current view: top level - zephyr/drivers/firmware/scmi/nxp - cpu.h Coverage Total Hit
Test: new.info Lines: 26.3 % 19 5
Test Date: 2025-09-05 20:47:19

            Line data    Source code
       1            1 : /*
       2              :  * Copyright 2025 NXP
       3              :  *
       4              :  * SPDX-License-Identifier: Apache-2.0
       5              :  */
       6              : 
       7              : /**
       8              :  * @file
       9              :  * @brief SCMI power domain protocol helpers
      10              :  */
      11              : 
      12              : #ifndef _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CPU_H_
      13              : #define _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CPU_H_
      14              : 
      15              : #include <zephyr/drivers/firmware/scmi/protocol.h>
      16              : #if __has_include("scmi_cpu_soc.h")
      17              : #include <scmi_cpu_soc.h>
      18              : #endif
      19              : 
      20            0 : #define SCMI_CPU_SLEEP_FLAG_IRQ_MUX 0x1U
      21              : 
      22            0 : #define SCMI_PROTOCOL_CPU_DOMAIN 130
      23              : 
      24            0 : #define SCMI_CPU_MAX_PDCONFIGS_T 7U
      25              : 
      26              : /**
      27              :  * @struct scmi_cpu_sleep_mode_config
      28              :  *
      29              :  * @brief Describes the parameters for the CPU_STATE_SET
      30              :  * command
      31              :  */
      32            1 : struct scmi_cpu_sleep_mode_config {
      33            0 :         uint32_t cpu_id;
      34            0 :         uint32_t flags;
      35            0 :         uint32_t sleep_mode;
      36              : };
      37              : 
      38            0 : struct scmi_pd_lpm_settings {
      39            0 :         uint32_t domain_id;
      40            0 :         uint32_t lpm_setting;
      41            0 :         uint32_t ret_mask;
      42              : };
      43              : 
      44              : /**
      45              :  * @struct scmi_cpu_pd_lpm_config
      46              :  *
      47              :  * @brief Describes cpu power domain low power mode setting
      48              :  */
      49            1 : struct scmi_cpu_pd_lpm_config {
      50            0 :         uint32_t cpu_id;
      51            0 :         uint32_t num_cfg;
      52            0 :         struct scmi_pd_lpm_settings cfgs[SCMI_CPU_MAX_PDCONFIGS_T];
      53              : };
      54              : 
      55              : /**
      56              :  * @brief CPU domain protocol command message IDs
      57              :  */
      58            0 : enum scmi_cpu_domain_message {
      59              :         SCMI_CPU_DOMAIN_MSG_PROTOCOL_VERSION = 0x0,
      60              :         SCMI_CPU_DOMAIN_MSG_PROTOCOL_ATTRIBUTES = 0x1,
      61              :         SCMI_CPU_DOMAIN_MSG_PROTOCOL_MESSAGE_ATTRIBUTES = 0x2,
      62              :         SCMI_CPU_DOMAIN_MSG_CPU_DOMAIN_ATTRIBUTES = 0x3,
      63              :         SCMI_CPU_DOMAIN_MSG_CPU_START = 0x4,
      64              :         SCMI_CPU_DOMAIN_MSG_CPU_STOP = 0x5,
      65              :         SCMI_CPU_DOMAIN_MSG_CPU_RESET_VECTOR_SET = 0x6,
      66              :         SCMI_CPU_DOMAIN_MSG_CPU_SLEEP_MODE_SET = 0x7,
      67              :         SCMI_CPU_DOMAIN_MSG_CPU_IRQ_WAKE_SET = 0x8,
      68              :         SCMI_CPU_DOMAIN_MSG_CPU_NON_IRQ_WAKE_SET = 0x9,
      69              :         SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET = 0xA,
      70              :         SCMI_CPU_DOMAIN_MSG_CPU_PER_LPM_CONFIG_SET = 0xB,
      71              :         SCMI_CPU_DOMAIN_MSG_CPU_INFO_GET = 0xC,
      72              :         SCMI_CPU_DOMAIN_MSG_NEGOTIATE_PROTOCOL_VERSION = 0x10,
      73              : };
      74              : 
      75              : /**
      76              :  * @brief Send the CPU_SLEEP_MODE_SET command and get its reply
      77              :  *
      78              :  * @param cfg pointer to structure containing configuration
      79              :  * to be set
      80              :  *
      81              :  * @retval 0 if successful
      82              :  * @retval negative errno if failure
      83              :  */
      84            1 : int scmi_cpu_sleep_mode_set(struct scmi_cpu_sleep_mode_config *cfg);
      85              : 
      86              : /**
      87              :  * @brief Send the SCMI_CPU_DOMAIN_MSG_CPU_PD_LPM_CONFIG_SET command and get its reply
      88              :  *
      89              :  * @param cfg pointer to structure containing configuration
      90              :  * to be set
      91              :  *
      92              :  * @retval 0 if successful
      93              :  * @retval negative errno if failure
      94              :  */
      95            1 : int scmi_cpu_pd_lpm_set(struct scmi_cpu_pd_lpm_config *cfg);
      96              : #endif /* _INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_SCMI_CPU_H_ */
        

Generated by: LCOV version 2.0-1