src/dev/arm/ufs_device.cc
/**
 * Manage write transfer. Manages correct transfer flow and makes sure that
 * the queues are filled on time
 */
Manage write transfer. Manages correct transfer flow and makes sure that
the queues are filled on time
Manage write transfer . Manages correct transfer flow and makes sure that the queues are filled on time
void
UFSHostDevice::manageWriteTransfer(uint8_t LUN, uint64_t offset, uint32_t
                                   sg_table_length, struct UFSHCDSGEntry*
                                   sglist)
{
    struct writeToDiskBurst next_packet;
    next_packet.SCSIDiskOffset = offset;
    UFSDevice[LUN]->setTotalWrite(sg_table_length);
    for (uint32_t count = 0; count < sg_table_length; count++) {
        next_packet.start = sglist[count].upperAddr;
        next_packet.start = (next_packet.start << 32) |
            (sglist[count].baseAddr & 0xFFFFFFFF);
        next_packet.LUN = LUN;
        DPRINTF(UFSHostDevice, "Write data DMA start: 0x%8x\n",
                next_packet.start);
        DPRINTF(UFSHostDevice, "Write data DMA size: 0x%8x\n",
                (sglist[count].size + 1));
        assert(sglist[count].size > 0);
        if (count != 0)
            next_packet.SCSIDiskOffset = next_packet.SCSIDiskOffset +
                (sglist[count - 1].size + 1);
        next_packet.size = sglist[count].size + 1;
        if (dmaWriteInfo.empty())
            writeDevice(NULL, true, next_packet.start, next_packet.size,
                        NULL, next_packet.SCSIDiskOffset, next_packet.LUN);
        else
            DPRINTF(UFSHostDevice, "Write not initiated queue: %d\n",
                    dmaWriteInfo.size());
        dmaWriteInfo.push_back(next_packet);
        DPRINTF(UFSHostDevice, "Write Location: 0x%8x\n",
                next_packet.SCSIDiskOffset);
        DPRINTF(UFSHostDevice, "Write transfer #: 0x%8x\n", count + 1);
        stats.totalWrittenSSD += (sglist[count].size + 1);
    }
    ++stats.totalWriteUFSTransactions;
}
void UFSHostDevice :: manageWriteTransfer ( uint8_t LUN , uint64_t offset , uint32_t sg_table_length , struct UFSHCDSGEntry * sglist ) { struct writeToDiskBurst next_packet ; next_packet . SCSIDiskOffset = offset ; UFSDevice [ LUN ] -> setTotalWrite ( sg_table_length ) ; for ( uint32_t count = 0 ; count < sg_table_length ; count ++ ) { next_packet . start = sglist [ count ] . upperAddr ; next_packet . start = ( next_packet . start << 32 ) | ( sglist [ count ] . baseAddr & 0xFFFFFFFF ) ; next_packet . LUN = LUN ; DPRINTF ( UFSHostDevice , " \n " , next_packet . start ) ; DPRINTF ( UFSHostDevice , " \n " , ( sglist [ count ] . size + 1 ) ) ; assert ( sglist [ count ] . size > 0 ) ; if ( count != 0 ) next_packet . SCSIDiskOffset = next_packet . SCSIDiskOffset + ( sglist [ count - 1 ] . size + 1 ) ; next_packet . size = sglist [ count ] . size + 1 ; if ( dmaWriteInfo . empty ( ) ) writeDevice ( NULL , true , next_packet . start , next_packet . size , NULL , next_packet . SCSIDiskOffset , next_packet . LUN ) ; else DPRINTF ( UFSHostDevice , " \n " , dmaWriteInfo . size ( ) ) ; dmaWriteInfo . push_back ( next_packet ) ; DPRINTF ( UFSHostDevice , " \n " , next_packet . SCSIDiskOffset ) ; DPRINTF ( UFSHostDevice , " \n " , count + 1 ) ; stats . totalWrittenSSD += ( sglist [ count ] . size + 1 ) ; } ++ stats . totalWriteUFSTransactions ; }
Manage write transfer.
Manage write transfer .
/**
     * Break-up the transactions into actions defined by the scatter gather
     * list.
     */ /**If the queue is empty, the transaction should be initiated*/ /** stats **/ /**stats**/