usb-uart: add a propertie in dts to enable usb-uart debug
[firefly-linux-kernel-4.4.55.git] / Documentation / devicetree / bindings / usb / rockchip-usb.txt
1 Rockchip SoC USB controller
2
3 The USB devices interface with USB controllers on Rockchip SOCs.
4 The device node has following properties.
5
6 DWC_OTG OTG20
7 Required properties:
8  - compatible : Should be "rockchip,rk3188_usb20_otg" or
9    "rockchip,rk3288_usb20_otg" and so on, depending upon the SoC.
10  - reg : Physical base address of the controller and
11    length of memory mapped region.
12  - interrupts : interrupt number to the cpu.
13  - clocks : Clock IDs array as required by the controller. 
14  - clock-names : Names of clock correseponding IDs clock
15    property as requested by the controller driver.
16  - rockchip,usb-mode : This signifies the otg controller mode.
17    "0" represents that otg supports both host and slave mode,
18    "1" represents that force otg to host only mode,
19    "2" represents that force otg to device only mode.
20
21 Example:
22  - RK3288
23
24         usb0: usb@ff580000 {
25                 compatible = "rockchip,rk3288_usb20_otg";
26                 reg = <0xff580000 0x40000>;
27                 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>;
28                 clocks = <&clk_gates13 4>, <&clk_gates7 4>;
29                 clock-names = "clk_usbphy0", "hclk_usb0";
30                 /*0 - Normal, 1 - Force Host, 2 - Force Device*/
31                 rockchip,usb-mode = <0>;
32         };
33
34 DWC_OTG HOST20
35 Required properties:
36  - compatible : Should be "rockchip,rk3188_usb20_host" or
37    "rockchip,rk3288_usb20_host" and so on, depending upon the SoC.
38  - reg : Physical base address of the controller and
39    length of memory mapped region.
40  - interrupts : Interrupt number to the cpu.
41  - clocks : Clock IDs array as required by the controller.
42  - clock-names : Names of clock correseponding IDs clock
43    property as requested by the controller driver.
44
45 Example:
46  - RK3288
47
48         usb1: usb@ff540000 {
49                 compatible = "rockchip,rk3288_usb20_host";
50                 reg = <0xff540000 0x40000>;
51                 interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
52                 clocks = <&clk_gates13 6>, <&clk_gates7 7>,
53                          <&usbphy_480m>;
54                 clock-names = "clk_usbphy1", "hclk_usb1",
55                               "usbphy_480m";
56         };
57
58 EHCI
59 Required properties:
60  - compatible : Should be "rockchip,rk3188_rk_ehci_host" or
61    "rockchip,rk3288_rk_ehci_host" and so on, for USB 2.0 EHCI
62    controller in host mode, depending upon the SoC.
63  - reg : Physical base address of the controller and
64    length of memory mapped region.
65  - interrupts : Interrupt number to the cpu.
66  - clocks : Clock IDs array as required by the controller.
67  - clock-names : Names of clock correseponding IDs clock
68    property as requested by the controller driver. 
69
70 Example:
71  - RK3288
72
73         usb2: usb@ff500000 {
74                 compatible = "rockchip,rk3288_rk_ehci_host";
75                 reg = <0xff500000 0x20000>;
76                 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>;
77                 clocks = <&clk_gates13 5>, <&clk_gates7 6>;
78                 clock-names = "clk_usbphy2", "hclk_usb2";
79         };
80
81 OHCI
82 Required properties:
83  - compatible : Should be "rockchip,rk3188_rk_ohci_host" or
84    "rockchip,rk3288_rk_ohci_host" and so on, for USB 2.0 OHCI
85    companion controller in host mode, depending upon the SoC.
86  - reg : Physical base address of the controller and
87    length of memory mapped region.
88  - interrupts : Interrupt number to the cpu.
89  - clocks : Clock IDs array as required by the controller.
90  - clock-names : Names of clock correseponding IDs clock
91    property as requested by the controller driver.
92
93 Example:
94  - RK3288
95
96         usb3: usb@ff520000 {
97                 compatible = "rockchip,rk3288_rk_ohci_host";
98                 reg = <0xff520000 0x20000>;
99                 interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
100                 clocks = <&clk_gates13 5>, <&clk_gates7 6>;
101                 clock-names = "clk_usbphy3", "hclk_usb3";
102         };
103
104
105 HSIC
106 Required properties:
107  - compatible : Should be "rockchip,rk3188_rk_hsic_host" or
108    "rockchip,rk3288_rk_hsic_host" and so on, depending upon
109    the SoC.
110  - reg : Physical base address of the controller and
111    length of memory mapped region.
112  - interrupts : Interrupt number to the cpu.
113  - clocks : Clock IDs array as required by the controller.
114  - clock-names : Names of clock correseponding IDs clock
115    property as requested by the controller driver.
116
117 Example:
118  - RK3288
119
120         hsic: hsic@ff5c0000 {
121                 compatible = "rockchip,rk3288_rk_hsic_host";
122                 reg = <0xff5c0000 0x40000>;
123                 interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
124                 clocks = <&hsicphy_480m>, <&clk_gates7 8>,
125                          <&hsicphy_12m>, <&usbphy_480m>,
126                          <&otgphy1_480m>, <&otgphy2_480m>;
127                 clock-names = "hsicphy_480m", "hclk_hsic",
128                               "hsicphy_12m", "usbphy_480m",
129                               "hsic_usbphy1", "hsic_usbphy2";
130         };      
131
132 ROCKCHIP USB-PHY CONTROL
133 Required properties:
134  - compatible : Should be "rockchip,rk3188-dwc-control-usb"
135    or "rockchip,rk3288-dwc-control-usb" and so on, depending
136    upon the SoC.
137  - reg : Physical base address of USB-PHY GRF registers.
138    It contains the address of "GRF_SOC_STATUSX" and
139    "GRF_UOCX_BASE" depending upon the number of usb controllers
140    that the SoC has. 
141  - reg-names : The names of the register addresses corresponding
142    to the registers filled in "reg".
143  - interrupts : Interrupt number to the cpu.
144  - interrupt-names : The names of the interrupts corresponding
145    to the registers filled in "interrupts".
146  - clocks : Clock IDs array as required by the controller.
147  - clock-names : Names of clock correseponding IDs clock
148    property as requested by the controller driver.
149
150 Child nodes:
151  The child node 'usb_bc' to the node 'dwc_control_usb' is for
152  USB Battery Charging detect. It is used to differentiate the
153  Charging Port(i.e. CDP, DCP or SDP).
154  Required properties:
155  - compatible : Should be "synopsys,phy", "inno,phy" or
156    "rockchip,ctrl" depending upon the vendor of usb phy 
157    that the SoC used.
158
159 Optional properties:
160  The following properties represent the control and status
161  registers of usb otg battery charging. All these properties
162  are of type <u32>. Each property contains three tuples.
163  The layout of each tuple is:
164
165  offset, start bit, and bitmask.
166  
167  - rk_usb,bvalid
168  - rk_usb,dcdenb
169  - rk_usb,dcdenb
170  - rk_usb,vdatdetenb
171  - rk_usb,chrgsel
172  - rk_usb,chgdet
173  - rk_usb,fsvminus
174  - rk_usb,fsvplus
175  - rk_usb,line
176  - rk_usb,softctrl
177  - rk_usb,opmode
178  - rk_usb,xcvrsel
179  - rk_usb,termsel
180
181  The child node 'usb_uart' to the node 'dwc_control_usb' is for
182  the usb uart debug function.
183  Required propertie:
184  - status : If be "ok" or "okay" will enable the usb-uart debug
185    function and bypass UART2 to USB OTG io port.
186
187 Example:
188  - RK3288
189
190         dwc_control_usb: dwc-control-usb@ff770284 {
191                 compatible = "rockchip,rk3288-dwc-control-usb";
192                 reg = <0xff770284 0x04>, <0xff770288 0x04>,
193                       <0xff7702cc 0x04>, <0xff7702d4 0x04>,
194                       <0xff770320 0x14>, <0xff770334 0x14>,
195                       <0xff770348 0x10>, <0xff770358 0x08>,
196                       <0xff770360 0x08>;
197                 reg-names = "GRF_SOC_STATUS1" ,"GRF_SOC_STATUS2",
198                             "GRF_SOC_STATUS19", "GRF_SOC_STATUS21",
199                             "GRF_UOC0_BASE", "GRF_UOC1_BASE",
200                             "GRF_UOC2_BASE", "GRF_UOC3_BASE",
201                             "GRF_UOC4_BASE";
202                 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
203                              <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
204                              <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
205                              <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
206                              <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
207                 interrupt-names = "otg_id",
208                                   "otg_bvalid",
209                                   "otg_linestate",
210                                   "host0_linestate",
211                                   "host1_linestate";
212                 clocks = <&clk_gates7 9>, <&usbphy_480m>,
213                          <&otgphy1_480m>, <&otgphy2_480m>;
214                 clock-names = "hclk_usb_peri", "usbphy_480m",
215                               "usbphy1_480m", "usbphy2_480m";
216
217                 usb_bc{
218                         compatible = "synopsys,phy";
219                         /* offset bit mask */
220                         rk_usb,bvalid     = <0x288 14 1>;
221                         rk_usb,dcdenb     = <0x328 14 1>;
222                         rk_usb,vdatsrcenb = <0x328  7 1>;
223                         rk_usb,vdatdetenb = <0x328  6 1>;
224                         rk_usb,chrgsel    = <0x328  5 1>;
225                         rk_usb,chgdet     = <0x2cc 23 1>;
226                         rk_usb,fsvminus   = <0x2cc 25 1>;
227                         rk_usb,fsvplus    = <0x2cc 24 1>;
228                 };
229                 usb_uart {
230                         status = "okay";
231                 };
232         };
233
234 ROCKCHIP USB-COMMON CONTROL
235 Required properties:
236  - compatible : Should be "rockchip,rk3188-usb-control" or
237    "rockchip,rk3288-usb-control" and so on, depending upon
238    the SoC.
239
240 Optional properties:
241  - host_drv_gpio : If present, specifies the GPIO that needs
242    to be pulled up for the host bus to be powered.
243  - otg_drv_gpio : If present, specifies the GPIO that needs
244    to be pulled up for the otg bus to be powered.
245  - rockchip,remote_wakeup : If present, host can be resumed
246    from suspend state by remote wakeup signal.
247  - rockchip,usb_irq_wakeup : If present, supports usb irqs to
248    wake up the system. The usb irqs are described in ROCKCHIP
249    USB-PHY CONTROL node, which include: "otg_id","otg_bvalid",
250    "linestate" and so on.
251
252 Example:
253  - RK3288
254
255         usb_control {
256                 compatible = "rockchip,rk3288-usb-control";
257
258                 host_drv_gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>;
259                 otg_drv_gpio = <&gpio0 GPIO_B4 GPIO_ACTIVE_LOW>;
260
261                 rockchip,remote_wakeup;
262                 rockchip,usb_irq_wakeup;
263         };