/******************************************************************************/
/* Component Name   ICU-M Interface Library (ICUMIF)                          */
/******************************************************************************/
/* Product      : ICU-M Firmware                                              */
/******************************************************************************/
/*******************************************************************************
* Copyright(C) 2021-2023 Renesas Electronics Corporation.                       
*                                                                               
*          RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY                     
*                                                                               
* These instructions, statements, and programs are the confidential information 
* of Renesas Electronics Corporation. They must be used and modified solely for 
* the purpose for which it was furnished by Renesas Electronics Corporation.    
* All part of them must not be reproduced nor disclosed to others in any form,  
* without the prior written permission of Renesas Electronics Corporation.      
*******************************************************************************/
#if !defined(R_ICUMIF_API_GET_INFO_H)
#define R_ICUMIF_API_GET_INFO_H


/**********************************************************************************/
/* Definition                                                                     */
/**********************************************************************************/
/* number of warning data */
#define INFO_WARNING_DATA_NUM    (16u)
/* 16 is the maximum number of secure data flash physical blocks
 assumed by the target microcomputer */
#define INFO_DF_BLOCK_NUM        (16u)

/**********************************************************************************/
/* Type definition                                                                */
/**********************************************************************************/

typedef enum
{
    INFO_GET_FW_NAME,
    INFO_GET_FW_VERSION,
    INFO_GET_FW_BUILD_TYPE,
    INFO_GET_JOB_COUNT,
    INFO_GET_KEY_MAPPING,
    INFO_GET_MYDATA_SET,
    INFO_GET_MONOCTR_MAPPING,
    INFO_GET_SECURE_TICK,
    INFO_GET_SECURE_TICK_FREQ,
    INFO_GET_TIMING_1ST_STAGE_BOOT,
    INFO_GET_CMAC_MIN,
    INFO_GET_BOOT_STAGE_SLICE,
    INFO_GET_BOOT_STAGE_SANCTION,
    INFO_GET_SECURE_BOOT,
    INFO_GET_WDT,
    INFO_GET_RND,
    INFO_GET_DEBUG,
    INFO_GET_SECURE_TICK_INTERVAL,
    INFO_GET_START_PE,
    INFO_GET_EARLY_STARTUP_PE,
    INFO_GET_DEVICE_ID,
    INFO_GET_MEMCLUSTER_MAPPING,
    INFO_GET_RAM_EXECUTE,
    INFO_GET_ECC_TEST_LOCK,
    INFO_GET_NVM_DATA_WARNING,
    INFO_GET_FLS_CFG,
    INFO_GET_FREE_BLOCK,
    INFO_GET_VM_CFG,

    LAST_ITEM_INFO_FW = 0x01000000
} info_type_t;

typedef enum
{
    DATASET_SYS_CFG,
    DATASET_MEM_CLUSTER,
    DATASET_AES_KEY,
    DATASET_CR_KEY,
    DATASET_RSA_PRIV_KEY,
    DATASET_RSA_PUB_KEY,
    DATASET_ECC_PRIV_KEY,
    DATASET_ECC_PUB_KEY,
    DATASET_MYDATA,
    DATASET_RSA_PUB_EXT_KEY,
    DATASET_ECC_PUB_EXT_KEY,
    
    DATASET_FW_INTERNAL = 0xFE,
    DATASET_NONE = 0xFF,

    LAST_ITEM_DATASET = 0x01000000
} info_dataset_type_t;

typedef struct
{
    info_dataset_type_t  dataset;
    uint16_t             index;
} info_warning_data_t;

typedef struct
{
    info_warning_data_t data[INFO_WARNING_DATA_NUM];
} info_warning_t;

typedef struct
{
    uint16_t total_num;
    uint16_t num[INFO_DF_BLOCK_NUM];
} info_free_block_t;

typedef struct
{
    uint64_t    counter;
} secure_tick_info_t;

/**********************************************************************************/
/* Service parameters                                                             */
/**********************************************************************************/

typedef struct ISD_GET_INFO
{
    info_type_t         info_id;
    union
    {
        void           *p_info;
        uint64_t        padding_sys64;
    } ptr;
    volatile uint8_t    data_size_in_bytes;
} ISD_GET_INFO_t;

#endif /* R_ICUMIF_API_GET_INFO_H */
