blob: 5f7f6d11af07152dd7e070cd0d16d3fc397929cf [file] [log] [blame]
wdenkba91e262005-05-30 23:55:42 +00001/*
2 * (C) Copyright 2004
3 * Elmeg Communications Systems GmbH, Juergen Selent (j.selent@elmeg.de)
4 *
5 * Support for the Elmeg VoVPN Gateway Module
6 * ------------------------------------------
7 * Initialize Marvell M88E6060 Switch
8 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02009 * SPDX-License-Identifier: GPL-2.0+
wdenkba91e262005-05-30 23:55:42 +000010 */
11
12#ifndef _INC_m88e6060_h_
13#define _INC_m88e6060_h_
14
15/* ************************************************************************** */
16/* *** DEFINES ************************************************************** */
17
18/* switch hw */
19#define M88X_PRT_CNT 6
20#define M88X_PHY_CNT 5
21
22/* phy register offsets */
23#define M88X_PHY_CNTL 0x00
24#define M88X_PHY_STAT 0x00
25#define M88X_PHY_ID0 0x02
26#define M88X_PHY_ID1 0x03
27#define M88X_PHY_ANEG_ADV 0x04
28#define M88X_PHY_LPA 0x05
29#define M88X_PHY_ANEG_EXP 0x06
30#define M88X_PHY_NPT 0x07
31#define M88X_PHY_LPNP 0x08
32
33/* port register offsets */
34#define M88X_PRT_STAT 0x00
35#define M88X_PRT_ID 0x03
36#define M88X_PRT_CNTL 0x04
37#define M88X_PRT_VLAN 0x06
38#define M88X_PRT_PAV 0x0b
39#define M88X_PRT_RX 0x10
40#define M88X_PRT_TX 0x11
41
42/* global/atu register offsets */
43#define M88X_GLB_STAT 0x00
44#define M88X_GLB_MAC01 0x01
45#define M88X_GLB_MAC23 0x02
46#define M88X_GLB_MAC45 0x03
47#define M88X_GLB_CNTL 0x04
48#define M88X_ATU_CNTL 0x0a
49#define M88X_ATU_OP 0x0b
50
51/* id0 register - 0x02 */
52#define M88X_PHY_ID0_VALUE 0x0141
53
54/* id1 register - 0x03 */
55#define M88X_PHY_ID1_VALUE 0x0c80 /* without revision ! */
56
57
58/* misc */
59#define M88E6060_ID ((M88X_PHY_ID0_VALUE<<16) | M88X_PHY_ID1_VALUE)
60
wdenkba91e262005-05-30 23:55:42 +000061/* ************************************************************************** */
62/* *** TYPEDEFS ************************************************************* */
63
64typedef struct {
65 int reg;
66 unsigned short msk;
67 unsigned short val;
68} m88x_regCfg_t;
69
wdenkba91e262005-05-30 23:55:42 +000070/* ************************************************************************** */
71/* *** PROTOTYPES *********************************************************** */
72
73extern int m88e6060_initialize( int );
74
wdenkba91e262005-05-30 23:55:42 +000075#endif /* _INC_m88e6060_h_ */