提交 630a8b25 编写于 作者: A Atsushi Nemoto 提交者: Bartlomiej Zolnierkiewicz

tx4938ide: Check minimum cycle time and SHWT range (v2)

SHWT value is used as address valid to -CSx assertion and -CSx to -DIOx
assertion setup time, and contrarywise, -DIOx to -CSx release and -CSx
release to address invalid hold time, so it actualy applies 4 times and
so constitutes -DIOx recovery time.  Check requirement of the recovery
time and cycle time.  Also check SHWT maximum value.
Suggested-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: NAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: ralf@linux-mips.org
Acked-by: NSergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: NBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
上级 ccd32e22
...@@ -39,10 +39,17 @@ static void tx4938ide_tune_ebusc(unsigned int ebus_ch, ...@@ -39,10 +39,17 @@ static void tx4938ide_tune_ebusc(unsigned int ebus_ch,
/* Address-valid to DIOR/DIOW setup */ /* Address-valid to DIOR/DIOW setup */
shwt = DIV_ROUND_UP(t->setup, cycle); shwt = DIV_ROUND_UP(t->setup, cycle);
/* -DIOx recovery time (SHWT * 4) and cycle time requirement */
while ((shwt * 4 + wt + (wt ? 2 : 3)) * cycle < t->cycle)
shwt++;
if (shwt > 7) {
pr_warning("tx4938ide: SHWT violation (%d)\n", shwt);
shwt = 7;
}
pr_debug("tx4938ide: ebus %d, bus cycle %dns, WT %d, SHWT %d\n", pr_debug("tx4938ide: ebus %d, bus cycle %dns, WT %d, SHWT %d\n",
ebus_ch, cycle, wt, shwt); ebus_ch, cycle, wt, shwt);
__raw_writeq((cr & ~(0x3f007ull)) | (wt << 12) | shwt, __raw_writeq((cr & ~0x3f007ull) | (wt << 12) | shwt,
&tx4938_ebuscptr->cr[ebus_ch]); &tx4938_ebuscptr->cr[ebus_ch]);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册