public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/1 v2][Net] Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API
Date: Thu, 20 Aug 2009 10:36:21 -0700	[thread overview]
Message-ID: <4A8D8995.6090700@gmail.com> (raw)
In-Reply-To: <20090820095659.36072833DBD2@gemini.denx.de>

Wolfgang Denk wrote:
> Dear Ben Warren,
>
> In message <f8328f7c0908132336k18e260d4xac724695594045f0@mail.gmail.com> 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
> <hangs>
>
>   
Well, the addresses look correct to me:

Definitions for this board prior to my patch:

#define CS8900_REG u16
#define CS8900_BASE 0xb4020300
#define CS8900_OFF 0x02
...  

#define CS8900_TxCMD  *(volatile CS8900_REG *)(CS8900_BASE+0x02*CS8900_OFF)
#define CS8900_TxLEN  *(volatile CS8900_REG *)(CS8900_BASE+0x03*CS8900_OFF)

Shit!  The accessor should be writew(), not writel().
That could very well be why this isn't working.  I'll put together another patch.


> Best regards,
>
> Wolfgang Denk
>
>   
Thanks a lot for your help.

Ben

  reply	other threads:[~2009-08-20 17:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-13  6:34 [U-Boot] [PATCH 1/1 v2][Net] Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API Ben Warren
2009-08-13  8:07 ` Wolfgang Denk
2009-08-14  6:36   ` Ben Warren
2009-08-20  9:56     ` Wolfgang Denk
2009-08-20 17:36       ` Ben Warren [this message]
2009-08-13  9:41 ` Wolfgang Denk

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=4A8D8995.6090700@gmail.com \
    --to=biggerbadderben@gmail.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