diff options
author | Tejun Heo <htejun@gmail.com> | 2006-04-11 09:32:19 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-04-11 13:31:36 -0400 |
commit | b5bc421c96ca56a9abaad4619da01fe0071904a2 (patch) | |
tree | 524f5edb321970e1595e9c6c940bc221ef41184f /drivers/scsi/sata_sil24.c | |
parent | 37024e8ee0d8dbcd0c2634192cb3836549db054e (diff) |
[PATCH] sata_sil24: implement sil24_init_port()
Implement sil24_init_port which performs port initialization via
PORT_CS_INIT. To be used later by softreset and EH.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/sata_sil24.c')
-rw-r--r-- | drivers/scsi/sata_sil24.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/scsi/sata_sil24.c b/drivers/scsi/sata_sil24.c index c535607e995a..8199527966eb 100644 --- a/drivers/scsi/sata_sil24.c +++ b/drivers/scsi/sata_sil24.c | |||
@@ -437,6 +437,22 @@ static void sil24_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | |||
437 | *tf = pp->tf; | 437 | *tf = pp->tf; |
438 | } | 438 | } |
439 | 439 | ||
440 | static int sil24_init_port(struct ata_port *ap) | ||
441 | { | ||
442 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; | ||
443 | u32 tmp; | ||
444 | |||
445 | writel(PORT_CS_INIT, port + PORT_CTRL_STAT); | ||
446 | ata_wait_register(port + PORT_CTRL_STAT, | ||
447 | PORT_CS_INIT, PORT_CS_INIT, 10, 100); | ||
448 | tmp = ata_wait_register(port + PORT_CTRL_STAT, | ||
449 | PORT_CS_RDY, 0, 10, 100); | ||
450 | |||
451 | if ((tmp & (PORT_CS_INIT | PORT_CS_RDY)) != PORT_CS_RDY) | ||
452 | return -EIO; | ||
453 | return 0; | ||
454 | } | ||
455 | |||
440 | static int sil24_softreset(struct ata_port *ap, unsigned int *class) | 456 | static int sil24_softreset(struct ata_port *ap, unsigned int *class) |
441 | { | 457 | { |
442 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; | 458 | void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr; |