Skip to contentSkip to conversation

Add support for TQM-specific chip select logic to UPM-FSL

PATCH Superseded Wolfgang Grandegger 1 participant 1 message Jan 7, 2009

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 Add support for TQM-specific chip select logic to UPM-FSL

For the NAND chips on the TQM8548 modules, a special chip-select logic is used. It uses dedicated address lines to be controlled via UPM machine address register (mar). This patch adds corresponding support to the FSL-UPM driver.

---
 drivers/mtd/nand/fsl_upm.c  |    5 ++++-
 include/linux/mtd/fsl_upm.h |    1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/mtd/nand/fsl_upm.c +4 -1
Index: u-boot/drivers/mtd/nand/fsl_upm.c
===================================================================
@@ -90,8 +90,11 @@ static void fun_cmd_ctrl(struct mtd_info
 	mar = cmd << (32 - fun->width);
 	io_addr = fun->upm.io_addr;
 #if 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);
 
include/linux/mtd/fsl_upm.h +1 -0
Index: u-boot/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;