diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2016-09-04 16:40:02 -0700 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-09-05 08:43:29 +0200 |
commit | f7a2e37fcd1731026d0d2034e49d530161f1b2b0 (patch) | |
tree | 1fd620d0eaf824cf62a9647ad2ffc27c10545d9f /scripts | |
parent | da1f91422c2e3479066e22cc2795b7927dfe6714 (diff) | |
download | barebox-f7a2e37fcd1731026d0d2034e49d530161f1b2b0.tar.gz barebox-f7a2e37fcd1731026d0d2034e49d530161f1b2b0.tar.xz |
i.MX: scripts: Fix a bug in imx-image
In order to clear a bitmask, "Set" bit has to be '0' and "Mask" bit
'1'. Since "Set" is bit 4 and "Mask" is bit 3 this leaves us with a
overal or-mask of 1 << 3. Orginal code was doing the inverse and setting
bit #4 to '1' bit #3 to '0'.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/imx/imx-image.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index c0bf9c004f..9bdba7ef12 100644 --- a/scripts/imx/imx-image.c +++ b/scripts/imx/imx-image.c @@ -380,7 +380,7 @@ static int write_mem_v2(uint32_t addr, uint32_t val, int width, int set_bits, in if (set_bits) cmd |= 3 << 3; if (clear_bits) - cmd |= 2 << 3; + cmd |= 1 << 3; if (curdcd > MAX_DCD - 3) { fprintf(stderr, "At maximum %d dcd entried are allowed\n", MAX_DCD); |