public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/8] net: asix: fix operation without eeprom
Date: Thu, 2 Jul 2015 20:39:05 +0200	[thread overview]
Message-ID: <201507022039.05618.marex@denx.de> (raw)
In-Reply-To: <F6A12672-7638-4702-951A-DC9983BFCE1A@ziswiler.com>

On Thursday, July 02, 2015 at 08:12:32 AM, Marcel Ziswiler wrote:
> On 2 July 2015 07:50:59 CEST, Marek Vasut <marex@denx.de> wrote:
> >On Thursday, July 02, 2015 at 01:04:47 AM, Marcel Ziswiler wrote:
> >
> >Hi!

Hi!

> >[...]
> >
> >> @@ -64,8 +67,14 @@
> >> 
> >>  	 AX_MEDIUM_AC | AX_MEDIUM_RE)
> >>  
> >>  /* AX88772 & AX88178 RX_CTL values */
> >> 
> >> +#define AX_RX_CTL_RH2M			0x0200	/* Enable IP header in
> >
> >receive
> >
> >> +						   buffer aligned on 32-bit
> >> +						   boundary */
> >
> >The comments need a bit of polishing, though it is not the main problem
> >I have
> >with this patch.
> 
> I was hesitant at first but then decided to submit it anyway to get some
> feedback on the thematic. So thank you very much!

No worries :)

> >The multiline comments should be like this according
> >to kernel
> >coding style (to my knowledge):
> >
> >/*
> >
> > * foo
> > * bar
> > * baz
> > */
> 
> Yeah, sorry. My bad. I since got educated in doing this but stumble over it
> at times on older patches.

Yeah, the code in certain areas of U-Boot isn't the pinacle of coding style
excellence for sure.

> >> +#define AX_RX_CTL_RH1M			0x0100	/* Enable RX-Header mode
> >
> >0 */
> >
> >>  #define AX_RX_CTL_SO			0x0080
> >>  #define AX_RX_CTL_AB			0x0008
> >> 
> >> +#define AX_RX_HEADER_DEFAULT		(AX_RX_CTL_RH1M | \
> >> +					 AX_RX_CTL_RH2M)
> >> 
> >>  #define AX_DEFAULT_RX_CTL	\
> >>  
> >>  	(AX_RX_CTL_SO | AX_RX_CTL_AB)
> >> 
> >> @@ -426,7 +435,15 @@ static int asix_init(struct eth_device *eth,
> >
> >bd_t *bd)
> >
> >>  	debug("** %s()\n", __func__);
> >> 
> >> -	if (asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL) < 0)
> >> +	if ((dev->pusb_dev->descriptor.idVendor == 0x0b95) &&
> >> +	    (dev->pusb_dev->descriptor.idProduct == 0x772b)) {
> >
> >I don't like hardcoding these constants here (and further down).
> >I understand that those are AX88792B chips (or whatever the number
> >is, there's a B at the end and they're not exactly compatible with
> >the original AX88792), but what about making this a bit more generic?
> 
> AX88772B actually and yes there seem to be C variants of that same chip out
> now as well but we haven't gotten our hands on any such yet. I just do
> remember that ASIX does not take backwards compatibility too serious.

Yeah, that I can confirm this.

> >What I expect is that when AX88792C comes, we'd just add another
> >if (idVendor == ... ) into this code here with another magic number
> >and it will become an unmaintainable horror.
> 
> Understood.
> 
> >Maybe add a function which handles quirks of each revision (B, C, ...)
> >of the ASIX chip and definitelly define those magic numbers as macros.
> 
> Agreed.

OK, thanks! :-)

[...]

  reply	other threads:[~2015-07-02 18:39 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-01 23:04 [U-Boot] [PATCH 0/8] assortment of fixes/enhancements Marcel Ziswiler
2015-07-01 23:04 ` [U-Boot] [PATCH 1/8] fs/fs.c: read up to EOF when len would read past EOF Marcel Ziswiler
2015-07-02  5:46   ` Marek Vasut
2015-07-02  6:01     ` Marcel Ziswiler
2015-07-01 23:04 ` [U-Boot] [PATCH 2/8] net: asix: fix operation without eeprom Marcel Ziswiler
2015-07-02  5:50   ` Marek Vasut
2015-07-02  6:12     ` Marcel Ziswiler
2015-07-02 18:39       ` Marek Vasut [this message]
2015-07-08  3:55   ` Joe Hershberger
2015-07-08  6:39     ` Marcel Ziswiler
2015-07-01 23:04 ` [U-Boot] [PATCH 3/8] generic-board: allow showing custom board info Marcel Ziswiler
2015-07-03  3:27   ` Simon Glass
2015-07-01 23:04 ` [U-Boot] [PATCH 4/8] logos: add Toradex logo Marcel Ziswiler
2015-07-01 23:04 ` [U-Boot] [PATCH 5/8] colibri_vf: remove spurious new line Marcel Ziswiler
2015-07-02  5:52   ` Marek Vasut
2015-07-01 23:04 ` [U-Boot] [PATCH 6/8] image-fdt.c: store returned error value Marcel Ziswiler
2015-07-02  5:52   ` Marek Vasut
2015-07-03  3:21     ` Simon Glass
2015-07-01 23:04 ` [U-Boot] [PATCH 7/8] mtd/nand/ubi: assortment of alignment fixes Marcel Ziswiler
2015-07-02  5:53   ` Marek Vasut
2015-07-02 21:35     ` Scott Wood
2015-07-03 13:44       ` Marek Vasut
2015-07-06 21:25         ` Scott Wood
2015-07-06 21:45           ` Marek Vasut
2015-07-06 21:50             ` Scott Wood
2015-07-06 21:57               ` Marek Vasut
2015-07-01 23:04 ` [U-Boot] [PATCH 8/8] tftp.c: fix CONFIG_TFTP_TSIZE for small files Marcel Ziswiler
2015-07-02  5:54   ` Marek Vasut

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=201507022039.05618.marex@denx.de \
    --to=marex@denx.de \
    --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