linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ansuel Smith <ansuelsmth@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Rob Herring <robh+dt@kernel.org>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Russell King <linux@armlinux.org.uk>,
	John Crispin <john@phrozen.org>,
	Ansuel Smith <ansuelsmth@gmail.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: [net-next PATCH v6 00/16] Multiple improvement for qca8337 switch
Date: Wed, 13 Oct 2021 03:16:06 +0200	[thread overview]
Message-ID: <20211013011622.10537-1-ansuelsmth@gmail.com> (raw)

This series is the final step of a long process of porting 80+ devices
to use the new qca8k driver instead of the hacky qca one based on never
merged swconfig platform.
Some background to justify all these additions.
QCA used a special binding to declare raw initval to set the swich. I
made a script to convert all these magic values and convert 80+ dts and
scan all the needed "unsupported regs". We find a baseline where we
manage to find the common and used regs so in theory hopefully we don't
have to add anymore things.
We discovered lots of things with this, especially about how differently
qca8327 works compared to qca8337.

In short, we found that qca8327 have some problem with suspend/resume for
their internal phy. It instead sets some dedicated regs that suspend the
phy without setting the standard bit. First 4 patch are to fix this.
There is also a patch about preferring master. This is directly from the
original driver and it seems to be needed to prevent some problem with
the pause frame.

Every ipq806x target sets the mac power sel and this specific reg
regulates the output voltage of the regulator. Without this some
instability can occur.

Some configuration (for some reason) swap mac6 with mac0. We add support
for this.
Also, we discovered that some device doesn't work at all with pll enabled
for sgmii line. In the original code this was based on the switch
revision. In later revision the pll regs were decided based on the switch
type (disabled for qca8327 and enabled for qca8337) but still some
device had that disabled in the initval regs.
Considering we found at least one qca8337 device that required pll
disabled to work (no traffic problem) we decided to introduce a binding
to enable pll and set it only with that.

Lastly, we add support for led open drain that require the power-on-sel
to set. Also, some device have only the power-on-sel set in the initval
so we add also support for that. This is needed for the correct function
of the switch leds.
Qca8327 have a special reg in the pws regs that set it to a reduced
48pin layout. This is needed or the switch doesn't work.

These are all the special configuration we find on all these devices that
are from various targets. Mostly ath79, ipq806x and bcm53xx.

Changes v6:
- Convert Documentation to yaml
- Add extra check for cpu port and invalid phy mode
- Add co developed by tag to give credits to Matthew

Changes v5:
- Swap patch. Document first then implement.
- Fix some grammar error reported.
- Rework function. Remove phylink mac_config DT scan and move everything
  to dedicated function in probe.
- Introduce new logic for delay selection where is also supported with
  internal delay declared and rgmii set as phy mode
- Start working on ymal conversion. Will later post this in v6 when we
  finally take final decision about mac swap.

Changes v4:
- Fix typo in SGMII falling edge about using PHY id instead of
  switch id

Changes v3:
- Drop phy patches (proposed separateley)
- Drop special pwr binding. Rework to ipq806x specific
- Better describe compatible and add serial print on switch chip
- Drop mac exchange. Rework falling edge and move it to mac_config
- Add support for port 6 cpu port. Drop hardcoded cpu port to port0
- Improve port stability with sgmii. QCA source have intenal delay also
  for sgmii
- Add warning with pll enabled on wrong configuration

Changes v2:
- Reword Documentation patch to dt-bindings
- Propose first 2 phy patch to net
- Better describe and add hint on how to use all the new
  bindings 
- Rework delay scan function and move to phylink mac_config
- Drop package48 wrong binding
- Introduce support for qca8328 switch
- Fix wrong binding name power-on-sel
- Return error on wrong config with led open drain and 
  ignore-power-on-sel not set

Ansuel Smith (15):
  dsa: qca8k: add mac_power_sel support
  dt-bindings: net: dsa: qca8k: Add SGMII clock phase properties
  net: dsa: qca8k: add support for sgmii falling edge
  dt-bindings: net: dsa: qca8k: Document support for CPU port 6
  net: dsa: qca8k: add support for cpu port 6
  net: dsa: qca8k: rework rgmii delay logic and scan for cpu port 6
  dt-bindings: net: dsa: qca8k: Document qca,sgmii-enable-pll
  net: dsa: qca8k: add explicit SGMII PLL enable
  dt-bindings: net: dsa: qca8k: Document qca,led-open-drain binding
  net: dsa: qca8k: add support for pws config reg
  dt-bindings: net: dsa: qca8k: document support for qca8328
  net: dsa: qca8k: add support for QCA8328
  net: dsa: qca8k: set internal delay also for sgmii
  net: dsa: qca8k: move port config to dedicated struct
  dt-bindings: net: ipq8064-mdio: fix warning with new qca8k switch

Matthew Hagan (1):
  dt-bindings: net: dsa: qca8k: convert to YAML schema

 .../devicetree/bindings/net/dsa/qca8k.txt     | 215 -----------
 .../devicetree/bindings/net/dsa/qca8k.yaml    | 362 +++++++++++++++++
 .../bindings/net/qcom,ipq8064-mdio.yaml       |   5 +-
 drivers/net/dsa/qca8k.c                       | 364 ++++++++++++++----
 drivers/net/dsa/qca8k.h                       |  35 +-
 5 files changed, 685 insertions(+), 296 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/net/dsa/qca8k.txt
 create mode 100644 Documentation/devicetree/bindings/net/dsa/qca8k.yaml

-- 
2.32.0


             reply	other threads:[~2021-10-13  1:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-13  1:16 Ansuel Smith [this message]
2021-10-13  1:16 ` [net-next PATCH v6 01/16] dsa: qca8k: add mac_power_sel support Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 02/16] dt-bindings: net: dsa: qca8k: Add SGMII clock phase properties Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 03/16] net: dsa: qca8k: add support for sgmii falling edge Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 04/16] dt-bindings: net: dsa: qca8k: Document support for CPU port 6 Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 05/16] net: dsa: qca8k: add support for cpu " Ansuel Smith
2021-10-13  4:10   ` DENG Qingfang
2021-10-13 11:42     ` Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 06/16] net: dsa: qca8k: rework rgmii delay logic and scan " Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 07/16] dt-bindings: net: dsa: qca8k: Document qca,sgmii-enable-pll Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 08/16] net: dsa: qca8k: add explicit SGMII PLL enable Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 09/16] dt-bindings: net: dsa: qca8k: Document qca,led-open-drain binding Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 10/16] net: dsa: qca8k: add support for pws config reg Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 11/16] dt-bindings: net: dsa: qca8k: document support for qca8328 Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 12/16] net: dsa: qca8k: add support for QCA8328 Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 13/16] net: dsa: qca8k: set internal delay also for sgmii Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 14/16] net: dsa: qca8k: move port config to dedicated struct Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 15/16] dt-bindings: net: dsa: qca8k: convert to YAML schema Ansuel Smith
2021-10-13  3:08   ` Rob Herring
2021-10-13 10:30     ` Ansuel Smith
2021-10-13  1:16 ` [net-next PATCH v6 16/16] dt-bindings: net: ipq8064-mdio: fix warning with new qca8k switch Ansuel Smith

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=20211013011622.10537-1-ansuelsmth@gmail.com \
    --to=ansuelsmth@gmail.com \
    --cc=agross@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=bjorn.andersson@linaro.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=vivien.didelot@gmail.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).