From 5779d8d985d95104ad74332f5fa3cb6c67645509 Mon Sep 17 00:00:00 2001 From: wdenk Date: Sat, 6 Dec 2003 23:55:10 +0000 Subject: =?UTF-8?q?*=20Patch=20by=20Nicolas=20Lacressonni=E8re,=2012=20Nov?= =?UTF-8?q?=202003:=20=20=20update=20for=20for=20Atmel=20AT91RM9200DK=20de?= =?UTF-8?q?velopment=20kit:=20=20=20-=20support=20for=20environment=20vari?= =?UTF-8?q?ables=20in=20DataFlash=20=20=20-=20Atmel=20DataFlash=20AT45DB12?= =?UTF-8?q?82=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Patch by Jeff Carr, 11 Nov 2003: add support for new version of 8270 processors * Patches by George G. Davis, 05 Nov 2003: - only pass the ARM linux initrd tag to the kernel when an initrd is actually present - update omap1510inn configuration file --- common/cmd_flash.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'common/cmd_flash.c') diff --git a/common/cmd_flash.c b/common/cmd_flash.c index 430a33e22..a51b5e998 100644 --- a/common/cmd_flash.c +++ b/common/cmd_flash.c @@ -307,7 +307,9 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ulong bank, addr_first, addr_last; int i, p, n, sect_first, sect_last; int rcode = 0; - +#ifdef CONFIG_HAS_DATAFLASH + int status; +#endif if (argc < 3) { printf ("Usage:\n%s\n", cmdtp->usage); return 1; @@ -322,6 +324,24 @@ int do_protect (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } +#ifdef CONFIG_HAS_DATAFLASH + if ((strcmp(argv[2], "all") != 0) && (strcmp(argv[2], "bank") != 0)) { + addr_first = simple_strtoul(argv[2], NULL, 16); + addr_last = simple_strtoul(argv[3], NULL, 16); + + if (addr_dataflash(addr_first) && addr_dataflash(addr_last)) { + status = dataflash_real_protect(p,addr_first,addr_last); + if (status < 0){ + printf("Bad DataFlash sector specification\n"); + return 1; + } + printf("%sProtect %d DataFlash Sectors\n", + p ? "" : "Un-", status); + return 0; + } + } +#endif + if (strcmp(argv[2], "all") == 0) { for (bank=1; bank<=CFG_MAX_FLASH_BANKS; ++bank) { info = &flash_info[bank-1]; -- cgit v1.2.3