From 65e5cb54d017d60ec9d5de394715e5c95765f836 Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Fri, 31 Oct 2014 11:29:45 +0100 Subject: mtd, cfi, ubi: add missing writebufsize initialization ff94bc40af3481d47546595ba73c136de6af6929 "mtd, ubi, ubifs: resync with Linux-3.14" introduced the writebufsize field in struct mtd_info, which is not initialized in the cfi_flash driver, which leads in not working ubi on cfi flashes. Fix it Signed-off-by: Heiko Schocher Reported-by: Andrew Ruder Acked-by: Stefan Roese Acked-by: Andrew Ruder diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c index ac805ff..709a486 100644 --- a/drivers/mtd/cfi_mtd.c +++ b/drivers/mtd/cfi_mtd.c @@ -226,6 +226,7 @@ int cfi_mtd_init(void) mtd->flags = MTD_CAP_NORFLASH; mtd->size = fi->size; mtd->writesize = 1; + mtd->writebufsize = mtd->writesize; mtd->_erase = cfi_mtd_erase; mtd->_read = cfi_mtd_read; -- cgit v0.10.2 From d1cfeee916fe86eddd944f7363f9d2884bdd9814 Mon Sep 17 00:00:00 2001 From: Andrew Ruder Date: Wed, 5 Nov 2014 13:31:57 -0600 Subject: ubi: enable error reporting in initialization The UBI layer will disable much of its error reporting when it is compiled into the linux kernel to avoid stopping boot. We want this error reporting in U-Boot since we don't initialize the UBI layer until it is used and want the error reporting. We force this by telling the UBI layer we are building as a module. Signed-off-by: Andrew Ruder Cc: Wolfgang Denk Cc: Heiko Schocher Cc: Kyungmin Park diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h index 1fd15f4..324fe72 100644 --- a/include/ubi_uboot.h +++ b/include/ubi_uboot.h @@ -51,6 +51,14 @@ #undef CONFIG_MTD_UBI_BLOCK +/* ubi_init() disables returning error codes when built into the Linux + * kernel so that it doesn't hang the Linux kernel boot process. Since + * the U-Boot driver code depends on getting valid error codes from this + * function we just tell the UBI layer that we are building as a module + * (which only enables the additional error reporting). + */ +#define CONFIG_MTD_UBI_MODULE + #if !defined(CONFIG_MTD_UBI_BEB_LIMIT) #define CONFIG_MTD_UBI_BEB_LIMIT 20 #endif -- cgit v0.10.2