2010-02-16 02:03:32 +08:00
|
|
|
/*
|
|
|
|
* Flash support for OMAP1
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/mtd/mtd.h>
|
|
|
|
#include <linux/mtd/map.h>
|
|
|
|
|
|
|
|
#include <plat/io.h>
|
|
|
|
#include <plat/tc.h>
|
2010-11-19 01:59:46 +08:00
|
|
|
#include <plat/flash.h>
|
2010-02-16 02:03:32 +08:00
|
|
|
|
2011-05-18 17:51:55 +08:00
|
|
|
void omap1_set_vpp(struct platform_device *pdev, int enable)
|
2010-02-16 02:03:32 +08:00
|
|
|
{
|
|
|
|
static int count;
|
|
|
|
u32 l;
|
|
|
|
|
|
|
|
if (enable) {
|
|
|
|
if (count++ == 0) {
|
|
|
|
l = omap_readl(EMIFS_CONFIG);
|
|
|
|
l |= OMAP_EMIFS_CONFIG_WP;
|
|
|
|
omap_writel(l, EMIFS_CONFIG);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (count && (--count == 0)) {
|
|
|
|
l = omap_readl(EMIFS_CONFIG);
|
|
|
|
l &= ~OMAP_EMIFS_CONFIG_WP;
|
|
|
|
omap_writel(l, EMIFS_CONFIG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|