mv88e61xx.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * (C) Copyright 2009
  3. * Marvell Semiconductor <www.marvell.com>
  4. * Prafulla Wadaskar <prafulla@marvell.com>
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of
  12. * the License, or (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  22. * MA 02110-1301 USA
  23. */
  24. #ifndef _MV88E61XX_H
  25. #define _MV88E61XX_H
  26. #include <miiphy.h>
  27. #define MV88E61XX_CPU_PORT 0x5
  28. #define MV88E61XX_MAX_PORTS_NUM 0x6
  29. #define MV88E61XX_PHY_TIMEOUT 100000
  30. #define MV88E61XX_PRT_STS_REG 0x1
  31. #define MV88E61XX_PRT_CTRL_REG 0x4
  32. #define MV88E61XX_PRT_VMAP_REG 0x6
  33. #define MV88E61XX_PRT_VID_REG 0x7
  34. #define MV88E61XX_PRT_OFST 0x10
  35. #define MV88E61XX_PHY_CMD 0x18
  36. #define MV88E61XX_PHY_DATA 0x19
  37. #define MV88E61XX_RGMII_TIMECTRL_REG 0x1A
  38. #define MV88E61XX_GLB2REG_DEVADR 0x1C
  39. #define MV88E61XX_BUSY_OFST 15
  40. #define MV88E61XX_MODE_OFST 12
  41. #define MV88E61XX_OP_OFST 10
  42. #define MV88E61XX_ADDR_OFST 5
  43. #ifdef CONFIG_MV88E61XX_MULTICHIP_ADRMODE
  44. static int mv88e61xx_busychk_multic(u32 devaddr);
  45. static void mv88e61xx_wr_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 data);
  46. static void mv88e61xx_rd_phy(char *name, u32 phy_adr, u32 reg_ofs, u16 * data);
  47. #define WR_PHY mv88e61xx_wr_phy
  48. #define RD_PHY mv88e61xx_rd_phy
  49. #else
  50. #define WR_PHY miiphy_write
  51. #define RD_PHY miiphy_read
  52. #endif /* CONFIG_MV88E61XX_MULTICHIP_ADRMODE */
  53. #endif /* _MV88E61XX_H */