devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@seco.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: "Ioana Ciornei" <ioana.ciornei@nxp.com>,
	"Vinod Koul" <vkoul@kernel.org>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	linux-phy@lists.infradead.org,
	"Madalin Bucur" <madalin.bucur@nxp.com>,
	linux-arm-kernel@lists.infradead.org,
	"Camelia Alexandra Groza" <camelia.groza@nxp.com>,
	devicetree@vger.kernel.org, "Rob Herring" <robh+dt@kernel.org>,
	linuxppc-dev@lists.ozlabs.org,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Fernández Rojas" <noltari@gmail.com>,
	"Jonas Gorski" <jonas.gorski@gmail.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Li Yang" <leoyang.li@nxp.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Stephen Boyd" <sboyd@kernel.org>,
	linux-clk@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-gpio@vger.kernel.org
Subject: Re: [PATCH v14 00/15] phy: Add support for Lynx 10G SerDes
Date: Mon, 21 Aug 2023 17:06:46 -0400	[thread overview]
Message-ID: <a66c9abf-5351-62b6-5573-cae38e6768e2@seco.com> (raw)
In-Reply-To: <20230821195823.ns55h3livxgol7fp@skbuf>

On 8/21/23 15:58, Vladimir Oltean wrote:
> On Mon, Aug 21, 2023 at 02:46:53PM -0400, Sean Anderson wrote:
>> After further review, it seems the reason 28g can get away without this
>> is because there's a one-to-one mapping between protocol controllers and
>> lanes. Unfortunately, that regularity is not present for 10g.
>> 
>> --Sean
> 
> There are some things I saw in your phy-fsl-lynx-10g.c driver and device
> tree bindings that I don't understand (the concept of lane groups)

Each lane group corresponds to a phy device (struct phy). For protocols
like PCIe or XAUI which can use multiple lanes, this lets the driver
coordinate configuring all lanes at once in the correct order.

> and
> I'm not sure if they're related with what you're saying here, so if you
> could elaborate a bit more (ideally with an example) on the one-to-one
> mapping and the specific problems it causes, it would be great.

For e.g. the LS2088A, SerDes1 lanes H-A use SG1-8 and XFI1-8. SerDes2
lanes A-H use SG9-16 and XFI9-16. Each lane has its own controller, and
the mapping is 1-to-1. In the PCCRs, each controller uses the same
value, and is mapped in a regular way. So you can go directly from the
lane number to the right value to mask in the PCCR, with a very simple
translation scheme.

For e.g. the LS1046A, SerDes1 lane D uses XFI.9 (aka XFIA) and lane C
uses XFI.10 (aka XFIB). This is the opposite of how SerDes1 lanes A-D
use SGMII.9, .10, .5, and .6 (aka SGMIIA-D).

For e.g. the T4240, SerDes1 lanes A-H use sg1.5, .6, .10, .9, .1, .2,
.3, .4 (aka SGMII E, F, H, G, A, B, C, D).

For e.g. the B4860, SerDes lanes A uses sgmii1 or sgmii5 and B uses
sgmii2 or sgmii6. The MAC selected is determined based on the value
programmed into PCCR2.

While I appreciate that your hardware engineers did a better job for
28g, many 10g serdes arbitrarily map lanes to protocol controllers.
I think the mapping is too irregular to tame, and it is better to say
"if you want this configuration, program this value".

> I may be off with my understanding of the regularity you are talking about,
> but the LX2160 (and Lynx 28G block) also has multi-lane protocols like 40G,
> 100G, assuming that's what you are talking about. I haven't started yet
> working on those for the mtip_backplane driver, but I'm not currently
> seeing a problem with the architecture where a phy_device represents a
> single lane that's part of a multi-lane port, and not an entire group.

Resetting one lane in a group will reset the rest, which could confuse
the driver. Additionally, treating the lanes as one phy lets us set the
reset direction and first lane bits correctly.

> In my imagination, there are 2 cases:
> - all 4 lanes are managed by the single dpaa2-mac consumer (which has 4
>   phandles, and iterates over them with a "for" loop)
> - each of the 4 lanes is managed by the respective backplane AN/LT core,
>   and thus, there's one phandle to each lane

By doing the grouping in the driver, we also simplify the consumer
implementation. The MAC can always use a single phy, without worrying
about the actual number of lanes. This matches the hardware, since the
MAC is going to talk XGMII (or whatever) to the protocol controller
anyway.

I think it will be a lot easier to add multi-lane support with this
method because it gives the driver more information about what's going
on. The driver can control the whole configuration/reset process and the
timing.

> I sketched some dt-bindings for the second case here, so I guess it must
> be the first scenario that's somehow problematic?
> https://cas5-0-urlprotect.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fpatchwork.kernel.org%2fproject%2fnetdevbpf%2fpatch%2f20230817150644.3605105%2d9%2dvladimir.oltean%40nxp.com%2f&umid=9e644233-009e-4197-a266-5d9a85eb1148&auth=d807158c60b7d2502abde8a2fc01f40662980862-cc1d5330d84af8fa40745b165a44849db50f8a67

Yes, no issues with the second case.

--Sean

  reply	other threads:[~2023-08-21 21:07 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 16:05 [PATCH v14 00/15] phy: Add support for Lynx 10G SerDes Sean Anderson
2023-04-13 16:05 ` [PATCH v14 01/15] dt-bindings: phy: Add 2500BASE-X and 10GBASE-R Sean Anderson
2023-04-13 16:05 ` [PATCH v14 02/15] dt-bindings: phy: Add Lynx 10G phy binding Sean Anderson
2023-04-13 16:05 ` [PATCH v14 03/15] dt-bindings: Convert gpio-mmio to yaml Sean Anderson
2023-04-18 20:37   ` Rob Herring
2023-05-11  9:18   ` Bartosz Golaszewski
2023-04-13 16:05 ` [PATCH v14 04/15] dt-bindings: gpio-mmio: Add compatible for QIXIS Sean Anderson
2023-04-13 16:05 ` [PATCH v14 05/15] dt-bindings: clock: Add ids for Lynx 10g PLLs Sean Anderson
2023-04-13 16:05 ` [PATCH v14 06/15] clk: Add Lynx 10G SerDes PLL driver Sean Anderson
2023-05-08  9:15   ` Vinod Koul
2023-05-08 15:31     ` Sean Anderson
2023-05-09 13:00       ` Vinod Koul
2023-05-09 15:26         ` Sean Anderson
2023-05-16 13:22           ` Vinod Koul
2023-05-16 15:11             ` Sean Anderson
2023-05-16 16:32               ` Vinod Koul
2023-04-13 16:05 ` [PATCH v14 07/15] phy: fsl: Add Lynx 10G SerDes driver Sean Anderson
2023-05-08  9:22   ` Vinod Koul
2023-05-08 15:28     ` Sean Anderson
2023-05-16 13:36       ` Vinod Koul
2023-05-16 15:12         ` Sean Anderson
2023-04-13 16:06 ` [PATCH v14 08/15] phy: lynx10g: Enable by default on Layerscape Sean Anderson
2023-04-13 16:06 ` [PATCH v14 09/15] arm64: dts: ls1046a: Add serdes nodes Sean Anderson
2023-04-13 16:06 ` [PATCH v14 10/15] arm64: dts: ls1046ardb: Add serdes descriptions Sean Anderson
2023-04-13 16:06 ` [PATCH v14 11/15] arm64: dts: ls1088a: Add serdes nodes Sean Anderson
2023-04-13 16:06 ` [PATCH v14 12/15] arm64: dts: ls1088a: Prevent PCSs from probing as phys Sean Anderson
2023-04-13 16:06 ` [PATCH v14 13/15] arm64: dts: ls1088ardb: Remove aquantia interrupt Sean Anderson
2023-04-13 16:06 ` [PATCH v14 14/15] arm64: dts: ls1088ardb: Add SFP cage Sean Anderson
2023-04-13 16:06 ` [PATCH v14 15/15] arm64: dts: ls1088ardb: Add serdes descriptions Sean Anderson
2023-04-25 19:50 ` [PATCH v14 00/15] phy: Add support for Lynx 10G SerDes Vladimir Oltean
2023-04-25 20:22   ` Sean Anderson
2023-04-26 10:51     ` Vladimir Oltean
2023-04-26 14:50       ` Sean Anderson
2023-04-29 17:24         ` Vladimir Oltean
2023-05-01 15:03           ` Sean Anderson
2023-05-22 14:42             ` Sean Anderson
2023-05-22 15:00               ` Vladimir Oltean
2023-06-09 19:19                 ` Sean Anderson
2023-06-10 22:21                   ` Vladimir Oltean
2023-06-12 14:35                     ` Sean Anderson
2023-06-12 16:33                       ` Vladimir Oltean
2023-06-12 20:46                         ` Sean Anderson
2023-06-13 14:27                           ` Vladimir Oltean
2023-08-10 10:26                             ` Vladimir Oltean
2023-08-10 19:58                               ` Sean Anderson
2023-08-11 16:12                                 ` Vladimir Oltean
2023-09-13 22:02                                 ` Vladimir Oltean
2023-08-11 15:08                             ` Vladimir Oltean
2023-08-11 15:43                               ` Sean Anderson
2023-08-11 16:36                                 ` Vladimir Oltean
2023-08-21 12:49                                   ` Vladimir Oltean
2023-08-21 17:45                                     ` Sean Anderson
2023-08-21 18:13                                       ` Ioana Ciornei
2023-08-21 18:20                                         ` Vladimir Oltean
2023-08-21 18:46                                         ` Sean Anderson
2023-08-21 19:58                                           ` Vladimir Oltean
2023-08-21 21:06                                             ` Sean Anderson [this message]
2023-08-21 22:48                                               ` Vladimir Oltean
2023-08-21 23:39                                                 ` Sean Anderson
2023-08-21 23:59                                                   ` Vladimir Oltean
2023-08-24 22:09                                                     ` Sean Anderson
2023-08-25 14:43                                                       ` Vladimir Oltean
2023-08-22 14:55                                           ` Ioana Ciornei
2023-08-24 20:54                                             ` Sean Anderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a66c9abf-5351-62b6-5573-cae38e6768e2@seco.com \
    --to=sean.anderson@seco.com \
    --cc=bagasdotme@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=camelia.groza@nxp.com \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=jonas.gorski@gmail.com \
    --cc=kishon@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=leoyang.li@nxp.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@nxp.com \
    --cc=mturquette@baylibre.com \
    --cc=noltari@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).