aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_bf54x.c
diff options
context:
space:
mode:
authorsonic zhang <sonic.adi@gmail.com>2007-11-26 23:47:39 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-01 17:35:58 -0500
commitf88c480dac88a754f84e943cb5539d59cda3c089 (patch)
tree5c2485dcab759849ecfda80d2f6b0fdc93c983b1 /drivers/ata/pata_bf54x.c
parent92d499d991ec4f5cbd00d6f33967eab9d3ee8d6c (diff)
Set proper ATA UDMA mode for bf548 according to system clock.
UDMA Mode - Frequency compatibility UDMA5 - 100 MB/s - SCLK = 133 MHz UDMA4 - 66 MB/s - SCLK >= 80 MHz UDMA3 - 44.4 MB/s - SCLK >= 50 MHz UDMA2 - 33 MB/s - SCLK >= 40 MHz Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/pata_bf54x.c')
-rw-r--r--drivers/ata/pata_bf54x.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 81db405a5445..088a41f4e656 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1489,6 +1489,8 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev)
1489 int board_idx = 0; 1489 int board_idx = 0;
1490 struct resource *res; 1490 struct resource *res;
1491 struct ata_host *host; 1491 struct ata_host *host;
1492 unsigned int fsclk = get_sclk();
1493 int udma_mode = 5;
1492 const struct ata_port_info *ppi[] = 1494 const struct ata_port_info *ppi[] =
1493 { &bfin_port_info[board_idx], NULL }; 1495 { &bfin_port_info[board_idx], NULL };
1494 1496
@@ -1507,6 +1509,11 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev)
1507 if (res == NULL) 1509 if (res == NULL)
1508 return -EINVAL; 1510 return -EINVAL;
1509 1511
1512 while (bfin_port_info[board_idx].udma_mask>0 && udma_fsclk[udma_mode] > fsclk) {
1513 udma_mode--;
1514 bfin_port_info[board_idx].udma_mask >>= 1;
1515 }
1516
1510 /* 1517 /*
1511 * Now that that's out of the way, wire up the port.. 1518 * Now that that's out of the way, wire up the port..
1512 */ 1519 */