Exynos5250 SATA Support
Subsystems (4)
v9 cover Exynos5250 SATA Support
This patch series enable the SATA support on Exynos5250 based boards. It incorporates the generic phy framework to deal with sata phy.
Yuvaraj Kumar C D (2):
PHY: Exynos: Add Exynos5250 SATA PHY driver
ARM: dts: Enable ahci sata and sata phy
.../devicetree/bindings/ata/exynos-sata-phy.txt | 14 -- .../devicetree/bindings/ata/exynos-sata.txt | 25 +- .../devicetree/bindings/phy/samsung-phy.txt | 36 +++ arch/arm/boot/dts/exynos5250-arndale.dts | 21 ++ arch/arm/boot/dts/exynos5250-smdk5250.dts | 17 +- arch/arm/boot/dts/exynos5250.dtsi | 18 +- drivers/phy/Kconfig | 15 ++ drivers/phy/Makefile | 1 + drivers/phy/phy-exynos5250-sata.c | 251 ++++++++++++++++++++ 9 files changed, 365 insertions(+), 33 deletions(-) delete mode 100644 Documentation/devicetree/bindings/ata/exynos-sata-phy.txt create mode 100644 drivers/phy/phy-exynos5250-sata.c
Signature · 1 line
1.7.10.4
PATCH v9 1/2 PHY: Exynos: Add Exynos5250 SATA PHY driver
This patch adds the SATA PHY driver for Exynos5250.This driver uses the generic PHY framework to deal with SATA PHY.Exynos5250 SATA PHY comprises of CMU and TRSV blocks which are of I2C register Map.So this driver configures the CMU and TRSV block of exynos5250 SATA PHY using i2c.
---
Changes from V8:
1. Updated commit message.
Changes from V7:
1.Used BIT macro and made CONFIG_PHY_EXYNOS5250_SATA
depends on HAS_IOMEM and OF.
Changes from V6:
1.Removed phy-exynos5250-sata-i2c.c,as it is not required
after moving to of_find_i2c_device_by_node().
2.Changed struct __iomem *pmureg to struct regmap *pmureg. 3.Changed the wait_for_reg_status() to return 0 or -EFAULT.
Changes from V5:
1.Rebased on latest generic PHY framework for-next tree. 2.Minor nits such as indentations.
Changes from V4:
1.Made Exynos5250 SATA PHY driver by default selects CONFIG_I2C and CONFIG_I2C_S3C2410, as SATA PHY driver depends on I2C.
2.struct i2c_driver sataphy_i2c_driver made static which was earlier global type.
3.Renamed the files to phy-exynos5250-sata.c and phy-exynos5250-sata-i2c.c and CONFIG_EXYNOS5250_SATA_PHY to CONFIG_PHY_EXYNOS5250_SATA.
Changes from V3:
1.Moved devm_phy_create before to devm_phy_provider_register.
Changes from V2:
1.Removed of_match_table
2.Moved to syscon interface for PMU handling.
Changes from V1:
1.Adapted to latest version of Generic PHY framework 2.Removed exynos_sata_i2c_remove function.
drivers/phy/Kconfig | 15 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-exynos5250-sata.c | 251 +++++++++++++++++++++++++++++++++++++ 3 files changed, 267 insertions(+) create mode 100644 drivers/phy/phy-exynos5250-sata.c
drivers/phy/Kconfig +15 -0
@@ -70,4 +70,19 @@ config BCM_KONA_USB2_PHY help Enable this to support the Broadcom Kona USB 2.0 PHY. +config PHY_EXYNOS5250_SATA + tristate "Exynos5250 Sata SerDes/PHY driver" + depends on SOC_EXYNOS5250 + depends on HAS_IOMEM + depends on OF + select GENERIC_PHY + select I2C + select I2C_S3C2410 + select MFD_SYSCON + help + Enable this to support SATA SerDes/Phy found on Samsung's + Exynos5250 based SoCs.This SerDes/Phy supports SATA 1.5 Gb/s, + SATA 3.0 Gb/s, SATA 6.0 Gb/s speeds. It supports one SATA host + port to accept one SATA device. + endmenu
drivers/phy/Makefile +1 -0
@@ -9,3 +9,4 @@ obj-$(CONFIG_PHY_EXYNOS_MIPI_VIDEO) += phy-exynos-mipi-video.o obj-$(CONFIG_PHY_MVEBU_SATA) += phy-mvebu-sata.o obj-$(CONFIG_OMAP_USB2) += phy-omap-usb2.o obj-$(CONFIG_TWL4030_USB) += phy-twl4030-usb.o +obj-$(CONFIG_PHY_EXYNOS5250_SATA) += phy-exynos5250-sata.o
drivers/phy/phy-exynos5250-sata.c new file +251 -0
251 lines not on this page · raw message
Signature · 1 line
1.7.10.4
PATCH v9 2/2 ARM: dts: Enable ahci sata and sata phy
In reply to Yuvaraj Kumar C DThis patch adds dt entry for ahci sata controller and its corresponding phy controller.phy node has been added w.r.t new generic phy framework.
---
Changes since V8:
1.sata at 122f0000 and sata_phy at 12170000 disabled by default in SOC specific dts file and enabled the same in board dts file.
Changes since V7:
1.syscon-phandle name updated.
Changes since V6:none
Changes since V5:none
Changes since V4:
1.Used the new phandle "sata_phy_i2c" in the DT entry. 2.Updated binding document.
Changes since V3:
1.Moved the binding info to the /bindings/phy/
Changes since V2:
1.Used syscon interface to PMU handling. 2.Changed "sata-phy-i2c" to "exynos-sataphy-i2c".
Changes since V1:
1.Minor changes to node name convention.
2.Updated binding document.
.../devicetree/bindings/ata/exynos-sata-phy.txt | 14 -------- .../devicetree/bindings/ata/exynos-sata.txt | 25 +++++++++----- .../devicetree/bindings/phy/samsung-phy.txt | 36 ++++++++++++++++++++ arch/arm/boot/dts/exynos5250-arndale.dts | 21 ++++++++++++ arch/arm/boot/dts/exynos5250-smdk5250.dts | 17 +++++---- arch/arm/boot/dts/exynos5250.dtsi | 18 +++++++--- 6 files changed, 98 insertions(+), 33 deletions(-) delete mode 100644 Documentation/devicetree/bindings/ata/exynos-sata-phy.txt
Documentation/devicetree/bindings/ata/exynos-sata-phy.txt deleted +0 -14
@@ -1,14 +0,0 @@ -* Samsung SATA PHY Controller - -SATA PHY nodes are defined to describe on-chip SATA Physical layer controllers. -Each SATA PHY controller should have its own node. - -Required properties: -- compatible : compatible list, contains "samsung,exynos5-sata-phy" -- reg : <registers mapping> - -Example: - sata at ffe07000 { - compatible = "samsung,exynos5-sata-phy"; - reg = <0xffe07000 0x1000>; - };
Documentation/devicetree/bindings/ata/exynos-sata.txt +16 -9
@@ -4,14 +4,21 @@ 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 "samsung,exynos5-sata" -- interrupts : <interrupt mapping for SATA IRQ> -- reg : <registers mapping> -- samsung,sata-freq : <frequency in MHz> +- compatible : compatible list, contains "samsung,exynos5-sata" +- interrupts : <interrupt mapping for SATA IRQ> +- reg : <registers mapping> +- samsung,sata-freq : <frequency in MHz> +- phys : as mentioned in phy-bindings.txt +- phy-names : as mentioned in phy-bindings.txt Example: - sata at ffe08000 { - compatible = "samsung,exynos5-sata"; - reg = <0xffe08000 0x1000>; - interrupts = <115>; - }; + sata at 122f0000 { + compatible = "snps,dwc-ahci"; + samsung,sata-freq = <66>; + reg = <0x122f0000 0x1ff>; + interrupts = <0 115 0>; + clocks = <&clock 277>, <&clock 143>; + clock-names = "sata", "sclk_sata"; + phys = <&sata_phy>; + phy-names = "sata-phy"; + };
Documentation/devicetree/bindings/phy/samsung-phy.txt +36 -0
@@ -20,3 +20,39 @@ Required properties: - compatible : should be "samsung,exynos5250-dp-video-phy"; - reg : offset and length of the Display Port PHY register set; - #phy-cells : from the generic PHY bindings, must be 0; + +Samsung SATA PHY Controller +--------------------------- + +SATA PHY nodes are defined to describe on-chip SATA Physical layer controllers. +Each SATA PHY controller should have its own node. + +Required properties: +- compatible : compatible list, contains "samsung,exynos5250-sata-phy" +- reg : offset and length of the SATA PHY register set; +- #phy-cells : from the generic phy bindings; + +Example: + sata_phy: sata-phy at 12170000 { + compatible = "samsung,exynos5250-sata-phy"; + reg = <0x12170000 0x1ff>; + clocks = <&clock 287>; + clock-names = "sata_phyctrl"; + #phy-cells = <0>; + samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>; + samsung,syscon-phandle = <&pmu_syscon>; + }; + +Device-Tree bindings for sataphy i2c client driver +-------------------------------------------------- + +Required properties: +compatible: Should be "samsung,exynos-sataphy-i2c" +- reg: I2C address of the sataphy i2c device. + +Example: + + sata_phy_i2c:sata-phy at 38 { + compatible = "samsung,exynos-sataphy-i2c"; + reg = <0x38>; + };
arch/arm/boot/dts/exynos5250-arndale.dts +21 -0
@@ -375,6 +375,27 @@ }; }; + i2c at 121D0000 { + status = "okay"; + samsung,i2c-sda-delay = <100>; + samsung,i2c-max-bus-freq = <40000>; + samsung,i2c-slave-addr = <0x38>; + + sata_phy_i2c:sata-phy at 38 { + compatible = "samsung,exynos-sataphy-i2c"; + reg = <0x38>; + }; + }; + + sata at 122F0000 { + status = "okay"; + }; + + sata-phy at 12170000 { + status = "okay"; + samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>; + }; + mmc_0: mmc at 12200000 { status = "okay"; num-slots = <1>;
arch/arm/boot/dts/exynos5250-smdk5250.dts +11 -6
@@ -100,16 +100,12 @@ samsung,i2c-slave-addr = <0x38>; status = "okay"; - sata-phy { - compatible = "samsung,sata-phy"; + sata_phy_i2c:sata-phy at 38 { + compatible = "samsung,exynos-sataphy-i2c"; reg = <0x38>; }; }; - sata at 122F0000 { - samsung,sata-freq = <66>; - }; - i2c at 12C80000 { samsung,i2c-sda-delay = <100>; samsung,i2c-max-bus-freq = <66000>;
@@ -132,6 +128,15 @@ }; }; + sata at 122F0000 { + status = "okay"; + }; + + sata-phy at 12170000 { + status = "okay"; + samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>; + }; + mmc at 12200000 { status = "okay"; num-slots = <1>;
arch/arm/boot/dts/exynos5250.dtsi +14 -4
@@ -46,6 +46,7 @@ i2c6 = &i2c_6; i2c7 = &i2c_7; i2c8 = &i2c_8; + i2c9 = &i2c_9; pinctrl0 = &pinctrl_0; pinctrl1 = &pinctrl_1; pinctrl2 = &pinctrl_2;
@@ -233,16 +234,25 @@ }; sata at 122F0000 { - compatible = "samsung,exynos5-sata-ahci"; + compatible = "snps,dwc-ahci"; + samsung,sata-freq = <66>; reg = <0x122F0000 0x1ff>; interrupts = <0 115 0>; clocks = <&clock 277>, <&clock 143>; clock-names = "sata", "sclk_sata"; + phys = <&sata_phy>; + phy-names = "sata-phy"; + status = "disabled"; }; - sata-phy at 12170000 { - compatible = "samsung,exynos5-sata-phy"; + sata_phy: sata-phy at 12170000 { + compatible = "samsung,exynos5250-sata-phy"; reg = <0x12170000 0x1ff>; + clocks = <&clock 287>; + clock-names = "sata_phyctrl"; + #phy-cells = <0>; + samsung,syscon-phandle = <&pmu_system_controller>; + status = "disabled"; }; i2c_0: i2c at 12C60000 {
@@ -360,7 +370,7 @@ status = "disabled"; }; - i2c at 121D0000 { + i2c_9: i2c at 121D0000 { compatible = "samsung,exynos5-sata-phy-i2c"; reg = <0x121D0000 0x100>; #address-cells = <1>;
Signature · 1 line
1.7.10.4
Re: [PATCH V9 2/2] ARM: dts: Enable ahci sata and sata phy
Quoted 5 lines · Yuvaraj Kumar C D
This patch adds dt entry for ahci sata controller and its corresponding phy controller.phy node has been added w.r.t new generic phy framework.
Signed-off-by Yuvaraj Kumar C D <[email protected]>
This should go via exynos dt tree.
FWIW
Quoted 258 lines
---
Changes since V8:1.sata at 122f0000 and sata_phy at 12170000 disabled by default in SOC specific dts file and enabled the same in board dts file.Changes since V7:
1.syscon-phandle name updated.Changes since V6:none
Changes since V5:none
Changes since V4:
1.Used the new phandle "sata_phy_i2c" in the DT entry. 2.Updated binding document.Changes since V3:
1.Moved the binding info to the /bindings/phy/Changes since V2:
1.Used syscon interface to PMU handling. 2.Changed "sata-phy-i2c" to "exynos-sataphy-i2c".Changes since V1:
1.Minor changes to node name convention.
2.Updated binding document..../devicetree/bindings/ata/exynos-sata-phy.txt | 14 -------- .../devicetree/bindings/ata/exynos-sata.txt | 25 +++++++++----- .../devicetree/bindings/phy/samsung-phy.txt | 36 ++++++++++++++++++++ arch/arm/boot/dts/exynos5250-arndale.dts | 21 ++++++++++++ arch/arm/boot/dts/exynos5250-smdk5250.dts | 17 +++++---- arch/arm/boot/dts/exynos5250.dtsi | 18 +++++++--- 6 files changed, 98 insertions(+), 33 deletions(-)delete mode 100644
Documentation/devicetree/bindings/ata/exynos-sata-phy.txtDocumentation/devicetree/bindings/ata/exynos-sata-phy.txt deleted +0
-14@@ -1,14 +0,0 @@ -* Samsung SATA PHY Controller - -SATA PHY nodes are defined to describe on-chip SATA Physical layer controllers. -Each SATA PHY controller should have its own node. - -Required properties: -- compatible : compatible list, contains "samsung,exynos5-sata-phy" -- reg : <registers mapping> - -Example: - sata at ffe07000 { - compatible = "samsung,exynos5-sata-phy"; - reg = <0xffe07000 0x1000>; - };Documentation/devicetree/bindings/ata/exynos-sata.txt +16
-9@@ -4,14 +4,21 @@ 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 "samsung,exynos5-sata" -- interrupts : <interrupt mapping for SATA IRQ> -- reg : <registers mapping> -- samsung,sata-freq : <frequency in MHz> +- compatible : compatible list, contains "samsung,exynos5-sata" +- interrupts : <interrupt mapping for SATA IRQ> +- reg : <registers mapping> +- samsung,sata-freq : <frequency in MHz> +- phys : as mentioned in phy-bindings.txt +- phy-names : as mentioned in phy-bindings.txt Example: - sata at ffe08000 { - compatible = "samsung,exynos5-sata"; - reg = <0xffe08000 0x1000>; - interrupts = <115>; - }; + sata at 122f0000 { + compatible = "snps,dwc-ahci"; + samsung,sata-freq = <66>; + reg = <0x122f0000 0x1ff>; + interrupts = <0 115 0>; + clocks = <&clock 277>, <&clock 143>; + clock-names = "sata", "sclk_sata"; + phys = <&sata_phy>; + phy-names = "sata-phy"; + };Documentation/devicetree/bindings/phy/samsung-phy.txt +36
-0@@ -20,3 +20,39 @@ Required properties: - compatible : should be "samsung,exynos5250-dp-video-phy"; - reg : offset and length of the Display Port PHY register set; - #phy-cells : from the generic PHY bindings, must be 0; + +Samsung SATA PHY Controller +--------------------------- + +SATA PHY nodes are defined to describe on-chip SATA Physical layer controllers. +Each SATA PHY controller should have its own node. + +Required properties: +- compatible : compatible list, contains "samsung,exynos5250-sata-phy" +- reg : offset and length of the SATA PHY register set; +- #phy-cells : from the generic phy bindings; + +Example: + sata_phy: sata-phy at 12170000 { + compatible = "samsung,exynos5250-sata-phy"; + reg = <0x12170000 0x1ff>; + clocks = <&clock 287>; + clock-names = "sata_phyctrl"; + #phy-cells = <0>; + samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>; + samsung,syscon-phandle = <&pmu_syscon>; + }; + +Device-Tree bindings for sataphy i2c client driver +-------------------------------------------------- + +Required properties: +compatible: Should be "samsung,exynos-sataphy-i2c" +- reg: I2C address of the sataphy i2c device. + +Example: + + sata_phy_i2c:sata-phy at 38 { + compatible = "samsung,exynos-sataphy-i2c"; + reg = <0x38>; + };arch/arm/boot/dts/exynos5250-arndale.dts +21
-0@@ -375,6 +375,27 @@ }; }; + i2c at 121D0000 { + status = "okay"; + samsung,i2c-sda-delay = <100>; + samsung,i2c-max-bus-freq = <40000>; + samsung,i2c-slave-addr = <0x38>; + + sata_phy_i2c:sata-phy at 38 { + compatible = "samsung,exynos-sataphy-i2c"; + reg = <0x38>; + }; + }; + + sata at 122F0000 { + status = "okay"; + }; + + sata-phy at 12170000 { + status = "okay"; + samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>; + }; + mmc_0: mmc at 12200000 { status = "okay"; num-slots = <1>;arch/arm/boot/dts/exynos5250-smdk5250.dts +11
-6@@ -100,16 +100,12 @@ samsung,i2c-slave-addr = <0x38>; status = "okay"; - sata-phy { - compatible = "samsung,sata-phy"; + sata_phy_i2c:sata-phy at 38 { + compatible = "samsung,exynos-sataphy-i2c"; reg = <0x38>; }; }; - sata at 122F0000 { - samsung,sata-freq = <66>; - }; - i2c at 12C80000 { samsung,i2c-sda-delay = <100>; samsung,i2c-max-bus-freq = <66000>;@@ -132,6 +128,15 @@ }; }; + sata at 122F0000 { + status = "okay"; + }; + + sata-phy at 12170000 { + status = "okay"; + samsung,exynos-sataphy-i2c-phandle = <&sata_phy_i2c>; + }; + mmc at 12200000 { status = "okay"; num-slots = <1>;arch/arm/boot/dts/exynos5250.dtsi +14
-4@@ -46,6 +46,7 @@ i2c6 = &i2c_6; i2c7 = &i2c_7; i2c8 = &i2c_8; + i2c9 = &i2c_9; pinctrl0 = &pinctrl_0; pinctrl1 = &pinctrl_1; pinctrl2 = &pinctrl_2;@@ -233,16 +234,25 @@ }; sata at 122F0000 { - compatible = "samsung,exynos5-sata-ahci"; + compatible = "snps,dwc-ahci"; + samsung,sata-freq = <66>; reg = <0x122F0000 0x1ff>; interrupts = <0 115 0>; clocks = <&clock 277>, <&clock 143>; clock-names = "sata", "sclk_sata"; + phys = <&sata_phy>; + phy-names = "sata-phy"; + status = "disabled"; }; - sata-phy at 12170000 { - compatible = "samsung,exynos5-sata-phy"; + sata_phy: sata-phy at 12170000 { + compatible = "samsung,exynos5250-sata-phy"; reg = <0x12170000 0x1ff>; + clocks = <&clock 287>; + clock-names = "sata_phyctrl"; + #phy-cells = <0>; + samsung,syscon-phandle = <&pmu_system_controller>; + status = "disabled"; }; i2c_0: i2c at 12C60000 {@@ -360,7 +370,7 @@ status = "disabled"; }; - i2c at 121D0000 { + i2c_9: i2c at 121D0000 { compatible = "samsung,exynos5-sata-phy-i2c"; reg = <0x121D0000 0x100>; #address-cells = <1>;
Re: [PATCH V9 2/2] ARM: dts: Enable ahci sata and sata phy
Quoted 7 lines · Kishon Vijay Abraham I
Quoted 4 lines · Yuvaraj Kumar C D
This patch adds dt entry for ahci sata controller and its corresponding phy controller.phy node has been added w.r.t new generic phy framework.
Quoted 7 lines
Quoted 1 line
Signed-off-by Yuvaraj Kumar C D <[email protected]>This should go via exynos dt tree.
FWIW
Quoted 1 line
?
Its a nit, but the subject really should have ?exynos? or some related qualifier. We aren?t enabling ahci sata & phy for all of ARM
- k
Signature · 2 lines
Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Re: [PATCH V9 2/2] ARM: dts: Enable ahci sata and sata phy
Quoted 11 lines · Kumar Gala
Quoted 9 lines · Kishon Vijay Abraham I
Quoted 5 lines · Yuvaraj Kumar C D
This patch adds dt entry for ahci sata controller and its corresponding phy controller.phy node has been added w.r.t new generic phy framework.
Signed-off-by Yuvaraj Kumar C D <[email protected]>
Quoted 8 lines
Quoted 5 lines
This should go via exynos dt tree.
FWIW
Quoted 1 line
-
Its a nit, but the subject really should have 'exynos' or some related qualifier. We aren't enabling ahci sata & phy for all of ARM
I agree with your opinion.
The subject should be fixed in order to get rid of confusion.
For example, one of the followings looks good.
ARM: dts: exynos5250: Enable ahci sata and sata phy
ARM: dts: Enable ahci sata and sata phy for exynos5250
Best regards,
Jingoo Han
Quoted 6 lines
- k
--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Kukjin Kim
AppliedRe: [PATCH V9 2/2] ARM: dts: Enable ahci sata and sata phy
In reply to Kishon Vijay Abraham IQuoted 11 lines · Kishon Vijay Abraham I
Quoted 5 lines · Yuvaraj Kumar C D
This patch adds dt entry for ahci sata controller and its corresponding phy controller.phy node has been added w.r.t new generic phy framework.
Signed-off-by Yuvaraj Kumar C D <[email protected]>This should go via exynos dt tree.
Applied, thanks.
- Kukjin
Quoted 39 lines
FWIW
Quoted 37 lines
---
Changes since V8:
1.sata at122f0000andsata_phyat 12170000 disabled by default in SOC specific dts file and enabled the same in board dts file.Changes since V7:
1.syscon-phandle name updated.Changes since V6:none
Changes since V5:none
Changes since V4:
1.Used the new phandle "sata_phy_i2c" in the DT entry. 2.Updated binding document.Changes since V3:
1.Moved the binding info to the /bindings/phy/Changes since V2:
1.Used syscon interface to PMU handling.
2.Changed "sata-phy-i2c" to "exynos-sataphy-i2c".Changes since V1:
1.Minor changes to node name convention.
2.Updated binding document.
.../devicetree/bindings/ata/exynos-sata-phy.txt| 14 --------.../devicetree/bindings/ata/exynos-sata.txt| 25 +++++++++-----.../devicetree/bindings/phy/samsung-phy.txt| 36 ++++++++++++++++++++arch/arm/boot/dts/exynos5250-arndale.dts| 21 ++++++++++++arch/arm/boot/dts/exynos5250-smdk5250.dts| 17 +++++----arch/arm/boot/dts/exynos5250.dtsi| 18 +++++++---6 files changed, 98 insertions(+), 33 deletions(-)delete mode 100644
Documentation/devicetree/bindings/ata/exynos-sata-phy.txt