From patchwork Thu Jul 23 03:22:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lozano X-Patchwork-Id: 1334370 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=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; dmarc=fail (p=none dis=none) header.from=collabora.com 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) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BByM201n5z9sQt for ; Thu, 23 Jul 2020 13:22:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C345981F24; Thu, 23 Jul 2020 05:22:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2778881EBE; Thu, 23 Jul 2020 05:22:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 15CCD81C17 for ; Thu, 23 Jul 2020 05:22:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=walter.lozano@collabora.com Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: wlozano) with ESMTPSA id 69C8C297A3E From: Walter Lozano To: u-boot@lists.denx.de, Simon Glass Cc: Walter Lozano , Heinrich Schuchardt Subject: [PATCH v2 1/3] dtoc: look for compatible string aliases in driver list Date: Thu, 23 Jul 2020 00:22:03 -0300 Message-Id: <20200723032205.29856-2-walter.lozano@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200723032205.29856-1-walter.lozano@collabora.com> References: <20200723032205.29856-1-walter.lozano@collabora.com> 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.3 at phobos.denx.de X-Virus-Status: Clean Currently dtoc checks if the first compatible string in a dtb node matches either a driver o driver alias name, without taking into account any other compatible string in the list. In the case that no driver matches the first compatible string a warning is printed and the U_BOOT_DEVICE is not being declared correctly. This patch adds dtoc's support for try all the compatible strings in the dtb node, in an effort to find the correct driver. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 45 ++++++++++++++++---------------- tools/dtoc/dtoc_test_aliases.dts | 5 ++++ tools/dtoc/test_dtoc.py | 20 +++++++++++--- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index c148c49625..b1b082e508 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -111,21 +111,17 @@ def get_value(ftype, value): return '%#x' % value def get_compat_name(node): - """Get a node's first compatible string as a C identifier + """Get the node's list of compatible string as a C identifiers Args: node: Node object to check Return: - Tuple: - C identifier for the first compatible string - List of C identifiers for all the other compatible strings - (possibly empty) + List of C identifiers for all the compatible strings """ compat = node.props['compatible'].value - aliases = [] - if isinstance(compat, list): - compat, aliases = compat[0], compat[1:] - return conv_name_to_c(compat), [conv_name_to_c(a) for a in aliases] + if not isinstance(compat, list): + compat = [compat] + return [conv_name_to_c(c) for c in compat] class DtbPlatdata(object): @@ -169,7 +165,7 @@ class DtbPlatdata(object): def get_normalized_compat_name(self, node): """Get a node's normalized compat name - Returns a valid driver name by retrieving node's first compatible + Returns a valid driver name by retrieving node's list of compatible string as a C identifier and performing a check against _drivers and a lookup in driver_aliases printing a warning in case of failure. @@ -183,19 +179,24 @@ class DtbPlatdata(object): In case of no match found, the return will be the same as get_compat_name() """ - compat_c, aliases_c = get_compat_name(node) - if compat_c not in self._drivers: - compat_c_old = compat_c - compat_c = self._driver_aliases.get(compat_c) - if not compat_c: - if not self._warning_disabled: - print('WARNING: the driver %s was not found in the driver list' - % (compat_c_old)) - compat_c = compat_c_old - else: - aliases_c = [compat_c_old] + aliases_c + compat_list_c = get_compat_name(node) + + for compat_c in compat_list_c: + if not compat_c in self._drivers: + compat_c = self._driver_aliases.get(compat_c) + if not compat_c: + continue + + aliases_c = compat_list_c + if compat_c in aliases_c: + 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])) - return compat_c, aliases_c + return compat_list_c[0], compat_list_c[1:] def setup_output(self, fname): """Set up the output destination diff --git a/tools/dtoc/dtoc_test_aliases.dts b/tools/dtoc/dtoc_test_aliases.dts index e545816f4e..ae33716863 100644 --- a/tools/dtoc/dtoc_test_aliases.dts +++ b/tools/dtoc/dtoc_test_aliases.dts @@ -14,4 +14,9 @@ intval = <1>; }; + spl-test2 { + u-boot,dm-pre-reloc; + compatible = "compat1", "simple_bus"; + intval = <1>; + }; }; diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index 3c8e343b1f..edb3912e94 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -144,18 +144,18 @@ class TestDtoc(unittest.TestCase): prop = Prop(['rockchip,rk3399-sdhci-5.1', 'arasan,sdhci-5.1']) node = Node({'compatible': prop}) - self.assertEqual(('rockchip_rk3399_sdhci_5_1', ['arasan_sdhci_5_1']), + self.assertEqual((['rockchip_rk3399_sdhci_5_1', 'arasan_sdhci_5_1']), get_compat_name(node)) prop = Prop(['rockchip,rk3399-sdhci-5.1']) node = Node({'compatible': prop}) - self.assertEqual(('rockchip_rk3399_sdhci_5_1', []), + self.assertEqual((['rockchip_rk3399_sdhci_5_1']), get_compat_name(node)) prop = Prop(['rockchip,rk3399-sdhci-5.1', 'arasan,sdhci-5.1', 'third']) node = Node({'compatible': prop}) - self.assertEqual(('rockchip_rk3399_sdhci_5_1', - ['arasan_sdhci_5_1', 'third']), + self.assertEqual((['rockchip_rk3399_sdhci_5_1', + 'arasan_sdhci_5_1', 'third']), get_compat_name(node)) def test_empty_file(self): @@ -566,6 +566,9 @@ void dm_populate_phandle_data(void) { struct dtd_compat1 { \tfdt32_t\t\tintval; }; +struct dtd_simple_bus { +\tfdt32_t\t\tintval; +}; #define dtd_compat2_1_fred dtd_compat1 #define dtd_compat3 dtd_compat1 ''', data) @@ -583,6 +586,15 @@ U_BOOT_DEVICE(spl_test) = { \t.platdata_size\t= sizeof(dtv_spl_test), }; +static struct dtd_simple_bus dtv_spl_test2 = { +\t.intval\t\t\t= 0x1, +}; +U_BOOT_DEVICE(spl_test2) = { +\t.name\t\t= "simple_bus", +\t.platdata\t= &dtv_spl_test2, +\t.platdata_size\t= sizeof(dtv_spl_test2), +}; + ''' + C_EMPTY_POPULATE_PHANDLE_DATA, data) def test_addresses64(self): From patchwork Thu Jul 23 03:22:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lozano X-Patchwork-Id: 1334371 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=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; dmarc=fail (p=none dis=none) header.from=collabora.com 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 4BByM96fByz9sQt for ; Thu, 23 Jul 2020 13:22:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 53BB481F1B; Thu, 23 Jul 2020 05:22:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E19CB81EBE; Thu, 23 Jul 2020 05:22:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EE74981E3C for ; Thu, 23 Jul 2020 05:22:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=walter.lozano@collabora.com Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: wlozano) with ESMTPSA id 945772975EB From: Walter Lozano To: u-boot@lists.denx.de, Simon Glass Cc: Walter Lozano , Bin Meng , Jagan Teki , Lukasz Majewski , Peng Fan Subject: [PATCH v2 2/3] drivers: avoid using aliases on drivers when OF_PLATDATA is enabled Date: Thu, 23 Jul 2020 00:22:04 -0300 Message-Id: <20200723032205.29856-3-walter.lozano@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200723032205.29856-1-walter.lozano@collabora.com> References: <20200723032205.29856-1-walter.lozano@collabora.com> 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.3 at phobos.denx.de X-Virus-Status: Clean After latest improvements on OF_PLATDATA struct names are generated based on driver name instead of compatible strings. With this in mind, using aliases in drivers are not longer needed. This patch removes code that tried to handle these kind of aliases to improve readability. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- Changes in v2: - Remove aliases from drivers drivers/gpio/mxs_gpio.c | 10 ++-------- drivers/mmc/mxsmmc.c | 10 ++-------- drivers/spi/mxs_spi.c | 10 ++-------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c index cb797261b7..b30adf50da 100644 --- a/drivers/gpio/mxs_gpio.c +++ b/drivers/gpio/mxs_gpio.c @@ -138,12 +138,6 @@ int name_to_gpio(const char *name) #include #define MXS_MAX_GPIO_PER_BANK 32 -#ifdef CONFIG_MX28 -#define dtd_fsl_imx_gpio dtd_fsl_imx28_gpio -#else /* CONFIG_MX23 */ -#define dtd_fsl_imx_gpio dtd_fsl_imx23_gpio -#endif - DECLARE_GLOBAL_DATA_PTR; /* * According to i.MX28 Reference Manual: @@ -158,7 +152,7 @@ DECLARE_GLOBAL_DATA_PTR; struct mxs_gpio_platdata { #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_fsl_imx_gpio dtplat; + struct dtd_fsl_imx23_gpio dtplat; #endif unsigned int bank; int gpio_ranges; @@ -247,7 +241,7 @@ static int mxs_gpio_probe(struct udevice *dev) char name[16], *str; #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_fsl_imx_gpio *dtplat = &plat->dtplat; + struct dtd_fsl_imx23_gpio *dtplat = &plat->dtplat; priv->bank = (unsigned int)dtplat->reg[0]; uc_priv->gpio_count = dtplat->gpio_ranges[3]; #else diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c index c6a06b9ca8..c368271c23 100644 --- a/drivers/mmc/mxsmmc.c +++ b/drivers/mmc/mxsmmc.c @@ -52,15 +52,9 @@ struct mxsmmc_priv { #include #include -#ifdef CONFIG_MX28 -#define dtd_fsl_imx_mmc dtd_fsl_imx28_mmc -#else /* CONFIG_MX23 */ -#define dtd_fsl_imx_mmc dtd_fsl_imx23_mmc -#endif - struct mxsmmc_platdata { #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_fsl_imx_mmc dtplat; + struct dtd_fsl_imx23_mmc dtplat; #endif struct mmc_config cfg; struct mmc mmc; @@ -581,7 +575,7 @@ static int mxsmmc_probe(struct udevice *dev) debug("%s: probe\n", __func__); #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_fsl_imx_mmc *dtplat = &plat->dtplat; + struct dtd_fsl_imx23_mmc *dtplat = &plat->dtplat; struct phandle_1_arg *p1a = &dtplat->clocks[0]; priv->buswidth = dtplat->bus_width; diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c index 3c1af839c0..fb0af02be0 100644 --- a/drivers/spi/mxs_spi.c +++ b/drivers/spi/mxs_spi.c @@ -41,15 +41,9 @@ #define MXS_SSP_IMX23_CLKID_SSP0 33 #define MXS_SSP_IMX28_CLKID_SSP0 46 -#ifdef CONFIG_MX28 -#define dtd_fsl_imx_spi dtd_fsl_imx28_spi -#else /* CONFIG_MX23 */ -#define dtd_fsl_imx_spi dtd_fsl_imx23_spi -#endif - struct mxs_spi_platdata { #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_fsl_imx_spi dtplat; + struct dtd_fsl_imx23_spi dtplat; #endif s32 frequency; /* Default clock frequency, -1 for none */ fdt_addr_t base; /* SPI IP block base address */ @@ -324,7 +318,7 @@ static int mxs_spi_probe(struct udevice *bus) debug("%s: probe\n", __func__); #if CONFIG_IS_ENABLED(OF_PLATDATA) - struct dtd_fsl_imx_spi *dtplat = &plat->dtplat; + struct dtd_fsl_imx23_spi *dtplat = &plat->dtplat; struct phandle_1_arg *p1a = &dtplat->clocks[0]; priv->regs = (struct mxs_ssp_regs *)dtplat->reg[0]; From patchwork Thu Jul 23 03:22:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Walter Lozano X-Patchwork-Id: 1334372 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=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; dmarc=fail (p=none dis=none) header.from=collabora.com 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 4BByMN1c7Zz9sQt for ; Thu, 23 Jul 2020 13:22:55 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 099C081CE2; Thu, 23 Jul 2020 05:22:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 87F7681F1B; Thu, 23 Jul 2020 05:22:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F1F681C17 for ; Thu, 23 Jul 2020 05:22:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=walter.lozano@collabora.com Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: wlozano) with ESMTPSA id 6DD10297A3E From: Walter Lozano To: u-boot@lists.denx.de, Simon Glass Cc: Walter Lozano , Heinrich Schuchardt Subject: [PATCH v2 3/3] dtoc: remove compatible string aliases support Date: Thu, 23 Jul 2020 00:22:05 -0300 Message-Id: <20200723032205.29856-4-walter.lozano@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200723032205.29856-1-walter.lozano@collabora.com> References: <20200723032205.29856-1-walter.lozano@collabora.com> 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.3 at phobos.denx.de X-Virus-Status: Clean After latest improvements in dtoc, compatible strings are checked against driver and driver alias list to get a valid driver name. With this new feature the list of compatible string aliases seems not useful any more. Signed-off-by: Walter Lozano Reviewed-by: Simon Glass Reviewed-by: Simon Glass --- (no changes since v1) tools/dtoc/dtb_platdata.py | 13 ------------ tools/dtoc/test_dtoc.py | 43 -------------------------------------- 2 files changed, 56 deletions(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index b1b082e508..c28768f4a2 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -139,9 +139,6 @@ class DtbPlatdata(object): _outfile: The current output file (sys.stdout or a real file) _warning_disabled: true to disable warnings about driver names not found _lines: Stashed list of output lines for outputting in the future - _aliases: Dict that hold aliases for compatible strings - key: First compatible string declared in a node - value: List of additional compatible strings declared in a node _drivers: List of valid driver names found in drivers/ _driver_aliases: Dict that holds aliases for driver names key: Driver alias declared with @@ -157,7 +154,6 @@ class DtbPlatdata(object): self._outfile = None self._warning_disabled = warning_disabled self._lines = [] - self._aliases = {} self._drivers = [] self._driver_aliases = {} self._links = [] @@ -483,10 +479,6 @@ class DtbPlatdata(object): prop.Widen(struct[name]) upto += 1 - struct_name, aliases = self.get_normalized_compat_name(node) - for alias in aliases: - self._aliases[alias] = struct_name - return structs def scan_phandles(self): @@ -549,11 +541,6 @@ class DtbPlatdata(object): self.out(';\n') self.out('};\n') - for alias, struct_name in self._aliases.items(): - if alias not in sorted(structs): - self.out('#define %s%s %s%s\n'% (STRUCT_PREFIX, alias, - STRUCT_PREFIX, struct_name)) - def output_node(self, node): """Output the C code for a node diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index edb3912e94..169ecd6e6e 100755 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -290,7 +290,6 @@ struct dtd_sandbox_gpio { \tbool\t\tgpio_controller; \tfdt32_t\t\tsandbox_gpio_count; }; -#define dtd_sandbox_gpio_alias dtd_sandbox_gpio ''', data) self.run_test(['platdata'], dtb_file, output) @@ -555,48 +554,6 @@ void dm_populate_phandle_data(void) { self.assertIn("Node 'phandle-target' has no cells property", str(e.exception)) - def test_aliases(self): - """Test output from a node with multiple compatible strings""" - dtb_file = get_dtb_file('dtoc_test_aliases.dts') - output = tools.GetOutputFilename('output') - self.run_test(['struct'], dtb_file, output) - with open(output) as infile: - data = infile.read() - self._CheckStrings(HEADER + ''' -struct dtd_compat1 { -\tfdt32_t\t\tintval; -}; -struct dtd_simple_bus { -\tfdt32_t\t\tintval; -}; -#define dtd_compat2_1_fred dtd_compat1 -#define dtd_compat3 dtd_compat1 -''', data) - - self.run_test(['platdata'], dtb_file, output) - with open(output) as infile: - data = infile.read() - self._CheckStrings(C_HEADER + ''' -static struct dtd_compat1 dtv_spl_test = { -\t.intval\t\t\t= 0x1, -}; -U_BOOT_DEVICE(spl_test) = { -\t.name\t\t= "compat1", -\t.platdata\t= &dtv_spl_test, -\t.platdata_size\t= sizeof(dtv_spl_test), -}; - -static struct dtd_simple_bus dtv_spl_test2 = { -\t.intval\t\t\t= 0x1, -}; -U_BOOT_DEVICE(spl_test2) = { -\t.name\t\t= "simple_bus", -\t.platdata\t= &dtv_spl_test2, -\t.platdata_size\t= sizeof(dtv_spl_test2), -}; - -''' + C_EMPTY_POPULATE_PHANDLE_DATA, data) - def test_addresses64(self): """Test output from a node with a 'reg' property with na=2, ns=2""" dtb_file = get_dtb_file('dtoc_test_addr64.dts')