Select Git revision
unbosx_eth_regs.h
-
Pieter Donker authoredPieter Donker authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
unbosx_eth_regs.h 6.89 KiB
/* -----------------------------------------------------------------------------
*
* Copyright (C) 2010
* ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/>
* JIVE (Joint Institute for VLBI in Europe) <http://www.jive.nl/>
* P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
---------------------------------------------------------------------------- */
#ifndef AVS_ETH_REGS_H
#define AVS_ETH_REGS_H
/* includes */
#include "io.h"
/* public constants */
// TSE MAC registers
#define AVS_ETH_TSE_PCS_ADDR_BASE (0x200)
#define AVS_ETH_TSE_RX_FIFO_DEPTH 256
#define AVS_ETH_TSE_TX_FIFO_DEPTH 256
#define AVS_ETH_TSE_TX_READY_LATENCY 1
#define AVS_ETH_TSE_PCS_LINK_STATUS_BIT (0x4)
// ETH registers
#define AVS_ETH_DEMUX_NOF_UDP_PORTS 4
#define AVS_ETH_REG_DEMUX_NOF_WORDS AVS_ETH_DEMUX_NOF_UDP_PORTS
#define AVS_ETH_REG_CONFIG_NOF_WORDS 4
#define AVS_ETH_REG_CONTROL_NOF_WORDS 1
#define AVS_ETH_REG_FRAME_NOF_WORDS 1
#define AVS_ETH_REG_STATUS_NOF_WORDS 1
#define AVS_ETH_REG_DEMUX_WI 0
#define AVS_ETH_REG_CONFIG_WI (AVS_ETH_REG_DEMUX_WI + AVS_ETH_REG_DEMUX_NOF_WORDS)
#define AVS_ETH_REG_CONTROL_WI (AVS_ETH_REG_CONFIG_WI + AVS_ETH_REG_CONFIG_NOF_WORDS)
#define AVS_ETH_REG_FRAME_WI (AVS_ETH_REG_CONTROL_WI + AVS_ETH_REG_CONTROL_NOF_WORDS)
#define AVS_ETH_REG_STATUS_WI (AVS_ETH_REG_FRAME_WI + AVS_ETH_REG_FRAME_NOF_WORDS)
#define AVS_ETH_REG_CONTINUE_WI (AVS_ETH_REG_STATUS_WI + AVS_ETH_REG_STATUS_NOF_WORDS)
// AVS_ETH_REG_DEMUX fields
#define AVS_ETH_UDP_PORT_MASK (0xFFFF)
#define AVS_ETH_UDP_PORT_OFST 0
#define AVS_ETH_UDP_PORT_EN_BIT_MASK (0x10000)
#define AVS_ETH_UDP_PORT_EN_BIT_OFST 16
// AVS_ETH_REG_CONFIG words
#define AVS_ETH_REG_CONFIG_SRC_MAC_LO AVS_ETH_REG_CONFIG_WI
#define AVS_ETH_REG_CONFIG_SRC_MAC_HI (AVS_ETH_REG_CONFIG_WI + 1)
#define AVS_ETH_REG_CONFIG_SRC_IP (AVS_ETH_REG_CONFIG_WI + 2)
#define AVS_ETH_REG_CONFIG_CTRL (AVS_ETH_REG_CONFIG_WI + 3)
// AVS_ETH_REG_CONTROL fields
#define AVS_ETH_REG_CONTROL_RX_EN_BIT_MASK (0x1)
#define AVS_ETH_REG_CONTROL_RX_EN_BIT_OFST 0
#define AVS_ETH_REG_CONTROL_TX_EN_BIT_MASK (0x2)