linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/2] MX53 Enable the AHCI SATA on MX53 LOCO
Date: Fri, 8 Apr 2011 18:18:10 +0200	[thread overview]
Message-ID: <20110408161810.GX7285@pengutronix.de> (raw)
In-Reply-To: <010C9052C42A00499CE76D637FA5EE900D942F@039-SN1MPN1-001.039d.mgd.msft.net>

On Fri, Apr 08, 2011 at 08:49:28AM +0000, Zhu Richard-R65037 wrote:
> >
> > When I read code like this I think that a devm_clk_get is overdue.
> >
> > Also, the ahci driver should handle the regular
> [Richard]Sorry, I can't catch what's the exact means of this comment.

devm_* are a set of functions which track the resources a driver
allocates and frees them automatically when the driver exits. See for
example the ahci driver. It uses devm_kzalloc and devm_ioremap.
devm_clk_get would be nice to have also.

> 
> >
> > > +
> > > +   tmpdata = readl(addr + HOST_CAP);
> > > +   if (!(tmpdata & HOST_CAP_SSS)) {
> > > +           tmpdata |= HOST_CAP_SSS;
> > > +           writel(tmpdata, addr + HOST_CAP);
> > > +   }
> >
> > According to the AHCI spec this bit is read only.
> >
> > > +
> > > +   if (!(readl(addr + HOST_PORTS_IMPL) & 0x1))
> > > +           writel((readl(addr + HOST_PORTS_IMPL) | 0x1),
> > > +                   addr + HOST_PORTS_IMPL);
> >
> > This is also readonly.
> >
> [Richard]:About the RO marked bits defined in the SPEC, there are used
>  as R/W bits in MX53 AHCI implementation actually.
> Here are the hack debug log:
> ----------Log--------------------
> HOST_CAP: 0x6726ff80
> HOST_CAP: 0x6f26ff80 <------------ After set the SSS bit.
> HOST_PT_IMPL: 0x0
> HOST_PT_IMPL: 0x1    <------------ After set the IMPL bit
> ahci: SSS flag set, parallel bus scan disabled
> ahci ahci.0: AHCI 0001.0100 32 slots 1 ports 3 Gbps 0x1 impl platform mode
> ahci ahci.0: flags: ncq sntf stag pm led clo only pmp pio slum part ccc
> scsi0 : ahci
> ata1: SATA max UDMA/133 irq_stat 0x00000040, connection status changed irq 28
> MXC MTD nand Driver 3.0
> ----------End--------------------

Sigh. At least they tried to implement a standard...

> > > +
> > > +   tmpdata = clk_get_rate(clk) / 1000;
> > > +   clk_put(clk);
> > > +   writel(tmpdata, addr + HOST_TIMER1MS);
> >
> > This should be in a more generic place as it needs to be done for every
> > board. We can put this into some i.MX53 startup function.
> >
> [Richard]How about put these codes into one standalone file in .../arch/arm/plat-mxc/ folder,
>  and export the sata_init and sata_exit out for kinds of MX53 boards?

Yes, probably except the special clock usage on the loco board.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

      reply	other threads:[~2011-04-08 16:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17  9:58 [PATCH V2 1/2] AHCI Add the AHCI SATA feature on MX53 platforms Richard Zhu
2011-03-17  9:58 ` [PATCH V2 2/2] MX53 Enable the AHCI SATA on MX53 LOCO Richard Zhu
2011-04-08  7:36   ` Sascha Hauer
2011-04-08  8:49     ` Zhu Richard-R65037
2011-04-08 16:18       ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110408161810.GX7285@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).