From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Wed, 26 Apr 2006 15:50:16 -0500 Subject: [U-Boot-Users] How do you test a bit set/clear from U-Boot command line/script? In-Reply-To: <20060426200809.6BE30353DAE@atlas.denx.de> References: <20060426200809.6BE30353DAE@atlas.denx.de> Message-ID: <444FDD08.2010101@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message <444FD06D.4060309@orkun.us> you wrote: > >> Within a u-boot script (to be executed by autoscr command), I need to >> read a GPIO port and if a particular GPIO bit is set execute some >> conditional commands. I am not sure how to do this with test/itest >> commands. Any ideas? >> > > This is obviously highly hardware specific. > > > I am not asking anything about hardware. Forget I said GPIO. Let's say a value in general memory space. It could be in ram or flash.... I know I can compare a simple value using itest command. e.g. itest *4000 -eq 1234 && echo 'Addr 4000 contains 1234' 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... Best regards, Tolunay