Skip to content

Commit f042846

Browse files
haduongquangmanuargue
authored andcommitted
s32: s32z: patch rtd 2.0.0 to work with zephyr
Remove 'u' suffix from macros so that they can be used with LISTIFY. Netc shim driver uses 'Netc_Eth_Ip_MSIX_Rx' function. Need to remove 'static inline' keywords from this function so that it can be used as an extern function outside of the file declaration. Set the number of UART LINFlexD instances configured that bases on the number of devicetree UART nodes enabled. Set the number of SPI instances configured that bases on the number of devicetree SPI nodes enabled. Enable SPI slave support bases on CONFIG_SPI_SLAVE. Wrap the defined macros of each MRU instance base on devicetree MRU node so that it is built when node enabled. Signed-off-by: Ha Duong Quang <[email protected]>
1 parent b4739b9 commit f042846

File tree

11 files changed

+40
-65
lines changed

11 files changed

+40
-65
lines changed

s32/drivers/s32ze/BaseNXP/header/S32Z2_CANXL_SIC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ typedef struct {
9191
} CANXL_SIC_Type, *CANXL_SIC_MemMapPtr;
9292

9393
/** Number of instances of the CANXL_SIC module. */
94-
#define CANXL_SIC_INSTANCE_COUNT (2u)
94+
#define CANXL_SIC_INSTANCE_COUNT (2)
9595

9696
/* CANXL_SIC - Peripheral instance base addresses */
9797
/** Peripheral CANXL_0__SIC base address */

s32/drivers/s32ze/BaseNXP/header/S32Z2_LINFLEXD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ typedef struct {
9595
} LINFLEXD_Type, *LINFLEXD_MemMapPtr;
9696

9797
/** Number of instances of the LINFLEXD module. */
98-
#define LINFLEXD_INSTANCE_COUNT (13u)
98+
#define LINFLEXD_INSTANCE_COUNT (13)
9999

100100
/* LINFLEXD - Peripheral instance base addresses */
101101
/** Peripheral LINFLEX_0 base address */

s32/drivers/s32ze/BaseNXP/header/S32Z2_NETC_F1.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ typedef struct {
8888
} NETC_F1_Type, *NETC_F1_MemMapPtr;
8989

9090
/** Number of instances of the NETC_F1 module. */
91-
#define NETC_F1_INSTANCE_COUNT (1u)
91+
#define NETC_F1_INSTANCE_COUNT (1)
9292

9393
/* NETC_F1 - Peripheral instance base addresses */
9494
/** Peripheral NETC__EMDIO_BASE base address */

s32/drivers/s32ze/BaseNXP/header/S32Z2_RTU_MRU.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ typedef struct {
135135
} RTU_MRU_Type, *RTU_MRU_MemMapPtr;
136136

137137
/** Number of instances of the RTU_MRU module. */
138-
#define RTU_MRU_INSTANCE_COUNT (8u)
138+
#define RTU_MRU_INSTANCE_COUNT (8)
139139

140140
/* RTU_MRU - Peripheral instance base addresses */
141141
/** Peripheral RTU0__MRU_0 base address */

s32/drivers/s32ze/BaseNXP/header/S32Z2_SPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ typedef struct {
106106
} SPI_Type, *SPI_MemMapPtr;
107107

108108
/** Number of instances of the SPI module. */
109-
#define SPI_INSTANCE_COUNT (10u)
109+
#define SPI_INSTANCE_COUNT (10)
110110

111111
/* SPI - Peripheral instance base addresses */
112112
/** Peripheral SPI_0 base address */

s32/drivers/s32ze/EthSwt_NETC/include/Netc_EthSwt_Ip_Types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ extern "C"{
9393
==================================================================================================*/
9494

9595
#define NETC_ETHSWT_IP_NUMBER_OF_PSEUDO_PORT (1U) /*!< number of pseudoport */
96-
#define NETC_ETHSWT_IP_NUMBER_OF_PORTS (3U) /*!< number of ports */
96+
#define NETC_ETHSWT_IP_NUMBER_OF_PORTS 3 /*!< number of ports */
9797
#define NETC_ETHSWT_IP_NUMBER_OF_MAC_PORTS (2U) /*!< number of mac ports*/
9898
#define NETC_ETHSWT_IP_NUMBER_OF_VID_PER_PORT (255U) /*!< 3 number of vid per port */
9999

s32/drivers/s32ze/Eth_NETC/src/Netc_Eth_Ip_Irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ static inline void Netc_Eth_Ip_MSIX_Tx_CheckAllRings(const uint32 TxRingIntStatu
114114
*
115115
* @param CtrlIndex
116116
*/
117-
static inline void Netc_Eth_Ip_MSIX_Rx(uint8 CtrlIndex);
117+
void Netc_Eth_Ip_MSIX_Rx(uint8 CtrlIndex);
118118

119119
/**
120120
* @brief Local function used to process PSI Message Receive event
@@ -227,7 +227,7 @@ static inline void Netc_Eth_Ip_MSIX_Tx(uint8 CtrlIndex)
227227
/***************************************************************************
228228
* implements Netc_Eth_Ip_MSIX_Rx_Activity
229229
***************************************************************************/
230-
static inline void Netc_Eth_Ip_MSIX_Rx(uint8 CtrlIndex)
230+
void Netc_Eth_Ip_MSIX_Rx(uint8 CtrlIndex)
231231
{
232232
uint8 RingIndex;
233233
uint32 interruptStatus = netcSIsBase[CtrlIndex]->SIRXIDR0;

s32/soc/s32z270/include/Linflexd_Uart_Ip_Defines.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ extern "C"{
2525
* 3) internal and external interfaces from this unit
2626
* 4) user callback header files
2727
==================================================================================================*/
28+
#include <zephyr/devicetree.h>
2829
#include "S32Z2_LINFLEXD.h"
2930
#include "Mcal.h"
3031
/*==================================================================================================
@@ -65,7 +66,7 @@ extern "C"{
6566
#define LINFLEXD_UART_IP_DEV_ERROR_DETECT (STD_OFF)
6667

6768
/* @brief Total number of channels configured */
68-
#define LINFLEXD_UART_IP_NUMBER_OF_INSTANCES (2U)
69+
#define LINFLEXD_UART_IP_NUMBER_OF_INSTANCES (DT_NUM_INST_STATUS_OKAY(nxp_s32_linflexd))
6970

7071
/* @brief Uart Osif source counter. This parameter is used to select between different OsIf counter implementation */
7172
#define LINFLEXD_UART_IP_TIMEOUT_TYPE (OSIF_COUNTER_DUMMY)

s32/soc/s32z270/include/Mru_Ip_Cfg.h

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern "C"{
3030
* 3) internal and external interfaces from this unit
3131
* 4) user callback header files
3232
==================================================================================================*/
33+
#include <zephyr/devicetree.h>
3334
#include "Mcal.h"
3435
#include "OsIf.h"
3536
#include "Mru_Ip_CfgDefines.h"
@@ -88,23 +89,10 @@ extern "C"{
8889
* DEFINES AND MACROS
8990
==================================================================================================*/
9091

91-
#define MRU_IP_CONFIG_EXT \
92-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU0_MRU0; \
93-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU0_MRU1; \
94-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU0_MRU2; \
95-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU0_MRU3; \
96-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU1_MRU4; \
97-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU1_MRU5; \
98-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU1_MRU6; \
99-
extern const Mru_Ip_ConfigType Mru_Ip_HWUnitConfig_RTU1_MRU7; \
100-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_0; \
101-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_1; \
102-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_2; \
103-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_3; \
104-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_4; \
105-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_5; \
106-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_6; \
107-
extern const Mru_Ip_ReceiveChannelType Mru_Ip_ReceiveChCfg_PlatformMruReceivingChannel_7;
92+
/* Not used by Zephyr integration but required to build the drivers */
93+
#define MRU_IP_CONFIG_EXT
94+
95+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru0), okay)
10896
/**
10997
* @brief RTU0_MRU0 is enabled and used.
11098
*/
@@ -117,6 +105,8 @@ extern "C"{
117105
* @brief Instance ID for RTU0_MRU0.
118106
*/
119107
#define MRU_IP_RTU0_MRU0_ID (0U)
108+
#endif
109+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru1), okay)
120110
/**
121111
* @brief RTU0_MRU1 is enabled and used.
122112
*/
@@ -129,6 +119,8 @@ extern "C"{
129119
* @brief Instance ID for RTU0_MRU1.
130120
*/
131121
#define MRU_IP_RTU0_MRU1_ID (1U)
122+
#endif
123+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru2), okay)
132124
/**
133125
* @brief RTU0_MRU2 is enabled and used.
134126
*/
@@ -141,6 +133,8 @@ extern "C"{
141133
* @brief Instance ID for RTU0_MRU2.
142134
*/
143135
#define MRU_IP_RTU0_MRU2_ID (2U)
136+
#endif
137+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru3), okay)
144138
/**
145139
* @brief RTU0_MRU3 is enabled and used.
146140
*/
@@ -153,6 +147,8 @@ extern "C"{
153147
* @brief Instance ID for RTU0_MRU3.
154148
*/
155149
#define MRU_IP_RTU0_MRU3_ID (3U)
150+
#endif
151+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru4), okay)
156152
/**
157153
* @brief RTU1_MRU4 is enabled and used.
158154
*/
@@ -165,6 +161,8 @@ extern "C"{
165161
* @brief Instance ID for RTU1_MRU4.
166162
*/
167163
#define MRU_IP_RTU1_MRU4_ID (4U)
164+
#endif
165+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru5), okay)
168166
/**
169167
* @brief RTU1_MRU5 is enabled and used.
170168
*/
@@ -177,6 +175,8 @@ extern "C"{
177175
* @brief Instance ID for RTU1_MRU5.
178176
*/
179177
#define MRU_IP_RTU1_MRU5_ID (5U)
178+
#endif
179+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru6), okay)
180180
/**
181181
* @brief RTU1_MRU6 is enabled and used.
182182
*/
@@ -189,6 +189,8 @@ extern "C"{
189189
* @brief Instance ID for RTU1_MRU6.
190190
*/
191191
#define MRU_IP_RTU1_MRU6_ID (6U)
192+
#endif
193+
#if DT_NODE_HAS_STATUS(DT_NODELABEL(mru7), okay)
192194
/**
193195
* @brief RTU1_MRU7 is enabled and used.
194196
*/
@@ -201,6 +203,8 @@ extern "C"{
201203
* @brief Instance ID for RTU1_MRU7.
202204
*/
203205
#define MRU_IP_RTU1_MRU7_ID (7U)
206+
#endif
207+
204208
/**
205209
* @brief Number of instance is used by the driver.
206210
*/
@@ -209,38 +213,12 @@ extern "C"{
209213
/**
210214
* @brief ID for interrupt group 0.
211215
*/
212-
#define MRU_IP_INT_GROUP_0 0u
216+
#define MRU_IP_INT_GROUP_0 0
213217
/**
214218
* @brief ID for interrupt group 1.
215219
*/
216-
#define MRU_IP_INT_GROUP_1 1u
217-
/**
218-
* @brief Skip the Platform default interrupt handler.
219-
*/
220-
#define MRU_IP_SKIP_RTU0_MRU0_INT1_HANDLER (STD_ON)
221-
#define MRU_IP_SKIP_RTU0_MRU0_INT2_HANDLER (STD_ON)
222-
#define MRU_IP_SKIP_RTU0_MRU0_INT3_HANDLER (STD_ON)
223-
#define MRU_IP_SKIP_RTU0_MRU1_INT1_HANDLER (STD_ON)
224-
#define MRU_IP_SKIP_RTU0_MRU1_INT2_HANDLER (STD_ON)
225-
#define MRU_IP_SKIP_RTU0_MRU1_INT3_HANDLER (STD_ON)
226-
#define MRU_IP_SKIP_RTU0_MRU2_INT1_HANDLER (STD_ON)
227-
#define MRU_IP_SKIP_RTU0_MRU2_INT2_HANDLER (STD_ON)
228-
#define MRU_IP_SKIP_RTU0_MRU2_INT3_HANDLER (STD_ON)
229-
#define MRU_IP_SKIP_RTU0_MRU3_INT1_HANDLER (STD_ON)
230-
#define MRU_IP_SKIP_RTU0_MRU3_INT2_HANDLER (STD_ON)
231-
#define MRU_IP_SKIP_RTU0_MRU3_INT3_HANDLER (STD_ON)
232-
#define MRU_IP_SKIP_RTU1_MRU4_INT1_HANDLER (STD_ON)
233-
#define MRU_IP_SKIP_RTU1_MRU4_INT2_HANDLER (STD_ON)
234-
#define MRU_IP_SKIP_RTU1_MRU4_INT3_HANDLER (STD_ON)
235-
#define MRU_IP_SKIP_RTU1_MRU5_INT1_HANDLER (STD_ON)
236-
#define MRU_IP_SKIP_RTU1_MRU5_INT2_HANDLER (STD_ON)
237-
#define MRU_IP_SKIP_RTU1_MRU5_INT3_HANDLER (STD_ON)
238-
#define MRU_IP_SKIP_RTU1_MRU6_INT1_HANDLER (STD_ON)
239-
#define MRU_IP_SKIP_RTU1_MRU6_INT2_HANDLER (STD_ON)
240-
#define MRU_IP_SKIP_RTU1_MRU6_INT3_HANDLER (STD_ON)
241-
#define MRU_IP_SKIP_RTU1_MRU7_INT1_HANDLER (STD_ON)
242-
#define MRU_IP_SKIP_RTU1_MRU7_INT2_HANDLER (STD_ON)
243-
#define MRU_IP_SKIP_RTU1_MRU7_INT3_HANDLER (STD_ON)
220+
#define MRU_IP_INT_GROUP_1 1
221+
244222
/*==================================================================================================
245223
* ENUMS
246224
==================================================================================================*/
@@ -270,5 +248,3 @@ extern RTU_MRU_Type* const Mru_Ip_apxRTU_Bases[RTU_MRU_INSTANCE_COUNT];
270248
#endif
271249

272250
/** @} */
273-
274-

s32/soc/s32z270/include/Netc_Eth_Ip_Features.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ extern "C"
4949
* DEFINES AND MACROS
5050
==================================================================================================*/
5151
/** @brief Total number of virtual ethernet controllers supported on NETC(VSIs). */
52-
#define FEATURE_NETC_ETH_NUM_OF_VIRTUAL_CTRLS (7U)
52+
#define FEATURE_NETC_ETH_NUM_OF_VIRTUAL_CTRLS 7
5353

5454
/** @brief Total number of physical ethernet controllers supported on NETC(PSIs). */
5555
#define NETC_ETH_IP_NUM_OF_PHYSICAL_CTRLS (1U)
5656

5757
/** @brief Total number of ethernet controllers supported on NETC(VSI + PSI). */
58-
#define FEATURE_NETC_ETH_NUMBER_OF_CTRLS (8U)
58+
#define FEATURE_NETC_ETH_NUMBER_OF_CTRLS (8)
5959

6060
#define FEATURE_NETC_NUMBER_OF_FUNC (4U)
6161

0 commit comments

Comments
 (0)