From owner-freebsd-mips@FreeBSD.ORG Sat Mar 8 22:50:15 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 70FAF1F5 for ; Sat, 8 Mar 2014 22:50:15 +0000 (UTC) Received: from mail-qa0-x230.google.com (mail-qa0-x230.google.com [IPv6:2607:f8b0:400d:c00::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 28B7B299 for ; Sat, 8 Mar 2014 22:50:15 +0000 (UTC) Received: by mail-qa0-f48.google.com with SMTP id m5so5389847qaj.21 for ; Sat, 08 Mar 2014 14:50:14 -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=Nsc03jlGkjYN4PihnB/ZSyLBB/A2PtXPjfgxWZLU/lU=; b=XRhZec7yZb3/CzcQXFcf3mtUlokucjVpSg18QB0qH+Kwk2o6Cd3MJviu8BIBaDI3Vo zfTBFq4mBO/2yf8fg6DrYN2tNSYDLojaUxojiuWQ6nPAIZg/kottHZVDuYZPoRDtp1jH HoTNHGcUXopK/4OYkkdMq/+NnZhvUyNPYGOMLKaJQaO73ThLv6o0f3TZJDL4xV/v4Jyv /FrDUx4vtgRcQ7tjN8yRsRCS0gCeMvPoutCYr/eYMmNQS6sYlzk+X8Ca+/fi5PgGmdzb vx+sVrc6ClkeVswpWfH/mogoYH+Ostjci/pf+TPrfwRsEHpCUUq1fFQKaVBaEkm1rUJ0 uVgg== MIME-Version: 1.0 X-Received: by 10.140.27.120 with SMTP id 111mr15074920qgw.14.1394319014334; Sat, 08 Mar 2014 14:50:14 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Sat, 8 Mar 2014 14:50:14 -0800 (PST) In-Reply-To: <20140308234129.76800b5c@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> <20140308140901.19782009@zeta.dino.sk> <20140308173642.0a48d2c2@zeta.dino.sk> <20140308234129.76800b5c@zeta.dino.sk> Date: Sat, 8 Mar 2014 14:50:14 -0800 X-Google-Sender-Auth: 4exZZNN2i0VYh4Zjp08B-PfnVbQ 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 22:50:15 -0000 Ok, well now let's figure out if the reset is working or not. look at arswitch_attach(): * It sets up the default methods; * it calls ar8327_attach(); * it resets the switch via arswitch_reset(); * it calls the HAL methods to set things up; * it attaches the PHYs; * it attaches said PHYs; * it starts the periodic checks via arswitch_tick(). So, I'd add some printf()s in arswitch_attach() to see where it's getting to before it calls return (ENXIO) or return (err). -a On 8 March 2014 14:41, Milan Obuch wrote: > On Sat, 8 Mar 2014 14:18:46 -0800 > Adrian Chadd wrote: > >> Hi, >> >> it's a different silicon version. >> >> Try this patch. It'll get the ar8327 probing and attaching. >> >> We'll worry about the AR9340 on-board switch after this. >> >> >> -a >> >> Index: arswitch.c >> =================================================================== >> --- arswitch.c (revision 262681) >> +++ arswitch.c (working copy) >> @@ -135,6 +135,7 @@ >> sc->sc_switchtype = AR8X16_SWITCH_AR8316; >> break; >> case 0x1202: >> + case 0x1204: >> chipname = "AR8327"; >> sc->sc_switchtype = AR8X16_SWITCH_AR8327; >> sc->mii_lo_first = 1; >> > > Well, not yet: > > argemdio0: at mem 0x19000000-0x19000fff on nexus0 > mdio0: on argemdio0 > mdioproxy0: on mdio0 > arswitch0: readreg 0x00000000: 0x12041204 > arswitch0: readreg 0x00000000: 0x00000000 > arswitch0: on mdio0 > device_attach: arswitch0 attach returned 6 > > Milan