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/internal.c b/internal.c
index 8af2690..e383809 100644
--- a/internal.c
+++ b/internal.c
@@ -190,6 +190,7 @@
 		ret = 1;
 		goto internal_init_exit;
 	}
+	internal->rom_base = 0; /* Default to top aligned flash at 4 GB. */
 	internal->max_rom_decode = 0;
 	prog->data = internal;
 
@@ -213,7 +214,7 @@
 		goto internal_init_exit;
 	}
 
-	if (processor_flash_enable()) {
+	if (processor_flash_enable(prog)) {
 		msg_perr("Processor detection/init failed.\n"
 			 "Aborting.\n");
 		ret = 1;
@@ -292,7 +293,7 @@
 
 	if (internal_buses_supported & BUS_NONSPI) {
 		register_par_master(&par_master_internal, internal_buses_supported,
-				    internal->max_rom_decode, NULL);
+				    internal->rom_base, internal->max_rom_decode, NULL);
 	}
 
 	/* Report if a non-whitelisted laptop is detected that likely uses a legacy bus. */