#include <common.h>
#include <command.h>
+#include <malloc.h>
#include <devices.h>
#include <version.h>
#include <net.h>
+#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+void nand_init (void);
+#endif
+
+ulong monitor_flash_len;
+
+#ifdef CONFIG_HAS_DATAFLASH
+extern int AT91F_DataflashInit(void);
+extern void dataflash_print_info(void);
+#endif
+
+#ifndef CONFIG_IDENT_STRING
+#define CONFIG_IDENT_STRING ""
+#endif
const char version_string[] =
- U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
+ U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")"CONFIG_IDENT_STRING;
#ifdef CONFIG_DRIVER_CS8900
extern void cs8900_get_enetaddr (uchar * addr);
#endif
+#ifdef CONFIG_DRIVER_LAN91C96
+#include "../drivers/lan91c96.h"
+#endif
/*
* Begin and End of memory area for malloc(), and current "brk"
*/
static ulong mem_malloc_end = 0;
static ulong mem_malloc_brk = 0;
-static void mem_malloc_init (ulong dest_addr)
+static
+void mem_malloc_init (ulong dest_addr)
{
mem_malloc_start = dest_addr;
mem_malloc_end = dest_addr + CFG_MALLOC_LEN;
uchar tmp[64]; /* long enough for environment variables */
int i = getenv_r ("baudrate", tmp, sizeof (tmp));
-
- gd->baudrate = (i > 0)
+ gd->bd->bi_baudrate = gd->baudrate = (i > 0)
? (int) simple_strtoul (tmp, NULL, 10)
: CONFIG_BAUDRATE;
}
-
/*
* Breath some life into the board...
*
- * Initialize an SMC for serial comms, and carry out some hardware
+ * Initialize a serial port as console, and carry out some hardware
* tests.
*
* The first part of initialization is running from Flash memory;
env_init, /* initialize environment */
init_baudrate, /* initialze baudrate settings */
serial_init, /* serial communications setup */
+ console_init_f, /* stage 1 init of console */
display_banner, /* say that we are here */
dram_init, /* configure available RAM banks */
display_dram_config,
-
+#if defined(CONFIG_VCMA9)
+ checkboard,
+#endif
NULL,
};
gd_t gd_data;
bd_t bd_data;
init_fnc_t **init_fnc_ptr;
-#ifdef CONFIG_VFD
+ char *s;
+#if defined(CONFIG_VFD)
unsigned long addr;
#endif
/* Pointer is writable since we allocated a register for it */
gd = &gd_data;
- memset (gd, 0, sizeof (gd_t));
+ memset ((void *)gd, 0, sizeof (gd_t));
gd->bd = &bd_data;
memset (gd->bd, 0, sizeof (bd_t));
+ monitor_flash_len = _armboot_end_data - _armboot_start;
+
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) {
hang ();
display_flash_config (size);
#ifdef CONFIG_VFD
-#ifndef PAGE_SIZE
-#define PAGE_SIZE 4096
-#endif
+# ifndef PAGE_SIZE
+# define PAGE_SIZE 4096
+# endif
/*
* reserve memory for VFD display (always full pages)
*/
mem_malloc_init (_armboot_real_end);
#endif /* CONFIG_VFD */
+#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+ puts ("NAND:");
+ nand_init(); /* go init the NAND */
+#endif
+
+#ifdef CONFIG_HAS_DATAFLASH
+ AT91F_DataflashInit();
+ dataflash_print_info();
+#endif
+
+ /* initialize environment */
+ env_relocate ();
+
#ifdef CONFIG_VFD
/* must do this after the framebuffer is allocated */
drv_vfd_init();
#endif
- /* initialize environment */
- env_relocate ();
/* IP Address */
bd_data.bi_ip_addr = getenv_IPaddr ("ipaddr");
}
}
+ devices_init (); /* get the devices list going. */
+
+ jumptable_init ();
+
+ console_init_r (); /* fully init console as a device */
+
#if defined(CONFIG_MISC_INIT_R)
/* miscellaneous platform dependent initialisations */
misc_init_r ();
enable_interrupts ();
#ifdef CONFIG_DRIVER_CS8900
- if (!getenv ("ethaddr")) {
- cs8900_get_enetaddr (gd->bd->bi_enetaddr);
- }
+ cs8900_get_enetaddr (gd->bd->bi_enetaddr);
#endif
+#ifdef CONFIG_DRIVER_LAN91C96
+ if (getenv ("ethaddr")) {
+ smc_set_mac_addr(gd->bd->bi_enetaddr);
+ }
+ /* eth_hw_init(); */
+#endif /* CONFIG_DRIVER_LAN91C96 */
+
+ /* Initialize from environment */
+ if ((s = getenv ("loadaddr")) != NULL) {
+ load_addr = simple_strtoul (s, NULL, 16);
+ }
+#if (CONFIG_COMMANDS & CFG_CMD_NET)
+ if ((s = getenv ("bootfile")) != NULL) {
+ copy_filename (BootFile, s, sizeof (BootFile));
+ }
+#endif /* CFG_CMD_NET */
+
#ifdef BOARD_POST_INIT
board_post_init ();
#endif