From: Wolfgang Denk Date: Thu, 20 Aug 2009 11:56:59 +0200 Subject: [U-Boot] [PATCH 1/1 v2][Net] Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API In-Reply-To: References: <1250145251-23438-1-git-send-email-biggerbadderben@gmail.com> <20090813080738.22A42833DBD2@gemini.denx.de> Message-ID: <20090820095659.36072833DBD2@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ben Warren, In message you wrote: > > I looked at a disassembly of this code and it looked like it should work. > In this case, the base offset of the device is in r2 (0x07000300) and the > code does store operations on this +#4 and +#6, which were the offsets in > the original. I guess it would be useful to printf something like: > > printf("addr = %#08x\n", &priv->regs->txcmd) just to make sure it's > 0x07000304. > > Other than that, I'm stumped. I'll review the code again to see if anything > jumps out. Hm... adding this patch: diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 5b9c4cb..0f86c39 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -215,6 +215,11 @@ static int cs8900_send(struct eth_device *dev, struct cs8900_priv *priv = (struct cs8900_priv *)(dev->priv); retry: + printf("priv=%#08x regs=%#08x txcmd=%#08x\n", + (unsigned int)priv, + (unsigned int)(priv->regs), + (unsigned int)(&priv->regs->txcmd)); + /* initiate a transmit sequence */ writel(PP_TxCmd_TxStart_Full, &priv->regs->txcmd); writel(length, &priv->regs->txlen); And testing on the mx31ads board I get this: => run load Using CS8900-0 device TFTP from server 192.168.1.1; our IP address is 192.168.20.9 Filename 'mx31ads/u-boot.bin'. Load address: 0x80800000 Loading: priv=0x87ed8100 regs=0xb4020300 txcmd=0xb4020304 Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de On the subject of C program indentation: "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." - Blair P. Houghton