From owner-freebsd-hackers@FreeBSD.ORG Sun May 8 09:36:33 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 CEEA4106564A for ; Sun, 8 May 2011 09:36:33 +0000 (UTC) (envelope-from damjan.marion@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6BB8FC0C for ; Sun, 8 May 2011 09:36:32 +0000 (UTC) Received: by wwc33 with SMTP id 33so4471871wwc.31 for ; Sun, 08 May 2011 02:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer; bh=P3qxd0otR5OG6Kk7mErRSuXUQpeygTkGJ69321gdi3Y=; b=jujNZNzQw5lVHl6Q7+pXrNTVa2ljfDybRsWJmCu/KJbiEhMpt/43R0XbU479Qz3lXa Z4M559LsN7ygkzxxpzjSpAa/zhcFgHN+Ec52VqflczC/TAlyjEYvY9ocrR4Bu+K9gZ4T 9mFPnsBEYkwa8+0kzvmpr5ck1Kx9YrDprnUwA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=qG0sHX5XADG+me05M4o9zHZTNVkIiU/my3NVAbwzPTzGMGxJ7tVh+Gce5A6RoNCttx uDbANyH8i2ErMujtzRzY2TNF3dCOjpiNYnWP6vFvSnmn59DqpIJqbfsfCTXLf7gi1lpB F4FC4lZLUBrCVYv1tf1giqjhKJV5nfoxUlmzc= Received: by 10.216.82.77 with SMTP id n55mr5778512wee.52.1304847391772; Sun, 08 May 2011 02:36:31 -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 f52sm2445672wes.35.2011.05.08.02.36.30 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 08 May 2011 02:36:30 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Damjan Marion In-Reply-To: Date: Sun, 8 May 2011 11:36:23 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <84255DD0-2593-4F24-8536-2C015CE11DC4@gmail.com> References: <34CF3ED0-52BC-4D0E-922A-FE26F624E77F@gmail.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) Cc: freebsd-hackers@freebsd.org Subject: Re: 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: Sun, 08 May 2011 09:36:34 -0000 On May 8, 2011, at 9:58 AM, Adrian Chadd wrote: > On 8 May 2011 01:22, Damjan Marion wrote: >=20 >> 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: >=20 > There's been some discussions in the past about how to implement a > switch PHY API for use by the variety of embedded switch devices out > there. >=20 > There's been a few attempts at it too. >=20 > What I think may just be a good first step is to port over the Linux > driver for it and instead of trying to make it appear as a multi-PHY > device, just export a programming and status interface via sysctl. > That at least gets the thing in the tree and functioning. Once we have > a few devices in the tree and functioning, we'll be in a better > position to have a discussion about how to represent it. >=20 > There's a couple of dissenting views about how it should be > implemented. I'd like to see some working code in the tree so some > discussion can occur, rather than lots of dissent and no discussion. > :) >=20 > (The switch phy is the last remaining bit of the board support for a > handful of boards too, so I'd really like to see it completed. :) Hi Adrian, I agree with your approach. At this point my concern is how to change = existing code to support switch PHY. In my case problem is that = mii_attach as it is today cannot be used detect this device as device is = not using standard registers. I can see 2 possible options: 1. Modifying eth driver in the way that if switch phy is detected then = it avoids calling mii_attach. Drawback of this approach is that it will = need applying same code for each pair of MAC-switch PHY 2. Modifying mii_attach in the way that it is more flexible in detecting = such devices. This looks challenging to me to do this in flexible way. What do you think? Damjan=