diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-11-13 17:49:53 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2019-11-26 12:21:34 -0800 |
commit | 920198556e35edb86c081598ce757a06e12d7711 (patch) | |
tree | 08392e8e532c86a10cad6b733950ffd8e509f4e6 /host/lib/usrp/dboard/magnesium/magnesium_constants.hpp | |
parent | 8b929b2d4e02ccd6318dac9c7c0a633f0cf60511 (diff) | |
download | uhd-920198556e35edb86c081598ce757a06e12d7711.tar.gz uhd-920198556e35edb86c081598ce757a06e12d7711.tar.bz2 uhd-920198556e35edb86c081598ce757a06e12d7711.zip |
mg/rh/rfnoc: Harmonize peripheral registers
- Move the SPI addresses out of radio_control_impl
- Fix the GPIO address spaces for N310/N300
Diffstat (limited to 'host/lib/usrp/dboard/magnesium/magnesium_constants.hpp')
-rw-r--r-- | host/lib/usrp/dboard/magnesium/magnesium_constants.hpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/host/lib/usrp/dboard/magnesium/magnesium_constants.hpp b/host/lib/usrp/dboard/magnesium/magnesium_constants.hpp index 7d98bca91..3d670e4a3 100644 --- a/host/lib/usrp/dboard/magnesium/magnesium_constants.hpp +++ b/host/lib/usrp/dboard/magnesium/magnesium_constants.hpp @@ -94,12 +94,22 @@ static const std::vector<std::string> MAGNESIUM_GP_OPTIONS = {"manual", namespace n310_regs { -constexpr uint32_t DB_GPIO_BASE = 0x80000; // FIXME -constexpr uint32_t DB_GPIO_RB = 0x80000; // FIXME -constexpr uint32_t DB_GPIO_OFFSET = 0x100; // FIXME -constexpr uint32_t FP_GPIO = 0x80000; // FIXME -constexpr uint32_t RB_FP_GPIO = 0x80000; // FIXME - +static constexpr uint32_t PERIPH_BASE = 0x80000; +// Space between registers +static constexpr uint32_t PERIPH_REG_OFFSET = 8; +// Space between channels on the same dboard +static constexpr uint32_t CHAN_REG_OFFSET = 0x100 * PERIPH_REG_OFFSET; + +// db_control registers +static constexpr uint32_t SR_MISC_OUTS = PERIPH_BASE + 160 * PERIPH_REG_OFFSET; +static constexpr uint32_t SR_SPI = PERIPH_BASE + 168 * PERIPH_REG_OFFSET; +static constexpr uint32_t SR_FP_GPIO = PERIPH_BASE + 184 * PERIPH_REG_OFFSET; +static constexpr uint32_t SR_DB_GPIO = PERIPH_BASE + 192 * PERIPH_REG_OFFSET; + +static constexpr uint32_t RB_MISC_IO = PERIPH_BASE + 16 * PERIPH_REG_OFFSET; +static constexpr uint32_t RB_SPI = PERIPH_BASE + 17 * PERIPH_REG_OFFSET; +static constexpr uint32_t RB_DB_GPIO = PERIPH_BASE + 19 * PERIPH_REG_OFFSET; +static constexpr uint32_t RB_FP_GPIO = PERIPH_BASE + 20 * PERIPH_REG_OFFSET; } #endif /* INCLUDED_LIBUHD_MAGNESIUM_CONSTANTS_HPP */ |