- if (send_cmd(CMD8, 0x1AA) == 1) { /* SDv2? */
- for (n = 0; n < 4; n++) ocr[n] = spi_rcvr(); /* Get trailing return value of R7 resp */
- if (ocr[2] == 0x01 && ocr[3] == 0xAA) { /* The card can work at vdd range of 2.7-3.6V */
- while (get_timer(timer) < MMC_INIT_TO && send_cmd(ACMD41, 1UL << 30)); /* Wait for leaving idle state (ACMD41 with HCS bit) */
- if (get_timer(timer) < MMC_INIT_TO && send_cmd(CMD58, 0) == 0) { /* Check CCS bit in the OCR */
- for (n = 0; n < 4; n++) ocr[n] = spi_rcvr();
+ if (send_cmd(drv, CMD8, 0x1AA) == 1) { /* SDv2? */
+ /* Get trailing return value of R7 resp */
+ for (n = 0; n < 4; n++)
+ ocr[n] = spi_rcvr();
+ if (ocr[2] == 0x01 && ocr[3] == 0xAA) {
+ /* The card can work at vdd range of 2.7-3.6V */
+ while (get_timer(timer) < MMC_INIT_TO
+ && send_cmd(drv, ACMD41, 1UL << 30))
+ ; /* Wait for leaving idle state (ACMD41 with HCS bit) */
+ if (get_timer(timer) < MMC_INIT_TO && send_cmd(drv, CMD58, 0) == 0) {
+ /* Check CCS bit in the OCR */
+ for (n = 0; n < 4; n++)
+ ocr[n] = spi_rcvr();