From patchwork Tue Mar 3 11:10:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dileep Katta X-Patchwork-Id: 45352 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2ED9421429 for ; Tue, 3 Mar 2015 11:14:30 +0000 (UTC) Received: by lbiz11 with SMTP id z11sf7934816lbi.2 for ; Tue, 03 Mar 2015 03:14:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=wazPazIRPHnytQ/RJDgKdqaPGfOiwNxM7cBLuQECeQQ=; b=UnDpnn07NlksLXvWYNLJibkmKWTzvxgARt3X9q57xGGCflfFEz/Gcaf54OH3U2Kqa/ DLBIPHBkUMA2JX8A3C/qiG7/ZsrhoGWDCp37sOl4hPz2Mb1Y3DHrPnWFxKycOXqQowsb NTUqA8yZBLrkp1o2hdFG/sSbYBBnMb0hsDDZwJh5JL45Du+6pJvtVbpam/2wGi20N6Mm hKT9ERbl47ZzXV4iWlSICyTEM8jFYZU++J2GcpWaxF02D7E3ut1WrElIWMtFDTvBB5hd 1p/uXKCWEy9FmItT3W66DFYUaK9KUbP6IrTYot+zt8Q/9GM0ubL8GTK6vmcunEr4jyrs W08Q== X-Gm-Message-State: ALoCoQlAyKu2qAOjjO1aeCQuJ8lNwhYPfO2ShExXXbWDTk49lsWagzKMAWNPuWqCp1kcl39bZTtI X-Received: by 10.194.239.41 with SMTP id vp9mr4470626wjc.5.1425381269148; Tue, 03 Mar 2015 03:14:29 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.229 with SMTP id db5ls28662lac.49.gmail; Tue, 03 Mar 2015 03:14:29 -0800 (PST) X-Received: by 10.112.205.68 with SMTP id le4mr27870098lbc.96.1425381268985; Tue, 03 Mar 2015 03:14:28 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id ma5si252753lbb.134.2015.03.03.03.14.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 03:14:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labhs14 with SMTP id hs14so36622188lab.4 for ; Tue, 03 Mar 2015 03:14:28 -0800 (PST) X-Received: by 10.112.37.198 with SMTP id a6mr14442088lbk.86.1425381268845; Tue, 03 Mar 2015 03:14:28 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp492492lbj; Tue, 3 Mar 2015 03:14:28 -0800 (PST) X-Received: by 10.180.77.48 with SMTP id p16mr43899352wiw.89.1425381268293; Tue, 03 Mar 2015 03:14:28 -0800 (PST) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id a6si685425wjy.131.2015.03.03.03.14.27; Tue, 03 Mar 2015 03:14:28 -0800 (PST) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C1EA24B5D3; Tue, 3 Mar 2015 12:14:26 +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 HIrIcLPqe-0u; Tue, 3 Mar 2015 12:14:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E365A4B5CB; Tue, 3 Mar 2015 12:14:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C07A4B5CB for ; Tue, 3 Mar 2015 12:14:22 +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 yzJsiVhmKEGr for ; Tue, 3 Mar 2015 12:14:22 +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-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by theia.denx.de (Postfix) with ESMTPS id 24F674B5B9 for ; Tue, 3 Mar 2015 12:14:19 +0100 (CET) Received: by padbj1 with SMTP id bj1so26841437pad.11 for ; Tue, 03 Mar 2015 03:14:18 -0800 (PST) X-Received: by 10.66.153.36 with SMTP id vd4mr55076394pab.126.1425381257962; Tue, 03 Mar 2015 03:14:17 -0800 (PST) Received: from localhost.localdomain ([223.227.218.142]) by mx.google.com with ESMTPSA id dq4sm584321pdb.96.2015.03.03.03.14.11 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Mar 2015 03:14:17 -0800 (PST) From: Dileep Katta To: u-boot@lists.denx.de, robherring2@gmail.com, trini@ti.com, rob.herring@linaro.org, srae@broadcom.com, l.majewski@samsung.com, angelabaker@ti.com Date: Tue, 3 Mar 2015 16:40:43 +0530 Message-Id: <1425381044-19460-3-git-send-email-dileep.katta@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1425381044-19460-1-git-send-email-dileep.katta@linaro.org> References: <1425381044-19460-1-git-send-email-dileep.katta@linaro.org> Cc: Dileep Katta Subject: [U-Boot] [PATCH v3 3/4] ARM: DRA7: Set serial number environment variable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: 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" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dileep.katta@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Adds the registers to get the serial number of dra7xx boards. Serial# environment variable will be set if not done already. This will be useful to show correct information in "fastboot devices" commands. Signed-off-by: Angela Stegmaier Signed-off-by: Dileep Katta --- arch/arm/cpu/armv7/omap5/prcm-regs.c | 2 ++ arch/arm/include/asm/omap_common.h | 2 ++ board/ti/dra7xx/evm.c | 11 +++++++++++ 3 files changed, 15 insertions(+) diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c b/arch/arm/cpu/armv7/omap5/prcm-regs.c index 0745d42..020a964 100644 --- a/arch/arm/cpu/armv7/omap5/prcm-regs.c +++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c @@ -440,6 +440,8 @@ struct omap_sys_ctrl_regs const dra7xx_ctrl = { .control_emif1_sdram_config_ext = 0x4AE0C144, .control_emif2_sdram_config_ext = 0x4AE0C148, .control_wkup_ldovbb_mpu_voltage_ctrl = 0x4AE0C158, + .control_std_fuse_die_id_3 = 0x4AE0C210, + .control_std_fuse_prod_id_0 = 0x4AE0C214, .control_padconf_mode = 0x4AE0C5A0, .control_xtal_oscillator = 0x4AE0C5A4, .control_i2c_2 = 0x4AE0C5A8, diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h index 323952f..b329803 100644 --- a/arch/arm/include/asm/omap_common.h +++ b/arch/arm/include/asm/omap_common.h @@ -362,6 +362,8 @@ struct omap_sys_ctrl_regs { u32 control_core_control_io1; u32 control_core_control_io2; u32 control_id_code; + u32 control_std_fuse_die_id_3; + u32 control_std_fuse_prod_id_0; u32 control_std_fuse_opp_bgap; u32 control_ldosram_iva_voltage_ctrl; u32 control_ldosram_mpu_voltage_ctrl; diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 6522241..e20d950 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -88,10 +88,21 @@ int board_init(void) int board_late_init(void) { #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + char serialno[72]; + uint32_t serialno_lo, serialno_hi; + if (omap_revision() == DRA722_ES1_0) setenv("board_name", "dra72x"); else setenv("board_name", "dra7xx"); + + if (!getenv("serial#")) { + printf("serial# not set, setting...\n"); + serialno_lo = readl((*ctrl)->control_std_fuse_die_id_3); + serialno_hi = readl((*ctrl)->control_std_fuse_prod_id_0); + sprintf(serialno, "%08x%08x", serialno_hi, serialno_lo); + setenv("serial#", serialno); + } #endif return 0; }