From patchwork Thu Dec 5 14:51:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13895470 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 703ADE7716D for ; Thu, 5 Dec 2024 14:55:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:To:From:Reply-To: Cc:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UObQQxVp3PNi/U3LeYQmo0T4c/idtN7E2PfgKAA5yAg=; b=mjIZbHFr5jZarPNHe2USii3hCz XSA5lVesm+aNNHGVwtiOftfywGosLvXXT+it0Pe+bCZgekVKV/p+n6WJGKr7cCqTv4sVaIkvse6ki manzhP+Jj5EHIRtxG3aLpwYGKy/g+Dys1+lU8u3DfMThi0w0QWNF70eZlad49ruTfyo1gyOVdCYfX EHDUawbygoHTM/dmOEgeC4VBWTQHcvb7xF3rue1RCaIsUsFr0OXu/Eimz1Mp8FPpLKCwgHi1zrtl6 jEBEZL688SLNl+SlyOF/Vrl/IzYlB0pTJmRboLbJlT4oqmSqsJL+2A52C08FX3ItoKFVSL774p0pq SoNafpeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tJDGS-0000000GQI6-2Vt5; Thu, 05 Dec 2024 14:55:36 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tJDDU-0000000GPjw-1fyP; Thu, 05 Dec 2024 14:52:33 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-434aabd688fso6924545e9.3; 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=lists.infradead.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=EGf0+QDXQP/8NKf1gkcCWSs7HMLdBFgsv4HPq3Y1/2OnN7mXmcazHWFJmyPe/4fyK9 tE3biiAipBfhV0vS5eGQZqU0wkiPB8Qs57qkchG6tMBike7fgf96RHaUSA6IteC/lwIx 66O8oqNd/jzXlkJKZP2AvjLaW82YM0bpGtvUFQR7QempBM59BYRLvd0OvH/0/1+/V+uE M98PZ8LvNYfBdNpJXR2NmIJFwBMv+dVr/bYOBpGZcAOB4IvlM6xxRd5UZGJ9DvUy8r4S mmvsMPXa2e3G/krzz8ZF97eOsaRYcxLMAYa4dxFWquMTDzlTd6D5iqXJc5kVa4r25TO5 HF8A== 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=q+zwpQtZqS0+SC4NeuSj/dXy89qC5hcSvkOA0yim5QiVpp/gsOx6cebKLkcp2St0g1 PqQEZyaD96vviW4P35ikzzacm5CTsVBMoiVNCtXgAptECKzGM35A3wTaf5Jl/PzGSAYG UN4IZsIibMlFfuq92tkf421sUSmRhWySO4Kusf84tbURABbeYZr2wBOGYsAq8cgVVkcr 2hyyvPwnVtzHg6a0g9k0KjjOGiuE7MY4ACnkl1hA7WrRSkYOawycUAf/AArRaVFcr+zG KZHQ7Xj8yggIE9qTp47CggEoKMnTf6ca71F3GkuAtleqx6b/6wJWZz2TXimx1r7SqC3M 7onQ== X-Forwarded-Encrypted: i=1; AJvYcCWkcS52c6UYFB+N7Q7hVo+A85ewCUOLqJHo6WfFYyP6vhTHaYvQcfJwVoSUxzS1Dlgq47svCSk8nxEPlh1KrVsH@lists.infradead.org, AJvYcCX/F+Y3s3mqgw24CuAZNsMvfWivCzYeqcdzOQQDumfj4s8N9O5n+53qjghw8aVeIERL3wd/IQDb9uQAgEIjr5Y=@lists.infradead.org X-Gm-Message-State: AOJu0YwP+ZGao6PmR985eKaRc2Du7ilhPq/RQXBxs3nvEqD5+o0Agkqf Ke2XSKVX9A06xCxvsA7Pipn44acg0PvRM6XlfQ/PWGVN4tRftiOJ X-Gm-Gg: ASbGncvWIH5EfpRLFbnH+tIL7NnwEMZU6PcVhZtxblr4o4BP4ElM1oR28EboQNd652I 5yPla5MBU3hydYrTk/W0+hIQ4oCCqc0H0hZmWzoUbISfOCYOaUEouMKqiM1TOygxMSm+kv5s9Lp wDtgYH1/dLiO3D77J36kERK9eslsebf1kP4Dc80Mufm7C9yj6Sz/r0WtscXmcnqap4tqdaAHXYr 2xK9Mt6b7ip2/KpfrOlFkvI/TD0OdEm1PlYWWpztYLEJyGBrhA+IZE/nfRvE1XbUwNYPNzr4+LV x/GqN34582jE9rakm0U= 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> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241205_065232_433490_1F0975C8 X-CRM114-Status: GOOD ( 16.93 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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 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,ext-surge: + $ref: /schemas/types.yaml#/definitions/flag + description: + Calibrate the internal PHY with the calibration values stored in EFUSE + 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 = <1>; + #size-cells = <0>; + + switch@1 { + compatible = "airoha,an8855"; + reg = <1>; + reset-gpios = <&pio 39 0>; + + airoha,ext-surge; + + #nvmem-cell-cells = <0>; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + shift_sel_port0_tx_a: shift-sel-port0-tx-a@c { + reg = <0xc 0x4>; + }; + + shift_sel_port0_tx_b: shift-sel-port0-tx-b@10 { + reg = <0x10 0x4>; + }; + + shift_sel_port0_tx_c: shift-sel-port0-tx-c@14 { + reg = <0x14 0x4>; + }; + + shift_sel_port0_tx_d: shift-sel-port0-tx-d@18 { + reg = <0x18 0x4>; + }; + + shift_sel_port1_tx_a: shift-sel-port1-tx-a@1c { + reg = <0x1c 0x4>; + }; + + shift_sel_port1_tx_b: shift-sel-port1-tx-b@20 { + reg = <0x20 0x4>; + }; + + shift_sel_port1_tx_c: shift-sel-port1-tx-c@24 { + reg = <0x24 0x4>; + }; + + shift_sel_port1_tx_d: shift-sel-port1-tx-d@28 { + reg = <0x28 0x4>; + }; + + shift_sel_port2_tx_a: shift-sel-port2-tx-a@2c { + reg = <0x2c 0x4>; + }; + + shift_sel_port2_tx_b: shift-sel-port2-tx-b@30 { + reg = <0x30 0x4>; + }; + + shift_sel_port2_tx_c: shift-sel-port2-tx-c@34 { + reg = <0x34 0x4>; + }; + + shift_sel_port2_tx_d: shift-sel-port2-tx-d@38 { + reg = <0x38 0x4>; + }; + + shift_sel_port3_tx_a: shift-sel-port3-tx-a@4c { + reg = <0x4c 0x4>; + }; + + shift_sel_port3_tx_b: shift-sel-port3-tx-b@50 { + reg = <0x50 0x4>; + }; + + shift_sel_port3_tx_c: shift-sel-port3-tx-c@54 { + reg = <0x54 0x4>; + }; + + shift_sel_port3_tx_d: shift-sel-port3-tx-d@58 { + reg = <0x58 0x4>; + }; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + phy-mode = "internal"; + phy-handle = <&internal_phy1>; + }; + + port@1 { + reg = <1>; + label = "lan2"; + phy-mode = "internal"; + phy-handle = <&internal_phy2>; + }; + + port@2 { + reg = <2>; + label = "lan3"; + phy-mode = "internal"; + phy-handle = <&internal_phy3>; + }; + + port@3 { + reg = <3>; + label = "lan4"; + phy-mode = "internal"; + phy-handle = <&internal_phy4>; + }; + + port@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_phy1: phy@1 { + reg = <1>; + + nvmem-cells = <&shift_sel_port0_tx_a>, + <&shift_sel_port0_tx_b>, + <&shift_sel_port0_tx_c>, + <&shift_sel_port0_tx_d>; + nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d"; + }; + + internal_phy2: phy@2 { + reg = <2>; + + nvmem-cells = <&shift_sel_port1_tx_a>, + <&shift_sel_port1_tx_b>, + <&shift_sel_port1_tx_c>, + <&shift_sel_port1_tx_d>; + nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d"; + }; + + internal_phy3: phy@3 { + reg = <3>; + + nvmem-cells = <&shift_sel_port2_tx_a>, + <&shift_sel_port2_tx_b>, + <&shift_sel_port2_tx_c>, + <&shift_sel_port2_tx_d>; + nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d"; + }; + + internal_phy4: phy@4 { + reg = <4>; + + nvmem-cells = <&shift_sel_port3_tx_a>, + <&shift_sel_port3_tx_b>, + <&shift_sel_port3_tx_c>, + <&shift_sel_port3_tx_d>; + nvmem-cell-names = "tx_a", "tx_b", "tx_c", "tx_d"; + }; + }; + }; + };