All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 018/108] Revert "RFC: sandbox: net: Suppress the MAC-address warnings"
Date: Sun, 20 Oct 2019 21:31:51 -0600	[thread overview]
Message-ID: <20191021033322.217715-18-sjg@chromium.org> (raw)
In-Reply-To: <20191021033322.217715-2-sjg@chromium.org>

This reverts commit 96ac4def8b6686de8566b91419ce98cd5765079b.

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

Changes in v3: None
Changes in v2: None

 arch/sandbox/cpu/state.c         | 12 ++----------
 arch/sandbox/include/asm/state.h |  5 +----
 cmd/nvedit.c                     |  8 --------
 include/configs/sandbox.h        |  7 +++++--
 include/env.h                    | 12 ------------
 net/eth-uclass.c                 | 11 ++---------
 test/dm/test-main.c              |  2 +-
 7 files changed, 11 insertions(+), 46 deletions(-)

diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index 70b278e4e27..dee5fde4f73 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -351,7 +351,7 @@ bool state_get_skip_delays(void)
 	return state->skip_delays;
 }
 
-void state_reset_for_test(struct sandbox_state *state, bool eth_vars)
+void state_reset_for_test(struct sandbox_state *state)
 {
 	/* No reset yet, so mark it as such. Always allow power reset */
 	state->last_sysreset = SYSRESET_COUNT;
@@ -367,14 +367,6 @@ void state_reset_for_test(struct sandbox_state *state, bool eth_vars)
 	 */
 	INIT_LIST_HEAD(&state->mapmem_head);
 	state->next_tag = state->ram_size;
-
-	if (eth_vars) {
-		/* set up some environment variables needed by the eth tests */
-		env_set_for_test("ethaddr", "00:00:11:22:33:44");
-		env_set_for_test("eth1addr", "00:00:11:22:33:45");
-		env_set_for_test("eth3addr", "00:00:11:22:33:46");
-		env_set_for_test("eth5addr", "00:00:11:22:33:47");
-	}
 }
 
 int state_init(void)
@@ -385,7 +377,7 @@ int state_init(void)
 	state->ram_buf = os_malloc(state->ram_size);
 	assert(state->ram_buf);
 
-	state_reset_for_test(state, false);
+	state_reset_for_test(state);
 	/*
 	 * Example of how to use GPIOs:
 	 *
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 4fa3b094a97..ad3e94beb9a 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -251,11 +251,8 @@ bool state_get_skip_delays(void);
  * state_reset_for_test() - Reset ready to re-run tests
  *
  * This clears out any test state ready for another test run.
- *
- * @param state		Sandbox state to update
- * @param eth_vars	Set environment variables for eth tests
  */
-void state_reset_for_test(struct sandbox_state *state, bool eth_vars);
+void state_reset_for_test(struct sandbox_state *state);
 
 /**
  * state_show() - Show information about the sandbox state
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index 5eef44eb5ff..1cb0bc1460b 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -299,14 +299,6 @@ static int _do_env_set(int flag, int argc, char * const argv[], int env_flag)
 	return 0;
 }
 
-int env_set_for_test(const char *varname, const char *value)
-{
-	const char * const argv[4] = { "setenv", varname, value, NULL };
-
-	assert(value);
-	return _do_env_set(0, 3, (char * const *)argv, 0);
-}
-
 int env_set(const char *varname, const char *varvalue)
 {
 	const char * const argv[4] = { "setenv", varname, varvalue, NULL };
diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 02e553c4b12..5d75021ed6b 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -98,8 +98,11 @@
 					"stderr=serial,vidconsole\0"
 #endif
 
-/* Note that some ethernet variables are set in state_reset_for_test() */
-#define SANDBOX_ETH_SETTINGS		"ipaddr=1.2.3.4\0"
+#define SANDBOX_ETH_SETTINGS		"ethaddr=00:00:11:22:33:44\0" \
+					"eth1addr=00:00:11:22:33:45\0" \
+					"eth3addr=00:00:11:22:33:46\0" \
+					"eth5addr=00:00:11:22:33:47\0" \
+					"ipaddr=1.2.3.4\0"
 
 #define MEM_LAYOUT_ENV_SETTINGS \
 	"bootm_size=0x10000000\0" \
diff --git a/include/env.h b/include/env.h
index bc48a72cde9..b72239f6a58 100644
--- a/include/env.h
+++ b/include/env.h
@@ -145,18 +145,6 @@ int env_get_yesno(const char *var);
  */
 int env_set(const char *varname, const char *value);
 
-/**
- * env_set_for_test() - Set the value of a variable for testing
- *
- * This works as if the variable value was defined in the built-in environment,
- * so uses a flags value of 0. This should only be used in tests.
- *
- * @varname: Variable to adjust
- * @value: Value to set for the variable (cannot be NULL)
- * @return 0 if OK, 1 on error
- */
-int env_set_for_test(const char *varname, const char *value);
-
 /**
  * env_get_ulong() - Return an environment variable as an integer value
  *
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index 6c195361385..3bd98b01ad3 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -485,12 +485,6 @@ static int eth_post_probe(struct udevice *dev)
 	struct eth_device_priv *priv = dev->uclass_priv;
 	struct eth_pdata *pdata = dev->platdata;
 	unsigned char env_enetaddr[ARP_HLEN];
-	/*
-	 * These warnings always appear on sandbox and are not useful. They have
-	 * been here for some time and the issue has not been resolved. So for
-	 * now, disable them.
-	 */
-	bool show_warnings = !IS_ENABLED(CONFIG_SANDBOX);
 
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 	struct eth_ops *ops = eth_get_ops(dev);
@@ -544,9 +538,8 @@ static int eth_post_probe(struct udevice *dev)
 		memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN);
 	} else if (is_valid_ethaddr(pdata->enetaddr)) {
 		eth_env_set_enetaddr_by_index("eth", dev->seq, pdata->enetaddr);
-		if (show_warnings)
-			printf("\nWarning: %s using MAC address from ROM\n",
-			       dev->name);
+		printf("\nWarning: %s using MAC address from ROM\n",
+		       dev->name);
 	} else if (is_zero_ethaddr(pdata->enetaddr) ||
 		   !is_valid_ethaddr(pdata->enetaddr)) {
 #ifdef CONFIG_NET_RANDOM_ETHADDR
diff --git a/test/dm/test-main.c b/test/dm/test-main.c
index 14a520944e8..72648162a91 100644
--- a/test/dm/test-main.c
+++ b/test/dm/test-main.c
@@ -28,7 +28,7 @@ static int dm_test_init(struct unit_test_state *uts, bool of_live)
 	memset(dms, '\0', sizeof(*dms));
 	gd->dm_root = NULL;
 	memset(dm_testdrv_op_count, '\0', sizeof(dm_testdrv_op_count));
-	state_reset_for_test(state_get_current(), true);
+	state_reset_for_test(state_get_current());
 
 #ifdef CONFIG_OF_LIVE
 	/* Determine whether to make the live tree available */
-- 
2.23.0.866.gb869b98d4c-goog

  parent reply	other threads:[~2019-10-21  3:31 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21  3:31 [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 002/108] binman: Add support for Intel FSP-S Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 003/108] binman: Add support for Intel FSP-T Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 004/108] binman: Fix up comment in intel-fsp-m Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 005/108] binman: Add a library to access binman entries Simon Glass
2019-10-28  3:27   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 006/108] dm: gpio: Allow control of GPIO uclass in SPL Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-11-02  9:38     ` Bin Meng
2019-11-02 23:10       ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 007/108] dm: core: Fix offset_to_ofnode() with invalid offset Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 008/108] dm: pci: Delay auto-config until after relocation Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 009/108] dm: pci: Move pci_get_devfn() into a common file Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 010/108] net: Move the checksum functions to lib/ Simon Glass
2019-10-28  4:45   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 011/108] i2c: Tidy up designware PCI support Simon Glass
2019-10-28  4:40   ` Heiko Schocher
2019-10-28  5:54   ` Bin Meng
2019-10-28 10:43   ` Stefan Roese
2019-10-21  3:31 ` [U-Boot] [PATCH v3 012/108] spl: Correct priority selection for image loaders Simon Glass
2019-10-28  5:54   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 013/108] x86: spi: Add helper functions for Intel Fast SPI Simon Glass
2019-11-02  4:13   ` Bin Meng
2019-11-02 21:04     ` Simon Glass
2019-11-02 23:18       ` Bin Meng
2019-11-03 14:36         ` Simon Glass
2019-11-03 23:40           ` Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 014/108] spi: Add support for memory-mapped flash Simon Glass
2019-11-02  4:13   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 015/108] dm: doc: Correct of-platdata driver name Simon Glass
2019-10-28  5:59   ` Bin Meng
2019-11-02  9:42     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 016/108] fdt: Show the preprocessed .dts file on error Simon Glass
2019-10-28  6:47   ` Bin Meng
2019-11-02 18:02     ` Simon Glass
2019-11-04  8:28       ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 017/108] RFC: sandbox: net: Suppress the MAC-address warnings Simon Glass
2019-10-21  3:31 ` Simon Glass [this message]
2019-10-28  6:16   ` [U-Boot] [PATCH v3 018/108] Revert "RFC: sandbox: net: Suppress the MAC-address warnings" Bin Meng
2019-11-02 18:07     ` Simon Glass
2019-10-21  3:31 ` [U-Boot] [PATCH v3 019/108] spl: Add a size check for TPL Simon Glass
2019-10-28  6:34   ` Bin Meng
2019-11-02  9:47     ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 020/108] sandbox: pci: Create a new sandbox_pci_read_bar() function Simon Glass
2019-10-28  6:36   ` Bin Meng
2019-10-21  3:31 ` [U-Boot] [PATCH v3 021/108] x86: timer: Set up the timer in timer_early_get_count() Simon Glass
2019-10-28  7:12   ` Bin Meng
2019-11-02  9:47     ` Bin Meng
2019-10-28  3:27 ` [U-Boot] [PATCH v3 001/108] binman: Correct symbol calculation with non-zero image base Bin Meng
2019-11-02  9:38   ` Bin Meng

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=20191021033322.217715-18-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.