Replace yaffs2 with new version
cover Replace yaffs2 with new version
This patch set replaces fs/yaffs2 with a new version.
This new version is faster and also adds the ability to dynamically add yaffs2 mount points which makes configuration far simpler.
-- Charles
PATCH 1/2 Blow away old yaffs2 code
--- fs/yaffs2/Makefile | 48 - fs/yaffs2/README-linux | 201 -- fs/yaffs2/devextras.h | 275 -- fs/yaffs2/yaffs_checkptrw.c | 405 --- fs/yaffs2/yaffs_checkptrw.h | 34 - fs/yaffs2/yaffs_ecc.c | 333 -- fs/yaffs2/yaffs_ecc.h | 44 - fs/yaffs2/yaffs_flashif.h | 31 - fs/yaffs2/yaffs_guts.c | 7329 ---------------------------------------- fs/yaffs2/yaffs_guts.h | 908 ----- fs/yaffs2/yaffs_malloc.h | 25 - fs/yaffs2/yaffs_mtdif.c | 246 -- fs/yaffs2/yaffs_mtdif.h | 27 - fs/yaffs2/yaffs_mtdif2.c | 235 -- fs/yaffs2/yaffs_mtdif2.h | 29 - fs/yaffs2/yaffs_nand.c | 134 - fs/yaffs2/yaffs_nand.h | 43 - fs/yaffs2/yaffs_nandemul2k.h | 39 - fs/yaffs2/yaffs_packedtags1.c | 55 - fs/yaffs2/yaffs_packedtags1.h | 37 - fs/yaffs2/yaffs_packedtags2.c | 185 - fs/yaffs2/yaffs_packedtags2.h | 38 - fs/yaffs2/yaffs_qsort.c | 163 - fs/yaffs2/yaffs_qsort.h | 23 - fs/yaffs2/yaffs_ramdisk.h | 32 - fs/yaffs2/yaffs_tagscompat.c | 532 --- fs/yaffs2/yaffs_tagscompat.h | 40 - fs/yaffs2/yaffs_tagsvalidity.c | 31 - fs/yaffs2/yaffs_tagsvalidity.h | 24 - fs/yaffs2/yaffscfg.c | 420 --- fs/yaffs2/yaffscfg.h | 45 - fs/yaffs2/yaffsfs.c | 1510 --------- fs/yaffs2/yaffsfs.h | 231 -- fs/yaffs2/yaffsinterface.h | 21 - fs/yaffs2/ydirectenv.h | 92 - fs/yaffs2/yportenv.h | 193 -- 36 files changed, 0 insertions(+), 14058 deletions(-) delete mode 100644 fs/yaffs2/Makefile delete mode 100644 fs/yaffs2/README-linux delete mode 100644 fs/yaffs2/devextras.h delete mode 100644 fs/yaffs2/yaffs_checkptrw.c delete mode 100644 fs/yaffs2/yaffs_checkptrw.h delete mode 100644 fs/yaffs2/yaffs_ecc.c delete mode 100644 fs/yaffs2/yaffs_ecc.h delete mode 100644 fs/yaffs2/yaffs_flashif.h delete mode 100644 fs/yaffs2/yaffs_guts.c delete mode 100644 fs/yaffs2/yaffs_guts.h delete mode 100644 fs/yaffs2/yaffs_malloc.h delete mode 100644 fs/yaffs2/yaffs_mtdif.c delete mode 100644 fs/yaffs2/yaffs_mtdif.h delete mode 100644 fs/yaffs2/yaffs_mtdif2.c delete mode 100644 fs/yaffs2/yaffs_mtdif2.h delete mode 100644 fs/yaffs2/yaffs_nand.c delete mode 100644 fs/yaffs2/yaffs_nand.h delete mode 100644 fs/yaffs2/yaffs_nandemul2k.h delete mode 100644 fs/yaffs2/yaffs_packedtags1.c delete mode 100644 fs/yaffs2/yaffs_packedtags1.h delete mode 100644 fs/yaffs2/yaffs_packedtags2.c delete mode 100644 fs/yaffs2/yaffs_packedtags2.h delete mode 100644 fs/yaffs2/yaffs_qsort.c delete mode 100644 fs/yaffs2/yaffs_qsort.h delete mode 100644 fs/yaffs2/yaffs_ramdisk.h delete mode 100644 fs/yaffs2/yaffs_tagscompat.c delete mode 100644 fs/yaffs2/yaffs_tagscompat.h delete mode 100644 fs/yaffs2/yaffs_tagsvalidity.c delete mode 100644 fs/yaffs2/yaffs_tagsvalidity.h delete mode 100644 fs/yaffs2/yaffscfg.c delete mode 100644 fs/yaffs2/yaffscfg.h delete mode 100644 fs/yaffs2/yaffsfs.c delete mode 100644 fs/yaffs2/yaffsfs.h delete mode 100644 fs/yaffs2/yaffsinterface.h delete mode 100644 fs/yaffs2/ydirectenv.h delete mode 100644 fs/yaffs2/yportenv.h
fs/yaffs2/Makefile deleted +0 -48
@@ -1,48 +0,0 @@ -# Makefile for YAFFS direct test -# -# -# YAFFS: Yet another Flash File System. A NAND-flash specific file system. -# -# Copyright (C) 2003 Aleph One Ltd. -# -# -# Created by Charles Manning <[email protected]> -# -# 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. -# -# NB Warning this Makefile does not include header dependencies. -# -# $Id: Makefile,v 1.15 2007/07/18 19:40:38 charles Exp $ - -#EXTRA_COMPILE_FLAGS = -DYAFFS_IGNORE_TAGS_ECC -include $(TOPDIR)/config.mk - -LIB = $(obj)libyaffs2.o - -COBJS-$(CONFIG_YAFFS2) := \ - yaffscfg.o yaffs_ecc.o yaffsfs.o yaffs_guts.o yaffs_packedtags1.o \ - yaffs_tagscompat.o yaffs_packedtags2.o yaffs_tagsvalidity.o \ - yaffs_nand.o yaffs_checkptrw.o yaffs_qsort.o yaffs_mtdif.o \ - yaffs_mtdif2.o - -SRCS := $(COBJS-y:.o=.c) -OBJS := $(addprefix $(obj),$(COBJS-y)) - -# -DCONFIG_YAFFS_NO_YAFFS1 -CFLAGS += -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 -DLINUX_VERSION_CODE=0x20622 - -all: $(LIB) - -$(LIB): $(obj).depend $(OBJS) - $(call cmd_link_o_target, $(OBJS)) - -######################################################################### - -# defines $(obj).depend target -include $(SRCTREE)/rules.mk - -sinclude $(obj).depend - -#########################################################################
fs/yaffs2/README-linux deleted +0 -201
201 lines not on this page · raw message
fs/yaffs2/devextras.h deleted +0 -275
275 lines not on this page · raw message
fs/yaffs2/yaffs_checkptrw.c deleted +0 -405
405 lines not on this page · raw message
fs/yaffs2/yaffs_checkptrw.h deleted +0 -34
@@ -1,34 +0,0 @@ -/* -* YAFFS: Yet another Flash File System . A NAND-flash specific file system. -* -* Copyright (C) 2002-2007 Aleph One Ltd. -* for Toby Churchill Ltd and Brightstar Engineering -* -* Created by Charles Manning <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 2.1 as -* published by the Free Software Foundation. -* -* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. -*/ - -#ifndef __YAFFS_CHECKPTRW_H__ -#define __YAFFS_CHECKPTRW_H__ - -#include "yaffs_guts.h" - -int yaffs_CheckpointOpen (yaffs_Device *dev,int forWriting); - -int yaffs_CheckpointWrite (yaffs_Device *dev,const void *data,int nBytes); - -int yaffs_CheckpointRead (yaffs_Device *dev,void *data,int nBytes); - -int yaffs_GetCheckpointSum (yaffs_Device *dev,__u32 *sum); - -int yaffs_CheckpointClose (yaffs_Device *dev); - -int yaffs_CheckpointInvalidateStream (yaffs_Device *dev); - - -#endif
fs/yaffs2/yaffs_ecc.c deleted +0 -333
333 lines not on this page · raw message
fs/yaffs2/yaffs_ecc.h deleted +0 -44
44 lines not on this page · raw message
fs/yaffs2/yaffs_flashif.h deleted +0 -31
@@ -1,31 +0,0 @@ -/* -* YAFFS: Yet another Flash File System . A NAND-flash specific file system. -* -* Copyright (C) 2002-2007 Aleph One Ltd. -* for Toby Churchill Ltd and Brightstar Engineering -* -* Created by Charles Manning <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 2.1 as -* published by the Free Software Foundation. -* -* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. -*/ - -#ifndef __YAFFS_FLASH_H__ -#define __YAFFS_FLASH_H__ - - -#include "yaffs_guts.h" -int yflash_EraseBlockInNAND (yaffs_Device *dev,int blockNumber); -int yflash_WriteChunkToNAND (yaffs_Device *dev,int chunkInNAND,const __u8 *data,const yaffs_Spare *spare); -int yflash_WriteChunkWithTagsToNAND (yaffs_Device *dev,int chunkInNAND,const __u8 *data,yaffs_ExtendedTags *tags); -int yflash_ReadChunkFromNAND (yaffs_Device *dev,int chunkInNAND,__u8 *data,yaffs_Spare *spare); -int yflash_ReadChunkWithTagsFromNAND (yaffs_Device *dev,int chunkInNAND,__u8 *data,yaffs_ExtendedTags *tags); -int yflash_EraseBlockInNAND (yaffs_Device *dev,int blockNumber); -int yflash_InitialiseNAND (yaffs_Device *dev); -int yflash_MarkNANDBlockBad (struct yaffs_DeviceStruct *dev,int blockNo); -int yflash_QueryNANDBlock (struct yaffs_DeviceStruct *dev,int blockNo,yaffs_BlockState *state,int *sequenceNumber); - -#endif
fs/yaffs2/yaffs_guts.c deleted +0 -7329
1,629 lines not on this page · raw message
fs/yaffs2/yaffs_guts.h deleted +0 -908
908 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif.c deleted +0 -246
246 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif2.c deleted +0 -235
235 lines not on this page · raw message
fs/yaffs2/yaffs_nand.c deleted +0 -134
134 lines not on this page · raw message
fs/yaffs2/yaffs_nand.h deleted +0 -43
43 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags1.c deleted +0 -55
55 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags2.c deleted +0 -185
185 lines not on this page · raw message
fs/yaffs2/yaffs_qsort.c deleted +0 -163
163 lines not on this page · raw message
fs/yaffs2/yaffs_tagscompat.c deleted +0 -532
532 lines not on this page · raw message
fs/yaffs2/yaffs_tagsvalidity.c deleted +0 -31
Lines of this file are not shown. View the raw message.
fs/yaffs2/yaffs_tagsvalidity.h deleted +0 -24
Lines of this file are not shown. View the raw message.
fs/yaffs2/yaffscfg.c deleted +0 -420
420 lines not on this page · raw message
fs/yaffs2/yaffscfg.h deleted +0 -45
45 lines not on this page · raw message
fs/yaffs2/yaffsfs.c deleted +0 -1510
1,510 lines not on this page · raw message
fs/yaffs2/yaffsfs.h deleted +0 -231
231 lines not on this page · raw message
fs/yaffs2/ydirectenv.h deleted +0 -92
92 lines not on this page · raw message
fs/yaffs2/yportenv.h deleted +0 -193
193 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.0.4
Part of the diff is not shown here. View the raw message.
PATCH 2/2 Patch in new yaffs2
In reply to Charles ManningPatched in from yaffs.net git at 1658295946bc589b4d351e75a59bd697630cd9e1
--- common/cmd_yaffs2.c | 244 ++- fs/yaffs2/Makefile | 64 + fs/yaffs2/stdio.h | 1 + fs/yaffs2/stdlib.h | 1 + fs/yaffs2/string.h | 6 + fs/yaffs2/yaffs_allocator.c | 357 +++ fs/yaffs2/yaffs_allocator.h | 30 + fs/yaffs2/yaffs_attribs.c | 153 ++ fs/yaffs2/yaffs_attribs.h | 28 + fs/yaffs2/yaffs_bitmap.c | 97 + fs/yaffs2/yaffs_bitmap.h | 33 + fs/yaffs2/yaffs_checkptrw.c | 408 ++++ fs/yaffs2/yaffs_checkptrw.h | 33 + fs/yaffs2/yaffs_ecc.c | 281 +++ fs/yaffs2/yaffs_ecc.h | 44 + fs/yaffs2/yaffs_error.c | 58 + fs/yaffs2/yaffs_flashif.c | 228 ++ fs/yaffs2/yaffs_flashif.h | 30 + fs/yaffs2/yaffs_flashif2.h | 30 + fs/yaffs2/yaffs_getblockinfo.h | 35 + fs/yaffs2/yaffs_guts.c | 5029 ++++++++++++++++++++++++++++++++++++++++ fs/yaffs2/yaffs_guts.h | 973 ++++++++ fs/yaffs2/yaffs_hweight.c | 53 + fs/yaffs2/yaffs_hweight.h | 24 + fs/yaffs2/yaffs_list.h | 125 + fs/yaffs2/yaffs_mtdif.c | 246 ++ fs/yaffs2/yaffs_mtdif.h | 27 + fs/yaffs2/yaffs_mtdif2.c | 274 +++ fs/yaffs2/yaffs_mtdif2.h | 30 + fs/yaffs2/yaffs_nameval.c | 207 ++ fs/yaffs2/yaffs_nameval.h | 28 + fs/yaffs2/yaffs_nand.c | 120 + fs/yaffs2/yaffs_nand.h | 38 + fs/yaffs2/yaffs_nandemul2k.h | 39 + fs/yaffs2/yaffs_nandif.c | 257 ++ fs/yaffs2/yaffs_nandif.h | 73 + fs/yaffs2/yaffs_osglue.h | 42 + fs/yaffs2/yaffs_packedtags1.c | 56 + fs/yaffs2/yaffs_packedtags1.h | 39 + fs/yaffs2/yaffs_packedtags2.c | 197 ++ fs/yaffs2/yaffs_packedtags2.h | 47 + fs/yaffs2/yaffs_qsort.c | 163 ++ fs/yaffs2/yaffs_summary.c | 312 +++ fs/yaffs2/yaffs_summary.h | 37 + fs/yaffs2/yaffs_tagscompat.c | 407 ++++ fs/yaffs2/yaffs_tagscompat.h | 36 + fs/yaffs2/yaffs_trace.h | 57 + fs/yaffs2/yaffs_uboot_glue.c | 470 ++++ fs/yaffs2/yaffs_verify.c | 529 +++++ fs/yaffs2/yaffs_verify.h | 43 + fs/yaffs2/yaffs_yaffs1.c | 422 ++++ fs/yaffs2/yaffs_yaffs1.h | 22 + fs/yaffs2/yaffs_yaffs2.c | 1532 ++++++++++++ fs/yaffs2/yaffs_yaffs2.h | 39 + fs/yaffs2/yaffscfg.h | 39 + fs/yaffs2/yaffsfs.c | 3236 ++++++++++++++++++++++++++ fs/yaffs2/yaffsfs.h | 205 ++ fs/yaffs2/ydirectenv.h | 98 + fs/yaffs2/yportenv.h | 308 +++ 59 files changed, 17994 insertions(+), 46 deletions(-) create mode 100644 fs/yaffs2/Makefile create mode 100644 fs/yaffs2/stdio.h create mode 100644 fs/yaffs2/stdlib.h create mode 100644 fs/yaffs2/string.h create mode 100644 fs/yaffs2/yaffs_allocator.c create mode 100644 fs/yaffs2/yaffs_allocator.h create mode 100644 fs/yaffs2/yaffs_attribs.c create mode 100644 fs/yaffs2/yaffs_attribs.h create mode 100644 fs/yaffs2/yaffs_bitmap.c create mode 100644 fs/yaffs2/yaffs_bitmap.h create mode 100644 fs/yaffs2/yaffs_checkptrw.c create mode 100644 fs/yaffs2/yaffs_checkptrw.h create mode 100644 fs/yaffs2/yaffs_ecc.c create mode 100644 fs/yaffs2/yaffs_ecc.h create mode 100644 fs/yaffs2/yaffs_error.c create mode 100644 fs/yaffs2/yaffs_flashif.c create mode 100644 fs/yaffs2/yaffs_flashif.h create mode 100644 fs/yaffs2/yaffs_flashif2.h create mode 100644 fs/yaffs2/yaffs_getblockinfo.h create mode 100644 fs/yaffs2/yaffs_guts.c create mode 100644 fs/yaffs2/yaffs_guts.h create mode 100644 fs/yaffs2/yaffs_hweight.c create mode 100644 fs/yaffs2/yaffs_hweight.h create mode 100644 fs/yaffs2/yaffs_list.h create mode 100644 fs/yaffs2/yaffs_mtdif.c create mode 100644 fs/yaffs2/yaffs_mtdif.h create mode 100644 fs/yaffs2/yaffs_mtdif2.c create mode 100644 fs/yaffs2/yaffs_mtdif2.h create mode 100644 fs/yaffs2/yaffs_nameval.c create mode 100644 fs/yaffs2/yaffs_nameval.h create mode 100644 fs/yaffs2/yaffs_nand.c create mode 100644 fs/yaffs2/yaffs_nand.h create mode 100644 fs/yaffs2/yaffs_nandemul2k.h create mode 100644 fs/yaffs2/yaffs_nandif.c create mode 100644 fs/yaffs2/yaffs_nandif.h create mode 100644 fs/yaffs2/yaffs_osglue.h create mode 100644 fs/yaffs2/yaffs_packedtags1.c create mode 100644 fs/yaffs2/yaffs_packedtags1.h create mode 100644 fs/yaffs2/yaffs_packedtags2.c create mode 100644 fs/yaffs2/yaffs_packedtags2.h create mode 100644 fs/yaffs2/yaffs_qsort.c create mode 100644 fs/yaffs2/yaffs_summary.c create mode 100644 fs/yaffs2/yaffs_summary.h create mode 100644 fs/yaffs2/yaffs_tagscompat.c create mode 100644 fs/yaffs2/yaffs_tagscompat.h create mode 100644 fs/yaffs2/yaffs_trace.h create mode 100644 fs/yaffs2/yaffs_uboot_glue.c create mode 100644 fs/yaffs2/yaffs_verify.c create mode 100644 fs/yaffs2/yaffs_verify.h create mode 100644 fs/yaffs2/yaffs_yaffs1.c create mode 100644 fs/yaffs2/yaffs_yaffs1.h create mode 100644 fs/yaffs2/yaffs_yaffs2.c create mode 100644 fs/yaffs2/yaffs_yaffs2.h create mode 100644 fs/yaffs2/yaffscfg.h create mode 100644 fs/yaffs2/yaffsfs.c create mode 100644 fs/yaffs2/yaffsfs.h create mode 100644 fs/yaffs2/ydirectenv.h create mode 100644 fs/yaffs2/yportenv.h
common/cmd_yaffs2.c +198 -46
@@ -1,3 +1,18 @@ +/* Yaffs commands. +* Modified by Charles Manning by adding ydevconfig command. +* +* Use ydevconfig to configure a mountpoint before use. +* For example: +* # Configure mountpt xxx using nand device 0 using blocks 100-500 +* ydevconfig xxx 0 100 500 +* # Mount it +* ymount xxx +* # yls, yrdm etc +* yls -l xxx +* yrdm xxx/boot-image 82000000 +* ... +*/ +#include <common.h> #include <config.h>
@@ -6,9 +21,12 @@#ifdef YAFFS2_DEBUG #define PRINTF(fmt,args...) printf (fmt ,##args)#else -#define PRINTF(fmt,args...) +#define PRINTF(fmt,args...) do { } while(0)#endif +extern void cmd_yaffs_dev_ls (void ); +extern void cmd_yaffs_tracemask (unsigned set,unsigned mask); +extern void cmd_yaffs_devconfig (char *mp,int flash_dev,int start_block,int end_block);extern void cmd_yaffs_mount (char *mp);extern void cmd_yaffs_umount (char *mp);extern void cmd_yaffs_read_file (char *fn);
@@ -21,12 +39,63 @@ extern void cmd_yaffs_rmdir(const char *dir);extern void cmd_yaffs_rm (const char *path);extern void cmd_yaffs_mv (const char *oldPath,const char *newPath); -extern int yaffs_DumpDevStruct (const char *path); +extern int yaffs_dump_dev (const char *path); + + +/* ytrace - show/set yaffs trace mask */ +int do_ytrace (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +if (argc >1 ) +cmd_yaffs_tracemask (1 ,simple_strtol (argv[1 ],NULL ,16 )); +else +cmd_yaffs_tracemask (0 ,0 ); + +return (0 ); +} + +/* ydevls - lists yaffs mount points. */ +int do_ydevls (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +cmd_yaffs_dev_ls (); + +return (0 ); +} + +/* ydevconfig mount_pt mtd_dev_num start_block end_block */ +int do_ydevconfig (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +char *mtpoint; +int mtd_dev; +int start_block; +int end_block; +if (argc !=5 ) { +printf ("Bad arguments: ydevconfig mount_pt mtd_dev start_block end_block\n" ); +return -1 ; + } + + mtpoint = argv[1 ]; + mtd_dev =simple_strtol (argv[2 ],NULL ,16 ); + start_block =simple_strtol (argv[3 ],NULL ,16 ); + end_block =simple_strtol (argv[4 ],NULL ,16 ); + +cmd_yaffs_devconfig (mtpoint, mtd_dev, start_block, end_block); + +return (0 ); +}int do_ymount (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *mtpoint = argv[1 ]; +char *mtpoint; + +if (argc !=2 ) { +printf ("Bad arguments: ymount mount_pt\n" ); +return -1 ; + } + + mtpoint = argv[1 ]; +printf ("Mounting yaffs2 mount point %s\n" ,mtpoint); +cmd_yaffs_mount (mtpoint);return (0 );
@@ -34,7 +103,15 @@ int do_ymount (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_yumount (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *mtpoint = argv[1 ]; +char *mtpoint; + +if (argc !=2 ) { +printf ("Bad arguments: yumount mount_pt\n" ); +return -1 ; + } + + mtpoint = argv[1 ]; +printf ("Unmounting yaffs2 mount point %s\n" ,mtpoint);cmd_yaffs_umount (mtpoint);return (0 );
@@ -42,7 +119,15 @@ int do_yumount (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_yls (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *dirname = argv[argc-1 ]; +char *dirname; + +if (argc <2 || argc >3 || + (argc ==3 &&strcmp (argv[1 ],"-l" ))) { +printf ("Bad arguments: yls [-l] dir\n" ); +return -1 ; + } + + dirname = argv[argc-1 ];cmd_yaffs_ls (dirname, (argc>2 )?1 :0 );
@@ -51,7 +136,15 @@ int do_yls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_yrd (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *filename = argv[1 ]; +char *filename; + +if (argc !=2 ) { +printf ("Bad arguments: yrd file_name\n" ); +return -1 ; + } + + filename = argv[1 ]; +printf ("Reading file %s " , filename);cmd_yaffs_read_file (filename);
@@ -62,9 +155,18 @@ int do_yrd (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_ywr (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *filename = argv[1 ]; -ulong value =simple_strtoul (argv[2 ],NULL ,16 ); -ulong numValues =simple_strtoul (argv[3 ],NULL ,16 ); +char *filename; +ulong value; +ulong numValues; + +if (argc !=4 ) { +printf ("Bad arguments: ywr file_name value n_values\n" ); +return -1 ; + } + + filename = argv[1 ]; + value =simple_strtoul (argv[2 ],NULL ,16 ); + numValues =simple_strtoul (argv[3 ],NULL ,16 );printf ("Writing value (%lx) %lx times to %s... " , value, numValues, filename);
@@ -76,8 +178,16 @@ int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_yrdm (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *filename = argv[1 ]; -ulong addr =simple_strtoul (argv[2 ],NULL ,16 ); +char *filename; +ulong addr; + +if (argc !=3 ) { +printf ("Bad arguments: yrdm file_name addr\n" ); +return -1 ; + } + + filename = argv[1 ]; + addr =simple_strtoul (argv[2 ],NULL ,16 );cmd_yaffs_mread_file (filename, (char *)addr);
@@ -86,9 +196,18 @@ int do_yrdm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_ywrm (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *filename = argv[1 ]; -ulong addr =simple_strtoul (argv[2 ],NULL ,16 ); -ulong size =simple_strtoul (argv[3 ],NULL ,16 ); +char *filename; +ulong addr; +ulong size; + +if (argc !=4 ) { +printf ("Bad arguments: ywrm file_name addr size\n" ); +return -1 ; + } + + filename = argv[1 ]; + addr =simple_strtoul (argv[2 ],NULL ,16 ); + size =simple_strtoul (argv[3 ],NULL ,16 );cmd_yaffs_mwrite_file (filename, (char *)addr, size);
@@ -97,8 +216,14 @@ int do_ywrm (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_ymkdir (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *dirname = argv[1 ]; +char *dirname; + +if (argc !=2 ) { +printf ("Bad arguments: ymkdir dir_name\n" ); +return -1 ; + } + dirname = argv[1 ];cmd_yaffs_mkdir (dirname);return (0 );
@@ -106,8 +231,14 @@ int do_ymkdir (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_yrmdir (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *dirname = argv[1 ]; +char *dirname; +if (argc !=2 ) { +printf ("Bad arguments: yrmdir dir_name\n" ); +return -1 ; + } + + dirname = argv[1 ];cmd_yaffs_rmdir (dirname);return (0 );
@@ -115,99 +246,120 @@ int do_yrmdir (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])int do_yrm (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *path = argv[1 ]; +char *name; + +if (argc !=2 ) { +printf ("Bad arguments: yrm name\n" ); +return -1 ; + } -cmd_yaffs_rm (path); + name = argv[1 ]; + +cmd_yaffs_rm (name);return (0 ); }int do_ymv (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -char *oldPath = argv[1 ]; -char *newPath = argv[2 ]; +char *oldPath; +char *newPath; + +if (argc !=3 ) { +printf ("Bad arguments: ymv old_path new_path\n" ); +return -1 ; + } + + oldPath = argv[1 ]; + newPath = argv[2 ];cmd_yaffs_mv (newPath, oldPath);return (0 ); } -int do_ydump (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) -{ -char *dirname = argv[1 ]; -if (yaffs_DumpDevStruct (dirname) !=0 ) -printf ("yaffs_DumpDevStruct returning error when dumping path: , %s\n" , dirname); -return 0 ; -} +U_BOOT_CMD ( + ytrace,2 ,0 , do_ytrace, +"show/set yaffs trace mask" , +"ytrace [new_mask] show/set yaffs trace mask" +); + +U_BOOT_CMD ( + ydevls,1 ,0 , do_ydevls, +"list yaffs mount points" , +"list yaffs mount points" +);U_BOOT_CMD ( - ymount,3 ,0 , do_ymount, + ydevconfig,5 ,0 , do_ydevconfig, +"configure yaffs mount point" , +"ydevconfig mtpoint mtd_id start_block end_block configures a yaffs2 mount point" +); + +U_BOOT_CMD ( + ymount,2 ,0 , do_ymount,"mount yaffs" , -"" +"ymount mtpoint mounts a yaffs2 mount point" ); +U_BOOT_CMD ( - yumount,3 ,0 , do_yumount, + yumount,2 ,0 , do_yumount,"unmount yaffs" , -"" +"yunmount mtpoint unmounts a yaffs2 mount point" );U_BOOT_CMD ( - yls,4 ,0 , do_yls, + yls,3 ,0 , do_yls,"yaffs ls" , -"[-l] name" +"yls [-l] dirname" );U_BOOT_CMD ( yrd,2 ,0 , do_yrd,"read file from yaffs" , -"filename" +"yrd path read file from yaffs" );U_BOOT_CMD ( ywr,4 ,0 , do_ywr,"write file to yaffs" , -"filename value num_vlues" +"ywr filename value num_vlues write values to yaffs file" );U_BOOT_CMD ( yrdm,3 ,0 , do_yrdm,"read file to memory from yaffs" , -"filename offset" +"yrdm filename offset reads yaffs file into memory" );U_BOOT_CMD ( ywrm,4 ,0 , do_ywrm,"write file from memory to yaffs" , -"filename offset size" +"ywrm filename offset size writes memory to yaffs file" );U_BOOT_CMD ( ymkdir,2 ,0 , do_ymkdir,"YAFFS mkdir" , -"dirname" +"ymkdir dir create a yaffs directory" );U_BOOT_CMD ( yrmdir,2 ,0 , do_yrmdir,"YAFFS rmdir" , -"dirname" +"yrmdir dirname removes a yaffs directory" );U_BOOT_CMD ( yrm,2 ,0 , do_yrm,"YAFFS rm" , -"path" +"yrm path removes a yaffs file" );U_BOOT_CMD ( ymv,4 ,0 , do_ymv,"YAFFS mv" , -"oldPath newPath" +"ymv old_path new_path moves/rename files within a yaffs mount point" ); -U_BOOT_CMD ( - ydump,2 ,0 , do_ydump, -"YAFFS device struct" , -"dirname" -);
fs/yaffs2/Makefile new file +64 -0
64 lines not on this page · raw message
fs/yaffs2/stdio.h new file +1 -0
@@ -0,0 +1 @@ +/* Dummy header for u-boot */
fs/yaffs2/stdlib.h new file +1 -0
@@ -0,0 +1 @@ +/* Dummy header for u-boot */
fs/yaffs2/string.h new file +6 -0
@@ -0,0 +1,6 @@ +#include <linux/stddef.h> +#include <linux/string.h> +#include <linux/stat.h> +#include <common.h> + +
fs/yaffs2/yaffs_allocator.c new file +357 -0
357 lines not on this page · raw message
fs/yaffs2/yaffs_allocator.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +#ifndef __YAFFS_ALLOCATOR_H__ +#define __YAFFS_ALLOCATOR_H__ + +#include "yaffs_guts.h" + +void yaffs_init_raw_tnodes_and_objs (struct yaffs_dev *dev); +void yaffs_deinit_raw_tnodes_and_objs (struct yaffs_dev *dev); + +struct yaffs_tnode *yaffs_alloc_raw_tnode (struct yaffs_dev *dev); +void yaffs_free_raw_tnode (struct yaffs_dev *dev,struct yaffs_tnode *tn); + +struct yaffs_obj *yaffs_alloc_raw_obj (struct yaffs_dev *dev); +void yaffs_free_raw_obj (struct yaffs_dev *dev,struct yaffs_obj *obj); + +#endif
fs/yaffs2/yaffs_attribs.c new file +153 -0
153 lines not on this page · raw message
fs/yaffs2/yaffs_attribs.h new file +28 -0
@@ -0,0 +1,28 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +#ifndef __YAFFS_ATTRIBS_H__ +#define __YAFFS_ATTRIBS_H__ + +#include "yaffs_guts.h" + +void yaffs_load_attribs (struct yaffs_obj *obj,struct yaffs_obj_hdr *oh); +void yaffs_load_attribs_oh (struct yaffs_obj_hdr *oh,struct yaffs_obj *obj); +void yaffs_attribs_init (struct yaffs_obj *obj,u32 gid,u32 uid,u32 rdev); +void yaffs_load_current_time (struct yaffs_obj *obj,int do_a,int do_c); +int yaffs_set_attribs (struct yaffs_obj *obj,struct iattr *attr); +int yaffs_get_attribs (struct yaffs_obj *obj,struct iattr *attr); + +#endif
fs/yaffs2/yaffs_bitmap.c new file +97 -0
97 lines not on this page · raw message
fs/yaffs2/yaffs_bitmap.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +/* +* Chunk bitmap manipulations +*/ + +#ifndef __YAFFS_BITMAP_H__ +#define __YAFFS_BITMAP_H__ + +#include "yaffs_guts.h" + +void yaffs_verify_chunk_bit_id (struct yaffs_dev *dev,int blk,int chunk); +void yaffs_clear_chunk_bits (struct yaffs_dev *dev,int blk); +void yaffs_clear_chunk_bit (struct yaffs_dev *dev,int blk,int chunk); +void yaffs_set_chunk_bit (struct yaffs_dev *dev,int blk,int chunk); +int yaffs_check_chunk_bit (struct yaffs_dev *dev,int blk,int chunk); +int yaffs_still_some_chunks (struct yaffs_dev *dev,int blk); +int yaffs_count_chunk_bits (struct yaffs_dev *dev,int blk); + +#endif
fs/yaffs2/yaffs_checkptrw.c new file +408 -0
408 lines not on this page · raw message
fs/yaffs2/yaffs_checkptrw.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +#ifndef __YAFFS_CHECKPTRW_H__ +#define __YAFFS_CHECKPTRW_H__ + +#include "yaffs_guts.h" + +int yaffs2_checkpt_open (struct yaffs_dev *dev,int writing); + +int yaffs2_checkpt_wr (struct yaffs_dev *dev,const void *data,int n_bytes); + +int yaffs2_checkpt_rd (struct yaffs_dev *dev,void *data,int n_bytes); + +int yaffs2_get_checkpt_sum (struct yaffs_dev *dev,u32 * sum); + +int yaffs_checkpt_close (struct yaffs_dev *dev); + +int yaffs2_checkpt_invalidate_stream (struct yaffs_dev *dev); + +#endif
fs/yaffs2/yaffs_ecc.c new file +281 -0
281 lines not on this page · raw message
fs/yaffs2/yaffs_ecc.h new file +44 -0
44 lines not on this page · raw message
fs/yaffs2/yaffs_error.c new file +58 -0
58 lines not on this page · raw message
fs/yaffs2/yaffs_flashif.c new file +228 -0
228 lines not on this page · raw message
fs/yaffs2/yaffs_flashif.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +#ifndef __YAFFS_FLASH_H__ +#define __YAFFS_FLASH_H__ + + +#include "yaffs_guts.h" +int yflash_EraseBlockInNAND (struct yaffs_dev *dev,int blockNumber); +int yflash_WriteChunkToNAND (struct yaffs_dev *dev,int nand_chunk,const u8 *data,const struct yaffs_spare *spare); +int yflash_WriteChunkWithTagsToNAND (struct yaffs_dev *dev,int nand_chunk,const u8 *data,const struct yaffs_ext_tags *tags); +int yflash_ReadChunkFromNAND (struct yaffs_dev *dev,int nand_chunk,u8 *data,struct yaffs_spare *spare); +int yflash_ReadChunkWithTagsFromNAND (struct yaffs_dev *dev,int nand_chunk,u8 *data,struct yaffs_ext_tags *tags); +int yflash_InitialiseNAND (struct yaffs_dev *dev); +int yflash_MarkNANDBlockBad (struct yaffs_dev *dev,int block_no); +int yflash_QueryNANDBlock (struct yaffs_dev *dev,int block_no,enum yaffs_block_state *state,u32 *seq_number); + +#endif
fs/yaffs2/yaffs_flashif2.h new file +30 -0
@@ -0,0 +1,30 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +#ifndef __YAFFS_FLASH2_H__ +#define __YAFFS_FLASH2_H__ + + +#include "yaffs_guts.h" +int yflash2_EraseBlockInNAND (struct yaffs_dev *dev,int blockNumber); +int yflash2_WriteChunkToNAND (struct yaffs_dev *dev,int nand_chunk,const u8 *data,const struct yaffs_spare *spare); +int yflash2_WriteChunkWithTagsToNAND (struct yaffs_dev *dev,int nand_chunk,const u8 *data,const struct yaffs_ext_tags *tags); +int yflash2_ReadChunkFromNAND (struct yaffs_dev *dev,int nand_chunk,u8 *data,struct yaffs_spare *spare); +int yflash2_ReadChunkWithTagsFromNAND (struct yaffs_dev *dev,int nand_chunk,u8 *data,struct yaffs_ext_tags *tags); +int yflash2_InitialiseNAND (struct yaffs_dev *dev); +int yflash2_MarkNANDBlockBad (struct yaffs_dev *dev,int block_no); +int yflash2_QueryNANDBlock (struct yaffs_dev *dev,int block_no,enum yaffs_block_state *state,u32 *seq_number); + +#endif
fs/yaffs2/yaffs_getblockinfo.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* YAFFS: Yet another Flash File System . A NAND-flash specific file system. +* +* Copyright (C) 2002-2011 Aleph One Ltd. +* for Toby Churchill Ltd and Brightstar Engineering +* +* Created by Charles Manning <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 2.1 as +* published by the Free Software Foundation. +* +* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. +*/ + +#ifndef __YAFFS_GETBLOCKINFO_H__ +#define __YAFFS_GETBLOCKINFO_H__ + +#include "yaffs_guts.h" +#include "yaffs_trace.h" + +/* Function to manipulate block info */ +static inline struct yaffs_block_info *yaffs_get_block_info (struct yaffs_dev + *dev,int blk) +{ +if (blk < dev->internal_start_block || blk > dev->internal_end_block) { +yaffs_trace (YAFFS_TRACE_ERROR , +"**>> yaffs: get_block_info block %d is not valid" , + blk); +BUG (); + } +return &dev->block_info[blk - dev->internal_start_block]; +} + +#endif
fs/yaffs2/yaffs_guts.c new file +5029 -0
699 lines not on this page · raw message
fs/yaffs2/yaffs_guts.h new file +973 -0
973 lines not on this page · raw message
fs/yaffs2/yaffs_hweight.c new file +53 -0
53 lines not on this page · raw message
fs/yaffs2/yaffs_list.h new file +125 -0
125 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif.c new file +246 -0
246 lines not on this page · raw message
fs/yaffs2/yaffs_mtdif2.c new file +274 -0
274 lines not on this page · raw message
fs/yaffs2/yaffs_nameval.c new file +207 -0
207 lines not on this page · raw message
fs/yaffs2/yaffs_nand.c new file +120 -0
120 lines not on this page · raw message
fs/yaffs2/yaffs_nandif.c new file +257 -0
257 lines not on this page · raw message
fs/yaffs2/yaffs_nandif.h new file +73 -0
73 lines not on this page · raw message
fs/yaffs2/yaffs_osglue.h new file +42 -0
42 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags1.c new file +56 -0
56 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags1.h new file +39 -0
Lines of this file are not shown. View the raw message.
fs/yaffs2/yaffs_packedtags2.c new file +197 -0
197 lines not on this page · raw message
fs/yaffs2/yaffs_packedtags2.h new file +47 -0
47 lines not on this page · raw message
fs/yaffs2/yaffs_qsort.c new file +163 -0
163 lines not on this page · raw message
fs/yaffs2/yaffs_summary.c new file +312 -0
312 lines not on this page · raw message
fs/yaffs2/yaffs_tagscompat.c new file +407 -0
407 lines not on this page · raw message
fs/yaffs2/yaffs_trace.h new file +57 -0
57 lines not on this page · raw message
fs/yaffs2/yaffs_uboot_glue.c new file +470 -0
470 lines not on this page · raw message
fs/yaffs2/yaffs_verify.c new file +529 -0
529 lines not on this page · raw message
fs/yaffs2/yaffs_verify.h new file +43 -0
43 lines not on this page · raw message
fs/yaffs2/yaffs_yaffs1.c new file +422 -0
422 lines not on this page · raw message
fs/yaffs2/yaffs_yaffs2.c new file +1532 -0
1,532 lines not on this page · raw message
fs/yaffs2/yaffsfs.c new file +3236 -0
3,236 lines not on this page · raw message
fs/yaffs2/yaffsfs.h new file +205 -0
205 lines not on this page · raw message
fs/yaffs2/ydirectenv.h new file +98 -0
98 lines not on this page · raw message
fs/yaffs2/yportenv.h new file +308 -0
308 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.0.4
Part of the diff is not shown here. View the raw message.
cover Replace yaffs2 with new version
In reply to Charles ManningDear Charles Manning,
Quoted 4 lines · In message <[email protected]> you wrote:
This patch set replaces fs/yaffs2 with a new version.
This new version is faster and also adds the ability to dynamically add yaffs2 mount points which makes configuration far simpler.
Sorry, but it doesn't work like this.
You cannot remove all code in one patch and re-add it in another, as this will break bisectability. This must be done in a single commit.
Also, please run your new code through checkpatch, and clean it up before resubmitting. Current status is:
total: 1630 errors, 464 warnings, 18175 lines checked
NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or scripts/cleanfile
Thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Our business is run on trust. We trust you will pay in advance.
cover Replace yaffs2 with new version
Quoted 3 lines · On Monday 30 April 2012 16:40:16 Wolfgang Denk wrote:
Dear Charles Manning,
In message <[email protected]> you
Quoted 5 lines · wrote:
Quoted 4 lines
This patch set replaces fs/yaffs2 with a new version.
This new version is faster and also adds the ability to dynamically add yaffs2 mount points which makes configuration far simpler.
Quoted 7 lines
Sorry, but it doesn't work like this.
You cannot remove all code in one patch and re-add it in another, as this will break bisectability. This must be done in a single commit.
Also, please run your new code through checkpatch, and clean it up before resubmitting. Current status is:
Ok, so one huge patch that passes (or close) checkpatch will be acceptable?
I have spent the last couple of days cleaning things up so I hope it will be.
I am having problems with the yaffs git server so when that is sorted, I'll make another u-boot patch and send that.
-- CHarles