mirror of https://github.com/ARMmbed/mbed-os.git
License
parent
b4a77f6ead
commit
dc71ec4a81
|
@ -1,49 +1,25 @@
|
|||
/***************************************************************************//**
|
||||
* \file cyprotection.c
|
||||
* \version 1.0
|
||||
/* mbed Microcontroller Library
|
||||
*
|
||||
* \brief
|
||||
* This is the source code for the protection unit config functions wrappers.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
*
|
||||
* <EFBFBD> 2018, Cypress Semiconductor Corporation
|
||||
|
||||
* (c) 2018, Cypress Semiconductor Corporation
|
||||
* or a subsidiary of Cypress Semiconductor Corporation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* This software, including source code, documentation and related
|
||||
* materials (<EFBFBD>Software<EFBFBD>), is owned by Cypress Semiconductor
|
||||
* Corporation or one of its subsidiaries (<EFBFBD>Cypress<EFBFBD>) and is protected by
|
||||
* and subject to worldwide patent protection (United States and foreign),
|
||||
* United States copyright laws and international treaty provisions.
|
||||
* Therefore, you may use this Software only as provided in the license
|
||||
* agreement accompanying the software package from which you
|
||||
* obtained this Software (<EFBFBD>EULA<EFBFBD>).
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* If no EULA applies, Cypress hereby grants you a personal, non-
|
||||
* exclusive, non-transferable license to copy, modify, and compile the
|
||||
* Software source code solely for use in connection with Cypress<EFBFBD>s
|
||||
* integrated circuit products. Any reproduction, modification, translation,
|
||||
* compilation, or representation of this Software except as specified
|
||||
* above is prohibited without the express written permission of Cypress.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO
|
||||
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING,
|
||||
* BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Cypress reserves the right to make
|
||||
* changes to the Software without notice. Cypress does not assume any
|
||||
* liability arising out of the application or use of the Software or any
|
||||
* product or circuit described in the Software. Cypress does not
|
||||
* authorize its products for use in any products where a malfunction or
|
||||
* failure of the Cypress product may reasonably be expected to result in
|
||||
* significant property damage, injury or death (<EFBFBD>High Risk Product<EFBFBD>). By
|
||||
* including Cypress<EFBFBD>s product in a High Risk Product, the manufacturer
|
||||
* of such system or application assumes all risk of such use and in doing
|
||||
* so agrees to indemnify Cypress against all liability.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
******************************************************************************/
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "cyprotection.h"
|
||||
|
||||
|
@ -311,7 +287,7 @@ cy_en_prot_status_t bus_masters_protect(cy_bus_master_config_t bus_masters_confi
|
|||
* none
|
||||
*
|
||||
* Called by:
|
||||
* isAccessAlowedSMPU, isAccessAlowedMPU
|
||||
* isAccessAllowedSMPU, isAccessAllowedMPU
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
|
@ -359,7 +335,7 @@ static uint8_t isProtRangeMatched(uint32_t startAddrMem, uint32_t memSize, uint3
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isAccessAlowedFixedRgPPU
|
||||
* Function Name: isAccessAllowedFixedRgPPU
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* The function checks whether a peripheral region is closed by Fixed Region PPU
|
||||
|
@ -379,13 +355,13 @@ static uint8_t isProtRangeMatched(uint32_t startAddrMem, uint32_t memSize, uint3
|
|||
* isProtRangeMatched
|
||||
*
|
||||
* Called by:
|
||||
* isPeriferalAccessAllowed
|
||||
* isPeripheralAccessAllowed
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
static uint8_t isAccessAlowedFixedRgPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
static uint8_t isAccessAllowedFixedRgPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed = 1;
|
||||
|
@ -449,7 +425,7 @@ static uint8_t isAccessAlowedFixedRgPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isAccessAlowedFixedSlPPU
|
||||
* Function Name: isAccessAllowedFixedSlPPU
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* The function checks whether a peripheral region is closed by Fixed Slave PPU
|
||||
|
@ -469,13 +445,13 @@ static uint8_t isAccessAlowedFixedRgPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
* isProtRangeMatched
|
||||
*
|
||||
* Called by:
|
||||
* isPeriferalAccessAllowed
|
||||
* isPeripheralAccessAllowed
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
static uint8_t isAccessAlowedFixedSlPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
static uint8_t isAccessAllowedFixedSlPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed = 1;
|
||||
|
@ -573,7 +549,7 @@ static uint8_t isAccessAlowedFixedSlPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isAccessAlowedProgPPU
|
||||
* Function Name: isAccessAllowedProgPPU
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* The function checks whether a peripheral region is closed by Programmable PPU
|
||||
|
@ -593,13 +569,13 @@ static uint8_t isAccessAlowedFixedSlPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
* isProtRangeMatched
|
||||
*
|
||||
* Called by:
|
||||
* isPeriferalAccessAllowed
|
||||
* isPeripheralAccessAllowed
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
static uint8_t isAccessAlowedProgPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
static uint8_t isAccessAllowedProgPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed = 1;
|
||||
|
@ -660,7 +636,7 @@ static uint8_t isAccessAlowedProgPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isAccessAlowedGrPPU
|
||||
* Function Name: isAccessAllowedGrPPU
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* The function checks whether a peripheral region is closed by Group PPU
|
||||
|
@ -680,13 +656,13 @@ static uint8_t isAccessAlowedProgPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
* isProtRangeMatched
|
||||
*
|
||||
* Called by:
|
||||
* isPeriferalAccessAllowed
|
||||
* isPeripheralAccessAllowed
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
static uint8_t isAccessAlowedGrPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
static uint8_t isAccessAllowedGrPPU(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed = 1;
|
||||
|
@ -750,7 +726,7 @@ static uint8_t isAccessAlowedGrPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isPeriferalAccessAllowed
|
||||
* Function Name: isPeripheralAccessAllowed
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* Checks if the given peripheral region is protected by PPU
|
||||
|
@ -767,7 +743,8 @@ static uint8_t isAccessAlowedGrPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
* uint8_t accessAllowed (values: 0 (no) /1 (yes))
|
||||
*
|
||||
* Calls:
|
||||
* isAccessAlowedGrPPU, isAccessAlowedProgPPU, isAccessAlowedFixedPPU, isAccessAlowedRegionPPU
|
||||
* isAccessAllowedGrPPU, isAccessAllowedProgPPU, isAccessAllowedFixedPPU,
|
||||
* isAccessAllowedRegionPPU
|
||||
*
|
||||
* Called by:
|
||||
* none
|
||||
|
@ -776,30 +753,30 @@ static uint8_t isAccessAlowedGrPPU(uint32_t perStartAddr, uint32_t perSize,
|
|||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
uint8_t isPeriferalAccessAllowed(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t isPeripheralAccessAllowed(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed;
|
||||
|
||||
accessAllowed = isAccessAlowedGrPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
accessAllowed = isAccessAllowedGrPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
if (accessAllowed)
|
||||
{
|
||||
accessAllowed = isAccessAlowedProgPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
accessAllowed = isAccessAllowedProgPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
}
|
||||
if (accessAllowed)
|
||||
{
|
||||
accessAllowed = isAccessAlowedFixedSlPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
accessAllowed = isAccessAllowedFixedSlPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
}
|
||||
if (accessAllowed)
|
||||
{
|
||||
accessAllowed = isAccessAlowedFixedRgPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
accessAllowed = isAccessAllowedFixedRgPPU(perStartAddr, perSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
}
|
||||
|
||||
return accessAllowed;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isAccessAlowedSMPU
|
||||
* Function Name: isAccessAllowedSMPU
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* The function checks whether a memory region is closed by SMPU for a master
|
||||
|
@ -825,7 +802,7 @@ uint8_t isPeriferalAccessAllowed(uint32_t perStartAddr, uint32_t perSize,
|
|||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
static uint8_t isAccessAlowedSMPU(uint32_t memStartAddr, uint32_t memSize,
|
||||
static uint8_t isAccessAllowedSMPU(uint32_t memStartAddr, uint32_t memSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed = 1;
|
||||
|
@ -887,7 +864,7 @@ static uint8_t isAccessAlowedSMPU(uint32_t memStartAddr, uint32_t memSize,
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
* Function Name: isAccessAlowedMPU
|
||||
* Function Name: isAccessAllowedMPU
|
||||
******************************************************************************
|
||||
* Summary:
|
||||
* The function checks whether a memory region is closed by MPU for a master
|
||||
|
@ -912,7 +889,7 @@ static uint8_t isAccessAlowedSMPU(uint32_t memStartAddr, uint32_t memSize,
|
|||
*
|
||||
*
|
||||
*****************************************************************************/
|
||||
static uint8_t isAccessAlowedMPU(uint32_t memStartAddr, uint32_t memSize,
|
||||
static uint8_t isAccessAllowedMPU(uint32_t memStartAddr, uint32_t memSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, cy_en_prot_perm_t accessType)
|
||||
{
|
||||
uint8_t accessAllowed = 1;
|
||||
|
@ -982,7 +959,7 @@ static uint8_t isAccessAlowedMPU(uint32_t memStartAddr, uint32_t memSize,
|
|||
* uint8_t accessAllowed (values: 0 (no) /1 (yes))
|
||||
*
|
||||
* Calls:
|
||||
* CheckEnabledMPUProtection, isAccessAlowedSMPU
|
||||
* CheckEnabledMPUProtection, isAccessAllowedSMPU
|
||||
*
|
||||
* Called by:
|
||||
* none
|
||||
|
@ -996,10 +973,10 @@ uint8_t isMemoryAccessAllowed(uint32_t memStartAddr, uint32_t memSize,
|
|||
{
|
||||
uint8_t accessAllowed;
|
||||
|
||||
accessAllowed = isAccessAlowedMPU(memStartAddr, memSize, privModeFlag, nsecureFlag, accessType);
|
||||
accessAllowed = isAccessAllowedMPU(memStartAddr, memSize, privModeFlag, nsecureFlag, accessType);
|
||||
if (accessAllowed)
|
||||
{
|
||||
accessAllowed = isAccessAlowedSMPU(memStartAddr, memSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
accessAllowed = isAccessAllowedSMPU(memStartAddr, memSize, privModeFlag, nsecureFlag, protectionCtx, accessType);
|
||||
}
|
||||
|
||||
return accessAllowed;
|
||||
|
|
|
@ -1,50 +1,25 @@
|
|||
/***************************************************************************//**
|
||||
* \file cyprotection.h
|
||||
* \version 1.0
|
||||
/* mbed Microcontroller Library
|
||||
*
|
||||
* \brief
|
||||
* This is the header file for the protection configuration structures
|
||||
* and functions.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
*
|
||||
* <EFBFBD> 2018, Cypress Semiconductor Corporation
|
||||
|
||||
* (c) 2018, Cypress Semiconductor Corporation
|
||||
* or a subsidiary of Cypress Semiconductor Corporation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* This software, including source code, documentation and related
|
||||
* materials (<EFBFBD>Software<EFBFBD>), is owned by Cypress Semiconductor
|
||||
* Corporation or one of its subsidiaries (<EFBFBD>Cypress<EFBFBD>) and is protected by
|
||||
* and subject to worldwide patent protection (United States and foreign),
|
||||
* United States copyright laws and international treaty provisions.
|
||||
* Therefore, you may use this Software only as provided in the license
|
||||
* agreement accompanying the software package from which you
|
||||
* obtained this Software (<EFBFBD>EULA<EFBFBD>).
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* If no EULA applies, Cypress hereby grants you a personal, non-
|
||||
* exclusive, non-transferable license to copy, modify, and compile the
|
||||
* Software source code solely for use in connection with Cypress<EFBFBD>s
|
||||
* integrated circuit products. Any reproduction, modification, translation,
|
||||
* compilation, or representation of this Software except as specified
|
||||
* above is prohibited without the express written permission of Cypress.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO
|
||||
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING,
|
||||
* BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Cypress reserves the right to make
|
||||
* changes to the Software without notice. Cypress does not assume any
|
||||
* liability arising out of the application or use of the Software or any
|
||||
* product or circuit described in the Software. Cypress does not
|
||||
* authorize its products for use in any products where a malfunction or
|
||||
* failure of the Cypress product may reasonably be expected to result in
|
||||
* significant property damage, injury or death (<EFBFBD>High Risk Product<EFBFBD>). By
|
||||
* including Cypress<EFBFBD>s product in a High Risk Product, the manufacturer
|
||||
* of such system or application assumes all risk of such use and in doing
|
||||
* so agrees to indemnify Cypress against all liability.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
******************************************************************************/
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _CYPROTECTION_H_
|
||||
#define _CYPROTECTION_H_
|
||||
|
@ -181,7 +156,7 @@ cy_en_prot_status_t ppu_prog_protect(cy_ppu_prog_cfg_t ppu_config_arr[], uint32_
|
|||
cy_en_prot_status_t ppu_fixed_gr_protect(cy_ppu_fixed_gr_cfg_t ppu_config_arr[], uint32_t arr_length);
|
||||
cy_en_prot_status_t bus_masters_protect(cy_bus_master_config_t bus_masters_config_arr[], uint32_t arr_length);
|
||||
|
||||
uint8_t isPeriferalAccessAllowed(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t isPeripheralAccessAllowed(uint32_t perStartAddr, uint32_t perSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType);
|
||||
uint8_t isMemoryAccessAllowed(uint32_t memStartAddr, uint32_t memSize,
|
||||
uint8_t privModeFlag, uint8_t nsecureFlag, enum cy_en_prot_pc_t protectionCtx, cy_en_prot_perm_t accessType);
|
||||
|
|
|
@ -1,49 +1,25 @@
|
|||
/***************************************************************************//**
|
||||
* \file cyprotection_config.h
|
||||
* \version 1.0
|
||||
/* mbed Microcontroller Library
|
||||
*
|
||||
* \brief
|
||||
* This is the header with protection configurations defines.
|
||||
*
|
||||
********************************************************************************
|
||||
* \copyright
|
||||
*
|
||||
* © 2018, Cypress Semiconductor Corporation
|
||||
|
||||
* (c) 2018, Cypress Semiconductor Corporation
|
||||
* or a subsidiary of Cypress Semiconductor Corporation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* This software, including source code, documentation and related
|
||||
* materials (“Software”), is owned by Cypress Semiconductor
|
||||
* Corporation or one of its subsidiaries (“Cypress”) and is protected by
|
||||
* and subject to worldwide patent protection (United States and foreign),
|
||||
* United States copyright laws and international treaty provisions.
|
||||
* Therefore, you may use this Software only as provided in the license
|
||||
* agreement accompanying the software package from which you
|
||||
* obtained this Software (“EULA”).
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* If no EULA applies, Cypress hereby grants you a personal, non-
|
||||
* exclusive, non-transferable license to copy, modify, and compile the
|
||||
* Software source code solely for use in connection with Cypress’s
|
||||
* integrated circuit products. Any reproduction, modification, translation,
|
||||
* compilation, or representation of this Software except as specified
|
||||
* above is prohibited without the express written permission of Cypress.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* Disclaimer: THIS SOFTWARE IS PROVIDED AS-IS, WITH NO
|
||||
* WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING,
|
||||
* BUT NOT LIMITED TO, NONINFRINGEMENT, IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. Cypress reserves the right to make
|
||||
* changes to the Software without notice. Cypress does not assume any
|
||||
* liability arising out of the application or use of the Software or any
|
||||
* product or circuit described in the Software. Cypress does not
|
||||
* authorize its products for use in any products where a malfunction or
|
||||
* failure of the Cypress product may reasonably be expected to result in
|
||||
* significant property damage, injury or death (“High Risk Product”). By
|
||||
* including Cypress’s product in a High Risk Product, the manufacturer
|
||||
* of such system or application assumes all risk of such use and in doing
|
||||
* so agrees to indemnify Cypress against all liability.
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
******************************************************************************/
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _CYPROTECTION_CONFIG_H_
|
||||
#define _CYPROTECTION_CONFIG_H_
|
||||
|
@ -59,8 +35,6 @@ CY_PROT_PCMASK3 + CY_PROT_PCMASK4)
|
|||
|
||||
#define ALL_SUBREGIONS (0x0)
|
||||
|
||||
/* !!! regionSize must power be power of 2 !!! */
|
||||
|
||||
const cy_smpu_region_config_t flash_spm_smpu_config[] = {
|
||||
/* FLASH_PC1_SPM */
|
||||
{
|
||||
|
@ -68,6 +42,7 @@ const cy_smpu_region_config_t flash_spm_smpu_config[] = {
|
|||
.regionSize = CY_PROT_SIZE_512KB,
|
||||
.subregions = ALL_SUBREGIONS,
|
||||
.userPermission = CY_PROT_PERM_RX,
|
||||
/*.privPermission = CY_PROT_PERM_RX,*/
|
||||
.privPermission = CY_PROT_PERM_RWX,
|
||||
.secure = true,
|
||||
.pcMatch = false,
|
||||
|
@ -85,6 +60,7 @@ const cy_smpu_region_config_t sram_spm_smpu_config[] = {
|
|||
.regionSize = CY_PROT_SIZE_64KB,
|
||||
.subregions = ALL_SUBREGIONS,
|
||||
.userPermission = CY_PROT_PERM_DISABLED,
|
||||
/*.privPermission = CY_PROT_PERM_RW,*/
|
||||
.privPermission = CY_PROT_PERM_RWX,
|
||||
.secure = true,
|
||||
.pcMatch = false,
|
||||
|
@ -164,6 +140,7 @@ const cy_ppu_fixed_rg_cfg_t fixed_rg_spm_ppu_config[] = {
|
|||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
.pcMatch = false,
|
||||
/*.pcMask = CY_PROT_PCMASK7,*/
|
||||
.pcMask = ALL_PROTECTION_CONTEXTS_MASK - CY_PROT_PCMASK7,
|
||||
.userMstPermission = CY_PROT_PERM_R,
|
||||
.privMstPermission = CY_PROT_PERM_RW,
|
||||
|
@ -188,6 +165,7 @@ const cy_ppu_fixed_rg_cfg_t fixed_rg_spm_ppu_config[] = {
|
|||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
.pcMatch = false,
|
||||
/*.pcMask = CY_PROT_PCMASK7,*/
|
||||
.pcMask = ALL_PROTECTION_CONTEXTS_MASK - CY_PROT_PCMASK7,
|
||||
.userMstPermission = CY_PROT_PERM_R,
|
||||
.privMstPermission = CY_PROT_PERM_RW,
|
||||
|
@ -478,6 +456,8 @@ const cy_ppu_fixed_sl_cfg_t fixed_sl_pc0_ppu_config[] = {
|
|||
.pPpuStr = PERI_GR_PPU_SL_PERI_GR2,
|
||||
},
|
||||
{
|
||||
/*.userPermission = CY_PROT_PERM_DISABLED,
|
||||
.privPermission = CY_PROT_PERM_DISABLED,*/
|
||||
.userPermission = CY_PROT_PERM_RW,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
|
@ -577,6 +557,11 @@ const cy_ppu_fixed_sl_cfg_t fixed_sl_spm_ppu_config[] = {
|
|||
.pPpuStr = PERI_GR_PPU_SL_CRYPTO,
|
||||
},
|
||||
{
|
||||
.userPermission = CY_PROT_PERM_RW,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
.pcMatch = false,
|
||||
.pcMask = ALL_PROTECTION_CONTEXTS_MASK,
|
||||
/*
|
||||
.userPermission = CY_PROT_PERM_DISABLED,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
|
@ -584,12 +569,6 @@ const cy_ppu_fixed_sl_cfg_t fixed_sl_spm_ppu_config[] = {
|
|||
.pcMatch = false,
|
||||
.pcMask = SECURE_CONTEXTS_MASK,
|
||||
*/
|
||||
.userPermission = CY_PROT_PERM_RW,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
.pcMatch = false,
|
||||
.pcMask = ALL_PROTECTION_CONTEXTS_MASK,
|
||||
/* Used less secure option to have CM4 working */
|
||||
.userMstPermission = CY_PROT_PERM_R,
|
||||
.privMstPermission = CY_PROT_PERM_RW,
|
||||
.secureMst = true,
|
||||
|
@ -621,6 +600,11 @@ const cy_ppu_fixed_sl_cfg_t fixed_sl_spm_ppu_config[] = {
|
|||
.pPpuStr = PERI_GR_PPU_SL_PROT,
|
||||
},
|
||||
{
|
||||
.userPermission = CY_PROT_PERM_RW,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
.pcMatch = false,
|
||||
.pcMask = ALL_PROTECTION_CONTEXTS_MASK,
|
||||
/*
|
||||
.userPermission = CY_PROT_PERM_DISABLED,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
|
@ -628,12 +612,6 @@ const cy_ppu_fixed_sl_cfg_t fixed_sl_spm_ppu_config[] = {
|
|||
.pcMatch = false,
|
||||
.pcMask = SECURE_CONTEXTS_MASK,
|
||||
*/
|
||||
.userPermission = CY_PROT_PERM_RW,
|
||||
.privPermission = CY_PROT_PERM_RW,
|
||||
.secure = false,
|
||||
.pcMatch = false,
|
||||
.pcMask = ALL_PROTECTION_CONTEXTS_MASK,
|
||||
/* Used less secure option to have CM4 working */
|
||||
.userMstPermission = CY_PROT_PERM_R,
|
||||
.privMstPermission = CY_PROT_PERM_RW,
|
||||
.secureMst = true,
|
||||
|
@ -1198,10 +1176,10 @@ const cy_bus_master_config_t bus_masters_config[] = {
|
|||
},
|
||||
{
|
||||
.busMaster = CPUSS_MS_ID_TC,
|
||||
.privileged = true,
|
||||
.privileged = false,
|
||||
.secure = false,
|
||||
.pcMask = CY_PROT_PCMASK1 + CY_PROT_PCMASK6,
|
||||
.act_pc = CY_PROT_PC1,
|
||||
.pcMask = CY_PROT_PCMASK7,
|
||||
.act_pc = CY_PROT_PC7,
|
||||
},
|
||||
{
|
||||
.busMaster = CPUSS_MS_ID_CRYPTO,
|
||||
|
|
Loading…
Reference in New Issue