
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h index 3d91e99..f8eca87 100644 --- a/include/config_cmd_all.h +++ b/include/config_cmd_all.h @@ -59,6 +59,7 @@ #define CONFIG_CMD_NAND /* NAND support */ #define CONFIG_CMD_NET /* bootp, tftpboot, rarpboot */ #define CONFIG_CMD_NFS /* NFS support */ +#define CONFIG_CMD_ONENAND /* OneNAND support */
NAK.
CONFIG_CMD_ONENAND is definitely NOT a candiate for config_cmd_all.h
No problem. I just add it as comments in "config_cmd_all" file. "Alphabetical list of all possible commands."
+++ b/include/onenand_uboot.h
...
+#define DEBUG_LEVEL 2
This should probably be 0 for production code?
+#ifdef ONENAND_DEBUG +#define DEBUG(level, args...) \ +do { \
- if (level <= DEBUG_LEVEL) { \
printf(args); \
- } \
+} while (0) +#else +#define DEBUG(level, args...) do { } while (0) +#endif
Please do not reinvent yoru own debug macros, please use the existing ones instead.
After new NAND implementation, there are required macro and filed. I added <linux/mtd/compat.h> and <linux/mtd/mtd.h> headers at required files
Others such as spinlock, wait_queue_head_t are typedef-ed. In NAND case, it disabled it by "if 0". And kvec also will be removed at next code update.
Thank you, Kyungmin Park
#ifndef __UBOOT_ONENAND_H #define __UBOOT_ONENAND_H
struct kvec { void *iov_base; size_t iov_len; };
typedef int spinlock_t; typedef int wait_queue_head_t;
/* Functions */ extern void onenand_init(void); extern int onenand_read(struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, u_char * buf); extern int onenand_read_oob(struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, u_char * buf); extern int onenand_write(struct mtd_info *mtd, loff_t from, size_t len, size_t * retlen, const u_char * buf); extern int onenand_erase(struct mtd_info *mtd, struct erase_info *instr);
extern int onenand_unlock(struct mtd_info *mtd, loff_t ofs, size_t len);
extern void onenand_print_device_info(int device, int verbose);
#endif /* __UBOOT_ONENAND_H */