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>
diff --git a/programmer.h b/programmer.h
index 50be159..4d153e6 100644
--- a/programmer.h
+++ b/programmer.h
@@ -69,6 +69,9 @@
#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 @@
#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 @@
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 @@
#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_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__ */