Skip to content
Draft
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
51 changes: 41 additions & 10 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,34 @@
* PHY and PERST; Linux owns the routing, MSI and the DART. Disabled with its DART
* until the boot loader trains it, which also renumbers the bus here to the PCI
* core's order.
*
* PCIe port 1: the SD card reader (t6050-sdreader.dtsi), as on J714s. From this
* board's ADT: port1, phy1 and intr2axi1 are apcie0 reg[22], reg[24] and
* reg[25], phy-shared reg[3], its interrupt 1531 (apcie0 interrupts[1]). The
* boot loader leaves the port down and the kernel trains it.
*/
&pcie0 {
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";

/* The N1's three functions are on DART streams 1-3 */
iommu-map = <0x100 &dart_apcie0 1 3>;
<0x4 0x10024000 0x0 0x4000>,
<0x4 0x11028000 0x0 0x8000>,
<0x4 0x17014000 0x0 0x4000>,
<0x4 0x11024000 0x0 0x4000>,
<0x4 0x17020000 0x0 0x4000>;
reg-names = "config", "rc", "port0", "phy0", "intr2axi0", "port1", "phy1", "intr2axi1",
"phy-shared";
interrupts = <AIC_IRQ 0 1523 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1531 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "port0", "port1";

/* The N1's three functions are on DART streams 1-3, the SD reader on stream 1 */
iommu-map = <0x100 &dart_apcie0 1 3>,
<0x200 &dart_apcie1 1 1>;
bus-range = <0 4>;
/* dart_apcie1 probes only once port 1 is up: the host must not wait for it */
post-init-providers = <&dart_apcie1>;

port00: pci@0,0 {
device_type = "pci";
Expand Down Expand Up @@ -109,6 +123,13 @@
};
};

#include "t6050-sdreader.dtsi"

/* The SD reader's power: SMC pcIO output 0 below (ADT pcie-sdreader function-sd_pwr_en) */
&port01 {
pwren-gpios = <&smc_pcio 0 GPIO_ACTIVE_HIGH>;
};

/* ATC3 and the PD controller bus nub-spmi-a2: not on this board's ports */
&nub_spmi_a2 {
status = "disabled";
Expand Down Expand Up @@ -200,11 +221,21 @@

/*
* Only the pins a node here names are exposed, as on the J716c: pin 112's register
* takes an SError when read. 80 is PCIe port 0's PERST#, 106 the amps' fault interrupt and
* 107 their shutdown line.
* takes an SError when read. 80 and 81 are PCIe ports 0 and 1's PERST#, 106 the amps'
* fault interrupt and 107 their shutdown line.
*/
&pinctrl_ap {
gpio-reserved-ranges = <0 80>, <81 25>, <108 113>;
gpio-reserved-ranges = <0 80>, <82 24>, <108 113>;
};

/*
* The one SMC pcIO output this board drives, as a pKW8('pcIO', lo, hi) template
* written (hi << 32) | lo with the level in the low bits:
* 0 sd_pwr_en (0x0, 0x190000): ADT pcie-sdreader function-sd_pwr_en, the SD
* reader's power on PCIe port 1
*/
&smc_pcio {
apple,output-commands = /bits/ 64 <0x0019000000000000>;
};

/* This board's SMC fan and power keys are not yet checked */
Expand Down
77 changes: 24 additions & 53 deletions arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -146,54 +146,31 @@
local-bd-address = [00 00 00 00 00 00];
};
};
};

port01: pci@1,0 {
device_type = "pci";
reg = <0x800 0 0 0 0>;
bus-range = <2 2>;
/* Down at boot: the kernel trains it, powering the reader first */
apple,link-trained-by-bootloader;
pwren-gpios = <&smc_pcio 0 GPIO_ACTIVE_HIGH>;
/* PERST#: ADT pci-bridge1 function-perst, GPIO 81 */
reset-gpios = <&pinctrl_ap 81 GPIO_ACTIVE_LOW>;
apple,apcie-config-tunables = <0x140 4 0x1 0x1>,
<0x144 4 0xffffff 0x253770>,
<0x8a8 4 0x1 0x1>,
<0x8ac 4 0x1 0x1>;
apple,pcie-rc-tunables = <0x78 4 0x7000 0x0>,
<0x194 4 0x2 0x2>,
<0xb80 4 0x7f3f3f 0x7f1e1e>,
<0xb88 4 0x7f3f3f 0x7f1e1e>;
apple,pcie-rc-gen3-shadow-tunables = <0x154 4 0xf0f0f0f 0x5050505>,
<0x890 4 0x3000000 0x0>,
<0x8a8 4 0xffff0f 0x1>;
apple,pcie-rc-gen4-shadow-tunables = <0x178 4 0xffff 0x5555>,
<0x890 4 0x3000000 0x1000000>,
<0x8a8 4 0xffff0f 0x1>;
apple,pcie-rc-gen5-shadow-tunables = <0x1ac 4 0xffff 0x5555>,
<0x890 4 0x3000000 0x2000000>,
<0x8a8 4 0xffff0f 0x1>;

#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 &port01 0 0 0 0>,
<0 0 0 2 &port01 0 0 0 1>,
<0 0 0 3 &port01 0 0 0 2>,
<0 0 0 4 &port01 0 0 0 3>;

/* The GL9755; card detect and write protect active high (ADT *-polarity = 1) */
sdhci0: mmc@0,0 {
compatible = "pci17a0,9755";
reg = <0x20000 0x0 0x0 0x0 0x0>;
cd-inverted;
wp-inverted;
};
};
#include "t6050-sdreader.dtsi"

&port01 {
/* Down at boot: the kernel trains it, powering the reader first */
pwren-gpios = <&smc_pcio 0 GPIO_ACTIVE_HIGH>;
/* pci-bridge1's link tunables */
apple,apcie-config-tunables = <0x140 4 0x1 0x1>,
<0x144 4 0xffffff 0x253770>,
<0x8a8 4 0x1 0x1>,
<0x8ac 4 0x1 0x1>;
apple,pcie-rc-tunables = <0x78 4 0x7000 0x0>,
<0x194 4 0x2 0x2>,
<0xb80 4 0x7f3f3f 0x7f1e1e>,
<0xb88 4 0x7f3f3f 0x7f1e1e>;
apple,pcie-rc-gen3-shadow-tunables = <0x154 4 0xf0f0f0f 0x5050505>,
<0x890 4 0x3000000 0x0>,
<0x8a8 4 0xffff0f 0x1>;
apple,pcie-rc-gen4-shadow-tunables = <0x178 4 0xffff 0x5555>,
<0x890 4 0x3000000 0x1000000>,
<0x8a8 4 0xffff0f 0x1>;
apple,pcie-rc-gen5-shadow-tunables = <0x1ac 4 0xffff 0x5555>,
<0x890 4 0x3000000 0x2000000>,
<0x8a8 4 0xffff0f 0x1>;
};

/*
Expand All @@ -207,12 +184,6 @@
gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <140 81>;
};

/* It answers only once port 1's root complex is up: pcie-apple then enables it */
&dart_apcie1 {
apple,manual-availability;
status = "okay";
};

/* The keyboard backlight: ADT pwm0/kbd-backlight, channel 0 at 25 kHz */
/ {
aliases {
Expand Down
59 changes: 43 additions & 16 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,38 @@

/*
* PCIe port 0: the N1 (Wi-Fi and Bluetooth), the only GP port this board uses besides the SD
* reader on port 1 (not yet described). The boot loader trains the link after the SMC releases
* the N1's reset and keeps power, clocks, the PHY and PERST; Linux owns the routing, MSI and
* the DART. Disabled with its DART until the boot loader trains it, which also renumbers the
* bus here to the PCI core's order.
* reader on port 1. The boot loader trains the link after the SMC releases the N1's reset and
* keeps power, clocks, the PHY and PERST; Linux owns the routing, MSI and the DART. Disabled
* with its DART until the boot loader trains it, which also renumbers the bus here to the PCI
* core's order.
*
* PCIe port 1: the SD card reader (t6050-sdreader.dtsi), as on J714s. From this board's ADT:
* port1, phy1 and intr2axi1 are apcie0 reg[22], reg[24] and reg[25], phy-shared reg[3], its
* interrupt 1531 (apcie0 interrupts[1]). The boot loader leaves the port down and the kernel
* trains it.
*/
&pcie0 {
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";

/* The N1's three functions are on DART streams 1-3 */
iommu-map = <0x100 &dart_apcie0 1 3>;
<0x4 0x10024000 0x0 0x4000>,
<0x4 0x11028000 0x0 0x8000>,
<0x4 0x17014000 0x0 0x4000>,
<0x4 0x11024000 0x0 0x4000>,
<0x4 0x17020000 0x0 0x4000>;
reg-names = "config", "rc", "port0", "phy0", "intr2axi0", "port1", "phy1", "intr2axi1",
"phy-shared";
interrupts = <AIC_IRQ 0 1523 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1531 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "port0", "port1";

/* The N1's three functions are on DART streams 1-3, the SD reader on stream 1 */
iommu-map = <0x100 &dart_apcie0 1 3>,
<0x200 &dart_apcie1 1 1>;
bus-range = <0 4>;
/* dart_apcie1 probes only once port 1 is up: the host must not wait for it */
post-init-providers = <&dart_apcie1>;

port00: pci@0,0 {
device_type = "pci";
Expand Down Expand Up @@ -176,11 +190,12 @@

/*
* Pin 112's register (0x29c0001c0) takes an SError when read, so only the pins a node
* here names are exposed: 80 (PCIe port 0's PERST#, ADT pci-bridge0 function-perst).
* A reserved line cannot be requested, so a node that names a new pin opens it here too.
* here names are exposed: 80 and 81 (PCIe ports 0 and 1's PERST#, ADT pci-bridge0 and
* pci-bridge1 function-perst). A reserved line cannot be requested, so a node that names
* a new pin opens it here too.
*/
&pinctrl_ap {
gpio-reserved-ranges = <0 80>, <81 140>;
gpio-reserved-ranges = <0 80>, <82 139>;
};

/* This board's SMC fan and power keys are not yet checked */
Expand Down Expand Up @@ -226,13 +241,25 @@
};
};

/* This board's PCIO outputs, the trackpad AFE reset (2) among them */
/*
* This board's PCIO outputs, the trackpad AFE reset (2) among them, and the SD reader's
* power (3), sd_pwr_en pKW8('pcIO', 0x0, 0x190000)
*/
&smc_pcio {
apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 0x011c000000010000>;
apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 0x011c000000010000
0x0019000000000000>;
};

#include "t6050-peripherals.dtsi"

/* After the peripherals, which describe dart-apcie1 (disabled) at the same node */
#include "t6050-sdreader.dtsi"

/* The SD reader's power: SMC pcIO output 3 above (ADT pcie-sdreader function-sd_pwr_en) */
&port01 {
pwren-gpios = <&smc_pcio 3 GPIO_ACTIVE_HIGH>;
};

#include "t6050-max-atc2.dtsi"

/* This unit's host DROM (router UUID from an earlier boot) */
Expand Down
53 changes: 39 additions & 14 deletions arch/arm64/boot/dts/apple/t6050-j716s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
};

/*
* PCIe port 0: the N1 (Wi-Fi and Bluetooth). Port 1 is the SD reader, not yet
* described. The registers, interrupt, DART streams and PERST# pin are the
* PCIe port 0: the N1 (Wi-Fi and Bluetooth). The registers, interrupt, DART streams and PERST# pin are the
* J716c's: the J716s ADT has the same port. Port 0 and its DART stay disabled
* until the boot loader enables them: once it trained the port, or with the
* port down because the kernel can train it (port00 names the N1's power
Expand All @@ -92,6 +91,14 @@
* (reg[5]), pcieclkgen (reg[6]), phy-window (reg[2]) and phy-ip (reg[4]),
* the same as the J714c's; the PHY and axi2af windows are cut to what their
* lists reach.
*
* PCIe port 1: the SD card reader (t6050-sdreader.dtsi), as on J714s. From this
* board's ADT: port1, phy1 and intr2axi1 are apcie0 reg[22], reg[24] and
* reg[25], its interrupt 1531 (apcie0 interrupts[1]). The reader's power is
* the SMC pcIO output of the ADT's function-sd_pwr_en, but this board's SMC
* gpio node is the gP bank (the N1's power, below), so the kernel cannot
* drive it and does not train the port. Port 1 and its DART stay disabled
* until a boot loader that powers and trains the port enables both.
*/
&pcie0 {
reg = <0x1c 0xb0000000 0x0 0x10000000>,
Expand All @@ -104,21 +111,27 @@
<0x4 0x16000000 0x0 0x24000>,
<0x4 0x15044000 0x0 0x4000>,
<0x4 0x17000000 0x0 0x24000>,
<0x4 0x17800000 0x0 0x1b4000>;
<0x4 0x17800000 0x0 0x1b4000>,
<0x4 0x11028000 0x0 0x8000>,
<0x4 0x17014000 0x0 0x4000>,
<0x4 0x11024000 0x0 0x4000>;
reg-names = "config", "rc", "port0", "phy0", "intr2axi0",
"phy-shared", "phy-common", "axi2af", "pcieclkgen",
"phy-window", "phy-ip";
interrupts = <AIC_IRQ 0 1523 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "port0";

/* The N1's three functions are on DART streams 1-3 */
iommu-map = <0x100 &dart_apcie0 1 3>;
"phy-window", "phy-ip", "port1", "phy1", "intr2axi1";
interrupts = <AIC_IRQ 0 1523 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 1531 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "port0", "port1";

/* The N1's three functions are on DART streams 1-3, the SD reader on stream 1 */
iommu-map = <0x100 &dart_apcie0 1 3>,
<0x200 &dart_apcie1 1 1>;
bus-range = <0 4>;
/*
* dart_apcie0 probes only once this host has the port up: fw_devlink
* must not make the host wait for it (strict mode enforces iommu-map)
* dart_apcie0 and dart_apcie1 probe only once this host has their port
* up: fw_devlink must not make the host wait for them (strict mode
* enforces iommu-map)
*/
post-init-providers = <&dart_apcie0>;
post-init-providers = <&dart_apcie0>, <&dart_apcie1>;

port00: pci@0,0 {
device_type = "pci";
Expand Down Expand Up @@ -166,6 +179,17 @@
};
};

#include "t6050-sdreader.dtsi"

/* Down at boot: a boot loader that powers and trains port 1 enables both */
&port01 {
status = "disabled";
};

&dart_apcie1 {
status = "disabled";
};

/* It answers only once port 0's root complex is up: pcie-apple then enables it */
&dart_apcie0 {
apple,manual-availability;
Expand All @@ -178,6 +202,7 @@
* 0 dp2hdmi_pwr_en (0x0, 0x1a0000)
* 1 hdmi_pwr_en (0x800000, 0xf0000)
* 2 afe-reset (0x10000, 0x11c0000)
* and the SD reader's sd_pwr_en (0x0, 0x190000).
*/
/delete-node/ &smc_pcio;

Expand Down Expand Up @@ -456,10 +481,10 @@

/*
* Pin 112 takes an SError when read (as on the J716c), so only the pins a node
* here names are exposed: 80 (PCIe port 0's PERST#).
* here names are exposed: 80 and 81 (PCIe ports 0 and 1's PERST#).
*/
&pinctrl_ap {
gpio-reserved-ranges = <0 80>, <81 140>;
gpio-reserved-ranges = <0 80>, <82 139>;
};

/*
Expand Down
Loading
Loading