Skip to content

Commit 45a6250

Browse files
committed
Update FPGA ID list and adjust part matching to handle multiple parts with the same JTAG ID
Signed-off-by: Alex Forencich <[email protected]>
1 parent 2cebcdf commit 45a6250

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

lib/mqnic/fpga_id.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@ const struct fpga_id fpga_id_list[] =
134134
// Kria SoM (Zynq UltraScale+)
135135
{FPGA_ID_XCK26, FPGA_ID_MASK_NOVER, "XCK26"},
136136
// Alveo (Virtex UltraScale+)
137-
{FPGA_ID_XCU50, FPGA_ID_MASK_NOVER, "XCU50"},
138-
{FPGA_ID_XCU200, FPGA_ID_MASK_NOVER, "XCU200"},
139-
{FPGA_ID_XCU250, FPGA_ID_MASK_NOVER, "XCU250"},
140-
{FPGA_ID_XCU280, FPGA_ID_MASK_NOVER, "XCU280"},
137+
{FPGA_ID_XCU50_XCU55N, FPGA_ID_MASK_NOVER, "XCU50_XCU55N"},
138+
{FPGA_ID_XCU200, FPGA_ID_MASK_NOVER, "XCU200"},
139+
{FPGA_ID_XCU250, FPGA_ID_MASK_NOVER, "XCU250"},
140+
{FPGA_ID_XCU280_XCU55C, FPGA_ID_MASK_NOVER, "XCU280_XCU55C"},
141141
// Versal AI Edge
142142
{FPGA_ID_XCVE1752, FPGA_ID_MASK_NOVER, "XCVE1752"},
143143
{FPGA_ID_XCVE2002, FPGA_ID_MASK_NOVER, "XCVE2002"},

lib/mqnic/fpga_id.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,10 @@
134134
// Kria SoM (Zynq UltraScale+)
135135
#define FPGA_ID_XCK26 0x4A49093
136136
// Alveo (Virtex UltraScale+)
137-
#define FPGA_ID_XCU50 0x4B77093
138-
#define FPGA_ID_XCU200 0x4B37093
139-
#define FPGA_ID_XCU250 0x4B57093
140-
#define FPGA_ID_XCU280 0x4B7D093
137+
#define FPGA_ID_XCU50_XCU55N 0x4B77093
138+
#define FPGA_ID_XCU200 0x4B37093
139+
#define FPGA_ID_XCU250 0x4B57093
140+
#define FPGA_ID_XCU280_XCU55C 0x4B7D093
141141
// Versal AI Edge
142142
#define FPGA_ID_XCVE1752 0x4C9A093
143143
#define FPGA_ID_XCVE2002 0x4CC1093

utils/mqnic-fw.c

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,11 @@ int main(int argc, char *argv[])
998998
{
999999
// read bit file
10001000
struct bitfile *bf;
1001+
char fpga_part[128];
1002+
char *ptr1, *ptr2;
1003+
int match = 0;
10011004

1005+
printf("Reading bit file \"%s\"...\n", write_file_name);
10021006
bf = bitfile_create_from_file(write_file_name);
10031007

10041008
if (!bf)
@@ -1009,7 +1013,29 @@ int main(int argc, char *argv[])
10091013
goto err;
10101014
}
10111015

1012-
if (stristr(bf->part, dev->fpga_part) != bf->part)
1016+
printf("Part: %s\n", bf->part);
1017+
printf("Date: %s %s\n", bf->date, bf->time);
1018+
1019+
// check device type
1020+
// dev->fpga_part may contain multiple possible device types, separated by underscores
1021+
strcpy(fpga_part, dev->fpga_part);
1022+
ptr1 = ptr2 = fpga_part;
1023+
1024+
while (ptr2)
1025+
{
1026+
ptr2 = strchr(ptr1, '_');
1027+
1028+
if (ptr2)
1029+
*ptr2 = 0;
1030+
1031+
if (stristr(bf->part, ptr1) == bf->part)
1032+
match = 1;
1033+
1034+
if (ptr2)
1035+
ptr1 = ptr2+1;
1036+
}
1037+
1038+
if (!match)
10131039
{
10141040
fprintf(stderr, "Device mismatch (target is %s, file is %s)\n", dev->fpga_part, bf->part);
10151041
bitfile_close(bf);
@@ -1018,6 +1044,7 @@ int main(int argc, char *argv[])
10181044
goto err;
10191045
}
10201046

1047+
// check for available space
10211048
if (bf->data_len > segment_size)
10221049
{
10231050
fprintf(stderr, "File larger than segment (%ld > %ld)\n", bf->data_len, segment_size);

0 commit comments

Comments
 (0)