From patchwork Wed Jun 6 00:46:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 925666 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" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="UzdEIV6a"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 410ql052sQz9s08 for ; Wed, 6 Jun 2018 10:47:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C4BFDC21F3A; Wed, 6 Jun 2018 00:47:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, 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 95A31C21E79; Wed, 6 Jun 2018 00:47:14 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7780AC21E79; Wed, 6 Jun 2018 00:47:13 +0000 (UTC) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) by lists.denx.de (Postfix) with ESMTPS id CE476C21DFB for ; Wed, 6 Jun 2018 00:47:12 +0000 (UTC) Received: by mail-io0-f182.google.com with SMTP id g22-v6so5646766iob.7 for ; Tue, 05 Jun 2018 17:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=2E5l3e3hQ5f7KYV28gyajsrQkhE/pVNylpG2Jap2OyA=; b=UzdEIV6ajbpZsx6cX00EKpIxkaPhRDG84GRpK35w95MaC82t4yDov/pMRA4+zDC+vy /kubOnFWG7gCiDo0mkvqchiSNnrnwq3xOh15LGIKWhCD0XwKrDD6fDBu4bKwlcdSuWER i+asqwZFOuKcZM6nZCUEhcHkFYSVj20E+3chjeWunhHgiOkhIo814xheFyBjTziXPMS+ Bg4+GdzwcOo4Zv2e88RA/xOGThmVG0hy095jUIk7168mEZAbjTsWJ1DCGvt2REdcF317 72q5yzq3ze5o95SQTUNRFV1zRl29ZAi3/x6UgwVZpGNFDJNDLS0iUS1VBFnrywMz7wf4 d/Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=2E5l3e3hQ5f7KYV28gyajsrQkhE/pVNylpG2Jap2OyA=; b=WjvynYF7QEVnVgmjXd3K3uxh5SyT+TUPExXRFIF7u5ZFgTcXMeXJ/V/xCR13CQaC45 K3wFP9vVzs257tu0HQTva1aFw/SL5jB1heooV0ZWbviLQ8AlNWzrLXiSl+EFjXxb+Q+/ hVARoxgDm22ofTEKwYf/Af9fN/IIAbjBg6hKElihINMthhZYzklyhhA1n1Bnv/Nzm7PK cPFVGNMpYhctZ4LThFU+r1FxIGM4+S05hnjUDiRQNJIyyIVf4qy5nVD5D8jNiQatTaDc SJLtss7SUMsNjQ6OqWCalttZ6EISu9rylYUXwPCN4SZALSYsmTKBY1U1hO0FlN28BJed 9VLg== X-Gm-Message-State: APt69E1pUG7jzURJ5xNnJwNqgh0ZUg29JkAiHjrgfEgn7SGdR13770Pa dvAiDn9T39NFx875IycZPbxxFQ== X-Google-Smtp-Source: ADUXVKJXYJ1qtxIGblfrX031EVFnwjjprpJWhhptx4M9SOtnGLk8D68zDX0MPx9eZCSeniZJ1yu/0Q== X-Received: by 2002:a6b:6709:: with SMTP id b9-v6mr856823ioc.170.1528246031278; Tue, 05 Jun 2018 17:47:11 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([100.67.80.24]) by smtp.gmail.com with ESMTPSA id g16-v6sm1338799itf.25.2018.06.05.17.47.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 17:47:10 -0700 (PDT) Received: by kiwi.bld.corp.google.com (Postfix, from userid 121222) id 42E12140700; Tue, 5 Jun 2018 18:47:09 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 5 Jun 2018 18:46:36 -0600 Message-Id: <20180606004705.79641-1-sjg@chromium.org> X-Mailer: git-send-email 2.17.1.1185.g55be947832-goog Cc: Tom Rini , Devicetree Compiler Subject: [U-Boot] [PATCH 00/29] binman: Add more tests and support for updating the device tree X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present we have 100% code coverage for binman. This series adds the same for dtoc (which converts device-tree data to C) and the Fdt class (which provides convenient Python access to the device tree). Binman already support writing a map file showing the location of each entry in the images in produces. But, with the exception of automatic linker symbols in SPL, this information is not available to U-Boot itself. The series adds support for this, by writing the updated entry position and size back to the device tree for inclusion in the image. With this, U-Boot can easily read this information and locate image entries at runtime. Note: At present the access to device-tree values is more clumbsy than it could be. Once pylibfdt support is finished, this needs another look. Simon Glass (28): binman: Make the operation of Entry__testing explicit binman: Tidy up variables in _RunMicrocodeTest() binman: Correct operation of ObtainContents() binman: Tidy up execution of tests binman: Tidy up setting of entry contents libfdt: Bring in proposed pylibfdt changes libfdt: Fix the Python pack() function libfdt: Add get_property() and del_node() binman: Move coverage logic into a new test_util file dtoc: Add some tests for the fdt module dtoc: Update tests to write failures to /tmp dtoc: Update fdt tests to increase code coverage dtoc: Make use of the new pylibfdt methods dtoc: Drop use of a local dtb buffer dtoc: Keep track of property offsets dtoc: Fix Fdt.GetNode() to handle a missing node dtoc: Update fdt tests to increase code coverage dtoc: Fix properties with a single zero-arg phandle dtoc: Fix some minor errors dtoc: Add a test for code coverage dtoc: Increase code coverage to 100% binman: Move capture_sys_output() to test_util dtoc: Avoid unwanted output during tests dtoc: Add functions to add integer properties binman: Complete documentation of stages binman: Add a ProcessFdt() method binman: Add a SetCalculatedProperties() method binman: Support updating the device tree with calc'd info Tom Rini (1): binman: Switch to 'python-coverage' scripts/dtc/libfdt/libfdt.h | 3 + scripts/dtc/pylibfdt/libfdt.i_shipped | 725 ++++++++++++++++-- tools/binman/README | 45 +- tools/binman/binman.py | 38 +- tools/binman/bsection.py | 27 + tools/binman/cmdline.py | 2 + tools/binman/control.py | 58 +- tools/binman/elf_test.py | 22 +- tools/binman/entry.py | 42 + tools/binman/etype/_testing.py | 27 +- tools/binman/etype/blob.py | 3 +- tools/binman/etype/section.py | 13 +- tools/binman/etype/u_boot_dtb_with_ucode.py | 47 +- tools/binman/etype/u_boot_spl_bss_pad.py | 4 +- tools/binman/etype/u_boot_ucode.py | 9 +- tools/binman/etype/u_boot_with_ucode_ptr.py | 11 +- tools/binman/ftest.py | 151 +++- tools/binman/image.py | 17 + tools/binman/image_test.py | 2 +- tools/binman/test/41_unknown_pos_size.dts | 1 + tools/binman/test/57_unknown_contents.dts | 14 + .../test/58_x86_ucode_spl_needs_retry.dts | 36 + tools/binman/test/59_change_size.dts | 14 + tools/binman/test/60_fdt_update.dts | 28 + tools/dtoc/dtb_platdata.py | 15 +- tools/dtoc/dtoc.py | 35 +- tools/dtoc/dtoc_test_add_prop.dts | 24 + tools/dtoc/dtoc_test_addr32_64.dts | 2 +- tools/dtoc/dtoc_test_addr64_32.dts | 2 +- tools/dtoc/dtoc_test_bad_reg.dts | 17 + tools/dtoc/dtoc_test_bad_reg2.dts | 17 + tools/dtoc/dtoc_test_phandle.dts | 6 + tools/dtoc/dtoc_test_phandle_bad.dts | 16 + tools/dtoc/dtoc_test_phandle_bad2.dts | 22 + tools/dtoc/dtoc_test_phandle_reorder.dts | 23 + tools/dtoc/dtoc_test_phandle_single.dts | 23 + tools/dtoc/dtoc_test_simple.dts | 1 + tools/dtoc/fdt.py | 110 ++- tools/dtoc/fdt_util.py | 4 +- tools/dtoc/test_dtoc.py | 223 +++++- tools/dtoc/test_fdt | 1 + tools/dtoc/test_fdt.py | 390 ++++++++++ tools/patman/test_util.py | 73 ++ 43 files changed, 2097 insertions(+), 246 deletions(-) create mode 100644 tools/binman/test/57_unknown_contents.dts create mode 100644 tools/binman/test/58_x86_ucode_spl_needs_retry.dts create mode 100644 tools/binman/test/59_change_size.dts create mode 100644 tools/binman/test/60_fdt_update.dts create mode 100644 tools/dtoc/dtoc_test_add_prop.dts create mode 100644 tools/dtoc/dtoc_test_bad_reg.dts create mode 100644 tools/dtoc/dtoc_test_bad_reg2.dts create mode 100644 tools/dtoc/dtoc_test_phandle_bad.dts create mode 100644 tools/dtoc/dtoc_test_phandle_bad2.dts create mode 100644 tools/dtoc/dtoc_test_phandle_reorder.dts create mode 100644 tools/dtoc/dtoc_test_phandle_single.dts create mode 120000 tools/dtoc/test_fdt create mode 100755 tools/dtoc/test_fdt.py create mode 100644 tools/patman/test_util.py