public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexander Holler <holler@ahsoftware.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] Fix compile errors for atmel_nand with hw-ecc and new SoC access
Date: Sat,  3 Apr 2010 13:08:07 +0200	[thread overview]
Message-ID: <1270292887-4873-3-git-send-email-holler@ahsoftware.de> (raw)
In-Reply-To: <1270292887-4873-2-git-send-email-holler@ahsoftware.de>

atmel_nand.c with HW-ECC doesn't compile with the new SoC access.
Using CONFIG_AT91_LEGACY to circumvent the compile errors only leaves
the driver in a state where it doesn't find the NAND.

To use HW-ECC with atmel_nand one has to use
CONFIG_SYS_NAND_ECC_BASE AT91_ECC0_BASE (instead of AT91_ECC0)
for an AT91SAM9263 or AT91_ECC_BASE for an AT91SAM9260.

I've removed three unused variables too.

Signed-off-by: Alexander Holler <holler@ahsoftware.de>
---
 drivers/mtd/nand/atmel_nand.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index d5eb54a..5f10a02 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -35,9 +35,9 @@
 
 /* Register access macros */
 #define ecc_readl(add, reg)				\
-	readl(AT91_BASE_SYS + add + ATMEL_ECC_##reg)
+	readl(add + ATMEL_ECC_##reg)
 #define ecc_writel(add, reg, value)			\
-	writel((value), AT91_BASE_SYS + add + ATMEL_ECC_##reg)
+	writel((value), add + ATMEL_ECC_##reg)
 
 #include "atmel_nand_ecc.h"	/* Hardware ECC registers */
 
@@ -79,7 +79,6 @@ static struct nand_ecclayout atmel_oobinfo_small = {
 static int atmel_nand_calculate(struct mtd_info *mtd,
 		const u_char *dat, unsigned char *ecc_code)
 {
-	struct nand_chip *nand_chip = mtd->priv;
 	unsigned int ecc_value;
 
 	/* get the first 2 ECC bytes */
@@ -167,7 +166,7 @@ static int atmel_nand_correct(struct mtd_info *mtd, u_char *dat,
 		u_char *read_ecc, u_char *isnull)
 {
 	struct nand_chip *nand_chip = mtd->priv;
-	unsigned int ecc_status, ecc_parity, ecc_mode;
+	unsigned int ecc_status;
 	unsigned int ecc_word, ecc_bit;
 
 	/* get the status from the Status Register */
-- 
1.6.2.5

  reply	other threads:[~2010-04-03 11:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18  6:55 [U-Boot] [PATH] at91: add hwecc method for nand Nikolay Petukhov
2010-03-18 22:46 ` Scott Wood
2010-03-19  5:49   ` Nikolay Petukhov
2010-03-19 22:17     ` Scott Wood
2010-03-28 12:42       ` [U-Boot] [PATCH 0/2] atmel_nand with HW-ECC Alexander Holler
2010-03-28 12:42         ` [U-Boot] [PATCH 1/2] Add AT91_ECC_BASE to at91sam9260.h to use " Alexander Holler
2010-03-28 12:42           ` [U-Boot] [PATCH 2/2] Fix compile errors for atmel_nand with hw-ecc and new SoC access Alexander Holler
2010-04-02 16:38             ` Scott Wood
2010-04-03 11:08               ` Alexander Holler
2010-04-03 11:08                 ` [U-Boot] [PATCH 1/2] Add AT91_ECC_BASE to at91sam9260.h to use atmel_nand with HW-ECC Alexander Holler
2010-04-03 11:08                   ` Alexander Holler [this message]
2010-04-04 16:26             ` [U-Boot] [PATCH 2/2] Fix compile errors for atmel_nand with hw-ecc and new SoC access Tom
2010-04-04 17:26               ` Alexander Holler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1270292887-4873-3-git-send-email-holler@ahsoftware.de \
    --to=holler@ahsoftware.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox