From owner-freebsd-embedded@FreeBSD.ORG Sun Dec 18 02:43:46 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 CBD77106566C for ; Sun, 18 Dec 2011 02:43:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 82D168FC0C for ; Sun, 18 Dec 2011 02:43:46 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so5732870vcb.13 for ; Sat, 17 Dec 2011 18:43:46 -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 :content-transfer-encoding; bh=+mcryZA9e7RkZN5O7ySBszXia1MOe8j/J4tOpbedA2w=; b=KpLyhm0lx7QxFtiRO5uXSEjBMiASOQQxu4XiFVtIA1IZboRSTtRHSja3n8OajHidmd wghedJY4EI3dK8caDIoN1stPZIByNdK17wctzz5btAbJ0e88SZ7kL/MHnIfkJ4igoPtY aj6sesma5MazN1+mOsPdPXan9qAGbBzMbjRDU= MIME-Version: 1.0 Received: by 10.52.67.111 with SMTP id m15mr8989301vdt.96.1324176226036; Sat, 17 Dec 2011 18:43:46 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.26.50 with HTTP; Sat, 17 Dec 2011 18:43:45 -0800 (PST) In-Reply-To: References: <0F6CC18F-6973-42A2-AC03-F01BF59458AE@lassitu.de> <1100F70E-9DA9-4163-AC9A-423ECE5AA9A3@lassitu.de> Date: Sat, 17 Dec 2011 18:43:45 -0800 X-Google-Sender-Auth: MNcaKKGqdyJxpjQaRADExhvsGCM Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-embedded@freebsd.org" Subject: Re: Updated switch/glue patch? 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: Sun, 18 Dec 2011 02:43:46 -0000 On 16 December 2011 00:03, Stefan Bethke wrote: > There is one more problem which is not immediately apparent: the register= access is slooooow. =A0The rtl_tick callback that runs once a second needs= .8 seconds to complete, see sysctl debug.rtl8366rb. =A0Most of this time i= s spent in DELAY() in iicbb.c, making the system rather unresponsive. > > rtl_tick() runs mii_tick() and mii_pollstat() for all five PHYs. =A0We ca= n likely leave out mii_tick() since the built-in PHYs don't need ticks for = autonegotiation to work correctly. =A0Leaving out mii_pollstat() means that= link state changes won't be detected and reported automatically but only w= hen you run e.g. etherswitchcfg port0. > > I'm currently looking into iicbb.c, since I believe it is DELAY()ing way = too much (running at effectively 20kHz instead of 100kZh for I2C). =A0I'll = try to speed it up, since the RTL8366RB can go at least at 100kHz. I'm looking at it now. Which particular part of it is delaying too much? Each delay is only 10 microseconds, but there's a handful of these for each _bit_ being sent. This seems a bit ridiculous. What the heck should it be? There are delays for different parts of i2c - setting the data output bit, toggling the clock bit, waiting for an ACK. Should these all be tunable for each device that's on the bus? Or just set the i2c bus speed for all devices on the bus? Or both? Or neither? :) (Someone with i2c clue, please stand up! :) Adrian