From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2444C433F5 for ; Mon, 10 Jan 2022 03:15:34 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4EC0B8302C; Mon, 10 Jan 2022 04:15:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="kfigt9NG"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3D2BC81761; Mon, 10 Jan 2022 04:15:16 +0100 (CET) Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 12574819D3 for ; Mon, 10 Jan 2022 04:15:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd36.google.com with SMTP id w22so5247509iov.3 for ; Sun, 09 Jan 2022 19:15:11 -0800 (PST) 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=5IhYen+bqxfL+/d5STLMQLbLrD43KHIPVTbn1ANYCdk=; b=kfigt9NGhkp6BV4IqG38yoh/GlKWBxoOuGgdmCxjo0wxszsZyf1hWF6syp6f3eUR9E NbMrXTRhvU+e1LQnqjYJuudUqc9kc51OSuCtcln6jYTBzCZbHAD79hFQtR8vcJ1HtLlV VWcXRM7dc8Gggr98CZei+dADxRTpAXRjQDG/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5IhYen+bqxfL+/d5STLMQLbLrD43KHIPVTbn1ANYCdk=; b=UaRW4GXgyTnpEqwRQ1QBrnWzeyaFR27XSDa1DNESIHU+Iz3JvWJOebfon1eb4ohq39 IzS9LimHvAO6V5hoDjPiCfp1jj7KIdDfoaQ2adcIH1lI3IXKszyjII99e6A7Cgo45PFb WmNEPyYHxsJoQjJFO6IL0+UlUK00G6bM7zF2G6leT7lkWhNhy8WhbAI3Cf9QUUCi+95J dSK/AA3b7jIoGg4Xcl+9DAR5KBJ8ang/0lCe+tusCmG7JeiGy1vM2jzBk9ksRLKOyJKO GyVMLGVnmia2HcA/UWGr2vzt4NTUn0uaSA+IrFmttQd6WpZFVcwXj9/9+xeL7oGlRi30 Ov9A== X-Gm-Message-State: AOAM5309bRzipEwRCxKUbwo4W88dOLZKFSXHZf29bZ26HN9DIG9VKrJ/ R9UTcuAMFgxSyTyX/i/e0iDcBna+m1zY5Q== X-Google-Smtp-Source: ABdhPJypJPRo/ZdkMDcfrOqbT7paKm41bL6H/9ZFO1XaMe9UTAoYDlubRW3xwIR65LVQQEz3BAs3jA== X-Received: by 2002:a05:6602:1648:: with SMTP id y8mr4913833iow.149.1641784509667; Sun, 09 Jan 2022 19:15:09 -0800 (PST) Received: from sjg1.roam.corp.google.com (c-67-190-101-114.hsd1.co.comcast.net. [67.190.101.114]) by smtp.gmail.com with ESMTPSA id d16sm3542182ioy.29.2022.01.09.19.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 19:15:09 -0800 (PST) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH v2 04/38] binman: Expand the external FIT test a little Date: Sun, 9 Jan 2022 20:13:39 -0700 Message-Id: <20220110031413.1970836-5-sjg@chromium.org> X-Mailer: git-send-email 2.34.1.575.g55b058a8bb-goog In-Reply-To: <20220110031413.1970836-1-sjg@chromium.org> References: <20220110031413.1970836-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean At present this does not check that the external data is in the expected place. Use a non-zero offset for the external data and check it. Signed-off-by: Simon Glass --- (no changes since v1) tools/binman/ftest.py | 17 +++++++++++++++++ tools/binman/test/162_fit_external.dts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index a9d9160967c..f44128de6f3 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -3713,11 +3713,28 @@ class TestFunctional(unittest.TestCase): data = self._DoReadFile('162_fit_external.dts') fit_data = data[len(U_BOOT_DATA):-2] # _testing is 2 bytes + # Size of the external-data region as set up by mkimage + external_data_size = len(U_BOOT_DATA) + 2 + expected_size = (len(U_BOOT_DATA) + 0x400 + + tools.Align(external_data_size, 4) + + len(U_BOOT_NODTB_DATA)) + # The data should be outside the FIT dtb = fdt.Fdt.FromData(fit_data) dtb.Scan() fnode = dtb.GetNode('/images/kernel') self.assertNotIn('data', fnode.props) + self.assertEqual(len(U_BOOT_DATA), + fdt_util.fdt32_to_cpu(fnode.props['data-size'].value)) + fit_pos = 0x400; + self.assertEqual( + fit_pos, + fdt_util.fdt32_to_cpu(fnode.props['data-position'].value)) + + self.assertEquals(expected_size, len(data)) + actual_pos = len(U_BOOT_DATA) + fit_pos + self.assertEqual(U_BOOT_DATA + b'aa', + data[actual_pos:actual_pos + external_data_size]) def testSectionIgnoreHashSignature(self): """Test that sections ignore hash, signature nodes for its data""" diff --git a/tools/binman/test/162_fit_external.dts b/tools/binman/test/162_fit_external.dts index 19518e05a58..6f2a629a985 100644 --- a/tools/binman/test/162_fit_external.dts +++ b/tools/binman/test/162_fit_external.dts @@ -10,7 +10,7 @@ u-boot { }; fit { - fit,external-offset = <0>; + fit,external-offset = <0x400>; description = "test-desc"; #address-cells = <1>; -- 2.34.1.575.g55b058a8bb-goog