diff options
author | Marek Vasut <marek.vasut+renesas@gmail.com> | 2018-04-17 02:49:48 +0200 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2018-04-17 11:38:56 +0200 |
commit | f2b6f82b9d97651200be3ab9f446668ae496178e (patch) | |
tree | 809d0775aca56aee2ceed94123ae62a6d3caeaa5 /board/renesas/porter/porter.c | |
parent | a3c159b9c3cb844a8f0bb3abdac93b0fcaccba54 (diff) | |
download | u-boot-f2b6f82b9d97651200be3ab9f446668ae496178e.tar.gz u-boot-f2b6f82b9d97651200be3ab9f446668ae496178e.tar.xz u-boot-f2b6f82b9d97651200be3ab9f446668ae496178e.zip |
ARM: rmobile: Ignore U-Boot env when started via JTAG on Porter
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>
Diffstat (limited to 'board/renesas/porter/porter.c')
-rw-r--r-- | board/renesas/porter/porter.c | 16 |
1 files changed, 16 insertions, 0 deletions
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; +} |