Commit 076c7f4c authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by David Woodhouse

[MTD] [NAND] tmio_nand: fix base address programming

Fix offset of second word used for programming base address of memory
window. Also program tmio with offset of the FCR, not with physical
memory location.
Signed-off-by: default avatarDmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Ian Molton <spyro@f2s.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent b380b0d4
...@@ -109,7 +109,7 @@ struct tmio_nand { ...@@ -109,7 +109,7 @@ struct tmio_nand {
void __iomem *ccr; void __iomem *ccr;
void __iomem *fcr; void __iomem *fcr;
unsigned long fcr_phys; unsigned long fcr_base;
unsigned int irq; unsigned int irq;
...@@ -316,8 +316,8 @@ static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio) ...@@ -316,8 +316,8 @@ static int tmio_hw_init(struct platform_device *dev, struct tmio_nand *tmio)
tmio_iowrite8(0x81, tmio->ccr + CCR_ICC); tmio_iowrite8(0x81, tmio->ccr + CCR_ICC);
/* (10h)BaseAddress 0x1000 spba.spba2 */ /* (10h)BaseAddress 0x1000 spba.spba2 */
tmio_iowrite16(tmio->fcr_phys, tmio->ccr + CCR_BASE); tmio_iowrite16(tmio->fcr_base, tmio->ccr + CCR_BASE);
tmio_iowrite16(tmio->fcr_phys >> 16, tmio->ccr + CCR_BASE + 16); tmio_iowrite16(tmio->fcr_base >> 16, tmio->ccr + CCR_BASE + 2);
/* (04h)Command Register I/O spcmd */ /* (04h)Command Register I/O spcmd */
tmio_iowrite8(0x02, tmio->ccr + CCR_COMMAND); tmio_iowrite8(0x02, tmio->ccr + CCR_COMMAND);
...@@ -395,7 +395,7 @@ static int tmio_probe(struct platform_device *dev) ...@@ -395,7 +395,7 @@ static int tmio_probe(struct platform_device *dev)
goto err_iomap_ccr; goto err_iomap_ccr;
} }
tmio->fcr_phys = (unsigned long)fcr->start; tmio->fcr_base = fcr->start & 0xfffff;
tmio->fcr = ioremap(fcr->start, fcr->end - fcr->start + 1); tmio->fcr = ioremap(fcr->start, fcr->end - fcr->start + 1);
if (!tmio->fcr) { if (!tmio->fcr) {
retval = -EIO; retval = -EIO;
......
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