netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@secretlab.ca>
To: gfilip@ee.ethz.ch
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 2/5] temac: dma init for Virtex4
Date: Mon, 22 Feb 2010 15:23:40 -0700	[thread overview]
Message-ID: <fa686aa41002221423g74349c60k7602f47b9e946018@mail.gmail.com> (raw)
In-Reply-To: <1266865621-28955-2-git-send-email-gfilip@ee.ethz.ch>

On Mon, Feb 22, 2010 at 12:06 PM,  <gfilip@ee.ethz.ch> wrote:
> This patch belongs to a set of patches which extends the temac driver to support Virtex4-FX. It was successfully tested on the ML403 evaluation board.
>
> Signed-off-by: Filip Gospodinov <gfilip@ee.ethz.ch>
> ---
>  drivers/net/ll_temac.h      |    4 ++++
>  drivers/net/ll_temac_main.c |   17 ++++++++++++++++-
>  2 files changed, 20 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ll_temac.h b/drivers/net/ll_temac.h
> index 95dd650..51824a8 100644
> --- a/drivers/net/ll_temac.h
> +++ b/drivers/net/ll_temac.h
> @@ -383,7 +383,11 @@ struct temac_local {
>
>        /* IO registers and IRQs */
>        void __iomem *regs;
> +#ifdef CONFIG_XILINX_VIRTEX_4_FX
> +       void __iomem *dma_regs;
> +#else
>        dcr_host_t sdma_dcrs;
> +#endif

Hi Filip,

Rather than using a CONFIG symbol to select between MMIO and DCR
modes, you should look at how this patch implemented it:

http://www.gossamer-threads.com/lists/linux/kernel/1184834?page=last

John Tyner's approach is pretty good, but it needs a bit more work
before merging and he is no longer working on a virtex platform so he
isn't planning to finish it.  Basically, there is no reason for the
driver to have to choose at compile time whether DCR or MMIO will be
used.

g.

>        int tx_irq;
>        int rx_irq;
>        int emac_num;
> diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
> index a8522bd..0d4b1c5 100644
> --- a/drivers/net/ll_temac_main.c
> +++ b/drivers/net/ll_temac_main.c
> @@ -812,7 +812,6 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
>        struct net_device *ndev;
>        const void *addr;
>        int size, rc = 0;
> -       unsigned int dcrs;
>
>        /* Init network device structure */
>        ndev = alloc_etherdev(sizeof(*lp));
> @@ -862,6 +861,21 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
>                goto nodev;
>        }
>
> +#ifdef CONFIG_XILINX_VIRTEX_4_FX
> +       unsigned int ds;
> +       const u32 *dr = of_get_property(np, "reg", &ds);
> +       if (dr == NULL || ds & 1 || 0 >= ds ) {
> +               dev_err(&op->dev, "could not get DMA register address\n");
> +               goto nodev;
> +       }
> +       lp->dma_regs = (u32) ioremap(*dr, 4096);
> +       if (!lp->dma_regs) {
> +               dev_err(&op->dev, "could not get DMA virtual address\n");
> +               goto nodev;
> +       }
> +       dev_dbg(&op->dev, "DMA base: %x\n", lp->dma_regs);
> +#else  /*CONFIG_XILINX_VIRTEX_4_FX*/
> +       unsigned int dcrs;
>        dcrs = dcr_resource_start(np, 0);
>        if (dcrs == 0) {
>                dev_err(&op->dev, "could not get DMA register address\n");
> @@ -869,6 +883,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
>        }
>        lp->sdma_dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
>        dev_dbg(&op->dev, "DCR base: %x\n", dcrs);
> +#endif /*CONFIG_XILINX_VIRTEX_4_FX*/'
>
>        lp->rx_irq = irq_of_parse_and_map(np, 0);
>        lp->tx_irq = irq_of_parse_and_map(np, 1);
> --
> 1.6.4.4
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  parent reply	other threads:[~2010-02-22 22:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 19:06 [PATCH 1/5] temac: Add Virtex4 address mappings gfilip
2010-02-22 19:06 ` [PATCH 2/5] temac: dma init for Virtex4 gfilip
2010-02-22 19:06   ` [PATCH 3/5] temac: dma deinit gfilip
2010-02-22 19:07     ` [PATCH 4/5] temac: dma MMIO for Virtex4 gfilip
2010-02-22 19:07       ` [PATCH 5/5] temac: add missing mask gfilip
2010-02-22 22:25         ` Grant Likely
2010-02-22 22:23   ` Grant Likely [this message]
2010-02-22 22:10 ` [PATCH 1/5] temac: Add Virtex4 address mappings Grant Likely

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=fa686aa41002221423g74349c60k7602f47b9e946018@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=gfilip@ee.ethz.ch \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).