Skip to content

Commit 825e895

Browse files
committed
drivers: nxp_s32_netc: support both netc port selections
The s32 netc psi configuration is hardcoded to port 0 of the interface, with no path to associate with port 1. Add a DT property for selecting the port, with 0 remaining the default for compatibility. Signed-off-by: Matthew Christian <[email protected]>
1 parent 5249619 commit 825e895

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

drivers/ethernet/eth_nxp_s32_netc_priv.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
#define NETC_MIN_RING_LEN 8U
1414
#define NETC_MIN_RING_BUF_SIZE 64U
1515

16-
#define NETC_SWITCH_IDX 0U
17-
#define NETC_SWITCH_PORT_IDX 0U
16+
#define NETC_SWITCH_IDX 0U
1817
#define NETC_SWITCH_PORT_AGING 300U
1918
#define NETC_ETH_0_RX_CLK_IDX 49U
2019
#define NETC_ETH_1_RX_CLK_IDX 51U

drivers/ethernet/eth_nxp_s32_netc_psi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static const struct nxp_s32_eth_config nxp_s32_eth##n##_config = { \
409409
.paCtrlTxRingConfig = &nxp_s32_eth##n##_txring_cfg, \
410410
}, \
411411
.si_idx = NETC_SI_NXP_S32_HW_INSTANCE(n), \
412-
.port_idx = NETC_SWITCH_PORT_IDX, \
412+
.port_idx = DT_INST_PROP(n, port_index), \
413413
.tx_ring_idx = TX_RING_IDX, \
414414
.rx_ring_idx = RX_RING_IDX, \
415415
.msix = { \

dts/bindings/ethernet/nxp,s32-netc-psi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ properties:
1616
type: int
1717
description: NETC system clock frequency operation, in Hz.
1818

19+
port-index:
20+
type: int
21+
default: 0
22+
enum:
23+
- 0
24+
- 1
25+
description: Outer port of the NETC system associated with this interface.
26+
1927
mboxes:
2028
required: true
2129

0 commit comments

Comments
 (0)