U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 08/20] dm: test: Drop of-platdata pytest
Date: Sat,  3 Oct 2020 11:31:30 -0600	[thread overview]
Message-ID: <20201003173142.3213123-9-sjg@chromium.org> (raw)
In-Reply-To: <20201003173142.3213123-1-sjg@chromium.org>

Now that we have a C version of this test, drop the Python implementation.

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

 arch/sandbox/cpu/spl.c           | 12 --------
 arch/sandbox/cpu/start.c         |  9 ------
 arch/sandbox/include/asm/state.h |  1 -
 drivers/misc/spltest_sandbox.c   | 35 ------------------------
 test/py/tests/test_ofplatdata.py | 47 --------------------------------
 5 files changed, 104 deletions(-)

diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index 81b217a1d70..9a77da15619 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -54,20 +54,8 @@ SPL_LOAD_IMAGE_METHOD("sandbox", 9, BOOT_DEVICE_BOARD, spl_board_load_image);
 void spl_board_init(void)
 {
 	struct sandbox_state *state = state_get_current();
-	struct udevice *dev;
 
 	preloader_console_init();
-	if (state->show_of_platdata) {
-		/*
-		 * Scan all the devices so that we can output their platform
-		 * data. See sandbox_spl_probe().
-		 */
-		printf("Scanning misc devices\n");
-		for (uclass_first_device(UCLASS_MISC, &dev);
-		     dev;
-		     uclass_next_device(&dev))
-			;
-	}
 
 	if (state->run_unittests) {
 		int ret;
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 569dafbcfee..58ada13fba5 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -365,15 +365,6 @@ static int sandbox_cmdline_cb_log_level(struct sandbox_state *state,
 SANDBOX_CMDLINE_OPT_SHORT(log_level, 'L', 1,
 			  "Set log level (0=panic, 7=debug)");
 
-static int sandbox_cmdline_cb_show_of_platdata(struct sandbox_state *state,
-					       const char *arg)
-{
-	state->show_of_platdata = true;
-
-	return 0;
-}
-SANDBOX_CMDLINE_OPT(show_of_platdata, 0, "Show of-platdata in SPL");
-
 static int sandbox_cmdline_cb_unittests(struct sandbox_state *state,
 					const char *arg)
 {
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 7547602dd1c..bca13069824 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -90,7 +90,6 @@ struct sandbox_state {
 	bool skip_delays;		/* Ignore any time delays (for test) */
 	bool show_test_output;		/* Don't suppress stdout in tests */
 	int default_log_level;		/* Default log level for sandbox */
-	bool show_of_platdata;		/* Show of-platdata in SPL */
 	bool ram_buf_read;		/* true if we read the RAM buffer */
 	bool run_unittests;		/* Run unit tests */
 	const char *select_unittests;	/* Unit test to run */
diff --git a/drivers/misc/spltest_sandbox.c b/drivers/misc/spltest_sandbox.c
index 999031625b5..3ae6707593e 100644
--- a/drivers/misc/spltest_sandbox.c
+++ b/drivers/misc/spltest_sandbox.c
@@ -8,43 +8,8 @@
 #include <dm.h>
 #include <dt-structs.h>
 
-static int sandbox_spl_probe(struct udevice *dev)
-{
-	struct dtd_sandbox_spl_test *plat = dev_get_platdata(dev);
-	int i;
-
-	printf("of-platdata probe:\n");
-	printf("bool %d\n", plat->boolval);
-
-	printf("byte %02x\n", plat->byteval);
-	printf("bytearray");
-	for (i = 0; i < sizeof(plat->bytearray); i++)
-		printf(" %02x", plat->bytearray[i]);
-	printf("\n");
-
-	printf("int %d\n", plat->intval);
-	printf("intarray");
-	for (i = 0; i < ARRAY_SIZE(plat->intarray); i++)
-		printf(" %d", plat->intarray[i]);
-	printf("\n");
-
-	printf("longbytearray");
-	for (i = 0; i < sizeof(plat->longbytearray); i++)
-		printf(" %02x", plat->longbytearray[i]);
-	printf("\n");
-
-	printf("string %s\n", plat->stringval);
-	printf("stringarray");
-	for (i = 0; i < ARRAY_SIZE(plat->stringarray); i++)
-		printf(" \"%s\"", plat->stringarray[i]);
-	printf("\n");
-
-	return 0;
-}
-
 U_BOOT_DRIVER(sandbox_spl_test) = {
 	.name	= "sandbox_spl_test",
 	.id	= UCLASS_MISC,
 	.flags	= DM_FLAG_PRE_RELOC,
-	.probe	= sandbox_spl_probe,
 };
diff --git a/test/py/tests/test_ofplatdata.py b/test/py/tests/test_ofplatdata.py
index 13154935b9b..78837a3c008 100644
--- a/test/py/tests/test_ofplatdata.py
+++ b/test/py/tests/test_ofplatdata.py
@@ -4,53 +4,6 @@
 import pytest
 import u_boot_utils as util
 
-OF_PLATDATA_OUTPUT = '''
-of-platdata probe:
-bool 1
-byte 05
-bytearray 06 00 00
-int 1
-intarray 2 3 4 0
-longbytearray 09 0a 0b 0c 0d 0e 0f 10 11
-string message
-stringarray "multi-word" "message" ""
-of-platdata probe:
-bool 0
-byte 08
-bytearray 01 23 34
-int 3
-intarray 5 0 0 0
-longbytearray 09 0a 0b 0c 00 00 00 00 00
-string message2
-stringarray "another" "multi-word" "message"
-of-platdata probe:
-bool 0
-byte 00
-bytearray 00 00 00
-int 0
-intarray 0 0 0 0
-longbytearray 00 00 00 00 00 00 00 00 00
-string <NULL>
-stringarray "one" "" ""
-of-platdata probe:
-bool 0
-byte 00
-bytearray 00 00 00
-int 0
-intarray 0 0 0 0
-longbytearray 00 00 00 00 00 00 00 00 00
-string <NULL>
-stringarray "spl" "" ""
-'''
-
- at pytest.mark.buildconfigspec('spl_of_platdata')
-def test_ofplatdata(u_boot_console):
-    """Test that of-platdata can be generated and used in sandbox"""
-    cons = u_boot_console
-    cons.restart_uboot_with_flags(['--show_of_platdata'])
-    output = cons.get_spawn_output().replace('\r', '')
-    assert OF_PLATDATA_OUTPUT in output
-
 @pytest.mark.buildconfigspec('spl_of_platdata')
 def test_spl_devicetree(u_boot_console):
     """Test content of spl device-tree"""
-- 
2.28.0.806.g8561365e88-goog

  parent reply	other threads:[~2020-10-03 17:31 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 17:31 [PATCH 00/20] dm: Enhance of-platdata to support parent devices Simon Glass
2020-10-03 17:31 ` [PATCH 01/20] sandbox: Drop ad-hoc device declarations in SPL Simon Glass
2020-10-27  1:01   ` Simon Glass
2020-10-03 17:31 ` [PATCH 02/20] dtoc: Document the return value of scan_structs() Simon Glass
2020-10-27  1:01   ` Simon Glass
2020-10-03 17:31 ` [PATCH 03/20] dtoc: Order the structures internally by name Simon Glass
2020-10-27  1:01   ` Simon Glass
2020-10-03 17:31 ` [PATCH 04/20] dm: core: Allow dm_warn() to be used in SPL Simon Glass
2020-10-27  1:01   ` Simon Glass
2020-10-03 17:31 ` [PATCH 05/20] dtoc: Fix widening of int to bytes Simon Glass
2020-10-27  1:01   ` Simon Glass
2020-10-03 17:31 ` [PATCH 06/20] dm: Add a C test for of-platdata properties Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 07/20] sandbox: Allow selection of SPL unit tests Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` Simon Glass [this message]
2020-10-03 17:31 ` [PATCH 09/20] dm: test: Add a check that all devices have a dev value Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 10/20] dm: test: Add a test for of-platdata phandles Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 11/20] dm: Use an allocated array for run-time device info Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 12/20] sandbox: Fix up building for of-platdata Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 13/20] dm: Support parent devices with of-platdata Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 14/20] dm: Add a test for of-platdata parent information Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 15/20] dm: core: Convert #ifdef to if() in root.c Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-11-04 12:55   ` Michal Simek
2020-11-04 13:59     ` Tom Rini
2020-11-04 14:33       ` Michal Simek
2020-10-03 17:31 ` [PATCH 16/20] x86: apl: Enable SPI flash in TPL with APL_SPI_FLASH_BOOT Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 17/20] x86: apl: Take advantage of the of-platdata parent support Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 18/20] dm: Use driver_info index instead of pointer Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 19/20] dm: Don't allow U_BOOT_DEVICE() when of-platdata is used Simon Glass
2020-10-30  3:34   ` Simon Glass
2020-10-03 17:31 ` [PATCH 20/20] dm: doc: Update the of-platadata documentation Simon Glass
2020-10-30  3:34   ` 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=20201003173142.3213123-9-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox