Merge tag 'xilinx-for-v2020.07-rc2' of https://gitlab.denx.de/u-boot/custodians/u...
[oweals/u-boot.git] / board / gardena / smart-gateway-mt7688 / board.c
index bd494c84fc80ed0a3ffa0ac34edfc991f1d25260..776afa43a66046fdf589d8502652765b022bf045 100644 (file)
@@ -6,10 +6,13 @@
 #include <common.h>
 #include <env.h>
 #include <env_internal.h>
+#include <init.h>
 #include <led.h>
+#include <malloc.h>
 #include <net.h>
 #include <spi.h>
 #include <spi_flash.h>
+#include <u-boot/crc.h>
 #include <uuid.h>
 #include <linux/ctype.h>
 #include <linux/io.h>
@@ -18,7 +21,7 @@
 
 #define FACTORY_DATA_OFFS      0xc0000
 #define FACTORY_DATA_SECT_SIZE 0x10000
-#if ((CONFIG_ENV_OFFSET_REDUND + CONFIG_ENV_SIZE_REDUND) > FACTORY_DATA_OFFS)
+#if ((CONFIG_ENV_OFFSET_REDUND + CONFIG_ENV_SIZE) > FACTORY_DATA_OFFS)
 #error "U-Boot image with environment too big (overlapping with factory-data)!"
 #endif
 #define FACTORY_DATA_USER_OFFS 0x140
@@ -292,8 +295,10 @@ err_free:
        return ret;
 }
 
+#ifndef CONFIG_SPL_BUILD
 U_BOOT_CMD(
        fd_write,       1,      0,      do_fd_write,
        "Write test factory-data values to SPI NOR",
        "\n"
 );
+#endif