From patchwork Mon Feb 4 16:03:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Nelson X-Patchwork-Id: 217980 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id E55A32C0040 for ; Tue, 5 Feb 2013 03:03:32 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A01CF4A17F; Mon, 4 Feb 2013 17:03:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1csO2zMrPKJn; Mon, 4 Feb 2013 17:03:30 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 329F24A188; Mon, 4 Feb 2013 17:03:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F8C34A188 for ; Mon, 4 Feb 2013 17:03:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oyUrsAPTnynx for ; Mon, 4 Feb 2013 17:03:26 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by theia.denx.de (Postfix) with ESMTPS id 142594A17F for ; Mon, 4 Feb 2013 17:03:24 +0100 (CET) Received: by mail-ie0-f182.google.com with SMTP id k14so5911317iea.13 for ; Mon, 04 Feb 2013 08:03:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=UBHOgliwzk1G4iBbYJa53D6Yw8bpaosW1YAmrD0hfis=; b=Fa846FC4sP4jqKEuPDmBDARRuBFrpuTV6OdwOqZA5+jQvzLaoytynLC1xYOPE0ohUe ndobbIU0aljTUHtwmoywCLm+SGQOR6iazrr7W50aSRVrGuJfFxMLqDvoROH3cahrcyXI N9FMoi1NLcJ3HhZblOytj3zOnRx0wrOJQy0NUuBN0Hkf+a/++idjXfJ0UJQYCnQ9FLdb d3kUvpo11KAsglc6RfwofWorsiHdul6eAPNVqp2hf2l9BX2gHSNS3t5tyOf+OQqAhZ96 /qbYSXJcZzonvhBsJDOYIt55D/RKVZffCoO+Svvc8pH2JDPFr/2IzR9PNV1yfISCSdh7 qiqQ== X-Received: by 10.50.187.134 with SMTP id fs6mr7201005igc.79.1359993801660; Mon, 04 Feb 2013 08:03:21 -0800 (PST) Received: from localhost.localdomain ([64.77.213.245]) by mx.google.com with ESMTPS id bg10sm11677059igc.6.2013.02.04.08.03.19 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 04 Feb 2013 08:03:20 -0800 (PST) From: Robert Nelson To: u-boot@lists.denx.de Date: Mon, 4 Feb 2013 10:03:10 -0600 Message-Id: <1359993790-22454-1-git-send-email-robertcnelson@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: trini@ti.com Subject: [U-Boot] [PATCH 1/2] beagle: expansion boards: retry i2c_read with 16bit addressing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Some expansion boards now ship with at24 eeproms that need to communicate via 16bit addressing. Signed-off-by: Robert Nelson --- board/ti/beagle/beagle.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c index b829a79..9493c6b 100644 --- a/board/ti/beagle/beagle.c +++ b/board/ti/beagle/beagle.c @@ -227,6 +227,14 @@ static unsigned int get_expansion_id(void) i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config, sizeof(expansion_config)); + /* retry reading configuration data with 16bit addressing */ + if ((expansion_config.device_vendor == 0xFFFFFF00) || + (expansion_config.device_vendor == 0xFFFFFFFF)) { + printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n"); + i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config, + sizeof(expansion_config)); + } + i2c_set_bus_num(TWL4030_I2C_BUS); return expansion_config.device_vendor;