* [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch
@ 2008-11-11 15:00 dirk.behme at googlemail.com
2008-11-11 15:53 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-11 21:04 ` Scott Wood
0 siblings, 2 replies; 5+ messages in thread
From: dirk.behme at googlemail.com @ 2008-11-11 15:00 UTC (permalink / raw)
To: u-boot
Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier
reading.
---
drivers/mtd/nand/omap_gpmc.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
Index: u-boot-arm/drivers/mtd/nand/omap_gpmc.c
===================================================================
--- u-boot-arm.orig/drivers/mtd/nand/omap_gpmc.c
+++ u-boot-arm/drivers/mtd/nand/omap_gpmc.c
@@ -255,12 +255,17 @@ void omap_nand_switch_ecc(int32_t hardwa
nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR |
NAND_NO_AUTOINCR;
+ /* Reset ecc interface */
+ nand->ecc.read_page = NULL;
+ nand->ecc.write_page = NULL;
+ nand->ecc.read_oob = NULL;
+ nand->ecc.write_oob = NULL;
+ nand->ecc.hwctl = NULL;
+ nand->ecc.correct = NULL;
+ nand->ecc.calculate = NULL;
+
/* Setup the ecc configurations again */
- if (!hardware) {
- nand->ecc.mode = NAND_ECC_SOFT;
- /* Use mtd default settings */
- nand->ecc.layout = NULL;
- } else {
+ if (hardware) {
nand->ecc.mode = NAND_ECC_HW;
nand->ecc.layout = &hw_nand_oob;
nand->ecc.size = 512;
@@ -269,6 +274,12 @@ void omap_nand_switch_ecc(int32_t hardwa
nand->ecc.correct = omap_correct_data;
nand->ecc.calculate = omap_calculate_ecc;
omap_hwecc_init(nand);
+ printf("HW ECC selected\n");
+ } else {
+ nand->ecc.mode = NAND_ECC_SOFT;
+ /* Use mtd default settings */
+ nand->ecc.layout = NULL;
+ printf("SW ECC selected\n");
}
/* Update NAND handling after ECC mode switch */
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch
2008-11-11 15:00 [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch dirk.behme at googlemail.com
@ 2008-11-11 15:53 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-11 21:04 ` Scott Wood
1 sibling, 0 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-11 15:53 UTC (permalink / raw)
To: u-boot
On 16:00 Tue 11 Nov , dirk.behme at googlemail.com wrote:
> Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier
> reading.
>
SOB missing
Best Regards,
J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch
@ 2008-11-11 16:03 dirk.behme at googlemail.com
2008-11-14 17:11 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 5+ messages in thread
From: dirk.behme at googlemail.com @ 2008-11-11 16:03 UTC (permalink / raw)
To: u-boot
Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier
reading.
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
---
drivers/mtd/nand/omap_gpmc.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
Index: u-boot-arm/drivers/mtd/nand/omap_gpmc.c
===================================================================
--- u-boot-arm.orig/drivers/mtd/nand/omap_gpmc.c
+++ u-boot-arm/drivers/mtd/nand/omap_gpmc.c
@@ -255,12 +255,17 @@ void omap_nand_switch_ecc(int32_t hardwa
nand->options = NAND_NO_PADDING | NAND_CACHEPRG | NAND_NO_AUTOINCR |
NAND_NO_AUTOINCR;
+ /* Reset ecc interface */
+ nand->ecc.read_page = NULL;
+ nand->ecc.write_page = NULL;
+ nand->ecc.read_oob = NULL;
+ nand->ecc.write_oob = NULL;
+ nand->ecc.hwctl = NULL;
+ nand->ecc.correct = NULL;
+ nand->ecc.calculate = NULL;
+
/* Setup the ecc configurations again */
- if (!hardware) {
- nand->ecc.mode = NAND_ECC_SOFT;
- /* Use mtd default settings */
- nand->ecc.layout = NULL;
- } else {
+ if (hardware) {
nand->ecc.mode = NAND_ECC_HW;
nand->ecc.layout = &hw_nand_oob;
nand->ecc.size = 512;
@@ -269,6 +274,12 @@ void omap_nand_switch_ecc(int32_t hardwa
nand->ecc.correct = omap_correct_data;
nand->ecc.calculate = omap_calculate_ecc;
omap_hwecc_init(nand);
+ printf("HW ECC selected\n");
+ } else {
+ nand->ecc.mode = NAND_ECC_SOFT;
+ /* Use mtd default settings */
+ nand->ecc.layout = NULL;
+ printf("SW ECC selected\n");
}
/* Update NAND handling after ECC mode switch */
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch
2008-11-11 15:00 [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch dirk.behme at googlemail.com
2008-11-11 15:53 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2008-11-11 21:04 ` Scott Wood
1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2008-11-11 21:04 UTC (permalink / raw)
To: u-boot
dirk.behme at googlemail.com wrote:
> Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier
> reading.
Acked-by: Scott Wood <scottwood@freescale.com>
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch
2008-11-11 16:03 dirk.behme at googlemail.com
@ 2008-11-14 17:11 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 0 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2008-11-14 17:11 UTC (permalink / raw)
To: u-boot
On 17:03 Tue 11 Nov , dirk.behme at googlemail.com wrote:
> Fix broken NAND ECC HW switch and invert logic of if(!hardware) for easier
> reading.
>
> Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
>
> ---
> drivers/mtd/nand/omap_gpmc.c | 21 ++++++++++++++++-----
> 1 files changed, 16 insertions(+), 5 deletions(-)
>
Applied to u-boot-arm/omap
Best Regards,
J.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-11-14 17:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-11 15:00 [U-Boot] [PATCH-OMAP3] OMAP3: Fix broken NAND ECC HW switch dirk.behme at googlemail.com
2008-11-11 15:53 ` Jean-Christophe PLAGNIOL-VILLARD
2008-11-11 21:04 ` Scott Wood
-- strict thread matches above, loose matches on Subject: below --
2008-11-11 16:03 dirk.behme at googlemail.com
2008-11-14 17:11 ` Jean-Christophe PLAGNIOL-VILLARD
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox