Ignore:
Timestamp:
Apr 1, 2015, 3:42:03 PM (10 years ago)
Author:
alain
Message:

Introducing a new IOC driver supporting the VciMultiAhci? disk controller (in polling mode only).
Extending the MMC driver to support the SYNC command requested by the AHCI protocol on the tsar_generic_iob platform.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/softs/tsar_boot/drivers/reset_inval.c

    r911 r962  
    22 * \file   reset_inval.c
    33 * \date   December 14, 2014
    4  * \author Cesar Fuguet
     4 * \author Cesar Fuguet / Alain Greiner
    55 */
    66
     
    1313#endif
    1414
    15 static int* const mcc_address = (int* const)SEG_MMC_BASE;
     15static int* const mmc_address = (int* const)SEG_MMC_BASE;
    1616
    1717enum memc_registers
     
    3131
    3232/**
    33  * \brief Invalidate all data cache lines corresponding to a memory buffer
    34  *        (identified by an address and a size) in L1 cache and L2 cache.
     33 * \brief Invalidate all L1 cache lines corresponding to a memory buffer
     34 *        (identified by an address and a size).
    3535 */
    36 void reset_buf_invalidate (void* const buffer, size_t size, int inval_memc)
     36void reset_L1_inval( void* const buffer, size_t size )
    3737{
    3838    unsigned int i;
     
    4545            : /* no outputs */
    4646            : "i" (0x11), "R" (*((char*)buffer + i))
    47             : "memory"
    48             );
     47            : "memory" );
    4948    }
     49}
    5050
    51     if (inval_memc)
    52     {
    53         // this preloader uses only the cluster 0
    54         // It does not use the ADDR_HI bits, and does not take
    55         // any lock for exclusive access to MCC
    56         iowrite32(&mcc_address[MCC_ADDR_LO], (unsigned int) buffer);
    57         iowrite32(&mcc_address[MCC_ADDR_HI], (unsigned int) 0);
    58         iowrite32(&mcc_address[MCC_LENGTH] , (unsigned int) size);
    59         iowrite32(&mcc_address[MCC_CMD]    , (unsigned int) MCC_CMD_INVAL);
    60     }
     51/**
     52 * \brief Invalidate all L2 cache lines corresponding to a memory buffer
     53 *        (identified by an address and a size).
     54 */
     55void reset_L2_inval( void* const buffer, size_t size )
     56{
     57    iowrite32( &mmc_address[MCC_ADDR_LO], (unsigned int)buffer );
     58    iowrite32( &mmc_address[MCC_ADDR_HI], 0 );
     59    iowrite32( &mmc_address[MCC_LENGTH] , size );
     60    iowrite32( &mmc_address[MCC_CMD]    , MCC_CMD_INVAL);
     61}
     62
     63/**
     64 * \brief Update external RAM for all L2 cache lines corresponding to
     65 *        a memory buffer (identified by an address and a size).
     66 */
     67void reset_L2_sync ( void* const buffer, size_t size )
     68{
     69    iowrite32( &mmc_address[MCC_ADDR_LO], (unsigned int)buffer );
     70    iowrite32( &mmc_address[MCC_ADDR_HI], 0 );
     71    iowrite32( &mmc_address[MCC_LENGTH] , size );
     72    iowrite32( &mmc_address[MCC_CMD]    , MCC_CMD_SYNC );
    6173}
    6274
Note: See TracChangeset for help on using the changeset viewer.