2017-05-26 07:03:20 +08:00
|
|
|
/*
|
|
|
|
* Marvell 88E6xxx PHY access
|
|
|
|
*
|
|
|
|
* Copyright (c) 2008 Marvell Semiconductor
|
|
|
|
*
|
|
|
|
* Copyright (c) 2017 Andrew Lunn <andrew@lunn.ch>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MV88E6XXX_PHY_H
|
|
|
|
#define _MV88E6XXX_PHY_H
|
|
|
|
|
2017-06-09 06:34:14 +08:00
|
|
|
#define MV88E6XXX_PHY_PAGE 0x16
|
|
|
|
#define MV88E6XXX_PHY_PAGE_COPPER 0x00
|
2017-06-03 05:06:16 +08:00
|
|
|
|
2017-05-27 06:03:06 +08:00
|
|
|
/* PHY Registers accesses implementations */
|
2017-05-26 07:03:20 +08:00
|
|
|
int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
|
|
|
|
int addr, int reg, u16 *val);
|
|
|
|
int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
|
|
|
|
int addr, int reg, u16 val);
|
2017-05-27 06:03:06 +08:00
|
|
|
int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
|
|
|
|
int addr, int reg, u16 *val);
|
|
|
|
int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
|
|
|
|
int addr, int reg, u16 val);
|
|
|
|
|
|
|
|
/* Generic PHY operations */
|
2017-05-26 07:03:20 +08:00
|
|
|
int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy,
|
|
|
|
int reg, u16 *val);
|
|
|
|
int mv88e6xxx_phy_write(struct mv88e6xxx_chip *chip, int phy,
|
|
|
|
int reg, u16 val);
|
|
|
|
int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy,
|
|
|
|
u8 page, int reg, u16 *val);
|
|
|
|
int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy,
|
|
|
|
u8 page, int reg, u16 val);
|
|
|
|
void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip);
|
|
|
|
void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip);
|
2017-05-27 06:03:05 +08:00
|
|
|
int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip);
|
2017-05-26 07:03:20 +08:00
|
|
|
|
|
|
|
#endif /*_MV88E6XXX_PHY_H */
|