mv643xx_eth.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 mv643xx_eth_platform_data {
  27. /*
  28. * Pointer back to our parent instance, and our port number.
  29. */
  30. struct platform_device *shared;
  31. int port_number;
  32. /*
  33. * Whether a PHY is present, and if yes, at which address.
  34. */
  35. int phy_addr;
  36. /*
  37. * Use this MAC address if it is valid, overriding the
  38. * address that is already in the hardware.
  39. */
  40. u8 mac_addr[6];
  41. /*
  42. * If speed is 0, autonegotiation is enabled.
  43. * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
  44. * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
  45. */
  46. int speed;
  47. int duplex;
  48. /*
  49. * How many RX/TX queues to use.
  50. */
  51. int rx_queue_count;
  52. int tx_queue_count;
  53. /*
  54. * Override default RX/TX queue sizes if nonzero.
  55. */
  56. int rx_queue_size;
  57. int tx_queue_size;
  58. /*
  59. * Use on-chip SRAM for RX/TX descriptors if size is nonzero
  60. * and sufficient to contain all descriptors for the requested
  61. * ring sizes.
  62. */
  63. unsigned long rx_sram_addr;
  64. int rx_sram_size;
  65. unsigned long tx_sram_addr;
  66. int tx_sram_size;
  67. };
  68. #endif