phy.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Marvell 88E6xxx PHY access
  4. *
  5. * Copyright (c) 2008 Marvell Semiconductor
  6. *
  7. * Copyright (c) 2017 Andrew Lunn <[email protected]>
  8. */
  9. #ifndef _MV88E6XXX_PHY_H
  10. #define _MV88E6XXX_PHY_H
  11. #define MV88E6XXX_PHY_PAGE 0x16
  12. #define MV88E6XXX_PHY_PAGE_COPPER 0x00
  13. /* PHY Registers accesses implementations */
  14. int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  15. int addr, int reg, u16 *val);
  16. int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  17. int addr, int reg, u16 val);
  18. int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  19. int addr, int reg, u16 *val);
  20. int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  21. int addr, int reg, u16 val);
  22. /* Generic PHY operations */
  23. int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy,
  24. int reg, u16 *val);
  25. int mv88e6xxx_phy_write(struct mv88e6xxx_chip *chip, int phy,
  26. int reg, u16 val);
  27. int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy,
  28. u8 page, int reg, u16 *val);
  29. int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy,
  30. u8 page, int reg, u16 val);
  31. void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip);
  32. void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip);
  33. int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip);
  34. #endif /*_MV88E6XXX_PHY_H */