[Feature]Add ethernet sleep and wake through LPSD mode in GSW

Change-Id: Icc69861b54f4cad6eda2aa4e7bbe8bbfac0109bd
diff --git a/src/kernel/linux/v4.19/drivers/net/phy/marvell-88q.c b/src/kernel/linux/v4.19/drivers/net/phy/marvell-88q.c
index 54336d3..c847653 100755
--- a/src/kernel/linux/v4.19/drivers/net/phy/marvell-88q.c
+++ b/src/kernel/linux/v4.19/drivers/net/phy/marvell-88q.c
@@ -5,6 +5,10 @@
 #include <linux/module.h>
 #include <linux/phy.h>
 #include <linux/of.h>
+//xf.li 2022/9/9 modify for LPSD mode start
+#include <linux/of_gpio.h>
+#include <linux/gpio/consumer.h>
+//xf.li 2022/9/9 modify for LPSD mode end
 #include <linux/delay.h>
 
 
@@ -212,11 +216,29 @@
 
 int q2220_suspend(struct phy_device *phydev)
 {
-	return phy_write(phydev, MII_ADDR_C45 | 0x038022, 0x1);
+    //xf.li 2022/9/9 modify for LPSD mode
+    printk("phy sleep start\n");
+    phy_write(phydev, MII_ADDR_C45 | 0x038022, 0x1);
+    mdelay(10);
+    printk("reg 038022 = %x\n", phy_read(phydev, (MII_ADDR_C45 | 0x038022)));
+    phy_write(phydev, (MII_ADDR_C45 | 0x038020), 0x1);
+    printk("reg 038020 = %x\n", phy_read(phydev, (MII_ADDR_C45 | 0x038020)));
+    gpio_direction_output(26 + 268, 0);
+
+    return 0;
+    //xf.li 2022/9/9 modify for LPSD mode
 }
 int q2220_resume(struct phy_device *phydev)
 {
-	return phy_write(phydev, MII_ADDR_C45 | 0x038022, 0x10);
+    //xf.li 2022/9/9 modify for LPSD mode
+    printk("phy awake start\n");
+    gpio_direction_output(7 + 268, 1);
+    udelay(1100);
+    gpio_direction_output(26 + 268, 1);
+    gpio_direction_output(7 + 268, 0);
+    q2110_config_init(phydev);
+    return 0;
+    //xf.li 2022/9/9 modify for LPSD mode
 }