From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Thu, 24 Jun 2010 12:37:42 -0400 Subject: [U-Boot] [PATCH V2] Allow PHY addresses on kirkwood egiga to be non continuous. In-Reply-To: <1277371907-18459-1-git-send-email-tor@excito.com> References: <1277371907-18459-1-git-send-email-tor@excito.com> Message-ID: <201006241237.43140.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thursday, June 24, 2010 05:31:47 Tor Krill wrote: > void reset_phy(void) > { > char *name = "egiga0"; > + u8 port_addr[] = CONFIG_PHY_ADDRS; > > if (miiphy_set_current_dev(name)) > return; > > /* reset the phy */ > - miiphy_reset(name, CONFIG_PHY_BASE_ADR); > + miiphy_reset(name, port_addr[0]); > } hmm, this cant possibly be correct. how do you know which of the phys is to be reset ? but i guess that's just a bug in the ARM tree you cant do much about without fixing everyone. > --- a/drivers/net/kirkwood_egiga.c > +++ b/drivers/net/kirkwood_egiga.c > @@ -629,6 +629,7 @@ int kirkwood_egiga_initialize(bd_t * bis) > int devnum; > char *s; > u8 used_ports[MAX_KWGBE_DEVS] = CONFIG_KIRKWOOD_EGIGA_PORTS; > + u8 port_addr[MAX_KWGBE_DEVS] = PHY_ADDRS; > > for (devnum = 0; devnum < MAX_KWGBE_DEVS; devnum++) { > /*skip if port is configured not to use */ > @@ -712,7 +713,7 @@ int kirkwood_egiga_initialize(bd_t * bis) > miiphy_register(dev->name, smi_reg_read, smi_reg_write); > /* Set phy address of the port */ > miiphy_write(dev->name, KIRKWOOD_PHY_ADR_REQUEST, > - KIRKWOOD_PHY_ADR_REQUEST, PHY_BASE_ADR + devnum); > + KIRKWOOD_PHY_ADR_REQUEST, port_addr[devnum]); > #endif > } > return 0; > --- a/drivers/net/kirkwood_egiga.h > +++ b/drivers/net/kirkwood_egiga.h > @@ -30,11 +30,11 @@ > > #define MAX_KWGBE_DEVS 2 /*controller has two ports */ > > -/* PHY_BASE_ADR is board specific and can be configured */ > -#if defined (CONFIG_PHY_BASE_ADR) > -#define PHY_BASE_ADR CONFIG_PHY_BASE_ADR > +/* PHY addresses is board specific and can be configured */ > +#if defined (CONFIG_PHY_ADDRS) > +#define PHY_ADDRS CONFIG_PHY_ADDRS > #else > -#define PHY_BASE_ADR 0x08 /* default phy base addr */ > +#define PHY_ADDRS {0x08,0x09} /* default phy base addr */ > #endif i dont know anything about the kirkwood_egiga, but cant you have more than one instance on a board ? if so, it'd make more sense to change the phy addr define stuff into an array argument that gets passed to the driver init func. -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20100624/a3db61d2/attachment.pgp