Vivien Didelot | 18abed2 | 2016-11-04 03:23:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Marvell 88E6xxx Switch Port Registers support |
| 3 | * |
| 4 | * Copyright (c) 2008 Marvell Semiconductor |
| 5 | * |
| 6 | * Copyright (c) 2016 Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
| 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 | |
| 14 | #ifndef _MV88E6XXX_PORT_H |
| 15 | #define _MV88E6XXX_PORT_H |
| 16 | |
| 17 | #include "mv88e6xxx.h" |
| 18 | |
| 19 | int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg, |
| 20 | u16 *val); |
| 21 | int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg, |
| 22 | u16 val); |
| 23 | |
Vivien Didelot | a0a0f62 | 2016-11-04 03:23:34 +0100 | [diff] [blame] | 24 | int mv88e6352_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port, |
| 25 | phy_interface_t mode); |
| 26 | int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port, |
| 27 | phy_interface_t mode); |
| 28 | |
Vivien Didelot | 08ef7f1 | 2016-11-04 03:23:32 +0100 | [diff] [blame] | 29 | int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link); |
| 30 | |
Vivien Didelot | 7f1ae07 | 2016-11-04 03:23:33 +0100 | [diff] [blame] | 31 | int mv88e6xxx_port_set_duplex(struct mv88e6xxx_chip *chip, int port, int dup); |
| 32 | |
Vivien Didelot | 96a2b40 | 2016-11-04 03:23:35 +0100 | [diff] [blame] | 33 | int mv88e6065_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 34 | int mv88e6185_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 35 | int mv88e6352_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 36 | int mv88e6390_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 37 | int mv88e6390x_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 38 | |
Vivien Didelot | e28def33 | 2016-11-04 03:23:27 +0100 | [diff] [blame] | 39 | int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state); |
| 40 | |
Vivien Didelot | 5a7921f | 2016-11-04 03:23:28 +0100 | [diff] [blame] | 41 | int mv88e6xxx_port_set_vlan_map(struct mv88e6xxx_chip *chip, int port, u16 map); |
| 42 | |
Vivien Didelot | b4e48c5 | 2016-11-04 03:23:29 +0100 | [diff] [blame] | 43 | int mv88e6xxx_port_get_fid(struct mv88e6xxx_chip *chip, int port, u16 *fid); |
| 44 | int mv88e6xxx_port_set_fid(struct mv88e6xxx_chip *chip, int port, u16 fid); |
| 45 | |
Vivien Didelot | 77064f3 | 2016-11-04 03:23:30 +0100 | [diff] [blame] | 46 | int mv88e6xxx_port_get_pvid(struct mv88e6xxx_chip *chip, int port, u16 *pvid); |
| 47 | int mv88e6xxx_port_set_pvid(struct mv88e6xxx_chip *chip, int port, u16 pvid); |
| 48 | |
Vivien Didelot | 385a099 | 2016-11-04 03:23:31 +0100 | [diff] [blame] | 49 | int mv88e6xxx_port_set_8021q_mode(struct mv88e6xxx_chip *chip, int port, |
| 50 | u16 mode); |
Andrew Lunn | ef0a731 | 2016-12-03 04:35:16 +0100 | [diff] [blame] | 51 | int mv88e6095_port_tag_remap(struct mv88e6xxx_chip *chip, int port); |
| 52 | int mv88e6390_port_tag_remap(struct mv88e6xxx_chip *chip, int port); |
Andrew Lunn | 56995cb | 2016-12-03 04:35:19 +0100 | [diff] [blame^] | 53 | int mv88e6xxx_port_set_egress_mode(struct mv88e6xxx_chip *chip, int port, |
| 54 | u16 mode); |
| 55 | int mv88e6085_port_set_frame_mode(struct mv88e6xxx_chip *chip, int port, |
| 56 | enum mv88e6xxx_frame_mode mode); |
| 57 | int mv88e6351_port_set_frame_mode(struct mv88e6xxx_chip *chip, int port, |
| 58 | enum mv88e6xxx_frame_mode mode); |
| 59 | int mv88e6085_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port, |
| 60 | bool on); |
| 61 | int mv88e6351_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port, |
| 62 | bool on); |
| 63 | int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port, |
| 64 | u16 etype); |
| 65 | |
Vivien Didelot | 385a099 | 2016-11-04 03:23:31 +0100 | [diff] [blame] | 66 | |
Vivien Didelot | 18abed2 | 2016-11-04 03:23:26 +0100 | [diff] [blame] | 67 | #endif /* _MV88E6XXX_PORT_H */ |