linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* How to use Localbus on 5200B w/ 2.6.29.1
@ 2009-04-27 17:18 Albrecht Dreß
  2009-04-27 17:36 ` Grant Likely
  0 siblings, 1 reply; 4+ messages in thread
From: Albrecht Dreß @ 2009-04-27 17:18 UTC (permalink / raw)
  To: Linux PPC Development

[-- Attachment #1: Type: text/plain, Size: 2844 bytes --]

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.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to use Localbus on 5200B w/ 2.6.29.1
  2009-04-27 17:18 How to use Localbus on 5200B w/ 2.6.29.1 Albrecht Dreß
@ 2009-04-27 17:36 ` Grant Likely
  2009-04-28 17:55   ` Albrecht Dreß
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Likely @ 2009-04-27 17:36 UTC (permalink / raw)
  To: Albrecht Dreß; +Cc: Linux PPC Development

On Mon, Apr 27, 2009 at 11:18 AM, Albrecht Dre=DF <albrecht.dress@arcor.de>=
 wrote:
> 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
> 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.


[...]
> =A0 =A0 =A0 =A0mydev@3,0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0compatible =3D "mydev";

"mydev" should be in the form: "<vendor>,<device>".

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0reg =3D <0 0x0 0x100>; =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

> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0interrupts =3D <1 3 2>; =A0 =A0 =A0 =A0 =
=A0 // todo - level?
> =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 .
> drwxr-xr-x =A0 =A07 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 ..
> -r--r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 devspec
> drwxr-xr-x =A0 =A02 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 fc000000.flash
> drwxr-xr-x =A0 =A02 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 fc000000.mydev
> -r--r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 modalias
> -r--r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 name
> lrwxrwxrwx =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 Jan =
=A01 00:00 subsystem ->
> ../../bus/of_platform
> -rw-r--r-- =A0 =A01 0 =A0 =A0 =A0 =A00 =A0 =A0 =A0 =A0 =A0 =A04096 Jan =
=A01 00:00 uevent
> </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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to use Localbus on 5200B w/ 2.6.29.1
  2009-04-27 17:36 ` Grant Likely
@ 2009-04-28 17:55   ` Albrecht Dreß
  2009-04-28 18:10     ` Grant Likely
  0 siblings, 1 reply; 4+ messages in thread
From: Albrecht Dreß @ 2009-04-28 17:55 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 596 bytes --]

Hi Grant:

Am 27.04.09 19:36 schrieb(en) Grant Likely:
> 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?

> 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.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to use Localbus on 5200B w/ 2.6.29.1
  2009-04-28 17:55   ` Albrecht Dreß
@ 2009-04-28 18:10     ` Grant Likely
  0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2009-04-28 18:10 UTC (permalink / raw)
  To: Albrecht Dreß; +Cc: linuxppc-dev

On Tue, Apr 28, 2009 at 11:55 AM, Albrecht Dre=DF <albrecht.dress@arcor.de>=
 wrote:
> Hi Grant:
>
> Am 27.04.09 19:36 schrieb(en) Grant Likely:
>>
>> 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
> file arch/powerpc/platforms/52xx/mpc52xx_common.c lists only "fsl,lpb" =
=A0as
> "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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-28 18:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 17:18 How to use Localbus on 5200B w/ 2.6.29.1 Albrecht Dreß
2009-04-27 17:36 ` Grant Likely
2009-04-28 17:55   ` Albrecht Dreß
2009-04-28 18:10     ` Grant Likely

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).