From: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Maxime Ripard
<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Cc: linux-PelNFVqkFnVyf+4FbqDuWQ@public.gmane.org,
Nicolas Ferre
<nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
Jean-Christophe Plagniol-Villard
<plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org>,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
Boris Brezillon
<boris-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
Thomas Petazzoni
<thomas-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 04/18] AT91: Rework ramc mapping code
Date: Mon, 7 Jul 2014 16:59:51 +0200 [thread overview]
Message-ID: <20140707145951.GD3113@piout.net> (raw)
In-Reply-To: <1404743131-24569-5-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
On 07/07/2014 at 16:25:17 +0200, Maxime Ripard wrote :
> Adapt the ramc mapping code to handle multiple ram controllers in the DT.
>
> Signed-off-by: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
> arch/arm/mach-at91/setup.c | 26 ++++++++++++++------------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
I believe you also need to update the documentation in
Documentation/devicetree/bindings/arm/atmel-at91.txt
> diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
> index 9c4c7fb323fb..cc520596f23b 100644
> --- a/arch/arm/mach-at91/setup.c
> +++ b/arch/arm/mach-at91/setup.c
> @@ -393,24 +393,26 @@ static void at91_dt_ramc(void)
> {
> struct device_node *np;
> const struct of_device_id *of_id;
> + int idx = 0;
>
> - np = of_find_matching_node(NULL, ramc_ids);
> - if (!np)
> - panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
> + for_each_matching_node(np, ramc_ids) {
> + at91_ramc_base[idx] = of_iomap(np, 0);
> + if (!at91_ramc_base[idx])
> + panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx);
>
> - at91_ramc_base[0] = of_iomap(np, 0);
> - if (!at91_ramc_base[0])
> - panic(pr_fmt("unable to map ramc[0] cpu registers\n"));
> - /* the controller may have 2 banks */
> - at91_ramc_base[1] = of_iomap(np, 1);
> + idx++;
> + }
> +
> + if (!idx)
> + panic(pr_fmt("unable to find compatible ram controller node in dtb\n"));
>
> of_id = of_match_node(ramc_ids, np);
> - if (!of_id)
> + if (!of_id) {
> pr_warn("ramc no standby function available\n");
> - else
> - at91_pm_set_standby(of_id->data);
> + return;
> + }
>
> - of_node_put(np);
> + at91_pm_set_standby(of_id->data);
> }
>
> static struct of_device_id shdwc_ids[] = {
> --
> 2.0.1
>
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-07-07 14:59 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 14:25 [PATCH v2 00/18] AT91: cleanup of the reset and poweroff code Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 02/18] AT91: setup: Switch to pr_fmt Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 03/18] AT91: G45: DT: Declare a second ram controller Maxime Ripard
[not found] ` <1404743131-24569-4-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-07-07 14:57 ` Alexandre Belloni
2014-07-07 14:25 ` [PATCH v2 04/18] AT91: Rework ramc mapping code Maxime Ripard
[not found] ` <1404743131-24569-5-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-07-07 14:59 ` Alexandre Belloni [this message]
2014-07-07 14:25 ` [PATCH v2 05/18] AT91: SAMA5D3: DT: Add shutdown controller Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 06/18] power: reset: Add AT91 reset driver Maxime Ripard
2014-07-08 17:31 ` Nicolas Ferre
2014-07-07 14:25 ` [PATCH v2 07/18] AT91: DT: Remove the old-style reset probing Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 09/18] AT91: Probe the reset driver Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 10/18] AT91: Call at91_register_devices in the board files Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 11/18] AT91: Remove reset code from the machine code Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 12/18] power: reset: Add AT91 poweroff driver Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 13/18] AT91: DT: Remove poweroff DT probing Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 14/18] AT91: Register the poweroff driver Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 15/18] AT91: Remove poweroff code Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 16/18] AT91: pm: Remove show_reset_status function Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 17/18] AT91: Remove rstc and shdwnc global base addresses Maxime Ripard
2014-07-07 14:25 ` [PATCH v2 18/18] AT91: Remove rstc and shdwc headers Maxime Ripard
[not found] ` <1404743131-24569-1-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-07-07 14:25 ` [PATCH v2 01/18] power: reset: Add if statement isntead of multiple depends on Maxime Ripard
[not found] ` <1404743131-24569-2-git-send-email-maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
2014-07-08 17:33 ` Nicolas Ferre
2014-07-07 14:25 ` [PATCH v2 08/18] AT91: soc: Introduce register_devices callback Maxime Ripard
2014-07-07 15:01 ` [PATCH v2 00/18] AT91: cleanup of the reset and poweroff code Alexandre Belloni
2014-07-08 17:31 ` Nicolas Ferre
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=20140707145951.GD3113@piout.net \
--to=alexandre.belloni-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=boris-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=linux-PelNFVqkFnVyf+4FbqDuWQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
--cc=nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org \
--cc=plagnioj-sclMFOaUSTBWk0Htik3J/w@public.gmane.org \
--cc=thomas-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@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).