From owner-freebsd-embedded@FreeBSD.ORG Fri Feb 7 03:29:28 2014 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E49832BA for ; Fri, 7 Feb 2014 03:29:27 +0000 (UTC) Received: from mail-ig0-f171.google.com (mail-ig0-f171.google.com [209.85.213.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AAA321884 for ; Fri, 7 Feb 2014 03:29:27 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id uy17so1138793igb.4 for ; Thu, 06 Feb 2014 19:29:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=FA6LVvja+mGRIJew+zWFZeuCAxA/CGbSL8vftDRh3JI=; b=f2vtazRatqB7HxMXCwwf80s8MrSbB/Ogw8vlAmyH0eNekwyur0yGRA5fVppNtHmHgj S1YqXZlTFfKX02BBJai/QnUBtMFGOH+CdVST/P/4Mi2TrWm6zm/xOf5VKKsTL7hrYsd9 vQEO2tiSl+IBb2KeDvBXCEYMLEaN+THEIj+WVsNJZDpWXODKBvZ97X3RbbJZbrhCv43J lBROSjI+etZMG3gwcWOQ3dnxi5SxLGey/Aw4PRLJ7mCzq53MzWPMYsuK8t149IkmG3V8 kd8hDczst/sLGngzVC4Eue5BBUWcECNu9RlaBOLuVWEMkXLhv4vgoXqbyvftlw+m6kbL kAwQ== X-Gm-Message-State: ALoCoQkLenXMi0/oYip6d2lDPfJXmetICpKTV8JQ2NMzOHw3qTwVd5Kf5b2QepL8U1Q4+MTj+9ty X-Received: by 10.50.159.194 with SMTP id xe2mr3141407igb.13.1391743313950; Thu, 06 Feb 2014 19:21:53 -0800 (PST) Received: from fusion-mac.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id z5sm5381297igw.0.2014.02.06.19.21.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Feb 2014 19:21:53 -0800 (PST) Sender: Warner Losh Subject: Re: FDT/OFW GPIO bus Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=windows-1252 From: Warner Losh In-Reply-To: <2D5F2707-FD55-46BB-A44F-8870B48E2BB1@gmail.com> Date: Thu, 6 Feb 2014 20:21:52 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <2D5F2707-FD55-46BB-A44F-8870B48E2BB1@gmail.com> To: Luiz Otavio O Souza X-Mailer: Apple Mail (2.1085) Cc: freebsd-arm@freebsd.org, freebsd-embedded@freebsd.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 03:29:28 -0000 On Feb 6, 2014, at 11:53 AM, Luiz Otavio O Souza wrote: > Hello guys, >=20 > Last call for alcohol^Wtest and reviews. >=20 > I=92ve finally managed to test these changes on a some FDT and non FDT = systems, so now it is all cleared to commit. >=20 > I plan to commit these changes on the weekend unless someone objects. This is cool. > 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)). >=20 > 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. >=20 > 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). >=20 > I used the RSPRO (MIPS/ar71xx) to check for regressions without any = visible problem. >=20 > gpioiic(4) devices can be described in DTS as follow: >=20 > gpio { >=20 > gpioiic { > compatible =3D "gpioiic"; Linux uses 'i2c-gpio' here. Can we follow that standard rather than = invent our own? Or at least support both? > gpios =3D <&gpio 17 2 0 > &gpio 21 2 0>; > scl =3D <0>; > sda =3D <1>; Linux doesn't have these at all, it seems, since they are implicit in = the gpios property. It would be ideal if the scl and sda properties were = optional... In addition, you'll often see things like: i2c-gpio,sda-open-drain; i2c-gpio,scl-open-drain; i2c-gpio,delay-us =3D <2>; as well. These should be easy enough to add and shouldn't gate things. There's also many DTS files that don't have this as a direct child of = gpio... But that's not strictly required. I'll cope with adding support = for that when I get the Atmel stuff working... > lm750 { > compatible =3D "lm75"; > i2c-address =3D <0x4b>; > }; > lm751 { > compatible =3D "lm75"; > i2c-address =3D <0x4f>; > }; > }; > }; >=20 > gpioled(4) devices can be described in two ways: >=20 > - directly under the GPIO controller node: >=20 > gpio { >=20 > led0 { > compatible =3D "gpioled"; cool. > gpios =3D <&gpio 16 2 0>; > label =3D "ok"; > }; >=20 > led1 { > compatible =3D "gpioled"; > gpios =3D <&gpio 17 2 0>; > name =3D "user-led1"; > }; > }; >=20 > - Or under a single =93gpio-leds=94 node: This follows Linux convention, which is cool... > leds { > compatible =3D "gpio-leds"; >=20 > led1 { > gpios =3D <&GPIO 53 2 0>; > name =3D "led1"; > }; >=20 > led2 { > gpios =3D <&GPIO 54 2 0>; > name =3D "led2"; > }; > }; >=20 >=20 > gpioiic(4) and gpioled(4) man pages were updated to cover FDT/OFW = based systems. Cool. > =46rom 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. >=20 > Please let me know if there are problems or concerns with the = following changes. I'll have to look at these in detail > Thanks, > Luiz >=20 > = <001-ofw-gpiobus.diff><002-iicbb-ofw-iicbus.diff><003-ofw-gpio-man.diff><0= 04-gpio-node.diff><005-bbb-gpioled.diff>__________________________________= _____________ > freebsd-embedded@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-embedded > To unsubscribe, send any mail to = "freebsd-embedded-unsubscribe@freebsd.org"