From owner-freebsd-arm@FreeBSD.ORG Mon Mar 2 04:00:17 2015 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 591F2A8 for ; Mon, 2 Mar 2015 04:00:17 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (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 DFAE62BB for ; Mon, 2 Mar 2015 04:00:16 +0000 (UTC) Received: by wgha1 with SMTP id a1so30898214wgh.12 for ; Sun, 01 Mar 2015 20:00:15 -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=XwVJIGQjZ+744nkTOD6tAlxFa66ZashkfmeR6gLfH5E=; b=sjQ71mxXxEzrE8fRvZ5TX3Jvi1th2SeQSomL25TdLxcJ0iB5TnzPJxGrBEPT3/O1VV eW5i7G3IQk2iN9s6XmDAmLjQ9cn/o5mTXZpHF/AMAbgkn6xVbbpAUmHgGeZXFM0qtr5Z fsSDKKh8PBJcCgjGHTX58+Cwrg6CwYsSHcATFf+ACNy3BXKAw+ONftwIRpRLJPs5KHPP zPrszd695RSsD9ap5SgvRoRLDNbnr+ho8nu+qjBnEPrKwdK3wCElUSYVwCNSpBhxU88s Ale50+c3GDtgPH4519Ca+IUvgJLNHD2I6CX9RL9GdJBgy8gQpePeKSabbWdEuMMPxO5i jxiA== MIME-Version: 1.0 X-Received: by 10.195.12.35 with SMTP id en3mr52554780wjd.129.1425268815391; Sun, 01 Mar 2015 20:00:15 -0800 (PST) Received: by 10.27.214.136 with HTTP; Sun, 1 Mar 2015 20:00:15 -0800 (PST) In-Reply-To: References: Date: Sun, 1 Mar 2015 20:00:15 -0800 Message-ID: Subject: Re: Chronodot on RPI From: Waitman Gobble To: Luiz Otavio O Souza 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 04:00:17 -0000 On Sun, Mar 1, 2015 at 7:46 PM, Luiz Otavio O Souza wrote: > 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 Thanks Luiz, I'll try it out tonight. I appreciate the update. Happy R450 :) I made a wallpaper from my recent Copocabana photo http://kde-look.org/CONTENT/content-files/167965-copocabana.png -- Waitman Gobble Los Altos California USA 510-830-7975