blob: ab76166451c77c34a0553d272c66f263fa13e28e [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Simon Glass4e037812015-03-05 12:25:31 -07002/*
3 * Copyright (c) 2015 Google, Inc
Simon Glass4e037812015-03-05 12:25:31 -07004 */
5
Simon Glass4e037812015-03-05 12:25:31 -07006#include <dm.h>
7#include <pci.h>
Simon Glassa1548b82015-07-03 18:28:25 -06008#include <asm/pci.h>
Simon Glass4e037812015-03-05 12:25:31 -07009
Simon Glass2a311e82020-01-27 08:49:37 -070010static 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 Glassa5464582019-08-31 21:23:18 -060013{
14 return pci_x86_read_config(bdf, offset, valuep, size);
15}
16
17static 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 Glassa1548b82015-07-03 18:28:25 -060023static const struct dm_pci_ops pci_x86_ops = {
Simon Glassa5464582019-08-31 21:23:18 -060024 .read_config = _pci_x86_read_config,
25 .write_config = _pci_x86_write_config,
Simon Glass4e037812015-03-05 12:25:31 -070026};
27
Simon Glassa1548b82015-07-03 18:28:25 -060028static const struct udevice_id pci_x86_ids[] = {
29 { .compatible = "pci-x86" },
Simon Glass4e037812015-03-05 12:25:31 -070030 { }
31};
32
33U_BOOT_DRIVER(pci_x86) = {
34 .name = "pci_x86",
35 .id = UCLASS_PCI,
Simon Glassa1548b82015-07-03 18:28:25 -060036 .of_match = pci_x86_ids,
37 .ops = &pci_x86_ops,
Simon Glass4e037812015-03-05 12:25:31 -070038};