Commit 1d1ca23b authored by Philipp Zabel's avatar Philipp Zabel Committed by Mauro Carvalho Chehab

media: coda: Add i.MX51 (CodaHx4) support

Add support for the CodaHx4 VPU used on i.MX51.

Decoding h.264, MPEG-4, and MPEG-2 video works, as well as encoding
h.264. MPEG-4 encoding is not enabled, it currently produces visual
artifacts.
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
[hans.verkuil@cisco.com: fix (bogus) sparse warning about uninited me_bits]
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 9f57ccdc
...@@ -68,8 +68,9 @@ static void coda_command_async(struct coda_ctx *ctx, int cmd) ...@@ -68,8 +68,9 @@ static void coda_command_async(struct coda_ctx *ctx, int cmd)
{ {
struct coda_dev *dev = ctx->dev; struct coda_dev *dev = ctx->dev;
if (dev->devtype->product == CODA_960 || if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) { dev->devtype->product == CODA_7541 ||
dev->devtype->product == CODA_960) {
/* Restore context related registers to CODA */ /* Restore context related registers to CODA */
coda_write(dev, ctx->bit_stream_param, coda_write(dev, ctx->bit_stream_param,
CODA_REG_BIT_BIT_STREAM_PARAM); CODA_REG_BIT_BIT_STREAM_PARAM);
...@@ -506,7 +507,8 @@ static int coda_alloc_context_buffers(struct coda_ctx *ctx, ...@@ -506,7 +507,8 @@ static int coda_alloc_context_buffers(struct coda_ctx *ctx,
goto err; goto err;
} }
if (!ctx->psbuf.vaddr && dev->devtype->product == CODA_7541) { if (!ctx->psbuf.vaddr && (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541)) {
ret = coda_alloc_context_buf(ctx, &ctx->psbuf, ret = coda_alloc_context_buf(ctx, &ctx->psbuf,
CODA7_PS_BUF_SIZE, "psbuf"); CODA7_PS_BUF_SIZE, "psbuf");
if (ret < 0) if (ret < 0)
...@@ -594,6 +596,7 @@ static void coda_setup_iram(struct coda_ctx *ctx) ...@@ -594,6 +596,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
int dbk_bits; int dbk_bits;
int bit_bits; int bit_bits;
int ip_bits; int ip_bits;
int me_bits;
memset(iram_info, 0, sizeof(*iram_info)); memset(iram_info, 0, sizeof(*iram_info));
iram_info->next_paddr = dev->iram.paddr; iram_info->next_paddr = dev->iram.paddr;
...@@ -603,15 +606,23 @@ static void coda_setup_iram(struct coda_ctx *ctx) ...@@ -603,15 +606,23 @@ static void coda_setup_iram(struct coda_ctx *ctx)
return; return;
switch (dev->devtype->product) { switch (dev->devtype->product) {
case CODA_HX4:
dbk_bits = CODA7_USE_HOST_DBK_ENABLE;
bit_bits = CODA7_USE_HOST_BIT_ENABLE;
ip_bits = CODA7_USE_HOST_IP_ENABLE;
me_bits = CODA7_USE_HOST_ME_ENABLE;
break;
case CODA_7541: case CODA_7541:
dbk_bits = CODA7_USE_HOST_DBK_ENABLE | CODA7_USE_DBK_ENABLE; dbk_bits = CODA7_USE_HOST_DBK_ENABLE | CODA7_USE_DBK_ENABLE;
bit_bits = CODA7_USE_HOST_BIT_ENABLE | CODA7_USE_BIT_ENABLE; bit_bits = CODA7_USE_HOST_BIT_ENABLE | CODA7_USE_BIT_ENABLE;
ip_bits = CODA7_USE_HOST_IP_ENABLE | CODA7_USE_IP_ENABLE; ip_bits = CODA7_USE_HOST_IP_ENABLE | CODA7_USE_IP_ENABLE;
me_bits = CODA7_USE_HOST_ME_ENABLE | CODA7_USE_ME_ENABLE;
break; break;
case CODA_960: case CODA_960:
dbk_bits = CODA9_USE_HOST_DBK_ENABLE | CODA9_USE_DBK_ENABLE; dbk_bits = CODA9_USE_HOST_DBK_ENABLE | CODA9_USE_DBK_ENABLE;
bit_bits = CODA9_USE_HOST_BIT_ENABLE | CODA7_USE_BIT_ENABLE; bit_bits = CODA9_USE_HOST_BIT_ENABLE | CODA7_USE_BIT_ENABLE;
ip_bits = CODA9_USE_HOST_IP_ENABLE | CODA7_USE_IP_ENABLE; ip_bits = CODA9_USE_HOST_IP_ENABLE | CODA7_USE_IP_ENABLE;
me_bits = 0;
break; break;
default: /* CODA_DX6 */ default: /* CODA_DX6 */
return; return;
...@@ -626,7 +637,8 @@ static void coda_setup_iram(struct coda_ctx *ctx) ...@@ -626,7 +637,8 @@ static void coda_setup_iram(struct coda_ctx *ctx)
w64 = mb_width * 64; w64 = mb_width * 64;
/* Prioritize in case IRAM is too small for everything */ /* Prioritize in case IRAM is too small for everything */
if (dev->devtype->product == CODA_7541) { if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) {
iram_info->search_ram_size = round_up(mb_width * 16 * iram_info->search_ram_size = round_up(mb_width * 16 *
36 + 2048, 1024); 36 + 2048, 1024);
iram_info->search_ram_paddr = coda_iram_alloc(iram_info, iram_info->search_ram_paddr = coda_iram_alloc(iram_info,
...@@ -635,8 +647,7 @@ static void coda_setup_iram(struct coda_ctx *ctx) ...@@ -635,8 +647,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
pr_err("IRAM is smaller than the search ram size\n"); pr_err("IRAM is smaller than the search ram size\n");
goto out; goto out;
} }
iram_info->axi_sram_use |= CODA7_USE_HOST_ME_ENABLE | iram_info->axi_sram_use |= me_bits;
CODA7_USE_ME_ENABLE;
} }
/* Only H.264BP and H.263P3 are considered */ /* Only H.264BP and H.263P3 are considered */
...@@ -688,7 +699,8 @@ static void coda_setup_iram(struct coda_ctx *ctx) ...@@ -688,7 +699,8 @@ static void coda_setup_iram(struct coda_ctx *ctx)
v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev, v4l2_dbg(1, coda_debug, &ctx->dev->v4l2_dev,
"IRAM smaller than needed\n"); "IRAM smaller than needed\n");
if (dev->devtype->product == CODA_7541) { if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) {
/* TODO - Enabling these causes picture errors on CODA7541 */ /* TODO - Enabling these causes picture errors on CODA7541 */
if (ctx->inst_type == CODA_INST_DECODER) { if (ctx->inst_type == CODA_INST_DECODER) {
/* fw 1.4.50 */ /* fw 1.4.50 */
...@@ -706,6 +718,7 @@ static void coda_setup_iram(struct coda_ctx *ctx) ...@@ -706,6 +718,7 @@ static void coda_setup_iram(struct coda_ctx *ctx)
static u32 coda_supported_firmwares[] = { static u32 coda_supported_firmwares[] = {
CODA_FIRMWARE_VERNUM(CODA_DX6, 2, 2, 5), CODA_FIRMWARE_VERNUM(CODA_DX6, 2, 2, 5),
CODA_FIRMWARE_VERNUM(CODA_HX4, 1, 4, 50),
CODA_FIRMWARE_VERNUM(CODA_7541, 1, 4, 50), CODA_FIRMWARE_VERNUM(CODA_7541, 1, 4, 50),
CODA_FIRMWARE_VERNUM(CODA_960, 2, 1, 5), CODA_FIRMWARE_VERNUM(CODA_960, 2, 1, 5),
CODA_FIRMWARE_VERNUM(CODA_960, 2, 3, 10), CODA_FIRMWARE_VERNUM(CODA_960, 2, 3, 10),
...@@ -890,6 +903,7 @@ static int coda_start_encoding(struct coda_ctx *ctx) ...@@ -890,6 +903,7 @@ static int coda_start_encoding(struct coda_ctx *ctx)
case CODA_960: case CODA_960:
coda_write(dev, 0, CODA9_GDI_WPROT_RGN_EN); coda_write(dev, 0, CODA9_GDI_WPROT_RGN_EN);
/* fallthrough */ /* fallthrough */
case CODA_HX4:
case CODA_7541: case CODA_7541:
coda_write(dev, CODA7_STREAM_BUF_DYNALLOC_EN | coda_write(dev, CODA7_STREAM_BUF_DYNALLOC_EN |
CODA7_STREAM_BUF_PIC_RESET, CODA_REG_BIT_STREAM_CTRL); CODA7_STREAM_BUF_PIC_RESET, CODA_REG_BIT_STREAM_CTRL);
...@@ -919,6 +933,7 @@ static int coda_start_encoding(struct coda_ctx *ctx) ...@@ -919,6 +933,7 @@ static int coda_start_encoding(struct coda_ctx *ctx)
value |= (q_data_src->height & CODADX6_PICHEIGHT_MASK) value |= (q_data_src->height & CODADX6_PICHEIGHT_MASK)
<< CODA_PICHEIGHT_OFFSET; << CODA_PICHEIGHT_OFFSET;
break; break;
case CODA_HX4:
case CODA_7541: case CODA_7541:
if (dst_fourcc == V4L2_PIX_FMT_H264) { if (dst_fourcc == V4L2_PIX_FMT_H264) {
value = (round_up(q_data_src->width, 16) & value = (round_up(q_data_src->width, 16) &
...@@ -1086,6 +1101,7 @@ static int coda_start_encoding(struct coda_ctx *ctx) ...@@ -1086,6 +1101,7 @@ static int coda_start_encoding(struct coda_ctx *ctx)
value = FMO_SLICE_SAVE_BUF_SIZE << 7; value = FMO_SLICE_SAVE_BUF_SIZE << 7;
coda_write(dev, value, CODADX6_CMD_ENC_SEQ_FMO); coda_write(dev, value, CODADX6_CMD_ENC_SEQ_FMO);
break; break;
case CODA_HX4:
case CODA_7541: case CODA_7541:
coda_write(dev, ctx->iram_info.search_ram_paddr, coda_write(dev, ctx->iram_info.search_ram_paddr,
CODA7_CMD_ENC_SEQ_SEARCH_BASE); CODA7_CMD_ENC_SEQ_SEARCH_BASE);
...@@ -1131,7 +1147,8 @@ static int coda_start_encoding(struct coda_ctx *ctx) ...@@ -1131,7 +1147,8 @@ static int coda_start_encoding(struct coda_ctx *ctx)
coda_write(dev, num_fb, CODA_CMD_SET_FRAME_BUF_NUM); coda_write(dev, num_fb, CODA_CMD_SET_FRAME_BUF_NUM);
coda_write(dev, stride, CODA_CMD_SET_FRAME_BUF_STRIDE); coda_write(dev, stride, CODA_CMD_SET_FRAME_BUF_STRIDE);
if (dev->devtype->product == CODA_7541) { if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) {
coda_write(dev, q_data_src->bytesperline, coda_write(dev, q_data_src->bytesperline,
CODA7_CMD_SET_FRAME_SOURCE_BUF_STRIDE); CODA7_CMD_SET_FRAME_SOURCE_BUF_STRIDE);
} }
...@@ -1570,7 +1587,8 @@ static bool coda_reorder_enable(struct coda_ctx *ctx) ...@@ -1570,7 +1587,8 @@ static bool coda_reorder_enable(struct coda_ctx *ctx)
struct coda_dev *dev = ctx->dev; struct coda_dev *dev = ctx->dev;
int profile, level; int profile, level;
if (dev->devtype->product != CODA_7541 && if (dev->devtype->product != CODA_HX4 &&
dev->devtype->product != CODA_7541 &&
dev->devtype->product != CODA_960) dev->devtype->product != CODA_960)
return false; return false;
...@@ -1664,7 +1682,8 @@ static int __coda_start_decoding(struct coda_ctx *ctx) ...@@ -1664,7 +1682,8 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
CODA_CMD_DEC_SEQ_MP4_ASP_CLASS); CODA_CMD_DEC_SEQ_MP4_ASP_CLASS);
} }
if (src_fourcc == V4L2_PIX_FMT_H264) { if (src_fourcc == V4L2_PIX_FMT_H264) {
if (dev->devtype->product == CODA_7541) { if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) {
coda_write(dev, ctx->psbuf.paddr, coda_write(dev, ctx->psbuf.paddr,
CODA_CMD_DEC_SEQ_PS_BB_START); CODA_CMD_DEC_SEQ_PS_BB_START);
coda_write(dev, (CODA7_PS_BUF_SIZE / 1024), coda_write(dev, (CODA7_PS_BUF_SIZE / 1024),
...@@ -1791,7 +1810,8 @@ static int __coda_start_decoding(struct coda_ctx *ctx) ...@@ -1791,7 +1810,8 @@ static int __coda_start_decoding(struct coda_ctx *ctx)
CODA_CMD_SET_FRAME_SLICE_BB_SIZE); CODA_CMD_SET_FRAME_SLICE_BB_SIZE);
} }
if (dev->devtype->product == CODA_7541) { if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) {
int max_mb_x = 1920 / 16; int max_mb_x = 1920 / 16;
int max_mb_y = 1088 / 16; int max_mb_y = 1088 / 16;
int max_mb_num = max_mb_x * max_mb_y; int max_mb_num = max_mb_x * max_mb_y;
...@@ -1909,6 +1929,7 @@ static int coda_prepare_decode(struct coda_ctx *ctx) ...@@ -1909,6 +1929,7 @@ static int coda_prepare_decode(struct coda_ctx *ctx)
switch (dev->devtype->product) { switch (dev->devtype->product) {
case CODA_DX6: case CODA_DX6:
/* TBD */ /* TBD */
case CODA_HX4:
case CODA_7541: case CODA_7541:
coda_write(dev, CODA_PRE_SCAN_EN, CODA_CMD_DEC_PIC_OPTION); coda_write(dev, CODA_PRE_SCAN_EN, CODA_CMD_DEC_PIC_OPTION);
break; break;
...@@ -2049,7 +2070,8 @@ static void coda_finish_decode(struct coda_ctx *ctx) ...@@ -2049,7 +2070,8 @@ static void coda_finish_decode(struct coda_ctx *ctx)
v4l2_err(&dev->v4l2_dev, v4l2_err(&dev->v4l2_dev,
"errors in %d macroblocks\n", err_mb); "errors in %d macroblocks\n", err_mb);
if (dev->devtype->product == CODA_7541) { if (dev->devtype->product == CODA_HX4 ||
dev->devtype->product == CODA_7541) {
val = coda_read(dev, CODA_RET_DEC_PIC_OPTION); val = coda_read(dev, CODA_RET_DEC_PIC_OPTION);
if (val == 0) { if (val == 0) {
/* not enough bitstream data */ /* not enough bitstream data */
......
...@@ -128,7 +128,8 @@ void coda_write_base(struct coda_ctx *ctx, struct coda_q_data *q_data, ...@@ -128,7 +128,8 @@ void coda_write_base(struct coda_ctx *ctx, struct coda_q_data *q_data,
/* /*
* Arrays of codecs supported by each given version of Coda: * Arrays of codecs supported by each given version of Coda:
* i.MX27 -> codadx6 * i.MX27 -> codadx6
* i.MX5x -> coda7 * i.MX51 -> codahx4
* i.MX53 -> coda7
* i.MX6 -> coda960 * i.MX6 -> coda960
* Use V4L2_PIX_FMT_YUV420 as placeholder for all supported YUV 4:2:0 variants * Use V4L2_PIX_FMT_YUV420 as placeholder for all supported YUV 4:2:0 variants
*/ */
...@@ -137,6 +138,13 @@ static const struct coda_codec codadx6_codecs[] = { ...@@ -137,6 +138,13 @@ static const struct coda_codec codadx6_codecs[] = {
CODA_CODEC(CODADX6_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 720, 576), CODA_CODEC(CODADX6_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 720, 576),
}; };
static const struct coda_codec codahx4_codecs[] = {
CODA_CODEC(CODA7_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 720, 576),
CODA_CODEC(CODA7_MODE_DECODE_H264, V4L2_PIX_FMT_H264, V4L2_PIX_FMT_YUV420, 1920, 1088),
CODA_CODEC(CODA7_MODE_DECODE_MP2, V4L2_PIX_FMT_MPEG2, V4L2_PIX_FMT_YUV420, 1920, 1088),
CODA_CODEC(CODA7_MODE_DECODE_MP4, V4L2_PIX_FMT_MPEG4, V4L2_PIX_FMT_YUV420, 1280, 720),
};
static const struct coda_codec coda7_codecs[] = { static const struct coda_codec coda7_codecs[] = {
CODA_CODEC(CODA7_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1280, 720), CODA_CODEC(CODA7_MODE_ENCODE_H264, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_H264, 1280, 720),
CODA_CODEC(CODA7_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1280, 720), CODA_CODEC(CODA7_MODE_ENCODE_MP4, V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_MPEG4, 1280, 720),
...@@ -234,6 +242,11 @@ static const struct coda_video_device *codadx6_video_devices[] = { ...@@ -234,6 +242,11 @@ static const struct coda_video_device *codadx6_video_devices[] = {
&coda_bit_encoder, &coda_bit_encoder,
}; };
static const struct coda_video_device *codahx4_video_devices[] = {
&coda_bit_encoder,
&coda_bit_decoder,
};
static const struct coda_video_device *coda7_video_devices[] = { static const struct coda_video_device *coda7_video_devices[] = {
&coda_bit_jpeg_encoder, &coda_bit_jpeg_encoder,
&coda_bit_jpeg_decoder, &coda_bit_jpeg_decoder,
...@@ -332,6 +345,8 @@ const char *coda_product_name(int product) ...@@ -332,6 +345,8 @@ const char *coda_product_name(int product)
switch (product) { switch (product) {
case CODA_DX6: case CODA_DX6:
return "CodaDx6"; return "CodaDx6";
case CODA_HX4:
return "CodaHx4";
case CODA_7541: case CODA_7541:
return "CODA7541"; return "CODA7541";
case CODA_960: case CODA_960:
...@@ -1775,7 +1790,8 @@ static void coda_encode_ctrls(struct coda_ctx *ctx) ...@@ -1775,7 +1790,8 @@ static void coda_encode_ctrls(struct coda_ctx *ctx)
V4L2_CID_MPEG_VIDEO_H264_PROFILE, V4L2_CID_MPEG_VIDEO_H264_PROFILE,
V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0, V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, 0x0,
V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE); V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE);
if (ctx->dev->devtype->product == CODA_7541) { if (ctx->dev->devtype->product == CODA_HX4 ||
ctx->dev->devtype->product == CODA_7541) {
v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
V4L2_CID_MPEG_VIDEO_H264_LEVEL, V4L2_CID_MPEG_VIDEO_H264_LEVEL,
V4L2_MPEG_VIDEO_H264_LEVEL_3_1, V4L2_MPEG_VIDEO_H264_LEVEL_3_1,
...@@ -1803,7 +1819,8 @@ static void coda_encode_ctrls(struct coda_ctx *ctx) ...@@ -1803,7 +1819,8 @@ static void coda_encode_ctrls(struct coda_ctx *ctx)
V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE, V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE, 0x0, V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE, 0x0,
V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE); V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE);
if (ctx->dev->devtype->product == CODA_7541 || if (ctx->dev->devtype->product == CODA_HX4 ||
ctx->dev->devtype->product == CODA_7541 ||
ctx->dev->devtype->product == CODA_960) { ctx->dev->devtype->product == CODA_960) {
v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops,
V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL, V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL,
...@@ -2004,6 +2021,7 @@ static int coda_open(struct file *file) ...@@ -2004,6 +2021,7 @@ static int coda_open(struct file *file)
if (enable_bwb || ctx->inst_type == CODA_INST_ENCODER) if (enable_bwb || ctx->inst_type == CODA_INST_ENCODER)
ctx->frame_mem_ctrl = CODA9_FRAME_ENABLE_BWB; ctx->frame_mem_ctrl = CODA9_FRAME_ENABLE_BWB;
/* fallthrough */ /* fallthrough */
case CODA_HX4:
case CODA_7541: case CODA_7541:
ctx->reg_idx = 0; ctx->reg_idx = 0;
break; break;
...@@ -2182,7 +2200,8 @@ static int coda_hw_init(struct coda_dev *dev) ...@@ -2182,7 +2200,8 @@ static int coda_hw_init(struct coda_dev *dev)
/* Tell the BIT where to find everything it needs */ /* Tell the BIT where to find everything it needs */
if (dev->devtype->product == CODA_960 || if (dev->devtype->product == CODA_960 ||
dev->devtype->product == CODA_7541) { dev->devtype->product == CODA_7541 ||
dev->devtype->product == CODA_HX4) {
coda_write(dev, dev->tempbuf.paddr, coda_write(dev, dev->tempbuf.paddr,
CODA_REG_BIT_TEMP_BUF_ADDR); CODA_REG_BIT_TEMP_BUF_ADDR);
coda_write(dev, 0, CODA_REG_BIT_BIT_STREAM_PARAM); coda_write(dev, 0, CODA_REG_BIT_BIT_STREAM_PARAM);
...@@ -2387,6 +2406,7 @@ static void coda_fw_callback(const struct firmware *fw, void *context) ...@@ -2387,6 +2406,7 @@ static void coda_fw_callback(const struct firmware *fw, void *context)
enum coda_platform { enum coda_platform {
CODA_IMX27, CODA_IMX27,
CODA_IMX51,
CODA_IMX53, CODA_IMX53,
CODA_IMX6Q, CODA_IMX6Q,
CODA_IMX6DL, CODA_IMX6DL,
...@@ -2407,6 +2427,21 @@ static const struct coda_devtype coda_devdata[] = { ...@@ -2407,6 +2427,21 @@ static const struct coda_devtype coda_devdata[] = {
.workbuf_size = 288 * 1024 + FMO_SLICE_SAVE_BUF_SIZE * 8 * 1024, .workbuf_size = 288 * 1024 + FMO_SLICE_SAVE_BUF_SIZE * 8 * 1024,
.iram_size = 0xb000, .iram_size = 0xb000,
}, },
[CODA_IMX51] = {
.firmware = {
"vpu_fw_imx51.bin",
"vpu/vpu_fw_imx51.bin",
"v4l-codahx4-imx51.bin"
},
.product = CODA_HX4,
.codecs = codahx4_codecs,
.num_codecs = ARRAY_SIZE(codahx4_codecs),
.vdevs = codahx4_video_devices,
.num_vdevs = ARRAY_SIZE(codahx4_video_devices),
.workbuf_size = 128 * 1024,
.tempbuf_size = 304 * 1024,
.iram_size = 0x14000,
},
[CODA_IMX53] = { [CODA_IMX53] = {
.firmware = { .firmware = {
"vpu_fw_imx53.bin", "vpu_fw_imx53.bin",
...@@ -2463,6 +2498,7 @@ MODULE_DEVICE_TABLE(platform, coda_platform_ids); ...@@ -2463,6 +2498,7 @@ MODULE_DEVICE_TABLE(platform, coda_platform_ids);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id coda_dt_ids[] = { static const struct of_device_id coda_dt_ids[] = {
{ .compatible = "fsl,imx27-vpu", .data = &coda_devdata[CODA_IMX27] }, { .compatible = "fsl,imx27-vpu", .data = &coda_devdata[CODA_IMX27] },
{ .compatible = "fsl,imx51-vpu", .data = &coda_devdata[CODA_IMX51] },
{ .compatible = "fsl,imx53-vpu", .data = &coda_devdata[CODA_IMX53] }, { .compatible = "fsl,imx53-vpu", .data = &coda_devdata[CODA_IMX53] },
{ .compatible = "fsl,imx6q-vpu", .data = &coda_devdata[CODA_IMX6Q] }, { .compatible = "fsl,imx6q-vpu", .data = &coda_devdata[CODA_IMX6Q] },
{ .compatible = "fsl,imx6dl-vpu", .data = &coda_devdata[CODA_IMX6DL] }, { .compatible = "fsl,imx6dl-vpu", .data = &coda_devdata[CODA_IMX6DL] },
......
...@@ -43,6 +43,7 @@ enum coda_inst_type { ...@@ -43,6 +43,7 @@ enum coda_inst_type {
enum coda_product { enum coda_product {
CODA_DX6 = 0xf001, CODA_DX6 = 0xf001,
CODA_HX4 = 0xf00a,
CODA_7541 = 0xf012, CODA_7541 = 0xf012,
CODA_960 = 0xf020, CODA_960 = 0xf020,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment