/*******************************************************************************
 * DISCLAIMER
 * This software is supplied by Renesas Electronics Corporation and is only
 * intended for use with Renesas products. No other uses are authorized. This
 * software is owned by Renesas Electronics Corporation and is protected under
 * all applicable laws, including copyright laws.
 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
 * Renesas reserves the right, without notice, to make changes to this software
 * and to discontinue the availability of this software. By using this software,
 * you agree to the additional terms and conditions found by accessing the
 * following link:
 * http://www.renesas.com/disclaimer
 * Copyright 2022 Renesas Electronics Corporation All rights reserved.
 *******************************************************************************/

/*******************************************************************************
 * DESCRIPTION   : TFMV Software minimum version table
 ******************************************************************************/
/******************************************************************************
 * @file          tfmv_ver_tbl.c
 * - Version      : 0.01
 * @brief         TFMV Software minimum version table.
 *                This is sample source code.
 * .
 *****************************************************************************/
/******************************************************************************
 * History : DD.MM.YYYY Version  Description
 *         : 05.08.2022 0.01     First Release
 *****************************************************************************/

#include <stdint.h>

#define CA_IPL  (0U)

/* Minimum software version of Secure FW */
#define SECURE_FW_CHECK_FLAG            (0x00000001U)   /* 0:disable other:enable */
#define SECURE_FW_SW_VERSION            (0x00000001U)
#define SECURE_FW_VER_OFFSET            (0x00000400U)

/* Minimum software version of RTOS */
#define RTOS_SW_CHECK_FLAG              (0x00000000U)   /* 0:disable other:enable */
#define RTOS_SW_SW_VERSION              (0x00000000U)
#define RTOS_SW_VER_OFFSET              (0x00000000U)

#if (CA_LOAD_TYPE == CA_IPL)
/* Minimum software version of CX 2nd IPL */
#define CX_2ND_IPL_CHECK_FLAG           (0x00000000U)   /* 0:disable other:enable */
#define CX_2ND_IPL_SW_VERSION           (0x00000000U)
#define CX_2ND_IPL_VER_OFFSET           (0x00000000U)
#else /* (CA_LOAD_TYPE == CA_IPL) */
/* Reserved */
#define CX_2ND_IPL_CHECK_FLAG           (0x00000000U)
#define CX_2ND_IPL_SW_VERSION           (0x00000000U)
#define CX_2ND_IPL_VER_OFFSET           (0x00000000U)
#endif /* (CA_LOAD_TYPE == CA_IPL) */

#if (RCAR_LSI == RCAR_S4)
/* Minimum software version of ICUMH program */
#define ICUMH_PROG_CHECK_FLAG           (0x00000000U)   /* 0:disable other:enable */
#define ICUMH_PROG_SW_VERSION           (0x00000000U)
#define ICUMH_PROG_VER_OFFSET           (0x00000000U)

/* Minimum software version of G4MH program(1st) */
#define G4MH_PROG_01_CHECK_FLAG         (0x00000000U)   /* 0:disable other:enable */
#define G4MH_PROG_01_SW_VERSION         (0x00000000U)
#define G4MH_PROG_01_VER_OFFSET         (0x00000000U)

/* Minimum software version of G4MH program(2nd) */
#define G4MH_PROG_02_CHECK_FLAG         (0x00000000U)   /* 0:disable other:enable */
#define G4MH_PROG_02_SW_VERSION         (0x00000000U)
#define G4MH_PROG_02_VER_OFFSET         (0x00000000U)

#else /* (RCAR_LSI == RCAR_S4) */
/* Reserved */
#define ICUMH_PROG_CHECK_FLAG           (0x00000000U)
#define ICUMH_PROG_SW_VERSION           (0x00000000U)
#define ICUMH_PROG_VER_OFFSET           (0x00000000U)
#define G4MH_PROG_01_CHECK_FLAG         (0x00000000U)
#define G4MH_PROG_01_SW_VERSION         (0x00000000U)
#define G4MH_PROG_01_VER_OFFSET         (0x00000000U)
#define G4MH_PROG_02_CHECK_FLAG         (0x00000000U)
#define G4MH_PROG_02_SW_VERSION         (0x00000000U)
#define G4MH_PROG_02_VER_OFFSET         (0x00000000U)
#endif /* (RCAR_LSI == RCAR_S4) */

/* Minimum software version of BL31 */
#define CA_PROG_01_CHECK_FLAG           (0x00000000U)   /* 0:disable other:enable */
#define CA_PROG_01_SW_VERSION           (0x00000000U)
#define CA_PROG_01_VER_OFFSET           (0x00000000U)

#if (RCAR_LSI == RCAR_S4)
/* Minimum software version of OP-TEE */
#define CA_PROG_02_CHECK_FLAG           (0x00000000U)   /* 0:disable other:enable */
#define CA_PROG_02_SW_VERSION           (0x00000000U)
#define CA_PROG_02_VER_OFFSET           (0x00000000U)
#else /* (RCAR_LSI == RCAR_S4) */
/* Reserved */
#define CA_PROG_02_CHECK_FLAG           (0x00000000U)
#define CA_PROG_02_SW_VERSION           (0x00000000U)
#define CA_PROG_02_VER_OFFSET           (0x00000000U)
#endif /* (RCAR_LSI == RCAR_S4) */

/* For 16-byte boundary */
#define RESERVED_FOR_PADDING            (0x00000000U)

__attribute__ ((section (".tfmv_tbl_top"))) const uint32_t tfmv_ver_tbl[] = {
    [0x0000 / 4] = SECURE_FW_CHECK_FLAG,
    [0x0004 / 4] = SECURE_FW_SW_VERSION,
    [0x0008 / 4] = SECURE_FW_VER_OFFSET,
    [0x0010 / 4] = RTOS_SW_CHECK_FLAG,
    [0x0014 / 4] = RTOS_SW_SW_VERSION,
    [0x0018 / 4] = RTOS_SW_VER_OFFSET,
    [0x0020 / 4] = CX_2ND_IPL_CHECK_FLAG,
    [0x0024 / 4] = CX_2ND_IPL_SW_VERSION,
    [0x0028 / 4] = CX_2ND_IPL_VER_OFFSET,
    [0x0030 / 4] = ICUMH_PROG_CHECK_FLAG,
    [0x0034 / 4] = ICUMH_PROG_SW_VERSION,
    [0x0038 / 4] = ICUMH_PROG_VER_OFFSET,
    [0x0040 / 4] = G4MH_PROG_01_CHECK_FLAG,
    [0x0044 / 4] = G4MH_PROG_01_SW_VERSION,
    [0x0048 / 4] = G4MH_PROG_01_VER_OFFSET,
    [0x0050 / 4] = G4MH_PROG_02_CHECK_FLAG,
    [0x0054 / 4] = G4MH_PROG_02_SW_VERSION,
    [0x0058 / 4] = G4MH_PROG_02_VER_OFFSET,
    [0x0060 / 4] = CA_PROG_01_CHECK_FLAG,
    [0x0064 / 4] = CA_PROG_01_SW_VERSION,
    [0x0068 / 4] = CA_PROG_01_VER_OFFSET,
    [0x0070 / 4] = CA_PROG_02_CHECK_FLAG,
    [0x0074 / 4] = CA_PROG_02_SW_VERSION,
    [0x0078 / 4] = CA_PROG_02_VER_OFFSET,
    [0x007C / 4] = RESERVED_FOR_PADDING,        /* Adjust to 16-byte boundary */
};

