All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v3 15/27] binman: Allow a way to select expanded entries
Date: Thu, 18 Mar 2021 20:25:05 +1300	[thread overview]
Message-ID: <20210318072517.26894-16-sjg@chromium.org> (raw)
In-Reply-To: <20210318072517.26894-1-sjg@chromium.org>

Add a new command-line option to disable expanded entries. This is needed
for most tests, since it is much easier to 'factor out' this function into
a separate test and keep the existing packing tests simple.

Add the option and select it by default from tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 tools/binman/cmdline.py |  3 +++
 tools/binman/ftest.py   | 19 +++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py
index c007d0a036d..0c0f48951f6 100644
--- a/tools/binman/cmdline.py
+++ b/tools/binman/cmdline.py
@@ -56,6 +56,9 @@ controlled by a description in the board device tree.'''
         default=False, help='Output a map file for each image')
     build_parser.add_argument('-M', '--allow-missing', action='store_true',
         default=False, help='Allow external blobs to be missing')
+    build_parser.add_argument('-n', '--no-expanded', action='store_true',
+            help="Don't use 'expanded' versions of entries where available; "
+                 "normally 'u-boot' becomes 'u-boot-expanded', for example")
     build_parser.add_argument('-O', '--outdir', type=str,
         action='store', help='Path to directory to use for intermediate and '
         'output files')
diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py
index d1bf64ce271..91825844178 100644
--- a/tools/binman/ftest.py
+++ b/tools/binman/ftest.py
@@ -305,7 +305,8 @@ class TestFunctional(unittest.TestCase):
 
     def _DoTestFile(self, fname, debug=False, map=False, update_dtb=False,
                     entry_args=None, images=None, use_real_dtb=False,
-                    verbosity=None, allow_missing=False, extra_indirs=None):
+                    use_expanded=False, verbosity=None, allow_missing=False,
+                    extra_indirs=None):
         """Run binman with a given test file
 
         Args:
@@ -322,6 +323,8 @@ class TestFunctional(unittest.TestCase):
                 the u-boot-dtb entry. Normally this is not needed and the
                 test contents (the U_BOOT_DTB_DATA string) can be used.
                 But in some test we need the real contents.
+            use_expanded: True to use expanded entries where available, e.g.
+                'u-boot-expanded' instead of 'u-boot'
             verbosity: Verbosity level to use (0-3, None=don't set it)
             allow_missing: Set the '--allow-missing' flag so that missing
                 external binaries just produce a warning instead of an error
@@ -344,6 +347,8 @@ class TestFunctional(unittest.TestCase):
             args.append('-u')
         if not use_real_dtb:
             args.append('--fake-dtb')
+        if not use_expanded:
+            args.append('--no-expanded')
         if entry_args:
             for arg, value in entry_args.items():
                 args.append('-a%s=%s' % (arg, value))
@@ -403,9 +408,9 @@ class TestFunctional(unittest.TestCase):
         dtb.Pack()
         return dtb.GetContents()
 
-    def _DoReadFileDtb(self, fname, use_real_dtb=False, map=False,
-                       update_dtb=False, entry_args=None, reset_dtbs=True,
-                       extra_indirs=None):
+    def _DoReadFileDtb(self, fname, use_real_dtb=False, use_expanded=False,
+                       map=False, update_dtb=False, entry_args=None,
+                       reset_dtbs=True, extra_indirs=None):
         """Run binman and return the resulting image
 
         This runs binman with a given test file and then reads the resulting
@@ -420,6 +425,8 @@ class TestFunctional(unittest.TestCase):
                 the u-boot-dtb entry. Normally this is not needed and the
                 test contents (the U_BOOT_DTB_DATA string) can be used.
                 But in some test we need the real contents.
+            use_expanded: True to use expanded entries where available, e.g.
+                'u-boot-expanded' instead of 'u-boot'
             map: True to output map files for the images
             update_dtb: Update the offset and size of each entry in the device
                 tree before packing it into the image
@@ -454,7 +461,7 @@ class TestFunctional(unittest.TestCase):
         try:
             retcode = self._DoTestFile(fname, map=map, update_dtb=update_dtb,
                     entry_args=entry_args, use_real_dtb=use_real_dtb,
-                    extra_indirs=extra_indirs)
+                    use_expanded=use_expanded, extra_indirs=extra_indirs)
             self.assertEqual(0, retcode)
             out_dtb_fname = tools.GetOutputFilename('u-boot.dtb.out')
 
@@ -652,7 +659,7 @@ class TestFunctional(unittest.TestCase):
         """Test that we can run it with a specific board"""
         self._SetupDtb('005_simple.dts', 'sandbox/u-boot.dtb')
         TestFunctional._MakeInputFile('sandbox/u-boot.bin', U_BOOT_DATA)
-        result = self._DoBinman('build', '-b', 'sandbox')
+        result = self._DoBinman('build', '-n', '-b', 'sandbox')
         self.assertEqual(0, result)
 
     def testNeedBoard(self):
-- 
2.31.0.rc2.261.g7f71774620-goog

  parent reply	other threads:[~2021-03-18  7:25 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18  7:24 [PATCH v3 00/27] binman: Support devicetree update in all entries Simon Glass
2021-03-18  7:24 ` [PATCH v3 01/27] binman: Allow extracting to current directory Simon Glass
2021-03-18  7:24 ` [PATCH v3 02/27] binman: Document ExpandEntries() in the base class Simon Glass
2021-03-18  7:24 ` [PATCH v3 03/27] binman: Update entry help for files-align Simon Glass
2021-03-18  7:24 ` [PATCH v3 04/27] binman: Tidy up underscores in entry documentation Simon Glass
2021-03-18  7:24 ` [PATCH v3 05/27] binman: Correct the documentation for u-boot-spl-bss-pad Simon Glass
2021-03-18  7:24 ` [PATCH v3 06/27] binman: Support symbols in u-boot-spl-nodtb Simon Glass
2021-03-18  7:24 ` [PATCH v3 07/27] binman: Add support for u-boot-tpl-nodtb Simon Glass
2021-03-18  7:24 ` [PATCH v3 08/27] binman: Add support for u-boot-tpl-bss-bad Simon Glass
2021-03-18  7:24 ` [PATCH v3 09/27] binman: Drop unnecessary 'type' property in tests Simon Glass
2021-03-18  7:25 ` [PATCH v3 10/27] binman: Use the fake SPL/TPL only if requested Simon Glass
2021-03-18  7:25 ` [PATCH v3 11/27] binman: Drop unnecessary field in output_fdt_info Simon Glass
2021-03-18  7:25 ` [PATCH v3 12/27] binman: Move the comment for GetFdts() to the base class Simon Glass
2021-03-18  7:25 ` [PATCH v3 13/27] binman: Use standard filenames for SPL/TPL devicetree Simon Glass
2021-03-18  7:25 ` [PATCH v3 14/27] binman: Allow using an an 'expanded' entry type Simon Glass
2021-03-18  7:25 ` Simon Glass [this message]
2021-03-18  7:25 ` [PATCH v3 16/27] binman: Plumb expanded entries through fully Simon Glass
2021-03-18  7:25 ` [PATCH v3 17/27] binman: Automatically expand phase binaries into sections Simon Glass
2021-03-18  7:25 ` [PATCH v3 18/27] Makefile: Pass new entry args to binman Simon Glass
2021-03-18  7:25 ` [PATCH v3 19/27] x86: Make use of binman expanded entries Simon Glass
2021-03-18  7:25 ` [PATCH v3 20/27] x86: dts: Drop unused CONFIG_SPL Simon Glass
2021-03-18  7:25 ` [PATCH v3 21/27] doc: Move UEFI under develop/ Simon Glass
2021-03-18  9:23   ` Heinrich Schuchardt
2021-03-19 23:52   ` Simon Glass
2021-03-18  7:25 ` [PATCH v3 22/27] doc: Move driver model docs " Simon Glass
2021-03-18  7:25 ` [PATCH v3 23/27] binman: doc: Add documentation to htmldocs Simon Glass
2021-03-18  7:25 ` [PATCH v3 24/27] binman: Rearrange documentation into headings Simon Glass
2021-03-18  7:25 ` [PATCH v3 25/27] binman: Incorporate entry documentation Simon Glass
2021-03-18  7:25 ` [PATCH v3 26/27] binman: Drop repetitive heading for each entry Simon Glass
2021-03-18  7:25 ` [PATCH v3 27/27] binman: Update various pieces of the documentation Simon Glass
2021-03-19 23:52 ` Simon Glass
2021-03-19 23:52 ` [PATCH v3 26/27] binman: Drop repetitive heading for each entry Simon Glass
2021-03-19 23:52 ` [PATCH v3 25/27] binman: Incorporate entry documentation Simon Glass
2021-03-19 23:52 ` [PATCH v3 24/27] binman: Rearrange documentation into headings Simon Glass
2021-03-19 23:52 ` [PATCH v3 23/27] binman: doc: Add documentation to htmldocs Simon Glass
2021-03-19 23:52 ` [PATCH v3 22/27] doc: Move driver model docs under develop/ Simon Glass
2021-03-19 23:52 ` [PATCH v3 20/27] x86: dts: Drop unused CONFIG_SPL Simon Glass
2021-03-19 23:52 ` [PATCH v3 19/27] x86: Make use of binman expanded entries Simon Glass
2021-03-19 23:52 ` [PATCH v3 18/27] Makefile: Pass new entry args to binman Simon Glass
2021-03-19 23:52 ` [PATCH v3 17/27] binman: Automatically expand phase binaries into sections Simon Glass
2021-03-19 23:52 ` [PATCH v3 16/27] binman: Plumb expanded entries through fully Simon Glass
2021-03-19 23:52 ` [PATCH v3 15/27] binman: Allow a way to select expanded entries Simon Glass
2021-03-19 23:52 ` [PATCH v3 14/27] binman: Allow using an an 'expanded' entry type Simon Glass
2021-03-19 23:52 ` [PATCH v3 13/27] binman: Use standard filenames for SPL/TPL devicetree Simon Glass
2021-03-19 23:52 ` [PATCH v3 12/27] binman: Move the comment for GetFdts() to the base class Simon Glass
2021-03-19 23:52 ` [PATCH v3 11/27] binman: Drop unnecessary field in output_fdt_info Simon Glass
2021-03-19 23:52 ` [PATCH v3 10/27] binman: Use the fake SPL/TPL only if requested Simon Glass
2021-03-19 23:53 ` [PATCH v3 09/27] binman: Drop unnecessary 'type' property in tests Simon Glass
2021-03-19 23:53 ` [PATCH v3 08/27] binman: Add support for u-boot-tpl-bss-bad Simon Glass
2021-03-19 23:53 ` [PATCH v3 07/27] binman: Add support for u-boot-tpl-nodtb Simon Glass
2021-03-19 23:53 ` [PATCH v3 06/27] binman: Support symbols in u-boot-spl-nodtb Simon Glass
2021-03-19 23:53 ` [PATCH v3 05/27] binman: Correct the documentation for u-boot-spl-bss-pad Simon Glass
2021-03-19 23:53 ` [PATCH v3 04/27] binman: Tidy up underscores in entry documentation Simon Glass
2021-03-19 23:53 ` [PATCH v3 03/27] binman: Update entry help for files-align Simon Glass
2021-03-19 23:53 ` [PATCH v3 02/27] binman: Document ExpandEntries() in the base class Simon Glass
2021-03-19 23:53 ` [PATCH v3 01/27] binman: Allow extracting to current directory Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210318072517.26894-16-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.