[PATCH] hw/sd: Correct CMD58's R3 response "in idle state" bit in SPI-mode

2022-01-25 Thread frank . chang
From: Frank Chang In SPI-mode, CMD58 returns R3 response with the format: 39 32 31 0 ++ +---+ | R1 | |OCR| ++ +---+ Where R1

Re: [PATCH] hw/sd: Correct the CURRENT_STATE bits in SPI-mode response

2022-01-23 Thread Frank Chang
On Tue, Jan 18, 2022 at 10:35 AM wrote: > From: Frank Chang > > In SPI-mode, type B ("cleared on valid command") clear condition is not > supported, and as the "In idle state" bit in SPI-mode has type A > ("according to current state") clear condi

[PATCH] hw/sd: Correct card status clear conditions in SPI-mode

2022-01-23 Thread frank . chang
From: Frank Chang In SPI-mode, unlike SD-mode, card status bits: ILLEGAL_COMMAND and COM_CRC_ERROR have type C ("cleared by read") clear conditions. Also, type B ("cleared on valid command") clear condition is not supported in SPI-mode. As the "In idle state&qu

[PATCH] hw/sd: Correct the CURRENT_STATE bits in SPI-mode response

2022-01-17 Thread frank . chang
From: Frank Chang In SPI-mode, type B ("cleared on valid command") clear condition is not supported, and as the "In idle state" bit in SPI-mode has type A ("according to current state") clear condition, the CURRENT_STATE bits in an SPI-mode response should be

[PATCH v2] hw/sd: Add SDHC support for SD card SPI-mode

2021-12-28 Thread frank . chang
From: Frank Chang In SPI-mode, SD card's OCR register: Card Capacity Status (CCS) bit is not set to 1 correclty when the assigned SD image size is larger than 2GB (SDHC). This will cause the SD card to be indentified as SDSC incorrectly. CCS bit should be set to 1 if we are using SDHC. Als

[PATCH] hw/sd: Add SDHC support for SD card SPI-mode

2021-12-27 Thread frank . chang
From: Frank Chang In SPI-mode, SD card's OCR register: Card Capacity Status (CCS) bit is not set to 1 correclty when the assigned SD image size is larger than 2GB (SDHC). This will cause the SD card to be indentified as SDSC incorrectly. CCS bit should be set to 1 if we are using SDHC. Als