diff --git a/drivers/gpu/drm/asahi/fwid.rs b/drivers/gpu/drm/asahi/fwid.rs index c7d2e84797cfb..c7b362a4e016c 100644 --- a/drivers/gpu/drm/asahi/fwid.rs +++ b/drivers/gpu/drm/asahi/fwid.rs @@ -545,6 +545,21 @@ mod tests { assert!(measured(builds, 0x13c000, &[[0x5c8df, 0x5c9c2]], [0; 32]).is_none()); } + #[cfg(CONFIG_DRM_ASAHI_G16)] + #[test] + fn j773g_accepts_its_loaded_image() { + let builds = crate::g16::hw::t8132::CONFIG.firmware; + let digest = [ + 0x91, 0x54, 0xc7, 0xf8, 0x4b, 0xce, 0x32, 0x15, 0x1e, 0x8a, 0x97, 0x41, 0x7d, 0x6a, + 0x20, 0x7a, 0x9e, 0xaf, 0x03, 0x54, 0xb4, 0xb8, 0xd6, 0xf0, 0x2a, 0xf5, 0x29, 0x95, + 0x40, 0xd3, 0xe8, 0x5a, + ]; + let found = measured(builds, 0x13c000, &[[0x5c8df, 0x5c9c2]], digest).unwrap(); + assert_eq!(found.name, "Apple GFX 25G83 (normalized loaded image, J773g)"); + assert_eq!(found.boot_filled, &[(0x224, 4), (0x5c917, 8)]); + assert!(measured(builds, 0x138000, &[[0x5c8df, 0x5c9c2]], digest).is_none()); + } + #[test] fn t6050_admits_only_its_pinned_image() { for cfg in [ diff --git a/drivers/gpu/drm/asahi/g16/hw.rs b/drivers/gpu/drm/asahi/g16/hw.rs index 353199dea75a1..b66afcc3cdd83 100644 --- a/drivers/gpu/drm/asahi/g16/hw.rs +++ b/drivers/gpu/drm/asahi/g16/hw.rs @@ -20,7 +20,7 @@ pub(crate) struct HwId { pub(crate) use crate::fwid::FirmwareBuild; -/// The J713/T8132 configuration. Hardware admission also checks the exact TEXT image. +/// The J713/J773g T8132 configuration. Hardware admission also checks the exact TEXT image. pub(crate) mod t8132 { use super::super::Config; use super::{FirmwareBuild, HwId}; @@ -79,6 +79,21 @@ pub(crate) mod t8132 { 0xc8, 0x29, 0x86, 0x8b, 0xc9, 0xcf, ], }, + FirmwareBuild { + // The 25G83 image as loaded by iBoot on a J773g (Mac mini). iBoot rewrites + // the header word at 0x224 and the 8-byte DILS payload at 0x5c917 on every + // boot there; they are zeroed before hashing. + name: "Apple GFX 25G83 (normalized loaded image, J773g)", + text_size: 0x60000, + data_size: 0x13c000, + entropy: &[[0x5c8df, 0x5c9c2]], + boot_filled: &[(0x224, 4), (0x5c917, 8)], + text_sha256: [ + 0x91, 0x54, 0xc7, 0xf8, 0x4b, 0xce, 0x32, 0x15, 0x1e, 0x8a, 0x97, 0x41, 0x7d, + 0x6a, 0x20, 0x7a, 0x9e, 0xaf, 0x03, 0x54, 0xb4, 0xb8, 0xd6, 0xf0, 0x2a, 0xf5, + 0x29, 0x95, 0x40, 0xd3, 0xe8, 0x5a, + ], + }, ], }; }