Date: Mon, 2 Mar 2015 00:46:14 -0300 From: Luiz Otavio O Souza <lists.br@gmail.com> To: Waitman Gobble <gobble.wa@gmail.com> Cc: "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: Chronodot on RPI Message-ID: <CAB=2f8xesDjDkUc7xr0N5fJNThLW2B-52k5UukSjAsQK12We6Q@mail.gmail.com> In-Reply-To: <CAFuo_fzzGV%2B=FcQ=bqxeAQBL9kGusDfW=t5oF6og2kOrN8WZZQ@mail.gmail.com> References: <CAFuo_fzzGV%2B=FcQ=bqxeAQBL9kGusDfW=t5oF6og2kOrN8WZZQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1 March 2015 at 16:12, Waitman Gobble wrote: > Anyone have luck with the ChronoDot (D3231) on Raspberry Pi? > I have a RPI B+ (rev 1), tried with HEAD r277133 and r279488 without luck. > > > # uname -a > FreeBSD ARTiming150228 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r277133: > Tue Jan 13 20:18:52 PST 2015 > waitman@rpidev.waitman.net:/usr/home/waitman/crochet-freebsd/work/obj/arm.armv6/usr/src/sys/TMRDEV > arm > > # uname -a > FreeBSD raspberry-pi 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r279488: Sun > Mar 1 10:27:33 PST 2015 > waitman@rpidev.waitman.net:/usr/home/waitman/crochet-freebsd/work/obj/arm.armv6/usr/src/sys/TMRDEV > arm > > > # dmesg | grep iic > iichb0: <BCM2708/2835 BSC controller> mem 0x205000-0x20501f irq 61 on simplebus0 > iicbus0: <OFW I2C bus> on iichb0 > iic0: <I2C generic I/O> on iicbus0 > iichb1: <BCM2708/2835 BSC controller> mem 0x804000-0x80401f irq 61 on simplebus0 > iicbus1: <OFW I2C bus> on iichb1 > iic1: <I2C generic I/O> on iicbus1 > > > a) tried the DS1307 program from Vadim Zaigrin, without success. > > b) tried i2cscan from Winston Smith, > > only get errors. ie, > > ioctl(I2CRDWR) failed: Input/output error > > I have VCC pin 1, GND pin 6, SDA on 3 and SCL on 5. > > trying /dev/iic0 and /dev/iic1 > > Any help/suggestions apprecitated. > > Thank you, > > > -- > Waitman Gobble > Los Altos California USA > 510-830-7975 Hi, I've just committed a driver for DS3231 (r279399), I'm using a different breakout board but chronodot will work just fine. Unfortunately you need to add this device to your kernel and also make the appropriate changes on DTS. Please add 'device ds3231' to RPI-B kernel and the following to RPi DTS: Index: rpi.dts =================================================================== --- sys/boot/dst/dts/arm/rpi.dts (revision 279408) +++ sys/boot/dst/dts/arm/rpi.dts (working copy) @@ -292,6 +292,14 @@ broadcom,function = "ALT3"; }; }; + + bsc1 { + rtc { + compatible = "maxim,ds3231"; + reg = <0xd0>; + }; + }; + usb { hub { compatible = "usb,hub", "usb,device"; Rebuild your kernel and DTB (binary version of DTS) update your SD card and hopefully everything will work. The ds3231(4) settings can be viewed with sysctl dev.ds3231 I've made some modifications to Winston's i2cscan which should now work on RPi: # ./i2cscan /dev/iic1 Checking device: /dev/iic1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- 4F 50: -- -- -- -- -- -- -- 57 -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20 - i2c GPIO expander 48 and 4f - lm75 57 - ? (I don't remember what is this one :) 68 - DS3231 You can find the modified i2cscan here: https://people.freebsd.org/~loos/i2cscan.c Luiz
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAB=2f8xesDjDkUc7xr0N5fJNThLW2B-52k5UukSjAsQK12We6Q>