Skip to contentSkip to conversation

driver: ata: add new Exynos5250 SATA controller driver

PATCH In review Vasanth Ananthan 2 participants 2 messages Jan 29, 2013 – Jan 30, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver: ata: add new Exynos5250 SATA controller driver

Adding platform driver for AHCI based SATA controller for Exynos5250. The SATA controller in Exynos5250 is an AHCI based controller. Though the controller implements only one port, the driver is scalable for maximum number of ports possible. The drivers uses libahci framework to initialize the controller and the ports implemented.

The driver also initializes the PHY controllers associated with the sata controller, for which the port-phy mapping have to provided in the device tree node of the sata controller node. The driver extracts the device_node of the PHY controller provided in the mapping, passes it the SATA PHY framework. The framework, return the corresponding PHY, if it has be registered with the framework, after which the driver intializes the PHY controller(s).

---
 .../devicetree/bindings/ata/exynos-sata.txt        |   16 +-
 drivers/ata/Kconfig                                |   12 +
 drivers/ata/Makefile                               |    1 +
 drivers/ata/sata_exynos.c                          |  308 ++++++++++++++++++++
 4 files changed, 336 insertions(+), 1 deletion(-)
 create mode 100644 drivers/ata/sata_exynos.c
Documentation/devicetree/bindings/ata/exynos-sata.txt +15 -1
index 0849f10..7247ad2 100644
@@ -8,10 +8,24 @@ Required properties:
 - interrupts        : <interrupt mapping for SATA IRQ>
 - reg               : <registers mapping>
 - samsung,sata-freq : <frequency in MHz>
+- samsung,exynos-sata-phy" : <phandle> This property specifies the PHY
+controller handle associated with each port in order.
 
-Example:
+Example: SATA with 2 port
         sata@ffe08000 {
                 compatible = "samsung,exynos5-sata";
                 reg = <0xffe08000 0x1000>;
                 interrupts = <115>;
+		samsung,sata-freq = <52>;
+		samsung,exynos-sata-phy = <&phy0 &phy1>;
+		};
         };
+
+	phy0: sata-phy@ffe09000 {
+		compatible = "samsung,exynos5250-sata-phy";
+		reg = <0xffe09000 0x1ff>;
+	}
+	phy1: sata-phy@ffe07000 {
+                compatible = "samsung,exynos5250-sata-phy";
+                reg = <0xffe07000 0x1ff>;
+        }
drivers/ata/Kconfig +12 -0
index 99c1e1b..8e61cf5 100644
@@ -106,6 +106,18 @@ config SATA_PHY
 	  registers itself with the framework through the APIs provided and the SATA
 	  controller finds and requests for an appropriate PHY controller.
 
+config SATA_EXYNOS
+        bool "Exynos SATA AHCI support"
+        select I2C
+        select HAVE_S3C2410_I2C
+        select I2C_S3C2410
+        select SATA_PHY
+        help
+          This option enables support for Exynos AHCI Serial ATA
+          controllers.
+
+          If unsure, say N.
+
 config SATA_FSL
 	tristate "Freescale 3.0Gbps SATA support"
 	depends on FSL_SOC
drivers/ata/Makefile +1 -0
index 7add682..c3a97f0 100644
@@ -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_SATA_PHY)		+= sata_phy.o sata_exynos_phy.o
+obj-$(CONFIG_SATA_EXYNOS)	+= sata_exynos.o libahci.o
 
 # SFF w/ custom DMA
 obj-$(CONFIG_PDC_ADMA)		+= pdc_adma.o
drivers/ata/sata_exynos.c new file +308 -0

308 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 16 lines · Vasanth Ananthan

Adding platform driver for AHCI based SATA controller for Exynos5250. The SATA controller in Exynos5250 is an AHCI based controller. Though the controller implements only one port, the driver is scalable for maximum number of ports possible. The drivers uses libahci framework to initialize the controller and the ports implemented.

The driver also initializes the PHY controllers associated with the sata controller, for which the port-phy mapping have to provided in the device tree node of the sata controller node. The driver extracts the device_node of the PHY controller provided in the mapping, passes it the SATA PHY framework. The framework, return the corresponding PHY, if it has be registered with the framework, after which the driver intializes the PHY controller(s).

---

[ ... ]

drivers/ata/sata_exynos.c line 64

Quoted 3 lines
drivers/ata/sata_exynos.c new file +3 -0
+
+static int __init exynos_sata_probe(struct platform_device *pdev)
+{

__init would result in a section mismatch warning.

[ ... ]

drivers/ata/sata_exynos.c line 269

Quoted 3 lines
drivers/ata/sata_exynos.c new file +3 -0
+
+static int __devexit exynos_sata_remove(struct platform_device *pdev)
+{

Use of __devexit is deprecated now. Please remove that.

Signature · 1 line
Tushar Behera