/*==================================================================================================
*   Project              : RTD AUTOSAR 4.7
*   Platform             : CORTEXM
*   Peripheral           : 
*   Dependencies         : none
*
*   Autosar Version      : 4.7.0
*   Autosar Revision     : ASR_REL_4_7_REV_0000
*   Autosar Conf.Variant :
*   SW Version           : 4.0.0
*   Build Version        : S32K3_RTD_4_0_0_D2311_ASR_REL_4_7_REV_0000_20231128
*
*   Copyright 2020 - 2023 NXP
*
*   NXP Confidential. This software is owned or controlled by NXP and may only be
*   used strictly in accordance with the applicable license terms. By expressly
*   accepting such terms or by downloading, installing, activating and/or otherwise
*   using the software, you are agreeing that you have read, and that you agree to
*   comply with and are bound by, such license terms. If you do not agree to be
*   bound by the applicable license terms, then you may not retain, install,
*   activate or otherwise use the software.
==================================================================================================*/

/**
*   @file Xrdc_Ip_PBcfg.c
*
*   @addtogroup XRDC_IP XRDC IPV Driver
*   @{
*/

#ifdef __cplusplus
extern "C"{
#endif

/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Xrdc_Ip_Types.h"
#include "Xrdc_Ip_Cfg.h"
#include "Xrdc_Ip_Device_Registers.h"

/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define RM_XRDC_IP_PBCFG_VENDOR_ID_C                     43
#define RM_XRDC_IP_PBCFG_AR_RELEASE_MAJOR_VERSION_C      4
#define RM_XRDC_IP_PBCFG_AR_RELEASE_MINOR_VERSION_C      7
#define RM_XRDC_IP_PBCFG_AR_RELEASE_REVISION_VERSION_C   0
#define RM_XRDC_IP_PBCFG_SW_MAJOR_VERSION_C              4
#define RM_XRDC_IP_PBCFG_SW_MINOR_VERSION_C              0
#define RM_XRDC_IP_PBCFG_SW_PATCH_VERSION_C              0
/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Checks against Xrdc_Ip_Types.h */
#if (RM_XRDC_IP_PBCFG_VENDOR_ID_C != RM_XRDC_IP_TYPES_VENDOR_ID)
    #error "Xrdc_Ip_PBcfg.c and Xrdc_Ip_Types.h have different vendor ids"
#endif
#if ((RM_XRDC_IP_PBCFG_AR_RELEASE_MAJOR_VERSION_C    != RM_XRDC_IP_TYPES_AR_RELEASE_MAJOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_AR_RELEASE_MINOR_VERSION_C    != RM_XRDC_IP_TYPES_AR_RELEASE_MINOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_AR_RELEASE_REVISION_VERSION_C != RM_XRDC_IP_TYPES_AR_RELEASE_REVISION_VERSION))
     #error "AUTOSAR Version Numbers of Xrdc_Ip_PBcfg.c and Xrdc_Ip_Types.h are different"
#endif
#if ((RM_XRDC_IP_PBCFG_SW_MAJOR_VERSION_C != RM_XRDC_IP_TYPES_SW_MAJOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_SW_MINOR_VERSION_C != RM_XRDC_IP_TYPES_SW_MINOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_SW_PATCH_VERSION_C != RM_XRDC_IP_TYPES_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Xrdc_Ip_PBcfg.c and Xrdc_Ip_Types.h are different"
#endif

/* Checks against Xrdc_Ip_Cfg.h */
#if (RM_XRDC_IP_PBCFG_VENDOR_ID_C != RM_XRDC_IP_CFG_VENDOR_ID)
    #error "Xrdc_Ip_PBcfg.c and Xrdc_Ip_Cfg.h have different vendor ids"
#endif
#if ((RM_XRDC_IP_PBCFG_AR_RELEASE_MAJOR_VERSION_C    != RM_XRDC_IP_CFG_AR_RELEASE_MAJOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_AR_RELEASE_MINOR_VERSION_C    != RM_XRDC_IP_CFG_AR_RELEASE_MINOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_AR_RELEASE_REVISION_VERSION_C != RM_XRDC_IP_CFG_AR_RELEASE_REVISION_VERSION))
     #error "AUTOSAR Version Numbers of Xrdc_Ip_PBcfg.c and Xrdc_Ip_Cfg.h are different"
#endif
#if ((RM_XRDC_IP_PBCFG_SW_MAJOR_VERSION_C != RM_XRDC_IP_CFG_SW_MAJOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_SW_MINOR_VERSION_C != RM_XRDC_IP_CFG_SW_MINOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_SW_PATCH_VERSION_C != RM_XRDC_IP_CFG_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Xrdc_Ip_PBcfg.c and Xrdc_Ip_Cfg.h are different"
#endif

/* Checks against Xrdc_Ip_Device_Registers.h */
#if (RM_XRDC_IP_PBCFG_VENDOR_ID_C != RM_XRDC_IP_DEVICE_REGISTERS_VENDOR_ID)
    #error "Xrdc_Ip_PBcfg.c and Xrdc_Ip_Device_Registers.h have different vendor ids"
#endif
#if ((RM_XRDC_IP_PBCFG_AR_RELEASE_MAJOR_VERSION_C    != RM_XRDC_IP_DEVICE_REGISTERS_AR_RELEASE_MAJOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_AR_RELEASE_MINOR_VERSION_C    != RM_XRDC_IP_DEVICE_REGISTERS_AR_RELEASE_MINOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_AR_RELEASE_REVISION_VERSION_C != RM_XRDC_IP_DEVICE_REGISTERS_AR_RELEASE_REVISION_VERSION))
     #error "AUTOSAR Version Numbers of Xrdc_Ip_PBcfg.c and Xrdc_Ip_Device_Registers.h are different"
#endif
#if ((RM_XRDC_IP_PBCFG_SW_MAJOR_VERSION_C != RM_XRDC_IP_DEVICE_REGISTERS_SW_MAJOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_SW_MINOR_VERSION_C != RM_XRDC_IP_DEVICE_REGISTERS_SW_MINOR_VERSION) || \
     (RM_XRDC_IP_PBCFG_SW_PATCH_VERSION_C != RM_XRDC_IP_DEVICE_REGISTERS_SW_PATCH_VERSION) \
    )
    #error "Software Version Numbers of Xrdc_Ip_PBcfg.c and Xrdc_Ip_Device_Registers.h are different"
#endif
/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/


/*==================================================================================================
*                                       LOCAL MACROS
==================================================================================================*/



/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
*                                      BUFFER DECLARATIONS
==================================================================================================*/

/*==================================================================================================
*                                   STATE STRUCTURE DECLARATIONS
==================================================================================================*/

/*==================================================================================================
*                                      LOCAL CONSTANTS
==================================================================================================*/

/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/

/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/

#define RM_START_SEC_CONFIG_DATA_UNSPECIFIED
#include "Rm_MemMap.h"
static const uint32 Xrdc_Instances_InUsed[1] =
{
    XRDC_INSTANCE0
};

/* XRDC instance: XRDC_INSTANCE0 */

static const Xrdc_Ip_MemConfigType Xrdc_Memory_Config_XRDC_INSTANCE0[1] =
{
    {
        /*Select Memory region controller Xrdc_0_PFLASH_0 will be used to control the address range below */
        XRDC_MRC0,
        /*Each memory region controller include 16 descriptors to write configuration. If multiple descriptors are configured the policy will be ORed by all the descriptors */
        (uint32)0UL,
        /*Start address for Xrdc_0_PFLASH_0 controller and descriptor 0 */
        (uint32)0x0UL,
        /*End address for Xrdc_0_PFLASH_0 controller and descriptor 0 */
        (uint32)0xffffffffUL,
        /*Enable Semaphore would require the domain must own the gate to have access right for this memory range */
        (uint32)XRDC_SEMA4_DISABLE,
        /*Number of the gate of sema4 for granting access*/
        (uint32)0UL,
        /*Xrdc MRGD bit lock*/
        XRDC_MRGD_W3_UNLOCK,
        /*Access policy for Domains 0-7 is calculated automatically*/
        (uint32)0x7UL,
        /*Access policy for Domains 8-15 is calculated automatically*/
        (uint32)0x0UL
    }
};

static const Xrdc_Ip_PeripheralConfigType Xrdc_Peripheral_Config_XRDC_INSTANCE0[1] =
{
    {
        /*Peripheral slot number of a block of peripherals. Checking Reference manual for chip specific*/
        (uint32)204UL,
        /*Enable Semaphore would require the domain must own the gate to have access right for this peripheral slot */
        (uint32)XRDC_SEMA4_DISABLE,
        /*Number of the gate of sema4 for granting access*/
        (uint32)0UL,
        /*Enable or disable PDAC lock bit. */
        (uint32)XRDC_PDAC_W1_UNLOCK,
        /*Access policy for Domains 0-7 is calculated automatically*/
        (uint32)0x7UL,
        /*Access policy for Domains 8-15 is calculated automatically*/
        (uint32)0x0UL
    }
};

static const Xrdc_Ip_DomainConfigType Xrdc_Domain_Config_XRDC_INSTANCE0[1] =
{
    {
        /*Valid DomainID*/
        XRDC_DOMAIN0,
        /*Select the MDA register respect the Master instance */
        XRDC_MDAC4,
        /*Attribute to specfiy the type of current master which is core or non core master*/
        XRDC_CORE_MASTER,
        /*PID field only has meaning if the core is core master type and PID mode enable*/
        0,
        /*PID mask*/
        0,
        /*PID mode enable - only valid if the master instance is core type*/
        XRDC_MDA_PID_DISABLE,
        /*Three State Model to be done later if architecture support*/
        0UL,
        /*Selection of descriptor for current master core. If master is non-core master this field should be omitted*/
        XRDC_WORD0,
        /*Domain ID bypass. If master is core master this field should be omitted*/
        XRDC_MDA_DID_BYPASS_USED,
        /*Xrdc MDA DFMT bit lock*/
        XRDC_MDA_LK1_UNLOCK,
        /*Domain Secure Mode*/
        XRDC_SECURE,
        /*Domain Priviledged Mode*/
        XRDC_USER_MODE
    }
};

static const Xrdc_Ip_InstanceConfigType Xrdc_Config_XRDC_INSTANCE0 =
{
    XRDC_INSTANCE0,
    Xrdc_Domain_Config_XRDC_INSTANCE0,
    (uint32)1UL,
    Xrdc_Memory_Config_XRDC_INSTANCE0,
    (uint32)1UL,
    Xrdc_Peripheral_Config_XRDC_INSTANCE0,
    (uint32)1UL,
    /*Xrdc CR bit lock*/
    XRDC_CR_UNLOCK,
        XRDC_PID_UNLOCKED,
};


static const Xrdc_Ip_InstanceConfigType * const aXrdc_Config_Array[1] = { &Xrdc_Config_XRDC_INSTANCE0};

const Xrdc_Ip_ConfigType Xrdc_Config =
{
    aXrdc_Config_Array,
    (uint32)1UL,
    Xrdc_Instances_InUsed,
    (uint32)1UL
};


#define RM_STOP_SEC_CONFIG_DATA_UNSPECIFIED
#include "Rm_MemMap.h"


/*==================================================================================================
*                                   LOCAL FUNCTION PROTOTYPES
==================================================================================================*/

/*==================================================================================================
*                                       LOCAL FUNCTIONS
==================================================================================================*/

/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

#ifdef __cplusplus
}
#endif

/** @} */

