]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Add support for TQM-specific chip select logic to FSL-UPM
authorWolfgang Grandegger <wg@grandegger.com>
Wed, 11 Feb 2009 17:38:22 +0000 (18:38 +0100)
committerScott Wood <scottwood@freescale.com>
Mon, 23 Mar 2009 20:53:39 +0000 (15:53 -0500)
For the NAND chips on the TQM8548 modules, a special chip-select logic is
used. It uses dedicated address lines to be set via UPM machine address
register (mar). This patch adds such support to the FSL-UPM driver.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>
drivers/mtd/nand/fsl_upm.c
include/linux/mtd/fsl_upm.h

index 73abbbad1f0370ba879ddf0b1db743f5c3afb915..e7e746b550d6a57c7dd9c34b76d0c643603d874f 100644 (file)
@@ -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);
 
index ada11c1a09a66ea4259a6f10133c955c7eb75cdf..10f5ddd87f55a94dfd5557a17ba5f4ff243158b8 100644 (file)
@@ -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;