blob: 4328d6f29d4d4c9d7910a6e40610dd6e6698d247 [file] [log] [blame]
Vivien Didelot18abed22016-11-04 03:23:26 +01001/*
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
19int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg,
20 u16 *val);
21int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg,
22 u16 val);
23
Vivien Didelota0a0f622016-11-04 03:23:34 +010024int mv88e6352_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
25 phy_interface_t mode);
26int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
27 phy_interface_t mode);
28
Vivien Didelot08ef7f12016-11-04 03:23:32 +010029int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link);
30
Vivien Didelot7f1ae072016-11-04 03:23:33 +010031int mv88e6xxx_port_set_duplex(struct mv88e6xxx_chip *chip, int port, int dup);
32
Vivien Didelot96a2b402016-11-04 03:23:35 +010033int mv88e6065_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
34int mv88e6185_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
35int mv88e6352_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
36int mv88e6390_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
37int mv88e6390x_port_set_speed(struct mv88e6xxx_chip *chip, int port, int speed);
38
Vivien Didelote28def332016-11-04 03:23:27 +010039int mv88e6xxx_port_set_state(struct mv88e6xxx_chip *chip, int port, u8 state);
40
Vivien Didelot5a7921f2016-11-04 03:23:28 +010041int mv88e6xxx_port_set_vlan_map(struct mv88e6xxx_chip *chip, int port, u16 map);
42
Vivien Didelotb4e48c52016-11-04 03:23:29 +010043int mv88e6xxx_port_get_fid(struct mv88e6xxx_chip *chip, int port, u16 *fid);
44int mv88e6xxx_port_set_fid(struct mv88e6xxx_chip *chip, int port, u16 fid);
45
Vivien Didelot77064f32016-11-04 03:23:30 +010046int mv88e6xxx_port_get_pvid(struct mv88e6xxx_chip *chip, int port, u16 *pvid);
47int mv88e6xxx_port_set_pvid(struct mv88e6xxx_chip *chip, int port, u16 pvid);
48
Vivien Didelot385a0992016-11-04 03:23:31 +010049int mv88e6xxx_port_set_8021q_mode(struct mv88e6xxx_chip *chip, int port,
50 u16 mode);
Andrew Lunnef0a7312016-12-03 04:35:16 +010051int mv88e6095_port_tag_remap(struct mv88e6xxx_chip *chip, int port);
52int mv88e6390_port_tag_remap(struct mv88e6xxx_chip *chip, int port);
Andrew Lunn56995cb2016-12-03 04:35:19 +010053int mv88e6xxx_port_set_egress_mode(struct mv88e6xxx_chip *chip, int port,
54 u16 mode);
55int mv88e6085_port_set_frame_mode(struct mv88e6xxx_chip *chip, int port,
56 enum mv88e6xxx_frame_mode mode);
57int mv88e6351_port_set_frame_mode(struct mv88e6xxx_chip *chip, int port,
58 enum mv88e6xxx_frame_mode mode);
59int mv88e6085_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port,
60 bool on);
Andrew Lunna23b2962017-02-04 20:15:28 +010061int mv88e6095_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port,
62 bool on);
Andrew Lunn56995cb2016-12-03 04:35:19 +010063int mv88e6351_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port,
64 bool on);
65int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
66 u16 etype);
Vivien Didelotea698f42017-03-11 16:12:50 -050067int mv88e6xxx_port_set_message_port(struct mv88e6xxx_chip *chip, int port,
68 bool message_port);
Andrew Lunn5f436662016-12-03 04:45:17 +010069int mv88e6165_port_jumbo_config(struct mv88e6xxx_chip *chip, int port);
Andrew Lunnef70b112016-12-03 04:45:18 +010070int mv88e6095_port_egress_rate_limiting(struct mv88e6xxx_chip *chip, int port);
71int mv88e6097_port_egress_rate_limiting(struct mv88e6xxx_chip *chip, int port);
Andrew Lunnb35d322a2016-12-03 04:45:19 +010072int mv88e6097_port_pause_config(struct mv88e6xxx_chip *chip, int port);
Andrew Lunn3ce0e652016-12-03 04:45:20 +010073int mv88e6390_port_pause_config(struct mv88e6xxx_chip *chip, int port);
Andrew Lunnf39908d2017-02-04 20:02:50 +010074int mv88e6390x_port_set_cmode(struct mv88e6xxx_chip *chip, int port,
75 phy_interface_t mode);
76int mv88e6xxx_port_get_cmode(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
Andrew Lunna23b2962017-02-04 20:15:28 +010077int mv88e6xxx_port_set_map_da(struct mv88e6xxx_chip *chip, int port);
78int mv88e6095_port_set_upstream_port(struct mv88e6xxx_chip *chip, int port,
79 int upstream_port);
Vivien Didelot18abed22016-11-04 03:23:26 +010080#endif /* _MV88E6XXX_PORT_H */