[net-next RFC PATCH 2/4] dt-bindings: net: dsa: Add Airoha AN8855 Gigabit Switch documentation
Christian Marangi
ansuelsmth at gmail.com
Mon Oct 21 06:01:57 PDT 2024
Add Airoha AN8855 5 port Gigabit Switch documentation.
The switch node requires an additional mdio node to describe each internal
PHY relative offset as the PHY address for the switch match the one for
the PHY ports. On top of internal PHY address, the switch base PHY address
is added.
Also the switch base PHY address can be configured and changed after the
first initialization. On reset, the switch PHY address is ALWAYS 1.
This can be configured with the use of "airoha,base_smi_address".
Calibration values might be stored in switch EFUSE and internal PHY
might need to be calibrated, in such case, airoha,ext_surge needs to be
enabled.
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
.../bindings/net/dsa/airoha,an8855.yaml | 146 ++++++++++++++++++
1 file changed, 146 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/dsa/airoha,an8855.yaml
diff --git a/Documentation/devicetree/bindings/net/dsa/airoha,an8855.yaml b/Documentation/devicetree/bindings/net/dsa/airoha,an8855.yaml
new file mode 100644
index 000000000000..861c47df5bde
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/dsa/airoha,an8855.yaml
@@ -0,0 +1,146 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/dsa/airoha,an8855.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Airoha AN8855 Gigabit switch
+
+maintainers:
+ - Christian Marangi <ansuelsmth at gmail.com>
+
+description:
+ Airoha AN8855 is a 5-port Gigabit Switch.
+
+ The switch node requires an additional mdio node to describe each internal
+ PHY relative offset as the PHY address for the switch match the one for
+ the PHY ports. On top of internal PHY address, the switch base PHY address
+ is added.
+
+ Also the switch base PHY address can be configured and changed after the
+ first initialization. On reset, the switch PHY address is ALWAYS 1.
+
+properties:
+ compatible:
+ const: airoha,an8855
+
+ reg:
+ maxItems: 1
+
+ reset-gpios:
+ description:
+ GPIO to be used to reset the whole device
+ maxItems: 1
+
+ airoha,base_smi_address:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Configure and change the base switch PHY address to a new address on
+ the bus.
+ On reset, the switch PHY address is ALWAYS 1.
+ default: 1
+ maximum: 31
+
+ airoha,ext_surge:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ Calibrate the internal PHY with the calibration values stored in EFUSE
+ for the r50Ohm values.
+
+ mdio:
+ $ref: /schemas/net/mdio.yaml#
+ unevaluatedProperties: false
+ description: Define the relative address of the internal PHY for each port.
+ Each reg for the PHY is relative to the switch base PHY address.
+
+$ref: dsa.yaml#
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ switch at 1 {
+ compatible = "airoha,an8855";
+ reg = <1>;
+ reset-gpios = <&pio 39 0>;
+
+ airoha,ext_surge;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port at 0 {
+ reg = <0>;
+ label = "lan1";
+ phy-mode = "internal";
+ phy-handle = <&internal_phy0>;
+ };
+
+ port at 1 {
+ reg = <1>;
+ label = "lan2";
+ phy-mode = "internal";
+ phy-handle = <&internal_phy1>;
+ };
+
+ port at 2 {
+ reg = <2>;
+ label = "lan3";
+ phy-mode = "internal";
+ phy-handle = <&internal_phy2>;
+ };
+
+ port at 3 {
+ reg = <3>;
+ label = "lan4";
+ phy-mode = "internal";
+ phy-handle = <&internal_phy3>;
+ };
+
+ port at 5 {
+ reg = <5>;
+ label = "cpu";
+ ethernet = <&gmac0>;
+ phy-mode = "2500base-x";
+
+ fixed-link {
+ speed = <2500>;
+ full-duplex;
+ pause;
+ };
+ };
+ };
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ internal_phy0: phy at 0 {
+ reg = <0>;
+ };
+
+ internal_phy1: phy at 1 {
+ reg = <1>;
+ };
+
+ internal_phy2: phy at 2 {
+ reg = <2>;
+ };
+
+ internal_phy3: phy at 3 {
+ reg = <3>;
+ };
+ };
+ };
+ };
--
2.45.2
More information about the Linux-mediatek
mailing list