From owner-freebsd-arm@FreeBSD.ORG Fri May 2 14:24:37 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 5A6EF7E6 for ; Fri, 2 May 2014 14:24:37 +0000 (UTC) Received: from mail-wg0-x230.google.com (mail-wg0-x230.google.com [IPv6:2a00:1450:400c:c00::230]) (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 EAEE71C82 for ; Fri, 2 May 2014 14:24:36 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id x13so1096160wgg.19 for ; Fri, 02 May 2014 07:24:35 -0700 (PDT) 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=2XPHRaUU6sGnSlRlLJjqJ7GFYMdm84jPURcKWACR4PA=; b=KjHUIQWlpKWxcZewar8Wwh1Aque/Ykj/hoI4o9vKldyjCF2+L0axz/J1QkLyNLKnxo XXmDKwcMgvmgu2yv9EomAoTdgwRrrQ/Bwfe0awGf9zRKEJluI7yHQGeUYu1mnq8Ghpgl pVj6IkREMh0Hm/eBsFCVaerLgJyojWYsYuuu1/zLv307g+eMyVqiZRdg/A1SCOFLfKtW Yze55vdNXZG+yS70ImJQhYNadSZrgIAyEb2T1rvpnQuUE5IX5dz3wJtJt4vjd9Wm+Yek 3jIuTj1wlXV5/t+vW5TXveIXOniPtJn1Bd6aQtNgse4Nez402yODJ7V0QnlHmubViqrk vq0A== MIME-Version: 1.0 X-Received: by 10.180.8.136 with SMTP id r8mr3209575wia.60.1399040675016; Fri, 02 May 2014 07:24:35 -0700 (PDT) Received: by 10.217.10.195 with HTTP; Fri, 2 May 2014 07:24:34 -0700 (PDT) In-Reply-To: <53633440.3070702@hot.ee> References: <53633440.3070702@hot.ee> Date: Fri, 2 May 2014 10:24:34 -0400 Message-ID: Subject: Re: BBB/I2C: Read PMIC data From: Winston Smith To: "Sulev-Madis Silber (ketas)" Content-Type: text/plain; charset=UTF-8 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 14:24:37 -0000 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. Hmmm ... I'm reading reg 0x0 (CHIPID) and 0xA (STATUS) from the PMIC @ address 0x24 on I2C0, but I get strange values: root@beaglebone:~ # ./bbb_pmic TPS65217 PMIC @ address 24: ChipID: 3D (Unknown) rev 1.13 Status: 00 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). I wonder if the device has been "claimed" by the kernel and is inaccessible?