summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFaiz Abbas <faiz_abbas@ti.com>2019-10-15 18:24:35 +0530
committerTom Rini <trini@konsulko.com>2019-10-23 20:47:12 -0400
commit8fbac8e23e55a63c218b8d737e629a8d07e9a840 (patch)
tree3371610ff24089a4a71eee6d5b22d78fd4cf63f8 /drivers
parentd48f00ed11d04eb76d4510b3db1d7f36f758d4e9 (diff)
scsi: Add dma direction member to command structure
Some SCSI devices like UFS use DMA for executing scsi commands and hence need to know the direction of transfer of the dma. Add a dma_dir element to the command structure to facilitate this. Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 0639eb6b31..69de6a53d5 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -169,6 +169,7 @@ static ulong scsi_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
block_dev->devnum, start, blks, (unsigned long)buffer);
do {
pccb->pdata = (unsigned char *)buf_addr;
+ pccb->dma_dir = DMA_FROM_DEVICE;
#ifdef CONFIG_SYS_64BIT_LBA
if (start > SCSI_LBA48_READ) {
unsigned long blocks;
@@ -237,6 +238,7 @@ static ulong scsi_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
__func__, block_dev->devnum, start, blks, (unsigned long)buffer);
do {
pccb->pdata = (unsigned char *)buf_addr;
+ pccb->dma_dir = DMA_TO_DEVICE;
if (blks > max_blks) {
pccb->datalen = block_dev->blksz * max_blks;
smallblks = max_blks;
@@ -385,6 +387,7 @@ static int scsi_read_capacity(struct udevice *dev, struct scsi_cmd *pccb,
pccb->msgout[0] = SCSI_IDENTIFY; /* NOT USED */
pccb->datalen = 16;
+ pccb->dma_dir = DMA_FROM_DEVICE;
if (scsi_exec(dev, pccb))
return 1;
@@ -487,6 +490,7 @@ static int scsi_detect_dev(struct udevice *dev, int target, int lun,
pccb->lun = lun;
pccb->pdata = (unsigned char *)&tempbuff;
pccb->datalen = 512;
+ pccb->dma_dir = DMA_FROM_DEVICE;
scsi_setup_inquiry(pccb);
if (scsi_exec(dev, pccb)) {
if (pccb->contr_stat == SCSI_SEL_TIME_OUT) {