Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015 Google, Inc |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 4 | */ |
| 5 | |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 6 | #include <dm.h> |
| 7 | #include <pci.h> |
Simon Glass | a1548b8 | 2015-07-03 18:28:25 -0600 | [diff] [blame] | 8 | #include <asm/pci.h> |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 9 | |
Simon Glass | 2a311e8 | 2020-01-27 08:49:37 -0700 | [diff] [blame] | 10 | static int _pci_x86_read_config(const struct udevice *bus, pci_dev_t bdf, |
| 11 | uint offset, ulong *valuep, |
| 12 | enum pci_size_t size) |
Simon Glass | a546458 | 2019-08-31 21:23:18 -0600 | [diff] [blame] | 13 | { |
| 14 | return pci_x86_read_config(bdf, offset, valuep, size); |
| 15 | } |
| 16 | |
| 17 | static int _pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, |
| 18 | uint offset, ulong value, enum pci_size_t size) |
| 19 | { |
| 20 | return pci_x86_write_config(bdf, offset, value, size); |
| 21 | } |
| 22 | |
Simon Glass | a1548b8 | 2015-07-03 18:28:25 -0600 | [diff] [blame] | 23 | static const struct dm_pci_ops pci_x86_ops = { |
Simon Glass | a546458 | 2019-08-31 21:23:18 -0600 | [diff] [blame] | 24 | .read_config = _pci_x86_read_config, |
| 25 | .write_config = _pci_x86_write_config, |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 26 | }; |
| 27 | |
Simon Glass | a1548b8 | 2015-07-03 18:28:25 -0600 | [diff] [blame] | 28 | static const struct udevice_id pci_x86_ids[] = { |
| 29 | { .compatible = "pci-x86" }, |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 30 | { } |
| 31 | }; |
| 32 | |
| 33 | U_BOOT_DRIVER(pci_x86) = { |
| 34 | .name = "pci_x86", |
| 35 | .id = UCLASS_PCI, |
Simon Glass | a1548b8 | 2015-07-03 18:28:25 -0600 | [diff] [blame] | 36 | .of_match = pci_x86_ids, |
| 37 | .ops = &pci_x86_ops, |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 38 | }; |