From patchwork Mon Mar 2 10:56:22 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 23931 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 91915DDF00 for ; Mon, 2 Mar 2009 21:56:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756417AbZCBK40 (ORCPT ); Mon, 2 Mar 2009 05:56:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756269AbZCBK40 (ORCPT ); Mon, 2 Mar 2009 05:56:26 -0500 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:40726 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756003AbZCBK4Z (ORCPT ); Mon, 2 Mar 2009 05:56:25 -0500 Received: from comxexch02.comx.local (unknown [172.31.1.117]) by lanfw001a.cxnet.dk (Postfix) with ESMTP id C8165163598; Mon, 2 Mar 2009 11:56:22 +0100 (CET) Received: from 172.31.4.93 ([172.31.4.93]) by comxexch02.comx.local ([172.31.1.117]) with Microsoft Exchange Server HTTP-DAV ; Mon, 2 Mar 2009 10:56:22 +0000 Received: from hawk by comxexch02.comx.local; 02 Mar 2009 11:56:22 +0100 Subject: Re: Marvell 88E609x switch? From: Jesper Dangaard Brouer Reply-To: jdb@comx.dk To: Lennert Buytenhek Cc: Jesper Dangaard Brouer , Gary Thomas , netdev In-Reply-To: <20090227222802.GZ17040@xi.wantstofly.org> References: <20090227145746.GD17040@xi.wantstofly.org> <49A801E6.1040502@mlbassoc.com> <20090227151441.GE17040@xi.wantstofly.org> <49A80606.1040508@mlbassoc.com> <20090227152721.GG17040@xi.wantstofly.org> <49A806C5.1010200@mlbassoc.com> <20090227153102.GH17040@xi.wantstofly.org> <49A80A75.8000101@mlbassoc.com> <20090227155224.GK17040@xi.wantstofly.org> <20090227222802.GZ17040@xi.wantstofly.org> Organization: ComX Networks A/S Date: Mon, 02 Mar 2009 11:56:22 +0100 Message-Id: <1235991382.30736.62.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 2009-02-27 at 23:28 +0100, Lennert Buytenhek wrote: > The main conclusion so far is that this write (net/dsa/mv88e6131.c): > > /* > * MAC Forcing register: don't force link, speed, duplex > * or flow control state to any particular values. > */ > REG_WRITE(addr, 0x01, 0x0003); This sort of enables auto-detection of speed. > isn't correct on ports that can either be CPU ports or external ports. For external ports I had to enabled the PPU to allow the external PHYs to negotiate. Also, on external PHYs ports 8 and 9, I write 0x0403 not 0x0003 (to register 0x1, PCS Control Register). Which also enables inband auto-negotiation, but I'm not sure this is necessary. > Forcing the link up on the CPU port helps somewhat, but things aren't > 100% working yet. On the CPU port I force link-up and force speed+duplex setting. I only got 100Mbit/s to the CPU port... /* CPU Port 10: Force 100Mbit Full-Duplex */ REG_WRITE( 0x1A , 0x01 , 0x003D ); You should write 0x003E ... see attached patch diff --git a/net/dsa/mv88e6131.c b/net/dsa/mv88e6131.c index 374d46a..400473a 100644 --- a/net/dsa/mv88e6131.c +++ b/net/dsa/mv88e6131.c @@ -159,9 +159,13 @@ static int mv88e6131_setup_port(struct dsa_switch *ds, int p) /* * MAC Forcing register: don't force link, speed, duplex - * or flow control state to any particular values. + * or flow control state to any particular values. Unless + * this is the CPU port, then force 1Gb/s and link-up. */ - REG_WRITE(addr, 0x01, 0x0003); + if ((p == ds->cpu_port)) + REG_WRITE(addr, 0x01, 0x003E); + else + REG_WRITE(addr, 0x01, 0x0003); /* * Port Control: disable Core Tag, disable Drop-on-Lock,