From 91a5518443f4ff938f67a2f1bd1b09b24bceecd5 Mon Sep 17 00:00:00 2001 From: Moritz Fischer Date: Wed, 25 Apr 2018 18:01:09 -0700 Subject: 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 Signed-off-by: Moritz Fischer --- mpm/tools/db-id.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mpm/tools/db-id.c') 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); -- cgit v1.2.3