src/dev/arm/ufs_device.cc
/**
 * Constructor for the UFS Host device
 */
Constructor for the UFS Host device
Constructor for the UFS Host device
UFSHostDevice::UFSHostDevice(const UFSHostDeviceParams &p) :
    DmaDevice(p),
    pioAddr(p.pio_addr),
    pioSize(0x0FFF),
    pioDelay(p.pio_latency),
    intNum(p.int_num),
    gic(p.gic),
    lunAvail(p.image.size()),
    UFSSlots(p.ufs_slots - 1),
    readPendingNum(0),
    writePendingNum(0),
    activeDoorbells(0),
    pendingDoorbells(0),
    countInt(0),
    transferTrack(0),
    taskCommandTrack(0),
    idlePhaseStart(0),
    stats(this),
    SCSIResumeEvent([this]{ SCSIStart(); }, name()),
    UTPEvent([this]{ finalUTP(); }, name())
{
    DPRINTF(UFSHostDevice, "The hostcontroller hosts %d Logic units\n",
            lunAvail);
    UFSDevice.resize(lunAvail);
    for (int count = 0; count < lunAvail; count++) {
        UFSDevice[count] = new UFSSCSIDevice(p, count,
                [this]() { LUNSignal(); },
                [this]() { readCallback(); });
    }
    if (UFSSlots > 31)
        warn("UFSSlots = %d, this will results in %d command slots",
             UFSSlots, (UFSSlots & 0x1F));
    if ((UFSSlots & 0x1F) == 0)
        fatal("Number of UFS command slots should be between 1 and 32.");
    setValues();
}
UFSHostDevice :: UFSHostDevice ( const UFSHostDeviceParams & p ) : DmaDevice ( p ) , pioAddr ( p . pio_addr ) , pioSize ( 0x0FFF ) , pioDelay ( p . pio_latency ) , intNum ( p . int_num ) , gic ( p . gic ) , lunAvail ( p . image . size ( ) ) , UFSSlots ( p . ufs_slots - 1 ) , readPendingNum ( 0 ) , writePendingNum ( 0 ) , activeDoorbells ( 0 ) , pendingDoorbells ( 0 ) , countInt ( 0 ) , transferTrack ( 0 ) , taskCommandTrack ( 0 ) , idlePhaseStart ( 0 ) , stats ( this ) , SCSIResumeEvent ( [ this ] { SCSIStart ( ) ; } , name ( ) ) , UTPEvent ( [ this ] { finalUTP ( ) ; } , name ( ) ) { DPRINTF ( UFSHostDevice , " \n " , lunAvail ) ; UFSDevice . resize ( lunAvail ) ; for ( int count = 0 ; count < lunAvail ; count ++ ) { UFSDevice [ count ] = new UFSSCSIDevice ( p , count , [ this ] ( ) { LUNSignal ( ) ; } , [ this ] ( ) { readCallback ( ) ; } ) ; } if ( UFSSlots > 31 ) warn ( " " , UFSSlots , ( UFSSlots & 0x1F ) ) ; if ( ( UFSSlots & 0x1F ) == 0 ) fatal ( " " ) ; setValues ( ) ; }
Constructor for the UFS Host device
Constructor for the UFS Host device