diff --git a/include/libopencm3/ethernet/phy_ksz80x1.h b/include/libopencm3/ethernet/phy_ksz80x1.h index 4a7e40eb..6d7aba5a 100644 --- a/include/libopencm3/ethernet/phy_ksz80x1.h +++ b/include/libopencm3/ethernet/phy_ksz80x1.h @@ -129,9 +129,8 @@ #define KSZ80X1_AFECTRL4_10TE (1 << 4) /* ----------KL */ /* KSZ80X1_MIICTRL ----------------------------------------------------------*/ - -#define KSZ8051_MIICTRL_100MRESTORE (1 << 7) /* ---DE------ */ -#define KSZ8051_MIICTRL_100MRESTORE (1 << 6) /* ---DE------ */ +#define KSZ8051_MIICTRL_PREAM_RESTORE_100M (1 << 7) /* ---DE------ */ +#define KSZ8051_MIICTRL_PREAM_RESTORE_10M (1 << 6) /* ---DE------ */ /* KSZ80X1_RXERCTR ----------------------------------------------------------*/ @@ -204,7 +203,7 @@ /* KSZ80X1_CR1 --------------------------------------------------------------*/ -/* family set 1 */ +/* family set 1, "8041" when conflicts arise */ #define KSZ80X1_CR1_LEDMODE (3 << 14) /* A-CDE------- */ #define KSZ80X1_CR1_LEDMODE_COL_FD_SPD_LNK (0 << 14) /* A---------- */ @@ -212,9 +211,9 @@ #define KSZ80X1_CR1_LEDMODE_ACT_FD_100_10 (2 << 14) /* A---------- */ #define KSZ80X1_CR1_LEDMODE_SPD_LNK (0 << 14) /* --CDE------ */ #define KSZ80X1_CR1_LEDMODE_ACT_LNK (1 << 14) /* --CDE------ */ -#define KSZ80X1_CR1_POLARITY (1 << 13) /* A-CDE------ */ +#define KSZ8041_CR1_POLARITY (1 << 13) /* A-CDE------ */ #define KSZ80X1_CR1_FEFAULT (1 << 12) /* A---E------ */ -#define KSZ80X1_CR1_MDIX (1 << 11) /* A-CDE------ */ +#define KSZ8041_CR1_MDIX (1 << 11) /* A-CDE------ */ #define KSZ80X1_CR1_LOOPBACK (1 << 7) /* A-CDE------ */ /* family set 2 */ diff --git a/lib/ethernet/phy_ksz80x1.c b/lib/ethernet/phy_ksz80x1.c index 275b5db9..8ce17794 100644 --- a/lib/ethernet/phy_ksz80x1.c +++ b/lib/ethernet/phy_ksz80x1.c @@ -33,7 +33,7 @@ #include #include -#include +#include /**@{*/ @@ -48,7 +48,7 @@ */ enum phy_status phy_link_status(uint8_t phy) { - return eth_smi_read(phy, PHY_REG_CR1) & 0x07; + return eth_smi_read(phy, KSZ80X1_CR1) & 0x07; } /*---------------------------------------------------------------------------*/ diff --git a/lib/stm32/f1/Makefile b/lib/stm32/f1/Makefile index 57635184..2bfbf78f 100755 --- a/lib/stm32/f1/Makefile +++ b/lib/stm32/f1/Makefile @@ -38,7 +38,7 @@ ARFLAGS = rcs OBJS = adc.o adc_common_v1.o can.o desig.o flash.o gpio.o \ rcc.o rtc.o timer.o -OBJS += mac.o mac_stm32fxx7.o phy.o phy_ksz8051mll.o +OBJS += mac.o mac_stm32fxx7.o phy.o phy_ksz80x1.o OBJS += crc_common_all.o dac_common_all.o dma_common_l1f013.o \ gpio_common_all.o i2c_common_v1.o iwdg_common_all.o \