[U-Boot] Support for reading GPIO's in boot scripts?

Wolfgang Denk wd at denx.de
Mon Mar 28 20:18:28 CEST 2011


Dear Charles Krinke,

In message <AANLkTind=t82J4w1N+sp8vnFwiF2nXQsgrNFsgfKXjvN at mail.gmail.com> you wrote:
>
> Let me add my $.02. I have a request to be able to boot a USB drive. So,
> reading a GPIO pin and making a decision in a script is a desirable thing.
> Certainly a 'MD 0x12345678' can read a pin but then making a decision in an
> environment string chain would help. Can we do this?

Sure we can do this.  It's as trivial as for example

	setexpr tmpvar *12345678.l "&" 00010000
	if itest ${tmpvar} != 0; then do something ; fi


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
History is only a confused heap of facts.
                                       -- Philip Earl of Chesterfield


More information about the U-Boot mailing list