Skip to content
Permalink
Alvin-ipraga/n…
Switch branches/tags

Commits on Oct 15, 2021

  1. net: phy: realtek: add support for RTL8365MB-VC internal PHYs

    The RTL8365MB-VC ethernet switch controller has 4 internal PHYs for its
    user-facing ports. All that is needed is to let the PHY driver core
    pick up the IRQ made available by the switch driver.
    
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  2. net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC

    This patch adds a realtek-smi subdriver for the RTL8365MB-VC 4+1 port
    10/100/1000M switch controller. The driver has been developed based on a
    GPL-licensed OS-agnostic Realtek vendor driver known as rtl8367c found
    in the OpenWrt source tree.
    
    Despite the name, the RTL8365MB-VC has an entirely different register
    layout to the already-supported RTL8366RB ASIC. Notwithstanding this,
    the structure of the rtl8365mb subdriver is loosely based on the rtl8366rb
    subdriver. Like the 'rb, it establishes its own irqchip to handle
    cascaded PHY link status interrupts.
    
    The RTL8365MB-VC switch is capable of offloading a large number of
    features from the software, but this patch introduces only the most
    basic DSA driver functionality. The ports always function as standalone
    ports, with bridging handled in software.
    
    One more thing. Realtek's nomenclature for switches makes it hard to
    know exactly what other ASICs might be supported by this driver. The
    vendor driver goes by the name rtl8367c, but as far as I can tell, no
    chip actually exists under this name. As such, the subdriver is named
    rtl8365mb to emphasize the potentially limited support. But it is clear
    from the vendor sources that a number of other more advanced switches
    share a similar register layout, and further support should not be too
    hard to add given access to the relevant hardware. With this in mind,
    the subdriver has been written with as few assumptions about the
    particular chip as is reasonable. But the RTL8365MB-VC is the only
    hardware I have available, so some further work is surely needed.
    
    Co-developed-by: Michael Rasmussen <mir@bang-olufsen.dk>
    Signed-off-by: Michael Rasmussen <mir@bang-olufsen.dk>
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  3. net: dsa: tag_rtl8_4: add realtek 8 byte protocol 4 tag

    This commit implements a basic version of the 8 byte tag protocol used
    in the Realtek RTL8365MB-VC unmanaged switch, which carries with it a
    protocol version of 0x04.
    
    The implementation itself only handles the parsing of the EtherType
    value and Realtek protocol version, together with the source or
    destination port fields. The rest is left unimplemented for now.
    
    The tag format is described in a confidential document provided to my
    company by Realtek Semiconductor Corp. Permission has been granted by
    the vendor to publish this driver based on that material, together with
    an extract from the document describing the tag format and its fields.
    It is hoped that this will help future implementors who do not have
    access to the material but who wish to extend the functionality of
    drivers for chips which use this protocol.
    
    In addition, two possible values of the REASON field are specified,
    based on experiments on my end. Realtek does not specify what value this
    field can take.
    
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  4. dt-bindings: net: dsa: realtek-smi: document new compatible rtl8365mb

    rtl8365mb is a new realtek-smi subdriver for the RTL8365MB-VC 4+1 port
    10/100/1000M Ethernet switch controller. Its compatible string is
    "realtek,rtl8365mb".
    
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Acked-by: Rob Herring <robh@kernel.org>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  5. net: dsa: move NET_DSA_TAG_RTL4_A to right place in Kconfig/Makefile

    Move things around a little so that this tag driver is alphabetically
    ordered. The Kconfig file is sorted based on the tristate text.
    
    Suggested-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  6. net: dsa: allow reporting of standard ethtool stats for slave devices

    Jakub pointed out that we have a new ethtool API for reporting device
    statistics in a standardized way, via .get_eth_{phy,mac,ctrl}_stats.
    Add a small amount of plumbing to allow DSA drivers to take advantage of
    this when exposing statistics.
    
    Suggested-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  7. ether: add EtherType for proprietary Realtek protocols

    Add a new EtherType ETH_P_REALTEK to the if_ether.h uapi header. The
    EtherType 0x8899 is used in a number of different protocols from Realtek
    Semiconductor Corp [1], so no general assumptions should be made when
    trying to decode such packets. Observed protocols include:
    
      0x1 - Realtek Remote Control protocol [2]
      0x2 - Echo protocol [2]
      0x3 - Loop detection protocol [2]
      0x4 - RTL8365MB 4- and 8-byte switch CPU tag protocols [3]
      0x9 - RTL8306 switch CPU tag protocol [4]
      0xA - RTL8366RB switch CPU tag protocol [4]
    
    [1] https://lore.kernel.org/netdev/CACRpkdYQthFgjwVzHyK3DeYUOdcYyWmdjDPG=Rf9B3VrJ12Rzg@mail.gmail.com/
    [2] https://www.wireshark.org/lists/ethereal-dev/200409/msg00090.html
    [3] https://lore.kernel.org/netdev/20210822193145.1312668-4-alvin@pqrs.dk/
    [4] https://lore.kernel.org/netdev/20200708122537.1341307-2-linus.walleij@linaro.org/
    
    Suggested-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Alvin Šipraga <alsi@bang-olufsen.dk>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    sipraga authored and intel-lab-lkp committed Oct 15, 2021
  8. Merge branch 'dpaa2-irq-coalescing'

    Ioana Ciornei says:
    
    ====================
    dpaa2-eth: add support for IRQ coalescing
    
    This patch set adds support for interrupts coalescing in dpaa2-eth.
    The first patches add support for the hardware level configuration of
    the IRQ coalescing in the dpio driver, while the ones that touch the
    dpaa2-eth driver are responsible for the ethtool user interraction.
    
    With the adaptive IRQ coalescing in place and enabled we have observed
    the following changes in interrupt rates on one A72 core @2.2GHz
    (LX2160A) while running a Rx TCP flow.  The TCP stream is sent on a
    10Gbit link and the only cpu that does Rx is fully utilized.
                                    IRQ rate (irqs / sec)
    before:   4.59 Gbits/sec                24k
    after:    5.67 Gbits/sec                1.3k
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Oct 15, 2021
  9. net: dpaa2: add adaptive interrupt coalescing

    Add support for adaptive interrupt coalescing to the dpaa2-eth driver.
    First of all, ETHTOOL_COALESCE_USE_ADAPTIVE_RX is defined as a supported
    coalesce parameter and the requested state is configured through the
    dpio APIs added in the previous patch.
    
    Besides the ethtool API interaction, we keep track of how many bytes and
    frames are dequeued per CDAN (Channel Data Availability Notification)
    and update the Net DIM instance through the dpaa2_io_update_net_dim()
    API.
    
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Oct 15, 2021
  10. soc: fsl: dpio: add Net DIM integration

    Use the generic dynamic interrupt moderation (dim) framework to
    implement adaptive interrupt coalescing on Rx. With the per-packet
    interrupt scheme, a high interrupt rate has been noted for moderate
    traffic flows leading to high CPU utilization.
    
    The dpio driver exports new functions to enable/disable adaptive IRQ
    coalescing on a DPIO object, to query the state or to update Net DIM
    with a new set of bytes and frames dequeued.
    
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Oct 15, 2021
  11. net: dpaa2: add support for manual setup of IRQ coalesing

    Use the newly exported dpio driver API to manually configure the IRQ
    coalescing parameters requested by the user.
    The .get_coalesce() and .set_coalesce() net_device callbacks are
    implemented and directly export or setup the rx-usecs on all the
    channels configured.
    
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Oct 15, 2021
  12. soc: fsl: dpio: add support for irq coalescing per software portal

    In DPAA2 based SoCs, the IRQ coalesing support per software portal has 2
    configurable parameters:
     - the IRQ timeout period (QBMAN_CINH_SWP_ITPR): how many 256 QBMAN
       cycles need to pass until a dequeue interrupt is asserted.
     - the IRQ threshold (QBMAN_CINH_SWP_DQRR_ITR): how many dequeue
       responses in the DQRR ring would generate an IRQ.
    
    Add support for setting up and querying these IRQ coalescing related
    parameters.
    
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Oct 15, 2021
  13. soc: fsl: dpio: extract the QBMAN clock frequency from the attributes

    Through the dpio_get_attributes() firmware call the dpio driver has
    access to the QBMAN clock frequency. Extend the structure which holds
    the firmware's response so that we can have access to this information.
    
    This will be needed in the next patches which also add support for
    interrupt coalescing which needs to be configured based on the
    frequency.
    
    Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    IoanaCiornei authored and davem330 committed Oct 15, 2021
  14. Merge branch 'L4S-style-ce_threshold_ect1-marking'

    Eric Dumazet says:
    
    ====================
    net/sched: implement L4S style ce_threshold_ect1 marking
    
    As suggested by Ingemar Johansson, Neal Cardwell, and others, fq_codel can be used
    for Low Latency, Low Loss, Scalable Throughput (L4S) with a small change.
    
    In ce_threshold_ect1 mode, only ECT(1) packets can be marked to CE if
    their sojourn time is above the threshold.
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Oct 15, 2021
  15. fq_codel: implement L4S style ce_threshold_ect1 marking

    Add TCA_FQ_CODEL_CE_THRESHOLD_ECT1 boolean option to select Low Latency,
    Low Loss, Scalable Throughput (L4S) style marking, along with ce_threshold.
    
    If enabled, only packets with ECT(1) can be transformed to CE
    if their sojourn time is above the ce_threshold.
    
    Note that this new option does not change rules for codel law.
    In particular, if TCA_FQ_CODEL_ECN is left enabled (this is
    the default when fq_codel qdisc is created), ECT(0) packets can
    still get CE if codel law (as governed by limit/target) decides so.
    
    Section 4.3.b of current draft [1] states:
    
    b.  A scheduler with per-flow queues such as FQ-CoDel or FQ-PIE can
        be used for L4S.  For instance within each queue of an FQ-CoDel
        system, as well as a CoDel AQM, there is typically also ECN
        marking at an immediate (unsmoothed) shallow threshold to support
        use in data centres (see Sec.5.2.7 of [RFC8290]).  This can be
        modified so that the shallow threshold is solely applied to
        ECT(1) packets.  Then if there is a flow of non-ECN or ECT(0)
        packets in the per-flow-queue, the Classic AQM (e.g.  CoDel) is
        applied; while if there is a flow of ECT(1) packets in the queue,
        the shallower (typically sub-millisecond) threshold is applied.
    
    Tested:
    
    tc qd replace dev eth1 root fq_codel ce_threshold_ect1 50usec
    
    netperf ... -t TCP_STREAM -- K dctcp
    
    tc -s -d qd sh dev eth1
    qdisc fq_codel 8022: root refcnt 32 limit 10240p flows 1024 quantum 9212 target 5ms ce_threshold_ect1 49us interval 100ms memory_limit 32Mb ecn drop_batch 64
     Sent 14388596616 bytes 9543449 pkt (dropped 0, overlimits 0 requeues 152013)
     backlog 0b 0p requeues 152013
      maxpacket 68130 drop_overlimit 0 new_flow_count 95678 ecn_mark 0 ce_mark 7639
      new_flows_len 0 old_flows_len 0
    
    [1] L4S current draft:
    https://datatracker.ietf.org/doc/html/draft-ietf-tsvwg-l4s-arch
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Neal Cardwell <ncardwell@google.com>
    Cc: Ingemar Johansson S <ingemar.s.johansson@ericsson.com>
    Cc: Tom Henderson <tomh@tomh.org>
    Cc: Bob Briscoe <in@bobbriscoe.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    neebe000 authored and davem330 committed Oct 15, 2021
  16. net: add skb_get_dsfield() helper

    skb_get_dsfield(skb) gets dsfield from skb, or -1
    if an error was found.
    
    This is basically a wrapper around ipv4_get_dsfield()
    and ipv6_get_dsfield().
    
    Used by following patch for fq_codel.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Neal Cardwell <ncardwell@google.com>
    Cc: Ingemar Johansson S <ingemar.s.johansson@ericsson.com>
    Cc: Tom Henderson <tomh@tomh.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    neebe000 authored and davem330 committed Oct 15, 2021
  17. tcp: switch orphan_count to bare per-cpu counters

    Use of percpu_counter structure to track count of orphaned
    sockets is causing problems on modern hosts with 256 cpus
    or more.
    
    Stefan Bach reported a serious spinlock contention in real workloads,
    that I was able to reproduce with a netfilter rule dropping
    incoming FIN packets.
    
        53.56%  server  [kernel.kallsyms]      [k] queued_spin_lock_slowpath
                |
                ---queued_spin_lock_slowpath
                   |
                    --53.51%--_raw_spin_lock_irqsave
                              |
                               --53.51%--__percpu_counter_sum
                                         tcp_check_oom
                                         |
                                         |--39.03%--__tcp_close
                                         |          tcp_close
                                         |          inet_release
                                         |          inet6_release
                                         |          sock_close
                                         |          __fput
                                         |          ____fput
                                         |          task_work_run
                                         |          exit_to_usermode_loop
                                         |          do_syscall_64
                                         |          entry_SYSCALL_64_after_hwframe
                                         |          __GI___libc_close
                                         |
                                          --14.48%--tcp_out_of_resources
                                                    tcp_write_timeout
                                                    tcp_retransmit_timer
                                                    tcp_write_timer_handler
                                                    tcp_write_timer
                                                    call_timer_fn
                                                    expire_timers
                                                    __run_timers
                                                    run_timer_softirq
                                                    __softirqentry_text_start
    
    As explained in commit cf86a08 ("net/dst: use a smaller percpu_counter
    batch for dst entries accounting"), default batch size is too big
    for the default value of tcp_max_orphans (262144).
    
    But even if we reduce batch sizes, there would still be cases
    where the estimated count of orphans is beyond the limit,
    and where tcp_too_many_orphans() has to call the expensive
    percpu_counter_sum_positive().
    
    One solution is to use plain per-cpu counters, and have
    a timer to periodically refresh this cache.
    
    Updating this cache every 100ms seems about right, tcp pressure
    state is not radically changing over shorter periods.
    
    percpu_counter was nice 15 years ago while hosts had less
    than 16 cpus, not anymore by current standards.
    
    v2: Fix the build issue for CONFIG_CRYPTO_DEV_CHELSIO_TLS=m,
        reported by kernel test robot <lkp@intel.com>
        Remove unused socket argument from tcp_too_many_orphans()
    
    Fixes: dd24c00 ("net: Use a percpu_counter for orphan_count")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: Stefan Bach <sfb@google.com>
    Cc: Neal Cardwell <ncardwell@google.com>
    Acked-by: Neal Cardwell <ncardwell@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    neebe000 authored and davem330 committed Oct 15, 2021
  18. mctp: Avoid leak of mctp_sk_key

    mctp_key_alloc() returns a key already referenced.
    
    The mctp_route_input() path receives a packet for a bind socket and
    allocates a key. It passes the key to mctp_key_add() which takes a
    refcount and adds the key to lists. mctp_route_input() should then
    release its own refcount when setting the key pointer to NULL.
    
    In the mctp_alloc_local_tag() path (for mctp_local_output()) we
    similarly need to unref the key before returning (mctp_reserve_tag()
    takes a refcount and adds the key to lists).
    
    Fixes: 73c6184 ("mctp: locking, lifetime and validity changes for sk_keys")
    Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
    Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    mkj authored and davem330 committed Oct 15, 2021
  19. Merge branch 'qca8337-improvements'

    Ansuel Smith says:
    
    ====================
    Multiple improvement for qca8337 switch
    
    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 v7:
    - Fix missing newline in yaml
    - Handle error with wrong cpu port detected
    - Move yaml commit as last to fix bot error
    
    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
    ====================
    
    Signed-off-by: David S. Miller <davem@davemloft.net>
    davem330 committed Oct 15, 2021
  20. dt-bindings: net: dsa: qca8k: convert to YAML schema

    Convert the qca8k bindings to YAML format.
    
    Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
    Co-developed-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    clayface authored and davem330 committed Oct 15, 2021
  21. dt-bindings: net: ipq8064-mdio: fix warning with new qca8k switch

    Fix warning now that we have qca8k switch Documentation using yaml.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  22. net: dsa: qca8k: move port config to dedicated struct

    Move ports related config to dedicated struct to keep things organized.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  23. net: dsa: qca8k: set internal delay also for sgmii

    QCA original code report port instability and sa that SGMII also require
    to set internal delay. Generalize the rgmii delay function and apply the
    advised value if they are not defined in DT.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  24. net: dsa: qca8k: add support for QCA8328

    QCA8328 switch is the bigger brother of the qca8327. Same regs different
    chip. Change the function to set the correct pin layout and introduce a
    new match_data to differentiate the 2 switch as they have the same ID
    and their internal PHY have the same ID.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  25. dt-bindings: net: dsa: qca8k: document support for qca8328

    QCA8328 is the bigger brother of qca8327. Document the new compatible
    binding and add some information to understand the various switch
    compatible.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  26. net: dsa: qca8k: add support for pws config reg

    Some qca8327 switch require to force the ignore of power on sel
    strapping. Some switch require to set the led open drain mode in regs
    instead of using strapping. While most of the device implements this
    using the correct way using pin strapping, there are still some broken
    device that require to be set using sw regs.
    Introduce a new binding and support these special configuration.
    As led open drain require to ignore pin strapping to work, the probe
    fails with EINVAL error with incorrect configuration.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  27. dt-bindings: net: dsa: qca8k: Document qca,led-open-drain binding

    Document new binding qca,ignore-power-on-sel used to ignore
    power on strapping and use sw regs instead.
    Document qca,led-open.drain to set led to open drain mode, the
    qca,ignore-power-on-sel is mandatory with this enabled or an error will
    be reported.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  28. net: dsa: qca8k: add explicit SGMII PLL enable

    Support enabling PLL on the SGMII CPU port. Some device require this
    special configuration or no traffic is transmitted and the switch
    doesn't work at all. A dedicated binding is added to the CPU node
    port to apply the correct reg on mac config.
    Fail to correctly configure sgmii with qca8327 switch and warn if pll is
    used on qca8337 with a revision greater than 1.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  29. dt-bindings: net: dsa: qca8k: Document qca,sgmii-enable-pll

    Document qca,sgmii-enable-pll binding used in the CPU nodes to
    enable SGMII PLL on MAC config.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  30. net: dsa: qca8k: rework rgmii delay logic and scan for cpu port 6

    Future proof commit. This switch have 2 CPU ports and one valid
    configuration is first CPU port set to sgmii and second CPU port set to
    rgmii-id. The current implementation detects delay only for CPU port
    zero set to rgmii and doesn't count any delay set in a secondary CPU
    port. Drop the current delay scan function and move it to the sgmii
    parser function to generalize and implicitly add support for secondary
    CPU port set to rgmii-id. Introduce new logic where delay is enabled
    also with internal delay binding declared and rgmii set as PHY mode.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  31. net: dsa: qca8k: add support for cpu port 6

    Currently CPU port is always hardcoded to port 0. This switch have 2 CPU
    ports. The original intention of this driver seems to be use the
    mac06_exchange bit to swap MAC0 with MAC6 in the strange configuration
    where device have connected only the CPU port 6. To skip the
    introduction of a new binding, rework the driver to address the
    secondary CPU port as primary and drop any reference of hardcoded port.
    With configuration of mac06 exchange, just skip the definition of port0
    and define the CPU port as a secondary. The driver will autoconfigure
    the switch to use that as the primary CPU port.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  32. dt-bindings: net: dsa: qca8k: Document support for CPU port 6

    The switch now support CPU port to be set 6 instead of be hardcoded to
    0. Document support for it and describe logic selection.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  33. net: dsa: qca8k: add support for sgmii falling edge

    Add support for this in the qca8k driver. Also add support for SGMII
    rx/tx clock falling edge. This is only present for pad0, pad5 and
    pad6 have these bit reserved from Documentation. Add a comment that this
    is hardcoded to PAD0 as qca8327/28/34/37 have an unique sgmii line and
    setting falling in port0 applies to both configuration with sgmii used
    for port0 or port6.
    
    Co-developed-by: Matthew Hagan <mnhagan88@gmail.com>
    Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  34. dt-bindings: net: dsa: qca8k: Add SGMII clock phase properties

    Add names and descriptions of additional PORT0_PAD_CTRL properties.
    qca,sgmii-(rx|tx)clk-falling-edge are for setting the respective clock
    phase to failling edge.
    
    Co-developed-by: Matthew Hagan <mnhagan88@gmail.com>
    Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
  35. dsa: qca8k: add mac_power_sel support

    Add missing mac power sel support needed for ipq8064/5 SoC that require
    1.8v for the internal regulator port instead of the default 1.5v.
    If other device needs this, consider adding a dedicated binding to
    support this.
    
    Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
    Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
    Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Ansuel authored and davem330 committed Oct 15, 2021
Older