From: Mercier Ivan <ivan.mercier@gmail.com>
To: Scott Wood <scottwood@freescale.com>
Cc: linuxppc-dev@lists.ozlabs.org
Subject: Re: Elbc device driver
Date: Fri, 11 Oct 2013 17:03:30 +0200 [thread overview]
Message-ID: <CAMc2ieqO5eKiXdGh0qraJy3FKPMbzkpTGgWrSwwGHh7sn2iCFw@mail.gmail.com> (raw)
In-Reply-To: <1381418079.7979.396.camel@snotra.buserror.net>
Hi,
this should be correct (I'm using chip select 3 for this device)
lbc: localbus@ffe124000 {
reg = <0xf 0xfe124000 0 0x1000>;
ranges = <3 0 0xf 0xe0000000 0x08000000>;
a3p400{
#address-cells = <1>;
#size-cells = <1>;
compatible = "my_a3p_driver";
reg = <0x0 0x0 0x800000>;
};
};
yeah, I'm including p3041-post.dtsi.
so it I get it, I should code my driver doing basically:
{
static u8 __iomem * a3p
struct device_node *np;
np = of_find_compatible_node(NULL, NULL, "my_a3p_driver");
if (!np) {
printk(KERN_CRIT "Could not find my_a3p_driver node\n");
return;
}
a3p_bcsr = of_iomap(np, 0);
of_node_put(np);
if (!a3p_bcsr) {
printk(KERN_CRIT "Could not remap BCSR\n");
return;
}
}
Thanks for your help Scott
2013/10/10 Scott Wood <scottwood@freescale.com>:
> On Thu, 2013-10-10 at 16:54 +0200, Mercier Ivan wrote:
>> Hi,
>> I've got a KERN_INFO msg: "fsl-lbc a3p400.11: failed to get memory
>> region" corresponding to my elbc device that I try to map.
>> a3p400@3,0 {
>> compatible = "fsl,elbc";
>> reg = <0 0xe0000000 0x1000000>;
>> };
>
> The node name and unit address do not match the contents of the node.
> The former describes a device that sits on the localbus, while the
> latter has a compatible describes the localbus itself. I don't know
> what that reg is, but it doesn't match the unit address.
>
>> The corresponding law on ELBC is 0xe0000000 ->0xf0000000.
>> I want to map my device on 0xe0000000 ->0xe8000000 as it has 16 adress bits.
>>
>> Now the controler registers are properly set,but how do I map the device?
>
> Your eLBC node should look something like this (I'm assuming CCSR is at
> 0xffe000000, and that you actually meant 0x0e0000000 and not
> 0xfe0000000, though probably one of those assumptions is wrong):
>
> localbus@ffe124000 {
> compatible = "fsl,elbc", "simple-bus";
> reg = <0xf 0xfe124000 0 0x1000>;
> interrupts = <25 2 0 0>;
> #address-cells = <2>;
> #size-cells = <1>;
>
> ranges = <3 0 0 0xe0000000 0x08000000>;
>
> /* If at all possible, replace "a3p400" in the node name with
> something generic */
> a3p400@3,0 {
> compatible = "something appropriate here";
> reg = <3 0 0x08000000>;
> };
> };
>
> Note that at the dts level, you should be including
> arch/powerpc/boot/dts/fsl/p3041-post.dtsi and thus your board dts would
> only need to supply reg, ranges, and the a3p400 node (see
> arch/powerpc/boot/dts/p3041ds.dts for an example).
>
> -Scott
>
>
>
next prev parent reply other threads:[~2013-10-11 15:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-08 14:06 Elbc device driver Mercier Ivan
2013-10-08 22:34 ` Scott Wood
2013-10-10 14:54 ` Mercier Ivan
2013-10-10 15:14 ` Scott Wood
2013-10-11 15:03 ` Mercier Ivan [this message]
2013-10-11 17:35 ` Scott Wood
2013-10-22 9:43 ` Mercier Ivan
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=CAMc2ieqO5eKiXdGh0qraJy3FKPMbzkpTGgWrSwwGHh7sn2iCFw@mail.gmail.com \
--to=ivan.mercier@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=scottwood@freescale.com \
/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).