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)
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.
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).
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.
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
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.