Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com> |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 6 | #include <ahci.h> |
Masami Hiramatsu | 700ef60 | 2021-06-04 18:43:23 +0900 | [diff] [blame] | 7 | #include <scsi.h> |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 8 | #include <dm.h> |
| 9 | #include <pci.h> |
| 10 | |
| 11 | static int ahci_pci_bind(struct udevice *dev) |
| 12 | { |
| 13 | struct udevice *scsi_dev; |
| 14 | |
| 15 | return ahci_bind_scsi(dev, &scsi_dev); |
| 16 | } |
| 17 | |
| 18 | static int ahci_pci_probe(struct udevice *dev) |
| 19 | { |
Bin Meng | 485e83d | 2017-08-02 19:07:17 -0700 | [diff] [blame] | 20 | return ahci_probe_scsi_pci(dev); |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | static const struct udevice_id ahci_pci_ids[] = { |
| 24 | { .compatible = "ahci-pci" }, |
| 25 | { } |
| 26 | }; |
| 27 | |
| 28 | U_BOOT_DRIVER(ahci_pci) = { |
| 29 | .name = "ahci_pci", |
| 30 | .id = UCLASS_AHCI, |
Masami Hiramatsu | 700ef60 | 2021-06-04 18:43:23 +0900 | [diff] [blame] | 31 | .ops = &scsi_ops, |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 32 | .of_match = ahci_pci_ids, |
| 33 | .bind = ahci_pci_bind, |
| 34 | .probe = ahci_pci_probe, |
| 35 | }; |
| 36 | |
| 37 | static struct pci_device_id ahci_pci_supported[] = { |
| 38 | { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, ~0) }, |
Pali Rohár | d8ea987 | 2022-12-04 13:31:08 +0100 | [diff] [blame] | 39 | { PCI_DEVICE(PCI_VENDOR_ID_ASMEDIA, 0x0611) }, |
Hajo Noerenberg | 4f9fa4e | 2022-03-28 15:49:08 +0200 | [diff] [blame] | 40 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6121) }, |
| 41 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x6145) }, |
Bin Meng | 239a09b | 2017-07-30 19:23:59 -0700 | [diff] [blame] | 42 | {}, |
| 43 | }; |
| 44 | |
| 45 | U_BOOT_PCI_DEVICE(ahci_pci, ahci_pci_supported); |