浏览代码

UBI: Add compile-time check for correct malloc area configuration

UBI is quite memory greedy and requires at least approx. 512k of malloc
area. This patch adds a compile-time check, so that boards will not
build with less memory reserved for this area (CONFIG_SYS_MALLOC_LEN).

Signed-off-by: Stefan Roese <sr@denx.de>
Stefan Roese 16 年之前
父节点
当前提交
60cfe87bd3
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      drivers/mtd/ubi/build.c

+ 4 - 0
drivers/mtd/ubi/build.c

@@ -46,6 +46,10 @@
 #include <ubi_uboot.h>
 #include <ubi_uboot.h>
 #include "ubi.h"
 #include "ubi.h"
 
 
+#if (CONFIG_SYS_MALLOC_LEN < (512 << 10))
+#error Malloc area too small for UBI, increase CONFIG_SYS_MALLOC_LEN to >= 512k
+#endif
+
 /* Maximum length of the 'mtd=' parameter */
 /* Maximum length of the 'mtd=' parameter */
 #define MTD_PARAM_LEN_MAX 64
 #define MTD_PARAM_LEN_MAX 64