|
|
|
@ -11,13 +11,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org> |
|
|
|
|
3 files changed, 184 insertions(+)
|
|
|
|
|
create mode 100644 drivers/net/phy/lantiq.c
|
|
|
|
|
|
|
|
|
|
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
|
|
|
|
|
index 961f0b2..41a2992 100644
|
|
|
|
|
--- a/drivers/net/phy/Kconfig
|
|
|
|
|
+++ b/drivers/net/phy/Kconfig
|
|
|
|
|
@@ -107,6 +107,11 @@ config MICREL_PHY
|
|
|
|
|
Index: linux-3.7.1/drivers/net/phy/Kconfig
|
|
|
|
|
===================================================================
|
|
|
|
|
--- linux-3.7.1.orig/drivers/net/phy/Kconfig 2012-12-21 10:30:28.953462268 +0100
|
|
|
|
|
+++ linux-3.7.1/drivers/net/phy/Kconfig 2012-12-21 10:30:29.609462283 +0100
|
|
|
|
|
@@ -150,6 +150,11 @@
|
|
|
|
|
---help---
|
|
|
|
|
Supports the KSZ9021, VSC8201, KS8001 PHYs.
|
|
|
|
|
Currently has a driver for the KSZ8041
|
|
|
|
|
|
|
|
|
|
+config LANTIQ_PHY
|
|
|
|
|
+ tristate "Driver for Lantiq PHYs"
|
|
|
|
@ -27,11 +27,11 @@ index 961f0b2..41a2992 100644 |
|
|
|
|
config FIXED_PHY
|
|
|
|
|
bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
|
|
|
|
|
depends on PHYLIB=y
|
|
|
|
|
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
|
|
|
|
|
index 9645e38..e2eeee3 100644
|
|
|
|
|
--- a/drivers/net/phy/Makefile
|
|
|
|
|
+++ b/drivers/net/phy/Makefile
|
|
|
|
|
@@ -23,6 +23,7 @@ obj-$(CONFIG_NATIONAL_PHY) += national.o
|
|
|
|
|
Index: linux-3.7.1/drivers/net/phy/Makefile
|
|
|
|
|
===================================================================
|
|
|
|
|
--- linux-3.7.1.orig/drivers/net/phy/Makefile 2012-12-21 10:30:28.953462268 +0100
|
|
|
|
|
+++ linux-3.7.1/drivers/net/phy/Makefile 2012-12-21 10:30:29.609462283 +0100
|
|
|
|
|
@@ -38,6 +38,7 @@
|
|
|
|
|
obj-$(CONFIG_DP83640_PHY) += dp83640.o
|
|
|
|
|
obj-$(CONFIG_STE10XP) += ste10Xp.o
|
|
|
|
|
obj-$(CONFIG_MICREL_PHY) += micrel.o
|
|
|
|
@ -39,12 +39,11 @@ index 9645e38..e2eeee3 100644 |
|
|
|
|
obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o
|
|
|
|
|
obj-$(CONFIG_MICREL_KS8995MA) += spi_ks8995.o
|
|
|
|
|
obj-$(CONFIG_AT803X_PHY) += at803x.o
|
|
|
|
|
diff --git a/drivers/net/phy/lantiq.c b/drivers/net/phy/lantiq.c
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000..ba4d7b7
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/drivers/net/phy/lantiq.c
|
|
|
|
|
@@ -0,0 +1,178 @@
|
|
|
|
|
Index: linux-3.7.1/drivers/net/phy/lantiq.c
|
|
|
|
|
===================================================================
|
|
|
|
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
|
|
+++ linux-3.7.1/drivers/net/phy/lantiq.c 2012-12-21 11:47:10.721571920 +0100
|
|
|
|
|
@@ -0,0 +1,220 @@
|
|
|
|
|
+/*
|
|
|
|
|
+ * This program is free software; you can redistribute it and/or modify
|
|
|
|
|
+ * it under the terms of the GNU General Public License as published by
|
|
|
|
@ -182,39 +181,81 @@ index 0000000..ba4d7b7 |
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/* TODO: add vr9_gphy_22f_driver and drivers for external Lantiq PEF7071 PHYs */
|
|
|
|
|
+static struct phy_driver vr9_gphy_11g_driver = {
|
|
|
|
|
+ .phy_id = 0xd565a408,
|
|
|
|
|
+ .phy_id_mask = 0xfffffff0,
|
|
|
|
|
+ .name = "Lantiq XWAY VR9 GPHY 11G",
|
|
|
|
|
+ .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
|
|
|
|
|
+ .flags = 0, /*PHY_HAS_INTERRUPT,*/
|
|
|
|
|
+ .config_init = vr9_gphy_config_init,
|
|
|
|
|
+ .config_aneg = vr9_gphy_config_aneg,
|
|
|
|
|
+ .read_status = genphy_read_status,
|
|
|
|
|
+ .ack_interrupt = vr9_gphy_ack_interrupt,
|
|
|
|
|
+ .did_interrupt = vr9_gphy_did_interrupt,
|
|
|
|
|
+ .config_intr = vr9_gphy_config_intr,
|
|
|
|
|
+ .driver = { .owner = THIS_MODULE },
|
|
|
|
|
+static struct phy_driver lantiq_phy[] = {
|
|
|
|
|
+ {
|
|
|
|
|
+ .phy_id = 0xd565a400,
|
|
|
|
|
+ .phy_id_mask = 0xffffffff,
|
|
|
|
|
+ .name = "Lantiq XWAY PEF7071",
|
|
|
|
|
+ .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
|
|
|
|
|
+ .flags = 0, /*PHY_HAS_INTERRUPT,*/
|
|
|
|
|
+ .config_init = vr9_gphy_config_init,
|
|
|
|
|
+ .config_aneg = vr9_gphy_config_aneg,
|
|
|
|
|
+ .read_status = genphy_read_status,
|
|
|
|
|
+ .ack_interrupt = vr9_gphy_ack_interrupt,
|
|
|
|
|
+ .did_interrupt = vr9_gphy_did_interrupt,
|
|
|
|
|
+ .config_intr = vr9_gphy_config_intr,
|
|
|
|
|
+ .driver = { .owner = THIS_MODULE },
|
|
|
|
|
+ }, {
|
|
|
|
|
+ .phy_id = 0x030260D0,
|
|
|
|
|
+ .phy_id_mask = 0xfffffff0,
|
|
|
|
|
+ .name = "Lantiq XWAY VR9 GPHY 11G v1.3",
|
|
|
|
|
+ .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
|
|
|
|
|
+ .flags = 0, /*PHY_HAS_INTERRUPT,*/
|
|
|
|
|
+ .config_init = vr9_gphy_config_init,
|
|
|
|
|
+ .config_aneg = vr9_gphy_config_aneg,
|
|
|
|
|
+ .read_status = genphy_read_status,
|
|
|
|
|
+ .ack_interrupt = vr9_gphy_ack_interrupt,
|
|
|
|
|
+ .did_interrupt = vr9_gphy_did_interrupt,
|
|
|
|
|
+ .config_intr = vr9_gphy_config_intr,
|
|
|
|
|
+ .driver = { .owner = THIS_MODULE },
|
|
|
|
|
+ }, {
|
|
|
|
|
+ .phy_id = 0xd565a408,
|
|
|
|
|
+ .phy_id_mask = 0xfffffff8,
|
|
|
|
|
+ .name = "Lantiq XWAY VR9 GPHY 11G v1.4",
|
|
|
|
|
+ .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
|
|
|
|
|
+ .flags = 0, /*PHY_HAS_INTERRUPT,*/
|
|
|
|
|
+ .config_init = vr9_gphy_config_init,
|
|
|
|
|
+ .config_aneg = vr9_gphy_config_aneg,
|
|
|
|
|
+ .read_status = genphy_read_status,
|
|
|
|
|
+ .ack_interrupt = vr9_gphy_ack_interrupt,
|
|
|
|
|
+ .did_interrupt = vr9_gphy_did_interrupt,
|
|
|
|
|
+ .config_intr = vr9_gphy_config_intr,
|
|
|
|
|
+ .driver = { .owner = THIS_MODULE },
|
|
|
|
|
+ }, {
|
|
|
|
|
+ .phy_id = 0xd565a418,
|
|
|
|
|
+ .phy_id_mask = 0xfffffff8,
|
|
|
|
|
+ .name = "Lantiq XWAY XRX PHY22F v1.4",
|
|
|
|
|
+ .features = (SUPPORTED_Pause),
|
|
|
|
|
+ .flags = 0, /*PHY_HAS_INTERRUPT,*/
|
|
|
|
|
+ .config_init = vr9_gphy_config_init,
|
|
|
|
|
+ .config_aneg = vr9_gphy_config_aneg,
|
|
|
|
|
+ .read_status = genphy_read_status,
|
|
|
|
|
+ .ack_interrupt = vr9_gphy_ack_interrupt,
|
|
|
|
|
+ .did_interrupt = vr9_gphy_did_interrupt,
|
|
|
|
|
+ .config_intr = vr9_gphy_config_intr,
|
|
|
|
|
+ .driver = { .owner = THIS_MODULE },
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+static int __init ltq_phy_init(void)
|
|
|
|
|
+{
|
|
|
|
|
+ int err;
|
|
|
|
|
+ int i;
|
|
|
|
|
+
|
|
|
|
|
+ err = phy_driver_register(&vr9_gphy_11g_driver);
|
|
|
|
|
+ if (err)
|
|
|
|
|
+ goto err_out;
|
|
|
|
|
+ for (i = 0; i < ARRAY_SIZE(lantiq_phy); i++) {
|
|
|
|
|
+ int err = phy_driver_register(&lantiq_phy[i]);
|
|
|
|
|
+ if (err)
|
|
|
|
|
+ pr_err("lantiq_phy: failed to load %s\n", lantiq_phy[i].name);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return 0;
|
|
|
|
|
+
|
|
|
|
|
+err_out:
|
|
|
|
|
+ return err;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static void __exit ltq_phy_exit(void)
|
|
|
|
|
+{
|
|
|
|
|
+ phy_driver_unregister(&vr9_gphy_11g_driver);
|
|
|
|
|
+ int i;
|
|
|
|
|
+
|
|
|
|
|
+ for (i = 0; i < ARRAY_SIZE(lantiq_phy); i++)
|
|
|
|
|
+ phy_driver_unregister(&lantiq_phy[i]);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+module_init(ltq_phy_init);
|
|
|
|
@ -223,6 +264,3 @@ index 0000000..ba4d7b7 |
|
|
|
|
+MODULE_DESCRIPTION("Lantiq PHY drivers");
|
|
|
|
|
+MODULE_AUTHOR("Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>");
|
|
|
|
|
+MODULE_LICENSE("GPL");
|
|
|
|
|
--
|
|
|
|
|
1.7.10.4
|
|
|
|
|
|
|
|
|
|