blob: 174ff341dd0d134f2cdea5dd79f9ac0d7b7ed27f [file] [log] [blame]
Cornelia Huck951e6292021-06-09 16:37:08 +02001#ifndef _ASM_GENERIC_PCI_HOST_BRIDGE_H_
2#define _ASM_GENERIC_PCI_HOST_BRIDGE_H_
Alexander Gordeev33d78b02016-11-07 11:14:42 +01003/*
4 * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <agordeev@redhat.com>
5 *
6 * This work is licensed under the terms of the GNU LGPL, version 2.
7 */
8#include "libcflat.h"
9
10phys_addr_t pci_host_bridge_get_paddr(uint64_t addr);
11
12static inline
13phys_addr_t pci_translate_addr(pcidevaddr_t dev __unused, uint64_t addr)
14{
15 /*
16 * Assume we only have single PCI host bridge in a system.
17 */
18 return pci_host_bridge_get_paddr(addr);
19}
20
21uint8_t pci_config_readb(pcidevaddr_t dev, uint8_t reg);
22uint16_t pci_config_readw(pcidevaddr_t dev, uint8_t reg);
23uint32_t pci_config_readl(pcidevaddr_t dev, uint8_t reg);
24void pci_config_writeb(pcidevaddr_t dev, uint8_t reg, uint8_t val);
25void pci_config_writew(pcidevaddr_t dev, uint8_t reg, uint16_t val);
26void pci_config_writel(pcidevaddr_t dev, uint8_t reg, uint32_t val);
27
28#endif