* [U-Boot] [PATCH] arm: OMAP2+: nandecc: propagate error to command return status
@ 2017-02-18 23:29 Ladislav Michl
2017-03-01 15:38 ` Tom Rini
0 siblings, 1 reply; 5+ messages in thread
From: Ladislav Michl @ 2017-02-18 23:29 UTC (permalink / raw)
To: u-boot
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
arch/arm/include/asm/arch-am33xx/sys_proto.h | 2 +-
arch/arm/include/asm/arch-omap3/sys_proto.h | 2 +-
arch/arm/mach-omap2/omap3/board.c | 32 ++++++++++++----------------
3 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 0c5792baa8..903398fe8f 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -29,7 +29,7 @@ void sdelay(unsigned long);
void gpmc_init(void);
void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs, u32 base,
u32 size);
-void omap_nand_switch_ecc(uint32_t, uint32_t);
+int omap_nand_switch_ecc(uint32_t, uint32_t);
void set_uart_mux_conf(void);
void set_mux_conf_regs(void);
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 5979340ac8..ddcb559928 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -68,7 +68,7 @@ u32 wait_on_value(u32, u32, void *, u32);
void cancel_out(u32 *num, u32 *den, u32 den_limit);
void sdelay(unsigned long);
void make_cs1_contiguous(void);
-void omap_nand_switch_ecc(uint32_t, uint32_t);
+int omap_nand_switch_ecc(uint32_t, uint32_t);
void power_init_r(void);
void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
void omap3_set_aux_cr_secure(u32 acr);
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index 5f5597772b..a727226563 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -269,38 +269,34 @@ void abort(void)
*****************************************************************************/
static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
+ int hw, strength = 1;
+
if (argc < 2 || argc > 3)
goto usage;
if (strncmp(argv[1], "hw", 2) == 0) {
- if (argc == 2) {
- omap_nand_switch_ecc(1, 1);
- } else {
- if (strncmp(argv[2], "hamming", 7) == 0)
- omap_nand_switch_ecc(1, 1);
- else if (strncmp(argv[2], "bch8", 4) == 0)
- omap_nand_switch_ecc(1, 8);
+ hw = 1;
+ if (argc == 3) {
+ if (strncmp(argv[2], "bch8", 4) == 0)
+ strength = 8;
else if (strncmp(argv[2], "bch16", 5) == 0)
- omap_nand_switch_ecc(1, 16);
- else
+ strength = 16;
+ else if (strncmp(argv[2], "hamming", 7) != 0)
goto usage;
}
} else if (strncmp(argv[1], "sw", 2) == 0) {
- if (argc == 2) {
- omap_nand_switch_ecc(0, 1);
- } else {
- if (strncmp(argv[2], "hamming", 7) == 0)
- omap_nand_switch_ecc(0, 1);
- else if (strncmp(argv[2], "bch8", 4) == 0)
- omap_nand_switch_ecc(0, 8);
- else
+ hw = 0;
+ if (argc == 3) {
+ if (strncmp(argv[2], "bch8", 4) == 0)
+ strength = 8;
+ else if (strncmp(argv[2], "hamming", 7) != 0)
goto usage;
}
} else {
goto usage;
}
- return 0;
+ return -omap_nand_switch_ecc(hw, strength);
usage:
printf ("Usage: nandecc %s\n", cmdtp->usage);
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] arm: OMAP2+: nandecc: propagate error to command return status
2017-02-18 23:29 [U-Boot] [PATCH] arm: OMAP2+: nandecc: propagate error to command return status Ladislav Michl
@ 2017-03-01 15:38 ` Tom Rini
2017-03-06 12:54 ` [U-Boot] [PATCH v2] " Ladislav Michl
0 siblings, 1 reply; 5+ messages in thread
From: Tom Rini @ 2017-03-01 15:38 UTC (permalink / raw)
To: u-boot
On Sun, Feb 19, 2017 at 12:29:24AM +0100, Ladislav Michl wrote:
Please explain the changes a little bit here, thanks!
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170301/fd115e88/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] arm: OMAP2+: nandecc: propagate error to command return status
2017-03-01 15:38 ` Tom Rini
@ 2017-03-06 12:54 ` Ladislav Michl
2017-03-10 15:09 ` Tom Rini
2017-03-12 3:30 ` [U-Boot] [U-Boot, " Tom Rini
0 siblings, 2 replies; 5+ messages in thread
From: Ladislav Michl @ 2017-03-06 12:54 UTC (permalink / raw)
To: u-boot
Currently nandecc returns zero even if underlaying
omap_nand_switch_ecc function fails. Fix that by
propagating error returned to command return value.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
Changes:
- v2: Add changelog text.
arch/arm/include/asm/arch-am33xx/sys_proto.h | 2 +-
arch/arm/include/asm/arch-omap3/sys_proto.h | 2 +-
arch/arm/mach-omap2/omap3/board.c | 32 ++++++++++++----------------
3 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 0c5792baa8..903398fe8f 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -29,7 +29,7 @@ void sdelay(unsigned long);
void gpmc_init(void);
void enable_gpmc_cs_config(const u32 *gpmc_config, const struct gpmc_cs *cs, u32 base,
u32 size);
-void omap_nand_switch_ecc(uint32_t, uint32_t);
+int omap_nand_switch_ecc(uint32_t, uint32_t);
void set_uart_mux_conf(void);
void set_mux_conf_regs(void);
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h
index 5979340ac8..ddcb559928 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -68,7 +68,7 @@ u32 wait_on_value(u32, u32, void *, u32);
void cancel_out(u32 *num, u32 *den, u32 den_limit);
void sdelay(unsigned long);
void make_cs1_contiguous(void);
-void omap_nand_switch_ecc(uint32_t, uint32_t);
+int omap_nand_switch_ecc(uint32_t, uint32_t);
void power_init_r(void);
void do_omap3_emu_romcode_call(u32 service_id, u32 parameters);
void omap3_set_aux_cr_secure(u32 acr);
diff --git a/arch/arm/mach-omap2/omap3/board.c b/arch/arm/mach-omap2/omap3/board.c
index 5f5597772b..a727226563 100644
--- a/arch/arm/mach-omap2/omap3/board.c
+++ b/arch/arm/mach-omap2/omap3/board.c
@@ -269,38 +269,34 @@ void abort(void)
*****************************************************************************/
static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
+ int hw, strength = 1;
+
if (argc < 2 || argc > 3)
goto usage;
if (strncmp(argv[1], "hw", 2) == 0) {
- if (argc == 2) {
- omap_nand_switch_ecc(1, 1);
- } else {
- if (strncmp(argv[2], "hamming", 7) == 0)
- omap_nand_switch_ecc(1, 1);
- else if (strncmp(argv[2], "bch8", 4) == 0)
- omap_nand_switch_ecc(1, 8);
+ hw = 1;
+ if (argc == 3) {
+ if (strncmp(argv[2], "bch8", 4) == 0)
+ strength = 8;
else if (strncmp(argv[2], "bch16", 5) == 0)
- omap_nand_switch_ecc(1, 16);
- else
+ strength = 16;
+ else if (strncmp(argv[2], "hamming", 7) != 0)
goto usage;
}
} else if (strncmp(argv[1], "sw", 2) == 0) {
- if (argc == 2) {
- omap_nand_switch_ecc(0, 1);
- } else {
- if (strncmp(argv[2], "hamming", 7) == 0)
- omap_nand_switch_ecc(0, 1);
- else if (strncmp(argv[2], "bch8", 4) == 0)
- omap_nand_switch_ecc(0, 8);
- else
+ hw = 0;
+ if (argc == 3) {
+ if (strncmp(argv[2], "bch8", 4) == 0)
+ strength = 8;
+ else if (strncmp(argv[2], "hamming", 7) != 0)
goto usage;
}
} else {
goto usage;
}
- return 0;
+ return -omap_nand_switch_ecc(hw, strength);
usage:
printf ("Usage: nandecc %s\n", cmdtp->usage);
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH v2] arm: OMAP2+: nandecc: propagate error to command return status
2017-03-06 12:54 ` [U-Boot] [PATCH v2] " Ladislav Michl
@ 2017-03-10 15:09 ` Tom Rini
2017-03-12 3:30 ` [U-Boot] [U-Boot, " Tom Rini
1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2017-03-10 15:09 UTC (permalink / raw)
To: u-boot
On Mon, Mar 06, 2017 at 01:54:30PM +0100, Ladislav Michl wrote:
> Currently nandecc returns zero even if underlaying
> omap_nand_switch_ecc function fails. Fix that by
> propagating error returned to command return value.
>
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170310/d97f88fb/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [U-Boot, v2] arm: OMAP2+: nandecc: propagate error to command return status
2017-03-06 12:54 ` [U-Boot] [PATCH v2] " Ladislav Michl
2017-03-10 15:09 ` Tom Rini
@ 2017-03-12 3:30 ` Tom Rini
1 sibling, 0 replies; 5+ messages in thread
From: Tom Rini @ 2017-03-12 3:30 UTC (permalink / raw)
To: u-boot
On Mon, Mar 06, 2017 at 01:54:30PM +0100, Ladislav Michl wrote:
> Currently nandecc returns zero even if underlaying
> omap_nand_switch_ecc function fails. Fix that by
> propagating error returned to command return value.
>
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170311/9cce8812/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-12 3:30 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-18 23:29 [U-Boot] [PATCH] arm: OMAP2+: nandecc: propagate error to command return status Ladislav Michl
2017-03-01 15:38 ` Tom Rini
2017-03-06 12:54 ` [U-Boot] [PATCH v2] " Ladislav Michl
2017-03-10 15:09 ` Tom Rini
2017-03-12 3:30 ` [U-Boot] [U-Boot, " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.