Microchip® Advanced Software Framework

dummy_phy/ethernet_phy.h File Reference

Ethernet Phy Management for a dummy Ethernet phy component.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include "macb.h"

Macros

#define EXTPHY_PHY_ADDR   0x01
 
#define EXTPHY_PHY_ID   0xFFFFFFFF
 
#define RBR_RMII   0x0020
 RMII Mode. More...
 
Extended registers for a dummy Ethernet phy
#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_ADDR   0x01

Phy Address (set through strap options) This Define must be place in the board configuration

#define EXTPHY_PHY_ID   0xFFFFFFFF

Phy Identifier for a dummy Ethernet phy

#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 prvSetupMACBInterrupt().

#define PHY_PHYCR   0x19

Phy CTRL reg.

#define PHY_RBR   0x17

RMII Bypass reg.

#define PHYCR_MDIX_EN   0x8000

Enable Auto MDIX.

#define PHYCR_MDIX_FORCE   0x4000

Force MDIX crossed.

#define RBR_RMII   0x0020

RMII Mode.

RMII Bypass Register

static void ethernet_phy_hw_reset ( void  )
inlinestatic

Generate an Hardware Reset on the Phy.

static void ethernet_phy_setup_auto_negotiation ( volatile avr32_macb_t *  macb,
volatile unsigned long *  config 
)
inlinestatic

Setup auto-negotiation for the Phy.

static void ethernet_phy_setup_rmii ( volatile avr32_macb_t *  macb)
inlinestatic

Setup the Phy in RMII mode.

static void ethernet_phy_sw_reset ( volatile avr32_macb_t *  macb)
inlinestatic

Generate a Software Reset on the Phy.