1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 07:02:34 +02:00

pci.h: move include into own wrapper

Split the include of hwaccess and libpci. There is no need to have pci.h
included in hwaccess.

Change-Id: Ibf00356f0ef5cc92e0ec99f8fe5cdda56f47b166
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/58883
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Thomas Heijligen 2021-11-02 21:03:00 +01:00 committed by Nico Huber
parent 9469f81d8f
commit 88c871e74c
24 changed files with 47 additions and 18 deletions

View File

@ -19,6 +19,7 @@
#include "programmer.h"
#include "hwaccess.h"
#include "spi.h"
#include "platform/pci.h"
/* same as serverengines */
static void enter_conf_mode_ec(uint16_t port)

View File

@ -19,6 +19,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define BIOS_ROM_ADDR 0x90
#define BIOS_ROM_DATA 0x94

View File

@ -19,6 +19,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define MAX_ROM_DECODE (32 * 1024)
#define ADDR_MASK (MAX_ROM_DECODE - 1)

View File

@ -21,6 +21,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_VIA 0x1106

View File

@ -26,6 +26,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#if defined(__i386__) || defined(__x86_64__)
/*

View File

@ -34,6 +34,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define NOT_DONE_YET 1

View File

@ -18,6 +18,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_DRKAISER 0x1803

View File

@ -19,6 +19,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_NVIDIA 0x10de

View File

@ -20,23 +20,6 @@
#ifndef __HWACCESS_H__
#define __HWACCESS_H__ 1
#if NEED_PCI == 1
/*
* libpci headers use the variable name "index" which triggers shadowing
* warnings on systems which have the index() function in a default #include
* or as builtin.
*/
#define index shadow_workaround_index
#if !defined (__NetBSD__)
#include <pci/pci.h>
#else
#include <pciutils/pci.h>
#endif
#undef index
#endif /* NEED_PCI == 1 */
void mmio_writeb(uint8_t val, void *addr);
void mmio_writew(uint16_t val, void *addr);
void mmio_writel(uint32_t val, void *addr);

View File

@ -20,6 +20,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
int is_laptop = 0;
int laptop_ok = 0;

View File

@ -18,6 +18,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
static uint8_t *it8212_bar = NULL;

View File

@ -24,6 +24,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
/* Bit positions for each pin. */

View File

@ -18,6 +18,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define BIOS_ROM_ADDR 0x04
#define BIOS_ROM_DATA 0x08

View File

@ -19,6 +19,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
static uint8_t *nicintel_bar;
static uint8_t *nicintel_control_bar;

View File

@ -35,6 +35,7 @@
#include "spi.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_INTEL 0x8086
#define MEMMAP_SIZE 0x1c /* Only EEC, EERD and EEWR are needed. */

View File

@ -35,6 +35,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_INTEL 0x8086
#define MEMMAP_SIZE getpagesize()

View File

@ -18,6 +18,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_NATSEMI 0x100b

View File

@ -18,6 +18,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_REALTEK 0x10ec
#define PCI_VENDOR_ID_SMC1211 0x1113

View File

@ -19,6 +19,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_OGP 0x1227

View File

@ -19,7 +19,7 @@
#include <string.h>
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
struct pci_access *pacc;

25
platform/pci.h Normal file
View File

@ -0,0 +1,25 @@
/*
* This is a wrapper for libpci.
* ...
*/
#ifndef __PLATFORM_PCI_H__
#define __PLATFORM_PCI_H__
/*
* An old libpci version seems to use the variable name "index" which triggers
* shadowing warnings on systems which have the index() function in a default
* #include or as builtin.
*/
#define index shadow_workaround_index
#if defined (__NetBSD__)
#include <pciutils/pci.h>
#else
#include <pci/pci.h>
#endif
#undef index
#endif /* __PLATFORM_PCI_H__ */

View File

@ -20,6 +20,7 @@
#include "flash.h"
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
static uint8_t *mv_bar;
static uint16_t mv_iobar;

View File

@ -18,6 +18,7 @@
#include "programmer.h"
#include "hwaccess.h"
#include "platform/pci.h"
#define PCI_VENDOR_ID_SII 0x1095

View File

@ -24,6 +24,7 @@
#include "programmer.h"
#include "hwaccess.h"
#include "spi.h"
#include "platform/pci.h"
/* This struct is unused, but helps visualize the SB600 SPI BAR layout.
*struct sb600_spi_controller {