Subject: How to use Localbus on 5200B w/ 2.6.29.1

From: Albrecht Dreß <[email-masked]>
Date: Mon, 27 Apr 2009 19:18:31 +0200

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.