Question about sd-card speed

It works!!!

user@starfive:~$ sudo hdparm --direct -t /dev/mmcblk1

/dev/mmcblk1:
 Timing O_DIRECT disk reads: 218 MB in  3.00 seconds =  72.64 MB/sec

Btw seems JH7110’s GPIO cannot handle faster io speed. If I set dts to HS400 mode, speed would be extremely slow.

6 Likes

Nicely done!! I nearly lost the hope that VF2 is faulty.
Which part of it can I take to rebuild? I’m too thirsty for this.

Also it would be cool to share this with U-Boot aswell, as it suffers same problem I think (none of my Uclass microsds which read at least 60~80M/s reach 20M/s in it with mmc read)

This branch is based on sf’s upstream branch (6.3rc+under review patches); only the newest 4 commits are needed (remember there are differences between downstream kernel and this, more commits are needed to port if you want to run it on downstream kernel)

2 Likes

This only works for emmc, SD card doesn’t have 1.8v power rail due to PMIC lacks enough rails for that. 1.8v is a must to reach higher speed.

2 Likes

I’m half wondering if someone at StarFive made a decision for maximum compatibility to (temporarily) limit performance. Get it working now, for as many people as possible, and then tune for performance at some later date.

You mean that microSD’s VDD is 3.3v only right now?

1 Like

If you look at page 2 of the schematic the 3.3V supply (DCDC1) for the SD card is shared with USB 3 (VL805), MIPI LCD, 3.3V supply for the eMMC, MIPI DSI, MIPI CSI and 40 pin GPIO (so it can not be changed to 1.8 volts without disabling a lot of functionality). But the eMMC also has a dedicated connection (ALDO4 AKA VDD_SD AKA VDD1833_SD0 - page 15) from the AXP15060 PMIC (power management integrated circuit), that can have it’s voltage modified (0.7-3.3V @ 300mA).

3 Likes

From what I’m looking at I wonder if some sort of hardware hack is possible. Any ideas?

1 Like

A bodge wire, might be possible in theory, but from where to where is the question (and you will probably end up creating an unshielded loop antenna which will radiate unwanted RF at multiple odd harmonics of the clock frequency). And what functionality would potentially be sacrificed is always the other question. I’ve not checked but I’m guessing that you need 300mA @ 1.8v. So when the MicroSD card is active, what other functionality would never be active that it could share a common voltage supply. Or what function could be fully disabled to supply that 1.8 volts @ 300mA to the MicroSD.

I’m looking at the board and thinking it is way beyond my ability to solder. My first idea would be to de-solder one of the 0.5mm pins (VDD: pin 4 on J10 a TF-15X15) on the MicroSD cardholder slot and bending it away from the PCB pointing to into the air for one end of the bodge (and some Kapton tape underneath the pin to prevent a short, oh and a decoupling capacitor and a bypass capacitor between pin 4 VDD and pin 6 VSS). But then you are faced with the problem where to go next.

It would be high risk.

3 Likes

Actually, vqmmc. SD/MMC device need two power supply, one is vmmc, for card’s core power. Another is vqmmc, for data line’s work voltage. Only vqmmc could work at both 3.3/1.8v. VMMC is static 3.3v

4 Likes

From published schematic I get it that sdcard sits in GPIO4 Domain Operating Voltage=1.8V/3.3V power group. There’s also HDMI, GMAC and I2C. You’re right about eMMC, it got SDIO0 Domain completely dedicated to it. But since GPIO4 says it’s compatible with 1.8v and 3.3v what will happen if it’ll go 1.8v (vqmmc)? Assuming I don’t use other peripherals of that group. Am I miss something?

SD card slot is using gpio mux to connect rather than direct io connected to controller. This would decrease maximum IO speed. You can try that, but I’m not sure how much improvement it would get.

Iirc I2C is used during boot? Maybe that is just for the video subsystem. I can’t imagine that it would work well, if at all.

Anyway, to repeat what @Stat_headcrabed said, you need to drop just one supply pin to 1.8, another needs to stay at 3.3. The circuitry simply doesn’t support that.