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. struct mv643xx_eth_shared_platform_data {
  15. struct mbus_dram_target_info *dram;
  16. struct platform_device *shared_smi;
  17. unsigned int t_clk;
  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 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. /*
  38. * Use this MAC address if it is valid, overriding the
  39. * address that is already in the hardware.
  40. */
  41. u8 mac_addr[6];
  42. /*
  43. * If speed is 0, autonegotiation is enabled.
  44. * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
  45. * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
  46. */
  47. int speed;
  48. int duplex;
  49. /*
  50. * How many RX/TX queues to use.
  51. */
  52. int rx_queue_count;
  53. int tx_queue_count;
  54. /*
  55. * Override default RX/TX queue sizes if nonzero.
  56. */
  57. int rx_queue_size;
  58. int tx_queue_size;
  59. /*
  60. * Use on-chip SRAM for RX/TX descriptors if size is nonzero
  61. * and sufficient to contain all descriptors for the requested
  62. * ring sizes.
  63. */
  64. unsigned long rx_sram_addr;
  65. int rx_sram_size;
  66. unsigned long tx_sram_addr;
  67. int tx_sram_size;
  68. };
  69. #endif