blob: 40e43ce5329f55f2e691df5dd6e8fad99810aec9 [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Ladislav Michl561b0362010-02-15 10:03:32 -08002/*
3 * Flash support for OMAP1
Ladislav Michl561b0362010-02-15 10:03:32 -08004 */
5
Tony Lindgren2e3ee9f2012-02-24 10:34:34 -08006#include <linux/io.h>
Ladislav Michl561b0362010-02-15 10:03:32 -08007#include <linux/mtd/mtd.h>
8#include <linux/mtd/map.h>
9
Tony Lindgren54b693d2012-10-02 13:39:28 -070010#include <mach/tc.h>
Arnd Bergmann100f9632015-01-30 10:45:33 +010011#include "flash.h"
Ladislav Michl561b0362010-02-15 10:03:32 -080012
Tony Lindgren2c799ce2012-02-24 10:34:35 -080013#include <mach/hardware.h>
14
Marc Zyngier667f3902011-05-18 10:51:55 +010015void omap1_set_vpp(struct platform_device *pdev, int enable)
Ladislav Michl561b0362010-02-15 10:03:32 -080016{
Ladislav Michl561b0362010-02-15 10:03:32 -080017 u32 l;
18
Paul Parsons876fe762012-03-07 14:12:08 +000019 l = omap_readl(EMIFS_CONFIG);
20 if (enable)
21 l |= OMAP_EMIFS_CONFIG_WP;
22 else
23 l &= ~OMAP_EMIFS_CONFIG_WP;
24 omap_writel(l, EMIFS_CONFIG);
Ladislav Michl561b0362010-02-15 10:03:32 -080025}