More detailed print on ahci error
This commit is contained in:
		
							parent
							
								
									72fe60b6a8
								
							
						
					
					
						commit
						478bc20b85
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		|  | @ -78,6 +78,8 @@ impl HbaPort { | |||
| 
 | ||||
|         self.clb.write(clb.physical() as u64); | ||||
|         self.fb.write(fb.physical() as u64); | ||||
|         let is = self.is.read(); | ||||
|         self.is.write(is); | ||||
| 
 | ||||
|         for i in 0..32 { | ||||
|             let cmdheader = &mut clb[i]; | ||||
|  | @ -272,11 +274,13 @@ impl HbaPort { | |||
| 
 | ||||
|             while self.ci.readf(1 << slot) { | ||||
|                 if self.is.readf(HBA_PORT_IS_TFES) { | ||||
|                     println!("IS_TFES set in CI loop TFS {:X} SERR {:X}", self.tfd.read(), self.serr.read()); | ||||
|                     return Err(Error::new(EIO)); | ||||
|                 } | ||||
|             } | ||||
| 
 | ||||
|             if self.is.readf(HBA_PORT_IS_TFES) { | ||||
|                 println!("IS_TFES set after CI loop TFS {:X} SERR {:X}", self.tfd.read(), self.serr.read()); | ||||
|                 return Err(Error::new(EIO)); | ||||
|             } | ||||
| 
 | ||||
|  | @ -306,6 +310,13 @@ pub struct HbaMem { | |||
|     pub ports: [HbaPort; 32], // 0x100 - 0x10FF, Port control registers
 | ||||
| } | ||||
| 
 | ||||
| impl HbaMem { | ||||
|     pub fn reset(&mut self) { | ||||
|         self.ghc.writef(1, true); | ||||
|         while self.ghc.readf(1) {} | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| #[repr(packed)] | ||||
| pub struct HbaPrdtEntry { | ||||
|     dba: Mmio<u64>, // Data base address
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jeremy Soller
						Jeremy Soller