blob: 20923eb2d9b6bae15efebce2b9971429d568b822 [file] [log] [blame]
Paul Walmsley31cde042012-04-13 06:34:31 -06001/*
2 * linux/arch/arm/mach-omap1/board-nand.c
3 *
4 * Common OMAP1 board NAND code
5 *
6 * Copyright (C) 2004, 2012 Texas Instruments, Inc.
7 * Copyright (C) 2002 MontaVista Software, Inc.
8 * Copyright (C) 2001 RidgeRun, Inc.
9 * Author: RidgeRun, Inc.
10 * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16#include <linux/kernel.h>
17#include <linux/io.h>
18#include <linux/mtd/mtd.h>
Boris Brezillond4092d72017-08-04 17:29:10 +020019#include <linux/mtd/rawnand.h>
Paul Walmsley31cde042012-04-13 06:34:31 -060020
21#include "common.h"
22
Boris Brezillon47bd59e2018-09-06 14:05:13 +020023void omap1_nand_cmd_ctl(struct nand_chip *this, int cmd, unsigned int ctrl)
Paul Walmsley31cde042012-04-13 06:34:31 -060024{
Paul Walmsley31cde042012-04-13 06:34:31 -060025 unsigned long mask;
26
27 if (cmd == NAND_CMD_NONE)
28 return;
29
30 mask = (ctrl & NAND_CLE) ? 0x02 : 0;
31 if (ctrl & NAND_ALE)
32 mask |= 0x04;
33
Boris Brezillon82fc5092018-09-07 00:38:34 +020034 writeb(cmd, this->legacy.IO_ADDR_W + mask);
Paul Walmsley31cde042012-04-13 06:34:31 -060035}
36