From nobody@FreeBSD.org  Sat Mar 16 21:23:10 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 629E0B31
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 16 Mar 2013 21:23:10 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 3C40E2FC
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 16 Mar 2013 21:23:10 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r2GLNA50008296
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 16 Mar 2013 21:23:10 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r2GLNA5L008295;
	Sat, 16 Mar 2013 21:23:10 GMT
	(envelope-from nobody)
Message-Id: <201303162123.r2GLNA5L008295@red.freebsd.org>
Date: Sat, 16 Mar 2013 21:23:10 GMT
From: Petko Bordjukov <bordjukov@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: arge1 fails to attach on UBNT Routerstation
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         177032
>Category:       kern
>Synopsis:       [arge] arge1 fails to attach on UBNT Routerstation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    loos
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 16 21:30:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Aug 19 13:19:18 UTC 2013
>Originator:     Petko Bordjukov
>Release:        10-CURRENT
>Organization:
>Environment:
FreeBSD rtrf3n 10.0-CURRENT FreeBSD 10.0-CURRENT #7 r248373M: Sat Mar 16 18:45:52 EET 2013     root@virtbsd10:/usr/obj/mips.mips/usr/src/sys/ROUTERSTATION  mips

>Description:
The phy of the arge1 interface (the two LAN ports) fails to attach during boot.
I have not modified the device hints.

root@rtrf3n:~ # dmesg
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2013 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #7 r248373M: Sat Mar 16 18:45:52 EET 2013
    root@virtbsd10:/usr/obj/mips.mips/usr/src/sys/ROUTERSTATION mips
gcc version 4.2.1 20070831 patched [FreeBSD]
real memory  = 67108864 (65536K bytes)
avail memory = 58482688 (55MB)
nexus0: <MIPS32 root nexus>
clock0: <Generic MIPS32 ticker> on nexus0
Timecounter "MIPS32" frequency 340000000 Hz quality 800
Event timer "MIPS32" frequency 340000000 Hz quality 800
apb0 at irq 4 on nexus0
uart0: <16550 or compatible> on apb0
uart0: console (115200,n,8,1)
gpio0: <Atheros AR71XX GPIO driver> on apb0
gpio0: [GIANT-LOCKED]
gpio0: gpio pinmask=0x0
gpioc0: <GPIO controller> on gpio0
gpiobus0: <GPIO bus> on gpio0
gpioled0: <GPIO led> at pin(s) 2 on gpiobus0
ehci0: <AR71XX Integrated USB 2.0 controller> at mem 0x1b000000-0x1bffffff irq 1 on nexus0
usbus0: set host controller mode
usbus0: EHCI version 1.0
usbus0: set host controller mode
usbus0 on ehci0
pcib0 at irq 0 on nexus0
pcib0: ar71xx_pci_attach: missing hint 'baseslot', default to AR71XX_PCI_BASE_SLOT
pci0: <PCI bus> on pcib0
ath0: <Atheros 2413> irq 0 at device 17.0 on pci0
ath0: AR2413 mac 7.8 RF2413 phy 4.5
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0056
ath1: <Atheros 9220> irq 1 at device 18.0 on pci0
ath1: [HT] enabling HT modes
ath1: [HT] 1 stream STBC receive enabled
ath1: [HT] 1 stream STBC transmit enabled
ath1: [HT] 2 RX streams; 2 TX streams
ath1: AR9220 mac 128.2 RF5133 phy 13.0
ath1: 2GHz radio: 0x0000; 5GHz radio: 0x00c0
ath2: <Atheros 2413> irq 2 at device 19.0 on pci0
ath2: AR2413 mac 7.8 RF2413 phy 4.5
ath2: 2GHz radio: 0x0000; 5GHz radio: 0x0056
arge0: <Atheros AR71xx built-in ethernet interface> at mem 0x19000000-0x19000fff irq 2 on nexus0
arge0: finishing attachment, phymask 100000, proxy null 
miibus0: <MII bus> on arge0
ukphy0: <Generic IEEE 802.3u media interface> PHY 20 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
arge0: Ethernet address: 00:15:6d:c1:2c:08


arge1: <Atheros AR71xx built-in ethernet interface> at mem 0x1a000000-0x1a000fff irq 3 on nexus0
arge1: finishing attachment, phymask 30000, proxy null 
arge1: unable to attach PHY 16: 6
device_attach: arge1 attach returned 6


spi0: <AR71XX SPI> at mem 0x1f000000-0x1f00000f on nexus0
spibus0: <spibus bus> on spi0
mx25l0: <M25Pxx Flash Family> at cs 0 on spibus0
mx25l0: mx25ll128, sector 65536 bytes, 256 sectors
ar71xx_wdog0: <Atheros AR71XX watchdog timer> on nexus0
Timecounters tick every 1.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <Atheros> at usbus0
uhub0: <Atheros EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
g_dev_taste: make_dev_p() failed (gp->name=redboot/RedBoot config, error=22)
g_dev_taste: make_dev_p() failed (gp->name=redboot/FIS directory, error=22)
Root mount waiting for: usbus0
uhub0: 2 ports with 2 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <vendor 0x1005> at usbus0
umass0: <vendor 0x1005 USB FLASH DRIVE, class 0/0, rev 2.00/1.00, addr 2> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x4001
umass0:0:0:-1: Attached to scbus0
Trying to mount root from ufs:gpt/rootfs []...
mountroot: waiting for device gpt/rootfs ...
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: < USB FLASH DRIVE PMAP> Removable Direct Access SCSI-0 device 
da0: 40.000MB/s transfers
da0: 3824MB (7831552 512 byte sectors: 255H 63S/T 487C)
Mounting from ufs:gpt/rootfs failed with error 19.

Loader variables:

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:tank
        cd9660:/dev/acd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> 
List of GEOM managed disk devices:
  gptid/a509f995-9cfc-4c9a-aa34-53f9009c4e8e gptid/9acd3c55-05a5-46ea-92ce-c7ae69ed3c0f da0p2 da0p1 da0 redboot/rootfs redboot/kernel redboot/RedBoot flash/spi0

mountroot> Trying to mount root from ufs:da0p1 []...
warning: no time-of-day clock registered, system time will not be set accurately

>How-To-Repeat:
svn checkout http://svn.freebsd.org/base/head src
cd src
setenv TARGET mips
setenv TARGET_ARCH mips
setenv TARGET_CPUTYPE mips32
setenv KERNCONF ROUTERSTATION
make buildworld
make buildkernel
setenv DESTDIR /tftpboot
make installkernel

in Redboot on the RS:
load -h <ip addr> boot/kernel/kernel
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Mar 27 01:51:56 UTC 2013 
Responsible-Changed-Why:  
Over to -net, although it should possibly be on -mips. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177032 
Responsible-Changed-From-To: freebsd-net->freebsd-mips 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Mar 27 14:42:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177032 

From: Luiz Otavio O Souza <loos.br@gmail.com>
To: bug-followup@FreeBSD.org,
 bordjukov@gmail.com
Cc:  
Subject: Re: kern/177032: [arge] arge1 fails to attach on UBNT Routerstation
Date: Mon, 1 Apr 2013 12:51:42 -0300

 Hello Petko,
 
 Can you please modify ROUTERSTATION.hints as below and check if your =
 arge1 works ?
 
 Thanks,
 Luiz
 
 
 Index: ROUTERSTATION.hints
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 --- ROUTERSTATION.hints (revision 248943)
 +++ ROUTERSTATION.hints (working copy)
 @@ -10,7 +10,7 @@
  hint.arge.1.media=3D100
  hint.arge.1.fduplex=3D1
  # Uncomment this hint for RS (not PRO)
 -hint.arge.1.phymask=3D0x30000
 +hint.arge.1.phymask=3D0x0
 =20
  # RF led
  hint.gpioled.0.at=3D"gpiobus0"
 
 
 

From: Petko Bordjukov <bordjukov@gmail.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/177032: [arge] arge1 fails to attach on UBNT Routerstation
Date: Mon, 01 Apr 2013 19:50:09 +0300

 Hello Luiz,
 
 Thank you for your response.
 
 Using a 0x0 PHY mask does indeed eliminate the error and the interface
 is present and operational. However, what are the implications of not
 using a directly mapped PHY?
 
 Also, to my knowledge the phymask should be 15 << 16 and the miimode
 should be RMII, however I was not able to get the interface running with
 these values.
 
 -- 
 Best regards,
 Petko
 
 

From: Luiz Otavio O Souza <lists.br@gmail.com>
To: Petko Bordjukov <bordjukov@gmail.com>
Cc: freebsd-mips@freebsd.org, bug-followup@FreeBSD.org
Subject: Re: kern/177032: [arge] arge1 fails to attach on UBNT Routerstation
Date: Mon, 1 Apr 2013 17:32:59 -0300

 --047d7bfd0bd6db028f04d9528645
 Content-Type: text/plain; charset=ISO-8859-1
 
 On 1 April 2013 14:00, Petko Bordjukov <bordjukov@gmail.com> wrote:
 
 > The following reply was made to PR kern/177032; it has been noted by GNATS.
 >
 > From: Petko Bordjukov <bordjukov@gmail.com>
 > To: bug-followup@FreeBSD.org
 > Cc:
 > Subject: Re: kern/177032: [arge] arge1 fails to attach on UBNT
 > Routerstation
 > Date: Mon, 01 Apr 2013 19:50:09 +0300
 >
 >  Hello Luiz,
 >
 >  Thank you for your response.
 >
 >  Using a 0x0 PHY mask does indeed eliminate the error and the interface
 >  is present and operational. However, what are the implications of not
 >  using a directly mapped PHY?
 >
 >  Also, to my knowledge the phymask should be 15 << 16 and the miimode
 >  should be RMII, however I was not able to get the interface running with
 >  these values.
 >
 >  --
 >  Best regards,
 >  Petko
 >
 >
 
 There are no implications for this change on ROUTERSTATION as the switch
 (ADM9669) cannot be managed from its MDIO interface and all you have is a
 static two port switch on arge1.
 
 Even with the correct phymask, you cannot attach and use two simultaneous
 PHY on a single ethernet interface so i think that the phymask=0 is correct
 for this board.
 
 And no, the phymask on the ROUTERSTATION.hints is correct (0x3 << 16 == PHY
 16 and 17) as there are only two ports connected on the switch (all the
 others PHYs on the switch are disconnected).
 
 I'm not sure about the correct miimode for ROUTERSTATION, but i think
 you're right, it should be RMII. I don't have physical access to this board
 anymore to test it myself (although a friend of mine has one of these).
 
 Regards,
 Luiz
 
 --047d7bfd0bd6db028f04d9528645
 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 <div dir=3D"ltr"><div class=3D"gmail_extra">On 1 April 2013 14:00, Petko Bo=
 rdjukov <span dir=3D"ltr">&lt;<a href=3D"mailto:bordjukov@gmail.com" target=
 =3D"_blank">bordjukov@gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmai=
 l_quote">
 <blockquote class=3D"gmail_quote" style=3D"margin-top:0px;margin-right:0px;=
 margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color=
 :rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=3D"i=
 m">
 The following reply was made to PR kern/177032; it has been noted by GNATS.=
 <br>
 <br>
 </div>From: Petko Bordjukov &lt;<a href=3D"mailto:bordjukov@gmail.com">bord=
 jukov@gmail.com</a>&gt;<br>
 To: bug-followup@FreeBSD.org<br>
 <div class=3D"im">Cc:<br>
 Subject: Re: kern/177032: [arge] arge1 fails to attach on UBNT Routerstatio=
 n<br>
 </div>Date: Mon, 01 Apr 2013 19:50:09 +0300<br>
 <br>
 =A0Hello Luiz,<br>
 <br>
 =A0Thank you for your response.<br>
 <br>
 =A0Using a 0x0 PHY mask does indeed eliminate the error and the interface<b=
 r>
 =A0is present and operational. However, what are the implications of not<br=
 >
 =A0using a directly mapped PHY?<br>
 <br>
 =A0Also, to my knowledge the phymask should be 15 &lt;&lt; 16 and the miimo=
 de<br>
 =A0should be RMII, however I was not able to get the interface running with=
 <br>
 =A0these values.<br>
 <br>
 =A0--<br>
 =A0Best regards,<br>
 =A0Petko<br>
 <div class=3D""><div class=3D"h5"><br></div></div></blockquote><div><br></d=
 iv><div><br></div><div>There are no implications for this change on ROUTERS=
 TATION as the switch (ADM9669) cannot be managed from its MDIO interface an=
 d all you have is a static two port switch on arge1.</div>
 <div><br></div><div>Even with the correct phymask, you cannot attach and us=
 e two simultaneous PHY on a single ethernet interface so i think that the p=
 hymask=3D0 is correct for this board.</div><div><br></div><div>And no, the =
 phymask on the ROUTERSTATION.hints is correct (0x3 &lt;&lt; 16 =3D=3D PHY 1=
 6 and 17) as there are only two ports connected on the switch (all the othe=
 rs PHYs on the switch are disconnected).</div>
 <div><br></div><div>I&#39;m not sure about the correct miimode for ROUTERST=
 ATION, but i think you&#39;re right, it should be RMII. I don&#39;t have ph=
 ysical access to this board anymore to test it myself (although a friend of=
  mine has one of these).</div>
 <div><br></div><div>Regards,</div><div>Luiz</div><div><br></div></div></div=
 ></div>
 
 --047d7bfd0bd6db028f04d9528645--

From: Petko Bordjukov <bordjukov@gmail.com>
To: bug-followup@FreeBSD.org, bordjukov@gmail.com
Cc: "freebsd-mips@FreeBSD.org" <freebsd-mips@freebsd.org>, Adrian Chadd
	<adrian@freebsd.org>, Luiz Otavio O Souza <lists.br@gmail.com>
Subject: Re: kern/177032: [arge] arge1 fails to attach on UBNT Routerstation
Date: Tue, 18 Jun 2013 22:36:27 +0003

 --=-qDx/L485RBEcRwmGHZSD
 Content-Type: text/plain; charset=utf-8; format=flowed
 
 I believe this can be closed now. It was fixed by r250385 and r250419.
 
 --=-qDx/L485RBEcRwmGHZSD
 Content-Type: text/html; charset=utf-8
 
 I believe this can be closed now. It was fixed by r250385 and r250419.
 --=-qDx/L485RBEcRwmGHZSD--
 
Responsible-Changed-From-To: freebsd-mips->loos 
Responsible-Changed-By: loos 
Responsible-Changed-When: Mon Aug 19 13:19:18 UTC 2013 
Responsible-Changed-Why:  
I will take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=177032 
>Unformatted:
