
Reinhard Meyer wrote:
Dear Stefano Babic,
Hi Reinhard,
Just looking at the patch I see that it writes the env to fixed blocks on the SD/MMC card. This will work of course. BUT usually (IMHO) such cards are used with partitions/filesystems.
Not always. In the specific case reported by Amit, the mx.51 processor can boot from a SD card, that must not contain partitions at least for the early sectors, where it is supposed there is the u-boot's code.
Usage of partitions is not forbidden, however. The partitions must only start after the space required by u-boot and (as supported by the patch in question) by the environment.
How do you make sure the blocks don't overwrite files or don't get overwritten by files?
Writing a correct partition table: the first partition must start after u-boot code and environment, used as raw-blocks. There is then no possibility for files to overwrite the environment or the code.
One can, of course, prepare the card with a small partition spanning the env blocks.
As I said, it is not required to have a partition for the environment, because this is read only as raw-block. It is only required to skip the first blocks (or the block set in the config file).
Should the env not be saved in a file? Which is probably a bit beyond possibility to read when not yet relocated...
Reading the environment from a file should be in a separate patch and made much more general ;-)
It is not related to a specific storage. We could have a filesystem even on other storages (SPI-Flash, NAND, HD...) and "reading from file" should IMHO hide the underlying storage media.
Best regards, Stefano