From: Brilliantov Kirill Vladimirovich <brilliantovkv@mail.byterg.ru>
To: mlindner@syskonnect.de
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] disable 1000Mb/s autonegotiation Marvell PHY for DM365/8 processors
Date: Mon, 03 Oct 2011 10:57:32 +0400 [thread overview]
Message-ID: <4E895CDC.7020200@mail.byterg.ru> (raw)
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@mail.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
reply other threads:[~2011-10-03 7:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E895CDC.7020200@mail.byterg.ru \
--to=brilliantovkv@mail.byterg.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mlindner@syskonnect.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.