EMAC8_MD_W - Accessible Internal Registers
Contents
- MAC Address Register (MAC_ADDR)
- Status Register (STATUS)
- Command Register (CMD)
- Transmit Message Length Register (TX_LEN)
- Receive Message Length Register (RX_LEN)
- Interrupt Enable Register (IE)
- PHY Address Register (PHY_ADDR)
- PHY Internal Register Address Register (REG_ADDR)
- PHY Command Register (PHY_CMD)
- PHY Data Output Register (DAT_OUT)
- PHY Data Input Register (DAT_IN)
The following sections detail the internal registers for the EMAC8_MD_W, that can be indirectly accessed from the host processor. Access to these registers is made using dedicated internal Wishbone registers. See Internal Wishbone Registers for more information.
MAC Address Register (MAC_ADDR)
Address: 5FAh
to 5FFh
Access: Write-only
Value after Reset: 000000000000h
This 48-bit register is addressed as six 8-bit locations in memory space. It is used to store the receiver MAC address, which is used by the Receiver to determine if a message on the bus is addressed to it or not (contained within the Destination Address field of the message frame).
This address is not used for transmission. Instead, a separate (and quite possibly different) MAC address must be entered into the Source Address field of a frame to be transmitted.
When writing to the MAC_ADDR register, the most significant byte of the MAC address should be loaded into the least significant byte of the register (at address 5FAh
). The least significant byte of the MAC address will therefore be stored in the most significant byte of the register (at address 5FFh
).
Status Register (STATUS)
Address: 5F9h
Access: Read-only
Value after Reset: 05h
This 8-bit register is used to determine the current state of the Controller.
MSB LSB | |||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
- | - | - | - | - | mdr | rxv | txr |
Bit | Symbol | Function |
---|---|---|
STATUS.7 | - | Not used. Returns 0 when read |
STATUS.6 | - | Not used. Returns 0 when read |
STATUS.5 | - | Not used. Returns 0 when read |
STATUS.4 | - | Not used. Returns 0 when read |
STATUS.3 | - | Not used. Returns 0 when read |
STATUS.2 | mdr | MD Ready flag. Reflects the state of communications with the internal registers of the connected PHY device.
0 = an action is currently being carried out and the interface is not ready for use |
STATUS.1 | rxv | Receive Valid flag. Reflects the current state of the Receiver.
0 = A message frame has not yet completed reception into the Receive Buffer |
STATUS.0 | txr | Transmit Ready flag. Reflects the current state of the Transmitter.
0 = The Transmitter is still sending the current message frame |
Command Register (CMD)
Address: 5F8h
Access: Read and Write
Value after Reset: 00h
This 8-bit register is used to control the start of transmission and reception for the Controller.
MSB LSB | |||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
- | - | - | - | - | - | srx | stx |
Bit | Symbol | Function |
---|---|---|
CMD.7 | - | Not used. Returns 0 when read |
CMD.6 | - | Not used. Returns 0 when read |
CMD.5 | - | Not used. Returns 0 when read |
CMD.4 | - | Not used. Returns 0 when read |
CMD.3 | - | Not used. Returns 0 when read |
CMD.2 | - | Not used. Returns 0 when read |
CMD.1 | srx | Start Receive bit. Set High to start reception of next message frame |
CMD.0 | stx | Start Transmit bit. Set High to start transmission of next message frame |
Transmit Message Length Register (TX_LEN)
Address: 5F6h
to 5F7h
Access: Write-only
Value after Reset: 0000h
This 16-bit register is addressed as two 8-bit locations in memory space. It is used to store the length (in Bytes) of the message frame to be transmitted. This value is used by the Transmitter to determine the number of bytes of data to be read from the Transmitter Buffer, when creating the message frame. The value written to this register is the total of the following individual field lengths:
- Destination Address field – constant value of 6 Bytes
- Source Address field – constant value of 6 Bytes
- Length/Type field – constant value of 2 Bytes
- Data field – variable value in the range 0 to 1500 Bytes.
The Preamble, SFD, Padding and FCS field lengths are not considered as part of this value for the Transmit length.
The maximum value for the Transmit length is 1514 Bytes, which equates to only 11 bits of the TX_LEN register being used. Bits 7..0 of the length value is written to memory location 5F7h
, while bits 10..8 are written to the three least significant bits of memory address 5F6h
.
The TX_LEN register is mapped to the same address as the RX_LEN register. Provided you are performing a write (WE_I input High), you will access the TX_LEN register.
Receive Message Length Register (RX_LEN)
Address: 5F6h
to 5F7h
Access: Read-only
Value after Reset: 0000h
This 16-bit register is addressed as two 8-bit locations in memory space. It is used to store the length (in Bytes) of the received message frame. This value is used by the processor to determine the number of bytes of data to be read from the Receive Buffer. The value read from this register is the total of the following individual field lengths:
- Destination Address field – constant value of 6 Bytes
- Source Address field – constant value of 6 Bytes
- Length/Type field – constant value of 2 Bytes
- Data field – variable value in the range 0 to 1500 Bytes
- Padding field – variable value in the range 0 to 46 Bytes
The Preamble and SFD fields are automatically stripped from the frame upon reception and the FCS field length is not considered as part of this value for the Receive length.
The maximum value for the Receive length is 1514 Bytes, which equates to only 11 bits of the RX_LEN register being used. Bits 7..0 of the length value are written to memory location 5F7h
, while bits 10..8 are written to the three least significant bits of memory address 5F6h
. The upper five bits of the RX_LEN register (bits 7..3 of address 5F6h
) are filled with zeros.
The RX_LEN register is mapped to the same address as the TX_LEN register. Provided you are performing a read (WE_I input Low), you will access the RX_LEN register.
Interrupt Enable Register (IE)
Address: 5F5h
Access: Read and Write
Value after Reset: 00h
This 8-bit register is used to individually enable interrupt generation from the Transmitter and Receiver.
MSB LSB | |||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
- | - | - | - | - | imd | irx | itx |
Bit | Symbol | Function |
---|---|---|
IE.7 | - | Not used. Returns 0 when read |
IE.6 | - | Not used. Returns 0 when read |
IE.5 | - | Not used. Returns 0 when read |
IE.4 | - | Not used. Returns 0 when read |
IE.3 | - | Not used. Returns 0 when read |
IE.2 | imd | MD Interrupt Enable. Set this bit High to enable generation of an interrupt when the MD interface becomes ready |
IE.1 | irx | Receive Interrupt Enable. Set this bit High to enable generation of an interrupt when reception of a message frame has completed and the Receive Buffer is full of valid data, ready to be read |
IE.0 | itx | Transmit Interrupt Enable. Set this bit High to enable generation of an interrupt when the Transmitter has completed transmission of the previously loaded message frame and is waiting ready to transmit the next frame |
PHY Address Register (PHY_ADDR)
Address: 5F0h
Access: Read and Write
Value after Reset: 01h
This 8-bit register is used to load the address of the PHY Controller device connected to the Controller. The PHY address is five bits in length. The high-order three bits of this register are therefore unused and will return '0' when read.
PHY Internal Register Address Register (REG_ADDR)
Address: 5F1h
Access: Read and Write
Value after Reset: 00h
This 8-bit register is used to load the unique address of an internal register of the connected PHY device that you wish to write to/read from. The internal register address is five bits in length. The high-order three bits of this register are therefore unused and will return '0' when read.
PHY Command Register (PHY_CMD)
Address: 5F4h
Access: Read and Write
Value after Reset: 00h
This 8-bit register is used to control the writing to/reading from internal registers of the connected PHY Controller device.
This register can only be written to if no other action is pending.
MSB LSB | |||||||
7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
- | - | - | - | - | - | rrd | rwr |
Bit | Symbol | Function |
---|---|---|
PHY_CMD.7 | - | Not used. Returns 0 when read |
PHY_CMD.6 | - | Not used. Returns 0 when read |
PHY_CMD.5 | - | Not used. Returns 0 when read |
PHY_CMD.4 | - | Not used. Returns 0 when read |
PHY_CMD.3 | - | Not used. Returns 0 when read |
PHY_CMD.2 | - | Not used. Returns 0 when read |
PHY_CMD.1 | rrd | Register Read bit. Set High to read from the addressed internal PHY register |
PHY_CMD.0 | rwr | Register Write bit. Set High to write to the addressed internal PHY register |
PHY Data Output Register (DAT_OUT)
Address: 5F2h
to 5F3h
Access: Write-only
Value after Reset: 0000h
This 16-bit register is addressed as two 8-bit locations in memory space. It is used to store the data to be written to the accessed internal register of the connected PHY Controller device.
The DAT_OUT register is mapped to the same address as the DAT_IN register. Provided you are performing a write (WR input High), you will access the DAT_OUT register.
PHY Data Input Register (DAT_IN)
Address: 5F2h
to 5F3h
Access: Read-only
Value after Reset: 0000h
This 16-bit register is addressed as two 8-bit locations in memory space. It is used to store the data received from the accessed internal register of the connected PHY Controller device.
The DAT_IN register is mapped to the same address as the DAT_OUT register. Provided you are performing a read (RD input High), you will access the DAT_IN register.