From patchwork Mon Mar 26 14:27:32 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: 132412 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3912174ljb; Mon, 26 Mar 2018 07:28:52 -0700 (PDT) X-Google-Smtp-Source: AG47ELsAJHrd89hGePnLd3fxg1yYXoIaR+VrFakp59wUYu1pZLUwWs8bNnKmM+KmErZP+xI4584K X-Received: by 10.80.135.68 with SMTP id 4mr27875077edv.11.1522074532401; Mon, 26 Mar 2018 07:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522074532; cv=none; d=google.com; s=arc-20160816; b=HXSjF4q1IDPW1KegkX4si89DN5iG5JDr1IpnpXC9snNgLv49MFEsJqXMmFIpvbfDf7 GddVzyuxttDwW29ADBo1HNKb/Ed+wq2U7bfa7X7w4GK7sf7In2P8IxapmwCA6EwYiyMc STN9EOtmGLhCq4flcCAh7cZT2qgKfSXd+/RLqdWKhmkV1gswThUn4EwYVqBW8xoodmi0 IeNEAjc+iIuxaVJU4hI52KVkEBDVMapWt0cPHrsvEOJ+sW7DttpSvZ/KExh0IbtxG0xx oEL2HtidZBaH03wtJaMjTrAmuo7gFnCKWAWoE5AwWGJe/W7LjOygmLITt8uFjwIWlrFv /ZkA== 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=5kaQDGLQKHmy0gMZ7ow0Abhs5V1P6rgyaMEh7WaRekU=; b=gCxIWtetHP/DJokKzExbcwiWuJvlfUrFuxNftzSC+iTbxc1zXVjgS67LLLe4iE2ukg bO1hW9vrW+RAHlGjVodo+Up7aJ45rPFiWxSPbouq9P/Gkftab+MMnJ9YHDSKEGxm4Ptp s9JncJkFVuPjlitKeizOaciiWq3Gxkw3ALbMJKAzU/Yqj4Grui74OmTzaUlymZTbSb/f lL8U+bc/Lq+sSkjb1ARL/qGA6urCIJOGdGFC5UJhuAiTpVsvio3waA/P7MweDz5WGFPi aY2kG5w0R9viwRkvjvK4qvfbcGnC92VSZoXAcrj2G8HjdDgyCdHyInzRwNbPbG4cKTui 7JVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DjW7+mwD; 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 p34si9030053eda.49.2018.03.26.07.28.52; Mon, 26 Mar 2018 07:28:52 -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=DjW7+mwD; 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 DA912C21F3C; Mon, 26 Mar 2018 14:27:57 +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_H3, RCVD_IN_MSPIKE_WL, 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 45C17C21F58; Mon, 26 Mar 2018 14:27:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 29781C21F38; Mon, 26 Mar 2018 14:27:39 +0000 (UTC) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by lists.denx.de (Postfix) with ESMTPS id 7AC2FC21CB6 for ; Mon, 26 Mar 2018 14:27:38 +0000 (UTC) Received: by mail-wm0-f67.google.com with SMTP id r131so9047286wmb.2 for ; Mon, 26 Mar 2018 07:27:38 -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=DRSqz1FlNLCyip9qLBOehDctRZRepioPl2ofIev1tZ8=; b=DjW7+mwDxGsWodpLtPkupR5uLcnHTnSIM+8/z4z+HNpf7N/yDNqaLaBJozRA8JiBXH PWCZKq8484TJasKjphrRN+D5c56qLYAMV+JjOQVbxFPT6PNCaQHt5bleeaVS/+QutDxe kohaY0B5L9DWC1rXrA6W0i6yaNu+CfOiiFQ9g= 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=DRSqz1FlNLCyip9qLBOehDctRZRepioPl2ofIev1tZ8=; b=HhNH2JD7aDdgrTZGltdjeWm1Yd7DAn85Bv8zsgtJZAD5FKCek0nTHhKuaOKzqQGdw2 MvFnUhwEXXMKzsfJb6SPF19Hi6D2yQvmjQSZHpmQDeuxL6EUuzBt4C2UrbT7WlF9ntHT SiO2GR5HU9mlcZGiY1GLfs06ZvUuUzzxERYh3GL7gWB61xCc/CocPYK9btIP62pke1v7 HfBByh2FWtSvLVHAqBQfL6rPJ3ojNM/EADIrLDYxWtU2RSOmNpDr1qQw5OVbJFBFEFmS K3EkgFQMbxxuEIA6x7teSo3NxvgBWzG8rCSos+H5NjjtSmpRy8jIFIiq8RFedn3WFZfO wrOg== X-Gm-Message-State: AElRT7HsjNYcG/Ea7mNpO3F1dQvdH2FEhgm4PrCakL33w9jTxLQAiC9L 4vruUxWCY41u2LLBFCCI7CLq0UTUPDA= X-Received: by 10.80.139.141 with SMTP id m13mr40284548edm.164.1522074457825; Mon, 26 Mar 2018 07:27:37 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a88sm10338634edf.64.2018.03.26.07.27.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Mar 2018 07:27:37 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com Date: Mon, 26 Mar 2018 15:27:32 +0100 Message-Id: <1522074454-16643-2-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522074454-16643-1-git-send-email-bryan.odonoghue@linaro.org> References: <1522074454-16643-1-git-send-email-bryan.odonoghue@linaro.org> Cc: rui.silva@linaro.org Subject: [U-Boot] [PATCH v3 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 Mon Mar 26 14:27:33 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: 132413 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3912645ljb; Mon, 26 Mar 2018 07:29:22 -0700 (PDT) X-Google-Smtp-Source: AG47ELsluKPrKAUsMB4McBfTaY2CIKLpMTHbdx12xsr7wBtt9xRIIlqpBobvbkwt+j+ZtynqbZpm X-Received: by 10.80.208.138 with SMTP id v10mr17649932edd.182.1522074562362; Mon, 26 Mar 2018 07:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522074562; cv=none; d=google.com; s=arc-20160816; b=voa5+N2+edwxXKsjKIvhMMZgTki6lGIDLHC9dkVsc8TlW1wNUROK2wzUMu6sOQQMn6 AzLNuuqH/pi+mTc+weArtcsAyHyjuDnvjWX0wkm4wqu8Kijuip0xx0nKzbVLokq5IkAz rES12lFnqcPgB2ZCimwHlk9X4Rk4SaALdvsdcWJPVLyBr0lVjwMrwH4v+NK7kLyX1Fwd pGEZlDpvwUUNUvqsykCHG0yunrCEh5ybi2AThBRNEeyVRWCaqVivb9pu7KOKdB8k4Erb eASU3RiJyzzerhEgpB+gibGgsxbRJkDBTXgCpC8wUdLEJd7z+G5BE1MSE5JEBKrFOyqO 5dvA== 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=32vnPTsfS/+on5SmPlBXkf3roehVKbdKOIKl1oew2zw=; b=WOgfgUiHefVNRiCk2AAm2uelUpgtlfnh2QpZ0a71fAo+KX5d/KE0i4vE0OfQcKFD7e Y4rqTnX/y52Wnev2dE6VHW67lUX5jhm80OGjXArXcSkLumrAuOuDPDlpyxkduPnfuzA3 xXqR4EbWWmT150/ELBqj+h0ofpa7Fq6Efzbnf1C+OZg1kyaqaf/2xRWmoq1IHfuknAUz lMiNq1ApTuuy4hEPLR0uWImIFMX2mSfhR7Rxkbd1pL9fsPXT6NFAoD/qrEmQ26PlVc3N XvIuJkYjD30gk8Y/E3V59emoV/L85tg/1yCnxalOWkAABDBXTPFhkZI04TsJhC8leERg p0aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=fAAhlu3c; 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 d92si2789057edc.231.2018.03.26.07.29.22; Mon, 26 Mar 2018 07:29:22 -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=fAAhlu3c; 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 DEE0AC21F1B; Mon, 26 Mar 2018 14:28:14 +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_H3, RCVD_IN_MSPIKE_WL, 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 248D3C21F6D; Mon, 26 Mar 2018 14:27:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4A32EC21F1D; Mon, 26 Mar 2018 14:27:43 +0000 (UTC) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by lists.denx.de (Postfix) with ESMTPS id C66ECC21F1D for ; Mon, 26 Mar 2018 14:27:39 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id p9so3327770wmc.3 for ; Mon, 26 Mar 2018 07:27:39 -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=3F7e6WdTiSUuglgtHevNnLtl29Sx12NK4gYUNbq9peI=; b=fAAhlu3cVCZyrRQv4QAh6nEtytFxyZ7Ks81w1RIdL/GmYln57/IjUpN3XPvRG7clYf xv6S6/nJW26R4257qBLhpYNNUn2u9N9RgfvSVXUJWcyFY7l88UUxRAut7sbekdO0pgad LOrB8ebMu36CMShRscRgrzXJEtNxO8FZEmmuw= 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=3F7e6WdTiSUuglgtHevNnLtl29Sx12NK4gYUNbq9peI=; b=d7wzrZPelDMppBSpCrsn6ymAQuoPWyLFB6497u+auDc/JCUauCwi5r4y7Qx0VjkLSI qHlqI3ditm6i+LIUNDz2cAmVrhozuF/Fn/7s5kb/2w8UtX0U04LHaAnFJ46Dq97jGTVH mW9jSsCq2C67GEAxQ4CboX4/HJEbjaHb0t5vBwrAxb1jvy0iF6b7IYn4lXz+NbIk9rDb Vbfu9E8szgna1y3I0yYkapDll/+COWRr97hYDQbTy7hf2/VBY4kG/Ov4DtVSx1s5W+y3 kazWdpMpVkQATrNP5CAACT8ZFYqLOAxfCG6RGMC23y0MZZSdgbksHSOxPBPpwKiDWPlz FG7A== X-Gm-Message-State: AElRT7GYeM7NGyiNZ6H5wz0u2M89TGsMZyCK+YSzMmg0umM9/Axyd24W ZdcYpx1hMOgQtq2Dto2m2sOPgR2h92U= X-Received: by 10.80.187.75 with SMTP id y69mr41128585ede.251.1522074458927; Mon, 26 Mar 2018 07:27:38 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a88sm10338634edf.64.2018.03.26.07.27.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Mar 2018 07:27:38 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com Date: Mon, 26 Mar 2018 15:27:33 +0100 Message-Id: <1522074454-16643-3-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522074454-16643-1-git-send-email-bryan.odonoghue@linaro.org> References: <1522074454-16643-1-git-send-email-bryan.odonoghue@linaro.org> Cc: rui.silva@linaro.org Subject: [U-Boot] [PATCH v3 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 Mon Mar 26 14:27:34 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: 132414 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp3912711ljb; Mon, 26 Mar 2018 07:29:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELtqFBnwjg0HGJ1jemYUtmN3yeQd2I4eW+VSwKHkbPPYEogdPlBITm20D1xZAufv8S1GxN7s X-Received: by 10.80.145.111 with SMTP id f44mr35365130eda.29.1522074567659; Mon, 26 Mar 2018 07:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522074567; cv=none; d=google.com; s=arc-20160816; b=bjU01G1uLJa0B29Na/7wfhTaPm/z5PljXZhSwkoxt8M3oOuwfC2mQBWpT+a4ZiOoGS H+BIyR2AghznOfY5dvvqh4RqHG8gbvyAdlqhL++TQn1czayKFVBDrgNkFp7FmLujcrTx e/eMTTI157N9kgGxkLdRZNMXZ2N6peYlgsW0FeWUxa7cxnpbjRtbAnmhOXfMHhXRQZ00 pJmKHBBx1KnNv127zSHj/tocM0fayCwAUUHDL4fwWi53ZZjqCcqHRop9kZiKGSNmDPWJ XSTUzMpYn6zkvJCMvdKWOLLwMPq2g7eip6TvJNGUJutYNFuLt/9TgsdLgYxpbxterw8S tE8Q== 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=uTH6f/tyDB0O/CR1Y0mmkQS1I+sX139Ys9DefNRkNow=; b=dG632RCHMyXglMNNyXQ4Zze7NU+ZbeoZK+9Aqp4CJu35TSsndXg0GeF3LLJuYKZ/Os MdfnjJARygDrMoQU0neZoT22m7n92wReOky5up++qvnZ9KuBcHXWRAWHEoepzhwnczCA m3FmVUzGjdQ//0sHzZCeoCCvDdfdJhwEeRNUWAHT8UP5G3UswBkG7sdPL6kYTfNBlYnM Djl0ujxeNxJkX2qpHrs0akSn1xuNxxJRtymuAowWlsTzB8N6arxxUyi03I+RrIje+nyb oZwf5tA970M4vNK6rdDy+TcXZyjsOmNBwbK1VhZfLD+QKTf/LY1yd88YmOGcZopt/kdR /GEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CMJlZG6v; 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 a22si1106235eda.495.2018.03.26.07.29.27; Mon, 26 Mar 2018 07:29:27 -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=CMJlZG6v; 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 3849CC21F38; Mon, 26 Mar 2018 14:28:31 +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_H3, RCVD_IN_MSPIKE_WL, 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 54F14C21F4A; Mon, 26 Mar 2018 14:28:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8C187C21F58; Mon, 26 Mar 2018 14:27:44 +0000 (UTC) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by lists.denx.de (Postfix) with ESMTPS id B485DC21F05 for ; Mon, 26 Mar 2018 14:27:40 +0000 (UTC) Received: by mail-wm0-f65.google.com with SMTP id l9so15862246wmh.2 for ; Mon, 26 Mar 2018 07:27:40 -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=eU+s2/Pf87pQxU+vxjyUhYogcC4cYGfV16nIAxKWcRQ=; b=CMJlZG6v47ElQVR1yZEWvFsTidcQF29EtnV/AjAMHMCCvV0/7MN27H+owfVjtkr9+v rpw8utrHN8jvUTztzd+/69cG1qCfeFatGahqZ+0p8KLhrVVbL5nKdoWD2C77ZiJ2tvb5 WBD4ZHqCWxWP3F+eIst31PgSwU1/kOtI5yy8Q= 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=eU+s2/Pf87pQxU+vxjyUhYogcC4cYGfV16nIAxKWcRQ=; b=fgwW71y0UodmQgxUzAhjauSH8O6Jv8p6OhRzuRFXb0Amg4tU15dFVF2PebNTCw1Geu 6FOQ2+169f9hYSoRIsbbREY8t8zt8ia+HIncWUqtE1n6ZIDsrzfBxfRB+CVhnpi64JPr 3Yxag3Gv+KKe5kpe5wCjJmivTfhaEr6+xh0i2pjMFY51ieqi6GGbE0KIjVPqlRaiN0T+ gww1w9rsYm/Vi4I3YmfaSFepWalDMhXwRGP711tBgpkVSPpp3RysNWWdUjpSHF+JtksP KD6vg6o/CFQ+GOyAZRBwij9mGcI7ePkb9m1qWZhJg6PAzo6LF8ywEvRaUAJ/VsXqbOMJ mffg== X-Gm-Message-State: AElRT7EMNOH3jPq9Z0+WdTVNQ6zqU9P2P51cCrdM+7+JpQfZfd30YURS 31RRM2E7kMdZl/po+VSskGEskQ4piuk= X-Received: by 10.80.146.97 with SMTP id j30mr35424997eda.134.1522074460030; Mon, 26 Mar 2018 07:27:40 -0700 (PDT) Received: from localhost.localdomain ([109.255.42.2]) by smtp.gmail.com with ESMTPSA id a88sm10338634edf.64.2018.03.26.07.27.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Mar 2018 07:27:39 -0700 (PDT) From: Bryan O'Donoghue To: u-boot@lists.denx.de, fabio.estevam@nxp.com Date: Mon, 26 Mar 2018 15:27:34 +0100 Message-Id: <1522074454-16643-4-git-send-email-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522074454-16643-1-git-send-email-bryan.odonoghue@linaro.org> References: <1522074454-16643-1-git-send-email-bryan.odonoghue@linaro.org> Cc: rui.silva@linaro.org Subject: [U-Boot] [PATCH v3 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" \