Skip to content

Commit 0e8fdf6

Browse files
tunguyen4585kartben
authored andcommitted
drivers: ethernet: adapt code with new RTD 2.0.1
update members in struct Netc_Eth_Ip_StationInterfaceConfigType in RTD 2.0.1 for both psi and vsi driver code. Netc_Eth_Ip_VsiToPsiMsgType need to relocate nocache section in RTD 2.0.1 Signed-off-by: Tu Nguyen Van <tu.nguyenvan@nxp.com>
1 parent 0e132ec commit 0e8fdf6

File tree

4 files changed

+30
-7
lines changed

4 files changed

+30
-7
lines changed

drivers/ethernet/Kconfig.nxp_s32_netc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2022-2023 NXP
1+
# Copyright 2022-2023, 2025 NXP
22
# SPDX-License-Identifier: Apache-2.0
33

44
menuconfig ETH_NXP_S32_NETC
@@ -92,6 +92,13 @@ config ETH_NXP_S32_MAC_FILTER_TABLE_SIZE
9292
help
9393
Maximum number of entries supported in the MAC filter hash table.
9494

95+
config ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE
96+
int "Multicast MAC filter hash table size"
97+
default 8
98+
range 0 8
99+
help
100+
Maximum number of entries supported in the Multicast MAC filter hash table.
101+
95102
config ETH_NXP_S32_VSI_INIT_PRIORITY
96103
int
97104
default 81

drivers/ethernet/eth_nxp_s32_netc_psi.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2024 NXP
2+
* Copyright 2022-2025 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -236,7 +236,7 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(nxp_s32_netc_psi) == 1, "Only one PSI enabl
236236
BUILD_ASSERT((DT_PROP_BY_IDX(node, prop, idx) > NETC_ETH_IP_PSI_INDEX) \
237237
&& (DT_PROP_BY_IDX(node, prop, idx) <= FEATURE_NETC_ETH_NUM_OF_VIRTUAL_CTRLS), \
238238
"Invalid VSI index"); \
239-
static Netc_Eth_Ip_VsiToPsiMsgType \
239+
static __nocache Netc_Eth_Ip_VsiToPsiMsgType \
240240
_CONCAT3(nxp_s32_eth##n##_vsi, DT_PROP_BY_IDX(node, prop, idx), _rx_msg_buf) \
241241
__aligned(FEATURE_NETC_ETH_VSI_MSG_ALIGNMENT)
242242

@@ -363,6 +363,11 @@ static const Netc_Eth_Ip_EnetcGeneralConfigType nxp_s32_eth##n##_enetc_general_c
363363
.maskVLANAllowUntaggedEnable = (uint32)0x30000U, \
364364
}; \
365365
\
366+
IF_ENABLED(CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE, \
367+
(static const Netc_Eth_Ip_SiMulticastMACHashFilterDataType \
368+
nxp_s32_eth##n##_multicast_entry_init \
369+
[CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE];)) \
370+
\
366371
static const Netc_Eth_Ip_StationInterfaceConfigType nxp_s32_eth##n##_si_cfg = { \
367372
.NumberOfRxBDR = 1, \
368373
.NumberOfTxBDR = 2, \
@@ -373,7 +378,10 @@ static const Netc_Eth_Ip_StationInterfaceConfigType nxp_s32_eth##n##_si_cfg = {
373378
.EnableSIMsgInterrupt = true, \
374379
.RxInterrupts = (uint32_t)true, \
375380
.TxInterrupts = (uint32_t)false, \
376-
.MACFilterTableMaxNumOfEntries = CONFIG_ETH_NXP_S32_MAC_FILTER_TABLE_SIZE, \
381+
IF_ENABLED(CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE, \
382+
(.NumberOfConfiguredMulticastMacHashFilterEntries = \
383+
CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE, \
384+
.MulticastMACFilterEntries = &nxp_s32_eth##n##_multicast_entry_init)) \
377385
}; \
378386
\
379387
static uint8_t nxp_s32_eth##n##_switch_vlandr2dei_cfg[NETC_ETHSWT_IP_NUMBER_OF_DR]; \

drivers/ethernet/eth_nxp_s32_netc_vsi.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2024 NXP
2+
* Copyright 2022-2025 NXP
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -133,6 +133,11 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(nxp_s32_netc_vsi) == 1, "Only one VSI enabl
133133
} \
134134
}; \
135135
\
136+
IF_ENABLED(CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE, \
137+
(static const Netc_Eth_Ip_SiMulticastMACHashFilterDataType \
138+
nxp_s32_eth##n##_multicast_entry_init \
139+
[CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE];)) \
140+
\
136141
static const Netc_Eth_Ip_StationInterfaceConfigType nxp_s32_eth##n##_si_cfg = { \
137142
.NumberOfRxBDR = 1, \
138143
.NumberOfTxBDR = 1, \
@@ -141,7 +146,10 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(nxp_s32_netc_vsi) == 1, "Only one VSI enabl
141146
.EnableSIMsgInterrupt = true, \
142147
.RxInterrupts = (uint32_t)true, \
143148
.TxInterrupts = (uint32_t)false, \
144-
.MACFilterTableMaxNumOfEntries = CONFIG_ETH_NXP_S32_MAC_FILTER_TABLE_SIZE, \
149+
IF_ENABLED(CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE, \
150+
(.NumberOfConfiguredMulticastMacHashFilterEntries = \
151+
CONFIG_ETH_NXP_S32_MULTICAST_MAC_FILTER_TABLE_SIZE, \
152+
.MulticastMACFilterEntries = &nxp_s32_eth##n##_multicast_entry_init,)) \
145153
.VSItoPSIMsgCommand = &nxp_s32_eth##n##_vsi2psi_msg, \
146154
}; \
147155
\

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ manifest:
205205
groups:
206206
- hal
207207
- name: hal_nxp
208-
revision: 6a316c1bf7b381845ae8af64208906f6ec332eab
208+
revision: d0e49d63ac74208e183ed47ebb4bf8d490ab63fb
209209
path: modules/hal/nxp
210210
groups:
211211
- hal

0 commit comments

Comments
 (0)