TMS570 Ethernet MAC driver. More...
#include "hw_reg_access.h"
#include "hw_emac.h"
#include "hw_emac_ctrl.h"
#include "hw_mdio.h"
#include "gio.h"
#include "sys_vim.h"
#include "core/net.h"
#include "drivers/mac/tms570_eth_driver.h"
#include "debug.h"
Go to the source code of this file.
Macros | |
#define | TRACE_LEVEL NIC_TRACE_LEVEL |
#define | MDIO_INPUT_CLK 75000000 |
#define | MDIO_OUTPUT_CLK 1000000 |
#define | CPPI_SWAP(x) ((uint32_t) (x)) |
Functions | |
error_t | tms570EthInit (NetInterface *interface) |
TMS570 Ethernet MAC initialization. More... | |
__weak_func void | tms570EthInitGpio (NetInterface *interface) |
GPIO configuration. More... | |
void | tms570EthInitBufferDesc (NetInterface *interface) |
Initialize buffer descriptor lists. More... | |
void | tms570EthTick (NetInterface *interface) |
TMS570 Ethernet MAC timer handler. More... | |
void | tms570EthEnableIrq (NetInterface *interface) |
Enable interrupts. More... | |
void | tms570EthDisableIrq (NetInterface *interface) |
Disable interrupts. More... | |
void | tms570EthTxIrqHandler (void) |
Ethernet MAC transmit interrupt. More... | |
void | tms570EthRxIrqHandler (void) |
Ethernet MAC receive interrupt. More... | |
void | tms570EthEventHandler (NetInterface *interface) |
TMS570 Ethernet MAC event handler. More... | |
error_t | tms570EthSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary) |
Send a packet. More... | |
error_t | tms570EthReceivePacket (NetInterface *interface) |
Receive a packet. More... | |
error_t | tms570EthUpdateMacAddrFilter (NetInterface *interface) |
Configure MAC address filtering. More... | |
error_t | tms570EthUpdateMacConfig (NetInterface *interface) |
Adjust MAC configuration parameters for proper operation. More... | |
void | tms570EthWritePhyReg (uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data) |
Write PHY register. More... | |
uint16_t | tms570EthReadPhyReg (uint8_t opcode, uint8_t phyAddr, uint8_t regAddr) |
Read PHY register. More... | |
Variables | |
const NicDriver | tms570EthDriver |
TMS570 Ethernet MAC driver. More... | |
Detailed Description
TMS570 Ethernet MAC driver.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file tms570_eth_driver.c.
Macro Definition Documentation
◆ CPPI_SWAP
Definition at line 65 of file tms570_eth_driver.c.
◆ MDIO_INPUT_CLK
#define MDIO_INPUT_CLK 75000000 |
Definition at line 57 of file tms570_eth_driver.c.
◆ MDIO_OUTPUT_CLK
#define MDIO_OUTPUT_CLK 1000000 |
Definition at line 59 of file tms570_eth_driver.c.
◆ TRACE_LEVEL
#define TRACE_LEVEL NIC_TRACE_LEVEL |
Definition at line 32 of file tms570_eth_driver.c.
Function Documentation
◆ tms570EthDisableIrq()
void tms570EthDisableIrq | ( | NetInterface * | interface | ) |
Disable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 497 of file tms570_eth_driver.c.
◆ tms570EthEnableIrq()
void tms570EthEnableIrq | ( | NetInterface * | interface | ) |
Enable interrupts.
- Parameters
-
[in] interface Underlying network interface
Definition at line 468 of file tms570_eth_driver.c.
◆ tms570EthEventHandler()
void tms570EthEventHandler | ( | NetInterface * | interface | ) |
TMS570 Ethernet MAC event handler.
- Parameters
-
[in] interface Underlying network interface
Definition at line 640 of file tms570_eth_driver.c.
◆ tms570EthInit()
error_t tms570EthInit | ( | NetInterface * | interface | ) |
TMS570 Ethernet MAC initialization.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 146 of file tms570_eth_driver.c.
◆ tms570EthInitBufferDesc()
void tms570EthInitBufferDesc | ( | NetInterface * | interface | ) |
Initialize buffer descriptor lists.
- Parameters
-
[in] interface Underlying network interface
Definition at line 357 of file tms570_eth_driver.c.
◆ tms570EthInitGpio()
__weak_func void tms570EthInitGpio | ( | NetInterface * | interface | ) |
GPIO configuration.
- Parameters
-
[in] interface Underlying network interface
Definition at line 330 of file tms570_eth_driver.c.
◆ tms570EthReadPhyReg()
uint16_t tms570EthReadPhyReg | ( | uint8_t | opcode, |
uint8_t | phyAddr, | ||
uint8_t | regAddr | ||
) |
Read PHY register.
- Parameters
-
[in] opcode Access type (2 bits) [in] phyAddr PHY address (5 bits) [in] regAddr Register address (5 bits)
- Returns
- Register value
Definition at line 989 of file tms570_eth_driver.c.
◆ tms570EthReceivePacket()
error_t tms570EthReceivePacket | ( | NetInterface * | interface | ) |
Receive a packet.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 746 of file tms570_eth_driver.c.
◆ tms570EthRxIrqHandler()
void tms570EthRxIrqHandler | ( | void | ) |
Ethernet MAC receive interrupt.
Definition at line 601 of file tms570_eth_driver.c.
◆ tms570EthSendPacket()
error_t tms570EthSendPacket | ( | NetInterface * | interface, |
const NetBuffer * | buffer, | ||
size_t | offset, | ||
NetTxAncillary * | ancillary | ||
) |
Send a packet.
- Parameters
-
[in] interface Underlying network interface [in] buffer Multi-part buffer containing the data to send [in] offset Offset to the first data byte [in] ancillary Additional options passed to the stack along with the packet
- Returns
- Error code
Definition at line 668 of file tms570_eth_driver.c.
◆ tms570EthTick()
void tms570EthTick | ( | NetInterface * | interface | ) |
TMS570 Ethernet MAC timer handler.
This routine is periodically called by the TCP/IP stack to handle periodic operations such as polling the link state
- Parameters
-
[in] interface Underlying network interface
Definition at line 431 of file tms570_eth_driver.c.
◆ tms570EthTxIrqHandler()
void tms570EthTxIrqHandler | ( | void | ) |
Ethernet MAC transmit interrupt.
Definition at line 532 of file tms570_eth_driver.c.
◆ tms570EthUpdateMacAddrFilter()
error_t tms570EthUpdateMacAddrFilter | ( | NetInterface * | interface | ) |
Configure MAC address filtering.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 844 of file tms570_eth_driver.c.
◆ tms570EthUpdateMacConfig()
error_t tms570EthUpdateMacConfig | ( | NetInterface * | interface | ) |
Adjust MAC configuration parameters for proper operation.
- Parameters
-
[in] interface Underlying network interface
- Returns
- Error code
Definition at line 907 of file tms570_eth_driver.c.
◆ tms570EthWritePhyReg()
void tms570EthWritePhyReg | ( | uint8_t | opcode, |
uint8_t | phyAddr, | ||
uint8_t | regAddr, | ||
uint16_t | data | ||
) |
Write PHY register.
- Parameters
-
[in] opcode Access type (2 bits) [in] phyAddr PHY address (5 bits) [in] regAddr Register address (5 bits) [in] data Register value
Definition at line 950 of file tms570_eth_driver.c.
Variable Documentation
◆ tms570EthDriver
const NicDriver tms570EthDriver |
TMS570 Ethernet MAC driver.
Definition at line 119 of file tms570_eth_driver.c.