Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * MV-643XX ethernet platform device data definition file.
0004  */
0005 
0006 #ifndef __LINUX_MV643XX_ETH_H
0007 #define __LINUX_MV643XX_ETH_H
0008 
0009 #include <linux/mbus.h>
0010 #include <linux/if_ether.h>
0011 
0012 #define MV643XX_ETH_SHARED_NAME     "mv643xx_eth"
0013 #define MV643XX_ETH_NAME        "mv643xx_eth_port"
0014 #define MV643XX_ETH_SHARED_REGS     0x2000
0015 #define MV643XX_ETH_SHARED_REGS_SIZE    0x2000
0016 #define MV643XX_ETH_BAR_4       0x2220
0017 #define MV643XX_ETH_SIZE_REG_4      0x2224
0018 #define MV643XX_ETH_BASE_ADDR_ENABLE_REG    0x2290
0019 
0020 #define MV643XX_TX_CSUM_DEFAULT_LIMIT   0
0021 
0022 struct mv643xx_eth_shared_platform_data {
0023     struct mbus_dram_target_info    *dram;
0024     /*
0025      * Max packet size for Tx IP/Layer 4 checksum, when set to 0, default
0026      * limit of 9KiB will be used.
0027      */
0028     int         tx_csum_limit;
0029 };
0030 
0031 #define MV643XX_ETH_PHY_ADDR_DEFAULT    0
0032 #define MV643XX_ETH_PHY_ADDR(x)     (0x80 | (x))
0033 #define MV643XX_ETH_PHY_NONE        0xff
0034 
0035 struct device_node;
0036 struct mv643xx_eth_platform_data {
0037     /*
0038      * Pointer back to our parent instance, and our port number.
0039      */
0040     struct platform_device  *shared;
0041     int         port_number;
0042 
0043     /*
0044      * Whether a PHY is present, and if yes, at which address.
0045      */
0046     int         phy_addr;
0047     struct device_node  *phy_node;
0048 
0049     /*
0050      * Use this MAC address if it is valid, overriding the
0051      * address that is already in the hardware.
0052      */
0053     u8          mac_addr[ETH_ALEN];
0054 
0055     /*
0056      * If speed is 0, autonegotiation is enabled.
0057      *   Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
0058      *   Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
0059      */
0060     int         speed;
0061     int         duplex;
0062 
0063     /*
0064      * How many RX/TX queues to use.
0065      */
0066     int         rx_queue_count;
0067     int         tx_queue_count;
0068 
0069     /*
0070      * Override default RX/TX queue sizes if nonzero.
0071      */
0072     int         rx_queue_size;
0073     int         tx_queue_size;
0074 
0075     /*
0076      * Use on-chip SRAM for RX/TX descriptors if size is nonzero
0077      * and sufficient to contain all descriptors for the requested
0078      * ring sizes.
0079      */
0080     unsigned long       rx_sram_addr;
0081     int         rx_sram_size;
0082     unsigned long       tx_sram_addr;
0083     int         tx_sram_size;
0084 };
0085 
0086 
0087 #endif