ichspi: Split ICH7 init out
The original, ICH7 init only shared about three lines with the newer,
ever growing ICH9+ init. That's not worth an indentation level in an
endlessly long function, so split it out.
We introduce a kind of "breakpoint" into the `ich_chipset' enum:
SPI_ENGINE_ICH9
This marks all chipset entries below it as supporting this code path
and should help to avoid long `case' lists.
Tested read/erase/write on ThinkPad T60 (ICH7).
Change-Id: I41e46d12e02c1343e636b47b2378db86e76af95e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/173
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
diff --git a/include/programmer.h b/include/programmer.h
index 2633450..f3e32c6 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -334,7 +334,10 @@
CHIPSET_TUNNEL_CREEK, /* Atom E6xx */
CHIPSET_CENTERTON, /* Atom S1220 S1240 S1260 */
CHIPSET_ICH7,
- CHIPSET_ICH8,
+
+ SPI_ENGINE_ICH9, /******** ICH9 compatible from here on ********/
+
+ CHIPSET_ICH8 = SPI_ENGINE_ICH9,
CHIPSET_ICH9,
CHIPSET_ICH10,
CHIPSET_5_SERIES_IBEX_PEAK,
@@ -357,7 +360,8 @@
/* ichspi.c */
#if CONFIG_INTERNAL == 1
-int ich_init_spi(void *spibar, enum ich_chipset ich_generation);
+int ich7_init_spi(void *spibar, enum ich_chipset);
+int ich9_init_spi(void *spibar, enum ich_chipset);
int via_init_spi(uint32_t mmio_base);
/* amd_imc.c */