diff options
author | Peng Fan <peng.fan@nxp.com> | 2017-03-16 14:35:06 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2017-03-19 17:30:15 +0100 |
commit | 3e0a71c157951c0f88a31182a6f3159cd3e12e23 (patch) | |
tree | 829cd00ecde4818fc3d3e4c381ff2d9db16eedce /tools/imximage.c | |
parent | 7966b43778f2556ecbda2275f1296934071224b2 (diff) | |
download | u-boot-3e0a71c157951c0f88a31182a6f3159cd3e12e23.zip u-boot-3e0a71c157951c0f88a31182a6f3159cd3e12e23.tar.gz u-boot-3e0a71c157951c0f88a31182a6f3159cd3e12e23.tar.bz2 |
tools: imximage: add set bit command
Add set bit command support.
Usage: SET_BIT 4 [address] [bitmask]
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'tools/imximage.c')
-rw-r--r-- | tools/imximage.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/imximage.c b/tools/imximage.c index 0c43196..eb7e682 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -23,6 +23,7 @@ static table_entry_t imximage_cmds[] = { {CMD_BOOT_OFFSET, "BOOT_OFFSET", "Boot offset", }, {CMD_WRITE_DATA, "DATA", "Reg Write Data", }, {CMD_WRITE_CLR_BIT, "CLR_BIT", "Reg clear bit", }, + {CMD_WRITE_SET_BIT, "SET_BIT", "Reg set bit", }, {CMD_CHECK_BITS_SET, "CHECK_BITS_SET", "Reg Check bits set", }, {CMD_CHECK_BITS_CLR, "CHECK_BITS_CLR", "Reg Check bits clr", }, {CMD_CSF, "CSF", "Command Sequence File", }, @@ -204,6 +205,15 @@ static void set_dcd_param_v2(struct imx_header *imxhdr, uint32_t dcd_len, d->write_dcd_command.length = cpu_to_be16(4); d->write_dcd_command.param = DCD_WRITE_CLR_BIT_PARAM; break; + case CMD_WRITE_SET_BIT: + if ((d->write_dcd_command.tag == DCD_WRITE_DATA_COMMAND_TAG) && + (d->write_dcd_command.param == DCD_WRITE_SET_BIT_PARAM)) + break; + d = d2; + d->write_dcd_command.tag = DCD_WRITE_DATA_COMMAND_TAG; + d->write_dcd_command.length = cpu_to_be16(4); + d->write_dcd_command.param = DCD_WRITE_SET_BIT_PARAM; + break; /* * Check data command only supports one entry, */ @@ -636,6 +646,7 @@ static void parse_cfg_cmd(struct imx_header *imxhdr, int32_t cmd, char *token, break; case CMD_WRITE_DATA: case CMD_WRITE_CLR_BIT: + case CMD_WRITE_SET_BIT: case CMD_CHECK_BITS_SET: case CMD_CHECK_BITS_CLR: value = get_cfg_value(token, name, lineno); @@ -686,6 +697,7 @@ static void parse_cfg_fld(struct imx_header *imxhdr, int32_t *cmd, switch(*cmd) { case CMD_WRITE_DATA: case CMD_WRITE_CLR_BIT: + case CMD_WRITE_SET_BIT: case CMD_CHECK_BITS_SET: case CMD_CHECK_BITS_CLR: |