Skip to content

Commit

Permalink
s32: s32ze: patch QSPI for integration with zephyr
Browse files Browse the repository at this point in the history
Adapt macros that are used in the QSPI memc and
QSPI flash shim drivers.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
  • Loading branch information
congnguyenhuu committed Oct 25, 2024
1 parent d501d32 commit 1c3a734
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions s32/drivers/s32ze/BaseNXP/header/S32Z2_QUADSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
/** QuadSPI - Size of Registers Arrays */
#define QuadSPI_RBDR_COUNT 64u
#define QuadSPI_LUT_COUNT 80u
#define QuadSPI_FRAD_COUNT 8u
#define QuadSPI_MDAD_COUNT 2u
#define QuadSPI_FRAD_COUNT 8
#define QuadSPI_MDAD_COUNT 2

/** QuadSPI - Register Layout Typedef */
typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion s32/drivers/s32ze/Mem_EXFLS/include/Qspi_Ip_Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern "C"{
#define QSPI_IP_ERASE_TYPES (4U)

/*! @brief Number of AHB buffers in the device */
#define QSPI_IP_AHB_BUFFERS (4U)
#define QSPI_IP_AHB_BUFFERS 4

/*! Invalid index in virtual LUT, used for unsupported features */
#define QSPI_IP_LUT_INVALID (uint16)0xFFFFU
Expand Down
4 changes: 2 additions & 2 deletions s32/soc/s32z270/include/Qspi_Ip_Cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C"{
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Qspi_Ip_Types.h"

#include <zephyr/devicetree.h>

/*==================================================================================================
* SOURCE FILE VERSION INFORMATION
Expand All @@ -51,7 +51,7 @@ extern "C"{
==================================================================================================*/

/* Number of serial flash devices */
#define QSPI_IP_MEM_INSTANCE_COUNT (1U)
#define QSPI_IP_MEM_INSTANCE_COUNT DT_NUM_INST_STATUS_OKAY(nxp_s32_qspi_hyperflash)

/* Maximum number of retries for Write Enable command */
#define QSPI_IP_MAX_RETRY (3U)
Expand Down
7 changes: 4 additions & 3 deletions s32/soc/s32z270/include/Qspi_Ip_CfgDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern "C"{
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include <zephyr/devicetree.h>

/*==================================================================================================
* SOURCE FILE VERSION INFORMATION
Expand All @@ -48,9 +49,9 @@ extern "C"{
==================================================================================================*/


#define QSPI_IP_SFP_ENABLE_GLOBAL (STD_ON)
#define QSPI_IP_SFP_ENABLE_MDAD (STD_ON)
#define QSPI_IP_SFP_ENABLE_FRAD (STD_ON)
#define QSPI_IP_SFP_ENABLE_MDAD DT_HAS_COMPAT_STATUS_OKAY(nxp_s32_qspi_sfp_mdad)
#define QSPI_IP_SFP_ENABLE_FRAD DT_HAS_COMPAT_STATUS_OKAY(nxp_s32_qspi_sfp_frad)
#define QSPI_IP_SFP_ENABLE_GLOBAL UTIL_OR(QSPI_IP_SFP_ENABLE_MDAD, QSPI_IP_SFP_ENABLE_FRAD)


/* Enable Multicore support when using MemAcc*/
Expand Down

0 comments on commit 1c3a734

Please sign in to comment.