Skip to content

Commit

Permalink
kernel: add support for imx vpu
Browse files Browse the repository at this point in the history
This adds support for the Video Processing Unit IP block
which is present in certain i.MX SOC's.

The vpu used in imx6 is the coda960 which supports:
- h264 enc
- h264 dec
- jpeg enc
- jpeg dec

Please note that the required firmware needs to be added
by yourself as it's not available currently in linux-firmware upstream.

The firmware package can be found on the internet
and it will decompress itself exposing all binaries
after accepting the EULA.

The binaries should be placed at exactly these paths:

- /lib/firmware/vpu_fw_imx6d.bin
- /lib/firmware/vpu_fw_imx6q.bin

Following output will be printed at boottime if all is well:

[    9.769638] coda 2040000.vpu: Firmware code revision: 46076
[    9.775277] coda 2040000.vpu: Initialized CODA960.
[    9.780082] coda 2040000.vpu: Firmware version: 3.1.1
[    9.785312] coda 2040000.vpu: coda-jpeg-encoder registered as video0
[    9.791859] coda 2040000.vpu: coda-jpeg-decoder registered as video1
[    9.798375] coda 2040000.vpu: coda-video-encoder registered as video2
[    9.805013] coda 2040000.vpu: coda-video-decoder registered as video3

gstreamer will automatically detect and use all encoders/decoders.

Please note that a FILES catch-all is required for the videobuf-dma objects
as some modules enabling this could require (and thus generating) only 1 of them.

Signed-off-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
  • Loading branch information
xback committed Jul 7, 2023
1 parent f1a9240 commit 7a72629
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions package/kernel/linux/modules/video.mk
Original file line number Diff line number Diff line change
Expand Up @@ -1085,3 +1085,23 @@ define KernelPackage/video-dma/description
endef

$(eval $(call KernelPackage,video-dma))

define KernelPackage/video-coda
TITLE:=i.MX VPU support
DEPENDS:=@(TARGET_imx&&!TARGET_imx_cortexa7) +kmod-video-mem2mem +kmod-video-dma
KCONFIG:= \
CONFIG_VIDEO_CODA \
CONFIG_VIDEO_IMX_VDOA
FILES:= \
$(LINUX_DIR)/drivers/media/$(V4L2_MEM2MEM_DIR)/coda/coda-vpu.ko \
$(LINUX_DIR)/drivers/media/$(V4L2_MEM2MEM_DIR)/coda/imx-vdoa.ko \
$(LINUX_DIR)/drivers/media/$(V4L2_DIR)/v4l2-jpeg.ko
AUTOLOAD:=$(call AutoProbe,coda-vpu imx-vdoa v4l2-jpeg)
$(call AddDepends/video)
endef

define KernelPackage/video-coda/description
The i.MX Video Processing Unit (VPU) kernel module
endef

$(eval $(call KernelPackage,video-coda))

0 comments on commit 7a72629

Please sign in to comment.