From: snickersun@163.com Date: Tue, 16 Dec 2025 08:10:15 +0000 (+0800) Subject: Revert "修复烧录后第一次mount慢的bug X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=f881fe77891f14af8371cb0979ce35aa36bc9eeb;p=mirrors%2FFD230.git Revert "修复烧录后第一次mount慢的bug " --- diff --git a/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image index aa49b9ec4..086d8c50f 100644 Binary files a/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image and b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image differ diff --git a/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.c b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.c index 77d10d502..66e2a0f60 100644 --- a/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.c +++ b/code/sdk/tools/bin/platform_tool/mkyaffs2image/mkyaffs2image.c @@ -62,24 +62,6 @@ unsigned int chunkSize, spareSize, pagesPerBlock; #define NANDIP_V100 0x100 -#define CHUNKS_PER_SUMMARY 63 -#define YAFFS_OBJECTID_SUMMARY 0x10 -#define YAFFS_SUMMARY_VERSION 1 - -/* Summary tags don't need the sequence number because that is redundant. */ -struct yaffs_summary_tags { - unsigned obj_id; - unsigned chunk_id; - unsigned n_bytes; -}; - -/* Summary header */ -struct yaffs_summary_header { - unsigned version; /* Must match current version */ - unsigned block; /* Must be this block */ - unsigned seq; /* Must be this sequence number */ - unsigned sum; /* Just add up all the bytes in the tags */ -}; /* this follow must be consistent with fastboot !!! */ enum ecc_type @@ -329,9 +311,6 @@ static objItem obj_list[MAX_OBJECTS]; static int obj_id = YAFFS_NOBJECT_BUCKETS + 1; static int n_obj, nDirectories, nPages; -static int summary_index; -static int current_chunk; -static struct yaffs_summary_tags *sum_tags; static int outFile; @@ -465,65 +444,6 @@ static void shuffle_oob(char *spareData, struct yaffs_packed_tags2 *pt) memcpy(spareData, pt, sizeof(*pt)); } -static unsigned yaffs_summary_sum(void) -{ - unsigned sum = 0; - u8 *sum_tags_tmp = (u8 *)sum_tags; - int length = CHUNKS_PER_SUMMARY * sizeof(struct yaffs_summary_tags); - - while (length > 0) { - sum += *sum_tags_tmp; - sum_tags_tmp++; - length--; - } - - return sum; -} - -static int yaffs_do_summary(void) -{ - struct nand_oob_free *oobfree = sel_oob_info->freeoob; - - struct yaffs_summary_header hdr; - hdr.version = YAFFS_SUMMARY_VERSION; - hdr.block = 0; - hdr.seq = YAFFS_LOWEST_SEQUENCE_NUMBER; - hdr.sum = yaffs_summary_sum(); - - char data[chunkSize]; - memset(data, 0xff, chunkSize); - memcpy(data, &hdr, sizeof(hdr)); - memcpy(data + sizeof(hdr), sum_tags, CHUNKS_PER_SUMMARY * sizeof(struct yaffs_summary_tags)); - - if (write(outFile, data, chunkSize) != chunkSize) - fatal("write"); - - struct yaffs_ext_tags t; - memset(&t, 0, sizeof(struct yaffs_ext_tags)); - t.chunk_id = 1; - t.serial_number = 1; - t.n_bytes = CHUNKS_PER_SUMMARY * sizeof(struct yaffs_summary_tags) + sizeof(hdr); - t.obj_id = YAFFS_OBJECTID_SUMMARY; - t.seq_number = YAFFS_LOWEST_SEQUENCE_NUMBER; - t.chunk_used = 1; - nPages++; - - struct yaffs_packed_tags2 pt; - memset(&pt, 0, sizeof(struct yaffs_packed_tags2)); - yaffs_pack_tags2(&dummy_dev, &pt, &t, 1); - - char spareData[spareSize]; - memset(spareData, 0xff, spareSize); - spareData[oobfree->length] = 0; - spareData[oobfree->length + 1] = 0; - - shuffle_oob(&spareData[2], &pt); // use 2bit to mark bad block - - if (write(outFile, spareData, spareSize) != spareSize) - fatal("write"); - return 0; -} - static int write_chunk(u8 *data, u32 id, u32 chunk_id, u32 n_bytes) { struct yaffs_ext_tags t; @@ -531,23 +451,6 @@ static int write_chunk(u8 *data, u32 id, u32 chunk_id, u32 n_bytes) char spareData[spareSize]; struct nand_oob_free *oobfree = sel_oob_info->freeoob; - current_chunk++; - if ((current_chunk % (CHUNKS_PER_SUMMARY + 1)) == 0) { - error = yaffs_do_summary(); - if (error < 0) { - printf("Yaffs2 write summary info failure.\n"); - return error; - } - memset(sum_tags, 0x0, CHUNKS_PER_SUMMARY * sizeof(struct yaffs_summary_tags)); - current_chunk = 1; - summary_index = 0; - } - - sum_tags[summary_index].chunk_id = chunk_id; - sum_tags[summary_index].n_bytes = n_bytes; - sum_tags[summary_index].obj_id = id; - summary_index++; - if (write(outFile,data,chunkSize) != chunkSize) fatal("write"); @@ -1039,14 +942,7 @@ int main(int argc, char *argv[]) chunkSize = get_pagesize(g_pagetype); spareSize = sel_oob_info->oobsize; - printf("fix mount slow after burn, chunkSize %d spareSize %d\n",chunkSize,spareSize); - int sum_tags_bytes = CHUNKS_PER_SUMMARY * sizeof(struct yaffs_summary_tags); - sum_tags = (struct yaffs_summary_tags *)malloc(sum_tags_bytes); - if (sum_tags == NULL) { - printf("Alloc sum_tags failure.\n"); - exit(1); - } - memset(sum_tags, 0x0, sum_tags_bytes); + printf("chunkSize %d spareSize %d\n",chunkSize,spareSize); printf("Processing directory %s into image file %s\n",argv[1],argv[2]);