yaffs_fileem2k.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  3. *
  4. * Copyright (C) 2002-2007 Aleph One Ltd.
  5. * for Toby Churchill Ltd and Brightstar Engineering
  6. *
  7. * Created by Charles Manning <charles@aleph1.co.uk>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License version 2.1 as
  11. * published by the Free Software Foundation.
  12. *
  13. * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  14. */
  15. #ifndef __FILEEM2K_H__
  16. #define __FILEEM2K_H__
  17. #if 1
  18. #define SIZE_IN_MB 128
  19. //#define SIZE_IN_MB 8000
  20. #define PAGE_DATA_SIZE (2048)
  21. #define PAGE_SPARE_SIZE (64)
  22. #define PAGE_SIZE (PAGE_DATA_SIZE + PAGE_SPARE_SIZE)
  23. #define PAGES_PER_BLOCK (64)
  24. #define BLOCK_DATA_SIZE (PAGE_DATA_SIZE * PAGES_PER_BLOCK)
  25. #define BLOCK_SIZE (PAGES_PER_BLOCK * (PAGE_SIZE))
  26. #define BLOCKS_PER_MB ((1024*1024)/BLOCK_DATA_SIZE)
  27. #define SIZE_IN_BLOCKS (BLOCKS_PER_MB * SIZE_IN_MB)
  28. #else
  29. #define SIZE_IN_MB 128
  30. #define PAGE_DATA_SIZE (512)
  31. #define SPARE_SIZE (16)
  32. #define PAGE_SIZE (PAGE_DATA_SIZE + SPARE_SIZE)
  33. #define PAGES_PER_BLOCK (32)
  34. #define BLOCK_DATA_SIZE (PAGE_SIZE * PAGES_PER_BLOCK)
  35. #define BLOCK_SIZE (PAGES_PER_BLOCK * (PAGE_SIZE))
  36. #define BLOCKS_PER_MB ((1024*1024)/BLOCK_DATA_SIZE)
  37. #define SIZE_IN_BLOCKS (BLOCKS_PER_MB * SIZE_IN_MB)
  38. #endif
  39. int yflash_GetNumberOfBlocks(void);
  40. #endif