sdmmc: refactor ICR/OCR defines

And others.
Also add some debug prints and move ocr argument to get op cond.
This commit is contained in:
CTCaer
2026-06-09 06:57:53 +03:00
parent 07f9043bcd
commit d873ebf0cd
2 changed files with 122 additions and 78 deletions

View File

@@ -49,14 +49,33 @@
#define SD_APP_GET_CER_RES1 48 /* adtc R1 */
#define SD_APP_CHANGE_SECURE_AREA 49 /* adtc R1b */
/* ICR bit definitions */
#define SD_ICR_PATTERN 0xAA /* Check pattern */
#define SD_ICR_VHS_27_36 (1U << 8) /* VDD IO voltage 2.7 ~ 3.6 */
#define SD_ICR_VHS_170_195 (2U << 8) /* VDD IO voltage 1.7 ~ 1.95 (LVS-only) */
#define SD_ICR_PCIE (1U << 12) /* PCIE availability */
#define SD_ICR_PCIE_12 (1U << 13) /* PCIE IO voltage 1.2 */
/* OCR bit definitions */
#define SD_OCR_VDD_18 (1U << 7) /* VDD voltage 1.8 */
#define SD_VHS_27_36 (1U << 8) /* VDD voltage 2.7 ~ 3.6 */
#define SD_OCR_VDD_32_33 (1U << 20) /* VDD voltage 3.2 ~ 3.3 */
#define SD_OCR_VDD_170_195 (1U << 7) /* VDD IO voltage 1.7 ~ 1.95 (LVS-only or support) */
#define SD_OCR_VDD_27_28 (1U << 15) /* VDD IO voltage 2.7 ~ 2.8 */
#define SD_OCR_VDD_28_29 (1U << 16) /* VDD IO voltage 2.8 ~ 2.9 */
#define SD_OCR_VDD_29_30 (1U << 17) /* VDD IO voltage 2.9 ~ 3.0 */
#define SD_OCR_VDD_30_31 (1U << 18) /* VDD IO voltage 3.0 ~ 3.1 */
#define SD_OCR_VDD_31_32 (1U << 19) /* VDD IO voltage 3.1 ~ 3.2 */
#define SD_OCR_VDD_32_33 (1U << 20) /* VDD IO voltage 3.2 ~ 3.3 */
#define SD_OCR_VDD_33_34 (1U << 21) /* VDD IO voltage 3.3 ~ 3.4 */
#define SD_OCR_VDD_34_35 (1U << 22) /* VDD IO voltage 3.4 ~ 3.5 */
#define SD_OCR_VDD_35_36 (1U << 23) /* VDD IO voltage 3.5 ~ 3.6 */
#define SD_OCR_S18R (1U << 24) /* 1.8V switching request */
#define SD_ROCR_S18A SD_OCR_S18R /* 1.8V switching accepted by card */
#define SD_OCR_XPC (1U << 28) /* SDXC power control */
#define SD_OCR_CCS (1U << 30) /* Card Capacity Status */
#define SD_OCR_S18A SD_OCR_S18R /* 1.8V switching accepted by card */
#define SD_OCR_HO2T (1U << 27) /* SDUC support */
#define SD_OCR_CO2T SD_OCR_HO2T /* SDUC Status */
#define SD_OCR_XPC (1U << 28) /* SDXC power control - Max Performance */
#define SD_OCR_FB (1U << 29) /* eSD Fast Boot Support */
#define SD_OCR_UHSII (1U << 29) /* UHS-II Card Status */
#define SD_OCR_HCS (1U << 30) /* Host Capacity Support */
#define SD_OCR_CCS SD_OCR_HCS /* Card Capacity Status */
#define SD_OCR_BUSY (1U << 31) /* Card Power up Status */
/*