0

I don't want to run U-boot and kernel from eMMC. Just want to access raw eMMC and perform some read/write cycle tests. Can we access the eMMC by writing the application layer?

Thanks,

2 Answers2

0

Yes, if you load your filesystem as a ramdisk and then use that, you can run performance tests on the eMMC. The kernel is already running in memory. The exact details on this will depend on things such as what SoC you are using.

Tom Rini
  • 2,058
  • 8
  • 11
0

eMMC software drivers are typically fairly complex, supporting multiple commands. So any tests will require a fairly large amount of software to be written (or borrowed) to get even basic read/write functionality.

uboot's emmc "core" driver is around 2.5k lines of code for example: https://github.com/ARM-software/u-boot/blob/master/drivers/mmc/mmc.c

and that's not including the device specific parts.

That's not taking into consideration that fact that booting from eMMC works differently. Or that eMMC could be running in different modes during different stages of operation. E.g. HS400 once full OS is running, but legacy mode in the bootloader.

So sure... it's certainly possible. But why? What's the end game?

Brian McFarland
  • 9,052
  • 6
  • 38
  • 56
  • 1
    We can not diagnostic the eMMC after boot is completed( Already up and running). My eMMC card is partition into 4 parts. Like U-boot, Part-A( rootfs-A), Part-B( Rooffs-B) and User data. Before it is up, we need to diagnosis the eMMC. What are the steps to complete the eMMC diagnostics at U-boot level. i.Mx8M platform. The end game like Write/read data to eMMC – user7850934 Mar 01 '22 at 08:47
  • If u-boot itself is read from eMMC (common on ARM SOCs), that means there's *either* an on-chip minimal bootloader that puts the eMMC into boot mode to read it -or- a 1st stage u-boot image (commonly called something like MLO / ULO) from a different device (commonly SPI-flash, USB, or UART). Either way: 1) Your operating system -should- still be able to perform raw eMMC device read/write operations, e.g. in linux using mmc-tools. 2) u-boot can still run diagnostics via the "mmc" command: https://u-boot.readthedocs.io/en/latest/usage/mmc.html – Brian McFarland Mar 04 '22 at 16:19
  • What "diagnostic" are you trying to run? Testing for failures? R/W performance? device part-num/size? Still not sure I understand your use case well enough to give a good answer. You may have better luck over on NXP i.MX8 forums or commercial support contacts rather than stack overflow. I don't know NXP part specifics all that well, but have had similar experience for TI OMAP family SOCs. – Brian McFarland Mar 04 '22 at 16:32
  • Linux kernel developers have developed mmc_test as a unit-testing module to test emmc and made it as a part of Linux kernel source code. I enabled CONFIG_MMC_TEST as a LKM. Followed below steps. Recompiled Kernel and generated Image . I am facinf one more issue as below while doing steps 1. #insmod mmc_test.ko 2. mount the debugfs if you don't mount for debugfs: #mount -t debugfs none /sys/kernel/debug 3. After mount, you can cat /sys/kernel/debug/mmc0/mmc0:0001/test Here I am not seen ' test ' File under above path and ' testlist ' file also not seen Thanks – user7850934 Mar 08 '22 at 12:15
  • Hi Brian, I want to perform R/W performance – user7850934 Mar 16 '22 at 04:06
  • For just read/write performance testing, you can just use dd on an unmounted partition or bonnie++ for a mounted filesystem. Tons of existing examples out there on the web. Just be careful with dd as it can wipe out partition tables & more if you point at the wrong device. – Brian McFarland Mar 18 '22 at 19:26