summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile22
-rw-r--r--board/da8xx/da8xx-evm/Makefile1
-rw-r--r--board/da8xx/da8xx-evm/da850.c4
-rwxr-xr-xcpu/arm926ejs/da8xx/nand.c4
-rw-r--r--include/configs/da850_evm.h148
5 files changed, 104 insertions, 75 deletions
diff --git a/Makefile b/Makefile
index 38dbdb2caee..c483a88e0d9 100644
--- a/Makefile
+++ b/Makefile
@@ -2715,10 +2715,28 @@ davinci_sffsdr_config : unconfig
davinci_sonata_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs sonata davinci davinci
+da850_omapl138_exp_spiflash_config \
+da850_omapl138_exp_config \
+da850_omapl138_evm_nand_config \
+da850_omapl138_evm_nor_config \
+da850_omapl138_evm_spiflash_config \
da850_omapl138_evm_config : unconfig
@mkdir -p $(obj)include
- echo "#define CONFIG_DA850_EVM" >> $(obj)include/config.h
- $(XECHO) "... configured for DA850/OMAP-L138 boot"
+ @if [ "$(findstring _exp,$@)" ] ; then \
+ echo "#define CONFIG_DA850_EXP" >> $(obj)include/config.h ; \
+ else \
+ echo "#define CONFIG_DA850_EVM" >> $(obj)include/config.h ; \
+ fi;
+ @if [ "$(findstring _nand,$@)" ] ; then \
+ echo "#define CONFIG_SYS_USE_NAND 1" >>$(obj)include/config.h ; \
+ $(XECHO) "... with environment variables in NAND FLASH" ; \
+ elif [ "$(findstring _nor,$@)" ] ; then \
+ echo "#define CONFIG_SYS_USE_NOR 1" >>$(obj)include/config.h ; \
+ $(XECHO) "... with environment variables in NOR FLASH" ; \
+ else \
+ echo "#define CONFIG_SYS_SPIFLASH 1" >>$(obj)include/config.h ; \
+ $(XECHO) "... with environment variables in SPI FLASH" ; \
+ fi;
@$(MKCONFIG) -a da850_evm arm arm926ejs da8xx-evm da8xx da8xx
da830_omapl137_evm_config : unconfig
diff --git a/board/da8xx/da8xx-evm/Makefile b/board/da8xx/da8xx-evm/Makefile
index 5d5c37a6198..8c524d6c9c2 100644
--- a/board/da8xx/da8xx-evm/Makefile
+++ b/board/da8xx/da8xx-evm/Makefile
@@ -29,6 +29,7 @@ LIB = $(obj)lib$(BOARD).a
COBJS-$(CONFIG_DA830_EVM) += da830.o
COBJS-$(CONFIG_DA850_EVM) += da850.o
+COBJS-$(CONFIG_DA850_EXP) += da850.o
COBJS := $(sort $(COBJS-y))
SOBJS := board_init.o
diff --git a/board/da8xx/da8xx-evm/da850.c b/board/da8xx/da8xx-evm/da850.c
index ccc464d1241..94520d4f22b 100644
--- a/board/da8xx/da8xx-evm/da850.c
+++ b/board/da8xx/da8xx-evm/da850.c
@@ -165,7 +165,7 @@ int board_init(void)
#endif
/* Async EMIF */
-#if defined(CONFIG_SYS_USE_NOR)
+#if defined(CONFIG_CMD_FLASH)
REG(PINMUX6) = 0x11111111;
REG(PINMUX7) = 0x11111111;
REG(PINMUX8) = 0x11111111;
@@ -175,7 +175,7 @@ int board_init(void)
REG(PINMUX12) = 0x11111111;
REG(PINMUX5) &= 0x00FFFFFF;
REG(PINMUX5) |= 0x11000000;
-#elif defined(CONFIG_SYS_USE_NAND)
+#else
REG(PINMUX7) &= 0xFF00F00F;
REG(PINMUX7) |= 0x00110110;
REG(PINMUX9) = 0x11111111;
diff --git a/cpu/arm926ejs/da8xx/nand.c b/cpu/arm926ejs/da8xx/nand.c
index 4e2d0c29e75..e1e56c435ec 100755
--- a/cpu/arm926ejs/da8xx/nand.c
+++ b/cpu/arm926ejs/da8xx/nand.c
@@ -44,7 +44,7 @@
#include <common.h>
#include <asm/io.h>
-#ifdef CONFIG_SYS_USE_NAND
+#ifdef CONFIG_CMD_NAND
#if !defined(CONFIG_NAND_LEGACY)
#include <nand.h>
@@ -1029,4 +1029,4 @@ int board_nand_init(struct nand_chip *nand)
#else
#error "U-Boot legacy NAND support not available for DaVinci chips"
#endif
-#endif /* CONFIG_SYS_USE_NAND */
+#endif /* CONFIG_CMD_NAND */
diff --git a/include/configs/da850_evm.h b/include/configs/da850_evm.h
index 4de2e139f48..39429357a37 100644
--- a/include/configs/da850_evm.h
+++ b/include/configs/da850_evm.h
@@ -26,13 +26,6 @@
#include <asm/sizes.h>
#include <asm/arch/hardware.h>
-/*=======*/
-/* Board */
-/*=======*/
-#define CONFIG_USE_SPIFLASH
-#undef CONFIG_SYS_USE_NAND
-#undef CONFIG_SYS_USE_NOR
-
/*===================*/
/* SoC Configuration */
/*===================*/
@@ -110,14 +103,56 @@
#define CONFIG_BOOTP_SEND_HOSTNAME
#define CONFIG_NET_RETRY_COUNT 10
-/*=====================*/
-/* Flash & Environment */
-/*=====================*/
-#ifdef CONFIG_SYS_USE_NAND
-#undef CONFIG_ENV_IS_IN_FLASH
+/*=================*/
+/* U-Boot commands */
+/*=================*/
+#include <config_cmd_default.h>
+#define CONFIG_CMD_ENV
+#define CONFIG_CMD_ASKENV
+#define CONFIG_CMD_DHCP
+#define CONFIG_CMD_DIAG
+#define CONFIG_CMD_MII
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_SAVES
+#define CONFIG_CMD_MEMORY
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_SETGETDCR
+#define CONFIG_CMD_EEPROM
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_NAND
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+
+/* Only enable NOR support if using it for environment */
+#ifdef CONFIG_SYS_USE_NOR
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMLS
+#undef CONFIG_CMD_NAND
+#endif
+
+/* eXperimenter does not contain NAND or NOR*/
+#if defined(CONFIG_DA850_EXP)
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_NAND
+#undef CONFIG_SYS_USE_NAND
+#undef CONFIG_SYS_USE_NOR
+#endif
+
+#ifdef CONFIG_USB_DA8XX
+#define CONFIG_CMD_USB /* inclue support for usb */
+#define CONFIG_CMD_STORAGE /* inclue support for usb */
+#define CONFIG_CMD_FAT /* inclue support for FAT/storage*/
+#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage*/
+#endif
+
+/*=======*/
+/* Flash */
+/*=======*/
#define CONFIG_SYS_NO_FLASH
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_SIZE SZ_128K
+
+#if defined(CONFIG_CMD_NAND)
#define CONFIG_NAND_CS 2
#define CONFIG_SYS_NAND_BASE DAVINCI_ASYNC_EMIF_DATA_CE3_BASE
#define CONFIG_CLE_MASK 0x10
@@ -129,35 +164,55 @@
/* Max number of NAND devices */
#define CONFIG_SYS_MAX_NAND_DEVICE 1
#define NAND_MAX_CHIPS 1
-/* Block 0--not used by bootcode */
-#define CONFIG_ENV_OFFSET 0x0
-#endif
-#ifdef CONFIG_SYS_USE_NOR
-#define CONFIG_ENV_IS_IN_FLASH
+#elif defined(CONFIG_CMD_FLASH)
#undef CONFIG_SYS_NO_FLASH
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_SYS_FLASH_CFI
#define CONFIG_SYS_MAX_FLASH_BANKS 1
#define CONFIG_SYS_FLASH_SECT_SZ 0x20000
-#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 2)
#define CONFIG_SYS_FLASH_BASE DAVINCI_ASYNC_EMIF_DATA_CE2_BASE
#define PHYS_FLASH_SIZE 0x800000
#define CONFIG_SYS_MAX_FLASH_SECT (PHYS_FLASH_SIZE/CONFIG_SYS_FLASH_SECT_SZ)
-#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_FLASH_SECT_SZ
#endif
-#ifdef CONFIG_USE_SPIFLASH
+#if defined(CONFIG_CMD_SF)
+#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
+#endif
+
+/*=============*/
+/* Environment */
+/*=============*/
+
+#if defined(CONFIG_SYS_SPIFLASH)
#undef CONFIG_ENV_IS_IN_FLASH
#undef CONFIG_ENV_IS_IN_NAND
#define CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_SIZE SZ_64K
#define CONFIG_ENV_OFFSET SZ_256K
#define CONFIG_ENV_SECT_SIZE SZ_64K
+
+#elif defined(CONFIG_SYS_USE_NAND)
+#undef CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_SIZE SZ_128K
#define CONFIG_SYS_NO_FLASH
-#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
-#endif
+#define CONFIG_ENV_IS_IN_NAND
+/* Block 0--not used by bootcode */
+#define CONFIG_ENV_OFFSET 0x0
+#elif defined(CONFIG_SYS_USE_NOR)
+#define CONFIG_ENV_IS_IN_FLASH
+#define CONFIG_ENV_OFFSET (CONFIG_SYS_FLASH_SECT_SZ * 2)
+#define CONFIG_ENV_SECT_SIZE CONFIG_SYS_FLASH_SECT_SZ
+
+#else
+#define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_SYS_NO_FLASH
+#define CONFIG_ENV_SIZE SZ_16K
+#undef CONFIG_CMD_IMLS
+#undef CONFIG_CMD_FLASH
+#undef CONFIG_CMD_ENV
+#endif
/*==============================*/
/* USB configuration */
@@ -207,50 +262,5 @@
#define CONFIG_BOOTARGS "mem=32M console=ttyS2,115200n8 root=/dev/ram0 rw initrd=0xc1180000,4M ip=dhcp"
#define CONFIG_BOOTDELAY 3
-/*=================*/
-/* U-Boot commands */
-/*=================*/
-#include <config_cmd_default.h>
-#define CONFIG_CMD_ENV
-#define CONFIG_CMD_ASKENV
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_DIAG
-#define CONFIG_CMD_MII
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_SAVES
-#define CONFIG_CMD_MEMORY
-#undef CONFIG_CMD_BDI
-#undef CONFIG_CMD_FPGA
-#undef CONFIG_CMD_SETGETDCR
-#define CONFIG_CMD_EEPROM
-
-#ifdef CONFIG_SYS_USE_NAND
-#undef CONFIG_CMD_FLASH
-#undef CONFIG_CMD_IMLS
-#define CONFIG_CMD_NAND
-#endif
-
-#ifdef CONFIG_USE_SPIFLASH
-#undef CONFIG_CMD_IMLS
-#undef CONFIG_CMD_FLASH
-#define CONFIG_CMD_SF
-#endif
-
-#if !defined(CONFIG_SYS_USE_NAND) && !defined(CONFIG_SYS_USE_NOR) && !defined(CONFIG_USE_SPIFLASH)
-#define CONFIG_ENV_IS_NOWHERE
-#define CONFIG_SYS_NO_FLASH
-#define CONFIG_ENV_SIZE SZ_16K
-#undef CONFIG_CMD_IMLS
-#undef CONFIG_CMD_FLASH
-#undef CONFIG_CMD_ENV
-#endif
-
-#ifdef CONFIG_USB_DA8XX
-#define CONFIG_CMD_USB /* inclue support for usb */
-#define CONFIG_CMD_STORAGE /* inclue support for usb */
-#define CONFIG_CMD_FAT /* inclue support for FAT/storage*/
-#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage*/
-#endif
-
#endif /* __CONFIG_H */