// SPDX-License-Identifier: GPL-2.0+
/*
 * LXT PHY drivers
 *
 * Copyright 2010-2011 Freescale Semiconductor, Inc.
 * author Andy Fleming
 */
#include <phy.h>

/* LXT971 Status 2 registers */
#define MIIM_LXT971_SR2                     0x11  /* Status Register 2  */
#define MIIM_LXT971_SR2_SPEED_MASK 0x4200
#define MIIM_LXT971_SR2_10HDX     0x0000  /*  10 Mbit half duplex selected */
#define MIIM_LXT971_SR2_10FDX     0x0200  /*  10 Mbit full duplex selected */
#define MIIM_LXT971_SR2_100HDX    0x4000  /* 100 Mbit half duplex selected */
#define MIIM_LXT971_SR2_100FDX    0x4200  /* 100 Mbit full duplex selected */

/* LXT971 */
static int lxt971_parse_status(struct phy_device *phydev)
{
	int mii_reg;
	int speed;

	mii_reg = phy_read(phydev, MDIO_DEVAD_NONE, MIIM_LXT971_SR2);
	speed = mii_reg & MIIM_LXT971_SR2_SPEED_MASK;

	switch (speed) {
	case MIIM_LXT971_SR2_10HDX:
		phydev->speed = SPEED_10;
		phydev->duplex = DUPLEX_HALF;
		break;
	case MIIM_LXT971_SR2_10FDX:
		phydev->speed = SPEED_10;
		phydev->duplex = DUPLEX_FULL;
		break;
	case MIIM_LXT971_SR2_100HDX:
		phydev->speed = SPEED_100;
		phydev->duplex = DUPLEX_HALF;
		break;
	default:
		phydev->speed = SPEED_100;
		phydev->duplex = DUPLEX_FULL;
	}

	return 0;
}

static int lxt971_startup(struct phy_device *phydev)
{
	int ret;

	ret = genphy_update_link(phydev);
	if (ret)
		return ret;

	return lxt971_parse_status(phydev);
}

U_BOOT_PHY_DRIVER(lxt971) = {
	.name = "LXT971",
	.uid = 0x1378e0,
	.mask = 0xfffff0,
	.features = PHY_BASIC_FEATURES,
	.config = &genphy_config_aneg,
	.startup = &lxt971_startup,
	.shutdown = &genphy_shutdown,
};
