Correct the definition of M487/NUC472 EMAC NU_ETH_MAX_FLEN & PACKET_BUFFER_SIZE

pull/12057/head
cyliangtw 2019-12-10 10:40:03 +08:00
parent 54d8c40f96
commit 42103f089d
6 changed files with 6 additions and 6 deletions

View File

@ -263,7 +263,7 @@ void numaker_eth_init(uint8_t *mac_addr)
EMAC->CAMEN = 1; // Enable CAM entry 0
/* Limit the max receive frame length to 1514 + 4 */
EMAC->MRFL = 1518;
EMAC->MRFL = NU_ETH_MAX_FLEN;
reset_phy();
EMAC_ENABLE_RX();

View File

@ -85,7 +85,7 @@
#define RX_DESCRIPTOR_NUM NU_RX_RING_LEN//4 //2 // 4: Max Number of Rx Frame Descriptors
#define TX_DESCRIPTOR_NUM NU_TX_RING_LEN//4 //2 // 4: Max number of Tx Frame Descriptors
#define PACKET_BUFFER_SIZE NU_ETH_MAX_FLEN//1520
#define PACKET_BUFFER_SIZE ( NU_ETH_MAX_FLEN + ((NU_ETH_MAX_FLEN%4) ? (4 - (NU_ETH_MAX_FLEN%4)) : 0) ) //For DMA 4 bytes alignment
#define CONFIG_PHY_ADDR 1

View File

@ -230,7 +230,7 @@ void numaker_eth_init(uint8_t *mac_addr)
numaker_set_mac_addr(mac_addr); // need to reconfigure hardware address 'cos we just RESET emc...
/* Limit the max receive frame length to 1514 + 4 */
EMAC->MRFL = 1518;
EMAC->MRFL = NU_ETH_MAX_FLEN;
reset_phy();
EMAC->CTL |= EMAC_CTL_STRIPCRC_Msk | EMAC_CTL_RXON_Msk | EMAC_CTL_TXON_Msk | EMAC_CTL_RMIIEN_Msk | EMAC_CTL_RMIIRXCTL_Msk;

View File

@ -84,7 +84,7 @@
#define RX_DESCRIPTOR_NUM NU_RX_RING_LEN//4 //2 // 4: Max Number of Rx Frame Descriptors
#define TX_DESCRIPTOR_NUM NU_TX_RING_LEN//4 //2 // 4: Max number of Tx Frame Descriptors
#define PACKET_BUFFER_SIZE NU_ETH_MAX_FLEN//1520
#define PACKET_BUFFER_SIZE ( NU_ETH_MAX_FLEN + ((NU_ETH_MAX_FLEN%4) ? (4 - (NU_ETH_MAX_FLEN%4)) : 0) ) //For DMA 4 bytes alignment
#define CONFIG_PHY_ADDR 1

View File

@ -42,7 +42,7 @@
#define NU_BUFF_ALIGNMENT 4
#define PHY_LINKED_STATE 1
#define PHY_UNLINKED_STATE 0
#define PACKET_BUFFER_SIZE NU_ETH_MAX_FLEN
#define PACKET_BUFFER_SIZE ( NU_ETH_MAX_FLEN + ((NU_ETH_MAX_FLEN%4) ? (4 - (NU_ETH_MAX_FLEN%4)) : 0) ) //For DMA 4 bytes alignment
extern "C" void numaker_eth_rx_next(void);
/* \brief Flags for worker thread */

View File

@ -22,7 +22,7 @@
#define NU_RX_RING_LEN (8)
#define NU_TX_RING_LEN (4)
#define NU_ETH_MAX_FLEN (1520)
#define NU_ETH_MAX_FLEN (1518)
#define NU_HWADDR_SIZE (6)