mv88e6352.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * (C) Copyright 2012
  3. * Valentin Lontgchamp, Keymile AG, valentin.longchamp@keymile.com
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  21. * MA 02110-1301 USA
  22. */
  23. #ifndef __MV886352_H
  24. #define __MV886352_H
  25. #include <common.h>
  26. /* PHY registers */
  27. #define PHY(itf) (itf)
  28. #define PHY_CTRL 0x00
  29. #define PHY_100_MBPS 0x2000
  30. #define PHY_1_GBPS 0x0040
  31. #define AUTONEG_EN 0x1000
  32. #define AUTONEG_RST 0x0200
  33. #define FULL_DUPLEX 0x0100
  34. #define PHY_PWR_DOWN 0x0800
  35. #define PHY_STATUS 0x01
  36. #define AN1000FIX 0x0001
  37. #define PHY_SPEC_CTRL 0x10
  38. #define SPEC_PWR_DOWN 0x0004
  39. #define AUTO_MDIX_EN 0x0060
  40. #define PHY_1000_CTRL 0x9
  41. #define NO_ADV 0x0000
  42. #define ADV_1000_FDPX 0x0200
  43. #define ADV_1000_HDPX 0x0100
  44. #define PHY_PAGE 0x16
  45. #define AN1000FIX_PAGE 0x00fc
  46. /* PORT or MAC registers */
  47. #define PORT(itf) (itf+0x10)
  48. #define PORT_STATUS 0x00
  49. #define NO_PHY_DETECT 0x0000
  50. #define PORT_PHY 0x01
  51. #define RX_RGMII_TIM 0x8000
  52. #define TX_RGMII_TIM 0x4000
  53. #define FLOW_CTRL_EN 0x0080
  54. #define FLOW_CTRL_FOR 0x0040
  55. #define LINK_VAL 0x0020
  56. #define LINK_FOR 0x0010
  57. #define FULL_DPX 0x0008
  58. #define FULL_DPX_FOR 0x0004
  59. #define NO_SPEED_FOR 0x0003
  60. #define SPEED_1000_FOR 0x0002
  61. #define SPEED_100_FOR 0x0001
  62. #define SPEED_10_FOR 0x0000
  63. #define PORT_CTRL 0x04
  64. #define FORWARDING 0x0003
  65. #define EGRS_FLD_ALL 0x000c
  66. #define PORT_DIS 0x0000
  67. struct mv88e_sw_reg {
  68. u8 port;
  69. u8 reg;
  70. u16 value;
  71. };
  72. int mv88e_sw_reset(const char *devname, u8 phy_addr);
  73. int mv88e_sw_program(const char *devname, u8 phy_addr,
  74. struct mv88e_sw_reg *regs, int regs_nb);
  75. #endif