rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
fsl_ftfx_features.h
Go to the documentation of this file.
1/*
2* The Clear BSD License
3* Copyright 2017-2018 NXP
4* All rights reserved.
5*
6* Redistribution and use in source and binary forms, with or without
7* modification, are permitted (subject to the limitations in the
8* disclaimer below) provided that the following conditions are met:
9*
10* * Redistributions of source code must retain the above copyright
11* notice, this list of conditions and the following disclaimer.
12*
13* * Redistributions in binary form must reproduce the above copyright
14* notice, this list of conditions and the following disclaimer in the
15* documentation and/or other materials provided with the distribution.
16*
17* * Neither the name of the copyright holder nor the names of its
18* contributors may be used to endorse or promote products derived from
19* this software without specific prior written permission.
20*
21* NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
22* GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23* HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
24* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
30* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
33* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*
35*/
36
37#ifndef _FSL_FTFX_FEATURES_H_
38#define _FSL_FTFX_FEATURES_H_
39
40#if (defined(BL_TARGET_FLASH) || defined(BL_TARGET_ROM) || defined(BL_TARGET_RAM))
41#include <assert.h>
42#include <string.h>
44#include "bootloader_common.h"
45#else
46#include "fsl_common.h"
47#endif
48
49#include "fsl_ftfx_adapter.h"
50
51/*******************************************************************************
52 * Definitions
53 ******************************************************************************/
54
55/*!
56 * @name FTFx configuration
57 * @{
58 */
59/*! @brief Flash driver location. */
60#if !defined(FTFx_DRIVER_IS_FLASH_RESIDENT)
61#if (!defined(BL_TARGET_ROM) && !defined(BL_TARGET_RAM))
62#define FTFx_DRIVER_IS_FLASH_RESIDENT 1 /*!< Used for the flash resident application. */
63#else
64#define FTFx_DRIVER_IS_FLASH_RESIDENT 0 /*!< Used for the non-flash resident application. */
65#endif
66#endif
67
68/*! @brief Flash Driver Export option */
69#if !defined(FTFx_DRIVER_IS_EXPORTED)
70#if defined(BL_TARGET_ROM)
71#define FTFx_DRIVER_IS_EXPORTED 1 /*!< Used for the ROM bootloader. */
72#else
73#define FTFx_DRIVER_IS_EXPORTED 0 /*!< Used for the MCUXpresso SDK application. */
74#endif
75#endif
76/*@}*/
77
78/*! @brief Indicates whether the secondary flash is supported in the Flash driver */
79#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) || defined(FSL_FEATURE_FLASH_PFLASH_1_START_ADDRESS)
80#define FTFx_DRIVER_HAS_FLASH1_SUPPORT (1)
81#define FTFx_FLASH_COUNT (2)
82#else
83#define FTFx_DRIVER_HAS_FLASH1_SUPPORT (0)
84#define FTFx_FLASH_COUNT (1)
85#endif
86
87/*!
88 * @name Secondary flash configuration
89 * @{
90 */
91/*! @brief Indicates whether the secondary flash has its own protection register in flash module. */
92#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) && defined(FTFE_FPROTS_PROTS_MASK)
93#define FTFx_FLASH1_HAS_PROT_CONTROL (1)
94#else
95#define FTFx_FLASH1_HAS_PROT_CONTROL (0)
96#endif
97
98/*! @brief Indicates whether the secondary flash has its own Execute-Only access register in flash module. */
99#if defined(FSL_FEATURE_FLASH_HAS_MULTIPLE_FLASH) && defined(FTFE_FACSSS_SGSIZE_S_MASK)
100#define FTFx_FLASH1_HAS_XACC_CONTROL (1)
101#else
102#define FTFx_FLASH1_HAS_XACC_CONTROL (0)
103#endif
104/*@}*/
105
106#if FTFx_FLASH1_HAS_XACC_CONTROL || FTFx_FLASH1_HAS_PROT_CONTROL
107#define FTFx_FLASH1_IS_INDEPENDENT_BLOCK (1)
108#else
109#define FTFx_FLASH1_IS_INDEPENDENT_BLOCK (0)
110#endif
111
112#endif /* _FSL_FTFX_FEATURES_H_ */
113