l64853Dma.c
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:21k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* l64853Dma.c - LSI Logic L64853 S-Bus DMA Controller library */
  2. /* Copyright 1989-1997 Wind River Systems, Inc. */
  3. #include "copyright_wrs.h"
  4. /*
  5. modification history
  6. --------------------
  7. 01f,29nov96,wlf  doc: cleanup.
  8. 01h,01jul96,map  added documentation.
  9. 01g,25may96,dat  added #include "stdio.h", to eliminate warnings
  10. 01f,25may96,dds  (from jaideep) modified l64853{HwInit,Reset} to do a
  11.                  complete job ...
  12. 01f,23may96,wlf  doc: cleanup.
  13. 01e,03dec93,ccc  fixed warning by adding include of stdlib.h.
  14. 01d,02sep92,ccc  renamed l64853Lib.c to l64853Dma.c.
  15. 01c,26may92,rrr  the tree shuffle
  16.   -changed includes to have absolute path from h/
  17. 01b,04oct91,rrr  passed through the ansification filter
  18.                   -changed functions to ansi style
  19.   -changed includes to have absolute path from h/
  20.   -changed VOID to void
  21.   -changed copyright notice
  22. 01a,28feb90,jcc  written
  23. */
  24. /*
  25. DESCRIPTION
  26. This is the driver for the LSI Logic L64853 S-Bus DMA Controller. The device
  27. supports two DMA channels; an 8-bit D channel and a 16-bit E channel.  The two
  28. channels can be used for DMA or programmed IO and using the controller as an
  29. SBus master or a slave. As an SBus master, the L64853 DMA controller, is
  30. capable of operating as a DVMA master, generating virtual memory addresses on
  31. the SBUS which are translated to physical addresses by the MMU on the SBus
  32. controller.
  33. Only D channel DMA operations is supported by this driver.  These DMA
  34. operation are controlled through L64853 internal programmable registers, while
  35. the E channel DMA operations are programmed through external registers located
  36. on an E channel device.
  37. The l64853 DMA controller uses the pack/unpack registers to buffer data.
  38. USAGE
  39. The routine l64853CtrlCreate() is called to create a DMA_CTRL structure which
  40. is used to describe the L64853 controller. The routine l64853CtrlInit() is
  41. used to initialize the chip before any operations are attempted on the L64853
  42. controller by calling l64853HwInit().
  43. The steps to setup a D channel DMA operation are,
  44. .iP
  45. Set the virtual memory address by calling l64853AdrCountSet().
  46. .iP
  47. Set the number of bytes to transfer by calling l64853ByteCountSet().
  48. .iP
  49. Set the direction transfer by calling l64853Read(), to perform DMA from
  50. memory, or l64853Write() to perform DMA into memory.
  51. .iP
  52. Program the D channel device to request a DMA transfer causing an assertion
  53. of the D_REQ line.
  54. .iP
  55. Enable the DMA by calling l64853DmaEnable(). DMA will now begin, and continue
  56. until the byte count expires or if there is an error. If interrupts were
  57. enabled by calling l64853IntEnable(), an interrupt is generated.
  58. .iP
  59. Service the interrupt, and if the completed DMA operation was a write to
  60. memory, bytes pending in the pack register should be drained into memory by
  61. calling l64853Drain(), otherwise the bytes should be flushed by calling
  62. l64853Flush().
  63. .LP
  64. INCLUDE FILES
  65. l64853.h
  66. SEE ALSO:
  67. .pG "I/O System"
  68. */
  69. #include "vxWorks.h"
  70. #include "drv/dma/l64853.h"
  71. #include "memLib.h"
  72. #include "stdlib.h"
  73. #include "stdio.h"
  74. /* defines */
  75. #define WD_33C93_MAX_BYTES_PER_XFER  ((UINT) 0xffffff)
  76. /* macros */
  77. /*******************************************************************************
  78. *
  79. * L64853_CSR_BIT_SET - set the specified bit(s) in the L64853 CSR register
  80. *
  81. * NOMANUAL
  82. */
  83. #define L64853_CSR_BIT_SET(pL64853, bit)
  84.     do
  85. {
  86.      *pL64853->pCsrReg |= bit;
  87. } while (FALSE)
  88. /*******************************************************************************
  89. *
  90. * L64853_CSR_BIT_RESET - reset the specified bit(s) in the L64853 CSR register
  91. *
  92. * NOMANUAL
  93. */
  94. #define L64853_CSR_BIT_RESET(pL64853, bit)
  95.     do
  96. {
  97.         *pL64853->pCsrReg &= ~bit;
  98. } while (FALSE)
  99. /* externals */
  100. IMPORT DMA_CTRL *pSysDmaCtrl;
  101. /* forward static functions */
  102. static void l64853HwInit (L64853 *pL64853);
  103. /*******************************************************************************
  104. *
  105. * l64853CtrlCreate - create an L64853 structure and initialize parts
  106. *
  107. * This routine creates an L64853 data structure.  It must be called before
  108. * using an L64853 chip and should be called only once for a specified
  109. * structure.  Since this routine allocates memory for a structure used by all
  110. * routines in l64853Lib, it must be called before any other routines in the
  111. * library.
  112. *
  113. * After calling this routine, at least one call to l64853CtrlInit() should
  114. * be made before initiating any DMA transaction using the L64853.
  115. *
  116. * The input parameters are as follows:
  117. * .iP <baseAdrs> 10
  118. * the address where the CPU accesses the lowest (CSR) register of
  119. * the L64853.
  120. * .iP <regOffset> 10
  121. * the address offset (in bytes) to access consecutive registers.
  122. * .iP <pIdReg> 10
  123. * the address where the CPU accesses the internal ID register.
  124. * .LP
  125. *
  126. * RETURNS: A pointer to the L64853 control structure,
  127. * or NULL if memory is unavailable or the parameters are invalid.
  128. *
  129. * SEE ALSO: l64853CtrlInit()
  130. */
  131. DMA_CTRL *l64853CtrlCreate
  132.     (
  133.     UINT32 *    baseAdrs,       /* base address of the L64853 */
  134.     int         regOffset,      /* address offset between consecutive regs. */
  135.     UINT32 *    pIdReg          /* address of internal ID register */
  136.     )
  137.     {
  138.     FAST L64853 *pL64853; /* ptr to L64853 info */
  139.     /* verify input parameters */
  140.     if (regOffset == 0)
  141.         return ((DMA_CTRL *) NULL);
  142.     /* calloc the controller info structure; return NULL if unable */
  143.     if ((pL64853 = (L64853 *) calloc (1, sizeof (L64853))) == NULL)
  144.         return ((DMA_CTRL *) NULL);
  145.     /* fill in L64853 specific data for this controller */
  146.     pL64853->pCsrReg = baseAdrs;
  147.     pL64853->pAdrsReg = (UINT32*) ((int) baseAdrs + (int) regOffset);
  148.     pL64853->pBcntReg = (UINT32*) ((int) baseAdrs + (0x2 * (int) regOffset));
  149.     return ((DMA_CTRL *) pL64853);
  150.     }
  151. /*******************************************************************************
  152. *
  153. * l64853CtrlInit - initialize the L64853 hardware
  154. *
  155. * This routine initializes the L64853 hardware.  It should be called after
  156. * l64853CtrlCreate(), but before the chip is actually used.
  157. *
  158. * The <pL64853> parameter is a pointer to the L64853_DMA_CTRL structure 
  159. * created with l64853CtrlCreate().
  160. *
  161. * RETURNS: OK, always.
  162. * SEE ALSO: l64853CtrlCreate(), l64853HwInit()
  163. */
  164. STATUS l64853CtrlInit
  165.     (
  166.     FAST L64853 *pL64853                /* ptr to L64853 info */
  167.     )
  168.     {
  169.     l64853HwInit (pL64853);  /* initialize the L64853 hardware */
  170.     return (OK);
  171.     }
  172. /*******************************************************************************
  173. *
  174. * l64853IntEnable - enable L64853 DMA controller interrupts
  175. *
  176. * This routine allows the L64853 DMA controller to generate interrupts
  177. * by setting the interrupt enable bit in the L64853 CSR register.
  178. * The chip generates interrupts when an error is pending (CSR
  179. * register bit L64853_CSR_ERR_PEND) or when the byte counter has expired (CSR
  180. * register bit L64853_CSR_TC).  It also passes through interrupts from the D
  181. * channel device.
  182. *
  183. * RETURNS: N/A
  184. *
  185. * SEE ALSO: l64853IntDisable()
  186. */
  187. void l64853IntEnable
  188.     (
  189.     L64853 *pL64853          /* ptr to an L64853 structure */
  190.     )
  191.     {
  192.     L64853_CSR_BIT_SET (pL64853, L64853_CSR_INT_EN);
  193.     }
  194. /*******************************************************************************
  195. *
  196. * l64853IntDisable - disable L64853 DMA controller interrupts
  197. *
  198. * This routine prevents the L64853 DMA controller from generating or 
  199. * passing through interrupts by resetting the interrupt enable bit in 
  200. * the L64853 CSR register.
  201. *
  202. * RETURNS: N/A
  203. *
  204. * SEE ALSO: l64853IntEnable()
  205. */
  206. void l64853IntDisable
  207.     (
  208.     L64853 *pL64853          /* ptr to an L64853 structure */
  209.     )
  210.     {
  211.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_INT_EN);
  212.     }
  213. /*******************************************************************************
  214. *
  215. * l64853Flush - flush the L64853 D channel pack register
  216. *
  217. * This routine sets the flush buffer bit in the CSR register of the L64853 DMA
  218. * controller, clearing the pack count (CSR register bits L64853_CSR_PACK_CNT), 
  219. * any pending errors (CSR register bit L64853_CSR_ERR_PEND), and the terminal
  220. * count bit (CSR register bit L64853_CSR_TC).
  221. *
  222. * RETURNS: N/A
  223. */
  224. void l64853Flush
  225.     (
  226.     L64853 *pL64853          /* ptr to an L64853 structure */
  227.     )
  228.     {
  229.     L64853_CSR_BIT_SET (pL64853, L64853_CSR_FLUSH);
  230.     }
  231. /*******************************************************************************
  232. *
  233. * l64853Drain - drain the L64853 D channel pack register
  234. *
  235. * This routine sets the drain buffer bit in the CSR register of the L64853 DMA
  236. * controller, causing any bytes in the D channel pack register to be written
  237. * out to SBus memory; then it clears the pack count (CSR register bits
  238. * L64853_CSR_PACK_CNT).
  239. *
  240. * RETURNS: N/A
  241. */
  242. void l64853Drain
  243.     (
  244.     L64853 *pL64853          /* ptr to an L64853 structure */
  245.     )
  246.     {
  247.     L64853_CSR_BIT_SET (pL64853, L64853_CSR_DRAIN);
  248.     }
  249. /*******************************************************************************
  250. *
  251. * l64853Reset - reset the L64853 DMA controller
  252. *
  253. * This routine toggles the reset bit in the CSR register of the L64853 DMA 
  254. * controller, putting the DMA controller into the default initial state.
  255. *
  256. * RETURNS: N/A
  257. */
  258. void l64853Reset
  259.     (
  260.     L64853 *pL64853          /* ptr to an L64853 structure */
  261.     )
  262.     {
  263.     /* toggle reset bit to hardware reset the L64853 */
  264.     
  265.     L64853_CSR_BIT_SET   (pL64853, L64853_CSR_RESET);
  266.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_RESET);
  267.     }
  268. /*******************************************************************************
  269. *
  270. * l64853Write - enable DMA transfers from a D channel device to SBus memory
  271. *
  272. * This routine permits the L64853 DMA controller to write data from a D
  273. * channel device to SBus memory, by setting the write bit (L64853_CSR_WRITE)
  274. * of the CSR register.
  275. *
  276. * RETURNS: N/A
  277. * SEE ALSO: l64853Read()
  278. */
  279. void l64853Write
  280.     (
  281.     L64853 *pL64853          /* ptr to an L64853 structure */
  282.     )
  283.     {
  284.     L64853_CSR_BIT_SET (pL64853, L64853_CSR_WRITE);
  285.     }
  286. /*******************************************************************************
  287. *
  288. * l64853Read - enable DMA transfers to a D channel device from SBus memory
  289. * This routine permits the L64853 DMA controller to read data from SBus memory
  290. * into a D channel device, by clearing the write bit (L64853_CSR_WRITE) of the
  291. * CSR register.
  292. *
  293. * RETURNS: N/A
  294. *
  295. * SEE ALSO: l64853Write()
  296. */
  297. void l64853Read
  298.     (
  299.     L64853 *pL64853          /* ptr to an L64853 structure */
  300.     )
  301.     {
  302.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_WRITE);
  303.     }
  304. /*******************************************************************************
  305. *
  306. * l64853DmaEnable - enable the L64853 DMA controller to accept DMA requests
  307. * This routine enables the L64853 DMA controller to accept DMA requests from a
  308. * D channel device, by setting the enable DMA bit (L64853_CSR_EN_DMA) in the
  309. * CSR register.
  310. *
  311. * RETURNS: N/A
  312. *
  313. * SEE ALSO: l64853DmaDisable()
  314. */
  315. void l64853DmaEnable
  316.     (
  317.     L64853 *pL64853          /* ptr to an L64853 structure */
  318.     )
  319.     {
  320.     L64853_CSR_BIT_SET (pL64853, L64853_CSR_EN_DMA);
  321.     }
  322. /*******************************************************************************
  323. *
  324. * l64853DmaDisable - prevent the L64853 DMA chip from accepting DMA requests
  325. * This routine disables acceptance of DMA requests from a D channel device by
  326. * the L64853 DMA controller, by resetting the enable DMA bit
  327. * (L64853_CSR_EN_DMA) in the CSR register.
  328. *
  329. * RETURNS: N/A
  330. *
  331. * SEE ALSO: l64853DmaEnable()
  332. */
  333. void l64853DmaDisable
  334.     (
  335.     L64853 *pL64853          /* ptr to an L64853 structure */
  336.     )
  337.     {
  338.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_EN_DMA);
  339.     }
  340. /*******************************************************************************
  341. *
  342. * l64853CountEnable - enable the byte counter of the L64853 DMA controller
  343. * This routine enables the byte counter of the L64853 DMA controller, by
  344. * setting the enable counter bit (L64853_CSR_EN_CNT) in the CSR register.  The
  345. * byte counter holds the number of bytes remaining in the current D channel
  346. * DMA transfer.
  347. *
  348. * RETURNS: N/A
  349. *
  350. * SEE ALSO: l64853CountDisable(), l64853TermCountTest()
  351. */
  352. void l64853CountEnable
  353.     (
  354.     L64853 *pL64853          /* ptr to an L64853 structure */
  355.     )
  356.     {
  357.     L64853_CSR_BIT_SET (pL64853, L64853_CSR_EN_CNT);
  358.     }
  359. /*******************************************************************************
  360. *
  361. * l64853CountDisable - disable the byte counter of the L64853 DMA controller
  362. * This routine disables the byte counter of the L64853 DMA controller, by
  363. * resetting the enable counter bit (L64853_CSR_EN_CNT) in the CSR register.
  364. *
  365. * RETURNS: N/A
  366. *
  367. * SEE ALSO: l64853CountEnable()
  368. */
  369. void l64853CountDisable
  370.     (
  371.     L64853 *pL64853          /* ptr to an L64853 structure */
  372.     )
  373.     {
  374.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_EN_CNT);
  375.     }
  376. /*******************************************************************************
  377. *
  378. * l64853ErrPendTest - test the L64853 DMA controller for an error
  379. *
  380. * This routine determines whether the error pending bit (L64853_CSR_ERR_PEND)
  381. * of the L64853 CSR register is set.
  382. *
  383. * RETURNS : TRUE if there is a DMA error, otherwise FALSE.
  384. */
  385. BOOL l64853ErrPendTest
  386.     (
  387.     L64853 *pL64853          /* ptr to an L64853 structure */
  388.     )
  389.     {
  390.     return ((*pL64853->pCsrReg & L64853_CSR_ERR_PEND) ? TRUE : FALSE);
  391.     }
  392. /*******************************************************************************
  393. *
  394. * l64853PackCountGet - get the L64853 DMA controller pack count
  395. *
  396. * This routine returns the number of bytes in the D channel pack register of
  397. * the L64853 DMA controller.
  398. *
  399. * RETURNS : An integer value of the pack count bits (L64853_CSR_PACK_CNT) of
  400. * the CSR register.
  401. */
  402. int l64853PackCountGet
  403.     (
  404.     L64853 *pL64853          /* ptr to an L64853 structure */
  405.     )
  406.     {
  407.     return ((*pL64853->pCsrReg & L64853_CSR_PACK_CNT) >> 2);
  408.     }
  409. /*******************************************************************************
  410. *
  411. * l64853ReqPendTest - test the L64853 DMA controller for a DMA transfer
  412. *
  413. * This routine determines whether the request pending bit
  414. * (L64853_CSR_REQ_PEND) of the L64853 CSR register is set.  This bit is set
  415. * when a D channel DMA transfer is in progress.
  416. *
  417. * RETURNS : TRUE if there is an active DMA transfer, otherwise FALSE.
  418. */
  419. BOOL l64853ReqPendTest
  420.     (
  421.     L64853 *pL64853          /* ptr to an L64853 structure */
  422.     )
  423.     {
  424.     return ((*pL64853->pCsrReg & L64853_CSR_REQ_PEND) ? TRUE : FALSE);
  425.     }
  426. /*******************************************************************************
  427. *
  428. * l64853ByteAdrsGet - get the byte address bits of the L64853 CSR register
  429. *
  430. * This routine returns the byte address bits (L64853_CSR_BYTE_ADDR) of the
  431. * L64853 CSR register.  These are the two least significant bits of the
  432. * address of the next byte to be accessed by the D channel controller.
  433. *
  434. * RETURNS : The integer value of the byte address bits.
  435. */
  436. int l64853ByteAdrsGet
  437.     (
  438.     L64853 *pL64853          /* ptr to an L64853 structure */
  439.     )
  440.     {
  441.     return ((*pL64853->pCsrReg & L64853_CSR_BYTE_ADDR) >> 11);
  442.     }
  443. /*******************************************************************************
  444. *
  445. * l64853TermCountTest - test the L64853 DMA chip for an expired byte counter
  446. *
  447. * This routine determines whether the byte counter has expired by testing the
  448. * terminal count bit (L64853_CSR_TC) of the L64853 CSR register.
  449. *
  450. * RETURNS : TRUE if the terminal count bit is set, otherwise FALSE.
  451. */
  452. BOOL l64853TermCountTest
  453.     (
  454.     L64853 *pL64853          /* ptr to an L64853 structure */
  455.     )
  456.     {
  457.     return ((*pL64853->pCsrReg & L64853_CSR_TC) ? TRUE : FALSE);
  458.     }
  459. /*******************************************************************************
  460. *
  461. * l64853DevIdGet - get the device ID bits of the L64853 CSR register
  462. *
  463. * This routine returns the device ID bits (L64853_CSR_DEV_ID) of the L64853
  464. * CSR register.
  465. *
  466. * RETURNS : The integer value of the device ID bits.
  467. */
  468. int l64853DevIdGet
  469.     (
  470.     L64853 *pL64853          /* ptr to an L64853 structure */
  471.     )
  472.     {
  473.     return ((*pL64853->pCsrReg & L64853_CSR_DEV_ID) >> 28);
  474.     }
  475. /*******************************************************************************
  476. *
  477. * l64853AdrsCountGet - get the SBus address in the L64853 DMA address counter
  478. *
  479. * This routine returns the contents of the L64853 DMA address counter. This
  480. * register contains the virtual address of the SBus memory for a D channel DMA
  481. * transfer (read or write).
  482. *
  483. * RETURNS : The current virtual address in the address counter.
  484. *
  485. * SEE ALSO: l64853AdrsCountSet()
  486. */
  487. char * l64853AdrsCountGet
  488.     (
  489.     L64853 *pL64853          /* ptr to an L64853 structure */
  490.     )
  491.     {
  492.     return ((char *) *pL64853->pAdrsReg);
  493.     }
  494. /*******************************************************************************
  495. *
  496. * l64853AdrsCountSet - set the starting address for a D channel DMA transfer
  497. *
  498. * This routine writes a specified SBus address to the L64853 DMA address
  499. * counter.  This address is used as the starting virtual address for a D
  500. * channel DMA transfer (read or write).
  501. *
  502. * RETURNS: N/A
  503. *
  504. * SEE ALSO: l64853AdrsCountGet()
  505. */
  506. void l64853AdrsCountSet
  507.     (
  508.     L64853 *pL64853,         /* ptr to an L64853 structure */
  509.     char *pAdrsCount            /* ptr */
  510.     )
  511.     {
  512.     *pL64853->pAdrsReg = (UINT32) pAdrsCount;
  513.     }
  514. /*******************************************************************************
  515. *
  516. * l64853ByteCountGet - get the contents of the L64853 DMA byte counter
  517. *
  518. * This routine returns the number of bytes remaining in the current D channel
  519. * DMA transfer.
  520. *
  521. * RETURNS : The contents of the DMA byte counter.
  522. *
  523. * SEE ALSO: l64853ByteCountSet()
  524. */
  525. int l64853ByteCountGet
  526.     (
  527.     L64853 *pL64853          /* ptr to an L64853 structure */
  528.     )
  529.     {
  530.     return ((int) *pL64853->pBcntReg);
  531.     }
  532. /*******************************************************************************
  533. *
  534. * l64853ByteCountSet - set the size of a D channel DMA transfer
  535. *
  536. * This routine sets the size the D channel DMA transfer by loading the value,
  537. * <byteCount>, into the L64853 DMA byte counter.
  538. *
  539. * RETURNS: N/A
  540. * SEE ALSO: l64853ByteCountGet()
  541. */
  542. void l64853ByteCountSet
  543.     (
  544.     L64853 *pL64853,         /* ptr to an L64853 structure */
  545.     int byteCount               /* ptr */
  546.     )
  547.     {
  548.     *pL64853->pBcntReg = (UINT32) byteCount;
  549.     }
  550. /*******************************************************************************
  551. *
  552. * l64853HwInit - initialize the L64853 DMA controller to a quiescent state
  553. *
  554. * This routine resets the L64853 DMA chip, and clears the interrupt enable,
  555. * DMA enable, and counter enable bits in the CSR register, putting the DMA
  556. * controller in a quiescent state.
  557. *
  558. * RETURNS: N/A
  559. *
  560. * SEE ALSO: l64853Reset()
  561. */
  562. LOCAL void l64853HwInit
  563.     (
  564.     L64853 *pL64853          /* ptr to an L64853 structure */
  565.     )
  566.     {
  567.     l64853Reset (pL64853);
  568.     /* clear various enable bits */
  569.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_INT_EN);
  570.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_EN_DMA);
  571.     L64853_CSR_BIT_RESET (pL64853, L64853_CSR_EN_CNT);
  572.     }
  573. /*******************************************************************************
  574. *
  575. * l64853Show - display the contents of all readable L64853 DMA chip registers
  576. *
  577. * This routine displays the state of the L64853 DMA controller, by printing
  578. * the contents of all readable registers.  It is used only during debugging.
  579. *
  580. * RETURNS: OK, or ERROR if both the parameter <pDmaCtrl> and the global
  581. * variable <pSysDmaCtrl> are NULL.
  582. *
  583. * SEE ALSO: sysDmaShow()
  584. */
  585. STATUS l64853Show
  586.     (
  587.     FAST DMA_CTRL *pDmaCtrl     /* ptr to DMA controller info */
  588.     )
  589.     {
  590.     FAST UINT32 csrRegCopy;
  591.     FAST L64853_DMA_CTRL *pl64853DmaCtrl; /* ptr to L64853 info */
  592.     if (pDmaCtrl == NULL)
  593.         {
  594.         if (pSysDmaCtrl != NULL)
  595.             pDmaCtrl = pSysDmaCtrl;
  596.         else
  597.             {
  598.             printErr ("No DMA controller specified.n");
  599.             return (ERROR);
  600.             }
  601.         }
  602.     pl64853DmaCtrl = (L64853_DMA_CTRL *) pDmaCtrl;
  603.     csrRegCopy = *pl64853DmaCtrl->pCsrReg;
  604.     printf ("Interrupt Pending:   %sn",
  605.     (csrRegCopy & L64853_CSR_INT_PEND)  ? " SET " : "reset");
  606.     printf ("Error Pending:       %sn",
  607.     (csrRegCopy & L64853_CSR_ERR_PEND)  ? " SET " : "reset");
  608.     printf ("Interrupt Enable:    %sn",
  609.     (csrRegCopy & L64853_CSR_INT_EN)  ? " SET " : "reset");
  610.     printf ("Drain Buffer:        %sn",
  611.     (csrRegCopy & L64853_CSR_DRAIN)  ? " SET " : "reset");
  612.     printf ("Reset DMA:           %sn",
  613.     (csrRegCopy & L64853_CSR_RESET)  ? " SET " : "reset");
  614.     printf ("Write:               %sn",
  615.     (csrRegCopy & L64853_CSR_WRITE)  ? " SET " : "reset");
  616.     printf ("Enable DMA:          %sn",
  617.     (csrRegCopy & L64853_CSR_EN_DMA)  ? " SET " : "reset");
  618.     printf ("Request Pending:     %sn",
  619.     (csrRegCopy & L64853_CSR_REQ_PEND)  ? " SET " : "reset");
  620.     printf ("Enable Counter:      %sn",
  621.     (csrRegCopy & L64853_CSR_EN_CNT)  ? " SET " : "reset");
  622.     printf ("Terminal Count:      %sn",
  623.     (csrRegCopy & L64853_CSR_TC)  ? " SET " : "reset");
  624.     printf ("ILACC 79C900:        %sn",
  625.     (csrRegCopy & L64853_CSR_ILACC)  ? " SET " : "reset");
  626.     printf ("n");
  627.     printf ("Pack Count:        %dn",
  628.     (csrRegCopy & L64853_CSR_PACK_CNT) >> 2);
  629.     printf ("Byte Address:      %dn",
  630.     (csrRegCopy & L64853_CSR_BYTE_ADDR) >> 11);
  631.     printf ("Device ID:         %dn",
  632.     (csrRegCopy & L64853_CSR_DEV_ID) >> 28);
  633.     printf ("n");
  634.     printf ("DMA Address    Reg = 0x%08xn", *pl64853DmaCtrl->pAdrsReg);
  635.     printf ("DMA Byte Count Reg = 0x%08xn", *pl64853DmaCtrl->pBcntReg);
  636.     return (OK);
  637.     }