From: "mmcx@mail.ru" mmcx@mail.ru
Signed-off-by: Maksim Kuleshov mmcx@mail.ru Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- rayer_spi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/rayer_spi.c b/rayer_spi.c index a2338b6..a705aad 100644 --- a/rayer_spi.c +++ b/rayer_spi.c @@ -96,11 +96,24 @@ static struct rayer_pinout altera_byteblaster = { .shutdown = byteblaster_shutdown, };
+static void stk200_preinit(void *); +static int stk200_shutdown(void *); + +static struct rayer_pinout atmel_stk200 = { + .cs_bit = 7, + .sck_bit = 4, + .mosi_bit = 5, + .miso_bit = 6, + .preinit = stk200_preinit, + .shutdown = stk200_shutdown, +}; + struct rayer_programmer rayer_spi_types[] = { {"rayer", NT, "RayeR SPIPGM", &rayer_spipgm}, {"xilinx", NT, "Xilinx Parallel Cable III (DLC 5)", &xilinx_dlc5}, {"dlc-5b", NT, "Xilinx Parallel Cable III (DLC 5) (buffered)", &xilinx_dlc5b}, {"byteblaster", NT, "Altera ByteBlaster", &altera_byteblaster}, + {"stk200", NT, "Atmel STK200/300 adapter", &atmel_stk200}, {0}, };
@@ -251,6 +264,21 @@ static int byteblaster_shutdown(void * data){ return 0; }
+static void stk200_preinit(void *data) { + msg_pdbg("stk200_init\n"); + /* Assert #EN signals, set LED signal. */ + lpt_outbyte = (1 << 6) ; + OUTB(lpt_outbyte, lpt_iobase); +} + +static int stk200_shutdown(void *data) { + msg_pdbg("stk200_shutdown\n"); + /* Assert #EN signals, clear LED signal. */ + lpt_outbyte = (1 << 2) | (1 << 3); + OUTB(lpt_outbyte, lpt_iobase); + return 0; +} + #else #error PCI port I/O access is not supported on this architecture yet. #endif