Enable TRIM on eMMC
As there is ONLY eMMC and no sdcard support one must take care of the expensive eMMC card. Please enable trim for meson-gx-mmc. Trimming works fine in uboot with "mmc erase" command (one has to erase the whole card or manually know which blocks to erase) but for linux the mmc controller driver must tell the OS that it supports it.
Linux even correctly reports /sys/devices/platform/soc/d0000000.apb/d0074000.mmc/mmc_host/mmc0/mmc0:0001/erase_size and /sys/devices/platform/soc/d0000000.apb/d0074000.mmc/mmc_host/mmc0/mmc0:0001/preferred_erase_size but the controller driver does not enable trimming.
Change needed:
In kernel source drivers/mmc/host/meson-gx-mmc.c in section mmc->caps declare MMC_CAP_ERASE.
Linux even correctly reports /sys/devices/platform/soc/d0000000.apb/d0074000.mmc/mmc_host/mmc0/mmc0:0001/erase_size and /sys/devices/platform/soc/d0000000.apb/d0074000.mmc/mmc_host/mmc0/mmc0:0001/preferred_erase_size but the controller driver does not enable trimming.
Change needed:
In kernel source drivers/mmc/host/meson-gx-mmc.c in section mmc->caps declare MMC_CAP_ERASE.
Comments
lsblk -D
Example output on RPi:
4M corresponds to: