memory_mapped: Reduce `decode_sizes` to a single `max_rom_decode`

We used to store the maximum decode size, i.e. the maximum memory-mapped
range of the flash chip, per bus type (Parallel, LPC, FWH, SPI). There
was no programmer in the tree that really made use of it, though:
* The chipset drivers usually focus on a single bus type. And even if
  they advertise the whole default set (PAR, LPC, FWH), they only pro-
  vide a maximum decode size for one of them. The latter is probably
  wrong, should really more than one bus type be supported.
* PCI and external programmers all support only a single bus type, with
  the exception of `serprog` which doesn't set a maximum decode size.

What made the distinction even less useful is that for some chips that
support multiple bus types, i.e. LPC+FWH, we can't even detect which
type it is. The existing code around this also only tried to provide
the best possible warning message at the expense of breaking the pro-
grammer abstraction.

Hence, unify the set of sizes into a single `max_rom_decode` property.
We store it inside the `registered_master` struct right away, to avoid
any more use of globals.

Change-Id: I2aaea18d5b4255eb843a625b016ee74bb145ed85
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72531
diff --git a/spi.c b/spi.c
index ddf76f5..1c1586e 100644
--- a/spi.c
+++ b/spi.c
@@ -136,7 +136,7 @@
 	return true;
 }
 
-int register_spi_master(const struct spi_master *mst, void *data)
+int register_spi_master(const struct spi_master *mst, size_t max_rom_decode, void *data)
 {
 	struct registered_master rmst;
 
@@ -157,7 +157,10 @@
 		return ERROR_FLASHPROG_BUG;
 	}
 
-
+	if (max_rom_decode)
+		rmst.max_rom_decode = max_rom_decode;
+	else
+		rmst.max_rom_decode = MAX_ROM_DECODE_UNLIMITED;
 	rmst.buses_supported = BUS_SPI;
 	rmst.spi = *mst;
 	if (data)