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
54 changes: 44 additions & 10 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,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 @@ -120,6 +134,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 @@ -211,11 +232,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>;
};

/*
Expand Down Expand Up @@ -543,3 +574,6 @@
&clpc {
apple,high-power-mode;
};

/* The SD card reader DART's power states (t6050-sdreader.dtsi) */
#include "t6050-sdreader-power.dtsi"
80 changes: 27 additions & 53 deletions arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -145,54 +145,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 @@ -206,12 +183,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 Expand Up @@ -841,3 +812,6 @@
&isp0 {
apple,camera-indicator = <&dcp>;
};

/* The SD card reader DART's power states (t6050-sdreader.dtsi) */
#include "t6050-sdreader-power.dtsi"
65 changes: 47 additions & 18 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,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 @@ -187,14 +201,14 @@

/*
* 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),
* 106 and 107 (the speaker amps' fault interrupt and shutdown line), 134 and 139 (the
* jack codec's interrupt and reset), 136 and 137 (speaker ID) and 138 (the Touch ID
* sensor's data-ready line).
* here names are exposed: 80 and 81 (PCIe ports 0 and 1's PERST#, ADT pci-bridge0 and
* pci-bridge1 function-perst), 106 and 107 (the speaker amps' fault interrupt and shutdown
* line), 134 and 139 (the jack codec's interrupt and reset), 136 and 137 (speaker ID) and
* 138 (the Touch ID sensor's data-ready line).
* 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 25>, <108 26>, <135 1>, <140 81>;
gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <140 81>;
};

/*
Expand Down Expand Up @@ -290,14 +304,26 @@
};
};

/* 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"
#include "t6050-media.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 Expand Up @@ -641,3 +667,6 @@
&clpc {
apple,high-power-mode;
};

/* The SD card reader DART's power states (t6050-sdreader.dtsi) */
#include "t6050-sdreader-power.dtsi"
Loading
Loading