Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 2014 20:18:25 -0400
From:      Winston Smith <smith.winston.101@gmail.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-arm <freebsd-arm@freebsd.org>, Mark R V Murray <mark@grondar.org>
Subject:   Re: i2c on RPI-B not working
Message-ID:  <CADH-AwH_Y4pCCpk69DjFtHD_7tFWxc0W5RbZeZrrEfHZFXmBdw@mail.gmail.com>
In-Reply-To: <1398903188.22079.89.camel@revolution.hippie.lan>
References:  <93181B67-1944-4DDD-A595-455D2AE9B110@grondar.org> <1CFC3564-65F0-4DC8-950C-3D53BBB2761C@FreeBSD.org> <CADH-AwFDk2uzOcNQQx%2BL%2BHGBgc7vccQVXLta_g6D3HRHhZxYsQ@mail.gmail.com> <1398903188.22079.89.camel@revolution.hippie.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 30, 2014 at 8:13 PM, Ian Lepore <ian@freebsd.org> wrote:
> I saw it mentioned on irc the other day that i2c(8) isn't very
> functional on most of our ARM systems.  It's expecting a different
> interface to the i2c hardware in which it sees all the low-level
> protocol events.  Most modern hardware has more of a "do this whole
> transaction for me" type interface.  We probably need to enhance i2c(8)
> to work (as much as it can) in such a mode.

i2c(8) being the user-mode utility; is the i2c kernel implementation functional?

> The i2c eeproms, on the other hand, should just work.  Add 'device icee'
> to the kernel config, and in the dts file make an icee entry that's a
> child of the i2c controller entry.  Something like this (this is for
> wandboard)...
>
>                 i2c@021a4000
>                 {
>                         status = "okay";
>                         icee@a0 {
>                                 compatible = "atmel,24c256";
>                                 reg = <0xa0>;
>                                 status = "okay";
>                         };
>                 };
>
> You'll end up with a /dev/icee0 device which you can read and write and
> seek and so on.  Note that the device will show up even if the hardware
> isn't there or isn't responding, there's no actual probe for hardware.
> If you do "dd /dev/icee0 | hd" and it comes up all-bits-one that's
> usually a sign that there's no hardware (but it could also be a brand
> new eeprom with nothing written to it).

It sounds very similar to how Linux maps the BBB's EEPROM into
/sys/bus/i2c/devices/0-0050/eeprom

I also have a DS1307 compatible I2C RTC that I'm hoping to support!

Thanks

-W



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CADH-AwH_Y4pCCpk69DjFtHD_7tFWxc0W5RbZeZrrEfHZFXmBdw>