hwaccess.c: move function declarations from programmer.h to hwaccess.h
Move declarations for functions implemented in hwaccess.c from
programmer.h to hwaccess.h.
Change-Id: I075fd86211c766ae3d5f29c76adbd7c5b9bdbd80
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/58865
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71436
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/dmi.c b/dmi.c
index 561ccc7..9dc29e0 100644
--- a/dmi.c
+++ b/dmi.c
@@ -32,6 +32,7 @@
#include "platform.h"
#include "flash.h"
+#include "hwaccess.h"
#include "programmer.h"
/* Enable SMBIOS decoding. Currently legacy DMI decoding is enough. */
diff --git a/hwaccess.h b/hwaccess.h
index b968271..ac86dcf 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -39,6 +39,38 @@
#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);
+uint8_t mmio_readb(const void *addr);
+uint16_t mmio_readw(const void *addr);
+uint32_t mmio_readl(const void *addr);
+void mmio_readn(const void *addr, uint8_t *buf, size_t len);
+void mmio_le_writeb(uint8_t val, void *addr);
+void mmio_le_writew(uint16_t val, void *addr);
+void mmio_le_writel(uint32_t val, void *addr);
+uint8_t mmio_le_readb(const void *addr);
+uint16_t mmio_le_readw(const void *addr);
+uint32_t mmio_le_readl(const void *addr);
+#define pci_mmio_writeb mmio_le_writeb
+#define pci_mmio_writew mmio_le_writew
+#define pci_mmio_writel mmio_le_writel
+#define pci_mmio_readb mmio_le_readb
+#define pci_mmio_readw mmio_le_readw
+#define pci_mmio_readl mmio_le_readl
+void rmmio_writeb(uint8_t val, void *addr);
+void rmmio_writew(uint16_t val, void *addr);
+void rmmio_writel(uint32_t val, void *addr);
+void rmmio_le_writeb(uint8_t val, void *addr);
+void rmmio_le_writew(uint16_t val, void *addr);
+void rmmio_le_writel(uint32_t val, void *addr);
+#define pci_rmmio_writeb rmmio_le_writeb
+#define pci_rmmio_writew rmmio_le_writew
+#define pci_rmmio_writel rmmio_le_writel
+void rmmio_valb(void *addr);
+void rmmio_valw(void *addr);
+void rmmio_vall(void *addr);
+
#define ___constant_swab8(x) ((uint8_t) ( \
(((uint8_t)(x) & (uint8_t)0xffU))))
diff --git a/ich_descriptors.c b/ich_descriptors.c
index 1e975fa..63d4580 100644
--- a/ich_descriptors.c
+++ b/ich_descriptors.c
@@ -16,6 +16,7 @@
*/
#include "ich_descriptors.h"
+#include "hwaccess.h"
#ifdef ICH_DESCRIPTORS_FROM_DUMP_ONLY
#include <stdio.h>
diff --git a/programmer.h b/programmer.h
index f1161a4..8b21cfa 100644
--- a/programmer.h
+++ b/programmer.h
@@ -279,39 +279,6 @@
extern enum chipbustype internal_buses_supported;
#endif
-/* hwaccess.c */
-void mmio_writeb(uint8_t val, void *addr);
-void mmio_writew(uint16_t val, void *addr);
-void mmio_writel(uint32_t val, void *addr);
-uint8_t mmio_readb(const void *addr);
-uint16_t mmio_readw(const void *addr);
-uint32_t mmio_readl(const void *addr);
-void mmio_readn(const void *addr, uint8_t *buf, size_t len);
-void mmio_le_writeb(uint8_t val, void *addr);
-void mmio_le_writew(uint16_t val, void *addr);
-void mmio_le_writel(uint32_t val, void *addr);
-uint8_t mmio_le_readb(const void *addr);
-uint16_t mmio_le_readw(const void *addr);
-uint32_t mmio_le_readl(const void *addr);
-#define pci_mmio_writeb mmio_le_writeb
-#define pci_mmio_writew mmio_le_writew
-#define pci_mmio_writel mmio_le_writel
-#define pci_mmio_readb mmio_le_readb
-#define pci_mmio_readw mmio_le_readw
-#define pci_mmio_readl mmio_le_readl
-void rmmio_writeb(uint8_t val, void *addr);
-void rmmio_writew(uint16_t val, void *addr);
-void rmmio_writel(uint32_t val, void *addr);
-void rmmio_le_writeb(uint8_t val, void *addr);
-void rmmio_le_writew(uint16_t val, void *addr);
-void rmmio_le_writel(uint32_t val, void *addr);
-#define pci_rmmio_writeb rmmio_le_writeb
-#define pci_rmmio_writew rmmio_le_writew
-#define pci_rmmio_writel rmmio_le_writel
-void rmmio_valb(void *addr);
-void rmmio_valw(void *addr);
-void rmmio_vall(void *addr);
-
/* bitbang_spi.c */
int register_spi_bitbang_master(const struct bitbang_spi_master *master);