From patchwork Mon Aug 5 10:32:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lyle Franklin X-Patchwork-Id: 1142136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bwwUuTvG"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 462Fm760z0z9s00 for ; Mon, 5 Aug 2019 21:24:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 908B7C21BE5; Mon, 5 Aug 2019 11:23:37 +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=FREEMAIL_FROM, 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 EFC3FC21E16; Mon, 5 Aug 2019 11:22:09 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EFDC3C21C4A; Mon, 5 Aug 2019 10:33:08 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by lists.denx.de (Postfix) with ESMTPS id 6B075C21BE5 for ; Mon, 5 Aug 2019 10:33:08 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id s22so59703422qkj.12 for ; Mon, 05 Aug 2019 03:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wG/saRy+LubP5vgzmpFtb/8TzgLjM9vGB0tjoucnqac=; b=bwwUuTvGOHmO5w64zqA7+vA6FfbzESccXWZEiUY0t1yR+ztZr1YE4ICnWrGd6iR1GS 8JE54rh/cibRh0gde/wlKVSL07hgp2dF/8dlPlx2IYsRVnZoQjAhcsJq6LnMPRf/i5oP GNBwn/Rn9hvItY12WXrVUTnG/cx9Ry5qXpWpHJzMY2RYFrVBUxEeI6fFCCwWUbL7h/fa YPSjdVsloQKop6CGMGDi/u9/L172xmyaWd/ICJ6jEQmAcn1RXTgkT8BZZXY5cYJH+GI9 zo65VoJfJKCNdIbvX78hgnLnrf7FKEbNpT0yoT88Hv1Xa56qtyMpxmc2ie0Pwx3V4a5K ZRcw== 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:mime-version :content-transfer-encoding; bh=wG/saRy+LubP5vgzmpFtb/8TzgLjM9vGB0tjoucnqac=; b=lFbU5RcA8Ocfj6qmRaSg963PgizBiHHSlFLZIKgFo/s8Z0JttnjBIFKS69jGFfpWnO B9D3CQfPwSLw5tPouFB0+VDZjCtg0ahhARUxcaSuAdT/xo/6Y88W1RP6XGPuXl8InKdU s8o/H/TY2UzbiQ0NrNqYKuN32gHqylRLGsvGcQ1Q+O6U/Ok7vJlVlzVWvmStDv8Jue1G N0hcwCNuxADNNhG6f8ffeycnMuCjgCaOQnyRpXSAhBTBFMuVB6tf8Z+3GE1M2StFhaup fMaXvopwcX/OX+sNetisIpsxTv/ZmhlEJG8g/8gSEkGfwv9u+GIgUcpprUyfEGU9/kJE 8+8Q== X-Gm-Message-State: APjAAAUK0jlPT7pgZDdDajaRNEVJL5Kk6cHHxjcLkHhmEPwTqSFDRGzV qlOh9J+poXyJ0unQ8/F5G9DWw7XXZUw= X-Google-Smtp-Source: APXvYqzyVm8YJZaTJGAJUAZwXThPUg57QYVvcjgbIiBXQ0yYLtLTG0iqgm5qmmZb0WOpox00cPlo2Q== X-Received: by 2002:a05:620a:68c:: with SMTP id f12mr101117589qkh.197.1565001187058; Mon, 05 Aug 2019 03:33:07 -0700 (PDT) Received: from localhost.localdomain (cpe-74-64-200-84.nj.res.rr.com. [74.64.200.84]) by smtp.gmail.com with ESMTPSA id x23sm33530721qtp.37.2019.08.05.03.33.05 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 05 Aug 2019 03:33:06 -0700 (PDT) From: lylejfranklin@gmail.com To: u-boot@lists.denx.de Date: Mon, 5 Aug 2019 06:32:58 -0400 Message-Id: <20190805103258.19464-1-lylejfranklin@gmail.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 05 Aug 2019 11:22:02 +0000 Cc: Matthias Brugger , Lyle Franklin Subject: [U-Boot] [PATCH] Adds `serial#_trimmed` env var for RPI boards 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Lyle Franklin - The `serial#` env var for Raspberry Pi boards is left padded with zeros in order to mimic the format of the serial number in `/proc/cpuinfo` - Unfortunately the Raspberry Pi bootloader which loads up before u-boot does not pad the serial number, meaning that some boot files are requested from 123456/ while u-boot requests files from 0000000000123456/ - Although a bit adhoc, adding an additional `serial#_trimmed` env var for the RPI board allows for all boot files to live in a single directory Signed-off-by: Lyle Franklin --- board/raspberrypi/rpi/rpi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index 617c892dde..678adff482 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -389,6 +389,9 @@ static void set_serial_number(void) snprintf(serial_string, sizeof(serial_string), "%016llx", msg->get_board_serial.body.resp.serial); env_set("serial#", serial_string); + snprintf(serial_string, sizeof(serial_string), "%llx", + msg->get_board_serial.body.resp.serial); + env_set("serial#_trimmed", serial_string); } int misc_init_r(void)