Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

91 řádky
2.5 KiB

  1. /*
  2. * Copyright 2017-2019 NXP
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. *
  7. */
  8. #ifndef FSL_FTFX_FEATURES_H
  9. #define FSL_FTFX_FEATURES_H
  10. #if (defined(BL_TARGET_FLASH) || defined(BL_TARGET_ROM) || defined(BL_TARGET_RAM))
  11. #include <assert.h>
  12. #include <string.h>
  13. #include "fsl_device_registers.h"
  14. #include "bootloader_common.h"
  15. #else
  16. #include "fsl_common.h"
  17. #endif
  18. #include "fsl_ftfx_adapter.h"
  19. /*!
  20. * @addtogroup ftfx_feature
  21. * @{
  22. */
  23. /*******************************************************************************
  24. * Definitions
  25. ******************************************************************************/
  26. /*!
  27. * @name FTFx configuration
  28. * @{
  29. */
  30. /*! @brief Flash driver location. */
  31. #if !defined(FTFx_DRIVER_IS_FLASH_RESIDENT)
  32. #if (!defined(BL_TARGET_ROM) && !defined(BL_TARGET_RAM))
  33. #define FTFx_DRIVER_IS_FLASH_RESIDENT 1U /*!< Used for the flash resident application. */
  34. #else
  35. #define FTFx_DRIVER_IS_FLASH_RESIDENT 0U /*!< Used for the non-flash resident application. */
  36. #endif
  37. #endif
  38. /*! @brief Flash Driver Export option */
  39. #if !defined(FTFx_DRIVER_IS_EXPORTED)
  40. #if defined(BL_TARGET_ROM)
  41. #define FTFx_DRIVER_IS_EXPORTED 1U /*!< Used for the ROM bootloader. */
  42. #else
  43. #define FTFx_DRIVER_IS_EXPORTED 0U /*!< Used for the MCUXpresso SDK application. */
  44. #endif
  45. #endif
  46. /*@}*/
  47. /*! @brief Indicates whether the secondary flash is supported in the Flash driver */
  48. #if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) || defined(FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS)
  49. #define FTFx_DRIVER_HAS_FLASH1_SUPPORT (1U)
  50. #define FTFx_FLASH_COUNT (2U)
  51. #else
  52. #define FTFx_DRIVER_HAS_FLASH1_SUPPORT (0U)
  53. #define FTFx_FLASH_COUNT (1U)
  54. #endif
  55. /*!
  56. * @name Secondary flash configuration
  57. * @{
  58. */
  59. /*! @brief Indicates whether the secondary flash has its own protection register in flash module. */
  60. #if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) && defined(FTFE_FPROTS_PROTS_MASK)
  61. #define FTFx_FLASH1_HAS_PROT_CONTROL (1U)
  62. #else
  63. #define FTFx_FLASH1_HAS_PROT_CONTROL (0U)
  64. #endif
  65. /*! @brief Indicates whether the secondary flash has its own Execute-Only access register in flash module. */
  66. #if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) && defined(FTFE_FACSSS_SGSIZE_S_MASK)
  67. #define FTFx_FLASH1_HAS_XACC_CONTROL (1U)
  68. #else
  69. #define FTFx_FLASH1_HAS_XACC_CONTROL (0U)
  70. #endif
  71. /*@}*/
  72. #if FTFx_FLASH1_HAS_XACC_CONTROL || FTFx_FLASH1_HAS_PROT_CONTROL
  73. #define FTFx_FLASH1_IS_INDEPENDENT_BLOCK (1U)
  74. #else
  75. #define FTFx_FLASH1_IS_INDEPENDENT_BLOCK (0U)
  76. #endif
  77. /*! @}*/
  78. #endif /* FSL_FTFX_FEATURES_H */