mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge tag 'pull-ufs-20240603' of https://gitlab.com/jeuk20.kim/qemu into staging
hw/ufs patches - Add support MCQ of UFSHCI 4.0 # -----BEGIN PGP SIGNATURE----- # # iQIzBAABCgAdFiEEUBfYMVl8eKPZB+73EuIgTA5dtgIFAmZdf7EACgkQEuIgTA5d # tgLI8Q//SXqscGTP/FrjaUj0SsQE90E0AEEfIX4juVP8e1FiFcM9x6tmEU/CT5CM # BQYk1zn0d3JY09ClIyr+AlVyy5RYMdlL/LyhGElxU0MPZh6u4X/6QJ/oHcxAx96r # sRGSjJp5k2maHXgjQmqVUFkp22SZGt5vpD+AQT83wvuWshL302b3MDJ8B3f9zX90 # mCcwSmk+JgSjceaXueuBAbOJud6Ie3jAqXf4w8Gv21nLwzRmDBacjfn5LGSVzQxd # BLkADuwRcRkxQ9hpoCPWOdKvXCAXtTIYqw8BRCG7Avl478UDI+CrYNjvK62SystM # el2ql5ZvGjL8w+k7aQxqJi44RyQH3k1NJwvss3pdRyJzwL9x9pVRVlsM6tQbW56u # COVexJnKDoufWmQs7o6rOv5OzexC6cD6yEoH2mi60F35jO8j3skJi1od7ehHwbzm # 2a6dt1glBKvRWgfcLgEGuFERji3vV++9T6bAg8To0GYTryZKZzLKMSbIHvYI/49t # u4ZwqhYkp36gpcQ8eA7Byr5FWd19UzEin6sVw3uCYibr6oONFTjp+XXnFz/LK9Fu # XbrSOe8943FCUs9dCBHHtJFLmw4j1Ck60GpnogFkzjPEhlKDHO8+4/lm1gFgPV2h # K2wqmq5kw8JtTKvHSDGa4iGTfJ/zxMOv1ePc3wiulwSH28kl6r8= # =dQMQ # -----END PGP SIGNATURE----- # gpg: Signature made Mon 03 Jun 2024 03:32:49 AM CDT # gpg: using RSA key 5017D831597C78A3D907EEF712E2204C0E5DB602 # gpg: Good signature from "Jeuk Kim <jeuk20.kim@samsung.com>" [unknown] # gpg: aka "Jeuk Kim <jeuk20.kim@gmail.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 5017 D831 597C 78A3 D907 EEF7 12E2 204C 0E5D B602 * tag 'pull-ufs-20240603' of https://gitlab.com/jeuk20.kim/qemu: hw/ufs: Add support MCQ of UFSHCI 4.0 hw/ufs: Update MCQ-related fields to block/ufs.h Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
@@ -11,13 +11,18 @@ ufs_exec_nop_cmd(uint32_t slot) "UTRLDBR slot %"PRIu32""
|
||||
ufs_exec_scsi_cmd(uint32_t slot, uint8_t lun, uint8_t opcode) "slot %"PRIu32", lun 0x%"PRIx8", opcode 0x%"PRIx8""
|
||||
ufs_exec_query_cmd(uint32_t slot, uint8_t opcode) "slot %"PRIu32", opcode 0x%"PRIx8""
|
||||
ufs_process_uiccmd(uint32_t uiccmd, uint32_t ucmdarg1, uint32_t ucmdarg2, uint32_t ucmdarg3) "uiccmd 0x%"PRIx32", ucmdarg1 0x%"PRIx32", ucmdarg2 0x%"PRIx32", ucmdarg3 0x%"PRIx32""
|
||||
ufs_mcq_complete_req(uint8_t qid) "sqid %"PRIu8""
|
||||
ufs_mcq_create_sq(uint8_t sqid, uint8_t cqid, uint64_t addr, uint16_t size) "mcq create sq sqid %"PRIu8", cqid %"PRIu8", addr 0x%"PRIx64", size %"PRIu16""
|
||||
ufs_mcq_create_cq(uint8_t cqid, uint64_t addr, uint16_t size) "mcq create cq cqid %"PRIu8", addr 0x%"PRIx64", size %"PRIu16""
|
||||
|
||||
# error condition
|
||||
ufs_err_dma_read_utrd(uint32_t slot, uint64_t addr) "failed to read utrd. UTRLDBR slot %"PRIu32", UTRD dma addr %"PRIu64""
|
||||
ufs_err_dma_read_req_upiu(uint32_t slot, uint64_t addr) "failed to read req upiu. UTRLDBR slot %"PRIu32", request upiu addr %"PRIu64""
|
||||
ufs_err_dma_read_prdt(uint32_t slot, uint64_t addr) "failed to read prdt. UTRLDBR slot %"PRIu32", prdt addr %"PRIu64""
|
||||
ufs_err_dma_read_sq(uint8_t sqid, uint64_t addr) "failed to read sq entry. sqid %"PRIu8", hwaddr %"PRIu64""
|
||||
ufs_err_dma_write_utrd(uint32_t slot, uint64_t addr) "failed to write utrd. UTRLDBR slot %"PRIu32", UTRD dma addr %"PRIu64""
|
||||
ufs_err_dma_write_rsp_upiu(uint32_t slot, uint64_t addr) "failed to write rsp upiu. UTRLDBR slot %"PRIu32", response upiu addr %"PRIu64""
|
||||
ufs_err_dma_write_cq(uint8_t cqid, uint64_t addr) "failed to write cq entry. cqid %"PRIu8", hwaddr %"PRIu64""
|
||||
ufs_err_utrl_slot_error(uint32_t slot) "UTRLDBR slot %"PRIu32" is in error"
|
||||
ufs_err_utrl_slot_busy(uint32_t slot) "UTRLDBR slot %"PRIu32" is busy"
|
||||
ufs_err_unsupport_register_offset(uint32_t offset) "Register offset 0x%"PRIx32" is not yet supported"
|
||||
@@ -31,3 +36,15 @@ ufs_err_query_invalid_opcode(uint8_t opcode) "query request has invalid opcode.
|
||||
ufs_err_query_invalid_idn(uint8_t opcode, uint8_t idn) "query request has invalid idn. opcode: 0x%"PRIx8", idn 0x%"PRIx8""
|
||||
ufs_err_query_invalid_index(uint8_t opcode, uint8_t index) "query request has invalid index. opcode: 0x%"PRIx8", index 0x%"PRIx8""
|
||||
ufs_err_invalid_trans_code(uint32_t slot, uint8_t trans_code) "request upiu has invalid transaction code. slot: %"PRIu32", trans_code: 0x%"PRIx8""
|
||||
ufs_err_mcq_db_wr_invalid_sqid(uint8_t qid) "invalid mcq sqid %"PRIu8""
|
||||
ufs_err_mcq_db_wr_invalid_db(uint8_t qid, uint32_t db) "invalid mcq doorbell sqid %"PRIu8", db %"PRIu32""
|
||||
ufs_err_mcq_create_sq_invalid_sqid(uint8_t qid) "invalid mcq sqid %"PRIu8""
|
||||
ufs_err_mcq_create_sq_invalid_cqid(uint8_t qid) "invalid mcq cqid %"PRIu8""
|
||||
ufs_err_mcq_create_sq_already_exists(uint8_t qid) "mcq sqid %"PRIu8 "already exists"
|
||||
ufs_err_mcq_delete_sq_invalid_sqid(uint8_t qid) "invalid mcq sqid %"PRIu8""
|
||||
ufs_err_mcq_delete_sq_not_exists(uint8_t qid) "mcq sqid %"PRIu8 "not exists"
|
||||
ufs_err_mcq_create_cq_invalid_cqid(uint8_t qid) "invalid mcq cqid %"PRIu8""
|
||||
ufs_err_mcq_create_cq_already_exists(uint8_t qid) "mcq cqid %"PRIu8 "already exists"
|
||||
ufs_err_mcq_delete_cq_invalid_cqid(uint8_t qid) "invalid mcq cqid %"PRIu8""
|
||||
ufs_err_mcq_delete_cq_not_exists(uint8_t qid) "mcq cqid %"PRIu8 "not exists"
|
||||
ufs_err_mcq_delete_cq_sq_not_deleted(uint8_t sqid, uint8_t cqid) "mcq sq %"PRIu8" still has cq %"PRIu8""
|
||||
|
||||
+457
-18
File diff suppressed because it is too large
Load Diff
+97
-1
@@ -16,6 +16,7 @@
|
||||
#include "block/ufs.h"
|
||||
|
||||
#define UFS_MAX_LUS 32
|
||||
#define UFS_MAX_MCQ_QNUM 32
|
||||
#define UFS_BLOCK_SIZE_SHIFT 12
|
||||
#define UFS_BLOCK_SIZE (1 << UFS_BLOCK_SIZE_SHIFT)
|
||||
|
||||
@@ -45,10 +46,11 @@ typedef enum UfsReqResult {
|
||||
UFS_REQUEST_NO_COMPLETE = 2,
|
||||
} UfsReqResult;
|
||||
|
||||
#define UFS_INVALID_SLOT (-1)
|
||||
typedef struct UfsRequest {
|
||||
struct UfsHc *hc;
|
||||
UfsRequestState state;
|
||||
int slot;
|
||||
int slot; /* -1 when it's a MCQ request */
|
||||
|
||||
UtpTransferReqDesc utrd;
|
||||
UtpUpiuReq req_upiu;
|
||||
@@ -57,8 +59,18 @@ typedef struct UfsRequest {
|
||||
/* for scsi command */
|
||||
QEMUSGList *sg;
|
||||
uint32_t data_len;
|
||||
|
||||
/* for MCQ */
|
||||
struct UfsSq *sq;
|
||||
struct UfsCqEntry cqe;
|
||||
QTAILQ_ENTRY(UfsRequest) entry;
|
||||
} UfsRequest;
|
||||
|
||||
static inline bool ufs_mcq_req(UfsRequest *req)
|
||||
{
|
||||
return req->sq != NULL;
|
||||
}
|
||||
|
||||
struct UfsLu;
|
||||
typedef UfsReqResult (*UfsScsiOp)(struct UfsLu *, UfsRequest *);
|
||||
|
||||
@@ -76,13 +88,43 @@ typedef struct UfsParams {
|
||||
char *serial;
|
||||
uint8_t nutrs; /* Number of UTP Transfer Request Slots */
|
||||
uint8_t nutmrs; /* Number of UTP Task Management Request Slots */
|
||||
bool mcq; /* Multiple Command Queue support */
|
||||
uint8_t mcq_qcfgptr; /* MCQ Queue Configuration Pointer in MCQCAP */
|
||||
uint8_t mcq_maxq; /* MCQ Maximum number of Queues */
|
||||
} UfsParams;
|
||||
|
||||
/*
|
||||
* MCQ Properties
|
||||
*/
|
||||
typedef struct UfsSq {
|
||||
struct UfsHc *u;
|
||||
uint8_t sqid;
|
||||
struct UfsCq *cq;
|
||||
uint64_t addr;
|
||||
uint16_t size; /* A number of entries (qdepth) */
|
||||
|
||||
QEMUBH *bh; /* Bottom half to process requests in async */
|
||||
UfsRequest *req;
|
||||
QTAILQ_HEAD(, UfsRequest) req_list; /* Free request list */
|
||||
} UfsSq;
|
||||
|
||||
typedef struct UfsCq {
|
||||
struct UfsHc *u;
|
||||
uint8_t cqid;
|
||||
uint64_t addr;
|
||||
uint16_t size; /* A number of entries (qdepth) */
|
||||
|
||||
QEMUBH *bh;
|
||||
QTAILQ_HEAD(, UfsRequest) req_list;
|
||||
} UfsCq;
|
||||
|
||||
typedef struct UfsHc {
|
||||
PCIDevice parent_obj;
|
||||
UfsBus bus;
|
||||
MemoryRegion iomem;
|
||||
UfsReg reg;
|
||||
UfsMcqReg mcq_reg[UFS_MAX_MCQ_QNUM];
|
||||
UfsMcqOpReg mcq_op_reg[UFS_MAX_MCQ_QNUM];
|
||||
UfsParams params;
|
||||
uint32_t reg_size;
|
||||
UfsRequest *req_list;
|
||||
@@ -100,8 +142,62 @@ typedef struct UfsHc {
|
||||
qemu_irq irq;
|
||||
QEMUBH *doorbell_bh;
|
||||
QEMUBH *complete_bh;
|
||||
|
||||
/* MCQ properties */
|
||||
UfsSq *sq[UFS_MAX_MCQ_QNUM];
|
||||
UfsCq *cq[UFS_MAX_MCQ_QNUM];
|
||||
} UfsHc;
|
||||
|
||||
static inline uint32_t ufs_mcq_sq_tail(UfsHc *u, uint32_t qid)
|
||||
{
|
||||
return u->mcq_op_reg[qid].sq.tp;
|
||||
}
|
||||
|
||||
static inline void ufs_mcq_update_sq_tail(UfsHc *u, uint32_t qid, uint32_t db)
|
||||
{
|
||||
u->mcq_op_reg[qid].sq.tp = db;
|
||||
}
|
||||
|
||||
static inline uint32_t ufs_mcq_sq_head(UfsHc *u, uint32_t qid)
|
||||
{
|
||||
return u->mcq_op_reg[qid].sq.hp;
|
||||
}
|
||||
|
||||
static inline void ufs_mcq_update_sq_head(UfsHc *u, uint32_t qid, uint32_t db)
|
||||
{
|
||||
u->mcq_op_reg[qid].sq.hp = db;
|
||||
}
|
||||
|
||||
static inline bool ufs_mcq_sq_empty(UfsHc *u, uint32_t qid)
|
||||
{
|
||||
return ufs_mcq_sq_tail(u, qid) == ufs_mcq_sq_head(u, qid);
|
||||
}
|
||||
|
||||
static inline uint32_t ufs_mcq_cq_tail(UfsHc *u, uint32_t qid)
|
||||
{
|
||||
return u->mcq_op_reg[qid].cq.tp;
|
||||
}
|
||||
|
||||
static inline void ufs_mcq_update_cq_tail(UfsHc *u, uint32_t qid, uint32_t db)
|
||||
{
|
||||
u->mcq_op_reg[qid].cq.tp = db;
|
||||
}
|
||||
|
||||
static inline uint32_t ufs_mcq_cq_head(UfsHc *u, uint32_t qid)
|
||||
{
|
||||
return u->mcq_op_reg[qid].cq.hp;
|
||||
}
|
||||
|
||||
static inline void ufs_mcq_update_cq_head(UfsHc *u, uint32_t qid, uint32_t db)
|
||||
{
|
||||
u->mcq_op_reg[qid].cq.hp = db;
|
||||
}
|
||||
|
||||
static inline bool ufs_mcq_cq_empty(UfsHc *u, uint32_t qid)
|
||||
{
|
||||
return ufs_mcq_cq_tail(u, qid) == ufs_mcq_cq_head(u, qid);
|
||||
}
|
||||
|
||||
#define TYPE_UFS "ufs"
|
||||
#define UFS(obj) OBJECT_CHECK(UfsHc, (obj), TYPE_UFS)
|
||||
|
||||
|
||||
+128
-3
@@ -7,7 +7,7 @@
|
||||
|
||||
typedef struct QEMU_PACKED UfsReg {
|
||||
uint32_t cap;
|
||||
uint32_t rsvd0;
|
||||
uint32_t mcqcap;
|
||||
uint32_t ver;
|
||||
uint32_t rsvd1;
|
||||
uint32_t hcpid;
|
||||
@@ -46,6 +46,13 @@ typedef struct QEMU_PACKED UfsReg {
|
||||
uint32_t rsvd7[4];
|
||||
uint32_t rsvd8[16];
|
||||
uint32_t ccap;
|
||||
uint32_t rsvd9[127];
|
||||
uint32_t config;
|
||||
uint32_t rsvd10[3];
|
||||
uint32_t rsvd11[28];
|
||||
uint32_t mcqconfig;
|
||||
uint32_t esilba;
|
||||
uint32_t esiuba;
|
||||
} UfsReg;
|
||||
|
||||
REG32(CAP, offsetof(UfsReg, cap))
|
||||
@@ -57,6 +64,15 @@ REG32(CAP, offsetof(UfsReg, cap))
|
||||
FIELD(CAP, OODDS, 25, 1)
|
||||
FIELD(CAP, UICDMETMS, 26, 1)
|
||||
FIELD(CAP, CS, 28, 1)
|
||||
FIELD(CAP, LSDBS, 29, 1)
|
||||
FIELD(CAP, MCQS, 30, 1)
|
||||
REG32(MCQCAP, offsetof(UfsReg, mcqcap))
|
||||
FIELD(MCQCAP, MAXQ, 0, 8)
|
||||
FIELD(MCQCAP, SP, 8, 1)
|
||||
FIELD(MCQCAP, RRP, 9, 1)
|
||||
FIELD(MCQCAP, EIS, 10, 1)
|
||||
FIELD(MCQCAP, QCFGPTR, 16, 8)
|
||||
FIELD(MCQCAP, MIAG, 24, 8)
|
||||
REG32(VER, offsetof(UfsReg, ver))
|
||||
REG32(HCPID, offsetof(UfsReg, hcpid))
|
||||
REG32(HCMID, offsetof(UfsReg, hcmid))
|
||||
@@ -78,6 +94,7 @@ REG32(IS, offsetof(UfsReg, is))
|
||||
FIELD(IS, HCFES, 16, 1)
|
||||
FIELD(IS, SBFES, 17, 1)
|
||||
FIELD(IS, CEFES, 18, 1)
|
||||
FIELD(IS, CQES, 20, 1)
|
||||
REG32(IE, offsetof(UfsReg, ie))
|
||||
FIELD(IE, UTRCE, 0, 1)
|
||||
FIELD(IE, UDEPRIE, 1, 1)
|
||||
@@ -95,6 +112,7 @@ REG32(IE, offsetof(UfsReg, ie))
|
||||
FIELD(IE, HCFEE, 16, 1)
|
||||
FIELD(IE, SBFEE, 17, 1)
|
||||
FIELD(IE, CEFEE, 18, 1)
|
||||
FIELD(IE, CQEE, 20, 1)
|
||||
REG32(HCS, offsetof(UfsReg, hcs))
|
||||
FIELD(HCS, DP, 0, 1)
|
||||
FIELD(HCS, UTRLRDY, 1, 1)
|
||||
@@ -128,9 +146,14 @@ REG32(UCMDARG1, offsetof(UfsReg, ucmdarg1))
|
||||
REG32(UCMDARG2, offsetof(UfsReg, ucmdarg2))
|
||||
REG32(UCMDARG3, offsetof(UfsReg, ucmdarg3))
|
||||
REG32(CCAP, offsetof(UfsReg, ccap))
|
||||
REG32(CONFIG, offsetof(UfsReg, config))
|
||||
FIELD(CONFIG, QT, 0, 1)
|
||||
REG32(MCQCONFIG, offsetof(UfsReg, mcqconfig))
|
||||
FIELD(MCQCONFIG, MAC, 8, 8)
|
||||
|
||||
#define UFS_INTR_MASK \
|
||||
((1 << R_IS_CEFES_SHIFT) | (1 << R_IS_SBFES_SHIFT) | \
|
||||
((1 << R_IS_CQES_SHIFT) | \
|
||||
(1 << R_IS_CEFES_SHIFT) | (1 << R_IS_SBFES_SHIFT) | \
|
||||
(1 << R_IS_HCFES_SHIFT) | (1 << R_IS_UTPES_SHIFT) | \
|
||||
(1 << R_IS_DFES_SHIFT) | (1 << R_IS_UCCS_SHIFT) | \
|
||||
(1 << R_IS_UTMRCS_SHIFT) | (1 << R_IS_ULSS_SHIFT) | \
|
||||
@@ -157,6 +180,84 @@ REG32(CCAP, offsetof(UfsReg, ccap))
|
||||
((be32_to_cpu(dword2) >> UFS_UPIU_HEADER_DATA_SEGMENT_LENGTH_SHIFT) & \
|
||||
UFS_UPIU_HEADER_DATA_SEGMENT_LENGTH_MASK)
|
||||
|
||||
typedef struct QEMU_PACKED UfsMcqReg {
|
||||
uint32_t sqattr;
|
||||
uint32_t sqlba;
|
||||
uint32_t squba;
|
||||
uint32_t sqdao;
|
||||
uint32_t sqisao;
|
||||
uint32_t sqcfg;
|
||||
uint32_t rsvd0[2];
|
||||
uint32_t cqattr;
|
||||
uint32_t cqlba;
|
||||
uint32_t cquba;
|
||||
uint32_t cqdao;
|
||||
uint32_t cqisao;
|
||||
uint32_t cqcfg;
|
||||
uint32_t rsvd1[2];
|
||||
} UfsMcqReg;
|
||||
|
||||
REG32(SQATTR, offsetof(UfsMcqReg, sqattr))
|
||||
FIELD(SQATTR, SIZE, 0, 16)
|
||||
FIELD(SQATTR, CQID, 16, 8)
|
||||
FIELD(SQATTR, SQPL, 28, 3)
|
||||
FIELD(SQATTR, SQEN, 31, 1)
|
||||
REG32(SQLBA, offsetof(UfsMcqReg, sqlba))
|
||||
REG32(SQUBA, offsetof(UfsMcqReg, squba))
|
||||
REG32(SQDAO, offsetof(UfsMcqReg, sqdao))
|
||||
REG32(SQISAO, offsetof(UfsMcqReg, sqisao))
|
||||
REG32(SQCFG, offsetof(UfsMcqReg, sqcfg))
|
||||
REG32(CQATTR, offsetof(UfsMcqReg, cqattr))
|
||||
FIELD(CQATTR, SIZE, 0, 16)
|
||||
FIELD(CQATTR, CQEN, 31, 1)
|
||||
REG32(CQLBA, offsetof(UfsMcqReg, cqlba))
|
||||
REG32(CQUBA, offsetof(UfsMcqReg, cquba))
|
||||
REG32(CQDAO, offsetof(UfsMcqReg, cqdao))
|
||||
REG32(CQISAO, offsetof(UfsMcqReg, cqisao))
|
||||
REG32(CQCFG, offsetof(UfsMcqReg, cqcfg))
|
||||
|
||||
typedef struct QEMU_PACKED UfsMcqSqReg {
|
||||
uint32_t hp;
|
||||
uint32_t tp;
|
||||
uint32_t rtc;
|
||||
uint32_t cti;
|
||||
uint32_t rts;
|
||||
} UfsMcqSqReg;
|
||||
|
||||
typedef struct QEMU_PACKED UfsMcqCqReg {
|
||||
uint32_t hp;
|
||||
uint32_t tp;
|
||||
} UfsMcqCqReg;
|
||||
|
||||
typedef struct QEMU_PACKED UfsMcqSqIntReg {
|
||||
uint32_t is;
|
||||
uint32_t ie;
|
||||
} UfsMcqSqIntReg;
|
||||
|
||||
typedef struct QEMU_PACKED UfsMcqCqIntReg {
|
||||
uint32_t is;
|
||||
uint32_t ie;
|
||||
uint32_t iacr;
|
||||
} UfsMcqCqIntReg;
|
||||
|
||||
REG32(CQIS, offsetof(UfsMcqCqIntReg, is))
|
||||
FIELD(CQIS, TEPS, 0, 1)
|
||||
|
||||
/*
|
||||
* Provide MCQ Operation & Runtime Registers as a contiguous addressed
|
||||
* registers for the simplicity.
|
||||
* DAO(Doorbell Address Offset) and ISAO(Interrupt Status Register Address
|
||||
* Offset) registers should be properly configured with the following
|
||||
* structure.
|
||||
*/
|
||||
#define UFS_MCQ_OPR_START 0x1000
|
||||
typedef struct QEMU_PACKED UfsMcqOpReg {
|
||||
UfsMcqSqReg sq;
|
||||
UfsMcqSqIntReg sq_int;
|
||||
UfsMcqCqReg cq;
|
||||
UfsMcqCqIntReg cq_int;
|
||||
} UfsMcqOpReg;
|
||||
|
||||
typedef struct QEMU_PACKED DeviceDescriptor {
|
||||
uint8_t length;
|
||||
uint8_t descriptor_idn;
|
||||
@@ -1064,9 +1165,31 @@ typedef struct QEMU_PACKED UtpUpiuRsp {
|
||||
};
|
||||
} UtpUpiuRsp;
|
||||
|
||||
/*
|
||||
* MCQ Completion Queue Entry
|
||||
*/
|
||||
typedef UtpTransferReqDesc UfsSqEntry;
|
||||
typedef struct QEMU_PACKED UfsCqEntry {
|
||||
uint64_t utp_addr;
|
||||
uint16_t resp_len;
|
||||
uint16_t resp_off;
|
||||
uint16_t prdt_len;
|
||||
uint16_t prdt_off;
|
||||
uint8_t status;
|
||||
uint8_t error;
|
||||
uint16_t rsvd1;
|
||||
uint32_t rsvd2[3];
|
||||
} UfsCqEntry;
|
||||
|
||||
static inline void _ufs_check_size(void)
|
||||
{
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsReg) != 0x104);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsReg) != 0x38C);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsMcqReg) != 64);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsMcqSqReg) != 20);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsMcqCqReg) != 8);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsMcqSqIntReg) != 8);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsMcqCqIntReg) != 12);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsMcqOpReg) != 48);
|
||||
QEMU_BUILD_BUG_ON(sizeof(DeviceDescriptor) != 89);
|
||||
QEMU_BUILD_BUG_ON(sizeof(GeometryDescriptor) != 87);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UnitDescriptor) != 45);
|
||||
@@ -1086,5 +1209,7 @@ static inline void _ufs_check_size(void)
|
||||
QEMU_BUILD_BUG_ON(sizeof(UtpTaskReqDesc) != 80);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UtpCmdRsp) != 40);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UtpUpiuRsp) != 288);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsSqEntry) != 32);
|
||||
QEMU_BUILD_BUG_ON(sizeof(UfsCqEntry) != 32);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user