summaryrefslogtreecommitdiff
path: root/board/nc650
diff options
context:
space:
mode:
authordzu@denx.de <dzu@eddie.localdomain>2006-04-19 11:52:46 +0200
committerDetlev Zundel <dzu@eddie.localdomain>2006-04-19 11:52:46 +0200
commita367d42640e3cb10afeb4950bd5beb1c7f6cf107 (patch)
tree7c41a069cee7f9e38be792819cdc535524fdc8ab /board/nc650
parent8419c013048b1f15f3fa2fc7c0463d860a04ee3e (diff)
downloadu-boot-imx-a367d42640e3cb10afeb4950bd5beb1c7f6cf107.zip
u-boot-imx-a367d42640e3cb10afeb4950bd5beb1c7f6cf107.tar.gz
u-boot-imx-a367d42640e3cb10afeb4950bd5beb1c7f6cf107.tar.bz2
Update for NC650 board. Add NC650 based CP850 configuration.
Signed-off-by: dzu@denx.de <dzu@denx.de>
Diffstat (limited to 'board/nc650')
-rw-r--r--board/nc650/Makefile3
-rw-r--r--board/nc650/config.mk2
-rw-r--r--board/nc650/nc650.c72
3 files changed, 69 insertions, 8 deletions
diff --git a/board/nc650/Makefile b/board/nc650/Makefile
index a4dd85f..8dc4934 100644
--- a/board/nc650/Makefile
+++ b/board/nc650/Makefile
@@ -1,4 +1,5 @@
#
+# (C) Copyright 2006 Detlev Zundel, dzu@denx.de
# (C) Copyright 2004
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
@@ -25,7 +26,7 @@ include $(TOPDIR)/config.mk
LIB = lib$(BOARD).a
-OBJS = $(BOARD).o flash.o
+OBJS = $(BOARD).o nand.o flash.o
$(LIB): .depend $(OBJS)
$(AR) crv $@ $(OBJS)
diff --git a/board/nc650/config.mk b/board/nc650/config.mk
index fa8ba31..5b2284a 100644
--- a/board/nc650/config.mk
+++ b/board/nc650/config.mk
@@ -1,4 +1,5 @@
#
+# (C) Copyright 2006 Detlev Zundel, dzu@denx.de
# (C) Copyright 2004
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
@@ -26,3 +27,4 @@
#
TEXT_BASE = 0x40700000
+BOARDLIBS = drivers/nand/libnand.a
diff --git a/board/nc650/nc650.c b/board/nc650/nc650.c
index fe96b93..c90ac9c 100644
--- a/board/nc650/nc650.c
+++ b/board/nc650/nc650.c
@@ -1,4 +1,5 @@
/*
+ * (C) Copyright 2006 Detlev Zundel, dzu@denx.de
* (C) Copyright 2001
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
@@ -108,7 +109,16 @@ const uint nand_flash_table[] = {
int checkboard (void)
{
- puts ("Board: NC650\n");
+#if !defined(CONFIG_CP850)
+ puts ("Board: NC650");
+#else
+ puts ("Board: CP850");
+#endif
+#if defined(CONFIG_IDS852_REV1)
+ puts (" with IDS852 rev 1 module\n");
+#elif defined(CONFIG_IDS852_REV2)
+ puts (" with IDS852 rev 2 module\n");
+#endif
return 0;
}
@@ -241,13 +251,61 @@ static long int dram_size (long int mamr_value, long int *base, long int maxsize
return (get_ram_size(base, maxsize));
}
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
-void nand_init(void)
-{
- extern unsigned long nand_probe(unsigned long physadr);
- unsigned long totlen = nand_probe(CFG_NAND_BASE);
+#if defined(CONFIG_CP850)
+
+#define DPRAM_VARNAME "KP850DIP"
+#define PARAM_ADDR 0x7C0
+#define NAME_ADDR 0x7F8
+#define BOARD_NAME "KP01"
+#define DEFAULT_LB "241111"
- printf ("%4lu MB\n", totlen >> 20);
+int misc_init_r(void)
+{
+ int iCompatMode = 0;
+ char *pParam = NULL;
+ char *envlb;
+
+ /*
+ First byte in CPLD read address space signals compatibility mode
+ 0 - cp850
+ 1 - kp852
+ */
+ pParam = (char*)(CFG_CPLD_BASE);
+ if( *pParam != 0)
+ iCompatMode = 1;
+
+ if ( iCompatMode != 0) {
+ /*
+ In KP852 compatibility mode we have to write to
+ DPRAM as early as possible the binary coded
+ line config and board name.
+ The line config is derived from the environment
+ variable DPRAM_VARNAME by converting from ASCII
+ to binary per character.
+ */
+ if ( (envlb = getenv ( DPRAM_VARNAME )) == 0) {
+ setenv( DPRAM_VARNAME, DEFAULT_LB);
+ envlb = DEFAULT_LB;
+ }
+
+ /* Status string */
+ printf("Mode: KP852(LB=%s)\n", envlb);
+
+ /* copy appl init */
+ pParam = (char*)(DPRAM_BASE_ADDR + PARAM_ADDR);
+ while (*envlb) {
+ *(pParam++) = *(envlb++) - '0';
+ }
+ *pParam = '\0';
+
+ /* copy board id */
+ pParam = (char*)(DPRAM_BASE_ADDR + NAME_ADDR);
+ strcpy( pParam, BOARD_NAME);
+ } else {
+ puts("Mode: CP850\n");
+ }
+
+ return 0;
}
#endif