devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 2/2] dmaengine: imx-sdma: add device tree probe support
Date: Fri, 15 Jul 2011 09:32:50 +0200	[thread overview]
Message-ID: <20110715073250.GH6069@pengutronix.de> (raw)
In-Reply-To: <20110715025413.GJ2927-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>

On Thu, Jul 14, 2011 at 08:54:13PM -0600, Grant Likely wrote:
> On Fri, Jul 15, 2011 at 12:14:17AM +0800, Shawn Guo wrote:
> > It adds device tree probe support for imx-sdma driver.
> > 
> > Signed-off-by: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > Cc: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
> > Cc: Vinod Koul <vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> > Cc: Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > ---
> >  .../devicetree/bindings/dma/fsl-imx-sdma.txt       |   55 ++++++++++++++++++++
> >  drivers/dma/imx-sdma.c                             |   29 +++++++++-
> >  2 files changed, 81 insertions(+), 3 deletions(-)
> >  create mode 100644 Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> > 
> > diff --git a/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> > new file mode 100644
> > index 0000000..71f4525
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt
> > @@ -0,0 +1,55 @@
> > +* Freescale Smart Direct Memory Access (SDMA) Controller for i.MX
> > +
> > +Required properties:
> > +- compatible : Should be "fsl,<chip>-sdma"
> > +- reg : Should contain SDMA registers location and length
> > +- interrupts : Should contain SDMA interrupt
> > +- fsl,sdma-script-name : Should contain the full path of SDMA RAM scripts
> > +  firmware
> > +- fsl,sdma-script-address : Should be an array giving entry address for each
> > +  script.  The address should be 0 in case that the specified script is not
> > +  included in the firmware.  See example below for the array details.
> > +
> > +Examples:
> > +
> > +sdma@83fb0000 {
> > +	compatible = "fsl,imx51-sdma", "fsl,imx35-sdma";
> > +	reg = <0x83fb0000 0x4000>;
> > +	interrupts = <6>;
> > +	fsl,sdma-script-name = "sdma-imx51.bin";
> > +	fsl,sdma-script-address = <642>,	/* ap_2_ap */
> > +				  <0>,		/* ap_2_bp */
> > +				  <0>,		/* ap_2_ap_fixed */
> > +				  <0>,		/* bp_2_ap */
> > +				  <0>,		/* loopback_on_dsp_side */
> > +				  <0>,		/* mcu_interrupt_only */
> > +				  <0>,		/* firi_2_per */
> > +				  <0>,		/* firi_2_mcu */
> > +				  <0>,		/* per_2_firi */
> > +				  <0>,		/* mcu_2_firi */
> > +				  <0>,		/* uart_2_per */
> > +				  <817>,	/* uart_2_mcu */
> > +				  <0>,		/* per_2_app */
> > +				  <747>,	/* mcu_2_app */
> > +				  <0>,		/* per_2_per */
> > +				  <0>,		/* uartsh_2_per */
> > +				  <0>,		/* uartsh_2_mcu */
> > +				  <0>,		/* per_2_shp */
> > +				  <961>,	/* mcu_2_shp */
> > +				  <1473>,	/* ata_2_mcu */
> > +				  <1392>,	/* mcu_2_ata */
> > +				  <1033>,	/* app_2_per */
> > +				  <683>,	/* app_2_mcu */
> > +				  <1251>,	/* shp_2_per */
> > +				  <892>,	/* shp_2_mcu */
> > +				  <0>,		/* mshc_2_mcu */
> > +				  <0>,		/* mcu_2_mshc */
> > +				  <0>,		/* spdif_2_mcu */
> > +				  <0>,		/* mcu_2_spdif */
> > +				  <0>,		/* asrc_2_mcu */
> > +				  <0>,		/* ext_mem_2_ipu */
> > +				  <0>,		/* descrambler */
> > +				  <0>,		/* dptc_dvfs */
> > +				  <0>,		/* utra_addr */
> > +				  <0>;		/* ram_code_start */
> 
> This looks icky.  Where do these numbers come from?  How are the
> offsets loaded into ram?  Are they properties of the firmware blob?
> If so, then maybe they should be embedded in the firmware blob instead
> of encoded in a DT that may become out of sync.

They are embedded in the firmware blob already and the current dma
driver uses these values to initialize the script addresses.

The SDMA firmware is split into two parts, one in an internal ROM
and one in RAM. So it's possible to run the SDMA engine (with limited
functionality) without an external firmware blob. The ROM addresses are currently contained
in platform_data. Don't know if it makes sense to move them to the
device tree though.

(That said, the current implementation of the SDMA driver does not
work without external firmware, but this is a software issue only)

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  parent reply	other threads:[~2011-07-15  7:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 16:14 [PATCH 0/2] Add device tree probe for imx-sdma driver Shawn Guo
     [not found] ` <1310660057-17953-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-14 16:14   ` [PATCH 1/2] dmaengine: imx-sdma: use platform_device_id to identify sdma version Shawn Guo
     [not found]     ` <1310660057-17953-2-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-15  2:54       ` Grant Likely
2011-07-15  8:01       ` Sascha Hauer
2011-07-15  8:22         ` Shawn Guo
     [not found]           ` <20110715082204.GD1840-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-07-15  8:25             ` Sascha Hauer
2011-07-14 16:14   ` [PATCH 2/2] dmaengine: imx-sdma: add device tree probe support Shawn Guo
     [not found]     ` <1310660057-17953-3-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-07-15  2:54       ` Grant Likely
     [not found]         ` <20110715025413.GJ2927-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-07-15  7:32           ` Sascha Hauer [this message]
     [not found]             ` <20110715073250.GH6069-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-07-15  7:55               ` Shawn Guo

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=20110715073250.GH6069@pengutronix.de \
    --to=s.hauer-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=vinod.koul-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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).