public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] Support for multiple SGMII/TBI interfaces	for TSEC ethernet
Date: Mon, 15 Sep 2008 17:17:32 -0500	[thread overview]
Message-ID: <1221517052.5876.65.camel@localhost.localdomain> (raw)
In-Reply-To: <2acbd3e40809151413u14ab3819r3e304e462b12c602@mail.gmail.com>

On Mon, 2008-09-15 at 16:13 -0500, Andy Fleming wrote:
> > @@ -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");
> 
> 
> What was the purpose of doing this?  The problem I have with it is in
> the odd situation where the TSEC whose MII regs are connected to the
> bus is not enabled.  It would mean that the TBIPA would never be set
> to CFG_TBIPA_VALUE.

I don't quite understand what you mean.  My understanding was that if a
TSEC is not enabled, the TBIPA for that TSEC should not be enabled
either.

The original code was writing the TBIPA value 2 times for every TSEC -
once at the TSEC register address in cpu space, and a second time at the
TSEC's MII register address in cpu space.

For example, if a board had 4 sgmii interfaces with 4 external PHYs on
an mpc8572 - all 4 PHYs could be physically connected to the MDIO bus of
TSEC1.  The cpu address offsets of the 4 TSECs would be:
TSEC1 regs    = 0x24000
TSEC1 phyregs = 0x24000
TSEC2 regs    = 0x25000
TSEC2 phyregs = 0x24000
TSEC3 regs    = 0x26000
TSEC3 phyregs = 0x24000
TSEC4 regs    = 0x27000
TSEC4 phyregs = 0x24000

With the old code, on bootup the ethernet initialization would go like:

configure TSEC1 - write TSEC1's TBIPA address, write TSEC1's TBIPA
address (2nd write to TSEC1 TBIPA)

configure TSEC2 - write TSEC2's TBIPA address, write TSEC1's TBIPA
address (3rd time)

configure TSEC3 - write TSEC3's TBIPA address, write TSEC1's TBIPA
address (4th time)

configure TSEC4 - write TSEC4's TBIPA address, write TSEC1's TBIPA
address (5th time)

So the old code would write TSEC1's TBIPA address 5 times.

The patch I submitted does the following:
configure TSEC1 - write TSEC1's TBIPA address

configure TSEC2 - write TSEC2's TBIPA address

configure TSEC3 - write TSEC3's TBIPA address

configure TSEC4 - write TSEC4's TBIPA address

This 2nd method seems correct to me - each TSECs TBIPA address should
only be set for itself, not itself as well as the TSEC its using to
access its external PHY.

Best,
Peter

  reply	other threads:[~2008-09-15 22:17 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
2008-09-15 21:13 ` Andy Fleming
2008-09-15 22:17   ` Peter Tyser [this message]
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=1221517052.5876.65.camel@localhost.localdomain \
    --to=ptyser@xes-inc.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