mv643xx_eth.h 1.9 KB

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