dv-cfi.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* Common Flash Memory Interface (CFI) model.
  2. Copyright (C) 2010-2015 Free Software Foundation, Inc.
  3. Contributed by Analog Devices, Inc.
  4. This file is part of simulators.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef DV_CFI_H
  16. #define DV_CFI_H
  17. /* CFI standard. */
  18. #define CFI_CMD_CFI_QUERY 0x98
  19. #define CFI_ADDR_CFI_QUERY_START 0x55
  20. #define CFI_ADDR_CFI_QUERY_RESULT 0x10
  21. #define CFI_CMD_READ 0xFF
  22. #define CFI_CMD_RESET 0xF0
  23. #define CFI_CMD_READ_ID 0x90
  24. /* Intel specific. */
  25. #define CFI_CMDSET_INTEL 0x0001
  26. #define INTEL_CMD_STATUS_CLEAR 0x50
  27. #define INTEL_CMD_STATUS_READ 0x70
  28. #define INTEL_CMD_WRITE 0x40
  29. #define INTEL_CMD_WRITE_ALT 0x10
  30. #define INTEL_CMD_WRITE_BUFFER 0xE8
  31. #define INTEL_CMD_WRITE_BUFFER_CONFIRM 0xD0
  32. #define INTEL_CMD_LOCK_SETUP 0x60
  33. #define INTEL_CMD_LOCK_BLOCK 0x01
  34. #define INTEL_CMD_UNLOCK_BLOCK 0xD0
  35. #define INTEL_CMD_LOCK_DOWN_BLOCK 0x2F
  36. #define INTEL_CMD_ERASE_BLOCK 0x20
  37. #define INTEL_CMD_ERASE_CONFIRM 0xD0
  38. /* Intel Status Register bits. */
  39. #define INTEL_SR_BWS (1 << 0) /* BEFP Write. */
  40. #define INTEL_SR_BLS (1 << 1) /* Block Locked. */
  41. #define INTEL_SR_PSS (1 << 2) /* Program Suspend. */
  42. #define INTEL_SR_VPPS (1 << 3) /* Vpp. */
  43. #define INTEL_SR_PS (1 << 4) /* Program. */
  44. #define INTEL_SR_ES (1 << 5) /* Erase. */
  45. #define INTEL_SR_ESS (1 << 6) /* Erase Suspend. */
  46. #define INTEL_SR_DWS (1 << 7) /* Device Write. */
  47. #define INTEL_ID_MANU 0x89
  48. #endif