pci_x86.c 864 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2015 Google, Inc
  4. */
  5. #include <common.h>
  6. #include <dm.h>
  7. #include <pci.h>
  8. #include <asm/pci.h>
  9. static int _pci_x86_read_config(const struct udevice *bus, pci_dev_t bdf,
  10. uint offset, ulong *valuep,
  11. enum pci_size_t size)
  12. {
  13. return pci_x86_read_config(bdf, offset, valuep, size);
  14. }
  15. static int _pci_x86_write_config(struct udevice *bus, pci_dev_t bdf,
  16. uint offset, ulong value, enum pci_size_t size)
  17. {
  18. return pci_x86_write_config(bdf, offset, value, size);
  19. }
  20. static const struct dm_pci_ops pci_x86_ops = {
  21. .read_config = _pci_x86_read_config,
  22. .write_config = _pci_x86_write_config,
  23. };
  24. static const struct udevice_id pci_x86_ids[] = {
  25. { .compatible = "pci-x86" },
  26. { }
  27. };
  28. U_BOOT_DRIVER(pci_x86) = {
  29. .name = "pci_x86",
  30. .id = UCLASS_PCI,
  31. .of_match = pci_x86_ids,
  32. .ops = &pci_x86_ops,
  33. };