linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] mfd: db8500-prcmu: Fetch the PRCMU TCPM base address from Device Tree
Date: Mon, 25 Mar 2013 15:31:42 +0000	[thread overview]
Message-ID: <20130325153142.GD3568@gmail.com> (raw)
In-Reply-To: <1364223758-17621-3-git-send-email-lee.jones@linaro.org>

Sorry Sam, looks like I missed you on this one.

> A recent move to send the base addresses though the PRCMU platform
> device resource instead of defines found in <mach/*>, means that dbx500
> devices can no longer boot successfully when booting with Device Tree
> enabled. This patch ensures the addresses are obtained correctly from
> DT instead.
> 
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/db8500-prcmu.c |   21 +++++++++++++++------
>  1 file changed, 15 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
> index 8602bf8..a998edc 100644
> --- a/drivers/mfd/db8500-prcmu.c
> +++ b/drivers/mfd/db8500-prcmu.c
> @@ -3159,8 +3159,9 @@ static void db8500_prcmu_update_cpufreq(void)
>   */
>  static int db8500_prcmu_probe(struct platform_device *pdev)
>  {
> -	struct device_node *np = pdev->dev.of_node;
>  	struct prcmu_pdata *pdata = dev_get_platdata(&pdev->dev);
> +	struct device_node *np = pdev->dev.of_node;
> +	struct device_node *tcdm_np;
>  	int irq = 0, err = 0, i;
>  	struct resource *res;
>  
> @@ -3169,11 +3170,19 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
>  	dbx500_fw_version_init(pdev, pdata->version_offset, np);
>  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "prcmu-tcdm");
>  	if (!res) {
> -		dev_err(&pdev->dev, "no prcmu tcdm region provided\n");
> -		return -ENOENT;
> -	}
> -	tcdm_base = devm_ioremap(&pdev->dev, res->start,
> -			resource_size(res));
> +		if (np) {
> +			tcdm_np = of_find_node_by_name(np->parent,
> +						       "prcmu-tcdm-per4");
> +			if (!tcdm_np) {
> +				dev_err(&pdev->dev,
> +					"no prcmu tcdm region provided\n");
> +				return -ENOENT;
> +			}
> +			tcdm_base = of_iomap(tcdm_np, 0);
> +		}
> +	} else
> +		tcdm_base = devm_ioremap(&pdev->dev, res->start,
> +					 resource_size(res));
>  
>  	/* Clean up the mailbox interrupts after pre-kernel code. */
>  	writel(ALL_MBOX_BITS, PRCM_ARM_IT1_CLR);

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2013-03-25 15:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 15:02 [PATCH 1/3] ARM: ux500: Add device nodes for TCDM and TCPM memory locations Lee Jones
2013-03-25 15:02 ` [PATCH 2/3] mfd: db8500-prcmu: Fetch the PRCMU TCDM base address from Device Tree Lee Jones
2013-03-25 15:32   ` Lee Jones
2013-03-25 15:40   ` Arnd Bergmann
2013-03-25 16:46     ` Lee Jones
2013-03-25 21:32       ` Linus Walleij
2013-03-26  8:17         ` Lee Jones
2013-03-26  9:11           ` Linus Walleij
2013-03-26  9:48             ` Lee Jones
2013-03-26 10:00               ` Arnd Bergmann
2013-03-26 10:19                 ` Lee Jones
2013-03-25 15:02 ` [PATCH 3/3] mfd: db8500-prcmu: Fetch the PRCMU TCPM " Lee Jones
2013-03-25 15:31   ` Lee Jones [this message]

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=20130325153142.GD3568@gmail.com \
    --to=lee.jones@linaro.org \
    --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).