summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-10-10 21:59:42 +0300
committerTom Rini <trini@konsulko.com>2017-10-16 09:42:51 -0400
commitc68c03f52badc90951dbf8a054c0e500e04bf365 (patch)
tree30fee12332240549a47bdb2cf2ee27a1a7d64b02 /cmd
parent95688de311e238ccfba21c50b1b67ceffbdc7fc5 (diff)
Drop CONFIG_HAS_DATAFLASH
Last user of this option went away in commit: fdc7718999 ("board: usb_a9263: Update to support DT and DM") Signed-off-by: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/flash.c33
-rw-r--r--cmd/mem.c106
2 files changed, 11 insertions, 128 deletions
diff --git a/cmd/flash.c b/cmd/flash.c
index b150940bf3..a2803e8ee4 100644
--- a/cmd/flash.c
+++ b/cmd/flash.c
@@ -11,10 +11,6 @@
#include <common.h>
#include <command.h>
-#ifdef CONFIG_HAS_DATAFLASH
-#include <dataflash.h>
-#endif
-
#if defined(CONFIG_CMD_MTDPARTS)
#include <jffs2/jffs2.h>
@@ -279,10 +275,6 @@ static int do_flinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ulong bank;
#endif
-#ifdef CONFIG_HAS_DATAFLASH
- dataflash_print_info();
-#endif
-
#ifdef CONFIG_MTD_NOR_FLASH
if (argc == 1) { /* print info for all FLASH banks */
for (bank=0; bank <CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
@@ -451,10 +443,7 @@ static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
u8 dev_type, dev_num, pnum;
#endif
#endif /* CONFIG_MTD_NOR_FLASH */
-#ifdef CONFIG_HAS_DATAFLASH
- int status;
-#endif
-#if defined(CONFIG_MTD_NOR_FLASH) || defined(CONFIG_HAS_DATAFLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
int p;
ulong addr_first, addr_last;
#endif
@@ -462,7 +451,7 @@ static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
if (argc < 3)
return CMD_RET_USAGE;
-#if defined(CONFIG_MTD_NOR_FLASH) || defined(CONFIG_HAS_DATAFLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
if (strcmp(argv[1], "off") == 0)
p = 0;
else if (strcmp(argv[1], "on") == 0)
@@ -471,24 +460,6 @@ static int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
return CMD_RET_USAGE;
#endif
-#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){
- puts ("Bad DataFlash sector specification\n");
- return 1;
- }
- printf("%sProtect %d DataFlash Sectors\n",
- p ? "" : "Un-", status);
- return 0;
- }
- }
-#endif
-
#ifdef CONFIG_MTD_NOR_FLASH
if (strcmp(argv[2], "all") == 0) {
for (bank=1; bank<=CONFIG_SYS_MAX_FLASH_BANKS; ++bank) {
diff --git a/cmd/mem.c b/cmd/mem.c
index 27075e54a9..6775ab7733 100644
--- a/cmd/mem.c
+++ b/cmd/mem.c
@@ -17,9 +17,6 @@
#include <cli.h>
#include <command.h>
#include <console.h>
-#ifdef CONFIG_HAS_DATAFLASH
-#include <dataflash.h>
-#endif
#include <hash.h>
#include <inttypes.h>
#include <mapmem.h>
@@ -52,10 +49,8 @@ static ulong base_address = 0;
#define DISP_LINE_LEN 16
static int do_mem_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- ulong addr, length;
-#if defined(CONFIG_HAS_DATAFLASH)
- ulong nbytes, linebytes;
-#endif
+ ulong addr, length, bytes;
+ const void *buf;
int size;
int rc = 0;
@@ -88,40 +83,13 @@ static int do_mem_md(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
length = simple_strtoul(argv[2], NULL, 16);
}
-#if defined(CONFIG_HAS_DATAFLASH)
- /* Print the lines.
- *
- * We buffer all read data, so we can make sure data is read only
- * once, and all accesses are with the specified bus width.
- */
- nbytes = length * size;
- do {
- char linebuf[DISP_LINE_LEN];
- void* p;
- linebytes = (nbytes>DISP_LINE_LEN)?DISP_LINE_LEN:nbytes;
-
- rc = read_dataflash(addr, (linebytes/size)*size, linebuf);
- p = (rc == DATAFLASH_OK) ? linebuf : (void*)addr;
- print_buffer(addr, p, size, linebytes/size, DISP_LINE_LEN/size);
-
- nbytes -= linebytes;
- addr += linebytes;
- if (ctrlc()) {
- rc = 1;
- break;
- }
- } while (nbytes > 0);
-#else
- {
- ulong bytes = size * length;
- const void *buf = map_sysmem(addr, bytes);
+ bytes = size * length;
+ buf = map_sysmem(addr, bytes);
- /* Print the lines. */
- print_buffer(addr, buf, size, length, DISP_LINE_LEN / size);
- addr += bytes;
- unmap_sysmem(buf);
- }
-#endif
+ /* Print the lines. */
+ print_buffer(addr, buf, size, length, DISP_LINE_LEN / size);
+ addr += bytes;
+ unmap_sysmem(buf);
dp_last_addr = addr;
dp_last_length = length;
@@ -286,13 +254,6 @@ static int do_mem_cmp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
count = simple_strtoul(argv[3], NULL, 16);
-#ifdef CONFIG_HAS_DATAFLASH
- if (addr_dataflash(addr1) | addr_dataflash(addr2)){
- puts ("Comparison with DataFlash space not supported.\n\r");
- return 0;
- }
-#endif
-
bytes = size * count;
base = buf1 = map_sysmem(addr1, bytes);
buf2 = map_sysmem(addr2, bytes);
@@ -370,11 +331,7 @@ static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#ifdef CONFIG_MTD_NOR_FLASH
/* check if we are copying to Flash */
- if ( (addr2info(dest) != NULL)
-#ifdef CONFIG_HAS_DATAFLASH
- && (!addr_dataflash(dest))
-#endif
- ) {
+ if (addr2info(dest) != NULL) {
int rc;
puts ("Copy to Flash... ");
@@ -389,44 +346,6 @@ static int do_mem_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
#endif
-#ifdef CONFIG_HAS_DATAFLASH
- /* Check if we are copying from RAM or Flash to DataFlash */
- if (addr_dataflash(dest) && !addr_dataflash(addr)){
- int rc;
-
- puts ("Copy to DataFlash... ");
-
- rc = write_dataflash (dest, addr, count*size);
-
- if (rc != 1) {
- dataflash_perror (rc);
- return (1);
- }
- puts ("done\n");
- return 0;
- }
-
- /* Check if we are copying from DataFlash to RAM */
- if (addr_dataflash(addr) && !addr_dataflash(dest)
-#ifdef CONFIG_MTD_NOR_FLASH
- && (addr2info(dest) == NULL)
-#endif
- ){
- int rc;
- rc = read_dataflash(addr, count * size, (char *) dest);
- if (rc != 1) {
- dataflash_perror (rc);
- return (1);
- }
- return 0;
- }
-
- if (addr_dataflash(addr) && addr_dataflash(dest)){
- puts ("Unsupported combination of source/destination.\n\r");
- return 1;
- }
-#endif
-
memcpy((void *)dest, (void *)addr, count * size);
return 0;
@@ -1072,13 +991,6 @@ mod_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
addr += base_address;
}
-#ifdef CONFIG_HAS_DATAFLASH
- if (addr_dataflash(addr)){
- puts ("Can't modify DataFlash in place. Use cp instead.\n\r");
- return 0;
- }
-#endif
-
/* Print the address, followed by value. Then accept input for
* the next value. A non-converted value exits.
*/