From patchwork Tue Mar 13 15:48:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 131488 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp899060ljb; Tue, 13 Mar 2018 08:49:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELvG0WvY2TGxNz33e0CMoO7X0bTLlbm/LLR4KG2x1/20UpWc45WvitxFj6plKxlOGNEdvPrb X-Received: by 10.80.177.141 with SMTP id m13mr1405917edd.308.1520956161316; Tue, 13 Mar 2018 08:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520956161; cv=none; d=google.com; s=arc-20160816; b=eVvOFO4v32kXDB9u7wE7l8ggKixGqBO4PWRiJHrdGhNdq542yAXvTgeCKReEyCllcC 2T199BsfMVPnYHvCza8nQZRIFEO3U7KcA3aj3GkUGqDWyV88IHj4VJVu1wW56VY54JT9 iTyOjiQaohmvO7eWeKCMfzUDulZmwdS43kNyafq1YR9cy+2Hrtuy//gDGZwykC1Es3Pm 1MAqzbl31TMvz8UWenNl5wiAX0JHJQyPGi8E2JcJX/PtZA7rR3vZqB8Y1sTnGl2w5oYJ KRXI8+pEtpZSx2nmvKEaXNwCFfQX3LVSpI7zGK5cbhALkCSbO66+TAHbWA/9f8UDdkqj IOAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=yXwvrRBl9mzOQKloBuubpep2tLz1hTL86Eukz4e8vLU=; b=SPI1bFsGZG4pYYccntQJbT3H1Kerygxw49DNUb2GF458cfL1DANZuteL9jT0giQGfO LAONbvCuz5Q3/Ohhm2B6ICHH9Nya8dDZlVnGCSi1SVH7kmZFpbVqMvIZO26w/dqhtiI9 doMOgnA268kbgbBt9FEYn+KyyTk4JBQZuGq6YYs/IHyRJNMl5sp3vdF2H/5ow1i8Dtlg GMp4TUtmIJaenguRnrQo9Qwdl5WeEKaETmFFQgdF6KVNwj7v4oN2SGkAYCes5YJGcS5X yn1kCLcPznWCO5ul+72Nms1T7DyaCtg/VQNmwcGIBaSb3VlTgii1lTId+zS6NoSihbs2 L0YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hxtImDNW; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id 65si286064edb.376.2018.03.13.08.49.21; Tue, 13 Mar 2018 08:49:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=hxtImDNW; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id CD8A0C21C27; Tue, 13 Mar 2018 15:48:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 334B3C21DC1; Tue, 13 Mar 2018 15:48:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D2F56C21DFF; Tue, 13 Mar 2018 15:48:25 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id 54A79C21C27 for ; Tue, 13 Mar 2018 15:48:22 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id r8so230632wrg.0 for ; Tue, 13 Mar 2018 08:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=S80A+x22VFxJ7/MWdb38R6VNbvGhV0jGGShttzhoh1A=; b=hxtImDNW0q870XjYYfuGdbOl/OEcc9JCbkqAgw/nbmY85GKDMD2js6fqwFNKfu5q82 xseJ4GCJ5RkRpJDb7Au3YYhbjmDbQb4nWImo6cxGkheDVVIsQtqUPavxi0QeSi/RH3bw LMGDftr7h8wx/0JODxzJsBv9tsK9xZEa1nun4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=S80A+x22VFxJ7/MWdb38R6VNbvGhV0jGGShttzhoh1A=; b=WxKwbUIIcmzakW6FITPwQMSjK8W5K2L7ZFGf6aRkw00L8pWd2D2ALS2+1h1hKtXrfT fYigXd2TZT+LDvjNVt2tbrkMsUq1qBTkJbhyOS/61Befuuevuf1F+Pb7q4bG7A9/C3o4 TB/PIvr+XTRwcJHtLOfFcrqkYv94Y7T7z3bnclAz////cP8CK6fX+TeggOLhMD/3JiSm DfbGYCyyZUE9Y2PaBA2rs33ZEnFR8wwMggT7PcgvcSPKGgZ8UW0SjiooSF2lOVoeIOiE e8cfJzul5wv4eLRbESD3iw+0Eo/dXY4KV1PG6RKZmjPQQwKaxDy5DhcznNHJt9a3qMQ2 pftQ== X-Gm-Message-State: AElRT7H53jo8eZbET4z/AtzTwyPT7Bf3pkgRxP7Zx6W871OfJ655nuY7 iK+CaaeSlzWlJ6rOSba2trR3r9aeuoM= X-Received: by 10.80.146.248 with SMTP id l53mr1359524eda.125.1520956101855; Tue, 13 Mar 2018 08:48:21 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id 4sm403616edx.8.2018.03.13.08.48.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Mar 2018 08:48:21 -0700 (PDT) From: Bryan O'Donoghue To: U-Boot@lists.denx.de Date: Tue, 13 Mar 2018 15:48:16 +0000 Message-Id: <1520956098-25261-2-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520956098-25261-1-git-send-email-bryan.odonoghue@linaro.org> References: <1520956098-25261-1-git-send-email-bryan.odonoghue@linaro.org> Cc: rui.silva@linaro.org, fabio.estevam@nxp.com Subject: [U-Boot] [PATCH v2 1/3] imx: mx7: Fix CONFIG_SERIAL_TAG compilation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" Currently when we define CONFIG_SERIAL_TAG we will barf with a failure to define "struct tag_serialnr". This structure is defined in , this patch includes to fix. Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic Reviewed-by: Fabio Estevam --- arch/arm/mach-imx/mx7/soc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index d349676..1602585 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -18,6 +18,7 @@ #include #include #include +#include #if defined(CONFIG_IMX_THERMAL) static const struct imx_thermal_plat imx7_thermal_plat = { From patchwork Tue Mar 13 15:48:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 131490 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp899783ljb; Tue, 13 Mar 2018 08:50:00 -0700 (PDT) X-Google-Smtp-Source: AG47ELuntIkzXNktMM/Ib0rhDLBvWvqIGM14svKQhPk9/T2btIX50Yn2gzd0fcV6uZexbENJ7sAU X-Received: by 10.80.149.3 with SMTP id u3mr1413594eda.212.1520956200305; Tue, 13 Mar 2018 08:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520956200; cv=none; d=google.com; s=arc-20160816; b=UXSkqIJOb7elTgLGeD3GXKnmtVYTHz9LsZdRIox9kJlFA3c16g9B3WRifWqamkvBuk d9DciuxFqp2yWvJVL/HEYRuteri/bM47/G4PIFblT9IS/2wdPyHonmPzEY5zf+1+mY// iM7SEZBbHr5H/NxotvllOVIHbG3r83Vlg1eirbco+/DfNbhzSMs/39PA/3SwclkKw+pp dhz9tRKFC76+kLte871YKnZ4F6TZn0EAYrS2GkI+ZyoFl8pGjVEHBRcdTaEzTHXfHAe7 3hww3VIDBGUtwouVJJHOqHevF30xdRhxx3SmKQ+KOWx11YJK6UFZ4h93zWLhRugmcTdu jDfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=tV4oi4D/rpKlPSrMtKVr/J37nX3G9bFc7jPnGq8ZpXM=; b=gEF+rZxmX1L8ePKnx4BAtmYlaHa0mvoBKJaj2FxHQDvfFmm/nOIU9B2OZN3utEGdcW w6Qya5SLcAkzeCv4ffIMwYGAw1rCJST6yd6hFlk3+7v3JYJ7e5rvMg7D9b3w/pKqkpvB dRTBAjfM/KdOTV/DtZATHmVn3b3pfzjJtMNL66UCWXTlWaV7MtlDl14MiTjt9vyKqEPn q8d2gczf66SiWyeS/1yTQC3/fozCK/Z8rxqsKEpvBohixk5wTvTOKYHO1AqbiS4qxwGf +VClyG5Z6rLhNFfaggTojMzJ9cBYzK1P2Sg9rlApF6knsk2YuKbLNIxIWe0AzVdZ7gVS SHgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Dx5iJdOj; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id c8si295862edj.516.2018.03.13.08.50.00; Tue, 13 Mar 2018 08:50:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Dx5iJdOj; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id DB026C21E0F; Tue, 13 Mar 2018 15:49:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0A35AC21E30; Tue, 13 Mar 2018 15:48:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id ABD2FC21E08; Tue, 13 Mar 2018 15:48:27 +0000 (UTC) Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by lists.denx.de (Postfix) with ESMTPS id C7E75C21DCA for ; Tue, 13 Mar 2018 15:48:23 +0000 (UTC) Received: by mail-wr0-f193.google.com with SMTP id n12so208493wra.2 for ; Tue, 13 Mar 2018 08:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aYWGmNddoYhNWF1oLK56rUV+M/dWXKoSfjRNxyPx/Lg=; b=Dx5iJdOjNlHj5ok0ZCEhpHlQV5ym2CcYLc1cby2PYz20u6LKQOK+eSI4an1gpVMmq+ Hxbjw+R0OfZT7YZSckdTW2c/gCS8h7pySyrDteu9hB5JLP84DzWn3/sXHxCjWa8a5zhF JrfLD+Xn43XREIDbhKPqVmJUrDhUQou9GcAts= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aYWGmNddoYhNWF1oLK56rUV+M/dWXKoSfjRNxyPx/Lg=; b=qLH3Dqvr1p6J1W0Q3oFAreQfho/7tVcHLNzExAUTwLGnKYOPxe56XsfyNa6oy/JGo+ N0P7zcoTyCmT+4Q8FY6MQ9Sm7eW2DM0Y/XHO4XaZyc2s5RaHoOBRwF8DGeP+NeoTQtNb yt3ptEfi/r0eecAsDOIXtWHWk7Qliedcmn6VUf+RcRGNUVVr0QML7IIyPf0FTq4f6i+d BN7bjq5MlyhD1vM7Gg3X/c3z9+OaiqsPvrci12pxnJfIBxwuCTWSQdBAWqGADt/UQE+m I9SwReHW7QBwNgyhhze9HBWFZj6hUHSRAIQKmNcU/VTywrgzqW6pDPz7Eawnw3PYrHwV pExQ== X-Gm-Message-State: AElRT7GBslCYMQJJMs7FM+8HC5S5v7eu+Ey4TNFdoZGBD+/4jjZAJTzh kBK+w84nvMcq44oELGl3aA26Ui1/r0U= X-Received: by 10.80.177.193 with SMTP id n1mr1338423edd.310.1520956103229; Tue, 13 Mar 2018 08:48:23 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id 4sm403616edx.8.2018.03.13.08.48.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Mar 2018 08:48:22 -0700 (PDT) From: Bryan O'Donoghue To: U-Boot@lists.denx.de Date: Tue, 13 Mar 2018 15:48:17 +0000 Message-Id: <1520956098-25261-3-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520956098-25261-1-git-send-email-bryan.odonoghue@linaro.org> References: <1520956098-25261-1-git-send-email-bryan.odonoghue@linaro.org> Cc: rui.silva@linaro.org, fabio.estevam@nxp.com Subject: [U-Boot] [PATCH v2 2/3] imx: mx7: Add comment to describe OTP TESTER registers X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The tester registers provide a unique chip-level identifier which get_board_serial() returns in a "struct tag_serialnr". This patch documents the properties of the registers; in summary. 31:0 OCOTP_TESTER0 (most significant) - FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID OCOTP_TESTER1 (least significant) 31:24 - The X-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID 23:16 - The Y-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID 15:11 - The wafer number of the wafer on which the device was fabricated/SJC CHALLENGE/ Unique ID 10:0 - FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID The 64 bits of data generate a unique serial number per-chip. Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: Peng Fan Cc: Stefano Babic Reviewed-by: Fabio Estevam --- arch/arm/mach-imx/mx7/soc.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/mach-imx/mx7/soc.c b/arch/arm/mach-imx/mx7/soc.c index 1602585..fb92a26 100644 --- a/arch/arm/mach-imx/mx7/soc.c +++ b/arch/arm/mach-imx/mx7/soc.c @@ -202,6 +202,27 @@ int arch_misc_init(void) #endif #ifdef CONFIG_SERIAL_TAG +/* + * OCOTP_TESTER + * i.MX 7Solo Applications Processor Reference Manual, Rev. 0.1, 08/2016 + * OCOTP_TESTER describes a unique ID based on silicon wafer + * and die X/Y position + * + * OCOTOP_TESTER offset 0x410 + * 31:0 fuse 0 + * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID + * + * OCOTP_TESTER1 offset 0x420 + * 31:24 fuse 1 + * The X-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID + * 23:16 fuse 1 + * The Y-coordinate of the die location on the wafer/SJC CHALLENGE/ Unique ID + * 15:11 fuse 1 + * The wafer number of the wafer on which the device was fabricated/SJC + * CHALLENGE/ Unique ID + * 10:0 fuse 1 + * FSL-wide unique, encoded LOT ID STD II/SJC CHALLENGE/ Unique ID + */ void get_board_serial(struct tag_serialnr *serialnr) { struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; From patchwork Tue Mar 13 15:48:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan O'Donoghue X-Patchwork-Id: 131491 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp900734ljb; Tue, 13 Mar 2018 08:50:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELuNayz+kcUJOHe4DJMwMSMe4wqRVGlHPJsnXIAh2fAL+yvmsmQ3pvjlU+DWQJa2tataLK07 X-Received: by 10.80.145.25 with SMTP id e25mr1433163eda.12.1520956256492; Tue, 13 Mar 2018 08:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520956256; cv=none; d=google.com; s=arc-20160816; b=amEf4GD/wnVAF96ybqV+ZVIwLSkuBY2S5Bstdt6FPkAHAnbErnE2txwcq/WPoX4fDS gSBTd82w6Y46MlSapOWflqts74wBZBcKHRvM5ZbABAyWML/36E/7ZA84aTBpyNYwEq9j InDYZC8FNPC52ZrYTmnh9emChocjo5DwqHVV5mKrCC/VHjw3xHCvnJsuh1vb/E0G6Ojl +KtACzMC7vQApr4kC0tqMn2r/W9bUzqWFdLKMRjnvPyeuG9gTmvE4aP7H8HiY/hDEnd/ OOHB/4G0XmBVcQIA65I+pahsmZy+Wva1XSjA276e6VEdjkofOkraDKyPknktjG1lsC0T mSGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:dkim-signature:arc-authentication-results; bh=d/ScQsFYp385loRm1sgWfIOHItqZCTFmZVPTjKbPFWk=; b=Bp6Rk+Nb6kA68wOWJJI2vd6DSl9w5NpWbRDLbxsDU/+mvZMMDiK0AQrl+LVWeBxosq jREfgU/XrckVHa9/zcyn/Mr1Exd117zzDsnDtgQO7MTy30+0k/lXUDuSTJZ4ZSeX8AD+ ++vJ13s053IAFImGrpL8rD2NgDqdxSlXuemBxzWOxYqJCgvDQb/KEDP0aUO3k0rtPwdO mgjGtOAfYfsy3Q2LBZM03EIBp8qAw0ycoUxGpFHX4a1shAUBAyO9ILGVtIBNNgwVYhb8 mWzOIs+OiTdDlk3mGv9v8+iiVqKFGyTt1gzQjZOoPWEMMuwG3LQqnYJ9F+uzUdG1GhoY 6t4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BOc4UbXy; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r1si275652edc.483.2018.03.13.08.50.56; Tue, 13 Mar 2018 08:50:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=BOc4UbXy; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 11C94C21D8E; Tue, 13 Mar 2018 15:49:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 04B6DC21DAF; Tue, 13 Mar 2018 15:48:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AF47AC21DC1; Tue, 13 Mar 2018 15:48:28 +0000 (UTC) Received: from mail-wr0-f196.google.com (mail-wr0-f196.google.com [209.85.128.196]) by lists.denx.de (Postfix) with ESMTPS id C4D16C21DFF for ; Tue, 13 Mar 2018 15:48:24 +0000 (UTC) Received: by mail-wr0-f196.google.com with SMTP id z12so195320wrg.4 for ; Tue, 13 Mar 2018 08:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KmPngDoH2lGRLfsGFUxdpfkGT0tNQYOIVJsammr/hpc=; b=BOc4UbXyex9BSwHMJJTlsdQg88gDdoi6J7RNyivy1dLNXyX0Q8bIcuQaOaGD5fRtKQ TmGeSYRQ91Q2wD3ud/0peEdTps1EXVUgJpOH/WG3pg9FDTggivWBo6VakvvOEuzTpuhN fWDE7AsxJDXgSOKTV3xQ/cqpkgOZymmYQXIy4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KmPngDoH2lGRLfsGFUxdpfkGT0tNQYOIVJsammr/hpc=; b=mULecT/P66WJhvIjQZRZcV6iRxU2YiAC8SjD3nEWKRv/jP+xTEFvof2le8Wpsn4mu/ yfkdKEYKQOglOZUW10IeoFkRn+9DKNArhegDdUFw0gn/NnT0iDeXvVTh25e8haPsL5Rl apS92wKZ94pUTaN7kX5KwAFEu+OF4h2xkZMPZyq+/dSBV+7ACBAWYGgFVFJzVbBqDrGK ZKFVuywZxwUz+8lRJg5qv+uRwqyyRQUj0Jt23b8CMAJbpW2IGhlgiZXKxUdVlKE0SHwT VuR6Z61ZWotFnNf8T5dXb2vpsQ0ZFSWJls5zXYHFIsVaqKAn4GGFqDfPswY6geh638ZK eKxQ== X-Gm-Message-State: AElRT7FnzWFWosJXVgOv3l9Gkzc98Glv1QxaklOyPAzSYA0QPRHTjyTQ q1JwQahW6M/6paL9aAkmP3WRtLeUdxU= X-Received: by 10.80.170.222 with SMTP id r30mr1344041edc.309.1520956104219; Tue, 13 Mar 2018 08:48:24 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id 4sm403616edx.8.2018.03.13.08.48.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Mar 2018 08:48:23 -0700 (PDT) From: Bryan O'Donoghue To: U-Boot@lists.denx.de Date: Tue, 13 Mar 2018 15:48:18 +0000 Message-Id: <1520956098-25261-4-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520956098-25261-1-git-send-email-bryan.odonoghue@linaro.org> References: <1520956098-25261-1-git-send-email-bryan.odonoghue@linaro.org> Cc: fabio.estevam@nxp.com, rui.silva@linaro.org Subject: [U-Boot] [PATCH v2 3/3] warp7: Set u-boot serial# based on OTP value X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" u-boot has a standard "serial#" environment variable that is suitable for storing the iSerial number we will supply via the USB device descriptor. serial# is automatically picked up by the disk subsystem in u-boot - thus providing a handy unique identifier in /dev/disk/by-id as detailed below. Storing the hardware serial identifier in serial# means we can change the serial# if we want before USB enumeration - thus making iSerial automatic via OTP but overridable if necessary. This patch reads the defined OTP fuse and sets environment variable "serial#" to the value read. With this patch in place the USB mass storage device will appear in /dev/disk/by-id with a unique name based on the OTP value. For example /dev/disk/by-id/usb-Linux_UMS_disk_0_WaRP7-0xf42400d3000001d4-0:0 Signed-off-by: Bryan O'Donoghue Cc: Fabio Estevam Cc: Rui Miguel Silva Cc: Ryan Harkin Reviewed-by: Fabio Estevam --- board/warp7/warp7.c | 14 ++++++++++++++ include/configs/warp7.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c index d422d63..327f656 100644 --- a/board/warp7/warp7.c +++ b/board/warp7/warp7.c @@ -23,6 +23,8 @@ #include #include #include "../freescale/common/pfuze.h" +#include +#include DECLARE_GLOBAL_DATA_PTR; @@ -186,6 +188,10 @@ int board_usb_phy_mode(int port) int board_late_init(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; +#ifdef CONFIG_SERIAL_TAG + struct tag_serialnr serialnr; + char serial_string[0x20]; +#endif imx_iomux_v3_setup_multiple_pads(wdog_pads, ARRAY_SIZE(wdog_pads)); @@ -197,5 +203,13 @@ int board_late_init(void) */ clrsetbits_le16(&wdog->wcr, 0, 0x10); +#ifdef CONFIG_SERIAL_TAG + /* Set serial# standard environment variable based on OTP settings */ + get_board_serial(&serialnr); + snprintf(serial_string, sizeof(serial_string), "WaRP7-0x%08x%08x", + serialnr.low, serialnr.high); + env_set("serial#", serial_string); +#endif + return 0; } diff --git a/include/configs/warp7.h b/include/configs/warp7.h index fe96988..0c3b605 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -24,6 +24,9 @@ #define CONFIG_SYS_FSL_ESDHC_HAS_DDR_MODE #define CONFIG_SYS_MMC_IMG_LOAD_PART 1 +/* Switch on SERIAL_TAG */ +#define CONFIG_SERIAL_TAG + #define CONFIG_DFU_ENV_SETTINGS \ "dfu_alt_info=boot raw 0x2 0x400 mmcpart 1\0" \