Ethernet Phy Management for DP83848 series.
Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.
#include "macb.h"
Macros | |
#define | EXTPHY_PHY_ID 0x20005C90 |
#define | RBR_RMII 0x0020 |
RMII Mode. More... | |
Extended registers for DP83848 | |
#define | PHY_RBR 0x17 |
RMII Bypass reg. More... | |
#define | PHY_MICR 0x11 |
Interrupt Control reg. More... | |
#define | PHY_MISR 0x12 |
Interrupt Status reg. More... | |
#define | PHY_PHYCR 0x19 |
Phy CTRL reg. More... | |
Interrupt Ctrl Register. | |
#define | MICR_INTEN 0x0002 |
Enable interrupts. More... | |
#define | MICR_INTOE 0x0001 |
Enable INT output. More... | |
Interrupt Status Register. | |
#define | MISR_ED_INT_EN 0x0040 |
Energy Detect enabled. More... | |
#define | MISR_LINK_INT_EN 0x0020 |
Link status change enabled. More... | |
#define | MISR_SPD_INT_EN 0x0010 |
Speed change enabled. More... | |
#define | MISR_DP_INT_EN 0x0008 |
Duplex mode change enabled. More... | |
#define | MISR_ANC_INT_EN 0x0004 |
Auto-Neg complete enabled. More... | |
#define | MISR_FHF_INT_EN 0x0002 |
False Carrier enabled. More... | |
#define | MISR_RHF_INT_EN 0x0001 |
Receive Error enabled. More... | |
#define | MISR_ED_INT 0x4000 |
Energy Detect. More... | |
#define | MISR_LINK_INT 0x2000 |
Link status change. More... | |
#define | MISR_SPD_INT 0x1000 |
Speed change. More... | |
#define | MISR_DP_INT 0x0800 |
Duplex mode change. More... | |
#define | MISR_ANC_INT 0x0400 |
Auto-Neg complete. More... | |
#define | MISR_FHF_INT 0x0200 |
False Carrier. More... | |
#define | MISR_RHF_INT 0x0100 |
Receive Error. More... | |
Phy Ctrl Register. | |
#define | PHYCR_MDIX_EN 0x8000 |
Enable Auto MDIX. More... | |
#define | PHYCR_MDIX_FORCE 0x4000 |
Force MDIX crossed. More... | |
Functions | |
static void | ethernet_phy_hw_reset (void) |
Generate an Hardware Reset on the Phy. More... | |
static void | ethernet_phy_setup_auto_negotiation (volatile avr32_macb_t *macb, volatile unsigned long *config) |
Setup auto-negotiation for the Phy. More... | |
static void | ethernet_phy_setup_rmii (volatile avr32_macb_t *macb) |
Setup the Phy in RMII mode. More... | |
static void | ethernet_phy_sw_reset (volatile avr32_macb_t *macb) |
Generate a Software Reset on the Phy. More... | |
#define EXTPHY_PHY_ID 0x20005C90 |
Phy Identifier for the DP83848
Referenced by prvProbePHY().
#define MICR_INTEN 0x0002 |
Enable interrupts.
Referenced by prvSetupMACBInterrupt().
#define MICR_INTOE 0x0001 |
Enable INT output.
Referenced by prvSetupMACBInterrupt().
#define MISR_ANC_INT 0x0400 |
Auto-Neg complete.
#define MISR_ANC_INT_EN 0x0004 |
Auto-Neg complete enabled.
#define MISR_DP_INT 0x0800 |
Duplex mode change.
#define MISR_DP_INT_EN 0x0008 |
Duplex mode change enabled.
#define MISR_ED_INT 0x4000 |
Energy Detect.
#define MISR_ED_INT_EN 0x0040 |
Energy Detect enabled.
#define MISR_FHF_INT 0x0200 |
False Carrier.
#define MISR_FHF_INT_EN 0x0002 |
False Carrier enabled.
#define MISR_LINK_INT 0x2000 |
Link status change.
#define MISR_LINK_INT_EN 0x0020 |
Link status change enabled.
Referenced by prvSetupMACBInterrupt().
#define MISR_RHF_INT 0x0100 |
Receive Error.
#define MISR_RHF_INT_EN 0x0001 |
Receive Error enabled.
#define MISR_SPD_INT 0x1000 |
Speed change.
#define MISR_SPD_INT_EN 0x0010 |
Speed change enabled.
#define PHY_MICR 0x11 |
Interrupt Control reg.
Referenced by prvSetupMACBInterrupt().
#define PHY_MISR 0x12 |
Interrupt Status reg.
Referenced by prvPHY_ISR_NonNakedBehaviour(), and prvSetupMACBInterrupt().
#define PHY_PHYCR 0x19 |
Phy CTRL reg.
Referenced by ethernet_phy_setup_auto_negotiation().
#define PHY_RBR 0x17 |
RMII Bypass reg.
Referenced by ethernet_phy_setup_rmii().
#define PHYCR_MDIX_EN 0x8000 |
Enable Auto MDIX.
Referenced by ethernet_phy_setup_auto_negotiation().
#define PHYCR_MDIX_FORCE 0x4000 |
Force MDIX crossed.
Referenced by ethernet_phy_setup_auto_negotiation().
#define RBR_RMII 0x0020 |
|
inlinestatic |
Generate an Hardware Reset on the Phy.
Referenced by xMACBInit().
|
inlinestatic |
Setup auto-negotiation for the Phy.
References BMCR_ANENABLE, BMCR_ANRESTART, BMCR_FULLDPLX, BMCR_SPEED100, PHY_PHYCR, PHYCR_MDIX_EN, PHYCR_MDIX_FORCE, ulReadMDIO(), and vWriteMDIO().
Referenced by prvProbePHY().
|
inlinestatic |
Setup the Phy in RMII mode.
References PHY_RBR, RBR_RMII, ulReadMDIO(), and vWriteMDIO().
Referenced by prvProbePHY().
|
inlinestatic |
Generate a Software Reset on the Phy.
References BMCR_RESET, PHY_BMCR, ulReadMDIO(), and vWriteMDIO().
Referenced by xMACBInit().