mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 14:41:31 +00:00
scsi: ceva: Convert driver to use UCLASS_AHCI instead of SCSI
In v2018 the patch
"dm: ahci: Correct uclass private data"
(sha1: bfc1c6b483
)
was causing an issue for ceva_sata.
But this issue is not in v2018.05-rc1 but still converting to
UCLASS_AHCI would make more sense.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
0b4b82ad14
commit
c3898a8891
1 changed files with 20 additions and 16 deletions
|
@ -72,6 +72,10 @@
|
||||||
#define DRV_NAME "ahci-ceva"
|
#define DRV_NAME "ahci-ceva"
|
||||||
#define CEVA_FLAG_BROKEN_GEN2 1
|
#define CEVA_FLAG_BROKEN_GEN2 1
|
||||||
|
|
||||||
|
struct ceva_sata_priv {
|
||||||
|
ulong base;
|
||||||
|
};
|
||||||
|
|
||||||
static int ceva_init_sata(ulong mmio)
|
static int ceva_init_sata(ulong mmio)
|
||||||
{
|
{
|
||||||
ulong tmp;
|
ulong tmp;
|
||||||
|
@ -110,18 +114,20 @@ static int ceva_init_sata(ulong mmio)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int sata_ceva_bind(struct udevice *dev)
|
||||||
|
{
|
||||||
|
struct udevice *scsi_dev;
|
||||||
|
|
||||||
|
return ahci_bind_scsi(dev, &scsi_dev);
|
||||||
|
}
|
||||||
|
|
||||||
static int sata_ceva_probe(struct udevice *dev)
|
static int sata_ceva_probe(struct udevice *dev)
|
||||||
{
|
{
|
||||||
int ret;
|
struct ceva_sata_priv *priv = dev_get_priv(dev);
|
||||||
struct scsi_platdata *plat = dev_get_uclass_platdata(dev);
|
|
||||||
|
|
||||||
ceva_init_sata(plat->base);
|
ceva_init_sata(priv->base);
|
||||||
|
|
||||||
ret = ahci_init_one_dm(dev);
|
return ahci_probe_scsi(dev, priv->base);
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return ahci_start_ports_dm(dev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct udevice_id sata_ceva_ids[] = {
|
static const struct udevice_id sata_ceva_ids[] = {
|
||||||
|
@ -131,24 +137,22 @@ static const struct udevice_id sata_ceva_ids[] = {
|
||||||
|
|
||||||
static int sata_ceva_ofdata_to_platdata(struct udevice *dev)
|
static int sata_ceva_ofdata_to_platdata(struct udevice *dev)
|
||||||
{
|
{
|
||||||
struct scsi_platdata *plat = dev_get_uclass_platdata(dev);
|
struct ceva_sata_priv *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
plat->base = devfdt_get_addr(dev);
|
priv->base = devfdt_get_addr(dev);
|
||||||
if (plat->base == FDT_ADDR_T_NONE)
|
if (priv->base == FDT_ADDR_T_NONE)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* Hardcode number for ceva sata controller */
|
|
||||||
plat->max_lun = 1; /* Actually two but untested */
|
|
||||||
plat->max_id = 2;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
U_BOOT_DRIVER(ceva_host_blk) = {
|
U_BOOT_DRIVER(ceva_host_blk) = {
|
||||||
.name = "ceva_sata",
|
.name = "ceva_sata",
|
||||||
.id = UCLASS_SCSI,
|
.id = UCLASS_AHCI,
|
||||||
.of_match = sata_ceva_ids,
|
.of_match = sata_ceva_ids,
|
||||||
|
.bind = sata_ceva_bind,
|
||||||
.ops = &scsi_ops,
|
.ops = &scsi_ops,
|
||||||
|
.priv_auto_alloc_size = sizeof(struct ceva_sata_priv),
|
||||||
.probe = sata_ceva_probe,
|
.probe = sata_ceva_probe,
|
||||||
.ofdata_to_platdata = sata_ceva_ofdata_to_platdata,
|
.ofdata_to_platdata = sata_ceva_ofdata_to_platdata,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue