summaryrefslogtreecommitdiff
path: root/firmware/src/simtrace/spi_flash.h
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-11-17 20:12:39 +0100
committerHarald Welte <laforge@gnumonks.org>2013-11-17 20:12:39 +0100
commit1e8df4869c05c75d6b094c3f324825be4f6aff19 (patch)
tree9209e764794fbb8309020cfbcf4a222a805c0d35 /firmware/src/simtrace/spi_flash.h
parent6ea973b79ef8f53a250313f34218680a7b5fb1b4 (diff)
spi_flash: add code for OTP read/write
Diffstat (limited to 'firmware/src/simtrace/spi_flash.h')
-rw-r--r--firmware/src/simtrace/spi_flash.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/src/simtrace/spi_flash.h b/firmware/src/simtrace/spi_flash.h
new file mode 100644
index 0000000..d823130
--- /dev/null
+++ b/firmware/src/simtrace/spi_flash.h
@@ -0,0 +1,19 @@
+#ifndef SPI_FLASH_H
+#define SPI_FLASH_H
+
+#include <sys/types.h>
+
+#define OTP_ADDR(x) (0x114 + ( ((x) - 1) * 16 ) )
+
+void spiflash_init(void);
+void spiflash_get_id(u_int8_t *id);
+int spiflash_read_status(void);
+void spiflash_clear_status(void);
+void spiflash_write_protect(int on);
+int spiflash_write_enable(int enable);
+int spiflash_otp_read(u_int32_t otp_addr, u_int8_t *out, u_int16_t rx_len);
+int spiflash_otp_write(u_int32_t otp_addr, u_int8_t data);
+int spiflash_otp_get_lock(u_int8_t region);
+int spiflash_otp_set_lock(u_int8_t region);
+
+#endif
personal git repositories of Harald Welte. Your mileage may vary