How to use Localbus on 5200B w/ 2.6.29.1
Hi all,
I have a question about the definition of the localbus on the Freescale 5200B (I'm testing with the Lite5200B board) with Kernel 2.6.29.1 which I could not figure out with the docs and the list archives...
When I use 'compatible = "fsl,mpc5200b-lpb";' in the dts file, the localbus and any nodes below it don't show up in /sys/devices.
When I use the following (top-level, not under the soc node) in the dts file
<snip>
localbus {
compatible = "fsl,lpb";
#address-cells = <2>;
#size-cells = <1>;
reg = <0xf0000300 0x32>;
ranges = < 0 0 0xfc000000 0x02000000
3 0 0xf0020000 0x00010000 >;
flash@0,0 {
compatible = "cfi-flash";
reg = <0 0x0 0x2000000>; // 32 MB
bank-width = <1>; // width in bytes of
the flash bank
device-width = <1>; // one devices on each
bank
#size-cells = <1>;
#address-cells = <1>;
};
mydev@3,0 {
compatible = "mydev";
reg = <0 0x0 0x100>; // 256 Bytes, 32 used
interrupts = <1 3 2>; // todo - level?
interrupt-parent = <&mpc5200_pic>;
};
};</snip>
I see in /sys/devices
<snip>
# ls -al /sys/devices/ drwxr-xr-x 7 0 0 0 Jan 1 00:00 . drwxr-xr-x 11 0 0 0 Jan 1 00:00 .. drwxr-xr-x 31 0 0 0 Jan 1 00:00 f0000000.soc5200 drwxr-xr-x 4 0 0 0 Jan 1 00:00 f0000300.localbus drwxr-xr-x 2 0 0 0 Jan 1 00:00 platform drwxr-xr-x 5 0 0 0 Jan 1 00:00 system drwxr-xr-x 8 0 0 0 Jan 1 00:00 virtual </snip>
Does this mean that the documentation (and some existing dts files) are inaccurate? What is the proper way to specify the localbus (or, in particular, it's child nodes) on the 5200B?
In /sys/devices/f0000300.localbus, I see
<snip>
# ls -al /sys/devices/f0000300.localbus/ drwxr-xr-x 4 0 0 0 Jan 1 00:00 . drwxr-xr-x 7 0 0 0 Jan 1 00:00 .. -r--r--r-- 1 0 0 4096 Jan 1 00:00 devspec drwxr-xr-x 2 0 0 0 Jan 1 00:00 fc000000.flash drwxr-xr-x 2 0 0 0 Jan 1 00:00 fc000000.mydev -r--r--r-- 1 0 0 4096 Jan 1 00:00 modalias -r--r--r-- 1 0 0 4096 Jan 1 00:00 name lrwxrwxrwx 1 0 0 0 Jan 1 00:00 subsystem -> ../../bus/of_platform -rw-r--r-- 1 0 0 4096 Jan 1 00:00 uevent </snip>
which is also confusing, as both devices appear to have the same address? Any idea what goes wrong here?
The flash device itself (mydev isn't present yet...) also doesn't work although mtd is enabled, but that's probably a different problem.
Any help would be really welcome!
Thanks in advance,
Albrecht.
Quoted 7 lines · On Mon, Apr 27, 2009 at 11:18 AM, Albrecht Dre=DF <[email protected]>=…
Hi all,
I have a question about the definition of the localbus on the Freescale 5200B (I'm testing with the Lite5200B board) with Kernel 2.6.29.1 which I could not figure out with the docs and the list archives...
When I use 'compatible =3D "fsl,mpc5200b-lpb";' in the dts file, the loca=
lbus
Quoted 1 line
and any nodes below it don't show up in
/sys/devices.
For completeness use: compatible =3D "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus"; Then it will work.
The kernel doesn't currently bind on the 'b' string, but we put it in the list anyway to completely describe the hardware, just in case it ever becomes important in the future.
[...]
Quoted 2 lines
=A0 =A0 =A0 =A0mydev@3,0 {
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "mydev";
"mydev" should be in the form: "<vendor>,<device>".
Quoted 1 line
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0
0x00x100>; =A0 =A0 =A0 =A0 =A0=
=A0// 256 Bytes, 32 used
If this is on CS3, then reg should be:
reg =3D <3 0x0 0x100>; // 256 Bytes, 32 used
Quoted 1 line
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <1 3 2>; =A0 =A0 =A0 =A0 =
=A0 // todo - level?
Quoted 5 lines
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupt-parent =3D <
&mpc5200_pic>; =A0 =A0 =A0 =A0};
};# ls -al /sys/devices/f0000300.localbus/ drwxr-xr-x =A0 =A04 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 .
Quoted 1 line
drwxr-xr-x =A0 =A07 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 ..
Quoted 1 line
-r--r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 devspec
Quoted 1 line
drwxr-xr-x =A0 =A02 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 fc000000.flash
Quoted 1 line
drwxr-xr-x =A0 =A02 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 fc000000.mydev
Quoted 1 line
-r--r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 modalias
Quoted 1 line
-r--r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 name
Quoted 1 line
lrwxrwxrwx =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 subsystem ->
Quoted 2 lines
../../bus/of_platform
-rw-r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 uevent
Quoted 4 lines
</snip>
which is also confusing, as both devices appear to have the same address? =A0Any idea what goes wrong here?
Because the reg property for mydev is wrong (see above).
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
Hi Grant:
Am 27.04.09 19:36 schrieb(en) Grant Likely:
Quoted 1 line
For completeness use: compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus"; Then it will work.
I doesn't. I had to add "fsl,lpb", without no localbus nodes show up. The file arch/powerpc/platforms/52xx/mpc52xx_common.c lists only "fsl,lpb" as "compatible". Or did I miss something here?
Quoted 2 lines
If this is on CS3, then reg should be:
reg = <3 0x0 0x100>; // 256 Bytes, 32 used
Ouch. Sorry, that was the error. Works perfectly now...
Thanks a lot for your help,
Albrecht.
Quoted 8 lines · On Tue, Apr 28, 2009 at 11:55 AM, Albrecht Dre=DF <[email protected]>=…
Hi Grant:
Am 27.04.09 19:36 schrieb(en) Grant Likely:
Quoted 3 lines
For completeness use: compatible =3D "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus"; =A0Then it will work.
I doesn't. =A0I had to add "fsl,lpb", without no localbus nodes show up. =
=A0The
Quoted 1 line
file
arch/powerpc/platforms/52xx/mpc52xx_common.clists only "fsl,lpb" =
=A0as
Quoted 1 line
"compatible". =A0Or did I miss something here?
Ah, I guess I didn't merge that fix until 2.6.30. fsl,lpb works for now. What I wrote about is the recommended value for .30 and later, just because it is clearer.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.