Feature #39123
Add eMMC flash storage support
Description
Please add support to install FreeNAS to onboard eMMC flash storage.
Nowadays more and more device comes out with onboard eMMC storage for the OS.
eMMC is a family of NAND flash memories with control functionality such as ECC, wear leveling and bad-block management.
I did some research and here are my results:
For the initial installation of FreeNAS the drivers needs to be compiled into the kernel in order to show up the device in the installation menu. (Note: But after that they can be used and loaded as a kernel module in the System -> Tunables menu if needed.)
eMMC device needs the following kernel modules:
geom_flashmap.ko --> dependency for mmcsd.ko
mmc.ko --> dependency for mmcsd.ko
mmcsd.ko --> eMMC driver
sdhci.ko --> Base bus driver for eMMC device
sdhci_pci.ko --> PCI bus driver for eMMC device
To compile them into the kernel following lines needs to be added to the FREENAS.amd64 kernel config file:
- eMMC flash storage support
device mmc # dependency for mmcsd
device mmcsd # eMMC driver
device sdhci # Bus driver for eMMC device, it will add sdhci_pci and sdhci_acpi as well
geom_flashmap is already included in the kernel.
I have successfully compiled and tested it on the freenas/11.1-stable and freenas/11.2-stable branches as well.
I have also attached the dmesg file of my test system for review. The device showing up as mmcsd0
That's it! I hope i could help and you will implement my request in the next release.
Associated revisions
History
#1
Updated by Dru Lavigne over 2 years ago
- Assignee changed from Release Council to Alexander Motin
#2
Updated by Alexander Motin over 2 years ago
- Status changed from Unscreened to Screened
- Severity changed from New to Low
eMMC is still used only in small embedded devices, that is so far not a big marked for FreeNAS. But if price is not high, we could possibly add the support.
#3
Updated by Alexander Motin over 2 years ago
- Status changed from Screened to In Progress
- Target version changed from Backlog to 11.2-RC1
I've added SD/MMC stack into 11-stable branch. Will probably merge into 11.2-stable after BETA3. Alex, could you try some of following nightly builds to check whether it work on your hardware, since I think we have nothing to test it on.
#4
Updated by Alex Nagy over 2 years ago
- File disks.png disks.png added
- File wizard.png wizard.png added
- File install.jpg install.jpg added
The installation went flawlessly.
The output of "dmesg | grep mmc" is:
mmc0: <MMC/SD bus> on sdhci_pci0
mmc1: <MMC/SD bus> on sdhci_acpi0
mmcsd0: 31GB <MMCHC 032GE4 0.0 SN 137464FF MFG 12/2013 by 17 0x0000> at mmc0 200.0MHz/8bit/8192-block
mmcsd0boot0: 4MB partion 1 at mmcsd0
mmcsd0boot1: 4MB partion 2 at mmcsd0
mmcsd0rpmb: 4MB partion 3 at mmcsd0
mmc1: No compatible cards found on bus (No SD card attached to the built in card reader)
Output of "gpart show mmcsd0":
=> 40 61071280 mmcsd0 GPT (29G)
40 532480 1 efi (260M)
532520 60538800 2 freebsd-zfs (29G)
As you see eMMC devices have 3 default partitions, which are hardcoded into the device and they are can't be deleted or modified.
mmcsd0boot0: 4MB partion 1 at mmcsd0
mmcsd0boot1: 4MB partion 2 at mmcsd0
mmcsd0rpmb: 4MB partion 3 at mmcsd0 (Replay Protected Memory Block is where to store counters like a pin code failure counter on mobile devices)
These partitions are useless on FreeNAS because of theirs small size (on my 32GB eMMC they are 4MB small, but on my other device with smaller eMMC chip they are just 2MB). Therefore i would suggest to hide them from users to avoid any problem in the installer and in the middleware as well.
Till now I have found only 3 places where mmcsd0boot0 and mmcsd0boot1 are showing up.
1. In the installer where to choose destination media. Here we need only "mmcsd0".
2. WebUI -> Storage -> View disks (In Legacy and Angular UI as well)
3. In the Wizard. It didn't let me click on "Next" without configuring these devices, but if i try to do so, the small size of the devices occurs an error by formatting them.
Please see the attached pics.
#5
Updated by Alexander Motin over 2 years ago
Thanks. Good to hear that aside of few issues it works. Main concern that appeared in our internal discussions is how reliable are those eMMC's. How many rewrite cycles it survive, and so for how long will they live if not used as read-only medium?
#6
Updated by Alex Nagy over 2 years ago
Good question. But if you take it in consideration, that millions of cell phones are using eMMC storage and people taking 1000s of pics and deleting them, installing many-many apps and deleted them, and how many websites are opened daily on a cellphone (especially when you commute) where cache data are also stored and deleted...
I also have a 5 years old LG Nexus 5 which still performs very well.(only battery was replaced)
And also Microsoft has just released the new Surface Go with 64GB eMMC with Windows 10 on top of it.
I think these scenarios are more IO intensive than a FreeNAS system partition in HOME environment where syslog is also saved onto the Storage dataset.
But fix me if I'm wrong.
These chips have built in wear leveling and bad-block management, which helps you a lot if some cells go wrong. I think my 32GB one have enough buffer if that happens.
The more important is, who's the manufacturer of the chip and it's SLC/MLC or TLC inside? Mine is from Toshiba and japanese do not make shit :)
So i'm not worrying about that.
#7
Updated by Alexander Motin over 2 years ago
PR for 11.2-stable: https://github.com/freenas/build/pull/113
#8
Updated by Dru Lavigne over 2 years ago
- Subject changed from eMMC flash storage support to Add eMMC flash storage support
- Status changed from In Progress to Ready for Testing
- Needs Merging changed from Yes to No
#10
Updated by Bonnie Follweiler over 2 years ago
- Status changed from Ready for Testing to Passed Testing
- Needs QA changed from Yes to No
#11
Updated by Dru Lavigne over 2 years ago
- File deleted (
dmesg.txt)
#12
Updated by Dru Lavigne over 2 years ago
- Status changed from Passed Testing to Done
- Needs Doc changed from Yes to No