Skip to content

Commit 0d455ad

Browse files
congnguyenhuummahadevan108
authored andcommitted
s32: soc: s32z2: add QSPI soc specific code
Code autogenerated with S32 Design Studio for s32ze Signed-off-by: Cong Nguyen Huu <[email protected]>
1 parent 540a739 commit 0d455ad

File tree

3 files changed

+294
-0
lines changed

3 files changed

+294
-0
lines changed

s32/soc/s32z270/include/Qspi_Ip_Cfg.h

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef QSPI_IP_CFG_H
8+
#define QSPI_IP_CFG_H
9+
10+
/**
11+
* @file Qspi_Ip_Cfg.h
12+
*
13+
* @addtogroup MEM_EXFLS
14+
* Qspi_Ip_Cfg.h_Artifact
15+
* @{
16+
*/
17+
18+
19+
#ifdef __cplusplus
20+
extern "C"{
21+
#endif
22+
23+
24+
/*==================================================================================================
25+
* INCLUDE FILES
26+
* 1) system and project includes
27+
* 2) needed interfaces from external units
28+
* 3) internal and external interfaces from this unit
29+
==================================================================================================*/
30+
#include "Qspi_Ip_Types.h"
31+
32+
33+
/*==================================================================================================
34+
* SOURCE FILE VERSION INFORMATION
35+
==================================================================================================*/
36+
#define QSPI_IP_VENDOR_ID_CFG 43
37+
#define QSPI_IP_AR_RELEASE_MAJOR_VERSION_CFG 4
38+
#define QSPI_IP_AR_RELEASE_MINOR_VERSION_CFG 7
39+
#define QSPI_IP_AR_RELEASE_REVISION_VERSION_CFG 0
40+
#define QSPI_IP_SW_MAJOR_VERSION_CFG 2
41+
#define QSPI_IP_SW_MINOR_VERSION_CFG 0
42+
#define QSPI_IP_SW_PATCH_VERSION_CFG 0
43+
44+
/*==================================================================================================
45+
* FILE VERSION CHECKS
46+
==================================================================================================*/
47+
48+
49+
/*==================================================================================================
50+
DEFINES AND MACROS
51+
==================================================================================================*/
52+
53+
/* Number of serial flash devices */
54+
#define QSPI_IP_MEM_INSTANCE_COUNT (1U)
55+
56+
/* Maximum number of retries for Write Enable command */
57+
#define QSPI_IP_MAX_RETRY (3U)
58+
59+
/* Development error detection for QSPI Ip API */
60+
#define QSPI_IP_DEV_ERROR_DETECT (STD_OFF)
61+
62+
/* Timeout for DLL lock sequence */
63+
#define QSPI_IP_DLL_LOCK_TIMEOUT (10000000U)
64+
65+
/* Timeout for QSPI command completion */
66+
#define QSPI_IP_CMD_COMPLETE_TIMEOUT (10000000U)
67+
68+
/* After the FRAD checks pass we wait for QSPI to become idle */
69+
#define QSPI_IP_QSPI_IDLE_TIMEOUT (100U)
70+
71+
/* Timeout for external flash software reset completion */
72+
#define QSPI_IP_RESET_TIMEOUT (2000000U)
73+
74+
/* Timeout for external flash startup initialization sequence completion */
75+
#define QSPI_IP_FLS_INIT_TIMEOUT (2000000U)
76+
77+
/* Timeout for a complete read operation */
78+
#define QSPI_IP_READ_TIMEOUT (2147483647U)
79+
80+
/* OsIf counter type used in timeout detection for QSPI IP operations */
81+
#define QSPI_IP_TIMEOUT_TYPE (OSIF_COUNTER_DUMMY)
82+
83+
/* Delay after changing the value of the QSPI software reset bits */
84+
#define QSPI_IP_SOFTWARE_RESET_DELAY (21U)
85+
86+
/*! @brief Minimum delay in CPU cycles between Tx FIFO reset and Tx FIFO push */
87+
#define QSPI_IP_TX_BUFFER_RESET_DELAY (0U)
88+
89+
90+
/* QSPI user mode support macro */
91+
#define QSPI_IP_ENABLE_USER_MODE_SUPPORT (STD_OFF)
92+
93+
#ifndef MCAL_ENABLE_USER_MODE_SUPPORT
94+
#if (STD_ON == QSPI_IP_ENABLE_USER_MODE_SUPPORT)
95+
#error MCAL_ENABLE_USER_MODE_SUPPORT is not enabled. For running Fls in user mode the MCAL_ENABLE_USER_MODE_SUPPORT needs to be defined.
96+
#endif
97+
#endif
98+
99+
#define QSPI_PERFORM_DEVICE_CONFIG (STD_ON)
100+
101+
102+
/*==================================================================================================
103+
DEFINES AND MACROS
104+
==================================================================================================*/
105+
/*==================================================================================================
106+
* GLOBAL VARIABLE DECLARATIONS
107+
==================================================================================================*/
108+
109+
#ifdef __cplusplus
110+
}
111+
#endif
112+
113+
/** @} */
114+
115+
#endif /* QSPI_IP_CFG_H */
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#ifndef QSPI_IP_CFG_DEFINES_H
8+
#define QSPI_IP_CFG_DEFINES_H
9+
10+
/**
11+
* @file Qspi_Ip_CfgDefines.h
12+
*
13+
* @addtogroup IPV_QSPI
14+
* Qspi_Ip_CfgDefines.h_Artifact
15+
* @{
16+
*/
17+
18+
19+
#ifdef __cplusplus
20+
extern "C"{
21+
#endif
22+
23+
24+
/*==================================================================================================
25+
* INCLUDE FILES
26+
* 1) system and project includes
27+
* 2) needed interfaces from external units
28+
* 3) internal and external interfaces from this unit
29+
==================================================================================================*/
30+
31+
/*==================================================================================================
32+
* SOURCE FILE VERSION INFORMATION
33+
==================================================================================================*/
34+
#define QSPI_IP_VENDOR_ID_CFG_DEFINES 43
35+
#define QSPI_IP_AR_RELEASE_MAJOR_VERSION_CFG_DEFINES 4
36+
#define QSPI_IP_AR_RELEASE_MINOR_VERSION_CFG_DEFINES 7
37+
#define QSPI_IP_AR_RELEASE_REVISION_VERSION_CFG_DEFINES 0
38+
#define QSPI_IP_SW_MAJOR_VERSION_CFG_DEFINES 2
39+
#define QSPI_IP_SW_MINOR_VERSION_CFG_DEFINES 0
40+
#define QSPI_IP_SW_PATCH_VERSION_CFG_DEFINES 0
41+
42+
/*==================================================================================================
43+
* FILE VERSION CHECKS
44+
==================================================================================================*/
45+
46+
/*==================================================================================================
47+
DEFINES AND MACROS
48+
==================================================================================================*/
49+
50+
51+
#define QSPI_IP_SFP_ENABLE_GLOBAL (STD_ON)
52+
#define QSPI_IP_SFP_ENABLE_MDAD (STD_ON)
53+
#define QSPI_IP_SFP_ENABLE_FRAD (STD_ON)
54+
55+
56+
/* Enable Multicore support when using MemAcc*/
57+
#define QSPI_IP_MULTICORE_ENABLED (STD_OFF)
58+
59+
#ifdef __cplusplus
60+
}
61+
#endif
62+
63+
/** @} */
64+
65+
#endif /* QSPI_IP_CFG_DEFINES_H */
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
#if !defined(QSPI_IP_FEATURES_H)
8+
#define QSPI_IP_FEATURES_H
9+
10+
/**
11+
* @file Qspi_Ip_Features.h
12+
*
13+
* @addtogroup IPV_QSPI
14+
* Qspi_Ip_Features.h_Artifact
15+
* @{
16+
*/
17+
18+
19+
#ifdef __cplusplus
20+
extern "C"{
21+
#endif
22+
23+
/*==================================================================================================
24+
* INCLUDE FILES
25+
* 1) system and project includes
26+
* 2) needed interfaces from external units
27+
* 3) internal and external interfaces from this unit
28+
==================================================================================================*/
29+
#include "S32Z2_QUADSPI.h"
30+
31+
/*==================================================================================================
32+
* SOURCE FILE VERSION INFORMATION
33+
==================================================================================================*/
34+
#define QSPI_IP_FEATURES_VENDOR_ID_CFG 43
35+
#define QSPI_IP_FEATURES_AR_RELEASE_MAJOR_VERSION_CFG 4
36+
#define QSPI_IP_FEATURES_AR_RELEASE_MINOR_VERSION_CFG 7
37+
#define QSPI_IP_FEATURES_AR_RELEASE_REVISION_VERSION_CFG 0
38+
#define QSPI_IP_FEATURES_SW_MAJOR_VERSION_CFG 2
39+
#define QSPI_IP_FEATURES_SW_MINOR_VERSION_CFG 0
40+
#define QSPI_IP_FEATURES_SW_PATCH_VERSION_CFG 0
41+
42+
43+
/*==================================================================================================
44+
* DEFINES AND MACROS
45+
==================================================================================================*/
46+
47+
/* QuadSPI module features */
48+
49+
/*! @brief First address of the serial flash device on the AHB bus for QuadSPI instances */
50+
#define FEATURE_QSPI_AMBA_BASE {0x00000000UL,0x10000000UL}
51+
/*! @brief Size of AHB buffer. */
52+
#define FEATURE_QSPI_AHB_BUF_SIZE 1024U
53+
/*! @brief Size of Tx FIFO. */
54+
#define FEATURE_QSPI_TX_BUF_SIZE 1024U
55+
/*! @brief Size of Rx FIFO. */
56+
#define FEATURE_QSPI_RX_BUF_SIZE 256U
57+
/*! @brief Number of LUT registers that make up a LUT sequence */
58+
#define FEATURE_QSPI_LUT_SEQUENCE_SIZE 5U
59+
/* Minimum entries of 4 bytes fill needed to allow Tx operation to start */
60+
#define FEATURE_QSPI_TX_MIN_BUF_FILL 1U
61+
62+
/*! @brief Supports Double Data Rate operation */
63+
#define FEATURE_QSPI_DDR 1
64+
/*! @brief QSPI side B is available */
65+
#define FEATURE_QSPI_HAS_SIDE_B 1
66+
/*! @brief Configurable Idle Signal Drive */
67+
#define FEATURE_QSPI_CONFIGURABLE_ISD 1
68+
69+
/*! @brief Supports addr. config options (column address, word addressable) */
70+
#define FEATURE_QSPI_ADDR_CFG 1
71+
/*! @brief Supports byte swap */
72+
#define FEATURE_QSPI_BYTES_SWAP_ADDR 1
73+
74+
/*! @brief Supports center-aligned read strobe */
75+
#define FEATURE_QSPI_CENTER_ALIGNED_READ_STROBE 1
76+
/*! @brief Supports differential clock */
77+
#define FEATURE_QSPI_DIFFERENTIAL_CLOCK 1
78+
79+
/*! @brief Supports internal DQS sampling mode */
80+
#define FEATURE_QSPI_INTERNAL_DQS 0
81+
/*! @brief Supports loopback sampling mode */
82+
#define FEATURE_QSPI_LOOPBACK 1
83+
/*! @brief Supports DQS loopback sampling mode */
84+
#define FEATURE_QSPI_LOOPBACK_DQS 0
85+
/*! @brief Supports external DQS sampling mode */
86+
#define FEATURE_QSPI_EXTERNAL_DQS 1
87+
/*! @brief Supports DQS_FA_SEL/DQS_FB_SEL field in MCR register for DQS selection */
88+
#define FEATURE_QSPI_SELECT_DQS 1
89+
90+
/*! @brief Supports Dll feature */
91+
#define FEATURE_QSPI_HAS_DLL 1
92+
/*! @brief Supports full DLL features (as opposed to bypass mode only) */
93+
#define FEATURE_QSPI_EXTERNAL_DLL_FULL 1
94+
/*! @brief Supports DLL reference counter and DLL resolution */
95+
#define FEATURE_QSPI_DLL_LOOPCONTROL 1
96+
97+
/*! @brief Supports secure flash protection feature */
98+
#define FEATURE_QSPI_HAS_SFP 1
99+
100+
101+
/*! @brief The maximum size of manufacturer & device ID that flash memories can have */
102+
#define FEATURE_EXFLS_FLASH_MDID_SIZE 10U
103+
104+
/*! @brief AHB base pointers initializer for all QSPI units */
105+
#define QuadSPI_AHB_PTRS FEATURE_QSPI_AMBA_BASE
106+
107+
108+
#ifdef __cplusplus
109+
}
110+
#endif
111+
112+
/** @} */
113+
114+
#endif /* QSPI_IP_FEATURES_H */

0 commit comments

Comments
 (0)