xref: /OK3568_Linux_fs/kernel/include/linux/smsc911x.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-or-later */
2*4882a593Smuzhiyun /***************************************************************************
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Copyright (C) 2004-2008 SMSC
5*4882a593Smuzhiyun  * Copyright (C) 2005-2008 ARM
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  ***************************************************************************/
8*4882a593Smuzhiyun #ifndef __LINUX_SMSC911X_H__
9*4882a593Smuzhiyun #define __LINUX_SMSC911X_H__
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun #include <linux/phy.h>
12*4882a593Smuzhiyun #include <linux/if_ether.h>
13*4882a593Smuzhiyun 
14*4882a593Smuzhiyun /* platform_device configuration data, should be assigned to
15*4882a593Smuzhiyun  * the platform_device's dev.platform_data */
16*4882a593Smuzhiyun struct smsc911x_platform_config {
17*4882a593Smuzhiyun 	unsigned int irq_polarity;
18*4882a593Smuzhiyun 	unsigned int irq_type;
19*4882a593Smuzhiyun 	unsigned int flags;
20*4882a593Smuzhiyun 	unsigned int shift;
21*4882a593Smuzhiyun 	phy_interface_t phy_interface;
22*4882a593Smuzhiyun 	unsigned char mac[ETH_ALEN];
23*4882a593Smuzhiyun };
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun /* Constants for platform_device irq polarity configuration */
26*4882a593Smuzhiyun #define SMSC911X_IRQ_POLARITY_ACTIVE_LOW	0
27*4882a593Smuzhiyun #define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH	1
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /* Constants for platform_device irq type configuration */
30*4882a593Smuzhiyun #define SMSC911X_IRQ_TYPE_OPEN_DRAIN		0
31*4882a593Smuzhiyun #define SMSC911X_IRQ_TYPE_PUSH_PULL		1
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun /* Constants for flags */
34*4882a593Smuzhiyun #define SMSC911X_USE_16BIT 			(BIT(0))
35*4882a593Smuzhiyun #define SMSC911X_USE_32BIT 			(BIT(1))
36*4882a593Smuzhiyun #define SMSC911X_FORCE_INTERNAL_PHY		(BIT(2))
37*4882a593Smuzhiyun #define SMSC911X_FORCE_EXTERNAL_PHY 		(BIT(3))
38*4882a593Smuzhiyun #define SMSC911X_SAVE_MAC_ADDRESS		(BIT(4))
39*4882a593Smuzhiyun 
40*4882a593Smuzhiyun /*
41*4882a593Smuzhiyun  * SMSC911X_SWAP_FIFO:
42*4882a593Smuzhiyun  * Enables software byte swap for fifo data. Should only be used as a
43*4882a593Smuzhiyun  * "last resort" in the case of big endian mode on boards with incorrectly
44*4882a593Smuzhiyun  * routed data bus to older devices such as LAN9118. Newer devices such as
45*4882a593Smuzhiyun  * LAN9221 can handle this in hardware, there are registers to control
46*4882a593Smuzhiyun  * this swapping but the driver doesn't currently use them.
47*4882a593Smuzhiyun  */
48*4882a593Smuzhiyun #define SMSC911X_SWAP_FIFO			(BIT(5))
49*4882a593Smuzhiyun 
50*4882a593Smuzhiyun #endif /* __LINUX_SMSC911X_H__ */
51