blob: 83cb3440e067b39aaba0a9e1cec01622ded2939d [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);
61int mv88e6351_port_set_egress_unknowns(struct mv88e6xxx_chip *chip, int port,
62 bool on);
63int mv88e6351_port_set_ether_type(struct mv88e6xxx_chip *chip, int port,
64 u16 etype);
65
Vivien Didelot385a0992016-11-04 03:23:31 +010066
Vivien Didelot18abed22016-11-04 03:23:26 +010067#endif /* _MV88E6XXX_PORT_H */