10 Mar, 2020

3 commits

  • The helper is used to reset PHYs on connect and it determines the clause
    to use (C22/C45) based on interface type. This fixes 'PHY reset timed out'
    warnings in console for USXGMII/XFI PHYs.

    Signed-off-by: Alex Marginean
    Acked-by: Joe Hershberger

    Alex Marginean
     
  • Add NC-SI to the usual phy handling. This makes two notable changes:
    - Somewhat similar to a fixed phy, phy_connect() will create an NC-SI
    phy if CONFIG_PHY_NCSI is defined.
    - An early return is added to phy_read() and phy_write() to handle a
    case like the NC-SI phy which does not define a bus.

    Signed-off-by: Samuel Mendoza-Jonas
    Reviewed-by: Joel Stanley
    Acked-by: Joe Hershberger

    Samuel Mendoza-Jonas
     
  • This introduces support for the NC-SI protocol, modelled as a phy driver
    for other ethernet drivers to consume.

    NC-SI (Network Controller Sideband Interface) is a protocol to manage a
    sideband connection to a proper network interface, for example a BMC
    (Baseboard Management Controller) sharing the NIC of the host system.
    Probing and configuration occurs by communicating with the "remote" NIC
    via NC-SI control frames (Ethernet header 0x88f8).

    This implementation is roughly based on the upstream Linux
    implementation[0], with a reduced feature set and an emphasis on getting
    a link up as fast as possible rather than probing the full possible
    topology of the bus.
    The current phy model relies on the network being "up", sending NC-SI
    command frames via net_send_packet() and receiving them from the
    net_loop() loop (added in a following patch).

    The ncsi-pkt.h header[1] is copied from the Linux kernel for consistent
    field definitions.

    [0]: https://github.com/torvalds/linux/tree/master/net/ncsi
    [1]: https://github.com/torvalds/linux/blob/master/net/ncsi/ncsi-pkt.h

    Signed-off-by: Samuel Mendoza-Jonas
    Reviewed-by: Joel Stanley
    Acked-by: Joe Hershberger

    Samuel Mendoza-Jonas
     

06 Feb, 2020

1 commit


09 Dec, 2019

1 commit


08 Oct, 2019

1 commit

  • This patch adds support for gmiitorgmii converter.
    This converter sits between the MAC and the external phy
    MAC GMII2RGMII RGMII_PHY.
    The ethernet driver probes this bridge and this bridge driver
    probes real phy driver and invokes the real phy functionalities
    as requested. This bridge just needs to be configured based on
    real phy negotiated speed and duplex.

    Signed-off-by: Siva Durga Prasad Paladugu
    Signed-off-by: Michal Simek

    Siva Durga Prasad Paladugu
     

19 Jul, 2019

1 commit

  • Added a comment on the limitations of phy_find_by_mask API when scanning
    MDIO buses with multiple PHYs present. Added short descriptions to the
    other APIs in phy.h for consistency.

    Signed-off-by: Alex Marginean
    Acked-by: Joe Hershberger
    Reviewed-by: Bin Meng

    Alex Marginean
     

08 May, 2019

1 commit

  • Two new helper functions (phy_read_mmd() and phy_write_mmd()) are added
    to allow access to the MMD PHY registers.

    The MMD PHY registers can be accessed by several means:

    1. Using two new MMD access function hooks in the PHY driver. These
    functions can be implemented when the PHY driver does not support the
    standard IEEE Compatible clause 45 access mechanism described in clause
    22 or if the PHY uses its own non-standard access mechanism.

    2. Direct access for C45 PHYs and C22 PHYs when accessing the reachable
    DEVADs.

    3. The standard clause 45 access extensions to the MMD registers through
    the indirection registers (clause 22) in all the other cases.

    Signed-off-by: Carlo Caione
    Acked-by: Joe Hershberger

    Carlo Caione
     

25 Jan, 2019

1 commit

  • The phy devices can be accessed via clause 22 or via clause 45.
    This information can be deduced when we read phy id. if the phy id
    is read without giving any MDIO Manageable Device Address (MMD), then
    it conforms to clause 22. otherwise it conforms to clause 45.

    Signed-off-by: Pankaj Bansal
    Acked-by: Joe Hershberger

    Pankaj Bansal
     

25 Oct, 2018

1 commit


27 Jul, 2018

2 commits

  • Now the UCLASS_ETH device "node" field is owerwritten by some network drivers in
    case of Ethernet PHYs which are linked to UCLASS_ETH device using
    "phy-handle" DT property and when Ethernet PHY driver needs to read some
    additional information from DT. In such cases following happens (in
    general):

    - network drivers
    priv->phydev = phy_connect(priv->bus, priv->phyaddr, dev,
    priv->interface);
    phy_of_handle > 0)
    dev_set_of_offset(priv->phydev->dev, priv->phy_of_handle);
    dev->node is overwritten by phy-handle DT node

    - PHY driver in .config() callback
    int node = dev_of_offset(dev);
    node
    const void *fdt = gd->fdt_blob;

    if (fdtdec_get_bool(fdt, node, "property"))
    ...

    As result, UCLASS_ETH device can't be used any more for DT accessing.

    This patch adds additional ofnode node field to struct phy_device which can
    be set explicitly by network drivers and used by PHY drivers, so
    overwriting can be avoided. Also add helper function phy_get_ofnode()
    which will check and return phy_device->node or dev_ofnode(phydev->dev) for
    backward compatibility with existing drivers.

    Signed-off-by: Grygorii Strashko
    Acked-by: Joe Hershberger

    Grygorii Strashko
     
  • Because some phy wants to export some functions [1], export.h was
    including the whole phy subsystem which pulls in lots of stuff that
    causes some ordering and redefinition issues. Split out the only part
    that is actually needed in export.h and include it there and in phy.h.

    [1] commit 95279315076c ("board/ls2085rdb: Export functions for
    standalone AQ FW load apps")

    Signed-off-by: Joe Hershberger

    Joe Hershberger
     

14 Jun, 2018

2 commits


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

16 Jan, 2018

1 commit

  • Add a minimalistic Broadcom BCM53xx (roboswitch) switch driver similar
    to the Marvell MV88E617x. This takes care of configuring the minimum
    amount out of the switch hardware such that each user visible port
    (configurable) and the CPU port can forward packets between each other
    while preserving isolation with other ports.

    This is useful for e.g: the Lamobo R1 board featuring a Broadcom
    BCM53125 switch.

    Reviewed-by: Stefan Roese
    Signed-off-by: Florian Fainelli

    Florian Fainelli
     

17 Nov, 2017

1 commit


08 Aug, 2017

1 commit

  • The KS8721BL and KSZ9021 PHYs are software-incompatible, yet they
    share the same ID. Drivers for bothe PHYs cannot safely coexist, so
    the solution was to use #ifdefs to select between the two drivers.

    As a result KSZ9031, which has a unique ID, is now caught in the
    crossfire. Unless CONFIG_PHY_MICREL_KSZ9031 is defined, the KSZ9031
    will not function properly, as some essential configuration code is
    ifdef'd-out.

    To prevent such situations, move the KSZ9000 drivers to a separate
    file, and place them under a separate Kconfig option. While it is
    possible to enable both KSZ8000 and KSZ9000 drivers at the same time,
    the assumption is that it is highly unlikely for a system to contain
    both a KSZ8000 and a KSZ9000 PHY, and that only one of the drivers
    will be enabled at any given time.

    Signed-off-by: Alexandru Gagniuc
    Reviewed-by: Philipp Tomsich
    Acked-by: Joe Hershberger

    Alexandru Gagniuc
     

04 Apr, 2017

1 commit


29 Mar, 2017

1 commit


26 Mar, 2017

1 commit

  • This patch adds support for having a "fixed-link" to some other MAC
    (like some embedded switch-device).

    For this purpose we introduce a new phy-driver, called "Fixed PHY".

    Fixed PHY works only with CONFIG_DM_ETH enabled, since the fixed-link is
    described with a subnode below ethernet interface.

    Most ethernet drivers (unfortunately not all are following same scheme
    for searching/attaching phys) are calling "phy_connect(...)" for getting
    a phy-device.
    At this point we link in, we search here for a subnode called "fixed-
    link", once found we start phy_device_create(...) with the special phy-
    id PHY_FIXED_ID (0xa5a55a5a).

    During init the "Fixed PHY" driver has registered with this id and now
    gets probed, during probe we get all the details about fixed-link out of
    dts, later on the phy reports this values.

    Signed-off-by: Hannes Schmelzer

    Signed-off-by: Hannes Schmelzer
    Acked-by: Joe Hershberger
    Reviewed-by: Christian Gmeiner

    Hannes Schmelzer
     

09 Feb, 2017

1 commit


25 May, 2016

3 commits

  • Add a helper to phy.h to identify whether the
    phy is configured for SGMII all variables.

    Signed-off-by: Dan Murphy
    Reviewed-by: Mugunthan V N
    Reviewed-by: Michal Simek
    Tested-by: Mugunthan V N
    Acked-by: Joe Hershberger

    Dan Murphy
     
  • Move the phy_interface_is_rgmii to the phy.h
    file for all phy's to be able to use the API.

    This now aligns with the Linux kernel based on
    commit e463d88c36d42211aa72ed76d32fb8bf37820ef1

    Signed-off-by: Dan Murphy
    Reviewed-by: Mugunthan V N
    Reviewed-by: Michal Simek
    Tested-by: Mugunthan V N
    Acked-by: Joe Hershberger

    Dan Murphy
     
  • The previous mv88e61xx driver was a driver for configuring the
    switch, but did not integrate with the PHY/networking system, so
    it could not be used as a PHY by U-boot. This is a complete
    rework to support this device as a PHY.

    Signed-off-by: Kevin Smith
    Acked-by: Prafulla Wadaskar
    Cc: Albert ARIBAUD
    Cc: Joe Hershberger
    Cc: Stefan Roese
    Cc: Marek Vasut
    Acked-by: Joe Hershberger

    Kevin Smith
     

05 Apr, 2016

1 commit


29 Jan, 2016

3 commits

  • Current driver always performs a phy soft reset when connecting the phy
    device, but soft reset is not always supported by a phy device, so
    introduce a quirk PHY_FLAG_BROKEN_RESET to let such a phy device to skip
    soft reset. This commit uses 'flags' of phy device structure to store the
    quirk.

    Signed-off-by: Shaohui Xie
    Acked-by: Joe Hershberger

    Shaohui Xie
     
  • This new function will allow MAC drivers to override supported
    capabilities of the phy. It is required when MAC cannot handle all
    speeds supported by phy.

    For example phy supports up-to 1Gb connections while MAC may only work
    in modes up to 100 or even 10 Mbit/sec.

    Signed-off-by: Alexey Brodkin
    Cc: Joe Hershberger
    Acked-by: Joe Hershberger

    Alexey Brodkin
     
  • Breakdown the PHY_*_FEATURES into per speed defines such that we can
    easily re-use them individually.

    Signed-off-by: Florian Fainelli
    Signed-off-by: Alexey Brodkin
    Cc: Joe Hershberger
    Acked-by: Joe Hershberger

    Florian Fainelli
     

19 Nov, 2015

1 commit


21 Apr, 2015

1 commit

  • commit 3c6928fd7b0f84 "net: phy: fix warnings with W=1" caused
    some PHYs(e.g. CS4315/CS4340) not working. This patch fixes the
    warning and make those special PHYs working as well.

    Signed-off-by: Shengzhou Liu

    Shengzhou Liu
     

19 Apr, 2015

1 commit

  • When driver model is used for Ethernet a few functions are passed a udevice
    instead of an eth_device. Also add a function to find a PHY type given its
    name. This will be used to decode the device tree node.

    Finally, put a phy_interface field in struct eth_pdata since this is an
    important part of the platform data for Ethernet.

    Signed-off-by: Simon Glass
    Acked-by: Joe Hershberger

    Simon Glass
     

17 Jan, 2015

1 commit


06 Dec, 2014

1 commit

  • Add support for Cortina CS4315/CS4340 10G PHY.
    - This driver loads CS43xx firmware from NOR/NAND/SPI/SD device
    to initialize Cortina PHY.
    - Cortina PHY has non-standard offset of PHY ID registers, thus
    we define own get_phy_id() to override default get_phy_id().
    - To define macro CONFIG_PHY_CORTINA will enable this driver.

    Signed-off-by: Shengzhou Liu
    Reviewed-by: York Sun

    Shengzhou Liu
     

20 Nov, 2014

1 commit

  • As auto-negotiation is not supported for 2.5G SGMII, we need
    to add a new type PHY_INTERFACE_MODE_SGMII_2500 to differentiate
    SGMII-1G and SGMII-2.5G with different setting for auto-negotiation.

    Signed-off-by: Shaohui Xie
    Signed-off-by: Shengzhou Liu
    Reviewed-by: York Sun

    Shengzhou Liu
     

23 Oct, 2014

1 commit


06 Aug, 2014

1 commit


05 Mar, 2014

1 commit

  • Add a prototype for board_phy_config() to fix the following sparse warning:

    wandboard.c:200:5: warning: symbol 'board_phy_config' was not declared. Should it be static?

    Cc: Joe Hershberger
    Signed-off-by: Fabio Estevam

    Fabio Estevam
     

02 Dec, 2013

1 commit


23 Nov, 2013

1 commit