linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: imx: add dt support of IRAM
Date: Tue, 27 Dec 2011 10:54:54 -0600	[thread overview]
Message-ID: <4EF9F85E.5020203@gmail.com> (raw)
In-Reply-To: <1324949596-27214-1-git-send-email-jason.chen@linaro.org>

On 12/26/2011 07:33 PM, Jason Chen wrote:
> Signed-off-by: Jason Chen <jason.chen@linaro.org>
> Signed-off-by: Eric Miao <eric.miao@linaro.org>
> ---
>  arch/arm/plat-mxc/include/mach/iram.h |    6 ++++++
>  arch/arm/plat-mxc/iram_alloc.c        |   16 ++++++++++++++++
>  2 files changed, 22 insertions(+), 0 deletions(-)
> 

Whatever happened to the generic SRAM support? That with a common DT
binding and init would be better.

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-May/051472.html

Rob

> diff --git a/arch/arm/plat-mxc/include/mach/iram.h b/arch/arm/plat-mxc/include/mach/iram.h
> index 022690c..f8372cf 100644
> --- a/arch/arm/plat-mxc/include/mach/iram.h
> +++ b/arch/arm/plat-mxc/include/mach/iram.h
> @@ -21,6 +21,7 @@
>  #ifdef CONFIG_IRAM_ALLOC
>  
>  int __init iram_init(unsigned long base, unsigned long size);
> +int __init of_iram_init(void);
>  void __iomem *iram_alloc(unsigned int size, unsigned long *dma_addr);
>  void iram_free(unsigned long dma_addr, unsigned int size);
>  
> @@ -31,6 +32,11 @@ static inline int __init iram_init(unsigned long base, unsigned long size)
>  	return -ENOMEM;
>  }
>  
> +static inline int __init of_iram_init(void)
> +{
> +	return -EINVAL;
> +}
> +
>  static inline void __iomem *iram_alloc(unsigned int size, unsigned long *dma_addr)
>  {
>  	return NULL;
> diff --git a/arch/arm/plat-mxc/iram_alloc.c b/arch/arm/plat-mxc/iram_alloc.c
> index 074c386..f73ca9d 100644
> --- a/arch/arm/plat-mxc/iram_alloc.c
> +++ b/arch/arm/plat-mxc/iram_alloc.c
> @@ -22,6 +22,8 @@
>  #include <linux/module.h>
>  #include <linux/spinlock.h>
>  #include <linux/genalloc.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
>  #include <mach/iram.h>
>  
>  static unsigned long iram_phys_base;
> @@ -71,3 +73,17 @@ int __init iram_init(unsigned long base, unsigned long size)
>  	pr_debug("i.MX IRAM pool: %ld KB at 0x%p\n", size / 1024, iram_virt_base);
>  	return 0;
>  }
> +
> +int __init of_iram_init(void)
> +{
> +	struct device_node *np;
> +	struct resource res;
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,imx-iram");
> +	if (of_address_to_resource(np, 0, &res))
> +		return -EINVAL;
> +	if (res.start && (res.end > res.start))
> +		return iram_init(res.start, res.end - res.start + 1);
> +	else
> +		return -EINVAL;
> +}

  parent reply	other threads:[~2011-12-27 16:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-27  1:33 [PATCH 1/2] ARM: imx: add dt support of IRAM Jason Chen
2011-12-27  7:02 ` Shawn Guo
2011-12-27 16:54 ` Rob Herring [this message]
2011-12-28  6:27   ` Shawn Guo
2011-12-28 12:23   ` Eric Miao

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=4EF9F85E.5020203@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).