ksz8061_driver.h File Reference

KSZ8061 Ethernet PHY driver. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define KSZ8061_PHY_ADDR   1
 
#define KSZ8061_BMCR   0x00
 
#define KSZ8061_BMSR   0x01
 
#define KSZ8061_PHYID1   0x02
 
#define KSZ8061_PHYID2   0x03
 
#define KSZ8061_ANAR   0x04
 
#define KSZ8061_ANLPAR   0x05
 
#define KSZ8061_ANER   0x06
 
#define KSZ8061_ANNPR   0x07
 
#define KSZ8061_ANLPNPR   0x08
 
#define KSZ8061_MMDACR   0x0D
 
#define KSZ8061_MMDAADR   0x0E
 
#define KSZ8061_DCON   0x10
 
#define KSZ8061_AFECON0   0x11
 
#define KSZ8061_AFECON1   0x12
 
#define KSZ8061_AFECON2   0x13
 
#define KSZ8061_AFECON3   0x14
 
#define KSZ8061_RXERCTR   0x15
 
#define KSZ8061_OM   0x16
 
#define KSZ8061_OMSS   0x17
 
#define KSZ8061_EXCON   0x18
 
#define KSZ8061_ICSR   0x1B
 
#define KSZ8061_FUNCON   0x1C
 
#define KSZ8061_LINKMD   0x1D
 
#define KSZ8061_PHYCON1   0x1E
 
#define KSZ8061_PHYCON2   0x1F
 
#define KSZ8061_AFED_CTRL   0x1B, 0x00
 
#define KSZ8061_SIGNAL_QUALITY   0x1C, 0xAC
 
#define KSZ8061_BMCR_RESET   0x8000
 
#define KSZ8061_BMCR_LOOPBACK   0x4000
 
#define KSZ8061_BMCR_SPEED_SEL   0x2000
 
#define KSZ8061_BMCR_AN_EN   0x1000
 
#define KSZ8061_BMCR_POWER_DOWN   0x0800
 
#define KSZ8061_BMCR_ISOLATE   0x0400
 
#define KSZ8061_BMCR_RESTART_AN   0x0200
 
#define KSZ8061_BMCR_DUPLEX_MODE   0x0100
 
#define KSZ8061_BMCR_COL_TEST   0x0080
 
#define KSZ8061_BMSR_100BT4   0x8000
 
#define KSZ8061_BMSR_100BTX_FD   0x4000
 
#define KSZ8061_BMSR_100BTX_HD   0x2000
 
#define KSZ8061_BMSR_10BT_FD   0x1000
 
#define KSZ8061_BMSR_10BT_HD   0x0800
 
#define KSZ8061_BMSR_NO_PREAMBLE   0x0040
 
#define KSZ8061_BMSR_AN_COMPLETE   0x0020
 
#define KSZ8061_BMSR_REMOTE_FAULT   0x0010
 
#define KSZ8061_BMSR_AN_CAPABLE   0x0008
 
#define KSZ8061_BMSR_LINK_STATUS   0x0004
 
#define KSZ8061_BMSR_JABBER_DETECT   0x0002
 
#define KSZ8061_BMSR_EXTENDED_CAPABLE   0x0001
 
#define KSZ8061_PHYID1_PHY_ID_MSB   0xFFFF
 
#define KSZ8061_PHYID1_PHY_ID_MSB_DEFAULT   0x0022
 
#define KSZ8061_PHYID2_PHY_ID_LSB   0xFC00
 
#define KSZ8061_PHYID2_PHY_ID_LSB_DEFAULT   0x1400
 
#define KSZ8061_PHYID2_MODEL_NUM   0x03F0
 
#define KSZ8061_PHYID2_MODEL_NUM_DEFAULT   0x0170
 
#define KSZ8061_PHYID2_REVISION_NUM   0x000F
 
#define KSZ8061_ANAR_NEXT_PAGE   0x8000
 
#define KSZ8061_ANAR_REMOTE_FAULT   0x2000
 
#define KSZ8061_ANAR_PAUSE   0x0C00
 
#define KSZ8061_ANAR_100BT4   0x0200
 
#define KSZ8061_ANAR_100BTX_FD   0x0100
 
#define KSZ8061_ANAR_100BTX_HD   0x0080
 
#define KSZ8061_ANAR_10BT_FD   0x0040
 
#define KSZ8061_ANAR_10BT_HD   0x0020
 
#define KSZ8061_ANAR_SELECTOR   0x001F
 
#define KSZ8061_ANAR_SELECTOR_DEFAULT   0x0001
 
#define KSZ8061_ANLPAR_NEXT_PAGE   0x8000
 
#define KSZ8061_ANLPAR_ACK   0x4000
 
#define KSZ8061_ANLPAR_REMOTE_FAULT   0x2000
 
#define KSZ8061_ANLPAR_PAUSE   0x0C00
 
#define KSZ8061_ANLPAR_100BT4   0x0200
 
#define KSZ8061_ANLPAR_100BTX_FD   0x0100
 
#define KSZ8061_ANLPAR_100BTX_HD   0x0080
 
#define KSZ8061_ANLPAR_10BT_FD   0x0040
 
#define KSZ8061_ANLPAR_10BT_HD   0x0020
 
#define KSZ8061_ANLPAR_SELECTOR   0x001F
 
#define KSZ8061_ANLPAR_SELECTOR_DEFAULT   0x0001
 
#define KSZ8061_ANER_PAR_DETECT_FAULT   0x0010
 
#define KSZ8061_ANER_LP_NEXT_PAGE_ABLE   0x0008
 
#define KSZ8061_ANER_NEXT_PAGE_ABLE   0x0004
 
#define KSZ8061_ANER_PAGE_RECEIVED   0x0002
 
#define KSZ8061_ANER_LP_AN_ABLE   0x0001
 
#define KSZ8061_ANNPR_NEXT_PAGE   0x8000
 
#define KSZ8061_ANNPR_MSG_PAGE   0x2000
 
#define KSZ8061_ANNPR_ACK2   0x1000
 
#define KSZ8061_ANNPR_TOGGLE   0x0800
 
#define KSZ8061_ANNPR_MESSAGE   0x07FF
 
#define KSZ8061_ANLPNPR_NEXT_PAGE   0x8000
 
#define KSZ8061_ANLPNPR_ACK   0x4000
 
#define KSZ8061_ANLPNPR_MSG_PAGE   0x2000
 
#define KSZ8061_ANLPNPR_ACK2   0x1000
 
#define KSZ8061_ANLPNPR_TOGGLE   0x0800
 
#define KSZ8061_ANLPNPR_MESSAGE   0x07FF
 
#define KSZ8061_MMDACR_FUNC   0xC000
 
#define KSZ8061_MMDACR_FUNC_ADDR   0x0000
 
#define KSZ8061_MMDACR_FUNC_DATA_NO_POST_INC   0x4000
 
#define KSZ8061_MMDACR_FUNC_DATA_POST_INC_RW   0x8000
 
#define KSZ8061_MMDACR_FUNC_DATA_POST_INC_W   0xC000
 
#define KSZ8061_MMDACR_DEVAD   0x001F
 
#define KSZ8061_DCON_PLL_OFF   0x0010
 
#define KSZ8061_AFECON0_SLOW_OSC_MODE_PD   0x0040
 
#define KSZ8061_AFECON1_100BT_AMPLITUDE   0xF000
 
#define KSZ8061_AFECON2_LINKMD_DETECT_THRESHOLD   0x8000
 
#define KSZ8061_AFECON2_SLOW_OSC_MODE_UDS   0x0001
 
#define KSZ8061_AFECON3_UDS_METHOD   0x0040
 
#define KSZ8061_AFECON3_MANUAL_UDS_MODE   0x0020
 
#define KSZ8061_AFECON3_NV_REG_ACCESS   0x0010
 
#define KSZ8061_AFECON3_UDS_MODE_SIGDET_EN   0x0008
 
#define KSZ8061_AFECON3_RX_INTERNAL_TERM_DIS   0x0004
 
#define KSZ8061_AFECON3_SIGDET_DEASSERT_DELAY   0x0002
 
#define KSZ8061_AFECON3_SIGDET_POL   0x0001
 
#define KSZ8061_OM_QWF_DIS   0x1000
 
#define KSZ8061_OMSS_PHYAD   0xE000
 
#define KSZ8061_OMSS_QWF_STRAP_STATUS   0x0100
 
#define KSZ8061_OMSS_MII_BTB_STRAP_STATUS   0x0080
 
#define KSZ8061_OMSS_RMII_BTB_STRAP_STATUS   0x0040
 
#define KSZ8061_OMSS_NAND_TREE_STRAP_STATUS   0x0020
 
#define KSZ8061_OMSS_RMII_STRAP_STATUS   0x0002
 
#define KSZ8061_OMSS_MII_STRAP_STATUS   0x0001
 
#define KSZ8061_EXCON_EDPD_DIS   0x0800
 
#define KSZ8061_EXCON_RX_PHY_LATENCY   0x0400
 
#define KSZ8061_EXCON_10BT_PREAMBLE_EN   0x0040
 
#define KSZ8061_ICSR_JABBER_IE   0x8000
 
#define KSZ8061_ICSR_RECEIVE_ERROR_IE   0x4000
 
#define KSZ8061_ICSR_PAGE_RECEIVED_IE   0x2000
 
#define KSZ8061_ICSR_PAR_DETECT_FAULT_IE   0x1000
 
#define KSZ8061_ICSR_LP_ACK_IE   0x0800
 
#define KSZ8061_ICSR_LINK_DOWN_IE   0x0400
 
#define KSZ8061_ICSR_REMOTE_FAULT_IE   0x0200
 
#define KSZ8061_ICSR_LINK_UP_IE   0x0100
 
#define KSZ8061_ICSR_JABBER_IF   0x0080
 
#define KSZ8061_ICSR_RECEIVE_ERROR_IF   0x0040
 
#define KSZ8061_ICSR_PAGE_RECEIVED_IF   0x0020
 
#define KSZ8061_ICSR_PAR_DETECT_FAULT_IF   0x0010
 
#define KSZ8061_ICSR_LP_ACK_IF   0x0008
 
#define KSZ8061_ICSR_LINK_DOWN_IF   0x0004
 
#define KSZ8061_ICSR_REMOTE_FAULT_IF   0x0002
 
#define KSZ8061_ICSR_LINK_UP_IF   0x0001
 
#define KSZ8061_FUNCON_LOCAL_LOOPBACK   0x0020
 
#define KSZ8061_LINKMD_TEST_EN   0x8000
 
#define KSZ8061_LINKMD_RESULT   0x6000
 
#define KSZ8061_LINKMD_SHORT   0x1000
 
#define KSZ8061_LINKMD_FAULT_COUNT   0x01FF
 
#define KSZ8061_PHYCON1_PAUSE_EN   0x0200
 
#define KSZ8061_PHYCON1_LINK_STATUS   0x0100
 
#define KSZ8061_PHYCON1_POL_STATUS   0x0080
 
#define KSZ8061_PHYCON1_MDIX_STATE   0x0020
 
#define KSZ8061_PHYCON1_ENERGY_DETECT   0x0010
 
#define KSZ8061_PHYCON1_PHY_ISOLATE   0x0008
 
#define KSZ8061_PHYCON1_OP_MODE   0x0007
 
#define KSZ8061_PHYCON1_OP_MODE_AN   0x0000
 
#define KSZ8061_PHYCON1_OP_MODE_10BT_HD   0x0001
 
#define KSZ8061_PHYCON1_OP_MODE_100BTX_HD   0x0002
 
#define KSZ8061_PHYCON1_OP_MODE_10BT_FD   0x0005
 
#define KSZ8061_PHYCON1_OP_MODE_100BTX_FD   0x0006
 
#define KSZ8061_PHYCON2_HP_MDIX   0x8000
 
#define KSZ8061_PHYCON2_MDIX_SEL   0x4000
 
#define KSZ8061_PHYCON2_PAIR_SWAP_DIS   0x2000
 
#define KSZ8061_PHYCON2_FORCE_LINK   0x0800
 
#define KSZ8061_PHYCON2_POWER_SAVING   0x0400
 
#define KSZ8061_PHYCON2_INT_LEVEL   0x0200
 
#define KSZ8061_PHYCON2_JABBER_EN   0x0100
 
#define KSZ8061_PHYCON2_LED_MODE   0x0030
 
#define KSZ8061_PHYCON2_TX_DIS   0x0008
 
#define KSZ8061_PHYCON2_REMOTE_LOOPBACK   0x0004
 
#define KSZ8061_PHYCON2_SQE_TEST_EN   0x0002
 
#define KSZ8061_PHYCON2_DATA_SCRAMBLING_DIS   0x0001
 
#define KSZ8061_AFED_CTRL_LINKMD_PULSE_AMPLITUDE   0x00F0
 
#define KSZ8061_SIGNAL_QUALITY_SIGNAL_QUALITY_IND   0x7F00
 

Functions

error_t ksz8061Init (NetInterface *interface)
 KSZ8061 PHY transceiver initialization. More...
 
void ksz8061InitHook (NetInterface *interface)
 KSZ8061 custom configuration. More...
 
void ksz8061Tick (NetInterface *interface)
 KSZ8061 timer handler. More...
 
void ksz8061EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz8061DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ksz8061EventHandler (NetInterface *interface)
 KSZ8061 event handler. More...
 
void ksz8061WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ksz8061ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void ksz8061DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 
void ksz8061WriteMmdReg (NetInterface *interface, uint8_t devAddr, uint16_t regAddr, uint16_t data)
 Write MMD register. More...
 
uint16_t ksz8061ReadMmdReg (NetInterface *interface, uint8_t devAddr, uint16_t regAddr)
 Read MMD register. More...
 

Variables

const PhyDriver ksz8061PhyDriver
 KSZ8061 Ethernet PHY driver. More...
 

Detailed Description

KSZ8061 Ethernet PHY 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file ksz8061_driver.h.

Macro Definition Documentation

◆ KSZ8061_AFECON0

#define KSZ8061_AFECON0   0x11

Definition at line 57 of file ksz8061_driver.h.

◆ KSZ8061_AFECON0_SLOW_OSC_MODE_PD

#define KSZ8061_AFECON0_SLOW_OSC_MODE_PD   0x0040

Definition at line 170 of file ksz8061_driver.h.

◆ KSZ8061_AFECON1

#define KSZ8061_AFECON1   0x12

Definition at line 58 of file ksz8061_driver.h.

◆ KSZ8061_AFECON1_100BT_AMPLITUDE

#define KSZ8061_AFECON1_100BT_AMPLITUDE   0xF000

Definition at line 173 of file ksz8061_driver.h.

◆ KSZ8061_AFECON2

#define KSZ8061_AFECON2   0x13

Definition at line 59 of file ksz8061_driver.h.

◆ KSZ8061_AFECON2_LINKMD_DETECT_THRESHOLD

#define KSZ8061_AFECON2_LINKMD_DETECT_THRESHOLD   0x8000

Definition at line 176 of file ksz8061_driver.h.

◆ KSZ8061_AFECON2_SLOW_OSC_MODE_UDS

#define KSZ8061_AFECON2_SLOW_OSC_MODE_UDS   0x0001

Definition at line 177 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3

#define KSZ8061_AFECON3   0x14

Definition at line 60 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_MANUAL_UDS_MODE

#define KSZ8061_AFECON3_MANUAL_UDS_MODE   0x0020

Definition at line 181 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_NV_REG_ACCESS

#define KSZ8061_AFECON3_NV_REG_ACCESS   0x0010

Definition at line 182 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_RX_INTERNAL_TERM_DIS

#define KSZ8061_AFECON3_RX_INTERNAL_TERM_DIS   0x0004

Definition at line 184 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_SIGDET_DEASSERT_DELAY

#define KSZ8061_AFECON3_SIGDET_DEASSERT_DELAY   0x0002

Definition at line 185 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_SIGDET_POL

#define KSZ8061_AFECON3_SIGDET_POL   0x0001

Definition at line 186 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_UDS_METHOD

#define KSZ8061_AFECON3_UDS_METHOD   0x0040

Definition at line 180 of file ksz8061_driver.h.

◆ KSZ8061_AFECON3_UDS_MODE_SIGDET_EN

#define KSZ8061_AFECON3_UDS_MODE_SIGDET_EN   0x0008

Definition at line 183 of file ksz8061_driver.h.

◆ KSZ8061_AFED_CTRL

#define KSZ8061_AFED_CTRL   0x1B, 0x00

Definition at line 72 of file ksz8061_driver.h.

◆ KSZ8061_AFED_CTRL_LINKMD_PULSE_AMPLITUDE

#define KSZ8061_AFED_CTRL_LINKMD_PULSE_AMPLITUDE   0x00F0

Definition at line 261 of file ksz8061_driver.h.

◆ KSZ8061_ANAR

#define KSZ8061_ANAR   0x04

Definition at line 49 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_100BT4

#define KSZ8061_ANAR_100BT4   0x0200

Definition at line 115 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_100BTX_FD

#define KSZ8061_ANAR_100BTX_FD   0x0100

Definition at line 116 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_100BTX_HD

#define KSZ8061_ANAR_100BTX_HD   0x0080

Definition at line 117 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_10BT_FD

#define KSZ8061_ANAR_10BT_FD   0x0040

Definition at line 118 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_10BT_HD

#define KSZ8061_ANAR_10BT_HD   0x0020

Definition at line 119 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_NEXT_PAGE

#define KSZ8061_ANAR_NEXT_PAGE   0x8000

Definition at line 112 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_PAUSE

#define KSZ8061_ANAR_PAUSE   0x0C00

Definition at line 114 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_REMOTE_FAULT

#define KSZ8061_ANAR_REMOTE_FAULT   0x2000

Definition at line 113 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_SELECTOR

#define KSZ8061_ANAR_SELECTOR   0x001F

Definition at line 120 of file ksz8061_driver.h.

◆ KSZ8061_ANAR_SELECTOR_DEFAULT

#define KSZ8061_ANAR_SELECTOR_DEFAULT   0x0001

Definition at line 121 of file ksz8061_driver.h.

◆ KSZ8061_ANER

#define KSZ8061_ANER   0x06

Definition at line 51 of file ksz8061_driver.h.

◆ KSZ8061_ANER_LP_AN_ABLE

#define KSZ8061_ANER_LP_AN_ABLE   0x0001

Definition at line 141 of file ksz8061_driver.h.

◆ KSZ8061_ANER_LP_NEXT_PAGE_ABLE

#define KSZ8061_ANER_LP_NEXT_PAGE_ABLE   0x0008

Definition at line 138 of file ksz8061_driver.h.

◆ KSZ8061_ANER_NEXT_PAGE_ABLE

#define KSZ8061_ANER_NEXT_PAGE_ABLE   0x0004

Definition at line 139 of file ksz8061_driver.h.

◆ KSZ8061_ANER_PAGE_RECEIVED

#define KSZ8061_ANER_PAGE_RECEIVED   0x0002

Definition at line 140 of file ksz8061_driver.h.

◆ KSZ8061_ANER_PAR_DETECT_FAULT

#define KSZ8061_ANER_PAR_DETECT_FAULT   0x0010

Definition at line 137 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR

#define KSZ8061_ANLPAR   0x05

Definition at line 50 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_100BT4

#define KSZ8061_ANLPAR_100BT4   0x0200

Definition at line 128 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_100BTX_FD

#define KSZ8061_ANLPAR_100BTX_FD   0x0100

Definition at line 129 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_100BTX_HD

#define KSZ8061_ANLPAR_100BTX_HD   0x0080

Definition at line 130 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_10BT_FD

#define KSZ8061_ANLPAR_10BT_FD   0x0040

Definition at line 131 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_10BT_HD

#define KSZ8061_ANLPAR_10BT_HD   0x0020

Definition at line 132 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_ACK

#define KSZ8061_ANLPAR_ACK   0x4000

Definition at line 125 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_NEXT_PAGE

#define KSZ8061_ANLPAR_NEXT_PAGE   0x8000

Definition at line 124 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_PAUSE

#define KSZ8061_ANLPAR_PAUSE   0x0C00

Definition at line 127 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_REMOTE_FAULT

#define KSZ8061_ANLPAR_REMOTE_FAULT   0x2000

Definition at line 126 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_SELECTOR

#define KSZ8061_ANLPAR_SELECTOR   0x001F

Definition at line 133 of file ksz8061_driver.h.

◆ KSZ8061_ANLPAR_SELECTOR_DEFAULT

#define KSZ8061_ANLPAR_SELECTOR_DEFAULT   0x0001

Definition at line 134 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR

#define KSZ8061_ANLPNPR   0x08

Definition at line 53 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR_ACK

#define KSZ8061_ANLPNPR_ACK   0x4000

Definition at line 152 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR_ACK2

#define KSZ8061_ANLPNPR_ACK2   0x1000

Definition at line 154 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR_MESSAGE

#define KSZ8061_ANLPNPR_MESSAGE   0x07FF

Definition at line 156 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR_MSG_PAGE

#define KSZ8061_ANLPNPR_MSG_PAGE   0x2000

Definition at line 153 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR_NEXT_PAGE

#define KSZ8061_ANLPNPR_NEXT_PAGE   0x8000

Definition at line 151 of file ksz8061_driver.h.

◆ KSZ8061_ANLPNPR_TOGGLE

#define KSZ8061_ANLPNPR_TOGGLE   0x0800

Definition at line 155 of file ksz8061_driver.h.

◆ KSZ8061_ANNPR

#define KSZ8061_ANNPR   0x07

Definition at line 52 of file ksz8061_driver.h.

◆ KSZ8061_ANNPR_ACK2

#define KSZ8061_ANNPR_ACK2   0x1000

Definition at line 146 of file ksz8061_driver.h.

◆ KSZ8061_ANNPR_MESSAGE

#define KSZ8061_ANNPR_MESSAGE   0x07FF

Definition at line 148 of file ksz8061_driver.h.

◆ KSZ8061_ANNPR_MSG_PAGE

#define KSZ8061_ANNPR_MSG_PAGE   0x2000

Definition at line 145 of file ksz8061_driver.h.

◆ KSZ8061_ANNPR_NEXT_PAGE

#define KSZ8061_ANNPR_NEXT_PAGE   0x8000

Definition at line 144 of file ksz8061_driver.h.

◆ KSZ8061_ANNPR_TOGGLE

#define KSZ8061_ANNPR_TOGGLE   0x0800

Definition at line 147 of file ksz8061_driver.h.

◆ KSZ8061_BMCR

#define KSZ8061_BMCR   0x00

Definition at line 45 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_AN_EN

#define KSZ8061_BMCR_AN_EN   0x1000

Definition at line 79 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_COL_TEST

#define KSZ8061_BMCR_COL_TEST   0x0080

Definition at line 84 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_DUPLEX_MODE

#define KSZ8061_BMCR_DUPLEX_MODE   0x0100

Definition at line 83 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_ISOLATE

#define KSZ8061_BMCR_ISOLATE   0x0400

Definition at line 81 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_LOOPBACK

#define KSZ8061_BMCR_LOOPBACK   0x4000

Definition at line 77 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_POWER_DOWN

#define KSZ8061_BMCR_POWER_DOWN   0x0800

Definition at line 80 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_RESET

#define KSZ8061_BMCR_RESET   0x8000

Definition at line 76 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_RESTART_AN

#define KSZ8061_BMCR_RESTART_AN   0x0200

Definition at line 82 of file ksz8061_driver.h.

◆ KSZ8061_BMCR_SPEED_SEL

#define KSZ8061_BMCR_SPEED_SEL   0x2000

Definition at line 78 of file ksz8061_driver.h.

◆ KSZ8061_BMSR

#define KSZ8061_BMSR   0x01

Definition at line 46 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_100BT4

#define KSZ8061_BMSR_100BT4   0x8000

Definition at line 87 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_100BTX_FD

#define KSZ8061_BMSR_100BTX_FD   0x4000

Definition at line 88 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_100BTX_HD

#define KSZ8061_BMSR_100BTX_HD   0x2000

Definition at line 89 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_10BT_FD

#define KSZ8061_BMSR_10BT_FD   0x1000

Definition at line 90 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_10BT_HD

#define KSZ8061_BMSR_10BT_HD   0x0800

Definition at line 91 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_AN_CAPABLE

#define KSZ8061_BMSR_AN_CAPABLE   0x0008

Definition at line 95 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_AN_COMPLETE

#define KSZ8061_BMSR_AN_COMPLETE   0x0020

Definition at line 93 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_EXTENDED_CAPABLE

#define KSZ8061_BMSR_EXTENDED_CAPABLE   0x0001

Definition at line 98 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_JABBER_DETECT

#define KSZ8061_BMSR_JABBER_DETECT   0x0002

Definition at line 97 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_LINK_STATUS

#define KSZ8061_BMSR_LINK_STATUS   0x0004

Definition at line 96 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_NO_PREAMBLE

#define KSZ8061_BMSR_NO_PREAMBLE   0x0040

Definition at line 92 of file ksz8061_driver.h.

◆ KSZ8061_BMSR_REMOTE_FAULT

#define KSZ8061_BMSR_REMOTE_FAULT   0x0010

Definition at line 94 of file ksz8061_driver.h.

◆ KSZ8061_DCON

#define KSZ8061_DCON   0x10

Definition at line 56 of file ksz8061_driver.h.

◆ KSZ8061_DCON_PLL_OFF

#define KSZ8061_DCON_PLL_OFF   0x0010

Definition at line 167 of file ksz8061_driver.h.

◆ KSZ8061_EXCON

#define KSZ8061_EXCON   0x18

Definition at line 64 of file ksz8061_driver.h.

◆ KSZ8061_EXCON_10BT_PREAMBLE_EN

#define KSZ8061_EXCON_10BT_PREAMBLE_EN   0x0040

Definition at line 203 of file ksz8061_driver.h.

◆ KSZ8061_EXCON_EDPD_DIS

#define KSZ8061_EXCON_EDPD_DIS   0x0800

Definition at line 201 of file ksz8061_driver.h.

◆ KSZ8061_EXCON_RX_PHY_LATENCY

#define KSZ8061_EXCON_RX_PHY_LATENCY   0x0400

Definition at line 202 of file ksz8061_driver.h.

◆ KSZ8061_FUNCON

#define KSZ8061_FUNCON   0x1C

Definition at line 66 of file ksz8061_driver.h.

◆ KSZ8061_FUNCON_LOCAL_LOOPBACK

#define KSZ8061_FUNCON_LOCAL_LOOPBACK   0x0020

Definition at line 224 of file ksz8061_driver.h.

◆ KSZ8061_ICSR

#define KSZ8061_ICSR   0x1B

Definition at line 65 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_JABBER_IE

#define KSZ8061_ICSR_JABBER_IE   0x8000

Definition at line 206 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_JABBER_IF

#define KSZ8061_ICSR_JABBER_IF   0x0080

Definition at line 214 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_LINK_DOWN_IE

#define KSZ8061_ICSR_LINK_DOWN_IE   0x0400

Definition at line 211 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_LINK_DOWN_IF

#define KSZ8061_ICSR_LINK_DOWN_IF   0x0004

Definition at line 219 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_LINK_UP_IE

#define KSZ8061_ICSR_LINK_UP_IE   0x0100

Definition at line 213 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_LINK_UP_IF

#define KSZ8061_ICSR_LINK_UP_IF   0x0001

Definition at line 221 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_LP_ACK_IE

#define KSZ8061_ICSR_LP_ACK_IE   0x0800

Definition at line 210 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_LP_ACK_IF

#define KSZ8061_ICSR_LP_ACK_IF   0x0008

Definition at line 218 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_PAGE_RECEIVED_IE

#define KSZ8061_ICSR_PAGE_RECEIVED_IE   0x2000

Definition at line 208 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_PAGE_RECEIVED_IF

#define KSZ8061_ICSR_PAGE_RECEIVED_IF   0x0020

Definition at line 216 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_PAR_DETECT_FAULT_IE

#define KSZ8061_ICSR_PAR_DETECT_FAULT_IE   0x1000

Definition at line 209 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_PAR_DETECT_FAULT_IF

#define KSZ8061_ICSR_PAR_DETECT_FAULT_IF   0x0010

Definition at line 217 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_RECEIVE_ERROR_IE

#define KSZ8061_ICSR_RECEIVE_ERROR_IE   0x4000

Definition at line 207 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_RECEIVE_ERROR_IF

#define KSZ8061_ICSR_RECEIVE_ERROR_IF   0x0040

Definition at line 215 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_REMOTE_FAULT_IE

#define KSZ8061_ICSR_REMOTE_FAULT_IE   0x0200

Definition at line 212 of file ksz8061_driver.h.

◆ KSZ8061_ICSR_REMOTE_FAULT_IF

#define KSZ8061_ICSR_REMOTE_FAULT_IF   0x0002

Definition at line 220 of file ksz8061_driver.h.

◆ KSZ8061_LINKMD

#define KSZ8061_LINKMD   0x1D

Definition at line 67 of file ksz8061_driver.h.

◆ KSZ8061_LINKMD_FAULT_COUNT

#define KSZ8061_LINKMD_FAULT_COUNT   0x01FF

Definition at line 230 of file ksz8061_driver.h.

◆ KSZ8061_LINKMD_RESULT

#define KSZ8061_LINKMD_RESULT   0x6000

Definition at line 228 of file ksz8061_driver.h.

◆ KSZ8061_LINKMD_SHORT

#define KSZ8061_LINKMD_SHORT   0x1000

Definition at line 229 of file ksz8061_driver.h.

◆ KSZ8061_LINKMD_TEST_EN

#define KSZ8061_LINKMD_TEST_EN   0x8000

Definition at line 227 of file ksz8061_driver.h.

◆ KSZ8061_MMDAADR

#define KSZ8061_MMDAADR   0x0E

Definition at line 55 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR

#define KSZ8061_MMDACR   0x0D

Definition at line 54 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR_DEVAD

#define KSZ8061_MMDACR_DEVAD   0x001F

Definition at line 164 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR_FUNC

#define KSZ8061_MMDACR_FUNC   0xC000

Definition at line 159 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR_FUNC_ADDR

#define KSZ8061_MMDACR_FUNC_ADDR   0x0000

Definition at line 160 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR_FUNC_DATA_NO_POST_INC

#define KSZ8061_MMDACR_FUNC_DATA_NO_POST_INC   0x4000

Definition at line 161 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR_FUNC_DATA_POST_INC_RW

#define KSZ8061_MMDACR_FUNC_DATA_POST_INC_RW   0x8000

Definition at line 162 of file ksz8061_driver.h.

◆ KSZ8061_MMDACR_FUNC_DATA_POST_INC_W

#define KSZ8061_MMDACR_FUNC_DATA_POST_INC_W   0xC000

Definition at line 163 of file ksz8061_driver.h.

◆ KSZ8061_OM

#define KSZ8061_OM   0x16

Definition at line 62 of file ksz8061_driver.h.

◆ KSZ8061_OM_QWF_DIS

#define KSZ8061_OM_QWF_DIS   0x1000

Definition at line 189 of file ksz8061_driver.h.

◆ KSZ8061_OMSS

#define KSZ8061_OMSS   0x17

Definition at line 63 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_MII_BTB_STRAP_STATUS

#define KSZ8061_OMSS_MII_BTB_STRAP_STATUS   0x0080

Definition at line 194 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_MII_STRAP_STATUS

#define KSZ8061_OMSS_MII_STRAP_STATUS   0x0001

Definition at line 198 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_NAND_TREE_STRAP_STATUS

#define KSZ8061_OMSS_NAND_TREE_STRAP_STATUS   0x0020

Definition at line 196 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_PHYAD

#define KSZ8061_OMSS_PHYAD   0xE000

Definition at line 192 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_QWF_STRAP_STATUS

#define KSZ8061_OMSS_QWF_STRAP_STATUS   0x0100

Definition at line 193 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_RMII_BTB_STRAP_STATUS

#define KSZ8061_OMSS_RMII_BTB_STRAP_STATUS   0x0040

Definition at line 195 of file ksz8061_driver.h.

◆ KSZ8061_OMSS_RMII_STRAP_STATUS

#define KSZ8061_OMSS_RMII_STRAP_STATUS   0x0002

Definition at line 197 of file ksz8061_driver.h.

◆ KSZ8061_PHY_ADDR

#define KSZ8061_PHY_ADDR   1

Definition at line 39 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1

#define KSZ8061_PHYCON1   0x1E

Definition at line 68 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_ENERGY_DETECT

#define KSZ8061_PHYCON1_ENERGY_DETECT   0x0010

Definition at line 237 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_LINK_STATUS

#define KSZ8061_PHYCON1_LINK_STATUS   0x0100

Definition at line 234 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_MDIX_STATE

#define KSZ8061_PHYCON1_MDIX_STATE   0x0020

Definition at line 236 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_OP_MODE

#define KSZ8061_PHYCON1_OP_MODE   0x0007

Definition at line 239 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_OP_MODE_100BTX_FD

#define KSZ8061_PHYCON1_OP_MODE_100BTX_FD   0x0006

Definition at line 244 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_OP_MODE_100BTX_HD

#define KSZ8061_PHYCON1_OP_MODE_100BTX_HD   0x0002

Definition at line 242 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_OP_MODE_10BT_FD

#define KSZ8061_PHYCON1_OP_MODE_10BT_FD   0x0005

Definition at line 243 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_OP_MODE_10BT_HD

#define KSZ8061_PHYCON1_OP_MODE_10BT_HD   0x0001

Definition at line 241 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_OP_MODE_AN

#define KSZ8061_PHYCON1_OP_MODE_AN   0x0000

Definition at line 240 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_PAUSE_EN

#define KSZ8061_PHYCON1_PAUSE_EN   0x0200

Definition at line 233 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_PHY_ISOLATE

#define KSZ8061_PHYCON1_PHY_ISOLATE   0x0008

Definition at line 238 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON1_POL_STATUS

#define KSZ8061_PHYCON1_POL_STATUS   0x0080

Definition at line 235 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2

#define KSZ8061_PHYCON2   0x1F

Definition at line 69 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_DATA_SCRAMBLING_DIS

#define KSZ8061_PHYCON2_DATA_SCRAMBLING_DIS   0x0001

Definition at line 258 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_FORCE_LINK

#define KSZ8061_PHYCON2_FORCE_LINK   0x0800

Definition at line 250 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_HP_MDIX

#define KSZ8061_PHYCON2_HP_MDIX   0x8000

Definition at line 247 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_INT_LEVEL

#define KSZ8061_PHYCON2_INT_LEVEL   0x0200

Definition at line 252 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_JABBER_EN

#define KSZ8061_PHYCON2_JABBER_EN   0x0100

Definition at line 253 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_LED_MODE

#define KSZ8061_PHYCON2_LED_MODE   0x0030

Definition at line 254 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_MDIX_SEL

#define KSZ8061_PHYCON2_MDIX_SEL   0x4000

Definition at line 248 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_PAIR_SWAP_DIS

#define KSZ8061_PHYCON2_PAIR_SWAP_DIS   0x2000

Definition at line 249 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_POWER_SAVING

#define KSZ8061_PHYCON2_POWER_SAVING   0x0400

Definition at line 251 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_REMOTE_LOOPBACK

#define KSZ8061_PHYCON2_REMOTE_LOOPBACK   0x0004

Definition at line 256 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_SQE_TEST_EN

#define KSZ8061_PHYCON2_SQE_TEST_EN   0x0002

Definition at line 257 of file ksz8061_driver.h.

◆ KSZ8061_PHYCON2_TX_DIS

#define KSZ8061_PHYCON2_TX_DIS   0x0008

Definition at line 255 of file ksz8061_driver.h.

◆ KSZ8061_PHYID1

#define KSZ8061_PHYID1   0x02

Definition at line 47 of file ksz8061_driver.h.

◆ KSZ8061_PHYID1_PHY_ID_MSB

#define KSZ8061_PHYID1_PHY_ID_MSB   0xFFFF

Definition at line 101 of file ksz8061_driver.h.

◆ KSZ8061_PHYID1_PHY_ID_MSB_DEFAULT

#define KSZ8061_PHYID1_PHY_ID_MSB_DEFAULT   0x0022

Definition at line 102 of file ksz8061_driver.h.

◆ KSZ8061_PHYID2

#define KSZ8061_PHYID2   0x03

Definition at line 48 of file ksz8061_driver.h.

◆ KSZ8061_PHYID2_MODEL_NUM

#define KSZ8061_PHYID2_MODEL_NUM   0x03F0

Definition at line 107 of file ksz8061_driver.h.

◆ KSZ8061_PHYID2_MODEL_NUM_DEFAULT

#define KSZ8061_PHYID2_MODEL_NUM_DEFAULT   0x0170

Definition at line 108 of file ksz8061_driver.h.

◆ KSZ8061_PHYID2_PHY_ID_LSB

#define KSZ8061_PHYID2_PHY_ID_LSB   0xFC00

Definition at line 105 of file ksz8061_driver.h.

◆ KSZ8061_PHYID2_PHY_ID_LSB_DEFAULT

#define KSZ8061_PHYID2_PHY_ID_LSB_DEFAULT   0x1400

Definition at line 106 of file ksz8061_driver.h.

◆ KSZ8061_PHYID2_REVISION_NUM

#define KSZ8061_PHYID2_REVISION_NUM   0x000F

Definition at line 109 of file ksz8061_driver.h.

◆ KSZ8061_RXERCTR

#define KSZ8061_RXERCTR   0x15

Definition at line 61 of file ksz8061_driver.h.

◆ KSZ8061_SIGNAL_QUALITY

#define KSZ8061_SIGNAL_QUALITY   0x1C, 0xAC

Definition at line 73 of file ksz8061_driver.h.

◆ KSZ8061_SIGNAL_QUALITY_SIGNAL_QUALITY_IND

#define KSZ8061_SIGNAL_QUALITY_SIGNAL_QUALITY_IND   0x7F00

Definition at line 264 of file ksz8061_driver.h.

Function Documentation

◆ ksz8061DisableIrq()

void ksz8061DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 192 of file ksz8061_driver.c.

◆ ksz8061DumpPhyReg()

void ksz8061DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 337 of file ksz8061_driver.c.

◆ ksz8061EnableIrq()

void ksz8061EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 177 of file ksz8061_driver.c.

◆ ksz8061EventHandler()

void ksz8061EventHandler ( NetInterface interface)

KSZ8061 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 207 of file ksz8061_driver.c.

◆ ksz8061Init()

error_t ksz8061Init ( NetInterface interface)

KSZ8061 PHY transceiver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 60 of file ksz8061_driver.c.

◆ ksz8061InitHook()

void ksz8061InitHook ( NetInterface interface)

KSZ8061 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 129 of file ksz8061_driver.c.

◆ ksz8061ReadMmdReg()

uint16_t ksz8061ReadMmdReg ( NetInterface interface,
uint8_t  devAddr,
uint16_t  regAddr 
)

Read MMD register.

Parameters
[in]interfaceUnderlying network interface
[in]devAddrDevice address
[in]regAddrRegister address
Returns
MMD register value

Definition at line 389 of file ksz8061_driver.c.

◆ ksz8061ReadPhyReg()

uint16_t ksz8061ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
Returns
Register value

Definition at line 311 of file ksz8061_driver.c.

◆ ksz8061Tick()

void ksz8061Tick ( NetInterface interface)

KSZ8061 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 139 of file ksz8061_driver.c.

◆ ksz8061WriteMmdReg()

void ksz8061WriteMmdReg ( NetInterface interface,
uint8_t  devAddr,
uint16_t  regAddr,
uint16_t  data 
)

Write MMD register.

Parameters
[in]interfaceUnderlying network interface
[in]devAddrDevice address
[in]regAddrRegister address
[in]dataMMD register value

Definition at line 362 of file ksz8061_driver.c.

◆ ksz8061WritePhyReg()

void ksz8061WritePhyReg ( NetInterface interface,
uint8_t  address,
uint16_t  data 
)

Write PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
[in]dataRegister value

Definition at line 287 of file ksz8061_driver.c.

Variable Documentation

◆ ksz8061PhyDriver

const PhyDriver ksz8061PhyDriver
extern

KSZ8061 Ethernet PHY driver.

Definition at line 44 of file ksz8061_driver.c.