mv643xx_eth.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * MV-643XX ethernet platform device data definition file.
  3. */
  4. #ifndef __LINUX_MV643XX_ETH_H
  5. #define __LINUX_MV643XX_ETH_H
  6. #include <linux/mbus.h>
  7. #define MV643XX_ETH_SHARED_NAME "mv643xx_eth"
  8. #define MV643XX_ETH_NAME "mv643xx_eth_port"
  9. #define MV643XX_ETH_SHARED_REGS 0x2000
  10. #define MV643XX_ETH_SHARED_REGS_SIZE 0x2000
  11. #define MV643XX_ETH_BAR_4 0x2220
  12. #define MV643XX_ETH_SIZE_REG_4 0x2224
  13. #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290
  14. #define MV643XX_TX_CSUM_DEFAULT_LIMIT 0
  15. struct mv643xx_eth_shared_platform_data {
  16. struct mbus_dram_target_info *dram;
  17. /*
  18. * Max packet size for Tx IP/Layer 4 checksum, when set to 0, default
  19. * limit of 9KiB will be used.
  20. */
  21. int tx_csum_limit;
  22. };
  23. #define MV643XX_ETH_PHY_ADDR_DEFAULT 0
  24. #define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x))
  25. #define MV643XX_ETH_PHY_NONE 0xff
  26. struct device_node;
  27. struct mv643xx_eth_platform_data {
  28. /*
  29. * Pointer back to our parent instance, and our port number.
  30. */
  31. struct platform_device *shared;
  32. int port_number;
  33. /*
  34. * Whether a PHY is present, and if yes, at which address.
  35. */
  36. int phy_addr;
  37. struct device_node *phy_node;
  38. /*
  39. * Use this MAC address if it is valid, overriding the
  40. * address that is already in the hardware.
  41. */
  42. u8 mac_addr[6];
  43. /*
  44. * If speed is 0, autonegotiation is enabled.
  45. * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
  46. * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
  47. */
  48. int speed;
  49. int duplex;
  50. /*
  51. * How many RX/TX queues to use.
  52. */
  53. int rx_queue_count;
  54. int tx_queue_count;
  55. /*
  56. * Override default RX/TX queue sizes if nonzero.
  57. */
  58. int rx_queue_size;
  59. int tx_queue_size;
  60. /*
  61. * Use on-chip SRAM for RX/TX descriptors if size is nonzero
  62. * and sufficient to contain all descriptors for the requested
  63. * ring sizes.
  64. */
  65. unsigned long rx_sram_addr;
  66. int rx_sram_size;
  67. unsigned long tx_sram_addr;
  68. int tx_sram_size;
  69. };
  70. #endif