summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--flash.h2
-rw-r--r--flashrom.c8
-rw-r--r--internal.c11
-rw-r--r--nic3com.c9
-rw-r--r--satasii.c9
5 files changed, 17 insertions, 22 deletions
diff --git a/flash.h b/flash.h
index 44569fcbd..42cda8d0b 100644
--- a/flash.h
+++ b/flash.h
@@ -629,6 +629,8 @@ void mmio_writel(uint32_t val, void *addr);
uint8_t mmio_readb(void *addr);
uint16_t mmio_readw(void *addr);
uint32_t mmio_readl(void *addr);
+void *fallback_map(const char *descr, unsigned long phys_addr, size_t len);
+void fallback_unmap(void *virt_addr, size_t len);
void fallback_chip_writew(uint16_t val, chipaddr addr);
void fallback_chip_writel(uint32_t val, chipaddr addr);
uint16_t fallback_chip_readw(const chipaddr addr);
diff --git a/flashrom.c b/flashrom.c
index 5b4cf8e1f..673c2880d 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -64,8 +64,8 @@ const struct programmer_entry programmer_table[] = {
{
.init = nic3com_init,
.shutdown = nic3com_shutdown,
- .map_flash_region = nic3com_map,
- .unmap_flash_region = nic3com_unmap,
+ .map_flash_region = fallback_map,
+ .unmap_flash_region = fallback_unmap,
.chip_readb = nic3com_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
@@ -77,8 +77,8 @@ const struct programmer_entry programmer_table[] = {
{
.init = satasii_init,
.shutdown = satasii_shutdown,
- .map_flash_region = satasii_map,
- .unmap_flash_region = satasii_unmap,
+ .map_flash_region = fallback_map,
+ .unmap_flash_region = fallback_unmap,
.chip_readb = satasii_chip_readb,
.chip_readw = fallback_chip_readw,
.chip_readl = fallback_chip_readl,
diff --git a/internal.c b/internal.c
index d2a9ae21b..c2d8f6bad 100644
--- a/internal.c
+++ b/internal.c
@@ -195,6 +195,17 @@ uint32_t mmio_readl(void *addr)
return *(volatile uint32_t *) addr;
}
+/* Fallback map() for programmers which don't need special handling */
+void *fallback_map(const char *descr, unsigned long phys_addr, size_t len)
+{
+ return 0;
+}
+
+/* Fallback unmap() for programmers which don't need special handling */
+void fallback_unmap(void *virt_addr, size_t len)
+{
+}
+
/* Little-endian fallback for drivers not supporting 16 bit accesses */
void fallback_chip_writew(uint16_t val, chipaddr addr)
{
diff --git a/nic3com.c b/nic3com.c
index 4e3e475c9..023ec350d 100644
--- a/nic3com.c
+++ b/nic3com.c
@@ -102,15 +102,6 @@ int nic3com_shutdown(void)
return 0;
}
-void *nic3com_map(const char *descr, unsigned long phys_addr, size_t len)
-{
- return 0;
-}
-
-void nic3com_unmap(void *virt_addr, size_t len)
-{
-}
-
void nic3com_chip_writeb(uint8_t val, chipaddr addr)
{
OUTL((uint32_t)addr, io_base_addr + BIOS_ROM_ADDR);
diff --git a/satasii.c b/satasii.c
index 78b90e33b..a137c7fca 100644
--- a/satasii.c
+++ b/satasii.c
@@ -80,15 +80,6 @@ int satasii_shutdown(void)
return 0;
}
-void *satasii_map(const char *descr, unsigned long phys_addr, size_t len)
-{
- return 0;
-}
-
-void satasii_unmap(void *virt_addr, size_t len)
-{
-}
-
void satasii_chip_writeb(uint8_t val, chipaddr addr)
{
uint32_t ctrl_reg, data_reg;