aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/tools/db-id.c
diff options
context:
space:
mode:
authorMoritz Fischer <moritz.fischer@ettus.com>2018-04-25 18:01:09 -0700
committerMartin Braun <martin.braun@ettus.com>2018-06-20 17:10:05 -0500
commit91a5518443f4ff938f67a2f1bd1b09b24bceecd5 (patch)
treeeb4adccd6d3c687d157d4a4073e76970a5ed0a69 /mpm/tools/db-id.c
parent0935bf5c2a6952fd07bc4b6c618d12b0bd79ca78 (diff)
downloaduhd-91a5518443f4ff938f67a2f1bd1b09b24bceecd5.tar.gz
uhd-91a5518443f4ff938f67a2f1bd1b09b24bceecd5.tar.bz2
uhd-91a5518443f4ff938f67a2f1bd1b09b24bceecd5.zip
mpm: tools: Introduce dt-compat and mcu-compat fields
Introduce dt-compat and mcu-compat fields into the eeprom structure. For the motherboard eeprom this is straightforward, since there's still padding bytes that could be (ab)used for this. On the dboard side more creativity is required and the original revision field of 2 bytes is reduced to only one byte revision and one byte dt-compat. Since this will only affect new units being backwards compatible with older versions of the bootloader is not an issue. Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com> Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'mpm/tools/db-id.c')
-rw-r--r--mpm/tools/db-id.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mpm/tools/db-id.c b/mpm/tools/db-id.c
index 53501e0df..87c06392b 100644
--- a/mpm/tools/db-id.c
+++ b/mpm/tools/db-id.c
@@ -10,10 +10,17 @@
static void usrp_sulfur_db_eeprom_print_id(struct usrp_sulfur_db_eeprom *ep)
{
+ int rev;
+
+ if (ntohl(ep->version) == 1)
+ rev = ntohs(ep->rev.v1_rev);
+ else
+ rev = ep->rev.v2_rev.rev;
+
if (ntohs(ep->pid) == 0x150)
- printf("product=ni,magnesium-rev%x\n", ntohs(ep->rev)+1);
+ printf("product=ni,magnesium-rev%x\n", rev + 1);
else if (ntohs(ep->pid) == 0x180)
- printf("product=ni,eiscat-rev%x\n", ntohs(ep->rev)+1);
+ printf("product=ni,eiscat-rev%x\n", rev + 1);
else
printf("product=unknown-(%04x)\n", ep->pid);