XilinxProcessorIPLib/drivers/axiethernet/examples/avb/xavb_example.c
static int AvbConfigHW(XAxiEthernet *AxiEthernetInstancePtr, XAvb *AvbInstancePtr)
{
	u32 ReadData;
	int Status;

	/*
	 * Configure MDIO Master in Axi Ethernet - MUST be done before
	 * any MDIO accesses
	 */
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
						XAE_MDIO_MC_OFFSET,0x0000005D);

	/*
	 * Disable Axi Ethernet Flow Control
	 */
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
						XAE_FCC_OFFSET,0x0);

	/*
	 * Initialise Axi Ethernet by enabling Tx and Rx with VLAN capability
	 */
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
			XAE_TC_OFFSET,XAE_TC_TX_MASK | XAE_TC_VLAN_MASK);
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
		XAE_RCW1_OFFSET, XAE_RCW1_RX_MASK | XAE_RCW1_VLAN_MASK);

	/*
	 * Initialise RTC reference clock for nominal frequency 125MHz -
	 * (see xavb_hw.h for value)
	 */
	XAvb_WriteReg(AvbInstancePtr->Config.BaseAddress,
				XAVB_RTC_INCREMENT_OFFSET,
				XAVB_RTC_INCREMENT_NOMINAL_RATE);

	Status = AvbConfigureGmii(AxiEthernetInstancePtr,AvbInstancePtr);
	return Status;
}
/*****************************************************************************/
/**
*
* This function configures Axi Ethernet core and AVB module.
*
* @param	AxiEthernetInstancePtr is a pointer to the Axi Ethernet driver
*		instance
* @param	AvbInstancePtr is a pointer to the AVB instance.
*
* @return	-XST_SUCCESS to indicate success
*		-XST_FAILURE to indicate failure.
*
* @note		None.
*
******************************************************************************/
This function configures Axi Ethernet core and AVB module.
This function configures Axi Ethernet core and AVB module .
static int AvbConfigHW(XAxiEthernet *AxiEthernetInstancePtr, XAvb *AvbInstancePtr)
{
	u32 ReadData;
	int Status;
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
						XAE_MDIO_MC_OFFSET,0x0000005D);
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
						XAE_FCC_OFFSET,0x0);
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
			XAE_TC_OFFSET,XAE_TC_TX_MASK | XAE_TC_VLAN_MASK);
	XAxiEthernet_WriteReg(AxiEthernetInstancePtr->Config.BaseAddress,
		XAE_RCW1_OFFSET, XAE_RCW1_RX_MASK | XAE_RCW1_VLAN_MASK);
	XAvb_WriteReg(AvbInstancePtr->Config.BaseAddress,
				XAVB_RTC_INCREMENT_OFFSET,
				XAVB_RTC_INCREMENT_NOMINAL_RATE);
	Status = AvbConfigureGmii(AxiEthernetInstancePtr,AvbInstancePtr);
	return Status;
}
static int AvbConfigHW ( XAxiEthernet * AxiEthernetInstancePtr , XAvb * AvbInstancePtr ) { u32 ReadData ; int Status ; XAxiEthernet_WriteReg ( AxiEthernetInstancePtr -> Config . BaseAddress , XAE_MDIO_MC_OFFSET , 0x0000005D ) ; XAxiEthernet_WriteReg ( AxiEthernetInstancePtr -> Config . BaseAddress , XAE_FCC_OFFSET , 0x0 ) ; XAxiEthernet_WriteReg ( AxiEthernetInstancePtr -> Config . BaseAddress , XAE_TC_OFFSET , XAE_TC_TX_MASK | XAE_TC_VLAN_MASK ) ; XAxiEthernet_WriteReg ( AxiEthernetInstancePtr -> Config . BaseAddress , XAE_RCW1_OFFSET , XAE_RCW1_RX_MASK | XAE_RCW1_VLAN_MASK ) ; XAvb_WriteReg ( AvbInstancePtr -> Config . BaseAddress , XAVB_RTC_INCREMENT_OFFSET , XAVB_RTC_INCREMENT_NOMINAL_RATE ) ; Status = AvbConfigureGmii ( AxiEthernetInstancePtr , AvbInstancePtr ) ; return Status ; }
This function configures Axi Ethernet core and AVB module.
This function configures Axi Ethernet core and AVB module .
/*
	 * Configure MDIO Master in Axi Ethernet - MUST be done before
	 * any MDIO accesses
	 */ /*
	 * Disable Axi Ethernet Flow Control
	 */ /*
	 * Initialise Axi Ethernet by enabling Tx and Rx with VLAN capability
	 */ /*
	 * Initialise RTC reference clock for nominal frequency 125MHz -
	 * (see xavb_hw.h for value)
	 */