├── PetaLinux └── bsp │ ├── zcu106 │ └── project-spec │ │ ├── meta-user │ │ ├── recipes-bsp │ │ │ ├── u-boot │ │ │ │ ├── files │ │ │ │ │ ├── bsp.cfg │ │ │ │ │ ├── platform-top.h │ │ │ │ │ └── 0001-ubifs-distroboot-support.patch │ │ │ │ └── u-boot-xlnx_%.bbappend │ │ │ └── device-tree │ │ │ │ ├── device-tree-sdt.inc │ │ │ │ └── device-tree.bbappend │ │ ├── recipes-apps │ │ │ └── initcams │ │ │ │ ├── .gdbinit │ │ │ │ ├── initcams.bb │ │ │ │ └── files │ │ │ │ └── init_cams.sh │ │ ├── meta-xilinx-tools │ │ │ └── recipes-bsp │ │ │ │ └── uboot-device-tree │ │ │ │ ├── files │ │ │ │ └── system-user.dtsi │ │ │ │ └── uboot-device-tree.bbappend │ │ ├── conf │ │ │ ├── petalinuxbsp.conf │ │ │ ├── user-rootfsconfig │ │ │ └── layer.conf │ │ ├── recipes-kernel │ │ │ └── linux │ │ │ │ ├── linux-xlnx_%.bbappend │ │ │ │ └── linux-xlnx │ │ │ │ └── bsp.cfg │ │ ├── COPYING.MIT │ │ └── README │ │ ├── attributes │ │ └── configs │ │ ├── init-ifupdown │ │ └── interfaces │ │ └── busybox │ │ └── inetd.conf │ ├── uzev │ └── project-spec │ │ ├── meta-user │ │ ├── recipes-bsp │ │ │ ├── u-boot │ │ │ │ ├── files │ │ │ │ │ ├── bsp.cfg │ │ │ │ │ ├── platform-top.h │ │ │ │ │ └── 0001-ubifs-distroboot-support.patch │ │ │ │ └── u-boot-xlnx_%.bbappend │ │ │ └── device-tree │ │ │ │ ├── device-tree-sdt.inc │ │ │ │ └── device-tree.bbappend │ │ ├── recipes-apps │ │ │ └── initcams │ │ │ │ ├── .gdbinit │ │ │ │ ├── initcams.bb │ │ │ │ └── files │ │ │ │ └── init_cams.sh │ │ ├── meta-xilinx-tools │ │ │ └── recipes-bsp │ │ │ │ └── uboot-device-tree │ │ │ │ ├── files │ │ │ │ └── system-user.dtsi │ │ │ │ └── uboot-device-tree.bbappend │ │ ├── conf │ │ │ ├── petalinuxbsp.conf │ │ │ ├── user-rootfsconfig │ │ │ └── layer.conf │ │ ├── recipes-kernel │ │ │ └── linux │ │ │ │ ├── linux-xlnx_%.bbappend │ │ │ │ └── linux-xlnx │ │ │ │ └── bsp.cfg │ │ ├── COPYING.MIT │ │ └── README │ │ ├── attributes │ │ └── configs │ │ ├── init-ifupdown │ │ └── interfaces │ │ └── busybox │ │ └── inetd.conf │ ├── zcu102 │ └── project-spec │ │ ├── meta-user │ │ ├── recipes-bsp │ │ │ ├── u-boot │ │ │ │ ├── files │ │ │ │ │ ├── bsp.cfg │ │ │ │ │ ├── platform-top.h │ │ │ │ │ └── 0001-ubifs-distroboot-support.patch │ │ │ │ └── u-boot-xlnx_%.bbappend │ │ │ └── device-tree │ │ │ │ ├── device-tree-sdt.inc │ │ │ │ └── device-tree.bbappend │ │ ├── recipes-apps │ │ │ └── initcams │ │ │ │ ├── .gdbinit │ │ │ │ ├── initcams.bb │ │ │ │ └── files │ │ │ │ └── init_cams.sh │ │ ├── meta-xilinx-tools │ │ │ └── recipes-bsp │ │ │ │ └── uboot-device-tree │ │ │ │ ├── files │ │ │ │ └── system-user.dtsi │ │ │ │ └── uboot-device-tree.bbappend │ │ ├── conf │ │ │ ├── petalinuxbsp.conf │ │ │ ├── user-rootfsconfig │ │ │ └── layer.conf │ │ ├── recipes-kernel │ │ │ └── linux │ │ │ │ ├── linux-xlnx_%.bbappend │ │ │ │ └── linux-xlnx │ │ │ │ └── bsp.cfg │ │ ├── COPYING.MIT │ │ └── README │ │ ├── attributes │ │ └── configs │ │ ├── init-ifupdown │ │ └── interfaces │ │ └── busybox │ │ └── inetd.conf │ ├── pynqzu │ └── project-spec │ │ ├── meta-user │ │ ├── recipes-apps │ │ │ └── initcams │ │ │ │ ├── .gdbinit │ │ │ │ ├── initcams.bb │ │ │ │ └── files │ │ │ │ └── init_cams.sh │ │ ├── meta-xilinx-tools │ │ │ └── recipes-bsp │ │ │ │ └── uboot-device-tree │ │ │ │ ├── files │ │ │ │ └── system-user.dtsi │ │ │ │ └── uboot-device-tree.bbappend │ │ ├── recipes-bsp │ │ │ ├── device-tree │ │ │ │ ├── device-tree-sdt.inc │ │ │ │ └── device-tree.bbappend │ │ │ └── u-boot │ │ │ │ ├── u-boot-xlnx_%.bbappend │ │ │ │ └── files │ │ │ │ ├── bsp.cfg │ │ │ │ ├── platform-top.h │ │ │ │ └── 0001-ubifs-distroboot-support.patch │ │ ├── conf │ │ │ ├── petalinuxbsp.conf │ │ │ └── user-rootfsconfig │ │ ├── recipes-kernel │ │ │ └── linux │ │ │ │ ├── linux-xlnx_%.bbappend │ │ │ │ └── linux-xlnx │ │ │ │ └── bsp.cfg │ │ └── recipes-modules │ │ │ └── wilc │ │ │ └── wilc_15.6.bb │ │ └── configs │ │ ├── init-ifupdown │ │ └── interfaces │ │ └── busybox │ │ └── inetd.conf │ ├── zcu104 │ └── project-spec │ │ ├── meta-user │ │ ├── recipes-apps │ │ │ └── initcams │ │ │ │ ├── .gdbinit │ │ │ │ ├── initcams.bb │ │ │ │ └── files │ │ │ │ └── init_cams.sh │ │ ├── recipes-bsp │ │ │ ├── u-boot │ │ │ │ ├── files │ │ │ │ │ ├── bsp.cfg │ │ │ │ │ ├── platform-top.h │ │ │ │ │ └── 0001-ubifs-distroboot-support.patch │ │ │ │ └── u-boot-xlnx_%.bbappend │ │ │ ├── device-tree │ │ │ │ ├── device-tree-sdt.inc │ │ │ │ └── device-tree.bbappend │ │ │ └── embeddedsw │ │ │ │ ├── fsbl-firmware_%.bbappend │ │ │ │ └── files │ │ │ │ └── zcu104_vadj_fsbl.patch │ │ ├── meta-xilinx-tools │ │ │ └── recipes-bsp │ │ │ │ └── uboot-device-tree │ │ │ │ ├── files │ │ │ │ └── system-user.dtsi │ │ │ │ └── uboot-device-tree.bbappend │ │ ├── conf │ │ │ ├── petalinuxbsp.conf │ │ │ ├── user-rootfsconfig │ │ │ └── layer.conf │ │ ├── recipes-kernel │ │ │ └── linux │ │ │ │ ├── linux-xlnx_%.bbappend │ │ │ │ └── linux-xlnx │ │ │ │ └── bsp.cfg │ │ ├── COPYING.MIT │ │ └── README │ │ ├── attributes │ │ └── configs │ │ ├── init-ifupdown │ │ └── interfaces │ │ └── busybox │ │ └── inetd.conf │ └── zcu102_hpc1 │ └── project-spec │ └── meta-user │ └── recipes-bsp │ └── device-tree │ └── files │ └── system-user.dtsi ├── .gitmodules ├── docs ├── source │ ├── images │ │ ├── rpi-camera-fmc-end-to-end.png │ │ ├── rpi-camera-fmc-architecture.png │ │ ├── rpi-camera-fmc-mipi-pipeline.png │ │ ├── rpi-camera-fmc-display-pipeline.png │ │ ├── rpi-camera-fmc-simple-pipeline.png │ │ └── rpi-camera-fmc-hdmi-display-pipe.png │ ├── troubleshooting.md │ ├── index.rst │ ├── revision_history.md │ ├── requirements.md │ ├── conf.py │ ├── supported_carriers.md │ ├── data.json │ ├── description.md │ └── build_instructions.md ├── Makefile ├── requirements.txt ├── make.bat └── README.md ├── Vitis ├── build-vitis.bat ├── py │ └── args.json ├── common │ └── src │ │ ├── platform_config.h │ │ ├── platform.h │ │ ├── dp159.h │ │ ├── frmbuf.h │ │ ├── reset_gpio.h │ │ ├── rpi_cam.h │ │ ├── config.h │ │ ├── imx219.h │ │ ├── ov5640.h │ │ ├── i2c.h │ │ ├── platform.c │ │ ├── pipe.h │ │ ├── rpi_cam.c │ │ ├── imx219.c │ │ ├── idt_8t49n24x.h │ │ ├── xhdmi_edid.h │ │ └── pipe.c └── Makefile ├── .gitignore ├── Vivado ├── build-vivado.bat ├── ip │ ├── isppipeline │ │ ├── run_hls.tcl │ │ └── include │ │ │ └── xf_config_params.h │ ├── get_part.tcl │ └── Makefile ├── scripts │ └── xsa.tcl ├── src │ └── constraints │ │ └── zcu102_hpc1.xdc └── Makefile ├── LICENSE └── .readthedocs.yaml /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SYS_CONFIG_NAME="platform-top" 2 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SYS_CONFIG_NAME="platform-top" 2 | CONFIG_CMD_SDRAM=y 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SYS_CONFIG_NAME="platform-top" 2 | CONFIG_CMD_SDRAM=y 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-apps/initcams/.gdbinit: -------------------------------------------------------------------------------- 1 | # Load the PetaLinux SDK main gdbinit script 2 | source plnx_gdbinit 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-apps/initcams/.gdbinit: -------------------------------------------------------------------------------- 1 | # Load the PetaLinux SDK main gdbinit script 2 | source plnx_gdbinit 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-apps/initcams/.gdbinit: -------------------------------------------------------------------------------- 1 | # Load the PetaLinux SDK main gdbinit script 2 | source plnx_gdbinit 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-apps/initcams/.gdbinit: -------------------------------------------------------------------------------- 1 | # Load the PetaLinux SDK main gdbinit script 2 | source plnx_gdbinit 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-apps/initcams/.gdbinit: -------------------------------------------------------------------------------- 1 | # Load the PetaLinux SDK main gdbinit script 2 | source plnx_gdbinit 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "submodules/Vitis_Libraries"] 2 | path = submodules/Vitis_Libraries 3 | url = https://github.com/Xilinx/Vitis_Libraries.git 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SYS_CONFIG_NAME="platform-top" 2 | CONFIG_ZYNQ_GEM_I2C_MAC_OFFSET=0x20 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/files/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | }; 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/files/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | }; 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/files/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | }; 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/files/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | }; 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/files/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | }; 4 | -------------------------------------------------------------------------------- /docs/source/images/rpi-camera-fmc-end-to-end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpgadeveloper/rpi-camera-fmc/HEAD/docs/source/images/rpi-camera-fmc-end-to-end.png -------------------------------------------------------------------------------- /docs/source/images/rpi-camera-fmc-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpgadeveloper/rpi-camera-fmc/HEAD/docs/source/images/rpi-camera-fmc-architecture.png -------------------------------------------------------------------------------- /docs/source/images/rpi-camera-fmc-mipi-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpgadeveloper/rpi-camera-fmc/HEAD/docs/source/images/rpi-camera-fmc-mipi-pipeline.png -------------------------------------------------------------------------------- /docs/source/images/rpi-camera-fmc-display-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpgadeveloper/rpi-camera-fmc/HEAD/docs/source/images/rpi-camera-fmc-display-pipeline.png -------------------------------------------------------------------------------- /docs/source/images/rpi-camera-fmc-simple-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpgadeveloper/rpi-camera-fmc/HEAD/docs/source/images/rpi-camera-fmc-simple-pipeline.png -------------------------------------------------------------------------------- /docs/source/images/rpi-camera-fmc-hdmi-display-pipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fpgadeveloper/rpi-camera-fmc/HEAD/docs/source/images/rpi-camera-fmc-hdmi-display-pipe.png -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc: -------------------------------------------------------------------------------- 1 | SRC_URI:append = " file://system-conf.dtsi" 2 | EXTRA_OVERLAYS:append:linux = " system-user.dtsi" 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc: -------------------------------------------------------------------------------- 1 | SRC_URI:append = " file://system-conf.dtsi" 2 | EXTRA_OVERLAYS:append:linux = " system-user.dtsi" 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc: -------------------------------------------------------------------------------- 1 | SRC_URI:append = " file://system-conf.dtsi" 2 | EXTRA_OVERLAYS:append:linux = " system-user.dtsi" 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc: -------------------------------------------------------------------------------- 1 | SRC_URI:append = " file://system-conf.dtsi" 2 | EXTRA_OVERLAYS:append:linux = " system-user.dtsi" 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-bsp/device-tree/device-tree-sdt.inc: -------------------------------------------------------------------------------- 1 | SRC_URI:append = " file://system-conf.dtsi" 2 | EXTRA_OVERLAYS:append:linux = " system-user.dtsi" 3 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://platform-top.h file://bsp.cfg" 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://platform-top.h file://bsp.cfg" 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://platform-top.h file://bsp.cfg" 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://platform-top.h file://bsp.cfg" 4 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://platform-top.h file://bsp.cfg" 4 | -------------------------------------------------------------------------------- /Vitis/build-vitis.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | setlocal ENABLEDELAYEDEXPANSION 4 | SET vitis=C:\Xilinx\Vitis\2024.1\bin\vitis.bat 5 | cmd /c "%vitis% -s py\build-vitis.py py\args.json ..\docs\source\data.json" 6 | pause 7 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/conf/petalinuxbsp.conf: -------------------------------------------------------------------------------- 1 | #User Configuration 2 | 3 | #OE_TERMINAL = "tmux" 4 | IMAGE_BOOT_FILES:zynqmp = "BOOT.BIN boot.scr Image ramdisk.cpio.gz.u-boot rootfs.cpio.gz.u-boot" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append = " file://bsp.cfg" 4 | KERNEL_FEATURES:append = " bsp.cfg" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/conf/petalinuxbsp.conf: -------------------------------------------------------------------------------- 1 | #User Configuration 2 | 3 | #OE_TERMINAL = "tmux" 4 | IMAGE_BOOT_FILES:zynqmp = "BOOT.BIN boot.scr Image ramdisk.cpio.gz.u-boot rootfs.cpio.gz.u-boot" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append = " file://bsp.cfg" 4 | KERNEL_FEATURES:append = " bsp.cfg" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/conf/petalinuxbsp.conf: -------------------------------------------------------------------------------- 1 | #User Configuration 2 | 3 | #OE_TERMINAL = "tmux" 4 | IMAGE_BOOT_FILES:zynqmp = "BOOT.BIN boot.scr Image ramdisk.cpio.gz.u-boot rootfs.cpio.gz.u-boot" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append = " file://bsp.cfg" 4 | KERNEL_FEATURES:append = " bsp.cfg" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/conf/petalinuxbsp.conf: -------------------------------------------------------------------------------- 1 | #User Configuration 2 | 3 | #OE_TERMINAL = "tmux" 4 | IMAGE_BOOT_FILES:zynqmp = "BOOT.BIN boot.scr Image ramdisk.cpio.gz.u-boot rootfs.cpio.gz.u-boot" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append = " file://bsp.cfg" 4 | KERNEL_FEATURES:append = " bsp.cfg" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/conf/petalinuxbsp.conf: -------------------------------------------------------------------------------- 1 | #User Configuration 2 | 3 | #OE_TERMINAL = "tmux" 4 | IMAGE_BOOT_FILES:zynqmp = "BOOT.BIN boot.scr Image ramdisk.cpio.gz.u-boot rootfs.cpio.gz.u-boot" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 2 | 3 | SRC_URI:append = " file://bsp.cfg" 4 | KERNEL_FEATURES:append = " bsp.cfg" 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/bsp.cfg: -------------------------------------------------------------------------------- 1 | # CONFIG_VIDEO_AP1302 is not set 2 | CONFIG_VIDEO_IMX219=y 3 | # CONFIG_VIDEO_IMX274 is not set 4 | CONFIG_VIDEO_OV5640=y 5 | CONFIG_NFSD=y 6 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/meta-xilinx-tools/recipes-bsp/uboot-device-tree/uboot-device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/bsp.cfg: -------------------------------------------------------------------------------- 1 | # CONFIG_VIDEO_AP1302 is not set 2 | CONFIG_VIDEO_IMX219=y 3 | # CONFIG_VIDEO_IMX274 is not set 4 | CONFIG_VIDEO_OV5640=y 5 | CONFIG_NFSD=y 6 | 7 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/bsp.cfg: -------------------------------------------------------------------------------- 1 | # CONFIG_VIDEO_AP1302 is not set 2 | CONFIG_VIDEO_IMX219=y 3 | # CONFIG_VIDEO_IMX274 is not set 4 | CONFIG_VIDEO_OV5640=y 5 | CONFIG_NFSD=y 6 | 7 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/attributes: -------------------------------------------------------------------------------- 1 | #Virtual Providers 2 | 3 | 4 | 5 | #defconfigs 6 | 7 | UBOOT_DEFAULT_DEFCONFIG="xilinx_zynqmp_virt_defconfig" 8 | 9 | #atf 10 | CONFIG_SUBSYSTEM_PRELOADED_BL33_BASE="0x8000000" 11 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/attributes: -------------------------------------------------------------------------------- 1 | #Virtual Providers 2 | 3 | 4 | 5 | #defconfigs 6 | 7 | UBOOT_DEFAULT_DEFCONFIG="xilinx_zynqmp_virt_defconfig" 8 | 9 | #atf 10 | 11 | CONFIG_SUBSYSTEM_PRELOADED_BL33_BASE=0x10080000 12 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/attributes: -------------------------------------------------------------------------------- 1 | #Virtual Providers 2 | 3 | 4 | 5 | #defconfigs 6 | 7 | UBOOT_DEFAULT_DEFCONFIG="xilinx_zynqmp_virt_defconfig" 8 | 9 | #atf 10 | 11 | CONFIG_SUBSYSTEM_PRELOADED_BL33_BASE=0x10080000 12 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/attributes: -------------------------------------------------------------------------------- 1 | #Virtual Providers 2 | 3 | 4 | 5 | #defconfigs 6 | 7 | UBOOT_DEFAULT_DEFCONFIG="xilinx_zynqmp_virt_defconfig" 8 | 9 | #atf 10 | 11 | CONFIG_SUBSYSTEM_PRELOADED_BL33_BASE=0x10080000 12 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/embeddedsw/fsbl-firmware_%.bbappend: -------------------------------------------------------------------------------- 1 | # Patch for FSBL 2 | SRC_URI:append = " \ 3 | file://zcu104_vadj_fsbl.patch \ 4 | " 5 | 6 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 7 | 8 | -------------------------------------------------------------------------------- /Vitis/py/args.json: -------------------------------------------------------------------------------- 1 | { 2 | "bd_name": "rpi", 3 | "app_name": "test_app", 4 | "app_template": "None", 5 | "src": { 6 | "all": "common/src", 7 | "mb": "", 8 | "zynq": "", 9 | "zynqmp": "", 10 | "versal": "" 11 | }, 12 | "combine_bit_elf": false 13 | } -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | require ${@'device-tree-sdt.inc' if d.getVar('SYSTEM_DTFILE') != '' else ''} 6 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | require ${@'device-tree-sdt.inc' if d.getVar('SYSTEM_DTFILE') != '' else ''} 6 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | require ${@'device-tree-sdt.inc' if d.getVar('SYSTEM_DTFILE') != '' else ''} 6 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | require ${@'device-tree-sdt.inc' if d.getVar('SYSTEM_DTFILE') != '' else ''} 6 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-bsp/device-tree/device-tree.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 2 | 3 | SRC_URI:append = " file://system-user.dtsi" 4 | 5 | require ${@'device-tree-sdt.inc' if d.getVar('SYSTEM_DTFILE') != '' else ''} 6 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/bsp.cfg: -------------------------------------------------------------------------------- 1 | # CONFIG_VIDEO_AP1302 is not set 2 | CONFIG_VIDEO_IMX219=y 3 | # CONFIG_VIDEO_IMX274 is not set 4 | CONFIG_VIDEO_OV5640=y 5 | CONFIG_NFSD=y 6 | # CONFIG_NFSD_V3 is not set 7 | # CONFIG_NFSD_V4 is not set 8 | 9 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/conf/user-rootfsconfig: -------------------------------------------------------------------------------- 1 | #Note: Mention Each package in individual line 2 | #These packages will get added into rootfs menu entry 3 | 4 | CONFIG_gpio-demo 5 | CONFIG_peekpoke 6 | 7 | # RPi Camera FMC additions 8 | 9 | CONFIG_packagegroup-petalinux-multimedia 10 | CONFIG_packagegroup-petalinux-x11 11 | CONFIG_initcams 12 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/conf/user-rootfsconfig: -------------------------------------------------------------------------------- 1 | #Note: Mention Each package in individual line 2 | #These packages will get added into rootfs menu entry 3 | 4 | CONFIG_gpio-demo 5 | CONFIG_peekpoke 6 | 7 | # RPi Camera FMC additions 8 | 9 | CONFIG_packagegroup-petalinux-multimedia 10 | CONFIG_packagegroup-petalinux-x11 11 | CONFIG_initcams 12 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/conf/user-rootfsconfig: -------------------------------------------------------------------------------- 1 | #Note: Mention Each package in individual line 2 | #These packages will get added into rootfs menu entry 3 | 4 | CONFIG_gpio-demo 5 | CONFIG_peekpoke 6 | 7 | # RPi Camera FMC additions 8 | 9 | CONFIG_packagegroup-petalinux-multimedia 10 | CONFIG_packagegroup-petalinux-x11 11 | CONFIG_initcams 12 | -------------------------------------------------------------------------------- /Vitis/common/src/platform_config.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C) 2018 - 2020 Xilinx, Inc. All rights reserved. 4 | SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | #ifndef __PLATFORM_CONFIG_H_ 8 | #define __PLATFORM_CONFIG_H_ 9 | 10 | #define STDOUT_IS_PSU_UART 11 | #define UART_DEVICE_ID 0 12 | #endif 13 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_SYS_CONFIG_NAME="platform-top" 2 | 3 | CONFIG_NET=y 4 | CONFIG_NET_TFTP_VARS=y 5 | CONFIG_NET_RANDOM_ETHADDR=y 6 | CONFIG_CMD_NET=y 7 | CONFIG_CMD_PING=y 8 | CONFIG_CMD_DHCP=y 9 | CONFIG_CMD_TFTPPUT=y 10 | CONFIG_CMD_NFS=y 11 | CONFIG_BOOTDELAY=2 12 | CONFIG_DM_MMC=y 13 | CONFIG_MMC_SDHCI=y 14 | CONFIG_MMC_SDHCI_ZYNQ=y 15 | CONFIG_CMD_MMC=y 16 | CONFIG_CMD_SDRAM=y 17 | 18 | -------------------------------------------------------------------------------- /Vitis/common/src/platform.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (C) 2008 - 2020 Xilinx, Inc. All rights reserved. 3 | * SPDX-License-Identifier: MIT 4 | ******************************************************************************/ 5 | 6 | 7 | #ifndef __PLATFORM_H_ 8 | #define __PLATFORM_H_ 9 | 10 | #include "platform_config.h" 11 | 12 | void init_platform(); 13 | void cleanup_platform(); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/conf/user-rootfsconfig: -------------------------------------------------------------------------------- 1 | #Note: Mention Each package in individual line 2 | #These packages will get added into rootfs menu entry 3 | 4 | CONFIG_gpio-demo 5 | CONFIG_peekpoke 6 | CONFIG_gstreamer-vcu-examples 7 | CONFIG_packagegroup-petalinux-v4lutils 8 | CONFIG_packagegroup-petalinux-audio 9 | CONFIG_gstreamer-vcu-notebooks 10 | 11 | # RPi Camera FMC additions 12 | 13 | CONFIG_packagegroup-petalinux-multimedia 14 | CONFIG_packagegroup-petalinux-x11 15 | CONFIG_initcams 16 | -------------------------------------------------------------------------------- /docs/source/troubleshooting.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | ## Build failures 4 | 5 | Check the following if the project fails to build or generate a bitstream: 6 | 7 | 1. **Are you using the correct version of Vivado for this version of the repository?** 8 | Check the version specified in the Requirements section of the README.md file. 9 | 10 | 2. **Did you follow the** [build instructions](build_instructions) **?** 11 | If it still doesn't build, please let us know and provide details of your setup and the error message(s). 12 | 13 | 14 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h: -------------------------------------------------------------------------------- 1 | #if defined(CONFIG_MICROBLAZE) 2 | #include 3 | #define CONFIG_SYS_BOOTM_LEN 0xF000000 4 | #endif 5 | #if defined(CONFIG_ARCH_ZYNQ) 6 | #include 7 | #endif 8 | #if defined(CONFIG_ARCH_ZYNQMP) 9 | #include 10 | #endif 11 | #if defined(CONFIG_ARCH_VERSAL) 12 | #include 13 | #endif 14 | #if defined(CONFIG_ARCH_VERSAL_NET) 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h: -------------------------------------------------------------------------------- 1 | #if defined(CONFIG_MICROBLAZE) 2 | #include 3 | #define CONFIG_SYS_BOOTM_LEN 0xF000000 4 | #endif 5 | #if defined(CONFIG_ARCH_ZYNQ) 6 | #include 7 | #endif 8 | #if defined(CONFIG_ARCH_ZYNQMP) 9 | #include 10 | #endif 11 | #if defined(CONFIG_ARCH_VERSAL) 12 | #include 13 | #endif 14 | #if defined(CONFIG_ARCH_VERSAL_NET) 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h: -------------------------------------------------------------------------------- 1 | #if defined(CONFIG_MICROBLAZE) 2 | #include 3 | #define CONFIG_SYS_BOOTM_LEN 0xF000000 4 | #endif 5 | #if defined(CONFIG_ARCH_ZYNQ) 6 | #include 7 | #endif 8 | #if defined(CONFIG_ARCH_ZYNQMP) 9 | #include 10 | #endif 11 | #if defined(CONFIG_ARCH_VERSAL) 12 | #include 13 | #endif 14 | #if defined(CONFIG_ARCH_VERSAL_NET) 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h: -------------------------------------------------------------------------------- 1 | #if defined(CONFIG_MICROBLAZE) 2 | #include 3 | #define CONFIG_SYS_BOOTM_LEN 0xF000000 4 | #endif 5 | #if defined(CONFIG_ARCH_ZYNQ) 6 | #include 7 | #endif 8 | #if defined(CONFIG_ARCH_ZYNQMP) 9 | #include 10 | #endif 11 | #if defined(CONFIG_ARCH_VERSAL) 12 | #include 13 | #endif 14 | #if defined(CONFIG_ARCH_VERSAL_NET) 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/conf/user-rootfsconfig: -------------------------------------------------------------------------------- 1 | #Note: Mention Each package in individual line 2 | #These packages will get added into rootfs menu entry 3 | 4 | CONFIG_gpio-demo 5 | CONFIG_peekpoke 6 | CONFIG_gstreamer-vcu-examples 7 | CONFIG_packagegroup-petalinux-v4lutils 8 | CONFIG_packagegroup-petalinux-audio 9 | CONFIG_gstreamer-vcu-notebooks 10 | #CONFIG_zcu106-1.0 11 | #CONFIG_zcu106-2.0 12 | 13 | # RPi Camera FMC additions 14 | 15 | CONFIG_packagegroup-petalinux-multimedia 16 | CONFIG_packagegroup-petalinux-x11 17 | CONFIG_initcams 18 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-bsp/u-boot/files/platform-top.h: -------------------------------------------------------------------------------- 1 | #if defined(CONFIG_MICROBLAZE) 2 | #include 3 | #define CONFIG_SYS_BOOTM_LEN 0xF000000 4 | #endif 5 | #if defined(CONFIG_ARCH_ZYNQ) 6 | #include 7 | #endif 8 | #if defined(CONFIG_ARCH_ZYNQMP) 9 | #include 10 | #endif 11 | #if defined(CONFIG_ARCH_VERSAL) 12 | #include 13 | #endif 14 | #if defined(CONFIG_ARCH_VERSAL_NET) 15 | #include 16 | #endif 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | # Define dynamic layers 9 | BBFILES_DYNAMIC += " \ 10 | xilinx-tools:${LAYERDIR}/meta-xilinx-tools/recipes-*/*/*.bbappend \ 11 | " 12 | 13 | BBFILE_COLLECTIONS += "meta-user" 14 | BBFILE_PATTERN_meta-user = "^${LAYERDIR}/" 15 | BBFILE_PRIORITY_meta-user = "7" 16 | LAYERSERIES_COMPAT_meta-user = "langdale" 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | # Define dynamic layers 9 | BBFILES_DYNAMIC += " \ 10 | xilinx-tools:${LAYERDIR}/meta-xilinx-tools/recipes-*/*/*.bbappend \ 11 | " 12 | 13 | BBFILE_COLLECTIONS += "meta-user" 14 | BBFILE_PATTERN_meta-user = "^${LAYERDIR}/" 15 | BBFILE_PRIORITY_meta-user = "7" 16 | LAYERSERIES_COMPAT_meta-user = "langdale" 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | # Define dynamic layers 9 | BBFILES_DYNAMIC += " \ 10 | xilinx-tools:${LAYERDIR}/meta-xilinx-tools/recipes-*/*/*.bbappend \ 11 | " 12 | 13 | BBFILE_COLLECTIONS += "meta-user" 14 | BBFILE_PATTERN_meta-user = "^${LAYERDIR}/" 15 | BBFILE_PRIORITY_meta-user = "7" 16 | LAYERSERIES_COMPAT_meta-user = "langdale" 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have recipes-* directories, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | # Define dynamic layers 9 | BBFILES_DYNAMIC += " \ 10 | xilinx-tools:${LAYERDIR}/meta-xilinx-tools/recipes-*/*/*.bbappend \ 11 | " 12 | 13 | BBFILE_COLLECTIONS += "meta-user" 14 | BBFILE_PATTERN_meta-user = "^${LAYERDIR}/" 15 | BBFILE_PRIORITY_meta-user = "7" 16 | LAYERSERIES_COMPAT_meta-user = "langdale" 17 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-apps/initcams/initcams.bb: -------------------------------------------------------------------------------- 1 | # 2 | # This file is the initcams recipe. 3 | # 4 | 5 | SUMMARY = "Scripts for RPi Camera FMC" 6 | SECTION = "PETALINUX/apps" 7 | LICENSE = "MIT" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 9 | 10 | SRC_URI = "file://init_cams.sh \ 11 | file://displaycams.sh \ 12 | " 13 | 14 | S = "${WORKDIR}" 15 | 16 | RDEPENDS:${PN} += "bash" 17 | 18 | do_install() { 19 | install -d ${D}${bindir} 20 | install -m 0755 ${WORKDIR}/init_cams.sh ${D}${bindir}/ 21 | install -m 0755 ${WORKDIR}/displaycams.sh ${D}${bindir}/ 22 | } 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-apps/initcams/initcams.bb: -------------------------------------------------------------------------------- 1 | # 2 | # This file is the initcams recipe. 3 | # 4 | 5 | SUMMARY = "Scripts for RPi Camera FMC" 6 | SECTION = "PETALINUX/apps" 7 | LICENSE = "MIT" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 9 | 10 | SRC_URI = "file://init_cams.sh \ 11 | file://displaycams.sh \ 12 | " 13 | 14 | S = "${WORKDIR}" 15 | 16 | RDEPENDS:${PN} += "bash" 17 | 18 | do_install() { 19 | install -d ${D}${bindir} 20 | install -m 0755 ${WORKDIR}/init_cams.sh ${D}${bindir}/ 21 | install -m 0755 ${WORKDIR}/displaycams.sh ${D}${bindir}/ 22 | } 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-apps/initcams/initcams.bb: -------------------------------------------------------------------------------- 1 | # 2 | # This file is the initcams recipe. 3 | # 4 | 5 | SUMMARY = "Scripts for RPi Camera FMC" 6 | SECTION = "PETALINUX/apps" 7 | LICENSE = "MIT" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 9 | 10 | SRC_URI = "file://init_cams.sh \ 11 | file://displaycams.sh \ 12 | " 13 | 14 | S = "${WORKDIR}" 15 | 16 | RDEPENDS:${PN} += "bash" 17 | 18 | do_install() { 19 | install -d ${D}${bindir} 20 | install -m 0755 ${WORKDIR}/init_cams.sh ${D}${bindir}/ 21 | install -m 0755 ${WORKDIR}/displaycams.sh ${D}${bindir}/ 22 | } 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-apps/initcams/initcams.bb: -------------------------------------------------------------------------------- 1 | # 2 | # This file is the initcams recipe. 3 | # 4 | 5 | SUMMARY = "Scripts for RPi Camera FMC" 6 | SECTION = "PETALINUX/apps" 7 | LICENSE = "MIT" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 9 | 10 | SRC_URI = "file://init_cams.sh \ 11 | file://displaycams.sh \ 12 | " 13 | 14 | S = "${WORKDIR}" 15 | 16 | RDEPENDS:${PN} += "bash" 17 | 18 | do_install() { 19 | install -d ${D}${bindir} 20 | install -m 0755 ${WORKDIR}/init_cams.sh ${D}${bindir}/ 21 | install -m 0755 ${WORKDIR}/displaycams.sh ${D}${bindir}/ 22 | } 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-apps/initcams/initcams.bb: -------------------------------------------------------------------------------- 1 | # 2 | # This file is the initcams recipe. 3 | # 4 | 5 | SUMMARY = "Scripts for RPi Camera FMC" 6 | SECTION = "PETALINUX/apps" 7 | LICENSE = "MIT" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" 9 | 10 | SRC_URI = "file://init_cams.sh \ 11 | file://displaycams.sh \ 12 | " 13 | 14 | S = "${WORKDIR}" 15 | 16 | RDEPENDS:${PN} += "bash" 17 | 18 | do_install() { 19 | install -d ${D}${bindir} 20 | install -m 0755 ${WORKDIR}/init_cams.sh ${D}${bindir}/ 21 | install -m 0755 ${WORKDIR}/displaycams.sh ${D}${bindir}/ 22 | } 23 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | RemoteSystemsTempFiles/ 2 | Vivado/.Xil/ 3 | *.log 4 | *.jou 5 | Vitis/*_workspace/ 6 | Vitis/.*/ 7 | Vitis/.* 8 | Vitis/boot/ 9 | docs/build/ 10 | Packages/ 11 | PetaLinux/offline.txt 12 | VitisAccel/*_workspace/ 13 | VitisAccel/*_container/ 14 | VitisAccel/kernels/build/ 15 | Vivado/ip/build/ 16 | bootimages/ 17 | PetaLinux/offline.txt 18 | # UPDATER START 19 | Vivado/zcu104/ 20 | PetaLinux/zcu104/ 21 | Vivado/zcu102_hpc0/ 22 | PetaLinux/zcu102_hpc0/ 23 | Vivado/zcu102_hpc1/ 24 | PetaLinux/zcu102_hpc1/ 25 | Vivado/zcu106_hpc0/ 26 | PetaLinux/zcu106_hpc0/ 27 | Vivado/pynqzu/ 28 | PetaLinux/pynqzu/ 29 | Vivado/genesyszu/ 30 | PetaLinux/genesyszu/ 31 | Vivado/uzev/ 32 | PetaLinux/uzev/ 33 | Vivado/auboard/ 34 | PetaLinux/auboard/ 35 | # UPDATER END 36 | -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | .. RPi Camera FMC Reference designs documentation master file, created by 2 | sphinx-quickstart on Sat Mar 30 14:26:08 2019. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | RPi Camera FMC Reference Designs 7 | ================================ 8 | 9 | This is the documentation for the `RPi Camera FMC`_ reference designs. 10 | 11 | 12 | .. toctree:: 13 | :maxdepth: 2 14 | :caption: User Guide 15 | 16 | description 17 | requirements 18 | supported_carriers 19 | build_instructions 20 | petalinux 21 | updating 22 | troubleshooting 23 | revision_history 24 | 25 | 26 | .. _RPi Camera FMC: https://camerafmc.com/docs/rpi-camera-fmc/overview/ 27 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/configs/init-ifupdown/interfaces: -------------------------------------------------------------------------------- 1 | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) 2 | 3 | # The loopback interface 4 | auto lo 5 | iface lo inet loopback 6 | 7 | # Wireless interfaces 8 | iface wlan0 inet dhcp 9 | wireless_mode managed 10 | wireless_essid any 11 | wpa-driver wext 12 | wpa-conf /etc/wpa_supplicant.conf 13 | 14 | iface atml0 inet dhcp 15 | 16 | # Wired or wireless interfaces 17 | auto eth0 18 | iface eth0 inet dhcp 19 | iface eth1 inet dhcp 20 | 21 | # Ethernet/RNDIS gadget (g_ether) 22 | # ... or on host side, usbnet and random hwaddr 23 | iface usb0 inet static 24 | address 192.168.7.2 25 | netmask 255.255.255.0 26 | network 192.168.7.0 27 | gateway 192.168.7.1 28 | 29 | # Bluetooth networking 30 | iface bnep0 inet dhcp 31 | 32 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/configs/init-ifupdown/interfaces: -------------------------------------------------------------------------------- 1 | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) 2 | 3 | # The loopback interface 4 | auto lo 5 | iface lo inet loopback 6 | 7 | # Wireless interfaces 8 | iface wlan0 inet dhcp 9 | wireless_mode managed 10 | wireless_essid any 11 | wpa-driver wext 12 | wpa-conf /etc/wpa_supplicant.conf 13 | 14 | iface atml0 inet dhcp 15 | 16 | # Wired or wireless interfaces 17 | auto eth0 18 | iface eth0 inet dhcp 19 | iface eth1 inet dhcp 20 | 21 | # Ethernet/RNDIS gadget (g_ether) 22 | # ... or on host side, usbnet and random hwaddr 23 | iface usb0 inet static 24 | address 192.168.7.2 25 | netmask 255.255.255.0 26 | network 192.168.7.0 27 | gateway 192.168.7.1 28 | 29 | # Bluetooth networking 30 | iface bnep0 inet dhcp 31 | 32 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/configs/init-ifupdown/interfaces: -------------------------------------------------------------------------------- 1 | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) 2 | 3 | # The loopback interface 4 | auto lo 5 | iface lo inet loopback 6 | 7 | # Wireless interfaces 8 | iface wlan0 inet dhcp 9 | wireless_mode managed 10 | wireless_essid any 11 | wpa-driver wext 12 | wpa-conf /etc/wpa_supplicant.conf 13 | 14 | iface atml0 inet dhcp 15 | 16 | # Wired or wireless interfaces 17 | auto eth0 18 | iface eth0 inet dhcp 19 | iface eth1 inet dhcp 20 | 21 | # Ethernet/RNDIS gadget (g_ether) 22 | # ... or on host side, usbnet and random hwaddr 23 | iface usb0 inet static 24 | address 192.168.7.2 25 | netmask 255.255.255.0 26 | network 192.168.7.0 27 | gateway 192.168.7.1 28 | 29 | # Bluetooth networking 30 | iface bnep0 inet dhcp 31 | 32 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/configs/init-ifupdown/interfaces: -------------------------------------------------------------------------------- 1 | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) 2 | 3 | # The loopback interface 4 | auto lo 5 | iface lo inet loopback 6 | 7 | # Wireless interfaces 8 | iface wlan0 inet dhcp 9 | wireless_mode managed 10 | wireless_essid any 11 | wpa-driver wext 12 | wpa-conf /etc/wpa_supplicant.conf 13 | 14 | iface atml0 inet dhcp 15 | 16 | # Wired or wireless interfaces 17 | auto eth0 18 | iface eth0 inet dhcp 19 | iface eth1 inet dhcp 20 | 21 | # Ethernet/RNDIS gadget (g_ether) 22 | # ... or on host side, usbnet and random hwaddr 23 | iface usb0 inet static 24 | address 192.168.7.2 25 | netmask 255.255.255.0 26 | network 192.168.7.0 27 | gateway 192.168.7.1 28 | 29 | # Bluetooth networking 30 | iface bnep0 inet dhcp 31 | 32 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/configs/init-ifupdown/interfaces: -------------------------------------------------------------------------------- 1 | # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) 2 | 3 | # The loopback interface 4 | auto lo 5 | iface lo inet loopback 6 | 7 | # Wireless interfaces 8 | iface wlan0 inet dhcp 9 | wireless_mode managed 10 | wireless_essid any 11 | wpa-driver wext 12 | wpa-conf /etc/wpa_supplicant.conf 13 | 14 | iface atml0 inet dhcp 15 | 16 | # Wired or wireless interfaces 17 | auto eth0 18 | iface eth0 inet dhcp 19 | iface eth1 inet dhcp 20 | 21 | # Ethernet/RNDIS gadget (g_ether) 22 | # ... or on host side, usbnet and random hwaddr 23 | iface usb0 inet static 24 | address 192.168.7.2 25 | netmask 255.255.255.0 26 | network 192.168.7.0 27 | gateway 192.168.7.1 28 | 29 | # Bluetooth networking 30 | iface bnep0 inet dhcp 31 | 32 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | alabaster==0.7.13 2 | Babel==2.12.1 3 | certifi==2023.7.22 4 | charset-normalizer==3.2.0 5 | commonmark==0.9.1 6 | docutils>=0.18.1 7 | idna==3.4 8 | imagesize==1.4.1 9 | importlib-metadata==6.8.0 10 | Jinja2==3.1.2 11 | markdown-it-py==3.0.0 12 | MarkupSafe==2.1.3 13 | mdit-py-plugins==0.4.0 14 | mdurl==0.1.2 15 | myst-parser==2.0.0 16 | packaging==23.1 17 | Pygments==2.16.1 18 | pytz==2023.3.post1 19 | PyYAML==6.0.1 20 | recommonmark==0.7.1 21 | requests==2.31.0 22 | snowballstemmer==2.2.0 23 | sphinx==7.1.2 24 | sphinx-rtd-theme==1.3.0 25 | sphinxcontrib-applehelp==1.0.4 26 | sphinxcontrib-devhelp==1.0.2 27 | sphinxcontrib-htmlhelp==2.0.1 28 | sphinxcontrib-jquery==4.1 29 | sphinxcontrib-jsmath==1.0.1 30 | sphinxcontrib-qthelp==1.0.3 31 | sphinxcontrib-serializinghtml==1.1.5 32 | urllib3==2.0.4 33 | zipp==3.16.2 34 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | %SPHINXBUILD% >NUL 2>NUL 14 | if errorlevel 9009 ( 15 | echo. 16 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 17 | echo.installed, then set the SPHINXBUILD environment variable to point 18 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 19 | echo.may add the Sphinx directory to PATH. 20 | echo. 21 | echo.If you don't have Sphinx installed, grab it from 22 | echo.https://www.sphinx-doc.org/ 23 | exit /b 1 24 | ) 25 | 26 | if "%1" == "" goto help 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /Vivado/build-vivado.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | SET vivado=C:\Xilinx\Vivado\2024.1\bin\vivado.bat 3 | if exist %vivado% ( 4 | %vivado% -mode batch -source scripts\build.tcl -notrace 5 | ) else ( 6 | ECHO. 7 | ECHO ############################### 8 | ECHO ### Failed to locate Vivado ### 9 | ECHO ############################### 10 | ECHO. 11 | ECHO This batch file "%~n0.bat" did not find Vivado installed in: 12 | ECHO. 13 | ECHO %vivado% 14 | ECHO. 15 | ECHO Fix the problem by doing one of the following: 16 | ECHO. 17 | ECHO 1. If you do not have this version of Vivado installed, 18 | ECHO please install it or download the project sources from 19 | ECHO a commit of the Git repository that was intended for 20 | ECHO your version of Vivado. 21 | ECHO. 22 | ECHO 2. If Vivado is installed in a different location on your 23 | ECHO PC, please modify the first line of this batch file 24 | ECHO to specify the correct location. 25 | ECHO. 26 | pause 27 | ) 28 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-modules/wilc/wilc_15.6.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2022 Xilinx, Inc 2 | 3 | # SPDX-License-Identifier: BSD-3-Clause 4 | 5 | SUMMARY = "Recipe for building an external wilc Linux kernel module" 6 | SECTION = "PETALINUX/modules" 7 | LICENSE = "GPLv2" 8 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" 9 | 10 | inherit module 11 | 12 | SRC_URI:append = " git://github.com/linux4sam/linux-at91.git;protocol=git;branch=${BRANCH};subpath=drivers/net/wireless/microchip/wilc1000" 13 | SRC_URI += "file://0001-wilc-pynqzu.patch" 14 | 15 | # Tag: linux4microchip+sam9x7-2022.07 16 | SRCREV = "1426a1e20ed37afbdf33851941388d1065aafaff" 17 | BRANCH = "linux-5.15-mchp+sam9x7" 18 | 19 | DEPENDS += "virtual/kernel" 20 | 21 | S = "${WORKDIR}/wilc1000" 22 | 23 | EXTRA_OEMAKE = 'CONFIG_WILC=y \ 24 | WLAN_VENDOR_MCHP=y \ 25 | CONFIG_WILC_SDIO=m \ 26 | CONFIG_WILC_SPI=n \ 27 | CONFIG_WILC1000_HW_OOB_INTR=n \ 28 | KERNEL_SRC="${STAGING_KERNEL_DIR}" \ 29 | O=${STAGING_KERNEL_BUILDDIR}' 30 | -------------------------------------------------------------------------------- /Vitis/common/src/dp159.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (C) 2018 - 2020 Xilinx, Inc. All rights reserved. 3 | * Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved. 4 | * SPDX-License-Identifier: MIT 5 | ******************************************************************************/ 6 | 7 | 8 | #ifndef DP159_H /* prevent circular inclusions */ 9 | #define DP159_H /* by using protection macros */ 10 | 11 | #include "xil_types.h" 12 | #include "xparameters.h" 13 | #ifndef versal 14 | #include "xvphy.h" 15 | #else 16 | #include "xhdmiphy1.h" 17 | #endif 18 | 19 | #ifdef SDT 20 | #define XPAR_IIC_0_BASEADDR XPAR_AXI_IIC_HDMI_CLK_BASEADDR 21 | #endif 22 | // Function prototypes 23 | #ifndef versal 24 | u32 i2c_dp159(XVphy *VphyPtr, u8 QuadId, u64 TxLineRate); 25 | #else 26 | u32 i2c_dp159(XHdmiphy1 *Hdmiphy1Ptr, u8 QuadId, u64 TxLineRate); 27 | #endif 28 | u32 i2c_dp159_write(u8 dev, u8 addr, u8 dat); 29 | u8 i2c_dp159_read(u8 dev, u8 addr); 30 | void i2c_dp159_dump(void); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/COPYING.MIT: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy 2 | of this software and associated documentation files (the "Software"), to deal 3 | in the Software without restriction, including without limitation the rights 4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 5 | copies of the Software, and to permit persons to whom the Software is 6 | furnished to do so, subject to the following conditions: 7 | 8 | The above copyright notice and this permission notice shall be included in 9 | all copies or substantial portions of the Software. 10 | 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 17 | THE SOFTWARE. 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Jeff Johnson 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/configs/busybox/inetd.conf: -------------------------------------------------------------------------------- 1 | #/etc/inetd.conf: see inetd(8) for further informations. 2 | # 3 | # Internet server configuration database 4 | # 5 | # If you want to disable an entry so it isn't touched during 6 | # package updates just comment it out with a single '#' character. 7 | # 8 | # 9 | # 10 | #:INTERNAL: Internal services 11 | #echo stream tcp nowait root internal 12 | #echo dgram udp wait root internal 13 | #chargen stream tcp nowait root internal 14 | #chargen dgram udp wait root internal 15 | #discard stream tcp nowait root internal 16 | #discard dgram udp wait root internal 17 | #daytime stream tcp nowait root internal 18 | #daytime dgram udp wait root internal 19 | #time stream tcp nowait root internal 20 | #time dgram udp wait root internal 21 | telnet stream tcp nowait root telnetd telnetd -i 22 | ftp stream tcp nowait root ftpd ftpd -w 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/configs/busybox/inetd.conf: -------------------------------------------------------------------------------- 1 | #/etc/inetd.conf: see inetd(8) for further informations. 2 | # 3 | # Internet server configuration database 4 | # 5 | # If you want to disable an entry so it isn't touched during 6 | # package updates just comment it out with a single '#' character. 7 | # 8 | # 9 | # 10 | #:INTERNAL: Internal services 11 | #echo stream tcp nowait root internal 12 | #echo dgram udp wait root internal 13 | #chargen stream tcp nowait root internal 14 | #chargen dgram udp wait root internal 15 | #discard stream tcp nowait root internal 16 | #discard dgram udp wait root internal 17 | #daytime stream tcp nowait root internal 18 | #daytime dgram udp wait root internal 19 | #time stream tcp nowait root internal 20 | #time dgram udp wait root internal 21 | telnet stream tcp nowait root telnetd telnetd -i 22 | ftp stream tcp nowait root ftpd ftpd -w 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/configs/busybox/inetd.conf: -------------------------------------------------------------------------------- 1 | #/etc/inetd.conf: see inetd(8) for further informations. 2 | # 3 | # Internet server configuration database 4 | # 5 | # If you want to disable an entry so it isn't touched during 6 | # package updates just comment it out with a single '#' character. 7 | # 8 | # 9 | # 10 | #:INTERNAL: Internal services 11 | #echo stream tcp nowait root internal 12 | #echo dgram udp wait root internal 13 | #chargen stream tcp nowait root internal 14 | #chargen dgram udp wait root internal 15 | #discard stream tcp nowait root internal 16 | #discard dgram udp wait root internal 17 | #daytime stream tcp nowait root internal 18 | #daytime dgram udp wait root internal 19 | #time stream tcp nowait root internal 20 | #time dgram udp wait root internal 21 | telnet stream tcp nowait root telnetd telnetd -i 22 | ftp stream tcp nowait root ftpd ftpd -w 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/configs/busybox/inetd.conf: -------------------------------------------------------------------------------- 1 | #/etc/inetd.conf: see inetd(8) for further informations. 2 | # 3 | # Internet server configuration database 4 | # 5 | # If you want to disable an entry so it isn't touched during 6 | # package updates just comment it out with a single '#' character. 7 | # 8 | # 9 | # 10 | #:INTERNAL: Internal services 11 | #echo stream tcp nowait root internal 12 | #echo dgram udp wait root internal 13 | #chargen stream tcp nowait root internal 14 | #chargen dgram udp wait root internal 15 | #discard stream tcp nowait root internal 16 | #discard dgram udp wait root internal 17 | #daytime stream tcp nowait root internal 18 | #daytime dgram udp wait root internal 19 | #time stream tcp nowait root internal 20 | #time dgram udp wait root internal 21 | telnet stream tcp nowait root telnetd telnetd -i 22 | ftp stream tcp nowait root ftpd ftpd -w 23 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/configs/busybox/inetd.conf: -------------------------------------------------------------------------------- 1 | #/etc/inetd.conf: see inetd(8) for further informations. 2 | # 3 | # Internet server configuration database 4 | # 5 | # If you want to disable an entry so it isn't touched during 6 | # package updates just comment it out with a single '#' character. 7 | # 8 | # 9 | # 10 | #:INTERNAL: Internal services 11 | #echo stream tcp nowait root internal 12 | #echo dgram udp wait root internal 13 | #chargen stream tcp nowait root internal 14 | #chargen dgram udp wait root internal 15 | #discard stream tcp nowait root internal 16 | #discard dgram udp wait root internal 17 | #daytime stream tcp nowait root internal 18 | #daytime dgram udp wait root internal 19 | #time stream tcp nowait root internal 20 | #time dgram udp wait root internal 21 | telnet stream tcp nowait root telnetd telnetd -i 22 | ftp stream tcp nowait root ftpd ftpd -w 23 | -------------------------------------------------------------------------------- /Vitis/common/src/frmbuf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | */ 5 | 6 | #ifndef FRMBUF_H_ 7 | #define FRMBUF_H_ 8 | 9 | #include "xparameters.h" 10 | #include "xv_frmbufrd_l2.h" 11 | #include "xv_frmbufwr_l2.h" 12 | 13 | // Frmbuf struct 14 | typedef struct { 15 | XV_FrmbufWr_l2 FrmbufWr; 16 | XV_FrmbufRd_l2 FrmbufRd; 17 | UINTPTR FrmbufBufrBaseAddr; 18 | UINTPTR FrmbufWrBufrAddr; 19 | UINTPTR FrmbufRdBufrAddr; 20 | u32 FrameStrideBytes; 21 | u32 FrameLines; 22 | u32 FrameSizeBytes; 23 | } Frmbuf; 24 | 25 | // Main functions for use by the outside 26 | int FrmbufWrInit(Frmbuf *Frmbuf, UINTPTR BaseAddr, UINTPTR BufrBaseAddr); 27 | int FrmbufRdInit(Frmbuf *Frmbuf, UINTPTR BaseAddr, UINTPTR BufrBaseAddr); 28 | int FrmbufStart(Frmbuf *Frmbuf); 29 | 30 | // Callback (ISR) functions 31 | void *FrmbufRdCallback(void *data); 32 | void *FrmbufWrCallback(void *data); 33 | 34 | // Stride calculator (should probably be placed in a module with other useful video calc functions) 35 | static u32 CalcStride(XVidC_ColorFormat Cfmt,u16 AXIMMDataWidth,XVidC_VideoStream *StreamPtr); 36 | 37 | #endif /* FRMBUF_H_ */ 38 | -------------------------------------------------------------------------------- /Vitis/common/src/reset_gpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * These functions facilitate the control of the resets in the design. 5 | */ 6 | #pragma once 7 | #include 8 | 9 | // Reset GPIO masks 10 | #define RESET_GPIO_VTPG_RST_N_MASK (0x1 << 0) // Video Pattern Generator IP reset 11 | #define RESET_GPIO_VMIX_RST_N_MASK (0x1 << 1) // Video Mixer IP reset 12 | 13 | extern XGpio GpioVideoResets; 14 | 15 | static inline uint32_t reset_gpio_read(void) { return XGpio_DiscreteRead(&GpioVideoResets, 1); } 16 | static inline void reset_gpio_write(uint32_t v) { XGpio_DiscreteWrite(&GpioVideoResets, 1, v); } 17 | 18 | /* ==== ACTIVE-LOW SEMANTICS: assert=0, deassert=1 ==== */ 19 | static inline void reset_assert(uint32_t mask) 20 | { 21 | uint32_t v = reset_gpio_read(); 22 | reset_gpio_write(v & ~mask); 23 | } 24 | 25 | static inline void reset_deassert(uint32_t mask) 26 | { 27 | uint32_t v = reset_gpio_read(); 28 | reset_gpio_write(v | mask); 29 | } 30 | 31 | /* Optional convenience for VTPG/VMIX (single-bit masks) */ 32 | #define RESET_MASK_VTPG (1u << 0) 33 | #define RESET_MASK_VMIX (1u << 1) 34 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file for Sphinx projects 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | # Required 5 | version: 2 6 | 7 | # Set the OS, Python version and other tools you might need 8 | build: 9 | os: ubuntu-22.04 10 | tools: 11 | python: "3.11" 12 | # You can also specify other tool versions: 13 | # nodejs: "20" 14 | # rust: "1.70" 15 | # golang: "1.20" 16 | 17 | # Build documentation in the "docs/" directory with Sphinx 18 | sphinx: 19 | configuration: docs/source/conf.py 20 | # You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs 21 | # builder: "dirhtml" 22 | # Fail on all warnings to avoid broken references 23 | # fail_on_warning: true 24 | 25 | # Optionally build your docs in additional formats such as PDF and ePub 26 | # formats: 27 | # - pdf 28 | # - epub 29 | 30 | # Optional but recommended, declare the Python requirements required 31 | # to build your documentation 32 | # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html 33 | python: 34 | install: 35 | - requirements: docs/requirements.txt 36 | -------------------------------------------------------------------------------- /Vivado/ip/isppipeline/run_hls.tcl: -------------------------------------------------------------------------------- 1 | # (C) Copyright 2020 - 2022 Xilinx, Inc. 2 | # SPDX-License-Identifier: Apache-2.0 3 | 4 | set board_name [lindex $argv 2] 5 | 6 | source "build/${board_name}/settings.tcl" 7 | 8 | # Work out absolute paths for IP sources and include files 9 | set curr_dir [pwd] 10 | set vision_dir "../../submodules/Vitis_Libraries/vision" 11 | set VITIS_LIBS [file normalize [file join $curr_dir $vision_dir]] 12 | set include_dir "isppipeline/include" 13 | set INCLUDE_PATH [file normalize [file join $curr_dir $include_dir]] 14 | 15 | set PROJ "isppipeline.prj" 16 | set SOLN "sol1" 17 | 18 | if {![info exists CLKP]} { 19 | set CLKP 3.3 20 | } 21 | 22 | # Change directory to create the IP project inside the build folder for this board 23 | cd build/$board_name 24 | 25 | open_project -reset $PROJ 26 | 27 | add_files "${VITIS_LIBS}/L1/examples/isppipeline/xf_isp_accel.cpp ${VITIS_LIBS}/L1/examples/isppipeline/xf_isp_types.h" -cflags "-I${VITIS_LIBS}/L1/include -I ${INCLUDE_PATH} -I ./ -D__SDSVHLS__ -std=c++0x" -csimflags "-I${VITIS_LIBS}/L1/include -I ${INCLUDE_PATH} -I ./ -D__SDSVHLS__ -std=c++0x" 28 | set_top ISPPipeline_accel 29 | 30 | open_solution -reset $SOLN 31 | 32 | set_part $XPART 33 | create_clock -period $CLKP 34 | 35 | csynth_design 36 | export_design -rtl verilog -format ip_catalog 37 | 38 | cd ../.. 39 | 40 | exit 41 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-bsp/u-boot/files/0001-ubifs-distroboot-support.patch: -------------------------------------------------------------------------------- 1 | From 357b3eebaa54be1ec8d14b306625eb73732ee5dc Mon Sep 17 00:00:00 2001 2 | From: Ashok Reddy Soma 3 | Date: Wed, 19 Aug 2020 05:29:40 -0600 4 | Subject: [UBOOT PATCH] ubifs: distroboot support 5 | 6 | Signed-off-by: Ashok Reddy Soma 7 | --- 8 | include/configs/xilinx_zynqmp.h | 5 ++++- 9 | 1 file changed, 4 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h 12 | index d3f465a..dc231b8 100644 13 | --- a/include/configs/xilinx_zynqmp.h 14 | +++ b/include/configs/xilinx_zynqmp.h 15 | @@ -154,7 +154,10 @@ 16 | 17 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ 18 | "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \ 19 | - "sf read $scriptaddr $script_offset_f $script_size_f && " \ 20 | + "setenv mtdids 'nor0=nor0' && " \ 21 | + "setenv mtdparts 'mtdparts=nor0:16m(raw),-(boot)' && " \ 22 | + "mtdparts && " \ 23 | + "ubi part boot; ubifsmount ubi0:boot; ubifsload $scriptaddr boot.scr; && " \ 24 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ 25 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" 26 | 27 | -- 28 | 2.7.4 29 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-bsp/u-boot/files/0001-ubifs-distroboot-support.patch: -------------------------------------------------------------------------------- 1 | From 357b3eebaa54be1ec8d14b306625eb73732ee5dc Mon Sep 17 00:00:00 2001 2 | From: Ashok Reddy Soma 3 | Date: Wed, 19 Aug 2020 05:29:40 -0600 4 | Subject: [UBOOT PATCH] ubifs: distroboot support 5 | 6 | Signed-off-by: Ashok Reddy Soma 7 | --- 8 | include/configs/xilinx_zynqmp.h | 5 ++++- 9 | 1 file changed, 4 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h 12 | index d3f465a..dc231b8 100644 13 | --- a/include/configs/xilinx_zynqmp.h 14 | +++ b/include/configs/xilinx_zynqmp.h 15 | @@ -154,7 +154,10 @@ 16 | 17 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ 18 | "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \ 19 | - "sf read $scriptaddr $script_offset_f $script_size_f && " \ 20 | + "setenv mtdids 'nor0=nor0' && " \ 21 | + "setenv mtdparts 'mtdparts=nor0:16m(raw),-(boot)' && " \ 22 | + "mtdparts && " \ 23 | + "ubi part boot; ubifsmount ubi0:boot; ubifsload $scriptaddr boot.scr; && " \ 24 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ 25 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" 26 | 27 | -- 28 | 2.7.4 29 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-bsp/u-boot/files/0001-ubifs-distroboot-support.patch: -------------------------------------------------------------------------------- 1 | From 357b3eebaa54be1ec8d14b306625eb73732ee5dc Mon Sep 17 00:00:00 2001 2 | From: Ashok Reddy Soma 3 | Date: Wed, 19 Aug 2020 05:29:40 -0600 4 | Subject: [UBOOT PATCH] ubifs: distroboot support 5 | 6 | Signed-off-by: Ashok Reddy Soma 7 | --- 8 | include/configs/xilinx_zynqmp.h | 5 ++++- 9 | 1 file changed, 4 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h 12 | index d3f465a..dc231b8 100644 13 | --- a/include/configs/xilinx_zynqmp.h 14 | +++ b/include/configs/xilinx_zynqmp.h 15 | @@ -154,7 +154,10 @@ 16 | 17 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ 18 | "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \ 19 | - "sf read $scriptaddr $script_offset_f $script_size_f && " \ 20 | + "setenv mtdids 'nor0=nor0' && " \ 21 | + "setenv mtdparts 'mtdparts=nor0:16m(raw),-(boot)' && " \ 22 | + "mtdparts && " \ 23 | + "ubi part boot; ubifsmount ubi0:boot; ubifsload $scriptaddr boot.scr; && " \ 24 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ 25 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" 26 | 27 | -- 28 | 2.7.4 29 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/u-boot/files/0001-ubifs-distroboot-support.patch: -------------------------------------------------------------------------------- 1 | From 357b3eebaa54be1ec8d14b306625eb73732ee5dc Mon Sep 17 00:00:00 2001 2 | From: Ashok Reddy Soma 3 | Date: Wed, 19 Aug 2020 05:29:40 -0600 4 | Subject: [UBOOT PATCH] ubifs: distroboot support 5 | 6 | Signed-off-by: Ashok Reddy Soma 7 | --- 8 | include/configs/xilinx_zynqmp.h | 5 ++++- 9 | 1 file changed, 4 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h 12 | index d3f465a..dc231b8 100644 13 | --- a/include/configs/xilinx_zynqmp.h 14 | +++ b/include/configs/xilinx_zynqmp.h 15 | @@ -154,7 +154,10 @@ 16 | 17 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ 18 | "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \ 19 | - "sf read $scriptaddr $script_offset_f $script_size_f && " \ 20 | + "setenv mtdids 'nor0=nor0' && " \ 21 | + "setenv mtdparts 'mtdparts=nor0:16m(raw),-(boot)' && " \ 22 | + "mtdparts && " \ 23 | + "ubi part boot; ubifsmount ubi0:boot; ubifsload $scriptaddr boot.scr; && " \ 24 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ 25 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" 26 | 27 | -- 28 | 2.7.4 29 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-bsp/u-boot/files/0001-ubifs-distroboot-support.patch: -------------------------------------------------------------------------------- 1 | From 357b3eebaa54be1ec8d14b306625eb73732ee5dc Mon Sep 17 00:00:00 2001 2 | From: Ashok Reddy Soma 3 | Date: Wed, 19 Aug 2020 05:29:40 -0600 4 | Subject: [UBOOT PATCH] ubifs: distroboot support 5 | 6 | Signed-off-by: Ashok Reddy Soma 7 | --- 8 | include/configs/xilinx_zynqmp.h | 5 ++++- 9 | 1 file changed, 4 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h 12 | index d3f465a..dc231b8 100644 13 | --- a/include/configs/xilinx_zynqmp.h 14 | +++ b/include/configs/xilinx_zynqmp.h 15 | @@ -154,7 +154,10 @@ 16 | 17 | #define BOOTENV_DEV_QSPI(devtypeu, devtypel, instance) \ 18 | "bootcmd_" #devtypel #instance "=sf probe " #instance " 0 0 && " \ 19 | - "sf read $scriptaddr $script_offset_f $script_size_f && " \ 20 | + "setenv mtdids 'nor0=nor0' && " \ 21 | + "setenv mtdparts 'mtdparts=nor0:16m(raw),-(boot)' && " \ 22 | + "mtdparts && " \ 23 | + "ubi part boot; ubifsmount ubi0:boot; ubifsload $scriptaddr boot.scr; && " \ 24 | "echo QSPI: Trying to boot script at ${scriptaddr} && " \ 25 | "source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;\0" 26 | 27 | -- 28 | 2.7.4 29 | -------------------------------------------------------------------------------- /Vitis/common/src/rpi_cam.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | */ 5 | 6 | #ifndef RPI_CAM_H_ 7 | #define RPI_CAM_H_ 8 | 9 | #include 10 | #include "xil_types.h" 11 | #include "xgpio.h" 12 | 13 | // Bayer patterns to bayer phases for Sensor Demosaic 14 | // https://docs.xilinx.com/r/en-US/pg286-v-demosaic/BAYER_PHASE-0x0028-Register 15 | #define BAYER_PATTERN_RGGB 0x00 16 | #define BAYER_PATTERN_GRBG 0x01 17 | #define BAYER_PATTERN_GBRG 0x02 18 | #define BAYER_PATTERN_BGGR 0x03 19 | 20 | // Supported camera types 21 | #define RPI_CAM_TYPE_OV5640 0 22 | #define RPI_CAM_TYPE_IMX219 1 23 | 24 | // Sensor bayer patterns 25 | #define RPI_CAM_BAYER_PAT_OV5640 BAYER_PATTERN_BGGR 26 | #define RPI_CAM_BAYER_PAT_IMX219 BAYER_PATTERN_RGGB 27 | 28 | // Sensor adapter 29 | typedef struct { 30 | uint8_t model; 31 | uint8_t bayer_pattern; 32 | int (*config) (uint8_t,XGpio*,uint8_t); 33 | int (*detect) (uint8_t); 34 | } Sensor; 35 | 36 | // RPi camera container 37 | typedef struct { 38 | uint8_t iic_id; 39 | XGpio *gpio; 40 | uint32_t gpio_mask; 41 | Sensor sensor; 42 | } RpiCamera; 43 | 44 | int rpi_cam_init(RpiCamera *camera,uint8_t iic_id,XGpio *gpio_inst,uint32_t gpio_mask); 45 | int rpi_cam_config(RpiCamera *camera); 46 | int rpi_cam_detect(RpiCamera *camera); 47 | uint8_t rpi_cam_bayer_phase(RpiCamera *camera); 48 | 49 | #endif /* RPI_CAM_H_ */ 50 | -------------------------------------------------------------------------------- /docs/source/revision_history.md: -------------------------------------------------------------------------------- 1 | # Revision History 2 | 3 | ## 2024.1 Changes 4 | 5 | * Removed VVAS image processing accelerator from the design - no current support for VVAS in version 6 | 2024.1. 7 | * Added AXI4-Streaming Data FIFO to MIPI video pipes, between MIPI CSI2 RX and ISP Pipeline IPs 8 | * Improved documentation, centralized target design info to JSON file 9 | * RPi camera IOs are properly driven 10 | * ISP Pipeline IP updated to version v2023.2_update1 of the Vitis_Libraries repo 11 | * ISP Pipeline now uses built-in Linux driver (linux-xlnx/drivers/media/platform/xilinx/xilinx-isppipeline.c) 12 | * Removed all Vitis-AI and VVAS recipes from BSPs 13 | 14 | ### 2022.1 2024-02-23 Changes 15 | 16 | * Changed the video pipeline to use ISPPipeline - this improved the quality of the images 17 | * Removed the standalone application 18 | * Added VVAS accelerator and VCU to the designs to make them more useful 19 | * Display pipeline fixed for use in PetaLinux and GStreamer 20 | * Docs updated 21 | * init_cams.sh script improved and displaycams.sh script added 22 | 23 | ## 2022.1 Changes 24 | 25 | * Added Makefiles to improve the build experience for Linux users 26 | * Consolidated Vivado batch files (user is prompted to select target design) 27 | * Vitis build script now creates a separate workspace for each target design (improved user experience) 28 | * Converted documentation to markdown (from reStructuredText) 29 | 30 | -------------------------------------------------------------------------------- /Vitis/common/src/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * This file should hold the major configuration parameters for the demo so that they can be set in 5 | * a single place. 6 | */ 7 | 8 | // Video mode and frame size defines 9 | //#define DEMO_VMODE_720P60 1 10 | #define DEMO_VMODE_1080P30 1 11 | 12 | #if defined (DEMO_VMODE_720P60) 13 | #define VMODE_WIDTH 1280 14 | #define VMODE_HEIGHT 720 15 | #define VMODE_CAM MODE_720P_1280_720_60fps 16 | #define GAMMA 1/1.0 17 | #define PIXEL_SIZE 8 // In bits 18 | #define GAMMA_TABLE_SIZE 256 // 2^PIXEL_SIZE 19 | #define FRAME_HORI_LEN VMODE_WIDTH*3 // Each pixel is 3 bytes 20 | #define FRAME_VERT_LEN VMODE_HEIGHT 21 | #define SUBFRAME_START_OFFSET (FRAME_HORI_LEN * 5 + 64) 22 | #endif 23 | #if defined (DEMO_VMODE_1080P30) 24 | #define VMODE_WIDTH 1920 25 | #define VMODE_HEIGHT 1080 26 | #define VMODE_FRAMERATE 60 27 | #define VMODE_CAM MODE_1080P_1920_1080_30fps 28 | #define VPROC_WIDTH_OUT 720 29 | #define VPROC_HEIGHT_OUT 480 30 | #define VPROC_FRAMERATE_OUT 60 31 | #define COLOR_FORMAT_ID XVIDC_CSF_RGB 32 | #define GAMMA 1/1.0 33 | #define PIXEL_SIZE 8 // In bits 34 | #define GAMMA_TABLE_SIZE 256 // 2^PIXEL_SIZE 35 | #define FRAME_HORI_LEN VMODE_WIDTH*3 // Each pixel is 3 bytes 36 | #define FRAME_VERT_LEN VMODE_HEIGHT 37 | #define SUBFRAME_START_OFFSET (FRAME_HORI_LEN * 5 + 64) 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /Vitis/common/src/imx219.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * Credit to Greg Taylor https://github.com/gtaylormb/ultra96v2_imx219_to_displayport 5 | */ 6 | #ifndef IMX219_H_ 7 | #define IMX219_H_ 8 | 9 | #include 10 | #include "xgpio.h" 11 | 12 | #define IMX219_I2C_SLAVE_ADDR 0x10 13 | 14 | /* Lens */ 15 | /* infinity, 0 current */ 16 | #define IMX219_LENS_MIN 0 17 | /* macro, max current */ 18 | #define IMX219_LENS_MAX 255 19 | #define IMX219_LENS_STEP 1 20 | /* AEC */ 21 | #define IMX219_DEFAULT_EXP 10000 22 | #define IMX219_DEFAULT_GAIN UINT8P8(1.0) 23 | #define IMX219_GAIN_MIN UINT8P8(1.0) 24 | #define IMX219_GAIN_MAX UINT8P8(8.0) 25 | #define IMX219_EXP_MIN 1 26 | #define IMX219_ANA_GAIN_GLOBAL 0x0157 27 | #define IMX219_COARSE_INT_TIME_HI 0x015A 28 | #define IMX219_COARSE_INT_TIME_LO 0x015B 29 | #define IMX219_FRM_LENGTH_HI 0x0160 30 | #define IMX219_FRM_LENGTH_LO 0x0161 31 | 32 | // Register address and value 33 | typedef struct { 34 | uint16_t addr; 35 | uint8_t data; 36 | } imx219_config_word_t; 37 | 38 | int imx219_detect(uint8_t iic_id); 39 | int imx219_config(uint8_t iic_id,XGpio *gpio,uint32_t gpio_mask); 40 | int imx219_reset(XGpio *gpio,uint32_t gpio_mask); 41 | int imx219_write(uint8_t iic_id,u16 addr, u8 data); 42 | int imx219_read(uint8_t iic_id,u16 addr, u8 *data); 43 | 44 | #endif /* IMX219_H_ */ 45 | -------------------------------------------------------------------------------- /Vitis/common/src/ov5640.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * Credit to Adam Taylor https://www.adiuvoengineering.com/post/microzed-chronicles-kria-raspberry-pi-camera 5 | */ 6 | 7 | #ifndef OV5640_H_ 8 | #define OV5640_H_ 9 | 10 | #include "xil_types.h" 11 | #include "xgpio.h" 12 | 13 | #define IIC_OV5640_ADDR 0x3c 14 | #define SIZEOF_ARRAY(x) sizeof(x)/sizeof(x[0]) 15 | #define MAP_ENUM_TO_CFG(en, cfg) en, cfg, SIZEOF_ARRAY(cfg) 16 | 17 | // Register address and value 18 | typedef struct { 19 | uint16_t addr; 20 | uint8_t data; 21 | } config_word_t; 22 | 23 | typedef enum { MODE_720P_1280_720_60fps = 0, MODE_1080P_1920_1080_15fps, 24 | MODE_1080P_1920_1080_30fps, MODE_1080P_1920_1080_30fps_336M_MIPI, 25 | MODE_1080P_1920_1080_30fps_336M_1LANE_MIPI, MODE_END } vmode_t; 26 | typedef struct { vmode_t mode; config_word_t const* cfg; size_t cfg_size; } config_modes_t; 27 | typedef enum { AWB_DISABLED = 0, AWB_SIMPLE, AWB_ADVANCED, AWB_END } awb_t; 28 | typedef struct { awb_t awb; config_word_t const* cfg; size_t cfg_size; } config_awb_t; 29 | 30 | /* 31 | * Public functions 32 | * These functions are intended to be called by the user 33 | */ 34 | int ov5640_config(uint8_t iic_id,XGpio *gpio,uint8_t gpio_mask); 35 | int ov5640_detect(uint8_t iic_id); 36 | 37 | /* 38 | * Internal functions 39 | * These functions are intended for use internal to this library 40 | */ 41 | int ov5640_reset(XGpio *gpio,uint8_t gpio_mask); 42 | int ov5640_write(uint8_t iic_id,uint16_t addr, uint8_t data); 43 | int ov5640_read(uint8_t iic_id,uint16_t addr, uint8_t *data); 44 | int ov5640_write_config(uint8_t iic_id,config_word_t const *cfg, size_t len); 45 | 46 | #endif /* OV5640_H_ */ 47 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the 2 | meta-user layer. 3 | 4 | Please see the corresponding sections below for details. 5 | 6 | 7 | Dependencies 8 | ============ 9 | 10 | This layer depends on: 11 | 12 | URI: git://git.openembedded.org/bitbake 13 | branch: master 14 | 15 | URI: git://git.openembedded.org/openembedded-core 16 | layers: meta 17 | branch: master 18 | 19 | URI: git://git.yoctoproject.org/xxxx 20 | layers: xxxx 21 | branch: master 22 | 23 | 24 | Patches 25 | ======= 26 | 27 | Please submit any patches against the meta-user layer to the 28 | xxxx mailing list (xxxx@zzzz.org) and cc: the maintainer: 29 | 30 | Maintainer: XXX YYYYYY 31 | 32 | 33 | Table of Contents 34 | ================= 35 | 36 | I. Adding the meta-user layer to your build 37 | II. Misc 38 | 39 | 40 | I. Adding the meta-user layer to your build 41 | ================================================= 42 | 43 | --- replace with specific instructions for the meta-user layer --- 44 | 45 | In order to use this layer, you need to make the build system aware of 46 | it. 47 | 48 | Assuming the meta-user layer exists at the top-level of your 49 | yocto build tree, you can add it to the build system by adding the 50 | location of the meta-user layer to bblayers.conf, along with any 51 | other layers needed. e.g.: 52 | 53 | BBLAYERS ?= " \ 54 | /path/to/yocto/meta \ 55 | /path/to/yocto/meta-poky \ 56 | /path/to/yocto/meta-yocto-bsp \ 57 | /path/to/yocto/meta-meta-user \ 58 | " 59 | 60 | 61 | II. Misc 62 | ======== 63 | 64 | --- replace with specific information about the meta-user layer --- 65 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the 2 | meta-user layer. 3 | 4 | Please see the corresponding sections below for details. 5 | 6 | 7 | Dependencies 8 | ============ 9 | 10 | This layer depends on: 11 | 12 | URI: git://git.openembedded.org/bitbake 13 | branch: master 14 | 15 | URI: git://git.openembedded.org/openembedded-core 16 | layers: meta 17 | branch: master 18 | 19 | URI: git://git.yoctoproject.org/xxxx 20 | layers: xxxx 21 | branch: master 22 | 23 | 24 | Patches 25 | ======= 26 | 27 | Please submit any patches against the meta-user layer to the 28 | xxxx mailing list (xxxx@zzzz.org) and cc: the maintainer: 29 | 30 | Maintainer: XXX YYYYYY 31 | 32 | 33 | Table of Contents 34 | ================= 35 | 36 | I. Adding the meta-user layer to your build 37 | II. Misc 38 | 39 | 40 | I. Adding the meta-user layer to your build 41 | ================================================= 42 | 43 | --- replace with specific instructions for the meta-user layer --- 44 | 45 | In order to use this layer, you need to make the build system aware of 46 | it. 47 | 48 | Assuming the meta-user layer exists at the top-level of your 49 | yocto build tree, you can add it to the build system by adding the 50 | location of the meta-user layer to bblayers.conf, along with any 51 | other layers needed. e.g.: 52 | 53 | BBLAYERS ?= " \ 54 | /path/to/yocto/meta \ 55 | /path/to/yocto/meta-poky \ 56 | /path/to/yocto/meta-yocto-bsp \ 57 | /path/to/yocto/meta-meta-user \ 58 | " 59 | 60 | 61 | II. Misc 62 | ======== 63 | 64 | --- replace with specific information about the meta-user layer --- 65 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the 2 | meta-user layer. 3 | 4 | Please see the corresponding sections below for details. 5 | 6 | 7 | Dependencies 8 | ============ 9 | 10 | This layer depends on: 11 | 12 | URI: git://git.openembedded.org/bitbake 13 | branch: master 14 | 15 | URI: git://git.openembedded.org/openembedded-core 16 | layers: meta 17 | branch: master 18 | 19 | URI: git://git.yoctoproject.org/xxxx 20 | layers: xxxx 21 | branch: master 22 | 23 | 24 | Patches 25 | ======= 26 | 27 | Please submit any patches against the meta-user layer to the 28 | xxxx mailing list (xxxx@zzzz.org) and cc: the maintainer: 29 | 30 | Maintainer: XXX YYYYYY 31 | 32 | 33 | Table of Contents 34 | ================= 35 | 36 | I. Adding the meta-user layer to your build 37 | II. Misc 38 | 39 | 40 | I. Adding the meta-user layer to your build 41 | ================================================= 42 | 43 | --- replace with specific instructions for the meta-user layer --- 44 | 45 | In order to use this layer, you need to make the build system aware of 46 | it. 47 | 48 | Assuming the meta-user layer exists at the top-level of your 49 | yocto build tree, you can add it to the build system by adding the 50 | location of the meta-user layer to bblayers.conf, along with any 51 | other layers needed. e.g.: 52 | 53 | BBLAYERS ?= " \ 54 | /path/to/yocto/meta \ 55 | /path/to/yocto/meta-poky \ 56 | /path/to/yocto/meta-yocto-bsp \ 57 | /path/to/yocto/meta-meta-user \ 58 | " 59 | 60 | 61 | II. Misc 62 | ======== 63 | 64 | --- replace with specific information about the meta-user layer --- 65 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/README: -------------------------------------------------------------------------------- 1 | This README file contains information on the contents of the 2 | meta-user layer. 3 | 4 | Please see the corresponding sections below for details. 5 | 6 | 7 | Dependencies 8 | ============ 9 | 10 | This layer depends on: 11 | 12 | URI: git://git.openembedded.org/bitbake 13 | branch: master 14 | 15 | URI: git://git.openembedded.org/openembedded-core 16 | layers: meta 17 | branch: master 18 | 19 | URI: git://git.yoctoproject.org/xxxx 20 | layers: xxxx 21 | branch: master 22 | 23 | 24 | Patches 25 | ======= 26 | 27 | Please submit any patches against the meta-user layer to the 28 | xxxx mailing list (xxxx@zzzz.org) and cc: the maintainer: 29 | 30 | Maintainer: XXX YYYYYY 31 | 32 | 33 | Table of Contents 34 | ================= 35 | 36 | I. Adding the meta-user layer to your build 37 | II. Misc 38 | 39 | 40 | I. Adding the meta-user layer to your build 41 | ================================================= 42 | 43 | --- replace with specific instructions for the meta-user layer --- 44 | 45 | In order to use this layer, you need to make the build system aware of 46 | it. 47 | 48 | Assuming the meta-user layer exists at the top-level of your 49 | yocto build tree, you can add it to the build system by adding the 50 | location of the meta-user layer to bblayers.conf, along with any 51 | other layers needed. e.g.: 52 | 53 | BBLAYERS ?= " \ 54 | /path/to/yocto/meta \ 55 | /path/to/yocto/meta-poky \ 56 | /path/to/yocto/meta-yocto-bsp \ 57 | /path/to/yocto/meta-meta-user \ 58 | " 59 | 60 | 61 | II. Misc 62 | ======== 63 | 64 | --- replace with specific information about the meta-user layer --- 65 | -------------------------------------------------------------------------------- /Vitis/common/src/i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * A simple interrupt based driver for AXI IIC and PS IIC. 5 | * This driver allows device drivers to use the IIC bus without being 6 | * concerned about the underlying IP (AXI IIC or PS IIC). Each bus that 7 | * is initialized is given an index that the device drivers can use to 8 | * make reads/writes on the bus. 9 | * 10 | */ 11 | 12 | #ifndef I2C_H_ 13 | #define I2C_H_ 14 | 15 | #include "xparameters.h" 16 | #ifdef XPAR_XIIC_NUM_INSTANCES 17 | #include "xiic.h" 18 | #endif 19 | #ifdef XPAR_XIICPS_NUM_INSTANCES 20 | #include "xiicps.h" 21 | #endif 22 | 23 | #define IIC_SCLK_RATE 100000 24 | 25 | // Types of IIC that can be used with this driver 26 | #define IIC_TYPE_AXI_IIC 0 27 | #define IIC_TYPE_PS_IIC 1 28 | 29 | typedef struct { 30 | void *Iic; 31 | u8 IicType; 32 | volatile u8 TransmitComplete; 33 | volatile u8 ReceiveComplete; 34 | volatile u8 ErrorCount; 35 | } IicIntHandlerInfo; 36 | 37 | 38 | int IicWrite(u8 index,u8 addr,u8 *buf, u16 len); 39 | int IicRead(u8 index,u8 addr, u8 *buf, u16 len); 40 | int IicReset(u8 index); 41 | 42 | /* 43 | * AXI IIC functions 44 | */ 45 | #ifdef XPAR_XIIC_NUM_INSTANCES 46 | int IicAxiInit(XIic *IicInstance, UINTPTR BaseAddr, u8 *Index); 47 | int IicAxiWrite(u8 index, u8 addr,u8 *buf, u16 len); 48 | int IicAxiRead(u8 index, u8 addr, u8 *buf, u16 len); 49 | 50 | void IicAxiSendHandler(IicIntHandlerInfo *Info); 51 | void IicAxiRecvHandler(IicIntHandlerInfo *Info); 52 | void IicAxiStatusHandler(IicIntHandlerInfo *Info, int Event); 53 | #endif 54 | 55 | /* 56 | * PS IIC functions 57 | */ 58 | #ifdef XPAR_XIICPS_NUM_INSTANCES 59 | int IicPsInit(XIicPs *IicInstance, UINTPTR BaseAddr, u8 *Index); 60 | void IicPsInterruptHandler(IicIntHandlerInfo *Info, u32 Event); 61 | int IicPsWrite(u8 index, u8 addr, u8 *buf,u16 len); 62 | int IicPsRead(u8 index, u8 addr, u8 *buf,u16 len); 63 | #endif 64 | 65 | #endif /* I2C_H_ */ 66 | -------------------------------------------------------------------------------- /Vivado/ip/get_part.tcl: -------------------------------------------------------------------------------- 1 | # Opsero Electronic Design Inc. 2024 2 | # ---------------------------------- 3 | # This script must be run with Vivado batch mode. The script is passed the board URL 4 | # and board name and it uses that information to get the device part for that board. The script then 5 | # creates a Tcl file that will later be called by the run_hls.tcl script to build the IP for that board. 6 | 7 | # Add Xilinx board store to the repo paths 8 | set_param board.repoPaths [get_property LOCAL_ROOT_DIR [xhub::get_xstores xilinx_board_store]] 9 | 10 | # Board url and name must be fed as command line arguments 11 | set board_url [lindex $argv 0] 12 | set board_name [lindex $argv 1] 13 | 14 | # Get the board device part number 15 | if { $board_name == "auboard_15p" } { 16 | # AUBoard not yet in board store, so part name is hard coded here 17 | set XPART "xcau15p-ffvb676-2-e" 18 | } else { 19 | # Get the part name from the board URL and board name 20 | set proj_board [get_board_parts "$board_url:$board_name:*" -latest_file_version] 21 | # Check if the board files are installed, if not, install them 22 | if { $proj_board == "" } { 23 | puts "Failed to find board files for $board_name. Installing board files..." 24 | xhub::refresh_catalog [xhub::get_xstores xilinx_board_store] 25 | xhub::install [xhub::get_xitems $board_url:xilinx_board_store:$board_name*] 26 | set proj_board [get_board_parts "$board_url:$board_name:*" -latest_file_version] 27 | } else { 28 | puts "Board files found for $board_name" 29 | } 30 | 31 | set XPART [get_property PART_NAME [get_board_parts $proj_board]] 32 | } 33 | 34 | # Create the Tcl script that run_hls.tcl will call 35 | 36 | # Set the directory and file names 37 | set directory "build/$board_name" 38 | 39 | # Check if the directory exists, create if it does not 40 | if { ![file exists $directory] } { 41 | file mkdir $directory 42 | } 43 | 44 | set filename "settings.tcl" 45 | set filepath "$directory/$filename" 46 | set file [open $filepath "w"] 47 | puts $file "set XPART $XPART" 48 | puts $file "" 49 | close $file 50 | 51 | -------------------------------------------------------------------------------- /Vitis/common/src/platform.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (C) 2010 - 2020 Xilinx, Inc. All rights reserved. 3 | * SPDX-License-Identifier: MIT 4 | ******************************************************************************/ 5 | 6 | 7 | #include "xparameters.h" 8 | #include "xil_cache.h" 9 | 10 | #include "platform_config.h" 11 | 12 | /* 13 | * Uncomment one of the following two lines, depending on the target, 14 | * if ps7/psu init source files are added in the source directory for 15 | * compiling example outside of SDK. 16 | */ 17 | /*#include "ps7_init.h"*/ 18 | /*#include "psu_init.h"*/ 19 | 20 | #ifdef STDOUT_IS_16550 21 | #include "xuartns550_l.h" 22 | 23 | #define UART_BAUD 9600 24 | #endif 25 | 26 | void 27 | enable_caches() 28 | { 29 | #ifdef __PPC__ 30 | Xil_ICacheEnableRegion(CACHEABLE_REGION_MASK); 31 | Xil_DCacheEnableRegion(CACHEABLE_REGION_MASK); 32 | #elif __MICROBLAZE__ 33 | #ifdef XPAR_MICROBLAZE_USE_ICACHE 34 | Xil_ICacheEnable(); 35 | #endif 36 | #ifdef XPAR_MICROBLAZE_USE_DCACHE 37 | Xil_DCacheEnable(); 38 | #endif 39 | #endif 40 | } 41 | 42 | void 43 | disable_caches() 44 | { 45 | Xil_DCacheDisable(); 46 | Xil_ICacheDisable(); 47 | } 48 | 49 | void 50 | init_uart() 51 | { 52 | #ifdef STDOUT_IS_16550 53 | XUartNs550_SetBaud(STDOUT_BASEADDR, XPAR_XUARTNS550_CLOCK_HZ, UART_BAUD); 54 | XUartNs550_SetLineControlReg(STDOUT_BASEADDR, XUN_LCR_8_DATA_BITS); 55 | #endif 56 | /* Bootrom/BSP configures PS7/PSU UART to 115200 bps */ 57 | } 58 | 59 | void 60 | init_platform() 61 | { 62 | /* 63 | * If you want to run this example outside of SDK, 64 | * uncomment one of the following two lines and also #include "ps7_init.h" 65 | * or #include "ps7_init.h" at the top, depending on the target. 66 | * Make sure that the ps7/psu_init.c and ps7/psu_init.h files are included 67 | * along with this example source files for compilation. 68 | */ 69 | /* ps7_init();*/ 70 | /* psu_init();*/ 71 | enable_caches(); 72 | init_uart(); 73 | } 74 | 75 | void 76 | cleanup_platform() 77 | { 78 | disable_caches(); 79 | } 80 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Documentation for the example designs 2 | 3 | The documentation for these example designs is hosted at [RPi Camera FMC Example design documentation](https://rpi.camerafmc.com) 4 | and it is best viewed from there. This folder of the repo contains the sources for the 5 | documentation, and we strongly encourage you to contribute to the documentation if you're 6 | interested in doing so. To contribute, you can modify these sources and then make a pull 7 | request to this repository on Github. 8 | 9 | ## How to build the docs locally 10 | 11 | These instructions will help you to get setup to build the docs locally on your 12 | machine. It is intended for people that wish to contribute to the documentation. If you 13 | only wish to view the documentation, then please view it [here](https://rpi.camerafmc.com). 14 | 15 | To build the documentation locally, you will need to have Python 3 with and Sphinx, MyST parser 16 | and the ReadTheDocs Sphinx theme installed. For this guide, we'll assume that you are using Linux 17 | and that it already has Python 3 installed. Ideally we would create a virtual environment and 18 | install all the packages we need into it using pip: 19 | 20 | 1. Install `python3-venv` (typically, it's already installed): 21 | 22 | ``` 23 | sudo apt install python3-venv -y 24 | ``` 25 | 26 | 2. Create a virtual environment: 27 | 28 | ``` 29 | mkdir sphinx_venv 30 | cd sphinx_venv 31 | python3 -m venv sphinx_venv 32 | ``` 33 | 34 | 3. Activate the virtual environment: 35 | 36 | ``` 37 | cd .. 38 | source sphinx_venv/bin/activate 39 | ``` 40 | 41 | 4. In the active virtual environment, install Sphinx, MyST and the ReadTheDocs Sphinx theme: 42 | 43 | ``` 44 | pip install -U sphinx 45 | pip install myst-parser 46 | pip install sphinx-rtd-theme 47 | ``` 48 | 49 | 5. Build the docs: 50 | 51 | ``` 52 | cd /docs 53 | make html 54 | ``` 55 | 56 | To view the locally generated docs, just browse to `/docs/build/html` and open 57 | the `index.html` in a web browser. Each time you wish to rebuild the docs, you just need to run 58 | `make html` and it will work as long as you have activated the virtual environment first. 59 | 60 | -------------------------------------------------------------------------------- /Vitis/common/src/pipe.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | */ 5 | 6 | #ifndef PIPE_H_ 7 | #define PIPE_H_ 8 | 9 | #include "xil_types.h" 10 | #include "xgpio.h" 11 | #include "xiic.h" 12 | #include "rpi_cam.h" 13 | #include "xv_demosaic.h" 14 | #include "xv_gamma_lut.h" 15 | #include "xvprocss_vdma.h" 16 | #include "frmbuf.h" 17 | 18 | // Camera GPIO masks 19 | #define GPIO_CAM_IO0_MASK 0x01 20 | #define GPIO_CAM_IO1_MASK 0x02 21 | // Reset GPIO masks 22 | #define GPIO_CAM_DEMOSAIC_RST_N_MASK (0x1 << 2) // CAM Demosaic IP reset 23 | #define GPIO_CAM_VPROC_RST_N_MASK (0x1 << 3) // CAM Vproc IP reset 24 | #define GPIO_CAM_GAMMA_RST_N_MASK (0x1 << 4) // CAM Gamma LUT IP reset 25 | #define GPIO_CAM_FRMBUFRD_RST_N_MASK (0x1 << 5) // CAM Frame Buffer Read IP reset 26 | #define GPIO_CAM_FRMBUFWR_RST_N_MASK (0x1 << 6) // CAM Frame Buffer Write IP reset 27 | 28 | // VideoPipe struct 29 | typedef struct { 30 | uint8_t IsConnected; 31 | XIic Iic; 32 | XGpio Gpio; 33 | XV_demosaic Demosaic; 34 | XV_gamma_lut GammaLut; 35 | XVprocSs Vproc; 36 | RpiCamera Camera; 37 | Frmbuf Frmbuf; 38 | } VideoPipe; 39 | 40 | // VideoPipe Base Addresses 41 | typedef struct { 42 | UINTPTR Iic; 43 | UINTPTR Gpio; 44 | UINTPTR FrmbufWr; 45 | UINTPTR FrmbufRd; 46 | UINTPTR FrmbufBufrBaseAddr; 47 | UINTPTR Demosaic; 48 | UINTPTR GammaLut; 49 | UINTPTR Vproc; 50 | } VideoPipeBaseAddr; 51 | 52 | static inline uint32_t pipe_gpio_read(VideoPipe *pipe) { return XGpio_DiscreteRead(&(pipe->Gpio), 1); } 53 | static inline void pipe_gpio_write(VideoPipe *pipe, uint32_t v) { XGpio_DiscreteWrite(&(pipe->Gpio), 1, v); } 54 | 55 | /* ==== ACTIVE-LOW SEMANTICS: assert=0, deassert=1 ==== */ 56 | static inline void pipe_reset_assert(VideoPipe *pipe,uint32_t mask) 57 | { 58 | uint32_t v = pipe_gpio_read(pipe); 59 | pipe_gpio_write(pipe,v & ~mask); 60 | } 61 | 62 | static inline void pipe_reset_deassert(VideoPipe *pipe,uint32_t mask) 63 | { 64 | uint32_t v = pipe_gpio_read(pipe); 65 | pipe_gpio_write(pipe,v | mask); 66 | } 67 | 68 | int pipe_init(VideoPipe *pipe, VideoPipeBaseAddr *baseaddr); 69 | int pipe_start_camera(VideoPipe *pipe); 70 | 71 | #endif /* PIPE_H_ */ 72 | -------------------------------------------------------------------------------- /Vitis/common/src/rpi_cam.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * This driver provides an interface to the image sensor. It currently supports: 5 | * 6 | * - Digilent Pcam (OV5640) 7 | * - Raspberry Pi camera v2 (IMX219) 8 | * 9 | */ 10 | 11 | #include "rpi_cam.h" 12 | #include "ov5640.h" 13 | #include "imx219.h" 14 | 15 | u8 NumRpiCameras = 0; 16 | RpiCamera RpiCameraArray[4]; 17 | 18 | static const Sensor SupportedSensors[2] = 19 | { 20 | { 21 | RPI_CAM_TYPE_OV5640, 22 | RPI_CAM_BAYER_PAT_OV5640, 23 | &ov5640_config, 24 | &ov5640_detect 25 | }, 26 | { 27 | RPI_CAM_TYPE_IMX219, 28 | RPI_CAM_BAYER_PAT_IMX219, 29 | &imx219_config, 30 | &imx219_detect 31 | } 32 | }; 33 | 34 | #define NUM_SUPPORTED_SENSORS (sizeof(SupportedSensors)/sizeof(SupportedSensors[0])) 35 | 36 | // Initialize the RPi Camera driver 37 | // Returns XST_SUCCESS if a supported camera was found on the I2C bus else returns XST_FAILURE 38 | int rpi_cam_init(RpiCamera *camera,uint8_t iic_id,XGpio *gpio_inst,uint32_t gpio_mask) 39 | { 40 | if (!camera || !gpio_inst) return XST_INVALID_PARAM; 41 | // Copy the IIC instance pointer that connects to the RPi Camera 42 | camera->iic_id = iic_id; 43 | // Copy the GPIO instance for the reset signal 44 | camera->gpio = gpio_inst; 45 | camera->gpio_mask = gpio_mask; 46 | 47 | // Determine the type of camera (if any) is connected 48 | // Read the detect register and check the returned value 49 | int Status; 50 | for(uint8_t i = 0; i < NUM_SUPPORTED_SENSORS; i++) { 51 | camera->sensor = SupportedSensors[i]; 52 | Status = rpi_cam_detect(camera); 53 | if (Status == XST_SUCCESS) { 54 | return(XST_SUCCESS); 55 | } 56 | } 57 | // Otherwise no supported camera was found - FAILURE 58 | return XST_FAILURE; 59 | } 60 | 61 | // Configure the camera, using the appropriate driver 62 | int rpi_cam_config(RpiCamera *camera) 63 | { 64 | int Status; 65 | Status = camera->sensor.config(camera->iic_id,camera->gpio,camera->gpio_mask); 66 | return(Status); 67 | } 68 | 69 | // Detect the camera, using the appropriate driver 70 | int rpi_cam_detect(RpiCamera *camera) 71 | { 72 | int Status; 73 | Status = camera->sensor.detect(camera->iic_id); 74 | return(Status); 75 | } 76 | 77 | // Returns the bayer pattern as a value for Demosaic bayer phase 78 | uint8_t rpi_cam_bayer_phase(RpiCamera *camera) 79 | { 80 | return(camera->sensor.bayer_pattern); 81 | } 82 | 83 | -------------------------------------------------------------------------------- /Vivado/ip/Makefile: -------------------------------------------------------------------------------- 1 | # Opsero Electronic Design Inc. 2024 2 | # 3 | # TODO: This Makefile would ideally be able to build through a list of multiple IPs for the target design. 4 | 5 | RM = rm -rf 6 | VIVADO = $(XILINX_VIVADO)/bin/vivado 7 | HLS = vitis_hls 8 | 9 | GET_PART_SCRIPT = get_part.tcl 10 | GET_PART_LOG = vivado_$(TARGET).log 11 | GET_PART_JOU = vivado_$(TARGET).jou 12 | 13 | # valid targets 14 | # UPDATER START 15 | zcu104_target := xilinx.com zcu104 16 | zcu102_hpc0_target := xilinx.com zcu102 17 | zcu102_hpc1_target := xilinx.com zcu102 18 | zcu106_hpc0_target := xilinx.com zcu106 19 | pynqzu_target := tul.com.tw pynqzu 20 | genesyszu_target := digilentinc.com gzu_5ev 21 | uzev_target := avnet.com ultrazed_7ev_cc 22 | auboard_target := avnet.com auboard_15p 23 | # UPDATER END 24 | 25 | TARGET_LIST := $(sort $(patsubst %_target,%,$(filter %_target,$(.VARIABLES)))) 26 | 27 | BOARD_URL = $(word 1,$($(TARGET)_target)) 28 | BOARD_NAME = $(word 2,$($(TARGET)_target)) 29 | 30 | IP_BUILD_DIR = build/$(BOARD_NAME) 31 | SETTINGS_TCL = $(IP_BUILD_DIR)/settings.tcl 32 | DONE_FILE = $(IP_BUILD_DIR)/ip_done.txt 33 | 34 | .PHONY: help 35 | help: 36 | @echo 'Usage:' 37 | @echo '' 38 | @echo ' make ip TARGET=' 39 | @echo ' Generate all IP for target project.' 40 | @echo '' 41 | @echo ' make clean TARGET=' 42 | @echo ' Clean IP for target project.' 43 | @echo '' 44 | @echo ' make clean_all' 45 | @echo ' Same as make clean but for all targets.' 46 | @echo '' 47 | @echo 'Parameters:' 48 | @echo '' 49 | @echo ' TARGET: Name of the target design, must be one of the following:' 50 | @$(foreach targ,$(TARGET_LIST),echo " - $(targ)";) 51 | @echo '' 52 | @echo 'Example usage:' 53 | @echo ' make ip TARGET=$(word 1,$(TARGET_LIST))' 54 | @echo '' 55 | 56 | .PHONY: all 57 | all: ip 58 | 59 | $(SETTINGS_TCL): 60 | $(VIVADO) -mode batch -notrace -source $(GET_PART_SCRIPT) -log $(GET_PART_LOG) -journal $(GET_PART_JOU) -tclargs $(BOARD_URL) $(BOARD_NAME) 61 | $(RM) $(GET_PART_LOG) $(GET_PART_JOU) 62 | 63 | ip: $(SETTINGS_TCL) 64 | $(HLS) -f isppipeline/run_hls.tcl $(BOARD_NAME) 65 | touch $(DONE_FILE) 66 | 67 | .PHONY: clean 68 | clean: check_target 69 | @echo 'Cleaning IP for $(TARGET)' 70 | $(RM) $(IP_BUILD_DIR) *.log 71 | 72 | .PHONY: clean_all 73 | clean_all: 74 | @echo 'Cleaning all IP' 75 | $(RM) build *.log 76 | 77 | check_target: 78 | ifndef $(TARGET)_target 79 | $(error "Please specify a TARGET. Use 'make help' to see valid targets.") 80 | endif 81 | 82 | -------------------------------------------------------------------------------- /docs/source/requirements.md: -------------------------------------------------------------------------------- 1 | # Requirements 2 | 3 | In order to test this design on hardware, you will need the following: 4 | 5 | * Vivado 2024.1 6 | * Vitis 2024.1 7 | * PetaLinux Tools 2024.1 8 | * Linux PC or Virtual machine (for build) 9 | * One or more [Raspberry Pi Camera Module 2] 10 | * One [RPi Camera FMC] 11 | * One DisplayPort monitor supporting 1080p video 12 | * One of the supported [target boards](supported_carriers) 13 | 14 | ## List of supported boards 15 | 16 | {% set unique_boards = {} %} 17 | {% for design in data.designs %} 18 | {% if design.publish %} 19 | {% if design.board not in unique_boards %} 20 | {% set _ = unique_boards.update({design.board: {"group": design.group, "link": design.link, "connectors": []}}) %} 21 | {% endif %} 22 | {% if design.connector not in unique_boards[design.board]["connectors"] %} 23 | {% set _ = unique_boards[design.board]["connectors"].append(design.connector) %} 24 | {% endif %} 25 | {% endif %} 26 | {% endfor %} 27 | 28 | {% for group in data.groups %} 29 | {% set boards_in_group = [] %} 30 | {% for name, board in unique_boards.items() %} 31 | {% if board.group == group.label %} 32 | {% set _ = boards_in_group.append(board) %} 33 | {% endif %} 34 | {% endfor %} 35 | 36 | {% if boards_in_group | length > 0 %} 37 | ### {{ group.name }} boards 38 | 39 | | Carrier board | Supported FMC connector(s) | 40 | |---------------------|--------------| 41 | {% for name,board in unique_boards.items() %}{% if board.group == group.label %}| [{{ name }}]({{ board.link }}) | {% for connector in board.connectors %}{{ connector }} {% endfor %} | 42 | {% endif %}{% endfor %} 43 | {% endif %} 44 | {% endfor %} 45 | 46 | For list of the target designs showing the number of cameras supported, refer to the build instructions. 47 | 48 | ## Supported cameras 49 | 50 | The [RPi Camera FMC] is designed to support all cameras with the standard 51 | [15-pin Raspberry Pi camera interface](https://camerafmc.com/docs/rpi-camera-fmc/detailed-description/#camera-connectors), 52 | however these example designs currently only have the software support for the [Raspberry Pi Camera Module 2]. 53 | 54 | ```{tip} We're working on developing software support for more cameras. If you'd like to help with 55 | this effort, your pull requests are more than welcome. 56 | ``` 57 | 58 | [RPi Camera FMC]: https://camerafmc.com/docs/rpi-camera-fmc/overview/ 59 | [Digilent Pcam 5C]: https://digilent.com/shop/pcam-5c-5-mp-fixed-focus-color-camera-module/ 60 | [Raspberry Pi Camera Module 2]: https://www.raspberrypi.com/products/camera-module-v2/ 61 | 62 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-bsp/embeddedsw/files/zcu104_vadj_fsbl.patch: -------------------------------------------------------------------------------- 1 | Opsero Electronic Design Inc. 2024 2 | Jeff Johnson 3 | ZCU104 FSBL patch 2024.1 4 | ======================== 5 | The FSBL for Zynq Ultrascale+ needs a patch to properly enable VADJ on the ZCU104 board in the 2024.1 6 | version of PetaLinux. The FSBL released with this version of PetaLinux has code to read the FMC card's 7 | EEPROM and then enable VADJ to the correct value. The released FSBL code in fact reads from the ZCU104 8 | board's EEPROM (address 0x54) and not the FMC's EEPROM (address 0x50). It also only reads 32 bytes 9 | from the EEPROM, which is not sufficient to include the VADJ voltage data. For both of these reasons, 10 | the FSBL does not properly enable VADJ on this board if this patch is not applied. 11 | 12 | diff --git a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c 13 | index 504f008004..7a3e414a08 100644 14 | --- a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c 15 | +++ b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.c 16 | @@ -85,7 +85,7 @@ static u32 XFsbl_ReadMinMaxEepromVadj(XIicPs* I2c0InstancePtr, u32 *MinVadj, u32 17 | u32 UStatus; 18 | s32 Status; 19 | u32 NominalVoltage; 20 | - u32 EepromAddr = 0x54U; 21 | + u32 EepromAddr = 0x50U; 22 | u32 MinVoltage; 23 | u32 MaxVoltage; 24 | 25 | @@ -94,8 +94,8 @@ static u32 XFsbl_ReadMinMaxEepromVadj(XIicPs* I2c0InstancePtr, u32 *MinVadj, u32 26 | MaxVoltage = 0U; 27 | XRecord.VadjRecordFound = 0U; 28 | 29 | - /* Select the Channel-1 of MUX for I2C EEprom Access */ 30 | - WriteBuffer[0U] = 0x1U; 31 | + /* Select the Channel-6 of MUX for FMC I2C EEprom Access */ 32 | + WriteBuffer[0U] = 0x20; 33 | Status = XIicPs_MasterSendPolled(I2c0InstancePtr, 34 | WriteBuffer, 1U, TCA9548A_ADDR); 35 | if (Status != XST_SUCCESS) { 36 | @@ -109,6 +109,16 @@ static u32 XFsbl_ReadMinMaxEepromVadj(XIicPs* I2c0InstancePtr, u32 *MinVadj, u32 37 | /** For MISRA-C compliance */ 38 | } 39 | 40 | + /* Set the read address to zero */ 41 | + WriteBuffer[0U] = 0x00U; 42 | + Status = XIicPs_MasterSendPolled(I2c0InstancePtr, 43 | + WriteBuffer, 1U, EepromAddr); 44 | + if (Status != XST_SUCCESS) { 45 | + UStatus = XFSBL_ERROR_I2C_WRITE; 46 | + XFsbl_Printf(DEBUG_GENERAL, "XFSBL_ERROR_I2C_WRITE\r\n"); 47 | + goto END; 48 | + } 49 | + 50 | /* Read the contents of FMC EEPROM to Read_Buffer */ 51 | Status = XIicPs_MasterRecvPolled(I2c0InstancePtr, Read_Buffer, 52 | EepromByteCount, EepromAddr); 53 | diff --git a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h 54 | index 6177fb61f9..23e552cf1f 100644 55 | --- a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h 56 | +++ b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_board.h 57 | @@ -58,7 +58,7 @@ extern "C" { 58 | #define IRPS5401_SWC_ADDR 0x45U 59 | 60 | #define BUF_LEN 10U 61 | -#define MAX_SIZE 32U 62 | +#define MAX_SIZE 256U 63 | 64 | #define CMD_CFG_0_REG 0x06U 65 | #define CMD_OUTPUT_0_REG 0x02U 66 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/bsp.cfg: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2021 Xilinx, Inc 2 | # SPDX-License-Identifier: BSD-3-Clause 3 | 4 | # 5 | # General 6 | # 7 | # CONFIG_BLK_DEV_INITRD is not set 8 | # CONFIG_PCI is not set 9 | # CONFIG_SENSORS_INA2XX is not set 10 | # CONFIG_INA2XX_ADC is not set 11 | # CONFIG_INV_MPU6050_I2C is not set 12 | 13 | # 14 | # Enable usb gadget 15 | # 16 | CONFIG_USB_NET_DRIVERS=y 17 | CONFIG_USB=y 18 | CONFIG_USB_GADGET=y 19 | CONFIG_USB_GADGET_VBUS_DRAW=2 20 | CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 21 | CONFIG_USB_GADGET_XILINX=y 22 | CONFIG_USB_LIBCOMPOSITE=y 23 | CONFIG_USB_F_ACM=y 24 | CONFIG_USB_F_SS_LB=y 25 | CONFIG_USB_U_SERIAL=y 26 | CONFIG_USB_U_ETHER=y 27 | CONFIG_USB_F_SERIAL=y 28 | CONFIG_USB_F_OBEX=y 29 | CONFIG_USB_F_NCM=y 30 | CONFIG_USB_F_ECM=y 31 | CONFIG_USB_F_EEM=y 32 | CONFIG_USB_F_SUBSET=y 33 | CONFIG_USB_F_RNDIS=y 34 | CONFIG_USB_F_MASS_STORAGE=y 35 | CONFIG_USB_F_FS=y 36 | CONFIG_USB_F_UAC1=y 37 | CONFIG_USB_F_UAC2=y 38 | CONFIG_USB_F_UVC=y 39 | CONFIG_USB_F_MIDI=y 40 | CONFIG_USB_F_HID=y 41 | CONFIG_USB_F_PRINTER=y 42 | CONFIG_USB_CONFIGFS=y 43 | CONFIG_USB_CONFIGFS_SERIAL=y 44 | CONFIG_USB_CONFIGFS_ACM=y 45 | CONFIG_USB_CONFIGFS_OBEX=y 46 | CONFIG_USB_CONFIGFS_NCM=y 47 | CONFIG_USB_CONFIGFS_ECM=y 48 | CONFIG_USB_CONFIGFS_ECM_SUBSET=y 49 | CONFIG_USB_CONFIGFS_RNDIS=y 50 | CONFIG_USB_CONFIGFS_EEM=y 51 | CONFIG_USB_CONFIGFS_MASS_STORAGE=y 52 | CONFIG_USB_CONFIGFS_F_LB_SS=y 53 | CONFIG_USB_CONFIGFS_F_FS=y 54 | CONFIG_USB_CONFIGFS_F_UAC1=y 55 | CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y 56 | CONFIG_USB_CONFIGFS_F_UAC2=y 57 | CONFIG_USB_CONFIGFS_F_MIDI=y 58 | CONFIG_USB_CONFIGFS_F_HID=y 59 | CONFIG_USB_CONFIGFS_F_UVC=y 60 | CONFIG_USB_CONFIGFS_F_PRINTER=y 61 | CONFIG_USB_GADGETFS=y 62 | CONFIG_USB_STORAGE=y 63 | CONFIG_USB_UAS=y 64 | 65 | # 66 | # Enable SPI user mode driver 67 | # 68 | CONFIG_SPI_SPIDEV=y 69 | 70 | # 71 | # Networking configurations 72 | # 73 | CONFIG_NF_TPROXY_IPV4=m 74 | CONFIG_NF_TPROXY_IPV6=m 75 | 76 | # 77 | # I2C Chip support 78 | # 79 | CONFIG_I2C_MUX=y 80 | # CONFIG_I2C_ARB_GPIO_CHALLENGE is not set 81 | # CONFIG_I2C_MUX_GPIO is not set 82 | # CONFIG_I2C_MUX_GPMUX is not set 83 | # CONFIG_I2C_MUX_LTC4306 is not set 84 | CONFIG_I2C_MUX_PCA9541=y 85 | CONFIG_I2C_MUX_PCA954x=y 86 | # CONFIG_I2C_MUX_PINCTRL is not set 87 | # CONFIG_I2C_MUX_REG is not set 88 | # CONFIG_I2C_DEMUX_PINCTRL is not set 89 | # CONFIG_I2C_MUX_MLXCPLD is not set 90 | CONFIG_I2C_HELPER_AUTO=y 91 | CONFIG_I2C_ALGOBIT=y 92 | CONFIG_I2C_GPIO=m 93 | 94 | 95 | # 96 | # Multimedia support 97 | # 98 | CONFIG_VIDEO_ADV_DEBUG=y 99 | # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set 100 | CONFIG_VIDEO_OV5640=y 101 | CONFIG_VIDEO_OV5645=y 102 | CONFIG_VIDEO_TUNER=m 103 | CONFIG_VIDEO_EM28XX=m 104 | CONFIG_VIDEO_TVEEPROM=m 105 | CONFIG_INPUT_MOUSEDEV=y 106 | 107 | CONFIG_PCI=y 108 | 109 | # CONFIG_VIDEO_AP1302 is not set 110 | CONFIG_VIDEO_IMX219=y 111 | # CONFIG_VIDEO_IMX274 is not set 112 | CONFIG_VIDEO_OV5640=y 113 | CONFIG_NFSD=y 114 | 115 | -------------------------------------------------------------------------------- /docs/source/conf.py: -------------------------------------------------------------------------------- 1 | # Configuration file for the Sphinx documentation builder. 2 | # 3 | # For the full list of built-in configuration values, see the documentation: 4 | # https://www.sphinx-doc.org/en/master/usage/configuration.html 5 | 6 | # -- Path setup -------------------------------------------------------------- 7 | 8 | # If extensions (or modules to document with autodoc) are in another directory, 9 | # add these directories to sys.path here. If the directory is relative to the 10 | # documentation root, use os.path.abspath to make it absolute, like shown here. 11 | # 12 | # import os 13 | # import sys 14 | # sys.path.insert(0, os.path.abspath('.')) 15 | import sys 16 | import os 17 | numfig = True 18 | 19 | # -- Project information ----------------------------------------------------- 20 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information 21 | 22 | project = 'RPi Camera FMC Reference Designs' 23 | copyright = '2024, Opsero Electronic Design Inc.' 24 | author = 'Jeff Johnson' 25 | 26 | # -- General configuration --------------------------------------------------- 27 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration 28 | 29 | extensions = [ 30 | 'myst_parser', 31 | ] 32 | 33 | # Add any paths that contain templates here, relative to this directory. 34 | templates_path = ['_templates'] 35 | 36 | # List of patterns, relative to source directory, that match files and 37 | # directories to ignore when looking for source files. 38 | # This pattern also affects html_static_path and html_extra_path. 39 | exclude_patterns = [] 40 | 41 | 42 | 43 | # -- Options for HTML output ------------------------------------------------- 44 | # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output 45 | 46 | # The theme to use for HTML and HTML Help pages. See the documentation for 47 | # a list of builtin themes. 48 | # 49 | html_theme = 'sphinx_rtd_theme' 50 | 51 | # Add any paths that contain custom static files (such as style sheets) here, 52 | # relative to this directory. They are copied after the builtin static files, 53 | # so a file named "default.css" will overwrite the builtin "default.css". 54 | html_static_path = ['_static'] 55 | 56 | import os 57 | import json 58 | from sphinx.util.fileutil import copy_asset 59 | from jinja2 import Environment, FileSystemLoader 60 | 61 | # Load the JSON data 62 | def load_json(): 63 | with open('data.json') as f: 64 | return json.load(f) 65 | 66 | # Add the data as a context variable for Jinja2 templates 67 | html_context = { 68 | 'data': load_json(), 69 | } 70 | 71 | # Function to process Jinja2 templates in .md files 72 | def render_jinja(app, docname, source): 73 | env = Environment( 74 | loader=FileSystemLoader(app.srcdir), 75 | ) 76 | template = env.from_string(source[0]) 77 | rendered_content = template.render(html_context) 78 | source[0] = rendered_content 79 | 80 | # Connect the Jinja2 rendering function to the Sphinx build process 81 | def setup(app): 82 | app.connect('source-read', render_jinja) 83 | -------------------------------------------------------------------------------- /Vivado/scripts/xsa.tcl: -------------------------------------------------------------------------------- 1 | # Opsero Electronic Design Inc. Copyright 2024 2 | # 3 | # This script runs synthesis, implementation and exports the hardware for a project. 4 | # 5 | # This script requires the target name and number of jobs to be specified upon launch. 6 | # It can be lauched in two ways: 7 | # 8 | # 1. Using two arguments passed to the script via tclargs. 9 | # eg. vivado -mode batch -source xsa.tcl -notrace -tclargs 10 | # 11 | # 2. By setting the target variables before sourcing the script. 12 | # eg. set target 13 | # set jobs 14 | # source xsa.tcl -notrace 15 | # 16 | #***************************************************************************************** 17 | 18 | # Check the version of Vivado used 19 | set version_required "2024.1" 20 | set ver [lindex [split $::env(XILINX_VIVADO) /] end] 21 | if {![string equal $ver $version_required]} { 22 | puts "###############################" 23 | puts "### Failed to build project ###" 24 | puts "###############################" 25 | puts "This project was designed for use with Vivado $version_required." 26 | puts "You are using Vivado $ver. Please install Vivado $version_required," 27 | puts "or download the project sources from a commit of the Git repository" 28 | puts "that was intended for your version of Vivado ($ver)." 29 | return 30 | } 31 | 32 | if { $argc == 3 } { 33 | set target [lindex $argv 0] 34 | puts "Target for the build: $target" 35 | set jobs [lindex $argv 1] 36 | puts "Number of jobs: $jobs" 37 | set synth_only [lindex $argv 2] 38 | puts "Synthesis only: $synth_only" 39 | } elseif { [info exists target] } { 40 | puts "Target for the build: $target" 41 | if { ![info exists jobs] } { 42 | set jobs 8 43 | } 44 | if { ![info exists synth_only] } { 45 | set synth_only 0 46 | } 47 | } else { 48 | puts "" 49 | puts "This script runs synthesis, implementation and exports the hardware for a project." 50 | puts "It can be launched in two ways:" 51 | puts "" 52 | puts " 1. Using three arguments passed to the script via tclargs." 53 | puts " eg. vivado -mode batch -source xsa.tcl -notrace -tclargs " 54 | puts "" 55 | puts " 2. By setting the target variables before sourcing the script." 56 | puts " eg. set target " 57 | puts " set jobs " 58 | puts " set synth_only " 59 | puts " source xsa.tcl -notrace" 60 | return 61 | } 62 | 63 | set design_name ${target} 64 | set block_name rpi 65 | 66 | # Set the reference directory for source file relative paths (by default the value is script directory path) 67 | set origin_dir "." 68 | 69 | # Set the directory path for the original project from where this script was exported 70 | set orig_proj_dir "[file normalize "$origin_dir/$design_name"]" 71 | 72 | # Open project 73 | open_project $origin_dir/$design_name/$design_name.xpr 74 | 75 | launch_runs synth_1 -jobs $jobs 76 | wait_on_run synth_1 77 | if {$synth_only == 1} { 78 | write_hw_platform -force -file $origin_dir/$design_name/${block_name}_wrapper.xsa 79 | } else { 80 | launch_runs impl_1 -jobs $jobs -to_step write_bitstream 81 | wait_on_run impl_1 82 | write_hw_platform -fixed -include_bit -force -file $origin_dir/$design_name/${block_name}_wrapper.xsa 83 | } 84 | validate_hw_platform -verbose $origin_dir/$design_name/${block_name}_wrapper.xsa 85 | 86 | -------------------------------------------------------------------------------- /docs/source/supported_carriers.md: -------------------------------------------------------------------------------- 1 | # Supported carrier boards 2 | 3 | ## List of supported boards 4 | 5 | {% set unique_boards = {} %} 6 | {% for design in data.designs %} 7 | {% if design.publish %} 8 | {% if design.board not in unique_boards %} 9 | {% set _ = unique_boards.update({design.board: {"group": design.group, "link": design.link, "connectors": []}}) %} 10 | {% endif %} 11 | {% set _ = unique_boards[design.board]["connectors"].append(design.connector) %} 12 | {% endif %} 13 | {% endfor %} 14 | 15 | {% for group in data.groups %} 16 | {% set designs_in_group = [] %} 17 | {% for design in data.designs %} 18 | {% if design.group == group.label and design.publish %} 19 | {% set _ = designs_in_group.append(design.label) %} 20 | {% endif %} 21 | {% endfor %} 22 | {% if designs_in_group | length > 0 %} 23 | ### {{ group.name }} boards 24 | 25 | | Carrier board | Supported FMC connector(s) | 26 | |---------------------|--------------| 27 | {% for name,board in unique_boards.items() %}{% if board.group == group.label %}| [{{ name }}]({{ board.link }}) | {% for connector in board.connectors %}{{ connector }} {% endfor %} | 28 | {% endif %}{% endfor %} 29 | {% endif %} 30 | {% endfor %} 31 | 32 | For list of the target designs showing the number of cameras supported, refer to the build instructions. 33 | 34 | ## Unlisted boards 35 | 36 | If you need more information on whether the [RPi Camera FMC] is compatible with a carrier that is not 37 | listed above, please first check the [compatibility list]. If the carrier is not listed there, please 38 | [contact Opsero], provide us with the pinout of your carrier and we'll be happy to check compatibility 39 | and generate a Vivado constraints file for you. 40 | 41 | ## Support for more than 4x cameras 42 | 43 | By using more than one [RPi Camera FMC] it is possible to support more than 4x cameras on a single 44 | target platform. At the moment however, the only target platform that can support more than 4x cameras 45 | in this way is the AMD Xilinx [ZCU102] Evaluation board, and it can only support a maximum of 6 46 | cameras. This configuration is achieved as follows: 47 | 48 | * ZCU102 HPC0 connector mates with one [RPi Camera FMC] with 4x cameras 49 | * ZCU102 HPC1 connector mates with another [RPi Camera FMC] with 2x cameras 50 | 51 | The limitation is due to the pinout of the HPC1 connector and there is currently no way around this. 52 | 53 | Here are some other possibilities for supporting more than 4x cameras on a single target platform: 54 | 55 | * Digilent [Genesys-ZU] Zynq UltraScale+ Development board can support 6x cameras with the 56 | [RPi Camera FMC] because it has 2x MIPI CSI connectors. 57 | * TUL [PYNQ-ZU] Zynq UltraScale+ Development board can support 5x cameras with the [RPi Camera FMC] 58 | because it has 1x MIPI CSI connector. 59 | 60 | ## Board specific notes 61 | 62 | ### PYNQ-ZU and UltraZed EV carrier 63 | 64 | Note that the PYNQ-ZU and UltraZed EV carrier boards have a fixed VADJ voltage that is set to 1.8VDC. The 65 | [AMD Xilinx MIPI CSI Controller Subsystem IP] documentation recommends an I/O voltage of 1.2VDC, and the 66 | Vivado tools prevent using the IP with IO standards that are not compatible with 1.2VDC. For this reason, 67 | all of the designs in this repository use 1.2VDC compatible IO standards, even though the I/O banks on the 68 | PYNQ-ZU and UltraZed EV carrier boards are powered at 1.8VDC. At the moment this is the only practical and 69 | functional workaround that we have found for these two target boards. 70 | 71 | 72 | [contact Opsero]: https://opsero.com/contact-us 73 | [RPi Camera FMC]: https://camerafmc.com/docs/rpi-camera-fmc/overview/ 74 | [compatibility list]: https://camerafmc.com/docs/rpi-camera-fmc/compatibility/ 75 | [AMD Xilinx MIPI CSI Controller Subsystem IP]: https://docs.xilinx.com/r/en-US/pg202-mipi-dphy 76 | 77 | [ZCU102]: https://www.xilinx.com/zcu102 78 | [Genesys-ZU]: https://digilent.com/shop/genesys-zu-zynq-ultrascale-mpsoc-development-board 79 | [PYNQ-ZU]: https://www.amd.com/en/corporate/university-program/aup-boards/pynq-zu.html 80 | -------------------------------------------------------------------------------- /Vivado/src/constraints/zcu102_hpc1.xdc: -------------------------------------------------------------------------------- 1 | 2 | # As we use LA03_P, we need the following constraint 3 | set_property UNAVAILABLE_DURING_CALIBRATION TRUE [get_ports iic_0_sda_io] 4 | 5 | # I2C signals for MIPI 0 6 | set_property PACKAGE_PIN AJ1 [get_ports iic_0_scl_io]; # LA03_N 7 | set_property PACKAGE_PIN AH1 [get_ports iic_0_sda_io]; # LA03_P 8 | set_property IOSTANDARD LVCMOS12 [get_ports iic_0_*] 9 | set_property SLEW SLOW [get_ports iic_0_*] 10 | set_property DRIVE 4 [get_ports iic_0_*] 11 | 12 | # I2C signals for MIPI 1 13 | set_property PACKAGE_PIN AH3 [get_ports iic_1_scl_io]; # LA05_N 14 | set_property PACKAGE_PIN AG3 [get_ports iic_1_sda_io]; # LA05_P 15 | set_property IOSTANDARD LVCMOS12 [get_ports iic_1_*] 16 | set_property SLEW SLOW [get_ports iic_1_*] 17 | set_property DRIVE 4 [get_ports iic_1_*] 18 | 19 | # CAM1 and CAM3 CLK_SEL signals 20 | set_property PACKAGE_PIN AF10 [get_ports {clk_sel[0]}]; # LA25_N 21 | set_property IOSTANDARD LVCMOS12 [get_ports {clk_sel[0]}] 22 | 23 | set_property PACKAGE_PIN AE10 [get_ports {clk_sel[1]}]; # LA25_P 24 | set_property IOSTANDARD LVCMOS12 [get_ports {clk_sel[1]}] 25 | 26 | # GPIOs for MIPI camera 0 27 | set_property PACKAGE_PIN AD6 [get_ports {gpio_0_tri_o[0]}]; # LA12_N 28 | set_property PACKAGE_PIN AD7 [get_ports {gpio_0_tri_o[1]}]; # LA12_P 29 | set_property IOSTANDARD LVCMOS12 [get_ports {gpio_0_tri_o[*]}] 30 | 31 | # GPIOs for MIPI camera 1 32 | set_property PACKAGE_PIN AE1 [get_ports {gpio_1_tri_o[0]}]; # LA09_N 33 | set_property PACKAGE_PIN AE2 [get_ports {gpio_1_tri_o[1]}]; # LA09_P 34 | set_property IOSTANDARD LVCMOS12 [get_ports {gpio_1_tri_o[*]}] 35 | 36 | # Reserved GPIOs 37 | set_property PACKAGE_PIN AF2 [get_ports {rsvd_gpio_tri_o[0]}]; # LA04_P 38 | set_property PACKAGE_PIN AF1 [get_ports {rsvd_gpio_tri_o[1]}]; # LA04_N 39 | set_property PACKAGE_PIN AD4 [get_ports {rsvd_gpio_tri_o[2]}]; # LA07_P 40 | set_property PACKAGE_PIN AE4 [get_ports {rsvd_gpio_tri_o[3]}]; # LA07_N 41 | set_property PACKAGE_PIN AG8 [get_ports {rsvd_gpio_tri_o[4]}]; # LA13_P 42 | set_property PACKAGE_PIN AH8 [get_ports {rsvd_gpio_tri_o[5]}]; # LA13_N 43 | set_property PACKAGE_PIN U10 [get_ports {rsvd_gpio_tri_o[6]}]; # LA27_P 44 | set_property PACKAGE_PIN T10 [get_ports {rsvd_gpio_tri_o[7]}]; # LA27_N 45 | set_property PACKAGE_PIN W12 [get_ports {rsvd_gpio_tri_o[8]}]; # LA29_P 46 | set_property PACKAGE_PIN W11 [get_ports {rsvd_gpio_tri_o[9]}]; # LA29_N 47 | set_property IOSTANDARD LVCMOS12 [get_ports {rsvd_gpio_tri_o[*]}] 48 | 49 | # MIPI interface 0 50 | set_property PACKAGE_PIN AE5 [get_ports {mipi_phy_if_0_clk_p}]; # LA00_CC_P 51 | set_property PACKAGE_PIN AF5 [get_ports {mipi_phy_if_0_clk_n}]; # LA00_CC_N 52 | set_property PACKAGE_PIN AH2 [get_ports {mipi_phy_if_0_data_p[0]}]; # LA06_P 53 | set_property PACKAGE_PIN AJ2 [get_ports {mipi_phy_if_0_data_n[0]}]; # LA06_N 54 | set_property PACKAGE_PIN AD2 [get_ports {mipi_phy_if_0_data_p[1]}]; # LA02_P 55 | set_property PACKAGE_PIN AD1 [get_ports {mipi_phy_if_0_data_n[1]}]; # LA02_N 56 | 57 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_0_clk_p] 58 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_0_clk_n] 59 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_0_data_p[*]] 60 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_0_data_n[*]] 61 | 62 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_0_clk_p] 63 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_0_clk_n] 64 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_0_data_p[*]] 65 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_0_data_n[*]] 66 | 67 | # MIPI interface 1 68 | set_property PACKAGE_PIN AJ6 [get_ports {mipi_phy_if_1_clk_p}]; # LA01_CC_P 69 | set_property PACKAGE_PIN AJ5 [get_ports {mipi_phy_if_1_clk_n}]; # LA01_CC_N 70 | set_property PACKAGE_PIN AD10 [get_ports {mipi_phy_if_1_data_p[0]}]; # LA15_P 71 | set_property PACKAGE_PIN AE9 [get_ports {mipi_phy_if_1_data_n[0]}]; # LA15_N 72 | set_property PACKAGE_PIN AH7 [get_ports {mipi_phy_if_1_data_p[1]}]; # LA14_P 73 | set_property PACKAGE_PIN AH6 [get_ports {mipi_phy_if_1_data_n[1]}]; # LA14_N 74 | 75 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_1_clk_p] 76 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_1_clk_n] 77 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_1_data_p[*]] 78 | set_property IOSTANDARD MIPI_DPHY_DCI [get_ports mipi_phy_if_1_data_n[*]] 79 | 80 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_1_clk_p] 81 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_1_clk_n] 82 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_1_data_p[*]] 83 | set_property DIFF_TERM_ADV TERM_100 [get_ports mipi_phy_if_1_data_n[*]] 84 | 85 | -------------------------------------------------------------------------------- /Vitis/common/src/imx219.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * Credit to Greg Taylor https://github.com/gtaylormb/ultra96v2_imx219_to_displayport 5 | */ 6 | #include "sleep.h" 7 | #include "imx219.h" 8 | #include "xgpio.h" 9 | #include "xil_printf.h" 10 | #include "i2c.h" 11 | 12 | // config from https://android.googlesource.com/kernel/bcm/+/android-bcm-tetra-3.10-lollipop-wear-release/drivers/media/video/imx219.c 13 | /* 1920x1080P48 */ 14 | imx219_config_word_t const imx219_cfg[] = 15 | { 16 | {0x30EB, 0x05}, 17 | {0x30EB, 0x0C}, 18 | {0x300A, 0xFF}, 19 | {0x300B, 0xFF}, 20 | {0x30EB, 0x05}, 21 | {0x30EB, 0x09}, 22 | {0x0114, 0x01}, // 2-wire csi 23 | {0x0128, 0x00}, // auto MIPI global timing 24 | {0x012A, 0x18}, // INCK freq: 24.0Mhz 25 | {0x012B, 0x00}, 26 | {0x0160, 0x04}, // frame length lines = 1113 27 | {0x0161, 0x59}, 28 | {0x0162, 0x0D}, // line length pixels = 3448 29 | {0x0163, 0x78}, 30 | {0x0164, 0x02}, // x-start address = 680 31 | {0x0165, 0xA8}, 32 | {0x0166, 0x0A}, // x-end address = 2599 33 | {0x0167, 0x27}, 34 | {0x0168, 0x02}, // y-start address = 692 35 | {0x0169, 0xB4}, 36 | {0x016A, 0x06}, // y-end address = 1771 37 | {0x016B, 0xEB}, 38 | {0x016C, 0x07}, // x-output size = 1920 39 | {0x016D, 0x80}, 40 | {0x016E, 0x04}, // y-output size = 1080 41 | {0x016F, 0x38}, 42 | {0x0170, 0x01}, // 43 | {0x0171, 0x01}, 44 | {0x0174, 0x00}, 45 | {0x0175, 0x00}, 46 | {0x018C, 0x0A}, 47 | {0x018D, 0x0A}, 48 | {0x0301, 0x05}, // video timing pixel clock divider value = 5 49 | {0x0303, 0x01}, // video timing system clock divider value = 1 50 | {0x0304, 0x03}, // external clock 24-27MHz 51 | {0x0305, 0x03}, // external clock 24-27MHz 52 | {0x0306, 0x00}, // PLL Video Timing system multiplier value = 57 53 | {0x0307, 0x39}, 54 | {0x0309, 0x0A}, // output pixel clock divider value = 10 55 | {0x030B, 0x01}, // output system clock divider value = 1 56 | {0x030C, 0x00}, // PLL output system multiplier value = 114 57 | {0x030D, 0x72}, 58 | {0x455E, 0x00}, 59 | {0x471E, 0x4B}, 60 | {0x4767, 0x0F}, 61 | {0x4750, 0x14}, 62 | {0x4540, 0x00}, 63 | {0x47B4, 0x14}, 64 | {0x4713, 0x30}, 65 | {0x478B, 0x10}, 66 | {0x478F, 0x10}, 67 | {0x4793, 0x10}, 68 | {0x4797, 0x0E}, 69 | {0x479B, 0x0E}, 70 | {0x0100, 0x01} 71 | }; 72 | 73 | /* 74 | * Looks for the IMX219 on the I2C bus 75 | */ 76 | int imx219_detect(uint8_t iic_id) 77 | { 78 | int Status; 79 | uint8_t data; 80 | 81 | // Read the register 82 | Status = imx219_read(iic_id,0x00,&data); 83 | if (Status != XST_SUCCESS) { 84 | return XST_FAILURE; 85 | } 86 | if(data != 0x02) { 87 | return XST_FAILURE; 88 | } 89 | else { 90 | return XST_SUCCESS; 91 | } 92 | } 93 | 94 | int imx219_config(uint8_t iic_id,XGpio *gpio,uint32_t gpio_mask) { 95 | int Status; 96 | // Reset the camera 97 | imx219_reset(gpio,gpio_mask); 98 | // Stop streaming 99 | Status = imx219_write(iic_id, 0x0100, 0x00); 100 | if(Status != XST_SUCCESS) { 101 | return(Status); 102 | } 103 | usleep(1000); // Write the config registers 104 | size_t len = sizeof(imx219_cfg)/sizeof(imx219_cfg[0]); 105 | for(size_t i = 0; i < len; i++) 106 | { 107 | Status = imx219_write(iic_id,imx219_cfg[i].addr,imx219_cfg[i].data); 108 | if(Status != XST_SUCCESS) { 109 | return(Status); 110 | } 111 | // Delay between writes does not seem to be required for IMX219 112 | //usleep(1000); 113 | } 114 | 115 | imx219_write(iic_id,IMX219_ANA_GAIN_GLOBAL, 232); 116 | 117 | // Commented out in Greg Taylor's code 118 | // imx219_write(iic_id,IMX219_COARSE_INT_TIME_HI, 0x02); 119 | 120 | return XST_SUCCESS; 121 | } 122 | 123 | // Reset the IMX219 by toggling the enable pin 124 | int imx219_reset(XGpio *gpio,uint32_t gpio_mask) 125 | { 126 | // Disable the camera, wait 100ms 127 | XGpio_DiscreteClear(gpio, 1, gpio_mask); 128 | usleep(100000); 129 | // Enable the camera, wait 50ms 130 | XGpio_DiscreteSet(gpio, 1, gpio_mask); 131 | usleep(100000); 132 | return XST_SUCCESS; 133 | } 134 | 135 | int imx219_write(uint8_t iic_id,uint16_t addr, uint8_t data) 136 | { 137 | int Status; 138 | uint8_t buf[10]; 139 | buf[0] = addr >> 8; 140 | buf[1] = addr & 0x00FF; 141 | buf[2] = data; 142 | Status = IicWrite(iic_id,IMX219_I2C_SLAVE_ADDR,buf,3); 143 | return Status; 144 | } 145 | 146 | int imx219_read(uint8_t iic_id,uint16_t addr, uint8_t *data) 147 | { 148 | int Status; 149 | uint8_t buf[10]; 150 | buf[0] = addr >> 8; 151 | buf[1] = addr & 0x00FF; 152 | Status = IicWrite(iic_id,IMX219_I2C_SLAVE_ADDR,buf,2); 153 | if (Status != XST_SUCCESS) { 154 | return(Status); 155 | } 156 | Status = IicRead(iic_id,IMX219_I2C_SLAVE_ADDR,buf,1); 157 | if (Status != XST_SUCCESS) { 158 | return(Status); 159 | } 160 | *data = buf[0]; 161 | return XST_SUCCESS; 162 | } 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /docs/source/data.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": [ 3 | { 4 | "label": "fpga", 5 | "name": "FPGA" 6 | }, 7 | { 8 | "label": "z7", 9 | "name": "Zynq-7000" 10 | }, 11 | { 12 | "label": "zu", 13 | "name": "Zynq UltraScale+" 14 | }, 15 | { 16 | "label": "versal", 17 | "name": "Versal" 18 | } 19 | ], 20 | "designs": [ 21 | { 22 | "publish": true, 23 | "label": "zcu104", 24 | "board": "ZCU104", 25 | "link": "https://www.xilinx.com/zcu104", 26 | "url": "xilinx.com", 27 | "boardname": "zcu104", 28 | "cams": [0,1,2,3], 29 | "vcu": true, 30 | "accel": false, 31 | "cfg": "prj_config", 32 | "connector": "LPC", 33 | "group": "zu", 34 | "petalinux": true, 35 | "baremetal": false, 36 | "license": false, 37 | "flashsize": "0", 38 | "flashintf": "0" 39 | }, 40 | { 41 | "publish": true, 42 | "label": "zcu102_hpc0", 43 | "board": "ZCU102", 44 | "link": "https://www.xilinx.com/zcu102", 45 | "url": "xilinx.com", 46 | "boardname": "zcu102", 47 | "cams": [0,1,2,3], 48 | "vcu": false, 49 | "accel": false, 50 | "cfg": "prj_config", 51 | "connector": "HPC0", 52 | "group": "zu", 53 | "petalinux": true, 54 | "baremetal": false, 55 | "license": false, 56 | "flashsize": "0", 57 | "flashintf": "0" 58 | }, 59 | { 60 | "publish": true, 61 | "label": "zcu102_hpc1", 62 | "board": "ZCU102", 63 | "link": "https://www.xilinx.com/zcu102", 64 | "url": "xilinx.com", 65 | "boardname": "zcu102", 66 | "cams": [0,1], 67 | "vcu": false, 68 | "accel": false, 69 | "cfg": "prj_config_1", 70 | "connector": "HPC1", 71 | "group": "zu", 72 | "petalinux": true, 73 | "baremetal": false, 74 | "license": false, 75 | "flashsize": "0", 76 | "flashintf": "0" 77 | }, 78 | { 79 | "publish": true, 80 | "label": "zcu106_hpc0", 81 | "board": "ZCU106", 82 | "link": "https://www.xilinx.com/zcu106", 83 | "url": "xilinx.com", 84 | "boardname": "zcu106", 85 | "cams": [0,1,2,3], 86 | "vcu": true, 87 | "accel": false, 88 | "cfg": "prj_config", 89 | "connector": "HPC0", 90 | "group": "zu", 91 | "petalinux": true, 92 | "baremetal": false, 93 | "license": false, 94 | "flashsize": "0", 95 | "flashintf": "0" 96 | }, 97 | { 98 | "publish": true, 99 | "label": "pynqzu", 100 | "board": "PYNQ-ZU", 101 | "link": "https://www.amd.com/en/corporate/university-program/aup-boards/pynq-zu.html", 102 | "url": "tul.com.tw", 103 | "boardname": "pynqzu", 104 | "cams": [1,2], 105 | "vcu": false, 106 | "accel": false, 107 | "cfg": "prj_config", 108 | "connector": "LPC", 109 | "group": "zu", 110 | "petalinux": true, 111 | "baremetal": false, 112 | "license": false, 113 | "flashsize": "0", 114 | "flashintf": "0" 115 | }, 116 | { 117 | "publish": false, 118 | "label": "genesyszu", 119 | "board": "Genesys ZU", 120 | "link": "https://digilent.com/shop/genesys-zu-zynq-ultrascale-mpsoc-development-board/", 121 | "url": "digilentinc.com", 122 | "boardname": "gzu_5ev", 123 | "cams": [1,2], 124 | "vcu": true, 125 | "accel": false, 126 | "cfg": "prj_config", 127 | "connector": "LPC", 128 | "group": "zu", 129 | "petalinux": false, 130 | "baremetal": false, 131 | "license": false, 132 | "flashsize": "0", 133 | "flashintf": "0" 134 | }, 135 | { 136 | "publish": true, 137 | "label": "uzev", 138 | "board": "UltraZed-EV Carrier", 139 | "link": "https://www.xilinx.com/products/boards-and-kits/1-1s78dxb.html", 140 | "url": "avnet.com", 141 | "boardname": "ultrazed_7ev_cc", 142 | "cams": [0,1,2,3], 143 | "vcu": true, 144 | "accel": false, 145 | "cfg": "prj_config", 146 | "connector": "HPC", 147 | "group": "zu", 148 | "petalinux": true, 149 | "baremetal": false, 150 | "license": false, 151 | "flashsize": "0", 152 | "flashintf": "0" 153 | }, 154 | { 155 | "publish": true, 156 | "label": "auboard", 157 | "board": "AUBoard 15P", 158 | "link": "https://www.avnet.com/americas/products/avnet-boards/avnet-board-families/auboard-15p-fpga-development-kit/", 159 | "url": "avnet-tria", 160 | "boardname": "auboard_15p", 161 | "cams": [0,2], 162 | "vcu": false, 163 | "accel": false, 164 | "cfg": "prj_config", 165 | "connector": "HPC", 166 | "group": "fpga", 167 | "petalinux": false, 168 | "baremetal": true, 169 | "license": false, 170 | "flashsize": "0", 171 | "flashintf": "0" 172 | } 173 | ] 174 | } 175 | -------------------------------------------------------------------------------- /Vivado/ip/isppipeline/include/xf_config_params.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2023 Advanced Micro Devices, Inc. All rights reserved. 2 | // SPDX-License-Identifier: Apache-2.0 3 | 4 | #ifndef _XF_ISP_TYPES_H_ 5 | #define _XF_ISP_TYPES_H_ 6 | 7 | // -------------------------------------------------------------------- 8 | // Required files 9 | // -------------------------------------------------------------------- 10 | #include "hls_stream.h" 11 | #include "ap_int.h" 12 | #include "common/xf_common.hpp" 13 | //#include "common/xf_utility.h" 14 | #include "ap_axi_sdata.h" 15 | #include "common/xf_axi_io.hpp" 16 | 17 | // Requried Vision modules 18 | #include "imgproc/xf_bpc.hpp" 19 | #include "imgproc/xf_gaincontrol.hpp" 20 | #include "imgproc/xf_autowhitebalance.hpp" 21 | #include "imgproc/xf_demosaicing.hpp" 22 | #include "imgproc/xf_ltm.hpp" 23 | #include "imgproc/xf_quantizationdithering.hpp" 24 | #include "imgproc/xf_lensshadingcorrection.hpp" 25 | #include "imgproc/xf_colorcorrectionmatrix.hpp" 26 | #include "imgproc/xf_black_level.hpp" 27 | #include "imgproc/xf_aec.hpp" 28 | #include "imgproc/xf_cvt_color.hpp" 29 | #include "imgproc/xf_cvt_color_1.hpp" 30 | #include "imgproc/xf_gammacorrection.hpp" 31 | 32 | #define XF_WIDTH 1920 33 | // MAX_COLS 34 | #define XF_HEIGHT 1080 35 | // MAX_ROWS 36 | 37 | #define XF_CV_DEPTH_IN_1 2 38 | #define XF_CV_DEPTH_IN_2 2 39 | #define XF_CV_DEPTH_BPC_OUT 2 40 | #define XF_CV_DEPTH_GAIN_OUT 2 41 | #define XF_CV_DEPTH_DEMOSAIC_OUT 2 42 | #define XF_CV_DEPTH_IMPOP 2 43 | #define XF_CV_DEPTH_LTM_IN 2 44 | #define XF_CV_DEPTH_LSC_OUT 2 45 | #define XF_CV_DEPTH_DST 2 46 | #define XF_CV_DEPTH_AEC_IN 2 47 | #define XF_CV_DEPTH_OUT 2 48 | 49 | //#define NPPCX XF_NPPC2 50 | #define NPPCX XF_NPPC1 51 | 52 | //#define XF_BAYER_PATTERN XF_BAYER_GR 53 | #define XF_BAYER_PATTERN XF_BAYER_RG 54 | // bayer pattern 55 | 56 | #define T_8U 0 57 | #define T_10U 1 58 | #define T_12U 0 59 | #define T_16U 0 60 | 61 | #define XF_CCM_TYPE XF_CCM_bt2020_bt709 62 | 63 | #define XF_LTM_T XF_8UC3 64 | // XF_8UC3 65 | 66 | #define IN_TYPE XF_10UC1 67 | // XF_8UC1 68 | #define OUT_TYPE XF_10UC3 69 | // XF_8UC3 70 | 71 | // #if T_8U 72 | // #define IN_TYPE XF_8UC1 73 | // XF_8UC1 74 | // #define OUT_TYPE XF_8UC3 75 | // XF_8UC3 76 | // #elif T_16U 77 | // #define IN_TYPE XF_16UC1 78 | // XF_8UC1 79 | // #define OUT_TYPE XF_16UC3 80 | // XF_8UC3 81 | // #elif T_10U 82 | // #define IN_TYPE XF_10UC1 83 | // XF_8UC1 84 | // #define OUT_TYPE XF_10UC3 85 | // XF_8UC3 86 | // #elif T_12U 87 | // #define IN_TYPE XF_12UC1 88 | // XF_8UC1 89 | // #define OUT_TYPE XF_12UC3 90 | // XF_8UC3 91 | // #endif 92 | 93 | #define SIN_CHANNEL_TYPE XF_8UC1 94 | 95 | #define WB_TYPE XF_WB_SIMPLE 96 | #define AEC_EN 0 97 | 98 | #define XF_AXI_GBR 1 99 | 100 | #define XF_USE_URAM 0 101 | // uram enable not implemented correctly needs correction 102 | 103 | #define S_DEPTH 4096 104 | 105 | // -------------------------------------------------------------------- 106 | // Macros definitions 107 | // -------------------------------------------------------------------- 108 | 109 | // Useful macro functions definitions 110 | #define _DATA_WIDTH_(_T, _N) (XF_PIXELWIDTH(_T, _N) * XF_NPIXPERCYCLE(_N)) 111 | #define _BYTE_ALIGN_(_N) ((((_N) + 7) / 8) * 8) 112 | 113 | #define IN_DATA_WIDTH _DATA_WIDTH_(IN_TYPE, NPPCX) 114 | //#define OUT_DATA_WIDTH _DATA_WIDTH_(OUT_TYPE, NPPCX) 115 | #define OUT_DATA_WIDTH _DATA_WIDTH_(XF_LTM_T, NPPCX) 116 | //#define OUT_DATA_WIDTH _DATA_WIDTH_(XF_16UC1, NPPCX) 117 | 118 | #define AXI_WIDTH_IN _BYTE_ALIGN_(IN_DATA_WIDTH) 119 | #define AXI_WIDTH_OUT _BYTE_ALIGN_(OUT_DATA_WIDTH) 120 | 121 | #define NR_COMPONENTS 3 122 | static constexpr int BLOCK_HEIGHT = 64; 123 | static constexpr int BLOCK_WIDTH = 64; 124 | // -------------------------------------------------------------------- 125 | // Internal types 126 | // -------------------------------------------------------------------- 127 | // Input/Output AXI video buses 128 | typedef ap_axiu InVideoStrmBus_t; 129 | typedef ap_axiu OutVideoStrmBus_t; 130 | 131 | // Input/Output AXI video stream 132 | typedef hls::stream InVideoStrm_t; 133 | typedef hls::stream OutVideoStrm_t; 134 | 135 | #if T_8U 136 | #define HIST_SIZE 256 137 | #endif 138 | #if T_10U 139 | #define HIST_SIZE 1024 140 | #endif 141 | #if T_12U 142 | #define HIST_SIZE 4096 143 | #endif 144 | #if T_16U 145 | #define HIST_SIZE 4096 146 | #endif 147 | 148 | #define BLACK_LEVEL 32 149 | #define MAX_PIX_VAL (1 << (XF_DTPIXELDEPTH(IN_TYPE, NPPCX))) - 1 150 | 151 | // HW Registers 152 | typedef struct { 153 | uint16_t width; 154 | uint16_t height; 155 | 156 | // uint16_t video_format; 157 | uint16_t bayer_phase; 158 | } HW_STRUCT_REG; 159 | 160 | // -------------------------------------------------------------------- 161 | // Prototype 162 | // -------------------------------------------------------------------- 163 | // top level function for HW synthesis 164 | void ISPPipeline_accel(uint16_t width, 165 | uint16_t height, 166 | InVideoStrm_t& s_axis_video, 167 | OutVideoStrm_t& m_axis_video, 168 | uint16_t rgain, 169 | uint16_t bgain, 170 | unsigned char r_lut[256 * 3], 171 | unsigned char mode_reg, 172 | uint16_t pawb); 173 | #endif 174 | -------------------------------------------------------------------------------- /Vivado/Makefile: -------------------------------------------------------------------------------- 1 | # Opsero Electronic Design Inc. 2024 2 | # 3 | # This Makefile can be used to build the Vivado projects. 4 | 5 | CP = cp -rf 6 | MKDIR = mkdir -p 7 | RM = rm -rf 8 | ROOT_DIR = $(shell pwd) 9 | VIVADO = $(XILINX_VIVADO)/bin/vivado 10 | BD_NAME = rpi 11 | 12 | # defaults 13 | .DEFAULT_GOAL := xsa 14 | TARGET ?= none 15 | JOBS ?= 8 16 | 17 | # valid targets 18 | # UPDATER START 19 | zcu104_target := xilinx.com zcu104 no_accel 20 | zcu102_hpc0_target := xilinx.com zcu102 no_accel 21 | zcu102_hpc1_target := xilinx.com zcu102 no_accel 22 | zcu106_hpc0_target := xilinx.com zcu106 no_accel 23 | pynqzu_target := tul.com.tw pynqzu no_accel 24 | genesyszu_target := digilentinc.com gzu_5ev no_accel 25 | uzev_target := avnet.com ultrazed_7ev_cc no_accel 26 | auboard_target := avnet.com auboard_15p no_accel 27 | # UPDATER END 28 | 29 | TARGET_LIST := $(sort $(patsubst %_target,%,$(filter %_target,$(.VARIABLES)))) 30 | 31 | BOARD_URL = $(word 1,$($(TARGET)_target)) 32 | BOARD_NAME = $(word 2,$($(TARGET)_target)) 33 | 34 | # Vivado paths 35 | VIV_SCRIPT_BD = scripts/build.tcl 36 | VIV_SCRIPT_XSA = scripts/xsa.tcl 37 | VIV_DIR = $(TARGET) 38 | IP_DIR= ./ip 39 | IP_DONE = $(IP_DIR)/build/$(BOARD_NAME)/ip_done.txt 40 | 41 | # output files 42 | VIV_XPR = $(VIV_DIR)/$(TARGET).xpr 43 | VIV_XSA = $(VIV_DIR)/$(BD_NAME)_wrapper.xsa 44 | VIV_XPR_LOG = $(TARGET)_xpr.log 45 | VIV_XPR_JOU = $(TARGET)_xpr.jou 46 | VIV_XSA_LOG = $(TARGET)_xsa.log 47 | VIV_XSA_JOU = $(TARGET)_xsa.jou 48 | VIV_BIT = $(VIV_DIR)/$(TARGET).runs/impl_1/$(BD_NAME)_wrapper.bit 49 | VIV_LOCK = $(ROOT_DIR)/.$(TARGET).lock 50 | 51 | # These macros return values from the valid target lists defined above 52 | define get_has_accel 53 | $(word 3,$($(1)_target)) 54 | endef 55 | 56 | # Targets with accelerators don't need to run implementation, only synth 57 | ifeq ($(call get_has_accel,$(TARGET)), accel) 58 | SYNTH_ONLY = 1 59 | else 60 | SYNTH_ONLY = 0 61 | endif 62 | 63 | .PHONY: help 64 | help: 65 | @echo 'Usage:' 66 | @echo '' 67 | @echo ' make xsa TARGET= JOBS=' 68 | @echo ' Create the Vivado project and block design, then synthesize' 69 | @echo ' implement and export to XSA.' 70 | @echo '' 71 | @echo ' make project TARGET=' 72 | @echo ' Create the Vivado project and block design.' 73 | @echo '' 74 | @echo ' make clean TARGET=' 75 | @echo ' Clean runs for target project.' 76 | @echo '' 77 | @echo ' make xsa_all JOBS=' 78 | @echo ' Same as make xsa but for all targets.' 79 | @echo '' 80 | @echo ' make project_all' 81 | @echo ' Same as make project but for all targets.' 82 | @echo '' 83 | @echo ' make clean_all' 84 | @echo ' Same as make clean but for all targets.' 85 | @echo '' 86 | @echo 'Parameters:' 87 | @echo '' 88 | @echo ' TARGET: Name of the target design, must be one of the following:' 89 | @$(foreach targ,$(TARGET_LIST),echo " - $(targ)";) 90 | @echo '' 91 | @echo ' JOBS: Optional param to set number of synthesis jobs (default 8)' 92 | @echo '' 93 | @echo 'Example usage:' 94 | @echo ' make xsa TARGET=$(word 1,$(TARGET_LIST))' 95 | @echo '' 96 | 97 | .PHONY: all 98 | all: xsa_all 99 | 100 | .PHONY: ip 101 | ip: $(IP_DONE) 102 | 103 | $(IP_DONE): 104 | make -C $(IP_DIR) ip TARGET=$(TARGET) 105 | 106 | .PHONY: xsa 107 | xsa: 108 | @if [ -f $(VIV_LOCK) ]; then \ 109 | echo "$(TARGET) is locked. Skipping..."; \ 110 | else \ 111 | touch $(VIV_LOCK); \ 112 | $(MAKE) xsa_locked TARGET=$(TARGET) JOBS=$(JOBS); \ 113 | rm -f $(VIV_LOCK); \ 114 | fi 115 | 116 | xsa_locked: $(VIV_XSA) check_warnings 117 | $(VIV_XSA): $(VIV_XPR) 118 | $(RM) $(VIV_XSA_LOG) $(VIV_XSA_JOU) 119 | $(VIVADO) -mode batch -notrace -source $(VIV_SCRIPT_XSA) -log $(VIV_XSA_LOG) -journal $(VIV_XSA_JOU) -tclargs $(TARGET) $(JOBS) $(SYNTH_ONLY) 120 | $(CP) $(VIV_XSA_LOG) $(VIV_XSA_JOU) $(TARGET)/. 121 | $(RM) $(VIV_XSA_LOG) $(VIV_XSA_JOU) 122 | 123 | check_warnings: 124 | @grep "CRITICAL WARNING:" $(TARGET)/$(VIV_XSA_LOG) && { \ 125 | echo "Critical warnings found. Exiting."; \ 126 | echo "For details see: $(TARGET)/$(VIV_XSA_LOG)"; \ 127 | exit 1; \ 128 | } || true 129 | 130 | .PHONY: xsa_all 131 | xsa_all: 132 | for targ in $(TARGET_LIST); do \ 133 | $(MAKE) xsa TARGET=$$targ JOBS=$(JOBS); \ 134 | done 135 | 136 | .PHONY: project 137 | project: check_target 138 | @if [ -f $(VIV_LOCK) ]; then \ 139 | echo "$(TARGET) is locked. Skipping..."; \ 140 | else \ 141 | touch $(VIV_LOCK); \ 142 | $(MAKE) project_locked TARGET=$(TARGET) JOBS=$(JOBS); \ 143 | rm -f $(VIV_LOCK); \ 144 | fi 145 | 146 | project_locked: $(VIV_XPR) 147 | $(VIV_XPR): $(IP_DONE) 148 | @echo 'Create Vivado project $(TARGET)' 149 | $(RM) $(VIV_XPR_LOG) $(VIV_XPR_JOU) 150 | $(VIVADO) -mode batch -notrace -source $(VIV_SCRIPT_BD) -log $(VIV_XPR_LOG) -journal $(VIV_XPR_JOU) -tclargs $(TARGET) 151 | $(CP) $(VIV_XPR_LOG) $(VIV_XPR_JOU) $(TARGET)/. 152 | $(RM) $(VIV_XPR_LOG) $(VIV_XPR_JOU) 153 | 154 | .PHONY: project_all 155 | project_all: 156 | for targ in $(TARGET_LIST); do \ 157 | $(MAKE) project TARGET=$$targ JOBS=$(JOBS); \ 158 | done 159 | 160 | .PHONY: clean 161 | clean: check_target 162 | @echo 'Cleaning project $(TARGET)' 163 | $(RM) $(VIV_DIR) 164 | $(MAKE) -C $(IP_DIR) clean TARGET=$(TARGET) 165 | 166 | .PHONY: clean_all 167 | clean_all: 168 | for targ in $(TARGET_LIST); do \ 169 | $(MAKE) clean TARGET=$$targ; \ 170 | done 171 | $(MAKE) -C $(IP_DIR) clean_all 172 | $(RM) .Xil vivado*.log vivado*.jou 173 | 174 | check_target: 175 | ifndef $(TARGET)_target 176 | $(error "Please specify a TARGET. Use 'make help' to see valid targets.") 177 | endif 178 | 179 | 180 | -------------------------------------------------------------------------------- /Vitis/Makefile: -------------------------------------------------------------------------------- 1 | # Opsero Electronic Design Inc. 2025 2 | # 3 | # This Makefile can be used to build the Vitis workspace. 4 | 5 | CP = cp -rf 6 | MKDIR = mkdir -p 7 | RM = rm -rf 8 | ROOT_DIR = $(shell pwd) 9 | XSCT = $(XILINX_VITIS)/bin/xsct 10 | BD_NAME = rpi 11 | ARGS_JSON = py/args.json 12 | DATA_JSON = ../docs/source/data.json 13 | 14 | # defaults 15 | .DEFAULT_GOAL := workspace 16 | TARGET ?= none 17 | JOBS ?= 8 18 | 19 | # valid targets 20 | # UPDATER START 21 | auboard_target := microblaze 22 | # UPDATER END 23 | 24 | TARGET_LIST := $(sort $(patsubst %_target,%,$(filter %_target,$(.VARIABLES)))) 25 | 26 | # Vitis paths 27 | VIT_SCRIPT_WS = py/build-vitis.py 28 | VIT_SCRIPT_BOOT = py/make-boot.py 29 | VIT_TARGET_WS = $(ROOT_DIR)/$(TARGET)_workspace 30 | VIT_LOCK = $(ROOT_DIR)/.$(TARGET).lock 31 | VIT_BOOT = $(ROOT_DIR)/boot 32 | VIT_BOOT_TARG = $(VIT_BOOT)/$(TARGET) 33 | 34 | # Vivado paths 35 | VIV_DIR = $(ROOT_DIR)/../Vivado 36 | VIV_PRJ_DIR = $(VIV_DIR)/$(TARGET) 37 | VIV_XSA = $(VIV_PRJ_DIR)/$(BD_NAME)_wrapper.xsa 38 | 39 | # These macros return values from the valid target lists defined above 40 | define get_template_name 41 | $(word 1,$($(1)_target)) 42 | endef 43 | 44 | # The name of the boot image depends on the device family. 45 | # NOTE: For MicroBlaze, make-boot.py may produce either: 46 | # - $(TARGET)_boot.bit (when combine_bit_elf=true), or 47 | # - $(TARGET).bit (when combine_bit_elf=false) 48 | # We don’t hard-depend on the exact filename here; see the bootfile target. 49 | ifeq ($(call get_template_name,$(TARGET)), microblaze) 50 | VIT_BOOT_FILE = $(VIT_BOOT_TARG)/$(TARGET).bit 51 | else ifeq ($(call get_template_name,$(TARGET)), zynq) 52 | VIT_BOOT_FILE = $(VIT_BOOT_TARG)/BOOT.BIN 53 | else ifeq ($(call get_template_name,$(TARGET)), zynqMP) 54 | VIT_BOOT_FILE = $(VIT_BOOT_TARG)/BOOT.BIN 55 | else ifeq ($(call get_template_name,$(TARGET)), versal) 56 | VIT_BOOT_FILE = $(VIT_BOOT_TARG)/BOOT.BIN 57 | endif 58 | 59 | .PHONY: help 60 | help: 61 | @echo 'Usage:' 62 | @echo '' 63 | @echo ' make workspace TARGET= JOBS=' 64 | @echo ' Create the Vitis workspace and add applications for specified target.' 65 | @echo '' 66 | @echo ' make all JOBS=' 67 | @echo ' Create the Vitis workspace and add applications for all targets.' 68 | @echo '' 69 | @echo ' make bootfile TARGET=' 70 | @echo ' Generate a boot image for the specified target (bit or BOOT.BIN).' 71 | @echo '' 72 | @echo ' make clean TARGET=' 73 | @echo ' Delete the Vitis workspace and all applications for specified target.' 74 | @echo '' 75 | @echo ' make clean_all' 76 | @echo ' Delete all Vitis workspaces and all applications.' 77 | @echo '' 78 | @echo 'Parameters:' 79 | @echo '' 80 | @echo ' TARGET: Name of the target design, must be one of the following:' 81 | @$(foreach targ,$(TARGET_LIST),echo " - $(targ)";) 82 | @echo '' 83 | @echo ' JOBS: Optional param to set number of synthesis jobs (default 8)' 84 | @echo '' 85 | @echo 'Example usage:' 86 | @echo ' make workspace TARGET=$(word 1,$(TARGET_LIST))' 87 | @echo ' make bootfile TARGET=$(word 1,$(TARGET_LIST))' 88 | @echo '' 89 | 90 | .PHONY: all 91 | all: 92 | @{ \ 93 | for targ in $(TARGET_LIST); do \ 94 | $(MAKE) --no-print-directory workspace TARGET=$$targ; \ 95 | done; \ 96 | } 97 | 98 | .PHONY: workspace 99 | workspace: check_target 100 | @if [ -f $(VIT_LOCK) ]; then \ 101 | echo "$(TARGET) is locked. Skipping..."; \ 102 | else \ 103 | touch $(VIT_LOCK); \ 104 | $(MAKE) workspace_locked TARGET=$(TARGET) JOBS=$(JOBS); \ 105 | rm -f $(VIT_LOCK); \ 106 | fi 107 | 108 | workspace_locked: $(VIT_TARGET_WS) 109 | 110 | $(VIT_TARGET_WS): $(VIV_XSA) 111 | @if [ -d $@ ]; then echo "Workspace for $(TARGET) already exists but is outdated. Use 'make clean TARGET=$(TARGET)' to remove it."; exit 1; fi 112 | vitis -source $(VIT_SCRIPT_WS) $(TARGET) $(ARGS_JSON) $(DATA_JSON) 113 | 114 | $(VIV_XSA): 115 | $(MAKE) -C $(VIV_DIR) xsa TARGET=$(TARGET) JOBS=$(JOBS) 116 | 117 | # -------------------------------------------------------------------- 118 | # Bootfile generation 119 | # - Ensures a workspace exists (creates it if missing) 120 | # - Calls the make-boot.py script 121 | # - Prints the likely output(s) 122 | # -------------------------------------------------------------------- 123 | .PHONY: bootfile 124 | bootfile: check_target 125 | @{ \ 126 | if [ ! -d "$(VIT_TARGET_WS)" ]; then \ 127 | echo "Workspace for $(TARGET) not found — creating it first..."; \ 128 | $(MAKE) --no-print-directory workspace TARGET=$(TARGET) || exit $$?; \ 129 | fi; \ 130 | echo "Generating bootfile for $(TARGET) ..."; \ 131 | vitis -source $(VIT_SCRIPT_BOOT) $(TARGET) $(ARGS_JSON) $(DATA_JSON) || exit $$?; \ 132 | echo ""; \ 133 | echo "Boot outputs are in: $(VIT_BOOT_TARG)"; \ 134 | if [ "$(call get_template_name,$(TARGET))" = "microblaze" ]; then \ 135 | echo " (MB) Possible files:"; \ 136 | echo " - $(VIT_BOOT_TARG)/$(BD_NAME)_boot.bit (combine_bit_elf=true)"; \ 137 | echo " - $(VIT_BOOT_TARG)/$(BD_NAME).bit (combine_bit_elf=false)"; \ 138 | else \ 139 | echo " (PS) Expected file:"; \ 140 | echo " - $(VIT_BOOT_TARG)/BOOT.BIN"; \ 141 | fi; \ 142 | } 143 | 144 | .PHONY: clean 145 | clean: check_target 146 | $(RM) $(TARGET)_workspace 147 | 148 | .PHONY: clean_all 149 | clean_all: 150 | @{ \ 151 | for targ in $(TARGET_LIST); do \ 152 | $(RM) $${targ}_workspace; \ 153 | done; \ 154 | $(RM) boot .Xil RemoteSystemsTempFiles; \ 155 | } 156 | 157 | check_target: 158 | ifndef $(TARGET)_target 159 | $(error "Please specify a TARGET. Use 'make help' to see valid targets.") 160 | endif 161 | 162 | 163 | -------------------------------------------------------------------------------- /Vitis/common/src/idt_8t49n24x.h: -------------------------------------------------------------------------------- 1 | /*****************************************************************************/ 2 | /** 3 | * 4 | * @file idt_8t49n24x.h 5 | * @addtogroup IDT_8T49N24x 6 | * @{ 7 | * 8 | *
  9 | * Copyright (c) 2016 Xilinx, Inc.
 10 | * Copyright (c) 2016 Adeas B.V. All rights reserved.
 11 | *
 12 | * MODIFICATION HISTORY:
 13 | *
 14 | * Ver   Who    Date     Changes
 15 | * ----- ------ -------- --------------------------------------------------
 16 | * X.XX  XX     YY/MM/DD
 17 | * 1.00  RHe    16/06/20 Initial release. A ported version from the
 18 | *                       8T49N28X-FrequencyProgrammingGuide-
 19 | *                       	register-calculations.py script
 20 | * 2.00  MG     16/08/15 Major update
 21 | * 2.10  MG     16/09/05 Added LOS variable
 22 | * 2.20  GM     18/02/08 Converted math.h functions (e.g. ceil) to
 23 | * 							standard functions
 24 | * 
25 | * 26 | ******************************************************************************/ 27 | 28 | #ifndef IDT_8T49N24X_H 29 | #define IDT_8T49N24X_H 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /***************************** Include Files *********************************/ 36 | #include "xil_types.h" 37 | 38 | /************************** Constant Definitions *****************************/ 39 | #define IDT_8T49N24X_REVID 0x0 //!< Device Revision 40 | #define IDT_8T49N24X_DEVID 0x0607 //!< Device ID Code 41 | 42 | #define IDT_8T49N24X_XTAL_FREQ 40000000 //!< The freq of the crystal in Hz 43 | 44 | #define IDT_8T49N24X_FVCO_MAX 4000000000 //!< Max VCO Operating Freq in Hz 45 | #define IDT_8T49N24X_FVCO_MIN 3000000000 //!< Min VCO Operating Freq in Hz 46 | 47 | #define IDT_8T49N24X_FOUT_MAX 400000000 //!< Max Output Freq in Hz 48 | #define IDT_8T49N24X_FOUT_MIN 8000 //!< Min Output Freq in Hz 49 | 50 | #define IDT_8T49N24X_FIN_MAX 875000000 //!< Max Input Freq in Hz 51 | #define IDT_8T49N24X_FIN_MIN 8000 //!< Min Input Freq in Hz 52 | 53 | //#define IDT_8T49N24X_FPD_MAX 8000000 //!< Max Phase Detector Freq in Hz 54 | #define IDT_8T49N24X_FPD_MAX 128000 //!< Max Phase Detector Freq in Hz 55 | #define IDT_8T49N24X_FPD_MIN 8000 //!< Min Phase Detector Freq in Hz 56 | 57 | #define IDT_8T49N24X_P_MAX 4194304 /* pow(2,22) */ //!< Max P div value 58 | #define IDT_8T49N24X_M_MAX 16777216 /* pow(2,24) */ //!< Max M mult value 59 | 60 | /* 61 | This configuration was created with the IDT timing commander. 62 | IT configures the clock device in synthesizer mode. 63 | It produces a 148.5 MHz free running clock on outputs Q2 and Q3. 64 | */ 65 | static const u8 IDT_8T49N24x_Config_Syn[] = { 66 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0x00, 0x03, 0x00, 0x31, 0x00, 67 | 0x04, 0x89, 0x00, 0x00, 0x01, 0x00, 0x63, 0xC6, 0x07, 0x00, 0x00, 0x77, 68 | 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 69 | 0x3F, 0x00, 0x28, 0x00, 0x1A, 0xCC, 0xCD, 0x00, 0x01, 0x00, 0x00, 0xD0, 70 | 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0C, 0x00, 0x00, 71 | 0x00, 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 72 | 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x0A, 0x2B, 0x20, 75 | 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 77 | }; 78 | 79 | /* 80 | This configuration was created with the IDT timing commander. 81 | It configures the clock device is Jitter Attenuator mode. 82 | It produces a 148.5 MHz clock on outputs Q2 and Q3 from an incoming 83 | 148.5 MHz clock. 84 | */ 85 | static const u8 IDT_8T49N24x_Config_JA[] = { 86 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0x00, 0x03, 0x00, 0x20, 0x00, 87 | 0x04, 0x89, 0x00, 0x00, 0x01, 0x00, 0x63, 0xC6, 0x07, 0x00, 0x00, 0x77, 88 | 0x6D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 89 | 0x3F, 0x00, 0x28, 0x00, 0x1A, 0xCC, 0xCD, 0x00, 0x01, 0x00, 0x00, 0xD0, 90 | 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x0C, 0x00, 0x00, 91 | 0x00, 0x44, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 92 | 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 94 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x02, 0x2B, 0x20, 95 | 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 96 | 0x00, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 97 | }; 98 | 99 | /**************************** Type Definitions *******************************/ 100 | 101 | typedef struct { 102 | // Integer Output Divider 103 | u8 NS1_Qx; 104 | u16 NS2_Qx; 105 | 106 | // Fractional Output Divider 107 | u32 N_Qx; 108 | u32 NFRAC_Qx; 109 | 110 | // Upper Loop Feedback Divider 111 | u16 DSM_INT; 112 | u32 DSM_FRAC; 113 | 114 | // Lower Loop Dividers 115 | u32 M1_x; 116 | u32 PRE_x; 117 | 118 | // Input monitor clocks 119 | u32 LOS_x; 120 | 121 | } IDT_8T49N24x_Settings; 122 | 123 | /***************** Macros (Inline Functions) Definitions *********************/ 124 | 125 | /************************** Function Prototypes ******************************/ 126 | 127 | int IDT_8T49N24x_Init(u32 I2CBaseAddress, u8 I2CSlaveAddress); 128 | int IDT_8T49N24x_SetClock(u32 I2CBaseAddress, u8 I2CSlaveAddress, int FIn, 129 | int FOut, u8 FreeRun); 130 | void IDT_8T49N24x_RegisterDump(u32 I2CBaseAddress, u8 I2CSlaveAddress); 131 | 132 | /************************** Variable Declarations ****************************/ 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | #endif /* IDT_8T49N24X_H */ 139 | /** @} */ 140 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102_hpc1/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi: -------------------------------------------------------------------------------- 1 | /include/ "system-conf.dtsi" 2 | / { 3 | dp_aclk: dp_aclk { 4 | compatible = "fixed-clock"; 5 | #clock-cells = <0>; 6 | clock-frequency = <100000000>; 7 | clock-accuracy = <100>; 8 | }; 9 | 10 | /* Repairing misc_clks as per Article number 000036480 */ 11 | /delete-node/ misc_clk_0; 12 | misc_clk_0: misc_clk_0 { 13 | #clock-cells = <0>; 14 | clock-frequency = <99999000>; 15 | compatible = "fixed-clock"; 16 | }; 17 | 18 | /delete-node/ misc_clk_1; 19 | misc_clk_1: misc_clk_1 { 20 | #clock-cells = <0>; 21 | clock-frequency = <249997500>; 22 | compatible = "fixed-clock"; 23 | }; 24 | 25 | /delete-node/ misc_clk_2; 26 | misc_clk_2: misc_clk_2 { 27 | #clock-cells = <0>; 28 | clock-frequency = <199998000>; 29 | compatible = "fixed-clock"; 30 | }; 31 | }; 32 | 33 | &zynqmp_dpsub { 34 | status = "okay"; 35 | clocks = <&dp_aclk>,<&zynqmp_clk DP_AUDIO_REF>,<&zynqmp_clk DP_VIDEO_REF>,<&display_pipeline_clk_wiz_0 0>; 36 | clock-names = "dp_apb_clk", "dp_aud_clk","dp_vtc_pixel_clk_in","dp_live_video_in_clk"; 37 | xlnx,bridge = <&display_pipeline_v_tc_0>; 38 | 39 | dp_port: port@0 { 40 | reg = <0>; 41 | dp_encoder: endpoint { 42 | remote-endpoint = <&mixer_crtcdisplay_pipeline_v_mix_0>; 43 | }; 44 | }; 45 | }; 46 | 47 | &amba_pl { 48 | imx219_clk: imx219_clk { 49 | #clock-cells = <0x0>; 50 | clock-frequency = <24000000>; 51 | compatible = "fixed-clock"; 52 | }; 53 | 54 | 55 | imx219_vana: fixedregulator@3 { 56 | compatible = "regulator-fixed"; 57 | regulator-name = "imx219_vana"; 58 | regulator-min-microvolt = <2800000>; 59 | regulator-max-microvolt = <2800000>; 60 | enable-active-high; 61 | }; 62 | 63 | imx219_vdig: fixedregulator@4 { 64 | compatible = "regulator-fixed"; 65 | regulator-name = "imx219_vdig"; 66 | regulator-min-microvolt = <1800000>; 67 | regulator-max-microvolt = <1800000>; 68 | }; 69 | 70 | imx219_vddl: fixedregulator@5 { 71 | compatible = "regulator-fixed"; 72 | regulator-name = "imx219_vddl"; 73 | regulator-min-microvolt = <1200000>; 74 | regulator-max-microvolt = <1200000>; 75 | }; 76 | 77 | /* zocl */ 78 | zyxclmm_drm { 79 | compatible = "xlnx,zocl"; 80 | status = "okay"; 81 | interrupt-parent = <&gic>; 82 | interrupts = <0 110 4>, <0 111 4>; 83 | }; 84 | }; 85 | 86 | &mipi_0_axi_iic_0 { 87 | imx219_cam0: sensor@10 { 88 | compatible = "sony,imx219"; 89 | reg = <0x10>; 90 | clocks = <&imx219_clk>; 91 | VANA-supply = <&imx219_vana>; /* 2.8v */ 92 | VDIG-supply = <&imx219_vdig>; /* 1.8v */ 93 | VDDL-supply = <&imx219_vddl>; /* 1.2v */ 94 | 95 | port { 96 | imx219_cam0_0: endpoint { 97 | remote-endpoint = <&mipi_csi_inmipi_0_mipi_csi2_rx_subsyst_0>; 98 | data-lanes = <1 2>; 99 | link-frequencies = /bits/ 64 <456000000>; 100 | }; 101 | }; 102 | }; 103 | }; 104 | 105 | &mipi_1_axi_iic_0 { 106 | imx219_cam1: sensor@10 { 107 | compatible = "sony,imx219"; 108 | reg = <0x10>; 109 | clocks = <&imx219_clk>; 110 | VANA-supply = <&imx219_vana>; /* 2.8v */ 111 | VDIG-supply = <&imx219_vdig>; /* 1.8v */ 112 | VDDL-supply = <&imx219_vddl>; /* 1.2v */ 113 | 114 | port { 115 | imx219_cam1_0: endpoint { 116 | remote-endpoint = <&mipi_csi_inmipi_1_mipi_csi2_rx_subsyst_0>; 117 | data-lanes = <1 2>; 118 | link-frequencies = /bits/ 64 <456000000>; 119 | }; 120 | }; 121 | }; 122 | }; 123 | 124 | &mipi_0_mipi_csi2_rx_subsyst_0 { 125 | xlnx,en-active-lanes; 126 | }; 127 | 128 | &mipi_1_mipi_csi2_rx_subsyst_0 { 129 | xlnx,en-active-lanes; 130 | }; 131 | 132 | &mipi_csi_inmipi_0_mipi_csi2_rx_subsyst_0 { 133 | remote-endpoint = <&imx219_cam0_0>; 134 | }; 135 | 136 | &mipi_csi_inmipi_1_mipi_csi2_rx_subsyst_0 { 137 | remote-endpoint = <&imx219_cam1_0>; 138 | }; 139 | 140 | &mipi_0_isppipeline { 141 | reset-gpios = <&gpio 86 1>; 142 | xlnx,max-height = /bits/ 16 <1232>; 143 | xlnx,max-width = /bits/ 16 <1920>; 144 | xlnx,rgain = /bits/ 16 <128>; 145 | xlnx,bgain = /bits/ 16 <210>; 146 | xlnx,pawb = /bits/ 16 <350>; 147 | xlnx,mode-reg = <1>; 148 | }; 149 | 150 | &isppipeline_port0mipi_0_isppipeline { 151 | xlnx,video-width = <10>; 152 | xlnx,cfa-pattern = "rggb"; 153 | }; 154 | 155 | &isppipeline_port1mipi_0_isppipeline { 156 | xlnx,video-width = <8>; 157 | xlnx,cfa-pattern = "rggb"; 158 | }; 159 | 160 | &mipi_1_isppipeline { 161 | reset-gpios = <&gpio 94 1>; 162 | xlnx,max-height = /bits/ 16 <1232>; 163 | xlnx,max-width = /bits/ 16 <1920>; 164 | xlnx,rgain = /bits/ 16 <128>; 165 | xlnx,bgain = /bits/ 16 <210>; 166 | xlnx,pawb = /bits/ 16 <350>; 167 | xlnx,mode-reg = <1>; 168 | }; 169 | 170 | &isppipeline_port0mipi_1_isppipeline { 171 | xlnx,video-width = <10>; 172 | xlnx,cfa-pattern = "rggb"; 173 | }; 174 | 175 | &isppipeline_port1mipi_1_isppipeline { 176 | xlnx,video-width = <8>; 177 | xlnx,cfa-pattern = "rggb"; 178 | }; 179 | 180 | &mipi_0_v_proc { 181 | compatible = "xlnx,v-vpss-scaler-2.2"; 182 | }; 183 | 184 | &mipi_1_v_proc { 185 | compatible = "xlnx,v-vpss-scaler-2.2"; 186 | }; 187 | 188 | &display_pipeline_clk_wiz_0 { 189 | #address-cells = <2>; 190 | }; 191 | 192 | &mixer_crtcdisplay_pipeline_v_mix_0 { 193 | remote-endpoint = <&dp_encoder>; 194 | }; 195 | 196 | &display_pipeline_v_mix_0 { 197 | xlnx,disp-bridge = <&zynqmp_dpsub>; 198 | }; 199 | 200 | &display_pipeline_v_tc_0 { 201 | compatible = "xlnx,bridge-v-tc-6.1"; 202 | xlnx,pixels-per-clock = <1>; 203 | }; 204 | 205 | &mipi_csi_port1mipi_0_mipi_csi2_rx_subsyst_0 { 206 | xlnx,cfa-pattern = "rggb"; 207 | xlnx,video-format = <12>; 208 | xlnx,video-width = <8>; 209 | }; 210 | 211 | &mipi_csi_port0mipi_0_mipi_csi2_rx_subsyst_0 { 212 | xlnx,cfa-pattern = "rggb"; 213 | xlnx,video-format = <12>; 214 | xlnx,video-width = <8>; 215 | }; 216 | 217 | &mipi_csi_port1mipi_1_mipi_csi2_rx_subsyst_0 { 218 | xlnx,cfa-pattern = "rggb"; 219 | xlnx,video-format = <12>; 220 | xlnx,video-width = <8>; 221 | }; 222 | 223 | &mipi_csi_port0mipi_1_mipi_csi2_rx_subsyst_0 { 224 | xlnx,cfa-pattern = "rggb"; 225 | xlnx,video-format = <12>; 226 | xlnx,video-width = <8>; 227 | }; 228 | 229 | -------------------------------------------------------------------------------- /docs/source/description.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | This reference design demonstrates the use of the [RPi Camera FMC] with 4x cameras and 1x DisplayPort monitor 4 | attached. The video streams coming from each camera pass through a video pipe composed of the 5 | [AMD Xilinx MIPI CSI Controller Subsystem IP] and other video processing IP. The cameras can be utilized 6 | through [GStreamer] in PetaLinux. 7 | 8 | ## Hardware Platforms 9 | 10 | The hardware designs provided in this reference are based on Vivado and support a range of MPSoC evaluation 11 | boards. The repository contains all necessary scripts and code to build these designs for the supported platforms listed below: 12 | 13 | {% for group in data.groups %} 14 | {% set designs_in_group = [] %} 15 | {% for design in data.designs %} 16 | {% if design.group == group.label and design.publish %} 17 | {% set _ = designs_in_group.append(design.label) %} 18 | {% endif %} 19 | {% endfor %} 20 | {% if designs_in_group | length > 0 %} 21 | ### {{ group.name }} platforms 22 | 23 | | Target board | FMC Slot Used | Cameras | VCU | 24 | |---------------------|---------------|---------|-----| 25 | {% for design in data.designs %}{% if design.group == group.label and design.publish %}| [{{ design.board }}]({{ design.link }}) | {{ design.connector }} | {{ design.cams | length }}x | {% if design.vcu %} ✅ {% else %} ❌ {% endif %} | 26 | {% endif %}{% endfor %} 27 | {% endif %} 28 | {% endfor %} 29 | 30 | ## Software 31 | 32 | These reference designs can be driven within a PetaLinux environment. 33 | The repository includes all necessary scripts and code to build the PetaLinux environment. The table 34 | below outlines the corresponding applications available in each environment: 35 | 36 | | Environment | Available Applications | 37 | |------------------|-------------------------| 38 | | PetaLinux | Built-in Linux commands
Additional tools: [GStreamer] | 39 | 40 | ## Architecture 41 | 42 | The hardware design for these projects is built in Vivado and is composed of IP that implement the 43 | MIPI interface with the cameras and VCU as well as a display pipeline. 44 | The main elements are: 45 | 46 | * 4x Raspberry Pi cameras each with an independent MIPI capture pipeline that writes to the DDR 47 | * Video Mixer based display pipeline that writes to the DisplayPort live interface of the ZynqMP 48 | * Video Codec Unit ([VCU]) 49 | 50 | The block diagram below illustrates the design from the top level. 51 | 52 | ![RPi Camera FMC design block diagram](images/rpi-camera-fmc-architecture.png) 53 | 54 | ### Capture pipeline 55 | 56 | There are four main capture/input pipelines in this design, one for each of the 4x Raspberry Pi cameras. 57 | The capture pipelines are composed of the following IP, implemented in the PL of the Zynq UltraScale+: 58 | 59 | * [MIPI CSI-2 Receiver Subsystem IP](https://docs.xilinx.com/r/en-US/pg232-mipi-csi2-rx) 60 | * [AXI4-Stream Data FIFO](https://docs.amd.com/r/en-US/pg085-axi4stream-infrastructure/AXI4-Stream-Data-FIFO) 61 | * [ISP Pipeline of the Vitis Libraries](https://github.com/Xilinx/Vitis_Libraries/tree/main/vision/L3/examples/isppipeline) 62 | * [Video Processing Subsystem IP](https://docs.xilinx.com/r/en-US/pg231-v-proc-ss) 63 | * [Frame Buffer Write IP](https://docs.xilinx.com/r/en-US/pg278-v-frmbuf) 64 | 65 | The MIPI CSI-2 RX IP is the front of the pipeline and receives image frames from the Raspberry Pi camera 66 | over the 2-lane MIPI interface. The MIPI IP generates an AXI-Streaming output of the frames in RAW10 format. The 67 | ISP Pipeline IP performs BPC (Bad Pixel Correction), gain control, demosaicing and auto white balance, to output 68 | the image frames in RGB888 format. The Video Processing Subsystem IP performs scaling and color space conversion 69 | (when needed). The Frame Buffer Write IP then writes the frame data to memory (DDR). The image below illustrates 70 | the MIPI pipeline. 71 | 72 | ![Video pipe sub-block diagram](images/rpi-camera-fmc-mipi-pipeline.png) 73 | 74 | ### Display pipeline 75 | 76 | The display pipeline reads frames from memory (DDR) and sends them to the monitor. To allow for four video streams to be 77 | displayed on a single monitor, the design uses the Video Mixer IP with four overlay inputs configured as memory mapped 78 | AXI4 interfaces. The Video Mixer IP can be thus configured to read four video streams from memory and send them to the 79 | monitor via the DisplayPort live input of the ZynqMP. The input layers of the Video Mixer IP are configured for YUY2 80 | (to this Video Mixer this is YUYV8). The output of the mixer is set to an AXI-Streaming video interface with YUV 422 81 | format, to satisfy the DisplayPort live interface. 82 | 83 | ![Display pipeline with video mixer](images/rpi-camera-fmc-display-pipeline.png) 84 | 85 | ### End-to-end pipeline 86 | 87 | The end-to-end pipeline shows an example of the flow of image frames through the entire system, from source to sink. 88 | In the diagram, the image resolutions and pixel formats are shown at each interface between the image processing 89 | blocks. The resolution and pixel format can be dynamically changed at the output of the RPi camera and the scaler 90 | (Video Processing Subsystem IP). 91 | 92 | ![End-to-end pipeline](images/rpi-camera-fmc-end-to-end.png) 93 | 94 | ### Video Codec Unit 95 | 96 | For some of the target boards, the Zynq UltraScale+ device contains a hardened Video Codec Unit (VCU) that can be used to 97 | perform video encoding and decoding of multiple video standards. On those target designs, we have included the VCU to 98 | enable these powerful features. Refer to the list of target designs to see which boards support this feature. 99 | 100 | 101 | [AMD Xilinx MIPI CSI Controller Subsystem IP]: https://docs.xilinx.com/r/en-US/pg202-mipi-dphy 102 | [RPi Camera FMC]: https://camerafmc.com/docs/rpi-camera-fmc/overview/ 103 | [GStreamer]: https://gstreamer.freedesktop.org/ 104 | [VCU]: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842546/Xilinx+Zynq+UltraScale+MPSoC+Video+Codec+Unit 105 | [G-Streamer plugins]: https://xilinx.github.io/VVAS/2.0/build/html/docs/common/common_plugins.html 106 | 107 | -------------------------------------------------------------------------------- /PetaLinux/bsp/uzev/project-spec/meta-user/recipes-apps/initcams/files/init_cams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Opsero Electronic Design Inc. 2024 4 | #----------------------------------- 5 | # This script goes through all of the media devices found and uses media-ctl 6 | # to filter out the devices that are not attached to the xilinx-video driver. 7 | # This way we attempt to target only the cameras that are connected to the 8 | # RPi Camera FMC, and ignore any USB (or other) cameras that are connected. 9 | # We also use media-ctl to determine the video device that is associated 10 | # with each media device, and we keep these values in an array. 11 | # The second part of the script goes through the array of media devices and 12 | # configures the associated video pipe with values for resolution, format 13 | # and frame rate, according to a set of variables defined at the top of this 14 | # script. 15 | # The last part of the script prints a list of the cameras that were found 16 | # and configured, showing the port (CAM0,CAM1,CAM2,CAM3), the media device 17 | # (eg. /dev/media0) and the video device (eg. /dev/video0) for each. 18 | 19 | # This dictionary associates GStreamer pixel formats with those used with media-ctl 20 | declare -A format_dict 21 | format_dict["NV12"]="VYYUYY8_1X24" 22 | format_dict["YUY2"]="UYVY8_1X16" 23 | 24 | #-------------------------------------------------------------------------------- 25 | # Example settings - the script will configure ALL video pipelines to these specs 26 | #-------------------------------------------------------------------------------- 27 | # Resolution of RPi cameras (must be a resolution supported by the IMX219 Linux driver 640x480, 1640x1232, 1920x1080) 28 | SRC_RES_W="${1:-1920}" 29 | SRC_RES_H="${2:-1080}" 30 | # Resolution of RPi camera pipelines (after Video Processing Subsystem IP) 31 | OUT_RES_W="${3:-1920}" 32 | OUT_RES_H="${4:-1080}" 33 | # Output format of the RPi camera pipelines (use a GStreamer pixel format from the dict above) 34 | OUT_FORMAT="${5:-YUY2}" 35 | #-------------------------------------------------------------------------------- 36 | # End of example settings 37 | #-------------------------------------------------------------------------------- 38 | 39 | # Find the vmixer 40 | VMIX_PATH=$(find /sys/bus/platform/devices/ -name "*.v_mix" | head -n 1) 41 | VMIX=$(basename "$VMIX_PATH") 42 | 43 | echo "-------------------------------------------------" 44 | echo " Capture pipeline init: RPi cam -> Scaler -> DDR" 45 | echo "-------------------------------------------------" 46 | 47 | # Print the settings 48 | echo "Configuring all video capture pipelines to:" 49 | echo " - RPi Camera output : $SRC_RES_W x $SRC_RES_H" 50 | echo " - Scaler (VPSS) output : $OUT_RES_W x $OUT_RES_H $OUT_FORMAT" 51 | 52 | # Print the bus_id of the video mixer 53 | echo "Video Mixer found here:" 54 | echo " - $VMIX" 55 | 56 | # Find all the media devices 57 | media_devices=($(ls /dev/media*)) 58 | 59 | # Declare a associative arrays 60 | declare -A unique_video_devices 61 | declare -A media_to_video_mapping 62 | declare -A media_to_cam_interface 63 | 64 | # For each media device, find its associated video devices 65 | for media in "${media_devices[@]}"; do 66 | output=$(media-ctl -d "$media" -p) 67 | # Check if the media device is of type "xilinx-video" 68 | if echo "$output" | grep -q "driver xilinx-video"; then 69 | video_device=$(echo "$output" | grep "dev/video") 70 | # Extract video device path from the grep result 71 | if [[ $video_device =~ (/dev/video[0-9]+) ]]; then 72 | unique_video_devices["${BASH_REMATCH[1]}"]=1 73 | # Store the media to video relationship 74 | media_to_video_mapping["$media"]="${BASH_REMATCH[1]}" 75 | 76 | # Extract X from the string "vcap_mipi_X_v_proc" 77 | if [[ $output =~ vcap_mipi_([0-9])_v_proc ]]; then 78 | cam_interface="CAM${BASH_REMATCH[1]}" 79 | media_to_cam_interface["$media"]="$cam_interface" 80 | fi 81 | fi 82 | fi 83 | done 84 | 85 | #------------------------------------------------------------------------------- 86 | # The section below serves as an example for configuring the video pipelines with 87 | # media-ctl. In this example, we set all video pipelines to the same specs. 88 | # See the documentation for help on these commands. 89 | # https://rpi.camerafmc.com/ (PetaLinux -> Debugging tips section) 90 | #------------------------------------------------------------------------------- 91 | for media in "${!media_to_video_mapping[@]}"; do 92 | OUTPUT=$(media-ctl -d $media -p) 93 | I2C_BUS=$(echo "$OUTPUT" | grep '.*- entity.*imx219' | awk -F' ' '{print $5}') 94 | media-ctl -V "\"imx219 ${I2C_BUS}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H}]" -d $media 95 | MIPI_CSI=$(echo "$OUTPUT" | grep '.*- entity.*mipi_csi2_rx_subsystem' | awk -F' ' '{print $4}') 96 | media-ctl -V "\"${MIPI_CSI}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 97 | media-ctl -V "\"${MIPI_CSI}\":1 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 98 | ISP_PIPE=$(echo "$OUTPUT" | grep '.*- entity.*ISPPipeline_accel' | awk -F' ' '{print $4}') 99 | media-ctl -V "\"${ISP_PIPE}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 100 | media-ctl -V "\"${ISP_PIPE}\":1 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 101 | V_PROC=$(echo "$OUTPUT" | grep '.*- entity.*.v_proc_ss ' | awk -F' ' '{print $4}') 102 | media-ctl -V "\"${V_PROC}\":0 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 103 | media-ctl -V "\"${V_PROC}\":1 [fmt:${format_dict[$OUT_FORMAT]}/${OUT_RES_W}x${OUT_RES_H} field:none colorspace:srgb]" -d $media 104 | done 105 | 106 | #------------------------------------------------------------------------------- 107 | # List the media devices and their associated video devices 108 | #------------------------------------------------------------------------------- 109 | echo "Detected and configured the following cameras on RPi Camera FMC:" 110 | for media in "${!media_to_video_mapping[@]}"; do 111 | echo " - ${media_to_cam_interface[$media]}: $media = ${media_to_video_mapping[$media]}" 112 | done 113 | -------------------------------------------------------------------------------- /PetaLinux/bsp/pynqzu/project-spec/meta-user/recipes-apps/initcams/files/init_cams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Opsero Electronic Design Inc. 2024 4 | #----------------------------------- 5 | # This script goes through all of the media devices found and uses media-ctl 6 | # to filter out the devices that are not attached to the xilinx-video driver. 7 | # This way we attempt to target only the cameras that are connected to the 8 | # RPi Camera FMC, and ignore any USB (or other) cameras that are connected. 9 | # We also use media-ctl to determine the video device that is associated 10 | # with each media device, and we keep these values in an array. 11 | # The second part of the script goes through the array of media devices and 12 | # configures the associated video pipe with values for resolution, format 13 | # and frame rate, according to a set of variables defined at the top of this 14 | # script. 15 | # The last part of the script prints a list of the cameras that were found 16 | # and configured, showing the port (CAM0,CAM1,CAM2,CAM3), the media device 17 | # (eg. /dev/media0) and the video device (eg. /dev/video0) for each. 18 | 19 | # This dictionary associates GStreamer pixel formats with those used with media-ctl 20 | declare -A format_dict 21 | format_dict["NV12"]="VYYUYY8_1X24" 22 | format_dict["YUY2"]="UYVY8_1X16" 23 | 24 | #-------------------------------------------------------------------------------- 25 | # Example settings - the script will configure ALL video pipelines to these specs 26 | #-------------------------------------------------------------------------------- 27 | # Resolution of RPi cameras (must be a resolution supported by the IMX219 Linux driver 640x480, 1640x1232, 1920x1080) 28 | SRC_RES_W="${1:-1920}" 29 | SRC_RES_H="${2:-1080}" 30 | # Resolution of RPi camera pipelines (after Video Processing Subsystem IP) 31 | OUT_RES_W="${3:-1920}" 32 | OUT_RES_H="${4:-1080}" 33 | # Output format of the RPi camera pipelines (use a GStreamer pixel format from the dict above) 34 | OUT_FORMAT="${5:-YUY2}" 35 | #-------------------------------------------------------------------------------- 36 | # End of example settings 37 | #-------------------------------------------------------------------------------- 38 | 39 | # Find the vmixer 40 | VMIX_PATH=$(find /sys/bus/platform/devices/ -name "*.v_mix" | head -n 1) 41 | VMIX=$(basename "$VMIX_PATH") 42 | 43 | echo "-------------------------------------------------" 44 | echo " Capture pipeline init: RPi cam -> Scaler -> DDR" 45 | echo "-------------------------------------------------" 46 | 47 | # Print the settings 48 | echo "Configuring all video capture pipelines to:" 49 | echo " - RPi Camera output : $SRC_RES_W x $SRC_RES_H" 50 | echo " - Scaler (VPSS) output : $OUT_RES_W x $OUT_RES_H $OUT_FORMAT" 51 | 52 | # Print the bus_id of the video mixer 53 | echo "Video Mixer found here:" 54 | echo " - $VMIX" 55 | 56 | # Find all the media devices 57 | media_devices=($(ls /dev/media*)) 58 | 59 | # Declare a associative arrays 60 | declare -A unique_video_devices 61 | declare -A media_to_video_mapping 62 | declare -A media_to_cam_interface 63 | 64 | # For each media device, find its associated video devices 65 | for media in "${media_devices[@]}"; do 66 | output=$(media-ctl -d "$media" -p) 67 | # Check if the media device is of type "xilinx-video" 68 | if echo "$output" | grep -q "driver xilinx-video"; then 69 | video_device=$(echo "$output" | grep "dev/video") 70 | # Extract video device path from the grep result 71 | if [[ $video_device =~ (/dev/video[0-9]+) ]]; then 72 | unique_video_devices["${BASH_REMATCH[1]}"]=1 73 | # Store the media to video relationship 74 | media_to_video_mapping["$media"]="${BASH_REMATCH[1]}" 75 | 76 | # Extract X from the string "vcap_mipi_X_v_proc" 77 | if [[ $output =~ vcap_mipi_([0-9])_v_proc ]]; then 78 | cam_interface="CAM${BASH_REMATCH[1]}" 79 | media_to_cam_interface["$media"]="$cam_interface" 80 | fi 81 | fi 82 | fi 83 | done 84 | 85 | #------------------------------------------------------------------------------- 86 | # The section below serves as an example for configuring the video pipelines with 87 | # media-ctl. In this example, we set all video pipelines to the same specs. 88 | # See the documentation for help on these commands. 89 | # https://rpi.camerafmc.com/ (PetaLinux -> Debugging tips section) 90 | #------------------------------------------------------------------------------- 91 | for media in "${!media_to_video_mapping[@]}"; do 92 | OUTPUT=$(media-ctl -d $media -p) 93 | I2C_BUS=$(echo "$OUTPUT" | grep '.*- entity.*imx219' | awk -F' ' '{print $5}') 94 | media-ctl -V "\"imx219 ${I2C_BUS}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H}]" -d $media 95 | MIPI_CSI=$(echo "$OUTPUT" | grep '.*- entity.*mipi_csi2_rx_subsystem' | awk -F' ' '{print $4}') 96 | media-ctl -V "\"${MIPI_CSI}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 97 | media-ctl -V "\"${MIPI_CSI}\":1 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 98 | ISP_PIPE=$(echo "$OUTPUT" | grep '.*- entity.*ISPPipeline_accel' | awk -F' ' '{print $4}') 99 | media-ctl -V "\"${ISP_PIPE}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 100 | media-ctl -V "\"${ISP_PIPE}\":1 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 101 | V_PROC=$(echo "$OUTPUT" | grep '.*- entity.*.v_proc_ss ' | awk -F' ' '{print $4}') 102 | media-ctl -V "\"${V_PROC}\":0 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 103 | media-ctl -V "\"${V_PROC}\":1 [fmt:${format_dict[$OUT_FORMAT]}/${OUT_RES_W}x${OUT_RES_H} field:none colorspace:srgb]" -d $media 104 | done 105 | 106 | #------------------------------------------------------------------------------- 107 | # List the media devices and their associated video devices 108 | #------------------------------------------------------------------------------- 109 | echo "Detected and configured the following cameras on RPi Camera FMC:" 110 | for media in "${!media_to_video_mapping[@]}"; do 111 | echo " - ${media_to_cam_interface[$media]}: $media = ${media_to_video_mapping[$media]}" 112 | done 113 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu102/project-spec/meta-user/recipes-apps/initcams/files/init_cams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Opsero Electronic Design Inc. 2024 4 | #----------------------------------- 5 | # This script goes through all of the media devices found and uses media-ctl 6 | # to filter out the devices that are not attached to the xilinx-video driver. 7 | # This way we attempt to target only the cameras that are connected to the 8 | # RPi Camera FMC, and ignore any USB (or other) cameras that are connected. 9 | # We also use media-ctl to determine the video device that is associated 10 | # with each media device, and we keep these values in an array. 11 | # The second part of the script goes through the array of media devices and 12 | # configures the associated video pipe with values for resolution, format 13 | # and frame rate, according to a set of variables defined at the top of this 14 | # script. 15 | # The last part of the script prints a list of the cameras that were found 16 | # and configured, showing the port (CAM0,CAM1,CAM2,CAM3), the media device 17 | # (eg. /dev/media0) and the video device (eg. /dev/video0) for each. 18 | 19 | # This dictionary associates GStreamer pixel formats with those used with media-ctl 20 | declare -A format_dict 21 | format_dict["NV12"]="VYYUYY8_1X24" 22 | format_dict["YUY2"]="UYVY8_1X16" 23 | 24 | #-------------------------------------------------------------------------------- 25 | # Example settings - the script will configure ALL video pipelines to these specs 26 | #-------------------------------------------------------------------------------- 27 | # Resolution of RPi cameras (must be a resolution supported by the IMX219 Linux driver 640x480, 1640x1232, 1920x1080) 28 | SRC_RES_W="${1:-1920}" 29 | SRC_RES_H="${2:-1080}" 30 | # Resolution of RPi camera pipelines (after Video Processing Subsystem IP) 31 | OUT_RES_W="${3:-1920}" 32 | OUT_RES_H="${4:-1080}" 33 | # Output format of the RPi camera pipelines (use a GStreamer pixel format from the dict above) 34 | OUT_FORMAT="${5:-YUY2}" 35 | #-------------------------------------------------------------------------------- 36 | # End of example settings 37 | #-------------------------------------------------------------------------------- 38 | 39 | # Find the vmixer 40 | VMIX_PATH=$(find /sys/bus/platform/devices/ -name "*.v_mix" | head -n 1) 41 | VMIX=$(basename "$VMIX_PATH") 42 | 43 | echo "-------------------------------------------------" 44 | echo " Capture pipeline init: RPi cam -> Scaler -> DDR" 45 | echo "-------------------------------------------------" 46 | 47 | # Print the settings 48 | echo "Configuring all video capture pipelines to:" 49 | echo " - RPi Camera output : $SRC_RES_W x $SRC_RES_H" 50 | echo " - Scaler (VPSS) output : $OUT_RES_W x $OUT_RES_H $OUT_FORMAT" 51 | 52 | # Print the bus_id of the video mixer 53 | echo "Video Mixer found here:" 54 | echo " - $VMIX" 55 | 56 | # Find all the media devices 57 | media_devices=($(ls /dev/media*)) 58 | 59 | # Declare a associative arrays 60 | declare -A unique_video_devices 61 | declare -A media_to_video_mapping 62 | declare -A media_to_cam_interface 63 | 64 | # For each media device, find its associated video devices 65 | for media in "${media_devices[@]}"; do 66 | output=$(media-ctl -d "$media" -p) 67 | # Check if the media device is of type "xilinx-video" 68 | if echo "$output" | grep -q "driver xilinx-video"; then 69 | video_device=$(echo "$output" | grep "dev/video") 70 | # Extract video device path from the grep result 71 | if [[ $video_device =~ (/dev/video[0-9]+) ]]; then 72 | unique_video_devices["${BASH_REMATCH[1]}"]=1 73 | # Store the media to video relationship 74 | media_to_video_mapping["$media"]="${BASH_REMATCH[1]}" 75 | 76 | # Extract X from the string "vcap_mipi_X_v_proc" 77 | if [[ $output =~ vcap_mipi_([0-9])_v_proc ]]; then 78 | cam_interface="CAM${BASH_REMATCH[1]}" 79 | media_to_cam_interface["$media"]="$cam_interface" 80 | fi 81 | fi 82 | fi 83 | done 84 | 85 | #------------------------------------------------------------------------------- 86 | # The section below serves as an example for configuring the video pipelines with 87 | # media-ctl. In this example, we set all video pipelines to the same specs. 88 | # See the documentation for help on these commands. 89 | # https://rpi.camerafmc.com/ (PetaLinux -> Debugging tips section) 90 | #------------------------------------------------------------------------------- 91 | for media in "${!media_to_video_mapping[@]}"; do 92 | OUTPUT=$(media-ctl -d $media -p) 93 | I2C_BUS=$(echo "$OUTPUT" | grep '.*- entity.*imx219' | awk -F' ' '{print $5}') 94 | media-ctl -V "\"imx219 ${I2C_BUS}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H}]" -d $media 95 | MIPI_CSI=$(echo "$OUTPUT" | grep '.*- entity.*mipi_csi2_rx_subsystem' | awk -F' ' '{print $4}') 96 | media-ctl -V "\"${MIPI_CSI}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 97 | media-ctl -V "\"${MIPI_CSI}\":1 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 98 | ISP_PIPE=$(echo "$OUTPUT" | grep '.*- entity.*ISPPipeline_accel' | awk -F' ' '{print $4}') 99 | media-ctl -V "\"${ISP_PIPE}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 100 | media-ctl -V "\"${ISP_PIPE}\":1 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 101 | V_PROC=$(echo "$OUTPUT" | grep '.*- entity.*.v_proc_ss ' | awk -F' ' '{print $4}') 102 | media-ctl -V "\"${V_PROC}\":0 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 103 | media-ctl -V "\"${V_PROC}\":1 [fmt:${format_dict[$OUT_FORMAT]}/${OUT_RES_W}x${OUT_RES_H} field:none colorspace:srgb]" -d $media 104 | done 105 | 106 | #------------------------------------------------------------------------------- 107 | # List the media devices and their associated video devices 108 | #------------------------------------------------------------------------------- 109 | echo "Detected and configured the following cameras on RPi Camera FMC:" 110 | for media in "${!media_to_video_mapping[@]}"; do 111 | echo " - ${media_to_cam_interface[$media]}: $media = ${media_to_video_mapping[$media]}" 112 | done 113 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu104/project-spec/meta-user/recipes-apps/initcams/files/init_cams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Opsero Electronic Design Inc. 2024 4 | #----------------------------------- 5 | # This script goes through all of the media devices found and uses media-ctl 6 | # to filter out the devices that are not attached to the xilinx-video driver. 7 | # This way we attempt to target only the cameras that are connected to the 8 | # RPi Camera FMC, and ignore any USB (or other) cameras that are connected. 9 | # We also use media-ctl to determine the video device that is associated 10 | # with each media device, and we keep these values in an array. 11 | # The second part of the script goes through the array of media devices and 12 | # configures the associated video pipe with values for resolution, format 13 | # and frame rate, according to a set of variables defined at the top of this 14 | # script. 15 | # The last part of the script prints a list of the cameras that were found 16 | # and configured, showing the port (CAM0,CAM1,CAM2,CAM3), the media device 17 | # (eg. /dev/media0) and the video device (eg. /dev/video0) for each. 18 | 19 | # This dictionary associates GStreamer pixel formats with those used with media-ctl 20 | declare -A format_dict 21 | format_dict["NV12"]="VYYUYY8_1X24" 22 | format_dict["YUY2"]="UYVY8_1X16" 23 | 24 | #-------------------------------------------------------------------------------- 25 | # Example settings - the script will configure ALL video pipelines to these specs 26 | #-------------------------------------------------------------------------------- 27 | # Resolution of RPi cameras (must be a resolution supported by the IMX219 Linux driver 640x480, 1640x1232, 1920x1080) 28 | SRC_RES_W="${1:-1920}" 29 | SRC_RES_H="${2:-1080}" 30 | # Resolution of RPi camera pipelines (after Video Processing Subsystem IP) 31 | OUT_RES_W="${3:-1920}" 32 | OUT_RES_H="${4:-1080}" 33 | # Output format of the RPi camera pipelines (use a GStreamer pixel format from the dict above) 34 | OUT_FORMAT="${5:-YUY2}" 35 | #-------------------------------------------------------------------------------- 36 | # End of example settings 37 | #-------------------------------------------------------------------------------- 38 | 39 | # Find the vmixer 40 | VMIX_PATH=$(find /sys/bus/platform/devices/ -name "*.v_mix" | head -n 1) 41 | VMIX=$(basename "$VMIX_PATH") 42 | 43 | echo "-------------------------------------------------" 44 | echo " Capture pipeline init: RPi cam -> Scaler -> DDR" 45 | echo "-------------------------------------------------" 46 | 47 | # Print the settings 48 | echo "Configuring all video capture pipelines to:" 49 | echo " - RPi Camera output : $SRC_RES_W x $SRC_RES_H" 50 | echo " - Scaler (VPSS) output : $OUT_RES_W x $OUT_RES_H $OUT_FORMAT" 51 | 52 | # Print the bus_id of the video mixer 53 | echo "Video Mixer found here:" 54 | echo " - $VMIX" 55 | 56 | # Find all the media devices 57 | media_devices=($(ls /dev/media*)) 58 | 59 | # Declare a associative arrays 60 | declare -A unique_video_devices 61 | declare -A media_to_video_mapping 62 | declare -A media_to_cam_interface 63 | 64 | # For each media device, find its associated video devices 65 | for media in "${media_devices[@]}"; do 66 | output=$(media-ctl -d "$media" -p) 67 | # Check if the media device is of type "xilinx-video" 68 | if echo "$output" | grep -q "driver xilinx-video"; then 69 | video_device=$(echo "$output" | grep "dev/video") 70 | # Extract video device path from the grep result 71 | if [[ $video_device =~ (/dev/video[0-9]+) ]]; then 72 | unique_video_devices["${BASH_REMATCH[1]}"]=1 73 | # Store the media to video relationship 74 | media_to_video_mapping["$media"]="${BASH_REMATCH[1]}" 75 | 76 | # Extract X from the string "vcap_mipi_X_v_proc" 77 | if [[ $output =~ vcap_mipi_([0-9])_v_proc ]]; then 78 | cam_interface="CAM${BASH_REMATCH[1]}" 79 | media_to_cam_interface["$media"]="$cam_interface" 80 | fi 81 | fi 82 | fi 83 | done 84 | 85 | #------------------------------------------------------------------------------- 86 | # The section below serves as an example for configuring the video pipelines with 87 | # media-ctl. In this example, we set all video pipelines to the same specs. 88 | # See the documentation for help on these commands. 89 | # https://rpi.camerafmc.com/ (PetaLinux -> Debugging tips section) 90 | #------------------------------------------------------------------------------- 91 | for media in "${!media_to_video_mapping[@]}"; do 92 | OUTPUT=$(media-ctl -d $media -p) 93 | I2C_BUS=$(echo "$OUTPUT" | grep '.*- entity.*imx219' | awk -F' ' '{print $5}') 94 | media-ctl -V "\"imx219 ${I2C_BUS}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H}]" -d $media 95 | MIPI_CSI=$(echo "$OUTPUT" | grep '.*- entity.*mipi_csi2_rx_subsystem' | awk -F' ' '{print $4}') 96 | media-ctl -V "\"${MIPI_CSI}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 97 | media-ctl -V "\"${MIPI_CSI}\":1 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 98 | ISP_PIPE=$(echo "$OUTPUT" | grep '.*- entity.*ISPPipeline_accel' | awk -F' ' '{print $4}') 99 | media-ctl -V "\"${ISP_PIPE}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 100 | media-ctl -V "\"${ISP_PIPE}\":1 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 101 | V_PROC=$(echo "$OUTPUT" | grep '.*- entity.*.v_proc_ss ' | awk -F' ' '{print $4}') 102 | media-ctl -V "\"${V_PROC}\":0 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 103 | media-ctl -V "\"${V_PROC}\":1 [fmt:${format_dict[$OUT_FORMAT]}/${OUT_RES_W}x${OUT_RES_H} field:none colorspace:srgb]" -d $media 104 | done 105 | 106 | #------------------------------------------------------------------------------- 107 | # List the media devices and their associated video devices 108 | #------------------------------------------------------------------------------- 109 | echo "Detected and configured the following cameras on RPi Camera FMC:" 110 | for media in "${!media_to_video_mapping[@]}"; do 111 | echo " - ${media_to_cam_interface[$media]}: $media = ${media_to_video_mapping[$media]}" 112 | done 113 | -------------------------------------------------------------------------------- /PetaLinux/bsp/zcu106/project-spec/meta-user/recipes-apps/initcams/files/init_cams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Opsero Electronic Design Inc. 2024 4 | #----------------------------------- 5 | # This script goes through all of the media devices found and uses media-ctl 6 | # to filter out the devices that are not attached to the xilinx-video driver. 7 | # This way we attempt to target only the cameras that are connected to the 8 | # RPi Camera FMC, and ignore any USB (or other) cameras that are connected. 9 | # We also use media-ctl to determine the video device that is associated 10 | # with each media device, and we keep these values in an array. 11 | # The second part of the script goes through the array of media devices and 12 | # configures the associated video pipe with values for resolution, format 13 | # and frame rate, according to a set of variables defined at the top of this 14 | # script. 15 | # The last part of the script prints a list of the cameras that were found 16 | # and configured, showing the port (CAM0,CAM1,CAM2,CAM3), the media device 17 | # (eg. /dev/media0) and the video device (eg. /dev/video0) for each. 18 | 19 | # This dictionary associates GStreamer pixel formats with those used with media-ctl 20 | declare -A format_dict 21 | format_dict["NV12"]="VYYUYY8_1X24" 22 | format_dict["YUY2"]="UYVY8_1X16" 23 | 24 | #-------------------------------------------------------------------------------- 25 | # Example settings - the script will configure ALL video pipelines to these specs 26 | #-------------------------------------------------------------------------------- 27 | # Resolution of RPi cameras (must be a resolution supported by the IMX219 Linux driver 640x480, 1640x1232, 1920x1080) 28 | SRC_RES_W="${1:-1920}" 29 | SRC_RES_H="${2:-1080}" 30 | # Resolution of RPi camera pipelines (after Video Processing Subsystem IP) 31 | OUT_RES_W="${3:-1920}" 32 | OUT_RES_H="${4:-1080}" 33 | # Output format of the RPi camera pipelines (use a GStreamer pixel format from the dict above) 34 | OUT_FORMAT="${5:-YUY2}" 35 | #-------------------------------------------------------------------------------- 36 | # End of example settings 37 | #-------------------------------------------------------------------------------- 38 | 39 | # Find the vmixer 40 | VMIX_PATH=$(find /sys/bus/platform/devices/ -name "*.v_mix" | head -n 1) 41 | VMIX=$(basename "$VMIX_PATH") 42 | 43 | echo "-------------------------------------------------" 44 | echo " Capture pipeline init: RPi cam -> Scaler -> DDR" 45 | echo "-------------------------------------------------" 46 | 47 | # Print the settings 48 | echo "Configuring all video capture pipelines to:" 49 | echo " - RPi Camera output : $SRC_RES_W x $SRC_RES_H" 50 | echo " - Scaler (VPSS) output : $OUT_RES_W x $OUT_RES_H $OUT_FORMAT" 51 | 52 | # Print the bus_id of the video mixer 53 | echo "Video Mixer found here:" 54 | echo " - $VMIX" 55 | 56 | # Find all the media devices 57 | media_devices=($(ls /dev/media*)) 58 | 59 | # Declare a associative arrays 60 | declare -A unique_video_devices 61 | declare -A media_to_video_mapping 62 | declare -A media_to_cam_interface 63 | 64 | # For each media device, find its associated video devices 65 | for media in "${media_devices[@]}"; do 66 | output=$(media-ctl -d "$media" -p) 67 | # Check if the media device is of type "xilinx-video" 68 | if echo "$output" | grep -q "driver xilinx-video"; then 69 | video_device=$(echo "$output" | grep "dev/video") 70 | # Extract video device path from the grep result 71 | if [[ $video_device =~ (/dev/video[0-9]+) ]]; then 72 | unique_video_devices["${BASH_REMATCH[1]}"]=1 73 | # Store the media to video relationship 74 | media_to_video_mapping["$media"]="${BASH_REMATCH[1]}" 75 | 76 | # Extract X from the string "vcap_mipi_X_v_proc" 77 | if [[ $output =~ vcap_mipi_([0-9])_v_proc ]]; then 78 | cam_interface="CAM${BASH_REMATCH[1]}" 79 | media_to_cam_interface["$media"]="$cam_interface" 80 | fi 81 | fi 82 | fi 83 | done 84 | 85 | #------------------------------------------------------------------------------- 86 | # The section below serves as an example for configuring the video pipelines with 87 | # media-ctl. In this example, we set all video pipelines to the same specs. 88 | # See the documentation for help on these commands. 89 | # https://rpi.camerafmc.com/ (PetaLinux -> Debugging tips section) 90 | #------------------------------------------------------------------------------- 91 | for media in "${!media_to_video_mapping[@]}"; do 92 | OUTPUT=$(media-ctl -d $media -p) 93 | I2C_BUS=$(echo "$OUTPUT" | grep '.*- entity.*imx219' | awk -F' ' '{print $5}') 94 | media-ctl -V "\"imx219 ${I2C_BUS}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H}]" -d $media 95 | MIPI_CSI=$(echo "$OUTPUT" | grep '.*- entity.*mipi_csi2_rx_subsystem' | awk -F' ' '{print $4}') 96 | media-ctl -V "\"${MIPI_CSI}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 97 | media-ctl -V "\"${MIPI_CSI}\":1 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 98 | ISP_PIPE=$(echo "$OUTPUT" | grep '.*- entity.*ISPPipeline_accel' | awk -F' ' '{print $4}') 99 | media-ctl -V "\"${ISP_PIPE}\":0 [fmt:SRGGB10_1X10/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 100 | media-ctl -V "\"${ISP_PIPE}\":1 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 101 | V_PROC=$(echo "$OUTPUT" | grep '.*- entity.*.v_proc_ss ' | awk -F' ' '{print $4}') 102 | media-ctl -V "\"${V_PROC}\":0 [fmt:RBG888_1X24/${SRC_RES_W}x${SRC_RES_H} field:none colorspace:srgb]" -d $media 103 | media-ctl -V "\"${V_PROC}\":1 [fmt:${format_dict[$OUT_FORMAT]}/${OUT_RES_W}x${OUT_RES_H} field:none colorspace:srgb]" -d $media 104 | done 105 | 106 | #------------------------------------------------------------------------------- 107 | # List the media devices and their associated video devices 108 | #------------------------------------------------------------------------------- 109 | echo "Detected and configured the following cameras on RPi Camera FMC:" 110 | for media in "${!media_to_video_mapping[@]}"; do 111 | echo " - ${media_to_cam_interface[$media]}: $media = ${media_to_video_mapping[$media]}" 112 | done 113 | -------------------------------------------------------------------------------- /Vitis/common/src/xhdmi_edid.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Copyright (C) 2014 - 2020 Xilinx, Inc. All rights reserved. 3 | * SPDX-License-Identifier: MIT 4 | ******************************************************************************/ 5 | 6 | /*****************************************************************************/ 7 | /** 8 | * 9 | * @file xhdmi_edid.h 10 | * 11 | * This file contains set of EDID demonstrates different capability 12 | * 13 | *
 14 | * MODIFICATION HISTORY:
 15 | *
 16 | * Ver   Who    Date     Changes
 17 | * ----- ------ -------- --------------------------------------------------
 18 | * 1.00         12/02/18 Initial release.
 19 | * 1.01  EB     05/04/18 Updated EDID
 20 | * 
21 | * 22 | ******************************************************************************/ 23 | #ifndef _XHDMI_EDID_H_ 24 | /** prevent circular inclusions by using protection macros */ 25 | #define _XHDMI_EDID_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /***************************** Include Files *********************************/ 32 | #include "xparameters.h" 33 | #include "xvidc_edid_ext.h" 34 | #ifdef XPAR_XV_HDMIRXSS_NUM_INSTANCES 35 | #include "xv_hdmirxss.h" 36 | #endif 37 | #ifdef XPAR_XV_HDMITXSS_NUM_INSTANCES 38 | #include "xv_hdmitxss.h" 39 | #endif 40 | 41 | /************************** Constant Definitions *****************************/ 42 | #ifdef XPAR_XV_HDMITXSS_NUM_INSTANCES 43 | /*Magic Number: Maximum Number of Retries for EDID Read*/ 44 | #define READEDIDRETRY 5 45 | /*Magic Number: Maximum Number of Retries for SCDC Read*/ 46 | #define READSCDCRETRY 5 47 | /*Magic Number: Maximum Number of Retries for EDID Read Interval*/ 48 | #define READINTERVAL 25000 49 | 50 | /** 51 | * These constants specify the flags of warning msg 52 | */ 53 | #define XV_HDMI_SINK_NO_WARNINGS 0x00 54 | #define XV_HDMI_SINK_EDID_SCDC_MISMATCH 0x01 55 | /* Sink's EDID indicates supported TMDS more than 340Mbps 56 | * and the HF-VSDB HDMI 2.0 is available but the 57 | * RR_Capable/Read Ready is not asserted */ 58 | #define XV_HDMI_SINK_EDID_20_VSDB20_NA_SCDC_PASS 0x02 59 | /* Sink's EDID indicates supported TMDS more than 340Mbps 60 | * and the HF-VSDB HDMI 2.0 is not available but the SCDC 61 | * is accessible*/ 62 | #define XV_HDMI_SINK_EDID_20_VSDB20_ACC_SCDC_FAIL 0x04 63 | /* Sink's EDID indicates supported TMDS more than 340Mbps 64 | * and the HF-VSDB HDMI 2.0 is available but the SCDC 65 | * is not accessible*/ 66 | #define XV_HDMI_SINK_EDID_14_SCDC_PASS 0x08 67 | /* Sink's EDID indicates supported TMDS less than 340Mbps 68 | * (HDMI 1.4) but the SCDC Register is accessible*/ 69 | #define XV_HDMI_SINK_20_NOT_CAPABLE 0x10 70 | /*Sink not HDMI 2.0 Capable */ 71 | #define XV_HDMI_SINK_DEEP_COLOR_10_NOT_SUPP 0x20 72 | /*Deep Color 10bpc is not supported */ 73 | #define XV_HDMI_SINK_DEEP_COLOR_12_NOT_SUPP 0x40 74 | /*Deep Color 12bpc is not supported */ 75 | #define XV_HDMI_SINK_DEEP_COLOR_16_NOT_SUPP 0x80 76 | /*Deep Color 16bpc is not supported */ 77 | #define XV_SINK_NOT_HDMI 0x100 78 | /*Sink is not HDMI */ 79 | 80 | /*EDID Parsing Data Structure (Application)*/ 81 | typedef struct { 82 | XV_VidC_EdidCntrlParam EdidCtrlParam; 83 | /*Control Parameter from the EDID Driver*/ 84 | 85 | u32 HdmiSinkWarningFlag; 86 | /*Hdmi Sink Warning Flag*/ 87 | 88 | /*Scratch Pad */ 89 | u8 EdidCableConnectRead; 90 | /* Flag indicate EDID Read during cable 91 | * connect 92 | */ 93 | u8 IsReReadSinkEdid; 94 | /*Status Flag for Re-Read EDID*/ 95 | u8 IsReReadSCDC; 96 | /*Status Flag for Re-Read SCDC*/ 97 | u8 IsHDMI20SinkCapable; 98 | /*Status Flag for HDMI 2.0 Capable*/ 99 | u32 SinkCheckRetryCount; 100 | /*Counter for Re-Read EDID Interval 101 | * (Magic Number)*/ 102 | u8 IsReReadSinkEdidRetry; 103 | /*Counter for Flag for Re-Read EDID Retry*/ 104 | u8 IsReReadScdcRetry; 105 | /*Counter for Re-Read SCDC of Sink Retry 106 | * (Non-EDID related)*/ 107 | } EdidHdmi20; 108 | 109 | extern EdidHdmi20 EdidHdmi20_t; 110 | #endif 111 | #ifdef XPAR_XV_HDMIRXSS_NUM_INSTANCES 112 | /* 113 | EDID 114 | */ 115 | /*EDID for 2018.1*/ 116 | static const u8 Edid[] = { 117 | 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x61, 0x98, 0x34, 0x12, 0x78, 0x56, 0x34, 0x12, 118 | 0x0E, 0x1C, 0x01, 0x03, 0x80, 0xA0, 0x5A, 0x78, 0x0A, 0xEE, 0x91, 0xA3, 0x54, 0x4C, 0x99, 0x26, 119 | 0x0F, 0x50, 0x54, 0x21, 0x08, 0x00, 0x71, 0x4F, 0x81, 0xC0, 0x81, 0x00, 0x81, 0x80, 0x95, 0x00, 120 | 0xA9, 0xC0, 0xB3, 0x00, 0x01, 0x01, 0x08, 0xE8, 0x00, 0x30, 0xF2, 0x70, 0x5A, 0x80, 0xB0, 0x58, 121 | 0x8A, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1E, 0x02, 0x3A, 0x80, 0x18, 0x71, 0x38, 0x2D, 0x40, 122 | 0x58, 0x2C, 0x45, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x18, 123 | 0x4B, 0x0F, 0x8C, 0x3C, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFC, 124 | 0x00, 0x58, 0x49, 0x4C, 0x49, 0x4E, 0x58, 0x20, 0x48, 0x44, 0x4D, 0x49, 0x0A, 0x20, 0x01, 0x85, 125 | 126 | 0x02, 0x03, 0x3B, 0xF1, 0x57, 0x61, 0x10, 0x1F, 0x04, 0x13, 0x05, 0x14, 0x20, 0x21, 0x22, 0x5D, 127 | 0x5E, 0x5F, 0x60, 0x65, 0x66, 0x62, 0x63, 0x64, 0x07, 0x16, 0x03, 0x12, 0x23, 0x09, 0x07, 0x07, 128 | 0x6B, 0x03, 0x0C, 0x00, 0x10, 0x00, 0x78, 0x3C, 0x20, 0x00, 0x20, 0x03, 0x67, 0xD8, 0x5D, 0xC4, 129 | 0x01, 0x78, 0x80, 0x07, 0xE3, 0x0F, 0x01, 0xE0, 0xE2, 0x00, 0xCF, 0x02, 0x3A, 0x80, 0x18, 0x71, 130 | 0x38, 0x2D, 0x40, 0x58, 0x2C, 0x45, 0x00, 0x20, 0xC2, 0x31, 0x00, 0x00, 0x1E, 0x08, 0xE8, 0x00, 131 | 0x30, 0xF2, 0x70, 0x5A, 0x80, 0xB0, 0x58, 0x8A, 0x00, 0x20, 0xC2, 0x31, 0x00, 0x00, 0x1E, 0x04, 132 | 0x74, 0x00, 0x30, 0xF2, 0x70, 0x5A, 0x80, 0xB0, 0x58, 0x8A, 0x00, 0x20, 0x52, 0x31, 0x00, 0x00, 133 | 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC 134 | }; 135 | #endif 136 | /***************** Macros (Inline Functions) Definitions ********************/ 137 | 138 | /************************** Function Prototypes *****************************/ 139 | #ifdef XPAR_XV_HDMITXSS_NUM_INSTANCES 140 | void EdidScdcCheck(XV_HdmiTxSs *HdmiTxSsPtr, 141 | EdidHdmi20 *CheckHdmi20Param); 142 | 143 | u8 SinkReadyCheck (XV_HdmiTxSs *HdmiTxSsPtr, 144 | EdidHdmi20 *CheckHdmi20Param); 145 | 146 | void EDIDConnectInit(EdidHdmi20 *CheckHdmi20Param); 147 | void SinkCapWarningMsg(EdidHdmi20 *CheckHdmi20Param); 148 | void SinkCapabilityCheck(EdidHdmi20 *CheckHdmi20Param); 149 | #endif 150 | #ifdef __cplusplus 151 | } 152 | #endif 153 | 154 | #endif /* _XHDMI_EDID_H_ */ 155 | -------------------------------------------------------------------------------- /Vitis/common/src/pipe.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Opsero Electronic Design Inc. Copyright 2025 3 | * 4 | * The functions in this module allow for initialization of the video pipe and starting of 5 | * the video pipe. 6 | */ 7 | 8 | #include "xstatus.h" 9 | #include "xil_printf.h" 10 | #include "i2c.h" 11 | #include "sleep.h" 12 | #include "xv_frmbufrd_l2.h" 13 | #include "xv_frmbufwr_l2.h" 14 | #include "xv_demosaic.h" 15 | #include "xv_gamma_lut.h" 16 | #include "xvprocss_vdma.h" 17 | #include "pipe.h" 18 | #include "math.h" 19 | #include "config.h" 20 | 21 | /* 22 | * Initialize the video pipe 23 | */ 24 | int pipe_init(VideoPipe *pipe, VideoPipeBaseAddr *baseaddr) 25 | { 26 | XVprocSs_Config *VprocSsConfigPtr; 27 | int Status; 28 | 29 | /* 30 | * Initialize the GPIO driver 31 | */ 32 | Status = XGpio_Initialize(&(pipe->Gpio), baseaddr->Gpio); 33 | if (Status != XST_SUCCESS) { 34 | xil_printf("Gpio Initialization Failed\r\n"); 35 | return XST_FAILURE; 36 | } 37 | 38 | // Set GPIO directions (1=input, 0=output) 39 | XGpio_SetDataDirection(&(pipe->Gpio), 1, 0); 40 | // Enable the camera and hold all video pipe elements in reset 41 | XGpio_DiscreteWrite(&(pipe->Gpio), 1, GPIO_CAM_IO0_MASK); 42 | usleep(10000); 43 | 44 | /* 45 | * Initialize the IIC for communication with camera 46 | */ 47 | u8 iic_id; 48 | Status = IicAxiInit(&(pipe->Iic),baseaddr->Iic,&iic_id); 49 | if (Status != XST_SUCCESS) { 50 | xil_printf("Failed to initialize the I2C\n\r"); 51 | return XST_FAILURE; 52 | } 53 | 54 | /* 55 | * Initialize the camera 56 | * This function will initialize the Camera container and try to communicate with the image sensor 57 | * via the I2C bus so that we know what model it is and thus configure the Sensor Demosaic 58 | * accordingly. 59 | */ 60 | Status = rpi_cam_init(&(pipe->Camera),iic_id,&(pipe->Gpio),GPIO_CAM_IO0_MASK); 61 | if(Status == XST_FAILURE) { 62 | pipe->IsConnected = FALSE; 63 | return(XST_FAILURE); 64 | } 65 | 66 | // Disable the camera while we setup the video pipe and until we use the pipe_start_camera function 67 | XGpio_DiscreteClear(&(pipe->Gpio), 1, GPIO_CAM_IO0_MASK); 68 | 69 | /* 70 | * Frame Buffer Wr/Rd initialization and config 71 | */ 72 | pipe_reset_deassert(pipe,GPIO_CAM_FRMBUFWR_RST_N_MASK); 73 | Status = FrmbufWrInit(&(pipe->Frmbuf),baseaddr->FrmbufWr,baseaddr->FrmbufBufrBaseAddr); 74 | if (Status != XST_SUCCESS) { 75 | xil_printf("Failed to initialize the Frame Buffer Write\n\r"); 76 | return XST_FAILURE; 77 | } 78 | pipe_reset_deassert(pipe,GPIO_CAM_FRMBUFRD_RST_N_MASK); 79 | Status = FrmbufRdInit(&(pipe->Frmbuf),baseaddr->FrmbufRd,baseaddr->FrmbufBufrBaseAddr); 80 | if (Status != XST_SUCCESS) { 81 | xil_printf("Failed to initialize the Frame Buffer Read\n\r"); 82 | return XST_FAILURE; 83 | } 84 | 85 | /* 86 | * Video Processor Subsystem initialization and config 87 | */ 88 | pipe_reset_deassert(pipe,GPIO_CAM_VPROC_RST_N_MASK); 89 | VprocSsConfigPtr = XVprocSs_LookupConfig(baseaddr->Vproc); 90 | if(VprocSsConfigPtr == NULL) { 91 | xil_printf("ERROR: Video Processor Subsystem device not found\r\n"); 92 | return(XST_FAILURE); 93 | } 94 | // Start capturing event log 95 | XVprocSs_LogReset(&(pipe->Vproc)); 96 | Status = XVprocSs_CfgInitialize(&(pipe->Vproc), 97 | VprocSsConfigPtr, 98 | VprocSsConfigPtr->BaseAddress); 99 | if(Status != XST_SUCCESS) { 100 | xil_printf("ERROR: Video Processing Subsystem Init. error\n\r"); 101 | return(XST_FAILURE); 102 | } 103 | 104 | // Configure the Video Processing Subsystem INPUT stream parameters 105 | XVidC_VideoMode resIdIn = XVidC_GetVideoModeId(VMODE_WIDTH,VMODE_HEIGHT,VMODE_FRAMERATE,FALSE); 106 | XVidC_VideoTiming const *TimingInPtr = XVidC_GetTimingInfo(resIdIn); 107 | XVidC_VideoStream StreamIn; 108 | StreamIn.VmId = resIdIn; 109 | StreamIn.Timing = *TimingInPtr; 110 | StreamIn.ColorFormatId = COLOR_FORMAT_ID; 111 | StreamIn.ColorDepth = pipe->Vproc.Config.ColorDepth; 112 | StreamIn.PixPerClk = pipe->Vproc.Config.PixPerClock; 113 | StreamIn.FrameRate = XVidC_GetFrameRate(resIdIn); 114 | StreamIn.IsInterlaced = XVidC_IsInterlaced(resIdIn); 115 | XVprocSs_SetVidStreamIn(&(pipe->Vproc), &StreamIn); 116 | 117 | // Configure the Video Processing Subsystem OUTPUT stream parameters 118 | XVidC_VideoMode resIdOut = XVidC_GetVideoModeId(VPROC_WIDTH_OUT,VPROC_HEIGHT_OUT,VPROC_FRAMERATE_OUT,FALSE); 119 | XVidC_VideoTiming const *TimingOutPtr = XVidC_GetTimingInfo(resIdOut); 120 | XVidC_VideoStream StreamOut; 121 | StreamOut.VmId = resIdOut; 122 | StreamOut.Timing = *TimingOutPtr; 123 | StreamOut.ColorFormatId = COLOR_FORMAT_ID; 124 | StreamOut.ColorDepth = pipe->Vproc.Config.ColorDepth; 125 | StreamOut.PixPerClk = pipe->Vproc.Config.PixPerClock; 126 | StreamOut.FrameRate = XVidC_GetFrameRate(resIdOut); 127 | StreamOut.IsInterlaced = XVidC_IsInterlaced(resIdOut); 128 | XVprocSs_SetVidStreamOut(&(pipe->Vproc), &StreamOut); 129 | 130 | // Start the Video Processor Subsystem 131 | Status = XVprocSs_SetSubsystemConfig(&(pipe->Vproc)); 132 | if (Status != XST_SUCCESS) { 133 | xil_printf("ERROR: Failed to start the Video Processing SS\n\r"); 134 | return XST_FAILURE; 135 | } 136 | XVprocSs_Start(&(pipe->Vproc)); 137 | 138 | /* 139 | * Demosaic initialization and config 140 | */ 141 | pipe_reset_deassert(pipe,GPIO_CAM_DEMOSAIC_RST_N_MASK); 142 | Status = XV_demosaic_Initialize(&(pipe->Demosaic), baseaddr->Demosaic); 143 | if (Status != XST_SUCCESS) { 144 | xil_printf("ERROR: Failed to initialize the Demosaic\n\r"); 145 | return XST_FAILURE; 146 | } 147 | XV_demosaic_Set_HwReg_width(&(pipe->Demosaic), VMODE_WIDTH); 148 | XV_demosaic_Set_HwReg_height(&(pipe->Demosaic), VMODE_HEIGHT); 149 | XV_demosaic_Set_HwReg_bayer_phase(&(pipe->Demosaic), rpi_cam_bayer_phase(&(pipe->Camera))); 150 | XV_demosaic_EnableAutoRestart(&(pipe->Demosaic)); 151 | XV_demosaic_Start(&(pipe->Demosaic)); 152 | 153 | /* 154 | * Gamma LUT initialization and config 155 | */ 156 | pipe_reset_deassert(pipe,GPIO_CAM_GAMMA_RST_N_MASK); 157 | Status = XV_gamma_lut_Initialize(&(pipe->GammaLut), baseaddr->GammaLut); 158 | if (Status != XST_SUCCESS) { 159 | xil_printf("ERROR: Failed to initialize the Gamma LUT\n\r"); 160 | return XST_FAILURE; 161 | } 162 | XV_gamma_lut_Set_HwReg_width(&(pipe->GammaLut), VMODE_WIDTH); 163 | XV_gamma_lut_Set_HwReg_height(&(pipe->GammaLut), VMODE_HEIGHT); 164 | XV_gamma_lut_Set_HwReg_video_format(&(pipe->GammaLut), 0); 165 | for(uint32_t i = 0; i < GAMMA_TABLE_SIZE; i++) 166 | { 167 | uint16_t value = pow((i / (double)GAMMA_TABLE_SIZE), GAMMA) * (float)GAMMA_TABLE_SIZE; 168 | Xil_Out16((pipe->GammaLut.Config.BaseAddress + 0x800 + i*2), value ); 169 | Xil_Out16((pipe->GammaLut.Config.BaseAddress + 0x1000 + i*2), value ); 170 | Xil_Out16((pipe->GammaLut.Config.BaseAddress + 0x1800 + i*2), value ); 171 | } 172 | XV_gamma_lut_Start(&(pipe->GammaLut)); 173 | XV_gamma_lut_EnableAutoRestart(&(pipe->GammaLut)); 174 | 175 | pipe->IsConnected = TRUE; 176 | 177 | return(XST_SUCCESS); 178 | } 179 | 180 | int pipe_start_camera(VideoPipe *pipe) 181 | { 182 | int Status; 183 | 184 | // Start the RPi camera 185 | Status = rpi_cam_config(&(pipe->Camera)); 186 | if (Status != XST_SUCCESS) { 187 | xil_printf("ERROR: Failed to configure the camera\n\r"); 188 | return XST_FAILURE; 189 | } 190 | // Start the Frame buffers 191 | Status = FrmbufStart(&(pipe->Frmbuf)); 192 | return(Status); 193 | } 194 | 195 | -------------------------------------------------------------------------------- /docs/source/build_instructions.md: -------------------------------------------------------------------------------- 1 | # Build instructions 2 | 3 | ## Source code 4 | 5 | The source code for the reference designs is managed on this Github repository: 6 | 7 | * [https://github.com/fpgadeveloper/rpi-camera-fmc](https://github.com/fpgadeveloper/rpi-camera-fmc) 8 | 9 | As this repository has submodules, you must clone the repository with the `--recursive` option as below: 10 | ``` 11 | git clone --recursive https://github.com/fpgadeveloper/rpi-camera-fmc.git 12 | ``` 13 | 14 | ## License requirements 15 | 16 | The designs for all of the [target boards](supported_carriers) except the ZCU102 can be built with the Vivado ML Standard 17 | Edition **without a license**. 18 | 19 | The ZCU102 board is not supported by the Vivado ML Standard Edition (aka. the Webpack or free version) 20 | so to build the designs for the ZCU102 board, you will need to either buy a license or download 21 | a 30-day evaluation license for Vivado ML Enterprise Edition. 22 | 23 | (target-designs)= 24 | ## Target designs 25 | 26 | This repo contains several designs that target the various supported development boards and their 27 | FMC connectors. The table below lists the target design name, the camera ports supported by the design and 28 | the FMC connector on which to connect the RPi Camera FMC. The VCU column indicates which designs contain 29 | the Video Codec Unit and which do not. 30 | 31 | {% for group in data.groups %} 32 | {% set designs_in_group = [] %} 33 | {% for design in data.designs %} 34 | {% if design.group == group.label and design.publish %} 35 | {% set _ = designs_in_group.append(design.label) %} 36 | {% endif %} 37 | {% endfor %} 38 | {% if designs_in_group | length > 0 %} 39 | ### {{ group.name }} designs 40 | 41 | | Target board | Target design | Cameras | FMC Slot | VCU | Vivado
Edition | 42 | |---------------------|-------------------|---------|-------------|-----|-----| 43 | {% for design in data.designs %}{% if design.group == group.label and design.publish %}| [{{ design.board }}]({{ design.link }}) | `{{ design.label }}` | {{ design.cams | length }} | {{ design.connector }} | {% if design.vcu %} ✅ {% else %} ❌ {% endif %} | {{ "Enterprise" if design.license else "Standard 🆓" }} | 44 | {% endif %}{% endfor %} 45 | {% endif %} 46 | {% endfor %} 47 | 48 | Notes: 49 | 1. The Vivado Edition column indicates which designs are supported by the Vivado *Standard* Edition, the 50 | FREE edition which can be used without a license. Vivado *Enterprise* Edition requires 51 | a license however a 30-day evaluation license is available from the AMD Xilinx Licensing site. 52 | 2. The HPC1 connector of the ZCU102 board can only support 2 cameras due to it's pin assignment. This design uses 53 | `CAM0` and `CAM1` as labelled on the RPi Camera FMC. 54 | 3. The `pynqzu` target design has video pipelines for only 2 cameras: `CAM1` and `CAM2` as 55 | labelled on the RPi Camera FMC. This is due to the resource limitations of the device on this board. 56 | 57 | ## Linux only 58 | 59 | These projects can be built using a machine (either physical or virtual) with one of the 60 | [supported Linux distributions]. 61 | 62 | ```{tip} The build steps can be completed in the order shown below, or 63 | you can go directly to the [build PetaLinux](#build-petalinux-project) instructions below 64 | to build the Vivado and PetaLinux projects with a single command. 65 | ``` 66 | 67 | ### Build Vivado project 68 | 69 | 1. Open a command terminal and launch the setup script for Vivado: 70 | ``` 71 | source /2024.1/settings64.sh 72 | ``` 73 | 2. Clone the Git repository and `cd` into the `Vivado` folder of the repo: 74 | ``` 75 | git clone --recursive https://github.com/fpgadeveloper/rpi-camera-fmc.git 76 | cd rpi-camera-fmc/Vivado 77 | ``` 78 | 3. Run make to create the Vivado project for the target board. You must replace `` with a valid 79 | target (alternatively, skip to step 5): 80 | ``` 81 | make project TARGET= 82 | ``` 83 | Valid target labels are: 84 | {% for design in data.designs if design.publish %} `{{ design.label }}`{{ ", " if not loop.last else "." }} {% endfor %} 85 | That will create the Vivado project and block design without generating a bitstream or exporting to XSA. 86 | 4. Open the generated project in the Vivado GUI and click **Generate Bitstream**. Once the build is 87 | complete, select **File->Export->Export Hardware** and be sure to tick **Include bitstream** and use 88 | the default name and location for the XSA file. 89 | 5. Alternatively, you can create the Vivado project, generate the bitstream and export to XSA (steps 3 and 4), 90 | all from a single command: 91 | ``` 92 | make xsa TARGET= 93 | ``` 94 | 95 | (build-petalinux-project)= 96 | ### Build PetaLinux project 97 | 98 | These steps will build the PetaLinux project for the target design. You are not required to have built the 99 | Vivado design before following these steps, as the Makefile triggers the Vivado build for the corresponding 100 | design if it has not already been done. 101 | 102 | 1. Launch the setup script for Vivado (only if you skipped the Vivado build steps above): 103 | ``` 104 | source /2024.1/settings64.sh 105 | ``` 106 | 2. Launch PetaLinux by sourcing the `settings.sh` bash script, eg: 107 | ``` 108 | source /2024.1/settings.sh 109 | ``` 110 | 3. Build the PetaLinux project for your specific target platform by running the following 111 | command, replacing `` with a valid value from below: 112 | ``` 113 | cd PetaLinux 114 | make petalinux TARGET= 115 | ``` 116 | Valid target labels for PetaLinux projects are: 117 | {% for design in data.designs if design.petalinux and design.publish %} `{{ design.label }}`{{ ", " if not loop.last else "." }} {% endfor %} 118 | Note that if you skipped the Vivado build steps above, the Makefile will first generate and 119 | build the Vivado project, and then build the PetaLinux project. 120 | 121 | ### PetaLinux offline build 122 | 123 | If you need to build the PetaLinux projects offline (without an internet connection), you can 124 | follow these instructions. 125 | 126 | 1. Download the sstate-cache artefacts from the Xilinx downloads site (the same page where you downloaded 127 | PetaLinux tools). There are four of them: 128 | * aarch64 sstate-cache (for ZynqMP designs) 129 | * arm sstate-cache (for Zynq designs) 130 | * microblaze sstate-cache (for Microblaze designs) 131 | * Downloads (for all designs) 132 | 2. Extract the contents of those files to a single location on your hard drive, for this example 133 | we'll say `/home/user/petalinux-sstate`. That should leave you with the following directory 134 | structure: 135 | ``` 136 | /home/user/petalinux-sstate 137 | +--- aarch64 138 | +--- arm 139 | +--- downloads 140 | +--- microblaze 141 | ``` 142 | 3. Create a text file called `offline.txt` in the `PetaLinux` directory of the project repository. The file should contain 143 | a single line of text specifying the path where you extracted the sstate-cache files. In this example, the contents of 144 | the file would be: 145 | ``` 146 | /home/user/petalinux-sstate 147 | ``` 148 | It is important that the file contain only one line and that the path is written with NO TRAILING 149 | FORWARD SLASH. 150 | 151 | Now when you use `make` to build the PetaLinux projects, they will be configured for offline build. 152 | 153 | [supported Linux distributions]: https://docs.amd.com/r/en-US/ug1144-petalinux-tools-reference-guide/Setting-Up-Your-Environment 154 | 155 | --------------------------------------------------------------------------------