From patchwork Wed Dec 28 16:28:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uri Mashiach X-Patchwork-Id: 709312 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 3tpdV81Vlwz9snk for ; Thu, 29 Dec 2016 03:29:20 +1100 (AEDT) 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="BoRpoAaa"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F7EBB3920; Wed, 28 Dec 2016 17:29:10 +0100 (CET) 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 KnwymhRb5Xu5; Wed, 28 Dec 2016 17:29:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9937FB38FB; Wed, 28 Dec 2016 17:28:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D925FA75E4 for ; Wed, 28 Dec 2016 17:28:51 +0100 (CET) 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 edWX-uHUEkVr for ; Wed, 28 Dec 2016 17:28:51 +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 compulab.co.il (softlayer.compulab.co.il [50.23.254.55]) by theia.denx.de (Postfix) with ESMTPS id 23930A75F3 for ; Wed, 28 Dec 2016 17:28:48 +0100 (CET) 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:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gkWaySLZEIR8TNaLshz4CTc0w+NrufPYvv8QKDg9NYQ=; b=BoRpoAaaVR2/asFjDmtJBYgdN mNET1Rs8mlpOXEO6tsAzk0GyopwxJEubvdNtiM1Ns9WlymkVYPF2fcFUgzZFSz61e0/kszpuQX+G+ A/X9VTU0fGEAizJNbq86KLEN+zZ839uH8eYxIZ0GCOr4W+fvnDWyroOtfgZ2Fyn67zjMvnKEfkY2v hHZl48+n34QHjnhaF5GcTjDNOAP2PFu086jErU3QeuiUZtAazvwIyD/vYsA406ichcwKMcZvhl8Xg Rko6O87o9CjREO/Lr4YsN7b2UXDG0fa3IHQ1zBWXGh7pveVDTa//OEEff7mF/YXB2DXORVFUkEDks APtHjyTzQ==; Received: from [62.90.235.247] (port=58049 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.87) (envelope-from ) id 1cMH5q-0007Hx-5V; Wed, 28 Dec 2016 18:28:46 +0200 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 5BB6F483A2D; Wed, 28 Dec 2016 18:28:45 +0200 (IST) 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 27jSOtgugO8g; Wed, 28 Dec 2016 18:28:44 +0200 (IST) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 82696483A23; Wed, 28 Dec 2016 18:28:44 +0200 (IST) 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 CJQbILW2BQ_I; Wed, 28 Dec 2016 18:28:44 +0200 (IST) Received: from urim-desk.compulab.local (uri-ipc.compulab.local [192.168.11.218]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 42A0D483A24; Wed, 28 Dec 2016 18:28:44 +0200 (IST) From: Uri Mashiach To: Tom Rini Date: Wed, 28 Dec 2016 18:28:34 +0200 Message-Id: <1482942516-28622-3-git-send-email-uri.mashiach@compulab.co.il> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1482942516-28622-1-git-send-email-uri.mashiach@compulab.co.il> References: <1482942516-28622-1-git-send-email-uri.mashiach@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_recent_authed_mail_ips_text_entry: uri.mashiach@compulab.co.il|compulab.co.il X-Authenticated-Sender: softlayer.compulab.co.il: uri.mashiach@compulab.co.il Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v4 2/4] arm: am57xx: cl-som-am57x: fetch board rev from EEPROM 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" From: Dmitry Lifshitz Add PCB revision message. Implement board revision get_board_rev API. Signed-off-by: Dmitry Lifshitz Commit description update. Signed-off-by: Uri Mashiach Acked-by: Igor Grinberg Reviewed-by: Tom Rini --- v3 -> v4: No modifications board/compulab/cl-som-am57x/cl-som-am57x.c | 14 ++++++++++++++ include/configs/cl-som-am57x.h | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/board/compulab/cl-som-am57x/cl-som-am57x.c b/board/compulab/cl-som-am57x/cl-som-am57x.c index 4bad644..bdd0a2b 100644 --- a/board/compulab/cl-som-am57x/cl-som-am57x.c +++ b/board/compulab/cl-som-am57x/cl-som-am57x.c @@ -14,6 +14,8 @@ #include #include #include +#include "../common/common.h" +#include "../common/eeprom.h" DECLARE_GLOBAL_DATA_PTR; @@ -60,3 +62,15 @@ int board_usb_init(int index, enum usb_init_type init) return 0; } #endif /* CONFIG_USB_XHCI_OMAP */ + +int misc_init_r(void) +{ + cl_print_pcb_info(); + + return 0; +} + +u32 get_board_rev(void) +{ + return cl_eeprom_get_board_rev(CONFIG_SYS_I2C_EEPROM_BUS); +} diff --git a/include/configs/cl-som-am57x.h b/include/configs/cl-som-am57x.h index c8d4a00..48c0f7f 100644 --- a/include/configs/cl-som-am57x.h +++ b/include/configs/cl-som-am57x.h @@ -24,6 +24,10 @@ #include +/* misc */ +#define CONFIG_MISC_INIT_R +#define CONFIG_REVISION_TAG + /* Status LED */ #define CONFIG_STATUS_LED /* Status LED enabled */ #define CONFIG_GPIO_LED @@ -65,6 +69,16 @@ #define CONFIG_ENV_OFFSET (768 * 1024) #define CONFIG_ENV_SPI_MAX_HZ 48000000 +/* EEPROM */ +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 +#define CONFIG_SYS_I2C_EEPROM_BUS 3 + +#define CONFIG_CMD_EEPROM +#define CONFIG_CMD_EEPROM_LAYOUT +#define CONFIG_ENV_EEPROM_IS_ON_I2C +#define CONFIG_SYS_EEPROM_SIZE 256 + #ifndef CONFIG_SPL_BUILD /* SATA */ #define CONFIG_CMD_SCSI