mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org
Subject: [PATCH] net: phy: Support Marvell 88E1318S and 88E1510 PHYs
Date: Tue, 26 Aug 2014 22:13:08 +0200	[thread overview]
Message-ID: <1409083988-32278-1-git-send-email-sebastian.hesselbarth@gmail.com> (raw)
In-Reply-To: <1408834420-899-4-git-send-email-ezequiel.garcia@free-electrons.com>

This adds support for Marvell 88E1318S and 88E1510 PHYs.

Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
---
Cc: barebox@lists.infradead.org
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Gregory Clement <gregory.clement@free-electrons.com>
Cc: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

Sascha, this patch is based on next plus Ezequiel's
 ("net: phy: Support Marvell 88EE1545 PHY")
 ("net: phy: Support Marvell 88EE1543 PHY")
patches and should be applied after them.
---
 drivers/net/phy/marvell.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index 63530771955d..74c48bc2a85d 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -52,6 +52,9 @@
 #define MII_88E1121_PHY_MSCR_DELAY_MASK	\
 	(MII_88E1121_PHY_MSCR_RX_DELAY | MII_88E1121_PHY_MSCR_TX_DELAY)
 
+#define MII_88E1318S_PHY_MSCR1		0x10
+#define MII_88E1318S_PHY_MSCR1_PAD_ODD	BIT(6)
+
 #define MII_88E1540_LED_PAGE		0x3
 #define MII_88E1540_LED_CONTROL		0x10
 
@@ -231,6 +234,30 @@ static int m88e1121_config_init(struct phy_device *phydev)
 	return 0;
 }
 
+static int m88e1318s_config_init(struct phy_device *phydev)
+{
+	u16 reg;
+	int ret;
+
+	ret = phy_write(phydev, MII_MARVELL_PHY_PAGE,
+			MII_88E1121_PHY_MSCR_PAGE);
+	if (ret < 0)
+		return ret;
+
+	reg = phy_read(phydev, MII_88E1318S_PHY_MSCR1);
+	reg |= MII_88E1318S_PHY_MSCR1_PAD_ODD;
+
+	ret = phy_write(phydev, MII_88E1318S_PHY_MSCR1, reg);
+	if (ret < 0)
+		return ret;
+
+	phy_write(phydev, MII_MARVELL_PHY_PAGE, MII_MARVELL_PHY_DEFAULT_PAGE);
+	if (ret < 0)
+		return ret;
+
+	return m88e1121_config_init(phydev);
+}
+
 static struct phy_driver marvell_phys[] = {
 {
 	.phy_id		= MARVELL_PHY_ID_88E1121R,
@@ -242,6 +269,24 @@ static struct phy_driver marvell_phys[] = {
 	.read_status	= marvell_read_status,
 },
 {
+	.phy_id		= MARVELL_PHY_ID_88E1318S,
+	.phy_id_mask	= MARVELL_PHY_ID_MASK,
+	.drv.name	= "Marvell 88E1318S",
+	.features	= PHY_GBIT_FEATURES,
+	.config_init	= m88e1318s_config_init,
+	.config_aneg	= genphy_config_aneg,
+	.read_status	= marvell_read_status,
+},
+{
+	.phy_id		= MARVELL_PHY_ID_88E1510,
+	.phy_id_mask	= MARVELL_PHY_ID_MASK,
+	.drv.name	= "Marvell 88E1510",
+	.features	= PHY_GBIT_FEATURES,
+	.config_init	= m88e1318s_config_init,
+	.config_aneg	= genphy_config_aneg,
+	.read_status	= marvell_read_status,
+},
+{
 	.phy_id		= MARVELL_PHY_ID_88E1545,
 	.phy_id_mask	= MARVELL_PHY_ID_MASK,
 	.drv.name	= "Marvell 88E1545",
-- 
2.0.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2014-08-26 20:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-23 22:53 [PATCH 0/5] mvebu: Add network support for Armada 370/XP Ezequiel Garcia
2014-08-23 22:53 ` [PATCH 1/5] ARM: mvebu: Enable PUP register Ezequiel Garcia
2014-08-26 14:28   ` Sebastian Hesselbarth
2014-08-23 22:53 ` [PATCH 2/5] net: phy: Support Marvell 88EE1545 PHY Ezequiel Garcia
2014-08-23 22:53 ` [PATCH 3/5] net: phy: Support Marvell 88EE1543 PHY Ezequiel Garcia
2014-08-26 20:13   ` Sebastian Hesselbarth [this message]
2014-08-23 22:53 ` [PATCH 4/5] net: Add driver for Armada 370/XP 10/100/1000 Mbps network controller Ezequiel Garcia
2014-08-26 14:30   ` Sebastian Hesselbarth
2014-08-26 16:20     ` Ezequiel Garcia
2014-08-26 20:06   ` Sebastian Hesselbarth
2014-08-23 22:53 ` [PATCH 5/5] configs: Add network options to Armada 370/XP boards Ezequiel Garcia
2014-09-01  8:55 ` [PATCH 0/5] mvebu: Add network support for Armada 370/XP Sascha Hauer

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=1409083988-32278-1-git-send-email-sebastian.hesselbarth@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox