TS-4900 EMMC: Difference between revisions
(Fixed typo) |
No edit summary |
||
Line 3: | Line 3: | ||
The eMMC module has a similar concern by default to SD cards in that they should not be powered down during a write/erase cycle. However, this eMMC module includes support for setting a fuse for a "Write Reliability" mode, and a "psuedo SLC" mode. With both of these enabled then any writes will be atomic to 512B. If a sector is being written during a power loss, a block is guaranteed to have either the old or new data. Even in cases where the wrong data is present on the next boot, fsck is able to deal with the older data being present in a 512B block. The downsides to setting these modes are that it will about half the size of the eMMC module to 1.759Gib by default, and write speed will be slower. | The eMMC module has a similar concern by default to SD cards in that they should not be powered down during a write/erase cycle. However, this eMMC module includes support for setting a fuse for a "Write Reliability" mode, and a "psuedo SLC" mode. With both of these enabled then any writes will be atomic to 512B. If a sector is being written during a power loss, a block is guaranteed to have either the old or new data. Even in cases where the wrong data is present on the next boot, fsck is able to deal with the older data being present in a 512B block. The downsides to setting these modes are that it will about half the size of the eMMC module to 1.759Gib by default, and write speed will be slower. | ||
The mmc-utils package is used to enable these modes. | The mmc-utils package is used to enable these modes. First determine the exact size of the flash you're using: | ||
<source lang=bash> | |||
mmc extcsd read /dev/mmcblk2 | grep MAX_ENH_SIZE_MULT -A 1 | |||
</source> | |||
<pre> | |||
Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x0001cd | |||
i.e. 1888256 KiB | |||
</pre> | |||
So in this case, 1888256 KiB is the max size of the enhanced partition. This number should be used for the enh_area command: | |||
<source lang=bash> | <source lang=bash> | ||
mmc write_reliability set -n 0 /dev/mmcblk2 | mmc write_reliability set -n 0 /dev/mmcblk2 | ||
mmc enh_area set -y 0 | mmc enh_area set -y 0 1888256 /dev/mmcblk2 | ||
</source> | </source> | ||
{{Warning|Setting either of those modes is permanent and using the wrong value it is possible to essentially brick eMMC which will not be covered by the warranty. Evaluation units with fuses set will not be accepted through returns.}} | {{Warning|Setting either of those modes is permanent and using the wrong value it is possible to essentially brick eMMC which will not be covered by the warranty. Evaluation units with fuses set will not be accepted through returns.}} | ||
After this is run, reboot the board. On all future boots the eMMC will be detected at the smaller size. | After this is run, reboot the board. On all future boots the eMMC will be detected at the smaller size. |
Revision as of 16:51, 7 November 2016
This board includes a Micron eMMC module with builds that have "4096F" in the part number. Our off the shelf builds are 4GiB, but up to 64GiB are available for larger builds. The eMMC flash appears to Linux as an SD card at /dev/mmcblk2. Our default programming will include one partition programmed with our Yocto image.
The eMMC module has a similar concern by default to SD cards in that they should not be powered down during a write/erase cycle. However, this eMMC module includes support for setting a fuse for a "Write Reliability" mode, and a "psuedo SLC" mode. With both of these enabled then any writes will be atomic to 512B. If a sector is being written during a power loss, a block is guaranteed to have either the old or new data. Even in cases where the wrong data is present on the next boot, fsck is able to deal with the older data being present in a 512B block. The downsides to setting these modes are that it will about half the size of the eMMC module to 1.759Gib by default, and write speed will be slower.
The mmc-utils package is used to enable these modes. First determine the exact size of the flash you're using:
mmc extcsd read /dev/mmcblk2 | grep MAX_ENH_SIZE_MULT -A 1
Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x0001cd i.e. 1888256 KiB
So in this case, 1888256 KiB is the max size of the enhanced partition. This number should be used for the enh_area command:
mmc write_reliability set -n 0 /dev/mmcblk2
mmc enh_area set -y 0 1888256 /dev/mmcblk2
WARNING: | Setting either of those modes is permanent and using the wrong value it is possible to essentially brick eMMC which will not be covered by the warranty. Evaluation units with fuses set will not be accepted through returns. |
After this is run, reboot the board. On all future boots the eMMC will be detected at the smaller size.