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 --- common/cmd_bootm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'common/cmd_bootm.c') diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index af62becf4a..8af7c7c9b7 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -56,6 +56,10 @@ #include #endif +#ifdef CONFIG_HAS_DATAFLASH +#include +#endif + /* * Some systems (for example LWMON) have very short watchdog periods; * we must make sure to split long operations like memmove() or @@ -138,6 +142,11 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) printf ("## Booting 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 memmove (&header, (char *)addr, sizeof(image_header_t)); if (ntohl(hdr->ih_magic) != IH_MAGIC) { @@ -178,6 +187,13 @@ int do_bootm (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) { printf (" Verifying Checksum ... "); if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { -- cgit v1.2.1