Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions Documentation/devicetree/bindings/phy/spacemit,k1-combphy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/phy/spacemit,k1-combphy.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SpacemiT K1 PCIe/USB3 Combo PHY

maintainers:
- Ze Huang <huangze@whut.edu.cn>

description:
Combo PHY on SpacemiT K1 SoC. PCIe port A and USB3 controller share this
phy, only one of PCIe port A and USB3 port can work at any given application
scenario.

properties:
compatible:
const: spacemit,k1-combphy

reg:
items:
- description: PHY control registers
- description: PCIe/USB3 mode selection register

reg-names:
items:
- const: ctrl
- const: sel

resets:
maxItems: 1

"#phy-cells":
const: 1
description:
Indicates the PHY mode to select. The value determines whether the PHY
operates in PCIe or USB3 mode.

spacemit,lfps-threshold:
description:
Controls the LFPS signal detection threshold, affects polling.LFPS
handshake. Lower the threshold when core voltage rises.
$ref: /schemas/types.yaml#/definitions/uint32
minimum: 0
maximum: 0xff

spacemit,rx-always-on:
description:
Affects RX.detect, enhance compatibility of some DFPs in device mode but
increase power consumption.
type: boolean

required:
- compatible
- reg
- reg-names
- resets
- "#phy-cells"

additionalProperties: false

examples:
- |
phy@c0b10000 {
compatible = "spacemit,k1-combphy";
reg = <0xc0b10000 0x800>,
<0xd4282910 0x400>;
reg-names = "ctrl", "sel";
resets = <&syscon_apmu 19>;
#phy-cells = <1>;
};
40 changes: 40 additions & 0 deletions Documentation/devicetree/bindings/phy/spacemit,usb2-phy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/phy/spacemit,usb2-phy.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: SpacemiT K1 SoC USB 2.0 PHY

maintainers:
- Ze Huang <huangze@whut.edu.cn>

properties:
compatible:
const: spacemit,k1-usb2-phy

reg:
maxItems: 1

clocks:
maxItems: 1

"#phy-cells":
const: 0

required:
- compatible
- reg
- clocks
- "#phy-cells"

additionalProperties: false

examples:
- |
usb-phy@c09c0000 {
compatible = "spacemit,k1-usb2-phy";
reg = <0xc09c0000 0x200>;
clocks = <&syscon_apmu 15>;
#phy-cells = <0>;
};
1 change: 1 addition & 0 deletions drivers/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ source "drivers/phy/renesas/Kconfig"
source "drivers/phy/rockchip/Kconfig"
source "drivers/phy/samsung/Kconfig"
source "drivers/phy/socionext/Kconfig"
source "drivers/phy/spacemit/Kconfig"
source "drivers/phy/st/Kconfig"
source "drivers/phy/starfive/Kconfig"
source "drivers/phy/sunplus/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/phy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ obj-y += allwinner/ \
rockchip/ \
samsung/ \
socionext/ \
spacemit/ \
st/ \
starfive/ \
sunplus/ \
Expand Down
21 changes: 21 additions & 0 deletions drivers/phy/spacemit/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Phy drivers for SpacemiT platforms
#
config PHY_SPACEMIT_K1_USB2
tristate "SpacemiT K1 USB 2.0 PHY support"
depends on (ARCH_SPACEMIT || COMPILE_TEST) && OF
depends on COMMON_CLK
depends on USB_COMMON
select GENERIC_PHY
help
Enable this to support K1 USB 2.0 PHY driver. This driver takes care of
enabling and clock setup and will be used by K1 udc/ehci/otg/xhci driver.

config PHY_SPACEMIT_K1_COMBPHY
tristate "SpacemiT K1 PCIe/USB3 combo PHY support"
depends on (ARCH_SPACEMIT || COMPILE_TEST) && OF
depends on COMMON_CLK
select GENERIC_PHY
help
USB3/PCIe Combo PHY Support for SpacemiT K1 SoC
3 changes: 3 additions & 0 deletions drivers/phy/spacemit/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_PHY_SPACEMIT_K1_COMBPHY) += phy-k1-combphy.o
obj-$(CONFIG_PHY_SPACEMIT_K1_USB2) += phy-k1-usb2.o
Loading