ahci-pci.c 852 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2017, Bin Meng <bmeng.cn@gmail.com>
  4. */
  5. #include <common.h>
  6. #include <ahci.h>
  7. #include <scsi.h>
  8. #include <dm.h>
  9. #include <pci.h>
  10. static int ahci_pci_bind(struct udevice *dev)
  11. {
  12. struct udevice *scsi_dev;
  13. return ahci_bind_scsi(dev, &scsi_dev);
  14. }
  15. static int ahci_pci_probe(struct udevice *dev)
  16. {
  17. return ahci_probe_scsi_pci(dev);
  18. }
  19. static const struct udevice_id ahci_pci_ids[] = {
  20. { .compatible = "ahci-pci" },
  21. { }
  22. };
  23. U_BOOT_DRIVER(ahci_pci) = {
  24. .name = "ahci_pci",
  25. .id = UCLASS_AHCI,
  26. .ops = &scsi_ops,
  27. .of_match = ahci_pci_ids,
  28. .bind = ahci_pci_bind,
  29. .probe = ahci_pci_probe,
  30. };
  31. static struct pci_device_id ahci_pci_supported[] = {
  32. { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_SATA_AHCI, ~0) },
  33. { PCI_DEVICE(0x1b21, 0x0611) },
  34. {},
  35. };
  36. U_BOOT_PCI_DEVICE(ahci_pci, ahci_pci_supported);