Ühel kenal päeval, K, 19.02.2014 kell 13:01, kirjutas Hans de Goede:
> From: Olliver Schinagl <[email protected]>
> 
> This patch adds support for the ahci sata controler found on Allwinner A10
> and A20 SoCs to the ahci_platform driver.
> 
> Orignally written by Olliver Schinagl using the approach of having a platform
> device which probe method creates a new child platform device which gets
> driven by ahci_platform.c, as done by ahci_imx.c .
> 
> Refactored by Hans de Goede to add most of the non sunxi specific 
> functionality
> to ahci_platform.c and use a platform_data pointer from of_device_id for the
> sunxi specific bits.
> 
> Signed-off-by: Olliver Schinagl <[email protected]>
> Signed-off-by: Hans de Goede <[email protected]>
> ---
>  .../devicetree/bindings/ata/ahci-platform.txt      |  15 +-
>  drivers/ata/Kconfig                                |   9 +
>  drivers/ata/Makefile                               |   1 +
>  drivers/ata/ahci_sunxi.c                           | 251 
> +++++++++++++++++++++
>  4 files changed, 273 insertions(+), 3 deletions(-)
>  create mode 100644 drivers/ata/ahci_sunxi.c
> 
> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt 
> b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> index 1ac807f..499bfed 100644
> --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
> @@ -4,7 +4,9 @@ SATA nodes are defined to describe on-chip Serial ATA 
> controllers.
>  Each SATA controller should have its own node.
>  
>  Required properties:
> -- compatible        : compatible list, contains "snps,spear-ahci"
> +- compatible        : compatible list, one of "snps,spear-ahci",
> +                      "snps,exynos5440-ahci", "ibm,476gtr-ahci", or
> +                      "allwinner,sun4i-a10-ahci"
>  - interrupts        : <interrupt mapping for SATA IRQ>
>  - reg               : <registers mapping>
>  
> @@ -13,10 +15,17 @@ Optional properties:
>  - clocks            : a list of phandle + clock specifier pairs
>  - target-supply     : regulator for SATA target power
>  
> -Example:
> +Examples:
>          sata@ffe08000 {
>               compatible = "snps,spear-ahci";
>               reg = <0xffe08000 0x1000>;
>               interrupts = <115>;
> -
>          };
> +
> +     ahci: sata@01c18000 {
> +             compatible = "allwinner,sun4i-a10-ahci";
> +             reg = <0x01c18000 0x1000>;
> +             interrupts = <56>;
> +             clocks = <&pll6 0>, <&ahb_gates 25>;
> +             target-supply = <&reg_ahci_5v>;
> +     };
> diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
> index 4e73772..cc67cc0 100644
> --- a/drivers/ata/Kconfig
> +++ b/drivers/ata/Kconfig
> @@ -106,6 +106,15 @@ config AHCI_IMX
>  
>         If unsure, say N.
>  
> +config AHCI_SUNXI
> +     tristate "Allwinner sunxi AHCI SATA support"
> +     depends on ARCH_SUNXI && SATA_AHCI_PLATFORM
> +     help
> +       This option enables support for the Allwinner sunxi SoC's
> +       onboard AHCI SATA.
> +
> +       If unsure, say N.
> +
>  config SATA_FSL
>       tristate "Freescale 3.0Gbps SATA support"
>       depends on FSL_SOC
> diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
> index 46518c6..246050b 100644
> --- a/drivers/ata/Makefile
> +++ b/drivers/ata/Makefile
> @@ -11,6 +11,7 @@ obj-$(CONFIG_SATA_SIL24)    += sata_sil24.o
>  obj-$(CONFIG_SATA_DWC)               += sata_dwc_460ex.o
>  obj-$(CONFIG_SATA_HIGHBANK)  += sata_highbank.o libahci.o
>  obj-$(CONFIG_AHCI_IMX)               += ahci_imx.o
> +obj-$(CONFIG_AHCI_SUNXI)     += ahci_sunxi.o
>  
>  # SFF w/ custom DMA
>  obj-$(CONFIG_PDC_ADMA)               += pdc_adma.o
> diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c
> new file mode 100644
> index 0000000..568a211
> --- /dev/null
> +++ b/drivers/ata/ahci_sunxi.c
> @@ -0,0 +1,251 @@
> +/*
> + * Allwinner sunxi AHCI SATA platform driver
> + * Copyright 2013 Olliver Schinagl <[email protected]>
> + * Copyright 2014 Hans de Goede <[email protected]>
> + *
> + * based on the AHCI SATA platform driver by Jeff Garzik and Anton Vorontsov
> + * Based on code from Allwinner Technology Co., Ltd. <www.allwinnertech.com>,
> + * Daniel Wang <[email protected]>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
> + * more details.
> + */
> +
> +#include <linux/ahci_platform.h>
> +#include <linux/clk.h>
> +#include <linux/errno.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of_device.h>
> +#include <linux/platform_device.h>
> +#include <linux/regulator/consumer.h>
> +#include "ahci.h"
> +
> +#define AHCI_BISTAFR 0x00a0
> +#define AHCI_BISTCR 0x00a4
> +#define AHCI_BISTFCTR 0x00a8
> +#define AHCI_BISTSR 0x00ac
> +#define AHCI_BISTDECR 0x00b0
> +#define AHCI_DIAGNR0 0x00b4
> +#define AHCI_DIAGNR1 0x00b8
> +#define AHCI_OOBR 0x00bc
> +#define AHCI_PHYCS0R 0x00c0
> +#define AHCI_PHYCS1R 0x00c4
> +#define AHCI_PHYCS2R 0x00c8
> +#define AHCI_TIMER1MS 0x00e0
> +#define AHCI_GPARAM1R 0x00e8
> +#define AHCI_GPARAM2R 0x00ec
> +#define AHCI_PPARAMR 0x00f0
> +#define AHCI_TESTR 0x00f4
> +#define AHCI_VERSIONR 0x00f8
> +#define AHCI_IDR 0x00fc
> +#define AHCI_RWCR 0x00fc

Duplicate 0x00fc


Päikest,
Priit Laes :)

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to