Commit 01e62edc authored by Ivaylo Dimitrov's avatar Ivaylo Dimitrov Committed by Kamal Mostafa

ARM: OMAP2+: Fix onenand initialization to avoid filesystem corruption

commit 3f315c5b upstream.

Commit e7b11dc7 ("ARM: OMAP2+: Fix onenand rate detection to avoid
filesystem corruption") partially fixed onenand configuration when GPMC
module is reset. Finish the job by also providing the correct values in
ONENAND_REG_SYS_CFG1 register.

Fixes: e7b11dc7 ("ARM: OMAP2+: Fix onenand rate detection to avoid
filesystem corruption")
Signed-off-by: default avatarIvaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Tested-by: default avatarAaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 564a440a
...@@ -101,10 +101,8 @@ static void omap2_onenand_set_async_mode(void __iomem *onenand_base) ...@@ -101,10 +101,8 @@ static void omap2_onenand_set_async_mode(void __iomem *onenand_base)
static void set_onenand_cfg(void __iomem *onenand_base) static void set_onenand_cfg(void __iomem *onenand_base)
{ {
u32 reg; u32 reg = ONENAND_SYS_CFG1_RDY | ONENAND_SYS_CFG1_INT;
reg = readw(onenand_base + ONENAND_REG_SYS_CFG1);
reg &= ~((0x7 << ONENAND_SYS_CFG1_BRL_SHIFT) | (0x7 << 9));
reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) | reg |= (latency << ONENAND_SYS_CFG1_BRL_SHIFT) |
ONENAND_SYS_CFG1_BL_16; ONENAND_SYS_CFG1_BL_16;
if (onenand_flags & ONENAND_FLAG_SYNCREAD) if (onenand_flags & ONENAND_FLAG_SYNCREAD)
...@@ -123,6 +121,7 @@ static void set_onenand_cfg(void __iomem *onenand_base) ...@@ -123,6 +121,7 @@ static void set_onenand_cfg(void __iomem *onenand_base)
reg |= ONENAND_SYS_CFG1_VHF; reg |= ONENAND_SYS_CFG1_VHF;
else else
reg &= ~ONENAND_SYS_CFG1_VHF; reg &= ~ONENAND_SYS_CFG1_VHF;
writew(reg, onenand_base + ONENAND_REG_SYS_CFG1); writew(reg, onenand_base + ONENAND_REG_SYS_CFG1);
} }
...@@ -289,6 +288,7 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base) ...@@ -289,6 +288,7 @@ static int omap2_onenand_setup_async(void __iomem *onenand_base)
} }
} }
onenand_async.sync_write = true;
omap2_onenand_calc_async_timings(&t); omap2_onenand_calc_async_timings(&t);
ret = gpmc_cs_program_settings(gpmc_onenand_data->cs, &onenand_async); ret = gpmc_cs_program_settings(gpmc_onenand_data->cs, &onenand_async);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment