Date: Sat, 03 May 2014 04:57:11 +0300 From: "Sulev-Madis Silber (ketas)" <madis555@hot.ee> To: Winston Smith <smith.winston.101@gmail.com> Cc: FreeBSD ARM <freebsd-arm@freebsd.org> Subject: Re: BBB/I2C: Read PMIC data Message-ID: <53644CF7.8050800@hot.ee> In-Reply-To: <CADH-AwER3hMhwY2i%2BJh4Fe04ZLYcRQ-e0gy==eotPgyZ0ZOnDA@mail.gmail.com> References: <CADH-AwGbnqzGqbzpV9YMgdOciLpoy3fqxF1RtCmMPZtgc%2BAcXg@mail.gmail.com> <53633440.3070702@hot.ee> <CADH-AwHKKXDTotrk_tQMsZ0WToyk55JgZEmLk0AkHJzGLiGKvA@mail.gmail.com> <C419C325-4354-4490-B7A8-29F4A606FD47@bsdimp.com> <CADH-AwER3hMhwY2i%2BJh4Fe04ZLYcRQ-e0gy==eotPgyZ0ZOnDA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2014-05-02 23:46, Winston Smith wrote: > On Fri, May 2, 2014 at 11:30 AM, Warner Losh <imp@bsdimp.com> wrote: >> Only if the kernel is actively accessing them so your transactions are messed up. >> In the kernel, all the bridge knows about is transactions of one flavor or another. >> This may indicate a more fundamental issue going on, either in your belief that >> it is at 24, or in the address (which is 7 bits) gets translated to 8 bits. Try a left >> shift 1 bit. > > Alright, figured it out. The "dummy" write that precedes the read is > not a dummy, you're sending a command to the I2C device. For a > EEPROM, you send it a 2 byte address of where to read. For the PMIC, > you need to send it a *1-byte* register ID! > > I've updated the tool and renamed it `bbb_sysutil.c`: > > http://pastebin.com/NhMy9D7d > > Here's the output (still working on the "interrupt storm" issue!): > > root@beaglebone:~ # ./bbb_sysutil > TPS65217 PMIC @ address 24: > ChipID: E2 TPS65217C rev 1.2 > Status: 08 ACPWR > interrupt storm detected on "intr70:"; throttling interrupt source > EEPROM @ address 50: signature=AA:55:33:EE > Model: A335BNLT0A6A > Serial: 0214BBBK4321 > > > Let me know if there is any more data you want from the PMIC. > > -W > Oh, awesome! Now I think I know why I didn't get correct results... I would also like to share something, it's a script I use to upgrade my BBB: http://ketas.si.pri.ee/bbb-hotinstaller.sh BTW, you could consider adding such small files as attachments, so they will not disappear somewhere.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53644CF7.8050800>