From patchwork Thu Oct 12 22:35:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13419939 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 F030FC41513 for ; Thu, 12 Oct 2023 22:36:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HjkczVGWcm8T2HuZV6WnaNMbWqEq4Jb+OoGc8qbLFPg=; b=HtFkUGtoxLKXmO zOVVc8PYEmSPFisII2hsuwKgn9r+Yt+41sOFlKIzjW+TSXlkTB/2vtvihrD8CQtLlsuo5BTV8+rvm HEJPzgLgsYjcGdpGiJShv8OezXh1dBZvPj+HZHifTUYUs/+cQF5NmembLHuiRNCHIQDrv81j+Mc3o EbmG2+/BwqhuAiVZoj7BXIwTW1UtN9s29/fXai/PC5SxUq14n+AL7EyDNFe9P5MA/2FrUG/z5biK6 BxKny2XKVqh2ZaVX5bPDzMQwFVL18CTWYuwSVOjSQuHaU2PhYeo5hQY9jzt316HmU2L+G4TNWvFNx Rd+QRpd8f2j6dLpcB25A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qr4HI-0020qc-2l; Thu, 12 Oct 2023 22:35:37 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qr4H6-0020lr-2M for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 22:35:30 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2bff776fe0bso18943891fa.0 for ; Thu, 12 Oct 2023 15:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697150122; x=1697754922; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=t8U+a3PhU8m5mApmJF8MtIvjJ5OqBpg+Pl3mnQuevJg=; b=XOY+oqux3kZLtXozr5Px2An5HJIz+Pobf1tuaiTmdbDyYhdcQZwqXg+Pa+OLXT3+Kk RYTVqhSjeO11tYPyGOk0F0QJyzqlxChVBbMXbc8B/vixkDonj6QguD/Zy968r1zJzsEg kMXddQP4xuIreqdKRyOnqFcy6H8/owwymTQL+xpmwxY7ojPzEvL/AXdcqlJosiWEB2gK C2hbdes5kUvtU7CHtvDL4T1/gz8hMQw/CVEPSimbiuyf6F7XUnr4XTkiX75bsso/S2AK Rq3MyiIpPV9YdwByLrlTbjUsidtCQl+2moZv9N0HQ5FadW2oOV4u4dVULXM2tfTwc272 l2sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697150122; x=1697754922; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t8U+a3PhU8m5mApmJF8MtIvjJ5OqBpg+Pl3mnQuevJg=; b=VAHNRCoYsjfBSNh+vX4ij+Yz5lIOlQi+pDvBVxStgCw4/6PeefOfVrQyg8nP5FrQTa usdHXOlzDjNIwVDGRNo5vX2wg1igmkgYpJUmMJXBwO+wvgFUlQQ/lQ+y8x93etTQNkyp SVVVa7C/gEgRw4+vEHLhWvnd8N6nufzOaLgc5y5TqDFiWB00eY87Y2BolsFpiny1k/E4 adkDf9CR5mQvfYpr2JBLueCNve0LMMNfnx3Gtb/bUEqhSnxurlUKaZYwuPfW7fxR1OOF B92I6uECyb9NoGrHOp496I8qoBX2ZswkTonvsUWFslEFx766DpMS23d0cErW+kFCqnqq 40kA== X-Gm-Message-State: AOJu0YxfvqKMmW+6qOCMsoq+Hma6UZfXw6no4UCK17n4h1LzVY7UgrLJ QQsMHT6m1zWUdWaAZy7jR8X8Dg== X-Google-Smtp-Source: AGHT+IGZTSbPvJZxknKfkA/iTsRvkhXfDcNp+3UEqfdvugniSIIFexQMavXsFpbuZZAamp/mOQab9g== X-Received: by 2002:a2e:be0e:0:b0:2c5:12b:6ef2 with SMTP id z14-20020a2ebe0e000000b002c5012b6ef2mr1334606ljq.33.1697150122289; Thu, 12 Oct 2023 15:35:22 -0700 (PDT) Received: from [192.168.1.2] (c-21d3225c.014-348-6c756e10.bbcust.telenor.se. [92.34.211.33]) by smtp.gmail.com with ESMTPSA id x21-20020a05651c105500b002bcb89e92dcsm3811671ljm.6.2023.10.12.15.35.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 15:35:21 -0700 (PDT) From: Linus Walleij Date: Fri, 13 Oct 2023 00:35:14 +0200 Subject: [PATCH 1/3] ARM: dts: marvell: Fix some common switch mistakes MIME-Version: 1.0 Message-Id: <20231013-marvell-88e6152-wan-led-v1-1-0712ba99857c@linaro.org> References: <20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org> In-Reply-To: <20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org> To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Russell King , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Christian Marangi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_153524_850301_F8370DB3 X-CRM114-Status: GOOD ( 14.88 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix some errors in the Marvell MV88E6xxx switch descriptions: - The top node had no address size or cells. - switch0@0 is not OK, should be switch@0. This serves as an example of fixes needed for introducing a schema for the bindings, but the patch can simply be applied. Signed-off-by: Linus Walleij --- arch/arm/boot/dts/marvell/armada-370-rd.dts | 2 -- arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts | 2 -- arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts | 2 +- arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts | 2 +- arch/arm/boot/dts/marvell/armada-385-linksys.dtsi | 2 -- arch/arm/boot/dts/marvell/armada-388-clearfog.dts | 2 -- arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts | 2 -- 7 files changed, 2 insertions(+), 12 deletions(-) diff --git a/arch/arm/boot/dts/marvell/armada-370-rd.dts b/arch/arm/boot/dts/marvell/armada-370-rd.dts index b459a670f615..e3a1834986ee 100644 --- a/arch/arm/boot/dts/marvell/armada-370-rd.dts +++ b/arch/arm/boot/dts/marvell/armada-370-rd.dts @@ -151,8 +151,6 @@ led@0 { switch: switch@10 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <0x10>; interrupt-controller; #interrupt-cells = <2>; diff --git a/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts b/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts index f4c4b213ef4e..d4fff4ea9f20 100644 --- a/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts +++ b/arch/arm/boot/dts/marvell/armada-381-netgear-gs110emx.dts @@ -79,14 +79,12 @@ &mdio { switch@0 { compatible = "marvell,mv88e6190"; - #address-cells = <1>; #interrupt-cells = <2>; interrupt-controller; interrupt-parent = <&gpio1>; interrupts = <7 IRQ_TYPE_LEVEL_LOW>; pinctrl-0 = <&switch_interrupt_pins>; pinctrl-names = "default"; - #size-cells = <0>; reg = <0>; mdio { diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts index 1990f7d0cc79..1be0419f8f3e 100644 --- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts +++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-l8.dts @@ -7,7 +7,7 @@ / { }; &mdio { - switch0: switch0@4 { + switch0: switch@4 { compatible = "marvell,mv88e6190"; reg = <4>; pinctrl-names = "default"; diff --git a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts index b795ad573891..6ec536222bfb 100644 --- a/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts +++ b/arch/arm/boot/dts/marvell/armada-385-clearfog-gtr-s4.dts @@ -11,7 +11,7 @@ &sfp0 { }; &mdio { - switch0: switch0@4 { + switch0: switch@4 { compatible = "marvell,mv88e6085"; reg = <4>; pinctrl-names = "default"; diff --git a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi index fc8216fd9f60..63a0bc9455ca 100644 --- a/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi +++ b/arch/arm/boot/dts/marvell/armada-385-linksys.dtsi @@ -160,8 +160,6 @@ &mdio { switch@0 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <0>; ports { diff --git a/arch/arm/boot/dts/marvell/armada-388-clearfog.dts b/arch/arm/boot/dts/marvell/armada-388-clearfog.dts index 32c569df142f..ab46903580aa 100644 --- a/arch/arm/boot/dts/marvell/armada-388-clearfog.dts +++ b/arch/arm/boot/dts/marvell/armada-388-clearfog.dts @@ -94,8 +94,6 @@ &mdio { switch@4 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <4>; pinctrl-0 = <&clearfog_dsa0_clk_pins &clearfog_dsa0_pins>; pinctrl-names = "default"; diff --git a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts index 7a0614fd0c93..2a5518c73bff 100644 --- a/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts +++ b/arch/arm/boot/dts/marvell/armada-xp-linksys-mamba.dts @@ -267,8 +267,6 @@ &mdio { switch@0 { compatible = "marvell,mv88e6085"; - #address-cells = <1>; - #size-cells = <0>; reg = <0>; ports { From patchwork Thu Oct 12 22:35:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13419940 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 DBEADCDB47E for ; Thu, 12 Oct 2023 22:36:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0agfjFj3EX/FfNkxnROL+U+usuZG2eA9zUTTet+7u6w=; b=ZECZ3Bc+XnnCW8 Mn91K9aX0rgKND1u8hs0jbR7kFStkgFjyfnSXcetS8MuGA1VM3Au6q1GbizFShGIG2U0RSPuD+f5C jIWnyIvT9gcvkadngciqp7DOIJrxUVzyow6RXpkiLFtlMh+ipeeM2SrS/puyThQhLUapDgNmabY/n RGgD2weQ2aeqizqRR12lDUcZMa6aNlgj6dcqyR2vuqFD5Ew/FQvA9Wi/wKqA9Yn9/gFFgJmlVNMpG cuDlYFEBTyYDzPQ8Wy4knld66KrfvyxtRK5Gg3No1HzrNLaNBPx/gOemTDsgNuZJ247GLyJZGMwNR siWUMQsnxTrwcoAn/Kxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qr4HK-0020ru-33; Thu, 12 Oct 2023 22:35:38 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qr4H8-0020mA-0k for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 22:35:31 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c16bc71e4cso17921491fa.0 for ; Thu, 12 Oct 2023 15:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697150123; x=1697754923; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hgMj9vdqqU21RhQ4lUklEYNZmR7Go1MrleRsfdqVh6E=; b=u+9vu6S/5t5g0yyBVkfM0OCcuf6+eAcG8DfUKqmKowvia+fPeXU3wdsLaX8rz5oud8 80dt2XVY5/HM55BSeBBHtyC9AxUMC3YXDVF3nFuYnG+tD2yLDoK7j/rCtr0D5FsnYIq9 E8FLbEuD8dZnx+4G7eVFFruXymRAie6nO0lsJW0mUu+DoH2AZQC7EeymI0+IkXN1yCZC AdEKwLOxvqhxaLeeYIK0LD9d9vtbWqCr5WCcAiOyVUgpZFxi0CgoDxTRbl4t6ds98uhZ Kk/ccpI5CuhhpncAfs7W5kuGdvK4hXPbbKL7JuXsx9GBUoXMagPZX24Up1W58shZQiad 7F8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697150123; x=1697754923; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hgMj9vdqqU21RhQ4lUklEYNZmR7Go1MrleRsfdqVh6E=; b=aHkkywCpk1RLvlw9If/HcC18QAMkoVJ9k1qai3nzXlTPxefIIxDSbVtuQ1z9X4DYoW H8Gw/Oa7wOz38rVT6eiv05s3Wsv8UtM+gyQQ9wf9FnqD7Kj2MQZFzV3eZ+2ubRe0oWNv l+bxAOjBYw/FtulY7c0waVsO0d3bRwI1xypWmZqaM7GORRfL/4JW3Amx1OgwkJkukiaZ NR/o8WkgX61bbfCbgKyUohFn+b/ke+EuclROAAzvVaCErtGl+XeF7pao3CY5/y7Nyaeo KaoCPM9vKVY4MWliATWYLEHMzajvUXoGVHK3/gXW6VycVY4lrYGdWxNstIJGmPZRZwS6 9vXA== X-Gm-Message-State: AOJu0YzQZwcYaeuC38twhq2txuf0AoH4g6dmac1FjaE7qWqYub917KNT LhCMAjstHM/ok4VsyHVdOYZaPg== X-Google-Smtp-Source: AGHT+IHpIxhKNFq+IeB0vOLQKz7wkEZGLa03nlX65eBLkq925LI7OqJi1mtlrYp8Srl6ttzrk2C3cQ== X-Received: by 2002:a2e:be0e:0:b0:2c4:feef:84d with SMTP id z14-20020a2ebe0e000000b002c4feef084dmr1856567ljq.43.1697150123483; Thu, 12 Oct 2023 15:35:23 -0700 (PDT) Received: from [192.168.1.2] (c-21d3225c.014-348-6c756e10.bbcust.telenor.se. [92.34.211.33]) by smtp.gmail.com with ESMTPSA id x21-20020a05651c105500b002bcb89e92dcsm3811671ljm.6.2023.10.12.15.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 15:35:22 -0700 (PDT) From: Linus Walleij Date: Fri, 13 Oct 2023 00:35:15 +0200 Subject: [PATCH 2/3] RFC: dt-bindings: marvell: Rewrite in schema MIME-Version: 1.0 Message-Id: <20231013-marvell-88e6152-wan-led-v1-2-0712ba99857c@linaro.org> References: <20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org> In-Reply-To: <20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org> To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Russell King , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Christian Marangi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_153526_270637_21710D65 X-CRM114-Status: GOOD ( 29.02 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This is an attempt to rewrite the Marvell MV88E6xxx switch bindings in YAML schema. The current text binding says: WARNING: This binding is currently unstable. Do not program it into a FLASH never to be changed again. Once this binding is stable, this warning will be removed. Well that never happened before we switched to YAML markup, we can't have it like this, what about fixing the mess? Signed-off-by: Linus Walleij --- .../bindings/net/dsa/marvell,mv88e6xxx.yaml | 249 +++++++++++++++++++++ .../devicetree/bindings/net/dsa/marvell.txt | 109 --------- MAINTAINERS | 2 +- 3 files changed, 250 insertions(+), 110 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml new file mode 100644 index 000000000000..8ff94e8b89da --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml @@ -0,0 +1,249 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dsa/marvell,mv88e6xxx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Marvell MV88E6xxx switch family + +maintainers: + - Andrew Lunn + +description: + The Marvell MV88E6xxx switch series has been produced and sold + by Marvell since at least 2010. The switch has a few compatibles which + just indicate the base address of the switch, then operating systems + can investigate switch ID registers to find out which actual version + of the switch it is dealing with. + +properties: + compatible: + oneOf: + - enum: + - marvell,mv88e6060 + - marvell,mv88e6085 + - marvell,mv88e6190 + - marvell,mv88e6250 + description: | + marvell,mv88e6060: The oldest Marvell switch supported (singular version) + marvell,mv88e6085: This switch uses base address 0x10. + This switch and its siblings will be autodetected from + ID registers found in the switch, so only "marvell,mv88e6085" should be + specified. This includes the following list of MV88Exxxx switches: + 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, 6176, + 6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352 + marvell,mv88e6190: This switch uses base address 0x00. + This switch and its siblings will be autodetected from + ID registers found in the switch, so only "marvell,mv88e6190" should be + specified. This includes the following list of MV88Exxxx switches: + 6190, 6190X, 6191, 6290, 6361, 6390, 6390X + marvell,mv88e6250: This switch uses base address 0x08 or 0x18. + This switch and its siblings will be autodetected from + ID registers found in the switch, so only "marvell,mv88e6250" should be + specified. This includes the following list of MV88Exxxx switches: + 6220, 6250 + reg: + maxItems: 1 + + eeprom-length: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Set to the length of an EEPROM connected to the switch. Must be + set if the switch can not detect the presence and/or size of a connected + EEPROM, otherwise optional. + + reset-gpios: + description: + GPIO to be used to reset the whole device + maxItems: 1 + + interrupts: + description: The switch provides an external interrupt line, but it is + not always used by target systems. + maxItems: 1 + + interrupt-controller: + description: The switch has an internal interrupt controller used by + the different sub-blocks. + + '#interrupt-cells': + description: The internal interrupt controller only supports triggering + on IRQ_TYPE_LEVEL_HIGH + # FIXME: what is this? this should be one cell should it not? + # the Linux mv88e6xxx driver does not implement .irq_set_type in its irq_chip + # so at least in that implementation the type is flat out ignored. + const: 2 + + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + description: Marvell MV88E6xxx switches have an internal mdio bus to + access switch ports, which is handled in this node. + + mdio-external: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + description: Marvell MV88E6xxx switches have an external mdio bus to + access switch ports. + + mdio1: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + description: Older version of mdio-external + deprecated: true + properties: + compatible: + const: marvell,mv88e6xxx-mdio-external + + required: + - compatible + +$ref: dsa.yaml# + +patternProperties: + "^(ethernet-)?ports$": + type: object + patternProperties: + "^(ethernet-)?port@[0-9a-f]+$": + type: object + description: Ethernet switch ports + + $ref: dsa-port.yaml# + + unevaluatedProperties: false + +oneOf: + - required: + - ports + - required: + - ethernet-ports + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + #include + #include + mdio { + #address-cells = <1>; + #size-cells = <0>; + + switch0: switch@0 { + compatible = "marvell,mv88e6085"; + reg = <0>; + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio0>; + interrupts = <27 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + port@1 { + reg = <1>; + label = "lan2"; + }; + port@2 { + reg = <2>; + label = "lan3"; + }; + port@3 { + reg = <3>; + label = "lan4"; + }; + port@4 { + reg = <4>; + label = "wan"; + }; + + port@5 { + reg = <5>; + phy-mode = "sgmii"; + ethernet = <ð2>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + switch0phy0: switch0phy@0 { + reg = <0>; + interrupt-parent = <&switch0>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + }; + }; + + - | + #include + #include + mdio { + #address-cells = <1>; + #size-cells = <0>; + + switch1: switch@0 { + compatible = "marvell,mv88e6190"; + reg = <0>; + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio0>; + interrupts = <27 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + port@1 { + reg = <1>; + label = "lan2"; + }; + port@2 { + reg = <2>; + label = "lan3"; + }; + port@3 { + reg = <3>; + label = "lan4"; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + switch1phy0: switch1phy@0 { + reg = <0>; + interrupt-parent = <&switch1>; + interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + + mdio-external { + compatible = "marvell,mv88e6xxx-mdio-external"; + #address-cells = <1>; + #size-cells = <0>; + switch1phy9: switch1phy@9 { + reg = <9>; + }; + }; + }; + }; diff --git a/Documentation/devicetree/bindings/net/dsa/marvell.txt b/Documentation/devicetree/bindings/net/dsa/marvell.txt deleted file mode 100644 index 6ec0c181b6db..000000000000 --- a/Documentation/devicetree/bindings/net/dsa/marvell.txt +++ /dev/null @@ -1,109 +0,0 @@ -Marvell DSA Switch Device Tree Bindings ---------------------------------------- - -WARNING: This binding is currently unstable. Do not program it into a -FLASH never to be changed again. Once this binding is stable, this -warning will be removed. - -If you need a stable binding, use the old dsa.txt binding. - -Marvell Switches are MDIO devices. The following properties should be -placed as a child node of an mdio device. - -The properties described here are those specific to Marvell devices. -Additional required and optional properties can be found in dsa.txt. - -The compatibility string is used only to find an identification register, -which is at a different MDIO base address in different switch families. -- "marvell,mv88e6085" : Switch has base address 0x10. Use with models: - 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, - 6171, 6172, 6175, 6176, 6185, 6240, 6320, 6321, - 6341, 6350, 6351, 6352 -- "marvell,mv88e6190" : Switch has base address 0x00. Use with models: - 6190, 6190X, 6191, 6290, 6361, 6390, 6390X -- "marvell,mv88e6250" : Switch has base address 0x08 or 0x18. Use with model: - 6220, 6250 - -Required properties: -- compatible : Should be one of "marvell,mv88e6085", - "marvell,mv88e6190" or "marvell,mv88e6250" as - indicated above -- reg : Address on the MII bus for the switch. - -Optional properties: - -- reset-gpios : Should be a gpio specifier for a reset line -- interrupts : Interrupt from the switch -- interrupt-controller : Indicates the switch is itself an interrupt - controller. This is used for the PHY interrupts. -#interrupt-cells = <2> : Controller uses two cells, number and flag -- eeprom-length : Set to the length of an EEPROM connected to the - switch. Must be set if the switch can not detect - the presence and/or size of a connected EEPROM, - otherwise optional. -- mdio : Container of PHY and devices on the switches MDIO - bus. -- mdio? : Container of PHYs and devices on the external MDIO - bus. The node must contains a compatible string of - "marvell,mv88e6xxx-mdio-external" - -Example: - - mdio { - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&gpio0>; - interrupts = <27 IRQ_TYPE_LEVEL_LOW>; - interrupt-controller; - #interrupt-cells = <2>; - - switch0: switch@0 { - compatible = "marvell,mv88e6085"; - reg = <0>; - reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - switch1phy0: switch1phy0@0 { - reg = <0>; - interrupt-parent = <&switch0>; - interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; - }; - }; - }; - }; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&gpio0>; - interrupts = <27 IRQ_TYPE_LEVEL_LOW>; - interrupt-controller; - #interrupt-cells = <2>; - - switch0: switch@0 { - compatible = "marvell,mv88e6190"; - reg = <0>; - reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - switch1phy0: switch1phy0@0 { - reg = <0>; - interrupt-parent = <&switch0>; - interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; - }; - }; - - mdio1 { - compatible = "marvell,mv88e6xxx-mdio-external"; - #address-cells = <1>; - #size-cells = <0>; - switch1phy9: switch1phy0@9 { - reg = <9>; - }; - }; - }; - }; diff --git a/MAINTAINERS b/MAINTAINERS index 90f13281d297..1b4475254d27 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12625,7 +12625,7 @@ MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER M: Andrew Lunn L: netdev@vger.kernel.org S: Maintained -F: Documentation/devicetree/bindings/net/dsa/marvell.txt +F: Documentation/devicetree/bindings/net/dsa/marvell,mv88e6xxx.yaml F: Documentation/networking/devlink/mv88e6xxx.rst F: drivers/net/dsa/mv88e6xxx/ F: include/linux/dsa/mv88e6xxx.h From patchwork Thu Oct 12 22:35:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13419938 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 79156CDB482 for ; Thu, 12 Oct 2023 22:36:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mHyogeJTnq9BC5Cv5om5ucTLlS2oyv0VOHJhtcFrXF8=; b=l7T02TvIZELU9q ke3vjByVWpsIu4p0H5RYJa7fVZ1UuKZKALaRdYqDP7bfZa0hwDUKIHV7c6c9Mcc6olO+ZTDBrQNlh c75POzlgU/2gI/CtSxS6XuSfjIM9UsZytGLnLAblRcP14ylMaMnySycmbEB2c4Hub59dY+mY1W0bn YJRBXqquqsNOrGCejmjO/7C4j+CSB/3f3QSbEMRHYFuTC9Z6CPu3QHnuYB5o009od1X+3IHHxGey+ je3tb+YmtDWqI4qyORzBOHiyPoyc4Yp5fUV2Zy9O+Pz0Wh6XCnXQWbAM/k168WbwSP+sGYMLhjYWc +rEde2RE9gPHplpm28OQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qr4HJ-0020rC-39; Thu, 12 Oct 2023 22:35:37 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qr4H8-0020mJ-2L for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 22:35:31 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2bfed7c4e6dso17585621fa.1 for ; Thu, 12 Oct 2023 15:35:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697150124; x=1697754924; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=tqJlehcmenMJKM/lRPSpwuiQHgzEckA+N7fF4C2GzPM=; b=uNQfatIZvDb/J6E908vbc9mtfAHBH9A5wYBaSELnm6LgjcFkaSDv7b/vr7C11Mw0wV LrHyZYnl1sXRZHGNCsz6yU/WipZLSxUUClinK36wlYoKRkkuoYKg12Qhw1FaoFoyR/Nr /O5xwI17jQTR1psmCMsZpuLBPdQaSA7E0Bem6gwdnWIe8IMclsRQ85776ZJGlsiCuCQl 09ouQuiBNAGGSIKCt3Ep4fp7g3Eb+odpT9LduLKL80CSuDF9wqYgG48xSD+M4BQk7HS1 WLF5du0xtpkGGI9m9L7KO1ZnfjtcRB6D/hIrmsty/8RANsa78MbNEmBOs9v3Asd+Jxmf td0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697150124; x=1697754924; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tqJlehcmenMJKM/lRPSpwuiQHgzEckA+N7fF4C2GzPM=; b=SpVO1SM7yIt9oCDvIH3Hzgog72CIBkQQE9x9AspPfpeAMvc+2HGZrRB6Mg//XheKes rJJth3dPtd5OAfRf2kCdLwRL0wn3q3gVbs2PKq+FChGldNA0oMqFR1hbn8I/A4871yBh k3+8pQdo9ObXhbNB6u4RfuOld3mhVBTUX3GinhnFaJaN/qXhy/2hKMx6rdfXgfTmyuvC 48cUU14tRzXxdy5o1Cw32Wu+2aNi1ve19afgLF9I78LLcy+iLfn8Gom44VslO4NZeMj8 bV5YwexZtk6GZxRby/hpIrnmopm6xDYJX6HMDmqagzH2lAEhV3szpQo0B81ae0eGd5xj VFxA== X-Gm-Message-State: AOJu0Yz0WdHv7JYUysA7Ypfan0Uu7ZtYRyOabEVrT3eT0KHT/+X+Dgvz EYtbufOVveVhZ9y9/fsa87+0OQ== X-Google-Smtp-Source: AGHT+IGRG9wyMhGDQ5kQd403PBsws9XNSvk9hZvSX0ryk0Cx//eQH3D87/fY5EPfSQfxBqXMgaBm9w== X-Received: by 2002:a2e:95d5:0:b0:2c0:298d:32df with SMTP id y21-20020a2e95d5000000b002c0298d32dfmr24561108ljh.9.1697150124454; Thu, 12 Oct 2023 15:35:24 -0700 (PDT) Received: from [192.168.1.2] (c-21d3225c.014-348-6c756e10.bbcust.telenor.se. [92.34.211.33]) by smtp.gmail.com with ESMTPSA id x21-20020a05651c105500b002bcb89e92dcsm3811671ljm.6.2023.10.12.15.35.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 15:35:24 -0700 (PDT) From: Linus Walleij Date: Fri, 13 Oct 2023 00:35:16 +0200 Subject: [PATCH 3/3] RFC: net: dsa: mv88e6xxx: Register mdio-external MIME-Version: 1.0 Message-Id: <20231013-marvell-88e6152-wan-led-v1-3-0712ba99857c@linaro.org> References: <20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org> In-Reply-To: <20231013-marvell-88e6152-wan-led-v1-0-0712ba99857c@linaro.org> To: Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Russell King , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Christian Marangi , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231012_153526_782362_FAC0351A X-CRM114-Status: GOOD ( 16.34 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Make it legal to have a subnode just named "mdio-external" and have that be recognized immediately as the external MDIO bus, register it and return. Only fallback to the old method with a compatible in the external bus node if this doesn't work. This is the result of deprecating the old DT method of providing a node "mdio1" with a compatible string. Signed-off-by: Linus Walleij --- drivers/net/dsa/mv88e6xxx/chip.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 52a99d8bada0..05f6776885f6 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -3676,7 +3676,21 @@ static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip) if (err) return err; - /* Walk the device tree, and see if there are any other nodes + /* If the optional external bus is explicitly named as such, + * just register it and be done with this. + */ + child = of_get_child_by_name(np, "mdio-external"); + if (child) { + err = mv88e6xxx_mdio_register(chip, child, true); + of_node_put(child); + if (err) + return err; + return 0; + } + + /* Deprecated binding with compatible: + * + * Walk the device tree, and see if there are any other nodes * which say they are compatible with the external mdio * bus. */