From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Support for multiple SGMII/TBI interfaces for TSEC ethernet
Date: Wed, 10 Sep 2008 16:08:35 -0700 [thread overview]
Message-ID: <48C85373.5030306@gmail.com> (raw)
In-Reply-To: <1221087977-23936-1-git-send-email-ptyser@xes-inc.com>
Andy,
You're much more qualified than me to accept or reject this, so if you
don't mind, please pick it up.
regards,
Ben
Peter Tyser wrote:
> Fix TBI PHY accesses to use the proper offset in CPU register space. The
> previous code would incorrectly access the TBI PHY by reading/writing to CPU
> register space at the same location as would be used to access external PHYs.
>
> Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
> ---
>
> Dohh... v2 of the patch introduced a compile warning. Please apply
> this version instead.
>
> I replaced the hardcoding of CFG_TBIPA_VALUE in the tsec_configure_serdes()
> to support possible changes of the TBI addressing down the road, but
> kept the default TBI PHY address at CFG_TBIPA_VALUE as Andy Flemming
> suggested.
>
> drivers/net/tsec.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index f81211a..cc7d528 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -283,11 +283,13 @@ uint tsec_local_mdio_read(volatile tsec_t *phyregs, uint phyid, uint regnum)
> /* Configure the TBI for SGMII operation */
> static void tsec_configure_serdes(struct tsec_private *priv)
> {
> - tsec_local_mdio_write(priv->phyregs, CFG_TBIPA_VALUE, TBI_ANA,
> + /* Access TBI PHY registers at given TSEC register offset as opposed to the
> + * register offset used for external PHY accesses */
> + tsec_local_mdio_write(priv->regs, priv->regs->tbipa, TBI_ANA,
> TBIANA_SETTINGS);
> - tsec_local_mdio_write(priv->phyregs, CFG_TBIPA_VALUE, TBI_TBICON,
> + tsec_local_mdio_write(priv->regs, priv->regs->tbipa, TBI_TBICON,
> TBICON_CLK_SELECT);
> - tsec_local_mdio_write(priv->phyregs, CFG_TBIPA_VALUE, TBI_CR,
> + tsec_local_mdio_write(priv->regs, priv->regs->tbipa, TBI_CR,
> TBICR_SETTINGS);
> }
>
> @@ -299,12 +301,10 @@ static int init_phy(struct eth_device *dev)
> {
> struct tsec_private *priv = (struct tsec_private *)dev->priv;
> struct phy_info *curphy;
> - volatile tsec_t *phyregs = priv->phyregs;
> volatile tsec_t *regs = priv->regs;
>
> /* Assign a Physical address to the TBI */
> regs->tbipa = CFG_TBIPA_VALUE;
> - phyregs->tbipa = CFG_TBIPA_VALUE;
> asm("sync");
>
> /* Reset MII (due to new addresses) */
>
next prev parent reply other threads:[~2008-09-10 23:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-10 23:06 [U-Boot] [PATCH v3] Support for multiple SGMII/TBI interfaces for TSEC ethernet Peter Tyser
2008-09-10 23:08 ` Ben Warren [this message]
2008-09-15 21:13 ` Andy Fleming
2008-09-15 22:17 ` Peter Tyser
2008-09-16 0:42 ` Andy Fleming
2008-09-16 3:55 ` Peter Tyser
2008-09-16 4:20 ` Andy Fleming
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=48C85373.5030306@gmail.com \
--to=biggerbadderben@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox