FDT/OFW GPIO bus

Luiz Otavio O Souza loos.br at gmail.com
Thu Feb 6 18:53:46 UTC 2014


Hello guys,

Last call for alcohol^Wtest and reviews.

I’ve finally managed to test these changes on a some FDT and non FDT systems, so now it is all cleared to commit.

I plan to commit these changes on the weekend unless someone objects.

They add support to describe GPIO connections on the DTS files. It also add the support to the in tree GPIO devices (gpioiic(4), gpioled(4)).

The last patch (005-bbb-gpioled.diff) sets the gpioled(4) for the 4 on board LEDs on BBB (beaglebone-black). The RPi led is already set and just need the first patch (001-ofw-gpiobus.diff) to work.

The tests were done on RPi and BBB using I2C devices (two lm75 on the same bus), LEDs (for gpioled(4)) and even with some non committed ethernet over SPI. The I2C tests are conducted using the hardware I2C controller (when available) and also the software big bang controller - gpioiic(4).

I used the RSPRO (MIPS/ar71xx) to check for regressions without any visible problem.

gpioiic(4) devices can be described in DTS as follow:

                gpio {

                        gpioiic {
                                compatible = "gpioiic";
                                gpios = <&gpio 17 2 0
                                         &gpio 21 2 0>;
                                scl = <0>;
                                sda = <1>;

                                lm750 {
                                        compatible = "lm75";
                                        i2c-address = <0x4b>;
                                };
                                lm751 {
                                        compatible = "lm75";
                                        i2c-address = <0x4f>;
                                };
                        };
		};

gpioled(4) devices can be described in two ways:

- directly under the GPIO controller node:

                gpio {

                        led0 {
                                compatible = "gpioled";
                                gpios = <&gpio 16 2 0>;
                                label = "ok";
                        };

                        led1 {
                                compatible = "gpioled";
                                gpios = <&gpio 17 2 0>;
                                name = "user-led1";
                        };
		};

- Or under a single “gpio-leds” node:

       leds {
               compatible = "gpio-leds";

               led1 {
                       gpios = <&GPIO 53 2 0>;
                       name = "led1";
               };

               led2 {
                       gpios = <&GPIO 54 2 0>;
                       name = "led2";
               };
	};


gpioiic(4) and gpioled(4) man pages were updated to cover FDT/OFW based systems.

From the latest patchset (published on freebsd-arch@ and freebsd-arm@) i removed the check for disabled devices on DTS as this seems to indicate that the device needs special attention but should not be skipped at attach time.

Please let me know if there are problems or concerns with the following changes.

Thanks,
Luiz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001-ofw-gpiobus.diff
Type: application/octet-stream
Size: 18240 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20140206/a09cc962/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 002-iicbb-ofw-iicbus.diff
Type: application/octet-stream
Size: 2022 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20140206/a09cc962/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 003-ofw-gpio-man.diff
Type: application/octet-stream
Size: 3450 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20140206/a09cc962/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 004-gpio-node.diff
Type: application/octet-stream
Size: 1580 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20140206/a09cc962/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 005-bbb-gpioled.diff
Type: application/octet-stream
Size: 899 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-arm/attachments/20140206/a09cc962/attachment-0004.obj>


More information about the freebsd-arm mailing list