Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
108 changes: 19 additions & 89 deletions arch/arm64/boot/dts/apple/t8112-j473.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

/dts-v1/;

#define T8112_TYPEC_DCP

#include "t8112.dtsi"
#include "t8112-jxxx.dtsi"

Expand Down Expand Up @@ -42,71 +40,36 @@
};
&dcpext {
status = "okay";
apple,connector-type = "HDMI-A";

/* HDMI HPD gpio, used as interrupt*/
hdmi-hpd-gpios = <&pinctrl_aop 49 GPIO_ACTIVE_HIGH>;

hdmi-pwren-gpios = <&smc_gpio 21 GPIO_ACTIVE_HIGH>;
dp2hdmi-pwren-gpios = <&smc_gpio 22 GPIO_ACTIVE_HIGH>;

phys = <&dptxphy>;
phy-names = "dp-phy";
apple,dptx-phy = <5>;
};

&display {
/* dispext0_dart needs to be first for m1n1's */
iommus = <&dispext0_dart 0 0x0 0x0 0xf 0xffff0000>,
<&disp0_dart 0 0x0 0x0 0xf 0xffff0000>;
/* the boot display (HDMI on dcp) DART first, for the boot loader */
iommus = <&disp0_dart 0 0x0 0x0 0xf 0xffff0000>,
<&dispext0_dart 0 0x0 0x0 0xf 0xffff0000>;
};

&disp0_dart {
status = "okay";
};

/*
* As macOS does: the HDMI port (DP to HDMI converter behind dptxphy, DFP
* endpoint 5 of the display switch) on the primary DCP, the USB-C ports on
* dcpext (t8112-jxxx.dtsi), which offers DSC.
*/
&dcp {
status = "okay";
apple,connector-type = "USB-C";
phys = <&atcphy0 PHY_TYPE_DP>, <&atcphy1 PHY_TYPE_DP>;
phy-names = "typec0", "typec1";
mux-controls = <&atcphy0_xbar 0>, <&atcphy1_xbar 0>;
mux-control-names = "typec0", "typec1";
apple,typec-mux-indices = <0 0>;
apple,typec-dptx-phys = <0 1>;

typec-routes {
#address-cells = <1>;
#size-cells = <0>;

route@0 {
reg = <0>;
mode-switch;

port {
dcp_typec0: endpoint {
remote-endpoint = <&typec0_dcp>;
};
};
};
apple,connector-type = "HDMI-A";

route@1 {
reg = <1>;
mode-switch;
/* HDMI HPD gpio, used as interrupt*/
hdmi-hpd-gpios = <&pinctrl_aop 49 GPIO_ACTIVE_HIGH>;

port {
dcp_typec1: endpoint {
remote-endpoint = <&typec1_dcp>;
};
};
};
};
};
hdmi-pwren-gpios = <&smc_gpio 21 GPIO_ACTIVE_HIGH>;
dp2hdmi-pwren-gpios = <&smc_gpio 22 GPIO_ACTIVE_HIGH>;

&dcpext {
/delete-property/ mux-controls;
/delete-property/ mux-control-names;
/delete-property/ mux-index;
phys = <&dptxphy>;
phy-names = "dp-phy";
apple,dptx-phy = <5>;
};

/*
Expand All @@ -129,45 +92,12 @@
status = "disabled";
};

&typec0 {
ports {
port@3 {
reg = <3>;
typec0_dcp: endpoint {
remote-endpoint = <&dcp_typec0>;
};
};
};
};

&typec1 {
ports {
port@3 {
reg = <3>;
typec1_dcp: endpoint {
remote-endpoint = <&dcp_typec1>;
};
};
};
};

/*
* Keep the power-domains used for the HDMI port on.
* Keep the power-domains used for the HDMI port on (disp0 stays always-on
* from t8112.dtsi).
*/
&framebuffer0 {
power-domains = <&ps_dispext_cpu0>, <&ps_dptx_ext_phy>;
};

/*
* The M2 Mac mini uses dispext for the HDMI output so it's not necessary to
* keep disp0 power-domains always-on.
*/
&ps_disp0_sys {
/delete-property/ apple,always-on;
};

&ps_disp0_fe {
/delete-property/ apple,always-on;
power-domains = <&ps_disp0_cpu0>, <&ps_dptx_ext_phy>;
};

/*
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/apple/afk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1888,7 +1888,8 @@ static void afk_recv_handle_init(struct apple_dcp_afkep *ep, u32 channel,
(ep->dcp->fw_compat == DCP_FIRMWARE_V_27_0 &&
ep->dcp->hw.firmware_compat == DCP_FIRMWARE_H17P) ||
ep->dcp->v27_j714s ||
(ep->dcp->fw_compat == DCP_FIRMWARE_V_27_0 && ep->dcp->dcpext) ||
(ep->dcp->fw_compat == DCP_FIRMWARE_V_27_0 &&
dcp_has_external_output(ep->dcp)) ||
(ep->dcp->v27_sleep_transport && !strcmp(name, "md-manager")))) {
/*
* H17G and firmware-27 T8142 can omit EPIC identity
Expand Down
10 changes: 10 additions & 0 deletions drivers/gpu/drm/apple/dcp-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,16 @@ static inline bool dcp_is_v27_external(const struct apple_dcp *dcp)
dcp->hw.dptx_endpoint == DPTX_ENDPOINT_V2;
}

/*
* A DCP that drives an external connector: an external processor, Type-C
* display routes, or a fixed DP/HDMI PHY in its device tree node (a primary
* DCP can own the fixed HDMI route, as on the M2 Mac mini).
*/
static inline bool dcp_has_external_output(const struct apple_dcp *dcp)
{
return dcp->dcpext || dcp->nr_typec_routes || dcp->fixed_phy;
}

/* The 14.7 internal panel (J514S/J516S), presented through DCPLink. */
static inline bool dcp_is_v14_7_panel(const struct apple_dcp *dcp)
{
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5100,7 +5100,7 @@ static int dcp_ext26_start_services(struct apple_dcp *dcp)
static void dcp_v27_dptx_layout(struct apple_dcp *dcp)
{
if (dcp->fw_compat != DCP_FIRMWARE_V_27_0 ||
(!dcp->dcpext && !dcp->nr_typec_routes) || dcp->hw.dptx_endpoint)
!dcp_has_external_output(dcp) || dcp->hw.dptx_endpoint)
return;
if (!apple_rtkit_has_endpoint(dcp->rtk, DPTX_CONTROLLER_ENDPOINT) ||
!apple_rtkit_has_endpoint(dcp->rtk, DPTX_ENDPOINT))
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/apple/dptxep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ int dptxep_init(struct apple_dcp *dcp)
*/
if (dcp_fw_is_14_7(dcp) || dcp_is_ext26(dcp) ||
(dcp->fw_compat == DCP_FIRMWARE_V_27_0 &&
(dcp->dcpext || dcp->nr_typec_routes))) {
dcp_has_external_output(dcp))) {
dev_info(dcp->dev,
"DPTX port %u not announced yet\n", port);
return 0;
Expand Down
Loading