Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Dec 2011 18:43:45 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Stefan Bethke <stb@lassitu.de>
Cc:        "freebsd-embedded@freebsd.org" <freebsd-embedded@freebsd.org>
Subject:   Re: Updated switch/glue patch?
Message-ID:  <CAJ-Vmon2boy7OCh_4O0MeCi0yCdZu0OYb5dxHCEK=-%2B46zBGtg@mail.gmail.com>
In-Reply-To: <C637C171-A1A2-4296-84FA-6DE97137DC42@lassitu.de>
References:  <CAJ-Vmon8%2BOXQ4g752zZEB-O0BR0sFWO0QUvw--xp2jsBDkx6tQ@mail.gmail.com> <0F6CC18F-6973-42A2-AC03-F01BF59458AE@lassitu.de> <CAJ-Vmo=Y8pp4iFnw%2B1hcPae6QXFboz=a7puwgC1kVSZ3JwMgPQ@mail.gmail.com> <1100F70E-9DA9-4163-AC9A-423ECE5AA9A3@lassitu.de> <CAJ-VmonrnJ7cC6u2LsL9AGusz_%2BkSwY62Rr1__sg5U_NynJ1SQ@mail.gmail.com> <CAJ-Vmo=WSN1oLM=B2HqSHrWyOaOD9BSwwu8=1Wys0CLRJ_N-TA@mail.gmail.com> <C637C171-A1A2-4296-84FA-6DE97137DC42@lassitu.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16 December 2011 00:03, Stefan Bethke <stb@lassitu.de> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmon2boy7OCh_4O0MeCi0yCdZu0OYb5dxHCEK=-%2B46zBGtg>