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