From 2e6c402ee2387a72abd47aae1ce1c65407260e76 Mon Sep 17 00:00:00 2001 From: Harini Katakam Date: Mon, 3 Nov 2014 15:41:00 +0530 Subject: [PATCH] xilskey: Add check for JS_ONES flag in jtag lib Add check for JS_ONES flag and handle it. Signed-off-by: Harini Katakam --- lib/sw_services/xilskey/src/xilskey_jscmd.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/sw_services/xilskey/src/xilskey_jscmd.c b/lib/sw_services/xilskey/src/xilskey_jscmd.c index 6e48da0c..0300b8fd 100755 --- a/lib/sw_services/xilskey/src/xilskey_jscmd.c +++ b/lib/sw_services/xilskey/src/xilskey_jscmd.c @@ -606,12 +606,16 @@ int jtagShiftTDIBits (unsigned char* tdiBuf, unsigned char* tdoBuf, int bitCount int currentByteCount = getByteCountFromBitCount (bitCount); int byteCount = currentByteCount; int index = 0; + unsigned char TdiTemp = 0x0; int bitsLeft = 8; if (bitCount % 8) { bitsLeft = bitCount % 8; } + if(flags | JS_ONES) + TdiTemp = 0xFF; + while (index < byteCount) { currentByteCount--; @@ -642,7 +646,11 @@ int jtagShiftTDIBits (unsigned char* tdiBuf, unsigned char* tdoBuf, int bitCount tdoByte = &tdoBuf [index]; } - jtagShiftTDI (tdiBuf [index], tdoByte, count, exitState); + if(tdiBuf != NULL) + jtagShiftTDI (tdiBuf [index], tdoByte, count, exitState); + else + jtagShiftTDI (TdiTemp, tdoByte, count, exitState); + if (tdoBuf) js_printf ("tdoBuf=0x%02X\n", *tdoByte);