diff --git a/arch/arm64/boot/dts/apple/t6050-atc1-dp-tunnel.dtsi b/arch/arm64/boot/dts/apple/t6050-atc1-dp-tunnel.dtsi new file mode 100644 index 0000000000000..38ce8c0374469 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-atc1-dp-tunnel.dtsi @@ -0,0 +1,55 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * The left-front port's (ATC1) USB4 DisplayPort tunnel clocks on T6050, as the right port's + * (t6050-atc2-dp-tunnel.dtsi): the PHY's DP IN pixel clock sources (dp-clock-source), their four + * clock gates, the PHY's dp0..dp3 power domains, and the router's DP IN interrupts (ADT + * atc1-dpin0..3). Without the clock sources a display behind a USB4/Thunderbolt dock or enclosure + * on this port stays dark. Addresses and interrupts are the T6050's (J714sAP and K114sAP ADT + * agree). For boards that describe the ATC1 router (acio1): J714s (t6050-j714s-display.dtsi), + * K114s and K114c (t6050-k114-usb.dtsi). + */ + +&ps_atc1_common_dp_0 { + status = "okay"; +}; + +&ps_atc1_common_dp_1 { + status = "okay"; +}; + +&ps_atc1_common_dp_2 { + status = "okay"; +}; + +&ps_atc1_common_dp_3 { + status = "okay"; +}; + +&atc1_phy { + reg = <0x2 0xab000000 0x0 0x2c000>, + <0x2 0xaaa90000 0x0 0x4000>, + <0x2 0xaa800000 0x0 0x4000>, + <0x2 0xab200000 0x0 0x4000>, + <0x2 0xab244000 0x0 0x4000>, + <0x2 0xa8000000 0x0 0x8000>, + <0x2 0xa8020000 0x0 0x4000>, + <0x2 0xab250000 0x0 0x4000>, + <0x2 0xab140000 0x0 0x4000>, + <0x2 0xab0c0000 0x0 0x10000>, + <0x2 0xaaa84000 0x0 0x4000>, + <0x2 0x80000058 0x0 0x10>; + reg-names = "core", "usb2phy", "usb2-digital", "reset", "fabric", "axi2af", "lioa", + "common-cfg", "usb-control", "firmware-data", "pipehandler", + "dp-clock-source"; + power-domains = <&ps_atc1_usb_aon>, <&ps_atc1_common>, <&ps_atc1_phymxwrap>, + <&ps_atc1_usb>, <&ps_atc1_common_dp_0>, <&ps_atc1_common_dp_1>, + <&ps_atc1_common_dp_2>, <&ps_atc1_common_dp_3>; + power-domain-names = "usb-aon", "common", "wrapper", "usb", "dp0", "dp1", "dp2", "dp3"; +}; + +/* The left-front router's DP IN interrupts (ADT atc1-dpin0..3) */ +&acio1 { + interrupts = , , + , ; + interrupt-names = "dpin0", "dpin1", "dpin2", "dpin3"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-j714s-display.dtsi b/arch/arm64/boot/dts/apple/t6050-j714s-display.dtsi index 78b2e3a54aa7d..f5728882e70b8 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s-display.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-j714s-display.dtsi @@ -279,21 +279,7 @@ #include "t6050-atc2-dp-tunnel.dtsi" -&ps_atc1_common_dp_0 { - status = "okay"; -}; - -&ps_atc1_common_dp_1 { - status = "okay"; -}; - -&ps_atc1_common_dp_2 { - status = "okay"; -}; - -&ps_atc1_common_dp_3 { - status = "okay"; -}; +#include "t6050-atc1-dp-tunnel.dtsi" /* The left-back crossbar (the inventory's, as atc1_dpxbar) and the PHY's tunnel clock gates */ &atc0_dpxbar { @@ -316,28 +302,6 @@ status = "disabled"; }; -&atc1_phy { - reg = <0x2 0xab000000 0x0 0x2c000>, - <0x2 0xaaa90000 0x0 0x4000>, - <0x2 0xaa800000 0x0 0x4000>, - <0x2 0xab200000 0x0 0x4000>, - <0x2 0xab244000 0x0 0x4000>, - <0x2 0xa8000000 0x0 0x8000>, - <0x2 0xa8020000 0x0 0x4000>, - <0x2 0xab250000 0x0 0x4000>, - <0x2 0xab140000 0x0 0x4000>, - <0x2 0xab0c0000 0x0 0x10000>, - <0x2 0xaaa84000 0x0 0x4000>, - <0x2 0x80000058 0x0 0x10>; - reg-names = "core", "usb2phy", "usb2-digital", "reset", "fabric", "axi2af", "lioa", - "common-cfg", "usb-control", "firmware-data", "pipehandler", - "dp-clock-source"; - power-domains = <&ps_atc1_usb_aon>, <&ps_atc1_common>, <&ps_atc1_phymxwrap>, - <&ps_atc1_usb>, <&ps_atc1_common_dp_0>, <&ps_atc1_common_dp_1>, - <&ps_atc1_common_dp_2>, <&ps_atc1_common_dp_3>; - power-domain-names = "usb-aon", "common", "wrapper", "usb", "dp0", "dp1", "dp2", "dp3"; -}; - /* The left-back PHY's tunnel clock gates, as the other ports' */ &atc0_phy { power-domains = <&ps_atc0_usb_aon>, <&ps_atc0_common>, <&ps_atc0_phymxwrap>, @@ -346,13 +310,6 @@ power-domain-names = "usb-aon", "common", "wrapper", "usb", "dp0", "dp1", "dp2", "dp3"; }; -/* The left-front router's DP IN interrupts (atc1-dpin0..3, as in the T6050 inventory and J716c) */ -&acio1 { - interrupts = , , - , ; - interrupt-names = "dpin0", "dpin1", "dpin2", "dpin3"; -}; - /* The right router's suppliers, disabled in the inventory */ &ps_atc2_cio { status = "okay"; diff --git a/arch/arm64/boot/dts/apple/t6050-j714s-left-usb4.dtsi b/arch/arm64/boot/dts/apple/t6050-j714s-left-usb4.dtsi index 081f17d51e47e..b296876ba1f0e 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s-left-usb4.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-j714s-left-usb4.dtsi @@ -6,6 +6,8 @@ * addresses and interrupts (/arm-io/acio1, acio-cpu1, dart-acio1, apciec1, dart-apciec1). Like * the right port's (t6050-max-atc2.dtsi), it is powered per connection and nothing is touched at * boot. The router, DART and tunnel tunables are this board's, from its ADT; they equal ATC2's. + * The K114s ADT has the same router nodes: t6050-k114-usb.dtsi includes this for the K114s + * and K114c. */ &ps_atc1_cio { @@ -191,7 +193,6 @@ reg-names = "config", "rc", "port0", "fabric", "debug", "ltssm", "intr2axi"; /* The port's: link events and INTx */ interrupts = ; - interrupt-names = "port0"; power-domains = <&ps_atc1_pcie>; /* No boot loader hands the port over: the kernel cold-initializes it. */ apple,pciec-kernel-init; diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116-usb.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116-usb.dtsi index 87b16d9a0429a..8a025b08f5a7b 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-k116-usb.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116-usb.dtsi @@ -30,7 +30,7 @@ compatible = "apple,sn201202x"; reg = <0xa SPMI_USID>; - connector { + typec1: connector { compatible = "usb-c-connector"; label = "USB-C Left-front"; power-role = "dual"; diff --git a/arch/arm64/boot/dts/apple/t6050-k114-usb.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-usb.dtsi index f81effbbb60b2..2dc4d18a855a9 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-usb.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-usb.dtsi @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-2.0+ OR MIT /* * The 14-inch K boards' ports beyond t6050-k114-k116-usb.dtsi: the MagSafe 3 PD controller - * on nub-spmi-a0 and ATC2's USB4/Thunderbolt router with its PCIe tunnel. The live K114s ADT - * (27.2) and the K114c's have the same nodes and values here, phandles aside. + * on nub-spmi-a0 and the USB4/Thunderbolt routers of ATC2 (right) and ATC1 (left-front) with + * their PCIe tunnels and DisplayPort tunnel clocks. The live K114s ADT (27.2) and the K114c's + * have the same nodes and values here, phandles aside. * * Included after t6050-k114-k116-usb.dtsi. t6050-max.dtsi describes the ATC2 router for the * boards that define T6050_K114C or T6050_K114S before including it. @@ -86,3 +87,18 @@ <&ps_atc2_cio_usb>, <&ps_atc2_cio_auss>, <&ps_atc2_pcie>; apple,pcie-tunnel = <&acio2_pcie_tunnel>; }; + +/* + * The left-front port's USB4/Thunderbolt router (acio1) and PCIe tunnel, and its DisplayPort + * tunnels, as on J714s: the K114s ADT's acio1, acio-cpu1, dart-acio1, apciec1, dart-apciec1 and + * atc1-dpin0..3 equal the J714sAP ADT's (host DROM and LSTX pin included), phandles aside, and + * so do atc-phy1's CIO RX_TOP tunables. (The K116s's RX_TOP tunables differ.) Without it a + * Thunderbolt dock or enclosure on this port gets USB only, and no DP or PCIe tunnel. + */ +#include "t6050-j714s-left-usb4.dtsi" +#include "t6050-atc1-dp-tunnel.dtsi" + +/* The LSTX pins of both routers: 79 (acio1) and 81 (acio2) */ +&pinctrl_aop { + gpio-reserved-ranges = <0 79>, <80 1>, <82 3>; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-k114c.dts b/arch/arm64/boot/dts/apple/t6050-k114c.dts index bb92a59450028..6b520df52d695 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -16,6 +16,8 @@ #include "t6050-soc-max.dtsi" /* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */ #define T6050_ATC2_USB4_ROUTER +/* ADT /arm-io/acio1: the left-front port's USB4/Thunderbolt router (t6050-k114-usb.dtsi) */ +#define T6050_ATC1_USB4_ROUTER /* The N1's firmware and this board's ADT board-id, for t6050-k114-k116.dtsi */ #define T6050_K_N1_FIRMWARE "apple/centauri/k114c-ftab.bin" #define T6050_K_BOARD_ID 0x04 diff --git a/arch/arm64/boot/dts/apple/t6050-k114s.dts b/arch/arm64/boot/dts/apple/t6050-k114s.dts index fdf02afb0530e..9e53a7486be0d 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114s.dts @@ -14,6 +14,8 @@ #define T6050_K114S /* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */ #define T6050_ATC2_USB4_ROUTER +/* ADT /arm-io/acio1: the left-front port's USB4/Thunderbolt router (t6050-k114-usb.dtsi) */ +#define T6050_ATC1_USB4_ROUTER /* The N1's firmware and this board's ADT board-id, for t6050-k114-k116.dtsi */ #define T6050_K_N1_FIRMWARE "apple/centauri/k114s-ftab.bin" #define T6050_K_BOARD_ID 0x14 diff --git a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi index f4472ddf9eba4..60c353b53780d 100644 --- a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi @@ -1598,7 +1598,8 @@ status = "disabled"; }; -#if !defined(T6050_J714S) && !defined(T6050_J716C) +/* Boards describing ATC1's USB4 router describe this DART with its PCIe tunnel instead. */ +#if !defined(T6050_J714S) && !defined(T6050_J716C) && !defined(T6050_ATC1_USB4_ROUTER) apciec1_dart: iommu@2ac000000 { compatible = "apple,t6050-dart", "apple,t8110-dart"; reg = <0x2 0xac000000 0x0 0x20000>;