Merge pull request #21 from johnp789/gpiojtag

Add support for reset and test pins via gpio driver
This commit is contained in:
Daniel Beer 2016-11-20 14:06:18 +13:00 committed by GitHub
commit df8de5daa3
2 changed files with 11 additions and 7 deletions

View File

@ -42,11 +42,13 @@ enum {
GPIO_TCK, GPIO_TCK,
GPIO_TMS, GPIO_TMS,
GPIO_TDO, GPIO_TDO,
GPIO_RST,
GPIO_TST,
GPIO_REQUIRED GPIO_REQUIRED
}; };
unsigned int jtag_gpios[4]; unsigned int jtag_gpios[6];
int fd_gpios[4]; int fd_gpios[6];
static int static int
gpio_open () gpio_open ()
@ -87,11 +89,13 @@ gpio_parse_config (const char *params)
{"tms=",GPIO_TMS}, {"tms=",GPIO_TMS},
{"tdi=",GPIO_TDI}, {"tdi=",GPIO_TDI},
{"tdo=",GPIO_TDO}, {"tdo=",GPIO_TDO},
{"tck=",GPIO_TCK} {"tck=",GPIO_TCK},
{"rst=",GPIO_RST},
{"tst=",GPIO_TST}
}; };
int i; int i;
for( i = 0;i < 4; i++) { for( i = 0;i < 6; i++) {
char* help; char* help;
help = strstr(params,ops[i].name); help = strstr(params,ops[i].name);
if (help) if (help)
@ -164,12 +168,12 @@ static void jtgpio_tdi(struct jtdev *p, int out)
static void jtgpio_rst(struct jtdev *p, int out) static void jtgpio_rst(struct jtdev *p, int out)
{ {
printf("jtag_reset\n"); gpio_set_value_fd (fd_gpios[GPIO_RST], out);
} }
static void jtgpio_tst(struct jtdev *p, int out) static void jtgpio_tst(struct jtdev *p, int out)
{ {
printf("jtag_test\n"); gpio_set_value_fd (fd_gpios[GPIO_TST], out);
} }
static int jtgpio_tdo_get(struct jtdev *p) static int jtgpio_tdo_get(struct jtdev *p)

View File

@ -203,7 +203,7 @@ Linux, ppi on FreeBSD and DragonFly BSD) must be specified via the
Connect to system gpios. JTAG mode must be used, and Connect to system gpios. JTAG mode must be used, and
only tty access is supported. Currently, this driver is only supported only tty access is supported. Currently, this driver is only supported
on Linux, FreeBSD and DragonFly BSD. The gpios to used must defined using on Linux, FreeBSD and DragonFly BSD. The gpios to used must defined using
a string like "tdi=7 tdo=8 tms=9 tck=4" via the a string like "tdi=7 tdo=8 tms=9 tck=4 rst=10 tst=11" via the
\fB-d\fR option. (dont forget the quotes) \fB-d\fR option. (dont forget the quotes)
.IP "\fBload-bsl\fR" .IP "\fBload-bsl\fR"