Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * linux/arch/arm/mach-omap1/board-nand.c
0004  *
0005  * Common OMAP1 board NAND code
0006  *
0007  * Copyright (C) 2004, 2012 Texas Instruments, Inc.
0008  * Copyright (C) 2002 MontaVista Software, Inc.
0009  * Copyright (C) 2001 RidgeRun, Inc.
0010  * Author: RidgeRun, Inc.
0011  *         Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
0012  */
0013 #include <linux/kernel.h>
0014 #include <linux/io.h>
0015 #include <linux/mtd/mtd.h>
0016 #include <linux/mtd/rawnand.h>
0017 
0018 #include "common.h"
0019 
0020 void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd, unsigned int ctrl)
0021 {
0022     unsigned long mask;
0023 
0024     if (cmd == NAND_CMD_NONE)
0025         return;
0026 
0027     mask = (ctrl & NAND_CLE) ? 0x02 : 0;
0028     if (ctrl & NAND_ALE)
0029         mask |= 0x04;
0030 
0031     writeb(cmd, this->legacy.IO_ADDR_W + mask);
0032 }
0033