From nobody Thu Dec 18 09:45:59 2025 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C40821C17F; Thu, 5 Dec 2024 14:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410353; cv=none; b=WvtebPYMB6Fa9TTBzHAtF+bJQe1i1z+mv8BlHBvt/QFKZlhcCpZLs4VxLbrMXjm0ZxvYw8yz8rOEhaxeBbRgABSd0UnfebUAqnHH8xJu5uJVZEeSmK95uPWxZJ5oybxYgD8+RlL/iSWtd3lJ3UsUeRMdDFJAjrGAIvja1r3VNwk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733410353; c=relaxed/simple; bh=GwZlCs0rDyfngSE0caElPofYG+iCYPrHRrRD7N9IuMM=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j4UrAHJ4bUZSz9OKY9QLvbmjk2O3SgO+C/4uGovJpQEKIp7FIEDxUlfPsPNF7NhYfijaUMdTYqeD1n/e9gleGhEqUuE7ad3ElNUJbL0DKA49jHiqgyFDoOkSkH32w07qAYc6E7CwXRy35Y/peo2KyUYLEJ8mDmv9vqI3kCAY3EI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FHTbBccp; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FHTbBccp" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-434ab938e37so7088165e9.0; Thu, 05 Dec 2024 06:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733410350; x=1734015150; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=UObQQxVp3PNi/U3LeYQmo0T4c/idtN7E2PfgKAA5yAg=; b=FHTbBccpFqc/+WQnCAvXXxg7O8htRYxIMZK9JqQEnJbl8oF7fPNkxqHlQK8qCyDV4S 2oCvP0lBPCOFQfFiuc4PuJjC836BrwUtTjS1m0T7uXvIgWJY1Km1tWy35g5UW5lx1J0B cIJ7/VCmds5QqlUxys6wBwyhumO1KEis/61EeglZiXqwnGNBuFl9Cj5DzTlSzP6t/0LT zbkyEBtPBW5GwhvSrSVnTtf7DpIcSgDHH9uxgkCzihWvq+FXG7+W0E+ZP12uNyAmTuvR cf7IE75epHpi5mfxM71iHBqO8vN83JUMlK5+AsD0/ZhRvDUpRz28ikMVnnEfZFW+8sGO yrBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733410350; x=1734015150; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UObQQxVp3PNi/U3LeYQmo0T4c/idtN7E2PfgKAA5yAg=; b=cUGB2wysZyrxcvwSsSddUHz4Nbw7+63aJ7WkXg+IAc3opInqt8X7YKd39GyjcO+5uz /yzPmxVPNBE2gLyoLot+iFMP/tFtFuHyzRCpF0jzHGcRpDRB+dJmaHK0hvj/jUtlsHfG XePdlfwUbl8kUWvu2NSLYNHKWMjbcoMHki6JRNe7BvL9Q77x00mlTahii/Lfh2dJNjuF RIrsVRFkjTvHSgGCJrBmWUlJpvMHJdshnhREc92yK3y7xJnWb7dM0VIrdmBJZscgQsvF f783BI7oGonootqRA7cumivi37TeOYmB4te0+QAyuMHNPWTOUEwCgYJJs9gyA0ATN+ox +j2Q== X-Forwarded-Encrypted: i=1; AJvYcCUxbbkBk5IpM1nXtxQ1PUd3vhzQtSMnXruSVFQus/GxNM1nAdmJEuroAzGt8/vbYh0gz0xGm4gLh5Xi@vger.kernel.org, AJvYcCV7PDUd+7uNwHtEeOJcg+XknQQkX+AAe60LGr0MtnUXWIH3nFgQ7emEg1itiP0x5EFwX4lppgsEN0BnRGE6@vger.kernel.org, AJvYcCXW3mbNzq2ezD+OYIzZlKituThLBYjbQvxASM2GWfyy9/3XO2xomi6NhrZHrH0/M8l/XYd1pra4@vger.kernel.org X-Gm-Message-State: AOJu0Yw3tpYJrxSTp7zscNshsNABqufTO5nag9DvBWih5Zyd4BlkMkG9 y2NLpaFiv7Iy3rM7WQTwE9DGv1uzmduS9XxdvZ40lJn98ArvQNol X-Gm-Gg: ASbGncvE/AZMxZfUn5xUF75oBjltJ2CZgyqkxe8jzAr96IRGAS1yZtgOACvKrOTaJtX dbyygIZhmT2scrs1eXgqTgGTcCUCdgTzFKOpuIVvxvvBiffS/HxYA3nwOtSUF/jpXin25Krio/f 4AMZ0VvhrM2qoo0YlJL+wFMWa5DwBTtBmLZCvk4ykaW/aYWbDq8ke6sF3ID8mxaDG0gVxIARCag 9GzEJiRlU5ced+2q1VukOui65zlLHECaxcX3smwhPKgMJX8UsgEe40JGJtbuhSw8DmJZrGl5UQN 5X3I03j+26imIFPxWlQ= X-Google-Smtp-Source: AGHT+IHVfbuvl4hY8uEF3CNg6E19otV2kMWvkycWL0ry6zNM/pUpJ/vDJTPaMmy8zntVQ2NCafntAA== X-Received: by 2002:a05:600c:1e21:b0:434:9934:575 with SMTP id 5b1f17b1804b1-434d3fae14dmr79693385e9.16.1733410350191; Thu, 05 Dec 2024 06:52:30 -0800 (PST) Received: from localhost.localdomain (93-34-91-161.ip49.fastwebnet.it. [93.34.91.161]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-434da113580sm26728035e9.29.2024.12.05.06.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 06:52:29 -0800 (PST) From: Christian Marangi To: Christian Marangi , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Russell King , Matthias Brugger , AngeloGioacchino Del Regno , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, upstream@airoha.com Subject: [net-next PATCH v9 2/4] dt-bindings: net: dsa: Add Airoha AN8855 Gigabit Switch documentation Date: Thu, 5 Dec 2024 15:51:32 +0100 Message-ID: <20241205145142.29278-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241205145142.29278-1-ansuelsmth@gmail.com> References: <20241205145142.29278-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add Airoha AN8855 5 port Gigabit Switch documentation. The switch node requires an additional mdio node to describe each internal PHY absolute address on the bus. 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 and relative NVMEM cells needs to be defined in nvmem-layout node. Signed-off-by: Christian Marangi Reviewed-by: Rob Herring (Arm) --- .../bindings/net/dsa/airoha,an8855.yaml | 242 ++++++++++++++++++ 1 file changed, 242 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..8ea2fadbab85 --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/airoha,an8855.yaml @@ -0,0 +1,242 @@ +# 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 + +description: > + Airoha AN8855 is a 5-port Gigabit Switch. + + The switch node requires an additional mdio node to describe each intern= al + 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 addre= ss + 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,ext-surge: + $ref: /schemas/types.yaml#/definitions/flag + description: + Calibrate the internal PHY with the calibration values stored in EFU= SE + for the r50Ohm values. + + '#nvmem-cell-cells': + const: 0 + + nvmem-layout: + $ref: /schemas/nvmem/layouts/nvmem-layout.yaml + description: + NVMEM Layout for exposed EFUSE. (for example to propagate calibration + value for r50Ohm for internal PHYs) + + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + description: + Define the absolute address of the internal PHY for each port. + +$ref: dsa.yaml# + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include + + mdio { + #address-cells =3D <1>; + #size-cells =3D <0>; + + switch@1 { + compatible =3D "airoha,an8855"; + reg =3D <1>; + reset-gpios =3D <&pio 39 0>; + + airoha,ext-surge; + + #nvmem-cell-cells =3D <0>; + + nvmem-layout { + compatible =3D "fixed-layout"; + #address-cells =3D <1>; + #size-cells =3D <1>; + + shift_sel_port0_tx_a: shift-sel-port0-tx-a@c { + reg =3D <0xc 0x4>; + }; + + shift_sel_port0_tx_b: shift-sel-port0-tx-b@10 { + reg =3D <0x10 0x4>; + }; + + shift_sel_port0_tx_c: shift-sel-port0-tx-c@14 { + reg =3D <0x14 0x4>; + }; + + shift_sel_port0_tx_d: shift-sel-port0-tx-d@18 { + reg =3D <0x18 0x4>; + }; + + shift_sel_port1_tx_a: shift-sel-port1-tx-a@1c { + reg =3D <0x1c 0x4>; + }; + + shift_sel_port1_tx_b: shift-sel-port1-tx-b@20 { + reg =3D <0x20 0x4>; + }; + + shift_sel_port1_tx_c: shift-sel-port1-tx-c@24 { + reg =3D <0x24 0x4>; + }; + + shift_sel_port1_tx_d: shift-sel-port1-tx-d@28 { + reg =3D <0x28 0x4>; + }; + + shift_sel_port2_tx_a: shift-sel-port2-tx-a@2c { + reg =3D <0x2c 0x4>; + }; + + shift_sel_port2_tx_b: shift-sel-port2-tx-b@30 { + reg =3D <0x30 0x4>; + }; + + shift_sel_port2_tx_c: shift-sel-port2-tx-c@34 { + reg =3D <0x34 0x4>; + }; + + shift_sel_port2_tx_d: shift-sel-port2-tx-d@38 { + reg =3D <0x38 0x4>; + }; + + shift_sel_port3_tx_a: shift-sel-port3-tx-a@4c { + reg =3D <0x4c 0x4>; + }; + + shift_sel_port3_tx_b: shift-sel-port3-tx-b@50 { + reg =3D <0x50 0x4>; + }; + + shift_sel_port3_tx_c: shift-sel-port3-tx-c@54 { + reg =3D <0x54 0x4>; + }; + + shift_sel_port3_tx_d: shift-sel-port3-tx-d@58 { + reg =3D <0x58 0x4>; + }; + }; + + ports { + #address-cells =3D <1>; + #size-cells =3D <0>; + + port@0 { + reg =3D <0>; + label =3D "lan1"; + phy-mode =3D "internal"; + phy-handle =3D <&internal_phy1>; + }; + + port@1 { + reg =3D <1>; + label =3D "lan2"; + phy-mode =3D "internal"; + phy-handle =3D <&internal_phy2>; + }; + + port@2 { + reg =3D <2>; + label =3D "lan3"; + phy-mode =3D "internal"; + phy-handle =3D <&internal_phy3>; + }; + + port@3 { + reg =3D <3>; + label =3D "lan4"; + phy-mode =3D "internal"; + phy-handle =3D <&internal_phy4>; + }; + + port@5 { + reg =3D <5>; + label =3D "cpu"; + ethernet =3D <&gmac0>; + phy-mode =3D "2500base-x"; + + fixed-link { + speed =3D <2500>; + full-duplex; + pause; + }; + }; + }; + + mdio { + #address-cells =3D <1>; + #size-cells =3D <0>; + + internal_phy1: phy@1 { + reg =3D <1>; + + nvmem-cells =3D <&shift_sel_port0_tx_a>, + <&shift_sel_port0_tx_b>, + <&shift_sel_port0_tx_c>, + <&shift_sel_port0_tx_d>; + nvmem-cell-names =3D "tx_a", "tx_b", "tx_c", "tx_d"; + }; + + internal_phy2: phy@2 { + reg =3D <2>; + + nvmem-cells =3D <&shift_sel_port1_tx_a>, + <&shift_sel_port1_tx_b>, + <&shift_sel_port1_tx_c>, + <&shift_sel_port1_tx_d>; + nvmem-cell-names =3D "tx_a", "tx_b", "tx_c", "tx_d"; + }; + + internal_phy3: phy@3 { + reg =3D <3>; + + nvmem-cells =3D <&shift_sel_port2_tx_a>, + <&shift_sel_port2_tx_b>, + <&shift_sel_port2_tx_c>, + <&shift_sel_port2_tx_d>; + nvmem-cell-names =3D "tx_a", "tx_b", "tx_c", "tx_d"; + }; + + internal_phy4: phy@4 { + reg =3D <4>; + + nvmem-cells =3D <&shift_sel_port3_tx_a>, + <&shift_sel_port3_tx_b>, + <&shift_sel_port3_tx_c>, + <&shift_sel_port3_tx_d>; + nvmem-cell-names =3D "tx_a", "tx_b", "tx_c", "tx_d"; + }; + }; + }; + }; --=20 2.45.2