Skip to content
Open
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
21 changes: 21 additions & 0 deletions drivers/media/platform/apple/ave/ave-abi-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2279,8 +2279,29 @@ static void ave_m3_probe_only(struct kunit *test)
KUNIT_EXPECT_EQ(test, ave_fw_check_boot(ave), -EOPNOTSUPP);
}

/* The Neo admits its 25G83 and macOS 27.2 builds, each with its layout. */
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_26a428_hevc_main10),
KUNIT_CASE(ave_9003_speed), KUNIT_CASE(ave_cq_table),
Expand Down
9 changes: 8 additions & 1 deletion drivers/media/platform/apple/ave/ave-drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,17 @@ const struct ave_variant ave_t8132 = {
.next_build = &ave_t8132_25g83,
};

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,
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/apple/ave/ave-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static const u32 ave_known_text_crc[] = {
AVE_FW_TEXT_CRC_T6000_26B123, /* encoder firmware macOS 27.2 26B123 / T6000/T6001 */
AVE_FW_TEXT_CRC_T8132_26B123, /* encoder firmware macOS 27.2 26B123 / T8132 */
AVE_FW_TEXT_CRC_T8142_26B123, /* encoder firmware 9013.55.1, macOS 27.2 26B123 / T8142 */
AVE_FW_TEXT_CRC_T8140_26B123, /* encoder firmware 9013.55.1, macOS 27.2 26B123 / T8140 */
0x460c7a7c, /* encoder firmware 6070.11.1 / T6000 */
0x25bfd039, /* encoder firmware 6070.11.1 / T8112 */
};
Expand Down
6 changes: 4 additions & 2 deletions drivers/media/platform/apple/ave/ave-layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,11 @@ const struct ave_fw_layout *ave_layout_for_crc(u32 crc)
* The M5's macOS 27.2 build (9013.55.1), between 26A428 and the 27.3
* beta, speaks 26A428's layout: on the J815's 27.2 stub, H.264
* Baseline (ffmpeg), H.264 and HEVC with B-frames (v4l2-ctl) encode
* with it.
* with it. The A18 Pro's build of the same firmware version takes the
* same ordinary-encode command layout.
*/
if (crc == AVE_FW_TEXT_CRC_T8142_26B123)
if (crc == AVE_FW_TEXT_CRC_T8142_26B123 ||
crc == AVE_FW_TEXT_CRC_T8140_26B123)
return &ave_layout_26a428;
return NULL;
}
7 changes: 6 additions & 1 deletion drivers/media/platform/apple/ave/ave.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ enum ave_opcode {
* AppleAVE2FW 9013.55.1: TEXT 0x154000, DATA 0x12c000, as 26A428's.
*/
#define AVE_FW_TEXT_CRC_T8142_26B123 0x24eb4625
/*
* The A18 Pro (T8140) build of macOS 27.2 (26B123), encoder firmware
* 9013.55.1: TEXT 0x154000, DATA 0x130000.
*/
#define AVE_FW_TEXT_CRC_T8140_26B123 0xa945c267

struct ave_ctx;

Expand Down Expand Up @@ -639,7 +644,7 @@ static inline struct ave_ctx *ave_file_to_ctx(struct file *file)
}

extern const struct ave_variant ave_t6000, ave_t6030, ave_t6041, ave_t6050,
ave_t8103, ave_t8112, ave_t8132, ave_m3;
ave_t8103, ave_t8112, ave_t8132, ave_t8140, ave_m3;

/* ave-fw.c */
u64 ave_fw_vcbar(const struct ave_variant *variant, u64 text_iova);
Expand Down
Loading