Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106434
b: refs/heads/master
c: d6248fd
h: refs/heads/master
v: v3
  • Loading branch information
Haavard Skinnemoen authored and David Woodhouse committed Jul 11, 2008
1 parent 458c379 commit 1723d78
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23a346ca4a5a6f50f81062456af955155f68e313
refs/heads/master: d6248fddf717041f25781050e6392cc76525272d
25 changes: 23 additions & 2 deletions trunk/drivers/mtd/nand/atmel_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <linux/io.h>

#include <asm/arch/board.h>
#include <asm/arch/cpu.h>

#ifdef CONFIG_MTD_NAND_ATMEL_ECC_HW
#define hard_ecc 1
Expand Down Expand Up @@ -264,6 +265,19 @@ static int atmel_nand_read_page(struct mtd_info *mtd,
uint8_t *ecc_pos;
int stat;

/*
* Errata: ALE is incorrectly wired up to the ECC controller
* on the AP7000, so it will include the address cycles in the
* ECC calculation.
*
* Workaround: Reset the parity registers before reading the
* actual data.
*/
if (cpu_is_at32ap7000()) {
struct atmel_nand_host *host = chip->priv;
ecc_writel(host->ecc, CR, ATMEL_ECC_RST);
}

/* read the page */
chip->read_buf(mtd, p, eccsize);

Expand Down Expand Up @@ -377,9 +391,16 @@ static int atmel_nand_correct(struct mtd_info *mtd, u_char *dat,
}

/*
* Enable HW ECC : unsused
* Enable HW ECC : unused on most chips
*/
static void atmel_nand_hwctl(struct mtd_info *mtd, int mode) { ; }
static void atmel_nand_hwctl(struct mtd_info *mtd, int mode)
{
if (cpu_is_at32ap7000()) {
struct nand_chip *nand_chip = mtd->priv;
struct atmel_nand_host *host = nand_chip->priv;
ecc_writel(host->ecc, CR, ATMEL_ECC_RST);
}
}

#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probes[] = { "cmdlinepart", NULL };
Expand Down

0 comments on commit 1723d78

Please sign in to comment.