From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Pont Date: Tue, 26 May 2015 09:01:44 +0100 Subject: [U-Boot] [PATCH v3 4/4] x86: minnowmax: initialize the pin-muxing from device tree In-Reply-To: <5564050A.80802@huau-gabriel.fr> References: <1429805775-1809-1-git-send-email-contact@huau-gabriel.fr> <1431411164-2148-1-git-send-email-contact@huau-gabriel.fr> <55519BCB.2090300@huau-gabriel.fr> <5564050A.80802@huau-gabriel.fr> Message-ID: <001501d0978a$3c9a4a90$b5cedfb0$@pont@sdcsystems.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Gabriel, > > soc_gpio_s5_0 at 0 { > gpio-offset = <0x80 0>; > pad-offset = <0x1d0>; > mode-gpio; > output-value = <0>; > direction = ; > }; > > soc_gpio_s5_1 at 0 { > gpio-offset = <0x80 1>; > pad-offset = <0x210>; > mode-gpio; > output-value = <0>; > direction = ; > }; > > soc_gpio_s5_2 at 0 { > gpio-offset = <0x80 2>; > pad-offset = <0x1e0>; > mode-gpio; > output-value = <0>; > direction = ; > }; > > And after, you can use the GPIO commands: > > => gpio set E0 > gpio: pin E0 (gpio 128) value is 1 > => gpio clear E0 > gpio: pin E0 (gpio 128) value is 0 > => gpio set E2 > gpio: pin E2 (gpio 130) value is 1 > => gpio clear E2 > gpio: pin E2 (gpio 130) value is 0 > > E0 E1 and E2 correspond to the GPIO0 1 and 2. Is there, or can someone add, some documentation somewhere as to how to convert between the device tree definition and the value used for "pin" in the gpio commands as it doesn't seem intuitive or obvious to me that what you have defined translates to E0, E1 and E2. Thanks, Andy.