@@ -19,6 +19,7 @@ COBJS-$(CONFIG_PHY_ATHEROS) += atheros.o
COBJS-$(CONFIG_PHY_BROADCOM) += broadcom.o
COBJS-$(CONFIG_PHY_DAVICOM) += davicom.o
COBJS-$(CONFIG_PHY_ET1011C) += et1011c.o
+COBJS-$(CONFIG_PHY_FIXED) += fixed.o
COBJS-$(CONFIG_PHY_ICPLUS) += icplus.o
COBJS-$(CONFIG_PHY_LXT) += lxt.o
COBJS-$(CONFIG_PHY_MARVELL) += marvell.o
new file mode 100644
@@ -0,0 +1,34 @@
+/*
+ * Fixed PHY driver
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright 2013 Bachmann electronic GmbH
+ * author Gmeiner Christian
+ */
+#include <config.h>
+#include <common.h>
+#include <phy.h>
+
+int fixed_config(struct phy_device *phydev)
+{
+ phydev->link = 1;
+ phydev->duplex = CONFIG_PHY_FIXED_SPEED;
+ phydev->speed = CONFIG_PHY_FIXED_DUPLEX;
+
+ return 0;
+}
+
+static struct phy_driver fixed_driver = {
+ .uid = 0xffffffff,
+ .mask = 0x00000000,
+ .name = "Fixed PHY",
+ .features = 0,
+ .config = &fixed_config,
+};
+
+int phy_fixed_init(void)
+{
+ phy_register(&fixed_driver);
+ return 0;
+}
@@ -479,6 +479,9 @@ int phy_init(void)
#ifdef CONFIG_PHY_VITESSE
phy_vitesse_init();
#endif
+#ifdef CONFIG_PHY_FIXED
+ phy_fixed_init();
+#endif
return 0;
}
This patch is needed if the MAC is directly connected to a ethernet switch. In my case the FEC MAC is connected to a Micrel KSZ8895. All I need to to is configure my fixed phy/link like: Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> --- drivers/net/phy/Makefile | 1 + drivers/net/phy/fixed.c | 34 ++++++++++++++++++++++++++++++++++ drivers/net/phy/phy.c | 3 +++ 3 files changed, 38 insertions(+) create mode 100644 drivers/net/phy/fixed.c