From patchwork Mon Mar 22 05:13:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1456370 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Ob9UqJQ5; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F3jMT219jz9sVS for ; Mon, 22 Mar 2021 16:13:41 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A9BE82A70; Mon, 22 Mar 2021 06:13:33 +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="Ob9UqJQ5"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4EE1682A6F; Mon, 22 Mar 2021 06:13:31 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) (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 4D88F82A4D for ; Mon, 22 Mar 2021 06:13:27 +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-pg1-x52d.google.com with SMTP id 32so1724537pgm.1 for ; Sun, 21 Mar 2021 22:13:27 -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=HS3ERSS4QiqsJA2IulszIi1pYHvi9ag9iJasunA2zCc=; b=Ob9UqJQ5nPSXvuFGE4Td8d1xajw0y+FxaF39tuTCNeUpNIe7AFOsnySdp/rIQ5T2rx OCHr1ihPXHh1ic7Ec/D+t1I32dH5luSrX+XPG0sRwiamHFNA0Fod6iXPX+cUlam+kC3G 03n0VtYnARxq/P924AMjYlm2EpWDpYthsTwYs= 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=HS3ERSS4QiqsJA2IulszIi1pYHvi9ag9iJasunA2zCc=; b=aO9Uc/zBLH3akhkCfhr5vFA6JrOk7QhWYk7iccdiyLZYDpE9aYBMhIqFYFpTo9MujS 8KlTjRWST1XpYiUW4CG3ibyAbLI45iR8nIvU/zPvowzC9LYyjHn42ntgOfBq0pULXGYV 888IKWEqorz3FWASYt93/Cl48TQxtLTK55jKRmBstykKDLeiYhFRML93TvyxCK+3CXcz c0qVT5JJlZo9DRlvNjKRgsmbyiFXRWyB7AzKQpZnG90WOdXrbotcjsVxTVbMWT8suptf N0kRSz/JxS9kerxB9bN9mzkz6ABfFBKoNOAs30eVpMVcqtQ0/paETFrZBz7Ru96v56Xv zuaQ== X-Gm-Message-State: AOAM531wZXBA/Vb2q8f+V6aJjtxnyOuZGhURqFib1DLN4xr/4DTdMU9N vEg+RbZkY8WXKqjpyj8k4m+QtXsb0ux1wA== X-Google-Smtp-Source: ABdhPJwzbLNRAqrbZbyWTmGhroQkq/RX7XMgnzV49XHIOwV4gkDo3V4zrwc0C/0yQLZpgQa7Ilmzrg== X-Received: by 2002:a65:4c43:: with SMTP id l3mr20856664pgr.327.1616390005489; Sun, 21 Mar 2021 22:13:25 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id v1sm10933316pgh.17.2021.03.21.22.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 22:13:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Walter Lozano Subject: [PATCH 1/5] dtoc: Show driver warnings once at the end Date: Mon, 22 Mar 2021 18:13:07 +1300 Message-Id: <20210322051311.2904746-2-sjg@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210322051311.2904746-1-sjg@chromium.org> References: <20210322051311.2904746-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean At present warnings are shown as soon as they are discovered in the source scannner. But the function that detects them may be called multiple times. Collect all the warnings and show them at the end. Signed-off-by: Simon Glass --- tools/dtoc/dtb_platdata.py | 6 ++++-- tools/dtoc/src_scan.py | 15 +++++++++------ tools/dtoc/test_dtoc.py | 2 +- tools/dtoc/test_src_scan.py | 38 ++++++++++++++++++------------------- 4 files changed, 33 insertions(+), 28 deletions(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index b5c449ebb47..27e88e75173 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -1186,8 +1186,7 @@ def run_steps(args, dtb_file, include_disabled, output, output_dirs, phase, raise ValueError('Must specify either output or output_dirs, not both') if not scan: - scan = src_scan.Scanner(basedir, warning_disabled, drivers_additional, - phase) + scan = src_scan.Scanner(basedir, drivers_additional, phase) scan.scan_drivers() do_process = True else: @@ -1217,4 +1216,7 @@ def run_steps(args, dtb_file, include_disabled, output, output_dirs, phase, plat.out_header(outfile) outfile.method(plat) plat.finish_output() + + if not warning_disabled: + scan.show_warnings() return plat diff --git a/tools/dtoc/src_scan.py b/tools/dtoc/src_scan.py index 114212cfe2d..2db96884c85 100644 --- a/tools/dtoc/src_scan.py +++ b/tools/dtoc/src_scan.py @@ -188,7 +188,6 @@ class Scanner: key: Driver alias declared with DM_DRIVER_ALIAS(driver_alias, driver_name) value: Driver name declared with U_BOOT_DRIVER(driver_name) - _warning_disabled: true to disable warnings about driver names not found _drivers_additional (list or str): List of additional drivers to use during scanning _of_match: Dict holding information about compatible strings @@ -206,7 +205,7 @@ class Scanner: _phase: The phase of U-Boot that we are generating data for, e.g. 'spl' or 'tpl'. None if not known """ - def __init__(self, basedir, warning_disabled, drivers_additional, phase=''): + def __init__(self, basedir, drivers_additional, phase=''): """Set up a new Scanner """ if not basedir: @@ -217,7 +216,7 @@ class Scanner: self._drivers = {} self._driver_aliases = {} self._drivers_additional = drivers_additional or [] - self._warning_disabled = warning_disabled + self._missing_drivers = set() self._of_match = {} self._compat_to_driver = {} self._uclass = {} @@ -268,9 +267,7 @@ class Scanner: aliases_c.remove(compat_c) return compat_c, aliases_c - if not self._warning_disabled: - print('WARNING: the driver %s was not found in the driver list' - % (compat_list_c[0])) + self._missing_drivers.add(compat_list_c[0]) return compat_list_c[0], compat_list_c[1:] @@ -578,6 +575,12 @@ class Scanner: self._drivers[driver.name] = driver self._of_match.update(of_match) + def show_warnings(self): + """Show any warnings that have been collected""" + for name in sorted(list(self._missing_drivers)): + print('WARNING: the driver %s was not found in the driver list' + % name) + def scan_driver(self, fname): """Scan a driver file to build a list of driver names and aliases diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index 1912a8723f2..62fcab74178 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -104,7 +104,7 @@ def setup(): # Disable warnings so that calls to get_normalized_compat_name() will not # output things. - saved_scan = src_scan.Scanner(None, True, False) + saved_scan = src_scan.Scanner(None, False) saved_scan.scan_drivers() def copy_scan(): diff --git a/tools/dtoc/test_src_scan.py b/tools/dtoc/test_src_scan.py index 0af86dcf0c3..d6da03849f9 100644 --- a/tools/dtoc/test_src_scan.py +++ b/tools/dtoc/test_src_scan.py @@ -48,7 +48,7 @@ class TestSrcScan(unittest.TestCase): def test_simple(self): """Simple test of scanning drivers""" - scan = src_scan.Scanner(None, True, None) + scan = src_scan.Scanner(None, None) scan.scan_drivers() self.assertIn('sandbox_gpio', scan._drivers) self.assertIn('sandbox_gpio_alias', scan._driver_aliases) @@ -59,8 +59,7 @@ class TestSrcScan(unittest.TestCase): def test_additional(self): """Test with additional drivers to scan""" scan = src_scan.Scanner( - None, True, - [None, '', 'tools/dtoc/test/dtoc_test_scan_drivers.cxx']) + None, [None, '', 'tools/dtoc/test/dtoc_test_scan_drivers.cxx']) scan.scan_drivers() self.assertIn('sandbox_gpio_alias2', scan._driver_aliases) self.assertEqual('sandbox_gpio', @@ -77,7 +76,7 @@ class TestSrcScan(unittest.TestCase): with open(driver_fn, 'wb+') as fout: fout.write(b'\x81') - scan = src_scan.Scanner(None, True, [driver_fn]) + scan = src_scan.Scanner(None, [driver_fn]) with test_util.capture_sys_output() as (stdout, _): scan.scan_drivers() self.assertRegex(stdout.getvalue(), @@ -126,7 +125,7 @@ class TestSrcScan(unittest.TestCase): # Mock out scan_driver and check that it is called with the # expected files with mock.patch.object(src_scan.Scanner, "scan_driver") as mocked: - scan = src_scan.Scanner(indir, True, None) + scan = src_scan.Scanner(indir, None) scan.scan_drivers() self.assertEqual(2, len(mocked.mock_calls)) self.assertEqual(mock.call(fname_list[0]), @@ -141,7 +140,7 @@ class TestSrcScan(unittest.TestCase): """Test scanning of a driver""" fname = os.path.join(OUR_PATH, '..', '..', 'drivers/i2c/tegra_i2c.c') buff = tools.ReadFile(fname, False) - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) scan._parse_driver(fname, buff) self.assertIn('i2c_tegra', scan._drivers) drv = scan._drivers['i2c_tegra'] @@ -165,14 +164,15 @@ class TestSrcScan(unittest.TestCase): # get_normalized_compat_name() uses this to check for root node node.parent = FakeNode() - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) with test_util.capture_sys_output() as (stdout, _): name, aliases = scan.get_normalized_compat_name(node) self.assertEqual('rockchip_rk3288_grf', name) self.assertEqual([], aliases) - self.assertEqual( - 'WARNING: the driver rockchip_rk3288_grf was not found in the driver list', - stdout.getvalue().strip()) + self.assertEqual(1, len(scan._missing_drivers)) + self.assertEqual({'rockchip_rk3288_grf'}, scan._missing_drivers) + #'WARNING: the driver rockchip_rk3288_grf was not found in the driver list', + #stdout.getvalue().strip()) i2c = 'I2C_UCLASS' compat = {'rockchip,rk3288-grf': 'ROCKCHIP_SYSCON_GRF', @@ -211,7 +211,7 @@ U_BOOT_DRIVER(i2c_tegra) = { .of_match = tegra_i2c_ids, }; ''' - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) with self.assertRaises(ValueError) as exc: scan._parse_driver('file.c', buff) self.assertIn( @@ -232,7 +232,7 @@ U_BOOT_DRIVER(i2c_tegra) = { .of_match = of_match_ptr(tegra_i2c_ids), }; ''' - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) scan._parse_driver('file.c', buff) self.assertIn('i2c_tegra', scan._drivers) drv = scan._drivers['i2c_tegra'] @@ -261,7 +261,7 @@ U_BOOT_DRIVER(testing) = { DM_HEADER() }; ''' - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) scan._parse_driver('file.c', buff) self.assertIn('testing', scan._drivers) drv = scan._drivers['testing'] @@ -293,7 +293,7 @@ UCLASS_DRIVER(i2c) = { }; ''' - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) scan._parse_uclass_driver('file.c', buff) self.assertIn('UCLASS_I2C', scan._uclass) drv = scan._uclass['UCLASS_I2C'] @@ -325,7 +325,7 @@ UCLASS_DRIVER(i2c) = { }; ''' - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) with self.assertRaises(ValueError) as exc: scan._parse_uclass_driver('file.c', buff) self.assertIn("file.c: Cannot parse uclass ID in driver 'i2c'", @@ -340,7 +340,7 @@ struct some_struct1 { uint nmsgs; }; ''' - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) scan._basedir = os.path.join(OUR_PATH, '..', '..') scan._parse_structs('arch/arm/include/asm/file.h', buff) self.assertIn('some_struct1', scan._structs) @@ -371,7 +371,7 @@ struct another_struct { output = tools.GetOutputFilename('output.h') tools.WriteFile(output, b'struct this is a test \x81 of bad unicode') - scan = src_scan.Scanner(None, False, None) + scan = src_scan.Scanner(None, None) with test_util.capture_sys_output() as (stdout, _): scan.scan_header(output) self.assertIn('due to unicode error', stdout.getvalue()) @@ -411,7 +411,7 @@ U_BOOT_DRIVER(%s) = { .of_match = test_ids, }; ''' % name - scan = src_scan.Scanner(None, False, None, phase) + scan = src_scan.Scanner(None, None, phase) scan._parse_driver('file1.c', driver1) self.assertIn(name, scan._drivers) drv1 = scan._drivers[name] @@ -476,7 +476,7 @@ U_BOOT_DRIVER(%s) = { def test_sequence(self): """Test assignment of sequence numnbers""" - scan = src_scan.Scanner(None, False, None, '') + scan = src_scan.Scanner(None, None, '') node = FakeNode() uc = src_scan.UclassDriver('UCLASS_I2C') node.uclass = uc From patchwork Mon Mar 22 05:13:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1456371 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=oTSNwGZC; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F3jMh0ffYz9sVS for ; Mon, 22 Mar 2021 16:13:52 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 970D382A6C; Mon, 22 Mar 2021 06:13:39 +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="oTSNwGZC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7035982A7F; Mon, 22 Mar 2021 06:13:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) (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 D047A82A68 for ; Mon, 22 Mar 2021 06:13:29 +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-pg1-x534.google.com with SMTP id v2so7855807pgk.11 for ; Sun, 21 Mar 2021 22:13: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=mO5UNIN3eUDBn29GQ8MpQJYZhAXm9XtXl1tYLjXSU9M=; b=oTSNwGZC+va1DcIXA273oL0P+FAyX/uoFRJzMLHclTABbU1dJ2BAyS1xbVQZZ2G2Z0 MsOruWMwuKEmLjD/MPWFXJw8dlwhadROqP6mWKz3uaw5M3gu08wSLEh/LjonhmTZMI0K ca7GlRzlr4H9mPZp5b/6N1xT0S5/xgEvXXNQg= 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=mO5UNIN3eUDBn29GQ8MpQJYZhAXm9XtXl1tYLjXSU9M=; b=P+fb2tGrLGPNOTe0GqzLXzowYrxwljgUIwFsuCoRolxYyy4Ula4L/abEhcM2K9CBQK Ht7FB5roBKFjur0p3HwfZSVNXkwp30cyR/N+9RALk7hRnudN7pT+3z4RjAGJc22kB5Bh tk+hhRx7dW0+VrSHtCxzJWmLSkAJYUxokZpDDBTCbkn3bhzQleys/p3zla9k5gfp8IF3 eyp3VoMfWnUtPoe86oYnMZwsntSm+MQYCUqLxnVTN9bjZ1+7QY0euiMQMTWjXMEaERMx 8gjtp9XQ9f/1UEcDzOX7bHjRywwh/jji+pe/axwksn/N+N/f99TVF/chj2os5LwUPknh 4oeA== X-Gm-Message-State: AOAM530fNv119tj5t5B5uq8pe+YzKdnx0AY8ZYGT0895X4swSXdhlUiF ynm3Et7rhjnBqvpDTsdab8CJ6761mja6Zg== X-Google-Smtp-Source: ABdhPJw/qPdEFoxf8RWlA2Pa5eu/zJ/S0JcLpJqHOhM3rHB31ghuLXL+v1HwkZE2UOHANsYY2+iJhQ== X-Received: by 2002:a63:231d:: with SMTP id j29mr20708287pgj.75.1616390007939; Sun, 21 Mar 2021 22:13:27 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id v1sm10933316pgh.17.2021.03.21.22.13.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 22:13:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , Walter Lozano Subject: [PATCH 2/5] dtoc: Improve handling of reg properties Date: Mon, 22 Mar 2021 18:13:08 +1300 Message-Id: <20210322051311.2904746-3-sjg@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210322051311.2904746-1-sjg@chromium.org> References: <20210322051311.2904746-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean This existing code assumes that a reg property is larger than one cell, but this is not always the case. Fix this assumption. Also if a node's parent is missing the #address-cells and #size-cells properties we use 2 as a default for each. But this should not happen in practice. More likely the properties were removed for SPL due to there being no 'u-boot,dm-pre-reloc' property, or similar. Add a warning for this as the failure can be very confusing. Signed-off-by: Simon Glass --- tools/dtoc/dtb_platdata.py | 14 ++++++++++---- tools/dtoc/test_dtoc.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 27e88e75173..57a45170a26 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -440,6 +440,9 @@ class DtbPlatdata(): Number of size cells for this node """ parent = node.parent + if parent and not parent.props: + raise ValueError("Parent node '%s' has no properties - do you need u-boot,dm-spl or similar?" % + parent.path) num_addr, num_size = 2, 2 if parent: addr_prop = parent.props.get('#address-cells') @@ -467,18 +470,21 @@ class DtbPlatdata(): if reg.type != fdt.Type.INT: raise ValueError("Node '%s' reg property is not an int" % node.name) - if len(reg.value) % total: + reg_val = reg.value + if not isinstance(reg_val, list): + reg_val = [reg_val] + if len(reg_val) % total: raise ValueError( - "Node '%s' reg property has %d cells " + "Node '%s' (parent '%s') reg property has %d cells " 'which is not a multiple of na + ns = %d + %d)' % - (node.name, len(reg.value), num_addr, num_size)) + (node.name, node.parent.name, len(reg_val), num_addr, num_size)) reg.num_addr = num_addr reg.num_size = num_size if num_addr != 1 or num_size != 1: reg.type = fdt.Type.INT64 i = 0 new_value = [] - val = reg.value + val = reg_val if not isinstance(val, list): val = [val] while i < len(val): diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index 62fcab74178..c856ea41681 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -1462,7 +1462,7 @@ U_BOOT_DRVINFO(test3) = { with self.assertRaises(ValueError) as exc: self.run_test(['struct'], dtb_file, output) self.assertIn( - "Node 'spl-test' reg property has 3 cells which is not a multiple of na + ns = 1 + 1)", + "Node 'spl-test' (parent '/') reg property has 3 cells which is not a multiple of na + ns = 1 + 1)", str(exc.exception)) def test_add_prop(self): From patchwork Mon Mar 22 05:13:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1456372 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=eqW+Cf9n; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F3jMw0vrhz9sVS for ; Mon, 22 Mar 2021 16:14:04 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C1D8982A85; Mon, 22 Mar 2021 06:13:42 +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="eqW+Cf9n"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1952D82A6C; Mon, 22 Mar 2021 06:13:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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 181B482A6C for ; Mon, 22 Mar 2021 06:13:32 +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-pl1-x634.google.com with SMTP id w11so5921710ply.6 for ; Sun, 21 Mar 2021 22:13:31 -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=4qzqQsLUPTG8UMNHTRaqaFDr/hfuPgkidLUl+SSFsEQ=; b=eqW+Cf9nn5k83C2T6SJl6B50KMLnVx4ea27yG5Jpbx1Bzj9ojtPZ1ZVMXZPZi1gRbL LbxPQ2ykVMwUxivmQ8R6kPkjZt3oM20YWnu2LhZuVAuJBPot95r50QFEhF+lgUWdq4x1 mj1gy0nrrr0yhOrsmS2ecwuZQBw8lVCIXgH+g= 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=4qzqQsLUPTG8UMNHTRaqaFDr/hfuPgkidLUl+SSFsEQ=; b=N2ofS4nj2J/ZF7nQ/29nKK5xxNMOSdH6udywjIH84KqmkhiOkqrYuV+Qk9SVbK1dPK 87U2ZGysmS5YIqYe68JIj0mkcsqP/gNFf3a/SrOYCyluQLX7mkiK5UbQUlHYwl6rvYPb od/3zniOYONfL3Pkpd2BKRK+TyPuZkHE4HXJ3HcSlQ7T9S75NGFWPKAUN5R5sObn9goL Eouk2uvYplkWXOXDG9ZFHzAuc6CtAgiBMC3rcZKhMUoj1m79zsd2t0yasdhzT9/4eYNy mWcHRv9Vp/fm69G2lszvtkHQQ2R8/VJwP+a9Yo6Qt8gxfMXrLr/5mskEKxNGSJ6J1H+B nkYA== X-Gm-Message-State: AOAM531rbFqEYPN4ou8AwCHSNQ5mg4INNk6GmmykVY4tVTwDvxc16vPP OngPDJHtk7mWg5Dyi+5rZZNHGJ52SlLmIg== X-Google-Smtp-Source: ABdhPJzH0Ybij21DjYe1nPl+nCjwAp4GVrVJKqRqvm7hJUgNs/xUbDO2bf352nhk/DH3TqucJ+J8Jg== X-Received: by 2002:a17:90a:d78e:: with SMTP id z14mr11028198pju.221.1616390010119; Sun, 21 Mar 2021 22:13:30 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id v1sm10933316pgh.17.2021.03.21.22.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 22:13:29 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 3/5] log: Fix up debug_cond() when LOG is enabled Date: Mon, 22 Mar 2021 18:13:09 +1300 Message-Id: <20210322051311.2904746-4-sjg@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210322051311.2904746-1-sjg@chromium.org> References: <20210322051311.2904746-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean At present debug() statements can cause debuf output to appear when LOG is enabled but DEBUG is not. This is not intended and it seems that the condition is wrong. Fix it. Signed-off-by: Simon Glass --- include/log.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/log.h b/include/log.h index ed7ba6d705a..f5288c549b8 100644 --- a/include/log.h +++ b/include/log.h @@ -234,11 +234,14 @@ int _log_buffer(enum log_category_t cat, enum log_level_t level, #define _SPL_BUILD 0 #endif -#if !_DEBUG && CONFIG_IS_ENABLED(LOG) +#if CONFIG_IS_ENABLED(LOG) -#define debug_cond(cond, fmt, args...) \ -({ \ - log(LOG_CATEGORY, LOGL_DEBUG, fmt, ##args); \ +#define debug_cond(cond, fmt, args...) \ +({ \ + if (cond) \ + log(LOG_CATEGORY, \ + (enum log_level_t)(LOGL_FORCE_DEBUG | _LOG_DEBUG), \ + fmt, ##args); \ }) #else /* _DEBUG */ From patchwork Mon Mar 22 05:13:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1456373 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hwipkvt/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F3jN86NPVz9sVS for ; Mon, 22 Mar 2021 16:14:16 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B690D82A8C; Mon, 22 Mar 2021 06:13:47 +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="hwipkvt/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 980E482A77; Mon, 22 Mar 2021 06:13:38 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) (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 5FE8582A74 for ; Mon, 22 Mar 2021 06:13:34 +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-pl1-x636.google.com with SMTP id w11so5921753ply.6 for ; Sun, 21 Mar 2021 22:13:34 -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=mXO9CrqrdjezH97DJhsa3P7ZsOOOD1SWjtXmlxCNDT8=; b=hwipkvt/TmAzdugpsD+jFZovPsZVIWno0qOJNuYvW0IwjA3nZM5L7UfdHdkNiEp+3F mm8qXQJPK5s5JeughEeE6stObsaBytS32e6qLV1R5j+2Sgb0AehUGGFFWeWwU3quavd1 1+cbPnjUGtJJsNFCq4e9iAri/r02bXFHkKENw= 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=mXO9CrqrdjezH97DJhsa3P7ZsOOOD1SWjtXmlxCNDT8=; b=E0diTOnmjHaQHqX2pvwvdvvz0m/5Tfi3RLNxHeN3gyKGI3H+dngFBLNaCSMM+qwqRQ LavBVs4goTtiR6VQVbXokqlWl9Nrg5dqdArh0tK0VGbvI7JABxmM9TKUPaUrPGkEE/ZR NUAsYv1o0OV+iLb1cm5FpiaTEdz+XwkRzFngD390CEmQ2blokXjQ4kSDtSx109Kmvdjf 2QvdZ+70KNF5LK52ejzztjoVIFZ3jwg0Bwh2YDJ7mCu6mOrQjBrfxwa5tSNj4eJXQVx+ bJahFfZn1aUE5+p4zASbl72seZOh24p8KuC+XxpLuQBF/Af9CLFegWgYnUZUxiRvt3ia i5Fg== X-Gm-Message-State: AOAM531H25pAI3I2M60iWUkfbQHBuWT3MP01angq47c9+XZCAOSTAj+m PXXko8zE+mUodb5ro6Jd585FWQinGoj/Aw== X-Google-Smtp-Source: ABdhPJz1S5IkITap1cpsGmBFM0x7yZOVLhQ7X4/N0vwDD55161QyeacF3XA71Q6RFx22RpPjKfrLCw== X-Received: by 2002:a17:90a:c918:: with SMTP id v24mr11487947pjt.182.1616390012656; Sun, 21 Mar 2021 22:13:32 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id v1sm10933316pgh.17.2021.03.21.22.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 22:13:32 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass Subject: [PATCH 4/5] moveconfig: Handle binary files cleanly Date: Mon, 22 Mar 2021 18:13:10 +1300 Message-Id: <20210322051311.2904746-5-sjg@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210322051311.2904746-1-sjg@chromium.org> References: <20210322051311.2904746-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean Some files are not actually source code and thus can produce unicode errors. Report this and continue. Signed-off-by: Simon Glass --- tools/moveconfig.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index 9514d9a00cb..1ac30c00281 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -12,6 +12,10 @@ config options from headers to Kconfig (defconfig). This tool intends to help this tremendous work. +Installing +---------- + +You may need to install 'python3-asteval' for the 'asteval' module. Usage ----- @@ -573,7 +577,11 @@ def cleanup_empty_blocks(header_path, options): """ pattern = re.compile(r'^\s*#\s*if.*$\n^\s*#\s*endif.*$\n*', flags=re.M) with open(header_path) as f: - data = f.read() + try: + data = f.read() + except UnicodeDecodeError as e: + print("Failed on file %s': %s" % (header_path, e)) + return new_data = pattern.sub('\n', data) @@ -596,7 +604,11 @@ def cleanup_one_header(header_path, patterns, options): options: option flags. """ with open(header_path) as f: - lines = f.readlines() + try: + lines = f.readlines() + except UnicodeDecodeError as e: + print("Failed on file %s': %s" % (header_path, e)) + return matched = [] for i, line in enumerate(lines): From patchwork Mon Mar 22 05:13:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1456374 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=RUe41XwF; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4F3jNN0fGVz9sVS for ; Mon, 22 Mar 2021 16:14:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6E5B282A7F; Mon, 22 Mar 2021 06:13:50 +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="RUe41XwF"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 57BD582A8D; Mon, 22 Mar 2021 06:13:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (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 B230D82A7A for ; Mon, 22 Mar 2021 06:13:40 +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-pg1-x52a.google.com with SMTP id v186so7856840pgv.7 for ; Sun, 21 Mar 2021 22:13: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=20Q4S+xNj+PtwmPXILjHd+MU2sEtSDp87squ/hsoejI=; b=RUe41XwFdom1TxaKX5mx8JEMzYeWLcIhhdqhCGAjlAm1co/LArYtRfR1BJJlPlFxwe dMNHM2STPRG0NE/oeaHZR9h7DG0aDJaoRZ2ZwMm4pz5Fu70Acvj4Vc0pavcpBWRVjonN UF4n+nxqReyCKGZfbW1h3bgRbERxOS2UMpiKE= 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=20Q4S+xNj+PtwmPXILjHd+MU2sEtSDp87squ/hsoejI=; b=GUtKhnMWnq+7Fl+//JpTANDACtfpP0VqxFwT0bLVo652+7+Kgk9I01X6TGTxsaV45u fInEV6FykEtDd9lndTPvNL2G2DzTCtX3CN4C8SepAvF1QYewvihZWfxpH+22NFeAracp GSPY+5QCAgYnRn27eMyk/t277TyI6fpKmoS9J81Ln4G2r4MCHiMmVfwKamNzAHZwhT/B Z7sYM338mbqEmB92LvaZuFrljN5W1PlJ9sZf18p/VyQgprt6C9TlW1Qn0bpZhO2Ez3Nl Omb8C3hjJEXR4mQaykPBwV3r8y7+XZRcwRHzq+o8t8UlkDmtXwm9lgDdciEa78chsir7 bttQ== X-Gm-Message-State: AOAM532x7cSidWVURwdlWVZTEs7o1BfQnnUEjAwZP+CPnuu8HcqADogr KZBwWNtdpvrzXppxiOyI/JuBuAyKAvjdIg== X-Google-Smtp-Source: ABdhPJwaRlHkxiRHb+R37YfKasHaRdAkcgxcjhy1tW/ueMCe/mRnWTj4MAgnwuX8fbhnDN4056jNzA== X-Received: by 2002:a63:4848:: with SMTP id x8mr20731266pgk.447.1616390018553; Sun, 21 Mar 2021 22:13:38 -0700 (PDT) Received: from sjg1.roam.corp.google.com (85.72.69.111.dynamic.snap.net.nz. [111.69.72.85]) by smtp.gmail.com with ESMTPSA id v1sm10933316pgh.17.2021.03.21.22.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Mar 2021 22:13:38 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Simon Glass , AKASHI Takahiro , Adam Ford , Ashok Reddy Soma , Heinrich Schuchardt , Igor Opaniuk , Marek Vasut , Mario Six , Michal Simek , Ovidiu Panait , Patrick Delaunay , Stefan Roese , Usama Arif , Valentin Longchamp Subject: [PATCH 5/5] Convert CONFIG_MISC_INIT_F to Kconfig Date: Mon, 22 Mar 2021 18:13:11 +1300 Message-Id: <20210322051311.2904746-6-sjg@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210322051311.2904746-1-sjg@chromium.org> References: <20210322051311.2904746-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.102.4 at phobos.denx.de X-Virus-Status: Clean This converts the following to Kconfig: CONFIG_MISC_INIT_F Signed-off-by: Simon Glass Reviewed-by: Stefan Roese --- common/Kconfig | 6 ++++++ configs/MPC8349ITXGP_defconfig | 1 + configs/MPC8349ITX_LOWBOOT_defconfig | 1 + configs/MPC8349ITX_defconfig | 1 + configs/kmcoge4_defconfig | 1 + configs/sandbox64_defconfig | 2 +- configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 2 +- configs/sandbox_spl_defconfig | 2 ++ configs/tools-only_defconfig | 1 + include/configs/MPC8349ITX.h | 2 -- include/configs/kmp204x.h | 2 -- include/configs/sandbox.h | 2 -- scripts/config_whitelist.txt | 1 - 14 files changed, 16 insertions(+), 9 deletions(-) diff --git a/common/Kconfig b/common/Kconfig index 482f1235347..0e36dfd2368 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -527,6 +527,12 @@ config LAST_STAGE_INIT U-Boot calls last_stage_init() before the command-line interpreter is started. +config MISC_INIT_F + bool "Execute pre-relocation misc init" + help + Enabling this option calls the 'misc_init_f' function in the init + sequence just before DRAM is inited. + config MISC_INIT_R bool "Execute Misc Init" default y if ARCH_KEYSTONE || ARCH_SUNXI || MPC85xx diff --git a/configs/MPC8349ITXGP_defconfig b/configs/MPC8349ITXGP_defconfig index 28e4ebf06f5..92f2093bb65 100644 --- a/configs/MPC8349ITXGP_defconfig +++ b/configs/MPC8349ITXGP_defconfig @@ -154,6 +154,7 @@ CONFIG_SYS_EXTRA_OPTIONS="SYS_TEXT_BASE=0xFE000000" CONFIG_BOOTDELAY=6 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=::::mpc8349emitxgp:eth0:off console=ttyS0,115200" +CONFIG_MISC_INIT_F=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="MPC8349E-mITX-GP> " diff --git a/configs/MPC8349ITX_LOWBOOT_defconfig b/configs/MPC8349ITX_LOWBOOT_defconfig index 46f7afc071f..cf1e90d6190 100644 --- a/configs/MPC8349ITX_LOWBOOT_defconfig +++ b/configs/MPC8349ITX_LOWBOOT_defconfig @@ -153,6 +153,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_BOOTDELAY=6 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=::::mpc8349emitx:eth0:off console=ttyS0,115200" +CONFIG_MISC_INIT_F=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="MPC8349E-mITX> " diff --git a/configs/MPC8349ITX_defconfig b/configs/MPC8349ITX_defconfig index 1f70b756b0c..733e5d35996 100644 --- a/configs/MPC8349ITX_defconfig +++ b/configs/MPC8349ITX_defconfig @@ -152,6 +152,7 @@ CONFIG_OF_STDOUT_VIA_ALIAS=y CONFIG_BOOTDELAY=6 CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="root=/dev/nfs rw nfsroot=:/nfsroot/rootfs ip=::::mpc8349emitx:eth0:off console=ttyS0,115200" +CONFIG_MISC_INIT_F=y CONFIG_MISC_INIT_R=y CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="MPC8349E-mITX> " diff --git a/configs/kmcoge4_defconfig b/configs/kmcoge4_defconfig index ddc8f8a7f98..462e5677964 100644 --- a/configs/kmcoge4_defconfig +++ b/configs/kmcoge4_defconfig @@ -20,6 +20,7 @@ CONFIG_AUTOBOOT_STOP_STR=" " CONFIG_BOARD_EARLY_INIT_F=y CONFIG_BOARD_EARLY_INIT_R=y CONFIG_LAST_STAGE_INIT=y +CONFIG_MISC_INIT_F=y CONFIG_HUSH_PARSER=y CONFIG_CMD_ASKENV=y CONFIG_CMD_GREPENV=y diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig index cfda83474b6..4648808d516 100644 --- a/configs/sandbox64_defconfig +++ b/configs/sandbox64_defconfig @@ -20,8 +20,8 @@ CONFIG_BOOTSTAGE_STASH_SIZE=0x4096 CONFIG_CONSOLE_RECORD=y CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 CONFIG_PRE_CONSOLE_BUFFER=y -CONFIG_LOG_SYSLOG=y CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_MISC_INIT_F=y CONFIG_CMD_CPU=y CONFIG_CMD_LICENSE=y CONFIG_CMD_BOOTZ=y diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 713708e01c2..c9515a44783 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -25,6 +25,7 @@ CONFIG_LOG=y CONFIG_LOG_SYSLOG=y CONFIG_LOG_ERROR_RETURN=y CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_MISC_INIT_F=y CONFIG_ANDROID_AB=y CONFIG_CMD_CPU=y CONFIG_CMD_LICENSE=y diff --git a/configs/sandbox_flattree_defconfig b/configs/sandbox_flattree_defconfig index 4401f33f0ba..b68f938cb37 100644 --- a/configs/sandbox_flattree_defconfig +++ b/configs/sandbox_flattree_defconfig @@ -17,8 +17,8 @@ CONFIG_BOOTSTAGE_STASH=y CONFIG_BOOTSTAGE_STASH_SIZE=0x4096 CONFIG_CONSOLE_RECORD=y CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 -CONFIG_LOG_SYSLOG=y CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_MISC_INIT_F=y CONFIG_CMD_CPU=y CONFIG_CMD_LICENSE=y CONFIG_CMD_BOOTZ=y diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig index ac71cab5f1e..0e40b17c624 100644 --- a/configs/sandbox_spl_defconfig +++ b/configs/sandbox_spl_defconfig @@ -11,6 +11,7 @@ CONFIG_SPL_SYS_MALLOC_F_LEN=0x8000 CONFIG_SPL=y CONFIG_BOOTSTAGE_STASH_ADDR=0x0 CONFIG_DEFAULT_DEVICE_TREE="sandbox" +CONFIG_TARGET_SANDBOX_SPL=y CONFIG_SANDBOX_SPL=y CONFIG_DEBUG_UART=y CONFIG_DISTRO_DEFAULTS=y @@ -27,6 +28,7 @@ CONFIG_BOOTSTAGE_STASH_SIZE=0x4096 CONFIG_CONSOLE_RECORD=y CONFIG_CONSOLE_RECORD_OUT_SIZE=0x1000 CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_MISC_INIT_F=y CONFIG_HANDOFF=y CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_ENV_SUPPORT=y diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig index a853abf2b8f..e16f702f00a 100644 --- a/configs/tools-only_defconfig +++ b/configs/tools-only_defconfig @@ -4,6 +4,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sandbox" CONFIG_ANDROID_BOOT_IMAGE=y CONFIG_FIT=y CONFIG_FIT_SIGNATURE=y +CONFIG_MISC_INIT_F=y # CONFIG_CMD_BOOTD is not set # CONFIG_CMD_BOOTM is not set # CONFIG_CMD_ELF is not set diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h index f50cdd717cb..586c1e9ae84 100644 --- a/include/configs/MPC8349ITX.h +++ b/include/configs/MPC8349ITX.h @@ -39,8 +39,6 @@ #ifndef __CONFIG_H #define __CONFIG_H -#define CONFIG_MISC_INIT_F - /* * On-board devices */ diff --git a/include/configs/kmp204x.h b/include/configs/kmp204x.h index 90e3702bd80..af3b03be490 100644 --- a/include/configs/kmp204x.h +++ b/include/configs/kmp204x.h @@ -177,8 +177,6 @@ unsigned long get_board_sys_clk(unsigned long dummy); #define CONFIG_SYS_BR1_PRELIM CONFIG_SYS_QRIO_BR_PRELIM /* QRIO Base Address */ #define CONFIG_SYS_OR1_PRELIM CONFIG_SYS_QRIO_OR_PRELIM /* QRIO Options */ -#define CONFIG_MISC_INIT_F - #define CONFIG_HWCONFIG /* define to use L1 as initial stack */ diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index e0708fe5739..bbb7d12ad14 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -130,6 +130,4 @@ #define CONFIG_SYS_SATA_MAX_DEVICE 2 -#define CONFIG_MISC_INIT_F - #endif diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 85857a746ca..b693925d20a 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -1030,7 +1030,6 @@ CONFIG_MIPS_HUGE_TLB_SUPPORT CONFIG_MIPS_MT_FPAFF CONFIG_MIRQ_EN CONFIG_MISC_COMMON -CONFIG_MISC_INIT_F CONFIG_MIU_1BIT_INTERLEAVED CONFIG_MIU_2BIT_21_7_INTERLEAVED CONFIG_MIU_2BIT_INTERLEAVED