diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c
index 834cbeb2d5e7396827ff9656db3c1f3eae059609..384fee9b75d4a3e15f49747a9766ac02854c3263 100644
--- a/board/altera/nios2-generic/nios2-generic.c
+++ b/board/altera/nios2-generic/nios2-generic.c
@@ -28,16 +28,21 @@ void early_flash_cmd_reset(void)
 
 int board_early_init_f(void)
 {
+#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \
+    defined(CONFIG_CFI_FLASH_MTD)
+	early_flash_cmd_reset();
+#endif
+	return 0;
+}
+
+int board_early_init_r(void)
+{
 #ifdef CONFIG_ALTERA_PIO
 #ifdef LED_PIO_BASE
 	altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o',
 			LED_PIO_RSTVAL, (1 << LED_PIO_WIDTH) - 1,
 			"led");
 #endif
-#endif
-#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \
-    defined(CONFIG_CFI_FLASH_MTD)
-	early_flash_cmd_reset();
 #endif
 	return 0;
 }
diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h
index 5bb776859d7c83cf1db7d837aacec553b29fa4a5..293acaef57c3dc63c18d21756b2b26c1c8f3592e 100644
--- a/include/configs/nios2-generic.h
+++ b/include/configs/nios2-generic.h
@@ -15,6 +15,7 @@
 #include "../board/altera/nios2-generic/custom_fpga.h" /* fpga parameters */
 #define CONFIG_BOARD_NAME "nios2-generic" /* custom board name */
 #define CONFIG_BOARD_EARLY_INIT_F	/* enable early board-spec. init */
+#define CONFIG_BOARD_EARLY_INIT_R
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DISPLAY_BOARDINFO
 #define CONFIG_SYS_NIOS_SYSID_BASE	CONFIG_SYS_SYSID_BASE