* Copyright (C) 2007 by Dominic Rath *
* Dominic.Rath@gmx.de *
* *
- * partially based on *
- * drivers/mtd/nand_ids.c *
- * *
- * Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de) *
+ * Partially based on drivers/mtd/nand_ids.c from Linux. *
+ * Copyright (C) 2002 Thomas Gleixner <tglx@linutronix.de> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
if ((argc < 1) || (argc > 3))
{
- command_print(cmd_ctx, "usage: nand info <num> [<first> <last>]");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
}
if (argc == 2)
if (argc != 1)
{
- command_print(cmd_ctx, "usage: nand probe <num>");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
p = get_nand_device_by_num(strtoul(args[0], NULL, 0));
if (argc != 3)
{
- command_print(cmd_ctx, "usage: nand erase <num> <first> <last>");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
}
p = get_nand_device_by_num(strtoul(args[0], NULL, 0));
if ((argc < 1) || (argc > 3) || (argc == 2))
{
- command_print(cmd_ctx, "usage: nand check_bad_blocks <num> [<first> <last>]");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
}
if (argc == 3)
if (argc != 4)
{
- command_print(cmd_ctx, "usage: nand copy <num> <offset> <length> <ram-address>");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
}
p = get_nand_device_by_num(strtoul(args[0], NULL, 0));
if (argc < 3)
{
- command_print(cmd_ctx, "usage: nand write <num> <file> <offset> [options]");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
}
p = get_nand_device_by_num(strtoul(args[0], NULL, 0));
if (fileio_open(&fileio, args[1], FILEIO_READ, FILEIO_BINARY) != ERROR_OK)
{
- command_print(cmd_ctx, "file open error: %s", fileio.error_str);
return ERROR_OK;
}
if (argc < 4)
{
- command_print(cmd_ctx, "usage: nand dump <num> <filename> <address> <size> [options]");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
p = get_nand_device_by_num(strtoul(args[0], NULL, 0));
if (fileio_open(&fileio, args[1], FILEIO_WRITE, FILEIO_BINARY) != ERROR_OK)
{
- command_print(cmd_ctx, "dump_image error: %s", fileio.error_str);
return ERROR_OK;
}
if ((argc < 1) || (argc > 2))
{
- command_print(cmd_ctx, "usage: nand raw_access <num> ['enable'|'disable']");
- return ERROR_OK;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
p = get_nand_device_by_num(strtoul(args[0], NULL, 0));
}
else
{
- command_print(cmd_ctx, "usage: nand raw_access ['enable'|disable']");
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
}