Skip to contentSkip to conversation

How do you test a bit set/clear from U-Boot command line/script?

U-Boot-Users Tolunay Orkun 1 participant 1 message Apr 26, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 6 lines · Wolfgang Denk
Quoted 4 lines · In message <[email protected]> you wrote:

I know I can compare a simple value using itest command. e.g.

itest *4000 -eq 1234 && echo 'Addr 4000 contains 1234'

Quoted 9 lines
Quoted 4 lines

Now my problem is how can I test a bit of 32 bit quantity (say bit 4) stored at location 4000? This is a question about general hush/u-boot shell capability? It is a generic question...

At the moment there is no command that implements this. As you probaly are aware, the "itest" command just implements the following operations:

I did hope there was some clever way to do this using existing commands.

Quoted 2 lines

Feel free to add new commands for AND, OR, and XOR...

I will send a patch. I am not sure how OR or XOR could be useful though... We do not support multiple operations or store computed expression results anywhere.

Tolunay