Skip to content

Conversation

@benwynn
Copy link

@benwynn benwynn commented Oct 29, 2025

The current code only calculates sectors for SDHC, with a max of 32G
The new code will calculate sectors for SDXC, with a max of 2T

C_SIZE is 22 bits[69:48] and the high 2 bits of csd[7] are required
to be 0, currently, so i'm not masking them off.

The max value for C_SIZE is 0x3FFEFF, so C_SIZE+1*1024 is a 32-bit number.

The current code only calculates sectors for SDHC, with a max of 32G
The new code will calculate sectors for SDXC, with a max of 2T

C_SIZE is 22 bits[69:48] and the high 2 bits of csd[7] are required
to be 0, currently, so i'm not masking them off.

The max value for C_SIZE is 0x3FFEFF, so C_SIZE+1*1024 is a 32-bit number.

Signed-off-by: Ben Wynn <[email protected]>
@benwynn benwynn changed the title drivers/storage/sdcard: updating sector calculation for CSD v2.0 sdcard: Updating sector calculation for SDXC. Oct 29, 2025
@benwynn
Copy link
Author

benwynn commented Oct 30, 2025

will fix issue #1053

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant