From owner-freebsd-mips@FreeBSD.ORG Fri Mar 7 19:42:34 2014 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1A333A8; Fri, 7 Mar 2014 19:42:34 +0000 (UTC) Received: from mailhost.netlab.sk (mailhost.netlab.sk [84.245.65.10]) (using SSLv3 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7122A7C6; Fri, 7 Mar 2014 19:42:33 +0000 (UTC) Received: from zeta.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: LOGIN milan) by mailhost.netlab.sk with ESMTPA; Fri, 07 Mar 2014 20:42:33 +0100 id 004FC9D7.531A2129.0000E986 Date: Fri, 7 Mar 2014 20:42:30 +0100 From: Milan Obuch To: Adrian Chadd Subject: Re: I (think) the AR8327 switch support now works Message-ID: <20140307204230.3c86b9b1@zeta.dino.sk> In-Reply-To: References: <20140301143607.13a96bd6@zeta.dino.sk> <20140301200546.7ff373d1@zeta.dino.sk> <20140301231239.023b8733@zeta.dino.sk> <20140307140432.0a460da1@zeta.dino.sk> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; i386-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_mailhost.netlab.sk-59782-1394221353-0001-2" Cc: freebsd-mips@freebsd.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Mar 2014 19:42:34 -0000 This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_mailhost.netlab.sk-59782-1394221353-0001-2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, 7 Mar 2014 10:19:03 -0800 Adrian Chadd wrote: > On 7 March 2014 05:04, Milan Obuch wrote: > > On Thu, 6 Mar 2014 23:05:56 -0800 > > Adrian Chadd wrote: > > > >> Hi, > >> > >> So I'd add some debugging in arswitch_readreg() and > >> arswitch_writereg() to see what's being read/written. It should be > >> obviously wrong or not. > >> > >> It may be something like the arge0/arge1 MDIO speeds need to be > >> changed. > >> > >> > >> -a > > > > Where is this debugging? I just svn update my src-current tree, > > built new kernel and does not see any debug info... > > There isn't any; you have to add printfs to them. :) > > > -a Ahh, I misunderstood you, sorry... So, yes, I did add some printfs, diff in attachment, and voila, arswitch1 probes and /dev/etherswitch0 got created... so this looks like some timing issue. I am going to repeat this test with new flash with fresh world, so I can actually try to do something. In the meantime, do you have any idea how can I adjust MDIO speed so no printf is necessary? Milan --=_mailhost.netlab.sk-59782-1394221353-0001-2 Content-Type: text/x-patch; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=arswitch.diff Index: /data/src/11/sys/dev/etherswitch/arswitch/arswitch_reg.c =================================================================== --- /data/src/11/sys/dev/etherswitch/arswitch/arswitch_reg.c (revision 262886) +++ /data/src/11/sys/dev/etherswitch/arswitch/arswitch_reg.c (working copy) @@ -164,9 +164,14 @@ int arswitch_readreg(device_t dev, int addr) { + int r; - return (arswitch_readreg_lsb(dev, addr) | + r = (arswitch_readreg_lsb(dev, addr) | arswitch_readreg_msb(dev, addr)); + + device_printf(dev, "readreg %4X: %4X\n", addr, r); + + return r; } int @@ -186,6 +191,8 @@ r |= arswitch_writereg_lsb(dev, addr, value); } + device_printf(dev, "writereg %4X: %4X (%4X)\n", addr, value, r); + return r; } --=_mailhost.netlab.sk-59782-1394221353-0001-2--