cpsw.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * CPSW Ethernet Switch Driver
  3. *
  4. * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation version 2.
  9. *
  10. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  11. * kind, whether express or implied; without even the implied warranty
  12. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #ifndef _CPSW_H_
  16. #define _CPSW_H_
  17. struct cpsw_slave_data {
  18. u32 slave_reg_ofs;
  19. u32 sliver_reg_ofs;
  20. int phy_addr;
  21. int phy_if;
  22. };
  23. enum {
  24. CPSW_CTRL_VERSION_1 = 0,
  25. CPSW_CTRL_VERSION_2 /* am33xx like devices */
  26. };
  27. struct cpsw_platform_data {
  28. u32 mdio_base;
  29. u32 cpsw_base;
  30. int mdio_div;
  31. int channels; /* number of cpdma channels (symmetric) */
  32. u32 cpdma_reg_ofs; /* cpdma register offset */
  33. int slaves; /* number of slave cpgmac ports */
  34. u32 ale_reg_ofs; /* address lookup engine reg offset */
  35. int ale_entries; /* ale table size */
  36. u32 host_port_reg_ofs; /* cpdma host port registers */
  37. u32 hw_stats_reg_ofs; /* cpsw hw stats counters */
  38. u32 bd_ram_ofs; /* Buffer Descriptor RAM offset */
  39. u32 mac_control;
  40. struct cpsw_slave_data *slave_data;
  41. void (*control)(int enabled);
  42. u32 host_port_num;
  43. u8 version;
  44. };
  45. int cpsw_register(struct cpsw_platform_data *data);
  46. #endif /* _CPSW_H_ */