From 89b0913c8afe073018aba1f64188220c2d23ba9e Mon Sep 17 00:00:00 2001 From: "Nanxin.Qin" Date: Fri, 2 Feb 2018 16:20:06 +0800 Subject: [PATCH] media: add the cpu type of G12A and AVS2 vformat PD#156749: Change-Id: I7fb09105a939d9a0c6cd3a66202ad29ab9c3c272 Signed-off-by: Nanxin.Qin --- arch/arm64/boot/dts/amlogic/g12a_pxp.dts | 59 ++++++++++++++++++++- arch/arm64/boot/dts/amlogic/g12a_skt.dts | 58 ++++++++++++++++++++ include/linux/amlogic/media/utils/vformat.h | 1 + 3 files changed, 117 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/amlogic/g12a_pxp.dts b/arch/arm64/boot/dts/amlogic/g12a_pxp.dts index d3a3654e4fa5..7030f99b178b 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_pxp.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_pxp.dts @@ -92,7 +92,21 @@ size = <0x0 0x02900000>; alignment = <0x0 0x400000>; }; - + codec_mm_cma:linux,codec_mm_cma { + compatible = "shared-dma-pool"; + reusable; + /* ion_codec_mm max can alloc size 80M*/ + size = <0x0 0x13400000>; + alignment = <0x0 0x400000>; + linux,contiguous-region; + }; + /* codec shared reserved */ + codec_mm_reserved:linux,codec_mm_reserved { + compatible = "amlogic, codec-mm-reserved"; + size = <0x0 0x0>; + alignment = <0x0 0x100000>; + //no-map; + }; }; vout { @@ -240,6 +254,49 @@ }; }; + codec_mm { + compatible = "amlogic, codec, mm"; + memory-region = <&codec_mm_cma &codec_mm_reserved>; + dev_name = "codec_mm"; + status = "okay"; + }; + + mesonstream { + compatible = "amlogic, codec, streambuf"; + dev_name = "mesonstream"; + status = "okay"; + // clocks = <&clkc CLKID_DOS_PARSER + // &clkc CLKID_DEMUX + // &clkc CLKID_DOS + // &clkc CLKID_VDEC_MUX + // &clkc CLKID_HCODEC_MUX + // &clkc CLKID_HEVC_MUX>; + // clock-names = "parser_top", + // "demux", + // "vdec", + // "clk_vdec_mux", + // "clk_hcodec_mux", + // "clk_hevc_mux"; + }; + + vdec { + compatible = "amlogic, vdec"; + dev_name = "vdec.0"; + status = "okay"; + interrupts = <0 3 1 + 0 23 1 + 0 32 1 + 0 43 1 + 0 44 1 + 0 45 1>; + interrupt-names = "vsync", + "demux", + "parser", + "mailbox_0", + "mailbox_1", + "mailbox_2"; + }; + rdma{ compatible = "amlogic, meson, rdma"; dev_name = "amlogic-rdma"; diff --git a/arch/arm64/boot/dts/amlogic/g12a_skt.dts b/arch/arm64/boot/dts/amlogic/g12a_skt.dts index 60de321b80b4..298a18d64712 100644 --- a/arch/arm64/boot/dts/amlogic/g12a_skt.dts +++ b/arch/arm64/boot/dts/amlogic/g12a_skt.dts @@ -95,6 +95,21 @@ size = <0x0 0x02900000>; alignment = <0x0 0x400000>; }; + codec_mm_cma:linux,codec_mm_cma { + compatible = "shared-dma-pool"; + reusable; + /* ion_codec_mm max can alloc size 80M*/ + size = <0x0 0x13400000>; + alignment = <0x0 0x400000>; + linux,contiguous-region; + }; + /* codec shared reserved */ + codec_mm_reserved:linux,codec_mm_reserved { + compatible = "amlogic, codec-mm-reserved"; + size = <0x0 0x0>; + alignment = <0x0 0x100000>; + //no-map; + }; }; vout { @@ -496,6 +511,49 @@ }; }; + codec_mm { + compatible = "amlogic, codec, mm"; + memory-region = <&codec_mm_cma &codec_mm_reserved>; + dev_name = "codec_mm"; + status = "okay"; + }; + + mesonstream { + compatible = "amlogic, codec, streambuf"; + dev_name = "mesonstream"; + status = "okay"; + // clocks = <&clkc CLKID_DOS_PARSER + // &clkc CLKID_DEMUX + // &clkc CLKID_DOS + // &clkc CLKID_VDEC_MUX + // &clkc CLKID_HCODEC_MUX + // &clkc CLKID_HEVC_MUX>; + // clock-names = "parser_top", + // "demux", + // "vdec", + // "clk_vdec_mux", + // "clk_hcodec_mux", + // "clk_hevc_mux"; + }; + + vdec { + compatible = "amlogic, vdec"; + dev_name = "vdec.0"; + status = "okay"; + interrupts = <0 3 1 + 0 23 1 + 0 32 1 + 0 43 1 + 0 44 1 + 0 45 1>; + interrupt-names = "vsync", + "demux", + "parser", + "mailbox_0", + "mailbox_1", + "mailbox_2"; + }; + rdma{ compatible = "amlogic, meson, rdma"; dev_name = "amlogic-rdma"; diff --git a/include/linux/amlogic/media/utils/vformat.h b/include/linux/amlogic/media/utils/vformat.h index b2ba08b94067..055fca71048b 100644 --- a/include/linux/amlogic/media/utils/vformat.h +++ b/include/linux/amlogic/media/utils/vformat.h @@ -34,6 +34,7 @@ enum vformat_e { VFORMAT_H264_ENC, VFORMAT_JPEG_ENC, VFORMAT_VP9, + VFORMAT_AVS2, VFORMAT_MAX };