Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 2024 18:35:24 +1030
From:      Daniel O'Connor <darius@dons.net.au>
To:        freebsd-arm@freebsd.org
Subject:   Re: I2C on Raspberry Pi 4B has wrong clock rate?
Message-ID:  <A5433A42-ED9C-4D44-8134-EF9B02CB3A31@dons.net.au>
In-Reply-To: <EAA369F5-948E-4C74-8A99-FB09916426FF@dons.net.au>
References:  <EAA369F5-948E-4C74-8A99-FB09916426FF@dons.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help


> On 13 Nov 2024, at 14:27, Daniel O'Connor <darius@dons.net.au> wrote:
> I tried setting the frequency but it does not 'stick':
> [rpi13 3:56] ~ >sudo sysctl dev.iichb.0.frequency=3D10000
> dev.iichb.0.frequency: 100000 -> 100000

I tried lowering the clock frequency to 600MHz (from 1.5GHz) and it =
seems 100% reliable now..

I then tried increasing the clock divisor programmed in =
bcm_bsc_iicbus_reset by 3x and it works fine at 1.5GHz (and 600MHz).

I suppose in practise most users have devices which can run at 400kHz so =
running at 250kHz is no problem but the pijuice I2C is handled by a =
microcontroller so it is pickier.

Obviously fixing the code so it properly handles clock speeds changes =
would be good but I am not sure where to start with that.

The code uses IICBUS_GET_FREQUENCY() to find which rate to use for I2C - =
is there some tunable or hint that can set this? Or DTS?

Thanks.

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A5433A42-ED9C-4D44-8134-EF9B02CB3A31>