110fa5bfcSAndrew Lunn /* 210fa5bfcSAndrew Lunn * Marvell 88E6xxx PHY access 310fa5bfcSAndrew Lunn * 410fa5bfcSAndrew Lunn * Copyright (c) 2008 Marvell Semiconductor 510fa5bfcSAndrew Lunn * 610fa5bfcSAndrew Lunn * Copyright (c) 2017 Andrew Lunn <andrew@lunn.ch> 710fa5bfcSAndrew Lunn * 810fa5bfcSAndrew Lunn * This program is free software; you can redistribute it and/or modify 910fa5bfcSAndrew Lunn * it under the terms of the GNU General Public License as published by 1010fa5bfcSAndrew Lunn * the Free Software Foundation; either version 2 of the License, or 1110fa5bfcSAndrew Lunn * (at your option) any later version. 1210fa5bfcSAndrew Lunn */ 1310fa5bfcSAndrew Lunn 1410fa5bfcSAndrew Lunn #ifndef _MV88E6XXX_PHY_H 1510fa5bfcSAndrew Lunn #define _MV88E6XXX_PHY_H 1610fa5bfcSAndrew Lunn 17bec90b6dSVivien Didelot #define MV88E6XXX_PHY_PAGE 0x16 18bec90b6dSVivien Didelot #define MV88E6XXX_PHY_PAGE_COPPER 0x00 19c4530ee1SVivien Didelot 207e20cfb5SVivien Didelot /* PHY Registers accesses implementations */ 2110fa5bfcSAndrew Lunn int mv88e6165_phy_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus, 2210fa5bfcSAndrew Lunn int addr, int reg, u16 *val); 2310fa5bfcSAndrew Lunn int mv88e6165_phy_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus, 2410fa5bfcSAndrew Lunn int addr, int reg, u16 val); 257e20cfb5SVivien Didelot int mv88e6185_phy_ppu_read(struct mv88e6xxx_chip *chip, struct mii_bus *bus, 267e20cfb5SVivien Didelot int addr, int reg, u16 *val); 277e20cfb5SVivien Didelot int mv88e6185_phy_ppu_write(struct mv88e6xxx_chip *chip, struct mii_bus *bus, 287e20cfb5SVivien Didelot int addr, int reg, u16 val); 297e20cfb5SVivien Didelot 307e20cfb5SVivien Didelot /* Generic PHY operations */ 3110fa5bfcSAndrew Lunn int mv88e6xxx_phy_read(struct mv88e6xxx_chip *chip, int phy, 3210fa5bfcSAndrew Lunn int reg, u16 *val); 3310fa5bfcSAndrew Lunn int mv88e6xxx_phy_write(struct mv88e6xxx_chip *chip, int phy, 3410fa5bfcSAndrew Lunn int reg, u16 val); 3510fa5bfcSAndrew Lunn int mv88e6xxx_phy_page_read(struct mv88e6xxx_chip *chip, int phy, 3610fa5bfcSAndrew Lunn u8 page, int reg, u16 *val); 3710fa5bfcSAndrew Lunn int mv88e6xxx_phy_page_write(struct mv88e6xxx_chip *chip, int phy, 3810fa5bfcSAndrew Lunn u8 page, int reg, u16 val); 3910fa5bfcSAndrew Lunn void mv88e6xxx_phy_init(struct mv88e6xxx_chip *chip); 4010fa5bfcSAndrew Lunn void mv88e6xxx_phy_destroy(struct mv88e6xxx_chip *chip); 411b17aedfSVivien Didelot int mv88e6xxx_phy_setup(struct mv88e6xxx_chip *chip); 4210fa5bfcSAndrew Lunn 4310fa5bfcSAndrew Lunn #endif /*_MV88E6XXX_PHY_H */ 44