README.JFFS2 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 CONFIG_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. chpart - change active partition
  10. If you boot from a partition which is mounted writable, and you
  11. update your boot environment by replacing single files on that
  12. partition, you should also define CONFIG_SYS_JFFS2_SORT_FRAGMENTS. Scanning
  13. the JFFS2 filesystem takes *much* longer with this feature, though.
  14. Sorting is done while inserting into the fragment list, which is
  15. more or less a bubble sort. That algorithm is known to be O(n^2),
  16. thus you should really consider if you can avoid it!
  17. There is two ways for JFFS2 to find the disk. The default way uses
  18. the flash_info structure to find the start of a JFFS2 disk (called
  19. partition in the code) and you can change where the partition is with
  20. two defines.
  21. CONFIG_SYS_JFFS2_FIRST_BANK
  22. defined the first flash bank to use
  23. CONFIG_SYS_JFFS2_FIRST_SECTOR
  24. defines the first sector to use
  25. The second way is to define CONFIG_SYS_JFFS_CUSTOM_PART and implement the
  26. jffs2_part_info(int part_num) function in your board specific files.
  27. In this mode CONFIG_SYS_JFFS2_FIRST_BANK and CONFIG_SYS_JFFS2_FIRST_SECTOR is not
  28. used.
  29. The input is a partition number starting with 0.
  30. Return a pointer to struct part_info or NULL for error;
  31. Ex jffs2_part_info() for one partition.
  32. ---
  33. #if defined CONFIG_SYS_JFFS_CUSTOM_PART
  34. #include <jffs2/jffs2.h>
  35. static struct part_info part;
  36. struct part_info*
  37. jffs2_part_info(int part_num)
  38. {
  39. if(part_num==0){
  40. if(part.usr_priv==(void*)1)
  41. return &part;
  42. memset(&part, 0, sizeof(part));
  43. part.offset=(char*)0xFF800000;
  44. part.size=1024*1024*8;
  45. /* Mark the struct as ready */
  46. part.usr_priv=(void*)1;
  47. return &part;
  48. }
  49. return 0;
  50. }
  51. #endif
  52. ---
  53. TODO.
  54. Remove the assumption that JFFS can dereference a pointer
  55. into the disk. The current code do not work with memory holes
  56. or hardware with a sliding window (PCMCIA).