lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 03 Oct 2011 10:57:32 +0400
From:	Brilliantov Kirill Vladimirovich <brilliantovkv@...l.byterg.ru>
To:	mlindner@...konnect.de
CC:	linux-kernel@...r.kernel.org
Subject: [PATCH] disable 1000Mb/s autonegotiation Marvell PHY for DM365/8
 processors

Hello!
Davinci DM365/8 processors have only 100Mb/s EMAC, I need disable 
1000Mb/s autonegotiation.
Tested on linux-2.6.18_pro500, Marvell 88E1111, TexasInstruments Davinci 
DM368ZCEF and TexasInstruments TMS320DM365ZCE30 processors.

Thank you and excuse me for my bad english.

Signed-off-by: Brilliantov Kirill Vladimirovich 
<brilliantovkv@...l.byterg.ru>
---
linux/drivers/net/phy/marvell.c |   25 ++++++++++++-------------
  1 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/linux/drivers/net/phy/marvell.c 
b/linux/drivers/net/phy/marvell.c
index 0ad2532..b8cf47d 100644
--- a/linux/drivers/net/phy/marvell.c
+++ b/linux/drivers/net/phy/marvell.c
@@ -64,7 +64,7 @@ static int marvell_config_intr(struct phy_device *phydev)
  {
         int err;

-       if(phydev->interrupts == PHY_INTERRUPT_ENABLED)
+       if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
                 err = phy_write(phydev, MII_M1011_IMASK, 
MII_M1011_IMASK_INIT);
         else
                 err = phy_write(phydev, MII_M1011_IMASK, 
MII_M1011_IMASK_CLEAR);
@@ -104,24 +104,35 @@ static int marvell_config_aneg(struct phy_device 
*phydev)
         if (err < 0)
                 return err;

-
+#if defined(CONFIG_ARCH_DAVINCI_DM365)
+       err = phy_read(phydev, MII_CTRL1000);
+       if (err < 0)
+               return err;
+       //disable autonegotiation 1000Mb/s
+       err = phy_write(phydev, MII_CTRL1000,
+                       err & (~(ADVERTISE_1000FULL | ADVERTISE_1000HALF)));
+       if (err < 0)
+               return err;
+       err = phy_read(phydev, MII_CTRL1000);
+       if (err < 0)
+               return err;
+#endif
         err = genphy_config_aneg(phydev);

         return err;
  }

-
  static struct phy_driver m88e1101_driver = {
-       .phy_id         = 0x01410c00,
-       .phy_id_mask    = 0xffffff00,
-       .name           = "Marvell 88E1101",
-       .features       = PHY_GBIT_FEATURES,
-       .flags          = PHY_HAS_INTERRUPT,
-       .config_aneg    = &marvell_config_aneg,
-       .read_status    = &genphy_read_status,
-       .ack_interrupt  = &marvell_ack_interrupt,
-       .config_intr    = &marvell_config_intr,
-       .driver         = { .owner = THIS_MODULE,},
+       .phy_id = 0x01410c00,
+       .phy_id_mask = 0xffffff00,
+       .name = "Marvell 88E1101",
+       .features = PHY_GBIT_FEATURES,
+       .flags = PHY_HAS_INTERRUPT,
+       .config_aneg = &marvell_config_aneg,
+       .read_status = &genphy_read_status,
+       .ack_interrupt = &marvell_ack_interrupt,
+       .config_intr = &marvell_config_intr,
+       .driver = {.owner = THIS_MODULE,},
  };

  static int __init marvell_init(void)


-- 
С уважением,
Бриллиантов Кирилл Владимирович
…………………………………………………………………
программист, технический отдел
ООО «БайтЭрг»
Видеокамеры МВК – Эффективность разумных решений
…………………………………………………………………
+7(495)221-66-22
http://www.byterg.ru    http://www.bestdvr.ru
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists