memory_bus: Move (un)map_flash_region into par master
Now that the map/unmap_flash functions are only called from memory-
mapped chip drivers, we can safely move the hooks into the parallel
masters.
This also allows us to move the code away from the globals in
`flashprog.c` into a new `memory_bus.c`.
Change-Id: Ic476cf4d96200232900537b997e1d07bb4e8b809
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72522
Reviewed-by: Riku Viitanen <riku.viitanen@protonmail.com>
diff --git a/internal.c b/internal.c
index f8de4a7..5d85758 100644
--- a/internal.c
+++ b/internal.c
@@ -84,6 +84,8 @@
.chip_writew = internal_chip_writew,
.chip_writel = internal_chip_writel,
.chip_writen = fallback_chip_writen,
+ .map_flash = physmap,
+ .unmap_flash = physunmap,
};
enum chipbustype internal_buses_supported = BUS_NONE;
@@ -362,6 +364,4 @@
.type = OTHER,
.devs.note = NULL,
.init = internal_init,
- .map_flash_region = physmap,
- .unmap_flash_region = physunmap,
};