Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gpio0 and gpio1 swapped on Beaglebone Black



brook%nmsu.edu@localhost (Brook Milligan) writes:

>It seems that the devices gpio0 and gpio1 are swapped by the kernel when =
>it probes a Beaglebone Black (but gpio2 and gpio3 seem ok).

The device numbering is unrelated to any documentation in the DTS.

	target-module@7000 {
		gpio@0 {
			phandle = <0x3d>;
		};
	};
	target-module@4c000 {
		gpio@0 {
			phandle = <0x27>;
		};
	};
	target-module@ac000 {
		gpio@0 {
			phandle = <0xc8>;
		};
	};
	target-module@ae000 {
		gpio@0 {
			phandle = <0xca>;
		};
	};

The tigpio devices are attached by phandle and these are generated
by the device tree compiler (dtc).

If you could control the ordering, it could still be problematic if
e.g. you had two gpio controllers. The first might get assigned
gpio0, gpio1, ... and the second gpio(N), gpio(N+1), .... but
which is which ?

It would be useful if userland could select such devices by some
attribute. For FDT there is "fdt-path", but for other schemes
we'd need a bus path and bus address.



Home | Main Index | Thread Index | Old Index