README.JFFS2 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. JFFS2 options and usage.
  2. -----------------------
  3. JFFS2 in U-Boot is a read only implementation of the file system in
  4. Linux with the same name. To use JFFS2 define CFG_CMD_JFFS2.
  5. The module adds three new commands.
  6. fsload - load binary file from a file system image
  7. fsinfo - print information about file systems
  8. ls - list files in a directory
  9. If you boot from a partition which is mounted writable, and you
  10. update your boot environment by replacing single files on that
  11. partition, you should also define CFG_JFFS2_SORT_FRAGMENTS. Scanning
  12. the JFFS2 filesystem takes *much* longer with this feature, though.
  13. Sorting is done while inserting into the fragment list, which is
  14. more or less a bubble sort. That algorithm is known to be O(n^2),
  15. thus you should really consider if you can avoid it!
  16. There is two ways for JFFS2 to find the disk. The default way uses
  17. the flash_info structure to find the start of a JFFS2 disk (called
  18. partition in the code) and you can change where the partition is with
  19. two defines.
  20. CFG_JFFS2_FIRST_BANK
  21. defined the first flash bank to use
  22. CFG_JFFS2_FIRST_SECTOR
  23. defines the first sector to use
  24. The second way is to define CFG_JFFS_CUSTOM_PART and implement the
  25. jffs2_part_info(int part_num) function in your board specific files.
  26. In this mode CFG_JFFS2_FIRST_BANK and CFG_JFFS2_FIRST_SECTOR is not
  27. used.
  28. The input is a partition number starting with 0.
  29. Return a pointer to struct part_info or NULL for error;
  30. Ex jffs2_part_info() for one partition.
  31. ---
  32. #if defined CFG_JFFS_CUSTOM_PART
  33. #include <jffs2/jffs2.h>
  34. static struct part_info part;
  35. struct part_info*
  36. jffs2_part_info(int part_num)
  37. {
  38. if(part_num==0){
  39. if(part.usr_priv==(void*)1)
  40. return &part;
  41. memset(&part, 0, sizeof(part));
  42. part.offset=(char*)0xFF800000;
  43. part.size=1024*1024*8;
  44. /* Mark the struct as ready */
  45. part.usr_priv=(void*)1;
  46. return &part;
  47. }
  48. return 0;
  49. }
  50. #endif
  51. ---
  52. TODO.
  53. Add a new command so it's actually possible to change
  54. partition.
  55. Remove the assumption that JFFS can dereference a pointer
  56. into the disk. The current code do not work with memory holes
  57. or hardware with a sliding window (PCMCIA).