From patchwork Tue Feb 27 20:05:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 129852 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp214803lja; Tue, 27 Feb 2018 12:06:23 -0800 (PST) X-Google-Smtp-Source: AH8x226ubQb3uCHN0zocg6x8V0i6jcu1QW2Dzrz0sR8ba9QO8QtKjoXykq2iIqiMVmH7RcR6NRGE X-Received: by 10.80.172.44 with SMTP id v41mr20375851edc.130.1519761982901; Tue, 27 Feb 2018 12:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519761982; cv=none; d=google.com; s=arc-20160816; b=k7zpHfZLqDRib+A8CV9anWU3B81amR9Cd59rECqsgQ24p3Vdjjt5byySnK6M0TML+7 Akf0c9PxJm2PVRw8/D8/UYnSLvno9zRJbNoR4FSn4yap/sklmtZM4W19JpZmm7znOcMn i/WQsa3KklvWh8GQw+Kv500sfumF8luzB678P/PkbK+5G6xL04+4QpfWJ0Gv0wpzEZq4 geS0yXkzi3riH5BfIZy3kh+nhn04z8JumBQRsU/B4yJvI06tI2i/Pw0VvpPqDOa5V2fZ w9szqeHmuVh6mFsh79iUnze8EZRwOZgqi1OVkTCkE/w/04m+HdVpJlTe1cUPQKcAmbMm oxcA== 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:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=AuHaQWNjjWMdVs7FgB65UvwRK/Di5BXbty80gseZ1eM=; b=FXN6RDGQluDgo4X9txqcoNJ7ZHD+4b1NFHKlVwVAIec/TVK86XBFuoKIRheW/m4JkN fSz/4CcQ3RpTnXi56EKyaoKJJx0W9p7xutl3gqP5NcGOByGvO8B6zCNzhWU6ZDhNRfej 3pECJPfdWl7EIIu+79YIyIK1Q0LvgZHPqPI3kuRJvAnK1vQSf8Ur1Jz0QyCGcZfl0UiV mxlfQnIkTABOs7qMK7x1lrIqvg3dle6fVLr57ayFnY2jPAuP92Malz1Z79rDzi8XFcit v8bop7AWYE79q8C+q/beuV5xb/WSBtaZNY6GBjk8VikIqncuPwMNM4A5HD9p9aLaZ7t0 Jwzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=gooxNIs4; 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 q11si222117edk.47.2018.02.27.12.06.22; Tue, 27 Feb 2018 12:06:22 -0800 (PST) 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=gooxNIs4; 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 54715C221B0; Tue, 27 Feb 2018 20:06:13 +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_DNSWL_NONE, 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 12EAEC221D3; Tue, 27 Feb 2018 20:06:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8C766C21DCA; Tue, 27 Feb 2018 20:05:49 +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 CE057C21F78 for ; Tue, 27 Feb 2018 20:05:45 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id v65so42396wrc.11 for ; Tue, 27 Feb 2018 12:05:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=fuMDtNEbqc7zkGwgFoKkAkLJDapyef5UvFdCjOC6gtw=; b=gooxNIs4j4Tfh7+59kMndGivlyVPDsVhxoGc/CNAvm8IqAbEtePRInq1aobiXJvE3t PSHECBw3c6MdcrIiOb8j+grC9+fHwQ4Id1vOTIJd2J4Jizz5Wap62tfzKQ8zVP1tcbz2 fudZxLaEwHy/eku6xX5RdyFyMojFHwDRr4kiE= 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; bh=fuMDtNEbqc7zkGwgFoKkAkLJDapyef5UvFdCjOC6gtw=; b=ew9Clu4tn2j7KZpnmx3Q0XdZekd8POq2/JFMo31/b6GRtLR/gQ3Xf832Uh8hCyd2Vc Cj326QJCtljHUJa1dUEeSqjKT14/W5M0DrV69a3Hh+lKznveoEUgi5bInxL/MvujVdVT hObAn3BnkB0fEHbdWFVsRO+lit27PlPyihTaOK4IOrS7ijchQUKfb5AzjOaBlUDv75Gq MpBTsMQFSwRNpnXomPbYGZ+Mb0AeveCU9mYkIV9rxbtxQEG8+kUVRBIKpBuAmkyLPg8+ +JaNKx1KlGx9gvwC1JKCgB3xl02IVQHN3oXzP5u3edVfye7nXYnRyAKwJpLwKqWHa+ae q8BQ== X-Gm-Message-State: APf1xPC1R6ZLcokK5nmg8fQb7/5fqS9UPIO5/7FpdpNdh2BIu7E6eWvL e2LNQ0AgL+P8CKPMk9fTDIN6BojHQts= X-Received: by 10.223.164.14 with SMTP id d14mr12470466wra.182.1519761944988; Tue, 27 Feb 2018 12:05:44 -0800 (PST) Received: from localhost ([195.238.92.76]) by smtp.gmail.com with ESMTPSA id c1sm10929825wre.10.2018.02.27.12.05.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Feb 2018 12:05:44 -0800 (PST) From: Sam Protsenko To: u-boot@lists.denx.de Date: Tue, 27 Feb 2018 22:05:43 +0200 Message-Id: <20180227200543.2367-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.16.1 Cc: Tom Rini Subject: [U-Boot] [PATCH] board: am335x: Set serial# variable 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" serial# variable is needed to show device correctly in "fastboot devices" output. It's useful when we have several devices (in fastboot mode) connected to single host and want to choose which one to flash. Reuse board_serial variable (obtained from EEPROM in set_board_info_env() function) to set serial#. We can't use omap_die_id_serial(), because AM335x lacks DIE_ID, as can be seen from AM335x TRM. The other available option would be to reuse ethaddr variable, but using board_serial seems more reasonable for this purpose. Signed-off-by: Sam Protsenko --- board/ti/am335x/board.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 1a52bffc00..4d421697bf 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -732,6 +732,10 @@ int board_late_init(void) */ if (get_device_type() == HS_DEVICE) env_set("boot_fit", "1"); + + /* Reuse serial number set by set_board_info_env() (from EEPROM) */ + if (!env_get("serial#")) + env_set("serial#", env_get("board_serial")); #endif #if !defined(CONFIG_SPL_BUILD)