Starting from revision F we can toggle a GPIO to control nWP of
the NAND chip. This means that during power-on or other mode of
operation no changes can be done to the flash.
Remove the nWP before we try to write to the flash in the UART
mode. Leave it enabled for further operations.
This means that the U-Boot now needs to stop to set these
values. I have manually tested this with BTS #1 and micron
flash. "MICRON" was printed on the serial console.
The NAND might have more bit flips than can be recovered. The way
to deal with it is to write multiple copies on multiple pages. The
probability of all pages failing depends on the specific NAND flash
used and was not calculated so far. The RBL is capable of trying to
load several copies and we should be more safe now.
This requires a new partioning inside the U-Boot or other bootloader.
I disabled the initialization of the vector interrupt tables in
davinci.c and then I can use u-boot commands like these
load and start ubl
dhcp; set serverip 192.168.0.88; tftp ubl_sysmobts_v2.elf; bootelf
manipulate bits. Flip a 1 to a 0:
nand read.raw 0x85000000 0x00080000 1
mm.b 0x85000000
nand write.raw 0x85000000 0x00080000 1