memory_bus: Turn flashbase into a par_master member `rom_base`
Get rid of the global `flashbase`. Treat overrides for the `rom_base`
similar to `max_rom_decode`: Gather the information in `internal_data`
and then pass it to register_par_master().
Change-Id: Ib9ed7234a849fe3550200fd602226d0036da15f0
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/436
diff --git a/processor_enable.c b/processor_enable.c
index 7c27ccd..909a531 100644
--- a/processor_enable.c
+++ b/processor_enable.c
@@ -62,7 +62,7 @@
}
#endif
-int processor_flash_enable(void)
+int processor_flash_enable(struct flashprog_programmer *prog)
{
/* Default to 1 to catch not implemented architectures. */
int ret = 1;
@@ -70,7 +70,8 @@
/* FIXME: detect loongson on FreeBSD and OpenBSD as well. */
#if defined (__MIPSEL__) && defined (__linux)
if (is_loongson()) {
- flashbase = 0x1fc00000;
+ struct internal_data *const internal = prog->data;
+ internal->rom_base = 0x1fc00000;
ret = 0;
}
#elif defined(__i386__) || defined(__x86_64__)