[PATCH] of: Have of_device_add call platform_device_add rather than device_add

Jason Gunthorpe jgunthorpe at obsidianresearch.com
Thu Nov 22 05:14:30 EST 2012


On Wed, Nov 21, 2012 at 06:07:46PM +0000, Grant Likely wrote:

> > Which is nesting the generic gpio driver under a larger region..
> 
> Try two sibling nodes with overlapping addresses. There are powerpc
> device trees doing that even though it isn't legal by the ofw and
> epapr specs.

Both my examples were using sibling nodes in the OF tree.

	pex at e0000000 {
		device_type = "pci";
		ranges = <0x02000000 0x00000000 0x00000000  0xe0000000  0x0 0x8000000>;
		bus-range = <0x0 0xFF>;
		chip at 0 {
			ranges = <0x02000000 0x00000000 0x00000000  0x02000000 0x00000000 0x00000000  0x0 0x8000000>;
			chip_control at 0 {
				compatible = "orc,chip,control";
				assigned-addresses = <0x02000000 0x0 0x0  0x0 4096>;
			};

			gpio3: chip_gpio at 8 {
			        #gpio-cells = <2>;
				compatible = "linux,basic-mmio-gpio";
				gpio-controller;
				reg-names = "dat", "set", "dirin";
				assigned-addresses = <0x02000000 0x0 0x8  0x0 4>,
				                     <0x02000000 0x0 0xc  0x0 4>,
				                     <0x02000000 0x0 0x10  0x0 4>;
			};

Non-conformant yes, but it is the simplest way to get linux to bind
two drivers to the same memory space.

Jason


More information about the devicetree-discuss mailing list