xilskey: Add check for JS_ONES flag in jtag lib

Add check for JS_ONES flag and handle it.

Signed-off-by: Harini Katakam <harinik@xilinx.com>
This commit is contained in:
Harini Katakam 2014-11-03 15:41:00 +05:30 committed by Suneel Garapati
parent 5f9ae570bf
commit 2e6c402ee2

View file

@ -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);