All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2] mvsata: issue hard reset on initialization
@ 2011-05-11 22:22 Michael Walle
  2011-05-19 19:42 ` Michael Walle
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Walle @ 2011-05-11 22:22 UTC (permalink / raw)
  To: u-boot

Before the actual initialization do a hard reset of the SATA port and the
connected device.

changes v1->v2:
 - add comment for udelay

Signed-off-by: Michael Walle <michael@walle.cc>
Cc: Prafulla Wadaskar <prafulla@marvell.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
---
 drivers/block/mvsata_ide.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/block/mvsata_ide.c b/drivers/block/mvsata_ide.c
index 3d6993a..83574ed 100644
--- a/drivers/block/mvsata_ide.c
+++ b/drivers/block/mvsata_ide.c
@@ -33,7 +33,9 @@
 
 /* SATA port registers */
 struct mvsata_port_registers {
-	u32 reserved1[192];
+	u32 reserved0[10];
+	u32 edma_cmd;
+	u32 reserved1[181];
 	/* offset 0x300 : ATA Interface registers */
 	u32 sstatus;
 	u32 serror;
@@ -76,6 +78,7 @@ struct mvsata_port_registers {
  * and for SStatus DETection.
  */
 
+#define MVSATA_EDMA_CMD_ATA_RST		0x00000004
 #define MVSATA_SCONTROL_DET_MASK		0x0000000F
 #define MVSATA_SCONTROL_DET_NONE		0x00000000
 #define MVSATA_SCONTROL_DET_INIT		0x00000001
@@ -115,6 +118,11 @@ static int mvsata_ide_initialize_port(struct mvsata_port_registers *port)
 	u32 status;
 	u32 timeleft = 10000; /* wait at most 10 ms for SATA reset to complete */
 
+	/* Hard reset */
+	writel(MVSATA_EDMA_CMD_ATA_RST, &port->edma_cmd);
+	udelay(25); /* taken from original marvell port */
+	writel(0, &port->edma_cmd);
+
 	/* Set control IPM to 3 (no low power) and DET to 1 (initialize) */
 	control = readl(&port->scontrol);
 	control = (control & ~MVSATA_SCONTROL_MASK) | MVSATA_PORT_INIT;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mvsata: issue hard reset on initialization
  2011-05-11 22:22 [U-Boot] [PATCH v2] mvsata: issue hard reset on initialization Michael Walle
@ 2011-05-19 19:42 ` Michael Walle
  2011-05-23  6:57   ` Albert ARIBAUD
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Walle @ 2011-05-19 19:42 UTC (permalink / raw)
  To: u-boot

Am Donnerstag 12 Mai 2011, 00:22:46 schrieb Michael Walle:
> Before the actual initialization do a hard reset of the SATA port and the
> connected device.
> 
> changes v1->v2:
>  - add comment for udelay


ping? :)

-- 
Michael

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH v2] mvsata: issue hard reset on initialization
  2011-05-19 19:42 ` Michael Walle
@ 2011-05-23  6:57   ` Albert ARIBAUD
  0 siblings, 0 replies; 3+ messages in thread
From: Albert ARIBAUD @ 2011-05-23  6:57 UTC (permalink / raw)
  To: u-boot

Le 19/05/2011 21:42, Michael Walle a ?crit :
> Am Donnerstag 12 Mai 2011, 00:22:46 schrieb Michael Walle:
>> Before the actual initialization do a hard reset of the SATA port and the
>> connected device.
>>
>> changes v1->v2:
>>   - add comment for udelay
>
>
> ping? :)

Apologies. Applied to u-boot-arm, thanks.

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-23  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11 22:22 [U-Boot] [PATCH v2] mvsata: issue hard reset on initialization Michael Walle
2011-05-19 19:42 ` Michael Walle
2011-05-23  6:57   ` Albert ARIBAUD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.