From patchwork Mon Dec 5 08:27:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uri Mashiach X-Patchwork-Id: 702627 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 3tXHx24JMvz9t0G for ; Mon, 5 Dec 2016 19:29:26 +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="QXDiTU/c"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1070BB3864; Mon, 5 Dec 2016 09:29:01 +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 CeXvDQk8C2dQ; Mon, 5 Dec 2016 09:29:00 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A6CBB386A; Mon, 5 Dec 2016 09:28:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BBC0A7599 for ; Mon, 5 Dec 2016 09:28:35 +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 Ud5aCRTjC2px for ; Mon, 5 Dec 2016 09:28:35 +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 022D1A75A9 for ; Mon, 5 Dec 2016 09:28:31 +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=t0ZQ405IC4jc/Imkg9B5aZ+bRp0Iit7JaR8XG0leDTc=; b=QXDiTU/c/6p4g321IdcbEvQOV W+KlXADsW3BaTZ9yYWZrrzwlxPCuWH1NO2lim15fdEv9a1O3d23Mexmso+ua+9s85Dbk9ZVlVVfi8 VG3E4VSqj6hnwMfZXdF9ayRhrjbeNYgCEuFN8DahhAX5kOfYK7Vib2fOAGfI/FxlMzJlTOeoC/fC+ Sw4+BFn+tOgVAiVVSn78LL5V/5Yb4tknrQXaEjfff3u6mQCyscQe0kRBAJv7OaxBuBqNB7lGQqNb8 iHTVlDvaOlg4Rm6IeUJ7MWkO1RBca/9xt/3FvaWvu3PtKPBIwJZcx/Sa66N/mA/KkjfYnnkTwY/Dq GjrzoIF2Q==; Received: from bzq-108-168-31-146.red.bezeqint.net ([31.168.108.146]:35378 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.87) (envelope-from ) id 1cDodR-0004qF-Cw; Mon, 05 Dec 2016 10:28:29 +0200 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 93C554844D2; Mon, 5 Dec 2016 10:28:28 +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 eYgFLoIqfk21; Mon, 5 Dec 2016 10:28:27 +0200 (IST) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 3900C4844CF; Mon, 5 Dec 2016 10:28:27 +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 Lz0AOoJul88v; Mon, 5 Dec 2016 10:28:27 +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 0C3384844CD; Mon, 5 Dec 2016 10:28:27 +0200 (IST) From: Uri Mashiach To: Tom Rini Date: Mon, 5 Dec 2016 10:27:56 +0200 Message-Id: <1480926478-17204-3-git-send-email-uri.mashiach@compulab.co.il> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480926478-17204-1-git-send-email-uri.mashiach@compulab.co.il> References: <1480926478-17204-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 v2 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 --- 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 46a19b3..b268d43 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 @@ -66,6 +70,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