From 69b302b728497f8f01a604516badb81b105ce25d Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Mon, 16 Nov 2026 00:45:06 +1100 Subject: [PATCH 1/2] media: apple: ave: admit Neo macOS 27.2 firmware Accept the T8140 26B123 firmware identity and select the existing macOS 27 command layout while retaining the 25G83 build. Assisted-by: LLM --- .../media/platform/apple/ave/ave-abi-test.c | 20 +++++++++++++++++++ drivers/media/platform/apple/ave/ave-drv.c | 9 ++++++++- drivers/media/platform/apple/ave/ave-fw.c | 1 + drivers/media/platform/apple/ave/ave-layout.c | 7 ++++--- drivers/media/platform/apple/ave/ave.h | 4 +++- 5 files changed, 36 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/apple/ave/ave-abi-test.c b/drivers/media/platform/apple/ave/ave-abi-test.c index 57e659dc25f25..be4b16e12de86 100644 --- a/drivers/media/platform/apple/ave/ave-abi-test.c +++ b/drivers/media/platform/apple/ave/ave-abi-test.c @@ -1496,8 +1496,28 @@ static void ave_t6041_text_boot_word(struct kunit *test) KUNIT_EXPECT_EQ(test, ave_fw_text_boot_crc(text, size, size - 2, &a), -EINVAL); } +static void ave_t8140_fw272_build(struct kunit *test) +{ + KUNIT_ASSERT_EQ(test, ave_t8140.build_count, 2U); + KUNIT_EXPECT_EQ(test, ave_t8140.builds[0].text_size, 0x14c000U); + KUNIT_EXPECT_EQ(test, ave_t8140.builds[0].data_size, 0x130000U); + KUNIT_EXPECT_EQ(test, ave_t8140.builds[0].text_crc, + AVE_FW_TEXT_CRC_9003_78_0); + KUNIT_EXPECT_EQ(test, ave_t8140.builds[1].text_size, 0x154000U); + KUNIT_EXPECT_EQ(test, ave_t8140.builds[1].data_size, 0x130000U); + KUNIT_EXPECT_EQ(test, ave_t8140.builds[1].text_crc, + AVE_FW_TEXT_CRC_T8140_26B123); + KUNIT_EXPECT_PTR_EQ(test, + ave_layout_for_crc(AVE_FW_TEXT_CRC_9003_78_0), + &ave_layout_9003_78_0); + KUNIT_EXPECT_PTR_EQ(test, + ave_layout_for_crc(AVE_FW_TEXT_CRC_T8140_26B123), + &ave_layout_26a428); +} + static struct kunit_case ave_abi_cases[] = { KUNIT_CASE(ave_t6041_text_boot_word), + KUNIT_CASE(ave_t8140_fw272_build), KUNIT_CASE(ave_9003_byte_equality), KUNIT_CASE(ave_9003_hevc_main10), KUNIT_CASE(ave_9003_speed), KUNIT_CASE(ave_cq_table), KUNIT_CASE(ave_6070_images), diff --git a/drivers/media/platform/apple/ave/ave-drv.c b/drivers/media/platform/apple/ave/ave-drv.c index 84810b03196bb..8a156c1f8cdcc 100644 --- a/drivers/media/platform/apple/ave/ave-drv.c +++ b/drivers/media/platform/apple/ave/ave-drv.c @@ -109,10 +109,17 @@ const struct ave_variant ave_t6041 = { .boot_qualified = true, }; -static const struct ave_variant ave_t8140 = { +static const struct ave_fw_build ave_t8140_builds[] = { + { "25G83", 0x14c000, 0x130000, AVE_FW_TEXT_CRC_9003_78_0 }, + { "26B123", 0x154000, 0x130000, AVE_FW_TEXT_CRC_T8140_26B123 }, +}; + +const struct ave_variant ave_t8140 = { .regs = &ave_coproc_v40, .fw_text_size = 0x14c000, .fw_data_size = 0x130000, + .builds = ave_t8140_builds, + .build_count = ARRAY_SIZE(ave_t8140_builds), .boot_device_id = 29, .boot_arg_value = AVE_COPROC_BOOT_ARG_VALUE, .timebase_multiplier = 1, diff --git a/drivers/media/platform/apple/ave/ave-fw.c b/drivers/media/platform/apple/ave/ave-fw.c index 389f24f0f9ecf..99771ebc98ba0 100644 --- a/drivers/media/platform/apple/ave/ave-fw.c +++ b/drivers/media/platform/apple/ave/ave-fw.c @@ -40,6 +40,7 @@ static const u32 ave_known_text_crc[] = { 0x69c54454, /* AppleAVE2FW 9003.78.0 (macOS 26.0.x) */ AVE_FW_TEXT_CRC_T6040_25G83, /* AppleAVE2FW 9003.78.0 / T6040 */ AVE_FW_TEXT_CRC_T6041_25G83, /* AppleAVE2FW 9003.78.0 / M4 Max */ + AVE_FW_TEXT_CRC_T8140_26B123, /* AppleAVE2FW 9013.55.1 / T8140 */ AVE_FW_TEXT_CRC_T6050_26A428, /* AppleAVE2FW, macOS 27.0 26A428 / T6050 */ AVE_FW_TEXT_CRC_T6050_26C5035, /* AppleAVE2FW, macOS 27.3 26C5035r / T6050 */ AVE_FW_TEXT_CRC_T8142_26A428, /* AppleAVE2FW 9013.45.1, macOS 27.0 26A428 / T8142 */ diff --git a/drivers/media/platform/apple/ave/ave-layout.c b/drivers/media/platform/apple/ave/ave-layout.c index 34bde7f96f641..7e5c3412a2925 100644 --- a/drivers/media/platform/apple/ave/ave-layout.c +++ b/drivers/media/platform/apple/ave/ave-layout.c @@ -961,11 +961,12 @@ const struct ave_fw_layout *ave_layout_for_crc(u32 crc) return &ave_layout_6070_11_1; /* * The macOS 27.0 build for the M5 Pro and Max, and the M5's build of the - * same firmware version (9013.45.1): one AppleAVE2 kext builds the - * commands for both. + * same firmware version (9013.45.1), plus the Neo's 27.2 build: one + * AppleAVE2 kext builds the commands for all three. */ if (crc == AVE_FW_TEXT_CRC_T6050_26A428 || - crc == AVE_FW_TEXT_CRC_T8142_26A428) + crc == AVE_FW_TEXT_CRC_T8142_26A428 || + crc == AVE_FW_TEXT_CRC_T8140_26B123) return &ave_layout_26a428; /* * The macOS 27.3 beta 1 build speaks the same command layout: H.264 diff --git a/drivers/media/platform/apple/ave/ave.h b/drivers/media/platform/apple/ave/ave.h index cf158479c9966..45dfe40849873 100644 --- a/drivers/media/platform/apple/ave/ave.h +++ b/drivers/media/platform/apple/ave/ave.h @@ -173,6 +173,8 @@ enum ave_opcode { * this is the TEXT CRC with that word zeroed. */ #define AVE_FW_TEXT_CRC_T6041_25G83 0x9a080cad +/* macOS 27.2 (26B123) / T8140: AppleAVE2FW 9013.55.1. */ +#define AVE_FW_TEXT_CRC_T8140_26B123 0xa945c267 #define AVE_FW_TEXT_CRC_T6050_26A428 0x87279429 /* macOS 27.3 beta 1 (26C5035r) / T6050: TEXT 0x158000, DATA 0x134000. */ #define AVE_FW_TEXT_CRC_T6050_26C5035 0xc25b4ddb @@ -549,7 +551,7 @@ static inline struct ave_ctx *ave_file_to_ctx(struct file *file) return container_of(file_to_v4l2_fh(file), struct ave_ctx, fh); } -extern const struct ave_variant ave_t6000, ave_t6041, ave_t8112; +extern const struct ave_variant ave_t6000, ave_t6041, ave_t8112, ave_t8140; /* ave-fw.c */ u64 ave_fw_vcbar(const struct ave_variant *variant, u64 text_iova); From 7847aa508e4dc78b889f0157c77a1dac24f60865 Mon Sep 17 00:00:00 2001 From: Ryan Murray Date: Fri, 20 Nov 2026 01:00:07 +1100 Subject: [PATCH 2/2] media: apple: ave: say what the 27.x builds share, not who builds it The comment over the 26A428 layout selection now states the shared fact (the same ordinary-encode command layout) for the three builds. Comment only. Signed-off-by: Ryan Murray --- drivers/media/platform/apple/ave/ave-layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/apple/ave/ave-layout.c b/drivers/media/platform/apple/ave/ave-layout.c index 7e5c3412a2925..93b57c776d4a0 100644 --- a/drivers/media/platform/apple/ave/ave-layout.c +++ b/drivers/media/platform/apple/ave/ave-layout.c @@ -961,8 +961,8 @@ const struct ave_fw_layout *ave_layout_for_crc(u32 crc) return &ave_layout_6070_11_1; /* * The macOS 27.0 build for the M5 Pro and Max, and the M5's build of the - * same firmware version (9013.45.1), plus the Neo's 27.2 build: one - * AppleAVE2 kext builds the commands for all three. + * same firmware version (9013.45.1), plus the Neo's 27.2 build: all + * three take the same ordinary-encode command layout. */ if (crc == AVE_FW_TEXT_CRC_T6050_26A428 || crc == AVE_FW_TEXT_CRC_T8142_26A428 ||