[flashrom] [commit] r1757 - trunk

repository service svn at flashrom.org
Wed Oct 2 03:22:17 CEST 2013


Author: stefanct
Date: Wed Oct  2 03:22:17 2013
New Revision: 1757
URL: http://flashrom.org/trac/flashrom/changeset/1757

Log:
rayer_spi: Fix Xilinx DLC-5 cable.

Pin 6 on LPT controls a pulldown on MISO/TDO signal. Whether there exists
an unbuffered clone is unknown. The author of the original patch confirmed
in private correspondence that the patch was incomplete. There has been
no sign of an unbuffered version on the interwebs, hence just change the
existing driver to disable the pulldown.

Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>

Modified:
   trunk/rayer_spi.c

Modified: trunk/rayer_spi.c
==============================================================================
--- trunk/rayer_spi.c	Wed Oct  2 03:22:11 2013	(r1756)
+++ trunk/rayer_spi.c	Wed Oct  2 03:22:17 2013	(r1757)
@@ -63,11 +63,16 @@
 	.miso_bit = 6,
 };
 
+static void dlc5_preinit(const void *);
+static int dlc5_shutdown(void *);
+
 static const struct rayer_pinout xilinx_dlc5 = {
 	.cs_bit = 2,
 	.sck_bit = 1,
 	.mosi_bit = 0,
 	.miso_bit = 4,
+	.preinit =  dlc5_preinit,
+	.shutdown = dlc5_shutdown,
 };
 
 static void byteblaster_preinit(const void *);
@@ -256,6 +261,21 @@
 	OUTB(lpt_outbyte, lpt_iobase);
 	return 0;
 }
+
+static void dlc5_preinit(const void *data) {
+	msg_pdbg("dlc5_preinit\n");
+	/* Assert pin 6 to receive MISO. */
+	lpt_outbyte |= (1<<4);
+	OUTB(lpt_outbyte, lpt_iobase);
+}
+
+static int dlc5_shutdown(void *data) {
+	msg_pdbg("dlc5_shutdown\n");
+	/* De-assert pin 6 to force MISO low. */
+	lpt_outbyte &= ~(1<<4);
+	OUTB(lpt_outbyte, lpt_iobase);
+	return 0;
+}
 
 #else
 #error PCI port I/O access is not supported on this architecture yet.




More information about the flashrom mailing list