diff options
author | Stephane Bonnet <bonnetst@hds.utc.fr> | 2012-04-04 21:05:25 +0200 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2012-04-10 20:19:47 +0000 |
commit | 57dce9560a2885782860b127fd1629798d659440 (patch) | |
tree | 6202790652fb71cf930ad804b3641adb19da8ef4 /src | |
parent | 108a458ab88880d063c29e1d09820fe6b62251dc (diff) | |
download | riscv-openocd-57dce9560a2885782860b127fd1629798d659440.zip riscv-openocd-57dce9560a2885782860b127fd1629798d659440.tar.gz riscv-openocd-57dce9560a2885782860b127fd1629798d659440.tar.bz2 |
ft2232: Support for Digilent HS1 USB adapter
* Added support to the FT2232 driver for the FT2232H-based
Digilent HS1 adapter.
Change-Id: Iab6cc15f299badaf115615b5d4d785ecb2273c27
Signed-off-by: Stephane Bonnet <bonnetst@hds.utc.fr>
Reviewed-on: http://openocd.zylin.com/558
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/drivers/ft2232.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/jtag/drivers/ft2232.c b/src/jtag/drivers/ft2232.c index 3a156bf..e6a7363 100644 --- a/src/jtag/drivers/ft2232.c +++ b/src/jtag/drivers/ft2232.c @@ -193,6 +193,7 @@ static int redbee_init(void); static int lisa_l_init(void); static int flossjtag_init(void); static int xds100v2_init(void); +static int digilent_hs1_init(void); /* reset procedures for supported layouts */ static void ftx23_reset(int trst, int srst); @@ -211,6 +212,7 @@ static void signalyzer_h_reset(int trst, int srst); static void ktlink_reset(int trst, int srst); static void redbee_reset(int trst, int srst); static void xds100v2_reset(int trst, int srst); +static void digilent_hs1_reset(int trst, int srst); /* blink procedures for layouts that support a blinking led */ static void olimex_jtag_blink(void); @@ -337,6 +339,11 @@ static const struct ft2232_layout ft2232_layouts[] = { .init = xds100v2_init, .reset = xds100v2_reset, }, + { .name = "digilent-hs1", + .init = digilent_hs1_init, + .reset = digilent_hs1_reset, + .channel = INTERFACE_A, + }, { .name = NULL, /* END OF TABLE */ }, }; @@ -4179,6 +4186,33 @@ static void ktlink_blink(void) buffer_write(high_direction); } +/******************************************************************** + * Support for Digilent HS-1 + * JTAG adapter from Digilent + * http://www.digilent.com + * Author: Stephane Bonnet bonnetst@hds.utc.fr + *******************************************************************/ + +static int digilent_hs1_init(void) +{ + /* the adapter only supports the base JTAG signals, no nTRST + nor nSRST */ + low_output = 0x88; + low_direction = 0x8b; + + /* initialize low byte for jtag */ + if (ft2232_set_data_bits_low_byte(low_output, low_direction) != ERROR_OK) { + LOG_ERROR("couldn't initialize FT2232 with 'digilent_hs1' layout"); + return ERROR_JTAG_INIT_FAILED; + } + return ERROR_OK; +} + +static void digilent_hs1_reset(int trst, int srst) +{ + /* Dummy function, no reset signals supported. */ +} + static const struct command_registration ft2232_command_handlers[] = { { .name = "ft2232_device_desc", |