Skip to content

Commit f552a7c

Browse files
bala-gunasundarmiquelraynal
authored andcommitted
mtd: rawnand: atmel: set pmecc data setup time
Setup the pmecc data setup time as 3 clock cycles for 133MHz as recommended by the datasheet. Fixes: f88fc12 ("mtd: nand: Cleanup/rework the atmel_nand driver") Reported-by: Zixun LI <[email protected]> Closes: https://lore.kernel.org/all/[email protected] Suggested-by: Ada Couprie Diaz <[email protected]> Signed-off-by: Balamanikandan Gunasundar <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 091d9e3 commit f552a7c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/mtd/nand/raw/atmel/pmecc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ struct atmel_pmecc_caps {
143143
int nstrengths;
144144
int el_offset;
145145
bool correct_erased_chunks;
146+
bool clk_ctrl;
146147
};
147148

148149
struct atmel_pmecc {
@@ -843,6 +844,10 @@ static struct atmel_pmecc *atmel_pmecc_create(struct platform_device *pdev,
843844
if (IS_ERR(pmecc->regs.errloc))
844845
return ERR_CAST(pmecc->regs.errloc);
845846

847+
/* pmecc data setup time */
848+
if (caps->clk_ctrl)
849+
writel(PMECC_CLK_133MHZ, pmecc->regs.base + ATMEL_PMECC_CLK);
850+
846851
/* Disable all interrupts before registering the PMECC handler. */
847852
writel(0xffffffff, pmecc->regs.base + ATMEL_PMECC_IDR);
848853
atmel_pmecc_reset(pmecc);
@@ -896,6 +901,7 @@ static struct atmel_pmecc_caps at91sam9g45_caps = {
896901
.strengths = atmel_pmecc_strengths,
897902
.nstrengths = 5,
898903
.el_offset = 0x8c,
904+
.clk_ctrl = true,
899905
};
900906

901907
static struct atmel_pmecc_caps sama5d4_caps = {

0 commit comments

Comments
 (0)