mv643xx_eth.h 2.0 KB

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