u-boot-brain/drivers/ata/ahci_mvebu.c
Stefan Roese 1eefd49cc1 sata: ahci_mvebu.c: Enable AHCI/SATA driver for MIPS Octeon
This patch enables the usage of the MVEBU AHCI/SATA driver. The only
changes necessary to support MIPS Octeon via DT based probing are, to
add the compatible DT property and the use of dev_remap_addr() so that
the correct mapped address is used in the Octeon case (phys != virt).

Please note that this driver supports the usage of the "scsi" command
and not the "sata" command, since it does not provide an own "scan"
function, which is needed for the "sata" cmd support.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
2021-04-23 21:22:55 +02:00

62 lines
1.2 KiB
C

// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2016 Stefan Roese <sr@denx.de>
*/
#include <common.h>
#include <ahci.h>
#include <dm.h>
#include <log.h>
/*
* Dummy implementation that can be overwritten by a board
* specific function
*/
__weak int board_ahci_enable(void)
{
return 0;
}
static int mvebu_ahci_bind(struct udevice *dev)
{
struct udevice *scsi_dev;
int ret;
ret = ahci_bind_scsi(dev, &scsi_dev);
if (ret) {
debug("%s: Failed to bind (err=%d\n)", __func__, ret);
return ret;
}
return 0;
}
static int mvebu_ahci_probe(struct udevice *dev)
{
/*
* Board specific SATA / AHCI enable code, e.g. enable the
* AHCI power or deassert reset
*/
board_ahci_enable();
ahci_probe_scsi(dev, (ulong)dev_remap_addr(dev));
return 0;
}
static const struct udevice_id mvebu_ahci_ids[] = {
{ .compatible = "marvell,armada-380-ahci" },
{ .compatible = "marvell,armada-3700-ahci" },
{ .compatible = "marvell,armada-8k-ahci" },
{ .compatible = "cavium,octeon-7130-ahci" },
{ }
};
U_BOOT_DRIVER(ahci_mvebu_drv) = {
.name = "ahci_mvebu",
.id = UCLASS_AHCI,
.of_match = mvebu_ahci_ids,
.bind = mvebu_ahci_bind,
.probe = mvebu_ahci_probe,
};