Message ID | 1707751422-31517-1-git-send-email-michal.vokac@ysoft.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-61904-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp64dyb; Mon, 12 Feb 2024 07:46:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPtBWz0V0A3QRZX4nYLWGVzXrZjC40O6UD8CzOSlLsrz2s6BY9VWhZIRSlDdZ4zH/iCgZe X-Received: by 2002:a05:6a21:8cc9:b0:19e:ca6a:118e with SMTP id ta9-20020a056a218cc900b0019eca6a118emr4095154pzb.36.1707752794894; Mon, 12 Feb 2024 07:46:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707752794; cv=pass; d=google.com; s=arc-20160816; b=j0CIuxGQ2OvxSI2xx8Lk92HPF/tyFIArfHHaJparbkbLcHEXKQcMg5zNsm09YO8QwX sB2PfGwbPIY42K+BPekZlSuBrddERHzKtHAXGN7q31NneztBRJyc0CXl5Ja4RfAW2jUn 5w4DUsIUMxpswAxXYYhPNiUtn6mfqOwegO6FC3HstI8HG3sH2P6227SAAL5HW/Xsf+Jn mbqeXadgaylbeYGtKDyYgZShjHn0kIDqVtEs4ELkoKoEhkAfmsJC5hx3WL5b6DgM1P+k I+118seKFHY3jmSuc27sTByXbE8kik8JVlBIxO99bEhPfn7MC5u7lFXAlwwO9ybpgUxR qDWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=oQZRF4F+VMaG/PnSRd+2qqxRcUHkMwMcRftkyRxLyiU=; fh=aE7NFzQWVlMvyYNVkoBIKHpU/sre5Dgjsowu9nakGCo=; b=bFH907iIor/KEv8Ld2siyRIUVCx3SkJ2Fzv3WyU4w6ylc0/fVgv1qgfPTcXcbgmn8s jgyDGgoAyIDAxfkPXWn/cSerc1CjVpA7N8oK56Uq2WemS0pQyK9VMDhm1b5rs6MDk/+k sVg1BuDGm705lnv8FWxhGqmJnc/4Bq4vOTnAHbdfd0pk65X+R1O220gyK3g659QiCraB wIi2IYh0GMOvx3AS/dKVzuhggJX3wFowRb3ybky1snfUkHsM/Lz0P9U6LPscURZVk0Ws r6V+t6Bv7Apz93dy/E86S3BmfpLg89tv3NblWuAv7b/d7j+hpWDVHSIbK93XiHUucaED V8ZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=QDAPGFOG; arc=pass (i=1 spf=pass spfdomain=ysoft.com dkim=pass dkdomain=ysoft.com dmarc=pass fromdomain=ysoft.com); spf=pass (google.com: domain of linux-kernel+bounces-61904-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61904-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com X-Forwarded-Encrypted: i=2; AJvYcCW0hILEhQdAaQRCv1f066zNW/SOGVZpnkKtgy9h2M3RVU4P0DrMkZ5CzbUnczzdGhZNqcnb8KR1/Ppwk/2+DsUYSWd4qg== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x27-20020a63b21b000000b005dc0e9aefeasi394635pge.809.2024.02.12.07.46.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 07:46:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61904-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=QDAPGFOG; arc=pass (i=1 spf=pass spfdomain=ysoft.com dkim=pass dkdomain=ysoft.com dmarc=pass fromdomain=ysoft.com); spf=pass (google.com: domain of linux-kernel+bounces-61904-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61904-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 17FD0284C3C for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 15:35:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1224E3C48D; Mon, 12 Feb 2024 15:33:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ysoft.com header.i=@ysoft.com header.b="QDAPGFOG" Received: from uho.ysoft.cz (uho.ysoft.cz [81.19.3.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F38E93C486; Mon, 12 Feb 2024 15:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=81.19.3.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707752031; cv=none; b=YBfGKNsW3+KFUxSe9/8K4rjjHthxwKeyE0VTSxVu6Y7XruA7toqxavm20elcjV3ASLRdGmVwbsTJmrkjR9LBHTrFVIusp/O753xEdpcxh3TeeWcBYzCpPVEd8JbjwAHPVrQub+JZm0vDgdBkNDmUY5R+XltVSV0eKnDOYoOjCa0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707752031; c=relaxed/simple; bh=MUhljBiclhV0V2vA5Xv3eSfj8tABtUDPWCxDhu338mY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=eJFKzTeWrlM4KU8nk+8RKrKbNNuR1Lr+t9ojkWfhqF1qkBWm6okKwbNzAmnhMfNnNt7FSSSoF6aL/TWpSe3zzyw2wcZVN7nrzOWP+/AlXZtChqefWXyhje1FgMDj8OUdNuPzLTyH6H7rfAa0RKz73gSBwQY3mHTZNqy8nZtHo1U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ysoft.com; spf=pass smtp.mailfrom=ysoft.com; dkim=pass (1024-bit key) header.d=ysoft.com header.i=@ysoft.com header.b=QDAPGFOG; arc=none smtp.client-ip=81.19.3.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ysoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ysoft.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ysoft.com; s=20160406-ysoft-com; t=1707751453; bh=oQZRF4F+VMaG/PnSRd+2qqxRcUHkMwMcRftkyRxLyiU=; h=From:To:Cc:Subject:Date:From; b=QDAPGFOGUDnlVz3BO72IhRUYgGrnYfQD5uonfWZtkNNE3Uzn73yfp3T0CSLyD/ZIe pxK/ZzJmYyewYaCYddymNprnTvdUF6QsV+IHie3zbpqmdwWjJNUgqs7JZ4mzqCcou9 ujWxwEoMOQC7MmtDASvNymzst1A8hD0cU652TuE8= Received: from iota-build.ysoft.local (unknown [10.1.5.151]) by uho.ysoft.cz (Postfix) with ESMTP id C54E3A05D4; Mon, 12 Feb 2024 16:24:13 +0100 (CET) From: =?utf-8?b?TWljaGFsIFZva8OhxI0=?= <michal.vokac@ysoft.com> To: Shawn Guo <shawnguo@kernel.org>, Fabio Estevam <festevam@gmail.com> Cc: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, NXP Linux Team <linux-imx@nxp.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>, =?utf-8?b?TWljaGFsIFZva8OhxI0=?= <michal.vokac@ysoft.com> Subject: [PATCH 1/2] ARM: dts: imx6dl-yapp4: Fix the QCA switch register address Date: Mon, 12 Feb 2024 16:23:41 +0100 Message-Id: <1707751422-31517-1-git-send-email-michal.vokac@ysoft.com> X-Mailer: git-send-email 2.1.4 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790708594422914888 X-GMAIL-MSGID: 1790708594422914888 |
Series |
[1/2] ARM: dts: imx6dl-yapp4: Fix the QCA switch register address
|
|
Commit Message
Michal Vokáč
Feb. 12, 2024, 3:23 p.m. UTC
The switch address in the node name is in hex while the address in the reg
property is decimal which is wrong. Fix that and write the reg address
as a hexadecimal number.
Fixes: 15b43e497ffd ("ARM: dts: imx6dl-yapp4: Use correct pseudo PHY address for the switch")
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
---
arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Feb 12, 2024 at 04:23:41PM +0100, Michal Vokáč wrote: > The switch address in the node name is in hex while the address in the reg > property is decimal which is wrong. Fix that and write the reg address > as a hexadecimal number. This feels the wrong way around. The reg value is used by the kernel, where as the node name is not. If the reg value was wrong, the switch would not be found. If this file was tested, why did somebody not notice the switch was missing? Do you have the hardware? Can you confirm is really does not work without this patch? Was 15b43e497ffd never actually tested? Thanks Andrew > > Fixes: 15b43e497ffd ("ARM: dts: imx6dl-yapp4: Use correct pseudo PHY address for the switch") > Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com> > --- > arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi > index cfb0fc924b42..5763f8253d51 100644 > --- a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi > +++ b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi > @@ -143,7 +143,7 @@ > > switch@10 { > compatible = "qca,qca8334"; > - reg = <10>; > + reg = <0x10>; > reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; > > switch_ports: ports { > -- > 2.1.4 >
On 12. 02. 24 17:08, Andrew Lunn wrote: > On Mon, Feb 12, 2024 at 04:23:41PM +0100, Michal Vokáč wrote: >> The switch address in the node name is in hex while the address in the reg >> property is decimal which is wrong. Fix that and write the reg address >> as a hexadecimal number. > > This feels the wrong way around. The reg value is used by the kernel, > where as the node name is not. If the reg value was wrong, the switch > would not be found. If this file was tested, why did somebody not > notice the switch was missing? > > Do you have the hardware? Can you confirm is really does not work > without this patch? Was 15b43e497ffd never actually tested? Yes, I have bunch of these boards all around my desk - we manufacture them. I am pretty sure I tested all the patches I have ever sent to the mailing list regarding these boards. The fact is that the switch actually works regardless of the reg value. It worked prior to the 15b43e497ffd commit with address 0, it worked later on with the reg value 10 and it works now with reg value 0x10. While dealing with the broken reset gpio [1] I just noticed that in the 15b43e497ffd commit I made a typo and the node name address value and reg address value differ so I wanted to put that in order. I barely remember that my motivation for creating the 15b43e497ffd commit was that I saw similar change on the mailing list or in the git log for the other boards using the QCA8K switch. So I "fixed" that on our board as well. Now when I was looking for some references I found that there is an other board in mainline with similarly wrong setting: arch/arm/boot/dts/qcom/qcom-ipq8064-rb3011.dts switch1: switch@14 { compatible = "qca,qca8337"; dsa,member = <1 0>; pinctrl-0 = <&sw1_reset_pin>; pinctrl-names = "default"; reset-gpios = <&qcom_pinmux 17 GPIO_ACTIVE_LOW>; reg = <0x10>; I admit that my understanding of the MDIO bus and addressing of the connected external/internal devices is pretty limited. I have no answer to why it works like that but as you brought up your questions I would actually like to know as well. Thank you! Michal +Cc: Jonathan McDowell [1] https://patchwork.kernel.org/project/netdevbpf/patch/1706266175-3408-1-git-send-email-michal.vokac@ysoft.com/
On Tue, Feb 13, 2024 at 01:20:44PM +0100, Michal Vokáč wrote: > On 12. 02. 24 17:08, Andrew Lunn wrote: > > On Mon, Feb 12, 2024 at 04:23:41PM +0100, Michal Vokáč wrote: > > > The switch address in the node name is in hex while the address in the reg > > > property is decimal which is wrong. Fix that and write the reg address > > > as a hexadecimal number. > > > > This feels the wrong way around. The reg value is used by the kernel, > > where as the node name is not. If the reg value was wrong, the switch > > would not be found. If this file was tested, why did somebody not > > notice the switch was missing? > > > > Do you have the hardware? Can you confirm is really does not work > > without this patch? Was 15b43e497ffd never actually tested? > Yes, I have bunch of these boards all around my desk - we manufacture > them. I am pretty sure I tested all the patches I have ever sent to > the mailing list regarding these boards. > > The fact is that the switch actually works regardless of the reg value. > It worked prior to the 15b43e497ffd commit with address 0, it worked > later on with the reg value 10 and it works now with reg value 0x10. Ah, so that is the missing piece of information from the commit message. That the reg value does not actually matter. Hence it is safe to change it. Please reword the commit message. > I admit that my understanding of the MDIO bus and addressing of > the connected external/internal devices is pretty limited. I have no > answer to why it works like that but as you brought up your questions > I would actually like to know as well. My guess is, the switch assumes it has full access to all the addresses on the bus. It probably uses a subset, but that subset is hard coded. But the MDIO DT binding requires a valid reg value, so something has to be used. There are some devices which use a single address on the bus. The mv88e6xxx can be strapped into such a mode, so you can have multiple switches on the bus. The reg value is then used. But you can also strap it so it takes over the whole bus, and uses #num_ports + 3 addresses on the bus, and those addresses are hard coded in the silicon, so the reg value is ignored. Andrew --- pw-bot: cr
On 13. 02. 24 14:10, Andrew Lunn wrote: > On Tue, Feb 13, 2024 at 01:20:44PM +0100, Michal Vokáč wrote: >> On 12. 02. 24 17:08, Andrew Lunn wrote: >>> On Mon, Feb 12, 2024 at 04:23:41PM +0100, Michal Vokáč wrote: >> The fact is that the switch actually works regardless of the reg value. >> It worked prior to the 15b43e497ffd commit with address 0, it worked >> later on with the reg value 10 and it works now with reg value 0x10. > > Ah, so that is the missing piece of information from the commit > message. That the reg value does not actually matter. Hence it is safe > to change it. > > Please reword the commit message. OK, I will do so. >> I admit that my understanding of the MDIO bus and addressing of >> the connected external/internal devices is pretty limited. I have no >> answer to why it works like that but as you brought up your questions >> I would actually like to know as well. > > My guess is, the switch assumes it has full access to all the > addresses on the bus. It probably uses a subset, but that subset is > hard coded. But the MDIO DT binding requires a valid reg value, so > something has to be used. That makes sense. The problem is that the MDIO access and addressing of the QCA8K switch is not well documented in the datasheet. > There are some devices which use a single address on the bus. The > mv88e6xxx can be strapped into such a mode, so you can have multiple > switches on the bus. The reg value is then used. But you can also > strap it so it takes over the whole bus, and uses #num_ports + 3 > addresses on the bus, and those addresses are hard coded in the > silicon, so the reg value is ignored. Ah, yes I am actually aware of that feature on the mv88e6xxx. We use it on newer board revisions. AFAIK the switch is by default strapped to the single chip addressing mode by internal pull-ups. Thank you very much for shedding some light to that topic! Michal
diff --git a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi index cfb0fc924b42..5763f8253d51 100644 --- a/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi +++ b/arch/arm/boot/dts/nxp/imx/imx6dl-yapp4-common.dtsi @@ -143,7 +143,7 @@ switch@10 { compatible = "qca,qca8334"; - reg = <10>; + reg = <0x10>; reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>; switch_ports: ports {