Commit 132d68d3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'usb-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Pull USB/PHY updates from Greg KH:
 "Here is the big set of USB and PHY driver patches for 5.2-rc1

  There is the usual set of:

   - USB gadget updates

   - PHY driver updates and additions

   - USB serial driver updates and fixes

   - typec updates and new chips supported

   - mtu3 driver updates

   - xhci driver updates

   - other tiny driver updates

  Nothing really interesting, just constant forward progress.

  All of these have been in linux-next for a while with no reported
  issues. The usb-gadget and usb-serial trees were merged a bit "late",
  but both of them had been in linux-next before they got merged here
  last Friday"

* tag 'usb-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (206 commits)
  USB: serial: f81232: implement break control
  USB: serial: f81232: add high baud rate support
  USB: serial: f81232: clear overrun flag
  USB: serial: f81232: fix interrupt worker not stop
  usb: dwc3: Rename DWC3_DCTL_LPM_ERRATA
  usb: dwc3: Fix default lpm_nyet_threshold value
  usb: dwc3: debug: Print GET_STATUS(device) tracepoint
  usb: dwc3: Do core validation early on probe
  usb: dwc3: gadget: Set lpm_capable
  usb: gadget: atmel: tie wake lock to running clock
  usb: gadget: atmel: support USB suspend
  usb: gadget: atmel_usba_udc: simplify setting of interrupt-enabled mask
  dwc2: gadget: Fix completed transfer size calculation in DDMA
  usb: dwc2: Set lpm mode parameters depend on HW configuration
  usb: dwc2: Fix channel disable flow
  usb: dwc2: Set actual frame number for completed ISOC transfer
  usb: gadget: do not use __constant_cpu_to_le16
  usb: dwc2: gadget: Increase descriptors count for ISOC's
  usb: introduce usb_ep_type_string() function
  usb: dwc3: move synchronize_irq() out of the spinlock protected block
  ...
parents 80f23212 3515468a
What: /sys/bus/i2c/drivers/ucsi_ccg/.../do_flash
Date: May 2019
Contact: Ajay Gupta <ajayg@nvidia.com>
Description:
Tell the driver for Cypress CCGx Type-C controller to attempt
firmware upgrade by writing [Yy1] to the file.
What: Raise a uevent when a USB Host Controller has died
Date: 2019-04-17
KernelVersion: 5.2
Contact: linux-usb@vger.kernel.org
Description: When the USB Host Controller has entered a state where it is no
longer functional a uevent will be raised. The uevent will
contain ACTION=offline and ERROR=DEAD.
Here is an example taken using udevadm monitor -p:
KERNEL[130.428945] offline /devices/pci0000:00/0000:00:10.0/usb2 (usb)
ACTION=offline
BUSNUM=002
DEVNAME=/dev/bus/usb/002/001
DEVNUM=001
DEVPATH=/devices/pci0000:00/0000:00:10.0/usb2
DEVTYPE=usb_device
DRIVER=usb
ERROR=DEAD
MAJOR=189
MINOR=128
PRODUCT=1d6b/2/414
SEQNUM=2168
SUBSYSTEM=usb
TYPE=9/0/1
Users: chromium-os-dev@chromium.org
Broadcom Stingray USB PHY
Required properties:
- compatible : should be one of the listed compatibles
- "brcm,sr-usb-combo-phy" is combo PHY has two PHYs, one SS and one HS.
- "brcm,sr-usb-hs-phy" is a single HS PHY.
- reg: offset and length of the PHY blocks registers
- #phy-cells:
- Must be 1 for brcm,sr-usb-combo-phy as it expects one argument to indicate
the PHY number of two PHYs. 0 for HS PHY and 1 for SS PHY.
- Must be 0 for brcm,sr-usb-hs-phy.
Refer to phy/phy-bindings.txt for the generic PHY binding properties
Example:
usbphy0: usb-phy@0 {
compatible = "brcm,sr-usb-combo-phy";
reg = <0x00000000 0x100>;
#phy-cells = <1>;
};
usbphy1: usb-phy@10000 {
compatible = "brcm,sr-usb-combo-phy";
reg = <0x00010000 0x100>,
#phy-cells = <1>;
};
usbphy2: usb-phy@20000 {
compatible = "brcm,sr-usb-hs-phy";
reg = <0x00020000 0x100>,
#phy-cells = <0>;
};
...@@ -7,6 +7,9 @@ Required properties: ...@@ -7,6 +7,9 @@ Required properties:
- clocks: phandles to the clocks for each clock listed in clock-names - clocks: phandles to the clocks for each clock listed in clock-names
- clock-names: must contain "phy" - clock-names: must contain "phy"
Optional properties:
- vbus-supply: A phandle to the regulator for USB VBUS.
Example: Example:
usb3_phy0: phy@381f0040 { usb3_phy0: phy@381f0040 {
compatible = "fsl,imx8mq-usb-phy"; compatible = "fsl,imx8mq-usb-phy";
......
* Amlogic G12A USB2 PHY binding
Required properties:
- compatible: Should be "amlogic,meson-g12a-usb2-phy"
- reg: The base address and length of the registers
- #phys-cells: must be 0 (see phy-bindings.txt in this directory)
- clocks: a phandle to the clock of this PHY
- clock-names: must be "xtal"
- resets: a phandle to the reset line of this PHY
- reset-names: must be "phy"
- phy-supply: see phy-bindings.txt in this directory
Example:
usb2_phy0: phy@36000 {
compatible = "amlogic,g12a-usb2-phy";
reg = <0x0 0x36000 0x0 0x2000>;
clocks = <&xtal>;
clock-names = "xtal";
resets = <&reset RESET_USB_PHY21>;
reset-names = "phy";
#phy-cells = <0>;
};
* Amlogic G12A USB3 + PCIE Combo PHY binding
Required properties:
- compatible: Should be "amlogic,meson-g12a-usb3-pcie-phy"
- #phys-cells: must be 1. The cell number is used to select the phy mode
as defined in <dt-bindings/phy/phy.h> between PHY_TYPE_USB3 and PHY_TYPE_PCIE
- reg: The base address and length of the registers
- clocks: a phandle to the 100MHz reference clock of this PHY
- clock-names: must be "ref_clk"
- resets: phandle to the reset lines for the PHY control
- reset-names: must be "phy"
Example:
usb3_pcie_phy: phy@46000 {
compatible = "amlogic,g12a-usb3-pcie-phy";
reg = <0x0 0x46000 0x0 0x2000>;
clocks = <&clkc CLKID_PCIE_PLL>;
clock-names = "ref_clk";
resets = <&reset RESET_PCIE_PHY>;
reset-names = "phy";
#phy-cells = <1>;
};
...@@ -36,11 +36,20 @@ Required properties: ...@@ -36,11 +36,20 @@ Required properties:
- Tegra124: "nvidia,tegra124-xusb-padctl" - Tegra124: "nvidia,tegra124-xusb-padctl"
- Tegra132: "nvidia,tegra132-xusb-padctl", "nvidia,tegra124-xusb-padctl" - Tegra132: "nvidia,tegra132-xusb-padctl", "nvidia,tegra124-xusb-padctl"
- Tegra210: "nvidia,tegra210-xusb-padctl" - Tegra210: "nvidia,tegra210-xusb-padctl"
- Tegra186: "nvidia,tegra186-xusb-padctl"
- reg: Physical base address and length of the controller's registers. - reg: Physical base address and length of the controller's registers.
- resets: Must contain an entry for each entry in reset-names. - resets: Must contain an entry for each entry in reset-names.
- reset-names: Must include the following entries: - reset-names: Must include the following entries:
- "padctl" - "padctl"
For Tegra186:
- avdd-pll-erefeut-supply: UPHY brick and reference clock as well as UTMI PHY
power supply. Must supply 1.8 V.
- avdd-usb-supply: USB I/Os, VBUS, ID, REXT, D+/D- power supply. Must supply
3.3 V.
- vclamp-usb-supply: Bias rail for USB pad. Must supply 1.8 V.
- vddio-hsic-supply: HSIC PHY power supply. Must supply 1.2 V.
Pad nodes: Pad nodes:
========== ==========
......
Hisilicon hi3660 USB PHY
-----------------------
Required properties:
- compatible: should be "hisilicon,hi3660-usb-phy"
- #phy-cells: must be 0
- hisilicon,pericrg-syscon: phandle of syscon used to control phy.
- hisilicon,pctrl-syscon: phandle of syscon used to control phy.
- hisilicon,eye-diagram-param: parameter set for phy
Refer to phy/phy-bindings.txt for the generic PHY binding properties
This is a subnode of usb3_otg_bc register node.
Example:
usb3_otg_bc: usb3_otg_bc@ff200000 {
compatible = "syscon", "simple-mfd";
reg = <0x0 0xff200000 0x0 0x1000>;
usb-phy {
compatible = "hisilicon,hi3660-usb-phy";
#phy-cells = <0>;
hisilicon,pericrg-syscon = <&crg_ctrl>;
hisilicon,pctrl-syscon = <&pctrl>;
hisilicon,eye-diagram-param = <0x22466e4>;
};
};
MediaTek Universal Flash Storage (UFS) M-PHY binding
--------------------------------------------------------
UFS M-PHY nodes are defined to describe on-chip UFS M-PHY hardware macro.
Each UFS M-PHY node should have its own node.
To bind UFS M-PHY with UFS host controller, the controller node should
contain a phandle reference to UFS M-PHY node.
Required properties for UFS M-PHY nodes:
- compatible : Compatible list, contains the following controller:
"mediatek,mt8183-ufsphy" for ufs phy
persent on MT81xx chipsets.
- reg : Address and length of the UFS M-PHY register set.
- #phy-cells : This property shall be set to 0.
- clocks : List of phandle and clock specifier pairs.
- clock-names : List of clock input name strings sorted in the same
order as the clocks property. Following clocks are
mandatory.
"unipro": Unipro core control clock.
"mp": M-PHY core control clock.
Example:
ufsphy: phy@11fa0000 {
compatible = "mediatek,mt8183-ufsphy";
reg = <0 0x11fa0000 0 0xc000>;
#phy-cells = <0>;
clocks = <&infracfg_ao INFRACFG_AO_UNIPRO_SCK_CG>,
<&infracfg_ao INFRACFG_AO_UFS_MP_SAP_BCLK_CG>;
clock-names = "unipro", "mp";
};
ufshci@11270000 {
...
phys = <&ufsphy>;
};
...@@ -11,6 +11,7 @@ Required properties: ...@@ -11,6 +11,7 @@ Required properties:
"qcom,msm8996-qmp-usb3-phy" for 14nm USB3 phy on msm8996, "qcom,msm8996-qmp-usb3-phy" for 14nm USB3 phy on msm8996,
"qcom,msm8998-qmp-usb3-phy" for USB3 QMP V3 phy on msm8998, "qcom,msm8998-qmp-usb3-phy" for USB3 QMP V3 phy on msm8998,
"qcom,msm8998-qmp-ufs-phy" for UFS QMP phy on msm8998, "qcom,msm8998-qmp-ufs-phy" for UFS QMP phy on msm8998,
"qcom,msm8998-qmp-pcie-phy" for PCIe QMP phy on msm8998,
"qcom,sdm845-qmp-usb3-phy" for USB3 QMP V3 phy on sdm845, "qcom,sdm845-qmp-usb3-phy" for USB3 QMP V3 phy on sdm845,
"qcom,sdm845-qmp-usb3-uni-phy" for USB3 QMP V3 UNI phy on sdm845, "qcom,sdm845-qmp-usb3-uni-phy" for USB3 QMP V3 UNI phy on sdm845,
"qcom,sdm845-qmp-ufs-phy" for UFS QMP phy on sdm845. "qcom,sdm845-qmp-ufs-phy" for UFS QMP phy on sdm845.
...@@ -48,6 +49,8 @@ Required properties: ...@@ -48,6 +49,8 @@ Required properties:
"aux", "cfg_ahb", "ref". "aux", "cfg_ahb", "ref".
For "qcom,msm8998-qmp-ufs-phy" must contain: For "qcom,msm8998-qmp-ufs-phy" must contain:
"ref", "ref_aux". "ref", "ref_aux".
For "qcom,msm8998-qmp-pcie-phy" must contain:
"aux", "cfg_ahb", "ref".
For "qcom,sdm845-qmp-usb3-phy" must contain: For "qcom,sdm845-qmp-usb3-phy" must contain:
"aux", "cfg_ahb", "ref", "com_aux". "aux", "cfg_ahb", "ref", "com_aux".
For "qcom,sdm845-qmp-usb3-uni-phy" must contain: For "qcom,sdm845-qmp-usb3-uni-phy" must contain:
...@@ -59,7 +62,8 @@ Required properties: ...@@ -59,7 +62,8 @@ Required properties:
one for each entry in reset-names. one for each entry in reset-names.
- reset-names: "phy" for reset of phy block, - reset-names: "phy" for reset of phy block,
"common" for phy common block reset, "common" for phy common block reset,
"cfg" for phy's ahb cfg block reset. "cfg" for phy's ahb cfg block reset,
"ufsphy" for the PHY reset in the UFS controller.
For "qcom,ipq8074-qmp-pcie-phy" must contain: For "qcom,ipq8074-qmp-pcie-phy" must contain:
"phy", "common". "phy", "common".
...@@ -69,12 +73,16 @@ Required properties: ...@@ -69,12 +73,16 @@ Required properties:
"phy", "common". "phy", "common".
For "qcom,msm8998-qmp-usb3-phy" must contain For "qcom,msm8998-qmp-usb3-phy" must contain
"phy", "common". "phy", "common".
For "qcom,msm8998-qmp-ufs-phy": no resets are listed. For "qcom,msm8998-qmp-ufs-phy": must contain:
"ufsphy".
For "qcom,msm8998-qmp-pcie-phy" must contain:
"phy", "common".
For "qcom,sdm845-qmp-usb3-phy" must contain: For "qcom,sdm845-qmp-usb3-phy" must contain:
"phy", "common". "phy", "common".
For "qcom,sdm845-qmp-usb3-uni-phy" must contain: For "qcom,sdm845-qmp-usb3-uni-phy" must contain:
"phy", "common". "phy", "common".
For "qcom,sdm845-qmp-ufs-phy": no resets are listed. For "qcom,sdm845-qmp-ufs-phy": must contain:
"ufsphy".
- vdda-phy-supply: Phandle to a regulator supply to PHY core block. - vdda-phy-supply: Phandle to a regulator supply to PHY core block.
- vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block. - vdda-pll-supply: Phandle to 1.8V regulator supply to PHY refclk pll block.
......
...@@ -7,6 +7,7 @@ Required properties: ...@@ -7,6 +7,7 @@ Required properties:
- compatible: "renesas,usb-phy-r8a7743" if the device is a part of R8A7743 SoC. - compatible: "renesas,usb-phy-r8a7743" if the device is a part of R8A7743 SoC.
"renesas,usb-phy-r8a7744" if the device is a part of R8A7744 SoC. "renesas,usb-phy-r8a7744" if the device is a part of R8A7744 SoC.
"renesas,usb-phy-r8a7745" if the device is a part of R8A7745 SoC. "renesas,usb-phy-r8a7745" if the device is a part of R8A7745 SoC.
"renesas,usb-phy-r8a77470" if the device is a part of R8A77470 SoC.
"renesas,usb-phy-r8a7790" if the device is a part of R8A7790 SoC. "renesas,usb-phy-r8a7790" if the device is a part of R8A7790 SoC.
"renesas,usb-phy-r8a7791" if the device is a part of R8A7791 SoC. "renesas,usb-phy-r8a7791" if the device is a part of R8A7791 SoC.
"renesas,usb-phy-r8a7794" if the device is a part of R8A7794 SoC. "renesas,usb-phy-r8a7794" if the device is a part of R8A7794 SoC.
...@@ -30,7 +31,7 @@ channels. These subnodes must contain the following properties: ...@@ -30,7 +31,7 @@ channels. These subnodes must contain the following properties:
- #phy-cells: see phy-bindings.txt in the same directory, must be <1>. - #phy-cells: see phy-bindings.txt in the same directory, must be <1>.
The phandle's argument in the PHY specifier is the USB controller selector for The phandle's argument in the PHY specifier is the USB controller selector for
the USB channel; see the selector meanings below: the USB channel other than r8a77470 SoC; see the selector meanings below:
+-----------+---------------+---------------+ +-----------+---------------+---------------+
|\ Selector | | | |\ Selector | | |
...@@ -41,6 +42,16 @@ the USB channel; see the selector meanings below: ...@@ -41,6 +42,16 @@ the USB channel; see the selector meanings below:
| 2 | PCI EHCI/OHCI | xHCI | | 2 | PCI EHCI/OHCI | xHCI |
+-----------+---------------+---------------+ +-----------+---------------+---------------+
For r8a77470 SoC;see the selector meaning below:
+-----------+---------------+---------------+
|\ Selector | | |
+ --------- + 0 | 1 |
| Channel \| | |
+-----------+---------------+---------------+
| 0 | EHCI/OHCI | HS-USB |
+-----------+---------------+---------------+
Example (Lager board): Example (Lager board):
usb-phy@e6590100 { usb-phy@e6590100 {
...@@ -48,15 +59,53 @@ Example (Lager board): ...@@ -48,15 +59,53 @@ Example (Lager board):
reg = <0 0xe6590100 0 0x100>; reg = <0 0xe6590100 0 0x100>;
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
clocks = <&mstp7_clks R8A7790_CLK_HSUSB>; clocks = <&cpg CPG_MOD 704>;
clock-names = "usbhs"; clock-names = "usbhs";
power-domains = <&sysc R8A7790_PD_ALWAYS_ON>;
resets = <&cpg 704>;
usb-channel@0 { usb0: usb-channel@0 {
reg = <0>; reg = <0>;
#phy-cells = <1>; #phy-cells = <1>;
}; };
usb-channel@2 { usb2: usb-channel@2 {
reg = <2>; reg = <2>;
#phy-cells = <1>; #phy-cells = <1>;
}; };
}; };
Example (iWave RZ/G1C sbc):
usbphy0: usb-phy0@e6590100 {
compatible = "renesas,usb-phy-r8a77470",
"renesas,rcar-gen2-usb-phy";
reg = <0 0xe6590100 0 0x100>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&cpg CPG_MOD 704>;
clock-names = "usbhs";
power-domains = <&sysc R8A77470_PD_ALWAYS_ON>;
resets = <&cpg 704>;
usb0: usb-channel@0 {
reg = <0>;
#phy-cells = <1>;
};
};
usbphy1: usb-phy@e6598100 {
compatible = "renesas,usb-phy-r8a77470",
"renesas,rcar-gen2-usb-phy";
reg = <0 0xe6598100 0 0x100>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&cpg CPG_MOD 706>;
clock-names = "usbhs";
power-domains = <&sysc R8A77470_PD_ALWAYS_ON>;
resets = <&cpg 706>;
usb1: usb-channel@0 {
reg = <0>;
#phy-cells = <1>;
};
};
* Renesas R-Car generation 3 USB 2.0 PHY * Renesas R-Car generation 3 USB 2.0 PHY
This file provides information on what the device node for the R-Car generation This file provides information on what the device node for the R-Car generation
3 and RZ/G2 USB 2.0 PHY contain. 3, RZ/G1C and RZ/G2 USB 2.0 PHY contain.
Required properties: Required properties:
- compatible: "renesas,usb2-phy-r8a774a1" if the device is a part of an R8A774A1 - compatible: "renesas,usb2-phy-r8a77470" if the device is a part of an R8A77470
SoC.
"renesas,usb2-phy-r8a774a1" if the device is a part of an R8A774A1
SoC. SoC.
"renesas,usb2-phy-r8a774c0" if the device is a part of an R8A774C0 "renesas,usb2-phy-r8a774c0" if the device is a part of an R8A774C0
SoC. SoC.
...@@ -27,7 +29,13 @@ Required properties: ...@@ -27,7 +29,13 @@ Required properties:
- reg: offset and length of the partial USB 2.0 Host register block. - reg: offset and length of the partial USB 2.0 Host register block.
- clocks: clock phandle and specifier pair(s). - clocks: clock phandle and specifier pair(s).
- #phy-cells: see phy-bindings.txt in the same directory, must be <0>. - #phy-cells: see phy-bindings.txt in the same directory, must be <1> (and
using <0> is deprecated).
The phandle's argument in the PHY specifier is the INT_STATUS bit of controller:
- 1 = USBH_INTA (OHCI)
- 2 = USBH_INTB (EHCI)
- 3 = UCOM_INT (OTG and BC)
Optional properties: Optional properties:
To use a USB channel where USB 2.0 Host and HSUSB (USB 2.0 Peripheral) are To use a USB channel where USB 2.0 Host and HSUSB (USB 2.0 Peripheral) are
......
...@@ -7,12 +7,15 @@ Required properties: ...@@ -7,12 +7,15 @@ Required properties:
- reg: PHY register address offset and length in "general - reg: PHY register address offset and length in "general
register files" register files"
Optional clocks using the clock bindings (see ../clock/clock-bindings.txt), Optional properties:
specified by name:
- clock-names: Should contain "emmcclk". Although this is listed as optional - clock-names: Should contain "emmcclk". Although this is listed as optional
(because most boards can get basic functionality without having (because most boards can get basic functionality without having
access to it), it is strongly suggested. access to it), it is strongly suggested.
See ../clock/clock-bindings.txt for details.
- clocks: Should have a phandle to the card clock exported by the SDHCI driver. - clocks: Should have a phandle to the card clock exported by the SDHCI driver.
- drive-impedance-ohm: Specifies the drive impedance in Ohm.
Possible values are 33, 40, 50, 66 and 100.
If not set, the default value of 50 will be applied.
Example: Example:
...@@ -29,6 +32,7 @@ grf: syscon@ff770000 { ...@@ -29,6 +32,7 @@ grf: syscon@ff770000 {
reg = <0xf780 0x20>; reg = <0xf780 0x20>;
clocks = <&sdhci>; clocks = <&sdhci>;
clock-names = "emmcclk"; clock-names = "emmcclk";
drive-impedance-ohm = <50>;
#phy-cells = <0>; #phy-cells = <0>;
}; };
}; };
TI AM654 SERDES
Required properties:
- compatible: Should be "ti,phy-am654-serdes"
- reg : Address and length of the register set for the device.
- #phy-cells: determine the number of cells that should be given in the
phandle while referencing this phy. Should be "2". The 1st cell
corresponds to the phy type (should be one of the types specified in
include/dt-bindings/phy/phy.h) and the 2nd cell should be the serdes
lane function.
If SERDES0 is referenced 2nd cell should be:
0 - USB3
1 - PCIe0 Lane0
2 - ICSS2 SGMII Lane0
If SERDES1 is referenced 2nd cell should be:
0 - PCIe1 Lane0
1 - PCIe0 Lane1
2 - ICSS2 SGMII Lane1
- power-domains: As documented by the generic PM domain bindings in
Documentation/devicetree/bindings/power/power_domain.txt.
- clocks: List of clock-specifiers representing the input to the SERDES.
Should have 3 items representing the left input clock, external
reference clock and right input clock in that order.
- clock-output-names: List of clock names for each of the clock outputs of
SERDES. Should have 3 items for CMU reference clock,
left output clock and right output clock in that order.
- assigned-clocks: As defined in
Documentation/devicetree/bindings/clock/clock-bindings.txt
- assigned-clock-parents: As defined in
Documentation/devicetree/bindings/clock/clock-bindings.txt
- #clock-cells: Should be <1> to choose between the 3 output clocks.
Defined in Documentation/devicetree/bindings/clock/clock-bindings.txt
The following macros are defined in dt-bindings/phy/phy-am654-serdes.h
for selecting the correct reference clock. This can be used while
specifying the clocks created by SERDES.
=> AM654_SERDES_CMU_REFCLK
=> AM654_SERDES_LO_REFCLK
=> AM654_SERDES_RO_REFCLK
- mux-controls: Phandle to the multiplexer that is used to select the lane
function. See #phy-cells above to see the multiplex values.
Example:
Example for SERDES0 is given below. It has 3 clock inputs;
left input reference clock as indicated by <&k3_clks 153 4>, external
reference clock as indicated by <&k3_clks 153 1> and right input
reference clock as indicated by <&serdes1 AM654_SERDES_LO_REFCLK>. (The
right input of SERDES0 is connected to the left output of SERDES1).
SERDES0 registers 3 clock outputs as indicated in clock-output-names. The
first refers to the CMU reference clock, second refers to the left output
reference clock and the third refers to the right output reference clock.
The assigned-clocks and assigned-clock-parents is used here to set the
parent of left input reference clock to MAINHSDIV_CLKOUT4 and parent of
CMU reference clock to left input reference clock.
serdes0: serdes@900000 {
compatible = "ti,phy-am654-serdes";
reg = <0x0 0x900000 0x0 0x2000>;
reg-names = "serdes";
#phy-cells = <2>;
power-domains = <&k3_pds 153>;
clocks = <&k3_clks 153 4>, <&k3_clks 153 1>,
<&serdes1 AM654_SERDES_LO_REFCLK>;
clock-output-names = "serdes0_cmu_refclk", "serdes0_lo_refclk",
"serdes0_ro_refclk";
assigned-clocks = <&k3_clks 153 4>, <&serdes0 AM654_SERDES_CMU_REFCLK>;
assigned-clock-parents = <&k3_clks 153 8>, <&k3_clks 153 4>;
ti,serdes-clk = <&serdes0_clk>;
mux-controls = <&serdes_mux 0>;
#clock-cells = <1>;
};
Example for PCIe consumer node using the SERDES PHY specifier is given below.
&pcie0_rc {
num-lanes = <2>;
phys = <&serdes0 PHY_TYPE_PCIE 1>, <&serdes1 PHY_TYPE_PCIE 1>;
phy-names = "pcie-phy0", "pcie-phy1";
};
...@@ -29,6 +29,7 @@ Optional properties: ...@@ -29,6 +29,7 @@ Optional properties:
- vdda-pll-max-microamp : specifies max. load that can be drawn from pll supply - vdda-pll-max-microamp : specifies max. load that can be drawn from pll supply
- vddp-ref-clk-supply : phandle to UFS device ref_clk pad power supply - vddp-ref-clk-supply : phandle to UFS device ref_clk pad power supply
- vddp-ref-clk-max-microamp : specifies max. load that can be drawn from this supply - vddp-ref-clk-max-microamp : specifies max. load that can be drawn from this supply
- resets : specifies the PHY reset in the UFS controller
Example: Example:
...@@ -51,9 +52,11 @@ Example: ...@@ -51,9 +52,11 @@ Example:
<&clock_gcc clk_ufs_phy_ldo>, <&clock_gcc clk_ufs_phy_ldo>,
<&clock_gcc clk_gcc_ufs_tx_cfg_clk>, <&clock_gcc clk_gcc_ufs_tx_cfg_clk>,
<&clock_gcc clk_gcc_ufs_rx_cfg_clk>; <&clock_gcc clk_gcc_ufs_rx_cfg_clk>;
resets = <&ufshc 0>;
}; };
ufshc@fc598000 { ufshc: ufshc@fc598000 {
#reset-cells = <1>;
... ...
phys = <&ufsphy1>; phys = <&ufsphy1>;
phy-names = "ufsphy"; phy-names = "ufsphy";
......
...@@ -50,6 +50,8 @@ Optional properties: ...@@ -50,6 +50,8 @@ Optional properties:
-lanes-per-direction : number of lanes available per direction - either 1 or 2. -lanes-per-direction : number of lanes available per direction - either 1 or 2.
Note that it is assume same number of lanes is used both Note that it is assume same number of lanes is used both
directions at once. If not specified, default is 2 lanes per direction. directions at once. If not specified, default is 2 lanes per direction.
- #reset-cells : Must be <1> for Qualcomm UFS controllers that expose
PHY reset from the UFS controller.
- resets : reset node register - resets : reset node register
- reset-names : describe reset node register, the "rst" corresponds to reset the whole UFS IP. - reset-names : describe reset node register, the "rst" corresponds to reset the whole UFS IP.
...@@ -79,4 +81,5 @@ Example: ...@@ -79,4 +81,5 @@ Example:
reset-names = "rst"; reset-names = "rst";
phys = <&ufsphy1>; phys = <&ufsphy1>;
phy-names = "ufsphy"; phy-names = "ufsphy";
#reset-cells = <1>;
}; };
...@@ -40,3 +40,91 @@ Example device nodes: ...@@ -40,3 +40,91 @@ Example device nodes:
phy-names = "usb2-phy", "usb3-phy"; phy-names = "usb2-phy", "usb3-phy";
}; };
}; };
Amlogic Meson G12A DWC3 USB SoC Controller Glue
The Amlogic G12A embeds a DWC3 USB IP Core configured for USB2 and USB3
in host-only mode, and a DWC2 IP Core configured for USB2 peripheral mode
only.
A glue connects the DWC3 core to USB2 PHYs and optionnaly to an USB3 PHY.
One of the USB2 PHY can be re-routed in peripheral mode to a DWC2 USB IP.
The DWC3 Glue controls the PHY routing and power, an interrupt line is
connected to the Glue to serve as OTG ID change detection.
Required properties:
- compatible: Should be "amlogic,meson-g12a-usb-ctrl"
- clocks: a handle for the "USB" clock
- resets: a handle for the shared "USB" reset line
- reg: The base address and length of the registers
- interrupts: the interrupt specifier for the OTG detection
- phys: handle to used PHYs on the system
- a <0> phandle can be used if a PHY is not used
- phy-names: names of the used PHYs on the system :
- "usb2-phy0" for USB2 PHY0 if USBHOST_A port is used
- "usb2-phy1" for USB2 PHY1 if USBOTG_B port is used
- "usb3-phy0" for USB3 PHY if USB3_0 is used
- dr_mode: should be "host", "peripheral", or "otg" depending on
the usage and configuration of the OTG Capable port.
- "host" and "peripheral" means a fixed Host or Device only connection
- "otg" means the port can be used as both Host or Device and
be switched automatically using the OTG ID pin.
Optional properties:
- vbus-supply: should be a phandle to the regulator controlling the VBUS
power supply when used in OTG switchable mode
Required child nodes:
A child node must exist to represent the core DWC3 IP block. The name of
the node is not important. The content of the node is defined in dwc3.txt.
A child node must exist to represent the core DWC2 IP block. The name of
the node is not important. The content of the node is defined in dwc2.txt.
PHY documentation is provided in the following places:
- Documentation/devicetree/bindings/phy/meson-g12a-usb2-phy.txt
- Documentation/devicetree/bindings/phy/meson-g12a-usb3-pcie-phy.txt
Example device nodes:
usb: usb@ffe09000 {
compatible = "amlogic,meson-g12a-usb-ctrl";
reg = <0x0 0xffe09000 0x0 0xa0>;
interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <2>;
#size-cells = <2>;
ranges;
clocks = <&clkc CLKID_USB>;
resets = <&reset RESET_USB>;
dr_mode = "otg";
phys = <&usb2_phy0>, <&usb2_phy1>,
<&usb3_pcie_phy PHY_TYPE_USB3>;
phy-names = "usb2-phy0", "usb2-phy1", "usb3-phy0";
dwc2: usb@ff400000 {
compatible = "amlogic,meson-g12a-usb", "snps,dwc2";
reg = <0x0 0xff400000 0x0 0x40000>;
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clkc CLKID_USB1_DDR_BRIDGE>;
clock-names = "ddr";
phys = <&usb2_phy1>;
dr_mode = "peripheral";
g-rx-fifo-size = <192>;
g-np-tx-fifo-size = <128>;
g-tx-fifo-size = <128 128 16 16 16>;
};
dwc3: usb@ff500000 {
compatible = "snps,dwc3";
reg = <0x0 0xff500000 0x0 0x100000>;
interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
dr_mode = "host";
snps,dis_u2_susphy_quirk;
snps,quirk-frame-length-adjustment;
};
};
...@@ -14,6 +14,7 @@ Required properties: ...@@ -14,6 +14,7 @@ Required properties:
- "amlogic,meson8-usb": The DWC2 USB controller instance in Amlogic Meson8 SoCs; - "amlogic,meson8-usb": The DWC2 USB controller instance in Amlogic Meson8 SoCs;
- "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs; - "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs;
- "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs; - "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs;
- "amlogic,meson-g12a-usb": The DWC2 USB controller instance in Amlogic G12A SoCs;
- "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs; - "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs;
- snps,dwc2: A generic DWC2 USB controller with default parameters. - snps,dwc2: A generic DWC2 USB controller with default parameters.
- "st,stm32f4x9-fsotg": The DWC2 USB FS/HS controller instance in STM32F4x9 SoCs - "st,stm32f4x9-fsotg": The DWC2 USB FS/HS controller instance in STM32F4x9 SoCs
...@@ -31,12 +32,18 @@ Refer to clk/clock-bindings.txt for generic clock consumer properties ...@@ -31,12 +32,18 @@ Refer to clk/clock-bindings.txt for generic clock consumer properties
Optional properties: Optional properties:
- phys: phy provider specifier - phys: phy provider specifier
- phy-names: shall be "usb2-phy" - phy-names: shall be "usb2-phy"
- vbus-supply: reference to the VBUS regulator. Depending on the current mode
this is enabled (in "host" mode") or disabled (in "peripheral" mode). The
regulator is updated if the controller is configured in "otg" mode and the
status changes between "host" and "peripheral".
Refer to phy/phy-bindings.txt for generic phy consumer properties Refer to phy/phy-bindings.txt for generic phy consumer properties
- dr_mode: shall be one of "host", "peripheral" and "otg" - dr_mode: shall be one of "host", "peripheral" and "otg"
Refer to usb/generic.txt Refer to usb/generic.txt
- g-rx-fifo-size: size of rx fifo size in gadget mode. - g-rx-fifo-size: size of rx fifo size in gadget mode.
- g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode. - g-np-tx-fifo-size: size of non-periodic tx fifo size in gadget mode.
- g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode. - g-tx-fifo-size: size of periodic tx fifo per endpoint (except ep0) in gadget mode.
- snps,reset-phy-on-wake: If present indicates that we need to reset the PHY when
we detect a wakeup. This is due to a hardware errata.
Deprecated properties: Deprecated properties:
- g-use-dma: gadget DMA mode is automatically detected - g-use-dma: gadget DMA mode is automatically detected
......
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/generic-ehci.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: USB EHCI Controller Device Tree Bindings
allOf:
- $ref: "usb-hcd.yaml"
maintainers:
- Greg Kroah-Hartman <gregkh@linuxfoundation.org>
properties:
compatible:
contains:
const: generic-ehci
reg:
maxItems: 1
interrupts:
maxItems: 1
resets:
minItems: 1
maxItems: 4
clocks:
minItems: 1
maxItems: 4
description: |
In case the Renesas R-Car Gen3 SoCs:
- if a host only channel: first clock should be host.
- if a USB DRD channel: first clock should be host and second
one should be peripheral
big-endian:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag for HCDs with big endian descriptors and big
endian registers.
big-endian-desc:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag for HCDs with big endian descriptors.
big-endian-regs:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag for HCDs with big endian registers.
has-transaction-translator:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag if EHCI has a Transaction Translator built into
the root hub.
needs-reset-on-resume:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag to force EHCI reset after resume.
phys: true
required:
- compatible
- reg
- interrupts
additionalProperties: false
examples:
- |
ehci@e0000300 {
compatible = "ibm,usb-ehci-440epx", "generic-ehci";
interrupt-parent = <&UIC0>;
interrupts = <0x1a 4>;
reg = <0 0xe0000300 90 0 0xe0000390 70>;
big-endian;
};
- |
ehci0: usb@1c14000 {
compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
reg = <0x01c14000 0x100>;
interrupts = <39>;
clocks = <&ahb_gates 1>;
phys = <&usbphy 1>;
phy-names = "usb";
};
...
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/generic-ohci.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: USB OHCI Controller Device Tree Bindings
allOf:
- $ref: "usb-hcd.yaml"
maintainers:
- Greg Kroah-Hartman <gregkh@linuxfoundation.org>
properties:
compatible:
contains:
const: generic-ohci
reg:
maxItems: 1
interrupts:
maxItems: 1
resets:
minItems: 1
maxItems: 2
clocks:
minItems: 1
maxItems: 3
description: |
In case the Renesas R-Car Gen3 SoCs:
- if a host only channel: first clock should be host.
- if a USB DRD channel: first clock should be host and second
one should be peripheral
big-endian:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag for HCDs with big endian descriptors and big
endian registers.
big-endian-desc:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag for HCDs with big endian descriptors.
big-endian-regs:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set this flag for HCDs with big endian registers.
remote-wakeup-connected:
$ref: /schemas/types.yaml#/definitions/flag
description:
Remote wakeup is wired on the platform.
no-big-frame-no:
$ref: /schemas/types.yaml#/definitions/flag
description:
Set if frame_no lives in bits [15:0] of HCCA
num-ports:
$ref: /schemas/types.yaml#/definitions/uint32
description:
Overrides the detected port count
phys: true
required:
- compatible
- reg
- interrupts
additionalProperties: false
examples:
- |
ohci0: usb@1c14400 {
compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
reg = <0x01c14400 0x100>;
interrupts = <64>;
clocks = <&usb_clk 6>, <&ahb_gates 2>;
phys = <&usbphy 1>;
};
...
...@@ -8,9 +8,15 @@ Required properties: ...@@ -8,9 +8,15 @@ Required properties:
- interrupt-names: must be "mc" - interrupt-names: must be "mc"
- clocks: phandle to the "udc" clock - clocks: phandle to the "udc" clock
- clock-names: must be "udc" - clock-names: must be "udc"
- phys: phandle to the USB PHY
Example: Example:
usb_phy: usb-phy@0 {
compatible = "usb-nop-xceiv";
#phy-cells = <0>;
};
udc: usb@13040000 { udc: usb@13040000 {
compatible = "ingenic,jz4740-musb"; compatible = "ingenic,jz4740-musb";
reg = <0x13040000 0x10000>; reg = <0x13040000 0x10000>;
...@@ -21,4 +27,6 @@ udc: usb@13040000 { ...@@ -21,4 +27,6 @@ udc: usb@13040000 {
clocks = <&cgu JZ4740_CLK_UDC>; clocks = <&cgu JZ4740_CLK_UDC>;
clock-names = "udc"; clock-names = "udc";
phys = <&usb_phy>;
}; };
...@@ -10,6 +10,7 @@ Required properties: ...@@ -10,6 +10,7 @@ Required properties:
- Tegra124: "nvidia,tegra124-xusb" - Tegra124: "nvidia,tegra124-xusb"
- Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb" - Tegra132: "nvidia,tegra132-xusb", "nvidia,tegra124-xusb"
- Tegra210: "nvidia,tegra210-xusb" - Tegra210: "nvidia,tegra210-xusb"
- Tegra186: "nvidia,tegra186-xusb"
- reg: Must contain the base and length of the xHCI host registers, XUSB FPCI - reg: Must contain the base and length of the xHCI host registers, XUSB FPCI
registers and XUSB IPFS registers. registers and XUSB IPFS registers.
- reg-names: Must contain the following entries: - reg-names: Must contain the following entries:
...@@ -59,6 +60,8 @@ For Tegra210: ...@@ -59,6 +60,8 @@ For Tegra210:
- avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V. - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
- dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V. - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
- hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V. - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
For Tegra210 and Tegra186:
- power-domains: A list of PM domain specifiers that reference each power-domain - power-domains: A list of PM domain specifiers that reference each power-domain
used by the xHCI controller. This list must comprise of a specifier for the used by the xHCI controller. This list must comprise of a specifier for the
XUSBA and XUSBC power-domains. See ../power/power_domain.txt and XUSBA and XUSBC power-domains. See ../power/power_domain.txt and
...@@ -78,6 +81,7 @@ Optional properties: ...@@ -78,6 +81,7 @@ Optional properties:
- Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1 - Tegra132: usb2-0, usb2-1, usb2-2, hsic-0, hsic-1, usb3-0, usb3-1
- Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2, - Tegra210: usb2-0, usb2-1, usb2-2, usb2-3, hsic-0, usb3-0, usb3-1, usb3-2,
usb3-3 usb3-3
- Tegra186: usb2-0, usb2-1, usb2-2, hsic-0, usb3-0, usb3-1, usb3-2
Example: Example:
-------- --------
......
...@@ -6,6 +6,7 @@ Required properties: ...@@ -6,6 +6,7 @@ Required properties:
- "renesas,usbhs-r8a7743" for r8a7743 (RZ/G1M) compatible device - "renesas,usbhs-r8a7743" for r8a7743 (RZ/G1M) compatible device
- "renesas,usbhs-r8a7744" for r8a7744 (RZ/G1N) compatible device - "renesas,usbhs-r8a7744" for r8a7744 (RZ/G1N) compatible device
- "renesas,usbhs-r8a7745" for r8a7745 (RZ/G1E) compatible device - "renesas,usbhs-r8a7745" for r8a7745 (RZ/G1E) compatible device
- "renesas,usbhs-r8a77470" for r8a77470 (RZ/G1C) compatible device
- "renesas,usbhs-r8a774a1" for r8a774a1 (RZ/G2M) compatible device - "renesas,usbhs-r8a774a1" for r8a774a1 (RZ/G2M) compatible device
- "renesas,usbhs-r8a774c0" for r8a774c0 (RZ/G2E) compatible device - "renesas,usbhs-r8a774c0" for r8a774c0 (RZ/G2E) compatible device
- "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device - "renesas,usbhs-r8a7790" for r8a7790 (R-Car H2) compatible device
......
USB EHCI controllers
Required properties:
- compatible : should be "generic-ehci".
- reg : should contain at least address and length of the standard EHCI
register set for the device. Optional platform-dependent registers
(debug-port or other) can be also specified here, but only after
definition of standard EHCI registers.
- interrupts : one EHCI interrupt should be described here.
Optional properties:
- big-endian-regs : boolean, set this for hcds with big-endian registers
- big-endian-desc : boolean, set this for hcds with big-endian descriptors
- big-endian : boolean, for hcds with big-endian-regs + big-endian-desc
- needs-reset-on-resume : boolean, set this to force EHCI reset after resume
- has-transaction-translator : boolean, set this if EHCI have a Transaction
Translator built into the root hub.
- clocks : a list of phandle + clock specifier pairs. In case of Renesas
R-Car Gen3 SoCs:
- if a host only channel: first clock should be host.
- if a USB DRD channel: first clock should be host and second one
should be peripheral.
- phys : see usb-hcd.txt in the current directory
- resets : phandle + reset specifier pair
additionally the properties from usb-hcd.txt (in the current directory) are
supported.
Example (Sequoia 440EPx):
ehci@e0000300 {
compatible = "ibm,usb-ehci-440epx", "usb-ehci";
interrupt-parent = <&UIC0>;
interrupts = <1a 4>;
reg = <0 e0000300 90 0 e0000390 70>;
big-endian;
};
Example (Allwinner sun4i A10 SoC):
ehci0: usb@1c14000 {
compatible = "allwinner,sun4i-a10-ehci", "generic-ehci";
reg = <0x01c14000 0x100>;
interrupts = <39>;
clocks = <&ahb_gates 1>;
phys = <&usbphy 1>;
phy-names = "usb";
};
Generic USB HCD (Host Controller Device) Properties
Optional properties:
- phys: a list of all USB PHYs on this HCD
Example:
&usb1 {
phys = <&usb2_phy1>, <&usb3_phy1>;
};
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/usb/usb-hcd.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Generic USB Host Controller Device Tree Bindings
maintainers:
- Greg Kroah-Hartman <gregkh@linuxfoundation.org>
properties:
$nodename:
pattern: "^usb(@.*)?"
phys:
$ref: /schemas/types.yaml#/definitions/phandle-array
description:
List of all the USB PHYs on this HCD
examples:
- |
usb {
phys = <&usb2_phy1>, <&usb3_phy1>;
};
USB OHCI controllers
Required properties:
- compatible : "generic-ohci"
- reg : ohci controller register range (address and length)
- interrupts : ohci controller interrupt
Optional properties:
- big-endian-regs : boolean, set this for hcds with big-endian registers
- big-endian-desc : boolean, set this for hcds with big-endian descriptors
- big-endian : boolean, for hcds with big-endian-regs + big-endian-desc
- no-big-frame-no : boolean, set if frame_no lives in bits [15:0] of HCCA
- remote-wakeup-connected: remote wakeup is wired on the platform
- num-ports : u32, to override the detected port count
- clocks : a list of phandle + clock specifier pairs. In case of Renesas
R-Car Gen3 SoCs:
- if a host only channel: first clock should be host.
- if a USB DRD channel: first clock should be host and second one
should be peripheral.
- phys : see usb-hcd.txt in the current directory
- resets : a list of phandle + reset specifier pairs
additionally the properties from usb-hcd.txt (in the current directory) are
supported.
Example:
ohci0: usb@1c14400 {
compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
reg = <0x01c14400 0x100>;
interrupts = <64>;
clocks = <&usb_clk 6>, <&ahb_gates 2>;
phys = <&usbphy 1>;
phy-names = "usb";
};
...@@ -10,6 +10,7 @@ Required properties: ...@@ -10,6 +10,7 @@ Required properties:
- "renesas,xhci-r8a7743" for r8a7743 SoC - "renesas,xhci-r8a7743" for r8a7743 SoC
- "renesas,xhci-r8a7744" for r8a7744 SoC - "renesas,xhci-r8a7744" for r8a7744 SoC
- "renesas,xhci-r8a774a1" for r8a774a1 SoC - "renesas,xhci-r8a774a1" for r8a774a1 SoC
- "renesas,xhci-r8a774c0" for r8a774c0 SoC
- "renesas,xhci-r8a7790" for r8a7790 SoC - "renesas,xhci-r8a7790" for r8a7790 SoC
- "renesas,xhci-r8a7791" for r8a7791 SoC - "renesas,xhci-r8a7791" for r8a7791 SoC
- "renesas,xhci-r8a7793" for r8a7793 SoC - "renesas,xhci-r8a7793" for r8a7793 SoC
......
...@@ -64,8 +64,10 @@ Optional properties : ...@@ -64,8 +64,10 @@ Optional properties :
- power-on-time-ms : Specifies the time it takes from the time the host - power-on-time-ms : Specifies the time it takes from the time the host
initiates the power-on sequence to a port until the port has adequate initiates the power-on sequence to a port until the port has adequate
power. The value is given in ms in a 0 - 510 range (default is 100ms). power. The value is given in ms in a 0 - 510 range (default is 100ms).
- swap-dx-lanes : Specifies the ports which will swap the differential-pair - swap-dx-lanes : Specifies the downstream ports which will swap the
(D+/D-), default is not-swapped. differential-pair (D+/D-), default is not-swapped.
- swap-us-lanes : Selects the upstream port differential-pair (D+/D-)
swapping (boolean, default is not-swapped)
Examples: Examples:
usb2512b@2c { usb2512b@2c {
......
================================
Linux UWB + Wireless USB + WiNET Linux UWB + Wireless USB + WiNET
================================
Copyright (C) 2005-2006 Intel Corporation
(C) 2005-2006 Intel Corporation
Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com> Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
...@@ -29,6 +31,7 @@ drivers for the USB based UWB radio controllers defined in the ...@@ -29,6 +31,7 @@ drivers for the USB based UWB radio controllers defined in the
Wireless USB 1.0 specification (including Wireless USB host controller Wireless USB 1.0 specification (including Wireless USB host controller
and an Intel WiNET controller). and an Intel WiNET controller).
.. Contents
1. Introduction 1. Introduction
1. HWA: Host Wire adapters, your Wireless USB dongle 1. HWA: Host Wire adapters, your Wireless USB dongle
...@@ -51,7 +54,8 @@ and an Intel WiNET controller). ...@@ -51,7 +54,8 @@ and an Intel WiNET controller).
4. Glossary 4. Glossary
Introduction Introduction
============
UWB is a wide-band communication protocol that is to serve also as the UWB is a wide-band communication protocol that is to serve also as the
low-level protocol for others (much like TCP sits on IP). Currently low-level protocol for others (much like TCP sits on IP). Currently
...@@ -93,7 +97,8 @@ The different logical parts of this driver are: ...@@ -93,7 +97,8 @@ The different logical parts of this driver are:
do the actual WUSB. do the actual WUSB.
HWA: Host Wire adapters, your Wireless USB dongle HWA: Host Wire adapters, your Wireless USB dongle
-------------------------------------------------
WUSB also defines a device called a Host Wire Adaptor (HWA), which in WUSB also defines a device called a Host Wire Adaptor (HWA), which in
mere terms is a USB dongle that enables your PC to have UWB and Wireless mere terms is a USB dongle that enables your PC to have UWB and Wireless
...@@ -125,7 +130,8 @@ The HWA itself is broken in two or three main interfaces: ...@@ -125,7 +130,8 @@ The HWA itself is broken in two or three main interfaces:
their type and kick into gear. their type and kick into gear.
DWA: Device Wired Adaptor, a Wireless USB hub for wired devices DWA: Device Wired Adaptor, a Wireless USB hub for wired devices
---------------------------------------------------------------
These are the complement to HWAs. They are a USB host for connecting These are the complement to HWAs. They are a USB host for connecting
wired devices, but it is connected to your PC connected via Wireless wired devices, but it is connected to your PC connected via Wireless
...@@ -137,7 +143,8 @@ code with the HWA-RC driver; there is a bunch of factorization work that ...@@ -137,7 +143,8 @@ code with the HWA-RC driver; there is a bunch of factorization work that
has been done to support that in upcoming releases. has been done to support that in upcoming releases.
WHCI: Wireless Host Controller Interface, the PCI WUSB host adapter WHCI: Wireless Host Controller Interface, the PCI WUSB host adapter
-------------------------------------------------------------------
This is your usual PCI device that implements WHCI. Similar in concept This is your usual PCI device that implements WHCI. Similar in concept
to EHCI, it allows your wireless USB devices (including DWAs) to connect to EHCI, it allows your wireless USB devices (including DWAs) to connect
...@@ -148,7 +155,8 @@ There is still no driver support for this, but will be in upcoming ...@@ -148,7 +155,8 @@ There is still no driver support for this, but will be in upcoming
releases. releases.
The UWB stack The UWB stack
=============
The main mission of the UWB stack is to keep a tally of which devices The main mission of the UWB stack is to keep a tally of which devices
are in radio proximity to allow drivers to connect to them. As well, it are in radio proximity to allow drivers to connect to them. As well, it
...@@ -156,7 +164,8 @@ provides an API for controlling the local radio controllers (RCs from ...@@ -156,7 +164,8 @@ provides an API for controlling the local radio controllers (RCs from
now on), such as to start/stop beaconing, scan, allocate bandwidth, etc. now on), such as to start/stop beaconing, scan, allocate bandwidth, etc.
Devices and hosts: the basic structure Devices and hosts: the basic structure
--------------------------------------
The main building block here is the UWB device (struct uwb_dev). For The main building block here is the UWB device (struct uwb_dev). For
each device that pops up in radio presence (ie: the UWB host receives a each device that pops up in radio presence (ie: the UWB host receives a
...@@ -187,7 +196,8 @@ the USB connected HWA. Eventually, drivers/whci-rc.c will do the same ...@@ -187,7 +196,8 @@ the USB connected HWA. Eventually, drivers/whci-rc.c will do the same
for the PCI connected WHCI controller. for the PCI connected WHCI controller.
Host Controller life cycle Host Controller life cycle
--------------------------
So let's say we connect a dongle to the system: it is detected and So let's say we connect a dongle to the system: it is detected and
firmware uploaded if needed [for Intel's i1480 firmware uploaded if needed [for Intel's i1480
...@@ -209,7 +219,8 @@ When a dongle is disconnected, /drivers/uwb/hwa-rc.c:hwarc_disconnect()/ ...@@ -209,7 +219,8 @@ When a dongle is disconnected, /drivers/uwb/hwa-rc.c:hwarc_disconnect()/
takes time of tearing everything down safely (or not...). takes time of tearing everything down safely (or not...).
On the air: beacons and enumerating the radio neighborhood On the air: beacons and enumerating the radio neighborhood
----------------------------------------------------------
So assuming we have devices and we have agreed for a channel to connect So assuming we have devices and we have agreed for a channel to connect
on (let's say 9), we put the new RC to beacon: on (let's say 9), we put the new RC to beacon:
...@@ -235,12 +246,14 @@ are received in some time, the device is considered gone and wiped out ...@@ -235,12 +246,14 @@ are received in some time, the device is considered gone and wiped out
the beacon cache of dead devices]. the beacon cache of dead devices].
Device lists Device lists
------------
All UWB devices are kept in the list of the struct bus_type uwb_bus_type. All UWB devices are kept in the list of the struct bus_type uwb_bus_type.
Bandwidth allocation Bandwidth allocation
--------------------
The UWB stack maintains a local copy of DRP availability through The UWB stack maintains a local copy of DRP availability through
processing of incoming *DRP Availability Change* notifications. This processing of incoming *DRP Availability Change* notifications. This
...@@ -260,7 +273,8 @@ completion. [Note: The bandwidth reservation work is in progress and ...@@ -260,7 +273,8 @@ completion. [Note: The bandwidth reservation work is in progress and
subject to change.] subject to change.]
Wireless USB Host Controller drivers Wireless USB Host Controller drivers
====================================
*WARNING* This section needs a lot of work! *WARNING* This section needs a lot of work!
...@@ -296,7 +310,8 @@ starts sending MMCs. ...@@ -296,7 +310,8 @@ starts sending MMCs.
Now it all depends on external stimuli. Now it all depends on external stimuli.
*New device connection* New device connection
---------------------
A new device pops up, it scans the radio looking for MMCs that give out A new device pops up, it scans the radio looking for MMCs that give out
the existence of Wireless USB channels. Once one (or more) are found, the existence of Wireless USB channels. Once one (or more) are found,
...@@ -322,7 +337,8 @@ has seen the port status changes, as we have been toggling them. It will ...@@ -322,7 +337,8 @@ has seen the port status changes, as we have been toggling them. It will
start enumerating and doing transfers through usb_hcd->urb_enqueue() to start enumerating and doing transfers through usb_hcd->urb_enqueue() to
read descriptors and move our data. read descriptors and move our data.
*Device life cycle and keep alives* Device life cycle and keep alives
---------------------------------
Every time there is a successful transfer to/from a device, we update a Every time there is a successful transfer to/from a device, we update a
per-device activity timestamp. If not, every now and then we check and per-device activity timestamp. If not, every now and then we check and
...@@ -340,7 +356,8 @@ device list looking for whom needs refreshing. ...@@ -340,7 +356,8 @@ device list looking for whom needs refreshing.
If the device wants to disconnect, it will either die (ugly) or send a If the device wants to disconnect, it will either die (ugly) or send a
/DN_Disconnect/ that will prompt a disconnection from the system. /DN_Disconnect/ that will prompt a disconnection from the system.
*Sending and receiving data* Sending and receiving data
--------------------------
Data is sent and received through /Remote Pipes/ (rpipes). An rpipe is Data is sent and received through /Remote Pipes/ (rpipes). An rpipe is
/aimed/ at an endpoint in a WUSB device. This is the same for HWAs and /aimed/ at an endpoint in a WUSB device. This is the same for HWAs and
...@@ -394,7 +411,8 @@ finalize the transfer. ...@@ -394,7 +411,8 @@ finalize the transfer.
For IN xfers, we only issue URBs for the segments we want to read and For IN xfers, we only issue URBs for the segments we want to read and
then wait for the xfer result data. then wait for the xfer result data.
*URB mapping into xfers* URB mapping into xfers
^^^^^^^^^^^^^^^^^^^^^^
This is done by hwahc_op_urb_[en|de]queue(). In enqueue() we aim an This is done by hwahc_op_urb_[en|de]queue(). In enqueue() we aim an
rpipe to the endpoint where we have to transmit, create a transfer rpipe to the endpoint where we have to transmit, create a transfer
...@@ -407,7 +425,8 @@ and not yet done and when all that is done, the xfer callback will be ...@@ -407,7 +425,8 @@ and not yet done and when all that is done, the xfer callback will be
called--this will call the URB callback. called--this will call the URB callback.
Glossary Glossary
========
*DWA* -- Device Wire Adapter *DWA* -- Device Wire Adapter
...@@ -436,4 +455,3 @@ the host. ...@@ -436,4 +455,3 @@ the host.
Design-overview.txt-1.8 (last edited 2006-11-04 12:22:24 by Design-overview.txt-1.8 (last edited 2006-11-04 12:22:24 by
InakyPerezGonzalez) InakyPerezGonzalez)
Linux ACM driver v0.16 ======================
(c) 1999 Vojtech Pavlik <vojtech@suse.cz> Linux ACM driver v0.16
Sponsored by SuSE ======================
----------------------------------------------------------------------------
Copyright (c) 1999 Vojtech Pavlik <vojtech@suse.cz>
Sponsored by SuSE
0. Disclaimer 0. Disclaimer
~~~~~~~~~~~~~ ~~~~~~~~~~~~~
This program is free software; you can redistribute it and/or modify it This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) Software Foundation; either version 2 of the License, or (at your option)
any later version. any later version.
This program is distributed in the hope that it will be useful, but This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. more details.
You should have received a copy of the GNU General Public License along You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc., 59 with this program; if not, write to the Free Software Foundation, Inc., 59
Temple Place, Suite 330, Boston, MA 02111-1307 USA Temple Place, Suite 330, Boston, MA 02111-1307 USA
Should you need to contact me, the author, you can do so either by e-mail Should you need to contact me, the author, you can do so either by e-mail -
- mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik, mail your message to <vojtech@suse.cz>, or by paper mail: Vojtech Pavlik,
Ucitelska 1576, Prague 8, 182 00 Czech Republic Ucitelska 1576, Prague 8, 182 00 Czech Republic
For your convenience, the GNU General Public License version 2 is included For your convenience, the GNU General Public License version 2 is included
in the package: See the file COPYING. in the package: See the file COPYING.
1. Usage 1. Usage
~~~~~~~~ ~~~~~~~~
The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal The drivers/usb/class/cdc-acm.c drivers works with USB modems and USB ISDN terminal
adapters that conform to the Universal Serial Bus Communication Device Class adapters that conform to the Universal Serial Bus Communication Device Class
Abstract Control Model (USB CDC ACM) specification. Abstract Control Model (USB CDC ACM) specification.
Many modems do, here is a list of those I know of: Many modems do, here is a list of those I know of:
3Com OfficeConnect 56k - 3Com OfficeConnect 56k
3Com Voice FaxModem Pro - 3Com Voice FaxModem Pro
3Com Sportster - 3Com Sportster
MultiTech MultiModem 56k - MultiTech MultiModem 56k
Zoom 2986L FaxModem - Zoom 2986L FaxModem
Compaq 56k FaxModem - Compaq 56k FaxModem
ELSA Microlink 56k - ELSA Microlink 56k
I know of one ISDN TA that does work with the acm driver: I know of one ISDN TA that does work with the acm driver:
3Com USR ISDN Pro TA - 3Com USR ISDN Pro TA
Some cell phones also connect via USB. I know the following phones work: Some cell phones also connect via USB. I know the following phones work:
SonyEricsson K800i - SonyEricsson K800i
Unfortunately many modems and most ISDN TAs use proprietary interfaces and Unfortunately many modems and most ISDN TAs use proprietary interfaces and
thus won't work with this drivers. Check for ACM compliance before buying. thus won't work with this drivers. Check for ACM compliance before buying.
To use the modems you need these modules loaded: To use the modems you need these modules loaded::
usbcore.ko usbcore.ko
uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko uhci-hcd.ko ohci-hcd.ko or ehci-hcd.ko
cdc-acm.ko cdc-acm.ko
After that, the modem[s] should be accessible. You should be able to use After that, the modem[s] should be accessible. You should be able to use
minicom, ppp and mgetty with them. minicom, ppp and mgetty with them.
2. Verifying that it works 2. Verifying that it works
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
The first step would be to check /sys/kernel/debug/usb/devices, it should look
like this: The first step would be to check /sys/kernel/debug/usb/devices, it should look
like this::
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0 T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1 B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
P: Vendor=0000 ProdID=0000 Rev= 0.00 D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
S: Product=USB UHCI Root Hub P: Vendor=0000 ProdID=0000 Rev= 0.00
S: SerialNumber=6800 S: Product=USB UHCI Root Hub
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA S: SerialNumber=6800
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2 T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 2 Spd=12 MxCh= 0
P: Vendor=04c1 ProdID=008f Rev= 2.07 D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2
S: Manufacturer=3Com Inc. P: Vendor=04c1 ProdID=008f Rev= 2.07
S: Product=3Com U.S. Robotics Pro ISDN TA S: Manufacturer=3Com Inc.
S: SerialNumber=UFT53A49BVT7 S: Product=3Com U.S. Robotics Pro ISDN TA
C: #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 0mA S: SerialNumber=UFT53A49BVT7
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=acm C: #Ifs= 1 Cfg#= 1 Atr=60 MxPwr= 0mA
E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=acm
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
C:* #Ifs= 2 Cfg#= 2 Atr=60 MxPwr= 0mA E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm C:* #Ifs= 2 Cfg#= 2 Atr=60 MxPwr= 0mA
E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms E: Ad=85(I) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
E: Ad=04(O) Atr=02(Bulk) MxPS= 64 Ivl= 0ms
The presence of these three lines (and the Cls= 'comm' and 'data' classes) The presence of these three lines (and the Cls= 'comm' and 'data' classes)
is important, it means it's an ACM device. The Driver=acm means the acm is important, it means it's an ACM device. The Driver=acm means the acm
driver is used for the device. If you see only Cls=ff(vend.) then you're out driver is used for the device. If you see only Cls=ff(vend.) then you're out
of luck, you have a device with vendor specific-interface. of luck, you have a device with vendor specific-interface::
D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2 D: Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs= 2
I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
In the system log you should see: In the system log you should see::
usb.c: USB new device connect, assigned device number 2 usb.c: USB new device connect, assigned device number 2
usb.c: kmalloc IF c7691fa0, numif 1 usb.c: kmalloc IF c7691fa0, numif 1
usb.c: kmalloc IF c7b5f3e0, numif 2 usb.c: kmalloc IF c7b5f3e0, numif 2
usb.c: skipped 4 class/vendor specific interface descriptors usb.c: skipped 4 class/vendor specific interface descriptors
usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3 usb.c: new device strings: Mfr=1, Product=2, SerialNumber=3
usb.c: USB device number 2 default language ID 0x409 usb.c: USB device number 2 default language ID 0x409
Manufacturer: 3Com Inc. Manufacturer: 3Com Inc.
Product: 3Com U.S. Robotics Pro ISDN TA Product: 3Com U.S. Robotics Pro ISDN TA
SerialNumber: UFT53A49BVT7 SerialNumber: UFT53A49BVT7
acm.c: probing config 1 acm.c: probing config 1
acm.c: probing config 2 acm.c: probing config 2
ttyACM0: USB ACM device ttyACM0: USB ACM device
acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x0 result: 0 acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x0 result: 0
acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x7 result: 7 acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x7 result: 7
usb.c: acm driver claimed interface c7b5f3e0 usb.c: acm driver claimed interface c7b5f3e0
usb.c: acm driver claimed interface c7b5f3f8 usb.c: acm driver claimed interface c7b5f3f8
usb.c: acm driver claimed interface c7691fa0 usb.c: acm driver claimed interface c7691fa0
If all this seems to be OK, fire up minicom and set it to talk to the ttyACM If all this seems to be OK, fire up minicom and set it to talk to the ttyACM
device and try typing 'at'. If it responds with 'OK', then everything is device and try typing 'at'. If it responds with 'OK', then everything is
......
==============================================================
Authorizing (or not) your USB devices to connect to the system Authorizing (or not) your USB devices to connect to the system
==============================================================
(C) 2007 Inaky Perez-Gonzalez <inaky@linux.intel.com> Intel Corporation Copyright (C) 2007 Inaky Perez-Gonzalez <inaky@linux.intel.com> Intel Corporation
This feature allows you to control if a USB device can be used (or This feature allows you to control if a USB device can be used (or
not) in a system. This feature will allow you to implement a lock-down not) in a system. This feature will allow you to implement a lock-down
...@@ -12,24 +13,25 @@ its interfaces are immediately made available to the users. With this ...@@ -12,24 +13,25 @@ its interfaces are immediately made available to the users. With this
modification, only if root authorizes the device to be configured will modification, only if root authorizes the device to be configured will
then it be possible to use it. then it be possible to use it.
Usage: Usage
=====
Authorize a device to connect: Authorize a device to connect::
$ echo 1 > /sys/bus/usb/devices/DEVICE/authorized $ echo 1 > /sys/bus/usb/devices/DEVICE/authorized
Deauthorize a device: De-authorize a device::
$ echo 0 > /sys/bus/usb/devices/DEVICE/authorized $ echo 0 > /sys/bus/usb/devices/DEVICE/authorized
Set new devices connected to hostX to be deauthorized by default (ie: Set new devices connected to hostX to be deauthorized by default (ie:
lock down): lock down)::
$ echo 0 > /sys/bus/usb/devices/usbX/authorized_default $ echo 0 > /sys/bus/usb/devices/usbX/authorized_default
Remove the lock down: Remove the lock down::
$ echo 1 > /sys/bus/usb/devices/usbX/authorized_default $ echo 1 > /sys/bus/usb/devices/usbX/authorized_default
By default, Wired USB devices are authorized by default to By default, Wired USB devices are authorized by default to
connect. Wireless USB hosts deauthorize by default all new connected connect. Wireless USB hosts deauthorize by default all new connected
...@@ -40,21 +42,21 @@ USB ports. ...@@ -40,21 +42,21 @@ USB ports.
Example system lockdown (lame) Example system lockdown (lame)
----------------------- ------------------------------
Imagine you want to implement a lockdown so only devices of type XYZ Imagine you want to implement a lockdown so only devices of type XYZ
can be connected (for example, it is a kiosk machine with a visible can be connected (for example, it is a kiosk machine with a visible
USB port): USB port)::
boot up boot up
rc.local -> rc.local ->
for host in /sys/bus/usb/devices/usb* for host in /sys/bus/usb/devices/usb*
do do
echo 0 > $host/authorized_default echo 0 > $host/authorized_default
done done
Hookup an script to udev, for new USB devices Hookup an script to udev, for new USB devices::
if device_is_my_type $DEV if device_is_my_type $DEV
then then
...@@ -67,10 +69,10 @@ checking if the class, type and protocol match something is the worse ...@@ -67,10 +69,10 @@ checking if the class, type and protocol match something is the worse
security verification you can make (or the best, for someone willing security verification you can make (or the best, for someone willing
to break it). If you need something secure, use crypto and Certificate to break it). If you need something secure, use crypto and Certificate
Authentication or stuff like that. Something simple for an storage key Authentication or stuff like that. Something simple for an storage key
could be: could be::
function device_is_my_type() function device_is_my_type()
{ {
echo 1 > authorized # temporarily authorize it echo 1 > authorized # temporarily authorize it
# FIXME: make sure none can mount it # FIXME: make sure none can mount it
mount DEVICENODE /mntpoint mount DEVICENODE /mntpoint
...@@ -83,7 +85,7 @@ function device_is_my_type() ...@@ -83,7 +85,7 @@ function device_is_my_type()
else else
echo 0 > authorized echo 0 > authorized
fi fi
} }
Of course, this is lame, you'd want to do a real certificate Of course, this is lame, you'd want to do a real certificate
...@@ -95,30 +97,35 @@ welcome. ...@@ -95,30 +97,35 @@ welcome.
Interface authorization Interface authorization
----------------------- -----------------------
There is a similar approach to allow or deny specific USB interfaces. There is a similar approach to allow or deny specific USB interfaces.
That allows to block only a subset of an USB device. That allows to block only a subset of an USB device.
Authorize an interface: Authorize an interface::
$ echo 1 > /sys/bus/usb/devices/INTERFACE/authorized
Deauthorize an interface: $ echo 1 > /sys/bus/usb/devices/INTERFACE/authorized
$ echo 0 > /sys/bus/usb/devices/INTERFACE/authorized
Deauthorize an interface::
$ echo 0 > /sys/bus/usb/devices/INTERFACE/authorized
The default value for new interfaces The default value for new interfaces
on a particular USB bus can be changed, too. on a particular USB bus can be changed, too.
Allow interfaces per default: Allow interfaces per default::
$ echo 1 > /sys/bus/usb/devices/usbX/interface_authorized_default
$ echo 1 > /sys/bus/usb/devices/usbX/interface_authorized_default
Deny interfaces per default::
Deny interfaces per default: $ echo 0 > /sys/bus/usb/devices/usbX/interface_authorized_default
$ echo 0 > /sys/bus/usb/devices/usbX/interface_authorized_default
Per default the interface_authorized_default bit is 1. Per default the interface_authorized_default bit is 1.
So all interfaces would authorized per default. So all interfaces would authorized per default.
Note: Note:
If a deauthorized interface will be authorized so the driver probing must If a deauthorized interface will be authorized so the driver probing must
be triggered manually by writing INTERFACE to /sys/bus/usb/drivers_probe be triggered manually by writing INTERFACE to /sys/bus/usb/drivers_probe
For drivers that need multiple interfaces all needed interfaces should be For drivers that need multiple interfaces all needed interfaces should be
authorized first. After that the drivers should be probed. authorized first. After that the drivers should be probed.
......
==============================================
ChipIdea Highspeed Dual Role Controller Driver
==============================================
1. How to test OTG FSM(HNP and SRP) 1. How to test OTG FSM(HNP and SRP)
----------------------------------- -----------------------------------
To show how to demo OTG HNP and SRP functions via sys input files To show how to demo OTG HNP and SRP functions via sys input files
with 2 Freescale i.MX6Q sabre SD boards. with 2 Freescale i.MX6Q sabre SD boards.
1.1 How to enable OTG FSM 1.1 How to enable OTG FSM
--------------------------------------- -------------------------
1.1.1 Select CONFIG_USB_OTG_FSM in menuconfig, rebuild kernel 1.1.1 Select CONFIG_USB_OTG_FSM in menuconfig, rebuild kernel
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Image and modules. If you want to check some internal Image and modules. If you want to check some internal
variables for otg fsm, mount debugfs, there are 2 files variables for otg fsm, mount debugfs, there are 2 files
which can show otg fsm variables and some controller registers value: which can show otg fsm variables and some controller registers value::
cat /sys/kernel/debug/ci_hdrc.0/otg
cat /sys/kernel/debug/ci_hdrc.0/registers cat /sys/kernel/debug/ci_hdrc.0/otg
cat /sys/kernel/debug/ci_hdrc.0/registers
1.1.2 Add below entries in your dts file for your controller node 1.1.2 Add below entries in your dts file for your controller node
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
otg-rev = <0x0200>; otg-rev = <0x0200>;
adp-disable; adp-disable;
1.2 Test operations 1.2 Test operations
------------------- -------------------
1) Power up 2 Freescale i.MX6Q sabre SD boards with gadget class driver loaded 1) Power up 2 Freescale i.MX6Q sabre SD boards with gadget class driver loaded
(e.g. g_mass_storage). (e.g. g_mass_storage).
...@@ -26,19 +41,24 @@ cat /sys/kernel/debug/ci_hdrc.0/registers ...@@ -26,19 +41,24 @@ cat /sys/kernel/debug/ci_hdrc.0/registers
The A-device(with micro A plug inserted) should enumerate B-device. The A-device(with micro A plug inserted) should enumerate B-device.
3) Role switch 3) Role switch
On B-device:
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req On B-device::
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
B-device should take host role and enumerate A-device. B-device should take host role and enumerate A-device.
4) A-device switch back to host. 4) A-device switch back to host.
On B-device:
echo 0 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req On B-device::
echo 0 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
or, by introducing HNP polling, B-Host can know when A-peripheral wish or, by introducing HNP polling, B-Host can know when A-peripheral wish
to be host role, so this role switch also can be trigged in A-peripheral to be host role, so this role switch also can be trigged in A-peripheral
side by answering the polling from B-Host, this can be done on A-device: side by answering the polling from B-Host, this can be done on A-device::
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
A-device should switch back to host and enumerate B-device. A-device should switch back to host and enumerate B-device.
...@@ -49,23 +69,31 @@ cat /sys/kernel/debug/ci_hdrc.0/registers ...@@ -49,23 +69,31 @@ cat /sys/kernel/debug/ci_hdrc.0/registers
A-device should NOT enumerate B-device. A-device should NOT enumerate B-device.
if A-device wants to use bus: if A-device wants to use bus:
On A-device:
echo 0 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop On A-device::
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
echo 0 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_req
if B-device wants to use bus: if B-device wants to use bus:
On B-device:
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req On B-device::
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
7) A-device power down the bus. 7) A-device power down the bus.
On A-device:
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop On A-device::
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/a_bus_drop
A-device should disconnect with B-device and power down the bus. A-device should disconnect with B-device and power down the bus.
8) B-device does data pulse for SRP. 8) B-device does data pulse for SRP.
On B-device:
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req On B-device::
echo 1 > /sys/bus/platform/devices/ci_hdrc.0/inputs/b_bus_req
A-device should resume usb bus and enumerate B-device. A-device should resume usb bus and enumerate B-device.
...@@ -75,22 +103,31 @@ cat /sys/kernel/debug/ci_hdrc.0/registers ...@@ -75,22 +103,31 @@ cat /sys/kernel/debug/ci_hdrc.0/registers
July 27, 2012 Revision 2.0 version 1.1a" July 27, 2012 Revision 2.0 version 1.1a"
2. How to enable USB as system wakeup source 2. How to enable USB as system wakeup source
----------------------------------- --------------------------------------------
Below is the example for how to enable USB as system wakeup source Below is the example for how to enable USB as system wakeup source
at imx6 platform. at imx6 platform.
2.1 Enable core's wakeup 2.1 Enable core's wakeup::
echo enabled > /sys/bus/platform/devices/ci_hdrc.0/power/wakeup
2.2 Enable glue layer's wakeup echo enabled > /sys/bus/platform/devices/ci_hdrc.0/power/wakeup
echo enabled > /sys/bus/platform/devices/2184000.usb/power/wakeup
2.3 Enable PHY's wakeup (optional) 2.2 Enable glue layer's wakeup::
echo enabled > /sys/bus/platform/devices/20c9000.usbphy/power/wakeup
2.4 Enable roothub's wakeup echo enabled > /sys/bus/platform/devices/2184000.usb/power/wakeup
echo enabled > /sys/bus/usb/devices/usb1/power/wakeup
2.5 Enable related device's wakeup 2.3 Enable PHY's wakeup (optional)::
echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
echo enabled > /sys/bus/platform/devices/20c9000.usbphy/power/wakeup
2.4 Enable roothub's wakeup::
echo enabled > /sys/bus/usb/devices/usb1/power/wakeup
2.5 Enable related device's wakeup::
echo enabled > /sys/bus/usb/devices/1-1/power/wakeup
If the system has only one usb port, and you want usb wakeup at this port, you If the system has only one usb port, and you want usb wakeup at this port, you
can use below script to enable usb wakeup. can use below script to enable usb wakeup::
for i in $(find /sys -name wakeup | grep usb);do echo enabled > $i;done;
for i in $(find /sys -name wakeup | grep usb);do echo enabled > $i;done;
===========
DWC3 driver
===========
TODO
~~~~
TODO
~~~~~~
Please pick something while reading :) Please pick something while reading :)
- Convert interrupt handler to per-ep-thread-irq - Convert interrupt handler to per-ep-thread-irq
...@@ -9,6 +14,7 @@ Please pick something while reading :) ...@@ -9,6 +14,7 @@ Please pick something while reading :)
until the command completes which is bad. until the command completes which is bad.
Implementation idea: Implementation idea:
- dwc core implements a demultiplexing irq chip for interrupts per - dwc core implements a demultiplexing irq chip for interrupts per
endpoint. The interrupt numbers are allocated during probe and belong endpoint. The interrupt numbers are allocated during probe and belong
to the device. If MSI provides per-endpoint interrupt this dummy to the device. If MSI provides per-endpoint interrupt this dummy
...@@ -19,6 +25,7 @@ Please pick something while reading :) ...@@ -19,6 +25,7 @@ Please pick something while reading :)
- dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout() - dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout()
until the command completes. until the command completes.
- the interrupt handler is split into the following pieces: - the interrupt handler is split into the following pieces:
- primary handler of the device - primary handler of the device
goes through every event and calls generic_handle_irq() for event goes through every event and calls generic_handle_irq() for event
it. On return from generic_handle_irq() in acknowledges the event it. On return from generic_handle_irq() in acknowledges the event
...@@ -40,6 +47,7 @@ Please pick something while reading :) ...@@ -40,6 +47,7 @@ Please pick something while reading :)
for command completion. for command completion.
Latency: Latency:
There should be no increase in latency since the interrupt-thread has a There should be no increase in latency since the interrupt-thread has a
high priority and will be run before an average task in user land high priority and will be run before an average task in user land
(except the user changed priorities). (except the user changed priorities).
===========
EHCI driver
===========
27-Dec-2002 27-Dec-2002
The EHCI driver is used to talk to high speed USB 2.0 devices using The EHCI driver is used to talk to high speed USB 2.0 devices using
...@@ -40,7 +44,8 @@ APIs exposed to USB device drivers. ...@@ -40,7 +44,8 @@ APIs exposed to USB device drivers.
<dbrownell@users.sourceforge.net> <dbrownell@users.sourceforge.net>
FUNCTIONALITY Functionality
=============
This driver is regularly tested on x86 hardware, and has also been This driver is regularly tested on x86 hardware, and has also been
used on PPC hardware so big/little endianness issues should be gone. used on PPC hardware so big/little endianness issues should be gone.
...@@ -48,6 +53,7 @@ It's believed to do all the right PCI magic so that I/O works even on ...@@ -48,6 +53,7 @@ It's believed to do all the right PCI magic so that I/O works even on
systems with interesting DMA mapping issues. systems with interesting DMA mapping issues.
Transfer Types Transfer Types
--------------
At this writing the driver should comfortably handle all control, bulk, At this writing the driver should comfortably handle all control, bulk,
and interrupt transfers, including requests to USB 1.1 devices through and interrupt transfers, including requests to USB 1.1 devices through
...@@ -63,6 +69,7 @@ since EHCI represents these with a different data structure. So for now, ...@@ -63,6 +69,7 @@ since EHCI represents these with a different data structure. So for now,
most USB audio and video devices can't be connected to high speed buses. most USB audio and video devices can't be connected to high speed buses.
Driver Behavior Driver Behavior
---------------
Transfers of all types can be queued. This means that control transfers Transfers of all types can be queued. This means that control transfers
from a driver on one interface (or through usbfs) won't interfere with from a driver on one interface (or through usbfs) won't interfere with
...@@ -83,14 +90,15 @@ limits on the number of periodic transactions that can be scheduled, ...@@ -83,14 +90,15 @@ limits on the number of periodic transactions that can be scheduled,
and prevent use of polling intervals of less than one frame. and prevent use of polling intervals of less than one frame.
USE BY Use by
======
Assuming you have an EHCI controller (on a PCI card or motherboard) Assuming you have an EHCI controller (on a PCI card or motherboard)
and have compiled this driver as a module, load this like: and have compiled this driver as a module, load this like::
# modprobe ehci-hcd # modprobe ehci-hcd
and remove it by: and remove it by::
# rmmod ehci-hcd # rmmod ehci-hcd
...@@ -112,13 +120,16 @@ If you're using this driver on a 2.5 kernel, and you've enabled USB ...@@ -112,13 +120,16 @@ If you're using this driver on a 2.5 kernel, and you've enabled USB
debugging support, you'll see three files in the "sysfs" directory for debugging support, you'll see three files in the "sysfs" directory for
any EHCI controller: any EHCI controller:
"async" dumps the asynchronous schedule, used for control "async"
dumps the asynchronous schedule, used for control
and bulk transfers. Shows each active qh and the qtds and bulk transfers. Shows each active qh and the qtds
pending, usually one qtd per urb. (Look at it with pending, usually one qtd per urb. (Look at it with
usb-storage doing disk I/O; watch the request queues!) usb-storage doing disk I/O; watch the request queues!)
"periodic" dumps the periodic schedule, used for interrupt "periodic"
dumps the periodic schedule, used for interrupt
and isochronous transfers. Doesn't show qtds. and isochronous transfers. Doesn't show qtds.
"registers" show controller register state, and "registers"
show controller register state, and
The contents of those files can help identify driver problems. The contents of those files can help identify driver problems.
...@@ -136,7 +147,8 @@ transaction translators are in use; some drivers have been seen to behave ...@@ -136,7 +147,8 @@ transaction translators are in use; some drivers have been seen to behave
badly when they see different faults than OHCI or UHCI report. badly when they see different faults than OHCI or UHCI report.
PERFORMANCE Performance
===========
USB 2.0 throughput is gated by two main factors: how fast the host USB 2.0 throughput is gated by two main factors: how fast the host
controller can process requests, and how fast devices can respond to controller can process requests, and how fast devices can respond to
...@@ -156,6 +168,7 @@ hardware and device driver software allow it. Periodic transfer modes ...@@ -156,6 +168,7 @@ hardware and device driver software allow it. Periodic transfer modes
approach the quoted 480 MBit/sec transfer rate. approach the quoted 480 MBit/sec transfer rate.
Hardware Performance Hardware Performance
--------------------
At this writing, individual USB 2.0 devices tend to max out at around At this writing, individual USB 2.0 devices tend to max out at around
20 MByte/sec transfer rates. This is of course subject to change; 20 MByte/sec transfer rates. This is of course subject to change;
...@@ -183,6 +196,7 @@ you issue a control or bulk request you can often expect to learn that ...@@ -183,6 +196,7 @@ you issue a control or bulk request you can often expect to learn that
it completed in less than 250 usec (depending on transfer size). it completed in less than 250 usec (depending on transfer size).
Software Performance Software Performance
--------------------
To get even 20 MByte/sec transfer rates, Linux-USB device drivers will To get even 20 MByte/sec transfer rates, Linux-USB device drivers will
need to keep the EHCI queue full. That means issuing large requests, need to keep the EHCI queue full. That means issuing large requests,
...@@ -206,9 +220,11 @@ mapping (which might apply an IOMMU) and IRQ reduction, all of which will ...@@ -206,9 +220,11 @@ mapping (which might apply an IOMMU) and IRQ reduction, all of which will
help make high speed transfers run as fast as they can. help make high speed transfers run as fast as they can.
TBD: Interrupt and ISO transfer performance issues. Those periodic TBD:
transfers are fully scheduled, so the main issue is likely to be how Interrupt and ISO transfer performance issues. Those periodic
to trigger "high bandwidth" modes. transfers are fully scheduled, so the main issue is likely to be how
to trigger "high bandwidth" modes.
TBD: More than standard 80% periodic bandwidth allocation is possible TBD:
through sysfs uframe_periodic_max parameter. Describe that. More than standard 80% periodic bandwidth allocation is possible
through sysfs uframe_periodic_max parameter. Describe that.
*How FunctionFS works* ====================
How FunctionFS works
====================
From kernel point of view it is just a composite function with some From kernel point of view it is just a composite function with some
unique behaviour. It may be added to an USB configuration only after unique behaviour. It may be added to an USB configuration only after
...@@ -38,13 +40,13 @@ when mounting. ...@@ -38,13 +40,13 @@ when mounting.
One can imagine a gadget that has an Ethernet, MTP and HID interfaces One can imagine a gadget that has an Ethernet, MTP and HID interfaces
where the last two are implemented via FunctionFS. On user space where the last two are implemented via FunctionFS. On user space
level it would look like this: level it would look like this::
$ insmod g_ffs.ko idVendor=<ID> iSerialNumber=<string> functions=mtp,hid $ insmod g_ffs.ko idVendor=<ID> iSerialNumber=<string> functions=mtp,hid
$ mkdir /dev/ffs-mtp && mount -t functionfs mtp /dev/ffs-mtp $ mkdir /dev/ffs-mtp && mount -t functionfs mtp /dev/ffs-mtp
$ ( cd /dev/ffs-mtp && mtp-daemon ) & $ ( cd /dev/ffs-mtp && mtp-daemon ) &
$ mkdir /dev/ffs-hid && mount -t functionfs hid /dev/ffs-hid $ mkdir /dev/ffs-hid && mount -t functionfs hid /dev/ffs-hid
$ ( cd /dev/ffs-hid && hid-daemon ) & $ ( cd /dev/ffs-hid && hid-daemon ) &
On kernel level the gadget checks ffs_data->dev_name to identify On kernel level the gadget checks ffs_data->dev_name to identify
whether it's FunctionFS designed for MTP ("mtp") or HID ("hid"). whether it's FunctionFS designed for MTP ("mtp") or HID ("hid").
...@@ -64,4 +66,3 @@ have been written to their ep0's. ...@@ -64,4 +66,3 @@ have been written to their ep0's.
Conversely, the gadget is unregistered after the first USB function Conversely, the gadget is unregistered after the first USB function
closes its endpoints. closes its endpoints.
This diff is collapsed.
This diff is collapsed.
===========================
Linux USB HID gadget driver Linux USB HID gadget driver
===========================
Introduction Introduction
============
The HID Gadget driver provides emulation of USB Human Interface The HID Gadget driver provides emulation of USB Human Interface
Devices (HID). The basic HID handling is done in the kernel, Devices (HID). The basic HID handling is done in the kernel,
and HID reports can be sent/received through I/O on the and HID reports can be sent/received through I/O on the
/dev/hidgX character devices. /dev/hidgX character devices.
For more details about HID, see the developer page on For more details about HID, see the developer page on
http://www.usb.org/developers/hidpage/ http://www.usb.org/developers/hidpage/
Configuration Configuration
=============
g_hid is a platform driver, so to use it you need to add g_hid is a platform driver, so to use it you need to add
struct platform_device(s) to your platform code defining the struct platform_device(s) to your platform code defining the
HID function descriptors you want to use - E.G. something HID function descriptors you want to use - E.G. something
like: like::
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/usb/g_hid.h> #include <linux/usb/g_hid.h>
/* hid descriptor for a keyboard */ /* hid descriptor for a keyboard */
static struct hidg_func_descriptor my_hid_data = { static struct hidg_func_descriptor my_hid_data = {
.subclass = 0, /* No subclass */ .subclass = 0, /* No subclass */
.protocol = 1, /* Keyboard */ .protocol = 1, /* Keyboard */
.report_length = 8, .report_length = 8,
...@@ -61,85 +64,87 @@ static struct hidg_func_descriptor my_hid_data = { ...@@ -61,85 +64,87 @@ static struct hidg_func_descriptor my_hid_data = {
0x81, 0x00, /* INPUT (Data,Ary,Abs) */ 0x81, 0x00, /* INPUT (Data,Ary,Abs) */
0xc0 /* END_COLLECTION */ 0xc0 /* END_COLLECTION */
} }
}; };
static struct platform_device my_hid = { static struct platform_device my_hid = {
.name = "hidg", .name = "hidg",
.id = 0, .id = 0,
.num_resources = 0, .num_resources = 0,
.resource = 0, .resource = 0,
.dev.platform_data = &my_hid_data, .dev.platform_data = &my_hid_data,
}; };
You can add as many HID functions as you want, only limited by You can add as many HID functions as you want, only limited by
the amount of interrupt endpoints your gadget driver supports. the amount of interrupt endpoints your gadget driver supports.
Configuration with configfs Configuration with configfs
===========================
Instead of adding fake platform devices and drivers in order to pass Instead of adding fake platform devices and drivers in order to pass
some data to the kernel, if HID is a part of a gadget composed with some data to the kernel, if HID is a part of a gadget composed with
configfs the hidg_func_descriptor.report_desc is passed to the kernel configfs the hidg_func_descriptor.report_desc is passed to the kernel
by writing the appropriate stream of bytes to a configfs attribute. by writing the appropriate stream of bytes to a configfs attribute.
Send and receive HID reports Send and receive HID reports
============================
HID reports can be sent/received using read/write on the HID reports can be sent/received using read/write on the
/dev/hidgX character devices. See below for an example program /dev/hidgX character devices. See below for an example program
to do this. to do this.
hid_gadget_test is a small interactive program to test the HID hid_gadget_test is a small interactive program to test the HID
gadget driver. To use, point it at a hidg device and set the gadget driver. To use, point it at a hidg device and set the
device type (keyboard / mouse / joystick) - E.G.: device type (keyboard / mouse / joystick) - E.G.::
# hid_gadget_test /dev/hidg0 keyboard # hid_gadget_test /dev/hidg0 keyboard
You are now in the prompt of hid_gadget_test. You can type any You are now in the prompt of hid_gadget_test. You can type any
combination of options and values. Available options and combination of options and values. Available options and
values are listed at program start. In keyboard mode you can values are listed at program start. In keyboard mode you can
send up to six values. send up to six values.
For example type: g i s t r --left-shift For example type: g i s t r --left-shift
Hit return and the corresponding report will be sent by the Hit return and the corresponding report will be sent by the
HID gadget. HID gadget.
Another interesting example is the caps lock test. Type Another interesting example is the caps lock test. Type
--caps-lock and hit return. A report is then sent by the --caps-lock and hit return. A report is then sent by the
gadget and you should receive the host answer, corresponding gadget and you should receive the host answer, corresponding
to the caps lock LED status. to the caps lock LED status::
--caps-lock --caps-lock
recv report:2 recv report:2
With this command: With this command::
# hid_gadget_test /dev/hidg1 mouse # hid_gadget_test /dev/hidg1 mouse
You can test the mouse emulation. Values are two signed numbers. You can test the mouse emulation. Values are two signed numbers.
Sample code Sample code::
/* hid_gadget_test */ /* hid_gadget_test */
#include <pthread.h> #include <pthread.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#define BUF_LEN 512 #define BUF_LEN 512
struct options { struct options {
const char *opt; const char *opt;
unsigned char val; unsigned char val;
}; };
static struct options kmod[] = { static struct options kmod[] = {
{.opt = "--left-ctrl", .val = 0x01}, {.opt = "--left-ctrl", .val = 0x01},
{.opt = "--right-ctrl", .val = 0x10}, {.opt = "--right-ctrl", .val = 0x10},
{.opt = "--left-shift", .val = 0x02}, {.opt = "--left-shift", .val = 0x02},
...@@ -149,9 +154,9 @@ static struct options kmod[] = { ...@@ -149,9 +154,9 @@ static struct options kmod[] = {
{.opt = "--left-meta", .val = 0x08}, {.opt = "--left-meta", .val = 0x08},
{.opt = "--right-meta", .val = 0x80}, {.opt = "--right-meta", .val = 0x80},
{.opt = NULL} {.opt = NULL}
}; };
static struct options kval[] = { static struct options kval[] = {
{.opt = "--return", .val = 0x28}, {.opt = "--return", .val = 0x28},
{.opt = "--esc", .val = 0x29}, {.opt = "--esc", .val = 0x29},
{.opt = "--bckspc", .val = 0x2a}, {.opt = "--bckspc", .val = 0x2a},
...@@ -183,10 +188,10 @@ static struct options kval[] = { ...@@ -183,10 +188,10 @@ static struct options kval[] = {
{.opt = "--up", .val = 0x52}, {.opt = "--up", .val = 0x52},
{.opt = "--num-lock", .val = 0x53}, {.opt = "--num-lock", .val = 0x53},
{.opt = NULL} {.opt = NULL}
}; };
int keyboard_fill_report(char report[8], char buf[BUF_LEN], int *hold) int keyboard_fill_report(char report[8], char buf[BUF_LEN], int *hold)
{ {
char *tok = strtok(buf, " "); char *tok = strtok(buf, " ");
int key = 0; int key = 0;
int i = 0; int i = 0;
...@@ -229,17 +234,17 @@ int keyboard_fill_report(char report[8], char buf[BUF_LEN], int *hold) ...@@ -229,17 +234,17 @@ int keyboard_fill_report(char report[8], char buf[BUF_LEN], int *hold)
fprintf(stderr, "unknown option: %s\n", tok); fprintf(stderr, "unknown option: %s\n", tok);
} }
return 8; return 8;
} }
static struct options mmod[] = { static struct options mmod[] = {
{.opt = "--b1", .val = 0x01}, {.opt = "--b1", .val = 0x01},
{.opt = "--b2", .val = 0x02}, {.opt = "--b2", .val = 0x02},
{.opt = "--b3", .val = 0x04}, {.opt = "--b3", .val = 0x04},
{.opt = NULL} {.opt = NULL}
}; };
int mouse_fill_report(char report[8], char buf[BUF_LEN], int *hold) int mouse_fill_report(char report[8], char buf[BUF_LEN], int *hold)
{ {
char *tok = strtok(buf, " "); char *tok = strtok(buf, " ");
int mvt = 0; int mvt = 0;
int i = 0; int i = 0;
...@@ -274,9 +279,9 @@ int mouse_fill_report(char report[8], char buf[BUF_LEN], int *hold) ...@@ -274,9 +279,9 @@ int mouse_fill_report(char report[8], char buf[BUF_LEN], int *hold)
fprintf(stderr, "unknown option: %s\n", tok); fprintf(stderr, "unknown option: %s\n", tok);
} }
return 3; return 3;
} }
static struct options jmod[] = { static struct options jmod[] = {
{.opt = "--b1", .val = 0x10}, {.opt = "--b1", .val = 0x10},
{.opt = "--b2", .val = 0x20}, {.opt = "--b2", .val = 0x20},
{.opt = "--b3", .val = 0x40}, {.opt = "--b3", .val = 0x40},
...@@ -287,10 +292,10 @@ static struct options jmod[] = { ...@@ -287,10 +292,10 @@ static struct options jmod[] = {
{.opt = "--hat4", .val = 0x03}, {.opt = "--hat4", .val = 0x03},
{.opt = "--hatneutral", .val = 0x04}, {.opt = "--hatneutral", .val = 0x04},
{.opt = NULL} {.opt = NULL}
}; };
int joystick_fill_report(char report[8], char buf[BUF_LEN], int *hold) int joystick_fill_report(char report[8], char buf[BUF_LEN], int *hold)
{ {
char *tok = strtok(buf, " "); char *tok = strtok(buf, " ");
int mvt = 0; int mvt = 0;
int i = 0; int i = 0;
...@@ -326,10 +331,10 @@ int joystick_fill_report(char report[8], char buf[BUF_LEN], int *hold) ...@@ -326,10 +331,10 @@ int joystick_fill_report(char report[8], char buf[BUF_LEN], int *hold)
fprintf(stderr, "unknown option: %s\n", tok); fprintf(stderr, "unknown option: %s\n", tok);
} }
return 4; return 4;
} }
void print_options(char c) void print_options(char c)
{ {
int i = 0; int i = 0;
if (c == 'k') { if (c == 'k') {
...@@ -358,10 +363,10 @@ void print_options(char c) ...@@ -358,10 +363,10 @@ void print_options(char c)
" three signed numbers\n" " three signed numbers\n"
"--quit to close\n"); "--quit to close\n");
} }
} }
int main(int argc, const char *argv[]) int main(int argc, const char *argv[])
{ {
const char *filename = NULL; const char *filename = NULL;
int fd = 0; int fd = 0;
char buf[BUF_LEN]; char buf[BUF_LEN];
...@@ -449,4 +454,4 @@ int main(int argc, const char *argv[]) ...@@ -449,4 +454,4 @@ int main(int argc, const char *argv[])
close(fd); close(fd);
return 0; return 0;
} }
-*- org -*- ==============================
Multifunction Composite Gadget
==============================
* Overview Overview
========
The Multifunction Composite Gadget (or g_multi) is a composite gadget The Multifunction Composite Gadget (or g_multi) is a composite gadget
that makes extensive use of the composite framework to provide that makes extensive use of the composite framework to provide
...@@ -17,13 +20,15 @@ have two configurations -- one with RNDIS and another with CDC ECM[3]. ...@@ -17,13 +20,15 @@ have two configurations -- one with RNDIS and another with CDC ECM[3].
Please note that if you use non-standard configuration (that is enable Please note that if you use non-standard configuration (that is enable
CDC ECM) you may need to change vendor and/or product ID. CDC ECM) you may need to change vendor and/or product ID.
* Host drivers Host drivers
============
To make use of the gadget one needs to make it work on host side -- To make use of the gadget one needs to make it work on host side --
without that there's no hope of achieving anything with the gadget. without that there's no hope of achieving anything with the gadget.
As one might expect, things one need to do very from system to system. As one might expect, things one need to do very from system to system.
** Linux host drivers Linux host drivers
------------------
Since the gadget uses standard composite framework and appears as such Since the gadget uses standard composite framework and appears as such
to Linux host it does not need any additional drivers on Linux host to Linux host it does not need any additional drivers on Linux host
...@@ -34,11 +39,13 @@ This is also true for two configuration set-up with RNDIS ...@@ -34,11 +39,13 @@ This is also true for two configuration set-up with RNDIS
configuration being the first one. Linux host will use the second configuration being the first one. Linux host will use the second
configuration with CDC ECM which should work better under Linux. configuration with CDC ECM which should work better under Linux.
** Windows host drivers Windows host drivers
--------------------
For the gadget to work under Windows two conditions have to be met: For the gadget to work under Windows two conditions have to be met:
*** Detecting as composite gadget Detecting as composite gadget
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
First of all, Windows need to detect the gadget as an USB composite First of all, Windows need to detect the gadget as an USB composite
gadget which on its own have some conditions[4]. If they are met, gadget which on its own have some conditions[4]. If they are met,
...@@ -53,7 +60,8 @@ The only thing to worry is that the gadget has to have a single ...@@ -53,7 +60,8 @@ The only thing to worry is that the gadget has to have a single
configuration so a dual RNDIS and CDC ECM gadget won't work unless you configuration so a dual RNDIS and CDC ECM gadget won't work unless you
create a proper INF -- and of course, if you do submit it! create a proper INF -- and of course, if you do submit it!
*** Installing drivers for each function Installing drivers for each function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The other, trickier thing is making Windows install drivers for each The other, trickier thing is making Windows install drivers for each
individual function. individual function.
...@@ -63,7 +71,8 @@ implementing USB Mass Storage class and selects appropriate driver. ...@@ -63,7 +71,8 @@ implementing USB Mass Storage class and selects appropriate driver.
Things are harder with RDNIS and CDC ACM. Things are harder with RDNIS and CDC ACM.
**** RNDIS RNDIS
.....
To make Windows select RNDIS drivers for the first function in the To make Windows select RNDIS drivers for the first function in the
gadget, one needs to use the [[file:linux.inf]] file provided with this gadget, one needs to use the [[file:linux.inf]] file provided with this
...@@ -75,11 +84,13 @@ RNDIS was not the first interface. You do not need to worry abut it ...@@ -75,11 +84,13 @@ RNDIS was not the first interface. You do not need to worry abut it
unless you are trying to develop your own gadget in which case watch unless you are trying to develop your own gadget in which case watch
out for this bug. out for this bug.
**** CDC ACM CDC ACM
.......
Similarly, [[file:linux-cdc-acm.inf]] is provided for CDC ACM. Similarly, [[file:linux-cdc-acm.inf]] is provided for CDC ACM.
**** Customising the gadget Customising the gadget
......................
If you intend to hack the g_multi gadget be advised that rearranging If you intend to hack the g_multi gadget be advised that rearranging
functions will obviously change interface numbers for each of the functions will obviously change interface numbers for each of the
...@@ -97,14 +108,16 @@ things don't work as intended before realising Windows have cached ...@@ -97,14 +108,16 @@ things don't work as intended before realising Windows have cached
some drivers information (changing USB port may sometimes help plus some drivers information (changing USB port may sometimes help plus
you might try using USBDeview[8] to remove the phantom device). you might try using USBDeview[8] to remove the phantom device).
**** INF testing INF testing
...........
Provided INF files have been tested on Windows XP SP3, Windows Vista Provided INF files have been tested on Windows XP SP3, Windows Vista
and Windows 7, all 32-bit versions. It should work on 64-bit versions and Windows 7, all 32-bit versions. It should work on 64-bit versions
as well. It most likely won't work on Windows prior to Windows XP as well. It most likely won't work on Windows prior to Windows XP
SP2. SP2.
** Other systems Other systems
-------------
At this moment, drivers for any other systems have not been tested. At this moment, drivers for any other systems have not been tested.
Knowing how MacOS is based on BSD and BSD is an Open Source it is Knowing how MacOS is based on BSD and BSD is an Open Source it is
...@@ -115,7 +128,8 @@ For more exotic systems I have even less to say... ...@@ -115,7 +128,8 @@ For more exotic systems I have even less to say...
Any testing and drivers *are* *welcome*! Any testing and drivers *are* *welcome*!
* Authors Authors
=======
This document has been written by Michal Nazarewicz This document has been written by Michal Nazarewicz
([[mailto:mina86@mina86.com]]). INF files have been hacked with ([[mailto:mina86@mina86.com]]). INF files have been hacked with
...@@ -124,7 +138,8 @@ Xiaofan Chen ([[mailto:xiaofanc@gmail.com]]) basing on the MS RNDIS ...@@ -124,7 +138,8 @@ Xiaofan Chen ([[mailto:xiaofanc@gmail.com]]) basing on the MS RNDIS
template[9], Microchip's CDC ACM INF file and David Brownell's template[9], Microchip's CDC ACM INF file and David Brownell's
([[mailto:dbrownell@users.sourceforge.net]]) original INF files. ([[mailto:dbrownell@users.sourceforge.net]]) original INF files.
* Footnotes Footnotes
=========
[1] Remote Network Driver Interface Specification, [1] Remote Network Driver Interface Specification,
[[http://msdn.microsoft.com/en-us/library/ee484414.aspx]]. [[http://msdn.microsoft.com/en-us/library/ee484414.aspx]].
......
===============================
Linux USB Printer Gadget Driver
===============================
Linux USB Printer Gadget Driver 06/04/2007
06/04/2007
Copyright (C) 2007 Craig W. Nadler <craig@nadler.us> Copyright (C) 2007 Craig W. Nadler <craig@nadler.us>
GENERAL General
======= =======
This driver may be used if you are writing printer firmware using Linux as This driver may be used if you are writing printer firmware using Linux as
...@@ -29,52 +31,60 @@ user space firmware can read or write this status byte using a device file ...@@ -29,52 +31,60 @@ user space firmware can read or write this status byte using a device file
HOWTO USE THIS DRIVER Howto Use This Driver
===================== =====================
To load the USB device controller driver and the printer gadget driver. The To load the USB device controller driver and the printer gadget driver. The
following example uses the Netchip 2280 USB device controller driver: following example uses the Netchip 2280 USB device controller driver::
modprobe net2280 modprobe net2280
modprobe g_printer modprobe g_printer
The follow command line parameter can be used when loading the printer gadget The follow command line parameter can be used when loading the printer gadget
(ex: modprobe g_printer idVendor=0x0525 idProduct=0xa4a8 ): (ex: modprobe g_printer idVendor=0x0525 idProduct=0xa4a8 ):
idVendor - This is the Vendor ID used in the device descriptor. The default is idVendor
This is the Vendor ID used in the device descriptor. The default is
the Netchip vendor id 0x0525. YOU MUST CHANGE TO YOUR OWN VENDOR ID the Netchip vendor id 0x0525. YOU MUST CHANGE TO YOUR OWN VENDOR ID
BEFORE RELEASING A PRODUCT. If you plan to release a product and don't BEFORE RELEASING A PRODUCT. If you plan to release a product and don't
already have a Vendor ID please see www.usb.org for details on how to already have a Vendor ID please see www.usb.org for details on how to
get one. get one.
idProduct - This is the Product ID used in the device descriptor. The default idProduct
This is the Product ID used in the device descriptor. The default
is 0xa4a8, you should change this to an ID that's not used by any of is 0xa4a8, you should change this to an ID that's not used by any of
your other USB products if you have any. It would be a good idea to your other USB products if you have any. It would be a good idea to
start numbering your products starting with say 0x0001. start numbering your products starting with say 0x0001.
bcdDevice - This is the version number of your product. It would be a good idea bcdDevice
This is the version number of your product. It would be a good idea
to put your firmware version here. to put your firmware version here.
iManufacturer - A string containing the name of the Vendor. iManufacturer
A string containing the name of the Vendor.
iProduct - A string containing the Product Name. iProduct
A string containing the Product Name.
iSerialNum - A string containing the Serial Number. This should be changed for iSerialNum
A string containing the Serial Number. This should be changed for
each unit of your product. each unit of your product.
iPNPstring - The PNP ID string used for this printer. You will want to set iPNPstring
The PNP ID string used for this printer. You will want to set
either on the command line or hard code the PNP ID string used for either on the command line or hard code the PNP ID string used for
your printer product. your printer product.
qlen - The number of 8k buffers to use per endpoint. The default is 10, you qlen
The number of 8k buffers to use per endpoint. The default is 10, you
should tune this for your product. You may also want to tune the should tune this for your product. You may also want to tune the
size of each buffer for your product. size of each buffer for your product.
USING THE EXAMPLE CODE Using The Example Code
====================== ======================
This example code talks to stdout, instead of a print engine. This example code talks to stdout, instead of a print engine.
...@@ -82,22 +92,23 @@ This example code talks to stdout, instead of a print engine. ...@@ -82,22 +92,23 @@ This example code talks to stdout, instead of a print engine.
To compile the test code below: To compile the test code below:
1) save it to a file called prn_example.c 1) save it to a file called prn_example.c
2) compile the code with the follow command: 2) compile the code with the follow command::
gcc prn_example.c -o prn_example gcc prn_example.c -o prn_example
To read printer data from the host to stdout: To read printer data from the host to stdout::
# prn_example -read_data # prn_example -read_data
To write printer data from a file (data_file) to the host: To write printer data from a file (data_file) to the host::
# cat data_file | prn_example -write_data # cat data_file | prn_example -write_data
To get the current printer status for the gadget driver: To get the current printer status for the gadget driver:::
# prn_example -get_status # prn_example -get_status
...@@ -107,60 +118,62 @@ To get the current printer status for the gadget driver: ...@@ -107,60 +118,62 @@ To get the current printer status for the gadget driver:
Printer OK Printer OK
To set printer to Selected/On-line: To set printer to Selected/On-line::
# prn_example -selected # prn_example -selected
To set printer to Not Selected/Off-line: To set printer to Not Selected/Off-line::
# prn_example -not_selected # prn_example -not_selected
To set paper status to paper out: To set paper status to paper out::
# prn_example -paper_out # prn_example -paper_out
To set paper status to paper loaded: To set paper status to paper loaded::
# prn_example -paper_loaded # prn_example -paper_loaded
To set error status to printer OK: To set error status to printer OK::
# prn_example -no_error # prn_example -no_error
To set error status to ERROR: To set error status to ERROR::
# prn_example -error # prn_example -error
EXAMPLE CODE Example Code
============ ============
::
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <linux/poll.h> #include <linux/poll.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <linux/usb/g_printer.h> #include <linux/usb/g_printer.h>
#define PRINTER_FILE "/dev/g_printer" #define PRINTER_FILE "/dev/g_printer"
#define BUF_SIZE 512 #define BUF_SIZE 512
/* /*
* 'usage()' - Show program usage. * 'usage()' - Show program usage.
*/ */
static void static void
usage(const char *option) /* I - Option string or NULL */ usage(const char *option) /* I - Option string or NULL */
{ {
if (option) { if (option) {
fprintf(stderr,"prn_example: Unknown option \"%s\"!\n", fprintf(stderr,"prn_example: Unknown option \"%s\"!\n",
option); option);
...@@ -186,12 +199,12 @@ usage(const char *option) /* I - Option string or NULL */ ...@@ -186,12 +199,12 @@ usage(const char *option) /* I - Option string or NULL */
fputs("\n\n", stderr); fputs("\n\n", stderr);
exit(1); exit(1);
} }
static int static int
read_printer_data() read_printer_data()
{ {
struct pollfd fd[1]; struct pollfd fd[1];
/* Open device file for printer gadget. */ /* Open device file for printer gadget. */
...@@ -236,12 +249,12 @@ read_printer_data() ...@@ -236,12 +249,12 @@ read_printer_data()
close(fd[0].fd); close(fd[0].fd);
return 0; return 0;
} }
static int static int
write_printer_data() write_printer_data()
{ {
struct pollfd fd[1]; struct pollfd fd[1];
/* Open device file for printer gadget. */ /* Open device file for printer gadget. */
...@@ -295,12 +308,12 @@ write_printer_data() ...@@ -295,12 +308,12 @@ write_printer_data()
close(fd[0].fd); close(fd[0].fd);
return 0; return 0;
} }
static int static int
read_NB_printer_data() read_NB_printer_data()
{ {
int fd; int fd;
static char buf[BUF_SIZE]; static char buf[BUF_SIZE];
int bytes_read; int bytes_read;
...@@ -329,12 +342,12 @@ read_NB_printer_data() ...@@ -329,12 +342,12 @@ read_NB_printer_data()
close(fd); close(fd);
return 0; return 0;
} }
static int static int
get_printer_status() get_printer_status()
{ {
int retval; int retval;
int fd; int fd;
...@@ -357,12 +370,12 @@ get_printer_status() ...@@ -357,12 +370,12 @@ get_printer_status()
close(fd); close(fd);
return(retval); return(retval);
} }
static int static int
set_printer_status(unsigned char buf, int clear_printer_status_bit) set_printer_status(unsigned char buf, int clear_printer_status_bit)
{ {
int retval; int retval;
int fd; int fd;
...@@ -397,12 +410,12 @@ set_printer_status(unsigned char buf, int clear_printer_status_bit) ...@@ -397,12 +410,12 @@ set_printer_status(unsigned char buf, int clear_printer_status_bit)
close(fd); close(fd);
return 0; return 0;
} }
static int static int
display_printer_status() display_printer_status()
{ {
char printer_status; char printer_status;
printer_status = get_printer_status(); printer_status = get_printer_status();
...@@ -429,12 +442,12 @@ display_printer_status() ...@@ -429,12 +442,12 @@ display_printer_status()
} }
return(0); return(0);
} }
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
int i; /* Looping var */ int i; /* Looping var */
int retval = 0; int retval = 0;
...@@ -507,4 +520,4 @@ main(int argc, char *argv[]) ...@@ -507,4 +520,4 @@ main(int argc, char *argv[])
} }
exit(retval); exit(retval);
} }
===============================
Linux Gadget Serial Driver v2.0
===============================
Linux Gadget Serial Driver v2.0 11/20/2004
11/20/2004
(updated 8-May-2008 for v2.3) (updated 8-May-2008 for v2.3)
License and Disclaimer License and Disclaimer
...@@ -56,7 +59,7 @@ hardware; for example, a PDA, an embedded Linux system, or a PC ...@@ -56,7 +59,7 @@ hardware; for example, a PDA, an embedded Linux system, or a PC
with a USB development card. with a USB development card.
The gadget serial driver talks over USB to either a CDC ACM driver The gadget serial driver talks over USB to either a CDC ACM driver
or a generic USB serial driver running on a host PC. or a generic USB serial driver running on a host PC::
Host Host
-------------------------------------- --------------------------------------
...@@ -112,11 +115,11 @@ configuring the kernel. Then rebuild and install the kernel or ...@@ -112,11 +115,11 @@ configuring the kernel. Then rebuild and install the kernel or
modules. modules.
Then you must load the gadget serial driver. To load it as an Then you must load the gadget serial driver. To load it as an
ACM device (recommended for interoperability), do this: ACM device (recommended for interoperability), do this::
modprobe g_serial modprobe g_serial
To load it as a vendor specific bulk in/out device, do this: To load it as a vendor specific bulk in/out device, do this::
modprobe g_serial use_acm=0 modprobe g_serial use_acm=0
...@@ -127,7 +130,7 @@ desired. ...@@ -127,7 +130,7 @@ desired.
Your system should use mdev (from busybox) or udev to make the Your system should use mdev (from busybox) or udev to make the
device nodes. After this gadget driver has been set up you should device nodes. After this gadget driver has been set up you should
then see a /dev/ttyGS0 node: then see a /dev/ttyGS0 node::
# ls -l /dev/ttyGS0 | cat # ls -l /dev/ttyGS0 | cat
crw-rw---- 1 root root 253, 0 May 8 14:10 /dev/ttyGS0 crw-rw---- 1 root root 253, 0 May 8 14:10 /dev/ttyGS0
...@@ -187,24 +190,24 @@ support". ...@@ -187,24 +190,24 @@ support".
Once the gadget serial driver is loaded and the USB device connected Once the gadget serial driver is loaded and the USB device connected
to the Linux host with a USB cable, the host system should recognize to the Linux host with a USB cable, the host system should recognize
the gadget serial device. For example, the command the gadget serial device. For example, the command::
cat /sys/kernel/debug/usb/devices cat /sys/kernel/debug/usb/devices
should show something like this: should show something like this:::
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 5 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 D: Ver= 2.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0525 ProdID=a4a7 Rev= 2.01 P: Vendor=0525 ProdID=a4a7 Rev= 2.01
S: Manufacturer=Linux 2.6.8.1 with net2280 S: Manufacturer=Linux 2.6.8.1 with net2280
S: Product=Gadget Serial S: Product=Gadget Serial
S: SerialNumber=0 S: SerialNumber=0
C:* #Ifs= 2 Cfg#= 2 Atr=c0 MxPwr= 2mA C:* #Ifs= 2 Cfg#= 2 Atr=c0 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=acm
E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=83(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=acm
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
If the host side Linux system is configured properly, the ACM driver If the host side Linux system is configured properly, the ACM driver
should be loaded automatically. The command "lsmod" should show the should be loaded automatically. The command "lsmod" should show the
...@@ -219,29 +222,29 @@ Serial Converter support", and for the "USB Generic Serial Driver". ...@@ -219,29 +222,29 @@ Serial Converter support", and for the "USB Generic Serial Driver".
Once the gadget serial driver is loaded and the USB device connected Once the gadget serial driver is loaded and the USB device connected
to the Linux host with a USB cable, the host system should recognize to the Linux host with a USB cable, the host system should recognize
the gadget serial device. For example, the command the gadget serial device. For example, the command::
cat /sys/kernel/debug/usb/devices cat /sys/kernel/debug/usb/devices
should show something like this: should show something like this:::
T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 6 Spd=480 MxCh= 0 T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 6 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 D: Ver= 2.00 Cls=ff(vend.) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0525 ProdID=a4a6 Rev= 2.01 P: Vendor=0525 ProdID=a4a6 Rev= 2.01
S: Manufacturer=Linux 2.6.8.1 with net2280 S: Manufacturer=Linux 2.6.8.1 with net2280
S: Product=Gadget Serial S: Product=Gadget Serial
S: SerialNumber=0 S: SerialNumber=0
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 2mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=serial I: If#= 0 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=serial
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
You must load the usbserial driver and explicitly set its parameters You must load the usbserial driver and explicitly set its parameters
to configure it to recognize the gadget serial device, like this: to configure it to recognize the gadget serial device, like this::
echo 0x0525 0xA4A6 >/sys/bus/usb-serial/drivers/generic/new_id echo 0x0525 0xA4A6 >/sys/bus/usb-serial/drivers/generic/new_id
The legacy way is to use module parameters: The legacy way is to use module parameters::
modprobe usbserial vendor=0x0525 product=0xA4A6 modprobe usbserial vendor=0x0525 product=0xA4A6
......
=============================
Infinity Usb Unlimited Readme Infinity Usb Unlimited Readme
----------------------------- =============================
Hi all, Hi all,
...@@ -19,7 +20,8 @@ have his own device file(/dev/ttyUSB0,/dev/ttyUSB1,...) ...@@ -19,7 +20,8 @@ have his own device file(/dev/ttyUSB0,/dev/ttyUSB1,...)
How to tune the reader speed ? How to tune the reader speed?
=============================
A few parameters can be used at load time A few parameters can be used at load time
To use parameters, just unload the module if it is To use parameters, just unload the module if it is
...@@ -27,26 +29,33 @@ How to tune the reader speed ? ...@@ -27,26 +29,33 @@ How to tune the reader speed ?
In case of prebuilt module, use the command In case of prebuilt module, use the command
insmod iuu_phoenix param=value. insmod iuu_phoenix param=value.
Example: Example::
modprobe iuu_phoenix clockmode=3 modprobe iuu_phoenix clockmode=3
The parameters are: The parameters are:
parm: clockmode:1=3Mhz579,2=3Mhz680,3=6Mhz (int) clockmode:
parm: boost:overclock boost percent 100 to 500 (int) 1=3Mhz579,2=3Mhz680,3=6Mhz (int)
parm: cdmode:Card detect mode 0=none, 1=CD, 2=!CD, 3=DSR, 4=!DSR, 5=CTS, 6=!CTS, 7=RING, 8=!RING (int) boost:
parm: xmas:xmas color enabled or not (bool) overclock boost percent 100 to 500 (int)
parm: debug:Debug enabled or not (bool) cdmode:
Card detect mode
0=none, 1=CD, 2=!CD, 3=DSR, 4=!DSR, 5=CTS, 6=!CTS, 7=RING, 8=!RING (int)
xmas:
xmas color enabled or not (bool)
debug:
Debug enabled or not (bool)
- clockmode will provide 3 different base settings commonly adopted by - clockmode will provide 3 different base settings commonly adopted by
different software: different software:
1. 3Mhz579
1. 3Mhz579
2. 3Mhz680 2. 3Mhz680
3. 6Mhz 3. 6Mhz
- boost provide a way to overclock the reader ( my favorite :-) ) - boost provide a way to overclock the reader ( my favorite :-) )
For example to have best performance than a simple clockmode=3, try this: For example to have best performance than a simple clockmode=3, try this::
modprobe boost=195 modprobe boost=195
...@@ -66,7 +75,8 @@ How to tune the reader speed ? ...@@ -66,7 +75,8 @@ How to tune the reader speed ?
- debug will produce a lot of debugging messages... - debug will produce a lot of debugging messages...
Last notes: Last notes
==========
Don't worry about the serial settings, the serial emulation Don't worry about the serial settings, the serial emulation
is an abstraction, so use any speed or parity setting will is an abstraction, so use any speed or parity setting will
......
* Overview =========================
Mass Storage Gadget (MSG)
=========================
Overview
========
Mass Storage Gadget (or MSG) acts as a USB Mass Storage device, Mass Storage Gadget (or MSG) acts as a USB Mass Storage device,
appearing to the host as a disk or a CD-ROM drive. It supports appearing to the host as a disk or a CD-ROM drive. It supports
...@@ -24,7 +29,8 @@ ...@@ -24,7 +29,8 @@
(which is no longer included in Linux). It will talk only briefly (which is no longer included in Linux). It will talk only briefly
about how to use MSF within composite gadgets. about how to use MSF within composite gadgets.
* Module parameters Module parameters
=================
The mass storage gadget accepts the following mass storage specific The mass storage gadget accepts the following mass storage specific
module parameters: module parameters:
...@@ -146,7 +152,8 @@ ...@@ -146,7 +152,8 @@
- iProduct -- USB Product string (string) - iProduct -- USB Product string (string)
- iSerialNumber -- SerialNumber string (sting) - iSerialNumber -- SerialNumber string (sting)
* sysfs entries sysfs entries
=============
For each logical unit, the gadget creates a directory in the sysfs For each logical unit, the gadget creates a directory in the sysfs
hierarchy. Inside of it the following three files are created: hierarchy. Inside of it the following three files are created:
...@@ -177,7 +184,8 @@ ...@@ -177,7 +184,8 @@
Other then those, as usual, the values of module parameters can be Other then those, as usual, the values of module parameters can be
read from /sys/module/g_mass_storage/parameters/* files. read from /sys/module/g_mass_storage/parameters/* files.
* Other gadgets using mass storage function Other gadgets using mass storage function
=========================================
The Mass Storage Gadget uses the Mass Storage Function to handle The Mass Storage Gadget uses the Mass Storage Function to handle
mass storage protocol. As a composite function, MSF may be used by mass storage protocol. As a composite function, MSF may be used by
...@@ -193,7 +201,8 @@ ...@@ -193,7 +201,8 @@
may take a look at mass_storage.c, acm_ms.c and multi.c (sorted by may take a look at mass_storage.c, acm_ms.c and multi.c (sorted by
complexity). complexity).
* Relation to file storage gadget Relation to file storage gadget
===============================
The Mass Storage Function and thus the Mass Storage Gadget has been The Mass Storage Function and thus the Mass Storage Gadget has been
based on the File Storage Gadget. The difference between the two is based on the File Storage Gadget. The difference between the two is
......
=============================
USB 7-Segment Numeric Display USB 7-Segment Numeric Display
=============================
Manufactured by Delcom Engineering Manufactured by Delcom Engineering
Device Information Device Information
...@@ -13,9 +16,13 @@ Device Modes ...@@ -13,9 +16,13 @@ Device Modes
------------ ------------
By default, the driver assumes the display is only 6 characters By default, the driver assumes the display is only 6 characters
The mode for 6 characters is: The mode for 6 characters is:
MSB 0x06; LSB 0x3f MSB 0x06; LSB 0x3f
For the 8 character display: For the 8 character display:
MSB 0x08; LSB 0xff MSB 0x08; LSB 0xff
The device can accept "text" either in raw, hex, or ascii textmode. The device can accept "text" either in raw, hex, or ascii textmode.
raw controls each segment manually, raw controls each segment manually,
hex expects a value between 0-15 per character, hex expects a value between 0-15 per character,
...@@ -42,5 +49,3 @@ Device Operation ...@@ -42,5 +49,3 @@ Device Operation
To set multiple decimals points sum up each power. To set multiple decimals points sum up each power.
For example, to set the 0th and 3rd decimal place For example, to set the 0th and 3rd decimal place
echo 1001 > /sys/bus/usb/.../decimals echo 1001 > /sys/bus/usb/.../decimals
CHANGES ================
mtouchusb driver
================
Changes
=======
- 0.3 - Created based off of scanner & INSTALL from the original touchscreen - 0.3 - Created based off of scanner & INSTALL from the original touchscreen
driver on freecode (http://freecode.com/projects/3mtouchscreendriver) driver on freecode (http://freecode.com/projects/3mtouchscreendriver)
- Amended for linux-2.4.18, then 2.4.19 - Amended for linux-2.4.18, then 2.4.19
- 0.5 - Complete rewrite using Linux Input in 2.6.3 - 0.5 - Complete rewrite using Linux Input in 2.6.3
Unfortunately no calibration support at this time Unfortunately no calibration support at this time
- 1.4 - Multiple changes to support the EXII 5000UC and house cleaning - 1.4 - Multiple changes to support the EXII 5000UC and house cleaning
Changed reset from standard USB dev reset to vendor reset Changed reset from standard USB dev reset to vendor reset
Changed data sent to host from compensated to raw coordinates Changed data sent to host from compensated to raw coordinates
Eliminated vendor/product module params Eliminated vendor/product module params
Performed multiple successful tests with an EXII-5010UC Performed multiple successful tests with an EXII-5010UC
Supported Hardware
==================
SUPPORTED HARDWARE: ::
All controllers have the Vendor: 0x0596 & Product: 0x0001 All controllers have the Vendor: 0x0596 & Product: 0x0001
...@@ -29,9 +37,10 @@ SUPPORTED HARDWARE: ...@@ -29,9 +37,10 @@ SUPPORTED HARDWARE:
USB Capacitive - Black Case EXII-5030UC USB Capacitive - Black Case EXII-5030UC
USB Capacitive - No Case EXII-5050UC USB Capacitive - No Case EXII-5050UC
DRIVER NOTES: Driver Notes
============
Installation is simple, you only need to add Linux Input, Linux USB, and the Installation is simple, you only need to add Linux Input, Linux USB, and the
driver to the kernel. The driver can also be optionally built as a module. driver to the kernel. The driver can also be optionally built as a module.
This driver appears to be one of possible 2 Linux USB Input Touchscreen This driver appears to be one of possible 2 Linux USB Input Touchscreen
...@@ -49,24 +58,27 @@ The controller screen resolution is now 0 to 16384 for both X and Y reporting ...@@ -49,24 +58,27 @@ The controller screen resolution is now 0 to 16384 for both X and Y reporting
the raw touch data. This is the same for the old and new capacitive USB the raw touch data. This is the same for the old and new capacitive USB
controllers. controllers.
Perhaps at some point an abstract function will be placed into evdev so Perhaps at some point an abstract function will be placed into evdev so
generic functions like calibrations, resets, and vendor information can be generic functions like calibrations, resets, and vendor information can be
requested from the userspace (And the drivers would handle the vendor specific requested from the userspace (And the drivers would handle the vendor specific
tasks). tasks).
TODO: TODO
====
Implement a control urb again to handle requests to and from the device Implement a control urb again to handle requests to and from the device
such as calibration, etc once/if it becomes available. such as calibration, etc once/if it becomes available.
DISCLAIMER: Disclaimer
==========
I am not a MicroTouch/3M employee, nor have I ever been. 3M does not support I am not a MicroTouch/3M employee, nor have I ever been. 3M does not support
this driver! If you want touch drivers only supported within X, please go to: this driver! If you want touch drivers only supported within X, please go to:
http://www.3m.com/3MTouchSystems/ http://www.3m.com/3MTouchSystems/
THANKS: Thanks
======
A huge thank you to 3M Touch Systems for the EXII-5010UC controllers for A huge thank you to 3M Touch Systems for the EXII-5010UC controllers for
testing! testing!
====
OHCI
====
23-Aug-2002 23-Aug-2002
The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived The "ohci-hcd" driver is a USB Host Controller Driver (HCD) that is derived
...@@ -29,4 +33,3 @@ work on while the OS is getting around to the relevant IRQ processing. ...@@ -29,4 +33,3 @@ work on while the OS is getting around to the relevant IRQ processing.
- David Brownell - David Brownell
<dbrownell@users.sourceforge.net> <dbrownell@users.sourceforge.net>
============
Diamonds Rio
============
Copyright (C) 1999, 2000 Bruce Tenison Copyright (C) 1999, 2000 Bruce Tenison
Portions Copyright (C) 1999, 2000 David Nelson Portions Copyright (C) 1999, 2000 David Nelson
Thanks to David Nelson for guidance and the usage of the scanner.txt Thanks to David Nelson for guidance and the usage of the scanner.txt
and scanner.c files to model our driver and this informative file. and scanner.c files to model our driver and this informative file.
Mar. 2, 2000 Mar. 2, 2000
CHANGES Changes
=======
- Initial Revision - Initial Revision
OVERVIEW Overview
========
This README will address issues regarding how to configure the kernel This README will address issues regarding how to configure the kernel
to access a RIO 500 mp3 player. to access a RIO 500 mp3 player.
Before I explain how to use this to access the Rio500 please be warned: Before I explain how to use this to access the Rio500 please be warned:
W A R N I N G: .. warning::
--------------
Please note that this software is still under development. The authors Please note that this software is still under development. The authors
are in no way responsible for any damage that may occur, no matter how are in no way responsible for any damage that may occur, no matter how
inconsequential. inconsequential.
It seems that the Rio has a problem when sending .mp3 with low batteries. It seems that the Rio has a problem when sending .mp3 with low batteries.
I suggest when the batteries are low and you want to transfer stuff that you I suggest when the batteries are low and you want to transfer stuff that you
replace it with a fresh one. In my case, what happened is I lost two 16kb replace it with a fresh one. In my case, what happened is I lost two 16kb
blocks (they are no longer usable to store information to it). But I don't blocks (they are no longer usable to store information to it). But I don't
know if that's normal or not; it could simply be a problem with the flash know if that's normal or not; it could simply be a problem with the flash
memory. memory.
In an extreme case, I left my Rio playing overnight and the batteries wore In an extreme case, I left my Rio playing overnight and the batteries wore
down to nothing and appear to have corrupted the flash memory. My RIO down to nothing and appear to have corrupted the flash memory. My RIO
needed to be replaced as a result. Diamond tech support is aware of the needed to be replaced as a result. Diamond tech support is aware of the
problem. Do NOT allow your batteries to wear down to nothing before problem. Do NOT allow your batteries to wear down to nothing before
changing them. It appears RIO 500 firmware does not handle low battery changing them. It appears RIO 500 firmware does not handle low battery
power well at all. power well at all.
On systems with OHCI controllers, the kernel OHCI code appears to have On systems with OHCI controllers, the kernel OHCI code appears to have
power on problems with some chipsets. If you are having problems power on problems with some chipsets. If you are having problems
connecting to your RIO 500, try turning it on first and then plugging it connecting to your RIO 500, try turning it on first and then plugging it
into the USB cable. into the USB cable.
Contact information: Contact Information
-------------------- -------------------
The main page for the project is hosted at sourceforge.net in the following The main page for the project is hosted at sourceforge.net in the following
URL: <http://rio500.sourceforge.net>. You can also go to the project's URL: <http://rio500.sourceforge.net>. You can also go to the project's
sourceforge home page at: <http://sourceforge.net/projects/rio500/>. sourceforge home page at: <http://sourceforge.net/projects/rio500/>.
There is also a mailing list: rio500-users@lists.sourceforge.net There is also a mailing list: rio500-users@lists.sourceforge.net
Authors: Authors
------- -------
Most of the code was written by Cesar Miquel <miquel@df.uba.ar>. Keith Most of the code was written by Cesar Miquel <miquel@df.uba.ar>. Keith
Clayton <kclayton@jps.net> is incharge of the PPC port and making sure Clayton <kclayton@jps.net> is incharge of the PPC port and making sure
things work there. Bruce Tenison <btenison@dibbs.net> is adding support things work there. Bruce Tenison <btenison@dibbs.net> is adding support
for .fon files and also does testing. The program will mostly sure be for .fon files and also does testing. The program will mostly sure be
re-written and Pete Ikusz along with the rest will re-design it. I would re-written and Pete Ikusz along with the rest will re-design it. I would
also like to thank Tri Nguyen <tmn_3022000@hotmail.com> who provided use also like to thank Tri Nguyen <tmn_3022000@hotmail.com> who provided use
with some important information regarding the communication with the Rio. with some important information regarding the communication with the Rio.
ADDITIONAL INFORMATION and Userspace tools Additional Information and userspace tools
http://rio500.sourceforge.net/ http://rio500.sourceforge.net/
REQUIREMENTS Requirements
============
A host with a USB port. Ideally, either a UHCI (Intel) or OHCI A host with a USB port. Ideally, either a UHCI (Intel) or OHCI
(Compaq and others) hardware port should work. (Compaq and others) hardware port should work.
...@@ -80,11 +88,11 @@ A Linux kernel with RIO 500 support enabled. ...@@ -80,11 +88,11 @@ A Linux kernel with RIO 500 support enabled.
'lspci' which is only needed to determine the type of USB hardware 'lspci' which is only needed to determine the type of USB hardware
available in your machine. available in your machine.
CONFIGURATION Configuration
Using `lspci -v`, determine the type of USB hardware available. Using `lspci -v`, determine the type of USB hardware available.
If you see something like: If you see something like::
USB Controller: ...... USB Controller: ......
Flags: ..... Flags: .....
...@@ -92,7 +100,7 @@ Using `lspci -v`, determine the type of USB hardware available. ...@@ -92,7 +100,7 @@ Using `lspci -v`, determine the type of USB hardware available.
Then you have a UHCI based controller. Then you have a UHCI based controller.
If you see something like: If you see something like::
USB Controller: ..... USB Controller: .....
Flags: .... Flags: ....
...@@ -107,8 +115,9 @@ hardware (determined from the steps above), 'USB Diamond Rio500 support', and ...@@ -107,8 +115,9 @@ hardware (determined from the steps above), 'USB Diamond Rio500 support', and
(you may need to execute `depmod -a` to update the module (you may need to execute `depmod -a` to update the module
dependencies). dependencies).
Add a device for the USB rio500: Add a device for the USB rio500::
`mknod /dev/usb/rio500 c 180 64`
mknod /dev/usb/rio500 c 180 64
Set appropriate permissions for /dev/usb/rio500 (don't forget about Set appropriate permissions for /dev/usb/rio500 (don't forget about
group and world permissions). Both read and write permissions are group and world permissions). Both read and write permissions are
...@@ -116,12 +125,14 @@ required for proper operation. ...@@ -116,12 +125,14 @@ required for proper operation.
Load the appropriate modules (if compiled as modules): Load the appropriate modules (if compiled as modules):
OHCI: OHCI::
modprobe usbcore modprobe usbcore
modprobe usb-ohci modprobe usb-ohci
modprobe rio500 modprobe rio500
UHCI: UHCI::
modprobe usbcore modprobe usbcore
modprobe usb-uhci (or uhci) modprobe usb-uhci (or uhci)
modprobe rio500 modprobe rio500
...@@ -129,10 +140,10 @@ Load the appropriate modules (if compiled as modules): ...@@ -129,10 +140,10 @@ Load the appropriate modules (if compiled as modules):
That's it. The Rio500 Utils at: http://rio500.sourceforge.net should That's it. The Rio500 Utils at: http://rio500.sourceforge.net should
be able to access the rio500. be able to access the rio500.
BUGS Bugs
====
If you encounter any problems feel free to drop me an email. If you encounter any problems feel free to drop me an email.
Bruce Tenison Bruce Tenison
btenison@dibbs.net btenison@dibbs.net
usb-help.txt ==============
USB references
==============
2008-Mar-7 2008-Mar-7
For USB help other than the readme files that are located in For USB help other than the readme files that are located in
Documentation/usb/*, see the following: `Documentation/usb/*`, see the following:
Linux-USB project: http://www.linux-usb.org - Linux-USB project: http://www.linux-usb.org
mirrors at http://usb.in.tum.de/linux-usb/ mirrors at http://usb.in.tum.de/linux-usb/
and http://it.linux-usb.org and http://it.linux-usb.org
Linux USB Guide: http://linux-usb.sourceforge.net - Linux USB Guide: http://linux-usb.sourceforge.net
Linux-USB device overview (working devices and drivers): - Linux-USB device overview (working devices and drivers):
http://www.qbik.ch/usb/devices/ http://www.qbik.ch/usb/devices/
The Linux-USB mailing list is at linux-usb@vger.kernel.org The Linux-USB mailing list is at linux-usb@vger.kernel.org
###
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -15377,6 +15377,11 @@ M: Laxman Dewangan <ldewangan@nvidia.com> ...@@ -15377,6 +15377,11 @@ M: Laxman Dewangan <ldewangan@nvidia.com>
S: Supported S: Supported
F: drivers/spi/spi-tegra* F: drivers/spi/spi-tegra*
TEGRA XUSB PADCTL DRIVER
M: JC Kuo <jckuo@nvidia.com>
S: Supported
F: drivers/phy/tegra/xusb*
TEHUTI ETHERNET DRIVER TEHUTI ETHERNET DRIVER
M: Andy Gospodarek <andy@greyhouse.net> M: Andy Gospodarek <andy@greyhouse.net>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
...@@ -16155,6 +16160,14 @@ L: linux-usb@vger.kernel.org ...@@ -16155,6 +16160,14 @@ L: linux-usb@vger.kernel.org
S: Maintained S: Maintained
F: drivers/usb/roles/intel-xhci-usb-role-switch.c F: drivers/usb/roles/intel-xhci-usb-role-switch.c
USB IP DRIVER FOR HISILICON KIRIN
M: Yu Chen <chenyu56@huawei.com>
M: Binghui Wang <wangbinghui@hisilicon.com>
L: linux-usb@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/phy/phy-hi3660-usb3.txt
F: drivers/phy/hisilicon/phy-hi3660-usb3.c
USB ISP116X DRIVER USB ISP116X DRIVER
M: Olav Kongas <ok@artecdesign.ee> M: Olav Kongas <ok@artecdesign.ee>
L: linux-usb@vger.kernel.org L: linux-usb@vger.kernel.org
......
...@@ -616,6 +616,7 @@ usb_host1: usb@ff540000 { ...@@ -616,6 +616,7 @@ usb_host1: usb@ff540000 {
dr_mode = "host"; dr_mode = "host";
phys = <&usbphy2>; phys = <&usbphy2>;
phy-names = "usb2-phy"; phy-names = "usb2-phy";
snps,reset-phy-on-wake;
status = "disabled"; status = "disabled";
}; };
...@@ -904,6 +905,8 @@ usbphy0: usb-phy@320 { ...@@ -904,6 +905,8 @@ usbphy0: usb-phy@320 {
clocks = <&cru SCLK_OTGPHY0>; clocks = <&cru SCLK_OTGPHY0>;
clock-names = "phyclk"; clock-names = "phyclk";
#clock-cells = <0>; #clock-cells = <0>;
resets = <&cru SRST_USBOTG_PHY>;
reset-names = "phy-reset";
}; };
usbphy1: usb-phy@334 { usbphy1: usb-phy@334 {
...@@ -912,6 +915,8 @@ usbphy1: usb-phy@334 { ...@@ -912,6 +915,8 @@ usbphy1: usb-phy@334 {
clocks = <&cru SCLK_OTGPHY1>; clocks = <&cru SCLK_OTGPHY1>;
clock-names = "phyclk"; clock-names = "phyclk";
#clock-cells = <0>; #clock-cells = <0>;
resets = <&cru SRST_USBHOST0_PHY>;
reset-names = "phy-reset";
}; };
usbphy2: usb-phy@348 { usbphy2: usb-phy@348 {
...@@ -920,6 +925,8 @@ usbphy2: usb-phy@348 { ...@@ -920,6 +925,8 @@ usbphy2: usb-phy@348 {
clocks = <&cru SCLK_OTGPHY2>; clocks = <&cru SCLK_OTGPHY2>;
clock-names = "phyclk"; clock-names = "phyclk";
#clock-cells = <0>; #clock-cells = <0>;
resets = <&cru SRST_USBHOST1_PHY>;
reset-names = "phy-reset";
}; };
}; };
}; };
......
...@@ -253,6 +253,12 @@ static const struct pci_device_id gpu_i2c_ids[] = { ...@@ -253,6 +253,12 @@ static const struct pci_device_id gpu_i2c_ids[] = {
}; };
MODULE_DEVICE_TABLE(pci, gpu_i2c_ids); MODULE_DEVICE_TABLE(pci, gpu_i2c_ids);
static const struct property_entry ccgx_props[] = {
/* Use FW built for NVIDIA (nv) only */
PROPERTY_ENTRY_U16("ccgx,firmware-build", ('n' << 8) | 'v'),
{ }
};
static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq) static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq)
{ {
struct i2c_client *ccgx_client; struct i2c_client *ccgx_client;
...@@ -267,6 +273,7 @@ static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq) ...@@ -267,6 +273,7 @@ static int gpu_populate_client(struct gpu_i2c_dev *i2cd, int irq)
sizeof(i2cd->gpu_ccgx_ucsi->type)); sizeof(i2cd->gpu_ccgx_ucsi->type));
i2cd->gpu_ccgx_ucsi->addr = 0x8; i2cd->gpu_ccgx_ucsi->addr = 0x8;
i2cd->gpu_ccgx_ucsi->irq = irq; i2cd->gpu_ccgx_ucsi->irq = irq;
i2cd->gpu_ccgx_ucsi->properties = ccgx_props;
ccgx_client = i2c_new_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi); ccgx_client = i2c_new_device(&i2cd->adapter, i2cd->gpu_ccgx_ucsi);
if (!ccgx_client) if (!ccgx_client)
return -ENODEV; return -ENODEV;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment