blob: 61a0da38d0cbc163e88b46e0b0fdf0fb50c62934 [file] [log] [blame]
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +02001/*
2 * MV-643XX ethernet platform device data definition file.
3 */
Lennert Buytenhekfa3959f2008-04-24 01:27:02 +02004
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +02005#ifndef __LINUX_MV643XX_ETH_H
6#define __LINUX_MV643XX_ETH_H
7
Lennert Buytenhekf2ce8252008-04-24 01:27:17 +02008#include <linux/mbus.h>
Joe Perches574e2af2013-08-01 16:17:48 -07009#include <linux/if_ether.h>
Lennert Buytenhekf2ce8252008-04-24 01:27:17 +020010
Lennert Buytenhek240e44192008-04-24 01:27:44 +020011#define MV643XX_ETH_SHARED_NAME "mv643xx_eth"
12#define MV643XX_ETH_NAME "mv643xx_eth_port"
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +020013#define MV643XX_ETH_SHARED_REGS 0x2000
14#define MV643XX_ETH_SHARED_REGS_SIZE 0x2000
Dale Farnsworth3077d782007-10-29 15:39:01 -070015#define MV643XX_ETH_BAR_4 0x2220
16#define MV643XX_ETH_SIZE_REG_4 0x2224
17#define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +020018
Arnaud Patard (Rtp)58569ae2012-07-26 12:15:46 +020019#define MV643XX_TX_CSUM_DEFAULT_LIMIT 0
20
Lennert Buytenhekf2ce8252008-04-24 01:27:17 +020021struct mv643xx_eth_shared_platform_data {
22 struct mbus_dram_target_info *dram;
Saeed Bishara9b2c2ff2010-06-27 00:26:43 +000023 /*
24 * Max packet size for Tx IP/Layer 4 checksum, when set to 0, default
25 * limit of 9KiB will be used.
26 */
27 int tx_csum_limit;
Lennert Buytenhekf2ce8252008-04-24 01:27:17 +020028};
29
Lennert Buytenhekac8406052008-08-26 14:06:47 +020030#define MV643XX_ETH_PHY_ADDR_DEFAULT 0
31#define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x))
32#define MV643XX_ETH_PHY_NONE 0xff
33
Sebastian Hesselbarth5f292352013-05-29 09:32:45 +000034struct device_node;
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +020035struct mv643xx_eth_platform_data {
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020036 /*
37 * Pointer back to our parent instance, and our port number.
38 */
Lennert Buytenhekfa3959f2008-04-24 01:27:02 +020039 struct platform_device *shared;
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020040 int port_number;
Lennert Buytenhekfa3959f2008-04-24 01:27:02 +020041
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020042 /*
43 * Whether a PHY is present, and if yes, at which address.
44 */
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020045 int phy_addr;
Sebastian Hesselbarth5f292352013-05-29 09:32:45 +000046 struct device_node *phy_node;
Lennert Buytenhekce4e2e42008-04-24 01:29:59 +020047
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020048 /*
49 * Use this MAC address if it is valid, overriding the
50 * address that is already in the hardware.
51 */
Joe Perches574e2af2013-08-01 16:17:48 -070052 u8 mac_addr[ETH_ALEN];
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +020053
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020054 /*
55 * If speed is 0, autonegotiation is enabled.
56 * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
57 * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
58 */
59 int speed;
60 int duplex;
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +020061
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020062 /*
Lennert Buytenhekf7981c12008-08-26 10:23:22 +020063 * How many RX/TX queues to use.
Lennert Buytenhek64da80a2008-06-02 01:01:26 +020064 */
Lennert Buytenhekf7981c12008-08-26 10:23:22 +020065 int rx_queue_count;
66 int tx_queue_count;
Lennert Buytenhek64da80a2008-06-02 01:01:26 +020067
68 /*
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020069 * Override default RX/TX queue sizes if nonzero.
70 */
71 int rx_queue_size;
72 int tx_queue_size;
73
74 /*
75 * Use on-chip SRAM for RX/TX descriptors if size is nonzero
76 * and sufficient to contain all descriptors for the requested
77 * ring sizes.
78 */
79 unsigned long rx_sram_addr;
80 int rx_sram_size;
81 unsigned long tx_sram_addr;
82 int tx_sram_size;
Lennert Buytenhekc4a6a2a2007-10-19 04:09:53 +020083};
84
Lennert Buytenhekfc32b0e2008-06-02 00:28:40 +020085
86#endif