Re: [PATCH 2/3] ARM: sunxi: Add an ahci-platform compatible AHCIdriver for the Allwinner SUNXi series of SoCs

From: Olliver Schinagl
Date: Thu Dec 12 2013 - 03:49:31 EST



On 12-12-13 07:40, Shawn Guo wrote:
On Wed, Dec 11, 2013 at 03:51:51PM +0100, Olliver Schinagl wrote:
Working on this and studying the existing
ahci_platform/shci_platform drivers the last few days and was
figuring out why ahci_platform only supports 1 clock. IMX handles
this by having 3 clocks defined in the DT, the first one gets
enabled by default via ahci_platform, the other 2 get enabled in
IMX's probe function.

Is it an idea to extend this to support all clocks that would be
required (via a callback)?
Not really. We did this for ahci_imx driver only because we do not want
to churn generic ahci_platform driver with those imx specific setup
code. Note, beside the additional two clocks, we have some PHY
parameters to set up in IMX IOMUXC general purpose registers, and vendor
specific register HOST_TIMER1MS to be set up as well.
Well many SoC's have these specific things so we need a place to provide for this.

The the question then becomes, what do we define as being the common clocks? Only the clock for the SATA IP? Or also the clock to which it connects to the bus? Where is the line drawn etc.

E.g. a rewritten new ahci-pltfrm.c will support all clocks defined in the DT for the ahci node.

Or do we prefer having the clocks
separated for other technical reasons? Or do we want to handle the
clocks via the ahci_platform framework and extend hpriv->clk to an
array of clocks?
The direction of the generic ahci platform driver will be having it be
a library providing helper functions, as discussed as below.

https://lkml.org/lkml/2013/12/6/153
I know, I started this entire thread :p hence my question :)

Oliver

We can ask the helper function to handle the common clocks and leave the
platform specific ones to platform driver.

Shawn


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/