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
182 changes: 182 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k114-k116-usb.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The K114c, K114s, K116c and K116s USB-C ports ATC1 (left-front) and ATC2 (right):
* USB 2/3 and the PD controllers. A board file includes this after
* t6050-peripherals.dtsi, which describes nub-spmi-a1 for these boards.
*
* From the boards' ADT, the same on all four:
* ATC0 usb-drd0 left-back hpm0 nub-spmi-a0 0x0c (the boot link's debug port, not described)
* ATC1 usb-drd1 left-front hpm1 nub-spmi-a0 0x0a, port-number 2, acio-parent acio1
* ATC2 usb-drd2 right hpm2 nub-spmi-a1 0x0c, port-number 3, acio-parent acio2
* hpm5 nub-spmi-a0 0x08 (MagSafe, not a USB-C connector)
* The PD controllers are SN201202x. The USB4/Thunderbolt routers (acio1, acio2) and the
* DisplayPort routes are not described here; the PHYs run in USB mode. The combo PHY driver
* leaves ATC0 alone on purpose (apple,port-index 0).
*
* The boot loader fills the PHYs' tunables from the ADT through the atcphy aliases.
*/
/ {
aliases {
atcphy1 = &atc1_phy;
atcphy2 = &atc2_phy;
};
};

/* ==== The left-front USB-C port (ATC1) ==== */
&nub_spmi_a0 {
status = "okay";

hpm1: usb-pd@a {
compatible = "apple,sn201202x";
reg = <0xa SPMI_USID>;

connector {
compatible = "usb-c-connector";
label = "USB-C Left-front";
power-role = "dual";
data-role = "dual";

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

port@0 {
reg = <0>;
hpm1_hs: endpoint {
remote-endpoint = <&usb_drd1_hs>;
};
};

port@1 {
reg = <1>;
hpm1_ss: endpoint {
remote-endpoint = <&atc1_phy_ep>;
};
};
};
};
};
};

&atc1_phy_mbox {
status = "okay";
};

&atc1_phy {
status = "okay";

port {
atc1_phy_ep: endpoint {
remote-endpoint = <&hpm1_ss>;
};
};
};

&usb_drd1 {
status = "okay";

port {
usb_drd1_hs: endpoint {
remote-endpoint = <&hpm1_hs>;
};
};
};

&usb_drd1_dart_0 {
status = "okay";
};

&usb_drd1_dart_1 {
status = "okay";
};

/*
* ==== The right USB-C port (ATC2) ====
*
* The HPM is on its own bus, nub-spmi-a1, and nothing hands the port off, so the power
* domains, the PHY mailbox, the PHY, the DWC3 and its DARTs are enabled outright. The driver
* polls the generation 4 bus and refuses an interrupt on it.
*/
&ps_atc2_common {
status = "okay";
};

&ps_atc2_usb_aon {
status = "okay";
};

&ps_atc2_phymxwrap {
status = "okay";
};

&ps_atc2_usb {
status = "okay";
};

&atc2_phy_mbox {
status = "okay";
};

&atc2_phy {
status = "okay";

port {
atc2_phy_ep: endpoint {
remote-endpoint = <&hpm2_ss>;
};
};
};

&usb_drd2 {
status = "okay";

port {
usb_drd2_hs: endpoint {
remote-endpoint = <&hpm2_hs>;
};
};
};

&usb_drd2_dart_0 {
status = "okay";
};

&usb_drd2_dart_1 {
status = "okay";
};

&nub_spmi_a1 {
/delete-property/ interrupts;
status = "okay";

hpm2: usb-pd@c {
compatible = "apple,sn201202x";
reg = <0xc SPMI_USID>;

connector {
compatible = "usb-c-connector";
label = "USB-C Right";
power-role = "dual";
data-role = "dual";

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

port@0 {
reg = <0>;
hpm2_hs: endpoint {
remote-endpoint = <&usb_drd2_hs>;
};
};

port@1 {
reg = <1>;
hpm2_ss: endpoint {
remote-endpoint = <&atc2_phy_ep>;
};
};
};
};
};
};
106 changes: 73 additions & 33 deletions arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

aliases {
serial0 = &dockchannel;
/* The boot loader fills the N1's factory addresses through these */
wifi0 = &n1_alpha;
bluetooth0 = &n1_beta;
};

chosen {
Expand Down Expand Up @@ -78,35 +81,14 @@
};
};

/* ATC1, ATC3 and the PD controller buses nub-spmi-a0 and -a2: not yet described for these boards */
&nub_spmi_a0 {
status = "disabled";
};

/*
* ATC3 and the PD controller bus nub-spmi-a2: not described for these boards. The
* USB-C ports ATC1 and ATC2 are in t6050-k114-k116-usb.dtsi.
*/
&nub_spmi_a2 {
status = "disabled";
};

&atc1_phy_mbox {
status = "disabled";
};

&atc1_phy {
status = "disabled";
};

&usb_drd1 {
status = "disabled";
};

&usb_drd1_dart_0 {
status = "disabled";
};

&usb_drd1_dart_1 {
status = "disabled";
};

&atc3_phy_mbox {
status = "disabled";
};
Expand Down Expand Up @@ -137,23 +119,81 @@

/*
* As on J716c, where reading pin 112 takes an SError, only the pins a node
* here names are exposed, and none is yet. The N1 on PCIe port 0 needs its
* board's platform ID, which the static ADT does not carry, so the port and
* its PERST# pin stay unused for now.
* names are exposed: 80, PCIe port 0's PERST#, and 134 and 139, the jack
* codec's interrupt and reset. A board that names more pins replaces the list.
*/
&pinctrl_ap {
gpio-reserved-ranges = <0 221>;
gpio-reserved-ranges = <0 80>, <81 53>, <135 4>, <140 81>;
};

/*
* The K114s N1 needs its own platform ID (its ADT /chosen board-id << 16 | 0x6050)
* before the port can be described. aura's T6050 hand-off still wants the host's
* iommu-map to mark the ports as it found them, so carry it with the host disabled.
* PCIe port 0: the N1 (Wi-Fi and Bluetooth), the same on all four boards and
* laid out as on J716c: the boot loader trains the link and keeps power,
* clocks, the PHY and PERST; Linux owns the routing, MSI and the DART. The
* port stays disabled until the loader trains it. From the boards' ADT:
* apcie0 gives port 0's registers and IRQ 1523, pci-bridge0's PERST# is GPIO
* 80, and the N1's three functions are on DART streams 1-3.
*
* The board file defines, before including this file, the N1's personalized
* firmware (T6050_K_N1_FIRMWARE) and its ADT /chosen board-id
* (T6050_K_BOARD_ID). The N1's platform ID is board-id << 16 | chip 0x6050.
* aura's T6050 hand-off wants the host's iommu-map to mark the ports as it
* found them.
*/
&pcie0 {
iommu-map = <0x100 &dart_apcie0 1 3>;
bus-range = <0 4>;
status = "disabled";
status = "okay";
reg = <0x1c 0xb0000000 0x0 0x10000000>,
<0x4 0x14000000 0x0 0x4000>,
<0x4 0x10028000 0x0 0x8000>,
<0x4 0x17010000 0x0 0x4000>,
<0x4 0x10024000 0x0 0x4000>;
reg-names = "config", "rc", "port0", "phy0", "intr2axi0";
interrupts = <AIC_IRQ 0 1523 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "port0";

port00: pci@0,0 {
device_type = "pci";
reg = <0x0 0 0 0 0>;
bus-range = <1 1>;
apple,link-trained-by-bootloader;
/* PERST#, driven only by the root-port reset after the N1's ROM stage */
reset-gpios = <&pinctrl_ap 80 GPIO_ACTIVE_LOW>;
status = "disabled";

#address-cells = <3>;
#size-cells = <2>;
ranges;

interrupt-controller;
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 7>;
interrupt-map = <0 0 0 1 &port00 0 0 0 0>,
<0 0 0 2 &port00 0 0 0 1>,
<0 0 0 3 &port00 0 0 0 2>,
<0 0 0 4 &port00 0 0 0 3>;

n1_control: control@0,0 {
compatible = "pci106b,1900";
reg = <0x10000 0x0 0x0 0x0 0x0>;
firmware-name = T6050_K_N1_FIRMWARE;
apple,centauri-platform-id = <((T6050_K_BOARD_ID << 16) | 0x6050)>;
apple,centauri-protocol = <27>;
};

n1_alpha: wifi@0,1 {
compatible = "pci106b,1902";
reg = <0x10100 0x0 0x0 0x0 0x0>;
local-mac-address = [00 00 00 00 00 00];
};

n1_beta: bluetooth@0,2 {
compatible = "pci106b,1903";
reg = <0x10200 0x0 0x0 0x0 0x0>;
local-bd-address = [00 00 00 00 00 00];
};
};
};

/* These boards' SMC fan and power keys are not yet checked */
Expand Down
Loading
Loading