net: ibm_newemac: convert it to use of_get_phy_mode
The patch extends 'enum phy_interface_t' and of_get_phy_mode a little bit with PHY_INTERFACE_MODE_NA and PHY_INTERFACE_MODE_SMII added, and then converts ibm_newemac net driver to use of_get_phy_mode getting phy mode from device tree. It also resolves the namespace conflict on phy_read/write between common mdiobus interface and ibm_newemac private one. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: David S. Miller <davem@davemloft.net> Cc: Grant Likely <grant.likely@secretlab.ca> Acked-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David Miller <davem@davemloft.net>
This commit is contained in:
parent
6ca1a11379
commit
4157ef1b87
5 changed files with 24 additions and 41 deletions
|
@ -26,6 +26,7 @@
|
|||
#define __IBM_NEWEMAC_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/phy.h>
|
||||
|
||||
/* EMAC registers Write Access rules */
|
||||
struct emac_regs {
|
||||
|
@ -106,15 +107,15 @@ struct emac_regs {
|
|||
/*
|
||||
* PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY)
|
||||
*/
|
||||
#define PHY_MODE_NA 0
|
||||
#define PHY_MODE_MII 1
|
||||
#define PHY_MODE_RMII 2
|
||||
#define PHY_MODE_SMII 3
|
||||
#define PHY_MODE_RGMII 4
|
||||
#define PHY_MODE_TBI 5
|
||||
#define PHY_MODE_GMII 6
|
||||
#define PHY_MODE_RTBI 7
|
||||
#define PHY_MODE_SGMII 8
|
||||
#define PHY_MODE_NA PHY_INTERFACE_MODE_NA
|
||||
#define PHY_MODE_MII PHY_INTERFACE_MODE_MII
|
||||
#define PHY_MODE_RMII PHY_INTERFACE_MODE_RMII
|
||||
#define PHY_MODE_SMII PHY_INTERFACE_MODE_SMII
|
||||
#define PHY_MODE_RGMII PHY_INTERFACE_MODE_RGMII
|
||||
#define PHY_MODE_TBI PHY_INTERFACE_MODE_TBI
|
||||
#define PHY_MODE_GMII PHY_INTERFACE_MODE_GMII
|
||||
#define PHY_MODE_RTBI PHY_INTERFACE_MODE_RTBI
|
||||
#define PHY_MODE_SGMII PHY_INTERFACE_MODE_SGMII
|
||||
|
||||
/* EMACx_MR0 */
|
||||
#define EMAC_MR0_RXI 0x80000000
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue