fs_enet_pd.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * Platform information definitions for the
  3. * universal Freescale Ethernet driver.
  4. *
  5. * Copyright (c) 2003 Intracom S.A.
  6. * by Pantelis Antoniou <panto@intracom.gr>
  7. *
  8. * 2005 (c) MontaVista Software, Inc.
  9. * Vitaly Bordug <vbordug@ru.mvista.com>
  10. *
  11. * This file is licensed under the terms of the GNU General Public License
  12. * version 2. This program is licensed "as is" without any warranty of any
  13. * kind, whether express or implied.
  14. */
  15. #ifndef FS_ENET_PD_H
  16. #define FS_ENET_PD_H
  17. #include <linux/version.h>
  18. #include <asm/types.h>
  19. #define FS_ENET_NAME "fs_enet"
  20. enum fs_id {
  21. fsid_fec1,
  22. fsid_fec2,
  23. fsid_fcc1,
  24. fsid_fcc2,
  25. fsid_fcc3,
  26. fsid_scc1,
  27. fsid_scc2,
  28. fsid_scc3,
  29. fsid_scc4,
  30. };
  31. #define FS_MAX_INDEX 9
  32. static inline int fs_get_fec_index(enum fs_id id)
  33. {
  34. if (id >= fsid_fec1 && id <= fsid_fec2)
  35. return id - fsid_fec1;
  36. return -1;
  37. }
  38. static inline int fs_get_fcc_index(enum fs_id id)
  39. {
  40. if (id >= fsid_fcc1 && id <= fsid_fcc3)
  41. return id - fsid_fcc1;
  42. return -1;
  43. }
  44. static inline int fs_get_scc_index(enum fs_id id)
  45. {
  46. if (id >= fsid_scc1 && id <= fsid_scc4)
  47. return id - fsid_scc1;
  48. return -1;
  49. }
  50. enum fs_mii_method {
  51. fsmii_fixed,
  52. fsmii_fec,
  53. fsmii_bitbang,
  54. };
  55. enum fs_ioport {
  56. fsiop_porta,
  57. fsiop_portb,
  58. fsiop_portc,
  59. fsiop_portd,
  60. fsiop_porte,
  61. };
  62. struct fs_mii_bus_info {
  63. int method; /* mii method */
  64. int id; /* the id of the mii_bus */
  65. int disable_aneg; /* if the controller needs to negothiate speed & duplex */
  66. int lpa; /* the default board-specific vallues will be applied otherwise */
  67. union {
  68. struct {
  69. int duplex;
  70. int speed;
  71. } fixed;
  72. struct {
  73. /* nothing */
  74. } fec;
  75. struct {
  76. /* nothing */
  77. } scc;
  78. struct {
  79. int mdio_port; /* port & bit for MDIO */
  80. int mdio_bit;
  81. int mdc_port; /* port & bit for MDC */
  82. int mdc_bit;
  83. int delay; /* delay in us */
  84. } bitbang;
  85. } i;
  86. };
  87. struct fs_platform_info {
  88. void(*init_ioports)(void);
  89. /* device specific information */
  90. int fs_no; /* controller index */
  91. u32 cp_page; /* CPM page */
  92. u32 cp_block; /* CPM sblock */
  93. u32 clk_trx; /* some stuff for pins & mux configuration*/
  94. u32 clk_route;
  95. u32 clk_mask;
  96. u32 mem_offset;
  97. u32 dpram_offset;
  98. u32 fcc_regs_c;
  99. u32 device_flags;
  100. int phy_addr; /* the phy address (-1 no phy) */
  101. int phy_irq; /* the phy irq (if it exists) */
  102. const struct fs_mii_bus_info *bus_info;
  103. int rx_ring, tx_ring; /* number of buffers on rx */
  104. __u8 macaddr[6]; /* mac address */
  105. int rx_copybreak; /* limit we copy small frames */
  106. int use_napi; /* use NAPI */
  107. int napi_weight; /* NAPI weight */
  108. int use_rmii; /* use RMII mode */
  109. };
  110. #endif