All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] ARM: rmobile: Ignore U-Boot env when started via JTAG on Stout
@ 2018-04-17  0:59 Marek Vasut
  2018-04-17  0:59 ` [U-Boot] [PATCH 2/2] ARM: rmobile: Ignore U-Boot env when started via JTAG on Porter Marek Vasut
  0 siblings, 1 reply; 2+ messages in thread
From: Marek Vasut @ 2018-04-17  0:59 UTC (permalink / raw)
  To: u-boot

When U-Boot is started via JTAG, ignore the installed environment
as it may interfere with the recovery of the board.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 board/renesas/stout/stout.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/board/renesas/stout/stout.c b/board/renesas/stout/stout.c
index d7e81292a0..192ee66a38 100644
--- a/board/renesas/stout/stout.c
+++ b/board/renesas/stout/stout.c
@@ -128,3 +128,18 @@ int board_phy_config(struct phy_device *phydev)
 const struct rmobile_sysinfo sysinfo = {
 	CONFIG_ARCH_RMOBILE_BOARD_STRING
 };
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+	const u32 load_magic = 0xb33fc0de;
+
+	/* Block environment access if loaded using JTAG */
+	if ((readl(CONFIG_SPL_TEXT_BASE + 0x24) == load_magic) &&
+	    (op != ENVOP_INIT))
+		return ENVL_UNKNOWN;
+
+	if (prio)
+		return ENVL_UNKNOWN;
+
+	return ENVL_SPI_FLASH;
+}
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [U-Boot] [PATCH 2/2] ARM: rmobile: Ignore U-Boot env when started via JTAG on Porter
  2018-04-17  0:59 [U-Boot] [PATCH 1/2] ARM: rmobile: Ignore U-Boot env when started via JTAG on Stout Marek Vasut
@ 2018-04-17  0:59 ` Marek Vasut
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Vasut @ 2018-04-17  0:59 UTC (permalink / raw)
  To: u-boot

When U-Boot is started via JTAG, ignore the installed environment
as it may interfere with the recovery of the board.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 board/renesas/porter/porter.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c
index acd4f91d59..eb66bc903e 100644
--- a/board/renesas/porter/porter.c
+++ b/board/renesas/porter/porter.c
@@ -11,6 +11,7 @@
 #include <malloc.h>
 #include <dm.h>
 #include <dm/platform_data/serial_sh.h>
+#include <environment.h>
 #include <asm/processor.h>
 #include <asm/mach-types.h>
 #include <asm/io.h>
@@ -136,3 +137,18 @@ void reset_cpu(ulong addr)
 	if (ret)
 		hang();
 }
+
+enum env_location env_get_location(enum env_operation op, int prio)
+{
+	const u32 load_magic = 0xb33fc0de;
+
+	/* Block environment access if loaded using JTAG */
+	if ((readl(CONFIG_SPL_TEXT_BASE + 0x24) == load_magic) &&
+	    (op != ENVOP_INIT))
+		return ENVL_UNKNOWN;
+
+	if (prio)
+		return ENVL_UNKNOWN;
+
+	return ENVL_SPI_FLASH;
+}
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-17  0:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17  0:59 [U-Boot] [PATCH 1/2] ARM: rmobile: Ignore U-Boot env when started via JTAG on Stout Marek Vasut
2018-04-17  0:59 ` [U-Boot] [PATCH 2/2] ARM: rmobile: Ignore U-Boot env when started via JTAG on Porter Marek Vasut

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.