From 66ef4e5ff32b1d19281c9d6723b1acfe566f9763 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Sun, 13 Dec 2009 22:28:00 +0000 Subject: Internal (onboard) programming was the only feature which could not be disabled Make various pieces of code conditional on support for internal programming. Code shared between PCI device programmers and onboard programming is now conditional as well. It is now possible to build only with dummy support: make CONFIG_INTERNAL=no CONFIG_NIC3COM=no CONFIG_SATASII=no CONFIG_DRKAISER=no CONFIG_SERPROG=no CONFIG_FT2232SPI=no This allows building for a specific use case only, and it also facilitates porting to a new architecture because it is possible to focus on highlevel code only. Note: Either internal or dummy programmer needs to be compiled in due to the current behaviour of always picking a default programmer if -p is not specified. Picking an arbitrary external programmer as default wouldn't make sense. Build and runtime tested in all 1024 possible build combinations. The only failures are by design as mentioned above. Corresponding to flashrom svn r797. Signed-off-by: Carl-Daniel Hailfinger Acked-by: Sean Nelson --- spi.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spi.c') diff --git a/spi.c b/spi.c index 14beed7..a2b26c5 100644 --- a/spi.c +++ b/spi.c @@ -40,6 +40,7 @@ const struct spi_programmer spi_programmer[] = { .write_256 = NULL, }, +#if INTERNAL_SUPPORT == 1 { /* SPI_CONTROLLER_ICH7 */ .command = ich_spi_send_command, .multicommand = ich_spi_send_multicommand, @@ -81,6 +82,7 @@ const struct spi_programmer spi_programmer[] = { .read = wbsio_spi_read, .write_256 = wbsio_spi_write_1, }, +#endif #if FT2232_SPI_SUPPORT == 1 { /* SPI_CONTROLLER_FT2232 */ @@ -308,11 +310,13 @@ int probe_spi_rdid4(struct flashchip *flash) { /* only some SPI chipsets support 4 bytes commands */ switch (spi_controller) { +#if INTERNAL_SUPPORT == 1 case SPI_CONTROLLER_ICH7: case SPI_CONTROLLER_ICH9: case SPI_CONTROLLER_VIA: case SPI_CONTROLLER_SB600: case SPI_CONTROLLER_WBSIO: +#endif #if FT2232_SPI_SUPPORT == 1 case SPI_CONTROLLER_FT2232: #endif @@ -1042,10 +1046,12 @@ int spi_aai_write(struct flashchip *flash, uint8_t *buf) int result; switch (spi_controller) { +#if INTERNAL_SUPPORT == 1 case SPI_CONTROLLER_WBSIO: fprintf(stderr, "%s: impossible with Winbond SPI masters," " degrading to byte program\n", __func__); return spi_chip_write_1(flash, buf); +#endif default: break; } -- cgit v1.1