Skip to content
Closed
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
16 changes: 16 additions & 0 deletions drivers/gpu/drm/asahi/g15/hw.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT

//! G15 hardware and firmware-ABI constants (layout values are shared by several modules; change
Expand Down Expand Up @@ -177,6 +177,22 @@
0xe7, 0x9b, 0xb9, 0xb0, 0x22, 0x09, 0xdb, 0x53,
],
},
// Some J516S units on the same 14.7 boot chain load a different B0
// TEXT image with identical sizes and marker. Pin its complete
// measured digest for the J516S only.
FirmwareBuild {
name: "J516S cd05 firmware (14.7 boot chain)",
machine: Some(kernel::c_str!("apple,j516s")),
text_size: 0x5c000,
data_size: 0x114000,
marker: 0x58e88,
text_sha256: [
0xcd, 0x05, 0xaf, 0x6a, 0x82, 0x8b, 0x52, 0xe4,
0xc2, 0xfe, 0xd2, 0x00, 0x86, 0xd3, 0xd1, 0x8a,
0x7d, 0xb4, 0x2e, 0x03, 0xa8, 0xfd, 0x6f, 0x83,
0x54, 0xf9, 0xf0, 0x6e, 0x0a, 0x61, 0x36, 0x3e,
],
},
],
machine: kernel::c_str!("apple,t6030"),
platform: super::Platform::AdtWithPmp,
Expand Down
5 changes: 4 additions & 1 deletion tools/asahi/g15-maintained-handoff-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,15 @@ def item(s, marker):
OWNER_CALLS.set(0); let bytes = fixture(kind);
assert!(parse(&dev, &Adt { data: &bytes }).is_err()); assert_eq!(OWNER_CALLS.get(), 0);
}
assert_eq!(BUILDS.len(), 3, "maintained B0 firmware row must not require an absent profile symbol");
assert_eq!(BUILDS.len(), 4, "maintained B0 firmware row must not require an absent profile symbol");
for (row, machine) in [(1, &b"apple,j516s"[..]), (2, &b"apple,j514s"[..])] {
assert_eq!(BUILDS[row].machine.unwrap().to_bytes(), machine);
assert_eq!((BUILDS[row].text_size, BUILDS[row].data_size, BUILDS[row].marker), (0x5c000, 0x114000, 0x58e88));
assert_eq!(BUILDS[row].text_sha256, [0xda,0x26,0xec,0xca,0xb1,0xf8,0x59,0x8d,0xa8,0x0c,0x85,0x5e,0xca,0x91,0x65,0x20,0x40,0x6d,0x1d,0x06,0x70,0xf1,0xd4,0x70,0xe7,0x9b,0xb9,0xb0,0x22,0x09,0xdb,0x53]);
}
assert_eq!(BUILDS[3].machine.unwrap().to_bytes(), b"apple,j516s");
assert_eq!((BUILDS[3].text_size, BUILDS[3].data_size, BUILDS[3].marker), (0x5c000, 0x114000, 0x58e88));
assert_eq!(BUILDS[3].text_sha256, [0xcd,0x05,0xaf,0x6a,0x82,0x8b,0x52,0xe4,0xc2,0xfe,0xd2,0x00,0x86,0xd3,0xd1,0x8a,0x7d,0xb4,0x2e,0x03,0xa8,0xfd,0x6f,0x83,0x54,0xf9,0xf0,0x6e,0x0a,0x61,0x36,0x3e]);
for error in [0, -517, -12] {
INIT_ERROR.set(error); let shared = Arc::new(Shared); let result = Rtkit::new(&dev, &shared);
assert_eq!(result.is_ok(), error == 0);
Expand Down
8 changes: 5 additions & 3 deletions tools/asahi/g15-zero-words-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
independently pinned to the original bytes,
except for the J514S B0 FirmwareBuild row added to its firmware table: the
module is the original pinned bytes (0079ae08) plus that one 15-line row, and
the whole hw.rs pin was refreshed with it. prepare_board() is pinned too;
the whole hw.rs pin was refreshed with it. Both pins were refreshed again for
the J516S cd05 FirmwareBuild row (one 18-line row with its comment; nothing
else in the module changed). prepare_board() is pinned too;
it was refreshed for the same Board change (its T6030 arm is unchanged).
"""

Expand All @@ -35,11 +37,11 @@
GOLDEN_FILES = {
"board/data.rs": "7c5ff1077ca3296cbfc9e7144294162b6dea78a3774c38eeed4b0f59a14d7a5c",
"board/template.rs": "286872f5474a67534f214e83e659253299f85143f3dc59035fa80894022e2549",
"hw.rs": "e9b80be9b74b1521798e26b48962f34a61d6e3be3cf960792e54db95c6d54644",
"hw.rs": "ef98b0a14892682d4ae0e2ca8699113e26c57f0e8ccb3f394345ab02eb1a8abe",
"power/idle.rs": "4928ecf7699b3ca85ff5143eb6e996efd40d47321e29a238a02c8873bc9f102c",
}
GOLDEN_FUNCTIONS = {
("hw.rs", "pub(crate) mod t6030 {"): "cab592b5d776be9ede93b96b1b0526c1d838ef2948a5e4a86caa4ec71f71c2ca",
("hw.rs", "pub(crate) mod t6030 {"): "6c14108e82019301db96f07a679f523022ed67d6224d525d1541a4d7f62e2c88",
("initdata.rs", "fn templates("): "c3115c9926d3d7d93317cb8510e93b04f30b0c256811d7137568e822dd93b8ee",
("initdata.rs", "pub(crate) fn prepare_board("): "ebef64ab87ef7b1f994eb7fa2a2424d05bc4fc9e88cbfbf18e51570bdfc4222d",
("board.rs", "pub(crate) fn from_adt("): "cecd0b28db5bd94d3b75c1bbb5f35204e8bf0699f74e5b3d08228c59025f6ac2",
Expand Down