blob: b1d231e0f9e17745bb55b2dfe92c969259cfca93 [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
6#include <common.h>
7#include <ahci.h>
Masami Hiramatsu700ef602021-06-04 18:43:23 +09008#include <scsi.h>
Bin Meng239a09b2017-07-30 19:23:59 -07009#include <dm.h>
10#include <pci.h>
11
12static int ahci_pci_bind(struct udevice *dev)
13{
14 struct udevice *scsi_dev;
15
16 return ahci_bind_scsi(dev, &scsi_dev);
17}
18
19static int ahci_pci_probe(struct udevice *dev)
20{
Bin Meng485e83d2017-08-02 19:07:17 -070021 return ahci_probe_scsi_pci(dev);
Bin Meng239a09b2017-07-30 19:23:59 -070022}
23
24static const struct udevice_id ahci_pci_ids[] = {
25 { .compatible = "ahci-pci" },
26 { }
27};
28
29U_BOOT_DRIVER(ahci_pci) = {
30 .name = "ahci_pci",
31 .id = UCLASS_AHCI,
Masami Hiramatsu700ef602021-06-04 18:43:23 +090032 .ops = &scsi_ops,
Bin Meng239a09b2017-07-30 19:23:59 -070033 .of_match = ahci_pci_ids,
34 .bind = ahci_pci_bind,
35 .probe = ahci_pci_probe,
36};
37
38static struct pci_device_id ahci_pci_supported[] = {
39 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, ~0) },
Oleksandr Rybalkoe664e8d2019-08-22 12:26:55 +020040 { PCI_DEVICE(0x1b21, 0x0611) },
Bin Meng239a09b2017-07-30 19:23:59 -070041 {},
42};
43
44U_BOOT_PCI_DEVICE(ahci_pci, ahci_pci_supported);