From 0aca20db63c0ce1ce0fdf8b3e46e234fdbd613f4 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Tue, 1 Dec 2026 15:50:00 +1100 Subject: [PATCH] soc: apple: display-gate: take the T6031 display wherever the boot loader hands it over On T6031 (M3 Max) the native display was on by default only when the root compatible was apple,j516c; every other T6031 board needed apple_t6031_display.enable=1, and because the T6031 GPU starts its firmware only after the native display is up, those boards kept the GPU off as well. The board check adds nothing the device tree does not already say. The boot loader marks the DCP and the display subsystem apple,t6031-handoff only after it has checked and locked the handover, and the gate still requires that marker, this Mac's PMP values in /chosen/asahi,t6031-pmp, the T6031 PMP image and a complete PMP topology before it enables anything. Take the display on every T6031 board where all of that holds, as on T6030 and T8122. Drop apple_t6031_display.enable with the board default. A boot that should stay on the boot framebuffer already has two ways that do not need a T6031 kernel switch: the boot loader's chosen.asahi,t6031-dcp=0 (no handoff, so no marker), or nomodeset, which keeps the display driver and so the PMP start away. The PMP report's recovery hint and the G15 wait message say that now. The KUnit cases follow: the T6031 path is on with the full handoff on a tree whose root is no Mac's, the T6030 and T8122 options do not turn it off, and every refusal case is unchanged apart from no longer setting the removed switch. Signed-off-by: Ryan Murray --- drivers/gpu/drm/asahi/g15/glue.c | 2 +- drivers/pmdomain/apple/Kconfig | 4 +- drivers/pmdomain/apple/pmp-report.c | 2 +- drivers/soc/apple/Kconfig | 29 ++--- drivers/soc/apple/display-gate-test.c | 167 +++----------------------- drivers/soc/apple/display-gate.c | 76 +++--------- 6 files changed, 51 insertions(+), 229 deletions(-) diff --git a/drivers/gpu/drm/asahi/g15/glue.c b/drivers/gpu/drm/asahi/g15/glue.c index a12a5e6fa2fe7..9fda291208d13 100644 --- a/drivers/gpu/drm/asahi/g15/glue.c +++ b/drivers/gpu/drm/asahi/g15/glue.c @@ -161,7 +161,7 @@ int asahi_g15_display_prepare(struct device *dev) return ret; np = of_find_compatible_node(NULL, NULL, "apple,t6031-display-subsystem"); if (!np || !of_device_is_available(np)) - dev_info_once(dev, "G15: waiting for the T6031 native display, which this boot did not enable (it needs the boot loader's display handoff, and apple_t6031_display.enable=1 except on the J516C)\n"); + dev_info_once(dev, "G15: waiting for the T6031 native display, which this boot did not enable (it needs the boot loader's display handoff)\n"); else dev_info_once(dev, "G15: waiting for the T6031 native display to come up: the GPU firmware starts only after the display is published\n"); of_node_put(np); diff --git a/drivers/pmdomain/apple/Kconfig b/drivers/pmdomain/apple/Kconfig index 0d67b542b97fa..4773e577758e4 100644 --- a/drivers/pmdomain/apple/Kconfig +++ b/drivers/pmdomain/apple/Kconfig @@ -73,8 +73,8 @@ config APPLE_PMP_REPORT and the display stays on the boot framebuffer. There is no safe way to stop the PMP short of a reboot, so reboot. To boot without starting the PMP, put apple_t8122_display.enable=0 (T8122) or nomodeset on the kernel - command line; on T6031 it is only started with - apple_t6031_display.enable=1. The start's state is in debugfs, in + command line; on T6031, nomodeset or chosen.asahi,t6031-dcp=0 in + the boot loader's configuration. The start's state is in debugfs, in apple-pmp-report/. config APPLE_PMP_FLOOR_KUNIT_TEST diff --git a/drivers/pmdomain/apple/pmp-report.c b/drivers/pmdomain/apple/pmp-report.c index 290ba7caa4231..5dcbe3a0e3c13 100644 --- a/drivers/pmdomain/apple/pmp-report.c +++ b/drivers/pmdomain/apple/pmp-report.c @@ -2648,7 +2648,7 @@ static const struct apple_pmp_report_offsets apple_pmp_offsets_t6031 = { .status = 0x10, .starts_pmp = true, .name = "T6031", - .fallback = "leave out apple_t6031_display.enable=1", + .fallback = "chosen.asahi,t6031-dcp=0 in the boot loader's configuration", .pwrstate = "apple,t6031-pmgr-pwrstate", .devices_ordered = true, }; diff --git a/drivers/soc/apple/Kconfig b/drivers/soc/apple/Kconfig index 978833308016d..bf036b9b86346 100644 --- a/drivers/soc/apple/Kconfig +++ b/drivers/soc/apple/Kconfig @@ -493,14 +493,13 @@ config APPLE_DISPLAY_GATE nomodeset. It also serves T6031 (M3 Max) device trees with apple,t6031-handoff, - in the same way and only with the PMP values the boot loader passes. - There the native display is on by default on the J516C, unless - apple_t6031_display.enable=0; the other T6031 boards need - apple_t6031_display.enable=1 on the kernel command line. The T6031 - GPU driver starts its firmware only after this native display is - up, so apple_t6031_display.enable=0, or a native display that does - not come up, also keeps the GPU off for that boot. It is not a - display-only switch. + in the same way and only with the PMP values the boot loader passes, + on every T6031 board whose boot loader marks the handoff. There is + no command-line switch: a boot loader that does not hand the display + over leaves the display on the boot framebuffer. The T6031 GPU + driver starts its firmware only after this native display is up, so + a native display that is not handed over or does not come up also + keeps the GPU off for that boot. On T6041 (M4 Pro) device trees it enables the internal display nodes only when the boot loader has handed the running display coprocessor @@ -541,14 +540,12 @@ config APPLE_DISPLAY_GATE_KUNIT_TEST default KUNIT_ALL_TESTS help Runs the display gate on test device trees with the T6030, T6031 - and T8122 display nodes, without Apple hardware. On T6031: on by - default only on the default board (the J516C), otherwise only with - apple_t6031_display.enable=1, off with apple_t6031_display.enable=0, - only with the boot loader's handoff marker and this Mac's PMP values, - and with nothing changed when a check fails. On T6030: on by default, as - before, whatever the T6031 option says. On T8122: on by default, - and nothing changed when the handoff or the device tree's own PMP - topology does not check out. On T6041: a power management processor + and T8122 display nodes, without Apple hardware. On T6031: on with + the boot loader's handoff marker and this Mac's PMP values on any + board, whatever the T6030 and T8122 options say, and with nothing + changed when a check fails. On T6030: on by default. On T8122: on + by default, and nothing changed when the handoff or the device + tree's own PMP topology does not check out. On T6041: a power management processor that binds late still powers the external displays up. On the J616c: each external display chain is enabled without a PMP once its processor has firmware memory, and the display subsystem's diff --git a/drivers/soc/apple/display-gate-test.c b/drivers/soc/apple/display-gate-test.c index 58e96acb602af..960d69017be2b 100644 --- a/drivers/soc/apple/display-gate-test.c +++ b/drivers/soc/apple/display-gate-test.c @@ -4,14 +4,13 @@ * Mac's: the gate's own init code decides, applies its changes and adds the * PMP from its built-in overlay (T6030), or completes the PMP the test tree * describes (T6031, T8122). - * - T6030 (t6030-gate-test.dtso): on by default, as before, and - * the T6031 switch does not change it. Run first: the T6031 and T8122 + * - T6030 (t6030-gate-test.dtso): on by default, as before. Run + * first: the T6031 and T8122 * trees describe a PMP, and the T6030 gate refuses to add a second one. - * - T6031 (t6031-gate-test.dtso): on by default only on the default board - * (the J516C; the cases point it at the test tree's own root to run that - * path), otherwise only with apple_t6031_display.enable=1, never with - * apple_t6031_display.enable=0; always with the full handoff, and nothing - * changed when a check fails. + * - T6031 (t6031-gate-test.dtso): on with the full handoff on any board + * (the test tree's root is no Mac's), with no command-line switch: the + * T6030 and T8122 options do not turn it off. Nothing changed when a + * check fails. * - T8122 (t8122-gate-test.dtso): on by default, with the full handoff, * and nothing changed when a check of the handoff or of the reused PMP * topology fails. Its external processor (dcpext) starts on 14.7.0, and @@ -157,9 +156,7 @@ static int gt_live_soc __initdata = -1; struct gate_test { const struct gt_soc *s; struct of_changeset cs; /* this case's own edits to the test tree */ - bool requested, t6031_requested; - int t6031_switch; - const char *t6031_board; + bool requested; const char *pmp_uuid; /* the PMP image the values name: the fixture's unless set */ }; @@ -417,17 +414,12 @@ static int __init gt_init(struct kunit *test, const struct gt_soc *s) t->pmp_uuid = s->pmp_uuid; /* As the boot left them: the test kernel's command line sets neither. */ t->requested = gate_requested; - t->t6031_requested = gate_t6031_requested; - t->t6031_switch = gate_t6031_switch; - t->t6031_board = gate_t6031_board; of_changeset_init(&t->cs); gate_soc = s->soc; gate_pmp_values = NULL; gate_pmp_ovcs = 0; gate_pmp_reused = false; gate_requested = true; - gate_t6031_requested = false; - gate_t6031_switch = -1; gate_t8122_dcpext_cs = NULL; if (gt_live_soc) kunit_skip(test, "the booted device tree has its own /soc"); @@ -479,123 +471,35 @@ static void __init gt_exit(struct kunit *test) of_node_put(gate_pmp_values); gate_pmp_values = NULL; gate_requested = t->requested; - gate_t6031_requested = t->t6031_requested; - gate_t6031_switch = t->t6031_switch; - gate_t6031_board = t->t6031_board; gate_soc = NULL; } /* T6031 */ -/* The boot defaults, and the T6031 switch apart from the others. */ -static void __init gate_t6031_param(struct kunit *test) +/* The full handoff on a board the gate has no list for: enabled. */ +static void __init gate_t6031_default_on(struct kunit *test) { - struct gate_test *t = test->priv; - - KUNIT_EXPECT_FALSE(test, t->t6031_requested); - KUNIT_EXPECT_EQ(test, t->t6031_switch, -1); - KUNIT_EXPECT_STREQ(test, t->t6031_board, "apple,j516c"); - KUNIT_EXPECT_TRUE(test, t->requested); - - KUNIT_EXPECT_EQ(test, gate_setup_t6031("1"), 0); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, 1); - KUNIT_EXPECT_EQ(test, gate_setup_t6031("0"), 0); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, 0); - /* A rejected value sets nothing: neither an explicit 1 nor a reset to unset. */ - KUNIT_EXPECT_NE(test, gate_setup_t6031("maybe"), 0); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, 0); - KUNIT_EXPECT_NE(test, gate_setup_t6031(NULL), 0); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, 0); - gate_t6031_switch = -1; - KUNIT_EXPECT_NE(test, gate_setup_t6031("maybe"), 0); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, -1); - - /* The T6030 and T8122 escapes do not touch it, nor it them. */ - KUNIT_EXPECT_EQ(test, gate_setup("0"), 0); - KUNIT_EXPECT_FALSE(test, gate_requested); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, -1); - KUNIT_EXPECT_EQ(test, gate_setup_t6031("1"), 0); - KUNIT_EXPECT_FALSE(test, gate_requested); - KUNIT_EXPECT_EQ(test, gate_setup_t8122("1"), 0); - KUNIT_EXPECT_TRUE(test, gate_requested); - KUNIT_EXPECT_EQ(test, gate_t6031_switch, 1); -} - -/* An explicit 0 or 1 wins; unset, only the default board asks for it. */ -static void __init gate_t6031_resolution(struct kunit *test) -{ - KUNIT_EXPECT_TRUE(test, gate_t6031_wanted(-1, true)); - KUNIT_EXPECT_FALSE(test, gate_t6031_wanted(-1, false)); - KUNIT_EXPECT_FALSE(test, gate_t6031_wanted(0, true)); - KUNIT_EXPECT_FALSE(test, gate_t6031_wanted(0, false)); - KUNIT_EXPECT_TRUE(test, gate_t6031_wanted(1, true)); - KUNIT_EXPECT_TRUE(test, gate_t6031_wanted(1, false)); -} - -/* Points the default board at the test tree's root, so gate_run() takes that path. */ -static void __init gt_default_board(struct kunit *test) -{ - const char *root = NULL; - - if (of_property_read_string(of_root, "compatible", &root) || !root) - kunit_skip(test, "the test tree's root has no compatible"); - gate_t6031_board = root; -} - -/* On the default board, the full handoff and no switch: enabled. */ -static void __init gate_t6031_default_board_on(struct kunit *test) -{ - gt_default_board(test); gt_run(test); gt_expect_enabled(test); } -/* apple_t6031_display.enable=0 still wins on the default board. */ -static void __init gate_t6031_default_board_switched_off(struct kunit *test) -{ - gt_default_board(test); - KUNIT_ASSERT_EQ(test, gate_setup_t6031("0"), 0); - gt_run(test); - gt_expect_untouched(test); -} - -/* The default asks for the display; it does not stand in for the handoff. */ -static void __init gate_t6031_default_board_no_marker(struct kunit *test) -{ - gt_default_board(test); - gt_remove(test, gt_t6031.dcp, "apple,t6031-handoff"); - gt_run(test); - gt_expect_untouched(test); -} - -/* Off the default board, with a complete handoff and no switch, nothing changes. */ -static void __init gate_t6031_off_by_default(struct kunit *test) -{ - gt_run(test); - gt_expect_untouched(test); -} - -static void __init gate_t6031_switched_off(struct kunit *test) +/* The T6030 and T8122 options are not a T6031 switch. */ +static void __init gate_t6031_t6030_option(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); - KUNIT_ASSERT_EQ(test, gate_setup_t6031("0"), 0); + KUNIT_ASSERT_EQ(test, gate_setup("0"), 0); gt_run(test); - gt_expect_untouched(test); + gt_expect_enabled(test); } -/* apple_t6031_display.enable=1 and the full handoff: the T6030 result. */ -static void __init gate_t6031_enabled(struct kunit *test) +static void __init gate_t6031_t8122_option(struct kunit *test) { - /* apple_t6030_display.enable=0 is not the T6031 switch. */ - KUNIT_ASSERT_EQ(test, gate_setup("0"), 0); - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); + KUNIT_ASSERT_EQ(test, gate_setup_t8122("0"), 0); gt_run(test); gt_expect_enabled(test); } static void __init gate_t6031_no_dcp_marker(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.dcp, "apple,t6031-handoff"); gt_run(test); gt_expect_untouched(test); @@ -603,7 +507,6 @@ static void __init gate_t6031_no_dcp_marker(struct kunit *test) static void __init gate_t6031_no_display_marker(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.display, "apple,t6031-handoff"); gt_run(test); gt_expect_untouched(test); @@ -611,7 +514,6 @@ static void __init gate_t6031_no_display_marker(struct kunit *test) static void __init gate_t6031_marker_not_one(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_u32(test, gt_t6031.dcp, "apple,t6031-handoff", 2); gt_run(test); gt_expect_untouched(test); @@ -620,7 +522,6 @@ static void __init gate_t6031_marker_not_one(struct kunit *test) /* The T6030 marker is not the T6031 one. */ static void __init gate_t6031_t6030_marker(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.dcp, "apple,t6031-handoff"); gt_remove(test, gt_t6031.display, "apple,t6031-handoff"); gt_add_u32(test, gt_t6031.dcp, "apple,t6030-handoff", 1); @@ -632,7 +533,6 @@ static void __init gate_t6031_t6030_marker(struct kunit *test) /* No fallback values on T6031. */ static void __init gate_t6031_no_pmp_values(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_detach(test, gt_t6031.values); gt_run(test); gt_expect_untouched(test); @@ -640,7 +540,6 @@ static void __init gate_t6031_no_pmp_values(struct kunit *test) static void __init gate_t6031_incomplete_pmp_values(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.values, "apple,board-id"); gt_run(test); gt_expect_untouched(test); @@ -649,7 +548,6 @@ static void __init gate_t6031_incomplete_pmp_values(struct kunit *test) /* The T6030 PMP image is not T6031's. */ static void __init gate_t6031_t6030_pmp_image(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_string(test, gt_t6031.values, "apple,tunable-uuid", "2F4EB4C4-001B-3ACF-A9A0-68D8E42FC3A7"); gt_run(test); @@ -658,7 +556,6 @@ static void __init gate_t6031_t6030_pmp_image(struct kunit *test) static void __init gate_t6031_other_pmp_image(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_string(test, gt_t6031.values, "apple,tunable-uuid", "3B18C886-4C70-349B-B1C4-70F35DE2C5CD"); gt_run(test); @@ -668,7 +565,6 @@ static void __init gate_t6031_other_pmp_image(struct kunit *test) /* The DCP on DISP_CPU, as on T6030, is not the T6031 power layout. */ static void __init gate_t6031_t6030_power_layout(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_u32(test, gt_t6031.dcp, "power-domains", gt_node(test, gt_t6031.ps[PMP_PS_DISP_CPU])->phandle); gt_run(test); @@ -677,7 +573,6 @@ static void __init gate_t6031_t6030_power_layout(struct kunit *test) static void __init gate_t6031_not_inherited_on(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.ps[PMP_PS_DISP_CPU], "apple,inherited-on"); gt_run(test); gt_expect_untouched(test); @@ -686,7 +581,6 @@ static void __init gate_t6031_not_inherited_on(struct kunit *test) /* The reused PMP topology must be complete and unused. */ static void __init gate_t6031_no_report_pmp_link(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.report, "apple,pmp"); gt_run(test); gt_expect_untouched(test); @@ -694,7 +588,6 @@ static void __init gate_t6031_no_report_pmp_link(struct kunit *test) static void __init gate_t6031_pmp_enabled(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_string(test, gt_t6031.pmp, "status", "okay"); gt_run(test); gt_expect_refused(test); @@ -702,7 +595,6 @@ static void __init gate_t6031_pmp_enabled(struct kunit *test) static void __init gate_t6031_pmp_has_values(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_add_u32(test, gt_t6031.pmp, "apple,board-id", 1); gt_run(test); gt_expect_refused(test); @@ -710,7 +602,6 @@ static void __init gate_t6031_pmp_has_values(struct kunit *test) static void __init gate_t6031_no_dcp_report_link(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.dcp, "apple,pmp-report"); gt_run(test); gt_expect_untouched(test); @@ -719,7 +610,6 @@ static void __init gate_t6031_no_dcp_report_link(struct kunit *test) /* The DCP must wait for the display request, not the storage one. */ static void __init gate_t6031_dcp_links_storage(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_u32(test, gt_t6031.dcp, "apple,pmp-report", gt_node(test, gt_t6031.ans)->phandle); gt_run(test); @@ -728,7 +618,6 @@ static void __init gate_t6031_dcp_links_storage(struct kunit *test) static void __init gate_t6031_disp_not_always_on(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_remove(test, gt_t6031.disp, "apple,always-on"); gt_run(test); gt_expect_untouched(test); @@ -736,7 +625,6 @@ static void __init gate_t6031_disp_not_always_on(struct kunit *test) static void __init gate_t6031_no_storage_request(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); gt_set_string(test, gt_t6031.ans, "status", "disabled"); gt_run(test); gt_expect_refused(test); @@ -745,22 +633,19 @@ static void __init gate_t6031_no_storage_request(struct kunit *test) /* Last: the enabled path again, after every refusal was undone. */ static void __init gate_t6031_enabled_again(struct kunit *test) { - gate_t6031_enabled(test); + gate_t6031_default_on(test); } /* T6030: unchanged */ -/* On by default: the T6031 switch, set or not, does not matter. */ static void __init gate_t6030_default_on(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("0"), 0); gt_run(test); gt_expect_enabled(test); } static void __init gate_t6030_escape(struct kunit *test) { - KUNIT_ASSERT_EQ(test, gate_setup_t6031("1"), 0); KUNIT_ASSERT_EQ(test, gate_setup("0"), 0); gt_run(test); gt_expect_untouched(test); @@ -829,14 +714,6 @@ static void __init gate_t8122_escape(struct kunit *test) gt_expect_untouched(test); } -/* The T6031 switch is not the T8122 one. */ -static void __init gate_t8122_t6031_switch(struct kunit *test) -{ - KUNIT_ASSERT_EQ(test, gate_setup_t6031("0"), 0); - gt_run(test); - gt_expect_enabled(test); -} - static void __init gate_t8122_no_marker(struct kunit *test) { gt_remove(test, gt_t8122.display, "apple,t8122-handoff"); @@ -1222,14 +1099,9 @@ static void __init gate_t8122_dcpext_alias_window(struct kunit *test) /* The case and suite structs outlive init: only the functions are init code. */ static struct kunit_case gate_t6031_cases[] __refdata = { - KUNIT_CASE(gate_t6031_param), - KUNIT_CASE(gate_t6031_resolution), - KUNIT_CASE(gate_t6031_off_by_default), - KUNIT_CASE(gate_t6031_default_board_on), - KUNIT_CASE(gate_t6031_default_board_switched_off), - KUNIT_CASE(gate_t6031_default_board_no_marker), - KUNIT_CASE(gate_t6031_switched_off), - KUNIT_CASE(gate_t6031_enabled), + KUNIT_CASE(gate_t6031_default_on), + KUNIT_CASE(gate_t6031_t6030_option), + KUNIT_CASE(gate_t6031_t8122_option), KUNIT_CASE(gate_t6031_no_dcp_marker), KUNIT_CASE(gate_t6031_no_display_marker), KUNIT_CASE(gate_t6031_marker_not_one), @@ -1282,7 +1154,6 @@ static struct kunit_suite gate_t6030_suite __refdata = { static struct kunit_case gate_t8122_cases[] __refdata = { KUNIT_CASE(gate_t8122_default_on), KUNIT_CASE(gate_t8122_escape), - KUNIT_CASE(gate_t8122_t6031_switch), KUNIT_CASE(gate_t8122_no_marker), KUNIT_CASE(gate_t8122_no_pmp_values), KUNIT_CASE(gate_t8122_t6031_pmp_image), diff --git a/drivers/soc/apple/display-gate.c b/drivers/soc/apple/display-gate.c index c5d17e78eaa6a..c5847fbb5f598 100644 --- a/drivers/soc/apple/display-gate.c +++ b/drivers/soc/apple/display-gate.c @@ -53,19 +53,20 @@ * option. * * On T6031 (M3 Max) the gate serves the same handoff, marked - * apple,t6031-handoff. Its default is scoped to the J516C: there the native - * display is on unless apple_t6031_display.enable=0; the other T6031 boards - * need apple_t6031_display.enable=1. The T6031 GPU starts its firmware only - * after this native display is up, so enable=0 (or a display that never - * comes up) keeps the GPU off for that boot too: it is not a display-only - * switch. The default changes no check of the - * handoff or the PMP below. The PMP values must come from the boot loader, in + * apple,t6031-handoff, on every T6031 board whose boot loader marks it: the + * marker is what says the display can be taken over, not the board. There + * is no command-line switch: a boot loader that does not hand the display + * over (aura's chosen.asahi,t6031-dcp=0) leaves no marker, and the display + * stays on the boot framebuffer. The T6031 GPU starts its firmware only + * after this native display is up, so a display that is not handed over or + * never comes up keeps the GPU off for that boot too. The PMP values must + * come from the boot loader, in * /chosen/asahi,t6031-pmp; there is no fallback. Its PMP topology is * reused from the device tree, as on T8122. The T6031 display power * states nest the other way round (the DCP's DISP_FE under DISP_CPU under * DISP_SYS), and its PMP power states are in another PMGR block. On every * T6031 boot the gate also logs what the boot loader handed over, so that - * a boot without the option already records what the next one needs. + * a boot whose handoff is refused still records what was missing. * * On T6041 (the display coprocessor of the M4 Pro, apple,t6040) m1n1 hands * over the DCP that iBoot leaves running. It marks the DCP, the display @@ -202,21 +203,6 @@ static const char gate_t6031_pmp_uuid[] __initconst = "07FF4C5B-CB2E-3DE6-95FF-3 */ static bool gate_requested __initdata = true; -/* - * apple_t6031_display.enable: -1 while it is not on the command line, else 0 - * or 1. Unset, the T6031 native display is on only on gate_t6031_board. - */ -static int gate_t6031_switch __initdata = -1; -static const char *gate_t6031_board __initdata = "apple,j516c"; -/* The resolved request, set by gate_run() on a T6031. */ -static bool gate_t6031_requested __initdata; - -/* Whether the T6031 native display is requested: an explicit 0 or 1 wins. */ -static bool __init gate_t6031_wanted(int sw, bool default_board) -{ - return sw < 0 ? default_board : sw; -} - /* One SoC's internal display handoff, as the gate checks and completes it */ struct gate_soc { const char *machine; /* root compatible */ @@ -246,8 +232,7 @@ struct gate_soc { bool records; /* PTD bits are soc-device records (T8122) */ const char *fallback_board; /* gets the fallback overlay without boot loader values */ const u8 *fallback_dtbo, *fallback_dtbo_end; - bool *requested; /* the command line switch */ - const char *opt_in; /* set: off unless this is on the command line */ + bool *requested; /* the command line switch, or NULL: none */ /* The DCP's power state and its parents, nearest first, as PMP_PS_*. */ u8 ps_chain[3]; bool pmp_ps_any_pmgr; /* PMP and PMS_SRAM are not beside the DCP's power state */ @@ -316,10 +301,9 @@ static const struct gate_soc gate_t8122 __initconst = { }; /* - * T6031 (M3 Max): the T6030 handoff at the T6031 addresses, on by default on - * the J516C and off unless apple_t6031_display.enable=1 on the other boards; - * apple_t6031_display.enable=0 keeps it, and with it the GPU, off everywhere. - * The PMP values must come from the boot + * T6031 (M3 Max): the T6030 handoff at the T6031 addresses, on every board + * whose boot loader marks it, with no command-line switch. The PMP values + * must come from the boot * loader: there is no built-in fallback. The PMP image is T6031's own; * any other, the T6030 image included, is refused. The report driver checks * the image's SRAM layout before it starts the PMP. The internal display's @@ -341,8 +325,6 @@ static const struct gate_soc gate_t6031 __initconst = { .reuse_pmp = true, .pmp_compat = "apple,t6031-pmp-v2", .ans_entry = "report@21", - .requested = &gate_t6031_requested, - .opt_in = "apple_t6031_display.enable=1", .ps_chain = { PMP_PS_DISP_FE, PMP_PS_DISP_CPU, PMP_PS_DISP_SYS }, .pmp_ps_any_pmgr = true, .describe = true, @@ -462,21 +444,6 @@ static int __init gate_setup_t8122(char *arg) } early_param("apple_t8122_display.enable", gate_setup_t8122); -/* - * Its own switch: the T6030 and T8122 options do not change it, nor it them. - * A value kstrtobool() rejects sets nothing, so the board default stays. - */ -static int __init gate_setup_t6031(char *arg) -{ - bool on; - int ret = kstrtobool(arg, &on); - - if (!ret) - gate_t6031_switch = on; - return ret; -} -early_param("apple_t6031_display.enable", gate_setup_t6031); - /* Returns the only node compatible with @compat, or NULL if there are none or several. */ static struct device_node *__init gate_find_one(const char *compat) { @@ -2191,21 +2158,8 @@ static void __init gate_run(void) if (gate_soc->describe) gate_describe(); - if (gate_soc == &gate_t6031) { - bool board = of_machine_is_compatible(gate_t6031_board); - - gate_t6031_requested = gate_t6031_wanted(gate_t6031_switch, board); - if (gate_t6031_switch < 0 && board) - gate_info("native display on by default on %s; apple_t6031_display.enable=0 keeps the boot framebuffer\n", - gate_t6031_board); - } - - if (!*gate_soc->requested) { - if (gate_soc->opt_in && gate_t6031_switch < 0) - gate_info("native display not requested (%s is not on the command line), display stays on the boot framebuffer\n", - gate_soc->opt_in); - else - gate_info("disabled on the command line, display stays on the boot framebuffer\n"); + if (gate_soc->requested && !*gate_soc->requested) { + gate_info("disabled on the command line, display stays on the boot framebuffer\n"); if (gate_soc->dcpext) gate_dcpext("the display gate is disabled"); return;