gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ufs_device.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2015 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * Authors: Rene de Jong
38  */
39 
40 
144 #ifndef __DEV_ARM_UFS_DEVICE_HH__
145 #define __DEV_ARM_UFS_DEVICE_HH__
146 
147 #include <deque>
148 
149 #include "base/addr_range.hh"
150 #include "base/bitfield.hh"
151 #include "base/statistics.hh"
152 #include "debug/UFSHostDevice.hh"
153 #include "dev/arm/abstract_nvm.hh"
154 #include "dev/arm/base_gic.hh"
155 #include "dev/storage/disk_image.hh"
156 #include "dev/dma_device.hh"
157 #include "dev/io_device.hh"
158 #include "mem/packet.hh"
159 #include "mem/packet_access.hh"
160 #include "params/UFSHostDevice.hh"
161 #include "sim/serialize.hh"
162 #include "sim/stats.hh"
163 
170 class UFSHostDevice : public DmaDevice
171 {
172  public:
173 
174  UFSHostDevice(const UFSHostDeviceParams* p);
175 
176  DrainState drain() override;
177  void checkDrain();
178  void serialize(CheckpointOut &cp) const override;
179  void unserialize(CheckpointIn &cp) override;
180 
181  private:
189  struct HCIMem {
193  uint32_t HCCAP;
194  uint32_t HCversion;
195  uint32_t HCHCDDID;
196  uint32_t HCHCPMID;
197 
205  uint32_t ORUECPA;
206  uint32_t ORUECDL;
207  uint32_t ORUECN;
208  uint32_t ORUECT;
209  uint32_t ORUECDME;
210  uint32_t ORUTRIACR;
211 
215  uint32_t vendorSpecific;
216 
220  uint32_t TRUTRLBA;
221  uint32_t TRUTRLBAU;
222  uint32_t TRUTRLDBR;
223  uint32_t TRUTRLCLR;
224  uint32_t TRUTRLRSR;
225 
229  uint32_t TMUTMRLBA;
230  uint32_t TMUTMRLBAU;
231  uint32_t TMUTMRLDBR;
232  uint32_t TMUTMRLCLR;
233  uint32_t TMUTMRLRSR;
234 
238  uint32_t CMDUICCMDR;
239  uint32_t CMDUCMDARG1;
240  uint32_t CMDUCMDARG2;
241  uint32_t CMDUCMDARG3;
242  };
243 
257  struct UTPUPIUHeader {
258  uint32_t dWord0;
259  uint32_t dWord1;
260  uint32_t dWord2;
261  };
262 
271  struct UTPUPIURSP {
274  uint32_t reserved[4];
275  uint16_t senseDataLen;
276  uint8_t senseData[18];
277  };
278 
287  struct UTPUPIUTaskReq {
289  uint32_t inputParam1;
290  uint32_t inputParam2;
291  uint32_t inputParam3;
292  uint32_t reserved[2];
293  };
294 
302  struct UFSHCDSGEntry {
303  uint32_t baseAddr;
304  uint32_t upperAddr;
305  uint32_t reserved;
306  uint32_t size;
307  };
308 
317  uint8_t commandUPIU[128];
318  uint8_t responseUPIU[128];
319  struct UFSHCDSGEntry PRDTable[128];
320  };
321 
325  struct UPIUMessage {
327  uint32_t dataOffset;
328  uint32_t dataCount;
330  };
331 
343 
352  uint32_t dWord0;
353  uint32_t dWord1;
354  uint32_t dWord2;
355  uint32_t dWord3;
356  } header;
357 
358  /* DW 4-5*/
361 
362  /* DW 6 */
365 
366  /* DW 7 */
367  uint16_t PRDTableLength;
368  uint16_t PRDTableOffset;
369  };
370 
375  struct SCSIReply {
376  uint8_t status;
377  uint32_t msgSize;
378  uint8_t LUN;
380  uint8_t senseSize;
381  uint8_t expectMore;//0x01 is for writes, 0x02 is for reads
382  uint64_t offset;
383  uint8_t senseCode[19];
384  };
385 
391  struct LUNInfo {
392  uint32_t dWord0;
393  uint32_t dWord1;
394  uint32_t vendor0;
395  uint32_t vendor1;
396  uint32_t product0;
397  uint32_t product1;
398  uint32_t product2;
399  uint32_t product3;
400  uint32_t productRevision;
401  };
402 
422  struct transferInfo {
424  uint32_t size;
425  uint64_t offset;
426  uint32_t filePointer;
427  uint32_t lunID;
428  };
429 
436  uint32_t reqPos;
438  uint32_t size;
440  uint8_t *destination;
441  bool finished;
442  uint32_t lunID;
443  };
444 
448  struct transferStart {
450  uint32_t mask;
452  uint32_t size;
453  uint32_t done;
454  uint32_t lun_id;
455  };
456 
460  struct taskStart {
462  uint32_t mask;
464  uint32_t size;
465  bool done;
466  };
467 
472  struct SCSIResumeInfo {
474  int reqPos;
476  uint32_t finalSize;
478  uint32_t done;
479  };
480 
487  uint64_t SCSIDiskOffset;
488  uint32_t size;
489  uint32_t LUN;
490  };
491 
500 
508 
512 
517 
522 
526  };
527 
534  {
535  public:
539  UFSSCSIDevice(const UFSHostDeviceParams* p, uint32_t lun_id, Callback*
540  transfer_cb, Callback *read_cb);
541  ~UFSSCSIDevice();
542 
548  struct SCSIReply SCSICMDHandle(uint32_t* SCSI_msg);
549 
558  void readFlash(uint8_t* readaddr, uint64_t offset, uint32_t size);
559 
564  void writeFlash(uint8_t* writeaddr, uint64_t offset, uint32_t size);
565 
571  bool finishedCommand() const {return transferCompleted;};
572 
577  void clearSignal() {transferCompleted = false;};
578 
586  bool finishedRead() const {return readCompleted;};
587 
592  void clearReadSignal() {readCompleted = false;};
593 
599  void SSDReadStart(uint32_t total_read);
600  void SSDWriteStart();
601 
607  void setTotalWrite(uint32_t total_write) {totalWrite = total_write;};
608 
613 
624 
630 
638 
639  private:
646  void readCallback();
647 
652  void SSDReadDone();
653 
657  void SSDWriteDone();
658 
664  void statusCheck(uint8_t status, uint8_t* sensecodelist);
665 
669  void setSignal() {transferCompleted = true;};
670 
674  void setReadSignal() {readCompleted = true;};
675 
683 
687  const uint32_t blkSize;
688  const uint32_t lunAvail;
689  const uint64_t diskSize;
690  const uint32_t capacityLower;
691  const uint32_t capacityUpper;
692 
697  struct LUNInfo lunInfo;
698  const uint32_t lunID;
699 
707 
711  uint32_t totalRead;
712  uint32_t totalWrite;
713 
719 
725 
731 
732  /*
733  * Default response header layout. For more information refer to
734  * chapter 7 http://www.jedec.org/standards-documents/results/jesd220
735  */
736  static const unsigned int UPIUHeaderDataIndWord0 = 0x0000C022;
737  static const unsigned int UPIUHeaderDataIndWord1 = 0x00000000;
738  static const unsigned int UPIUHeaderDataIndWord2 = 0x40000000;
739 
740  /*
741  * SCSI mode pages values assigned in ufs_device.cc
742  * The mode pages give device specific information via the SCSI
743  * protocol. They are defined in
744  * http://www.jedec.org/standards-documents/results/jesd220
745  */
746  static const unsigned int controlPage[3];
747  static const unsigned int recoveryPage[3];
748  static const unsigned int cachingPage[5];
749 
750  /*
751  * SCSI command set; defined in
752  * http://www.jedec.org/standards-documents/results/jesd220
753  */
755  SCSIInquiry = 0x12,
756  SCSIRead6 = 0x08,
757  SCSIRead10 = 0x28,
758  SCSIRead16 = 0x88,
764  SCSIVerify10 = 0x2F,
765  SCSIWrite6 = 0x0A,
766  SCSIWrite10 = 0x2A,
767  SCSIWrite16 = 0x8A,
771  //UFS SCSI additional command set for full functionality
776  SCSIUnmap = 0x42,
779  //SCSI commands not supported by UFS; but Linux send them anyway
781  };
782 
783  /*
784  * SCSI status codes; defined in
785  * http://www.jedec.org/standards-documents/results/jesd220
786  */
788  SCSIGood = 0x00,
791  SCSIBusy = 0x08,
799  };
800 
801  /*
802  * SCSI sense codes; defined in
803  * http://www.jedec.org/standards-documents/results/jesd220
804  */
806  SCSINoSense = 0x00,
808  SCSINotReady = 0x02,
818  };
819 
820  };
821 
822  //All access functions are inherrited; no need to make them public
826  AddrRangeList getAddrRanges() const override;
827 
831  Tick read(PacketPtr pkt) override;
832  Tick write(PacketPtr pkt) override;
833  // end of access functions
834 
838  void setValues();
839 
853  void requestHandler();
854 
859  void commandHandler();
860 
865  void taskStart();
866 
872  void taskHandler(struct UTPUPIUTaskReq* request_in,
873  uint32_t req_pos, Addr finaladdress, uint32_t finalsize);
874 
879  void transferStart();
880 
890  void transferHandler(struct UTPTransferReqDesc*
891  request_in, int req_pos, Addr finaladdress,
892  uint32_t finalsize, uint32_t done);
893 
898  void SCSIStart();
899 
904  void SCSIResume(uint32_t lun_id);
905 
909  void LUNSignal();
910 
915  void transferDone(Addr responseStartAddr, uint32_t req_pos,
916  struct UTPUPIURSP request_out, uint32_t size,
917  Addr address, uint8_t* destination, bool finished,
918  uint32_t lun_id);
923  void finalUTP();
924 
928  void clearInterrupt();
929  void generateInterrupt();
930 
938  void writeDevice(Event* additional_action, bool toDisk, Addr start,
939  int size, uint8_t* destination, uint64_t SCSIDiskOffset,
940  uint32_t lun_id);
941  void readDevice(bool lastTransfer, Addr SCSIStart, uint32_t SCSISize,
942  uint8_t* SCSIDestination, bool no_cache,
943  Event* additional_action);
944 
951  void manageWriteTransfer(uint8_t LUN, uint64_t offset, uint32_t
952  sg_table_length, struct UFSHCDSGEntry* sglist);
953  void manageReadTransfer(uint32_t size, uint32_t LUN, uint64_t offset,
954  uint32_t sg_table_length,
955  struct UFSHCDSGEntry* sglist);
956 
963  void readDone();
964 
971  void writeDone();
972 
979  void readCallback();
980 
988  void readGarbage();
989 
991  void regStats() override;
992 
996  const Addr pioAddr;
997  const Addr pioSize;
998  const Tick pioDelay;
999  const int intNum;
1001  const uint32_t lunAvail;
1002  const uint8_t UFSSlots;
1003 
1008 
1014 
1026 
1034  uint32_t countInt;
1035 
1044  uint32_t transferTrack;
1046 
1054 
1061 
1068 
1076 
1085 
1097 
1102 
1107 
1112 
1117 
1122 
1136 
1144 
1156 
1161 
1167 
1177 
1181  static const unsigned int UTPTransferREQCOMPL = 0x01;//UFS_BIT(0)
1182  static const unsigned int UTPTaskREQCOMPL = 0x200;//UFS_BIT(9)
1183  static const unsigned int UICCommandCOMPL = 0x400;//UFS_BIT(10)
1184  static const unsigned int UICCommandReady = 0x08;//UFS_BIT(3)
1185 
1186  /*
1187  * UFSHCI Registers; please refer to
1188  * http://www.jedec.org/standards-documents/results/jesd223
1189  * for their definition.
1190  */
1220  };
1221 };
1222 
1223 #endif //__DEV_ARM_UFS_DEVICE_HH__
Stats::Scalar currentSCSIQueue
Queue lengths.
Definition: ufs_device.hh:497
const uint32_t lunAvail
Definition: ufs_device.hh:1001
std::deque< struct transferInfo > SSDReadPending
Information from the Disk, waiting to be pushed to the DMA.
Definition: ufs_device.hh:1111
void clearReadSignal()
Clear signal.
Definition: ufs_device.hh:592
struct SCSIResumeInfo SCSIInfo
SCSI resume info information structure for SCSI resume.
Definition: ufs_device.hh:1075
void generateInterrupt()
set interrupt and sort out the doorbell register.
Definition: ufs_device.cc:1817
void SSDReadStart(uint32_t total_read)
Start the transactions to (and from) the disk The host will queue all the transactions.
Definition: ufs_device.cc:2180
Callback * transferDoneCallback
Callbacks for the logic units.
Definition: ufs_device.hh:1142
void setSignal()
set signal to indicate that the transaction has been completed.
Definition: ufs_device.hh:669
std::deque< struct taskStart > taskInfo
When a task/transfer is started it needs information about the task/transfer it is about to perform...
Definition: ufs_device.hh:1095
Generic callback class.
Definition: callback.hh:41
AddrRangeList getAddrRanges() const override
Address range functions.
Definition: ufs_device.cc:916
uint32_t totalRead
Total amount transactions that need to be made.
Definition: ufs_device.hh:711
void unserialize(CheckpointIn &cp) override
Unserialize; needed to restore from checkpoints.
Definition: ufs_device.cc:2308
A stat that calculates the per tick average of a value.
Definition: statistics.hh:2485
DrainState
Object drain/handover states.
Definition: drain.hh:71
void setValues()
Initialization function.
Definition: ufs_device.cc:889
std::deque< struct transferStart > transferStartInfo
Definition: ufs_device.hh:1096
Tick transactionStart[32]
Helper for latency stats These variables keep track of the latency for every doorbell.
Definition: ufs_device.hh:1052
uint32_t ORInterruptStatus
Operation and runtime registers.
Definition: ufs_device.hh:201
std::vector< uint8_t > buffer
Definition: ufs_device.hh:423
UPIU tranfer message.
Definition: ufs_device.hh:325
void finalUTP()
final UTP, sends the last acknowledge data structure to the system; prepares the clean up functions...
Definition: ufs_device.cc:1743
Stats::Scalar totalReadSSD
Amount of data read/written.
Definition: ufs_device.hh:502
void transferStart()
Transfer Start function.
Definition: ufs_device.cc:1362
struct UTPUPIURSP - Response UPIU structure header: UPIU header DW-0 to DW-2 residualTransferCount: R...
Definition: ufs_device.hh:271
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 t...
Definition: ufs_device.cc:1928
bool transferCompleted
Signals to Host layer 1: signal for transaction completion 2: signal for read action completion...
Definition: ufs_device.hh:705
void writeFlash(uint8_t *writeaddr, uint64_t offset, uint32_t size)
Write flash.
Definition: ufs_device.cc:706
struct UTPTransferReqDesc - UTRD structure header: UTRD header DW-0 to DW-3 commandDescBaseAddrLo: UC...
Definition: ufs_device.hh:342
void SSDWriteDone()
SSD Write Done; This is the callback function for the memory model.
Definition: ufs_device.cc:2052
UFS command flow state machine digraph CommandFlow{ node [fontsize=10]; IDLE -> transferHandler [ lab...
Definition: ufs_device.hh:170
UFSHostDevice(const UFSHostDeviceParams *p)
Constructor for the UFS Host device.
Definition: ufs_device.cc:719
DiskImage * flashDisk
The objects this model links to.
Definition: ufs_device.hh:674
struct UTPUPIUHeader header
Definition: ufs_device.hh:288
transferDoneInfo transferInfo
End of transfer information.
Definition: ufs_device.hh:607
uint32_t ORInterruptEnable
Definition: ufs_device.hh:202
std::deque< EventWrapper< UFSHostDevice,&UFSHostDevice::readGarbage > > readGarbageEventQueue
Event after a read to clean up the UTP data structures.
Definition: ufs_device.hh:1166
Bitfield< 23, 0 > offset
Definition: types.hh:149
void regStats() override
register statistics
Definition: ufs_device.cc:775
Stats::Scalar totalWriteDiskTransactions
Definition: ufs_device.hh:505
uint8_t pendingDoorbells
Definition: ufs_device.hh:1025
struct UTPUPIUTaskReq - Task request UPIU structure header - UPIU header structure DW0 to DW-2 inputP...
Definition: ufs_device.hh:287
struct UFSHCDSGEntry PRDTable[128]
Definition: ufs_device.hh:319
Tick write(PacketPtr pkt) override
UFSHCD write function.
Definition: ufs_device.cc:1067
struct UFSHostDeviceStats stats
RequestHandler stats.
Definition: ufs_device.hh:1121
std::deque< struct transferStart > transferEnd
To finish the transaction one needs information about the original message.
Definition: ufs_device.hh:1084
struct UFSHostDevice::UTPTransferReqDesc::RequestDescHeader header
uint32_t ORHostControllerEnable
Definition: ufs_device.hh:204
std::deque< EventWrapper< UFSHostDevice,&UFSHostDevice::writeDone > > writeDoneEvent
Definition: ufs_device.hh:1135
Tick read(PacketPtr pkt) override
register access functions
Definition: ufs_device.cc:929
void readFlash(uint8_t *readaddr, uint64_t offset, uint32_t size)
Disk access functions.
Definition: ufs_device.cc:692
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2475
void statusCheck(uint8_t status, uint8_t *sensecodelist)
Status of SCSI.
Definition: ufs_device.cc:675
int readPendingNum
Track number of DMA transactions in progress.
Definition: ufs_device.hh:1012
const Addr pioAddr
Host controller information.
Definition: ufs_device.hh:996
void readCallback()
Read callback Call back function for the logic units to indicate the completion of a read action...
Definition: ufs_device.cc:2242
std::deque< struct UTPTransferReqDesc * > garbage
garbage queue, ensure clearing of the allocated memory
Definition: ufs_device.hh:1116
Bitfield< 5, 0 > status
Definition: miscregs.hh:1604
void commandHandler()
Command handler function.
Definition: ufs_device.cc:1382
const int intNum
Definition: ufs_device.hh:999
bool finishedCommand() const
finished command.
Definition: ufs_device.hh:571
uint32_t HCCAP
Specify the host capabilities.
Definition: ufs_device.hh:193
uint8_t activeDoorbells
Statistics helper variables Active doorbells indicates how many doorbells are in teh process of being...
Definition: ufs_device.hh:1024
Callback * memReadCallback
Callbacks between Device and Memory.
Definition: ufs_device.hh:729
All the data structures are defined in the UFS standard This standard be found at the JEDEC website f...
Definition: ufs_device.hh:257
Stats::Average averageSCSIQueue
Average Queue lengths.
Definition: ufs_device.hh:514
SCSI reply structure.
Definition: ufs_device.hh:375
uint32_t ORHostControllerStatus
Definition: ufs_device.hh:203
std::deque< struct SCSIResumeInfo > SCSIInfoQueue
Information message queues, as there can be multiple messages queued for handling in this system...
Definition: ufs_device.hh:623
static const unsigned int UPIUHeaderDataIndWord0
Definition: ufs_device.hh:736
uint64_t Tick
Tick count type.
Definition: types.hh:63
void clearInterrupt()
Interrupt control functions.
Definition: ufs_device.cc:1840
void SSDReadDone()
SSD Read done; Determines if the final callback of the transaction should be made at the end of a rea...
Definition: ufs_device.cc:2201
transfer completion info.
Definition: ufs_device.hh:434
std::vector< uint8_t > destination
Definition: ufs_device.hh:477
void taskStart()
Task Start function.
Definition: ufs_device.cc:1348
void readDevice(bool lastTransfer, Addr SCSIStart, uint32_t SCSISize, uint8_t *SCSIDestination, bool no_cache, Event *additional_action)
Dma transaction function: read device.
Definition: ufs_device.cc:2082
bool finishedRead() const
Finished read.
Definition: ufs_device.hh:586
A simple histogram stat.
Definition: statistics.hh:2551
void serialize(CheckpointOut &cp) const override
Serialize; needed to make checkpoints.
Definition: ufs_device.cc:2291
std::deque< struct transferInfo > SSDWriteDoneInfo
SSDWriteDoneInfo: Structure from dma to disk, that contains data, and helper info to get it to the ri...
Definition: ufs_device.hh:637
HCIMem UFSHCIMem
Host controller memory.
Definition: ufs_device.hh:1007
BaseGic * gic
Definition: ufs_device.hh:1000
const uint32_t capacityUpper
Definition: ufs_device.hh:691
Stats::Formula curDoorbell
Number of doorbells rung.
Definition: ufs_device.hh:519
void LUNSignal()
LU callback function to indicate that the action has completed.
Definition: ufs_device.cc:1672
DrainState drain() override
Drain; needed to enable checkpoints.
Definition: ufs_device.cc:2325
std::deque< struct writeToDiskBurst > dmaWriteInfo
Information to get a DMA transaction.
Definition: ufs_device.hh:1101
Basic interface for accessing a disk image.
Definition: disk_image.hh:51
static const unsigned int cachingPage[5]
Definition: ufs_device.hh:748
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
uint32_t TMUTMRLBA
Task control registers.
Definition: ufs_device.hh:229
static const unsigned int UPIUHeaderDataIndWord2
Definition: ufs_device.hh:738
static const unsigned int UPIUHeaderDataIndWord1
Definition: ufs_device.hh:737
void transferHandler(struct UTPTransferReqDesc *request_in, int req_pos, Addr finaladdress, uint32_t finalsize, uint32_t done)
Transfer handler function.
Definition: ufs_device.cc:1432
void SCSIStart()
Transfer SCSI function.
Definition: ufs_device.cc:1475
UFSSCSIDevice(const UFSHostDeviceParams *p, uint32_t lun_id, Callback *transfer_cb, Callback *read_cb)
Constructor and destructor.
Definition: ufs_device.cc:77
struct UTPTransferCMDDesc - UFS Commad Descriptor structure commandUPIU: Command UPIU Frame address r...
Definition: ufs_device.hh:316
void readGarbage()
Read garbage A read from disk data structure can vary in size and is therefor allocated on creation...
Definition: ufs_device.cc:2279
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
void readCallback()
Functions to indicate that the action to the SSD has completed.
Definition: ufs_device.cc:2222
uint32_t CMDUICCMDR
Command registers.
Definition: ufs_device.hh:238
Callback * signalDone
Callbacks between Host and Device.
Definition: ufs_device.hh:723
static const unsigned int UTPTaskREQCOMPL
Definition: ufs_device.hh:1182
void manageReadTransfer(uint32_t size, uint32_t LUN, uint64_t offset, uint32_t sg_table_length, struct UFSHCDSGEntry *sglist)
Manage read transfer.
Definition: ufs_device.cc:2115
STL deque class.
Definition: stl.hh:47
struct UTPTransferReqDesc * destination
Definition: ufs_device.hh:449
struct UTPUPIUHeader header
Definition: ufs_device.hh:326
A formula for statistics that is calculated when printed.
Definition: statistics.hh:2895
struct UTPUPIUTaskReq destination
Definition: ufs_device.hh:461
void setReadSignal()
set signal to indicate that the read action has been completed
Definition: ufs_device.hh:674
static const unsigned int recoveryPage[3]
Definition: ufs_device.hh:747
Logic unit information structure.
Definition: ufs_device.hh:391
Task start information.
Definition: ufs_device.hh:460
struct UTPUPIUHeader header
Definition: ufs_device.hh:272
device layer: This is your Logic unit This layer implements the SCSI functionality of the UFS Device ...
Definition: ufs_device.hh:533
int size()
Definition: pagetable.hh:146
struct UTPTransferReqDesc * RequestIn
Definition: ufs_device.hh:473
uint32_t amountOfWriteTransfers
transaction progress tracking
Definition: ufs_device.hh:717
std::deque< EventWrapper< UFSHostDevice,&UFSHostDevice::transferStart > > transferEventQueue
Definition: ufs_device.hh:1176
Base class for ARM GIC implementations.
void readDone()
Read done Started at the end of a transaction after the last read action.
Definition: ufs_device.cc:1789
struct RequestDescHeader dword0: Descriptor Header DW0 dword1: Descriptor Header DW1 dword2: Descript...
Definition: ufs_device.hh:351
Declaration of the Packet class.
const Addr pioSize
Definition: ufs_device.hh:997
uint32_t vendorSpecific
vendor specific register
Definition: ufs_device.hh:215
std::ostream CheckpointOut
Definition: serialize.hh:67
static const unsigned int UTPTransferREQCOMPL
Bits of interest within UFS data packages.
Definition: ufs_device.hh:1181
Stats::Formula averageReadSSDBW
Average bandwidth for reads and writes.
Definition: ufs_device.hh:510
Host Controller Interface This is a set of registers that allow the driver to control the transaction...
Definition: ufs_device.hh:189
void writeDone()
Write done After a DMA write with data intended for the disk, this function is called.
Definition: ufs_device.cc:1987
Different events, and scenarios require different types of information.
Definition: ufs_device.hh:422
Definition: eventq.hh:185
const Tick pioDelay
Definition: ufs_device.hh:998
struct UPIUMessage message
Definition: ufs_device.hh:379
Disk Image Interfaces.
uint32_t TRUTRLBA
Transfer control registers.
Definition: ufs_device.hh:220
EventWrapper< UFSHostDevice,&UFSHostDevice::SCSIStart > SCSIResumeEvent
The events that control the functionality.
Definition: ufs_device.hh:1155
struct SCSIReply request_out_datain
SCSI reply structure, used for direct answering.
Definition: ufs_device.hh:1067
After a SCSI command has been identified, the SCSI resume function will handle it.
Definition: ufs_device.hh:472
uint32_t taskCommandTrack
Definition: ufs_device.hh:1045
std::deque< struct transferInfo > SSDWriteinfo
Information from DMA transaction to disk.
Definition: ufs_device.hh:1106
void setTotalWrite(uint32_t total_write)
Sets total amount of write transactions that needs to be made.
Definition: ufs_device.hh:607
void clearSignal()
Clear signal.
Definition: ufs_device.hh:577
const uint32_t capacityLower
Definition: ufs_device.hh:690
Stats::Histogram transactionLatency
Histogram of latencies.
Definition: ufs_device.hh:524
const uint32_t blkSize
Logic unit dimensions.
Definition: ufs_device.hh:687
Transfer start information.
Definition: ufs_device.hh:448
This is an interface between the disk interface (which will handle the disk data transactions) and th...
Definition: abstract_nvm.hh:55
struct UFSHCDSGEntry - UFSHCI PRD Entry baseAddr: Lower 32bit physical address DW-0 upperAddr: Upper ...
Definition: ufs_device.hh:302
static const unsigned int controlPage[3]
These pages are SCSI specific.
Definition: ufs_device.hh:746
Callback * memReadCallback
Definition: ufs_device.hh:1143
void taskHandler(struct UTPUPIUTaskReq *request_in, uint32_t req_pos, Addr finaladdress, uint32_t finalsize)
Task handler function.
Definition: ufs_device.cc:1396
uint32_t transferTrack
Track the transfer This is allows the driver to "group" certain transfers together by using a tag in ...
Definition: ufs_device.hh:1044
std::vector< uint32_t > dataMsg
Definition: ufs_device.hh:329
Disk transfer burst information.
Definition: ufs_device.hh:485
struct UTPUPIURSP requestOut
Definition: ufs_device.hh:437
std::vector< UFSSCSIDevice * > UFSDevice
logic units connected to the UFS Host device Note again that the "device" as such is represented by o...
Definition: ufs_device.hh:1060
struct LUNInfo lunInfo
Logic unit info; needed for SCSI Info messages and LU identification.
Definition: ufs_device.hh:697
void SSDWriteStart()
SSD write start.
Definition: ufs_device.cc:2033
EventWrapper< UFSHostDevice,&UFSHostDevice::finalUTP > UTPEvent
Wait for the moment where we can send the last frame.
Definition: ufs_device.hh:1160
uint32_t countInt
interrupt verification This keeps track of the number of interrupts generated.
Definition: ufs_device.hh:1034
std::deque< EventWrapper< UFSHostDevice,&UFSHostDevice::taskStart > > taskEventQueue
Multiple tasks transfers can be scheduled at once for the device, the only thing we know for sure abo...
Definition: ufs_device.hh:1174
Bitfield< 0 > p
std::deque< EventWrapper< UFSHostDevice,&UFSHostDevice::readDone > > readDoneEvent
Transfer flow events Basically these events form two queues, one from memory to UFS device (DMA) and ...
Definition: ufs_device.hh:1133
const uint8_t UFSSlots
Definition: ufs_device.hh:1002
void requestHandler()
Handler functions.
Definition: ufs_device.cc:1231
void checkDrain()
Checkdrain; needed to enable checkpoints.
Definition: ufs_device.cc:2341
void SCSIResume(uint32_t lun_id)
Starts the scsi handling function in the apropriate Logic unit, prepares the right data transfer sche...
Definition: ufs_device.cc:1520
Abstract superclass for simulation objects.
Definition: sim_object.hh:94
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.
Definition: ufs_device.cc:1704
static const unsigned int UICCommandCOMPL
Definition: ufs_device.hh:1183
static const unsigned int UICCommandReady
Definition: ufs_device.hh:1184
std::deque< struct transferInfo > SSDReadInfo
SSDReadInfo: Structure from disk to dma, that contains data, and helper info to get it to the right p...
Definition: ufs_device.hh:629
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 in...
Definition: ufs_device.cc:1878

Generated on Fri Jun 9 2017 13:03:45 for gem5 by doxygen 1.8.6