ibm_emac_rgmii.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Defines for the IBM RGMII bridge
  3. *
  4. * Based on ocp_zmii.h/ibm_emac_zmii.h
  5. * Armin Kuster akuster@mvista.com
  6. *
  7. * Copyright 2004 MontaVista Software, Inc.
  8. * Matt Porter <mporter@kernel.crashing.org>
  9. *
  10. * This program is free software; you can redistribute it and/or modify it
  11. * under the terms of the GNU General Public License as published by the
  12. * Free Software Foundation; either version 2 of the License, or (at your
  13. * option) any later version.
  14. */
  15. #ifndef _IBM_EMAC_RGMII_H_
  16. #define _IBM_EMAC_RGMII_H_
  17. #include <linux/config.h>
  18. /* RGMII bridge */
  19. typedef struct rgmii_regs {
  20. u32 fer; /* Function enable register */
  21. u32 ssr; /* Speed select register */
  22. } rgmii_t;
  23. #define RGMII_INPUTS 4
  24. /* RGMII device */
  25. struct ibm_ocp_rgmii {
  26. struct rgmii_regs *base;
  27. int mode[RGMII_INPUTS];
  28. int users; /* number of EMACs using this RGMII bridge */
  29. };
  30. /* Fuctional Enable Reg */
  31. #define RGMII_FER_MASK(x) (0x00000007 << (4*x))
  32. #define RGMII_RTBI 0x00000004
  33. #define RGMII_RGMII 0x00000005
  34. #define RGMII_TBI 0x00000006
  35. #define RGMII_GMII 0x00000007
  36. /* Speed Selection reg */
  37. #define RGMII_SP2_100 0x00000002
  38. #define RGMII_SP2_1000 0x00000004
  39. #define RGMII_SP3_100 0x00000200
  40. #define RGMII_SP3_1000 0x00000400
  41. #define RGMII_MII2_SPDMASK 0x00000007
  42. #define RGMII_MII3_SPDMASK 0x00000700
  43. #define RGMII_MII2_100MB RGMII_SP2_100 & ~RGMII_SP2_1000
  44. #define RGMII_MII2_1000MB RGMII_SP2_1000 & ~RGMII_SP2_100
  45. #define RGMII_MII2_10MB ~(RGMII_SP2_100 | RGMII_SP2_1000)
  46. #define RGMII_MII3_100MB RGMII_SP3_100 & ~RGMII_SP3_1000
  47. #define RGMII_MII3_1000MB RGMII_SP3_1000 & ~RGMII_SP3_100
  48. #define RGMII_MII3_10MB ~(RGMII_SP3_100 | RGMII_SP3_1000)
  49. #define RTBI 0
  50. #define RGMII 1
  51. #define TBI 2
  52. #define GMII 3
  53. #endif /* _IBM_EMAC_RGMII_H_ */