From 212c155f323fb12b025d1c6ec880f557e9fa077f Mon Sep 17 00:00:00 2001 From: Chris Kearney <303316+chriskearney@users.noreply.github.com> Date: Sat, 24 Oct 2026 11:31:50 -0700 Subject: [PATCH] tests: asahi: scan default T6030 trees for PMP compatibles The display gate refuses any existing PMP or report compatible anywhere in the tree, including disabled nodes. The DT control only checks four names under /soc, so renamed or nested nodes can pass it and still block the runtime PMP overlay. Walk the whole default-profile tree and reject either compatible in any entry of each compatible string list. Keep the existing static-profile node and alias checks. Compare case-insensitively, as the OF lookup does. Link: https://github.com/omacom/linux-aurora/pull/202#discussion_r4367839442 Signed-off-by: Chris Kearney <303316+chriskearney@users.noreply.github.com> Generated-by: LLM --- tools/asahi/t6030-pmp-dt-tests.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tools/asahi/t6030-pmp-dt-tests.py b/tools/asahi/t6030-pmp-dt-tests.py index 22826e998173da..913e8d31aa7d7c 100644 --- a/tools/asahi/t6030-pmp-dt-tests.py +++ b/tools/asahi/t6030-pmp-dt-tests.py @@ -15,6 +15,32 @@ "pmp@350500000", "mbox@350c08000", } +PMP_COMPATIBLES = {"apple,t6000-pmp-v2", "apple,t6030-pmp-v2-report"} + + +def check_default_compatibles(dtb, board): + pending = ["/"] + while pending: + node = pending.pop() + raw = subprocess.check_output( + ["fdtget", "-t", "bx", "-d", "", str(dtb), node, "compatible"], + text=True, + ) + # Match the gate's whole-tree OF lookup, including disabled nodes + # and every string in a compatible list. + compatible = bytes(int(value, 16) for value in raw.split()) + matches = PMP_COMPATIBLES.intersection( + value.decode("ascii").lower() for value in compatible.split(b"\0") + if value + ) + if matches: + raise AssertionError(f"{board} default: static PMP compatible " + f"{sorted(matches)} at {node}") + children = subprocess.check_output( + ["fdtget", "-l", str(dtb), node], text=True, + ) + pending.extend(node.rstrip("/") + "/" + child + for child in children.splitlines()) def check_profile(tree, output, dtc, board, static): @@ -38,6 +64,8 @@ def check_profile(tree, output, dtc, board, static): if present != expected: raise AssertionError(f"{board} {profile}: static PMP nodes " f"{sorted(present)}, expected {sorted(expected)}") + if not static: + check_default_compatibles(dtb, board) alias = subprocess.run(["fdtget", "-t", "s", str(dtb), "/aliases", "pmp"], capture_output=True, text=True)