From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Wed, 04 Aug 2010 22:03:37 +0200 Subject: [U-Boot] [PATCH V5 4/4] edminiv2: add mvsata_ide and cmd_ide support In-Reply-To: <4C591584.4020709@free.fr> References: <1279022559-15772-1-git-send-email-albert.aribaud@free.fr> <1279022559-15772-2-git-send-email-albert.aribaud@free.fr> <1279022559-15772-3-git-send-email-albert.aribaud@free.fr> <1279022559-15772-4-git-send-email-albert.aribaud@free.fr> <4C49740D.3020003@free.fr> <4C55B043.3020604@free.fr> <4C5661FE.506@free.fr> <4C58051A.30606@free.fr> <4C591584.4020709@free.fr> Message-ID: <4C59C799.7040508@free.fr> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Le 04/08/2010 09:23, Albert ARIBAUD a ?crit : > Le 04/08/2010 08:08, Prafulla Wadaskar a ?crit : >> 3. Instead of adding fixed 41/50 usec delay between the writes to >> Scontrol It would be good if you can check/poll some status bit >> associated with IDE controller, this will make mvsata driver rock >> solid on any platform. > > I've looked up the marvell kirkwood and orion docs for such a control > bit but found none. I'll look it up again, however it might help if > you can find someone inside Marvell who would, and could, provide the > info. I think I've found out how it works. I initially thought the DET field in SControl was a sort of reset line, and that writing a 1 would put the controller in continuous reset and writing a 0 to put it out of reset. But actually, DET is a command field : a write of 1 starts the reset sequence immediately: the DET field of the SStatus register will go from 0 to 3 (possibly passing through 1). Then you can set SControl's DET back to 0 so that you can use the port. Thus the init sequence becomes: write 3 to SControl's IPM and 1 to DET, read SStatus until its DET field is 3, write 0 to SControl's DET. However I'll keep a timeout value in the status read loop, because you can't expect SStatus to become 3: it could stay 0 if no drive is connected, for instance. If I did not keep a timeout, u-boot would freeze. :/ Amicalement, -- Albert.