i2c on RPI-B not working

Bernd Walter ticso at cicely7.cicely.de
Thu May 1 17:20:27 UTC 2014


On Thu, May 01, 2014 at 11:42:27AM -0400, Winston Smith wrote:
> On Wed, Apr 30, 2014 at 8:13 PM, Ian Lepore <ian at freebsd.org> wrote:
> > 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 at 021a4000
> >                 {
> >                         status = "okay";
> >                         icee at 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).
> 
> Is there an equivalent for an RTC?
> 
> I know Linux will detect a DS1307 on the I2C bus and map it to
> /dev/rtcN from which the system can use the time?

I had been using a DS1672 RTC on one of my own boards.
But it did use device.hints compiled into the kernel and no DTS.
However the RTC driver already existed before I used it.
Take a look into src/sys/dev/iicbus/, wheh most or maybe all iic drivers
including RTC live, then see if you can find one of them in an existing
DTS file.
I didn't find a DS1307 driver however - maybe the DS133x is similar
enough to base a driver on it.
I personally prefered using an RTC with a unix timestamp instead of
a wallclock time based.

-- 
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.


More information about the freebsd-arm mailing list