summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/nand/fsl_upm.c5
-rw-r--r--include/linux/mtd/fsl_upm.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index 73abbbad1..e7e746b55 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -90,8 +90,11 @@ static void fun_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
mar = cmd << (32 - fun->width);
io_addr = fun->upm.io_addr;
#if CONFIG_SYS_NAND_MAX_CHIPS > 1
- if (fun->chip_nr > 0)
+ if (fun->chip_nr > 0) {
io_addr += fun->chip_offset * fun->chip_nr;
+ if (fun->upm_mar_chip_offset)
+ mar |= fun->upm_mar_chip_offset * fun->chip_nr;
+ }
#endif
fsl_upm_run_pattern(&fun->upm, fun->width, io_addr, mar);
diff --git a/include/linux/mtd/fsl_upm.h b/include/linux/mtd/fsl_upm.h
index ada11c1a0..10f5ddd87 100644
--- a/include/linux/mtd/fsl_upm.h
+++ b/include/linux/mtd/fsl_upm.h
@@ -28,6 +28,7 @@ struct fsl_upm_nand {
int width;
int upm_cmd_offset;
int upm_addr_offset;
+ int upm_mar_chip_offset;
int wait_pattern;
int (*dev_ready)(int chip_nr);
int chip_delay;