wdenk | ba91e26 | 2005-05-30 23:55:42 +0000 | [diff] [blame] | 1 | /* |
| 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 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 22 | * MA 02111-1307 USA |
| 23 | */ |
| 24 | |
| 25 | #ifndef _INC_m88e6060_h_ |
| 26 | #define _INC_m88e6060_h_ |
| 27 | |
| 28 | /* ************************************************************************** */ |
| 29 | /* *** DEFINES ************************************************************** */ |
| 30 | |
| 31 | /* switch hw */ |
| 32 | #define M88X_PRT_CNT 6 |
| 33 | #define M88X_PHY_CNT 5 |
| 34 | |
| 35 | /* phy register offsets */ |
| 36 | #define M88X_PHY_CNTL 0x00 |
| 37 | #define M88X_PHY_STAT 0x00 |
| 38 | #define M88X_PHY_ID0 0x02 |
| 39 | #define M88X_PHY_ID1 0x03 |
| 40 | #define M88X_PHY_ANEG_ADV 0x04 |
| 41 | #define M88X_PHY_LPA 0x05 |
| 42 | #define M88X_PHY_ANEG_EXP 0x06 |
| 43 | #define M88X_PHY_NPT 0x07 |
| 44 | #define M88X_PHY_LPNP 0x08 |
| 45 | |
| 46 | /* port register offsets */ |
| 47 | #define M88X_PRT_STAT 0x00 |
| 48 | #define M88X_PRT_ID 0x03 |
| 49 | #define M88X_PRT_CNTL 0x04 |
| 50 | #define M88X_PRT_VLAN 0x06 |
| 51 | #define M88X_PRT_PAV 0x0b |
| 52 | #define M88X_PRT_RX 0x10 |
| 53 | #define M88X_PRT_TX 0x11 |
| 54 | |
| 55 | /* global/atu register offsets */ |
| 56 | #define M88X_GLB_STAT 0x00 |
| 57 | #define M88X_GLB_MAC01 0x01 |
| 58 | #define M88X_GLB_MAC23 0x02 |
| 59 | #define M88X_GLB_MAC45 0x03 |
| 60 | #define M88X_GLB_CNTL 0x04 |
| 61 | #define M88X_ATU_CNTL 0x0a |
| 62 | #define M88X_ATU_OP 0x0b |
| 63 | |
| 64 | /* id0 register - 0x02 */ |
| 65 | #define M88X_PHY_ID0_VALUE 0x0141 |
| 66 | |
| 67 | /* id1 register - 0x03 */ |
| 68 | #define M88X_PHY_ID1_VALUE 0x0c80 /* without revision ! */ |
| 69 | |
| 70 | |
| 71 | /* misc */ |
| 72 | #define M88E6060_ID ((M88X_PHY_ID0_VALUE<<16) | M88X_PHY_ID1_VALUE) |
| 73 | |
wdenk | ba91e26 | 2005-05-30 23:55:42 +0000 | [diff] [blame] | 74 | /* ************************************************************************** */ |
| 75 | /* *** TYPEDEFS ************************************************************* */ |
| 76 | |
| 77 | typedef struct { |
| 78 | int reg; |
| 79 | unsigned short msk; |
| 80 | unsigned short val; |
| 81 | } m88x_regCfg_t; |
| 82 | |
wdenk | ba91e26 | 2005-05-30 23:55:42 +0000 | [diff] [blame] | 83 | /* ************************************************************************** */ |
| 84 | /* *** PROTOTYPES *********************************************************** */ |
| 85 | |
| 86 | extern int m88e6060_initialize( int ); |
| 87 | |
wdenk | ba91e26 | 2005-05-30 23:55:42 +0000 | [diff] [blame] | 88 | #endif /* _INC_m88e6060_h_ */ |