From owner-freebsd-mips@FreeBSD.ORG Sat Mar 8 08:55:40 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 25204FDC for ; Sat, 8 Mar 2014 08:55:40 +0000 (UTC) Received: from mail-qa0-x22f.google.com (mail-qa0-x22f.google.com [IPv6:2607:f8b0:400d:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D2CEEBBB for ; Sat, 8 Mar 2014 08:55:39 +0000 (UTC) Received: by mail-qa0-f47.google.com with SMTP id w5so5025444qac.6 for ; Sat, 08 Mar 2014 00:55:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=eNZydX81gAidoJn649djgUJCV1+0l2dJF8SoArt/1p0=; b=lnd/llPdOC0vWPudMzNE8zmFySGFR+d7SFWPHHoj/a8aYA0uDN89gpXpWEPA3xzYRn 7d6JqFT+ocRqU7VBYjoaJm8thsaIlHyv+XF6BSwLlUJKEEBanSw2bn3ztiJt4KFGiko5 EQr/OYhvOQJjRw9WZVmOCd4Q4pj8wyjFzQF0X+a+iaGd0fQNEy3vNdIGNh1GkVN1Jr11 yfd5cdhMqdzcHz5TlsooEfMCRx7r/FpQFGBheDyPMjsQqmxwNPWZJLwr127g1uq8Yre7 D8YmHvcoty9DtbGIRT+T2zLe3zbZcePx92oWbBTeV0nVNtLZzgl9Cm2jZcyim5swmqjc eaUw== MIME-Version: 1.0 X-Received: by 10.224.4.130 with SMTP id 2mr27566276qar.45.1394268938567; Sat, 08 Mar 2014 00:55:38 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Sat, 8 Mar 2014 00:55:38 -0800 (PST) In-Reply-To: <20140307204230.3c86b9b1@zeta.dino.sk> References: <20140301143607.13a96bd6@zeta.dino.sk> <20140301200546.7ff373d1@zeta.dino.sk> <20140301231239.023b8733@zeta.dino.sk> <20140307140432.0a460da1@zeta.dino.sk> <20140307204230.3c86b9b1@zeta.dino.sk> Date: Sat, 8 Mar 2014 00:55:38 -0800 X-Google-Sender-Auth: uFn1Mi4iA-0FfwT0kJlzeukk0-A Message-ID: Subject: Re: I (think) the AR8327 switch support now works From: Adrian Chadd To: Milan Obuch Content-Type: text/plain; charset=ISO-8859-1 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: Sat, 08 Mar 2014 08:55:40 -0000 Look at if_arge.c - arge_fetch_mdiobus_clock_rate() . See whether the openwrt config sets the mdiobus frequency to something. The AR9344 defaults to 'MAC_MII_CFG_CLOCK_DIV_58'. Maybe you can fiddle with which divisor it uses. -a On 7 March 2014 11:42, Milan Obuch wrote: > 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