summaryrefslogtreecommitdiffstats
path: root/programmer.h
diff options
context:
space:
mode:
authorVirgil-Adrian Teaca <darkstarlinux@gmail.com>2012-04-30 23:11:06 +0000
committerMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2012-04-30 23:11:06 +0000
commitacb4d41a0e87cfb96b6d10ce3e937795524a8400 (patch)
tree08bfe3653a11370baf4c5e1ad51d83da0012d8fc /programmer.h
parent3017bd90698e4c088f646cd033496aab795bc1d7 (diff)
downloadflashrom-acb4d41a0e87cfb96b6d10ce3e937795524a8400.zip
flashrom-acb4d41a0e87cfb96b6d10ce3e937795524a8400.tar.gz
Add serial port bitbanging code
This adds the pony_spi driver which supports the SI_Prog adapter, which is commonly used for SPI chips with PonyProg 2000, and a custom adapter called "SERBANG" which differs in the logic of two pins. Corresponding to flashrom svn r1525. Signed-off-by: Virgil-Adrian Teaca <darkstarlinux@gmail.com> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'programmer.h')
-rw-r--r--programmer.h40
1 files changed, 39 insertions, 1 deletions
diff --git a/programmer.h b/programmer.h
index 50be159..4d153e6 100644
--- a/programmer.h
+++ b/programmer.h
@@ -69,6 +69,9 @@ enum programmer {
#if CONFIG_RAYER_SPI == 1
PROGRAMMER_RAYER_SPI,
#endif
+#if CONFIG_PONY_SPI == 1
+ PROGRAMMER_PONY_SPI,
+#endif
#if CONFIG_NICINTEL == 1
PROGRAMMER_NICINTEL,
#endif
@@ -110,6 +113,9 @@ enum bitbang_spi_master_type {
#if CONFIG_RAYER_SPI == 1
BITBANG_SPI_MASTER_RAYER,
#endif
+#if CONFIG_PONY_SPI == 1
+ BITBANG_SPI_MASTER_PONY,
+#endif
#if CONFIG_NICINTEL_SPI == 1
BITBANG_SPI_MASTER_NICINTEL,
#endif
@@ -430,6 +436,11 @@ void print_supported_usbdevs(const struct usbdev_status *devs);
int rayer_spi_init(void);
#endif
+/* pony_spi.c */
+#if CONFIG_PONY_SPI == 1
+int pony_spi_init(void);
+#endif
+
/* bitbang_spi.c */
int bitbang_spi_init(const struct bitbang_spi_master *master);
@@ -492,7 +503,7 @@ enum spi_controller {
#if CONFIG_DEDIPROG == 1
SPI_CONTROLLER_DEDIPROG,
#endif
-#if CONFIG_OGP_SPI == 1 || CONFIG_NICINTEL_SPI == 1 || CONFIG_RAYER_SPI == 1 || (CONFIG_INTERNAL == 1 && (defined(__i386__) || defined(__x86_64__)))
+#if CONFIG_OGP_SPI == 1 || CONFIG_NICINTEL_SPI == 1 || CONFIG_RAYER_SPI == 1 || CONFIG_PONY_SPI == 1 || (CONFIG_INTERNAL == 1 && (defined(__i386__) || defined(__x86_64__)))
SPI_CONTROLLER_BITBANG,
#endif
#if CONFIG_LINUX_SPI == 1
@@ -636,4 +647,31 @@ int serialport_shutdown(void *data);
int serialport_write(unsigned char *buf, unsigned int writecnt);
int serialport_read(unsigned char *buf, unsigned int readcnt);
+/* Serial port/pin mapping:
+
+ 1 CD <-
+ 2 RXD <-
+ 3 TXD ->
+ 4 DTR ->
+ 5 GND --
+ 6 DSR <-
+ 7 RTS ->
+ 8 CTS <-
+ 9 RI <-
+*/
+enum SP_PIN {
+ PIN_CD = 1,
+ PIN_RXD,
+ PIN_TXD,
+ PIN_DTR,
+ PIN_GND,
+ PIN_DSR,
+ PIN_RTS,
+ PIN_CTS,
+ PIN_RI,
+};
+
+void sp_set_pin(enum SP_PIN pin, int val);
+int sp_get_pin(enum SP_PIN pin);
+
#endif /* !__PROGRAMMER_H__ */
OpenPOWER on IntegriCloud