Lines Matching refs:Interface
122 static void SysaceDumpRegisters(struct _Sac *Interface) in SysaceDumpRegisters() argument
238 printf("Sysace@%p:\n", Interface); in SysaceDumpRegisters()
239 printf("\tTag %x\n", Interface->Tag); in SysaceDumpRegisters()
240 SysacePrintRegister(&Control_Names, Interface->Control); in SysaceDumpRegisters()
241 printf("\tBUSMODEREG %x\n", Interface->BUSMODEREG); in SysaceDumpRegisters()
242 SysacePrintRegister(&STATUS_Names, Interface->STATUS); in SysaceDumpRegisters()
243 SysacePrintRegister(&ERRORREG_Names, Interface->ERRORREG); in SysaceDumpRegisters()
244 printf("\tCFGLBAREG %x\n", Interface->CFGLBAREG); in SysaceDumpRegisters()
245 printf("\tMPULBAREG %x\n", Interface->MPULBAREG); in SysaceDumpRegisters()
246 printf("\tVERSIONREG %x\n", Interface->VERSIONREG); in SysaceDumpRegisters()
247 printf("\tSECCNTCMDREG %x = %s cnt=%d\n", Interface->SECCNTCMDREG, in SysaceDumpRegisters()
248 CommandNames[(Interface->SECCNTCMDREG >> 8)&7], in SysaceDumpRegisters()
249 Interface->SECCNTCMDREG & SAC_SECCCNT); in SysaceDumpRegisters()
250 SysacePrintRegister(&CONTROLREG_Names, Interface->CONTROLREG); in SysaceDumpRegisters()
251 SysacePrintRegister(&FATSTATREG_Names, Interface->FATSTATREG); in SysaceDumpRegisters()
260 static int SysaceInitialize(struct _Sac *Interface) in SysaceInitialize() argument
266 Interface->Control = SAC_RST; in SysaceInitialize()
270 Interface->BUSMODEREG = SAC_MODE16 | (SAC_MODE16 << 8); in SysaceInitialize()
274 Control = Interface->Control; in SysaceInitialize()
275 BusMode = Interface->BUSMODEREG; in SysaceInitialize()
280 Interface->Control = Control | SAC_BUS16; in SysaceInitialize()
281 Interface->Control = Interface->Control & ~SAC_BUS8; in SysaceInitialize()
285 Interface->Control = Control | SAC_BUS8; in SysaceInitialize()
286 Interface->Control = Interface->Control & ~SAC_BUS16; in SysaceInitialize()
290 BusMode = Interface->BUSMODEREG; in SysaceInitialize()
291 Control = Interface->Control; in SysaceInitialize()
297 Interface->Control &= ~SAC_INTMASK; in SysaceInitialize()
299 Control = Interface->CONTROLREG; in SysaceInitialize()
301 Interface->CONTROLREG = Control; in SysaceInitialize()
302 Interface->CONTROLREG = Control & ~SAC_RESETIRQ; in SysaceInitialize()
305 Interface->MPULBAREG = 0; in SysaceInitialize()
312 static int SysaceLock(struct _Sac *Interface) in SysaceLock() argument
319 Status = Interface->STATUS; in SysaceLock()
325 Interface->CONTROLREG |= SAC_LOCKREQ; in SysaceLock()
330 Status = Interface->STATUS; in SysaceLock()
340 SysaceDumpRegisters(Interface); in SysaceLock()
346 static int SysaceUnlock(struct _Sac *Interface) in SysaceUnlock() argument
353 Interface->CONTROLREG &= ~SAC_CFGRESET; in SysaceUnlock()
357 Status = Interface->STATUS; in SysaceUnlock()
363 Interface->CONTROLREG &= ~SAC_LOCKREQ; in SysaceUnlock()
368 Status = Interface->STATUS; in SysaceUnlock()
378 SysaceDumpRegisters(Interface); in SysaceUnlock()
406 static int SysaceStartCommand(struct _Sac *Interface, in SysaceStartCommand() argument
415 if (!SysaceLock(Interface)) { in SysaceStartCommand()
422 if (! (Interface->STATUS & SAC_CFDETECT)) { in SysaceStartCommand()
424 DBGME(2,printf("Sysace:: no media (st=%x)\n",Interface->STATUS)); in SysaceStartCommand()
430 if (!SysaceReadyForCommand(Interface)) { in SysaceStartCommand()
431 DBGME(3,printf("Sysace:: not ready (st=%x)\n",Interface->STATUS)); in SysaceStartCommand()
432 SysaceDumpRegisters(Interface); in SysaceStartCommand()
438 Interface->MPULBAREG = Lba; in SysaceStartCommand()
439 Interface->SECCNTCMDREG = (uint16_t)(Command | (nSectors & SAC_SECCCNT)); in SysaceStartCommand()
446 Interface->CONTROLREG |= SAC_CFGRESET; in SysaceStartCommand()
453 static void SysAce_isr ( struct _Sac *Interface ) in SysAce_isr() argument
459 SysaceIntoff(Interface); in SysAce_isr()
461 Control = Interface->CONTROLREG & (~(SAC_RESETIRQ|SAC_INTERRUPTS)); in SysAce_isr()
462 Interface->CONTROLREG = Control | SAC_RESETIRQ; in SysAce_isr()
463 Interface->CONTROLREG = Control; in SysAce_isr()
466 static int SysAce_wait(struct _Sac *Interface) in SysAce_wait() argument
470 if (Interface->STATUS & SAC_DATABUFRDY) { in SysAce_wait()
471 SysAce_isr(Interface); in SysAce_wait()
485 static int SysAce_read(struct _Sac * Interface, char *Buffer, uint32_t StartSector, uint32_t nBlock… in SysAce_read() argument
510 SysaceInton(Interface); in SysAce_read()
511 sc = SysaceStartCommand(Interface, in SysAce_read()
518 sc = SysAce_wait(Interface); in SysAce_read()
532 Status = Interface->STATUS; in SysAce_read()
543 Data32 = Interface->DATABUFREG[0]; in SysAce_read()
554 SysaceDumpRegisters(Interface); in SysAce_read()
571 SysaceUnlock(Interface); in SysAce_read()