cmd: Add command for calculating binary operations
This patch adds a command that enables the calculation of bit operations
(AND, OR, XOR) on binary data from the command line. Memory locations as
well as the contents of environment variables are eligible as sources
and destination of the binary data used in the operations.
The possible applications are manifold: Setting specific bits in
registers using the regular read-OR-write pattern, masking out bits in
bit values, implementation of simple OTP encryption using the XOR
operation, etc.
Signed-off-by: Mario Six <mario.six@gdsys.cc>
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 27086df..cb21dab 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -423,6 +423,12 @@
menu "Memory commands"
+config CMD_BINOP
+ bool "binop"
+ help
+ Compute binary operations (xor, or, and) of byte arrays of arbitrary
+ size from memory and store the result in memory or the environment.
+
config CMD_CRC32
bool "crc32"
select HASH