From patchwork Fri Aug 26 05:30:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 662992 X-Patchwork-Delegate: joe.hershberger@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sL8lf5ZyHz9sBg for ; Fri, 26 Aug 2016 15:30:54 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=k1UAyCl5; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1668B4B979; Fri, 26 Aug 2016 07:30:52 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mdGV-gumy4T1; Fri, 26 Aug 2016 07:30:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7BBBA4B77D; Fri, 26 Aug 2016 07:30:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D2BA64B77D for ; Fri, 26 Aug 2016 07:30:47 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3dzM9Ca_r0Jp for ; Fri, 26 Aug 2016 07:30:47 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pf0-f196.google.com (mail-pf0-f196.google.com [209.85.192.196]) by theia.denx.de (Postfix) with ESMTPS id 3E2574B71E for ; Fri, 26 Aug 2016 07:30:43 +0200 (CEST) Received: by mail-pf0-f196.google.com with SMTP id h186so4312998pfg.2 for ; Thu, 25 Aug 2016 22:30:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=nCkOSV5FGBi7StsUj9wNdwhGr4m4fEk47dy6Mmp4RUQ=; b=k1UAyCl5yWuvruB50djJ49/M48v1PxtWc/moatCJey6Th2m9vW+GmOVFvkLs4sE/yQ wH/b2hFxvFidYuvJrP7P8x3WVBrlkUyl76zUgAWPqZ2iSAUUCCHup6HcFptpX8s7k/5x 3J6pCXHMLNCV1P6XdH7MV57e75PbqoAKc88i6LPopMU0poPfgYtMBjCKWoVNt5eh1up3 i1qOL0kWGhlvdtBeK+qXgqdoIz9cplldkNsXnN5uRNIhVQ0qmqSaFZrD5Px1v+Jrh+pU H48QY8DAxQHH5W5HxpN8tR2kd2UJN2grt9AcM0AOkvdeCo7UiASGX2AknzjbDBV3l7m7 /gIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nCkOSV5FGBi7StsUj9wNdwhGr4m4fEk47dy6Mmp4RUQ=; b=hlbd9OFVfglF4kv5Bsepux0+AwunU+ZdkVCMKu+YUlUUiez+y3U+UlVFdWk9ufmDyF vKlfvaI/g44pHyHEDyI7sTPzl7NymlBfg0+QAuKHfQrPyux1SUN11WCAS42w2xQIJTce iwQO4lmm+ZKjv3FbRT9UjJdLhHo0NZMe+vVjK0lz4zIQ9oN2KCuroJfwzYZLN/HJrsi+ Ou2zmeZiRjZzKpdYoPAt+McLTf0KbYIKDkUyysk4G8XUiDK8GKHb94z/P9Vw3DojbVmz Uj27jraiTkfo/hTsC1Si8eTzU+HOD9wPBvE7IKX7mRmioCVGrZsjIx971WqLEF+9/hqH 8BRA== X-Gm-Message-State: AE9vXwMSi+5rBLACmzyk7ml+wrR1GkggH2jkR48zIrbye8NHM3woxuBClrUb2ldR/K43KA== X-Received: by 10.98.62.65 with SMTP id l62mr2699923pfa.2.1472189441583; Thu, 25 Aug 2016 22:30:41 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc (2-163-36-202-static.alliedtelesis.co.nz. [202.36.163.2]) by smtp.gmail.com with ESMTPSA id ah5sm24786340pad.30.2016.08.25.22.30.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 25 Aug 2016 22:30:40 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Fri, 26 Aug 2016 17:30:25 +1200 Message-Id: <20160826053026.29827-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.9.2.518.ged577c6.dirty Cc: Joshua Scott , Chris Packham , Joe Hershberger Subject: [U-Boot] [PATCH v1 1/2] net: Add support for mv88e609x switches X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The Marvell Link Street mv88e60xx is a series of FastEthernet switch chips, some of which also support Gigabit ports. It is similar to the mv88e61xx series which support Gigabit on all ports. The main difference is the number of ports. Which affects the PORT_COUNT define and the size of the mask passed to mv88e61xx_port_set_vlan(). Other than that it's just a matter of adding the appropriate chip IDs. Signed-off-by: Chris Packham Cc: Joshua Scott Acked-by: Joe Hershberger --- This is a re-work of Joshua's patch http://patchwork.ozlabs.org/patch/425556/ Thanks to the work from Kevin Smith the changes to support the 88E609x are quite trivial. I've tested this on a board with a 88E6097. It should also work for a 88E6096 based on the datasheet. drivers/net/phy/mv88e61xx.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c index 74d5609..7385848 100644 --- a/drivers/net/phy/mv88e61xx.c +++ b/drivers/net/phy/mv88e61xx.c @@ -40,7 +40,7 @@ #define PHY_AUTONEGOTIATE_TIMEOUT 5000 -#define PORT_COUNT 7 +#define PORT_COUNT 11 #define PORT_MASK ((1 << PORT_COUNT) - 1) /* Device addresses */ @@ -167,6 +167,8 @@ #endif /* ID register values for different switch models */ +#define PORT_SWITCH_ID_6096 0x0980 +#define PORT_SWITCH_ID_6097 0x0990 #define PORT_SWITCH_ID_6172 0x1720 #define PORT_SWITCH_ID_6176 0x1760 #define PORT_SWITCH_ID_6240 0x2400 @@ -580,7 +582,7 @@ static int mv88e61xx_port_enable(struct phy_device *phydev, u8 port) } static int mv88e61xx_port_set_vlan(struct phy_device *phydev, u8 port, - u8 mask) + u16 mask) { int val; @@ -974,9 +976,21 @@ static struct phy_driver mv88e61xx_driver = { .shutdown = &genphy_shutdown, }; +static struct phy_driver mv88e609x_driver = { + .name = "Marvell MV88E609x", + .uid = 0x1410c89, + .mask = 0xfffffff0, + .features = PHY_GBIT_FEATURES, + .probe = mv88e61xx_probe, + .config = mv88e61xx_phy_config, + .startup = mv88e61xx_phy_startup, + .shutdown = &genphy_shutdown, +}; + int phy_mv88e61xx_init(void) { phy_register(&mv88e61xx_driver); + phy_register(&mv88e609x_driver); return 0; }