From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXygs-0000U4-Dl for qemu-devel@nongnu.org; Wed, 09 Apr 2014 16:01:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WXygj-0000cY-22 for qemu-devel@nongnu.org; Wed, 09 Apr 2014 16:01:46 -0400 Received: from mail-ee0-x231.google.com ([2a00:1450:4013:c00::231]:53744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WXygi-0000cA-R9 for qemu-devel@nongnu.org; Wed, 09 Apr 2014 16:01:36 -0400 Received: by mail-ee0-f49.google.com with SMTP id c41so2251757eek.22 for ; Wed, 09 Apr 2014 13:01:35 -0700 (PDT) Date: Wed, 9 Apr 2014 22:01:17 +0200 From: Beniamino Galvani Message-ID: <20140409200007.GA794@gmail.com> References: <6f4d53b04ddbfb19895bfb61a595e69f1c08859a.1396594056.git.peter.crosthwaite@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6f4d53b04ddbfb19895bfb61a595e69f1c08859a.1396594056.git.peter.crosthwaite@xilinx.com> Subject: Re: [Qemu-devel] [PATCH target-arm v1 1/1] net: cadence_gem: Make phy respond to broadcast List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: peter.maydell@linaro.org, nathan.rossi@xilinx.com, qemu-devel@nongnu.org On Thu, Apr 03, 2014 at 11:55:19PM -0700, Peter Crosthwaite wrote: > Phys must respond to address 0 by specification. Implement. > > Signed-off-by: Nathan Rossi > Signed-off-by: Peter Crosthwaite > --- > > hw/net/cadence_gem.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c > index 92dc2f2..e34b25e 100644 > --- a/hw/net/cadence_gem.c > +++ b/hw/net/cadence_gem.c > @@ -1093,7 +1093,7 @@ static uint64_t gem_read(void *opaque, hwaddr offset, unsigned size) > uint32_t phy_addr, reg_num; > > phy_addr = (retval & GEM_PHYMNTNC_ADDR) >> GEM_PHYMNTNC_ADDR_SHFT; > - if (phy_addr == BOARD_PHY_ADDRESS) { > + if (phy_addr == BOARD_PHY_ADDRESS || phy_addr == 0) { > reg_num = (retval & GEM_PHYMNTNC_REG) >> GEM_PHYMNTNC_REG_SHIFT; > retval &= 0xFFFF0000; > retval |= gem_phy_read(s, reg_num); > @@ -1193,7 +1193,7 @@ static void gem_write(void *opaque, hwaddr offset, uint64_t val, > uint32_t phy_addr, reg_num; > > phy_addr = (val & GEM_PHYMNTNC_ADDR) >> GEM_PHYMNTNC_ADDR_SHFT; > - if (phy_addr == BOARD_PHY_ADDRESS) { > + if (phy_addr == BOARD_PHY_ADDRESS || phy_addr == 0) { > reg_num = (val & GEM_PHYMNTNC_REG) >> GEM_PHYMNTNC_REG_SHIFT; > gem_phy_write(s, reg_num, val); > } Although 802.3 standard dictates that PHYs must always respond to address 0, AFAIK not all PHYs do this. In this case, if the Marvell PHY complies with standard: Reviewed-by: Beniamino Galvani