Page 1 of 1

Upgrading PMECC from 2 to 4 within the Linux system

Posted: Fri Jan 12, 2018 1:33 pm
by gudjon
Hi list

I have been searching for a solution to the following problem without success.

I need some program that can make a full remote update preferably without
having the user to press the NAND-disable button.

The program must as well change the PMECC bits from 2 to 4 for all parts of the system.
at91bootstrap
u-boot
Device tree
Linux-kernel

Is there any way to make nandwrite running on a system with 2 bit PMECC write these
files with 4 bit PMECC and then reboot?

Regards
Gudjon

Re: Upgrading PMECC from 2 to 4 within the Linux system

Posted: Sat Jan 13, 2018 2:46 am
by blue_z
gudjon wrote:Is there any way to make nandwrite running on a system with 2 bit PMECC write these
files with 4 bit PMECC and then reboot?
That can be done with either U-Boot or Linux. The remote requirement adds the need to use scripts, which then favors the use of Linux.

Changing the NFC configuration on the fly simply means that NAND flash cannot be in use at that time.
Since U-Boot is single tasking that is trivial to ensure.
For a Linux system that means that no filesystem based in NAND flash can be actively mounted. Booting Linux with an initramfs (like a LiveCD of a distro, but booting from a SDcard or the network) would be the simplest means of having no mounted filesystems based in NAND.

The booted version of U-Boot or Linux kernel could have its NAND driver built with the revised PMECC parameters. There should be no reason to have to add a "change PMECC parameters" capability. The sacrifice is that these versions cannot read the existing contents of NAND flash, but must erase and update NAND flash before reading any previously-written blocks.

gudjon wrote:The program must as well change the PMECC bits from 2 to 4 for all parts of the system.
at91bootstrap
u-boot
Device tree
Linux-kernel
Isn't this list incomplete (i.e. what about a root filesystem)?

Regards