53 lines
926 B
C
53 lines
926 B
C
#include <common.h>
|
|
#include <ahci.h>
|
|
#include <dm.h>
|
|
|
|
/*
|
|
* Dummy implementation that can be overwritten by a board
|
|
* specific function
|
|
*/
|
|
__weak int board_ahci_enable(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static int nvt_ahci_bind(struct udevice *dev)
|
|
{
|
|
struct udevice *scsi_dev;
|
|
int ret;
|
|
|
|
ret = ahci_bind_scsi(dev, &scsi_dev);
|
|
if (ret) {
|
|
printf("%s: Failed to bind (err=%d\n)", __func__, ret);
|
|
return ret;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static int nvt_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)devfdt_get_addr_ptr(dev));
|
|
|
|
return 0;
|
|
}
|
|
|
|
static const struct udevice_id nvt_ahci_ids[] = {
|
|
{ .compatible = "novatech,nvt_sata100" },
|
|
{ }
|
|
};
|
|
|
|
U_BOOT_DRIVER(ahci_mvebu_drv) = {
|
|
.name = "ahci_nvt",
|
|
.id = UCLASS_AHCI,
|
|
.of_match = nvt_ahci_ids,
|
|
.bind = nvt_ahci_bind,
|
|
.probe = nvt_ahci_probe,
|
|
};
|