summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@mailbox.org>2023-08-07 02:26:12 +0200
committerTom Rini <trini@konsulko.com>2023-08-17 16:39:20 -0400
commit02660defdc8a5c6de9dd203c6f8082861475d5d4 (patch)
tree1aef86b4c3afb38aa9c628f2d8ee02c4400e698d /drivers
parent4b316f1e67d8cb8320649f83fe322412b4eed739 (diff)
downloadu-boot-02660defdc8a5c6de9dd203c6f8082861475d5d4.tar.gz
u-boot-02660defdc8a5c6de9dd203c6f8082861475d5d4.tar.bz2
u-boot-02660defdc8a5c6de9dd203c6f8082861475d5d4.zip
scsi: Cache align temporary buffer
The temporary buffer may be passed to DMA capable device, make sure it is cache aligned. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/scsi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 6caeb3fcdd..77c75240d5 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -14,6 +14,7 @@
#include <env.h>
#include <libata.h>
#include <log.h>
+#include <memalign.h>
#include <part.h>
#include <pci.h>
#include <scsi.h>
@@ -42,7 +43,7 @@ const struct pci_device_id scsi_device_list[] = { SCSI_DEV_LIST };
#endif
static struct scsi_cmd tempccb; /* temporary scsi command buffer */
-static unsigned char tempbuff[512]; /* temporary data buffer */
+DEFINE_CACHE_ALIGN_BUFFER(u8, tempbuff, 512); /* temporary data buffer */
#if !defined(CONFIG_DM_SCSI)
static int scsi_max_devs; /* number of highest available scsi device */
@@ -490,7 +491,7 @@ static int scsi_detect_dev(struct udevice *dev, int target, int lun,
pccb->target = target;
pccb->lun = lun;
- pccb->pdata = (unsigned char *)&tempbuff;
+ pccb->pdata = tempbuff;
pccb->datalen = 512;
pccb->dma_dir = DMA_FROM_DEVICE;
scsi_setup_inquiry(pccb);