gem5 v24.0.0.0
|
Host controller layer: This is your Host controller This layer handles the UFS functionality. More...
#include <ufs_device.hh>
Classes | |
struct | HCIMem |
Host Controller Interface This is a set of registers that allow the driver to control the transactions to the flash devices. More... | |
struct | LUNInfo |
Logic unit information structure. More... | |
struct | SCSIReply |
SCSI reply structure. More... | |
struct | SCSIResumeInfo |
After a SCSI command has been identified, the SCSI resume function will handle it. More... | |
struct | taskStart |
Task start information. More... | |
struct | transferDoneInfo |
transfer completion info. More... | |
struct | transferInfo |
Different events, and scenarios require different types of information. More... | |
struct | transferStart |
Transfer start information. More... | |
struct | UFSHCDSGEntry |
struct UFSHCDSGEntry - UFSHCI PRD Entry baseAddr: Lower 32bit physical address DW-0 upperAddr: Upper 32bit physical address DW-1 reserved: Reserved for future use DW-2 size: size of physical segment DW-3 More... | |
struct | UFSHostDeviceStats |
Statistics. More... | |
class | UFSSCSIDevice |
device layer: This is your Logic unit This layer implements the SCSI functionality of the UFS Device One logic unit controls one or more disk partitions More... | |
struct | UPIUMessage |
UPIU tranfer message. More... | |
struct | UTPTransferCMDDesc |
struct UTPTransferCMDDesc - UFS Commad Descriptor structure commandUPIU: Command UPIU Frame address responseUPIU: Response UPIU Frame address PRDTable: Physcial Region Descriptor All lengths as defined by JEDEC220 More... | |
struct | UTPTransferReqDesc |
struct UTPTransferReqDesc - UTRD structure header: UTRD header DW-0 to DW-3 commandDescBaseAddrLo: UCD base address low DW-4 commandDescBaseAddrHi: UCD base address high DW-5 responseUPIULength: response UPIU length DW-6 responseUPIUOffset: response UPIU offset DW-6 PRDTableLength: Physical region descriptor length DW-7 PRDTableOffset: Physical region descriptor offset DW-7 More... | |
struct | UTPUPIUHeader |
All the data structures are defined in the UFS standard This standard be found at the JEDEC website free of charge (login required): http://www.jedec.org/standards-documents/results/jesd220. More... | |
struct | UTPUPIURSP |
struct UTPUPIURSP - Response UPIU structure header: UPIU header DW-0 to DW-2 residualTransferCount: Residual transfer count DW-3 reserved: Reserved DW-4 to DW-7 senseDataLen: Sense data length DW-8 U16 senseData: Sense data field DW-8 to DW-12 More... | |
struct | UTPUPIUTaskReq |
struct UTPUPIUTaskReq - Task request UPIU structure header - UPIU header structure DW0 to DW-2 inputParam1: Input param 1 DW-3 inputParam2: Input param 2 DW-4 inputParam3: Input param 3 DW-5 reserved: Reserver DW-6 to DW-7 More... | |
struct | writeToDiskBurst |
Disk transfer burst information. More... | |
Public Member Functions | |
UFSHostDevice (const UFSHostDeviceParams &p) | |
Constructor for the UFS Host device. | |
DrainState | drain () override |
Drain; needed to enable checkpoints. | |
void | checkDrain () |
Checkdrain; needed to enable checkpoints. | |
void | serialize (CheckpointOut &cp) const override |
Serialize; needed to make checkpoints. | |
void | unserialize (CheckpointIn &cp) override |
Unserialize; needed to restore from checkpoints. | |
Public Member Functions inherited from gem5::DmaDevice | |
DmaDevice (const Params &p) | |
virtual | ~DmaDevice ()=default |
void | dmaWrite (Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0) |
void | dmaWrite (Addr addr, int size, Event *event, uint8_t *data, Tick delay=0) |
void | dmaRead (Addr addr, int size, Event *event, uint8_t *data, uint32_t sid, uint32_t ssid, Tick delay=0) |
void | dmaRead (Addr addr, int size, Event *event, uint8_t *data, Tick delay=0) |
bool | dmaPending () const |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
Addr | cacheBlockSize () const |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. | |
Public Member Functions inherited from gem5::PioDevice | |
PioDevice (const Params &p) | |
virtual | ~PioDevice () |
void | init () override |
init() is called after all C++ SimObjects have been created and all ports are connected. | |
Port & | getPort (const std::string &if_name, PortID idx=InvalidPortID) override |
Get a port with a given name and index. | |
Public Member Functions inherited from gem5::ClockedObject | |
ClockedObject (const ClockedObjectParams &p) | |
Public Member Functions inherited from gem5::SimObject | |
const Params & | params () const |
SimObject (const Params &p) | |
virtual | ~SimObject () |
virtual void | loadState (CheckpointIn &cp) |
loadState() is called on each SimObject when restoring from a checkpoint. | |
virtual void | initState () |
initState() is called on each SimObject when not restoring from a checkpoint. | |
virtual void | regProbePoints () |
Register probe points for this object. | |
virtual void | regProbeListeners () |
Register probe listeners for this object. | |
ProbeManager * | getProbeManager () |
Get the probe manager for this object. | |
virtual void | startup () |
startup() is the final initialization call before simulation. | |
virtual void | memWriteback () |
Write back dirty buffers to memory using functional writes. | |
virtual void | memInvalidate () |
Invalidate the contents of memory buffers. | |
Public Member Functions inherited from gem5::EventManager | |
EventQueue * | eventQueue () const |
void | schedule (Event &event, Tick when) |
void | deschedule (Event &event) |
void | reschedule (Event &event, Tick when, bool always=false) |
void | schedule (Event *event, Tick when) |
void | deschedule (Event *event) |
void | reschedule (Event *event, Tick when, bool always=false) |
void | wakeupEventQueue (Tick when=(Tick) -1) |
This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers. | |
void | setCurTick (Tick newVal) |
EventManager (EventManager &em) | |
Event manger manages events in the event queue. | |
EventManager (EventManager *em) | |
EventManager (EventQueue *eq) | |
Public Member Functions inherited from gem5::Serializable | |
Serializable () | |
virtual | ~Serializable () |
void | serializeSection (CheckpointOut &cp, const char *name) const |
Serialize an object into a new section. | |
void | serializeSection (CheckpointOut &cp, const std::string &name) const |
void | unserializeSection (CheckpointIn &cp, const char *name) |
Unserialize an a child object. | |
void | unserializeSection (CheckpointIn &cp, const std::string &name) |
Public Member Functions inherited from gem5::Drainable | |
DrainState | drainState () const |
Return the current drain state of an object. | |
virtual void | notifyFork () |
Notify a child process of a fork. | |
Public Member Functions inherited from gem5::statistics::Group | |
Group (Group *parent, const char *name=nullptr) | |
Construct a new statistics group. | |
virtual | ~Group () |
virtual void | regStats () |
Callback to set stat parameters. | |
virtual void | resetStats () |
Callback to reset stats. | |
virtual void | preDumpStats () |
Callback before stats are dumped. | |
void | addStat (statistics::Info *info) |
Register a stat with this group. | |
const std::map< std::string, Group * > & | getStatGroups () const |
Get all child groups associated with this object. | |
const std::vector< Info * > & | getStats () const |
Get all stats associated with this object. | |
void | addStatGroup (const char *name, Group *block) |
Add a stat block as a child of this block. | |
const Info * | resolveStat (std::string name) const |
Resolve a stat by its name within this group. | |
void | mergeStatGroup (Group *block) |
Merge the contents (stats & children) of a block to this block. | |
Group ()=delete | |
Group (const Group &)=delete | |
Group & | operator= (const Group &)=delete |
Public Member Functions inherited from gem5::Named | |
Named (const std::string &name_) | |
virtual | ~Named ()=default |
virtual std::string | name () const |
Public Member Functions inherited from gem5::Clocked | |
void | updateClockPeriod () |
Update the tick to the current tick. | |
Tick | clockEdge (Cycles cycles=Cycles(0)) const |
Determine the tick when a cycle begins, by default the current one, but the argument also enables the caller to determine a future cycle. | |
Cycles | curCycle () const |
Determine the current cycle, corresponding to a tick aligned to a clock edge. | |
Tick | nextCycle () const |
Based on the clock of the object, determine the start tick of the first cycle that is at least one cycle in the future. | |
uint64_t | frequency () const |
Tick | clockPeriod () const |
double | voltage () const |
Cycles | ticksToCycles (Tick t) const |
Tick | cyclesToTicks (Cycles c) const |
Private Types | |
enum | UFSHCIRegisters { regControllerCapabilities = 0x00 , regUFSVersion = 0x08 , regControllerDEVID = 0x10 , regControllerPRODID = 0x14 , regInterruptStatus = 0x20 , regInterruptEnable = 0x24 , regControllerStatus = 0x30 , regControllerEnable = 0x34 , regUICErrorCodePHYAdapterLayer = 0x38 , regUICErrorCodeDataLinkLayer = 0x3C , regUICErrorCodeNetworkLayer = 0x40 , regUICErrorCodeTransportLayer = 0x44 , regUICErrorCodeDME = 0x48 , regUTPTransferREQINTAGGControl = 0x4C , regUTPTransferREQListBaseL = 0x50 , regUTPTransferREQListBaseH = 0x54 , regUTPTransferREQDoorbell = 0x58 , regUTPTransferREQListClear = 0x5C , regUTPTransferREQListRunStop = 0x60 , regUTPTaskREQListBaseL = 0x70 , regUTPTaskREQListBaseH = 0x74 , regUTPTaskREQDoorbell = 0x78 , regUTPTaskREQListClear = 0x7C , regUTPTaskREQListRunStop = 0x80 , regUICCommand = 0x90 , regUICCommandArg1 = 0x94 , regUICCommandArg2 = 0x98 , regUICCommandArg3 = 0x9C } |
Private Member Functions | |
AddrRangeList | getAddrRanges () const override |
Address range functions. | |
Tick | read (PacketPtr pkt) override |
register access functions | |
Tick | write (PacketPtr pkt) override |
UFSHCD write function. | |
void | setValues () |
Initialization function. | |
void | requestHandler () |
Handler functions. | |
void | commandHandler () |
Command handler function. | |
void | taskStart () |
Task Start function. | |
void | taskHandler (struct UTPUPIUTaskReq *request_in, uint32_t req_pos, Addr finaladdress, uint32_t finalsize) |
Task handler function. | |
void | transferStart () |
Transfer Start function. | |
void | transferHandler (struct UTPTransferReqDesc *request_in, int req_pos, Addr finaladdress, uint32_t finalsize, uint32_t done) |
Transfer handler function. | |
void | SCSIStart () |
Transfer SCSI function. | |
void | SCSIResume (uint32_t lun_id) |
Starts the scsi handling function in the apropriate Logic unit, prepares the right data transfer scheme and kicks it off. | |
void | LUNSignal () |
LU callback function to indicate that the action has completed. | |
void | transferDone (Addr responseStartAddr, uint32_t req_pos, struct UTPUPIURSP request_out, uint32_t size, Addr address, uint8_t *destination, bool finished, uint32_t lun_id) |
transfer done, the beginning of the final stage of the transfer. | |
void | finalUTP () |
final UTP, sends the last acknowledge data structure to the system; prepares the clean up functions. | |
void | clearInterrupt () |
Interrupt control functions. | |
void | generateInterrupt () |
set interrupt and sort out the doorbell register. | |
void | writeDevice (Event *additional_action, bool toDisk, Addr start, int size, uint8_t *destination, uint64_t SCSIDiskOffset, uint32_t lun_id) |
DMA transfer functions These allow the host to push/pull the data to the memory The provided event indicates what the next phase it that will handle the obtained data, or what the follow up action is once the data has been pushed to the memory. | |
void | readDevice (bool lastTransfer, Addr SCSIStart, uint32_t SCSISize, uint8_t *SCSIDestination, bool no_cache, Event *additional_action) |
Dma transaction function: read device. | |
void | manageWriteTransfer (uint8_t LUN, uint64_t offset, uint32_t sg_table_length, struct UFSHCDSGEntry *sglist) |
Disk transfer management functions these set up the queues, and initiated them, leading to the data transaction timing model based on the scatter gather list constructed in SCSIresume. | |
void | manageReadTransfer (uint32_t size, uint32_t LUN, uint64_t offset, uint32_t sg_table_length, struct UFSHCDSGEntry *sglist) |
Manage read transfer. | |
void | readDone () |
Read done Started at the end of a transaction after the last read action. | |
void | writeDone () |
Write done After a DMA write with data intended for the disk, this function is called. | |
void | readCallback () |
Read callback Call back function for the logic units to indicate the completion of a read action. | |
void | readGarbage () |
Read garbage A read from disk data structure can vary in size and is therefor allocated on creation. | |
Private Attributes | |
const Addr | pioAddr |
Host controller information. | |
const Addr | pioSize |
const Tick | pioDelay |
const int | intNum |
BaseGic * | gic |
const uint32_t | lunAvail |
const uint8_t | UFSSlots |
HCIMem | UFSHCIMem |
Host controller memory. | |
int | readPendingNum |
Track number of DMA transactions in progress. | |
int | writePendingNum |
uint8_t | activeDoorbells |
Statistics helper variables Active doorbells indicates how many doorbells are in teh process of being handled. | |
uint8_t | pendingDoorbells |
uint32_t | countInt |
interrupt verification This keeps track of the number of interrupts generated. | |
uint32_t | transferTrack |
Track the transfer This is allows the driver to "group" certain transfers together by using a tag in the UPIU. | |
uint32_t | taskCommandTrack |
Tick | transactionStart [32] |
Helper for latency stats These variables keep track of the latency for every doorbell. | |
Tick | idlePhaseStart |
std::vector< UFSSCSIDevice * > | UFSDevice |
logic units connected to the UFS Host device Note again that the "device" as such is represented by one or multiple logic units. | |
struct SCSIReply | request_out_datain |
SCSI reply structure, used for direct answering. | |
struct SCSIResumeInfo | SCSIInfo |
SCSI resume info information structure for SCSI resume. | |
std::deque< struct transferStart > | transferEnd |
To finish the transaction one needs information about the original message. | |
std::deque< struct taskStart > | taskInfo |
When a task/transfer is started it needs information about the task/transfer it is about to perform. | |
std::deque< struct transferStart > | transferStartInfo |
std::deque< struct writeToDiskBurst > | dmaWriteInfo |
Information to get a DMA transaction. | |
std::deque< struct transferInfo > | SSDWriteinfo |
Information from DMA transaction to disk. | |
std::deque< struct transferInfo > | SSDReadPending |
Information from the Disk, waiting to be pushed to the DMA. | |
std::deque< struct UTPTransferReqDesc * > | garbage |
garbage queue, ensure clearing of the allocated memory | |
struct UFSHostDeviceStats | stats |
RequestHandler stats. | |
std::deque< EventFunctionWrapper > | readDoneEvent |
Transfer flow events Basically these events form two queues, one from memory to UFS device (DMA) and one from device to flash (SSD). | |
std::deque< EventFunctionWrapper > | writeDoneEvent |
EventFunctionWrapper | SCSIResumeEvent |
The events that control the functionality. | |
EventFunctionWrapper | UTPEvent |
Wait for the moment where we can send the last frame. | |
std::deque< EventFunctionWrapper > | readGarbageEventQueue |
Event after a read to clean up the UTP data structures. | |
std::deque< EventFunctionWrapper > | taskEventQueue |
Multiple tasks transfers can be scheduled at once for the device, the only thing we know for sure about them is that they will happen in a first come first serve order; hence we need to queue. | |
std::deque< EventFunctionWrapper > | transferEventQueue |
Static Private Attributes | |
static const unsigned int | UTPTransferREQCOMPL = 0x01 |
Bits of interest within UFS data packages. | |
static const unsigned int | UTPTaskREQCOMPL = 0x200 |
static const unsigned int | UICCommandCOMPL = 0x400 |
static const unsigned int | UICCommandReady = 0x08 |
Additional Inherited Members | |
Public Types inherited from gem5::DmaDevice | |
typedef DmaDeviceParams | Params |
Public Types inherited from gem5::PioDevice | |
using | Params = PioDeviceParams |
Public Types inherited from gem5::ClockedObject | |
using | Params = ClockedObjectParams |
Parameters of ClockedObject. | |
Public Types inherited from gem5::SimObject | |
typedef SimObjectParams | Params |
Static Public Member Functions inherited from gem5::SimObject | |
static void | serializeAll (const std::string &cpt_dir) |
Create a checkpoint by serializing all SimObjects in the system. | |
static SimObject * | find (const char *name) |
Find the SimObject with the given name and return a pointer to it. | |
static void | setSimObjectResolver (SimObjectResolver *resolver) |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
static SimObjectResolver * | getSimObjectResolver () |
There is a single object name resolver, and it is only set when simulation is restoring from checkpoints. | |
Static Public Member Functions inherited from gem5::Serializable | |
static const std::string & | currentSection () |
Gets the fully-qualified name of the active section. | |
static void | generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream) |
Generate a checkpoint file so that the serialization can be routed to it. | |
Public Attributes inherited from gem5::ClockedObject | |
PowerState * | powerState |
Protected Member Functions inherited from gem5::Drainable | |
Drainable () | |
virtual | ~Drainable () |
virtual void | drainResume () |
Resume execution after a successful drain. | |
void | signalDrainDone () const |
Signal that an object is drained. | |
Protected Member Functions inherited from gem5::Clocked | |
Clocked (ClockDomain &clk_domain) | |
Create a clocked object and set the clock domain based on the parameters. | |
Clocked (Clocked &)=delete | |
Clocked & | operator= (Clocked &)=delete |
virtual | ~Clocked () |
Virtual destructor due to inheritance. | |
void | resetClock () const |
Reset the object's clock using the current global tick value. | |
virtual void | clockPeriodUpdated () |
A hook subclasses can implement so they can do any extra work that's needed when the clock rate is changed. | |
Protected Attributes inherited from gem5::DmaDevice | |
DmaPort | dmaPort |
Protected Attributes inherited from gem5::PioDevice | |
System * | sys |
PioPort< PioDevice > | pioPort |
The pioPort that handles the requests for us and provides us requests that it sees. | |
Protected Attributes inherited from gem5::SimObject | |
const SimObjectParams & | _params |
Cached copy of the object parameters. | |
Protected Attributes inherited from gem5::EventManager | |
EventQueue * | eventq |
A pointer to this object's event queue. | |
Host controller layer: This is your Host controller This layer handles the UFS functionality.
It tracks all the different transaction stages and uses the device layer and the flash layer to determine the transaction flow.
Definition at line 172 of file ufs_device.hh.
|
private |
Definition at line 1206 of file ufs_device.hh.
gem5::UFSHostDevice::UFSHostDevice | ( | const UFSHostDeviceParams & | p | ) |
Constructor for the UFS Host device.
Definition at line 718 of file ufs_device.cc.
References SCSIStart().
void gem5::UFSHostDevice::checkDrain | ( | ) |
Checkdrain; needed to enable checkpoints.
Definition at line 2318 of file ufs_device.cc.
References activeDoorbells, DPRINTF, gem5::Draining, gem5::Drainable::drainState(), gem5::Drainable::signalDrainDone(), gem5::UFSHostDevice::HCIMem::TRUTRLDBR, and UFSHCIMem.
Referenced by clearInterrupt(), and generateInterrupt().
|
private |
Interrupt control functions.
Clear interrupt.
end of a transaction
Definition at line 1812 of file ufs_device.cc.
References checkDrain(), gem5::BaseGic::clearInt(), countInt, gem5::curTick(), DPRINTF, gic, idlePhaseStart, intNum, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, and UFSHCIMem.
Referenced by read().
|
private |
Command handler function.
Handles the commands that are given.
Handles the command send to the Host controller
At this point in time, not many commands have been implemented in the driver.
Definition at line 1354 of file ufs_device.cc.
References gem5::UFSHostDevice::HCIMem::CMDUICCMDR, gem5::UFSHostDevice::HCIMem::ORHostControllerStatus, and UFSHCIMem.
Referenced by requestHandler().
|
overridevirtual |
Drain; needed to enable checkpoints.
Reimplemented from gem5::SimObject.
Definition at line 2302 of file ufs_device.cc.
References DPRINTF, gem5::Drained, gem5::Draining, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, and UFSHCIMem.
|
private |
final UTP, sends the last acknowledge data structure to the system; prepares the clean up functions.
finalUTP.
Second part of the transfer done event. this sends the final response: the UTP response. After this transaction the doorbell shall be cleared, and the interupt shall be set.
stats
Last message that will be transfered
clean and ensure that the tracker is updated
stats
This is the moment that the device is available again
Definition at line 1715 of file ufs_device.cc.
References activeDoorbells, gem5::UFSHostDevice::UFSHostDeviceStats::averageDoorbell, gem5::X86ISA::count, gem5::curTick(), DPRINTF, garbage, gem5::UFSHostDevice::UFSHostDeviceStats::maxDoorbell, pendingDoorbells, readDevice(), gem5::statistics::DistBase< Derived, Stor >::sample(), SCSIResume(), stats, gem5::UFSHostDevice::UFSHostDeviceStats::transactionLatency, transactionStart, transferEnd, transferEventQueue, transferTrack, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, UFSDevice, UFSHCIMem, and gem5::statistics::ScalarBase< Derived, Stor >::value().
|
private |
set interrupt and sort out the doorbell register.
just to keep track of the transactions
step5 clear doorbell
step6 raise interrupt
Definition at line 1789 of file ufs_device.cc.
References checkDrain(), countInt, DPRINTF, gic, intNum, pendingDoorbells, gem5::BaseGic::sendInt(), transferTrack, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, and UFSHCIMem.
Referenced by readDone(), and requestHandler().
|
overrideprivatevirtual |
Address range functions.
Determine address ranges.
Implements gem5::PioDevice.
Definition at line 903 of file ufs_device.cc.
References pioAddr, pioSize, and gem5::RangeSize().
|
private |
LU callback function to indicate that the action has completed.
Find finished transfer.
Callback function. One of the LUNs is done with the disk transfer and reports back to the controller. This function finds out who it was, and calls transferDone.
Definition at line 1644 of file ufs_device.cc.
References gem5::curTick(), lunAvail, panic, gem5::UFSHostDevice::transferInfo::size, transferDone(), and UFSDevice.
|
private |
Manage read transfer.
Manages correct transfer flow and makes sure that the queues are filled on time
Break-up the transactions into actions defined by the scatter gather list.
The disk image is read here; but the action is simultated later You can see this as the preparation stage, whereas later is the simulation phase.
stats
stats
Definition at line 2091 of file ufs_device.cc.
References gem5::UFSHostDevice::UFSHostDeviceStats::averageReadSSDQueue, gem5::X86ISA::count, gem5::UFSHostDevice::UFSHostDeviceStats::currentReadSSDQueue, DPRINTF, gem5::UFSHostDevice::transferInfo::filePointer, gem5::UFSHostDevice::transferInfo::lunID, gem5::ArmISA::offset, gem5::UFSHostDevice::transferInfo::offset, gem5::statistics::ScalarBase< Derived, Stor >::size(), gem5::UFSHostDevice::transferInfo::size, gem5::UFSHostDevice::UFSHCDSGEntry::size, stats, gem5::UFSHostDevice::UFSHostDeviceStats::totalReadSSD, gem5::UFSHostDevice::UFSHostDeviceStats::totalReadUFSTransactions, UFSDevice, and gem5::UFSHostDevice::UFSHCDSGEntry::upperAddr.
Referenced by SCSIResume().
|
private |
Disk transfer management functions these set up the queues, and initiated them, leading to the data transaction timing model based on the scatter gather list constructed in SCSIresume.
Manage write transfer.
Manages correct transfer flow and makes sure that the queues are filled on time
Break-up the transactions into actions defined by the scatter gather list.
If the queue is empty, the transaction should be initiated
stats
stats
Definition at line 1902 of file ufs_device.cc.
References gem5::X86ISA::count, dmaWriteInfo, DPRINTF, gem5::UFSHostDevice::writeToDiskBurst::LUN, gem5::ArmISA::offset, gem5::UFSHostDevice::writeToDiskBurst::SCSIDiskOffset, gem5::UFSHostDevice::UFSHCDSGEntry::size, gem5::UFSHostDevice::writeToDiskBurst::size, gem5::UFSHostDevice::writeToDiskBurst::start, stats, gem5::UFSHostDevice::UFSHostDeviceStats::totalWriteUFSTransactions, gem5::UFSHostDevice::UFSHostDeviceStats::totalWrittenSSD, UFSDevice, gem5::UFSHostDevice::UFSHCDSGEntry::upperAddr, and writeDevice().
Referenced by SCSIResume().
register access functions
UFSHCD read register.
This function allows the system to read the register entries
Implements gem5::PioDevice.
Definition at line 916 of file ufs_device.cc.
References clearInterrupt(), gem5::UFSHostDevice::HCIMem::CMDUCMDARG1, gem5::UFSHostDevice::HCIMem::CMDUCMDARG2, gem5::UFSHostDevice::HCIMem::CMDUCMDARG3, gem5::UFSHostDevice::HCIMem::CMDUICCMDR, data, gem5::Packet::getAddr(), gem5::UFSHostDevice::HCIMem::HCCAP, gem5::UFSHostDevice::HCIMem::HCHCDDID, gem5::UFSHostDevice::HCIMem::HCHCPMID, gem5::UFSHostDevice::HCIMem::HCversion, gem5::Packet::makeResponse(), gem5::UFSHostDevice::HCIMem::ORHostControllerEnable, gem5::UFSHostDevice::HCIMem::ORHostControllerStatus, gem5::UFSHostDevice::HCIMem::ORInterruptEnable, gem5::UFSHostDevice::HCIMem::ORInterruptStatus, gem5::UFSHostDevice::HCIMem::ORUECDL, gem5::UFSHostDevice::HCIMem::ORUECDME, gem5::UFSHostDevice::HCIMem::ORUECN, gem5::UFSHostDevice::HCIMem::ORUECPA, gem5::UFSHostDevice::HCIMem::ORUECT, gem5::UFSHostDevice::HCIMem::ORUTRIACR, pioDelay, regControllerCapabilities, regControllerDEVID, regControllerEnable, regControllerPRODID, regControllerStatus, regInterruptEnable, regInterruptStatus, regUFSVersion, regUICCommand, regUICCommandArg1, regUICCommandArg2, regUICCommandArg3, regUICErrorCodeDataLinkLayer, regUICErrorCodeDME, regUICErrorCodeNetworkLayer, regUICErrorCodePHYAdapterLayer, regUICErrorCodeTransportLayer, regUTPTaskREQDoorbell, regUTPTaskREQListBaseH, regUTPTaskREQListBaseL, regUTPTaskREQListClear, regUTPTaskREQListRunStop, regUTPTransferREQDoorbell, regUTPTransferREQINTAGGControl, regUTPTransferREQListBaseH, regUTPTransferREQListBaseL, regUTPTransferREQListClear, regUTPTransferREQListRunStop, gem5::Packet::setLE(), gem5::UFSHostDevice::HCIMem::TMUTMRLBA, gem5::UFSHostDevice::HCIMem::TMUTMRLBAU, gem5::UFSHostDevice::HCIMem::TMUTMRLCLR, gem5::UFSHostDevice::HCIMem::TMUTMRLDBR, gem5::UFSHostDevice::HCIMem::TMUTMRLRSR, gem5::UFSHostDevice::HCIMem::TRUTRLBA, gem5::UFSHostDevice::HCIMem::TRUTRLBAU, gem5::UFSHostDevice::HCIMem::TRUTRLCLR, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, gem5::UFSHostDevice::HCIMem::TRUTRLRSR, and UFSHCIMem.
|
private |
Read callback Call back function for the logic units to indicate the completion of a read action.
Read callback, on the way from the disk to the DMA.
Note that this is needed because the read functionality needs to push data structures back to the memory.
Called by the UFSSCSI layer.
stats
Definition at line 2218 of file ufs_device.cc.
References gem5::curTick(), DPRINTF, lunAvail, name(), panic, readDevice(), readGarbage(), readGarbageEventQueue, SSDReadPending, stats, gem5::UFSHostDevice::UFSHostDeviceStats::totalReadDiskTransactions, and UFSDevice.
|
private |
Dma transaction function: read device.
Notice that the dma action is from a device perspective, while this function is from an initiator perspective
check wether interrupt is needed
Definition at line 2056 of file ufs_device.cc.
References gem5::X86ISA::destination, gem5::DmaPort::dmaAction(), gem5::DmaDevice::dmaPort, DPRINTF, name(), readDone(), readDoneEvent, readPendingNum, gem5::Event::scheduled(), and gem5::MemCmd::WriteReq.
Referenced by finalUTP(), readCallback(), SCSIResume(), taskHandler(), and transferDone().
|
private |
Read done Started at the end of a transaction after the last read action.
Read done handling function, is only initiated at the end of a transaction.
Cleans up UTP descriptor and other remaining data structures. It also raises the interrupt.
Garbage collection; sort out the allocated UTP descriptor
done, generate interrupt if we havent got one already
Definition at line 1761 of file ufs_device.cc.
References DPRINTF, garbage, generateInterrupt(), gem5::UFSHostDevice::HCIMem::ORInterruptStatus, readDoneEvent, readPendingNum, UFSHCIMem, and UTPTransferREQCOMPL.
Referenced by readDevice().
|
private |
Read garbage A read from disk data structure can vary in size and is therefor allocated on creation.
After a disk read DMA transfer, the structure needs to be freed.
It can only be destroyed once that particular read action has completed. This function is called on completion of a read from disk action to handle this.
This is done in this function.
Definition at line 2256 of file ufs_device.cc.
References DPRINTF, readGarbageEventQueue, and SSDReadPending.
Referenced by readCallback().
|
private |
Handler functions.
Request handler.
Each function handles a different stage of the transfer. Note that the UFS protocol specifies three types of messages to the host (and devices): 1: Command (to Host specifically) 2: Task (to device; to control flow, not for data) 3: Transfer (to device; to transfer data) request handler. This function finds the cause of the request and triggers the right follow-up action (command handler, task handler, or transferhandler)
Determines where the request comes from and initiates the appropriate actions accordingly.
step1 determine what called us step2 determine where to get it Look for any request of which we where not yet aware
Command; general control of the Host controller. no DMA transfer needed
Task; flow control, meant for the device/Logic unit DMA transfer is needed, flash will not be approached
Find the position that is not handled yet
Transfer; Data transfer from or to the disk. There will be DMA transfers, and the flash might be approached. Further commands, are needed to specify the exact command.
Find the position that is not handled yet
stats
step3 start transfer step4 register information; allowing the host to respond in the end
Deleted in readDone, queued in finalUTP
Definition at line 1201 of file ufs_device.cc.
References activeDoorbells, gem5::UFSHostDevice::taskStart::address, gem5::UFSHostDevice::transferStart::address, gem5::UFSHostDevice::UFSHostDeviceStats::averageDoorbell, gem5::UFSHostDevice::HCIMem::CMDUICCMDR, commandHandler(), gem5::X86ISA::count, gem5::curTick(), gem5::UFSHostDevice::taskStart::done, gem5::UFSHostDevice::transferStart::done, DPRINTF, gem5::findLsbSet(), generateInterrupt(), inform, gem5::ArmISA::mask, gem5::UFSHostDevice::taskStart::mask, gem5::UFSHostDevice::transferStart::mask, gem5::UFSHostDevice::UFSHostDeviceStats::maxDoorbell, name(), gem5::UFSHostDevice::HCIMem::ORInterruptStatus, gem5::UFSHostDevice::taskStart::size, gem5::UFSHostDevice::transferStart::size, stats, taskCommandTrack, taskEventQueue, taskInfo, taskStart(), gem5::UFSHostDevice::HCIMem::TMUTMRLBA, gem5::UFSHostDevice::HCIMem::TMUTMRLBAU, gem5::UFSHostDevice::HCIMem::TMUTMRLDBR, transactionStart, transferEventQueue, transferStart(), transferStartInfo, transferTrack, gem5::UFSHostDevice::HCIMem::TRUTRLBA, gem5::UFSHostDevice::HCIMem::TRUTRLBAU, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, UFSHCIMem, UICCommandCOMPL, gem5::statistics::ScalarBase< Derived, Stor >::value(), and writeDevice().
Referenced by write().
|
private |
Starts the scsi handling function in the apropriate Logic unit, prepares the right data transfer scheme and kicks it off.
Handles the transfer requests that are given.
There can be three types of transfer. SCSI specific, Reads and writes apart from the data transfer, this also generates its own reply (UPIU response). Information for this reply is stored in transferInfo and will be used in transferDone
old info, lets form it such that we can understand it
call logic unit to handle SCSI command
build response stating that it was succesful command completion, Logic unit number, and Task tag
SCSI status reply
segment size + EHS length (see UFS standard ch7)
amount of data that will follow
transferdone information packet filling
In this part the data that needs to be transfered will be initiated and the chain of DMA (and potentially) disk transactions will be started.
write transfer
read transfer
not disk related transfer, SCSI maintanance
Transport the SCSI reponse data according to the SG list
safetynet; it has been shown that sg list may be optimistic in the amount of data allocated, which can potentially lead to some garbage data being send over. Hence this construction that finds the least amount of data that needs to be transfered.
Go to the next stage of the answering process
Definition at line 1492 of file ufs_device.cc.
References gem5::UFSHostDevice::UTPTransferReqDesc::commandDescBaseAddrHi, gem5::UFSHostDevice::UTPTransferReqDesc::commandDescBaseAddrLo, gem5::X86ISA::count, gem5::UFSHostDevice::UPIUMessage::dataMsg, DPRINTF, gem5::UFSHostDevice::UTPTransferReqDesc::RequestDescHeader::dWord0, gem5::UFSHostDevice::SCSIReply::expectMore, gem5::UFSHostDevice::UTPTransferReqDesc::header, gem5::UFSHostDevice::SCSIReply::LUN, manageReadTransfer(), manageWriteTransfer(), gem5::UFSHostDevice::SCSIReply::message, gem5::UFSHostDevice::SCSIReply::msgSize, gem5::UFSHostDevice::SCSIReply::offset, panic, gem5::UFSHostDevice::UTPTransferReqDesc::PRDTableLength, gem5::UFSHostDevice::UTPTransferReqDesc::PRDTableOffset, readDevice(), request_out_datain, gem5::UFSHostDevice::UTPTransferReqDesc::responseUPIULength, gem5::UFSHostDevice::SCSIReply::senseCode, gem5::UFSHostDevice::SCSIReply::senseSize, gem5::UFSHostDevice::UFSHCDSGEntry::size, gem5::UFSHostDevice::SCSIReply::status, transferDone(), gem5::UFSHostDevice::HCIMem::TRUTRLDBR, UFSDevice, UFSHCIMem, and gem5::UFSHostDevice::UFSHCDSGEntry::upperAddr.
Referenced by finalUTP(), and SCSIStart().
|
private |
Transfer SCSI function.
Obtain LUN and put it in the right LUN queue.
Determines which Logic unit to address and starts the SCSI resume function
Each LUN has its own queue of commands that need to be executed. This is the first instance where it can be determined which Logic unit should handle the transfer. Then check wether it should wait and queue or if it can continue.
There are 32 doorbells, so at max there can be 32 transactions
First transfer is done, fetch the next; At this point, the device is busy, not the HC
loading next data packet in case Another LUN is approached in the mean time
Definition at line 1447 of file ufs_device.cc.
References gem5::UFSHostDevice::SCSIResumeInfo::destination, DPRINTF, panic, SCSIInfo, SCSIResume(), transferEventQueue, transferStartInfo, UFSDevice, and writeDevice().
Referenced by UFSHostDevice().
|
overridevirtual |
Serialize; needed to make checkpoints.
Reimplemented from gem5::ClockedObject.
Definition at line 2268 of file ufs_device.cc.
References lunAvail, gem5::ClockedObject::serialize(), SERIALIZE_ARRAY, SERIALIZE_SCALAR, and UFSHCIMem.
|
private |
Initialization function.
Register init.
Sets the sefault HCI register values
The capability register is built up as follows: 31-29 RES; Testmode support; O3 delivery; 64 bit addr; 23-19 RES; 18-16 #TM Req slots; 15-5 RES;4-0 # TR slots
Definition at line 876 of file ufs_device.cc.
References gem5::UFSHostDevice::HCIMem::CMDUICCMDR, gem5::UFSHostDevice::HCIMem::HCCAP, gem5::UFSHostDevice::HCIMem::HCHCDDID, gem5::UFSHostDevice::HCIMem::HCHCPMID, gem5::UFSHostDevice::HCIMem::HCversion, gem5::UFSHostDevice::HCIMem::ORHostControllerStatus, gem5::UFSHostDevice::HCIMem::TMUTMRLBA, gem5::UFSHostDevice::HCIMem::TMUTMRLBAU, gem5::UFSHostDevice::HCIMem::TMUTMRLDBR, gem5::UFSHostDevice::HCIMem::TRUTRLBA, gem5::UFSHostDevice::HCIMem::TRUTRLBAU, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, UFSHCIMem, and UFSSlots.
|
private |
Task handler function.
Handles the tasks that are given.
Handles the tasks send to the devices because there are not many tasks implemented yet this is kept in the Host controller layer
At this point in time, not many tasks have been implemented in the driver.
For now, just unpack and acknowledge the task without doing anything. TODO Implement UFS tasks.
Definition at line 1368 of file ufs_device.cc.
References gem5::UFSHostDevice::UTPUPIUHeader::dWord0, gem5::UFSHostDevice::UTPUPIUHeader::dWord1, gem5::UFSHostDevice::UTPUPIUHeader::dWord2, gem5::UFSHostDevice::UTPUPIUTaskReq::header, inform, gem5::UFSHostDevice::HCIMem::ORInterruptStatus, readDevice(), taskCommandTrack, gem5::UFSHostDevice::HCIMem::TMUTMRLDBR, UFSHCIMem, and UTPTaskREQCOMPL.
Referenced by taskStart().
|
private |
Task Start function.
Task start event.
Starts the task handler once the task data structure has arrived
Definition at line 1320 of file ufs_device.cc.
References DPRINTF, taskEventQueue, taskHandler(), and taskInfo.
Referenced by requestHandler().
|
private |
transfer done, the beginning of the final stage of the transfer.
Transfer done.
Acknowledges UPIU frame and prepares the UTP response frame
When the data transfer is done, this function ensures that the application is notified.
Test whether SCSI queue hasn't popped prematurely
Definition at line 1676 of file ufs_device.cc.
References gem5::UFSHostDevice::transferStart::address, gem5::UFSHostDevice::transferStart::destination, gem5::X86ISA::destination, gem5::UFSHostDevice::transferStart::done, DPRINTF, gem5::UFSHostDevice::transferStart::lun_id, gem5::UFSHostDevice::transferStart::mask, panic, readDevice(), gem5::UFSHostDevice::transferStart::size, transferEnd, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, UFSDevice, UFSHCIMem, and UTPEvent.
Referenced by LUNSignal(), and SCSIResume().
|
private |
Transfer handler function.
Obtains the SCSI command (if any) Two possibilities: if it contains a SCSI command, then it is a usable message; if it doesnt contain a SCSI message, then it can't be handeld by this code.
Handles the transfers send to the devices Important to understand here is that a Logic unit is not a device (a device can contain multiple logic units). This function analyses the first data structure that has been transfered. Which will tell the host to expect SCSI frames for the rest of the transaction. Note that the host has no indication whatsoever which LU to address. That will follow in the next transaction.
This is the second stage of the transfer. We have the information about where the next command can be found and what the type of command is. The actions that are needed from the device its side are: get the information and store the information such that we can reply.
Get the UTP command that has the SCSI command
Definition at line 1404 of file ufs_device.cc.
References gem5::UFSHostDevice::UTPTransferReqDesc::commandDescBaseAddrHi, gem5::UFSHostDevice::UTPTransferReqDesc::commandDescBaseAddrLo, gem5::UFSHostDevice::SCSIResumeInfo::destination, gem5::UFSHostDevice::SCSIResumeInfo::done, DPRINTF, gem5::UFSHostDevice::UTPTransferReqDesc::RequestDescHeader::dWord2, gem5::UFSHostDevice::SCSIResumeInfo::finalAddress, gem5::UFSHostDevice::SCSIResumeInfo::finalSize, gem5::UFSHostDevice::UTPTransferReqDesc::header, gem5::UFSHostDevice::UTPTransferReqDesc::PRDTableLength, gem5::UFSHostDevice::UTPTransferReqDesc::PRDTableOffset, gem5::UFSHostDevice::SCSIResumeInfo::reqPos, gem5::UFSHostDevice::SCSIResumeInfo::RequestIn, gem5::Event::scheduled(), SCSIInfo, SCSIResumeEvent, transferEventQueue, and writeDevice().
Referenced by transferStart().
|
private |
Transfer Start function.
Transfer start event.
Starts the transfer handler once the transfer data structure has arrived
Definition at line 1334 of file ufs_device.cc.
References DPRINTF, transferEventQueue, transferHandler(), and transferStartInfo.
Referenced by requestHandler().
|
overridevirtual |
Unserialize; needed to restore from checkpoints.
Reimplemented from gem5::ClockedObject.
Definition at line 2285 of file ufs_device.cc.
References lunAvail, UFSHCIMem, gem5::ClockedObject::unserialize(), UNSERIALIZE_ARRAY, and UNSERIALIZE_SCALAR.
UFSHCD write function.
This function allows access to the writeable registers. If any function attempts to write value to an unwriteable register entry, then the value will not be written.
Implements gem5::PioDevice.
Definition at line 1054 of file ufs_device.cc.
References gem5::UFSHostDevice::HCIMem::CMDUCMDARG1, gem5::UFSHostDevice::HCIMem::CMDUCMDARG2, gem5::UFSHostDevice::HCIMem::CMDUCMDARG3, gem5::UFSHostDevice::HCIMem::CMDUICCMDR, gem5::curTick(), data, gem5::Packet::getAddr(), gem5::Packet::getSize(), gem5::Packet::getUintX(), idlePhaseStart, gem5::UFSHostDevice::UFSHostDeviceStats::idleTimes, gem5::Packet::makeResponse(), gem5::UFSHostDevice::HCIMem::ORHostControllerEnable, gem5::UFSHostDevice::HCIMem::ORHostControllerStatus, gem5::UFSHostDevice::HCIMem::ORInterruptEnable, gem5::UFSHostDevice::HCIMem::ORUECDL, gem5::UFSHostDevice::HCIMem::ORUECDME, gem5::UFSHostDevice::HCIMem::ORUECN, gem5::UFSHostDevice::HCIMem::ORUECPA, gem5::UFSHostDevice::HCIMem::ORUECT, gem5::UFSHostDevice::HCIMem::ORUTRIACR, pioDelay, regControllerCapabilities, regControllerDEVID, regControllerEnable, regControllerPRODID, regControllerStatus, regInterruptEnable, regInterruptStatus, regUFSVersion, regUICCommand, regUICCommandArg1, regUICCommandArg2, regUICCommandArg3, regUICErrorCodeDataLinkLayer, regUICErrorCodeDME, regUICErrorCodeNetworkLayer, regUICErrorCodePHYAdapterLayer, regUICErrorCodeTransportLayer, regUTPTaskREQDoorbell, regUTPTaskREQListBaseH, regUTPTaskREQListBaseL, regUTPTaskREQListClear, regUTPTaskREQListRunStop, regUTPTransferREQDoorbell, regUTPTransferREQINTAGGControl, regUTPTransferREQListBaseH, regUTPTransferREQListBaseL, regUTPTransferREQListClear, regUTPTransferREQListRunStop, requestHandler(), gem5::statistics::DistBase< Derived, Stor >::sample(), stats, gem5::UFSHostDevice::HCIMem::TMUTMRLBA, gem5::UFSHostDevice::HCIMem::TMUTMRLBAU, gem5::UFSHostDevice::HCIMem::TMUTMRLCLR, gem5::UFSHostDevice::HCIMem::TMUTMRLDBR, gem5::UFSHostDevice::HCIMem::TMUTMRLRSR, gem5::UFSHostDevice::HCIMem::TRUTRLBA, gem5::UFSHostDevice::HCIMem::TRUTRLBAU, gem5::UFSHostDevice::HCIMem::TRUTRLCLR, gem5::UFSHostDevice::HCIMem::TRUTRLDBR, gem5::UFSHostDevice::HCIMem::TRUTRLRSR, UFSHCIMem, and UICCommandReady.
|
private |
DMA transfer functions These allow the host to push/pull the data to the memory The provided event indicates what the next phase it that will handle the obtained data, or what the follow up action is once the data has been pushed to the memory.
Important to understand about the transfer flow: We have basically three stages, The "system memory" stage, the "device buffer" stage and the "disk" stage.
In this model we assume an infinite buffer, or a buffer that is big enough to store all the data in the biggest transaction. Between the three stages are two queues. Those queues store the messages to simulate their transaction from one stage to the next. The manage{Action} function fills up one of the queues and triggers the first event, which causes a chain reaction of events executed once they pass through their queues. For a write action the stages are ordered "system memory", "device buffer" and "disk", whereas the read transfers happen "disk", "device buffer" and "system memory". The dma action in the dma device is written from a bus perspective whereas this model is written from a device perspective. To avoid confusion, the translation between the two has been made in the writeDevice and readDevice funtions. Dma transaction function: write device. Note that the dma action is from a device perspective, while this function is from an initiator perspective
check whether transfer is all the way to the flash
destination is an offset here since we are writing to a disk
allocate appropriate buffer
transaction
Definition at line 1850 of file ufs_device.cc.
References gem5::curTick(), gem5::X86ISA::destination, gem5::DmaPort::dmaAction(), gem5::DmaDevice::dmaPort, DPRINTF, gem5::UFSHostDevice::transferInfo::filePointer, gem5::UFSHostDevice::transferInfo::lunID, name(), gem5::UFSHostDevice::transferInfo::offset, gem5::MemCmd::ReadReq, gem5::Event::scheduled(), gem5::UFSHostDevice::transferInfo::size, SSDWriteinfo, writeDone(), writeDoneEvent, and writePendingNum.
Referenced by manageWriteTransfer(), requestHandler(), SCSIStart(), transferHandler(), and writeDone().
|
private |
Write done After a DMA write with data intended for the disk, this function is called.
Write done handling function.
It ensures that the disk image is modified, and that the correct timing function is triggered.
Is only initiated when the flash is directly approached
DMA is done, information no longer needed
If there is nothing on the way, we need to start the events
Write the disk
Move to the second queue, enter the logic unit This is where the disk is approached and the flash transaction is handled SSDWriteDone will take care of the timing
so far, only the DMA part has been handled, lets do the disk delay
stats
initiate the next dma action (if any)
Definition at line 1961 of file ufs_device.cc.
References gem5::UFSHostDevice::UFSHostDeviceStats::averageWriteSSDQueue, gem5::UFSHostDevice::UFSHostDeviceStats::currentWriteSSDQueue, dmaWriteInfo, DPRINTF, gem5::statistics::ScalarBase< Derived, Stor >::size(), SSDWriteinfo, stats, gem5::UFSHostDevice::UFSHostDeviceStats::totalWriteDiskTransactions, UFSDevice, writeDevice(), and writePendingNum.
Referenced by writeDevice().
|
private |
Statistics helper variables Active doorbells indicates how many doorbells are in teh process of being handled.
Pending doorbells have been handled and are waiting to be acknowledged by the host system. The doorbell register is 32 bits wide, so one byte is enough to keep track of the numbers
Definition at line 1052 of file ufs_device.hh.
Referenced by checkDrain(), finalUTP(), and requestHandler().
|
private |
interrupt verification This keeps track of the number of interrupts generated.
It is usefull for debug purposes. Make sure that the implemented driver prints the number of interrupts it has handled so far to fully benefit from this feature.
Definition at line 1062 of file ufs_device.hh.
Referenced by clearInterrupt(), and generateInterrupt().
|
private |
Information to get a DMA transaction.
Definition at line 1129 of file ufs_device.hh.
Referenced by manageWriteTransfer(), and writeDone().
|
private |
garbage queue, ensure clearing of the allocated memory
Definition at line 1144 of file ufs_device.hh.
Referenced by finalUTP(), and readDone().
|
private |
Definition at line 1028 of file ufs_device.hh.
Referenced by clearInterrupt(), and generateInterrupt().
|
private |
Definition at line 1081 of file ufs_device.hh.
Referenced by clearInterrupt(), and write().
|
private |
Definition at line 1027 of file ufs_device.hh.
Referenced by clearInterrupt(), and generateInterrupt().
|
private |
Definition at line 1029 of file ufs_device.hh.
Referenced by LUNSignal(), readCallback(), serialize(), and unserialize().
|
private |
Definition at line 1053 of file ufs_device.hh.
Referenced by finalUTP(), and generateInterrupt().
|
private |
Host controller information.
Definition at line 1024 of file ufs_device.hh.
Referenced by getAddrRanges().
|
private |
Definition at line 1026 of file ufs_device.hh.
|
private |
Definition at line 1025 of file ufs_device.hh.
Referenced by getAddrRanges().
|
private |
Transfer flow events Basically these events form two queues, one from memory to UFS device (DMA) and one from device to flash (SSD).
The SSD "queue" is maintained by the flash and the lun classes and does not form a queue of events as such, but rather a queue of information. This can be done because the flow of the events is completely in the control of these classes. (Whereas in the DMA case we rely on an external class)
Definition at line 1160 of file ufs_device.hh.
Referenced by readDevice(), and readDone().
|
private |
Event after a read to clean up the UTP data structures.
Definition at line 1183 of file ufs_device.hh.
Referenced by readCallback(), and readGarbage().
|
private |
Track number of DMA transactions in progress.
Definition at line 1040 of file ufs_device.hh.
Referenced by readDevice(), and readDone().
|
private |
SCSI reply structure, used for direct answering.
Might be refered to during the assembly of the reply (data, and response; e.g. if something goes wrong along the way, the reply will be different)
Definition at line 1095 of file ufs_device.hh.
Referenced by SCSIResume().
|
private |
SCSI resume info information structure for SCSI resume.
it keeps track of all the information that is needed to successfully complete the transaction (response addresses, communicated information so far, etc.).
Definition at line 1103 of file ufs_device.hh.
Referenced by SCSIStart(), and transferHandler().
|
private |
The events that control the functionality.
After a doorbell has been set, either a taskevent or a transfer event is scheduled. A transfer event might schedule a SCSI event, all events sequences end with an UTP event, which can be considered as the event which answers the doorbell. Wait for the SCSI specific data to arive
Definition at line 1173 of file ufs_device.hh.
Referenced by transferHandler().
|
private |
Information from the Disk, waiting to be pushed to the DMA.
Definition at line 1139 of file ufs_device.hh.
Referenced by readCallback(), and readGarbage().
|
private |
Information from DMA transaction to disk.
Definition at line 1134 of file ufs_device.hh.
Referenced by writeDevice(), and writeDone().
|
private |
RequestHandler stats.
Definition at line 1149 of file ufs_device.hh.
Referenced by finalUTP(), manageReadTransfer(), manageWriteTransfer(), readCallback(), requestHandler(), write(), and writeDone().
|
private |
Definition at line 1073 of file ufs_device.hh.
Referenced by requestHandler(), and taskHandler().
|
private |
Multiple tasks transfers can be scheduled at once for the device, the only thing we know for sure about them is that they will happen in a first come first serve order; hence we need to queue.
Definition at line 1190 of file ufs_device.hh.
Referenced by requestHandler(), and taskStart().
|
private |
When a task/transfer is started it needs information about the task/transfer it is about to perform.
This is defined in these structures. If multiple tasks/transfers are issued at the same time, they still need to be fetched one by one. They then need to be executed in the order specified by the UFS standard (least significant doorbell first). The tasks/transfers are placed in the queue in that specific order.
Definition at line 1123 of file ufs_device.hh.
Referenced by requestHandler(), and taskStart().
|
private |
Helper for latency stats These variables keep track of the latency for every doorbell.
Eventually the latenmcies will be put in a histogram.
Definition at line 1080 of file ufs_device.hh.
Referenced by finalUTP(), and requestHandler().
|
private |
To finish the transaction one needs information about the original message.
This is stored in this queue transferEnd uses the same structure as transferStartInfo, because all the information it needs is in there. It improves readability in the cc file.
Definition at line 1112 of file ufs_device.hh.
Referenced by finalUTP(), and transferDone().
|
private |
Definition at line 1191 of file ufs_device.hh.
Referenced by finalUTP(), requestHandler(), SCSIStart(), transferHandler(), and transferStart().
|
private |
Definition at line 1124 of file ufs_device.hh.
Referenced by requestHandler(), SCSIStart(), and transferStart().
|
private |
Track the transfer This is allows the driver to "group" certain transfers together by using a tag in the UPIU.
The messages with the same tag should be handled together, i.e. their doorbells should be cleared when they are all done. but we need to keep track of the ones we already handled, this integer shadows the doorbells to allow this behaviour.
Definition at line 1072 of file ufs_device.hh.
Referenced by finalUTP(), generateInterrupt(), and requestHandler().
|
private |
logic units connected to the UFS Host device Note again that the "device" as such is represented by one or multiple logic units.
Definition at line 1088 of file ufs_device.hh.
Referenced by finalUTP(), LUNSignal(), manageReadTransfer(), manageWriteTransfer(), readCallback(), SCSIResume(), SCSIStart(), transferDone(), and writeDone().
|
private |
Host controller memory.
Definition at line 1035 of file ufs_device.hh.
Referenced by checkDrain(), clearInterrupt(), commandHandler(), drain(), finalUTP(), generateInterrupt(), read(), readDone(), requestHandler(), SCSIResume(), serialize(), setValues(), taskHandler(), transferDone(), unserialize(), and write().
|
private |
Definition at line 1030 of file ufs_device.hh.
Referenced by setValues().
|
staticprivate |
Definition at line 1198 of file ufs_device.hh.
Referenced by requestHandler().
|
staticprivate |
Definition at line 1199 of file ufs_device.hh.
Referenced by write().
|
private |
Wait for the moment where we can send the last frame.
Definition at line 1178 of file ufs_device.hh.
Referenced by transferDone().
|
staticprivate |
Definition at line 1197 of file ufs_device.hh.
Referenced by taskHandler().
|
staticprivate |
Bits of interest within UFS data packages.
Definition at line 1196 of file ufs_device.hh.
Referenced by readDone().
|
private |
Definition at line 1161 of file ufs_device.hh.
Referenced by writeDevice().
|
private |
Definition at line 1041 of file ufs_device.hh.
Referenced by writeDevice(), and writeDone().