Hi,
In V1.X, ST don't use TRIMFFS in U-Boot (CMD_NAND_TRIMFFS [=n])
And I agree with you, today this TRIMFFS feature is not supported on MTD
backend DFU introduced by ST in U-Boot (and also upstreamed):
it is a simple RAW, without full UBI support (same level than DFU NAND before
your patch).
For V2.0, we move to this DFU MTD interface to support all MTD devices with
only one DFU backend, including SPI-NAND.
Today I see a solution for your issue: implement the TRIM FSS directly in
the file drivers/dfu/dfu_mtd.c as it was done drivers/mtd/nand/raw/nand_util.c
= skip the LAST 0xFF in each write page with a new function drop_ffs
This dev is not planned today by ST as it is not mandatory:
"--space-fixup" flag is used in OpenSTLinux v2.0 yocto recipes
in meta-st/meta-st-stm32mp/conf/machine/include/st-machine-common-stm32mp.inc:
MKUBIFS_ARGS_nand_4_256 = "--min-io-size 4096 --leb-size 253952 --max-leb-cnt 4096 --space-fixup"
Why it is blocking for you to use "--space-fixup" flag as us ?
It is for time optimization on first boot ?
References:
http://www.linux-mtd.infradead.org/faq/ubifs.html#L_free_space_fixup
https://linux-mtd.infradead.narkive.com/MuWWGTRF/patch-ubifs-make-space-fixup-work-in-the-remount-case
if you want to come back to NAND DFU instead of MTD DFU.....
it should be possible with some adaptation but for me it just a temporarily solution,
I prefer the TRIMFFS addition in DFU_MTD (it is more generic solution)
I see something at least the next modification not tested:
1/ activate CONFIG_DFU_NAND (add imply arch/arm/mach-stm32mp/Kconfig in config CMD_STM32PROG)
2/ update configuration in arch/arm/mach-stm32mp$ ne cmd_stm32prog/stm32prog.c
in stm32prog_alt_add()
...
" mmcpart %d;", -(part->part_id));
} else {
if (part->part_type == PART_SYSTEM &&
(part->target == STM32PROG_NAND ||
part->target == STM32PROG_NOR ||
part->target == STM32PROG_SPI_NAND))
offset += snprintf(buf + offset,
ALT_BUF_LEN - offset,
"partubi");
else
offset += snprintf(buf + offset,
ALT_BUF_LEN - offset,
"part");
- /* dev_id requested by DFU MMC */
- if (part->target == STM32PROG_MMC)
+ /* dev_id requested by DFU MMC and FDU_NAND */
+ if (part->target == STM32PROG_MMC || part->target == STM32PROG_NAND)
offset += snprintf(buf + offset, ALT_BUF_LEN - offset,
" %d", part->dev_id);
offset += snprintf(buf + offset, ALT_BUF_LEN - offset,
" %d;", part->part_id);
}
switch (part->target) {
.....
- case STM32PROG_NAND:
case STM32PROG_NOR:
case STM32PROG_SPI_NAND:
sprintf(dfustr, "mtd");
get_mtd_by_target(devstr, part->target, part->dev_id);
break;
+ case STM32PROG_NAND:
+ sprintf(dfustr, "nand");
+ sprintf(devstr, "%d", part->dev_id);
+ break;
......
BR
Patrick