Skip to contentSkip to conversation

NAND update

PATCH New William Juul 1 participant 1 message Nov 12, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 6/9 NAND update

Here is some of the changes made in include/

Note that the patch-series is broken unless it is seen as one single patch. It is broken up to multiple emails to fit the size limit.

We have set up a git repository were you can pull the complete patch:
http://git.tandberg.com/tandberg/u-boot.git

Best regards
William

-------------------------------------------------
William Juul, Senior Development Engineer
Data Respons Norge AS
Sandviksveien 26
P.O. Box 489
NO-1323 H?vik, Norway

www.datarespons.no
-------------------------------------------------

include/common.h +2 -0
index aca281b..b0aad92 100644
@@ -124,11 +124,13 @@ typedef volatile unsigned char	vu_char;
 #define debugX(level,fmt,args...)
 #endif	/* DEBUG */
 
+#ifndef BUG
 #define BUG() do { \
 	printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \
 	panic("BUG!"); \
 } while (0)
 #define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+#endif /* BUG */
 
 typedef void (interrupt_handler_t)(void *);
 
include/linux/err.h new file +45 -0

45 lines not on this page · raw message

include/linux/mtd/blktrans.h new file +81 -0

81 lines not on this page · raw message

include/linux/mtd/compat.h +6 -1
index fe55087..9036b74 100644
@@ -18,7 +18,12 @@
 #define KERN_DEBUG
 
 #define kmalloc(size, flags)	malloc(size)
-#define kfree(ptr)		free(ptr)
+#define kzalloc(size, flags)	calloc(size, 1)
+#define vmalloc(size)			malloc(size)
+#define kfree(ptr)				free(ptr)
+#define vfree(ptr)				free(ptr)
+
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
 
 /*
  * ..and if you can't take the strict
include/linux/mtd/doc2000.h +105 -112

283 lines not on this page · raw message

include/linux/mtd/inftl-user.h new file +91 -0

91 lines not on this page · raw message

include/linux/mtd/jffs2-user.h new file +35 -0
new file mode 100644
index 0000000..d508ef0
@@ -0,0 +1,35 @@
+/*
+ * $Id: jffs2-user.h,v 1.1 2004/05/05 11:57:54 dwmw2 Exp $
+ *
+ * JFFS2 definitions for use in user space only
+ */
+
+#ifndef __JFFS2_USER_H__
+#define __JFFS2_USER_H__
+
+/* This file is blessed for inclusion by userspace */
+#include <linux/jffs2.h>
+#include <endian.h>
+#include <byteswap.h>
+
+#undef cpu_to_je16
+#undef cpu_to_je32
+#undef cpu_to_jemode
+#undef je16_to_cpu
+#undef je32_to_cpu
+#undef jemode_to_cpu
+
+extern int target_endian;
+
+#define t16(x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
+#define t32(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
+
+#define cpu_to_je16(x) ((jint16_t){t16(x)})
+#define cpu_to_je32(x) ((jint32_t){t32(x)})
+#define cpu_to_jemode(x) ((jmode_t){t32(x)})
+
+#define je16_to_cpu(x) (t16((x).v16))
+#define je32_to_cpu(x) (t32((x).v32))
+#define jemode_to_cpu(x) (t32((x).m))
+
+#endif /* __JFFS2_USER_H__ */
include/nand.h +2 -1
index 3c0752e..67dedbe 100644
@@ -82,6 +82,7 @@ struct nand_write_options {
 };
 
 typedef struct nand_write_options nand_write_options_t;
+typedef struct mtd_oob_ops mtd_oob_ops_t;
 
 struct nand_read_options {
 	u_char *buffer;		/* memory block in which read image is written*/
@@ -105,7 +106,7 @@ struct nand_erase_options {
 
 typedef struct nand_erase_options nand_erase_options_t;
 
-int nand_write_opts(nand_info_t *meminfo, const nand_write_options_t *opts);
+int nand_write_opts(nand_info_t *mtd, loff_t to, mtd_oob_ops_t *ops);
 
 int nand_read_opts(nand_info_t *meminfo, const nand_read_options_t *opts);
 int nand_erase_opts(nand_info_t *meminfo, const nand_erase_options_t *opts);
include/linux/mtd/mtd-abi.h +97 -40

185 lines not on this page · raw message

include/linux/mtd/mtd.h +103 -51

262 lines not on this page · raw message