From owner-freebsd-hackers@FreeBSD.ORG Sat May 7 17:44:55 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27081106564A for ; Sat, 7 May 2011 17:44:55 +0000 (UTC) (envelope-from damjan.marion@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id B08258FC0C for ; Sat, 7 May 2011 17:44:54 +0000 (UTC) Received: by wyf23 with SMTP id 23so4011448wyf.13 for ; Sat, 07 May 2011 10:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:content-type:content-transfer-encoding :subject:date:message-id:to:mime-version:x-mailer; bh=IYZzue+FIKlVwJqZEgGGDFf7mc/poh2tdJZcidlvlBI=; b=D1xZGgBEO7IY1VyUGb0ednUUW6T9rtsp51+G+lPpL8ke212erTCS3b6QzkwgA16s0G IEOAUkVfiX/8KBm+LwbBijyW1EYoBlrdZPeFwpvKLbLMvQ2Ry0I5Jw5c5zdDHCEGXzHL cBTRcHK9cCnWi6AuMxl+nt2tVe3JyqNPPctkc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:content-type:content-transfer-encoding:subject:date:message-id :to:mime-version:x-mailer; b=KajUtHYASoVUrtzNUL/RgU5Og04vAbcayRBH2tew9biOIurIBtq9jZVrcYboza9OsU RnAe/MgxWJm1I6LjBmmAUFqnLX19rM8z/zPrOtyoPkenMGHruBNYRMGrailuFa4Y9x2Z CHBkgUzB/IXwWBxAN+IYTnLrpu9GJ0EvLij4g= Received: by 10.227.11.17 with SMTP id r17mr5219689wbr.6.1304788947720; Sat, 07 May 2011 10:22:27 -0700 (PDT) Received: from [192.168.123.4] (cpe-109-60-66-194.zg3.cable.xnet.hr [109.60.66.194]) by mx.google.com with ESMTPS id t16sm1690315wbg.23.2011.05.07.10.22.25 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 May 2011 10:22:25 -0700 (PDT) From: Damjan Marion Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Sat, 7 May 2011 19:22:23 +0200 Message-Id: <34CF3ED0-52BC-4D0E-922A-FE26F624E77F@gmail.com> To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Apple Message framework v1084) X-Mailer: Apple Mail (2.1084) Subject: Embedded switch instead of stadard PHY X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 17:44:55 -0000 Hi, I would like to implement support for embedded switch on WRT350Nv2 = router which is based on 88F5181L SoC (ARM). FreeBSD already have = support for embedded gigabit card (if_mge) but in case if this router = MAC is connected directly to 8-port ethernet chip (88E6131). If I use = MII_PHY_ANY scan founds following PHYs on miibus: mge0: mem 0xf1072000-0xf1073fff = irq 18,19,20,21,22 on simplebus0 miibus0: on mge0 e1000phy0: PHY 12 on miibus0 e1000phy0: id1=3D0x0141, id2=3D0x0c00=20 e1000phy1: PHY 13 on miibus0 e1000phy1: id1=3D0x0141, id2=3D0x0c00=20 e1000phy2: PHY 14 on miibus0 e1000phy2: id1=3D0x0141, id2=3D0x0c00=20 e1000phy3: PHY 15 on miibus0 e1000phy3: id1=3D0x0141, id2=3D0x0c00=20 ukphy0: PHY 20 on miibus0 ukphy0: =20 ukphy1: PHY 21 on miibus0 ukphy1: =20 ukphy2: PHY 22 on miibus0 ukphy2: =20 ukphy3: PHY 23 on miibus0 if_mge MAC is connected to port 3 of E6131 and port 3 acts in = reverse-GMII mode to simulate PHY side. Reason for output above is that E6131 uses non-standard registers on = multiple device addresses and on some of them mii_attach fails, and on = another it false detects PHY (20-23 above). I would like to hear form more experienced people how to implement this = properly, as it is obvious that it cannot be addressed with existing = routines. On linux this is implemented as dsa driver (Distributed Switch = Architecture) which supports several similar devices (net/dsa/*). Thanks in advance, Damjan=