gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
38 
142 #ifndef __DEV_ARM_UFS_DEVICE_HH__
143 #define __DEV_ARM_UFS_DEVICE_HH__
144 
145 #include <deque>
146 
147 #include "base/addr_range.hh"
148 #include "base/bitfield.hh"
149 #include "base/statistics.hh"
150 #include "debug/UFSHostDevice.hh"
151 #include "dev/arm/abstract_nvm.hh"
152 #include "dev/arm/base_gic.hh"
153 #include "dev/storage/disk_image.hh"
154 #include "dev/dma_device.hh"
155 #include "dev/io_device.hh"
156 #include "mem/packet.hh"
157 #include "mem/packet_access.hh"
158 #include "params/UFSHostDevice.hh"
159 #include "sim/serialize.hh"
160 #include "sim/stats.hh"
161 
168 class UFSHostDevice : public DmaDevice
169 {
170  public:
171 
172  UFSHostDevice(const UFSHostDeviceParams* p);
173 
174  DrainState drain() override;
175  void checkDrain();
176  void serialize(CheckpointOut &cp) const override;
177  void unserialize(CheckpointIn &cp) override;
178 
179  private:
187  struct HCIMem {
191  uint32_t HCCAP;
192  uint32_t HCversion;
193  uint32_t HCHCDDID;
194  uint32_t HCHCPMID;
195 
203  uint32_t ORUECPA;
204  uint32_t ORUECDL;
205  uint32_t ORUECN;
206  uint32_t ORUECT;
207  uint32_t ORUECDME;
208  uint32_t ORUTRIACR;
209 
213  uint32_t vendorSpecific;
214 
218  uint32_t TRUTRLBA;
219  uint32_t TRUTRLBAU;
220  uint32_t TRUTRLDBR;
221  uint32_t TRUTRLCLR;
222  uint32_t TRUTRLRSR;
223 
227  uint32_t TMUTMRLBA;
228  uint32_t TMUTMRLBAU;
229  uint32_t TMUTMRLDBR;
230  uint32_t TMUTMRLCLR;
231  uint32_t TMUTMRLRSR;
232 
236  uint32_t CMDUICCMDR;
237  uint32_t CMDUCMDARG1;
238  uint32_t CMDUCMDARG2;
239  uint32_t CMDUCMDARG3;
240  };
241 
255  struct UTPUPIUHeader {
256  uint32_t dWord0;
257  uint32_t dWord1;
258  uint32_t dWord2;
259  };
260 
269  struct UTPUPIURSP {
272  uint32_t reserved[4];
273  uint16_t senseDataLen;
274  uint8_t senseData[18];
275  };
276 
285  struct UTPUPIUTaskReq {
287  uint32_t inputParam1;
288  uint32_t inputParam2;
289  uint32_t inputParam3;
290  uint32_t reserved[2];
291  };
292 
300  struct UFSHCDSGEntry {
301  uint32_t baseAddr;
302  uint32_t upperAddr;
303  uint32_t reserved;
304  uint32_t size;
305  };
306 
315  uint8_t commandUPIU[128];
316  uint8_t responseUPIU[128];
317  struct UFSHCDSGEntry PRDTable[128];
318  };
319 
323  struct UPIUMessage {
325  uint32_t dataOffset;
326  uint32_t dataCount;
328  };
329 
341 
350  uint32_t dWord0;
351  uint32_t dWord1;
352  uint32_t dWord2;
353  uint32_t dWord3;
354  } header;
355 
356  /* DW 4-5*/
359 
360  /* DW 6 */
363 
364  /* DW 7 */
365  uint16_t PRDTableLength;
366  uint16_t PRDTableOffset;
367  };
368 
373  struct SCSIReply {
374  void reset() {
375  memset(static_cast<void*>(this), 0, sizeof(*this));
376  }
377 
378  uint8_t status;
379  uint32_t msgSize;
380  uint8_t LUN;
381  struct UPIUMessage message;
382  uint8_t senseSize;
383  uint8_t expectMore;//0x01 is for writes, 0x02 is for reads
384  uint64_t offset;
385  uint8_t senseCode[19];
386  };
387 
393  struct LUNInfo {
394  uint32_t dWord0;
395  uint32_t dWord1;
396  uint32_t vendor0;
397  uint32_t vendor1;
398  uint32_t product0;
399  uint32_t product1;
400  uint32_t product2;
401  uint32_t product3;
402  uint32_t productRevision;
403  };
404 
424  struct transferInfo {
426  uint32_t size;
427  uint64_t offset;
428  uint32_t filePointer;
429  uint32_t lunID;
430  };
431 
438  uint32_t reqPos;
439  struct UTPUPIURSP requestOut;
440  uint32_t size;
442  uint8_t *destination;
443  bool finished;
444  uint32_t lunID;
445  };
446 
450  struct transferStart {
452  uint32_t mask;
454  uint32_t size;
455  uint32_t done;
456  uint32_t lun_id;
457  };
458 
462  struct taskStart {
464  uint32_t mask;
466  uint32_t size;
467  bool done;
468  };
469 
474  struct SCSIResumeInfo {
476  int reqPos;
478  uint32_t finalSize;
480  uint32_t done;
481  };
482 
489  uint64_t SCSIDiskOffset;
490  uint32_t size;
491  uint32_t LUN;
492  };
493 
502 
510 
514 
519 
524 
528  };
529 
536  {
537  public:
541  UFSSCSIDevice(const UFSHostDeviceParams* p, uint32_t lun_id, Callback*
542  transfer_cb, Callback *read_cb);
543  ~UFSSCSIDevice();
544 
550  struct SCSIReply SCSICMDHandle(uint32_t* SCSI_msg);
551 
560  void readFlash(uint8_t* readaddr, uint64_t offset, uint32_t size);
561 
566  void writeFlash(uint8_t* writeaddr, uint64_t offset, uint32_t size);
567 
573  bool finishedCommand() const {return transferCompleted;};
574 
579  void clearSignal() {transferCompleted = false;};
580 
588  bool finishedRead() const {return readCompleted;};
589 
594  void clearReadSignal() {readCompleted = false;};
595 
601  void SSDReadStart(uint32_t total_read);
602  void SSDWriteStart();
603 
609  void setTotalWrite(uint32_t total_write) {totalWrite = total_write;};
610 
615 
626 
632 
640 
641  private:
648  void readCallback();
649 
654  void SSDReadDone();
655 
659  void SSDWriteDone();
660 
666  void statusCheck(uint8_t status, uint8_t* sensecodelist);
667 
671  void setSignal() {transferCompleted = true;};
672 
676  void setReadSignal() {readCompleted = true;};
677 
683  DiskImage* flashDisk;
685 
689  const uint32_t blkSize;
690  const uint32_t lunAvail;
691  const uint64_t diskSize;
692  const uint32_t capacityLower;
693  const uint32_t capacityUpper;
694 
699  struct LUNInfo lunInfo;
700  const uint32_t lunID;
701 
709 
713  uint32_t totalRead;
714  uint32_t totalWrite;
715 
721 
727 
733 
734  /*
735  * Default response header layout. For more information refer to
736  * chapter 7 http://www.jedec.org/standards-documents/results/jesd220
737  */
738  static const unsigned int UPIUHeaderDataIndWord0 = 0x0000C022;
739  static const unsigned int UPIUHeaderDataIndWord1 = 0x00000000;
740  static const unsigned int UPIUHeaderDataIndWord2 = 0x40000000;
741 
742  /*
743  * SCSI mode pages values assigned in ufs_device.cc
744  * The mode pages give device specific information via the SCSI
745  * protocol. They are defined in
746  * http://www.jedec.org/standards-documents/results/jesd220
747  */
748  static const unsigned int controlPage[3];
749  static const unsigned int recoveryPage[3];
750  static const unsigned int cachingPage[5];
751 
752  /*
753  * SCSI command set; defined in
754  * http://www.jedec.org/standards-documents/results/jesd220
755  */
757  SCSIInquiry = 0x12,
758  SCSIRead6 = 0x08,
759  SCSIRead10 = 0x28,
760  SCSIRead16 = 0x88,
761  SCSIReadCapacity10 = 0x25,
762  SCSIReadCapacity16 = 0x9E,
763  SCSIReportLUNs = 0xA0,
764  SCSIStartStop = 0x1B,
765  SCSITestUnitReady = 0x00,
766  SCSIVerify10 = 0x2F,
767  SCSIWrite6 = 0x0A,
768  SCSIWrite10 = 0x2A,
769  SCSIWrite16 = 0x8A,
770  SCSIFormatUnit = 0x04,
771  SCSISendDiagnostic = 0x1D,
772  SCSISynchronizeCache = 0x35,
773  //UFS SCSI additional command set for full functionality
774  SCSIModeSelect10 = 0x55,
775  SCSIModeSense6 = 0x1A,
776  SCSIModeSense10 = 0x5A,
777  SCSIRequestSense = 0x03,
778  SCSIUnmap = 0x42,
779  SCSIWriteBuffer = 0x3B,
780  SCSIReadBuffer = 0x3C,
781  //SCSI commands not supported by UFS; but Linux send them anyway
782  SCSIMaintenanceIn = 0xA3
783  };
784 
785  /*
786  * SCSI status codes; defined in
787  * http://www.jedec.org/standards-documents/results/jesd220
788  */
790  SCSIGood = 0x00,
791  SCSICheckCondition = 0x02,
792  SCSIConditionGood = 0x04,
793  SCSIBusy = 0x08,
794  SCSIIntermediateGood = 0x10,
795  SCSIIntermediatCGood = 0x14,
796  SCSIReservationConflict = 0x18,
797  SCSICommandTerminated = 0x22,
798  SCSITaskSetFull = 0x28,
799  SCSIACAActive = 0x30,
800  SCSITaskAborted = 0x40
801  };
802 
803  /*
804  * SCSI sense codes; defined in
805  * http://www.jedec.org/standards-documents/results/jesd220
806  */
808  SCSINoSense = 0x00,
809  SCSIRecoverdError = 0x01,
810  SCSINotReady = 0x02,
811  SCSIMediumError = 0x03,
812  SCSIHardwareError = 0x04,
813  SCSIIllegalRequest = 0x05,
814  SCSIUnitAttention = 0x06,
815  SCSIDataProtect = 0x07,
816  SCSIBlankCheck = 0x08,
817  SCSIAbortedCommand = 0x0B,
818  SCSIVolumeOverflow = 0x0D,
819  SCSIMisCompare = 0x0E
820  };
821 
822  };
823 
824  //All access functions are inherrited; no need to make them public
828  AddrRangeList getAddrRanges() const override;
829 
833  Tick read(PacketPtr pkt) override;
834  Tick write(PacketPtr pkt) override;
835  // end of access functions
836 
840  void setValues();
841 
855  void requestHandler();
856 
861  void commandHandler();
862 
867  void taskStart();
868 
874  void taskHandler(struct UTPUPIUTaskReq* request_in,
875  uint32_t req_pos, Addr finaladdress, uint32_t finalsize);
876 
881  void transferStart();
882 
893  request_in, int req_pos, Addr finaladdress,
894  uint32_t finalsize, uint32_t done);
895 
900  void SCSIStart();
901 
906  void SCSIResume(uint32_t lun_id);
907 
911  void LUNSignal();
912 
917  void transferDone(Addr responseStartAddr, uint32_t req_pos,
918  struct UTPUPIURSP request_out, uint32_t size,
919  Addr address, uint8_t* destination, bool finished,
920  uint32_t lun_id);
925  void finalUTP();
926 
930  void clearInterrupt();
931  void generateInterrupt();
932 
940  void writeDevice(Event* additional_action, bool toDisk, Addr start,
941  int size, uint8_t* destination, uint64_t SCSIDiskOffset,
942  uint32_t lun_id);
943  void readDevice(bool lastTransfer, Addr SCSIStart, uint32_t SCSISize,
944  uint8_t* SCSIDestination, bool no_cache,
945  Event* additional_action);
946 
953  void manageWriteTransfer(uint8_t LUN, uint64_t offset, uint32_t
954  sg_table_length, struct UFSHCDSGEntry* sglist);
955  void manageReadTransfer(uint32_t size, uint32_t LUN, uint64_t offset,
956  uint32_t sg_table_length,
957  struct UFSHCDSGEntry* sglist);
958 
965  void readDone();
966 
973  void writeDone();
974 
981  void readCallback();
982 
990  void readGarbage();
991 
993  void regStats() override;
994 
998  const Addr pioAddr;
999  const Addr pioSize;
1001  const int intNum;
1003  const uint32_t lunAvail;
1004  const uint8_t UFSSlots;
1005 
1010 
1016 
1028 
1036  uint32_t countInt;
1037 
1046  uint32_t transferTrack;
1048 
1056 
1063 
1070 
1078 
1087 
1099 
1104 
1109 
1114 
1119 
1124 
1136 
1144 
1156 
1161 
1166 
1174 
1178  static const unsigned int UTPTransferREQCOMPL = 0x01;//UFS_BIT(0)
1179  static const unsigned int UTPTaskREQCOMPL = 0x200;//UFS_BIT(9)
1180  static const unsigned int UICCommandCOMPL = 0x400;//UFS_BIT(10)
1181  static const unsigned int UICCommandReady = 0x08;//UFS_BIT(3)
1182 
1183  /*
1184  * UFSHCI Registers; please refer to
1185  * http://www.jedec.org/standards-documents/results/jesd223
1186  * for their definition.
1187  */
1217  };
1218 };
1219 
1220 #endif //__DEV_ARM_UFS_DEVICE_HH__
Stats::Scalar currentSCSIQueue
Queue lengths.
Definition: ufs_device.hh:499
const uint32_t lunAvail
Definition: ufs_device.hh:1003
std::deque< struct transferInfo > SSDReadPending
Information from the Disk, waiting to be pushed to the DMA.
Definition: ufs_device.hh:1113
void clearReadSignal()
Clear signal.
Definition: ufs_device.hh:594
struct SCSIResumeInfo SCSIInfo
SCSI resume info information structure for SCSI resume.
Definition: ufs_device.hh:1077
void generateInterrupt()
set interrupt and sort out the doorbell register.
Definition: ufs_device.cc:1817
std::deque< EventFunctionWrapper > writeDoneEvent
Definition: ufs_device.hh:1135
output header
Definition: nop.cc:36
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:671
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:1097
Generic callback class.
Definition: callback.hh:39
AddrRangeList getAddrRanges() const override
Address range functions.
Definition: ufs_device.cc:914
uint32_t totalRead
Total amount transactions that need to be made.
Definition: ufs_device.hh:713
void unserialize(CheckpointIn &cp) override
Unserialize; needed to restore from checkpoints.
Definition: ufs_device.cc:2313
A stat that calculates the per tick average of a value.
Definition: statistics.hh:2521
void setValues()
Initialization function.
Definition: ufs_device.cc:887
std::deque< struct transferStart > transferStartInfo
Definition: ufs_device.hh:1098
Tick transactionStart[32]
Helper for latency stats These variables keep track of the latency for every doorbell.
Definition: ufs_device.hh:1054
uint32_t ORInterruptStatus
Operation and runtime registers.
Definition: ufs_device.hh:199
std::vector< uint8_t > buffer
Definition: ufs_device.hh:425
UPIU tranfer message.
Definition: ufs_device.hh:323
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:504
EventFunctionWrapper UTPEvent
Wait for the moment where we can send the last frame.
Definition: ufs_device.hh:1160
void transferStart()
Transfer Start function.
Definition: ufs_device.cc:1362
std::deque< EventFunctionWrapper > readGarbageEventQueue
Event after a read to clean up the UTP data structures.
Definition: ufs_device.hh:1165
std::deque< EventFunctionWrapper > transferEventQueue
Definition: ufs_device.hh:1173
struct UTPUPIURSP - Response UPIU structure header: UPIU header DW-0 to DW-2 residualTransferCount: R...
Definition: ufs_device.hh:269
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:1930
bool transferCompleted
Signals to Host layer 1: signal for transaction completion 2: signal for read action completion...
Definition: ufs_device.hh:707
struct UTPTransferReqDesc - UTRD structure header: UTRD header DW-0 to DW-3 commandDescBaseAddrLo: UC...
Definition: ufs_device.hh:340
UFS command flow state machine digraph CommandFlow{ node [fontsize=10]; IDLE -> transferHandler [ lab...
Definition: ufs_device.hh:168
UFSHostDevice(const UFSHostDeviceParams *p)
Constructor for the UFS Host device.
Definition: ufs_device.cc:717
transferDoneInfo transferInfo
End of transfer information.
Definition: ufs_device.hh:609
uint32_t ORInterruptEnable
Definition: ufs_device.hh:200
Bitfield< 23, 0 > offset
Definition: types.hh:152
void regStats() override
register statistics
Definition: ufs_device.cc:773
Stats::Scalar totalWriteDiskTransactions
Definition: ufs_device.hh:507
uint8_t pendingDoorbells
Definition: ufs_device.hh:1027
Definition: cprintf.cc:40
struct UTPUPIUTaskReq - Task request UPIU structure header - UPIU header structure DW0 to DW-2 inputP...
Definition: ufs_device.hh:285
Tick write(PacketPtr pkt) override
UFSHCD write function.
Definition: ufs_device.cc:1065
struct UFSHostDeviceStats stats
RequestHandler stats.
Definition: ufs_device.hh:1123
std::deque< EventFunctionWrapper > taskEventQueue
Multiple tasks transfers can be scheduled at once for the device, the only thing we know for sure abo...
Definition: ufs_device.hh:1172
std::deque< struct transferStart > transferEnd
To finish the transaction one needs information about the original message.
Definition: ufs_device.hh:1086
uint32_t ORHostControllerEnable
Definition: ufs_device.hh:202
Tick read(PacketPtr pkt) override
register access functions
Definition: ufs_device.cc:927
Declaration of Statistics objects.
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2505
DrainState
Object drain/handover states.
Definition: drain.hh:71
int readPendingNum
Track number of DMA transactions in progress.
Definition: ufs_device.hh:1014
const Addr pioAddr
Host controller information.
Definition: ufs_device.hh:998
void readCallback()
Read callback Call back function for the logic units to indicate the completion of a read action...
Definition: ufs_device.cc:2246
std::deque< struct UTPTransferReqDesc * > garbage
garbage queue, ensure clearing of the allocated memory
Definition: ufs_device.hh:1118
bool finishedCommand() const
finished command.
Definition: ufs_device.hh:573
Bitfield< 5, 0 > status
void commandHandler()
Command handler function.
Definition: ufs_device.cc:1382
const int intNum
Definition: ufs_device.hh:1001
uint32_t HCCAP
Specify the host capabilities.
Definition: ufs_device.hh:191
uint8_t activeDoorbells
Statistics helper variables Active doorbells indicates how many doorbells are in teh process of being...
Definition: ufs_device.hh:1026
Callback * memReadCallback
Callbacks between Device and Memory.
Definition: ufs_device.hh:731
All the data structures are defined in the UFS standard This standard be found at the JEDEC website f...
Definition: ufs_device.hh:255
Stats::Average averageSCSIQueue
Average Queue lengths.
Definition: ufs_device.hh:516
SCSI reply structure.
Definition: ufs_device.hh:373
uint32_t ORHostControllerStatus
Definition: ufs_device.hh:201
std::deque< struct SCSIResumeInfo > SCSIInfoQueue
Information message queues, as there can be multiple messages queued for handling in this system...
Definition: ufs_device.hh:625
uint64_t Tick
Tick count type.
Definition: types.hh:61
void clearInterrupt()
Interrupt control functions.
Definition: ufs_device.cc:1840
transfer completion info.
Definition: ufs_device.hh:436
bool finishedRead() const
Finished read.
Definition: ufs_device.hh:588
std::vector< uint8_t > destination
Definition: ufs_device.hh:479
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:2084
A simple histogram stat.
Definition: statistics.hh:2626
void serialize(CheckpointOut &cp) const override
Serialize; needed to make checkpoints.
Definition: ufs_device.cc:2296
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:639
HCIMem UFSHCIMem
Host controller memory.
Definition: ufs_device.hh:1009
BaseGic * gic
Definition: ufs_device.hh:1002
const uint32_t capacityUpper
Definition: ufs_device.hh:693
Stats::Formula curDoorbell
Number of doorbells rung.
Definition: ufs_device.hh:521
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:2330
std::deque< struct writeToDiskBurst > dmaWriteInfo
Information to get a DMA transaction.
Definition: ufs_device.hh:1103
Basic interface for accessing a disk image.
Definition: disk_image.hh:49
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:140
uint32_t TMUTMRLBA
Task control registers.
Definition: ufs_device.hh:227
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
struct UTPTransferCMDDesc - UFS Commad Descriptor structure commandUPIU: Command UPIU Frame address r...
Definition: ufs_device.hh:314
void readGarbage()
Read garbage A read from disk data structure can vary in size and is therefor allocated on creation...
Definition: ufs_device.cc:2284
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:249
uint32_t CMDUICCMDR
Command registers.
Definition: ufs_device.hh:236
Callback * signalDone
Callbacks between Host and Device.
Definition: ufs_device.hh:725
EventFunctionWrapper SCSIResumeEvent
The events that control the functionality.
Definition: ufs_device.hh:1155
static const unsigned int UTPTaskREQCOMPL
Definition: ufs_device.hh:1179
std::deque< EventFunctionWrapper > readDoneEvent
Transfer flow events Basically these events form two queues, one from memory to UFS device (DMA) and ...
Definition: ufs_device.hh:1134
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:2119
STL deque class.
Definition: stl.hh:44
struct UTPTransferReqDesc * destination
Definition: ufs_device.hh:451
A formula for statistics that is calculated when printed.
Definition: statistics.hh:3009
void setReadSignal()
set signal to indicate that the read action has been completed
Definition: ufs_device.hh:676
Logic unit information structure.
Definition: ufs_device.hh:393
Task start information.
Definition: ufs_device.hh:462
device layer: This is your Logic unit This layer implements the SCSI functionality of the UFS Device ...
Definition: ufs_device.hh:535
struct UTPTransferReqDesc * RequestIn
Definition: ufs_device.hh:475
uint32_t amountOfWriteTransfers
transaction progress tracking
Definition: ufs_device.hh:719
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:349
Declaration of the Packet class.
const Addr pioSize
Definition: ufs_device.hh:999
uint32_t vendorSpecific
vendor specific register
Definition: ufs_device.hh:213
std::ostream CheckpointOut
Definition: serialize.hh:63
static const unsigned int UTPTransferREQCOMPL
Bits of interest within UFS data packages.
Definition: ufs_device.hh:1178
Stats::Formula averageReadSSDBW
Average bandwidth for reads and writes.
Definition: ufs_device.hh:512
Host Controller Interface This is a set of registers that allow the driver to control the transaction...
Definition: ufs_device.hh:187
void writeDone()
Write done After a DMA write with data intended for the disk, this function is called.
Definition: ufs_device.cc:1989
Different events, and scenarios require different types of information.
Definition: ufs_device.hh:424
Definition: eventq.hh:245
const Tick pioDelay
Definition: ufs_device.hh:1000
Disk Image Interfaces.
uint32_t TRUTRLBA
Transfer control registers.
Definition: ufs_device.hh:218
struct SCSIReply request_out_datain
SCSI reply structure, used for direct answering.
Definition: ufs_device.hh:1069
After a SCSI command has been identified, the SCSI resume function will handle it.
Definition: ufs_device.hh:474
uint32_t taskCommandTrack
Definition: ufs_device.hh:1047
std::deque< struct transferInfo > SSDWriteinfo
Information from DMA transaction to disk.
Definition: ufs_device.hh:1108
void clearSignal()
Clear signal.
Definition: ufs_device.hh:579
const uint32_t capacityLower
Definition: ufs_device.hh:692
Stats::Histogram transactionLatency
Histogram of latencies.
Definition: ufs_device.hh:526
const uint32_t blkSize
Logic unit dimensions.
Definition: ufs_device.hh:689
Transfer start information.
Definition: ufs_device.hh:450
This is an interface between the disk interface (which will handle the disk data transactions) and th...
Definition: abstract_nvm.hh:53
struct UFSHCDSGEntry - UFSHCI PRD Entry baseAddr: Lower 32bit physical address DW-0 upperAddr: Upper ...
Definition: ufs_device.hh:300
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:1046
std::vector< uint32_t > dataMsg
Definition: ufs_device.hh:327
Disk transfer burst information.
Definition: ufs_device.hh:487
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:1062
uint32_t countInt
interrupt verification This keeps track of the number of interrupts generated.
Definition: ufs_device.hh:1036
Bitfield< 0 > p
const uint8_t UFSSlots
Definition: ufs_device.hh:1004
void requestHandler()
Handler functions.
Definition: ufs_device.cc:1229
void checkDrain()
Checkdrain; needed to enable checkpoints.
Definition: ufs_device.cc:2346
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:93
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:1180
static const unsigned int UICCommandReady
Definition: ufs_device.hh:1181
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:631
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 Thu May 28 2020 16:21:32 for gem5 by doxygen 1.8.13