Skip to contentSkip to conversation

UBI+UBIFS on Read-Only NAND

DISCUSSION Thomas Herrmann 3 participants 3 messages Dec 5, 2013 – Dec 6, 2013 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

We had an old JFFS based system that had a dip switch connected to the write-enable pin of the flash device, and it worked as expected. Users were able to configure and use the system in r/w mode and then "lock" the configuration.

I tried the same with our newer hardware, and UBI/UBIFS. I did not use static volumes, since write support is essential for initial setup. However, the system will not boot if the flash is write-protected in hardware, because UBI assumes that it is R/W.

What is the suggested solution for such a setup? I could not find anything in the FAQ or in the archive, but I may have been searching for the wrong keywords...

Regards
Thomas Herrmann

#1 lore raw

2013/12/5 Thomas Herrmann <[email protected]>:

Quoted 5 lines

We had an old JFFS based system that had a dip switch connected to the write-enable pin of the flash device, and it worked as expected. Users were able to configure and use the system in r/w mode and then "lock" the configuration.

Quoted 8 lines

I tried the same with our newer hardware, and UBI/UBIFS. I did not use static volumes, since write support is essential for initial setup. However, the system will not boot if the flash is write-protected in hardware, because UBI assumes that it is R/W.

What is the suggested solution for such a setup? I could not find anything in the FAQ or in the archive, but I may have been searching for the wrong keywords...

AFAIK, UBI is not design to be used on a write protected NAND. As it is basically a wear-leveling / bad block handling layer, it wouldn't make much sense without a write capability.
The closest use case I can imagine would be to mount the UBIFS volume RO by default and remount it RW when a gpio button is pushed. But with a dip switch directly on the NAND WP pin, I don't think there's an UBI based solution.

Richard.

#2 lore raw
Quoted 15 lines · Richard Genoud

2013/12/5 Thomas Herrmann <[email protected]>:

Quoted 5 lines

We had an old JFFS based system that had a dip switch connected to the write-enable pin of the flash device, and it worked as expected. Users were able to configure and use the system in r/w mode and then "lock" the configuration.

Quoted 8 lines

I tried the same with our newer hardware, and UBI/UBIFS. I did not use static volumes, since write support is essential for initial setup. However, the system will not boot if the flash is write-protected in hardware, because UBI assumes that it is R/W.

What is the suggested solution for such a setup? I could not find anything in the FAQ or in the archive, but I may have been searching for the wrong keywords...

Quoted 8 lines

AFAIK, UBI is not design to be used on a write protected NAND. As it is basically a wear-leveling / bad block handling layer, it wouldn't make much sense without a write capability.
The closest use case I can imagine would be to mount the UBIFS volume RO by default and remount it RW when a gpio button is pushed. But with a dip switch directly on the NAND WP pin, I don't think there's an UBI based solution.

When you open a UBI volume you can choose the mode (UBI_READONLY, UBI_READWRITE, UBI_EXCLUSIVE).
But ubifs always open it in UBI_READWRITE mode (in ubifs_fill_super), even if we are in ro mode.

If it wasn't the case you can implement a software write protect at ubi level.

Matthieu