/*******************************************************************************
 * Copyright (c) 2018-2021 Renesas Electronics Corporation. All rights reserved.
 *
 *     RENESAS ELECTRONICS CONFIDENTIAL AND PROPRIETARY
 *
 * This software is provided as reference/sample code under the license
 * agreement between Renesas Electronics Corporation and licensee (the
 * "License Agreement") and shall be treated as specified in the License
 * Agreement.
 * These instructions, statements, and software 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 or part of these instructions, statements and
 * software must not be reproduced nor disclosed to any third party in any
 * form, unless permitted by the License Agreement.
 *
 * THIS SOFTWARE IS PROVIDED BY RENESAS ELEOCTRONICS CORPORATION "AS IS" AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
 * SATISFACTORY QUALITY, ACCURACY, TITLE AND NON-INFRINGEMENT ARE DISCLAIMED.
 * IN NO EVENT SHALL RENESAS ELECTRONICS CORPORATION BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, PUNITIVE, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 ******************************************************************************/

/*******************************************************************************
 * DESCRIPTION   : LifeC Access Protection header
 ******************************************************************************/

#ifndef ACC_PROT_LIFEC_H__
#define ACC_PROT_LIFEC_H__

#include <stdint.h>

typedef struct {
    uintptr_t   address;
    uint32_t    value;
} LIFEC_SETTING_TABLE;

void acc_prot_lifec(void);

#define LIFEC_GROUP3    (3U)
#define LIFEC_GROUP2    (2U)
#define LIFEC_GROUP1    (1U)
#define LIFEC_GROUP0    (0U)
#define LIFEC_PUBLIC    (0U)

#define LIFEC_REG_TGT(RegNo, Bits)      (((uint32_t)(RegNo) << 16U) | (uint32_t)(Bits))

#define LIFEC_TGT_M_ICUMX   LIFEC_REG_TGT(3U, 13U)

void lifec_set_master_grp(uint32_t target, uint32_t sec_grp, uint32_t safe_grp);

#endif  /* ACC_PROT_LIFEC_H__ */
