diff options
author | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2020-10-12 13:40:30 +0200 |
---|---|---|
committer | Christian Mauderer <christian.mauderer@embedded-brains.de> | 2020-11-20 08:53:18 +0100 |
commit | 48f6a6c302a3e1a3f8915e2503d0fe618d1af285 (patch) | |
tree | b5d570ddd5e432519c5a9d42b4cf6725d8161551 /bsps/arm/imxrt/include/fsl_flexram_allocate.h | |
parent | cpu/armv7m: Add table based init for ARMV7M_MPU (diff) | |
download | rtems-48f6a6c302a3e1a3f8915e2503d0fe618d1af285.tar.bz2 |
bsp/imxrt: Import files from MCUXpresso SDK V2.8.5
The following files have been imported:
cp ${SDK}/boards/evkbimxrt1050/project_template/clock_config.c nxp/boards/evkbimxrt1050
cp ${SDK}/boards/evkbimxrt1050/project_template/clock_config.h include/fsl_clock_config.h
cp ${SDK}/boards/evkbimxrt1050/project_template/dcd.c start/flash-dcd.c
cp ${SDK}/boards/evkbimxrt1050/project_template/pin_mux.c nxp/boards/evkbimxrt1050
cp ${SDK}/boards/evkbimxrt1050/project_template/pin_mux.h include/fsl_pin_mux.h
cp ${SDK}/boards/evkbimxrt1050/xip/evkbimxrt1050_flexspi_nor_config.h include/fsl_flexspi_nor_config.h
cp ${SDK}/devices/MIMXRT1052/MIMXRT1052.h include
cp ${SDK}/devices/MIMXRT1052/MIMXRT1052_features.h include
cp ${SDK}/devices/MIMXRT1052/drivers/fsl_*.c nxp/devices/MIMXRT1052/drivers
cp ${SDK}/devices/MIMXRT1052/drivers/fsl_*.h include
cp ${SDK}/devices/MIMXRT1052/fsl_device_registers.h include
cp ${SDK}/devices/MIMXRT1052/system_MIMXRT1052.h include/
cp ${SDK}/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.c nxp/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.c
cp ${SDK}/devices/MIMXRT1052/xip/fsl_flexspi_nor_boot.h include
Update #4180
Diffstat (limited to 'bsps/arm/imxrt/include/fsl_flexram_allocate.h')
-rw-r--r-- | bsps/arm/imxrt/include/fsl_flexram_allocate.h | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/bsps/arm/imxrt/include/fsl_flexram_allocate.h b/bsps/arm/imxrt/include/fsl_flexram_allocate.h new file mode 100644 index 0000000000..8fad10f5b5 --- /dev/null +++ b/bsps/arm/imxrt/include/fsl_flexram_allocate.h @@ -0,0 +1,99 @@ +/* + * Copyright 2019-2020 NXP + * All rights reserved. + * + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef _FSL_FLEXRAM_ALLOCATE_H_ +#define _FSL_FLEXRAM_ALLOCATE_H_ + +#include "fsl_common.h" + +/*! + * @addtogroup flexram + * @{ + */ + +/****************************************************************************** + * Definitions. + *****************************************************************************/ + +/*! @name Driver version */ +/*@{*/ +/*! @brief Driver version 2.0.7. */ +#define FSL_FLEXRAM_DRIVER_VERSION (MAKE_VERSION(2U, 0U, 7U)) +/*@}*/ + +/*! @brief FLEXRAM bank type */ +enum +{ + kFLEXRAM_BankNotUsed = 0U, /*!< bank is not used */ + kFLEXRAM_BankOCRAM = 1U, /*!< bank is OCRAM */ + kFLEXRAM_BankDTCM = 2U, /*!< bank is DTCM */ + kFLEXRAM_BankITCM = 3U, /*!< bank is ITCM */ +}; + +/*! @brief FLEXRAM bank allocate source */ +typedef enum _flexram_bank_allocate_src +{ + kFLEXRAM_BankAllocateThroughHardwareFuse = 0U, /*!< allocate ram through hardware fuse value */ + kFLEXRAM_BankAllocateThroughBankCfg = 1U, /*!< allocate ram through FLEXRAM_BANK_CFG */ +} flexram_bank_allocate_src_t; + +/*! @brief FLEXRAM allocate ocram, itcm, dtcm size */ +typedef struct _flexram_allocate_ram +{ + const uint8_t ocramBankNum; /*!< ocram banknumber which the SOC support */ + const uint8_t dtcmBankNum; /*!< dtcm bank number to allocate, the number should be power of 2 */ + const uint8_t itcmBankNum; /*!< itcm bank number to allocate, the number should be power of 2 */ +} flexram_allocate_ram_t; + +/******************************************************************************* + * APIs + ******************************************************************************/ + +#if defined(__cplusplus) +extern "C" { +#endif + +/*! + * @brief FLEXRAM allocate on-chip ram for OCRAM,ITCM,DTCM + * This function is independent of FLEXRAM_Init, it can be called directly if ram re-allocate + * is needed. + * @param config allocate configuration. + * @retval kStatus_InvalidArgument the argument is invalid + * kStatus_Success allocate success + */ +status_t FLEXRAM_AllocateRam(flexram_allocate_ram_t *config); + +/*! + * @brief FLEXRAM set allocate on-chip ram source + * @param src bank config source select value. + */ +static inline void FLEXRAM_SetAllocateRamSrc(flexram_bank_allocate_src_t src) +{ + IOMUXC_GPR->GPR16 &= ~IOMUXC_GPR_GPR16_FLEXRAM_BANK_CFG_SEL_MASK; + IOMUXC_GPR->GPR16 |= IOMUXC_GPR_GPR16_FLEXRAM_BANK_CFG_SEL(src); +} + +/*! + * @brief FLEXRAM configure TCM size + * This function is used to set the TCM to the target size. If a odd bank number is used, + * a new banknumber will be used which is bigger than target value, application can set tcm + * size to the biggest bank number always, then boundary access error can be captured by flexram only. + * When access to the TCM memory boundary ,hardfault will raised by core. + * @param itcmBankNum itcm bank number to allocate + * @param dtcmBankNum dtcm bank number to allocate + * + */ +void FLEXRAM_SetTCMSize(uint8_t itcmBankNum, uint8_t dtcmBankNum); + +#if defined(__cplusplus) +} +#endif + +/*! @}*/ + +#endif |