Browse Source

ethernet: ksz80x1: fix build/compile

Originally sourced from: https://github.com/libopencm3/libopencm3/pull/382

fixed some typos from the manual and poor merging/rebaseing,
and one judgment call on using a specific name for a conflicting
bit definition.
pull/771/merge
Karl Palsson 7 years ago
parent
commit
23fc65d44c
  1. 11
      include/libopencm3/ethernet/phy_ksz80x1.h
  2. 4
      lib/ethernet/phy_ksz80x1.c
  3. 2
      lib/stm32/f1/Makefile

11
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 */

4
lib/ethernet/phy_ksz80x1.c

@ -33,7 +33,7 @@
#include <libopencm3/ethernet/mac.h>
#include <libopencm3/ethernet/phy.h>
#include <libopencm3/ethernet/phy_ksz8051mll.h>
#include <libopencm3/ethernet/phy_ksz80x1.h>
/**@{*/
@ -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;
}
/*---------------------------------------------------------------------------*/

2
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 \

Loading…
Cancel
Save