ophub / amlogic-s9xxx-armbian

Support for Armbian in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x2, s912, s905d, s905x, s905w, s905, s905l, rk3588, rk3568, rk3399, rk3328, h6, etc.
GNU General Public License v2.0
5.41k stars 1.72k forks source link

Uhs-i mode for microsd on s905x2 #2294

Closed serj-47 closed 1 month ago

serj-47 commented 2 months ago

S095x2, X2Cube, 6.1.84, Bookworm.

How do I enable uhs-i high bandwidth mode for my microsd card? I checked the current parameters of the memory devices in the kernel, and it shows that the uhs-i mode is used only for the built-in mmc2 memory, but not for my microsd mmc1. Thus, the read and write speeds of the MICROSD card in the tvbox do not exceed 20 and 10 MB/s, respectively, but when connecting the microsd card to a laptop, the speeds are much higher.

root@X2Cube:~# cat /sys/kernel/debug/mmc0/ios
clock:          100000000 Hz
actual clock:   99999999 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    5 (sd uhs SDR50)                                                 
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)

root@X2Cube:~# cat /sys/kernel/debug/mmc1/ios                                    
clock:          50000000 Hz
actual clock:   50000000 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      2 (4 bits)
timing spec:    2 (sd high-speed)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)

root@X2Cube:~# cat /sys/kernel/debug/mmc2/ios
clock:          200000000 Hz
actual clock:   199999997 Hz
vdd:            21 (3.3 ~ 3.4 V)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     2 (on)
bus width:      3 (8 bits)
timing spec:    9 (mmc HS200)
signal voltage: 1 (1.80 V)
driver type:    0 (driver type B)
ophub commented 2 months ago

Is the interface on your TV box using the same specifications as a computer? Are the test results in the Android system the same as on a computer?

serj-47 commented 2 months ago

Is the interface on your TV box using the same specifications as a computer? Are the test results in the Android system the same as on a computer?

I checked the read write speed of the microsd card in android, and there are about the same numbers as in armbian, i.e. reading 22MB/s, writing 15MB/s. I also checked the microsd on the computer and there are about the following figures: Write-40MB/s Read-70 MB/s. As for the interface on the laptop, it seems that this is not what I need, because ..kernel/debug/mmc0 contains very strange data..

LAPTOP:

cat /sys/kernel/debug/mmc0/ios
clock:          0 Hz
vdd:            0 (invalid)
bus mode:       2 (push-pull)
chip select:    0 (don't care)
power mode:     0 (off)
bus width:      0 (1 bits)
timing spec:    0 (legacy)
signal voltage: 0 (3.30 V)
driver type:    0 (driver type B)
lshw
*-pci:2
             description: PCI bridge
             product: Sunrise Point-LP PCI Express Root Port #9
             vendor: Intel Corporation
             physical id: 1d
             bus info: pci@0000:00:1d.0
             version: f1
             width: 32 bits
             clock: 33MHz
             capabilities: pci pciexpress msi pm normal_decode bus_master cap_list
             configuration: driver=pcieport
             resources: irq:122 ioport:5000(size=4096) memory:f1200000-f12fffff ioport:de900000(size=2097152)
           *-generic
                description: MMC Host
                product: RTS522A PCI Express Card Reader
                vendor: Realtek Semiconductor Co., Ltd.
                physical id: 0
                bus info: pci@0000:03:00.0
                logical name: mmc0
                version: 01
                width: 32 bits
                clock: 33MHz
                capabilities: pm msi pciexpress bus_master cap_list
                configuration: driver=rtsx_pci latency=0
                resources: irq:125 memory:f1200000-f1200fff
              *-device
                   description: SD Card
                   product: USD
                   vendor: Unknown (29)
                   physical id: 59b4
                   logical name: /dev/mmcblk0
                   version: 1.0
                   date: 09/2023
                   serial: 4497
                   size: 29GiB (31GB)
                   capabilities: sd partitioned partitioned:dos
                   configuration: logicalsectorsize=512 sectorsize=512 signature=255458ee
ophub commented 2 months ago

So, this is the read and write speed of the box