Commit graph

28 commits

Author SHA1 Message Date
Lars Amsel
d1458a2cf3 MPM: add ability to run scripts to MPM shell
MPM shell now supports script execution. It utilizes the cmdqueue of
Pythons cmd.Cmd class for this. The script to execute is a text file
containing the commands one per line.

The output decoration of MPM shell changed. Commands are decorated with
">" whereas responses use "<" at line start. Multiline responses are
decorated in each line.

Cleanup overwritten methods of cmd.Cmd to allow proper shutdow in
interactive as well as in scripted mode.

Improved pylint score.
2020-02-07 09:14:41 -06:00
bidavis
9ca8504f8e mpm: include the failed mpm_shell command
This commit changes an mpm_shell error message to include the command
that failed when the mpm_shell does not have the claim token.
2020-01-06 14:33:33 -08:00
Martin Braun
0812a5f6bf mpm: Add MB-EEPROMv3
This includes a rev_compat field, which we can use to identify the last
hardware revision this hardware is compatible with. Example: Say the
current hardware revision is 7, but it is compatible with version 5,
then we store 7 as the current rev, and 5 as the rev_compat. Software
can now check the rev_compat rather than the current rev for
compatibility. This makes MPM more future-proof against minor,
compatible hardware changes.
2019-05-10 16:59:58 -07:00
Sugandha Gupta
178b35569b e310/e320: Move E310 to MPM architecture and refactor
- Turns the E310 into an MPM device (like N3xx, E320)
- Factor out common code between E320 and E310, maximize sharing between
  the two devices
- Remove all pre-MPM E310 code that is no longer needed
- Modify MPM to remove all existing overlays before applying new ones
  (this is necessary to enable idle image mode for E310)

Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2019-05-01 15:17:23 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Alex Williams
ea0b759c02 mpm_shell: Multiprocessing instead of threading for claimer loop
If we use threading, the claimer loop's thread won't get scheduled in a
timely manner on n3xx. Using multiprocessing frees the claimer loop from
using the same GIL and gives back timely reclaim calls.
2018-12-17 17:43:55 -08:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Derek Kozel
b8abcdbec3 mpm: tools: Added Rhodium ID to db-id utility 2018-10-25 10:30:59 -07:00
Alex Williams
8f6dff00ec tools: Fix handling of 0-valued dt-compat
A value of 0 for dt-compat would cause db-init to use the rev
instead. This fixes the check to be on number of args instead of
the dt-compat value.
2018-09-12 11:55:46 -07:00
Brent Stapleton
503b087b24 mpm: Fix eeprom-tools in CMake
Fixes the list of epprom-tools to be built in CMake. The list of tools
is appended, instead of being overwritten by device-specific tools.

Fixes: 300a5e3f6e [mpm: initial commit of E320 code]
2018-07-19 14:41:06 -07:00
Moritz Fischer
23ff5c277f mpm: tools: eeprom-id: Add E320 product id to eeprom-id
Add E320 product id to eeprom-id executable

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-07-18 15:37:27 -07:00
Brent Stapleton
300a5e3f6e mpm: initial commit of E320 code
Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com>
2018-07-18 15:37:27 -07:00
Moritz Fischer
d31f463415 mpm: tools: eeprom-init: Fix issue with dt/mcu-compat number
Fix issue with dt-compat and mcu-compat numbers not working for
the case where 0 is a legitimate dt/mcu compat number.

This can happen if a Rev2 board (1 in hardware) shares a DT or
MCU firmware with the Rev1 board (0 in hardware).

Fixes 91a5518443 ("mpm: tools: Introduce dt-compat ...")
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-07-12 16:46:10 -07:00
Moritz Fischer
91a5518443 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>
2018-06-20 17:10:05 -05:00
Derek Kozel
4cd4b1559f mpm: Fixed db slot typo in db-id 2018-04-23 14:03:59 -07:00
Brent Stapleton
1b49089d85 mpm: break up device compilation
Breaking up dboard compilation based on the target MPM_DEVICE.
2018-03-05 15:56:41 -08:00
Martin Braun
9c8edf8fd4 mpm: Update EEPROM tools to allow setting PID
Default behaviour is to fall back to writing the N310 PID (0x4242).

Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-03-05 15:56:41 -08:00
Martin Braun
e9288a439c mpm: Update all license headers
- Fix typo in company name (missing 'a')
- Updated SPDX license identifier to version 3.0
2018-02-19 16:55:08 -08:00
Derek Kozel
f764f5ea6d mpm: Changed mpm_shell to support scripted use 2018-01-24 10:32:30 -08:00
Martin Braun
deccab5a1b mpm: Add EEPROM utilities for N310
Actually-written-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-01-12 17:30:53 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Martin Braun
275b81c341 mpm: Add 'hijack' mode to mpm_shell 2017-12-22 15:05:06 -08:00
Martin Braun
d711ad4c93 mpm: RPC methods now tell us if they need a claim
On the RPC server side, we keep track of which methods require a claim
token. MPM shell uses this info to automatically add claim tokens when
required.
2017-12-22 15:04:00 -08:00
Martin Braun
f24b7fcdbd mpm: Added mpm_shell.py
Was actually the old rpc_shell.py, was renamed and heavily refactored.
Now includes claim logic and other fancy features.
2017-12-22 15:04:00 -08:00
Martin Braun
2bd564ca22 mpm: Replaced xrange with range for better Python future-proofing 2017-12-22 15:03:58 -08:00
Andrej Rode
6a12add156 mpm: mpm reorganization 2017-12-22 15:03:45 -08:00
Andrej Rode
8ac9014d5c mpm: CMake cleanup, Python code enhancements
- Send user defined data in ping
- Improve rpc_shell, add mpm_debug.py, fix tracebacks in multiprocessing
2017-12-22 15:03:44 -08:00
Martin Braun
1a4348038d Initial commit for N3xx development.
- Creates mpm/ subdirectory
- First pass at hardware daemon/MPM
- New code for LMK04828, AD9371
- spidev integration

Contributions by:

Martin Braun <martin.braun@ettus.com>
Derek Kozel <derek.kozel@ettus.com>
Mark Meserve <mark.meserve@ni.com>
Andrej Rode <andrej.rode@ettus.com>
2017-12-22 15:03:44 -08:00