Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp5036875rdb; Sat, 30 Dec 2023 03:28:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHp+ACt179OBExCKiqsl1YDa4rAVQx1lv7N3NDuBzzuZZ8ZNufpcGbIMHnhH3+K9D8HxqQs X-Received: by 2002:a05:6512:203c:b0:50e:85be:e03b with SMTP id s28-20020a056512203c00b0050e85bee03bmr2182528lfs.115.1703935703718; Sat, 30 Dec 2023 03:28:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703935703; cv=none; d=google.com; s=arc-20160816; b=CO5Fr3d0TShhxkrbM+xqSQwytZo8J0V+T3X97G0oENTV6n2696ww3jTu1qIVJmS/kW 1B/co6RFfe/ShoQReTM3Ntcoly8FvUGzpuyvQzZmnJN39qS0QHbDT2aWa0R4/3ZC+eyB fD743aj3UvsNTrK3VWGY3k8cgwJLLbGo4llcRDW/y+cQEJWJQ9mghPL1yGGpi7Fv8ioh zzjyBcIPWJJMHVwk9b1nodJznzA898kUkCEpMOpCby5XjMoulI5TSPGl+4tcoI4oBK0n VTeo7bEZNzIEc/WFvRjduAcKCGmqKjZ7H6EW6YHWnpfaoF1QyB0gmlW8Kaex0+1AjNDw kctg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=85O6LiWePPiFIF6JQGS3gBNdkvVwV11/X/ToIcvymM4=; fh=AR8J9PkpiGPGk+EPpCZalbV0+j6uydswZmIwNkmFKgU=; b=SdNR1p+v6iVYZwu1/qw8Dhtaq1oVP0HV4731c7RZzGtD/+hpaQyO97bhr5zKlVNQMv wzDM57yFIlqF3woynojynnSCfrn4+VaJoxfBUxC3oG0wdUZfSP2B+sRXLPS/5NznsDBq QLt9V7zkNrPeJM7uyzMA+fB+NsguXTf9p5PArqidrpOa4b/4+kFrbnZBc8jGaMjDPRUI 0avV9aac89U/SMooWGbJYynDSupa8fcOmLGhu9B3eZdOzFQTEZieqe4A2pd/FPW97FQP R+TVHaezNVxW5a74ge8A7lHSdCN0Uo3Pew8p7zppMS21nS8J9eaWMoUafc1qrJ+PmGW7 ZF8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mQAoPmrR; spf=pass (google.com: domain of linux-kernel+bounces-13397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id v9-20020a17090606c900b00a1c63cb9e71si8255712ejb.433.2023.12.30.03.28.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 03:28:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=mQAoPmrR; spf=pass (google.com: domain of linux-kernel+bounces-13397-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13397-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5849E1F21952 for ; Sat, 30 Dec 2023 11:28:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25C0179C2; Sat, 30 Dec 2023 11:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mQAoPmrR" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 DA815881F; Sat, 30 Dec 2023 11:28:10 +0000 (UTC) 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 Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-555aa7fd668so1758017a12.0; Sat, 30 Dec 2023 03:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703935689; x=1704540489; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=85O6LiWePPiFIF6JQGS3gBNdkvVwV11/X/ToIcvymM4=; b=mQAoPmrREDvW+GE7hGXkVZr/LX7Jv15pjCmx9ijXqs0CFOsmtmCZlBYX7MFLPTMtKw mOTwzLHYHGYwtXKqc4M/68NL2ROSIekRpCM7WdcsSM4nVE479n9PK1P5523SU4siBP6l oCfThr56k/oQkDNXjpXIBsn4DRpXKPSroSLWBRQ1i68oqG0BPUgYBZtkxS6bv44nTYC7 ctGSz69l8DjjsvcfFDbOJbjzoZJRy3OqGuTCpkB84fQc0+dZ7DCMjXdhOZT2Q2UrmB3D qSjHbiXAvaRITgFUgeGxcyzVTWAyu8oULnHhoD29FCOczL8gqdMeOJpG5nKdSNHW6aqf FIVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703935689; x=1704540489; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=85O6LiWePPiFIF6JQGS3gBNdkvVwV11/X/ToIcvymM4=; b=FgR+ewDFBwU4rC0SjwI8YHc1IohrzyVl8BVbSyREAyAX9oMZWcyE1EdZaaV320wzIx +5AD2Hubn1Fn5d6bwLOvJEDkLxIOyQIzwU+qzgWXOTNVKDAnYQLUKbn/KVhikRPXD6DG m26geBaax/8nvaw3TMcvB7Fi9HJIM1Tgv2vpBsNyFsuXLYq8VpPHBQGXWJ4nIF8+YOCy mcEpn1pTt6N+kpAhi1FEid/jx2ebLGeaBkFB2kONtdHTeq/7YMYJOTnwKDV7nUl+2AKi 2ThABCoQCkAMWFaVNZvFuOXsNuDTXkZF4J+8vYou0OB5G5/ytvFm+mCITIrPf/C1AbH7 8TlQ== X-Gm-Message-State: AOJu0Yz9ggKgYCcykR2Z9iNjFMSe17Y11whyDTjI+f9wIhoL0y9zzPEs zNaLYtZH4tZVlBtXWOP5UsM= X-Received: by 2002:a50:9f8c:0:b0:554:3afd:492c with SMTP id c12-20020a509f8c000000b005543afd492cmr7890236edf.17.1703935688964; Sat, 30 Dec 2023 03:28:08 -0800 (PST) Received: from skbuf ([188.25.255.36]) by smtp.gmail.com with ESMTPSA id o20-20020aa7c7d4000000b0055537e76e94sm5218374eds.57.2023.12.30.03.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Dec 2023 03:28:08 -0800 (PST) Date: Sat, 30 Dec 2023 13:28:06 +0200 From: Vladimir Oltean To: Jagan Teki Cc: Andrew Lunn , Heiner Kallweit , "Andrew F. Davis" , Florian Fainelli , linux-kernel , netdev@vger.kernel.org, Michael Nazzareno Trimarchi , Ioana Ciornei , Shawn Guo , linux-arm-kernel , Fabio Estevam Subject: Re: PHY issue with SJA1105Q/DP84849I Design Message-ID: <20231230112806.o5ia43mu4mo64lea@skbuf> References: <20231222145100.sfcuux7ayxtxgogo@skbuf> <20231226153055.4yihsmu6kiak6hkf@skbuf> <20231229152519.2jxrwaeltp4pxlms@skbuf> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sat, Dec 30, 2023 at 01:48:38AM +0530, Jagan Teki wrote: > On Fri, Dec 29, 2023 at 8:55 PM Vladimir Oltean wrote: > > Why all these combinations? You don't know which switch port is which? > > This is where I get confused in the first place. I didn't find proper > information on binding about how the physical pin-out is to be > configured in DT ports or maybe I didn't understand properly. > > As per schematics. > Pin MII0_RXD0-D3/TXD0-D3 is connected to PROC_MII0_RXD0-D3/TXD0-D3 > this would be fec0. > Pin MII1_RXD0-D3/TXD0-D3 is connected to PHY_MII1_RXD0-D3/TXD0-D3 this > would be ethphy0. > Pin MII2_RXD0-D3/TXD0-D3 is connected to PHY_MII2_RXD0-D3/TXD0-D3 this > would be ethphy1. > Pin MII3_RXD0-D3/TXD0-D3 is grounded > Pin MII4_RXD0-D3/TXD0-D3 is grounded > > So, I did use the above 3 combinations and assumed fec0 is always a > port4 based on existing DTS in the tree. Please let me know which > configuration is proper as per schematic connections. With this switch, any port can be a CPU port. The CPU port selection from existing, unrelated upstream boards has no influence upon yours. The pin naming in "MII0_RXD/TXD" follows the same numbering scheme as "port@0" etc. The SJA1105PQRS.pdf datasheet should tell you as much. So your CPU port should be the "port@0" node and not "port@4". The switch "port@3" and "port@4" sound like they should be the ones with status = "disabled". > > If you are truly using MII, then you should remove the RGMII delay > > properties, and since you are using a 6.1 kernel - hence after kernel > > commit 5d645df99ac6 ("net: dsa: sja1105: determine PHY/MAC role from PHY > > interface type") - you should be using phy-mode = "rev-mii" to put this > > port in MII PHY ("RevMII") mode - to interoperate with the FEC in MII > > MAC mode. > > Okay, I will remove RGMII delay. is phy-mode = "rev-mii" applicable to > all ports or only for fec port4? Use phy-mode = "rev-mii" for the switch port going to the FEC, and phy-mode = "mii" for the switch ports going to MII PHYs (and for the FEC itself). > > You can also use the RX counters to determine which switch port is which > > (but the phy-handle of each port to each PHY needs to be correct). > > RX counters in ethtool you mean? Yes.