All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] PHY: micrel: helper function for KSZ9031
Date: Thu, 20 Jun 2013 16:44:57 +0200	[thread overview]
Message-ID: <51C31569.9000306@denx.de> (raw)
In-Reply-To: <3465D313FDFB824F9A9C8CD24FA4F6BC0108CD33@frontmail.adetel.com>

Hi Joe,

On 20/06/2013 13:26, SARTRE Leo wrote:
> micrel.c: Add function ksz9031_phy_extended_write, helper to MDD
> 		  register write
> micrel.h: Prototype and define MDD registers
> 
> Signed-off-by: Leo Sartre <lsartre@adeneo-embedded.com>
> ---
>  drivers/net/phy/micrel.c |   29 +++++++++++++++++++++++++++--
>  include/micrel.h         |    7 +++++++
>  2 files changed, 34 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
> index 2a8b6cb..5b5c11b 100644
> --- a/drivers/net/phy/micrel.c
> +++ b/drivers/net/phy/micrel.c
> @@ -85,7 +85,7 @@ static int ksz90xx_startup(struct phy_device *phydev)
>  }
>  #ifdef CONFIG_PHY_MICREL_KSZ9021
>  
> -/*
> +/**
>   * KSZ9021
>   */
>  
> @@ -148,9 +148,34 @@ static struct phy_driver ksz9021_driver = {
>  };
>  #endif
>  
> -/*
> +/**
>   * KSZ9031
>   */
> +
> +/* PHY Registers */
> +#define MII_KSZ9031_MMD_ACCES_CTRL 0x0d
> +#define MII_KSZ9031_MMD_REG_DATA   0x0e
> +
> +/* Accessors to extended registers*/
> +int ksz9031_phy_extended_write(struct phy_device *phydev,
> +							   int devaddr,
> +							   int regnum,
> +							   u16 val)
> +{
> +	/*select register addr for mmd*/
> +	phy_write(phydev, MDIO_DEVAD_NONE,
> +			 MII_KSZ9031_MMD_ACCES_CTRL, devaddr);
> +	/*select register for mmd*/
> +	phy_write(phydev, MDIO_DEVAD_NONE,
> +			 MII_KSZ9031_MMD_REG_DATA, regnum);
> +	/*setup mode*/
> +	phy_write(phydev, MDIO_DEVAD_NONE,
> +			 MII_KSZ9031_MMD_ACCES_CTRL, (devaddr | 0xC000));
> +	/*write the value*/
> +	return phy_write(phydev, MDIO_DEVAD_NONE,
> +					 MII_KSZ9031_MMD_REG_DATA, val);
> +}
> +
>  static struct phy_driver ksz9031_driver = {
>  	.name = "Micrel ksz9031",
>  	.uid  = 0x221620,
> diff --git a/include/micrel.h b/include/micrel.h
> index 25e8a46..d63ff45 100644
> --- a/include/micrel.h
> +++ b/include/micrel.h
> @@ -9,8 +9,15 @@
>  #define MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW	0x106
>  #define MII_KSZ9021_EXT_ANALOG_TEST		0x107
>  
> +#define MII_KSZ9031_EXT_RGMII_CTRL_SIG_SKEW	0x4
> +#define MII_KSZ9031_EXT_RGMII_RX_DATA_SKEW	0x5
> +#define MII_KSZ9031_EXT_RGMII_TX_DATA_SKEW	0x6
> +#define MII_KSZ9031_EXT_RGMII_CLOCK_SKEW	0x8
> +
>  struct phy_device;
>  int ksz9021_phy_extended_write(struct phy_device *phydev, int regnum, u16 val);
>  int ksz9021_phy_extended_read(struct phy_device *phydev, int regnum);
>  
> +int ksz9031_phy_extended_write(struct phy_device *phydev, int devaddr,
> +							   int regnum, u16 val);
>  #endif
> 

This patchset belongs to two are, mainly i.MX (for Congatec) and to
Network (this patch). Can you ACK/NACK this ? I will enqueue the other
two patches in the meantime. To proceed, I propose I can merge then
whole patchset into u-boot-imx to avoid to have inconsistent trees.

Thanks,
Stefano

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  parent reply	other threads:[~2013-06-20 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1371727592-21028-1-git-send-email-lsartre@adeneo-embedded.com>
2013-06-20 11:26 ` [U-Boot] [PATCH 1/2] PHY: micrel: helper function for KSZ9031 SARTRE Leo
2013-06-20 12:31   ` Otavio Salvador
2013-06-20 14:44   ` Stefano Babic [this message]
2013-06-20 11:26 ` [U-Boot] [PATCH 2/2] ARM: Congatec: Ethernet: Add support for cgtqmx6qeval SARTRE Leo
2013-06-20 12:34   ` Otavio Salvador

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=51C31569.9000306@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.