aboutsummaryrefslogtreecommitdiff
path: root/src/flash/nand
diff options
context:
space:
mode:
authorMathias K <kesmtp@freenet.de>2011-12-16 07:48:39 +0100
committerØyvind Harboe <oyvindharboe@gmail.com>2012-01-04 17:56:46 +0000
commit16b6b5e7a86353dbc0c4823fe3d772c0faca7c1c (patch)
tree4950e26d07d60b16b3223e085227c583418c2ef8 /src/flash/nand
parent42cb62cf3b47b982d6444948b483f9c6ce32de05 (diff)
downloadriscv-openocd-16b6b5e7a86353dbc0c4823fe3d772c0faca7c1c.zip
riscv-openocd-16b6b5e7a86353dbc0c4823fe3d772c0faca7c1c.tar.gz
riscv-openocd-16b6b5e7a86353dbc0c4823fe3d772c0faca7c1c.tar.bz2
Change return value on error.
On wrong parameters a error is signalized to the calling function. Change-Id: I484443fdb39938e20382edc9246d5ec546a5c960 Signed-off-by: Mathias K <kesmtp@freenet.de> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com> Reviewed-on: http://openocd.zylin.com/282 Tested-by: jenkins Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src/flash/nand')
-rw-r--r--src/flash/nand/davinci.c6
-rw-r--r--src/flash/nand/lpc3180.c3
-rw-r--r--src/flash/nand/lpc32xx.c3
-rw-r--r--src/flash/nand/mx3.c4
-rw-r--r--src/flash/nand/orion.c4
5 files changed, 8 insertions, 12 deletions
diff --git a/src/flash/nand/davinci.c b/src/flash/nand/davinci.c
index b7fe66e..e12fc46 100644
--- a/src/flash/nand/davinci.c
+++ b/src/flash/nand/davinci.c
@@ -689,10 +689,7 @@ NAND_DEVICE_COMMAND_HANDLER(davinci_nand_device_command)
* Plus someday, optionally, ALE and CLE masks.
*/
if (CMD_ARGC < 5) {
- LOG_ERROR("parameters: %s target "
- "chip_addr hwecc_mode aemif_addr",
- CMD_ARGV[0]);
- goto fail;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
COMMAND_PARSE_NUMBER(ulong, CMD_ARGV[2], chip);
@@ -783,6 +780,7 @@ fail:
struct nand_flash_controller davinci_nand_controller = {
.name = "davinci",
+ .usage = "chip_addr hwecc_mode aemif_addr",
.nand_device_command = davinci_nand_device_command,
.init = davinci_init,
.reset = davinci_reset,
diff --git a/src/flash/nand/lpc3180.c b/src/flash/nand/lpc3180.c
index f196af7..9d8cbae 100644
--- a/src/flash/nand/lpc3180.c
+++ b/src/flash/nand/lpc3180.c
@@ -45,8 +45,7 @@ NAND_DEVICE_COMMAND_HANDLER(lpc3180_nand_device_command)
{
if (CMD_ARGC < 3)
{
- LOG_WARNING("incomplete 'lpc3180' nand flash configuration");
- return ERROR_FLASH_BANK_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
uint32_t osc_freq;
diff --git a/src/flash/nand/lpc32xx.c b/src/flash/nand/lpc32xx.c
index ffb322c..addc323 100644
--- a/src/flash/nand/lpc32xx.c
+++ b/src/flash/nand/lpc32xx.c
@@ -75,8 +75,7 @@ static dmac_ll_t dmalist[(2048/256) * 2 + 1];
NAND_DEVICE_COMMAND_HANDLER(lpc32xx_nand_device_command)
{
if (CMD_ARGC < 3) {
- LOG_WARNING("incomplete 'lpc32xx' nand flash configuration");
- return ERROR_FLASH_BANK_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
uint32_t osc_freq;
diff --git a/src/flash/nand/mx3.c b/src/flash/nand/mx3.c
index 45591e3..54ba1f9 100644
--- a/src/flash/nand/mx3.c
+++ b/src/flash/nand/mx3.c
@@ -76,8 +76,7 @@ NAND_DEVICE_COMMAND_HANDLER(imx31_nand_device_command)
if (CMD_ARGC < 3)
{
- LOG_ERROR ("use \"nand device imx31 target noecc|hwecc\"");
- return ERROR_FAIL;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
/*
* check hwecc requirements
@@ -851,6 +850,7 @@ static int do_data_output (struct nand_device *nand)
struct nand_flash_controller imx31_nand_flash_controller = {
.name = "imx31",
+ .usage = "nand device imx31 target noecc|hwecc",
.nand_device_command = &imx31_nand_device_command,
.init = &imx31_init,
.reset = &imx31_reset,
diff --git a/src/flash/nand/orion.c b/src/flash/nand/orion.c
index 5b0c964..e6a33eb 100644
--- a/src/flash/nand/orion.c
+++ b/src/flash/nand/orion.c
@@ -121,8 +121,7 @@ NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
uint8_t ale, cle;
if (CMD_ARGC != 3) {
- LOG_ERROR("arguments must be: <target_id> <NAND_address>");
- return ERROR_NAND_DEVICE_INVALID;
+ return ERROR_COMMAND_SYNTAX_ERROR;
}
hw = calloc(1, sizeof(*hw));
@@ -156,6 +155,7 @@ static int orion_nand_init(struct nand_device *nand)
struct nand_flash_controller orion_nand_controller =
{
.name = "orion",
+ .usage = "<target_id> <NAND_address>",
.command = orion_nand_command,
.address = orion_nand_address,
.read_data = orion_nand_read,