Excuse me Alejandro, I have been busy all this time...
Finally I managed to make it work.
The problem was on the kernel driver for nand in kernel 3.17.2, it didn't create the partitions so Linux was using all the NandFlash space instead of creating a first partition (mtd0) for boot and another for rootfs.
I have made a patch that changes the driver configuration and create both partitions on NandFlash, so I can use them with no problems.
Patch:
>From 2e3339c6865f9214744bbe6f6c6db6ce33b7d169 Mon Sep 17 00:00:00 2001
From: jmalvarez <jmalvarez@dezac.es>
Date: Mon, 18 May 2015 15:40:06 +0200
Subject: [PATCH] Particiones MTD nand flash
---
drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 33 +++++++++++++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 959cb9b..1943511 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1698,12 +1698,17 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
struct mtd_part_parser_data ppdata = {};
int ret;
+//JM para particiones en nand-flash
+ struct mtd_partition partitions[2];
+ static char *chip_0_boot_name = "gpmi-nfc-0-boot";
+ static char *general_use_name = "gpmi-nfc-general-use";
+
/* init current chip */
this->current_chip = -1;
/* init the MTD data structures */
mtd->priv = chip;
- mtd->name = "gpmi-nand";
+ mtd->name = "gpmi-nand-init";
mtd->owner = THIS_MODULE;
/* init the nand_chip{}, we don't support a 16-bit NAND Flash bus. */
@@ -1760,7 +1765,31 @@ static int gpmi_nand_init(struct gpmi_nand_data *this)
chip->scan_bbt(mtd);
ppdata.of_node = this->pdev->dev.of_node;
- ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
+//JM ret = mtd_device_parse_register(mtd, NULL, &ppdata, NULL, 0);
+
+ /*
+ * We partition the medium like so:
+ *
+ * +------+----------------------------------------------------+
+ * | Boot | General Use |
+ * +------+----------------------------------------------------+
+ */
+
+ /* Chip 0 Boot */
+
+ partitions[0].name = chip_0_boot_name;
+ partitions[0].offset = 0;
+ partitions[0].size = 160 * SZ_128K; //0x1400000; //JM rom->boot_area_size_in_bytes;
+ partitions[0].mask_flags = 0;
+
+ /* General Use */
+
+ partitions[1].name = general_use_name;
+ partitions[1].offset = 160 * SZ_128K; //0x1400000; //JM rom->boot_area_size_in_bytes;
+ partitions[1].size = MTDPART_SIZ_FULL;
+ partitions[1].mask_flags = 0;
+
+ ret = mtd_device_parse_register(mtd, NULL, &ppdata, partitions, 2);
if (ret)
goto err_out;
return 0;
--
1.9.1