Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-09-01 Thread Wolfgang Denk
Dear Michal Simek, In message <4e5f4883.3080...@monstr.eu> you wrote: > > > Well I see it both ways ... 0x4000 == 1 << 30 ... it's the same thing. > > On > > the other note, it's hard to count the zeroes in there AND you can mistake > > 0 and > > 8 in a huge series of those. > > > > Also,

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-09-01 Thread Michal Simek
Marek Vasut wrote: > On Thursday, September 01, 2011 10:55:31 AM Michal Simek wrote: > > [...] > I am fine to use 1 << n solution but definitely in our repo I will use in way I like. >>> Well I see it both ways ... 0x4000 == 1 << 30 ... it's the same >>> thing. On the other note, it

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-09-01 Thread Marek Vasut
On Thursday, September 01, 2011 10:55:31 AM Michal Simek wrote: [...] > >> I am fine to use 1 << n solution but definitely in our repo I will use > >> in way I like. > > > > Well I see it both ways ... 0x4000 == 1 << 30 ... it's the same > > thing. On the other note, it's hard to count the z

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-09-01 Thread Michal Simek
>> + >> +/* Axi Ethernet registers offset */ >> +#define XAE_IS_OFFSET 0x000C /* Interrupt status */ >> +#define XAE_IE_OFFSET 0x0014 /* Interrupt enable */ >> +#define XAE_RCW1_OFFSET 0x0404 /* Rx Configuration Word 1 */ >> +#define X

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-09-01 Thread Marek Vasut
On Thursday, September 01, 2011 09:17:35 AM Michal Simek wrote: > Marek Vasut wrote: > > On Wednesday, August 31, 2011 04:46:22 PM Michal Simek wrote: > >> Marek Vasut wrote: > >>> On Tuesday, August 30, 2011 02:05:19 PM Michal Simek wrote: > Add the first axi_ethernet driver for little-endian

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-09-01 Thread Michal Simek
Marek Vasut wrote: > On Wednesday, August 31, 2011 04:46:22 PM Michal Simek wrote: >> Marek Vasut wrote: >>> On Tuesday, August 30, 2011 02:05:19 PM Michal Simek wrote: Add the first axi_ethernet driver for little-endian Microblaze. Signed-off-by: Michal Simek --- dr

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-31 Thread Michal Simek
Mike Frysinger wrote: > On Tuesday, August 30, 2011 08:05:19 Michal Simek wrote: >> +static void setup_mac(struct eth_device *dev) >> +{ >> +/* Set the MAC address */ >> +int val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) | >> +(dev->enetaddr[1] << 8) | (dev->enetadd

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-31 Thread Wolfgang Denk
Dear Michal Simek, In message <4e5e493e.3070...@monstr.eu> you wrote: > > >> +/* Axi Ethernet registers offset */ > >> +#define XAE_IS_OFFSET 0x000C /* Interrupt status */ > >> +#define XAE_IE_OFFSET 0x0014 /* Interrupt enable */ > >> +#define XAE_RCW1_OFFSET

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-31 Thread Mike Frysinger
On Tuesday, August 30, 2011 08:05:19 Michal Simek wrote: > +static void setup_mac(struct eth_device *dev) > +{ > + /* Set the MAC address */ > + int val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) | > + (dev->enetaddr[1] << 8) | (dev->enetaddr[0])); > + aximac_out

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-31 Thread Marek Vasut
On Wednesday, August 31, 2011 04:46:22 PM Michal Simek wrote: > Marek Vasut wrote: > > On Tuesday, August 30, 2011 02:05:19 PM Michal Simek wrote: > >> Add the first axi_ethernet driver for little-endian Microblaze. > >> > >> Signed-off-by: Michal Simek > >> --- > >> > >> drivers/net/Makefile

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-31 Thread Michal Simek
Marek Vasut wrote: > On Tuesday, August 30, 2011 02:05:19 PM Michal Simek wrote: >> Add the first axi_ethernet driver for little-endian Microblaze. >> >> Signed-off-by: Michal Simek >> --- >> drivers/net/Makefile |1 + >> drivers/net/xilinx_axi_emac.c | 622 >> ++

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-31 Thread Marek Vasut
On Tuesday, August 30, 2011 02:05:19 PM Michal Simek wrote: > Add the first axi_ethernet driver for little-endian Microblaze. > > Signed-off-by: Michal Simek > --- > drivers/net/Makefile |1 + > drivers/net/xilinx_axi_emac.c | 622 > + include

[U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-08-30 Thread Michal Simek
Add the first axi_ethernet driver for little-endian Microblaze. Signed-off-by: Michal Simek --- drivers/net/Makefile |1 + drivers/net/xilinx_axi_emac.c | 622 + include/netdev.h |1 + 3 files changed, 624 insertions(+), 0 de

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-08 Thread Mike Frysinger
On Friday, March 04, 2011 05:09:53 Michal Simek wrote: > To finish this discuss - here is what you think that it is correct. > ad 2) > return -1 - if initialize failed > return 0 - never return > return >0 - # of devices oh, and to clarify on the "return 0", i think it's conceivable that if a dev

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-08 Thread Mike Frysinger
On Friday, March 04, 2011 05:09:53 Michal Simek wrote: > Mike Frysinger wrote: > >> 3. dev->init > >> return -1 - if init failed > >> return 0 - on success > > > > ok > > > >> (here you are saying should be return # of devices) > > > > no, i think you confused "initialize" with "init" in my feed

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-04 Thread Michal Simek
Mike Frysinger wrote: > also, you should change the "hang()" to "return 0" in the init func. Are you sure return 0 which should mean success. Anything different from 0 seems to me relevant. >>> as i said, the initialize function is not returning "success" or >>> "failure". it is retur

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-03 Thread Mike Frysinger
On Tuesday, March 01, 2011 04:29:21 Michal Simek wrote: > Mike Frysinger wrote: > > On Tuesday, March 01, 2011 03:34:38 Michal Simek wrote: > >> How does it look like phy lib u-boot support? > > > > i dont know what you mean ... how is phylib relevant to this ? or are > > you just asking in gener

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Michal Simek
Mike Frysinger wrote: > On Tuesday, March 01, 2011 03:34:38 Michal Simek wrote: >> Mike Frysinger wrote: >>> On Tuesday, March 01, 2011 03:00:47 Michal Simek wrote: If both functions should return 0 then any code should check it and all others drivers should be fixed. >>> i agree, but tha

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Mike Frysinger
On Tuesday, March 01, 2011 03:46:16 Michal Simek wrote: > Mike Frysinger wrote: > > On Tuesday, March 01, 2011 03:19:12 Michal Simek wrote: > +static void setup_mac(struct eth_device *dev) > +{ > +/* Set the MAC address */ > +int val = ((dev->enetaddr[3] << 24) |

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Mike Frysinger
On Tuesday, March 01, 2011 03:37:30 Michal Simek wrote: > Mike Frysinger wrote: > > On Monday, February 28, 2011 13:50:55 Michal Simek wrote: > >> Mike Frysinger wrote: > >>> On Monday, February 28, 2011 04:40:33 Michal Simek wrote: > +return 1; > >>> > >>> a bunch of these funcs retu

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Mike Frysinger
On Tuesday, March 01, 2011 03:34:38 Michal Simek wrote: > Mike Frysinger wrote: > > On Tuesday, March 01, 2011 03:00:47 Michal Simek wrote: > >> If both functions should return 0 then any code should check it and all > >> others drivers should be fixed. > > > > i agree, but that doesnt mean new co

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Michal Simek
Mike Frysinger wrote: > On Tuesday, March 01, 2011 03:19:12 Michal Simek wrote: +static void setup_mac(struct eth_device *dev) +{ + /* Set the MAC address */ + int val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) | + (dev->enetaddr[1] << 8) | (dev->enet

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Michal Simek
Mike Frysinger wrote: > On Monday, February 28, 2011 13:50:55 Michal Simek wrote: >> Mike Frysinger wrote: >>> On Monday, February 28, 2011 04:40:33 Michal Simek wrote: + return 1; >>> a bunch of these funcs return 1 when i'm pretty sure they should be 0 >> init function is called from eth.c:

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Michal Simek
Mike Frysinger wrote: > On Tuesday, March 01, 2011 03:00:47 Michal Simek wrote: >> If both functions should return 0 then any code should check it and all >> others drivers should be fixed. > > i agree, but that doesnt mean new code should knowingly be left broken I agree that make no sense do no

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Mike Frysinger
On Tuesday, March 01, 2011 03:19:12 Michal Simek wrote: > >> +static void setup_mac(struct eth_device *dev) > >> +{ > >> + /* Set the MAC address */ > >> + int val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) | > >> + (dev->enetaddr[1] << 8) | (dev->enetaddr[0])); > >> + out_b

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Michal Simek
>> +static void setup_mac(struct eth_device *dev) >> +{ >> +/* Set the MAC address */ >> +int val = ((dev->enetaddr[3] << 24) | (dev->enetaddr[2] << 16) | >> +(dev->enetaddr[1] << 8) | (dev->enetaddr[0])); >> +out_be32(dev->iobase + XAE_UAW0_OFFSET, val); >> + >> +val =

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Mike Frysinger
On Tuesday, March 01, 2011 03:00:47 Michal Simek wrote: > If both functions should return 0 then any code should check it and all > others drivers should be fixed. i agree, but that doesnt mean new code should knowingly be left broken > > the init func is a special beast -- it returns the # of de

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-03-01 Thread Michal Simek
Mike Frysinger wrote: > On Monday, February 28, 2011 13:50:55 Michal Simek wrote: >> Mike Frysinger wrote: >>> On Monday, February 28, 2011 04:40:33 Michal Simek wrote: + return 1; >>> a bunch of these funcs return 1 when i'm pretty sure they should be 0 >> init function is called from eth.c:

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-02-28 Thread Mike Frysinger
On Monday, February 28, 2011 13:50:55 Michal Simek wrote: > Mike Frysinger wrote: > > On Monday, February 28, 2011 04:40:33 Michal Simek wrote: > >> + return 1; > > > > a bunch of these funcs return 1 when i'm pretty sure they should be 0 > > init function is called from eth.c:eth_init(). From t

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-02-28 Thread Michal Simek
Mike Frysinger wrote: > On Monday, February 28, 2011 04:40:33 Michal Simek wrote: >> --- /dev/null >> +++ b/drivers/net/xilinx_axi_emac.c >> +static void axi_ethernet_init(struct eth_device *dev) >> +{ >> ... >> +u32 timeout = 200; >> +while (timeout && >> +(!(in_be32(dev->iobas

Re: [U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-02-28 Thread Mike Frysinger
On Monday, February 28, 2011 04:40:33 Michal Simek wrote: > --- /dev/null > +++ b/drivers/net/xilinx_axi_emac.c > +static void axi_ethernet_init(struct eth_device *dev) > +{ > ... > + u32 timeout = 200; > + while (timeout && > + (!(in_be32(dev->iobase + XAE_IS_OFFSET) & XAE_INT_

[U-Boot] [PATCH] net: axi_ethernet: Add driver to u-boot

2011-02-28 Thread Michal Simek
Add the first axi_ethernet driver for little-endian Microblaze. Signed-off-by: Michal Simek --- .../xilinx/microblaze-generic/microblaze-generic.c |4 + drivers/net/Makefile |1 + drivers/net/xilinx_axi_emac.c | 529