arm: mvebu: ds414: Auto-populate env if appropriate
[platform/kernel/u-boot.git] / board / Synology / ds414 / ds414.c
index 9c4ce67..abe6f9e 100644 (file)
@@ -18,6 +18,8 @@
 #include "../arch/arm/mach-mvebu/serdes/axp/high_speed_env_spec.h"
 #include "../arch/arm/mach-mvebu/serdes/axp/board_env_spec.h"
 
+#include "cmd_syno.h"
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /* GPP and MPP settings as found in mvBoardEnvSpec.c of Synology's U-Boot */
@@ -179,6 +181,15 @@ int board_init(void)
        return 0;
 }
 
+int misc_init_r(void)
+{
+       if (!env_get("ethaddr")) {
+               puts("Incomplete environment, populating from SPI flash\n");
+               do_syno_populate(0, NULL);
+       }
+       return 0;
+}
+
 int checkboard(void)
 {
        puts("Board: DS414\n");