summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@chromium.org>2021-08-09 09:48:01 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-09 11:04:39 +0000
commit871c4115c23ee7ad79131d55edfb178237f9327f (patch)
treec0bc74822ff6533c5d0bd53000f6fe026d2caa10
parent6ccfccc1f8febf2a75269bf04239738543372285 (diff)
downloadchrome-ec-871c4115c23ee7ad79131d55edfb178237f9327f.tar.gz
chip/mt_scp: move video capability to chip specific
BRANCH=none BUG=b:185977882 TEST=make BOARD=asurada_scp -j && make BOARD=cherry_scp -j Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: Id5eaa5ddc0e21c9b33a1a4197393de6c6ef331e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3080541
-rw-r--r--chip/mt_scp/mt8192/build.mk2
-rw-r--r--chip/mt_scp/mt8192/video.c19
-rw-r--r--chip/mt_scp/mt8195/build.mk2
-rw-r--r--chip/mt_scp/mt8195/video.c19
-rw-r--r--chip/mt_scp/rv32i_common/ipi.c6
-rw-r--r--chip/mt_scp/rv32i_common/ipi_chip.h16
-rw-r--r--chip/mt_scp/rv32i_common/video.h30
7 files changed, 75 insertions, 19 deletions
diff --git a/chip/mt_scp/mt8192/build.mk b/chip/mt_scp/mt8192/build.mk
index 5ca0f1033c..c81bd83595 100644
--- a/chip/mt_scp/mt8192/build.mk
+++ b/chip/mt_scp/mt8192/build.mk
@@ -6,3 +6,5 @@
# Required chip modules
chip-y+=$(CHIP_VARIANT)/uart.o
chip-y+=$(CHIP_VARIANT)/clock.o
+chip-y+=$(CHIP_VARIANT)/video.o
+
diff --git a/chip/mt_scp/mt8192/video.c b/chip/mt_scp/mt8192/video.c
new file mode 100644
index 0000000000..2f9b9a7808
--- /dev/null
+++ b/chip/mt_scp/mt8192/video.c
@@ -0,0 +1,19 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "common.h"
+#include "video.h"
+
+uint32_t video_get_enc_capability(void)
+{
+ return VENC_CAP_4K;
+}
+
+uint32_t video_get_dec_capability(void)
+{
+ return VDEC_CAP_4K_DISABLED | VDEC_CAP_MM21 |
+ VDEC_CAP_H264_SLICE | VDEC_CAP_VP8_FRAME |
+ VDEC_CAP_VP9_FRAME;
+}
diff --git a/chip/mt_scp/mt8195/build.mk b/chip/mt_scp/mt8195/build.mk
index 5ca0f1033c..c81bd83595 100644
--- a/chip/mt_scp/mt8195/build.mk
+++ b/chip/mt_scp/mt8195/build.mk
@@ -6,3 +6,5 @@
# Required chip modules
chip-y+=$(CHIP_VARIANT)/uart.o
chip-y+=$(CHIP_VARIANT)/clock.o
+chip-y+=$(CHIP_VARIANT)/video.o
+
diff --git a/chip/mt_scp/mt8195/video.c b/chip/mt_scp/mt8195/video.c
new file mode 100644
index 0000000000..dc4b7b3397
--- /dev/null
+++ b/chip/mt_scp/mt8195/video.c
@@ -0,0 +1,19 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "common.h"
+#include "video.h"
+
+uint32_t video_get_enc_capability(void)
+{
+ return VENC_CAP_4K;
+}
+
+uint32_t video_get_dec_capability(void)
+{
+ return VDEC_CAP_MT21C | VDEC_CAP_MM21 |
+ VDEC_CAP_H264_SLICE | VDEC_CAP_VP8_FRAME |
+ VDEC_CAP_VP9_FRAME;
+}
diff --git a/chip/mt_scp/rv32i_common/ipi.c b/chip/mt_scp/rv32i_common/ipi.c
index 462865be83..cba5c65d0b 100644
--- a/chip/mt_scp/rv32i_common/ipi.c
+++ b/chip/mt_scp/rv32i_common/ipi.c
@@ -14,6 +14,7 @@
#include "system.h"
#include "task.h"
#include "util.h"
+#include "video.h"
#define CPRINTF(format, args...) cprintf(CC_IPI, format, ##args)
#define CPRINTS(format, args...) cprints(CC_IPI, format, ##args)
@@ -128,9 +129,8 @@ static void ipi_enable_deferred(void)
scp_run.signaled = 1;
strncpy(scp_run.fw_ver, system_get_version(EC_IMAGE_RW),
SCP_FW_VERSION_LEN);
- scp_run.dec_capability = VCODEC_CAPABILITY_4K_DISABLED | VDEC_CAP_MM21 | VDEC_CAP_H264_SLICE |
- VDEC_CAP_VP8_FRAME | VDEC_CAP_VP9_FRAME;
- scp_run.enc_capability = VENC_CAP_4K;
+ scp_run.dec_capability = video_get_dec_capability();
+ scp_run.enc_capability = video_get_enc_capability();
ret = ipi_send(SCP_IPI_INIT, (void *)&scp_run, sizeof(scp_run), 1);
if (ret) {
diff --git a/chip/mt_scp/rv32i_common/ipi_chip.h b/chip/mt_scp/rv32i_common/ipi_chip.h
index 3484358a86..47a9434b09 100644
--- a/chip/mt_scp/rv32i_common/ipi_chip.h
+++ b/chip/mt_scp/rv32i_common/ipi_chip.h
@@ -14,22 +14,6 @@
*/
#define SCP_FW_VERSION_LEN 32
-/*
- * Video decoder supported capability
- */
-#define VCODEC_CAPABILITY_4K_DISABLED BIT(4)
-#define VDEC_CAP_MM21 BIT(5)
-#define VDEC_CAP_MT21C BIT(6)
-#define VDEC_CAP_H264_SLICE BIT(8)
-#define VDEC_CAP_VP8_FRAME BIT(9)
-#define VDEC_CAP_VP9_FRAME BIT(10)
-
-/*
- * Video encoder supported capability:
- * BIT(0): enable 4K
- */
-#define VENC_CAP_4K BIT(0)
-
#ifndef SCP_IPI_INIT
#error If CONFIG_IPI is enabled, SCP_IPI_INIT must be defined.
#endif
diff --git a/chip/mt_scp/rv32i_common/video.h b/chip/mt_scp/rv32i_common/video.h
new file mode 100644
index 0000000000..773ce75279
--- /dev/null
+++ b/chip/mt_scp/rv32i_common/video.h
@@ -0,0 +1,30 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_VIDEO_H
+#define __CROS_EC_VIDEO_H
+
+#include "common.h"
+
+/*
+ * Video decoder supported capability
+ */
+#define VDEC_CAP_4K_DISABLED BIT(4)
+#define VDEC_CAP_MM21 BIT(5)
+#define VDEC_CAP_MT21C BIT(6)
+#define VDEC_CAP_H264_SLICE BIT(8)
+#define VDEC_CAP_VP8_FRAME BIT(9)
+#define VDEC_CAP_VP9_FRAME BIT(10)
+
+/*
+ * Video encoder supported capability:
+ * BIT(0): enable 4K
+ */
+#define VENC_CAP_4K BIT(0)
+
+uint32_t video_get_enc_capability(void);
+uint32_t video_get_dec_capability(void);
+
+#endif /* #ifndef __CROS_EC_VIDEO_H */