From patchwork Sat Aug 24 13:22:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152610 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XjHdb1M5"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzZh5YH4z9s7T for ; Sat, 24 Aug 2019 23:27:08 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4274FC21DB5; Sat, 24 Aug 2019 13:27:03 +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=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 5C4E0C21C3F; Sat, 24 Aug 2019 13:27:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D35B4C21C3F; Sat, 24 Aug 2019 13:26:59 +0000 (UTC) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by lists.denx.de (Postfix) with ESMTPS id 43521C21C38 for ; Sat, 24 Aug 2019 13:26:59 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id 18so26618479ioe.10 for ; Sat, 24 Aug 2019 06:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7DtfXC455ScZfj3ge/ID0VPA+iZE/nX4m3x0YLDBpYU=; b=XjHdb1M5KOW17rRlCaWLosbKeVNGuWYsz2z9GJ95dMrkRpo2eURPfTMeZlp7F3DA37 KdWNb2h//qiVLorzNyBjZwc4RianPg3vHUmhjs/utUcxqysag7jT910iwh/vPZIDr6gR hp4Bnaar6i55IdoF4KKh1gIS3LVAr3S0IpoG8= 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:mime-version:content-transfer-encoding; bh=7DtfXC455ScZfj3ge/ID0VPA+iZE/nX4m3x0YLDBpYU=; b=rTep3GccI7mApMJCw3MJhclbyC7nEX4zFxqxXURf4anR51gAZliK6bUS9OkxKuWHnV v9Pu4AkjSPsxpK3l0fP01R3m74oBQoFvWP2/XXzSCg8Kf2Llq0HUQYcPcXP6E4DM+1pj S94SFZvWk5VTcYSU/bPNDaSw2PYod9Vdg6KEx+0wemdoOMmNFlDA68klFZYhq1B6gu9L s3/oct0kJ20PL89t7YdOpwQoXyYRvTQqr/Zq3Wuk51DRe17lCrHSor35kOQHnOrhp6Wb MOkQbOBsHPgARd32W+yZEkeiaUVlJKuqbGZbu78Fo8bs+zLbCbpB5JHTr+w4Rw+283Yq BCoA== X-Gm-Message-State: APjAAAWl2qnw37mhjjOfJCGthlBnRT0dKVVyvvjDxT+H+hGKwvSOrI6e BZORHKSKyC5Pix1PXaE0FTLY28F4fcs= X-Google-Smtp-Source: APXvYqza1ctkngiSDpzoop34sRXGDQbya2+5TLJgqqV3xZIRlmxMW8pIr4lS4IgeCfehdDYMsVBgsQ== X-Received: by 2002:a02:b713:: with SMTP id g19mr9666622jam.77.1566653218029; Sat, 24 Aug 2019 06:26:58 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:26:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:41 -0600 Message-Id: <20190824132315.53130-2-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 01/34] patman: Drop binary parameter 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" Since cros_subprocess use bytestrings now, this feature not needed. Drop it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/patman/cros_subprocess.py | 3 +-- tools/patman/tools.py | 15 +++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py index 06be64cc2c..0f0d60dfb7 100644 --- a/tools/patman/cros_subprocess.py +++ b/tools/patman/cros_subprocess.py @@ -54,7 +54,7 @@ class Popen(subprocess.Popen): """ def __init__(self, args, stdin=None, stdout=PIPE_PTY, stderr=PIPE_PTY, - shell=False, cwd=None, env=None, binary=False, **kwargs): + shell=False, cwd=None, env=None, **kwargs): """Cut-down constructor Args: @@ -72,7 +72,6 @@ class Popen(subprocess.Popen): """ stdout_pty = None stderr_pty = None - self.binary = binary if stdout == PIPE_PTY: stdout_pty = pty.openpty() diff --git a/tools/patman/tools.py b/tools/patman/tools.py index 0d4705db76..97441ca796 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -186,7 +186,7 @@ def PathHasFile(path_spec, fname): return True return False -def Run(name, *args, **kwargs): +def Run(name, *args): """Run a tool with some arguments This runs a 'tool', which is a program used by binman to process files and @@ -196,7 +196,6 @@ def Run(name, *args, **kwargs): Args: name: Command name to run args: Arguments to the tool - kwargs: Options to pass to command.run() Returns: CommandResult object @@ -206,8 +205,8 @@ def Run(name, *args, **kwargs): if tool_search_paths: env = dict(os.environ) env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH'] - return command.Run(name, *args, capture=True, - capture_stderr=True, env=env, **kwargs) + return command.Run(name, *args, capture=True, capture_stderr=True, + env=env) except: if env and not PathHasFile(env['PATH'], name): msg = "Please install tool '%s'" % name @@ -401,14 +400,14 @@ def Compress(indata, algo, with_header=True): fname = GetOutputFilename('%s.comp.tmp' % algo) WriteFile(fname, indata) if algo == 'lz4': - data = Run('lz4', '--no-frame-crc', '-c', fname, binary=True) + data = Run('lz4', '--no-frame-crc', '-c', fname) # cbfstool uses a very old version of lzma elif algo == 'lzma': outfname = GetOutputFilename('%s.comp.otmp' % algo) Run('lzma_alone', 'e', fname, outfname, '-lc1', '-lp0', '-pb0', '-d8') data = ReadFile(outfname) elif algo == 'gzip': - data = Run('gzip', '-c', fname, binary=True) + data = Run('gzip', '-c', fname) else: raise ValueError("Unknown algorithm '%s'" % algo) if with_header: @@ -441,13 +440,13 @@ def Decompress(indata, algo, with_header=True): with open(fname, 'wb') as fd: fd.write(indata) if algo == 'lz4': - data = Run('lz4', '-dc', fname, binary=True) + data = Run('lz4', '-dc', fname) elif algo == 'lzma': outfname = GetOutputFilename('%s.decomp.otmp' % algo) Run('lzma_alone', 'd', fname, outfname) data = ReadFile(outfname) elif algo == 'gzip': - data = Run('gzip', '-cd', fname, binary=True) + data = Run('gzip', '-cd', fname) else: raise ValueError("Unknown algorithm '%s'" % algo) return data From patchwork Sat Aug 24 13:22:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152614 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="dq5Dsunz"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzdb4y9Lz9sBF for ; Sat, 24 Aug 2019 23:29:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 481F2C21DCA; Sat, 24 Aug 2019 13:27:56 +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=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 1FAF3C21DD4; Sat, 24 Aug 2019 13:27:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D81F2C21DAF; Sat, 24 Aug 2019 13:27:13 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id C8DF7C21DEC for ; Sat, 24 Aug 2019 13:27:09 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id t3so26584522ioj.12 for ; Sat, 24 Aug 2019 06:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bpMBW3dI7G3kiMtmG/LJuI7/quv8rCW1y0Wy1xXzRF8=; b=dq5DsunzawOxq6EVHDbM1VWl0nrWNSr68lS2P1rLHKSpJ+8su6xT9mtUm+igoFugKK DzWYJ6lYQYbSyvrg/oHU6VaS47f8DaqXhSyUfqq42zd5oQR9xzjOGXvsjYOH81Qa4Zxa eLS7t7Ew0762JFywR7CqB/0oAmPBUw64kCKu4= 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:mime-version:content-transfer-encoding; bh=bpMBW3dI7G3kiMtmG/LJuI7/quv8rCW1y0Wy1xXzRF8=; b=tgs52QrZcUNnicmC/BY0jkB/MWsDTbzrF9w/Svj0t4qUQirTabqOGBIQ5V+bs4KnWU jIQB7a2FmhX/+HvYRbEr3mQuhe9CqWiZ4T/rJRg8KYcF7RC4UDed/ut8YbFrMRjmacCg NP/ph4DrLZxF69rj0RP6RDwr0hOlygrf21U9KeNXe1G1v/gpSLACcxSXKHf7axyw7mTX jgd4eEbEJchrIDs5jZQLAKINZL+D0ZiL5Vbk/0vZKBMvJqQsqPtjMM2HI3qE18ThLNfq N/+Ohy/MqoYeEnhbe2xPQowhp2C/cEInD+Mlfs/gQX10++sNsNlt40RG1zQyZufROcJ9 Lanw== X-Gm-Message-State: APjAAAXgO29R3gKBy/vXxlSvP0Ergljxt7IkoJWuLUvoJp8EeVkDron0 gfbK1ttv2f4W4SqZrduCqMSWRu0/Q9w= X-Google-Smtp-Source: APXvYqyTo5oYd+GJ2Qx+fu5OiX/0A+naJcDCiJ7aTnmbVDN594Vi7Naz4A0bj6eyx5dcbYV6Y5uEZA== X-Received: by 2002:a02:a503:: with SMTP id e3mr9559694jam.134.1566653228598; Sat, 24 Aug 2019 06:27:08 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:42 -0600 Message-Id: <20190824132315.53130-3-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 02/34] patman: Update command.Run() to handle failure better 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" At present tools are not expected to fail. If they do an exception is raised but there is no detail about what went wrong. This makes it hard to debug if something does actually go wrong. Fix this by outputting both stderr and stdout on failure. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/patman/tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/patman/tools.py b/tools/patman/tools.py index 97441ca796..0952681579 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -205,8 +205,14 @@ def Run(name, *args): if tool_search_paths: env = dict(os.environ) env['PATH'] = ':'.join(tool_search_paths) + ':' + env['PATH'] - return command.Run(name, *args, capture=True, capture_stderr=True, - env=env) + all_args = (name,) + args + result = command.RunPipe([all_args], capture=True, capture_stderr=True, + env=env, raise_on_error=False) + if result.return_code: + raise Exception("Error %d running '%s': %s" % + (result.return_code,' '.join(all_args), + result.stderr)) + return result.stdout except: if env and not PathHasFile(env['PATH'], name): msg = "Please install tool '%s'" % name From patchwork Sat Aug 24 13:22:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152611 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="cIeMEgJU"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzbd6dwqz9s7T for ; Sat, 24 Aug 2019 23:27:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5EC99C21E16; Sat, 24 Aug 2019 13:27:20 +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=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 E58CAC21E16; Sat, 24 Aug 2019 13:27:19 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 2D053C21C50; Sat, 24 Aug 2019 13:27:13 +0000 (UTC) Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by lists.denx.de (Postfix) with ESMTPS id 93936C21DB5 for ; Sat, 24 Aug 2019 13:27:12 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id l7so26715700ioj.6 for ; Sat, 24 Aug 2019 06:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z9GOJ+0i+vhFrVIUNRa0nwptNemjN5pBljbWRpwpUK8=; b=cIeMEgJUCfJvIF4P8LjAllkOmy+Xdd/tq3N82R+6KhjW1Whr4de1470xvuRaZwh/7a lLdpSEMm5sz8glZu3QTKPbL84JxjcU3EcwIkB6cF4T8m8yDVtdSOKOSRUyGa22fGJKk+ c2/d1KXq3W969F3Ru68VzE++kA314JqhZyCzw= 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:mime-version:content-transfer-encoding; bh=Z9GOJ+0i+vhFrVIUNRa0nwptNemjN5pBljbWRpwpUK8=; b=oM34QFktCB0Qy92yG1D5QQid5AYraHl+VRZCMtsWZGaxbjSiIyIirikODDgSHkoGvu mextEHsBhTCtyJbV/x3kfKKPsH4Hc/1tVBZplRLns8G74lztcqrsmoy/F9tfDLGTb9lF 5fwjXFyK3p99PkxoI2VKSqmLq8oSOpgenpvaKvHSn2G7a0nG1GfxCzYkLYRVCjPj0XGG CzoAk3tkJg2nyTKFVR0uWMs1LFTCDYfNjowau+l69VzCzWPgt72kXOQXbv84J1hTuNA5 vnk9HgPZ4ithlOwUfyMtkcRnCQPuSMlKEFVNys3/0dTZCjcumJM5obp+xwwx/RRbII0K m9ow== X-Gm-Message-State: APjAAAWfLRfdpkUAmUWFNi3rn+OP/vNtRG7soTT0/95tq9gayYtntQ8W xE1a6d9+uL5euchCUi7t46XTX3Q47hk= X-Google-Smtp-Source: APXvYqw54y9yX74ZthvDlwBNMFjubpQT4K7FCrUtoTlSeRQQkr8asoxR/r3A1mXfvCYCGTGhtTc1RQ== X-Received: by 2002:a05:6638:a12:: with SMTP id 18mr4727989jan.123.1566653231415; Sat, 24 Aug 2019 06:27:11 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:43 -0600 Message-Id: <20190824132315.53130-4-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 03/34] binman: Use cls instead of self for class methods 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" It is more common to use the name 'cls' for the class object of a class method, to distinguish it from normal methods, which use 'self' Update the binman tests accordingly. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/ftest.py | 54 +++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 0f3b70b3bb..acf361fa84 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -94,16 +94,16 @@ class TestFunctional(unittest.TestCase): the test/ diurectory. """ @classmethod - def setUpClass(self): + def setUpClass(cls): global entry import entry # Handle the case where argv[0] is 'python' - self._binman_dir = os.path.dirname(os.path.realpath(sys.argv[0])) - self._binman_pathname = os.path.join(self._binman_dir, 'binman') + cls._binman_dir = os.path.dirname(os.path.realpath(sys.argv[0])) + cls._binman_pathname = os.path.join(cls._binman_dir, 'binman') # Create a temporary directory for input files - self._indir = tempfile.mkdtemp(prefix='binmant.') + cls._indir = tempfile.mkdtemp(prefix='binmant.') # Create some test files TestFunctional._MakeInputFile('u-boot.bin', U_BOOT_DATA) @@ -113,7 +113,7 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('blobfile', BLOB_DATA) TestFunctional._MakeInputFile('me.bin', ME_DATA) TestFunctional._MakeInputFile('vga.bin', VGA_DATA) - self._ResetDtbs() + cls._ResetDtbs() TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA) TestFunctional._MakeInputFile('u-boot-br.bin', PPC_MPC85XX_BR_DATA) TestFunctional._MakeInputFile('spl/u-boot-x86-16bit-spl.bin', @@ -135,35 +135,35 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('refcode.bin', REFCODE_DATA) # ELF file with a '_dt_ucode_base_size' symbol - with open(self.TestFile('u_boot_ucode_ptr'), 'rb') as fd: + with open(cls.TestFile('u_boot_ucode_ptr'), 'rb') as fd: TestFunctional._MakeInputFile('u-boot', fd.read()) # Intel flash descriptor file - with open(self.TestFile('descriptor.bin'), 'rb') as fd: + with open(cls.TestFile('descriptor.bin'), 'rb') as fd: TestFunctional._MakeInputFile('descriptor.bin', fd.read()) - shutil.copytree(self.TestFile('files'), - os.path.join(self._indir, 'files')) + shutil.copytree(cls.TestFile('files'), + os.path.join(cls._indir, 'files')) TestFunctional._MakeInputFile('compress', COMPRESS_DATA) # Travis-CI may have an old lz4 - self.have_lz4 = True + cls.have_lz4 = True try: tools.Run('lz4', '--no-frame-crc', '-c', - os.path.join(self._indir, 'u-boot.bin')) + os.path.join(cls._indir, 'u-boot.bin')) except: - self.have_lz4 = False + cls.have_lz4 = False @classmethod - def tearDownClass(self): + def tearDownClass(cls): """Remove the temporary input directory and its contents""" - if self.preserve_indir: - print('Preserving input dir: %s' % self._indir) + if cls.preserve_indir: + print('Preserving input dir: %s' % cls._indir) else: - if self._indir: - shutil.rmtree(self._indir) - self._indir = None + if cls._indir: + shutil.rmtree(cls._indir) + cls._indir = None @classmethod def setup_test_args(cls, preserve_indir=False, preserve_outdirs=False, @@ -226,7 +226,7 @@ class TestFunctional(unittest.TestCase): return tmpdir, updated_fname @classmethod - def _ResetDtbs(self): + def _ResetDtbs(cls): TestFunctional._MakeInputFile('u-boot.dtb', U_BOOT_DTB_DATA) TestFunctional._MakeInputFile('spl/u-boot-spl.dtb', U_BOOT_SPL_DTB_DATA) TestFunctional._MakeInputFile('tpl/u-boot-tpl.dtb', U_BOOT_TPL_DTB_DATA) @@ -432,7 +432,7 @@ class TestFunctional(unittest.TestCase): return self._DoReadFileDtb(fname, use_real_dtb)[0] @classmethod - def _MakeInputFile(self, fname, contents): + def _MakeInputFile(cls, fname, contents): """Create a new test input file, creating directories as needed Args: @@ -441,7 +441,7 @@ class TestFunctional(unittest.TestCase): Returns: Full pathname of file created """ - pathname = os.path.join(self._indir, fname) + pathname = os.path.join(cls._indir, fname) dirname = os.path.dirname(pathname) if dirname and not os.path.exists(dirname): os.makedirs(dirname) @@ -450,7 +450,7 @@ class TestFunctional(unittest.TestCase): return pathname @classmethod - def _MakeInputDir(self, dirname): + def _MakeInputDir(cls, dirname): """Create a new test input directory, creating directories as needed Args: @@ -459,24 +459,24 @@ class TestFunctional(unittest.TestCase): Returns: Full pathname of directory created """ - pathname = os.path.join(self._indir, dirname) + pathname = os.path.join(cls._indir, dirname) if not os.path.exists(pathname): os.makedirs(pathname) return pathname @classmethod - def _SetupSplElf(self, src_fname='bss_data'): + def _SetupSplElf(cls, src_fname='bss_data'): """Set up an ELF file with a '_dt_ucode_base_size' symbol Args: Filename of ELF file to use as SPL """ - with open(self.TestFile(src_fname), 'rb') as fd: + with open(cls.TestFile(src_fname), 'rb') as fd: TestFunctional._MakeInputFile('spl/u-boot-spl', fd.read()) @classmethod - def TestFile(self, fname): - return os.path.join(self._binman_dir, 'test', fname) + def TestFile(cls, fname): + return os.path.join(cls._binman_dir, 'test', fname) def AssertInList(self, grep_list, target): """Assert that at least one of a list of things is in a target From patchwork Sat Aug 24 13:22:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152612 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="RcQz4qcu"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzcG5h40z9s7T for ; Sat, 24 Aug 2019 23:28:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 20599C21C50; Sat, 24 Aug 2019 13:27: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=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 91246C21E16; Sat, 24 Aug 2019 13:27:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4585EC21D8A; Sat, 24 Aug 2019 13:27:14 +0000 (UTC) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by lists.denx.de (Postfix) with ESMTPS id 39FF0C21DFA for ; Sat, 24 Aug 2019 13:27:14 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id x4so26548023iog.13 for ; Sat, 24 Aug 2019 06:27:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6eU3ziVTf004Kk3U6wg3FQIBuir5s1LahyQV5uQK7RQ=; b=RcQz4qcupgwqJ0M2HG0GAs7caYhCpMmY6KCpaH4sZbUMJhvZyouOwc5TqXko/IL2Qn fT9Xt4dnZruUFyK19IqYUpKVD6MoNSHPodnf6f1JgP4VT+5d+JwG7QzUUWgqqUpqb6sr cV7ewMq37gcgIYCjpnQXvsa+zYA8Lox+FhPsg= 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:mime-version:content-transfer-encoding; bh=6eU3ziVTf004Kk3U6wg3FQIBuir5s1LahyQV5uQK7RQ=; b=DzssnnT3kBh66T4fZclpogLIBmXSa7B5ex0podyR0/i2qejBuYT7Py2zW0hP0ly0hL 0Uhd19W4Ds11YeKs+AQYjBfGNhQQtdi4vYmUcC8uhm0cQMw382h846zBOzcYbaiNsrSm jCD6XoQ7z/Vt6alSaY3dz9o2zt4zM7B72/vRvpSyUjl9lXH1s7nIn06dg3udSakQYFOZ Hf6kUu0UXPlKa63egqDs16kHPiiUSbCs94MZr1K6SUCS/dhO1Fn/pKynWPYtEiTJsSOp xBemDeV4IHgw2Rj2BxaMDJ6GfCcvXUPCQTk3P46HlTPPkr1GcoZsoMyqGc9hDVRXxNix nX+g== X-Gm-Message-State: APjAAAV5iIKpD6OnzNbI4pkw10sI3x094khBFW4t4vx/wTpGpgOQxAC+ ILhegwADquKu1cOtyDyQNLS9QKScT44= X-Google-Smtp-Source: APXvYqx3ceu1/MpKifDXzrbEOpbF7tyyTCTXIMp7VXOB7cYZO5DNebqXEGavvINVUVrSMvBNsGkoKA== X-Received: by 2002:a02:a8a:: with SMTP id 132mr9775300jaw.16.1566653232971; Sat, 24 Aug 2019 06:27:12 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:44 -0600 Message-Id: <20190824132315.53130-5-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 04/34] binman: Allow use of help and entry-docs without libfdt 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" At present if libfdt is not available binman can't do anything much. Improve the situation a little. Ideally there should be a test to cover this, but I'm not quite sure how to fake this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/control.py | 10 ++++++++-- tools/binman/entry.py | 5 ++++- tools/binman/etype/blob.py | 1 - tools/binman/etype/blob_dtb.py | 6 ++++-- tools/binman/etype/cbfs.py | 5 ++++- tools/binman/etype/fdtmap.py | 13 +++++++++---- tools/binman/etype/files.py | 5 ++++- tools/binman/etype/u_boot_dtb_with_ucode.py | 5 ++++- 8 files changed, 37 insertions(+), 13 deletions(-) diff --git a/tools/binman/control.py b/tools/binman/control.py index 9e7587864c..43f5d49406 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -15,8 +15,6 @@ import tools import cbfs_util import command import elf -from image import Image -import state import tout # List of images we plan to create @@ -459,6 +457,10 @@ def Binman(args): Args: args: Command line arguments Namespace object """ + # Put these here so that we can import this module without libfdt + global state + global Image + if args.full_help: pager = os.getenv('PAGER') if not pager: @@ -468,6 +470,10 @@ def Binman(args): command.Run(pager, fname) return 0 + # Put these here so that we can import this module without libfdt + from image import Image + import state + if args.cmd == 'ls': try: tools.PrepareOutputDir(None) diff --git a/tools/binman/entry.py b/tools/binman/entry.py index 6a2c6e0d92..04c26f9e50 100644 --- a/tools/binman/entry.py +++ b/tools/binman/entry.py @@ -21,7 +21,6 @@ import os import sys import fdt_util -import state import tools from tools import ToHex, ToHexSize import tout @@ -71,6 +70,10 @@ class Entry(object): orig_size: Original size value read from node """ def __init__(self, section, etype, node, name_prefix=''): + # Put this here to allow entry-docs and help to work without libfdt + global state + import state + self.section = section self.etype = etype self._node = node diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index d15d0789e5..d34c7b51bf 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -7,7 +7,6 @@ from entry import Entry import fdt_util -import state import tools import tout diff --git a/tools/binman/etype/blob_dtb.py b/tools/binman/etype/blob_dtb.py index 5b559967d7..b2afa064c1 100644 --- a/tools/binman/etype/blob_dtb.py +++ b/tools/binman/etype/blob_dtb.py @@ -5,8 +5,6 @@ # Entry-type module for U-Boot device tree files # -import state - from entry import Entry from blob import Entry_blob @@ -18,6 +16,10 @@ class Entry_blob_dtb(Entry_blob): 'state' module. """ def __init__(self, section, etype, node): + # Put this here to allow entry-docs and help to work without libfdt + global state + import state + Entry_blob.__init__(self, section, etype, node) def ObtainContents(self): diff --git a/tools/binman/etype/cbfs.py b/tools/binman/etype/cbfs.py index 28a9c81a8a..35b78370b2 100644 --- a/tools/binman/etype/cbfs.py +++ b/tools/binman/etype/cbfs.py @@ -11,7 +11,6 @@ import cbfs_util from cbfs_util import CbfsWriter from entry import Entry import fdt_util -import state class Entry_cbfs(Entry): """Entry containing a Coreboot Filesystem (CBFS) @@ -164,6 +163,10 @@ class Entry_cbfs(Entry): both of size 1MB. """ def __init__(self, section, etype, node): + # Put this here to allow entry-docs and help to work without libfdt + global state + import state + Entry.__init__(self, section, etype, node) self._cbfs_arg = fdt_util.GetString(node, 'cbfs-arch', 'x86') self._cbfs_entries = OrderedDict() diff --git a/tools/binman/etype/fdtmap.py b/tools/binman/etype/fdtmap.py index b1810b9ddb..5dc08b8289 100644 --- a/tools/binman/etype/fdtmap.py +++ b/tools/binman/etype/fdtmap.py @@ -8,11 +8,7 @@ This handles putting an FDT into the image with just the information about the image. """ -import libfdt - from entry import Entry -from fdt import Fdt -import state import tools import tout @@ -80,6 +76,15 @@ class Entry_fdtmap(Entry): added as necessary. See the binman README. """ def __init__(self, section, etype, node): + # Put these here to allow entry-docs and help to work without libfdt + global libfdt + global state + global Fdt + + import libfdt + import state + from fdt import Fdt + Entry.__init__(self, section, etype, node) def _GetFdtmap(self): diff --git a/tools/binman/etype/files.py b/tools/binman/etype/files.py index 0068b305f7..3473a2b1ef 100644 --- a/tools/binman/etype/files.py +++ b/tools/binman/etype/files.py @@ -11,7 +11,6 @@ import os from section import Entry_section import fdt_util -import state import tools @@ -29,6 +28,10 @@ class Entry_files(Entry_section): at run-time so you can obtain the file positions. """ def __init__(self, section, etype, node): + # Put this here to allow entry-docs and help to work without libfdt + global state + import state + Entry_section.__init__(self, section, etype, node) self._pattern = fdt_util.GetString(self._node, 'pattern') if not self._pattern: diff --git a/tools/binman/etype/u_boot_dtb_with_ucode.py b/tools/binman/etype/u_boot_dtb_with_ucode.py index cb6c3730d7..6efd24a9b3 100644 --- a/tools/binman/etype/u_boot_dtb_with_ucode.py +++ b/tools/binman/etype/u_boot_dtb_with_ucode.py @@ -7,7 +7,6 @@ from entry import Entry from blob_dtb import Entry_blob_dtb -import state import tools class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb): @@ -25,6 +24,10 @@ class Entry_u_boot_dtb_with_ucode(Entry_blob_dtb): it available to u_boot_ucode. """ def __init__(self, section, etype, node): + # Put this here to allow entry-docs and help to work without libfdt + global state + import state + Entry_blob_dtb.__init__(self, section, etype, node) self.ucode_data = b'' self.collate = False From patchwork Sat Aug 24 13:22:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152616 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Y5FSw/X/"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzf625HGz9s7T for ; Sat, 24 Aug 2019 23:30:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EDF67C21E85; Sat, 24 Aug 2019 13:28:06 +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=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 B7E37C21C51; Sat, 24 Aug 2019 13:27:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 247F9C21C8B; Sat, 24 Aug 2019 13:27:16 +0000 (UTC) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by lists.denx.de (Postfix) with ESMTPS id 9A79FC21E18 for ; Sat, 24 Aug 2019 13:27:15 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id e20so26587156iob.9 for ; Sat, 24 Aug 2019 06:27:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tIIUl627oHeBFiPEAwpir+BgucSqTBzFxK7wbq3oUaU=; b=Y5FSw/X/MXZGFmKFxBAbyBOnE64VhrT2dVjOBXyEXre1OBr9JaixZ5q92HUdltCN5T 7xcbJrixZ//i6rWX7Ieo6mqhDFXiwIWza42xcC9LaXfdyS7mDmagqTFmvr1dxLQy71ap egFwOEj14Oc1jYTr1bjIYzPbokYoPEp6vSeUQ= 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:mime-version:content-transfer-encoding; bh=tIIUl627oHeBFiPEAwpir+BgucSqTBzFxK7wbq3oUaU=; b=Kpk8P3Kjo+EmgfyvE41ZuMhSe1l33G/IcDQ2oIhUea2clFXrywt+0wwdyEdeCOgfyS /qWAPc1JRCzF9Bpu8CvGuQIVLPQdNSCEHCs0rTiTPTG67fk/m4wIZlSZW7nlzN55pXeL Tm+97CCDL0Pa1vz87p6aJOuFib5X5D4bl7PyM9cmUh+n+uNHXqfnK7I7LQVgiYAHuO9q U1DcSumCI05Yy6JBl0tRmlrYmF61O9nF3CRfS9p1oQmy7dacD7aMCYMtbE/xJ10LFr1b x6DzXPgrc4dEjew7BbaUEANNUgbTBZ6er62/l+rSVW15t48l0/uw2uXBHpTMYTylZpfy iiOA== X-Gm-Message-State: APjAAAUy1MRinY0m1E5papaRoKRQPFeOzpzHB5821w9zgLQaK1g1wGdw YAn4Gqo0LGFZZ9Qgg5EUAYylnYKwZYI= X-Google-Smtp-Source: APXvYqxxuXS5Pjttn2jZJNZCzzbdJEX+MZ9FySY+lHjp5U9gXuZegKmDQUbauZOzXjgSZYBTRH3now== X-Received: by 2002:a02:650b:: with SMTP id u11mr9616770jab.81.1566653234467; Sat, 24 Aug 2019 06:27:14 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:45 -0600 Message-Id: <20190824132315.53130-6-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 05/34] binman: Drop .note section from ELF 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" Recent versions of binutils add a '.note.gnu.property' into the ELF file. This is not required and interferes with the expected output. Drop it. Also fix testMakeElf() to use a different file for input and output. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf.py | 3 +++ tools/binman/elf_test.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/binman/elf.py b/tools/binman/elf.py index af40024cea..c7ef74ce7d 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -221,6 +221,9 @@ SECTIONS .empty : { *(.empty) } :empty + /DISCARD/ : { + *(.note.gnu.property) + } .note : { *(.comment) } :note diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index 416e43baf0..cc6e9c5128 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -148,7 +148,7 @@ class TestElf(unittest.TestCase): expected_text = b'1234' expected_data = b'wxyz' elf_fname = os.path.join(outdir, 'elf') - bin_fname = os.path.join(outdir, 'elf') + bin_fname = os.path.join(outdir, 'bin') # Make an Elf file and then convert it to a fkat binary file. This # should produce the original data. From patchwork Sat Aug 24 13:22:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152617 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fPzGZ05n"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzgM5J8cz9s7T for ; Sat, 24 Aug 2019 23:31:11 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F104BC21C6A; Sat, 24 Aug 2019 13:30:12 +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=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 11E63C21E26; Sat, 24 Aug 2019 13:28:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1EB81C21C51; Sat, 24 Aug 2019 13:27:17 +0000 (UTC) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by lists.denx.de (Postfix) with ESMTPS id 36FEDC21E18 for ; Sat, 24 Aug 2019 13:27:17 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id l7so26715967ioj.6 for ; Sat, 24 Aug 2019 06:27:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=obDtusOqlxu7eeA0EBcs6fPMyRAhtUcE0cRuiE+AeHI=; b=fPzGZ05no1JRaoJKZLb3bsW0R6VzvjjL6ahM5wu7+Ree9zfhEDonZR1nevzuBM3yGx bI6IQKFabR0oGhfTLPpsNghIwL/SqyvcRBpXuSpuIXo32gQbZ1c16MMXxVo/f6wRX+pI Qrcf9peatDswhv35qwP06WUJnCdKOr+TA+R1Y= 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:mime-version:content-transfer-encoding; bh=obDtusOqlxu7eeA0EBcs6fPMyRAhtUcE0cRuiE+AeHI=; b=TdFLfwnm9vJY7tke9wnbhoMNX5Hs4nOM6y0G/7eEL++oO1sQ9p9YHBC1W7VWSoaRKM 8Cb3r7efImJqslWL1FHc8TkMc6aUWvtLQFhSwuJYdWFFMIskOhHEQFowYI6FE/gGHqsn 15iyYOHfN9Mklo80M/zCv2V7bpFF02A6G9ALPjSfBkkHZ5G51zJw+otS+Zqw4NxVqdor nHSVt91cLJYJsKLcEmj+R+yNVg0iR13N7gb7BxYyt04mq80sHSEEyYlEXbF+8P4Vj4yr jmypWtu8vwHgIzWFl04PHfrbYS+rOw3SYJHrp8c+aYtKlPZB6EuIEI0McCrIxF5QA4sG Pjmw== X-Gm-Message-State: APjAAAVrK+TY59aJQ9wp+GF1be1naRQiMSDsdoejLaTEZE3rkpsMIY4N MvB/vMlwz3BuCAYIbW9NUY40hIQgYXM= X-Google-Smtp-Source: APXvYqynIVkeXt7KWvSbfopW3tsDz7IdXmq9NdIrpmbbfWOpApkMVRKNIIhR+R08tCARk04fJeANTg== X-Received: by 2002:a6b:500e:: with SMTP id e14mr6080948iob.49.1566653236091; Sat, 24 Aug 2019 06:27:16 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:46 -0600 Message-Id: <20190824132315.53130-7-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 06/34] binman: Handle hidden symbols in ELF files 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" Some versions of binutils generate hidden symbols which are currently not parsed by binman. Correct this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/elf.py b/tools/binman/elf.py index c7ef74ce7d..66cfe796a2 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -72,7 +72,7 @@ def GetSymbols(fname, patterns): parts = rest[7:].split() section, size = parts[:2] if len(parts) > 2: - name = parts[2] + name = parts[2] if parts[2] != '.hidden' else parts[3] syms[name] = Symbol(section, int(value, 16), int(size,16), flags[1] == 'w') From patchwork Sat Aug 24 13:22:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152635 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FAoB2PDk"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzsr4X1Pz9s7T for ; Sat, 24 Aug 2019 23:40:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 51D3BC21E5B; Sat, 24 Aug 2019 13:29:38 +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=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 EA382C21E34; Sat, 24 Aug 2019 13:28:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EB8FDC21DD3; Sat, 24 Aug 2019 13:27:19 +0000 (UTC) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by lists.denx.de (Postfix) with ESMTPS id B92C4C21E12 for ; Sat, 24 Aug 2019 13:27:18 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id 18so26619739ioe.10 for ; Sat, 24 Aug 2019 06:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CJmrPghg0IRP/x0sg6EXn+C5lu9tHSyyw6WfzpdWt9I=; b=FAoB2PDkOxCCoyPq6XYg1FT3hq8xdotSOq72cjc3ymCZzvyfGbtNKZTCn8+LRZkh5f zc3hiFTZLCjkT2uCehdwwQC05ZNHV3z8ogIcwXhKmplEFnp/F8xmCdRUfcPG5yB3p1QX NLE1UlTKOsZtK8Cmre/nR90uoAA+/TKA6WUXw= 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:mime-version:content-transfer-encoding; bh=CJmrPghg0IRP/x0sg6EXn+C5lu9tHSyyw6WfzpdWt9I=; b=rHa+niv9NQYix18e/v0vg6+JHSUKj/6boTgeYdgG142VQtb/sbmMSA/vV8Jt0Wqug9 tthCLGBnU3kizl5PXZPFEHVFsAEmkDAlKBI4XeNLwqrfBGOD7A9loTLEjiKGEJvXe+eT pnhB5zm64XMUU5nVzEue1NoQClOTuGInw2lj/XzcOeU8EmbB0B9R+AOVyzoyEdKNJV3U IHQ+PLv/hm/Bgog+sIUv3Ugh6U6EOqWDhH1htNIDJmTI5JObeZAeSfnAEdQyeG2g3g5W eMh/QowfcLucCf9wqylI4K3V10/SRqEqXbAq7EivdyXPURN8nqXr74J5nu/pObbqWVWn Vj9A== X-Gm-Message-State: APjAAAV+UR33DN9yzR7SKVQUjwG+ZNMhikd1a0m7nrIb0yBdnbJy8VJ9 HboolQ6cnh6ziaycS1ohqLVOe+H1idg= X-Google-Smtp-Source: APXvYqx0isK5RBS5GrXN2nSl7LcPcFy4FWG12nhQE5PszB0Ion3z5AzN3QuKLtFQpZlYtxCJiU4WSg== X-Received: by 2002:a05:6638:25a:: with SMTP id w26mr7210700jaq.133.1566653237584; Sat, 24 Aug 2019 06:27:17 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:47 -0600 Message-Id: <20190824132315.53130-8-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 07/34] binman: Correct use of 'replace' in IFWI tests 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" At present the Intel IFWI entry uses 'replace' without the 'ifwi-' prefix. This is a fairly generic name which might conflict with the main Entry base class at some point, if more features are added. Add a prefix. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/README.entries | 6 ++++++ tools/binman/etype/intel_ifwi.py | 8 +++++++- tools/binman/test/111_x86-rom-ifwi.dts | 2 +- tools/binman/test/112_x86-rom-ifwi-nodesc.dts | 2 +- tools/binman/test/113_x86-rom-ifwi-nodata.dts | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 0f0e367d02..11c55fd8c8 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -432,6 +432,12 @@ The contents of the IFWI are specified by the subnodes of the IFWI node. Each subnode describes an entry which is placed into the IFWFI with a given sub-partition (and optional entry name). +Properties for subnodes: + ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP" + ifwi-entry - entry name t use, e.g. "IBBL" + ifwi-replace - if present, indicates that the item should be replaced + in the IFWI. Otherwise it is added. + See README.x86 for information about x86 binary blobs. diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index 9cbdf3698a..f3745f7a8c 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -36,6 +36,12 @@ class Entry_intel_ifwi(Entry_blob): Each subnode describes an entry which is placed into the IFWFI with a given sub-partition (and optional entry name). + Properties for subnodes: + ifwi-subpart - sub-parition to put this entry into, e.g. "IBBP" + ifwi-entry - entry name t use, e.g. "IBBL" + ifwi-replace - if present, indicates that the item should be replaced + in the IFWI. Otherwise it is added. + See README.x86 for information about x86 binary blobs. """ def __init__(self, section, etype, node): @@ -95,7 +101,7 @@ class Entry_intel_ifwi(Entry_blob): for node in self._node.subnodes: entry = Entry.Create(self.section, node) entry.ReadNode() - entry._ifwi_replace = fdt_util.GetBool(node, 'replace') + entry._ifwi_replace = fdt_util.GetBool(node, 'ifwi-replace') entry._ifwi_subpart = fdt_util.GetString(node, 'ifwi-subpart') entry._ifwi_entry_name = fdt_util.GetString(node, 'ifwi-entry') self._ifwi_entries[entry._ifwi_subpart] = entry diff --git a/tools/binman/test/111_x86-rom-ifwi.dts b/tools/binman/test/111_x86-rom-ifwi.dts index 63b5972cc8..c0ba4f2ea4 100644 --- a/tools/binman/test/111_x86-rom-ifwi.dts +++ b/tools/binman/test/111_x86-rom-ifwi.dts @@ -20,7 +20,7 @@ convert-fit; u-boot-tpl { - replace; + ifwi-replace; ifwi-subpart = "IBBP"; ifwi-entry = "IBBL"; }; diff --git a/tools/binman/test/112_x86-rom-ifwi-nodesc.dts b/tools/binman/test/112_x86-rom-ifwi-nodesc.dts index 21ec4654ff..0874440ab5 100644 --- a/tools/binman/test/112_x86-rom-ifwi-nodesc.dts +++ b/tools/binman/test/112_x86-rom-ifwi-nodesc.dts @@ -19,7 +19,7 @@ filename = "ifwi.bin"; u-boot-tpl { - replace; + ifwi-replace; ifwi-subpart = "IBBP"; ifwi-entry = "IBBL"; }; diff --git a/tools/binman/test/113_x86-rom-ifwi-nodata.dts b/tools/binman/test/113_x86-rom-ifwi-nodata.dts index 62486fd990..82a4bc8cdd 100644 --- a/tools/binman/test/113_x86-rom-ifwi-nodata.dts +++ b/tools/binman/test/113_x86-rom-ifwi-nodata.dts @@ -20,7 +20,7 @@ _testing { return-unknown-contents; - replace; + ifwi-replace; ifwi-subpart = "IBBP"; ifwi-entry = "IBBL"; }; From patchwork Sat Aug 24 13:22:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152625 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ca3jgkBM"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzmT6TMNz9s7T for ; Sat, 24 Aug 2019 23:35:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 7497DC21C51; Sat, 24 Aug 2019 13:29:52 +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=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 896E3C21DED; Sat, 24 Aug 2019 13:28:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C7B38C21DEC; Sat, 24 Aug 2019 13:27:24 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id 7A449C21DF8 for ; Sat, 24 Aug 2019 13:27:20 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id t3so26585135ioj.12 for ; Sat, 24 Aug 2019 06:27:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Kg6mfma+BbtbJFzwjw3pX6THtr0BrwdLC7BuLmlgByw=; b=Ca3jgkBMv+9/TCasCAja5J2GDR7N8hbLIMv6dYFTfbaEurTAxreHjwY9xq+ZVMZxiU h/l9KvKvVVcVdQ5WMwkOHCdJz2kx3y8NblYEs4oE4qHfEjzB4FGauDNrx6uQB3HBfvFT nhzCW5+03AaCgz+mYCdh/X+L++sW1gwGpLulk= 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:mime-version:content-transfer-encoding; bh=Kg6mfma+BbtbJFzwjw3pX6THtr0BrwdLC7BuLmlgByw=; b=rK7MlDBWzERfcrwjeO2UjFtPYf0vzTO4AR2qakZ8+Wd473TUyTAm/oPTgwu5+H3uss K3L2PuI4Of+Shd1ec3LWpZ6Q40H8G3rf0aVNRkb0jbsjoQphCoFzSuksCjJcfCNXLY4F yYJoi+nAD9TX3Fh1DxkpjPN5yoL73kKkfzAA3aXLswp/0qwLLUK+csTBNOT3lRd1GV8E on41Eupbch5ukPsnrKG3/qBCTFWQS7ngXr8FqZ18ifbulKUzPr1u+FkZst8lPKbBpkPr gwJCrl/udCQIjrnb3dnKqm4HNM8QTGwuc2TSvPhnf9lZSAz6vX+UwI9UOo+oXHnKd5mC 5sKA== X-Gm-Message-State: APjAAAVCu8QqYCoCF9Dl674jN8fRieGtCuUrd5mEyofFhqIzjbJ1/pqH 8jw+gtmFjgofcY9GDzFSaj/ozjsXPMA= X-Google-Smtp-Source: APXvYqxfBp8rNzDT6udNi2SFcFVLsB9L/Xn/TXqXtxiRbi33/OfpInNT/EvlfctQdloE1cRZW/AvoQ== X-Received: by 2002:a02:495:: with SMTP id 143mr9483379jab.94.1566653239174; Sat, 24 Aug 2019 06:27:19 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:48 -0600 Message-Id: <20190824132315.53130-9-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 08/34] binman: Add support for an x86 'reset' section 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" At present binman has a single entry type for the 16-bit code code needed to start up an x86 processor. This entry is intended to include both the reset vector itself as well as the code to move to 32-bit mode. However this is not very flexible since in some cases other data needs to be included at the top of the SPI flash, in between these two pieces. For example Intel requires that a FIT (Firmware Image Table) pointer be placed 0x40 bytes before the end of the ROM. To deal with this, add a new reset entry for just the reset vector. A subsequent change will adjust the existing 'start16' entry. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/README.entries | 48 +++++++++++++++++++++++ tools/binman/etype/x86_reset16.py | 29 ++++++++++++++ tools/binman/etype/x86_reset16_spl.py | 29 ++++++++++++++ tools/binman/etype/x86_reset16_tpl.py | 29 ++++++++++++++ tools/binman/ftest.py | 30 +++++++++++++- tools/binman/test/144_x86_reset16.dts | 13 ++++++ tools/binman/test/145_x86_reset16_spl.dts | 13 ++++++ tools/binman/test/146_x86_reset16_tpl.dts | 13 ++++++ 8 files changed, 203 insertions(+), 1 deletion(-) create mode 100644 tools/binman/etype/x86_reset16.py create mode 100644 tools/binman/etype/x86_reset16_spl.py create mode 100644 tools/binman/etype/x86_reset16_tpl.py create mode 100644 tools/binman/test/144_x86_reset16.dts create mode 100644 tools/binman/test/145_x86_reset16_spl.dts create mode 100644 tools/binman/test/146_x86_reset16_tpl.dts diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 11c55fd8c8..55e3fa0dcc 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -937,6 +937,54 @@ and kernel are genuine. +Entry: x86-reset16: x86 16-bit reset code for U-Boot +---------------------------------------------------- + +Properties / Entry arguments: + - filename: Filename of u-boot-x86-reset16.bin (default + 'u-boot-x86-reset16.bin') + +x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code +must be placed at a particular address. This entry holds that code. It is +typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible +for jumping to the x86-start16 code, which continues execution. + +For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead. + + + +Entry: x86-reset16-spl: x86 16-bit reset code for U-Boot +-------------------------------------------------------- + +Properties / Entry arguments: + - filename: Filename of u-boot-x86-reset16.bin (default + 'u-boot-x86-reset16.bin') + +x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code +must be placed at a particular address. This entry holds that code. It is +typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible +for jumping to the x86-start16 code, which continues execution. + +For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead. + + + +Entry: x86-reset16-tpl: x86 16-bit reset code for U-Boot +-------------------------------------------------------- + +Properties / Entry arguments: + - filename: Filename of u-boot-x86-reset16.bin (default + 'u-boot-x86-reset16.bin') + +x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code +must be placed at a particular address. This entry holds that code. It is +typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible +for jumping to the x86-start16 code, which continues execution. + +For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead. + + + Entry: x86-start16: x86 16-bit start-up code for U-Boot ------------------------------------------------------- diff --git a/tools/binman/etype/x86_reset16.py b/tools/binman/etype/x86_reset16.py new file mode 100644 index 0000000000..54eb814ea3 --- /dev/null +++ b/tools/binman/etype/x86_reset16.py @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# Entry-type module for the 16-bit x86 reset code for U-Boot +# + +from entry import Entry +from blob import Entry_blob + +class Entry_x86_reset16(Entry_blob): + """x86 16-bit reset code for U-Boot + + Properties / Entry arguments: + - filename: Filename of u-boot-x86-reset16.bin (default + 'u-boot-x86-reset16.bin') + + x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code + must be placed at a particular address. This entry holds that code. It is + typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible + for jumping to the x86-start16 code, which continues execution. + + For 64-bit U-Boot, the 'x86_reset16_spl' entry type is used instead. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) + + def GetDefaultFilename(self): + return 'u-boot-x86-reset16.bin' diff --git a/tools/binman/etype/x86_reset16_spl.py b/tools/binman/etype/x86_reset16_spl.py new file mode 100644 index 0000000000..699a0c6bcb --- /dev/null +++ b/tools/binman/etype/x86_reset16_spl.py @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# Entry-type module for the 16-bit x86 reset code for U-Boot +# + +from entry import Entry +from blob import Entry_blob + +class Entry_x86_reset16_spl(Entry_blob): + """x86 16-bit reset code for U-Boot + + Properties / Entry arguments: + - filename: Filename of u-boot-x86-reset16.bin (default + 'u-boot-x86-reset16.bin') + + x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code + must be placed at a particular address. This entry holds that code. It is + typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible + for jumping to the x86-start16 code, which continues execution. + + For 32-bit U-Boot, the 'x86_reset_spl' entry type is used instead. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) + + def GetDefaultFilename(self): + return 'spl/u-boot-x86-reset16-spl.bin' diff --git a/tools/binman/etype/x86_reset16_tpl.py b/tools/binman/etype/x86_reset16_tpl.py new file mode 100644 index 0000000000..4eedb8d601 --- /dev/null +++ b/tools/binman/etype/x86_reset16_tpl.py @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# Entry-type module for the 16-bit x86 reset code for U-Boot +# + +from entry import Entry +from blob import Entry_blob + +class Entry_x86_reset16_tpl(Entry_blob): + """x86 16-bit reset code for U-Boot + + Properties / Entry arguments: + - filename: Filename of u-boot-x86-reset16.bin (default + 'u-boot-x86-reset16.bin') + + x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code + must be placed at a particular address. This entry holds that code. It is + typically placed at offset CONFIG_RESET_VEC_LOC. The code is responsible + for jumping to the x86-start16 code, which continues execution. + + For 32-bit U-Boot, the 'x86_reset_tpl' entry type is used instead. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) + + def GetDefaultFilename(self): + return 'tpl/u-boot-x86-reset16-tpl.bin' diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index acf361fa84..77445814a7 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -49,6 +49,9 @@ U_BOOT_TPL_DTB_DATA = b'tpldtb' X86_START16_DATA = b'start16' X86_START16_SPL_DATA = b'start16spl' X86_START16_TPL_DATA = b'start16tpl' +X86_RESET16_DATA = b'reset16' +X86_RESET16_SPL_DATA = b'reset16spl' +X86_RESET16_TPL_DATA = b'reset16tpl' PPC_MPC85XX_BR_DATA = b'ppcmpc85xxbr' U_BOOT_NODTB_DATA = b'nodtb with microcode pointer somewhere in here' U_BOOT_SPL_NODTB_DATA = b'splnodtb with microcode pointer somewhere in here' @@ -114,12 +117,22 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('me.bin', ME_DATA) TestFunctional._MakeInputFile('vga.bin', VGA_DATA) cls._ResetDtbs() - TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA) + TestFunctional._MakeInputFile('u-boot-br.bin', PPC_MPC85XX_BR_DATA) + + TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA) TestFunctional._MakeInputFile('spl/u-boot-x86-16bit-spl.bin', X86_START16_SPL_DATA) TestFunctional._MakeInputFile('tpl/u-boot-x86-16bit-tpl.bin', X86_START16_TPL_DATA) + + TestFunctional._MakeInputFile('u-boot-x86-reset16.bin', + X86_RESET16_DATA) + TestFunctional._MakeInputFile('spl/u-boot-x86-reset16-spl.bin', + X86_RESET16_SPL_DATA) + TestFunctional._MakeInputFile('tpl/u-boot-x86-reset16-tpl.bin', + X86_RESET16_TPL_DATA) + TestFunctional._MakeInputFile('u-boot-nodtb.bin', U_BOOT_NODTB_DATA) TestFunctional._MakeInputFile('spl/u-boot-spl-nodtb.bin', U_BOOT_SPL_NODTB_DATA) @@ -3236,6 +3249,21 @@ class TestFunctional(unittest.TestCase): self.assertIn('Must specify exactly one entry path to write with -f', str(e.exception)) + def testPackReset16(self): + """Test that an image with an x86 reset16 region can be created""" + data = self._DoReadFile('144_x86_reset16.dts') + self.assertEqual(X86_RESET16_DATA, data[:len(X86_RESET16_DATA)]) + + def testPackReset16Spl(self): + """Test that an image with an x86 reset16-spl region can be created""" + data = self._DoReadFile('145_x86_reset16_spl.dts') + self.assertEqual(X86_RESET16_SPL_DATA, data[:len(X86_RESET16_SPL_DATA)]) + + def testPackReset16Tpl(self): + """Test that an image with an x86 reset16-tpl region can be created""" + data = self._DoReadFile('146_x86_reset16_tpl.dts') + self.assertEqual(X86_RESET16_TPL_DATA, data[:len(X86_RESET16_TPL_DATA)]) + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/144_x86_reset16.dts b/tools/binman/test/144_x86_reset16.dts new file mode 100644 index 0000000000..ba90333b27 --- /dev/null +++ b/tools/binman/test/144_x86_reset16.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + x86-reset16 { + }; + }; +}; diff --git a/tools/binman/test/145_x86_reset16_spl.dts b/tools/binman/test/145_x86_reset16_spl.dts new file mode 100644 index 0000000000..cc8d97a7e6 --- /dev/null +++ b/tools/binman/test/145_x86_reset16_spl.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + x86-reset16-spl { + }; + }; +}; diff --git a/tools/binman/test/146_x86_reset16_tpl.dts b/tools/binman/test/146_x86_reset16_tpl.dts new file mode 100644 index 0000000000..041b16f3de --- /dev/null +++ b/tools/binman/test/146_x86_reset16_tpl.dts @@ -0,0 +1,13 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + x86-reset16-tpl { + }; + }; +}; From patchwork Sat Aug 24 13:22:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152615 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="SmDnGztx"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzdz2X5jz9s7T for ; Sat, 24 Aug 2019 23:29:59 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id EA697C21DF8; Sat, 24 Aug 2019 13:28:19 +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 A6A4BC21E12; Sat, 24 Aug 2019 13:27:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0A9BAC21D8E; Sat, 24 Aug 2019 13:27:26 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id 8521EC21DD3 for ; Sat, 24 Aug 2019 13:27:22 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id e20so26587651iob.9 for ; Sat, 24 Aug 2019 06:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qLGxJrqDZyyQOMXik//Xce7RnlaC5H+n3hDFSKk7670=; b=SmDnGztxx5jB0JtczuyWlqVYxu1+WfQELZQVC7X28u1wTJ+ZPr7MJPSe4VAGIwUCG1 4CcazL2bjo9z6SDTBSIuEbh3CJAAj5cLWdhLm+Y762TtENbiHAeLAC/k6B7F/cTrp9mo ziwusMQRFyoZsAI9Eswhf6/3LZDtgXPxEvYSU= 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:mime-version:content-transfer-encoding; bh=qLGxJrqDZyyQOMXik//Xce7RnlaC5H+n3hDFSKk7670=; b=YKI0eatobBSjXc0ECgawZkpmr8sw2K1oByANp666i6YipiLwEGjClOrpeyGrMIg12U hDnM3A2mGs1WD1CLx4sn6omSKD25LLXSFrBCTmu6uRT1M4WG0P4bFC2D6kjME/m8L7aQ nJL6kT7Ykk9npR5F7OhqW9szVfDOshn+aNeDf0k9EMocAr1NA13AHbw5JD3t2IUVsGWq tPkD+4oGwdLKd5sS3OoL6PnNdrxXBg8EHrotqDx+PM4bEYPSfXwerWQGV8GpTCBuxIFL fv+sJrIPxOHk5xz4/XG76WtpdFBwZu5/LckX8C0c0XB8xWkNZlUbqjhnsdzA+l8NJVlP Exuw== X-Gm-Message-State: APjAAAWcJMxXUp48I9lC+j3PC3nTkT8fY9KTaokDZq1mzmfqKX6LsO0A xrlVQA1aN9HCBAb5kusbVMgu8Mma5YA= X-Google-Smtp-Source: APXvYqy630EgSmoLMAChurEIMD9v2wzK1PoDdCuvNwbkOvLkryE2R0YEUVgRRXaHrWVZS3Y1QcEFhw== X-Received: by 2002:a02:a11e:: with SMTP id f30mr9852238jag.0.1566653241157; Sat, 24 Aug 2019 06:27:21 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:49 -0600 Message-Id: <20190824132315.53130-10-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 09/34] binman: x86: Separate out 16-bit reset and init code 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" At present these two sections of code are linked together into a single 2KB chunk in a single file. Some Intel SoCs like to have a FIT (Firmware Interface Table) in the ROM and the pointer for this needs to go at 0xffffffc0 which is in the middle of these two sections. Make use of the new 'reset' entry and change the existing 16-bit entry to include just the 16-bit data. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- Makefile | 10 ++++-- arch/x86/dts/u-boot.dtsi | 9 ++++++ scripts/Makefile.spl | 22 +++++++++---- tools/binman/README.entries | 46 +++++++++++++++------------ tools/binman/etype/x86_start16.py | 15 +++++---- tools/binman/etype/x86_start16_spl.py | 19 +++++------ tools/binman/etype/x86_start16_tpl.py | 18 ++++++----- tools/binman/ftest.py | 6 ++-- 8 files changed, 88 insertions(+), 57 deletions(-) diff --git a/Makefile b/Makefile index 3b0864ae8e..df4a54e204 100644 --- a/Makefile +++ b/Makefile @@ -1402,14 +1402,18 @@ quiet_cmd_ldr = LD $@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ $(filter-out FORCE,$^) -o $@ -u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \ +u-boot.rom: u-boot-x86-start16.bin u-boot-x86-reset16.bin u-boot.bin \ $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ $(if $(CONFIG_TPL_X86_16BIT_INIT),tpl/u-boot-tpl.bin) \ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE $(call if_changed,binman) -OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec -u-boot-x86-16bit.bin: u-boot FORCE +OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16 +u-boot-x86-start16.bin: u-boot FORCE + $(call if_changed,objcopy) + +OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec +u-boot-x86-reset16.bin: u-boot FORCE $(call if_changed,objcopy) endif diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index daeb168b65..0e87b88e10 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -120,14 +120,23 @@ x86-start16-tpl { offset = ; }; + x86-reset16-tpl { + offset = ; + }; #elif defined(CONFIG_SPL) x86-start16-spl { offset = ; }; + x86-reset16-spl { + offset = ; + }; #else x86-start16 { offset = ; }; + x86-reset16 { + offset = ; + }; #endif }; #endif diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 7af6b120b6..0f3d89b215 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -229,9 +229,11 @@ ALL-y += $(obj)/boot.bin endif ifdef CONFIG_TPL_BUILD -ALL-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-tpl.bin +ALL-$(CONFIG_TPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-tpl.bin \ + $(obj)/u-boot-x86-reset16-tpl.bin else -ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-16bit-spl.bin +ALL-$(CONFIG_SPL_X86_16BIT_INIT) += $(obj)/u-boot-x86-start16-spl.bin \ + $(obj)/u-boot-x86-reset16-spl.bin endif ALL-$(CONFIG_ARCH_ZYNQ) += $(obj)/boot.bin @@ -337,12 +339,20 @@ OBJCOPYFLAGS_$(SPL_BIN)-nodtb.bin = $(SPL_OBJCFLAGS) -O binary \ $(obj)/$(SPL_BIN)-nodtb.bin: $(obj)/$(SPL_BIN) FORCE $(call if_changed,objcopy) -OBJCOPYFLAGS_u-boot-x86-16bit-spl.bin := -O binary -j .start16 -j .resetvec -$(obj)/u-boot-x86-16bit-spl.bin: $(obj)/u-boot-spl FORCE +OBJCOPYFLAGS_u-boot-x86-start16-spl.bin := -O binary -j .start16 +$(obj)/u-boot-x86-start16-spl.bin: $(obj)/u-boot-spl FORCE $(call if_changed,objcopy) -OBJCOPYFLAGS_u-boot-x86-16bit-tpl.bin := -O binary -j .start16 -j .resetvec -$(obj)/u-boot-x86-16bit-tpl.bin: $(obj)/u-boot-tpl FORCE +OBJCOPYFLAGS_u-boot-x86-start16-tpl.bin := -O binary -j .start16 +$(obj)/u-boot-x86-start16-tpl.bin: $(obj)/u-boot-tpl FORCE + $(call if_changed,objcopy) + +OBJCOPYFLAGS_u-boot-x86-reset16-spl.bin := -O binary -j .resetvec +$(obj)/u-boot-x86-reset16-spl.bin: $(obj)/u-boot-spl FORCE + $(call if_changed,objcopy) + +OBJCOPYFLAGS_u-boot-x86-reset16-tpl.bin := -O binary -j .resetvec +$(obj)/u-boot-x86-reset16-tpl.bin: $(obj)/u-boot-tpl FORCE $(call if_changed,objcopy) LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL) diff --git a/tools/binman/README.entries b/tools/binman/README.entries index 55e3fa0dcc..d17b3cb078 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -989,14 +989,15 @@ Entry: x86-start16: x86 16-bit start-up code for U-Boot ------------------------------------------------------- Properties / Entry arguments: - - filename: Filename of u-boot-x86-16bit.bin (default - 'u-boot-x86-16bit.bin') + - filename: Filename of u-boot-x86-start16.bin (default + 'u-boot-x86-start16.bin') x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code -must be placed at a particular address. This entry holds that code. It is -typically placed at offset CONFIG_SYS_X86_START16. The code is responsible -for changing to 32-bit mode and jumping to U-Boot's entry point, which -requires 32-bit mode (for 32-bit U-Boot). +must be placed in the top 64KB of the ROM. The reset code jumps to it. This +entry holds that code. It is typically placed at offset +CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode +and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit +U-Boot). For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead. @@ -1006,16 +1007,17 @@ Entry: x86-start16-spl: x86 16-bit start-up code for SPL -------------------------------------------------------- Properties / Entry arguments: - - filename: Filename of spl/u-boot-x86-16bit-spl.bin (default - 'spl/u-boot-x86-16bit-spl.bin') + - filename: Filename of spl/u-boot-x86-start16-spl.bin (default + 'spl/u-boot-x86-start16-spl.bin') -x86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code -must be placed at a particular address. This entry holds that code. It is -typically placed at offset CONFIG_SYS_X86_START16. The code is responsible -for changing to 32-bit mode and starting SPL, which in turn changes to -64-bit mode and jumps to U-Boot (for 64-bit U-Boot). +x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code +must be placed in the top 64KB of the ROM. The reset code jumps to it. This +entry holds that code. It is typically placed at offset +CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode +and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit +U-Boot). -For 32-bit U-Boot, the 'x86_start16' entry type is used instead. +For 32-bit U-Boot, the 'x86-start16' entry type is used instead. @@ -1023,15 +1025,17 @@ Entry: x86-start16-tpl: x86 16-bit start-up code for TPL -------------------------------------------------------- Properties / Entry arguments: - - filename: Filename of tpl/u-boot-x86-16bit-tpl.bin (default - 'tpl/u-boot-x86-16bit-tpl.bin') + - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default + 'tpl/u-boot-x86-start16-tpl.bin') -x86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code -must be placed at a particular address. This entry holds that code. It is -typically placed at offset CONFIG_SYS_X86_START16. The code is responsible -for changing to 32-bit mode and starting TPL, which in turn jumps to SPL. +x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code +must be placed in the top 64KB of the ROM. The reset code jumps to it. This +entry holds that code. It is typically placed at offset +CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode +and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit +U-Boot). -If TPL is not being used, the 'x86_start16_spl or 'x86_start16' entry types +If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types may be used instead. diff --git a/tools/binman/etype/x86_start16.py b/tools/binman/etype/x86_start16.py index 7d32ecd321..6736b692d5 100644 --- a/tools/binman/etype/x86_start16.py +++ b/tools/binman/etype/x86_start16.py @@ -12,14 +12,15 @@ class Entry_x86_start16(Entry_blob): """x86 16-bit start-up code for U-Boot Properties / Entry arguments: - - filename: Filename of u-boot-x86-16bit.bin (default - 'u-boot-x86-16bit.bin') + - filename: Filename of u-boot-x86-start16.bin (default + 'u-boot-x86-start16.bin') x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code - must be placed at a particular address. This entry holds that code. It is - typically placed at offset CONFIG_SYS_X86_START16. The code is responsible - for changing to 32-bit mode and jumping to U-Boot's entry point, which - requires 32-bit mode (for 32-bit U-Boot). + must be placed in the top 64KB of the ROM. The reset code jumps to it. This + entry holds that code. It is typically placed at offset + CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode + and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit + U-Boot). For 64-bit U-Boot, the 'x86_start16_spl' entry type is used instead. """ @@ -27,4 +28,4 @@ class Entry_x86_start16(Entry_blob): Entry_blob.__init__(self, section, etype, node) def GetDefaultFilename(self): - return 'u-boot-x86-16bit.bin' + return 'u-boot-x86-start16.bin' diff --git a/tools/binman/etype/x86_start16_spl.py b/tools/binman/etype/x86_start16_spl.py index d85909e7ae..c8c70639de 100644 --- a/tools/binman/etype/x86_start16_spl.py +++ b/tools/binman/etype/x86_start16_spl.py @@ -12,19 +12,20 @@ class Entry_x86_start16_spl(Entry_blob): """x86 16-bit start-up code for SPL Properties / Entry arguments: - - filename: Filename of spl/u-boot-x86-16bit-spl.bin (default - 'spl/u-boot-x86-16bit-spl.bin') + - filename: Filename of spl/u-boot-x86-start16-spl.bin (default + 'spl/u-boot-x86-start16-spl.bin') - x86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code - must be placed at a particular address. This entry holds that code. It is - typically placed at offset CONFIG_SYS_X86_START16. The code is responsible - for changing to 32-bit mode and starting SPL, which in turn changes to - 64-bit mode and jumps to U-Boot (for 64-bit U-Boot). + x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code + must be placed in the top 64KB of the ROM. The reset code jumps to it. This + entry holds that code. It is typically placed at offset + CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode + and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit + U-Boot). - For 32-bit U-Boot, the 'x86_start16' entry type is used instead. + For 32-bit U-Boot, the 'x86-start16' entry type is used instead. """ def __init__(self, section, etype, node): Entry_blob.__init__(self, section, etype, node) def GetDefaultFilename(self): - return 'spl/u-boot-x86-16bit-spl.bin' + return 'spl/u-boot-x86-start16-spl.bin' diff --git a/tools/binman/etype/x86_start16_tpl.py b/tools/binman/etype/x86_start16_tpl.py index 46ce169ae0..5261a8adf0 100644 --- a/tools/binman/etype/x86_start16_tpl.py +++ b/tools/binman/etype/x86_start16_tpl.py @@ -12,19 +12,21 @@ class Entry_x86_start16_tpl(Entry_blob): """x86 16-bit start-up code for TPL Properties / Entry arguments: - - filename: Filename of tpl/u-boot-x86-16bit-tpl.bin (default - 'tpl/u-boot-x86-16bit-tpl.bin') + - filename: Filename of tpl/u-boot-x86-start16-tpl.bin (default + 'tpl/u-boot-x86-start16-tpl.bin') - x86 CPUs start up in 16-bit mode, even if they are 64-bit CPUs. This code - must be placed at a particular address. This entry holds that code. It is - typically placed at offset CONFIG_SYS_X86_START16. The code is responsible - for changing to 32-bit mode and starting TPL, which in turn jumps to SPL. + x86 CPUs start up in 16-bit mode, even if they are 32-bit CPUs. This code + must be placed in the top 64KB of the ROM. The reset code jumps to it. This + entry holds that code. It is typically placed at offset + CONFIG_SYS_X86_START16. The code is responsible for changing to 32-bit mode + and jumping to U-Boot's entry point, which requires 32-bit mode (for 32-bit + U-Boot). - If TPL is not being used, the 'x86_start16_spl or 'x86_start16' entry types + If TPL is not being used, the 'x86-start16-spl or 'x86-start16' entry types may be used instead. """ def __init__(self, section, etype, node): Entry_blob.__init__(self, section, etype, node) def GetDefaultFilename(self): - return 'tpl/u-boot-x86-16bit-tpl.bin' + return 'tpl/u-boot-x86-start16-tpl.bin' diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 77445814a7..04127faa6f 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -120,10 +120,10 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('u-boot-br.bin', PPC_MPC85XX_BR_DATA) - TestFunctional._MakeInputFile('u-boot-x86-16bit.bin', X86_START16_DATA) - TestFunctional._MakeInputFile('spl/u-boot-x86-16bit-spl.bin', + TestFunctional._MakeInputFile('u-boot-x86-start16.bin', X86_START16_DATA) + TestFunctional._MakeInputFile('spl/u-boot-x86-start16-spl.bin', X86_START16_SPL_DATA) - TestFunctional._MakeInputFile('tpl/u-boot-x86-16bit-tpl.bin', + TestFunctional._MakeInputFile('tpl/u-boot-x86-start16-tpl.bin', X86_START16_TPL_DATA) TestFunctional._MakeInputFile('u-boot-x86-reset16.bin', From patchwork Sat Aug 24 13:22:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152639 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TzNQ3Zck"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzvR6XyRz9s7T for ; Sat, 24 Aug 2019 23:41:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 95BFFC21E8A; Sat, 24 Aug 2019 13:28:53 +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=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 ED451C21DDC; Sat, 24 Aug 2019 13:27:53 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B7114C21DD3; Sat, 24 Aug 2019 13:27:28 +0000 (UTC) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by lists.denx.de (Postfix) with ESMTPS id 53502C21D8A for ; Sat, 24 Aug 2019 13:27:24 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id s21so26758571ioa.1 for ; Sat, 24 Aug 2019 06:27:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PMASFI/xdJzdP1ocVWQQXe8bREm/dY2PNS4fbQXBnZM=; b=TzNQ3ZckZaTOA+iRmdqHnJxPZxDgDkfLOpUNgDM+5/m/IkjB7Myv1mfbA3A2Ry1kNF gRwg2j6exGsyXbmi+6NAdYSDo2vNEhmo3Qe80qYKa2aiCh0DfbBFSbvZF/vjzUMkbSr0 ZL+QX059+6ZO6K9c0dWN0L45PbvUDDPTRlvLg= 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:mime-version:content-transfer-encoding; bh=PMASFI/xdJzdP1ocVWQQXe8bREm/dY2PNS4fbQXBnZM=; b=hJKC6odzO9k7LrmCwgokj/n7bxH4YEx/cV3kMg/dk0+uMAe6P2qQsDmSxd1didpcJ9 D3biglx0vDeiq4g39XmmOdOGnA29EMupVtCNKbsC4pfrWUiDbb1kMrjguTYBmpFx35ng ho8vY67lchAyp8d4Ba48iWQPEF72VP9HK6guvhsQPr1TAKqI2GAQ9OA2BX9zHzsyvF22 neClx8qGy1veiFR7cW9FSyutS2YgtbQn777zwTC0bRdGeCcwYBMLit3FgshteJYrEmzT Qgyqi/Tpwa/eDNPY3xY+7ol4olKx+pL6fz3lTgKLgQy0r6quU6xcItUMUAdp7Rv/lPVC 50kA== X-Gm-Message-State: APjAAAUDVPU1E2zUSklGkuyawpAPyrOV47Bb8uQZRdYt3heKuIVIfrE1 0m8e70YC5LGUxBo64NCpnfPEegcBIk0= X-Google-Smtp-Source: APXvYqxMeza9/ajk4kJy6ToaxOuJbrVHOm7wL5Rt8QRtMbP9sFrzAeXEpi4zY2VDhjWR5d0+fcumig== X-Received: by 2002:a6b:6812:: with SMTP id d18mr7041913ioc.239.1566653243122; Sat, 24 Aug 2019 06:27:23 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:50 -0600 Message-Id: <20190824132315.53130-11-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 10/34] binman: Add support for Intel FIT 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" A Firmware Image Table (FIT) is a data structure defined by Intel which contains information about various things needed by the SoC, such as microcode. Add support for this entry as well as the pointer to it. The contents of FIT are fixed at present. Future work is needed to support adding microcode, etc. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/README.entries | 19 ++++++++++ tools/binman/etype/intel_fit.py | 32 ++++++++++++++++ tools/binman/etype/intel_fit_ptr.py | 41 +++++++++++++++++++++ tools/binman/ftest.py | 20 ++++++++++ tools/binman/test/147_intel_fit.dts | 20 ++++++++++ tools/binman/test/148_intel_fit_missing.dts | 17 +++++++++ 6 files changed, 149 insertions(+) create mode 100644 tools/binman/etype/intel_fit.py create mode 100644 tools/binman/etype/intel_fit_ptr.py create mode 100644 tools/binman/test/147_intel_fit.dts create mode 100644 tools/binman/test/148_intel_fit_missing.dts diff --git a/tools/binman/README.entries b/tools/binman/README.entries index d17b3cb078..dba51e6daa 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -391,6 +391,25 @@ See README.x86 for information about x86 binary blobs. +Entry: intel-fit: Intel Firmware Image Table (FIT) +-------------------------------------------------- + +This entry contains a dummy FIT as required by recent Intel CPUs. The FIT +contains information about the firmware and microcode available in the +image. + +At present binman only supports a basic FIT with no microcode. + + + +Entry: intel-fit-ptr: Intel Firmware Image Table (FIT) pointer +-------------------------------------------------------------- + +This entry contains a pointer to the FIT. It is required to be at address +0xffffffc0 in the image. + + + Entry: intel-fsp: Entry containing an Intel Firmware Support Package (FSP) file ------------------------------------------------------------------------------- diff --git a/tools/binman/etype/intel_fit.py b/tools/binman/etype/intel_fit.py new file mode 100644 index 0000000000..23606d27d0 --- /dev/null +++ b/tools/binman/etype/intel_fit.py @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# Entry-type module for Intel Firmware Image Table +# + +import struct + +from blob import Entry_blob + +class Entry_intel_fit(Entry_blob): + """Intel Firmware Image Table (FIT) + + This entry contains a dummy FIT as required by recent Intel CPUs. The FIT + contains information about the firmware and microcode available in the + image. + + At present binman only supports a basic FIT with no microcode. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) + + def ReadNode(self): + """Force 16-byte alignment as required by FIT pointer""" + Entry_blob.ReadNode(self) + self.align = 16 + + def ObtainContents(self): + data = struct.pack('<8sIHBB', '_FIT_ ', 1, 0x100, 0x80, 0x7d) + self.SetContents(data) + return True diff --git a/tools/binman/etype/intel_fit_ptr.py b/tools/binman/etype/intel_fit_ptr.py new file mode 100644 index 0000000000..148b206c3c --- /dev/null +++ b/tools/binman/etype/intel_fit_ptr.py @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2016 Google, Inc +# Written by Simon Glass +# +# Entry-type module for a pointer to an Intel Firmware Image Table +# + +import struct + +from blob import Entry_blob + +class Entry_intel_fit_ptr(Entry_blob): + """Intel Firmware Image Table (FIT) pointer + + This entry contains a pointer to the FIT. It is required to be at address + 0xffffffc0 in the image. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) + if self.HasSibling('intel-fit') is False: + self.Raise("'intel-fit-ptr' section must have an 'intel-fit' sibling") + + def _GetContents(self): + fit_pos = self.GetSiblingImagePos('intel-fit') + return struct.pack('; + #size-cells = <1>; + + binman { + end-at-4gb; + size = <0x80>; + + u-boot { + }; + + intel-fit { + }; + + intel-fit-ptr { + }; + }; +}; diff --git a/tools/binman/test/148_intel_fit_missing.dts b/tools/binman/test/148_intel_fit_missing.dts new file mode 100644 index 0000000000..388c76b1ab --- /dev/null +++ b/tools/binman/test/148_intel_fit_missing.dts @@ -0,0 +1,17 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + end-at-4gb; + size = <0x80>; + + u-boot { + }; + + intel-fit-ptr { + }; + }; +}; From patchwork Sat Aug 24 13:22:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152631 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OETvLgLw"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzqY6S6Qz9s7T for ; Sat, 24 Aug 2019 23:38:17 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 35F52C21EA7; Sat, 24 Aug 2019 13:29:09 +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=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 71222C21E35; Sat, 24 Aug 2019 13:27:54 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 00787C21D56; Sat, 24 Aug 2019 13:27:30 +0000 (UTC) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by lists.denx.de (Postfix) with ESMTPS id 71633C21C6A for ; Sat, 24 Aug 2019 13:27:26 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id q22so26699966iog.4 for ; Sat, 24 Aug 2019 06:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1JTb4GG8AoPpTXc2orSGlK2B4Dc4vSqnvt29fVCcdf8=; b=OETvLgLwOOaI0w3SslmABKQ+u2ggBZAuLMPg8Hxw4Dzqs0BenV2FF2KrdL4aeZQ2PV V0iMMvYugCCrZ2urq3w54FA9Biwnio+mKBjCE/sDPVK4W5P8IPNW1gkFE+UtxPCVhMEh hac+ltHcVcJMZXK4BbXgqRzX6KFx2DCfD4x8o= 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:mime-version:content-transfer-encoding; bh=1JTb4GG8AoPpTXc2orSGlK2B4Dc4vSqnvt29fVCcdf8=; b=EIPHE4e3/0q0//ZGWg+ZIqPFng09vJ38NvazP4165fGSl43RXMB0gN57UbAnoAs5Dk DSU2k2GEP51hQMTUR50IVNbymvodbdicDUbOwcnZqkEif8f1dmLVAZ8iENtcINE3V1Sr +xzpsBHFeau8b2uzKAYFwdBRp7AIwo0uLOyCXb0zt//4YKZCK9oIsY8B/Cx/Oo/RfULE NSxKaF3wpzPeFRSfhc7Nff42mAwLJDnCZrTpVAaNwI0/pqGs3aILkuDxbQK9tDcTEwoh O7smXQqGpAitBvL+ewsm8Y61082zn2viFGbnVDiD3uxv9ESFS6lqiZIah6BesCoKaUL8 Uu5w== X-Gm-Message-State: APjAAAUxQC3SePuoES2G35oAbjCOn66JwLIbAzQ036w4tfEL8qyzTKY6 ex9C8KMK9TZ7XHxjMqh2hHpjcl3yK64= X-Google-Smtp-Source: APXvYqzbxrJW6Wzj2KRSZATbHcbBWeSHhWnjYQZPonmieL6+68uZJ7mgs15CNj46r2ErQ0ZRFDW7Sg== X-Received: by 2002:a05:6602:2492:: with SMTP id g18mr13777593ioe.266.1566653245272; Sat, 24 Aug 2019 06:27:25 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:51 -0600 Message-Id: <20190824132315.53130-12-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 11/34] binman: Fix IFWI output when using an Intel FIT image 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" At present this entry does not work correctly when a FIT image is used as the input. It updates the FIT instead of the output image. The test passed because the FIT image happened to have the right data already. Fix it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/intel_ifwi.py | 6 +++--- tools/binman/ftest.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index f3745f7a8c..e4da3e498a 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -75,10 +75,10 @@ class Entry_intel_ifwi(Entry_blob): self._pathname = outname else: # Provide a different code path here to ensure we have test coverage - inname = self._pathname + outname = self._pathname # Delete OBBP if it is there, then add the required new items. - tools.RunIfwiTool(inname, tools.CMD_DELETE, subpart='OBBP') + tools.RunIfwiTool(outname, tools.CMD_DELETE, subpart='OBBP') for entry in self._ifwi_entries.values(): # First get the input data and put it in a file @@ -89,7 +89,7 @@ class Entry_intel_ifwi(Entry_blob): input_fname = tools.GetOutputFilename('input.%s' % uniq) tools.WriteFile(input_fname, data) - tools.RunIfwiTool(inname, + tools.RunIfwiTool(outname, tools.CMD_REPLACE if entry._ifwi_replace else tools.CMD_ADD, input_fname, entry._ifwi_subpart, entry._ifwi_entry_name) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 080599fee3..bba07e7275 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -2044,7 +2044,7 @@ class TestFunctional(unittest.TestCase): subpart='IBBP', entry_name='IBBL') tpl_data = tools.ReadFile(tpl_fname) - self.assertEqual(tpl_data[:len(U_BOOT_TPL_DATA)], U_BOOT_TPL_DATA) + self.assertEqual(U_BOOT_TPL_DATA, tpl_data[:len(U_BOOT_TPL_DATA)]) def testPackX86RomIfwi(self): """Test that an x86 ROM with Integrated Firmware Image can be created""" From patchwork Sat Aug 24 13:22:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152637 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="am98cntO"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FztS2zCvz9sBF for ; Sat, 24 Aug 2019 23:40:48 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1F3BEC21E76; Sat, 24 Aug 2019 13:28:43 +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=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 47A13C21DB5; Sat, 24 Aug 2019 13:27:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A727AC21E30; Sat, 24 Aug 2019 13:27:31 +0000 (UTC) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by lists.denx.de (Postfix) with ESMTPS id 37F6DC21DDC for ; Sat, 24 Aug 2019 13:27:28 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id j4so18334581iog.11 for ; Sat, 24 Aug 2019 06:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iSnDLj/K/2Ax12mV/9/02xmMabVT82+35tCxQDg9gV8=; b=am98cntOH11RBTpipX4j8T3b9jkHn/Cmrel6vYYmjhuHAoG0R4AseJLfxRJEyLbRLQ gRK2bAIMypYRA8DHqP8b13R/oTxr8m5iE2OWoQguATgFqCLXoTBNOmxjTLuYYZx/jik7 GYNlPDGiJVuB3liYZLv9bN9nnNtI0vtSEf9Jo= 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:mime-version:content-transfer-encoding; bh=iSnDLj/K/2Ax12mV/9/02xmMabVT82+35tCxQDg9gV8=; b=Jcmj93vG9ylHNBPQrLcUU3Ben0AJznCdXpqlMzWiFvnlQ8qx4wR+S7g1ii85ghmJUS H7drmZUceh10tGf460Xsh4AfijoNUiABvyHLdS2JlfRNBBPutd6rxsMIKuVrmkuTqnaw 0G3PPe27/+KNtZCB5UpRIaK/1YLDQF4W3h8/R/R0HEh7476wxzslb1NtpBfCn6BH/CgZ NgJAxyj7pw2eJdgAotLHSMlRHv9lOafsaAE7/QTgyUI08lIf/0PIuOpczrKFksmKfZoL v25tAVKUpU8W3hvl4GQzT6DpG5P8pqKqlswm4PuUBKJSf2StQPvcFzINvnxaUjmF0dLR YKJQ== X-Gm-Message-State: APjAAAVNk/WbsjYInDfAaBmJaA+3VAQRu23pbna07WThyi1pyrfgJiUQ ycovfvCTdxEh2+jYmEKeKUQDXg4c2K4= X-Google-Smtp-Source: APXvYqxRADgljoI3cg1Nt7j+MnS+VOSNGTEkYUYMYDA0t5AqCagzgSVd/yt0PuHGVtUKOEkp05DF9g== X-Received: by 2002:a6b:90c3:: with SMTP id s186mr13928148iod.114.1566653247100; Sat, 24 Aug 2019 06:27:27 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:52 -0600 Message-Id: <20190824132315.53130-13-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 12/34] binman: Use tools.Run() to run objdump 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" At present this command silently fails if something goes wrong. Use the tools.Run() function instead, since it reports errors. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/elf.py b/tools/binman/elf.py index 66cfe796a2..7bc7cf61b5 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -49,7 +49,7 @@ def GetSymbols(fname, patterns): key: Name of symbol value: Hex value of symbol """ - stdout = command.Output('objdump', '-t', fname, raise_on_error=False) + stdout = tools.Run('objdump', '-t', fname) lines = stdout.splitlines() if patterns: re_syms = re.compile('|'.join(patterns)) From patchwork Sat Aug 24 13:22:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152619 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fuy6VtLK"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzjm2Y2hz9sBF for ; Sat, 24 Aug 2019 23:33:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 02F11C21D8E; Sat, 24 Aug 2019 13:29:20 +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=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 40EFCC21DD7; Sat, 24 Aug 2019 13:27:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id AB87CC21DE8; Sat, 24 Aug 2019 13:27:33 +0000 (UTC) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by lists.denx.de (Postfix) with ESMTPS id 0A51AC21DD9 for ; Sat, 24 Aug 2019 13:27:30 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id l7so26716821ioj.6 for ; Sat, 24 Aug 2019 06:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YITz3ixobZ0m7ErRU7m3UYOxsMNALeR29XWWQ9Ahk0w=; b=fuy6VtLKo8EwUYlVufaAm+sNFLkQ/kQDuycZfi7Tkiw56bbs5Mrm3G+3c8gMeccaTV h90ngp1yblEI1r5eLRCPSIH3NCRA5x+J51CamDOpAzvfjg6GEir1EONBpd1HqdAQNNtD L5GmnNlhpuU4enxBhAupjXAqJB3SrAB+UJI3Q= 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:mime-version:content-transfer-encoding; bh=YITz3ixobZ0m7ErRU7m3UYOxsMNALeR29XWWQ9Ahk0w=; b=GouEAaFACQ3xRmMGWIKSY2Tr3w8ZHVSIigsh+3c4S32C+7tHLbonDXK4/fu4P08Snb 6JBKDUzKGP9dylf6fOSUeFokPQLuHvmWH7k8SG9tJwXZqtpwK4Qm9ieSP+hrOvYN9LEO UUrL22da9vO5ixzBY4HQeH7rD4ZaHXE9/GP1CJ3fT+QXsI71/bli4ZUwRRxLyHYnxT1/ z268UaqQUumhK6QO5k+o3ZrnUt7BO/q73LvtfYD/CsDAQ0PB+EBbZR3vo2ZvJwpBn1aq 3cDe8+FU6fvIAehcy1sr7o0WxX5D5KXpLyTu+zSaJbpi5sEIKC2iYqA9vI3NaAmMB+gF p9uw== X-Gm-Message-State: APjAAAVGk/kdVmfFPYtG9pcqDHWQUWOBaAMXNJhES08k+dN/wUSXh9LB mh+F/XkFOpWMrM54sDo4NkzceFysRqg= X-Google-Smtp-Source: APXvYqxphCqenf35igGTSUNjzRz1Yn3VTpUpznjDrGQmvXC/ir7s3XOm6va4Z7W3qNTe7MZOSNIpfg== X-Received: by 2002:a5d:88ce:: with SMTP id i14mr7388272iol.307.1566653248824; Sat, 24 Aug 2019 06:27:28 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:53 -0600 Message-Id: <20190824132315.53130-14-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 13/34] binman: Use the Makefile to build ELF test files 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" At present the ELF test files are checked into the U-Boot tree. This is covenient since the files never change and can be used on non-x86 platforms. However it is not good practice to check in binaries and in this case it does not seem essential. Update the binman test-file Makefile to support having source in a different directory. Adjust binman to run it to build bss_data, as a start. We can add other files as needed. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 23 +++++++++++++++++++++++ tools/binman/ftest.py | 24 ++++++++++++++++++------ tools/binman/test/Makefile | 3 ++- tools/binman/test/bss_data | Bin 5020 -> 0 bytes 4 files changed, 43 insertions(+), 7 deletions(-) delete mode 100755 tools/binman/test/bss_data diff --git a/tools/binman/test/bss_data b/tools/binman/test/bss_data deleted file mode 100755 index afa28282aa157f6717c1ba244ecbfc6e1b081734..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5020 zcmeHLyKWOf6uoP&!GJ+|Af+(H7C{(6hJ>s{1O*}i;vz!9k|7jmvEv0>!j5FGr4S(= z1rl`m016r?sner~AE2ip9R*N@0-1AWb`nc8lqu#)$M-R39(#6N?0tS?>89s-Vl5+C zVfN$CU=YG@j+l{90?A29j!9mR>*@YU@kF< zm|&e)-boq-EK+#s=ZTZ35qA7G#*zMGT%X&LM}8Jqyj7L$-{T)Z{jc>) zoA)Lv)i*nzb0r)u1JV{C_dj{X>=n-E`M(bagY)oQhvscm#Cw|eiUr?)4ZOE;EwK{y#HNI)1&RP})m zBwkNM#m(qpx7LoMW}~~GiE7l6ny7lOCu()A-HtoS|Lal&^)SHCcil&Tp9HMgPjH0- zzvtN-*hQ~l7v6r;Bi!p{glWw6bl(A!hIw|q`5|6_-b4W29BS4qZwUqN%N~U8gQR^A zrZmf|AkG8i1!zb3;PIVU3)0{&JlC5}bMnrmF&)Q2Mv+e-r`{#_QQVFIo;@!(Jhvxj;Qe&}5sc3w z=l$WG7=v X-Patchwork-Id: 1152633 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YGScCDDS"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzsd3zf7z9s7T for ; Sat, 24 Aug 2019 23:40:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3DBA1C21E49; Sat, 24 Aug 2019 13:34:05 +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=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 92E08C21E49; Sat, 24 Aug 2019 13:31:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EABB0C21DEC; Sat, 24 Aug 2019 13:27:36 +0000 (UTC) Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by lists.denx.de (Postfix) with ESMTPS id 0E01CC21DAF for ; Sat, 24 Aug 2019 13:27:32 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id t3so26585828ioj.12 for ; Sat, 24 Aug 2019 06:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=W/Vn8YuMWbcMsEHwceSHwAy9RqWroJAfzljbxY3ZALE=; b=YGScCDDSyBswkYSaNktdJqj2RZboHhLJAvVjAabbMjWkZtCd0Qm59ersjXwA5518bM lG5Tq2ioVLCCvnx5a7Y0QK862ycFpCLO0b4Ll2nBZva3DzjH+2ZU2xiHQCeP8Hb6LE7K l1raUpHh/y/RHCrYS8IKOCYNMhY1nOEg+3CjI= 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:mime-version:content-transfer-encoding; bh=W/Vn8YuMWbcMsEHwceSHwAy9RqWroJAfzljbxY3ZALE=; b=iPbmz5umHFR+c56shh7nCeFxMjZOiaEBrVvJm0SmghFHYO49r+9dncxvG+nQekLZ7C 6ae/MCesjAMM4Z9Apu5M9HhCITnpWvxTVwHUwE/s7Vh8OzE1qjE5KAL+RQIRjNfZ1m2t IdTD6lVCkpoGpF8m+swXKdItsvdkBUJghqofYLsNKO+Ls2zqiVzrjItfd07PLwy+vlbq FNeAOAW/oWXYoIGuvyImt/L5ZPzpYkjAF2D2Uaz979W/eEN4/sproD63XVNj7T4oDMIg Bp50oLiWI4hu5bo93w9DBO4rZB6lhLtUnhl4k7YlmA69eKOScYtUAYyJOAHGb1XBu5cc VBvQ== X-Gm-Message-State: APjAAAUm5ZUNuctPzp2zbQqtHclXvYmAU0S+ZFayDl2Qv/+zVpktGHdn 39QHxDTQi13z1fGDecPLrjvjezUMbVo= X-Google-Smtp-Source: APXvYqwJ21v3apK1oBm+QCy1hCh1yKYQB60SlzipQvCxYUXw+c/MbIafL1j2h4ktjYvcrb97MU+5Bg== X-Received: by 2002:a05:6638:637:: with SMTP id h23mr9574120jar.59.1566653250764; Sat, 24 Aug 2019 06:27:30 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:30 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:54 -0600 Message-Id: <20190824132315.53130-15-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 14/34] binman: Use the Makefile for u_boot_ucode_ptr 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" Remove this file from git and instead build it using the Makefile. Update tools.GetInputFilename() to support reading files from an absolute path, so that we can read the Elf test files easily. Also make sure that the temp directory is report in ELF tests as this was commented out. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 19 +++++++++++++++---- tools/binman/ftest.py | 14 +++++++------- tools/binman/test/Makefile | 2 +- tools/binman/test/u_boot_ucode_ptr | Bin 4175 -> 0 bytes tools/binman/test/u_boot_ucode_ptr.lds | 3 ++- tools/patman/tools.py | 2 +- 6 files changed, 26 insertions(+), 14 deletions(-) delete mode 100755 tools/binman/test/u_boot_ucode_ptr diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index 736b931fd5..403ca2b412 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -75,18 +75,29 @@ def BuildElfTestFiles(target_dir): class TestElf(unittest.TestCase): @classmethod - def setUpClass(self): + def setUpClass(cls): + cls._indir = tempfile.mkdtemp(prefix='elf.') tools.SetInputDirs(['.']) + BuildElfTestFiles(cls._indir) + + @classmethod + def tearDownClass(cls): + if cls._indir: + shutil.rmtree(cls._indir) + + @classmethod + def ElfTestFile(cls, fname): + return os.path.join(cls._indir, fname) def testAllSymbols(self): """Test that we can obtain a symbol from the ELF file""" - fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr') + fname = self.ElfTestFile('u_boot_ucode_ptr') syms = elf.GetSymbols(fname, []) self.assertIn('.ucode', syms) def testRegexSymbols(self): """Test that we can obtain from the ELF file by regular expression""" - fname = os.path.join(binman_dir, 'test', 'u_boot_ucode_ptr') + fname = self.ElfTestFile('u_boot_ucode_ptr') syms = elf.GetSymbols(fname, ['ucode']) self.assertIn('.ucode', syms) syms = elf.GetSymbols(fname, ['missing']) @@ -201,7 +212,7 @@ class TestElf(unittest.TestCase): self.assertEqual(elf.ElfInfo(b'\0\0' + expected[2:], load, entry, len(expected)), elf.DecodeElf(data, load + 2)) - #shutil.rmtree(outdir) + shutil.rmtree(outdir) if __name__ == '__main__': diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index fad62bb04f..e7ade0fddf 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -152,8 +152,8 @@ class TestFunctional(unittest.TestCase): elf_test.BuildElfTestFiles(cls._elf_testdir) # ELF file with a '_dt_ucode_base_size' symbol - with open(cls.TestFile('u_boot_ucode_ptr'), 'rb') as fd: - TestFunctional._MakeInputFile('u-boot', fd.read()) + TestFunctional._MakeInputFile('u-boot', + tools.ReadFile(cls.ElfTestFile('u_boot_ucode_ptr'))) # Intel flash descriptor file with open(cls.TestFile('descriptor.bin'), 'rb') as fd: @@ -489,7 +489,7 @@ class TestFunctional(unittest.TestCase): Filename of ELF file to use as SPL """ # TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile() - if src_fname in ['bss_data']: + if src_fname in ['bss_data', 'u_boot_ucode_ptr']: fname = cls.ElfTestFile(src_fname) else: fname = cls.TestFile(src_fname) @@ -1101,8 +1101,8 @@ class TestFunctional(unittest.TestCase): finally: # Put the original file back - with open(self.TestFile('u_boot_ucode_ptr'), 'rb') as fd: - TestFunctional._MakeInputFile('u-boot', fd.read()) + TestFunctional._MakeInputFile('u-boot', + tools.ReadFile(self.ElfTestFile('u_boot_ucode_ptr'))) def testMicrocodeNotInImage(self): """Test that microcode must be placed within the image""" @@ -1818,8 +1818,8 @@ class TestFunctional(unittest.TestCase): u-boot-tpl.dtb with the microcode removed the microcode """ - with open(self.TestFile('u_boot_ucode_ptr'), 'rb') as fd: - TestFunctional._MakeInputFile('tpl/u-boot-tpl', fd.read()) + TestFunctional._MakeInputFile('tpl/u-boot-tpl', + tools.ReadFile(self.ElfTestFile('u_boot_ucode_ptr'))) first, pos_and_size = self._RunMicrocodeTest('093_x86_tpl_ucode.dts', U_BOOT_TPL_NODTB_DATA) self.assertEqual(b'tplnodtb with microc' + pos_and_size + diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile index ce1c2f900c..fd660eac6e 100644 --- a/tools/binman/test/Makefile +++ b/tools/binman/test/Makefile @@ -10,7 +10,7 @@ VPATH := $(SRC) CFLAGS := -march=i386 -m32 -nostdlib -I ../../../include -LDS_UCODE := -T u_boot_ucode_ptr.lds +LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds LDS_BINMAN := -T u_boot_binman_syms.lds LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds diff --git a/tools/binman/test/u_boot_ucode_ptr b/tools/binman/test/u_boot_ucode_ptr deleted file mode 100755 index dbfb184cecfbcf55cf43ed4f4ac0ee90a7364d93..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4175 zcmeHKze~eV5WfDv>Y%NqTOB%ds7Rl!MiB>>qFqFAD7b~B30kpLh}je}Vs) zgM)i3QgG0CU(yE=7YE1p!Ew2t@9xWVH@o|LsZ@#-(v%@sqt7rjSl=(i5rZlmsZoxy zQ9SaF!jM>&I0rHVXMs3_>*wPh=u>4I0zc&NRXVJG0rgz2p&8H&Xa+O`ngPv#Wh9TCMV?U7?UiPJBvzCKcpQta-m##SW0$~TeGpF8jNCaKqaY=Oj ze&6*ZKlNvnIWxzC`EXm}&a5V?u^%8_A>)8o(X9qLQXD z#1~o6OQFqqJIY{<8~_@#DLmzgZrQ+Xi@EVGZrnMRWWNeKSJ|ha`YAi9u{Z4aQjhnG z?c~ddtBklhOXCp#9(;g{)Q?Fq+c>PTU-d6wo4~YvUz*V$GtcEfbjfs-ZCgXv9QLkU KGKbO{NcskUZF7hK diff --git a/tools/binman/test/u_boot_ucode_ptr.lds b/tools/binman/test/u_boot_ucode_ptr.lds index 0cf9b762b5..cf4d1b8bbd 100644 --- a/tools/binman/test/u_boot_ucode_ptr.lds +++ b/tools/binman/test/u_boot_ucode_ptr.lds @@ -9,9 +9,10 @@ ENTRY(_start) SECTIONS { - . = 0xfffffdf0; + . = 0xfffffe14; _start = .; .ucode : { *(.ucode) } + .interp : { *(.interp*) } } diff --git a/tools/patman/tools.py b/tools/patman/tools.py index 0952681579..4a7fcdad21 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -125,7 +125,7 @@ def GetInputFilename(fname): Returns: The full path of the filename, within the input directory """ - if not indir: + if not indir or fname[:1] == '/': return fname for dirname in indir: pathname = os.path.join(dirname, fname) From patchwork Sat Aug 24 13:22:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152634 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="nxszGDlj"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzsm5MJ7z9s7T for ; Sat, 24 Aug 2019 23:40:12 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 779C4C21E1E; Sat, 24 Aug 2019 13:30:33 +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=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 47128C21C3F; Sat, 24 Aug 2019 13:28:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA623C21C8B; Sat, 24 Aug 2019 13:27:37 +0000 (UTC) Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by lists.denx.de (Postfix) with ESMTPS id 84027C21C93 for ; Sat, 24 Aug 2019 13:27:33 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id j4so18334896iog.11 for ; Sat, 24 Aug 2019 06:27:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kzG8/dSH/VhQkaH0ASlIW+PkiRJUfAiODh8BJudIEak=; b=nxszGDljNCrHwDGWzNUAwv/RfsTIugpmA4hCFICsdMFf8i0t5D1xkyNIDZOLmYGykG ZZdXuEBGtV2YoIJTNFei6yM8cVNKrXyEsOc+SlfpSYdOtPmxBbeQG/4o2zK7ir0ptGPE olL9bxmYWqfJcdZQ8NjNLqROlCuZjNnpn3yE4= 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:mime-version:content-transfer-encoding; bh=kzG8/dSH/VhQkaH0ASlIW+PkiRJUfAiODh8BJudIEak=; b=g/lSmPHgtz7BOjBMuT6XoQhnS36YHRPtUFkjIdsLOSiAetrQ9qkh4dLWQwKtjwLunh VvMJnrV/dEck633rFRufxiv9Sf/bFmu6qllyMUOobd+o5/68/1yo9NkPl9YgiC5Q0lW5 EZT0td2PCJYzXNGqw2ICfSI52C8gSRApbtMjL9jsTPUkIbnBkH5F+LALWgQbsLPsGco+ Yeq7nr8m74nRCLAv8XcJGJCCu+Y0LDNkvkOZlP2l/EGMNe48XghvSwGyJojhuddwl0ZQ S+j4mNnYa4VphQRwhDO9IRW6COdYTVE2Xi8gGjpD8OmB0iVIGsNf7AJCd8CW44mMyN+j 9Hlw== X-Gm-Message-State: APjAAAXrnu9M/IYK60TpDABM5DpHzhmFMswySbqI9NpihHwG9emCHzRe sVcU7ddsRp4OEsWZkacH3dj4Bad7028= X-Google-Smtp-Source: APXvYqz8qToaxenT2slvduZ2mDlKLqqN/QhbYLxw53tzy9O3s0xqFNLWZRUzaJq4svyPUz+EhzwVtg== X-Received: by 2002:a5d:9ad0:: with SMTP id x16mr1235018ion.66.1566653252409; Sat, 24 Aug 2019 06:27:32 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:55 -0600 Message-Id: <20190824132315.53130-16-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 15/34] binman: Use the Makefile for u_boot_no_ucode_ptr 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" Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 2 +- tools/binman/ftest.py | 10 +++++----- tools/binman/test/u_boot_no_ucode_ptr | Bin 4182 -> 0 bytes 3 files changed, 6 insertions(+), 6 deletions(-) delete mode 100755 tools/binman/test/u_boot_no_ucode_ptr diff --git a/tools/binman/test/u_boot_no_ucode_ptr b/tools/binman/test/u_boot_no_ucode_ptr deleted file mode 100755 index f72462f0be41a934d468481bf627d6c1ec9a8e1c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4182 zcmeHKy-EW?5T5*Cv``}iEVQ^HMMSbDdWK+O6Euwq7AdTbT<(Ygb0^7OVG6bMF|2$8 zpFw;En;;05iM_7#<+2d5v9R2MkJ51hV9kJT?hJ(n9X3>XFs1BL;^fMLKe zU>GnA7zPXjhJk-z0Q*;tkz&+O8uWhlJbWr0zYHsC`1(-IehePl*#DA<*J^uKq2We> zj4WGJgSdDb~a)^k?3D_Wz%IXd$B&(ry!KRXa|vSqt1m_?06)iR_OU8 zT4A^A2a>P)v#fDuhJp8Cx5S>ApQ*-t5W&D4m^1gKRF3!4c|L2=dAsaDUTGS@9=oZN zrZL1<80e*?&UyRVV2vCIG~TA=ewpZ&4eYjfH}1ubyTF+3XR))wJ}tVRwr4fwh8=I} z@qDp8do$uXBd$)(xO`84NJ_C$;LPaVgT TQ=i-H`%b?z@X6`RW>3;L6WVxU diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index 403ca2b412..c7f51bb86a 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -70,7 +70,7 @@ def BuildElfTestFiles(target_dir): del os.environ['MAKEFLAGS'] tools.Run('make', '-C', target_dir, '-f', os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir, - 'bss_data', 'u_boot_ucode_ptr') + 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr') class TestElf(unittest.TestCase): diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index e7ade0fddf..30a8b0b14c 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -489,7 +489,7 @@ class TestFunctional(unittest.TestCase): Filename of ELF file to use as SPL """ # TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile() - if src_fname in ['bss_data', 'u_boot_ucode_ptr']: + if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr']: fname = cls.ElfTestFile(src_fname) else: fname = cls.TestFile(src_fname) @@ -1091,8 +1091,8 @@ class TestFunctional(unittest.TestCase): """Test that a U-Boot binary without the microcode symbol is detected""" # ELF file without a '_dt_ucode_base_size' symbol try: - with open(self.TestFile('u_boot_no_ucode_ptr'), 'rb') as fd: - TestFunctional._MakeInputFile('u-boot', fd.read()) + TestFunctional._MakeInputFile('u-boot', + tools.ReadFile(self.ElfTestFile('u_boot_no_ucode_ptr'))) with self.assertRaises(ValueError) as e: self._RunPackUbootSingleMicrocode() @@ -1114,8 +1114,8 @@ class TestFunctional(unittest.TestCase): def testWithoutMicrocode(self): """Test that we can cope with an image without microcode (e.g. qemu)""" - with open(self.TestFile('u_boot_no_ucode_ptr'), 'rb') as fd: - TestFunctional._MakeInputFile('u-boot', fd.read()) + TestFunctional._MakeInputFile('u-boot', + tools.ReadFile(self.ElfTestFile('u_boot_no_ucode_ptr'))) data, dtb, _, _ = self._DoReadFileDtb('044_x86_optional_ucode.dts', True) # Now check the device tree has no microcode From patchwork Sat Aug 24 13:22:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152643 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="QJMz+0Ye"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzx40pL0z9s7T for ; Sat, 24 Aug 2019 23:43:03 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 9B151C21D8A; Sat, 24 Aug 2019 13:33:38 +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=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 2AA7EC21E45; Sat, 24 Aug 2019 13:30:58 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 9E4C8C21E45; Sat, 24 Aug 2019 13:27:39 +0000 (UTC) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by lists.denx.de (Postfix) with ESMTPS id 576AFC21DFA for ; Sat, 24 Aug 2019 13:27:35 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id e20so26588432iob.9 for ; Sat, 24 Aug 2019 06:27:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jWYOmvzKk+E2453wiKqYKlFCEsexGByouL4QZqUrstc=; b=QJMz+0Ye3dtxDC4BT1sNBjaFTuEEb5qEl7D1hqk403oPJiTqZBoWJ5zpZLCqrlV8LD 19FyOF9ZF1bPQXTogcIHO3P49qFQ74MhafLtgcy3APykKT0e6qOS/ptIMvgo3cwmmcyd RbGKeOXAZDoENA/H0+BBiRn0bmGDbQnac4814= 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:mime-version:content-transfer-encoding; bh=jWYOmvzKk+E2453wiKqYKlFCEsexGByouL4QZqUrstc=; b=mb0+im3aDamF/JAS9KBN+wULhhJ0n3HsMuX4Fyew3XEDw/dR1MbCwwYZAOAuNry325 7KRQJLbtXdKD8bfrzdFN/Y30MTBuqMZS1WPLFhZB2gXgSyjJs868fgKzTexs8bGfzZHF +aN6rsd0mmbQh4eRp2iHwNDmJ4IFSpOwlCyep6T6zJ/t+K1Yc8ij/A2HHZ9txbBvIFeX cBcITKM9X01+e2bqF+z099oIAMwPEFxsI/p6DihKWX3jiHbRCwP49GsbzI6C0ljxiKB8 kmD1iS9CEV/CvwKl4OpbC+6GBGbGlfxdNp+zjpWy8ZwAY4MSNOEzs9Dut1jegHRvduJU cgfw== X-Gm-Message-State: APjAAAWnN9m9DiUvGbv4FmaXVGtvLJk0JamY4OihsywbfiqqJWtCyCBL CDC/38D0qxYJUsxJ0jI8x8QWe4qdirg= X-Google-Smtp-Source: APXvYqwE3vX0gxX4pGnUl0c3bnm6yx2Z9WFDpGDn2fU8mZc8bzs32u7P2vwEtbs36LGla1bYVcOb3g== X-Received: by 2002:a02:cc50:: with SMTP id i16mr9682525jaq.50.1566653254113; Sat, 24 Aug 2019 06:27:34 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:33 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:56 -0600 Message-Id: <20190824132315.53130-17-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 16/34] binman: Use the Makefile for u_boot_binman_syms 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" Remove this file from git and instead build it using the Makefile. With this change a few things need to be adjusted: 1. The 'notes' section no-longer appears at the start of the ELF file (before the code), so update testSymbols to adjust the offsets. 2. The dynamic linker is disabled to avoid errors like: "Not enough room for program headers, try linking with -N" 3. The interpreter note is moved to the end of the image, so that the binman symbols appear first. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 9 +++++---- tools/binman/ftest.py | 7 ++++--- tools/binman/test/Makefile | 5 +++-- tools/binman/test/u_boot_binman_syms | Bin 4924 -> 0 bytes tools/binman/test/u_boot_binman_syms.lds | 1 + 5 files changed, 13 insertions(+), 9 deletions(-) delete mode 100755 tools/binman/test/u_boot_binman_syms diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index c7f51bb86a..ff036cb655 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -70,7 +70,8 @@ def BuildElfTestFiles(target_dir): del os.environ['MAKEFLAGS'] tools.Run('make', '-C', target_dir, '-f', os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir, - 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr') + 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', + 'u_boot_binman_syms', 'u_boot_binman_syms.bin') class TestElf(unittest.TestCase): @@ -118,7 +119,7 @@ class TestElf(unittest.TestCase): """Test a symbol which extends outside the entry area is detected""" entry = FakeEntry(10) section = FakeSection() - elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms') + elf_fname = self.ElfTestFile('u_boot_binman_syms') with self.assertRaises(ValueError) as e: syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertIn('entry_path has offset 4 (size 8) but the contents size ' @@ -158,7 +159,7 @@ class TestElf(unittest.TestCase): """ entry = FakeEntry(20) section = FakeSection(sym_value=None) - elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms') + elf_fname = self.ElfTestFile('u_boot_binman_syms') syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertEqual(tools.GetBytes(255, 16) + tools.GetBytes(ord('a'), 4), entry.data) @@ -169,7 +170,7 @@ class TestElf(unittest.TestCase): tout.Init(tout.DEBUG) entry = FakeEntry(20) section = FakeSection() - elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms') + elf_fname = self.ElfTestFile('u_boot_binman_syms') with test_util.capture_sys_output() as (stdout, stderr): syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertTrue(len(stdout.getvalue()) > 0) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 30a8b0b14c..507c481881 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -489,7 +489,8 @@ class TestFunctional(unittest.TestCase): Filename of ELF file to use as SPL """ # TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile() - if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr']: + if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', + 'u_boot_binman_syms']: fname = cls.ElfTestFile(src_fname) else: fname = cls.TestFile(src_fname) @@ -1223,14 +1224,14 @@ class TestFunctional(unittest.TestCase): def testSymbols(self): """Test binman can assign symbols embedded in U-Boot""" - elf_fname = self.TestFile('u_boot_binman_syms') + elf_fname = self.ElfTestFile('u_boot_binman_syms') syms = elf.GetSymbols(elf_fname, ['binman', 'image']) addr = elf.GetSymbolAddress(elf_fname, '__image_copy_start') self.assertEqual(syms['_binman_u_boot_spl_prop_offset'].address, addr) self._SetupSplElf('u_boot_binman_syms') data = self._DoReadFile('053_symbols.dts') - sym_values = struct.pack('b@{x4c zE5;WsFm2Hg^@?wr9YU~>YH4`}5c1&&ByC=kmIE-njg7@cOGNIMMrEqY*0%Jew;7a^sB_W@r02_y_o5))_MHhhw82$s+oLkVEs6T@@=QIAe5MwG*swm5} ziUw&Crm7exh3p9vPRSx4ZmE2fu9lN4Ibsc9FJs@4 ncxM85*3jr@_lETl{jT6ScUlE_F7M+JFyC(j{k|b*%=G&MuziL^ diff --git a/tools/binman/test/u_boot_binman_syms.lds b/tools/binman/test/u_boot_binman_syms.lds index 29cf9d0e54..926df873cb 100644 --- a/tools/binman/test/u_boot_binman_syms.lds +++ b/tools/binman/test/u_boot_binman_syms.lds @@ -25,5 +25,6 @@ SECTIONS KEEP(*(SORT(.binman_sym*))); __binman_sym_end = .; } + .interp : { *(.interp*) } } From patchwork Sat Aug 24 13:22:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152622 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OzQp5vz8"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzlm406Bz9s7T for ; Sat, 24 Aug 2019 23:35:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D1018C21E60; Sat, 24 Aug 2019 13:33:53 +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=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 D92F3C21D4A; Sat, 24 Aug 2019 13:31:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3DD85C21D4A; Sat, 24 Aug 2019 13:27:41 +0000 (UTC) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by lists.denx.de (Postfix) with ESMTPS id 0F9D2C21DF9 for ; Sat, 24 Aug 2019 13:27:37 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id x4so26549488iog.13 for ; Sat, 24 Aug 2019 06:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DPMm61GDr1tkQZRU77YnR4I3QrWp9NfgU2BuIiQgr1Q=; b=OzQp5vz8QaxPbxDM8+CrNzRZD6IfnjOLkDFYEKsIEnAaI0NwItixN0/Q87w/PUU+29 fTjWjbqwnaaIHAw930SUlhEIdLQzBioyv84QFdmMx/GVgdu4jPF9pc5j1AKjLoG6EPB9 SiGXEuXGvRAPyRr/ltlnbK4S8ygEK5C9lEsrk= 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:mime-version:content-transfer-encoding; bh=DPMm61GDr1tkQZRU77YnR4I3QrWp9NfgU2BuIiQgr1Q=; b=V5tef39W1ellkLlEgNvPGUHgKSm94ae4yZqRnmWhGUjZxlO0d/Exa8yXcYQ0m2cJt8 vSWb+zOdm1aW7NZYqp1TUAAtjRS51vKS+0jlHRCBcPsMBg7q9Oc2u8Q6V692ituw3uD+ 7+R839sW4T/vPfIYitBQaAF4Q97nbsKswPw9YjB6T7rpHtVoxJD5P+ndpEp5eEu537vt 1KvOLLA9e7wvn3ALILgvgZc2dhhb6mFMlAJ53X9YxfZMVId3I0nGjYX9xznzw/yl/J6E FLMpmNt070NB8pv0NuPYdr8ICCfefg19dA2QaYQ1plTznwLQsCllLX2S7quQFRokG8Lw ujDg== X-Gm-Message-State: APjAAAWqtNwYk22JAHyNx/h7JWFABfKzHLPxH5RqO4Rrvhg6emWxFueK wZgKmKx9iNs6IcWV9AtslbIPmjF2cPs= X-Google-Smtp-Source: APXvYqwPqxC5lm7nr+h7u/OxZBpw+AVkD4TNm/6QOsEH5ZkcNEH2KHmhuNZsQclThX1sTFHudHDdmA== X-Received: by 2002:a6b:6516:: with SMTP id z22mr13239067iob.7.1566653255819; Sat, 24 Aug 2019 06:27:35 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:35 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:57 -0600 Message-Id: <20190824132315.53130-18-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 17/34] binman: Use the Makefile for u_boot_binman_syms_size 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" Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 5 +++-- tools/binman/ftest.py | 2 +- tools/binman/test/u_boot_binman_syms_size | Bin 4825 -> 0 bytes 3 files changed, 4 insertions(+), 3 deletions(-) delete mode 100755 tools/binman/test/u_boot_binman_syms_size diff --git a/tools/binman/test/u_boot_binman_syms_size b/tools/binman/test/u_boot_binman_syms_size deleted file mode 100755 index d691e897c0f1842cb82efbc67f57d9f62853b99c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4825 zcmeHLyKWOv5FI~+mChk_G%jq(2>Hq;D?t(oMY4z$2|-f0i*)7nuFOi_hrD+Sryze| zet;iH2NGo(I=XcH0Tm7Tf^f#WV{DlQ>O0c$+?hEuyZ6|Q=jzq#lTxWfVr8n3L=KW4 z>v_eY1}bf;Q8lj@d9Jn!Jm3KNYT?=D&rP=W*Agf^anP^*B!EMcZ%C C$!_BS diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index ff036cb655..a913970150 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -71,7 +71,8 @@ def BuildElfTestFiles(target_dir): tools.Run('make', '-C', target_dir, '-f', os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir, 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', - 'u_boot_binman_syms', 'u_boot_binman_syms.bin') + 'u_boot_binman_syms', 'u_boot_binman_syms.bin', + 'u_boot_binman_syms_size') class TestElf(unittest.TestCase): @@ -145,7 +146,7 @@ class TestElf(unittest.TestCase): """ entry = FakeEntry(10) section = FakeSection() - elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms_size') + elf_fname =self.ElfTestFile('u_boot_binman_syms_size') with self.assertRaises(ValueError) as e: syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) self.assertIn('has size 1: only 4 and 8 are supported', diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 507c481881..51eab6fbfa 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -490,7 +490,7 @@ class TestFunctional(unittest.TestCase): """ # TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile() if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', - 'u_boot_binman_syms']: + 'u_boot_binman_syms', 'u_boot_binman_syms_size']: fname = cls.ElfTestFile(src_fname) else: fname = cls.TestFile(src_fname) From patchwork Sat Aug 24 13:22:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152636 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jAPvkWjr"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FztC1H2Qz9s7T for ; Sat, 24 Aug 2019 23:40:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id D9303C21E7D; Sat, 24 Aug 2019 13:33:26 +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 6B104C21C50; Sat, 24 Aug 2019 13:30:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4E52AC21DEC; Sat, 24 Aug 2019 13:27:43 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id 8B4EBC21E12 for ; Sat, 24 Aug 2019 13:27:38 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id p12so26732928iog.5 for ; Sat, 24 Aug 2019 06:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RCWDR34j1/1r6mr6S4bBmw8KMbTri/1NSTN8pWOZ6Q4=; b=jAPvkWjrZE+AlzvVLPnmr1h817HMxL0PgXRCx6DmoNuvnoyyuDEMYP2HsdvDUjCHwb lQRi/JoBv2oop/td+a8faoMwJbBDXUGTjcpTaFzPGS6t/PBKLLb7TbhyYC74Zf14+KWK 9vkr/RnF2r/iS/r3Mg4MmIk5oCg4WvyVSvHB0= 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:mime-version:content-transfer-encoding; bh=RCWDR34j1/1r6mr6S4bBmw8KMbTri/1NSTN8pWOZ6Q4=; b=aB4uldkDpNu/MaNvjcqViukV8R7Kq2TNLsdV+RIBtUkH/vmJvzxpbIT0d9RiUk/8L6 GowZfmvhzbXWAXduZ/79TEaEfCYbjT7jIykSAKkVIDGox3czymOrgTIOZu8yd7B+BCx5 ox69UZRp0tiz0p0zmXtgk3QDOpb020DhI1tyE7cPWclzuMHjViMqC8mA2hSINIsn9XMO yefvzN9XQDXqnJA10i7eYwKEpGfOarrdyDFubJPJErQXQ6zinjV1lzaGQ9MJh2xzQBUf SWxdGZd/R2KzQpco4gBcQBWybNS1yFv5mGQyxnZ8YlWMS7hi/0ZYjAXGAi5jmEabamWp HJWg== X-Gm-Message-State: APjAAAWGGHny/j9uapckt4g7lbLrpp8/S1XIYLSEq+DROeXf/LSdrejG YWzPD7XjS/FM7e6+6Hd1cKf2cB6FkQc= X-Google-Smtp-Source: APXvYqwTryuZyMoSBWpwzmLEQYrKpGzQJRX+OQ8Bs85wXV+t+xGyCBtnq2zFrswWel59OyxAWo1SpA== X-Received: by 2002:a6b:fd10:: with SMTP id c16mr12518951ioi.217.1566653257343; Sat, 24 Aug 2019 06:27:37 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:37 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:58 -0600 Message-Id: <20190824132315.53130-19-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 18/34] binman: Use the Makefile for u_boot_binman_syms_bad 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" Remove this file from git and instead build it using the Makefile. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 4 ++-- tools/binman/test/Makefile | 2 +- tools/binman/test/u_boot_binman_syms_bad | Bin 4890 -> 0 bytes 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100755 tools/binman/test/u_boot_binman_syms_bad diff --git a/tools/binman/test/u_boot_binman_syms_bad b/tools/binman/test/u_boot_binman_syms_bad deleted file mode 100755 index 8da3d9d48f388a9be53e92590984411691f6721f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4890 zcmeHLJ!=$E6up~WjOjLFrOg&wtVkY797F^`2yqpRVv#}#JZ3VBF6_=MJ8y(ENwASv zTZuow-an8(k|ITFk^BHXXW!gp@?m5BF5I~v=e#@bo!MsJ-ulaDjYdP%=A?|UEab!>$^ba;d9Esg+fF-hI&dUhZQ7UZ1yrOXM4R zYC2Er>!RM|@O-r9g*UTShR0j-`;X7g>pMufp8HzF`iCBxJ=-|V6J$O3O*rv)h}25? zACdEJh}H)F8BzDcT1uPbxwGeAzOYH0nr+cmMJOgCJDKJaJIM>Ng^Q=|8p>*oQ;n?F U$JtH|)8YK34YE{hz2S%d1wo~NOaK4? diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index a913970150..1ee5d9d57c 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -72,7 +72,7 @@ def BuildElfTestFiles(target_dir): os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir, 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', 'u_boot_binman_syms', 'u_boot_binman_syms.bin', - 'u_boot_binman_syms_size') + 'u_boot_binman_syms_size', 'u_boot_binman_syms_bad') class TestElf(unittest.TestCase): @@ -134,7 +134,7 @@ class TestElf(unittest.TestCase): """ entry = FakeEntry(10) section = FakeSection() - elf_fname = os.path.join(binman_dir, 'test', 'u_boot_binman_syms_bad') + elf_fname = self.ElfTestFile('u_boot_binman_syms_bad') self.assertEqual(elf.LookupAndWriteSymbols(elf_fname, entry, section), None) diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile index 7af5459793..593bbe9bd9 100644 --- a/tools/binman/test/Makefile +++ b/tools/binman/test/Makefile @@ -13,7 +13,7 @@ CFLAGS := -march=i386 -m32 -nostdlib -I $(SRC)../../../include \ LDS_UCODE := -T $(SRC)u_boot_ucode_ptr.lds LDS_BINMAN := -T $(SRC)u_boot_binman_syms.lds -LDS_BINMAN_BAD := -T u_boot_binman_syms_bad.lds +LDS_BINMAN_BAD := -T $(SRC)u_boot_binman_syms_bad.lds TARGETS = u_boot_ucode_ptr u_boot_no_ucode_ptr bss_data \ u_boot_binman_syms u_boot_binman_syms.bin u_boot_binman_syms_bad \ From patchwork Sat Aug 24 13:22:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152624 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="C0epZOEA"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzmJ4lvKz9s7T for ; Sat, 24 Aug 2019 23:35:28 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 521EAC21E30; Sat, 24 Aug 2019 13:32:00 +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=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 47933C21E30; Sat, 24 Aug 2019 13:29:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8BA59C21D56; Sat, 24 Aug 2019 13:27:44 +0000 (UTC) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by lists.denx.de (Postfix) with ESMTPS id 2C144C21DDC for ; Sat, 24 Aug 2019 13:27:40 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id p12so26733018iog.5 for ; Sat, 24 Aug 2019 06:27:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xcOsBX3q1kA4JDPBNY3J+NYvJ20Yi0vVqrfkD/uES0w=; b=C0epZOEAEqjz7Gn48DdkxjlEFj0LNZ45WhDtKnwgMRBnKjUppiz4w99nOByMOO4fY4 Jw8x3UDuPq3lyOPVQXoMtpK7O1XnXhHvOzTQgAwXn5h2eDHYksJ0ywskphgVGKnkulgf f5lF/TU96ovxZ/cD8WP8BfZF1nNCk9RdT2Src= 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:mime-version:content-transfer-encoding; bh=xcOsBX3q1kA4JDPBNY3J+NYvJ20Yi0vVqrfkD/uES0w=; b=pklVvhAi+qqsmbKslz3Nwd49dlk0npS4EmxIIVrCfS2t4Q6ihOcKABpXElqsnhiVsu rV+0mrU8hFXPx6/xbPnGtzjqD66qoTRGGWcGaEhaztlEjR7rLblNylOCbsjmw2b2IZNr RYXwg+jIQRLOMvBz+JedgKpchZgpyDbHX/DZfSEsFdKT6cVEDVd3rpgJhuYNpwVfQxcM TZZ0ekoRCuYqj4nHHbSjWoqeR3FJ4K2aN4VHt/74bfUgde1xN/Ad9Q1F6wmXvUebJCQ3 88EMNOohd8B++gpzksL8yhdoI0ewjB2Da9nO2CNb9G4/zF96bUIDs80vLAACMXWgOvVp tPLA== X-Gm-Message-State: APjAAAVkhv50JRlYm7Cp5jWvqUNORIy+Q3QkDnnRc+++8338po48qMRp cMJ8ihYgkBiADw/Ct6qKm3PQufuwBNQ= X-Google-Smtp-Source: APXvYqzcURFr/X6orfcsTzmj4HK/1YGqiY1SknNucsPSSq+9t2JZJm8aV15Wdn/ZYhO+8RFu3WSiEA== X-Received: by 2002:a6b:3b57:: with SMTP id i84mr13620815ioa.145.1566653259025; Sat, 24 Aug 2019 06:27:39 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:22:59 -0600 Message-Id: <20190824132315.53130-20-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 19/34] binman: Clean up unnecessary code related to ELF test files 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" We use the Makefile for all ELF test files now, so drop all the code that checks whether to get the test file from the Makefile or from the git repo. Also add a comment to the Makefile indicating that it is run from binman. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 5 +---- tools/binman/ftest.py | 9 ++------- tools/binman/test/Makefile | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index 1ee5d9d57c..f05545bcb1 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -69,10 +69,7 @@ def BuildElfTestFiles(target_dir): if 'MAKEFLAGS' in os.environ: del os.environ['MAKEFLAGS'] tools.Run('make', '-C', target_dir, '-f', - os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir, - 'bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', - 'u_boot_binman_syms', 'u_boot_binman_syms.bin', - 'u_boot_binman_syms_size', 'u_boot_binman_syms_bad') + os.path.join(testdir, 'Makefile'), 'SRC=%s/' % testdir) class TestElf(unittest.TestCase): diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 51eab6fbfa..1d774e28e5 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -488,13 +488,8 @@ class TestFunctional(unittest.TestCase): Args: Filename of ELF file to use as SPL """ - # TODO(sjg@chromium.org): Drop this when all Elf files use ElfTestFile() - if src_fname in ['bss_data', 'u_boot_ucode_ptr', 'u_boot_no_ucode_ptr', - 'u_boot_binman_syms', 'u_boot_binman_syms_size']: - fname = cls.ElfTestFile(src_fname) - else: - fname = cls.TestFile(src_fname) - TestFunctional._MakeInputFile('spl/u-boot-spl', tools.ReadFile(fname)) + TestFunctional._MakeInputFile('spl/u-boot-spl', + tools.ReadFile(cls.ElfTestFile(src_fname))) @classmethod def TestFile(cls, fname): diff --git a/tools/binman/test/Makefile b/tools/binman/test/Makefile index 593bbe9bd9..bdbb009874 100644 --- a/tools/binman/test/Makefile +++ b/tools/binman/test/Makefile @@ -1,5 +1,5 @@ # -# Builds test programs +# Builds test programs. This is launched from elf_test.BuildElfTestFiles() # # Copyright (C) 2017 Google, Inc # Written by Simon Glass From patchwork Sat Aug 24 13:23:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152642 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="F+VC0K1u"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzwq3pkrz9s7T for ; Sat, 24 Aug 2019 23:42:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 29106C21D8A; Sat, 24 Aug 2019 13:31:08 +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=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 CA7A1C21E49; Sat, 24 Aug 2019 13:29:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 4C757C21E07; Sat, 24 Aug 2019 13:27:46 +0000 (UTC) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by lists.denx.de (Postfix) with ESMTPS id ADF45C21DF9 for ; Sat, 24 Aug 2019 13:27:41 +0000 (UTC) Received: by mail-io1-f67.google.com with SMTP id e20so26588843iob.9 for ; Sat, 24 Aug 2019 06:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5qWe34Qy/1bISohMU7IbFYkAxAfJ+/ilpVNevaPRhOo=; b=F+VC0K1uiOKy1cUZnraeCh2zizTJ6+OEkhB0EO9tt4k1WghZmbOHvtFWlZ79G4uDY2 VxbRV4hjJHO3HaSWn7oMMbtemKcNw8j5fVL3RLUjbxPcSmAOMYUf4aUCZFUvN5Obxuqu 6U082o8q6Xk9BB//AnfsvWYxp3CpVZ/0l4s/M= 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:mime-version:content-transfer-encoding; bh=5qWe34Qy/1bISohMU7IbFYkAxAfJ+/ilpVNevaPRhOo=; b=gXTh7iPAg516EB2rFw3sXVcM75/8f9F6HlV7lWjl1WIb+8PNO9KGIssPXRA4RshigA wdWxOUrRtU3aPa71RCnC0/KBghxAneii45jj64ULaCeDWPJOeTKch0CHs5Xd1Qm+bs0d 7egxRiE5tXhD42yzALS2kltYh3jp60SpnM3nk0IE5rArjFtW4smy08sgUWeD4qn0TtGM i8Zs9WYpqNLZgwwPjczjki2rrIWomtv3PrkoIdidHvgkVxFMBbUamP+TKW6bYX8TzVuo jFcuyzb6Bb9Qa2lPsbUETh0bPwttmyLb3HGTxamMijrN1PI8abFIPJFJhdtUVZtVJLz9 qJ0g== X-Gm-Message-State: APjAAAWdeVjdxgX50828LNOpofWF/5FtLMwleeq0W7qc30B3RUm4W74Y WDLrHqZL/oC9/TeGcM8fn2HbcPgrWmQ= X-Google-Smtp-Source: APXvYqzWQks+D6yPJIYVQ5uqAlF6hnrKt76Kcq5HkG6Qlba2gRiaCcsAnKq7qizcHjfeDcnPIhGimg== X-Received: by 2002:a05:6602:2492:: with SMTP id g18mr13778615ioe.266.1566653260574; Sat, 24 Aug 2019 06:27:40 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:00 -0600 Message-Id: <20190824132315.53130-21-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 20/34] binman: Allow symbols to be resolved inside sections 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" At present we only support symbols inside binaries which are at the top level of an image. This restrictions seems unreasonable since more complex images may want to group binaries within different sections. Relax the restriction. Also fix a typo in the comment for testTpl(). Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/u_boot_spl.py | 2 +- tools/binman/etype/u_boot_tpl.py | 2 +- tools/binman/ftest.py | 35 +++++++++++++++++++++++++-- tools/binman/test/149_symbols_tpl.dts | 28 +++++++++++++++++++++ 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 tools/binman/test/149_symbols_tpl.dts diff --git a/tools/binman/etype/u_boot_spl.py b/tools/binman/etype/u_boot_spl.py index ab78714c8d..7fedd00021 100644 --- a/tools/binman/etype/u_boot_spl.py +++ b/tools/binman/etype/u_boot_spl.py @@ -40,4 +40,4 @@ class Entry_u_boot_spl(Entry_blob): return 'spl/u-boot-spl.bin' def WriteSymbols(self, section): - elf.LookupAndWriteSymbols(self.elf_fname, self, section) + elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage()) diff --git a/tools/binman/etype/u_boot_tpl.py b/tools/binman/etype/u_boot_tpl.py index 4d4bb92596..1b69c4f4a7 100644 --- a/tools/binman/etype/u_boot_tpl.py +++ b/tools/binman/etype/u_boot_tpl.py @@ -40,4 +40,4 @@ class Entry_u_boot_tpl(Entry_blob): return 'tpl/u-boot-tpl.bin' def WriteSymbols(self, section): - elf.LookupAndWriteSymbols(self.elf_fname, self, section) + elf.LookupAndWriteSymbols(self.elf_fname, self, section.GetImage()) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 1d774e28e5..008e747270 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -40,7 +40,7 @@ import tout U_BOOT_DATA = b'1234' U_BOOT_IMG_DATA = b'img' U_BOOT_SPL_DATA = b'56780123456789abcde' -U_BOOT_TPL_DATA = b'tpl' +U_BOOT_TPL_DATA = b'tpl9876543210fedcb' BLOB_DATA = b'89' ME_DATA = b'0abcd' VGA_DATA = b'vga' @@ -491,6 +491,16 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputFile('spl/u-boot-spl', tools.ReadFile(cls.ElfTestFile(src_fname))) + @classmethod + def _SetupTplElf(cls, src_fname='bss_data'): + """Set up an ELF file with a '_dt_ucode_base_size' symbol + + Args: + Filename of ELF file to use as TPL + """ + TestFunctional._MakeInputFile('tpl/u-boot-tpl', + tools.ReadFile(cls.ElfTestFile(src_fname))) + @classmethod def TestFile(cls, fname): return os.path.join(cls._binman_dir, 'test', fname) @@ -1557,7 +1567,7 @@ class TestFunctional(unittest.TestCase): "'other'", str(e.exception)) def testTpl(self): - """Test that an image with TPL and ots device tree can be created""" + """Test that an image with TPL and its device tree can be created""" # ELF file with a '__bss_size' symbol with open(self.ElfTestFile('bss_data'), 'rb') as fd: TestFunctional._MakeInputFile('tpl/u-boot-tpl', fd.read()) @@ -3292,6 +3302,27 @@ class TestFunctional(unittest.TestCase): self.assertIn("'intel-fit-ptr' section must have an 'intel-fit' sibling", str(e.exception)) + def testSymbolsTplSection(self): + """Test binman can assign symbols embedded in U-Boot TPL in a section""" + self._SetupSplElf('u_boot_binman_syms') + self._SetupTplElf('u_boot_binman_syms') + data = self._DoReadFile('149_symbols_tpl.dts') + sym_values = struct.pack('; + #size-cells = <1>; + + binman { + pad-byte = <0xff>; + u-boot-spl { + offset = <4>; + }; + + u-boot-spl2 { + offset = <0x18>; + type = "u-boot-spl"; + }; + + u-boot { + offset = <0x30>; + }; + + section { + u-boot-tpl { + type = "u-boot-tpl"; + }; + }; + }; +}; From patchwork Sat Aug 24 13:23:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152618 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="P6qnlo5f"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzjm1GJ1z9s7T for ; Sat, 24 Aug 2019 23:33:15 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A1349C21D56; Sat, 24 Aug 2019 13:32:25 +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=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 83137C21E35; Sat, 24 Aug 2019 13:30:01 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B07E1C21E85; Sat, 24 Aug 2019 13:27:48 +0000 (UTC) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by lists.denx.de (Postfix) with ESMTPS id BAD60C21DB5 for ; Sat, 24 Aug 2019 13:27:43 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id j5so26654497ioj.8 for ; Sat, 24 Aug 2019 06:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rYrdFDr17Na0XFxmV5LPRZkfUVtJv/X4FIL+LFIeAxw=; b=P6qnlo5fymi6DZdU3o1IyMBALeZvz8EC7iSoC1PSBCuLuBLKt+OBixj5yAfP5xepx0 d3PUB37GhAneNzQgIWezuTSb77SBv1wT2lnAAHZ2HopiQyFksXwepHDjC3J1h9zSo2tO Fg6RY8MhGa87Cfrp4lLCPYsU3okfN0W6brkyE= 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:mime-version:content-transfer-encoding; bh=rYrdFDr17Na0XFxmV5LPRZkfUVtJv/X4FIL+LFIeAxw=; b=okhteajzM+9p2yjUftDXX3cdhbhYJ1SxRRC2fzkFH8LDNVYEJchzHFGHDJnEDoUuU4 Mkwf80yQi7pkPGIp6DsA3UWSnJTGp9YaYIKGWodbQLGkYIsYedh4QUvt6ahsDMvedCBY SjljLw9Ic1K1GtZZclYSQxmwfEKNT09FQA9eWHqO/wV6Wd331wImo+Qhe86+udzy94Zi QqyXjCoEZ1PkFgquzdtFJAlqxFKRnJrHEMosvRmmrmYgqzTsDgFVHwl6Xfs+J+tcI1ng APfqC76Y96Qjto/Te9pZ8AEypXj4FnyNzjiCfWRsTt3by69OEq8Xd5OipgVmnpoRbbVd wpuw== X-Gm-Message-State: APjAAAUmBOzuDLN0wiLnR4A5GpllWWkCA94x/xXta5vYKQJhfnrZrWLF uMQj8n/sByJDFojpj0IRi+aBvaOIIzs= X-Google-Smtp-Source: APXvYqyaivBTpnthgnOrZoIF/5YSxBQ8v9khZGZQWh3aJGVTaMrYIenEq0Ibf8/nrHebT1gU5RszZA== X-Received: by 2002:a05:6602:1d6:: with SMTP id w22mr13306440iot.87.1566653262530; Sat, 24 Aug 2019 06:27:42 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:01 -0600 Message-Id: <20190824132315.53130-22-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 21/34] binman: Use underscore in test filenames 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" At present a small number of test files use hyphens instead of underscores. Rename them for consistency. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/ftest.py | 28 +++++++++---------- .../test/{029_x86-rom.dts => 029_x86_rom.dts} | 0 ...no-desc.dts => 030_x86_rom_me_no_desc.dts} | 0 ...{031_x86-rom-me.dts => 031_x86_rom_me.dts} | 0 .../{032_intel-vga.dts => 032_intel_vga.dts} | 0 ...33_x86-start16.dts => 033_x86_start16.dts} | 0 .../{042_intel-fsp.dts => 042_intel_fsp.dts} | 0 .../{043_intel-cmc.dts => 043_intel_cmc.dts} | 0 .../{046_intel-vbt.dts => 046_intel_vbt.dts} | 0 ...tart16-spl.dts => 048_x86_start16_spl.dts} | 0 ...tart16-tpl.dts => 081_x86_start16_tpl.dts} | 0 ..._x86-rom-ifwi.dts => 111_x86_rom_ifwi.dts} | 0 ...nodesc.dts => 112_x86_rom_ifwi_nodesc.dts} | 0 ...nodata.dts => 113_x86_rom_ifwi_nodata.dts} | 0 14 files changed, 14 insertions(+), 14 deletions(-) rename tools/binman/test/{029_x86-rom.dts => 029_x86_rom.dts} (100%) rename tools/binman/test/{030_x86-rom-me-no-desc.dts => 030_x86_rom_me_no_desc.dts} (100%) rename tools/binman/test/{031_x86-rom-me.dts => 031_x86_rom_me.dts} (100%) rename tools/binman/test/{032_intel-vga.dts => 032_intel_vga.dts} (100%) rename tools/binman/test/{033_x86-start16.dts => 033_x86_start16.dts} (100%) rename tools/binman/test/{042_intel-fsp.dts => 042_intel_fsp.dts} (100%) rename tools/binman/test/{043_intel-cmc.dts => 043_intel_cmc.dts} (100%) rename tools/binman/test/{046_intel-vbt.dts => 046_intel_vbt.dts} (100%) rename tools/binman/test/{048_x86-start16-spl.dts => 048_x86_start16_spl.dts} (100%) rename tools/binman/test/{081_x86-start16-tpl.dts => 081_x86_start16_tpl.dts} (100%) rename tools/binman/test/{111_x86-rom-ifwi.dts => 111_x86_rom_ifwi.dts} (100%) rename tools/binman/test/{112_x86-rom-ifwi-nodesc.dts => 112_x86_rom_ifwi_nodesc.dts} (100%) rename tools/binman/test/{113_x86-rom-ifwi-nodata.dts => 113_x86_rom_ifwi_nodata.dts} (100%) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 008e747270..d0ec2f1f5c 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -921,7 +921,7 @@ class TestFunctional(unittest.TestCase): def testPackX86Rom(self): """Test that a basic x86 ROM can be created""" self._SetupSplElf() - data = self._DoReadFile('029_x86-rom.dts') + data = self._DoReadFile('029_x86_rom.dts') self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 7) + U_BOOT_SPL_DATA + tools.GetBytes(0, 2), data) @@ -929,21 +929,21 @@ class TestFunctional(unittest.TestCase): """Test that an invalid Intel descriptor entry is detected""" TestFunctional._MakeInputFile('descriptor.bin', b'') with self.assertRaises(ValueError) as e: - self._DoTestFile('031_x86-rom-me.dts') + self._DoTestFile('031_x86_rom_me.dts') self.assertIn("Node '/binman/intel-descriptor': Cannot find Intel Flash Descriptor (FD) signature", str(e.exception)) def testPackX86RomBadDesc(self): """Test that the Intel requires a descriptor entry""" with self.assertRaises(ValueError) as e: - self._DoTestFile('030_x86-rom-me-no-desc.dts') + self._DoTestFile('030_x86_rom_me_no_desc.dts') self.assertIn("Node '/binman/intel-me': No offset set with " "offset-unset: should another entry provide this correct " "offset?", str(e.exception)) def testPackX86RomMe(self): """Test that an x86 ROM with an ME region can be created""" - data = self._DoReadFile('031_x86-rom-me.dts') + data = self._DoReadFile('031_x86_rom_me.dts') expected_desc = tools.ReadFile(self.TestFile('descriptor.bin')) if data[:0x1000] != expected_desc: self.fail('Expected descriptor binary at start of image') @@ -951,12 +951,12 @@ class TestFunctional(unittest.TestCase): def testPackVga(self): """Test that an image with a VGA binary can be created""" - data = self._DoReadFile('032_intel-vga.dts') + data = self._DoReadFile('032_intel_vga.dts') self.assertEqual(VGA_DATA, data[:len(VGA_DATA)]) def testPackStart16(self): """Test that an image with an x86 start16 region can be created""" - data = self._DoReadFile('033_x86-start16.dts') + data = self._DoReadFile('033_x86_start16.dts') self.assertEqual(X86_START16_DATA, data[:len(X86_START16_DATA)]) def testPackPowerpcMpc85xxBootpgResetvec(self): @@ -1144,17 +1144,17 @@ class TestFunctional(unittest.TestCase): def testPackFsp(self): """Test that an image with a FSP binary can be created""" - data = self._DoReadFile('042_intel-fsp.dts') + data = self._DoReadFile('042_intel_fsp.dts') self.assertEqual(FSP_DATA, data[:len(FSP_DATA)]) def testPackCmc(self): """Test that an image with a CMC binary can be created""" - data = self._DoReadFile('043_intel-cmc.dts') + data = self._DoReadFile('043_intel_cmc.dts') self.assertEqual(CMC_DATA, data[:len(CMC_DATA)]) def testPackVbt(self): """Test that an image with a VBT binary can be created""" - data = self._DoReadFile('046_intel-vbt.dts') + data = self._DoReadFile('046_intel_vbt.dts') self.assertEqual(VBT_DATA, data[:len(VBT_DATA)]) def testSplBssPad(self): @@ -1175,7 +1175,7 @@ class TestFunctional(unittest.TestCase): def testPackStart16Spl(self): """Test that an image with an x86 start16 SPL region can be created""" - data = self._DoReadFile('048_x86-start16-spl.dts') + data = self._DoReadFile('048_x86_start16_spl.dts') self.assertEqual(X86_START16_SPL_DATA, data[:len(X86_START16_SPL_DATA)]) def _PackUbootSplMicrocode(self, dts, ucode_second=False): @@ -1595,7 +1595,7 @@ class TestFunctional(unittest.TestCase): def testPackStart16Tpl(self): """Test that an image with an x86 start16 TPL region can be created""" - data = self._DoReadFile('081_x86-start16-tpl.dts') + data = self._DoReadFile('081_x86_start16_tpl.dts') self.assertEqual(X86_START16_TPL_DATA, data[:len(X86_START16_TPL_DATA)]) def testSelectImage(self): @@ -2067,20 +2067,20 @@ class TestFunctional(unittest.TestCase): def testPackX86RomIfwi(self): """Test that an x86 ROM with Integrated Firmware Image can be created""" self._SetupIfwi('fitimage.bin') - data = self._DoReadFile('111_x86-rom-ifwi.dts') + data = self._DoReadFile('111_x86_rom_ifwi.dts') self._CheckIfwi(data) def testPackX86RomIfwiNoDesc(self): """Test that an x86 ROM with IFWI can be created from an ifwi.bin file""" self._SetupIfwi('ifwi.bin') - data = self._DoReadFile('112_x86-rom-ifwi-nodesc.dts') + data = self._DoReadFile('112_x86_rom_ifwi_nodesc.dts') self._CheckIfwi(data) def testPackX86RomIfwiNoData(self): """Test that an x86 ROM with IFWI handles missing data""" self._SetupIfwi('ifwi.bin') with self.assertRaises(ValueError) as e: - data = self._DoReadFile('113_x86-rom-ifwi-nodata.dts') + data = self._DoReadFile('113_x86_rom_ifwi_nodata.dts') self.assertIn('Could not complete processing of contents', str(e.exception)) diff --git a/tools/binman/test/029_x86-rom.dts b/tools/binman/test/029_x86_rom.dts similarity index 100% rename from tools/binman/test/029_x86-rom.dts rename to tools/binman/test/029_x86_rom.dts diff --git a/tools/binman/test/030_x86-rom-me-no-desc.dts b/tools/binman/test/030_x86_rom_me_no_desc.dts similarity index 100% rename from tools/binman/test/030_x86-rom-me-no-desc.dts rename to tools/binman/test/030_x86_rom_me_no_desc.dts diff --git a/tools/binman/test/031_x86-rom-me.dts b/tools/binman/test/031_x86_rom_me.dts similarity index 100% rename from tools/binman/test/031_x86-rom-me.dts rename to tools/binman/test/031_x86_rom_me.dts diff --git a/tools/binman/test/032_intel-vga.dts b/tools/binman/test/032_intel_vga.dts similarity index 100% rename from tools/binman/test/032_intel-vga.dts rename to tools/binman/test/032_intel_vga.dts diff --git a/tools/binman/test/033_x86-start16.dts b/tools/binman/test/033_x86_start16.dts similarity index 100% rename from tools/binman/test/033_x86-start16.dts rename to tools/binman/test/033_x86_start16.dts diff --git a/tools/binman/test/042_intel-fsp.dts b/tools/binman/test/042_intel_fsp.dts similarity index 100% rename from tools/binman/test/042_intel-fsp.dts rename to tools/binman/test/042_intel_fsp.dts diff --git a/tools/binman/test/043_intel-cmc.dts b/tools/binman/test/043_intel_cmc.dts similarity index 100% rename from tools/binman/test/043_intel-cmc.dts rename to tools/binman/test/043_intel_cmc.dts diff --git a/tools/binman/test/046_intel-vbt.dts b/tools/binman/test/046_intel_vbt.dts similarity index 100% rename from tools/binman/test/046_intel-vbt.dts rename to tools/binman/test/046_intel_vbt.dts diff --git a/tools/binman/test/048_x86-start16-spl.dts b/tools/binman/test/048_x86_start16_spl.dts similarity index 100% rename from tools/binman/test/048_x86-start16-spl.dts rename to tools/binman/test/048_x86_start16_spl.dts diff --git a/tools/binman/test/081_x86-start16-tpl.dts b/tools/binman/test/081_x86_start16_tpl.dts similarity index 100% rename from tools/binman/test/081_x86-start16-tpl.dts rename to tools/binman/test/081_x86_start16_tpl.dts diff --git a/tools/binman/test/111_x86-rom-ifwi.dts b/tools/binman/test/111_x86_rom_ifwi.dts similarity index 100% rename from tools/binman/test/111_x86-rom-ifwi.dts rename to tools/binman/test/111_x86_rom_ifwi.dts diff --git a/tools/binman/test/112_x86-rom-ifwi-nodesc.dts b/tools/binman/test/112_x86_rom_ifwi_nodesc.dts similarity index 100% rename from tools/binman/test/112_x86-rom-ifwi-nodesc.dts rename to tools/binman/test/112_x86_rom_ifwi_nodesc.dts diff --git a/tools/binman/test/113_x86-rom-ifwi-nodata.dts b/tools/binman/test/113_x86_rom_ifwi_nodata.dts similarity index 100% rename from tools/binman/test/113_x86-rom-ifwi-nodata.dts rename to tools/binman/test/113_x86_rom_ifwi_nodata.dts From patchwork Sat Aug 24 13:23:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152641 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="EwJVUomc"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzvy5BKyz9s7T for ; Sat, 24 Aug 2019 23:42:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5788BC21E63; Sat, 24 Aug 2019 13:31:29 +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 E6571C21E60; Sat, 24 Aug 2019 13:29:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DD720C21E31; Sat, 24 Aug 2019 13:27:50 +0000 (UTC) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by lists.denx.de (Postfix) with ESMTPS id 62DDEC21E26 for ; Sat, 24 Aug 2019 13:27:45 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id 18so26621599ioe.10 for ; Sat, 24 Aug 2019 06:27:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6HkKJkv5tTZ9LZrSMpE19Cty6tFJXSekQ7696//iIrY=; b=EwJVUomcU1CbPUKxYKW9eGmCQoNmxsEXfZLuWsK3zrZlWigJxWM8hh8Wku95rFG2xb i7ZWrKE6bQQp9AK3zcy4PIW2gNBv1BqxogeF87sHF3399+ILQ3SeFl8NDQd21ejL8k0G Lcl0qh49dSyGtl12SIdQJN/Jr7OTKtd4ajVOY= 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:mime-version:content-transfer-encoding; bh=6HkKJkv5tTZ9LZrSMpE19Cty6tFJXSekQ7696//iIrY=; b=C0oMj0cqifxX/p0qJjuF8LtzjKjYBTH6oHAoCyHX0dg0ckS7SgbueEssIZes1NSReV IOUHrrxJKwAOAYfxUHW/GLd0mYUQb9VEA6dn8uhGpSbNLQNLlQrRIrXhTD1u00yE5Oev 0iFBNCbH0OurW16mPEd4VoYslLo2RGLw6YXU9t7J7WVgLkJiTWL4I+OEo2kCz+TV7abu 7r1Y6x6J9QBRckkzO9iz2gd+VA12wE3tSSsKM51R39MXUmr1IJgDrYE3z2rUJ2UNLgT3 EJ405Mx4x9dQLhC/O4VOLivVxU6Oo7iyKvBqPQbfHd6wnLnsbGANOagk+iJJNt1Fe1pK oslg== X-Gm-Message-State: APjAAAXgTiNV6Hqpjv+qjGUf7OvfGxhU4YO2EjtJLcx8AqdYotA2AS5J ZEsu6TlMATDWmoXRSI7LewGvyZdqH6k= X-Google-Smtp-Source: APXvYqzbzH3MUeXzkjkZs0jlTLSMdo5JgYSDNzsd9YKcYtcGWixIsynaPZlYP0pAtucdlKTgrIgcIQ== X-Received: by 2002:a5d:88ce:: with SMTP id i14mr7389228iol.307.1566653264278; Sat, 24 Aug 2019 06:27:44 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:43 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:02 -0600 Message-Id: <20190824132315.53130-23-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 22/34] binman: Rename some two-digit test files 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" Two of the test files somehow were not converted to three digits. Fix them, using the next available numbers. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/ftest.py | 4 ++-- ...rt_together.dts => 098_4gb_and_skip_at_start_together.dts} | 0 ...g_resetvec.dts => 150_powerpc_mpc85xx_bootpg_resetvec.dts} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename tools/binman/test/{80_4gb_and_skip_at_start_together.dts => 098_4gb_and_skip_at_start_together.dts} (100%) rename tools/binman/test/{81_powerpc_mpc85xx_bootpg_resetvec.dts => 150_powerpc_mpc85xx_bootpg_resetvec.dts} (100%) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index d0ec2f1f5c..75e25f3e23 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -906,7 +906,7 @@ class TestFunctional(unittest.TestCase): """Test that the end-at-4gb and skip-at-size property can't be used together""" with self.assertRaises(ValueError) as e: - self._DoTestFile('80_4gb_and_skip_at_start_together.dts') + self._DoTestFile('098_4gb_and_skip_at_start_together.dts') self.assertIn("Image '/binman': Provide either 'end-at-4gb' or " "'skip-at-start'", str(e.exception)) @@ -962,7 +962,7 @@ class TestFunctional(unittest.TestCase): def testPackPowerpcMpc85xxBootpgResetvec(self): """Test that an image with powerpc-mpc85xx-bootpg-resetvec can be created""" - data = self._DoReadFile('81_powerpc_mpc85xx_bootpg_resetvec.dts') + data = self._DoReadFile('150_powerpc_mpc85xx_bootpg_resetvec.dts') self.assertEqual(PPC_MPC85XX_BR_DATA, data[:len(PPC_MPC85XX_BR_DATA)]) def _RunMicrocodeTest(self, dts_fname, nodtb_data, ucode_second=False): diff --git a/tools/binman/test/80_4gb_and_skip_at_start_together.dts b/tools/binman/test/098_4gb_and_skip_at_start_together.dts similarity index 100% rename from tools/binman/test/80_4gb_and_skip_at_start_together.dts rename to tools/binman/test/098_4gb_and_skip_at_start_together.dts diff --git a/tools/binman/test/81_powerpc_mpc85xx_bootpg_resetvec.dts b/tools/binman/test/150_powerpc_mpc85xx_bootpg_resetvec.dts similarity index 100% rename from tools/binman/test/81_powerpc_mpc85xx_bootpg_resetvec.dts rename to tools/binman/test/150_powerpc_mpc85xx_bootpg_resetvec.dts From patchwork Sat Aug 24 13:23:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152627 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jUq5YeYA"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzmk4y2Gz9s7T for ; Sat, 24 Aug 2019 23:35:50 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 53699C21DB5; Sat, 24 Aug 2019 13:32:43 +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=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 1C8A9C21EC2; Sat, 24 Aug 2019 13:30:03 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 005D2C21E1B; Sat, 24 Aug 2019 13:27:51 +0000 (UTC) Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by lists.denx.de (Postfix) with ESMTPS id E7141C21E0F for ; Sat, 24 Aug 2019 13:27:46 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id z3so26745693iog.0 for ; Sat, 24 Aug 2019 06:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ht3LNRy4BOgm4ad7EgHE2QgNhMz/YJXfYJ7Ln7wXzcM=; b=jUq5YeYAkcZfiUX0t0nN2cjVkVhsRzqRpWWQEAbSds0STK9p5c2hilXp007p4F1t5E 0ErtDrRcn5psKLR01bxwZKUpJxREaGpGfZjAXR70ULCfI6YvKQIBSbjKt7VZXVb+ACoW 3KI8Cqq2hSnHA9IWiMqEQa5Jf1dO++jJP7aoY= 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:mime-version:content-transfer-encoding; bh=ht3LNRy4BOgm4ad7EgHE2QgNhMz/YJXfYJ7Ln7wXzcM=; b=oPAZK+kGUGea62T7emAtMP1l+Mplr7eUkHlVBh8Kb1UiHTnoeHTvxRQTnSPzjeJo1/ XXwUP1B054zvVIFAvwHVNXK5xFB3FJ6jMKEQowqgIZr0bFvd3RcZZlvCuDGUJG3mfCQv o4KdrRdm3FU+lziaHNis7UWeXHokVr66ZanNKgYI9vNtikrwQCFO6pJxzp8Fqv/9HY/u JZG0ZDwrEcIYupsiAWGA6WbdQewbNnkyINjhzaJQwQZf0LM1O+4IXQUjOaVgcEWWpFdg TvaxyuJWXiTcPBnBtd3l7Qb2UIsV8XkyQl1iHy7bV0Z0KKF8uyNegp+/kVEx0YvU/0yv MN9A== X-Gm-Message-State: APjAAAXINpSjXiE8W6e16FNEY7J6m9nMd7x9ban48b2LrGnoE24wqM0g TCfLtfvx6kSqU1BfdXoJQNaaDvcGumE= X-Google-Smtp-Source: APXvYqyUsbGptYNsffEm2jt0wE2M8D3VCsrEY+JpjS+qDeSpknRMiZmSNlOdqeYo5nLuni+I+J2bKA== X-Received: by 2002:a5d:9ec6:: with SMTP id a6mr6045813ioe.256.1566653265806; Sat, 24 Aug 2019 06:27:45 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:45 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:03 -0600 Message-Id: <20190824132315.53130-24-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 23/34] binman: Avoid needing the section size in advance 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" Entries which include a section and need to obtain its contents call GetData(), as with any other entry. But the current implementation of this method in entry_Section requires the size of the section to be known. If it is unknown, an error is produced, since size is None: TypeError: can't multiply sequence by non-int of type 'NoneType' There is no need to know the size in advance since the code can be adjusted to build up the section piece by piece, instead of patching each entry into an existing bytearray. Update the code to handle this and add a test. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/section.py | 14 +++++--- tools/binman/ftest.py | 6 ++++ .../binman/test/151_x86_rom_ifwi_section.dts | 33 +++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 tools/binman/test/151_x86_rom_ifwi_section.dts diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index 5d34fc546a..ff5d30f3fa 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -142,13 +142,19 @@ class Entry_section(Entry): return self.GetEntryContents() def GetData(self): - section_data = tools.GetBytes(self._pad_byte, self.size) + section_data = b'' for entry in self._entries.values(): data = entry.GetData() - base = self.pad_before + entry.offset - self._skip_at_start - section_data = (section_data[:base] + data + - section_data[base + len(data):]) + base = self.pad_before + (entry.offset or 0) - self._skip_at_start + pad = base - len(section_data) + if pad > 0: + section_data += tools.GetBytes(self._pad_byte, pad) + section_data += data + if self.size: + pad = self.size - len(section_data) + if pad > 0: + section_data += tools.GetBytes(self._pad_byte, pad) self.Detail('GetData: %d entries, total size %#x' % (len(self._entries), len(section_data))) return section_data diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 75e25f3e23..1eb0d3b684 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -3323,6 +3323,12 @@ class TestFunctional(unittest.TestCase): expected4 = sym_values + U_BOOT_TPL_DATA[16:] self.assertEqual(expected4, data[upto3:]) + def testPackX86RomIfwiSectiom(self): + """Test that a section can be placed in an IFWI region""" + self._SetupIfwi('fitimage.bin') + data = self._DoReadFile('151_x86_rom_ifwi_section.dts') + self._CheckIfwi(data) + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/151_x86_rom_ifwi_section.dts b/tools/binman/test/151_x86_rom_ifwi_section.dts new file mode 100644 index 0000000000..7e455c3a4b --- /dev/null +++ b/tools/binman/test/151_x86_rom_ifwi_section.dts @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + sort-by-offset; + end-at-4gb; + size = <0x800000>; + intel-descriptor { + filename = "descriptor.bin"; + }; + + intel-ifwi { + offset-unset; + filename = "fitimage.bin"; + convert-fit; + + section { + ifwi-replace; + ifwi-subpart = "IBBP"; + ifwi-entry = "IBBL"; + u-boot-tpl { + }; + u-boot-dtb { + }; + }; + }; + }; +}; From patchwork Sat Aug 24 13:23:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152626 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CgfwQh60"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzmd1zTFz9sBF for ; Sat, 24 Aug 2019 23:35:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E3F8DC21E50; Sat, 24 Aug 2019 13:33: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=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 21897C21D56; Sat, 24 Aug 2019 13:30:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BA4E5C21E38; Sat, 24 Aug 2019 13:27:53 +0000 (UTC) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by lists.denx.de (Postfix) with ESMTPS id 74A4EC21E18 for ; Sat, 24 Aug 2019 13:27:48 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id l7so26717910ioj.6 for ; Sat, 24 Aug 2019 06:27:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8RPtoxRHxtaryT1Iqk+PxMCAM7MpG6O9R3SyeaLa2wA=; b=CgfwQh60Mp1bjQYanLEzkhVjcc97JZmjtCFg3u7jS8/CGhvuOGJKDpuIl8qZeiWtRe wECnDULE0Mratdi1gQxKraI1gu7ZdbwC5mnttFvCu7M6cjtGrwhaBV5mww36hUojgJ2e M/YMhOPha/kGea0NGrmnH8u05RW4wW/x5Y8Hk= 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:mime-version:content-transfer-encoding; bh=8RPtoxRHxtaryT1Iqk+PxMCAM7MpG6O9R3SyeaLa2wA=; b=iqA9OH4Mux/8zqfE3UulFjRqYtctfPz2B73sRnmSUtXxaidRfxKbEbPAM0P2+xkEyv LLpyTL6xZSw0HOb6p7OWCj7oUDGMvvGfgqrH00lDDz/LeTKeNyzBcwEMtRUcJmX4XJ+y S5XneSnx6X85+jwSJff+yVFLI8fE1JpJkZM8o4pVFRarOkMvX7b7TFkfyuOQslijJK3N rLWS1XCwmbyRwsailrCxEq6Iq5k28x2/QQk5qfoyfJRRl+IUUciqLKB+bpSMQ4yWk74X NKwg6C8LxgFdbWFclnXgo5gBIPGAt6MIwWdvLp1Qly0iCrvQwXVIl/Cudg5s5GoUvLhq aKSQ== X-Gm-Message-State: APjAAAXmk7v+m0nRWrGw4cVnVk1QpMZNy/6upc/SO4Xv7x4kEY2x2BVT ZIWeluRv9juJ/2gqIUSrD4ZIAXs+TJg= X-Google-Smtp-Source: APXvYqz/U8sZORzuQxxAVY9Wt98aBNhGHGdQAkVWqCj6JoH1+GpnBPWqyq+w/SNFYtM5aNy+qNawMA== X-Received: by 2002:a05:6602:224a:: with SMTP id o10mr3635073ioo.44.1566653267281; Sat, 24 Aug 2019 06:27:47 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:46 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:04 -0600 Message-Id: <20190824132315.53130-25-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 24/34] binman: Increase size of TPL and SPL test data 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" At present these are large enough to hold 20 bytes of symbol data. Add four more bytes so we can add another test. Unfortunately at present this involves changing a few test files to make room. We could adjust the test files to not specify sizes for entries. Then we could make the tests check the actual sizes. But for now, leave it as it is, since the effort is minor. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/ftest.py | 14 +++++++------- tools/binman/test/021_image_pad.dts | 2 +- tools/binman/test/024_sorted.dts | 2 +- tools/binman/test/028_pack_4gb_outside.dts | 2 +- tools/binman/test/029_x86_rom.dts | 2 +- tools/binman/test/053_symbols.dts | 2 +- tools/binman/test/149_symbols_tpl.dts | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 1eb0d3b684..65d3ad59ea 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -39,8 +39,8 @@ import tout # Contents of test files, corresponding to different entry types U_BOOT_DATA = b'1234' U_BOOT_IMG_DATA = b'img' -U_BOOT_SPL_DATA = b'56780123456789abcde' -U_BOOT_TPL_DATA = b'tpl9876543210fedcb' +U_BOOT_SPL_DATA = b'56780123456789abcdefghi' +U_BOOT_TPL_DATA = b'tpl9876543210fedcbazyw' BLOB_DATA = b'89' ME_DATA = b'0abcd' VGA_DATA = b'vga' @@ -922,7 +922,7 @@ class TestFunctional(unittest.TestCase): """Test that a basic x86 ROM can be created""" self._SetupSplElf() data = self._DoReadFile('029_x86_rom.dts') - self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 7) + U_BOOT_SPL_DATA + + self.assertEqual(U_BOOT_DATA + tools.GetBytes(0, 3) + U_BOOT_SPL_DATA + tools.GetBytes(0, 2), data) def testPackX86RomMeNoDesc(self): @@ -1236,7 +1236,7 @@ class TestFunctional(unittest.TestCase): self._SetupSplElf('u_boot_binman_syms') data = self._DoReadFile('053_symbols.dts') - sym_values = struct.pack('; + offset = <24>; }; }; }; diff --git a/tools/binman/test/024_sorted.dts b/tools/binman/test/024_sorted.dts index d35d39f077..b79d9adf68 100644 --- a/tools/binman/test/024_sorted.dts +++ b/tools/binman/test/024_sorted.dts @@ -7,7 +7,7 @@ binman { sort-by-offset; u-boot { - offset = <22>; + offset = <26>; }; u-boot-spl { diff --git a/tools/binman/test/028_pack_4gb_outside.dts b/tools/binman/test/028_pack_4gb_outside.dts index 2216abfb70..11a1f6059e 100644 --- a/tools/binman/test/028_pack_4gb_outside.dts +++ b/tools/binman/test/028_pack_4gb_outside.dts @@ -13,7 +13,7 @@ }; u-boot-spl { - offset = <0xffffffeb>; + offset = <0xffffffe7>; }; }; }; diff --git a/tools/binman/test/029_x86_rom.dts b/tools/binman/test/029_x86_rom.dts index d5c69f9d4a..88aa007bba 100644 --- a/tools/binman/test/029_x86_rom.dts +++ b/tools/binman/test/029_x86_rom.dts @@ -13,7 +13,7 @@ }; u-boot-spl { - offset = <0xffffffeb>; + offset = <0xffffffe7>; }; }; }; diff --git a/tools/binman/test/053_symbols.dts b/tools/binman/test/053_symbols.dts index 9f135676cb..8af575158f 100644 --- a/tools/binman/test/053_symbols.dts +++ b/tools/binman/test/053_symbols.dts @@ -10,7 +10,7 @@ }; u-boot { - offset = <20>; + offset = <24>; }; u-boot-spl2 { diff --git a/tools/binman/test/149_symbols_tpl.dts b/tools/binman/test/149_symbols_tpl.dts index 087e10f292..dfc84af5e7 100644 --- a/tools/binman/test/149_symbols_tpl.dts +++ b/tools/binman/test/149_symbols_tpl.dts @@ -11,12 +11,12 @@ }; u-boot-spl2 { - offset = <0x18>; + offset = <0x1c>; type = "u-boot-spl"; }; u-boot { - offset = <0x30>; + offset = <0x34>; }; section { From patchwork Sat Aug 24 13:23:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152621 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="RbiByG+Z"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzlD0XFKz9s7T for ; Sat, 24 Aug 2019 23:34:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6E5DFC21C50; Sat, 24 Aug 2019 13:30:45 +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=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 14D49C21E63; Sat, 24 Aug 2019 13:28:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B4188C21E3A; Sat, 24 Aug 2019 13:27:54 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id CE3CBC21E34 for ; Sat, 24 Aug 2019 13:27:49 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id q22so26701395iog.4 for ; Sat, 24 Aug 2019 06:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=y66/fDouXttbdaZmEaxbMLTgFHEUI6GTp3ugtKt/9og=; b=RbiByG+ZM8inlpDg6AWgT//zQ5MgN48VehooZoLZFbMxvEK7Bu1UEpJnBFdkiJXCJc 7+IzaeWONPiGZfUOgrT5OyD3luAd5+Cz5J3oV8RG8H+x57Bvk/WpKstQQ0CfLGHMQ7zh cXEd9k7XI2WOynXwrY/EGpl9m2GeWbw+/haio= 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:mime-version:content-transfer-encoding; bh=y66/fDouXttbdaZmEaxbMLTgFHEUI6GTp3ugtKt/9og=; b=m2TBnPAsHQVfVvm1GBMUA+Sf2n6JzuGeGk8+d2yca0pxvDaTYH/qlnyZqB7pIdiMDe k1byIJ0NaVpp6yE2couPwkXGZ13aw5dcDs/nvg25V5KyhanLN1UKak/pmrYB/JiHDZjm McmeHIr91n81J/f94sWW4D7xSQ9AfDfVXq2Nl3+Y3+a/RnZ46wdit4KUuAg2+5S0psMj xv8I6HgScSs8831QdcDTTM4iao8x8yzJn6Ezb20RUK0FnCgoZKWJENGjWPglOvSeqOk3 hSqHeYbAABJyCtbOMumHL7r9pkkgA7jWTG+iO6nqwdOkEHWllgsSnNZCBMA5Ymc62xr2 u/Pg== X-Gm-Message-State: APjAAAV+z5HjSijZv+C7tF8hq1E5qIYwbQy8azRDzRG2X/4NzaUzlQOM HGm628SGanV6Vwddo94Rd6pHLGYOlVw= X-Google-Smtp-Source: APXvYqzI55RV09IwHYvQC2AFR6YEHKOLdv5EeyJaX9C7CwQrbpEkShZzsMPgG1ggJMVl0ZnYp9GmGg== X-Received: by 2002:a02:4881:: with SMTP id p123mr9810639jaa.69.1566653268704; Sat, 24 Aug 2019 06:27:48 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:48 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:05 -0600 Message-Id: <20190824132315.53130-26-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 25/34] binman: Allow support for writing a size symbol to binaries 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" It is useful to be able to access the size of an image in SPL, with something like: binman_sym_declare(unsigned long, u_boot_any, size); ... ulong u_boot_size = binman_sym(ulong, u_boot_any, size); Add support for this and update the tests. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf_test.py | 4 ++-- tools/binman/etype/section.py | 2 ++ tools/binman/ftest.py | 14 +++++++------- tools/binman/test/u_boot_binman_syms.c | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tools/binman/elf_test.py b/tools/binman/elf_test.py index f05545bcb1..c0c11cb340 100644 --- a/tools/binman/elf_test.py +++ b/tools/binman/elf_test.py @@ -155,11 +155,11 @@ class TestElf(unittest.TestCase): This should produce -1 values for all thress symbols, taking up the first 16 bytes of the image. """ - entry = FakeEntry(20) + entry = FakeEntry(24) section = FakeSection(sym_value=None) elf_fname = self.ElfTestFile('u_boot_binman_syms') syms = elf.LookupAndWriteSymbols(elf_fname, entry, section) - self.assertEqual(tools.GetBytes(255, 16) + tools.GetBytes(ord('a'), 4), + self.assertEqual(tools.GetBytes(255, 20) + tools.GetBytes(ord('a'), 4), entry.data) def testDebug(self): diff --git a/tools/binman/etype/section.py b/tools/binman/etype/section.py index ff5d30f3fa..d39c6ad81e 100644 --- a/tools/binman/etype/section.py +++ b/tools/binman/etype/section.py @@ -344,6 +344,8 @@ class Entry_section(Entry): return entry.offset elif prop_name == 'image_pos': return entry.image_pos + if prop_name == 'size': + return entry.size else: raise ValueError("%s: No such property '%s'" % (msg, prop_name)) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 65d3ad59ea..a740c3e03d 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1236,10 +1236,10 @@ class TestFunctional(unittest.TestCase): self._SetupSplElf('u_boot_binman_syms') data = self._DoReadFile('053_symbols.dts') - sym_values = struct.pack(' X-Patchwork-Id: 1152638 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DZ5/c4HD"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzth5DKRz9s7T for ; Sat, 24 Aug 2019 23:41:00 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 17309C21EE4; Sat, 24 Aug 2019 13:34:20 +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=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 75B52C21C51; Sat, 24 Aug 2019 13:32:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7337FC21DD7; Sat, 24 Aug 2019 13:27:55 +0000 (UTC) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) by lists.denx.de (Postfix) with ESMTPS id 71A52C21E26 for ; Sat, 24 Aug 2019 13:27:51 +0000 (UTC) Received: by mail-io1-f65.google.com with SMTP id q22so26701479iog.4 for ; Sat, 24 Aug 2019 06:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R2KEcGgxdLIP4OMlxCkLe6Jet7aktuhlr5iza7XhX3A=; b=DZ5/c4HDxzK0Jnc4j4SuCTN7HDJ5MGS/jNXeyFQnMgdjGVknpweTslRxac4P46CPBt K0cOAQXzGl6bEa4Zj8TJt/ipYk0RwBbYXrV1oIn6+1XFCOOhqrZDJS7B16IhMjoUMyJ6 zXMHlZPPODT27B914uHlbVRRs0EKp+DaKHJmU= 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:mime-version:content-transfer-encoding; bh=R2KEcGgxdLIP4OMlxCkLe6Jet7aktuhlr5iza7XhX3A=; b=K7+jkYVR3Pn3IsAGndgWdjDagBA6CWsAMr0lO72xgujOKQ5KDtoGnJPt2DlDkloYae LIh4DABTxawZl+9wdJEr9ZxZCq/w7iYj3oNtZ3GvioljLecfCeqpAqgLzxt1UmyVfJzn J/m8LJaCoPf87dajf89+IwA5iA0t150ukzVIdspJfxirsBME4wHUxgFS/f/4MHM3FQ8m eyzq8FZ76XVMbVXTMcDr82EmnE94ZhbN+T8nx1hhBMgfvJSv2iuuatxVHCnysKeVqLcn 8t12ZRG44mQlUMo4lpIUWSND4wD1gHalZmtIxmnE9OuEjhNNTPnfvYjaNC67xa2j7ctJ A9EQ== X-Gm-Message-State: APjAAAUY6dV51MVAN5YDU+zD8PQD6HInwljaeAXvOyq5yPDUMBH9BTDg FS5xIQbE+IqC9fPg0RCz+laW4Qj42jw= X-Google-Smtp-Source: APXvYqyzCPVXqLNdAPGvKV8baIY4D9+h1uq/DfYvCUQVOePBC6lBgMMIvza5LoL0GmdsxR4Eoj5QKg== X-Received: by 2002:a5d:87c2:: with SMTP id q2mr9326495ios.268.1566653270359; Sat, 24 Aug 2019 06:27:50 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:50 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:06 -0600 Message-Id: <20190824132315.53130-27-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 26/34] binman: Correct symbol calculation with non-zero image base 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" At present binman adds the image base address to the symbol value before it writes it to the binary. This is not correct since the symbol value itself (e.g. image position) has no relationship to the image base. Fix this and update the tests to cover this case. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/elf.py | 4 +--- tools/binman/test/u_boot_binman_syms.lds | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/binman/elf.py b/tools/binman/elf.py index 7bc7cf61b5..0c1a5b44b6 100644 --- a/tools/binman/elf.py +++ b/tools/binman/elf.py @@ -135,9 +135,7 @@ def LookupAndWriteSymbols(elf_fname, entry, section): # Look up the symbol in our entry tables. value = section.LookupSymbol(name, sym.weak, msg) - if value is not None: - value += base.address - else: + if value is None: value = -1 pack_string = pack_string.lower() value_bytes = struct.pack(pack_string, value) diff --git a/tools/binman/test/u_boot_binman_syms.lds b/tools/binman/test/u_boot_binman_syms.lds index 926df873cb..825fc3f649 100644 --- a/tools/binman/test/u_boot_binman_syms.lds +++ b/tools/binman/test/u_boot_binman_syms.lds @@ -9,7 +9,7 @@ ENTRY(_start) SECTIONS { - . = 0x00000000; + . = 0x00000010; _start = .; . = ALIGN(4); From patchwork Sat Aug 24 13:23:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152630 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="nlhNbp2l"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzps0Vt5z9s7T for ; Sat, 24 Aug 2019 23:37:40 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 2B5F2C21E7D; Sat, 24 Aug 2019 13:32: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=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 E2C65C21E6C; Sat, 24 Aug 2019 13:29:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 8148CC21DF9; Sat, 24 Aug 2019 13:27:56 +0000 (UTC) Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by lists.denx.de (Postfix) with ESMTPS id 1A422C21DD7 for ; Sat, 24 Aug 2019 13:27:53 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id x4so26550606iog.13 for ; Sat, 24 Aug 2019 06:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8KbPQHRL8Yy5Agzz43gDttPLnycuSnWzNcEaLevJjpk=; b=nlhNbp2ln0mLGix2cLy23VUtAYP+Iha+rVkfyTvypArgZJ9PPjmcxAyjTs9Z4FL4iO 5UK7YfH38DWfGU5ZUhNpcx4n3P1LLzvQ/q0O+Zzv2XMzQllbcUWO+pwA+65FYLyaGAiH KOVeO0sgc/uip2D+DWZn5sp+3W7Nnj3AKeWJQ= 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:mime-version:content-transfer-encoding; bh=8KbPQHRL8Yy5Agzz43gDttPLnycuSnWzNcEaLevJjpk=; b=I76XXjiZ+sHtR9PCYfuDJ9GZwYegIR8djaRzYSQqtN7PVQqrzD6RCvoQl83M0ZEP8i b/pxta6wbQUP63EWqD7J6LlwrPuBg27aaZ8zYflXHQ3hB08b0DsU4mLNU3BIlhguTatq ZncDjJDb+iqypyAYdL9momNGL3fgrbIk6y8w7273AgrUA1Uq5wJ8F79WXTjSnA9ewK+u CCp/fhAklq4D8nNUigCLwiwTOpQQzKoWRlxJT5JiPL1KS/I+Q8ZlCVwJbzCZk2KbxrRQ ZVRuZWJ3ek1z8Jl+ShntsSEtba8Oo1vfypIb3OERYSApkWg5VILNLPHtL/Zi+Has7j+I CWig== X-Gm-Message-State: APjAAAXWW7YwoYJOzse56UMyTREE+RYPJJTy53gGtHPcYRmre9LG20Xw 69UoxJP7rkcjwi4w9k2Mr21mTOsVdrY= X-Google-Smtp-Source: APXvYqwM9lpUS2t7XbsGvExwmZ66NXAEhY/1mVjJ8W7TZAh7tM/NAvEJ8T0yuE4z43/p13lyEw1BBw== X-Received: by 2002:a6b:500e:: with SMTP id e14mr6083257iob.49.1566653271933; Sat, 24 Aug 2019 06:27:51 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:51 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:07 -0600 Message-Id: <20190824132315.53130-28-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 27/34] binman: Add support for Intel FSP meminit 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" The Intel FSP supports initialising memory early during boot using a binary blob called 'fspm'. Add support for this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/README.entries | 17 +++++++++++++++++ tools/binman/etype/intel_fsp_m.py | 27 +++++++++++++++++++++++++++ tools/binman/ftest.py | 8 ++++++++ tools/binman/test/152_intel_fsp_m.dts | 14 ++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 tools/binman/etype/intel_fsp_m.py create mode 100644 tools/binman/test/152_intel_fsp_m.dts diff --git a/tools/binman/README.entries b/tools/binman/README.entries index dba51e6daa..bce2244596 100644 --- a/tools/binman/README.entries +++ b/tools/binman/README.entries @@ -427,6 +427,23 @@ See README.x86 for information about x86 binary blobs. +Entry: intel-fsp-m: Entry containing Intel Firmware Support Package (FSP) memory init +------------------------------------------------------------------------------------- + +Properties / Entry arguments: + - filename: Filename of file to read into entry + +This file contains a binary blob which is used on some devices to set up +SDRAM. U-Boot executes this code in SPL so that it can make full use of +memory. Documentation is typically not available in sufficient detail to +allow U-Boot do this this itself.. + +An example filename is 'fsp_m.bin' + +See README.x86 for information about x86 binary blobs. + + + Entry: intel-ifwi: Entry containing an Intel Integrated Firmware Image (IFWI) file ---------------------------------------------------------------------------------- diff --git a/tools/binman/etype/intel_fsp_m.py b/tools/binman/etype/intel_fsp_m.py new file mode 100644 index 0000000000..2d6b2b6621 --- /dev/null +++ b/tools/binman/etype/intel_fsp_m.py @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright 2019 Google LLC +# Written by Simon Glass +# +# Entry-type module for Intel Firmware Support Package binary blob (T section) +# + +from entry import Entry +from blob import Entry_blob + +class Entry_intel_fsp_m(Entry_blob): + """Entry containing Intel Firmware Support Package (FSP) memory init + + Properties / Entry arguments: + - filename: Filename of file to read into entry + + This file contains a binary blob which is used on some devices to set up + SDRAM. U-Boot executes this code in SPL so that it can make full use of + memory. Documentation is typically not available in sufficient detail to + allow U-Boot do this this itself.. + + An example filename is 'fsp_m.bin' + + See README.x86 for information about x86 binary blobs. + """ + def __init__(self, section, etype, node): + Entry_blob.__init__(self, section, etype, node) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index a740c3e03d..b0b942dfdc 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -72,6 +72,7 @@ FILES_DATA = (b"sorry I'm late\nOh, don't bother apologising, I'm " + b"sorry you're alive\n") COMPRESS_DATA = b'compress xxxxxxxxxxxxxxxxxxxxxx data' REFCODE_DATA = b'refcode' +FSP_M_DATA = b'fsp_m' # The expected size for the device tree in some tests EXTRACT_DTB_SIZE = 0x3c9 @@ -147,6 +148,7 @@ class TestFunctional(unittest.TestCase): TestFunctional._MakeInputDir('devkeys') TestFunctional._MakeInputFile('bmpblk.bin', BMPBLK_DATA) TestFunctional._MakeInputFile('refcode.bin', REFCODE_DATA) + TestFunctional._MakeInputFile('fsp_m.bin', FSP_M_DATA) cls._elf_testdir = os.path.join(cls._indir, 'elftest') elf_test.BuildElfTestFiles(cls._elf_testdir) @@ -3329,6 +3331,12 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('151_x86_rom_ifwi_section.dts') self._CheckIfwi(data) + def testPackFspM(self): + """Test that an image with a FSP memory-init binary can be created""" + data = self._DoReadFile('152_intel_fsp_m.dts') + self.assertEqual(FSP_M_DATA, data[:len(FSP_M_DATA)]) + + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/152_intel_fsp_m.dts b/tools/binman/test/152_intel_fsp_m.dts new file mode 100644 index 0000000000..b6010f31c2 --- /dev/null +++ b/tools/binman/test/152_intel_fsp_m.dts @@ -0,0 +1,14 @@ +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + size = <16>; + + intel-fsp-m { + filename = "fsp_m.bin"; + }; + }; +}; From patchwork Sat Aug 24 13:23:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152644 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="QHbBK68O"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzxv023Rz9s7T for ; Sat, 24 Aug 2019 23:43:46 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F0AE6C21E49; Sat, 24 Aug 2019 13:31:21 +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 7032FC21DDC; Sat, 24 Aug 2019 13:29:21 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DF76EC21C51; Sat, 24 Aug 2019 13:27:57 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id 673E5C21E0D for ; Sat, 24 Aug 2019 13:27:54 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id e20so26589665iob.9 for ; Sat, 24 Aug 2019 06:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MpkOv4z49aejGzksEgFqIQyDYgMgc5qm08lN+rzx9No=; b=QHbBK68OUwanaZXRsSGY7KlMnVEms6gzBs+kDeTo8L1Gwg/scIQw5bB08F0aDEufvp UcBuwGapzhSJqwsoFF59K6SN+IJ9fmEgaTXE4MaqfR5EeoK6kG5PoQm4Axo9jibNmm2u SNtexRBVqDx4cHKW5dcgV0dxd3JbUMhXnz3uY= 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:mime-version:content-transfer-encoding; bh=MpkOv4z49aejGzksEgFqIQyDYgMgc5qm08lN+rzx9No=; b=lBU/oUKLT7HpV7yF5Rr+JxcXbrDOdYBXQSKHuR/kjH58Kpg41vyNeVDIqtMbjT1MZ3 pvBvCBjgv+pICP3dIE9fmj1NiJmNEqc7gSF86aJtgSefPRsZ2YXeWUbaFsEdaDGfQilb Z3vtiMI8lWJS4FUnC77oK0uGo4DPW85KFQiTlEFxcyeoO5ktIFawi1tMdjpmIpdMllpc sdoTAOWXZrXA78jE9URq/F4Cpq2245wamqo3Qjn/rUlGdytCGAHJ+bNiIuinyjL8MJ72 /EqgtDZk9SOGtDBr1a0krXmcwZZQfSE4SldE1w1fp9cV6Iw/7mBnu32QwYifnIirU/D2 e2Tg== X-Gm-Message-State: APjAAAWg88fCycdCPAhlSf2zn0zNYoUg/L81JYQcYpbk6c404YUIQrTS YJqCfzOTmm2+k2YtfZKEwepfwYeioME= X-Google-Smtp-Source: APXvYqxjoNh09VmCyfqKTgeFeUpeI/yww+TTse1V1QGQXA4fSQePUuiVbRw/50PpghOIuIEhJXI3iw== X-Received: by 2002:a6b:710b:: with SMTP id q11mr2124132iog.61.1566653273290; Sat, 24 Aug 2019 06:27:53 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:53 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:08 -0600 Message-Id: <20190824132315.53130-29-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 28/34] binman: Fix entry comment for Intel descriptor 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" This comment references another entry type. Fix it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/intel_descriptor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/etype/intel_descriptor.py b/tools/binman/etype/intel_descriptor.py index fb5e889ebf..b6477931d6 100644 --- a/tools/binman/etype/intel_descriptor.py +++ b/tools/binman/etype/intel_descriptor.py @@ -2,7 +2,7 @@ # Copyright (c) 2016 Google, Inc # Written by Simon Glass # -# Entry-type module for 'u-boot' +# Entry-type module for Intel flash descriptor # import struct From patchwork Sat Aug 24 13:23:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152632 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="QzXFPFmB"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46FzqZ4ddCz9sBF for ; Sat, 24 Aug 2019 23:38:18 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E1FF8C21E1E; Sat, 24 Aug 2019 13:30:58 +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 1F26FC21C8B; Sat, 24 Aug 2019 13:28:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B0DF5C21E1E; Sat, 24 Aug 2019 13:27:58 +0000 (UTC) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) by lists.denx.de (Postfix) with ESMTPS id DC1C0C21E02 for ; Sat, 24 Aug 2019 13:27:55 +0000 (UTC) Received: by mail-io1-f68.google.com with SMTP id q22so26701753iog.4 for ; Sat, 24 Aug 2019 06:27:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GRT5Epgt0uE7TBA2lER8Fl5v1gLNEXyIJXkSIQkJrhQ=; b=QzXFPFmBlQEStVVJS9SK7g9VA2LAMqSrgifcr4csoU8GgCYM0ZRJ6VR4afrfdHHYo8 wUogkSUL3t9xJ+sjpmXgk2/dSQpAVOu7YzFfOK3L8zkqk+T6Wovj7nKGI7WgMFCV6fuZ yp2HwPm7QOdcd164P0t9aoysqQpSt04qC0KJ0= 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:mime-version:content-transfer-encoding; bh=GRT5Epgt0uE7TBA2lER8Fl5v1gLNEXyIJXkSIQkJrhQ=; b=Y8TQsmkHMxXbZ8PqWNnkMUrK9FQb/P+QGaA2TUqy+k1ahG8XhACkZeSlboIfdinKLY ix6bPpIbDWUHJZd4NiYhQZgbTy546i5PnN9bt5Zy+rHWfwdt4a6mBcUL2eMdz891Upsu NhBpzfeRX5Ps+WJ/u1maKCkFZifr9YFT0PUk1PYrQLcGnZMmvWiBL9sUeyCks4/hplGX NNQ/9sg7vG7OlT0Achom4x8bgWXpxDi0CuSXThwYwWC7LTjefti8K0wL2tWi5CQzzH8N 9AtzK2Kz5kRc5wVKqEqRYR74rC4hy8Rz37ttUphHRyYGi3CIHTGTUQ/sxA2GV7RygMRB Sjtg== X-Gm-Message-State: APjAAAW0jDQ42UPRZsG9A9PQRNg80wjEh7GhIQiFnwKlXU7fG0um2de2 BCeQNcd+QyDEi1K4oFhDlkf570jBgbA= X-Google-Smtp-Source: APXvYqypj5uPs8VwAabJhCtwlx1G/yeJvCzTC22L4NZ4FRm6UBBDkpzMwjpQgjkQswxn3W730FOnng== X-Received: by 2002:a5d:8196:: with SMTP id u22mr6129435ion.280.1566653274794; Sat, 24 Aug 2019 06:27:54 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:54 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:09 -0600 Message-Id: <20190824132315.53130-30-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 29/34] binman: Update IFWI entry to read entries outside constructor 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" At present this class reads its entries in the constructor. This is not how things should be done now. Update it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/intel_ifwi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index e4da3e498a..ef2b35706f 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -48,7 +48,10 @@ class Entry_intel_ifwi(Entry_blob): Entry_blob.__init__(self, section, etype, node) self._convert_fit = fdt_util.GetBool(self._node, 'convert-fit') self._ifwi_entries = OrderedDict() + + def ReadNode(self): self._ReadSubnodes() + Entry_blob.ReadNode(self) def ObtainContents(self): """Get the contects for the IFWI From patchwork Sat Aug 24 13:23:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152620 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="EEpHe65x"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzjv34W8z9s7T for ; Sat, 24 Aug 2019 23:33:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 260A2C21D8E; Sat, 24 Aug 2019 13:31:49 +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=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 6D533C21DE8; Sat, 24 Aug 2019 13:29:27 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 00B03C21E35; Sat, 24 Aug 2019 13:28:00 +0000 (UTC) Received: from mail-io1-f66.google.com (mail-io1-f66.google.com [209.85.166.66]) by lists.denx.de (Postfix) with ESMTPS id 740ACC21DD4 for ; Sat, 24 Aug 2019 13:27:57 +0000 (UTC) Received: by mail-io1-f66.google.com with SMTP id j5so26655280ioj.8 for ; Sat, 24 Aug 2019 06:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x510gcJBvDIXIPPumxPz9wM23L7i7WzZ7ypnp6GGVuU=; b=EEpHe65xgaHrGJC2Pz4WLHYkNBPZuvJfeTdeqWWTQIFGtToNqk5Z6tY4X4U2lvwbXg aOF4G689eXSNsOarCu1azp8m5Aq2ITiespzrH/QfKjCbS6EHwX9QXB4U9f8j/9WwylIt lzyYZKBtY/URA6XLoiyNuK3pSHhFL65O+md40= 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:mime-version:content-transfer-encoding; bh=x510gcJBvDIXIPPumxPz9wM23L7i7WzZ7ypnp6GGVuU=; b=p3rC08MoQV+PbZeyxlqtZRjUUd7Y6vW/tV7KSd5dWNH/WoJFNn5xuKLqmfpSM2/ECn 7vzcjDcnbQjmNqGVJ+O87eag2SYS0l8O95hU+7Sl5rkyHgsOjZFxOTcRHAZO4w7oyb7K 5P/+W75uniXkkpjo8khF5eyk9wvhH/r6ryngUEdyTURpev24fUhfVv6puU/BYk2mk7Qb Yx3UR94XeyldMeLtdXKRhoCdJ3J8teUzb5xzmTxPWEY5+2CCO6o4pYNONB3pBSdCwN/y 1m0yH8Zw7EgqA/xgxyXTcFbEYZ64NygMkNYiML/nKWnY+d4SS+tD7gru0j9SvzJm4LpK P96w== X-Gm-Message-State: APjAAAV8SqfyVCD/LQseH7TsPBU6gvhlxyrmCoPuEntFkaAYsqeLjSI1 fx3S2G1huxNU6zHO1sw0PBJN4V8iBy0= X-Google-Smtp-Source: APXvYqzC4NBCp+NtOHLUODMgbmAAYkRttD1P7GpR/ogIRWeVY16uTAgne97PyWRx+TZV1twTWMvO/w== X-Received: by 2002:a05:6638:a12:: with SMTP id 18mr4729985jan.123.1566653276262; Sat, 24 Aug 2019 06:27:56 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:10 -0600 Message-Id: <20190824132315.53130-31-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 30/34] binman: Update IFWI entry to support updates 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" Add support for the ProcessContents() method in this entry so that it is possible to support entries which change after initial creation. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/intel_ifwi.py | 46 +++++++++++++++++++------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index ef2b35706f..17792defe9 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -53,22 +53,8 @@ class Entry_intel_ifwi(Entry_blob): self._ReadSubnodes() Entry_blob.ReadNode(self) - def ObtainContents(self): - """Get the contects for the IFWI - - Unfortunately we cannot create anything from scratch here, as Intel has - tools which create precursor binaries with lots of data and settings, - and these are not incorporated into binman. - - The first step is to get a file in the IFWI format. This is either - supplied directly or is extracted from a fitimage using the 'create' - subcommand. - - After that we delete the OBBP sub-partition and add each of the files - that we want in the IFWI file, one for each sub-entry of the IWFI node. - """ - self._pathname = tools.GetInputFilename(self._filename) - + def _BuildIfwi(self): + """Build the contents of the IFWI and write it to the 'data' property""" # Create the IFWI file if needed if self._convert_fit: inname = self._pathname @@ -85,8 +71,6 @@ class Entry_intel_ifwi(Entry_blob): for entry in self._ifwi_entries.values(): # First get the input data and put it in a file - if not entry.ObtainContents(): - return False data = entry.GetData() uniq = self.GetUniqueName() input_fname = tools.GetOutputFilename('input.%s' % uniq) @@ -99,6 +83,32 @@ class Entry_intel_ifwi(Entry_blob): self.ReadBlobContents() return True + def ObtainContents(self): + """Get the contects for the IFWI + + Unfortunately we cannot create anything from scratch here, as Intel has + tools which create precursor binaries with lots of data and settings, + and these are not incorporated into binman. + + The first step is to get a file in the IFWI format. This is either + supplied directly or is extracted from a fitimage using the 'create' + subcommand. + + After that we delete the OBBP sub-partition and add each of the files + that we want in the IFWI file, one for each sub-entry of the IWFI node. + """ + self._pathname = tools.GetInputFilename(self._filename) + for entry in self._ifwi_entries.values(): + if not entry.ObtainContents(): + return False + return self._BuildIfwi() + + def ProcessContents(self): + orig_data = self.data + self._BuildIfwi() + same = orig_data == self.data + return same + def _ReadSubnodes(self): """Read the subnodes to find out what should go in this IFWI""" for node in self._node.subnodes: From patchwork Sat Aug 24 13:23:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152629 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="f2vabed/"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzpl11GFz9s7T for ; Sat, 24 Aug 2019 23:37:35 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C773BC21E07; Sat, 24 Aug 2019 13:33:04 +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 88A52C21E89; Sat, 24 Aug 2019 13:30:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7F75AC21DAF; Sat, 24 Aug 2019 13:28:02 +0000 (UTC) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by lists.denx.de (Postfix) with ESMTPS id 0D5D0C21D4A for ; Sat, 24 Aug 2019 13:27:59 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id t6so26699702ios.7 for ; Sat, 24 Aug 2019 06:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a39owbv1ffte0ESLvCaYmbgPN4FHKUS1oJnIL8QrJQ0=; b=f2vabed/9ex5hIaiSCI3Zkx1ZfzGm2IAAPCwobIWkrudVlkv7QFm8xq4y+KZIVLoXL Tqd2V1T6Q6uac9tpwFhKXaHB9Pyr2iqNxPoWoWBo2U1emhM4oCGn0CkNOQ4jtJHbTAaT ofek3OEa2PWb1NdyfNMy1rac/yuNj9JIJmS1I= 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:mime-version:content-transfer-encoding; bh=a39owbv1ffte0ESLvCaYmbgPN4FHKUS1oJnIL8QrJQ0=; b=irz0J2AO5Y/oneuvkXqlhNz7UNdsZFCZ7WHJEaexvlwfH+xV+s2dGErDTqjLiCtjUr rmjG3QZOssMVcUQC1K00HLPWfsAlKQVDzsCG4m8Z4elO5QbnYDp5cJmTRSTeD7WsetDm Uj6T0WJTS5WVeuT/vUA8QUjL8x4YF/CdIGwaGDyTtqpF3pp76wYXcGFZg0SXrCpdtnW4 2S2STRnAGDI8gh4m3gkZZ1tKiuNS7h7Fu9fgVlqIhiT0Oaxz9GK+H7pEpvnKOEaj/iR9 +t/VzifcSg3JQcmBgoXDPN+mThq8XvQXXJcJ15Pjso4KTQtpRP1Wfa0dxFCYqoxxuFkE n0ag== X-Gm-Message-State: APjAAAUa1QJ8itDozKGGre5UqjFsokPsxqGO3xP0/WC29kuyeIsMqqph OQ51xHE3kECLco1rYawMBMKtMZ/DnuE= X-Google-Smtp-Source: APXvYqzHnBx47fL9Mw/QKlUdLwAX+13Nzl3HNuNX/kCk+yZZCRVHBPVOOm4Ks1WLG1y/aD6fZAeBug== X-Received: by 2002:a02:6d24:: with SMTP id m36mr9633495jac.87.1566653277898; Sat, 24 Aug 2019 06:27:57 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:57 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:11 -0600 Message-Id: <20190824132315.53130-32-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 31/34] binman: Support writing symbols into entries within an IFWI 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" The Intel IFWI (Integrated Firmware Image) is effectively a section with other entries inside it. Support writing symbol information into entries within it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/etype/intel_ifwi.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/binman/etype/intel_ifwi.py b/tools/binman/etype/intel_ifwi.py index 17792defe9..36aadc210c 100644 --- a/tools/binman/etype/intel_ifwi.py +++ b/tools/binman/etype/intel_ifwi.py @@ -118,3 +118,8 @@ class Entry_intel_ifwi(Entry_blob): entry._ifwi_subpart = fdt_util.GetString(node, 'ifwi-subpart') entry._ifwi_entry_name = fdt_util.GetString(node, 'ifwi-entry') self._ifwi_entries[entry._ifwi_subpart] = entry + + def WriteSymbols(self, section): + """Write symbol values into binary files for access at run time""" + for entry in self._ifwi_entries.values(): + entry.WriteSymbols(self) From patchwork Sat Aug 24 13:23:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152628 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hkRhAxue"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fznh2Cftz9s7T for ; Sat, 24 Aug 2019 23:36:40 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E16F4C21E02; Sat, 24 Aug 2019 13:32:55 +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=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 98F86C21E0D; Sat, 24 Aug 2019 13:30:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A27E7C21D56; Sat, 24 Aug 2019 13:28:03 +0000 (UTC) Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by lists.denx.de (Postfix) with ESMTPS id D7A84C21E02 for ; Sat, 24 Aug 2019 13:28:00 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id e20so26590058iob.9 for ; Sat, 24 Aug 2019 06:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dNOLeLpb10OUoAnuP2y6h8Aof0YxgGtuhav+1ehfksw=; b=hkRhAxueyqM/xZDPW3dG+j0sMz5hUXT4CS8ZucYgdiFvTjgJ7/CYC2d/VVRS4bCKmE AXCQZoFTnE6CCZ7NdHBMZdf5ta5JvtGyqE0dJWNpzYLuMZMKSWVFD3km6nTzNg1JKfMD tUdfQwbaQDGGgYYmU0O3mYjR8oX+pXElbMrd0= 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:mime-version:content-transfer-encoding; bh=dNOLeLpb10OUoAnuP2y6h8Aof0YxgGtuhav+1ehfksw=; b=o8tSM9W0IF+g3RlL3ddMZHqjhipXb+X1qkMyNrE1NrSViXMrBeQibcPQp6uCXrqU0D 86fwkIJMJNJwX5dLl+TPdbcWInnxl9JDZ2tvwdnaroyfwbhaApt6+vZSpvXsgMmjCEKW 3Z87NjXaPeFJCEVs7nxADpJkTqsH7uJFisOgRwQTDdV0PfBESymOnPdHhB1lRQxeW+kL z6/cuJH2Mksw5L1oLtzpjtxsVs/Z7Q9tF49WipWA533M8LZacfS57Xrfr++sVVcyEjFB 3cTenLdPoM9PS/eyulXK/w9wJT+UaT+M4M6Emr45eiAYRx5Hr/LOCSFlHkgt5ehknR+4 IgKw== X-Gm-Message-State: APjAAAU/fnJyrfDBwawnQHok8XdlBhznyV9MotYvMp2sHLDSx7KNbMlM 6X4SnR0Vf5bXtk2s01oxyKoOGjOAIS8= X-Google-Smtp-Source: APXvYqw4kYwQ4XDBn3NTGCBMTfIVyz0NNm0wh/Xeu8kiJ3dfv9eKZPhn8/q1GfWH8L4uF77T6kzv8Q== X-Received: by 2002:a02:c055:: with SMTP id u21mr10063926jam.32.1566653279734; Sat, 24 Aug 2019 06:27:59 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:27:59 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:12 -0600 Message-Id: <20190824132315.53130-33-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 32/34] binman: Write symbol info before image inclusion 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" At present the symbol information is written to binaries just before binman exits. This is fine for entries within sections since the section contents is calculated when it is needed, so the updated symbol values are included in the image that is written. However some binaries are inside entries which have already generated their contents and do not notice that the entries have changed (e.g. Intel IFWI). Move the symbol writing earlier to cope with this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/binman/control.py b/tools/binman/control.py index 43f5d49406..07dffbd89c 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -434,6 +434,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, for dtb_item in state.GetAllFdts(): dtb_item.Sync() dtb_item.Flush() + image.WriteSymbols() sizes_ok = image.ProcessEntryContents() if sizes_ok: break @@ -442,7 +443,6 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, image.Raise('Entries changed size after packing (tried %s passes)' % passes) - image.WriteSymbols() image.BuildImage() if write_map: image.WriteMap() From patchwork Sat Aug 24 13:23:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152640 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Eb42jSj2"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzvg5G64z9s7T for ; Sat, 24 Aug 2019 23:41:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 5958AC21F01; Sat, 24 Aug 2019 13:30:22 +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=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 BD253C21E45; Sat, 24 Aug 2019 13:28:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 447EFC21DE8; Sat, 24 Aug 2019 13:28:04 +0000 (UTC) Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by lists.denx.de (Postfix) with ESMTPS id 42847C21D8E for ; Sat, 24 Aug 2019 13:28:02 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id t6so26699905ios.7 for ; Sat, 24 Aug 2019 06:28:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DOiayrgli6WVtmX6499Or0mg0GWKCqH/19DDCkXIwGQ=; b=Eb42jSj2DVJsQyLhWTuC2j09md0siViQTM9yOfl66Bxhe0oBVIopUc9KFnf1C9BDgU ACm66Qq/y/ycR0vXGivbwMJ5w4XaQRau173EL43tgvxkKtCpOCaov5WzQ24Hmk/Rku7u 2kz4uMxcNh2AxvrA8wby3UYGN+7W43nGIVpDU= 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:mime-version:content-transfer-encoding; bh=DOiayrgli6WVtmX6499Or0mg0GWKCqH/19DDCkXIwGQ=; b=ORz4pWksRWuRiHArvpWGxsVQzwi2p/5bx68uu+58DEtUOHv4hoMORkYk53l9v22pi6 hW/esQFccvY2SbMV1J6/s4hBkAqmwPDS3l9hXYqOWg8S0PoK0s4HozwhMONgrFDKCQHP mFwj6imEgZcJr7Ukx4PMRWj9Fz1XxFu9KeMiX4RCAZjuJag66aEgC8w6NQ7BPmjfrtdf xsbO4hMuotEpODH0TJX9A5G1we+V3y8HsZ9ZS/OTT4g92MJvDYultob5bq+dozjS9O3H dm2Kwk2xZ4zVLKs45M7fsfhMaX+Iak0ZSuDcrulTx+5MpjXSsCzUx7NOJTDag1O/Hnut 01Sw== X-Gm-Message-State: APjAAAXkltk2NqFGvWZTsFiCkP+11qBZHt3KFxuPrsoaSw85r2QWh4ct B7ZyW6hObBxt97LU4nEZvtblZYL0Nx0= X-Google-Smtp-Source: APXvYqxJZC7Or/GTrH95vWg4PrDCzgU+trl/mMEIepfDJhvXcsQVNSaPuVgVO9pXOF4AKYEQQw6OXg== X-Received: by 2002:a05:6602:2193:: with SMTP id b19mr13717149iob.113.1566653281159; Sat, 24 Aug 2019 06:28:01 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:28:00 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:13 -0600 Message-Id: <20190824132315.53130-34-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 33/34] binman: Add logging for the number of pack passes 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" Sometimes binman takes multiple passes to complete packing an image. Add logging to indicate this. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/control.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/binman/control.py b/tools/binman/control.py index 07dffbd89c..d1ca798cfb 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -439,6 +439,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True, if sizes_ok: break image.ResetForPack() + tout.Info('Pack completed after %d pass(es)' % (pack_pass + 1)) if not sizes_ok: image.Raise('Entries changed size after packing (tried %s passes)' % passes) From patchwork Sat Aug 24 13:23:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1152623 X-Patchwork-Delegate: sjg@chromium.org 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=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ORPqrZuy"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Fzm21mg8z9s7T for ; Sat, 24 Aug 2019 23:35:14 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B702AC21C8B; Sat, 24 Aug 2019 13:31:39 +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=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 9F528C21E1E; Sat, 24 Aug 2019 13:29:25 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 635C8C21DFA; Sat, 24 Aug 2019 13:28:06 +0000 (UTC) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by lists.denx.de (Postfix) with ESMTPS id BE16DC21DEC for ; Sat, 24 Aug 2019 13:28:03 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id q22so26702242iog.4 for ; Sat, 24 Aug 2019 06:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lDinUX1EglsQ/akom6Rw7ELo9iNSgWcGt6uS9KAo+yg=; b=ORPqrZuyDAnnjM8bOa5prquCh6lPb/jXFeKsEtG9rzJDHbCNvxPyoYrEGk2k7sSIfo 57Gda2b5TbYvG1kQGWAe6q3NUp02W7zSZg7fguFDWv7ocTWzNb2Lmkxc9FbRttvaiTAl wckhDMUODaD/AMKrHL5dC+oEba1lFiCU5T1FA= 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:mime-version:content-transfer-encoding; bh=lDinUX1EglsQ/akom6Rw7ELo9iNSgWcGt6uS9KAo+yg=; b=B2z8gajFQ671jHdVvvtbMriLFptOX7UzFAHMxFRMCp7o8wCC63BluaviNilPn8SURt SVar0mE/0pslIli/0wMFT4FWTgwmIlI+7mMSRPdapZSa3q/MOXqiDb3jQCkVMGwKX8Zt cu3yPxLNG4p99d0O+8rAwhn5KKFyVmlJyWRiiXwrEIavKdYecDogFPqPY/+C2YtUbKWv m6FwZ9g11kVRyzI+s/me9DNyQQJ7GAasleYkEjmUY9PmcRbsRvaEuhxFVrnfFCOSsSqz v5dLccrhOPm6Hti64Ml9kntDohKc5lTLAe02mHryyqHkrFNUtU8EyKfidw8+cB2wE+sJ oLyQ== X-Gm-Message-State: APjAAAX5oI0bxdZ8qEOXygYb09/9oVr2lWR3uxnPWfEbpDRiqGrxz456 XDzJot/3eBksMW5ldJvhz+3g3p2r69Q= X-Google-Smtp-Source: APXvYqzLeZu7jO1L5ydXb+IuElnU1OGurvY8zdHIy3h6vGCliwvhEIsz9gJuJDIwl4j4tojdorNiDw== X-Received: by 2002:a6b:7a0a:: with SMTP id h10mr9898377iom.45.1566653282659; Sat, 24 Aug 2019 06:28:02 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([2620:15c:183:0:8223:87c:a681:66aa]) by smtp.gmail.com with ESMTPSA id l2sm8881790ioq.83.2019.08.24.06.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Aug 2019 06:28:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Sat, 24 Aug 2019 07:23:14 -0600 Message-Id: <20190824132315.53130-35-sjg@chromium.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190824132315.53130-1-sjg@chromium.org> References: <20190824132315.53130-1-sjg@chromium.org> MIME-Version: 1.0 Subject: [U-Boot] [PATCH 34/34] binman: Drop comment-out code in testUpdateFdtOutput() 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" This code is not needed so drop it. Signed-off-by: Simon Glass Signed-off-by: Simon Glass --- tools/binman/ftest.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index b0b942dfdc..0a66369cbd 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -1669,8 +1669,6 @@ class TestFunctional(unittest.TestCase): # source file (e.g. test/075_fdt_update_all.dts) thus does not enter # binman as a file called u-boot.dtb. To fix this, copy the file # over to the expected place. - #tools.WriteFile(os.path.join(self._indir, 'u-boot.dtb'), - #tools.ReadFile(tools.GetOutputFilename('source.dtb'))) start = 0 for fname in ['u-boot.dtb.out', 'spl/u-boot-spl.dtb.out', 'tpl/u-boot-tpl.dtb.out']: