ixp2400-msf.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * Generic library functions for the MSF (Media and Switch Fabric) unit
  3. * found on the Intel IXP2400 network processor.
  4. *
  5. * Copyright (C) 2004, 2005 Lennert Buytenhek <buytenh@wantstofly.org>
  6. * Dedicated to Marija Kulikova.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU Lesser General Public License as
  10. * published by the Free Software Foundation; either version 2.1 of the
  11. * License, or (at your option) any later version.
  12. */
  13. #ifndef __IXP2400_MSF_H
  14. #define __IXP2400_MSF_H
  15. struct ixp2400_msf_parameters
  16. {
  17. u32 rx_mode;
  18. unsigned rxclk01_multiplier:2;
  19. unsigned rxclk23_multiplier:2;
  20. unsigned rx_poll_ports:6;
  21. u32 rx_channel_mode[4];
  22. u32 tx_mode;
  23. unsigned txclk01_multiplier:2;
  24. unsigned txclk23_multiplier:2;
  25. unsigned tx_poll_ports:6;
  26. u32 tx_channel_mode[4];
  27. };
  28. void ixp2400_msf_init(struct ixp2400_msf_parameters *mp);
  29. #define IXP2400_PLL_MULTIPLIER_48 0x00
  30. #define IXP2400_PLL_MULTIPLIER_24 0x01
  31. #define IXP2400_PLL_MULTIPLIER_16 0x02
  32. #define IXP2400_PLL_MULTIPLIER_12 0x03
  33. #define IXP2400_RX_MODE_CSIX 0x00400000
  34. #define IXP2400_RX_MODE_UTOPIA_POS 0x00000000
  35. #define IXP2400_RX_MODE_WIDTH_MASK 0x00300000
  36. #define IXP2400_RX_MODE_1x16_2x8 0x00300000
  37. #define IXP2400_RX_MODE_4x8 0x00200000
  38. #define IXP2400_RX_MODE_2x16 0x00100000
  39. #define IXP2400_RX_MODE_1x32 0x00000000
  40. #define IXP2400_RX_MODE_MPHY 0x00080000
  41. #define IXP2400_RX_MODE_SPHY 0x00000000
  42. #define IXP2400_RX_MODE_MPHY_32 0x00040000
  43. #define IXP2400_RX_MODE_MPHY_4 0x00000000
  44. #define IXP2400_RX_MODE_MPHY_POLLED_STATUS 0x00020000
  45. #define IXP2400_RX_MODE_MPHY_DIRECT_STATUS 0x00000000
  46. #define IXP2400_RX_MODE_CBUS_FULL_DUPLEX 0x00010000
  47. #define IXP2400_RX_MODE_CBUS_SIMPLEX 0x00000000
  48. #define IXP2400_RX_MODE_MPHY_LEVEL2 0x00004000
  49. #define IXP2400_RX_MODE_MPHY_LEVEL3 0x00000000
  50. #define IXP2400_RX_MODE_CBUS_8BIT 0x00002000
  51. #define IXP2400_RX_MODE_CBUS_4BIT 0x00000000
  52. #define IXP2400_RX_MODE_CSIX_SINGLE_FREELIST 0x00000200
  53. #define IXP2400_RX_MODE_CSIX_SPLIT_FREELISTS 0x00000000
  54. #define IXP2400_RX_MODE_RBUF_SIZE_MASK 0x0000000c
  55. #define IXP2400_RX_MODE_RBUF_SIZE_256 0x00000008
  56. #define IXP2400_RX_MODE_RBUF_SIZE_128 0x00000004
  57. #define IXP2400_RX_MODE_RBUF_SIZE_64 0x00000000
  58. #define IXP2400_PORT_RX_MODE_SLAVE 0x00000040
  59. #define IXP2400_PORT_RX_MODE_MASTER 0x00000000
  60. #define IXP2400_PORT_RX_MODE_POS_PHY_L3 0x00000020
  61. #define IXP2400_PORT_RX_MODE_POS_PHY_L2 0x00000000
  62. #define IXP2400_PORT_RX_MODE_POS_PHY 0x00000010
  63. #define IXP2400_PORT_RX_MODE_UTOPIA 0x00000000
  64. #define IXP2400_PORT_RX_MODE_EVEN_PARITY 0x0000000c
  65. #define IXP2400_PORT_RX_MODE_ODD_PARITY 0x00000008
  66. #define IXP2400_PORT_RX_MODE_NO_PARITY 0x00000000
  67. #define IXP2400_PORT_RX_MODE_UTOPIA_BIG_CELLS 0x00000002
  68. #define IXP2400_PORT_RX_MODE_UTOPIA_NORMAL_CELLS 0x00000000
  69. #define IXP2400_PORT_RX_MODE_2_CYCLE_DECODE 0x00000001
  70. #define IXP2400_PORT_RX_MODE_1_CYCLE_DECODE 0x00000000
  71. #define IXP2400_TX_MODE_CSIX 0x00400000
  72. #define IXP2400_TX_MODE_UTOPIA_POS 0x00000000
  73. #define IXP2400_TX_MODE_WIDTH_MASK 0x00300000
  74. #define IXP2400_TX_MODE_1x16_2x8 0x00300000
  75. #define IXP2400_TX_MODE_4x8 0x00200000
  76. #define IXP2400_TX_MODE_2x16 0x00100000
  77. #define IXP2400_TX_MODE_1x32 0x00000000
  78. #define IXP2400_TX_MODE_MPHY 0x00080000
  79. #define IXP2400_TX_MODE_SPHY 0x00000000
  80. #define IXP2400_TX_MODE_MPHY_32 0x00040000
  81. #define IXP2400_TX_MODE_MPHY_4 0x00000000
  82. #define IXP2400_TX_MODE_MPHY_POLLED_STATUS 0x00020000
  83. #define IXP2400_TX_MODE_MPHY_DIRECT_STATUS 0x00000000
  84. #define IXP2400_TX_MODE_CBUS_FULL_DUPLEX 0x00010000
  85. #define IXP2400_TX_MODE_CBUS_SIMPLEX 0x00000000
  86. #define IXP2400_TX_MODE_MPHY_LEVEL2 0x00004000
  87. #define IXP2400_TX_MODE_MPHY_LEVEL3 0x00000000
  88. #define IXP2400_TX_MODE_CBUS_8BIT 0x00002000
  89. #define IXP2400_TX_MODE_CBUS_4BIT 0x00000000
  90. #define IXP2400_TX_MODE_TBUF_SIZE_MASK 0x0000000c
  91. #define IXP2400_TX_MODE_TBUF_SIZE_256 0x00000008
  92. #define IXP2400_TX_MODE_TBUF_SIZE_128 0x00000004
  93. #define IXP2400_TX_MODE_TBUF_SIZE_64 0x00000000
  94. #define IXP2400_PORT_TX_MODE_SLAVE 0x00000040
  95. #define IXP2400_PORT_TX_MODE_MASTER 0x00000000
  96. #define IXP2400_PORT_TX_MODE_POS_PHY 0x00000010
  97. #define IXP2400_PORT_TX_MODE_UTOPIA 0x00000000
  98. #define IXP2400_PORT_TX_MODE_EVEN_PARITY 0x0000000c
  99. #define IXP2400_PORT_TX_MODE_ODD_PARITY 0x00000008
  100. #define IXP2400_PORT_TX_MODE_NO_PARITY 0x00000000
  101. #define IXP2400_PORT_TX_MODE_UTOPIA_BIG_CELLS 0x00000002
  102. #define IXP2400_PORT_TX_MODE_2_CYCLE_DECODE 0x00000001
  103. #define IXP2400_PORT_TX_MODE_1_CYCLE_DECODE 0x00000000
  104. #endif