phy.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Marvell 88E6xxx PHY access
  3. *
  4. * Copyright (c) 2008 Marvell Semiconductor
  5. *
  6. * Copyright (c) 2017 Andrew Lunn <andrew@lunn.ch>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. */
  13. #ifndef _MV88E6XXX_PHY_H
  14. #define _MV88E6XXX_PHY_H
  15. #define MV88E6XXX_PHY_PAGE 0x16
  16. #define MV88E6XXX_PHY_PAGE_COPPER 0x00
  17. /* PHY Registers accesses implementations */
  18. int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  19. int addr, int reg, u16 *val);
  20. int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  21. int addr, int reg, u16 val);
  22. int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  23. int addr, int reg, u16 *val);
  24. int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus,
  25. int addr, int reg, u16 val);
  26. /* Generic PHY operations */
  27. int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy,
  28. int reg, u16 *val);
  29. int mv88e6xxx_phy_write(struct mv88e6xxx_chip *chip, int phy,
  30. int reg, u16 val);
  31. int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy,
  32. u8 page, int reg, u16 *val);
  33. int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy,
  34. u8 page, int reg, u16 val);
  35. void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip);
  36. void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip);
  37. int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip);
  38. #endif /*_MV88E6XXX_PHY_H */