xgene_enet_xgmac.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* Applied Micro X-Gene SoC Ethernet Driver
  2. *
  3. * Copyright (c) 2014, Applied Micro Circuits Corporation
  4. * Authors: Iyappan Subramanian <isubramanian@apm.com>
  5. * Keyur Chudgar <kchudgar@apm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef __XGENE_ENET_XGMAC_H__
  21. #define __XGENE_ENET_XGMAC_H__
  22. #define X2_BLOCK_ETH_MAC_CSR_OFFSET 0x3000
  23. #define BLOCK_AXG_MAC_OFFSET 0x0800
  24. #define BLOCK_AXG_MAC_CSR_OFFSET 0x2000
  25. #define BLOCK_PCS_OFFSET 0x3800
  26. #define XGENET_CONFIG_REG_ADDR 0x20
  27. #define XGENET_SRST_ADDR 0x00
  28. #define XGENET_CLKEN_ADDR 0x08
  29. #define CSR_CLK BIT(0)
  30. #define XGENET_CLK BIT(1)
  31. #define PCS_CLK BIT(3)
  32. #define AN_REF_CLK BIT(4)
  33. #define AN_CLK BIT(5)
  34. #define AD_CLK BIT(6)
  35. #define CSR_RST BIT(0)
  36. #define XGENET_RST BIT(1)
  37. #define PCS_RST BIT(3)
  38. #define AN_REF_RST BIT(4)
  39. #define AN_RST BIT(5)
  40. #define AD_RST BIT(6)
  41. #define AXGMAC_CONFIG_0 0x0000
  42. #define AXGMAC_CONFIG_1 0x0004
  43. #define HSTMACRST BIT(31)
  44. #define HSTTCTLEN BIT(31)
  45. #define HSTTFEN BIT(30)
  46. #define HSTRCTLEN BIT(29)
  47. #define HSTRFEN BIT(28)
  48. #define HSTPPEN BIT(7)
  49. #define HSTDRPLT64 BIT(5)
  50. #define HSTLENCHK BIT(3)
  51. #define HSTMACADR_LSW_ADDR 0x0010
  52. #define HSTMACADR_MSW_ADDR 0x0014
  53. #define HSTMAXFRAME_LENGTH_ADDR 0x0020
  54. #define XG_MCX_RX_DV_GATE_REG_0_ADDR 0x0004
  55. #define XG_MCX_ECM_CFG_0_ADDR 0x0074
  56. #define XG_MCX_MULTI_DPF0_ADDR 0x007c
  57. #define XG_MCX_MULTI_DPF1_ADDR 0x0080
  58. #define XG_DEF_PAUSE_THRES 0x390
  59. #define XG_DEF_PAUSE_OFF_THRES 0x2c0
  60. #define XG_RSIF_CONFIG_REG_ADDR 0x00a0
  61. #define XG_RSIF_CLE_BUFF_THRESH 0x3
  62. #define RSIF_CLE_BUFF_THRESH_SET(dst, val) xgene_set_bits(dst, val, 0, 3)
  63. #define XG_RSIF_CONFIG1_REG_ADDR 0x00b8
  64. #define XG_RSIF_PLC_CLE_BUFF_THRESH 0x1
  65. #define RSIF_PLC_CLE_BUFF_THRESH_SET(dst, val) xgene_set_bits(dst, val, 0, 2)
  66. #define XCLE_BYPASS_REG0_ADDR 0x0160
  67. #define XCLE_BYPASS_REG1_ADDR 0x0164
  68. #define XG_CFG_BYPASS_ADDR 0x0204
  69. #define XG_CFG_LINK_AGGR_RESUME_0_ADDR 0x0214
  70. #define XG_LINK_STATUS_ADDR 0x0228
  71. #define XG_TSIF_MSS_REG0_ADDR 0x02a4
  72. #define XG_DEBUG_REG_ADDR 0x0400
  73. #define XG_ENET_SPARE_CFG_REG_ADDR 0x040c
  74. #define XG_ENET_SPARE_CFG_REG_1_ADDR 0x0410
  75. #define XGENET_RX_DV_GATE_REG_0_ADDR 0x0804
  76. #define XGENET_CSR_ECM_CFG_0_ADDR 0x0880
  77. #define XGENET_CSR_MULTI_DPF0_ADDR 0x0888
  78. #define XGENET_CSR_MULTI_DPF1_ADDR 0x088c
  79. #define XG_RXBUF_PAUSE_THRESH 0x0020
  80. #define XG_MCX_ICM_CONFIG0_REG_0_ADDR 0x00e0
  81. #define XG_MCX_ICM_CONFIG2_REG_0_ADDR 0x00e8
  82. #define PCS_CONTROL_1 0x0000
  83. #define PCS_CTRL_PCS_RST BIT(15)
  84. extern const struct xgene_mac_ops xgene_xgmac_ops;
  85. extern const struct xgene_port_ops xgene_xgport_ops;
  86. #endif /* __XGENE_ENET_XGMAC_H__ */