From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] net: axi_ethernet: Add driver to u-boot
Date: Fri, 02 Sep 2011 11:02:04 +0200 [thread overview]
Message-ID: <4E609B8C.8060708@monstr.eu> (raw)
In-Reply-To: <20110901131718.B6D9D166C886@gemini.denx.de>
Dear Wolfgang Denk,
Wolfgang Denk wrote:
> Dear Michal Simek,
>
> In message <1314877154-14536-2-git-send-email-monstr@monstr.eu> you wrote:
>> Add axi_ethernet driver for little-endian Microblaze.
>>
>> RX/TX BDs and rxframe buffer are shared among all axi_ethernet MACs.
>> Only one MAC can work in one time.
>>
>> Signed-off-by: Michal Simek <monstr@monstr.eu>
>
>> +/* Mask used to verify certain PHY features (or register contents)
>> + * in the register above:
>> + * 0x1000: 10Mbps full duplex support
>> + * 0x0800: 10Mbps half duplex support
>> + * 0x0008: Auto-negotiation support
>> + */
>
> Incorrect multiline comment style. Please fix globally.
Fixed.
>
>
>> + u32 timeout = 200;
>> + /* Wait till MDIO interface is ready to accept a new transaction. */
>> + while (timeout && (!(in_be32(®s->mdio_mcr)
>> + & XAE_MDIO_MCR_READY_MASK)))
>> + timeout--;
>
> Multiline statement - braches needed.
>
> Also, add some udelay() or similar to have a defined length of the
> timeout. Please fix globally.
Fixed.
>
>
>> +/* STOP DMA transfers */
>> +static void axiemac_halt(struct eth_device *dev)
>> +{
>> + struct axidma_priv *priv = dev->priv;
>> +
>> + /* Stop the hardware */
>> + priv->dmatx->control &= ~XAXIDMA_CR_RUNSTOP_MASK;
>> + priv->dmarx->control &= ~XAXIDMA_CR_RUNSTOP_MASK;
>
> Please ALWAYS use I/O accessors to access device registers. Please
> fix globally.
Done
>
>> +static int IsRxReady(struct eth_device *dev)
>
> As requested before: Please get rid of these CamelCaps identifiers!!!
Fixed this.
>
>
>> +static int axiemac_miiphy_read(const char *devname, uchar addr,
>> + uchar reg, ushort *val)
>> +{
>> + struct eth_device *dev = eth_get_dev();
>> + *val = phyread(dev, addr, reg);
>> + debug("axiemac: Read MII 0x%x, 0x%x, 0x%x\n", addr, reg, *val);
>> + return 0;
>
> Please separate declarations and code by a single blank line. Please
> fix globally.
Done
>
>
> Why does this function return int when you uncondsitionally always
> return 0 only?
I have fixed phywrite/phyread functions.
>
>> +}
>> +
>> +static int axiemac_miiphy_write(const char *devname, uchar addr,
>> + uchar reg, ushort val)
>> +{
>> + struct eth_device *dev = eth_get_dev();
>> + debug("axiemac: Write MII 0x%x, 0x%x, 0x%x\n", addr, reg, val);
>> + phywrite(dev, addr, reg, val);
>> + return 0;
>> +}
>
> Ditto.
>
>> +static int axiemac_bus_reset(struct mii_dev *bus)
>> +{
>> + debug("axiemac: Bus reset\n");
>> + return 0;
>> +}
>
> Ditto.
Because of miiphyutil code requires to return 0 and I am not aware about
doing anything useful for bus_reset.
Regards,
Michal
--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
next prev parent reply other threads:[~2011-09-02 9:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 11:39 [U-Boot] [PATCH v3] net: ll_temac: Add LL TEMAC driver to u-boot Michal Simek
2011-09-01 11:39 ` [U-Boot] [PATCH v2] net: axi_ethernet: Add " Michal Simek
2011-09-01 13:17 ` Wolfgang Denk
2011-09-02 9:02 ` Michal Simek [this message]
2011-09-01 13:06 ` [U-Boot] [PATCH v3] net: ll_temac: Add LL TEMAC " Wolfgang Denk
2011-09-01 13:17 ` Michal Simek
2011-09-01 14:09 ` Wolfgang Denk
2011-09-02 6:39 ` Michal Simek
2011-09-02 8:19 ` Wolfgang Denk
2011-09-02 8:40 ` Michal Simek
2011-09-02 9:24 ` Wolfgang Denk
2011-09-02 10:38 ` Michal Simek
2011-09-02 12:53 ` Wolfgang Denk
2011-09-02 13:29 ` Michal Simek
2011-09-02 14:08 ` Wolfgang Denk
2011-09-05 7:15 ` Michal Simek
2011-09-05 8:00 ` 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=4E609B8C.8060708@monstr.eu \
--to=monstr@monstr.eu \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.