I'm looking for a tricky solution, here is my problem:
I want to make devices field update linux kernel 3.0.15-ts-armv7l to a newer version using nand tools.
But, u-boot is 2013.07 from timesys and use hardware ECC, and kernel 3.0.15-ts-armv7l use software ECC.
Kernel need to be written with hardware ECC from linux, how can it be done?
Is it possible to compile NAND tools (nandwrite) with their own driver?Is it possible to override NAND vf610_nfc driver in some way?
Solved! Go to Solution.
I understand your dilemma. Can you detail more about your field update capabilities? Because you mention compiling nandwrite as a separate driver, I assume your field update process only currently has support to update the rootfs on your board. If you could field update U-Boot 2013.07 or Linux 3.0, you can configure both of these with NAND soft or hard ECC, making the subsequent Linux 4.0 update easy.
If you want to use 'nandwrite' from Linux userspace to update U-Boot configured with NAND soft ECC, maybe it would be possible to build a small kernel module that would do this. You would not want to reinit any NAND devices in your kernel module, because these have already been initted by the NAND driver builtin to the kernel.
My big mistake was to not paying attention to ECC detail when I decided to switch to u-boot 2013.07 (:
Customer application (QT application) can run a script when USB drive is present.
The idea is, to run something to update kernel and modify some u-boot env parameters, reboot with the new kernel and rfs on USB, then update NAND rfs.
Possible to do this?
- Flashing an u-boot 2013.07 version with soft ECC
- flash a new env with soft ECC
- update kernel (with HW ECC driver)
- reboot with RFS on USB pen
- re-flash u-boot 2013.07 with HW ECC
- re-flash the right env to boot on NAND with dtb
- reflash kernel
- update RFS
- then reboot
It should works on paper, but I have some doubt how to deal with the BCB when flashing u-boot, and such operation is risky, if only one thing goes wrong, the device must be returned to service.
Can you give me an advice for Boot Configuration Block, how to write it from linux user space.
This procedure looks good for the end result of using hard ECC. If you were OK with using soft ECC, there would be fewer NAND write steps necessary.
Updating U-Boot from Linux userspace will be the trickiest part. Timesys does not have an example of this; I would imagine you would want to port the source from the 'nandwrite' command in U-Boot, which has the BCB logic, to a loadable Linux kernel module. You could then probe the module, which would provide an interface for updating the U-Boot NAND partition.