a problem about pci-Ide dma transf - VxWorks

This is a discussion on a problem about pci-Ide dma transf - VxWorks ; I am writing a pci-ide driver support Udma (ACAD utp865) but when i test the Rw function ataRw,i meet a problem about pci-Ide dma transf my sequence is just as Neil Walker 1) wait until the hard drive is ready ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: a problem about pci-Ide dma transf

  1. a problem about pci-Ide dma transf

    I am writing a pci-ide driver support Udma (ACAD utp865)

    but when i test the Rw function ataRw,i meet a problem about pci-Ide
    dma transf


    my sequence is just as Neil Walker


    1) wait until the hard drive is ready by querying the
    status byte
    2) write to the following regs in the hard drive:


    the feature register
    the sector
    the cylinder
    the sdh, which will vary depending on wether
    you are in LBA or
    IBM mode


    3) setup the DMA transfer on the chip:


    tell the chip where the PRD table entry starts
    program the PRD table entry, indicating the end
    of the PRD
    write to the config register indicating native
    mode/clear interrupt
    pending


    4) send the command to the hard disk to initiate the
    transfer


    5) send a command to the dma control to enable bus
    master for either read or write




    but when i run the function i found some datas "lost ":


    ->
    -> d 0x82f98210
    82f98210: eb3e 9056 5835 444f 5333 3200 1020 2000 *.>.VX5DOS32.. .*
    82f98220: 0200 0000 00f8 0000 3f00 4000 0000 0000 *........?.@.....*
    82f98230: ffff ffff ffff ffff ffff ffff ffff ffff *................*
    82f98240: 0100 0600 0000 0000 0000 0000 0000 0000 *................*
    82f98250: 8000 2900 00b3 2a00 0000 0000 0000 0000 *..)...*.........*
    82f98260: 0000 4641 5433 3220 2020 0000 0000 0000 *..FAT32 ......*
    82f98270: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f98280: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f98290: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f982a0: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f982b0: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f982c0: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f982d0: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f982e0: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f982f0: ffff ffff ffff ffff ffff ffff ffff ffff *................*
    82f98300: ffff ffff ffff ffff ffff ffff ffff ffff *................*
    82f98310: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f98320: ffff ffff ffff ffff ffff ffff ffff ffff *................*
    82f98330: ffff ffff ffff ffff ffff ffff ffff ffff *................*
    82f98340: ffff ffff ffff ffff ffff ffff ffff ffff *................*
    82f98350: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f98360: 0000 0000 0000 0000 0000 0000 0000 0000 *................*
    82f98370: 0000 0000 0000 0000 0000 0000 0000 0000 *................*

    "ffffff" is the "lost " datas, the info is my read from the memey
    ,nocache

    the current datas is "00"or "eb3e 9056 5835 444f 5333 3200 1020 " but
    not the "f".


    When i set break between the 4) send the command to the hard disk to
    initiate the transfer

    and 5) send a command to the dma control to enable bus master for
    either read or write

    the transf is OK!! So i add the taskdelay (wait time ) and run it again
    ,the problem is also as

    before! add taskdelay is no use. i wonder whether the ide wait for
    some status?what ?

    or other reasons ?


  2. Re: a problem about pci-Ide dma transf



    trsc wrote:

    > before! add taskdelay is no use. i wonder whether the ide wait for
    > some status?what ?
    >
    > or other reasons ?


    It is probably a cache issue. My guess is you either need to get Vxworks
    to mark the DMA buffer as non-cacheable, or use the VxWorks caching
    functions to invalidate the cache right after a DMA read completes, and
    flush the cache right before you do a DMA write.

    David


  3. Re: a problem about pci-Ide dma transf

    thank you for your help ,but i found there are two set of functions :

    cacheFlush (DATA_CACHE,pBuf,nWords);
    cacheInvalidate (DATA_CACHE,pBuf, nWords);


    cacheDrvFlush( )
    cacheDrvInvalidate( ) //for driver

    when i use the cacheDrvInvalidate ,what is the the first ( "
    CACHE_FUNCS * pFuncs," /* pointer to CACHE_FUNCS */) parameter ?

    when i use the "cacheInvalidate " it seems no use .

    can you give me a example ?


    thanks again.


+ Reply to Thread