For MMC cards, add partitions found on the card as separate disk(9) devices. Don't do anything with RPMB partition for now.
Lots of code is copied almost 1:1 from the mmcsd.c in the old stack, credits Marius Strobl (marius@FreeBSD.org)
Differential D12762
Implement initial MMC partitions support for MMCCAM kibab on Oct 22 2017, 9:48 PM. Authored by Tags Referenced Files
Subscribers None
Details
For MMC cards, add partitions found on the card as separate disk(9) devices. Don't do anything with RPMB partition for now. Lots of code is copied almost 1:1 from the mmcsd.c in the old stack, credits Marius Strobl (marius@FreeBSD.org) Boot BBB: sdda1: MMC MMC02G 3.10 SN D685362C MFG 02/1997 by 254 0x004e (sdda1:sdhci_slot1:0:0:0): Partition type 'default', size 983547510784 (sdda1:sdhci_slot1:0:0:0): Partition type 'boot0', size 1048576 (sdda1:sdhci_slot1:0:0:0): Partition type 'boot1', size 1048576 (sdda1:sdhci_slot1:0:0:0): Partition type 'RPMB', size 131072
Diff Detail
Event TimelineComment Actions Well, IMO committing the partition identification code only with all the glory details yet to be done is premature, even for head. Comment Actions I have now implemented support for attaching partitions as disk(9) and switching them upon access. Thanks for the review! Comment Actions Generally better, but still quite a few TODOs.
Comment Actions Hi Marius, thank you very much for such a verbose review!
Comment Actions This looks OK-ish. There's still a fair amount of cut and paste going on, but that's no different than other drivers. There's a few things we can cleanup, but maybe in a separate commit.
Comment Actions Again better; at this point, I'm mainly concerned about:
Comment Actions Marius, Comment Actions Well, to get en par with the eMMC partition functionality in mmc(4), there still needs to be code added which actually does something with the extended user data area information and a way to create partitions. As for the later, adding such support to camcontrol(8) probably would be the more natural thing to do with CAM. But given that partitioning eMMC devices is a one-time-operation, I'd strongly suggest to just also add a Linux-compatible MMC IOCTL interface so mmc-utils can be continued to be used unless you want to risk to brick a couple of eMMC chips (besides, there are tutorials how to partition with mmc-utils). I'm okay with this patch getting committed as it currently is, though. |