From 920198556e35edb86c081598ce757a06e12d7711 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Wed, 13 Nov 2019 17:49:53 -0800 Subject: mg/rh/rfnoc: Harmonize peripheral registers - Move the SPI addresses out of radio_control_impl - Fix the GPIO address spaces for N310/N300 --- .../usrp/dboard/magnesium/magnesium_constants.hpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'host/lib/usrp/dboard/magnesium/magnesium_constants.hpp') 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 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 */ -- cgit v1.2.3