Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 May 2014 09:30:11 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Winston Smith <smith.winston.101@gmail.com>
Cc:        FreeBSD ARM <freebsd-arm@freebsd.org>
Subject:   Re: BBB/I2C: Read PMIC data
Message-ID:  <C419C325-4354-4490-B7A8-29F4A606FD47@bsdimp.com>
In-Reply-To: <CADH-AwHKKXDTotrk_tQMsZ0WToyk55JgZEmLk0AkHJzGLiGKvA@mail.gmail.com>
References:  <CADH-AwGbnqzGqbzpV9YMgdOciLpoy3fqxF1RtCmMPZtgc%2BAcXg@mail.gmail.com> <53633440.3070702@hot.ee> <CADH-AwHKKXDTotrk_tQMsZ0WToyk55JgZEmLk0AkHJzGLiGKvA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_64858297-1955-45FA-A052-B5977587DD8A
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii


On May 2, 2014, at 8:24 AM, Winston Smith <smith.winston.101@gmail.com> =
wrote:

> On Fri, May 2, 2014 at 1:59 AM, Sulev-Madis Silber (ketas)
> <madis555@hot.ee> wrote:
>> Could you look into reading data from PMIC? I tried... there is all =
the
>> code that shows power status on boot... there are PMIC I2C specs...
>> there is your code... however I clearly can't write C enough to get =
that
>> one byte out of PMIC and displayed in human-readable form.
>=20
> Hmmm ... I'm reading reg 0x0 (CHIPID) and 0xA (STATUS) from the PMIC @
> address 0x24 on I2C0, but I get strange values:
>=20
> root@beaglebone:~ # ./bbb_pmic
> TPS65217 PMIC @ address 24:
> ChipID: 3D (Unknown) rev 1.13
> Status: 00
>=20
>=20
> 0x3D isn't a valid CHIPID according to the TPS65217 datasheet; and
> 0x00 doesn't look like a valid value for the status register (there
> should be some 1's in there to indicate the ACPWR or USBPWR).
>=20
> I wonder if the device has been "claimed" by the kernel and is =
inaccessible?

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.

Warner

--Apple-Mail=_64858297-1955-45FA-A052-B5977587DD8A
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTY7oDAAoJEGwc0Sh9sBEAk1AP/imfctYnJ7yiDhqIHNLsMD5A
8ZP6EGSUIz4s2cAlaYH6jRGbL+dtmuXb3VPH8qJgQdmk83pkHK60Arnbiqhwq/ja
pdaxAmWJZJnuh/18WFKdsv9VGREwXAXDWWtMjEFHejuH20sa/7VWaS7WAgB41MXj
UhMU8Dpjoif9BKhIpO4O+T1nhk1ZVhmH/tq9LpLrr19ae6ezYBmweC0l8pdfq51h
0x2xnKvDCtOodDNBucU3sfJvCIgmBjpWmIP1uG4scnG+GOlx+XlkyPRQ21ZAw+bE
DEGgNDlDraHIxjLp1AlLP7gnexZ4pvFcJSgjKqDCV4I/T0p3Hy/ZF9ywx8rthApd
rL5yxOZtT6TrnUio5Lintpz0HO1jQjabr+N2RzC1wS+d0ERIGEAqcXtLwrfjJRqv
v/8Av3Va69wT+wx7Lj5LRUmKkih64RS3ligc3ve5MSOmwLqMU14UKA/PP8Eg3T+Z
bOAg4pzK9n6w5QBv7UCUoxt862C8KRYSGd9eR8sV+yMPbPTAixx/BESI2YygubqG
ExOf/haK2A42Hu5WMIniwqWb8v7h+qUqtWY5eHnZ0ZkMsWN+EKYFJpbTbEutrvgt
qt0brfqcfMATilTpgVWWv7O6p2UF0RbvcI3j3/ojSheAF7UD8xh8/ZOtdTIMBCA+
dFWRap4a993nuxL4oPyO
=zmGe
-----END PGP SIGNATURE-----

--Apple-Mail=_64858297-1955-45FA-A052-B5977587DD8A--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C419C325-4354-4490-B7A8-29F4A606FD47>