fs_enet_pd.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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 <asm/types.h>
  18. #define FS_ENET_NAME "fs_enet"
  19. enum fs_id {
  20. fsid_fec1,
  21. fsid_fec2,
  22. fsid_fcc1,
  23. fsid_fcc2,
  24. fsid_fcc3,
  25. fsid_scc1,
  26. fsid_scc2,
  27. fsid_scc3,
  28. fsid_scc4,
  29. };
  30. #define FS_MAX_INDEX 9
  31. static inline int fs_get_fec_index(enum fs_id id)
  32. {
  33. if (id >= fsid_fec1 && id <= fsid_fec2)
  34. return id - fsid_fec1;
  35. return -1;
  36. }
  37. static inline int fs_get_fcc_index(enum fs_id id)
  38. {
  39. if (id >= fsid_fcc1 && id <= fsid_fcc3)
  40. return id - fsid_fcc1;
  41. return -1;
  42. }
  43. static inline int fs_get_scc_index(enum fs_id id)
  44. {
  45. if (id >= fsid_scc1 && id <= fsid_scc4)
  46. return id - fsid_scc1;
  47. return -1;
  48. }
  49. enum fs_mii_method {
  50. fsmii_fixed,
  51. fsmii_fec,
  52. fsmii_bitbang,
  53. };
  54. enum fs_ioport {
  55. fsiop_porta,
  56. fsiop_portb,
  57. fsiop_portc,
  58. fsiop_portd,
  59. fsiop_porte,
  60. };
  61. struct fs_mii_bus_info {
  62. int method; /* mii method */
  63. int id; /* the id of the mii_bus */
  64. int disable_aneg; /* if the controller needs to negothiate speed & duplex */
  65. int lpa; /* the default board-specific vallues will be applied otherwise */
  66. union {
  67. struct {
  68. int duplex;
  69. int speed;
  70. } fixed;
  71. struct {
  72. /* nothing */
  73. } fec;
  74. struct {
  75. /* nothing */
  76. } scc;
  77. struct {
  78. int mdio_port; /* port & bit for MDIO */
  79. int mdio_bit;
  80. int mdc_port; /* port & bit for MDC */
  81. int mdc_bit;
  82. int delay; /* delay in us */
  83. } bitbang;
  84. } i;
  85. };
  86. struct fs_platform_info {
  87. void(*init_ioports)(void);
  88. /* device specific information */
  89. int fs_no; /* controller index */
  90. u32 cp_page; /* CPM page */
  91. u32 cp_block; /* CPM sblock */
  92. u32 clk_trx; /* some stuff for pins & mux configuration*/
  93. u32 clk_route;
  94. u32 clk_mask;
  95. u32 mem_offset;
  96. u32 dpram_offset;
  97. u32 fcc_regs_c;
  98. u32 device_flags;
  99. int phy_addr; /* the phy address (-1 no phy) */
  100. int phy_irq; /* the phy irq (if it exists) */
  101. const struct fs_mii_bus_info *bus_info;
  102. int rx_ring, tx_ring; /* number of buffers on rx */
  103. __u8 macaddr[6]; /* mac address */
  104. int rx_copybreak; /* limit we copy small frames */
  105. int use_napi; /* use NAPI */
  106. int napi_weight; /* NAPI weight */
  107. int use_rmii; /* use RMII mode */
  108. };
  109. #endif