diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2009-05-17 23:12:17 +0000 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2009-05-17 23:12:17 +0000 |
commit | c6915939d962b4414b1890f6049f7fa19e1602eb (patch) | |
tree | 046978a97e7de417a0abdc4286552a01ccb68760 | |
parent | 3def09d401e2282a6296639fdf935fb0a7790b7a (diff) | |
download | flashrom-c6915939d962b4414b1890f6049f7fa19e1602eb.tar.gz flashrom-c6915939d962b4414b1890f6049f7fa19e1602eb.tar.bz2 flashrom-c6915939d962b4414b1890f6049f7fa19e1602eb.zip |
Factor out fallback_map/unmap, most external programmers don't need and special handling here
Corresponding to flashrom svn r531.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
-rw-r--r-- | flash.h | 2 | ||||
-rw-r--r-- | flashrom.c | 8 | ||||
-rw-r--r-- | internal.c | 11 | ||||
-rw-r--r-- | nic3com.c | 9 | ||||
-rw-r--r-- | satasii.c | 9 |
5 files changed, 17 insertions, 22 deletions
@@ -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) { @@ -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); @@ -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; |