From 2abbe0754759f94c79125a2534fbc4be74f416bc Mon Sep 17 00:00:00 2001 From: wdenk Date: Mon, 16 Jun 2003 23:50:08 +0000 Subject: * Patch by Nicolas Lacressonniere, 11 Jun 2003: Modifications for Atmel AT91RM9200DK ARM920T based development kit - Add Atmel DataFlash support for reading and writing. - Add possibility to boot a Linux from DataFlash with BOOTM command. - Add Flash detection on Atmel AT91RM9200DK (between Atmel AT49BV1614 and AT49BV1614A flashes) - Replace old Ethernet PHY layer functions - Change link address * Patch by Frank Smith, 9 Jun 2003: use CRIT_EXCEPTION for machine check on 4xx * Patch by Detlev Zundel, 13 Jun 2003: added implementation of the "carinfo" command in cmd_immap.c --- lib_arm/armlinux.c | 15 +++++++++++++++ lib_arm/board.c | 10 ++++++++++ 2 files changed, 25 insertions(+) (limited to 'lib_arm') diff --git a/lib_arm/armlinux.c b/lib_arm/armlinux.c index 2fb8db8..0305803 100644 --- a/lib_arm/armlinux.c +++ b/lib_arm/armlinux.c @@ -27,6 +27,9 @@ #include #include #include +#ifdef CONFIG_HAS_DATAFLASH +#include +#endif #include #define tag_size(type) ((sizeof(struct tag_header) + sizeof(struct type)) >> 2) @@ -94,6 +97,11 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], printf ("## Loading Ramdisk Image at %08lx ...\n", addr); /* Copy header so we can blank CRC field for re-calculation */ +#ifdef CONFIG_HAS_DATAFLASH + if (addr_dataflash(addr)){ + read_dataflash(addr, sizeof(image_header_t), (char *)&header); + } else +#endif memcpy (&header, (char *)addr, sizeof(image_header_t)); if (ntohl(hdr->ih_magic) != IH_MAGIC) { @@ -121,6 +129,13 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], data = addr + sizeof(image_header_t); len = ntohl(hdr->ih_size); +#ifdef CONFIG_HAS_DATAFLASH + if (addr_dataflash(addr)){ + read_dataflash(data, len, (char *)CFG_LOAD_ADDR); + data = CFG_LOAD_ADDR; + } +#endif + if (verify) { ulong csum = 0; diff --git a/lib_arm/board.c b/lib_arm/board.c index af6af14..37d4d9f 100644 --- a/lib_arm/board.c +++ b/lib_arm/board.c @@ -37,6 +37,11 @@ void nand_init (void); ulong monitor_flash_len; +#ifdef CONFIG_HAS_DATAFLASH +extern int AT91F_DataflashInit(void); +extern void dataflash_print_info(void); +#endif + const char version_string[] = U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")"; @@ -242,6 +247,11 @@ void start_armboot (void) nand_init(); /* go init the NAND */ #endif +#ifdef CONFIG_HAS_DATAFLASH + AT91F_DataflashInit(); + dataflash_print_info(); +#endif + /* initialize environment */ env_relocate (); -- cgit v1.1