Thread: [Linux1394-cvslog] rev 816 - branches/linux-2.4
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-03-06 16:31:07
|
Author: bencollins Date: 2003-03-06 11:30:26 -0500 (Thu, 06 Mar 2003) New Revision: 816 Modified: branches/linux-2.4/ohci1394.c branches/linux-2.4/ohci1394.h Log: Fix logic for soft_reset. Noticed by Peter Yao. Also add some subdefs for HCControl reg. (backported from trunk) Modified: branches/linux-2.4/ohci1394.c ============================================================================== --- branches/linux-2.4/ohci1394.c (original) +++ branches/linux-2.4/ohci1394.c 2003-03-06 11:30:27.000000000 -0500 @@ -356,10 +356,10 @@ static void ohci_soft_reset(struct ti_ohci *ohci) { int i; - reg_write(ohci, OHCI1394_HCControlSet, 0x00010000); + reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_softReset); for (i = 0; i < OHCI_LOOP_COUNT; i++) { - if (reg_read(ohci, OHCI1394_HCControlSet) & 0x00010000) + if (!reg_read(ohci, OHCI1394_HCControlSet) & OHCI1394_HCControl_softReset) break; mdelay(1); } @@ -516,7 +516,7 @@ reg_write(ohci, OHCI1394_NodeID, 0x0000ffc0); /* Enable posted writes */ - reg_write(ohci, OHCI1394_HCControlSet, 0x00040000); + reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_postedWriteEnable); /* Clear link control register */ reg_write(ohci, OHCI1394_LinkControlClear, 0xffffffff); @@ -579,7 +579,7 @@ (OHCI1394_MAX_PHYS_RESP_RETRIES<<8)); /* We don't want hardware swapping */ - reg_write(ohci, OHCI1394_HCControlClear, 0x40000000); + reg_write(ohci, OHCI1394_HCControlClear, OHCI1394_HCControl_noByteSwap); /* Enable interrupts */ reg_write(ohci, OHCI1394_IntMaskSet, @@ -596,7 +596,7 @@ OHCI1394_cycleInconsistent); /* Enable link */ - reg_write(ohci, OHCI1394_HCControlSet, 0x00020000); + reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_linkEnable); buf = reg_read(ohci, OHCI1394_Version); PRINT(KERN_INFO, ohci->id, "OHCI-1394 %d.%d (PCI): IRQ=[%d] " @@ -3330,7 +3330,7 @@ * accessing registers in the SClk domain without LPS enabled * will lock up the machine. Wait 50msec to make sure we have * full link enabled. */ - reg_write(ohci, OHCI1394_HCControlSet, 0x00080000); + reg_write(ohci, OHCI1394_HCControlSet, OHCI1394_HCControl_LPS); mdelay(50); /* Determine the number of available IR and IT contexts. */ Modified: branches/linux-2.4/ohci1394.h ============================================================================== --- branches/linux-2.4/ohci1394.h (original) +++ branches/linux-2.4/ohci1394.h 2003-03-06 11:30:28.000000000 -0500 @@ -288,6 +288,13 @@ #define OHCI1394_VendorID 0x040 #define OHCI1394_HCControlSet 0x050 #define OHCI1394_HCControlClear 0x054 +#define OHCI1394_HCControl_noByteSwap 0x40000000 +#define OHCI1394_HCControl_programPhyEnable 0x00800000 +#define OHCI1394_HCControl_aPhyEnhanceEnable 0x00400000 +#define OHCI1394_HCControl_LPS 0x00080000 +#define OHCI1394_HCControl_postedWriteEnable 0x00040000 +#define OHCI1394_HCControl_linkEnable 0x00020000 +#define OHCI1394_HCControl_softReset 0x00010000 #define OHCI1394_SelfIDBuffer 0x064 #define OHCI1394_SelfIDCount 0x068 #define OHCI1394_IRMultiChanMaskHiSet 0x070 |