au-ts / sddf

A collection of interfaces, libraries and tools for writing device drivers for seL4 that allow accessing devices securely and with low overhead.
Other
17 stars 14 forks source link

Add support for SDSC (≤2GiB) SD cards #224

Closed midnightveil closed 1 week ago

midnightveil commented 2 weeks ago

Tested on on a 2GiB SDSC Card, matches with mmc-utils on Linux.

CSD Version: 0
READ_BL_LEN: a
C_SIZE: eaf
C_SIZE_MULT: 7
uSDHC DRIVER|ERROR: Card size (blocks): 481280
Hello from client
[   0] = 0x3
[   1] = 0x4
[   2] = 0x5
[   3] = 0x6
[ 508] = 0xff
[ 509] = 0x0
[ 510] = 0x1
[ 511] = 0x2
[ 512] = 0x3
[ 513] = 0x4
[ 514] = 0x5
[ 515] = 0x6
[ 516] = 0x7
[4092] = 0xff
[4093] = 0x0
[4094] = 0x1
[4095] = 0x2
[4096] = 0x3
[4097] = 0x4
[NW-3] = 0x0
[NW-2] = 0x1
[NWB-] = 0x2

[NWB=] = 0x0
[NWB+] = 0x0
[NW++] = 0x0
[NR-2] = 0x0
[NR-1] = 0x0

[NRB=] = 0x3
[NR+1] = 0x4
[NR+2] = 0x5
[NR+3] = 0x6
Client read/write data is correct!

In theory, should also work on SDXC (32GiB -> 2TiB) and SDUC (> 2TiB), though we don't have cards to test.

Waiting on #206 to merge first. Part of #187.