Commit graph

28 commits

Author SHA1 Message Date
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
Sugandha Gupta
c81b4ac99f mpm: net: Add bridge utilities 2019-01-17 15:38:23 -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
Alex Williams
738b9ec102 mpm: Add convenience function to pull i2c bus from device tree
This function grabs the i2c character device path from the OF_NAME
property. That property must be unique in the device tree!
2018-11-07 18:26:13 -08:00
Mark Meserve
d0de7a5812 mpm: identify sysfs gpios more generically
- Allow generic path names to be given for each search parameter instead of
  only checking the label
2018-10-18 18:15:25 -07:00
Trung Tran
b357278c1b mpm: add link_speed xport_info 2018-09-13 14:47:54 -07:00
Sugandha Gupta
2c91648c7f mpm: sys_utils: Get list of temperatures from all thermal zones 2018-08-09 17:39:14 -07:00
Brent Stapleton
5b18614d39 uio: mpm: Fixup for opening mboard-regs UIO
- Fix the syntax to open mboard-regs UIO objects, and change the open()
and close() functions to be private.
- We were calling open() twice in every context manager line- once
manually, and once in __enter__. This commit corrects those usages, and
allows the context manager to fully manage the opening and closing of
UIO objects.
2018-07-23 10:33:34 -07:00
Martin Braun
e56d9188f7 mpm: uio: Fix use of logger
When logger==None, it uio.py would fail.
2018-07-19 10:31:40 -07:00
Martin Braun
8762a4d444 mpm: net: Fix rare failures for IP addr detection
Because the detection of valid Ethernet devices happens across multiple
calls in a non-atomic fashion, we cannot assume that a device passed to
net.get_iface_info() actually has a valid IP address, so we don't make
that assumption.
2018-06-08 14:58:20 -07:00
Brent Stapleton
86dbaee5b8 mpm: adding reference counters to UIO
UIO objects now count references on open and close calls. This should
prevent problems with nested function calls that open/close the same
UIO object.

References counts are not atomic -- this is intended for nesting with
statements within the same thread context.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2018-03-14 16:45:45 -07:00
Martin Braun
37e49f56b1 mpm: sysfs_gpio: Throw exception on unsuccessful init
In case of a lost connection to a sysfs-gpio device, this will trigger
the correct errors.
2018-03-08 10:54:19 -08:00
Martin Braun
725debb964 mpm: Rename n310 to n3xx
This module (and class) are, in fact, used for all N3xx-derivates so
renaming it is the more correct thing to do.
2018-03-05 15:56:41 -08:00
Martin Braun
0cb30c8412 mpm: net: Add get_hostname() 2018-03-02 13:48:14 -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
Trung N Tran
43969f4758 mpm: remove GPIOBank.set_all function
-set_all function doesn't fit well with the GPIO api. It is rather
a test sepecific function.
-Add gpio_set_all helper to n3xx_bist.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-02-09 18:02:44 +01:00
Martin Braun
e6dc09470d mpm: Add prefs modules
- prefs is a module for centralized preferences management
- Uses Python's ConfigParser module
2018-02-08 22:18:14 +01:00
Martin Braun
0e285428df mpm: net: Add get_local_ip_addrs() method 2018-02-07 13:44:54 -08:00
Trung N Tran
8f5f38e4f9 mpm: convert to string explicitly in GPIOBank 2018-01-24 17:33:34 -08:00
Martin Braun
15e36d8c36 mpm: Demoting watchdog related log message to DEBUG 2018-01-19 17:00:48 -08:00
Martin Braun
66d0257b2e mpm: Enable systemd watchdog and update it from MPM
- Updated systemd service file
- Added health status flag in shared data object
- Added thread in RPC process to update watchdog

Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-01-15 10:45:07 -08:00
Martin Braun
032e483adc mpm: sys_utils: Add watchdog module
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-01-15 10:45:07 -08:00
Martin Braun
d682a90255 mpm: Factor GPIO panel code into common module
GPIOBank is the new class, n310.FrontpanelGPIO and BackpanelGPIO now
derive from that.

Other minor changes:
- Renamed classes to FrontpanelGPIO and BackpanelGPIO in accordance
  with coding guidelines
- Moved MboardRegsControl before n310 class for consistent code layout
2018-01-10 17:31:21 -08:00
Trung Tran
0db52a520b mpm: Add sysfs_thermal module
This will provide an API call to read thermal values via udev.
2017-12-22 15:06:11 -08:00
Martin Braun
a5432174b9 mpm: Fix linter warnings
- Magnesium: Bad formatting in DRP setup
- PeriphManagerBase: Import order
- dtoverlay: Missed default value for param
2017-12-22 15:06:03 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Brent Stapleton
0bf22a3e57 mpm: UIOs now open only when necessary
Refactoring to use the C++-based UIO objects. The Liberio and Ethernet
objects now open the UIO before using it, and close it once done.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
d3e6dd1140 mpm: Harmonize imports, tidy + sort modules
- Moved nijesdcore to cores/
- Moved udev, net, dtoverlay, uio to sys_utils/
- Made all imports non-relative (except in __init__.py files)
- Removed some unnecessary imports
- Reordered some imports for Python conventions
2017-12-22 15:05:58 -08:00