20 Dec, 2016

1 commit

  • The most of ethernet drivers are using this mdio registration sequence.
    strcpy(priv->bus->name, "emac");
    mdio_register(priv->bus);
    Where driver can be used only with one MDIO bus because only unique
    name should be used.

    Other drivers are using unique device name for MDIO registration to
    support multiple instances.
    snprintf(priv->bus->name, sizeof(bus->name), "%s", name);

    With DM dev->seq is used more even in logs
    (like random MAC address generation:
    printf("\nWarning: %s (eth%d) using random MAC address - %pM\n",
    dev->name, dev->seq, pdata->enetaddr);
    )
    where eth%d prefix is used.

    Simplify driver code to register mdio device with dev->seq number
    to simplify mdio registration and reduce code duplication across
    all drivers. With DM_SEQ_ALIAS enabled dev->seq reflects alias setting.

    Signed-off-by: Michal Simek
    Acked-by: Joe Hershberger
    Reviewed-by: Simon Glass

    Michal Simek
     

09 Dec, 2016

1 commit


08 Dec, 2016

1 commit

  • The most of ethernet drivers are using this mdio registration sequence.
    strcpy(priv->bus->name, "emac");
    mdio_register(priv->bus);
    Where driver can be used only with one MDIO bus because only unique
    name should be used.

    Other drivers are using unique device name for MDIO registration to
    support multiple instances.
    snprintf(priv->bus->name, sizeof(bus->name), "%s", name);

    With DM dev->seq is used more even in logs
    (like random MAC address generation:
    printf("\nWarning: %s (eth%d) using random MAC address - %pM\n",
    dev->name, dev->seq, pdata->enetaddr);
    )
    where eth%d prefix is used.

    Simplify driver code to register mdio device with dev->seq number
    to simplify mdio registration and reduce code duplication across
    all drivers. With DM_SEQ_ALIAS enabled dev->seq reflects alias setting.

    Signed-off-by: Michal Simek
    ---
    For example:

    Board: Xilinx Zynq
    Net: ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id

    Warning: ethernet@e000b000 (eth0) using random MAC address -
    7a:fc:90:53:6a:41
    eth0: ethernet@e000b000ZYNQ GEM: e000c000, phyaddr ffffffff, interface
    rgmii-id

    Warning: ethernet@e000c000 (eth3) using random MAC address -
    1a:ff:d7:1a:a1:b2
    , eth3: ethernet@e000c000
    ** Bad device size - mmc 0 **
    Checking if uenvcmd is set ...
    Hit any key to stop autoboot: 0
    Zynq> mdio list
    eth0:
    17 - Marvell 88E1111S ethernet@e000b000
    eth3:
    17 - Marvell 88E1111S ethernet@e000c000
    Zynq>

    Michal Simek
     

02 Dec, 2016

1 commit

  • It is confusing that mdio commands work and report phy id as
    decimal value when mii is working with hex values.

    For example:
    ZynqMP> mdio list
    gem:
    21 - TI DP83867 ethernet@ff0e0000
    ZynqMP> mdio read ethernet@ff0e0000 0
    Reading from bus gem
    PHY at address 21:
    0 - 0x1140
    ZynqMP> mii dump 21 0
    Incorrect PHY address. Range should be 0-31
    ...
    ZynqMP> mii dump 15
    0. (1140) -- PHY control register --
    (8000:0000) 0.15 = 0 reset

    U-Boot normally takes hex values that's why this patch is changing mdio
    command to handle hex instead of changing mii command to handle decimal
    values.

    Signed-off-by: Michal Simek
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger

    Michal Simek
     

23 Aug, 2016

1 commit


16 Aug, 2016

1 commit


06 Dec, 2015

2 commits

  • The following code will alloc memory for new_dev and ldev:
    "
    new_dev = mdio_alloc();
    ldev = malloc(sizeof(*ldev));
    "
    Either new_dev or ldev is NULL, directly return, but this may leak memory.
    So before return, using free(ldev) and mdio_free(new_dev) to avoid
    leaking memory, also free can handle NULL pointer.

    Signed-off-by: Peng Fan
    Cc: Joe Hershberger
    Cc: Simon Glass
    Cc: Bin Meng
    Reviewed-by: Bin Meng
    Acked-by: Joe Hershberger

    Peng Fan
     
  • The entry name of mii_dev is an array not pointer, so
    no need to check.

    Signed-off-by: Peng Fan
    Cc: Joe Hershberger
    Cc: Simon Glass
    Cc: Bin Meng
    Reviewed-by: Simon Glass
    Acked-by: Joe Hershberger
    Reviewed-by: Bin Meng

    Peng Fan
     

30 Oct, 2015

1 commit


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
     

24 Jul, 2013

1 commit


07 Dec, 2011

2 commits

  • This reverts commit 5c45a22b9203351a32aec4600514341b91175542.

    It causes a lot of "incompatible pointer type" warnings for a large
    number of Ethernet drivers, which are not really worth fixing
    especially as this patch was only supposed to help the old,
    deprecated miiphy API. Instead of adding more efforts to a lost case
    we rather revert it.

    Signed-off-by: Wolfgang Denk

    Wolfgang Denk
     
  • This patch is added for PHY whose register offset value exceeds 0xFF and
    cannot be used with "unsigned char" datatype in miiphy_read, miiphy_write
    and miiphy_register functions. Datatype of register offset is changed to
    unsigned short instead of unsigned char so that offset value greater then
    0xFF can be used.

    Signed-off-by: Chandan Nath
    Acked-by: Mike Frysinger

    Chandan Nath
     

06 Dec, 2011

1 commit


26 Jul, 2011

1 commit

  • In miiphy_register() the new device's name was initialised by passing a
    string parameter as the format string to sprintf(). As this would cause
    problems if it ever contained a '%' symbol, switch to using strncpy()
    instead.

    Signed-off-by: Laurence Withers
    Cc: Andy Fleming

    Laurence Withers
     

01 May, 2011

1 commit


21 Apr, 2011

2 commits

  • Extends the mii_dev structure to participate in a full-blown MDIO and
    PHY driver scheme. The mii_dev structure and miiphy calls are modified
    in such a way to allow the original mii command and miiphy
    infrastructure to work as before, but also to support a new set of APIs
    which allow (among other things) sharing of PHY driver code and 10G support

    The mii command will continue to support normal PHY management functions
    (Clause 22 of 802.3), but will not be changed to support 10G
    (Clause 45).

    The basic design is similar to PHY Lib from Linux, but simplified for
    U-Boot's network and driver infrastructure.

    We now have MDIO drivers and PHY drivers

    An MDIO driver provides:
    read
    write
    reset

    A PHY driver provides:
    (optionally): probe
    config - initial setup, starting of auto-negotiation
    startup - waiting for AN, and reading link state
    shutdown - any cleanup needed

    The ethernet drivers interact with the PHY Lib using these functions:
    phy_connect()
    phy_config()
    phy_startup()
    phy_shutdown()

    Each PHY driver can be configured separately, or all at once using
    config_phylib_all_drivers.h (added in the patch which adds the drivers)

    We also provide generic drivers for Clause 22 (10/100/1000), and
    Clause 45 (10G) PHYs.

    We also implement phy_reset(), and call it in phy_connect(). Because
    phy_reset() is essentially the same as miiphy_reset, but:
    a) must support 10G PHYs, and
    b) should use the phylib primitives,

    we implement miiphy_reset, using phy_reset(), but only when
    CONFIG_PHYLIB is set. Otherwise, we just use the old version. In this
    way, we save on compile size, even if we don't manage to save code size.

    Pulled ethtool.h and mdio.h from:
    git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
    782d640afd15af7a1faf01cfe566ca4ac511319d
    With many, many deletions so as to enable compilation under u-boot

    Signed-off-by: Andy Fleming
    Signed-off-by: Kumar Gala
    Acked-by: Detlev Zundel

    Andy Fleming
     
  • Mostly putting a space between function name and "(", and
    doing return (foo)

    Signed-off-by: Andy Fleming
    Acked-by: Detlev Zundel

    Andy Fleming
     

10 Jan, 2011

1 commit

  • The include/miiphy.h header duplicates a lot of things from linux/mii.h.
    So punt all the things that overlap to keep the API simple and to make
    merging between U-Boot and Linux simpler.

    Signed-off-by: Mike Frysinger

    Mike Frysinger
     

10 Aug, 2010

3 commits

  • For code that uses miiphy_{read,write}, every call invokes a full look up
    of the mii list. There is already a "current_mii" cache that is used by
    some code, but have the miiphy_{read,write} function use it as well. This
    does increase the code size slightly, but I think it's worth it.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Ben Warren

    Mike Frysinger
     
  • Rather than have every func re-implement the list walking code, do it one
    local function. This shrinks the resulting object code a little while
    making the source much more manageable.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Ben Warren

    Mike Frysinger
     
  • The driver name does not need to be writable, so constify it.

    Signed-off-by: Mike Frysinger
    Signed-off-by: Ben Warren

    Mike Frysinger
     

12 Mar, 2010

1 commit


07 Feb, 2010

1 commit

  • This patch fixes a problem I've notived on a buggy PPC4xx system. This
    system has problems with the PHY MDIO communication and seemed to be
    stuck/crashed in miiphy_reset(). But degugging revealed, that the CPU
    didn't crash, but "only" hung in this counting loop for about 2 minutes.

    This patch now uses a real timeout of 0.5 seconds (as mentioned in the
    comment in miiphy_reset).

    Signed-off-by: Stefan Roese
    Signed-off-by: Ben Warren

    Stefan Roese
     

19 Oct, 2009

1 commit


19 Oct, 2008

1 commit


30 Aug, 2008

1 commit


15 Feb, 2008

1 commit

  • Current MII_DEBUG is confusing in two ways. One is useless define-then-
    undef at the top of the file. The other is there is only one debug() in
    this file, and that doesn't seem worthwhile to bother having MII_DEBUG.
    While there are many useful printf()/puts() debug codes, but they are for
    DEBUG, not for MII_DEBUG.

    This patch tries to put them all together into MII_DEBUG and debug().

    Signed-off-by: Shinya Kuribayashi

    Shinya Kuribayashi
     

06 Nov, 2007

2 commits


09 Jul, 2007

1 commit


04 Jul, 2007

1 commit


01 Dec, 2005

1 commit


29 Oct, 2005

1 commit


13 Aug, 2005

1 commit


07 Jun, 2004

1 commit

  • Add support for OMAP730 Perseus2 Development board

    * Patch by Alan J. Luse, 29 Apr 2004:
    Fix flash chip-select (OR0) option register setting on FADS boards.

    * Patch by Alan J. Luse, 29 Apr 2004:
    Report MII network speed and duplex setting properly when
    auto-negotiate is not enabled.

    * Patch by Jarrett Redd, 29 Apr 2004:
    Fix hang on reset on Ocotea board due to flash in wrong mode.

    wdenk
     

16 Apr, 2004

1 commit


24 Mar, 2004

2 commits

  • Increase speed of sector reads from SystemACE,
    shorten poll timeout and remove a useless reset

    * Patch by Tolunay Orkun, 19 Mar 2004:
    Make GigE PHY 1000Mbps Speed/Duplex detection conditional
    (CONFIG_PHY_GIGE)

    * Patch by Brad Kemp, 18 Mar 2004:
    prevent machine checks during a PCI scan

    * Patch by Pierre Aubert, 18 Mar 2004:
    Fix string cleaning in IDE identification

    wdenk
     
  • - show PCI clock frequency on MPC8260 systems
    - add FCC_PSMR_RMII flag for HiP7 processors
    - in do_jffs2_fsload(), take load address from load_addr if not set
    explicit, update load_addr otherwise
    - replaced printf by putc/puts when no formatting is needed
    (smaller code size, faster execution)

    wdenk
     

15 Mar, 2004

1 commit

  • - Fix Gigabit Ethernet support for 440GX
    - Add Gigabit Ethernet Support to MII PHY utilities

    * Patch by Brad Kemp, 12 Mar 2004:
    Fixes for drivers/cfi_flash.c:
    - Better support for x8/x16 implementations
    - Added failure for AMD chips attempting to use CFG_FLASH_USE_BUFFER_WRITE
    - Added defines for AMD command and address constants

    * Patch by Leon Kukovec, 12 Mar 2004:
    Fix get_dentfromdir() to correctly handle deleted dentries

    * Patch by George G. Davis, 11 Mar 2004:
    Remove hard coded network settings in TI OMAP1610 H2
    default board config

    * Patch by George G. Davis, 11 Mar 2004:
    add support for ADS GraphicsClient+ board.

    wdenk