Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Feb 2016 08:27:08 -0700
From:      Ian Lepore <ian@freebsd.org>
To:        Emmanuel Vadot <manu@bidouilliste.com>, Jukka Ukkonen <jau789@gmail.com>
Cc:        freebsd-arm <freebsd-arm@FreeBSD.org>
Subject:   Re: ds3231 suddenly failing
Message-ID:  <1454513228.1736.6.camel@freebsd.org>
In-Reply-To: <20160203155644.29677e6b6e35bc9f9462e678@bidouilliste.com>
References:  <56B21158.80401@gmail.com> <20160203155644.29677e6b6e35bc9f9462e678@bidouilliste.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2016-02-03 at 15:56 +0100, Emmanuel Vadot wrote:
>  Hi,
> 
>  0xd0 is the 7-bit address while 0x1a0 is the 8-bits address so
> nothing is wrong here.
> 

No, that's incorrect.  0x1a0 is not a valid i2c address.  The address
of a Maxim DS3231 is 0b1101000x; 0xd0 when expressing addresses as 8
-bit, or 0x68 when expressing them as 7-bit.

-- Ian

>  i2c -s doesn't show anything because rpi only support I2C_RDRW
> ioctl.
>  If you want to confirm that your device is ok you can patch i2c(8)
> with this diff : 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198817
>  You do not need to recompile the kernel, just i2c(8).
> 
> On Wed, 3 Feb 2016 16:40:24 +0200
> Jukka Ukkonen <jau789@gmail.com> wrote:
> 
> > 
> > Hello all,
> > 
> > Previously my RPI2 had no problems with ds3231 RTC.
> > Now 11.0-CURRENT r295206 shows these during boot...
> > 
> > ds32310: <Maxim DS3231 RTC> at addr 0x1a0 on iicbus1
> > ds32310: cannot read from RTC.
> > 
> > Trying sysctl dev.ds3231 gives me this...
> > 
> > dev.ds3231.0.%parent: iicbus1
> > dev.ds3231.0.%pnpinfo: name=rtc compat=maxim,ds3231
> > dev.ds3231.0.%location: addr=0x1a0
> > dev.ds3231.0.%driver: ds3231
> > dev.ds3231.0.%desc: Maxim DS3231 RTC
> > dev.ds3231.%parent:
> > 
> > Trying "i2c -s" does not show anything on either
> > /dev/iic0 or /dev/iic1.
> > 
> > AFAIK I have not changed anything in the build.
> > 
> > Checking the contents of rpi2.dtb says this about
> > the clock chip...
> > 
> >                         rtc {
> >                                 compatible = "maxim,ds3231";
> >                                 reg = <0xd0>;
> >                         };
> > 
> > I guess that the alert "cannot read from RTC." is
> > due to the fact that "addr 0x1a0" does not match
> > "reg = <0xd0>;" in the DTB. It just does not dawn
> > to me where the kernel found the alternate value.
> > Any ideas?
> > 
> > --jau
> > _______________________________________________
> > freebsd-arm@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> > To unsubscribe, send any mail to "
> > freebsd-arm-unsubscribe@freebsd.org"
> 
> 



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