mirror of https://github.com/ARMmbed/mbed-os.git
K64F, K66F: Update the SYSMPU implementation
Do not disable SYSMPU, instead add access for ENET bus master Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>pull/6847/head
parent
93f8cfed05
commit
7bc4c0ec21
|
@ -29,18 +29,45 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fsl_port.h"
|
#include "fsl_port.h"
|
||||||
|
#include "fsl_sysmpu.h"
|
||||||
|
|
||||||
|
/* Initialize the region 1, master 0, 1, 2, 3 - core access rights supervisior r/w/x , user r/w/x. */
|
||||||
|
sysmpu_rwxrights_master_access_control_t right =
|
||||||
|
{
|
||||||
|
kSYSMPU_SupervisorEqualToUsermode,
|
||||||
|
kSYSMPU_UserReadWriteExecute,
|
||||||
|
#if FSL_FEATURE_SYSMPU_HAS_PROCESS_IDENTIFIER
|
||||||
|
false,
|
||||||
|
#endif /* FSL_FEATURE_SYSMPU_HAS_PROCESS_IDENTIFIER */
|
||||||
|
};
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Code
|
* Code
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
void k64f_init_eth_hardware(void)
|
void kinetis_init_eth_hardware(void)
|
||||||
{
|
{
|
||||||
port_pin_config_t configENET = {0};
|
port_pin_config_t configENET = {0};
|
||||||
|
sysmpu_region_config_t regConfig;
|
||||||
|
sysmpu_config_t config;
|
||||||
|
|
||||||
#ifndef FEATURE_UVISOR
|
memset(®Config, 0, sizeof(sysmpu_region_config_t));
|
||||||
/* Disable MPU only when uVisor is not around. */
|
memset(&config, 0, sizeof(sysmpu_config_t));
|
||||||
MPU->CESR &= ~MPU_CESR_VLD_MASK;
|
|
||||||
#endif/*FEATURE_UVISOR*/
|
regConfig.regionNum = 1;
|
||||||
|
regConfig.startAddress = 0U;
|
||||||
|
regConfig.endAddress = 0xFFFFFFFFU;
|
||||||
|
regConfig.accessRights1[0] = right;
|
||||||
|
regConfig.accessRights1[1] = right;
|
||||||
|
regConfig.accessRights1[2] = right;
|
||||||
|
regConfig.accessRights1[3] = right;
|
||||||
|
|
||||||
|
#if FSL_FEATURE_SYSMPU_HAS_PROCESS_IDENTIFIER
|
||||||
|
regConfig.processIdentifier = 1U;
|
||||||
|
regConfig.processIdMask = 0U;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
config.regionConfig = regConfig;
|
||||||
|
SYSMPU_Init(SYSMPU, &config);
|
||||||
|
|
||||||
CLOCK_EnableClock(kCLOCK_PortC);
|
CLOCK_EnableClock(kCLOCK_PortC);
|
||||||
CLOCK_EnableClock(kCLOCK_PortB);
|
CLOCK_EnableClock(kCLOCK_PortB);
|
||||||
|
|
|
@ -29,18 +29,45 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fsl_port.h"
|
#include "fsl_port.h"
|
||||||
|
#include "fsl_sysmpu.h"
|
||||||
|
|
||||||
|
/* Initialize the region 1, master 0, 1, 2, 3 - core access rights supervisior r/w/x , user r/w/x. */
|
||||||
|
sysmpu_rwxrights_master_access_control_t right =
|
||||||
|
{
|
||||||
|
kSYSMPU_SupervisorEqualToUsermode,
|
||||||
|
kSYSMPU_UserReadWriteExecute,
|
||||||
|
#if FSL_FEATURE_SYSMPU_HAS_PROCESS_IDENTIFIER
|
||||||
|
false,
|
||||||
|
#endif /* FSL_FEATURE_SYSMPU_HAS_PROCESS_IDENTIFIER */
|
||||||
|
};
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Code
|
* Code
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
void k66f_init_eth_hardware(void)
|
void kinetis_init_eth_hardware(void)
|
||||||
{
|
{
|
||||||
port_pin_config_t configENET = {0};
|
port_pin_config_t configENET = {0};
|
||||||
|
sysmpu_region_config_t regConfig;
|
||||||
|
sysmpu_config_t config;
|
||||||
|
|
||||||
#ifndef FEATURE_UVISOR
|
memset(®Config, 0, sizeof(sysmpu_region_config_t));
|
||||||
/* Disable MPU only when uVisor is not around. */
|
memset(&config, 0, sizeof(sysmpu_config_t));
|
||||||
SYSMPU->CESR &= ~SYSMPU_CESR_VLD_MASK;
|
|
||||||
#endif/*FEATURE_UVISOR*/
|
regConfig.regionNum = 1;
|
||||||
|
regConfig.startAddress = 0U;
|
||||||
|
regConfig.endAddress = 0xFFFFFFFFU;
|
||||||
|
regConfig.accessRights1[0] = right;
|
||||||
|
regConfig.accessRights1[1] = right;
|
||||||
|
regConfig.accessRights1[2] = right;
|
||||||
|
regConfig.accessRights1[3] = right;
|
||||||
|
|
||||||
|
#if FSL_FEATURE_SYSMPU_HAS_PROCESS_IDENTIFIER
|
||||||
|
regConfig.processIdentifier = 1U;
|
||||||
|
regConfig.processIdMask = 0U;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
config.regionConfig = regConfig;
|
||||||
|
SYSMPU_Init(SYSMPU, &config);
|
||||||
|
|
||||||
/* Ungate the port clock */
|
/* Ungate the port clock */
|
||||||
CLOCK_EnableClock(kCLOCK_PortA);
|
CLOCK_EnableClock(kCLOCK_PortA);
|
||||||
|
|
Loading…
Reference in New Issue