From: Gabriel Huau Date: Tue, 26 May 2015 07:41:11 -0700 Subject: [U-Boot] [PATCH v3 4/4] x86: minnowmax: initialize the pin-muxing from device tree In-Reply-To: <001501d0978a$3c9a4a90$b5cedfb0$@pont@sdcsystems.com> 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> <001501d0978a$3c9a4a90$b5cedfb0$@pont@sdcsystems.com> Message-ID: <55648607.2040508@huau-gabriel.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Andy, On 05/26/2015 01:01 AM, Andy Pont wrote: > 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. I agree, but I think the documentation should be part of another patch, especially as this is the case for all the x86 platform. The naming is not specific to the minnowboard max (baytrail). > Thanks, > > Andy. > Regards, Gabriel