blob: 5a45edc4e41f6b5a5fb597437b4d39a51ea60e63 [file] [log] [blame]
Bin Menga5c680f2017-07-30 19:23:59 -07001/*
2 * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <ahci.h>
9#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 Meng7b9c88b2017-08-02 19:07:17 -070021 return ahci_probe_scsi_pci(dev);
Bin Menga5c680f2017-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,
32 .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) },
39 {},
40};
41
42U_BOOT_PCI_DEVICE(ahci_pci, ahci_pci_supported);