Skip to content

Commit 5fbe949

Browse files
yangbolu1991mmahadevan108
authored andcommitted
net: dsa: add tag protocol definition and binding
Added tag protocol definition and binding. Also introduced zephyr,dsa-port compatible for future tag protocol driver Kconfig dependency checking. Updated existed dts. Signed-off-by: Yangbo Lu <[email protected]>
1 parent c559cf6 commit 5fbe949

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

dts/arm/nxp/nxp_rt118x.dtsi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <dt-bindings/i2c/i2c.h>
1010
#include <zephyr/dt-bindings/adc/adc.h>
1111
#include <zephyr/dt-bindings/pwm/pwm.h>
12+
#include <zephyr/dt-bindings/ethernet/dsa_tag_proto.h>
1213

1314
/ {
1415
aliases {
@@ -663,30 +664,36 @@
663664
#size-cells = <0>;
664665

665666
switch_port0: switch_port@0 {
667+
compatible = "zephyr,dsa-port";
666668
reg = <0>;
667669
status = "disabled";
668670
};
669671

670672
switch_port1: switch_port@1 {
673+
compatible = "zephyr,dsa-port";
671674
reg = <1>;
672675
status = "disabled";
673676
};
674677

675678
switch_port2: switch_port@2 {
679+
compatible = "zephyr,dsa-port";
676680
reg = <2>;
677681
status = "disabled";
678682
};
679683

680684
switch_port3: switch_port@3 {
685+
compatible = "zephyr,dsa-port";
681686
reg = <3>;
682687
status = "disabled";
683688
};
684689

685690
/* Internal port */
686691
switch_port4: switch_port@4 {
692+
compatible = "zephyr,dsa-port";
687693
reg = <4>;
688694
ethernet = <&enetc_psi1>;
689695
phy-connection-type = "internal";
696+
dsa-tag-protocol = <DSA_TAG_PROTO_NOTAG>;
690697
status = "disabled";
691698
};
692699
};

dts/bindings/dsa/dsa.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
description: DSA Device
55

66
child-binding:
7-
description: Properties of slave port
7+
description: Properties of port
8+
9+
compatible: "zephyr,dsa-port"
810

911
include:
1012
- name: pinctrl-device.yaml
@@ -25,3 +27,8 @@ child-binding:
2527
description:
2628
A phandle to a valid Ethernet device node. This host
2729
device is what the switch port is connected to.
30+
dsa-tag-protocol:
31+
type: int
32+
description:
33+
Tag protocol the switch using. The <zephyr/dt-bindings/ethernet/dsa_tag_proto.h>
34+
which provides macros should be included to use.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright 2025 NXP
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#ifndef ZEPHYR_INCLUDE_DT_BINDINGS_DSA_TAG_PROTO_H_
7+
#define ZEPHYR_INCLUDE_DT_BINDINGS_DSA_TAG_PROTO_H_
8+
9+
/* No switch tag protocol supported */
10+
#define DSA_TAG_PROTO_NOTAG 0
11+
/* NXP NETC switch tag protocol */
12+
#define DSA_TAG_PROTO_NETC 1
13+
14+
#endif /* ZEPHYR_INCLUDE_DT_BINDINGS_DSA_TAG_PROTO_H_ */

0 commit comments

Comments
 (0)