1/1

|
I add the bytebalsterII support but still not work
by liunx on Oct 27, 2011 |
liunx
Posts: 10 Joined: Aug 14, 2008 Last seen: Jul 16, 2021 |
||
|
hello,
I add the byteblasterII support to the adv_jtag_bridge, see the diff: ##################################################################### Index: cable_common.c =================================================================== --- cable_common.c (revision 58) +++ cable_common.c (working copy) @@ -65,6 +65,7 @@ #ifdef __SUPPORT_PARALLEL_CABLES__ jtag_cables[i++] = cable_xpc3_get_driver(); + jtag_cables[i++] = cable_bb2_get_driver(); jtag_cables[i++] = cable_xess_get_driver(); #endif Index: cable_parallel.c =================================================================== --- cable_parallel.c (revision 58) +++ cable_parallel.c (working copy) @@ -50,6 +50,21 @@ .help = "-p [port] Which port to use when communicating with the parport hardware (eg. 0x378)\n" }; +jtag_cable_t bb2_cable_driver = { + .name = "bb2", + .inout_func = cable_bb2_inout, + .out_func = cable_bb2_out, + .init_func = cable_parallel_init, + .opt_func = cable_parallel_opt, + .bit_out_func = cable_common_write_bit, + .bit_inout_func = cable_common_read_write_bit, + .stream_out_func = cable_common_write_stream, + .stream_inout_func = cable_common_read_stream, + .flush_func = NULL, + .opts = "p:", + .help = "-p [port] Which port to use when communicating with the parport hardware (eg. 0x378)\n" + }; + jtag_cable_t xess_cable_driver = { .name = "xess", .inout_func = cable_xess_inout, @@ -275,6 +290,59 @@ return retval; } +/*----------------------------------------------[ bb2 specific functions ]---*/ +jtag_cable_t *cable_bb2_get_driver(void) +{ + return &bb2_cable_driver; +} + +int cable_bb2_out(uint8_t value) +{ + uint8_t out = 0; + + cable_parallel_phys_wait(); // Limit the max clock rate if necessary + + /* First convert the bits in value byte to the ones that the cable wants */ + if(value & TCLK_BIT) + out |= 0x01; /* D0 pin 2 */ + if(value & TRST_BIT) + out |= 0x10; /* Not used */ + if(value & TDI_BIT) + out |= 0x40; /* D7 pin 8 */ + if(value & TMS_BIT) + out |= 0x02; /* D1 pin 3 */ + + return cable_parallel_out(out); +} + +int cable_bb2_inout(uint8_t value, uint8_t *inval) +{ + uint8_t in; + int retval; + uint8_t out = 0; + + cable_parallel_phys_wait(); // Limit the max clock rate if necessary + + /* First convert the bits in value byte to the ones that the cable wants */ + if(value & TCLK_BIT) + out |= 0x01; /* D0 pin 2 */ + if(value & TRST_BIT) + out |= 0x10; /* Not used */ + if(value & TDI_BIT) + out |= 0x40; /* D7 pin 8 */ + if(value & TMS_BIT) + out |= 0x02; /* D1 pin 3 */ + + retval = cable_parallel_inout(out, &in); + + if(in & 0x80) /* S7 pin 11 */ + *inval = 1; + else + *inval = 0; + + return retval; +} + /*----------------------------------------------[ xess specific functions ]---*/ jtag_cable_t *cable_xess_get_driver(void) { Index: cable_parallel.h =================================================================== --- cable_parallel.h (revision 58) +++ cable_parallel.h (working copy) @@ -13,6 +13,10 @@ int cable_xpc3_inout(uint8_t value, uint8_t *inval); int cable_xpc3_out(uint8_t value); +jtag_cable_t *cable_bb2_get_driver(void); +int cable_bb2_inout(uint8_t value, uint8_t *inval); +int cable_bb2_out(uint8_t value); + jtag_cable_t *cable_xess_get_driver(void); int cable_xess_inout(uint8_t value, uint8_t *inval); int cable_xess_out(uint8_t value); ####################################################################### It seems work, I got the result below: $ sudo adv_jtag_bridge -x1 bb2 Connected to parallel port at 378 Dropping root privileges. Enumerating JTAG chain... WARNING: maximum supported devices on JTAG chain (1024) exceeded. Devices on JTAG chain: Index Name ID Code IR Length ---------------------------------------------------------------- 0: (unknown) 0xFFFFFFFF -1 1: (unknown) 0x7EFA6791 -1 2: (unknown) 0xFFFFFFFF -1 ... 1022: (unknown) 0xFFFFFFFF -1 1023: (unknown) 0xFFFFFFFF -1 Target device 1, JTAG ID = 0x7efa6791 ERROR! Unable to autoprobe IR length for device index 1; Must set IR size on command line. Aborting. from the result, we can get the jtag id, so I think the code has worked, but what I should do next, add some bsdl file or any thing else? regards |
|||
1/1

