summaryrefslogtreecommitdiff
path: root/rayer_spi.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-10-02 01:22:17 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2013-10-02 01:22:17 +0000
commitb75373375499344ed99c2ac623379771a4aaef3a (patch)
tree27867f78877f589c05b554f476f975c17ac91d51 /rayer_spi.c
parent4cb0e2fbe8f669650c94fe8a6cbacb3394ceafa5 (diff)
downloadflashrom-b75373375499344ed99c2ac623379771a4aaef3a.tar.gz
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@gmail.com> Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1757 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'rayer_spi.c')
-rw-r--r--rayer_spi.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/rayer_spi.c b/rayer_spi.c
index f8dff95..189341a 100644
--- a/rayer_spi.c
+++ b/rayer_spi.c
@@ -63,11 +63,16 @@ static const struct rayer_pinout rayer_spipgm = {
.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 *);
@@ -257,6 +262,21 @@ static int stk200_shutdown(void *data) {
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.
#endif