- command_t cmd;
- cyg_uint32 card_state = 0;
- cyg_uint32 transfer_status = 0;
- command_response_t response;
- cyg_uint32 card_address = (Card_rca << RCA_SHIFT);
-
- /* Configure CMD7 for MMC card */
- /* 16bit card address is expected as Argument */
- mxcmci_cmd_config(&cmd, CMD7, card_address, READ, RESPONSE_48,
- DATA_PRESENT_NONE, ENABLE, ENABLE);
-
- /* Sending the card from stand-by to transfer state */
- if (host_send_cmd(&cmd) == FAIL) {
- transfer_status = FAIL;
- diag_printf("Send CMD7 Failed.\n");
- } else {
-
- /* Configure CMD13 to read status of the card becuase CMD7 has R1b response */
- mxcmci_cmd_config(&cmd, CMD13, card_address, READ, RESPONSE_48,
- DATA_PRESENT_NONE, ENABLE, ENABLE);
-
- if (host_send_cmd(&cmd) == FAIL) {
- transfer_status = FAIL;
- diag_printf("Send CMD13 Failed.\n");
- } else {
- /* Read Command response */
- response.format = RESPONSE_48;
- host_read_response(&response);
-
- card_state = CURR_CARD_STATE(response.cmd_rsp0);
-
- if (card_state == TRAN) {
- transfer_status = SUCCESS;
-
- } else {
- diag_printf("card_state: 0x%x\n", card_state);
- transfer_status = FAIL;
- }
- }
-
- }
+ command_t cmd;
+ cyg_uint32 card_state = 0;
+ cyg_uint32 transfer_status = 0;
+ command_response_t response;
+ cyg_uint32 card_address = (Card_rca << RCA_SHIFT);
+
+ /* Configure CMD7 for MMC card */
+ /* 16bit card address is expected as Argument */
+ mxcmci_cmd_config(&cmd, CMD7, card_address, READ, RESPONSE_48,
+ DATA_PRESENT_NONE, ENABLE, ENABLE);
+
+ /* Sending the card from stand-by to transfer state */
+ if (host_send_cmd(&cmd) == FAIL) {
+ transfer_status = FAIL;
+ diag_printf("Send CMD7 Failed.\n");
+ } else {
+
+ /* Configure CMD13 to read status of the card becuase CMD7 has R1b response */
+ mxcmci_cmd_config(&cmd, CMD13, card_address, READ, RESPONSE_48,
+ DATA_PRESENT_NONE, ENABLE, ENABLE);
+
+ if (host_send_cmd(&cmd) == FAIL) {
+ transfer_status = FAIL;
+ diag_printf("Send CMD13 Failed.\n");
+ } else {
+ /* Read Command response */
+ response.format = RESPONSE_48;
+ host_read_response(&response);
+
+ card_state = CURR_CARD_STATE(response.cmd_rsp0);
+
+ if (card_state == TRAN) {
+ transfer_status = SUCCESS;
+
+ } else {
+ diag_printf("card_state: 0x%x\n", card_state);
+ transfer_status = FAIL;
+ }
+ }
+
+ }
+
+ return transfer_status;