All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: H Hartley Sweeten <hartleys@visionengravers.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Vinod Koul <vinod.koul@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"ryan@bluewatersys.com" <ryan@bluewatersys.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	spi mailing list <spi-devel-general@lists.sourceforge.net>
Subject: Re: [PATCH 1/5] dmaengine: add ep93xx DMA support
Date: Fri, 27 May 2011 00:58:19 +0200	[thread overview]
Message-ID: <BANLkTimry2+rdp=9FA-fuhJLNfkcP3Db4w@mail.gmail.com> (raw)
In-Reply-To: <0D753D10438DA54287A00B027084269764D3319EC4@AUSP01VMBX24.collaborationhost.net>

2011/5/26 H Hartley Sweeten <hartleys@visionengravers.com>:

> I think the biggest hurdle with using the amba-pl022 driver is that the ep93xx
> spi peripheral does not have the registers with the pid and cid id's.  Without
> those I don't think the amba bus driver will be able to match the device to
> the driver.

This is not a problem. We have this code to dynamically create and
register a device with a specific periphid on ux500. It worked even
before my recent patches to amba's bus.c if you have only
zeroes in these registers:

struct amba_device *
dbx500_add_amba_device(const char *name, resource_size_t base,
                       int irq, void *pdata, unsigned int periphid)
{
        struct amba_device *dev;
        int ret;

        dev = kzalloc(sizeof *dev, GFP_KERNEL);
        if (!dev)
                return ERR_PTR(-ENOMEM);

        dev->dev.init_name = name;

        dev->res.start = base;
        dev->res.end = base + SZ_4K - 1;
        dev->res.flags = IORESOURCE_MEM;

        dev->dma_mask = DMA_BIT_MASK(32);
        dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);

        dev->irq[0] = irq;
        dev->irq[1] = NO_IRQ;

        dev->periphid = periphid;

        dev->dev.platform_data = pdata;

        ret = amba_device_register(dev, &iomem_resource);
        if (ret) {
                kfree(dev);
                return ERR_PTR(ret);
        }

        return dev;
}

I'd recommend coming up with some clever numbering scheme
with invented vendor ID.

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/5] dmaengine: add ep93xx DMA support
Date: Fri, 27 May 2011 00:58:19 +0200	[thread overview]
Message-ID: <BANLkTimry2+rdp=9FA-fuhJLNfkcP3Db4w@mail.gmail.com> (raw)
In-Reply-To: <0D753D10438DA54287A00B027084269764D3319EC4@AUSP01VMBX24.collaborationhost.net>

2011/5/26 H Hartley Sweeten <hartleys@visionengravers.com>:

> I think the biggest hurdle with using the amba-pl022 driver is that the ep93xx
> spi peripheral does not have the registers with the pid and cid id's. ?Without
> those I don't think the amba bus driver will be able to match the device to
> the driver.

This is not a problem. We have this code to dynamically create and
register a device with a specific periphid on ux500. It worked even
before my recent patches to amba's bus.c if you have only
zeroes in these registers:

struct amba_device *
dbx500_add_amba_device(const char *name, resource_size_t base,
                       int irq, void *pdata, unsigned int periphid)
{
        struct amba_device *dev;
        int ret;

        dev = kzalloc(sizeof *dev, GFP_KERNEL);
        if (!dev)
                return ERR_PTR(-ENOMEM);

        dev->dev.init_name = name;

        dev->res.start = base;
        dev->res.end = base + SZ_4K - 1;
        dev->res.flags = IORESOURCE_MEM;

        dev->dma_mask = DMA_BIT_MASK(32);
        dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);

        dev->irq[0] = irq;
        dev->irq[1] = NO_IRQ;

        dev->periphid = periphid;

        dev->dev.platform_data = pdata;

        ret = amba_device_register(dev, &iomem_resource);
        if (ret) {
                kfree(dev);
                return ERR_PTR(ret);
        }

        return dev;
}

I'd recommend coming up with some clever numbering scheme
with invented vendor ID.

Yours,
Linus Walleij

  parent reply	other threads:[~2011-05-26 22:58 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 17:03 [PATCH 0/5] ep93xx DMA patches Mika Westerberg
2011-05-22 17:03 ` Mika Westerberg
2011-05-22 17:03 ` [PATCH 1/5] dmaengine: add ep93xx DMA support Mika Westerberg
2011-05-22 17:03   ` Mika Westerberg
2011-05-25  8:00   ` Koul, Vinod
2011-05-25  8:00     ` Koul, Vinod
2011-05-25 19:00     ` Mika Westerberg
2011-05-25 19:00       ` Mika Westerberg
2011-05-26  4:38       ` Koul, Vinod
2011-05-26  4:38         ` Koul, Vinod
2011-05-26 18:15         ` Mika Westerberg
2011-05-26 18:15           ` Mika Westerberg
2011-05-26 18:42           ` H Hartley Sweeten
2011-05-26 18:42             ` H Hartley Sweeten
2011-05-25  8:39   ` Linus Walleij
2011-05-25  8:39     ` Linus Walleij
2011-05-25  8:19     ` Koul, Vinod
2011-05-25  8:19       ` Koul, Vinod
2011-05-25  9:09       ` Linus Walleij
2011-05-25  9:09         ` Linus Walleij
2011-05-25 19:54     ` Mika Westerberg
2011-05-25 19:54       ` Mika Westerberg
2011-05-25 20:47       ` Linus Walleij
2011-05-25 20:47         ` Linus Walleij
2011-05-26  4:33         ` Mika Westerberg
2011-05-26  4:33           ` Mika Westerberg
2011-05-26  5:26           ` Ryan Mallon
2011-05-26  5:26             ` Ryan Mallon
2011-05-26  7:15           ` Linus Walleij
2011-05-26  7:15             ` Linus Walleij
2011-05-26 18:38             ` Mika Westerberg
2011-05-26 18:38               ` Mika Westerberg
2011-05-26 18:48               ` H Hartley Sweeten
2011-05-26 18:48                 ` H Hartley Sweeten
2011-05-26 18:48                 ` H Hartley Sweeten
2011-05-26 21:53                 ` Russell King - ARM Linux
2011-05-26 21:53                   ` Russell King - ARM Linux
2011-05-26 21:53                   ` Russell King - ARM Linux
2011-05-26 22:58                 ` Linus Walleij [this message]
2011-05-26 22:58                   ` Linus Walleij
2011-05-26 22:58                   ` Linus Walleij
2011-05-27  1:38   ` H Hartley Sweeten
2011-05-27  1:38     ` H Hartley Sweeten
2011-05-28 10:33     ` Mika Westerberg
2011-05-28 10:33       ` Mika Westerberg
2011-05-22 17:03 ` [PATCH 2/5] ep93xx: add dmaengine platform code Mika Westerberg
2011-05-22 17:03   ` Mika Westerberg
2011-05-27  1:44   ` H Hartley Sweeten
2011-05-27  1:44     ` H Hartley Sweeten
2011-05-22 17:03 ` [PATCH 3/5] ASoC: ep93xx: convert to use the DMA engine API Mika Westerberg
2011-05-22 17:03   ` Mika Westerberg
2011-05-23  5:11   ` Mark Brown
2011-05-23  5:11     ` Mark Brown
2011-05-23  9:38     ` Liam Girdwood
2011-05-23  9:38       ` Liam Girdwood
2011-05-27  1:43   ` H Hartley Sweeten
2011-05-27  1:43     ` H Hartley Sweeten
2011-05-22 17:03 ` [PATCH 4/5] ep93xx: remove the old M2P DMA code Mika Westerberg
2011-05-22 17:03   ` Mika Westerberg
2011-05-27  1:42   ` H Hartley Sweeten
2011-05-27  1:42     ` H Hartley Sweeten
2011-05-22 17:03 ` [PATCH 5/5] spi/ep93xx: add DMA support Mika Westerberg
2011-05-22 17:03   ` Mika Westerberg
2011-05-27  1:47   ` H Hartley Sweeten
2011-05-27  1:47     ` H Hartley Sweeten
2011-05-23 17:34 ` [PATCH 0/5] ep93xx DMA patches H Hartley Sweeten
2011-05-23 17:34   ` H Hartley Sweeten
2011-05-23 20:10 ` Ryan Mallon
2011-05-23 20:10   ` Ryan Mallon
2011-05-24 14:42   ` Mika Westerberg
2011-05-24 14:42     ` Mika Westerberg

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='BANLkTimry2+rdp=9FA-fuhJLNfkcP3Db4w@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=dan.j.williams@intel.com \
    --cc=grant.likely@secretlab.ca \
    --cc=hartleys@visionengravers.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@iki.fi \
    --cc=ryan@bluewatersys.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=vinod.koul@intel.com \
    /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.