summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-04-10 21:20:28 +0200
committerWolfgang Denk <wd@denx.de>2011-04-10 21:20:28 +0200
commit4fd783d63f85871db03b1f06a2572bf43085af32 (patch)
tree9c966aef0be572da9506a38688876cf35aecae39
parenta8708a86344794d7d9a25c71d2fe56b36563a0b5 (diff)
parent030103d780490096c7052ecee8f2af1cb422217d (diff)
downloadu-boot-imx-4fd783d63f85871db03b1f06a2572bf43085af32.zip
u-boot-imx-4fd783d63f85871db03b1f06a2572bf43085af32.tar.gz
u-boot-imx-4fd783d63f85871db03b1f06a2572bf43085af32.tar.bz2
Merge branch 'next' of git://git.denx.de/u-boot-nios
-rw-r--r--board/altera/nios2-generic/nios2-generic.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c
index 89848cf..220a4c4 100644
--- a/board/altera/nios2-generic/nios2-generic.c
+++ b/board/altera/nios2-generic/nios2-generic.c
@@ -24,12 +24,28 @@
#include <common.h>
#include <netdev.h>
+#include <mtd/cfi_flash.h>
+#include <asm/io.h>
void text_base_hook(void); /* nop hook for text_base.S */
+#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
+static void __early_flash_cmd_reset(void)
+{
+ /* reset flash before we read env */
+ writeb(AMD_CMD_RESET, CONFIG_ENV_ADDR);
+ writeb(FLASH_CMD_RESET, CONFIG_ENV_ADDR);
+}
+void early_flash_cmd_reset(void)
+ __attribute__((weak,alias("__early_flash_cmd_reset")));
+#endif
+
int board_early_init_f(void)
{
text_base_hook();
+#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR)
+ early_flash_cmd_reset();
+#endif
return 0;
}