[PATCH 2/9] SPEAr13xx: Add source files

viresh kumar viresh.linux at gmail.com
Sat Apr 21 08:23:00 EDT 2012


On 4/20/12, Arnd Bergmann <arnd at arndb.de> wrote:
> On Friday 20 April 2012, Viresh Kumar wrote:
>
>> +static struct dw_dma_slave uart1_dma_param[] = {
>> +	{
> Again, I hope that we can remove this eventually when we have the DMA
> bindings, but it's ok for now.

Surely try do later, once those DT bindings are up.

>> +/* SATA device registration */
>> +static int sata_miphy_init(struct device *dev, void __iomem *addr)
>> +{
>> +	writel(SPEAR1340_SATA_CFG_VAL, SPEAR1340_PCIE_SATA_CFG);
>> +	writel(SPEAR1340_PCIE_SATA_MIPHY_CFG_SATA_25M_CRYSTAL_CLK,
>> +			SPEAR1340_PCIE_MIPHY_CFG);
>> +	/* Switch on sata power domain */
>> +	writel((readl(SPEAR1340_PCM_CFG) | (0x800)), SPEAR1340_PCM_CFG);
>> +	msleep(20);
>> +	/* Disable PCIE SATA Controller reset */
>> +	writel((readl(SPEAR1340_PERIP1_SW_RST) & (~0x1000)),
>> +			SPEAR1340_PERIP1_SW_RST);
>> +	msleep(20);
>> +
>> +	return 0;
>> +}
>> +
>> +void sata_miphy_exit(struct device *dev)
>> +{
>> +	writel(0, SPEAR1340_PCIE_SATA_CFG);
>> +	writel(0, SPEAR1340_PCIE_MIPHY_CFG);
>> +
>> +	/* Enable PCIE SATA Controller reset */
>> +	writel((readl(SPEAR1340_PERIP1_SW_RST) | (0x1000)),
>> +			SPEAR1340_PERIP1_SW_RST);
>> +	msleep(20);
>> +	/* Switch off sata power domain */
>> +	writel((readl(SPEAR1340_PCM_CFG) & (~0x800)), SPEAR1340_PCM_CFG);
>> +	msleep(20);
>> +}
>> +
>> +int sata_suspend(struct device *dev)
>> +{
>> +	if (dev->power.power_state.event == PM_EVENT_FREEZE)
>> +		return 0;
>> +
>> +	sata_miphy_exit(dev);
>> +
>> +	return 0;
>> +}
>
> I'd like to see this done differently, with a ahci_spear driver derived from
> ahci_platform that provides these functions in a modular driver that
> registers
> to a spear specific identifier string and is able to do the platform
> specific
> based on information it can find in the device tree. That would however
> require
> changes to the existing ahci_platform code and I'd first like to hear what
> Jeff and others have to say about this.

To get platform data for ahci with DT, we need to do as mentioned by you.
But for now maybe we can accept this approach. Once somebody fix ahci
DT support as you suggested, we could create such drivers.

--
viresh



More information about the linux-arm-kernel mailing list