2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2016-09-08 13:06:45 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Google, Inc
|
|
|
|
* Written by Simon Glass <sjg@chromium.org>
|
|
|
|
* Copyright (c) 2016 Xilinx, Inc
|
|
|
|
* Written by Michal Simek
|
|
|
|
*
|
|
|
|
* Based on ahci-uclass.c
|
|
|
|
*/
|
|
|
|
|
2021-04-27 09:02:19 +00:00
|
|
|
#define LOG_CATEGORY UCLASS_SCSI
|
|
|
|
|
2016-09-08 13:06:45 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <dm.h>
|
|
|
|
#include <scsi.h>
|
|
|
|
|
2017-06-15 03:28:43 +00:00
|
|
|
int scsi_exec(struct udevice *dev, struct scsi_cmd *pccb)
|
|
|
|
{
|
|
|
|
struct scsi_ops *ops = scsi_get_ops(dev);
|
|
|
|
|
|
|
|
if (!ops->exec)
|
|
|
|
return -ENOSYS;
|
|
|
|
|
|
|
|
return ops->exec(dev, pccb);
|
|
|
|
}
|
|
|
|
|
|
|
|
int scsi_bus_reset(struct udevice *dev)
|
|
|
|
{
|
|
|
|
struct scsi_ops *ops = scsi_get_ops(dev);
|
|
|
|
|
|
|
|
if (!ops->bus_reset)
|
|
|
|
return -ENOSYS;
|
|
|
|
|
|
|
|
return ops->bus_reset(dev);
|
|
|
|
}
|
|
|
|
|
2016-09-08 13:06:45 +00:00
|
|
|
UCLASS_DRIVER(scsi) = {
|
|
|
|
.id = UCLASS_SCSI,
|
|
|
|
.name = "scsi",
|
2020-12-03 23:55:23 +00:00
|
|
|
.per_device_plat_auto = sizeof(struct scsi_plat),
|
2016-09-08 13:06:45 +00:00
|
|
|
};
|