Author: uwe Date: 2009-05-18 01:12:17 +0200 (Mon, 18 May 2009) New Revision: 531
Modified: trunk/flash.h trunk/flashrom.c trunk/internal.c trunk/nic3com.c trunk/satasii.c Log: Factor out fallback_map/unmap, most external programmers don't need and special handling here (trivial).
Signed-off-by: Uwe Hermann uwe@hermann-uwe.de Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: trunk/flash.h =================================================================== --- trunk/flash.h 2009-05-17 22:58:41 UTC (rev 530) +++ trunk/flash.h 2009-05-17 23:12:17 UTC (rev 531) @@ -629,6 +629,8 @@ 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);
Modified: trunk/flashrom.c =================================================================== --- trunk/flashrom.c 2009-05-17 22:58:41 UTC (rev 530) +++ trunk/flashrom.c 2009-05-17 23:12:17 UTC (rev 531) @@ -64,8 +64,8 @@ { .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 @@ { .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,
Modified: trunk/internal.c =================================================================== --- trunk/internal.c 2009-05-17 22:58:41 UTC (rev 530) +++ trunk/internal.c 2009-05-17 23:12:17 UTC (rev 531) @@ -195,6 +195,17 @@ 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) {
Modified: trunk/nic3com.c =================================================================== --- trunk/nic3com.c 2009-05-17 22:58:41 UTC (rev 530) +++ trunk/nic3com.c 2009-05-17 23:12:17 UTC (rev 531) @@ -102,15 +102,6 @@ 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);
Modified: trunk/satasii.c =================================================================== --- trunk/satasii.c 2009-05-17 22:58:41 UTC (rev 530) +++ trunk/satasii.c 2009-05-17 23:12:17 UTC (rev 531) @@ -80,15 +80,6 @@ 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;