xref: /openbmc/linux/include/linux/smsc911x.h (revision 1a59d1b8)
11a59d1b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2fd9abb3dSSteve Glendinning /***************************************************************************
3fd9abb3dSSteve Glendinning  *
4fd9abb3dSSteve Glendinning  * Copyright (C) 2004-2008 SMSC
5fd9abb3dSSteve Glendinning  * Copyright (C) 2005-2008 ARM
6fd9abb3dSSteve Glendinning  *
7fd9abb3dSSteve Glendinning  ***************************************************************************/
8fd9abb3dSSteve Glendinning #ifndef __LINUX_SMSC911X_H__
9fd9abb3dSSteve Glendinning #define __LINUX_SMSC911X_H__
10fd9abb3dSSteve Glendinning 
11fd9abb3dSSteve Glendinning #include <linux/phy.h>
12574e2af7SJoe Perches #include <linux/if_ether.h>
13fd9abb3dSSteve Glendinning 
14fd9abb3dSSteve Glendinning /* platform_device configuration data, should be assigned to
15fd9abb3dSSteve Glendinning  * the platform_device's dev.platform_data */
16fd9abb3dSSteve Glendinning struct smsc911x_platform_config {
17fd9abb3dSSteve Glendinning 	unsigned int irq_polarity;
18fd9abb3dSSteve Glendinning 	unsigned int irq_type;
192107fb8bSSteve Glendinning 	unsigned int flags;
20c326de88SMathieu J. Poirier 	unsigned int shift;
21fd9abb3dSSteve Glendinning 	phy_interface_t phy_interface;
22574e2af7SJoe Perches 	unsigned char mac[ETH_ALEN];
23fd9abb3dSSteve Glendinning };
24fd9abb3dSSteve Glendinning 
25fd9abb3dSSteve Glendinning /* Constants for platform_device irq polarity configuration */
26fd9abb3dSSteve Glendinning #define SMSC911X_IRQ_POLARITY_ACTIVE_LOW	0
27fd9abb3dSSteve Glendinning #define SMSC911X_IRQ_POLARITY_ACTIVE_HIGH	1
28fd9abb3dSSteve Glendinning 
29fd9abb3dSSteve Glendinning /* Constants for platform_device irq type configuration */
30fd9abb3dSSteve Glendinning #define SMSC911X_IRQ_TYPE_OPEN_DRAIN		0
31fd9abb3dSSteve Glendinning #define SMSC911X_IRQ_TYPE_PUSH_PULL		1
32fd9abb3dSSteve Glendinning 
332107fb8bSSteve Glendinning /* Constants for flags */
342107fb8bSSteve Glendinning #define SMSC911X_USE_16BIT 			(BIT(0))
352107fb8bSSteve Glendinning #define SMSC911X_USE_32BIT 			(BIT(1))
36d23f028aSSteve Glendinning #define SMSC911X_FORCE_INTERNAL_PHY		(BIT(2))
37d23f028aSSteve Glendinning #define SMSC911X_FORCE_EXTERNAL_PHY 		(BIT(3))
3831f45747SSteve Glendinning #define SMSC911X_SAVE_MAC_ADDRESS		(BIT(4))
392107fb8bSSteve Glendinning 
40833cc67cSMagnus Damm /*
41833cc67cSMagnus Damm  * SMSC911X_SWAP_FIFO:
42833cc67cSMagnus Damm  * Enables software byte swap for fifo data. Should only be used as a
43833cc67cSMagnus Damm  * "last resort" in the case of big endian mode on boards with incorrectly
44833cc67cSMagnus Damm  * routed data bus to older devices such as LAN9118. Newer devices such as
45833cc67cSMagnus Damm  * LAN9221 can handle this in hardware, there are registers to control
46833cc67cSMagnus Damm  * this swapping but the driver doesn't currently use them.
47833cc67cSMagnus Damm  */
48833cc67cSMagnus Damm #define SMSC911X_SWAP_FIFO			(BIT(5))
49833cc67cSMagnus Damm 
50fd9abb3dSSteve Glendinning #endif /* __LINUX_SMSC911X_H__ */
51