5 #include "yaffs_guts.h"
6 #include "yaffs_flashif.h"
11 unsigned yaffs_traceMask = 0xFFFFFFFF;
13 static void InitDevice(yaffs_Device *dev)
15 // Initialise the NAND device. This should agree with what is set in yaffscfg for /boot
18 // Only some of these parameters are actually used.
19 dev->nBytesPerChunk = YAFFS_BYTES_PER_CHUNK;
20 dev->nChunksPerBlock = YAFFS_CHUNKS_PER_BLOCK;
21 dev->startBlock = 1; // Can't use block 0
22 dev->endBlock = 127; // Last block in 2MB.
23 dev->useNANDECC = 0; // use YAFFS's ECC
24 dev->nShortOpCaches = 10; // Use caches
25 dev->genericDevice = (void *) 1; // Used to identify the device in fstat.
26 dev->writeChunkToNAND = yflash_WriteChunkToNAND;
27 dev->readChunkFromNAND = yflash_ReadChunkFromNAND;
28 dev->eraseBlockInNAND = yflash_EraseBlockInNAND;
29 dev->initialiseNAND = yflash_InitialiseNAND;
43 printf("Test boot code\n");
47 oId = yaffsboot_InitFile(&dev,"yyfile",&fsize);
49 printf("ObjectId = %d, size is %d\n",oId,fsize);
53 printf("File not found\n");
57 printf("dumping file as text\n\n");
61 while(yaffsboot_ReadByte(&ch) >= 0)
67 printf("\n\n%d bytes read\n",nBytes);