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. #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. struct platform_device *shared_smi;
  18. unsigned int t_clk;
  19. /*
  20. * Max packet size for Tx IP/Layer 4 checksum, when set to 0, default
  21. * limit of 9KiB will be used.
  22. */
  23. int tx_csum_limit;
  24. };
  25. #define MV643XX_ETH_PHY_ADDR_DEFAULT 0
  26. #define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x))
  27. #define MV643XX_ETH_PHY_NONE 0xff
  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. /*
  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