summaryrefslogtreecommitdiff
path: root/include/linux/mtd/map.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2005-02-08 17:11:19 +0000
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 12:25:23 +0200
commitf77814dd5728edaf1239d19755d2aa0d8c33d861 (patch)
tree5cf7f73aa367bf152e5fbd16b5173e18bb787dd5 /include/linux/mtd/map.h
parent67d9e95c393d23c229836e28b262dc73d71da784 (diff)
[MTD] Support for protection register support on Intel FLASH chips
This enables support for reading, writing and locking so called "Protection Registers" present on some flash chips. A subset of them are pre-programmed at the factory with a unique set of values. The rest is user-programmable. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/mtd/map.h')
-rw-r--r--include/linux/mtd/map.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index f0268b99c900..8fc6679aa9b1 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -1,6 +1,6 @@
/* Overhauled routines for dealing with different mmap regions of flash */
-/* $Id: map.h,v 1.46 2005/01/05 17:09:44 dwmw2 Exp $ */
+/* $Id: map.h,v 1.47 2005/02/08 17:11:15 nico Exp $ */
#ifndef __LINUX_MTD_MAP_H__
#define __LINUX_MTD_MAP_H__
@@ -263,6 +263,17 @@ static inline map_word map_word_and(struct map_info *map, map_word val1, map_wor
return r;
}
+static inline map_word map_word_clr(struct map_info *map, map_word val1, map_word val2)
+{
+ map_word r;
+ int i;
+
+ for (i=0; i<map_words(map); i++) {
+ r.x[i] = val1.x[i] & ~val2.x[i];
+ }
+ return r;
+}
+
static inline map_word map_word_or(struct map_info *map, map_word val1, map_word val2)
{
map_word r;
@@ -273,6 +284,7 @@ static inline map_word map_word_or(struct map_info *map, map_word val1, map_word
}
return r;
}
+
#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
static inline int map_word_bitsset(struct map_info *map, map_word val1, map_word val2)
@@ -338,6 +350,7 @@ static inline map_word map_word_ff(struct map_info *map)
}
return r;
}
+
static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
{
map_word r;