Skip to content

Commit 24a9e16

Browse files
congnguyenhuummahadevan108
authored andcommitted
s32: s32ze: patch QSPI for integration with zephyr
Adapt macros that are used in the QSPI memc and QSPI flash shim drivers. Signed-off-by: Cong Nguyen Huu <[email protected]>
1 parent 0d455ad commit 24a9e16

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

s32/drivers/s32ze/Mem_EXFLS/include/Qspi_Ip_Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ extern "C"{
121121
#define QSPI_IP_ERASE_TYPES (4U)
122122

123123
/*! @brief Number of AHB buffers in the device */
124-
#define QSPI_IP_AHB_BUFFERS (4U)
124+
#define QSPI_IP_AHB_BUFFERS 4
125125

126126
/*! Invalid index in virtual LUT, used for unsupported features */
127127
#define QSPI_IP_LUT_INVALID (uint16)0xFFFFU

s32/soc/s32z270/include/Qspi_Ip_Cfg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C"{
2828
* 3) internal and external interfaces from this unit
2929
==================================================================================================*/
3030
#include "Qspi_Ip_Types.h"
31-
31+
#include <zephyr/devicetree.h>
3232

3333
/*==================================================================================================
3434
* SOURCE FILE VERSION INFORMATION
@@ -51,7 +51,7 @@ extern "C"{
5151
==================================================================================================*/
5252

5353
/* Number of serial flash devices */
54-
#define QSPI_IP_MEM_INSTANCE_COUNT (1U)
54+
#define QSPI_IP_MEM_INSTANCE_COUNT DT_NUM_INST_STATUS_OKAY(nxp_s32_qspi_hyperflash)
5555

5656
/* Maximum number of retries for Write Enable command */
5757
#define QSPI_IP_MAX_RETRY (3U)

s32/soc/s32z270/include/Qspi_Ip_CfgDefines.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ extern "C"{
2727
* 2) needed interfaces from external units
2828
* 3) internal and external interfaces from this unit
2929
==================================================================================================*/
30+
#include <zephyr/devicetree.h>
3031

3132
/*==================================================================================================
3233
* SOURCE FILE VERSION INFORMATION
@@ -48,9 +49,9 @@ extern "C"{
4849
==================================================================================================*/
4950

5051

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)
52+
#define QSPI_IP_SFP_ENABLE_MDAD DT_HAS_COMPAT_STATUS_OKAY(nxp_s32_qspi_sfp_mdad)
53+
#define QSPI_IP_SFP_ENABLE_FRAD DT_HAS_COMPAT_STATUS_OKAY(nxp_s32_qspi_sfp_frad)
54+
#define QSPI_IP_SFP_ENABLE_GLOBAL UTIL_OR(QSPI_IP_SFP_ENABLE_MDAD, QSPI_IP_SFP_ENABLE_FRAD)
5455

5556

5657
/* Enable Multicore support when using MemAcc*/

0 commit comments

Comments
 (0)