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 | * |
Vivien Didelot | 4333d61 | 2017-03-28 15:10:36 -0400 | [diff] [blame] | 6 | * Copyright (c) 2016-2017 Savoir-faire Linux Inc. |
| 7 | * Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
Vivien Didelot | 18abed2 | 2016-11-04 03:23:26 +0100 | [diff] [blame] | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | */ |
| 14 | |
| 15 | #ifndef _MV88E6XXX_PORT_H |
| 16 | #define _MV88E6XXX_PORT_H |
| 17 | |
| 18 | #include "mv88e6xxx.h" |
| 19 | |
| 20 | int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg, |
| 21 | u16 *val); |
| 22 | int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg, |
| 23 | u16 val); |
| 24 | |
Vivien Didelot | a0a0f62 | 2016-11-04 03:23:34 +0100 | [diff] [blame] | 25 | int mv88e6352_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port, |
| 26 | phy_interface_t mode); |
| 27 | int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port, |
| 28 | phy_interface_t mode); |
| 29 | |
Vivien Didelot | 08ef7f1 | 2016-11-04 03:23:32 +0100 | [diff] [blame] | 30 | int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link); |
| 31 | |
Vivien Didelot | 7f1ae07 | 2016-11-04 03:23:33 +0100 | [diff] [blame] | 32 | int mv88e6xxx_port_set_duplex(struct mv88e6xxx_chip *chip, int port, int dup); |
| 33 | |
Vivien Didelot | 96a2b40 | 2016-11-04 03:23:35 +0100 | [diff] [blame] | 34 | int mv88e6065_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 35 | int mv88e6185_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 36 | int mv88e6352_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 37 | int mv88e6390_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 38 | int mv88e6390x_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed); |
| 39 | |
Vivien Didelot | e28def33 | 2016-11-04 03:23:27 +0100 | [diff] [blame] | 40 | int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state); |
| 41 | |
Vivien Didelot | 5a7921f | 2016-11-04 03:23:28 +0100 | [diff] [blame] | 42 | int mv88e6xxx_port_set_vlan_map(struct mv88e6xxx_chip *chip, int port, u16 map); |
| 43 | |
Vivien Didelot | b4e48c5 | 2016-11-04 03:23:29 +0100 | [diff] [blame] | 44 | int mv88e6xxx_port_get_fid(struct mv88e6xxx_chip *chip, int port, u16 *fid); |
| 45 | int mv88e6xxx_port_set_fid(struct mv88e6xxx_chip *chip, int port, u16 fid); |
| 46 | |
Vivien Didelot | 77064f3 | 2016-11-04 03:23:30 +0100 | [diff] [blame] | 47 | int mv88e6xxx_port_get_pvid(struct mv88e6xxx_chip *chip, int port, u16 *pvid); |
| 48 | int mv88e6xxx_port_set_pvid(struct mv88e6xxx_chip *chip, int port, u16 pvid); |
| 49 | |
Vivien Didelot | 385a099 | 2016-11-04 03:23:31 +0100 | [diff] [blame] | 50 | int mv88e6xxx_port_set_8021q_mode(struct mv88e6xxx_chip *chip, int port, |
| 51 | u16 mode); |
Andrew Lunn | ef0a731 | 2016-12-03 04:35:16 +0100 | [diff] [blame] | 52 | int mv88e6095_port_tag_remap(struct mv88e6xxx_chip *chip, int port); |
| 53 | int mv88e6390_port_tag_remap(struct mv88e6xxx_chip *chip, int port); |
Andrew Lunn | 56995cb | 2016-12-03 04:35:19 +0100 | [diff] [blame] | 54 | int mv88e6xxx_port_set_egress_mode(struct mv88e6xxx_chip *chip, int port, |
| 55 | u16 mode); |
| 56 | int mv88e6085_port_set_frame_mode(struct mv88e6xxx_chip *chip, int port, |
| 57 | enum mv88e6xxx_frame_mode mode); |
| 58 | int mv88e6351_port_set_frame_mode(struct mv88e6xxx_chip *chip, int port, |
| 59 | enum mv88e6xxx_frame_mode mode); |
Vivien Didelot | 601aeed | 2017-03-11 16:13:00 -0500 | [diff] [blame] | 60 | int mv88e6185_port_set_egress_floods(struct mv88e6xxx_chip *chip, int port, |
| 61 | bool unicast, bool multicast); |
| 62 | int mv88e6352_port_set_egress_floods(struct mv88e6xxx_chip *chip, int port, |
| 63 | bool unicast, bool multicast); |
Andrew Lunn | 56995cb | 2016-12-03 04:35:19 +0100 | [diff] [blame] | 64 | int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port, |
| 65 | u16 etype); |
Vivien Didelot | ea698f4 | 2017-03-11 16:12:50 -0500 | [diff] [blame] | 66 | int mv88e6xxx_port_set_message_port(struct mv88e6xxx_chip *chip, int port, |
| 67 | bool message_port); |
Andrew Lunn | 5f43666 | 2016-12-03 04:45:17 +0100 | [diff] [blame] | 68 | int mv88e6165_port_jumbo_config(struct mv88e6xxx_chip *chip, int port); |
Andrew Lunn | ef70b11 | 2016-12-03 04:45:18 +0100 | [diff] [blame] | 69 | int mv88e6095_port_egress_rate_limiting(struct mv88e6xxx_chip *chip, int port); |
| 70 | int mv88e6097_port_egress_rate_limiting(struct mv88e6xxx_chip *chip, int port); |
Andrew Lunn | b35d322a | 2016-12-03 04:45:19 +0100 | [diff] [blame] | 71 | int mv88e6097_port_pause_config(struct mv88e6xxx_chip *chip, int port); |
Andrew Lunn | 3ce0e65 | 2016-12-03 04:45:20 +0100 | [diff] [blame] | 72 | int mv88e6390_port_pause_config(struct mv88e6xxx_chip *chip, int port); |
Andrew Lunn | f39908d | 2017-02-04 20:02:50 +0100 | [diff] [blame] | 73 | int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port, |
| 74 | phy_interface_t mode); |
| 75 | int mv88e6xxx_port_get_cmode(struct mv88e6xxx_chip *chip, int port, u8 *cmode); |
Andrew Lunn | a23b296 | 2017-02-04 20:15:28 +0100 | [diff] [blame] | 76 | int mv88e6xxx_port_set_map_da(struct mv88e6xxx_chip *chip, int port); |
| 77 | int mv88e6095_port_set_upstream_port(struct mv88e6xxx_chip *chip, int port, |
| 78 | int upstream_port); |
Vivien Didelot | c8c9489 | 2017-03-11 16:13:01 -0500 | [diff] [blame] | 79 | |
| 80 | int mv88e6xxx_port_disable_learn_limit(struct mv88e6xxx_chip *chip, int port); |
Vivien Didelot | 9dbfb4e | 2017-03-11 16:13:02 -0500 | [diff] [blame] | 81 | int mv88e6xxx_port_disable_pri_override(struct mv88e6xxx_chip *chip, int port); |
Vivien Didelot | c8c9489 | 2017-03-11 16:13:01 -0500 | [diff] [blame] | 82 | |
Vivien Didelot | 18abed2 | 2016-11-04 03:23:26 +0100 | [diff] [blame] | 83 | #endif /* _MV88E6XXX_PORT_H */ |