README.cfi 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. The common CFI driver provides this weak default implementation for
  2. flash_cmd_reset():
  3. static void __flash_cmd_reset(flash_info_t *info)
  4. {
  5. /*
  6. * We do not yet know what kind of commandset to use, so we issue
  7. * the reset command in both Intel and AMD variants, in the hope
  8. * that AMD flash roms ignore the Intel command.
  9. */
  10. flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
  11. udelay(1);
  12. flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
  13. }
  14. void flash_cmd_reset(flash_info_t *info)
  15. __attribute__((weak,alias("__flash_cmd_reset")));
  16. Some flash chips seem to have trouble with this reset sequence.
  17. In this case, board-specific code can override this weak default
  18. version with a board-specific function.
  19. At the time of writing, there are two boards that define their own
  20. routine for this.
  21. First, the digsy_mtc board equipped with the M29W128GH from Numonyx
  22. needs this version to function properly:
  23. void flash_cmd_reset(flash_info_t *info)
  24. {
  25. flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
  26. }
  27. In addition, the t3corp board defines the routine thusly:
  28. void flash_cmd_reset(flash_info_t *info)
  29. {
  30. /*
  31. * FLASH at address CONFIG_SYS_FLASH_BASE is a Spansion chip and
  32. * needs the Spansion type reset commands. The other flash chip
  33. * is located behind a FPGA (Xilinx DS617) and needs the Intel type
  34. * reset command.
  35. */
  36. if (info->start[0] == CONFIG_SYS_FLASH_BASE)
  37. flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
  38. else
  39. flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
  40. }
  41. see also:
  42. http://www.mail-archive.com/u-boot@lists.denx.de/msg24368.html
  43. Config Option
  44. CONFIG_SYS_MAX_FLASH_SECT: Number of sectors available on Flash device
  45. CONFIG_SYS_FLASH_CFI_WIDTH: Data-width of the flash device
  46. CONFIG_CMD_FLASH: Enables Flash command library
  47. CONFIG_FLASH_CFI_DRIVER: Enables CFI Flash driver
  48. CONFIG_FLASH_CFI_MTD: Enables MTD frame work for NOR Flash devices