From owner-freebsd-arm@FreeBSD.ORG Mon Mar 2 03:46:16 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99651E42 for ; Mon, 2 Mar 2015 03:46:16 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D0311B6 for ; Mon, 2 Mar 2015 03:46:16 +0000 (UTC) Received: by wiwh11 with SMTP id h11so11751770wiw.1 for ; Sun, 01 Mar 2015 19:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QCHIhX3C086flu4AWzhOttFSCbqmrWmS4VPndCSJshM=; b=KCNXgmLGGFN4EISBD9kEjLR4o6yZTYRtFRyo/wgcQNlSOE9h4FDfLyCGYWxvncSya1 LDkUCDy+vmpEsFJMP+gO5LSSUs5dXeWE+LzkRFMmrowMvspiRaA5be8yfpH/1bh+sZ1P l5nYwfqmD8e0x4rIsxPBfpC5jxSz7d3hExy/OYC3z/jsX0R9KWeDiOJYfJAya8eq2Qpx UpJkXf7huwRyypftvLQAEj7bReSZmHijBSJhKKnIzVQvQMV3UiEPGaxTNRrLxvwv8aTG cQheHt18CtM56ZIt9M6+8VYCM4qc29DY9o3hH0Z3a/4eMXRtJkyC+eP454Seq+PXDKlh zVXQ== MIME-Version: 1.0 X-Received: by 10.194.88.37 with SMTP id bd5mr32667634wjb.125.1425267974440; Sun, 01 Mar 2015 19:46:14 -0800 (PST) Received: by 10.180.195.99 with HTTP; Sun, 1 Mar 2015 19:46:14 -0800 (PST) In-Reply-To: References: Date: Mon, 2 Mar 2015 00:46:14 -0300 Message-ID: Subject: Re: Chronodot on RPI From: Luiz Otavio O Souza To: Waitman Gobble Content-Type: text/plain; charset=UTF-8 Cc: "freebsd-arm@freebsd.org" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Mar 2015 03:46:16 -0000 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: mem 0x205000-0x20501f irq 61 on simplebus0 > iicbus0: on iichb0 > iic0: on iicbus0 > iichb1: mem 0x804000-0x80401f irq 61 on simplebus0 > iicbus1: on iichb1 > iic1: 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