This is an automated email from Gerrit. Paul Fertser ([email protected]) just uploaded a new patch set to Gerrit, which you can find at http://openocd.zylin.com/2181
-- gerrit commit 463206aa8074cc9157c14aa18e5f285612404789 Author: Paul Fertser <[email protected]> Date: Fri Jun 20 12:47:24 2014 +0400 jtag/drivers/ftdi: add option to declare signal aliases This adds -alias|-nalias options to ftdi_layout_signal command that allow to declare a new signal based on an already defined one. Change-Id: I552578ebcd12ae21957a1c0d3b7e878adeff6df0 Signed-off-by: Paul Fertser <[email protected]> diff --git a/doc/openocd.texi b/doc/openocd.texi index fa8f1c5..e51de4d 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2767,7 +2767,7 @@ minimal impact on the target system. Avoid floating inputs, conflicting outputs and initially asserted reset signals. @end deffn -@deffn {Config Command} {ftdi_layout_signal} name [@option{-data}|@option{-ndata} data_mask] [@option{-oe}|@option{-noe} oe_mask] +@deffn {Config Command} {ftdi_layout_signal} name [@option{-data}|@option{-ndata} data_mask] [@option{-oe}|@option{-noe} oe_mask] [@option{-alias}|@option{-nalias} name] Creates a signal with the specified @var{name}, controlled by one or more FTDI GPIO pins via a range of possible buffer connections. The masks are FTDI GPIO register bitmasks to tell the driver the connection and type of the output @@ -2790,6 +2790,10 @@ target without any buffer. The FTDI pin is then switched between output and input as necessary to provide the full set of low, high and Hi-Z characteristics. In all other cases, the pins specified in a signal definition are always driven by the FTDI. + +If @option{-alias} or @option{-nalias} is used, the signal is created +identical (or with data inverted) to an already specified signal +@var{name}. @end deffn @deffn {Command} {ftdi_set_signal} name @option{0}|@option{1}|@option{z} diff --git a/src/jtag/drivers/ftdi.c b/src/jtag/drivers/ftdi.c index be02d20..5648f5c 100644 --- a/src/jtag/drivers/ftdi.c +++ b/src/jtag/drivers/ftdi.c @@ -740,6 +740,19 @@ COMMAND_HANDLER(ftdi_handle_layout_signal_command) } else if (strcmp("-noe", CMD_ARGV[i]) == 0) { invert_oe = true; COMMAND_PARSE_NUMBER(u16, CMD_ARGV[i + 1], oe_mask); + } else if (!strcmp("-alias", CMD_ARGV[i]) | + !strcmp("-nalias", CMD_ARGV[i])) { + if (!strcmp("-nalias", CMD_ARGV[i])) + invert_data = true; + struct signal *sig = find_signal_by_name(CMD_ARGV[i + 1]); + if (!sig) { + LOG_ERROR("signal %s is not defined", CMD_ARGV[i + 1]); + return ERROR_FAIL; + } + data_mask = sig->data_mask; + oe_mask = sig->oe_mask; + invert_oe = sig->invert_oe; + invert_data ^= sig->invert_data; } else { LOG_ERROR("unknown option '%s'", CMD_ARGV[i]); return ERROR_COMMAND_SYNTAX_ERROR; @@ -869,7 +882,7 @@ static const struct command_registration ftdi_command_handlers[] = { .mode = COMMAND_ANY, .help = "define a signal controlled by one or more FTDI GPIO as data " "and/or output enable", - .usage = "name [-data mask|-ndata mask] [-oe mask|-noe mask]", + .usage = "name [-data mask|-ndata mask] [-oe mask|-noe mask] [-alias|-nalias name]", }, { .name = "ftdi_set_signal", -- ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ OpenOCD-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openocd-devel
