[PATCH 06/10] imx-bbu-nand-fcb: Use barebox partition instead of whole device

Sascha Hauer s.hauer at pengutronix.de
Thu Jun 11 23:35:42 PDT 2015


We used to use nand0 device for storing barebox and made the assumption
that there is enough space at the beginning of the first device. Instead,
use the barebox partition directly. This requires that the partition
where barebox should be stored is named 'barebox', that is the case for
all boards currently.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/imx-bbu-nand-fcb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/imx-bbu-nand-fcb.c b/common/imx-bbu-nand-fcb.c
index 5b984d4..ca7df97 100644
--- a/common/imx-bbu-nand-fcb.c
+++ b/common/imx-bbu-nand-fcb.c
@@ -370,7 +370,7 @@ static int imx6_bbu_nand_update(struct bbu_handler *handler, struct bbu_data *da
 	if (ret)
 		return ret;
 
-	bcb_cdev = cdev_by_name("nand0");
+	bcb_cdev = cdev_by_name(handler->devicefile);
 	if (!bcb_cdev) {
 		pr_err("%s: No FCB device!\n", __func__);
 		return -ENODEV;
@@ -478,7 +478,7 @@ int imx6_bbu_nand_register_handler(const char *name, unsigned long flags)
 	int ret;
 
 	handler = xzalloc(sizeof(*handler));
-	handler->devicefile = "/dev/nand0";
+	handler->devicefile = "nand0.barebox";
 	handler->name = name;
 	handler->flags = flags;
 	handler->handler = imx6_bbu_nand_update;
-- 
2.1.4




More information about the barebox mailing list