serprog.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * This file is part of the flashrom project.
  3. *
  4. * Copyright (C) 2009, 2011 Urja Rannikko <urjaman@gmail.com>
  5. * Copyright (C) 2009 Carl-Daniel Hailfinger
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. */
  17. /* According to Serial Flasher Protocol Specification - version 1 */
  18. #define S_ACK 0x06
  19. #define S_NAK 0x15
  20. #define S_CMD_NOP 0x00 /* No operation */
  21. #define S_CMD_Q_IFACE 0x01 /* Query interface version */
  22. #define S_CMD_Q_CMDMAP 0x02 /* Query supported commands bitmap */
  23. #define S_CMD_Q_PGMNAME 0x03 /* Query programmer name */
  24. #define S_CMD_Q_SERBUF 0x04 /* Query Serial Buffer Size */
  25. #define S_CMD_Q_BUSTYPE 0x05 /* Query supported bustypes */
  26. #define S_CMD_Q_CHIPSIZE 0x06 /* Query supported chipsize (2^n format) */
  27. #define S_CMD_Q_OPBUF 0x07 /* Query operation buffer size */
  28. #define S_CMD_Q_WRNMAXLEN 0x08 /* Query Write to opbuf: Write-N maximum length */
  29. #define S_CMD_R_BYTE 0x09 /* Read a single byte */
  30. #define S_CMD_R_NBYTES 0x0A /* Read n bytes */
  31. #define S_CMD_O_INIT 0x0B /* Initialize operation buffer */
  32. #define S_CMD_O_WRITEB 0x0C /* Write opbuf: Write byte with address */
  33. #define S_CMD_O_WRITEN 0x0D /* Write to opbuf: Write-N */
  34. #define S_CMD_O_DELAY 0x0E /* Write opbuf: udelay */
  35. #define S_CMD_O_EXEC 0x0F /* Execute operation buffer */
  36. #define S_CMD_SYNCNOP 0x10 /* Special no-operation that returns NAK+ACK */
  37. #define S_CMD_Q_RDNMAXLEN 0x11 /* Query read-n maximum length */
  38. #define S_CMD_S_BUSTYPE 0x12 /* Set used bustype(s). */
  39. #define S_CMD_O_SPIOP 0x13 /* Perform SPI operation. */
  40. #define S_CMD_S_SPI_FREQ 0x14 /* Set SPI clock frequency */
  41. #define S_CMD_S_PIN_STATE 0x15 /* Enable/disable output drivers */