mirror of
				https://github.com/acidanthera/audk.git
				synced 2025-10-31 19:23:54 +01:00 
			
		
		
		
	EmbeddedPkg/MmcDxe: Removed redundant CMD12 calls from MMC
Command 12 - Stop transmission (ends read or write). Normally only needed for streaming transfers or after error. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14525 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		
							parent
							
								
									842b02d87f
								
							
						
					
					
						commit
						9532373b1d
					
				| @ -486,6 +486,22 @@ MmcDetectCard ( | |||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | EFI_STATUS | ||||||
|  | MmcStopTransmission ( | ||||||
|  |   EFI_MMC_HOST_PROTOCOL     *MmcHost | ||||||
|  |   ) | ||||||
|  | { | ||||||
|  |   EFI_STATUS              Status; | ||||||
|  |   UINT32                  Response[4]; | ||||||
|  |   // Command 12 - Stop transmission (ends read or write)
 | ||||||
|  |   // Normally only needed for streaming transfers or after error.
 | ||||||
|  |   Status = MmcHost->SendCommand (MmcHost, MMC_CMD12, 0); | ||||||
|  |   if (!EFI_ERROR (Status)) { | ||||||
|  |     MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1b, Response); | ||||||
|  |   } | ||||||
|  |   return Status; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| #define MMCI0_BLOCKLEN 512 | #define MMCI0_BLOCKLEN 512 | ||||||
| #define MMCI0_TIMEOUT  10000 | #define MMCI0_TIMEOUT  10000 | ||||||
| 
 | 
 | ||||||
| @ -598,6 +614,7 @@ MmcIoBlocks ( | |||||||
|       Status = MmcHost->ReadBlockData (MmcHost, Lba, This->Media->BlockSize, Buffer); |       Status = MmcHost->ReadBlockData (MmcHost, Lba, This->Media->BlockSize, Buffer); | ||||||
|       if (EFI_ERROR (Status)) { |       if (EFI_ERROR (Status)) { | ||||||
|         DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Read Block Data and Status = %r\n", Status)); |         DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Read Block Data and Status = %r\n", Status)); | ||||||
|  |         MmcStopTransmission (MmcHost); | ||||||
|         return Status; |         return Status; | ||||||
|       } |       } | ||||||
|       Status = MmcNotifyState (MmcHostInstance, MmcProgrammingState); |       Status = MmcNotifyState (MmcHostInstance, MmcProgrammingState); | ||||||
| @ -610,16 +627,11 @@ MmcIoBlocks ( | |||||||
|       Status = MmcHost->WriteBlockData (MmcHost, Lba, This->Media->BlockSize, Buffer); |       Status = MmcHost->WriteBlockData (MmcHost, Lba, This->Media->BlockSize, Buffer); | ||||||
|       if (EFI_ERROR (Status)) { |       if (EFI_ERROR (Status)) { | ||||||
|         DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Write Block Data and Status = %r\n", Status)); |         DEBUG ((EFI_D_BLKIO, "MmcIoBlocks(): Error Write Block Data and Status = %r\n", Status)); | ||||||
|  |         MmcStopTransmission (MmcHost); | ||||||
|         return Status; |         return Status; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // Command 12 - Stop transmission (ends read)
 |  | ||||||
|     Status = MmcHost->SendCommand (MmcHost, MMC_CMD12, 0); |  | ||||||
|     if (!EFI_ERROR (Status)) { |  | ||||||
|       MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R1b, Response); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     // Command 13 - Read status and wait for programming to complete (return to tran)
 |     // Command 13 - Read status and wait for programming to complete (return to tran)
 | ||||||
|     Timeout = MMCI0_TIMEOUT; |     Timeout = MMCI0_TIMEOUT; | ||||||
|     CmdArg = MmcHostInstance->CardInfo.RCA << 16; |     CmdArg = MmcHostInstance->CardInfo.RCA << 16; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user