Skip to content

Commit d508d99

Browse files
committed
Merge tag 'for_3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-next
Kishon writes: for_3.17 Adds regulator support in PHY core. PHY core is modified to support representation of multi-phy PHY providers with each individual PHY as sub-node OF PHY provider node. New PHY drivers adapted to PHY framework (hix5hd2 SATA PHY, QCOM APQ8064 SATA PHY, QCOM IPQ806x SATA PHY, Berlin SATA PHY and MiPHY356x). Existing TI PIPE3 PHY can now be used for PCIe too. Includes misc fixes and cleanups.
2 parents df40f8d + 7ebdb52 commit d508d99

36 files changed

+2218
-134
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Berlin SATA PHY
2+
---------------
3+
4+
Required properties:
5+
- compatible: should be "marvell,berlin2q-sata-phy"
6+
- address-cells: should be 1
7+
- size-cells: should be 0
8+
- phy-cells: from the generic PHY bindings, must be 1
9+
- reg: address and length of the register
10+
- clocks: reference to the clock entry
11+
12+
Sub-nodes:
13+
Each PHY should be represented as a sub-node.
14+
15+
Sub-nodes required properties:
16+
- reg: the PHY number
17+
18+
Example:
19+
sata_phy: phy@f7e900a0 {
20+
compatible = "marvell,berlin2q-sata-phy";
21+
reg = <0xf7e900a0 0x200>;
22+
clocks = <&chip CLKID_SATA>;
23+
#address-cells = <1>;
24+
#size-cells = <0>;
25+
#phy-cells = <1>;
26+
27+
sata-phy@0 {
28+
reg = <0>;
29+
};
30+
31+
sata-phy@1 {
32+
reg = <1>;
33+
};
34+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Hisilicon hix5hd2 SATA PHY
2+
-----------------------
3+
4+
Required properties:
5+
- compatible: should be "hisilicon,hix5hd2-sata-phy"
6+
- reg: offset and length of the PHY registers
7+
- #phy-cells: must be 0
8+
Refer to phy/phy-bindings.txt for the generic PHY binding properties
9+
10+
Optional Properties:
11+
- hisilicon,peripheral-syscon: phandle of syscon used to control peripheral.
12+
- hisilicon,power-reg: offset and bit number within peripheral-syscon,
13+
register of controlling sata power supply.
14+
15+
Example:
16+
sata_phy: phy@f9900000 {
17+
compatible = "hisilicon,hix5hd2-sata-phy";
18+
reg = <0xf9900000 0x10000>;
19+
#phy-cells = <0>;
20+
hisilicon,peripheral-syscon = <&peripheral_ctrl>;
21+
hisilicon,power-reg = <0x8 10>;
22+
};

Documentation/devicetree/bindings/phy/phy-bindings.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Required Properties:
1010
provider can use the values in cells to find the appropriate
1111
PHY.
1212

13+
Optional Properties:
14+
phy-supply: Phandle to a regulator that provides power to the PHY. This
15+
regulator will be managed during the PHY power on/off sequence.
16+
1317
For example:
1418

1519
phys: phy {
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
STMicroelectronics STi MIPHY365x PHY binding
2+
============================================
3+
4+
This binding describes a miphy device that is used to control PHY hardware
5+
for SATA and PCIe.
6+
7+
Required properties (controller (parent) node):
8+
- compatible : Should be "st,miphy365x-phy"
9+
- st,syscfg : Should be a phandle of the system configuration register group
10+
which contain the SATA, PCIe mode setting bits
11+
12+
Required nodes : A sub-node is required for each channel the controller
13+
provides. Address range information including the usual
14+
'reg' and 'reg-names' properties are used inside these
15+
nodes to describe the controller's topology. These nodes
16+
are translated by the driver's .xlate() function.
17+
18+
Required properties (port (child) node):
19+
- #phy-cells : Should be 1 (See second example)
20+
Cell after port phandle is device type from:
21+
- MIPHY_TYPE_SATA
22+
- MIPHY_TYPE_PCI
23+
- reg : Address and length of register sets for each device in
24+
"reg-names"
25+
- reg-names : The names of the register addresses corresponding to the
26+
registers filled in "reg":
27+
- sata: For SATA devices
28+
- pcie: For PCIe devices
29+
- syscfg: To specify the syscfg based config register
30+
31+
Optional properties (port (child) node):
32+
- st,sata-gen : Generation of locally attached SATA IP. Expected values
33+
are {1,2,3). If not supplied generation 1 hardware will
34+
be expected
35+
- st,pcie-tx-pol-inv : Bool property to invert the polarity PCIe Tx (Txn/Txp)
36+
- st,sata-tx-pol-inv : Bool property to invert the polarity SATA Tx (Txn/Txp)
37+
38+
Example:
39+
40+
miphy365x_phy: miphy365x@fe382000 {
41+
compatible = "st,miphy365x-phy";
42+
st,syscfg = <&syscfg_rear>;
43+
#address-cells = <1>;
44+
#size-cells = <1>;
45+
ranges;
46+
47+
phy_port0: port@fe382000 {
48+
reg = <0xfe382000 0x100>, <0xfe394000 0x100>, <0x824 0x4>;
49+
reg-names = "sata", "pcie", "syscfg";
50+
#phy-cells = <1>;
51+
st,sata-gen = <3>;
52+
};
53+
54+
phy_port1: port@fe38a000 {
55+
reg = <0xfe38a000 0x100>, <0xfe804000 0x100>, <0x828 0x4>;;
56+
reg-names = "sata", "pcie", "syscfg";
57+
#phy-cells = <1>;
58+
st,pcie-tx-pol-inv;
59+
};
60+
};
61+
62+
Specifying phy control of devices
63+
=================================
64+
65+
Device nodes should specify the configuration required in their "phys"
66+
property, containing a phandle to the phy port node and a device type.
67+
68+
Example:
69+
70+
#include <dt-bindings/phy/phy-miphy365x.h>
71+
72+
sata0: sata@fe380000 {
73+
...
74+
phys = <&phy_port0 MIPHY_TYPE_SATA>;
75+
...
76+
};
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Qualcomm APQ8064 SATA PHY Controller
2+
------------------------------------
3+
4+
SATA PHY nodes are defined to describe on-chip SATA Physical layer controllers.
5+
Each SATA PHY controller should have its own node.
6+
7+
Required properties:
8+
- compatible: compatible list, contains "qcom,apq8064-sata-phy".
9+
- reg: offset and length of the SATA PHY register set;
10+
- #phy-cells: must be zero
11+
- clocks: a list of phandles and clock-specifier pairs, one for each entry in
12+
clock-names.
13+
- clock-names: must be "cfg" for phy config clock.
14+
15+
Example:
16+
sata_phy: sata-phy@1b400000 {
17+
compatible = "qcom,apq8064-sata-phy";
18+
reg = <0x1b400000 0x200>;
19+
20+
clocks = <&gcc SATA_PHY_CFG_CLK>;
21+
clock-names = "cfg";
22+
23+
#phy-cells = <0>;
24+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Qualcomm IPQ806x SATA PHY Controller
2+
------------------------------------
3+
4+
SATA PHY nodes are defined to describe on-chip SATA Physical layer controllers.
5+
Each SATA PHY controller should have its own node.
6+
7+
Required properties:
8+
- compatible: compatible list, contains "qcom,ipq806x-sata-phy"
9+
- reg: offset and length of the SATA PHY register set;
10+
- #phy-cells: must be zero
11+
- clocks: must be exactly one entry
12+
- clock-names: must be "cfg"
13+
14+
Example:
15+
sata_phy: sata-phy@1b400000 {
16+
compatible = "qcom,ipq806x-sata-phy";
17+
reg = <0x1b400000 0x200>;
18+
19+
clocks = <&gcc SATA_PHY_CFG_CLK>;
20+
clock-names = "cfg";
21+
22+
#phy-cells = <0>;
23+
};

Documentation/devicetree/bindings/phy/samsung-phy.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Samsung S5P/EXYNOS SoC series USB PHY
2626

2727
Required properties:
2828
- compatible : should be one of the listed compatibles:
29+
- "samsung,exynos3250-usb2-phy"
2930
- "samsung,exynos4210-usb2-phy"
3031
- "samsung,exynos4x12-usb2-phy"
3132
- "samsung,exynos5250-usb2-phy"
@@ -46,6 +47,7 @@ and Exynos 4212) it is as follows:
4647
1 - USB host ("host"),
4748
2 - HSIC0 ("hsic0"),
4849
3 - HSIC1 ("hsic1"),
50+
Exynos3250 has only USB device phy available as phy 0.
4951

5052
Exynos 4210 and Exynos 4212 use mode switching and require that mode switch
5153
register is supplied.

Documentation/devicetree/bindings/phy/ti-phy.txt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ Required properties:
99
e.g. USB2_PHY on OMAP5.
1010
"ti,control-phy-pipe3" - if it has DPLL and individual Rx & Tx power control
1111
e.g. USB3 PHY and SATA PHY on OMAP5.
12+
"ti,control-phy-pcie" - for pcie to support external clock for pcie and to
13+
set PCS delay value.
14+
e.g. PCIE PHY in DRA7x
1215
"ti,control-phy-usb2-dra7" - if it has power down register like USB2 PHY on
1316
DRA7 platform.
1417
"ti,control-phy-usb2-am437" - if it has power down register like USB2 PHY on
1518
AM437 platform.
16-
- reg : Address and length of the register set for the device. It contains
17-
the address of "otghs_control" for control-phy-otghs or "power" register
18-
for other types.
19-
- reg-names: should be "otghs_control" control-phy-otghs and "power" for
20-
other types.
19+
- reg : register ranges as listed in the reg-names property
20+
- reg-names: "otghs_control" for control-phy-otghs
21+
"power", "pcie_pcs" and "control_sma" for control-phy-pcie
22+
"power" for all other types
2123

2224
omap_control_usb: omap-control-usb@4a002300 {
2325
compatible = "ti,control-phy-otghs";
@@ -56,8 +58,8 @@ usb2phy@4a0ad080 {
5658
TI PIPE3 PHY
5759

5860
Required properties:
59-
- compatible: Should be "ti,phy-usb3" or "ti,phy-pipe3-sata".
60-
"ti,omap-usb3" is deprecated.
61+
- compatible: Should be "ti,phy-usb3", "ti,phy-pipe3-sata" or
62+
"ti,phy-pipe3-pcie. "ti,omap-usb3" is deprecated.
6163
- reg : Address and length of the register set for the device.
6264
- reg-names: The names of the register addresses corresponding to the registers
6365
filled in "reg".
@@ -69,10 +71,17 @@ Required properties:
6971
* "wkupclk" - wakeup clock.
7072
* "sysclk" - system clock.
7173
* "refclk" - reference clock.
74+
* "dpll_ref" - external dpll ref clk
75+
* "dpll_ref_m2" - external dpll ref clk
76+
* "phy-div" - divider for apll
77+
* "div-clk" - apll clock
7278

7379
Optional properties:
7480
- ctrl-module : phandle of the control module used by PHY driver to power on
7581
the PHY.
82+
- id: If there are multiple instance of the same type, in order to
83+
differentiate between each instance "id" can be used (e.g., multi-lane PCIe
84+
PHY). If "id" is not provided, it is set to default value of '1'.
7685

7786
This is usually a subnode of ocp2scp to which it is connected.
7887

Documentation/phy.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ unregister the PHY.
5353
The PHY driver should create the PHY in order for other peripheral controllers
5454
to make use of it. The PHY framework provides 2 APIs to create the PHY.
5555

56-
struct phy *phy_create(struct device *dev, const struct phy_ops *ops,
57-
struct phy_init_data *init_data);
58-
struct phy *devm_phy_create(struct device *dev, const struct phy_ops *ops,
59-
struct phy_init_data *init_data);
56+
struct phy *phy_create(struct device *dev, struct device_node *node,
57+
const struct phy_ops *ops,
58+
struct phy_init_data *init_data);
59+
struct phy *devm_phy_create(struct device *dev, struct device_node *node,
60+
const struct phy_ops *ops,
61+
struct phy_init_data *init_data);
6062

6163
The PHY drivers can use one of the above 2 APIs to create the PHY by passing
6264
the device pointer, phy ops and init_data.

0 commit comments

Comments
 (0)