From owner-freebsd-embedded@FreeBSD.ORG Sat Dec 3 15:47:38 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A5C3106566B for ; Sat, 3 Dec 2011 15:47:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 070128FC12 for ; Sat, 3 Dec 2011 15:47:37 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so4823364vbb.13 for ; Sat, 03 Dec 2011 07:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=egBmmkaLy1KoxDLqEnrUg+HgWYHsd57J7JxMQ4dam7k=; b=uE2RBAWymtRNCf6GUWIZmEe0QgkElTpj70Jm9VJqpuxqbWsN/BI3OOwGh/W50tIJop 9Y3IdB5irjC3pOX92oOE4RQUTe/uiMbwv9CryUbwY5cBEsmax6ShHYLcC7VlCNVF/c8J dfunzXfp/poN4tuPPIne8XzE09yWGAAhFPDxc= MIME-Version: 1.0 Received: by 10.52.66.35 with SMTP id c3mr1584689vdt.17.1322927257167; Sat, 03 Dec 2011 07:47:37 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.109.10 with HTTP; Sat, 3 Dec 2011 07:47:37 -0800 (PST) In-Reply-To: <2DB1EAFF-BFEA-4104-8F5A-E4D00BFDF8F9@lassitu.de> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <86030CEE-6839-4B96-ACDC-2BA9AC1E4AE4@lassitu.de> <2D625CC9-A0E3-47AA-A504-CE8FB2F90245@lassitu.de> <203BF1C8-D528-40C9-8611-9C7AC7E43BAB@lassitu.de> <3C0E9CA3-E130-4E9A-ABCC-1782E28999D1@lassitu.de> <2B8826C7-00C7-4117-B424-4A86F1346DFF@bsdimp.com> <20111130231311.4a154bc5.ray@ddteam.net> <20111202164539.fff3ea91.ray@dlink.ua> <20111202191122.GK25601@funkthat.com> <2DB1EAFF-BFEA-4104-8F5A-E4D00BFDF8F9@lassitu.de> Date: Sat, 3 Dec 2011 23:47:37 +0800 X-Google-Sender-Auth: vWahqv6h8Mlp2wgda82NtKtlwpo Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: Aleksandr Rybalko , freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2011 15:47:38 -0000 Hi, Initial comments (yes, I broke my own rule..) * Don't get rid of SCL_PIN / SDA_PIN: instead rename them to blah_PIN_DEFAULT, and use those defines instead of hardcoding 0 and 1. I have a "thing" for avoiding hard-coded constants, and this makes it more obvious that those 0/1 values are pins rather than true/false. * We should break this out into separate diffs - let's focus right now on fixing/extending the i2c bus code to work with the "strict" flag you've introduced. The rest of the diff is GPIO stuff. That way we can commit it in two parts. Stuff to look at later: * The gpio default stuff is fine (but luis has send me some alternate hint code to look at too!) - however, the capabilities are either in or out. What about pullup, pulldown, etc? * Is there any way to make that "configure GPIO from hint" function generic? Or should we worry about that later on? (eg so the rt305x CPU support from ray@ can also use this?) And my final question: Does this actually now work for mainipulating the switch phy? If so: * how does it work; * do we get per-physical-switch-port statistics somehow? * how do I tinker with it next week when I'm over in Melbourne, talking about this stuff to a group of researchers that want to use the 1043nd? :) Thanks again for this! Adrian