diff options
author | Kumar Gala <galak@kernel.crashing.org> | 2006-04-20 12:25:10 -0500 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2006-04-20 12:25:10 -0500 |
commit | b86d7622b33892b1dafe761a7a9eaeeab9f3816b (patch) | |
tree | 56b1b6fc978166abce4afa8e9dee0af94bfc3cd6 /board/nc650/nc650.c | |
parent | f8edca2e9a128f526b1fe6f997f7adb852cf5b3c (diff) | |
parent | 56a4a63c106cc317fc0fe42686a99416fc469f5b (diff) | |
download | u-boot-imx-b86d7622b33892b1dafe761a7a9eaeeab9f3816b.zip u-boot-imx-b86d7622b33892b1dafe761a7a9eaeeab9f3816b.tar.gz u-boot-imx-b86d7622b33892b1dafe761a7a9eaeeab9f3816b.tar.bz2 |
Merge branch 'master' of rsync://rsync.denx.de/git/u-boot
Diffstat (limited to 'board/nc650/nc650.c')
-rw-r--r-- | board/nc650/nc650.c | 72 |
1 files changed, 65 insertions, 7 deletions
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 |