diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2018-05-09 12:08:18 +0200 |
---|---|---|
committer | Patrick Rudolph <siro@das-labor.org> | 2018-05-14 13:53:30 +0000 |
commit | f18c1b03fb30b348fc2897fb2745addea7daa748 (patch) | |
tree | fc4395b6f16e1545e14c001c566e5fa25346093b | |
parent | 4576600dd2a820ddddf539c40f147757d8644466 (diff) | |
download | coreboot-f18c1b03fb30b348fc2897fb2745addea7daa748.tar.xz |
pci: Fix compilation on non x86
* Introduce pci_devfn_t on all arch
* Add PCI function prototypes in arch/pci_ops.h
* Remove unused pci_config_default()
Change-Id: I71d6f82367e907732944ac5dfaabfa77181c5f20
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/25723
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/arch/arm/include/arch/pci_ops.h | 16 | ||||
-rw-r--r-- | src/arch/arm64/include/arch/pci_ops.h | 20 | ||||
-rw-r--r-- | src/arch/mips/include/arch/pci_ops.h | 19 |
3 files changed, 44 insertions, 11 deletions
diff --git a/src/arch/arm/include/arch/pci_ops.h b/src/arch/arm/include/arch/pci_ops.h index 99a47ce41a..2e2661b744 100644 --- a/src/arch/arm/include/arch/pci_ops.h +++ b/src/arch/arm/include/arch/pci_ops.h @@ -16,6 +16,20 @@ #ifndef ARCH_ARM_PCI_OPS_H #define ARCH_ARM_PCI_OPS_H -/* Empty stub until PCI includes are properly fixed. */ +#include <stdint.h> + +typedef u32 pci_devfn_t; + +#ifdef __SIMPLE_DEVICE__ +// FIXME: Use of device_t is deprecated +typedef pci_devfn_t device_t; + +u8 pci_read_config8(pci_devfn_t dev, unsigned int where); +u16 pci_read_config16(pci_devfn_t dev, unsigned int where); +u32 pci_read_config32(pci_devfn_t dev, unsigned int where); +void pci_write_config8(pci_devfn_t dev, unsigned int where, u8 val); +void pci_write_config16(pci_devfn_t dev, unsigned int where, u16 val); +void pci_write_config32(pci_devfn_t dev, unsigned int where, u32 val); +#endif #endif diff --git a/src/arch/arm64/include/arch/pci_ops.h b/src/arch/arm64/include/arch/pci_ops.h index 7c3d4cb105..e6d5206955 100644 --- a/src/arch/arm64/include/arch/pci_ops.h +++ b/src/arch/arm64/include/arch/pci_ops.h @@ -16,10 +16,20 @@ #ifndef ARCH_ARM64_PCI_OPS_H #define ARCH_ARM64_PCI_OPS_H -/* V8 has PCI in some form. We will need to fill this in. */ -static inline const struct pci_bus_operations *pci_config_default(void) -{ - return NULL; -} +#include <stdint.h> + +typedef u32 pci_devfn_t; + +#ifdef __SIMPLE_DEVICE__ +// FIXME: Use of device_t is deprecated +typedef pci_devfn_t device_t; + +u8 pci_read_config8(pci_devfn_t dev, unsigned int where); +u16 pci_read_config16(pci_devfn_t dev, unsigned int where); +u32 pci_read_config32(pci_devfn_t dev, unsigned int where); +void pci_write_config8(pci_devfn_t dev, unsigned int where, u8 val); +void pci_write_config16(pci_devfn_t dev, unsigned int where, u16 val); +void pci_write_config32(pci_devfn_t dev, unsigned int where, u32 val); +#endif #endif diff --git a/src/arch/mips/include/arch/pci_ops.h b/src/arch/mips/include/arch/pci_ops.h index a710ce2c7f..5fef126f2f 100644 --- a/src/arch/mips/include/arch/pci_ops.h +++ b/src/arch/mips/include/arch/pci_ops.h @@ -16,11 +16,20 @@ #ifndef ARCH_MIPS_PCI_OPS_H #define ARCH_MIPS_PCI_OPS_H -#include <stddef.h> +#include <stdint.h> -static inline const struct pci_bus_operations *pci_config_default(void) -{ - return NULL; -} +typedef u32 pci_devfn_t; + +#ifdef __SIMPLE_DEVICE__ +// FIXME: Use of device_t is deprecated +typedef pci_devfn_t device_t; + +u8 pci_read_config8(pci_devfn_t dev, unsigned int where); +u16 pci_read_config16(pci_devfn_t dev, unsigned int where); +u32 pci_read_config32(pci_devfn_t dev, unsigned int where); +void pci_write_config8(pci_devfn_t dev, unsigned int where, u8 val); +void pci_write_config16(pci_devfn_t dev, unsigned int where, u16 val); +void pci_write_config32(pci_devfn_t dev, unsigned int where, u32 val); +#endif #endif |