Skip to content
Merged
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
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
/dts-v1/;

#define T6050_J714C
/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */
#include "t6050-soc-max.dtsi"
/* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */
#define T6050_ATC2_USB4_ROUTER
#include <dt-bindings/leds/common.h>
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/dts-v1/;

#define T6050_J716C
/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */
#include "t6050-soc-max.dtsi"
/* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */
#define T6050_ATC2_USB4_ROUTER
#include "t6050-max.dtsi"
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j775c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@
};

#define T6050_J775C
/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */
#include "t6050-soc-max.dtsi"
#include "t6050-peripherals.dtsi"
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j775d.dts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@
};

#define T6050_J775D
/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */
#include "t6050-soc-max.dtsi"
#include "t6050-peripherals.dtsi"

/*
Expand Down
134 changes: 124 additions & 10 deletions arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@

/*
* As on J716c, where reading pin 112 takes an SError, only the pins a node
* 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.
* names are exposed: 80 and 81, PCIe ports 0 and 1'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 80>, <81 53>, <135 4>, <140 81>;
gpio-reserved-ranges = <0 80>, <82 52>, <135 4>, <140 81>;
};

/*
Expand All @@ -141,19 +142,48 @@
* (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.
*
* PCIe port 1: the SD card reader (ADT apcie0/pci-bridge1/pcie-sdreader, a
* GL9755), the same on all four boards' ADTs and laid out as on J714s. The
* boot loader leaves the port down, so the kernel trains it. From the ADTs:
* port1, phy1, intr2axi1: apcie0 reg[22], reg[24], reg[25] (port 0's are
* reg[16], reg[18], reg[19]), behind /arm-io's ranges (+0x200000000)
* phy-shared: apcie0 reg[3], the shared PHY's state, which the train reads;
* the boot loader leaves the PHY up with port 0
* IRQ 1531: apcie0 interrupts[1]
* PERST#: pci-bridge1 function-perst, gpio0 pin 0x51 (81)
* power: pcie-sdreader function-sd_pwr_en, SMC pcIO (0x0, 0x190000), output
* 3 of smc_pcio below
* link tunables: pci-bridge1's apcie-config-tunables, pcie-rc-tunables and
* pcie-rc-gen{3,4,5}-shadow-tunables, as (offset, size, mask, value)
* The reader is behind dart-apcie1 (0x211000000, IRQ 1532; manual-availability:
* it answers only once the root complex is up). The ADT's mapper-apcie1 names
* no stream (the bridge requests one at run time), so stream 1 is this tree's
* choice, below the DART's first bypass stream (16), as on J714s.
* pci-bridge1's function-clkreq (gpio0 pin 0x4d) is not described: the
* driver does not take CLKREQ# lines.
*/
&pcie0 {
iommu-map = <0x100 &dart_apcie0 1 3>;
iommu-map = <0x100 &dart_apcie0 1 3>,
<0x200 &dart_apcie1 1 1>;
bus-range = <0 4>;
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";
<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";
/* 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 @@ -196,6 +226,87 @@
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;
/* ADT pcie-sdreader function-sd_pwr_en: SMC pcIO output 3 below */
pwren-gpios = <&smc_pcio 3 GPIO_ACTIVE_HIGH>;
/* PERST#: ADT pci-bridge1 function-perst, GPIO 81 */
reset-gpios = <&pinctrl_ap 81 GPIO_ACTIVE_LOW>;
/* ADT pci-bridge1 */
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 are active high: ADT
* pcie-sdreader card-detect-polarity and write-protect-polarity = 1.
*/
sdhci0: mmc@0,0 {
compatible = "pci17a0,9755";
reg = <0x20000 0x0 0x0 0x0 0x0>;
cd-inverted;
wp-inverted;
};
};
};

/*
* ADT dart-apcie1 manual-availability: pcie-apple enables it once port 1 is up. It sits in
* the same apcie block as port 0's DART and takes the same APCIE_SYS_GP (enabled in
* t6050-k114-k116-usb.dtsi), as the T6040's apcie1_dart at the same address does.
*/
&dart_apcie1 {
power-domains = <&ps_apcie_sys_gp>;
apple,manual-availability;
status = "okay";
};

/*
* The PMU's RTC and its alarm. The four boards' ADTs (27.2) give the PMU
* (nub-spmi0/spmi-abbeyL1) the same registers: info-rtc (0x2002),
* info-rtc_alarm_offset (0x2008), info-rtc_irq_mask_offset (0x200e),
* info-rtc_alarm_ctrl (0x2000) and info-rtc_scrpad (0x2100), the registers of
* the T6041 PMU. It raises no interrupt on this SoC: an armed alarm can only
* wake the machine from a firmware sleep, not from s2idle.
*/
&pmu {
pmu_rtc: rtc {
compatible = "apple,t6050-pmu-rtc", "apple,t6041-pmu-rtc";
nvmem-cells = <&rtc_offset>;
nvmem-cell-names = "rtc_offset";
wakeup-source;
};
};

/* These boards' SMC fan and power keys are not yet checked */
Expand Down Expand Up @@ -301,10 +412,13 @@
/*
* The board's pcIO outputs, from the ADT: dp2hdmi_pwr_en pKW8('pcIO', 0, 0x1a0000),
* hdmi_pwr_en pKW8('pcIO', 0x800000, 0xf0000), and the trackpad AFE reset (2),
* pKW8('pcIO', 0x10000, 0x11c0000); the same as on J716c.
* pKW8('pcIO', 0x10000, 0x11c0000), the same as on J716c; then the SD reader's
* power (3), sd_pwr_en pKW8('pcIO', 0x0, 0x190000): ADT pcie-sdreader
* function-sd_pwr_en.
*/
&smc_pcio {
apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 0x011c000000010000>;
apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000
0x011c000000010000 0x0019000000000000>;
};

/*
Expand Down
9 changes: 5 additions & 4 deletions arch/arm64/boot/dts/apple/t6050-k114.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@

/*
* Pin 112's register takes an SError when read, so only the pins a node names are
* exposed: 80 (PCIe port 0's PERST#); 106 and 107, the speaker amps' interrupt and
* shutdown line (ADT audio-speaker, used only where a board describes the amps);
* 134 and 139, the jack codec's interrupt and reset; 136 and 137, the speaker ID.
* exposed: 80 and 81 (PCIe ports 0 and 1's PERST#); 106 and 107, the speaker amps'
* interrupt and shutdown line (ADT audio-speaker, used only where a board describes
* the amps); 134 and 139, the jack codec's interrupt and reset; 136 and 137, the
* speaker ID.
*/
&pinctrl_ap {
gpio-reserved-ranges = <0 80>, <81 25>, <108 26>, <135 1>, <138 1>, <140 81>;
gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <138 1>, <140 81>;
};

/*
Expand Down
104 changes: 2 additions & 102 deletions arch/arm64/boot/dts/apple/t6050-k114c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/* Defined before the includes: t6050-max.dtsi guards the ATC2 router on it. */
#define T6050_K114C
/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */
#include "t6050-soc-max.dtsi"
/* ADT /arm-io/acio2: the right port's USB4/Thunderbolt router */
#define T6050_ATC2_USB4_ROUTER
/* The N1's firmware and this board's ADT board-id, for t6050-k114-k116.dtsi */
Expand Down Expand Up @@ -206,105 +208,3 @@
*/
#include "t6050-k114-k116-usb.dtsi"
#include "t6050-k114-usb.dtsi"

/*
* PCIe port 1: the SD card reader, this board's own beside the shared port 0
* (t6050-k114-k116.dtsi): its registers, interrupt and DART stream 1 of dart-apcie1.
*/
&pcie0 {
reg = <0x1c 0xb0000000 0x0 0x10000000>,
<0x4 0x14000000 0x0 0x4000>,
<0x4 0x10028000 0x0 0x8000>,
<0x4 0x17010000 0x0 0x4000>,
<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";
iommu-map = <0x100 &dart_apcie0 1 3>,
<0x200 &dart_apcie1 1 1>;
/* dart_apcie1 probes only once port 1 is up: the host must not wait for it */
post-init-providers = <&dart_apcie1>;

/*
* PCIe port 1: the SD card reader (ADT pci-bridge1/pcie-sdreader, a GL9755), as on
* J714s. The boot loader leaves it down, so the kernel trains it: power is the SMC
* pcIO output of function-sd_pwr_en (index 3 below), PERST# GPIO 81, IRQ 1531. It is
* on stream 1 of dart-apcie1. The link tunables are pci-bridge1's, as on port 0.
*/
port01: pci@1,0 {
device_type = "pci";
reg = <0x800 0 0 0 0>;
bus-range = <2 2>;
apple,link-trained-by-bootloader;
pwren-gpios = <&smc_pcio 3 GPIO_ACTIVE_HIGH>;
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;
};
};
};

/*
* Pin 112's register takes an SError when read, so only the pins a node here
* names are exposed: 80 and 81 (PCIe ports 0 and 1's PERST#); 106 and 107, the speaker
* amps' interrupt and shutdown line; 134 and 139, the jack codec's interrupt and
* reset; 136 and 137, the speaker ID.
*/
&pinctrl_ap {
gpio-reserved-ranges = <0 80>, <82 24>, <108 26>, <135 1>, <138 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 board's pcIO outputs (t6050-k114-k116.dtsi lists indices 0 to 2), plus index 3,
* sd_pwr_en pKW8('pcIO', 0x0, 0x190000): ADT pcie-sdreader function-sd_pwr_en.
*/
&smc_pcio {
apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000
0x011c000000010000 0x0019000000000000>;
};
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k116c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
};

#define T6050_K116C
/* The M5 Max die-0 blocks (nub-spmi1, nub-spmi4) */
#include "t6050-soc-max.dtsi"
#include "t6050-peripherals.dtsi"

/* The GPU, handed over by the boot loader */
Expand Down
Loading
Loading