blob: 8d036930e73b9e936285cf265f0ab834eb27e705 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Simon Glassa219dae2015-03-05 12:25:31 -07002/*
3 * Copyright (c) 2015 Google, Inc
Simon Glassa219dae2015-03-05 12:25:31 -07004 */
5
6#include <common.h>
7#include <dm.h>
8#include <pci.h>
Simon Glass945cae72015-07-03 18:28:25 -06009#include <asm/pci.h>
Simon Glassa219dae2015-03-05 12:25:31 -070010
Simon Glassc4e72c42020-01-27 08:49:37 -070011static int _pci_x86_read_config(const struct udevice *bus, pci_dev_t bdf,
12 uint offset, ulong *valuep,
13 enum pci_size_t size)
Simon Glassa827ba92019-08-31 21:23:18 -060014{
15 return pci_x86_read_config(bdf, offset, valuep, size);
16}
17
18static 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
Simon Glass945cae72015-07-03 18:28:25 -060024static const struct dm_pci_ops pci_x86_ops = {
Simon Glassa827ba92019-08-31 21:23:18 -060025 .read_config = _pci_x86_read_config,
26 .write_config = _pci_x86_write_config,
Simon Glassa219dae2015-03-05 12:25:31 -070027};
28
Simon Glass945cae72015-07-03 18:28:25 -060029static const struct udevice_id pci_x86_ids[] = {
30 { .compatible = "pci-x86" },
Simon Glassa219dae2015-03-05 12:25:31 -070031 { }
32};
33
34U_BOOT_DRIVER(pci_x86) = {
35 .name = "pci_x86",
36 .id = UCLASS_PCI,
Simon Glass945cae72015-07-03 18:28:25 -060037 .of_match = pci_x86_ids,
38 .ops = &pci_x86_ops,
Simon Glassa219dae2015-03-05 12:25:31 -070039};