[U-Boot] register polling from HUSH parser?
Wolfgang Denk
wd at denx.de
Wed Apr 27 11:46:24 CEST 2016
Dear Masahiro,
In message <CAK7LNATy2wfxErhQTaPtJ+YREPLttD9oGDr3kZff7TXBD0BCVQ at mail.gmail.com> you wrote:
>
> Is there any good way to poll a certain register
> in a HUSH parser script?
Yes, there is :-)
> For example, I want to wait
> until the register value of 0x50000000 becomes 1
> in a HUSH script.
OK...
> The pseudo code would be like this:
>
> while readl(0x50000000) != 1
> do
> ;
> done;
And in HUSH:
while itest *50000000 != 1
do
...
done
> I wish there were a command that
> stores a value of a given address into an environment,
> but I have no idea about that.
Try "help setexpr". If you want to store the value as is, just apply
a null operation, like
=> setexp foo *50000000 | 0
=> printenv foo
Hope this helps...
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
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
"The X11 source code style is ATROCIOUS and should not be used as a
model." - Doug Gwyn
More information about the U-Boot
mailing list