Date: Thu, 1 May 2014 19:19:48 +0200 From: Bernd Walter <ticso@cicely7.cicely.de> To: Winston Smith <smith.winston.101@gmail.com> Cc: freebsd-arm <freebsd-arm@freebsd.org>, Mark R V Murray <mark@grondar.org>, Ian Lepore <ian@freebsd.org> Subject: Re: i2c on RPI-B not working Message-ID: <20140501171948.GA52252@cicely7.cicely.de> In-Reply-To: <CADH-AwFz%2Bo5XuqaWuOZTSFsPmNQsYXbR_D4mLDJVyo2R6AZX5A@mail.gmail.com> References: <93181B67-1944-4DDD-A595-455D2AE9B110@grondar.org> <1CFC3564-65F0-4DC8-950C-3D53BBB2761C@FreeBSD.org> <CADH-AwFDk2uzOcNQQx%2BL%2BHGBgc7vccQVXLta_g6D3HRHhZxYsQ@mail.gmail.com> <1398903188.22079.89.camel@revolution.hippie.lan> <CADH-AwFz%2Bo5XuqaWuOZTSFsPmNQsYXbR_D4mLDJVyo2R6AZX5A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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@021a4000 > > { > > status = "okay"; > > icee@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@bwct.de> http://www.bwct.de Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140501171948.GA52252>