emac_defs.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  3. *
  4. * Based on:
  5. *
  6. * ----------------------------------------------------------------------------
  7. *
  8. * dm644x_emac.h
  9. *
  10. * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
  11. *
  12. * Copyright (C) 2005 Texas Instruments.
  13. *
  14. * ----------------------------------------------------------------------------
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License as published by
  18. * the Free Software Foundation; either version 2 of the License, or
  19. * (at your option) any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this program; if not, write to the Free Software
  28. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29. * ----------------------------------------------------------------------------
  30. * Modifications:
  31. * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
  32. *
  33. */
  34. #ifndef _DM644X_EMAC_H_
  35. #define _DM644X_EMAC_H_
  36. #include <asm/arch/hardware.h>
  37. #ifdef CONFIG_SOC_DM365
  38. #define EMAC_BASE_ADDR (0x01d07000)
  39. #define EMAC_WRAPPER_BASE_ADDR (0x01d0a000)
  40. #define EMAC_WRAPPER_RAM_ADDR (0x01d08000)
  41. #define EMAC_MDIO_BASE_ADDR (0x01d0b000)
  42. #define DAVINCI_EMAC_VERSION2
  43. #elif defined(CONFIG_SOC_DA8XX)
  44. #define EMAC_BASE_ADDR DAVINCI_EMAC_CNTRL_REGS_BASE
  45. #define EMAC_WRAPPER_BASE_ADDR DAVINCI_EMAC_WRAPPER_CNTRL_REGS_BASE
  46. #define EMAC_WRAPPER_RAM_ADDR DAVINCI_EMAC_WRAPPER_RAM_BASE
  47. #define EMAC_MDIO_BASE_ADDR DAVINCI_MDIO_CNTRL_REGS_BASE
  48. #define DAVINCI_EMAC_VERSION2
  49. #else
  50. #define EMAC_BASE_ADDR (0x01c80000)
  51. #define EMAC_WRAPPER_BASE_ADDR (0x01c81000)
  52. #define EMAC_WRAPPER_RAM_ADDR (0x01c82000)
  53. #define EMAC_MDIO_BASE_ADDR (0x01c84000)
  54. #endif
  55. #ifdef CONFIG_SOC_DM646X
  56. #define DAVINCI_EMAC_VERSION2
  57. #define DAVINCI_EMAC_GIG_ENABLE
  58. #endif
  59. #ifdef CONFIG_SOC_DM646X
  60. /* MDIO module input frequency */
  61. #define EMAC_MDIO_BUS_FREQ 76500000
  62. /* MDIO clock output frequency */
  63. #define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */
  64. #elif defined(CONFIG_SOC_DM365)
  65. /* MDIO module input frequency */
  66. #define EMAC_MDIO_BUS_FREQ 121500000
  67. /* MDIO clock output frequency */
  68. #define EMAC_MDIO_CLOCK_FREQ 2200000 /* 2.2 MHz */
  69. #elif defined(CONFIG_SOC_DA8XX)
  70. /* MDIO module input frequency */
  71. #define EMAC_MDIO_BUS_FREQ clk_get(DAVINCI_MDIO_CLKID)
  72. /* MDIO clock output frequency */
  73. #define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
  74. #else
  75. /* MDIO module input frequency */
  76. #define EMAC_MDIO_BUS_FREQ 99000000 /* PLL/6 - 99 MHz */
  77. /* MDIO clock output frequency */
  78. #define EMAC_MDIO_CLOCK_FREQ 2000000 /* 2.0 MHz */
  79. #endif
  80. #define PHY_KSZ8873 (0x00221450)
  81. int ksz8873_is_phy_connected(int phy_addr);
  82. int ksz8873_get_link_speed(int phy_addr);
  83. int ksz8873_init_phy(int phy_addr);
  84. int ksz8873_auto_negotiate(int phy_addr);
  85. #define PHY_LXT972 (0x001378e2)
  86. int lxt972_is_phy_connected(int phy_addr);
  87. int lxt972_get_link_speed(int phy_addr);
  88. int lxt972_init_phy(int phy_addr);
  89. int lxt972_auto_negotiate(int phy_addr);
  90. #define PHY_DP83848 (0x20005c90)
  91. int dp83848_is_phy_connected(int phy_addr);
  92. int dp83848_get_link_speed(int phy_addr);
  93. int dp83848_init_phy(int phy_addr);
  94. int dp83848_auto_negotiate(int phy_addr);
  95. #define PHY_ET1011C (0x282f013)
  96. int et1011c_get_link_speed(int phy_addr);
  97. #endif /* _DM644X_EMAC_H_ */