projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
efi_loader: type of efi_secure_mode
[oweals/u-boot.git]
/
include
/
phy.h
diff --git
a/include/phy.h
b/include/phy.h
index 6ace9b3a0c4c7b21c4b6b6c8a9793f2be2ee1315..b5de14cbfc293d7b5fb1b67ff2cbf22e2ba91bef 100644
(file)
--- a/
include/phy.h
+++ b/
include/phy.h
@@
-10,13
+10,17
@@
#define _PHY_H
#include <dm.h>
#define _PHY_H
#include <dm.h>
+#include <linux/errno.h>
#include <linux/list.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/mdio.h>
#include <linux/list.h>
#include <linux/mii.h>
#include <linux/ethtool.h>
#include <linux/mdio.h>
+#include <log.h>
#include <phy_interface.h>
#define PHY_FIXED_ID 0xa5a55a5a
#include <phy_interface.h>
#define PHY_FIXED_ID 0xa5a55a5a
+#define PHY_NCSI_ID 0xbeefcafe
+
/*
* There is no actual id for this.
* This is just a dummy id for gmii2rgmmi converter.
/*
* There is no actual id for this.
* This is just a dummy id for gmii2rgmmi converter.
@@
-170,6
+174,11
@@
static inline int phy_read(struct phy_device *phydev, int devad, int regnum)
{
struct mii_dev *bus = phydev->bus;
{
struct mii_dev *bus = phydev->bus;
+ if (!bus || !bus->read) {
+ debug("%s: No bus configured\n", __func__);
+ return -1;
+ }
+
return bus->read(bus, phydev->addr, devad, regnum);
}
return bus->read(bus, phydev->addr, devad, regnum);
}
@@
-178,6
+187,11
@@
static inline int phy_write(struct phy_device *phydev, int devad, int regnum,
{
struct mii_dev *bus = phydev->bus;
{
struct mii_dev *bus = phydev->bus;
+ if (!bus || !bus->read) {
+ debug("%s: No bus configured\n", __func__);
+ return -1;
+ }
+
return bus->write(bus, phydev->addr, devad, regnum, val);
}
return bus->write(bus, phydev->addr, devad, regnum, val);
}
@@
-246,10
+260,15
@@
static inline int phy_write_mmd(struct phy_device *phydev, int devad,
#ifdef CONFIG_PHYLIB_10G
extern struct phy_driver gen10g_driver;
#ifdef CONFIG_PHYLIB_10G
extern struct phy_driver gen10g_driver;
-/* For now, XGMII is the only 10G interface */
+/*
+ * List all 10G interfaces here, the assumption being that PHYs on these
+ * interfaces are C45
+ */
static inline int is_10g_interface(phy_interface_t interface)
{
static inline int is_10g_interface(phy_interface_t interface)
{
- return interface == PHY_INTERFACE_MODE_XGMII;
+ return interface == PHY_INTERFACE_MODE_XGMII ||
+ interface == PHY_INTERFACE_MODE_USXGMII ||
+ interface == PHY_INTERFACE_MODE_XFI;
}
#endif
}
#endif
@@
-399,6
+418,7
@@
int phy_vitesse_init(void);
int phy_xilinx_init(void);
int phy_mscc_init(void);
int phy_fixed_init(void);
int phy_xilinx_init(void);
int phy_mscc_init(void);
int phy_fixed_init(void);
+int phy_ncsi_init(void);
int phy_xilinx_gmii2rgmii_init(void);
int board_phy_config(struct phy_device *phydev);
int phy_xilinx_gmii2rgmii_init(void);
int board_phy_config(struct phy_device *phydev);