From patchwork Wed Sep 2 16:05:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Kiryanov X-Patchwork-Id: 513558 X-Patchwork-Delegate: sbabic@denx.de 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 DCF4614018C for ; Thu, 3 Sep 2015 02:08:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=compulab.co.il header.i=@compulab.co.il header.b=a3XRM+wk; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4074B4B741; Wed, 2 Sep 2015 18:08:00 +0200 (CEST) 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 1AQ-4O5xKJrJ; Wed, 2 Sep 2015 18:08:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7ECD4B746; Wed, 2 Sep 2015 18:07:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BE0E94B71C for ; Wed, 2 Sep 2015 18:07:46 +0200 (CEST) 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 yPDtmG6SCEpq for ; Wed, 2 Sep 2015 18:07:46 +0200 (CEST) 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 compulab.co.il (softlayer.compulab.co.il [50.23.254.55]) by theia.denx.de (Postfix) with ESMTPS id 4A1DA4B71D for ; Wed, 2 Sep 2015 18:07:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=compulab.co.il; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=zazaxzDB9gYBnc1E75kfDuT+qA0Ax+9MQZgmaRza9KQ=; b=a3XRM+wkaap86FRkDVgTLgqQs7vDKqDx6HuYRnWneB7lX+2x6qnV2Qvq2BXiapNk63gHV0qQuuJS6YgxpRIa3tGyaQ6IqoH5niMu16exdaL1qotN5il/BxttyuXOUocaESMSy0XfmU2Qqva3kNjLRT8ATDOHIFFTzgjqlNwYEzk=; Received: from [62.90.235.247] (port=5228 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.85) (envelope-from ) id 1ZXAZa-0004Vk-1a; Wed, 02 Sep 2015 19:07:42 +0300 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 2AB0048726C; Wed, 2 Sep 2015 19:07:41 +0300 (IDT) Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 9XvIq2nXdf-s; Wed, 2 Sep 2015 19:07:40 +0300 (IDT) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 8F87B487267; Wed, 2 Sep 2015 19:07:40 +0300 (IDT) X-Virus-Scanned: amavisd-new at zimbra-mta.compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Mp8vnJYxJiim; Wed, 2 Sep 2015 19:07:40 +0300 (IDT) Received: from skynet.compulab.local (nikita-pc.compulab.local [192.168.11.211]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 6264B487264; Wed, 2 Sep 2015 19:07:40 +0300 (IDT) From: Nikita Kiryanov To: u-boot@lists.denx.de Date: Wed, 2 Sep 2015 19:05:18 +0300 Message-Id: <1441209920-10583-2-git-send-email-nikita@compulab.co.il> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441209920-10583-1-git-send-email-nikita@compulab.co.il> References: <1441209920-10583-1-git-send-email-nikita@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Get-Message-Sender-Via: softlayer.compulab.co.il: acl_c_relayhosts_text_entry: nikita@compulab.co.il|compulab.co.il Subject: [U-Boot] [PATCH 1/3] compulab: eeprom: select i2c bus when querying for board rev X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add support for selecting which eeprom is queried for board revision by extending cl_eeprom_get_board_rev() to accept an i2c bus number. Cc: Stefano Babic Cc: Igor Grinberg Signed-off-by: Nikita Kiryanov Acked-by: Igor Grinberg --- board/compulab/cm_fx6/cm_fx6.c | 2 +- board/compulab/cm_t35/cm_t35.c | 2 +- board/compulab/common/eeprom.c | 4 ++-- board/compulab/common/eeprom.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index 3ad1216..572111d 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -708,7 +708,7 @@ int dram_init(void) u32 get_board_rev(void) { - return cl_eeprom_get_board_rev(); + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); } static struct mxc_serial_platdata cm_fx6_mxc_serial_plat = { diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index 398c573..26c6a81 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -105,7 +105,7 @@ int board_init(void) */ u32 get_board_rev(void) { - return cl_eeprom_get_board_rev(); + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); }; int misc_init_r(void) diff --git a/board/compulab/common/eeprom.c b/board/compulab/common/eeprom.c index 77bcea4..aaacd2e 100644 --- a/board/compulab/common/eeprom.c +++ b/board/compulab/common/eeprom.c @@ -121,7 +121,7 @@ static u32 board_rev; * Routine: cl_eeprom_get_board_rev * Description: read system revision from eeprom */ -u32 cl_eeprom_get_board_rev(void) +u32 cl_eeprom_get_board_rev(uint eeprom_bus) { char str[5]; /* Legacy representation can contain at most 4 digits */ uint offset = BOARD_REV_OFFSET_LEGACY; @@ -129,7 +129,7 @@ u32 cl_eeprom_get_board_rev(void) if (board_rev) return board_rev; - if (cl_eeprom_setup(CONFIG_SYS_I2C_EEPROM_BUS)) + if (cl_eeprom_setup(eeprom_bus)) return 0; if (cl_eeprom_layout != LAYOUT_LEGACY) diff --git a/board/compulab/common/eeprom.h b/board/compulab/common/eeprom.h index 50c6b02..e74c379 100644 --- a/board/compulab/common/eeprom.h +++ b/board/compulab/common/eeprom.h @@ -12,13 +12,13 @@ #ifdef CONFIG_SYS_I2C int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus); -u32 cl_eeprom_get_board_rev(void); +u32 cl_eeprom_get_board_rev(uint eeprom_bus); #else static inline int cl_eeprom_read_mac_addr(uchar *buf, uint eeprom_bus) { return 1; } -static inline u32 cl_eeprom_get_board_rev(void) +static inline u32 cl_eeprom_get_board_rev(uint eeprom_bus) { return 0; }