From owner-freebsd-arm@FreeBSD.ORG Fri May 2 15:30:22 2014 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 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 312D73D0 for ; Fri, 2 May 2014 15:30:22 +0000 (UTC) Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2A9B1510 for ; Fri, 2 May 2014 15:30:21 +0000 (UTC) Received: by mail-pa0-f46.google.com with SMTP id kx10so2812685pab.19 for ; Fri, 02 May 2014 08:30:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=0GARjL7/f37iFYQ5Vr4kJV4sap6ZMvnSQxmRT73HCPU=; b=S6bJLbx0yCx41sxLqNrw45z78SDb0z6cLpKgONdhgpYbnXPa14qHHWndll7ehoHxMP XrkWuhD0zoblotKkBRL6nUp4fGaTMp/3EE9jOCOLPpeeaegV47NT+UbO9hJ11tYzNddr 0tUih0xIWjrkF96zpWcPeGzVrj7swuyr4N7gQ0xez5Hsama3prb4dsmWFuYCZXrErqz+ ii8vc3img73hMz7eTT5PXngS7DaNyy7K5IAuUtHTwd1Lda2fd7lShci58niX37ga4v/j 7OILN/WqUQ+p+dSRimzVlPpef8AiGSIDaIms5xSQCsRRKmlyuTvCAXDcRycqP31GoZkh UZBw== X-Gm-Message-State: ALoCoQlU7JnxhSo1plMLJvKPmWPHyWKLaN7YYpICXNR0j9aSFk+sFORTeTEejVcMHTLATydREMJV X-Received: by 10.66.122.1 with SMTP id lo1mr36394710pab.118.1399044615030; Fri, 02 May 2014 08:30:15 -0700 (PDT) Received: from lgwl-achen.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id fk4sm185340954pab.23.2014.05.02.08.30.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 02 May 2014 08:30:13 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_64858297-1955-45FA-A052-B5977587DD8A"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: BBB/I2C: Read PMIC data From: Warner Losh In-Reply-To: Date: Fri, 2 May 2014 09:30:11 -0600 Message-Id: References: <53633440.3070702@hot.ee> To: Winston Smith X-Mailer: Apple Mail (2.1874) Cc: FreeBSD ARM X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 May 2014 15:30:22 -0000 --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 = wrote: > On Fri, May 2, 2014 at 1:59 AM, Sulev-Madis Silber (ketas) > 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--