Changeset 592 for trunk/modules/vci_spi


Ignore:
Timestamp:
Dec 5, 2013, 5:15:26 PM (11 years ago)
Author:
bouyer
Message:
  • report DMA errors
  • minor changes to sync with the VHDL model
Location:
trunk/modules/vci_spi
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_spi/caba/source/src/vci_spi.cpp

    r579 r592  
    161161                    if (s_dma_bsy)
    162162                        data |= SPI_CTRL_DMA_BSY;
     163                    if (r_dma_error)
     164                        data |= SPI_CTRL_DMA_ERR;
    163165                    data |= (uint32_t)r_ctrl_char_len.read();
    164166                    r_rdata = data;
     
    256258        r_spi_clk_ignore = r_ctrl_cpha;
    257259        r_spi_bit_count = r_ctrl_char_len;
    258         r_spi_out = (r_txrx[(r_ctrl_char_len -1)/ 64] >> ((r_ctrl_char_len - 1) % 64)) & (uint64_t)0x0000000000000001ULL;
    259260        if (r_dma_count != 0) {
    260261                if (r_read.read())
     
    264265        } else if (r_spi_bsy.read() && !r_spi_done.read()) {
    265266            r_spi_fsm = S_XMIT;
     267            r_spi_out = (r_txrx[(r_ctrl_char_len -1)/ 64] >> ((r_ctrl_char_len - 1) % 64)) & (uint64_t)0x0000000000000001ULL;
    266268        }
    267269        break;
     
    294296    case S_DMA_SEND:
    295297        r_spi_out = 1;
    296         r_txrx[0] = 0xffffffff;
    297298        r_spi_clk_counter = r_divider.read();
    298299        r_spi_clk = 0;
     
    305306                    (typename vci_param::data_t)r_txrx[0]);
    306307                r_spi_word_count = r_spi_word_count - 1;
     308                r_txrx[0] = 0xffffffff;
    307309                if ( r_spi_word_count == 0 ) {
    308310                    r_spi_fsm = S_DMA_SEND_END;
  • trunk/modules/vci_spi/include/soclib/vcispi.h

    r579 r592  
    4141};
    4242
     43#define SPI_CTRL_DMA_ERR        (1 << 17) /* R   DMA error                    */
    4344#define SPI_CTRL_DMA_BSY        (1 << 16) /* R   DMA in progress              */
    4445#define SPI_CTRL_CPOL           (1 << 15) /* R/W Clock polarity               */
Note: See TracChangeset for help on using the changeset viewer.