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
117 changes: 117 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k114c-gpu.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* K114c (M5 Max, G17C) GPU, for the boot loader's GPU handoff. Everything here
* stays disabled: the loader checks the ADT and the live GPU firmware build,
* fills the GPU reservations, then enables the power states, both mailboxes and
* the GPU, the GPU last. A loader that refuses leaves the GPU off.
*
* Same layout as t6050-j714s-gpu-panel.dtsi; the GPU is G17C and, in the ADT,
* sgx and both GPU ASCs are the same as on the M5 Pro.
*/

/ {
aliases {
/* The loader finds the GPU through this alias */
gpu = &sgx;
};

reserved-memory {
/* Filled and enabled by the loader from the ADT */
gpu_fw_text: gpu-fw-text {
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

gpu_fw_data: gpu-fw-data {
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

uat_ttbs: uat-ttbs {
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

uat_pagetables: uat-pagetables {
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

uat_l2_pagetables: uat-l2-pagetables {
reg = <0 0 0 0>;
no-map;
status = "disabled";
};

uat_handoff: uat-handoff {
reg = <0 0 0 0>;
no-map;
status = "disabled";
};
};
};

/* The inventory ASC nodes; the mailboxes below describe the same windows. */
/delete-node/ &gfx_asc;
/delete-node/ &gfx1_asc;

&{/soc} {
/*
* ADT gfx-asc and gfx1-asc at their physical windows: the wrapper, the
* 8-byte iop-vbar, and their second and third interrupts (send-empty,
* recv-not-empty), as T8140/T8142.
*/
gfx_mbox: mailbox@2302600000 {
compatible = "apple,t6050-j775d-ascwrap-v6";
reg = <0x23 0x2600000 0x0 0x88000>,
<0x23 0x2050000 0x0 0x8>;
reg-names = "wrapper", "iop-vbar";
interrupts = <AIC_IRQ 0 2797 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 2800 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "recv-not-empty";
apple,firmware-role = "GFX";
power-domains = <&ps_gfx>;
#mbox-cells = <0>;
status = "disabled";
};

gfx1_mbox: mailbox@2302e00000 {
compatible = "apple,t6050-j775d-ascwrap-v6";
reg = <0x23 0x2e00000 0x0 0x88000>,
<0x23 0x2850000 0x0 0x8>;
reg-names = "wrapper", "iop-vbar";
interrupts = <AIC_IRQ 0 2801 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 2804 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "recv-not-empty";
apple,firmware-role = "GFX1";
power-domains = <&ps_gfx>;
#mbox-cells = <0>;
status = "disabled";
};
};

/* The ADT marks GPX and AFR, GFX's parents, critical. */
&ps_gpx {
apple,always-on;
};

&ps_afr {
apple,always-on;
};

&sgx {
compatible = "apple,agx-g17s";
/* ADT sgx reg[0]; the driver maps the first 16 MiB as "sgx" */
reg = <0x23 0x0 0x0 0x3fdc000>;
reg-names = "sgx";
/delete-property/ interrupts;
mboxes = <&gfx_mbox>, <&gfx1_mbox>;
memory-region = <&uat_ttbs>, <&uat_pagetables>, <&uat_handoff>,
<&gpu_fw_data>, <&uat_l2_pagetables>, <&gpu_fw_text>;
memory-region-names = "ttbs", "pagetables", "handoff", "fw-data",
"l2-pagetables", "fw-text";
};
83 changes: 83 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-k114c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,86 @@

#define T6050_K114C
#include "t6050-peripherals.dtsi"

/ {
aliases {
/* kboot fills the N1's factory addresses from /chosen through these */
wifi0 = &n1_alpha;
bluetooth0 = &n1_beta;
};
};

/*
* PCIe port 0: the N1 (Wi-Fi and Bluetooth), 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.
*/
&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>;
bus-range = <0 4>;
status = "okay";

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>;

/* platform ID (board 0x04 << 16) | chip 0x6050 */
n1_control: control@0,0 {
compatible = "pci106b,1900";
reg = <0x10000 0x0 0x0 0x0 0x0>;
firmware-name = "apple/centauri/k114c-ftab.bin";
apple,centauri-platform-id = <0x00046050>;
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];
};
};
};

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

#include "t6050-k114c-gpu.dtsi"
Loading