Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 298143
b: refs/heads/master
c: 0b3f0d1
h: refs/heads/master
i:
  298141: 8f8de77
  298139: d37df01
  298135: ee873c1
  298127: 644a4de
  298111: 5910f13
v: v3
  • Loading branch information
Bastian Hecht authored and David Woodhouse committed Mar 26, 2012
1 parent 77a088f commit b4a8762
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 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: dd5ab248329edab4b16b70e4d9920f162d181d90
refs/heads/master: 0b3f0d12eff1ed23496fcf4cf468e1d317516e53
22 changes: 7 additions & 15 deletions trunk/drivers/mtd/nand/sh_flctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static void write_fiforeg(struct sh_flctl *flctl, int rlen, int offset)
static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_val)
{
struct sh_flctl *flctl = mtd_to_flctl(mtd);
uint32_t flcmncr_val = readl(FLCMNCR(flctl)) & ~SEL_16BIT;
uint32_t flcmncr_val = flctl->flcmncr_base & ~SEL_16BIT;
uint32_t flcmdcr_val, addr_len_bytes = 0;

/* Set SNAND bit if page size is 2048byte */
Expand Down Expand Up @@ -684,16 +684,15 @@ static void flctl_cmdfunc(struct mtd_info *mtd, unsigned int command,
static void flctl_select_chip(struct mtd_info *mtd, int chipnr)
{
struct sh_flctl *flctl = mtd_to_flctl(mtd);
uint32_t flcmncr_val = readl(FLCMNCR(flctl));

switch (chipnr) {
case -1:
flcmncr_val &= ~CE0_ENABLE;
writel(flcmncr_val, FLCMNCR(flctl));
flctl->flcmncr_base &= ~CE0_ENABLE;
writel(flctl->flcmncr_base, FLCMNCR(flctl));
break;
case 0:
flcmncr_val |= CE0_ENABLE;
writel(flcmncr_val, FLCMNCR(flctl));
flctl->flcmncr_base |= CE0_ENABLE;
writel(flctl->flcmncr_base, FLCMNCR(flctl));
break;
default:
BUG();
Expand Down Expand Up @@ -751,11 +750,6 @@ static int flctl_verify_buf(struct mtd_info *mtd, const u_char *buf, int len)
return 0;
}

static void flctl_register_init(struct sh_flctl *flctl, unsigned long val)
{
writel(val, FLCMNCR(flctl));
}

static int flctl_chip_init_tail(struct mtd_info *mtd)
{
struct sh_flctl *flctl = mtd_to_flctl(mtd);
Expand Down Expand Up @@ -807,8 +801,7 @@ static int flctl_chip_init_tail(struct mtd_info *mtd)
chip->ecc.mode = NAND_ECC_HW;

/* 4 symbols ECC enabled */
writel(readl(FLCMNCR(flctl)) | _4ECCEN | ECCPOS2 | ECCPOS_02,
FLCMNCR(flctl));
flctl->flcmncr_base |= _4ECCEN | ECCPOS2 | ECCPOS_02;
} else {
chip->ecc.mode = NAND_ECC_SOFT;
}
Expand Down Expand Up @@ -854,10 +847,9 @@ static int __devinit flctl_probe(struct platform_device *pdev)
nand = &flctl->chip;
flctl_mtd->priv = nand;
flctl->pdev = pdev;
flctl->flcmncr_base = pdata->flcmncr_val;
flctl->hwecc = pdata->has_hwecc;

flctl_register_init(flctl, pdata->flcmncr_val);

nand->options = NAND_NO_AUTOINCR;

/* Set address of hardware control function */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mtd/sh_flctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ struct sh_flctl {
int erase1_page_addr; /* page_addr in ERASE1 cmd */
uint32_t erase_ADRCNT; /* bits of FLCMDCR in ERASE1 cmd */
uint32_t rw_ADRCNT; /* bits of FLCMDCR in READ WRITE cmd */
uint32_t flcmncr_base; /* base value of FLCMNCR */

int hwecc_cant_correct[4];

Expand Down

0 comments on commit b4a8762

Please sign in to comment.