[U-Boot] [PATCH] da830: bug fix: CONFIG_USE_SPIFLASH

Ben Gardiner bengardiner at nanometrics.ca
Wed Jun 2 19:27:29 CEST 2010


Previous to this patch the following compiler error was observed when
CONFIG_USE_SPIFLASH is added to include/configs/da830evm.h for the
da830evm_config target:

common/libcommon.a(cmd_eeprom.o): In function `eeprom_init':
/media/unixdata/src/u-boot/uboot-nand/nand_and_omapl1/common/cmd_eeprom.c:408: undefined reference to `spi_init_f'
common/libcommon.a(cmd_eeprom.o): In function `eeprom_write':
/media/unixdata/src/u-boot/uboot-nand/nand_and_omapl1/common/cmd_eeprom.c:276: undefined reference to `spi_write'
common/libcommon.a(cmd_eeprom.o): In function `eeprom_read':
/media/unixdata/src/u-boot/uboot-nand/nand_and_omapl1/common/cmd_eeprom.c:180: undefined reference to `spi_read'
make: *** [u-boot] Error 1

This patch fixes the compiler error by #undef'ing CONFIG_CMD_EEPROM if
CONFIG_USE_SPIFLASH is defined. It also changes the max spi frequency
macro definition to the symbol used by the rest of U-boot and adds the SF 
command to those commands that are available when SPI flash is enabled.

Signed-off-by: Ben Gardiner <bengardiner at nanometrics.ca>

---

This patch is almost a cherry-pick of

b43d9d5ab21b4155824a6a6dac5167608218e254
da830: Enable SPI in configuration file
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj at ti.com>

from [3] except that in this patch we #undef CONFIG_CMD_EEPROM conditionally
on the presence of the CONFIG_USE_SPIFLASH macro.

[3] git://arago-project.org/git/people/sekhar/u-boot-omapl1.git
---
 include/configs/da830evm.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h
index 0f58e11..d07cc57 100644
--- a/include/configs/da830evm.h
+++ b/include/configs/da830evm.h
@@ -148,7 +148,7 @@
 #define CONFIG_SYS_SPI_BASE		DAVINCI_SPI0_BASE
 #define CONFIG_SYS_SPI_CLK		clk_get(DAVINCI_SPI0_CLKID)
 #define CONFIG_SF_DEFAULT_SPEED		50000000
-#define CONFIG_SYS_ENV_SPI_MAX_HZ	CONFIG_SF_DEFAULT_SPEED
+#define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
 #endif
 
 /*
@@ -224,7 +224,9 @@
 #ifdef CONFIG_USE_SPIFLASH
 #undef CONFIG_CMD_IMLS
 #undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_EEPROM
 #define CONFIG_CMD_SPI
+#define CONFIG_CMD_SF
 #define CONFIG_CMD_SAVEENV
 #endif
 
-- 
1.7.0.4



More information about the U-Boot mailing list