SD Fun with Pinebook Pro

lots of SD failures with pinebook pro. trying to slow it down to see if it can be made stable. this may also be what is contributing to the “choppy” effects of things. i did not notice this until i looked for it. dmesg and syslog were full of SD errors.

Instructions per Dragan Simic (dsimic) via Pine64 IRC

cp -av /boot/dtbs/rockchip/rk3399-pinebook-pro.dtb /boot/dtbs/rockchip/rk3399-pinebook-pro.dtb.orig
cp -av /boot/dtbs/rockchip/rk3399-pinebook-pro.dtb.orig $HOME

dtc -I dtb -O dts -@ -o rk3399-pinebook-pro.dts rk3399-pinebook-pro.dtb.orig

(please ignore all the warnings you’ll get when running “dtc”) now we need to edit the decompiled .dts file, to make the desired changes

replace “sd-uhs-sdr104” with “sd-uhs-ddr50” in the “mmc@fe320000” node

(you can also replace it with “sd-uhs-sdr50” in the second iteration, if the card still misbehaves)
as a note, this is the above-mentioned “sd-uhs-sdr104” line in the original source code:

https://elixir.bootlin.com/linux/latest/source/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts#L948

now it’s needed to compile the .dts file back into the .dtb file, using the following commands:

dtc -I dts -O dtb -o rk3399-pinebook-pro.dtb rk3399-pinebook-pro.dts

cp -av rk3399-pinebook-pro.dtb /boot/dtbs/rockchip/rk3399-pinebook-pro.dtb

(again, please ignore all the warnings you’ll get when running “dtc”)
at that point, rebooting the PBP will make the changes take effect, and it will be possible to see how the microSD card performs

as a reminder, please send me the output of “dmesg | grep -i mmc” in the new state
of course, there’s backup in /boot/dtbs/rockchip/rk3399-pinebook-pro.dtb.orig you can always use to revert the changes back

sd-uhs-ddr50 was a fail
sd-uhs-sdr50 was used instead

sd-uhs-sdr50 seems to be working so far. going to test it more in order to ensure that different types of writes work as well as different types of SDs

Testing syntax:
dd if=/dev/zero of=test.001 bs=1M count=16384 oflag=direct status=progress
i only care about write speed. the assumption is read will be faster. writes are where these have been failing anyways.

001: Samsung EVO A2 512GB (original testing) (~36MB/s)
002: Samsung EVO A1 64GB (~17.6MB/s)
003: Sandisk Ultra A1 32GB (~18.6MB/s)
004: Sandisk Ultra HC 1 32GB (~9MB/s)
(004 seems to be especially slow / old this one had the circle with a 10 inside which i vaguely remember being the typical sustained write speed)

those are the only four i had laying around. the change in dtb to limit with sdr50 seems to work so far. i will test with writing a bunch of files to the 512GB (this would fail without doubt).

all files copied without issue. didn’t see anything awkward and data seems ok. last dmesg.

this was booting without sd in slot, then putting it in sd slot. sorry for the double take but it is hard to make it click into place so it jumped out on me.