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
101 changes: 83 additions & 18 deletions Documentation/devicetree/bindings/phy/apple,t6040-atcphy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ maintainers:

description: >
The Type-C PHY of the Apple T6040 (M4 Pro) SoC, as used for USB2 and USB3
host operation. USB3 is brought up by a PHY coprocessor running RTKit
firmware, reached through an ASC mailbox. The PHY also provides the reset
line of the attached DWC3 controller and acts as the Type-C orientation
switch.
host operation and for DisplayPort. USB3 is brought up by a PHY coprocessor
running RTKit firmware, reached through an ASC mailbox. The PHY also
provides the reset line of the attached DWC3 controller and acts as the
Type-C orientation switch and, where the port carries DisplayPort alt mode,
as its mode switch. The same PHY drives the fixed DisplayPort link of an
HDMI converter; that instance has no USB controller behind it and therefore
no PIPE interface.

$defs:
apple,tunable:
Expand All @@ -35,6 +38,7 @@ properties:
const: apple,t6040-atcphy

reg:
minItems: 10
items:
- description: USB2 PHY controls
- description: USB2 event counter controls
Expand All @@ -49,21 +53,37 @@ properties:
- description: ATC common configuration controls

reg-names:
items:
- const: bank0
- const: bank1
- const: pipehandler
- const: core
- const: cfg
- const: cpu
- const: cpu-data
- const: axi2af
- const: axi2af-lioa
- const: fabric
- const: common-cfg
oneOf:
- items:
- const: bank0
- const: bank1
- const: pipehandler
- const: core
- const: cfg
- const: cpu
- const: cpu-data
- const: axi2af
- const: axi2af-lioa
- const: fabric
- const: common-cfg
- description: A fixed DisplayPort PHY without a USB controller
items:
- const: bank0
- const: bank1
- const: core
- const: cfg
- const: cpu
- const: cpu-data
- const: axi2af
- const: axi2af-lioa
- const: fabric
- const: common-cfg

"#phy-cells":
const: 1
description: >
The PHY type (dt-bindings/phy/phy.h): PHY_TYPE_USB2, PHY_TYPE_USB3 or
PHY_TYPE_DP.

"#reset-cells":
const: 0
Expand All @@ -81,9 +101,13 @@ properties:

orientation-switch: true

mode-switch: true

port:
$ref: /schemas/graph.yaml#/properties/port
description: Link to the SuperSpeed lanes of the Type-C connector.
description: >
Link to the SuperSpeed lanes of the Type-C connector. Absent on a fixed
DisplayPort PHY.

apple,tunable-axi2af:
$ref: "#/$defs/apple,tunable"
Expand Down Expand Up @@ -134,9 +158,24 @@ required:
- reg
- reg-names
- "#phy-cells"
- "#reset-cells"
- power-domains

allOf:
- if:
properties:
reg-names:
contains:
const: pipehandler
then:
required:
- "#reset-cells"
else:
properties:
"#reset-cells": false
orientation-switch: false
mode-switch: false
port: false

additionalProperties: false

examples:
Expand Down Expand Up @@ -170,4 +209,30 @@ examples:
orientation-switch;
};
};
- |
soc {
#address-cells = <2>;
#size-cells = <2>;

phy@39aa90000 {
compatible = "apple,t6040-atcphy";
reg = <0x3 0x9aa90000 0x0 0x4000>,
<0x3 0x9a800000 0x0 0x4000>,
<0x3 0x9b000000 0x0 0x30000>,
<0x3 0x9b200000 0x0 0x4000>,
<0x3 0x9b140000 0x0 0x4000>,
<0x3 0x9b0c0000 0x0 0x10000>,
<0x3 0x98000000 0x0 0x8000>,
<0x3 0x98020000 0x0 0x4000>,
<0x3 0x9b244000 0x0 0x4000>,
<0x3 0x9b250000 0x0 0x4000>;
reg-names = "bank0", "bank1", "core", "cfg", "cpu", "cpu-data",
"axi2af", "axi2af-lioa", "fabric", "common-cfg";
#phy-cells = <1>;
power-domains = <&ps_atc3_common_dp>;
mboxes = <&atcphy3_mbox>;
mbox-names = "phy-cpu";
nonposted-mmio;
};
};
...
21 changes: 12 additions & 9 deletions drivers/phy/apple/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,26 @@ config PHY_APPLE_ATC_KUNIT_TEST
If unsure, say N.

config PHY_APPLE_T6040_USB2
tristate "Apple T6040 Type-C PHY (USB2 and USB3 host)"
tristate "Apple T6040 Type-C PHY (USB2/USB3 host, DisplayPort)"
depends on ARM64 && ARCH_APPLE
depends on TYPEC
depends on APPLE_RTKIT
select GENERIC_PHY
select APPLE_TUNABLE
help
Build the PHY provider for the T6040 generation's Type-C ports. It
implements the USB2 host sequence and the USB3 host attach decoded
from the paired AppleT6040TypeCPhy driver, including the start of
the PHY coprocessor, and provides no device mode, DisplayPort,
USB4/Thunderbolt or retimer support.
Build the PHY provider for the T6040 generation's Type-C ports and
fixed DisplayPort PHYs. It implements the USB2 host sequence and the
USB3 host attach decoded from the paired AppleT6040TypeCPhy driver,
including the start of the PHY coprocessor, and the DisplayPort mode
(all four lanes, RBR to HBR3) a Type-C controller selects through the
PHY's mode switch or that an HDMI converter's PHY runs permanently.
It provides no device mode, DisplayPort pin assignment D, USB4,
Thunderbolt or retimer support.

This driver performs no ATC-register writes at probe time. Enabling a
matching device-tree node causes MMIO writes when a USB2 consumer
powers on the PHY and therefore requires platform-specific safety
review.
matching device-tree node causes MMIO writes when a USB2, USB3 or
DisplayPort consumer powers on the PHY and therefore requires
platform-specific safety review.

config PHY_APPLE_DPTX
tristate "Apple DPTX PHY"
Expand Down
Loading