public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Carl Riechers <criechers@yahoo.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] 440GX PHY/MII access
Date: Tue, 13 Apr 2004 06:46:41 -0700 (PDT)	[thread overview]
Message-ID: <20040413134641.63993.qmail@web60503.mail.yahoo.com> (raw)
In-Reply-To: <C7FFFEA58B43D311920D0004ACE5333F132B00D6@amer25.avnet.com>

If you are using address zero for the PHY you will
have problems.  The 440GX seems to use this address
for diagnostics.  I could not find any documentation
on this.  I have a simular configuration with only
eth2 and eth3.  If you are using the Marvel PHYs, make
sure you hardware reset them per the specification
otherwise the soft reset will not work correctly.

The author of the code was most likely using a
different brand of PHY and needed to reset the PHY to
have access to certain registers.  The code
reconfigures the selected MAC to interface with the
serial bus to the PHYs.  Each MAC has a MII serial bus
master, but only one can drive the MII serial
interface to the PHYs though the bridge.

Carl

--- "Kerl, John" <John.Kerl@Avnet.com> wrote:
> Hello,
> 
> I am wondering if anyone can illuminate the
> following code snippet,
> from ppc_440x_eth_init() in cpu/ppc4xx/440gx_enet.c:
> 
> 	out32 (ZMII_SSR, ZMII_SSR_SP <<
> ZMII_SSR_V(devnum));
> 	__asm__ volatile ("eieio");
> 
> 	/* reset emac so we have access to the phy */
> 	out32 (EMAC_M0 + hw_p->hw_addr, EMAC_M0_SRST);
> 	__asm__ volatile ("eieio");
> 
> 	failsafe = 1000;
> 	while ((in32 (EMAC_M0 + hw_p->hw_addr) &
> (EMAC_M0_SRST)) && failsafe) {
> 		udelay (1000);
> 		failsafe--;
> 	}
> 	in32(EMAC_M0 + hw_p->hw_addr), EMAC_M0 +
> hw_p->hw_addr);
> 
> In particular I don't understand the comment "reset
> emac so we have
> access to the phy".  In fact, print statements
> before and after
> the MAC reset indicate that we *can* read PHY
> registers before
> the MAC reset, but we *lose* the ability to read PHY
> registers
> after the MAC reset.  Note that this does not happen
> on all
> three boards, and not all the time.  Also this loss
> of PHY-register
> access after MAC reset is more likely to happen if
> the Ethernet cable
> is connected.
> 
> Now, there are a couple oddities: (1) these are
> brand-new boards,
> still being debugged and flywired; (2) we are using
> EMACs 2 & 3 over
> RGMII, but we have EMACs 0 & 1 not connected to
> anything (unlike
> the Ocotea board).
> 
> In particular, I don't doubt that the above code is
> correct; certainly
> the finger of doubt points in the direction of our
> new board.  Still,
> though, I don't yet understand why the MAC reset
> would cause PHY
> access to go away.  The scope reveals that after the
> MAC reset, the
> MDIO line is no longer being driven.
> 
> Does this ring any bells for anyone?
> 
> Thanks.
> 
> 
>
-------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux
> Tutorials
> Free Linux tutorial presented by Daniel Robbins,
> President and CEO of
> GenToo technologies. Learn everything from
> fundamentals to system
>
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/u-boot-users



	
		
__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/

  reply	other threads:[~2004-04-13 13:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-07 21:05 [U-Boot-Users] 440GX PHY/MII access Kerl, John
2004-04-13 13:46 ` Carl Riechers [this message]
2004-04-13 15:05   ` [U-Boot-Users] Cascaded U-Boot setup question Mike Wellington
2004-04-13 16:22     ` Mike Wellington
     [not found] <407C12CF.7030609@doremilabs.com>
2004-04-14 12:03 ` [U-Boot-Users] 440GX PHY/MII access Carl Riechers
  -- strict thread matches above, loose matches on Subject: below --
2004-04-14 16:58 Kerl, John

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=20040413134641.63993.qmail@web60503.mail.yahoo.com \
    --to=criechers@yahoo.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