ibm_emac_zmii.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * ocp_zmii.h
  3. *
  4. * Defines for the IBM ZMII bridge
  5. *
  6. * Armin Kuster akuster@mvista.com
  7. * Dec, 2001
  8. *
  9. * Copyright 2001 MontaVista Softare Inc.
  10. *
  11. * This program is free software; you can redistribute it and/or modify it
  12. * under the terms of the GNU General Public License as published by the
  13. * Free Software Foundation; either version 2 of the License, or (at your
  14. * option) any later version.
  15. */
  16. #ifndef _IBM_EMAC_ZMII_H_
  17. #define _IBM_EMAC_ZMII_H_
  18. #include <linux/config.h>
  19. /* ZMII bridge registers */
  20. struct zmii_regs {
  21. u32 fer; /* Function enable reg */
  22. u32 ssr; /* Speed select reg */
  23. u32 smiirs; /* SMII status reg */
  24. };
  25. #define ZMII_INPUTS 4
  26. /* ZMII device */
  27. struct ibm_ocp_zmii {
  28. struct zmii_regs *base;
  29. int mode[ZMII_INPUTS];
  30. int users; /* number of EMACs using this ZMII bridge */
  31. };
  32. /* Fuctional Enable Reg */
  33. #define ZMII_FER_MASK(x) (0xf0000000 >> (4*x))
  34. #define ZMII_MDI0 0x80000000
  35. #define ZMII_SMII0 0x40000000
  36. #define ZMII_RMII0 0x20000000
  37. #define ZMII_MII0 0x10000000
  38. #define ZMII_MDI1 0x08000000
  39. #define ZMII_SMII1 0x04000000
  40. #define ZMII_RMII1 0x02000000
  41. #define ZMII_MII1 0x01000000
  42. #define ZMII_MDI2 0x00800000
  43. #define ZMII_SMII2 0x00400000
  44. #define ZMII_RMII2 0x00200000
  45. #define ZMII_MII2 0x00100000
  46. #define ZMII_MDI3 0x00080000
  47. #define ZMII_SMII3 0x00040000
  48. #define ZMII_RMII3 0x00020000
  49. #define ZMII_MII3 0x00010000
  50. /* Speed Selection reg */
  51. #define ZMII_SCI0 0x40000000
  52. #define ZMII_FSS0 0x20000000
  53. #define ZMII_SP0 0x10000000
  54. #define ZMII_SCI1 0x04000000
  55. #define ZMII_FSS1 0x02000000
  56. #define ZMII_SP1 0x01000000
  57. #define ZMII_SCI2 0x00400000
  58. #define ZMII_FSS2 0x00200000
  59. #define ZMII_SP2 0x00100000
  60. #define ZMII_SCI3 0x00040000
  61. #define ZMII_FSS3 0x00020000
  62. #define ZMII_SP3 0x00010000
  63. #define ZMII_MII0_100MB ZMII_SP0
  64. #define ZMII_MII0_10MB ~ZMII_SP0
  65. #define ZMII_MII1_100MB ZMII_SP1
  66. #define ZMII_MII1_10MB ~ZMII_SP1
  67. #define ZMII_MII2_100MB ZMII_SP2
  68. #define ZMII_MII2_10MB ~ZMII_SP2
  69. #define ZMII_MII3_100MB ZMII_SP3
  70. #define ZMII_MII3_10MB ~ZMII_SP3
  71. /* SMII Status reg */
  72. #define ZMII_STS0 0xFF000000 /* EMAC0 smii status mask */
  73. #define ZMII_STS1 0x00FF0000 /* EMAC1 smii status mask */
  74. #define SMII 0
  75. #define RMII 1
  76. #define MII 2
  77. #define MDI 3
  78. #endif /* _IBM_EMAC_ZMII_H_ */