blob: 5c1cd6d8e9a5e361971d23ffead531712174ed06 [file] [log] [blame]
Andrew Lunn6d917822017-05-26 01:03:21 +02001/*
2 * Marvell 88E6xxx SERDES manipulation, via SMI bus
3 *
4 * Copyright (c) 2008 Marvell Semiconductor
5 *
6 * Copyright (c) 2016 Andrew Lunn <andrew@lunn.ch>
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_SERDES_H
15#define _MV88E6XXX_SERDES_H
16
Vivien Didelot4d5f2ba72017-06-02 17:06:15 -040017#include "chip.h"
Andrew Lunn6d917822017-05-26 01:03:21 +020018
19#define MV88E6352_ADDR_SERDES 0x0f
20#define MV88E6352_SERDES_PAGE_FIBER 0x01
21
Andrew Lunn6335e9f2017-05-26 01:03:23 +020022#define MV88E6390_PORT9_LANE0 0x09
23#define MV88E6390_PORT9_LANE1 0x12
24#define MV88E6390_PORT9_LANE2 0x13
25#define MV88E6390_PORT9_LANE3 0x14
26#define MV88E6390_PORT10_LANE0 0x0a
27#define MV88E6390_PORT10_LANE1 0x15
28#define MV88E6390_PORT10_LANE2 0x16
29#define MV88E6390_PORT10_LANE3 0x17
30#define MV88E6390_SERDES_DEVICE (4 << 16)
31
32/* 10GBASE-R and 10GBASE-X4/X2 */
33#define MV88E6390_PCS_CONTROL_1 0x1000
34#define MV88E6390_PCS_CONTROL_1_RESET BIT(15)
35#define MV88E6390_PCS_CONTROL_1_LOOPBACK BIT(14)
36#define MV88E6390_PCS_CONTROL_1_SPEED BIT(13)
37#define MV88E6390_PCS_CONTROL_1_PDOWN BIT(11)
38
39/* 1000BASE-X and SGMII */
40#define MV88E6390_SGMII_CONTROL 0x2000
41#define MV88E6390_SGMII_CONTROL_RESET BIT(15)
42#define MV88E6390_SGMII_CONTROL_LOOPBACK BIT(14)
43#define MV88E6390_SGMII_CONTROL_PDOWN BIT(11)
44
Andrew Lunn6d917822017-05-26 01:03:21 +020045int mv88e6352_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on);
Andrew Lunn6335e9f2017-05-26 01:03:23 +020046int mv88e6390_serdes_power(struct mv88e6xxx_chip *chip, int port, bool on);
Andrew Lunn6d917822017-05-26 01:03:21 +020047
48#endif