From patchwork Wed Nov 5 23:11:26 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ron Madrid X-Patchwork-Id: 7432 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 84126DE257 for ; Thu, 6 Nov 2008 10:15:44 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org X-Greylist: delayed 400 seconds by postgrey-1.31 at ozlabs; Thu, 06 Nov 2008 10:15:31 EST Received: from smtp123.sbc.mail.sp1.yahoo.com (smtp123.sbc.mail.sp1.yahoo.com [69.147.64.96]) by ozlabs.org (Postfix) with SMTP id 232E0DDE9F for ; Thu, 6 Nov 2008 10:15:30 +1100 (EST) Received: (qmail 93516 invoked from network); 5 Nov 2008 23:08:50 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:Subject:Date:Message-Id:X-Mailer; b=GuOWxm+CV5fnWvvypN2tFQMs5qR+ZTjfDzroxf24j4APQ4CfEwly5LzpZVfyz4YVUCgGwByYbhOw8pkTHM7kNxnnEUS49N95OVOa+Xes1pm2keNUAg/gVjsMMv2bH8zBZ3OgeOyfzFOD8brIvAVV1M6Ha2czav8WvwJnRwaXX98= ; Received: from unknown (HELO localhost.localdomain) (ron_madrid@71.154.215.226 with login) by smtp123.sbc.mail.sp1.yahoo.com with SMTP; 5 Nov 2008 23:08:50 -0000 X-YMail-OSG: txJKQJQVM1lCFBHYZamGpb9a1xHyxb4Q0_ZNG8XVxEp7lGkikkv60aSjsOYVutaSn7YxFgvokGRT4zIy.rU0aTP6CIXtcTluOM_bgHBkmkjXMKZYFfEf5EajglwVAoWl6VPqwPc9KfyBEE.Zm3zrGI0As46vKQxE60I6Kl4vbT.GSJBKBoonBdV65Dc- X-Yahoo-Newman-Property: ymail-3 From: Ron Madrid To: linuxppc-dev@ozlabs.org Subject: [PATCH] Add support for Marvell 88E1118 PHY Date: Wed, 5 Nov 2008 15:11:26 -0800 Message-Id: <1225926686-5891-1-git-send-email-ron_madrid@sbcglobal.net> X-Mailer: git-send-email 1.5.5.1 Cc: Ron Madrid X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org This patch will add support for the Marvell 88E1118 PHY which supports gigabit ethernet among other things. Signed-off-by: Ron Madrid --- drivers/net/phy/marvell.c | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 66 insertions(+), 0 deletions(-) diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 4aa5479..eb6411c 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -227,6 +227,59 @@ static int m88e1111_config_init(struct phy_device *phydev) return 0; } +static int m88e1118_config_aneg(struct phy_device *phydev) +{ + int err; + + err = phy_write(phydev, MII_BMCR, BMCR_RESET); + if (err < 0) + return err; + + err = phy_write(phydev, MII_M1011_PHY_SCR, + MII_M1011_PHY_SCR_AUTO_CROSS); + if (err < 0) + return err; + + err = genphy_config_aneg(phydev); + return 0; +} + +static int m88e1118_config_init(struct phy_device *phydev) +{ + int err; + + /* Change address */ + err = phy_write(phydev, 0x16, 0x0002); + if (err < 0) + return err; + + /* Enable 1000 Mbit */ + err = phy_write(phydev, 0x15, 0x1070); + if (err < 0) + return err; + + /* Change address */ + err = phy_write(phydev, 0x16, 0x0003); + if (err < 0) + return err; + + /* Adjust LED Control */ + err = phy_write(phydev, 0x10, 0x021e); + if (err < 0) + return err; + + /* Reset address */ + err = phy_write(phydev, 0x16, 0x0); + if (err < 0) + return err; + + err = phy_write(phydev, MII_BMCR, BMCR_RESET); + if (err < 0) + return err; + + return 0; +} + static int m88e1145_config_init(struct phy_device *phydev) { int err; @@ -416,6 +469,19 @@ static struct phy_driver marvell_drivers[] = { .driver = { .owner = THIS_MODULE }, }, { + .phy_id = 0x01410e10, + .phy_id_mask = 0xfffffff0, + .name = "Marvell 88E1118", + .features = PHY_GBIT_FEATURES, + .flags = PHY_HAS_INTERRUPT, + .config_init = &m88e1118_config_init, + .config_aneg = &m88e1118_config_aneg, + .read_status = &genphy_read_status, + .ack_interrupt = &marvell_ack_interrupt, + .config_intr = &marvell_config_intr, + .driver = {.owner = THIS_MODULE,}, + }, + { .phy_id = 0x01410cd0, .phy_id_mask = 0xfffffff0, .name = "Marvell 88E1145",