]>
git.ipfire.org Git - people/ms/u-boot.git/blob - cpu/mpc824x/drivers/i2o/i2o1.c
1 /*********************************************************
4 * copyright @ Motorola, 1999
5 *********************************************************/
8 extern unsigned int load_runtime_reg( unsigned int eumbbar
, unsigned int reg
);
9 #pragma Alias( load_runtime_reg, "load_runtime_reg" );
11 extern void store_runtime_reg( unsigned int eumbbar
, unsigned int reg
, unsigned int val
);
12 #pragma Alias( store_runtime_reg, "store_runtime_reg" );
14 typedef struct _fifo_stat
20 FIFOSTAT fifo_stat
= { QSIZE_4K
, 0xffffffff };
22 /**********************************************************************************
23 * function: I2OMsgEnable
25 * description: Enable the interrupt associated with in/out bound msg
26 * return I2OSUCCESS if no error, otherwise return I2OMSGINVALID.
28 * All previously enabled interrupts are preserved.
30 * Inbound message interrupt generated by PCI master and serviced by local processor
31 * Outbound message interrupt generated by local processor and serviced by PCI master
33 * local processor needs to enable its inbound interrupts it wants to handle(LOCAL)
34 * PCI master needs to enable the outbound interrupts of devices it wants to handle(REMOTE)
35 ************************************************************************************/
36 I2OSTATUS
I2OMsgEnable ( LOCATION loc
, /* REMOTE/LOCAL */
37 unsigned int base
, /* pcsrbar/eumbbar */
38 unsigned char n
) /* b'1' - msg 0
43 unsigned int reg
, val
;
44 if ( ( n
& 0x3 ) == 0 )
46 /* neither msg 0, nor msg 1 */
51 /* LOCATION - REMOTE : enable outbound message of device, pcsrbar as base
52 * LOCAL : enable local inbound message, eumbbar as base
54 reg
= ( loc
== REMOTE
? I2O_OMIMR
: I2O_IMIMR
);
55 val
= load_runtime_reg( base
, reg
);
57 val
&= 0xfffffffc; /* masked out the msg interrupt bits */
58 val
|= n
; /* LSB are the one we want */
59 store_runtime_reg( base
, reg
, val
);
64 /*********************************************************************************
65 * function: I2OMsgDisable
67 * description: Disable the interrupt associated with in/out bound msg
68 * Other previously enabled interrupts are preserved.
69 * return I2OSUCCESS if no error otherwise return I2OMSGINVALID
72 * local processor needs to disable its inbound interrupts it is not interested(LOCAL)
73 * PCI master needs to disable outbound interrupts of devices it is not interested(REMOTE)
74 *********************************************************************************/
75 I2OSTATUS
I2OMsgDisable( LOCATION loc
, /* REMOTE/LOCAL */
76 unsigned int base
, /* pcsrbar/eumbbar */
77 unsigned char n
) /* b'1' - msg 0
82 unsigned int reg
, val
;
84 if ( ( n
& 0x3 ) == 0 )
86 /* neither msg 0, nor msg 1 */
90 /* LOCATION - REMOTE : disable outbound message interrupt of device, pcsrbar as base
91 * LOCAL : disable local inbound message interrupt, eumbbar as base
93 reg
= ( loc
== REMOTE
? I2O_OMIMR
: I2O_IMIMR
);
94 val
= load_runtime_reg( base
, reg
);
96 val
&= 0xfffffffc; /* masked out the msg interrupt bits */
98 store_runtime_reg( base
, reg
, val
);
104 /**************************************************************************
105 * function: I2OMsgGet
107 * description: Local processor reads the nth Msg register from its inbound msg,
108 * or a PCI Master reads nth outbound msg from device
110 * return I2OSUCCESS if no error, otherwise return I2OMSGINVALID.
113 * If it is not local, pcsrbar must be passed to the function. Otherwise eumbbar is passed.
114 * If it is remote, outbound msg on the device is read; otherwise local inbound msg is read
115 *************************************************************************/
116 I2OSTATUS
I2OMsgGet ( LOCATION loc
, /* REMOTE/LOCAL */
117 unsigned int base
, /*pcsrbar/eumbbar */
118 unsigned int n
, /* 0 or 1 */
121 if ( n
>= I2O_NUM_MSG
|| msg
== 0 )
123 return I2OMSGINVALID
;
128 /* read the outbound msg of the device, pcsrbar as base */
129 *msg
= load_runtime_reg( base
, I2O_OMR0
+n
*I2O_REG_OFFSET
);
133 /* read the inbound msg sent by PCI master, eumbbar as base */
134 *msg
= load_runtime_reg( base
, I2O_IMR0
+n
*I2O_REG_OFFSET
);
140 /***************************************************************
141 * function: I2OMsgPost
143 * description: Kahlua writes to its nth outbound msg register
144 * PCI master writes to nth inbound msg register of device
146 * return I2OSUCCESS if no error, otherwise return I2OMSGINVALID.
149 * If it is not local, pcsrbar must be passed to the function. Otherwise eumbbar is passed.
151 * If it is remote, inbound msg on the device is written; otherwise local outbound msg is written
152 ***************************************************************/
153 I2OSTATUS
I2OMsgPost( LOCATION loc
, /* REMOTE/LOCAL */
154 unsigned int base
, /*pcsrbar/eumbbar */
155 unsigned int n
, /* 0 or 1 */
158 if ( n
>= I2O_NUM_MSG
)
160 return I2OMSGINVALID
;
165 /* write to the inbound msg register of the device, pcsrbar as base */
166 store_runtime_reg( base
, I2O_IMR0
+n
*I2O_REG_OFFSET
, msg
);
170 /* write to the outbound msg register for PCI master to read, eumbbar as base */
171 store_runtime_reg( base
, I2O_OMR0
+n
*I2O_REG_OFFSET
, msg
);
177 /***********************************************************************
178 * function: I2ODBEnable
180 * description: Local processor enables it's inbound doorbell interrupt
181 * PCI master enables outbound doorbell interrupt of devices
182 * Other previously enabled interrupts are preserved.
183 * Return I2OSUCCESS if no error otherwise return I2ODBINVALID
186 * In DoorBell interrupt is generated by PCI master and serviced by local processor
187 * Out Doorbell interrupt is generated by local processor and serviced by PCI master
189 * Out Doorbell interrupt is generated by local processor and serviced by PCI master
190 * PCI master needs to enable the outbound doorbell interrupts of device it wants to handle
191 **********************************************************************/
192 I2OSTATUS
I2ODBEnable( LOCATION loc
, /* REMOTE/LOCAL */
193 unsigned int base
, /* pcsrbar/eumbbar */
194 unsigned int in_db
) /* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
197 /* LOCATION - REMOTE : PCI master initializes outbound doorbell message of device
198 * LOCAL : Kahlua initializes its inbound doorbell message
202 if ( loc
== LOCAL
&& ( in_db
& 0x3 ) == 0 )
209 /* pcsrbar is base */
210 val
= load_runtime_reg( base
, I2O_OMIMR
);
212 store_runtime_reg( base
, I2O_OMIMR
, val
);
216 /* eumbbar is base */
217 val
= load_runtime_reg( base
, I2O_IMIMR
);
218 in_db
= ( (~in_db
) & 0x3 ) << 3;
219 val
= ( val
& 0xffffffe7) | in_db
;
220 store_runtime_reg( base
, I2O_IMIMR
, val
);
226 /**********************************************************************************
227 * function: I2ODBDisable
229 * description: local processor disables its inbound DoorBell Interrupt
230 * PCI master disables outbound DoorBell interrupt of device
231 * Other previously enabled interrupts are preserved.
232 * return I2OSUCCESS if no error.Otherwise return I2ODBINVALID
235 * local processor needs to disable its inbound doorbell interrupts it is not interested
237 * PCI master needs to disable outbound doorbell interrupts of device it is not interested
238 ************************************************************************************/
239 I2OSTATUS
I2ODBDisable( LOCATION loc
, /* REMOTE/LOCAL */
240 unsigned int base
, /* pcsrbar/eumbbar */
241 unsigned int in_db
) /* when LOCAL, I2O_IN_DB, MC, I2O_IN_DB|MC */
243 /* LOCATION - REMOTE : handle device's out bound message initialization
244 * LOCAL : handle local in bound message initialization
248 if ( loc
== LOCAL
&& ( in_db
& 0x3 ) == 0 )
255 /* pcsrbar is the base */
256 val
= load_runtime_reg( base
, I2O_OMIMR
);
258 store_runtime_reg( base
, I2O_OMIMR
, val
);
262 val
= load_runtime_reg( base
, I2O_IMIMR
);
263 in_db
= ( in_db
& 0x3 ) << 3;
265 store_runtime_reg( base
, I2O_IMIMR
, val
);
271 /**********************************************************************************
274 * description: Local processor reads its in doorbell register,
275 * PCI master reads the outdoorbell register of device.
276 * After a doorbell register is read, the whole register will be cleared.
277 * Otherwise, HW keeps generating interrupt.
280 * If it is not local, pcsrbar must be passed to the function.
281 * Otherwise eumbbar is passed.
283 * If it is remote, out doorbell register on the device is read.
284 * Otherwise local in doorbell is read
286 * If the register is not cleared by write to it, any remaining bit of b'1's
287 * will cause interrupt pending.
288 *********************************************************************************/
289 unsigned int I2ODBGet( LOCATION loc
, /* REMOTE/LOCAL */
290 unsigned int base
) /* pcsrbar/eumbbar */
292 unsigned int msg
, val
;
296 /* read outbound doorbell register of device, pcsrbar is the base */
297 val
= load_runtime_reg( base
, I2O_ODBR
);
298 msg
= val
& 0xe0000000;
299 store_runtime_reg( base
, I2O_ODBR
, val
); /* clear the register */
303 /* read the inbound doorbell register, eumbbar is the base */
304 val
= load_runtime_reg( base
, I2O_IDBR
);
305 store_runtime_reg( base
, I2O_IDBR
, val
); /* clear the register */
312 /**********************************************************************
313 * function: I2ODBPost
315 * description: local processor writes to a outbound doorbell register,
316 * PCI master writes to the inbound doorbell register of device
319 * If it is not local, pcsrbar must be passed to the function.
320 * Otherwise eumbbar is passed.
322 * If it is remote, in doorbell register on the device is written.
323 * Otherwise local out doorbell is written
324 *********************************************************************/
325 void I2ODBPost( LOCATION loc
, /* REMOTE/LOCAL */
326 unsigned int base
, /* pcsrbar/eumbbar */
327 unsigned int msg
) /* in / out */
331 /* write to inbound doorbell register of device, pcsrbar is the base */
332 store_runtime_reg( base
, I2O_IDBR
, msg
);
336 /* write to local outbound doorbell register, eumbbar is the base */
337 store_runtime_reg( base
, I2O_ODBR
, msg
& 0x1fffffff );
342 /********************************************************************
343 * function: I2OOutMsgStatGet
345 * description: PCI master reads device's outbound msg unit interrupt status.
346 * Reading an interrupt status register,
347 * the register will be cleared.
349 * The value of the status register is AND with the outbound
350 * interrupt mask and result is returned.
353 * pcsrbar must be passed to the function.
354 ********************************************************************/
355 I2OSTATUS
I2OOutMsgStatGet( unsigned int pcsrbar
, I2OOMSTAT
*val
)
365 /* read device's outbound status */
366 stat
= load_runtime_reg( pcsrbar
, I2O_OMISR
);
367 mask
= load_runtime_reg( pcsrbar
, I2O_OMIMR
);
368 store_runtime_reg( pcsrbar
, I2O_OMISR
, stat
& 0xffffffd7);
371 val
->rsvd0
= ( stat
& 0xffffffc0 ) >> 6;
372 val
->opqi
= ( stat
& 0x00000020 ) >> 5;
373 val
->rsvd1
= ( stat
& 0x00000010 ) >> 4;
374 val
->odi
= ( stat
& 0x00000008 ) >> 3;
375 val
->rsvd2
= ( stat
& 0x00000004 ) >> 2;
376 val
->om1i
= ( stat
& 0x00000002 ) >> 1;
377 val
->om0i
= ( stat
& 0x00000001 );
382 /********************************************************************
383 * function: I2OInMsgStatGet
385 * description: Local processor reads its inbound msg unit interrupt status.
386 * Reading an interrupt status register,
387 * the register will be cleared.
389 * The inbound msg interrupt status is AND with the inbound
390 * msg interrupt mask and result is returned.
393 * eumbbar must be passed to the function.
394 ********************************************************************/
395 I2OSTATUS
I2OInMsgStatGet(unsigned int eumbbar
, I2OIMSTAT
*val
)
405 /* read device's outbound status */
406 stat
= load_runtime_reg( eumbbar
, I2O_OMISR
);
407 mask
= load_runtime_reg( eumbbar
, I2O_OMIMR
);
408 store_runtime_reg( eumbbar
, I2O_OMISR
, stat
& 0xffffffe7 );
411 val
->rsvd0
= ( stat
& 0xfffffe00 ) >> 9;
412 val
->ofoi
= ( stat
& 0x00000100 ) >> 8;
413 val
->ipoi
= ( stat
& 0x00000080 ) >> 7;
414 val
->rsvd1
= ( stat
& 0x00000040 ) >> 6;
415 val
->ipqi
= ( stat
& 0x00000020 ) >> 5;
416 val
->mci
= ( stat
& 0x00000010 ) >> 4;
417 val
->idi
= ( stat
& 0x00000008 ) >> 3;
418 val
->rsvd2
= ( stat
& 0x00000004 ) >> 2;
419 val
->im1i
= ( stat
& 0x00000002 ) >> 1;
420 val
->im0i
= ( stat
& 0x00000001 );
426 /***********************************************************
427 * function: I2OFIFOInit
429 * description: Configure the I2O FIFO, including QBAR,
430 * IFHPR/IFTPR, IPHPR/IPTPR, OFHPR/OFTPR,
433 * return I2OSUCCESS if no error,
434 * otherwise return I2OQUEINVALID
436 * note: It is NOT this driver's responsibility of initializing
437 * MFA blocks, i.e., FIFO queue itself. The MFA blocks
438 * must be initialized before I2O unit can be used.
439 ***********************************************************/
440 I2OSTATUS
I2OFIFOInit( unsigned int eumbbar
,
441 QUEUE_SIZE sz
, /* value of CQS of MUCR */
442 unsigned int qba
) /* queue base address that must be aligned at 1M */
445 if ( ( qba
& 0xfffff ) != 0 )
447 /* QBA must be aligned at 1Mbyte boundary */
448 return I2OQUEINVALID
;
451 store_runtime_reg( eumbbar
, I2O_QBAR
, qba
);
452 store_runtime_reg( eumbbar
, I2O_MUCR
, (unsigned int)sz
);
453 store_runtime_reg( eumbbar
, I2O_IFHPR
, qba
);
454 store_runtime_reg( eumbbar
, I2O_IFTPR
, qba
);
455 store_runtime_reg( eumbbar
, I2O_IPHPR
, qba
+ 1 * ( sz
<< 11 ));
456 store_runtime_reg( eumbbar
, I2O_IPTPR
, qba
+ 1 * ( sz
<< 11 ));
457 store_runtime_reg( eumbbar
, I2O_OFHPR
, qba
+ 2 * ( sz
<< 11 ));
458 store_runtime_reg( eumbbar
, I2O_OFTPR
, qba
+ 2 * ( sz
<< 11 ));
459 store_runtime_reg( eumbbar
, I2O_OPHPR
, qba
+ 3 * ( sz
<< 11 ));
460 store_runtime_reg( eumbbar
, I2O_OPTPR
, qba
+ 3 * ( sz
<< 11 ));
468 /**************************************************
469 * function: I2OFIFOEnable
471 * description: Enable the circular queue
472 * return I2OSUCCESS if no error.
473 * Otherwise I2OQUEINVALID is returned.
476 *************************************************/
477 I2OSTATUS
I2OFIFOEnable( unsigned int eumbbar
)
481 if ( fifo_stat
.qba
== 0xfffffff )
483 return I2OQUEINVALID
;
486 val
= load_runtime_reg( eumbbar
, I2O_MUCR
);
487 store_runtime_reg( eumbbar
, I2O_MUCR
, val
| 0x1 );
492 /**************************************************
493 * function: I2OFIFODisable
495 * description: Disable the circular queue
498 *************************************************/
499 void I2OFIFODisable( unsigned int eumbbar
)
501 if ( fifo_stat
.qba
== 0xffffffff )
507 unsigned int val
= load_runtime_reg( eumbbar
, I2O_MUCR
);
508 store_runtime_reg( eumbbar
, I2O_MUCR
, val
& 0xfffffffe );
511 /****************************************************
512 * function: I2OFIFOAlloc
514 * description: Allocate a free MFA from free FIFO.
515 * return I2OSUCCESS if no error.
516 * return I2OQUEEMPTY if no more free MFA.
517 * return I2OINVALID on other errors.
519 * A free MFA must be allocated before a
520 * message can be posted.
523 * PCI Master allocates a free MFA from inbound queue of device
524 * (pcsrbar is the base,) through the inbound queue port of device
525 * while local processor allocates a free MFA from its outbound
526 * queue (eumbbar is the base.)
528 ****************************************************/
529 I2OSTATUS
I2OFIFOAlloc( LOCATION loc
,
533 I2OSTATUS stat
= I2OSUCCESS
;
536 if ( pMsg
== 0 || *pMsg
== 0 || fifo_stat
.qba
== 0xffffffff )
539 return I2OQUEINVALID
;
544 /* pcsrbar is the base and read the inbound free tail ptr */
545 pTil
= (void *)load_runtime_reg( base
, I2O_IFQPR
);
546 if ( ( (unsigned int)pTil
& 0xFFFFFFF ) == 0xFFFFFFFF )
557 /* eumbbar is the base and read the outbound free tail ptr */
558 pHdr
= (void *)load_runtime_reg( base
, I2O_OFHPR
); /* queue head */
559 pTil
= (void *)load_runtime_reg( base
, I2O_OFTPR
); /* queue tail */
561 /* check underflow */
564 /* hdr and til point to the same fifo item, no free MFA */
570 *pMsg
= (void *)(*(unsigned char *)pTil
);
571 pTil
= (void *)((unsigned int)pTil
+ 4);
572 if ( (unsigned int)pTil
== fifo_stat
.qba
+ ( 4 * ( fifo_stat
.qsz
<< 11 ) ) )
574 /* reach the upper limit */
575 pTil
= (void *)(fifo_stat
.qba
+ ( 3 * (fifo_stat
.qsz
<< 11) ));
577 store_runtime_reg( base
, I2O_OFTPR
, (unsigned int)pTil
);
584 /******************************************************
585 * function: I2OFIFOFree
587 * description: Free a used MFA back to free queue after
589 * return I2OSUCCESS if no error.
590 * return I2OQUEFULL if inbound free queue
593 * note: PCI Master frees a MFA into device's outbound queue
594 * (OFQPR) while local processor frees a MFA into its
595 * inbound queue (IFHPR).
596 *****************************************************/
597 I2OSTATUS
I2OFIFOFree( LOCATION loc
,
602 I2OSTATUS stat
= I2OSUCCESS
;
604 if ( fifo_stat
.qba
== 0xffffffff || pMsg
== 0 )
606 return I2OQUEINVALID
;
611 /* pcsrbar is the base */
612 store_runtime_reg( base
, I2O_OFQPR
, (unsigned int)pMsg
);
616 /* eumbbar is the base */
617 pHdr
= (void **)load_runtime_reg( base
, I2O_IFHPR
);
618 pTil
= (void **)load_runtime_reg( base
, I2O_IFTPR
);
626 if ( (unsigned int)pHdr
== fifo_stat
.qba
+ ( fifo_stat
.qsz
<< 11 ) )
628 /* reach the upper limit */
629 pHdr
= (void **)fifo_stat
.qba
;
632 /* check inbound free queue overflow */
635 store_runtime_reg( base
, I2O_OPHPR
, (unsigned int)pHdr
);
648 /*********************************************
649 * function: I2OFIFOPost
651 * description: Post a msg into FIFO post queue
652 * the value of msg must be the one
653 * returned by I2OFIFOAlloc
655 * note: PCI Master posts a msg into device's inbound queue
656 * (IFQPR) while local processor post a msg into device's
657 * outbound queue (OPHPR)
658 *********************************************/
659 I2OSTATUS
I2OFIFOPost( LOCATION loc
,
664 I2OSTATUS stat
= I2OSUCCESS
;
666 if ( fifo_stat
.qba
== 0xffffffff || pMsg
== 0 )
668 return I2OQUEINVALID
;
673 /* pcsrbar is the base */
674 store_runtime_reg( base
, I2O_IFQPR
, (unsigned int)pMsg
);
678 /* eumbbar is the base */
679 pHdr
= (void **)load_runtime_reg( base
, I2O_OPHPR
);
680 pTil
= (void **)load_runtime_reg( base
, I2O_OPTPR
);
688 if ( (unsigned int)pHdr
== fifo_stat
.qba
+ 3 * ( fifo_stat
.qsz
<< 11 ) )
690 /* reach the upper limit */
691 pHdr
= (void **)(fifo_stat
.qba
+ 2 * ( fifo_stat
.qsz
<< 11 ) );
694 /* check post queue overflow */
697 store_runtime_reg( base
, I2O_OPHPR
, (unsigned int)pHdr
);
708 /************************************************
709 * function: I2OFIFOGet
711 * description: Read a msg from FIFO
712 * This function should be called
713 * only when there is a corresponding
716 * note: PCI Master reads a msg from device's outbound queue
717 * (OFQPR) while local processor reads a msg from device's
718 * inbound queue (IPTPR)
719 ************************************************/
720 I2OSTATUS
I2OFIFOGet( LOCATION loc
,
724 I2OSTATUS stat
= I2OSUCCESS
;
727 if ( pMsg
== 0 || *pMsg
== 0 || fifo_stat
.qba
== 0xffffffff )
730 return I2OQUEINVALID
;
735 /* pcsrbar is the base */
736 pTil
= (void *)load_runtime_reg( base
, I2O_OFQPR
);
737 if ( ( (unsigned int)pTil
& 0xFFFFFFF ) == 0xFFFFFFFF )
748 /* eumbbar is the base and read the outbound free tail ptr */
749 pHdr
= (void *)load_runtime_reg( base
, I2O_IPHPR
); /* queue head */
750 pTil
= (void *)load_runtime_reg( base
, I2O_IPTPR
); /* queue tail */
752 /* check underflow */
761 *pMsg
= (void *)(*(unsigned char *)pTil
);
762 pTil
= (void *)((unsigned int)pTil
+ 4);
763 if ( (unsigned int)pTil
== fifo_stat
.qba
+ 2 * ( fifo_stat
.qsz
<< 11 ) )
765 /* reach the upper limit */
766 pTil
= (void *)(fifo_stat
.qba
+ 1 * (fifo_stat
.qsz
<< 11) );
769 store_runtime_reg( base
, I2O_IPTPR
, (unsigned int)pTil
);
776 /********************************************************
779 * description: Get the I2O PCI configuration identification
782 * note: PCI master should pass pcsrbar while local processor
783 * should pass eumbbar.
784 *********************************************************/
785 I2OSTATUS
I2OPCIConfigGet( LOCATION loc
,
794 tmp
= load_runtime_reg( base
, PCI_CFG_CLA
);
795 val
->base_class
= ( tmp
& 0xFF) << 16;
796 tmp
= load_runtime_reg( base
, PCI_CFG_SCL
);
797 val
->sub_class
= ( (tmp
& 0xFF) << 8 );
798 tmp
= load_runtime_reg( base
, PCI_CFG_PIC
);
799 val
->prg_code
= (tmp
& 0xFF);
803 /*********************************************************
804 * function: I2OFIFOIntEnable
806 * description: Enable the circular post queue interrupt
809 * PCI master enables outbound FIFO interrupt of device
810 * pscrbar is the base
811 * Device enables its inbound FIFO interrupt
812 * eumbbar is the base
813 *******************************************************/
814 void I2OFIFOIntEnable( LOCATION loc
, unsigned int base
)
816 unsigned int reg
, val
;
818 /* LOCATION - REMOTE : enable outbound message of device, pcsrbar as base
819 * LOCAL : enable local inbound message, eumbbar as base
821 reg
= ( loc
== REMOTE
? I2O_OMIMR
: I2O_IMIMR
);
822 val
= load_runtime_reg( base
, reg
);
824 val
&= 0xffffffdf; /* clear the msg interrupt bits */
825 store_runtime_reg( base
, reg
, val
);
829 /****************************************************
830 * function: I2OFIFOIntDisable
832 * description: Disable the circular post queue interrupt
835 * PCI master disables outbound FIFO interrupt of device
836 * (pscrbar is the base)
837 * Device disables its inbound FIFO interrupt
838 * (eumbbar is the base)
839 *****************************************************/
840 void I2OFIFOIntDisable( LOCATION loc
, unsigned int base
)
843 /* LOCATION - REMOTE : disable outbound message interrupt of device, pcsrbar as base
844 * LOCAL : disable local inbound message interrupt, eumbbar as base
846 unsigned int reg
= ( loc
== REMOTE
? I2O_OMIMR
: I2O_IMIMR
);
847 unsigned int val
= load_runtime_reg( base
, reg
);
849 val
|= 0x00000020; /* masked out the msg interrupt bits */
850 store_runtime_reg( base
, reg
, val
);
854 /*********************************************************
855 * function: I2OFIFOOverflowIntEnable
857 * description: Enable the circular queue overflow interrupt
860 * Device enables its inbound FIFO post overflow interrupt
861 * and outbound free overflow interrupt.
862 * eumbbar is the base
863 *******************************************************/
864 void I2OFIFOOverflowIntEnable( unsigned int eumbbar
)
866 unsigned int val
= load_runtime_reg( eumbbar
, I2O_IMIMR
);
868 val
&= 0xfffffe7f; /* clear the two overflow interrupt bits */
869 store_runtime_reg( eumbbar
, I2O_IMIMR
, val
);
873 /****************************************************
874 * function: I2OFIFOOverflowIntDisable
876 * description: Disable the circular queue overflow interrupt
879 * Device disables its inbound post FIFO overflow interrupt
880 * and outbound free FIFO overflow interrupt
881 * (eumbbar is the base)
882 *****************************************************/
883 void I2OFIFOOverflowIntDisable( unsigned int eumbbar
)
886 unsigned int val
= load_runtime_reg( eumbbar
, I2O_IMIMR
);
888 val
|= 0x00000180; /* masked out the msg overflow interrupt bits */
889 store_runtime_reg( eumbbar
, I2O_IMIMR
, val
);