blob: f2102aaa6353da03719bc8c4fb7c9d921d2095d1 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Bin Meng239a09b2017-07-30 19:23:59 -07002/*
3 * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
Bin Meng239a09b2017-07-30 19:23:59 -07004 */
5
Bin Meng239a09b2017-07-30 19:23:59 -07006#include <ahci.h>
Masami Hiramatsu700ef602021-06-04 18:43:23 +09007#include <scsi.h>
Bin Meng239a09b2017-07-30 19:23:59 -07008#include <dm.h>
9#include <pci.h>
10
11static int ahci_pci_bind(struct udevice *dev)
12{
13 struct udevice *scsi_dev;
14
15 return ahci_bind_scsi(dev, &scsi_dev);
16}
17
18static int ahci_pci_probe(struct udevice *dev)
19{
Bin Meng485e83d2017-08-02 19:07:17 -070020 return ahci_probe_scsi_pci(dev);
Bin Meng239a09b2017-07-30 19:23:59 -070021}
22
23static const struct udevice_id ahci_pci_ids[] = {
24 { .compatible = "ahci-pci" },
25 { }
26};
27
28U_BOOT_DRIVER(ahci_pci) = {
29 .name = "ahci_pci",
30 .id = UCLASS_AHCI,
Masami Hiramatsu700ef602021-06-04 18:43:23 +090031 .ops = &scsi_ops,
Bin Meng239a09b2017-07-30 19:23:59 -070032 .of_match = ahci_pci_ids,
33 .bind = ahci_pci_bind,
34 .probe = ahci_pci_probe,
35};
36
37static struct pci_device_id ahci_pci_supported[] = {
38 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, ~0) },
Pali Rohárd8ea9872022-12-04 13:31:08 +010039 { PCI_DEVICE(PCI_VENDOR_ID_ASMEDIA, 0x0611) },
Hajo Noerenberg4f9fa4e2022-03-28 15:49:08 +020040 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6121) },
41 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6145) },
Bin Meng239a09b2017-07-30 19:23:59 -070042 {},
43};
44
45U_BOOT_PCI_DEVICE(ahci_pci, ahci_pci_supported);