m88e6060.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #ifndef _INC_m88e6060_h_
  25. #define _INC_m88e6060_h_
  26. /* ************************************************************************** */
  27. /* *** DEFINES ************************************************************** */
  28. /* switch hw */
  29. #define M88X_PRT_CNT 6
  30. #define M88X_PHY_CNT 5
  31. /* phy register offsets */
  32. #define M88X_PHY_CNTL 0x00
  33. #define M88X_PHY_STAT 0x00
  34. #define M88X_PHY_ID0 0x02
  35. #define M88X_PHY_ID1 0x03
  36. #define M88X_PHY_ANEG_ADV 0x04
  37. #define M88X_PHY_LPA 0x05
  38. #define M88X_PHY_ANEG_EXP 0x06
  39. #define M88X_PHY_NPT 0x07
  40. #define M88X_PHY_LPNP 0x08
  41. /* port register offsets */
  42. #define M88X_PRT_STAT 0x00
  43. #define M88X_PRT_ID 0x03
  44. #define M88X_PRT_CNTL 0x04
  45. #define M88X_PRT_VLAN 0x06
  46. #define M88X_PRT_PAV 0x0b
  47. #define M88X_PRT_RX 0x10
  48. #define M88X_PRT_TX 0x11
  49. /* global/atu register offsets */
  50. #define M88X_GLB_STAT 0x00
  51. #define M88X_GLB_MAC01 0x01
  52. #define M88X_GLB_MAC23 0x02
  53. #define M88X_GLB_MAC45 0x03
  54. #define M88X_GLB_CNTL 0x04
  55. #define M88X_ATU_CNTL 0x0a
  56. #define M88X_ATU_OP 0x0b
  57. /* id0 register - 0x02 */
  58. #define M88X_PHY_ID0_VALUE 0x0141
  59. /* id1 register - 0x03 */
  60. #define M88X_PHY_ID1_VALUE 0x0c80 /* without revision ! */
  61. /* misc */
  62. #define M88E6060_ID ((M88X_PHY_ID0_VALUE<<16) | M88X_PHY_ID1_VALUE)
  63. /* ************************************************************************** */
  64. /* *** TYPEDEFS ************************************************************* */
  65. typedef struct {
  66. int reg;
  67. unsigned short msk;
  68. unsigned short val;
  69. } m88x_regCfg_t;
  70. /* ************************************************************************** */
  71. /* *** PROTOTYPES *********************************************************** */
  72. extern int m88e6060_initialize( int );
  73. #endif /* _INC_m88e6060_h_ */