Skip to content
Open
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
17 changes: 15 additions & 2 deletions arch/arm64/boot/dts/apple/t8142-j813-gpu.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,18 @@
reg = <0x100 0x02444000 0x0 0x184000>;
};

/*
* Both roles' __TEXT, contiguous (ADT gfx-asc and gfx1-asc segment-ranges),
* which the driver identifies before it starts the firmware. Fixed at the
* macOS 27.0 address like fw-data, until the bootloader fills it in; under
* 27.2 (26B123) iBoot loads it at 0x100_00e5_4000 and the DATA at
* 0x100_0245_8000.
*/
gpu_fw_text: fw-text {
reg = <0x100 0x00e44000 0x0 0x9c000>;
no-map;
};

uat_handoff: uat-handoff {
reg = <0 0 0 0>;
};
Expand Down Expand Up @@ -105,9 +117,10 @@
power-domains = <&ps_gfx>;
memory-region = <&uat_ttbs>, <&uat_pagetables>, <&uat_handoff>,
<&uat_l2_pagetables>, <&gfx_data>, <&gfx1_data>,
<&gpu_fw_data>;
<&gpu_fw_data>, <&gpu_fw_text>;
memory-region-names = "ttbs", "pagetables", "handoff",
"shared-l2", "gfx-data", "gfx1-data", "fw-data";
"shared-l2", "gfx-data", "gfx1-data", "fw-data",
"fw-text";
operating-points-v2 = <&gpu_opp>;
/* Holds the DCS and fabric floor while GPU work is in flight. */
apple,clpc = <&clpc>;
Expand Down
5 changes: 3 additions & 2 deletions drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5260,11 +5260,12 @@ static enum dcp_firmware_version dcp_check_firmware_version(struct device *dev)
* T8142 (J813) on macOS 27.0: the H17P interface written for its 26.x
* firmware makes the 27.0 DCP firmware panic right after the first
* hotplug ("ap_link: callback failed with: 0x5"). It runs the T6050's
* firmware-27 generation.
* firmware-27 generation, and so does 27.2, with the 27.2 method table.
*/
if (of_device_is_compatible(dev->of_node, "apple,t8142-dcp")) {
ret = dcp_read_fw_version(dev, "apple,firmware-compat", compat_str);
if (ret >= 0 && !strcmp(compat_str, "27.0.0"))
if (ret >= 0 && (!strcmp(compat_str, "27.0.0") ||
!strcmp(compat_str, "27.2.0")))
return DCP_FIRMWARE_V_27_0;
}

Expand Down
7 changes: 4 additions & 3 deletions drivers/gpu/drm/apple/iomfb_v27.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ static const struct dcp_method_entry dcp_methods_27_0[dcpep_num_methods] = {
* A400/A401, so IOMobileFramebufferAP moved up by 50 (start_signal A451,
* get_color_remap_mode A477), and set_create_DFB and vi_set_temperature_hint
* up by one. The UPPipe A0xx and A1xx IDs are unchanged. The firmware rejects
* an unknown tag with a panic ("link_rpc_lookup callback not found"), so
* dfb_ready_query, whose 27.2 tag has not been seen in a call, has no entry
* here and is not sent to this build (boot_5()).
* an unknown tag with a panic ("link_rpc_lookup callback not found").
* dfb_ready_query is A385, one above its 27.0 ID: the 27.3 trace sends it
* there, and the J813's DCP answers it at A385 on 27.2.
*/
static const struct dcp_method_entry dcp_methods_27_2[dcpep_num_methods] = {
IOMFB_METHOD("A000", dcpep_late_init_signal),
Expand All @@ -147,6 +147,7 @@ static const struct dcp_method_entry dcp_methods_27_2[dcpep_num_methods] = {
IOMFB_METHOD("A104", dcpep_set_dfb_dimensions),
IOMFB_METHOD("A105", dcpep_commit_dfb_info),
IOMFB_METHOD("A035", dcpep_dfb_query),
IOMFB_METHOD("A385", dcpep_dfb_ready_query),
IOMFB_METHOD("A353", dcpep_pipe_query_353),
IOMFB_METHOD("A352", dcpep_pipe_set_352),
IOMFB_METHOD("A465", dcpep_pipe_cfg_415),
Expand Down
28 changes: 28 additions & 0 deletions drivers/gpu/drm/asahi/fwid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,4 +585,32 @@ mod tests {
assert!(admit(t, d, &e[..1], h).is_none());
}
}

#[test]
fn t8142_identifies_each_build() {
use crate::g17::fw::m5::initdata::RootProfile;
let crate::g17::fw::variant::Firmware::Identified(builds) = crate::hw::t8142::CONFIG.firmware
else {
panic!("the J813 must identify its loaded firmware");
};
assert_eq!(builds.len(), 2);
// Same TEXT and DATA sizes for both builds, so each is told apart by its digest at its
// own record offsets.
t6050_admits_only(builds);
let [a428, b123] = [&builds[0].images[0], &builds[1].images[0]];
for (image, other) in [(a428, builds[1].images), (b123, builds[0].images)] {
assert!(lookup(other, image.text_size, image.data_size, |_| {
Some(image.text_sha256)
})
.is_none());
}
// 26A428 runs the board as probed; 26B123 runs it on the 26B123 graph.
assert!(builds[0].config.is_none());
let config = builds[1].config.unwrap();
assert_eq!(config.m5.unwrap().graph.profile, RootProfile::J873G18G26B123);
assert_eq!(
crate::hw::t8142::CONFIG.m5.unwrap().graph.profile,
RootProfile::J873G18G26A428
);
}
}
Loading
Loading