Unit GENET

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


Broadcom GENET Gigabit Ethernet Driver unit

This driver supports members of the Broadcom family of Gigabit Ethernet devices including the BCM54213PE contained in the Raspberry Pi 4B.

These devices support speeds of 10BASE-T, 100BASE-TX and 1000BASE-T and include a range of features including WOL and EEE.

The device included in the Raspberry Pi 4B uses a memory mapped interface which supports multiple TX and RX queues with priority queueing, hardware filtering and DMA bus master transfers.

Constants



[Expand]
GENET specific constants GENET_*


[Expand]
DMA configuration DMA_MAX_*


[Expand]
RX status bits STATUS_RX_*


[Expand]
TX status bits STATUS_TX_*


[Expand]
DMA descriptor DMA_DESC_*


[Expand]
UniMAC registers UMAC_*


[Expand]
Receive buffer registers RBUF_*


[Expand]
Hardware filter block (HFB) RBUF_HFB_*


[Expand]
Transmit buffer registers TBUF_*


[Expand]
Hardware filter block (HFB) registers HFB_*


[Expand]
UniMAC INTRL2 registers INTRL2_CPU_*


[Expand]
UniMAC INTRL2 IRQ0 definitions UMAC_IRQ0_*


[Expand]
UniMAC INTRL2 IRQ1 definitions UMAC_IRQ1_*


[Expand]
GENET register block offsets GENET_*_OFF


[Expand]
SYS block offsets and register definitions SYS_*


[Expand]
Ext block register offsets and definitions EXT_*


[Expand]
DMA rings size DMA_RING_SIZE*


[Expand]
DMA registers common definitions DMA_RW_POINTER_*


[Expand]
DMA ring size register DMA_RING_*


[Expand]
DMA interrupt threshold register DMA_INTR_*


[Expand]
DMA XON/XOFF register DMA_XON_THREHOLD_*


[Expand]
DMA flow period register DMA_FLOW_*


[Expand]
DMA control register DMA_EN_*


[Expand]
DMA status register DMA_DESC_*


[Expand]
DMA SCB burst size register DMA_SCB_BURST_*


[Expand]
DMA activity vector register DMA_ACTIVITY_*


[Expand]
DMA backpressure mask register DMA_BACKPRESSURE_MASK*


[Expand]
DMA backpressure status register DMA_BACKPRESSURE_*


[Expand]
DMA override register DMA_*_MODE_*


[Expand]
DMA timeout register DMA_TIMEOUT_*


[Expand]
TDMA rate limiting control register DMA_RATE_*


[Expand]
TDMA arbitration control register DMA_ARBITER_*


[Expand]
TX/RX DMA descriptor common bits DMA_BUFLENGTH_*


[Expand]
TX specific DMA descriptor bits DMA_TX_*


[Expand]
RX specific DMA descriptor bits DMA_RX_*


[Expand]
GENET power management mode GENET_POWER_*


[Expand]
GENET hardware flags GENET_HAS_*


[Expand]
RX/TX DMA registers DMA_CTRL*


[Expand]
RDMA/TDMA ring registers TDMA_*


[Expand]
UniMAC specific constants MDIO_*


[Expand]
Broadcom PHY ID PHY_ID_BCM*


[Expand]
Broadcom PHY flags PHY_BCM_FLAGS_*


[Expand]
Broadcom BCM54XX register definitions MII_BCM54XX_*


[Expand]
Broadcom auxilliary control shadow access registers MII_BCM54XX_AUXCTL_*


[Expand]
Broadcom LED source encodings BCM_LED_SRC_*


[Expand]
Broadcom multicolor LED configurations (expansion register 4) BCM_*_MULTICOLOR*


[Expand]
BCM5482 shadow registers BCM54XX_SHD_*


[Expand]
Expansion shadow access registers MII_BCM54XX_EXP_*


[Expand]
BCM5482 secondary SerDes registers BCM5482_SSD_*


[Expand]
BCM54810 registers BCM54810_*


Type definitions



GENET network

[Expand]

PGENETNetwork = ^TGENETNetwork;

TGENETNetwork = record

GENET RX/TX control block

[Expand]

PGENETControlBlock = ^TGENETControlBlock;

TGENETControlBlock = record

GENET control blocks

[Expand]

PGENETControlBlocks = ^TGENETControlBlocks;

TGENETControlBlocks = array[0..GENET_TOTAL_DESC - 1] of TGENETControlBlock;

GENET RX ring int enable

TGENETRXRingIntEnable = procedure(Network:PGENETNetwork; Ring:PGENETRXRing);

GENET RX ring int disable

TGENETRXRingIntDisable = procedure(Network:PGENETNetwork; Ring:PGENETRXRing);

GENET RX ring buffer

[Expand]

PGENETRXRing = ^TGENETRXRing;

TGENETRXRing = record

GENET RX rings buffer

[Expand]

PGENETRXRings = ^TGENETRXRings;

TGENETRXRings = array[0..GENET_DESC_INDEX] of TGENETRXRing;

GENET TX ring int enable

TGENETTXRingIntEnable = procedure(Network:PGENETNetwork;Ring:PGENETTXRing);

GENET TX ring int disable

TGENETTXRingIntDisable = procedure(Network:PGENETNetwork;Ring:PGENETTXRing);

GENET TX ring buffer

[Expand]

PGENETTXRing = ^TGENETTXRing;

TGENETTXRing = record

GENET TX rings buffer

[Expand]

PGENETTXRings = ^TGENETTXRings;

TGENETTXRings = array[0..GENET_DESC_INDEX] of TGENETTXRing;

GENET RX/TX DMA registers

[Expand]

PGENETDMARegisters = ^TGENETDMARegisters;

TGENETDMARegisters = array[DMA_RING_CFG..DMA_RING16_TIMEOUT] of Byte;

GENET RX/TX DMA ring registers

[Expand]

PGENETDMARingRegisters = ^TGENETDMARingRegisters;

TGENETDMARingRegisters = array[TDMA_READ_PTR..TDMA_WRITE_PTR_HI] of Byte;

GENET status 64

[Expand]

PGENETStatus64 = ^TGENETStatus64;

TGENETStatus64 = record


Public variables



GENET specific variables

GENET_PHY_MODE:String;
GENET_PHY_ADDR:LongWord;
GENET_SKIP_UMAC_RESET:Boolean;
GENET_NO_PHY_INTERRUPT:Boolean;


Function declarations



GENET functions

[Expand]
function GENETNetworkCreate(Address:PtrUInt; MDIOOffset:LongWord; IRQ0,IRQ1:LongWord):PNetworkDevice;
Description: Create and register a new GENET Network device which can be accessed using the Network API


[Expand]
function GENETNetworkDestroy(Network:PNetworkDevice):LongWord;
Description: Close, deregister and destroy a GENET Network device created by this driver


GENET network functions

[Expand]
function GENETNetworkOpen(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceOpen API for GENET Network


[Expand]
function GENETNetworkClose(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceClose API for GENET Network


[Expand]
function GENETNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Description: Implementation of NetworkDeviceControl API for GENET Network


[Expand]
function GENETBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferAllocate API for GENET Network


[Expand]
function GENETBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferRelease API for GENET Network


[Expand]
function GENETBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferReceive API for GENET Network


[Expand]
function GENETBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferTransmit API for GENET Network


GENET helper functions

[Expand]
function GENETGetHardwareParameters(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function GENETGetMACAddress(Network:PGENETNetwork; Address:PHardwareAddress):LongWord;
Description: Get the current MAC address from a GENET Network device


[Expand]
function GENETSetMACAddress(Network:PGENETNetwork; Address:PHardwareAddress):LongWord;
Description: Set the current MAC address for a GENET Network device


[Expand]
procedure GENETPowerUp(Network:PGENETNetwork; Mode:LongWord);
Description: To be documented


[Expand]
function GENETPowerDown(Network:PGENETNetwork; Mode:LongWord):LongWord;
Description: Power down the unimac, based on mode


[Expand]
procedure GENETResetUMAC(Network:PGENETNetwork);
Description: To be documented


[Expand]
procedure GENETUMACReset(Network:PGENETNetwork);
Description: To be documented


[Expand]
procedure GENETInitUMAC(Network:PGENETNetwork);
Description: To be documented


[Expand]
function GENETInitializeDMA(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function GENETFinalizeDMA(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function GENETShutdownDMA(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function GENETDisableDMA(Network:PGENETNetwork; FlushRX:Boolean):LongWord;
Description: Returns a reusable DMA control register value


[Expand]
procedure GENETEnableDMA(Network:PGENETNetwork; DMAControl:LongWord);
Description: To be documented


[Expand]
function GENETInitRXQueues(Network:PGENETNetwork):LongWord;
Description: Initialize RX queues


[Expand]
procedure GENETInitTXQueues(Network:PGENETNetwork);
Description: Initialize TX queues


[Expand]
function GENETInitRXRing(Network:PGENETNetwork; Index,Size,First,Last:LongWord):LongWord;
Description: Initialize an RX DMA ring


[Expand]
procedure GENETInitTXRing(Network:PGENETNetwork; Index,Size,First,Last:LongWord);
Description: Initialize a TX DMA ring along with corresponding hardware registers


[Expand]
function GENETAllocRXBuffers(Network:PGENETNetwork; Ring:PGENETRXRing):LongWord;
Description: Assign buffer to RX DMA descriptor


[Expand]
procedure GENETFreeRXBuffers(Network:PGENETNetwork);
Description: To be documented


[Expand]
procedure GENETHFBInit(Network:PGENETNetwork);
Description: To be documented


[Expand]
procedure GENETHFBClear(Network:PGENETNetwork);
Description: Clear Hardware Filter Block and disable all filtering


[Expand]
procedure GENETInterfaceStart(Network:PGENETNetwork);
Description: To be documented


[Expand]
procedure GENETInterfaceStop(Network:PGENETNetwork);
Description: To be documented


[Expand]
function GENETMIIProbe(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
procedure GENETMIISetup(Network:PGENETNetwork);
Description: Setup netdev link state when PHY link status change and update UMAC and RGMII block when link up


[Expand]
function GENETMIIConfig(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function GENETMIIWait(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function GENETPhyReadStatus(Network:PGENETNetwork):LongWord;
Description: Check the link status and update current link state


UniMAC helper functions

[Expand]
procedure UniMACMDIOStart(Network:PGENETNetwork);
Description: To be documented


[Expand]
function UniMACMDIOBusy(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function UniMACMDIOPoll(Network:PGENETNetwork):LongWord;
Description: To be documented


[Expand]
function UniMACMDIORead(Network:PGENETNetwork; Reg:LongWord; var Value:Word):LongWord;
Description: To be documented


[Expand]
function UniMACMDIOWrite(Network:PGENETNetwork; Reg:LongWord; Value:Word):LongWord;
Description: To be documented


[Expand]
function UniMACMDIOReset(Network:PGENETNetwork):LongWord;
Description: To be documented


Return to Unit Reference