diff options
author | Martin Braun <martin.braun@ettus.com> | 2022-01-28 11:56:11 +0100 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2022-02-24 14:00:07 -0600 |
commit | 8ca640b922700276abb86adde1b5ad46f3d2af07 (patch) | |
tree | 13190bed0163c696039cd00be4e33b9a79036d4e /mpm/tools/eeprom-pids.h | |
parent | 1d0806092491dc172ba31312840df02d8ec0b11a (diff) | |
download | uhd-8ca640b922700276abb86adde1b5ad46f3d2af07.tar.gz uhd-8ca640b922700276abb86adde1b5ad46f3d2af07.tar.bz2 uhd-8ca640b922700276abb86adde1b5ad46f3d2af07.zip |
mpm: eeprom: Fix default values in EEPROM utilities
When executing eeprom-init on E320 (which was originally written for
N310), it would use defaults from N310, potentially causing issues.
These issues would have arisen if we letter-revved the E320 one more
time (because at rev 5, N310 had a compatibility cutover).
Summary of changes:
- eeprom-init will now read values *not* given on the command line from
the existing content of the EEPROM, if it contains valid data. This
means that DT, MCU, and rev compat values will no longer get
auto-derived if the EEPROM already contained "good" values.
- If the EEPROM is empty or corrupted, eeprom-init will no longer run if
the pid value is not provided. This is to avoid N310 defaults being
written to E320 EEPROMs.
- A README is added to explain which devices use which utilities.
- PID checks are more strict now. It is unlikely we'll build new devices
using the old EEPROM format (prior to TLV), so we can check
specifically for E320, N3x0.
- The hard-coded list of PIDs for the EEPROM tools are moved to
a central location (eeprom-pids.h).
- The code to derive values for DT/MCU/rev compat from the rev is now
pid-specific and no longer device-agnostic.
Diffstat (limited to 'mpm/tools/eeprom-pids.h')
-rw-r--r-- | mpm/tools/eeprom-pids.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mpm/tools/eeprom-pids.h b/mpm/tools/eeprom-pids.h new file mode 100644 index 000000000..c980c12ed --- /dev/null +++ b/mpm/tools/eeprom-pids.h @@ -0,0 +1,14 @@ +// +// Copyright 2022 Ettus Research, a National Instruments Brand +// +// SPDX-License-Identifier: GPL-3.0-or-later +// + +#ifndef EEPROM_PIDS_H +#define EEPROM_PIDS_H + +#define N310_PID 0x4242 +#define N300_PID 0x4240 +#define E320_PID 0xe320 + +#endif /* EEPROM_PIDS_H */ |