mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-kernel@vger.kernel.org,
	Linus Walleij <linus.ml.walleij@gmail.com>,
	Dan Williams <dan.j.williams@intel.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3 v2] dmaengine: Add Freescale i.MX SDMA support
Date: Tue, 24 Aug 2010 09:58:53 +0200	[thread overview]
Message-ID: <19571.31677.407213.580581@ipc1.ka-ro> (raw)
In-Reply-To: <20100823125704.GU27749@pengutronix.de>

Hi,

> This patch adds support for the Freescale i.MX SDMA engine.
> 
> The SDMA engine is a scatter/gather DMA engine which is implemented
> as a seperate coprocessor. SDMA needs its own firmware which is
> requested using the standard request_firmware mechanism. The firmware
> has different entry points for each peripheral type, so drivers
> have to pass the peripheral type to the DMA engine which in turn
> picks the correct firmware entry point from a table contained in
> the firmware image itself.
> The original Freescale code also supports support for transfering
> data to the internal SRAM which needs different entry points to
> the firmware. Support for this is currently not implemented. Also,
> support for the ASRC (asymmetric sample rate converter) is skipped.
> 
> I took a very simple approach to implement dmaengine support. Only
> a single descriptor is statically assigned to a each channel. This
> means that transfers can't be queued up but only a single transfer
> is in progress. This simplifies implementation a lot and is sufficient
> for the usual device/memory transfers.
> 
> Changes since v1:
> 
[...]
> +static int __devinit sdma_probe(struct platform_device *pdev)
>
__devinit/__devexit is for hot-pluggable devices. I don't think the
SDMA controller is hot-pluggable, so __init/__exit could be used here.

> +{
> +	int ret;
> +	const struct firmware *fw;
> +	const struct sdma_firmware_header *header;
> +	const struct sdma_script_start_addrs *addr;
> +	int irq;
> +	unsigned short *ram_code;
> +	struct resource *iores;
> +	struct sdma_platform_data *pdata = pdev->dev.platform_data;
> +	char *fwname;
> +	int i;
> +	dma_cap_mask_t mask;
> +	struct sdma_engine *sdma;
> +
> +	sdma = kzalloc(sizeof(*sdma), GFP_KERNEL);
> +	if (!sdma)
> +		return -ENOMEM;
> +
> +	sdma->dev = &pdev->dev;
> +
> +	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	irq = platform_get_irq(pdev, 0);
> +	if (!iores || irq < 0 || !pdata) {
> +		ret = -EINVAL;
> +		goto err_irq;
> +	}
> +
> +	sdma->clk = clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(sdma->clk)) {
> +		ret = PTR_ERR(sdma->clk);
> +		goto err_clk;
> +	}
> +
request_mem_region()?
> +	sdma->regs = ioremap(iores->start, resource_size(iores));
> +	if (!sdma->regs) {
> +		ret = -ENOMEM;
> +		goto err_ioremap;
> +	}
> +
> +

> +static int __devexit sdma_remove(struct platform_device *pdev)
>
see above.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

  parent reply	other threads:[~2010-08-24  7:58 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-16 11:07 [RFC] dmaengine: assorted patches and Freescale " Sascha Hauer
2010-08-16 11:07 ` [PATCH 1/3] dmaengine: add possibility for cyclic transfers Sascha Hauer
2010-08-16 11:56   ` Lothar Waßmann
2010-08-16 12:27     ` Linus Walleij
2010-08-16 12:32     ` Sascha Hauer
2010-08-16 12:22   ` Linus Walleij
2010-09-20 13:01   ` Sascha Hauer
2010-09-23 19:42     ` Dan Williams
2010-09-24  7:25       ` Sascha Hauer
2010-08-16 11:07 ` [PATCH 2/3] dmaengine: add wrapper functions for dmaengine Sascha Hauer
2010-08-23  7:17   ` Sascha Hauer
2010-09-20 13:02   ` Sascha Hauer
2010-09-23 19:53   ` Dan Williams
2010-09-24  7:25     ` Sascha Hauer
2010-09-24 15:45       ` Dan Williams
2010-08-16 11:07 ` [PATCH 3/3] dmaengine: Add Freescale i.MX SDMA support Sascha Hauer
2010-08-16 12:21   ` Linus Walleij
2010-08-16 14:15     ` Sascha Hauer
2010-08-17  4:36       ` Baruch Siach
2010-08-17  6:47         ` Sascha Hauer
2010-08-18 11:17           ` Philippe Rétornaz
2010-08-24  7:10     ` [PATCH 3/3 v3] " Sascha Hauer
2010-09-02 14:06     ` [PATCH 3/3] " Russell King - ARM Linux
2010-08-23 12:57   ` [PATCH 3/3 v2] " Sascha Hauer
2010-08-23 17:30     ` Linus Walleij
2010-08-24  6:58       ` Sascha Hauer
2010-08-23 17:48     ` Uwe Kleine-König
2010-08-28 15:18       ` Linus Walleij
2010-08-28 15:27         ` Marek Vasut
2010-08-28 16:18           ` Sascha Hauer
2010-08-28 16:30             ` Marek Vasut
2010-08-28 17:20               ` Sascha Hauer
2010-09-02 11:20               ` Russell King - ARM Linux
2010-08-29 12:35             ` Linus Walleij
2010-08-30 12:55               ` Sascha Hauer
2010-08-24  7:58     ` Lothar Waßmann [this message]
2010-08-24 15:01       ` Linus Walleij
2010-08-27 12:22   ` [PATCH 3/3 v3] " Sascha Hauer

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=19571.31677.407213.580581@ipc1.ka-ro \
    --to=lw@karo-electronics.de \
    --cc=dan.j.williams@intel.com \
    --cc=linus.ml.walleij@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.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

all inboxes | Powered by JetHome®