/*1* Flash support for OMAP12*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License version 2 as5* published by the Free Software Foundation.6*/78#include <linux/mtd/mtd.h>9#include <linux/mtd/map.h>1011#include <plat/io.h>12#include <plat/tc.h>13#include <plat/flash.h>1415void omap1_set_vpp(struct platform_device *pdev, int enable)16{17static int count;18u32 l;1920if (enable) {21if (count++ == 0) {22l = omap_readl(EMIFS_CONFIG);23l |= OMAP_EMIFS_CONFIG_WP;24omap_writel(l, EMIFS_CONFIG);25}26} else {27if (count && (--count == 0)) {28l = omap_readl(EMIFS_CONFIG);29l &= ~OMAP_EMIFS_CONFIG_WP;30omap_writel(l, EMIFS_CONFIG);31}32}33}343536