[U-Boot] [PATCH 1/1 v2][Net] Convert CS8900 Ethernet driver to CONFIG_NET_MULTI API

Ben Warren biggerbadderben at gmail.com
Fri Aug 14 08:36:01 CEST 2009


On Thu, Aug 13, 2009 at 1:07 AM, Wolfgang Denk <wd at denx.de> wrote:

> Dear Ben Warren,
>
> In message <1250145251-23438-1-git-send-email-biggerbadderben at gmail.com>
> you wrote:
> > All in-tree boards that use this controller have CONFIG_NET_MULTI added
> > Also:
> >   - changed CONFIG_DRIVER_CS8900 to CONFIG_CS8900
> >   - changed CS8900_BASE to CONFIG_CS8900_BASE
> >   - changed CS8900_BUS?? to CONFIG_CS8900_BUS??
> >   - cleaned up line lengths
> >   - modified VCMA9 command function that accesses the device
> >   - removed MAC address initialization from lib_arm/board.c
> >
> > Signed-off-by: Ben Warren <biggerbadderben at gmail.com>
> > ---
> >
> > v2: Fixed typo: CS8900_BUS32 -> CONFIG_CS8900_BUS32
> >     Added more descriptive printf in cs8900_init as suggested by Wolfgang
> >     Initialize 'priv' data structure in cs8900_initialize()
>
> Thanks. That's better, but no cigar yet.
>
:(

>
> I now get this:
>
> TRAB # run load
> Using CS8900-0 device
> TFTP from server 192.168.1.1; our IP address is 192.168.3.68
> Filename 'trab/u-boot.bin-wd'.
> Load address: 0xc100000
> Loading: data abort
> pc : [<0df6b254>]          lr : [<0df4c694>]
> sp : 0df1bb74  ip : 00000004     fp : 0000083c
> r10: 0df79ca0  r9 : 000000c0     r8 : 0df1bfd8
> r7 : 0df1c100  r6 : 0df1c140     r5 : 0000002a  r4 : 0000005c
> r3 : 07000300  r2 : 0000002a     r1 : 0df79ca0  r0 : 0df1c100
> Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
> Resetting CPU ...
>
> Decoding PC and LR gives:
>
> PC: 0x0df6b254 -- 0x0df6b228 + 0x002c   cs8900_send
> LR: 0x0df4c694 -- 0x0df4c668 + 0x002c   eth_send
>
> Placing a few printf()s indicates that it crashes in the writel()
> following the rety: label. Looking at the code, the
> "&priv->regs->txcmd" looks a bit fishy to me. I played around a bit
> (guessing for "priv->regs->txcmd" and "&(priv->regs->txcmd)" but this
> doesn't change behaviour.
>
Yeah, this should be fine.  I think there'd be a compile error if the
compiler interpreted the '&' as belonging to something other than 'txcmd'.

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.

thanks again,
Ben


More information about the U-Boot mailing list