Author: dgorbachev
Date: Fri Oct 14 05:33:49 2011
New Revision: 54130
URL: http://svn.reactos.org/svn/reactos?rev=54130&view=rev
Log:
[UNIATA]
Nathan Lineback <~lineback~AT~toastytech~DOT~com~>:
- Apply the Linux fix to UniATA. Bug #6500.
Modified:
trunk/reactos/drivers/storage/ide/uniata/id_init.cpp
Modified: trunk/reactos/drivers/storage/ide/uniata/id_init.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_init.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_init.cpp [iso-8859-1] Fri Oct 14 05:33:49 2011
@@ -854,6 +854,32 @@
ULONG IoSize = 0;
ULONG BaseMemAddress = 0;
+
+ /*
+ * vt6420/1 has problems talking to some drives. The following
+ * is based on the fix from Joseph Chan <JosephChan(a)via.com.tw>.
+ *
+ * When host issues HOLD, device may send up to 20DW of data
+ * before acknowledging it with HOLDA and the host should be
+ * able to buffer them in FIFO. Unfortunately, some WD drives
+ * send upto 40DW before acknowledging HOLD and, in the
+ * default configuration, this ends up overflowing vt6421's
+ * FIFO, making the controller abort the transaction with
+ * R_ERR.
+ *
+ * Rx52[2] is the internal 128DW FIFO Flow control watermark
+ * adjusting mechanism enable bit and the default value 0
+ * means host will issue HOLD to device when the left FIFO
+ * size goes below 32DW. Setting it to 1 makes the watermark
+ * 64DW.
+ *
+ * http://www.reactos.org/bugzilla/show_bug.cgi?id=6500
+ */
+
+ if(DeviceID == 0x3149 || DeviceID == 0x3249) { //vt6420 or vt6421
+ KdPrint2((PRINT_PREFIX "VIA 642x FIFO\n"));
+ ChangePciConfig1(0x52, a | (1 << 2));
+ }
switch(DeviceID) {
case 0x3149: // VIA 6420