Skip to content
Merged
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
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/phy/apple,dptx-phy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ select:
compatible:
contains:
enum:
- apple,t6041-dptx-phy
- apple,t6050-dptx-phy
- apple,t8122-dptx-phy
required:
Expand All @@ -34,6 +35,9 @@ properties:
- apple,t8122-dptx-phy
- const: apple,dptx-phy
- const: apple,t6050-dptx-phy
- items:
- const: apple,t6041-dptx-phy
- const: apple,t6050-dptx-phy

reg:
minItems: 2
Expand Down
95 changes: 95 additions & 0 deletions arch/arm64/boot/dts/apple/t6041-j575c-hdmi.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The J575c's HDMI port: the LPDPTX PHY (ADT /arm-io/lpdptx-phy0, the display
* crossbar's output 4) and the on-board DP-to-HDMI converter, whose hotplug
* and power pins are the J616c's (ADT /arm-io/dp2hdmi-gpio0: AOP GPIO 0x24,
* SMC gP0f and gP1a).
*
* macOS drives this port from the internal DCP, which aura's Stage 1 puts to
* sleep on this board. The crossbar has no registers: the PHY's source select
* picks the engine, so dcpext0 (crossbar input 0) drives it here, as on the
* M2 Max Mac Studio (t6021-j475c.dts).
*
* Every node is disabled. The boot loader fills dcpext0's firmware memory and
* the display gate (drivers/soc/apple/display-gate.c) then enables the chain.
*/

/ {
aliases {
dcpext0 = &dcpext0;
};

reserved-memory {
/* Filled by the boot loader, as dcpext1's (t6041-j575c-usbc.dtsi). */
dcpext0_text: dcpext0-text {
compatible = "apple,asc-mem";
reg = <0x0 0x0 0x0 0x4000>;
no-map;
status = "disabled";
};

dcpext0_data: dcpext0-data {
compatible = "apple,asc-mem";
reg = <0x0 0x0 0x0 0x4000>;
no-map;
status = "disabled";
};

dcpext0_heap: dcpext0-heap {
compatible = "apple,asc-mem";
reg = <0x0 0x0 0x0 0x4000>;
no-map;
status = "disabled";
};
};

/*
* ADT /arm-io/lpdptx-phy0 (dptx-phy,t8132): the T6050 layout, a core
* bank and a dptx bank, and the T8132 PLL calibration. FD0FD1SWAP and
* RODCOROLEAKCOMP are 0xffffffff (unset) in the ADT.
*/
lpdptx_phy0: phy@51c200000 {
compatible = "apple,t6041-dptx-phy", "apple,t6050-dptx-phy";
reg = <0x5 0x1c200000 0x0 0x4000>,
<0x5 0x1c240000 0x0 0x10000>;
reg-names = "core", "dptx";
power-domains = <&ps_dptx_phy>;
#phy-cells = <0>;
#reset-cells = <0>;
/* dispext0: source-select-offset 1 puts it at source select 1 */
apple,ufp-endpoint = <0>;
apple,pll-dcocfg = <0x4>;
apple,pll-dtcvreg = <0xf>;
apple,pll-dtccal = <0x2>;
apple,pll-dcdadj = <0x10>;
apple,pll-dlfcfg = <0x3>;
status = "disabled";
};
};

/* ADT /arm-io/pmgr DPTX_PHY: pmgr + 0x360 (its parents SBR and FAB5_SOC are not described) */
&pmgr {
ps_dptx_phy: power-controller@360 {
compatible = "apple,t6041-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate";
reg = <0x360 4>;
#power-domain-cells = <0>;
#reset-cells = <0>;
label = "dptx_phy";
status = "disabled";
};
};

&dcpext0 {
/delete-property/ apple,typec-hybrid-first;
apple,iomfb-surfaces = <1 1 0 0>;
apple,connector-type = "HDMI-A";
hdmi-hpd-gpios = <&pinctrl_aop 36 GPIO_ACTIVE_HIGH>;
hdmi-pwren-gpios = <&smc_gpio 15 GPIO_ACTIVE_HIGH>;
dp2hdmi-pwren-gpios = <&smc_gpio 26 GPIO_ACTIVE_HIGH>;
phys = <&lpdptx_phy0>;
phy-names = "dp-phy";
/* the crossbar's output 4 (ADT lpdptx-phy0 dp-switch-dfp-endpoint) */
apple,dptx-phy = <4>;
memory-region = <&dcpext0_text>, <&dcpext0_data>, <&dcpext0_heap>;
memory-region-names = "text", "data", "heap";
};
6 changes: 2 additions & 4 deletions arch/arm64/boot/dts/apple/t6041-j575c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -1993,11 +1993,9 @@
#include "t6041-j575c-atc3.dtsi"
#include "t6041-j575c-usb3.dtsi"
#include "t6041-j575c-usbc.dtsi"
#include "t6041-j575c-hdmi.dtsi"

/*
* Not described: HDMI (dcpext0 through display-crossbar0 to the lpdptx PHY
* and a DP-to-HDMI converter on i2c8) and the SEP (no Touch ID sensor).
*/
/* Not described: the SEP (no Touch ID sensor). */

/*
* The PMP, as the M4 Max MacBook Pros run it. The pmp alias lets the loader
Expand Down
21 changes: 21 additions & 0 deletions drivers/soc/apple/display-gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3154,8 +3154,29 @@ static const struct gate_staged t6041_j575c_usbc = {
"/iommu@602300000", t6041_j575c_usbc_nodes, ARRAY_SIZE(t6041_j575c_usbc_nodes),
};

/*
* The J575c's HDMI chain. Its ATC3 is a USB-C port, and its HDMI port runs
* through the LPDPTX PHY instead (t6041-j575c-hdmi.dtsi): that PHY's power,
* the AOP pins (the converter's hotplug), the PHY, then dcpext0's chain.
*/
static const char *const t6041_j575c_hdmi_nodes[] = {
"/power-management@502280000/power-controller@360",
"/pinctrl@510824000",
"/phy@51c200000",
"/iommu@3a2340000",
"/iommu@3a2300000",
"/mailbox@3a2e08000",
"/dcp@3a2e00000",
};

static const struct gate_staged t6041_j575c_hdmi = {
"/iommu@3a2300000", t6041_j575c_hdmi_nodes, ARRAY_SIZE(t6041_j575c_hdmi_nodes),
};

static const struct gate_staged *t6041_max_stage(unsigned int i)
{
if (i == 0 && of_machine_is_compatible("apple,j575c"))
return &t6041_j575c_hdmi;
if (i == 1 && of_machine_is_compatible("apple,j575c"))
return &t6041_j575c_usbc;
return &t6041_max_stages[i];
Expand Down
Loading