mtd/include/linux/mtd cfi.h,1.32,1.33 map.h,1.29,1.30
David Woodhouse
dwmw2 at infradead.org
Wed May 14 11:05:20 EDT 2003
- Previous message: mtd/drivers/mtd/maps map_funcs.c,NONE,1.1 Config.in,1.47,1.48
GNUmakefile,1.9,1.10 Kconfig,1.6,1.7 Makefile,1.40,1.41
amd76xrom.c,1.3,1.4 arctic-mtd.c,1.4,1.5 autcpu12-nvram.c,1.1,1.2
beech-mtd.c,1.3,1.4 cdb89712.c,1.3,1.4 ceiva.c,1.3,1.4
cfi_flagadm.c,1.7,1.8 cstm_mips_ixx.c,1.5,1.6 dbox2-flash.c,1.5,1.6
dc21285.c,1.10,1.11 dilnetpc.c,1.8,1.9 ebony.c,1.3,1.4
edb7312.c,1.3,1.4 elan-104nc.c,1.13,1.14 epxa10db-flash.c,1.5,1.6
fortunet.c,1.2,1.3 h720x-flash.c,1.1,1.2 ich2rom.c,1.3,1.4
impa7.c,1.3,1.4 integrator-flash.c,1.8,1.9 iq80310.c,1.10,1.11
l440gx.c,1.8,1.9 lasat.c,1.1,1.2 lubbock-flash.c,1.2,1.3
mbx860.c,1.1,1.2 netsc520.c,1.5,1.6 nettel.c,1.1,1.2
ocelot.c,1.7,1.8 octagon-5066.c,1.20,1.21 pb1xxx-flash.c,1.4,1.5
pci.c,1.2,1.3 pcmciamtd.c,1.40,1.41 physmap.c,1.22,1.23
pnc2000.c,1.10,1.11 redwood.c,1.2,1.3 rpxlite.c,1.15,1.16
sa1100-flash.c,1.30,1.31 sbc_gxx.c,1.21,1.22 sc520cdp.c,1.11,1.12
scb2_flash.c,1.2,1.3 scx200_docflash.c,1.1,1.2
solutionengine.c,1.5,1.6 sun_uflash.c,1.4,1.5 tqm8xxl.c,1.4,1.5
tsunami_flash.c,1.1,1.2 uclinux.c,1.2,1.3 vmax301.c,1.24,1.25
physmap64.c,1.1,NONE
- Next message: mtd/drivers/mtd GNUmakefile,1.12,1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/include/linux/mtd
In directory phoenix.infradead.org:/tmp/cvs-serv26387/include/linux/mtd
Modified Files:
cfi.h map.h
Log Message:
Make support for non-linear mappings conditional
Index: cfi.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/cfi.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- cfi.h 5 Sep 2002 05:15:32 -0000 1.32
+++ cfi.h 14 May 2003 15:05:17 -0000 1.33
@@ -479,5 +479,4 @@
spin_unlock_bh(mutex);
}
-
#endif /* __MTD_CFI_H__ */
Index: map.h
===================================================================
RCS file: /home/cvs/mtd/include/linux/mtd/map.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- map.h 21 Oct 2002 13:20:52 -0000 1.29
+++ map.h 14 May 2003 15:05:17 -0000 1.30
@@ -9,6 +9,7 @@
#include <linux/types.h>
#include <linux/mtd/mtd.h>
#include <linux/slab.h>
+#include <asm/io.h>
/* The map stuff is very simple. You fill in your struct map_info with
a handful of routines for accessing the device, making sure they handle
@@ -29,39 +30,44 @@
struct map_info {
char *name;
unsigned long size;
+ unsigned long phys;
+#define NO_XIP (-1UL)
+
+ unsigned long virt;
+ void *cached;
+
int buswidth; /* in octets */
- __u8 (*read8)(struct map_info *, unsigned long);
- __u16 (*read16)(struct map_info *, unsigned long);
- __u32 (*read32)(struct map_info *, unsigned long);
- __u64 (*read64)(struct map_info *, unsigned long);
+
+#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
+ u8 (*read8)(struct map_info *, unsigned long);
+ u16 (*read16)(struct map_info *, unsigned long);
+ u32 (*read32)(struct map_info *, unsigned long);
+ u64 (*read64)(struct map_info *, unsigned long);
/* If it returned a 'long' I'd call it readl.
* It doesn't.
* I won't.
* dwmw2 */
void (*copy_from)(struct map_info *, void *, unsigned long, ssize_t);
- void (*write8)(struct map_info *, __u8, unsigned long);
- void (*write16)(struct map_info *, __u16, unsigned long);
- void (*write32)(struct map_info *, __u32, unsigned long);
- void (*write64)(struct map_info *, __u64, unsigned long);
+ void (*write8)(struct map_info *, u8, unsigned long);
+ void (*write16)(struct map_info *, u16, unsigned long);
+ void (*write32)(struct map_info *, u32, unsigned long);
+ void (*write64)(struct map_info *, u64, unsigned long);
void (*copy_to)(struct map_info *, unsigned long, const void *, ssize_t);
- u_char * (*point) (struct map_info *, loff_t, size_t);
- void (*unpoint) (struct map_info *, u_char *, loff_t, size_t);
-
+ /* We can perhaps put in 'point' and 'unpoint' methods, if we really
+ want to enable XIP for non-linear mappings. Not yet though. */
+#endif
+ /* set_vpp() must handle being reentered -- enable, enable, disable
+ must leave it enabled. */
void (*set_vpp)(struct map_info *, int);
- /* We put these two here rather than a single void *map_priv,
- because we want mappers to be able to have quickly-accessible
- cache for the 'currently-mapped page' without the _extra_
- redirection that would be necessary. If you need more than
- two longs, turn the second into a pointer. dwmw2 */
+
unsigned long map_priv_1;
unsigned long map_priv_2;
void *fldrv_priv;
struct mtd_chip_driver *fldrv;
};
-
struct mtd_chip_driver {
struct mtd_info *(*probe)(struct map_info *map);
void (*destroy)(struct mtd_info *);
@@ -95,5 +101,89 @@
#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
+
+#ifdef CONFIG_MTD_COMPLEX_MAPPINGS
+#define map_read8(map, ofs) (map)->read8(map, ofs)
+#define map_read16(map, ofs) (map)->read16(map, ofs)
+#define map_read32(map, ofs) (map)->read32(map, ofs)
+#define map_read64(map, ofs) (map)->read64(map, ofs)
+#define map_copy_from(map, to, from, len) (map)->copy_from(map, to, from, len)
+#define map_write8(map, datum, ofs) (map)->write8(map, datum, ofs)
+#define map_write16(map, datum, ofs) (map)->write16(map, datum, ofs)
+#define map_write32(map, datum, ofs) (map)->write32(map, datum, ofs)
+#define map_write64(map, datum, ofs) (map)->write64(map, datum, ofs)
+#define map_copy_to(map, to, from, len) (map)->copy_to(map, to, from, len)
+
+extern void simple_map_init(struct map_info *);
+#define map_is_linear(map) (map->phys != NO_XIP)
+
+#else
+static inline u8 map_read8(struct map_info *map, unsigned long ofs)
+{
+ return __raw_readb(map->virt + ofs);
+}
+
+static inline u16 map_read16(struct map_info *map, unsigned long ofs)
+{
+ return __raw_readw(map->virt + ofs);
+}
+
+static inline u32 map_read32(struct map_info *map, unsigned long ofs)
+{
+ return __raw_readl(map->virt + ofs);
+}
+
+static inline u64 map_read64(struct map_info *map, unsigned long ofs)
+{
+#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */
+ BUG();
+ return 0;
+#else
+ return __raw_readll(map->virt + ofs);
+#endif
+}
+
+static inline void map_write8(struct map_info *map, u8 datum, unsigned long ofs)
+{
+ __raw_writeb(datum, map->virt + ofs);
+ mb();
+}
+
+static inline void map_write16(struct map_info *map, u16 datum, unsigned long ofs)
+{
+ __raw_writew(datum, map->virt + ofs);
+ mb();
+}
+
+static inline void map_write32(struct map_info *map, u32 datum, unsigned long ofs)
+{
+ __raw_writel(datum, map->virt + ofs);
+ mb();
+}
+
+static inline void map_write64(struct map_info *map, u64 datum, unsigned long ofs)
+{
+#ifndef CONFIG_MTD_CFI_B8 /* 64-bit mappings */
+ BUG();
+#else
+ __raw_writell(datum, map->virt + ofs);
+ mb();
+#endif /* CFI_B8 */
+}
+
+static inline void map_copy_from(struct map_info *map, void *to, unsigned long from, ssize_t len)
+{
+ memcpy_fromio(to, map->virt + from, len);
+}
+
+static inline void map_copy_to(struct map_info *map, unsigned long to, const void *from, ssize_t len)
+{
+ memcpy_toio(map->virt + to, from, len);
+}
+
+#define simple_map_init(map) do { } while (0)
+#define map_is_linear(struct map_info *map) (1)
+
+#endif /* !CONFIG_COMPLEX_MAPPINGS */
#endif /* __LINUX_MTD_MAP_H__ */
- Previous message: mtd/drivers/mtd/maps map_funcs.c,NONE,1.1 Config.in,1.47,1.48
GNUmakefile,1.9,1.10 Kconfig,1.6,1.7 Makefile,1.40,1.41
amd76xrom.c,1.3,1.4 arctic-mtd.c,1.4,1.5 autcpu12-nvram.c,1.1,1.2
beech-mtd.c,1.3,1.4 cdb89712.c,1.3,1.4 ceiva.c,1.3,1.4
cfi_flagadm.c,1.7,1.8 cstm_mips_ixx.c,1.5,1.6 dbox2-flash.c,1.5,1.6
dc21285.c,1.10,1.11 dilnetpc.c,1.8,1.9 ebony.c,1.3,1.4
edb7312.c,1.3,1.4 elan-104nc.c,1.13,1.14 epxa10db-flash.c,1.5,1.6
fortunet.c,1.2,1.3 h720x-flash.c,1.1,1.2 ich2rom.c,1.3,1.4
impa7.c,1.3,1.4 integrator-flash.c,1.8,1.9 iq80310.c,1.10,1.11
l440gx.c,1.8,1.9 lasat.c,1.1,1.2 lubbock-flash.c,1.2,1.3
mbx860.c,1.1,1.2 netsc520.c,1.5,1.6 nettel.c,1.1,1.2
ocelot.c,1.7,1.8 octagon-5066.c,1.20,1.21 pb1xxx-flash.c,1.4,1.5
pci.c,1.2,1.3 pcmciamtd.c,1.40,1.41 physmap.c,1.22,1.23
pnc2000.c,1.10,1.11 redwood.c,1.2,1.3 rpxlite.c,1.15,1.16
sa1100-flash.c,1.30,1.31 sbc_gxx.c,1.21,1.22 sc520cdp.c,1.11,1.12
scb2_flash.c,1.2,1.3 scx200_docflash.c,1.1,1.2
solutionengine.c,1.5,1.6 sun_uflash.c,1.4,1.5 tqm8xxl.c,1.4,1.5
tsunami_flash.c,1.1,1.2 uclinux.c,1.2,1.3 vmax301.c,1.24,1.25
physmap64.c,1.1,NONE
- Next message: mtd/drivers/mtd GNUmakefile,1.12,1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list